Skip to content
Snippets Groups Projects
Commit dd626c35 authored by Peter Rotich's avatar Peter Rotich
Browse files

Improve navigation of user pages

Link to org & user landing pages & kill pjax on internal pages
parent 4010b27a
Branches
Tags
No related merge requests found
......@@ -26,7 +26,8 @@ if(is_object($thisstaff) && $thisstaff->isStaff()) { ?>
if ($.support.pjax) {
$(document).on('click', 'a', function(event) {
if (!$(this).hasClass('no-pjax')
&& !$(this).closest('.no-pjax').length)
&& !$(this).closest('.no-pjax').length
&& $(this).attr('href')[0] != '#')
$.pjax.click(event, {container: $('#pjax-container'), timeout: 2000});
})
}
......
......@@ -95,7 +95,7 @@ echo sprintf(
'
<tr>
<th>From:</th>
<td>%s <span class="faded">%s</span></td>
<td><a href="users.php?id=%d" class="no-pjax">%s</a> <span class="faded">%s</span></td>
</tr>
<tr>
<th width="100">Department:</th>
......@@ -105,6 +105,7 @@ echo sprintf(
<th>Help Topic:</th>
<td>%s</td>
</tr>',
$ticket->getUserId(),
Format::htmlchars($ticket->getName()),
$ticket->getEmail(),
Format::htmlchars($ticket->getDeptName()),
......@@ -118,14 +119,16 @@ echo '</div>'; // ticket preview content.
<table border="0" cellspacing="" cellpadding="1">
<colgroup><col style="min-width: 250px;"></col></colgroup>
<?php
if (($users=$ticket->getCollaborators())) {?>
if (($collabs=$ticket->getCollaborators())) {?>
<?php
foreach($users as $user) {
echo sprintf('<tr><td %s><i class="icon-%s"></i> %s <em>&lt;%s&gt;</em></td></tr>',
($user->isActive()? '' : 'class="faded"'),
($user->isActive()? 'comments' : 'comment-alt'),
$user->getName(),
$user->getEmail());
foreach($collabs as $collab) {
echo sprintf('<tr><td %s><i class="icon-%s"></i>
<a href="users.php?id=%d" class="no-pjax">%s</a> <em>&lt;%s&gt;</em></td></tr>',
($collab->isActive()? '' : 'class="faded"'),
($collab->isActive()? 'comments' : 'comment-alt'),
$collab->getUserId(),
$collab->getName(),
$collab->getEmail());
}
} else {
echo "Ticket doesn't have collaborators.";
......
......@@ -84,9 +84,8 @@ $org = $user->getOrganization();
<span id="user-<?php echo $user->getId(); ?>-org">
<?php
if ($org)
echo sprintf('<a href="#users/%d/org"
class="user-action">%s</a>',
$user->getId(), $org->getName());
echo sprintf('<a href="orgs.php?id=%d">%s</a>',
$org->getId(), $org->getName());
else
echo sprintf('<a href="#users/%d/org"
class="user-action">Add Organization</a>',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment