Re: setting the value of a checkbox

2010-10-05 Thread james livsey
thanks Iqbal!

On Tue, Oct 5, 2010 at 11:40 AM, Iqbal Santyaswardan isant...@gmail.comwrote:

 If the field is changeable by user, you might have an ObserveField set
 to that field.  See Ajax Helper.

 Regards

 On Tue, Oct 5, 2010 at 5:15 PM, james jamesliv...@googlemail.com wrote:
  Hi i was wondering how i might set the default value of a checkbox to
  the value of the field before it? So if the value of the field before
  it is 1 then the checkbox would be checked by default?
 
  thanks
 
  Check out the new CakePHP Questions site http://cakeqs.org and help
 others with their CakePHP related questions.
 
  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.comcake-php%2bunsubscr...@googlegroups.comFor
   more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en
 

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: date fields

2010-09-29 Thread james livsey
yeah its a database field - just a regular date outputting 'September 29
2010' but i need to 'add' the day to that  output - does that make sense?

so if the outputted date is the above i need to work out that the day is a
Wednesday.

Thanks for replying!

On Wed, Sep 29, 2010 at 3:19 PM, Tilen Majerle tilen.maje...@gmail.comwrote:

 Time Helper u mean?

 or u mean database fields? created and modified (updated)

 --
 Tilen Majerle
 http://majerle.eu



 2010/9/29 james jamesliv...@googlemail.com

 Hi,

 is there a cake way to work out the day from a date field?

 thanks

 Check out the new CakePHP Questions site http://cakeqs.org and help
 others with their CakePHP related questions.

 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.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


  Check out the new CakePHP Questions site http://cakeqs.org and help
 others with their CakePHP related questions.

 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.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 a value when user clicks a link

2010-09-28 Thread james livsey
Hi

Well its during the creation of an advert that the relevant field in
appointments would need to be updated so it seemed like the best place to do
it

thanks

On Mon, Sep 27, 2010 at 7:19 PM, cricket zijn.digi...@gmail.com wrote:

 On Mon, Sep 27, 2010 at 10:24 AM, james livsey
 jamesliv...@googlemail.com wrote:
  Thanks Cricket,
 
  I added that code as you suggested. While it doesnt cause any errors it
  doesnt seem to modify the field data either.
 
  what I have is:
 
 function add($appointment_id = null){
 //existing code
 $this-Advert-Appointment-id = $appointment_id;
 $this-Advert-Appointment-saveField('appointment_status',
 'Order');
 $this-Advert-create();
 }
 
 
  does that look about right?
 
  And yeah your right i should change it to status
 
 You've got create() in the wrong place. That should come first, if
 it's included at all. See the API:

 http://api.cakephp.org/class/model#method-Modelcreate

 $this-Advert-Appointment-create(array('Appointment' = array('id'
 = $appointment_id)));

 That will initialize the instance with the appropriate id.

 Actually, why are you calling create() on Advert, instead of
 Appointment? I'm guessing there's more to this method.

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: editing rows from index.cttp

2010-09-27 Thread james livsey
Hi Jeremy thankyou for replying.

yes there are multiple rows and the idea is that it would be more user
friendly if the user could 'batch update' multiple records in one view.

so in my index i have the normal columns of data eg

td?php echo $advert['Advert']['ad_size']; ?nbsp;/td

but at the end there is the addition of:

td
$this-Form-create('Advert');
echo $form-input('contract_received');
/td

with the form end after the foreach (so there isnt a submit for every row):

   ?php echo $this-Form-end(__('Submit', true));?

On the controller i tried using saveAll as following

   $this-Advert-set($this-data);
   $this-Advert-saveAll($this-data);

but i think im missing the way to 'fire' the event.

Does that sound like the right way of doing it? At the moment the submit
button doesnt do anything.

Thanks - hope that isnt too confusing

On Fri, Sep 17, 2010 at 2:47 PM, Jeremy Burns | Class Outfit 
jeremybu...@classoutfit.com wrote:

 Do you mean that there are multiple rows, each of which could have been
 updated? If so, (assuming that your form encompasses all of the potential
 updates) check your $this-data array when the form is submitted. Depending
 upon its structure you can either do a saveAll($this-data) or loop through
 and do a series of saves.

 Jeremy Burns
 Class Outfit

 jeremybu...@classoutfit.com
 http://www.classoutfit.com

 On 17 Sep 2010, at 14:38, james wrote:

  Hi I have a field that shows if a contract has been received or not in
  my index view. This field needs to be editable from within the same
  view with one submit button committing the changes to the table. Is
  this possible? Im not entirely sure as to the correct way to go about
  this?
 
  Thanks in advance
 
  Check out the new CakePHP Questions site http://cakeqs.org and help
 others with their CakePHP related questions.
 
  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.comcake-php%2bunsubscr...@googlegroups.comFor
   more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 a value when user clicks a link

2010-09-27 Thread james livsey
Thanks Cricket,

I added that code as you suggested. While it doesnt cause any errors it
doesnt seem to modify the field data either.

what I have is:

   function add($appointment_id = null){
   //existing code
   $this-Advert-Appointment-id = $appointment_id;
   $this-Advert-Appointment-saveField('appointment_status', 'Order');
   $this-Advert-create();
   }


does that look about right?

And yeah your right i should change it to status

On Fri, Sep 17, 2010 at 6:42 PM, cricket zijn.digi...@gmail.com wrote:

 On Fri, Sep 17, 2010 at 6:22 AM, james jamesliv...@googlemail.com wrote:
  Hi,
 
  I have a table that holds appointments and in view.ctp there is a link
  that allows the user to convert that appointment to an advert and
  passes the id of the appointment and the name of the business involved
  to the add.ctp view for adding an advert.
 
  When this happens i need an appointment_status field in the
  appointments table to update to Ordered. How can I do this? i cant
  seem to be able to include it in the save method of the add advert.

 Assuming there's an association between Advert and Appointment:

 $this-Advert-Appointment-id = $id;
 $this-Advert-Appointment-saveField('appointment_status', 'ordered');

 BTW, why don't you name the field just 'status'? Seems a bit redundant.

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: setting options to add inputs

2010-08-23 Thread james livsey
Hi Cricket,

where do you declare that in the controller? So for example if the model
with the displayField I need to rename is Media and the corresponding model
is Host would i declare

$this-Mdeia-Host-displayField = '...';

in each function in the controllers?

thanks for your help

On Fri, Aug 20, 2010 at 5:03 PM, cricket zijn.digi...@gmail.com wrote:

 On Fri, Aug 20, 2010 at 10:48 AM, james livsey
 jamesliv...@googlemail.com wrote:
  Hi cricket,
 
  thanks for that. Yes thats the kind of thing im looking for but the
 fields i
  need to use as the display field actually belong to another model. Is
 that
  possible to declare in the model?
  Like
  $displayField = OtherModel.displayField;
  ?

 $this-Model-OtherModel-displayField = '...';

 Or, you can define it in the other model if it's not going to be
 changing. The above is something you'd do if displayField needed to be
 changed in certain situations. If you don't need that put it in the
 class definition..

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: setting options to add inputs

2010-08-20 Thread james livsey
Hi cricket,

thanks for that. Yes thats the kind of thing im looking for but the fields i
need to use as the display field actually belong to another model. Is that
possible to declare in the model?
Like
$displayField = OtherModel.displayField;
?

On Thu, Aug 19, 2010 at 5:10 PM, cricket zijn.digi...@gmail.com wrote:

 On Thu, Aug 19, 2010 at 10:38 AM, james jamesliv...@googlemail.com
 wrote:
  In one of my add views there is a drop down that allows the user to
  specify associated records via id fields. I was wondering if there was
  a way to add exra info to this to make it more user friendly.

 Search for cakephp displayfield. I think that's what you want.

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 component issue

2010-08-12 Thread james livsey
yes that must be it. Its encrypting the encrypted password!
cheers!

On Thu, Aug 12, 2010 at 2:41 PM, Max Dörfler max.doerf...@googlemail.comwrote:

 Hi,

 that is beacuse when you create the user, the plaintext password gets
 encrypted. When you now edit the user, the encrypted password gets loaded
 and when you save your user, the encrypted password gets encrypted again.
 (so the already encrypted password is handled as if it's a plaintext
 password).
 So, to keep the encrypted password, don't save it again. (unset the
 password field or don't load it or exclude it from your fields array or ...)

 Greetings
 Max

 Am 12.08.2010 14:32, schrieb james:

  Hi,

 I'm using the auth component and ive noticed that if i edit a users
 details from within the app it automatically changes the encrypted
 password. Any ideas as to why it would do this?

 thanks,

 James.

 Check out the new CakePHP Questions site http://cakeqs.org and help
 others with their CakePHP related questions.

 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.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en



 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: HABTM

2010-08-03 Thread james livsey
Thanks! I thought that would be the case but i didnt want to miss a trick
later on in development.


On Tue, Aug 3, 2010 at 11:39 AM, Anthony anthony.c.fra...@gmail.com wrote:

 No. In the same sense that you don't need to create controllers or
 views for DB models you won't be directly interfacing with.

 On Aug 2, 9:45 am, james jamesliv...@googlemail.com wrote:
  Just out of interest, I haent done much with habtm relationships yet
  (they're a bit messy!) but its unavoidable. That being the case, do
  you have to include models and views for join tables?
 
  Thanks!

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Please help | Newbie in cakephp

2010-07-14 Thread james livsey
Have you tried to decalre the display field?

if you add the line

var $displayField = 'name';

in the artists model class it should show the name instead of the id field.

Hope that helps!


On Wed, Jul 14, 2010 at 4:15 AM, Jramirez07 jramire...@gmail.com wrote:

 Hello,

 I am very new to cake and started using to test things out and so far
 loving it. Have had some complications and been searching everywhere
 for answers on it but no luck.

 Here's what I have:

 two models: Artists  Albums which are associated with each other with
 the hasMany / hasOne respectively.
 Both model Controllers have the standard CRUD with some minor
 modifications which i'll explain below.
 Database is a follows:

 //Artist DB
 artists.id_artists
 artists.name

 //Album DB
 albums.id_albums
 albums.id_artists
 name
 year

 Problem is in the view of my Album: I can successfully add new Albums
 with the standard 'add' that bake generates for me (with some
 modification for selecting the Artist in a Select Drop Down Box
 instead of an input box for the id) but when I go back to the index
 (the list Albums), I'm getting the album.id_artist (along side
 album.name and album.year)

 How can I change the album.id_artist  to reflect  artists.name  as I
 do not want my users to see the id of the artist.

 Please heeelp!

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: filtering

2010-07-08 Thread james livsey
well for me I'm after they ability for a user to filter the data in an index
view through a couple of drop downs and a button labelled filter? I was
thinking AJAX might be the way to go but I'd be happy to use any method
really.

On Thu, Jul 8, 2010 at 3:25 PM, Shaz shazam...@gmail.com wrote:

 What sort of filtering and for what are you after?

 On Jul 8, 10:08 am, james jamesliv...@googlemail.com wrote:
  Hi I am also looking for some advice on filtering. Are these the best
  tutorials?
 
  thanks.

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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