Re: testing a controller's add action

2009-12-28 Thread Lorenzo Bettini
nurvzy wrote: testAction will not use your TestPapers class that I assume you've created in your test. It will faulter at the redirect. I'm not sure why $this-data is not being populated by testAction in your admin_add action as you seem to be doing it correctly.. How do you know its not

Re: Cookie in Models

2009-12-28 Thread dyutiman
Hi Nabil, thanks for your reply and suggestion. It'll really help. I thought about getting the cookie value in controller and pass it to model. But for this I have to rewrite every model functionality provided by cake by default. I am still thinking of a good solution of the problem. But in the

Re: How to setup relationships in model User has a Status

2009-12-28 Thread robustsolution
AFAIK, In general we have three statuses for every account created but not active (0) activated (1) banned (-1) It is better to stick to one table (users), so this table have an indexed integer field called status. As for Active, ''Banned, etc... It is just a convention and 9X% of the queries

Re: coding practices with models

2009-12-28 Thread John Andersen
I use the model class as the maintainer of the individual record and the provider of a collection of records. So in your banana example, my model would know what to do when a controller stated that peeling the banana was required :) Whether or not to read the banana into the model depends on the

Re: coding practices with models

2009-12-28 Thread robustsolution
in your previous code, you are not instantiating the banana, you are only looking for the banana record with the specific id. As for the Banana Model Class, you can define custom methods. You can do hat ever you want but, If you want to know how do I think? I do not put a method in the model

Cache MADNESS with Auth

2009-12-28 Thread lacenaepro...@gmail.com
Hi, I have this userscope Auth configuration in the AppController: $this-Auth-userScope = array('User.confirmed' = '1'); Today I decided to change the value from 1 to 2. I changed the line above and ALL THE RECORDS IN THE user table. The Auth components now DOES NOT LOGIN the users. I cleared

Re: paginating - several on one page

2009-12-28 Thread Chad Smith
Hello Melanie, The other poster is right that Pagination can only operate on one view at a time. I've never really had a lot of luck with it to be honest because I love the idea but feel that it still is slightly restrictive in the real world complex functionality. To get around the limitations

Re: Cache MADNESS with Auth

2009-12-28 Thread Chad Smith
Hello Dario, If the field is a tinyint (which most likely it is) then in Cake's mind 1 = true, 0 = false. You changing it to 2 will confuse Cake and make it not know what to think. You will need to change that field to int and then change the values to 2 if they are confirmed. When I was

Re: power point reader in cakephp

2009-12-28 Thread soth ratana
hi I think flash can help you .. James On Mon, Dec 28, 2009 at 10:09 AM, puneet sharma puneets...@gmail.comwrote: Hello Group, Is there any way in cake php or in php itself, through which we can read powerpoint files in php? my development environment is linux, I got some Dom

convention clarifications, and joins with cakephp

2009-12-28 Thread Jaimon
hi, just few days ago i found out about this miracle called cakePHP so i am pretty green to it. i need to build a mail application, so i have followed the convention and created: data base description: table of users user_id (primary key), fname, lname. table of mails mail_id(primary key), from

Re: Getting incremental number from the counter

2009-12-28 Thread aveev
Well I mistakenly wrote it as an app number. It's actually a registration number. 1) What are the requirements for the application? So here's the process: After a user is finished filling up the form, his app will be given a reg number. We will store this user data along with the reg number on a

Re: Cache MADNESS with Auth

2009-12-28 Thread lacenaepro...@gmail.com
HI CHAD, YOU ARE THE GOD!! So simple Thank you very much, yuor code excerpt is interesting!! Dario On 28 Dic, 14:37, Chad Smith chadsmith...@gmail.com wrote: Hello Dario, If the field is a tinyint (which most likely it is) then in Cake's mind 1 = true, 0 = false.  You changing it to 2

Re: Getting incremental number from the counter

2009-12-28 Thread John Andersen
Based on what you wrote, I would put the method together with the model that handles the registration, so that when the registration data have been validated, the model requests a registration number and saves it together with the registration data. Hope this helps ;) John On Dec 28, 4:08 pm,

Re: convention clarifications, and joins with cakephp

2009-12-28 Thread Renato de Freitas Freire
you can setup your model to look for any field as foreign key... just do that: in your case, User hasMany Mail and Mail belongsTo User in your user model: var $hasMany = array( 'MailTo' = array( 'className' = 'Mail', 'foreignKey' = 'to' ), 'MailFrom' = array( 'className' = 'Mail', 'foreignKey'

How to auto-populate dependent habtm select boxes using ajax...

2009-12-28 Thread otisjs01
Hello, I am new to CakePHP, and I am guessing that this has been answered before, but I have a question about auto-populating dependent select boxes. I've been googling and looking for nearly a week, and I just can't seem to figure this out! I've come close, but most of the examples that I have

Favorite list in view

2009-12-28 Thread Gabor
Hi! I would like create a favorite list to a user, and I would like to show it always on a sidebar. In the main section the user can browse items, and there would be a link to add favorite. but I would like to show immediately in the sidebar. Ok I know I have to use AJAX. The problem is: Where

how to setup privileges

2009-12-28 Thread Nuno Oliveira
Hi all, I am starting with cakePHP, and already have a doubt, 1st of a few ;). I am making an application with the login/user privileges part, but where users are related with a club/association. So the user's privileges are related to that club/association, if a user has a total privileges,

Re: how to setup privileges

2009-12-28 Thread Renato de Freitas Freire
Hi All. I have the same question here... This ACL component is the worth thing in cakephp... I already did it once, but i didn’t fully understood what I was doing and I had some people in the project helping me... so, Im in trouble now... I have to implement access control in my system… it

a double criteria case

2009-12-28 Thread jlugo
I have to show on a list some data but it has to be filtred by one estado_id dependeing o the logge user, an user has an estado_id, an i have to do a filter of Fundos, Fundos has parroquia_id-Parroquia, in Parroquia i have Municipio_id-Municipio,an then i have in Municipio estado_id that belongs

Re: testing a controller's add action

2009-12-28 Thread nurvzy
Lorenzo Bettini bett...@dsi.unifi.it wrote: I'm not getting errors: as I said before, I can see that data is not populated using the debugger, and also because it executes the instructions to be executed when data is null; thus it basically does not faulter, it simply does not get any data...  

Out of office reply

2009-12-28 Thread jim
Hi, I am out the office until the 14th of January. If you require urgent assistance then please contact p...@citadelsecure.com or call him on 07890 592198 - otherwise I will answer your email on my return. Regards Jim Check out the new CakePHP Questions site http://cakeqs.org and help

i18n and anonymous surfers - bug?

2009-12-28 Thread euromark
i would have never found that out if i hadnt built myself a bot- tracking component it basically logs all non-js-browsing and tries to detect if it was a known search bot anyway this way i found out that my website has been visited by users using http://anonymouse.org/ i tried it out myself and

Re: coding practices with models

2009-12-28 Thread tristan_ph
If you want to instantiate a banana, you should write it like this, $Banana = ClassRegistry::init('Banana'); then you may now execute the peel() like this, $Banana-peel($id); On Dec 28, 10:14 am, Christian cdamiani...@gmail.com wrote: When i come across situations that I feel needs to be coded

Re: Nested Models

2009-12-28 Thread John Andersen
When a user selects a contract to view, store the contract id internally (session). Then when the user requests to view the related messages, show the messages and add a form for the user to enter a new message, and have the form url be /messages/add. If the user adds a new message, retrieve the