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
No related tags found
No related merge requests found
......@@ -22,13 +22,20 @@ class ApprovalBodyAdminController extends Nmc_Controller_Action
public function editBodyAction()
{
$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->page = 'approval_body_admin';
$out->groups = Groups::getInstance()->fetchAll();
$out->approvalBody = ApprovalBodies::getInstance()->findOne($approvalBodyId);
$out->approvalBody = $approvalBody;
$out->approvalBodies = ApprovalBodies::getInstance()->fetchAll();
$out->clearSidebarModules();
......
......@@ -83,7 +83,7 @@ class UserAdminController extends Nmc_Controller_Action
$out = new Application_View();
$out->clearSidebarModules();
$out->refresh = '/UserAdmin/EditUser/' . $userId;
echo $out->render('unlModdernWrapper.xhtml');
echo $out->render('unlModernWrapper.xhtml');
}
public function editGroupAction()
......@@ -110,7 +110,7 @@ class UserAdminController extends Nmc_Controller_Action
$out->groups = Groups::getInstance()->fetchAllWithoutPrimaries();
$out->clearSidebarModules();
echo $out->render('unlModdernWrapper.xhtml');
echo $out->render('unlModernWrapper.xhtml');
}
protected function editGroupActionPost()
......@@ -147,7 +147,12 @@ class UserAdminController extends Nmc_Controller_Action
$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);
$removedUsers = $currentUsers->getRowsNotInCommonWith($selectedUsers);
......
......@@ -48,6 +48,9 @@ class People extends Nmc_Db_Table
public function findByUserId($userId)
{
if(is_array($userId)) {
if (count($userId) == 0) {
$userId = array(-1);
}
$where = $this->_db->quoteInto('userId IN (?)', $userId);
return $this->fetchAll($where);
} else {
......
<div id="admin_list">
<h2>Approval Bodies</h2>
<ul>
<li>
<a href="/ApprovalBodyAdmin/EditBody/new">
--Add New Approval Body--
</a>
</li>
<?php foreach($this->approvalBodies as $approvalBody) { ?>
<li>
<a href="/ApprovalBodyAdmin/EditBody/<?php echo $approvalBody->getPrimaryKey(); ?>">
......
......@@ -87,10 +87,18 @@ function MM_swapImage() { //v3.0
<a href="/Request/View/<?php echo $request->getPrimaryKey(); ?>">View</a>
/
<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);
echo RequestComments::getInstance()->fetchWithRequestAndAfterTime($request, $lastViewTime)->count();
?> </td>
$newCommentCount = RequestComments::getInstance()->fetchWithRequestAndAfterTime($request, $lastViewTime)->count();
if ($newCommentCount > 0) {
?>
<img src="/images/e-mail_icon1.png" alt="mail" />
<?php
echo $newCommentCount;
}
?>
</td>
</tr>
<?php } ?>
</table>
......@@ -152,11 +160,17 @@ function MM_swapImage() { //v3.0
/
<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
<?php
$lastViewTime = RequestViewTimes::getInstance()->getViewTimeForUserAndRequest($this->user, $request);
echo RequestComments::getInstance()->fetchWithRequestAndAfterTime($request, $lastViewTime)->count();
?> </td>
$newCommentCount = RequestComments::getInstance()->fetchWithRequestAndAfterTime($request, $lastViewTime)->count();
if ($newCommentCount > 0) {
?>
<img src="/images/e-mail_icon1.png" alt="mail" />
<?php
echo $newCommentCount;
}
?>
</td>
</tr>
<?php } ?>
</table>
......
<div id="creqNavigation" class="titled_box">
<div class="box_shadow_2">
<div class="tr"></div>
<div class="tl">
<h2>Navigation</h2>
</div>
<div class="bl"></div>
</div>
<div class="content">
<div id="navigationLinks">
<ul>
<li><a href="/Home">My Requests</a></li>
<li><a href="/Request/Search">New Request</a></li>
</ul>
</div>
<div id="creqNavigation">
<h4>Navigation</h4>
<div id="navigationLinks">
<ul>
<li><a href="/Home">My Requests</a></li>
<li><a href="/Request/Search">New Request</a></li>
</ul>
</div>
</div>
\ No newline at end of file
......@@ -142,7 +142,7 @@ ul.horizontal_menu {
.titled_box {
.tl {
h2 {
background-color: #434443;
background-color: #6E6E6E;
color: #e3e3e3;
font-family: URWGroteskTLig, sans-serif;
font-weight: normal;
......
......@@ -19,10 +19,23 @@
}
#creqNavigation {
h4 {
padding-left: 11px;
background: transparent url(/images/nav_heading.png) no-repeat ;
border-bottom: 1px solid #ddd;
background:#434343 url(/ucomm/templatedependents/templatecss/images/nav_head.gif) no-repeat scroll right top;
border-bottom:3px solid #AF0909;
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 {
......
......@@ -16,23 +16,28 @@ div.edit_pane h2 {
margin-bottom: 1em;
}
label, input, textarea, select {
#maincontent label,
#maincontent input,
#maincontent textarea,
#maincontent select {
display: block;
}
label {
#maincontent label {
margin-top: 0.5em;
}
label input {
#maincontent label input {
display: inline;
margin-bottom: 0px;
}
input, textarea, select {
#maincontent input,
#maincontent textarea,
#maincontent select {
margin-bottom: 0.5em;
}
fieldset {
#maincontent fieldset {
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.
Finish editing this message first!
Please register or to comment