| 1 |
<?php |
|---|
| 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 |
$action = isset($_REQUEST['action'])?$_REQUEST['action']:''; |
|---|
| 20 |
$extdisplay= htmlspecialchars(isset($_REQUEST['extdisplay'])?$_REQUEST['extdisplay']:''); |
|---|
| 21 |
$old_extdisplay = $extdisplay; |
|---|
| 22 |
$dispnum = 'did'; |
|---|
| 23 |
$account = isset($_REQUEST['account'])?$_REQUEST['account']:''; |
|---|
| 24 |
$goto = isset($_REQUEST['goto0'])?$_REQUEST['goto0']:''; |
|---|
| 25 |
$ringing = isset($_REQUEST['ringing'])?$_REQUEST['ringing']:''; |
|---|
| 26 |
$description = htmlspecialchars(isset($_REQUEST['description'])?$_REQUEST['description']:''); |
|---|
| 27 |
$privacyman = isset($_REQUEST['privacyman'])?$_REQUEST['privacyman']:'0'; |
|---|
| 28 |
$pmmaxretries = isset($_REQUEST['pmmaxretries'])?$_REQUEST['pmmaxretries']:''; |
|---|
| 29 |
$pmminlength = isset($_REQUEST['pmminlength'])?$_REQUEST['pmminlength']:''; |
|---|
| 30 |
$alertinfo = htmlspecialchars(isset($_REQUEST['alertinfo'])?$_REQUEST['alertinfo']:''); |
|---|
| 31 |
$mohclass = isset($_REQUEST['mohclass'])?$_REQUEST['mohclass']:'default'; |
|---|
| 32 |
$grppre = isset($_REQUEST['grppre'])?$_REQUEST['grppre']:''; |
|---|
| 33 |
$delay_answer = isset($_REQUEST['delay_answer'])&&$_REQUEST['delay_answer']?$_REQUEST['delay_answer']:''; |
|---|
| 34 |
$pricid = isset($_REQUEST['pricid'])?$_REQUEST['pricid']:''; |
|---|
| 35 |
$rnavsort = isset($_REQUEST['rnavsort'])?$_REQUEST['rnavsort']:'description'; |
|---|
| 36 |
$didfilter = isset($_REQUEST['didfilter'])?$_REQUEST['didfilter']:''; |
|---|
| 37 |
|
|---|
| 38 |
$tabindex = 0; |
|---|
| 39 |
|
|---|
| 40 |
if (isset($_REQUEST['submitclear']) && isset($_REQUEST['goto0'])) { |
|---|
| 41 |
$_REQUEST[$_REQUEST['goto0'].'0'] = ''; |
|---|
| 42 |
} |
|---|
| 43 |
|
|---|
| 44 |
if (isset($_REQUEST['extension']) && isset($_REQUEST['cidnum'])) { |
|---|
| 45 |
$extdisplay = $_REQUEST['extension']."/".$_REQUEST['cidnum']; |
|---|
| 46 |
} |
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| 49 |
|
|---|
| 50 |
switch ($action) { |
|---|
| 51 |
case 'addIncoming': |
|---|
| 52 |
|
|---|
| 53 |
extract($_REQUEST); |
|---|
| 54 |
|
|---|
| 55 |
if (core_did_add($_REQUEST)) { |
|---|
| 56 |
needreload(); |
|---|
| 57 |
redirect_standard('extdisplay', 'extension', 'cidnum', 'didfilter', 'rnavsort'); |
|---|
| 58 |
} |
|---|
| 59 |
break; |
|---|
| 60 |
case 'delIncoming': |
|---|
| 61 |
$extarray=explode('/',$extdisplay,2); |
|---|
| 62 |
core_did_del($extarray[0],$extarray[1]); |
|---|
| 63 |
needreload(); |
|---|
| 64 |
redirect_standard('didfilter', 'rnavsort'); |
|---|
| 65 |
break; |
|---|
| 66 |
case 'edtIncoming': |
|---|
| 67 |
$extarray=explode('/',$old_extdisplay,2); |
|---|
| 68 |
if (core_did_edit($extarray[0],$extarray[1],$_REQUEST)) { |
|---|
| 69 |
needreload(); |
|---|
| 70 |
redirect_standard('extdisplay', 'extension', 'cidnum', 'didfilter', 'rnavsort'); |
|---|
| 71 |
} |
|---|
| 72 |
break; |
|---|
| 73 |
} |
|---|
| 74 |
|
|---|
| 75 |
?> |
|---|
| 76 |
</div> |
|---|
| 77 |
|
|---|
| 78 |
<?php |
|---|
| 79 |
$display_link = "config.php?display=$dispnum"; |
|---|
| 80 |
$display_add = $display_link; |
|---|
| 81 |
$display_link .= (isset($extdisplay) && $extdisplay != '') ? "&extdisplay=".$extdisplay : ''; |
|---|
| 82 |
$display_link_current = $display_link.(($rnavsort == "description") ? "&rnavsort=extension" : "&rnavsort=description"); |
|---|
| 83 |
$rnav_add = ($rnavsort == "extension") ? "&rnavsort=extension" : "&rnavsort=description"; |
|---|
| 84 |
$display_link .= $rnav_add; |
|---|
| 85 |
$display_add .= $rnav_add."&didfilter=$didfilter"; |
|---|
| 86 |
$toggle_sort = _(" (toggle sort)"); |
|---|
| 87 |
?> |
|---|
| 88 |
<div class="rnav"> |
|---|
| 89 |
<ul> |
|---|
| 90 |
<li><a <?php echo ($extdisplay=='' ? 'class="current"':'') ?> href="<?php echo $display_add?>"><?php echo _("Add Incoming Route")?></a></li> |
|---|
| 91 |
<li><a <?php echo ($didfilter=='' ? 'class="current"':'') ?> href="<?php echo ($didfilter==''?$display_link_current:$display_link)?>"><?php echo _("All DIDs").($didfilter==''?$toggle_sort:"")?></a></li> |
|---|
| 92 |
<li><a <?php echo ($didfilter=='directdid' ? 'class="current"':'') ?> href="<?php echo ($didfilter=='directdid'?$display_link_current:$display_link).'&didfilter=directdid'?>"><?php echo _("User DIDs").($didfilter=='directdid'?$toggle_sort:"")?></a></li> |
|---|
| 93 |
<li><a <?php echo ($didfilter=='incoming' ? 'class="current"':'') ?> href="<?php echo ($didfilter=='incoming'?$display_link_current:$display_link).'&didfilter=incoming'?>"><?php echo _("General DIDs").($didfilter=='incoming'?$toggle_sort:"")?></a></li> |
|---|
| 94 |
<li><a <?php echo ($didfilter=='unassigned' ? 'class="current"':'') ?> href="<?php echo ($didfilter=='unassigned'?$display_link_current:$display_link).'&didfilter=unassigned'?>"><?php echo _("Unused DIDs").($didfilter=='unassigned'?$toggle_sort:"")?></a></li><hr> |
|---|
| 95 |
<?php |
|---|
| 96 |
|
|---|
| 97 |
$inroutes = core_did_list($rnavsort); |
|---|
| 98 |
switch ($didfilter) { |
|---|
| 99 |
case 'directdid': |
|---|
| 100 |
foreach ($inroutes as $key => $did_items) { |
|---|
| 101 |
$did_dest = explode(',',$did_items['destination']); |
|---|
| 102 |
if (!isset($did_dest[0]) || $did_dest[0] != 'from-did-direct') { |
|---|
| 103 |
unset($inroutes[$key]); |
|---|
| 104 |
} |
|---|
| 105 |
} |
|---|
| 106 |
break; |
|---|
| 107 |
case 'incoming': |
|---|
| 108 |
foreach ($inroutes as $key => $did_items) { |
|---|
| 109 |
$did_dest = explode(',',$did_items['destination']); |
|---|
| 110 |
if (!isset($did_dest[0]) || $did_dest[0] == 'from-did-direct') { |
|---|
| 111 |
unset($inroutes[$key]); |
|---|
| 112 |
} |
|---|
| 113 |
} |
|---|
| 114 |
break; |
|---|
| 115 |
case 'unassigned': |
|---|
| 116 |
foreach ($inroutes as $key => $did_items) { |
|---|
| 117 |
if (isset($did_items['destination']) && $did_items['destination'] != '') { |
|---|
| 118 |
unset($inroutes[$key]); |
|---|
| 119 |
} |
|---|
| 120 |
} |
|---|
| 121 |
break; |
|---|
| 122 |
default: |
|---|
| 123 |
} |
|---|
| 124 |
if (isset($inroutes)) { |
|---|
| 125 |
foreach ($inroutes as $inroute) { |
|---|
| 126 |
$displaydid = ( (trim($inroute['extension']) == "") ? _("any DID") : $inroute['extension'] ); |
|---|
| 127 |
$displaycid = ( (trim($inroute['cidnum']) == "") ? _("any CID") : $inroute['cidnum'] ); |
|---|
| 128 |
$desc = ( empty($inroute['description'])? "" : htmlspecialchars($inroute['description'])."<br />" ); |
|---|
| 129 |
echo "\t<li><a ".($extdisplay==$inroute['extension']."/".$inroute['cidnum'] ? 'class="current"':'')." href=\"config.php?display=$dispnum&didfilter=$didfilter&rnavsort=$rnavsort&extdisplay=".urlencode($inroute['extension'])."/".urlencode($inroute['cidnum'])."\">{$desc} {$displaydid} / {$displaycid} </a></li>\n"; |
|---|
| 130 |
} |
|---|
| 131 |
} |
|---|
| 132 |
?> |
|---|
| 133 |
</ul> |
|---|
| 134 |
</div> |
|---|
| 135 |
|
|---|
| 136 |
<div class="content"> |
|---|
| 137 |
<?php |
|---|
| 138 |
if ($action == 'delIncoming') { |
|---|
| 139 |
echo '<br><h3>Route '.$extdisplay.' '._("deleted").'!</h3><br><br><br><br><br><br><br><br>'; |
|---|
| 140 |
} else { |
|---|
| 141 |
?> |
|---|
| 142 |
<?php |
|---|
| 143 |
if ($extdisplay) { |
|---|
| 144 |
|
|---|
| 145 |
$extarray=explode('/',$extdisplay,2); |
|---|
| 146 |
$ininfo=core_did_get($extarray[0],$extarray[1]); |
|---|
| 147 |
if (is_array($ininfo) && !empty($ininfo)) { |
|---|
| 148 |
extract($ininfo); |
|---|
| 149 |
$description = htmlspecialchars($description); |
|---|
| 150 |
$extension = htmlspecialchars($extension); |
|---|
| 151 |
$cidnum = htmlspecialchars($cidnum); |
|---|
| 152 |
$alertinfo = htmlspecialchars($alertinfo); |
|---|
| 153 |
$grppre = htmlspecialchars($grppre); |
|---|
| 154 |
|
|---|
| 155 |
$delete_url = true; |
|---|
| 156 |
?> |
|---|
| 157 |
<h2><?php echo _("Route")?>: <?php echo !empty($description)?$description:$extdisplay; ?></h2> |
|---|
| 158 |
<?php |
|---|
| 159 |
} else { |
|---|
| 160 |
$extension = $extarray[0]; |
|---|
| 161 |
$cidnum = $extarray[1]; |
|---|
| 162 |
$delete_url = false; |
|---|
| 163 |
$extdisplay = ''; |
|---|
| 164 |
?> |
|---|
| 165 |
<h2><?php echo _("Add Incoming Route")?></h2> |
|---|
| 166 |
<?php |
|---|
| 167 |
} |
|---|
| 168 |
|
|---|
| 169 |
if ($delete_url) { |
|---|
| 170 |
$delURL = $_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING']."&action=delIncoming&didfilter=$didfilter&rnavsort=$rnavsort"; |
|---|
| 171 |
$tlabel = sprintf(_("Delete Route %s"),!empty($description)?$description:$extdisplay); |
|---|
| 172 |
$label = '<span><img width="16" height="16" border="0" title="'.$tlabel.'" alt="" src="images/core_delete.png"/> '.$tlabel.'</span>'; |
|---|
| 173 |
echo "<p><a href=".$delURL.">".$label."</a></p>"; |
|---|
| 174 |
} |
|---|
| 175 |
|
|---|
| 176 |
// |
|---|
| 177 |
$did_dest = explode(',',$destination); |
|---|
| 178 |
if (isset($did_dest[0]) && $did_dest[0] == 'from-did-direct') { |
|---|
| 179 |
|
|---|
| 180 |
if (isset($amp_conf["AMPEXTENSIONS"]) && ($amp_conf["AMPEXTENSIONS"] == "deviceanduser")) { |
|---|
| 181 |
$editURL = $_SERVER['PHP_SELF'].'?display=users&extdisplay='.$did_dest[1]; |
|---|
| 182 |
$EXTorUSER = _("User"); |
|---|
| 183 |
} |
|---|
| 184 |
else { |
|---|
| 185 |
$editURL = $_SERVER['PHP_SELF'].'?display=extensions&extdisplay='.$did_dest[1]; |
|---|
| 186 |
$EXTorUSER = _("Extension"); |
|---|
| 187 |
} |
|---|
| 188 |
$result = core_users_get($did_dest[1]); |
|---|
| 189 |
$label = '<span><img width="16" height="16" border="0" title="'.sprintf(_("Edit %s"),$EXTorUSER).'" alt="" src="images/user_edit.png"/> '.sprintf(_("Edit %s %s (%s)"),$EXTorUSER, $did_dest[1],$result['name']).'</span>'; |
|---|
| 190 |
echo "<p><a href=".$editURL.">".$label."</a></p>"; |
|---|
| 191 |
} |
|---|
| 192 |
?> |
|---|
| 193 |
<?php |
|---|
| 194 |
} else { |
|---|
| 195 |
?> |
|---|
| 196 |
<h2><?php echo _("Add Incoming Route")?></h2> |
|---|
| 197 |
<?php |
|---|
| 198 |
} |
|---|
| 199 |
?> |
|---|
| 200 |
<form name="editGRP" action="<?php $_SERVER['PHP_SELF'] ?>" method="post" onsubmit="return editGRP_onsubmit();"> |
|---|
| 201 |
<input type="hidden" name="display" value="<?php echo $dispnum?>"> |
|---|
| 202 |
<input type="hidden" name="action" value="<?php echo ($extdisplay ? 'edtIncoming' : 'addIncoming') ?>"> |
|---|
| 203 |
<input type="hidden" name="extdisplay" value="<?php echo $extdisplay ?>"> |
|---|
| 204 |
<input type="hidden" name="didfilter" value="<?php echo $didfilter ?>"> |
|---|
| 205 |
<input type="hidden" name="rnavsort" value="<?php echo $rnavsort ?>"> |
|---|
| 206 |
<table> |
|---|
| 207 |
<tr><td colspan="2"><h5><?php echo ($extdisplay ? _('Edit Incoming Route') : _('Add Incoming Route')) ?><hr></h5></td></tr> |
|---|
| 208 |
<tr> |
|---|
| 209 |
<td><a href="#" class="info"><?php echo _("Description")?><span><?php echo _('Provide a meaningful description of what this incoming route is')?></span></a>:</td> |
|---|
| 210 |
<td><input type="text" name="description" value="<?php echo isset($description)?$description:''; ?>" tabindex="<?php echo ++$tabindex;?>"></td> |
|---|
| 211 |
</tr> |
|---|
| 212 |
<tr> |
|---|
| 213 |
<td><a href="#" class="info"><?php echo _("DID Number")?><span><?php echo _('Define the expected DID Number if your trunk passes DID on incoming calls. <br><br>Leave this blank to match calls with any or no DID info.<br><br>You can also use a pattern match (eg _2[345]X) to match a range of numbers')?></span></a>:</td> |
|---|
| 214 |
<td><input type="text" name="extension" value="<?php echo isset($extension)?$extension:''; ?>" tabindex="<?php echo ++$tabindex;?>"></td> |
|---|
| 215 |
</tr> |
|---|
| 216 |
<tr> |
|---|
| 217 |
<td><a href="#" class="info"><?php echo _("CallerID Number")?><span><?php echo _('Define the CallerID Number to be matched on incoming calls.<br><br>Leave this field blank to match any or no CID info. In addition to standard dial sequences, you can also put Private, Blocked, Unknown, Restricted, Anonymous and Unavailable in order to catch these special cases if the Telco transmits them.')?></span></a>:</td> |
|---|
| 218 |
<td><input type="text" name="cidnum" value="<?php echo isset($cidnum)?$cidnum:'' ?>" tabindex="<?php echo ++$tabindex;?>"></td> |
|---|
| 219 |
</tr> |
|---|
| 220 |
|
|---|
| 221 |
<tr> |
|---|
| 222 |
<td><a href="#" class="info"><?php echo _("CID Priority Route")?><span><?php echo _('This effects CID ONLY routes where no DID is specified. If checked, calls with this CID will be routed to this route, even if there is a route to the DID that was called. Normal behavior is for the DID route to take the calls. If there is a specific DID/CID route for this CID, that route will still take the call when that DID is called.')?></span></a>:</td> |
|---|
| 223 |
<td><input type="checkbox" name="pricid" value="CHECKED" <?php echo $pricid ?> tabindex="<?php echo ++$tabindex;?>"/></td> |
|---|
| 224 |
</tr> |
|---|
| 225 |
|
|---|
| 226 |
<tr><td colspan="2"><h5><?php echo _("Options")?><hr></h5></td></tr> |
|---|
| 227 |
<tr> |
|---|
| 228 |
<td><a href="#" class="info"><?php echo _("Alert Info")?><span><?php echo _('ALERT_INFO can be used for distinctive ring with SIP devices.')?></span></a>:</td> |
|---|
| 229 |
<td><input type="text" name="alertinfo" size="10" value="<?php echo $alertinfo ?>" tabindex="<?php echo ++$tabindex;?>"></td> |
|---|
| 230 |
</tr> |
|---|
| 231 |
<tr> |
|---|
| 232 |
<td><a href="#" class="info"><?php echo _("CID name prefix")?><span><?php echo _('You can optionally prefix the CallerID name. ie: If you prefix with "Sales:", a call from John Doe would display as "Sales:John Doe" on the extensions that ring.')?></span></a>:</td> |
|---|
| 233 |
<td><input type="text" name="grppre" size="10" value="<?php echo $grppre ?>" tabindex="<?php echo ++$tabindex;?>"></td> |
|---|
| 234 |
</tr> |
|---|
| 235 |
<?php if (function_exists('music_list')) { ?> |
|---|
| 236 |
<tr> |
|---|
| 237 |
<td><a href="#" class="info"><?php echo _("Music On Hold")?><span><?php echo _("Set the MoH class that will be used for calls that come in on this route. For example, choose a type appropriate for routes coming in from a country which may have announcements in their language.")?></span></a>:</td> |
|---|
| 238 |
<td> |
|---|
| 239 |
<select name="mohclass" tabindex="<?php echo ++$tabindex;?>"> |
|---|
| 240 |
<?php |
|---|
| 241 |
$tresults = music_list(); |
|---|
| 242 |
$cur = (isset($mohclass) && $mohclass != "" ? $mohclass : 'default'); |
|---|
| 243 |
|
|---|
| 244 |
if (isset($tresults[0])) { |
|---|
| 245 |
$tresults as $tresult) { |
|---|
| 246 |
$tresult == 'none' ? $ttext = _("No Music") : $ttext = $tresult); |
|---|
| 247 |
$tresult == 'default' ? $ttext = _("Default") : $ttext = $tresult); |
|---|
| 248 |
'<option value="'.$tresult.'"'.($tresult == $cur ? ' SELECTED' : '').'>'._($ttext)."</option>\n"; |
|---|
| 249 |
|
|---|
| 250 |
|
|---|
| 251 |
?> |
|---|
| 252 |
</select> |
|---|
| 253 |
</td> |
|---|
| 254 |
</tr> |
|---|
| 255 |
<?php } ?> |
|---|
| 256 |
<tr> |
|---|
| 257 |
<td><a href="#" class="info"><?php echo _("Signal RINGING")?><span><?php echo _('Some devices or providers require RINGING to be sent before ANSWER. You\'ll notice this happening if you can send calls directly to a phone, but if you send it to an IVR, it won\'t connect the call.')?></span></a>:</td> |
|---|
| 258 |
<td><input type="checkbox" name="ringing" value="CHECKED" <?php echo $ringing ?> tabindex="<?php echo ++$tabindex;?>"/></td> |
|---|
| 259 |
</tr> |
|---|
| 260 |
<tr> |
|---|
| 261 |
<td><a href="#" class="info"><?php echo _("Pause Before Answer")?><span><?php echo _("An optional delay to wait before processing this route. Setting this value will delay the channel from answering the call. This may be handy if external fax equipment or security systems are installed in parallel and you would like them to be able to seize the line.")?></span></a>:</td> |
|---|
| 262 |
<td><input type="text" name="delay_answer" size="3" value="<?php echo ($delay_answer != '0')?$delay_answer:'' ?>" tabindex="<?php echo ++$tabindex;?>"></td> |
|---|
| 263 |
</tr> |
|---|
| 264 |
|
|---|
| 265 |
<tr><td colspan="2"><h5><?php echo _("Privacy")?><hr></h5></td></tr> |
|---|
| 266 |
|
|---|
| 267 |
<tr> |
|---|
| 268 |
<td><a href="#" class="info"><?php echo _("Privacy Manager")?><span><?php echo _('If no CallerID has been received, Privacy Manager will ask the caller to enter their phone number. If an user/extension has Call Screening enabled, the incoming caller will be be prompted to say their name when the call reaches the user/extension.')?></span></a>:</td> |
|---|
| 269 |
<td> |
|---|
| 270 |
<select name="privacyman" tabindex="<?php echo ++$tabindex;?>"> |
|---|
| 271 |
<option value="0" <?php echo ($privacyman == '0' ? 'SELECTED' : '')?>><?php echo _("No")?> |
|---|
| 272 |
<option value="1" <?php echo ($privacyman == '1' ? 'SELECTED' : '')?>><?php echo _("Yes")?> |
|---|
| 273 |
</select> |
|---|
| 274 |
</td> |
|---|
| 275 |
</tr> |
|---|
| 276 |
<tr class="pm_opts" <?php echo $privacyman == '0' ? 'style="display:none"':''?>> |
|---|
| 277 |
<td><a href="#" class="info"><?php echo _("Max attempts")?><span><?php echo _('Number of attempts the caller has to enter a valid CallerID')?></span></a>:</td> |
|---|
| 278 |
<td> |
|---|
| 279 |
<select name="pmmaxretries" tabindex="<?php echo ++$tabindex;?>"> |
|---|
| 280 |
<?php |
|---|
| 281 |
for($i=1;$i<11;$i++){ |
|---|
| 282 |
if(!isset($pmmaxretries)||$pmmaxretries==''){$pmmaxretries=3;} |
|---|
| 283 |
echo '<option value="'.$i.'"'.($pmmaxretries == $i ? 'SELECTED' : '').' >'.$i.'</option>'; |
|---|
| 284 |
} |
|---|
| 285 |
?> |
|---|
| 286 |
</select> |
|---|
| 287 |
</td> |
|---|
| 288 |
</tr> |
|---|
| 289 |
<tr class="pm_opts" <?php echo $privacyman == '0' ? 'style="display:none"':''?>> |
|---|
| 290 |
<td><a href="#" class="info"><?php echo _("Min Length")?><span><?php echo _('Minimum amount of digits CallerID needs to contain in order to be considered valid')?></span></a>:</td> |
|---|
| 291 |
<td> |
|---|
| 292 |
<select name="pmminlength" tabindex="<?php echo ++$tabindex;?>"> |
|---|
| 293 |
<?php |
|---|
| 294 |
if(!isset($pmminlength)||$pmminlength==''){$pmminlength=10;} |
|---|
| 295 |
for($i=1;$i<16;$i++){ |
|---|
| 296 |
echo '<option value="'.$i.'"'.($pmminlength == $i ? 'SELECTED' : '').' >'.$i.'</option>'; |
|---|
| 297 |
} |
|---|
| 298 |
?> |
|---|
| 299 |
</select> |
|---|
| 300 |
</td> |
|---|
| 301 |
</tr> |
|---|
| 302 |
<?php |
|---|
| 303 |
|
|---|
| 304 |
// object was initialized in config.php |
|---|
| 305 |
echo $module_hook->hookHtml; |
|---|
| 306 |
?> |
|---|
| 307 |
<tr><td colspan="2"><h5><?php echo _("Set Destination")?><hr></h5></td></tr> |
|---|
| 308 |
|
|---|
| 309 |
<?php |
|---|
| 310 |
|
|---|
| 311 |
echo drawselects(isset($destination)?$destination:null,0); |
|---|
| 312 |
?> |
|---|
| 313 |
<tr> |
|---|
| 314 |
<td colspan="2"> |
|---|
| 315 |
<h6><input name="Submit" type="submit" value="<?php echo _("Submit")?>" tabindex="<?php echo ++$tabindex;?>"> |
|---|
| 316 |
<input name="submitclear" type="submit" value="<?php echo _("Clear Destination & Submit")?>" ></h6> |
|---|
| 317 |
</td> |
|---|
| 318 |
</tr> |
|---|
| 319 |
</table> |
|---|
| 320 |
<script language="javascript"> |
|---|
| 321 |
<!-- |
|---|
| 322 |
|
|---|
| 323 |
var theForm = document.editGRP; |
|---|
| 324 |
|
|---|
| 325 |
theForm.extension.focus(); |
|---|
| 326 |
|
|---|
| 327 |
function editGRP_onsubmit() { |
|---|
| 328 |
var msgInvalidDIDNumb = "<?php echo _('Please enter a valid DID Number'); ?>"; |
|---|
| 329 |
var msgInvalidCIDNum = "<?php echo _('Please enter a valid CallerID Number'); ?>"; |
|---|
| 330 |
var msgInvalidFaxEmail = "<?php echo _('Please enter a valid Fax Email or leave it empty to use the default'); ?>"; |
|---|
| 331 |
var msgInvalidPause = "<?php echo _('Please enter a valid number for Pause after answer'); ?>"; |
|---|
| 332 |
var msgInvalidPauseBefore = "<?php echo _('Please enter a valid number for Pause Before Answer field'); ?>"; |
|---|
| 333 |
var msgConfirmDIDCIDBlank = "<?php echo _('Leaving the DID Number AND the CallerID Number empty will match all incoming calls received not routed using any other defined Incoming Route.\n\nAre you sure?'); ?>"; |
|---|
| 334 |
var msgConfirmDIDNonStd = "<?php echo _('DID information is normally just an incoming telephone number or for advanced users, a valid Asterisk Dial Pattern\n\nYou have entered a non standard DID pattern.\n\nAre you sure this is correct?'); ?>"; |
|---|
| 335 |
var msgConfirmDIDNoSlash = "<?php echo _('A Slash (\'/\') is never a valid DID. Please remove it and try again'); ?>"; |
|---|
| 336 |
var msgInvalidGrpPrefix = "<?php echo _('Invalid CallerID prefix.'); ?>"; |
|---|
| 337 |
|
|---|
| 338 |
setDestinations(theForm,1); |
|---|
| 339 |
|
|---|
| 340 |
defaultEmptyOK = true; |
|---|
| 341 |
if (!isDialpattern(theForm.extension.value)) { |
|---|
| 342 |
// warn the user that DID is normally numbers |
|---|
| 343 |
if (!confirm(msgConfirmDIDNonStd)) |
|---|
| 344 |
return false; |
|---|
| 345 |
} |
|---|
| 346 |
|
|---|
| 347 |
if (isInside(theForm.extension.value, "/")) { |
|---|
| 348 |
warnInvalid(theForm.extension, msgConfirmDIDNoSlash); |
|---|
| 349 |
return false; |
|---|
| 350 |
} |
|---|
| 351 |
|
|---|
| 352 |
var mycid = theForm.cidnum.value.toLowerCase(); |
|---|
| 353 |
if (!isDialpattern(mycid) && mycid.substring(0,4) != "priv" && mycid.substring(0,5) != "block" && mycid != "unknown" && mycid.substring(0,8) != "restrict" && mycid.substring(0,7) != "unavail" && mycid.substring(0,6) != "anonym") |
|---|
| 354 |
return warnInvalid(theForm.cidnum, msgInvalidCIDNum); |
|---|
| 355 |
|
|---|
| 356 |
if (!isInteger(theForm.delay_answer.value)) |
|---|
| 357 |
return warnInvalid(theForm.delay_answer, msgInvalidPauseBefore); |
|---|
| 358 |
|
|---|
| 359 |
if (!validateDestinations(theForm,1,true)) |
|---|
| 360 |
return false; |
|---|
| 361 |
|
|---|
| 362 |
// warning about 'any DID / any CID' |
|---|
| 363 |
if (theForm.extension.value == "" && theForm.cidnum.value == "" && theForm.channel.value == "" ) { |
|---|
| 364 |
if (!confirm(msgConfirmDIDCIDBlank)) |
|---|
| 365 |
return false; |
|---|
| 366 |
} |
|---|
| 367 |
defaultEmptyOK = true; |
|---|
| 368 |
if (!isCallerID(theForm.grppre.value)) |
|---|
| 369 |
return warnInvalid(theForm.grppre, msgInvalidGrpPrefix); |
|---|
| 370 |
|
|---|
| 371 |
return true; |
|---|
| 372 |
} |
|---|
| 373 |
|
|---|
| 374 |
$(document).ready(function() { |
|---|
| 375 |
//show/hide privacy manager options |
|---|
| 376 |
$('select[name=privacyman]').change(function(){ |
|---|
| 377 |
if($(this).val()==0){$('.pm_opts').fadeOut();} |
|---|
| 378 |
if($(this).val()==1){$('.pm_opts').fadeIn();} |
|---|
| 379 |
}); |
|---|
| 380 |
}); |
|---|
| 381 |
|
|---|
| 382 |
//--> |
|---|
| 383 |
</script> |
|---|
| 384 |
</form> |
|---|
| 385 |
<?php |
|---|
| 386 |
} |
|---|
| 387 |
|
|---|
| 388 |
?> |
|---|
| 389 |
|
|---|