From 9f26be7f273a1c16fee2a369eb6c8dbcfdc83cdd Mon Sep 17 00:00:00 2001
From: Simon
Date: Wed, 9 Mar 2011 14:43:40 +0100
Subject: Icons ins Oberlfäche hinzugefügt & Views geupdated & style geupdated
& select in free clients hinzugefügt
---
application/views/scripts/bootiso/index.phtml | 8 +++----
application/views/scripts/bootmenu/index.phtml | 22 +++++++++----------
application/views/scripts/bootos/index.phtml | 8 +++----
application/views/scripts/client/index.phtml | 8 +++----
application/views/scripts/config/index.phtml | 8 +++----
application/views/scripts/filter/index.phtml | 24 ++++++++++-----------
application/views/scripts/pool/index.phtml | 30 +++++++++++++++-----------
application/views/scripts/session/index.phtml | 8 +++----
8 files changed, 60 insertions(+), 56 deletions(-)
(limited to 'application/views/scripts')
diff --git a/application/views/scripts/bootiso/index.phtml b/application/views/scripts/bootiso/index.phtml
index 20de6a1..5e7da1e 100644
--- a/application/views/scripts/bootiso/index.phtml
+++ b/application/views/scripts/bootiso/index.phtml
@@ -28,22 +28,22 @@
escape(date('Y-m-d H:i:s', $bootiso->getCreated())); ?> |
escape($bootiso->getExpires()); ?> |
escape($bootiso->getPublic()); ?> |
- url(
array(
'controller' => 'bootiso',
'action' => 'editbootiso',
'bootisoID' => $bootiso->getID()
),
'default',
- true, false) ?>">Edit BootISO |
-  |
+ Delete BootISO |
+ true) ?>">
diff --git a/application/views/scripts/bootmenu/index.phtml b/application/views/scripts/bootmenu/index.phtml
index 019a799..6fb55e4 100644
--- a/application/views/scripts/bootmenu/index.phtml
+++ b/application/views/scripts/bootmenu/index.phtml
@@ -22,23 +22,23 @@
escape($bootmenu->getGroupID()); ?> |
escape($bootmenu->getMembershipID()); ?> |
escape(date('Y-m-d H:i:s', $bootmenu->getCreated())); ?> |
- url(
array(
'controller' => 'bootmenu',
'action' => 'editbootmenu',
'bootmenuID' => $bootmenu->getID()
),
'default',
- true, false) ?>">Edit Bootmenu |
-  |
+ Delete Bootmenu |
-  |
+ Add Entry |
+ true) ?>">
bootmenuentrylist[$bootmenu->getID()]) > 0):?>
- |
+ ↳ |
diff --git a/application/views/scripts/bootos/index.phtml b/application/views/scripts/bootos/index.phtml
index df4f072..6da7a16 100644
--- a/application/views/scripts/bootos/index.phtml
+++ b/application/views/scripts/bootos/index.phtml
@@ -35,22 +35,22 @@
| escape(date('Y-m-d H:i:s', $bootos->getCreated())); ?> |
escape($bootos->getExpires()); ?> |
escape($bootos->getPublic()); ?> |
- url(
array(
'controller' => 'bootos',
'action' => 'editbootos',
'bootosID' => $bootos->getID()
),
'default',
- true, false) ?>">Edit BootOS |
-  |
+ Delete BootOS |
+ true) ?>">
diff --git a/application/views/scripts/client/index.phtml b/application/views/scripts/client/index.phtml
index 9ef344b..fd7725c 100644
--- a/application/views/scripts/client/index.phtml
+++ b/application/views/scripts/client/index.phtml
@@ -16,22 +16,22 @@
escape($client->getID()) ?> |
escape($client->getMacadress()) ?> |
escape($client->getHardwarehash()) ?> |
- url(
array(
'controller' => 'client',
'action' => 'editclient',
'clientID' => $client->getID()
),
'default',
- true) ?>">edit client |
-  |
+ remove client |
+ true) ?>">
diff --git a/application/views/scripts/config/index.phtml b/application/views/scripts/config/index.phtml
index 6457d8f..5562b86 100644
--- a/application/views/scripts/config/index.phtml
+++ b/application/views/scripts/config/index.phtml
@@ -23,22 +23,22 @@
escape($config->getMembershipID()); ?> |
escape($config->getShellscript()); ?> |
escape(date('Y-m-d H:i:s', $config->getCreated())); ?> |
- url(
array(
'controller' => 'config',
'action' => 'editconfig',
'configID' => $config->getID()
),
'default',
- true, false) ?>">Edit Config |
-  |
+ Delete Config |
+ true) ?>">
diff --git a/application/views/scripts/filter/index.phtml b/application/views/scripts/filter/index.phtml
index 253d14d..6f98b4c 100644
--- a/application/views/scripts/filter/index.phtml
+++ b/application/views/scripts/filter/index.phtml
@@ -1,5 +1,5 @@
Filters
-formButton('createconfig', 'Add Filter', array(
+formButton('createconfig', 'Create Filter', array(
'onclick' => 'self.location="/filter/addfilter"',
'class' => 'addbutton'))?>
@@ -18,33 +18,33 @@
escape($filter->title) ?> |
escape($filter->priority) ?> |
escape($filter->bootmenuID) ?> |
- url(
array(
'controller' => 'filter',
'action' => 'editfilter',
'filterID' => $filter->getID()
),
'default',
- true) ?>">edit filter |
-  |
+ delete filter |
-  |
+ add filterentry |
+ true) ?>">
- |
+ ↳ |
|
|
|
- url(
array(
'controller' => 'filter',
'action' => 'editfilterentry',
'filterentriesID' => $filterentry['filterentriesID']
),
'default',
- true) ?>">edit filterentry
- |
+ | remove filterentry
+ true) ?>">
|
diff --git a/application/views/scripts/pool/index.phtml b/application/views/scripts/pool/index.phtml
index 68fcbc4..f89dbc9 100644
--- a/application/views/scripts/pool/index.phtml
+++ b/application/views/scripts/pool/index.phtml
@@ -18,33 +18,33 @@
escape($pool->getTitle()) ?> |
escape($pool->getDescription()) ?> |
escape($pool->getLocation()) ?> |
- url(
array(
'controller' => 'pool',
'action' => 'editpool',
'poolID' => $pool->getID()
),
'default',
- true) ?>">edit pool |
-  |
+ delete pool |
-  |
+ link client |
+ true) ?>">
- |
+ ↳ |
Free clients
-
--
cgit v1.2.3-55-g7522
From 3d04fb75a980dba20e51dc91afd49f0eb9ee43fe Mon Sep 17 00:00:00 2001
From: Simon
Date: Wed, 9 Mar 2011 16:31:58 +0100
Subject: Form-Verhalten geändert & Datenbank korrigiert
---
application/controllers/ClientController.php | 21 +++-----
application/controllers/FilterController.php | 78 +++++++++++-----------------
application/controllers/PoolController.php | 20 +++----
application/forms/FilterAdd.php | 24 +++++----
application/views/scripts/filter/index.phtml | 11 ++--
application/views/scripts/pool/index.phtml | 22 +++++---
pbs-data.sql | 6 ++-
public/media/css/style.css | 5 +-
8 files changed, 91 insertions(+), 96 deletions(-)
(limited to 'application/views/scripts')
diff --git a/application/controllers/ClientController.php b/application/controllers/ClientController.php
index ff663ba..580eb6e 100644
--- a/application/controllers/ClientController.php
+++ b/application/controllers/ClientController.php
@@ -16,16 +16,15 @@ class ClientController extends Zend_Controller_Action
public function addclientAction()
{
- $mac = $this->_request->getParam('mac');
- $hh = $this->_request->getParam('hh');
+ $mac = $this->_request->getParam('mac');
+ $hh = $this->_request->getParam('hh');
if (!isset($_POST["add"])){
- $addclient = new Application_Form_Client();
- $this->view->addclient = $addclient;
+ $addclient = new Application_Form_Client();
+ $this->view->addclient = $addclient;
}
else{
$addfilterform = new Application_Form_Client($_POST);
- print_a($_POST,$addfilterform->isValid($_POST));
if ($addfilterform->isValid($_POST) || ($mac != '' && $hh != '') ) {
$client = new Application_Model_Client();
$mac = ($mac!='')?$mac:$_POST['macadress'];
@@ -37,9 +36,7 @@ class ClientController extends Zend_Controller_Action
print_a('inserted');
$this->_redirect('/client');
}
- else{
- print_a('no insert');
- }
+ $this->view->addclient = $addclient;
}
}
@@ -69,8 +66,8 @@ class ClientController extends Zend_Controller_Action
$this->view->editclient = $editclient;
}
else{
- $addfilterform = new Application_Form_Client($_POST);
- if ($addfilterform->isValid($_POST) || ($mac != '' && $hh != '') ) {
+ $editclient = new Application_Form_Client($_POST);
+ if ($editclient->isValid($_POST) || ($mac != '' && $hh != '') ) {
$client = new Application_Model_Client($_POST);
$client->setID($this->_request->getParam('clientID'));
$clientmapper = new Application_Model_ClientMapper();
@@ -78,9 +75,7 @@ class ClientController extends Zend_Controller_Action
print_a('updated');
$this->_redirect('/client');
}
- else{
- print_a('no update');
- }
+ $this->view->editclient = $editclient;
}
}
diff --git a/application/controllers/FilterController.php b/application/controllers/FilterController.php
index 54bcb19..2853706 100644
--- a/application/controllers/FilterController.php
+++ b/application/controllers/FilterController.php
@@ -19,27 +19,27 @@ class FilterController extends Zend_Controller_Action
public function indexAction()
{
try{
- $this->_filtermapper = new Application_Model_FilterMapper();
- $this->view->filters = $this->_filtermapper->fetchAll();
+ $this->_filtermapper = new Application_Model_FilterMapper();
+ $this->view->filters = $this->_filtermapper->fetchAll();
}catch (Zend_Exception $e) {
- echo "Error message 2: " . $e->getMessage() . "\n";
+ echo "Error message 2: " . $e->getMessage() . "\n";
}
}
public function addfilterAction()
{
- if (!isset($_POST["add"])){
- $addfilterform = new Application_Form_FilterAdd();
- $this->view->addfilterform = $addfilterform;
+ $bmmapper = new Application_Model_BootMenuMapper();
+ //TODO get bootmenu by group
+ $bootmenus = $bmmapper->fetchAll();
+ if (!isset($_POST["add"])){
+ $addfilterform = new Application_Form_FilterAdd(array('bootmenus'=>$bootmenus));
+ $this->view->addfilterform = $addfilterform;
}else {
- $addfilterform = new Application_Form_FilterAdd($_POST);
+ $addfilterform = new Application_Form_FilterAdd(array('bootmenus'=>$bootmenus),$_POST);
if ($addfilterform->isValid($_POST)) {
try{
- $newfilter = new Application_Model_Filter();
- $newfilter->setTitle($_POST['title']);
+ $newfilter = new Application_Model_Filter($_POST);
$newfilter->setCreated(time());
- $newfilter->setDescription($_POST['description']);
- $newfilter->setPriority($_POST['priority']);
// TODO: Ändere mit ACL
$newfilter->setGroupID('1');
@@ -54,6 +54,7 @@ class FilterController extends Zend_Controller_Action
echo "Error message 2: " . $e->getMessage() . "\n";
}
}
+ $this->view->addfilterform = $addfilterform;
}
}
@@ -73,6 +74,9 @@ class FilterController extends Zend_Controller_Action
public function editfilterAction()
{
+ $bmmapper = new Application_Model_BootMenuMapper();
+ //TODO get bootmenu by group
+ $bootmenus = $bmmapper->fetchAll();
if (!isset($_POST["add"])){
// TODO: ACL implementieren ob er editieren darf
$filterID = $this->_request->getParam('filterID');
@@ -83,7 +87,7 @@ class FilterController extends Zend_Controller_Action
$filtermapper->find($filterID,$filter);
$filter2 = $filter->toArray();
- $editfilterform = new Application_Form_FilterAdd();
+ $editfilterform = new Application_Form_FilterAdd(array('bootmenus'=>$bootmenus));
$editfilterform->populate($filter2);
$this->view->editfilterform = $editfilterform;
@@ -91,7 +95,7 @@ class FilterController extends Zend_Controller_Action
try{
$filterID = $this->_request->getParam('filterID');
- $editfilterform = new Application_Form_FilterAdd($_POST);
+ $editfilterform = new Application_Form_FilterAdd(array('bootmenus'=>$bootmenus),$_POST);
//TODO: ACL integrieren
$_POST['groupID'] = 1;
$_POST['membershipID'] = 1;
@@ -102,16 +106,13 @@ class FilterController extends Zend_Controller_Action
$newfilterenty->setID($this->_request->getParam('filterID'));
$newfilter2 = new Application_Model_FilterMapper();
$newfilter2->save($newfilterenty);
- echo 'valid';
- }
- else
- {
- echo 'not valid';
- }
+ echo 'valid';
+ $this->_redirect('/filter');
+ }
+ $this->view->editfilterform = $editfilterform;
}catch (Zend_Exception $e) {
echo "Error message 2: " . $e->getMessage() . "\n";
}
- $this->_redirect('/filter');
}
}
@@ -120,23 +121,15 @@ class FilterController extends Zend_Controller_Action
// TODO: ACL implementieren ob er editieren darf
if (!isset($_POST["add"])){
- echo "case1";
try{
$editfilterform = new Application_Form_FilterEntriesAdd(array('filterID' => $this->_request->getParam('filterID')));
$this->view->editfilterform = $editfilterform;
- echo "";
- print_r(array('debug','case1'));
- echo "";
-
}catch (Zend_Exception $e) {
echo "Error message 2: " . $e->getMessage() . "\n";
}
} else{
- $editfilterform = new Application_Form_FilterEntriesAdd($_POST);
- echo "case2 ";
-
- if ($editfilterform->isValid($_POST)) {
- echo "case 2.2 ";
+ $editfilterform = new Application_Form_FilterEntriesAdd($_POST);
+ if ($editfilterform->isValid($_POST)) {
$newfilterenty = new Application_Model_FilterEntries();
$newfilterenty->setFilterID($_POST['filterID']);
$newfilterenty->setFiltertypeID($_POST['filtertypeID']);
@@ -151,12 +144,10 @@ class FilterController extends Zend_Controller_Action
}
$newfilter2 = new Application_Model_FilterEntriesMapper();
- echo "";
- print_r($newfilterenty);
- echo " ";
$newfilter2->save($newfilterenty);
+ $this->_redirect('/filter');
}
- $this->_redirect('/filter');
+ $this->view->editfilterform = $editfilterform;
}
}
public function editfilterentryAction()
@@ -174,13 +165,9 @@ class FilterController extends Zend_Controller_Action
$editfilterform = new Application_Form_FilterEntriesAdd();
- echo "";
- print_r($filterentry->toArray());
- echo " ";
$editfilterform->populate($filterentry->toArray());
$editfilterform->setFilterID($filterID);
$this->view->editfilterform = $editfilterform;
- echo "case 1.1";
}catch (Zend_Exception $e) {
echo "Error message 2: " . $e->getMessage() . "\n";
@@ -189,8 +176,7 @@ class FilterController extends Zend_Controller_Action
try{
$filterentriesID = $this->_request->getParam('filterentriesID');
$editfilterform = new Application_Form_FilterEntriesAdd($_POST);
- if ($editfilterform->isValid($_POST)) {
- echo "valid\n";
+ if ($editfilterform->isValid($_POST)) {
$newfilterenty = new Application_Model_FilterEntries($_POST);
$newfilterenty->setID($filterentriesID);
if($_POST['filtertypeID'] == 1){
@@ -201,20 +187,15 @@ class FilterController extends Zend_Controller_Action
$newfilterenty->setFiltervalue($_POST['filtervalue']);
$newfilterenty->setFiltervalue2($_POST['filtervalue2']);
}
- echo "";
- print_r($newfilterenty);
- echo " ";
$newfilter2 = new Application_Model_FilterEntriesMapper();
$newfilter2->save($newfilterenty);
+ $this->_redirect('/filter');
}
- else{
- echo 'nö';
- }
+ $this->view->editfilterform = $editfilterform;
}catch (Zend_Exception $e) {
echo "Error message 2: " . $e->getMessage() . "\n";
}
- $this->_redirect('/filter');
}
}
public function removefilterentryAction()
@@ -260,8 +241,7 @@ class FilterController extends Zend_Controller_Action
public function evaluateAction(){
$db = $this->db;
$showPartResults = false;
- try{
-
+ try{
$mysession = '1';
$filtertypID = 8;
diff --git a/application/controllers/PoolController.php b/application/controllers/PoolController.php
index cb38a80..7c5092e 100644
--- a/application/controllers/PoolController.php
+++ b/application/controllers/PoolController.php
@@ -25,7 +25,6 @@ class PoolController extends Zend_Controller_Action
$assignedclientsArray[] = $c->toArray();
}
$freeclients = $this->arrayDiff($clientsArray,$assignedclientsArray);
- #print_a($freeclients);
$this->view->freeclients = $freeclients;
@@ -49,6 +48,7 @@ class PoolController extends Zend_Controller_Action
echo "Error message 2: " . $e->getMessage() . "\n";
}
}
+ $this->view->addpool = $addfilterform;
}
}
@@ -80,8 +80,8 @@ class PoolController extends Zend_Controller_Action
$this->view->editpoolform = $editpool;
}else {
- $addpoolform = new Application_Form_Pool($_POST);
- if ($addpoolform->isValid($_POST)) {
+ $editpoolform = new Application_Form_Pool($_POST);
+ if ($editpoolform->isValid($_POST)) {
try{
$pool = new Application_Model_Pool($_POST);
$pool->setID($this->_request->getParam('poolID'));
@@ -92,6 +92,7 @@ class PoolController extends Zend_Controller_Action
echo "Error message 2: " . $e->getMessage() . "\n";
}
}
+ $this->view->editpoolform = $editpoolform;
}
}
@@ -99,10 +100,8 @@ class PoolController extends Zend_Controller_Action
{
$clientID = $this->_request->getParam('clientID');
$poolID = $this->_request->getParam('poolID');
- print_a($clientID,$poolID);
if(!isset($_POST['clientID']) && ($clientID == '' && $poolID == '')){
- print_a($_POST);
$clientmapper = new Application_Model_ClientMapper();
$clients = $clientmapper->fetchAll();
foreach($clients as $c){
@@ -117,10 +116,8 @@ class PoolController extends Zend_Controller_Action
$poolclient = new Application_Form_PoolClient(array('clients'=> $freeclients));
$this->view->poolclient = $poolclient;
- }else {
- #$_POST['poolID'] = $this->_request->getParam('poolID');
- $poolclientform = new Application_Form_PoolClient($_POST);
-
+ }else {
+ $poolclient = new Application_Form_PoolClient($_POST);
try{
$pool = new Application_Model_PoolEntries($_POST);
$pool->setPoolID($this->_request->getParam('poolID'));
@@ -133,6 +130,7 @@ class PoolController extends Zend_Controller_Action
}catch (Zend_Exception $e) {
echo "Error message 2: " . $e->getMessage() . "\n";
}
+ $this->view->poolclient = $poolclient;
}
}
@@ -156,15 +154,11 @@ class PoolController extends Zend_Controller_Action
if(is_numeric($poolentriesID)){
$deletepoolentries = new Application_Model_PoolEntries();
$deletepoolentries->setID($poolentriesID);
- echo "";
- print_r($deletepoolentries);
- echo " ";
$deletepoolentriesmapper = new Application_Model_PoolEntriesMapper();
$deletepoolentriesmapper->delete($deletepoolentries);
echo "ok";
}
-# echo "ready";
$this->_redirect('/pool');
}
diff --git a/application/forms/FilterAdd.php b/application/forms/FilterAdd.php
index af4f9b2..091eb37 100644
--- a/application/forms/FilterAdd.php
+++ b/application/forms/FilterAdd.php
@@ -2,6 +2,7 @@
class Application_Form_FilterAdd extends Zend_Form
{
+ private $bootmenus;
public function init()
{
@@ -22,14 +23,16 @@ class Application_Form_FilterAdd extends Zend_Form
'label' => 'Description:',
));
- $this->addElement('text', 'bootmenuID', array(
- 'filters' => array('StringTrim'),
- 'validators' => array(
- array('StringLength', false, array(0, 50)),
- ),
- 'required' => true,
- 'label' => 'bootmenuID:',
- ));
+ $bootmenufield = $this->createElement('select','bootmenuID');
+ $bootmenufield ->setLabel('Bootmenu:');
+
+ if(count($this->bootmenus)>0){
+ foreach($this->bootmenus as $id => $g){
+ $bootmenufield->addMultiOption($g->getID(), $g->getTitle());
+ }
+ }
+ $bootmenufield->setRegisterInArrayValidator(false);
+ $this->addElement($bootmenufield);
$this->addElement('text', 'priority', array(
'filters' => array('StringTrim'),
@@ -45,7 +48,10 @@ class Application_Form_FilterAdd extends Zend_Form
'label' => 'Save',
));
}
-
+ function setBootmenus($val){
+ $this->bootmenus = $val;
+ return;
+ }
}
diff --git a/application/views/scripts/filter/index.phtml b/application/views/scripts/filter/index.phtml
index 6f98b4c..a3d3efa 100644
--- a/application/views/scripts/filter/index.phtml
+++ b/application/views/scripts/filter/index.phtml
@@ -43,13 +43,17 @@
'default',
true) ?>"> |
+ findBy('filterID',$filter->getID()));
+ $erg = $fe->findBy('filterID',$filter->getID());
+ ?>
+ 0): ?>
| ↳ |
findBy('filterID',$filter->getID()));
- $erg = $fe->findBy('filterID',$filter->getID());
+
?>
|
+
diff --git a/application/views/scripts/pool/index.phtml b/application/views/scripts/pool/index.phtml
index f89dbc9..2c6ba16 100644
--- a/application/views/scripts/pool/index.phtml
+++ b/application/views/scripts/pool/index.phtml
@@ -43,6 +43,11 @@
'default',
true) ?>">
+ findBy('poolID',$pool->getID());
+ ?>
+ 0): ?>
| ↳ |
@@ -54,8 +59,6 @@
| Actions |
findBy('poolID',$pool->getID());
foreach ($clients as $client): ?>
|
@@ -77,14 +80,18 @@
+
+
+
Free clients
-| ClientID | MacAdress | Hardwarehash |
-pools as $pool): ?>
- escape($pool->getTitle()) ?> |
-
+
|---|
+| ClientID |
+MacAdress |
+Hardwarehash |
+Actions |
freeclients as $client): ?>
@@ -92,7 +99,8 @@ foreach ($this->freeclients as $client): ?>
|
|
|
- |