More L10n for InputHelper Date

2008-10-28 Thread David Christopher Zentgraf
Hi, Is there an elegant way to completely l6e (localize) the InputHelper's Date widget? I know about being able to translate month names via .po files. But I want to built a date input in Japanese, and the 100% correct way would be like this: 2008年10月29日, i.e. inserting 年, 月 and 日 either be

Re: missing view

2008-09-09 Thread David Christopher Zentgraf
On 9 Sep 2008, at 16:28, David C. Zentgraf wrote: > The URL /test implies /test/index, which means Cake will look for > this: > > app/controllers/test_controller.php (needs to have function index()) > app/views/test/index.ctp (or .thtml for Cake 1.1) Forgot of course that test_controller.php i

Set::extract, parents and ticket 5225

2008-09-08 Thread David Christopher Zentgraf
Hi! I have a tree structure like this: Array ( [0] => Array ( [Location] => Array ( [id] => 1 [parent_id] => [lft] => 1 [rght] => 32 [name_en] => Tokyo

Support for ORDER BY FIELD(`id`, 1, 2, ... )

2008-09-04 Thread David Christopher Zentgraf
Hi, I was wondering if anybody has thought about adding support for "manual sorting" to Cake. In my specific case, I need to paginate a model and want to order it by the average score of ratings that are stored in another table (Place hasMany Rating; ORDER BY AVG(Rating.score)). The best so

HABTM database tables not found after update to 1.2.0.7531

2008-08-28 Thread David Christopher Zentgraf
Hi, I just updated to the latest svn version 1.2.0.7531, and suddenly Cake won't find my DB tables anymore. class Place extends AppModel { ... var $hasAndBelongsToMany = array( 'Station' => array( 'className' => 'CgStation',

Re: Documentation

2008-06-24 Thread David Christopher Zentgraf
I suppose I'm talking about this: http://book.cakephp.org/view/21/a-typical-cakephp-request Just right now I feel it's neither high-level enough nor detailled enough to really help. Adding code examples would be great. Following variables/data throughout the application would help (controller

Re: Baking controllers, Missing table for 'Item'

2008-06-10 Thread David Christopher Zentgraf
Okay, sorry, please ignore. There _was_ an 'item' relationship which shouldn't have been there. Better go get some lunch... ;o) On 11 Jun 2008, at 13:16, David Christopher Zentgraf wrote: > Hi, > > I'm trying to bake my controllers via the console. My app

Baking controllers, Missing table for 'Item'

2008-06-10 Thread David Christopher Zentgraf
Hi, I'm trying to bake my controllers via the console. My app and Cake directories are separated, the Cake folder is in /path/to/trunk/cake/ cake, my app in /path/to/trunk/shop/admin. From /path/to/trunk/cake/cake/console I do this: $ ./cake -app /path/to/trunk/shop/admin ... --

Tools for merging directories

2008-06-04 Thread David Christopher Zentgraf
Hi, With the release of RC1 (Cheers!), I'll use the opportunity to ask the list what you use to update your Cake builds. What's the best tool for you to merge directory structures? Something like Diff for whole trees. I tried several tools on the Mac, but none have really worked all that we

Re: Is migrations support planned for Cake?

2008-05-19 Thread David Christopher Zentgraf
On 20 May 2008, at 08:21, Dardo Sordi Bogado wrote: > I've didn't noticed it, isn't anyone else using the Cake schema shell? > If that is the case, they are missing a great tool. Speaking for me personally, I'm not using schema because there's very little documentation to be found. This thread

Re: setting path in app/webroot/index.php

2008-05-19 Thread David Christopher Zentgraf
Don't fumble around with index.php UNLESS you deliberately moved the / cake and /app directories from their original locations. What you probably want to do is edit the 3 .htaccess files in / , /app and /app/webroot to look something like this: RewriteEngine on RewriteBase /~user/

Re: undefined variable problem $form

2008-05-19 Thread David Christopher Zentgraf
Hi, 1) $validate goes into the Model, not the controller! http://book.cakephp.org/view/66/models 2) $form is the Helper, and you'll need to specify in the Controller which helpers you want to be able to use in the View. http://book.cakephp.org/view/98/helpers Chrs, Dav On 19 May 2008, at 21:

Re: Custom SQL queries, binding and organizing results

2008-05-19 Thread David Christopher Zentgraf
.) > [User] => Array (...) > ) > > [1] => Array ... > ) > > Has been modified from a normal mysql query result... in what way is > this a "flat" array? > What output are you trying to achieve? > > > > > On May 19, 11:39

Re: Custom SQL queries, binding and organizing results

2008-05-19 Thread David Christopher Zentgraf
I see, thanks! I played around with finderQueries a bit more and got them to work to some extend, but not perfectly. Depending on which model I'm querying from, Cake throws away part of the results I'd like to keep, as it doesn't seem to think the result is related enough to the querying mo

Re: HABTM search entries help

2008-05-19 Thread David Christopher Zentgraf
`User`.`email`, `User`.`password`, `User`.`group`, > `User`.`first_name`, `User`.`last_name` FROM `conversations_users` AS > `ConversationsUser` LEFT JOIN `conversations` AS `Conversation` ON > (`ConversationsUser`.`conversation_id` = `Conversation`.`id`) LEFT > JOIN `users` AS `User` O

Re: HABTM search entries help

2008-05-18 Thread David Christopher Zentgraf
Can you post the SQL queries generated by Cake? Sounds really weird. On 18 May 2008, at 16:04, oana wrote: > > Hi Keith, > > Your summary is very accurate, that is exactly what's happening. > > This is how i select the conversations for an user, in the user > controller: > > $this->set('conversa

Custom SQL queries, binding and organizing results

2008-05-16 Thread David Christopher Zentgraf
Hi, I've read many posts on this topic, but I haven't figured out how to do it right yet. I have four models linked together (Transaction hasMany Intermediators belongsTo Account belongsTo User), and I want to run a query on a "removed cousin", like $this->Account->Intermediator->Transacti

Re: Defining more than one hasMany relationship

2008-05-16 Thread David Christopher Zentgraf
foreach() does neither modify nor unset the original array unless explicitly told to. Maybe you're having issues with the array pointer? http://jp2.php.net/foreach > foreach has some side effects on the array pointer. Don't rely on > the array pointer during or after the foreach without reset

Re: Auth/Acl, limited accounts and endless redirects

2008-05-14 Thread David Christopher Zentgraf
Done: http://bin.cakephp.org/view/579746692 Please have a look. On 14 May 2008, at 19:41, Marcin Domanski wrote: > > post your app_controller and routes.php to the bin > > On Wed, May 14, 2008 at 10:03 AM, David Christopher Zentgraf > <[EMAIL PROTECTED]> wrote: >> &

Auth/Acl, limited accounts and endless redirects

2008-05-14 Thread David Christopher Zentgraf
Hi, I ran into this situation: I'm using the Auth and Acl components to lock down my system. Really limited accounts basically have no right besides viewing and editing their own profile page. I disabled autoforwarding in the Auth component and set up some customized redirects: a) if the use

Re: Current Id - wie bekomme ich diese heraus

2008-05-13 Thread David Christopher Zentgraf
Ich weiß net genau wie's mit 1.1 steht, aber in Cake 1.2 sollte $this- >Model->id eigentlich immer die aktuelle ID enthalten. Notfalls mal unter $this->Model->data['Model']['id'] nachschauen? Seriously, write English, will ya? Gruß. On 13 May 2008, at 20:45, grobald wrote: > > sIst sicher

Re: file_get_contents() to get response from Cake app?

2008-05-13 Thread David Christopher Zentgraf
/controller/action > You should see http status 200. If you see anything else 302 (probably > login redirect), 401 (authentication needed). Anyway, you should see > something other than an OK 200 response. > > > > On May 13, 6:31 am, David Christopher Zentgraf <[EMAIL PROTECTED

Re: Validation on Update in Cake using VALID_UNIQUE

2008-05-12 Thread David Christopher Zentgraf
Actually, you may run into problems with this: var $validate = array( array( 'rule' => array('validateUnique', 'email') ), ); function validateUnique($fieldValue, $fieldName) { if (!$this->isUnique($fieldName)) { return false; } els

Re: file_get_contents() to get response from Cake app?

2008-05-12 Thread David Christopher Zentgraf
Okay, that's weird. Setting Debug to 1 in core.php suddenly gives me an output. Even though in my remote action I explicitly call: $this->layout = 'ajax'; Configure::write('debug', 0); Interestingly, if I set debug to 0 in core.php and try to turn it back on in my action, it doesn't work eithe

file_get_contents() to get response from Cake app?

2008-05-12 Thread David Christopher Zentgraf
Hi, I have a rather peculiar problem: I have a CakePHP app that external apps need to query some data from. Any app can basically send a request to a special controller action with a few encoded parameters in the URL, and the action will return a blank page with only the words true or false

Re: hasAndBelongsToMany and belongsTo on same model

2008-05-11 Thread David Christopher Zentgraf
Hi, I have a similar setup, where a user has many Accounts, but also has a default account. My model looks like this: class User extends AppModel { var $name = 'User'; var $belongsTo = array( 'DefaultAccount' => array( '

Re: Bug: Saving HABTM relationship, "Column in where clause is ambiguous"

2008-05-07 Thread David Christopher Zentgraf
Since I'm manually specifying the table name I can call it whatever I want actually. No, the problem turned out to be in one of my validation functions, the checkUnique() function I just took straight from the manual. For some reason it only came up as a problem in the context of HABTM saves

Re: Bug: Saving HABTM relationship, "Column in where clause is ambiguous"

2008-05-06 Thread David Christopher Zentgraf
;joinTable'=> 'user_friends', > 'foreignKey'=> 'User.user_id', > 'associationForeignKey' => 'Friend.friend_id', > 'unique'=> true > ) >

Re: Bug: Saving HABTM relationship, "Column in where clause is ambiguous"

2008-05-06 Thread David Christopher Zentgraf
nForeignKey' => 'friend_id', 'unique'=> true ) ); } On 7 May 2008, at 15:22, Grant Cox wrote: > > Can you post your $hasAndBelongsToMany variable definition? I think > you'll be ab

Bug: Saving HABTM relationship, "Column in where clause is ambiguous"

2008-05-06 Thread David Christopher Zentgraf
Hi, I'm stumbling across bug number 4194. https://trac.cakephp.org/ticket/4194 I have a User model, which has a `name` field. This User hasMany Accounts, which also have a `name` field. The User also hasAndBelongsToMany other Users as a friend relationship. User (`name`, ...) | |- hasMany | |-

Integrating CakePHP app into another app

2008-04-22 Thread David Christopher Zentgraf
Hi, I wrote a user/login/permission management app in Cake 1.2. I'm now looking for ways to integrate that into other (non-Cake) apps, so their permissions and users can be centrally managed. My idea is to have a small .php file which could be included() from apps, providing them with an obje

Re: I18n, is this correct way? Configure::write('Config.language', "en");

2008-04-22 Thread David Christopher Zentgraf
I just had that same issue the other day, see thread: http://groups.google.com/group/cake-php/browse_thread/thread/3ada672bf5a86b6b/cf386c0d99eca0bf Basically, all you do is this in your core.php config file: Configure::write('Config.language', "eng"); This establishes the default language for y

Re: Cause for l10n/i18n not working?

2008-04-22 Thread David Christopher Zentgraf
On 22 Apr 2008, at 16:28, [EMAIL PROTECTED] wrote: > A few things that may cause a change in beforeFilter not to work is > that you have to set it to eng, fra or swe... not en_us, se_sv or > something similar (just checking). You should try this with all > caching off for a start (see above). Als

Re: Cause for l10n/i18n not working?

2008-04-21 Thread David Christopher Zentgraf
$i18n = I18n::getInstance(); > $i18n->l10n->get($lang); > > hope this helps. > /Martin > > On Apr 21, 12:28 pm, francky06l <[EMAIL PROTECTED]> wrote: >> I use the l10n/i18n to set language, my method is close to yours >> except that I set the language using : &

Re: Cause for l10n/i18n not working?

2008-04-21 Thread David Christopher Zentgraf
:28 pm, francky06l <[EMAIL PROTECTED]> wrote: >> I use the l10n/i18n to set language, my method is close to yours >> except that I set the language using : >> $l10n = & new L10n(); >> $l10n->__setLanguage($lang) >> >> hth >> >> On Apr 21, 8:51 am,

Cause for l10n/i18n not working?

2008-04-20 Thread David Christopher Zentgraf
This seems to be the cause of a lot of complaints about l10n/i18n not working. I set up two languages in my app: 'eng' and 'jpn'. In core.php I added: define('DEFAULT_LANGUAGE', 'eng'); Configure::write('Config.language', 'en'); In my app_controller beforeFilter: $lang = $this->Auth->user('pr

Re: ACL: ACOs inherit permission settings backwards?

2008-04-10 Thread David Christopher Zentgraf
d something in my solution. > > Check it out, and see if it works for you as well. > > Since the solution relies on lft and rght values, it will work no > matter what order the ACO and ARO nodes were created in. > > -Aran > > On Apr 9, 9:10 pm, David Christopher Zentgraf &l

Re: ACL: ACOs inherit permission settings backwards?

2008-04-09 Thread David Christopher Zentgraf
gt;> >>> The issue only seems to apply to situations in which the overlapping >>> permissions are from the same ARO node. I'm not sure this is >>> going to >>> be considered buggy behavior by the developers. >> >>> Instead, it seems lik

Re: ACL: ACOs inherit permission settings backwards?

2008-04-09 Thread David Christopher Zentgraf
the check loop would need to be revised IMHO. On 10 Apr 2008, at 04:06, Chris Hartjes wrote: > > On Wed, Apr 9, 2008 at 2:34 AM, David Christopher Zentgraf > <[EMAIL PROTECTED]> wrote: >> >> Ignore my previous fix, only works under certain conditions. >

Re: ACL: ACOs inherit permission settings backwards?

2008-04-08 Thread David Christopher Zentgraf
>Aro->Permission->alias); The checking algorithm still needs some revisitation. On 9 Apr 2008, at 13:15, David Christopher Zentgraf wrote: > Posted a possible fix in https://trac.cakephp.org/ticket/4450 . > > Replace the loop on line 313 of cake/libs/controller/components/ >

Re: ACL: ACOs inherit permission settings backwards?

2008-04-08 Thread David Christopher Zentgraf
appreciated. On 9 Apr 2008, at 11:56, David Christopher Zentgraf wrote: > Tried with the latest Nightly (08.04.08), dumped all my tables, > set everything up again, still the same. > Opened a ticket for it: https://trac.cakephp.org/ticket/4450 > > On 8 Apr 2008, at 22:23, Dardo Sor

Re: ACL: ACOs inherit permission settings backwards?

2008-04-08 Thread David Christopher Zentgraf
e/libs/controller/components/acl.php > > method check, > > look for === -1, change to == -1. If it isn't there, probably you > need to put a couple of pr() and start debugging :(. > > Before that, try with an fresh install of the latest svn. > > On Tue, Apr 8, 2008

Re: ACL: ACOs inherit permission settings backwards?

2008-04-08 Thread David Christopher Zentgraf
bug described. > > Look in cake/libs/controller/components/acl.php > > method check, > > look for === -1, change to == -1. If it isn't there, probably you > need to put a couple of pr() and start debugging :(. > > Before that, try with an fresh install of the latest

Re: ACL: ACOs inherit permission settings backwards?

2008-04-08 Thread David Christopher Zentgraf
[8]delete But: $cake acl check deceze Users/index all deceze is allowed. On 8 Apr 2008, at 20:49, Dardo Sordi Bogado wrote: > > Can you post the SQL generated? > > On Tue, Apr 8, 2008 at 8:47 AM, David Christopher Zentgraf > <[EMAIL PROTECTED]> wrote: >>

Re: ACL: ACOs inherit permission settings backwards?

2008-04-08 Thread David Christopher Zentgraf
, > > https://trac.cakephp.org/ticket/3851 > https://trac.cakephp.org/changeset/6342 > > It's fixed in current versions. > > On Tue, Apr 8, 2008 at 6:01 AM, David Christopher Zentgraf > <[EMAIL PROTECTED]> wrote: >> >> Hi, >> >> Am I getting

ACL: ACOs inherit permission settings backwards?

2008-04-08 Thread David Christopher Zentgraf
Hi, Am I getting this right? With the ACL component, AROs inherit their permissions like this: Group [denied something] |- User [allowed something] In this case, the explicitly granted permission on the User overrides the general Group setting, allowing the User something specifically. With