Re: Behavior of a div updated

2007-03-28 Thread Steniskis

Thank you Frankie,
Yes it is yet the case. Best is to load it into the initial layout.
So I have to find another solution.
Steniskis



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



Ajax: inactive ajax/javascript in a div updated

2007-03-27 Thread Steniskis

Hi all,
I update a div with a form
echo $ajax-submit('Soumettre', array('url' = '/tournees/search',
'update' = 'tableau_tournees'));
This div contains a list with calls to thickbox. These calls display
other forms to edit or delete the line in the list.
When the page is displayed, all is ok but when I update the list, I
cannot call anymore the thickbox.
I have the same problem with the zebra app in javascript whick allows
an alternate color on the lines.
I tried many things and went into many messages but did not see any
solution.
Thank you for any contribution to this problem
Steniskis


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



Behavior of a div updated

2007-03-27 Thread Steniskis

Hi,

Sorry to repeat my question but I try to be more clear. I have updated
a div with an ajax form. In this div updated that is a list, I have no
access to any javascript or ajax.

Besides, the layout used in this action contains those javascript.

Have you any explication or solution ?

Thank you

Steniskis


--~--~-~--~~~---~--~~
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: Include Js file in layouts

2007-02-20 Thread Steniskis

You put your js files in a directory js inside the webroot directory

Then you have  helpers to add.

In the controller, you include
var $helpers = array('html', 'javascript');

and in your layout, you put this for example :

echo $html-charsetTag('UTF-8');

$head-js('prototype');
$head-js('scriptaculous.js?load=effects');
$head-js('controls');

$head-js('datepicker');
$head-js('zebra_tables');
$head-js('listes');
$head-js('script');
$head-js('jquery');
$head-js('thickbox');
$head-js('common');
if (ereg(MSIE, getenv(HTTP_USER_AGENT))){
$head-css('ie6_or_less');
}
$head-css('page');
$head-css('main');
$head-css('thickbox');
$head-css('datepicker');

Cheers
Steniskis


--~--~-~--~~~---~--~~
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: Include Js file in layouts

2007-02-20 Thread Steniskis

Don't forget the helper head.
Sorry
Steniskis



--~--~-~--~~~---~--~~
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: What editor do you use for CakePHP?

2007-02-12 Thread Steniskis

Quanta Plus (Linux) or Homesite(Windows)
Steniskis

On 12 fév, 13:02, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 G'day all,

 Matt from Australia here.  In the past I've done all my PHP coding
 using a text editor such as Wordpad, and then a few years back I've
 begun using Dreamweaver.

 Currently I'm using Dreamweaver 8 and I've found it to be quite good
 when dealing with .php files.  It's not great when editing .thtml
 files though, since it doesn't recognize them as code, and so doesn't
 give you all the nice code colouring and auto-closing of tags, etc...
 At least the automated uploading/downloading is nice.

 What do you use for Cake cooking?


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



Re: how to generate a menu list and make an array

2007-01-30 Thread Steniskis

For dynamic menus see
http://groups.google.com/group/cake-php/browse_thread/thread/
676eb57cfa4d9c6a/379c6632a0130f45?lnk=gstq=menu
+steniskisrnum=3#379c6632a0130f45
I tried to begin a tutorial but got an error. I will as soon as 
possible.
Steniskis


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



Re: how to generate a menu list and make an array

2007-01-30 Thread Steniskis

oops !
I give you a shorter link
http://tinyurl.com/2ucvcp


--~--~-~--~~~---~--~~
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: Choosing from a large data set

2007-01-30 Thread Steniskis

Add pagination too with different sortings
http://bakery.cakephp.org/articles/view/65
Cheers
Sten


--~--~-~--~~~---~--~~
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 missing model error

2007-01-30 Thread Steniskis

Hi Jason,
Are you sure you don't have any error on CamelCase/undescore ? What 
are the names of your files ?
Sten


--~--~-~--~~~---~--~~
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 missing model error

2007-01-30 Thread Steniskis

Include into the array $uses, the Model 'Aboutu'.
Sten


--~--~-~--~~~---~--~~
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 missing model error

2007-01-30 Thread Steniskis

Jason,
You have an error in
 class AboutUsController extends AppController {
   var $name = 'Aboutus';
either you have a camelcase or not but here you put a upper case for 
the class and not for the name...
Sten


--~--~-~--~~~---~--~~
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: Same result from the same method with a different argument

2007-01-26 Thread Steniskis

Yes Sam, I have

In the controller, I have this
http://bin.cakephp.org/view/910330616

In the view I have this
http://bin.cakephp.org/view/2134642903

I am facing a mystery... ;=)

Thank you
Steniskis


--~--~-~--~~~---~--~~
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: Same result from the same method with a different argument

2007-01-26 Thread Steniskis

Well AD7six
I used
http://bin.cakephp.org/view/1303483276
then I got
Warning: Invalid argument supplied for foreach() in
/var/www/html/SID/cake/libs/model/datasources/datasource.php on line
458
I am a bit short of time and could not explore further the reason why.
Sten


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



Same result from the same method with a different argument

2007-01-24 Thread Steniskis

Hello,
In my controller, I call twice the same method with a different value
Here is the code

$this-set('desrippeurs',$this-Agent-listedesagents(2));
$this-set('deschauffeurs',$this-Agent-listedesagents(1));
FIst I send 2 and then 1 for example.
Normally I would have a different list in each case but both get the
same list, the first one. Do I have to write twice the same method with
a different name to have the right answer ?

Thank you
Steniskis


--~--~-~--~~~---~--~~
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: d_auth : login problems

2007-01-16 Thread Steniskis


Thank you all,
Yes Dieter and Paul, I got the right javascript code.
I am thinking my problem comes from the part where I create a profile,
cause I had first a misconception of the app. Here is the code from
add.thtml:

?php
$action = 'Add';
$formAction = $html-url('/users/add/');
echo $dAuth-loadJs();
echo $dAuth-ErrorMsg($action,$error);
if($this-params['bare']):
echo $ajax-form('/users/add/','post',array('update'=
'update_form','loading'= Element.show('loading'),'complete'=
Element.hide('loading')));
else:
echo $dAuth-formHeader($action,$formAction,$allowcleartext);
endif;
?
fieldset
legendAjouter un usager/legend
div class=set-column
div class=label
labelRole:/label requis
/div
div class=input
?php echo $html-selectTag('User/auth_group_id', 
$roles,
$html-tagValue('User/auth_group_id'), null, null, false);?
/div
/div
div class=set-column
div class=input
?php echo 
$dAuth-formInput('Surnom','User/username');?
/div
/div
div class=set-column
div class=input
?php
echo $dAuth-formPassword('Password','User/password');
   echo $dAuth-hiddenField('hashed_pw','User/hashed_pw','');

?
/div
/div
div class=submit style=margin-left:120px;
?php echo $dAuth-submit('Enregistrer', false);?
/div
/fieldset
/form

and here is the one from the add() method in users_controller :

function add() {
$this-set('roles', $this-Group-generateList(null, null, null,
'{n}.Group.id', '{n}.Group.name'));
$this-set('allowcleartext', $this-dAuth-allowClearText);
$this-layout = 'ajax';
if (!empty($this-params['data'])) {
$this-data['User']['username']=$this-nettoyer($this-data['User']['username']);
$this-data['User']['name']=$this-nettoyer($this-data['User']['name']);
$this-data['User']['email']=$this-nettoyer($this-data['User']['email']);
if ($this-User-save($this-params['data'])) {
$this-flash('Usager ajouté.','TB_remove');
}
}
}

the nettoyer() method is to get rid of any accent.
Thank you for your help.
Jean


--~--~-~--~~~---~--~~
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: d_auth : login problems

2007-01-16 Thread Steniskis


Thank you Dieter and Paul,
Yes I got the good javascript code.

I am thinking, may be the problem comes from the profile creation.
Here is my code for add.thtml to add a user:

echo $dAuth-loadJs();
echo $dAuth-ErrorMsg($action,$error);
if($this-params['bare']):
echo $ajax-form('/users/add/','post',array('update'=
'update_form','loading'= Element.show('loading'),'complete'=
Element.hide('loading')));
else:
echo $dAuth-formHeader($action,$formAction,$allowcleartext);
endif;
?
fieldset
legendAjouter un usager/legend
div class=set-column
div class=label
labelRole:/label requis
/div
div class=input
?php echo $html-selectTag('User/auth_group_id', 
$roles,
$html-tagValue('User/auth_group_id'), null, null, false);?
/div
/div
div class=set-column
div class=input
?php echo $dAuth-formInput('Surnom','User/username');?
/div
/div
div class=set-column
div class=input
?php
echo $dAuth-formPassword('Password','User/password');
   echo $dAuth-hiddenField('hashed_pw','User/hashed_pw','');
?
/div
/div
div class=submit style=margin-left:120px;
?php echo $dAuth-submit('Enregistrer', false);?
/div
/fieldset
/form

and here is the method in users_controller.php :

function add() {

$this-set('roles', $this-Group-generateList(null, null, null,
'{n}.Group.id', '{n}.Group.name'));
$this-set('allowcleartext', $this-dAuth-allowClearText);
$this-layout = 'ajax';
if (!empty($this-params['data'])) {
$this-data['User']['username']=$this-nettoyer($this-data['User']['username']);
$this-data['User']['name']=$this-nettoyer($this-data['User']['name']);
$this-data['User']['email']=$this-nettoyer($this-data['User']['email']);
$this-data['User']['password']=$this-data['User']['hashed_pw'];

if ($this-User-save($this-params['data'])) {
$this-flash('Usager ajouté.','TB_remove');
}
}
}

the nettoyer() method is used to get rid of any accent.

Thank you

Jean


--~--~-~--~~~---~--~~
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: d_auth : login problems

2007-01-16 Thread Steniskis


OOPS!! sorry for the double message, I thought all got lost the first
tiem I posted.
Jean


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



Re: Integrate a datepicker

2007-01-15 Thread Steniskis


I use this one
http://www.frequency-decoder.com/2006/10/02/unobtrusive-date-picker-widgit-update
It is all right and simple to install.
Jean


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



d_auth : login problems

2007-01-15 Thread Steniskis


Hello,
I have installed d_auth, all works well except with my login.
I exposed the details on http://bakery.cakephp.org/articles/view/147
When I login for authentification, the hash from the form and the hash
on the database are different :
username = ravel
password = pavane

I get this
Real hash : 903a6e1948193c9da492c4a06aa571816b0f274a
Submitted hash : b174737ff0ba3f2ce29f20ec792ac25209fb76b9

Anyone has a hunch about this ?
Thank you
Jean


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



Re: Model not available from app_controller

2006-12-08 Thread Steniskis

Hello
Thank you AD7six for your insight, happy for you Langdon. I did what
you suggest AD7six, it was fine for my app_controller but now I have
this message
Call to a member function on a non-object in
/var/www/html/SID/app/views/layouts/default.thtml
It is a problem with the head helper. So I put all my helpers in my
app_controller and then there is an error message about
css-register().
May be someone could have an insight on this problem of missing. I feel
like turning around and around.
Thank you for your help
Sten


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



Re: Model not available from app_controller

2006-12-08 Thread Steniskis

Hi Mariano,
Thank you for your help but in fact all works except one page and to be
precise the error displayed is about  this line in the head helper
$this-_register(array($file,'css',$htmlAttributes));
This error masks something else...
Sten


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



Re: Model not available from app_controller

2006-12-08 Thread Steniskis

Hi,
Eventually I found a problem on a table name in one of my models. I
think there was two problems with a difficulty to identify the errors.
Thanks for your help
Sten


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



Re: Model not available from app_controller

2006-12-07 Thread Steniskis

Hi all of you,
Thank you for your explanations and you contributions to this debate. I
think I will separate my model in two ones on the same table, I think
this will fix this problem.
Sten


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



Re: Model not available from app_controller

2006-12-07 Thread Steniskis

This last operation did no change. 
Sten


--~--~-~--~~~---~--~~
 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: Problems when using observeField to check password and its confirm

2006-10-27 Thread Steniskis

Hi Samuel
I got a script in javascript from GLPI
http://www.glpi-project.org/spip.php?lang=en

javascript//

/**
 * This array is used to remember mark status of rows in browse mode
 */
var marked_row = new Array;

var timeoutglobalvar;
function setdisplay (objet, statut) {
if (objet.style.display != statut) objet.style.display = statut;
}

function cleandisplay(id){
var e=document.getElementById(id);
if (e){
var ie=false;

var appVer = navigator.appVersion.toLowerCase();
var iePos = appVer.indexOf('msie');
if (iePos !=-1) {
var is_minor =
parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos)));
var is_major = parseInt(is_minor);
}
if (navigator.appName.substring(0,9) == Microsoft)
{ // Check if IE version is 6 or older
if (is_major = 6) {
ie=true;
}
}

setdisplay(e,'block');

if (ie){
 var selx=0; var sely=0; var selp;
 if(e.offsetParent){
 selp=e;
 while(selp.offsetParent){
selp=selp.offsetParent;
 selx+=selp.offsetLeft;
 sely+=selp.offsetTop;
 }
 }
 selx+=e.offsetLeft;
sely+=e.offsetTop;
 selw=e.offsetWidth;
 selh=e.offsetHeight;
hideSelect(selx,sely,selw,selh);
}
}
}

function cleanhide(id){
var e=document.getElementById(id);
if (e){
var ie=false;

var appVer = navigator.appVersion.toLowerCase();
var iePos = appVer.indexOf('msie');
if (iePos !=-1) {
var is_minor =
parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos)));
var is_major = parseInt(is_minor);
}
if (navigator.appName.substring(0,9) == Microsoft)
{ // Check if IE version is 6 or older
if (is_major = 6) {
ie=true;
}
}

if (ie){
 var selx=0; var sely=0; var selp;
 if(e.offsetParent){
 selp=e;
 while(selp.offsetParent){
selp=selp.offsetParent;
 selx+=selp.offsetLeft;
 sely+=selp.offsetTop;
 }
 }
 selx+=e.offsetLeft;
sely+=e.offsetTop;
 selw=e.offsetWidth;
 selh=e.offsetHeight;
showSelect(selx,sely,selw,selh);
}
setdisplay(e,'none');

}
}


function hidemenu(){
var ie=false;

var appVer = navigator.appVersion.toLowerCase();
var iePos = appVer.indexOf('msie');
 if (iePos !=-1) {
 var is_minor =
parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos)));
 var is_major = parseInt(is_minor);
}
 if (navigator.appName.substring(0,9) == Microsoft)
 { // Check if IE version is 6 or older
if (is_major = 6) {
ie=true;
}
}

for (var i = 1; i=10; i++) {
var e=document.getElementById('smenu'+i);
if (e) {
if (ie){
 var selx=0; var sely=0; var selp;
 if(e.offsetParent){
 selp=e;
 while(selp.offsetParent){
selp=selp.offsetParent;
 selx+=selp.offsetLeft;
 sely+=selp.offsetTop;
 }
 }
 selx+=e.offsetLeft;
sely+=e.offsetTop;
 selw=e.offsetWidth;
 selh=e.offsetHeight;
showSelect(selx,sely,selw,selh);
}
setdisplay(e,'none');
}
}
}

function montre(id) {
var d 

Re: ajax observefield how to get $params in the controller ?

2006-10-25 Thread Steniskis

Hi Bakers

Sorry I just changed

$this-Vehicule-listedesvehicules(mysql_real_escape_string($params['form']['vehicule_select']));

for

$this-Vehicule-listedesvehicules(mysql_real_escape_string($this-params['form']['vehicule_select']));


AND IT WORKS!

Sten


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



ajax observefield how to get $params in the controller ?

2006-10-24 Thread Steniskis

Hi all,
I am stuck because my $params are undefined in the controller. May be
you have an idea or an experience that would help me and others.
I reload a select with an observe field
my element is :
==ELEMENT
div id=options_vehicules
table
  tr
td

Véhicule input type='text'
ondblclick=document.getElementById('vehicule_select').value='*';
id='vehicule_select' name='vehicule_input' size='10'
?php echo $ajax-observeField('vehicule_select', array('size'='20',
'update'='vehicule_span', 'url'='/tournees/refresh_vehicules',
'frequency'=1, 'stripe();')); ?
/div
span id='vehicule_span'
?php echo $html-selectTag('Vehicule/IDP_vehicules', 
$desoptions);
?
/span

/form
/td/tr
/table/div

===CONTROLLER METHOD=
function refresh_vehicules() {
$this-layout = ajax;
$desoptions =
$this-Vehicule-listedesvehicules(mysql_real_escape_string($params['form']['vehicule_select']));
$this-set('desoptions',$desoptions);
}

=ACTION
?
$params = array('controller'='tournees', 'desoptions'=$desoptions);
echo $this-renderElement('liste_vehicules', $params);
?

Thank you for any hunch, suggestion or solution.
Sten


--~--~-~--~~~---~--~~
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: find method

2006-10-24 Thread Steniskis

Hi Roby,
Don't you have to camelCase the method name findByUserName ?
Yes it is a magic method.
Go and fetch it in http://manual.cakephp.org/chapter/models
Lastly you can create a method in your model and include a query
inside, calling it from your controller.
Cheers
Sten


--~--~-~--~~~---~--~~
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: Dynamic Menu

2006-10-23 Thread Steniskis

Hello
I have created a component with my menus
I began with the menu tutorial in the wiki
http://wiki.cakephp.org/tutorials:building_a_cakephp_site_part_-_1

I call the menu from my controller
lass RapportsController extends AppController {

var $name = Rapports;
var $layout = page;
var $helpers= array('html', 'javascript', 'ajax', 'time', 'page',
'thickbox', 'awbarplot');
var $components = array('Menu');
var $beforeFilter = array('init');
function init() {
// Create menu component
$this-Menu-controller = $this;
$this-Menu-init($this-name);
}
...
?

then I have the menuComponent where I build an array. The variable
$_SERVER['REQUEST_URI']; is used to know which on which page we are.
?
class MenuComponent extends Object {
var $active=1;
var $controller = true;

  var $les_menus = array(
   Accueil= 'accueil/',
Collecte = array(
1 = Collecte,
Tournées = tournees/,
Equipes = equipes/,
Personnels = personnels/,
Secteurs = secteurs/
),

Rapports =  rapports/,

Admin = array(
1 = Admin,
Droits Accès = acces/,
Usagers et groupes = usagers/,
Importations = importations/
),
Réclamations  = reclamations/,
Déchetteries  = dechetteries/
);

function startup($controller) {
$this-controller = $controller;
}


 function init () {
$this-controller-set('les_menus',$this-les_menus);
$this-controller-set('active',$this-activer($this-les_menus));
$this-controller-set('active',$this-active);
}

  function activer ($les_menus) {
  $uri=$_SERVER['REQUEST_URI'];
  $i=0;

foreach ($les_menus as $valeur){


 if (!is_array($valeur)) {
 $i++;
 if (eregi($valeur,$uri)){

 $this-active=$i;
}
} else {

 foreach($valeur as $svaleur) {
$i++;

 if (eregi($svaleur,$uri)){
 $this-active = $i;
}
}//foreach
}//else

}//foreach
} //méthode

}
?
then in your view you include your element
?php echo $this-renderElement('nav',$les_menus); ?

then here is your element

ul id=nav
?php $k=0; $i=0; $j=0; $menus=''; $k=0; ?
?php $taille_1=count($les_menus); ?
?php foreach ($les_menus as $libelle = $valeur): ?

?php
 if (!is_array($valeur)) {
$i++; $k++;
 if ($k==$active){
 echo 'li class=active id=';
}
 elseif ($i==1){
 echo 'li class=first';
}
 elseif ($i==$taille_1){
 echo 'li class=last';
}
 else {
 echo 'li'.\n;
}

 if ($k==$active){
 echo $html-link($libelle,'#');
}
 else {

  echo $html-link($libelle,FULL_BASE_URL . 
$this-webroot .
$valeur);
}
 echo '/li'.\n;
} else {
 $taille_2=count($valeur);
 foreach($valeur as $slibelle = $svaleur) {
 $k++;
 $j++;
 if ($k==$active){

 echo 'li class=active';
echo $html-link($slibelle,$_SERVER['REQUEST_URI']);
echo \n;
 if ($j==1){
echo 'ul';
}
else {
echo '/li';
}
}
   elseif ($j==$taille_2){
  echo  'li class=last';
echo $html-link($slibelle,FULL_BASE_URL . $this-webroot .$svaleur);
echo '/li'.\n;
}
elseif ($j==1){
if (($active($k+$taille_2))  
($active$k)){

   echo 'li class=active';
if 
(is_numeric($slibelle)){

echo $html-link($svaleur,'#');

}
else {
echo $html-link($slibelle,FULL_BASE_URL . $this-webroot .$svaleur);
}
echo \n;
}
else {

echo 'li';
if (is_numeric($slibelle)){

Re: autocomplete options ?

2006-10-20 Thread Steniskis

Here is the code :
div id=options_vehicules
table
  tr
td
Véhicule ?php echo
$ajax-autoComplete('Vehicule/listedesvehicules','/tournees/refresh_vehicules',
array('size'='20','minChars'='4', 'update'='misajour_vehicules',
'afterUpdate'=pick_vehicule)); ?
div class=misajour_vehicules id=misajour_vehicules/div
/td/tr
tr
td
?php echo $html-hidden (Vehicule/IDP_vehicule,
array('class'=vehicule_id,'id'=vehicule_id, 'value'=)); ?
/td/tr
/table/div


--~--~-~--~~~---~--~~
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: autocomplete options ?

2006-10-20 Thread Steniskis

Thank again Leo, I'll keep you informed through this thread.
Sten


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



autocomplete options ?

2006-10-19 Thread Steniskis

Hi all,
 I am blocked with a code that does not work. Are the options OK ? Are
they really parts of Cake or just of scriptaculous ?
See code on
http://cakephp.org/pastes/show/20407380906c34e5ce247f832c7602a5
Do you have an idea ?
Thank you for any help
Sten


--~--~-~--~~~---~--~~
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: Problem with associations

2006-10-18 Thread Steniskis

Hello Leo,
What about using the query in a method inside your model ?
Sten


--~--~-~--~~~---~--~~
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: ajax observeField on a select

2006-10-17 Thread Steniskis

Not yet, thank you Léo, I will.
Have a nice day
Sten


--~--~-~--~~~---~--~~
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: observeField ajax helper and Firefox

2006-10-16 Thread Steniskis

Hi Zach,
your value for $field_id needs a quote...
Steniskis


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



ajax observeField on a select

2006-10-13 Thread Steniskis

Hi all,
I have a form with select tags. The list is too long and so I have,
each time, a text field to filter the display of the select. It does
not work. The query remains the same without any changing after the
filtering and the display is wrong.


---elementliste_vehicules.thtml

div id=options_vehicules
table
  tr
tdform method=post action=?php echo
$html-url('/tournees/refresh_vehicules')?
Filtre véhicule :
/tdtdinput type=text name=livesearch id=livesearch
size=25?php echo $html-image('magnify.png',
array('alt'='loupe')); ?
?php echo $html-image('spinner.gif', 
array('alt'='Spinner',
'id'='search_spinner', 'style'='display:none;')); ?
/form
?php echo $ajax-observeField('livesearch',
array('update'='select_vehicule', 'url'='refresh_vehicules',
'frequency'=1, 'stripe();')); ?
/td/trtrtd
Véhicule /tdtd?php echo
$html-selectTag('Vehicule/IDP_vehicule', $desoptions, null,
array('id'='select_vehicule'), null, true, false); ?
/td/tr
/table/div
--

-controller -tournees_controller

function index() {
$desoptions = $this-Vehicule-listedesvehicules();
$this-set('desoptions',$desoptions);
}
function refresh_vehicules() {
$this-layout = ajax;
$desoptions =
$this-Vehicule-listedesvehicules(mysql_real_escape_string($this-params['form']['livesearch']));

$this-set('desoptions',$desoptions);
}

---

method in model
vehicule.php-

function listedesvehicules ($atome=null){
if (is_null($atome)){
$sql=SELECT `Vehicule`.`IDP_vehicule`, `Vehicule`.`type`,
`Vehicule`.`marque`, `Vehicule`.`immatriculation`, `Vehicule`.`numParc`
FROM `tb_vehicules` AS `Vehicule` WHERE reforme = 0;
}
else {
$sql=SELECT `Vehicule`.`IDP_vehicule`, `Vehicule`.`type`,
`Vehicule`.`marque`, `Vehicule`.`immatriculation` ,
`Vehicule`.`numParc` FROM `tb_vehicules` as `Vehicule` WHERE (reforme =
0) AND (type LIKE '%.$atome.%' or marque LIKE '%.$atome.%' or
immatriculation LIKE '%.$atome.%' or numParc LIKE '%.$atome.%');
}
while ($row = mysql_fetch_object($result)) {
$IDP_vehicule= $row-IDP_vehicule;
$numParc= $row-numParc;
$type= $row-type;
$immatriculation= $row-immatriculation;
$marque= $row-marque;
  $this-desoptions[$IDP_vehicule] = $type.' '.$marque.'
'.$immatriculation.' '.$numParc;
}
mysql_free_result($result);
return $this-desoptions;
}

//
---view
refresh_vehicules---
$params = array('controller'='tournees', 'desoptions'=$desoptions);
echo $this-renderElement('liste_vehicules', $params);
-
//

Thank you for your help. I am new in Cakology ;=)

Steniskis


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