forked from FreePBX/core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
page.users.php
95 lines (93 loc) · 5.1 KB
/
page.users.php
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
<?php /* $Id$ */
if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); }
?>
<div class="fpbx-container container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="alert alert-danger">
<?php echo _("Editing devices and users seperately is not tested and is considered unsupported. Modifying devices and users seperately may cause things to not work as expected.")?>
</div>
<?php
// If this is a popOver, we need to set it so the selection of user type does not result
// in the popover closing because config.php thinks it was the process function. Maybe
// the better way to do this would be to log an error or put some proper mechanism in place
// since this is a bit of a kludge
//
if (!empty($_REQUEST['fw_popover'])) {
?>
<script>
$(document).ready(function(){
$('[name="fw_popover_process"]').val('');
$('<input>').attr({type: 'hidden', name: 'fw_popover'}).val('1').appendTo('.popover-form');
});
</script>
<?php
}
$display = isset($_REQUEST['display'])?$_REQUEST['display']:null;
$action = isset($_REQUEST['action'])?$_REQUEST['action']:null;
$extdisplay = isset($_REQUEST['extdisplay'])?$_REQUEST['extdisplay']:null;
$view = isset($_REQUEST['view'])?$_REQUEST['view']:null;
global $currentcomponent;
$page = $currentcomponent->generateconfigpage(__DIR__."/views/users.php");
if($view == "add" || (!is_null($extdisplay) && trim($extdisplay) != '')) {
echo $page;
} else { ?>
<div class="display no-border">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" data-name="alldids" class="active">
<a href="#alldids" aria-controls="alldids" role="tab" data-toggle="tab">
<?php echo _("All Users")?>
</a>
</li>
</ul>
<div class="tab-content display">
<div role="tabpanel" id="alldids" class="tab-pane active">
<div id="toolbar-users">
<button id="remove-user" class="btn btn-danger btn-remove" data-type="users" disabled>
<i class="glyphicon glyphicon-remove"></i> <span><?php echo _('Delete')?></span>
</button>
<a href="?display=users&view=add" class="btn btn-default"><i class="fa fa-plus"></i> <?php echo _("Add User")?></a>
</div>
<table data-url="ajax.php?module=core&command=getUserGrid&type=all" data-cache="false" data-show-refresh="true" data-toolbar="#toolbar-users" data-maintain-selected="true" data-show-columns="true" data-show-toggle="true" data-toggle="table" data-pagination="true" data-search="true" class="table table-striped ext-list" id="table-users">
<thead>
<tr>
<th data-checkbox="true"></th>
<th data-sortable="true" data-field="extension"><?php echo _('User')?></th>
<th data-sortable="true" data-field="name"><?php echo _('Name')?></th>
<th data-formatter="CWIconFormatter"><?php echo _('CW')?></th>
<th data-formatter="DNDIconFormatter"><?php echo _('DND')?></th>
<th data-formatter="FMFMIconFormatter"><?php echo _('FM/FM')?></th>
<th data-formatter="CFIconFormatter"><?php echo _('CF')?></th>
<th data-formatter="CFBIconFormatter"><?php echo _('CFB')?></th>
<th data-formatter="CFUIconFormatter"><?php echo _('CFU')?></th>
<th data-field="actions"><?php echo _('Actions')?></th>
</tr>
</thead>
</table>
</div>
</div>
</div>
<?php } ?>
</div>
</div>
</div>
<script>
function DNDIconFormatter(value, row) {
return row.settings.dnd ? '<i class="fa fa-check-square-o" style="color:green" title="<?php echo _("Do Not Disturb is enabled")?>"></i>' : '<i class="fa fa-square-o" title="<?php echo _("Do Not Disturb is disabled")?>"></i>';
}
function CWIconFormatter(value, row) {
return row.settings.cw ? '<i class="fa fa-check-square-o" style="color:green" title="<?php echo _("Call Waiting is enabled")?>"></i>' : '<i class="fa fa-square-o" title="<?php echo _("Call Waiting is disabled")?>"></i>';
}
function CFIconFormatter(value, row) {
return row.settings.cf ? '<i class="fa fa-check-square-o" style="color:green" title="<?php echo _("Call Forwarding is enabled")?>"></i>' : '<i class="fa fa-square-o" title="<?php echo _("Call Forwarding is disabled")?>"></i>';
}
function CFBIconFormatter(value, row) {
return row.settings.cfb ? '<i class="fa fa-check-square-o" style="color:green" title="<?php echo _("Call Forwarding Busy is enabled")?>"></i>' : '<i class="fa fa-square-o" title="<?php echo _("Call Forwarding Busy is disabled")?>"></i>';
}
function CFUIconFormatter(value, row) {
return row.settings.cfu ? '<i class="fa fa-check-square-o" style="color:green" title="<?php echo _("Call Forwarding Unconditional is enabled")?>"></i>' : '<i class="fa fa-square-o" title="<?php echo _("Call Forwarding Unconditional is disabled")?>"></i>';
}
function FMFMIconFormatter(value, row) {
return row.settings.fmfm ? '<i class="fa fa-check-square-o" style="color:green" title="<?php echo _("Find Me/Follow Me is enabled")?>"></i>' : '<i class="fa fa-square-o" title="<?php echo _("Find Me/Follow Me is disabled")?>"></i>';
}
</script>