Compare commits

...

5 Commits

Author SHA1 Message Date
OpenXE-ERP
ce11caac12
Merge pull request #54 from tsgoff/patch-1
setup.php php 8.1 deprecation for function_exists(): Passing null to parameter
2023-01-19 10:53:11 +01:00
OpenXE
bb3a68042d ticket system ensure status offen on self-assigned tickets 2023-01-19 09:27:23 +01:00
tsgoff
f8bfe19f1d
Update setup.php
php 8.1 deprecation for function_exists(): Passing null to parameter
2023-01-18 23:15:24 +01:00
OpenXE
d89c23ad0e bugfix ticket system mail addresses with long tld > 4 characters 2023-01-18 14:41:12 +01:00
OpenXE
cb3191393a Bugfix ticket system letzte aktion 2023-01-17 10:31:10 +01:00
3 changed files with 21 additions and 7 deletions

View File

@ -20,11 +20,11 @@
<table width="100%" border="0" class="mkTableFormular">
<legend>{|[STATUSICON]<b>Ticket <font color="blue">#[SCHLUESSEL]</font></b>|}</legend>
<tr><td>{|Betreff|}:</td><td><input type="text" name="betreff" id="betreff" value="[BETREFF]" size="20"></td></tr>
<tr><td>{|Letzte Aktion|}:</td><td>[ZEIT]</td></tr>
<tr><td>{|Von|}:</td><td>[KUNDE]&nbsp;[MAILADRESSE]</td></tr>
<tr><td>{|Projekt|}:</td><td><input type="text" name="projekt" id="projekt" value="[PROJEKT]" size="20"></td></tr>
<tr><td>{|Adresse|}:</td><td><input type="text" name="adresse" id="adresse" value="[ADRESSE]" size="20"><a href="index.php?module=adresse&action=edit&id=[ADRESSE_ID]"><img src="./themes/new/images/forward.svg" border="0" style="top:6px; position:relative"></a></td></tr>
<tr><td>{|Tags|}:</td><td><input type="text" name="tags" id="tags" value="[TAGS]" size="20"></td></tr>
<tr><td>{|Letzte Aktion|}:</td><td>[ZEIT]</td></tr>
</table>
</fieldset>
</div>

View File

@ -172,6 +172,16 @@ class Ticket {
return $erg;
}
// Ensure status 'offen' on self-assigned tickets
function ticket_set_self_assigned_status(array $ids) {
$sql = "UPDATE ticket SET status = 'offen'
WHERE
status = 'neu'
AND id IN (".implode(',',$ids).")
AND warteschlange IN (SELECT label FROM warteschlangen WHERE adresse = '".$this->app->User->GetAdresse()."')";
$this->app->DB->Update($sql);
}
function ticket_list() {
// Process multi action
@ -183,7 +193,7 @@ class Ticket {
if($selectedId > 0) {
$selectedIds[] = $selectedId;
}
}
}
$status = $this->app->Secure->GetPOST('status');
$warteschlange = $this->app->Secure->GetPOST('warteschlange');
@ -194,9 +204,10 @@ class Ticket {
}
$sql .= " WHERE id IN (".implode(",",$selectedIds).")";
$this->app->DB->Update($sql);
$this->ticket_set_self_assigned_status($selectedIds);
}
// List
@ -488,6 +499,9 @@ class Ticket {
$sql = "INSERT INTO ticket (".$columns.") VALUES (".$values.") ON DUPLICATE KEY UPDATE ".$update;
$this->app->DB->Update($sql);
$id = $this->app->DB->GetInsertID();
$this->ticket_set_self_assigned_status(array($id));
return($id);
}
@ -578,7 +592,7 @@ class Ticket {
// Load values again from database
$sql = "SELECT t.id, t.schluessel, ".$this->app->erp->FormatDateTimeShort("zeit").", p.abkuerzung as projekt, t.bearbeiter, t.quelle, t.status, t.prio, t.adresse, t.kunde, CONCAT(w.label,' ',w.warteschlange) as warteschlange, t.mailadresse, t.betreff, t.zugewiesen, t.inbearbeitung, t.inbearbeitung_user, t.firma, t.notiz, t.bitteantworten, t.service, t.kommentar, t.privat, t.dsgvo, t.tags, t.nachrichten_anz, t.id FROM ticket t LEFT JOIN adresse a ON t.adresse = a.id LEFT JOIN projekt p on t.projekt = p.id LEFT JOIN warteschlangen w on t.warteschlange = w.label WHERE t.id=$id";
$sql = "SELECT t.id, t.schluessel, ".$this->app->erp->FormatDateTimeShort("zeit",'zeit').", p.abkuerzung as projekt, t.bearbeiter, t.quelle, t.status, t.prio, t.adresse, t.kunde, CONCAT(w.label,' ',w.warteschlange) as warteschlange, t.mailadresse, t.betreff, t.zugewiesen, t.inbearbeitung, t.inbearbeitung_user, t.firma, t.notiz, t.bitteantworten, t.service, t.kommentar, t.privat, t.dsgvo, t.tags, t.nachrichten_anz, t.id FROM ticket t LEFT JOIN adresse a ON t.adresse = a.id LEFT JOIN projekt p on t.projekt = p.id LEFT JOIN warteschlangen w on t.warteschlange = w.label WHERE t.id=$id";
$ticket_from_db = $this->app->DB->SelectArr($sql)[0];
@ -776,12 +790,12 @@ class Ticket {
// Attachments
$files = $this->app->erp->GetDateiSubjektObjektDateiname('Anhang','Ticket',$drafted_messages[0]['id'],"");
$pattern = '/[a-z0-9_\-\+\.]+@[a-z0-9\-]+\.([a-z]{2,4})(?:\.[a-z]{2})?/i';
$pattern = '/[a-z0-9_\-\+\.]+@[a-z0-9\-]+\.([a-z]{2,63})(?:\.[a-z]{2})?/i';
preg_match_all($pattern, $drafted_messages[0]['mail'], $matches);
$to = $matches[0];
if ($drafted_messages[0]['mail_cc'] != '') {
$pattern = '/[a-z0-9_\-\+\.]+@[a-z0-9\-]+\.([a-z]{2,4})(?:\.[a-z]{2})?/i';
preg_match_all($pattern, $drafted_messages[0]['mail_cc'], $matches);
$cc = $matches[0];
} else {

View File

@ -101,7 +101,7 @@
unset($_POST['_ACTION']);
unset($_POST['_SUBMIT']);
$error = ((function_exists($action)) ? $action() : '');
$error = ((function_exists($action ?? '')) ? $action() : '');
if($configfile=='') $error .= "<br>'configfile' for this step is missing";
if($error=='') {