-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexceptions_main_global.php
More file actions
362 lines (252 loc) · 17.7 KB
/
exceptions_main_global.php
File metadata and controls
362 lines (252 loc) · 17.7 KB
1
2
3
4
5
6
7
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
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
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<!--XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX TABLE Exception Management XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -->
<div class="col-sm-9">
<div id="global-exceptions" class="admin-exceptions dynamic">
<table id="exceptions-table" class="display hover" cellpadding="0" cellspacing="0" border="0" width="100%">
<caption><center>
<h3>Exception Management (<?php echo count($exceptions); ?>)</h3>
<input id='ex-management' type="button" title="Add New" class="removeButton" value="+"/>
</center></caption>
<thead>
<tr>
<th>Category</th>
<th>Code</th>
<th>Description</th>
<th>Default<br />Ex Sev</th>
<?php foreach ($exceptionFlags as $row){
echo "<th>".htmlentities($row->exceptionflagdescription)."</th>";
}
?>
<th title="Add a default message">M</th>
<th title="Remove an exception">E</th>
</tr>
</thead>
<tbody>
<?php foreach ($exceptions as $row){ ?>
<tr>
<td>
<select id="ex-catg-<?php echo $row->exceptionid; ?>" class="ex-catg-select">
<?php $str=""; foreach($exceptionCategories as $val){
if($val->exceptioncategoryid==$row->exceptioncategoryid){
$str.= "<option value='".$val->exceptioncategoryid."' selected >".htmlentities($val->exceptioncategorydescription)."</option>";
}else{
$str.= "<option value='".$val->exceptioncategoryid."'>".htmlentities($val->exceptioncategorydescription)."</option>";
}
}
echo $str;
?>
</select>
</td>
<td><?php echo htmlentities($row->exceptioncode); ?></td>
<td><?php echo htmlentities($row->exceptiondescription); ?></td>
<td>
<select id="ex-sevg-<?php echo $row->exceptionid; ?>" class="ex-sevg-select">
<option value="0">---</option>
<?php $str=""; foreach($exceptionSeverity as $val){
if($val->exceptionseverityid==$row->defaultexceptionseverity){
$str.= "<option value='".$val->exceptionseverityid."' selected >".htmlentities($val->exceptionseverityvalue)."</option>";
}else{
$str.= "<option value='".$val->exceptionseverityid."'>".htmlentities($val->exceptionseverityvalue)."</option>";
}
}
echo $str;
?>
</select>
</td>
<!-- START EXCEPTION FLAGS-->
<?php foreach ($exceptionFlags as $val){
$checked="";
foreach ($exceptionHasFlags as $flag){
if($val->exceptionflagid==$flag->exceptionflagid && $row->exceptionid==$flag->exceptionid){
$checked="checked";
break 1;
}
}
?>
<td><input class="ex-flag-set" id="flag-<?php echo $row->exceptionid.'-'.$val->exceptionflagid; ?>" type="checkbox" value="" <?php echo $checked; ?> /></td>
<?php };?> <!-- END EXCEPTION FLAGS-->
<td><a href="#"><span id="<?php echo $row->exceptionid; ?>" title="<?php echo htmlentities($row->defaultwording); ?>" class="ex-message-set glyphicon glyphicon-list-alt"></span></a></td>
<td><a href="#"><span id="<?php echo $row->exceptionid; ?>" class="ex-row-delete glyphicon glyphicon-trash"></span></a></td>
</tr>
<?php };?>
</tbody>
</table>
</div>
</div>
</div> <!-- <div class="container-fluid mimin-wrapper"> SEE HEADER -->
</div>
<!-- MODAL FORMS START -->
<!-- XXXXXXXXXXXXXXXXXXXXXXXXXXXXX Exception flag XXXXXXXXXXXXXXXXXXX -->
<div class="modal fade" id="myModal-exception-flag" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<!-- Modal Header -->
<div class="modal-header">
<button type="button" class="close"
data-dismiss="modal">
<span aria-hidden="true">×</span>
<span class="sr-only">Close</span>
</button>
<h4 class="modal-title" id="myModalLabel">
Add a new Exception flag
</h4>
</div>
<!-- Modal Body -->
<div class="modal-body">
<form id="modal-form-ex-flag" role="form">
<div class="form-group">
<label for="ex-flag">Enter a description</label>
<input type="text" class="form-control" id="ex-flag" maxlength="<?php echo SECTION_NAME_MAXLENGTH - 10;?>" name="ex-flag" placeholder="Enter a flag name here ..." data-toggle="tooltip" data-placement="left" title="Maximum length: <?php echo SECTION_NAME_MAXLENGTH - 10;?>" required />
</div>
<button id="first-modal-form-submit-ex-flag" type="submit" class="btn btn-primary">Save changes</button>
</form>
</div>
<!-- Modal Footer -->
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX EXCEPTION Category XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX --->
<div class="modal fade" id="myModal-exception-cat" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<!-- Modal Header -->
<div class="modal-header">
<button type="button" class="close"
data-dismiss="modal">
<span aria-hidden="true">×</span>
<span class="sr-only">Close</span>
</button>
<h4 class="modal-title" id="myModalLabe2">
Add a new Category
</h4>
</div>
<!-- Modal Body -->
<div class="modal-body">
<form id="modal-form-ex-cat" role="form">
<div class="form-group">
<label for="ex-cat">Enter a description</label>
<input type="text" class="form-control" id="ex-cat" name="ex-cat" maxlength="<?php echo SECTION_NAME_MAXLENGTH - 10;?>" placeholder="Enter a category name here ..." data-toggle="tooltip" data-placement="left" title="Maximum length: <?php echo SECTION_NAME_MAXLENGTH - 10;?>" required />
</div>
<button id="first-modal-form-submit-ex-cat" type="submit" class="btn btn-primary">Save changes</button>
</form>
</div>
<!-- Modal Footer -->
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX EXCEPTION Severity XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX --->
<div class="modal fade" id="myModal-exception-sev" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<!-- Modal Header -->
<div class="modal-header">
<button type="button" class="close"
data-dismiss="modal">
<span aria-hidden="true">×</span>
<span class="sr-only">Close</span>
</button>
<h4 class="modal-title" id="myModalLabe2">
Add a new Severity
</h4>
</div>
<!-- Modal Body -->
<div class="modal-body">
<form id="modal-form-ex-sev" role="form">
<div class="form-group">
<label for="ex-sev">Enter a description</label>
<input type="text" class="form-control" id="ex-sev" name="ex-sev" maxlength="<?php echo SECTION_NAME_MAXLENGTH - 10;?>" placeholder="Enter a Severity name here ..." data-toggle="tooltip" data-placement="left" title="Maximum length: <?php echo SECTION_NAME_MAXLENGTH - 10;?>" required />
</div>
<button id="first-modal-form-submit-ex-sev" type="submit" class="btn btn-primary">Save changes</button>
</form>
</div>
<!-- Modal Footer -->
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- XXXXXXXXXXXXXXXXXXXXXXXXXXXXX Exception Management - add wording OR Add a new exception (the form can submitted in 2 ways - see exceptions.js) XXXXXXXXXXXXXXXXXXX -->
<div class="modal fade" id="myModal-exception-default-wording" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<!-- Modal Header -->
<div class="modal-header">
<button type="button" class="close"
data-dismiss="modal">
<span aria-hidden="true">×</span>
<span class="sr-only">Close</span>
</button>
<h4 class="modal-title" id="form-title">
Add default wording
</h4>
</div>
<!-- Modal Body -->
<div class="modal-body">
<form id="modal-form-ex-default-wording" role="form">
<div class="form-group">
<!-- Add new Exception -->
<div class="ane hideall">
<label for="cat_name">Enter Category</label>
<select class="form-control add-ex" name="cat_name">
<?php foreach($exceptionCategories as $row){ ?>?>
<option value="<?php echo $row->exceptioncategoryid; ?>"> <?php echo $row->exceptioncategorydescription; ?> </option>
<?php };?>
</select><br />
<label for="cat_code">Enter Code</label>
<input class="form-control add-ex" maxlength="<?php echo EXCEPTION_CODE_MAXLENGTH;?>" type="input" name="cat_code" id="cat_code" placeholder="Enter a Code name ..." data-toggle="tooltip" data-placement="left" title="Maximum length: <?php echo EXCEPTION_CODE_MAXLENGTH;?> chars" required />
<label for="cat_desc">Enter Description</label>
<input class="form-control add-ex" maxlength="<?php echo SECTION_NAME_MAXLENGTH;?>" type="input" name="cat_desc" id="cat_desc" placeholder="Enter a description ..." data-toggle="tooltip" data-placement="left" title="Maximum length: <?php echo SECTION_NAME_MAXLENGTH;?> chars" required />
<br /><label for="check_flags">Select exception flag(s)</label>
<?php foreach ($exceptionFlags as $row){ ?>
<div class="checkbox add-ex">
<label><input type="checkbox" name="check_flags[]" value="<?php echo $row->exceptionflagid;?>"><?php echo $row->exceptionflagdescription;?></label>
</div>
<?php };?>
<br /><label for="select_sev">Select default severity</label>
<div class="radio add-ex">
<label><input type="radio" name="select_sev" checked="checked" value="0">None</label>
</div>
<?php foreach ($exceptionSeverity as $row){ ?>
<div class="radio add-ex">
<label><input type="radio" name="select_sev" value="<?php echo $row->exceptionseverityid;?>"><?php echo $row->exceptionseverityvalue;?></label>
</div>
<?php };?>
</div>
<!-- Add default wording -->
<div class="adw hideall">
<label for="ex-default-wording">Enter details</label>
<textarea maxlength="<?php echo DATAPOINT_NAME_MAXLENGTH;?>" class="form-control" rows="5" name="ex-default-wording" id="ex-default-wording" placeholder="Enter default wording here ..." data-toggle="tooltip" data-placement="left" required ></textarea>
<input type="hidden" name="id" id="id" value="0"/>
</div>
</div>
<button id="ex-default-wording-btn" type="submit" class="btn btn-primary">Save changes</button>
</form>
</div>
<!-- Modal Footer -->
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- MODAL FORMS END -->
</div> <!-- <div class="content"> -->
</html>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
<script src="/public/asset/js/exceptions.js"></script>