mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2025-01-12 06:41:14 +01:00
ticket add spam filter from list
This commit is contained in:
parent
088ad4555c
commit
d7db78489c
@ -49,7 +49,19 @@
|
|||||||
<tr><td>{|Status|}:</td><td><select name="status">[STATUS]</select></td></tr>
|
<tr><td>{|Status|}:</td><td><select name="status">[STATUS]</select></td></tr>
|
||||||
<tr><td>{|Verantwortlich|}:</td><td><input type="text" name="warteschlange" id="warteschlange" value="[WARTESCHLANGE]" size="20"></td></tr>
|
<tr><td>{|Verantwortlich|}:</td><td><input type="text" name="warteschlange" id="warteschlange" value="[WARTESCHLANGE]" size="20"></td></tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><input type="checkbox" value="1" id="autoalle" /> alle markieren </td><td><input type="submit" class="btnBlue" name="ausfuehren" value="{|Zuordnen|}" /></td>
|
<td>
|
||||||
|
<input type="checkbox" value="1" id="autoalle" /> alle markieren
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<button name="submit" value="zuordnen" class="ui-button-icon" style="width:100%;">{|Zuordnen|}</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr [SPAM_HIDDEN]>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<button name="submit" value="spam_filter" class="ui-button-icon" title="Ticket auf Status 'Papierkorb' setzen und Absender-Adresse in Ticketregel eintragen" style="width:100%;">{|Spamregel erstellen|}</button>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
@ -187,6 +187,7 @@ class Ticket {
|
|||||||
|
|
||||||
// Process multi action
|
// Process multi action
|
||||||
$auswahl = $this->app->Secure->GetPOST('auswahl');
|
$auswahl = $this->app->Secure->GetPOST('auswahl');
|
||||||
|
$submit = $this->app->Secure->GetPOST('submit');
|
||||||
$selectedIds = [];
|
$selectedIds = [];
|
||||||
if(!empty($auswahl)) {
|
if(!empty($auswahl)) {
|
||||||
foreach($auswahl as $selectedId) {
|
foreach($auswahl as $selectedId) {
|
||||||
@ -196,19 +197,72 @@ class Ticket {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$status = $this->app->Secure->GetPOST('status');
|
switch ($submit) {
|
||||||
$warteschlange = $this->app->Secure->GetPOST('warteschlange');
|
case 'zuordnen':
|
||||||
|
$status = $this->app->Secure->GetPOST('status');
|
||||||
|
$warteschlange = $this->app->Secure->GetPOST('warteschlange');
|
||||||
|
|
||||||
$sql = "UPDATE ticket SET status = '".$status."', zeit = NOW()";
|
$sql = "UPDATE ticket SET status = '".$status."', zeit = NOW()";
|
||||||
if ($warteschlange != '') {
|
if ($warteschlange != '') {
|
||||||
$sql .= ", warteschlange = '".explode(" ",$warteschlange)[0]."'";
|
$sql .= ", warteschlange = '".explode(" ",$warteschlange)[0]."'";
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql .= " WHERE id IN (".implode(",",$selectedIds).")";
|
$sql .= " WHERE id IN (".implode(",",$selectedIds).")";
|
||||||
$this->app->DB->Update($sql);
|
$this->app->DB->Update($sql);
|
||||||
|
|
||||||
$this->ticket_set_self_assigned_status($selectedIds);
|
$this->ticket_set_self_assigned_status($selectedIds);
|
||||||
|
break;
|
||||||
|
case 'spam_filter':
|
||||||
|
if($this->app->erp->RechteVorhanden('ticketregeln','create')) {
|
||||||
|
$sql = "UPDATE ticket SET status = 'spam', zeit = NOW()";
|
||||||
|
$sql .= " WHERE id IN (".implode(",",$selectedIds).")";
|
||||||
|
$this->app->DB->Update($sql);
|
||||||
|
|
||||||
|
foreach ($selectedIds as $selectedId) {
|
||||||
|
|
||||||
|
// Check existing
|
||||||
|
$sql = "SELECT id FROM ticket_regeln WHERE
|
||||||
|
empfaenger_email = '' AND
|
||||||
|
sender_email = (SELECT mailadresse FROM ticket WHERE id = ".$selectedId." LIMIT 1) AND
|
||||||
|
name = '' AND
|
||||||
|
betreff = '' AND
|
||||||
|
spam = 1 AND
|
||||||
|
aktiv = 1
|
||||||
|
";
|
||||||
|
|
||||||
|
if (!$this->app->DB->Select($sql)) {
|
||||||
|
$sql = "INSERT IGNORE INTO ticket_regeln (
|
||||||
|
empfaenger_email,
|
||||||
|
sender_email,
|
||||||
|
name,
|
||||||
|
betreff,
|
||||||
|
spam,
|
||||||
|
persoenlich,
|
||||||
|
prio,
|
||||||
|
dsgvo,
|
||||||
|
adresse,
|
||||||
|
warteschlange,
|
||||||
|
aktiv
|
||||||
|
) VALUES (
|
||||||
|
'',
|
||||||
|
(SELECT mailadresse FROM ticket WHERE id = ".$selectedId." LIMIT 1),
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
)";
|
||||||
|
$this->app->DB->Insert($sql);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// List
|
// List
|
||||||
@ -223,6 +277,10 @@ class Ticket {
|
|||||||
$this->app->Tpl->Set('STATUS', $this->app->erp->GetStatusTicketSelect('neu'));
|
$this->app->Tpl->Set('STATUS', $this->app->erp->GetStatusTicketSelect('neu'));
|
||||||
$this->app->YUI->AutoComplete("warteschlange","warteschlangename");
|
$this->app->YUI->AutoComplete("warteschlange","warteschlangename");
|
||||||
|
|
||||||
|
if(!$this->app->erp->RechteVorhanden('ticketregeln','create')) {
|
||||||
|
$this->app->Tpl->Set('SPAM_HIDDEN', 'hidden');
|
||||||
|
}
|
||||||
|
|
||||||
$this->app->YUI->TableSearch('TAB1', 'ticket_list', "show", "", "", basename(__FILE__), __CLASS__);
|
$this->app->YUI->TableSearch('TAB1', 'ticket_list', "show", "", "", basename(__FILE__), __CLASS__);
|
||||||
$this->app->Tpl->Parse('PAGE', "ticket_list.tpl");
|
$this->app->Tpl->Parse('PAGE', "ticket_list.tpl");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user