Changeset 10797

Show
Ignore:
Timestamp:
01/06/11 04:42:13 (2 years ago)
Author:
tm1000
Message:

Fixed everything on the Endpoint Manager Plugin for the Extensions Page. Cleaned up the EPM Directory. Added a bunch of Reboot Options. Version is now 2.9.0.3RC1.

Gettin' Close! :-)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.9/endpointman/functions.inc.php

    r10792 r10797  
    3737 
    3838        $display = isset($_REQUEST['display'])?$_REQUEST['display']:null; 
    39         if($display == "extensions") { 
     39        $extdisplay = isset($_REQUEST['extdisplay'])?$_REQUEST['extdisplay']:null; 
     40        $action = isset($_REQUEST['action'])?$_REQUEST['action']:null; 
     41        $delete = isset($_REQUEST['epm_delete'])?$_REQUEST['epm_delete']:null; 
     42 
     43        if(($display == "extensions") && isset($extdisplay)) { 
    4044            global $endpoint; 
    4145 
     
    4650            ini_set('display_errors', 0); 
    4751 
     52            if($action == "edit") { 
     53 
     54                if(isset($delete)) { 
     55                    $sql = "SELECT mac_id,line FROM endpointman_line_list WHERE ext = ". $extdisplay; 
     56                    $macid = $endpoint->db->getRow($sql,array(),DB_FETCHMODE_ASSOC); 
     57 
     58                    if($macid) { 
     59                        $sql = "SELECT * FROM endpointman_line_list WHERE mac_id = ".$macid['mac_id']; 
     60                        $list = $endpoint->db->getAll($sql,array(),DB_FETCHMODE_ASSOC); 
     61 
     62                        $count = count($list); 
     63 
     64                        if($count == 1) { 
     65                            $sql = "DELETE FROM endpointman_mac_list WHERE id = ".$macid['mac_id']; 
     66                            $endpoint->db->query($sql); 
     67                        } 
     68 
     69                        $sql = "DELETE FROM endpointman_line_list WHERE mac_id = ".$macid['mac_id']." AND line = ".$macid['line']; 
     70                        $endpoint->db->query($sql); 
     71                    } 
     72                } 
     73 
     74                $mac = isset($_REQUEST['epm_mac'])?$_REQUEST['epm_mac']:null; 
     75 
     76                if(!empty($mac)) { 
     77                    //Mac is set 
     78                    $brand = isset($_REQUEST['epm_brand'])?$_REQUEST['epm_brand']:null; 
     79                    $model = isset($_REQUEST['epm_model'])?$_REQUEST['epm_model']:null; 
     80                    $line = isset($_REQUEST['epm_line'])?$_REQUEST['epm_line']:null; 
     81                    $temp = isset($_REQUEST['epm_temps'])?$_REQUEST['epm_temps']:null; 
     82                    $extdisplay = isset($_REQUEST['extdisplay'])?$_REQUEST['extdisplay']:null; 
     83                    $name = isset($_REQUEST['name'])?$_REQUEST['name']:null; 
     84                    $reboot = isset($_REQUEST['epm_reboot'])?$_REQUEST['epm_reboot']:null; 
     85 
     86                    if($endpoint->mac_check_clean($mac)) { 
     87                        $sql = "SELECT id FROM endpointman_mac_list WHERE mac = '".$endpoint->mac_check_clean($mac)."'"; 
     88                        $macid = $endpoint->db->getOne($sql); 
     89                        if($macid) { 
     90                            //In Database already 
     91                            $sql = 'SELECT * FROM endpointman_line_list WHERE ext = '.$extdisplay.' AND mac_id = '. $macid; 
     92                            $lines_list =& $endpoint->db->getRow($sql,array(),DB_FETCHMODE_ASSOC); 
     93                            if(($lines_list) AND (isset($model)) AND (isset($line)) AND (!isset($delete)) AND (isset($temp))) { 
     94                                //Modifying line already in the database 
     95                                $sql = "UPDATE endpointman_line_list SET line = ".$lines_list['line'].", description =  '".$name."' WHERE  luid =" . $lines_list['luid']; 
     96                                $endpoint->db->query($sql); 
     97 
     98                                $sql = "UPDATE  endpointman_mac_list SET model = ".$model.", template_id =  ".$temp." WHERE id = ".$macid; 
     99                                $endpoint->db->query($sql); 
     100 
     101                                $row = $endpoint->get_phone_info($macid); 
     102                                if(isset($reboot)) { 
     103                                    $endpoint->prepare_configs($row); 
     104                                } else { 
     105                                    $endpoint->prepare_configs($row,FALSE); 
     106                                } 
     107                            } elseif((isset($model)) AND (!isset($delete)) AND (isset($line)) AND (isset($temp))) { 
     108                                //Add line to the database 
     109                                $sql = "INSERT INTO endpointman_line_list (mac_id, line, ext, description) VALUES (".$macid.",  ".$line.",  ".$extdisplay.",  '".$name."')"; 
     110                                $endpoint->db->query($sql); 
     111 
     112                                $sql = "UPDATE  endpointman_mac_list SET model = ".$model.", template_id =  ".$temp." WHERE id = ".$macid; 
     113                                $endpoint->db->query($sql); 
     114                            } 
     115                        } elseif(!isset($delete)) { 
     116                            //Add Extension/Phone to database 
     117                            $mac = $endpoint->mac_check_clean($mac); 
     118                            $sql = "INSERT INTO `endpointman_mac_list` (`mac`, `model`, `template_id`) VALUES ('".$mac."', '".$model."', '".$temp."')"; 
     119                            $endpoint->db->query($sql); 
     120 
     121                            $sql = 'SELECT last_insert_id()'; 
     122                            $ext_id =& $endpoint->db->getOne($sql); 
     123 
     124                            if(!isset($line)) { 
     125                                $line = 1; 
     126                            } 
     127 
     128                            $sql = "INSERT INTO `endpointman_line_list` (`mac_id`, `ext`, `line`, `description`) VALUES ('".$ext_id."', '".$extdisplay."', '".$line."', '".$name."')"; 
     129                            $endpoint->db->query($sql); 
     130                        } 
     131                    } 
     132                } else { 
     133                    //Mac not set so delete 
     134                    $sql = "SELECT mac_id,line FROM endpointman_line_list WHERE ext = ". $extdisplay; 
     135                    $macid = $endpoint->db->getRow($sql,array(),DB_FETCHMODE_ASSOC); 
     136 
     137                    if($macid) { 
     138                        $sql = "SELECT * FROM endpointman_line_list WHERE mac_id = ".$macid['mac_id']; 
     139                        $list = $endpoint->db->getAll($sql,array(),DB_FETCHMODE_ASSOC); 
     140                        $count = count($list); 
     141 
     142                        if($count == 1) { 
     143                            $sql = "DELETE FROM endpointman_mac_list WHERE id = ".$macid['mac_id']; 
     144                            $endpoint->db->query($sql); 
     145                        } 
     146 
     147                        $sql = "DELETE FROM endpointman_line_list WHERE mac_id = ".$macid['mac_id']." AND line = ".$macid['line']; 
     148                        $endpoint->db->query($sql); 
     149                    } 
     150                } 
     151            } 
    48152            endpointman_applyhooks(); 
    49153        } 
     
    66170  // Don't display this stuff it it's on a 'This xtn has been deleted' page. 
    67171  if ($action != 'del') { 
    68             $sql = "SELECT mac_id,luid,line FROM endpointman_line_list WHERE ext = '".$extdisplay."' "; 
    69             $line_info =& $db->getRow($sql, array(), DB_FETCHMODE_ASSOC); 
    70             if($line_info) { 
    71                 $info = $endpoint->get_phone_info($line_info['mac_id']); 
    72  
    73                  
    74                 $js = " 
     172 
     173            $js = " 
    75174                    $.ajaxSetup({ cache: false }); 
    76175 
     
    88187                    }) 
    89188                "; 
    90                 $currentcomponent->addjsfunc('brand_change(value)', $js); 
     189            $currentcomponent->addjsfunc('brand_change(value)', $js); 
     190 
     191            $section = _('End Point Manager'); 
     192 
     193            $sql = "SELECT mac_id,luid,line FROM endpointman_line_list WHERE ext = '".$extdisplay."' "; 
     194            $line_info =& $db->getRow($sql, array(), DB_FETCHMODE_ASSOC); 
     195            if($line_info) { 
    91196 
    92197                $js = " 
     
    112217                $currentcomponent->addjsfunc('model_change(value,macid)', $js); 
    113218 
    114                 $section = _('End Point Manager'); 
    115  
     219                $info = $endpoint->get_phone_info($line_info['mac_id']); 
    116220                 
    117221                $brand_list = $endpoint->brands_available($info['brand_id'], true); 
     
    126230                } 
    127231 
    128                 $currentcomponent->addguielem($section, new gui_textbox('epm_mac', $info['mac'], 'MAC Address', 'The MAC Address of the Phone Assigned to this Extension/Device.', 'isEmpty()', 'Please enter a valid MAC Address', true, 12, true),9); 
     232                $checked = false; 
     233 
     234                $currentcomponent->addguielem($section, new gui_checkbox('epm_delete', $checked, 'Delete','Delete this Extension from Endpoint Manager'),9); 
     235                $currentcomponent->addguielem($section, new gui_textbox('epm_mac', $info['mac'], 'MAC Address', 'The MAC Address of the Phone Assigned to this Extension/Device. <br />(Leave Blank to Remove from Endpoint Manager)', '', 'Please enter a valid MAC Address', true, 17, false),9); 
    129236                $currentcomponent->addguielem($section, new gui_selectbox('epm_brand', $brand_list, $info['brand_id'], 'Brand', 'The Brand of this Phone.', false, 'frm_extensions_brand_change(this.options[this.selectedIndex].value)', false),9); 
    130237                $currentcomponent->addguielem($section, new gui_selectbox('epm_model', $model_list, $info['model_id'], 'Model', 'The Model of this Phone.', false, 'frm_extensions_model_change(this.options[this.selectedIndex].value,\''.$line_info['luid'].'\')', false),9); 
    131238                $currentcomponent->addguielem($section, new gui_selectbox('epm_line', $line_list, $line_info['line'], 'Line', 'The Line of this Extension/Device.', false, '', false),9); 
    132239                $currentcomponent->addguielem($section, new gui_selectbox('epm_temps', $template_list, $info['template_id'], 'Template', 'The Template of this Phone.', false, '', false),9); 
     240                $currentcomponent->addguielem($section, new gui_checkbox('epm_reboot', $checked, 'Reboot','Reboot this Phone on Submit'),9); 
     241                 
     242            } else { 
     243 
     244                $js = " 
     245                    $.ajaxSetup({ cache: false }); 
     246                    $.getJSON('config.php?type=tool&quietmode=1&handler=file&module=endpointman&file=ajax_select.html.php&atype=template2',{id: value}, function(j){ 
     247                            var options = ''; 
     248                            for (var i = 0; i < j.length; i++) { 
     249                                    options += '<option value=\"' + j[i].optionValue + '\">' + j[i].optionDisplay + '</option>'; 
     250                            } 
     251                            $('#epm_temps').html(options); 
     252                            $('#epm_temps option:first').attr('selected', 'selected'); 
     253                    }), 
     254                    $.ajaxSetup({ cache: false }); 
     255                    $.getJSON('config.php?type=tool&quietmode=1&handler=file&module=endpointman&file=ajax_select.html.php&mac='+ mac +'&atype=lines',{id: value}, function(j){ 
     256                            var options = ''; 
     257                            for (var i = 0; i < j.length; i++) { 
     258                                    options += '<option value=\"' + j[i].optionValue + '\">' + j[i].optionDisplay + '</option>'; 
     259                            } 
     260                            $('#epm_line').html(options); 
     261                            $('#epm_line option:first').attr('selected', 'selected'); 
     262                    }) 
     263                "; 
     264                $currentcomponent->addjsfunc('model_change(value,mac)', $js); 
     265 
     266                $brand_list = $endpoint->brands_available(NULL, true); 
     267                $model_list = array(); 
     268                $line_list = array(); 
     269                $template_list = array(); 
     270 
     271                $currentcomponent->addguielem($section, new gui_textbox('epm_mac', $info['mac'], 'MAC Address', 'The MAC Address of the Phone Assigned to this Extension/Device. <br />(Leave Blank to Remove from Endpoint Manager)', '', 'Please enter a valid MAC Address', true, 17, false),9); 
     272                $currentcomponent->addguielem($section, new gui_selectbox('epm_brand', $brand_list, $info['brand_id'], 'Brand', 'The Brand of this Phone.', false, 'frm_extensions_brand_change(this.options[this.selectedIndex].value)', false),9); 
     273                $currentcomponent->addguielem($section, new gui_selectbox('epm_model', $model_list, $info['model_id'], 'Model', 'The Model of this Phone.', false, 'frm_extensions_model_change(this.options[this.selectedIndex].value,document.getElementById(\'epm_mac\').value)', false),9); 
     274                $currentcomponent->addguielem($section, new gui_selectbox('epm_line', $line_list, $line_info['line'], 'Line', 'The Line of this Extension/Device.', false, '', false),9); 
     275                $currentcomponent->addguielem($section, new gui_selectbox('epm_temps', $template_list, $info['template_id'], 'Template', 'The Template of this Phone.', false, '', false),9); 
    133276            } 
    134277        } 
  • modules/branches/2.9/endpointman/includes/advanced.inc

    r10792 r10797  
    567567                $_POST['enable_debug'] = 0; 
    568568            } 
    569             if((isset($_POST['enable_updates'])) AND ($_POST['enable_updates'] == "on")) { 
    570                 $_POST['enable_updates'] = 1; 
    571                 $sql = "INSERT INTO cronmanager (module, id, time, freq, lasttime, command) VALUES ('endpointman', 'UPDATES', '23', '24', '0', 'php ".$amp_conf['AMPWEBROOT']."/admin/modules/endpointman/includes/update_check.php')"; 
    572                 $endpoint->db->query($sql); 
    573             } else { 
    574                 $_POST['enable_updates'] = 0; 
    575                 $sql = "DELETE FROM `cronmanager` WHERE CONVERT(`cronmanager`.`module` USING utf8) = 'endpointman' AND CONVERT(`cronmanager`.`id` USING utf8) = 'UPDATES' LIMIT 1"; 
    576                 $endpoint->db->query($sql); 
     569            if((isset($_POST['disable_help'])) AND ($_POST['disable_help'] == "on")) { 
     570                $_POST['disable_help'] = 1; 
     571            } else { 
     572                $_POST['disable_help'] = 0; 
    577573            } 
    578574 
     
    594590            $endpoint->db->query($sql); 
    595591 
    596             $sql="UPDATE endpointman_global_vars SET value='" . $_POST['enable_updates'] . "' WHERE var_name='check_updates'"; 
    597             $endpoint->db->query($sql); 
    598  
    599592            $sql="UPDATE endpointman_global_vars SET value='" . $_POST['nmap_loc'] . "' WHERE var_name='nmap_location'"; 
    600593            $endpoint->db->query($sql); 
    601594 
    602595            $sql="UPDATE endpointman_global_vars SET value='" . $_POST['arp_loc'] . "' WHERE var_name='arp_location'"; 
     596            $endpoint->db->query($sql); 
     597 
     598            $sql="UPDATE endpointman_global_vars SET value='" . $_POST['disable_help'] . "' WHERE var_name='disable_help'"; 
    603599            $endpoint->db->query($sql); 
    604600 
     
    614610            $ari_selected = ""; 
    615611        } 
    616  
    617         if($endpoint->global_cfg['disable_htaccess']) { 
    618             $htaccess_selected = "checked"; 
     612         
     613        if($endpoint->global_cfg['disable_help']) { 
     614            $help_selected = "checked"; 
    619615        } else { 
    620             $htaccess_selected = ""; 
    621         } 
    622  
    623         if($endpoint->global_cfg['check_updates']) { 
    624             $updates_selected = "checked"; 
    625         } else { 
    626             $updates_selected = ""; 
    627         } 
     616            $help_selected = ""; 
     617        } 
     618 
    628619        if($endpoint->global_cfg['debug']) { 
    629620            $debug_selected = "checked"; 
     
    634625            $debug_selected = ""; 
    635626        } 
    636         $endpoint->tpl->assign("htaccess_selected", $htaccess_selected); 
     627        $endpoint->tpl->assign("help_selected", $help_selected); 
     628 
    637629        $endpoint->tpl->assign("ari_selected", $ari_selected); 
    638         $endpoint->tpl->assign("updates_selected", $updates_selected); 
    639630        $endpoint->tpl->assign("debug_selected", $debug_selected); 
    640631 
  • modules/branches/2.9/endpointman/includes/ajax_select.php

    r10792 r10797  
    77 * @package Provisioner 
    88 */ 
     9 
     10require 'functions.inc'; 
     11$endpoint = new endpointmanager(); 
     12 
    913include 'jsonwrapper.php'; 
    10 //ini_set('display_errors', 1); 
    1114function in_array_recursive($needle, $haystack) { 
    1215 
     
    1922    }  
    2023    return FALSE; 
    21 } 
    22  
    23 function linesAvailable($lineid=NULL,$macid=NULL) { 
    24     global $db; 
    25     if(isset($lineid)) { 
    26         $sql="SELECT max_lines FROM endpointman_model_list WHERE id = (SELECT endpointman_mac_list.model FROM endpointman_mac_list, endpointman_line_list WHERE endpointman_line_list.luid = ".$lineid." AND endpointman_line_list.mac_id = endpointman_mac_list.id)"; 
    27  
    28         $sql_l = "SELECT line, mac_id FROM `endpointman_line_list` WHERE luid = ".$lineid; 
    29         $line =& $db->getRow($sql_l, array(), DB_FETCHMODE_ASSOC); 
    30  
    31         $sql_lu = "SELECT line FROM endpointman_line_list WHERE mac_id = ".$line['mac_id']; 
    32     } elseif(isset($macid)) { 
    33         $sql="SELECT max_lines FROM endpointman_model_list WHERE id = (SELECT model FROM endpointman_mac_list WHERE id =".$macid.")"; 
    34         $sql_lu = "SELECT line FROM endpointman_line_list WHERE mac_id = ".$macid; 
    35  
    36         $line['line'] = 0; 
    37     } 
    38     $max_lines = $db->getOne($sql); 
    39     $lines_used =& $db->getAll($sql_lu); 
    40  
    41     for($i = 1; $i <= $max_lines; $i++) { 
    42         if($i == $line['line']) { 
    43             $temp[$i]['value'] = $i; 
    44             $temp[$i]['text'] = $i; 
    45             $temp[$i]['selected'] = "selected"; 
    46         } else { 
    47             if(!in_array_recursive($i,$lines_used)) { 
    48                 $temp[$i]['value'] = $i; 
    49                 $temp[$i]['text'] = $i; 
    50             } 
    51         } 
    52     } 
    53     if(isset($temp)) { 
    54         return($temp); 
    55     } else { 
    56         return FALSE; 
    57     } 
    5824} 
    5925 
     
    7339} elseif ($_REQUEST['atype'] == "model_clone") { 
    7440        $sql = "SELECT endpointman_model_list.id, endpointman_model_list.model as model FROM endpointman_model_list, endpointman_product_list WHERE endpointman_product_list.id = endpointman_model_list.product_id AND endpointman_model_list.enabled = 1 AND endpointman_model_list.hidden = 0 AND product_id = '". $_GET['id']."'"; 
    75 }   elseif ($_REQUEST['atype'] == "lines") { 
    76         if(isset($_REQUEST['macid'])) { 
    77             //die(); 
    78             $sql = "SELECT endpointman_model_list.max_lines FROM endpointman_model_list,endpointman_line_list,endpointman_mac_list WHERE endpointman_mac_list.id = endpointman_line_list.mac_id AND endpointman_model_list.id = endpointman_mac_list.model AND endpointman_line_list.luid = ". $_REQUEST['macid']; 
     41} elseif ($_REQUEST['atype'] == "lines") { 
     42    if(isset($_REQUEST['macid'])) { 
     43        $sql = "SELECT endpointman_model_list.max_lines FROM endpointman_model_list,endpointman_line_list,endpointman_mac_list WHERE endpointman_mac_list.id = endpointman_line_list.mac_id AND endpointman_model_list.id = endpointman_mac_list.model AND endpointman_line_list.luid = ". $_REQUEST['macid']; 
     44    } elseif(isset($_REQUEST['mac'])) { 
     45        $sql = "SELECT id FROM endpointman_mac_list WHERE mac = '".$endpoint->mac_check_clean($_REQUEST['mac'])."'"; 
     46        $macid = $endpoint->db->getOne($sql); 
     47        if($macid) { 
     48            $_REQUEST['mac'] = $macid; 
     49            $sql = "SELECT endpointman_model_list.max_lines FROM endpointman_model_list,endpointman_line_list,endpointman_mac_list WHERE endpointman_mac_list.id = endpointman_line_list.mac_id AND endpointman_model_list.id = endpointman_mac_list.model AND endpointman_mac_list.id = ". $macid; 
    7950        } else { 
     51            unset($_REQUEST['mac']); 
    8052            $sql = "SELECT max_lines FROM endpointman_model_list WHERE id = '". $_GET['id']."'"; 
    8153        } 
     54    } else { 
     55        $sql = "SELECT max_lines FROM endpointman_model_list WHERE id = '". $_GET['id']."'"; 
     56    } 
    8257} 
    8358 
     
    9469} 
    9570 
    96 if(($_REQUEST['atype'] == "lines") && (!isset($_REQUEST['macid']))) { 
    97     $count = $db->getOne($sql); 
     71if(($_REQUEST['atype'] == "lines") && (!isset($_REQUEST['mac'])) && (!isset($_REQUEST['macid']))) { 
     72    $count = $endpoint->db->getOne($sql); 
    9873    for($z=0;$z<$count;$z++) { 
    9974        $result[$z]['id'] = $z + 1; 
     
    10176    } 
    10277} elseif(isset($_REQUEST['macid'])) { 
    103     $result = linesAvailable($_REQUEST['macid']); 
     78    $result = $endpoint->linesAvailable($_REQUEST['macid']); 
     79} elseif(isset($_REQUEST['mac'])) { 
     80    $result = $endpoint->linesAvailable(NULL,$_REQUEST['mac']); 
    10481} else { 
    105     $result = $db->getAll($sql,array(), DB_FETCHMODE_ASSOC); 
     82    $result = $endpoint->db->getAll($sql,array(), DB_FETCHMODE_ASSOC); 
    10683} 
    10784 
    10885foreach($result as $row) { 
    109         if(isset($_REQUEST['macid'])) { 
     86        if((isset($_REQUEST['macid'])) OR (isset($_REQUEST['mac']))) { 
    11087            $out[$i]['optionValue'] = $row['value']; 
    11188            $out[$i]['optionDisplay'] = $row['text']; 
  • modules/branches/2.9/endpointman/includes/devices_manager.inc

    r10792 r10797  
    144144            $row =& $endpoint->db->getRow($sql,array(),DB_FETCHMODE_ASSOC); 
    145145 
    146             $cfg_data = unserialize($row['template_data']); 
    147  
    148             $count = count($cfg_data); 
    149             $i = 0; 
    150             while($i < $count) { 
    151                 if(array_key_exists('variable',$cfg_data[$i])) { 
    152                     $temping = str_replace('$','',$cfg_data[$i]['variable']); 
    153                     if(is_array($cfg_data[$i]['default_value'])) { 
    154                         $custom_cfg_data[$temping]['value'] = ''; 
    155                     } else { 
    156                         $custom_cfg_data[$temping]['value'] = $cfg_data[$i]['default_value']; 
    157                     } 
    158                 } 
    159                 $i++; 
    160             } 
    161             if((isset($custom_cfg_data)) AND (is_array($custom_cfg_data))) { 
    162                 $custom_cfg_data = serialize($custom_cfg_data); 
    163             } else { 
    164                 $temp = array(); 
    165                 $custom_cfg_data = serialize($temp); 
    166             } 
    167  
    168             $sql = "INSERT INTO `endpointman_mac_list` (`mac`, `model`, `global_custom_cfg_data`, `template_id`) VALUES ('".$mac."', '".$_REQUEST['model_list']."', '".$custom_cfg_data."', '".$_REQUEST['template_list']."')"; 
     146            $sql = "INSERT INTO `endpointman_mac_list` (`mac`, `model`, `template_id`) VALUES ('".$mac."', '".$_REQUEST['model_list']."', '".$_REQUEST['template_list']."')"; 
    169147            $endpoint->db->query($sql); 
    170148 
     
    549527        $endpoint->tpl->assign("models_ava", $ma); 
    550528    } 
    551     $endpoint->tpl->assign("web_path", WEB_PATH); 
    552529    $endpoint->tpl->assign("product_list", $product_list); 
    553530    $endpoint->tpl->assign("display_ext", $endpoint->display_registration_list()); 
  • modules/branches/2.9/endpointman/includes/functions.inc

    r10792 r10797  
    3333        date_default_timezone_set('America/Los_Angeles'); 
    3434 
    35                 //Move all information from the global $amp_conf into our public space. This will help prevent security concerns 
     35        //Move all information from the global $amp_conf into our public space. This will help prevent security concerns 
    3636        $this->amp_conf = $amp_conf; 
    3737 
     
    5252 
    5353        //Define error reporting 
    54         if($this->global_cfg['debug']) { 
     54        if(($this->global_cfg['debug']) AND (!isset($_REQUEST['quietmode']))) { 
    5555            error_reporting(E_ALL); 
    5656            ini_set('display_errors', 1); 
     
    7878        $this->tpl = new RainTPL( LOCAL_PATH.'templates/freepbx', LOCAL_PATH.'templates/freepbx/compiled', '/admin/modules/endpointman/templates/images' ); 
    7979 
     80        if($this->global_cfg['disable_help']) { 
     81            $this->tpl->assign("disable_help", 1); 
     82        } 
     83         
     84        $this->tpl->assign("web_path", WEB_PATH); 
    8085    } 
    8186 
     
    119124        $tpl->assign("fatal_error", $fatal_error); 
    120125        $tpl->assign("error_message", $message); 
    121     } 
    122  
    123     /** 
    124      * A hacky way to add notifications into freepbx 
    125      * @deprecated Supposed to remove 
    126      * @param <type> $id 
    127      * @param <type> $type 
    128      * @param <type> $display_text 
    129      * @param <type> $text 
    130      * @param <type> $link 
    131      */ 
    132     function add_freepbx_notification($id, $type, $display_text, $text, $link) { 
    133         $sql = "INSERT INTO notifications (module, id, level, display_text, link, candelete, timestamp, extended_text) VALUES ('endpointman', '".$id."', '500', '".$display_text."', '".$link."', '1', '".time()."', '".$text."')"; 
    134         mysql_query($sql); 
    135126    } 
    136127 
     
    168159    function get_brand_from_mac($mac){ 
    169160        //Check for valid mac address first 
    170         if(!preg_match("/[0-9a-f][0-9a-f][:-][0-9a-f][0-9a-f][:-][0-9a-f][0-9a-f][:-][0-9a-f][0-9a-f][:-][0-9a-f][0-9a-f][:-][0-9a-f][0-9a-f]/i",$mac)) { 
     161        if(!$this->mac_check_clean($mac)) { 
    171162            return(FALSE); 
    172163        } 
    173164 
    174165        //Get the OUI only 
    175         $oui = substr($mac,0,6); 
     166        $oui = substr($this->mac_check_clean($mac),0,6); 
    176167        //Find the matching brand model to the oui 
    177168        $oui_sql = "SELECT endpointman_brand_list.name, endpointman_brand_list.id FROM endpointman_oui_list, endpointman_brand_list WHERE oui LIKE '%". $oui ."%' AND endpointman_brand_list.id = endpointman_oui_list.brand AND endpointman_brand_list.installed = 1 LIMIT 1"; 
     
    193184    } 
    194185 
    195     /** 
    196      * Setup provisioner class from Provisioner.net 
    197      * 
    198      * Not used yet 
    199      * 
    200      * @param <type> $mac_id 
    201      */ 
    202     function setup_provisioner($mac_id=NULL) { 
    203         if(!class_exists('ProvisionerConfig')) { 
    204             require(PHONE_MODULES_PATH.'setup.php'); 
    205         } 
    206         $phone_info = $endpoint->get_phone_info($mac_id); 
    207  
    208         if(is_array($phone_info['template_data'])) { 
    209             $template_data = unserialize($phone_info['template_data']['custom_cfg_data']); 
    210         } else { 
    211             $template_data = unserialize($phone_info['custom_cfg_data']); 
    212         } 
    213  
    214         $new_template_data = array(); 
    215         if(is_array($template_data)) { 
    216             foreach($template_data as $key => $data) { 
    217                 $new_template_data = array_merge($new_template_data, array($key => $data['value'])); 
    218             } 
    219         } 
    220  
    221         $class = "endpoint_" . $phone_info['directory'] . "_" . $phone_info['cfg_dir'] . '_phone'; 
    222  
    223         $provisioner_lib = new $class(); 
    224  
    225         $provisioner_lib->root_dir = PHONE_MODULES_PATH; 
    226  
    227         $provisioner_lib->engine = 'asterisk'; 
    228         $provisioner_lib->system = 'unix'; 
    229  
    230         $provisioner_lib->options = $new_template_data; 
    231  
    232         //have to because of versions less than php5.3 
    233         $provisioner_lib->brand_name = $phone_info['directory']; 
    234         $provisioner_lib->family_line = $phone_info['cfg_dir']; 
     186    function add_device() { 
     187 
     188    } 
     189 
     190    function add_line() { 
     191 
     192    } 
     193 
     194    function delete_line() { 
     195 
     196    } 
     197 
     198    function delete_device() { 
     199 
    235200    } 
    236201 
     
    238203     * Send this function an ID from the mac devices list table and you'll get all the information we have on that particular phone 
    239204     * @param integer $mac_id ID number reference from the MySQL database referencing the table endpointman_mac_list 
    240      * @return <type> 
     205     * @return array 
     206     * @example 
     207     * Final Output will look something similar to this 
     208     *  Array 
     209     *       ( 
     210     *            [config_files_override] => 
     211     *            [global_user_cfg_data] => N; 
     212     *            [model_id] => 213 
     213     *            [brand_id] => 2 
     214     *            [name] => Grandstream 
     215     *            [directory] => grandstream 
     216     *            [model] => GXP2000 
     217     *            [mac] => 000B820D0050 
     218     *            [template_id] => 0 
     219     *            [global_custom_cfg_data] => Serialized Data (Changed Template Values) 
     220     *            [long_name] => GXP Enterprise IP series [280,1200,2000,2010,2020] 
     221     *            [product_id] => 21 
     222     *            [cfg_dir] => gxp 
     223     *            [cfg_ver] => 1.5 
     224     *            [template_data] => Serialized Data (The default Template Values) 
     225     *            [enabled] => 1 
     226     *            [line] => Array 
     227     *                ( 
     228     *                    [1] => Array 
     229     *                        ( 
     230     *                            [luid] => 2 
     231     *                            [mac_id] => 2 
     232     *                            [line] => 1 
     233     *                            [ext] => 1000 
     234     *                            [description] => Description 
     235     *                            [custom_cfg_data] => 
     236     *                            [user_cfg_data] => 
     237     *                            [secret] => secret 
     238     *                            [id] => 1000 
     239     *                            [tech] => sip 
     240     *                            [dial] => SIP/1000 
     241     *                            [devicetype] => fixed 
     242     *                            [user] => 1000 
     243     *                            [emergency_cid] => 
     244     *                        ) 
     245     *                ) 
     246     *         ) 
    241247     */ 
    242248    function get_phone_info($mac_id=NULL) { 
     
    299305            } 
    300306        } 
    301  
    302         //Final Output will look something similar to this 
    303         /**Array 
    304             ( 
    305                 [config_files_override] => 
    306                 [global_user_cfg_data] => N; 
    307                 [model_id] => 213 
    308                 [brand_id] => 2 
    309                 [name] => Grandstream 
    310                 [directory] => grandstream 
    311                 [model] => GXP2000 
    312                 [mac] => 000B820D0050 
    313                 [template_id] => 0 
    314                 [global_custom_cfg_data] => Serialized Data (Changed Template Values) 
    315                 [long_name] => GXP Enterprise IP series [280,1200,2000,2010,2020] 
    316                 [product_id] => 21 
    317                 [cfg_dir] => gxp 
    318                 [cfg_ver] => 1.5 
    319                 [template_data] => Serialized Data (The default Template Values) 
    320                 [enabled] => 1 
    321                 [line] => Array 
    322                     ( 
    323                         [1] => Array 
    324                             ( 
    325                                 [luid] => 2 
    326                                 [mac_id] => 2 
    327                                 [line] => 1 
    328                                 [ext] => 1000 
    329                                 [description] => Description 
    330                                 [custom_cfg_data] => 
    331                                 [user_cfg_data] => 
    332                                 [secret] => secret 
    333                                 [id] => 1000 
    334                                 [tech] => sip 
    335                                 [dial] => SIP/1000 
    336                                 [devicetype] => fixed 
    337                                 [user] => 1000 
    338                                 [emergency_cid] => 
    339                             ) 
    340  
    341                     ) 
    342  
    343             ) 
    344         */ 
    345307        return $phone_info; 
    346308    } 
     
    455417            echo "No Template Data has been defined for this Product<br />"; 
    456418        } 
    457         $this->tpl->assign("web_path", WEB_PATH); 
    458419 
    459420        $this->tpl->assign("template_editor", $out); 
     
    741702                $template_variables_array['type'] = "NA"; 
    742703                break; 
    743             case "file": 
    744                 $template_variables_array['type'] = "NA"; 
    745                 break; 
    746704            case "break": 
    747705               if($admin) { 
     
    778736        //This function is reversed. Not sure why 
    779737        if($custom != "0") { 
    780             $sql = "SELECT endpointman_product_list.config_files, endpointman_mac_list.*, endpointman_product_list.id as product_id, endpointman_product_list.long_name, endpointman_model_list.template_data, endpointman_product_list.cfg_dir, endpointman_brand_list.directory FROM endpointman_brand_list, endpointman_mac_list, endpointman_model_list, endpointman_product_list WHERE endpointman_mac_list.id=".$id." AND endpointman_mac_list.model = endpointman_model_list.id AND endpointman_model_list.brand = endpointman_brand_list.id AND endpointman_model_list.product_id = endpointman_product_list.id"; 
    781         } else { 
    782             $sql = "SELECT endpointman_brand_list.directory, endpointman_product_list.cfg_dir, endpointman_product_list.config_files, endpointman_product_list.long_name, endpointman_model_list.template_data, endpointman_model_list.id as model_id, endpointman_template_list.* FROM endpointman_brand_list, endpointman_product_list, endpointman_model_list, endpointman_template_list WHERE endpointman_product_list.id = endpointman_template_list.product_id AND endpointman_brand_list.id = endpointman_product_list.brand AND endpointman_template_list.model_id = endpointman_model_list.id AND endpointman_template_list.id = ".$id; 
     738            $sql = "SELECT endpointman_model_list.max_lines, endpointman_product_list.config_files, endpointman_mac_list.*, endpointman_product_list.id as product_id, endpointman_product_list.long_name, endpointman_model_list.template_data, endpointman_product_list.cfg_dir, endpointman_brand_list.directory FROM endpointman_brand_list, endpointman_mac_list, endpointman_model_list, endpointman_product_list WHERE endpointman_mac_list.id=".$id." AND endpointman_mac_list.model = endpointman_model_list.id AND endpointman_model_list.brand = endpointman_brand_list.id AND endpointman_model_list.product_id = endpointman_product_list.id"; 
     739        } else { 
     740            $sql = "SELECT endpointman_model_list.max_lines, endpointman_brand_list.directory, endpointman_product_list.cfg_dir, endpointman_product_list.config_files, endpointman_product_list.long_name, endpointman_model_list.template_data, endpointman_model_list.id as model_id, endpointman_template_list.* FROM endpointman_brand_list, endpointman_product_list, endpointman_model_list, endpointman_template_list WHERE endpointman_product_list.id = endpointman_template_list.product_id AND endpointman_brand_list.id = endpointman_product_list.brand AND endpointman_template_list.model_id = endpointman_model_list.id AND endpointman_template_list.id = ".$id; 
    783741        } 
    784742 
     
    831789                            } 
    832790                        } elseif ($config_options['type'] == 'loop_line_options') { 
    833                             for($a=1;$a<=3;$a++) { 
     791                            for($a=1;$a<=$row['max_lines'];$a++) { 
    834792                                foreach($config_options['data']['item'] as $items) { 
    835793                                    if(isset($items['description'])) { 
     
    888846        $this->db->query($sql); 
    889847 
    890         $phone_info = ""
     848        $phone_info = array()
    891849 
    892850        if($custom != 0) { 
    893851            $phone_info = $this->get_phone_info($id); 
    894             $this->prepare_configs($phone_info); 
    895  
     852            if(isset($_REQUEST['epm_reboot'])) { 
     853                $this->prepare_configs($phone_info); 
     854            } else { 
     855                $this->prepare_configs($phone_info,FALSE); 
     856            } 
    896857        } else { 
    897858            $sql = 'SELECT id FROM endpointman_mac_list WHERE template_id = '.$id; 
     
    899860            foreach($phones as $data) { 
    900861                $phone_info = $this->get_phone_info($data['id']); 
    901                 $this->prepare_configs($phone_info); 
     862                if(isset($_REQUEST['epm_reboot'])) { 
     863                    $this->prepare_configs($phone_info); 
     864                } else { 
     865                    $this->prepare_configs($phone_info,FALSE); 
     866                } 
    902867            } 
    903868        } 
     
    10361001        //template_data_custom.xml which will get included or template_data_<model_name>_custom.xml which will also get included 
    10371002        //line 'global' will set variables that aren't line dependant 
    1038  
    10391003        $provisioner_lib->options = $new_template_data; 
    10401004 
     
    10511015        $time = $time_end - $time_start; 
    10521016        if($time > 360) { 
    1053             $this->error['generate_time'] = "It's taking a awfully long time to generate configs...(".round($time,2)." seconds)"; 
     1017            $this->error['generate_time'] = "It took an awfully long time to generate configs...(".round($time,2)." seconds)"; 
    10541018        } 
    10551019        //Create Directory Structure (If needed) 
     
    12601224        } elseif(!empty($array)) { 
    12611225            return($array); 
     1226        //This is so stupid?! PHP gets confused. 
     1227        } elseif($array == '0') { 
     1228            return($array); 
    12621229        } else { 
    12631230            return(""); 
     
    14181385    } 
    14191386 
     1387    /** 
     1388     * This will download the xml & brand package remotely 
     1389     * @param integer $id Brand ID 
     1390     */ 
    14201391    function download_brand($id) { 
    14211392        $row =& $this->db->getAll('SELECT * FROM  endpointman_brand_list WHERE id ='.$id, array(), DB_FETCHMODE_ASSOC); 
     
    14741445 
    14751446        echo "Removing Temporary Files.............."; 
    1476         $this->deltree(PHONE_MODULES_PATH."temp/" .$row[0]['directory']); 
     1447        $this->rmrf(PHONE_MODULES_PATH."temp/" .$row[0]['directory']); 
    14771448        unlink(PHONE_MODULES_PATH.'temp/'. $package); 
    14781449        echo "Done!<br />"; 
     
    16331604        $this->db->query($sql); 
    16341605 
    1635         $this->deltree(PHONE_MODULES_PATH .$brand_dir); 
     1606        $this->rmrf(PHONE_MODULES_PATH .$brand_dir); 
    16361607        $sql = "DELETE FROM endpointman_brand_list WHERE id = ". $id; 
    16371608 
     
    18791850            return($exec); 
    18801851        } 
    1881     } 
    1882  
    1883     /** 
    1884      * Delete Directory Tree. 
    1885      * @deprecated In favor of rmrf 
    1886      * @param string $dir Full Directory path to delete 
    1887      */ 
    1888     function deltree($dir) { 
    1889         $this->rmrf($dir); 
    18901852    } 
    18911853 
  • modules/branches/2.9/endpointman/includes/template_manager.inc

    r10792 r10797  
    106106    $endpoint->tpl->assign("no_add", $no_add); 
    107107    $endpoint->tpl->assign("debug", $debug); 
    108     $endpoint->tpl->assign("web_path", WEB_PATH); 
    109108 
    110109    foreach($endpoint->error as $key => $error) { 
  • modules/branches/2.9/endpointman/install.php

    r10792 r10797  
    9292} 
    9393 
    94 $version = "2.4.1"; 
     94$version = "2.9.0.3"; 
    9595 
    9696if(ep_table_exists("endpointman_global_vars")) { 
     
    168168} elseif($global_cfg['version'] == '2.4.2') { 
    169169    $ver = "2.4.2"; 
     170} elseif($global_cfg['version'] == '2.9.0.0') { 
     171    $ver = "2.9.0.0"; 
     172} elseif($global_cfg['version'] == '2.9.0.1') { 
     173    $ver = "2.9.0.1"; 
     174} elseif($global_cfg['version'] == '2.9.0.2') { 
     175    $ver = "2.9.0.2"; 
     176} elseif($global_cfg['version'] == '2.9.0.3') { 
     177    $ver = "2.9.0.3"; 
     178} elseif($global_cfg['version'] == '2.9.0.4') { 
     179    $ver = "2.9.0.4"; 
     180} elseif($global_cfg['version'] == '2.9.0.5') { 
     181    $ver = "2.9.0.5"; 
    170182} else { 
    171183    $ver = "1000"; 
     
    206218                (14, 'check_updates', '1'), 
    207219                (15, 'disable_htaccess', ''), 
    208                 (16, 'endpoint_vers', '0')"; 
     220                (16, 'endpoint_vers', '0'), 
     221                (17, 'disable_help', '0')"; 
    209222        $db->query($sql_update_vars); 
    210223 
     
    877890    } 
    878891 
     892    if ($ver <= "2.9.0.2") { 
     893        $sql = 'INSERT INTO `asterisk`.`endpointman_global_vars` (`idnum`, `var_name`, `value`) VALUES (NULL, \'disable_help\', \'0\');'; 
     894        $db->query($sql); 
     895    } 
     896 
    879897} 
    880898 
     
    939957            (14, 'check_updates', '0'), 
    940958            (15, 'disable_htaccess', ''), 
    941             (16, 'endpoint_vers', '0')"; 
     959            (16, 'endpoint_vers', '0'), 
     960            (17, 'disable_help', '0')"; 
    942961        $db->query($sql); 
    943962 
     
    11571176        mkdir($amp_conf['AMPWEBROOT']."/recordings/theme/js/"); 
    11581177 
    1159         copy(LOCAL_PATH. "templates/javascript/jquery.coda-slider-2.0.js", $amp_conf['AMPWEBROOT']."/recordings/theme/js/jquery.coda-slider-2.0.js"); 
    1160  
    1161         copy(LOCAL_PATH. "templates/javascript/jquery.easing.1.3.js", $amp_conf['AMPWEBROOT']."/recordings/theme/js/jquery.easing.1.3.js"); 
    1162  
    1163         copy(LOCAL_PATH. "templates/stylesheets/coda-slider-2.0a.css", $amp_conf['AMPWEBROOT']."/recordings/theme/coda-slider-2.0a.css"); 
     1178        copy(LOCAL_PATH. "templates/freepbx/javascript/jquery.coda-slider-2.0.js", $amp_conf['AMPWEBROOT']."/recordings/theme/js/jquery.coda-slider-2.0.js"); 
     1179 
     1180        copy(LOCAL_PATH. "templates/freepbx/javascript/jquery.easing.1.3.js", $amp_conf['AMPWEBROOT']."/recordings/theme/js/jquery.easing.1.3.js"); 
     1181 
     1182        copy(LOCAL_PATH. "templates/freepbx/stylesheets/coda-slider-2.0a.css", $amp_conf['AMPWEBROOT']."/recordings/theme/coda-slider-2.0a.css"); 
    11641183 
    11651184 
     
    11811200        } 
    11821201 
    1183         copy(LOCAL_PATH. "templates/javascript/jquery.coda-slider-2.0.js", $amp_conf['AMPWEBROOT']."/recordings/theme/js/jquery.coda-slider-2.0.js"); 
    1184  
    1185         copy(LOCAL_PATH. "templates/javascript/jquery.easing.1.3.js", $amp_conf['AMPWEBROOT']."/recordings/theme/js/jquery.easing.1.3.js"); 
     1202        copy(LOCAL_PATH. "templates/freepbx/javascript/jquery.coda-slider-2.0.js", $amp_conf['AMPWEBROOT']."/recordings/theme/js/jquery.coda-slider-2.0.js"); 
     1203 
     1204        copy(LOCAL_PATH. "templates/freepbx/javascript/jquery.easing.1.3.js", $amp_conf['AMPWEBROOT']."/recordings/theme/js/jquery.easing.1.3.js"); 
    11861205         
    1187         copy(LOCAL_PATH. "templates/stylesheets/coda-slider-2.0a.css", $amp_conf['AMPWEBROOT']."/recordings/theme/coda-slider-2.0a.css"); 
     1206        copy(LOCAL_PATH. "templates/freepbx/stylesheets/coda-slider-2.0a.css", $amp_conf['AMPWEBROOT']."/recordings/theme/coda-slider-2.0a.css"); 
    11881207 
    11891208 
  • modules/branches/2.9/endpointman/module.xml

    r10793 r10797  
    22  <rawname>endpointman</rawname> 
    33  <name>PBX End Point Manager</name> 
    4   <version>2.9.0.1</version> 
     4  <version>2.9.0.3RC1</version> 
    55  <type>tool</type> 
    66  <category>End Point Manager</category> 
     
    2121        </changelog> 
    2222  <info>http://projects.colsolgrp.net/projects/show/endpointman</info> 
    23   <location>release/2.9/endpointman-2.9.0.1.tgz</location> 
     23  <location>contributed_modules/release/endpointman-2.3.2.tgz</location> 
    2424 
    25 <md5sum>ff802d5bfae951860d0efe69b9079ddb</md5sum> 
     25<md5sum>b0e3a14a20449b0441d1a9f432f19559</md5sum> 
    2626</module> 
  • modules/branches/2.9/endpointman/templates/freepbx/advanced_settings_settings.html

    r10792 r10797  
    6464  </label></td> 
    6565</tr> 
    66 <!-- 
    6766<tr> 
    68   <td align='right'><?=_("Enable Nightly Phone Module Updates Check")?></td> 
     67  <td align='right'><?=_("Disable Tooltips")?></td> 
    6968  <td align='left'><label> 
    70     <input type=checkbox name="enable_updates" {$updates_selected}> 
     69    <input type=checkbox name="disable_help" {$help_selected}> 
    7170  </label></td> 
    7271</tr> 
    73 --> 
    7472<tr> 
    7573<td colspan='2' align='center'><input type='Submit' name='button_update_globals' value='<?=_('Update Globals')?>'></td> 
  • modules/branches/2.9/endpointman/templates/freepbx/devices_manager.html

    r10792 r10797  
    301301  {loop name="list"} 
    302302        <tr class="headerRow"> 
    303             <td align='center' ><div id="demo"><img src="{$web_path}templates/images/bullet_plus.png" id="imgrowGroup{$value.master_id}" alt="" onclick="toggleDisplay(document.getElementById('devList'),'headerRow','rowGroup{$value.master_id}')" title="Expand Line Information"><input type="checkbox" name="selected[]" value="{$value.id}"></div></td> 
     303            <td align='center' ><div id="demo"><a href="#"><img src="{$web_path}templates/images/bullet_plus.png" id="imgrowGroup{$value.master_id}" alt="" onclick="toggleDisplay(document.getElementById('devList'),'headerRow','rowGroup{$value.master_id}')" title="Expanded Line Information"><input type="checkbox" name="selected[]" value="{$value.id}"></a></div></td> 
    304304            <td align='center' width='11%'>{$value.mac}</td> 
    305305            <td width="13%" align='center'>{$value.name}</td> 
    306306            <td width="14%" align='center'>{$value.model}</td> 
    307             <td width="10%" align='center'></td> 
    308             <td width="19%" align='center'></td> 
     307            <td width="10%" align='center'><div id="demo"><a href="#"><img src="{$web_path}templates/images/expand.png" id="img2rowGroup{$value.master_id}" onclick="toggleDisplay(document.getElementById('devList'),'headerRow','rowGroup{$value.master_id}')" title="Expanded Line Information"></a></div></td> 
     308            <td width="19%" align='center'><div id="demo"><a href="#"><img src="{$web_path}templates/images/expand.png" id="img3rowGroup{$value.master_id}" onclick="toggleDisplay(document.getElementById('devList'),'headerRow','rowGroup{$value.master_id}')" title="Expanded Line Information"></a></div></td> 
    309309            <td align='center' width='15%'>{$value.template_name}</td> 
    310310            <td align='center' width='9%'><div id="demo"><a href='javascript:submit_wtype("edit",{$value.id});'><img src='{$web_path}templates/images/edit.png' ALT='<?=_('Edit')?>' title='Edit Device' border='0'></a></div></td> 
     
    373373</form> 
    374374 
     375{if condition="!isset($disable_help)"} 
    375376<script> 
    376377    $("#demo img[title]").tooltip(); 
    377 </script>  
     378</script> 
     379{/if} 
    378380{include="global_footer"} 
  • modules/branches/2.9/endpointman/templates/freepbx/global_header.html

    r10792 r10797  
    126126                                tblRows[i].style.display = ''; 
    127127                                document.getElementById("img"+rowClass).src= '{$web_path}templates/images/bullet_minus.png'; 
     128                                document.getElementById("img2"+rowClass).src= '{$web_path}templates/images/collapse.png'; 
     129                                document.getElementById("img3"+rowClass).src= '{$web_path}templates/images/collapse.png'; 
    128130                            }else{ 
    129131                                tblRows[i].style.display = 'none'; 
    130132                                document.getElementById("img"+rowClass).src= '{$web_path}templates/images/bullet_plus.png'; 
     133                                document.getElementById("img2"+rowClass).src= '{$web_path}templates/images/expand.png'; 
     134                                document.getElementById("img3"+rowClass).src= '{$web_path}templates/images/expand.png'; 
    131135                            } 
    132136                        } 
  • modules/branches/2.9/endpointman/templates/freepbx/template_editor.html

    r10792 r10797  
    1717    <body> 
    1818{else} 
     19<script type="text/javascript" src="<?=WEB_PATH?>templates/freepbx/javascript/jquery.tooltip.v.1.1.js"></script> 
     20<script type="text/javascript" src="<?=WEB_PATH?>templates/freepbx/javascript/jquery.tooltip.execute.js"></script> 
     21<link href="<?=WEB_PATH?>templates/freepbx/stylesheets/simpletooltip.css" rel="stylesheet" type="text/css" /> 
    1922<script language="javascript" type="text/javascript"> 
    2023        function popitup(url, name) { 
     
    113116              {/loop} 
    114117            {elseif condition="$value.type == 'list'"} 
    115               {$value.description} <select name='{$value.key}' id='{$value.key}'> 
     118              {$value.description}: <select name='{$value.key}' id='{$value.key}'> 
    116119              {loop name="value.data"} 
    117120                                            <option value='{$value.value}' {if condition="array_key_exists('selected',$value)"}{$value.selected}{/if}>{$value.description}</option> 
     
    141144            <input name="custom" id="custom" type="hidden" value="{$hidden_custom}"> 
    142145            {if condition="!isset($in_ari)"} 
     146            Reboot Phone(s) <input type='checkbox' name='epm_reboot'><br /> 
    143147            <input type="submit" name="button_save_template" value="<?=_('Save Template');?>"> 
    144148        </form> 
  • modules/branches/2.9/endpointman/uninstall.php

    r10315 r10797  
    2828 
    2929out("Removing Phone Modules Directory"); 
    30 $endpoint->deltree(PHONE_MODULES_PATH); 
     30$endpoint->rmrf(PHONE_MODULES_PATH); 
    3131exec("rm -R ". PHONE_MODULES_PATH); 
    3232