Changeset 13471
- Timestamp:
- 02/18/12 14:33:58 (1 year ago)
- Files:
-
- modules/branches/2.10/findmefollow/functions.inc.php (modified) (6 diffs)
- modules/branches/2.10/findmefollow/install.php (modified) (1 diff)
- modules/branches/2.10/findmefollow/module.xml (modified) (1 diff)
- modules/branches/2.10/findmefollow/page.findmefollow.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/branches/2.10/findmefollow/functions.inc.php
r13470 r13471 275 275 global $astman; 276 276 global $db; 277 278 if (empty($postdest)) { 279 $postdest = "ext-local,$grpnum,dest"; 280 } 277 281 278 282 $sql = "INSERT INTO findmefollow (grpnum, strategy, grptime, grppre, grplist, annmsg_id, postdest, dring, needsconf, remotealert_id, toolate_id, ringing, pre_ring) VALUES ('".$db->escapeSimple($grpnum)."', '".$db->escapeSimple($strategy)."', ".$db->escapeSimple($grptime).", '".$db->escapeSimple($grppre)."', '".$db->escapeSimple($grplist)."', '".$db->escapeSimple($annmsg_id)."', '".$db->escapeSimple($postdest)."', '".$db->escapeSimple($dring)."', '$needsconf', '$remotealert_id', '$toolate_id', '$ringing', '$pre_ring')"; … … 391 395 $results['voicemail'] = sql("SELECT `voicemail` FROM `users` WHERE `extension` = '".$db->escapeSimple($grpnum)."'","getOne"); 392 396 } 397 if (!isset($results['strategy'])) { 398 $results['strategy'] = $amp_conf['FOLLOWME_RG_STRATEGY']; 399 } 393 400 394 401 if ($check_astdb) { … … 418 425 $astdb_ddial = $astman->database_get("AMPUSER",$grpnum."/followme/ddial"); 419 426 // If the values are different then use what is in astdb as it may have been changed. 427 // If sql returned no results for pre_ring/grptime then it's not configued so we reset 428 // the astdb defaults as well 420 429 // 421 430 $changed=0; 422 431 if (!isset($results['pre_ring'])) { 423 $results['pre_ring'] = '';432 $results['pre_ring'] = $astdb_prering = $amp_conf['FOLLOWME_PRERING']; 424 433 } 425 434 if (!isset($results['grptime'])) { 426 $results['grptime'] = '';435 $results['grptime'] = $astdb_grptime = $amp_conf['FOLLOWME_TIME']; 427 436 } 428 437 if (!isset($results['grplist'])) { … … 465 474 $ddial = ''; 466 475 } else { 467 // Bogus value, should not get here but treat as disabled468 $ddial = '';476 // If here then followme must not be set so use default 477 $ddial = $amp_conf['FOLLOWME_DISABLED'] ? 'CHECKED' : ''; 469 478 } 470 479 $results['ddial'] = $ddial; … … 483 492 function findmefollow_configpageinit($dispnum) { 484 493 global $currentcomponent; 494 global $amp_conf; 485 495 486 496 if ( ($dispnum == 'users' || $dispnum == 'extensions') ) { 487 497 $currentcomponent->addguifunc('findmefollow_configpageload'); 498 499 if ($amp_conf['FOLLOWME_AUTO_CREATE']) { 500 $action = isset($_REQUEST['action'])?$_REQUEST['action']:null; 501 if ($action=="add") { 502 $currentcomponent->addprocessfunc('findmefollow_configprocess', 8); 503 } 504 } 488 505 } 489 506 } … … 514 531 } 515 532 533 // If we are auto-creating a followme for each extension then add the hook funcitons for 534 // extensions and users. 535 // 536 if ($amp_conf['FOLLOWME_AUTO_CREATE']) { 537 function findmefollow_configprocess() { 538 global $amp_conf; 539 540 //create vars from the request 541 $action = isset($_REQUEST['action'])?$_REQUEST['action']:null; 542 $ext = isset($_REQUEST['extdisplay'])?$_REQUEST['extdisplay']:null; 543 $extn = isset($_REQUEST['extension'])?$_REQUEST['extension']:null; 544 545 if ($ext=='') { 546 $extdisplay = $extn; 547 } else { 548 $extdisplay = $ext; 549 } 550 if ($action == "add") { 551 if (!isset($GLOBALS['abort']) || $GLOBALS['abort'] !== true) { 552 553 $ddial = $amp_conf['FOLLOWME_DISABLED'] ? 'CHECKED' : ''; 554 findmefollow_add($extdisplay, $amp_conf['FOLLOWME_RG_STRATEGY'], $amp_conf['FOLLOWME_TIME'], 555 $extdisplay, "", "", "", "", "", "", "","", $amp_conf['FOLLOWME_PRERING'], $ddial,'default',''); 556 } 557 } 558 } 559 } 560 516 561 function findmefollow_check_destinations($dest=true) { 517 562 global $active_modules; modules/branches/2.10/findmefollow/install.php
r13091 r13471 293 293 } 294 294 295 ?> 295 $freepbx_conf =& freepbx_conf::create(); 296 297 // FOLLOWME_AUTO_CREATE 298 // 299 $set['value'] = false; 300 $set['defaultval'] =& $set['value']; 301 $set['readonly'] = 0; 302 $set['hidden'] = 0; 303 $set['level'] = 1; 304 $set['module'] = 'findmefollow'; 305 $set['category'] = 'Follow Me Module'; 306 $set['emptyok'] = 0; 307 $set['sortorder'] = 30; 308 $set['name'] = 'Create Follow Me at Extension Creation Time'; 309 $set['description'] = 'When creating a new user or extension, setting this to true will automatically create a new Follow Me for that user using the default settings listed below'; 310 $set['type'] = CONF_TYPE_BOOL; 311 $freepbx_conf->define_conf_setting('FOLLOWME_AUTO_CREATE',$set); 312 313 // FOLLOWME_DISABLED 314 // 315 $set['value'] = true; 316 $set['defaultval'] =& $set['value']; 317 $set['readonly'] = 0; 318 $set['hidden'] = 0; 319 $set['level'] = 1; 320 $set['module'] = 'findmefollow'; 321 $set['category'] = 'Follow Me Module'; 322 $set['emptyok'] = 0; 323 $set['sortorder'] = 40; 324 $set['name'] = 'Disable Follow Me Upon Creation'; 325 $set['description'] = 'This is the default value for the Follow Me "Disable" setting. When first creating a Follow Me or if auto-created with a new extension, setting this to true will disable the Follow Me setting which can be changed by the user or admin in multiple locations.'; 326 $set['type'] = CONF_TYPE_BOOL; 327 $freepbx_conf->define_conf_setting('FOLLOWME_DISABLED',$set); 328 329 // FOLLOWME_TIME 330 // 331 unset($options); 332 for ($i=5;$i<=120;$i++) { 333 $options[] = $i; 334 } 335 $set['value'] = '20'; 336 $set['defaultval'] =& $set['value']; 337 $set['options'] = $options; 338 $set['readonly'] = 0; 339 $set['hidden'] = 0; 340 $set['level'] = 1; 341 $set['module'] = 'findmefollow'; 342 $set['category'] = 'Follow Me Module'; 343 $set['emptyok'] = 0; 344 $set['sortorder'] = 50; 345 $set['name'] = "Default Follow Me Ring Time"; 346 $set['description'] = "The default Ring Time for a Follow Me set upon creation and used if auto-created with a new extension."; 347 $set['type'] = CONF_TYPE_SELECT; 348 $freepbx_conf->define_conf_setting('FOLLOWME_TIME',$set); 349 350 // FOLLOWME_PRERING 351 // 352 unset($options); 353 for ($i=5;$i<=60;$i++) { 354 $options[] = $i; 355 } 356 $set['value'] = '7'; 357 $set['defaultval'] =& $set['value']; 358 $set['options'] = $options; 359 $set['readonly'] = 0; 360 $set['hidden'] = 0; 361 $set['level'] = 1; 362 $set['module'] = 'findmefollow'; 363 $set['category'] = 'Follow Me Module'; 364 $set['emptyok'] = 0; 365 $set['sortorder'] = 60; 366 $set['name'] = "Default Follow Me Initial Ring Time"; 367 $set['description'] = "The default Initial Ring Time for a Follow Me set upon creation and used if auto-created with a new extension."; 368 $set['type'] = CONF_TYPE_SELECT; 369 $freepbx_conf->define_conf_setting('FOLLOWME_PRERING',$set); 370 371 // FOLLOWME_RG_STRATEGY 372 // 373 $set['value'] = 'ringallv2-prim'; 374 $set['defaultval'] =& $set['value']; 375 $set['options'] = array('ringallv2','ringallv2-prim','ringall','ringall-prim','hunt','hunt-prim','memoryhunt','memoryhunt-prim','firstavailable','firstnotonphone'); 376 $set['readonly'] = 0; 377 $set['hidden'] = 0; 378 $set['level'] = 1; 379 $set['module'] = 'findmefollow'; 380 $set['category'] = 'Follow Me Module'; 381 $set['emptyok'] = 0; 382 $set['sortorder'] = 70; 383 $set['name'] = 'Default Follow Me Ring Strategy'; 384 $set['description'] = "The default Ring Strategy selected for a Follow Me set upon creation and used if auto-created with an extension."; 385 $set['type'] = CONF_TYPE_SELECT; 386 $freepbx_conf->define_conf_setting('FOLLOWME_RG_STRATEGY',$set); modules/branches/2.10/findmefollow/module.xml
r13323 r13471 3 3 <repo>standard</repo> 4 4 <name>Follow Me</name> 5 <version>2.10.0. 2</version>5 <version>2.10.0.3</version> 6 6 <publisher>FreePBX</publisher> 7 7 <license>GPLv2+</license> 8 8 <changelog> 9 *2.10.0.3* #5358, #5521, #5169 9 10 *2.10.0.2* #5478 10 11 *2.10.0.1* call recording bug fixes modules/branches/2.10/findmefollow/page.findmefollow.php
r13469 r13471 24 24 isset($_REQUEST['extdisplay'])?$extdisplay=$_REQUEST['extdisplay']:$extdisplay=''; 25 25 isset($_REQUEST['account'])?$account = $_REQUEST['account']:$account=''; 26 isset($_REQUEST['grptime'])?$grptime = $_REQUEST['grptime']:$grptime= '';26 isset($_REQUEST['grptime'])?$grptime = $_REQUEST['grptime']:$grptime=$amp_conf['FOLLOWME_TIME']; 27 27 isset($_REQUEST['grppre'])?$grppre = $_REQUEST['grppre']:$grppre=''; 28 isset($_REQUEST['strategy'])?$strategy = $_REQUEST['strategy']:$strategy= '';28 isset($_REQUEST['strategy'])?$strategy = $_REQUEST['strategy']:$strategy=$amp_conf['FOLLOWME_RG_STRATEGY']; 29 29 isset($_REQUEST['annmsg_id'])?$annmsg_id = $_REQUEST['annmsg_id']:$annmsg_id=''; 30 30 isset($_REQUEST['dring'])?$dring = $_REQUEST['dring']:$dring=''; … … 33 33 isset($_REQUEST['toolate_id'])?$toolate_id = $_REQUEST['toolate_id']:$toolate_id=''; 34 34 isset($_REQUEST['ringing'])?$ringing = $_REQUEST['ringing']:$ringing=''; 35 isset($_REQUEST['pre_ring'])?$pre_ring = $_REQUEST['pre_ring']:$pre_ring='0'; 36 isset($_REQUEST['ddial'])?$ddial = $_REQUEST['ddial']:$ddial=''; 35 isset($_REQUEST['pre_ring'])?$pre_ring = $_REQUEST['pre_ring']:$pre_ring=$amp_conf['FOLLOWME_PRERING']; 37 36 isset($_REQUEST['changecid'])?$changecid = $_REQUEST['changecid']:$changecid='default'; 38 37 isset($_REQUEST['fixedcid'])?$fixedcid = $_REQUEST['fixedcid']:$fixedcid=''; 39 38 39 $ddial = isset($_REQUEST['ddial']) ? $_REQUEST['ddial'] : ($amp_conf['FOLLOWME_DISABLED'] ? 'CHECKED' : ''); 40 40 41 41 if (isset($_REQUEST['goto0']) && isset($_REQUEST[$_REQUEST['goto0']."0"])) { 42 $goto = $_REQUEST[$_REQUEST['goto0']."0"];42 $goto = $_REQUEST[$_REQUEST['goto0']."0"]; 43 43 } else { 44 $goto = ''; 45 } 46 44 $goto = "ext-local,$extdisplay,dest"; 45 } 47 46 48 47 if (isset($_REQUEST["grplist"])) {
