Changeset 15256

Show
Ignore:
Timestamp:
02/26/08 17:18:09 (9 months ago)
Author:
flack
Message:

backport date validation

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/MidCOM_2_8/midcom.helper.datamanager2/formmanager.php

    r15105 r15256  
    246246 
    247247            $this->widgets[$name]->set_form($this->form); 
     248            //Load custom QF rules, so that they can be used in widgets' add_element_to_form calls 
     249            $this->_load_type_qfrules($name); 
    248250            $this->widgets[$name]->add_elements_to_form(); 
    249251            $this->_add_rules_and_filters($name, $config); 
     
    675677    function _add_rules_and_filters($name, $config) 
    676678    { 
    677         $this->_load_type_qfrules($name); 
    678679        $widget =& $this->widgets[$name]; 
    679680        if ($config['readonly']) 
  • branches/MidCOM_2_8/midcom.helper.datamanager2/locale/default.de.txt

    r11234 r15256  
    129129---STRINGEND 
    130130 
     131---STRING validation failed: date 
     132Dies ist keine gÃŒltige Datumsangabe 
     133---STRINGEND 
     134 
    131135---STRING validation failed: email 
    132136Dies ist keine gÃŒltige E-Mail-Adresse. 
  • branches/MidCOM_2_8/midcom.helper.datamanager2/locale/default.en.txt

    r14808 r15256  
    157157---STRINGEND 
    158158 
     159---STRING validation failed: date 
     160This is not a valid date 
     161---STRINGEND 
     162 
    159163---STRING validation failed: email 
    160164This is not a valid E-Mail address 
  • branches/MidCOM_2_8/midcom.helper.datamanager2/widget/jsdate.php

    r14808 r15256  
    175175 
    176176        $this->_form->addGroup($elements, $this->name, $this->_translate($this->_field['title']), '', false); 
     177 
     178        if($this->_field['required']) 
     179        { 
     180            $errmsg = sprintf($this->_l10n->get('field %s is required'), $this->_field['title']); 
     181 
     182            $this->_form->addRule($this->name, $errmsg, 'regex', '/^[^0]/'); 
     183        } 
     184        $this->_form->addRule($this->name, $this->_translate('validation failed: date'), 'checkjsdate'); 
    177185    } 
    178186 
  • branches/MidCOM_2_8/midcom.helper.datamanager2/widget/simpledate.php

    r15236 r15256  
    110110            $this->_form->addGroupRule($this->name, $errmsg, 'nonzero', null, 3); 
    111111        } 
     112        $this->_form->addRule($this->name, $this->_translate('validation failed: date'), 'checksimpledate'); 
    112113    } 
    113114