diff options
| author | michael pereira | 2011-03-10 15:48:39 +0100 |
|---|---|---|
| committer | michael pereira | 2011-03-10 15:48:39 +0100 |
| commit | 580448f3dc83b63137a6172ca7d3e4f8b3c63cf3 (patch) | |
| tree | c541666235a27f027f9cda2ae902e39650f96959 | |
| parent | Resource Controller (diff) | |
| parent | Merge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2 (diff) | |
| download | pbs2-580448f3dc83b63137a6172ca7d3e4f8b3c63cf3.tar.gz pbs2-580448f3dc83b63137a6172ca7d3e4f8b3c63cf3.tar.xz pbs2-580448f3dc83b63137a6172ca7d3e4f8b3c63cf3.zip | |
Merge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2
| -rw-r--r-- | application/layouts/main.phtml | 1 | ||||
| -rw-r--r-- | application/models/ConfigMapper.php | 13 | ||||
| -rw-r--r-- | application/models/GroupMapper.php | 13 | ||||
| -rw-r--r-- | application/models/MembershipMapper.php | 13 | ||||
| -rw-r--r-- | application/models/PersonMapper.php | 13 | ||||
| -rw-r--r-- | application/views/scripts/bootmenu/index.phtml | 9 | ||||
| -rw-r--r-- | pbs.sql | 8 | ||||
| -rw-r--r-- | public/media/img/play.gif | bin | 0 -> 113 bytes |
8 files changed, 54 insertions, 16 deletions
diff --git a/application/layouts/main.phtml b/application/layouts/main.phtml index 57d09c7..ca09e42 100644 --- a/application/layouts/main.phtml +++ b/application/layouts/main.phtml @@ -25,6 +25,7 @@ echo $this->headScript()."\n"; <li><a href='/bootmenu'>BootMenu</a></li> <li><a href='/config'>Config</a></li> <li><a href='/bootos'>BootOs</a></li> + <li><a href='/resource'>Resource</a></li> <li><a href='/client'>Client</a></li> <li><a href='/filter'>Filter</a></li> <li><a href='/pool'>Pool</a></li> diff --git a/application/models/ConfigMapper.php b/application/models/ConfigMapper.php index da7a073..d8a23c4 100644 --- a/application/models/ConfigMapper.php +++ b/application/models/ConfigMapper.php @@ -66,9 +66,14 @@ class Application_Model_ConfigMapper } } - public function find($id) + public function find($id, Application_Model_Config $config = null) { - $config = new Application_Model_Config(); + if($config == null){ + $return = true; + } + if($return){ + $config = new Application_Model_Config(); + } $result = $this->getDbTable()->find($id); if (0 == count($result)) { return; @@ -77,7 +82,9 @@ class Application_Model_ConfigMapper $row = $result->current(); $config->setID($row->configID)->setGroupID($row->groupID)->setMembershipID($row->membershipID)->setCreated($row->created)->setShellscript($row->shellscript)->setTitle($row->title); - return $config; + if($return){ + return $config; + } } public function fetchAll() diff --git a/application/models/GroupMapper.php b/application/models/GroupMapper.php index d43b3f1..463f3d1 100644 --- a/application/models/GroupMapper.php +++ b/application/models/GroupMapper.php @@ -66,9 +66,14 @@ class Application_Model_GroupMapper } } - public function find($id) + public function find($id,Application_Model_Group $group = null) { - $group = new Application_Model_Group(); + if($group == null){ + $return = true; + } + if($return){ + $group = new Application_Model_Group(); + } $result = $this->getDbTable()->find($id); if (0 == count($result)) { return; @@ -77,7 +82,9 @@ class Application_Model_GroupMapper $row = $result->current(); $group->setID($row->groupID)->setTitle($row->title)->setDescription($row->description); - return $group; + if($return){ + return $group; + } } public function fetchAll() diff --git a/application/models/MembershipMapper.php b/application/models/MembershipMapper.php index 2a6e57d..313248c 100644 --- a/application/models/MembershipMapper.php +++ b/application/models/MembershipMapper.php @@ -66,9 +66,14 @@ class Application_Model_MembershipMapper } } - public function find($id) + public function find($id, Application_Model_Membership $membership = null) { - $membership = new Application_Model_Membership(); + if($membership == null){ + $return = true; + } + if($return){ + $membership = new Application_Model_Membership(); + } $result = $this->getDbTable()->find($id); if (0 == count($result)) { return; @@ -77,7 +82,9 @@ class Application_Model_MembershipMapper $row = $result->current(); $membership->setID($row->membershipID)->setGroupID($row->groupID)->setRoleID($row->roleID)->setPersonID($row->personID); - return $membership; + if($return){ + return $membership; + } } public function fetchAll() diff --git a/application/models/PersonMapper.php b/application/models/PersonMapper.php index 038670d..b2cbf39 100644 --- a/application/models/PersonMapper.php +++ b/application/models/PersonMapper.php @@ -66,9 +66,14 @@ class Application_Model_PersonMapper } } - public function find($id) + public function find($id,Application_Model_Person $person = null) { - $person = new Application_Model_Person(); + if($person == null){ + $return = true; + } + if($return){ + $person = new Application_Model_Person(); + } $result = $this->getDbTable()->find($id); if (0 == count($result)) { return; @@ -77,7 +82,9 @@ class Application_Model_PersonMapper $row = $result->current(); $person->setID($row->personID)->setTitle($row->title)->setName($row->name)->setFirstname($row->firstname)->setStreet($row->street)->setHousenumber($row->housenumber)->setCity($row->city)->setPostalcode($row->postalcode)->setLogindate($row->logindate)->setRegisterdate($row->registerdate)->setEmail($row->email)->setLogin($row->login)->setPassword($row->password)->setPasswordSalt($row->password_salt); - return $person; + if($return){ + return $person; + } } public function fetchAll() diff --git a/application/views/scripts/bootmenu/index.phtml b/application/views/scripts/bootmenu/index.phtml index 6fb55e4..fa722e4 100644 --- a/application/views/scripts/bootmenu/index.phtml +++ b/application/views/scripts/bootmenu/index.phtml @@ -55,7 +55,7 @@ <td colspan=7> <table> <tr> - + <th></th> <th>ID</th> <th>Title</th> <!-- <th>BootmenuID</th>--> @@ -70,7 +70,12 @@ <?php foreach ($this->bootmenuentrylist[$bootmenu->getID()] as $bootmenuentry): ?> <?php $bootos = $this->bootosmapper->find($bootmenuentry->getBootosID());?> <?php $config = $this->configmapper->find($bootmenuentry->getConfigID());?> - <tr> + <tr> + <td class='action'> + <a href='/resource/getbootmenuentry/bootmenuentryID/<?php echo $bootmenuentry->getID();?>'> + <img src='/media/img/play.gif'> + </a> + </td> <td><?php echo $this->escape($bootmenuentry->getID()); ?></td> <td><?php echo $this->escape($bootmenuentry->getTitle()); ?></td> <!--<td><?php echo $this->escape($bootmenuentry->getBootmenuID()); ?></td> @@ -33,6 +33,7 @@ ALTER TABLE `pbs_role` CREATE TABLE IF NOT EXISTS `pbs_rightroles` ( `roleID` int(11) NOT NULL, `rightID` int(11) NOT NULL, + PRIMARY KEY (`roleID`,`rightID`), KEY `roleID` (`roleID`), KEY `rightID` (`rightID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; @@ -45,6 +46,7 @@ ALTER TABLE `pbs_rightroles` CREATE TABLE IF NOT EXISTS `pbs_groupgroups` ( `parentID` int(11) NOT NULL, `groupID` int(11) NOT NULL, + PRIMARY KEY (`parentID`,`groupID`), KEY `parentID` (`parentID`), KEY `groupID` (`groupID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; @@ -231,6 +233,7 @@ CREATE TABLE IF NOT EXISTS `pbs_pool` ( CREATE TABLE IF NOT EXISTS `pbs_poolentries` ( `poolID` int(11) NOT NULL, `clientID` int(11) NOT NULL, + PRIMARY KEY (`poolID`,`clientID`), KEY `poolID` (`poolID`), KEY `clientID` (`clientID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; @@ -263,6 +266,7 @@ ALTER TABLE `pbs_filter` CREATE TABLE IF NOT EXISTS `pbs_membershipfilters` ( `membershipID` int(11) NOT NULL, `filterID` int(11) NOT NULL, + PRIMARY KEY (`membershipID`,`filterID`), KEY `membershipID` (`membershipID`), KEY `filterID` (`filterID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; @@ -274,6 +278,7 @@ ALTER TABLE `pbs_membershipfilters` CREATE TABLE IF NOT EXISTS `pbs_poolfilters` ( `poolID` int(11) NOT NULL, `filterID` int(11) NOT NULL, + PRIMARY KEY (`poolID`,`filterID`), KEY `poolID` (`poolID`), KEY `filterID` (`filterID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; @@ -293,6 +298,7 @@ CREATE TABLE IF NOT EXISTS `pbs_filterentries` ( `filtertypeID` int(11) NOT NULL, `filtervalue` varchar(140) NOT NULL, `filtervalue2` varchar(140) NOT NULL, + PRIMARY KEY (`filterID`,`filtertypeID`), KEY `filterID` (`filterID`), KEY `filtertypeID` (`filtertypeID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; @@ -302,7 +308,6 @@ ALTER TABLE `pbs_filterentries` ADD CONSTRAINT `pbs_filterentries_ibfk_1` FOREIGN KEY (`filterID`) REFERENCES `pbs_filter` (`filterID`) ON DELETE CASCADE, ADD CONSTRAINT `pbs_filterentries_ibfk_2` FOREIGN KEY (`filtertypeID`) REFERENCES `pbs_filtertype` (`filtertypeID`) ON DELETE CASCADE; - -- Insert Filtertypes INSERT INTO `pbs`.`pbs_filtertype` (`filtertypeID`, `filtertypename`) VALUES (NULL, 'IP'); INSERT INTO `pbs`.`pbs_filtertype` (`filtertypeID`, `filtertypename`) VALUES (NULL, 'MAC'); @@ -313,4 +318,3 @@ INSERT INTO `pbs`.`pbs_filtertype` (`filtertypeID`, `filtertypename`) VALUES (NU INSERT INTO `pbs`.`pbs_filtertype` (`filtertypeID`, `filtertypename`) VALUES (NULL, 'Time'); INSERT INTO `pbs`.`pbs_filtertype` (`filtertypeID`, `filtertypename`) VALUES (NULL, 'Client'); - diff --git a/public/media/img/play.gif b/public/media/img/play.gif Binary files differnew file mode 100644 index 0000000..b3045c9 --- /dev/null +++ b/public/media/img/play.gif |
