Re: Model findAll Error

2007-08-01 Thread francky06l

calling a method is case sensitive:

function getIdAliasArray()

you were probably calling "getidaliasarray" instead of
"getIdAliasArray" as  mentionned into the Sql message. If you call a
method for a model that does not exists, it seem to be passed to Sql,
and this is why you see this message.

hope this help

On Aug 1, 10:52 pm, starkey <[EMAIL PROTECTED]> wrote:
> Odd, I moved it to my controller and it worked fine...  Can someone
> explain why?  Thanks!
>
> function add()
> {
>$selectBoxData = $this->Aro->findAll(null,array('id','alias'),'alias 
> ASC',null,1,0);
>
>...
> }
>
> On Aug 1, 4:46 pm, starkey <[EMAIL PROTECTED]> wrote:
>
> > Okay, I'm sure I'm really showing my noobie stripes with this one...
>
> > As a learning exercise I'm creating a front end for ACL.
>
> > Instead of using generateList to populate a selectTag I thought I'd
> > try a custom query by adding a method to my model and call it from the
> > controller.  Here is the method:
>
> > function getIdAliasArray()
> > {
> >$arr = $this->findAll(null,array('id','alias'),'alias ASC');
> >return($arr);
> > }
>
> > Well, this causes an error because it tries to run "getidaliasarray"
> > as if it were an SQL query instead of a method name.  Here is the
> > error:
> > Query: getidaliasarray
> > Warning: SQL Error: 1064: You have an error in your SQL syntax; check
> > the manual that corresponds to your MySQL server version for the right
> > syntax to use near 'getidaliasarray' at line...
>
> > I even set DEBUG to 2 and it pumped out "getidaliasarray" along with
> > all of the other queries.
>
> > What am I doing wrong here?
>
> > Thanks!
> > Shawn


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: passing data from model to controller

2007-08-01 Thread francky06l

well, I am a bit lost. I do not know what you want to achieve. Just
few comments :

- in your finddata() you should try to use the Cake convention  with
findAll
- afterSave() will be called also when you update data, it does not
seems to be the right place to handle the inserted Id.
- Why not handling the membership_id in the function where you
actually call save() ?

Again, I do not know what you want to achieve, but the overall
approach seems weird regarding the code posted here.

On Aug 2, 12:16 am, rtanz <[EMAIL PROTECTED]> wrote:
> thanks so i reviewed my code, the remaining problems are:
> 1. $membership_id is not being passed correctly
> 2. im not sure how to save the returned arrays into tasklist records
> any help on this? thanks
>
> 
> class Membership extends AppModel
> {
> var $name = 'Membership';
> var $belongsTo = array('Module','Role','User');
>
> function afterSave(){
> $membership_id = $this->getLastInsertId();
> //$membership_id = 1; //getlastid
> $this->requestAction('tasklists/add/$membership_id');
> return true;
> }
>
> }
>
> ?>
>
> Tasklist controller:
>
> function add($membership_id) {
> $tasklists = $this->Tasklist->finddata($membership_id);
> $this->set('tasklists',$tasklists);
>
> }
>
> class Tasklist extends AppModel
> {
> var $name = 'Tasklist';
> var $belongsTo = array('Module','Task','User');
>
> function finddata($membership_id) {
>
> return $this->query("SELECT
> `memberships`.`module_id`,`memberships`.`user_id`, `tasks`.`id`as
> task_id
> FROM 
> `memberships` , `tasks`
> WHERE 
> `tasks`.`role_id` =  `memberships`.`role_id` AND
> `memberships`.`id`=$membership_id");
> //  debug($ret);
>
> return $ret;
> }
>
> }
>
> ?>


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Multiple field values in select box?

2007-08-01 Thread Beertigger

Anyone? I'm pulling my hair out here. This is something that should be
basic, shouldn't it? I'll freely admit I'm an idiot, but I'm just not
understanding this ; (


Thanks to anyone willing to point me in the right direction.

On Aug 1, 9:38 am, Beertigger <[EMAIL PROTECTED]> wrote:
> Multiple model fields in generatelist... ?
>
> Moving this one along a bit
> I've tried every which way to get this one to work, and I'm stumped.
> Using afterFind on info from one table works just fine; putting this
> in the Player model:
> function afterFind($results) {
>  foreach ($results as $key => $val) {
> $results[$key]['Player']['fullname'] =
> $val['Player']['fname'] . ' ' . $val['Player']['lname'];
> }
> return $results;
> }
> lets me use 'fullname' in controllers easily enough.
> How do I get something from another table to concat nicely.
> Code like
> function afterFind($results) {
>  foreach ($results as $key => $val) {
> $results[$key]['Team']['teamsport'] =
> $val['Team']['team'] . ' ' . $val['Sport']['sport'];
> }
> return $results;
> }
> only gets me the field from the Team table when it's in the Team
> model, and throws a Notice: Undefined index: Sport in...blahblahblah
> error.
> Team belongsto Sport, Sport hasmany Team
> What kinda hoops do I need to jump threw to get this info in a Cake-y
> manner? I need to generate a select in another controller. If
> somebody'd hold my hand on this one, it'd be greatly appreciated...
> Thanks!
>
> On Jul 28, 8:35 am, cauld <[EMAIL PROTECTED]> wrote:
>
> > Not exactly a cake solution, but in the past I've created a database
> > view an concatenated the two columns I want in the SQL (ex)
> > concat(last_name, ', ', first_name) and then passed the view results
> > to generateList().  Perhpas you could do the same with query() and
> > pass those results to generateList(), but I've not tried that method
> > so can't say it would work, just thinking out loud.  Hope that is
> > helpful.
>
> > On Jul 27, 11:17 pm,Beertigger<[EMAIL PROTECTED]> wrote:
>
> > > Is there any way to get values from multiple fields into a select box?
>
> > > After much searching, I've come to the conclusion I'm not going to
> > > find the answer without appealing to those far wiser than myself...
>
> > > Here's an old thread for reference, which discusses, w/o resolution,
> > > exactly what I'm looking for:
>
> > > "* Is it possible to use multiple fields to make up the value of the
> > > select box?  Such that it would come out looking something like
>
> > > field2value - field3value"
>
> > >http://groups.google.com/group/cake-php/browse_thread/thread/50a2ecaf...
>
> > > So, just wondering if anyone ever made any progress on this. Saw the
> > > code in trac, but it seems to be for 1.2 (?). Couldn't get it to work,
> > > anyway. I'd find this functionality very valuable
>
> > > Thanks to anyone for any help!


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Extending AppController

2007-08-01 Thread Jon Bennett

Hi Safi,

> And not all controllers are modules so i do not wish for all
> controllers in /controllers to extend Module controller.
> Only the ones which are "Modules".
> By doing this the code is quite easy to follow and understand which
> parts are responsible for what.
>
> But my problem is the nasty solution of dumping the class definition
> into /app/app_controller.php ...
> All ideas, tips and hints are very welcome!

I think you may have a very hard of it if you go this route, as you're
straying massively from how cake does things. My advice would be to
refactor your app so it fits more with how cakephp works.

sorry, I realise that's not much help, but I don't think you'll get
much help because you're really trying to break cake's conventions,
rather than working within it's confines (it much easier if you do,
trust me!).

cheers,

Jon

>
> On Aug 2, 12:54 am, safl <[EMAIL PROTECTED]> wrote:
> > thx for all the replies.
> >
> > I should have said that i already tried placing a
> > module_controller.php in /app/, that didn't work.
> > When i then let my controllers inside of /controllers extend
> > ModuleController, i get the error "class not found or something like
> > that".
> > Problem is that module_controller.php in /app/module_controller.php
> > (right next to app_controller.php) is not the the include path and not
> > loaded at the right "time" as the basics.php in /cake does.
> > I tried fixing this by adding the /app path to php's include path
> > inside of /app/config/bootstrap.php but that didnt work either.
> >
> > My current solution is that i have simply dumped the class definition
> > inside of /app/app_controller.php.
> > Now i don't even have to say this, but that is one ugly solution :)
> >
> > To be more clear about what i wish to achieve. I wan't my
> > ModuleController to be an extension of AppController.
> >
> > As a design point of view this makes AppController a more "abstract"
> > or "general" class than ModuleController. The AppController contains
> > everything that is required for an "Application Controller", the
> > "Module Controller" extends this functionality and properties and
> > implements stuff which is only needed for "Modules".
> >
> > The application I'm doing is fairly big. I got 11 "Modules"
> > integrated. (Helpdesk, Surveillance, Inventory Management etc..).
> >
> > Therefore i really wan't to split the controller logic into smaller
> > chunks.
> >
> > On Aug 1, 9:33 pm, francky06l <[EMAIL PROTECTED]> wrote:
> >
> > > Hi LS, did not think about this .. but I safi wants to make different
> > > classes inherit from a bunch of  "specialized" AppControler, this not
> > > the way .. If all classes inherit from "ModelController", better to
> > > "enhance" AppController itself ..
> > > This is my 2 cents on top  :-)
> >
> > > On Aug 1, 9:27 pm, LS <[EMAIL PROTECTED]> wrote:
> >
> > > > My 2 cents:
> > > > Make model_controller.php in the same level as app_controller.php
> > > > make this model_controller declaration:
> > > > class ModelController extends Controller {}
> > > > and this app_controller declaration:
> > > > class AppController extends ModelController {}
> >
> > > > This way, you won't have to change any controller in your application.
> >
> > > > Regards,
> > > > - LS
> >
> > > > On Aug 1, 4:11 pm, francky06l <[EMAIL PROTECTED]> wrote:
> >
> > > > > I think you can place your module_controller.php file at same level of
> > > > > app_controller.php. This should work without problem having you
> > > > > ModuleController extending AppController and other controller
> > > > > extending ModuleController.
> >
> > > > > On Aug 1, 5:54 pm, safl <[EMAIL PROTECTED]> wrote:
> >
> > > > > > Hello,
> >
> > > > > > I would like to have different controller types that are extends of
> > > > > > the basic AppController.
> >
> > > > > > Let's say i got "class ModuleController extends AppController" where
> > > > > > should i then place my "module_controller.php" so my controllers in 
> > > > > > /
> > > > > > controllers be able to: "class WhateverController extends
> > > > > > ModuleController" instead of "class WhateverController extends
> > > > > > AppController"?
> > > > > > And without messing with the Cake installation.
> >
> > > > > > The thing is I got a bunch of logic in AppController in beforeFilter
> > > > > > and the use of a couple of components and stuff like that but I only
> > > > > > wan't a subset of my controllers in /controller to inherit these
> > > > > > properties.
> >
> > > > > > And other controllers will very soon like to inherit some other
> > > > > > properties of some other controller type.
> >
> > > > > > regards,
> > > > > > Simon
>
>
> >
>


-- 


jon bennett
t: +44 (0) 1225 341 039 w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-

Re: uploading files

2007-08-01 Thread rtanz

thnx i already searched those before, i was just wondering whether
there is some simple in built functionality that i could use as my
needs seem to be pretty simple to me.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



progress report matrix

2007-08-01 Thread rtanz

hi i would like to have a report page that shows which tasks have been
completed or not. in my system the aim is to fill in reviews so i
would like to read each record in the reviews table and build a sort
of matrix to show if each field of the record has been filled in or
not:

 Task 1Task 2Task 3
Review 1Done  Pending  Done
Review 2Pending  Pending  Pending

how should i go about doing this? thanks


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: uploading files

2007-08-01 Thread Samuel DeVore

mmm try searching before asking and people will be less grumpy





or




On 8/1/07, rtanz <[EMAIL PROTECTED]> wrote:
>
> hi i need a simple file upload function, basically the users would be
> filling in a form and have to upload two files in the form. I dont
> need anything fancy just the facility to specify the location of the
> file and then the files get uploaded on submitting the form. When they
> view the form they should see a link to the uploaded file.
>
> is there some built in cake facility to do this or should i be looking
> at other solutions? thanks
>
>
> >
>


-- 
(the old fart) the advice is free, the lack of crankiness will cost you

- its a fine line between a real question and an idiot

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



uploading files

2007-08-01 Thread rtanz

hi i need a simple file upload function, basically the users would be
filling in a form and have to upload two files in the form. I dont
need anything fancy just the facility to specify the location of the
file and then the files get uploaded on submitting the form. When they
view the form they should see a link to the uploaded file.

is there some built in cake facility to do this or should i be looking
at other solutions? thanks


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Validation fails but shows no error

2007-08-01 Thread burzum

http://doomzone.de/cake/
I've uploaded the files there as phps files, click them and they'll
appear as colored source code.

On Aug 1, 10:41 pm, francky06l <[EMAIL PROTECTED]> wrote:
> Could you past code from model and controller in the bin ?
>
> On Aug 1, 10:20 pm, rtconner <[EMAIL PROTECTED]> wrote:
>
> > you need error('Model.field')?> in your view.
>
> > On Aug 1, 1:57 pm, burzum <[EMAIL PROTECTED]> wrote:
>
> > > Im using the save() method but tried also your suggestion - it does
> > > not work.
>
> > > On Aug 1, 8:39 pm, francky06l <[EMAIL PROTECTED]> wrote:
>
> > > > Do you use save() function or invalidates to get the validation ? If
> > > > you use the validates function, a tip :


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: integrate third party ajax library

2007-08-01 Thread Grant Cox

You should just be able to change that to

new Ajax.Request( '/your_controller/action', { method:
'POST',parameters: pars, onComplete: onCompleteCallBack });

then in that action, have a $this->log($this->params) to see how the
data is arriving.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: String fields empty on a create()?

2007-08-01 Thread Grant Cox

If you put a default value on the table fields, this should be used in
model->create()


On Aug 2, 7:07 am, chewie124 <[EMAIL PROTECTED]> wrote:
> Hi -
> I'm using cake 1.2 - Just a quick question - How come string fields
> (varchar in the DB) don't have their keys set when you do a model-
>
> >create()?  Is there a way to make it so it is?
>
> Thanks,
> Rich


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Help with initial setup

2007-08-01 Thread Grant Cox

And how is Cake to fit in with your existing site?  Are you going to
move the entire site into a single Cake app (it sounds like it), or is
Cake just going to be for some areas / applications?  What are your
reasons for choosing to do it this way?

You do not have to keep the webroot structure - by default anything
that is in webroot is accessible via a direct url, and only if a
request does not match a webroot file is it passed to the Cake
dispatcher to execute as a controller action.  If you do change the
folder names you will want to copy the /cake/config/paths.php to /app/
config/paths.php and update the defines in there - so you can continue
to use the HtmlHelper.

And in general, just get cake set up and working on a small scale
first.  Once you have a good idea of how it is actually structured,
then it will be more obvious how you can modify it.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Extending AppController

2007-08-01 Thread safl

And not all controllers are modules so i do not wish for all
controllers in /controllers to extend Module controller.
Only the ones which are "Modules".
By doing this the code is quite easy to follow and understand which
parts are responsible for what.

But my problem is the nasty solution of dumping the class definition
into /app/app_controller.php ...
All ideas, tips and hints are very welcome!

On Aug 2, 12:54 am, safl <[EMAIL PROTECTED]> wrote:
> thx for all the replies.
>
> I should have said that i already tried placing a
> module_controller.php in /app/, that didn't work.
> When i then let my controllers inside of /controllers extend
> ModuleController, i get the error "class not found or something like
> that".
> Problem is that module_controller.php in /app/module_controller.php
> (right next to app_controller.php) is not the the include path and not
> loaded at the right "time" as the basics.php in /cake does.
> I tried fixing this by adding the /app path to php's include path
> inside of /app/config/bootstrap.php but that didnt work either.
>
> My current solution is that i have simply dumped the class definition
> inside of /app/app_controller.php.
> Now i don't even have to say this, but that is one ugly solution :)
>
> To be more clear about what i wish to achieve. I wan't my
> ModuleController to be an extension of AppController.
>
> As a design point of view this makes AppController a more "abstract"
> or "general" class than ModuleController. The AppController contains
> everything that is required for an "Application Controller", the
> "Module Controller" extends this functionality and properties and
> implements stuff which is only needed for "Modules".
>
> The application I'm doing is fairly big. I got 11 "Modules"
> integrated. (Helpdesk, Surveillance, Inventory Management etc..).
>
> Therefore i really wan't to split the controller logic into smaller
> chunks.
>
> On Aug 1, 9:33 pm, francky06l <[EMAIL PROTECTED]> wrote:
>
> > Hi LS, did not think about this .. but I safi wants to make different
> > classes inherit from a bunch of  "specialized" AppControler, this not
> > the way .. If all classes inherit from "ModelController", better to
> > "enhance" AppController itself ..
> > This is my 2 cents on top  :-)
>
> > On Aug 1, 9:27 pm, LS <[EMAIL PROTECTED]> wrote:
>
> > > My 2 cents:
> > > Make model_controller.php in the same level as app_controller.php
> > > make this model_controller declaration:
> > > class ModelController extends Controller {}
> > > and this app_controller declaration:
> > > class AppController extends ModelController {}
>
> > > This way, you won't have to change any controller in your application.
>
> > > Regards,
> > > - LS
>
> > > On Aug 1, 4:11 pm, francky06l <[EMAIL PROTECTED]> wrote:
>
> > > > I think you can place your module_controller.php file at same level of
> > > > app_controller.php. This should work without problem having you
> > > > ModuleController extending AppController and other controller
> > > > extending ModuleController.
>
> > > > On Aug 1, 5:54 pm, safl <[EMAIL PROTECTED]> wrote:
>
> > > > > Hello,
>
> > > > > I would like to have different controller types that are extends of
> > > > > the basic AppController.
>
> > > > > Let's say i got "class ModuleController extends AppController" where
> > > > > should i then place my "module_controller.php" so my controllers in /
> > > > > controllers be able to: "class WhateverController extends
> > > > > ModuleController" instead of "class WhateverController extends
> > > > > AppController"?
> > > > > And without messing with the Cake installation.
>
> > > > > The thing is I got a bunch of logic in AppController in beforeFilter
> > > > > and the use of a couple of components and stuff like that but I only
> > > > > wan't a subset of my controllers in /controller to inherit these
> > > > > properties.
>
> > > > > And other controllers will very soon like to inherit some other
> > > > > properties of some other controller type.
>
> > > > > regards,
> > > > > Simon


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Extending AppController

2007-08-01 Thread safl

thx for all the replies.

I should have said that i already tried placing a
module_controller.php in /app/, that didn't work.
When i then let my controllers inside of /controllers extend
ModuleController, i get the error "class not found or something like
that".
Problem is that module_controller.php in /app/module_controller.php
(right next to app_controller.php) is not the the include path and not
loaded at the right "time" as the basics.php in /cake does.
I tried fixing this by adding the /app path to php's include path
inside of /app/config/bootstrap.php but that didnt work either.

My current solution is that i have simply dumped the class definition
inside of /app/app_controller.php.
Now i don't even have to say this, but that is one ugly solution :)

To be more clear about what i wish to achieve. I wan't my
ModuleController to be an extension of AppController.

As a design point of view this makes AppController a more "abstract"
or "general" class than ModuleController. The AppController contains
everything that is required for an "Application Controller", the
"Module Controller" extends this functionality and properties and
implements stuff which is only needed for "Modules".

The application I'm doing is fairly big. I got 11 "Modules"
integrated. (Helpdesk, Surveillance, Inventory Management etc..).

Therefore i really wan't to split the controller logic into smaller
chunks.


On Aug 1, 9:33 pm, francky06l <[EMAIL PROTECTED]> wrote:
> Hi LS, did not think about this .. but I safi wants to make different
> classes inherit from a bunch of  "specialized" AppControler, this not
> the way .. If all classes inherit from "ModelController", better to
> "enhance" AppController itself ..
> This is my 2 cents on top  :-)
>
> On Aug 1, 9:27 pm, LS <[EMAIL PROTECTED]> wrote:
>
> > My 2 cents:
> > Make model_controller.php in the same level as app_controller.php
> > make this model_controller declaration:
> > class ModelController extends Controller {}
> > and this app_controller declaration:
> > class AppController extends ModelController {}
>
> > This way, you won't have to change any controller in your application.
>
> > Regards,
> > - LS
>
> > On Aug 1, 4:11 pm, francky06l <[EMAIL PROTECTED]> wrote:
>
> > > I think you can place your module_controller.php file at same level of
> > > app_controller.php. This should work without problem having you
> > > ModuleController extending AppController and other controller
> > > extending ModuleController.
>
> > > On Aug 1, 5:54 pm, safl <[EMAIL PROTECTED]> wrote:
>
> > > > Hello,
>
> > > > I would like to have different controller types that are extends of
> > > > the basic AppController.
>
> > > > Let's say i got "class ModuleController extends AppController" where
> > > > should i then place my "module_controller.php" so my controllers in /
> > > > controllers be able to: "class WhateverController extends
> > > > ModuleController" instead of "class WhateverController extends
> > > > AppController"?
> > > > And without messing with the Cake installation.
>
> > > > The thing is I got a bunch of logic in AppController in beforeFilter
> > > > and the use of a couple of components and stuff like that but I only
> > > > wan't a subset of my controllers in /controller to inherit these
> > > > properties.
>
> > > > And other controllers will very soon like to inherit some other
> > > > properties of some other controller type.
>
> > > > regards,
> > > > Simon


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: passing data from model to controller

2007-08-01 Thread rtanz

thanks so i reviewed my code, the remaining problems are:
1. $membership_id is not being passed correctly
2. im not sure how to save the returned arrays into tasklist records
any help on this? thanks


getLastInsertId();
//$membership_id = 1; //getlastid
$this->requestAction('tasklists/add/$membership_id');
return true;
}

}

?>

Tasklist controller:

function add($membership_id) {
$tasklists = $this->Tasklist->finddata($membership_id);
$this->set('tasklists',$tasklists);
}

class Tasklist extends AppModel
{
var $name = 'Tasklist';
var $belongsTo = array('Module','Task','User');

function finddata($membership_id) {

return $this->query("SELECT
`memberships`.`module_id`,`memberships`.`user_id`, `tasks`.`id`as
task_id
FROM 
`memberships` , `tasks`
WHERE 
`tasks`.`role_id` =  `memberships`.`role_id` AND
`memberships`.`id`=$membership_id");
//  debug($ret);

return $ret;
}
}

?>


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CakePHP + AJAX+ charsets

2007-08-01 Thread francky06l

No problem, c'est du vecu :-)

On Aug 1, 1:37 pm, Femi Taiwo <[EMAIL PROTECTED]> wrote:
> francky06l - You're quite right!
> Re-saving the default.po file for French (& other languages ) with UTF-8 
> encoding solved the problem completely.
> Thanks! Now I don't need to specify the ISO-8859-1 charset in my 
> beforeRender() while I also leave the UTF-8 as my charset right from my 
> default layout.
> Femi
> francky06l wrote:Are the errors you see are in the language file for French ? 
> If so, I think you should save your language file in UTF-8 without BOM. On 
> Aug 1, 11:29 am, Femi Taiwo<[EMAIL PROTECTED]>wrote:Hi, The i10n version 
> (french in this case) of my cakephp application shows up with invalid 
> characters, if I'm loading up the view using ajax. If i use the classic full 
> reload of the page, everything's normal, but views loaded using ajax do not 
> render well. Accented characters show up as question marks or other funny 
> looking character. I thot it might have something to do with the set charset, 
> so i changed the charset from UTF-8 to  $html->charset('ISO-8859-1'). "\n"; ?> without results. I've included a small 
> screenshot in this mail hoping it would help. The left sidebar of the 
> displayed page came with the index.ctp while the part on the right was loaded 
> using ajax . Please has anyone experienced this before or have an idea how to 
> do this correctly Thanks. Cheers Femi T. french-i10n.jpg 19KViewDownload


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



String fields empty on a create()?

2007-08-01 Thread chewie124

Hi -
I'm using cake 1.2 - Just a quick question - How come string fields
(varchar in the DB) don't have their keys set when you do a model-
>create()?  Is there a way to make it so it is?

Thanks,
Rich


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Model findAll Error

2007-08-01 Thread starkey

Odd, I moved it to my controller and it worked fine...  Can someone
explain why?  Thanks!

function add()
{
   $selectBoxData = $this->Aro-
>findAll(null,array('id','alias'),'alias ASC',null,1,0);
   ...
}


On Aug 1, 4:46 pm, starkey <[EMAIL PROTECTED]> wrote:
> Okay, I'm sure I'm really showing my noobie stripes with this one...
>
> As a learning exercise I'm creating a front end for ACL.
>
> Instead of using generateList to populate a selectTag I thought I'd
> try a custom query by adding a method to my model and call it from the
> controller.  Here is the method:
>
> function getIdAliasArray()
> {
>$arr = $this->findAll(null,array('id','alias'),'alias ASC');
>return($arr);
> }
>
> Well, this causes an error because it tries to run "getidaliasarray"
> as if it were an SQL query instead of a method name.  Here is the
> error:
> Query: getidaliasarray
> Warning: SQL Error: 1064: You have an error in your SQL syntax; check
> the manual that corresponds to your MySQL server version for the right
> syntax to use near 'getidaliasarray' at line...
>
> I even set DEBUG to 2 and it pumped out "getidaliasarray" along with
> all of the other queries.
>
> What am I doing wrong here?
>
> Thanks!
> Shawn


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Paginating results of custom queries?

2007-08-01 Thread Arjen V
I've done this a while back. It probably isn't the best way, but it works.
I'm not sure if this was done with the most recent alpha, but it's easy to
recreate: just remove the code that's used to run the findAll query and make
it use the one you supply.

cake/app_controller.php

  function paginateResultSet($object = null, $results)
  {

  if (is_array($object)) {
  $whitelist = $scope;
  $scope = $object;
  $object = null;
  }

  if (is_string($object)) {
  if (isset($this->{$object})) {
  $object = $this->{$object};
  } elseif (isset($this->{$this->modelClass}) &&
isset($this->{$this->modelClass}->{$object})) {
  $object = $this->{$this->modelClass}->{$object};
  } elseif (!empty($this->uses)) {
  for ($i = 0; $i < count($this->uses); $i++) {
  $model = $this->uses[$i];
  if (isset($this->{$model}->{$object})) {
  $object = $this->{$model}->{$object};
  break;
  }
  }
  }
  } elseif (empty($object) || $object == null) {
  if (isset($this->{$this->modelClass})) {
  $object = $this->{$this->modelClass};
  } else {
  $object = $this->{$this->uses[0]};
  }
  }

  if (!is_object($object)) {
  // Error: can't find object
  return array();
  }
  $options = am($this->params, $this->params['url'], $this->passedArgs);

  if (isset($this->paginate[$object->name])) {
  $defaults = $this->paginate[$object->name];
  } else {
  $defaults = $this->paginate;
  }

  if (isset($options['show'])) {
  $options['limit'] = $options['show'];
  }

  if (isset($options['sort']) && isset($options['direction'])) {
  $options['order'] = array($options['sort'] =>
$options['direction']);
  } elseif (isset($options['sort'])) {
  $options['order'] = array($options['sort'] => 'asc');
  }

  if (!empty($options['order']) && is_array($options['order'])) {
  $key = key($options['order']);
  if (strpos($key, '.') === false && $object->hasField($key)) {
  $options['order'][$object->name . '.' . $key] =
$options['order'][$key];
  unset($options['order'][$key]);
  }
  }

  $vars = array('fields', 'order', 'limit', 'page', 'recursive');
  $keys = array_keys($options);
  $count = count($keys);

  for($i = 0; $i < $count; $i++) {
  if (!in_array($keys[$i], $vars)) {
  unset($options[$keys[$i]]);
  }
  if (empty($whitelist) && ($keys[$i] == 'fields' || $keys[$i] ==
'recursive')) {
  unset($options[$keys[$i]]);
  } elseif (!empty($whitelist) && !in_array($keys[$i], $whitelist))
{
  unset($options[$keys[$i]]);
  }
  }

  $conditions = $fields = $order = $limit = $page = $recursive = null;
  if (!isset($defaults['conditions'])) {
  $defaults['conditions'] = array();
  }

  extract($options = am(array('page' => 1, 'limit' => 20), $defaults,
$options));
  /*if (is_array($scope) && !empty($scope)) {
  $conditions = am($conditions, $scope);
  } elseif (is_string($scope)) {
  $conditions = array($conditions, $scope);
  }
  $recursive = $object->recursive;
  */
  $count = $object->findCount($conditions, $recursive);
  $pageCount = ceil($count / $limit);

  if($page == 'last') {
  $options['page'] = $page = $pageCount;
  }

  //$results = $object->findAll($conditions, $fields, $order, $limit,
$page, $recursive);
  $paging = array(
  'page'=> $page,
  'current'=> count($results),
  'count'=> $count,
  'prevPage'=> ($page > 1),
  'nextPage'=> ($count > ($page * $limit)),
  'pageCount'=> $pageCount,
  'defaults'=> am(array('limit' => 20, 'step' => 1), $defaults),

  'options'=> $options
  );

  $this->params['paging'][$object->name] = $paging;

  if (!in_array('Paginator', $this->helpers) &&
!array_key_exists('Paginator', $this->helpers)) {
  $this->helpers[] = 'Paginator';
  }

  return $results;
  }


Arjen

On 8/1/07, Ketan Patel <[EMAIL PROTECTED]> wrote:
>
>
> You will have to overload the paginate method in your model. And then
> in the model you could write your custom queries as required. Read the
> code for more information.
>
> Ketan.
>
> kionae wrote:
> > Is there any way to just pass an array into 1.2's paginate function
> > and have it paginate the data?  Essentially, I have an array that is a
> > set of search results returned by some custom queries and a bit of
> > manipulation.  I couldn't generate the results I needed by going
> > through $this

cakephp 1.2: i18n german core.po

2007-08-01 Thread Christian

Hello all,

I am tryring to run latest cakephp 1.2.0.5427alpha with some basic
language translation: I like to have the core messages be in German. I
saw in SVN for this release all other languages were removed but
English. The language files moved to cakeforge, which may be nice
idea. Unfortunately in the mentioned cakeforge project no files have
been released so far ;(

I searched through the bakery and FAQ of this group, changed some code
of mine, but it runs only partially. Doing a lets say private
translation table with app/locale/deu/LC_MESSAGES/default.po works
fine after assigning the language in bootstrap.php.

$language = 'deu';
Configure::write('Config.language', $language);

Grabbing from SVN (version before the languages were removed) the
german core.po does not work. I put it in app/locale/deu/core.po but
still all core messages are in english. What is wrong? What do I need
to do?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Model findAll Error

2007-08-01 Thread starkey

Okay, I'm sure I'm really showing my noobie stripes with this one...

As a learning exercise I'm creating a front end for ACL.

Instead of using generateList to populate a selectTag I thought I'd
try a custom query by adding a method to my model and call it from the
controller.  Here is the method:

function getIdAliasArray()
{
   $arr = $this->findAll(null,array('id','alias'),'alias ASC');
   return($arr);
}

Well, this causes an error because it tries to run "getidaliasarray"
as if it were an SQL query instead of a method name.  Here is the
error:
Query: getidaliasarray
Warning: SQL Error: 1064: You have an error in your SQL syntax; check
the manual that corresponds to your MySQL server version for the right
syntax to use near 'getidaliasarray' at line...

I even set DEBUG to 2 and it pumped out "getidaliasarray" along with
all of the other queries.

What am I doing wrong here?

Thanks!
Shawn


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Validation fails but shows no error

2007-08-01 Thread francky06l

Could you past code from model and controller in the bin ?

On Aug 1, 10:20 pm, rtconner <[EMAIL PROTECTED]> wrote:
> you need error('Model.field')?> in your view.
>
> On Aug 1, 1:57 pm, burzum <[EMAIL PROTECTED]> wrote:
>
> > Im using the save() method but tried also your suggestion - it does
> > not work.
>
> > On Aug 1, 8:39 pm, francky06l <[EMAIL PROTECTED]> wrote:
>
> > > Do you use save() function or invalidates to get the validation ? If
> > > you use the validates function, a tip :


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Validation fails but shows no error

2007-08-01 Thread rtconner

you need error('Model.field')?> in your view.

On Aug 1, 1:57 pm, burzum <[EMAIL PROTECTED]> wrote:
> Im using the save() method but tried also your suggestion - it does
> not work.
>
> On Aug 1, 8:39 pm, francky06l <[EMAIL PROTECTED]> wrote:
>
> > Do you use save() function or invalidates to get the validation ? If
> > you use the validates function, a tip :


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Validation fails but shows no error

2007-08-01 Thread burzum

Im using the save() method but tried also your suggestion - it does
not work.

On Aug 1, 8:39 pm, francky06l <[EMAIL PROTECTED]> wrote:
> Do you use save() function or invalidates to get the validation ? If
> you use the validates function, a tip :


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Extending AppController

2007-08-01 Thread francky06l

Hi LS, did not think about this .. but I safi wants to make different
classes inherit from a bunch of  "specialized" AppControler, this not
the way .. If all classes inherit from "ModelController", better to
"enhance" AppController itself ..
This is my 2 cents on top  :-)

On Aug 1, 9:27 pm, LS <[EMAIL PROTECTED]> wrote:
> My 2 cents:
> Make model_controller.php in the same level as app_controller.php
> make this model_controller declaration:
> class ModelController extends Controller {}
> and this app_controller declaration:
> class AppController extends ModelController {}
>
> This way, you won't have to change any controller in your application.
>
> Regards,
> - LS
>
> On Aug 1, 4:11 pm, francky06l <[EMAIL PROTECTED]> wrote:
>
> > I think you can place your module_controller.php file at same level of
> > app_controller.php. This should work without problem having you
> > ModuleController extending AppController and other controller
> > extending ModuleController.
>
> > On Aug 1, 5:54 pm, safl <[EMAIL PROTECTED]> wrote:
>
> > > Hello,
>
> > > I would like to have different controller types that are extends of
> > > the basic AppController.
>
> > > Let's say i got "class ModuleController extends AppController" where
> > > should i then place my "module_controller.php" so my controllers in /
> > > controllers be able to: "class WhateverController extends
> > > ModuleController" instead of "class WhateverController extends
> > > AppController"?
> > > And without messing with the Cake installation.
>
> > > The thing is I got a bunch of logic in AppController in beforeFilter
> > > and the use of a couple of components and stuff like that but I only
> > > wan't a subset of my controllers in /controller to inherit these
> > > properties.
>
> > > And other controllers will very soon like to inherit some other
> > > properties of some other controller type.
>
> > > regards,
> > > Simon


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Extending AppController

2007-08-01 Thread LS

My 2 cents:
Make model_controller.php in the same level as app_controller.php
make this model_controller declaration:
class ModelController extends Controller {}
and this app_controller declaration:
class AppController extends ModelController {}

This way, you won't have to change any controller in your application.

Regards,
- LS

On Aug 1, 4:11 pm, francky06l <[EMAIL PROTECTED]> wrote:
> I think you can place your module_controller.php file at same level of
> app_controller.php. This should work without problem having you
> ModuleController extending AppController and other controller
> extending ModuleController.
>
> On Aug 1, 5:54 pm, safl <[EMAIL PROTECTED]> wrote:
>
> > Hello,
>
> > I would like to have different controller types that are extends of
> > the basic AppController.
>
> > Let's say i got "class ModuleController extends AppController" where
> > should i then place my "module_controller.php" so my controllers in /
> > controllers be able to: "class WhateverController extends
> > ModuleController" instead of "class WhateverController extends
> > AppController"?
> > And without messing with the Cake installation.
>
> > The thing is I got a bunch of logic in AppController in beforeFilter
> > and the use of a couple of components and stuff like that but I only
> > wan't a subset of my controllers in /controller to inherit these
> > properties.
>
> > And other controllers will very soon like to inherit some other
> > properties of some other controller type.
>
> > regards,
> > Simon


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Ridiculous User Management Head Melt

2007-08-01 Thread Sonic Baker
   

Hi Bakers,
I have a problem and I could really use some advice.
Apart from having multiple types of groups defined in my ACL's I want
certain users to have extra associated information.

For example:

  General Staff:

Staff members have a home addresses and a Tax number


  Management:

Management will have a home addresses, a Tax number and a Vehicle


  Customers:

When a customer registers they will be the administrator of their
accounts. A Customer can register many Accounts. Once registered, they will
be allowed to (or required to) register 3 different types of users for each
account. Each Account user will have different permissions for accessing
areas of the account back-end and each account user will also have different
types of additional information associated with them.


The 3 types of account user are:
  admins -> have access to all functionality
  managers -> can view stats and use basic functionality
  billing contacts -> can view invoices


Account Admins will have a phone number, fax and email
Account Managers will have a phone number, alternative phone number, fax and
email
Account Billing Contacts will have a phone number, and email

There is a table for `customers` and a table for `accounts`.

  Customer hasMany Account


So far the `accounts` table holds the info about the all three types of
account user.


There is a separate table for `staff_members`.

  StaffMember hasOne Address


There is a separate table for `management_members`

  ManagementMember hasOne Address

  ManagementMember hasOne Vehicle


Now I'm trying to implement the Auth and ACL stuff. I left this till I had
some base functionality down as I was going for most business value first.
I'm trying a few different types of CakePHP Auth and ACL systems to see
which will be the most suitable. I see now that a single  `users` table is
required.

So when a user logs in, I'll want to check what group they belong to. If
they are of type:

  Staff:

I'll want to access their extra information from the Staff and
associated Address models.


  Management:

 I'll want to access their extra information from the Management and
associated Address and Vehicle models.


  Account Admin, Manager or Billing Contact:

 I'll probably want an 'account_id' in the User model and look in the
relevant Account to get their extra information like phone numbers etc. This
will mean having the account_id set to '0' for StaffMember and
ManagementMember because they will not have accounts in the sense a Customer
can.

It all seems a bit ridiculous to me now. It's starting to melt my head to be
honest. Can anyone see an alternative arrangement which would take care of
my requirements. I was considering the Subtype/Supertype method on the User
model but this could bet messy also.

I'd really appreciate any help of suggestions.

Cheers,

Sonic

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Ajax and Validation in 1.2 (not Validation with ajax)

2007-08-01 Thread LS

Hello, everyone...
  I've looked everywhere, and I've still have a problem with
validation (that even may be solved in another way)...
  I have two tables. Users (id, created, modified, name, login,
password) and Companies (id, created, modified, name, user_id).
  I want an ajax search to fill the user_id in my companies table. I
have tought in two ways of that:

#1
Make an ajax searchable field (the search must be with the users.name
field only), that stores the user.id somewhere to pass to the
company.user_id when submitting the form

Since I havent found a solution, for that, I skipped to another
approach

#2
In the ajax searcheable field, grab the name of the user (wich is
unique in the table), check the users table to see if the name really
exists, grab the id and move on...

BUT, I tried to make a validation (in the controller) to check if the
name really exists, and, if not, accuse an error and return the same
view again. I havent found how to tell the view that there is a
problem with the data submitted.

I am using cake version 1.2.0.5427alpha.
I have a Users model with no fancy stuff
I have a Company model with no fancy stuff
I have a Companies controller with index and add controllers.
  Index lists the companies
  Add prints the add company view if no data is passed to it. If any
data is passed to it, it SIMPLY checks if the name of the user passed
is valid (I havent even done any saving in the database yet).

If anyone can help with either the problems above, I would be VERY
MUCH grateful.

Thanks!
- LS


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Extending AppController

2007-08-01 Thread francky06l

I think you can place your module_controller.php file at same level of
app_controller.php. This should work without problem having you
ModuleController extending AppController and other controller
extending ModuleController.

On Aug 1, 5:54 pm, safl <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I would like to have different controller types that are extends of
> the basic AppController.
>
> Let's say i got "class ModuleController extends AppController" where
> should i then place my "module_controller.php" so my controllers in /
> controllers be able to: "class WhateverController extends
> ModuleController" instead of "class WhateverController extends
> AppController"?
> And without messing with the Cake installation.
>
> The thing is I got a bunch of logic in AppController in beforeFilter
> and the use of a couple of components and stuff like that but I only
> wan't a subset of my controllers in /controller to inherit these
> properties.
>
> And other controllers will very soon like to inherit some other
> properties of some other controller type.
>
> regards,
> Simon


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: passing data from model to controller

2007-08-01 Thread francky06l

The problem comes from here :

debug($tasklists);

Actually you pass the tasklist into your view, but that variable is
not known in your controller:

try this :

  $tasklists = $this->Tasklist->finddata();
  $this->set('tasklists',$tasklists);
debug($tasklists);

For the saving, something is wrong  Why to loop on  tasklists if
you always use $this->data to save ? Besides, if you have multiple
record in your form, user $this->Tasklist->create before calling save
and review the $this->data parameter (maybe $this->Tasklist-
>save($this->data['Tasklist'][$i] ?, depends of your form of course).

Hope this helps


On Aug 1, 8:48 pm, rtanz <[EMAIL PROTECTED]> wrote:
> Bdw i was planning to do the save code in the controller as follows:
>
> foreach ($tasklists as $tasklist) {
> $this->Tasklist->save($this->data))
> }
>
> again i dont know if this is the correct way to do it and would like
> some help on how to do the whole thing thanks


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: passing data from model to controller

2007-08-01 Thread rtanz

Bdw i was planning to do the save code in the controller as follows:

foreach ($tasklists as $tasklist) {
$this->Tasklist->save($this->data))
}

again i dont know if this is the correct way to do it and would like
some help on how to do the whole thing thanks


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



passing data from model to controller

2007-08-01 Thread rtanz

hi i have the following

class Tasklist extends AppModel
{
var $name = 'Tasklist';
var $belongsTo = array('Module','Task','User');

function finddata() {

return $this->query("SELECT `memberships`.`module_id`,
`memberships`.`user_id`, `tasks`.`id`as task_id
FROM 
`memberships` , `tasks`
WHERE 
`tasks`.`role_id` =  `memberships`.`role_id`");
}
}

and

in Tasklist controller:
function add() {

$this->set('tasklists',$this->Tasklist->finddata());
debug($tasklists);

}

The problem is this:

Notice: Undefined variable: tasklists in W:\www\cake\app\controllers
\tasklists_controller.php on line 23

Warning: Cannot modify header information - headers already sent by
(output started at W:\www\cake\app\controllers
\tasklists_controller.php:23) in W:\www\cake\cake\libs\controller
\controller.php on line 447


I am guessing that i am not passing the data from the model to the
controller in the correct way, so i would like some help on how to do
that correctly. I would like to call the save method from the
controller then, so as to insert the data retrieved by the query plus
some additional fields.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Validation fails but shows no error

2007-08-01 Thread francky06l

Do you use save() function or invalidates to get the validation ? If
you use the validates function, a tip :

in controller :
$this->Spindle->data = $this->data;
$this->Spindle->invalidate();

Hope this helps

On Aug 1, 2:56 pm, burzum <[EMAIL PROTECTED]> wrote:
> On Aug 1, 1:55 pm, Baz <[EMAIL PROTECTED]> wrote:
>
> > I'm assuming this is 1.2?
>
> Yes, its 1.2, the nightly build from 2007-07-29 but the older build
> had the same problem.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: PayPal Direct Payment API Component

2007-08-01 Thread [EMAIL PROTECTED]

Hi,

by default, the code is something like this:

 // Set up common component's parameters
 $this->Paypal-
>setEnvironment(CAKE_COMPONENT_PAYPAL_ENVIRONMENT_SANDBOX);
 $this->Paypal->setUser('ApiUser');
 $this->Paypal->setPassword('ApiPassword');
 $this->Paypal->setCertificate('cert_perm.txt');
 $this->Paypal->setOrder($order)

the source doesn't give instruction that this part should be change. I
tried changing the username, password for my
sandbox paypal account but still i do get the same error message.


On Aug 2, 1:48 am, "Gonzalo Servat" <[EMAIL PROTECTED]> wrote:
> On 8/1/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi,
> > what usename, password, certificate file and environment this error
> > referring to?
>
> > ERROR: API Username, Password, Certificate File and Environment must
> > all be set
>
> I haven't used this component myself, but maybe you could search the source
> code for this error you're getting to see where it's going to check for the
> above details. That'll probably lead you to the answer.
>
> - Gonzalo


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: PayPal Direct Payment API Component

2007-08-01 Thread Gonzalo Servat
On 8/1/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
> Hi,
> what usename, password, certificate file and environment this error
> referring to?
>
> ERROR: API Username, Password, Certificate File and Environment must
> all be set


I haven't used this component myself, but maybe you could search the source
code for this error you're getting to see where it's going to check for the
above details. That'll probably lead you to the answer.

- Gonzalo

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



PayPal Direct Payment API Component

2007-08-01 Thread [EMAIL PROTECTED]

Hi,
what usename, password, certificate file and environment this error
referring to?

ERROR: API Username, Password, Certificate File and Environment must
all be set


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Configs for multiple Products per User

2007-08-01 Thread Jon Bennett

Hi,

I'm trying to figure out the best way to approach a config issue in an
app I'm working on.

The system has Products and Product Categories. Some of the Product
Categories require some configuration for each user, this is also true
of some Products.

I'm trying to figure out the best way of modelling this in the DB,
does anyone have any experience of this type of thing?

I have a half working version based on the following (but I'm not sure
it's the best approach):

// Models
ProductCategory
- hasMany Product, ProductCategoryConfigQuestion

Product
- belongsTo ProductCategory

User
- hasMany ProductCategoryConfigAnswer

ProductCategoryConfigQuestion
- belongsTo ProductCategory
- hasMany ProductCategoryConfigAnswer

ProductCategoryConfigAnswer
- belongsTo ProductCategoryConfigQuestion, User

So I can create a form on the fly, I have the following in
ProductCategoryConfigOption:

id
product_category_id
name
field_type (text, textarea, select)
field_values (used for select)

This works ok, and I can display the form correctly and then save the
results - it just feels clunky! For instance I can't use Cake's built
in validation, and I will need to recreate the Question and Answer
tables for Products (and the controller functionality).

I've looked about, and there's a component on the bakery [1] however
this uses Keys, which I could use, though it would have to be a
composite based on the user id, product_category_id and config_option.
Also this doesn't take into account the fact I need to associate an
answer to a question.

I'm not sure I'm going about this the correct way, and would
appreciate some insight.

Thanks,

Jon
[1] 
http://bakery.cakephp.org/articles/view/confcomponent-db-based-configuration-tutorial

-- 


jon bennett

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Please healp me for using the PHPBB

2007-08-01 Thread Chris Hartjes

On 8/1/07, John David Anderson (_psychic_) <[EMAIL PROTECTED]> wrote:
> And here's one for you, Chris:
>
> http://en.wikipedia.org/wiki/Flaming_%28Internet%29
>

Oo!  I hadn't run into that page before.  I promptly bookmarked it.

-- 
Chris Hartjes
Senior Developer
Cake Development Corporation

My motto for 2007:  "Just build it, damnit!"

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Multiple field values in select box?

2007-08-01 Thread Beertigger

Multiple model fields in generatelist... ?

Moving this one along a bit
I've tried every which way to get this one to work, and I'm stumped.
Using afterFind on info from one table works just fine; putting this
in the Player model:
function afterFind($results) {
 foreach ($results as $key => $val) {
$results[$key]['Player']['fullname'] =
$val['Player']['fname'] . ' ' . $val['Player']['lname'];
}
return $results;
}
lets me use 'fullname' in controllers easily enough.
How do I get something from another table to concat nicely.
Code like
function afterFind($results) {
 foreach ($results as $key => $val) {
$results[$key]['Team']['teamsport'] =
$val['Team']['team'] . ' ' . $val['Sport']['sport'];
}
return $results;
}
only gets me the field from the Team table when it's in the Team
model, and throws a Notice: Undefined index: Sport in...blahblahblah
error.
Team belongsto Sport, Sport hasmany Team
What kinda hoops do I need to jump threw to get this info in a Cake-y
manner? I need to generate a select in another controller. If
somebody'd hold my hand on this one, it'd be greatly appreciated...
Thanks!

On Jul 28, 8:35 am, cauld <[EMAIL PROTECTED]> wrote:
> Not exactly a cake solution, but in the past I've created a database
> view an concatenated the two columns I want in the SQL (ex)
> concat(last_name, ', ', first_name) and then passed the view results
> to generateList().  Perhpas you could do the same with query() and
> pass those results to generateList(), but I've not tried that method
> so can't say it would work, just thinking out loud.  Hope that is
> helpful.
>
> On Jul 27, 11:17 pm,Beertigger<[EMAIL PROTECTED]> wrote:
>
> > Is there any way to get values from multiple fields into a select box?
>
> > After much searching, I've come to the conclusion I'm not going to
> > find the answer without appealing to those far wiser than myself...
>
> > Here's an old thread for reference, which discusses, w/o resolution,
> > exactly what I'm looking for:
>
> > "* Is it possible to use multiple fields to make up the value of the
> > select box?  Such that it would come out looking something like
>
> > field2value - field3value"
>
> >http://groups.google.com/group/cake-php/browse_thread/thread/50a2ecaf...
>
> > So, just wondering if anyone ever made any progress on this. Saw the
> > code in trac, but it seems to be for 1.2 (?). Couldn't get it to work,
> > anyway. I'd find this functionality very valuable
>
> > Thanks to anyone for any help!


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How should I allow Users only to edit their own Posts in a Cake App? Acl related

2007-08-01 Thread Ketan Patel

If you are sticking to very basic level like user x can edit his own
records and not others, then it is OK. However, as your application
grows, you may not find this good enough for management and will start
giving you nightmares later on. I would suggest to go with ACL as it
does not add that much of an overhead as you might think!

Cheers,
Ketan


starkey wrote:
> I do not think I'd use ACL for this.  I'd do as you suggest and check
> the current userid against the create_by userid.  Also, I would not
> give them an "edit" or "view" link if they aren't allowed to edit/view
> it, they would just get confused if the option is there but they can't
> use it.
>
> Regards,
> Shawn
>
>
> On Aug 1, 9:41 am, luke BAKING barker <[EMAIL PROTECTED]> wrote:
> > Hi
> >
> > What is the best way in a Cake app to allow a User to
> > view/edit (etc) their own Profiles / Posts and so on?
> >
> > Rather than create a separate ARO (as Ketan Bakery tutorial suggests),
> > I need to basically have a separate test in each action I guess
> > something  like so:
> >
> > //pseudocode
> > function edit($id) {
> > ...
> > $relevant = $this->Post->read($id);
> > if ($this->session->USERID === $relevant['Post']['user_id']) {
> >
> >   // it's OK show them the view}
> >
> > else {
> >  // this Post was not by this User , so they cant update it!
> > $this->redirect();
> >
> > }
> >
> > does that make sense?
> >
> > I am learning the usage of Acl in 1.2 just now and this is perplexing
> > me on how to do this with minimum of fuss.
> >
> > I don't know if it can be integrated / should be into Acl and Auth
> > part of my web-app?
> >
> > thanks for any advice with this pattern,
> >
> > regards
> >
> > Luke


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: any idea why my save doesn't (?) work - help

2007-08-01 Thread Ketan Patel

As kionae mentioned, every record in cake is refererred with respect
to the column 'id' and that is why the user manual also presses you to
have the id as the primary key for all your tables.

So if you are updating the record, make sure you have either

1. read the record in the model before you issue save  or
2. have the id in the data that you are saving.

Also, if you are updating one field, make sure you pass only that
field in the save argument, this will save you time, trouble and close
many security loopholes.

Ketan


kionae wrote:
> Try passing the user id along with the user name and password to the
> save function.  If it doesn't know which record to edit, it'll always
> just create a new one.
>
> On Aug 1, 9:40 am, apadzik <[EMAIL PROTECTED]> wrote:
> > Thank you very much!!:-
> >
> > Maybe there's another function for updating record?
> >
> > For example I have table customers and i have password reminder which
> > sets new password for customer.
> > When i generate password as $newPass and try to set it for user like
> > this:
> > $this->data['Customer']['login_name']=$_SESSION['login'];
> > $this->data['Customer']['password']=md5($newPass);
> > $this->Customer->save($this->data);
> >
> > it created me new record with all fields like first_name, last_name
> > etc. blank expcept for login_name and password.
> > Thanks in advance:)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Paginating results of custom queries?

2007-08-01 Thread Ketan Patel

You will have to overload the paginate method in your model. And then
in the model you could write your custom queries as required. Read the
code for more information.

Ketan.

kionae wrote:
> Is there any way to just pass an array into 1.2's paginate function
> and have it paginate the data?  Essentially, I have an array that is a
> set of search results returned by some custom queries and a bit of
> manipulation.  I couldn't generate the results I needed by going
> through $this->paginate because it wouldn't let me join tables, so I'm
> stuck with using the custom queries.
>
> I've seen other topics on this, but there didn't seem to be a clear
> answer (in fact I'm still not even sure this is possible after reading
> them all).


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Paginating results of custom queries?

2007-08-01 Thread rtconner

Just found this link, give it a read also, maybe it can help you.
http://groups.google.com/group/cake-php/browse_frm/thread/8cbf01f7a9acda57/9e84f7aacbf3cd85?#9e84f7aacbf3cd85

On Aug 1, 9:32 am, rtconner <[EMAIL PROTECTED]> wrote:
> Yeah I'm doubting anyone has a good answer for you.
>
> "Is there any way to just pass an array into 1.2's paginate function
> and have it paginate the data?"
>
> No. Sorry.
>
> If you work hard enough, likely I'm thinking you can join the tables
> you want to join. I came across this once, and I kind of ended up
> writing a "fake_paginate" method to do it. Not a great idea. Another
> thing, I've never tried, but have been meaning to try is this: In your
> relationship definitions in your models.. I'm theorizing you can write
> some combination of finderQuery and counterQuery and then paginate
> will use them and happily work. These are area I've never really
> explored so really I have no idea if they'll work. It's just a theory
> I have.
>
> -Rob Conner
>
> On Aug 1, 9:19 am, kionae <[EMAIL PROTECTED]> wrote:
>
> > No one knows?
>
> > On Jul 30, 3:48 pm, kionae <[EMAIL PROTECTED]> wrote:
>
> > > Is there any way to just pass an array into 1.2's paginate function
> > > and have it paginate the data?  Essentially, I have an array that is a
> > > set of search results returned by some custom queries and a bit of
> > > manipulation.  I couldn't generate the results I needed by going
> > > through $this->paginate because it wouldn't let me join tables, so I'm
> > > stuck with using the custom queries.
>
> > > I've seen other topics on this, but there didn't seem to be a clear
> > > answer (in fact I'm still not even sure this is possible after reading
> > > them all).


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Linking a HABTM Association to extra data beside the tag?

2007-08-01 Thread rtconner

If I'm catching what you are doing... You have to create a FansUser
model and add some relationships to it.

http://groups.google.com/group/cake-php/browse_frm/thread/f23b1825050ad543/e793267f42fa77fd?#e793267f42fa77fd
http://groups.google.com/group/cake-php/browse_frm/thread/8cbf01f7a9acda57/9e84f7aacbf3cd85?#9e84f7aacbf3cd85

I think.. this is what you want. I could be wrong though.

On Aug 1, 9:47 am, Jim Newfer <[EMAIL PROTECTED]> wrote:
> Anyone? Sorry, I am just stuck. If there was some way in cake to
> specify an alternative key it is searching for in the foreign table, I
> think that may solve my problem.
> Thanks.
>
> Jim.
>
> On Jul 31, 1:55 pm, Jim Newfer <[EMAIL PROTECTED]> wrote:
>
> > Hello everyone,
>
> > Last resort post, I am stuck. What I have done is create a "friends"
> > system in my app. Although it is mildly tricky because the friends are
> > the same thing as users, just using an alias.
>
> > My tables look like this right now (only relevant information shown):
>
> > Users:
> > Id
>
> > Fans_Users:
> > fan_id
> > user_id
>
> > Fans:
> > id
> > fans_info
>
> > The fan is just an alias for another user. I have the HABTM
> > association set up fine and dandy. But what I cannot seem to get to
> > work no matter what I try, is get the user infomation to be be pulled
> > up with that fan. For example, User 67 has two fans, users 45 and
> > users 46. Not when I query for User 67, his two fans are shown, users
> > 45 and 46. BUT, I want users 45 and users 46 information to be shown
> > as well. I have tried all sorts of combinations of hasOne/belongsTo in
> > the fans table to get the fan to link to some user info. Even tried
> > adding a fan_id to the user table, (which is the same thing as their
> > id) And linking it to that. Problem is, it is matching the Fan.id to
> > the fan.user_id which is obviously a problem. I was thinking if I
> > could somehow modify the primary key it is searching for in the local
> > table, it could work (instead of matching the Fan.id to the User.id,
> > match the Fan.fan_id to the User.id)
>
> > I am really stuck here, has anyone attempting anything similar?
>
> > Thanks.
>
> > Jim


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Extending AppController

2007-08-01 Thread safl

Hello,

I would like to have different controller types that are extends of
the basic AppController.

Let's say i got "class ModuleController extends AppController" where
should i then place my "module_controller.php" so my controllers in /
controllers be able to: "class WhateverController extends
ModuleController" instead of "class WhateverController extends
AppController"?
And without messing with the Cake installation.

The thing is I got a bunch of logic in AppController in beforeFilter
and the use of a couple of components and stuff like that but I only
wan't a subset of my controllers in /controller to inherit these
properties.

And other controllers will very soon like to inherit some other
properties of some other controller type.

regards,
Simon


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: integrate third party ajax library

2007-08-01 Thread nagarjuna

Thanks for the advice Chris.  I installed the firbug plugin and fixed
a coupld of problems.  I realize now that the main issue is that the
code in the library is trying to request an additional .php file that
is in the library's folder inside the /vendors folder.  The relevant
code is:

new Ajax.Request( sc_select_ajax_handler.php, { method: 'POST',
parameters: pars, onComplete: onCompleteCallBack });

When it does, I get the following error message:
You are seeing this error because the action
sc_select_ajax_handler.php

So I guess my question then really boils down to how to make this
request process correctly?  Do I need to map this .php file to a
controller action? Thanks for any help.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Linking a HABTM Association to extra data beside the tag?

2007-08-01 Thread Jim Newfer

Anyone? Sorry, I am just stuck. If there was some way in cake to
specify an alternative key it is searching for in the foreign table, I
think that may solve my problem.
Thanks.

Jim.

On Jul 31, 1:55 pm, Jim Newfer <[EMAIL PROTECTED]> wrote:
> Hello everyone,
>
> Last resort post, I am stuck. What I have done is create a "friends"
> system in my app. Although it is mildly tricky because the friends are
> the same thing as users, just using an alias.
>
> My tables look like this right now (only relevant information shown):
>
> Users:
> Id
>
> Fans_Users:
> fan_id
> user_id
>
> Fans:
> id
> fans_info
>
> The fan is just an alias for another user. I have the HABTM
> association set up fine and dandy. But what I cannot seem to get to
> work no matter what I try, is get the user infomation to be be pulled
> up with that fan. For example, User 67 has two fans, users 45 and
> users 46. Not when I query for User 67, his two fans are shown, users
> 45 and 46. BUT, I want users 45 and users 46 information to be shown
> as well. I have tried all sorts of combinations of hasOne/belongsTo in
> the fans table to get the fan to link to some user info. Even tried
> adding a fan_id to the user table, (which is the same thing as their
> id) And linking it to that. Problem is, it is matching the Fan.id to
> the fan.user_id which is obviously a problem. I was thinking if I
> could somehow modify the primary key it is searching for in the local
> table, it could work (instead of matching the Fan.id to the User.id,
> match the Fan.fan_id to the User.id)
>
> I am really stuck here, has anyone attempting anything similar?
>
> Thanks.
>
> Jim


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Paginating results of custom queries?

2007-08-01 Thread rtconner

Yeah I'm doubting anyone has a good answer for you.

"Is there any way to just pass an array into 1.2's paginate function
and have it paginate the data?"

No. Sorry.

If you work hard enough, likely I'm thinking you can join the tables
you want to join. I came across this once, and I kind of ended up
writing a "fake_paginate" method to do it. Not a great idea. Another
thing, I've never tried, but have been meaning to try is this: In your
relationship definitions in your models.. I'm theorizing you can write
some combination of finderQuery and counterQuery and then paginate
will use them and happily work. These are area I've never really
explored so really I have no idea if they'll work. It's just a theory
I have.

-Rob Conner

On Aug 1, 9:19 am, kionae <[EMAIL PROTECTED]> wrote:
> No one knows?
>
> On Jul 30, 3:48 pm, kionae <[EMAIL PROTECTED]> wrote:
>
> > Is there any way to just pass an array into 1.2's paginate function
> > and have it paginate the data?  Essentially, I have an array that is a
> > set of search results returned by some custom queries and a bit of
> > manipulation.  I couldn't generate the results I needed by going
> > through $this->paginate because it wouldn't let me join tables, so I'm
> > stuck with using the custom queries.
>
> > I've seen other topics on this, but there didn't seem to be a clear
> > answer (in fact I'm still not even sure this is possible after reading
> > them all).


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: any idea why my save doesn't (?) work - help

2007-08-01 Thread kionae

Try passing the user id along with the user name and password to the
save function.  If it doesn't know which record to edit, it'll always
just create a new one.

On Aug 1, 9:40 am, apadzik <[EMAIL PROTECTED]> wrote:
> Thank you very much!!:-
>
> Maybe there's another function for updating record?
>
> For example I have table customers and i have password reminder which
> sets new password for customer.
> When i generate password as $newPass and try to set it for user like
> this:
> $this->data['Customer']['login_name']=$_SESSION['login'];
> $this->data['Customer']['password']=md5($newPass);
> $this->Customer->save($this->data);
>
> it created me new record with all fields like first_name, last_name
> etc. blank expcept for login_name and password.
> Thanks in advance:)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Please healp me for using the PHPBB

2007-08-01 Thread John David Anderson (_psychic_)


On Aug 1, 2007, at 7:00 AM, Chris Hartjes wrote:

>
> On 8/1/07, sandy <[EMAIL PROTECTED]> wrote:
>>
>> Dear Friends
>>
>>  I am sandy.and I want to know that how to we use
>> phpbb and how can we Implement.actuly I am new in the field of
>> PHP.please help me.
>>
>> Thank's to all
>>
>> With Warm regards
>>
>
> Here's a great link to help you with that:
>
> http://slash7.com/pages

And here's one for you, Chris:

http://en.wikipedia.org/wiki/Flaming_%28Internet%29

-- John

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Please healp me for using the PHPBB

2007-08-01 Thread John David Anderson (_psychic_)


On Aug 1, 2007, at 5:54 AM, sandy wrote:

>
> Dear Friends
>
>  I am sandy.and I want to know that how to we use
> phpbb and how can we Implement.actuly I am new in the field of
> PHP.please help me.

This mailing list is meant for discussion about CakePHP, not PHPBB.  
I'd look for some resources here:

http://www.phpbb.com/support/

Thanks,

John

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Paginating results of custom queries?

2007-08-01 Thread kionae

No one knows?

On Jul 30, 3:48 pm, kionae <[EMAIL PROTECTED]> wrote:
> Is there any way to just pass an array into 1.2's paginate function
> and have it paginate the data?  Essentially, I have an array that is a
> set of search results returned by some custom queries and a bit of
> manipulation.  I couldn't generate the results I needed by going
> through $this->paginate because it wouldn't let me join tables, so I'm
> stuck with using the custom queries.
>
> I've seen other topics on this, but there didn't seem to be a clear
> answer (in fact I'm still not even sure this is possible after reading
> them all).


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Help with initial setup

2007-08-01 Thread dzr

I'm trying to learn CakePHP but can't even get past the setup - I
can't find much info on why/when to use production/development/
alternative setup.

Here's our situation - we are running Apache with PHP5/MySQL and Zend
Core installed.

We have 3 servers - our live site, a mirror of the live site where we
make changes etc. before making them live and a development server
where we are doing an entire site redesign.

We have thousands of pages/images on our live site and a few small php
applications.

Here's what we're thinking -- create a 4th server that is a copy of
our live server and install Cake with the production set up.
Restructure everything accordingly and make the switch after testing.

My questions -

How will this affect current PHP pages?

The default structure in the webroot folder  has css, img, files, js
directories -- do we have to keep the structure like this? As in all
the images go in img? We have sections of our site that are completely
different in design...

Should we consider the development or an alternative set up based on
how big our current site is?


any help would be great!!!

thanks,
danielle


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: SWFupload for cake1.2

2007-08-01 Thread Fanck

Hi,
So far I coulnd't get this component to upload anything on 1.2.
Can't get "upload" button to show as on SWFUpload website, neither can
get any file in upload queue.

Is it possible I missed something else? I tried with original and your
modified component, all I got is JS to change the form with "browse"
and "upload" buttons, but nothing else.

Has anyone encounter such problem before?

thanks


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: A quick note about BakeSale

2007-08-01 Thread drayen

Excellent!

I agree 100% on the osCommerce comment, BakeSale has lots going for it
and is very easy to extend, so far its been mostly the work of a
single person (not me), but i think hes looking to get more people
involved.

Please do post to BakeSaleHQ, look forward to hearing from you.

Drayen.

On Aug 1, 11:22 am, housebolt <[EMAIL PROTECTED]> wrote:
> > I've committed code tobakesaleand use it myself
>
> Glad to hear from you. I'll post some of the stuff over at BakeSaleHq
> as soon as I get some time this week. It's a great platform, and I
> think it could go further than osCommerce (and be 10 times more easy
> to use and customize). I personally think all shopping carts should
> use some sort of framework, andBakeSaleis the first of its kind for
> Cake.
>
> On Aug 1, 1:25 am, drayen <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > I've committed code tobakesaleand use it myself, i would be
> > interested to hear what you've found. I can also confirm you never
> > contacted thebakesaleteam. Onto your image :
>
> > The system doesn't look like its released any useful data?
>
> > The output your showing is on the demo site, which is deliberately
> > unsecured to allow people to test the admin interface. Were you able
> > to re-create your results on your own server?
>
> > If you want to help, by all means apply to be a part of thebakesale
> > cakeforge group and commit updated and more secure code, i am sure we
> > would welcome the help. We are soon going to move to 1.2 and will be
> > using the security class you talked about in a post you made 34 hours
> > ago, which should close a few holes.
>
> > Or if not how about submit the holes you've found, ideally with
> > solution code via our bug tracker on google code 
> > :http://code.google.com/p/bakesale/issues/list
>
> > 
>
> > > I'm not trying to make trouble here
>
> > Your also not being constructive, don't just troll without even
> > talking to the people who can change things for the better, or fully
> > understanding what your criticizing.
>
> > > So, if you're
> > > thinking about usingBakeSale, make sure that you take a good look at
> > > the code before you use it, especially if you're going to be saving
> > > credit card numbers in your database.
>
> >Bakesaledoes NOT store CC information, it uses external payment
> > gateways e.g. paypal.
> > 
>
> > Drayen.
>
> > On Aug 1, 3:38 am, housebolt <[EMAIL PROTECTED]> wrote:
>
> > > There's nothing to disclose. I haven't given out anything, and it's
> > > blatantly apparent. There is not one single security measure in place
> > > within the code, so I would have to disclose the entire code base.
>
> > > I'm not trying to make trouble here, I'm just warning people about the
> > > danger of usingBakeSale"straight out of the box".
>
> > > I would be fine if they were marketing it as a basic starting point
> > > for building a shopping cart, but they're making it out to be a
> > > complete product.
>
> > > On Jul 31, 7:30 pm, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote:
>
> > > > On 8/1/07, housebolt <[EMAIL PROTECTED]> wrote:
>
> > > > > I was just taking a look atbakesalefor some ideas on building my own
> > > > > shopping cart.
>
> > > > > Please don't usebakesalein its current form without looking into its
> > > > > security issues.
>
> > > > Did you contact the deveopers ofBakesaleabout this before disclosing 
> > > > here?
>
> > > > If yes what was the response?
>
> > > > Tarique
>
> > > > --
> > > > =
> > > > Cheesecake-Photoblog:http://cheesecake-photoblog.org
> > > > PHP for E-Biz:http://sanisoft.com
> > > > =


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How should I allow Users only to edit their own Posts in a Cake App? Acl related

2007-08-01 Thread starkey

I do not think I'd use ACL for this.  I'd do as you suggest and check
the current userid against the create_by userid.  Also, I would not
give them an "edit" or "view" link if they aren't allowed to edit/view
it, they would just get confused if the option is there but they can't
use it.

Regards,
Shawn


On Aug 1, 9:41 am, luke BAKING barker <[EMAIL PROTECTED]> wrote:
> Hi
>
> What is the best way in a Cake app to allow a User to
> view/edit (etc) their own Profiles / Posts and so on?
>
> Rather than create a separate ARO (as Ketan Bakery tutorial suggests),
> I need to basically have a separate test in each action I guess
> something  like so:
>
> //pseudocode
> function edit($id) {
> ...
> $relevant = $this->Post->read($id);
> if ($this->session->USERID === $relevant['Post']['user_id']) {
>
>   // it's OK show them the view}
>
> else {
>  // this Post was not by this User , so they cant update it!
> $this->redirect();
>
> }
>
> does that make sense?
>
> I am learning the usage of Acl in 1.2 just now and this is perplexing
> me on how to do this with minimum of fuss.
>
> I don't know if it can be integrated / should be into Acl and Auth
> part of my web-app?
>
> thanks for any advice with this pattern,
>
> regards
>
> Luke


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: any idea why my save doesn't (?) work - help

2007-08-01 Thread apadzik

Thank you very much!!:-

Maybe there's another function for updating record?

For example I have table customers and i have password reminder which
sets new password for customer.
When i generate password as $newPass and try to set it for user like
this:
$this->data['Customer']['login_name']=$_SESSION['login'];
$this->data['Customer']['password']=md5($newPass);
$this->Customer->save($this->data);

it created me new record with all fields like first_name, last_name
etc. blank expcept for login_name and password.
Thanks in advance:)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Component, Model, or Vendor?

2007-08-01 Thread starkey

I ended up putting it in as a vendor as it is all in one file.

Thanks for your response!
Shawn

On Aug 1, 9:31 am, euphrate_ylb <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I understand that "cutting  your dev into pieces" is quite bothering.
> It seems quite ugly for a developer to copy/paste his files in ten
> different folders. However, you should do it this way because this is
> where your source code should be since your are dealing with data,
> business logic ... My point is : Don't gather all your sources in a
> single vendor folder only because cakephp doesn't have yet some kind
> of package manager that easliy deploy in a web app cake extensions
> (plugins, vendors, behavior, ).
>
> Therefore, because your app is consumming data from a LDAP directory,
> you should implement (or use) some kind LDAP datasoruce. Then you
> should model your data in a LdapUser model that provides a convinient
> way for using LDAP data. Finally you should handle in a controller
> authentication issues.
>
> This is just my opinion ... I hope it may help.
>
> ylb
>
> On Jul 31, 3:46 pm, starkey <[EMAIL PROTECTED]> wrote:
>
> > Good morning,
>
> > I'm porting an LDAP connector to Cake and am trying to figure out the
> > best way to do it without cutting it up into pieces.  Basically, the
> > connector authenticates someone against LDAP and then loads relevant
> > LDAP data (and some other data) into the session.
>
> > So the object needs access to LDAP and the SessionComponent.
>
> > The LDAP connector will be used in the AppController's beforeFilter
> > method to insure the user is logged in and is who they say they are.
>
> > I thought about putting it in Vendor because it has LDAP access and
> > business logic... however gaining access to the Session isn't
> > intuitive (to me at least).
>
> > Then I thought about Model because of the LDAP connection... except it
> > accesses the Session which belongs to Controllers and has business
> > logic... so I thought about a Component...
>
> > And now I'm asking you, what do you think is the "Cake" way to do
> > this?
>
> > By the way, when is the session started?  I've tried to access it in a
> > constructor and it is NULL.
>
> > Thanks!
> > Shawn


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cake 1.2 Data Validation Problem

2007-08-01 Thread Feris Thia

On 8/1/07, Pablo Viojo <[EMAIL PROTECTED]> wrote:
>
> Tryarray('rule'  => array('alphaNumeric')) (note => instead of ,)

Ah... that fix it. What a miss :P

Thanks Pablo !
>
> --
> Pablo Viojo
> [EMAIL PROTECTED]
> http://pviojo.net
>
>

Regars,

Feris
http://www.phi-integration.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: cakephp events reminder

2007-08-01 Thread starkey

First, setup a cronjob to run at whatever period you want, calling
your script.
Now, in your script:
Set your server's timezone equal to the user's timezone.
Then query your reminders table for upcoming reminders.
Send the reminder
Finally, delete the record for the reminder that you just sent.

Regards,
Shawn

On Aug 1, 10:01 am, "Pablo Viojo" <[EMAIL PROTECTED]> wrote:
> Hi ,
>
> My name is Pablo, could you introduce yourself (or at least sign your
> message). Also can you explain  a little about what you're trying to
> do?
>
> --
> Pablo Viojo
> [EMAIL PROTECTED]://pviojo.net
>
> On 8/1/07, candesprojects <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi,
>
> > Please help me with ideas how can I make a events reminder with
> > cakephp. I'm stuck on sending the emails when there is also the
> > timezone.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cake 1.2 Data Validation Problem

2007-08-01 Thread Pablo Viojo

Tryarray('rule'  => array('alphaNumeric')) (note => instead of ,)

-- 
Pablo Viojo
[EMAIL PROTECTED]
http://pviojo.net



On 8/1/07, Feris Thia <[EMAIL PROTECTED]> wrote:
>
> Hi All,
>
> I've read about data validation in CakePHP 1.2 version and I change my
> model $validate var as below :
>
> 
> var $validate = array(
>   'username' => array('rule', array('alphaNumeric')),
>   'password' => array('rule', array('alphaNumeric'))
> );
> 
>
> and I test the validation with following code in my controller
> 
>  $data = array ( 'User' => array ( 'username' =>
> 'dfsdfjhjhg', 'password' => 'sdffsdfsdf') );
> $this->User->create($data);
> if ($this->User->validates())
>  {
>echo 'succeed';
>  }
> 
>
> But the code returns this warning :
>
> Warning (2): preg_match() [function.preg-match]: Delimiter must not be
> alphanumeric or backslash [CORE\cake\libs\model\model.php, line 1674]
>
> What's wrong ?
>
> Regards,
>
> Feris
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: any idea why my save doesn't (?) work - help

2007-08-01 Thread Pablo Viojo

Use  $this->Orderitem->create(); as the first line on foreach
($cartitems as $ci) loop to initialize the model for a new record

-- 
Pablo Viojo
[EMAIL PROTECTED]
http://pviojo.net


On 8/1/07, apadzik <[EMAIL PROTECTED]> wrote:
>
> Hi! I got problem. I have tables: carts, carts_products, orders and
> orderitems. So, when the customer makes an order, the action make() in
> orders controller does the simple thing to create order for customer,
> then find all the products from the user's cart and save it to the
> orders orderitems table.
> The problem is that, when I save cartproducts to orderitems I do it in
> a loop:
>
> $cartitems=$this->CartsProduct->findAllByCartId($c_id);
> foreach ($cartitems as $ci)
> {
> 
> $this->data['Orderitem']['order_id']=$o_id;
> 
> $this->data['Orderitem']['product_id']=$ci['CartsProduct']
> ['product_id'];
> 
> $this->data['Orderitem']['size']=$ci['CartsProduct']['size'];
> 
> $this->data['Orderitem']['price']=$this->Product-
> >field('price',"id='".$ci['CartsProduct']['product_id']."'");
> $this->Orderitem->save($this->data);
> }
>
> When I "echo" all this data above ($cartitems, and $ci[..][..]) it
> shows me everything what's in the cart just like it's supposed to.
> When I echo "$this->Orderitem->save($this->data)" for all the
> cartproducts it gives me "1" as it was saved to orderitems table.
> So...why in phpMyAdmin in my orderitems table I see only one
> product from cart and it is the last product added to cart??
> Any1 help!:- Please:-))
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Cake 1.2 Data Validation Problem

2007-08-01 Thread Feris Thia

Hi All,

I've read about data validation in CakePHP 1.2 version and I change my
model $validate var as below :


var $validate = array(
  'username' => array('rule', array('alphaNumeric')),
  'password' => array('rule', array('alphaNumeric'))
);


and I test the validation with following code in my controller

 $data = array ( 'User' => array ( 'username' =>
'dfsdfjhjhg', 'password' => 'sdffsdfsdf') );
$this->User->create($data);
if ($this->User->validates())
 {
   echo 'succeed';
 }


But the code returns this warning :

Warning (2): preg_match() [function.preg-match]: Delimiter must not be
alphanumeric or backslash [CORE\cake\libs\model\model.php, line 1674]

What's wrong ?

Regards,

Feris

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



any idea why my save doesn't (?) work - help

2007-08-01 Thread apadzik

Hi! I got problem. I have tables: carts, carts_products, orders and
orderitems. So, when the customer makes an order, the action make() in
orders controller does the simple thing to create order for customer,
then find all the products from the user's cart and save it to the
orders orderitems table.
The problem is that, when I save cartproducts to orderitems I do it in
a loop:

$cartitems=$this->CartsProduct->findAllByCartId($c_id);
foreach ($cartitems as $ci)
{

$this->data['Orderitem']['order_id']=$o_id;

$this->data['Orderitem']['product_id']=$ci['CartsProduct']
['product_id'];

$this->data['Orderitem']['size']=$ci['CartsProduct']['size'];

$this->data['Orderitem']['price']=$this->Product-
>field('price',"id='".$ci['CartsProduct']['product_id']."'");
$this->Orderitem->save($this->data);
}

When I "echo" all this data above ($cartitems, and $ci[..][..]) it
shows me everything what's in the cart just like it's supposed to.
When I echo "$this->Orderitem->save($this->data)" for all the
cartproducts it gives me "1" as it was saved to orderitems table.
So...why in phpMyAdmin in my orderitems table I see only one
product from cart and it is the last product added to cart??
Any1 help!:- Please:-))


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How would you route this?

2007-08-01 Thread Pablo Viojo

Try Named Parameters [1], only cake 1.2 AFAIK

[1] http://bakery.cakephp.org/articles/view/passing-named-parameters

-- 
Pablo Viojo
[EMAIL PROTECTED]
http://pviojo.net






On 8/1/07, omer <[EMAIL PROTECTED]> wrote:
>
>
> (cakephp nubee, patience please ;) )
>
> Trying to keep up with cakePHP's RESTful approach,
> I can't quite figure out how to build the URL for a query that is a
> bit more complex than "get object X", or "get all objects X created
> over last week".
>
> For example, let's say I have a Posts table, that it has a has-and-
> belongs-to-many connection to a Tags table.
>
> Now, how do I RESTfully, simply, build a URL route that will say:
> "Get me all posts added during the last week, that are linked to both
> the tag 'Fun' and the tag 'Games'"?
>
>
> I'm can think of a few not-so-beautiful and not-very-aesthetic ways of
> doing it,
> but I'm sure there's a more elegant way...
>
> anyone?
>
> thanx,
> Omer.
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: cakephp events reminder

2007-08-01 Thread Pablo Viojo

Hi ,

My name is Pablo, could you introduce yourself (or at least sign your
message). Also can you explain  a little about what you're trying to
do?

-- 
Pablo Viojo
[EMAIL PROTECTED]
http://pviojo.net




On 8/1/07, candesprojects <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> Please help me with ideas how can I make a events reminder with
> cakephp. I'm stuck on sending the emails when there is also the
> timezone.
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How should I allow Users only to edit their own Posts in a Cake App? Acl related

2007-08-01 Thread luke BAKING barker

Hi

What is the best way in a Cake app to allow a User to
view/edit (etc) their own Profiles / Posts and so on?

Rather than create a separate ARO (as Ketan Bakery tutorial suggests),
I need to basically have a separate test in each action I guess
something  like so:

//pseudocode
function edit($id) {
...
$relevant = $this->Post->read($id);
if ($this->session->USERID === $relevant['Post']['user_id']) {

  // it's OK show them the view
}
else {
 // this Post was not by this User , so they cant update it!
$this->redirect();
}

does that make sense?

I am learning the usage of Acl in 1.2 just now and this is perplexing
me on how to do this with minimum of fuss.

I don't know if it can be integrated / should be into Acl and Auth
part of my web-app?

thanks for any advice with this pattern,

regards

Luke


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Component, Model, or Vendor?

2007-08-01 Thread euphrate_ylb

Hi,

I understand that "cutting  your dev into pieces" is quite bothering.
It seems quite ugly for a developer to copy/paste his files in ten
different folders. However, you should do it this way because this is
where your source code should be since your are dealing with data,
business logic ... My point is : Don't gather all your sources in a
single vendor folder only because cakephp doesn't have yet some kind
of package manager that easliy deploy in a web app cake extensions
(plugins, vendors, behavior, ).

Therefore, because your app is consumming data from a LDAP directory,
you should implement (or use) some kind LDAP datasoruce. Then you
should model your data in a LdapUser model that provides a convinient
way for using LDAP data. Finally you should handle in a controller
authentication issues.

This is just my opinion ... I hope it may help.

ylb

On Jul 31, 3:46 pm, starkey <[EMAIL PROTECTED]> wrote:
> Good morning,
>
> I'm porting an LDAP connector to Cake and am trying to figure out the
> best way to do it without cutting it up into pieces.  Basically, the
> connector authenticates someone against LDAP and then loads relevant
> LDAP data (and some other data) into the session.
>
> So the object needs access to LDAP and the SessionComponent.
>
> The LDAP connector will be used in the AppController's beforeFilter
> method to insure the user is logged in and is who they say they are.
>
> I thought about putting it in Vendor because it has LDAP access and
> business logic... however gaining access to the Session isn't
> intuitive (to me at least).
>
> Then I thought about Model because of the LDAP connection... except it
> accesses the Session which belongs to Controllers and has business
> logic... so I thought about a Component...
>
> And now I'm asking you, what do you think is the "Cake" way to do
> this?
>
> By the way, when is the session started?  I've tried to access it in a
> constructor and it is NULL.
>
> Thanks!
> Shawn


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Best Practice for Views

2007-08-01 Thread starkey

Grant & Geoff, that's a pretty cool solution!


On Jul 31, 7:56 pm, Geoff Ford <[EMAIL PROTECTED]> wrote:
> I'm with grant - use one action with a differnt view as needed
>
> function action1($layout = 'list'){
>   // set data and other stuff
>   switch ($layout){
> case 'table':
>   $this->render('action1_table');
>   break;
> default:
>   $this->render('action1_list');
>   break;
>   }
>
> }
>
> You could use if...else if there are only two possible options
>
> Geoff
> --http://lemoncake.wordpress.com
>
> On Aug 1, 9:19 am, Grant Cox <[EMAIL PROTECTED]> wrote:
>
> > One of the primary parts of Cake is to keep your data separate from
> > your application interface (controllers), separate from your
> > presentation (views).  Changing one of these elements should not
> > require modification to the others.  You want the first two to remain
> > the same, you just want different views.
>
> > If the controller functionality remains the same between the different
> > modes (list vs table), which I imagine it does, then you should stick
> > to a single controller action.  Allow the request to determine what
> > format to output, and render the appropriate view from this.  So
> > requesting /controller/view/list vs  /controller/view/table  will
> > execute the same controller action, but just render the list.ctp or
> > table.ctp view file.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



cakephp events reminder

2007-08-01 Thread candesprojects

Hi,

Please help me with ideas how can I make a events reminder with
cakephp. I'm stuck on sending the emails when there is also the
timezone.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: About Associations : example

2007-08-01 Thread starkey

I suggest you check out the Bakery.


On Aug 1, 7:40 am, Ghanshyam Rathod <[EMAIL PROTECTED]> wrote:
> Hello friends,
>
>  I am newbie to the cakePHP frameworks and want to learn association
> in good way.
> kindly send me SQL script with  model, controller and view code.
>
> i mean running example.
>
> Thanks


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Please healp me for using the PHPBB

2007-08-01 Thread Chris Hartjes

On 8/1/07, sandy <[EMAIL PROTECTED]> wrote:
>
> Dear Friends
>
>  I am sandy.and I want to know that how to we use
> phpbb and how can we Implement.actuly I am new in the field of
> PHP.please help me.
>
> Thank's to all
>
> With Warm regards
>

Here's a great link to help you with that:

http://slash7.com/pages

-- 
Chris Hartjes
Senior Developer
Cake Development Corporation

My motto for 2007:  "Just build it, damnit!"

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Validation fails but shows no error

2007-08-01 Thread burzum

On Aug 1, 1:55 pm, Baz <[EMAIL PROTECTED]> wrote:
> I'm assuming this is 1.2?

Yes, its 1.2, the nightly build from 2007-07-29 but the older build
had the same problem.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: paginate with criteria in 1.2

2007-08-01 Thread gmarziou

Looks like the same problem I posted yesterday and I got a good
answer, check this thread:

http://groups.google.com/group/cake-php/browse_thread/thread/c39604e397f7a4a9

Cheers,

Gael\


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Please healp me for using the PHPBB

2007-08-01 Thread sandy

Dear Friends

 I am sandy.and I want to know that how to we use
phpbb and how can we Implement.actuly I am new in the field of
PHP.please help me.
 
Thank's to all
 
With Warm regards
 
sandy


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



About Associations : example

2007-08-01 Thread Ghanshyam Rathod

Hello friends,

 I am newbie to the cakePHP frameworks and want to learn association
in good way.
kindly send me SQL script with  model, controller and view code.

i mean running example.

Thanks


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Cake PHP Book

2007-08-01 Thread Sarat Pediredla

Just a shout out to the community that I will be writing a book for
CakePHP 1.2 which will be due out Summer 2008. Our company has been
working with CakePHP from 1.1 and after building many apps and writing
custom hacks to the frameworks for ages (which are thankfully resolved
in 1.2), we decided to make sure the community gets the documentation
it deserves.

I doubt it would be as good as a book coming from the CakePHP creators
but it is better their focus remains on the actual code and API.
Hopefully, the book effort can complement this. And hopefully a nice
share to the foundation from the book revenue when it hits the
shelves.

If anyone wants to discuss this or has any comments/feedback, please
drop me a line.

Sarat Pediredla
http://hedgehoglab.com


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: A quick note about BakeSale

2007-08-01 Thread housebolt

> I've committed code to bakesale and use it myself

Glad to hear from you. I'll post some of the stuff over at BakeSaleHq
as soon as I get some time this week. It's a great platform, and I
think it could go further than osCommerce (and be 10 times more easy
to use and customize). I personally think all shopping carts should
use some sort of framework, and BakeSale is the first of its kind for
Cake.

On Aug 1, 1:25 am, drayen <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I've committed code to bakesale and use it myself, i would be
> interested to hear what you've found. I can also confirm you never
> contacted the bakesale team. Onto your image :
>
> The system doesn't look like its released any useful data?
>
> The output your showing is on the demo site, which is deliberately
> unsecured to allow people to test the admin interface. Were you able
> to re-create your results on your own server?
>
> If you want to help, by all means apply to be a part of the bakesale
> cakeforge group and commit updated and more secure code, i am sure we
> would welcome the help. We are soon going to move to 1.2 and will be
> using the security class you talked about in a post you made 34 hours
> ago, which should close a few holes.
>
> Or if not how about submit the holes you've found, ideally with
> solution code via our bug tracker on google code 
> :http://code.google.com/p/bakesale/issues/list
>
> 
>
> > I'm not trying to make trouble here
>
> Your also not being constructive, don't just troll without even
> talking to the people who can change things for the better, or fully
> understanding what your criticizing.
>
> > So, if you're
> > thinking about using BakeSale, make sure that you take a good look at
> > the code before you use it, especially if you're going to be saving
> > credit card numbers in your database.
>
> Bakesale does NOT store CC information, it uses external payment
> gateways e.g. paypal.
> 
>
> Drayen.
>
> On Aug 1, 3:38 am, housebolt <[EMAIL PROTECTED]> wrote:
>
> > There's nothing to disclose. I haven't given out anything, and it's
> > blatantly apparent. There is not one single security measure in place
> > within the code, so I would have to disclose the entire code base.
>
> > I'm not trying to make trouble here, I'm just warning people about the
> > danger of using BakeSale "straight out of the box".
>
> > I would be fine if they were marketing it as a basic starting point
> > for building a shopping cart, but they're making it out to be a
> > complete product.
>
> > On Jul 31, 7:30 pm, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote:
>
> > > On 8/1/07, housebolt <[EMAIL PROTECTED]> wrote:
>
> > > > I was just taking a look at bakesale for some ideas on building my own
> > > > shopping cart.
>
> > > > Please don't use bakesale in its current form without looking into its
> > > > security issues.
>
> > > Did you contact the deveopers of Bakesale about this before disclosing 
> > > here?
>
> > > If yes what was the response?
>
> > > Tarique
>
> > > --
> > > =
> > > Cheesecake-Photoblog:http://cheesecake-photoblog.org
> > > PHP for E-Biz:http://sanisoft.com
> > > =


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Validation fails but shows no error

2007-08-01 Thread Baz
I'm assuming this is 1.2?

select('Spindle/company_id',
$CompaniesList,null,array('class' => 'required'),'-');?>

error(Spindle.spinnr) ;?>

text('Spindle/spinnr',array('class' => 'required'));?>


On 8/1/07, burzum <[EMAIL PROTECTED]> wrote:
>
>
> There is no output of an error message in my view but pr($this-
> >Spindle->invalidFields()); placed in the controller shows that 2
> fields are invalid!?
>
> Array
> (
> [company_id] => This field cannot be left blank
> [spinnr] => This field cannot be left blank
> )
>
> My model:
>
> var $validate = array(
> 'company_id' => array(
> 'rule' => array('numeric')
> ),
> 'spinnr' => array(
> 'rule' => array('custom',VALID_NOT_EMPTY)
> )
> );
>
> My View:
>
> select('Spindle/company_id',
> $CompaniesList,null,array('class' => 'required'),'-');?>
> text('Spindle/spinnr',array('class' => 'required'));?>
>
> Any ideas whats wrong?
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Validation fails but shows no error

2007-08-01 Thread burzum

There is no output of an error message in my view but pr($this-
>Spindle->invalidFields()); placed in the controller shows that 2
fields are invalid!?

Array
(
[company_id] => This field cannot be left blank
[spinnr] => This field cannot be left blank
)

My model:

var $validate = array(
'company_id' => array(
'rule' => array('numeric')
),
'spinnr' => array(
'rule' => array('custom',VALID_NOT_EMPTY)
)
);

My View:

select('Spindle/company_id',
$CompaniesList,null,array('class' => 'required'),'-');?>
text('Spindle/spinnr',array('class' => 'required'));?>

Any ideas whats wrong?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CakePHP + AJAX+ charsets

2007-08-01 Thread Femi Taiwo






francky06l - You're quite right! 
Re-saving the default.po file for French (& other languages ) with
UTF-8 encoding solved the problem completely.
Thanks! Now I don't need to specify the ISO-8859-1 charset in my
beforeRender() while I also leave the UTF-8 as my charset right from my
default layout.

Femi

francky06l wrote:

  Are the errors you see are in the language file for French ?
If so, I think you should save your language file in UTF-8 without
BOM.

On Aug 1, 11:29 am, Femi Taiwo <[EMAIL PROTECTED]> wrote:
  
  
Hi,
The i10n version (french in this case) of my cakephp application shows
up with invalid characters, if I'm loading up the view using ajax. If i
use the classic full reload of the page, everything's normal,
but views loaded using ajax do not render well. Accented characters show
up as question marks or other funny looking character.
I thot it might have something to do with the set charset, so i changed
the charset from UTF-8 to
charset('ISO-8859-1'). "\n"; ?> without results.

I've included a small screenshot in this mail hoping it would help. The
left sidebar of the displayed page came with the index.ctp while the
part on the right was loaded using ajax .
Please has anyone experienced this before or have an idea how to do this
correctly

Thanks. Cheers

Femi T.

 french-i10n.jpg
19KViewDownload

  
  



  



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php?hl=en  -~--~~~~--~~--~--~---





Re: Load only some record of a DB table in a model

2007-08-01 Thread bugfaceuk

If you mean, how do I always find a sub-set of the available rows then
you can over-ride some methods in your model. For example:

/**
 * Makes sure that it is restricted to current members
 * Over-rides the findAll method
 */
function findAll($conditions = null, $fields = null, $order = null,
$limit = null, $page = 1, $recursive = null){
if ($conditions===null){
$conditions=array("User.currentMember" => "1");
} else {
$conditions["User.currentMember"]="1";
}

return parent::findAll($conditions,$fields,$order,$limit,$page,
$recursive);
}

A similar process could be applied in other methods.

On Jul 31, 6:34 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On 7/31/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
>
> > For example ...
> > If I change the __construct method I can get the result that I want?
>
> I don't think you have explained *what* it is you want.  When you
> explain that, I'm sure there is a solution.
>
> Everything you do will require you to use one of the built-in SQL
> helpers like find() or findAll() or findByX() or else you will be
> writing the SQL yourself.
>
> --
> Chris Hartjes
> Senior Developer
> Cake Development Corporation
>
> My motto for 2007:  "Just build it, damnit!"
>
> @TheBallpark -http://www.littlehart.net/attheballpark
> @TheKeyboard -http://www.littlehart.net/atthekeyboard


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Easy problem, not all that easy to figure out (set function)

2007-08-01 Thread Adam Royle

If you are just counting the number of rows returned, just use the php
function count() on your returned dataset.

in your view:

echo count($gallery);

Cheers,
Adam

On Jul 31, 7:12 pm, DrLaban <[EMAIL PROTECTED]> wrote:
> That worked ace! Thanks!
>
> Regard
>  DrLaban
>
> On Jul 29, 6:22 pm, Gorka <[EMAIL PROTECTED]> wrote:
>
> > If I understood you right, you are overwritting the value of 'gallery'
> > with the second call to $this->set(), when you wanted to merge both
> > values. Try preparing your data first, then setting 'gallery' for the
> > view.
>
> > $galery = $this->Gallery->findAll();
> > $gallery['numRows'] = $this->Gallery->getNumRows();
> > $this->set('gallery', $gallery);
>
> > On 29 jul, 17:30,DrLaban<[EMAIL PROTECTED]> wrote:
>
> > > Hey all!
>
> > > Short and simple;
> > > I'm trying to add more data to a Controller object with the help of
> > > set().
>
> > > So what I'm doing in practice:
> > > $this->set('gallery', $this->Gallery->findAll());
>
> > > Everything works out fine here. I get access to all the info I need in
> > > the view I'm working with.
> > > Now, I'd like to add something simple like "numRows" to the gallery
> > > variable.
>
> > > What I've tried is:
> > > $this->set('gallery', array('numRows' => $this->Gallery-
>
> > > >getNumRows());
>
> > > But, as it would seem, the gallery object now only contains the last
> > > set function call's info. How do I add info to the gallery object
> > > without losing info from the first set call? I'd just like to add a
> > > field called "numRows" that contains the int value of rows returned,
> > > into the gallery object.
>
> > > Thanks in advance!
>
> > > Regards
> > >  DrLaban


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: tags.ini.php

2007-08-01 Thread Feris Thia

On 8/1/07, TBone <[EMAIL PROTECTED]> wrote:
>
> Feris,
>
> I too was searching for this file. It happens to be moved into a
> helper class found in "cake\libs\view\helpers\html.php"

Hi Tbone,

Great that's what I'm looking for.
>
> T

Thanks !

Feris

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Idea about bin

2007-08-01 Thread [EMAIL PROTECTED]

I would have thought that a paste bin by definition is more likely to
have dodgy code people are asking about in the group than beautiful
examples ripe for a case study. Isn't the case study worthy, useful
quality code better suited to the snippets mechanism?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CakePHP + AJAX+ charsets

2007-08-01 Thread francky06l

Are the errors you see are in the language file for French ?
If so, I think you should save your language file in UTF-8 without
BOM.

On Aug 1, 11:29 am, Femi Taiwo <[EMAIL PROTECTED]> wrote:
> Hi,
> The i10n version (french in this case) of my cakephp application shows
> up with invalid characters, if I'm loading up the view using ajax. If i
> use the classic full reload of the page, everything's normal,
> but views loaded using ajax do not render well. Accented characters show
> up as question marks or other funny looking character.
> I thot it might have something to do with the set charset, so i changed
> the charset from UTF-8 to
> charset('ISO-8859-1'). "\n"; ?> without results.
>
> I've included a small screenshot in this mail hoping it would help. The
> left sidebar of the displayed page came with the index.ctp while the
> part on the right was loaded using ajax .
> Please has anyone experienced this before or have an idea how to do this
> correctly
>
> Thanks. Cheers
>
> Femi T.
>
>  french-i10n.jpg
> 19KViewDownload


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: how to perform this query

2007-08-01 Thread rtanz

ah ok tnx fixed that, any help on my last post for inserting the $ret
data returned from
the tasklist model into the tasklist controller's $this->data ?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Usinf DATE_FORMAT Expression in findAll()

2007-08-01 Thread grigri

I've come across this question before in one of my projects, here's
what I worked out:

The reason the info is not present in the returned array is because
cake check if the field name is present in the model's metadata - i.e.
columns in the table.
Ways to get around this:

* Use afterFind to perform the operations in PHP (like you did)
instead of in the SQL
* Use afterFind to move the results into the array: (I did something
like this, but in a behavior)
  function afterFind($results) {
foreach ($results as $key => $row) {
  if (!empty($row[0]['validity_date_fmt'])) {
$results[$key]['Event']['validity_date_fmt'] = $row[0]
['validity_date_fmt'];
unset($results[$key][0]['validity_date_fmt']);
  }
}
return $results;
  }
* Override the Event::loadInfo() function to tack on another field
called 'validity_date_fmt' (NOT tested)
  > This might cause problems when doing a query with no specified
fields, as it will try to grab the 'validity_date_fmt' from the
database,
 where it doesn't exist. You'd have to write a beforeFind handler
to check for this condition - or something

Hope this helps; in any case I'd like to see the "official" way to
handle this issue.

On 31 Jul, 19:55, keys71 <[EMAIL PROTECTED]> wrote:
> ...or is the usage of an 'afterFind' - function the right method of
> resolution (because it works)?
>
> function afterFind($results) {
> foreach ($results as $key => $val) {
> if ( isset($val['Event']['validity_date']) ) {
>$dates = explode("-", $val['Event']['validity_date']);
>$results[$key]['Event']['validity_date_fmt'] =
> $dates[2].".".$dates[1].".".$dates[0];
> }
>  }
>   return $results;
>}


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



CakePHP + AJAX+ charsets Part 2

2007-08-01 Thread Femi Taiwo

Hi,

Using firebug for firefox, I was able to pin point the problem to the 
fact that by default, the request header returned to the ajax call made 
is UTF-8, so I've just added  the following code to my custom 
app_controller.php and everything is fine now

function beforeRender(){

if(!headers_sent()){
  header('Content-type: text/html;charset=ISO-8859-1');
}
.

}

So my l10n is displaying perfectly!
Just in case, is this method of solving this problem the best or there's 
a more elegant method?

Thanks!
& Cheers

Femi T.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



CakePHP + AJAX+ charsets

2007-08-01 Thread Femi Taiwo
Hi,
The i10n version (french in this case) of my cakephp application shows 
up with invalid characters, if I'm loading up the view using ajax. If i 
use the classic full reload of the page, everything's normal,
but views loaded using ajax do not render well. Accented characters show 
up as question marks or other funny looking character.
I thot it might have something to do with the set charset, so i changed 
the charset from UTF-8 to
charset('ISO-8859-1'). "\n"; ?> without results.

I've included a small screenshot in this mail hoping it would help. The 
left sidebar of the displayed page came with the index.ctp while the 
part on the right was loaded using ajax .
Please has anyone experienced this before or have an idea how to do this 
correctly

Thanks. Cheers

Femi T.




--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---

<>

paginate with criteria in 1.2

2007-08-01 Thread pravinda

Hi,
Paginatore paginates automatically is great functionality of cakephp.
But I am unable to paginate by applying the criteria or conditions, if
I applies the nest and prev links does not contains the criteria so as
to get the next page using that criteria or conditions
thanks in advance


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: A quick note about BakeSale

2007-08-01 Thread drayen

Hi,

I've committed code to bakesale and use it myself, i would be
interested to hear what you've found. I can also confirm you never
contacted the bakesale team. Onto your image :

The system doesn't look like its released any useful data?

The output your showing is on the demo site, which is deliberately
unsecured to allow people to test the admin interface. Were you able
to re-create your results on your own server?

If you want to help, by all means apply to be a part of the bakesale
cakeforge group and commit updated and more secure code, i am sure we
would welcome the help. We are soon going to move to 1.2 and will be
using the security class you talked about in a post you made 34 hours
ago, which should close a few holes.

Or if not how about submit the holes you've found, ideally with
solution code via our bug tracker on google code :
http://code.google.com/p/bakesale/issues/list


> I'm not trying to make trouble here

Your also not being constructive, don't just troll without even
talking to the people who can change things for the better, or fully
understanding what your criticizing.

> So, if you're
> thinking about using BakeSale, make sure that you take a good look at
> the code before you use it, especially if you're going to be saving
> credit card numbers in your database.

Bakesale does NOT store CC information, it uses external payment
gateways e.g. paypal.


Drayen.


On Aug 1, 3:38 am, housebolt <[EMAIL PROTECTED]> wrote:
> There's nothing to disclose. I haven't given out anything, and it's
> blatantly apparent. There is not one single security measure in place
> within the code, so I would have to disclose the entire code base.
>
> I'm not trying to make trouble here, I'm just warning people about the
> danger of using BakeSale "straight out of the box".
>
> I would be fine if they were marketing it as a basic starting point
> for building a shopping cart, but they're making it out to be a
> complete product.
>
> On Jul 31, 7:30 pm, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote:
>
> > On 8/1/07, housebolt <[EMAIL PROTECTED]> wrote:
>
> > > I was just taking a look at bakesale for some ideas on building my own
> > > shopping cart.
>
> > > Please don't use bakesale in its current form without looking into its
> > > security issues.
>
> > Did you contact the deveopers of Bakesale about this before disclosing here?
>
> > If yes what was the response?
>
> > Tarique
>
> > --
> > =
> > Cheesecake-Photoblog:http://cheesecake-photoblog.org
> > PHP for E-Biz:http://sanisoft.com
> > =


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Newbie: What if save returns flase (mySQL:connection state/error)?

2007-08-01 Thread Fran Simó

I'm developing in WAMP/MAMP and LAMP with differents versions of PHP
and mySQL a single app.
While in MAMP and LAMP a save returns always true, in WAMP retunrs
false. (it's a very simple table with no validation nor table
restrictions)

I imagine that is a problem with the installation, but:

How can I access to an conecction state, last error or something
similar?

Model::onError is not called, it's simply returning false.

Thanks.

--
Fran Simó
http://justpictures.es(


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Using paginate() with conditions from a query form

2007-08-01 Thread gmarziou

Excellent article, thanks a lot for pointing me to it.

Gael



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How would you route this?

2007-08-01 Thread omer


(cakephp nubee, patience please ;) )

Trying to keep up with cakePHP's RESTful approach,
I can't quite figure out how to build the URL for a query that is a
bit more complex than "get object X", or "get all objects X created
over last week".

For example, let's say I have a Posts table, that it has a has-and-
belongs-to-many connection to a Tags table.

Now, how do I RESTfully, simply, build a URL route that will say:
"Get me all posts added during the last week, that are linked to both
the tag 'Fun' and the tag 'Games'"?


I'm can think of a few not-so-beautiful and not-very-aesthetic ways of
doing it,
but I'm sure there's a more elegant way...

anyone?

thanx,
Omer.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: A quick note about BakeSale

2007-08-01 Thread Hohngjuhn Pahk
Like this:

#include 

void main(void) {
   char strings[] = "\nHello, everybody!\n";

printf(strings);

}

Some simple code is little variation of the GREAT R. Ricky owned.
Somebody can compiled it as ANSI C compiler.



07. 8. 1, Hohngjuhn Pahk <[EMAIL PROTECTED]>님이 작성:
>
> By dictioary in www.naver.com
>
> blatantly
>
> bla·tant〔〕 a.
> 1 떠들썩한, 시끄러운
> 2 뻔뻔스러운, 주제넘은
> 3 <복장 등이> 난한, 야한, 야단스러운
> 4 속이 들여다보이는, 노골적인;심한
> blatant·ly ad.
>
> blatant  /bletnt/
>
> ADJ
> You use blatant to describe something bad that is done in an open or very
> obvious way.
> Outsiders will continue to suffer the most blatant discrimination.
> a blatant attempt to spread the blame for the fiasco.
> The elitism was blatant.
>
>
> blatantly ADV : ADV adj, ADV with v
> a blatantly sexist question.
>
> They said the song blatantly encouraged the killing of policemen.
>
>
>  English news
> Is Missionary Work Safe in Islamic World?
> "... Korean missionaries' work noted that Korean missionaries have a
> notorious reputation for their aggressive and blatant way of evangelizing.
> Oleg Kiriyanov, correspondent of the Russian state-run newspaper,
> Rossiyskaya Gazeta, said he was surprised... "
>
> blatant
> One entry found for blatant.
>
>
> From the webster in www.Yahoo.com 
>
> Main Entry: bla·tant
> Pronunciation: 'blA-t&nt
> Function: adjective
> Etymology: perhaps from Latin blatire to chatter
> 1 : noisy especially in a vulgar or offensive manner : CLAMOROUS
> 2 : completely obvious, conspicuous, or obtrusive especially in a crass or
> offensive manner : BRAZEN 
> synonym see VOCIFEROUS
> - bla·tant·ly adverb
>
> What do you want from my response.
>
>
> 2007/8/1, Dr. Tarique Sani <[EMAIL PROTECTED]>:
> >
> > On 8/1/07, housebolt < [EMAIL PROTECTED]> wrote:
> > >
> > >
> > > There's nothing to disclose. I haven't given out anything, and it's
> > > blatantly apparent.
> >
> >
> > Should I take that to mean you did not contact the original developers
> > before posting here?
> >
> > At the expense of sounding didactic I would like to point out - it is a
> > good etiquette that any security related issues are first to be conveyed to
> > the developer and response solicited before discussing it in public.
> >
> > Anyways - end of thread from my side
> >
> > Tarique
> >
> > --
> > =
> > Cheesecake-Photoblog: http://cheesecake-photoblog.org
> > PHP for E-Biz: http://sanisoft.com
> > =
> > > >
> >
>
>
> --
> 朴ong준




-- 
朴ong준

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---