From 859904587fcad755b595298a12099db5a1e93bd2 Mon Sep 17 00:00:00 2001 From: ATM john Date: Thu, 12 Sep 2019 21:17:48 +0200 Subject: [PATCH] add private support and title buttons --- htdocs/core/lib/ticket.lib.php | 9 ++++++--- htdocs/langs/en_US/ticket.lang | 2 ++ htdocs/theme/eldy/btn.inc.php | 4 +++- htdocs/theme/eldy/timeline.inc.php | 6 ++++++ htdocs/ticket/messaging.php | 22 ++++++++++++++++++++-- 5 files changed, 37 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index 4487fdfdb3a..86f02d0ebd5 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -515,9 +515,9 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no } - require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php'; - $caction=new CActionComm($db); - $arraylist=$caction->liste_array(1, 'code', '', (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:0), '', 1); + //require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php'; + //$caction=new CActionComm($db); + //$arraylist=$caction->liste_array(1, 'code', '', (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:0), '', 1); $actualCycleDate = false; @@ -580,6 +580,9 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no elseif($actionstatic->code == 'TICKET_MSG'){ $iconClass = 'fa fa-comments'; } + elseif($actionstatic->code == 'TICKET_MSG_PRIVATE'){ + $iconClass = 'fa fa-mask'; + } elseif (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) { if ($actionstatic->type_picto) $img_picto = img_picto('', $actionstatic->type_picto); diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang index 70bd8220af0..bc2632a4254 100644 --- a/htdocs/langs/en_US/ticket.lang +++ b/htdocs/langs/en_US/ticket.lang @@ -137,6 +137,8 @@ NoUnreadTicketsFound=No unread ticket found TicketViewAllTickets=View all tickets TicketViewNonClosedOnly=View only open tickets TicketStatByStatus=Tickets by status +OrderByDateAsc=Sort by ascending date +OrderByDateDesc=Sort by descending date # # Ticket card diff --git a/htdocs/theme/eldy/btn.inc.php b/htdocs/theme/eldy/btn.inc.php index 2e42d42acaa..cd9d847f47d 100644 --- a/htdocs/theme/eldy/btn.inc.php +++ b/htdocs/theme/eldy/btn.inc.php @@ -208,7 +208,9 @@ TITLE BUTTON display: block; } - +div.pagination li:first-child a.btnTitle{ + margin-left: 10px; +} diff --git a/htdocs/theme/eldy/timeline.inc.php b/htdocs/theme/eldy/timeline.inc.php index d0a12021759..2cb3461d713 100644 --- a/htdocs/theme/eldy/timeline.inc.php +++ b/htdocs/theme/eldy/timeline.inc.php @@ -62,8 +62,10 @@ if (! defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> .timeline > li.timeline-code-ticket_msg_private > .timeline-item { background: #fffbe5; + border-color: #d0cfc0; } + .timeline > li > .timeline-item > .time{ color: #6f6f6f; float: right; @@ -123,6 +125,10 @@ a.timeline-btn:hover font-weight: normal; line-height: 1.1; } +.timeline > li.timeline-code-ticket_msg_private > .timeline-item > .timeline-header { + border-color: #ecebda; +} + .timeline > li > .timeline-item > .timeline-header > a { font-weight: 600; } diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php index c0442d27637..9f1b988f1a4 100644 --- a/htdocs/ticket/messaging.php +++ b/htdocs/ticket/messaging.php @@ -47,7 +47,7 @@ $page = GETPOST("page"); $page = is_numeric($page) ? $page : 0; $page = $page == -1 ? 0 : $page; if (! $sortfield) $sortfield="a.datep,a.id"; -if (! $sortorder) $sortorder="DESC"; +if (! $sortorder) $sortorder="desc"; $offset = $limit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; @@ -225,7 +225,25 @@ if (!empty($object->id)) if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; - print_barre_liste($langs->trans("ActionsOnTicket"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlcenter, '', 0, 1, 1); + $morehtmlright = ''; + + if($sortorder === 'desc') { + $sortUrl = $_SERVER["PHP_SELF"] . '?sortfield=a.datep&sortorder=asc' . $param; + $morehtmlright .= dolGetButtonTitle($langs->trans('Date'), $langs->trans('OrderByDateAsc'), 'fa fa-sort-numeric-down', $sortUrl, $id = '', $status = 1); + } + else{ + $sortUrl = $_SERVER["PHP_SELF"] . '?sortfield=a.datep&sortorder=desc' . $param; + $morehtmlright .= dolGetButtonTitle($langs->trans('Date'), $langs->trans('OrderByDateDesc'), 'fa fa-sort-numeric-down-alt', $sortUrl, $id = '', $status = 1); + } + + // Show link to add a message (if read and not closed) + $btnstatus = $object->fk_statut < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage"; + $url = 'card.php?track_id=' . $object->track_id . '&action=presend_addmessage&mode=init'; + $morehtmlright .= dolGetButtonTitle($langs->trans('TicketAddMessage') , '', 'fa fa-comment', $url, 'add-new-ticket-title-button', $btnstatus); + + + + print_barre_liste($langs->trans("ActionsOnTicket"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 1); // List of all actions $filters=array();