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

Merge pull request #948 from greezybacon/feature/client-ux-tweaks


Several small tweaks to the client user experience

Reviewed-By: default avatarPeter Rotich <peter@osticket.com>
parents 136a235d f7b99809
No related branches found
No related tags found
No related merge requests found
......@@ -127,9 +127,9 @@ h1 {
h3 {
font-size: 16px;
}
h2 {
h2, .subject {
font-size: 16px;
color: #999;
color: black;
}
/* Helpers */
.centered {
......
......@@ -149,6 +149,10 @@ abstract class TicketUser {
return $this->_guest;
}
function getUserId() {
return $this->user->getId();
}
abstract function getTicketId();
abstract function getTicket();
}
......
<?php
$title=($cfg && is_object($cfg) && $cfg->getTitle())?$cfg->getTitle():'osTicket :: Support Ticket System';
$signin_url = ROOT_PATH . "login.php"
. ($thisclient ? "?e=".urlencode($thisclient->getEmail()) : "");
header("Content-Type: text/html; charset=UTF-8\r\n");
?>
<!DOCTYPE html>
......@@ -56,7 +58,7 @@ header("Content-Type: text/html; charset=UTF-8\r\n");
Guest User | <?php
}
if ($cfg->getClientRegistrationMode() != 'disabled') { ?>
<a href="<?php echo ROOT_PATH; ?>login.php">Sign In</a>
<a href="<?php echo $signin_url; ?>">Sign In</a>
<?php
}
} ?>
......
......@@ -14,7 +14,9 @@ if ($thisclient && $thisclient->isGuest()
<div id="msg_info">
<i class="icon-compass icon-2x pull-left"></i>
<strong>Looking for your other tickets?</strong></br>
<a href="login.php" style="text-decoration:underline">Sign in</a> or
<a href="<?php echo ROOT_PATH; ?>login.php?e=<?php
echo urlencode($thisclient->getEmail());
?>" style="text-decoration:underline">Sign in</a> or
<a href="account.php?do=create" style="text-decoration:underline">register for an account</a>
for the best experience on our help desk.</div>
......@@ -26,7 +28,9 @@ if ($thisclient && $thisclient->isGuest()
<h1>
Ticket #<?php echo $ticket->getNumber(); ?> &nbsp;
<a href="tickets.php?id=<?php echo $ticket->getId(); ?>" title="Reload"><span class="Icon refresh">&nbsp;</span></a>
<?php if ($cfg->allowClientUpdates()) { ?>
<?php if ($cfg->allowClientUpdates()
// Only ticket owners can edit the ticket details (and other forms)
&& $thisclient->getId() == $ticket->getUserId()) { ?>
<a class="action-button" href="tickets.php?a=edit&id=<?php
echo $ticket->getId(); ?>"><i class="icon-edit"></i> Edit</a>
<?php } ?>
......@@ -93,9 +97,7 @@ foreach (DynamicFormEntry::forTicket($ticket->getId()) as $idx=>$form) {
</tr>
</table>
<br>
<h2>Subject:<?php echo Format::htmlchars($ticket->getSubject()); ?></h2>
<br>
<span class="Icon thread">Ticket Thread</span>
<div class="subject">Subject: <strong><?php echo Format::htmlchars($ticket->getSubject()); ?></strong></div>
<div id="ticketThread">
<?php
if($ticket->getThreadCount() && ($thread=$ticket->getClientThread())) {
......
......@@ -5,7 +5,7 @@
$(document).ready(function(){
$("input:not(.dp):visible:enabled:first").focus();
$('input:not(.dp):visible:enabled:input[value=""]:first').focus();
$('table.list tbody tr:odd').addClass('odd');
//Overlay
......
......@@ -40,7 +40,8 @@ if($_POST && is_object($ticket) && $ticket->getId()):
$errors=array();
switch(strtolower($_POST['a'])){
case 'edit':
if(!$ticket->checkUserAccess($thisclient)) //double check perm again!
if(!$ticket->checkUserAccess($thisclient) //double check perm again!
|| $thisclient->getId() != $ticket->getUserId())
$errors['err']='Access Denied. Possibly invalid ticket ID';
elseif (!$cfg || !$cfg->allowClientUpdates())
$errors['err']='Access Denied. Client updates are currently disabled';
......
......@@ -16,14 +16,23 @@
**********************************************************************/
require_once('client.inc.php');
$errors = array();
// Check if the client is already signed in. Don't corrupt their session!
if ($_GET['auth']
&& $thisclient
&& ($u = TicketUser::lookupByToken($_GET['auth']))
&& ($u->getUserId() == $thisclient->getId())
) {
Http::redirect('tickets.php?id='.$u->getTicketId());
}
// Try autologin the user
// Authenticated user can be of type ticket owner or collaborator
$errors = array();
if (isset($_GET['auth']) || isset($_GET['t']))
elseif (isset($_GET['auth']) || isset($_GET['t'])) {
// TODO: Consider receiving an AccessDenied object
$user = UserAuthenticationBackend::processSignOn($errors, false);
}
if ($user && $user->getTicketId())
if (@$user && is_object($user) && $user->getTicketId())
Http::redirect('tickets.php?id='.$user->getTicketId());
$nav = new UserNav();
......
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