summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
authorSimon2011-04-20 18:00:20 +0200
committerSimon2011-04-20 18:00:20 +0200
commit156abd0d614adfffed22e1d4de3168c22bf611c6 (patch)
tree6eac79e0c19ff6a8f5d0983b2090019d38a343a4 /application
parentBootOsUser und HomeType Models hinzugefügt (diff)
downloadpbs2-156abd0d614adfffed22e1d4de3168c22bf611c6.tar.gz
pbs2-156abd0d614adfffed22e1d4de3168c22bf611c6.tar.xz
pbs2-156abd0d614adfffed22e1d4de3168c22bf611c6.zip
Created bei Client hinzugefügt
Diffstat (limited to 'application')
-rw-r--r--application/models/Client.php10
-rw-r--r--application/models/ClientMapper.php15
-rw-r--r--application/modules/fbgui/controllers/IndexController.php1
-rw-r--r--application/modules/user/controllers/ClientController.php12
-rw-r--r--application/modules/user/controllers/PoolController.php7
-rw-r--r--application/modules/user/views/scripts/client/index.phtml3
-rw-r--r--application/modules/user/views/scripts/pool/index.phtml8
7 files changed, 47 insertions, 9 deletions
diff --git a/application/models/Client.php b/application/models/Client.php
index a63e8ba..e8108ef 100644
--- a/application/models/Client.php
+++ b/application/models/Client.php
@@ -16,6 +16,7 @@ class Application_Model_Client
protected $_groupID;
protected $_macadress;
protected $_hardwarehash;
+ protected $_created;
public function __construct(array $options = null)
{
@@ -91,6 +92,15 @@ class Application_Model_Client
$this->_hardwarehash = $_hardwarehash;
return $this;
}
+ public function getCreated()
+ {
+ return $this->_created;
+ }
+ public function setCreated($_created)
+ {
+ $this->_created = $_created;
+ return $this;
+ }
/**
* Returns current data as associative array using ReflectionClass
*
diff --git a/application/models/ClientMapper.php b/application/models/ClientMapper.php
index d727352..bcb3286 100644
--- a/application/models/ClientMapper.php
+++ b/application/models/ClientMapper.php
@@ -87,7 +87,8 @@ class Application_Model_ClientMapper
$data = array('clientID'=> $client->getID() ,
'groupID' => $client->getGroupID(),
'macadress'=> $client->getMacadress() ,
- 'hardwarehash'=> $client->getHardwarehash()
+ 'hardwarehash'=> $client->getHardwarehash(),
+ 'created'=> $client->getCreated()
);
if (null === ($id = $client->getID()) ) {
@@ -116,7 +117,11 @@ class Application_Model_ClientMapper
$row = $result->current();
- $client->setID($row->clientID)->setGroupID($row->groupID)->setMacadress($row->macadress)->setHardwarehash($row->hardwarehash);
+ $client->setID($row->clientID)
+ ->setGroupID($row->groupID)
+ ->setMacadress($row->macadress)
+ ->setHardwarehash($row->hardwarehash)
+ ->setCreated($row->created);
}
public function fetchAll()
@@ -126,7 +131,11 @@ class Application_Model_ClientMapper
foreach ($resultSet as $row) {
$entry = new Application_Model_Client();
- $entry->setID($row->clientID)->setGroupID($row->groupID)->setMacadress($row->macadress)->setHardwarehash($row->hardwarehash);
+ $entry->setID($row->clientID)
+ ->setGroupID($row->groupID)
+ ->setMacadress($row->macadress)
+ ->setHardwarehash($row->hardwarehash)
+ ->setCreated($row->created);
$entries[] = $entry;
}
diff --git a/application/modules/fbgui/controllers/IndexController.php b/application/modules/fbgui/controllers/IndexController.php
index 150f1c5..d2b21be 100644
--- a/application/modules/fbgui/controllers/IndexController.php
+++ b/application/modules/fbgui/controllers/IndexController.php
@@ -75,6 +75,7 @@ class Fbgui_IndexController extends Zend_Controller_Action
$client->setMacadress($mySession->postdata['mac']);
$client->setHardwarehash($mySession->postdata['hardwarehash']);
$client->setGroupID($groupID);
+ $client->setCreated(time());
$client = $n->createClient($client);
$clientID = $client->getID();
diff --git a/application/modules/user/controllers/ClientController.php b/application/modules/user/controllers/ClientController.php
index 687e910..589fcdc 100644
--- a/application/modules/user/controllers/ClientController.php
+++ b/application/modules/user/controllers/ClientController.php
@@ -69,7 +69,12 @@ class User_ClientController extends Zend_Controller_Action
$clientsInGroup = $mySearch->search($clientsInGroup);
}
$this->view->searchform = $mySearch->searchForm();
-
+
+ // Format Time-String
+ foreach($clientsInGroup as $k=>$cig){
+ $clientsInGroup[$k]['created'] = date(Zend_Registry::get('dateformat'),$cig['created']);
+ }
+
// Pagination
$pagination = new Pbs_Pagination();
$pagination->setPerPage(10);
@@ -111,7 +116,8 @@ class User_ClientController extends Zend_Controller_Action
$mac = ($mac!='')?$mac:$_POST['macadress'];
$hh = ($hh!='')?$hh:$_POST['hardwarehash'];
$client->setMacadress($mac);
- $client->setHardwarehash($hh);
+ $client->setHardwarehash($hh);
+ $client->setCreated(time());
$client->setGroupID($this->membership->getGroupID());
$clientmapper = new Application_Model_ClientMapper();
$clientmapper->save($client);
@@ -178,6 +184,8 @@ class User_ClientController extends Zend_Controller_Action
$dbclient = new Application_Model_Client();
$clientMapper = new Application_Model_ClientMapper();
$clientMapper->find($this->_request->getParam('clientID'),$dbclient);
+
+ $client->setCreated($dbclient->getCreated());
if($dbclient->getGroupID() == $this->membership->getGroupID()){
$client->setGroupID($this->membership->getGroupID());
diff --git a/application/modules/user/controllers/PoolController.php b/application/modules/user/controllers/PoolController.php
index 3d6c0a7..3d6a0f5 100644
--- a/application/modules/user/controllers/PoolController.php
+++ b/application/modules/user/controllers/PoolController.php
@@ -112,7 +112,12 @@ class User_PoolController extends Zend_Controller_Action
// extract the un-assigned clients from the clientlist of the group
$freeclients = $this->arrayDiff($clientsArray,$assignedclientsArray);
-
+
+ // Format Time-String
+ foreach($freeclients as $k=>$cig){
+ $freeclients[$k]['created'] = date(Zend_Registry::get('dateformat'),$cig['created']);
+ }
+
if(Pbs_Acl::checkRight('posuc'))
$this->view->freeclients = $freeclients;
}
diff --git a/application/modules/user/views/scripts/client/index.phtml b/application/modules/user/views/scripts/client/index.phtml
index b519140..6f7a806 100644
--- a/application/modules/user/views/scripts/client/index.phtml
+++ b/application/modules/user/views/scripts/client/index.phtml
@@ -11,6 +11,7 @@
<div class='code'>clientID</div>
<div class='code'>macadress</div>
<div class='code'>hardwarehash</div>
+ <div class='code'>created</div>
</div>
<div class='listelement'>
@@ -55,6 +56,8 @@
<div class='item'><?php echo $this->escape($client['macadress']) ?></div>
<label>Hardwarehash</label>
<div class='item'><?php echo $this->escape($client['hardwarehash']) ?></div>
+ <label>Created</label>
+ <div class='item'><?php echo $this->escape($client['created']) ?></div>
</div>
</div>
<div class='clear'></div>
diff --git a/application/modules/user/views/scripts/pool/index.phtml b/application/modules/user/views/scripts/pool/index.phtml
index 56ae8d5..f78df6a 100644
--- a/application/modules/user/views/scripts/pool/index.phtml
+++ b/application/modules/user/views/scripts/pool/index.phtml
@@ -144,7 +144,7 @@
<div class='content'>
<div class='actions'>
<?php if(Pbs_Acl::checkRight('polc')):?>
- <select onChange="location.href=this.options[this.selectedIndex].value">
+ Pool:<select onChange="location.href=this.options[this.selectedIndex].value">
<option></option>
<?php foreach ($this->pools as $pool): ?>
<option value="<?php echo $this->url(
@@ -165,9 +165,11 @@
</div>
<div class='details'>
<label>MacAdress</label>
- <div class='item'><?php echo $client['macadress']; ?></div>
+ <div class='item'><?php echo $this->escape($client['macadress']); ?></div>
<label>HardwareHash</label>
- <div class='item'><?php echo $client['hardwarehash']; ?></div>
+ <div class='item'><?php echo $this->escape($client['hardwarehash']); ?></div>
+ <label>Created</label>
+ <div class='item'><?php echo $this->escape($client['created']) ?></div>
</div>
</div>
<div class='clear'></div>