Changeset 973
- Timestamp:
- 05/31/08 23:33:42 (6 months ago)
- Files:
-
- trunk/lib/jelix/docs/ns/jforms_1.1.rng (modified) (1 diff)
- trunk/lib/jelix/docs/ns/jforms_1.1.rng (modified) (1 diff)
- trunk/lib/jelix/docs/ns/jforms_1.1.rng (modified) (1 diff)
- trunk/lib/jelix/docs/ns/jforms_1.1.rng (modified) (1 diff)
- trunk/lib/jelix/forms/jFormsCompiler_jf_1_1.class.php (modified) (2 diffs)
- trunk/lib/jelix/forms/jFormsCompiler_jf_1_1.class.php (modified) (2 diffs)
- trunk/lib/jelix/forms/jFormsCompiler_jf_1_1.class.php (modified) (2 diffs)
- trunk/lib/jelix/forms/jFormsCompiler_jf_1_1.class.php (modified) (2 diffs)
- trunk/lib/jelix/forms/jFormsDatasource.class.php (modified) (4 diffs)
- trunk/lib/jelix/forms/jFormsDatasource.class.php (modified) (4 diffs)
- trunk/lib/jelix/forms/jFormsDatasource.class.php (modified) (4 diffs)
- trunk/lib/jelix/forms/jFormsDatasource.class.php (modified) (4 diffs)
- trunk/testapp/modules/jelix_tests/daos/products.dao.xml (modified) (1 diff)
- trunk/testapp/modules/jelix_tests/daos/products.dao.xml (modified) (1 diff)
- trunk/testapp/modules/jelix_tests/daos/products.dao.xml (modified) (1 diff)
- trunk/testapp/modules/jelix_tests/daos/products.dao.xml (modified) (1 diff)
- trunk/testapp/modules/jelix_tests/tests/jforms.compiler.html_cli.php (modified) (7 diffs)
- trunk/testapp/modules/jelix_tests/tests/jforms.compiler.html_cli.php (modified) (7 diffs)
- trunk/testapp/modules/jelix_tests/tests/jforms.compiler.html_cli.php (modified) (7 diffs)
- trunk/testapp/modules/jelix_tests/tests/jforms.compiler.html_cli.php (modified) (7 diffs)
- trunk/testapp/modules/jelix_tests/tests/jforms.htmlbuilder.html_cli.php (modified) (3 diffs)
- trunk/testapp/modules/jelix_tests/tests/jforms.htmlbuilder.html_cli.php (modified) (3 diffs)
- trunk/testapp/modules/jelix_tests/tests/jforms.htmlbuilder.html_cli.php (modified) (3 diffs)
- trunk/testapp/modules/jelix_tests/tests/jforms.htmlbuilder.html_cli.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/jelix/docs/ns/jforms_1.1.rng
r959 r973 313 313 <attribute name="daomethod" /> 314 314 <attribute name="labelproperty" /> 315 <optional><attribute name="labelseparator" /></optional> 315 316 <optional><attribute name="valueproperty" /></optional> 316 317 <optional> trunk/lib/jelix/docs/ns/jforms_1.1.rng
r959 r973 313 313 <attribute name="daomethod" /> 314 314 <attribute name="labelproperty" /> 315 <optional><attribute name="labelseparator" /></optional> 315 316 <optional><attribute name="valueproperty" /></optional> 316 317 <optional> trunk/lib/jelix/docs/ns/jforms_1.1.rng
r959 r973 313 313 <attribute name="daomethod" /> 314 314 <attribute name="labelproperty" /> 315 <optional><attribute name="labelseparator" /></optional> 315 316 <optional><attribute name="valueproperty" /></optional> 316 317 <optional> trunk/lib/jelix/docs/ns/jforms_1.1.rng
r959 r973 313 313 <attribute name="daomethod" /> 314 314 <attribute name="labelproperty" /> 315 <optional><attribute name="labelseparator" /></optional> 315 316 <optional><attribute name="valueproperty" /></optional> 316 317 <optional> trunk/lib/jelix/forms/jFormsCompiler_jf_1_1.class.php
r959 r973 103 103 if(isset($attrs['dao'])) { 104 104 if ( isset($attrs['profile'])) 105 $profile = ' \''.$attrs['profile'].'\'';105 $profile = ',\''.$attrs['profile'].'\''; 106 106 else 107 $profile = ' \'\'';107 $profile = ',\'\''; 108 108 if(isset($attrs['valueproperty'])) { 109 109 $daovalue = $attrs['valueproperty']; … … 116 116 117 117 if(isset($attrs['criteria'])) 118 $criteria=',\''.$attrs['criteria'].'\' ';118 $criteria=',\''.$attrs['criteria'].'\',null'; 119 119 elseif(isset($attrs['criteriafrom'])) 120 120 $criteria=',null,\''.$attrs['criteriafrom'].'\''; 121 121 else 122 $criteria=''; 122 $criteria=',null,null'; 123 if ( isset($attrs['labelseparator'])) 124 $labelSeparator = ',\''.$attrs['labelseparator'].'\''; 125 else 126 $labelSeparator = ''; 123 127 124 128 $source[]='$ctrl->datasource = new jFormsDaoDatasource(\''.$attrs['dao'].'\',\''. 125 $attrs['method'].'\',\''.$attrs['labelproperty'].'\',\''.$daovalue.'\' ,'.$profile.$criteria.');';129 $attrs['method'].'\',\''.$attrs['labelproperty'].'\',\''.$daovalue.'\''.$profile.$criteria.$labelSeparator.');'; 126 130 if($controltype == 'submit'){ 127 131 $source[]='$ctrl->standalone=false;'; trunk/lib/jelix/forms/jFormsCompiler_jf_1_1.class.php
r959 r973 103 103 if(isset($attrs['dao'])) { 104 104 if ( isset($attrs['profile'])) 105 $profile = ' \''.$attrs['profile'].'\'';105 $profile = ',\''.$attrs['profile'].'\''; 106 106 else 107 $profile = ' \'\'';107 $profile = ',\'\''; 108 108 if(isset($attrs['valueproperty'])) { 109 109 $daovalue = $attrs['valueproperty']; … … 116 116 117 117 if(isset($attrs['criteria'])) 118 $criteria=',\''.$attrs['criteria'].'\' ';118 $criteria=',\''.$attrs['criteria'].'\',null'; 119 119 elseif(isset($attrs['criteriafrom'])) 120 120 $criteria=',null,\''.$attrs['criteriafrom'].'\''; 121 121 else 122 $criteria=''; 122 $criteria=',null,null'; 123 if ( isset($attrs['labelseparator'])) 124 $labelSeparator = ',\''.$attrs['labelseparator'].'\''; 125 else 126 $labelSeparator = ''; 123 127 124 128 $source[]='$ctrl->datasource = new jFormsDaoDatasource(\''.$attrs['dao'].'\',\''. 125 $attrs['method'].'\',\''.$attrs['labelproperty'].'\',\''.$daovalue.'\' ,'.$profile.$criteria.');';129 $attrs['method'].'\',\''.$attrs['labelproperty'].'\',\''.$daovalue.'\''.$profile.$criteria.$labelSeparator.');'; 126 130 if($controltype == 'submit'){ 127 131 $source[]='$ctrl->standalone=false;'; trunk/lib/jelix/forms/jFormsCompiler_jf_1_1.class.php
r959 r973 103 103 if(isset($attrs['dao'])) { 104 104 if ( isset($attrs['profile'])) 105 $profile = ' \''.$attrs['profile'].'\'';105 $profile = ',\''.$attrs['profile'].'\''; 106 106 else 107 $profile = ' \'\'';107 $profile = ',\'\''; 108 108 if(isset($attrs['valueproperty'])) { 109 109 $daovalue = $attrs['valueproperty']; … … 116 116 117 117 if(isset($attrs['criteria'])) 118 $criteria=',\''.$attrs['criteria'].'\' ';118 $criteria=',\''.$attrs['criteria'].'\',null'; 119 119 elseif(isset($attrs['criteriafrom'])) 120 120 $criteria=',null,\''.$attrs['criteriafrom'].'\''; 121 121 else 122 $criteria=''; 122 $criteria=',null,null'; 123 if ( isset($attrs['labelseparator'])) 124 $labelSeparator = ',\''.$attrs['labelseparator'].'\''; 125 else 126 $labelSeparator = ''; 123 127 124 128 $source[]='$ctrl->datasource = new jFormsDaoDatasource(\''.$attrs['dao'].'\',\''. 125 $attrs['method'].'\',\''.$attrs['labelproperty'].'\',\''.$daovalue.'\' ,'.$profile.$criteria.');';129 $attrs['method'].'\',\''.$attrs['labelproperty'].'\',\''.$daovalue.'\''.$profile.$criteria.$labelSeparator.');'; 126 130 if($controltype == 'submit'){ 127 131 $source[]='$ctrl->standalone=false;'; trunk/lib/jelix/forms/jFormsCompiler_jf_1_1.class.php
r959 r973 103 103 if(isset($attrs['dao'])) { 104 104 if ( isset($attrs['profile'])) 105 $profile = ' \''.$attrs['profile'].'\'';105 $profile = ',\''.$attrs['profile'].'\''; 106 106 else 107 $profile = ' \'\'';107 $profile = ',\'\''; 108 108 if(isset($attrs['valueproperty'])) { 109 109 $daovalue = $attrs['valueproperty']; … … 116 116 117 117 if(isset($attrs['criteria'])) 118 $criteria=',\''.$attrs['criteria'].'\' ';118 $criteria=',\''.$attrs['criteria'].'\',null'; 119 119 elseif(isset($attrs['criteriafrom'])) 120 120 $criteria=',null,\''.$attrs['criteriafrom'].'\''; 121 121 else 122 $criteria=''; 122 $criteria=',null,null'; 123 if ( isset($attrs['labelseparator'])) 124 $labelSeparator = ',\''.$attrs['labelseparator'].'\''; 125 else 126 $labelSeparator = ''; 123 127 124 128 $source[]='$ctrl->datasource = new jFormsDaoDatasource(\''.$attrs['dao'].'\',\''. 125 $attrs['method'].'\',\''.$attrs['labelproperty'].'\',\''.$daovalue.'\' ,'.$profile.$criteria.');';129 $attrs['method'].'\',\''.$attrs['labelproperty'].'\',\''.$daovalue.'\''.$profile.$criteria.$labelSeparator.');'; 126 130 if($controltype == 'submit'){ 127 131 $source[]='$ctrl->standalone=false;'; trunk/lib/jelix/forms/jFormsDatasource.class.php
r959 r973 79 79 protected $selector; 80 80 protected $method; 81 protected $labelProperty; 81 protected $labelProperty = array(); 82 protected $labelSeparator; 82 83 protected $keyProperty; 83 84 protected $profile; 84 85 85 protected $criteria ;86 protected $criteriaF orm;86 protected $criteria = null; 87 protected $criteriaFrom = null ; 87 88 88 89 protected $dao = null; 89 90 90 function __construct ($selector ,$method , $label, $key, $profile='', $criteria=null, $criteriaFrom=null ){91 function __construct ($selector ,$method , $label, $key, $profile='', $criteria=null, $criteriaFrom=null, $labelSeparator=''){ 91 92 $this->selector = $selector; 92 93 $this->profile = $profile; 93 94 $this->method = $method ; 94 $this->labelProperty = $label; 95 $this->criteria = $criteria; 96 $this->criteriaFrom = $criteriaFrom; 95 $this->labelProperty = preg_split('/[\s,]+/',$label); 96 $this->labelSeparator = $labelSeparator; 97 if ( $criteria !== null ) 98 $this->criteria = preg_split('/[\s,]+/',$criteria) ; 99 if ( $criteriaFrom !== null ) 100 $this->criteriaFrom = preg_split('/[\s,]+/',$criteriaFrom) ; 97 101 if($key == ''){ 98 102 $rec = jDao::createRecord($this->selector, $this->profile); … … 107 111 $this->dao = jDao::get($this->selector, $this->profile); 108 112 if($this->criteria !== null) { 109 $found = $this->dao->{$this->method}($this->criteria);113 $found = call_user_func_array( array($this->dao, $this->method), $this->criteria); 110 114 } else if ($this->criteriaFrom !== null) { 111 $found = $this->dao->{$this->method}($form->getData($this->criteriaFrom)); 115 $args = array() ; 116 foreach( (array)$this->criteriaFrom as $criteria ) { 117 array_push( $args, $form->getData($criteria) ) ; 118 } 119 $found = call_user_func_array( array($this->dao, $this->method), $args); 112 120 } else { 113 121 $found = $this->dao->{$this->method}(); … … 115 123 $result=array(); 116 124 foreach($found as $obj){ 117 $result[$obj->{$this->keyProperty}] = $obj->{$this->labelProperty}; 125 $label = '' ; 126 foreach( (array)$this->labelProperty as $property ) { 127 if (!empty( $obj->{$property})) 128 $label .= $obj->{$property}.$this->labelSeparator; 129 } 130 if ($this->labelSeparator != '') 131 $label = substr($label, 0, -strlen($this->labelSeparator)); 132 $result[$obj->{$this->keyProperty}] = $label ; 118 133 } 119 134 return $result; … … 123 138 if($this->dao === null) $this->dao = jDao::get($this->selector, $this->profile); 124 139 $rec = $this->dao->get($key); 125 if($rec) 126 return $rec->{$this->labelProperty}; 140 if($rec) { 141 $label = '' ; 142 foreach( (array)$this->labelProperty as $property ) { 143 if (!empty( $rec->{$property})) 144 $label .= $rec->{$property}.$this->labelSeparator; 145 } 146 if ($this->labelSeparator != '') 147 $label = substr($label, 0, -strlen($this->labelSeparator)); 148 return $label ; 149 } 127 150 else 128 151 return null; trunk/lib/jelix/forms/jFormsDatasource.class.php
r959 r973 79 79 protected $selector; 80 80 protected $method; 81 protected $labelProperty; 81 protected $labelProperty = array(); 82 protected $labelSeparator; 82 83 protected $keyProperty; 83 84 protected $profile; 84 85 85 protected $criteria ;86 protected $criteriaF orm;86 protected $criteria = null; 87 protected $criteriaFrom = null ; 87 88 88 89 protected $dao = null; 89 90 90 function __construct ($selector ,$method , $label, $key, $profile='', $criteria=null, $criteriaFrom=null ){91 function __construct ($selector ,$method , $label, $key, $profile='', $criteria=null, $criteriaFrom=null, $labelSeparator=''){ 91 92 $this->selector = $selector; 92 93 $this->profile = $profile; 93 94 $this->method = $method ; 94 $this->labelProperty = $label; 95 $this->criteria = $criteria; 96 $this->criteriaFrom = $criteriaFrom; 95 $this->labelProperty = preg_split('/[\s,]+/',$label); 96 $this->labelSeparator = $labelSeparator; 97 if ( $criteria !== null ) 98 $this->criteria = preg_split('/[\s,]+/',$criteria) ; 99 if ( $criteriaFrom !== null ) 100 $this->criteriaFrom = preg_split('/[\s,]+/',$criteriaFrom) ; 97 101 if($key == ''){ 98 102 $rec = jDao::createRecord($this->selector, $this->profile); … … 107 111 $this->dao = jDao::get($this->selector, $this->profile); 108 112 if($this->criteria !== null) { 109 $found = $this->dao->{$this->method}($this->criteria);113 $found = call_user_func_array( array($this->dao, $this->method), $this->criteria); 110 114 } else if ($this->criteriaFrom !== null) { 111 $found = $this->dao->{$this->method}($form->getData($this->criteriaFrom)); 115 $args = array() ; 116 foreach( (array)$this->criteriaFrom as $criteria ) { 117 array_push( $args, $form->getData($criteria) ) ; 118 } 119 $found = call_user_func_array( array($this->dao, $this->method), $args); 112 120 } else { 113 121 $found = $this->dao->{$this->method}(); … … 115 123 $result=array(); 116 124 foreach($found as $obj){ 117 $result[$obj->{$this->keyProperty}] = $obj->{$this->labelProperty}; 125 $label = '' ; 126 foreach( (array)$this->labelProperty as $property ) { 127 if (!empty( $obj->{$property})) 128 $label .= $obj->{$property}.$this->labelSeparator; 129 } 130 if ($this->labelSeparator != '') 131 $label = substr($label, 0, -strlen($this->labelSeparator)); 132 $result[$obj->{$this->keyProperty}] = $label ; 118 133 } 119 134 return $result; … … 123 138 if($this->dao === null) $this->dao = jDao::get($this->selector, $this->profile); 124 139 $rec = $this->dao->get($key); 125 if($rec) 126 return $rec->{$this->labelProperty}; 140 if($rec) { 141 $label = '' ; 142 foreach( (array)$this->labelProperty as $property ) { 143 if (!empty( $rec->{$property})) 144 $label .= $rec->{$property}.$this->labelSeparator; 145 } 146 if ($this->labelSeparator != '') 147 $label = substr($label, 0, -strlen($this->labelSeparator)); 148 return $label ; 149 } 127 150 else 128 151 return null; trunk/lib/jelix/forms/jFormsDatasource.class.php
r959 r973 79 79 protected $selector; 80 80 protected $method; 81 protected $labelProperty; 81 protected $labelProperty = array(); 82 protected $labelSeparator; 82 83 protected $keyProperty; 83 84 protected $profile; 84 85 85 protected $criteria ;86 protected $criteriaF orm;86 protected $criteria = null; 87 protected $criteriaFrom = null ; 87 88 88 89 protected $dao = null; 89 90 90 function __construct ($selector ,$method , $label, $key, $profile='', $criteria=null, $criteriaFrom=null ){91 function __construct ($selector ,$method , $label, $key, $profile='', $criteria=null, $criteriaFrom=null, $labelSeparator=''){ 91 92 $this->selector = $selector; 92 93 $this->profile = $profile; 93 94 $this->method = $method ; 94 $this->labelProperty = $label; 95 $this->criteria = $criteria; 96 $this->criteriaFrom = $criteriaFrom; 95 $this->labelProperty = preg_split('/[\s,]+/',$label); 96 $this->labelSeparator = $labelSeparator; 97 if ( $criteria !== null ) 98 $this->criteria = preg_split('/[\s,]+/',$criteria) ; 99 if ( $criteriaFrom !== null ) 100 $this->criteriaFrom = preg_split('/[\s,]+/',$criteriaFrom) ; 97 101 if($key == ''){ 98 102 $rec = jDao::createRecord($this->selector, $this->profile); … … 107 111 $this->dao = jDao::get($this->selector, $this->profile); 108 112 if($this->criteria !== null) { 109 $found = $this->dao->{$this->method}($this->criteria);113 $found = call_user_func_array( array($this->dao, $this->method), $this->criteria); 110 114 } else if ($this->criteriaFrom !== null) { 111 $found = $this->dao->{$this->method}($form->getData($this->criteriaFrom)); 115 $args = array() ; 116 foreach( (array)$this->criteriaFrom as $criteria ) { 117 array_push( $args, $form->getData($criteria) ) ; 118 } 119 $found = call_user_func_array( array($this->dao, $this->method), $args); 112 120 } else { 113 121 $found = $this->dao->{$this->method}(); … … 115 123 $result=array(); 116 124 foreach($found as $obj){ 117 $result[$obj->{$this->keyProperty}] = $obj->{$this->labelProperty}; 125 $label = '' ; 126 foreach( (array)$this->labelProperty as $property ) { 127 if (!empty( $obj->{$property})) 128 $label .= $obj->{$property}.$this->labelSeparator; 129 } 130 if ($this->labelSeparator != '') 131 $label = substr($label, 0, -strlen($this->labelSeparator)); 132 $result[$obj->{$this->keyProperty}] = $label ; 118 133 } 119 134 return $result; … … 123 138 if($this->dao === null) $this->dao = jDao::get($this->selector, $this->profile); 124 139 $rec = $this->dao->get($key); 125 if($rec) 126 return $rec->{$this->labelProperty}; 140 if($rec) { 141 $label = '' ; 142 foreach( (array)$this->labelProperty as $property ) { 143 if (!empty( $rec->{$property})) 144 $label .= $rec->{$property}.$this->labelSeparator; 145 } 146 if ($this->labelSeparator != '') 147 $label = substr($label, 0, -strlen($this->labelSeparator)); 148 return $label ; 149 } 127 150 else 128 151 return null; trunk/lib/jelix/forms/jFormsDatasource.class.php
r959 r973 79 79 protected $selector; 80 80 protected $method; 81 protected $labelProperty; 81 protected $labelProperty = array(); 82 protected $labelSeparator; 82 83 protected $keyProperty; 83 84 protected $profile; 84 85 85 protected $criteria ;86 protected $criteriaF orm;86 protected $criteria = null; 87 protected $criteriaFrom = null ; 87 88 88 89 protected $dao = null; 89 90 90 function __construct ($selector ,$method , $label, $key, $profile='', $criteria=null, $criteriaFrom=null ){91 function __construct ($selector ,$method , $label, $key, $profile='', $criteria=null, $criteriaFrom=null, $labelSeparator=''){ 91 92 $this->selector = $selector; 92 93 $this->profile = $profile; 93 94 $this->method = $method ; 94 $this->labelProperty = $label; 95 $this->criteria = $criteria; 96 $this->criteriaFrom = $criteriaFrom; 95 $this->labelProperty = preg_split('/[\s,]+/',$label); 96 $this->labelSeparator = $labelSeparator; 97 if ( $criteria !== null ) 98 $this->criteria = preg_split('/[\s,]+/',$criteria) ; 99 if ( $criteriaFrom !== null ) 100 $this->criteriaFrom = preg_split('/[\s,]+/',$criteriaFrom) ; 97 101 if($key == ''){ 98 102 $rec = jDao::createRecord($this->selector, $this->profile); … … 107 111 $this->dao = jDao::get($this->selector, $this->profile); 108 112 if($this->criteria !== null) { 109 $found = $this->dao->{$this->method}($this->criteria);113 $found = call_user_func_array( array($this->dao, $this->method), $this->criteria); 110 114 } else if ($this->criteriaFrom !== null) { 111 $found = $this->dao->{$this->method}($form->getData($this->criteriaFrom)); 115 $args = array() ; 116 foreach( (array)$this->criteriaFrom as $criteria ) { 117 array_push( $args, $form->getData($criteria) ) ; 118 } 119 $found = call_user_func_array( array($this->dao, $this->method), $args); 112 120 } else { 113 121 $found = $this->dao->{$this->method}(); … … 115 123 $result=array(); 116 124 foreach($found as $obj){ 117 $result[$obj->{$this->keyProperty}] = $obj->{$this->labelProperty}; 125 $label = '' ; 126 foreach( (array)$this->labelProperty as $property ) { 127 if (!empty( $obj->{$property})) 128 $label .= $obj->{$property}.$this->labelSeparator; 129 } 130 if ($this->labelSeparator != '') 131 $label = substr($label, 0, -strlen($this->labelSeparator)); 132 $result[$obj->{$this->keyProperty}] = $label ; 118 133 } 119 134 return $result; … … 123 138 if($this->dao === null) $this->dao = jDao::get($this->selector, $this->profile); 124 139 $rec = $this->dao->get($key); 125 if($rec) 126 return $rec->{$this->labelProperty}; 140 if($rec) { 141 $label = '' ; 142 foreach( (array)$this->labelProperty as $property ) { 143 if (!empty( $rec->{$property})) 144 $label .= $rec->{$property}.$this->labelSeparator; 145 } 146 if ($this->labelSeparator != '') 147 $label = substr($label, 0, -strlen($this->labelSeparator)); 148 return $label ; 149 } 127 150 else 128 151 return null; trunk/testapp/modules/jelix_tests/daos/products.dao.xml
r895 r973 17 17 </conditions> 18 18 </method> 19 <method name="findBetweenId" type="select"> 20 <parameter name="minId" /> 21 <parameter name="maxId" /> 22 <conditions> 23 <gt property="id" expr="$minId" /> 24 <lt property="id" expr="$maxId" /> 25 </conditions> 26 </method> 19 27 </factory> 20 28 </dao> 21 trunk/testapp/modules/jelix_tests/daos/products.dao.xml
r895 r973 17 17 </conditions> 18 18 </method> 19 <method name="findBetweenId" type="select"> 20 <parameter name="minId" /> 21 <parameter name="maxId" /> 22 <conditions> 23 <gt property="id" expr="$minId" /> 24 <lt property="id" expr="$maxId" /> 25 </conditions> 26 </method> 19 27 </factory> 20 28 </dao> 21 trunk/testapp/modules/jelix_tests/daos/products.dao.xml
r895 r973 17 17 </conditions> 18 18 </method> 19 <method name="findBetweenId" type="select"> 20 <parameter name="minId" /> 21 <parameter name="maxId" /> 22 <conditions> 23 <gt property="id" expr="$minId" /> 24 <lt property="id" expr="$maxId" /> 25 </conditions> 26 </method> 19 27 </factory> 20 28 </dao> 21 trunk/testapp/modules/jelix_tests/daos/products.dao.xml
r895 r973 17 17 </conditions> 18 18 </method> 19 <method name="findBetweenId" type="select"> 20 <parameter name="minId" /> 21 <parameter name="maxId" /> 22 <conditions> 23 <gt property="id" expr="$minId" /> 24 <lt property="id" expr="$maxId" /> 25 </conditions> 26 </method> 19 27 </factory> 20 28 </dao> 21 trunk/testapp/modules/jelix_tests/tests/jforms.compiler.html_cli.php
r962 r973 4 4 * @subpackage unittest module 5 5 * @author Jouanneau Laurent 6 * @contributor Loic Mathaud 6 * @contributor Loic Mathaud, Dominique Papin 7 7 * @copyright 2007-2008 Jouanneau laurent 8 * @copyright 2007 Loic Mathaud 8 * @copyright 2007 Loic Mathaud, Dominique Papin 9 9 * @link http://www.jelix.org 10 10 * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html … … 351 351 <datasource dao="foo" method="bar" labelproperty="baz" valueproperty="plop" criteria="toto"/> 352 352 </listbox>', 353 80=>'<listbox ref="nom" xmlns="http://jelix.org/ns/forms/1.1" >354 <label>Votre nom</label> 355 <datasource dao="foo" method="bar" labelproperty="baz" valueproperty="plop" profile="youp"criteria="toto"/>353 80=>'<listbox ref="nom" xmlns="http://jelix.org/ns/forms/1.1" multiple="true"> 354 <label>Votre nom</label> 355 <datasource dao="foo" method="bar" labelproperty="baz" valueproperty="plop" criteria="toto"/> 356 356 </listbox>', 357 357 81=>'<listbox ref="nom" xmlns="http://jelix.org/ns/forms/1.1" multiple="true"> … … 360 360 </listbox>', 361 361 82=>'<menulist ref="nom" xmlns="http://jelix.org/ns/forms/1.1"> 362 <label>Votre nom</label> 363 <datasource dao="foo" method="bar" labelproperty="baz" valueproperty="plop" criteriafrom="prenom" profile="youp"/> 364 </menulist>', 365 83=>'<menulist ref="nom" xmlns="http://jelix.org/ns/forms/1.1"> 366 <label>Votre nom</label> 367 <datasource dao="foo" method="bar" labelproperty="baz,biz" valueproperty="plop" criteria="joe,dumb"/> 368 </menulist>', 369 84=>'<menulist ref="nom" xmlns="http://jelix.org/ns/forms/1.1"> 370 <label>Votre nom</label> 371 <datasource dao="foo" method="bar" labelproperty="baz,biz" valueproperty="plop" criteriafrom="prenom,nom"/> 372 </menulist>', 373 85=>'<menulist ref="nom" xmlns="http://jelix.org/ns/forms/1.1"> 374 <label>Votre nom</label> 375 <datasource dao="foo" method="bar" labelproperty="baz,biz" labelseparator=" - " valueproperty="plop" criteriafrom="prenom,nom"/> 376 </menulist>', 377 86=>'<menulist ref="nom" xmlns="http://jelix.org/ns/forms/1.1"> 362 378 <label>Votre nom</label> 363 379 <datasource class="jelix_tests~mydatasource"/> … … 745 761 74=>'$ctrl= new jFormsControlcheckboxes(\'nom\'); 746 762 $ctrl->label=\'Votre nom\'; 747 $ctrl->datasource = new jFormsDaoDatasource(\'foo\',\'bar\',\'baz\',\'plop\',\'\' );763 $ctrl->datasource = new jFormsDaoDatasource(\'foo\',\'bar\',\'baz\',\'plop\',\'\',null,null); 748 764 $this->addControl($ctrl);', 749 765 75=>'$ctrl= new jFormsControlradiobuttons(\'nom\'); 750 766 $ctrl->label=\'Votre nom\'; 751 $ctrl->datasource = new jFormsDaoDatasource(\'foo\',\'bar\',\'baz\',\'plop\',\'\' );767 $ctrl->datasource = new jFormsDaoDatasource(\'foo\',\'bar\',\'baz\',\'plop\',\'\',null,null); 752 768 $this->addControl($ctrl);', 753 769 76=>'$ctrl= new jFormsControllistbox(\'nom\'); 754 770 $ctrl->label=\'Votre nom\'; 755 $ctrl->datasource = new jFormsDaoDatasource(\'foo\',\'bar\',\'baz\',\'plop\',\'\' );771 $ctrl->datasource = new jFormsDaoDatasource(\'foo\',\'bar\',\'baz\',\'plop\',\'\',null,null); 756 772 $this->addControl($ctrl);', 757 773 77=>'$ctrl= new jFormsControlmenulist(\'nom\'); 758 774 $ctrl->label=\'Votre nom\'; 759 $ctrl->datasource = new jFormsDaoDatasource(\'foo\',\'bar\',\'baz\',\'plop\',\'\' );775 $ctrl->datasource = new jFormsDaoDatasource(\'foo\',\'bar\',\'baz\',\'plop\',\'\',null,null); 760 776 $this->addControl($ctrl);', 761 777 78=>'$ctrl= new jFormsControllistbox(\'nom\'); 762 778 $ctrl->label=\'Votre nom\'; 763 $ctrl->datasource = new jFormsDaoDatasource(\'foo\',\'bar\',\'baz\',\'plop\',\'\' );779 $ctrl->datasource = new jFormsDaoDatasource(\'foo\',\'bar\',\'baz\',\'plop\',\'\',null,null); 764 780 $ctrl->multiple=true; 765 781 $this->addControl($ctrl);', 766 782 79=>'$ctrl= new jFormsControllistbox(\'nom\'); 767 783 $ctrl->label=\'Votre nom\'; 768 $ctrl->datasource = new jFormsDaoDatasource(\'foo\',\'bar\',\'baz\',\'plop\',\'\',\'toto\' );784 $ctrl->datasource = new jFormsDaoDatasource(\'foo\',\'bar\',\'baz\',\'plop\',\'\',\'toto\',null); 769 785 $this->addControl($ctrl);', 770 786 80=>'$ctrl= new jFormsControllistbox(\'nom\'); 771 787 $ctrl->label=\'Votre nom\'; 772 $ctrl->datasource = new jFormsDaoDatasource(\'foo\',\'bar\',\'baz\',\'plop\',\'youp\',\'toto\'); 788 $ctrl->datasource = new jFormsDaoDatasource(\'foo\',\'bar\',\'baz\',\'plop\',\'\',\'toto\',null); 789 $ctrl->multiple=true; 773 790 $this->addControl($ctrl);', 774 791 81=>'$ctrl= new jFormsControllistbox(\'nom\'); … … 778 795 $this->addControl($ctrl);', 779 796 82=>'$ctrl= new jFormsControlmenulist(\'nom\'); 797 $ctrl->label=\'Votre nom\'; 798 $ctrl->datasource = new jFormsDaoDatasource(\'foo\',\'bar\',\'baz\',\'plop\',\'youp\',null,\'prenom\'); 799 $this->addControl($ctrl);', 800 83=>'$ctrl= new jFormsControlmenulist(\'nom\'); 801 $ctrl->label=\'Votre nom\'; 802 $ctrl->datasource = new jFormsDaoDatasource(\'foo\',\'bar\',\'baz,biz\',\'plop\',\'\',\'joe,dumb\',null); 803 $this->addControl($ctrl);', 804 84=>'$ctrl= new jFormsControlmenulist(\'nom\'); 805 $ctrl->label=\'Votre nom\'; 806 $ctrl->datasource = new jFormsDaoDatasource(\'foo\',\'bar\',\'baz,biz\',\'plop\',\'\',null,\'prenom,nom\'); 807 $this->addControl($ctrl);', 808 85=>'$ctrl= new jFormsControlmenulist(\'nom\'); 809 $ctrl->label=\'Votre nom\'; 810 $ctrl->datasource = new jFormsDaoDatasource(\'foo\',\'bar\',\'baz,biz\',\'plop\',\'\',null,\'prenom,nom\',\' - \'); 811 $this->addControl($ctrl);', 812 86=>'$ctrl= new jFormsControlmenulist(\'nom\'); 780 813 $ctrl->label=\'Votre nom\'; 781 814 jClasses::inc(\'jelix_tests~mydatasource\'); … … 1201 1234 $js.="jForms.tForm.addControl( jForms.tControl);\n";', 1202 1235 80=>'$label = \'Votre nom\'; 1203 $js.="jForms.tControl = new jFormsControl(\'nom\', \'".str_replace("\'","\\\'",$label)."\', \'string\');\n"; 1204 $js.="jForms.tControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\n"; 1205 $js.="jForms.tControl.errInvalid =\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.invalid\', $label))."\';\n"; 1236 $js.="jForms.tControl = new jFormsControl(\'nom[]\', \'".str_replace("\'","\\\'",$label)."\', \'string\');\n"; 1237 $js.="jForms.tControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\n"; 1238 $js.="jForms.tControl.errInvalid =\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.invalid\', $label))."\';\n"; 1239 $js.="jForms.tControl.multiple = true;\n"; 1206 1240 $js.="jForms.tForm.addControl( jForms.tControl);\n";', 1207 1241 81=>'$label = \'Votre nom\'; … … 1212 1246 $js.="jForms.tForm.addControl( jForms.tControl);\n";', 1213 1247 82=>'$label = \'Votre nom\'; 1248 $js.="jForms.tControl = new jFormsControl(\'nom\', \'".str_replace("\'","\\\'",$label)."\', \'string\');\n"; 1249 $js.="jForms.tControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\n"; 1250 $js.="jForms.tControl.errInvalid =\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.invalid\', $label))."\';\n"; 1251 $js.="jForms.tForm.addControl( jForms.tControl);\n";', 1252 83=>'$label = \'Votre nom\'; 1253 $js.="jForms.tControl = new jFormsControl(\'nom\', \'".str_replace("\'","\\\'",$label)."\', \'string\');\n"; 1254 $js.="jForms.tControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\n"; 1255 $js.="jForms.tControl.errInvalid =\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.invalid\', $label))."\';\n"; 1256 $js.="jForms.tForm.addControl( jForms.tControl);\n";', 1257 84=>'$label = \'Votre nom\'; 1258 $js.="jForms.tControl = new jFormsControl(\'nom\', \'".str_replace("\'","\\\'",$label)."\', \'string\');\n"; 1259 $js.="jForms.tControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\n"; 1260 $js.="jForms.tControl.errInvalid =\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.invalid\', $label))."\';\n"; 1261 $js.="jForms.tForm.addControl( jForms.tControl);\n";', 1262 85=>'$label = \'Votre nom\'; 1263 $js.="jForms.tControl = new jFormsControl(\'nom\', \'".str_replace("\'","\\\'",$label)."\', \'string\');\n"; 1264 $js.="jForms.tControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\n"; 1265 $js.="jForms.tControl.errInvalid =\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.invalid\', $label))."\';\n"; 1266 $js.="jForms.tForm.addControl( jForms.tControl);\n";', 1267 86=>'$label = \'Votre nom\'; 1214 1268 $js.="jForms.tControl = new jFormsControl(\'nom\', \'".str_replace("\'","\\\'",$label)."\', \'string\');\\n"; 1215 1269 $js.="jForms.tControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\\n"; trunk/testapp/modules/jelix_tests/tests/jforms.compiler.html_cli.php
r962 r973 4 4 * @subpackage unittest module 5 5 * @author Jouanneau Laurent 6 * @contributor Loic Mathaud 6 * @contributor Loic Mathaud, Dominique Papin 7 7 * @copyright 2007-2008 Jouanneau laurent 8 * @copyright 2007 Loic Mathaud 8 * @copyright 2007 Loic Mathaud, Dominique Papin 9 9 * @link http://www.jelix.org 10 10 * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html … … 351 351 <datasource dao="foo" method="bar" labelproperty="baz" valueproperty="plop" criteria="toto"/> 352 352 </listbox>', 353 80=>'<listbox ref="nom" xmlns="http://jelix.org/ns/forms/1.1" >354 <label>Votre nom</label> 355 <datasource dao="foo" method="bar" labelproperty="baz" valueproperty="plop" profile="youp"criteria="toto"/>353 80=>'<listbox ref="nom" xmlns="http://jelix.org/ns/forms/1.1" multiple="true"> 354 <label>Votre nom</label> 355 <datasource dao="foo" method="bar" labelproperty="baz" valueproperty="plop" criteria="toto"/> 356 356 </listbox>', 357 357 81=>'<listbox ref="nom" xmlns="http://jelix.org/ns/forms/1.1" multiple="true"> … … 360 360 </listbox>', 361 361 82=>'<menulist ref="nom" xmlns="http://jelix.org/ns/forms/1.1"> 362 <label>Votre nom</label> 363 <datasource dao="foo" method="bar" labelproperty="baz" valueproperty="plop" criteriafrom="prenom" profile="youp"/> 364 </menulist>', 365 83=>'<menulist ref="nom" xmlns="http://jelix.org/ns/forms/1.1"> 366 <label>Votre nom</label> 367 <datasource dao="foo" method="bar" labelproperty="baz,biz" valueproperty="plop" criteria="joe,dumb"/> 368 </menulist>', 369 84=>'<menulist ref="nom" xmlns="http://jelix.org/ns/forms/1.1"> 370 <label>Votre nom</label> 371 <datasource dao="foo" method="bar" labelproperty="baz,biz" valueproperty="plop" criteriafrom="prenom,nom"/> 372 </menulist>', 373 85=>'<menulist ref="nom" xmlns="http://jelix.org/ns/forms/1.1"> 374 <label>Votre nom</label> 375 <datasource dao="foo" method="bar" labelproperty="baz,biz" labelseparator=" - " valueproperty="plop" criteriafrom="prenom,nom"/> 376 </menulist>', 377 86=>'<menulist ref="nom" xmlns="http://jelix.org/ns/forms/1.1"> 362 378 <label>Votre nom</label> 363 379 <datasource class="jelix_tests~mydatasource"/> … … 745 761 74=>'$c
