From 38f401c0106c021eafdbdca0b169a18ce1c078b1 Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 10 Mar 2011 21:09:05 +0100 Subject: kcl auch als file senden & Server für Testbetrieb nur vom Uni-Netz erreichbar --- application/controllers/ResourceController.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'application') diff --git a/application/controllers/ResourceController.php b/application/controllers/ResourceController.php index b70c589..92be437 100644 --- a/application/controllers/ResourceController.php +++ b/application/controllers/ResourceController.php @@ -102,6 +102,11 @@ class ResourceController extends Zend_Controller_Action $bmemapper->find($bmeID,$bme); if($bme->getKcl() != null){ + header('Content-Type: text/html'); + $content_disp = ( ereg('MSIE ([0-9].[0-9]{1,2})', $HTTP_USER_AGENT) == 'IE') ? 'inline' : 'attachment'; + header('Content-Disposition: ' . $content_disp . '; filename="kcl.txt"'); + header('Pragma: no-cache'); + header('Expires: 0'); echo $bme->getKcl(); } -- cgit v1.2.3-55-g7522 From f755b6a457f96e9489a8dc89e35dea6882927f42 Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 11 Mar 2011 08:57:39 +0100 Subject: MacAdressenFilterung gefixxt, Fomular Buttons eingebaut, debug code entfernt --- application/controllers/FilterController.php | 11 +++++++---- application/forms/Client.php | 4 ++++ application/forms/FilterAdd.php | 4 ++++ application/forms/FilterEntriesAdd.php | 12 ++++++++---- application/forms/FilterEvaluate.php | 2 +- application/forms/Pool.php | 4 ++++ application/forms/Session.php | 4 ++++ application/models/FilterEntriesMapper.php | 10 ++-------- application/models/FilterMapper.php | 2 -- public/media/css/style.css | 1 + 10 files changed, 35 insertions(+), 19 deletions(-) (limited to 'application') diff --git a/application/controllers/FilterController.php b/application/controllers/FilterController.php index 9141e10..02b468d 100644 --- a/application/controllers/FilterController.php +++ b/application/controllers/FilterController.php @@ -154,7 +154,6 @@ class FilterController extends Zend_Controller_Action public function editfilterentryAction() { if (!isset($_POST["add"])){ - echo "case1"; try{ $filterentriesID = $this->_request->getParam('filterentriesID'); @@ -317,11 +316,11 @@ class FilterController extends Zend_Controller_Action $macAdress = $client->getMacadress(); } try{ - $macAdress = str_replace(":","",$this->fillMac($ipAdress)); + $macAdress = $this->fillMac($macAdress); $stmt = $db->query("SELECT * FROM pbs_filterentries WHERE filtertypeID = ".$filtertypID." AND - CONV(HEX('filtervalue'),16,10) <= CONV(HEX('".$macAdress."'),16,10) AND - CONV(HEX('".$macAdress."'),16,10) <= CONV(HEX('filtervalue2'),16,10)"); + filtervalue <= '".$macAdress."' AND + '".$macAdress."' <= filtervalue2"); $result = $stmt->fetchAll(); foreach($result as $r){ $set[$filtertypID][] = $r['filterID']; @@ -567,6 +566,10 @@ class FilterController extends Zend_Controller_Action 'clients' => $clients, )); + $filterevaluate->populate(array( + 'mac' => '6er tupel', + 'time'=>date('d.m.Y H:i')) + ); $this->view->filterevaluate = $filterevaluate; } diff --git a/application/forms/Client.php b/application/forms/Client.php index 1378349..d1d4382 100644 --- a/application/forms/Client.php +++ b/application/forms/Client.php @@ -29,6 +29,10 @@ class Application_Form_Client extends Zend_Form 'required' => false, 'ignore' => true, 'label' => 'Save', + )); + + $this->addElement('button', 'Cancel', array( + 'onclick' => 'self.location="/client"' )); } diff --git a/application/forms/FilterAdd.php b/application/forms/FilterAdd.php index 091eb37..43a4aca 100644 --- a/application/forms/FilterAdd.php +++ b/application/forms/FilterAdd.php @@ -46,6 +46,10 @@ class Application_Form_FilterAdd extends Zend_Form 'required' => false, 'ignore' => true, 'label' => 'Save', + )); + + $this->addElement('button', 'Cancel', array( + 'onclick' => 'self.location="/filter"' )); } function setBootmenus($val){ diff --git a/application/forms/FilterEntriesAdd.php b/application/forms/FilterEntriesAdd.php index 7b3f52b..2646484 100644 --- a/application/forms/FilterEntriesAdd.php +++ b/application/forms/FilterEntriesAdd.php @@ -31,16 +31,20 @@ class Application_Form_FilterEntriesAdd extends Zend_Form $this->addElement('text', 'filtervalue2', array( 'label' => 'Value2:' )); - - $this->addElement('hidden', 'filterID', array( - 'value' => $this->filterID - )); $this->addElement('submit', 'add', array( 'required' => false, 'ignore' => true, 'label' => 'Save', + )); + + $this->addElement('button', 'Cancel', array( + 'onclick' => 'self.location="/filter"' )); + + $this->addElement('hidden', 'filterID', array( + 'value' => $this->filterID + )); } public function setFilterID($id) { diff --git a/application/forms/FilterEvaluate.php b/application/forms/FilterEvaluate.php index 2c93aef..28dd848 100644 --- a/application/forms/FilterEvaluate.php +++ b/application/forms/FilterEvaluate.php @@ -90,7 +90,7 @@ class Application_Form_FilterEvaluate extends Zend_Form $clientfield->addMultiOption('',''); if(count($this->clients)>0){ foreach($this->clients as $id => $g){ - $clientfield->addMultiOption($g->getID(), $g->getMacadress()); + $clientfield->addMultiOption($g->getID(), $g->getID() . " - " . $g->getMacadress()); } } $clientfield->setRegisterInArrayValidator(false); diff --git a/application/forms/Pool.php b/application/forms/Pool.php index 0cef533..2fcdf78 100644 --- a/application/forms/Pool.php +++ b/application/forms/Pool.php @@ -37,6 +37,10 @@ class Application_Form_Pool extends Zend_Form 'ignore' => true, 'label' => 'Save', )); + + $this->addElement('button', 'Cancel', array( + 'onclick' => 'self.location="/pool"' + )); } diff --git a/application/forms/Session.php b/application/forms/Session.php index 30aefda..b74ca43 100644 --- a/application/forms/Session.php +++ b/application/forms/Session.php @@ -75,6 +75,10 @@ $this->addElement('text', 'ip6', array( 'ignore' => true, 'label' => 'Save', )); + + $this->addElement('button', 'Cancel', array( + 'onclick' => 'self.location="/session"' + )); } function setClients($v){ $this->clients = $v; diff --git a/application/models/FilterEntriesMapper.php b/application/models/FilterEntriesMapper.php index bf57dbd..0f070ee 100644 --- a/application/models/FilterEntriesMapper.php +++ b/application/models/FilterEntriesMapper.php @@ -60,10 +60,8 @@ class Application_Model_FilterEntriesMapper if (0 == count($result) && null == $id1) { $this->getDbTable()->insert($data); - echo 'inserted'; } else { - print_r($this->getDbTable()->update($data, array('filterentriesID = ?' => $id1))); - echo 'updated'; + $this->getDbTable()->update($data, array('filterentriesID = ?' => $id1)); } }catch (Zend_Exception $e) { @@ -78,11 +76,9 @@ class Application_Model_FilterEntriesMapper if ((null == $id1)) { - echo 'case1'; return; } else { $this->getDbTable()->delete(array('filterentriesID = ?' => $id1)); - echo 'case2'; } }catch (Zend_Exception $e) { @@ -93,11 +89,9 @@ class Application_Model_FilterEntriesMapper public function find($filterentriesID, Application_Model_FilterEntries $filterentries) { $result = $this->getDbTable()->find($filterentriesID); - echo 'dump1'; if (0 == count($result)) { return; - } - echo 'dump2'; + } $row = $result->current(); $filterentries->setID($row->filterentriesID) diff --git a/application/models/FilterMapper.php b/application/models/FilterMapper.php index eba9b71..1e83da6 100644 --- a/application/models/FilterMapper.php +++ b/application/models/FilterMapper.php @@ -55,10 +55,8 @@ class Application_Model_FilterMapper if (null === ($id = $filter->getID()) ) { unset($data['filterID']); $this->getDbTable()->insert($data); - echo 'case1'; } else { $this->getDbTable()->update($data, array('filterID = ?' => $id)); - echo 'case2'; } } diff --git a/public/media/css/style.css b/public/media/css/style.css index 1d3da5d..24e357b 100644 --- a/public/media/css/style.css +++ b/public/media/css/style.css @@ -44,6 +44,7 @@ padding:5px 10px; #nav ul { margin:2px; +padding:8px; } #nav li { -- cgit v1.2.3-55-g7522 From fdba31fdca095ab8e5abd81a1a751ffede0efc63 Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 11 Mar 2011 09:04:32 +0100 Subject: FilterController fixes --- application/controllers/FilterController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'application') diff --git a/application/controllers/FilterController.php b/application/controllers/FilterController.php index 02b468d..5fb149c 100644 --- a/application/controllers/FilterController.php +++ b/application/controllers/FilterController.php @@ -567,7 +567,7 @@ class FilterController extends Zend_Controller_Action )); $filterevaluate->populate(array( - 'mac' => '6er tupel', + 'mac' => '08:00:20:ae:fd:7e', 'time'=>date('d.m.Y H:i')) ); $this->view->filterevaluate = $filterevaluate; -- cgit v1.2.3-55-g7522 From abda64d32457744695f91a20feafde3431f9e9e2 Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 11 Mar 2011 10:00:40 +0100 Subject: AddClientToPool über Formular gefixxt, Buttonbeschriftungen anhand der Action beschriftet --- application/controllers/ClientController.php | 8 ++++---- application/controllers/FilterController.php | 19 ++++++++++--------- application/controllers/PoolController.php | 19 +++++++++---------- application/controllers/SessionController.php | 12 +++++------- application/forms/Client.php | 6 +++++- application/forms/FilterAdd.php | 6 +++++- application/forms/FilterEntriesAdd.php | 6 +++++- application/forms/Pool.php | 6 +++++- application/forms/PoolClient.php | 1 + application/forms/Session.php | 6 +++++- 10 files changed, 54 insertions(+), 35 deletions(-) (limited to 'application') diff --git a/application/controllers/ClientController.php b/application/controllers/ClientController.php index 580eb6e..affa780 100644 --- a/application/controllers/ClientController.php +++ b/application/controllers/ClientController.php @@ -20,11 +20,11 @@ class ClientController extends Zend_Controller_Action $hh = $this->_request->getParam('hh'); if (!isset($_POST["add"])){ - $addclient = new Application_Form_Client(); + $addclient = new Application_Form_Client(array('buttontext' => 'Create Client')); $this->view->addclient = $addclient; } else{ - $addfilterform = new Application_Form_Client($_POST); + $addfilterform = new Application_Form_Client(array('buttontext' => 'Create Client'),$_POST); if ($addfilterform->isValid($_POST) || ($mac != '' && $hh != '') ) { $client = new Application_Model_Client(); $mac = ($mac!='')?$mac:$_POST['macadress']; @@ -61,12 +61,12 @@ class ClientController extends Zend_Controller_Action $mapper = new Application_Model_ClientMapper(); $mapper->find($clientID,$data); - $editclient = new Application_Form_Client(); + $editclient = new Application_Form_Client(array('buttontext' => 'Edit Client')); $editclient->populate($data->toArray()); $this->view->editclient = $editclient; } else{ - $editclient = new Application_Form_Client($_POST); + $editclient = new Application_Form_Client(array('buttontext' => 'Edit Client'),$_POST); if ($editclient->isValid($_POST) || ($mac != '' && $hh != '') ) { $client = new Application_Model_Client($_POST); $client->setID($this->_request->getParam('clientID')); diff --git a/application/controllers/FilterController.php b/application/controllers/FilterController.php index 5fb149c..7b05b0e 100644 --- a/application/controllers/FilterController.php +++ b/application/controllers/FilterController.php @@ -34,10 +34,10 @@ class FilterController extends Zend_Controller_Action //TODO get bootmenu by group $bootmenus = $bmmapper->fetchAll(); if (!isset($_POST["add"])){ - $addfilterform = new Application_Form_FilterAdd(array('bootmenus'=>$bootmenus)); + $addfilterform = new Application_Form_FilterAdd(array('buttontext' => 'Create Filter','bootmenus'=>$bootmenus)); $this->view->addfilterform = $addfilterform; }else { - $addfilterform = new Application_Form_FilterAdd(array('bootmenus'=>$bootmenus),$_POST); + $addfilterform = new Application_Form_FilterAdd(array('buttontext' => 'Create Filter','bootmenus'=>$bootmenus),$_POST); if ($addfilterform->isValid($_POST)) { try{ $newfilter = new Application_Model_Filter($_POST); @@ -88,7 +88,7 @@ class FilterController extends Zend_Controller_Action $filtermapper->find($filterID,$filter); $filter2 = $filter->toArray(); - $editfilterform = new Application_Form_FilterAdd(array('bootmenus'=>$bootmenus)); + $editfilterform = new Application_Form_FilterAdd(array('buttontext' => 'Edit Filter','bootmenus'=>$bootmenus)); $editfilterform->populate($filter2); $this->view->editfilterform = $editfilterform; @@ -96,7 +96,7 @@ class FilterController extends Zend_Controller_Action try{ $filterID = $this->_request->getParam('filterID'); - $editfilterform = new Application_Form_FilterAdd(array('bootmenus'=>$bootmenus),$_POST); + $editfilterform = new Application_Form_FilterAdd(array('buttontext' => 'Edit Filter','bootmenus'=>$bootmenus),$_POST); //TODO: ACL integrieren $_POST['groupID'] = 1; $_POST['membershipID'] = 1; @@ -122,13 +122,13 @@ class FilterController extends Zend_Controller_Action // TODO: ACL implementieren ob er editieren darf if (!isset($_POST["add"])){ try{ - $editfilterform = new Application_Form_FilterEntriesAdd(array('filterID' => $this->_request->getParam('filterID'))); + $editfilterform = new Application_Form_FilterEntriesAdd(array('buttontext' => 'Add Filterentry','filterID' => $this->_request->getParam('filterID'))); $this->view->editfilterform = $editfilterform; }catch (Zend_Exception $e) { echo "Error message 2: " . $e->getMessage() . "\n"; } } else{ - $editfilterform = new Application_Form_FilterEntriesAdd($_POST); + $editfilterform = new Application_Form_FilterEntriesAdd(array('buttontext' => 'Add Filterentry'),$_POST); if ($editfilterform->isValid($_POST)) { $newfilterenty = new Application_Model_FilterEntries(); $newfilterenty->setFilterID($_POST['filterID']); @@ -164,7 +164,7 @@ class FilterController extends Zend_Controller_Action $filterentriesmapper->find($filterentriesID,$filterentry); - $editfilterform = new Application_Form_FilterEntriesAdd(); + $editfilterform = new Application_Form_FilterEntriesAdd(array('buttontext' => 'Edit Filterentry')); $editfilterform->populate($filterentry->toArray()); $editfilterform->setFilterID($filterID); $this->view->editfilterform = $editfilterform; @@ -175,7 +175,7 @@ class FilterController extends Zend_Controller_Action } else{ try{ $filterentriesID = $this->_request->getParam('filterentriesID'); - $editfilterform = new Application_Form_FilterEntriesAdd($_POST); + $editfilterform = new Application_Form_FilterEntriesAdd(array('buttontext' => 'Edit Filterentry'),$_POST); if ($editfilterform->isValid($_POST)) { $newfilterenty = new Application_Model_FilterEntries($_POST); $newfilterenty->setID($filterentriesID); @@ -529,7 +529,7 @@ class FilterController extends Zend_Controller_Action $bm = new Application_Model_BootMenu(); $bmmapper = new Application_Model_BootMenuMapper(); $bmmapper->find($bootmenuID,$bm); - echo "

Goto BootmenuID: ".$bootmenuID."

"; + echo "

Goto BootmenuID: ".$bootmenuID."

"; } else{ echo "

No Result :-(

"; @@ -567,6 +567,7 @@ class FilterController extends Zend_Controller_Action )); $filterevaluate->populate(array( + 'ip' => '132.230.5.6', 'mac' => '08:00:20:ae:fd:7e', 'time'=>date('d.m.Y H:i')) ); diff --git a/application/controllers/PoolController.php b/application/controllers/PoolController.php index 7c5092e..f27ee45 100644 --- a/application/controllers/PoolController.php +++ b/application/controllers/PoolController.php @@ -33,10 +33,10 @@ class PoolController extends Zend_Controller_Action public function createpoolAction() { if (!isset($_POST["add"])){ - $addfilterform = new Application_Form_Pool(); + $addfilterform = new Application_Form_Pool(array('buttontext' => 'Create Pool')); $this->view->addpool = $addfilterform; }else { - $addpoolform = new Application_Form_Pool($_POST); + $addpoolform = new Application_Form_Pool(array('buttontext' => 'Create Pool'),$_POST); if ($addpoolform->isValid($_POST)) { try{ $pool = new Application_Model_Pool($_POST); @@ -75,12 +75,12 @@ class PoolController extends Zend_Controller_Action $poolmapper->find($poolID,$pool); $poolArray = $pool->toArray(); - $editpool = new Application_Form_Pool(); + $editpool = new Application_Form_Pool(array('buttontext' => 'Edit Pool')); $editpool->populate($poolArray); $this->view->editpoolform = $editpool; }else { - $editpoolform = new Application_Form_Pool($_POST); + $editpoolform = new Application_Form_Pool(array('buttontext' => 'Edit Pool'),$_POST); if ($editpoolform->isValid($_POST)) { try{ $pool = new Application_Model_Pool($_POST); @@ -100,24 +100,23 @@ class PoolController extends Zend_Controller_Action { $clientID = $this->_request->getParam('clientID'); $poolID = $this->_request->getParam('poolID'); - - if(!isset($_POST['clientID']) && ($clientID == '' && $poolID == '')){ + if(!isset($_POST['clientID']) && ($clientID == '')){ $clientmapper = new Application_Model_ClientMapper(); $clients = $clientmapper->fetchAll(); foreach($clients as $c){ $clientsArray[] = $c->toArray(); - } + } $assignedclientmapper = new Application_Model_PoolEntriesMapper(); $assignedclients = $assignedclientmapper->fetchAll(); foreach($assignedclients as $c){ $assignedclientsArray[] = $c->toArray(); } $freeclients = $this->arrayDiff($clientsArray,$assignedclientsArray); - - $poolclient = new Application_Form_PoolClient(array('clients'=> $freeclients)); + + $poolclient = new Application_Form_PoolClient(array('buttontext' => 'Link Client','clients'=> $freeclients)); $this->view->poolclient = $poolclient; }else { - $poolclient = new Application_Form_PoolClient($_POST); + $poolclient = new Application_Form_PoolClient(array('buttontext' => 'Link Client'),$_POST); try{ $pool = new Application_Model_PoolEntries($_POST); $pool->setPoolID($this->_request->getParam('poolID')); diff --git a/application/controllers/SessionController.php b/application/controllers/SessionController.php index 09eadc9..6d0a873 100644 --- a/application/controllers/SessionController.php +++ b/application/controllers/SessionController.php @@ -26,11 +26,11 @@ class SessionController extends Zend_Controller_Action $bootisos = $bi->fetchAll(); if (!isset($_POST["add"])){ - $createsession = new Application_Form_Session(array('clients'=>$clients,'bootos'=>$bootos,'bootisos'=>$bootisos)); + $createsession = new Application_Form_Session(array('buttontext' => 'Create Session','clients'=>$clients,'bootos'=>$bootos,'bootisos'=>$bootisos)); $this->view->createsession = $createsession; }else { // TODO extend with normal function not only with post - $createsession = new Application_Form_Session(array('clients'=>$clients,'bootos'=>$bootos,'bootisos'=>$bootisos),$_POST); + $createsession = new Application_Form_Session(array('buttontext' => 'Create Session','clients'=>$clients,'bootos'=>$bootos,'bootisos'=>$bootisos),$_POST); print_a($_POST); if ($createsession->isValid($_POST)) { try{ @@ -49,9 +49,7 @@ class SessionController extends Zend_Controller_Action }catch (Zend_Exception $e) { echo "Error message 2: " . $e->getMessage() . "\n"; - } - print_a('saved'); - #$this->_redirect('/session'); + } } $this->view->createsession = $createsession; } @@ -78,7 +76,7 @@ class SessionController extends Zend_Controller_Action $session->setTime(date('d.m.Y H:i',$session->getTime())); $session2 = $session->toArray(); - $editsession = new Application_Form_Session(array('clients'=>$clients,'bootos'=>$bootos,'bootisos'=>$bootisos)); + $editsession = new Application_Form_Session(array('buttontext' => 'Edit Session','clients'=>$clients,'bootos'=>$bootos,'bootisos'=>$bootisos)); $editsession->populate($session2); $this->view->editsession = $editsession; @@ -86,7 +84,7 @@ class SessionController extends Zend_Controller_Action try{ $sessionID = $this->_request->getParam('sessionID'); - $editsession = new Application_Form_Session(array('clients'=>$clients,'bootos'=>$bootos,'bootisos'=>$bootisos),$_POST); + $editsession = new Application_Form_Session(array('buttontext' => 'Edit Session','clients'=>$clients,'bootos'=>$bootos,'bootisos'=>$bootisos),$_POST); if ($editsession->isValid($_POST)) { $session = new Application_Model_Session($_POST); diff --git a/application/forms/Client.php b/application/forms/Client.php index d1d4382..83df97e 100644 --- a/application/forms/Client.php +++ b/application/forms/Client.php @@ -28,13 +28,17 @@ class Application_Form_Client extends Zend_Form $this->addElement('submit', 'add', array( 'required' => false, 'ignore' => true, - 'label' => 'Save', + 'label' => $this->buttontext, )); $this->addElement('button', 'Cancel', array( 'onclick' => 'self.location="/client"' )); } + private $buttontext = 'Save'; + function setButtontext($v){ + $this->buttontext = $v; + } } diff --git a/application/forms/FilterAdd.php b/application/forms/FilterAdd.php index 43a4aca..b720089 100644 --- a/application/forms/FilterAdd.php +++ b/application/forms/FilterAdd.php @@ -45,7 +45,7 @@ class Application_Form_FilterAdd extends Zend_Form $this->addElement('submit', 'add', array( 'required' => false, 'ignore' => true, - 'label' => 'Save', + 'label' => $this->buttontext, )); $this->addElement('button', 'Cancel', array( @@ -56,6 +56,10 @@ class Application_Form_FilterAdd extends Zend_Form $this->bootmenus = $val; return; } + private $buttontext = 'Save'; + function setButtontext($v){ + $this->buttontext = $v; + } } diff --git a/application/forms/FilterEntriesAdd.php b/application/forms/FilterEntriesAdd.php index 2646484..3b051f5 100644 --- a/application/forms/FilterEntriesAdd.php +++ b/application/forms/FilterEntriesAdd.php @@ -35,7 +35,7 @@ class Application_Form_FilterEntriesAdd extends Zend_Form $this->addElement('submit', 'add', array( 'required' => false, 'ignore' => true, - 'label' => 'Save', + 'label' => $this->buttontext, )); $this->addElement('button', 'Cancel', array( @@ -50,6 +50,10 @@ class Application_Form_FilterEntriesAdd extends Zend_Form { $this->filterID = $id; } + private $buttontext = 'Save'; + function setButtontext($v){ + $this->buttontext = $v; + } } diff --git a/application/forms/Pool.php b/application/forms/Pool.php index 2fcdf78..be30444 100644 --- a/application/forms/Pool.php +++ b/application/forms/Pool.php @@ -35,13 +35,17 @@ class Application_Form_Pool extends Zend_Form $this->addElement('submit', 'add', array( 'required' => false, 'ignore' => true, - 'label' => 'Save', + 'label' => $this->buttontext, )); $this->addElement('button', 'Cancel', array( 'onclick' => 'self.location="/pool"' )); } + private $buttontext = 'Save'; + function setButtontext($v){ + $this->buttontext = $v; + } } diff --git a/application/forms/PoolClient.php b/application/forms/PoolClient.php index 7bacae0..0c4ef6a 100644 --- a/application/forms/PoolClient.php +++ b/application/forms/PoolClient.php @@ -11,6 +11,7 @@ class Application_Form_PoolClient extends Zend_Form $clientfield = $this->createElement('select','clientID'); $clientfield ->setLabel('Client:'); + print_a($this->clients); foreach($this->clients as $c){ $clientfield->addMultiOption($c['clientID'],$c['macadress']." - ".$c['hardwarehash']); } diff --git a/application/forms/Session.php b/application/forms/Session.php index b74ca43..f2175a7 100644 --- a/application/forms/Session.php +++ b/application/forms/Session.php @@ -73,7 +73,7 @@ $this->addElement('text', 'ip6', array( $this->addElement('submit', 'add', array( 'required' => false, 'ignore' => true, - 'label' => 'Save', + 'label' => $this->buttontext, )); $this->addElement('button', 'Cancel', array( @@ -89,6 +89,10 @@ $this->addElement('text', 'ip6', array( function setBootisos($v){ $this->bootisos = $v; } + private $buttontext = 'Save'; + function setButtontext($v){ + $this->buttontext = $v; + } } -- cgit v1.2.3-55-g7522