diff options
| author | michael pereira | 2011-03-07 18:31:04 +0100 |
|---|---|---|
| committer | michael pereira | 2011-03-07 18:31:04 +0100 |
| commit | 1cc0d2ecc98ce0ed42b7d28ae95b56ec92f49024 (patch) | |
| tree | d5a45f91484e9bbd7f27b4c0f26dab51dc6daed5 | |
| parent | Merge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2 (diff) | |
| download | pbs2-1cc0d2ecc98ce0ed42b7d28ae95b56ec92f49024.tar.gz pbs2-1cc0d2ecc98ce0ed42b7d28ae95b56ec92f49024.tar.xz pbs2-1cc0d2ecc98ce0ed42b7d28ae95b56ec92f49024.zip | |
BootMenu fix
| -rw-r--r-- | application/configs/application.ini | 2 | ||||
| -rw-r--r-- | application/controllers/BootmenuController.php | 6 | ||||
| -rw-r--r-- | application/models/BootMenuEntriesMapper.php | 14 | ||||
| -rw-r--r-- | application/models/DbTable/BootMenuEntries.php | 1 | ||||
| -rw-r--r-- | application/views/scripts/bootmenu/index.phtml | 6 |
5 files changed, 20 insertions, 9 deletions
diff --git a/application/configs/application.ini b/application/configs/application.ini index 226dc30..c02bd7c 100644 --- a/application/configs/application.ini +++ b/application/configs/application.ini @@ -10,7 +10,7 @@ resources.frontController.params.displayExceptions = 0 resources.db.adapter = PDO_MYSQL resources.db.params.host = localhost resources.db.params.username = root -resources.db.params.password = 123456 +resources.db.params.password = lsfks resources.db.params.dbname = pbs resources.db.isDefaultTableAdapter = true resources.view[] = "" diff --git a/application/controllers/BootmenuController.php b/application/controllers/BootmenuController.php index dba15a7..2a0ec8a 100644 --- a/application/controllers/BootmenuController.php +++ b/application/controllers/BootmenuController.php @@ -15,9 +15,10 @@ class BootmenuController extends Zend_Controller_Action $bootmenuentries = array(); $this->view->bootmenulist = $bootmenumapper->fetchAll(); foreach ($this->view->bootmenulist as $bootmenu){ - $bootmenuentries[$bootmenu->getID()] = $bootmenuentriesmapper->find($bootmenu->getID()); + $bootmenuentries[$bootmenu->getID()] = $bootmenuentriesmapper->findBy('bootmenuID',$bootmenu->getID()); } $this->view->bootmenuentrylist = $bootmenuentries; + } public function addbootmenuentryAction() @@ -148,10 +149,11 @@ class BootmenuController extends Zend_Controller_Action if ($editbootmenuentryForm->isValid($_POST)) { $bootmenuentry = new Application_Model_BootMenuEntries($_POST); + $bootmenuentry->setBootmenuID($bootmenuID); $bootmenuentry->setID($bootmenuentryID); - $bootmenumapper = new Application_Model_BootMenuEntriesMapper(); + $bootmenuentrymapper = new Application_Model_BootMenuEntriesMapper(); try { $bootmenuentrymapper->save($bootmenuentry); diff --git a/application/models/BootMenuEntriesMapper.php b/application/models/BootMenuEntriesMapper.php index d697c10..346664c 100644 --- a/application/models/BootMenuEntriesMapper.php +++ b/application/models/BootMenuEntriesMapper.php @@ -13,8 +13,18 @@ class Application_Model_BootMenuEntriesMapper ->from($this->_dbTable) ->where($criteria . ' = ?', $value); $stmt = $select->query(); - $result = $stmt->fetchAll(); - return $result; + $resultSet = $stmt->fetchAll(); + + $entries = array(); + foreach ($resultSet as $row) { + + $entry = new Application_Model_BootMenuEntries($row); + $entry->setID($row['bootmenuentriesID']); + $entries[] = $entry; + } + + return $entries; + }catch (Zend_Exception $e) { echo "Error message 2: " . $e->getMessage() . "\n"; } diff --git a/application/models/DbTable/BootMenuEntries.php b/application/models/DbTable/BootMenuEntries.php index b4ad677..92fb068 100644 --- a/application/models/DbTable/BootMenuEntries.php +++ b/application/models/DbTable/BootMenuEntries.php @@ -4,7 +4,6 @@ class Application_Model_DbTable_BootMenuEntries extends Zend_Db_Table_Abstract { protected $_name = 'pbs_bootmenuentries'; - protected $_primary = 'bootmenuID'; } diff --git a/application/views/scripts/bootmenu/index.phtml b/application/views/scripts/bootmenu/index.phtml index d7acbac..e40ac90 100644 --- a/application/views/scripts/bootmenu/index.phtml +++ b/application/views/scripts/bootmenu/index.phtml @@ -71,7 +71,8 @@ tr.bootentry{background-color:#E0ECF8;} array( 'controller' => 'bootmenu', 'action' => 'editbootmenuentry', - 'bootmenuentryID' => $bootmenuentry->getID() + 'bootmenuentryID' => $bootmenuentry->getID(), + 'bootmenuID' => $bootmenu->getID() ), 'default', true, false) ?>">Edit Entry</a></td> @@ -79,8 +80,7 @@ tr.bootentry{background-color:#E0ECF8;} array( 'controller' => 'bootmenu', 'action' => 'removebootmenuentry', - 'bootmenuentryID' => $bootmenuentry->getID(), - 'bootmenuID' => $bootmenu->getID() + 'bootmenuentryID' => $bootmenuentry->getID() ), 'default', true) ?>">Remove Entry</a></td> |
