summaryrefslogtreecommitdiffstats
path: root/application/modules/user/forms
diff options
context:
space:
mode:
authorSimon2011-03-21 12:48:44 +0100
committerSimon2011-03-21 12:48:44 +0100
commite83e5f1768562d142e638980dc0c8d7fd4d88104 (patch)
treee2de8972e8e3091753f76d1f2ce0130ebd767df7 /application/modules/user/forms
parentMerge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2 (diff)
downloadpbs2-e83e5f1768562d142e638980dc0c8d7fd4d88104.tar.gz
pbs2-e83e5f1768562d142e638980dc0c8d7fd4d88104.tar.xz
pbs2-e83e5f1768562d142e638980dc0c8d7fd4d88104.zip
FilterEntries-Formular steht
Diffstat (limited to 'application/modules/user/forms')
-rw-r--r--application/modules/user/forms/FilterEntry.php68
1 files changed, 62 insertions, 6 deletions
diff --git a/application/modules/user/forms/FilterEntry.php b/application/modules/user/forms/FilterEntry.php
index 55941c0..c2581c2 100644
--- a/application/modules/user/forms/FilterEntry.php
+++ b/application/modules/user/forms/FilterEntry.php
@@ -11,7 +11,7 @@ class user_Form_FilterEntry extends Zend_Form
$this->setMethod('post');
$this->setAttrib('id','filterentryform');
#print_a($this->data);
- print_a($this->selectData);
+ #print_a($this->selectData);
try{
$filtertypemapper = new Application_Model_FilterTypeMapper();
$filtertype = $filtertypemapper->fetchAll();
@@ -189,11 +189,37 @@ class user_Form_FilterEntry extends Zend_Form
$filtervalue1 = $this->createElement('text', 'filtervalue', array(
'label' => $label1,
+ 'validators' => array(
+ array(
+ 'regex',
+ false,
+ array(
+ '/^([0-1][0-9]|[2][0-3]):([0-5][0-9])$/i',
+ 'messages' => array(
+ Zend_Validate_Regex::NOT_MATCH => "'%value%' is not a valid Time-Format, It must be HH:MM",
+ Zend_Validate_Regex::INVALID => 'Time contains invalid characters.'
+ )
+ )
+ )
+ ),
'required' => true,
'id' => 'val1'
));
$filtervalue2 = $this->createElement('text', 'filtervalue2', array(
'label' => $label2,
+ 'validators' => array(
+ array(
+ 'regex',
+ false,
+ array(
+ '/^([0-1][0-9]|[2][0-3]):([0-5][0-9])$/i',
+ 'messages' => array(
+ Zend_Validate_Regex::NOT_MATCH => "'%value%' is not a valid Time-Format, It must be HH:MM",
+ Zend_Validate_Regex::INVALID => 'Time contains invalid characters.'
+ )
+ )
+ )
+ ),
'required' => true,
'id' => 'val2'
));
@@ -231,11 +257,37 @@ class user_Form_FilterEntry extends Zend_Form
$filtervalue1 = $this->createElement('text', 'filtervalue', array(
'label' => $label1,
+ 'validators' => array(
+ array(
+ 'regex',
+ false,
+ array(
+ '/^([1-7])$/i',
+ 'messages' => array(
+ Zend_Validate_Regex::NOT_MATCH => "'%value%' is not a valid Day-Format, It must be betweeen 1 and 7",
+ Zend_Validate_Regex::INVALID => 'Day contains invalid characters.'
+ )
+ )
+ )
+ ),
'required' => true,
'id' => 'val1'
));
$filtervalue2 = $this->createElement('text', 'filtervalue2', array(
'label' => $label2,
+ 'validators' => array(
+ array(
+ 'regex',
+ false,
+ array(
+ '/^([1-7])$/i',
+ 'messages' => array(
+ Zend_Validate_Regex::NOT_MATCH => "'%value%' is not a valid Day-Format, It must be betweeen 1 and 7",
+ Zend_Validate_Regex::INVALID => 'Day contains invalid characters.'
+ )
+ )
+ )
+ ),
'required' => true,
'id' => 'val2'
));
@@ -246,15 +298,19 @@ class user_Form_FilterEntry extends Zend_Form
$label2 = 'End Date:';
$filtervalue1 = $this->createElement('text', 'filtervalue', array(
- 'label' => $label1,
+ 'label' => $label1,
'required' => true,
'id' => 'val1'
- ));
+ ));
+ $filtervalue1->addValidator('Date',false, array('format'=>'dd.MM.yyyy'));
+
$filtervalue2 = $this->createElement('text', 'filtervalue2', array(
- 'label' => $label2,
- 'required' => true,
+ 'label' => $label2,
+ 'required' => true,
'id' => 'val2'
- ));
+ ));
+ $filtervalue2->addValidator('Date',false, array('format'=>'dd.MM.yyyy'));
+
break;
}
$filtertypes->setDescription($desc);