Newer
Older
<?php
if(!defined('OSTSTAFFINC') || !$staff || !$thisstaff) die('Access Denied');
$info=$staff->getInfo();
$info['signature'] = Format::viewableImages($info['signature']);
$info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
$info['id']=$staff->getId();
?>
<form action="profile.php" method="post" id="save" autocomplete="off">
<input type="hidden" name="do" value="update">
<input type="hidden" name="id" value="<?php echo $info['id']; ?>">
<h2>My Account Profile</h2>
<table class="form_table" width="940" border="0" cellspacing="0" cellpadding="2">
<thead>
<tr>
<th colspan="2">
<h4>Account Information</h4>
<em>Contact information.</em>
</th>
</tr>
</thead>
<tbody>
<tr>
<td width="180" class="required">
Username:
</td>
<td><b><?php echo $staff->getUserName(); ?></b> <i class="help-tip icon-question-sign" href="#username"></i></td>
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
</tr>
<tr>
<td width="180" class="required">
First Name:
</td>
<td>
<input type="text" size="34" name="firstname" value="<?php echo $info['firstname']; ?>">
<span class="error">* <?php echo $errors['firstname']; ?></span>
</td>
</tr>
<tr>
<td width="180" class="required">
Last Name:
</td>
<td>
<input type="text" size="34" name="lastname" value="<?php echo $info['lastname']; ?>">
<span class="error">* <?php echo $errors['lastname']; ?></span>
</td>
</tr>
<tr>
<td width="180" class="required">
Email Address:
</td>
<td>
<input type="text" size="34" name="email" value="<?php echo $info['email']; ?>">
<span class="error">* <?php echo $errors['email']; ?></span>
</td>
</tr>
<tr>
<td width="180">
Phone Number:
</td>
<td>
<input type="text" size="22" name="phone" value="<?php echo $info['phone']; ?>">
<span class="error"> <?php echo $errors['phone']; ?></span>
Ext <input type="text" size="5" name="phone_ext" value="<?php echo $info['phone_ext']; ?>">
<span class="error"> <?php echo $errors['phone_ext']; ?></span>
</td>
</tr>
<tr>
<td width="180">
Mobile Number:
</td>
<td>
<input type="text" size="22" name="mobile" value="<?php echo $info['mobile']; ?>">
<span class="error"> <?php echo $errors['mobile']; ?></span>
</td>
</tr>
<tr>
<th colspan="2">
<em><strong>Preferences</strong>: Profile preferences and settings.</em>
</th>
</tr>
<tr>
<td width="180" class="required">
Time Zone:
</td>
<td>
<select name="timezone_id" id="timezone_id">
<option value="0">— Select Time Zone —</option>
<?php
$sql='SELECT id, offset,timezone FROM '.TIMEZONE_TABLE.' ORDER BY id';
if(($res=db_query($sql)) && db_num_rows($res)){
while(list($id,$offset, $tz)=db_fetch_row($res)){
$sel=($info['timezone_id']==$id)?'selected="selected"':'';
echo sprintf('<option value="%d" %s>GMT %s - %s</option>',$id,$sel,$offset,$tz);
}
}
?>
</select>
<span class="error">* <?php echo $errors['timezone_id']; ?></span>
</td>
</tr>
<tr>
<td width="180">
Preferred Language:
</td>
<td>
<?php
$langs = Internationalization::availableLanguages(); ?>
<select name="lang">
<option value="">— Use Browser Preference —</option>
<?php foreach($langs as $l) {
$selected = ($info['lang'] == $l['code']) ? 'selected="selected"' : ''; ?>
<option value="<?php echo $l['code']; ?>" <?php echo $selected;
?>><?php echo $l['desc']; ?></option>
<?php } ?>
</select>
<span class="error"> <?php echo $errors['lang']; ?></span>
</td>
</tr>
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<tr>
<td width="180">
Daylight Saving:
</td>
<td>
<input type="checkbox" name="daylight_saving" value="1" <?php echo $info['daylight_saving']?'checked="checked"':''; ?>>
Observe daylight saving
<em>(Current Time: <strong><?php echo Format::date($cfg->getDateTimeFormat(),Misc::gmtime(),$info['tz_offset'],$info['daylight_saving']); ?></strong>)</em>
</td>
</tr>
<tr>
<td width="180">Maximum Page size:</td>
<td>
<select name="max_page_size">
<option value="0">— system default —</option>
<?php
$pagelimit=$info['max_page_size']?$info['max_page_size']:$cfg->getPageSize();
for ($i = 5; $i <= 50; $i += 5) {
$sel=($pagelimit==$i)?'selected="selected"':'';
echo sprintf('<option value="%d" %s>show %s records</option>',$i,$sel,$i);
} ?>
</select> per page.
</td>
</tr>
<tr>
<td width="180">Auto Refresh Rate:</td>
<td>
<select name="auto_refresh_rate">
<option value="0">— disable —</option>
<?php
$y=1;
for($i=1; $i <=30; $i+=$y) {
$sel=($info['auto_refresh_rate']==$i)?'selected="selected"':'';
echo sprintf('<option value="%d" %s>Every %s %s</option>',$i,$sel,$i,($i>1?'mins':'min'));
if($i>9)
$y=2;
} ?>
</select>
<em>(Tickets page refresh rate in minutes.)</em>
</td>
</tr>
<tr>
<td width="180">Default Signature:</td>
<td>
<select name="default_signature_type">
<option value="none" selected="selected">— None —</option>
<?php
$options=array('mine'=>'My Signature','dept'=>'Dept. Signature (if set)');
foreach($options as $k=>$v) {
echo sprintf('<option value="%s" %s>%s</option>',
$k,($info['default_signature_type']==$k)?'selected="selected"':'',$v);
}
?>
</select>
<em>(You can change selection on ticket page)</em>
<span class="error"> <?php echo $errors['default_signature_type']; ?></span>
</td>
</tr>
<tr>
<td width="180">Default Paper Size:</td>
<td>
<select name="default_paper_size">
<option value="none" selected="selected">— None —</option>
<?php
$options=array('Letter', 'Legal', 'A4', 'A3');
foreach($options as $v) {
echo sprintf('<option value="%s" %s>%s</option>',
$v,($info['default_paper_size']==$v)?'selected="selected"':'',$v);
}
?>
</select>
<em>Paper size used when printing tickets to PDF</em>
<span class="error"> <?php echo $errors['default_paper_size']; ?></span>
</td>
</tr>
<tr>
<td>Show Assigned Tickets:</td>
<td>
<input type="checkbox" name="show_assigned_tickets" <?php echo $info['show_assigned_tickets']?'checked="checked"':''; ?>>
<em>Show assigned tickets on open queue. <i class="help-tip icon-question-sign" href="#show_assigned_tickets"></i></em>
</td>
</tr>
<tr>
<th colspan="2">
<em><strong>Password</strong>: To reset your password, provide your current password and a new password below. <span class="error"> <?php echo $errors['passwd']; ?></span></em>
</th>
</tr>
<?php if (!isset($_SESSION['_staff']['reset-token'])) { ?>
<tr>
<td width="180">
Current Password:
</td>
<td>
<input type="password" size="18" name="cpasswd" value="<?php echo $info['cpasswd']; ?>">
<span class="error"> <?php echo $errors['cpasswd']; ?></span>
</td>
</tr>
<tr>
<td width="180">
New Password:
</td>
<td>
<input type="password" size="18" name="passwd1" value="<?php echo $info['passwd1']; ?>">
<span class="error"> <?php echo $errors['passwd1']; ?></span>
</td>
</tr>
<tr>
<td width="180">
Confirm New Password:
</td>
<td>
<input type="password" size="18" name="passwd2" value="<?php echo $info['passwd2']; ?>">
<span class="error"> <?php echo $errors['passwd2']; ?></span>
</td>
</tr>
<tr>
<th colspan="2">
<em><strong>Signature</strong>: Optional signature used on outgoing emails.
<span class="error"> <?php echo $errors['signature']; ?></span> <i class="help-tip icon-question-sign" href="#signature"></i></em>
<textarea class="richtext no-bar" name="signature" cols="21"
rows="5" style="width: 60%;"><?php echo $info['signature']; ?></textarea>
<br><em>Signature is made available as a choice, on ticket reply.</em>
</td>
</tr>
</tbody>
</table>
<p style="padding-left:200px;">
<input type="submit" name="submit" value="Save Changes">
<input type="reset" name="reset" value="Reset Changes">
<input type="button" name="cancel" value="Cancel Changes" onclick='window.location.href="index.php"'>
</p>
</form>