aros/acos that are inherited

2011-10-20 Thread Javelot Guillaume
Hi,

I'm using the AclComponent with cakePHP 1.3. Here is the situation :

I have users that belongs to groups and groupwide authorization have
been set. I can also define user-specific rights. My concern is that
i'm not able to know if an aro/aco authorization is granted/denied to
a user because he inherited it from the group he belongs to or because
I specified that particular right for that user. Is there any way to
know if an aro/aco is allowed/denied/inherited or should I write that
function myself ?

Thanks for reading

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakePHP + Oracle : query other schema

2011-03-08 Thread Guillaume Luszack
Actually it seems to be working with a view. No need for a synonym. As long as the user you're 
connected with

has granted rights on the tables you're guerying of course:)

Sorry for not trying with a view earlier !
G.


Selon Zaky Katalan-Ezra:

Did you try to create a view for the synoname?

On Mon, Mar 7, 2011 at 9:53 PM, guix69 > wrote:


Database is the same, only the schema is different.

My database.php contains the settings to connect to SCHEMA1 but I
would like to make a model to query data from SCHEMA2

I tried using a synonym (inside SCHEMA1, pointing to the desired table
inside SCHEMA2) but it looks like the synonym is invisible to cake.

--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org
 and help others with their CakePHP related
questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com
 For more options,
visit this group at http://groups.google.com/group/cake-php






--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.



To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Translate SQL query into $conditions

2009-06-23 Thread Guillaume Koenig

Hello,

I am new to CakePHP. Everything has been running smoothly so far, with
simple SQL requests and data retrieval with the $conditions variable.
However I am stuck now with this query that I would like to be put
into the $conditions variable. I don't want to redefine a paginate
function which for sure won't be as cool as the core one...

SELECT *
FROM (
SELECT clients.*, SUM(sub.price) AS price
FROM clients LEFT OUTER JOIN (
SELECT appointments.client_id, services.price
FROM services, appointments
WHERE appointments.service_id = services.id
AND DATE(appointments.datetime) >= '2009-06-23'
AND DATE(appointments.datetime) <= '2009-06-23') AS sub
ON (sub.client_id = clients.id)
GROUP BY clients.id) AS dummy
WHERE price >= 100
AND price <= 200

Tell me this is possible :( Any help greatly appreciated.

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



Re: Association recursive hasMany

2008-08-27 Thread Guillaume

$this->Model1->contain(array('Model2"=>"Model3"); should work.

$this->Model1->contain( 'Model2.Model3'); too

http://bakery.cakephp.org/articles/view/bindable-behavior-control-your-model-bindings

Guillaume
--
http://cherryonthe.popnews.com


On 27 août, 14:49, vj <[EMAIL PROTECTED]> wrote:
> I have 3 Models having following association:
>
> Model1 hasMany Model2
> Model2 belongsTo Model1
> Model2 hasMany Model3
> Model3 belongsTo Model2
>
> I had primary key value of Model1 and want to retrieve All Information
> from Model3.
>
> But
> $this->Model1->contain( 'Model2',
>                                     'Model2.Model3'
>                                  )
>
> won't give me Data from Model3,Instead it shows blank array.
>
> Can any one resolve this.
--~--~-~--~~~---~--~~
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: Trouble with multipple database configs in RC1

2008-06-09 Thread Guillaume

I submitted a ticket.

https://trac.cakephp.org/ticket/4873

Sorry for it not being very clear, it was my first one. I try to build
a test case but I don't know yet how to use multiple database configs
in a test case.

Any help would be appreciated (even telling me I'm a complete fool
would be)

Guillaume

On 9 juin, 08:19, Guillaume <[EMAIL PROTECTED]> wrote:
> Hello,
> I don't have time to test if deeper now (going to work!) but I
> encountered strange problems with a Shell script using Models
> belonging to different databases.
> My Shell script aims at migrating data from an old database named
> "popnews_old" to a new one named "popnews" so it uses models belonging
> to different databases.
>
> $this->Model->find('all') with a Model pointing toward the old
> database issues a query to the wrong database.
>
> It used to work perfectly before.
>
> Here are some excerpts of my code :
>
> //{app}/config/database.php
> var $default = array('driver' => 'mysql',
>                                                                 'connect' => 
> 'mysql_connect',
>                                                                 'host' => 
> '127.0.0.1',
>                                                                 'login' => 
> 'xx',
>                                                                 'password' => 
> 'x',
>                                                                 'database' => 
> 'popnews',
>                                                                 'prefix' => 
> '',
>                                                                 'port' => 
> 8889);
>
> var $oldLocalDatabase = array('driver' => 'mysql',
>                                                         'connect' => 
> 'mysql_connect',
>                                                         'host' => '127.0.0.1',
>                                                         'port' => 8889,
>                                                         'login' => '',
>                                                         'password' => 'x',
>                                                         'database' => 
> 'popnews_old',
>                                                         'prefix' => '');
>
> //{app}/models/old_redacteur.php
>
> class OldRedacteur extends AppModel {
>
>         var $name = 'OldRedacteur';
>
>         var $useDbConfig = 'oldLocalDatabase';
>
>         var $useTable = 'REDACTEURS';
>
>         var $primaryKey = 'REDID';
>
> }
>
> //{app}/vendors/shells/recup_users.php
> class RecupUsersShell extends Shell {
>         var $uses = array ('OldRedacteur', 'User');
>         var $tasks = array('DbConfig');
>
>         function main($rundry = false) {
>                 // this line outputs the right db config !
>                 $this->out('db config '.$this->OldRedacteur->useDbConfig);
>
>                 // this line doesn't work anymore
>                 $redacteurs = $this->OldRedacteur->find('all');
> ...
>
> The last line generates this error :
> the query (with the good fields from the table the model relates to) +
> SQL Error: 1146: Table 'popnews.REDACTEURS' doesn't exist span>
> which indicates that the query is executed on the wrong database
> ("popnews" and not "popnews_old").
>
> I don't have the time to fill in a ticket for the moment, but does
> someone have this strange problem?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Trouble with multipple database configs in RC1

2008-06-08 Thread Guillaume

Hello,
I don't have time to test if deeper now (going to work!) but I
encountered strange problems with a Shell script using Models
belonging to different databases.
My Shell script aims at migrating data from an old database named
"popnews_old" to a new one named "popnews" so it uses models belonging
to different databases.

$this->Model->find('all') with a Model pointing toward the old
database issues a query to the wrong database.

It used to work perfectly before.

Here are some excerpts of my code :

//{app}/config/database.php
var $default = array('driver' => 'mysql',
'connect' => 
'mysql_connect',
'host' => 
'127.0.0.1',
'login' => 
'xx',
'password' => 
'x',
'database' => 
'popnews',
'prefix' => '',
'port' => 8889);

var $oldLocalDatabase = array('driver' => 'mysql',
'connect' => 
'mysql_connect',
'host' => '127.0.0.1',
'port' => 8889,
'login' => '',
'password' => 'x',
'database' => 
'popnews_old',
'prefix' => '');

//{app}/models/old_redacteur.php

class OldRedacteur extends AppModel {

var $name = 'OldRedacteur';

var $useDbConfig = 'oldLocalDatabase';

var $useTable = 'REDACTEURS';

var $primaryKey = 'REDID';

}

//{app}/vendors/shells/recup_users.php
class RecupUsersShell extends Shell {
var $uses = array ('OldRedacteur', 'User');
var $tasks = array('DbConfig');

function main($rundry = false) {
// this line outputs the right db config !
$this->out('db config '.$this->OldRedacteur-
>useDbConfig);
// this line doesn't work anymore
$redacteurs = $this->OldRedacteur->find('all');
...

The last line generates this error :
the query (with the good fields from the table the model relates to) +
SQL Error: 1146: Table 'popnews.REDACTEURS' doesn't exist
which indicates that the query is executed on the wrong database
("popnews" and not "popnews_old").

I don't have the time to fill in a ticket for the moment, but does
someone have this strange problem?


--~--~-~--~~~---~--~~
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: What is the best Image Upload / Thumbnail package for CakePHP?

2008-06-06 Thread Guillaume

What do you think of Attachment aka attm?
http://cakeforge.org/projects/attm/
It deals with the upload part and the multi-size display part too...



On 6 juin, 17:38, aranworld <[EMAIL PROTECTED]> wrote:
> I agree with stefanski that it makes sense to put a lot of this into
> the model/behavior zone.  I like to think of an imagefile as a piece
> of data, that I just happen to store in the filesystem rather than the
> database.
>
> But as far as uploaders go, there are some limitations with PHP that
> will prevent us from ever having a truly mind-blowing uploader.  Just
> look at Flickr, which certainly has it's fair share of PHP experts.
> For it's uploader application, they have turned to some pretty
> sophisticated compiled (I believe) server code, which connects to an
> executable file on your PC via an API.  Their online uploader
> meanwhile remains pretty basic.
>
> I think Flickr's general strategy for image file management is fairly
> easy to replicate in CakePHP.  I like how they produce 4 versions of
> every image you upload.  I also like how they create randomized
> filenames as a way of protecting people from downloading large blocks
> of files outside of the interface.
>
> On Jun 6, 7:17 am, stefanski <[EMAIL PROTECTED]> wrote:
>
> > For a more general aproach regarding different requirements, I think
> > it makes more sense to split the tasks. For uploading i use 
> > thishttp://labs.iamkoa.net/2007/10/23/image-upload-component-cakephp/
> > which i modified to a behaviour because I see it more on the model-
> > side (happy to share code if wanted). And for Thumbnails I love 
> > thehttp://bakery.cakephp.org/articles/view/image-resize-helperbecauseit
> > offers great flexibilty with dynamic thumbnails and caching.
--~--~-~--~~~---~--~~
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: Emal component problem

2008-04-28 Thread Guillaume

I use it like this:

$this->Email->to = '[EMAIL PROTECTED]';
  $this->Email->subject = $this-
>data['Contact']['subject'];
$this->Email->replyTo = $this-
>data['Contact']['email'];
$this->Email->from =
'Website';
$this->Email->template =
'contact';
$this->Email->sendAs =
'both';
$message = array();
$message[] = $this->data['Contact']['message'];
return ($this->Email->send($message));



On 28 avr, 21:49, Mech7 <[EMAIL PROTECTED]> wrote:
> I have been trying out the email component but i can't get the body of
> the email to send? I am using cake fro svn.
> When the email arrives it works ok except the body of the email is
> empty?
>
> This is my controller:
>
>  class ContactController extends AppController {
>
>         /**
>          * Use the email component to send the email
>          *
>          * @var array
>          * @access public
>          */
>         public $components = array('Email');
>
>         /*
>          * Use the form helper for contact form
>          *
>          * @var array
>          * @access public
>          */
>         public $helpers = array('Form');
>
>         /**
>          * Index action for contact form
>          *
>          * @access public
>          */
>         public function index($send = null){
>
>                 if($send == 'send'){
>                         $this->set('status', 'succes');
>                 } elseif ($send == 'failed'){
>                         $this->set('status', 'failed');
>                 } else {
>                         $this->set('status', 'form');
>
>                         if(!empty($this->data)){
>
>                                 // Set data to model for valiation
>                                 $this->Contact->set( $this->data );
>
>                                 if ($this->Contact->validates()) {
>
>                                         $this->Email->to = '[EMAIL 
> PROTECTED]';
>                                         $this->Email->subject = 
> $this->data['Contact']['subject'];
>                                         $this->Email->replyTo = 
> $this->data['Contact']['email'];
>                                         $this->Email->from = 'Website';
>                                         $this->Email->template = 'contact';
>                                         $this->Email->sendAs = 'both';
>                                         $this->set('message', 
> $this->data['Contact']['message']);
>                                         if($this->Email->send()){
>                                                 
> $this->redirect('/contact/index/send');
>                                         } else {
>                                                 
> $this->redirect('/contact/index/failed');
>                                         }
>                                 }
>                         }
>                 }
>         }}
>
> ?>
>
> And then in elements i have:
>
> email/text/contact.ctp
>
>  echo $message;
> ?>
>
> email/html/contact.ctp
>
>  echo htmlentities($message, ENT_QUOTES);
> ?>
>
> I also have the layouts/email/html and text files...
--~--~-~--~~~---~--~~
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: Uses PHPUnit instead of SimpleTest

2008-04-24 Thread Guillaume

If I remember well, PHPunit for PHP 4 is an old version not maintened
anymore.
For the moment, CakePHP is compatible with both PHP 4 and PHP 5...
So for now I guess SimpleTest is the way to go.



On 24 avr, 15:08, "Renan Gonçalves" <[EMAIL PROTECTED]> wrote:
> Hi!
>
> I have been created a ticket (https://trac.cakephp.org/ticket/4531)
> proposing a change of CakePHP Test Suite.
> I'm sure PHPUnit is better than SimpleTest!
>
> Comments be welcome.
>
> Thanks!
> --
> Renan Gonçalves - Software Engineer
> Cell Phone: +55 11 8633 6018
> MSN: [EMAIL PROTECTED]
> São Paulo - SP/Brazil
--~--~-~--~~~---~--~~
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: Adding meta description tags on a view page

2008-03-28 Thread Guillaume

Hello Rusty,

>From the code at the end of the $html->meta helper method, I guess
that it uses the $scripts_for_layout var you have to echo between the
head tags.

You can read a bit about it on my blog.

Guillaume
CakePHP blog: http://cherryonthe.popnews.com/



On 28 mar, 02:08, Rusty <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm not sure if I am doing something wrong, but I am trying to add a
> meta tag on the view page using the following command:
>
> echo $html->meta('description', 'meta description goes in here',
> array('type'=>'description'), false);
>
> Doing this, nothing shows up on the page. If I set the inline to true,
> it shows right at the top of the page, but after all the header
> information from the layout page.
>
> I would like to have it so that setting it to false puts it up in the
> head section (as per the API).
>
> Does anyone have any ideas, or is it me doing something wrong?
>
> ThaCakePHP nks!
--~--~-~--~~~---~--~~
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: Localizate month names

2008-03-26 Thread Guillaume

Yes., it works for me with French.

Be careful though with LC_ALL, because it has a wider effect than just
localizing month names... eg. for French, setting the separator for
float to the comma instead of the dot, which brings trouble when
inserting to a MySQL database not configured the same.

As to me, I simply use :

setlocale(LC_TIME,"fr_FR.UTF-8");

Guillaume
--
Cake blog: http://cherryonthe.popnews.com

On 26 mar, 19:34, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> setlocale does work for me, I have this in app/config/bootstrap.php :
>
> setlocale(LC_ALL, 'es_AR.utf8');On Wed, Mar 26, 2008 at 8:29 AM, ygneo 
> <[EMAIL PROTECTED]> wrote:
>
> >  Hi everybody!
>
> >  Anyone knows a good method to localizate month names when using $form-
> >  >input with a date field?
>
> >  I mean, setlocale doesn't works for me, and I think it would works
> >  with L10n, with I haven't find out how...
>
> >  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: HABTM Relation with foreign key

2008-03-26 Thread Guillaume Chomat

Hi boyracerr,

Thanks for  your help. Cake is effectively amazing!!!

Kind Regards.

On Mar 26, 4:10 am, boyracerr <[EMAIL PROTECTED]> wrote:
> Me again,
>
> As so often, I knew I wanted to use it but needed a helpful post
> laying it out for me in simple terms. Mariano to the rescue!
>
> http://www.cricava.com/blogs/index.php?blog=6&title=modelizing_habtm_...
>
> If you are using 1.2, then just set the table up like this (my
> example):
>
> id, user_id, forum_id, role_id
>
> and the relation:
>
> var $hasAndBelongsToMany = array('Members' => array('className' =>
> 'User'
>                                                                               
>                                   )
>                                                                         );
>
> Yes, thats it. As usual, Cake is amazing but you need a blog post to
> tell you why :)
>
> On Mar 26, 4:21 am, boyracerr <[EMAIL PROTECTED]> wrote:
>
> > As so often, stating my problem helped me think of it in a different
> > way (actually it gave me different phrases to Google for)
>
> > Have a look at:
>
> >http://www.thinkingphp.org/2006/10/26/modeling-relationships-in-cakep...
>
> > I think this is what we are both trying to do.
>
> > If you are using 1.2, one of the comments on the above post might also
> > be relevant:
>
> > """"""""""
> > This is already halfway implemented in Cake 1.2, but only for MySQL,
> > i.e.:
>
> > class User extends AppModel {
>
> > var $hasAndBelongsToMany = array("Group" => array("with" =>
> > "Memberships"));
>
> > }
>
> > And the join table fields will be selected as 'Memberships' within the
> > association.
>
> > """"""""""
>
> > I'm going to try this now, let me know how you get on.
>
> > Ben
>
> > On Mar 26, 4:13 am, boyracerr <[EMAIL PROTECTED]> wrote:
>
> > > Hi, sorry for jumping in your post, but I think my situation is almost
> > > exactly the same.
>
> > > Imagine I have a forum application with many forums, so that we have
>
> > > Users
> > > Forums
>
> > > A user may be an admin for one forum, a member of another, a moderator
> > > of another. There is a table for Roles.
>
> > > What is the best way to represent this relationship?
>
> > > Like Guillaume, I'm thinking a foreign key in the forums_users table
> > > which goes to Roles. This seems logical to me.
>
> > > I'm sure many people must have faced this (essentially a three way
> > > relation) but I can't find a decent solution.
>
> > > Ben
>
> > > On Mar 25, 11:57 pm, Guillaume Chomat <[EMAIL PROTECTED]>
> > > wrote:
>
> > > > Hi logica,
>
> > > > Don't focus on the cohérence of the sample used to explain my needs.
> > > > It is just a weird example.
> > > > What i need is to know if it is possible when defining a HABTM
> > > > relationship to tell cake to resolve also the foreign key contained in
> > > > the join table.
>
> > > > Can you help me on this?
>
> > > > Thanks in advance.
>
> > > > On Mar 25, 5:17 pm, "b logica" <[EMAIL PROTECTED]> wrote:
>
> > > > > I suspect that you'd be far better off with role_id in the users
> > > > > table. Unless it denotes a particular role (among many) that a user
> > > > > had when making the post.
>
> > > > > users belongsTo roles, HABTM posts
> > > > > posts HABTM  users
> > > > > posts_users (user_id, post_id)
>
> > > > > On Tue, Mar 25, 2008 at 5:35 AM, Guillaume Chomat
>
> > > > > <[EMAIL PROTECTED]> wrote:
>
> > > > > >  Hi everybody,
>
> > > > > >  Is cake able to read any referenced model in a join table?
>
> > > > > >  Suppose we have three entities table:
> > > > > >  - users
> > > > > >  - posts
> > > > > >  - roles
>
> > > > > >  and a join table:
> > > > > >  - posts_users.
>
> > > > > >  The join table posts_users has a field role_id, foreign key to the
> > > > > >  roles table.
>
> > > > > >  We have defined the HABTM relationship in the user model.
> > > > > >  So now, we would like to be able to read the posts associated to 
> > > > > > the
> > > > > >  user but also get the role specified in the relation.
>
> > > > > >  Is it possible without defining the finderQuery field in the HABTM
> > > > > >  relationship?
>
> > > > > >  Thanks in advance for your help
>
> > > > > >  Kind Regards
--~--~-~--~~~---~--~~
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: HABTM Relation with foreign key

2008-03-25 Thread Guillaume Chomat

Hi logica,

Don't focus on the cohérence of the sample used to explain my needs.
It is just a weird example.
What i need is to know if it is possible when defining a HABTM
relationship to tell cake to resolve also the foreign key contained in
the join table.

Can you help me on this?

Thanks in advance.

On Mar 25, 5:17 pm, "b logica" <[EMAIL PROTECTED]> wrote:
> I suspect that you'd be far better off with role_id in the users
> table. Unless it denotes a particular role (among many) that a user
> had when making the post.
>
> users belongsTo roles, HABTM posts
> posts HABTM  users
> posts_users (user_id, post_id)
>
> On Tue, Mar 25, 2008 at 5:35 AM, Guillaume Chomat
>
> <[EMAIL PROTECTED]> wrote:
>
> >  Hi everybody,
>
> >  Is cake able to read any referenced model in a join table?
>
> >  Suppose we have three entities table:
> >  - users
> >  - posts
> >  - roles
>
> >  and a join table:
> >  - posts_users.
>
> >  The join table posts_users has a field role_id, foreign key to the
> >  roles table.
>
> >  We have defined the HABTM relationship in the user model.
> >  So now, we would like to be able to read the posts associated to the
> >  user but also get the role specified in the relation.
>
> >  Is it possible without defining the finderQuery field in the HABTM
> >  relationship?
>
> >  Thanks in advance for your help
>
> >  Kind Regards
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



HABTM Relation with foreign key

2008-03-25 Thread Guillaume Chomat

Hi everybody,

Is cake able to read any referenced model in a join table?

Suppose we have three entities table:
- users
- posts
- roles

and a join table:
- posts_users.

The join table posts_users has a field role_id, foreign key to the
roles table.

We have defined the HABTM relationship in the user model.
So now, we would like to be able to read the posts associated to the
user but also get the role specified in the relation.

Is it possible without defining the finderQuery field in the HABTM
relationship?

Thanks in advance for your help

Kind Regards


--~--~-~--~~~---~--~~
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 1.2 find('list') changing displayField

2008-03-06 Thread Guillaume

I think you just have to set the $displayField var in your model
tag.php

$displayField = 'word';

Guillaume
--
http://cherryonthe.popnews.com

On 6 mar, 03:25, clrockwell <[EMAIL PROTECTED]> wrote:
> Using 1.2, i have a tag table that has two fields -> 'id' and 'word',
> when i use $this->Tag->find('list'), the result is like:
> 1 or Tag['id'] option>
>
> What I want is:
> Parking or  value=Tag['id']>Tag['word']
>
> I tried using $this->Tag->find('list', array('word')), and 
> $this->Tag->find('list', array('fields' => 'word'))
>
> but neither return the desired results.
>
> Thanks in advance for any direction you can give
--~--~-~--~~~---~--~~
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: Where is the flashMessage div constructed? Trying to created multiple flashes

2008-02-18 Thread Guillaume

Hzllo
I hope i understand your question...

The setFlash method takes a second argument which is a layout for the
Flash message.

So you just have to create a .ctp (eg. "warning_message.ctp") file in
app/view/layout/ with your html code you want and
e($content_for_layout) and then you call it using :

$this->Session->setFlash('Please correct it"', "warning_message");

Guillaume


On 18 fév, 15:30, designvoid <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I'm trying to create multiple flash messages ie an error message and a
> success message, I have it to show the error message and the standard
> flash, but the standard has a div around it and my own error one just
> dumps the passed error... I'm using the stable release not the beta...
>
> Can anyone advise me on how to make them both show in the div but with
> different classes?
>
> TIA,
>
> toby.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Why forcing by default the primary key to be 'id'?

2008-02-07 Thread Guillaume Chomat

Hi everyone,

I'm little newby in cake so perhaps it would be simple to answer to my
concerns.
According to my knowledge a natural join is better when the two joined
fields have the same name.
In the cake policy the primary key and referenced one have different
name: 'id' and '_id.
Is the performance issue minor in join queries? What the initial
reason to chooce this policy?

Best regards.

PS: Thanks for the cake team for this very great job. I hope to be
able to participate for the evolution of our framework in 2008.

--~--~-~--~~~---~--~~
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: MySQL and CakePHP characterset incompatibility?

2008-02-04 Thread Guillaume

Hello,

I had the same problem with French characters.
CakePHP is not to blame here, it's a problem of configuration of
PhpMyAdmin.

Guillaume


On 4 fév, 07:18, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> I have very weird problem.
> Hopefully I am doing something wrong here...
>
> If I input Korean characters into MySQL table (through CakePHP
> interface I threw together), i can read it back out, and everything is
> fine.
> But when I view the table data through phpMyAdmin, all Korean
> characters are garbled up.
>
> If I input Korean characters through phpMyAdmin SQL editor, Korean
> characters show up fine in the phpMyAdmin browser.
> But when I view the table data through CakePHP i threw together, all
> Korean characters are garbled up.
>
> You can see what I mean here:http://cake.ziroziro.com/books/knownbooks
>
> Collation on MySQL is utf8_unicode_ci
>
> The database setting I have set for database.php is,
>
> class DATABASE_CONFIG {
> var $default = array(
> 'driver' => 'mysql',
> 'persistent' => false,
> 'host' => 'localhost',
> 'port' => '',
> 'login' => 'cake_user',
> 'password' => '*',
> 'database' => 'cake',
> 'schema' => '',
> 'prefix' => '',
> 'encoding' => 'UTF-8'
> );
>
> }
>
> Thank you in advance for any insight!
--~--~-~--~~~---~--~~
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: scripts for layout in cake 1.2

2008-01-07 Thread Guillaume

> Why do you want the javascript to be executed last?
Well, it may be to wait for all the DOM components to be loaded (it
could be a way to achieve that not depending on browsers' various
implementation on .onload.
Moreover, it seems a good practice to load javascript last :
http://developer.yahoo.com/performance/rules.html#js_bottom

Guillaume

On 7 jan, 16:54, rtconner <[EMAIL PROTECTED]> wrote:
> Perhaps this bakery article will help you.
>
> http://bakery.cakephp.org/articles/view/anything_for_layout-making-ht...

--~--~-~--~~~---~--~~
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 concatenation not working

2007-11-12 Thread Guillaume

If your host allows it, you can use your own workstation and program a
script that periodically does something like

mysqldump -C --host DB_HOSTNAME -u USERNAME -p PASSWORD DB_NAME >
mysdump.sql

over the network.

Your mysql needs to be reachable from outside the server.

My host used to allow it and it was a very convenient and quick (owing
to the C option) way to backup a database remotely.

There can be security hazards though (but sending the dump via email
too).

Guillaume
http://cherryonthe.popnews.com


On 12 nov, 10:21, technicaltitch <[EMAIL PROTECTED]> wrote:
> surely it is easier to concatenate a string in PHP than change my
> host?! i'm keen to hear of workarounds, but mostly hoping for help
> with the string handling.
>
> our hosting is US$11 per year which is incredibly competitive, we are
> very happy with their service (faultless in several years) and
> familiar with the setup - and every single cent makes a difference in
> bolivia. ( they are bargainvault.com and the website i'm replacing 
> iswww.intiwarayassi.org)
>
> On Nov 11, 9:55 pm, Steve Boyd <[EMAIL PROTECTED]> wrote:
>
> > then changes your host.  there is incredibly cheap hosting everywhere
> > (well within the USA anyhow) that allows you cron jobs + all the other
> > bells and whistles
>
> > On Nov 12, 8:37 am, technicaltitch <[EMAIL PROTECTED]> wrote:
>
> > > because it's for a bolivian volunteer organization we're using
> > > incredibly cheap hosting which doesn't allow us cron jobs. i thought
> > > this would be trivial.
>
> > > On Nov 11, 5:21 pm, AD7six <[EMAIL PROTECTED]> wrote:
>
> > > > On Nov 11, 1:33 pm, technicaltitch <[EMAIL PROTECTED]> wrote:
> > > > 
>
> > > > Why would you not use mysqldump and a cron job?
>
> > > > AD- Hide quoted text -
>
> > - Show quoted text -


--~--~-~--~~~---~--~~
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: $this->params['pass'] - manual incorrect?

2006-07-08 Thread guillaume bordas
You're right, I think the manual is not up to date with the code. I've got the same result with my code !PS: I'm not a Cake expert, I may be wrong ;)2006/7/8, Attila <
[EMAIL PROTECTED]>:In the manual cake-manual.pdf
 it says:--$this->params['pass']Stores the GET query string passed with the current request. Forexample, if the URL /posts/view/?var1=3&var2=4wascalled,$this->params['pass']
would  equal"?var1=3&var2=4".--However $this->params['pass'] gives back an array (which is evenbetter):posts/view/4/town/streetArray([0] => 4
[1] => town[2] => street)This is using the latest (I think) versions of cake and the manual.

--~--~-~--~~~---~--~~
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  -~--~~~~--~~--~--~---


Re: Re: help me

2006-07-04 Thread guillaume bordas
Just a spam in french... Don't waste your time on it ;)2006/7/4, Michael Grunewalder <[EMAIL PROTECTED]>:
The only problems I can see are- the horse didn't brush it's teeth- the duck is drunk- I don't speak FrenchBut other than that all looks fine.
--~--~-~--~~~---~--~~
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  -~--~~~~--~~--~--~---


Re: including an element in the depending on which view I'm in

2006-06-29 Thread guillaume bordas
While you're in the snippet section, don't forget to grab the Util Helper, Head helper make use of it;)Head helper manual by example: 
http://rossoft.wordpress.com/2006/03/28/register-head-tags-from-helpers-2/Third comment, important one (rossoft, maybe it should be on the top of the "article") : 

			3. rossoft - May 16, 2006			

			I've talked with Nao and __construct() works in PHP4.
Note for readers: Don't forget to include the HeadHelper in your
AppController, and put this in your HEAD section of your layout:
if (isset($head)) echo $head->print_registered();

			I just discovered it this morning, having a coffee and reading the mailing list, I was about to code a helper to do something like this.Thanks a lot Rossoft for saving our time ! :D
2006/6/29, Olivier Percebois-Garve <[EMAIL PROTECTED]>:
The head helper made by rossoft is probably the best way.brandags wrote:> I don't know if this is the best solution, but I created a variable> called "addHead", which I create in my view (or maybe I created it in
> my app controller...? can't remember..), then use it in the layout.> Like so:>> index.thtml:> addHead .= 'This will go in the head section';?>>> layout.thtml
:> > addHead)) echo $this->addHead;?>> >> If anyone has a better way, let it be heard!>>> >>
>
--~--~-~--~~~---~--~~
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  -~--~~~~--~~--~--~---


Re: Videos not working...Plugin?

2006-06-10 Thread Bordas Guillaume
Without Itune:http://www.apple.com/quicktime/download/standalone.htmlWithout Quicktime (with Media Player Classic):
http://www.free-codecs.com/download/QuickTime_Alternative.htm2006/6/9, nate <[EMAIL PROTECTED]>:
Per the screencast page:Download the latest QuickTime:http://www.apple.com/quicktime/download/
--~--~-~--~~~---~--~~
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  -~--~~~~--~~--~--~---