help.verua.ch/include/staff/staff.inc.php

156 lines
7.2 KiB
PHP
Raw Permalink Normal View History

2026-01-05 08:46:20 +01:00
<?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&uuml;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']?>">
&nbsp;<font class="error">*&nbsp;<?=$errors['username']?></font></td>
</tr>
<tr>
<th>Abteilung:</th>
<td>
<select name="dept_id">
<option value=0>Abteilung ausw&auml;hlen</option>
<?
while (list($id,$name) = db_fetch_row($depts)){
$selected = ($rep['dept_id']==$id)?'selected':''; ?>
<option value="<?=$id?>"<?=$selected?>>Abteilung <?=$name?></option>
<?
}?>
</select>&nbsp;<font class="error">*&nbsp;<?=$errors['dept']?></font>
</td>
</tr>
<tr>
<th>Nutzergruppe:</th>
<td>
<select name="group_id">
<option value=0>Gruppe w&auml;hlen</option>
<?
while (list($id,$name) = db_fetch_row($groups)){
$selected = ($rep['group_id']==$id)?'selected':''; ?>
<option value="<?=$id?>"<?=$selected?>><?=$name?></option>
<?
}?>
</select>&nbsp;<font class="error">*&nbsp;<?=$errors['group']?></font>
</td>
</tr>
<tr>
<th>Name (Vor-, Nachname):</th>
<td>
<input type="text" name="firstname" value="<?=$rep['firstname']?>">&nbsp;<font class="error">*</font>
&nbsp;&nbsp;&nbsp;<input type="text" name="lastname" value="<?=$rep['lastname']?>">
&nbsp;<font class="error">*&nbsp;<?=$errors['name']?></font></td>
</tr>
<tr>
<th>Email-Adresse:</th>
<td><input type="text" name="email" size=25 value="<?=$rep['email']?>">
&nbsp;<font class="error">*&nbsp;<?=$errors['email']?></font></td>
</tr>
<tr>
<th>Dienstl. Telefon:</th>
<td>
<input type="text" name="phone" value="<?=$rep['phone']?>" >&nbsp;Durchwahl&nbsp;
<input type="text" name="phone_ext" size=6 value="<?=$rep['phone_ext']?>" >
&nbsp;<font class="error">&nbsp;<?=$errors['phone']?></font></td>
</tr>
<tr>
<th>Mobiltelefon:</th>
<td>
<input type="text" name="mobile" value="<?=$rep['mobile']?>" >
&nbsp;<font class="error">&nbsp;<?=$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>&nbsp;&nbsp;&nbsp;<font class="error">&nbsp;<?=$errors['npassword']?></font> <br/>
<input type="password" name="npassword" AUTOCOMPLETE=OFF >&nbsp;
</td>
</tr>
<tr>
<th>Passwort (Wiederholung):</th>
<td class="mainTableAlt"><input type="password" name="vpassword" AUTOCOMPLETE=OFF >
&nbsp;<font class="error">&nbsp;<?=$errors['vpassword']?></font></td>
</tr>
<tr>
<th>Zwingende Passwort&auml;nderung:</th>
<td>
<input type="checkbox" name="resetpasswd" <?=$rep['resetpasswd'] ? 'checked': ''?>>Erfordert bei der n&auml;chsten Anmelung die &Auml;nderung des Passwortes</td>
</tr>
<tr class="header"><td colspan=2>Kontorechte, Status &amp; Einstellungen</td></tr>
<tr class="subheader"><td colspan=2>
Die Rechte des Mitarbeiters basieren auf die Rechte der Gruppe. <b>F&uuml;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>
&nbsp;&nbsp;
</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>
&nbsp;&nbsp;
</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>)
&nbsp;<font class="error">&nbsp;<?=$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&auml;tigen">
<input class="button" type="reset" name="reset" value="Zur&uuml;cksetzen">
<input class="button" type="button" name="cancel" value="Abbrechen" onClick='window.location.href="admin.php?t=staff"'>
</td></tr>
</form>
</table>