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

Add link to manage collaborators on preview.

parent 68917edf
Branches
No related tags found
No related merge requests found
......@@ -463,9 +463,6 @@ class TicketsAjaxAPI extends AjaxController {
|| !$ticket->checkStaffAccess($thisstaff))
Http::response(404, 'No such ticket');
if (!$ticket->getCollaborators())
Http::response(404, 'No such ticket');
ob_start();
include STAFFINC_DIR . 'templates/collaborators-preview.tmpl.php';
$resp = ob_get_contents();
......
......@@ -12,17 +12,33 @@ if (($users=$ticket->getCollaborators())) {?>
$user->getEmail());
}
} else {
echo "Bro, not sure how you got here!";
echo "<strong>Ticket doesn't have collaborators.</strong>";
}?>
</table>
<?php
$options = array();
//TODO: Add options to manage collaborators
$options[] = sprintf(
'<a class="collaborators" id="managecollab" href="#tickets/%d/collaborators">%s</a>',
$ticket->getId(),
$ticket->getNumCollaborators()
? 'Manage Collaborators' : 'Add Collaborator'
);
if ($options) {
echo '<ul class="tip_menu">';
foreach($options as $option)
echo sprintf('<li><a href="%s">%s</a></li>', $option['url'], $option['action']);
echo sprintf('<li>%s</li>', $option);
echo '</ul>';
}
?>
</div>
<script type="text/javascript">
$(function() {
$(document).on('click', 'a#managecollab', function (e) {
e.preventDefault();
$('.tip_box').remove();
return false;
});
});
</script>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment