Changeset 571

Show
Ignore:
Timestamp:
09/04/07 11:10:30 (1 year ago)
Author:
laurentj
Message:

ticket #24: implemented base controller for crud
fixed little bug in jtplcompiler and jformsbase

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/build/manifests/jelix-lib.mn

    r570 r571  
    8787  install_jacl.datas.mysql.sql 
    8888cd lib/jelix/core-modules/jelix/locales/en_US 
     89  auth.ISO-8859-1.properties 
     90  auth.UTF-8.properties 
     91  common.ISO-8859-1.properties 
     92  common.UTF-8.properties 
     93  crud.ISO-8859-1.properties 
     94  crud.UTF-8.properties 
    8995  dao.ISO-8859-1.properties 
     96  dao.UTF-8.properties 
    9097  daoxml.ISO-8859-1.properties 
     98  daoxml.UTF-8.properties 
    9199  db.ISO-8859-1.properties 
     100  db.UTF-8.properties 
     101  errors.ISO-8859-1.properties 
     102  errors.UTF-8.properties 
     103  format.ISO-8859-1.properties 
     104  format.UTF-8.properties 
     105  formserr.ISO-8859-1.properties 
     106  formserr.UTF-8.properties 
     107  jelix.ISO-8859-1.properties 
     108  jelix.UTF-8.properties 
     109  ui.ISO-8859-1.properties 
     110  ui.UTF-8.properties 
     111cd lib/jelix/core-modules/jelix/locales/en_EN 
     112  auth.ISO-8859-1.properties 
     113  auth.UTF-8.properties 
    92114  common.ISO-8859-1.properties 
     115  common.UTF-8.properties 
     116  crud.ISO-8859-1.properties 
     117  crud.UTF-8.properties 
     118  dao.ISO-8859-1.properties 
     119  dao.UTF-8.properties 
     120  daoxml.ISO-8859-1.properties 
     121  daoxml.UTF-8.properties 
     122  db.ISO-8859-1.properties 
     123  db.UTF-8.properties 
     124  errors.ISO-8859-1.properties 
     125  errors.UTF-8.properties 
    93126  format.ISO-8859-1.properties 
     127  format.UTF-8.properties 
    94128  formserr.ISO-8859-1.properties 
     129  formserr.UTF-8.properties 
    95130  jelix.ISO-8859-1.properties 
     131  jelix.UTF-8.properties 
     132  ui.ISO-8859-1.properties 
     133  ui.UTF-8.properties 
     134cd lib/jelix/core-modules/jelix/locales/fr_FR 
     135  auth.ISO-8859-1.properties 
     136  auth.UTF-8.properties 
     137  common.ISO-8859-1.properties 
     138  common.UTF-8.properties 
     139  crud.ISO-8859-1.properties 
     140  crud.UTF-8.properties 
     141  dao.ISO-8859-1.properties 
     142  dao.UTF-8.properties 
     143  daoxml.ISO-8859-1.properties 
     144  daoxml.UTF-8.properties 
     145  db.ISO-8859-1.properties 
     146  db.UTF-8.properties 
    96147  errors.ISO-8859-1.properties 
     148  errors.UTF-8.properties 
     149  format.ISO-8859-1.properties 
     150  format.UTF-8.properties 
     151  formserr.ISO-8859-1.properties 
     152  formserr.UTF-8.properties 
     153  jelix.ISO-8859-1.properties 
     154  jelix.UTF-8.properties 
    97155  ui.ISO-8859-1.properties 
    98   auth.ISO-8859-1.properties 
    99   dao.UTF-8.properties 
    100   daoxml.UTF-8.properties 
    101   db.UTF-8.properties 
    102   common.UTF-8.properties 
    103   format.UTF-8.properties 
    104   formserr.UTF-8.properties 
    105   jelix.UTF-8.properties 
    106   errors.UTF-8.properties 
    107156  ui.UTF-8.properties 
    108   auth.ISO-8859-1.properties 
    109 cd lib/jelix/core-modules/jelix/locales/en_EN 
    110   dao.ISO-8859-1.properties 
    111   daoxml.ISO-8859-1.properties 
    112   db.ISO-8859-1.properties 
    113   common.ISO-8859-1.properties 
    114   format.ISO-8859-1.properties 
    115   formserr.ISO-8859-1.properties 
    116   jelix.ISO-8859-1.properties 
    117   errors.ISO-8859-1.properties 
    118   ui.ISO-8859-1.properties 
    119   auth.ISO-8859-1.properties 
    120   dao.UTF-8.properties 
    121   daoxml.UTF-8.properties 
    122   db.UTF-8.properties 
    123   common.UTF-8.properties 
    124   format.UTF-8.properties 
    125   formserr.UTF-8.properties 
    126   jelix.UTF-8.properties 
    127   errors.UTF-8.properties 
    128   ui.UTF-8.properties 
    129   auth.ISO-8859-1.properties 
    130 cd lib/jelix/core-modules/jelix/locales/fr_FR 
    131   dao.ISO-8859-1.properties 
    132   daoxml.ISO-8859-1.properties 
    133   db.ISO-8859-1.properties 
    134   common.ISO-8859-1.properties 
    135   format.ISO-8859-1.properties 
    136   formserr.ISO-8859-1.properties 
    137   jelix.ISO-8859-1.properties 
    138   errors.ISO-8859-1.properties 
    139   ui.ISO-8859-1.properties 
    140   auth.ISO-8859-1.properties 
    141   dao.UTF-8.properties 
    142   daoxml.UTF-8.properties 
    143   db.UTF-8.properties 
    144   common.UTF-8.properties 
    145   format.UTF-8.properties 
    146   formserr.UTF-8.properties 
    147   jelix.UTF-8.properties 
    148   errors.UTF-8.properties 
    149   ui.UTF-8.properties 
    150   auth.UTF-8.properties 
    151157cd lib/jelix/core-modules/jelix/templates 
    152158  404.xul.tpl 
  • trunk/build/manifests/jelix-lib.mn

    r570 r571  
    8787  install_jacl.datas.mysql.sql 
    8888cd lib/jelix/core-modules/jelix/locales/en_US 
     89  auth.ISO-8859-1.properties 
     90  auth.UTF-8.properties 
     91  common.ISO-8859-1.properties 
     92  common.UTF-8.properties 
     93  crud.ISO-8859-1.properties 
     94  crud.UTF-8.properties 
    8995  dao.ISO-8859-1.properties 
     96  dao.UTF-8.properties 
    9097  daoxml.ISO-8859-1.properties 
     98  daoxml.UTF-8.properties 
    9199  db.ISO-8859-1.properties 
     100  db.UTF-8.properties 
     101  errors.ISO-8859-1.properties 
     102  errors.UTF-8.properties 
     103  format.ISO-8859-1.properties 
     104  format.UTF-8.properties 
     105  formserr.ISO-8859-1.properties 
     106  formserr.UTF-8.properties 
     107  jelix.ISO-8859-1.properties 
     108  jelix.UTF-8.properties 
     109  ui.ISO-8859-1.properties 
     110  ui.UTF-8.properties 
     111cd lib/jelix/core-modules/jelix/locales/en_EN 
     112  auth.ISO-8859-1.properties 
     113  auth.UTF-8.properties 
    92114  common.ISO-8859-1.properties 
     115  common.UTF-8.properties 
     116  crud.ISO-8859-1.properties 
     117  crud.UTF-8.properties 
     118  dao.ISO-8859-1.properties 
     119  dao.UTF-8.properties 
     120  daoxml.ISO-8859-1.properties 
     121  daoxml.UTF-8.properties 
     122  db.ISO-8859-1.properties 
     123  db.UTF-8.properties 
     124  errors.ISO-8859-1.properties 
     125  errors.UTF-8.properties 
    93126  format.ISO-8859-1.properties 
     127  format.UTF-8.properties 
    94128  formserr.ISO-8859-1.properties 
     129  formserr.UTF-8.properties 
    95130  jelix.ISO-8859-1.properties 
     131  jelix.UTF-8.properties 
     132  ui.ISO-8859-1.properties 
     133  ui.UTF-8.properties 
     134cd lib/jelix/core-modules/jelix/locales/fr_FR 
     135  auth.ISO-8859-1.properties 
     136  auth.UTF-8.properties 
     137  common.ISO-8859-1.properties 
     138  common.UTF-8.properties 
     139  crud.ISO-8859-1.properties 
     140  crud.UTF-8.properties 
     141  dao.ISO-8859-1.properties 
     142  dao.UTF-8.properties 
     143  daoxml.ISO-8859-1.properties 
     144  daoxml.UTF-8.properties 
     145  db.ISO-8859-1.properties 
     146  db.UTF-8.properties 
    96147  errors.ISO-8859-1.properties 
     148  errors.UTF-8.properties 
     149  format.ISO-8859-1.properties 
     150  format.UTF-8.properties 
     151  formserr.ISO-8859-1.properties 
     152  formserr.UTF-8.properties 
     153  jelix.ISO-8859-1.properties 
     154  jelix.UTF-8.properties 
    97155  ui.ISO-8859-1.properties 
    98   auth.ISO-8859-1.properties 
    99   dao.UTF-8.properties 
    100   daoxml.UTF-8.properties 
    101   db.UTF-8.properties 
    102   common.UTF-8.properties 
    103   format.UTF-8.properties 
    104   formserr.UTF-8.properties 
    105   jelix.UTF-8.properties 
    106   errors.UTF-8.properties 
    107156  ui.UTF-8.properties 
    108   auth.ISO-8859-1.properties 
    109 cd lib/jelix/core-modules/jelix/locales/en_EN 
    110   dao.ISO-8859-1.properties 
    111   daoxml.ISO-8859-1.properties 
    112   db.ISO-8859-1.properties 
    113   common.ISO-8859-1.properties 
    114   format.ISO-8859-1.properties 
    115   formserr.ISO-8859-1.properties 
    116   jelix.ISO-8859-1.properties 
    117   errors.ISO-8859-1.properties 
    118   ui.ISO-8859-1.properties 
    119   auth.ISO-8859-1.properties 
    120   dao.UTF-8.properties 
    121   daoxml.UTF-8.properties 
    122   db.UTF-8.properties 
    123   common.UTF-8.properties 
    124   format.UTF-8.properties 
    125   formserr.UTF-8.properties 
    126   jelix.UTF-8.properties 
    127   errors.UTF-8.properties 
    128   ui.UTF-8.properties 
    129   auth.ISO-8859-1.properties 
    130 cd lib/jelix/core-modules/jelix/locales/fr_FR 
    131   dao.ISO-8859-1.properties 
    132   daoxml.ISO-8859-1.properties 
    133   db.ISO-8859-1.properties 
    134   common.ISO-8859-1.properties 
    135   format.ISO-8859-1.properties 
    136   formserr.ISO-8859-1.properties 
    137   jelix.ISO-8859-1.properties 
    138   errors.ISO-8859-1.properties 
    139   ui.ISO-8859-1.properties 
    140   auth.ISO-8859-1.properties 
    141   dao.UTF-8.properties 
    142   daoxml.UTF-8.properties 
    143   db.UTF-8.properties 
    144   common.UTF-8.properties 
    145   format.UTF-8.properties 
    146   formserr.UTF-8.properties 
    147   jelix.UTF-8.properties 
    148   errors.UTF-8.properties 
    149   ui.UTF-8.properties 
    150   auth.UTF-8.properties 
    151157cd lib/jelix/core-modules/jelix/templates 
    152158  404.xul.tpl 
  • trunk/build/manifests/testapp.mn

    r569 r571  
    3636  config.dao.xml 
    3737  testnews.dao.xml 
     38  products.dao.xml 
    3839cd testapp/modules/testapp/controllers 
    3940  main.classic.php 
  • trunk/build/manifests/testapp.mn

    r569 r571  
    3636  config.dao.xml 
    3737  testnews.dao.xml 
     38  products.dao.xml 
    3839cd testapp/modules/testapp/controllers 
    3940  main.classic.php 
  • trunk/lib/jelix/controllers/jControllerDaoCrud.class.php

    r570 r571  
    8585    protected $pseudoFormId = 'jelix_crud_roxor'; 
    8686 
     87 
     88    protected $uploadsDirectory =''; 
     89 
    8790    /** 
    8891     * Returned a simple html response to display CRUD contents. You can override this 
     
    182185        if($form->check() && $this->_checkDatas($form)){ 
    183186            $id = $form->saveToDao($this->dao); 
     187            $form->saveAllFiles($this->uploadsDirectory); 
    184188            $rep->action = $this->_getAction('view'); 
    185189            jForms::destroy($this->form); 
     
    257261        if($form->check() && $this->_checkDatas($form)){ 
    258262            $id = $form->saveToDao($this->dao); 
     263            $form->saveAllFiles($this->uploadsDirectory); 
    259264            $rep->action = $this->_getAction('view'); 
    260265            jForms::destroy($this->form, $id); 
  • trunk/lib/jelix/controllers/jControllerDaoCrud.class.php

    r570 r571  
    8585    protected $pseudoFormId = 'jelix_crud_roxor'; 
    8686 
     87 
     88    protected $uploadsDirectory =''; 
     89 
    8790    /** 
    8891     * Returned a simple html response to display CRUD contents. You can override this 
     
    182185        if($form->check() && $this->_checkDatas($form)){ 
    183186            $id = $form->saveToDao($this->dao); 
     187            $form->saveAllFiles($this->uploadsDirectory); 
    184188            $rep->action = $this->_getAction('view'); 
    185189            jForms::destroy($this->form); 
     
    257261        if($form->check() && $this->_checkDatas($form)){ 
    258262            $id = $form->saveToDao($this->dao); 
     263            $form->saveAllFiles($this->uploadsDirectory); 
    259264            $rep->action = $this->_getAction('view'); 
    260265            jForms::destroy($this->form, $id); 
  • trunk/lib/jelix/core-modules/jelix/templates/crud_edit.tpl

    r568 r571  
    11{if $id === null} 
    22 
    3 <h1>Create a new record</h1> 
     3<h1>{@jelix~crud.title.create@}</h1> 
    44{formfull $form, $submitAction} 
    55 
    66{else} 
    77 
    8 <h1>Edit a record</h1> 
     8<h1>{@jelix~crud.title.update@}</h1> 
    99{formfull $form, $submitAction, array('id'=>$id)} 
    1010 
     
    1313 
    1414 
    15 <p><a href="{jurl $listAction}">Return to the list</a>.</p> 
     15<p><a href="{jurl $listAction}" class="crud-link">{@jelix~crud.link.return.to.list@}</a>.</p> 
  • trunk/lib/jelix/core-modules/jelix/templates/crud_edit.tpl

    r568 r571  
    11{if $id === null} 
    22 
    3 <h1>Create a new record</h1> 
     3<h1>{@jelix~crud.title.create@}</h1> 
    44{formfull $form, $submitAction} 
    55 
    66{else} 
    77 
    8 <h1>Edit a record</h1> 
     8<h1>{@jelix~crud.title.update@}</h1> 
    99{formfull $form, $submitAction, array('id'=>$id)} 
    1010 
     
    1313 
    1414 
    15 <p><a href="{jurl $listAction}">Return to the list</a>.</p> 
     15<p><a href="{jurl $listAction}" class="crud-link">{@jelix~crud.link.return.to.list@}</a>.</p> 
  • trunk/lib/jelix/core-modules/jelix/templates/crud_list.tpl

    r570 r571  
    1 <h1>List</h1> 
     1<h1>{@jelix~crud.title.list@}</h1> 
    22 
    3 <table
     3<table class="crud-record-list"
    44{foreach $list as $record} 
    55<tr> 
     
    88    {/foreach} 
    99    <td> 
    10         <a href="{jurl $viewAction,array('id'=>$record->$primarykey)}">View</a> 
     10        <a href="{jurl $viewAction,array('id'=>$record->$primarykey)}">{@jelix~crud.link.view.record@}</a> 
    1111    </td> 
    1212</tr> 
    1313{/foreach} 
    1414</table> 
    15 <p>Pages : {pagelinks $listAction, array(),  $recordCount, $page, $listPageSize, $offsetParameterName }</p> 
    16 <p><a href="{jurl $createAction}">Create a new record</a>.</p> 
     15<p class="crud-pages">Pages : {pagelinks $listAction, array(),  $recordCount, $page, $listPageSize, $offsetParameterName }</p> 
     16<p><a href="{jurl $createAction}" class="crud-link">{@jelix~crud.link.create.record@}</a>.</p> 
    1717 
  • trunk/lib/jelix/core-modules/jelix/templates/crud_list.tpl

    r570 r571  
    1 <h1>List</h1> 
     1<h1>{@jelix~crud.title.list@}</h1> 
    22 
    3 <table
     3<table class="crud-record-list"
    44{foreach $list as $record} 
    55<tr> 
     
    88    {/foreach} 
    99    <td> 
    10         <a href="{jurl $viewAction,array('id'=>$record->$primarykey)}">View</a> 
     10        <a href="{jurl $viewAction,array('id'=>$record->$primarykey)}">{@jelix~crud.link.view.record@}</a> 
    1111    </td> 
    1212</tr> 
    1313{/foreach} 
    1414</table> 
    15 <p>Pages : {pagelinks $listAction, array(),  $recordCount, $page, $listPageSize, $offsetParameterName }</p> 
    16 <p><a href="{jurl $createAction}">Create a new record</a>.</p> 
     15<p class="crud-pages">Pages : {pagelinks $listAction, array(),  $recordCount, $page, $listPageSize, $offsetParameterName }</p> 
     16<p><a href="{jurl $createAction}" class="crud-link">{@jelix~crud.link.create.record@}</a>.</p> 
    1717 
  • trunk/lib/jelix/core-modules/jelix/templates/crud_view.tpl

    r568 r571  
    1 <h1>View of a record</h1> 
     1<h1>{@jelix~crud.title.view@}</h1> 
    22{formdatasfull $form} 
    33 
    44 
    55<ul> 
    6     <li><a href="{jurl $editAction, array('id'=>$id)}">Edit this record</a></li> 
    7     <li><a href="{jurl $deleteAction, array('id'=>$id)}">Delete this record</a></li> 
    8     <li><a href="{jurl $listAction}">Return to the list</a></li> 
     6    <li><a href="{jurl $editAction, array('id'=>$id)}" class="crud-link">{@jelix~crud.link.edit.record@}</a></li> 
     7    <li><a href="{jurl $deleteAction, array('id'=>$id)}" class="crud-link" onclick="return confirm('{@jelix~crud.confirm.deletion@}')">{@jelix~crud.link.delete.record@}</a></li> 
     8    <li><a href="{jurl $listAction}" class="crud-link">{@jelix~crud.link.return.to.list@}</a></li> 
    99</ul> 
    1010 
  • trunk/lib/jelix/core-modules/jelix/templates/crud_view.tpl

    r568 r571  
    1 <h1>View of a record</h1> 
     1<h1>{@jelix~crud.title.view@}</h1> 
    22{formdatasfull $form} 
    33 
    44 
    55<ul> 
    6     <li><a href="{jurl $editAction, array('id'=>$id)}">Edit this record</a></li> 
    7     <li><a href="{jurl $deleteAction, array('id'=>$id)}">Delete this record</a></li> 
    8     <li><a href="{jurl $listAction}">Return to the list</a></li> 
     6    <li><a href="{jurl $editAction, array('id'=>$id)}" class="crud-link">{@jelix~crud.link.edit.record@}</a></li> 
     7    <li><a href="{jurl $deleteAction, array('id'=>$id)}" class="crud-link" onclick="return confirm('{@jelix~crud.confirm.deletion@}')">{@jelix~crud.link.delete.record@}</a></li> 
     8    <li><a href="{jurl $listAction}" class="crud-link">{@jelix~crud.link.return.to.list@}</a></li> 
    99</ul> 
    1010 
  • trunk/lib/jelix/forms/jFormsBase.class.php

    r567 r571  
    432432            $path = JELIX_APP_VAR_PATH.'uploads/'.$this->_sel.'/'; 
    433433 
    434         jFile::createDir($path); 
    435  
    436434        if(!isset($this->_controls[$controlName]) || $this->_controls[$controlName]->type != 'upload') 
    437435            throw new jExceptionForms('jelix~formserr.invalid.upload.control.name', array($controlName, $this->_sel)); 
     
    443441            return false; 
    444442        } 
     443        jFile::createDir($path); 
    445444        move_uploaded_file($_FILES[$controlName]['tmp_name'], $path); 
    446445        return true; 
     
    458457            $path = JELIX_APP_VAR_PATH.'uploads/'.$this->_sel.'/'; 
    459458 
    460         jFile::createDir($path); 
     459        if(count($this->_uploads)) 
     460            jFile::createDir($path); 
    461461 
    462462        foreach($this->_uploads as $ref=>$ctrl){ 
     
    487487        } 
    488488    } 
    489  
    490  
    491  
    492489} 
    493490 
    494  
    495491?> 
  • trunk/lib/jelix/forms/jFormsBase.class.php

    r567 r571  
    432432            $path = JELIX_APP_VAR_PATH.'uploads/'.$this->_sel.'/'; 
    433433 
    434         jFile::createDir($path); 
    435  
    436434        if(!isset($this->_controls[$controlName]) || $this->_controls[$controlName]->type != 'upload') 
    437435            throw new jExceptionForms('jelix~formserr.invalid.upload.control.name', array($controlName, $this->_sel)); 
     
    443441            return false; 
    444442        } 
     443        jFile::createDir($path); 
    445444        move_uploaded_file($_FILES[$controlName]['tmp_name'], $path); 
    446445        return true; 
     
    458457            $path = JELIX_APP_VAR_PATH.'uploads/'.$this->_sel.'/'; 
    459458 
    460         jFile::createDir($path); 
     459        if(count($this->_uploads)) 
     460            jFile::createDir($path); 
    461461 
    462462        foreach($this->_uploads as $ref=>$ctrl){ 
     
    487487        } 
    488488    } 
    489  
    490  
    491  
    492489} 
    493490 
    494  
    495491?> 
  • trunk/lib/jelix/tpl/jTplCompiler.class.php

    r538 r571  
    4141       T_CONST, T_CONTINUE, T_DECLARE, T_DEFAULT, T_DO, T_ECHO, T_ELSE, T_ELSEIF, T_EMPTY, 
    4242       T_EXIT, T_FINAL, T_FOR, T_FOREACH, T_FUNCTION, T_GLOBAL, T_IF, T_IMPLEMENTS, T_INSTANCEOF, 
    43        T_INTERFACE, T_LOGICAL_AND, T_LOGICAL_OR, T_LOGICAL_XOR, T_NEW, T_PRIVATE, T_PUBLIC, 
     43       T_INTERFACE, T_LIST, T_LOGICAL_AND, T_LOGICAL_OR, T_LOGICAL_XOR, T_NEW, T_PRIVATE, T_PUBLIC, 
    4444       T_PROTECTED, T_RETURN, T_STATIC, T_SWITCH, T_THROW, T_TRY, T_USE, T_VAR, T_WHILE, 
    4545       T_DNUMBER, T_LNUMBER); 
  • trunk/lib/jelix/tpl/jTplCompiler.class.php

    r538 r571  
    4141       T_CONST, T_CONTINUE, T_DECLARE, T_DEFAULT, T_DO, T_ECHO, T_ELSE, T_ELSEIF, T_EMPTY, 
    4242       T_EXIT, T_FINAL, T_FOR, T_FOREACH, T_FUNCTION, T_GLOBAL, T_IF, T_IMPLEMENTS, T_INSTANCEOF, 
    43        T_INTERFACE, T_LOGICAL_AND, T_LOGICAL_OR, T_LOGICAL_XOR, T_NEW, T_PRIVATE, T_PUBLIC, 
     43       T_INTERFACE, T_LIST, T_LOGICAL_AND, T_LOGICAL_OR, T_LOGICAL_XOR, T_NEW, T_PRIVATE, T_PUBLIC, 
    4444       T_PROTECTED, T_RETURN, T_STATIC, T_SWITCH, T_THROW, T_TRY, T_USE, T_VAR, T_WHILE, 
    4545       T_DNUMBER, T_LNUMBER); 
  • trunk/testapp/install/install.mysql.sql

    r504 r571  
    121121('test', '33'); 
    122122 
    123  
     123-- for unit tests 
    124124CREATE TABLE `product_test` ( 
    125125`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , 
     
    133133PRIMARY KEY ( `product_id` , `tag` ) 
    134134) ENGINE = MYISAM ; 
     135 
     136-- for the crud example 
     137CREATE TABLE `products` ( 
     138`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , 
     139`name` VARCHAR( 150 ) NOT NULL , 
     140`price` FLOAT NOT NULL 
     141) TYPE = MYISAM ; 
  • trunk/testapp/install/install.mysql.sql

    r504 r571  
    121121('test', '33'); 
    122122 
    123  
     123-- for unit tests 
    124124CREATE TABLE `product_test` ( 
    125125`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , 
     
    133133PRIMARY KEY ( `product_id` , `tag` ) 
    134134) ENGINE = MYISAM ; 
     135 
     136-- for the crud example 
     137CREATE TABLE `products` ( 
     138`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , 
     139`name` VARCHAR( 150 ) NOT NULL , 
     140`price` FLOAT NOT NULL 
     141) TYPE = MYISAM ; 
  • trunk/testapp/modules/jelix_tests/tests/jtpl.expressions_parsing.html_cli.php

    r539 r571  
    7676        '@aa~trc.234.popo@'=>'jLocale::get(\'aa~trc.234.popo\')', 
    7777        '@aa~trc.23.4.popo@'=>'jLocale::get(\'aa~trc.23.4.popo\')', 
     78        '@aa~trc.23.4.list@'=>'jLocale::get(\'aa~trc.23.4.list\')', 
    7879        '$aa*count($bb)'=>'$t->_vars[\'aa\']*count($t->_vars[\'bb\'])', 
    7980        '$aa & $bb'=>'$t->_vars[\'aa\'] & $t->_vars[\'bb\']', 
  • trunk/testapp/modules/jelix_tests/tests/jtpl.expressions_parsing.html_cli.php

    r539 r571  
    7676        '@aa~trc.234.popo@'=>'jLocale::get(\'aa~trc.234.popo\')', 
    7777        '@aa~trc.23.4.popo@'=>'jLocale::get(\'aa~trc.23.4.popo\')', 
     78        '@aa~trc.23.4.list@'=>'jLocale::get(\'aa~trc.23.4.list\')', 
    7879        '$aa*count($bb)'=>'$t->_vars[\'aa\']*count($t->_vars[\'bb\'])', 
    7980        '$aa & $bb'=>'$t->_vars[\'aa\'] & $t->_vars[\'bb\']', 
  • trunk/testapp/modules/testapp/controllers/samplecrud.classic.php

    r570 r571  
    1717    protected $listPageSize = 5; 
    1818 
    19     protected $dao = 'jelix_tests~products'; 
     19    protected $dao = 'testapp~products'; 
    2020 
    2121    protected $form = 'testapp~products'; 
  • trunk/testapp/modules/testapp/controllers/samplecrud.classic.php

    r570 r571  
    1717    protected $listPageSize = 5; 
    1818 
    19     protected $dao = 'jelix_tests~products'; 
     19    protected $dao = 'testapp~products'; 
    2020 
    2121    protected $form = 'testapp~products'; 
Download in other formats: Unified Diff Zip Archive