Merge branch 'new-staff-page' into '3-0-0'
New staff page See merge request !27merge-requests/29/head
commit
ccb8931157
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -0,0 +1,51 @@
|
||||
.white {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.red,
|
||||
.important,
|
||||
.critical-priority {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.green {
|
||||
color: green;
|
||||
}
|
||||
|
||||
.orange,
|
||||
.rating {
|
||||
color: orange;
|
||||
}
|
||||
|
||||
.medium {
|
||||
color: #FF9900;
|
||||
}
|
||||
|
||||
.gray {
|
||||
color: grey;
|
||||
}
|
||||
|
||||
.critical {
|
||||
color: #9400d3;
|
||||
}
|
||||
|
||||
.blue {
|
||||
color: blue;
|
||||
}
|
||||
|
||||
.med-low-priority {
|
||||
background-color: #8BB467;
|
||||
}
|
||||
|
||||
.high-priority {
|
||||
background-color: #ff6a00;
|
||||
}
|
||||
|
||||
/* Hover colors */
|
||||
.red-on-hover:hover {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.gray-on-hover:hover {
|
||||
color: grey;
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
.hide-on-overflow {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.no-wrap {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.event-category {
|
||||
border-radius: 4px;
|
||||
padding: 5px;
|
||||
}
|
@ -0,0 +1,153 @@
|
||||
.navbar-nav > .messages-menu > .dropdown-menu >li .menu > li > a,
|
||||
.sidebar-menu, .main-sidebar .user-panel, .sidebar-menu > li.header{
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.icon-link {
|
||||
font-size: 16px; !important;
|
||||
}
|
||||
|
||||
#due-date:hover,
|
||||
.click-to-edit:hover {
|
||||
font-weight: bolder;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.linkless-dropdown {
|
||||
display: block;
|
||||
padding: 3px 20px;
|
||||
clear: both;
|
||||
font-weight: normal;
|
||||
line-height: 1.42857143;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.dropdown-menu>li>span>.fa {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.no-margins {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
@media (max-width: 991px) {
|
||||
.ticket-cell-admin {
|
||||
border-bottom: solid 1px #ddd;
|
||||
border-right: 0;
|
||||
padding-top: 5px;
|
||||
height: 100px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 992px) {
|
||||
.ticket-cell-admin {
|
||||
border-bottom: 0;
|
||||
border-right: solid 1px #ddd;
|
||||
margin-top: 1px;
|
||||
height: 100px;
|
||||
padding-top: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.ticket-property-title {
|
||||
color: rgba(255, 255, 255, .75);
|
||||
font-size: 11px;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
@media (min-width: 992px) {
|
||||
.ticketPropertyText {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.ticketPropertyText:hover {
|
||||
white-space: normal;
|
||||
overflow: visible;
|
||||
}
|
||||
}
|
||||
|
||||
.ticketPropertyText {
|
||||
font-size: 16px;
|
||||
line-height: 1em;
|
||||
color: #fff;
|
||||
padding-bottom: 2px;
|
||||
}
|
||||
|
||||
.status-row {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.push-down-10 {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
|
||||
.attachment-table > tbody > tr > td > i {
|
||||
color: #ddd;
|
||||
text-shadow: 2px 2px #ccc;
|
||||
}
|
||||
|
||||
.attachment-table > tbody > tr > td {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.attachment-table > tbody > tr > td > span > img {
|
||||
max-height: 80px;
|
||||
max-width: 80px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.note {
|
||||
border-bottom: solid 1px #000;
|
||||
}
|
||||
|
||||
.fileinput-button {
|
||||
width: 100%;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
margin-top: -2px;
|
||||
}
|
||||
|
||||
.file-row p.name {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.timeline-footer {
|
||||
border-top: 1px solid #f4f4f4;
|
||||
}
|
||||
|
||||
.timeline > .today-top {
|
||||
margin-bottom: 60px;
|
||||
}
|
||||
|
||||
.white-readonly {
|
||||
cursor: text !important;
|
||||
background-color: #fff !important;
|
||||
}
|
||||
|
||||
button.dropdown-submit {
|
||||
background: none !important;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.form-signin {
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.loginError {
|
||||
padding-top: 20px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.login-box {
|
||||
width: 500px;
|
||||
}
|
||||
|
||||
.login-box-body {
|
||||
border-radius: 5px;
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
.move-down-20 {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.move-right-20 {
|
||||
margin-left: 20px;
|
||||
}
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
function mfh_get_mail_headers_for_dropdown($user_id, $hesk_settings, $hesklang) {
|
||||
$deleted_user_text = hesk_dbEscape($hesklang['deleted_user_title_case']);
|
||||
$sql = "SELECT `mail`.`id` AS `id`, `mail`.`subject` AS `subject`,
|
||||
COALESCE(`users`.`name`, '{$deleted_user_text}') AS `from`, `mail`.`dt` AS `date`
|
||||
FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "mail` AS `mail`
|
||||
LEFT JOIN `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` AS `users`
|
||||
ON `mail`.`from` = `users`.`id`
|
||||
WHERE `to` = " . hesk_dbEscape($user_id) . "
|
||||
AND `read` = '0'
|
||||
ORDER BY `mail`.`dt` DESC";
|
||||
|
||||
$rs = hesk_dbQuery($sql);
|
||||
|
||||
$mails = array();
|
||||
while ($row = hesk_dbFetchAssoc($rs)) {
|
||||
$mails[] = $row;
|
||||
}
|
||||
|
||||
return $mails;
|
||||
}
|
@ -0,0 +1,168 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @param $search_filter Filter to search by. Valid criteria:
|
||||
* //TODO
|
||||
*/
|
||||
function get_tickets($search_filter, $hesk_settings) {
|
||||
$sql = "SELECT `id`, `trackid`, `name`, `email`, `category`, `priority`, `subject`, LEFT(`message`, 400) AS `message`,
|
||||
`dt`, `lastchange`, `firstreply`, `closedat`, `status`, `openedby`, `firstreplyby`, `closedby`, `replies`, `staffreplies`, `owner`,
|
||||
`time_worked`, `lastreplier`, `replierid`, `archive`, `locked`, `merged`, `due_date`, `latitude`, `longitude`, `user_agent`,
|
||||
`screen_resolution_width`, `screen_resolution_height`";
|
||||
|
||||
foreach ($hesk_settings['custom_fields'] as $k => $v) {
|
||||
if ($v['use']) {
|
||||
$sql .= ", `" . $k . "`";
|
||||
}
|
||||
}
|
||||
|
||||
$sql .= " FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` WHERE ";
|
||||
|
||||
// --> CATEGORY
|
||||
$category = $search_filter['category'];
|
||||
if ($category > 0 && hesk_okCategory($category, 0)) {
|
||||
$sql .= " `category`='{$category}' ";
|
||||
} else {
|
||||
$sql .= hesk_myCategories();
|
||||
}
|
||||
|
||||
// --> TAGGED
|
||||
$tagged = $search_filter['tagged'];
|
||||
if ($tagged) {
|
||||
$sql .= " AND `archive`='1' ";
|
||||
}
|
||||
|
||||
// --> TICKET ASSIGNMENT
|
||||
$sql = handle_ticket_assignments($search_filter, $sql);
|
||||
|
||||
// --> TICKET STATUS
|
||||
$statuses = $search_filter['status'];
|
||||
if (count($statuses) > 0) {
|
||||
$sql .= " AND `status` IN ('" . implode("','", $statuses) . "') ";
|
||||
}
|
||||
|
||||
// --> TICKET PRIORITY
|
||||
$priorities = $search_filter['priority'];
|
||||
|
||||
if (count($priorities) > 0) {
|
||||
$sql .= " AND `priority` IN ('" . implode("','", array_keys($priority)) . "') ";
|
||||
}
|
||||
|
||||
// Sorting
|
||||
$sql .= " ORDER BY ";
|
||||
|
||||
// --> PUSH TO TOP
|
||||
$force_to_top = $search_filter['force_to_top'];
|
||||
$direction = $search_filter['force_direction'];
|
||||
if ($force_to_top != NULL) {
|
||||
if ($force_to_top == 'owner') {
|
||||
$sql .= " CASE WHEN `owner` = '".intval($_SESSION['id'])."' THEN 1 ELSE 0 END DESC, `owner` ASC, ";
|
||||
} else {
|
||||
$sql .= ' `'.hesk_dbEscape($force_to_top).'` ';
|
||||
$sql .= $direction == 'ascending' ? 'ASC, ' : 'DESC, ';
|
||||
}
|
||||
}
|
||||
|
||||
// --> CRITICAL ON TOP
|
||||
$critical_on_top = $search_filter['critical_on_top'];
|
||||
if ($critical_on_top) {
|
||||
$sql .= " CASE WHEN `priority` = '0' THEN 1 ELSE 0 END DESC , ";
|
||||
}
|
||||
|
||||
// --> SORT BY
|
||||
$sort_by = $search_filter['sort_by'];
|
||||
$sort_direction = $search_filter['sort_direction'];
|
||||
|
||||
if ($sort_by) {
|
||||
$sql .= $sort_by == 'lastreplier'
|
||||
? " CASE WHEN `lastreplier` = '0' THEN 0 ELSE 1 END DESC, COALESCE(`replierid`, NULLIF(`lastreplier`, '0'), `name`) "
|
||||
: ' `'.hesk_dbEscape($sort_by).'` ';
|
||||
} else {
|
||||
$sql .= ' `status` ';
|
||||
$sort_by = 'status';
|
||||
}
|
||||
|
||||
$sql .= $sort_direction == 'ascending'
|
||||
? ' ASC '
|
||||
: ' DESC ';
|
||||
|
||||
if ($sort_by != 'priority') {
|
||||
$sql .= ' , `priority` ASC ';
|
||||
}
|
||||
|
||||
//Uncomment for debugging purposes
|
||||
//echo "SQL: $sql";
|
||||
$results = hesk_dbQuery($sql);
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
function handle_ticket_assignments($search_filter, $sql) {
|
||||
$assigned_to_self = $search_filter['assignment']['self'];
|
||||
$assigned_to_others = $search_filter['assignment']['others'];
|
||||
$assigned_to_no_one = $search_filter['assignment']['no_one'];
|
||||
|
||||
if (!$assigned_to_self && !$assigned_to_others && !$assigned_to_no_one) {
|
||||
$assigned_to_self = true;
|
||||
$assigned_to_others = true;
|
||||
$assigned_to_no_one = true;
|
||||
|
||||
if (!defined('MAIN_PAGE')) {
|
||||
hesk_show_notice($hesklang['e_nose']);
|
||||
}
|
||||
}
|
||||
|
||||
/* If the user doesn't have permission to view assigned to others block those */
|
||||
if (!hesk_checkPermission('can_view_ass_others',0)) {
|
||||
$assigned_to_others = 0;
|
||||
}
|
||||
|
||||
/* If the user doesn't have permission to view unassigned tickets block those */
|
||||
if (!hesk_checkPermission('can_view_unassigned',0)) {
|
||||
$assigned_to_no_one = 0;
|
||||
}
|
||||
|
||||
/* Process assignments */
|
||||
if (!$assigned_to_self || !$assigned_to_others || !$assigned_to_no_one) {
|
||||
if ($assigned_to_self && $assigned_to_others) {
|
||||
// All but unassigned
|
||||
$sql .= " AND `owner` > 0 ";
|
||||
} elseif ($assigned_to_self && $assigned_to_no_one) {
|
||||
// My tickets + unassigned
|
||||
$sql .= " AND `owner` IN ('0', '" . intval($_SESSION['id']) . "') ";
|
||||
} elseif ($assigned_to_others && $assigned_to_no_one) {
|
||||
// Assigned to others + unassigned
|
||||
$sql .= " AND `owner` != '" . intval($_SESSION['id']) . "' ";
|
||||
}
|
||||
elseif ($assigned_to_self) {
|
||||
// Assigned to me only
|
||||
$sql .= " AND `owner` = '" . intval($_SESSION['id']) . "' ";
|
||||
} elseif ($assigned_to_others) {
|
||||
// Assigned to others
|
||||
$sql .= " AND `owner` NOT IN ('0', '" . intval($_SESSION['id']) . "') ";
|
||||
} elseif ($assigned_to_no_one) {
|
||||
// Only unassigned
|
||||
$sql .= " AND `owner` = 0 ";
|
||||
}
|
||||
}
|
||||
|
||||
return $sql;
|
||||
}
|
||||
|
||||
function get_empty_filter() {
|
||||
$search_filter['category'] = NULL;
|
||||
$search_filter['tagged'] = NULL;
|
||||
$search_filter['status'] = NULL;
|
||||
$search_filter['priority'] = NULL;
|
||||
$search_filter['force_to_top'] = NULL;
|
||||
$search_filter['force_direction'] = NULL;
|
||||
$search_filter['critical_on_top'] = NULL;
|
||||
$search_filter['sort_by'] = NULL;
|
||||
$search_filter['sort_direction'] = NULL;
|
||||
$search_filter['assignment'] = array();
|
||||
$search_filter['assignment']['self'] = 0;
|
||||
$search_filter['assignment']['others'] = 0;
|
||||
$search_filter['assignment']['no_one'] = 0;
|
||||
|
||||
return $search_filter;
|
||||
}
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue