Re: how to do cascading combobox

2013-04-23 Thread Karey Powell
Hello, you can try and achieve that by following this: 
http://www.willis-owen.co.uk/2011/11/dynamic-select-box-with-cakephp-2-0/

On Saturday, 20 April 2013 06:49:56 UTC-4, di wrote:
>
> I'm using cakephp 2.1
> in my application I have 5 tables that are related: Provinces, Districts, 
> Towns, Neighborhoods and block. 
> In my form AddParticipant, have five combobox, Provinces, Districts, Towns
> , Neighborhoods and block.
> wanted when the user selects the Province, the District combobox shows up 
> Districts Related to this Province, 
> District combobox shows up the locations, Location combobox shows up 
> theNeighborhoods
> .
>
> Any help please.
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Checking Consistency Before Saving

2013-04-23 Thread Karey Powell
Following upon David's suggestion, you can achieve the functionality of a 
dynamic select box using this tutorial as a guide: 
http://www.willis-owen.co.uk/2011/11/dynamic-select-box-with-cakephp-2-0/. 
That is how I would do it as well.

On Monday, 22 April 2013 14:36:11 UTC-4, da...@qccareerschool.com wrote:
>
> I have a table of students with foreign keys of province_id and a 
> country_id. And the table of provinces has a foreign key of country_id just 
> like the students table.
>
> I want to make sure that a student doesn't get saved with a province that 
> doesn't match the country. I put this into my Student model and it works, 
> but I want to know if I'm following best practices.
>
> Can anyone suggest a better way to do this?
>
> public function beforeValidate(array $options = array()) {
> if ($this->data['Student']['province_id']) {
> $p = new Province();
> $this->set('province', 
> $p->findById($this->data['Student']['province_id']));
> if ($this->data['Student']['province']['Province']['country_id'] != 
> $this->data['Student']['country_id']) {
> $this->invalidate('province_id', 'Invalid province for the selected 
> country');
> return false;
> }
> }
> return true;
> }
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Using Auth component with two different models

2013-04-23 Thread André Luis
I suggest to use a single model and separate the users using groups...

Em sexta-feira, 19 de abril de 2013 12h39min38s UTC-3, Alex Bovey escreveu:
>
> Hi all,
>
> What's the best technique to use if I have two separate areas of my site 
> and I want the Auth component to use two separate models to log in to those 
> areas?
>
> I have tried setting the $this->Auth->authenticate['Form']['userModel'] 
> from the controller but that doesn't seem to have any effect...
>
> Thanks all,
>
> Alex 
>
> -- 
> Alex Bovey
> Web Developer | Alex Bovey Consultancy Ltd
> Registered in England & Wales no. 6471391 | VAT no. 934 8959 65
> al...@bovey.co.uk  | t 0844 567 8995 | m 07828 649386 | f 
> 0870 288 9533
> PHP | CakePHP | MySQL | jQuery | HTML5 | CSS3 | Drupal | Wordpress | 
> Hosting
>  

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Deletion Simulation

2013-04-23 Thread Advantage+
I have a fairly large database with a lot of records related to each other
and need to follow the cascades on deletion of records from various points
in the site and see what would be related along the trail. 

But I do not want to delete these records as then I have to go back and
create them and that takes quite a bit of time even with an automated script
since it cross's between Users, their Role, and their records with hasMany,
belongsTo, HABTM, to other parts of the site and so on.

 

Is there a way to follow a delete thru its relations / cascade to return
what would be deleted but not actually delete anything?

 

Thanks

Dave

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Migrar Sistema CAKEPHP

2013-04-23 Thread Pablito Pablito
Depende la version. Si estas en la misma major version, no es mucho mas 
complejo que actualizar tu lib/Cake y ver la guia que los devs de Cakephp 
publican con cada update. Si estas en 1.3 a 2.3 o cuando salga la version 3 
seguro los cambios sean mayores. 

No es facil de responder la pregunta porque depende de los cambios que 
ocurran en el core de Cakephp. 

Saludos.


On Monday, April 22, 2013 6:38:00 PM UTC-3, MicLti wrote:
>
> Hola buen dia 
> Es dificil migrar un sistema de una version antigua a la mas nueva de 
> cakephp
> que componentes son los que mas cambian cuando salen nuevas versiones
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Using Auth component with two different models

2013-04-23 Thread Alex Bovey
On Fri, Apr 19, 2013 at 4:39 PM, Alex Bovey  wrote:
> Hi all,
>
> What's the best technique to use if I have two separate areas of my site and
> I want the Auth component to use two separate models to log in to those
> areas?
>
> I have tried setting the $this->Auth->authenticate['Form']['userModel'] from
> the controller but that doesn't seem to have any effect...

Hi all - any thoughts on this one?  Thanks! Alex

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Checking Consistency Before Saving

2013-04-23 Thread david . suna
I think a more basic question has to do with the data model.  Why are you 
duplicating information in two places?  If the Student has a reference to a 
Province and a Province has a reference to a Country then you do not need a 
reference to a Country in Student.

>From a UI standpoint I would allow the user to select a Country.  When the 
country is selected I would display only the Provinces that are defined for 
that Country.  When the Student is saved it would only save the 
province_id.  

If you need the country for the Student later on you can access it by doing 
a find with recursive set to 2 or by doing an explicit join of the Country 
table.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




The online CakePHP baking tool Petit Four 1.1.0 has been released

2013-04-23 Thread Christian Cadéré
Petit four  is an online tool 
allowing the design of a Web project: its models and their fields, 
validation and relations, then generates all necessary files following the 
CakePHP convention: models, controllers and views. This online application 
also generates the SQL tables of your project.

Now with version 1.1.0, you can now create an 
accounton the 
website in order to save your projects for further use, and 
eventually share them with the 
communityto give other CakePHP 
users a base to start their similar projects.

Check out : http://patisserie.keensoftware.com/en

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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