Re: Containable, paginate, Trying to get property of non-object

2011-02-23 Thread Ryan Schmidt
On Feb 24, 2011, at 00:39, Ryan Schmidt wrote: > I do in fact have a hasMany relationship defined for Place: > > class Place extends AppModel { >var $hasMany = array( >'Thing' => array( >'className' => 'Thing', >'foreignKey' => 'place_id', >'depend

RE: afterDelete not running as intended

2011-02-23 Thread Krissy Masters
Not so much related to your post but I noticed something so tip for you: I do the same thing delete an ordered item 1,2,3,4,5,6 delete #4 so I grab the Model.order I am deleting and updateAll where Model.order is greater than 4 for this example saving un-necessary save's 1,2,3 never changed so why

Re: Containable, paginate, Trying to get property of non-object

2011-02-23 Thread Ryan Schmidt
I should have mentioned before that everything seems to be working correctly -- it correctly fetches and displays only the data I've specified -- the only problem I see is that CakePHP generates this notice. On Feb 24, 2011, at 00:25, Jeremy Burns | Class Outfit wrote: > What happens if you ad

Re: Containable, paginate, Trying to get property of non-object

2011-02-23 Thread Jeremy Burns | Class Outfit
What happens if you add a $hasMany Place statement to the Thing model? Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 24 Feb 2011, at 05:44, Ryan Schmidt wrote: > I'm using CakePHP 1.3.6 and am trying to use Containable for the first time, > and I have an i

Re: afterDelete not running as intended

2011-02-23 Thread Jeremy Burns | Class Outfit
Is this in a model or a controller? I am guessing it's in a controller because you have a redirect statement. To make it run as afterDelete you need to move it into the model (afterDelete is a model callback) and then you'd need to remove the redirect statement because it will error. Jeremy Bur

Containable, paginate, Trying to get property of non-object

2011-02-23 Thread Ryan Schmidt
I'm using CakePHP 1.3.6 and am trying to use Containable for the first time, and I have an index action (as CakePHP baked it for me) that uses paginate(). Since I suspect I will want to use Containable everywhere, in my app_model.php I have: class AppModel extends Model { var $actsAs = arra

Re: hiding link from certain users.

2011-02-23 Thread Ryan Schmidt
Well, you don't have a column group_id in your users table; you have a column superuser. So did you try: if ($session->read('Auth.User.superuser') == 1) { } On Feb 23, 2011, at 21:22, Kid Hell wrote: > thank you for your reply..but i still can't get it right.. I'm a slow > learner. Can yo

afterDelete not running as intended

2011-02-23 Thread adam_g2000
Hi Guys, I have this method I've written... function tidyup() { //Re-sort orders to remove the 'hole' // Create an array of the image table contents of IDs and Orders. $conditions = array( 'fields' => array('id','order'),

Re: hiding link from certain users.

2011-02-23 Thread Kid Hell
thank you for your reply..but i still can't get it right.. I'm a slow learner. Can you please explain deeper on the (Auth.User.group_id') part. this is what the table in db looks like id usrname pass superuser 1 jill 12345

Re: cakephp Messaging sysytem

2011-02-23 Thread Josh
So to generate a user's "inbox", I'm guessing you would select all of the conversation_id's from the conversation_users table and save them to an array. Then you would select the messages from the messages table where the conversation_id is in the array you made that contains all of the conver

Re: cakephp Messaging sysytem

2011-02-23 Thread euromark
sure CREATE TABLE IF NOT EXISTS `comm_conversations` ( `id` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `user_id` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `title` varchar(60) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `created` datetime NOT NULL, `last_message_id

Re: cookbook experience

2011-02-23 Thread Ryan Schmidt
On Feb 23, 2011, at 13:14, rj wrote: > Hi, this is just to share some experiences with the fabulous new > cookbook. > > Last week the dynamic table of contents in combination with the search > field worked for me for the first time (on FF 3.6). That's really > cool! (It throws an error though in

Re: problems populating my select box

2011-02-23 Thread cricket
On Wed, Feb 23, 2011 at 3:28 PM, barricades wrote: > > I'm viewing this thread through the google group in my browser, thats > where the link doesn't work :) Me too, but it's fine. Weird. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new Cak

Re: cakephp Messaging sysytem

2011-02-23 Thread Miles J
This is the structure I have used in the past. id user_id - Sending recipient_id - Receiving status userFolder recipientFolder subject content created modified With the following enums (not mysql enums, but class integer/ constants). status = 0 unread, 1 read, 2 replied, 3 forwarded userFolder/r

Re: Update Display Fields

2011-02-23 Thread euromark
yes there is: $model = $this->Model->find() // data validation and save if (empty($this->data)) { $this->data = $model; } $this->set(compact('model)); you can now work with $model array in the view (contains all fields) On 23 Feb., 21:34, Pekkle wrote: > I have a table that i did two

Re: Benchmark

2011-02-23 Thread Miles J
There is a plugin called the DebugKit. It monitors benchmarks, SQL, variables, session, etc. https://github.com/cakephp/debug_kit On Feb 22, 11:36 pm, Chris DB wrote: > I am a new comer and fresh patissier for CakePHP. My Question: CakePHP > use the concept of benchmarking to assess the performa

Update Display Fields

2011-02-23 Thread Pekkle
I have a table that i did two functions - the "add" form (7 fields) - the "modify" form (4 fields+3 fields uneditable (just echo them on screen) I am using the model validation... (thus it is impt for me to keep user-input after i prompt them for error BUT... Whenever i submit with errors for th

Re: cakephp Messaging sysytem

2011-02-23 Thread Josh
Hey euromark, That looks like exactly what I'm trying to do. Could you also let us know what columns are in each table? I'm sort of following your logic, but not 100% and I think seeing the table columns would help a lot. ~Josh -- Our newest site for the community: CakePHP Video Tutorials

Re: problems populating my select box

2011-02-23 Thread barricades
Hey Cricket, thanks for the extra info. > It could be your mail client doing that. Most clients recognise URLs > in text and auto-link them. Sometimes they screw up. In gmail, for me, > it's pointing to the correct address. I'm viewing this thread through the google group in my browser, thats wh

cookbook experience

2011-02-23 Thread rj
Hi, this is just to share some experiences with the fabulous new cookbook. Last week the dynamic table of contents in combination with the search field worked for me for the first time (on FF 3.6). That's really cool! (It throws an error though in IE7, details below, and no table of contents at al

Re: problems populating my select box

2011-02-23 Thread cricket
On Wed, Feb 23, 2011 at 1:45 PM, barricades wrote: > > Ah, I see. Thanks for the info. My first comment was maybe a bit confusing. When I said that the value we want is Charity.id I meant that's the key from find('list') that we should be the value of the select list. The *name* of the select is

Re: problems populating my select box

2011-02-23 Thread Stephen
Ah, thank you! I didn't realise it was doing that :) Good luck with your CakePHP venture Barricades. On 23 February 2011 18:45, barricades wrote: > > Ah, I see. Thanks for the info. > > By the way I clicked on your website but 'coz it doesn't have the http > it actually points at http://www.goo

Re: problems populating my select box

2011-02-23 Thread barricades
Ah, I see. Thanks for the info. By the way I clicked on your website but 'coz it doesn't have the http it actually points at http://www.google.com/www.ninjacodermonkey.co.uk On Feb 23, 4:00 pm, Stephen wrote: > Because of the association between Campaign and Charity. > > Your campaign table sh

Re: AJAX - ACL redirection

2011-02-23 Thread Julien Barbedette
I already implemented an AJAX layout and I detect in my app_controller if it is an AJAX request or a classic HTTP request. In fact, I don't want to redirect the user to login action. Simply I can have a user who IS ALREADY LOGGED IN and click on an AJAX action that he can't access. So I want to di

RE: AJAX - ACL redirection

2011-02-23 Thread Krissy Masters
I asked similar question a while back and no answers. There is an $this->Auth->ajaxLogin = '/elements/users/expired_login'; option you can add in app_controller My problem is a lot of my ajax calls are waiting for a JSON response.status true or false then do something based on that so nothing hap

Re: AJAX - ACL redirection

2011-02-23 Thread Tilen Majerle
and i forgor...maybe you want to disable autoRedirect option http://book.cakephp.org/view/1274/autoRedirect -- Lep pozdrav, Tilen Majerle http://majerle.eu 2011/2/23 Tilen Majerle > first, use RequestHandler componentthen check if is Ajax request so... > > if ($this->RequestHandler->is

Re: AJAX - ACL redirection

2011-02-23 Thread Tilen Majerle
first, use RequestHandler componentthen check if is Ajax request so... if ($this->RequestHandler->isAjax()) { $this->layout = 'ajax'; } else //not ajax, make redirect { $this->redirect('/'); } make a layout new and name it "ajax.ctp" and put this inside: and in a view of controller, action,

AJAX - ACL redirection

2011-02-23 Thread Julien Barbedette
Hi, By default, the Auth component used with the ACL component redirects the user to the referer when this one can't access to the controller/ action (last lines of method startup in auth component): if ($this->isAuthorized($type)) { return true;

Re: problems populating my select box

2011-02-23 Thread Stephen
Because of the association between Campaign and Charity. Your campaign table should have the field "charity_id" which links it to a charity, not by the charity name. My apologies for not realizing this initially. -- Kind Regards Stephen @ NinjaCoderMonkey www.ninjacodermonkey.co.uk -- Our

Re: date time calendar picker

2011-02-23 Thread Tapan Kumar Thapa
No i am sorry but i don't want to use ajax at all as i don't have much knowledge on this. I just to enable start and end date search via a calendar which should have date and time with seconds feature so i have found out jquery calendar ( http://jqueryui.com/demos/). I want to implement this with

Re: problems populating my select box

2011-02-23 Thread barricades
Yea, That worked! I don't understand how though. Why Campaign.charity_id? On Feb 22, 7:35 pm, cricket wrote: > > Try Campaign.charity_id as the input name. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://a

Re: A Small Problem

2011-02-23 Thread Jeremy Burns | Class Outfit
Have you tried a PHP specific forum? Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 22 Feb 2011, at 13:02, Samsung Galaxy wrote: > I have one PHP script where there are two options for the users to > choose. > > Option 1 is to Select the type of Graph and O

Benchmark

2011-02-23 Thread Chris DB
I am a new comer and fresh patissier for CakePHP. My Question: CakePHP use the concept of benchmarking to assess the performance of cake defined actions or methods of framework classes in response time? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check ou

Re: JsHelper request question

2011-02-23 Thread DavidJ
Hi, I had the same question few days ago. find the solution, (I give my example of form creation you can use your way) echo $this->Form->create(null,array( 'default' => false, 'inputDefaults' => array( 'label' => false, 'div' => false ) )); echo $this->Form->input('da

A Small Problem

2011-02-23 Thread Samsung Galaxy
I have one PHP script where there are two options for the users to choose. Option 1 is to Select the type of Graph and Option 2 is to choose from [Day, Week, Month or Year] now it looks like this. //For Option 1 if (!isset($_POST['mydropdown'])){ $value = 4;}else{ $value = $_POST['mydropdo

Re: Change the Database at Login by user choice

2011-02-23 Thread Stephen
Interesting! I could have used this a while ago On 22 February 2011 08:45, John Andersen wrote: > You have to look into using the models attribute useDbConfig, see the > CakePHP book at: > http://book.cakephp.org/view/1058/useDbConfig > > and applying it in the controllers beforeFilter method d

Re: hiding link from certain users.

2011-02-23 Thread Stephen
$session->read('Auth.User.column'); You can access the user's record from within a view like the above, so as long as your group is specified in the user record (say ... group_id) if($session->read('Auth.User.group_id') == 'superuser') { } This assumes you are using the Auth componen

Re: date time calendar picker

2011-02-23 Thread Tapan Kumar Thapa
Hello Community, Finally i have got one jquery based calendar. http://jqueryui.com/docs/Getting_Started how to from this site: *JS:* $('#date').datepicker(); My current code to select date with form helper is: echo $this->Form->create(array('controller' => 'users', 'action' => 'view')); ec

Re: Relations between models

2011-02-23 Thread Axel
Okay thanks! This question was an introduction to another one : When you do this, aren't you consuming too much ressources? I believe not but just in case, because ressources can become quickly a bottleneck in a site with a lot of visitors so I4would like to know the best practices in that case (a

Re: isAuthorized problem with mixed case actions

2011-02-23 Thread chris
Thanks for the reply. I will ensure I check agaisnt the lowercase form of the action in my isAuthorized function. On Feb 22, 7:26 pm, cricket wrote: > On Tue, Feb 22, 2011 at 11:35 AM, chris > wrote: > > Whilst going through the security of my application, I've noticed a > > flaw. I'm not sure

Re: Relations between models

2011-02-23 Thread Jeremy Burns | Class Outfit
Don't worry too much about the hows and whys. If your models are associated in any way you can reach a distantly related model to run any model method as described earlier. It's a very useful and powerful facility. Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com

Re: Relations between models

2011-02-23 Thread Axel
Very interesting! When you speak of $this->Car->Race->Spectator, the "->" arrow can represent any association, belongsTo, hasMany, hasOne,..? I find quite hard to understand how a model can be a property or attribute of another object model? The constructing of those model classes is still full o