156 lines
7.2 KiB
PHP
156 lines
7.2 KiB
PHP
<?php
|
|
if(!defined('OSTADMININC') || !$thisuser->isadmin()) die('Zugriff verweigert');
|
|
|
|
$rep=null;
|
|
$newuser=true;
|
|
if($staff && $_REQUEST['a']!='new'){
|
|
$rep=$staff->getInfo();
|
|
$title='Aktualisieren: '.$rep['firstname'].' '.$rep['lastname'];
|
|
$action='update';
|
|
$pwdinfo='Um das Passwort zurück zu setzen geben Sie nachfolgend ein neues ein';
|
|
$newuser=false;
|
|
}else {
|
|
$title='Neuer Mitarbeiter';
|
|
$pwdinfo='Temp. Passwort erforderlich';
|
|
$action='create';
|
|
$rep['resetpasswd']=isset($rep['resetpasswd'])?$rep['resetpasswd']:1;
|
|
$rep['isactive']=isset($rep['isactive'])?$rep['isactive']:1;
|
|
$rep['dept_id']=$rep['dept_id']?$rep['dept_id']:$_GET['dept'];
|
|
$rep['isvisible']=isset($rep['isvisible'])?$rep['isvisible']:1;
|
|
}
|
|
$rep=($errors && $_POST)?Format::input($_POST):Format::htmlchars($rep);
|
|
|
|
//get the goodies.
|
|
$groups=db_query('SELECT group_id,group_name FROM '.GROUP_TABLE);
|
|
$depts= db_query('SELECT dept_id,dept_name FROM '.DEPT_TABLE);
|
|
|
|
?>
|
|
<div class="msg"><?=$title?></div>
|
|
<table width="100%" border="0" cellspacing=0 cellpadding=0>
|
|
<form action="admin.php" method="post">
|
|
<input type="hidden" name="do" value="<?=$action?>">
|
|
<input type="hidden" name="a" value="<?=Format::htmlchars($_REQUEST['a'])?>">
|
|
<input type="hidden" name="t" value="staff">
|
|
<input type="hidden" name="staff_id" value="<?=$rep['staff_id']?>">
|
|
<tr><td>
|
|
<table width="100%" border="0" cellspacing=0 cellpadding=2 class="tform">
|
|
<tr class="header"><td colspan=2>Nutzerkonto</td></tr>
|
|
<tr class="subheader"><td colspan=2>Kontoinformationen</td></tr>
|
|
<tr>
|
|
<th>Nutzername:</th>
|
|
<td><input type="text" name="username" value="<?=$rep['username']?>">
|
|
<font class="error">* <?=$errors['username']?></font></td>
|
|
</tr>
|
|
<tr>
|
|
<th>Abteilung:</th>
|
|
<td>
|
|
<select name="dept_id">
|
|
<option value=0>Abteilung auswählen</option>
|
|
<?
|
|
while (list($id,$name) = db_fetch_row($depts)){
|
|
$selected = ($rep['dept_id']==$id)?'selected':''; ?>
|
|
<option value="<?=$id?>"<?=$selected?>>Abteilung <?=$name?></option>
|
|
<?
|
|
}?>
|
|
</select> <font class="error">* <?=$errors['dept']?></font>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Nutzergruppe:</th>
|
|
<td>
|
|
<select name="group_id">
|
|
<option value=0>Gruppe wählen</option>
|
|
<?
|
|
while (list($id,$name) = db_fetch_row($groups)){
|
|
$selected = ($rep['group_id']==$id)?'selected':''; ?>
|
|
<option value="<?=$id?>"<?=$selected?>><?=$name?></option>
|
|
<?
|
|
}?>
|
|
</select> <font class="error">* <?=$errors['group']?></font>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Name (Vor-, Nachname):</th>
|
|
<td>
|
|
<input type="text" name="firstname" value="<?=$rep['firstname']?>"> <font class="error">*</font>
|
|
<input type="text" name="lastname" value="<?=$rep['lastname']?>">
|
|
<font class="error">* <?=$errors['name']?></font></td>
|
|
</tr>
|
|
<tr>
|
|
<th>Email-Adresse:</th>
|
|
<td><input type="text" name="email" size=25 value="<?=$rep['email']?>">
|
|
<font class="error">* <?=$errors['email']?></font></td>
|
|
</tr>
|
|
<tr>
|
|
<th>Dienstl. Telefon:</th>
|
|
<td>
|
|
<input type="text" name="phone" value="<?=$rep['phone']?>" > Durchwahl
|
|
<input type="text" name="phone_ext" size=6 value="<?=$rep['phone_ext']?>" >
|
|
<font class="error"> <?=$errors['phone']?></font></td>
|
|
</tr>
|
|
<tr>
|
|
<th>Mobiltelefon:</th>
|
|
<td>
|
|
<input type="text" name="mobile" value="<?=$rep['mobile']?>" >
|
|
<font class="error"> <?=$errors['mobile']?></font></td>
|
|
</tr>
|
|
<tr>
|
|
<th valign="top">Signatur:</th>
|
|
<td><textarea name="signature" cols="21" rows="5" style="width: 60%;"><?=$rep['signature']?></textarea></td>
|
|
</tr>
|
|
<tr>
|
|
<th>Passwort:</th>
|
|
<td>
|
|
<i><?=$pwdinfo?></i> <font class="error"> <?=$errors['npassword']?></font> <br/>
|
|
<input type="password" name="npassword" AUTOCOMPLETE=OFF >
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Passwort (Wiederholung):</th>
|
|
<td class="mainTableAlt"><input type="password" name="vpassword" AUTOCOMPLETE=OFF >
|
|
<font class="error"> <?=$errors['vpassword']?></font></td>
|
|
</tr>
|
|
<tr>
|
|
<th>Zwingende Passwortänderung:</th>
|
|
<td>
|
|
<input type="checkbox" name="resetpasswd" <?=$rep['resetpasswd'] ? 'checked': ''?>>Erfordert bei der nächsten Anmelung die Änderung des Passwortes</td>
|
|
</tr>
|
|
<tr class="header"><td colspan=2>Kontorechte, Status & Einstellungen</td></tr>
|
|
<tr class="subheader"><td colspan=2>
|
|
Die Rechte des Mitarbeiters basieren auf die Rechte der Gruppe. <b>Für Administratoren greifen keine Gruppenrechte.</b></td>
|
|
</tr>
|
|
<tr><th><b>Kontostatus</b></th>
|
|
<td>
|
|
<input type="radio" name="isactive" value="1" <?=$rep['isactive']?'checked':''?> /><b>Aktiv</b>
|
|
<input type="radio" name="isactive" value="0" <?=!$rep['isactive']?'checked':''?> /><b>Gesperrt</b>
|
|
|
|
</td>
|
|
</tr>
|
|
<tr><th><b>Kontotyp</b></th>
|
|
<td class="mainTableAlt">
|
|
<input type="radio" name="isadmin" value="1" <?=$rep['isadmin']?'checked':''?> /><font color="red"><b>Admin</b></font>
|
|
<input type="radio" name="isadmin" value="0" <?=!$rep['isadmin']?'checked':''?> /><b>Mitarbeiter</b>
|
|
|
|
</td>
|
|
</tr>
|
|
<tr><th>Verzeichnislistung</th>
|
|
<td>
|
|
<input type="checkbox" name="isvisible" <?=$rep['isvisible'] ? 'checked': ''?>>Zeigt den Mitarbeiter in Mitarbeiterverzeichnis
|
|
</td>
|
|
</tr>
|
|
<tr><th>Abwesenheitsassistent</th>
|
|
<td class="mainTableAlt">
|
|
<input type="checkbox" name="onvacation" <?=$rep['onvacation'] ? 'checked': ''?>>
|
|
Mitarbeiter ist abwesend / im Urlaub. (<i>Keine Ticketzuweisung oder Hinweis</i>)
|
|
<font class="error"> <?=$errors['vacation']?></font>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</td></tr>
|
|
<tr><td style="padding:5px 0 10px 210px;">
|
|
<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=staff"'>
|
|
</td></tr>
|
|
</form>
|
|
</table>
|