From 7ca19d7bac2553b29afdcfd18ab10d67d6f74fef Mon Sep 17 00:00:00 2001
From: Xenomporio <>
Date: Sun, 31 Jul 2022 21:45:38 +0200
Subject: [PATCH] Ticket system tag functionality as well as sort/search bugfix
---
www/pages/content/ticket_edit.tpl | 2 +-
www/pages/ticket.php | 34 ++++++++++++++++++++++++-------
www/themes/new/css/styles.css | 6 ++++++
3 files changed, 34 insertions(+), 8 deletions(-)
diff --git a/www/pages/content/ticket_edit.tpl b/www/pages/content/ticket_edit.tpl
index fa1191d6..034cb57c 100644
--- a/www/pages/content/ticket_edit.tpl
+++ b/www/pages/content/ticket_edit.tpl
@@ -24,7 +24,7 @@
{|Von|}: | [KUNDE] [MAILADRESSE] |
{|Projekt|}: | |
{|Adresse|}: | |
- {|Tags|}: | |
+ {|Tags|}: | |
diff --git a/www/pages/ticket.php b/www/pages/ticket.php
index f2e09d24..58e5509e 100644
--- a/www/pages/ticket.php
+++ b/www/pages/ticket.php
@@ -42,12 +42,16 @@ class Ticket {
switch ($name) {
case "ticket_list":
- $allowed['ticket_list'] = array('list');
- $heading = array('','','Ticket #', 'Letzte Aktion', 'Adresse', 'Betreff', 'Notizen', 'Tags', 'Verantwortlich', 'Nachr.', 'Status', 'Alter', 'Projekt', 'Menü');
- $width = array('1%','1%','5%', '5%', '5%', '20%', '20%', '5%', '5%', '1%', '1%', '5%', '5%', '5%');
- $findcols = array('t.id','t.id','t.schluessel', 't.zeit', 't.bearbeiter', 'a.name', 't.betreff', 't.notiz', 't.tags', 'w.warteschlange', 'nachrichten_anz', 't.status', 't.projekt');
- $searchsql = array('t.schluessel', 't.zeit', 't.bearbeiter', 'a.name', 't.betreff', 't.notiz', 't.tags', 'w.warteschlange', 't.status', 't.projekt');
+ $this->app->YUI->TagEditor('taglist', array('width'=>370));
+ $this->app->Tpl->Add('SCRIPTJAVASCRIPT','');
+
+ $allowed['ticket_list'] = array('list');
+ $heading = array('','','Ticket #', 'Letzte Aktion', 'Adresse', 'Betreff', 'Tags', 'Verant.', 'Nachr.', 'Status', 'Alter', 'Projekt', 'Menü');
+ $width = array('1%','1%','5%', '5%', '5%', '30%', '1%', '5%', '1%', '1%', '1%', '1%', '1%');
+
+ $findcols = array('t.id','t.id','t.schluessel', 't.zeit', 'a.name', 't.betreff', 't.tags', 'w.warteschlange', 'nachrichten_anz', 't.status','t.zeit', 't.projekt');
+ $searchsql = array( 't.schluessel', 't.zeit', 'a.name', 't.betreff','t.notiz', 't.tags', 'w.warteschlange', 't.status', 't.projekt');
$defaultorder = 1;
$defaultorderdesc = 0;
@@ -66,7 +70,22 @@ class Ticket {
$anzahlnachrichten = "(SELECT COUNT(n.id) FROM ticket_nachricht n WHERE n.ticket = t.schluessel)";
- $sql = "SELECT t.id,".$dropnbox.", t.schluessel, t.zeit, a.name, ".$priobetreff.", replace(substring(t.notiz,1,500),'\n','
'), t.tags, w.warteschlange, ".$anzahlnachrichten." as nachrichten_anz, ".ticket_iconssql().", ".$timedifference.", p.abkuerzung, t.id
+ $tagstart = "";
+ $tagend = "";
+
+ $sql = "SELECT
+ t.id,
+ ".$dropnbox.",
+ t.schluessel,
+ t.zeit,
+ a.name,
+ CONCAT('',".$priobetreff.",'
',replace(substring(t.notiz,1,500),'\n','
'),''), CONCAT(''\n,'".$tagstart."',replace(t.tags,',','".$tagend."
".$tagstart."'),'".$tagend."','
'),
+ w.warteschlange,
+ ".$anzahlnachrichten." as nachrichten_anz,
+ ".ticket_iconssql().",
+ ".$timedifference.",
+ p.abkuerzung,
+ t.id
FROM ticket t
LEFT JOIN adresse a ON t.adresse = a.id
LEFT JOIN warteschlangen w ON t.warteschlange = w.label
@@ -128,7 +147,7 @@ class Ticket {
// END Toggle filters
$moreinfo = true; // Allow drop down details
- $menucol = 13; // For moredata
+ $menucol = 12; // For moredata
$count = "SELECT count(DISTINCT id) FROM ticket t WHERE $where";
@@ -395,6 +414,7 @@ class Ticket {
$this->app->Tpl->Set('ADRESSE', $this->app->erp->ReplaceAdresse(false,$result[0]['adresse'],false)); // Convert ID to form display
$this->app->YUI->AutoComplete("projekt","projektname",1);
$this->app->YUI->AutoComplete("status","ticketstatus",1);
+ $this->app->YUI->TagEditor('tags', array('width'=>370));
$this->app->Tpl->Set('STATUS', $this->app->erp->GetStatusTicketSelect($result[0]['status']));
$input['projekt'] = $this->app->erp->ReplaceProjekt(false,$input['projekt'],false); // Parameters: Target db?, value, from form?
diff --git a/www/themes/new/css/styles.css b/www/themes/new/css/styles.css
index 917ff146..b8f1921c 100644
--- a/www/themes/new/css/styles.css
+++ b/www/themes/new/css/styles.css
@@ -2445,6 +2445,12 @@ ul.tag-editor {
border: 0 solid transparent;
background-color: transparent;
}
+
+.ticketoffene .tag-editor-tag {
+ padding-right: 5px;
+ padding-left: 5px;
+}
+
.ticketoffene input.tageditor {
visibility: hidden;
}