Hab hier mal einen kleinen Mod erstellt, der es erlaubt, bei jedem Ticket einzustellen, ob der Kunde ein Anhang hinzufügen kann.
Hoffe mal ich habe keine Änderung vergessen.
Habe die deutsche Version verwendet, deshalb sind auch Teile des Code in Deutsch.
wenn Intresse besteht, kann ich das auch nochmal übersetzen in die Originalversion, bzw wäre froh, wenn das jemand macht, der besser Englisch kann als ich :).
Note:
If you must have this Mod in English, please answer this Post and Say it to me. I have use the German Version for the Mod.
öffne tickets.php
finde:
if(!$cfg->allowOnlineAttachments()) //Something wrong with the form...user shouldn't have an option to attach
ersetze mit:
if(!$ticket->getAllowAttachment()) //Something wrong with the form...user shouldn't have an option to attach
öffne: include/class-ticket.php
finde:
//Replace base variables.
function replaceTemplateVars($text){
füge davor ein:
function allowAtachment() {
db_query('UPDATE '.TICKET_TABLE.' SET allow_attachment=1 WHERE ticket_id='.db_input($this->getId()));
}
function unAllowAttachment() {
db_query('UPDATE '.TICKET_TABLE.' SET allow_attachment=0 WHERE ticket_id='.db_input($this->getId()));
}
function getAllowAttachment($str = 0) {
$resp = db_query('SELECT allow_attachment FROM '.TICKET_TABLE.' WHERE ticket_id='.db_input($this->getId()));
$row = mysql_fetch_array($resp);
if (!$str)
return $row;
if ($row == 1)
return "erlaubt";
else
return "nicht erlaubt";
}
öffne:
include/client/viewticket.inc.php
finde:
<? if($cfg->allowOnlineAttachments()) {?>
ersetze mit:
<?if($ticket->getAllowAttachment() == 1) {?>
öffne: include/staff/viewticket.inc.php
finde:
<tr><th nowrap>Letzte Nachricht:</th>
<td><?=Format:($ticket->getLastMessageDate())?></td>
</tr>
füge danach ein:
<tr>
<th>Anhänge:</th>
<td><?=$ticket->getAllowAttachment(1)?></td>
</tr>
finde:
onChange="this.form.ticket_priority.disabled=strcmp(this.options.value,'change_priority','reopen','overdue')?false;">
ersetze mit:
onChange="this.form.ticket_priority.disabled=strcmp(this.options.value,'change_priority','reopen','overdue', 'allowAttachment', 'unAllowAttachment')?false;">
finde:
<?if($thisuser->canDeleteTickets()){ //oooh...fear the deleters! ?>
<option value="delete" >Ticket löschen</option>
<?}?>
füge danach ein:
<?php
if($ticket->getAllowAttachment() == 0)
print '<option value="allowAttachment">Gestatte Anhang</option>';
else
print '<option value="unAllowAttachment">Verbiete Anhang</option>';
?>
öffne: /scp/tickets.php
finde:
default:
$errors='Sie müssen eine Aktion auswählen um fortzufahren';
füge davor ein:
case 'allowattachment':
$ticket->allowAtachment();
$msg='für dieses Ticket wurde das Anhängen von Anhängen erlaubt';
break;
case 'unallowattachment':
$ticket->unAllowAttachment();
$msg='für dieses Ticket wurde das Anhängen von Anhängen verboten';
break;