Ticket #3994: functions.inc.php.patch

File functions.inc.php.patch, 2.2 kB (added by IgorG, 2 years ago)

Patch for Custom Context 0.3.4

  • functions.inc.php

    old new  
    425425function customcontexts_devices_configpageload() { 
    426426global $currentcomponent; 
    427427//should get current context if possible 
    428   $curcontext = ''; 
     428  $extdisplay = isset($_REQUEST['extdisplay'])?$_REQUEST['extdisplay']:null; 
     429  $query="SELECT `data` FROM `sip` WHERE `keyword`='context' AND `id`='".$extdisplay."'"; 
     430  $curcontext = mysql_result(mysql_query($query), 0); 
    429431  $currentcomponent->addguielem('Device Options', new gui_selectbox('customcontext', $currentcomponent->getoptlist('contextssel'), $curcontext, 'Custom Context', 'You have the '.customcontexts_getmodulevalue('moduledisplayname').' Module installed! You can select a custom context from this list to limit this user to portions of the dialplan you defined in the '.customcontexts_getmodulevalue('moduledisplayname').' module.',true, "javascript:if (document.frm_devices.customcontext.value) {document.frm_devices.devinfo_context.value = document.frm_devices.customcontext.value} else {document.frm_devices.devinfo_context.value = 'from-internal'}")); 
    430432} 
    431433 
     
    433435function customcontexts_extensions_configpageload() { 
    434436global $currentcomponent; 
    435437//should get current context if possible 
    436   $curcontext = ''; 
     438  $extdisplay = isset($_REQUEST['extdisplay'])?$_REQUEST['extdisplay']:null; 
     439  $query="SELECT `data` FROM `sip` WHERE `keyword`='context' AND `id`='".$extdisplay."'"; 
     440  $curcontext = mysql_result(mysql_query($query), 0); 
    437441  $currentcomponent->addguielem('Device Options', new gui_selectbox('customcontext', $currentcomponent->getoptlist('contextssel'), $curcontext, 'Custom Context', 'You have the '.customcontexts_getmodulevalue('moduledisplayname').' Module installed! You can select a custom context from this list to limit this user to portions of the dialplan you defined in the '.customcontexts_getmodulevalue('moduledisplayname').' module.',true, "javascript:if (document.frm_extensions.customcontext.value) {document.frm_extensions.devinfo_context.value = document.frm_extensions.customcontext.value} else {document.frm_extensions.devinfo_context.value = 'from-internal'}")); 
    438442} 
    439443