492 lines
26 KiB
PHP
492 lines
26 KiB
PHP
|
|
<?php
|
||
|
|
//Note that ticket is initiated in tickets.php.
|
||
|
|
if(!defined('OSTSCPINC') || !@$thisuser->isStaff() || !is_object($ticket) ) die('Ungültiger Pfad');
|
||
|
|
if(!$ticket->getId() or (!$thisuser->canAccessDept($ticket->getDeptId()) and $thisuser->getId()!=$ticket->getStaffId())) die('Zugriff verweigert');
|
||
|
|
|
||
|
|
$info=($_POST && $errors)?Format::input($_POST):array(); //Re-use the post info on error...savekeyboards.org
|
||
|
|
|
||
|
|
//Auto-lock the ticket if locking is enabled..if locked already simply renew it.
|
||
|
|
if($cfg->getLockTime() && !$ticket->acquireLock())
|
||
|
|
$warn.='Nicht in der Lage, eine Sperre für das Ticket zu erhalten.';
|
||
|
|
|
||
|
|
//We are ready baby...lets roll. Akon rocks!
|
||
|
|
$dept = $ticket->getDept(); //Dept
|
||
|
|
$staff = $ticket->getStaff(); //Assiged staff.
|
||
|
|
$lock = $ticket->getLock(); //Ticket lock obj
|
||
|
|
$id=$ticket->getId(); //Ticket ID.
|
||
|
|
$stati = $ticket->getStatus();
|
||
|
|
switch(strtolower($stati)){ //Status is overloaded
|
||
|
|
case 'open':
|
||
|
|
$ger_status='Offen';
|
||
|
|
break;
|
||
|
|
case 'closed':
|
||
|
|
$ger_status='Abgeschlossen';
|
||
|
|
break;
|
||
|
|
default:
|
||
|
|
$ger_status='Offen';
|
||
|
|
}
|
||
|
|
|
||
|
|
if($staff)
|
||
|
|
$warn.=' <span class="Icon assignedTicket">Ticket ist an '.$staff->getName().' zugewiesen</span>';
|
||
|
|
if(!$errors['err'] && ($lock && $lock->getStaffId()!=$thisuser->getId()))
|
||
|
|
$errors['err']='Dieses Ticket ist momentan durch einen anderen Mitarbeiter in Nutzung!';
|
||
|
|
if(!$errors['err'] && ($emailBanned=BanList::isbanned($ticket->getEmail())))
|
||
|
|
$errors['err']='Email befindet sich in der Sperrliste! Sie muss dort erst entfernt werden bevor man antworten kann';
|
||
|
|
if($ticket->isOverdue())
|
||
|
|
$warn.=' <span class="Icon overdueTicket">Überfällig markiert!</span>';
|
||
|
|
|
||
|
|
?>
|
||
|
|
<table width="100%" cellpadding="2" cellspacing="0" border="0">
|
||
|
|
<tr>
|
||
|
|
<td class="msg" width=50%>
|
||
|
|
Ticket #<?=$ticket->getExtId()?> <a href="tickets.php?id=<?=$id?>" title="Aktualisieren"><span class="Icon refresh"> </span></a></td>
|
||
|
|
|
||
|
|
<td class="msg" width=50%>
|
||
|
|
<? if($thisuser->canEditTickets() || ($thisuser->isManager() && $dept->getId()==$thisuser->getDeptId())) { ?>
|
||
|
|
<a href="tickets.php?id=<?=$id?>&a=edit" title="Ticket ändern" class="Icon editTicket">Ticket ändern</a>
|
||
|
|
<?}?>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<tr>
|
||
|
|
<td width=50%>
|
||
|
|
<table align="center" class="ticketinfo" cellspacing="1" cellpadding="3" width="100%" border=0>
|
||
|
|
<tr>
|
||
|
|
<th>Status:</th>
|
||
|
|
<td><?=$ger_status?></td>
|
||
|
|
</tr>
|
||
|
|
<tr>
|
||
|
|
<th>Priorität:</th>
|
||
|
|
<td><?=$ticket->getPriority()?></td>
|
||
|
|
</tr>
|
||
|
|
<tr>
|
||
|
|
<th>Abteilung:</th>
|
||
|
|
<td><?=Format::htmlchars($ticket->getDeptName())?></td>
|
||
|
|
</tr>
|
||
|
|
<tr>
|
||
|
|
<th>Erstellungsdatum:</th>
|
||
|
|
<td><?=Format::db_datetime($ticket->getCreateDate())?></td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</td>
|
||
|
|
<td width=50% valign="top">
|
||
|
|
<table align="center" class="ticketinfo" cellspacing="1" cellpadding="3" width="100%" border=0>
|
||
|
|
<tr>
|
||
|
|
<th>Name:</th>
|
||
|
|
<td><?=Format::htmlchars($ticket->getName())?></td>
|
||
|
|
</tr>
|
||
|
|
<tr>
|
||
|
|
<th>Email:</th>
|
||
|
|
<td><?php
|
||
|
|
echo $ticket->getEmail();
|
||
|
|
if(($related=$ticket->getRelatedTicketsCount())) {
|
||
|
|
echo sprintf(' <a href="tickets.php?a=search&query=%s" title="in Verbindung stehende Tickets">(<b>%d</b>)</a>',
|
||
|
|
urlencode($ticket->getEmail()),$related);
|
||
|
|
}
|
||
|
|
?>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<tr>
|
||
|
|
<th>Telefon:</th>
|
||
|
|
<td><?=Format::phone($ticket->getPhoneNumber())?></td>
|
||
|
|
</tr>
|
||
|
|
<tr>
|
||
|
|
<th>Quelle:</th>
|
||
|
|
<td><?=$ticket->getSource()?></td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<tr><td colspan=2 class="msg">Betreff: <?=Format::htmlchars($ticket->getSubject())?></td></tr>
|
||
|
|
<tr>
|
||
|
|
<td valign="top" width=50%>
|
||
|
|
<table align="center" class="ticketinfo" cellspacing="1" cellpadding="3" width="100%" border=0>
|
||
|
|
<tr>
|
||
|
|
<th>Bearbeiter:</th>
|
||
|
|
<td><?=$staff?Format::htmlchars($staff->getName()):'- nicht zugewiesen -'?></td>
|
||
|
|
</tr>
|
||
|
|
<tr>
|
||
|
|
<th nowrap>Letzte Bearbeitung:</th>
|
||
|
|
<td><?=Format::db_datetime($ticket->getLastResponseDate())?></td>
|
||
|
|
</tr>
|
||
|
|
<?php
|
||
|
|
if($ticket->isOpen()){ ?>
|
||
|
|
<tr>
|
||
|
|
<th>Ablaufdatum:</th>
|
||
|
|
<td><?=Format::db_datetime($ticket->getDueDate())?></td>
|
||
|
|
</tr>
|
||
|
|
<?php
|
||
|
|
}else { ?>
|
||
|
|
<tr>
|
||
|
|
<th>Geschlossen am:</th>
|
||
|
|
<td><?=Format::db_datetime($ticket->getCloseDate())?></td>
|
||
|
|
</tr>
|
||
|
|
<?php
|
||
|
|
}
|
||
|
|
?>
|
||
|
|
</table>
|
||
|
|
</td>
|
||
|
|
<td width=50% valign="top">
|
||
|
|
<table align="center" class="ticketinfo" cellspacing="1" cellpadding="3" width="100%" border=0>
|
||
|
|
<tr><th>Hilfethema:</th>
|
||
|
|
<td><?
|
||
|
|
$ht=$ticket->getHelpTopic();
|
||
|
|
echo Format::htmlchars($ht?$ht:'N/A');
|
||
|
|
?>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<tr>
|
||
|
|
<th>IP Adresse:</th>
|
||
|
|
<td><?=$ticket->getIP()?></td>
|
||
|
|
</tr>
|
||
|
|
<tr><th nowrap>Letzte Nachricht:</th>
|
||
|
|
<td><?=Format::db_datetime($ticket->getLastMessageDate())?></td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
<div>
|
||
|
|
<?if($errors['err'] && $_POST['a']=='process') {?>
|
||
|
|
<p align="center" id="errormessage"><?=$errors['err']?></p>
|
||
|
|
<?}elseif($msg && $_POST['a']=='process' || $_POST['a']=='update' ) {?>
|
||
|
|
<p align="center" id="infomessage"><?=$msg?></p>
|
||
|
|
<?}elseif($warn) {?>
|
||
|
|
<p id="warnmessage"><?=$warn?></p>
|
||
|
|
<?}?>
|
||
|
|
</div>
|
||
|
|
<?
|
||
|
|
//Ticket adminstrative options...admin,managers and staff with manage perm allowed.
|
||
|
|
if($thisuser->canManageTickets() || $thisuser->isManager()){ ?>
|
||
|
|
<table cellpadding="0" cellspacing="2" border="0" width="100%" class="ticketoptions">
|
||
|
|
<tr><td>
|
||
|
|
<form name=action action='tickets.php?id=<?=$id?>' method=post class="inline" >
|
||
|
|
<input type='hidden' name='ticket_id' value="<?=$id?>"/>
|
||
|
|
<input type='hidden' name='a' value="process"/>
|
||
|
|
<span for="do"> <b>Aktion:</b></span>
|
||
|
|
<select id="do" name="do"
|
||
|
|
onChange="this.form.ticket_priority.disabled=strcmp(this.options[this.selectedIndex].value,'change_priority','reopen','overdue')?false:true;">
|
||
|
|
<option value="">Aktion wählen</option>
|
||
|
|
<option value="change_priority" <?=$info['do']=='change_priority'?'selected':''?> >Priorität ändern</option>
|
||
|
|
<?if(!$ticket->isoverdue()){ ?>
|
||
|
|
<option value="overdue" <?=$info['do']=='overdue'?'selected':''?> >Überfällig markieren</option>
|
||
|
|
<?}?>
|
||
|
|
<?if($ticket->isAssigned()){ ?>
|
||
|
|
<option value="release" <?=$info['do']=='release'?'selected':''?> >Freigabe (aufheben)</option>
|
||
|
|
<?}?>
|
||
|
|
|
||
|
|
<?if($thisuser->canCloseTickets()){
|
||
|
|
//if you can close a ticket...reopening it is given.
|
||
|
|
if($ticket->isOpen()){?>
|
||
|
|
<option value="close" <?=$info['do']=='close'?'selected':''?> >Ticket schließen</option>
|
||
|
|
<?}else{?>
|
||
|
|
<option value="reopen" <?=$info['do']=='reopen'?'selected':''?> >Ticket wieder öffnen</option>
|
||
|
|
<?}
|
||
|
|
}?>
|
||
|
|
<?php
|
||
|
|
if($thisuser->canManageBanList()) {
|
||
|
|
if(!$emailBanned) {?>
|
||
|
|
<option value="banemail" >Email sperren <?=$ticket->isOpen()?'& Ticket schließen':''?></option>
|
||
|
|
<?}else{?>
|
||
|
|
<option value="unbanemail">Gestatte Email</option>
|
||
|
|
<?}
|
||
|
|
}?>
|
||
|
|
|
||
|
|
<?if($thisuser->canDeleteTickets()){ //oooh...fear the deleters! ?>
|
||
|
|
<option value="delete" >Ticket löschen</option>
|
||
|
|
<?}?>
|
||
|
|
</select>
|
||
|
|
<span for="ticket_priority">Priorität:</span>
|
||
|
|
<select id="ticket_priority" name="ticket_priority" <?=!$info['do']?'disabled':''?> >
|
||
|
|
<option value="0" selected="selected">-Unverändert-</option>
|
||
|
|
<?
|
||
|
|
$priorityId=$ticket->getPriorityId();
|
||
|
|
$resp=db_query('SELECT priority_id,priority_desc FROM '.TICKET_PRIORITY_TABLE);
|
||
|
|
while($row=db_fetch_array($resp)){ ?>
|
||
|
|
<option value="<?=$row['priority_id']?>" <?=$priorityId==$row['priority_id']?'disabled':''?> ><?=$row['priority_desc']?></option>
|
||
|
|
<?}?>
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<input class="button" type="submit" value="Los">
|
||
|
|
</form>
|
||
|
|
</tr></td>
|
||
|
|
</table>
|
||
|
|
<?}?>
|
||
|
|
<br>
|
||
|
|
<?
|
||
|
|
//Internal Notes
|
||
|
|
|
||
|
|
$sql ='SELECT note_id,title,note,source,created FROM '.TICKET_NOTE_TABLE.' WHERE ticket_id='.db_input($id).' ORDER BY created DESC';
|
||
|
|
if(($resp=db_query($sql)) && ($notes=db_num_rows($resp))){
|
||
|
|
$display=($notes>5)?'none':'block'; //Collapse internal notes if more than 5.
|
||
|
|
?>
|
||
|
|
<div align="left">
|
||
|
|
<a class="Icon note" href="#" onClick="toggleLayer('ticketnotes'); return false;">Interne Notizen (<?=$notes?>)</a><br><br>
|
||
|
|
<div id='ticketnotes' style="display:<?=$display?>;text-align:center;">
|
||
|
|
<?
|
||
|
|
while($row=db_fetch_array($resp)) {?>
|
||
|
|
<table align="center" class="note" cellspacing="0" cellpadding="1" width="100%" border=0>
|
||
|
|
<tr><th><?=Format::db_daydatetime($row['created'])?> - eingetragen von <?=$row['source']?></th></tr>
|
||
|
|
<? if($row['title']) {?>
|
||
|
|
<tr class="header"><td><?=Format::display($row['title'])?></td></tr>
|
||
|
|
<?} ?>
|
||
|
|
<tr><td><?=Format::display($row['note'])?></td></tr>
|
||
|
|
</table>
|
||
|
|
<?} ?>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<?} ?>
|
||
|
|
<div align="left">
|
||
|
|
<a class="Icon thread" href="#" onClick="toggleLayer('ticketthread'); return false;">Ticket-Verlauf</a>
|
||
|
|
<div id="ticketthread">
|
||
|
|
<?
|
||
|
|
//get messages
|
||
|
|
$sql='SELECT msg.msg_id,msg.created,msg.message,count(attach_id) as attachments FROM '.TICKET_MESSAGE_TABLE.' msg '.
|
||
|
|
' LEFT JOIN '.TICKET_ATTACHMENT_TABLE." attach ON msg.ticket_id=attach.ticket_id AND msg.msg_id=attach.ref_id AND ref_type='M' ".
|
||
|
|
' WHERE msg.ticket_id='.db_input($id).
|
||
|
|
' GROUP BY msg.msg_id ORDER BY created';
|
||
|
|
$msgres =db_query($sql);
|
||
|
|
while ($msg_row = db_fetch_array($msgres)) {
|
||
|
|
?>
|
||
|
|
<table align="center" class="message" cellspacing="0" cellpadding="1" width="100%" border=0>
|
||
|
|
<tr><th><?=Format::db_daydatetime($msg_row['created'])?></th></tr>
|
||
|
|
<?if($msg_row['attachments']>0){ ?>
|
||
|
|
<tr class="header"><td><?=$ticket->getAttachmentStr($msg_row['msg_id'],'M')?></td></tr>
|
||
|
|
<?}?>
|
||
|
|
<tr><td><?=Format::display($msg_row['message'])?> </td></tr>
|
||
|
|
</table>
|
||
|
|
<?
|
||
|
|
//get answers for messages
|
||
|
|
$sql='SELECT resp.*,count(attach_id) as attachments FROM '.TICKET_RESPONSE_TABLE.' resp '.
|
||
|
|
' LEFT JOIN '.TICKET_ATTACHMENT_TABLE." attach ON resp.ticket_id=attach.ticket_id AND resp.response_id=attach.ref_id AND ref_type='R' ".
|
||
|
|
' WHERE msg_id='.db_input($msg_row['msg_id']).' AND resp.ticket_id='.db_input($id).
|
||
|
|
' GROUP BY resp.response_id ORDER BY created';
|
||
|
|
$resp =db_query($sql);
|
||
|
|
while ($resp_row = db_fetch_array($resp)) {
|
||
|
|
$respID=$resp_row['response_id'];
|
||
|
|
?>
|
||
|
|
<table align="center" class="response" cellspacing="0" cellpadding="1" width="100%" border=0>
|
||
|
|
<tr><th><?=Format::db_daydatetime($resp_row['created'])?> - <?=$resp_row['staff_name']?></th></tr>
|
||
|
|
<?if($resp_row['attachments']>0){ ?>
|
||
|
|
<tr class="header">
|
||
|
|
<td><?=$ticket->getAttachmentStr($respID,'R')?></td></tr>
|
||
|
|
<?}?>
|
||
|
|
<tr><td> <?=Format::display($resp_row['response'])?></td></tr>
|
||
|
|
</table>
|
||
|
|
<?}
|
||
|
|
$msgid =$msg_row['msg_id'];
|
||
|
|
}?>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<table align="center" cellspacing="0" cellpadding="3" width="90%" border=0>
|
||
|
|
<?if($_POST['a']!='process') {?>
|
||
|
|
<tr> <td align="center">
|
||
|
|
<?if($errors['err']) {?>
|
||
|
|
<p align="center" id="errormessage"><?=$errors['err']?></p>
|
||
|
|
<?}elseif($msg) {?>
|
||
|
|
<p align="center" id="infomessage"><?=$msg?></p>
|
||
|
|
<?}?>
|
||
|
|
</td></tr>
|
||
|
|
<?}?>
|
||
|
|
<tr> <td align="center">
|
||
|
|
<div class="tabber">
|
||
|
|
<div id="reply" class="tabbertab" align="left">
|
||
|
|
<h2>Antwort erstellen</h2>
|
||
|
|
<p>
|
||
|
|
<form action="tickets.php?id=<?=$id?>#reply" name="reply" id="replyform" method="post" enctype="multipart/form-data">
|
||
|
|
<input type="hidden" name="ticket_id" value="<?=$id?>">
|
||
|
|
<input type="hidden" name="msg_id" value="<?=$msgid?>">
|
||
|
|
<input type="hidden" name="a" value="reply">
|
||
|
|
<div><font class="error"> <?=$errors['response']?></font></div>
|
||
|
|
<div>
|
||
|
|
<?
|
||
|
|
$sql='SELECT premade_id,title FROM '.KB_PREMADE_TABLE.' WHERE isenabled=1 '.
|
||
|
|
' AND (dept_id=0 OR dept_id='.db_input($ticket->getDeptId()).')';
|
||
|
|
$canned=db_query($sql);
|
||
|
|
if($canned && db_num_rows($canned)) {
|
||
|
|
?>
|
||
|
|
Antwortvorlage:
|
||
|
|
<select id="canned" name="canned"
|
||
|
|
onChange="getCannedResponse(this.options[this.selectedIndex].value,this.form,'response');this.selectedIndex='0';" >
|
||
|
|
<option value="0" selected="selected">Fertige Antwort wählen</option>
|
||
|
|
<?while(list($cannedId,$title)=db_fetch_row($canned)) { ?>
|
||
|
|
<option value="<?=$cannedId?>" ><?=Format::htmlchars($title)?></option>
|
||
|
|
<?}?>
|
||
|
|
</select> <label><input type='checkbox' value='1' name=append checked="true" />Hinzufügen</label>
|
||
|
|
<?}?>
|
||
|
|
<textarea name="response" id="response" cols="90" rows="9" wrap="soft" style="width:90%"><?=$info['response']?></textarea>
|
||
|
|
</div>
|
||
|
|
<?php if($cfg->canUploadFiles()){ //TODO: may be allow anyways and simply email out attachment?? ?>
|
||
|
|
<div style="margin-top: 3px;">
|
||
|
|
<label for="attachment" >Dateianhang:</label>
|
||
|
|
<input type="file" name="attachment" id="attachment" size=30px value="<?=$info['attachment']?>" />
|
||
|
|
<font class="error"> <?=$errors['attachment']?></font>
|
||
|
|
</div>
|
||
|
|
<?php }?>
|
||
|
|
<?
|
||
|
|
$appendStaffSig=$thisuser->appendMySignature();
|
||
|
|
$appendDeptSig=$dept->canAppendSignature();
|
||
|
|
$info['signature']=!$info['signature']?'none':$info['signature']; //change 'none' to 'mine' to default to staff signature.
|
||
|
|
if($appendStaffSig || $appendDeptSig) { ?>
|
||
|
|
<div style="margin-top: 10px;">
|
||
|
|
<label for="signature" nowrap>Signatur hinzufügen:</label>
|
||
|
|
<label><input type="radio" name="signature" value="none" checked > Keine</label>
|
||
|
|
<?if($appendStaffSig) {?>
|
||
|
|
<label> <input type="radio" name="signature" value="mine" <?=$info['signature']=='mine'?'checked':''?> > Meine Signatur</label>
|
||
|
|
<?}?>
|
||
|
|
<?if($appendDeptSig) {?>
|
||
|
|
<label><input type="radio" name="signature" value="dept" <?=$info['signature']=='dept'?'checked':''?> > Abt.-Signatur</label>
|
||
|
|
<?}?>
|
||
|
|
</div>
|
||
|
|
<?}?>
|
||
|
|
<div style="margin-top: 3px;">
|
||
|
|
<b>Ticket Status:</b>
|
||
|
|
<?
|
||
|
|
$checked=isset($info['ticket_status'])?'checked':''; //Staff must explicitly check the box to change status..
|
||
|
|
if($ticket->isOpen()){?>
|
||
|
|
<label><input type="checkbox" name="ticket_status" id="l_ticket_status" value="Close" <?=$checked?> > Nach Antwort schließen</label>
|
||
|
|
<?}else{ ?>
|
||
|
|
<label><input type="checkbox" name="ticket_status" id="l_ticket_status" value="Reopen" <?=$checked?> > Nach Antwort wieder öffnen</label>
|
||
|
|
<?}?>
|
||
|
|
</div>
|
||
|
|
<p>
|
||
|
|
<div style="margin-left: 50px; margin-top: 30px; margin-bottom: 10px;border: 0px;">
|
||
|
|
<input class="button" type='submit' value='Antwort erstellen' />
|
||
|
|
<input class="button" type='reset' value='Zurücksenden' />
|
||
|
|
<input class="button" type='button' value='Abbrechen' onClick="history.go(-1)" />
|
||
|
|
</div>
|
||
|
|
</p>
|
||
|
|
</form>
|
||
|
|
</p>
|
||
|
|
</div>
|
||
|
|
<div id="notes" class="tabbertab" align="left">
|
||
|
|
<h2>Interne Notiz senden</h2>
|
||
|
|
<p>
|
||
|
|
<form action="tickets.php?id=<?=$id?>#notes" name="notes" class="inline" method="post" enctype="multipart/form-data">
|
||
|
|
<input type="hidden" name="ticket_id" value="<?=$id?>">
|
||
|
|
<input type="hidden" name="a" value="postnote">
|
||
|
|
<div>
|
||
|
|
<label for="title">Titel der Notiz:</label>
|
||
|
|
<input type="text" name="title" id="title" value="<?=$info['title']?>" size=30px />
|
||
|
|
</select><font class="error">* <?=$errors['title']?></font>
|
||
|
|
</div>
|
||
|
|
<div style="margin-top: 3px;">
|
||
|
|
<label for="note" valign="top">Notiz eingeben.
|
||
|
|
<font class="error">* <?=$errors['note']?></font></label><br/>
|
||
|
|
<textarea name="note" id="note" cols="80" rows="7" wrap="soft" style="width:90%"><?=$info['note']?></textarea>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<?
|
||
|
|
//When the ticket is assigned Allow assignee, admin or ANY dept manager to close it
|
||
|
|
if(!$ticket->isAssigned() || $thisuser->isadmin() || $thisuser->isManager() || $thisuser->getId()==$ticket->getStaffId()) {
|
||
|
|
?>
|
||
|
|
<div style="margin-top: 3px;">
|
||
|
|
<b>Ticket Status:</b>
|
||
|
|
<?
|
||
|
|
$checked=($info && isset($info['ticket_status']))?'checked':''; //not selected by default.
|
||
|
|
if($ticket->isOpen()){?>
|
||
|
|
<label><input type="checkbox" name="ticket_status" id="ticket_status" value="Close" <?=$checked?> > Ticket schließen</label>
|
||
|
|
<?}else{ ?>
|
||
|
|
<label><input type="checkbox" name="ticket_status" id="ticket_status" value="Reopen" <?=$checked?> > Ticket wieder öffnen</label>
|
||
|
|
<?}?>
|
||
|
|
</div>
|
||
|
|
<?}?>
|
||
|
|
<p>
|
||
|
|
<div align="left" style="margin-left: 50px;margin-top: 10px; margin-bottom: 10px;border: 0px;">
|
||
|
|
<input class="button" type='submit' value='Notiz senden' />
|
||
|
|
<input class="button" type='reset' value='Zurücksetzen' />
|
||
|
|
<input class="button" type='button' value='Abbrechen' onClick="history.go(-1)" />
|
||
|
|
</div>
|
||
|
|
</p>
|
||
|
|
</form>
|
||
|
|
</p>
|
||
|
|
</div>
|
||
|
|
<?
|
||
|
|
if($thisuser->canTransferTickets()) {
|
||
|
|
?>
|
||
|
|
<div id="transfer" class="tabbertab" align="left">
|
||
|
|
<h2>Verschieben zu and. Abteilung</h2>
|
||
|
|
<p>
|
||
|
|
|
||
|
|
<form action="tickets.php?id=<?=$id?>#transfer" name="notes" method="post" enctype="multipart/form-data">
|
||
|
|
<input type="hidden" name="ticket_id" value="<?=$id?>">
|
||
|
|
<input type="hidden" name="a" value="transfer">
|
||
|
|
<div>
|
||
|
|
<span for="dept_id">Abteilung:</span>
|
||
|
|
<select id="dept_id" name="dept_id">
|
||
|
|
<option value="" selected="selected">- Ziel-Abt. wählen -</option>
|
||
|
|
<?
|
||
|
|
$depts= db_query('SELECT dept_id,dept_name FROM '.DEPT_TABLE.' WHERE dept_id!='.db_input($ticket->getDeptId()));
|
||
|
|
while (list($deptId,$deptName) = db_fetch_row($depts)){
|
||
|
|
$selected = ($info['dept_id']==$deptId)?'selected':''; ?>
|
||
|
|
<option value="<?=$deptId?>"<?=$selected?>><?=$deptName?></option>
|
||
|
|
<?
|
||
|
|
}?>
|
||
|
|
</select><font class='error'> *<?=$errors['dept_id']?></font>
|
||
|
|
</div>
|
||
|
|
<div>
|
||
|
|
<span >Hinweise über den Transfer. (<i>Interne Notiz</i>)
|
||
|
|
<font class='error'> *<?=$errors['message']?></font></span>
|
||
|
|
<textarea name="message" id="message" cols="80" rows="7" wrap="soft" style="width:90%;"><?=$info['message']?></textarea>
|
||
|
|
</div>
|
||
|
|
<p>
|
||
|
|
<div style="margin-left: 50px; margin-top: 5px; margin-bottom: 10px;border: 0px;" align="left">
|
||
|
|
<input class="button" type='submit' value='Verschieben' />
|
||
|
|
<input class="button" type='reset' value='Zurücksetzen' />
|
||
|
|
<input class="button" type='button' value='Abbrechen' onClick="history.go(-1)" />
|
||
|
|
</div>
|
||
|
|
</p>
|
||
|
|
</form>
|
||
|
|
</p>
|
||
|
|
</div>
|
||
|
|
<?}?>
|
||
|
|
<?
|
||
|
|
//When the ticket is assigned Allow assignee, admin or ANY dept manager to reassign the ticket.
|
||
|
|
if(!$ticket->isAssigned() || $thisuser->isadmin() || $thisuser->isManager() || $thisuser->getId()==$ticket->getStaffId()) {
|
||
|
|
?>
|
||
|
|
<div id="assign" class="tabbertab" align="left">
|
||
|
|
|
||
|
|
<h2><?=$staff?'Neu zugewiesenes Ticket':'Zuweisen an Mitarbeiter'?></h2>
|
||
|
|
<p>
|
||
|
|
<form action="tickets.php?id=<?=$id?>#assign" name="notes" method="post" enctype="multipart/form-data">
|
||
|
|
<input type="hidden" name="ticket_id" value="<?=$id?>">
|
||
|
|
<input type="hidden" name="a" value="assign">
|
||
|
|
<div>
|
||
|
|
<span for="staffId">Mitarbeiter:</span>
|
||
|
|
<select id="staffId" name="staffId">
|
||
|
|
<option value="0" selected="selected">- Mitarbeiter wählen -</option>
|
||
|
|
<?
|
||
|
|
//TODO: make sure the user's group is also active....DO a join.
|
||
|
|
$sql=' SELECT staff_id,CONCAT_WS(", ",lastname,firstname) as name FROM '.STAFF_TABLE.
|
||
|
|
' WHERE isactive=1 AND onvacation=0 ';
|
||
|
|
if($ticket->isAssigned())
|
||
|
|
$sql.=' AND staff_id!='.db_input($ticket->getStaffId());
|
||
|
|
$depts= db_query($sql.' ORDER BY lastname,firstname ');
|
||
|
|
while (list($staffId,$staffName) = db_fetch_row($depts)){
|
||
|
|
|
||
|
|
$selected = ($info['staffId']==$staffId)?'selected':''; ?>
|
||
|
|
<option value="<?=$staffId?>"<?=$selected?>><?=$staffName?></option>
|
||
|
|
<?
|
||
|
|
}?>
|
||
|
|
</select><font class='error'> *<?=$errors['staffId']?></font>
|
||
|
|
</div>
|
||
|
|
<div>
|
||
|
|
<span >Kommentar an neuen Bearbeiter. (<i>Interne Notiz</i>)
|
||
|
|
<font class='error'> *<?=$errors['assign_message']?></font></span>
|
||
|
|
<textarea name="assign_message" id="assign_message" cols="80" rows="7"
|
||
|
|
wrap="soft" style="width:90%;"><?=$info['assign_message']?></textarea>
|
||
|
|
</div>
|
||
|
|
<p>
|
||
|
|
<div style="margin-left: 50px; margin-top: 5px; margin-bottom: 10px;border: 0px;" align="left">
|
||
|
|
<input class="button" type='submit' value='Zuweisen' />
|
||
|
|
<input class="button" type='reset' value='Zurücksetzen' />
|
||
|
|
<input class="button" type='button' value='Abbrechen' onClick="history.go(-1)" />
|
||
|
|
</div>
|
||
|
|
</p>
|
||
|
|
</form>
|
||
|
|
</p>
|
||
|
|
</div>
|
||
|
|
<?}?>
|
||
|
|
</div>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|