summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
authorSimon2011-03-11 08:57:39 +0100
committerSimon2011-03-11 08:57:39 +0100
commitf755b6a457f96e9489a8dc89e35dea6882927f42 (patch)
tree6ee4ec99c11f7d94a8ea7350da4ccc489cefb9ae /application
parentMerge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2 (diff)
downloadpbs2-f755b6a457f96e9489a8dc89e35dea6882927f42.tar.gz
pbs2-f755b6a457f96e9489a8dc89e35dea6882927f42.tar.xz
pbs2-f755b6a457f96e9489a8dc89e35dea6882927f42.zip
MacAdressenFilterung gefixxt, Fomular Buttons eingebaut, debug code entfernt
Diffstat (limited to 'application')
-rw-r--r--application/controllers/FilterController.php11
-rw-r--r--application/forms/Client.php4
-rw-r--r--application/forms/FilterAdd.php4
-rw-r--r--application/forms/FilterEntriesAdd.php12
-rw-r--r--application/forms/FilterEvaluate.php2
-rw-r--r--application/forms/Pool.php4
-rw-r--r--application/forms/Session.php4
-rw-r--r--application/models/FilterEntriesMapper.php10
-rw-r--r--application/models/FilterMapper.php2
9 files changed, 34 insertions, 19 deletions
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';
}
}