Changeset 11618
- Timestamp:
- 02/27/11 20:03:06 (2 years ago)
- Files:
-
- modules/branches/2.9/endpointman/assets/js/jquery-1.3.2.min.js (deleted)
- modules/branches/2.9/endpointman/assets/js/jquery.js (deleted)
- modules/branches/2.9/endpointman/functions.inc.php (modified) (5 diffs)
- modules/branches/2.9/endpointman/includes/abstraction/freepbx.inc (modified) (2 diffs)
- modules/branches/2.9/endpointman/includes/advanced.inc (modified) (9 diffs)
- modules/branches/2.9/endpointman/includes/brand_model_manager.inc (modified) (1 diff)
- modules/branches/2.9/endpointman/includes/functions.inc (modified) (37 diffs)
- modules/branches/2.9/endpointman/includes/installer.php (modified) (1 diff)
- modules/branches/2.9/endpointman/includes/popup.php (modified) (4 diffs)
- modules/branches/2.9/endpointman/install.php (modified) (4 diffs)
- modules/branches/2.9/endpointman/module.xml (modified) (3 diffs)
- modules/branches/2.9/endpointman/templates/freepbx/advanced_settings_iedl.html (modified) (1 diff)
- modules/branches/2.9/endpointman/templates/freepbx/advanced_settings_manual_upload.html (modified) (2 diffs)
- modules/branches/2.9/endpointman/templates/freepbx/advanced_settings_oui.html (modified) (2 diffs)
- modules/branches/2.9/endpointman/templates/freepbx/advanced_settings_poce.html (modified) (5 diffs)
- modules/branches/2.9/endpointman/templates/freepbx/advanced_settings_settings.html (modified) (3 diffs)
- modules/branches/2.9/endpointman/templates/freepbx/advanced_settings_sh_manager.html (modified) (3 diffs)
- modules/branches/2.9/endpointman/templates/freepbx/advanced_subheader.html (modified) (1 diff)
- modules/branches/2.9/endpointman/templates/freepbx/brand_model_manager.html (modified) (4 diffs)
- modules/branches/2.9/endpointman/templates/freepbx/devices_manager.html (modified) (3 diffs)
- modules/branches/2.9/endpointman/templates/freepbx/global_footer.html (modified) (2 diffs)
- modules/branches/2.9/endpointman/templates/freepbx/global_header.html (modified) (3 diffs)
- modules/branches/2.9/endpointman/templates/freepbx/message_box.html (modified) (1 diff)
- modules/branches/2.9/endpointman/templates/freepbx/template_editor.html (modified) (2 diffs)
- modules/branches/2.9/endpointman/templates/freepbx/template_manager.html (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/branches/2.9/endpointman/functions.inc.php
r11318 r11618 34 34 } 35 35 function endpointman_configpageinit($pagename) { 36 global $currentcomponent ;36 global $currentcomponent, $amp_conf; 37 37 38 38 $display = isset($_REQUEST['display'])?$_REQUEST['display']:null; 39 if(isset($_REQUEST['extension'])) { 40 $extdisplay = isset($_REQUEST['extension'])?$_REQUEST['extension']:null; 41 } else { 39 40 if($display == "extensions") { 41 if(isset($_REQUEST['extension'])) { 42 $extdisplay = isset($_REQUEST['extension'])?$_REQUEST['extension']:null; 43 } else { 44 $extdisplay = isset($_REQUEST['extdisplay'])?$_REQUEST['extdisplay']:null; 45 } 46 } elseif($display == "devices") { 42 47 $extdisplay = isset($_REQUEST['extdisplay'])?$_REQUEST['extdisplay']:null; 43 48 } 49 44 50 $action = isset($_REQUEST['action'])?$_REQUEST['action']:null; 45 51 $delete = isset($_REQUEST['epm_delete'])?$_REQUEST['epm_delete']:null; 46 52 $tech = isset($_REQUEST['tech_hardware'])?$_REQUEST['tech_hardware']:null; 47 53 48 if(( $display == "extensions") && (isset($extdisplay) OR ($tech == "sip_generic"))) {54 if((($display == "extensions") OR ($display == "devices")) && (isset($extdisplay) OR ($tech == "sip_generic"))) { 49 55 global $endpoint; 50 56 51 $doc_root = $ _SERVER["DOCUMENT_ROOT"] ."/admin/modules/endpointman/";57 $doc_root = $amp_conf['AMPWEBROOT'] ."/admin/modules/endpointman/"; 52 58 require($doc_root . "includes/functions.inc"); 53 59 … … 80 86 $line = isset($_REQUEST['epm_line'])?$_REQUEST['epm_line']:null; 81 87 $temp = isset($_REQUEST['epm_temps'])?$_REQUEST['epm_temps']:null; 82 $name = isset($_REQUEST['name'])?$_REQUEST['name']:null; 88 if(isset($_REQUEST['name'])) { 89 $name = isset($_REQUEST['name'])?$_REQUEST['name']:null; 90 } else { 91 $name = isset($_REQUEST['description'])?$_REQUEST['description']:null; 92 } 83 93 $reboot = isset($_REQUEST['epm_reboot'])?$_REQUEST['epm_reboot']:null; 84 94 … … 165 175 function endpointman_configpageload() { 166 176 global $currentcomponent, $endpoint, $db; 177 178 $display = isset($_REQUEST['display'])?$_REQUEST['display']:null; 167 179 168 180 // Init vars from $_REQUEST[] … … 236 248 $currentcomponent->addguielem($section, new gui_checkbox('epm_delete', $checked, 'Delete','Delete this Extension from Endpoint Manager'),9); 237 249 $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); 238 $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);239 $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);250 $currentcomponent->addguielem($section, new gui_selectbox('epm_brand', $brand_list, $info['brand_id'], 'Brand', 'The Brand of this Phone.', false, 'frm_'.$display.'_brand_change(this.options[this.selectedIndex].value)', false),9); 251 $currentcomponent->addguielem($section, new gui_selectbox('epm_model', $model_list, $info['model_id'], 'Model', 'The Model of this Phone.', false, 'frm_'.$display.'_model_change(this.options[this.selectedIndex].value,\''.$line_info['luid'].'\')', false),9); 240 252 $currentcomponent->addguielem($section, new gui_selectbox('epm_line', $line_list, $line_info['line'], 'Line', 'The Line of this Extension/Device.', false, '', false),9); 241 253 $currentcomponent->addguielem($section, new gui_selectbox('epm_temps', $template_list, $info['template_id'], 'Template', 'The Template of this Phone.', false, '', false),9); … … 272 284 273 285 $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); 274 $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);275 $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);286 $currentcomponent->addguielem($section, new gui_selectbox('epm_brand', $brand_list, $info['brand_id'], 'Brand', 'The Brand of this Phone.', false, 'frm_'.$display.'_brand_change(this.options[this.selectedIndex].value)', false),9); 287 $currentcomponent->addguielem($section, new gui_selectbox('epm_model', $model_list, $info['model_id'], 'Model', 'The Model of this Phone.', false, 'frm_'.$display.'_model_change(this.options[this.selectedIndex].value,document.getElementById(\'epm_mac\').value)', false),9); 276 288 $currentcomponent->addguielem($section, new gui_selectbox('epm_line', $line_list, $line_info['line'], 'Line', 'The Line of this Extension/Device.', false, '', false),9); 277 289 $currentcomponent->addguielem($section, new gui_selectbox('epm_temps', $template_list, $info['template_id'], 'Template', 'The Template of this Phone.', false, '', false),9); modules/branches/2.9/endpointman/includes/abstraction/freepbx.inc
r10792 r11618 9 9 public $db; 10 10 public $amp_conf; 11 public $global_cfg; 11 12 12 13 function __construct() { 13 14 //Pull in shit from FreePBX! (it's all about the globals baaaaabbbyyyyyyyy) 14 global $amp_conf, $db , $global_cfg;15 global $amp_conf, $db; 15 16 16 17 //The only time dbh_asterisk is set is when we are inside the ARI Recording interface … … 114 115 115 116 function all_unused_registrations() { 116 $not_added="SELECT devices.id, devices.description FROM devices WHERE tech='sip' AND devices.id not in (SELECT devices.id FROM devices, endpointman_line_list WHERE tech='sip' AND devices.id = endpointman_line_list.ext ) ORDER BY devices.id"; 117 if($this->global_cfg['show_all_registrations']) { 118 $not_added="SELECT devices.id, devices.description FROM devices WHERE tech='sip' ORDER BY devices.id"; 119 } else { 120 $not_added="SELECT devices.id, devices.description FROM devices WHERE tech='sip' AND devices.id not in (SELECT devices.id FROM devices, endpointman_line_list WHERE tech='sip' AND devices.id = endpointman_line_list.ext ) ORDER BY devices.id"; 121 } 117 122 $result =& $this->db->getAll($not_added,array(), DB_FETCHMODE_ASSOC); 118 123 return($result); modules/branches/2.9/endpointman/includes/advanced.inc
r11075 r11618 159 159 $endpoint->error['manual_upload'] = "Invalid File Extension"; 160 160 } 161 162 163 } elseif(isset($_REQUEST['upload_master_xml'])) {164 $extension = pathinfo($_FILES["xml"]["name"],PATHINFO_EXTENSION);165 if($extension == "xml") {166 if ($_FILES['xml']['error'] == UPLOAD_ERR_OK) {167 $tmp_name = $_FILES['xml']["tmp_name"];168 $name = $_FILES['xml']["name"];169 move_uploaded_file($tmp_name, "$uploads_dir/$name");170 $endpoint->tpl->assign("show_installer", 1);171 $endpoint->tpl->assign("package", 0);172 $endpoint->tpl->assign("type", "upload_master_xml");173 $endpoint->tpl->assign("xml", $name);174 } else {175 $endpoint->error['manual_upload'] = $endpoint->file_upload_error_message($_FILES['xml']['error']);176 }177 } else {178 $endpoint->error['manual_upload'] = "Invalid File Extension";179 }180 161 } elseif(isset($_REQUEST['upload_brand'])) { 181 162 $error = FALSE; … … 184 165 foreach($_FILES as $files) { 185 166 $extension = pathinfo($files["name"],PATHINFO_EXTENSION); 186 if( ($extension == "xml") OR ($extension == "tgz")) {167 if($extension == "tgz") { 187 168 if ($files['error'] == UPLOAD_ERR_OK) { 188 169 $tmp_name = $files["tmp_name"]; … … 202 183 if(!$error){ 203 184 $endpoint->tpl->assign("show_installer", 1); 204 $endpoint->tpl->assign("package", $files_list[ 1]);185 $endpoint->tpl->assign("package", $files_list[0]); 205 186 $endpoint->tpl->assign("type", "upload_brand"); 206 $endpoint->tpl->assign("xml", $files_list[0]);207 187 } else { 208 188 $message = $error_message; … … 338 318 $message = "Deleted!"; 339 319 } 340 if(1 == 0) {341 $file = $_REQUEST['temp_file'];342 343 $sql = "SELECT cfg_dir,directory,config_files FROM endpointman_product_list,endpointman_brand_list WHERE endpointman_product_list.brand = endpointman_brand_list.id AND endpointman_product_list.id = '". $_REQUEST['product_select'] ."'";344 $row =& $endpoint->db->getRow($sql, array(), DB_FETCHMODE_ASSOC);345 346 $file=PHONE_MODULES_PATH.'endpoint/'.$row['directory']."/".$row['cfg_dir']."/".$file;347 348 if(isset($_REQUEST['config_text'])) {349 if(isset($_REQUEST['button_save'])) {350 $wfh=fopen($file,'w');351 fwrite($wfh,$_REQUEST['config_text']);352 fclose($wfh);353 }354 }355 356 if(!file_exists($file)) {357 $fp = fopen($file, 'w');358 fwrite($fp, '359 <!--<template_data>360 <item>361 <description>General Settings</description>362 <type>group</type>363 </item>364 <item>365 <variable>$sip_digit_timeout</variable>366 <default_value>4</default_value>367 <description>SIP Digit Timeout</description>368 <type>input</type>369 </item>370 </template_data>-->371 ');372 fclose($fp);373 }374 $handle = fopen($file, "rb");375 $contents = fread($handle, filesize($file));376 fclose($handle);377 $endpoint->tpl->assign("location", $file);378 $endpoint->tpl->assign("config_data", $contents);379 }380 320 if(isset($_REQUEST['file'])) { 381 321 $sql = "SELECT cfg_dir,directory,config_files FROM endpointman_product_list,endpointman_brand_list WHERE endpointman_product_list.brand = endpointman_brand_list.id AND endpointman_product_list.id = '". $_REQUEST['product_select'] ."'"; … … 407 347 408 348 $endpoint->tpl->assign("save_as_name_value", $config_files[$_REQUEST['file']]); 349 350 $contents = $endpoint->display_htmlspecialchars($contents); 351 409 352 $endpoint->tpl->assign("config_data", $contents); 410 353 $endpoint->tpl->assign("filename", $config_files[$_REQUEST['file']]); … … 438 381 } 439 382 383 $row['data'] = $endpoint->display_htmlspecialchars($row['data']); 384 440 385 $endpoint->tpl->assign("save_as_name_value", $row['name']); 441 386 $endpoint->tpl->assign("filename", $row['original_name']); … … 574 519 $_POST['disable_help'] = 0; 575 520 } 521 if((isset($_POST['allow_dupext'])) AND ($_POST['allow_dupext'] == "on")) { 522 $_POST['allow_dupext'] = 1; 523 } else { 524 $_POST['allow_dupext'] = 0; 525 } 526 527 $sql="UPDATE endpointman_global_vars SET value='" . $_POST['allow_dupext'] . "' WHERE var_name='show_all_registrations'"; 528 $endpoint->db->query($sql); 576 529 577 530 $sql="UPDATE endpointman_global_vars SET value='" . $_POST['enable_ari'] . "' WHERE var_name='enable_ari'"; … … 606 559 $endpoint->global_cfg =& $db->getAssoc("SELECT var_name, value FROM endpointman_global_vars"); 607 560 561 if($endpoint->global_cfg['show_all_registrations']) { 562 $dupext_selected= "checked"; 563 } else { 564 $dupext_selected = ""; 565 } 608 566 609 567 if($endpoint->global_cfg['enable_ari']) { … … 628 586 } 629 587 $endpoint->tpl->assign("help_selected", $help_selected); 588 $endpoint->tpl->assign("dupext_selected", $dupext_selected); 630 589 631 590 $endpoint->tpl->assign("ari_selected", $ari_selected); modules/branches/2.9/endpointman/includes/brand_model_manager.inc
r10792 r11618 44 44 } 45 45 } elseif(isset($_REQUEST['button_check_for_updates'])) { 46 $brand_up = $endpoint-> brand_update_check();46 $brand_up = $endpoint->update_check(); 47 47 $endpoint->tpl->assign("update_check", 1); 48 48 modules/branches/2.9/endpointman/includes/functions.inc
r11318 r11618 29 29 $this->global_cfg = $this->endpoint_data->get_stored_globals(); 30 30 31 $this->endpoint_data->global_cfg = $this->global_cfg; 32 31 33 $this->global_cfg['disable_epm'] = FALSE; 32 34 … … 44 46 $this->amp_conf = $amp_conf; 45 47 } else { 46 $this->error['amp_conf'] = "The Global Variable $amp_conf is empty or not set! Can't connect to the database.";48 $this->error['amp_conf'] = 'The Global Variable $amp_conf is empty or not set! Can\'t connect to the database.'; 47 49 $this->global_cfg['disable_epm'] = TRUE; 48 50 } … … 53 55 //end possible removal 54 56 55 define("MODULES_PATH", $this->get_modules_dir());57 define("MODULES_PATH", $this->get_modules_dir()); 56 58 57 59 //Define the location of phone modules, keeping it outside of the module directory so that when the user updates endpointmanager they don't lose all of their phones … … 108 110 $this->tpl->assign("disable_help", 1); 109 111 } 110 } 111 112 function get_modules_dir() { 113 114 $file_name = "endpointman/includes/functions.inc"; 115 116 $includes = get_included_files(); 117 foreach($includes as $key => $data) { 118 if(strripos($data,$file_name)) { 119 $keyout = $key; 120 break; 121 } 122 } 123 124 $stripped_path = str_replace("endpointman/includes/functions.inc", "", $includes[$keyout]); 125 126 return $stripped_path; 127 } 112 113 $sql = 'SELECT value FROM `admin` WHERE `variable` LIKE CONVERT(_utf8 \'version\' USING latin1) COLLATE latin1_swedish_ci'; 114 $this->global_cfg['amp_ver'] = $this->db->getOne($sql); 115 $this->tpl->assign("amp_ver", (float)$this->global_cfg['amp_ver']); 116 117 } 118 119 function display_htmlspecialchars($contents) { 120 $contents = str_replace("&", "&amp;", $contents); 121 $contents = str_replace("<", "&lt;", $contents); 122 $contents = str_replace(">", "&gt;", $contents); 123 $contents = str_replace(""", "&quot;", $contents); 124 $contents = str_replace("'", "&#039;", $contents); 125 return($contents); 126 } 127 128 function get_modules_dir() { 129 130 $file_name = "endpointman/includes/functions.inc"; 131 132 $includes = get_included_files(); 133 foreach($includes as $key => $data) { 134 if(strripos($data,$file_name)) { 135 $keyout = $key; 136 break; 137 } 138 } 139 140 $stripped_path = str_replace("endpointman/includes/functions.inc", "", $includes[$keyout]); 141 142 return $stripped_path; 143 } 128 144 129 145 … … 218 234 //Find the matching brand model to the oui 219 235 $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"; 220 $brand = &$this->db->getRow($oui_sql, array(), DB_FETCHMODE_ASSOC);221 222 $res = &$this->db->query($oui_sql);236 $brand = $this->db->getRow($oui_sql, array(), DB_FETCHMODE_ASSOC); 237 238 $res = $this->db->query($oui_sql); 223 239 $brand_count = $res->numRows(); 224 240 … … 250 266 function delete_line($lineid,$allow_device_remove=FALSE) { 251 267 $sql = 'SELECT mac_id FROM endpointman_line_list WHERE luid = '.$lineid ; 252 $mac_id = &$this->db->getOne($sql,array(),DB_FETCHMODE_ASSOC);268 $mac_id = $this->db->getOne($sql,array(),DB_FETCHMODE_ASSOC); 253 269 $row = $this->get_phone_info($mac_id); 254 270 255 271 $sql = 'SELECT COUNT(*) FROM endpointman_line_list WHERE mac_id = '.$mac_id; 256 $num_lines = &$this->db->getOne($sql,array(),DB_FETCHMODE_ASSOC);272 $num_lines = $this->db->getOne($sql,array(),DB_FETCHMODE_ASSOC); 257 273 if($num_lines > 1) { 258 274 $sql = "DELETE FROM endpointman_line_list WHERE luid=".$lineid; … … 344 360 $sql = "SELECT id FROM endpointman_mac_list WHERE model > 0 AND id =".$mac_id; 345 361 346 $res = &$this->db->query($sql);362 $res = $this->db->query($sql); 347 363 if($res->numRows()) { 348 364 //Returns Brand Name, Brand Directory, Model Name, Mac Address, Extension (FreePBX), Custom Configuration Template, Custom Configuration Data, Product Name, Product ID, Product Configuration Directory, Product Configuration Version, Product XML name, 349 365 $sql = "SELECT endpointman_mac_list.config_files_override, endpointman_mac_list.global_user_cfg_data, endpointman_model_list.id as model_id, endpointman_brand_list.id as brand_id, endpointman_brand_list.name, endpointman_brand_list.directory, endpointman_model_list.model, endpointman_mac_list.mac, endpointman_mac_list.template_id, endpointman_mac_list.global_custom_cfg_data, endpointman_product_list.long_name, endpointman_product_list.id as product_id, endpointman_product_list.cfg_dir, endpointman_product_list.cfg_ver, endpointman_model_list.template_data, endpointman_model_list.enabled FROM endpointman_line_list, endpointman_mac_list, endpointman_model_list, endpointman_brand_list, endpointman_product_list WHERE endpointman_mac_list.model = endpointman_model_list.id AND endpointman_brand_list.id = endpointman_model_list.brand AND endpointman_product_list.id = endpointman_model_list.product_id AND endpointman_mac_list.id = endpointman_line_list.mac_id AND endpointman_mac_list.id = ". $mac_id; 350 366 351 $phone_info = &$this->db->getRow($sql, array(), DB_FETCHMODE_ASSOC);367 $phone_info = $this->db->getRow($sql, array(), DB_FETCHMODE_ASSOC); 352 368 353 369 if(!$phone_info) { … … 359 375 $sql = "SELECT name, global_custom_cfg_data, config_files_override FROM endpointman_template_list WHERE id = ".$phone_info['template_id']; 360 376 361 $phone_info['template_data_info'] = &$this->db->getRow($sql, array(), DB_FETCHMODE_ASSOC);377 $phone_info['template_data_info'] = $this->db->getRow($sql, array(), DB_FETCHMODE_ASSOC); 362 378 363 379 } 364 380 365 381 $sql = "SELECT endpointman_line_list.*, sip.data as secret, devices.* FROM endpointman_line_list, sip, devices WHERE endpointman_line_list.ext = devices.id AND endpointman_line_list.ext = sip.id AND sip.keyword = 'secret' AND mac_id = ".$mac_id." ORDER BY endpointman_line_list.line ASC"; 366 $lines_info = &$this->db->getAll($sql, array(), DB_FETCHMODE_ASSOC);382 $lines_info = $this->db->getAll($sql, array(), DB_FETCHMODE_ASSOC); 367 383 foreach($lines_info as $line) { 368 384 $phone_info['line'][$line['line']] = $line; … … 373 389 $sql = "SELECT id, mac, ext FROM endpointman_mac_list WHERE id =".$mac_id; 374 390 //Phone is unknown, we need to display this to the end user so that they can make corrections 375 $row = &$this->db->getRow($sql, array(), DB_FETCHMODE_ASSOC);391 $row = $this->db->getRow($sql, array(), DB_FETCHMODE_ASSOC); 376 392 377 393 $brand = $this->get_brand_from_mac($row['mac']); … … 390 406 $phone_info['mac'] = $row['mac']; 391 407 $sql = "SELECT endpointman_line_list.*, sip.data as secret, devices.* FROM endpointman_line_list, sip, devices WHERE endpointman_line_list.ext = devices.id AND endpointman_line_list.ext = sip.id AND sip.keyword = 'secret' AND mac_id = ".$mac_id; 392 $lines_info = &$this->db->getAll($sql, array(), DB_FETCHMODE_ASSOC);408 $lines_info = $this->db->getAll($sql, array(), DB_FETCHMODE_ASSOC); 393 409 foreach($lines_info as $line) { 394 410 $phone_info['line'][$line['line']] = $line; … … 431 447 } 432 448 433 $row = &$this->db->getRow($sql, array(), DB_FETCHMODE_ASSOC);449 $row = $this->db->getRow($sql, array(), DB_FETCHMODE_ASSOC); 434 450 435 451 $this->tpl->assign("template_editor_display", 1); … … 471 487 foreach($config_files_list as $files) { 472 488 $sql = "SELECT * FROM endpointman_custom_configs WHERE product_id = '".$row['product_id']."' AND original_name = '".$files."'"; 473 $alt_configs_list_count = &$this->db->query($sql);489 $alt_configs_list_count = $this->db->query($sql); 474 490 if($alt_configs_list_count->numRows() > 0) { 475 $alt_configs_list = &$this->db->getAll($sql, array(), DB_FETCHMODE_ASSOC);491 $alt_configs_list = $this->db->getAll($sql, array(), DB_FETCHMODE_ASSOC); 476 492 $alt_configs[$i]['name'] = $files; 477 493 $files = str_replace(".","_",$files); … … 498 514 $this->tpl->assign("alt", $alt); 499 515 if(!isset($_REQUEST['maxlines'])) { 500 $maxlines = $row['max_lines'];516 $maxlines = 3; 501 517 } else { 502 518 $maxlines = $_REQUEST['maxlines']; … … 832 848 833 849 //Load template data 834 $row = &$this->db->getRow($sql, array(), DB_FETCHMODE_ASSOC);850 $row = $this->db->getRow($sql, array(), DB_FETCHMODE_ASSOC); 835 851 836 852 $cfg_data = unserialize($row['template_data']); … … 1015 1031 foreach($temp as $list) { 1016 1032 $sql = "SELECT original_name,data FROM endpointman_custom_configs WHERE id = ".$list; 1017 $res = &$this->db->query($sql);1033 $res = $this->db->query($sql); 1018 1034 if($res->numRows()) { 1019 1035 $data = $this->db->getRow($sql, array(),DB_FETCHMODE_ASSOC); … … 1029 1045 foreach($temp as $list) { 1030 1046 $sql = "SELECT original_name,data FROM endpointman_custom_configs WHERE id = ".$list; 1031 $res = &$this->db->query($sql);1047 $res = $this->db->query($sql); 1032 1048 if($res->numRows()) { 1033 1049 $data = $this->db->getRow($sql, array(),DB_FETCHMODE_ASSOC); … … 1196 1212 function firmware_update_check($id=NULL) { 1197 1213 $sql = "SELECT * FROM endpointman_product_list WHERE id ='". $id."'"; 1198 $row = &$this->db->getRow($sql,array(),DB_FETCHMODE_ASSOC);1214 $row = $this->db->getRow($sql,array(),DB_FETCHMODE_ASSOC); 1199 1215 1200 1216 $sql = "SELECT directory FROM endpointman_brand_list WHERE id =". $row['brand']; 1201 $brand_directory = &$this->db->getOne($sql);1217 $brand_directory = $this->db->getOne($sql); 1202 1218 1203 1219 //config drive unknown! … … 1226 1242 function firmware_local_check($id=NULL) { 1227 1243 $sql = "SELECT * FROM endpointman_product_list WHERE hidden = 0 AND id ='". $id ."'"; 1228 $res = &$this->db->query($sql);1244 $res = $this->db->query($sql); 1229 1245 1230 1246 if($res->numRows()) { 1231 $row = &$this->db->getRow($sql,array(),DB_FETCHMODE_ASSOC);1247 $row = $this->db->getRow($sql,array(),DB_FETCHMODE_ASSOC); 1232 1248 1233 1249 $sql = "SELECT directory FROM endpointman_brand_list WHERE hidden = 0 AND id =". $row['brand']; 1234 $brand_directory = &$this->db->getOne($sql);1250 $brand_directory = $this->db->getOne($sql); 1235 1251 1236 1252 //config drive unknown! … … 1280 1296 function install_firmware($product_id) { 1281 1297 $sql = 'SELECT endpointman_product_list.*, endpointman_brand_list.directory FROM endpointman_product_list, endpointman_brand_list WHERE endpointman_product_list.brand = endpointman_brand_list.id AND endpointman_product_list.id = '.$product_id; 1282 $row = &$this->db->getRow($sql, array(), DB_FETCHMODE_ASSOC);1298 $row = $this->db->getRow($sql, array(), DB_FETCHMODE_ASSOC); 1283 1299 $temp = $this->xml2array(PHONE_MODULES_PATH."endpoint/".$row['directory']."/".$row['cfg_dir']."/family_data.xml"); 1284 1300 if($temp['data']['firmware_ver'] > $row['firmware_vers']) { … … 1350 1366 if(!isset($directory)) { 1351 1367 $destination_file = PHONE_MODULES_PATH.'master.xml'; 1352 $directory = "master";1368 $directory = "master"; 1353 1369 } else { 1354 1370 if(!file_exists(PHONE_MODULES_PATH.'/'.$directory)) { 1355 mkdir(PHONE_MODULES_PATH.'/'.$directory,0764 );1356 } 1371 mkdir(PHONE_MODULES_PATH.'/'.$directory,0764,TRUE); 1372 } 1357 1373 $destination_file = PHONE_MODULES_PATH.'/'.$directory.'/brand_data.xml'; 1358 1374 } 1359 1375 $temp_file = PHONE_MODULES_PATH.'temp/'.$directory.'.xml'; 1376 @mkdir(dirname($temp_file)); 1360 1377 if($this->download_xml_file($location, $temp_file)) { 1361 1378 $handle = fopen($temp_file, "rb"); … … 1382 1399 * @return array An array of all the brands/products/models and information about what's enabled, installed or otherwise 1383 1400 */ 1384 function brand_update_check() {1401 function update_check() { 1385 1402 $master_result = $this->download_xml(UPDATE_PATH . "master.xml"); 1386 1403 … … 1396 1413 1397 1414 $sql = "SELECT value FROM endpointman_global_vars WHERE var_name LIKE 'endpoint_vers'"; 1398 $data = &$this->db->getOne($sql);1415 $data = $this->db->getOne($sql); 1399 1416 1400 1417 if(($data == "") OR ($data <= $endpoint_last_mod)) { … … 1421 1438 //Assume that if we can't connect and find the master.xml file then why should we try to find every other file. 1422 1439 if($master_result) { 1423 $row = &$this->db->getAll('SELECT * FROM endpointman_brand_list WHERE id > 0', array(), DB_FETCHMODE_ASSOC);1440 $row = $this->db->getAll('SELECT * FROM endpointman_brand_list WHERE id > 0', array(), DB_FETCHMODE_ASSOC); 1424 1441 1425 1442 foreach($out as $data) { 1426 //TODO: Make this pull from the local directory 1427 $result = $this->download_xml(UPDATE_PATH .$data['directory']."/".$data['directory'].".xml","endpoint/".$data['directory']); 1428 if(!$result) { 1429 $this->error['brand_update_check'] = "<br/>Not able to connect to repository. Using local brand [".$data['name']."] file instead."; 1443 1444 $local = $this->db->getOne("SELECT local FROM endpointman_brand_list WHERE directory = '".$data['directory']."'"); 1445 1446 if(!$local) { 1447 $result = $this->download_xml(UPDATE_PATH .$data['directory']."/".$data['directory'].".xml","endpoint/".$data['directory']); 1448 if(!$result) { 1449 $this->error['brand_update_check'] = "<br/>Not able to connect to repository. Using local brand [".$data['name']."] file instead."; 1450 } 1430 1451 } 1431 1452 … … 1498 1519 */ 1499 1520 function download_brand($id) { 1500 $row = &$this->db->getAll('SELECT * FROM endpointman_brand_list WHERE id ='.$id, array(), DB_FETCHMODE_ASSOC);1521 $row = $this->db->getAll('SELECT * FROM endpointman_brand_list WHERE id ='.$id, array(), DB_FETCHMODE_ASSOC); 1501 1522 echo "Downloading Brand XML....."; 1502 1523 $result = $this->download_xml(UPDATE_PATH .$row[0]['directory']. "/".$row[0]['directory'].".xml","endpoint/".$row[0]['directory']); 1524 1503 1525 if($result) { 1504 1526 echo "Done!<br/>"; 1505 $temp = $this->xml2array(PHONE_MODULES_PATH.'/endpoint/'.$row[0]['directory'].'/brand_data.xml'); 1506 $this->update_brand($temp); 1527 1528 $temp = $this->xml2array(PHONE_MODULES_PATH.'endpoint/'. $row[0]['directory'].'/brand_data.xml'); 1529 $package = $temp['data']['brands']['package']; 1530 1531 echo "<div style='float: left'>Downloading Brand Package...</div><div style='float: left' id=\"DivExample\">.</div>"; 1532 $this->download_file_with_progress_bar(UPDATE_PATH.$row[0]['directory'].'/'.$package, PHONE_MODULES_PATH."temp/".$package); 1533 echo "<script type='text/javascript'>document.getElementById('DivExample').innerHTML='Done!';</script><br />"; 1534 1535 if(file_exists(PHONE_MODULES_PATH.'temp/'. $package)) { 1536 echo "Extracting Tarball........"; 1537 exec("tar -xvf ".PHONE_MODULES_PATH.'temp/'. $package ." -C ".PHONE_MODULES_PATH."temp/"); 1538 echo "Done!<br />"; 1539 1540 //Update File in directory 1541 copy(PHONE_MODULES_PATH.'endpoint/'. $row[0]['directory'].'/brand_data.xml', PHONE_MODULES_PATH.'temp/'. $row[0]['directory'].'/brand_data.xml'); 1542 1543 $package = basename($package, ".tgz"); 1544 $package = explode("-",$package); 1545 $this->update_brand($package[0]); 1546 } else { 1547 $this->error['uploader'] = "Can't Find Downloaded File!"; 1548 } 1507 1549 } else { 1508 1550 echo "<br/>Error Connecting to the Package Repository. Module not installed. Please Try again later.<br/>You Can Also Manually Update The Repository By Downloading Files here: <a href='http://www.provisioner.net/releases3' target='_blank'>Release Repo</a><br />Then Use Manual Upload in Advanced Settings"; … … 1513 1555 * This will install or updated a brand package (which is the same thing to this) 1514 1556 * Still needs way to determine when models move...perhaps another function? 1515 * @param <type> $id 1516 */ 1517 function update_brand($temp) { 1518 $row[0]['directory'] = $temp['data']['brands']['directory']; 1519 $brand_name = $temp['data']['brands']['name']; 1520 $brand_id = $temp['data']['brands']['brand_id']; 1521 $brand_version = $temp['data']['brands']['version']; 1522 $brand_last_mod = $temp['data']['brands']['last_modified']; 1523 $package = $temp['data']['brands']['package']; 1524 1525 echo "<div style='float: left'>Downloading Brand Package...</div><div style='float: left' id=\"DivExample\">.</div>"; 1526 $this->download_file_with_progress_bar(UPDATE_PATH.$row[0]['directory'].'/'.$package, PHONE_MODULES_PATH."temp/".$package); 1527 echo "<script type='text/javascript'>document.getElementById('DivExample').innerHTML='Done!';</script><br />"; 1528 1529 echo "Extracting Tarball........"; 1530 exec("tar -xvf ".PHONE_MODULES_PATH.'temp/'. $package ." -C ".PHONE_MODULES_PATH."temp/"); 1531 echo "Done!<br />"; 1532 1533 echo "Creating Directory Structure/Moving Files..............."; 1534 $dir_iterator = new RecursiveDirectoryIterator(PHONE_MODULES_PATH."temp/".$row[0]['directory']."/"); 1535 $iterator = new RecursiveIteratorIterator($dir_iterator, RecursiveIteratorIterator::SELF_FIRST); 1536 // could use CHILD_FIRST if you so wish 1537 1538 foreach ($iterator as $file) { 1539 if(is_dir($file)) { 1540 $dir = str_replace(PHONE_MODULES_PATH."temp/".$row[0]['directory']."/", "", $file); 1541 if(!file_exists(PHONE_MODULES_PATH."endpoint/".$row[0]['directory']."/".$dir)) { 1542 mkdir(PHONE_MODULES_PATH."endpoint/".$row[0]['directory']."/".$dir,0764); 1543 } 1544 } else { 1545 if(basename($file) != "brand_data.xml") { 1546 $dir = str_replace(PHONE_MODULES_PATH."temp/".$row[0]['directory']."/", "", $file); 1547 rename($file, PHONE_MODULES_PATH."endpoint/".$row[0]['directory']."/".$dir); 1548 chmod(PHONE_MODULES_PATH."endpoint/".$row[0]['directory']."/".$dir,0764); 1549 } 1550 } 1551 } 1552 echo "Done!<br />"; 1553 1554 echo "Removing Temporary Files.............."; 1555 $this->rmrf(PHONE_MODULES_PATH."temp/" .$row[0]['directory']); 1556 unlink(PHONE_MODULES_PATH.'temp/'. $package); 1557 echo "Done!<br />"; 1558 1559 $last_mod = ""; 1560 $temp['data']['brands']['family_list']['family'] = $this->fix_single_array_keys($temp['data']['brands']['family_list']['family']); 1561 foreach($temp['data']['brands']['family_list']['family'] as $family_list) { 1562 echo "Updating Family Lines.................<br/>"; 1563 $last_mod = max($last_mod, $family_list['last_modified']); 1564 1565 $family_line_xml = $this->xml2array(PHONE_MODULES_PATH.'/endpoint/'.$row[0]['directory'].'/'.$family_list['directory'].'/family_data.xml'); 1566 $data =& $this->db->getOne("SELECT id FROM endpointman_product_list WHERE id='".$brand_id.$family_line_xml['data']['id']."'", array(), DB_FETCHMODE_ASSOC); 1567 $short_name = preg_replace("/\[(.*?)\]/si", "", $family_line_xml['data']['name']); 1568 if($data) { 1569 $sql = "UPDATE endpointman_product_list SET short_name = '".$short_name."', long_name = '".$family_line_xml['data']['name']."', cfg_ver = '".$family_line_xml['data']['version']."', config_files='".$family_line_xml['data']['configuration_files']."' WHERE id = '".$brand_id.$family_line_xml['data']['id']."'"; 1570 } else { 1571 $sql = "INSERT INTO endpointman_product_list (`id`, `brand`, `short_name`, `long_name`, `cfg_dir`, `cfg_ver`, `config_files`, `hidden`) VALUES ('".$brand_id.$family_line_xml['data']['id']."', '".$brand_id."', '".$short_name."', '".$family_line_xml['data']['name']."', '".$family_line_xml['data']['directory']."', '".$family_line_xml['data']['version']."','".$family_line_xml['data']['configuration_files']."', '0')"; 1572 } 1573 1574 $this->db->query($sql); 1575 $family_line_xml['data']['model_list'] = $this->fix_single_array_keys($family_line_xml['data']['model_list']); 1576 echo "--Updating Model Lines................<br/>"; 1577 foreach($family_line_xml['data']['model_list'] as $model_list) { 1578 if(is_array($model_list['template_data']['files'])) { 1579 $template_list = implode(",",$model_list['template_data']['files']); 1580 } else { 1581 $template_list = $model_list['template_data']['files']; 1582 } 1583 1584 $model_final_id = $brand_id.$family_line_xml['data']['id'].$model_list['id']; 1585 $sql = 'SELECT id, global_custom_cfg_data, global_user_cfg_data FROM endpointman_mac_list WHERE model = '.$model_final_id; 1586 $old_data = NULL; 1587 $old_data = $this->db->getAll($sql, array(), DB_FETCHMODE_ASSOC); 1588 foreach($old_data as $data) { 1589 $global_custom_cfg_data = unserialize($data['global_custom_cfg_data']); 1590 if((is_array($global_custom_cfg_data)) AND (!array_key_exists('data', $global_custom_cfg_data))) { 1591 echo "----Old Data Detected! Migrating......"; 1592 $new_data = array(); 1593 $new_ari = array(); 1594 foreach($global_custom_cfg_data as $key => $old_keys) { 1595 if(array_key_exists('value', $old_keys)) { 1596 $new_data[$key] = $old_keys['value']; 1597 } else { 1598 $breaks = explode("_", $key); 1599 $new_data["loop|".$key] = $old_keys[$breaks[2]]; 1557 */ 1558 function update_brand($package,$remote=TRUE) { 1559 if(file_exists(PHONE_MODULES_PATH.'temp/'. $package.'/brand_data.xml')) { 1560 $temp = $this->xml2array(PHONE_MODULES_PATH.'temp/'. $package.'/brand_data.xml'); 1561 if(key_exists('directory', $temp['data']['brands'])) { 1562 echo "Appears to be a valid Provisioner.net XML file.....Continuing<br />"; 1563 1564 //Pull in all variables 1565 $directory = $temp['data']['brands']['directory']; 1566 $brand_name = $temp['data']['brands']['name']; 1567 $brand_id = $temp['data']['brands']['brand_id']; 1568 $brand_version = $temp['data']['brands']['version']; 1569 $brand_last_mod = $temp['data']['brands']['last_modified']; 1570 1571 //create directory structure and move files 1572 echo "Creating Directory Structure/Moving Files.."; 1573 1574 @mkdir(PHONE_MODULES_PATH."endpoint/".$directory); 1575 1576 $dir_iterator = new RecursiveDirectoryIterator(PHONE_MODULES_PATH."temp/".$directory."/"); 1577 $iterator = new RecursiveIteratorIterator($dir_iterator, RecursiveIteratorIterator::SELF_FIRST); 1578 foreach ($iterator as $file) { 1579 if(is_dir($file)) { 1580 $dir = str_replace(PHONE_MODULES_PATH."temp/".$directory."/", "", $file); 1581 if(!file_exists(PHONE_MODULES_PATH."endpoint/".$directory."/".$dir)) { 1582 mkdir(PHONE_MODULES_PATH."endpoint/".$directory."/".$dir,0764, TRUE); 1583 echo "."; 1584 } 1585 } else { 1586 if((basename($file) != "brand_data.xml") OR (!$remote)) { 1587 $dir = str_replace(PHONE_MODULES_PATH."temp/".$directory."/", "", $file); 1588 $stats = rename($file, PHONE_MODULES_PATH."endpoint/".$directory."/".$dir); 1589 if($stats === FALSE) { 1590 echo "Error Moving ". basename($file); 1600 1591 } 1601 if(array_key_exists('ari', $old_keys)) { 1602 $new_ari[$key] = 1; 1592 chmod(PHONE_MODULES_PATH."endpoint/".$directory."/".$dir,0764); 1593 echo "."; 1594 } 1595 } 1596 } 1597 echo "Done!<br />"; 1598 1599 $last_mod = ""; 1600 $temp['data']['brands']['family_list']['family'] = $this->fix_single_array_keys($temp['data']['brands']['family_list']['family']); 1601 foreach($temp['data']['brands']['family_list']['family'] as $family_list) { 1602 echo "Updating Family Lines.................<br/>"; 1603 $last_mod = max($last_mod, $family_list['last_modified']); 1604 1605 $family_line_xml = $this->xml2array(PHONE_MODULES_PATH.'/endpoint/'.$directory.'/'.$family_list['directory'].'/family_data.xml'); 1606 $data = $this->db->getOne("SELECT id FROM endpointman_product_list WHERE id='".$brand_id.$family_line_xml['data']['id']."'", array(), DB_FETCHMODE_ASSOC); 1607 $short_name = preg_replace("/\[(.*?)\]/si", "", $family_line_xml['data']['name']); 1608 if($data) { 1609 $sql = "UPDATE endpointman_product_list SET short_name = '".$short_name."', long_name = '".$family_line_xml['data']['name']."', cfg_ver = '".$family_line_xml['data']['version']."', config_files='".$family_line_xml['data']['configuration_files']."' WHERE id = '".$brand_id.$family_line_xml['data']['id']."'"; 1610 } else { 1611 $sql = "INSERT INTO endpointman_product_list (`id`, `brand`, `short_name`, `long_name`, `cfg_dir`, `cfg_ver`, `config_files`, `hidden`) VALUES ('".$brand_id.$family_line_xml['data']['id']."', '".$brand_id."', '".$short_name."', '".$family_line_xml['data']['name']."', '".$family_line_xml['data']['directory']."', '".$family_line_xml['data']['version']."','".$family_line_xml['data']['configuration_files']."', '0')"; 1612 } 1613 1614 $this->db->query($sql); 1615 $family_line_xml['data']['model_list'] = $this->fix_single_array_keys($family_line_xml['data']['model_list']); 1616 echo "--Updating Model Lines................<br/>"; 1617 foreach($family_line_xml['data']['model_list'] as $model_list) { 1618 if(is_array($model_list['template_data']['files'])) { 1619 $template_list = implode(",",$model_list['template_data']['files']); 1620 } else { 1621 $template_list = $model_list['template_data']['files']; 1622 } 1623 1624 $model_final_id = $brand_id.$family_line_xml['data']['id'].$model_list['id']; 1625 $sql = 'SELECT id, global_custom_cfg_data, global_user_cfg_data FROM endpointman_mac_list WHERE model = '.$model_final_id; 1626 $old_data = NULL; 1627 $old_data = $this->db->getAll($sql, array(), DB_FETCHMODE_ASSOC); 1628 foreach($old_data as $data) { 1629 $global_custom_cfg_data = unserialize($data['global_custom_cfg_data']); 1630 if((is_array($global_custom_cfg_data)) AND (!array_key_exists('data', $global_custom_cfg_data))) { 1631 echo "----Old Data Detected! Migrating......"; 1632 $new_data = array(); 1633 $new_ari = array(); 1634 foreach($global_custom_cfg_data as $key => $old_keys) { 1635 if(array_key_exists('value', $old_keys)) { 1636 $new_data[$key] = $old_keys['value']; 1637 } else { 1638 $breaks = explode("_", $key); 1639 $new_data["loop|".$key] = $old_keys[$breaks[2]]; 1640 } 1641 if(array_key_exists('ari', $old_keys)) { 1642 $new_ari[$key] = 1; 1643 } 1644 } 1645 $final_data = array(); 1646 $final_data['data'] = $new_data; 1647 $final_data['ari'] = $new_ari; 1648 $final_data = serialize($final_data); 1649 $sql = "UPDATE endpointman_mac_list SET global_custom_cfg_data = '".$final_data."' WHERE id =".$data['id']; 1650 $this->db->query($sql); 1651 echo "Done!<br/>"; 1652 } 1653 1654 $global_user_cfg_data = unserialize($data['global_user_cfg_data']); 1655 $old_check = FALSE; 1656 if(is_array($global_user_cfg_data)) { 1657 foreach($global_user_cfg_data as $stuff) { 1658 if(is_array($stuff)) { 1659 if(array_key_exists('value', $stuff)) { 1660 $old_check = TRUE; 1661 break; 1662 } else { 1663 break; 1664 } 1665 } else { 1666 break; 1667 } 1668 } 1669 } 1670 if((is_array($global_user_cfg_data)) AND ($old_check)) { 1671 echo "Old Data Detected! Migrating......"; 1672 $new_data = array(); 1673 foreach($global_user_cfg_data as $key => $old_keys) { 1674 if(array_key_exists('value', $old_keys)) { 1675 $exploded = explode("_",$key); 1676 $counted = count($exploded); 1677 $counted = $counted - 1; 1678 if(is_numeric($exploded[$counted])) { 1679 $key = "loop|".$key; 1680 } 1681 $new_data[$key] = $old_keys['value']; 1682 } 1683 } 1684 $final_data = serialize($new_data); 1685 $sql = "UPDATE endpointman_mac_list SET global_user_cfg_data = '".$final_data."' WHERE id =".$data['id']; 1686 $this->db->query($sql); 1687 echo "Done!<br/>"; 1603 1688 } 1604 1689 } 1605 $ final_data = array();1606 $ final_data['data'] = $new_data;1607 $ final_data['ari'] = $new_ari;1608 $final_data = serialize($final_data);1609 $sql = "UPDATE endpointman_mac_list SET global_custom_cfg_data = '".$final_data."' WHERE id =".$data['id'];1610 $this->db->query($sql);1611 echo "Done!<br/>";1612 }1613 1614 $global_user_cfg_data = unserialize($data['global_user_cfg_data']);1615 $old_check = FALSE;1616 if(is_array($global_user_cfg_data)) {1617 foreach($global_user_cfg_data as $stuff){1618 if(is_array($stuff)) {1619 if(array_key_exists('value', $stuff)) {1620 $old_check = TRUE;1621 break;1622 } else {1623 break;1690 $old_data = NULL; 1691 $sql = 'SELECT id, global_custom_cfg_data FROM endpointman_template_list WHERE model_id = '.$model_final_id; 1692 $old_data = $this->db->getAll($sql, array(), DB_FETCHMODE_ASSOC); 1693 foreach($old_data as $data) { 1694 $global_custom_cfg_data = unserialize($data['global_custom_cfg_data']); 1695 if((is_array($global_custom_cfg_data)) AND (!array_key_exists('data', $global_custom_cfg_data))) { 1696 echo "Old Data Detected! Migrating......"; 1697 $new_data = array(); 1698 $new_ari = array(); 1699 foreach($global_custom_cfg_data as $key => $old_keys) { 1700 if(array_key_exists('value', $old_keys)) { 1701 $new_data[$key] = $old_keys['value']; 1702 } else { 1703 $breaks = explode("_", $key); 1704 $new_data["loop|".$key] = $old_keys[$breaks[2]]; 1705 } 1706 if(array_key_exists('ari', $old_keys)) { 1707 $new_ari[$key] = 1; 1708 } 1624 1709 } 1625 } else { 1626 break; 1710 $final_data = array(); 1711 $final_data['data'] = $new_data; 1712 $final_data['ari'] = $new_ari; 1713 $final_data = serialize($final_data); 1714 $sql = "UPDATE endpointman_template_list SET global_custom_cfg_data = '".$final_data."' WHERE id =".$data['id']; 1715 $this->db->query($sql); 1716 echo "Done!<br/>"; 1627 1717 } 1628 1718 } 1629 } 1630 if((is_array($global_user_cfg_data)) AND ($old_check)) { 1631 echo "Old Data Detected! Migrating......"; 1632 $new_data = array(); 1633 foreach($global_user_cfg_data as $key => $old_keys) { 1634 if(array_key_exists('value', $old_keys)) { 1635 $exploded = explode("_",$key); 1636 $counted = count($exploded); 1637 $counted = $counted - 1; 1638 if(is_numeric($exploded[$counted])) { 1639 $key = "loop|".$key; 1640 } 1641 $new_data[$key] = $old_keys['value']; 1642 } 1719 1720 $m_data = $this->db->getOne("SELECT id FROM endpointman_model_list WHERE id='".$brand_id.$family_line_xml['data']['id'].$model_list['id']."'", array(), DB_FETCHMODE_ASSOC); 1721 if($m_data) { 1722 $sql = "UPDATE endpointman_model_list SET max_lines = '".$model_list['lines']."', model = '".$model_list['model']."', template_list = '".$template_list."' WHERE id = '".$brand_id.$family_line_xml['data']['id'].$model_list['id']."'"; 1723 } else { 1724 $sql = "INSERT INTO endpointman_model_list (`id`, `brand`, `model`, `max_lines`, `product_id`, `template_list`, `enabled`, `hidden`) VALUES ('".$brand_id.$family_line_xml['data']['id'].$model_list['id']."', '".$brand_id."', '".$model_list['model']."', '".$model_list['lines']."', '".$brand_id.$family_line_xml['data']['id']."', '".$template_list."', '0', '0')"; 1643 1725 } 1644 $final_data = serialize($new_data);1645 $sql = "UPDATE endpointman_mac_list SET global_user_cfg_data = '".$final_data."' WHERE id =".$data['id'];1646 1726 $this->db->query($sql); 1647 echo "Done!<br/>"; 1648 } 1649 } 1650 $old_data = NULL; 1651 $sql = 'SELECT id, global_custom_cfg_data FROM endpointman_template_list WHERE model_id = '.$model_final_id; 1652 $old_data = $this->db->getAll($sql, array(), DB_FETCHMODE_ASSOC); 1653 foreach($old_data as $data) { 1654 $global_custom_cfg_data = unserialize($data['global_custom_cfg_data']); 1655 if((is_array($global_custom_cfg_data)) AND (!array_key_exists('data', $global_custom_cfg_data))) { 1656 echo "Old Data Detected! Migrating......"; 1657 $new_data = array(); 1658 $new_ari = array(); 1659 foreach($global_custom_cfg_data as $key => $old_keys) { 1660 if(array_key_exists('value', $old_keys)) { 1661 $new_data[$key] = $old_keys['value']; 1662 } else { 1663 $breaks = explode("_", $key); 1664 $new_data["loop|".$key] = $old_keys[$breaks[2]]; 1665 } 1666 if(array_key_exists('ari', $old_keys)) { 1667 $new_ari[$key] = 1; 1668 } 1727 1728 if(!$this->sync_model($brand_id.$family_line_xml['data']['id'].$model_list['id'])) { 1729 echo "System Error in Sync Model Function, Load Failure!<br />"; 1669 1730 } 1670 $final_data = array(); 1671 $final_data['data'] = $new_data; 1672 $final_data['ari'] = $new_ari; 1673 $final_data = serialize($final_data); 1674 $sql = "UPDATE endpointman_template_list SET global_custom_cfg_data = '".$final_data."' WHERE id =".$data['id']; 1675 $this->db->query($sql); 1676 echo "Done!<br/>"; 1677 } 1678 } 1679 1680 $m_data =& $this->db->getOne("SELECT id FROM endpointman_model_list WHERE id='".$brand_id.$family_line_xml['data']['id'].$model_list['id']."'", array(), DB_FETCHMODE_ASSOC); 1681 if($m_data) { 1682 $sql = "UPDATE endpointman_model_list SET max_lines = '".$model_list['lines']."', model = '".$model_list['model']."', template_list = '".$template_list."' WHERE id = '".$brand_id.$family_line_xml['data']['id'].$model_list['id']."'"; 1731 } 1732 //TODO: Phone Models Move Here 1733 } 1734 if($remote) { 1735 $local = 0; 1683 1736 } else { 1684 $sql = "INSERT INTO endpointman_model_list (`id`, `brand`, `model`, `max_lines`, `product_id`, `template_list`, `enabled`, `hidden`) VALUES ('".$brand_id.$family_line_xml['data']['id'].$model_list['id']."', '".$brand_id."', '".$model_list['model']."', '".$model_list['lines']."', '".$brand_id.$family_line_xml['data']['id']."', '".$template_list."', '0', '0')"; 1685 } 1686 $this->db->query($sql); 1687 1688 if(!$this->sync_model($brand_id.$family_line_xml['data']['id'].$model_list['id'])) { 1689 echo "System Error in Sync Model Function, Load Failure!<br />"; 1690 } 1691 } 1692 } 1693 1694 $brand_version = max($last_mod, $brand_last_mod); 1695 echo "Updating data.........."; 1696 $sql = "UPDATE endpointman_brand_list SET name = '".$brand_name."', cfg_ver = '".$brand_version."', installed = 1, hidden = 0 WHERE id = ".$brand_id; 1697 $this->db->query($sql); 1698 echo "Done!<br/>"; 1699 } 1737 $local = 1; 1738 } 1739 $brand_version = max($last_mod, $brand_last_mod); 1740 1741 $b_data = $this->db->getOne("SELECT id FROM endpointman_brand_list WHERE id='".$brand_id."'", array(), DB_FETCHMODE_ASSOC); 1742 if($b_data) { 1743 echo "Updating data.........."; 1744 $sql = "UPDATE endpointman_brand_list SET local = '".$local."', name = '".$brand_name."', cfg_ver = '".$brand_version."', installed = 1, hidden = 0 WHERE id = ".$brand_id; 1745 $this->db->query($sql); 1746 } else { 1747 $sql = "INSERT INTO endpointman_brand_list (id, name, directory, cfg_ver, local, installed) VALUES ('".$brand_id."', '".$brand_name."', '".$directory."', '".$brand_version."', '1', '1')"; 1748 $this->db->query($sql); 1749 } 1750 1751 foreach($temp['data']['brands']['oui_list']['oui'] as $oui) { 1752 $sql = "INSERT INTO endpointman_oui_list (`oui`, `brand`, `custom`) VALUES ('".$oui."', '".$brand_id."', '0')"; 1753 $this->db->query($sql); 1754 } 1755 1756 echo "Done!<br/>"; 1757 } else { 1758 echo "Invalid XML Structure<br />"; 1759 } 1760 } else { 1761 echo "No 'brand_data.xml' file exists!<br />"; 1762 } 1763 1764 echo "Removing Temporary Files.............."; 1765 $this->rmrf(PHONE_MODULES_PATH."temp/" .$package); 1766 echo "Done!<br />"; 1767 1768 } 1769 1700 1770 1701 1771 /** … … 1704 1774 */ 1705 1775 function remove_brand($id=NULL) { 1706 $brand_dir = &$this->db->getOne("SELECT directory FROM endpointman_brand_list WHERE id=".$id);1776 $brand_dir = $this->db->getOne("SELECT directory FROM endpointman_brand_list WHERE id=".$id); 1707 1777 $this->rmrf(PHONE_MODULES_PATH."endpoint/".$brand_dir); 1708 1778 … … 1731 1801 $sql = "SELECT * FROM endpointman_model_list WHERE id='".$model."'"; 1732 1802 1733 $model_row = &$this->db->getRow($sql, array(),DB_FETCHMODE_ASSOC);1803 $model_row = $this->db->getRow($sql, array(),DB_FETCHMODE_ASSOC); 1734 1804 1735 1805 $sql = "SELECT * FROM endpointman_product_list WHERE id='".$model_row['product_id']."'"; 1736 1806 1737 $product_row = &$this->db->getRow($sql, array(),DB_FETCHMODE_ASSOC);1807 $product_row = $this->db->getRow($sql, array(),DB_FETCHMODE_ASSOC); 1738 1808 1739 1809 $sql = "SELECT * FROM endpointman_brand_list WHERE id=".$model_row['brand']; 1740 1810 1741 1811 1742 $brand_row = &$this->db->getRow($sql, array(),DB_FETCHMODE_ASSOC);1812 $brand_row = $this->db->getRow($sql, array(),DB_FETCHMODE_ASSOC); 1743 1813 1744 1814 $family_line_xml = $this->xml2array(PHONE_MODULES_PATH.'/endpoint/'.$brand_row['directory'].'/'.$product_row['cfg_dir'].'/family_data.xml'); … … 2246 2316 $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"; 2247 2317 2248 $brand = &$this->db->getRow($oui_sql, array(), DB_FETCHMODE_ASSOC);2318 $brand = $this->db->getRow($oui_sql, array(), DB_FETCHMODE_ASSOC); 2249 2319 2250 $res = &$this->db->query($oui_sql);2320 $res = $this->db->query($oui_sql); 2251 2321 $brand_count = $res->numRows(); 2252 2322 … … 2259 2329 //Find out if endpoint has already been configured for this mac address 2260 2330 $epm_sql = "SELECT * FROM endpointman_mac_list WHERE mac LIKE '%". $mac_strip ."%'"; 2261 $epm_row = &$this->db->getRow($epm_sql, array(), DB_FETCHMODE_ASSOC);2262 2263 $res = &$this->db->query($epm_sql);2331 $epm_row = $this->db->getRow($epm_sql, array(), DB_FETCHMODE_ASSOC); 2332 2333 $res = $this->db->query($epm_sql); 2264 2334 $epm_count = $res->numRows(); 2265 2335 … … 2289 2359 $count = $this->db->getOne($sql); 2290 2360 2291 //TODO: FIX this2292 /**2293 if($count == 0) {2294 $this->sync_model($model);2295 $sql = "SELECT max_lines FROM endpointman_model_list WHERE id = '". $model."'";2296 $count = $this->db->getOne($sql);2297 if($count == 0) {2298 die("Can't Reset Lines to more than 0! ['areaAvailble']");2299 }2300 }2301 *2302 */2303 2361 for($z=0;$z<$count;$z++) { 2304 2362 $result[$z]['id'] = $z + 1; … … 2333 2391 2334 2392 if ((!isset($oui)) && (!isset($brand)) && (!isset($model))) { 2335 $result1 = &$this->endpoint_data->all_models();2393 $result1 = $this->endpoint_data->all_models(); 2336 2394 }elseif((isset($brand)) && ($brand !=0)) { 2337 $result1 = &$this->endpoint_data->all_models_by_brand($brand);2395 $result1 = $this->endpoint_data->all_models_by_brand($brand); 2338 2396 }elseif((isset($product)) && ($product !=0)) { 2339 $result1 = &$this->endpoint_data->all_models_by_product($product);2340 } else { 2341 $result1 = &$this->endpoint_data->all_models();2397 $result1 = $this->endpoint_data->all_models_by_product($product); 2398 } else { 2399 $result1 = $this->endpoint_data->all_models(); 2342 2400 } 2343 2401 … … 2383 2441 2384 2442 $sql_l = "SELECT line, mac_id FROM `endpointman_line_list` WHERE luid = ".$lineid; 2385 $line = &$this->db->getRow($sql_l, array(), DB_FETCHMODE_ASSOC);2443 $line = $this->db->getRow($sql_l, array(), DB_FETCHMODE_ASSOC); 2386 2444 2387 2445 $sql_lu = "SELECT line FROM endpointman_line_list WHERE mac_id = ".$line['mac_id']; … … 2394 2452 2395 2453 $max_lines = $this->db->getOne($sql); 2396 $lines_used = &$this->db->getAll($sql_lu);2454 $lines_used = $this->db->getAll($sql_lu); 2397 2455 2398 2456 for($i = 1; $i <= $max_lines; $i++) { … … 2422 2480 2423 2481 if(isset($line_id)) { 2424 $result = &$this->endpoint_data->all_unused_registrations();2425 $line_data = &$this->endpoint_data->get_line_information($line_id);2426 } else { 2427 $result = &$this->endpoint_data->all_unused_registrations();2482 $result = $this->endpoint_data->all_unused_registrations(); 2483 $line_data = $this->endpoint_data->get_line_information($line_id); 2484 } else { 2485 $result = $this->endpoint_data->all_unused_registrations(); 2428 2486 $line_data = NULL; 2429 2487 } … … 2452 2510 */ 2453 2511 function brands_available ($selected = NULL,$show_blank=TRUE) { 2454 $data = &$this->endpoint_data->all_active_brands();2512 $data = $this->endpoint_data->all_active_brands(); 2455 2513 if($show_blank) { 2456 2514 $temp[0]['value'] = ""; … … 2477 2535 $sql="SELECT id FROM endpointman_product_list WHERE endpointman_product_list.id ='".$product_id."'"; 2478 2536 2479 $id = &$this->db->getOne($sql);2537 $id = $this->db->getOne($sql); 2480 2538 2481 2539 $sql="SELECT * FROM endpointman_template_list WHERE product_id = '".$id."'"; 2482 2540 2483 $data = &$this->db->getAll($sql,array(), DB_FETCHMODE_ASSOC);2541 $data = $this->db->getAll($sql,array(), DB_FETCHMODE_ASSOC); 2484 2542 foreach($data as $row) { 2485 2543 $temp[$i]['value'] = $row['id']; … … 2503 2561 function listTZ($selected) { 2504 2562 $sql="SELECT tz FROM endpointman_time_zones"; 2505 $data = &$this->db->getAll($sql,array(), DB_FETCHMODE_ASSOC);2563 $data = $this->db->getAll($sql,array(), DB_FETCHMODE_ASSOC); 2506 2564 $i = 0; 2507 2565 foreach($data as $row) { modules/branches/2.9/endpointman/includes/installer.php
r11318 r11618 73 73 break; 74 74 case "upload_brand": 75 if ((file_exists(PHONE_MODULES_PATH."temp/".$_REQUEST['package'])) AND (file_exists(PHONE_MODULES_PATH."temp/".$_REQUEST['xml']))) { 76 $temp = $endpoint->xml2array(PHONE_MODULES_PATH."temp/".$_REQUEST['xml']); 77 $endpoint->update_brand($temp); 75 if (file_exists(PHONE_MODULES_PATH."temp/".$_REQUEST['package'])) { 76 echo "Extracting Tarball........"; 77 exec("tar -xvf ".PHONE_MODULES_PATH.'temp/'. $_REQUEST['package'] ." -C ".PHONE_MODULES_PATH."temp/"); 78 echo "Done!<br />"; 79 80 $package = basename($_REQUEST['package'], ".tgz"); 81 $package = explode("-",$package); 82 83 if(file_exists(PHONE_MODULES_PATH."temp/".$package[0])) { 84 $endpoint->update_brand($package[0],FALSE); 85 unlink(PHONE_MODULES_PATH.'temp/'. $_REQUEST['package']); 86 } else { 87 echo "Please name the Package the same name as your brand!"; 88 } 89 } else { 90 $endpoint->error['upload'] = "No File Provided"; 78 91 } 79 92 break; modules/branches/2.9/endpointman/includes/popup.php
r10792 r11618 45 45 $endpoint->tpl->assign("save_as_name_value", $row['name']); 46 46 $endpoint->tpl->assign("filename", $row['original_name']); 47 $row['data'] = $endpoint->display_htmlspecialchars($row['data']); 47 48 $endpoint->tpl->assign("config_data", $row['data']); 48 49 } else { … … 62 63 $contents = fread($handle, filesize($file)); 63 64 fclose($handle); 65 $contents = $endpoint->display_htmlspecialchars($contents); 64 66 $endpoint->tpl->assign("config_data", $contents); 65 67 } … … 76 78 $endpoint->tpl->assign("save_as_name_value", $row['name']); 77 79 $endpoint->tpl->assign("filename", $row['original_name']); 80 $row['data'] = $endpoint->display_htmlspecialchars($row['data']); 78 81 $endpoint->tpl->assign("config_data", $row['data']); 79 82 } else { … … 93 96 $contents = fread($handle, filesize($file)); 94 97 fclose($handle); 98 $contents = $endpoint->display_htmlspecialchars($contents); 95 99 $endpoint->tpl->assign("config_data", $contents); 96 100 } modules/branches/2.9/endpointman/install.php
r11318 r11618 92 92 } 93 93 94 $version = "2.9.0. 4";94 $version = "2.9.0.6"; 95 95 96 96 if(ep_table_exists("endpointman_global_vars")) { … … 900 900 } 901 901 902 if($ver <= "2.9.0.4") { 903 $sql = 'ALTER TABLE `endpointman_brand_list` ADD `local` INT( 1 ) NOT NULL DEFAULT \'0\' AFTER `cfg_ver`'; 904 $db->query($sql); 905 } 906 907 if($ver <= "2.9.0.5") { 908 $sql = "INSERT INTO `asterisk`.`endpointman_global_vars` (`idnum` ,`var_name` ,`value`)VALUES (NULL , 'show_all_registrations', '0')"; 909 $db->query($sql); 910 } 911 902 912 } 903 913 … … 912 922 `cfg_ver` varchar(255) NOT NULL, 913 923 `installed` int(1) NOT NULL DEFAULT '0', 924 `local` int(1) NOT NULL DEFAULT '0', 914 925 `hidden` int(1) NOT NULL DEFAULT '0', 915 926 PRIMARY KEY (`id`) … … 963 974 (15, 'disable_htaccess', ''), 964 975 (16, 'endpoint_vers', '0'), 965 (17, 'disable_help', '0')"; 976 (17, 'disable_help', '0'), 977 (17, 'show_all_registrations', '0')"; 966 978 $db->query($sql); 967 979 modules/branches/2.9/endpointman/module.xml
r11319 r11618 3 3 <repo>standard</repo> 4 4 <name>PBX End Point Manager</name> 5 <version>2.9.0.3RC 5</version>5 <version>2.9.0.3RC7</version> 6 6 <type>tool</type> 7 7 <category>End Point Manager</category> … … 16 16 <description>PBX End Point Manager supports automated deployment of multiple manufacturers IP telephones.</description> 17 17 <changelog> 18 *2.9.0.3RC6* Fixed Device & User Mode (http://www.freepbx.org/forum/freepbx/users/device-user-mode), #4792 18 19 *2.9.0.0* bumped for 2.9, removed errors in module.xml causing erors for online xml parsing 19 20 *2.3.2* Various Bug Fixes … … 22 23 </changelog> 23 24 <info>http://projects.colsolgrp.net/projects/show/endpointman</info> 24 <location>release/2.9/endpointman-2.9.0.3RC 5.tgz</location>25 <location>release/2.9/endpointman-2.9.0.3RC2.tgz</location> 25 26 26 <md5sum> ecd0e63c2947a7b1e6eaa678a6e09d76</md5sum>27 <md5sum>f4aed8221b1398a65438454786ce8089</md5sum> 27 28 </module> modules/branches/2.9/endpointman/templates/freepbx/advanced_settings_iedl.html
r10947 r11618 5 5 <br> 6 6 <a href="{$exporter_address}"><?=_('Export CSV')?></a></p> 7 <p><?=_('Import CSV file of devices')?>:<form name="form1" enctype="multipart/form-data" method="post" action="config.php {$web_vars}&display=epm_advanced&subpage=iedl&action=import">7 <p><?=_('Import CSV file of devices')?>:<form name="form1" enctype="multipart/form-data" method="post" action="config.php?type=tool&display=epm_advanced&subpage=iedl&action=import"> 8 8 <label> 9 9 <input type="hidden" name="MAX_FILE_SIZE" value="30000" /> modules/branches/2.9/endpointman/templates/freepbx/advanced_settings_manual_upload.html
r10792 r11618 17 17 freepbx_modal_hide('moduleBox'); 18 18 if (goback) { 19 location.href = 'config.php?type=tool& display=epm_advanced&subpage=manual_upload';19 location.href = 'config.php?type=tool&display=epm_advanced&subpage=manual_upload'; 20 20 } 21 21 } … … 35 35 </form> 36 36 <br /><br /> 37 {if condition="1 == 0"}38 37 <form action="" method="post" enctype="multipart/form-data" name="form1"> 39 <label>Master List File (.xml):40 <input type="file" name="xml" id="fileField">41 </label> Local Date Last Modified: {$master_ver}42 <br/>43 <input type="submit" name="upload_master_xml" value="<?=_('Upload')?>">44 </form>45 <br /><br />46 {/if}47 <form action="" method="post" enctype="multipart/form-data" name="form1">48 <label>Brand XML File (.xml):49 <input type="file" name="xml" id="fileField">50 </label>51 <br />52 38 <label>Brand Package (.tgz): 53 39 <input type="file" name="package" id="fileField"> 54 40 </label> 55 <br/>41 <br /><font style="font-size: small">Note: The Brand XML File is no longer needed as it is contained within the Brand Package.<br /><br />Learn How to Create your own brand package here: <a target="_blank" href="http://www.provisioner.net/adding_new_phones">http://www.provisioner.net/adding_new_phones</a></font><br /> 56 42 <input type="submit" name="upload_brand" value="<?=_('Upload')?>"> 57 43 </form> modules/branches/2.9/endpointman/templates/freepbx/advanced_settings_oui.html
r10792 r11618 12 12 {loop name="oui_list_custom"} 13 13 </tr><tr> 14 <td align='center'>{$value.oui}</td><td align='center'>{$value.name}</td><td align='center'><a href="config.php {$web_vars}&display=epm_advanced&subpage=oui_manager&delete=yes&id={$value.id}"><img src='images/delete.gif' ALT='Delete' border='0'></a></td>14 <td align='center'>{$value.oui}</td><td align='center'>{$value.name}</td><td align='center'><a href="config.php?type=tool&display=epm_advanced&subpage=oui_manager&delete=yes&id={$value.id}"><img src='images/delete.gif' ALT='Delete' border='0'></a></td> 15 15 </tr><tr> 16 16 {/loop} … … 19 19 <td colspan="2" align='center'><h3><?=_('Add Custom')?> OUI</h3></td> 20 20 </form> 21 <form action='config.php {$web_vars}&display=epm_advanced&subpage=oui_manager' method='POST'>21 <form action='config.php?type=tool&display=epm_advanced&subpage=oui_manager' method='POST'> 22 22 </tr><tr> 23 23 <td align='center'><input name="oui" type="text" maxlength="6"/></td><td align='center'> <select name="rb_brand"> modules/branches/2.9/endpointman/templates/freepbx/advanced_settings_poce.html
r10792 r11618 2 2 {include="message_box"} 3 3 {/if} 4 <center><form method="post" action="config.php {$web_vars}&display=epm_advanced&subpage=poce">4 <center><form method="post" action="config.php?type=tool&display=epm_advanced&subpage=poce"> 5 5 <?=_("Select Product")?> 6 6 <select name="product_select" id="product_select"> … … 15 15 </center> 16 16 <hr width="30%"> 17 <form method="post" action="config.php {$web_vars}&display=epm_advanced&subpage=poce&product_select={$product_selected}&phone_options=true">17 <form method="post" action="config.php?type=tool&display=epm_advanced&subpage=poce&product_select={$product_selected}&phone_options=true"> 18 18 {if condition="isset($options)"} 19 19 {$options} … … 35 35 <u><?=_("Local File Configs")?></u><br /> 36 36 {loop name="file_list"} 37 <a href="config.php {$web_vars}&display=epm_advanced&subpage=poce&product_select={$product_selected}&file={$value.value}">{$value.text}</a><br />37 <a href="config.php?type=tool&display=epm_advanced&subpage=poce&product_select={$product_selected}&file={$value.value}">{$value.text}</a><br /> 38 38 {/loop} 39 39 <hr> … … 41 41 {if condition="isset($sql_file_list)"} 42 42 {loop name="sql_file_list"} 43 <a href="config.php {$web_vars}&display=epm_advanced&subpage=poce&product_select={$product_selected}&sql={$value.value}">{$value.text}</a> [{$value.ref}] <a href="{$web_vars}&display=epm_advanced&subpage=poce&product_select={$product_selected}&sql={$value.value}&delete=yes"><img src='images/delete.gif' ALT='Delete' border='0'></a>43 <a href="config.php?type=tool&display=epm_advanced&subpage=poce&product_select={$product_selected}&sql={$value.value}">{$value.text}</a> [{$value.ref}] <a href="config.php?type=tool&display=epm_advanced&subpage=poce&product_select={$product_selected}&sql={$value.value}&delete=yes"><img src='images/delete.gif' ALT='Delete' border='0'></a> 44 44 <br /> 45 45 {/loop} … … 59 59 <label> 60 60 <input type="text" name="save_as_name" id="save_as_name" value="{if condition="isset($save_as_name_value)"}{$save_as_name_value}{/if}"> 61 </label>{/if}{if condition="isset($type)"}|| <a href="config.php {$web_vars}&display=epm_advanced&subpage=poce&sendid={$sendid}&filename={$filename}&product_select={$product_selected}&{if condition="$type == 'sql'"}sql={$sendid}{else}file={$sendid}{/if}">Click here to send this configuration file to the Provisioner.net Team</a>{/if}</div>61 </label>{/if}{if condition="isset($type)"}|| <a href="config.php?type=tool&display=epm_advanced&subpage=poce&sendid={$sendid}&filename={$filename}&product_select={$product_selected}&{if condition="$type == 'sql'"}sql={$sendid}{else}file={$sendid}{/if}">Click here to send this configuration file to the Provisioner.net Team</a>{/if}</div> 62 62 </form><div style="font-size: 13px">(Note: 'Save' Saves to the local hard drive, if the phone module is ever updated this file will be over-written, 'Save As' Saves to the database and is not over-written on updates)</div></td> 63 63 modules/branches/2.9/endpointman/templates/freepbx/advanced_settings_settings.html
r10797 r11618 2 2 {include="message_box"} 3 3 {/if} 4 <form action='config.php {$web_vars}&display=epm_advanced&subpage=settings' method='POST'>4 <form action='config.php?type=tool&display=epm_advanced&subpage=settings' method='POST'> 5 5 <table width='90%' align='center'> 6 6 <tr> 7 7 <td width='50%' align='right'><?=_("IP address of phone server")?>:</td> 8 8 <td width='50%' align='left'><input type='text' id='srvip' name='srvip' value='{$srvip}'><a href='#' onclick="document.getElementById('srvip').value = '{$ip}'; "><?=_("Determine for me")?></a></td> 9 </tr><tr> 9 </tr> 10 <tr> 11 <td align='right'><?=_("Configuration Type")?></td> 12 <td align='left'> 13 <select name="cfg_type" id="cfg_type"> 14 <option value="file">File (TFTP/FTP)</option> 15 <option value="web">Web (HTTP)</option> 16 </select> 17 </td> 18 </tr> 19 <tr> 20 <td align='right'><?=_("Default Final Configuration Directory")?></td> 21 <td align='left'><label> 22 <input type="text" name="config_loc" value="{$config_location}"> 23 </label></td> 24 </tr> 25 <tr> 10 26 <td width='50%' align='right'><?=_("Time Zone")?> (<?=_('like')?> USA-5)</td> 11 27 <td width='50%' align='left'><select name="tz" id="tz"> … … 16 32 17 33 </td> 18 </tr>19 <!-- Future20 <tr>21 <td width='50%' align='right'><?=_("Language")?> (<?=_('like')?> EN_US)</td>22 <td width='50%' align='left'><select name="tz" id="tz">23 {loop name="list_tz"}24 <option value="{$value.value}" {if condition="$value.selected == 1"}selected='selected'{/if}>{$value.text}</option>25 {/loop}26 </select>27 </td>28 </tr>29 -->30 <tr>31 <td align='right'><?=_("Default Final Configuration Directory")?></td>32 <td align='left'><label>33 <input type="text" name="config_loc" value="{$config_location}">34 </label></td>35 34 </tr> 36 35 <tr> … … 71 70 </tr> 72 71 <tr> 72 <td align='right'><?=_("Allow Duplicate Extensions")?></td> 73 <td align='left'><label> 74 <input type=checkbox name="allow_dupext" {$dupext_selected}> 75 </label></td> 76 </tr> 77 <tr> 73 78 <td colspan='2' align='center'><input type='Submit' name='button_update_globals' value='<?=_('Update Globals')?>'></td> 74 79 </tr> modules/branches/2.9/endpointman/templates/freepbx/advanced_settings_sh_manager.html
r10792 r11618 21 21 <table width="100%" class="brand" border="0" cellspacing="0" cellpadding="0"> 22 22 <tr> 23 <td colspan="2">{$value.name}<form action='config.php{$web_vars}&display=epm_advanced&subpage=sh_manager' method='POST'><input type="hidden" name="brand" value="{$value.id}"><input type="submit" name="button_{if condition="$value.hidden == '1'"}show{else}hide{/if}" class="button_{if condition="$value.hidden == '1'"}show{else}hide{/if}" value="{if condition="$value.hidden == '1'"}<?=_('Show')?>{else}<?=_('Hide')?>{/if}"></form></td>23 <td colspan="2">{$value.name}<form action='config.php?type=tool&display=epm_advanced&subpage=sh_manager' method='POST'><input type="hidden" name="brand" value="{$value.id}"><input type="submit" name="button_{if condition="$value.hidden == '1'"}show{else}hide{/if}" class="button_{if condition="$value.hidden == '1'"}show{else}hide{/if}" value="{if condition="$value.hidden == '1'"}<?=_('Show')?>{else}<?=_('Hide')?>{/if}"></form></td> 24 24 </tr> 25 25 <tr> … … 28 28 <table width="100%" class="product" border="0" cellspacing="0" cellpadding="0"> 29 29 <tr> 30 <td colspan="2">{$value.long_name}<form action='config.php{$web_vars}&display=epm_advanced&subpage=sh_manager' method='POST'><input type="hidden" name="product" value="{$value.id}"><input type="submit" name="button_{if condition="$value.hidden == '1'"}show{else}hide{/if}" class="button_{if condition="$value.hidden == '1'"}show{else}hide{/if}" value="{if condition="$value.hidden == '1'"}<?=_('Show')?>{else}<?=_('Hide')?>{/if}"></form></td>30 <td colspan="2">{$value.long_name}<form action='config.php?type=tool&display=epm_advanced&subpage=sh_manager' method='POST'><input type="hidden" name="product" value="{$value.id}"><input type="submit" name="button_{if condition="$value.hidden == '1'"}show{else}hide{/if}" class="button_{if condition="$value.hidden == '1'"}show{else}hide{/if}" value="{if condition="$value.hidden == '1'"}<?=_('Show')?>{else}<?=_('Hide')?>{/if}"></form></td> 31 31 </tr> 32 32 <tr> … … 35 35 <table width="100%" class="model" border="0" cellspacing="0" cellpadding="0"> 36 36 <tr> 37 <td>{$value.model} <form action='config.php {$web_vars}&display=epm_advanced&subpage=sh_manager' method='POST'><input type="hidden" name="model" value="{$value.id}"><input type="submit" name="button_{if condition="$value.hidden == '1'"}show{else}hide{/if}" class="button_{if condition="$value.hidden == '1'"}Show{else}Hide{/if}" value="{if condition="$value.hidden == '1'"}<?=_('Show')?>{else}<?=_('Hide')?>{/if}"></form></td>37 <td>{$value.model} <form action='config.php?type=tool&display=epm_advanced&subpage=sh_manager' method='POST'><input type="hidden" name="model" value="{$value.id}"><input type="submit" name="button_{if condition="$value.hidden == '1'"}show{else}hide{/if}" class="button_{if condition="$value.hidden == '1'"}Show{else}Hide{/if}" value="{if condition="$value.hidden == '1'"}<?=_('Show')?>{else}<?=_('Hide')?>{/if}"></form></td> 38 38 </tr> 39 39 </table>{/loop}</td> modules/branches/2.9/endpointman/templates/freepbx/advanced_subheader.html
r10792 r11618 1 1 <table align='center' width='90%'> 2 2 <tr> 3 <td align='center'>{if condition="$subhead_area == 'settings'"}<h4 style="color:#ff9933;"><?=_('Settings')?></h4>{else}<h4><a href=' {$web_vars}&display=epm_advanced&subpage=settings'><?=_('Settings')?></a></h4>{/if}</td>4 <td align='center'>{if condition="$subhead_area == 'oui_manager'"}<h4 style="color:#ff9933;"><?=_('OUI Manager')?></h4>{else}<h4><a href=' {$web_vars}&display=epm_advanced&subpage=oui_manager'><?=_('OUI Manager')?></a></h4>{/if}</td>5 <td align='center'>{if condition="$subhead_area == 'poce'"}<h4 style="color:#ff9933;"><?=_('Product Options/Configuration Editor')?></h4>{else}<h4><a href=' {$web_vars}&display=epm_advanced&subpage=poce'><?=_('Product Options/Configuration Editor')?></a></h4>{/if}</td>3 <td align='center'>{if condition="$subhead_area == 'settings'"}<h4 style="color:#ff9933;"><?=_('Settings')?></h4>{else}<h4><a href='config.php?type=tool&display=epm_advanced&subpage=settings'><?=_('Settings')?></a></h4>{/if}</td> 4 <td align='center'>{if condition="$subhead_area == 'oui_manager'"}<h4 style="color:#ff9933;"><?=_('OUI Manager')?></h4>{else}<h4><a href='config.php?type=tool&display=epm_advanced&subpage=oui_manager'><?=_('OUI Manager')?></a></h4>{/if}</td> 5 <td align='center'>{if condition="$subhead_area == 'poce'"}<h4 style="color:#ff9933;"><?=_('Product Options/Configuration Editor')?></h4>{else}<h4><a href='config.php?type=tool&display=epm_advanced&subpage=poce'><?=_('Product Options/Configuration Editor')?></a></h4>{/if}</td> 6 6 </tr> 7 7 <tr> 8 <td align='center'>{if condition="$subhead_area == 'iedl'"}<h4 style="color:#ff9933;"><?=_('Import/Export Devices My Devices List')?></h4>{else}<h4><a href=' {$web_vars}&display=epm_advanced&subpage=iedl'><?=_('Import/Export Devices My Devices List')?></a></h4>{/if}</td>9 <td align='center'>{if condition="$subhead_area == 'manual_upload'"}<h4 style="color:#ff9933;"><?=_('Manual Endpoint Modules Upload')?></h4>{else}<h4><a href=' {$web_vars}&display=epm_advanced&subpage=manual_upload'><?=_('Manual Endpoint Modules Upload')?></a></h4>{/if}</td>10 <td align='center'>{if condition="$subhead_area == 'sh_manager'"}<h4 style="color:#ff9933;"><?=_('Show/Hide Brands/Models')?></h4>{else}<h4><a href=' {$web_vars}&display=epm_advanced&subpage=sh_manager'><?=_('Show/Hide Brands/Models')?></a></h4>{/if}</td>8 <td align='center'>{if condition="$subhead_area == 'iedl'"}<h4 style="color:#ff9933;"><?=_('Import/Export Devices My Devices List')?></h4>{else}<h4><a href='config.php?type=tool&display=epm_advanced&subpage=iedl'><?=_('Import/Export Devices My Devices List')?></a></h4>{/if}</td> 9 <td align='center'>{if condition="$subhead_area == 'manual_upload'"}<h4 style="color:#ff9933;"><?=_('Manual Endpoint Modules Upload')?></h4>{else}<h4><a href='config.php?type=tool&display=epm_advanced&subpage=manual_upload'><?=_('Manual Endpoint Modules Upload')?></a></h4>{/if}</td> 10 <td align='center'>{if condition="$subhead_area == 'sh_manager'"}<h4 style="color:#ff9933;"><?=_('Show/Hide Brands/Models')?></h4>{else}<h4><a href='config.php?type=tool&display=epm_advanced&subpage=sh_manager'><?=_('Show/Hide Brands/Models')?></a></h4>{/if}</td> 11 11 </tr> 12 12 </table> modules/branches/2.9/endpointman/templates/freepbx/brand_model_manager.html
r11318 r11618 29 29 </script> 30 30 <center> 31 <form id='check' action='config.php {$web_var}&display=epm_config' method='POST'>31 <form id='check' action='config.php?type=tool&display=epm_config' method='POST'> 32 32 <input type="submit" name="button_check_for_updates" onclick="check();" value="<?=_('Check for Updates')?>"> 33 33 </form> … … 160 160 <table width="100%" class="brand" border="0" cellspacing="0" cellpadding="0"> 161 161 <tr> 162 <td colspan="2">{$value.name} {if condition="$value.installed == '1'"}(<?=_('Package Last Modified')?> [{$value.cfg_ver}]) {/if}<form action='config.php {$web_var}&display=epm_config' method='POST'><input type="hidden" name="brand" value="{$value.id}"><input type="submit" name="button_{if condition="$value.installed == '1'"}uninstall{else}install{/if}" class="button_{if condition="$value.installed == '1'"}Disable{else}Enable{/if}" value="{if condition="$value.installed == '1'"}<?=_('Uninstall')?>{else}<?=_('Install')?>{/if}">{if condition="array_key_exists('update',$value)"}{if condition="$value.update == 1"}New Package Modified [{$value.update_vers}]<input type="submit" name="button_update" class="button_update" value="<?=_('Update')?>">{/if}{/if}</form></td>162 <td colspan="2">{$value.name} {if condition="$value.installed == '1'"}(<?=_('Package Last Modified')?> [{$value.cfg_ver}]) {/if}<form action='config.php?type=tool&display=epm_config' method='POST'><input type="hidden" name="brand" value="{$value.id}"><input type="submit" name="button_{if condition="$value.installed == '1'"}uninstall{else}install{/if}" class="button_{if condition="$value.installed == '1'"}Disable{else}Enable{/if}" value="{if condition="$value.installed == '1'"}<?=_('Uninstall')?>{else}<?=_('Install')?>{/if}">{if condition="array_key_exists('update',$value)"}{if condition="$value.update == 1"}New Package Modified [{$value.update_vers}]<input type="submit" name="button_update" class="button_update" value="<?=_('Update')?>">{/if}{/if}</form></td> 163 163 </tr> 164 164 <tr> … … 167 167 <table width="100%" class="product" border="0" cellspacing="0" cellpadding="0"> 168 168 <tr> 169 <td colspan="2">{$value.long_name} {if condition="$value.cfg_ver != ''"}{/if} <form action='config.php {$web_var}&display=epm_config' method='POST'><input type="hidden" name="product" value="{$value.id}">{if condition="array_key_exists('update',$value)"}{if condition="$value.update == 1"}<input type="submit" name="button_update" class="button_update" value="Update">{/if}{/if}{if condition="$value.fw_type == 'install'"}<input type="submit" name="button_install_firmware" class="button_update" value="<?=_('Install Firmware')?>">{elseif condition="$value.fw_type == 'remove'"}<input type="submit" name="button_remove_firmware" class="button_update" value="<?=_('Remove Firmware')?>">{/if}{if condition="array_key_exists('update_fw',$value)"}{if condition="$value.update_fw == 1"}<input type="submit" name="button_update_firmware" class="button_update" value="<?=_('Update Firmware')?>">{/if}{/if}</form></td>169 <td colspan="2">{$value.long_name} {if condition="$value.cfg_ver != ''"}{/if} <form action='config.php?type=tool&display=epm_config' method='POST'><input type="hidden" name="product" value="{$value.id}">{if condition="array_key_exists('update',$value)"}{if condition="$value.update == 1"}<input type="submit" name="button_update" class="button_update" value="Update">{/if}{/if}{if condition="$value.fw_type == 'install'"}<input type="submit" name="button_install_firmware" class="button_update" value="<?=_('Install Firmware')?>">{elseif condition="$value.fw_type == 'remove'"}<input type="submit" name="button_remove_firmware" class="button_update" value="<?=_('Remove Firmware')?>">{/if}{if condition="array_key_exists('update_fw',$value)"}{if condition="$value.update_fw == 1"}<input type="submit" name="button_update_firmware" class="button_update" value="<?=_('Update Firmware')?>">{/if}{/if}</form></td> 170 170 </tr> 171 171 <tr> … … 174 174 <table width="100%" class="model" border="0" cellspacing="0" cellpadding="0"> 175 175 <tr> 176 <td>{$value.model} <form action='config.php {$web_var}&display=epm_config' method='POST'><input type="hidden" name="model" value="{$value.id}"><input type="submit" name="button_{if condition="$value.enabled == '1'"}disable{else}enable{/if}" class="button_{if condition="$value.enabled == '1'"}Disable{else}Enable{/if}" value="{if condition="$value.enabled == '1'"}<?=_('Disable')?>{else}<?=_('Enable')?>{/if}"></form></td>176 <td>{$value.model} <form action='config.php?type=tool&display=epm_config' method='POST'><input type="hidden" name="model" value="{$value.id}"><input type="submit" name="button_{if condition="$value.enabled == '1'"}disable{else}enable{/if}" class="button_{if condition="$value.enabled == '1'"}Disable{else}Enable{/if}" value="{if condition="$value.enabled == '1'"}<?=_('Disable')?>{else}<?=_('Enable')?>{/if}"></form></td> 177 177 </tr> 178 178 </table>{/loop}</td> modules/branches/2.9/endpointman/templates/freepbx/devices_manager.html
r11318 r11618 60 60 <center> 61 61 {if condition="$no_add == FALSE"} 62 <form id='go' action='config.php?type=tool& display=epm_devices' method='POST'>62 <form id='go' action='config.php?type=tool&display=epm_devices' method='POST'> 63 63 <label><?=_('Search for new devices in netmask')?> 64 64 <input name="netmask" type="text" value="{$srvip}/24"> … … 84 84 <td align='center'></td> 85 85 </tr> 86 <form name="adding" id="adding" action='config.php?type=tool& display=epm_devices' method='POST' />86 <form name="adding" id="adding" action='config.php?type=tool&display=epm_devices' method='POST' /> 87 87 88 88 {if condition="$no_add == FALSE"} … … 304 304 <td align='center'><h3>Delete</h3></td> 305 305 </tr> 306 <form id="managed" action='config.php?type=tool& display=epm_devices' method='POST'>306 <form id="managed" action='config.php?type=tool&display=epm_devices' method='POST'> 307 307 {loop name="list"} 308 308 <tr class="headerRow"> modules/branches/2.9/endpointman/templates/freepbx/global_footer.html
r11318 r11618 1 < hr>1 <!--<hr> 2 2 <h6 align='center'>The Endpoint Configuration Manager is currently maintained by <a target="_blank" href=http://www.andrewsnagy.com/>Andrew Nagy</a> 3 3 <br/><?=_("The Endpoint Configuration Manager was originally written by")?> <a target="_blank" href=http://www.mymcs.us>Ed Macri</a>, <a target="_blank" href=http://www.cohutta.com> John Mullinix.</a> and <a target="_blank" href=http://www.colsolgrp.com>Tony Shiffer</a> … … 5 5 <br> <?=_("The project is maintained at")?> 6 6 <a target="_blank" href="http://projects.colsolgrp.net/projects/show/endpointman"> CSG Software Projects.</a> 7 </body> 8 </html> 7 --> modules/branches/2.9/endpointman/templates/freepbx/global_header.html
r11318 r11618 2 2 <head> 3 3 <title>PBX Endpoint Configuration Manager</title> 4 {if condition="isset($silent_mode)"} 5 <script type="text/javascript" src="common/libfreepbx.javascripts.js" language="javascript"></script> 4 6 <script type="text/javascript" src="assets/endpointman/js/jquery.tools.min.js"></script> 5 {if condition="isset($silent_mode)"}6 <script type="text/javascript" src="assets/endpointman/js/jquery -1.3.2.min.js"></script>7 <script type="text/javascript" src="assets/endpointman/js/jquery.easing.1.3.js"></script> 8 <script type="text/javascript" src="assets/endpointman/js/jquery.coda-slider-2.0.js"></script> 7 9 <link href="common/mainstyle.css" rel="stylesheet" type="text/css" /> 10 {/if} 11 {if condition="$amp_ver < 2.9"} 12 <script type="text/javascript" src="assets/endpointman/js/jquery.tools.min.js"></script> 13 <script type="text/javascript" src="assets/endpointman/js/jquery.easing.1.3.js"></script> 14 <script type="text/javascript" src="assets/endpointman/js/jquery.coda-slider-2.0.js"></script> 8 15 {/if} 9 16 <style> … … 40 47 <link href="assets/endpointman/theme/coda-slider-2.0a.css" media="screen, projection" rel="stylesheet" type="text/css" /> 41 48 42 43 <!-- Begin JavaScript -->44 <script type="text/javascript" src="assets/endpointman/js/jquery.easing.1.3.js"></script>45 <script type="text/javascript" src="assets/endpointman/js/jquery.coda-slider-2.0.js"></script>46 49 <script type="text/javascript"> 47 50 $().ready(function() { … … 51 54 }); 52 55 </script> 53 <!-- End JavaScript -->54 56 {/if} 55 57 {if condition="isset($amp_conf_serial)"} modules/branches/2.9/endpointman/templates/freepbx/message_box.html
r10792 r11618 1 <div style="background-color:#f8f8ff; border: 1px solid #aaaaff; padding:10px;font-family:arial;color:{if condition="$fatal_error == 1"}red{else}grey{/if};font-size:20px;text-align:center"><b>{$error_message}</b>{if condition="$advanced_debug == 1"}<br /><h5 style="font-family:arial;color:black;font-size:12px;text-align:left"><pre>< ?=debug_print_backtrace();?></pre></h5>{/if}</div>1 <div style="background-color:#f8f8ff; border: 1px solid #aaaaff; padding:10px;font-family:arial;color:{if condition="$fatal_error == 1"}red{else}grey{/if};font-size:20px;text-align:center"><b>{$error_message}</b>{if condition="$advanced_debug == 1"}<br /><h5 style="font-family:arial;color:black;font-size:12px;text-align:left"><pre><u>Backtrace</u><br /><?=debug_print_backtrace();?><br /><u>Extended Backtrace</u><br /><?=var_dump(debug_backtrace());?><br /><u>Last Error</u><br /><?=print_r(error_get_last());?></pre></h5>{/if}</div> modules/branches/2.9/endpointman/templates/freepbx/template_editor.html
r11318 r11618 37 37 <strong><?=_('Clone of Model')?>:</strong> {$model}<br /> 38 38 <strong><?=_('Display')?></strong> 39 {if condition="isset($silent_mode)"} 40 <select name="area_list" onchange="window.location.href='config.php?display=epm_config&quietmode=1&handler=file&file=popup.html.php&module=endpointman&pop_type=edit_template&edit_id={$hidden_id}&model_list=126&template_list=0&rand='+ new Date().getTime() + '&maxlines='+this.options[this.selectedIndex].value"> 41 {else} 39 42 <select name="area_list" onchange="window.location.href='config.php?type=tool&edit_template=true&display=epm_templates&custom='+ document.getElementById('custom').value +'&id='+ document.getElementById('id').value +'&maxlines='+this.options[this.selectedIndex].value"> 43 {/if} 40 44 {loop name="area_ava"} 41 45 <option value="{$value.value}" {if condition="!empty($value.selected)"}selected{/if}>{$value.text}</option> … … 58 62 </select><br/> 59 63 <strong><?=_('Display')?></strong> 64 {if condition="isset($silent_mode)"} 65 <select name="area_list" onchange="window.location.href='config.php?display=epm_config&quietmode=1&handler=file&file=popup.html.php&module=endpointman&pop_type=edit_template&edit_id={$hidden_id}&model_list=126&template_list=0&rand='+ new Date().getTime() + '&maxlines='+this.options[this.selectedIndex].value"> 66 {else} 60 67 <select name="area_list" onchange="window.location.href='config.php?type=tool&edit_template=true&display=epm_templates&custom='+ document.getElementById('custom').value +'&id='+ document.getElementById('id').value +'&maxlines='+this.options[this.selectedIndex].value"> 68 {/if} 61 69 {loop name="area_ava"} 62 70 <option value="{$value.value}" {if condition="!empty($value.selected)"}selected{/if}>{$value.text}</option> modules/branches/2.9/endpointman/templates/freepbx/template_manager.html
r11318 r11618 5 5 {if condition="$no_add == FALSE"} 6 6 <center> 7 <h3><?=_('Add New Template')?>:</h3><form action="config.php? display=epm_templates&Submit=EditTemplate" method="POST">7 <h3><?=_('Add New Template')?>:</h3><form action="config.php?type=tool&display=epm_templates&Submit=EditTemplate" method="POST"> 8 8 <?=_('Template Name')?>: 9 9 <label> … … 42 42 <td>{$value.model_clone}</td> 43 43 44 <td align='center' width='9%'><a href="config.php?type=tool& edit_template=true&display=epm_templates&custom={$value.custom}&id={$value.id}"><img src='assets/endpointman/images/edit.png' ALT='<?=_('Edit')?>' border='0'></a></td>44 <td align='center' width='9%'><a href="config.php?type=tool&edit_template=true&display=epm_templates&custom={$value.custom}&id={$value.id}"><img src='assets/endpointman/images/edit.png' ALT='<?=_('Edit')?>' border='0'></a></td> 45 45 <td align='center' width='5%'>{if condition="$value.custom == 0"} 46 <a href="config.php?type=tool& delete_template=true&display=epm_templates&id={$value.id}"><img src='assets/endpointman/images/delete.png' ALT='<?=_('Delete')?>' border='0'></a>{/if}</td>46 <a href="config.php?type=tool&delete_template=true&display=epm_templates&id={$value.id}"><img src='assets/endpointman/images/delete.png' ALT='<?=_('Delete')?>' border='0'></a>{/if}</td> 47 47 </tr> 48 48 {/loop}
