161 lines
8.3 KiB
PHP
161 lines
8.3 KiB
PHP
<?php
|
|
if(!defined('OSTADMININC') || !$thisuser->isadmin()) die('Zugriff verweigert');
|
|
$info=null;
|
|
if($dept && $_REQUEST['a']!='new'){
|
|
//Editing Department.
|
|
$title='Abteilung aktualisieren';
|
|
$action='update';
|
|
$info=$dept->getInfo();
|
|
}else {
|
|
$title='Neue Abteilung';
|
|
$action='create';
|
|
$info['ispublic']=isset($info['ispublic'])?$info['ispublic']:1;
|
|
$info['ticket_auto_response']=isset($info['ticket_auto_response'])?$info['ticket_auto_response']:1;
|
|
$info['message_auto_response']=isset($info['message_auto_response'])?$info['message_auto_response']:1;
|
|
}
|
|
$info=($errors && $_POST)?Format::input($_POST):Format::htmlchars($info);
|
|
|
|
?>
|
|
<div class="msg"><?=$title?></div>
|
|
<table width="100%" border="0" cellspacing=0 cellpadding=0>
|
|
<form action="admin.php?t=dept&id=<?=$info['dept_id']?>" method="POST" name="dept">
|
|
<input type="hidden" name="do" value="<?=$action?>">
|
|
<input type="hidden" name="a" value="<?=Format::htmlchars($_REQUEST['a'])?>">
|
|
<input type="hidden" name="t" value="dept">
|
|
<input type="hidden" name="dept_id" value="<?=$info['dept_id']?>">
|
|
<tr><td>
|
|
<table width="100%" border="0" cellspacing=0 cellpadding=2 class="tform">
|
|
<tr class="header"><td colspan=2>Abteilung</td></tr>
|
|
<tr class="subheader"><td colspan=2 >Abteilung hängt mit E-Mail- & Hilfethemen-Einstellungen für eingehende Tickets zusammen.</td></tr>
|
|
<tr><th>Abteilungsname:</th>
|
|
<td><input type="text" name="dept_name" size=25 value="<?=$info['dept_name']?>">
|
|
<font class="error">* <?=$errors['dept_name']?></font>
|
|
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Abteilungsmail:</th>
|
|
<td>
|
|
<select name="email_id">
|
|
<option value="">Bitte wählen</option>
|
|
<?
|
|
$emails=db_query('SELECT email_id,email,name,smtp_active FROM '.EMAIL_TABLE);
|
|
while (list($id,$email,$name,$smtp) = db_fetch_row($emails)){
|
|
$email=$name?"$name <$email>":$email;
|
|
if($smtp)
|
|
$email.=' (SMTP)';
|
|
?>
|
|
<option value="<?=$id?>"<?=($info['email_id']==$id)?'selected':''?>><?=$email?></option>
|
|
<?
|
|
}?>
|
|
</select>
|
|
<font class="error">* <?=$errors['email_id']?></font> (abgehende Email)
|
|
</td>
|
|
</tr>
|
|
<? if($info['dept_id']) { //update
|
|
$users= db_query('SELECT staff_id,CONCAT_WS(" ",firstname,lastname) as name FROM '.STAFF_TABLE.' WHERE dept_id='.db_input($info['dept_id']));
|
|
?>
|
|
<tr>
|
|
<th>Abteilungsleiter:</th>
|
|
<td>
|
|
<?if($users && db_num_rows($users)) {?>
|
|
<select name="manager_id">
|
|
<option value=0 >-------Keine-------</option>
|
|
<option value=0 disabled >Abteilungsleiter wählen (optional)</option>
|
|
<?
|
|
while (list($id,$name) = db_fetch_row($users)){ ?>
|
|
<option value="<?=$id?>"<?=($info['manager_id']==$id)?'selected':''?>><?=$name?></option>
|
|
<?}?>
|
|
|
|
</select>
|
|
<?}else {?>
|
|
Keine Nutzer (Nutzer hinzufügen)
|
|
<input type="hidden" name="manager_id" value="0" />
|
|
<?}?>
|
|
<font class="error"> <?=$errors['manager_id']?></font>
|
|
</td>
|
|
</tr>
|
|
<?}?>
|
|
<tr><th>Abteilungstyp</th>
|
|
<td>
|
|
<input type="radio" name="ispublic" value="1" <?=$info['ispublic']?'checked':''?> />Sichtbar
|
|
<input type="radio" name="ispublic" value="0" <?=!$info['ispublic']?'checked':''?> />Verborgen
|
|
<font class="error"><?=$errors['ispublic']?></font>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th valign="top"><br/>Abteilungssignatur:</th>
|
|
<td>
|
|
<i>Erforderlich wenn Abteilung sichtbar ist</i> <font class="error"><?=$errors['dept_signature']?></font><br/>
|
|
<textarea name="dept_signature" cols="21" rows="5" style="width: 60%;"><?=$info['dept_signature']?></textarea>
|
|
<br>
|
|
<input type="checkbox" name="can_append_signature" <?=$info['can_append_signature'] ?'checked':''?> >
|
|
kann an Antworten angehängt werden. (verfügbar bei sichtbaren Abteilungen)
|
|
</td>
|
|
</tr>
|
|
<tr><th>Email Vorlagen:</th>
|
|
<td>
|
|
<select name="tpl_id">
|
|
<option value=0 disabled>Vorlage wählen</option>
|
|
<option value="0" selected="selected">System-Standard</option>
|
|
<?
|
|
$templates=db_query('SELECT tpl_id,name FROM '.EMAIL_TEMPLATE_TABLE.' WHERE tpl_id!='.db_input($cfg->getDefaultTemplateId()));
|
|
while (list($id,$name) = db_fetch_row($templates)){
|
|
$selected = ($info['tpl_id']==$id)?'SELECTED':''; ?>
|
|
<option value="<?=$id?>"<?=$selected?>><?=Format::htmlchars($name)?></option>
|
|
<?
|
|
}?>
|
|
</select><font class="error"> <?=$errors['tpl_id']?></font><br/>
|
|
<i>Wird für ausgehende E-Mails, Alarme und Notizen zum Kunden und Mitarbeiter verwendet.</i>
|
|
</td>
|
|
</tr>
|
|
<tr class="header"><td colspan=2>Automatische Antwort</td></tr>
|
|
<tr class="subheader"><td colspan=2>
|
|
Globale Auto-Antwort Einstellung den Vorzug Abschnitt muss für Abteilung "Aktiviert"-Einstellung wirksam wird aktiviert werden<br>
|
|
Global auto-response settings in preference section must be enabled for Dept 'Enable' setting to take effect.
|
|
</td>
|
|
</tr>
|
|
<tr><th>Neues Ticket:</th>
|
|
<td>
|
|
<input type="radio" name="ticket_auto_response" value="1" <?=$info['ticket_auto_response']?'checked':''?> />Aktiviert
|
|
<input type="radio" name="ticket_auto_response" value="0" <?=!$info['ticket_auto_response']?'checked':''?> />Deaktiviert
|
|
</td>
|
|
</tr>
|
|
<tr><th>Neue Nachricht:</th>
|
|
<td>
|
|
<input type="radio" name="message_auto_response" value="1" <?=$info['message_auto_response']?'checked':''?> />Aktiviert
|
|
<input type="radio" name="message_auto_response" value="0" <?=!$info['message_auto_response']?'checked':''?> />Deaktiviert
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Auto-Antwort Email:</th>
|
|
<td>
|
|
<select name="autoresp_email_id">
|
|
<option value="0" disabled>Bitte wählen</option>
|
|
<option value="0" selected="selected">Abteilungsmail (wie oben)</option>
|
|
<?
|
|
$emails=db_query('SELECT email_id,email,name,smtp_active FROM '.EMAIL_TABLE.' WHERE email_id!='.db_input($info['email_id']));
|
|
if($emails && db_num_rows($emails)) {
|
|
while (list($id,$email,$name,$smtp) = db_fetch_row($emails)){
|
|
$email=$name?"$name <$email>":$email;
|
|
if($smtp)
|
|
$email.=' (SMTP)';
|
|
?>
|
|
<option value="<?=$id?>"<?=($info['autoresp_email_id']==$id)?'selected':''?>><?=$email?></option>
|
|
<?
|
|
}
|
|
}?>
|
|
</select>
|
|
<font class="error"> <?=$errors['autoresp_email_id']?></font> <br/>
|
|
<i>Emailaddesse wird benutzt um Automatische Anworten zu senden, falls aktiviert.</i>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</td></tr>
|
|
<tr><td style="padding:10px 0 10px 200px;">
|
|
<input class="button" type="submit" name="submit" value="Bestätigen">
|
|
<input class="button" type="reset" name="reset" value="Zurücksetzen">
|
|
<input class="button" type="button" name="cancel" value="Abbrechen" onClick='window.location.href="admin.php?t=dept"'>
|
|
</td></tr>
|
|
</form>
|
|
</table>
|