Newer
Older
<?php
if(!defined('OSTADMININC') || !$thisstaff || !$thisstaff->isAdmin() || !$config) die('Access Denied');
if(!($maxfileuploads=ini_get('max_file_uploads')))
$maxfileuploads=DEFAULT_MAX_FILE_UPLOADS;
?>
<h2><?php echo __('Task Settings and Options');?></h2>
<form action="settings.php?t=tasks" method="post" class="save">
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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
<?php csrf_token(); ?>
<input type="hidden" name="t" value="tasks" >
<ul class="tabs" id="tasks-tabs">
<li class="active"><a href="#settings">
<i class="icon-asterisk"></i> <?php echo __('Settings'); ?></a></li>
<li><a href="#alerts">
<i class="icon-bell-alt"></i> <?php echo __('Alerts & Notices'); ?></a></li>
</ul>
<div id="tasks-tabs_container">
<div id="settings" class="tab_content">
<table class="form_table settings_table" width="940" border="0" cellspacing="0" cellpadding="2">
<thead>
<tr>
<th colspan="2">
<em><?php echo __('Global default task settings and options.'); ?></em>
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<?php echo __('Default Task Number Format'); ?>:
</td>
<td>
<input type="text" name="task_number_format" value="<?php
echo $config['task_number_format']; ?>"/>
<span class="faded"><?php echo __('e.g.'); ?> <span id="format-example"><?php
if ($config['task_sequence_id'])
$seq = Sequence::lookup($config['task_sequence_id']);
if (!isset($seq))
$seq = new RandomSequence();
echo $seq->current($config['task_number_format']);
?></span></span>
<i class="help-tip icon-question-sign" href="#number_format"></i>
<div class="error"><?php echo $errors['task_number_format']; ?></div>
</td>
</tr>
<tr><td width="220"><?php echo __('Default Task Number Sequence'); ?>:</td>
<?php $selected = 'selected="selected"'; ?>
<td>
<select name="task_sequence_id">
<option value="0" <?php if ($config['task_sequence_id'] == 0) echo $selected;
?>>— <?php echo __('Random'); ?> —</option>
<?php foreach (Sequence::objects() as $s) { ?>
<option value="<?php echo $s->id; ?>" <?php
if ($config['task_sequence_id'] == $s->id) echo $selected;
?>><?php echo $s->name; ?></option>
<?php } ?>
</select>
<button class="action-button pull-right" onclick="javascript:
$.dialog('ajax.php/sequence/manage', 205);
return false;
"><i class="icon-gear"></i> <?php echo __('Manage'); ?></button>
<i class="help-tip icon-question-sign" href="#sequence_id"></i>
</td>
</tr>
<tr>
<td width="180" class="required"><?php echo __('Default Priority');?>:</td>
<td>
<select name="default_task_priority_id">
<?php
$priorities= db_query('SELECT priority_id,priority_desc FROM '.TICKET_PRIORITY_TABLE);
while (list($id,$tag) = db_fetch_row($priorities)){ ?>
<option value="<?php echo $id; ?>"<?php echo
($config['default_task_priority_id']==$id)?'selected':''; ?>><?php echo $tag; ?></option>
<?php
} ?>
</select>
<span class="error">* <?php echo
$errors['default_task_priority_id']; ?></span> <i class="help-tip icon-question-sign" href="#default_priority"></i>
</td>
</tr>
<tr>
<th colspan="2">
<em><b><?php echo __('Attachments');?></b>:</em>
</th>
</tr>
<tr>
<td width="180"><?php echo __('Task Attachment Settings');?>:</td>
<?php
$tform = TaskForm::objects()->one()->getForm();
$f = $tform->getField('description');
?>
<a class="action-button field-config" style="overflow:inherit"
href="#ajax.php/form/field-config/<?php
echo $f->get('id'); ?>"
onclick="javascript:
$.dialog($(this).attr('href').substr(1), [201]);
return false;
"><i class="icon-edit"></i> <?php echo __('Config'); ?></a>
<i class="help-tip icon-question-sign" href="#task_attachment_settings"></i>
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
</td>
</tr>
</tbody>
</table>
</div>
<div id="alerts" class="tab_content" style="display:none;">
<table class="form_table settings_table" width="940" border="0" cellspacing="0" cellpadding="2">
<tbody>
<tr><th><em><b><?php echo __('New Task Alert'); ?></b>:
<i class="help-tip icon-question-sign" href="#task_alert"></i>
</em></th></tr>
<tr>
<td><em><b><?php echo __('Status'); ?>:</b></em>
<input type="radio" name="task_alert_active" value="1"
<?php echo $config['task_alert_active'] ? 'checked="checked"' : ''; ?>
/> <?php echo __('Enable'); ?>
<input type="radio" name="task_alert_active" value="0"
<?php echo !$config['task_alert_active'] ? 'checked="checked"' : ''; ?> />
<?php echo __('Disable'); ?>
<font class="error"> <?php echo $errors['task_alert_active']; ?></font></em>
</td>
</tr>
<tr>
<td>
<input type="checkbox" name="task_alert_admin" <?php
echo $config['task_alert_admin'] ? 'checked="checked"' : ''; ?>>
<?php echo __('Admin Email'); ?> <em>(<?php echo $cfg->getAdminEmail(); ?>)</em>
</td>
</tr>
<tr>
<td>
<input type="checkbox" name="task_alert_dept_manager"
<?php echo $config['task_alert_dept_manager'] ? 'checked="checked"' : ''; ?>>
<?php echo __('Department Manager'); ?>
</td>
</tr>
<tr>
<td>
<input type="checkbox" name="task_alert_dept_members"
<?php echo $config['task_alert_dept_members'] ? 'checked="checked"' : ''; ?>>
<?php echo __('Department Members'); ?>
</td>
</tr>
<tr><th><em><b><?php echo __('New Activity Alert'); ?></b>:
<i class="help-tip icon-question-sign" href="#activity_alert"></i>
</em></th></tr>
<tr>
<td><em><b><?php echo __('Status'); ?>:</b></em>
<input type="radio" name="task_activity_alert_active" value="1"
<?php echo $config['task_activity_alert_active'] ? 'checked="checked"' : ''; ?> />
<?php echo __('Enable'); ?>
<input type="radio" name="task_activity_alert_active" value="0"
<?php echo !$config['task_activity_alert_active'] ? 'checked="checked"' : ''; ?> />
<?php echo __('Disable'); ?>
<font class="error"> <?php echo $errors['task_activity_alert_active']; ?></font>
</td>
</tr>
<tr>
<td>
<input type="checkbox" name="task_activity_alert_laststaff" <?php
echo $config['task_activity_alert_laststaff'] ? 'checked="checked"' : ''; ?>>
<?php echo __('Last Respondent'); ?>
</td>
</tr>
<tr>
<td>
<input type="checkbox" name="task_activity_alert_assigned"
<?php echo $config['task_activity_alert_assigned'] ? 'checked="checked"' : ''; ?>>
<?php echo __('Assigned Agent / Team'); ?>
</td>
</tr>
<tr>
<td>
<input type="checkbox" name="task_activity_alert_dept_manager"
<?php echo $config['task_activity_alert_dept_manager'] ? 'checked="checked"' : ''; ?>>
<?php echo __('Department Manager'); ?>
</td>
</tr>
<tr><th><em><b><?php echo __('Task Assignment Alert'); ?></b>:
<i class="help-tip icon-question-sign" href="#assignment_alert"></i>
</em></th></tr>
<tr>
<td><em><b><?php echo __('Status'); ?>: </b></em>
<input name="task_assignment_alert_active" value="1" type="radio"
<?php echo $config['task_assignment_alert_active'] ? 'checked="checked"' : ''; ?>>
<?php echo __('Enable'); ?>
<input name="task_assignment_alert_active" value="0" type="radio"
<?php echo !$config['task_assignment_alert_active'] ? 'checked="checked"' : ''; ?>>
<?php echo __('Disable'); ?>
<font class="error"> <?php echo $errors['task_assignment_alert_active']; ?></font>
</td>
</tr>
<tr>
<td>
<input type="checkbox" name="task_assignment_alert_staff" <?php echo
$config['task_assignment_alert_staff'] ? 'checked="checked"' : ''; ?>>
<?php echo __('Assigned Agent / Team'); ?>
</td>
</tr>
<tr>
<td>
<input type="checkbox"name="task_assignment_alert_team_lead" <?php
echo $config['task_assignment_alert_team_lead'] ? 'checked="checked"' : ''; ?>>
<?php echo __('Team Lead'); ?>
</td>
</tr>
<tr>
<td>
<input type="checkbox"name="task_assignment_alert_team_members"
<?php echo $config['task_assignment_alert_team_members'] ? 'checked="checked"' : ''; ?>>
<?php echo __('Team Members'); ?>
</td>
</tr>
<tr><th><em><b><?php echo __('Task Transfer Alert'); ?></b>:
<i class="help-tip icon-question-sign" href="#transfer_alert"></i>
</em></th></tr>
<tr>
<td><em><b><?php echo __('Status'); ?>:</b></em>
<input type="radio" name="task_transfer_alert_active" value="1"
<?php echo $config['task_transfer_alert_active'] ? 'checked="checked"' : ''; ?> />
<?php echo __('Enable'); ?>
<input type="radio" name="task_transfer_alert_active" value="0"
<?php echo !$config['task_transfer_alert_active'] ? 'checked="checked"' : ''; ?> />
<?php echo __('Disable'); ?>
<font class="error"> <?php
echo $errors['task_transfer_alert_active']; ?></font>
</td>
</tr>
<tr>
<td>
<input type="checkbox" name="task_transfer_alert_assigned"
<?php echo $config['task_transfer_alert_assigned']?'checked="checked"':''; ?>>
<?php echo __('Assigned Agent / Team'); ?>
</td>
</tr>
<tr>
<td>
<input type="checkbox" name="task_transfer_alert_dept_manager"
<?php echo $config['task_transfer_alert_dept_manager'] ? 'checked="checked"' : ''; ?>>
<?php echo __('Department Manager'); ?>
</td>
</tr>
<tr>
<td>
<input type="checkbox" name="task_transfer_alert_dept_members"
<?php echo $config['task_transfer_alert_dept_members'] ? 'checked="checked"' : ''; ?>>
<?php echo __('Department Members'); ?>
</td>
</tr>
<tr><th><em><b><?php echo __('Overdue Task Alert'); ?></b>:
<i class="help-tip icon-question-sign" href="#overdue_alert"></i>
</em></th></tr>
<tr>
<td><em><b><?php echo __('Status'); ?>:</b></em>
<input type="radio" name="task_overdue_alert_active" value="1"
<?php echo $config['task_overdue_alert_active'] ? 'checked="checked"' : ''; ?> /> <?php echo __('Enable'); ?>
<input type="radio" name="task_overdue_alert_active" value="0"
<?php echo !$config['task_overdue_alert_active'] ? 'checked="checked"' : ''; ?> /> <?php echo __('Disable'); ?>
<font class="error"> <?php echo $errors['task_overdue_alert_active']; ?></font>
</td>
</tr>
<tr>
<td>
<input type="checkbox" name="task_overdue_alert_assigned" <?php
echo $config['task_overdue_alert_assigned'] ? 'checked="checked"' : ''; ?>>
<?php echo __('Assigned Agent / Team'); ?>
</td>
</tr>
<tr>
<td>
<input type="checkbox" name="task_overdue_alert_dept_manager" <?php
echo $config['task_overdue_alert_dept_manager'] ? 'checked="checked"' : ''; ?>>
<?php echo __('Department Manager'); ?>
</td>
</tr>
<tr>
<td>
<input type="checkbox" name="task_overdue_alert_dept_members" <?php
echo $config['task_overdue_alert_dept_members'] ? 'checked="checked"' : ''; ?>>
<?php echo __('Department Members'); ?>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p style="text-align:center;">
<input class="button" type="submit" name="submit" value="<?php echo __('Save Changes');?>">
<input class="button" type="reset" name="reset" value="<?php echo __('Reset Changes');?>">
</p>
</form>
<script type="text/javascript">
$(function() {
var request = null,
update_example = function() {
request && request.abort();
request = $.get('ajax.php/sequence/'
+ $('[name=task_sequence_id] :selected').val(),
{'format': $('[name=task_number_format]').val()},
function(data) { $('#format-example').text(data); }
);
};
$('[name=task_sequence_id]').on('change', update_example);
$('[name=task_number_format]').on('keyup', update_example);
});
</script>