Many-to-Many Relationships with 3 tables. Auth and Acl

2008-08-18 Thread Reza Muhammad
Hi All, I've been following lately, and I must say I'm very pleased with the framework. Currently, I'm having a different project where there should be many to many relationships between 3 tables. This particular situation is for user management purposes. The User role /group will depend

Re: Thoughts on translation strings.

2008-08-18 Thread [EMAIL PROTECTED]
Thanks for your replies guys. I had managed to track down the guidelines at gnu.org but the other ones were new to me. /Martin On Aug 15, 1:23 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote: > > But how much real text should I put in each string? I could just as > > easily translate: > > "Y

How to get the category cover from a product table?

2008-08-18 Thread Henrique Machado
Hello! This is my first messa ge here. Sorry my bad english, i'm from brazil Scenario: Category hasMany Products Products belongsTo Category category table: `id` int(10) unsigned NOT NULL auto_increment, `nome` varchar(255) collate utf8_unicode_ci default NULL, `created` datetime default

Re: 2 column layout for $form->input() ?

2008-08-18 Thread peterm95018
Would it be possible for someone to post a short example? I've been struggling with formatting a form layout all day. thank you, peterm --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to th

Re: validationErrors in plugins

2008-08-18 Thread martinp
Sorry, ignore me. I hadn't used $this->User->read() before trying to save and this was causing the problem. On Aug 19, 12:47 am, martinp <[EMAIL PROTECTED]> wrote: > Hi - Been staring at this for a few hours now and can't see what the > problem is.. maybe someone can help? > > Somehow my validati

Re: generateList / Set::combine help

2008-08-18 Thread Zoltan
That worked perfectly... that's it- Cake makes this stuff way too easy :) Thanks, Zoltan On Aug 18, 6:50 pm, AD7six <[EMAIL PROTECTED]> wrote: > On Aug 19, 12:31 am, Zoltan <[EMAIL PROTECTED]> wrote: > > > > > Hi > > > I'm trying to figure out the syntax for creating an array in the > > proper f

Re: Acl and Auth slow page load

2008-08-18 Thread Marcus J. Ertl
Marcus J. Ertl schrieb: Hi again! > I'm afraid, this is poor application design on my side too. :-( > OK, I took a look into this! It was bad design on my side! :-( I've startet with more then 60 queries, taking about 30 seconds! :-( After taking the check outside the loop, I'm down to 24

Field Naming Convention

2008-08-18 Thread kienpham2000
Hi all cake bakers, I'm using the 1.2RC and I followed the field naming convention here to get array of data for a field name: http://book.cakephp.org/view/547/field-naming-convention Here is my code to create input fields: input('MyModel.myField.1');?> input('MyModel.myField.2');?> But when it

Re: generateList / Set::combine help

2008-08-18 Thread AD7six
On Aug 19, 12:31 am, Zoltan <[EMAIL PROTECTED]> wrote: > Hi > > I'm trying to figure out the syntax for creating an array in the > proper format for grouping by as the old generateList method did (but > using 1.2's find() instead) > > This is the array I have: > Array > ( >     [0] => Array >  

Re: Best practice: DB table data needed in a view helper?

2008-08-18 Thread francky06l
@Mark, Kalt suggestion is goof for an element. You could also user an helper and caching. The helper would check the cached file, if not there or expired your helper can do a requestAction and cache the results for future calls. I use this quite a lot for fetching data for select for example (lik

validationErrors in plugins

2008-08-18 Thread martinp
Hi - Been staring at this for a few hours now and can't see what the problem is.. maybe someone can help? Somehow my validationErrors are getting lost on their way from the controller to the view. I have a simple form: echo $form->create('Users.User', array('url' => $thi

Re: Best practice: DB table data needed in a view helper?

2008-08-18 Thread Kalt
Take a look at the "requestAction" method. And instead of a helper, I think you'd better use an element. On 19 août, 00:06, "Mark (Germany)" <[EMAIL PROTECTED]> wrote: > I have a helper which needs the "codecats" table data (20-40 rows) > everywhere where it is used. > i sure could ask for it in

Re: Acl and Auth slow page load

2008-08-18 Thread Marcus J. Ertl
mark_story schrieb: Hi Mark! > Tiggr: How many queries is ACL component doing. Normally for a single > check it is ~6 db calls. If you are doing more than one acl check per- > page you should be caching the results, so you can use them over > again. But caching is not part of the core ACL compo

Re: Bake and MySQL problems

2008-08-18 Thread [EMAIL PROTECTED]
php -m gives me the following : [PHP Modules] ctype curl date dom exif filter ftp hash iconv json ldap libxml mbstring mysql mysqli odbc openssl pcre PDO pdo_sqlite posix Reflection session SimpleXML sockets SPL SQLite standard tokenizer xml xmlreader xmlrpc xmlwriter xsl zlib [Zend Modules] an

generateList / Set::combine help

2008-08-18 Thread Zoltan
Hi I'm trying to figure out the syntax for creating an array in the proper format for grouping by as the old generateList method did (but using 1.2's find() instead) This is the array I have: Array ( [0] => Array ( [ReviewTopic] => Array (

Re: Printing labels with barcodes (PDF)

2008-08-18 Thread LunarDraco
I would take a look at using an rtf library. This will give you the control you need over your layout and allow you to specify fonts. You'll also need a Code 3 of 9 font. Then you can specify your text and build all the barcodes in the format of *12348* etc. rtf class: http://www.phpclasses.org/b

Best practice: DB table data needed in a view helper?

2008-08-18 Thread Mark (Germany)
I have a helper which needs the "codecats" table data (20-40 rows) everywhere where it is used. i sure could ask for it in the controller: ->list('all').. and pass it the view there i can again pass it to the helper but is there a) a way to automatically pass it from the controller to the helper

Re: Specific Directories

2008-08-18 Thread Arak Tai'Roth
Hmmm, well, that definitely solved the problem much easier. Never though of that. Thank you very much for your help. On Aug 18, 3:23 pm, "Marcin Domanski" <[EMAIL PROTECTED]> wrote: > 1.in production you document root should point to app/webroot. > 2. if you have a directory in app/webroot cake w

Re: Selective field model validation

2008-08-18 Thread francky06l
Check carefully the meaning of "required" versus "notEmpty" (or '/\S +/') in validation ("required" makes the field mandatory -- but can be empty -- every time single time you call validation, whether the field is in a form or not). Some usage of "on" => "create" might also help. hth On Aug 18,

RE: Bake and MySQL problems

2008-08-18 Thread Christian Winther
Or do this in CLI: "php -m" to get a list of loaded modules and "php --ini" to get a list of ini files loaded by CLI Those two should point you in the right direction -Original Message- From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Marcin Domanski Sent: 18.

Re: Specific Directories

2008-08-18 Thread Marcin Domanski
1.in production you document root should point to app/webroot. 2. if you have a directory in app/webroot cake wil show that directory first insted of trying to find a controller for it HTH, -- Marcin Domanski http://kabturek.info On Mon, Aug 18, 2008 at 9:49 PM, Arak Tai'Roth <[EMAIL PROTECTED]>

Re: Acl and Auth slow page load

2008-08-18 Thread francky06l
You might also index your aros/acos tables, according to the mode used in Auth ... On Aug 18, 10:51 pm, mark_story <[EMAIL PROTECTED]> wrote: > Tiggr: How many queries is ACL component doing. Normally for a single > check it is ~6 db calls. If you are doing more than one acl check per- > page y

Re: Bake and MySQL problems

2008-08-18 Thread Marcin Domanski
Hey, probably (99%) you PHP CLI doesnt have mysql extension loaded . find the php.ini responisble for cli and uncomment the mysql extension lines. -- Marcin Domanski http://kabturek.info On Mon, Aug 18, 2008 at 3:51 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hi everyone, > > I am goi

Re: Acl and Auth slow page load

2008-08-18 Thread mark_story
Tiggr: How many queries is ACL component doing. Normally for a single check it is ~6 db calls. If you are doing more than one acl check per- page you should be caching the results, so you can use them over again. But caching is not part of the core ACL component. -Mark On Aug 18, 3:12 am, Tig

Re: isUnique model validation 'on create' not working?

2008-08-18 Thread Zoltan
Problem turned out to be I had taken the 'id' field out of the edit.ctp file. Put it back in, and everything worked fine. Zoltan On Aug 18, 1:38 pm, haj <[EMAIL PROTECTED]> wrote: > I know I'm not answering to the question but a field that needs to be > unique generally hold the same requiremen

Re: Selective field model validation

2008-08-18 Thread AD7six
On Aug 18, 9:47 pm, David Yell <[EMAIL PROTECTED]> wrote: > This was solved in #cakephp > By using $this->Model->validates($this->data['Model']['field'] > > So big thanks to penfold_99 for sorting this for me, thanks! That reminds me of the time someone "optimized" my code by commenting out all

Re: Specific Directories

2008-08-18 Thread Arak Tai'Roth
I thought that might be the solution. I was looking around at how to write RewriteRules in .htaccess, everything I can find seems to be a more complicated problem then what mine is, and thus a more complicated solution. Do you have any example code or somewhere I can see example code in regards to

Re: Selective field model validation

2008-08-18 Thread David Yell
This was solved in #cakephp By using $this->Model->validates($this->data['Model']['field'] So big thanks to penfold_99 for sorting this for me, thanks! On Aug 18, 3:26 pm, David Yell <[EMAIL PROTECTED]> wrote: > Hi, > > I've been doing some work with my users model and I got to a stage > where I

Re: CakePHP + Flash

2008-08-18 Thread Pettor
Ohh thanks for the tips! I will test them tomorrow. The way of fetching variables through the tag looks nice! Thanks! I reply if i get into trouble :). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" grou

Re: keeping model cache might improve performace

2008-08-18 Thread Gwoo
@stefanski You did not define all the required settings so the config was not created. Specifically, you must specify an "engine" --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group,

Re: Find with custom GROUP BY and ORDER BY

2008-08-18 Thread Pixelastic
You're right, that was clearly the way I should have handle that. Works like a charm. Thanks a lot On 18 août, 15:53, Kalt <[EMAIL PROTECTED]> wrote: > I think you are doing it the wrong way : you don't want to order your > buildings by flat price, you want to order them by the minimum flat > pr

Re: Specific Directories

2008-08-18 Thread Kalt
Simply add a rule to your www/.htaccess, so everything starting with portfolio/ is NOT redirected to index.php On 18 août, 19:44, "Arak Tai'Roth" <[EMAIL PROTECTED]> wrote: > So, I have this problem and wasn't even sure what to search for to > find a solution, so I thought I would ask here. > > I

Re: License issues

2008-08-18 Thread Werner Petry Moraes
Hey, http://www.opensource.org/licenses/mit-license.php ... Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to u

Specific Directories

2008-08-18 Thread Arak Tai'Roth
So, I have this problem and wasn't even sure what to search for to find a solution, so I thought I would ask here. In my main directory, I have the normal cake folders app, cake, docs, and vendors. However, I also have a directory called portfolio. What I want is when a user types in http://www.

Re: License issues

2008-08-18 Thread Chris Hartjes
On Mon, Aug 18, 2008 at 1:30 PM, bigboss0101 <[EMAIL PROTECTED]> wrote: > > Hi friends, > Cakephp is released under MIT lincense. Can we use cakephp to develop > commercial applications or only those applications that should be > released under an MIT license or an opensource? > Thanks a lot for u

License issues

2008-08-18 Thread bigboss0101
Hi friends, Cakephp is released under MIT lincense. Can we use cakephp to develop commercial applications or only those applications that should be released under an MIT license or an opensource? Thanks a lot for ur guidance. --~--~-~--~~~---~--~~ You received this

Re: isUnique model validation 'on create' not working?

2008-08-18 Thread haj
I know I'm not answering to the question but a field that needs to be unique generally hold the same requirement on an edit? For the real answer, it's working here. Sorry for not helping.. --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: Selective field model validation

2008-08-18 Thread teknoid
I would suggest to carefully read the manual, where it talks about data validation ;) On Aug 18, 10:26 am, David Yell <[EMAIL PROTECTED]> wrote: > Hi, > > I've been doing some work with my users model and I got to a stage > where I was creating a method to change a users password to avoid the > d

isUnique model validation 'on create' not working?

2008-08-18 Thread Zoltan
In my model I'm doing something like: var $validate = array( 'slug' => array('rule' => 'isUnique', 'on' => 'create', 'message' => 'This title slug has already been taken.'), 'venue_type_id' => array('numeric'),... Creating a new record works fine. Now the

Re: CakePHP + Flash

2008-08-18 Thread Gwoo
using $html->url() for images/js/css will give you the wrong path if you are not using mod_rewrite. For anything in the webroot, you should use $html->webroot(); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePH

Re: CakePHP + Flash

2008-08-18 Thread Adam Royle
1. Use cakephp to do this dirty work! 2. Use $html->url() to create your urls... it will create true absolute urls, even if your cake app is a few levels deep. eg. use this as your controller/action path to send to flash echo $html->url('/images/getImagesForFlash/'); and then in your getImages

Selective field model validation

2008-08-18 Thread David Yell
Hi, I've been doing some work with my users model and I got to a stage where I was creating a method to change a users password to avoid the default edit screen from having a populated password and such. Either way I ended up with a change_password method and view, this works great. On this page

Bake and MySQL problems

2008-08-18 Thread [EMAIL PROTECTED]
Hi everyone, I am going through David Golding's new book "Beginning CakePHP" and have found it extremely helpful up until the Bake section. I have built a scaffolded blog, so I know that my DB connections are correct. And the paths to my app are correct in Terminal. However, when I go to bake

Re: Find with custom GROUP BY and ORDER BY

2008-08-18 Thread Kalt
I think you are doing it the wrong way : you don't want to order your buildings by flat price, you want to order them by the minimum flat price. Here is my solution : // controllers/buildings_controller.php function index() { // Trick to have LEFT JOIN in the query $this->Building->unbindMode

Re: Password field automagically fills up to 40 characters or so !!

2008-08-18 Thread mark_story
Jeremy, You shouldn't wrap entire form->input() calls in __() as you will have to translate all the HTML as well, which can lead to nightmare town quickly. Better would be to just wrap the label field in __() so you only need to translate the label string. $form->input('User.password', array('s

Re: keeping model cache might improve performace

2008-08-18 Thread NOSLOW
I've been digging into caching issues lately as I've seen a terrible slow down recently. My problem was that I broke the file & dir caching on my Windows machine by incorrectly loading a vendor file from bootstrap.php. So even when debug = 0, it was still rebuilding the cake_core_dir_map & cake_co

Re: Setting the database definition based on session values

2008-08-18 Thread Bruce
OK, I have tried things out on a very simple app, and have the database switching working from a constructor in app_model. But I am back to my initial problem of needing a way to direct the logic from the controller somehow. What I am intending to do is to access a family of controllers through a

Find with custom GROUP BY and ORDER BY

2008-08-18 Thread Pixelastic
Hello, I'm trying to use on a find query the 'group' and 'order' parameters, but the two seems not to work well together (or at least not the way I would). I have a simple structure like this : Model 'Building' (id, name) Model 'Flat' (id, building_id, price) (and Flat belongsTo Building, obviou

Re: 2 column layout for $form->input() ?

2008-08-18 Thread Jonathan Snook
Options. 1. Each input is invariably encased in a DIV. Set a width to half that of the container, and then float:left. 2. Put half the inputs in one DIV and the other half in another DIV. Float the DIVs. 3. Create a table with two columns, put half the inputs in one cell and half the inputs in ano

Re: CakePHP + Flash

2008-08-18 Thread clemos
Hi Pettor It won't actually solve your particular problem (probably due to security issues in Flash ?), but... You should definitely pass the cake path variables to Flash through HTML/Javascript. For example (in your tag): (it may depend on the way you embed your Flash app, ie swfobject has a m

Re: Help with Model:find()

2008-08-18 Thread Kalt
Of course your solution is better and this is what I do too. I just wanted to show Lauren how to do with her own setup. On 18 août, 14:43, "Jon Bennett" <[EMAIL PROTECTED]> wrote: > Hi Kalt, > > > @jon : the "unpaid" status should not be in the Payments but in the > > Purchases > > ahh, yes - she

Re: Difference between read and find

2008-08-18 Thread clemos
Hi Just look at the source : http://api.cakephp.org/libs_2model_2model_8php-source.html#l00949 Model::read is only a wrapper for Model::find, which, as Dardo said, and as mentionned in the API (http://api.cakephp.org/class_model.html), populates Model::$data... ("find" doesn't do that) It's just

Re: Help with Model:find()

2008-08-18 Thread Jon Bennett
Hi Kalt, > @jon : the "unpaid" status should not be in the Payments but in the > Purchases ahh, yes - she wants all Purchases that have no payments made - I was really just trying to illustrate how containable can be used instead of the old hasOne/belongsTo hack. a far easier solution to the pr

parameter 0 in requestAction do not work

2008-08-18 Thread Klaus Schwarzkopf
Hi, i use the requestAction funktion with a parameter. The value of the parameter is 0. My cake version is 1.2.0.7296 RC2. Controller: $action='/repairs/getData/0'; $this->set('repairs', $this->requestAction($action)); I get this error: Warning (2): Missing argument 1 fo

CakePHP + Flash

2008-08-18 Thread Pettor
Hi, i have a strange problem with a Flash script and CakePHP. The Flash load images from paths that the database keeps. Because i have no clue how to make Flash work togheter with the CakePHP framework i wrote a simple read.php file that just connects to the database, grabs the paths and prints t

Re: validation doen't work

2008-08-18 Thread clemos
Hi On Mon, Aug 18, 2008 at 3:51 AM, skilled_dreamer <[EMAIL PROTECTED]> wrote: >'rule'=> array('minLenght', 3), I guess it should be minLength... + Clément --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: Help with Model:find()

2008-08-18 Thread Kalt
@jon : the "unpaid" status should not be in the Payments but in the Purchases On 18 août, 14:03, "Jon Bennett" <[EMAIL PROTECTED]> wrote: > Hi Lauren, > > providing you're using 1.2, a less hacky way would be to use the > Containable behaviour. > > $this->Purchase->Behaviors->attach('Containable'

2 column layout for $form->input() ?

2008-08-18 Thread Malcolm Krugger
Whenever I user $form->input in templates invariably it outputs one below the other How do I make a 2 column form using $form->input tags ? Malcolm --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To

Re: Help with Model:find()

2008-08-18 Thread Jon Bennett
Hi Lauren, providing you're using 1.2, a less hacky way would be to use the Containable behaviour. $this->Purchase->Behaviors->attach('Containable'); $results = $this->Purchase->find('all', array( 'conditions'=>array('Purchase.account_id' => $account_id, 'Payment.id' => null), '

ibm tutorial #2 product addition

2008-08-18 Thread fourcs
Can't get IBM tut#2 to restrict product addition to logged-in users. This is the products_controller: function add() {if (!empty($this->data)) { $this->Product->create(); if ($this->Product->save($this->data)) { $dealer = $this->Product->Dealer->read(null,

Re: requestAction(): returning html corrupted utf8

2008-08-18 Thread Steven Chan
Hi all, I upgrade to the latest release candidate but that didn't fix it so I decided to trace the code for requestAction(). Anway, that led me to View::_render() and what I did to correct my problem was to put header('Content-Type: text/html; charset='.Configure::read('App.encoding')); after th

Re: Help with Model:find()

2008-08-18 Thread Kalt
For now, you defined the following relations : - Account hasMany Purchase, Payment - Purchase hasMany Payment Right ? Now, try this : // controllers/purchases_controller.php function purchases_not_paid($account_id = null) { // We trick the bindings $this->Purchase->unbindModel(array('hasMan

Re: keeping model cache might improve performace

2008-08-18 Thread stefanski
Thanks for your answers. I played around with the duration option - Cache::config('_cake_core_', array('duration' => 1000) and Cache::config('_cake_model_', array('duration' => 1000) but it had no effect, the model cache seems to be rebuild every 10 seconds, which I found out in cake/libs/model/da

ibm tutorial #2 on product addition

2008-08-18 Thread fourcs
Can't get the IBM tut #2 to restrict product addition to a logged-in dealer. Add function is below. function add() {if (!empty($this->data)) { // $this->deconstruct(); $this->Product->create(); if ($this->Product->save($this->data)) { $dealer = $this->Product->Dealer->read(null,

Re: Acl and Auth slow page load

2008-08-18 Thread Tiggr
Hi! > var $components = array('Acl', 'Auth', 'Email'); > > The page load goes through the roof. Just the same for me, but only with Acl! And it isn't slow all the time, pages load fast when user isn't logged in, but after logging in, all is getting worse! Loadtime goes up through the roof becaus

How to handle multiple submit button in the controller

2008-08-18 Thread anus
Hi all, Iam a very new beginner to cakephp. Iam struggling with multiple submit button in one form(via POST). This is my issue: I have .ctp page with two submit button like this, create('Task', array('action' => 'home','type' => 'post')); ?> submit('tasks.gif',array('name'=>'Task'));

Re: Set the associated model id in beforeSave method?

2008-08-18 Thread Primeminister
He Brendon, I always forget that 'on' thing ;) I tried: 'Duplicate' => array( 'rule' => array('isUnique'), 'on'=> 'create', 'message' => 'This nick is already taken. Choose another or sign in' ) But still is given me this