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

Revision 5516, 20.3 kB (checked in by p_lindheimer, 5 years ago)

add additonal information to automoatic update tooltip to describe version info that is trasmitted

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 <?php /* $Id$ */
2 //Copyright (C) 2004 Coalescent Systems Inc. (info@coalescentsystems.ca)
3 //
4 //This program is free software; you can redistribute it and/or
5 //modify it under the terms of the GNU General Public License
6 //as published by the Free Software Foundation; either version 2
7 //of the License, or (at your option) any later version.
8 //
9 //This program 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 $action = isset($_REQUEST['action'])?$_REQUEST['action']:'';
15
16 $cm =& cronmanager::create($db);
17
18
19 //if submitting form, update database
20 if ($action == 'editglobals') {
21     $globalfields = array(
22                         array($_REQUEST['RINGTIMER'],'RINGTIMER'),
23                         array($_REQUEST['FAX_RX'],'FAX_RX'),
24                         array($_REQUEST['FAX_RX_EMAIL'],'FAX_RX_EMAIL'),
25                         array($_REQUEST['FAX_RX_FROM'],'FAX_RX_FROM'),
26                         array($_REQUEST['DIRECTORY'],'DIRECTORY'),
27                         array($_REQUEST['VM_PREFIX'],'VM_PREFIX'),
28                         array($_REQUEST['VM_DDTYPE'],'VM_DDTYPE'),
29                         array($_REQUEST['VM_GAIN'],'VM_GAIN'),
30                         array($_REQUEST['DIAL_OPTIONS'],'DIAL_OPTIONS'),
31                         array($_REQUEST['TRUNK_OPTIONS'],'TRUNK_OPTIONS'),
32                         array($_REQUEST['TONEZONE'], 'TONEZONE'),
33                         array($_REQUEST['TIMEFORMAT'], 'TIMEFORMAT'),
34                         array($_REQUEST['ALLOW_SIP_ANON'], 'ALLOW_SIP_ANON'),
35                         array($_REQUEST['OPERATOR_XTN'], 'OPERATOR_XTN'),
36                         array(isset($_REQUEST['DIRECTORY_OPTS']) ? $_REQUEST['DIRECTORY_OPTS'] : "",'DIRECTORY_OPTS'),
37                         array(isset($_REQUEST['VM_OPTS']) ? $_REQUEST['VM_OPTS'] : "",'VM_OPTS'),
38
39                         array(isset($_REQUEST['VMX_CONTEXT']) ? $_REQUEST['VMX_CONTEXT'] : "",'VMX_CONTEXT'),
40                         array(isset($_REQUEST['VMX_PRI']) ? $_REQUEST['VMX_PRI'] : "",'VMX_PRI'),
41                         array(isset($_REQUEST['VMX_TIMEDEST_CONTEXT']) ? $_REQUEST['VMX_TIMEDEST_CONTEXT'] : "",'VMX_TIMEDEST_CONTEXT'),
42                         array(isset($_REQUEST['VMX_TIMEDEST_EXT']) ? $_REQUEST['VMX_TIMEDEST_EXT'] : "",'VMX_TIMEDEST_EXT'),
43                         array(isset($_REQUEST['VMX_TIMEDEST_PRI']) ? $_REQUEST['VMX_TIMEDEST_PRI'] : "",'VMX_TIMEDEST_PRI'),
44                         array(isset($_REQUEST['VMX_LOOPDEST_CONTEXT']) ? $_REQUEST['VMX_LOOPDEST_CONTEXT'] : "",'VMX_LOOPDEST_CONTEXT'),
45                         array(isset($_REQUEST['VMX_LOOPDEST_EXT']) ? $_REQUEST['VMX_LOOPDEST_EXT'] : "",'VMX_LOOPDEST_EXT'),
46                         array(isset($_REQUEST['VMX_LOOPDEST_PRI']) ? $_REQUEST['VMX_LOOPDEST_PRI'] : "",'VMX_LOOPDEST_PRI'),
47                         array(isset($_REQUEST['VMX_OPTS_TIMEOUT']) ? $_REQUEST['VMX_OPTS_TIMEOUT'] : "",'VMX_OPTS_TIMEOUT'),
48                         array(isset($_REQUEST['VMX_OPTS_LOOP']) ? $_REQUEST['VMX_OPTS_LOOP'] : "",'VMX_OPTS_LOOP'),
49                         array(isset($_REQUEST['VMX_OPTS_DOVM']) ? $_REQUEST['VMX_OPTS_DOVM'] : "",'VMX_OPTS_DOVM'),
50                         array(isset($_REQUEST['VMX_TIMEOUT']) ? $_REQUEST['VMX_TIMEOUT'] : "",'VMX_TIMEOUT'),
51                         array(isset($_REQUEST['VMX_REPEAT']) ? $_REQUEST['VMX_REPEAT'] : "",'VMX_REPEAT'),
52                         array(isset($_REQUEST['VMX_LOOPS']) ? $_REQUEST['VMX_LOOPS'] : "",'VMX_LOOPS'),
53                         );
54
55     $compiled = $db->prepare('UPDATE globals SET value = ? WHERE variable = ?');
56     //$compiled = $db->prepare('REPLACE INTO globals (value,variable) VALUES (?, ?)');
57     $result = $db->executeMultiple($compiled,$globalfields);
58     if(DB::IsError($result)) {
59         echo $action.'<br>';
60         die_freepbx($result->getMessage());
61     }
62     
63     /* update online updates and email as appropriate
64     */
65     $online_updates = isset($_REQUEST['online_updates'])? $_REQUEST['online_updates'] : 'yes';
66     $update_email   = isset($_REQUEST['update_email'])  ? $_REQUEST['update_email']   : '';
67
68     if ($online_updates == 'yes') {
69         $cm->enable_updates();
70     } else {
71         $cm->disable_updates();
72     }
73
74     // TODO: maybe check the email address a bit better server/client side
75     //
76     $cm->save_email($update_email);
77     
78     //indicate 'need reload' link in header.php
79     needreload();
80 }
81
82 $online_updates = $cm->updates_enabled() ? 'yes' : 'no';
83 $update_email   = $cm->get_email();
84
85 //get all rows relating to selected account
86 $sql = "SELECT * FROM globals";
87 $globals = $db->getAll($sql);
88 if(DB::IsError($globals)) {
89 die_freepbx($globals->getMessage());
90 }
91
92 //create a set of variables that match the items in global[0]
93 foreach ($globals as $global) {
94     ${trim($global[0])} = $global[1];   
95 }
96
97 ?>
98
99 <form name="general" action="config.php" method="post" onsubmit="return general_onsubmit();">
100 <input type="hidden" name="display" value="general"/>
101 <input type="hidden" name="action" value="editglobals"/>
102
103 <h5><?php echo _("Dialing Options")?></h5>
104 <p>
105     <a href=# class="info"><?php echo _("Asterisk Dial command options:")?><span><br>
106 <?php echo _("t: Allow the called user to transfer the call by hitting #")?><br>
107 <?php echo _("T: Allow the calling user to transfer the call by hitting #")?><br>
108 <?php echo _("r: Generate a ringing tone for the calling party")?><br>
109 <?php echo _("w: Allow the called user to start recording after pressing *1 (Asterisk v1.2)")?><br>
110 <?php echo _("W: Allow the calling user to start recording after pressing *1 (Asterisk v1.2)")?><br>
111     </span></a>
112     <input type="text" size="2" name="DIAL_OPTIONS" value="<?php  echo htmlspecialchars($DIAL_OPTIONS)?>"/>
113     <br><br>
114     <a href=# class="info"><?php echo _("Asterisk Outbound Dial command options:")?><span><br>
115 <?php echo _("t: Allow the called user to transfer the call by hitting #")?><br>
116 <?php echo _("T: Allow the calling user to transfer the call by hitting #")?><br>
117 <?php echo _("w: Allow the called user to start recording after pressing *1 (Asterisk v1.2)")?><br>
118 <?php echo _("W: Allow the calling user to start recording after pressing *1 (Asterisk v1.2)")?><br>
119 <?php echo _("r: You SHOULD NOT use this option on outbound trunks")?><br>
120     </span></a>
121     <input type="text" size="2" name="TRUNK_OPTIONS" value="<?php  echo htmlspecialchars($TRUNK_OPTIONS)?>"/>
122 </p>
123
124 <h5><?php echo _("Voicemail")?></h5>
125 <p>
126     <?php echo _("Number of seconds to ring phones before sending callers to voicemail:")?>
127     <input type="text" size="2" name="RINGTIMER" value="<?php  echo htmlspecialchars($RINGTIMER)?>"/>
128     <br><br>
129     <?php echo _("Extension prefix for dialing direct to voicemail:")?>
130     <input type="text" size="2" name="VM_PREFIX" value="<?php  echo htmlspecialchars($VM_PREFIX)?>"/>
131     <br><br>
132     <?php echo _("Direct Dial to Voicemail message type:")?>
133     <select name="VM_DDTYPE">
134     <option value=""><?php echo _("Default"); ?></option>
135     <option value="u"<?php if ($VM_DDTYPE == "u") echo " SELECTED"; ?>><?php echo _("Unavailable"); ?></option>
136     <option value="su"<?php if ($VM_DDTYPE == "su") echo " SELECTED"; ?>><?php echo _("Unavailable")."--"._("no instructions"); ?></option>
137     <option value="b"<?php if ($VM_DDTYPE == "b") echo " SELECTED"; ?>><?php echo _("Busy"); ?></option>
138     <option value="sb"<?php if ($VM_DDTYPE == "sb") echo " SELECTED"; ?>><?php echo _("Busy")."--"._("no instructions"); ?></option>
139     <option value="s"<?php if ($VM_DDTYPE == "s") echo " SELECTED"; ?>><?php echo ("No Message"); ?></option>
140     </select>
141     <br><br>
142     <a href=# class="info"><?php echo _("Use gain when recording the voicemail message (optional):")?><span>
143     <?php echo _("Use the specified amount of gain when recording the voicemail message."); ?><br><br>
144     <?php echo _("The units are whole-number decibels (dB)."); ?></span></a>
145     <input type="text" size="2" name="VM_GAIN" value="<?php  echo htmlspecialchars($VM_GAIN)?>"/>
146     <br><br>
147     <input type="checkbox" value="s" name="VM_OPTS" <?php  echo ($VM_OPTS ? 'CHECKED' : '')?>> <a href=# class="info"><?php echo _("Do Not Play")?><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> <?php echo _("please leave message after tone to caller")?>
148 </p>
149
150 <h5><?php echo _("Voicemail VmX Locator")?></h5>
151     <table>
152         <tr>
153             <td>
154             <a href=# class="info"><?php echo _("Default Context & Pri:")?><span>
155             <?php echo _("Default to use if only an number/extension are provided."); ?></span></a>
156             </td>
157             <td><input type="text" size="18" name="VMX_CONTEXT" value="<?php  echo htmlspecialchars($VMX_CONTEXT)?>"/><small><?php echo _("context")?></small></td>
158             <td></td>
159             <td><input type="text" size="2" name="VMX_PRI" value="<?php  echo htmlspecialchars($VMX_PRI)?>"/><small><?php echo _("pri")?></small></td>
160         </tr>
161         <tr>
162             <td>
163             <a href=# class="info"><?php echo _("Timeout/#-press default:")?><span>
164             <?php echo _("This is the default location that a caller will be sent if they don't press any key (timeout) or press # which is interpreted as a timeout. Set this to 'dovm' to go to voicemail (default)."); ?></span></a>
165             </td>
166             <td><input type="text" size="18" name="VMX_TIMEDEST_CONTEXT" value="<?php  echo htmlspecialchars($VMX_TIMEDEST_CONTEXT)?>"/><small><?php echo _("context")?></small></td>
167             <td><input type="text" size="4" name="VMX_TIMEDEST_EXT" value="<?php  echo htmlspecialchars($VMX_TIMEDEST_EXT)?>"/><small><?php echo _("exten")?></small></td>
168             <td><input type="text" size="2" name="VMX_TIMEDEST_PRI" value="<?php  echo htmlspecialchars($VMX_TIMEDEST_PRI)?>"/><small><?php echo _("pri")?></small></td>
169         </tr>
170         <tr>
171             <td>
172             <a href=# class="info"><?php echo _("Loop Exceed default:")?><span>
173             <?php echo _("This is the default location that a caller will be sent if they press an invalid options too man times, as defined by the Maximum Loops count. Set this to 'dovm' to go to voicemail (default)."); ?></span></a>
174             </td>
175             <td><input type="text" size="18" name="VMX_LOOPDEST_CONTEXT" value="<?php  echo htmlspecialchars($VMX_LOOPDEST_CONTEXT)?>"/><small><?php echo _("context")?></small></td>
176             <td><input type="text" size="4" name="VMX_LOOPDEST_EXT" value="<?php  echo htmlspecialchars($VMX_LOOPDEST_EXT)?>"/><small><?php echo _("exten")?></small></td>
177             <td><input type="text" size="2" name="VMX_LOOPDEST_PRI" value="<?php  echo htmlspecialchars($VMX_LOOPDEST_PRI)?>"/><small><?php echo _("pri")?></small></td>
178         </tr>
179         <tr>
180             <td>
181             <a href=# class="info"><?php echo _("Timeout VM Msg:")?><span>
182             <?php echo _("If this destination is voicemail, select whether or not to play the standard voicemail instructions or just beep."); ?></span></a>
183             </td>
184             <td align=right>
185             <select name="VMX_OPTS_TIMEOUT">
186                 <option value=""  <?php  echo ($VMX_OPTS_TIMEOUT == '' ? 'SELECTED' : '') ?>><?php echo _("Std Instructions")?>
187                 <option value="s" <?php  echo ($VMX_OPTS_TIMEOUT == 's' ? 'SELECTED' : '')?>><?php echo _("Beep Only")?>
188             </select>
189             </td>
190         </tr>
191         <tr>
192             <td>
193             <a href=# class="info"><?php echo _("Max Loop VM Msg:")?><span>
194             <?php echo _("If this destination is voicemail, select whether or not to play the standard voicemail instructions or just beep."); ?></span></a>
195             </td>
196             <td align=right>
197             <select name="VMX_OPTS_LOOP">
198                 <option value=""  <?php  echo ($VMX_OPTS_LOOP == '' ? 'SELECTED' : '') ?>><?php echo _("Std Instructions")?>
199                 <option value="s" <?php  echo ($VMX_OPTS_LOOP == 's' ? 'SELECTED' : '')?>><?php echo _("Beep Only")?>
200             </select>
201             </td>
202         </tr>
203         <tr>
204             <td>
205             <a href=# class="info"><?php echo _("Direct VM Option")?><span>
206             <?php echo _("If a user defined option is to go to voicmail (using the 'dovm' extension) this is the default option if not specified by the user's settings."); ?></span></a>
207             </td>
208             <td align=right>
209             <select name="VMX_OPTS_DOVM">
210                 <option value=""  <?php  echo ($VMX_OPTS_DOVM == '' ? 'SELECTED' : '') ?>><?php echo _("Std Instructions")?>
211                 <option value="s" <?php  echo ($VMX_OPTS_DOVM == 's' ? 'SELECTED' : '')?>><?php echo _("Beep Only")?>
212             </select>
213             </td>
214         </tr>
215         <tr>
216             <td>
217             <a href=# class="info"><?php echo _("Msg Timeout:")?><span>
218             <?php echo _("Time ot wait after message has played to timeout and/or repeat the message if no entry pressed."); ?></span></a>
219             </td>
220             <td align=right>
221             <select name="VMX_TIMEOUT">
222 <?php
223             for ($i=0;$i<16;$i++) {
224                 $VMX_TIMEOUT = (!isset($VMX_TIMEOUT) || $VMX_TIMEOUT == '')?2:$VMX_TIMEOUT;
225 ?>
226                 <option value="<?php echo $i?><?php  echo ($VMX_TIMEOUT == $i ? 'SELECTED' : '') ?>><?php echo $i?>
227 <?php
228                 }
229 ?>
230             </select></td><td><small><?php echo _("seconds")?></small>
231             </td>
232         </tr>
233         <tr>
234             <td>
235             <a href=# class="info"><?php echo _("Msg Play:")?><span>
236             <?php echo _("Number of times to play the recorded message if the caller does not press any options and it times out."); ?></span></a>
237             </td>
238             <td align=right>
239             <select name="VMX_REPEAT">
240 <?php
241             for ($i=1;$i<5;$i++) {
242                 $VMX_REPEAT = (!isset($VMX_REPEAT) || $VMX_REPEAT == '')?1:$VMX_REPEAT;
243 ?>
244                 <option value="<?php echo $i?><?php  echo ($VMX_REPEAT == $i ? 'SELECTED' : '') ?>><?php echo $i?>
245 <?php
246                 }
247 ?>
248             </select></td><td><small><?php echo _("times")?></small>
249             </td>
250         </tr>
251         <tr>
252             <td>
253             <a href=# class="info"><?php echo _("Error Re-tries:")?><span>
254             <?php echo _("Number of times to play invalid options and repeat the message upon receiving an undefined option."); ?></span></a>
255             </td>
256             <td align=right>
257             <select name="VMX_LOOPS">
258 <?php
259             for ($i=1;$i<5;$i++) {
260                 $VMX_REPEAT = (!isset($VMX_LOOPS) || $VMX_LOOPS == '')?1:$VMX_LOOPS;
261 ?>
262                 <option value="<?php echo $i?><?php  echo ($VMX_LOOPS == $i ? 'SELECTED' : '') ?>><?php echo $i?>
263 <?php
264                 }
265 ?>
266             </select></td><td><small><?php echo _("times")?></small>
267             </td>
268         </tr>
269     </table>
270 <p>
271
272 </p>
273
274 <h5><?php echo _("Company Directory")?></h5>
275 <p>
276     <?php echo _("Find users in the Company Directory by:")?>
277     <select name="DIRECTORY">
278         <option value="first" <?php  echo ($DIRECTORY == 'first' ? 'SELECTED' : '')?>><?php echo _("first name")?>
279         <option value="last" <?php  echo ($DIRECTORY == 'last' ? 'SELECTED' : '')?>><?php echo _("last name")?>
280         <option value="both" <?php  echo ($DIRECTORY == 'both' ? 'SELECTED' : '')?>><?php echo _("first or last name")?>
281     </select>
282     <br><br>
283     <input type="checkbox" value="e" name="DIRECTORY_OPTS" <?php  echo ($DIRECTORY_OPTS ? 'CHECKED' : '')?>> <a href=# class="info"><?php echo _("Play extension number")?><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.")?></span></a> <?php echo _("to caller before transferring call")?><br><br>
284     <a href=# class="info"><?php echo _("Operator Extension:")?><span>
285     <?php echo _("When users hit '0' in the directory, they are put through to this number. Note that it"); ?>
286     <?php echo _(" does NOT need to be an extension, it can be a Ring Group, or even an external number."); ?></span></a>
287     <input type="text" size="10" name="OPERATOR_XTN" value="<?php  echo htmlspecialchars($OPERATOR_XTN)?>"/>
288 </p>
289 <h5><?php echo _("Fax Machine")?></h5>
290 <p>
291     <?php echo _("Extension of")?> <a class="info" href="#"><?php echo _("fax machine")?><span><?php echo _("Select 'system' to have the system receive and email faxes.<br>Selecting 'disabled' will result in incoming calls being answered more quickly.")?></span></a> <?php echo _("for receiving faxes:")?>
292     <!--<input type="text" size="8" name="FAX_RX" value="<?php  echo $FAX_RX?>"/>-->
293     <select name="FAX_RX">
294         <option value="disabled" <?php  echo ($FAX_RX == 'disabled' ? 'SELECTED' : '')?>><?php echo _("disabled")?>
295         <option value="system" <?php  echo ($FAX_RX == 'system' ? 'SELECTED' : '')?>><?php echo _("system")?>
296 <?php
297     //get unique devices
298     $devices = core_devices_list();
299     if (isset($devices)) {
300         foreach ($devices as $device) {
301             echo '<option value="'.$device[0].'" '.($FAX_RX == $device[0] ? 'SELECTED' : '').'>'.$device[1].' &lt;'.$device[0].'&gt;';
302         }
303     }
304 ?>    
305     </select>
306    
307 </p>
308 <p>
309     <a class="info" href="#"><?php echo _("Email address")?><span><?php echo _("Email address used if 'system' has been chosen for the fax extension above.")?></span></a> <?php echo _("to have faxes emailed to:")?>
310     <input type="text" size="20" name="FAX_RX_EMAIL" value="<?php  echo htmlspecialchars($FAX_RX_EMAIL)?>"/>
311 </p>
312 <p>
313     <a class="info" href="#"><?php echo _("Email address")?><span><?php echo _("Email address that faxes appear to come from if 'system' has been chosen for the fax extension above.")?></span></a> <?php echo _("that faxes appear to come from:")?>
314     <input type="text" size="20" name="FAX_RX_FROM" value="<?php  echo htmlspecialchars($FAX_RX_FROM)?>"/>
315 </p>
316 <h5><?php echo _("International Settings")?></h5>
317 <p>
318     <?php echo _("Country")?> <a class="info" href="#"><?php echo _("Indications")?><span><?php echo _("Select which country you are in")?></span></a>&nbsp;
319     <?php     if (isset($TONEZONE) && strlen($TONEZONE))
320         general_display_zones($TONEZONE);
321         else
322         general_display_zones('us');
323         ?>
324 </p>
325 <p>
326     <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>&nbsp;
327     <select name="TIMEFORMAT">
328         <option value="IMp"><?php echo _("no"); ?></option>
329         <option value="kM" <?php echo (($TIMEFORMAT=="kM") ? 'selected="selected"' : '');?>><?php echo _("yes"); ?></option>
330     </select>
331 </p>
332 <h5><?php echo _("Security Settings")?></h5>
333 <p>
334     <a href=# class="info"><?php echo _("Allow Anonymous Inbound SIP Calls?")?><span><br>
335 <?php echo _("** WARNING **")?><br><br>
336 <?php echo _("Setting this to 'yes' will potentially allow ANYBODY to call into your Asterisk server using the SIP protocol")?><br><br>
337 <?php echo _("It should only be used if you fully understand the impact of allowing anonymous calls into your server")?><br>
338     </span></a>&nbsp;
339     <select name="ALLOW_SIP_ANON">
340     <option value="no"><?php echo _("no"); ?></option>
341     <option <?php if ($ALLOW_SIP_ANON == "yes") echo "SELECTED "?>value="yes"><?php echo _("yes"); ?></option>
342     </select>
343 </p>
344
345 <h5><?php echo _("Online Updates")?></h5>
346     <table>
347         <tr>
348             <td>
349             <a href=# class="info"><?php echo _("Check for Updates")?><span>
350             <?php echo _("Choosing Yes will result in the system automatically checking for updates nighly. The resuling infomation will be displayed in the dashboard and will be optionally emailed to the address below if provided.<br />This will trasmit 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 trasmitted."); ?></span></a>
351             </td>
352             <td align=right>
353             <select name="online_updates">
354                 <option value="yes"  <?php  echo ($online_updates == 'yes' ? 'SELECTED' : '')?>><?php echo _("Yes")?>
355                 <option value="no"   <?php  echo ($online_updates == 'no'  ? 'SELECTED' : '')?>><?php echo _("No")?>
356             </select>
357             </td>
358         </tr>
359         <tr>
360             <td>
361             <a href=# class="info"><?php echo _("Update Email")?><span>
362             <?php echo _("Email address where online udpates will be sent. Leaving blank will result in no udpates being sent."); ?></span></a>
363             </td>
364             <td>
365                 <input type="text" size="40" name="update_email" value="<?php  echo htmlspecialchars($update_email)?>"/>
366             </td>
367         </tr>
368     </table>
369 <h6>
370     <input name="Submit" type="submit" value="<?php echo _("Submit Changes")?>">
371 </h6>
372 <script language="javascript">
373 <!--
374
375 var theForm = document.general;
376
377 function hasRing (s) {
378     if (s.indexOf('r') >= 0) {
379         return true;
380     } else {
381         return false;
382     }
383 }
384
385 function warnConfirm (theField, s) {
386     theField.focus();
387     theField.select();
388         return confirm(s);
389 }
390
391 function general_onsubmit() {
392     var msgInvalidSeconds = "<?php echo _('Please enter a valid Number of Seconds'); ?>";
393     var msgInvalidDefaultFaxEmail = "<?php echo _('Please enter a valid Fax Email'); ?>";
394     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 signalling. Asterisk will generate a ringing tone until the signalling indicates the line is answered. This will result in some external IVRs being inaccessible and other strange problems.'); ?>";
395
396     defaultEmptyOK = false;
397     if (!isInteger(theForm.RINGTIMER.value))
398         return warnInvalid(theForm.RINGTIMER, msgInvalidSeconds);
399
400     // Fax email must be present if selected 'system', otherwise optional
401     if (theForm.FAX_RX.value == "system") {
402         defaultEmptyOK = false;
403     } else {
404         defaultEmptyOK = true;
405     }
406     if (!isEmail(theForm.FAX_RX_EMAIL.value))
407         return warnInvalid(theForm.FAX_RX_EMAIL, msgInvalidDefaultFaxEmail);
408
409     if (hasRing(theForm.TRUNK_OPTIONS.value))
410         return warnConfirm(theForm.TRUNK_OPTIONS, msgRingOptionOutboundTrunk);
411    
412     return true;
413 }
414
415 //-->
416 </script>
417 </form>
418
419
Note: See TracBrowser for help on using the browser.