Skip to content
Snippets Groups Projects
Commit 79b71848 authored by Tim Steiner's avatar Tim Steiner
Browse files

Slight template updates (on navigation)

Fixed admin pages to actually work :)
parent cc8dcb75
No related branches found
Tags
No related merge requests found
...@@ -22,13 +22,20 @@ class ApprovalBodyAdminController extends Nmc_Controller_Action ...@@ -22,13 +22,20 @@ class ApprovalBodyAdminController extends Nmc_Controller_Action
public function editBodyAction() public function editBodyAction()
{ {
$in = $this->getRequest(); $in = $this->getRequest();
$approvalBodyId = Zend_Filter_Int::filter($in->getParam(0));
$approvalBodyId = $in->getParam(0);
if ($approvalBodyId == 'new') {
$approvalBody = ApprovalBodies::getInstance()->fetchNew();
} else {
$approvalBodyId = Zend_Filter_Int::filter($approvalBodyId);
$approvalBody = ApprovalBodies::getInstance()->findOne($approvalBodyId);
}
$out = new Application_View(); $out = new Application_View();
$out->page = 'approval_body_admin'; $out->page = 'approval_body_admin';
$out->groups = Groups::getInstance()->fetchAll(); $out->groups = Groups::getInstance()->fetchAll();
$out->approvalBody = ApprovalBodies::getInstance()->findOne($approvalBodyId); $out->approvalBody = $approvalBody;
$out->approvalBodies = ApprovalBodies::getInstance()->fetchAll(); $out->approvalBodies = ApprovalBodies::getInstance()->fetchAll();
$out->clearSidebarModules(); $out->clearSidebarModules();
......
...@@ -83,7 +83,7 @@ class UserAdminController extends Nmc_Controller_Action ...@@ -83,7 +83,7 @@ class UserAdminController extends Nmc_Controller_Action
$out = new Application_View(); $out = new Application_View();
$out->clearSidebarModules(); $out->clearSidebarModules();
$out->refresh = '/UserAdmin/EditUser/' . $userId; $out->refresh = '/UserAdmin/EditUser/' . $userId;
echo $out->render('unlModdernWrapper.xhtml'); echo $out->render('unlModernWrapper.xhtml');
} }
public function editGroupAction() public function editGroupAction()
...@@ -110,7 +110,7 @@ class UserAdminController extends Nmc_Controller_Action ...@@ -110,7 +110,7 @@ class UserAdminController extends Nmc_Controller_Action
$out->groups = Groups::getInstance()->fetchAllWithoutPrimaries(); $out->groups = Groups::getInstance()->fetchAllWithoutPrimaries();
$out->clearSidebarModules(); $out->clearSidebarModules();
echo $out->render('unlModdernWrapper.xhtml'); echo $out->render('unlModernWrapper.xhtml');
} }
protected function editGroupActionPost() protected function editGroupActionPost()
...@@ -147,7 +147,12 @@ class UserAdminController extends Nmc_Controller_Action ...@@ -147,7 +147,12 @@ class UserAdminController extends Nmc_Controller_Action
$group->addGroup($newGroup); $group->addGroup($newGroup);
} }
$selectedUsers = People::getInstance()->findByUserId($in->getPost('users')); $selectedUsersArray = $in->getPost('users');
if (!is_array($selectedUsersArray)) {
$selectedUsersArray = array();
}
$selectedUsers = People::getInstance()->findByUserId($selectedUsersArray);
$currentUsers = $group->getUsers(false); $currentUsers = $group->getUsers(false);
$removedUsers = $currentUsers->getRowsNotInCommonWith($selectedUsers); $removedUsers = $currentUsers->getRowsNotInCommonWith($selectedUsers);
......
...@@ -48,6 +48,9 @@ class People extends Nmc_Db_Table ...@@ -48,6 +48,9 @@ class People extends Nmc_Db_Table
public function findByUserId($userId) public function findByUserId($userId)
{ {
if(is_array($userId)) { if(is_array($userId)) {
if (count($userId) == 0) {
$userId = array(-1);
}
$where = $this->_db->quoteInto('userId IN (?)', $userId); $where = $this->_db->quoteInto('userId IN (?)', $userId);
return $this->fetchAll($where); return $this->fetchAll($where);
} else { } else {
......
<div id="admin_list"> <div id="admin_list">
<h2>Approval Bodies</h2> <h2>Approval Bodies</h2>
<ul> <ul>
<li>
<a href="/ApprovalBodyAdmin/EditBody/new">
--Add New Approval Body--
</a>
</li>
<?php foreach($this->approvalBodies as $approvalBody) { ?> <?php foreach($this->approvalBodies as $approvalBody) { ?>
<li> <li>
<a href="/ApprovalBodyAdmin/EditBody/<?php echo $approvalBody->getPrimaryKey(); ?>"> <a href="/ApprovalBodyAdmin/EditBody/<?php echo $approvalBody->getPrimaryKey(); ?>">
......
...@@ -87,10 +87,18 @@ function MM_swapImage() { //v3.0 ...@@ -87,10 +87,18 @@ function MM_swapImage() { //v3.0
<a href="/Request/View/<?php echo $request->getPrimaryKey(); ?>">View</a> <a href="/Request/View/<?php echo $request->getPrimaryKey(); ?>">View</a>
/ /
<a href="/Request/Load/<?php echo $request->getPrimaryKey(); ?>">Edit</a> </td> <a href="/Request/Load/<?php echo $request->getPrimaryKey(); ?>">Edit</a> </td>
<td><img src="/images/e-mail_icon1.png" width="40" height="32" alt="mail" /> <?php <td>
<?php
$lastViewTime = RequestViewTimes::getInstance()->getViewTimeForUserAndRequest($this->user, $request); $lastViewTime = RequestViewTimes::getInstance()->getViewTimeForUserAndRequest($this->user, $request);
echo RequestComments::getInstance()->fetchWithRequestAndAfterTime($request, $lastViewTime)->count(); $newCommentCount = RequestComments::getInstance()->fetchWithRequestAndAfterTime($request, $lastViewTime)->count();
?> </td> if ($newCommentCount > 0) {
?>
<img src="/images/e-mail_icon1.png" alt="mail" />
<?php
echo $newCommentCount;
}
?>
</td>
</tr> </tr>
<?php } ?> <?php } ?>
</table> </table>
...@@ -152,11 +160,17 @@ function MM_swapImage() { //v3.0 ...@@ -152,11 +160,17 @@ function MM_swapImage() { //v3.0
/ /
<a href="/Request/Load/<?php echo $request->getPrimaryKey(); ?>">Edit</a> </td> <a href="/Request/Load/<?php echo $request->getPrimaryKey(); ?>">Edit</a> </td>
<td> <td>
<img src="/images/e-mail_icon1.png" width="40" height="32" alt="mail" />
<?php <?php
$lastViewTime = RequestViewTimes::getInstance()->getViewTimeForUserAndRequest($this->user, $request); $lastViewTime = RequestViewTimes::getInstance()->getViewTimeForUserAndRequest($this->user, $request);
echo RequestComments::getInstance()->fetchWithRequestAndAfterTime($request, $lastViewTime)->count(); $newCommentCount = RequestComments::getInstance()->fetchWithRequestAndAfterTime($request, $lastViewTime)->count();
?> </td> if ($newCommentCount > 0) {
?>
<img src="/images/e-mail_icon1.png" alt="mail" />
<?php
echo $newCommentCount;
}
?>
</td>
</tr> </tr>
<?php } ?> <?php } ?>
</table> </table>
......
<div id="creqNavigation" class="titled_box"> <div id="creqNavigation">
<div class="box_shadow_2"> <h4>Navigation</h4>
<div class="tr"></div>
<div class="tl">
<h2>Navigation</h2>
</div>
<div class="bl"></div>
</div>
<div class="content">
<div id="navigationLinks"> <div id="navigationLinks">
<ul> <ul>
<li><a href="/Home">My Requests</a></li> <li><a href="/Home">My Requests</a></li>
...@@ -14,4 +7,3 @@ ...@@ -14,4 +7,3 @@
</ul> </ul>
</div> </div>
</div> </div>
\ No newline at end of file
</div>
\ No newline at end of file
...@@ -142,7 +142,7 @@ ul.horizontal_menu { ...@@ -142,7 +142,7 @@ ul.horizontal_menu {
.titled_box { .titled_box {
.tl { .tl {
h2 { h2 {
background-color: #434443; background-color: #6E6E6E;
color: #e3e3e3; color: #e3e3e3;
font-family: URWGroteskTLig, sans-serif; font-family: URWGroteskTLig, sans-serif;
font-weight: normal; font-weight: normal;
......
...@@ -19,10 +19,23 @@ ...@@ -19,10 +19,23 @@
} }
#creqNavigation { #creqNavigation {
h4 { h4 {
padding-left: 11px; background:#434343 url(/ucomm/templatedependents/templatecss/images/nav_head.gif) no-repeat scroll right top;
background: transparent url(/images/nav_heading.png) no-repeat ; border-bottom:3px solid #AF0909;
border-bottom: 1px solid #ddd; color:#FFFFFF;
font-family:Verdana,Helvetica,sans-serif;
font-size:1.6em;
font-size-adjust:none;
font-stretch:normal;
font-style:normal;
font-variant:normal;
font-weight:normal;
letter-spacing:-1px;
line-height:normal;
margin:3px 1px 0pt 0pt;
padding:5px 0pt 7px 15px;
} }
ul { ul {
......
...@@ -16,23 +16,28 @@ div.edit_pane h2 { ...@@ -16,23 +16,28 @@ div.edit_pane h2 {
margin-bottom: 1em; margin-bottom: 1em;
} }
label, input, textarea, select { #maincontent label,
#maincontent input,
#maincontent textarea,
#maincontent select {
display: block; display: block;
} }
label { #maincontent label {
margin-top: 0.5em; margin-top: 0.5em;
} }
label input { #maincontent label input {
display: inline; display: inline;
margin-bottom: 0px; margin-bottom: 0px;
} }
input, textarea, select { #maincontent input,
#maincontent textarea,
#maincontent select {
margin-bottom: 0.5em; margin-bottom: 0.5em;
} }
fieldset { #maincontent fieldset {
border-width: 0px border-width: 0px
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment