| 1 |
<?php |
|---|
| 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 |
$dispnum = 'ringgroups'; |
|---|
| 15 |
|
|---|
| 16 |
isset($_REQUEST['action'])?$action = $_REQUEST['action']:$action=''; |
|---|
| 17 |
|
|---|
| 18 |
isset($_REQUEST['extdisplay'])?$extdisplay=$_REQUEST['extdisplay']:$extdisplay=''; |
|---|
| 19 |
isset($_REQUEST['account'])?$account = $_REQUEST['account']:$account=''; |
|---|
| 20 |
isset($_REQUEST['grptime'])?$grptime = $_REQUEST['grptime']:$grptime=''; |
|---|
| 21 |
isset($_REQUEST['grppre'])?$grppre = $_REQUEST['grppre']:$grppre=''; |
|---|
| 22 |
isset($_REQUEST['strategy'])?$strategy = $_REQUEST['strategy']:$strategy=''; |
|---|
| 23 |
isset($_REQUEST['annmsg_id'])?$annmsg_id = $_REQUEST['annmsg_id']:$annmsg_id=''; |
|---|
| 24 |
isset($_REQUEST['description'])?$description = $_REQUEST['description']:$description=''; |
|---|
| 25 |
isset($_REQUEST['alertinfo'])?$alertinfo = $_REQUEST['alertinfo']:$alertinfo=''; |
|---|
| 26 |
isset($_REQUEST['needsconf'])?$needsconf = $_REQUEST['needsconf']:$needsconf=''; |
|---|
| 27 |
isset($_REQUEST['cwignore'])?$cwignore = $_REQUEST['cwignore']:$cwignore=''; |
|---|
| 28 |
isset($_REQUEST['cfignore'])?$cfignore = $_REQUEST['cfignore']:$cfignore=''; |
|---|
| 29 |
isset($_REQUEST['remotealert_id'])?$remotealert_id = $_REQUEST['remotealert_id']:$remotealert_id=''; |
|---|
| 30 |
isset($_REQUEST['toolate_id'])?$toolate_id = $_REQUEST['toolate_id']:$toolate_id=''; |
|---|
| 31 |
isset($_REQUEST['ringing'])?$ringing = $_REQUEST['ringing']:$ringing=''; |
|---|
| 32 |
|
|---|
| 33 |
if (isset($_REQUEST['goto0']) && isset($_REQUEST[$_REQUEST['goto0']."0"])) { |
|---|
| 34 |
$goto = $_REQUEST[$_REQUEST['goto0']."0"]; |
|---|
| 35 |
} else { |
|---|
| 36 |
$goto = ''; |
|---|
| 37 |
} |
|---|
| 38 |
|
|---|
| 39 |
|
|---|
| 40 |
if (isset($_REQUEST["grplist"])) { |
|---|
| 41 |
$grplist = explode("\n",$_REQUEST["grplist"]); |
|---|
| 42 |
|
|---|
| 43 |
if (!$grplist) { |
|---|
| 44 |
$grplist = null; |
|---|
| 45 |
} |
|---|
| 46 |
|
|---|
| 47 |
foreach (array_keys($grplist) as $key) { |
|---|
| 48 |
|
|---|
| 49 |
$grplist[$key] = trim($grplist[$key]); |
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 |
$grplist[$key] = preg_replace("/[^0-9#*]/", "", $grplist[$key]); |
|---|
| 53 |
|
|---|
| 54 |
if ($grplist[$key] == ltrim($extdisplay,'GRP-').'#') |
|---|
| 55 |
$grplist[$key] = rtrim($grplist[$key],'#'); |
|---|
| 56 |
|
|---|
| 57 |
|
|---|
| 58 |
if ($grplist[$key] == "") unset($grplist[$key]); |
|---|
| 59 |
} |
|---|
| 60 |
|
|---|
| 61 |
|
|---|
| 62 |
$grplist = array_values(array_unique($grplist)); |
|---|
| 63 |
} |
|---|
| 64 |
|
|---|
| 65 |
|
|---|
| 66 |
if(isset($_POST['action'])){ |
|---|
| 67 |
|
|---|
| 68 |
if (isset($account) && !checkRange($account)){ |
|---|
| 69 |
echo "<script>javascript:alert('". _("Warning! Extension")." ".$account." "._("is not allowed for your account").".');</script>"; |
|---|
| 70 |
} else { |
|---|
| 71 |
|
|---|
| 72 |
if ($action == 'addGRP') { |
|---|
| 73 |
|
|---|
| 74 |
$conflict_url = array(); |
|---|
| 75 |
$usage_arr = framework_check_extension_usage($account); |
|---|
| 76 |
if (!empty($usage_arr)) { |
|---|
| 77 |
$conflict_url = framework_display_extension_usage_alert($usage_arr); |
|---|
| 78 |
|
|---|
| 79 |
} elseif (ringgroups_add($account,$strategy,$grptime,implode("-",$grplist),$goto,$description,$grppre,$annmsg_id,$alertinfo,$needsconf,$remotealert_id,$toolate_id,$ringing,$cwignore,$cfignore)) { |
|---|
| 80 |
needreload(); |
|---|
| 81 |
redirect_standard(); |
|---|
| 82 |
} |
|---|
| 83 |
} |
|---|
| 84 |
|
|---|
| 85 |
|
|---|
| 86 |
if ($action == 'delGRP') { |
|---|
| 87 |
ringgroups_del($account); |
|---|
| 88 |
needreload(); |
|---|
| 89 |
redirect_standard(); |
|---|
| 90 |
} |
|---|
| 91 |
|
|---|
| 92 |
|
|---|
| 93 |
if ($action == 'edtGRP') { |
|---|
| 94 |
ringgroups_del($account); |
|---|
| 95 |
ringgroups_add($account,$strategy,$grptime,implode("-",$grplist),$goto,$description,$grppre,$annmsg_id,$alertinfo,$needsconf,$remotealert_id,$toolate_id,$ringing,$cwignore,$cfignore); |
|---|
| 96 |
needreload(); |
|---|
| 97 |
redirect_standard('extdisplay'); |
|---|
| 98 |
} |
|---|
| 99 |
} |
|---|
| 100 |
} |
|---|
| 101 |
?> |
|---|
| 102 |
</div> |
|---|
| 103 |
|
|---|
| 104 |
<div class="rnav"><ul> |
|---|
| 105 |
<li><a id="<?php echo ($extdisplay=='' ? 'current':'') ?>" href="config.php?display=<?php echo urlencode($dispnum)?>"><?php echo _("Add Ring Group")?></a></li> |
|---|
| 106 |
<?php |
|---|
| 107 |
|
|---|
| 108 |
$gresults = ringgroups_list(); |
|---|
| 109 |
|
|---|
| 110 |
if (isset($gresults)) { |
|---|
| 111 |
foreach ($gresults as $gresult) { |
|---|
| 112 |
echo "<li><a id=\"".($extdisplay=='GRP-'.$gresult[0] ? 'current':'')."\" href=\"config.php?display=".urlencode($dispnum)."&extdisplay=".urlencode("GRP-".$gresult[0])."\">".$gresult[1]." ({$gresult[0]})</a></li>"; |
|---|
| 113 |
} |
|---|
| 114 |
} |
|---|
| 115 |
?> |
|---|
| 116 |
</ul></div> |
|---|
| 117 |
|
|---|
| 118 |
<div class="content"> |
|---|
| 119 |
<?php |
|---|
| 120 |
if ($action == 'delGRP') { |
|---|
| 121 |
echo '<br><h3>'._("Ring Group").' '.$account.' '._("deleted").'!</h3><br><br><br><br><br><br><br><br>'; |
|---|
| 122 |
} else { |
|---|
| 123 |
if ($extdisplay) { |
|---|
| 124 |
|
|---|
| 125 |
$thisgrp = ringgroups_get(ltrim($extdisplay,'GRP-')); |
|---|
| 126 |
$grpliststr = $thisgrp['grplist']; |
|---|
| 127 |
$grplist = explode("-", $grpliststr); |
|---|
| 128 |
$strategy = $thisgrp['strategy']; |
|---|
| 129 |
$grppre = $thisgrp['grppre']; |
|---|
| 130 |
$grptime = $thisgrp['grptime']; |
|---|
| 131 |
$goto = $thisgrp['postdest']; |
|---|
| 132 |
$annmsg_id = $thisgrp['annmsg_id']; |
|---|
| 133 |
$description = $thisgrp['description']; |
|---|
| 134 |
$alertinfo = $thisgrp['alertinfo']; |
|---|
| 135 |
$remotealert_id = $thisgrp['remotealert_id']; |
|---|
| 136 |
$needsconf = $thisgrp['needsconf']; |
|---|
| 137 |
$cwignore = $thisgrp['cwignore']; |
|---|
| 138 |
$cfignore = $thisgrp['cfignore']; |
|---|
| 139 |
$toolate_id = $thisgrp['toolate_id']; |
|---|
| 140 |
$ringing = $thisgrp['ringing']; |
|---|
| 141 |
unset($grpliststr); |
|---|
| 142 |
unset($thisgrp); |
|---|
| 143 |
|
|---|
| 144 |
$delButton = " |
|---|
| 145 |
<form name=delete action=\"{$_SERVER['PHP_SELF']}\" method=POST> |
|---|
| 146 |
<input type=\"hidden\" name=\"display\" value=\"{$dispnum}\"> |
|---|
| 147 |
<input type=\"hidden\" name=\"account\" value=\"".ltrim($extdisplay,'GRP-')."\"> |
|---|
| 148 |
<input type=\"hidden\" name=\"action\" value=\"delGRP\"> |
|---|
| 149 |
<input type=submit value=\""._("Delete Group")."\"> |
|---|
| 150 |
</form>"; |
|---|
| 151 |
|
|---|
| 152 |
echo "<h2>"._("Ring Group").": ".ltrim($extdisplay,'GRP-')."</h2>"; |
|---|
| 153 |
echo "<p>".$delButton."</p>"; |
|---|
| 154 |
|
|---|
| 155 |
$usage_list = framework_display_destination_usage(ringgroups_getdest(ltrim($extdisplay,'GRP-'))); |
|---|
| 156 |
if (!empty($usage_list)) { |
|---|
| 157 |
?> |
|---|
| 158 |
<a href="#" class="info"><?php echo $usage_list['text']?>:<span><?php echo $usage_list['tooltip']?></span></a> |
|---|
| 159 |
<?php |
|---|
| 160 |
} |
|---|
| 161 |
|
|---|
| 162 |
} else { |
|---|
| 163 |
$grplist = explode("-", '');; |
|---|
| 164 |
$strategy = ''; |
|---|
| 165 |
$grppre = ''; |
|---|
| 166 |
$grptime = ''; |
|---|
| 167 |
$goto = ''; |
|---|
| 168 |
$annmsg_id = ''; |
|---|
| 169 |
$alertinfo = ''; |
|---|
| 170 |
$remotealert_id = ''; |
|---|
| 171 |
$needsconf = ''; |
|---|
| 172 |
$cwignore = ''; |
|---|
| 173 |
$cfignore = ''; |
|---|
| 174 |
$toolate_id = ''; |
|---|
| 175 |
$ringing = ''; |
|---|
| 176 |
|
|---|
| 177 |
if (!empty($conflict_url)) { |
|---|
| 178 |
echo "<h5>"._("Conflicting Extensions")."</h5>"; |
|---|
| 179 |
echo implode('<br .>',$conflict_url); |
|---|
| 180 |
} |
|---|
| 181 |
|
|---|
| 182 |
echo "<h2>"._("Add Ring Group")."</h2>"; |
|---|
| 183 |
} |
|---|
| 184 |
?> |
|---|
| 185 |
<form name="editGRP" action="<?php $_SERVER['PHP_SELF'] ?>" method="post" onsubmit="return checkGRP(editGRP);"> |
|---|
| 186 |
<input type="hidden" name="display" value="<?php echo $dispnum?>"> |
|---|
| 187 |
<input type="hidden" name="action" value="<?php echo ($extdisplay ? 'edtGRP' : 'addGRP'); ?>"> |
|---|
| 188 |
<table> |
|---|
| 189 |
<tr><td colspan="2"><h5><?php echo ($extdisplay ? _("Edit Ring Group") : _("Add Ring Group")) ?><hr></h5></td></tr> |
|---|
| 190 |
<tr> |
|---|
| 191 |
<?php |
|---|
| 192 |
if ($extdisplay) { |
|---|
| 193 |
|
|---|
| 194 |
?> |
|---|
| 195 |
<input size="5" type="hidden" name="account" value="<?php echo ltrim($extdisplay,'GRP-'); ?>" tabindex="<?php echo ++$tabindex;?>"> |
|---|
| 196 |
<?php } else { ?> |
|---|
| 197 |
<td><a href="#" class="info"><?php echo _("Ring-Group Number")?>:<span><?php echo _("The number users will dial to ring extensions in this ring group")?></span></a></td> |
|---|
| 198 |
<td><input size="5" type="text" name="account" value="<?php if ($gresult[0]==0) { echo "600"; } else { echo $gresult[0] + 1; } ?>" tabindex="<?php echo ++$tabindex;?>"></td> |
|---|
| 199 |
<?php } ?> |
|---|
| 200 |
</tr> |
|---|
| 201 |
|
|---|
| 202 |
<tr> |
|---|
| 203 |
<td> <a href="#" class="info"><?php echo _("Group Description")?>:<span><?php echo _("Provide a descriptive title for this Ring Group.")?></span></a></td> |
|---|
| 204 |
<td><input size="20" maxlength="35" type="text" name="description" value="<?php echo htmlspecialchars($description); ?>" tabindex="<?php echo ++$tabindex;?>"></td> |
|---|
| 205 |
</tr> |
|---|
| 206 |
|
|---|
| 207 |
<tr> |
|---|
| 208 |
<td> <a href="#" class="info"><?php echo _("Ring Strategy:")?> |
|---|
| 209 |
<span> |
|---|
| 210 |
<b><?php echo _("ringall")?></b>: <?php echo _("Ring all available channels until one answers (default)")?><br> |
|---|
| 211 |
<b><?php echo _("hunt")?></b>: <?php echo _("Take turns ringing each available extension")?><br> |
|---|
| 212 |
<b><?php echo _("memoryhunt")?></b>: <?php echo _("Ring first extension in the list, then ring the 1st and 2nd extension, then ring 1st 2nd and 3rd extension in the list.... etc.")?><br> |
|---|
| 213 |
<b><?php echo _("*-prim")?></b>: <?php echo _("These modes act as described above. However, if the primary extension (first in list) is occupied, the other extensions will not be rung. If the primary is FreePBX DND, it won't be rung. If the primary is FreePBX CF unconditional, then all will be rung")?><br> |
|---|
| 214 |
<b><?php echo _("firstavailable")?></b>: <?php echo _("ring only the first available channel")?><br> |
|---|
| 215 |
<b><?php echo _("firstnotonphone")?></b>: <?php echo _("ring only the first channel which is not offhook - ignore CW")?><br> |
|---|
| 216 |
</span> |
|---|
| 217 |
</a></td> |
|---|
| 218 |
<td> |
|---|
| 219 |
<select name="strategy" tabindex="<?php echo ++$tabindex;?>"> |
|---|
| 220 |
<?php |
|---|
| 221 |
$default = (isset($strategy) ? $strategy : 'ringall'); |
|---|
| 222 |
$items = array('ringall','ringall-prim','hunt','hunt-prim','memoryhunt','memoryhunt-prim','firstavailable','firstnotonphone'); |
|---|
| 223 |
foreach ($items as $item) { |
|---|
| 224 |
echo '<option value="'.$item.'" '.($default == $item ? 'SELECTED' : '').'>'._($item); |
|---|
| 225 |
} |
|---|
| 226 |
?> |
|---|
| 227 |
</select> |
|---|
| 228 |
</td> |
|---|
| 229 |
</tr> |
|---|
| 230 |
|
|---|
| 231 |
<tr> |
|---|
| 232 |
<td> |
|---|
| 233 |
<a href=# class="info"><?php echo _("Ring Time (max 60 sec)")?> |
|---|
| 234 |
<span> |
|---|
| 235 |
<?php echo _("Time in seconds that the phones will ring. For all hunt style ring strategies, this is the time for each iteration of phone(s) that are rung")?> |
|---|
| 236 |
</span> |
|---|
| 237 |
</a> |
|---|
| 238 |
</td> |
|---|
| 239 |
<td><input size="4" type="text" name="grptime" value="<?php echo $grptime?$grptime:20 ?>" tabindex="<?php echo ++$tabindex;?>"></td> |
|---|
| 240 |
</tr> |
|---|
| 241 |
|
|---|
| 242 |
<tr> |
|---|
| 243 |
<td valign="top"><a href="#" class="info"><?php echo _("Extension List")?>:<span><br><?php echo _("List extensions to ring, one per line, or use the Extension Quick Pick below to insert them here.<br><br>You can include an extension on a remote system, or an external number by suffixing a number with a '#'. ex: 2448089# would dial 2448089 on the appropriate trunk (see Outbound Routing)<br><br>Extensions (without a '#' will not ring a user's Follow-Me. To dial Follow-Me, Queues and other numbers that are not extensions, put a '#' at the end.")?><br><br></span></a></td> |
|---|
| 244 |
<td valign="top"> |
|---|
| 245 |
<?php |
|---|
| 246 |
$rows = count($grplist)+1; |
|---|
| 247 |
($rows < 5) ? 5 : (($rows > 20) ? 20 : $rows); |
|---|
| 248 |
?> |
|---|
| 249 |
<textarea id="grplist" cols="15" rows="<?php echo $rows ?>" name="grplist" tabindex="<?php echo ++$tabindex;?>"><?php echo implode("\n",$grplist);?></textarea> |
|---|
| 250 |
</td> |
|---|
| 251 |
</tr> |
|---|
| 252 |
|
|---|
| 253 |
<tr> |
|---|
| 254 |
<td> |
|---|
| 255 |
<a href=# class="info"><?php echo _("Extension Quick Pick")?> |
|---|
| 256 |
<span> |
|---|
| 257 |
<?php echo _("Choose an extension to append to the end of the extension list above.")?> |
|---|
| 258 |
</span> |
|---|
| 259 |
</a> |
|---|
| 260 |
</td> |
|---|
| 261 |
<td> |
|---|
| 262 |
<select onChange="insertExten();" id="insexten" tabindex="<?php echo ++$tabindex;?>"> |
|---|
| 263 |
<option value=""><?php echo _("(pick extension)")?></option> |
|---|
| 264 |
<?php |
|---|
| 265 |
$results = core_users_list(); |
|---|
| 266 |
foreach ($results as $result) { |
|---|
| 267 |
echo "<option value='".$result[0]."'>".$result[0]." (".$result[1].")</option>\n"; |
|---|
| 268 |
} |
|---|
| 269 |
?> |
|---|
| 270 |
</select> |
|---|
| 271 |
</td> |
|---|
| 272 |
</tr> |
|---|
| 273 |
|
|---|
| 274 |
<?php if(function_exists('recordings_list')) { ?> |
|---|
| 275 |
<tr> |
|---|
| 276 |
<td><a href="#" class="info"><?php echo _("Announcement:")?><span><?php echo _("Message to be played to the caller before dialing this group.<br><br>To add additional recordings please use the \"System Recordings\" MENU to the left")?></span></a></td> |
|---|
| 277 |
<td> |
|---|
| 278 |
<select name="annmsg_id" tabindex="<?php echo ++$tabindex;?>"> |
|---|
| 279 |
<?php |
|---|
| 280 |
$tresults = recordings_list(); |
|---|
| 281 |
$default = (isset($annmsg_id) ? $annmsg_id : ''); |
|---|
| 282 |
echo '<option value="">'._("None")."</option>"; |
|---|
| 283 |
if (isset($tresults[0])) { |
|---|
| 284 |
foreach ($tresults as $tresult) { |
|---|
| 285 |
echo '<option value="'.$tresult['id'].'"'.($tresult['id'] == $default ? ' SELECTED' : '').'>'.$tresult['displayname']."</option>\n"; |
|---|
| 286 |
} |
|---|
| 287 |
} |
|---|
| 288 |
?> |
|---|
| 289 |
</select> |
|---|
| 290 |
</td> |
|---|
| 291 |
</tr> |
|---|
| 292 |
<?php } else { ?> |
|---|
| 293 |
<tr> |
|---|
| 294 |
<td><a href="#" class="info"><?php echo _("Announcement:")?><span><?php echo _("Message to be played to the caller before dialing this group.<br><br>You must install and enable the \"Systems Recordings\" Module to edit this option")?></span></a></td> |
|---|
| 295 |
<td> |
|---|
| 296 |
<?php |
|---|
| 297 |
$default = (isset($annmsg_id) ? $annmsg_id : ''); |
|---|
| 298 |
?> |
|---|
| 299 |
<input type="hidden" name="annmsg_id" value="<?php echo $default; ?>"><?php echo ($default != '' ? $default : 'None'); ?> |
|---|
| 300 |
</td> |
|---|
| 301 |
</tr> |
|---|
| 302 |
<?php } if (function_exists('music_list')) { ?> |
|---|
| 303 |
<tr> |
|---|
| 304 |
<td><a href="#" class="info"><?php echo _("Play Music On Hold?")?><span><?php echo _("If you select a Music on Hold class to play, instead of 'Ring', they will hear that instead of Ringing while they are waiting for someone to pick up.")?></span></a></td> |
|---|
| 305 |
<td> |
|---|
| 306 |
<select name="ringing" tabindex="<?php echo ++$tabindex;?>"> |
|---|
| 307 |
<?php |
|---|
| 308 |
$tresults = music_list($amp_conf['ASTVARLIBDIR']."/mohmp3"); |
|---|
| 309 |
$cur = (isset($ringing) ? $ringing : 'Ring'); |
|---|
| 310 |
echo '<option value="Ring">'._("Ring")."</option>"; |
|---|
| 311 |
if (isset($tresults[0])) { |
|---|
| 312 |
foreach ($tresults as $tresult) { |
|---|
| 313 |
( $tresult == 'none' ? $ttext = _("none") : $ttext = $tresult ); |
|---|
| 314 |
( $tresult == 'default' ? $ttext = _("default") : $ttext = $tresult ); |
|---|
| 315 |
echo '<option value="'.$tresult.'"'.($tresult == $cur ? ' SELECTED' : '').'>'._($ttext)."</option>\n"; |
|---|
| 316 |
} |
|---|
| 317 |
} |
|---|
| 318 |
?> |
|---|
| 319 |
</select> |
|---|
| 320 |
</td> |
|---|
| 321 |
</tr> |
|---|
| 322 |
<?php } ?> |
|---|
| 323 |
|
|---|
| 324 |
<tr> |
|---|
| 325 |
<td><a href="#" class="info"><?php echo _("CID Name Prefix")?>:<span><?php echo _('You can optionally prefix the Caller ID name when ringing extensions in this group. 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> |
|---|
| 326 |
<td><input size="4" type="text" name="grppre" value="<?php echo $grppre ?>" tabindex="<?php echo ++$tabindex;?>"></td> |
|---|
| 327 |
</tr> |
|---|
| 328 |
|
|---|
| 329 |
<tr> |
|---|
| 330 |
<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> |
|---|
| 331 |
<td><input type="text" name="alertinfo" size="20" value="<?php echo ($alertinfo)?$alertinfo:'' ?>" tabindex="<?php echo ++$tabindex;?>"></td> |
|---|
| 332 |
</tr> |
|---|
| 333 |
|
|---|
| 334 |
<tr> |
|---|
| 335 |
<td><a href="#" class="info"><?php echo _("Ignore CF Settings")?><span> <?php echo _("When checked, agents who attempt to Call Forward will be ignored, this applies to CF, CFU and CFB. Extensions entered with '#' at the end, for example to access the extension's Follow-Me, might not honor this setting .") ?></span></a>:</td> |
|---|
| 336 |
<td> |
|---|
| 337 |
<input type="checkbox" name="cfignore" value="CHECKED" <?php echo $cfignore ?> tabindex="<?php echo ++$tabindex;?>"/> |
|---|
| 338 |
</td> |
|---|
| 339 |
</tr> |
|---|
| 340 |
|
|---|
| 341 |
<tr> |
|---|
| 342 |
<td><a href="#" class="info"><?php echo _("Skip Busy Agent")?><span> <?php echo _("When checked, agents who are on an occupied phone will be skipped as if the line were returning busy. This means that Call Waiting or multi-line phones will not be presented with the call and in the various hunt style ring strategies, the next agent will be attempted.") ?></span></a>:</td> |
|---|
| 343 |
<td> |
|---|
| 344 |
<input type="checkbox" name="cwignore" value="CHECKED" <?php echo $cwignore ?> tabindex="<?php echo ++$tabindex;?>"/> |
|---|
| 345 |
</td> |
|---|
| 346 |
</tr> |
|---|
| 347 |
|
|---|
| 348 |
<tr> |
|---|
| 349 |
<td><a href="#" class="info"><?php echo _("Confirm Calls")?><span><?php echo _('Enable this if you\'re calling external numbers that need confirmation - eg, a mobile phone may go to voicemail which will pick up the call. Enabling this requires the remote side push 1 on their phone before the call is put through. This feature only works with the ringall ring strategy')?></span></a>:</td> |
|---|
| 350 |
<td> |
|---|
| 351 |
<input type="checkbox" name="needsconf" value="CHECKED" <?php echo $needsconf ?> tabindex="<?php echo ++$tabindex;?>"/> |
|---|
| 352 |
</td> |
|---|
| 353 |
</tr> |
|---|
| 354 |
|
|---|
| 355 |
<?php if(function_exists('recordings_list')) { ?> |
|---|
| 356 |
<tr> |
|---|
| 357 |
<td><a href="#" class="info"><?php echo _("Remote Announce:")?><span><?php echo _("Message to be played to the person RECEIVING the call, if 'Confirm Calls' is enabled.<br><br>To add additional recordings use the \"System Recordings\" MENU to the left")?></span></a></td> |
|---|
| 358 |
<td> |
|---|
| 359 |
<select name="remotealert_id" tabindex="<?php echo ++$tabindex;?>"> |
|---|
| 360 |
<?php |
|---|
| 361 |
$tresults = recordings_list(); |
|---|
| 362 |
$default = (isset($remotealert_id) ? $remotealert_id : ''); |
|---|
| 363 |
echo '<option value="">'._("Default")."</option>"; |
|---|
| 364 |
if (isset($tresults[0])) { |
|---|
| 365 |
foreach ($tresults as $tresult) { |
|---|
| 366 |
echo '<option value="'.$tresult['id'].'"'.($tresult['id'] == $default ? ' SELECTED' : '').'>'.$tresult['displayname']."</option>\n"; |
|---|
| 367 |
} |
|---|
| 368 |
} |
|---|
| 369 |
?> |
|---|
| 370 |
</select> |
|---|
| 371 |
</td> |
|---|
| 372 |
</tr> |
|---|
| 373 |
|
|---|
| 374 |
<tr> |
|---|
| 375 |
<td><a href="#" class="info"><?php echo _("Too-Late Announce:")?><span><?php echo _("Message to be played to the person RECEIVING the call, if the call has already been accepted before they push 1.<br><br>To add additional recordings use the \"System Recordings\" MENU to the left")?></span></a></td> |
|---|
| 376 |
<td> |
|---|
| 377 |
<select name="toolate_id" tabindex="<?php echo ++$tabindex;?>"> |
|---|
| 378 |
<?php |
|---|
| 379 |
$tresults = recordings_list(); |
|---|
| 380 |
$default = (isset($toolate_id) ? $toolate_id : ''); |
|---|
| 381 |
echo '<option value="">'._("Default")."</option>"; |
|---|
| 382 |
if (isset($tresults[0])) { |
|---|
| 383 |
foreach ($tresults as $tresult) { |
|---|
| 384 |
echo '<option value="'.$tresult['id'].'"'.($tresult['id'] == $default ? ' SELECTED' : '').'>'.$tresult['displayname']."</option>\n"; |
|---|
| 385 |
} |
|---|
| 386 |
} |
|---|
| 387 |
?> |
|---|
| 388 |
</select> |
|---|
| 389 |
</td> |
|---|
| 390 |
</tr> |
|---|
| 391 |
<?php } ?> |
|---|
| 392 |
<?php |
|---|
| 393 |
|
|---|
| 394 |
// object was initialized in config.php |
|---|
| 395 |
echo $module_hook->hookHtml; |
|---|
| 396 |
?> |
|---|
| 397 |
|
|---|
| 398 |
<tr><td colspan="2"><br><h5><?php echo _("Destination if no answer")?>:<hr></h5></td></tr> |
|---|
| 399 |
|
|---|
| 400 |
<?php |
|---|
| 401 |
|
|---|
| 402 |
echo drawselects($goto,0); |
|---|
| 403 |
?> |
|---|
| 404 |
|
|---|
| 405 |
<tr> |
|---|
| 406 |
<td colspan="2"><br><h6><input name="Submit" type="submit" value="<?php echo _("Submit Changes")?>" tabindex="<?php echo ++$tabindex;?>"></h6></td> |
|---|
| 407 |
|
|---|
| 408 |
</tr> |
|---|
| 409 |
</table> |
|---|
| 410 |
</form> |
|---|
| 411 |
<?php |
|---|
| 412 |
} |
|---|
| 413 |
|
|---|
| 414 |
|
|---|
| 415 |
?> |
|---|
| 416 |
<script language="javascript"> |
|---|
| 417 |
<!-- |
|---|
| 418 |
|
|---|
| 419 |
function insertExten() { |
|---|
| 420 |
exten = document.getElementById('insexten').value; |
|---|
| 421 |
|
|---|
| 422 |
grpList=document.getElementById('grplist'); |
|---|
| 423 |
if (grpList.value[ grpList.value.length - 1 ] == "\n") { |
|---|
| 424 |
grpList.value = grpList.value + exten; |
|---|
| 425 |
} else { |
|---|
| 426 |
grpList.value = grpList.value + '\n' + exten; |
|---|
| 427 |
} |
|---|
| 428 |
|
|---|
| 429 |
// reset element |
|---|
| 430 |
document.getElementById('insexten').value = ''; |
|---|
| 431 |
} |
|---|
| 432 |
|
|---|
| 433 |
function checkGRP(theForm) { |
|---|
| 434 |
var msgInvalidGrpNum = "<?php echo _('Invalid Group Number specified'); ?>"; |
|---|
| 435 |
var msgInvalidExtList = "<?php echo _('Please enter an extension list.'); ?>"; |
|---|
| 436 |
var msgInvalidGrpPrefix = "<?php echo _('Invalid Caller ID prefix.'); ?>"; |
|---|
| 437 |
var msgInvalidTime = "<?php echo _('Invalid time specified'); ?>"; |
|---|
| 438 |
var msgInvalidGrpTimeRange = "<?php echo _('Time must be between 1 and 60 seconds'); ?>"; |
|---|
| 439 |
var msgInvalidDescription = "<?php echo _('Please enter a valid Group Description'); ?>"; |
|---|
| 440 |
var msgInvalidRingStrategy = "<?php echo _('Only ringall, ringallv2, hunt and the respective -prim versions are supported when confirmation is checked'); ?>"; |
|---|
| 441 |
|
|---|
| 442 |
// set up the Destination stuff |
|---|
| 443 |
setDestinations(theForm, 1); |
|---|
| 444 |
|
|---|
| 445 |
// form validation |
|---|
| 446 |
defaultEmptyOK = false; |
|---|
| 447 |
if (!isInteger(theForm.account.value)) { |
|---|
| 448 |
return warnInvalid(theForm.account, msgInvalidGrpNum); |
|---|
| 449 |
} |
|---|
| 450 |
|
|---|
| 451 |
defaultEmptyOK = false; |
|---|
| 452 |
if (!isAlphanumeric(theForm.description.value)) |
|---|
| 453 |
return warnInvalid(theForm.description, msgInvalidDescription); |
|---|
| 454 |
|
|---|
| 455 |
if (isEmpty(theForm.grplist.value)) |
|---|
| 456 |
return warnInvalid(theForm.grplist, msgInvalidExtList); |
|---|
| 457 |
|
|---|
| 458 |
defaultEmptyOK = true; |
|---|
| 459 |
if (!isCallerID(theForm.grppre.value)) |
|---|
| 460 |
return warnInvalid(theForm.grppre, msgInvalidGrpPrefix); |
|---|
| 461 |
|
|---|
| 462 |
defaultEmptyOK = false; |
|---|
| 463 |
if (!isInteger(theForm.grptime.value)) { |
|---|
| 464 |
return warnInvalid(theForm.grptime, msgInvalidTime); |
|---|
| 465 |
} else { |
|---|
| 466 |
var grptimeVal = theForm.grptime.value; |
|---|
| 467 |
if (grptimeVal < 1 || grptimeVal > 60) |
|---|
| 468 |
return warnInvalid(theForm.grptime, msgInvalidGrpTimeRange); |
|---|
| 469 |
} |
|---|
| 470 |
|
|---|
| 471 |
if (theForm.needsconf.checked && (theForm.strategy.value.substring(0,7) != "ringall" && theForm.strategy.value.substring(0,4) != "hunt")) { |
|---|
| 472 |
return warnInvalid(theForm.needsconf, msgInvalidRingStrategy); |
|---|
| 473 |
} |
|---|
| 474 |
|
|---|
| 475 |
if (!validateDestinations(theForm, 1, true)) |
|---|
| 476 |
return false; |
|---|
| 477 |
|
|---|
| 478 |
return true; |
|---|
| 479 |
} |
|---|
| 480 |
//--> |
|---|
| 481 |
</script> |
|---|
| 482 |
|
|---|
| 483 |
|
|---|