diff options
| author | Michael Neves | 2012-01-26 15:56:42 +0100 |
|---|---|---|
| committer | Michael Neves | 2012-01-26 15:56:42 +0100 |
| commit | dd8dbbcdde46419dd1ad193a8170cde5ca24630b (patch) | |
| tree | 501f81c7e1dfe00d420175f32bbb36bc39ece3e6 /application/modules | |
| parent | Added Preboottype Model, changed bootiso and preboot model (diff) | |
| download | pbs2-dd8dbbcdde46419dd1ad193a8170cde5ca24630b.tar.gz pbs2-dd8dbbcdde46419dd1ad193a8170cde5ca24630b.tar.xz pbs2-dd8dbbcdde46419dd1ad193a8170cde5ca24630b.zip | |
Preboot Serial and type in View
Diffstat (limited to 'application/modules')
| -rw-r--r-- | application/modules/user/controllers/PrebootController.php | 3 | ||||
| -rw-r--r-- | application/modules/user/forms/Preboot.php | 18 | ||||
| -rw-r--r-- | application/modules/user/views/scripts/preboot/index.phtml | 6 |
3 files changed, 26 insertions, 1 deletions
diff --git a/application/modules/user/controllers/PrebootController.php b/application/modules/user/controllers/PrebootController.php index 746cab7..4f83820 100644 --- a/application/modules/user/controllers/PrebootController.php +++ b/application/modules/user/controllers/PrebootController.php @@ -61,9 +61,12 @@ class User_PrebootController extends Zend_Controller_Action { if(!Pbs_Acl::checkRight('pro')) { $this->_redirect('/user/index'); } + $preboottypeMapper = new Application_Model_PreBootTypeMapper(); + $this->view->prebootlist = $this->prebootMapper->findBy(array("groupID" => $groupID)); foreach ($this->view->prebootlist as $preboot) { $preboot->setCreated(date(Zend_Registry::get('dateformat'), $preboot->getCreated())); + $preboot->setPreBootTypeID($preboottypeMapper->find($preboot->getPreBootTypeID())->getName()); } // Search diff --git a/application/modules/user/forms/Preboot.php b/application/modules/user/forms/Preboot.php index 75fc471..bb90f65 100644 --- a/application/modules/user/forms/Preboot.php +++ b/application/modules/user/forms/Preboot.php @@ -57,6 +57,24 @@ class user_Form_Preboot extends Zend_Form { 'cols' => 50, 'label' => 'Description:', )); + + $serial = time(); + for($i = 2; $i < 14; $i += 3) + { + $serial = substr($serial, 0, $i) .'-'. substr($serial, $i, strlen($serial)); + } + + $this->addElement('text', 'serialnumber', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'size' => 50, + 'label' => 'Serialnumber:', + 'readOnly' => $meta, + 'value' => $serial + )); $this->addElement('file', 'preboot', array( 'validators' => array(array('Extension', false, array('zip'))), diff --git a/application/modules/user/views/scripts/preboot/index.phtml b/application/modules/user/views/scripts/preboot/index.phtml index c6fdb79..d332800 100644 --- a/application/modules/user/views/scripts/preboot/index.phtml +++ b/application/modules/user/views/scripts/preboot/index.phtml @@ -12,6 +12,8 @@ <div class='code'>prebootID</div> <div class='code'>title</div> <div class='code'>description</div> + <div class='code'>preboottypeID</div> + <div class='code'>serialnumber</div> <div class='code'>created</div> <div class='code'>source</div> </div> @@ -52,11 +54,13 @@ true) ?>"><img src='/media/img/delete.png' alt='Delete Preboot'/></a> <?php endif; ?> </div> - <div class='title'><?php echo $this->escape($preboot->getTitle()); ?></div> + <div class='title'><?php echo $this->escape($preboot->getTitle()); ?> <?php echo $this->escape($preboot->getPreBootTypeID()); ?></div> <div class='subtitle'><?php echo $this->escape($preboot->getDescription()); ?></div> <div class='details'> <label>PrebootID</label> <div class='item'><?php echo $this->escape($preboot->getID()); ?></div> + <label>Serialnumber</label> + <div class='item'><?php echo $this->escape($preboot->getSerialnumber()); ?></div> <label>Source</label> <div class='item'><?php echo $this->escape($preboot->getSource()); ?></div> <label>Changed</label> |
