Re: Can't share elements between apps

2009-04-23 Thread Ernesto

no it doesn't

i'll re-check the file... maybe i mistyped something

thx for the help

On 23 Apr, 14:26, John Andersen  wrote:
> I just checked the source code, and CakePHP checkes for elements under
> each specified path, in the elements directory, so it should work, if
> you specify the view path to for example: "\mycommonparts\views" and
> all my common elements are placed in "\mycommonparts\views\elements"
> then it should work!
>
> Check out the source code at:
> "http://api.cakephp.org/view_source/view/#line-331";
>
> Enjoy,
>    John
>
> On Apr 23, 2:56 pm, Ernesto  wrote:
>
>
>
> > Hi John. Thx for the response.
>
> > i already checked this cookbook page but... there's no $elementPath :(
>
> > so i guessed "maybe cake will search for a "elements" subdir in
> > viewPath, as usually does with standard apps"...
>
> > but i had no luck T_T
>
> > PS: sry for my ultra-bad english lol
>
> > On 23 Apr, 08:46, John Andersen  wrote:
>
> > > Hi Ernesto
>
> > > Try look at this "http://book.cakephp.org/view/36/Additional-Class-
> > > Paths", maybe it may solve your issue :)
>
> > > Enjoy,
> > >    John
>
> > > On Apr 22, 5:13 pm, Ernesto  wrote:
>
> > > > Hello.
>
> > > > view sharing works, but not elements sharing
>
> > > > here's a snippet from my bootstrap.php
>
> > > > if (!defined('SHARED_ITEMS_FOLDER')) {
> > > >         define('SHARED_ITEMS_FOLDER',
> > > > CAKE_CORE_INCLUDE_PATH .'\shared_items');
>
> > > > }
>
> > > > $viewPaths = array(SHARED_ITEMS_FOLDER .'\views');
>
> > > > My webroot dir tree is this:
>
> > > > WebRoot
> > > >         cake
> > > >         apps
> > > >         shared_items
> > > >                 helpers
> > > >                 views
> > > >                         elements
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: cakephp auth component password field always empty why ??

2009-04-23 Thread John Andersen

Start from the View and move towards the Model:
1) Ensure that your input field is named "password" in your view.
Better yet, show us the form creation code!
2) In your controller, before you save, insert "debug($this->data);"
and watch for the password value! Make sure that the resulting array
looks something like:

array( 'Member' => array('password') ...

Check it and tell us if you found something wrong :)
Enjoy,
   John


On Apr 24, 7:11 am, Malcolm Krugger 
wrote:
> INSERT INTO `Member` (`username`, `password`, `firstname`, `lastname`,
> `emailid`) VALUES ('user34', NULL, 'sdafas', 'fasfa', 'sfasfas')
>
> Yes the password field is null in the SQL too
>
> Am I missing any configuration directive ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Call Validate routines manually from controller

2009-04-23 Thread John Andersen

The validation takes place using the model, so either you have to
define the model with validation definitions in it, or you have to
make the validation function yourself in the controller.

Look at "http://book.cakephp.org/view/125/Data-Validation"; for further
information on validation! It does not take a lot of time to define
it!

Enjoy,
   John

On Apr 24, 7:32 am, Temujin  wrote:
> I know this will make some MVC purists out there cringe, but is there
> a way to manually call Validate routines from within the controller?
>
> I have a simple form that needs to validate multiple email addresses
> and I don't want to make a model to handle just this one validation
> check.
>
> Trying the following:
> Validate::email($email)
>
> ... from the controller results in "Class 'Validate' not found".
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Error using find function on model

2009-04-23 Thread John Andersen

Yes, I got the name wrong :) And you are correct, better to "restart"
and follow the CakePHP naming conventions!
Enjoy,
   John

On Apr 24, 4:59 am, "Dr. Loboto"  wrote:
> On Apr 24, 2:25 am, John Andersen  wrote:
>
> > Based on what Dr. Loboto states, the model name is not the expected
> > one, so add:
>
> > var $uses = array('FondoFuncionale');
>
> > to your controller!
>
> No, don't right. To use model that efrainbss show, name should be
> "FondoFuncional". But I listed also tables names not just for
> information - I cannot predict what table efrainbss done for this
> model so there can be more errors.
>
> In this case much better redo all naming from scratch then connect 3
> bad named items - model, table and controller.
>
> > Enjoy,
> >    John
>
> > On Apr 23, 6:00 pm, "Dr. Loboto"  wrote:
>
> > > By convention model FondoFuncional refer to fondo_funcionals table and
> > > should be in file fondo_funcional.php Also by convention controller
> > > FondosFuncionales assume FondosFuncionale model as default, that refer
> > > to table fondos_funcionales and should be in file fondos_funcionale.php
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Call Validate routines manually from controller

2009-04-23 Thread Temujin

I know this will make some MVC purists out there cringe, but is there
a way to manually call Validate routines from within the controller?

I have a simple form that needs to validate multiple email addresses
and I don't want to make a model to handle just this one validation
check.

Trying the following:
Validate::email($email)

... from the controller results in "Class 'Validate' not found".
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: cakephp auth component password field always empty why ??

2009-04-23 Thread Malcolm Krugger

INSERT INTO `Member` (`username`, `password`, `firstname`, `lastname`,
`emailid`) VALUES ('user34', NULL, 'sdafas', 'fasfa', 'sfasfas')

Yes the password field is null in the SQL too

Am I missing any configuration directive ?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Error using find function on model

2009-04-23 Thread Dr. Loboto

On Apr 24, 2:25 am, John Andersen  wrote:
> Based on what Dr. Loboto states, the model name is not the expected
> one, so add:
>
> var $uses = array('FondoFuncionale');
>
> to your controller!

No, don't right. To use model that efrainbss show, name should be
"FondoFuncional". But I listed also tables names not just for
information - I cannot predict what table efrainbss done for this
model so there can be more errors.

In this case much better redo all naming from scratch then connect 3
bad named items - model, table and controller.

> Enjoy,
>    John
>
> On Apr 23, 6:00 pm, "Dr. Loboto"  wrote:
>
> > By convention model FondoFuncional refer to fondo_funcionals table and
> > should be in file fondo_funcional.php Also by convention controller
> > FondosFuncionales assume FondosFuncionale model as default, that refer
> > to table fondos_funcionales and should be in file fondos_funcionale.php
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: modifying a Baked function

2009-04-23 Thread brian

On Thu, Apr 23, 2009 at 11:17 AM, Teedaddy  wrote:
>
> hello friends, I am VERY new to all the cakePHP methods, so, any help
> would be much appreciated.
>
> I have built my database tables and have Baked all Models,
> Controllers, and Views. Everything is working as expected with the
> relations and interaction with the  db tables.
>
> I am now trying to customize the view, add, and edit functions. The
> main thing I need to do is make many of the views, User.id specific
> and can't for the life of me figure out the best way to do that.

Define "User.id specific". Do you mean that you need to save a user_id
foreign key with your data? Are you saving the user to a session when
logged in?

> Here is a sample of code of what I am trying to do. I just want the
> add form to grab the current User.id for saving to the database.
>
> function writer_add() {
>                if (!empty($this->data)) {
>                        $this->Writer->create();
>                        if ($this->Writer->save($this->data)) {
>                                $this->Session->setFlash(__('The Writer has 
> been saved', true));
>                                $this->redirect(array('action'=>'index'));
>                        } else {
>                                $this->Session->setFlash(__('The Writer could 
> not be saved.
> Please, try again.', true));
>                        }
>                }
>                $users = $this->Writer->User->find('first', array('User' =>
> 'User.id'));
>                $this->set(compact('users'));
>        }
>

This makes no sense. If you want find a *specific* ('first') User,
then you need to put 'User.id' on the left side and pass a $user_id on
the right. Also, though it's not too big a deal, I guess your var
should be $user, not $users.

Anyway, if you save the User to the session when they log in, you
won't need to do a find() here. Maybe you should explain what it is
you're trying to do.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Configuring CSS

2009-04-23 Thread brian

By default, your stylesheets should be in webroot/css.

On Thu, Apr 23, 2009 at 3:32 PM, christopher  wrote:
>
> Hi could anyone tell me how to use my own CSS style sheet in Cake
> PHP.  I have just started using CakePHP and am having difficulty.
> I have created teh default.ctp file in the web root and the CSS file
> in the views layout folder but I think  the default code is wrong.
>
> Would appreciate a simple guide on how to set it up.
>
> Thanks
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Model Association Not Creating Query Joins

2009-04-23 Thread Rob Wilkerson

I have an Alert model, an Account model and an AccountAlert model:

Alert hasMany AccountAlert
Account hasMany AccountAlert
AccountAlert belongsTo ( Alert, Account )

AccountAlert has several other defining fields, so it has its own
primary key in the database as well as being its own model. IOW, it's
more than a simple linking table. It has foreign keys to the alerts
and accounts tables (alert_id and account_id, respectively).

>From AccountModel, I'm trying to retrieve all of the Alerts for a
given Account.  If I try a simple find:

$this->Alert->find ( 'all' )

I get each Alert and each AccountAlert that has that alert. If,
however, I try to restrict by the account_id then I get an unknown
column error:

$alert_ids = $this->Alert->find (
'all',
array (
'conditions'=>  array (
'AccountAlert.account_id'  => $account_id
),
'fields'=>  array('id'),
)
);

Looking at the debug SQL, no join is being created. Since the model
associations are intact (I assume this is the case since the simple
find() returns data for both models), should CakePHP be building the
join automagically and, therefore, understanding the
AccountAlert.account_id syntax in my condition?

Even being relatively new to CakePHP, it still seems like I should
have run into this before, but I can't remember having seen this. Any
push in the right direction would be much appreciated.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Updating fields based upon a field in another table

2009-04-23 Thread smithtrev...@googlemail.com

Thanks for that, but I'm new to cakephp and I'm trying to translate
the SQL to fetch the key into cake, but as I said I'm new and not
exactly sure how to do it...

SELECT id FROM weeks WHERE now( ) BETWEEN start AND end;

So far, I have this...

$Week->findAll(array('now()' => 'BETWEEN start AND end'));

This comes up with an undefined variable error.
Any help would be great, thanks.








On Apr 23, 4:21 pm, brian  wrote:
> You could add the foreign key in a beforeSave() routine but, probably
> a much simpler way would be to fetch the key you want based on the
> date in your register action. Then add a hidden input to the form with
> that value.
>
> function register()
> {
>         if (!empty($this->data))
>         {
>
>         }
>
>         $this->set(
>                 'the_key',
>                 $this->Model->OtherModel->getYourKey()
>         );
>
> }
>
> echo $form->hidden('the_key', array('value' => $the_key));
>
> On Thu, Apr 23, 2009 at 11:50 AM, smithtrev...@googlemail.com
>
>  wrote:
>
> > It's part of the site logic. Everytime a new user registers, it needs
> > to be able to decide what week number (week_id), they are starting in
> > based on it being betweek the start and end date in another table.
>
> > On Apr 23, 3:44 pm, Faza  wrote:
> >> want to do it using Cake or just plain good ol' SQL? Also, is it a
> >> one-timer, or is it a part of your site logic?
>
> >> smithtrev...@googlemail.com pisze:
>
> >> > Hi,
> >> > I have a question, if I wanted to update a foreignkey field in a
> >> > table, based on a date range in another table (eg. it has an id,
> >> > startdate, enddate). How would I do that?
>
> >> > Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth performing logout Without Requesting It

2009-04-23 Thread Miles J

Try setting it to medium/low and see what happens.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: AppController does not load custom helpers

2009-04-23 Thread Miles J

Capitalize your helper names.

How is it not being loaded? Does $site->function() not work, or whats
your error?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Basic Security component problem

2009-04-23 Thread Miles J

If your using any javascript in your form, the security component will
always blackhole. You will need to put this in the beforeFilter().

$this->Security->validatePost = false;

But that will disable it for all actions, if you only want one:

if ($this->params['action'] == 'action') {
$this->Security->validatePost = false;
}
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Configuring CSS

2009-04-23 Thread Sam Sherlock
doctype('xhtml-trans') ?>
http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">

charset(); ?>

css($myCSS, Array('media' => 'screen'));
?>








when myCSS is an array of
- or -
single string referance to

css file(s)

if test.css is in css then your ref would be 'test' the file name minus
suffix or 'simple/test' if a directory in webroot/css simple contains the
test.css file.  or an array of strings

- S


2009/4/23 christopher 

> uld anyone tell me how to use my own CSS style sheet in Cake
> PHP.  I have just started using CakePHP and am having difficulty.
> I have created teh default.ctp file in the web root and the CSS file
> in the views layout folder but I think  the default code is
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Pagination with POST data

2009-04-23 Thread chopstik |/

Hi there, I struck the same issue with Paginator and no easy way to
preserve any form data posted by the original form when navigating
around subsequent pages. I wasn't keen to go down the route of
serialzing the posted data and re-directing to a new controller action
as described by Joe above. Instead I used the Session helper to store
the form data and test for it in each subsequent page delivered by the
Paginator. See below...

// the form has posted some search criteria, add it into the
$criteria_post array
if(!empty($this->data["Search"]["rate"])){
$criteria_post["Candidate.rate"] = $this->data["Search"]["rate"];
}

// read in the session variable
$criteria_session = $this->Session->read('Search.criteria');

if(!empty($this->data["Search"])){
$criteria = $criteria_post;
$this->Session->del('Search.criteria'); // we have new search
variables posted in, so remove the old session variable
$this->Session->write('Search.criteria',$criteria); //  then write a
fresh, new session variable
}elseif(!empty($criteria_session)){ // but if we have no new fresh
search criteria revert to any session search criteria
$criteria = $criteria_session;
}else{
$criteria = array();
}

// then pass the criteria, regardless of where its from into the
Paginator helper
$data = $this->paginate('Application', $criteria);

Worked for me anyway.  Hope it helps someone else.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Configuring CSS

2009-04-23 Thread christopher

Hi could anyone tell me how to use my own CSS style sheet in Cake
PHP.  I have just started using CakePHP and am having difficulty.
I have created teh default.ctp file in the web root and the CSS file
in the views layout folder but I think  the default code is wrong.

Would appreciate a simple guide on how to set it up.

Thanks

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: altered my folders-tree in app, now js in vendors don't work

2009-04-23 Thread Evert

Ok, this is a little weird.
Apparently it was /app/vendors/js/ instead of /app/vendors/javascript/
the vendors.php file confused me.
Sorry for wasting your time.
Please take the time though to look at
http://groups.google.com/group/cake-php/browse_thread/thread/4f1f5050f4d08280
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Error using find function on model

2009-04-23 Thread John Andersen

Based on what Dr. Loboto states, the model name is not the expected
one, so add:

var $uses = array('FondoFuncionale');

to your controller!
Enjoy,
   John

On Apr 23, 6:00 pm, "Dr. Loboto"  wrote:
> By convention model FondoFuncional refer to fondo_funcionals table and
> should be in file fondo_funcional.php Also by convention controller
> FondosFuncionales assume FondosFuncionale model as default, that refer
> to table fondos_funcionales and should be in file fondos_funcionale.php
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Steps Form

2009-04-23 Thread Mike

Thanks for the answers!
Keep the data in the session?, wow that's a very good idea!, i think
i'll do it that way.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



modifying a Baked function

2009-04-23 Thread Teedaddy

hello friends, I am VERY new to all the cakePHP methods, so, any help
would be much appreciated.

I have built my database tables and have Baked all Models,
Controllers, and Views. Everything is working as expected with the
relations and interaction with the  db tables.

I am now trying to customize the view, add, and edit functions. The
main thing I need to do is make many of the views, User.id specific
and can't for the life of me figure out the best way to do that.

Here is a sample of code of what I am trying to do. I just want the
add form to grab the current User.id for saving to the database.

function writer_add() {
if (!empty($this->data)) {
$this->Writer->create();
if ($this->Writer->save($this->data)) {
$this->Session->setFlash(__('The Writer has 
been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Writer could 
not be saved.
Please, try again.', true));
}
}
$users = $this->Writer->User->find('first', array('User' =>
'User.id'));
$this->set(compact('users'));
}

Thanks so much

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Plugin for MySQL Workbench: Who to contact?

2009-04-23 Thread Karsten Wutzke

I'm referring to

http://forums.mysql.com/read.php?155,258646,258824#msg-258824

The CakePHP plugin for MySQL Workbench is supposed to be working with
version 5.1, but it isn't.

Who do I contact to clear things up?

Karsten

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



DataGrid with sumarized row

2009-04-23 Thread Mauricio Tellez
Hi, I'm using the DataGrid to display sales info for several stores, but the
last row has the sales totals. Of course if I sort the grid, the totals rows
get sorted wich is very confusing. Is there a way to lock the last row when
sorting? Thanks in advance

-- 
Mauricio Tellez

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Paginating several elements

2009-04-23 Thread Evert

As I described in another post, I've created a cms which uses a lot of
plugins. And those plugins only have some models and elements.

So, say for example I have a page with some content (an article for
example) on it and comments below that article. Those are 2 separate
elements from 2 separate plugins.

Now, maybe both the article and the comments need paging. But how do I
do that? Cause, if I go to page 2 of the article and then to page 5 of
the comments, the article won't 'know' anymore it's on page 2...

Please some advice.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Updating fields based upon a field in another table

2009-04-23 Thread brian

You could add the foreign key in a beforeSave() routine but, probably
a much simpler way would be to fetch the key you want based on the
date in your register action. Then add a hidden input to the form with
that value.

function register()
{
if (!empty($this->data))
{

}

$this->set(
'the_key',
$this->Model->OtherModel->getYourKey()
);
}

echo $form->hidden('the_key', array('value' => $the_key));


On Thu, Apr 23, 2009 at 11:50 AM, smithtrev...@googlemail.com
 wrote:
>
> It's part of the site logic. Everytime a new user registers, it needs
> to be able to decide what week number (week_id), they are starting in
> based on it being betweek the start and end date in another table.
>
>
> On Apr 23, 3:44 pm, Faza  wrote:
>> want to do it using Cake or just plain good ol' SQL? Also, is it a
>> one-timer, or is it a part of your site logic?
>>
>> smithtrev...@googlemail.com pisze:
>>
>> > Hi,
>> > I have a question, if I wanted to update a foreignkey field in a
>> > table, based on a date range in another table (eg. it has an id,
>> > startdate, enddate). How would I do that?
>>
>> > Thanks.
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Model -> save problem

2009-04-23 Thread Frankaube

I found the problem actually. My form in my view didn't have the same
name as my model so when trying th match the fields it would'nt find
any matches.

Hope it helps anyone if they find this.

thanks

On Apr 23, 11:59 am, fain182  wrote:
> > Hi I'm new to cakephp and have problems saving my data.
>
> > When calling Model->save it never saves to the databases with no
> > errors.
>
> > cake is calling describe on the table but not running any inserts
> > after.
>
> > I have no validation rules and the save function is returning TRUE. I
> > can retreive information with Model->find and it works with the same
> > model.
>
> can you show us the form(in the view) and the code(in the controller)
> that saves data?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



altered my folders-tree in app, now js in vendors don't work

2009-04-23 Thread Evert

I'll describe what I did.

I created a cms-system which basically consists of a lot of plugins.
All plugins just have some models and some element-views. For example,
I have a plugin which basically enables you to put comments on a page.
Another plugin enables you to put content on a page. Another plugin is
a poll, another is a rating-box, etc etc

With that cms, I can create a whole new site with just a new database
and a new webroot to put the css-files and the images in.

So I had to alter my folders-tree in app. Now I don't have /app/
webroot/
I have /app/webroots/localhost/ and /app/webroots/example.com/ etc..
I changed some files like index.php in the webroots and the htaccess-
files etc so everything works, and it does work.

Now, when I use the html-helper or the javascript-helper to create a
link to my css file or my js-file it does create the right link.
However, I want some javascript-files to be in /app/vendors/javascript
instead of /app/webroots/localhost/js/
But for some reason that doesn't work.

When I do this:
echo $javascript->link('jquery');
it creates a link to /app/webroots/localhost/js/jquery.js but the file
isn't there. Now I think that at that moment vendors.php (which is in
that folder) should step in and get the file from /app/vendors/
javascript/, am I right? Well, it doesn't...
And yes, I have altered vendors.php as well so the paths match and it
should work...

What am I doing wrong?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



redirecting old site urls

2009-04-23 Thread Zoltan

Hello,

I have a site that's gone through 3 versions (pure PHP, Cake 1.1-
based, Cake 1.2 currently) and there are a number of these old urls
still being linked to so I'd like to catch these and re-direct them to
the new location.

About 99% of these are straight substitutions:
e.g. /page.php?id=123§ionId=8 => /reviews/news_article

I came up with using the router::connect and that seems to work, but
I'd really like to send a 301 to tell Google that the pages have
really moved, so I'm thinking of use .htaccess, the thing is I can't
figure out which .htaccess file to add the redirects to (and how to
not clash with CakePHP's own RewriteRules

Most of the urls are pretty simple:
e.g.
RewriteRule  ^page\.php?id=123§ionId=8$ /reviews/news_article
[R=301 NC L]

Any help would be appreciated,
Zoltan

twitter: ZedGuy
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: multirecord form and retaining data on refresh

2009-04-23 Thread brian

Do it with javascript. With something like jQuery, this is very easily achieved.

On Thu, Apr 23, 2009 at 4:27 AM, wendell.mal...@gmail.com
 wrote:
>
> I am planning to have a recipe submission on my website using
> multirecord form. I want to add a inputbox on the fly as the user want
> to add additional recipe instruction and at the same time, I don't
> them losing the data they have entered if refreshed or accidentally
> refreshed. Is this something that the CakePHP can achieve?
>
> Thank you for your time.
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Updating fields based upon a field in another table

2009-04-23 Thread smithtrev...@googlemail.com

It's part of the site logic. Everytime a new user registers, it needs
to be able to decide what week number (week_id), they are starting in
based on it being betweek the start and end date in another table.


On Apr 23, 3:44 pm, Faza  wrote:
> want to do it using Cake or just plain good ol' SQL? Also, is it a
> one-timer, or is it a part of your site logic?
>
> smithtrev...@googlemail.com pisze:
>
> > Hi,
> > I have a question, if I wanted to update a foreignkey field in a
> > table, based on a date range in another table (eg. it has an id,
> > startdate, enddate). How would I do that?
>
> > Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Merge results of model->findAll with an array returned by function

2009-04-23 Thread brian

2009/4/23 Faza :
>
> Hi all,
>
> more newbie questions on the way.
>
> I have few models related (mostly $belongsTo), and one of them requires a 
> level 3 recursion, which is not-a-very-good practice. Especially that 
> enabling lvl 3 recursion gathers much more data from the model than I really 
> need.
>
> Therefore I thought that I could extend the model using some function to get 
> the data I need, and then merge it with the result of findAll.
>
> The problem is, I don't have a clue where to start.

Have you had a look at ContainableBehavior? I'd bet using that would
be a lot easier.

>
> 1st of all, how to make Cake run my function each iteration of the "foreach 
> $results as $result"? I need this, because - obviously - I have to pass the 
> id of each row to the function.

Not necessarily. You could extract the IDs with one call using Set
class and then make one query using the resulting array.

$foreign_keys = Set::extract($results, '{n}.SomeModel.id');

I still think you should be using contain, though, and avoiding the
need for any of this.
>
> ...
>
> What I want to get, is that result of findAll will be expanded with the above 
> fields.
>
> Plz bear with my newbieness and ask away if there's something I didn't 
> describe good enough to be understood.

You haven't given any indication of the *other* data, the initial find
you're making, nor how all of these models are associated. There's not
much to go on.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Updating fields based upon a field in another table

2009-04-23 Thread Faza

want to do it using Cake or just plain good ol' SQL? Also, is it a 
one-timer, or is it a part of your site logic?

smithtrev...@googlemail.com pisze:
> Hi,
> I have a question, if I wanted to update a foreignkey field in a
> table, based on a date range in another table (eg. it has an id,
> startdate, enddate). How would I do that?
>
> Thanks.
> >
>
>   


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Basic Security component problem

2009-04-23 Thread brian

I haven't used FCK in some time and don't remember the details, but
it's possible that it's adding a new form element along with all of
the other page elements it creates.This would cause Security to
blackhole your submission. You could check for this by disabling
Security and checking $data after submit:

if (!empty($this->data))
{
Debugger::log($this->data);
// or die(debug($this->data));

If there's anything in there that's unexpected you could tell Security
to ignore it.

On Thu, Apr 23, 2009 at 8:02 AM, toby1kenobi  wrote:
>
> Anyone see (or think of) anything that might be causing my issue?
>
> Cheers,
>
> Toby
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Updating fields based upon a field in another table

2009-04-23 Thread smithtrev...@googlemail.com

Hi,
I have a question, if I wanted to update a foreignkey field in a
table, based on a date range in another table (eg. it has an id,
startdate, enddate). How would I do that?

Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Merge results of model->findAll with an array returned by function

2009-04-23 Thread Faza

Shit,

i've made mistake on describing the resulting array.
Of course all arrays (new, assigned, editing) are sub-arrays of [0].
sorry for the mixup

Faza pisze:
> Hi all,
>
> more newbie questions on the way.
>
> I have few models related (mostly $belongsTo), and one of them requires a 
> level 3 recursion, which is not-a-very-good practice. Especially that 
> enabling lvl 3 recursion gathers much more data from the model than I really 
> need.
>
> Therefore I thought that I could extend the model using some function to get 
> the data I need, and then merge it with the result of findAll.
>
> The problem is, I don't have a clue where to start.
>
> 1st of all, how to make Cake run my function each iteration of the "foreach 
> $results as $result"? I need this, because - obviously - I have to pass the 
> id of each row to the function.
>
> 2nd, the function will return a leveled array, like this:
>
> Array
> (
> [0] => Array
> (
> [New] => Array
>   (
>   Since => 2009-04-20,
>   Changer => John Doe
>   )
> [1] => Array
> (
> [Assigned] => Array
>   (
>   Since => 2009-04-22,
>   Changer => Ed Smith
>   )
>
> [3] => Array
> (
> [Editing] => Array
>   (
>   Since => 2009-04-23,
>   Changer => Mark Adams
>   )
>
> )
>
> etc etc
>
> What I want to get, is that result of findAll will be expanded with the above 
> fields.
>
> Plz bear with my newbieness and ask away if there's something I didn't 
> describe good enough to be understood.
>
> Thanks in advance.
>
>
> >
>
>   


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Merge results of model->findAll with an array returned by function

2009-04-23 Thread Faza

Hi all,

more newbie questions on the way.

I have few models related (mostly $belongsTo), and one of them requires a level 
3 recursion, which is not-a-very-good practice. Especially that enabling lvl 3 
recursion gathers much more data from the model than I really need.

Therefore I thought that I could extend the model using some function to get 
the data I need, and then merge it with the result of findAll.

The problem is, I don't have a clue where to start.

1st of all, how to make Cake run my function each iteration of the "foreach 
$results as $result"? I need this, because - obviously - I have to pass the id 
of each row to the function.

2nd, the function will return a leveled array, like this:

Array
(
[0] => Array
(
[New] => Array
(
Since => 2009-04-20,
Changer => John Doe
)
[1] => Array
(
[Assigned] => Array
(
Since => 2009-04-22,
Changer => Ed Smith
)

[3] => Array
(
[Editing] => Array
(
Since => 2009-04-23,
Changer => Mark Adams
)

)

etc etc

What I want to get, is that result of findAll will be expanded with the above 
fields.

Plz bear with my newbieness and ask away if there's something I didn't describe 
good enough to be understood.

Thanks in advance.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Error using find function on model

2009-04-23 Thread Dr. Loboto

By convention model FondoFuncional refer to fondo_funcionals table and
should be in file fondo_funcional.php Also by convention controller
FondosFuncionales assume FondosFuncionale model as default, that refer
to table fondos_funcionales and should be in file fondos_funcionale.php
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Model -> save problem

2009-04-23 Thread fain182

> Hi I'm new to cakephp and have problems saving my data.
>
> When calling Model->save it never saves to the databases with no
> errors.
>
> cake is calling describe on the table but not running any inserts
> after.
>
> I have no validation rules and the save function is returning TRUE. I
> can retreive information with Model->find and it works with the same
> model.

can you show us the form(in the view) and the code(in the controller)
that saves data?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: MVC question: convert DB data to human-readable format: where?

2009-04-23 Thread fain182

On Thu, Apr 23, 2009 at 4:08 PM, Ernesto  wrote:
>
> hello
>
> i'm wondering what's the best place to convert DB data in human-
> readable format.
>
> right now i'm using some routines in AppModel::afterFind and in
> AppModel::beforeDelete.
>
> These functions are working correctly but... formatting data in model
> doesn't sound very MVC-ish to me.
>
> So.. i was wondering... wich way is the most coherent with MVC
> pattern?
why not in the view? maybe in an element?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Help Me!

2009-04-23 Thread Brendon Kozlowski

http://lmgtfy.com/?q=cakephp+on+xampp

On Apr 23, 9:36 am, Sam Sherlock  wrote:
> yes but a email entitled help me and asking quite a basic question with no
> background about what you have tried - error messages you have got - or
> resources you have learnt from is not helpful for anyone helping you
>
> is your db working?
> is .htaccess working? if not use cakes internal rewriting system & remove
> .htaccess
> is php working?
> have you tried searching for other who have been in your position?
>  eg less than 2 second googling gete me 
> thesehttp://kumaresan1024.wordpress.com/2008/04/19/configuring-cake-php-in...http://practicaltechniques.com/2008/04/28/setting-up-cakephp-with-xampp/
>
> are you new to php also?
> have you read book.cakephp.org?
> can you turn debug on?
>
> cake will give you informative debug information even code & content with
> line numbers
>
> - S
>
> 2009/4/23 yuva 
>
>
>
>
>
> > Hi.. all am new to cake php..
>
> > here comes my problem..
>
> > i ve installed xampp... n i want to install cake php.. is it
> > possible.. to do tat.. plz anyone guide me.. to do tat..  thanks in
> > advance..- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Best way to mix PHP+HTML+Javascript in View classes???

2009-04-23 Thread mixersoft

I'm comfortable writing PHP+Html Views, but now I need to build a big,
fancy web-enable photo management app and I think I need to go with a
Javascript/AJAX framework. I'm looking at YUI in this case.

But Javascript was never one of my strong suits, and when I start
comparing writing simple Html to YUI/Javascript/DOM UI components, my
head starts to spin.

Can someone share some best practices on mixing Javascript frameworks
with PHP+html in Views? My first thought is to use PHP to dump all the
View variables into Javascript ,and then build the page entirely by
manipulating DOM objects in Javascript? Are there better approaches?

Thanks.

m.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



MVC question: convert DB data to human-readable format: where?

2009-04-23 Thread Ernesto

hello

i'm wondering what's the best place to convert DB data in human-
readable format.

right now i'm using some routines in AppModel::afterFind and in
AppModel::beforeDelete.

These functions are working correctly but... formatting data in model
doesn't sound very MVC-ish to me.

So.. i was wondering... wich way is the most coherent with MVC
pattern?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: AppController does not load custom helpers

2009-04-23 Thread ezekfred

Hi Sytze,

sure, you're calling a helper in a controller...

here's something not very cakish (not MVC) but it works:
  App::import('Helper', 'Site');
  $mysite = new SiteHelper();

  $mysite->myfonction...

bye,


On Apr 23, 10:42 am, Sytze Loor  wrote:
> Hi,
> Although I found a workaround for this problem, I'm not really happy
> about it.
> In my AppController is have this:
> [code]
> class AppController extends Controller {
>   var $helpers = array('javascript', 'form', 'html', 'number', 'time',
> 'site');
>   function beforeFilter() {
>     Configure::load('site_config/config');
>   }}
>
> [/code]
>
> The SiteHelper (last in the helpers array), I've build myself.
>
> However, when I try this, the SiteHelper (or any custom build helper)
> is not being loaded.
>
> I also have a beforeFilter as you can see. When I place echo('test')
> in it, the SiteHelper is being loaded and everything works out as it's
> supposed to.
>
> My questions are simple; am I doing something wrong and is there a way
> to fix this properly?
>
> Here is my full code:
> [code]
> class AppController extends Controller {
>   var $helpers = array('javascript', 'form', 'html', 'number', 'time',
> 'site');
>   function beforeFilter() {
>     Configure::load('site_config/config');
>   }}
>
> [/code]
>
> Thank you in advance!
>
> Sytze Loor
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Help Me!

2009-04-23 Thread Sam Sherlock
yes but a email entitled help me and asking quite a basic question with no
background about what you have tried - error messages you have got - or
resources you have learnt from is not helpful for anyone helping you

is your db working?
is .htaccess working? if not use cakes internal rewriting system & remove
.htaccess
is php working?
have you tried searching for other who have been in your position?
 eg less than 2 second googling gete me these
http://kumaresan1024.wordpress.com/2008/04/19/configuring-cake-php-in-xampp/
http://practicaltechniques.com/2008/04/28/setting-up-cakephp-with-xampp/

are you new to php also?
have you read book.cakephp.org?
can you turn debug on?

cake will give you informative debug information even code & content with
line numbers

- S


2009/4/23 yuva 

>
> Hi.. all am new to cake php..
>
> here comes my problem..
>
> i ve installed xampp... n i want to install cake php.. is it
> possible.. to do tat.. plz anyone guide me.. to do tat..  thanks in
> advance..
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Basics, models + associations

2009-04-23 Thread holub.mic...@gmail.com

Just started with Cake for one simle app - online daily menu editor.
Briefly. One menu has many menu items. One menu item = one dish. one
dish = one dish type. There are 9 dish types (it's an indian
restaurant, so it's rice, naan, curry, veg. curry etc). Here is the db
structure

CREATE TABLE `dish_types`
(
  `id` int(11) NOT NULL
auto_increment,
  `name` varchar(100) collate utf8_czech_ci NOT
NULL,
  PRIMARY KEY
(`id`)
)

CREATE TABLE `dishes`
(
  `id` int(11) NOT NULL
auto_increment,
  `name_en` text collate utf8_czech_ci NOT
NULL,
  `name_cs` text collate utf8_czech_ci NOT
NULL,
  `dish_type_id` int(11) NOT
NULL,
  PRIMARY KEY
(`id`),
  KEY `NewIndex1`
(`dish_type_id`),
  CONSTRAINT `FK_dishes` FOREIGN KEY (`dish_type_id`)
REFERENCES `dish_types` (`id`) ON DELETE CASCADE
)

CREATE TABLE `menu_items`
(
  `id` int(11) NOT NULL
auto_increment,
  `menu_id` int(11) NOT
NULL,
  `dish_id` int(11) NOT
NULL,
  PRIMARY KEY
(`id`),
  KEY `NewIndex1`
(`menu_id`),
  KEY `NewIndex2`
(`dish_id`),
  CONSTRAINT `FK_menu_items` FOREIGN KEY (`dish_id`)
REFERENCES `dishes` (`id`) ON DELETE CASCADE,
  CONSTRAINT `FK_menu_items1` FOREIGN KEY (`menu_id`)
REFERENCES `menus` (`id`) ON DELETE CASCADE
)

CREATE TABLE `menus` (
  `id` int(11) NOT NULL auto_increment,
  `created` timestamp NOT NULL default CURRENT_TIMESTAMP,
  `forday` date NOT NULL,
  PRIMARY KEY  (`id`)
)


Here is how I define model associations

class Menu extends AppModel {
var $hasMany = array(
'MenuItem' => array(
'className' => 'MenuItem',
'order' => 'Dish.dish_type_id asc'
)
);
}

class Dish extends AppModel {
var $belongsTo = 'DishType';
}

class MenuItem extends AppModel {
var $hasOne = 'Dish';
}

Now my trouble begin. I have a controller MenusController and an
action create. In the view create.ctp I want to see one date field
(that works) and 9 select fields to choose the 9 dishes for the day.
Now the question.
How do I automagically create the 9 select fields. I understand the
mechanism for 1 attribute, ie. if I do in controller $this->set
('dishes', $this->Dish->find('list'));
and in the view  echo $form->input('Dish'); the select is there and
filled as expected.
But how to show 9 of them, each having only a subset of dishes. first
only rice, second naan etc)?

What I do now, is that in the view I manually render, using $form-
>select all 9 selects. But I feel that this is not exactly how is cake
supposed to be used.

Thanks, Michal

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Basics, models + associations

2009-04-23 Thread holub.mic...@gmail.com

Just started with Cake for one simle app - online daily menu editor.
Briefly. One menu has many menu items. One menu item = one dish. one
dish = one dish type. There are 9 dish types (it's an indian
restaurant, so it's rice, naan, curry, veg. curry etc). Here is the db
structure

CREATE TABLE `dish_types`
(
  `id` int(11) NOT NULL
auto_increment,
  `name` varchar(100) collate utf8_czech_ci NOT
NULL,
  PRIMARY KEY
(`id`)
)

CREATE TABLE `dishes`
(
  `id` int(11) NOT NULL
auto_increment,
  `name_en` text collate utf8_czech_ci NOT
NULL,
  `name_cs` text collate utf8_czech_ci NOT
NULL,
  `dish_type_id` int(11) NOT
NULL,
  PRIMARY KEY
(`id`),
  KEY `NewIndex1`
(`dish_type_id`),
  CONSTRAINT `FK_dishes` FOREIGN KEY (`dish_type_id`)
REFERENCES `dish_types` (`id`) ON DELETE CASCADE
)

CREATE TABLE `menu_items`
(
  `id` int(11) NOT NULL
auto_increment,
  `menu_id` int(11) NOT
NULL,
  `dish_id` int(11) NOT
NULL,
  PRIMARY KEY
(`id`),
  KEY `NewIndex1`
(`menu_id`),
  KEY `NewIndex2`
(`dish_id`),
  CONSTRAINT `FK_menu_items` FOREIGN KEY (`dish_id`)
REFERENCES `dishes` (`id`) ON DELETE CASCADE,
  CONSTRAINT `FK_menu_items1` FOREIGN KEY (`menu_id`)
REFERENCES `menus` (`id`) ON DELETE CASCADE
)

CREATE TABLE `menus` (
  `id` int(11) NOT NULL auto_increment,
  `created` timestamp NOT NULL default CURRENT_TIMESTAMP,
  `forday` date NOT NULL,
  PRIMARY KEY  (`id`)
)


Here is how I define model associations

class Menu extends AppModel {
var $hasMany = array(
'MenuItem' => array(
'className' => 'MenuItem',
'order' => 'Dish.dish_type_id asc'
)
);
}

class Dish extends AppModel {
var $belongsTo = 'DishType';
}

class MenuItem extends AppModel {
var $hasOne = 'Dish';
}

Now my trouble begin. I have a controller MenusController and an
action create. In the view create.ctp I want to see one date field
(that works) and 9 select fields to choose the 9 dishes for the day.
Now the question.
How do I automagically create the 9 select fields. I understand the
mechanism for 1 attribute, ie. if I do in controller $this->set
('dishes', $this->Dish->find('list'));
and in the view  echo $form->input('Dish'); the select is there and
filled as expected.
But how to show 9 of them, each having only a subset of dishes. first
only rice, second naan etc)?

I already tried to do it manually. Meaning load the dishes in the
controller and then in the view call the method $form->select(...) 9
times to create 9 selects. But somehow I feel it goes against the
framework...or not?

Anyone have an idea?






--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Table relationship question

2009-04-23 Thread valentin.olte...@gmail.com

Hello!
I am new to cakephp and I have a question about relationships between
tables in cakephp.

I have 2 tables related as described below:

1.entries
id
price1
price1_currency
price2
price2_currency


2.currencies
id
title

currencies would be something like:
1 USD
2 EUR
etc.

My question is how should I define relationships for these 2 tables so
when I add a new entry, the price1_currency and price2_currency to be
populated with a dropdown select containg the values from currencies.

Thanks,
Valentin

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Model -> save problem

2009-04-23 Thread Frankaube

Hi I'm new to cakephp and have problems saving my data.

When calling Model->save it never saves to the databases with no
errors.

cake is calling describe on the table but not running any inserts
after.

I have no validation rules and the save function is returning TRUE. I
can retreive information with Model->find and it works with the same
model.

Thanks for the help
Frank


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Web Service

2009-04-23 Thread Rahul Sinhaa

Hello guys ,

We have to start a new project using cake php framework.
The project is related to WEB Services.

We have to create a WEB SERVICE -server , I want you guys to help me
deciding on the WEB SERVICE method (SOAP, REST ..) since I am not sure
that which method will be the best match for CAKE PHP and their
limitations also.

Thanks in advance

-Rahul

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



AppController does not load custom helpers

2009-04-23 Thread Sytze Loor

Hi,
Although I found a workaround for this problem, I'm not really happy
about it.
In my AppController is have this:
[code]
class AppController extends Controller {
  var $helpers = array('javascript', 'form', 'html', 'number', 'time',
'site');
  function beforeFilter() {
Configure::load('site_config/config');
  }
}
[/code]

The SiteHelper (last in the helpers array), I've build myself.

However, when I try this, the SiteHelper (or any custom build helper)
is not being loaded.

I also have a beforeFilter as you can see. When I place echo('test')
in it, the SiteHelper is being loaded and everything works out as it's
supposed to.

My questions are simple; am I doing something wrong and is there a way
to fix this properly?

Here is my full code:
[code]
class AppController extends Controller {
  var $helpers = array('javascript', 'form', 'html', 'number', 'time',
'site');
  function beforeFilter() {
Configure::load('site_config/config');
  }
}
[/code]

Thank you in advance!

Sytze Loor

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



multirecord form and retaining data on refresh

2009-04-23 Thread wendell.mal...@gmail.com

I am planning to have a recipe submission on my website using
multirecord form. I want to add a inputbox on the fly as the user want
to add additional recipe instruction and at the same time, I don't
them losing the data they have entered if refreshed or accidentally
refreshed. Is this something that the CakePHP can achieve?

Thank you for your time.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Help Me!

2009-04-23 Thread yuva

Hi.. all am new to cake php..

here comes my problem..

i ve installed xampp... n i want to install cake php.. is it
possible.. to do tat.. plz anyone guide me.. to do tat..  thanks in
advance..

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Error using find function on model

2009-04-23 Thread efrainbss

I really need help, im a beginner in cakephp, i need to know how to
fix this:

-
OUTPUT ERROR:
-
Notice (8): Undefined property: FondosFuncionalesController::
$FondoFuncional [APP\controllers\fondos_funcionales_controller.php,
line 10]

Code



function index() {

$this->set('fondos_funcionales', $this->FondoFuncional-
>find('all'));

FondosFuncionalesController::index() - APP\controllers
\fondos_funcionales_controller.php, line 10
Object::dispatchMethod() - CORE\cake\libs\object.php, line 115
Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 227
Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 194
[main] - APP\webroot\index.php, line 88


Fatal error: Call to a member function find() on a non-object in C:
\xampp\htdocs\cake_1_2\app\controllers
\fondos_funcionales_controller.php on line 10

-
MODEL CODE (app/models/fondo_funcional.php)
-



-
CONTROLLER CODE (app/controllers/fondos_funcionales_controller.php)
-
set('fondos_funcionales', 
$this->FondoFuncional->find
('all'));
}

}
?>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Pulling data to use in default.ctp menu

2009-04-23 Thread Firas

I'm trying to do the same thing as well. I'm a little new to CakaPHP.

I'm using elements, and for what them want it to do, they seem to
work.

On Apr 22, 9:58 am, blake  wrote:
> Hello,
>
> I have a menu being generated in my default.ctp file, and I need the
> menu options to change depending on a users permissions. I have a
> component to handle all the checking and returning an array I can use,
> but I am unsure how to properly get that data into the default.ctp
> layout.
>
> What controller would I use the component in to pass the data through
> to default.ctp?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Pulling data to use in default.ctp menu

2009-04-23 Thread blake

So am I perhaps going about this the wrong way or something? I
would've thought this was a fairly easy task.



On Apr 22, 10:58 am, blake  wrote:
> Hello,
>
> I have a menu being generated in my default.ctp file, and I need the
> menu options to change depending on a users permissions. I have a
> component to handle all the checking and returning an array I can use,
> but I am unsure how to properly get that data into the default.ctp
> layout.
>
> What controller would I use the component in to pass the data through
> to default.ctp?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Can't share elements between apps

2009-04-23 Thread John Andersen

I just checked the source code, and CakePHP checkes for elements under
each specified path, in the elements directory, so it should work, if
you specify the view path to for example: "\mycommonparts\views" and
all my common elements are placed in "\mycommonparts\views\elements"
then it should work!

Check out the source code at:
"http://api.cakephp.org/view_source/view/#line-331";

Enjoy,
   John

On Apr 23, 2:56 pm, Ernesto  wrote:
> Hi John. Thx for the response.
>
> i already checked this cookbook page but... there's no $elementPath :(
>
> so i guessed "maybe cake will search for a "elements" subdir in
> viewPath, as usually does with standard apps"...
>
> but i had no luck T_T
>
> PS: sry for my ultra-bad english lol
>
> On 23 Apr, 08:46, John Andersen  wrote:
>
> > Hi Ernesto
>
> > Try look at this "http://book.cakephp.org/view/36/Additional-Class-
> > Paths", maybe it may solve your issue :)
>
> > Enjoy,
> >    John
>
> > On Apr 22, 5:13 pm, Ernesto  wrote:
>
> > > Hello.
>
> > > view sharing works, but not elements sharing
>
> > > here's a snippet from my bootstrap.php
>
> > > if (!defined('SHARED_ITEMS_FOLDER')) {
> > >         define('SHARED_ITEMS_FOLDER',
> > > CAKE_CORE_INCLUDE_PATH .'\shared_items');
>
> > > }
>
> > > $viewPaths = array(SHARED_ITEMS_FOLDER .'\views');
>
> > > My webroot dir tree is this:
>
> > > WebRoot
> > >         cake
> > >         apps
> > >         shared_items
> > >                 helpers
> > >                 views
> > >                         elements
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Console not working - open_basedir restriction errors

2009-04-23 Thread Martin Westin


Since you are using console (php in cli-mode) you might have a
separate php.ini to edit. Some systems have that. On my server, for
example php ini is: "/etc/php5/cli/php.ini".

All you should have to do is comment out the open_basedir directive
from (the correct) php.ini
If you get the console working like that you can uncomment it again
and add another allowed path... for example "/opt/lampp/htdocs/"

/Martin


On Apr 22, 9:15 pm, Cepheus  wrote:
> Hrmm I've tried messing around with it, safe mode is turned off but it
> still will not include the file. I've tried messing around with the
> htaccess but no success. I guess I'll find another approach. Thanks,
> though.
>
> On Apr 22, 12:56 pm, Martin Westin  wrote:
>
> > You have installed Cake in a directory that is not allowed by your php
> > configuration.
>
> >http://www.php.net/manual/en/features.safe-mode.php
>
> > Look in your php.ini (possibly in /etc/) for the directive to change
> > the allowed directories. (But I am not sure Cake works that well under
> > "safe mode" even in an allowed directory.)
>
> > I guess your path is a symlink at some point?
> > ~/workspace/www/blog/cake/console would normally be
> > /home/usename/workspace/www/blog... but according to php it is
> > /opt/lampp/htdocs/blog...
>
> > /Martin
>
> > On Apr 22, 12:10 pm, Cepheus  wrote:
>
> > > Hey everyone,
>
> > > I've installed cakephp by checking out the SVN repository. When I try
> > > to run the cake console, I receive the following output:
>
> > > [cep...@cephah-laptop ~/workspace/www/blog/cake/console]$ ./cake
>
> > > Warning: require_once(): open_basedir restriction in effect. File(/opt/
> > > lampp/htdocs/blog/cake/basics.php) is not within the allowed path(s):
> > > (/srv/http/:/home/:/tmp/:/usr/share/pear/) in /opt/lampp/htdocs/blog/
> > > cake/console/cake.php on line 155
>
> > > Warning: require_once(/opt/lampp/htdocs/blog/cake/basics.php): failed
> > > to open stream: Operation not permitted in /opt/lampp/htdocs/blog/cake/
> > > console/cake.php on line 155
>
> > > Fatal error: require_once(): Failed opening required '/opt/lampp/
> > > htdocs/blog/cake/basics.php' (include_path='.:/usr/share/pear') in /
> > > opt/lampp/htdocs/blog/cake/console/cake.php on line 155
> > > [cep...@cephah-laptop ~/workspace/www/blog/cake/console]$
>
> > > I've tried looking around the web but I haven't found anything that
> > > worked. Does anyone know what I need to do to rectify this problem?
>
> > > Thanks in advance,
> > > Michael.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



access model properties from an helper

2009-04-23 Thread Ernesto

Hello.

i can't find a way to access model properties from an helper

is there one?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Basic Security component problem

2009-04-23 Thread toby1kenobi

Anyone see (or think of) anything that might be causing my issue?

Cheers,

Toby
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Can't share elements between apps

2009-04-23 Thread Ernesto

Hi John. Thx for the response.

i already checked this cookbook page but... there's no $elementPath :(

so i guessed "maybe cake will search for a "elements" subdir in
viewPath, as usually does with standard apps"...

but i had no luck T_T

PS: sry for my ultra-bad english lol

On 23 Apr, 08:46, John Andersen  wrote:
> Hi Ernesto
>
> Try look at this "http://book.cakephp.org/view/36/Additional-Class-
> Paths", maybe it may solve your issue :)
>
> Enjoy,
>    John
>
> On Apr 22, 5:13 pm, Ernesto  wrote:
>
>
>
> > Hello.
>
> > view sharing works, but not elements sharing
>
> > here's a snippet from my bootstrap.php
>
> > if (!defined('SHARED_ITEMS_FOLDER')) {
> >         define('SHARED_ITEMS_FOLDER',
> > CAKE_CORE_INCLUDE_PATH .'\shared_items');
>
> > }
>
> > $viewPaths = array(SHARED_ITEMS_FOLDER .'\views');
>
> > My webroot dir tree is this:
>
> > WebRoot
> >         cake
> >         apps
> >         shared_items
> >                 helpers
> >                 views
> >                         elements
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Move Baked app to Production server

2009-04-23 Thread aryan

Thanks! I'll Try


On Apr 21, 7:39 pm, brian  wrote:
> Copy the entire cake directory. Where you put it depends on how you
> set up on your local machine. Some people put cake beside app, others
> have one central cake directory for many apps. So, if you have:
>
> /some/dir/path/
>   app/
>   cake/
>
> ... then just do the same on the server.
>
> On Tue, Apr 21, 2009 at 9:31 AM, aryan  wrote:
>
> > What exactly should I do? Should I copy "lib" folder and place it on
> > web server(above the webroot directory)?
>
> > Thanks!
>
> > On Apr 20, 9:14 pm, brian  wrote:
> >> You're going to require the Cake libs on the server, also. Baking an
> >> app does not "compile" the libs into your classes.
>
> >> On Mon, Apr 20, 2009 at 8:43 AM, aryan  wrote:
>
> >> > I have made an application using bake tool. Cakephp is installed on my
> >> > pc.
>
> >> > How should I move it to the production server which doesn't have
> >> > cakephp installed?
>
> >> > Thanks!
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Architectural question on integration of external application in CakePHP

2009-04-23 Thread fain182

maybe you are interested in this:
http://bakery.cakephp.org/articles/view/phpbb3-api-bridge

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: xmlHelper - serialize

2009-04-23 Thread martinp

$xml->serialize($yourData, array('format' => 'tags'));

On Mar 9, 11:25 pm, tobi_one  wrote:
> Thanks Joe for this hint!
> How do you know what format options there are? I can't find any
> suggestions at the API or docs...
>
> Looks like format -> elements is getting closer to what I want.
> Unfortunately the elements are now empty (i.e. elements are defined
> ok, but no data in them)... Any idea what this could be?
>
> Thanks again!
>
> Cheers,
> Tobi
>
> On Mar 9, 9:05 pm, Joe Critchley  wrote:
>
> >http://api.cakephp.org/class/xml-helper#method-XmlHelperserialize
>
> > You can do the following:
>
> > $xml->serialize($yourData, array('format' => 'elements'));
>
> > On Mar 9, 7:45 pm, tobi_one  wrote:
>
> > > Hi,
>
> > > I'm using the xmlHelper andserializeto output an array asXML. This
> > > works ok, except that the outputedXMLuses "attributes" 
> > > (http://www.w3schools.com/XML/xml_attributes.asp) instead of standard
> > > elements.
>
> > > Is there a way to change this behaviour? I see there is an option
> > > attribute withserialize, but unfortunately no documentation on what
> > > could be specified there...
>
> > > Cheers,
> > > Tobi
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth performing logout Without Requesting It

2009-04-23 Thread rartavia

Is set to high

Here's my session config

Configure::write('Session.save', 'php');
Configure::write('Session.cookie', 'CAKEPHP');
Configure::write('Session.timeout', '120');
Configure::write('Session.start', true);
Configure::write('Session.checkAgent', true);
Configure::write('Security.level', 'high');
Configure::write('Acl.classname', 'DbAcl');
Configure::write('Acl.database', 'default');
Configure::write('Security.salt', '...');

Thanks for your help
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Using jQuery.ajax - Sending non-forms values to server

2009-04-23 Thread rartavia

In Controller I do "$this->Denouncement->saveAll($this->data)" and all
saves correctly excepting for one relation: Denouncements hasMany
Sections and Sections hasMay SectionParts.
Sections saved correctly (Denouncement hasMany Section) but
SectionParts are not being saved, i guess because I'm including
SectionParts inside the data[Section] array. But then how can I tell
cake that 'X' SectionPart belongs to 'Y' Section if SectionParts are
outside data[Section] and I dont have Section id yet

The generic explanation: I'm saving to one main table with several
kind of relations by sending all in a single array. One is a nested
relation, 'main table' (denouncements) hasMany other-object (sections)
which hasMany another-object (section_parts). Sending to saveAll in a
single array i'm being able to save on to sections, how should
section_parts should be placed so cake identify to which section they
belong. I hope this is 'understandable' =S

I'm sending to DB:

...&
data[Section][0][user_given_name]=asdf&
data[Section][0][type]=6&
data[Section][0][SectionPart][0][name]=embed&
data[Section][0][SectionPart][0][value]=&
data[Section][0][SectionPart][0][type]=embed&
data[Section][0][SectionPart][1][name]=top_left_img&
data[Section][0][SectionPart][1][value]=/site/files/user_uploaded_imgs/
20090423T050438.jpg&
data[Section][0][SectionPart][1][type]=img&
data[Section][0][SectionPart][2][name]=bottom_left_img&
data[Section][0][SectionPart][2][value]=/site/files/user_uploaded_imgs/
20090423T050439.jpg&
data[Section][0][SectionPart][2][type]=img&
data[Section][1][user_given_name]=ajksdfljasdfjlh&
data[Section][1][type]=0&
data[Section][1][SectionPart][0][name]=title&
data[Section][1][SectionPart][0][value]=ajksdfljasdfjlh&
data[Section][1][SectionPart][0][type]=text&
data[Section][1][SectionPart][1][name]=text&
data[Section][1][SectionPart][1][value]=ljsa kd ljkasdlkj&
data[Section][1][SectionPart][1][type]=text

Sections are saved correctly, however, SectionParts are ignored, no
error nor warning appears

Thanks a lot for any help
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Using jQuery.ajax - Sending non-forms values to server

2009-04-23 Thread rartavia

Thanks a lot to both of you yodi and Miles J.
I took Miles J concept and did my complex scenario, got great results,
I was able to read correctly in the controller with $this->data

In JavaScript I created an array with all my info by doing array.push
("data[...][...]="+value) and then, $.ajax({data:array.join
("&"),...}), i get something like this:

data[Denouncement][title]=asdf&
data[Denouncement][country]=Costa Rica&
...
data[UploadedImage][0][url]=/files/user_uploaded_imgs/
20090423T0504380500seleccion.jpg&
...
data[Section][0][user_given_name]=asdf&
...
data[Section][1][type]=0&
data[Section][1][SectionPart][0][name]=title&
...
data[Section][1][SectionPart][1][type]=text

(I removed some parts)

Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Using jQuery.ajax - Sending non-forms values to server

2009-04-23 Thread rartavia

Thanks a lot to both of you yodi and Miles J.
I took Miles J concept and did my complex scenario, got great results,
I was able to read correctly in the controller with $this->data

In JavaScript I created an array with all my info by doing array.pop
("data[...][...]="+value), and then, $.ajax({data:array.join
("&"),...}), i get something like this:

data[Denouncement][title]=asdf&
data[Denouncement][country]=Costa Rica&
...
data[UploadedImage][0][url]=/files/user_uploaded_imgs/
20090423T0504380500seleccion.jpg&
...
data[Section][0][user_given_name]=asdf&
...
data[Section][1][type]=0&
data[Section][1][SectionPart][0][name]=title&
...
data[Section][1][SectionPart][1][type]=text

(I removed some parts)

Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Basic Security component problem

2009-04-23 Thread toby1kenobi

Thanks for getting back to me Miles!

They do indeed blackhole (which sends the client a 404). There is one
'odd' field on my form ('text') below, which I'm showing using
FCKEditor. I tried your suggestion, and I also tried removing it
completely, but I still get the same issue. Can you see anything else
in my form that might cause issues? Am I right in thinking that I
shouldn't necessarily need to add anything to my controller's
beforeFilter?

create('Site');?>


input('Site.id');
echo $form->input('Site.parent_content_item_id');
echo $form->hidden('Site.created_by_user_id');
echo $form->hidden('Site.modified_by_user_id', array('value'
=> $authenticatedUser['User']['id']));
echo $form->input('Site.title');
echo $form->input('Site.description');
echo $fck->fckeditor(array('Site', 'text'), $form, $html-
>base, $this->data['Site']['text']);
echo $form->hidden('Address.0.id');
echo $form->hidden('Address.0.type', array('value' =>
'Site'));
echo $form->input('Address.0.address_1');
echo $form->input('Address.0.address_2');
echo $form->input('Address.0.town');
echo $form->input('Address.0.county');
echo $form->input('Address.0.postcode');
echo $form->input('Address.0.telephone');
echo $form->input('Address.0.fax');
echo $form->input('Address.0.email');
echo $form->input('Site.url', array('disabled' =>
'disabled'));
echo $form->input('Site.meta_keywords');
echo $form->input('Site.meta_description');
?>

end('Submit');?>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth performing logout Without Requesting It

2009-04-23 Thread Miles J

Whats your session security level at?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Basic Security component problem

2009-04-23 Thread Miles J

Do you mean they blackhole?

If you are adding fields manually, that arent created by $form->input
(), it will blackhole.

To fix this, place the following code in your beforeFilter(). You
would add each field you created manually as an argument.

$this->Security->disabledFields = array('field1', 'field2', 'field3');
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Basic Security component problem

2009-04-23 Thread toby1kenobi

Hi all,

  I added the Security component to my controller, which I thought
would be enough to add basic form authentication. However, my
admin_edit/admin_add actions both now fail (404).

  I have tried adding various combinations of requirePost and
requireAuth to my beforeFilter (applied to 'add' and 'edit' with and
without admin routing, and also admin_add and admin_edit), but to no
avail.

  In case it's relevant, my actions affect the controller's model plus
one other (a hasMany relationship).

  Any help much appreciated,

Toby
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Architectural question on integration of external application in CakePHP

2009-04-23 Thread marco.rizze...@gmail.com

Hi
I have my application in CakePHP.
My application only manages users and services.
More precisely I have some registered users and I have some services.
With CakePHP I manage which users can access certain services and
which can not.
For the moment all services are made in cakephp so the management is
simple
Now my client would add a Wiki between services.
The client would use Mediawiki.
Now I have 2 problem
1) I must manage the access to mediawiki automatically from my
application without login operation.
2) How to join or integrate databases of Mediawiki and CakePHP
application so that the management of users could be simultaneously
and automatically on both databases of the two applications

I think that it is a thing that can happen often and  have a best
practice could be useful.

Many thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---