diff options
author | Björn Geiger | 2011-03-28 12:56:10 +0200 |
---|---|---|
committer | Björn Geiger | 2011-03-28 12:56:10 +0200 |
commit | 84f8c7b61f61ff68e9568e01c23689d591dc4828 (patch) | |
tree | 35d6e718bdb2d6413a34d5d1bc5be40db76bb2bd /application/modules/user/views/scripts/group | |
parent | updatebutton geadded (diff) | |
download | pbs2-84f8c7b61f61ff68e9568e01c23689d591dc4828.tar.gz pbs2-84f8c7b61f61ff68e9568e01c23689d591dc4828.tar.xz pbs2-84f8c7b61f61ff68e9568e01c23689d591dc4828.zip |
Groupcontroller User Module
Diffstat (limited to 'application/modules/user/views/scripts/group')
6 files changed, 244 insertions, 1 deletions
diff --git a/application/modules/user/views/scripts/group/add.phtml b/application/modules/user/views/scripts/group/add.phtml new file mode 100644 index 0000000..4f96cf0 --- /dev/null +++ b/application/modules/user/views/scripts/group/add.phtml @@ -0,0 +1,4 @@ +<?php +$this->addForm->setAction($this->url()); +echo $this->addForm; +?>
\ No newline at end of file diff --git a/application/modules/user/views/scripts/group/edit.phtml b/application/modules/user/views/scripts/group/edit.phtml new file mode 100644 index 0000000..d513dea --- /dev/null +++ b/application/modules/user/views/scripts/group/edit.phtml @@ -0,0 +1,10 @@ +<?php +if(isset($this->addForm)) { + $this->addForm->setAction('/user/group/add'); + echo $this->addForm; +} +else { + $this->editForm->setAction($this->url()); + echo $this->editForm; +} +?> diff --git a/application/modules/user/views/scripts/group/index.phtml b/application/modules/user/views/scripts/group/index.phtml deleted file mode 100644 index a1e5635..0000000 --- a/application/modules/user/views/scripts/group/index.phtml +++ /dev/null @@ -1 +0,0 @@ -<br /><br /><center>View script for controller <b>Group</b> and script/action name <b>index</b></center>
\ No newline at end of file diff --git a/application/modules/user/views/scripts/group/link.phtml b/application/modules/user/views/scripts/group/link.phtml new file mode 100644 index 0000000..94ad343 --- /dev/null +++ b/application/modules/user/views/scripts/group/link.phtml @@ -0,0 +1,4 @@ +<?php +$this->linkForm->setAction($this->url()); +echo $this->linkForm; +?>
\ No newline at end of file diff --git a/application/modules/user/views/scripts/group/show.phtml b/application/modules/user/views/scripts/group/show.phtml new file mode 100644 index 0000000..18ad1d3 --- /dev/null +++ b/application/modules/user/views/scripts/group/show.phtml @@ -0,0 +1,147 @@ +<?php +if($this->groupID) { + if(isset($this->userIDsNamespace['groupID'])) { + ?> +<h1>Group</h1> + <?php + } else { + ?> +<h1>Group Details</h1> + <?php + } + if(isset($this->userIDsNamespace['groupID'])) { + echo $this->formButton('deletegroup', 'Delete', array( + 'onclick' => 'self.location="/user/group/delete/"', + 'class' => 'rightbutton')); + echo $this->formButton('editgroup', 'Edit', array( + 'onclick' => 'self.location="/user/group/edit/"', + 'class' => 'rightbutton')); + } else { + echo $this->formButton('deletegroup', 'Delete', array( + 'onclick' => 'self.location="/user/group/delete/groupID/' . $this->group->getID() .'"', + 'class' => 'rightbutton')); + echo $this->formButton('editgroup', 'Edit', array( + 'onclick' => 'self.location="/user/group/edit/groupID/' . $this->group->getID() .'"', + 'class' => 'rightbutton')); + } + ?> +<span class="clear"></span> +<table> + <tr> + <th>Title</th> + <th>Description</th> + </tr> + <tr class="entry"> + <td><?php echo $this->group->getTitle(); ?></td> + <td><?php echo $this->group->getDescription(); ?></td> + </tr> + <?php + if(isset($parentGroup) && is_object($parentGroup)) { + ?> + <tr> + <td><b>Superordinated Group:</b></td> + <td><?php echo $this->parentGroup->getTitle(); ?></td> + </tr> + <?php + } + ?> +</table> + <?php + echo $this->formButton('editgroup', 'Show Grouplist', array( + 'onclick' => 'self.location="/user/group/showall"', + 'class' => 'rightbutton')); + if(isset($this->groupRequestList)) { + ?> +<br /> +<h2>Requests:</h2> +<table> + <tr> + <th>Firstname</th> + <th>Name</th> + <th>email</th> + <th>city</th> + <th>grant</th> + </tr> + <?php + foreach($this->groupRequestList as $grouprequest) { + $grouprequestID = $grouprequest['grouprequestID']; + $person = $grouprequest['person']; + ?> + <tr class="entry"> + <td><?php echo $person->getFirstname(); ?></td> + <td><?php echo $person->getName(); ?></td> + <td><?php echo $person->getEmail(); ?></td> + <td><?php echo $person->getCity(); ?></td> + <td> + <form action="/user/group/grantperson" method="post"><input + type="hidden" name="grouprequestID" + value="<?php echo $grouprequestID; ?>" /> <?php printRoleSelect($this->roleList); ?> + <input type="image" src='/media/img/save.png' alt='Grant Person' + name="confirm" value="confirm" /></form> + </td> + </tr> + <?php + } + ?> +</table> + <?php + } + if(isset($this->membersList)) { + ?> +<br /> +<h2>Members:</h2> +<table> + <tr> + <th>Firstname</th> + <th>Name</th> + <th>email</th> + <th>city</th> + <th>revoke</th> + </tr> + + <?php + foreach($this->membersList as $member) { + $membershipID = $member['membershipID']; + $person = $member['person']; + ?> + <tr class="entry"> + <td><?php echo $person->getFirstname(); ?></td> + <td><?php echo $person->getName(); ?></td> + <td><?php echo $person->getEmail(); ?></td> + <td><?php echo $person->getCity(); ?></td> + <td class='action'><a + href="<?php echo $this->url( + array( + 'module' => 'user', + 'controller' => 'group', + 'action' => 'revokeperson', + 'membershipID' => $membershipID, + ), + 'default', + true) ?>"> <img src='/media/img/delete.png' alt='Delete Group' /></a> + </td> + </tr> + <?php + } + ?> +</table> + <?php + } +} + +function printRoleSelect($roleList) { + if(!is_array($roleList)) { + return; + } + echo "<select name=\"roleID\">"; + foreach($roleList as $role) { + echo "<option value=\"" . $role['roleID'] . "\">" . $role['title'] . "</option>"; + } + echo "</select>"; +} +?> +<br /> +<br /> +<br /> +<br /> +<br /> diff --git a/application/modules/user/views/scripts/group/showall.phtml b/application/modules/user/views/scripts/group/showall.phtml new file mode 100644 index 0000000..e26e91e --- /dev/null +++ b/application/modules/user/views/scripts/group/showall.phtml @@ -0,0 +1,79 @@ +<h1>Groups</h1> +<?php echo $this->formButton('addgroup', 'Add Group', array( + 'onclick' => 'self.location="/user/group/add"', + 'class' => 'addbutton')) +?> +<table> + <tr> + <th>Title</th> + <th colspan=3>Actions</th> + </tr> + <?php + $count = 0; + foreach($this->groupList as $group) { + ?> + <tr + <?php if($group->getID() == $this->userIDsNamespace['groupID']) echo 'class="selectedEntry"'; else echo 'class="entry"'; ?>> + <td><?php echo $group->getTitle(); ?></td> + <td class='action'><a + href="<?php if($group->getID() == $this->userIDsNamespace['groupID']) echo $this->url( + array( + 'module' => 'user', + 'controller' => 'group', + 'action' => 'show' + ), + 'default', + true); else echo $this->url( + array( + 'module' => 'user', + 'controller' => 'group', + 'action' => 'show', + 'groupID' => $group->getID() + ), + 'default', + true); ?>"> <img src='/media/img/show.png' alt='Show Group' /></a></td> + <td class='action'><a + href="<?php if($group->getID() == $this->userIDsNamespace['groupID']) echo $this->url( + array( + 'module' => 'user', + 'controller' => 'group', + 'action' => 'edit' + ), + 'default', + true); else echo $this->url( + array( + 'module' => 'user', + 'controller' => 'group', + 'action' => 'edit', + 'groupID' => $group->getID() + ), + 'default', + true); ?>"> <img src='/media/img/edit.png' alt='Edit Group' /></a></td> + <td class='action'><a + href="<?php if($group->getID() == $this->userIDsNamespace['groupID']) echo $this->url( + array( + 'module' => 'user', + 'controller' => 'group', + 'action' => 'delete' + ), + 'default', + true); else echo $this->url( + array( + 'module' => 'user', + 'controller' => 'group', + 'action' => 'delete', + 'groupID' => $group->getID() + ), + 'default', + true); ?>"> <img src='/media/img/delete.png' alt='Delete Group' /></a> + </td> + </tr> + <?php + $count++; + } + ?> +</table> + <?php echo $this->formButton('linkgroups', 'Link Groups', array( + 'onclick' => 'self.location="/user/group/link"', + 'class' => 'addbutton')) + ?> |