root/modules/branches/2.9/core/page.general.php

Revision 11647, 21.5 kB (checked in by p_lindheimer, 2 years ago)

closes #4137 choose whether to use automon or automixmon for one-touch-recording in Advanced Settings, dial options tooltips updated, proper dialoptions must be set based on the choice made and pre-1.6 systems will be forced to automon

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 <?php /* $Id$ */
2 // This file is part of FreePBX.
3 //
4 //    FreePBX is free software: you can redistribute it and/or modify
5 //    it under the terms of the GNU General Public License as published by
6 //    the Free Software Foundation, either version 2 of the License, or
7 //    (at your option) any later version.
8 //
9 //    FreePBX is distributed in the hope that it will be useful,
10 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
11 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 //    GNU General Public License for more details.
13 //
14 //    You should have received a copy of the GNU General Public License
15 //    along with FreePBX.  If not, see <http://www.gnu.org/licenses/>.
16 //
17 //    Copyright (C) 2004 Coalescent Systems Inc. (info@coalescentsystems.ca)
18 //
19
20 $action = isset($_REQUEST['action'])?$_REQUEST['action']:'';
21 $tabindex = 0;
22
23 $cm =& cronmanager::create($db);
24
25
26 //if submitting form, update database
27 if ($action == 'editglobals') {
28     $globalfields = array(
29               array($_REQUEST['RECORDING_STATE'],'RECORDING_STATE'),
30               array($_REQUEST['MIXMON_FORMAT'],'MIXMON_FORMAT'),
31                         array($_REQUEST['MIXMON_DIR'],'MIXMON_DIR'),
32                         array($_REQUEST['MIXMON_POST'],'MIXMON_POST'),
33             array($_REQUEST['RINGTIMER'],'RINGTIMER'),
34                         array(isset($_REQUEST['DIRECTORY']) ? $_REQUEST['DIRECTORY'] : 'both','DIRECTORY'),
35                         array($_REQUEST['VM_PREFIX'],'VM_PREFIX'),
36                         array($_REQUEST['VM_DDTYPE'],'VM_DDTYPE'),
37                         array($_REQUEST['VM_GAIN'],'VM_GAIN'),
38                         array($_REQUEST['DIAL_OPTIONS'],'DIAL_OPTIONS'),
39                         array($_REQUEST['TRUNK_OPTIONS'],'TRUNK_OPTIONS'),
40                         array($_REQUEST['TONEZONE'], 'TONEZONE'),
41                         array($_REQUEST['TIMEFORMAT'], 'TIMEFORMAT'),
42                         array($_REQUEST['ALLOW_SIP_ANON'], 'ALLOW_SIP_ANON'),
43                         array($_REQUEST['OPERATOR_XTN'], 'OPERATOR_XTN'),
44                         array(isset($_REQUEST['DIRECTORY_OPTS']) ? $_REQUEST['DIRECTORY_OPTS'] : "",'DIRECTORY_OPTS'),
45                         array(isset($_REQUEST['VM_OPTS']) ? $_REQUEST['VM_OPTS'] : "",'VM_OPTS'),
46                         array(isset($_REQUEST['VMX_CONTEXT']) ? $_REQUEST['VMX_CONTEXT'] : "",'VMX_CONTEXT'),
47                         array(isset($_REQUEST['VMX_PRI']) ? $_REQUEST['VMX_PRI'] : "",'VMX_PRI'),
48                         array(isset($_REQUEST['VMX_TIMEDEST_CONTEXT']) ? $_REQUEST['VMX_TIMEDEST_CONTEXT'] : "",'VMX_TIMEDEST_CONTEXT'),
49                         array(isset($_REQUEST['VMX_TIMEDEST_EXT']) ? $_REQUEST['VMX_TIMEDEST_EXT'] : "",'VMX_TIMEDEST_EXT'),
50                         array(isset($_REQUEST['VMX_TIMEDEST_PRI']) ? $_REQUEST['VMX_TIMEDEST_PRI'] : "",'VMX_TIMEDEST_PRI'),
51                         array(isset($_REQUEST['VMX_LOOPDEST_CONTEXT']) ? $_REQUEST['VMX_LOOPDEST_CONTEXT'] : "",'VMX_LOOPDEST_CONTEXT'),
52                         array(isset($_REQUEST['VMX_LOOPDEST_EXT']) ? $_REQUEST['VMX_LOOPDEST_EXT'] : "",'VMX_LOOPDEST_EXT'),
53                         array(isset($_REQUEST['VMX_LOOPDEST_PRI']) ? $_REQUEST['VMX_LOOPDEST_PRI'] : "",'VMX_LOOPDEST_PRI'),
54                         array(isset($_REQUEST['VMX_OPTS_TIMEOUT']) ? $_REQUEST['VMX_OPTS_TIMEOUT'] : "",'VMX_OPTS_TIMEOUT'),
55                         array(isset($_REQUEST['VMX_OPTS_LOOP']) ? $_REQUEST['VMX_OPTS_LOOP'] : "",'VMX_OPTS_LOOP'),
56                         array(isset($_REQUEST['VMX_OPTS_DOVM']) ? $_REQUEST['VMX_OPTS_DOVM'] : "",'VMX_OPTS_DOVM'),
57                         array(isset($_REQUEST['VMX_TIMEOUT']) ? $_REQUEST['VMX_TIMEOUT'] : "",'VMX_TIMEOUT'),
58                         array(isset($_REQUEST['VMX_REPEAT']) ? $_REQUEST['VMX_REPEAT'] : "",'VMX_REPEAT'),
59                         array(isset($_REQUEST['VMX_LOOPS']) ? $_REQUEST['VMX_LOOPS'] : "",'VMX_LOOPS'),
60                         );
61
62     $compiled = $db->prepare('UPDATE globals SET value = ? WHERE variable = ?');
63     //$compiled = $db->prepare('REPLACE INTO globals (value,variable) VALUES (?, ?)');
64     $result = $db->executeMultiple($compiled,$globalfields);
65     if(DB::IsError($result)) {
66         echo $action.'<br>';
67         die_freepbx($result->getMessage());
68     }
69     
70     /* update online updates and email as appropriate
71     */
72     $online_updates = isset($_REQUEST['online_updates'])? $_REQUEST['online_updates'] : 'yes';
73     $update_email   = isset($_REQUEST['update_email'])  ? $_REQUEST['update_email']   : '';
74
75     if ($online_updates == 'yes') {
76         $cm->enable_updates();
77     } else {
78         $cm->disable_updates();
79     }
80
81     // TODO: maybe check the email address a bit better server/client side
82     //
83     $cm->save_email($update_email);
84     
85     //indicate 'need reload' link in header.php
86     needreload();
87 }
88
89 $online_updates = $cm->updates_enabled() ? 'yes' : 'no';
90 $update_email   = $cm->get_email();
91
92 //get all rows relating to selected account
93 $sql = "SELECT * FROM globals";
94 $globals = $db->getAll($sql);
95 if(DB::IsError($globals)) {
96 die_freepbx($globals->getMessage());
97 }
98
99 //create a set of variables that match the items in global[0]
100 foreach ($globals as $global) {
101     ${trim($global[0])} = $global[1];   
102 }
103
104 ?>
105 <br />
106 <a href="<?php echo $_SERVER['PHP_SELF'] ?>?display=advancedsettings">
107     <img src="images/cog.png" style="border: none">
108     <?php echo _('Advanced Settings') ?>
109 </a>
110 <form name="general" action="config.php" method="post" onsubmit="return general_onsubmit();">
111 <input type="hidden" name="display" value="general"/>
112 <input type="hidden" name="action" value="editglobals"/>
113
114 <h5><?php echo _("Dialing Options")?></h5>
115 <table>
116     <tr><td>
117     <a href=# class="info"><?php echo _("Asterisk Dial command options:")?><span>
118 <?php echo _("t: Allow the called user to transfer the call by hitting #")?><br>
119 <?php echo _("T: Allow the calling user to transfer the call by hitting #")?><br>
120 <?php echo _("r: Generate a ringing tone for the calling party")?><br>
121 <?php echo _("x or w: Allow the called user to start recording using One-Touch Recording")?><br>
122 <?php echo _("X or W: Allow the calling user to start recording using One-Touch Recording")?><br>
123 <?php echo _("Choose automixmon (x/X) or automon (w/W) for One-Touch Recording in Advanced Settings")?><br>
124 <?php echo _("See Asterisk documentation for other advanced options.")?><br>
125     </span></a>
126     </td><td align="right">
127     <input type="text" size="10" name="DIAL_OPTIONS" value="<?php  echo htmlspecialchars($DIAL_OPTIONS)?>" tabindex="<?php echo ++$tabindex;?>"/>
128     </td></tr>
129     <tr><td>
130     <a href=# class="info"><?php echo _("Asterisk Outbound Dial command options:")?><span>
131 <?php echo _("t: Allow the called user to transfer the call by hitting #")?><br>
132 <?php echo _("T: Allow the calling user to transfer the call by hitting #")?><br>
133 <?php echo _("r: You SHOULD NOT use this option on outbound trunks")?><br>
134 <?php echo _("x or w: Allow the called user to start recording using One-Touch Recording")?><br>
135 <?php echo _("X or W: Allow the calling user to start recording using One-Touch Recording")?><br>
136 <?php echo _("Choose automixmon (x/X) or automon (w/W) for One-Touch Recording in Advanced Settings")?><br>
137 <?php echo _("See Asterisk documentation for other advanced options.")?><br>
138     </span></a>
139     </td><td align="right">
140     <input type="text" size="10" name="TRUNK_OPTIONS" value="<?php  echo htmlspecialchars($TRUNK_OPTIONS)?>" tabindex="<?php echo ++$tabindex;?>"/>
141     </td></tr>
142 </table>
143
144 <h5><?php echo _("Call Recording")?></h5>
145 <table>
146     <tr><td>
147     <a href=# class="info"><?php echo _("Extension Recording Override:")?><span>
148     <?php echo _("This will override the recording settings of all extensions/users. If enabled, the system will ignore all Record Always settings of a user and will not turn on recording. This does not effect On Demand recording controlled by the dial options 'w' and 'W' above. It does not effect other recording settings in modules such as Queues and Conferences. If you don't use recordings, setting this is beneficial to system performance as it removes the check that is otherwise done on every single call."); ?></span></a>
149     </td><td align="right">
150     <select name="RECORDING_STATE" tabindex="<?php echo ++$tabindex;?>">
151         <option value="DISABLED"  <?php  echo ($RECORDING_STATE == 'DISABLED' ? 'SELECTED' : '')?>><?php echo _("Enabled")?>
152         <option value="ENABLED"   <?php  echo ($RECORDING_STATE == 'ENABLED'  ? 'SELECTED' : '')?>><?php echo _("Disabled")?>
153     </select>
154     </td></tr>
155     <tr><td>
156   <a href=# class="info"><?php echo _("Call recording format:")?><span>
157   <?php echo _("Pick the format in which to save recorded calls")?>
158   </span></a>
159     </td><td align="right">
160   <select name="MIXMON_FORMAT" tabindex="<?php echo ++$tabindex;?>">
161   <option value="WAV"<?php if ($MIXMON_FORMAT == "WAV") echo " SELECTED"; ?>><?php echo _("WAV"); ?></option>
162   <option value="wav"<?php if ($MIXMON_FORMAT == "wav") echo " SELECTED"; ?>><?php echo _("wav"); ?></option>
163   <option value="ulaw"<?php if ($MIXMON_FORMAT == "ulaw") echo " SELECTED"; ?>><?php echo _("ulaw"); ?></option>
164   <option value="alaw"<?php if ($MIXMON_FORMAT == "alaw") echo " SELECTED"; ?>><?php echo _("alaw"); ?></option>
165   <option value="sln"<?php if ($MIXMON_FORMAT == "sln") echo " SELECTED"; ?>><?php echo _("sln"); ?></option>
166   <option value="gsm"<?php if ($MIXMON_FORMAT == "gsm") echo " SELECTED"; ?>><?php echo _("gsm"); ?></option>
167   <option value="g729"<?php if ($MIXMON_FORMAT == "g729") echo " SELECTED"; ?>><?php echo _("g729"); ?></option>
168   </select>
169     </td></tr>
170 </table>
171
172 <h5><?php echo _("Voicemail")?></h5>
173 <table>
174     <tr><td>
175   <a href=# class="info"><?php echo _("Ringtime Default:")?><span>
176   <?php echo _("Default number of seconds to ring phones before sending callers to voicemail. This can be set per extension/user and will have no effect on phones with no voicemail.")?><br>
177   </span></a>
178     </td><td align="right">
179     <input type="text" size="2" name="RINGTIMER" value="<?php  echo htmlspecialchars($RINGTIMER)?>" tabindex="<?php echo ++$tabindex;?>"/>
180     </td></tr>
181     <tr><td>
182   <a href=# class="info"><?php echo _("Direct Dial Voicemail Prefix:")?><span>
183   <?php echo _("Prefix used to dial directly to someone's voicemail. Caution should be taken in choosing this prefix to avoid conflicts with featurecodes.")?><br>
184   </span></a>
185     </td><td align="right">
186     <input type="text" size="2" name="VM_PREFIX" value="<?php  echo htmlspecialchars($VM_PREFIX)?>" tabindex="<?php echo ++$tabindex;?>"/>
187     </td></tr>
188     <tr><td>
189     <a href=# class="info"><?php echo _("Direct Dial to Voicemail message type:")?><span>
190     <?php echo _("Default message type to use when dialing direct to an extensions voicemail")?><br>
191   </span></a>
192     </td><td align="right">
193     <select name="VM_DDTYPE" tabindex="<?php echo ++$tabindex;?>">
194     <option value=""><?php echo _("Default"); ?></option>
195     <option value="u"<?php if ($VM_DDTYPE == "u" || $VM_DDTYPE == "su") echo " SELECTED"; ?>><?php echo _("Unavailable"); ?></option>
196     <option value="b"<?php if ($VM_DDTYPE == "b" || $VM_DDTYPE == "sb") echo " SELECTED"; ?>><?php echo _("Busy"); ?></option>
197     <option value="s"<?php if ($VM_DDTYPE == "s") echo " SELECTED"; ?>><?php echo _("No Message"); ?></option>
198     </select>
199     </td></tr>
200     <tr><td>
201     <a href=# class="info"><?php echo _("Optional Voicemail Recording Gain:")?><span>
202     <?php echo _("Use the specified amount of gain when recording the voicemail message."); ?><br><br>
203     <?php echo _("The units are whole-number decibels (dB)."); ?></span></a>
204     </td><td align="right">
205     <input type="text" size="2" name="VM_GAIN" value="<?php  echo htmlspecialchars($VM_GAIN)?>" tabindex="<?php echo ++$tabindex;?>"/>
206     </td></tr>
207     <tr><td>
208     <a href=# class="info"><?php echo _("Do Not Play \"please leave message after tone\" to caller")?><span><?php echo _("Check this to remove the default message \"Please leave your message after the tone. When done, hang-up, or press the pound key.\" That is played after the voicemail greeting (the s option). This applies globally to all vm boxes.")?></span></a>
209     </td><td align="right">
210     <input type="checkbox" value="s" name="VM_OPTS" <?php  echo (($VM_OPTS || $VM_DDTYPE == "su" || $VM_DDTYPE == "bu") ? 'CHECKED' : '')?> tabindex="<?php echo ++$tabindex;?>">
211     </td></tr>
212     <tr><td>
213     <a href=# class="info"><?php echo _("Operator Extension:")?><span>
214     <?php echo _("Default number to dial when callers hit '0' from voicemail or the built in IVR directory (it has no effect on the Directory Module). This does NOT need to be an extension, it can be a Ring Group, or even an external number."); ?></span></a>
215     </td><td align="right">
216     <input type="text" size="10" name="OPERATOR_XTN" value="<?php  echo htmlspecialchars($OPERATOR_XTN)?>" tabindex="<?php echo ++$tabindex;?>"/>
217     </td></tr>
218 </table>
219
220 <h5><?php echo _("Voicemail VmX Locator")?></h5>
221     <table>
222         <tr>
223             <td>
224             <a href=# class="info"><?php echo _("Timeout VM Msg:")?><span>
225             <?php echo _("If this destination is voicemail, select whether or not to play the standard voicemail instructions or just beep."); ?></span></a>
226             </td>
227             <td colspan="3" align="right">
228             <select name="VMX_OPTS_TIMEOUT" tabindex="<?php echo ++$tabindex;?>">
229                 <option value=""  <?php  echo ($VMX_OPTS_TIMEOUT == '' ? 'SELECTED' : '') ?>><?php echo _("Std Instructions")?>
230                 <option value="s" <?php  echo ($VMX_OPTS_TIMEOUT == 's' ? 'SELECTED' : '')?>><?php echo _("Beep Only")?>
231             </select>
232             </td>
233         </tr>
234         <tr>
235             <td>
236             <a href=# class="info"><?php echo _("Max Loop VM Msg:")?><span>
237             <?php echo _("If this destination is voicemail, select whether or not to play the standard voicemail instructions or just beep."); ?></span></a>
238             </td>
239             <td colspan="3" align="right">
240             <select name="VMX_OPTS_LOOP" tabindex="<?php echo ++$tabindex;?>">
241                 <option value=""  <?php  echo ($VMX_OPTS_LOOP == '' ? 'SELECTED' : '') ?>><?php echo _("Std Instructions")?>
242                 <option value="s" <?php  echo ($VMX_OPTS_LOOP == 's' ? 'SELECTED' : '')?>><?php echo _("Beep Only")?>
243             </select>
244             </td>
245         </tr>
246         <tr>
247             <td>
248             <a href=# class="info"><?php echo _("Direct VM Option")?><span>
249             <?php echo _("If a user defined option is to go to voicemail (using the 'dovm' extension) this is the default option if not specified by the user's settings."); ?></span></a>
250             </td>
251             <td colspan="3" align="right">
252             <select name="VMX_OPTS_DOVM" tabindex="<?php echo ++$tabindex;?>">
253                 <option value=""  <?php  echo ($VMX_OPTS_DOVM == '' ? 'SELECTED' : '') ?>><?php echo _("Std Instructions")?>
254                 <option value="s" <?php  echo ($VMX_OPTS_DOVM == 's' ? 'SELECTED' : '')?>><?php echo _("Beep Only")?>
255             </select>
256             </td>
257         </tr>
258         <tr>
259             <td>
260             <a href=# class="info"><?php echo _("Msg Timeout:")?><span>
261             <?php echo _("Time to wait after message has played to timeout and/or repeat the message if no entry pressed."); ?></span></a>
262             </td>
263             <td colspan="3" align="right">
264             <select name="VMX_TIMEOUT" tabindex="<?php echo ++$tabindex;?>">
265 <?php
266             for ($i=0;$i<16;$i++) {
267                 $VMX_TIMEOUT = (!isset($VMX_TIMEOUT) || $VMX_TIMEOUT == '')?2:$VMX_TIMEOUT;
268 ?>
269                 <option value="<?php echo $i?><?php  echo ($VMX_TIMEOUT == $i ? 'SELECTED' : '') ?>><?php echo $i?>
270 <?php
271                 }
272 ?>
273             </select></td><td><small><?php echo _("seconds")?></small>
274             </td>
275         </tr>
276         <tr>
277             <td>
278             <a href=# class="info"><?php echo _("Msg Play:")?><span>
279             <?php echo _("Number of times to play the recorded message if the caller does not press any options and it times out."); ?></span></a>
280             </td>
281             <td colspan="3" align="right">
282             <select name="VMX_REPEAT" tabindex="<?php echo ++$tabindex;?>">
283 <?php
284             for ($i=1;$i<5;$i++) {
285                 $VMX_REPEAT = (!isset($VMX_REPEAT) || $VMX_REPEAT == '')?1:$VMX_REPEAT;
286 ?>
287                 <option value="<?php echo $i?><?php  echo ($VMX_REPEAT == $i ? 'SELECTED' : '') ?>><?php echo $i?>
288 <?php
289                 }
290 ?>
291             </select></td><td><small><?php echo _("times")?></small>
292             </td>
293         </tr>
294         <tr>
295             <td>
296             <a href=# class="info"><?php echo _("Error Re-tries:")?><span>
297             <?php echo _("Number of times to play invalid options and repeat the message upon receiving an undefined option."); ?></span></a>
298             </td>
299             <td colspan="3" align="right">
300             <select name="VMX_LOOPS" tabindex="<?php echo ++$tabindex;?>">
301 <?php
302             for ($i=1;$i<5;$i++) {
303                 $VMX_REPEAT = (!isset($VMX_LOOPS) || $VMX_LOOPS == '')?1:$VMX_LOOPS;
304 ?>
305                 <option value="<?php echo $i?><?php  echo ($VMX_LOOPS == $i ? 'SELECTED' : '') ?>><?php echo $i?>
306 <?php
307                 }
308 ?>
309             </select></td><td><small><?php echo _("times")?></small>
310             </td>
311         </tr>
312     </table>
313
314 <?php
315 if (function_exists('ivr_list')) {
316   $count = sql('SELECT COUNT(*) FROM `ivr` WHERE `enable_directory` = "CHECKED"','getOne');
317   if ($count) {
318 ?>
319 <h5><?php echo _("Legacy Company Directory")?></h5>
320 <table>
321     <tr><td>
322     <a href=# class="info"><?php echo _("Find users in the Company Directory by:")?><span><?php echo _("The Company Directory allows a caller to spell the user's first name, last name, or both when searching for a user. This will select which of these modes are used.")?></span></a>
323     </td><td align="right">
324     <select name="DIRECTORY" tabindex="<?php echo ++$tabindex;?>">
325         <option value="first" <?php  echo ($DIRECTORY == 'first' ? 'SELECTED' : '')?>><?php echo _("first name")?>
326         <option value="last" <?php  echo ($DIRECTORY == 'last' ? 'SELECTED' : '')?>><?php echo _("last name")?>
327         <option value="both" <?php  echo ($DIRECTORY == 'both' ? 'SELECTED' : '')?>><?php echo _("first or last name")?>
328     </select>
329     </td></tr>
330     <tr><td>
331     <a href=# class="info"><?php echo _("Announce Extension:")?><span><?php echo _("Plays a message \"Please hold while I transfer you to extension xxx\" that lets the caller know what extension to use in the future when connecting from the company directory.")?></span></a>
332     </td><td align="right">
333     <input type="checkbox" value="e" name="DIRECTORY_OPTS" <?php  echo ($DIRECTORY_OPTS ? 'CHECKED' : '')?> tabindex="<?php echo ++$tabindex;?>">
334     </td></tr>
335 </table>
336 <?php
337   }
338 }
339 ?>
340
341 <h5><?php echo _("International Settings")?></h5>
342 <table>
343     <tr><td>
344     <a class="info" href="#"><?php echo _("Country Indications")?><span><?php echo _("Select which country you are in")?></span></a>:
345     </td><td align="right">
346     <?php     if (isset($TONEZONE) && strlen($TONEZONE))
347         general_display_zones($TONEZONE);
348         else
349         general_display_zones('us');
350         ?>
351     </td></tr>
352     <tr><td>
353     <a class="info" href="#"><?php echo _("24-hour format")?><span><?php echo _("Select Yes if you use 24-hour format or No if you are using 12-hour am/pm format")?></span></a>:
354     </td><td align="right">
355     <select name="TIMEFORMAT" tabindex="<?php echo ++$tabindex;?>">
356         <option value="IMp"><?php echo _("no"); ?></option>
357         <option value="kM" <?php echo (($TIMEFORMAT=="kM") ? 'selected="selected"' : '');?>><?php echo _("yes"); ?></option>
358     </select>
359     </td></tr>
360 </table>
361 <h5><?php echo _("Security Settings")?></h5>
362 <table>
363     <tr><td>
364     <a href=# class="info"><?php echo _("Allow Anonymous Inbound SIP Calls?")?><span>
365 <?php echo _("** WARNING **")?><br><br>
366 <?php echo _("Setting this to 'yes' will potentially allow ANYBODY to call into your Asterisk server using the SIP protocol")?><br><br>
367 <?php echo _("It should only be used if you fully understand the impact of allowing anonymous calls into your server")?><br>
368     </span></a>:
369     </td><td align="right">
370     <select name="ALLOW_SIP_ANON" tabindex="<?php echo ++$tabindex;?>">
371     <option value="no"><?php echo _("no"); ?></option>
372     <option <?php if ($ALLOW_SIP_ANON == "yes") echo "SELECTED "?>value="yes"><?php echo _("yes"); ?></option>
373     </select>
374     </td></tr>
375 </table>
376
377 <h5><?php echo _("Online Updates")?></h5>
378     <table>
379         <tr>
380             <td>
381             <a href=# class="info"><?php echo _("Check for Updates")?><span>
382             <?php echo _("Choosing Yes will result in the system automatically checking for updates nightly. The resulting information will be displayed in the dashboard and will be optionally emailed to the address below if provided.<br />This will transmit your FreePBX and Asterisk version numbers along with a unique but random identifier. This is used to provide proper update information and to track version usage to focus development and maintenance efforts. No private information is transmitted."); ?></span></a>
383             </td>
384             <td align=right>
385             <select name="online_updates" tabindex="<?php echo ++$tabindex;?>">
386                 <option value="yes"  <?php  echo ($online_updates == 'yes' ? 'SELECTED' : '')?>><?php echo _("Yes")?>
387                 <option value="no"   <?php  echo ($online_updates == 'no'  ? 'SELECTED' : '')?>><?php echo _("No")?>
388             </select>
389             </td>
390         </tr>
391         <tr>
392             <td>
393             <a href=# class="info"><?php echo _("Update Email")?><span>
394             <?php echo _("Email address where online updates will be sent. Leaving blank will result in no updates being sent."); ?></span></a>
395             </td>
396             <td>
397                 <input type="text" size="40" name="update_email" value="<?php  echo htmlspecialchars($update_email)?>" tabindex="<?php echo ++$tabindex;?>"/>
398             </td>
399         </tr>
400     </table>
401 <h6>
402     <input name="Submit" type="submit" value="<?php echo _("Submit Changes")?>" tabindex="<?php echo ++$tabindex;?>">
403 </h6>
404 <script language="javascript">
405 <!--
406
407 var theForm = document.general;
408
409 function hasRing (s) {
410     if (s.indexOf('r') >= 0) {
411         return true;
412     } else {
413         return false;
414     }
415 }
416
417 function warnConfirm (theField, s) {
418     theField.focus();
419     theField.select();
420         return confirm(s);
421 }
422
423 function general_onsubmit() {
424     var msgInvalidSeconds = "<?php echo _('Please enter a valid Number of Seconds'); ?>";
425     var msgInvalidDefaultFaxEmail = "<?php echo _('Please enter a valid Fax Email'); ?>";
426     var msgRingOptionOutboundTrunk = "<?php echo _('You have selected the \'r\' option for your trunks. This is highly discouraged and will create problems with calls on many PRI, VoIP, ISDN and other trunks that are capable of signaling. Asterisk will generate a ringing tone until the signaling indicates the line is answered. This will result in some external IVRs being inaccessible and other strange problems.'); ?>";
427
428     defaultEmptyOK = false;
429     if (!isInteger(theForm.RINGTIMER.value))
430         return warnInvalid(theForm.RINGTIMER, msgInvalidSeconds);
431
432     // Fax email must be present if selected 'system', otherwise optional
433     if (theForm.FAX_RX.value == "system") {
434         defaultEmptyOK = false;
435     } else {
436         defaultEmptyOK = true;
437     }
438     if (!isEmail(theForm.FAX_RX_EMAIL.value))
439         return warnInvalid(theForm.FAX_RX_EMAIL, msgInvalidDefaultFaxEmail);
440
441     if (hasRing(theForm.TRUNK_OPTIONS.value))
442         return warnConfirm(theForm.TRUNK_OPTIONS, msgRingOptionOutboundTrunk);
443    
444     return true;
445 }
446
447 //-->
448 </script>
449 </form>
450
451
Note: See TracBrowser for help on using the browser.