Re: Dealing with forms!!!!!

2010-05-13 Thread WebbedIT
I wrote a blog post about using ModalBox which is handy if you're using Prototype: http://webbedit.co.uk/blog_posts/view/tutorial-cakephp-modalbox-crud HTH Paul. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this m

Re: 2 models in one view

2010-05-13 Thread Marek Sebera
Isnť it $user['UserPreference'][0]['image'] ? Like here: foreach($user['UserPreference'] as $user){ $img = $user['image']; } Mark 2010/5/14 bradmaxs > I know this is probably simple but I have spent a lot of time trying > to figure this out and was hoping someone could assist. > > I have a us

Translations

2010-05-13 Thread Marcell
Hi folks, How can I contribute to translations? I tried to using http://translation.cakephp.org/ but either got a 'An error has occurred. Thank you for your patience.' or a 'You do not have rights to access this translation project.' error when selecting the translated language. Cheers, Marcel

2 models in one view

2010-05-13 Thread bradmaxs
I know this is probably simple but I have spent a lot of time trying to figure this out and was hoping someone could assist. I have a user model and a user_preference model. user_preference belongs to user. I am in view.ctp of the user model and in the dump I have the following array. Array (

How to handle multiple user types

2010-05-13 Thread Eric Anderson
Hi everyone, I'm just curious how everyone else out there handles different user types when they have different data associated with them? I have a system that has guests, members and hosts. Each user type has many different fields associated with them. Currently I handle it by having a main user

Re: Multiple AJAX Forms on same page all submitting to first form.

2010-05-13 Thread Nabil Alsharif
Are you calling $form->end()? On Thu, May 13, 2010 at 9:54 AM, Robert McWay < mcway.web.developm...@gmail.com> wrote: > i had already fixed that issue since i posted this initially, and that > wasn't the issue. I actually did get it working now, by switching to > using $ajax->form, instead of $aj

Re: BAKE Cake SPAM

2010-05-13 Thread calvin
That's no good, but are you sure it's targeting CakePHP and not just any sites based on an MVC framework or that use RESTful URLs? That's a pretty standard routing pattern these days (I assume you meant to say "/admin/model/action", not "/model/admin/action"), and I'm pretty sure that more than a f

Re: Multiple AJAX Forms on same page all submitting to first form.

2010-05-13 Thread Robert McWay
i had already fixed that issue since i posted this initially, and that wasn't the issue. I actually did get it working now, by switching to using $ajax->form, instead of $ajax->submit(). The downside is data validation doesn't work with $ajax->form, but at least the form tags are being generated pr

BAKE Cake SPAM

2010-05-13 Thread Stuart Cross
I have seen evidence of SPAM spiders hunting for BAKE'd Cake sites with unprotected admin urls. They are simply using the model names from urls and hitting model/admin/add model/admin/edit/n in the access logs. May seem obvious but check you lock down your admin methods and remove unwanted baked me

Re: how write update query in cakephp

2010-05-13 Thread Jeremy Burns
Here's a clue: > duplicate key value violates unique constraint "tblcdlog_pkey" You are trying to create a duplicate row in the database. Jeremy Burns jeremybu...@me.com On 13 May 2010, at 14:00, Narendra Padala wrote: > Warning (512): SQL Error: ERROR: duplicate key value violates unique >

Re: how write update query in cakephp

2010-05-13 Thread Narendra Padala
*Warning* (512): *SQL Error:* ERROR: duplicate key value violates unique constraint "tblcdlog_pkey" [*CORE/cake/libs/model/datasources/dbo_source.php*, line *526*] On Thu, May 13, 2010 at 6:28 PM, Jeremy Burns wrote: > I'm sorry to sound unhelpful, but have you read the error message? > > > J

Re: how write update query in cakephp

2010-05-13 Thread Jeremy Burns
I'm sorry to sound unhelpful, but have you read the error message? Jeremy Burns jeremybu...@me.com On 13 May 2010, at 13:53, Narendra Padala wrote: > hi sir, > i did that one now i got this error sir please help me out sir > > Warning (2): pg_query() [function.pg-query]: Query failed: ERROR:

Re: how write update query in cakephp

2010-05-13 Thread Narendra Padala
hi sir, i did that one now i got this error sir please help me out sir *Warning* (2) : pg_query() [function.pg-query ]: Query failed: ERROR: duplicate key value violates unique constraint "tblcdlog_pkey" [*CORE/cake/libs/model/datasources/dbo/dbo_postgres.php*, l

CakePHP ERA modeler

2010-05-13 Thread Ziki
Hello, once I have been finded ERA modeler especialy for CakePHP conventions, and now I can't find that website, does anybody know what is URL of that site or is there any similar? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. Yo

Re: how write update query in cakephp

2010-05-13 Thread Jeremy Burns
That's a fairly self explanatory error message. Your dtmcreated field cannot be null. You need to include the dtmcreated field and a matching value in the update statement. Something like: > $this->data['Tblcdlog']['lngcdlog']=157; > $this->data['Tblcdlog']['strerrordesc']='value'; > > $this->

Re: how write update query in cakephp

2010-05-13 Thread Narendra Padala
when i am tried above like that, i got this error message *Warning* (2) : pg_query() [function.pg-query ]: Query failed: ERROR: null value in column "dtmcreated" violates not-null constraint [*CORE/cake/libs/model/datasources/dbo/dbo_postgres.php*, line *155*] C

Re: Rewrite url in cakephp

2010-05-13 Thread
Couple of ways to do this: 1) Rename the file to 'admin_controller' and change var $name to admin. You might need to set var $uses to Admin in this case. 2) THE PREFERRED WAY - open up Config/routes.php and set yourself another route in there. The notes in the file should see you through, it is w

Re: Authorizing problems with Auth compoment.

2010-05-13 Thread
Have a look in the book for the isAuthorized() function - you need that if you are authorizing by controller. Without that present (it can be in AppController if you have very simple needs) then you won't have much luck. J On May 13, 2:11 am, still wrote: > The problem confucing me is that when

Rewrite url in cakephp

2010-05-13 Thread Jipson
Hello friends, In my site created using cake php, I can access my sites admin control panel login by http://mysite.com/admins/login. admins_controller is the controller and login is the function name. How I can acces the same by http://mysite.com/admin/login? Can you please help me? Thanks, Jip

Rewrite url in cakephp

2010-05-13 Thread Jipson
Hello friends, In my site created using cake php, I can access my sites admin control panel login by http://mysite.com/admins/login. admins_controller is the controller and login is the function name. How I can acces the same by http://mysite.com/admin/login? Can you please help me? Thanks, Ji

Re: Dealing with forms!!!!!

2010-05-13 Thread
This isn't too tricky to fix. Essentially you want to reload the form if registration fails? Like Paul said above, you need to be doing the validation in the Model, and use the Model->validates() method to test for it. So, if you build the validation criteria in the model (have a look at the Book

Re: how write update query in cakephp

2010-05-13 Thread Dilip Godhani
Hi, Suppose u want to update one row and its id is 1 then u want following array $this->data['ModdelName']['id']=1; $this->data['ModdelName']['2field']='value'; $this->ModelName->save($this->data); Array ( [ModelName] => Array ( [id] => 1 [2field] => 'value'

Re: i18n / l10n Problem with Cake 1.3

2010-05-13 Thread nils
Miles, thanks a bunch, that was it. Damn, I lost a whole day on that.. Documentation should really be improved here! :/ I'll be heading over to book.cakephp.org right away and add that to the i18n section as a comment.. Have a good one! nils On May 12, 7:16 pm, Miles J wrote: > If you want G

Re: how write update query in cakephp

2010-05-13 Thread Narendra Padala
Sir, looked at sir, but i am not getting properly, can u write one example for my above code..please help me out sir On Thu, May 13, 2010 at 3:31 PM, Jeremy Burns wrote: > Have you even looked at the online guide? > http://book.cakephp.org/view/1031/Saving-Your-Data > > Jeremy Burns > jeremybu..

Re: edit last row in the table.

2010-05-13 Thread Mateo San Román
If you are using a UUID, you should also have a timestamp field to sort the table on that field... On 11 mayo, 22:58, Jeremy Burns wrote: > Just being picky - you don't need limit => 1 if you are doing a find first. > > Jeremy Burns > jeremybu...@me.com > > On 11 May 2010, at 23:33, Stefano Mart

Re: how write update query in cakephp

2010-05-13 Thread Mateo San Román
Something like this: On 'Tblcdlogs' Controller: function Update($id) { $this->Tblcdlog->id = $lngCDLog; $this->set('strerrordesc' => 'The CD could not be mounted. Make sure it is a valid $COMPANY_NAME Data CD.'); $this->save(); ... } Please check the manual for further explanation On 1

Re: how write update query in cakephp

2010-05-13 Thread Jeremy Burns
Have you even looked at the online guide? http://book.cakephp.org/view/1031/Saving-Your-Data Jeremy Burns jeremybu...@me.com On 13 May 2010, at 11:00, Narendra Padala wrote: > > Hi...All!, > > I am new to cake php,I am suing postgreSql i need to update some > fields in my database. In my con

how write update query in cakephp

2010-05-13 Thread Narendra Padala
Hi...All!, I am new to cake php,I am suing postgreSql i need to update some fields in my database. In my controller my code like thishere i need convert these update command to cake, Please anyone can help me out how to convert this in to cake. function fun() { /***

Re: sql error 1054 unknown column in 'on clause'

2010-05-13 Thread Ambika Kulkarni
U r the MASTER sir Thanks to you, for all your kind help On Thu, May 13, 2010 at 12:17 PM, Amit Rawat wrote: > No acknowledgement for me? > > Check out the new CakePHP Questions site http://cakeqs.org and help others > with their CakePHP related questions. > > You received this message becaus

Routing GET parameters

2010-05-13 Thread Mateo San Román
Hello, I'm using a cake view to serve an AJAX autocomplete which is implemented in the form URL?q=[searchstring]. I cannot change that implementation and I need the URL to be in pretty form, since results are meant to be cached. Is there a way I could route /controller/search/?=:string to /control

Re: how to store drop down selected element in the table

2010-05-13 Thread Master Ram
think u sir.. On May 13, 1:04 pm, Jeremy Burns wrote: > > What do you get when you debug $this->data just before you do the save? > > Jeremy Burns > jeremybu...@me.com > > On 13 May 2010, at 09:03, Master Ram wrote: > > > > > sir its storing only "0" i has to change something like 1 or 2 or 3 > >

Re: how to store drop down selected element in the table

2010-05-13 Thread Jeremy Burns
> What do you get when you debug $this->data just before you do the save? Jeremy Burns jeremybu...@me.com On 13 May 2010, at 09:03, Master Ram wrote: > sir its storing only "0" i has to change something like 1 or 2 or 3 > etc. > > its not giving any error sir > > On May 13, 12:54 pm, Jeremy B

Re: how to store drop down selected element in the table

2010-05-13 Thread Master Ram
sir its storing only "0" i has to change something like 1 or 2 or 3 etc. its not giving any error sir On May 13, 12:54 pm, Jeremy Burns wrote: > I think your model name should be Agency, for a start. > > You haven't specified what error you are getting. What do you get when you > debug $this->d

Re: how to store drop down selected element in the table

2010-05-13 Thread Jeremy Burns
I think your model name should be Agency, for a start. You haven't specified what error you are getting. What do you get when you debug $this->data just before you do the save? Jeremy Burns jeremybu...@me.com On 13 May 2010, at 08:48, Master Ram wrote: > Hi... all > > i am getting "agencies"

Re: Limitations to plugins for app modularity - are there any left in cake 1.3?

2010-05-13 Thread keymaster
Jamie - yes, it does feel good to know someone else is doing things the way you did. I'm sure others are too. AD7six - You said: > what do you do when in app project you don't want something you're inheriting? You 404 all actions you don't want to inherit. AppController::Return404( array( ...

how to store drop down selected element in the table

2010-05-13 Thread Master Ram
Hi... all i am getting "agencies" table field in to drop down. but i am not able to store the selected item in to the "promoters" table ". this is the code i user. My table name is: "promoters" the fields are promoter_id, agency_id.etc., this is my view code: select('agencyId',

Re: Dealing with forms!!!!!

2010-05-13 Thread sherzo
Hi Paul Thanks for your reply and the great comment about the validation. My main issue is, the registration form is included in a light box and after submission I dont like it to be redirected to another page in case of any error especially of user turned off the javascript in the browser ! Tha

Re: Containable Aggregate Fields Problem

2010-05-13 Thread WebbedIT
I have not done any work within Cake using GROUP BY, AVG or SUM etc yet but immediately it strikes me that your running this query on the wrong model and not GROUPing your results to allow it to return any meaningful AVGs. If you set debug to 2 and look at the queries being generated you will see

Re: Dealing with forms!!!!!

2010-05-13 Thread WebbedIT
Hmm, your doing all of your validation manually in the controller ... this is supposed to be done automagically by the model when you save the record. Read the following through a couple of times: http://book.cakephp.org/view/125/Data-Validation The one thing you have to watch out for is the pas