Skip to content
Snippets Groups Projects
Commit f66e0c67 authored by Nathan Febuary's avatar Nathan Febuary Committed by Peter Rotich
Browse files

feature/custom-queue-sorting

Adds the UI for sorting and creating custom sorting options. Custom
sorting options can be used for ANY custom queue. Custom sorting has an
ascending priority. Meaning the top sorted field option is sorted
first.
parent e6b33417
No related branches found
No related tags found
No related merge requests found
......@@ -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>&mdash; <?php echo __('Add New Sort Criteria');?> &mdash;</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>
......
<?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>
<?php
/**
* Calling conventions
*
* $column - <QueueColumn> instance for this column
*/
$colid = $column->getId();
?>
<h3 class="drag-handle"><?php echo __('Manage Sort Options'); ?> &mdash;
<?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>
<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
......@@ -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;
}
......
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