diff options
| author | Simon | 2011-04-08 17:55:55 +0200 |
|---|---|---|
| committer | Simon | 2011-04-08 17:55:55 +0200 |
| commit | 63f0c0060bce22ed4a994f5bda013676f327ebf0 (patch) | |
| tree | b98a1ad9646cdac647dc87c8f120a3e3b9d1ec38 | |
| parent | Recht: 'Edit role' hinzugefügt (diff) | |
| parent | kcl fixed (diff) | |
| download | pbs2-63f0c0060bce22ed4a994f5bda013676f327ebf0.tar.gz pbs2-63f0c0060bce22ed4a994f5bda013676f327ebf0.tar.xz pbs2-63f0c0060bce22ed4a994f5bda013676f327ebf0.zip | |
Merge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2
| -rw-r--r-- | application/modules/user/controllers/BootmenuController.php | 29 | ||||
| -rw-r--r-- | application/modules/user/forms/BootmenuEntries.php | 22 | ||||
| -rw-r--r-- | application/modules/user/views/scripts/bootmenu/index.phtml | 2 | ||||
| -rw-r--r-- | pbs-newdata.sql | 14 | ||||
| -rw-r--r-- | pbs.sql | 2 |
5 files changed, 39 insertions, 30 deletions
diff --git a/application/modules/user/controllers/BootmenuController.php b/application/modules/user/controllers/BootmenuController.php index adcf08f..03d0362 100644 --- a/application/modules/user/controllers/BootmenuController.php +++ b/application/modules/user/controllers/BootmenuController.php @@ -73,6 +73,12 @@ class user_BootmenuController extends Zend_Controller_Action $bootmenuID = $bm->getID(); $bootmenuentries[$bootmenuID] = $this->bootmenuentriesMapper->findBy(array('bootmenuID' => $bootmenuID)); foreach ($bootmenuentries[$bootmenuID] as $bootmenuentry){ + if($bootmenuentry->getKcl()) + $bootmenuentry->setKcl($bootosMapper->find($bootmenuentry->getBootosID())->getDefaultkcl()); + else + $bootmenuentry->setKcl("deactivated (edit Bootmenuentry to activate)"); + if($bootmenuentry->getKclappend() == null) + $bootmenuentry->setKclappend("none (edit Bootmenuentry to set KCL-Append)"); $bootmenuentry->setBootosID("[".$bootmenuentry->getBootosID()."] ".$bootosMapper->find($bootmenuentry->getBootosID())->getTitle()); $bootmenuentry->setConfigID("[".$bootmenuentry->getConfigID()."] ".$configMapper->find($bootmenuentry->getConfigID())->gettitle()); } @@ -84,6 +90,12 @@ class user_BootmenuController extends Zend_Controller_Action $bootmenuID = $bootmenu[0]->getID(); $bootmenuentries[$bootmenuID] = $this->bootmenuentriesMapper->findBy(array('bootmenuID' => $bootmenuID)); foreach ($bootmenuentries[$bootmenuID] as $bootmenuentry){ + if($bootmenuentry->getKcl()) + $bootmenuentry->setKcl($bootosMapper->find($bootmenuentry->getBootosID())->getDefaultkcl()); + else + $bootmenuentry->setKcl("deactivated (edit Bootmenuentry to activate)"); + if($bootmenuentry->getKclappend() == null) + $bootmenuentry->setKclappend("none"); $bootmenuentry->setBootosID("[".$bootmenuentry->getBootosID()."] ".$bootosMapper->find($bootmenuentry->getBootosID())->getTitle()); $bootmenuentry->setConfigID("[".$bootmenuentry->getConfigID()."] ".$configMapper->find($bootmenuentry->getConfigID())->gettitle()); } @@ -313,17 +325,20 @@ class user_BootmenuController extends Zend_Controller_Action if (!isset($_POST["addbootmenuentry"])){ + if(!isset($_POST['kcl'])) + $_POST['kcl'] = true; + $bootmenuentryForm = new user_Form_BootmenuEntries(array( 'bootoslist'=> $bootoslist, 'bootosanzeige' => $bootosanzeige, 'maxorder'=> $maxorder, 'configlist'=> $configlist, 'page' => $this->page, - 'action' => 'addbootmenuentry' + 'action' => 'addbootmenuentry', )); $bootmenuentryForm->populate(array('order' => $maxorder)); - unset($_POST['kcl']); + unset($_POST['defaultkcl']); unset($_POST['configID']); $bootmenuentryForm->populate($_POST); @@ -335,7 +350,8 @@ class user_BootmenuController extends Zend_Controller_Action 'maxorder'=> $maxorder, 'configlist'=>$configlist, 'page' => $this->page, - 'action' => 'addbootmenuentry'),$_POST); + 'action' => 'addbootmenuentry', + ),$_POST); if ($bootmenuentryForm->isValid($_POST)) { @@ -415,12 +431,14 @@ class user_BootmenuController extends Zend_Controller_Action if (!isset($_POST["editbootmenuentry"])){ + if(!isset($_POST['kcl'])) + $_POST['kcl'] = $bootmenuentry->getKcl(); + $bootmenuentryForm = new user_Form_BootmenuEntries(array( 'bootoslist'=> $bootoslist, 'bootosanzeige' => $bootosanzeige, 'maxorder'=> $maxorder-1, 'configlist'=> $configlist, - 'kcl' => $bootmenuentry->getKcl(), 'page' => $this->page, 'action' => 'editbootmenuentry', )); @@ -429,7 +447,7 @@ class user_BootmenuController extends Zend_Controller_Action $bootmenuentryForm->populate($bootmenuentry->toArray()); } else{ - unset($_POST['kcl']); + unset($_POST['defaultkcl']); unset($_POST['configID']); $bootmenuentryForm->populate($_POST); } @@ -440,7 +458,6 @@ class user_BootmenuController extends Zend_Controller_Action 'bootosanzeige' => $bootosanzeige, 'maxorder'=> $maxorder-1, 'configlist'=> $configlist, - 'kcl' => $bootmenuentry->getKcl(), 'page' => $this->page, 'action' => 'editbootmenuentry'),$_POST); diff --git a/application/modules/user/forms/BootmenuEntries.php b/application/modules/user/forms/BootmenuEntries.php index b897974..58a2820 100644 --- a/application/modules/user/forms/BootmenuEntries.php +++ b/application/modules/user/forms/BootmenuEntries.php @@ -7,13 +7,8 @@ class user_Form_BootmenuEntries extends Zend_Form private $configlist; private $maxorder; private $action; - private $page; - private $kcl; + private $page; - - public function setKcl($kcl){ - $this->kcl = $kcl; - } public function setAction($action){ $this->action = $action; @@ -47,10 +42,7 @@ class user_Form_BootmenuEntries extends Zend_Form @list($key) = array_keys($this->bootoslist); $firstbootos = $this->bootoslist[$key]; $_POST['bootosID'] = $firstbootos->getID(); - if(isset($this->kcl)) - $_POST['kclactive'] = true; - else - $_POST['kclactive'] = false; + } $this->setName($this->action); @@ -78,15 +70,15 @@ class user_Form_BootmenuEntries extends Zend_Form $bootosfield->setRegisterInArrayValidator(false); $this->addElement($bootosfield); - $kclactive = $this->createElement('checkbox','kclactive'); + $kclactive = $this->createElement('checkbox','kcl'); $kclactive->setAttrib('onChange', "document.getElementById('".$this->action."').submit();"); $kclactive->setLabel('Use default KCL:'); - $kclactive->setValue($_POST['kclactive']); + $kclactive->setValue($_POST['kcl']); $this->addElement($kclactive); - if($_POST['kclactive']){ - $this->addElement('textarea', 'kcl', array( + if($_POST['kcl']){ + $this->addElement('textarea', 'defaultkcl', array( 'filters' => array('StringTrim'), 'validators' => array( array('StringLength', false, array(0, 50)), @@ -101,7 +93,7 @@ class user_Form_BootmenuEntries extends Zend_Form )); } - if($_POST['kclactive']) + if($_POST['kcl']) $kcllength = 175 - strlen($this->bootoslist[$_POST['bootosID']]->getDefaultkcl()); else $kcllength = 175; diff --git a/application/modules/user/views/scripts/bootmenu/index.phtml b/application/modules/user/views/scripts/bootmenu/index.phtml index 5d298a5..0b4b12f 100644 --- a/application/modules/user/views/scripts/bootmenu/index.phtml +++ b/application/modules/user/views/scripts/bootmenu/index.phtml @@ -116,7 +116,7 @@ <div class='title'><?php echo $this->escape($bootmenuentry->getTitle()); ?></div> <div class='subtitle'><?php echo $this->escape($bootmenuentry->getBootosID()) ?></div> <div class='details dispnone'> - <label>KCL</label> + <label>Default KCL</label> <div class='item'><?php echo $this->escape($bootmenuentry->getKcl()); ?></div> <label>KCL-Append</label> <div class='item'><?php echo $this->escape($bootmenuentry->getKclappend()); ?></div> diff --git a/pbs-newdata.sql b/pbs-newdata.sql index 0954204..ea67ecf 100644 --- a/pbs-newdata.sql +++ b/pbs-newdata.sql @@ -121,13 +121,13 @@ INSERT INTO `pbs_bootmenu` (`bootmenuID`, `membershipID`, `groupID`, `title`, `c -- Adding BootOs to BootMenus INSERT INTO `pbs_bootmenuentries` (`bootmenuentriesID`, `bootosID`, `bootmenuID`, `title`, `kcl`, `kclappend`, `configID`, `order`) VALUES -(1, 5, 1, '123', 'default kcl 5', 'abc', 1, 0), -(2, 2, 1, 'menu2', 'default kcl 2', '123456', 1, 1), -(3, 6, 1, 'Mein OS 6', 'default kcl 6', 'appending', 1, 2), -(4, 10, 2, 'Das OS 10', 'default kcl 10', 'append', 1, 0), -(5, 9, 5, 'Bootos 9', 'default kcl 9', 'a', 1, 0), -(6, 1, 4, 'booting 1', 'default kcl 1', 'aphabeta', 1, 0), -(7, 6, 3, 'blablabla', 'default kcl 6', '11', 1, 0); +(1, 5, 1, '123', '1', 'abc', 1, 0), +(2, 2, 1, 'menu2', '0', '123456', 1, 1), +(3, 6, 1, 'Mein OS 6', '1', 'appending', 1, 2), +(4, 10, 2, 'Das OS 10', '1', 'append', 1, 0), +(5, 9, 5, 'Bootos 9', '1', 'a', 1, 0), +(6, 1, 4, 'booting 1', '0', 'aphabeta', 1, 0), +(7, 6, 3, 'blablabla', '0', '11', 1, 0); -- Adding client to pools (poolentries) INSERT INTO `pbs_poolentries` (`poolentriesID`, `poolID`, `clientID`) VALUES @@ -176,7 +176,7 @@ CREATE TABLE IF NOT EXISTS `pbs_bootmenuentries` ( `bootosID` int(11) NOT NULL, `bootmenuID` int(11) NOT NULL, `title` varchar(30) NOT NULL, - `kcl` varchar(255), + `kcl` tinyint(1) NOT NULL, `kclappend` varchar(255), `configID` int(11), `order` int(11) NOT NULL, |
