Re: Pagination with containable: Contain has to effect

2008-11-25 Thread Sebastian Veggiani

Anja, I'm sorry for the mistake.

I remember that in first 1.2 versions Containable was a behaviour you
had to include manually.

Greetings

PS: sorry for my poor english :)



On Nov 25, 9:23 am, Sebastian Veggiani <[EMAIL PROTECTED]> wrote:
> May be he's using an older version of 1.2. ¿or not?
>
> On Nov 24, 9:31 am, Mariano Iglesias <[EMAIL PROTECTED]>
> wrote:
>
> > [2] What do you mean you had the file in the wrong place? Containable is
> > part of the core.
>
> > Liebermann, Anja Carolin wrote:
> > > [2] I have contaninable for all my models But I had the file placed 
> > > in the wrong folder. Ouch
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Pagination with containable: Contain has to effect

2008-11-25 Thread Sebastian Veggiani

May be he's using an older version of 1.2. ¿or not?


On Nov 24, 9:31 am, Mariano Iglesias <[EMAIL PROTECTED]>
wrote:
> [2] What do you mean you had the file in the wrong place? Containable is
> part of the core.
>
> Liebermann, Anja Carolin wrote:
> > [2] I have contaninable for all my models But I had the file placed in 
> > the wrong folder. Ouch
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Pagination with containable: Contain has to effect

2008-11-25 Thread Sebastian Veggiani

May be he's using an older version of 1.2. ¿or not?


On Nov 24, 9:31 am, Mariano Iglesias <[EMAIL PROTECTED]>
wrote:
> [2] What do you mean you had the file in the wrong place? Containable is
> part of the core.
>
> Liebermann, Anja Carolin wrote:
> > [2] I have contaninable for all my models But I had the file placed in 
> > the wrong folder. Ouch
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Pagination with containable: Contain has to effect

2008-11-25 Thread Sebastian Veggiani

May be he's using an older version of 1.2. ¿or not?


On Nov 24, 9:31 am, Mariano Iglesias <[EMAIL PROTECTED]>
wrote:
> [2] What do you mean you had the file in the wrong place? Containable is
> part of the core.
>
> Liebermann, Anja Carolin wrote:
> > [2] I have contaninable for all my models But I had the file placed in 
> > the wrong folder. Ouch
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



MySQL Views support in Cake 1.2

2008-04-24 Thread Sebastian Veggiani

Hi,

somebody could clarify what is the level of support of Cake 1.2 for
woriking with MySQL Views?

For example, I've a chain o associations of three or more levels.

If I want to filter the results by a field in the 3rd level or beyond
there is no easy way to do it, unless I use a Custom SQL Query, but in
this case I can't use the Model paginator in the view.

The solution I found was to create a View in MySQL with the necessary
data from joined tables and then filter by one of these fields. This
works OK for me.

The problem comes with pagination  and sorting. When I try to sort by
a view field which is not in the main table (specified by FROM) the
application fails. Ordering by any field in the main table works OK.


anybody knows something about MySQL Views in cake?

Thanks,

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



Re: Session ID

2008-04-22 Thread Sebastian Veggiani

The methodology to work with sessions is:

// for reading
$myVar = $this->Session->read('varName');

// for writing
$this->Session->write('varName', $varValue)

// for debugging the session array
$mySessionVars = $this->Session->read();
debug( $mySessionVars );

I hope this helps.


On 22 abr, 14:15, "b logica" <[EMAIL PROTECTED]> wrote:
> You're going to wince when you see this ...
>
> $session->id()http://api.cakephp.org/1.2/class_session_component.html#e1692bdb30d58...
>
> Yeah, it's odd that debug($session) shows an empty 'id' field and that
> you need to use the method. I'm sure it's much safer that way but then
> why the array field?
>
> Because, if i do
>
> $session->id('foobar') // the method also accepts a param to set the var
> debug($session);
>
> the id field is still empty.
>
> On Tue, Apr 22, 2008 at 1:04 PM, MonkeyGirl <[EMAIL PROTECTED]> wrote:
>
> >  Hi again!
>
> >  I'm using the session component, as documented at
> >  http://manual.cakephp.org/view/173/sessions, and it's storing and
> >  retrieving all the session variables I set just fine.
>
> >  However, I'm trying to find the session ID - or anything else that's
> >  unique to each visitor, but doesn't change each time they load a new
> >  page - and I'm getting a bit stuck here.
>
> >  I've tried echoing out PHP's session ID, as documented 
> > atwww.php.net/session_id
> >  , but it seems to change each time a page is loaded. I'm assuming
> >  CakePHP is doing magical things with sessions that I just shouldn't
> >  interfere with lest I break something, but please correct me if I'm
> >  wrong about that.
>
> >  So I looked at what $this->Session is storing, figuring that maybe
> >  it's storing some kind of consistent ID somewhere. The closest I could
> >  find was $this->Session->_userAgent , but that appears to just be a
> >  hash of the browser name, nothing else, as someone else using the same
> >  browser even on a different network will get the same value.
>
> >  So is there anything that acts like a regular, consistent session ID?
>
> >  If not, I can just set a hash of the user's browser, IP address, and
> >  the current timestamp at the exact moment they visit the site and set
> >  that as a regular session variable (ie each time the user loads a
> >  page, check for this session variable, and if it's not set, generate
> >  and set it), but that seems a bit long winded and a case of
> >  reinventing the wheel when this is exactly what session IDs are for.
>
> >  Thanks for any suggestions,
> >  Zoe.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



OT?: How to use Poedit with the "__d()" translation function?

2008-04-17 Thread Sebastian Veggiani

I'm having problems to use Poedit with the "__d()" function.

I've to split the translations in two files. One for the
Administration of my project and another for the public pages.
The public file will be sent to the client for translation in 2
additional languages.

The problem is:
As default Poedit scans files and retrieves the first parameter of the
function as translation ID.
When using the __d function, the first parameter is the
"domain" (or .po file), so it's not possible to use the program to
bring and translate de strings.

Anyone knows how to configure Poedit (specifically xgettext) to
retrieve de second parameter of the function?

I've tried in many ways without success,

Thanks for your attention
--~--~-~--~~~---~--~~
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: name the locale directory

2008-04-17 Thread Sebastian Veggiani

Johnson,
If you look here:
http://api.cakephp.org/1.2/l10n_8php-source.html#l00180

You'll find that the code you are trying to use is set with "-"
instead of "_".
I think the codes must be used as defined in this array.

Here you have some additional info:
http://bakery.cakephp.org/articles/view/p28n-the-top-to-bottom-persistent-internationalization-tutorial



On 17 abr, 09:09, Johnson <[EMAIL PROTECTED]> wrote:
> i want to support eng and zh_tw in my website.the locale's directories
> are
>
> app\locale\eng\LC_MESSAGES\default.po
> app\locale\zh_tw\LC_MESSAGES\default.po
>
> then, i use $this->Session->write('Config.language', $language); to
> control current language.
> if i want to display english , i set $language='eng' is work.
> but when i set $language='zh_tw', it's not work!
>
> so, i tried $language='zh-tw', then it's work!
>
> can anyone please tell me why? this is confused 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
-~--~~~~--~~--~--~---



Re: Help: is it feasible to use multiple .po files?

2008-04-16 Thread Sebastian Veggiani

Someone has been able to configure Poedit to work with the "__d("
function?
When Poedit search for entries to translate it returns the first
parameter which is the 'domain' or name of the .po file.

I've tried many ways of configure de gettext parameters without any
luck.

Thanks,



On 3 abr, 13:03, "b logica" <[EMAIL PROTECTED]> wrote:
> I'm happy to help!
>
> On Wed, Apr 2, 2008 at 11:38 PM, neeocis <[EMAIL PROTECTED]> wrote:
>
> >  Dear b logica,
> >  I don't know how can i give you my greetings to you.
> >  Thank you very much
> >  You saved my life.. :)
>
> >  On Apr 2, 11:00 pm, "b logica" <[EMAIL PROTECTED]> wrote:
> >  > Yes, but you shoulduse__d() instead of __() to translate. Look at
> >  > the method in cake/basics.php. In a nutshell, you woulduseit like:
>
> >  > __d('common', 'some string to translate')
> >  > __d('common', 'some string to translate', true)
> >  > __d('msgid_will_use_in_ctp_file1', 'some string to translate', true)
>
> > > On Wed, Apr 2, 2008 at 6:33 AM, neeocis <[EMAIL PROTECTED]> wrote:
>
> >  > >  Dear all,
> >  > >  I am trying to figure out that is it possible and orfeasibletouse
> >  > >  multiple.pofilesfor each language like...
>
> > > >  /app/locale/eng/LC_MESSAGES/common.po
> >  > >  /app/locale/eng/LC_MESSAGES/msgid_will_use_in_ctp_file1.po
> >  > >  /app/locale/eng/LC_MESSAGES/msgid_will_use_in_ctp_file2.po
> >  > >  -
> >  > >  /app/locale/fin/LC_MESSAGES/common.po
> >  > >  /app/locale/fin/LC_MESSAGES/msgid_will_use_in_ctp_file1.po
> >  > >  /app/locale/fin/LC_MESSAGES/msgid_will_use_in_ctp_file2.po
>
> >  > >  Because, the system we are developing will must support more than 3
> >  > >  languages and the static contents are huge. So if i canusemultiple
> >  > >  filesrather than /app/locale/eng/LC_MESSAGES/default.po
>
> > > >  than it will be more easier for me to maintain, update and develop.
>
> >  > >  Pleasehelpme on this regards..  any resource/links will be
>
> > > >  appritiate.
>
> >  > >  Thanks in advance,
> >  > >  Neeocis
--~--~-~--~~~---~--~~
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: Weird problem with validation, bug?

2008-04-08 Thread Sebastian Veggiani

Does anyone have any idea?

On 7 abr, 20:25, elHobbit <[EMAIL PROTECTED]> wrote:
> Thanks b logica.
>
> But, I really need to use the validation rules in the User model.
> I'll try to overwrite the validation rules for the fields I'm not
> using in this view.
> Anyway, I think the problem isn't that, because with different fields
> the form works ok.
>
> Again, thanks for your help.  :)
>
> On Apr 7, 7:31 pm, "b logica" <[EMAIL PROTECTED]> wrote:
>
> > If the problem is that Cake is trying to validate User when
> > unnecessary you could try what Dardo just suggested for a similar
> > problem I was having. Put this in your edit() action:
>
> > $this->User->validate = array();
>
> > On Mon, Apr 7, 2008 at 4:42 PM, elHobbit <[EMAIL PROTECTED]> wrote:
>
> > >  First, excuse me for my poor english.
>
> > >  I'm using Cake 1.2.6311. I'm having a weird problem validating some
> > >  fields from my model.
>
> > >  The situation is like that:
>
> > >  - One model "users" with validation rules.
> > >  - "Users" controller with 2 basic actions: 'edit' & 'changepassword'.
> > >  - The problem: in the action "changepassword" where I'm only showing
> > >  the field "password" (and hidden ID field) when the form is submited
> > >  I'm obtaining a connection reset.
>
> > >  The weird thing is:
>
> > >  - If I add this two lines, in which I set the value for the "email"
> > >  into the ['data'] array the forms submits OK and the validation is
> > >  triggered.
> > >  --
> > >  $pp = $this->User->read( null, $id );
> > >  $this->data['User']['email'] = $pp['User']['email'];
> > >  --
>
> > >  - If the only showed field is "email" the form is submited OK and the
> > >  validation triggered as expected without manually loading the
> > >  "password" field to the "data" array. So I guess this is not a problem
> > >  related with some requirement of having all "validated" fields in the
> > >  form.
>
> > >  My question is:
> > >  Why if I only show the "email" field everything works fine. But with
> > >  the field "password" I've to use the workaround from above?
> > >  I'm very new with Cake so is VERY POSSIBLE I'm doing something vry
> > >  wrong.
>
> > >  Someone can help me with this issue? Thanks for your attention.
>
> > >  PS: here is the code of my files:
>
> > >  User Model:
> > >  
> > > -
> > >   > >  class User extends AppModel{
>
> > > var $name = 'User';
> > > var $belongsTo = array( 'Company', 'Group' );
>
> > > var $validate = array(
>
> > > 'email' => array(
> > > 'required' => array(
> > > 'rule' => 'email',
> > > 'required' => true,
> > > 'message' => 'Ingrese una dirección de 
> > > e-mail válida'
> > > )
> > > ),
>
> > > 'password' => array(
> > > 'required' => array(
> > > 'rule' => VALID_NOT_EMPTY,
> > > 'message' => 'Debe indicar su contraseña'
> > > )
> > > ),
>
> > > 'company_id' => array(
> > > 'required' => array(
> > > 'rule' => VALID_NOT_EMPTY,
> > > 'message' => 'Seleccione una empresa'
> > > )
> > > ),
>
> > > 'group_id' => array(
> > > 'required' => array(
> > > 'rule' => VALID_NOT_EMPTY,
> > > 'message' => 'Seleccione el grupo al que 
> > > pertenece el usuario'
> > > )
> > > ),
>
> > > // campo adicional para confirmar la contraseña, no 
> > > existe en la
> > >  BBDD
> > > 'password_conf' => array(
> > > 'required' => array(
> > > 'rule' => VALID_NOT_EMPTY,
> > > 'message' => 'Debe confirmar su 
> > > contraseña'
> > > )
> > > )
>
> > > );
>
> > >  }
> > >  ?>
>
> > >  Users controller
> > >  
> > > -
> > >  
> > >  class UsersController extends AppController{
>
> > > var $name = 'Users';
> > > var $paginate = array( 'limit' => 15, 'page' => 1 );
>
> > > function control_view() {
> > > ..
> > > }
>
> > > function control_edit( $id = null ) {
> > > // protección por tipo de admin
>
> > > // inicialización
> > > $this