From dd8dbbcdde46419dd1ad193a8170cde5ca24630b Mon Sep 17 00:00:00 2001 From: Michael Neves Date: Thu, 26 Jan 2012 15:56:42 +0100 Subject: Preboot Serial and type in View --- .../modules/user/controllers/PrebootController.php | 3 +++ application/modules/user/forms/Preboot.php | 18 ++++++++++++++++++ .../modules/user/views/scripts/preboot/index.phtml | 6 +++++- 3 files changed, 26 insertions(+), 1 deletion(-) (limited to 'application/modules') 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 @@
prebootID
title
description
+
preboottypeID
+
serialnumber
created
source
@@ -52,11 +54,13 @@ true) ?>">Delete Preboot -
escape($preboot->getTitle()); ?>
+
escape($preboot->getTitle()); ?> escape($preboot->getPreBootTypeID()); ?>
escape($preboot->getDescription()); ?>
escape($preboot->getID()); ?>
+ +
escape($preboot->getSerialnumber()); ?>
escape($preboot->getSource()); ?>
-- cgit v1.2.3-55-g7522