223 lines
10 KiB
PHP
223 lines
10 KiB
PHP
|
|
<?php
|
||
|
|
if(!defined('OSTSCPINC') || !is_object($thisuser) || !$thisuser->isStaff()) die('Zugriff verweigert');
|
||
|
|
$info=($_POST && $errors)?Format::input($_POST):array(); //on error...use the post data
|
||
|
|
?>
|
||
|
|
<div width="100%">
|
||
|
|
<?if($errors['err']) {?>
|
||
|
|
<p align="center" id="errormessage"><?=$errors['err']?></p>
|
||
|
|
<?}elseif($msg) {?>
|
||
|
|
<p align="center" class="infomessage"><?=$msg?></p>
|
||
|
|
<?}elseif($warn) {?>
|
||
|
|
<p class="warnmessage"><?=$warn?></p>
|
||
|
|
<?}?>
|
||
|
|
</div>
|
||
|
|
<table width="80%" border="0" cellspacing=1 cellpadding=2>
|
||
|
|
<form action="tickets.php" method="post" enctype="multipart/form-data">
|
||
|
|
<input type='hidden' name='a' value='open'>
|
||
|
|
<tr><td align="left" colspan=2>Bitte füllen Sie nachstehendes Formular sorgfältig aus, um ein Ticket zu eröffnen.</td></tr>
|
||
|
|
<tr>
|
||
|
|
<td align="left" nowrap width="20%"><b>Email-Adresse:</b></td>
|
||
|
|
<td>
|
||
|
|
<input type="text" id="email" name="email" size="25" value="<?=$info['email']?>">
|
||
|
|
<font class="error"><b>*</b> <?=$errors['email']?></font>
|
||
|
|
<? if($cfg->notifyONNewStaffTicket()) {?>
|
||
|
|
|
||
|
|
<input type="checkbox" name="alertuser" <?=(!$errors || $info['alertuser'])? 'checked': ''?>>Sende Meldung zu jeden.
|
||
|
|
<?}?>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<tr>
|
||
|
|
<td align="left" ><b>Vollständiger Name:</b></td>
|
||
|
|
<td>
|
||
|
|
<input type="text" id="name" name="name" size="25" value="<?=$info['name']?>">
|
||
|
|
<font class="error"><b>*</b> <?=$errors['name']?></font>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<tr>
|
||
|
|
<td align="left">Telefon:</td>
|
||
|
|
<td><input type="text" name="phone" size="25" value="<?=$info['phone']?>">
|
||
|
|
Durchwahl <input type="text" name="phone_ext" size="6" value="<?=$info['phone_ext']?>">
|
||
|
|
<font class="error"> <?=$errors['phone']?></font></td>
|
||
|
|
</tr>
|
||
|
|
<tr height=2px><td align="left" colspan=2 > </td></tr>
|
||
|
|
<tr>
|
||
|
|
<td align="left" ><b>Herkunft der Meldung:</b></td>
|
||
|
|
<td align=2>
|
||
|
|
<select name="source">
|
||
|
|
<option value="" selected >Quelle wählen</option>
|
||
|
|
<option value="Phone" <?=($info['source']=='Phone')?'selected':''?>>Telefon</option>
|
||
|
|
<option value="Email" <?=($info['source']=='Email')?'selected':''?>>Email</option>
|
||
|
|
<option value="Other" <?=($info['source']=='Other')?'selected':''?>>Sonstiges</option>
|
||
|
|
</select>
|
||
|
|
<font class="error"><b>*</b> <?=$errors['source']?></font>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<tr>
|
||
|
|
<td align="left"><b>Abteilung:</b></td>
|
||
|
|
<td>
|
||
|
|
<select name="deptId">
|
||
|
|
<option value="" selected >Abteilung wählen</option>
|
||
|
|
<?
|
||
|
|
$services= db_query('SELECT dept_id,dept_name FROM '.DEPT_TABLE.' ORDER BY dept_name');
|
||
|
|
while (list($deptId,$dept) = db_fetch_row($services)){
|
||
|
|
$selected = ($info['deptId']==$deptId)?'selected':''; ?>
|
||
|
|
<option value="<?=$deptId?>"<?=$selected?>><?=$dept?></option>
|
||
|
|
<?
|
||
|
|
}?>
|
||
|
|
</select>
|
||
|
|
<font class="error"><b>*</b> <?=$errors['deptId']?></font>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<tr>
|
||
|
|
<td align="left"><b>Betreff:</b></td>
|
||
|
|
<td>
|
||
|
|
<input type="text" name="subject" size="35" value="<?=$info['subject']?>">
|
||
|
|
<font class="error">* <?=$errors['subject']?></font>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<tr>
|
||
|
|
<td align="left" valign="top"><b>Antwort:</b></td>
|
||
|
|
<td>
|
||
|
|
<i>Sichtbar für Kunde/Nutzer.</i><font class="error"><b>* <?=$errors['issue']?></b></font><br/>
|
||
|
|
<?
|
||
|
|
$sql='SELECT premade_id,title FROM '.KB_PREMADE_TABLE.' WHERE isenabled=1';
|
||
|
|
$canned=db_query($sql);
|
||
|
|
if($canned && db_num_rows($canned)) {
|
||
|
|
?>
|
||
|
|
Vorlage:
|
||
|
|
<select id="canned" name="canned"
|
||
|
|
onChange="getCannedResponse(this.options[this.selectedIndex].value,this.form,'issue');this.selectedIndex='0';" >
|
||
|
|
<option value="0" selected="selected">Antwort/Thema auswä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="issue" cols="55" rows="8" wrap="soft"><?=$info['issue']?></textarea></td>
|
||
|
|
</tr>
|
||
|
|
<?if($cfg->canUploadFiles()) {
|
||
|
|
?>
|
||
|
|
<tr>
|
||
|
|
<td>Anhang:</td>
|
||
|
|
<td>
|
||
|
|
<input type="file" name="attachment"><font class="error"> <?=$errors['attachment']?></font>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<?}?>
|
||
|
|
<tr>
|
||
|
|
<td align="left" valign="top">Interne Notiz:</td>
|
||
|
|
<td>
|
||
|
|
<i>Optionale interne Notiz(en).</i><font class="error"><b> <?=$errors['note']?></b></font><br/>
|
||
|
|
<textarea name="note" cols="55" rows="5" wrap="soft"><?=$info['note']?></textarea></td>
|
||
|
|
</tr>
|
||
|
|
|
||
|
|
<tr>
|
||
|
|
<td align="left" valign="top">Fälligkeitsdatum:</td>
|
||
|
|
<td>
|
||
|
|
<i>Zeit basiert auf Ihre Zeitzone (GM <?=$thisuser->getTZoffset()?>)</i> <font class="error"> <?=$errors['time']?></font><br>
|
||
|
|
<input id="duedate" name="duedate" value="<?=Format::htmlchars($info['duedate'])?>"
|
||
|
|
onclick="event.cancelBubble=true;calendar(this);" autocomplete=OFF>
|
||
|
|
<a href="#" onclick="event.cancelBubble=true;calendar(getObj('duedate')); return false;"><img src='images/cal.png'border=0 alt=""></a>
|
||
|
|
|
||
|
|
<?php
|
||
|
|
$min=$hr=null;
|
||
|
|
if($info['time'])
|
||
|
|
list($hr,$min)=explode(':',$info['time']);
|
||
|
|
echo Misc::timeDropdown($hr,$min,'time');
|
||
|
|
?>
|
||
|
|
<font class="error"> <?=$errors['duedate']?></font>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<?
|
||
|
|
$sql='SELECT priority_id,priority_desc FROM '.TICKET_PRIORITY_TABLE.' ORDER BY priority_urgency DESC';
|
||
|
|
if(($priorities=db_query($sql)) && db_num_rows($priorities)){ ?>
|
||
|
|
<tr>
|
||
|
|
<td align="left">Priorität:</td>
|
||
|
|
<td>
|
||
|
|
<select name="pri">
|
||
|
|
<?
|
||
|
|
$info['pri']=$info['pri']?$info['pri']:$cfg->getDefaultPriorityId();
|
||
|
|
while($row=db_fetch_array($priorities)){ ?>
|
||
|
|
<option value="<?=$row['priority_id']?>" <?=$info['pri']==$row['priority_id']?'selected':''?> ><?=$row['priority_desc']?></option>
|
||
|
|
<?}?>
|
||
|
|
</select>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<? }?>
|
||
|
|
<?php
|
||
|
|
$services= db_query('SELECT topic_id,topic FROM '.TOPIC_TABLE.' WHERE isactive=1 ORDER BY topic');
|
||
|
|
if($services && db_num_rows($services)){ ?>
|
||
|
|
<tr>
|
||
|
|
<td align="left" valign="top">Thema:</td>
|
||
|
|
<td>
|
||
|
|
<select name="topicId">
|
||
|
|
<option value="" selected >Auswählen</option>
|
||
|
|
<?
|
||
|
|
while (list($topicId,$topic) = db_fetch_row($services)){
|
||
|
|
$selected = ($info['topicId']==$topicId)?'selected':''; ?>
|
||
|
|
<option value="<?=$topicId?>"<?=$selected?>><?=$topic?></option>
|
||
|
|
<?
|
||
|
|
}?>
|
||
|
|
</select>
|
||
|
|
<font class="error"> <?=$errors['topicId']?></font>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<?
|
||
|
|
}?>
|
||
|
|
<tr>
|
||
|
|
<td>Zuweisen:</td>
|
||
|
|
<td>
|
||
|
|
<select id="staffId" name="staffId">
|
||
|
|
<option value="0" selected="selected">-Zuweisung an-</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 ';
|
||
|
|
$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>
|
||
|
|
|
||
|
|
<input type="checkbox" name="alertstaff" <?=(!$errors || $info['alertstaff'])? 'checked': ''?>>Sende Meldung an zugewiesenes Personal.
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<tr>
|
||
|
|
<td>Signatur:</td>
|
||
|
|
<td> <?php
|
||
|
|
$appendStaffSig=$thisuser->appendMySignature();
|
||
|
|
$info['signature']=!$info['signature']?'none':$info['signature']; //change 'none' to 'mine' to default to staff signature.
|
||
|
|
?>
|
||
|
|
<div style="margin-top: 2px;">
|
||
|
|
<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>
|
||
|
|
<?}?>
|
||
|
|
<label><input type="radio" name="signature" value="dept" <?=$info['signature']=='dept'?'checked':''?> > Abt. Signatur (falls vorhanden)</label>
|
||
|
|
</div>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<tr height=2px><td align="left" colspan=2 > </td</tr>
|
||
|
|
<tr>
|
||
|
|
<td></td>
|
||
|
|
<td>
|
||
|
|
<input class="button" type="submit" name="submit_x" value="Sende Ticket">
|
||
|
|
<input class="button" type="reset" value="Zurücksetzen">
|
||
|
|
<input class="button" type="button" name="Abbrechen" value="Abbrechen" onClick='window.location.href="tickets.php"'>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</form>
|
||
|
|
</table>
|
||
|
|
<script type="text/javascript">
|
||
|
|
|
||
|
|
var options = {
|
||
|
|
script:"ajax.php?api=tickets&f=searchbyemail&limit=10&",
|
||
|
|
varname:"input",
|
||
|
|
json: true,
|
||
|
|
shownoresults:false,
|
||
|
|
maxresults:10,
|
||
|
|
callback: function (obj) { document.getElementById('email').value = obj.id; document.getElementById('name').value = obj.info; return false;}
|
||
|
|
};
|
||
|
|
var autosug = new bsn.AutoSuggest('email', options);
|
||
|
|
</script>
|