-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtimeframes.php
More file actions
104 lines (82 loc) · 2.55 KB
/
timeframes.php
File metadata and controls
104 lines (82 loc) · 2.55 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
<?php
/**
*
* Time Frame Override for Yealink & Netsapiens by Brent Nesbit
* Details: https://github.com/nesb0t/tod-override
* Version 1.0.0 -- Last updated: 2017-06-15
*
**/
###################################################
# Header: Set our variables/constants/etc
###################################################
date_default_timezone_set('America/New_York'); // Not required, but usually a good idea in php
define("URI", "http://timeframe.example.com/ClientName"); // Set your URL here to the location of where you uploaded these files (no trailing slash). Example: If your file is at http://timeframe.example.com/ClientName/status.php, put "http://timeframe.example.com/ClientName" here
###################################################
require('status.php'); // Pull the current status of the override
?>
<?xml version="1.0" encoding="ISO-8859-1"?> <!-- Generate file for Yealink XML browser -->
<YealinkIPPhoneTextMenu
destroyOnExit="yes"
style="numbered"
wrapList="yes"
Timeout="5"
LockIn="yes">
<Title>Override: * indicates current selection</Title>
<?php
if ($status == "enable"){ // If our override status is currently set to "enable"
?>
<MenuItem>
<Prompt> [*] Override to Closed</Prompt>
<URI><?= URI ?>/selection.php</URI> <!-- Fill in the uri from above -->
<Selection>disable</Selection>
</MenuItem>
<MenuItem>
<Prompt> [ ] Normal Operation</Prompt>
<URI><?= URI ?>/selection.php</URI> <!-- Fill in the uri from above -->
<Selection>disable</Selection>
</MenuItem>
<?php
}
else if ($status == "disable"){ // If our override status is currently set to "disable"
?>
<MenuItem>
<Prompt> [ ] Override to Closed</Prompt>
<URI><?= URI ?>/selection.php</URI>
<Selection>enable</Selection>
</MenuItem>
<MenuItem>
<Prompt> [*] Normal Operation</Prompt>
<URI><?= URI ?>/selection.php</URI>
<Selection>enable</Selection>
</MenuItem>
<?php
}
else { // If our override status is currently unknown
?>
<MenuItem>
<Prompt> [ ] Override to Closed</Prompt>
<URI><?= URI ?>/selection.php</URI>
<Selection>enable</Selection>
</MenuItem>
<MenuItem>
<Prompt> [ ] Normal Operation</Prompt>
<URI><?= URI ?>/selection.php</URI>
<Selection>disable</Selection>
</MenuItem>
<?php
}
// This sets the soft keys for the XML browser window
?>
<SoftKey index = "1">
<Label>OK</Label>
<URI>SoftKey:Select</URI>
</SoftKey>
<SoftKey index="2">
<Label>Refresh</Label>
<URI><?= URI ?>/timeframes.php</URI>
</SoftKey>
<SoftKey index = "4">
<Label>Exit</Label>
<URI>SoftKey:Exit</URI>
</SoftKey>
</YealinkIPPhoneTextMenu>