summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
Diffstat (limited to 'application')
-rw-r--r--application/controllers/IndexController.php1
-rw-r--r--application/modules/user/controllers/FilterController.php7
-rw-r--r--application/modules/user/forms/FilterEntry.php68
3 files changed, 68 insertions, 8 deletions
diff --git a/application/controllers/IndexController.php b/application/controllers/IndexController.php
index 2972e9e..5f61df4 100644
--- a/application/controllers/IndexController.php
+++ b/application/controllers/IndexController.php
@@ -10,6 +10,7 @@ class IndexController extends Zend_Controller_Action
public function indexAction()
{
+ print_a($_SERVER);
if(stristr($_SERVER['HTTP_USER_AGENT'],'prebootGUI')){
$this->_forward('index','Index','fbgui');
}
diff --git a/application/modules/user/controllers/FilterController.php b/application/modules/user/controllers/FilterController.php
index 444a33a..307c40d 100644
--- a/application/modules/user/controllers/FilterController.php
+++ b/application/modules/user/controllers/FilterController.php
@@ -206,13 +206,16 @@ class User_FilterController extends Zend_Controller_Action
// TODO: get all child groups
$grouppMapper = new Application_Model_GroupMapper();
- $groups = $grouppMapper->findBY('groupID',$this->membership->getGroupID());
+ $group = new Application_Model_Group();
+ $grouppMapper->find($this->membership->getGroupID(),$group);
+ $groups[] = $group->toArray();
$clientMapper = new Application_Model_ClientMapper();
$clients = $clientMapper->findBY('groupID',$this->membership->getGroupID());
return array ( 'clients' => $clients,
'memberships' => $memberships,
+ 'groups' => $groups,
'bootisos' => $bootisos,
'pools' => $pools);
@@ -246,7 +249,7 @@ class User_FilterController extends Zend_Controller_Action
$addform = new user_Form_FilterEntry(array('buttontext' => 'Add Filterentry',
'selectData' => $selectData,
'data'=>$_POST
- ));
+ ));
if ($addform->isValid($_POST)) {
print_a('valid');
$newfilterenty = new Application_Model_FilterEntries();
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);