diff --git a/include/staff/queue.inc.php b/include/staff/queue.inc.php index 9c85a0497719711988a6b683c2b45ec8b9dd0f19..4d2cc050e0384b17e25c9838b37f1d332e1569e7 100644 --- a/include/staff/queue.inc.php +++ b/include/staff/queue.inc.php @@ -30,7 +30,7 @@ else { <input type="hidden" name="root" value="<?php echo Format::htmlchars($_REQUEST['t']); ?>"> <h2><a href="settings.php?t=tickets#queues"><?php echo __('Ticket Queues'); ?></a> - // <?php echo $title; ?> + <i class="icon-caret-right" style="color:rgba(0,0,0,.3);"></i> <?php echo $title; ?> <?php if (isset($queue->id)) { ?><small> — <?php echo $queue->getFullName(); ?></small> <?php } ?> @@ -41,6 +41,8 @@ else { <?php echo __('Criteria'); ?></a></li> <li><a href="#columns"><i class="icon-columns"></i> <?php echo __('Columns'); ?></a></li> + <li><a href="#sorting-tab"><i class="icon-sort-by-attributes"></i> + <?php echo __('Sort'); ?></a></li> <li><a href="#preview-tab"><i class="icon-eye-open"></i> <?php echo __('Preview'); ?></a></li> </ul> @@ -127,6 +129,12 @@ else { </div> <div class="hidden tab_content" id="columns"> + + <div class="tab-desc"> + <p><b><?php echo __("Manage columns in this queue"); ?></b> + <br><?php echo __( + "Add, remove, and customize the content of the columns in this queue using the options below. Click a column header to manage or resize it"); ?></p> + </div> <table class="table two-column"> <?php if ($queue->parent) { ?> <tbody> @@ -142,14 +150,6 @@ else { </tbody> <?php } ?> <tbody class="if-not-inherited <?php if ($queue->inheritColumns()) echo 'hidden'; ?>"> - <tr class="header"> - <th colspan="3"> - <?php echo __("Manage columns in this queue"); ?> - <div><small><?php echo __( - "Add, remove, and customize the content of the columns in this queue using the options below. Click a column header to manage or resize it"); ?> - </small></div> - </th> - </tr> <tr class="header"> <td style="width:36%"><small><b><?php echo __('Heading and Width'); ?></b></small></td> <td><small><b><?php echo __('Column Details'); ?></b></small></td> @@ -175,13 +175,12 @@ else { $.dialog('ajax.php/tickets/search/column/edit/' + colid, 201); return false; "><i class="icon-cog"></i> <?php echo __('Config'); ?></a> - <span></span> + </div> </td> <td> <input type="checkbox" data-name="sortable"> <a href="#" class="pull-right drop-column" title="<?php echo __('Delete'); ?>"><i class="icon-trash"></i></a> - </div> </td> </tr> </tbody> @@ -207,11 +206,65 @@ else { </tr> </tbody> </table> - </div> - - <div class="hidden tab_content" id="preview-tab"> - + + + <div class="hidden tab_content" id="sorting-tab"> + <div class="tab-desc"> + <p><b><?php echo __("Manage Queue Sorting"); ?></b> + <br><?php echo __("Add, edit or remove the sorting criteria for this custom queue using the options below. Sorting is priortized in ascending order."); ?></p> + </div> + <table class="queue-sort table"> + <tbody class="sortable-rows ui-sortable"> + <tr style="display: table-row;"> + <td> + <i class="faded-more icon-sort"></i> + <a class="inline" + href="#" onclick="javascript: + var colid = $(this).closest('tr').find('[data-name=sorting_id]').val(); + $.dialog('ajax.php/tickets/search/sorting/edit/' + colid, 201); + return false;"><?php echo __('This is sort criteria title 1'); ?></a> + </td> + <td> + <a href="#" class="pull-right drop-column" title="Delete"><i class="icon-trash"></i></a> + </td> + </tr> + <tr style="display: table-row;"> + <td> + <i class="faded-more icon-sort"></i> + <a class="inline" + href="#" onclick="javascript: + var colid = $(this).closest('tr').find('[data-name=sorting_id]').val(); + $.dialog('ajax.php/tickets/search/sorting/edit/' + colid, 201); + return false; + "><?php echo __('This is sort criteria title 2'); ?></a> + </td> + <td> + <a href="#" class="pull-right drop-column" title="Delete"><i class="icon-trash"></i></a> + </td> + </tr> + </tbody> + <tbody> + <tr class="header"> + <td colspan="3"></td> + </tr> + <tr> + <td colspan="3" id="append-sort"> + <i class="icon-plus-sign"></i> + <select id="add-sort" data-quick-add="queue-column"> + <option value="">— Add Sort Criteria —</option> + <option value="">Sort Option 1</option> + <option value="">Sort Option 2</option> + <option value="0" data-quick-add>— <?php echo __('Add New Sort Criteria');?> —</option> + </select> + <button type="button" class="green button">Add</button> + </td> + </tr> + </tbody> + </table> + </div> + + <div class="hidden tab_content" id="preview-tab"> <div id="preview"> </div> diff --git a/include/staff/templates/queue-sorting-add.tmpl.php b/include/staff/templates/queue-sorting-add.tmpl.php new file mode 100644 index 0000000000000000000000000000000000000000..ab5c345a8a907a4bc37a2e64350bd099a840f37e --- /dev/null +++ b/include/staff/templates/queue-sorting-add.tmpl.php @@ -0,0 +1,30 @@ +<?php +/** + * Calling conventions + * + * $column - <QueueColumn> instance for this column + */ +$colid = 0; +?> +<h3 class="drag-handle"><?php echo __('Add Sort Options'); ?></h3> +<a class="close" href=""><i class="icon-remove-circle"></i></a> +<hr/> + +<form method="post" action="#admin/quick-add/queue-column"> + +<?php +include 'queue-sorting.tmpl.php'; +?> + +<hr> +<p class="full-width"> + <span class="buttons pull-left"> + <input type="reset" value="<?php echo __('Reset'); ?>"> + <input type="button" value="<?php echo __('Cancel'); ?>" class="close"> + </span> + <span class="buttons pull-right"> + <input type="submit" value="<?php echo __('Save'); ?>"> + </span> + </p> + + </form> diff --git a/include/staff/templates/queue-sorting-edit.tmpl.php b/include/staff/templates/queue-sorting-edit.tmpl.php new file mode 100644 index 0000000000000000000000000000000000000000..0e2734d4822d618842fcaacbd49770685db099d0 --- /dev/null +++ b/include/staff/templates/queue-sorting-edit.tmpl.php @@ -0,0 +1,32 @@ +<?php +/** + * Calling conventions + * + * $column - <QueueColumn> instance for this column + */ +$colid = $column->getId(); +?> +<h3 class="drag-handle"><?php echo __('Manage Sort Options'); ?> — + <?php echo $column->get('name') ?></h3> +<a class="close" href=""><i class="icon-remove-circle"></i></a> +<hr/> + +<form method="post" action="#tickets/search/column/edit/<?php + echo $colid; ?>"> + +<?php +include 'queue-sorting.tmpl.php'; +?> + +<hr> +<p class="full-width"> + <span class="buttons pull-left"> + <input type="reset" value="<?php echo __('Reset'); ?>"> + <input type="button" value="<?php echo __('Cancel'); ?>" class="close"> + </span> + <span class="buttons pull-right"> + <input type="submit" value="<?php echo __('Save'); ?>"> + </span> + </p> + + </form> diff --git a/include/staff/templates/queue-sorting.tmpl.php b/include/staff/templates/queue-sorting.tmpl.php new file mode 100644 index 0000000000000000000000000000000000000000..d73c0f9c2bb6b7adc3871e22cf7bb927fb1b90b3 --- /dev/null +++ b/include/staff/templates/queue-sorting.tmpl.php @@ -0,0 +1,67 @@ +<div class="tab-desc"> + <p><b>Manage Custom Sorting</b> + <br>Add, and remove the fields in this list using the options below. Sorting is priortized in ascending order.</p> +</div> +<table class="table"> + <tbody> + <tr> + <td colspan="3" style="border-bottom:1px"> + <input type="text" name="name" value="" style="width:100%" placeholder="<?php echo __('Sort Criteria Title');?>" /> + </td> + </tr> + </tbody> + <tbody class="sortable-rows ui-sortable"> + <tr style="display: table-row;"> + <td> + <i class="faded-more icon-sort"></i> + <span><?php echo __('Sort field 0'); ?></span> + </td> + <td> + <select> + <option value="0"> + <?php echo __('Ascending');?> + </option> + <option value="1"> + <?php echo __('Descending');?> + </option> + </select> + </td> + <td> + <a href="#" class="pull-right drop-column" title="Delete"><i class="icon-trash"></i></a> + </td> + </tr> + <tr style="display: table-row;"> + <td> + <i class="faded-more icon-sort"></i> + <span><?php echo __('Sort field 1'); ?></span> + </td> + <td> + <select> + <option value="0"> + <?php echo __('Ascending');?> + </option> + <option value="1"> + <?php echo __('Descending');?> + </option> + </select> + </td> + <td> + <a href="#" class="pull-right drop-column" title="Delete"><i class="icon-trash"></i></a> + </td> + </tr> + </tbody> + <tbody> + <tr class="header"> + <td colspan="3"></td> + </tr> + <tr> + <td colspan="3" id="append-sort"> + <i class="icon-plus-sign"></i> + <select id="add-sort"> + <option value="">— Add Field —</option> + </select> + <button type="button" class="green button">Add</button> + </td> + </tr> + </tbody> +</table> \ No newline at end of file diff --git a/scp/css/scp.css b/scp/css/scp.css index 379db451cdaa0f6ee30e837b049e01960badb760..3a6b184c749aafa8c96cef18a8d3f40d68062027 100644 --- a/scp/css/scp.css +++ b/scp/css/scp.css @@ -1261,11 +1261,16 @@ a.print { .table tr:not(:last-child):not(.header) { border-bottom:1px dotted #ddd; } + .table tr.header { border-bottom: 1px dotted #777; } .table td:not(:empty) { - padding: 5px; + padding: 4px; + background-color:#fff; +} +.queue-sort.table td:not(:empty) { + padding: 10px; } .table.two-column tbody tr td:first-child { width: 25%; @@ -2225,7 +2230,9 @@ time.faq { min-height: 50px; overflow-y: auto; } - +.dialog .table td:not(:empty) { + background-color:#f8f8f8!IMPORTANT; +} .dialog#popup { width:650px; }