From 3e403fe3339535749cdac9917b24c9bcbadd786a Mon Sep 17 00:00:00 2001 From: Nathan Febuary <nathan@bedheadcreative.com> Date: Wed, 19 Aug 2015 10:26:44 -0500 Subject: [PATCH] ui: Move subject below buttons, add titles to custom data forms --- include/client/view.inc.php | 2 +- include/staff/ticket-view.inc.php | 56 ++++++++++++++++++------------- scp/css/scp.css | 21 ++++++++++++ 3 files changed, 54 insertions(+), 25 deletions(-) diff --git a/include/client/view.inc.php b/include/client/view.inc.php index 610bd2e92..ca9aa363c 100644 --- a/include/client/view.inc.php +++ b/include/client/view.inc.php @@ -32,7 +32,7 @@ if ($thisclient && $thisclient->isGuest() <td colspan="2" width="100%"> <h1> <a href="tickets.php?id=<?php echo $ticket->getId(); ?>" title="<?php echo __('Reload'); ?>"><i class="refresh icon-refresh"></i></a> - <b><?php echo $ticket->getSubject(); ?></b> + <b><?php echo Format::htmlchars($ticket->getSubject()); ?></b> <small>#<?php echo $ticket->getNumber(); ?></small> <div class="pull-right"> <a class="action-button" href="tickets.php?a=print&id=<?php diff --git a/include/staff/ticket-view.inc.php b/include/staff/ticket-view.inc.php index 4799b011a..9f0c7fca0 100644 --- a/include/staff/ticket-view.inc.php +++ b/include/staff/ticket-view.inc.php @@ -50,7 +50,7 @@ if($ticket->isOverdue()) $warn.=' <span class="Icon overdueTicket">'.__('Marked overdue!').'</span>'; ?> -<div class="has_bottom_border"> +<div> <div class="sticky bar"> <div class="content"> <div class="pull-right flush-right"> @@ -194,12 +194,16 @@ if($ticket->isOverdue()) <h2><a href="tickets.php?id=<?php echo $ticket->getId(); ?>" title="<?php echo __('Reload'); ?>"><i class="icon-refresh"></i> <?php echo sprintf(__('Ticket #%s'), $ticket->getNumber()); ?></a> - <?php if ($ticket) { ?> – <small><?php echo $ticket->getSubject(); ?></small><?php } ?> </h2> </div> </div> </div> </div> +<div class="clear tixTitle has_bottom_border"> + <h3> + <?php echo Format::htmlchars($ticket->getSubject()); ?> + </h3> +</div> <table class="ticket_info" cellspacing="0" cellpadding="0" width="940" border="0"> <tr> <td width="50%"> @@ -403,9 +407,7 @@ if($ticket->isOverdue()) </tr> </table> <br> -<table class="ticket_info" cellspacing="0" cellpadding="0" width="940" border="0"> <?php -$idx = 0; foreach (DynamicFormEntry::forTicket($ticket->getId()) as $form) { // Skip core fields shown earlier in the ticket view // TODO: Rewrite getAnswers() so that one could write @@ -415,30 +417,36 @@ foreach (DynamicFormEntry::forTicket($ticket->getId()) as $form) { 'field__flags__hasbit' => DynamicFormField::FLAG_EXT_STORED, 'field__name__in' => array('subject', 'priority') ))); - if (count($answers) == 0) + $displayed = array(); + foreach($answers as $a) { + if (!($v = $a->display())) + continue; + $displayed[] = array($a->getLocal('label'), $v); + } + if (count($displayed) == 0) continue; ?> + <table class="ticket_info custom-data" cellspacing="0" cellpadding="0" width="940" border="0"> + <thead> + <th colspan="2"><?php echo Format::htmlchars($form->getTitle()); ?></th> + </thead> + <tbody> +<?php + foreach ($displayed as $stuff) { + list($label, $v) = $stuff; +?> <tr> - <td colspan="2"> - <table cellspacing="0" cellpadding="4" width="100%" border="0"> - <?php foreach($answers as $a) { - if (!($v = $a->display())) continue; ?> - <tr> - <th width="100"><?php - echo $a->getLocal('label'); - ?>:</th> - <td><?php - echo $v; - ?></td> - </tr> - <?php } ?> - </table> - </td> + <td width="200"><?php +echo Format::htmlchars($label); + ?>:</th> + <td><?php +echo $v; + ?></td> </tr> - <?php - $idx++; - } ?> -</table> +<?php } ?> + </tbody> + </table> +<?php } ?> <div class="clear"></div> <?php diff --git a/scp/css/scp.css b/scp/css/scp.css index 26369e0ec..2cec5526c 100644 --- a/scp/css/scp.css +++ b/scp/css/scp.css @@ -845,6 +845,16 @@ h3 { padding:5px 0; color:#444; } +.tixTitle { + padding:0 5px 0px; +} +.tixTitle h3 { + color:#444; + padding:0; + margin:0; + font-size:1.4em; + font-weight:300; +} .has_bottom_border { padding-bottom:5px; @@ -859,6 +869,17 @@ h3 { background:#F4FAFF; } +.ticket_info.custom-data thead th { + border-bottom: 2px solid #ccc; + background-color: white; +} +.custom-data th, .custom-data td { + padding: 3px; +} +table.custom-data { + margin-bottom: 1em; +} + .right_align { text-align:right; } h2 .reload { -- GitLab