summaryrefslogtreecommitdiffstats
path: root/application/modules/user/forms/Preboot.php
diff options
context:
space:
mode:
authorMichael Neves2012-01-26 15:56:42 +0100
committerMichael Neves2012-01-26 15:56:42 +0100
commitdd8dbbcdde46419dd1ad193a8170cde5ca24630b (patch)
tree501f81c7e1dfe00d420175f32bbb36bc39ece3e6 /application/modules/user/forms/Preboot.php
parentAdded Preboottype Model, changed bootiso and preboot model (diff)
downloadpbs2-dd8dbbcdde46419dd1ad193a8170cde5ca24630b.tar.gz
pbs2-dd8dbbcdde46419dd1ad193a8170cde5ca24630b.tar.xz
pbs2-dd8dbbcdde46419dd1ad193a8170cde5ca24630b.zip
Preboot Serial and type in View
Diffstat (limited to 'application/modules/user/forms/Preboot.php')
-rw-r--r--application/modules/user/forms/Preboot.php18
1 files changed, 18 insertions, 0 deletions
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'))),