Changeset 973

Show
Ignore:
Timestamp:
05/31/08 23:33:42 (6 months ago)
Author:
bibo
Message:

ticket #581 : specify more than one labelProperty, criteria, criteriaFrom for dao datasource

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/jelix/docs/ns/jforms_1.1.rng

    r959 r973  
    313313                <attribute name="daomethod" /> 
    314314                <attribute name="labelproperty" /> 
     315                <optional><attribute name="labelseparator" /></optional> 
    315316                <optional><attribute name="valueproperty" /></optional> 
    316317                <optional> 
  • trunk/lib/jelix/docs/ns/jforms_1.1.rng

    r959 r973  
    313313                <attribute name="daomethod" /> 
    314314                <attribute name="labelproperty" /> 
     315                <optional><attribute name="labelseparator" /></optional> 
    315316                <optional><attribute name="valueproperty" /></optional> 
    316317                <optional> 
  • trunk/lib/jelix/docs/ns/jforms_1.1.rng

    r959 r973  
    313313                <attribute name="daomethod" /> 
    314314                <attribute name="labelproperty" /> 
     315                <optional><attribute name="labelseparator" /></optional> 
    315316                <optional><attribute name="valueproperty" /></optional> 
    316317                <optional> 
  • trunk/lib/jelix/docs/ns/jforms_1.1.rng

    r959 r973  
    313313                <attribute name="daomethod" /> 
    314314                <attribute name="labelproperty" /> 
     315                <optional><attribute name="labelseparator" /></optional> 
    315316                <optional><attribute name="valueproperty" /></optional> 
    316317                <optional> 
  • trunk/lib/jelix/forms/jFormsCompiler_jf_1_1.class.php

    r959 r973  
    103103            if(isset($attrs['dao'])) { 
    104104                if ( isset($attrs['profile'])) 
    105                     $profile = '\''.$attrs['profile'].'\''; 
     105                    $profile = ',\''.$attrs['profile'].'\''; 
    106106                else 
    107                     $profile = '\'\''; 
     107                    $profile = ',\'\''; 
    108108                if(isset($attrs['valueproperty'])) { 
    109109                    $daovalue = $attrs['valueproperty']; 
     
    116116 
    117117                if(isset($attrs['criteria'])) 
    118                     $criteria=',\''.$attrs['criteria'].'\''; 
     118                    $criteria=',\''.$attrs['criteria'].'\',null'; 
    119119                elseif(isset($attrs['criteriafrom'])) 
    120120                    $criteria=',null,\''.$attrs['criteriafrom'].'\''; 
    121121                else 
    122                     $criteria=''; 
     122                    $criteria=',null,null'; 
     123                if ( isset($attrs['labelseparator'])) 
     124                    $labelSeparator = ',\''.$attrs['labelseparator'].'\''; 
     125                else 
     126                    $labelSeparator = ''; 
    123127 
    124128                $source[]='$ctrl->datasource = new jFormsDaoDatasource(\''.$attrs['dao'].'\',\''. 
    125                                  $attrs['method'].'\',\''.$attrs['labelproperty'].'\',\''.$daovalue.'\','.$profile.$criteria.');'; 
     129                                 $attrs['method'].'\',\''.$attrs['labelproperty'].'\',\''.$daovalue.'\''.$profile.$criteria.$labelSeparator.');'; 
    126130                if($controltype == 'submit'){ 
    127131                    $source[]='$ctrl->standalone=false;'; 
  • trunk/lib/jelix/forms/jFormsCompiler_jf_1_1.class.php

    r959 r973  
    103103            if(isset($attrs['dao'])) { 
    104104                if ( isset($attrs['profile'])) 
    105                     $profile = '\''.$attrs['profile'].'\''; 
     105                    $profile = ',\''.$attrs['profile'].'\''; 
    106106                else 
    107                     $profile = '\'\''; 
     107                    $profile = ',\'\''; 
    108108                if(isset($attrs['valueproperty'])) { 
    109109                    $daovalue = $attrs['valueproperty']; 
     
    116116 
    117117                if(isset($attrs['criteria'])) 
    118                     $criteria=',\''.$attrs['criteria'].'\''; 
     118                    $criteria=',\''.$attrs['criteria'].'\',null'; 
    119119                elseif(isset($attrs['criteriafrom'])) 
    120120                    $criteria=',null,\''.$attrs['criteriafrom'].'\''; 
    121121                else 
    122                     $criteria=''; 
     122                    $criteria=',null,null'; 
     123                if ( isset($attrs['labelseparator'])) 
     124                    $labelSeparator = ',\''.$attrs['labelseparator'].'\''; 
     125                else 
     126                    $labelSeparator = ''; 
    123127 
    124128                $source[]='$ctrl->datasource = new jFormsDaoDatasource(\''.$attrs['dao'].'\',\''. 
    125                                  $attrs['method'].'\',\''.$attrs['labelproperty'].'\',\''.$daovalue.'\','.$profile.$criteria.');'; 
     129                                 $attrs['method'].'\',\''.$attrs['labelproperty'].'\',\''.$daovalue.'\''.$profile.$criteria.$labelSeparator.');'; 
    126130                if($controltype == 'submit'){ 
    127131                    $source[]='$ctrl->standalone=false;'; 
  • trunk/lib/jelix/forms/jFormsCompiler_jf_1_1.class.php

    r959 r973  
    103103            if(isset($attrs['dao'])) { 
    104104                if ( isset($attrs['profile'])) 
    105                     $profile = '\''.$attrs['profile'].'\''; 
     105                    $profile = ',\''.$attrs['profile'].'\''; 
    106106                else 
    107                     $profile = '\'\''; 
     107                    $profile = ',\'\''; 
    108108                if(isset($attrs['valueproperty'])) { 
    109109                    $daovalue = $attrs['valueproperty']; 
     
    116116 
    117117                if(isset($attrs['criteria'])) 
    118                     $criteria=',\''.$attrs['criteria'].'\''; 
     118                    $criteria=',\''.$attrs['criteria'].'\',null'; 
    119119                elseif(isset($attrs['criteriafrom'])) 
    120120                    $criteria=',null,\''.$attrs['criteriafrom'].'\''; 
    121121                else 
    122                     $criteria=''; 
     122                    $criteria=',null,null'; 
     123                if ( isset($attrs['labelseparator'])) 
     124                    $labelSeparator = ',\''.$attrs['labelseparator'].'\''; 
     125                else 
     126                    $labelSeparator = ''; 
    123127 
    124128                $source[]='$ctrl->datasource = new jFormsDaoDatasource(\''.$attrs['dao'].'\',\''. 
    125                                  $attrs['method'].'\',\''.$attrs['labelproperty'].'\',\''.$daovalue.'\','.$profile.$criteria.');'; 
     129                                 $attrs['method'].'\',\''.$attrs['labelproperty'].'\',\''.$daovalue.'\''.$profile.$criteria.$labelSeparator.');'; 
    126130                if($controltype == 'submit'){ 
    127131                    $source[]='$ctrl->standalone=false;'; 
  • trunk/lib/jelix/forms/jFormsCompiler_jf_1_1.class.php

    r959 r973  
    103103            if(isset($attrs['dao'])) { 
    104104                if ( isset($attrs['profile'])) 
    105                     $profile = '\''.$attrs['profile'].'\''; 
     105                    $profile = ',\''.$attrs['profile'].'\''; 
    106106                else 
    107                     $profile = '\'\''; 
     107                    $profile = ',\'\''; 
    108108                if(isset($attrs['valueproperty'])) { 
    109109                    $daovalue = $attrs['valueproperty']; 
     
    116116 
    117117                if(isset($attrs['criteria'])) 
    118                     $criteria=',\''.$attrs['criteria'].'\''; 
     118                    $criteria=',\''.$attrs['criteria'].'\',null'; 
    119119                elseif(isset($attrs['criteriafrom'])) 
    120120                    $criteria=',null,\''.$attrs['criteriafrom'].'\''; 
    121121                else 
    122                     $criteria=''; 
     122                    $criteria=',null,null'; 
     123                if ( isset($attrs['labelseparator'])) 
     124                    $labelSeparator = ',\''.$attrs['labelseparator'].'\''; 
     125                else 
     126                    $labelSeparator = ''; 
    123127 
    124128                $source[]='$ctrl->datasource = new jFormsDaoDatasource(\''.$attrs['dao'].'\',\''. 
    125                                  $attrs['method'].'\',\''.$attrs['labelproperty'].'\',\''.$daovalue.'\','.$profile.$criteria.');'; 
     129                                 $attrs['method'].'\',\''.$attrs['labelproperty'].'\',\''.$daovalue.'\''.$profile.$criteria.$labelSeparator.');'; 
    126130                if($controltype == 'submit'){ 
    127131                    $source[]='$ctrl->standalone=false;'; 
  • trunk/lib/jelix/forms/jFormsDatasource.class.php

    r959 r973  
    7979    protected $selector; 
    8080    protected $method; 
    81     protected $labelProperty; 
     81    protected $labelProperty = array(); 
     82    protected $labelSeparator; 
    8283    protected $keyProperty; 
    8384    protected $profile; 
    8485 
    85     protected $criteria
    86     protected $criteriaForm
     86    protected $criteria = null
     87    protected $criteriaFrom = null
    8788 
    8889    protected $dao = null; 
    8990 
    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=''){ 
    9192        $this->selector  = $selector; 
    9293        $this->profile = $profile; 
    9394        $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) ; 
    97101        if($key == ''){ 
    98102            $rec = jDao::createRecord($this->selector, $this->profile); 
     
    107111            $this->dao = jDao::get($this->selector, $this->profile); 
    108112        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); 
    110114        } 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); 
    112120        } else { 
    113121            $found = $this->dao->{$this->method}(); 
     
    115123        $result=array(); 
    116124        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 ; 
    118133        } 
    119134        return $result; 
     
    123138        if($this->dao === null) $this->dao = jDao::get($this->selector, $this->profile); 
    124139        $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        } 
    127150        else 
    128151            return null; 
  • trunk/lib/jelix/forms/jFormsDatasource.class.php

    r959 r973  
    7979    protected $selector; 
    8080    protected $method; 
    81     protected $labelProperty; 
     81    protected $labelProperty = array(); 
     82    protected $labelSeparator; 
    8283    protected $keyProperty; 
    8384    protected $profile; 
    8485 
    85     protected $criteria
    86     protected $criteriaForm
     86    protected $criteria = null
     87    protected $criteriaFrom = null
    8788 
    8889    protected $dao = null; 
    8990 
    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=''){ 
    9192        $this->selector  = $selector; 
    9293        $this->profile = $profile; 
    9394        $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) ; 
    97101        if($key == ''){ 
    98102            $rec = jDao::createRecord($this->selector, $this->profile); 
     
    107111            $this->dao = jDao::get($this->selector, $this->profile); 
    108112        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); 
    110114        } 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); 
    112120        } else { 
    113121            $found = $this->dao->{$this->method}(); 
     
    115123        $result=array(); 
    116124        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 ; 
    118133        } 
    119134        return $result; 
     
    123138        if($this->dao === null) $this->dao = jDao::get($this->selector, $this->profile); 
    124139        $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        } 
    127150        else 
    128151            return null; 
  • trunk/lib/jelix/forms/jFormsDatasource.class.php

    r959 r973  
    7979    protected $selector; 
    8080    protected $method; 
    81     protected $labelProperty; 
     81    protected $labelProperty = array(); 
     82    protected $labelSeparator; 
    8283    protected $keyProperty; 
    8384    protected $profile; 
    8485 
    85     protected $criteria
    86     protected $criteriaForm
     86    protected $criteria = null
     87    protected $criteriaFrom = null
    8788 
    8889    protected $dao = null; 
    8990 
    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=''){ 
    9192        $this->selector  = $selector; 
    9293        $this->profile = $profile; 
    9394        $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) ; 
    97101        if($key == ''){ 
    98102            $rec = jDao::createRecord($this->selector, $this->profile); 
     
    107111            $this->dao = jDao::get($this->selector, $this->profile); 
    108112        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); 
    110114        } 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); 
    112120        } else { 
    113121            $found = $this->dao->{$this->method}(); 
     
    115123        $result=array(); 
    116124        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 ; 
    118133        } 
    119134        return $result; 
     
    123138        if($this->dao === null) $this->dao = jDao::get($this->selector, $this->profile); 
    124139        $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        } 
    127150        else 
    128151            return null; 
  • trunk/lib/jelix/forms/jFormsDatasource.class.php

    r959 r973  
    7979    protected $selector; 
    8080    protected $method; 
    81     protected $labelProperty; 
     81    protected $labelProperty = array(); 
     82    protected $labelSeparator; 
    8283    protected $keyProperty; 
    8384    protected $profile; 
    8485 
    85     protected $criteria
    86     protected $criteriaForm
     86    protected $criteria = null
     87    protected $criteriaFrom = null
    8788 
    8889    protected $dao = null; 
    8990 
    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=''){ 
    9192        $this->selector  = $selector; 
    9293        $this->profile = $profile; 
    9394        $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) ; 
    97101        if($key == ''){ 
    98102            $rec = jDao::createRecord($this->selector, $this->profile); 
     
    107111            $this->dao = jDao::get($this->selector, $this->profile); 
    108112        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); 
    110114        } 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); 
    112120        } else { 
    113121            $found = $this->dao->{$this->method}(); 
     
    115123        $result=array(); 
    116124        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 ; 
    118133        } 
    119134        return $result; 
     
    123138        if($this->dao === null) $this->dao = jDao::get($this->selector, $this->profile); 
    124139        $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        } 
    127150        else 
    128151            return null; 
  • trunk/testapp/modules/jelix_tests/daos/products.dao.xml

    r895 r973  
    1717            </conditions> 
    1818       </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> 
    1927   </factory> 
    2028</dao> 
    21  
  • trunk/testapp/modules/jelix_tests/daos/products.dao.xml

    r895 r973  
    1717            </conditions> 
    1818       </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> 
    1927   </factory> 
    2028</dao> 
    21  
  • trunk/testapp/modules/jelix_tests/daos/products.dao.xml

    r895 r973  
    1717            </conditions> 
    1818       </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> 
    1927   </factory> 
    2028</dao> 
    21  
  • trunk/testapp/modules/jelix_tests/daos/products.dao.xml

    r895 r973  
    1717            </conditions> 
    1818       </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> 
    1927   </factory> 
    2028</dao> 
    21  
  • trunk/testapp/modules/jelix_tests/tests/jforms.compiler.html_cli.php

    r962 r973  
    44* @subpackage  unittest module 
    55* @author      Jouanneau Laurent 
    6 * @contributor Loic Mathaud 
     6* @contributor Loic Mathaud, Dominique Papin 
    77* @copyright   2007-2008 Jouanneau laurent 
    8 * @copyright   2007 Loic Mathaud 
     8* @copyright   2007 Loic Mathaud, Dominique Papin 
    99* @link        http://www.jelix.org 
    1010* @licence     GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
     
    351351    <datasource dao="foo" method="bar" labelproperty="baz" valueproperty="plop" criteria="toto"/> 
    352352</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"/> 
     35380=>'<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"/> 
    356356</listbox>', 
    35735781=>'<listbox ref="nom" xmlns="http://jelix.org/ns/forms/1.1" multiple="true"> 
     
    360360</listbox>', 
    36136182=>'<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>', 
     36583=>'<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>', 
     36984=>'<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>', 
     37385=>'<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>', 
     37786=>'<menulist ref="nom" xmlns="http://jelix.org/ns/forms/1.1"> 
    362378    <label>Votre nom</label> 
    363379    <datasource class="jelix_tests~mydatasource"/> 
     
    74576174=>'$ctrl= new jFormsControlcheckboxes(\'nom\'); 
    746762$ctrl->label=\'Votre nom\'; 
    747 $ctrl->datasource = new jFormsDaoDatasource(\'foo\',\'bar\',\'baz\',\'plop\',\'\'); 
     763$ctrl->datasource = new jFormsDaoDatasource(\'foo\',\'bar\',\'baz\',\'plop\',\'\',null,null); 
    748764$this->addControl($ctrl);', 
    74976575=>'$ctrl= new jFormsControlradiobuttons(\'nom\'); 
    750766$ctrl->label=\'Votre nom\'; 
    751 $ctrl->datasource = new jFormsDaoDatasource(\'foo\',\'bar\',\'baz\',\'plop\',\'\'); 
     767$ctrl->datasource = new jFormsDaoDatasource(\'foo\',\'bar\',\'baz\',\'plop\',\'\',null,null); 
    752768$this->addControl($ctrl);', 
    75376976=>'$ctrl= new jFormsControllistbox(\'nom\'); 
    754770$ctrl->label=\'Votre nom\'; 
    755 $ctrl->datasource = new jFormsDaoDatasource(\'foo\',\'bar\',\'baz\',\'plop\',\'\'); 
     771$ctrl->datasource = new jFormsDaoDatasource(\'foo\',\'bar\',\'baz\',\'plop\',\'\',null,null); 
    756772$this->addControl($ctrl);', 
    75777377=>'$ctrl= new jFormsControlmenulist(\'nom\'); 
    758774$ctrl->label=\'Votre nom\'; 
    759 $ctrl->datasource = new jFormsDaoDatasource(\'foo\',\'bar\',\'baz\',\'plop\',\'\'); 
     775$ctrl->datasource = new jFormsDaoDatasource(\'foo\',\'bar\',\'baz\',\'plop\',\'\',null,null); 
    760776$this->addControl($ctrl);', 
    76177778=>'$ctrl= new jFormsControllistbox(\'nom\'); 
    762778$ctrl->label=\'Votre nom\'; 
    763 $ctrl->datasource = new jFormsDaoDatasource(\'foo\',\'bar\',\'baz\',\'plop\',\'\'); 
     779$ctrl->datasource = new jFormsDaoDatasource(\'foo\',\'bar\',\'baz\',\'plop\',\'\',null,null); 
    764780$ctrl->multiple=true; 
    765781$this->addControl($ctrl);', 
    76678279=>'$ctrl= new jFormsControllistbox(\'nom\'); 
    767783$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); 
    769785$this->addControl($ctrl);', 
    77078680=>'$ctrl= new jFormsControllistbox(\'nom\'); 
    771787$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; 
    773790$this->addControl($ctrl);', 
    77479181=>'$ctrl= new jFormsControllistbox(\'nom\'); 
     
    778795$this->addControl($ctrl);', 
    77979682=>'$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);', 
     80083=>'$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);', 
     80484=>'$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);', 
     80885=>'$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);', 
     81286=>'$ctrl= new jFormsControlmenulist(\'nom\'); 
    780813$ctrl->label=\'Votre nom\'; 
    781814jClasses::inc(\'jelix_tests~mydatasource\'); 
     
    12011234$js.="jForms.tForm.addControl( jForms.tControl);\n";', 
    1202123580=>'$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"; 
    12061240$js.="jForms.tForm.addControl( jForms.tControl);\n";', 
    1207124181=>'$label = \'Votre nom\'; 
     
    12121246$js.="jForms.tForm.addControl( jForms.tControl);\n";', 
    1213124782=>'$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";', 
     125283=>'$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";', 
     125784=>'$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";', 
     126285=>'$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";', 
     126786=>'$label = \'Votre nom\'; 
    12141268$js.="jForms.tControl = new jFormsControl(\'nom\', \'".str_replace("\'","\\\'",$label)."\', \'string\');\\n"; 
    12151269$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  
    44* @subpackage  unittest module 
    55* @author      Jouanneau Laurent 
    6 * @contributor Loic Mathaud 
     6* @contributor Loic Mathaud, Dominique Papin 
    77* @copyright   2007-2008 Jouanneau laurent 
    8 * @copyright   2007 Loic Mathaud 
     8* @copyright   2007 Loic Mathaud, Dominique Papin 
    99* @link        http://www.jelix.org 
    1010* @licence     GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
     
    351351    <datasource dao="foo" method="bar" labelproperty="baz" valueproperty="plop" criteria="toto"/> 
    352352</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"/> 
     35380=>'<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"/> 
    356356</listbox>', 
    35735781=>'<listbox ref="nom" xmlns="http://jelix.org/ns/forms/1.1" multiple="true"> 
     
    360360</listbox>', 
    36136182=>'<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>', 
     36583=>'<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>', 
     36984=>'<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>', 
     37385=>'<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>', 
     37786=>'<menulist ref="nom" xmlns="http://jelix.org/ns/forms/1.1"> 
    362378    <label>Votre nom</label> 
    363379    <datasource class="jelix_tests~mydatasource"/> 
     
    74576174=>'$c