diff --git a/include/class.ticket.php b/include/class.ticket.php index aa57299fb09951b10ae106d5382548e50b8c532a..02b4f805bd3446ad3839e50910d8e7d6da3f62be 100644 --- a/include/class.ticket.php +++ b/include/class.ticket.php @@ -3281,9 +3281,15 @@ implements RestrictedAccess, Threadable, Searchable { // Convert duedate to DB timezone. if ($fid == 'duedate' && ($dt = Format::parseDateTime($val))) { + // Make sure the due date is valid + if (Misc::user2gmtime($val) <= Misc::user2gmtime()) + $errors['field']=__('Due date must be in the future'); $dt->setTimezone(new DateTimeZone($cfg->getDbTimezone())); $val = $dt->format('Y-m-d H:i:s'); } + elseif ($fid == 'duedate' && !$val) + $errors['field']=__('Invalid due date'); + $changes = array(); $this->{$fid} = $val; foreach ($this->dirty as $F=>$old) { diff --git a/include/staff/ticket-view.inc.php b/include/staff/ticket-view.inc.php index e7440d13a1cdc1103c8df31a68ad731ddb716ea6..f5d7ae5f7ba3bf740000ed119c2e1429b2e3324e 100644 --- a/include/staff/ticket-view.inc.php +++ b/include/staff/ticket-view.inc.php @@ -262,7 +262,18 @@ if($ticket->isOverdue()) <table border="0" cellspacing="" cellpadding="4" width="100%"> <tr> <th width="100"><?php echo __('Status');?>:</th> - <td><?php echo ($S = $ticket->getStatus()) ? $S->display() : ''; ?></td> + <?php + if ($role->hasPerm(Ticket::PERM_CLOSE)) {?> + <td> + <a class="tickets-action" data-dropdown="#action-dropdown-statuses" data-placement="bottom" data-toggle="tooltip" title="<?php echo __('Change Status'); ?>" + data-redirect="tickets.php?id=<?php echo $ticket->getId(); ?>" + href="#statuses"> + <?php echo $ticket->getStatus(); ?> + </a> + </td> + <?php } else { ?> + <td><?php echo ($S = $ticket->getStatus()) ? $S->display() : ''; ?></td> + <?php } ?> </tr> <tr> <th><?php echo __('Priority');?>:</th> @@ -575,7 +586,7 @@ foreach (DynamicFormEntry::forTicket($ticket->getId()) as $form) { ))); $displayed = array(); foreach($answers as $a) { - $displayed[] = array($a->getLocal('label'), $a->display() ?: __('Enter'), $a->getLocal('id')); + $displayed[] = array($a->getLocal('label'), $a->display() ?: '<span class="faded">—' . __('Empty') . '— </span>', $a->getLocal('id')); } if (count($displayed) == 0) continue; @@ -587,7 +598,7 @@ foreach (DynamicFormEntry::forTicket($ticket->getId()) as $form) { <tbody> <?php foreach ($displayed as $stuff) { - list($label, $v) = $stuff; + list($label, $v, $id) = $stuff; ?> <tr> <td width="200"><?php echo Format::htmlchars($label); ?>:</td>