Changeset 9819
- Timestamp:
- 06/11/10 09:46:57 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
contributed_modules/modules/customcontexts/functions.inc.php
r9818 r9819 49 49 $section = $val[0]; 50 50 if (isset($ext->_includes[$section])) { 51 $i = 0;51 $i = 0; 52 52 foreach ($ext->_includes[$section] as $include) { 53 53 if ($section == 'outbound-allroutes') { 54 54 $i = $i + 1; 55 $sql = "update customcontexts_includes_list set missing = 0, sort = $i where context = '$section' and include = '$include'";55 $sql = "update customcontexts_includes_list set missing = 0, sort = $i where context = '$section' and include = '$include'"; 56 56 $db->query($sql); 57 //fix prioritized contexts, description = '$include'57 //fix prioritized contexts , description = '$include' 58 58 $sql = "update customcontexts_includes_list set include = '$include', description = '$include', missing = 0, sort = $i where missing = 1 and context = '$section' and substring(include,1,6) = 'outrt-' and substring(include,10) = substring('$include',10)"; 59 59 $db->query($sql); 60 //fix allowed prioritized contexts (i did not do , sort = $i, maybe i should) context = '$section' and60 //fix allowed prioritized contexts (i did not do , sort = $i, maybe i should) context = '$section' and 61 61 $sql = "update customcontexts_includes set include = '$include' where substr(include,1,6) = 'outrt-' and substr(include,10) = substr('$include',10)"; 62 62 $db->query($sql); … … 64 64 $sql = "update customcontexts_includes_list set missing = 0, sort = $i where context = '$section' and include = '$include'"; 65 65 $db->query($sql); 66 }66 } 67 67 $sql = "INSERT IGNORE INTO customcontexts_includes_list (context, include, description, sort) VALUES ('$section', '$include', '$include', $i)"; 68 68 $db->query($sql); … … 90 90 default: 91 91 return false; 92 break; 93 } 94 } 95 96 //this is to catch any rename reorder or delete route, so i can fix custom contexts 97 function customcontexts_hookProcess_core($viewing_itemid, $request) { 98 switch ($request['display']) { 99 case 'routing': 100 if(isset($request['Submit'])) { 101 // $route = substr($viewing_itemid,4); 102 // $priority = (int)(substr($viewing_itemid,0,3)); 103 } 104 switch ($request['action']) { 105 case 'delroute': 106 // $route = substr($viewing_itemid,4); 107 $priority = (int)(substr($viewing_itemid,0,3)); 108 customcontexts_routing_prioritize($request['action'],$priority); 109 break; 110 case 'prioritizeroute': 111 $fullroute = $viewing_itemid; 112 if (isset($request['reporoutekey'])) { 113 $outbound_routes = core_routing_getroutenames(); 114 $fullroute = $outbound_routes[(int)$request['reporoutekey']][0]; 115 } 116 // $route = substr($fullroute,4); 117 $priority = (int)(substr($fullroute,0,3)); 118 $direction = $request['reporoutedirection']; 119 customcontexts_routing_prioritize($request['action'],$priority,$direction); 120 break; 121 case 'renameroute'; 122 $newname = $request['newroutename']; 123 $route = $viewing_itemid; 124 $priority = (substr($viewing_itemid,0,3)); 125 $fullnewname = 'outrt-'.$priority.'-'.$newname; 126 $fullroutename = 'outrt-'.$route; 127 customcontexts_routing_editname($fullroutename,$fullnewname); 128 break; 129 default: 130 131 break; 132 } 92 133 break; 93 134 } … … 447 488 $currentcomponent->addguielem('_top', new gui_hidden('action', ($extdisplay ? 'edit' : 'add'))); 448 489 $currentcomponent->addguielem('_bottom', new gui_link('help', _(customcontexts_getmodulevalue('moduledisplayname')." v".customcontexts_getmodulevalue('moduleversion')), 'http://www.freepbx.org/support/documentation/module-documentation/third-party-unsupported-modules/customcontexts', true, false), 0); 490 $currentcomponent->addguielem('_bottom', new gui_link('bounty', 'Module Going END OF LIFE - Click For Details', 'http://www.freepbx.org/bounties/custom-context', true, false), 0); 449 491 if (!$extdisplay) { 450 492 $currentcomponent->addguielem('_top', new gui_pageheading('title', _("Add Context"), false), 0); … … 864 906 $info = ''; 865 907 $currentcomponent->addguielem('_bottom', new gui_link('ver', _(customcontexts_getmodulevalue('moduledisplayname')." v".customcontexts_getmodulevalue('moduleversion')), 'http://www.freepbx.org/support/documentation/module-documentation/third-party-unsupported-modules/customcontexts', true, false), 0); 908 $currentcomponent->addguielem('_bottom', new gui_link('bounty', 'Module Going END OF LIFE - Click For Details', 'http://www.freepbx.org/bounties/custom-context', true, false), 0); 866 909 if (!$extdisplay) { 867 910 $currentcomponent->addguielem('_top', new gui_pageheading('title', _("Add Time Group"), false), 0);
