Changeset 11318

Show
Ignore:
Timestamp:
02/07/11 17:09:22 (2 years ago)
Author:
tm1000
Message:

Fixed: (Internet Explorer Javascript Issues), (Elastix SIP Extension Page Issues + Embedded FreePBX related Issues), (Add Reboot Option to ARI Module Interface), (Add & Fix Reboot Messages), (Fix all asset [JS,IMGS,CSS] related 404, 403 issues), (Delete Device when Extension is deleted on FreePBX Extensions Page), (Fixed Issue where system wouldn't generate configs when device was added through FreePBX Extension Page)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.9/endpointman/ENDPOINTMAN_LICENSE.txt

    r10792 r11318  
    2424  Andrew Nagy 
    2525  Darren Schreiber 
    26         Philippe Lindheimer 
     26  Philippe Lindheimer 
     27  Andrew Miffleton 
    2728 
    2829Alternatively, the contents of this file may be used under the terms of 
  • modules/branches/2.9/endpointman/config.php

    r10333 r11318  
    2222 
    2323$endpoint = new endpointmanager(); 
     24 
     25if(!file_exists($amp_conf['AMPWEBROOT'].'/admin/assets/endpointman/images/add.png')) { 
     26    echo "WARNING: Assets Missing! ^^Please click the Orange \"Apply Configuration Changes\" Bar"; 
     27} 
    2428 
    2529if(!file_exists(PHONE_MODULES_PATH."temp/")) { 
  • modules/branches/2.9/endpointman/functions.inc.php

    r11086 r11318  
    136136 
    137137                            $row = $endpoint->get_phone_info($ext_id); 
    138                             $endpoint->prepare_configs($row,FALSE); 
     138                            if(isset($reboot)) { 
     139                                $endpoint->prepare_configs($row); 
     140                            } else { 
     141                                $endpoint->prepare_configs($row,FALSE); 
     142                            } 
    139143                        } 
    140144                    } 
  • modules/branches/2.9/endpointman/includes/devices_manager.inc

    r11086 r11318  
    293293    case "rebuild_selected_phones": 
    294294        if(isset($_REQUEST['selected'])) { 
    295             $rebooted = NULL; 
    296295            foreach($_REQUEST['selected'] as $key => $data) { 
    297296                $phone_info = $endpoint->get_phone_info($_REQUEST['selected'][$key]); 
    298297                if(isset($_REQUEST['reboot'])) { 
    299298                    $endpoint->prepare_configs($phone_info); 
    300                     $rebooted = "& Rebooted"; 
     299                    $rebooted_msg = "& Rebooted"; 
    301300                } else { 
    302301                    $endpoint->prepare_configs($phone_info,FALSE); 
    303                     $rebooted = "For"; 
    304                 } 
    305             } 
    306             $message = "Rebuilt Configs ".$rebooted." Selected Phones"; 
     302                    $rebooted_msg = "For"; 
     303                } 
     304            } 
     305            $message = "Rebuilt Configs ".$rebooted_msg." Selected Phones"; 
    307306        } else { 
    308307            $message = _("No Phones Selected")."!"; 
     
    312311        $sql = "SELECT endpointman_mac_list.id FROM endpointman_mac_list, endpointman_brand_list, endpointman_product_list, endpointman_model_list WHERE endpointman_brand_list.id = endpointman_product_list.brand AND endpointman_product_list.id = endpointman_model_list.product_id AND endpointman_mac_list.model = endpointman_model_list.id ORDER BY endpointman_product_list.cfg_dir ASC"; 
    313312        $mac_list =& $endpoint->db->getAll($sql,array(),DB_FETCHMODE_ASSOC); 
    314         $rebooted = NULL; 
    315313        foreach($mac_list as $data) { 
    316314            $phone_info = $endpoint->get_phone_info($data['id']); 
     
    321319            if(isset($_REQUEST['reboot'])) { 
    322320                $endpoint->prepare_configs($phone_info); 
    323                 $rebooted = "& Rebooted"; 
    324             } else { 
    325                 $endpoint->prepare_configs($phone_info,FALSE); 
    326                 $rebooted = "For"; 
    327            
    328        
    329         $message = "Rebuilt Configs ".$rebooted." All Phones"; 
     321                    $rebooted_msg = "& Rebooted"; 
     322                } else { 
     323                    $endpoint->prepare_configs($phone_info,FALSE); 
     324                    $rebooted_msg = "For"; 
     325               
     326           
     327            $message = "Rebuilt Configs ".$rebooted_msg." All Phones"; 
    330328        break; 
    331329    case "reboot_brand" : 
     
    458456                        $endpoint->prepare_configs($phone_info,FALSE); 
    459457                    } 
    460                     $message = _("Changed Model/Brand").$rebooted."!"; 
     458                    $message = _("Saved").$rebooted."!"; 
    461459                } 
    462460            } else { 
     
    481479                if(isset($_REQUEST['reboot'])) { 
    482480                    $endpoint->prepare_configs($phone_info); 
    483                     $rebooted = "& Rebooted"; 
     481                    $rebooted_msg = "& Rebooted Phones"; 
    484482                } else { 
    485483                    $endpoint->prepare_configs($phone_info,FALSE); 
    486                     $rebooted = ""; 
     484                    $rebooted_msg = ""; 
    487485                } 
    488486                foreach($phone_info['line'] as $line) { 
     
    491489                } 
    492490            } 
    493             $message = "Rebuilt Configs " .$rebooted
     491            $message = "Rebuilt Configs " . $rebooted_msg
    494492        } 
    495493        break; 
  • modules/branches/2.9/endpointman/includes/functions.inc

    r11075 r11318  
    5353        //end possible removal 
    5454 
     55    define("MODULES_PATH", $this->get_modules_dir()); 
     56 
    5557        //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 
    56         if(file_exists(dirname($_SERVER["SCRIPT_FILENAME"])."/modules/_ep_phone_modules/")) { 
    57             define("PHONE_MODULES_PATH", dirname($_SERVER["SCRIPT_FILENAME"])."/modules/_ep_phone_modules/"); 
    58         } else { 
    59             $this->error['amp_conf'] = "Phone Modules Directory doesn't exist!"; 
    60             $this->global_cfg['disable_epm'] = TRUE; 
    61         } 
    62  
    63         //Get local path information 
    64         define("WEB_PATH", dirname($_SERVER['SCRIPT_NAME'])."/modules/endpointman/"); 
    65         define("LOCAL_PATH", dirname($_SERVER["SCRIPT_FILENAME"])."/modules/endpointman/"); 
     58        if(file_exists(MODULES_PATH."_ep_phone_modules/")) { 
     59            define("PHONE_MODULES_PATH", MODULES_PATH."_ep_phone_modules/"); 
     60        } else {   
     61            die("Phone Modules Directory doesn't exist!"); 
     62        } 
     63 
     64    //Determine if local path is correct! 
     65    if(file_exists(MODULES_PATH."endpointman/")) { 
     66      define("LOCAL_PATH", MODULES_PATH."endpointman/"); 
     67    } else { 
     68      die("Can't Load Local Endpoint Manager Directory!"); 
     69    }          
     70 
     71        //include the local template class 
     72        if(file_exists(LOCAL_PATH."includes/rain.tpl.class.php")) { 
     73            require(LOCAL_PATH."includes/rain.tpl.class.php"); 
     74        } else { 
     75            die("Can't Load the Template Class"); 
     76        } 
    6677 
    6778        //Define error reporting 
     
    90101        } 
    91102 
    92         //include the local template class 
    93         if(file_exists(LOCAL_PATH."includes/rain.tpl.class.php")) { 
    94             require(LOCAL_PATH."includes/rain.tpl.class.php"); 
    95         } else { 
    96             $this->error['rain_tpl'] = "Can't Load the Template Class"; 
    97             $this->global_cfg['diable_epm'] = TRUE; 
    98         } 
    99103 
    100104        $this->tpl = new RainTPL( LOCAL_PATH.'templates/freepbx', LOCAL_PATH.'templates/freepbx/compiled', '/admin/modules/endpointman/templates/images' ); 
     105 
    101106 
    102107        if($this->global_cfg['disable_help']) { 
    103108            $this->tpl->assign("disable_help", 1); 
    104109        } 
    105          
    106         $this->tpl->assign("web_path", WEB_PATH); 
    107     } 
     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  } 
     128   
    108129 
    109130    /** 
     
    247268                return(TRUE); 
    248269            } else { 
    249                 //$message = _("You can't remove the only line left")."!"; 
    250270                $this->message['delete_line'] = _("You can't remove the only line left")."!"; 
    251271                return(FALSE); 
  • modules/branches/2.9/endpointman/includes/installer.php

    r10792 r11318  
    77 * @package Provisioner 
    88 */ 
     9 
    910require 'functions.inc'; 
    1011 
     
    1314echo "<html><head><title>Installer</title></head><body>"; 
    1415 
    15 function out($text){ 
    16     echo $text."<br />"; 
     16if(!function_exists("out")) { 
     17    function out($text){ 
     18        echo $text."<br />"; 
     19    } 
    1720} 
    1821 
  • modules/branches/2.9/endpointman/install.php

    r11109 r11318  
    77 * @package Endpoint Manager 
    88 */ 
    9  
    10 // Leaving these conditional functions for now since this module is used 
    11 // by some earlier releases of FreePBX which may not have them. 
    12 // 
    139if (! function_exists("out")) { 
    1410    function out($text) { 
     
    6662define("LOCAL_PATH", $amp_conf['AMPWEBROOT'].'/admin/modules/endpointman/'); 
    6763 
     64 
    6865if(!file_exists(PHONE_MODULES_PATH)) { 
    69  mkdir(PHONE_MODULES_PATH, 0764); 
    70         out("Creating Phone Modules Directory"); 
     66    mkdir(PHONE_MODULES_PATH, 0764); 
     67    out("Creating Phone Modules Directory"); 
    7168} 
    7269 
    7370if(!file_exists(PHONE_MODULES_PATH."setup.php")) { 
    74  copy(LOCAL_PATH."install/setup.php",PHONE_MODULES_PATH."setup.php"); 
    75         out("Moving Auto Provisioner Class"); 
     71    copy(LOCAL_PATH."install/setup.php",PHONE_MODULES_PATH."setup.php"); 
     72    out("Moving Auto Provisioner Class"); 
    7673} 
    7774 
    7875if(!file_exists(PHONE_MODULES_PATH."temp/")) { 
    79  mkdir(PHONE_MODULES_PATH."temp/", 0764); 
    80         out("Creating temp folder"); 
     76    mkdir(PHONE_MODULES_PATH."temp/", 0764); 
     77    out("Creating temp folder"); 
    8178} 
    8279//Detect Version 
    8380 
    8481function ep_table_exists ($table) { 
    85  global $db; 
     82    global $db; 
    8683    $sql = "SHOW TABLES FROM asterisk"; 
    8784    $result = $db->getAll($sql); 
     
    9895 
    9996if(ep_table_exists("endpointman_global_vars")) { 
    100         $global_cfg =& $db->getAssoc("SELECT var_name, value FROM endpointman_global_vars"); 
     97    $global_cfg =& $db->getAssoc("SELECT var_name, value FROM endpointman_global_vars"); 
    10198} else { 
    10299    $global_cfg['version'] = '?'; 
     
    908905if ($new_install) { 
    909906 
    910         out("Creating Brand List Table"); 
    911         $sql = "CREATE TABLE IF NOT EXISTS `endpointman_brand_list` ( 
     907    out("Creating Brand List Table"); 
     908    $sql = "CREATE TABLE IF NOT EXISTS `endpointman_brand_list` ( 
    912909                  `id` varchar(11) NOT NULL, 
    913910                  `name` varchar(255) NOT NULL, 
     
    918915                  PRIMARY KEY (`id`) 
    919916                ) ENGINE=MyISAM DEFAULT CHARSET=latin1"; 
    920         $db->query($sql); 
    921  
    922         out("Creating Line List Table"); 
    923  
    924         $sql = "CREATE TABLE IF NOT EXISTS `endpointman_line_list` ( 
     917    $db->query($sql); 
     918 
     919    out("Creating Line List Table"); 
     920 
     921    $sql = "CREATE TABLE IF NOT EXISTS `endpointman_line_list` ( 
    925922  `luid` int(11) NOT NULL AUTO_INCREMENT, 
    926923  `mac_id` int(11) NOT NULL, 
     
    934931    $db->query($sql); 
    935932 
    936         out("Creating Global Variables Table"); 
    937         $sql = "CREATE TABLE IF NOT EXISTS `endpointman_global_vars` ( 
     933    out("Creating Global Variables Table"); 
     934    $sql = "CREATE TABLE IF NOT EXISTS `endpointman_global_vars` ( 
    938935                  `idnum` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Index', 
    939936                  `var_name` varchar(25) NOT NULL COMMENT 'Variable Name', 
     
    941938                  PRIMARY KEY (`idnum`) 
    942939                ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=17"; 
    943         $db->query($sql); 
    944  
    945         out("Locating NMAP + ARP + ASTERISK Executables"); 
    946         $nmap = find_exec("nmap"); 
    947         $arp = find_exec("arp"); 
    948         $asterisk = find_exec("asterisk"); 
    949  
    950         out("Inserting data into the global vars Table"); 
    951         $sql = "INSERT INTO `endpointman_global_vars` (`idnum`, `var_name`, `value`) VALUES 
     940    $db->query($sql); 
     941 
     942    out("Locating NMAP + ARP + ASTERISK Executables"); 
     943    $nmap = find_exec("nmap"); 
     944    $arp = find_exec("arp"); 
     945    $asterisk = find_exec("asterisk"); 
     946 
     947    out("Inserting data into the global vars Table"); 
     948    $sql = "INSERT INTO `endpointman_global_vars` (`idnum`, `var_name`, `value`) VALUES 
    952949            (1, 'srvip', ''), 
    953950            (2, 'tz', ''), 
     
    967964            (16, 'endpoint_vers', '0'), 
    968965            (17, 'disable_help', '0')"; 
    969         $db->query($sql); 
    970  
    971         out("Creating mac list Table"); 
    972         $sql = "CREATE TABLE IF NOT EXISTS `endpointman_mac_list` ( 
     966    $db->query($sql); 
     967 
     968    out("Creating mac list Table"); 
     969    $sql = "CREATE TABLE IF NOT EXISTS `endpointman_mac_list` ( 
    973970  `id` int(10) NOT NULL AUTO_INCREMENT, 
    974971  `mac` varchar(12) DEFAULT NULL, 
     
    981978  UNIQUE KEY `mac` (`mac`) 
    982979) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1"; 
    983         $db->query($sql); 
    984  
    985         out("Creating model List Table"); 
    986         $sql = "CREATE TABLE IF NOT EXISTS `endpointman_model_list` ( 
     980    $db->query($sql); 
     981 
     982    out("Creating model List Table"); 
     983    $sql = "CREATE TABLE IF NOT EXISTS `endpointman_model_list` ( 
    987984  `id` varchar(11) NOT NULL COMMENT 'Key ', 
    988985  `brand` int(11) NOT NULL COMMENT 'Brand', 
     
    996993  PRIMARY KEY (`id`) 
    997994) ENGINE=MyISAM DEFAULT CHARSET=latin1"; 
    998         $db->query($sql); 
    999  
    1000         out("Creating oui List Table"); 
    1001         $sql = "CREATE TABLE IF NOT EXISTS `endpointman_oui_list` ( 
     995    $db->query($sql); 
     996 
     997    out("Creating oui List Table"); 
     998    $sql = "CREATE TABLE IF NOT EXISTS `endpointman_oui_list` ( 
    1002999          `id` int(30) NOT NULL AUTO_INCREMENT, 
    10031000          `oui` varchar(30) DEFAULT NULL, 
     
    10071004          UNIQUE KEY `oui` (`oui`) 
    10081005        ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1"; 
    1009         $db->query($sql); 
    1010  
    1011         out("Creating product List Table"); 
    1012         $sql = "CREATE TABLE IF NOT EXISTS `endpointman_product_list` ( 
     1006    $db->query($sql); 
     1007 
     1008    out("Creating product List Table"); 
     1009    $sql = "CREATE TABLE IF NOT EXISTS `endpointman_product_list` ( 
    10131010  `id` varchar(11) NOT NULL, 
    10141011  `brand` int(11) NOT NULL, 
     
    10241021  PRIMARY KEY (`id`) 
    10251022) ENGINE=MyISAM DEFAULT CHARSET=latin1"; 
    1026         $db->query($sql); 
    1027  
    1028         out("Creating Template List Table"); 
    1029         $sql = "CREATE TABLE IF NOT EXISTS `endpointman_template_list` ( 
     1023    $db->query($sql); 
     1024 
     1025    out("Creating Template List Table"); 
     1026    $sql = "CREATE TABLE IF NOT EXISTS `endpointman_template_list` ( 
    10301027  `id` int(11) NOT NULL AUTO_INCREMENT, 
    10311028  `product_id` varchar(11) NOT NULL, 
     
    10361033  PRIMARY KEY (`id`) 
    10371034) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1"; 
    1038         $db->query($sql); 
    1039  
    1040         out("Creating Time Zone List Table"); 
    1041         $sql = "CREATE TABLE IF NOT EXISTS `endpointman_time_zones` ( 
     1035    $db->query($sql); 
     1036 
     1037    out("Creating Time Zone List Table"); 
     1038    $sql = "CREATE TABLE IF NOT EXISTS `endpointman_time_zones` ( 
    10421039    `idnum` int(11) NOT NULL auto_increment COMMENT 'Record Number', 
    10431040    `tz` varchar(10) NOT NULL COMMENT 'Time Zone', 
     
    10461043    PRIMARY KEY  (`idnum`) 
    10471044  ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=116"; 
    1048         $db->query($sql); 
    1049  
    1050         out("Inserting Data into table Table"); 
    1051         $sql = "INSERT INTO `endpointman_time_zones` (`idnum`, `tz`, `gmtoff`, `gmthr`) VALUES 
     1045    $db->query($sql); 
     1046 
     1047    out("Inserting Data into table Table"); 
     1048    $sql = "INSERT INTO `endpointman_time_zones` (`idnum`, `tz`, `gmtoff`, `gmthr`) VALUES 
    10521049  (1, 'USA-10', '-36000', 'GMT-10:00'), 
    10531050  (2, 'USA-9', '-32400', 'GMT-09:00'), 
     
    11651162  (114, 'NZL+12.75', '45900', 'GMT+12:00'), 
    11661163  (115, 'TON+13', '46800', 'GMT+13:00')"; 
    1167         $db->query($sql); 
    1168  
    1169         out("Create Custom Configs Table"); 
    1170         $sql = "CREATE TABLE IF NOT EXISTS `endpointman_custom_configs` ( 
     1164    $db->query($sql); 
     1165 
     1166    out("Create Custom Configs Table"); 
     1167    $sql = "CREATE TABLE IF NOT EXISTS `endpointman_custom_configs` ( 
    11711168          `id` int(11) NOT NULL AUTO_INCREMENT, 
    11721169          `name` varchar(255) NOT NULL, 
     
    11761173          PRIMARY KEY (`id`) 
    11771174        ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1"; 
    1178         $db->query($sql); 
    1179  
    1180 } else { 
    1181     out("Update Version Number to ".$version); 
    1182     $sql = "UPDATE endpointman_global_vars SET value = '".$version."' WHERE var_name = 'version'"; 
    11831175    $db->query($sql); 
    11841176 
    1185  
    1186     $sql = "UPDATE endpointman_global_vars SET value = 'http://www.provisioner.net/release3/' WHERE var_name = 'update_server'"; 
    1187     $db->query($sql); 
    1188 
    1189  
    1190 if(file_exists($amp_conf['AMPWEBROOT']."/recordings")) { 
    1191     out("Installing ARI Module"); 
     1177
     1178 
     1179out("Update Version Number to ".$version); 
     1180$sql = "UPDATE endpointman_global_vars SET value = '".$version."' WHERE var_name = 'version'"; 
     1181$db->query($sql); 
     1182 
     1183$sql = "UPDATE endpointman_global_vars SET value = 'http://www.provisioner.net/release3/' WHERE var_name = 'update_server'"; 
     1184$db->query($sql); 
     1185 
     1186$sql = 'SELECT value FROM `admin` WHERE `variable` LIKE CONVERT(_utf8 \'version\' USING latin1) COLLATE latin1_swedish_ci'; 
     1187$amp_version = $db->getOne($sql); 
     1188 
     1189if(file_exists($amp_conf['AMPWEBROOT']."/recordings/modules/phonesettings.module")) { 
    11921190    unlink($amp_conf['AMPWEBROOT']."/recordings/modules/phonesettings.module"); 
    1193     symlink(LOCAL_PATH. "install/phonesettings.module", $amp_conf['AMPWEBROOT']."/recordings/modules/phonesettings.module"); 
    1194  
    1195     if(!file_exists($amp_conf['AMPWEBROOT']."/recordings/theme/js/")) { 
    1196         mkdir($amp_conf['AMPWEBROOT']."/recordings/theme/js/"); 
    1197     } 
    1198  
     1191
     1192 
     1193if(file_exists($amp_conf['AMPWEBROOT']."/recordings/theme/js/jquery.coda-slider-2.0.js")) { 
    11991194    unlink($amp_conf['AMPWEBROOT']."/recordings/theme/js/jquery.coda-slider-2.0.js"); 
     1195} 
     1196 
     1197if(file_exists($amp_conf['AMPWEBROOT']."/recordings/theme/js/jquery.easing.1.3.js")) { 
    12001198    unlink($amp_conf['AMPWEBROOT']."/recordings/theme/js/jquery.easing.1.3.js"); 
     1199} 
     1200 
     1201if(file_exists($amp_conf['AMPWEBROOT']."/recordings/theme/coda-slider-2.0a.css")) { 
    12011202    unlink($amp_conf['AMPWEBROOT']."/recordings/theme/coda-slider-2.0a.css"); 
    1202     symlink(LOCAL_PATH. "templates/freepbx/javascript/jquery.coda-slider-2.0.js", $amp_conf['AMPWEBROOT']."/recordings/theme/js/jquery.coda-slider-2.0.js"); 
    1203     symlink(LOCAL_PATH. "templates/freepbx/javascript/jquery.easing.1.3.js", $amp_conf['AMPWEBROOT']."/recordings/theme/js/jquery.easing.1.3.js"); 
    1204     symlink(LOCAL_PATH. "templates/freepbx/stylesheets/coda-slider-2.0a.css", $amp_conf['AMPWEBROOT']."/recordings/theme/coda-slider-2.0a.css"); 
    1205      
    1206     out("Fixing permissions on ARI module"); 
    1207     chmod($amp_conf['AMPWEBROOT']."/recordings/modules/phonesettings.module", 0664); 
    1208      
    1209 
    1210  
    1211 out("Updating Symbolic Links for Images"); 
    1212 foreach (glob(LOCAL_PATH."templates/images/*.*") as $filename) { 
    1213     //echo "$filename size " . filesize($filename) . "<br />"; 
    1214     $newloc = str_replace(stristr($filename, 'admin/'), '', $filename) . "admin/images/".basename($filename); 
    1215     //echo "\t". $newloc ."<br />"; 
    1216     unlink($newloc); 
    1217     if((!file_exists($newloc)) && (readlink($newloc) != $filename)) { 
    1218         symlink($filename, $newloc); 
    1219     } 
    1220 
    1221  
    1222 out("Updating Symbolic Links for Javascripts"); 
    1223 foreach (glob(LOCAL_PATH."templates/freepbx/javascript/*.*") as $filename) { 
    1224     //echo "$filename size " . filesize($filename) . "<br />"; 
    1225     $newloc = str_replace(stristr($filename, 'admin/'), '', $filename) . "admin/common/".basename($filename); 
    1226     //echo "\t". $newloc ."<br />"; 
    1227     unlink($newloc); 
    1228     if((!file_exists($newloc)) && (readlink($newloc) != $filename)) { 
    1229         symlink($filename, $newloc); 
    1230     } 
    1231 
    1232  
    1233 out("Updating Symbolic Links for Stylesheets"); 
    1234 foreach (glob(LOCAL_PATH."templates/freepbx/stylesheets/*.*") as $filename) { 
    1235     //echo "$filename size " . filesize($filename) . "<br />"; 
    1236     $newloc = str_replace(stristr($filename, 'admin/'), '', $filename) . "admin/common/".basename($filename); 
    1237     //echo "\t". $newloc ."<br />"; 
    1238     unlink($newloc); 
    1239     if((!file_exists($newloc)) && (readlink($newloc) != $filename)) { 
    1240         symlink($filename, $newloc); 
    1241     } 
    1242 
     1203
     1204 
     1205if($amp_version < "2.9.0") { 
     1206    //Do symlinks ourself because retrieve_conf is OLD 
     1207 
     1208    //images 
     1209    $dir = $amp_conf['AMPWEBROOT'].'/admin/assets/endpointman/images'; 
     1210    if(!file_exists($dir)) { 
     1211        mkdir($dir, 0777, TRUE); 
     1212    } 
     1213    foreach (glob(LOCAL_PATH."assets/images/*.*") as $filename) { 
     1214        if(file_exists($dir.'/'.basename($filename))) { 
     1215            unlink($dir.'/'.basename($filename)); 
     1216            symlink($filename, $dir.'/'.basename($filename)); 
     1217        } else { 
     1218            symlink($filename, $dir.'/'.basename($filename)); 
     1219        } 
     1220    } 
     1221 
     1222    //javascripts 
     1223    $dir = $amp_conf['AMPWEBROOT'].'/admin/assets/endpointman/js'; 
     1224    if(!file_exists($dir)) { 
     1225        mkdir($dir, 0777, TRUE); 
     1226    } 
     1227    foreach (glob(LOCAL_PATH."assets/js/*.*") as $filename) { 
     1228        if(file_exists($dir.'/'.basename($filename))) { 
     1229            unlink($dir.'/'.basename($filename)); 
     1230            symlink($filename, $dir.'/'.basename($filename)); 
     1231        } else { 
     1232            symlink($filename, $dir.'/'.basename($filename)); 
     1233        } 
     1234    } 
     1235 
     1236    //theme (css/stylesheets) 
     1237    $dir = $amp_conf['AMPWEBROOT'].'/admin/assets/endpointman/theme'; 
     1238    if(!file_exists($dir)) { 
     1239        mkdir($dir, 0777, TRUE); 
     1240    } 
     1241    foreach (glob(LOCAL_PATH."assets/theme/*.*") as $filename) { 
     1242        if(file_exists($dir.'/'.basename($filename))) { 
     1243            unlink($dir.'/'.basename($filename)); 
     1244            symlink($filename, $dir.'/'.basename($filename)); 
     1245        } else { 
     1246            symlink($filename, $dir.'/'.basename($filename)); 
     1247        } 
     1248    } 
     1249 
     1250    //ari-theme (css/stylesheets) 
     1251    $dir = $amp_conf['AMPWEBROOT'].'/recordings/theme'; 
     1252    if(!file_exists($dir)) { 
     1253        mkdir($dir, 0777, TRUE); 
     1254    } 
     1255    foreach (glob(LOCAL_PATH."ari/theme/*.*") as $filename) { 
     1256        if(file_exists($dir.'/'.basename($filename))) { 
     1257            unlink($dir.'/'.basename($filename)); 
     1258            symlink($filename, $dir.'/'.basename($filename)); 
     1259        } else { 
     1260            symlink($filename, $dir.'/'.basename($filename)); 
     1261        } 
     1262    } 
     1263 
     1264    //ari-images 
     1265    $dir = $amp_conf['AMPWEBROOT'].'/recordings/theme/images'; 
     1266    if(!file_exists($dir)) { 
     1267        mkdir($dir, 0777, TRUE); 
     1268    } 
     1269    foreach (glob(LOCAL_PATH."ari/images/*.*") as $filename) { 
     1270        if(file_exists($dir.'/'.basename($filename))) { 
     1271            unlink($dir.'/'.basename($filename)); 
     1272            symlink($filename, $dir.'/'.basename($filename)); 
     1273        } else { 
     1274            symlink($filename, $dir.'/'.basename($filename)); 
     1275        } 
     1276    } 
     1277 
     1278    //ari-js 
     1279    $dir = $amp_conf['AMPWEBROOT'].'/recordings/theme/js'; 
     1280    if(!file_exists($dir)) { 
     1281        mkdir($dir, 0777, TRUE); 
     1282    } 
     1283    foreach (glob(LOCAL_PATH."ari/js/*.*") as $filename) { 
     1284        if(file_exists($dir.'/'.basename($filename))) { 
     1285            unlink($dir.'/'.basename($filename)); 
     1286            symlink($filename, $dir.'/'.basename($filename)); 
     1287        } else { 
     1288            symlink($filename, $dir.'/'.basename($filename)); 
     1289        } 
     1290    } 
     1291 
     1292    //ari-modules 
     1293    $dir = $amp_conf['AMPWEBROOT'].'/recordings/modules'; 
     1294    if(!file_exists($dir)) { 
     1295        mkdir($dir, 0777, TRUE); 
     1296    } 
     1297    foreach (glob(LOCAL_PATH."ari/modules/*.*") as $filename) { 
     1298        if(file_exists($dir.'/'.basename($filename))) { 
     1299            unlink($dir.'/'.basename($filename)); 
     1300            symlink($filename, $dir.'/'.basename($filename)); 
     1301        } else { 
     1302            symlink($filename, $dir.'/'.basename($filename)); 
     1303        } 
     1304    } 
     1305
  • modules/branches/2.9/endpointman/module.xml

    r11140 r11318  
    11<module> 
    22  <rawname>endpointman</rawname> 
    3   <repo>extended</repo> 
     3  <repo>standard</repo> 
    44  <name>PBX End Point Manager</name> 
    5   <version>2.9.0.3RC4</version> 
     5  <version>2.9.0.3RC5</version> 
    66  <type>tool</type> 
    77  <category>End Point Manager</category> 
     
    2222        </changelog> 
    2323  <info>http://projects.colsolgrp.net/projects/show/endpointman</info> 
    24   <location>release/2.9/endpointman-2.9.0.3RC4.tgz</location> 
     24  <location>release/2.9/endpointman-2.9.0.3RC2.tgz</location> 
    2525 
    26 <md5sum>05062b33d72877058e3a058974ebf1bb</md5sum> 
     26<md5sum>f4aed8221b1398a65438454786ce8089</md5sum> 
    2727</module> 
  • modules/branches/2.9/endpointman/templates/freepbx/brand_model_manager.html

    r11086 r11318  
    2222--> 
    2323</style> 
     24<script type="text/javascript" charset="utf-8"> 
     25    function check() { 
     26        $('#spinner').toggle(); 
     27        document.check.submit(); 
     28    } 
     29</script> 
    2430<center> 
    25 <form action='config.php{$web_var}&display=epm_config' method='POST'> 
    26   <input type="submit" name="button_check_for_updates" value="<?=_('Check for Updates')?>">  
     31<form id='check' action='config.php{$web_var}&display=epm_config' method='POST'> 
     32  <input type="submit" name="button_check_for_updates" onclick="check();" value="<?=_('Check for Updates')?>"> 
    2733</form> 
    2834</center> 
     
    3137 
    3238{if condition="1 == 0"} 
    33 <script type="text/javascript" src="common/jquery.jstree.js"></script> 
     39<script type="text/javascript" src="/admin/modules/endpointman/templates/javascript/jquery.jstree.js"></script> 
    3440<script type="text/javascript" class="source"> 
    3541$(function () { 
     
    109115{if condition="isset($installer)"} 
    110116<script> 
     117 
    111118function process_module_actions(actions) { 
    112   freepbx_modal_show('moduleBox'); 
     119        if ($.browser.msie) { 
     120            //This is so ugly & it doesn't even really work right, but if I don't do this then the modal box will display offscreen 
     121            freepbx_modal_show('moduleBox'); 
     122            var cssObj = { 
     123                'top': '40%', 
     124                'left': '40%', 
     125                'background-color':'#ff9933' 
     126            } 
     127            $('#moduleBox').css(cssObj); 
     128 
     129            var cssObj = { 
     130                'width':'420px', 
     131                'height':'400px', 
     132                'border':'0', 
     133                'padding': '0em 1em 0em 1em', 
     134            } 
     135            $('#moduleBox iframe').css(cssObj); 
     136 
     137        } else { 
     138            freepbx_modal_show('moduleBox'); 
     139        } 
    113140  urlStr = "config.php?display=epm_config&amp;quietmode=1&amp;handler=file&amp;file=installer.html.php&amp;module=endpointman&amp;type={$installer.type}&amp;id={$installer.id}"; 
    114141  urlStr += "&amp;rand="+Math.random ( ); 
     
    127154process_module_actions(); 
    128155</script> 
    129  
    130156<div id="moduleBox" style="display:none;"></div>  
    131  
    132157{/if} 
    133158{if condition="1 == 1"} 
  • modules/branches/2.9/endpointman/templates/freepbx/devices_manager.html

    r11086 r11318  
    1010    } 
    1111    function submit_go() { 
     12        $('#spinner').toggle(); 
    1213        $('#go').append('<input type="hidden" name="sub_type" value="go"/>'); 
    1314        document.go.submit(); 
     
    5960<center> 
    6061    {if condition="$no_add == FALSE"} 
    61     <form id='go' action='config.php{$web_var}&display=epm_devices' method='POST'> 
     62    <form id='go' action='config.php?type=tool&display=epm_devices' method='POST'> 
    6263        <label><?=_('Search for new devices in netmask')?> 
    6364            <input name="netmask" type="text" value="{$srvip}/24"> 
    64             <input type="Submit" name="button_go" onclick="submit_go();" value="<?=_('Go')?>"> 
     65            <input type="Submit" name="button_go" id="button_go" onclick="submit_go();" value="<?=_('Go')?>"> 
    6566        </label> 
    6667        <label> 
     
    8384        <td align='center'></td> 
    8485    </tr> 
    85         <form name="adding" id="adding" action='config.php{$web_var}&display=epm_devices' method='POST' /> 
     86        <form name="adding" id="adding" action='config.php?type=tool&display=epm_devices' method='POST' /> 
    8687 
    8788  {if condition="$no_add == FALSE"} 
     
    126127                {/loop} 
    127128            </select> 
    128             <a href="#" onclick="return popitup('config.php?display=epm_config&amp;quietmode=1&amp;handler=file&amp;file=popup.html.php&amp;module=endpointman&amp;pop_type=edit_template&amp;edit_id={$edit_id}', 'Template Editor')"><img src='images/edit.png' title="Edit Template Selected on the Left"></a></div> 
     129            <a href="#" onclick="return popitup('config.php?display=epm_config&amp;quietmode=1&amp;handler=file&amp;file=popup.html.php&amp;module=endpointman&amp;pop_type=edit_template&amp;edit_id={$edit_id}', 'Template Editor')"><img src='assets/endpointman/images/edit.png' title="Edit Template Selected on the Left" border="0"></a></div> 
    129130        </label></td> 
    130131    <td align='center'> 
     
    162163    </td> 
    163164    <td align='center'></td> 
    164     <td align='center'>{if condition="!isset($disabled_delete_line)"}<div id="demo"><a href="#" onclick="submit_wtype_sub('edit',{$value.luid},'delete');"><img src="images/delete.png" title="Delete Line from Device to the Left"></div>{/if}</a></td> 
     165    <td align='center'>{if condition="!isset($disabled_delete_line)"}<div id="demo"><a href="#" onclick="submit_wtype_sub('edit',{$value.luid},'delete');"><img src="assets/endpointman/images/delete.png" title="Delete Line from Device to the Left"></div>{/if}</a></td> 
    165166    <td align='center'></td> 
    166167</tr> 
     
    201202    <td align='center'>&nbsp;</td> 
    202203    <td align='center'></td> 
    203     <td align='center'><div id="demo"><a href="#" onclick="submit_wtype_sub('edit',{$edit_id},'add_line_x');"><img src="images/add.png" alt="Add Line" border="0" width="24" height="24" title="Add a Line to the device currently being edited"></a></div></td> 
     204    <td align='center'><div id="demo"><a href="#" onclick="submit_wtype_sub('edit',{$edit_id},'add_line_x');"><img src="assets/endpointman/images/add.png" alt="Add Line" border="0" width="24" height="24" title="Add a Line to the device currently being edited"></a></div></td> 
    204205    <td align='center'></td> 
    205206</tr>  
     
    213214    <td align='center'>&nbsp;</td> 
    214215    <td align='center'></td> 
    215     <td align='center'><a href="#" onclick="add_line();"><img src="images/add.png" alt="Add Line" border="0" width="24" height="24"></a></td> 
     216    <td align='center'><a href="#" onclick="add_line();"><img src="assets/endpointman/images/add.png" alt="Add Line" border="0" width="24" height="24"></a></td> 
    216217    <td align='center'></td> 
    217218</tr> 
     
    303304        <td align='center'><h3>Delete</h3></td> 
    304305    </tr> 
    305     <form id="managed" action='config.php{$web_var}&display=epm_devices' method='POST'> 
     306    <form id="managed" action='config.php?type=tool&display=epm_devices' method='POST'> 
    306307  {loop name="list"} 
    307308        <tr class="headerRow"> 
    308             <td align='center' ><div id="demo"><a><img src="images/bullet_plus.png" id="imgrowGroup{$value.master_id}" alt="" onclick="toggleDisplay(document.getElementById('devList'),'headerRow','rowGroup{$value.master_id}')" title="Click to Expand Line Information"><input type="checkbox" name="selected[]" value="{$value.id}"></a></div></td> 
     309            <td align='center' ><div id="demo"><a><img src="assets/endpointman/images/bullet_plus.png" id="imgrowGroup{$value.master_id}" alt="" onclick="toggleDisplay(document.getElementById('devList'),'headerRow','rowGroup{$value.master_id}')" title="Click to Expand Line Information"><input type="checkbox" name="selected[]" value="{$value.id}"></a></div></td> 
    309310            <td align='center' width='11%'>{$value.mac}</td> 
    310311            <td width="13%" align='center'>{$value.name}</td> 
    311312            <td width="14%" align='center'>{$value.model}</td> 
    312             <td width="10%" align='center'><div id="demo"><a><img src="images/expand.png" id="img2rowGroup{$value.master_id}" onclick="toggleDisplay(document.getElementById('devList'),'headerRow','rowGroup{$value.master_id}')" title="Click to Expand Line Information"></a></div></td> 
    313             <td width="19%" align='center'><div id="demo"><a><img src="images/expand.png" id="img3rowGroup{$value.master_id}" onclick="toggleDisplay(document.getElementById('devList'),'headerRow','rowGroup{$value.master_id}')" title="Click to Expand Line Information"></a></div></td> 
     313            <td width="10%" align='center'><div id="demo"><a><img src="assets/endpointman/images/expand.png" id="img2rowGroup{$value.master_id}" onclick="toggleDisplay(document.getElementById('devList'),'headerRow','rowGroup{$value.master_id}')" title="Click to Expand Line Information"></a></div></td> 
     314            <td width="19%" align='center'><div id="demo"><a><img src="assets/endpointman/images/expand.png" id="img3rowGroup{$value.master_id}" onclick="toggleDisplay(document.getElementById('devList'),'headerRow','rowGroup{$value.master_id}')" title="Click to Expand Line Information"></a></div></td> 
    314315            <td align='center' width='15%'>{$value.template_name}</td> 
    315             <td align='center' width='9%'><div id="demo"><a href="#" onclick="submit_wtype('edit',{$value.id});"><img src='images/edit.png' ALT='<?=_('Edit')?>' title='Edit Device' border='0'></a></div></td> 
    316             <td align='center' width='7%'><div id="demo"><a href="#" onclick="delete_device({$value.id});"><img src='images/delete.png' ALT='<?=_('Delete')?>' title='Delete Device' border='0'></a></div></td> 
     316            <td align='center' width='9%'><div id="demo"><a href="#" onclick="submit_wtype('edit',{$value.id});"><img src='assets/endpointman/images/edit.png' ALT='<?=_('Edit')?>' title='Edit Device' border='0'></a></div></td> 
     317            <td align='center' width='7%'><div id="demo"><a href="#" onclick="delete_device({$value.id});"><img src='assets/endpointman/images/delete.png' ALT='<?=_('Delete')?>' title='Delete Device' border='0'></a></div></td> 
    317318        </tr> 
    318319        {loop name="value.line"} 
     
    326327            <td align='center' width='15%'></td> 
    327328            <td align='center' width='9%'></td> 
    328             <td align='center' width='7%'><div id="demo"><a href="#" onclick="submit_wtype('delete_line',{$value.luid});"><img src='images/delete.png' ALT='<?=_('Delete')?>' title='Delete Line' border='0'></a></div></td> 
     329            <td align='center' width='7%'><div id="demo"><a href="#" onclick="submit_wtype('delete_line',{$value.luid});"><img src='assets/endpointman/images/delete.png' ALT='<?=_('Delete')?>' title='Delete Line' border='0'></a></div></td> 
    329330        </tr> 
    330331        {/loop} 
     
    372373                        <option></option> 
    373374                    </select> 
    374                     <input type="submit" name="button_rebuild_reboot" onclick="submit_global3('rebuild_reboot');" value="<?=_('Rebuild & Reboot')?>"><br /><input type="checkbox" name="reboot" checked>Reboot Phones 
     375                    <input type="submit" name="button_rebuild_reboot" onclick="submit_global3('rebuild_reboot');" value="<?=_('Rebuild')?>"><br /><input type="checkbox" name="reboot" checked>Reboot Phones 
    375376                </label></td> 
    376377    </tr> 
  • modules/branches/2.9/endpointman/templates/freepbx/global_footer.html

    r10792 r11318  
    22<h6 align='center'>The Endpoint Configuration Manager is currently maintained by <a target="_blank" href=http://www.andrewsnagy.com/>Andrew Nagy</a> 
    33<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> 
    4 <br/>Endpoint Configuration Manager uses code from the MPL licensed project Provisioner.net at <a href="http://www.assembla.com/code/provisioner/git/nodes?rev=master">http://www.assembla.com/code/provisioner/git/nodes?rev=master</a> co-written by Darren Schreiber &amp Andrew Nagy 
     4<br/>Endpoint Configuration Manager uses code from the MPL licensed project Provisioner.net at <a href="http://provisioner.net" target="_blank">http://www.provisioner.net</a> co-written by Darren Schreiber &amp Andrew Nagy 
    55<br> <?=_("The project is maintained at")?>  
    66<a target="_blank" href="http://projects.colsolgrp.net/projects/show/endpointman"> CSG Software Projects.</a> 
  • modules/branches/2.9/endpointman/templates/freepbx/global_header.html

    r11086 r11318  
    11<html> 
    2 <head> 
    3  <title>PBX Endpoint Configuration Manager</title> 
    4         <script type="text/javascript" src="common/jquery.tools.min.js"></script> 
     2    <head> 
     3        <title>PBX Endpoint Configuration Manager</title> 
     4        <script type="text/javascript" src="assets/endpointman/js/jquery.tools.min.js"></script> 
    55        {if condition="isset($silent_mode)"} 
    6         <script type="text/javascript" src="common/jquery-1.3.2.js"></script> 
     6        <script type="text/javascript" src="assets/endpointman/js/jquery-1.3.2.min.js"></script> 
    77        <link href="common/mainstyle.css" rel="stylesheet" type="text/css" /> 
    88        {/if} 
     
    1010            .tooltip { 
    1111                display:none; 
    12                 background:transparent url('images/black_arrow.png'); 
     12                background:transparent url('assets/endpointman/images/black_arrow.png'); 
    1313                font-size:12px; 
    1414                height:70px; 
     
    1717                color:#fff; 
    1818            } 
     19            #spinner 
     20            { 
     21                display:none; 
     22                width:200px; 
     23                height: 200px; 
     24                position: fixed; 
     25                top: 40%; 
     26                left: 55%; 
     27                background:url('assets/endpointman/images/ajax-loader.gif') no-repeat center #fff; 
     28                text-align:center; 
     29                padding:10px; 
     30                font:normal 16px Tahoma, Geneva, sans-serif; 
     31                margin-left: -50px; 
     32                margin-top: -50px; 
     33                z-index:2; 
     34                overflow: auto; 
     35                background-color:#f8f8ff; 
     36                border: 1px solid #aaaaff; 
     37            } 
    1938        </style> 
    2039  {if condition="isset($template_editor_display)"} 
    21    <link href="common/coda-slider-2.0a.css" media="screen, projection" rel="stylesheet" type="text/css" /> 
     40        <link href="assets/endpointman/theme/coda-slider-2.0a.css" media="screen, projection" rel="stylesheet" type="text/css" /> 
    2241 
    23   
    24     <!-- Begin JavaScript -->  
    25      <script type="text/javascript" src="common/jquery.easing.1.3.js"></script> 
    26      <script type="text/javascript" src="common/jquery.coda-slider-2.0.js"></script> 
    27        <script type="text/javascript">  
    28              $().ready(function() { 
    29                $('#coda-slider-9').codaSlider({ 
    30            dynamicArrows: false 
    31          }); 
    32              }); 
    33            </script>  
    34    <!-- End JavaScript --> 
     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        <script type="text/javascript"> 
     47            $().ready(function() { 
     48                $('#coda-slider-9').codaSlider({ 
     49                    dynamicArrows: false 
     50                }); 
     51            }); 
     52        </script> 
     53        <!-- End JavaScript --> 
    3554  {/if} 
    36                 <!-- config.php?type=tool&amp;display=epm_config&amp;quietmode=1&amp;handler=file&amp;module=endpointman&amp;file=ajax_select.php?amp_conf --> 
     55  {if condition="isset($amp_conf_serial)"} 
     56        <script type="text/javascript" charset="utf-8"> 
     57            $(function(){ 
     58                $("select#brand_edit").change(function(){ 
     59                    $.ajaxSetup({ cache: false }); 
     60                    $.getJSON("config.php?type=tool&quietmode=1&handler=file&module=endpointman&file=ajax_select.html.php&atype=model",{id: $(this).val()}, function(j){ 
     61                        var options = ''; 
     62                        for (var i = 0; i < j.length; i++) { 
     63                            options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>'; 
     64                        } 
     65                        $("#model_new").html(options); 
     66                        $('#model_new option:first').attr('selected', 'selected'); 
     67                        $("#template_list").html('<option></option>'); 
     68                        $('#template_list option:first').attr('selected', 'selected'); 
     69                    }) 
     70                }) 
     71            }) 
     72            $(function(){ 
     73                $("select#product_select").change(function(){ 
     74                    $.ajaxSetup({ cache: false }); 
     75                    $.getJSON("config.php?type=tool&quietmode=1&handler=file&module=endpointman&file=ajax_select.html.php&atype=template",{id: $(this).val()}, function(j){ 
     76                        var options = ''; 
     77                        for (var i = 0; i < j.length; i++) { 
     78                            options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>'; 
     79                        } 
     80                        $("#template_selector").html(options); 
     81                        $('#template_selector option:first').attr('selected', 'selected'); 
     82                    }) 
     83                }) 
     84            }) 
     85            $(function(){ 
     86                $("select#model_new").change(function(){ 
     87                    $.ajaxSetup({ cache: false }); 
     88                    $.getJSON("config.php?type=tool&quietmode=1&handler=file&module=endpointman&file=ajax_select.html.php&atype=template2",{id: $(this).val()}, function(j){ 
     89                        var options = ''; 
     90                        for (var i = 0; i < j.length; i++) { 
     91                            options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>'; 
     92                        } 
     93                        $("#template_list").html(options); 
     94                        $('#template_list option:first').attr('selected', 'selected'); 
     95                    }), 
     96                    $.ajaxSetup({ cache: false }); 
     97                    $.getJSON("config.php?type=tool&quietmode=1&handler=file&module=endpointman&file=ajax_select.html.php&atype=lines",{id: $(this).val()}, function(j){ 
     98                        var options = ''; 
     99                        for (var i = 0; i < j.length; i++) { 
     100                            options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>'; 
     101                        } 
     102                        $("#line_list").html(options); 
     103                        $('#line_list option:first').attr('selected', 'selected'); 
     104                    }) 
     105                }) 
     106            }) 
    37107 
    38                  
     108            $(function(){ 
     109                $("select#brand_list_selected").change(function(){ 
     110                    $.ajaxSetup({ cache: false }); 
     111                    $.getJSON("config.php?type=tool&quietmode=1&handler=file&module=endpointman&file=ajax_select.html.php&atype=model",{id: $(this).val()}, function(j){ 
     112                        var options = ''; 
     113                        for (var i = 0; i < j.length; i++) { 
     114                            options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>'; 
     115                        } 
     116                        $("#model_list_selected").html(options); 
     117                        $('#model_list_selected option:first').attr('selected', 'selected'); 
     118                    }) 
     119                }) 
     120            }) 
     121            $(function(){ 
     122                $("select#model_class").change(function(){ 
     123                    $.ajaxSetup({ cache: false }); 
     124                    $.getJSON("config.php?type=tool&quietmode=1&handler=file&module=endpointman&file=ajax_select.html.php&atype=model_clone",{id: $(this).val()}, function(j){ 
     125                        var options = ''; 
     126                        for (var i = 0; i < j.length; i++) { 
     127                            options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>'; 
     128                        } 
     129                        $("#model_clone").html(options); 
     130                        $('#model_clone option:first').attr('selected', 'selected'); 
     131                    }) 
     132                }) 
     133            }) 
    39134 
    40   {if condition="isset($amp_conf_serial)"} 
    41     <script type="text/javascript" charset="utf-8">  
    42     $(function(){ 
    43       $("select#brand_edit").change(function(){ 
    44                                 $.ajaxSetup({ cache: false }); 
    45         $.getJSON("config.php?type=tool&quietmode=1&handler=file&module=endpointman&file=ajax_select.html.php&atype=model",{id: $(this).val()}, function(j){ 
    46           var options = ''; 
    47           for (var i = 0; i < j.length; i++) { 
    48             options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>'; 
    49           } 
    50           $("#model_new").html(options); 
    51           $('#model_new option:first').attr('selected', 'selected'); 
    52           $("#template_list").html('<option></option>'); 
    53           $('#template_list option:first').attr('selected', 'selected'); 
    54         }) 
    55       })       
    56     }) 
    57     $(function(){ 
    58       $("select#product_select").change(function(){ 
    59         $.ajaxSetup({ cache: false }); 
    60                                 $.getJSON("config.php?type=tool&quietmode=1&handler=file&module=endpointman&file=ajax_select.html.php&atype=template",{id: $(this).val()}, function(j){ 
    61           var options = ''; 
    62           for (var i = 0; i < j.length; i++) { 
    63             options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>'; 
    64           } 
    65           $("#template_selector").html(options); 
    66           $('#template_selector option:first').attr('selected', 'selected'); 
    67         }) 
    68       })       
    69     }) 
    70     $(function(){ 
    71       $("select#model_new").change(function(){ 
    72         $.ajaxSetup({ cache: false }); 
    73                                 $.getJSON("config.php?type=tool&quietmode=1&handler=file&module=endpointman&file=ajax_select.html.php&atype=template2",{id: $(this).val()}, function(j){ 
    74           var options = ''; 
    75           for (var i = 0; i < j.length; i++) { 
    76             options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>'; 
    77           } 
    78           $("#template_list").html(options); 
    79           $('#template_list option:first').attr('selected', 'selected'); 
    80         }), 
    81                                 $.ajaxSetup({ cache: false }); 
    82                                 $.getJSON("config.php?type=tool&quietmode=1&handler=file&module=endpointman&file=ajax_select.html.php&atype=lines",{id: $(this).val()}, function(j){ 
    83                                         var options = ''; 
    84                                         for (var i = 0; i < j.length; i++) { 
    85                                                 options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>'; 
    86                                         } 
    87                                         $("#line_list").html(options); 
    88                                         $('#line_list option:first').attr('selected', 'selected'); 
    89                                 }) 
    90       })       
    91     }) 
    92  
    93     $(function(){ 
    94       $("select#brand_list_selected").change(function(){ 
    95         $.ajaxSetup({ cache: false }); 
    96                                 $.getJSON("config.php?type=tool&quietmode=1&handler=file&module=endpointman&file=ajax_select.html.php&atype=model",{id: $(this).val()}, function(j){ 
    97           var options = ''; 
    98           for (var i = 0; i < j.length; i++) { 
    99             options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>'; 
    100           } 
    101           $("#model_list_selected").html(options); 
    102           $('#model_list_selected option:first').attr('selected', 'selected'); 
    103         }) 
    104       })       
    105     }) 
    106                 $(function(){ 
    107                         $("select#model_class").change(function(){ 
    108                                 $.ajaxSetup({ cache: false }); 
    109                                 $.getJSON("config.php?type=tool&quietmode=1&handler=file&module=endpointman&file=ajax_select.html.php&atype=model_clone",{id: $(this).val()}, function(j){ 
    110                                         var options = ''; 
    111                                         for (var i = 0; i < j.length; i++) { 
    112                                                 options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>'; 
    113                                         } 
    114                                         $("#model_clone").html(options); 
    115                                         $('#model_clone option:first').attr('selected', 'selected'); 
    116                                 }) 
    117                         }) 
    118                 }) 
    119                  
    120                 function toggleDisplay(tbl, tblClass, rowClass) { 
    121                     var tblRows = tbl.rows; 
    122                     for (i = 0; i < tblRows.length; i++) { 
    123                         if ((tblRows[i].className != tblClass) && (tblRows[i].className == rowClass)) { 
    124                             if( tblRows[i].style.display=='none' ){ 
    125                                 tblRows[i].style.display = ''; 
    126                                 document.getElementById("img"+rowClass).src= 'images/bullet_minus.png'; 
    127                                 document.getElementById("img2"+rowClass).src= 'images/collapse.png'; 
    128                                 document.getElementById("img3"+rowClass).src= 'images/collapse.png'; 
    129                             }else{ 
    130                                 tblRows[i].style.display = 'none'; 
    131                                 document.getElementById("img"+rowClass).src= 'images/bullet_plus.png'; 
    132                                 document.getElementById("img2"+rowClass).src= 'images/expand.png'; 
    133                                 document.getElementById("img3"+rowClass).src= 'images/expand.png'; 
    134                             } 
    135                         } 
    136                     } 
     135            function toggleDisplay(tbl, tblClass, rowClass) { 
     136                if($("#img"+rowClass).attr("src") == 'assets/endpointman/images/bullet_plus.png') { 
     137                    $("#img"+rowClass).attr("src", "assets/endpointman/images/bullet_minus.png"); 
     138                    $("#img2"+rowClass).attr("src", "assets/endpointman/images/collapse.png"); 
     139                    $("#img3"+rowClass).attr("src", "assets/endpointman/images/collapse.png"); 
     140                    $('.'+rowClass).show(); 
     141                } else { 
     142                    $("#img"+rowClass).attr("src", "assets/endpointman/images/bullet_plus.png"); 
     143                    $("#img2"+rowClass).attr("src", "assets/endpointman/images/expand.png"); 
     144                    $("#img3"+rowClass).attr("src", "assets/endpointman/images/expand.png"); 
     145                    $('.'+rowClass).hide(); 
    137146                } 
    138     </script> 
     147            } 
     148             
     149        </script> 
    139150  {/if} 
    140 </head> 
    141 <body face="Arial"> 
    142 <br> 
    143 <h1><face="Arial"><center><?=_('End Point Configuration Manager')?></center></h1> 
    144 <hr> 
     151    </head> 
     152    <body face="Arial"> 
     153        <div id="spinner"> 
     154        </div> 
     155        <br> 
     156        <h1><face="Arial"><center><?=_('End Point Configuration Manager')?></center></h1> 
     157        <hr> 
  • modules/branches/2.9/endpointman/templates/freepbx/template_editor.html

    r11086 r11318  
    22<html> 
    33    <head> 
    4         <link href="/recordings/theme/coda-slider-2.0a.css" rel="stylesheet" type="text/css" /> 
     4        <link href="theme/coda-slider-2.0a.css" rel="stylesheet" type="text/css" /> 
    55        <!-- Begin JavaScript --> 
    6         <script type="text/javascript" src="/recordings/theme/js/jquery.easing.1.3.js"></script> 
    7         <script type="text/javascript" src="/recordings/theme/js/jquery.coda-slider-2.0.js"></script> 
     6        <script type="text/javascript" src="theme/js/jquery.easing.1.3.js"></script> 
     7        <script type="text/javascript" src="theme/js/jquery.coda-slider-2.0.js"></script> 
    88        <script type="text/javascript"> 
    99            $().ready(function() { 
     
    1717    <body> 
    1818{else} 
    19 <script type="text/javascript" src="common/jquery.tooltip.v.1.1.js"></script> 
    20 <script type="text/javascript" src="common/jquery.tooltip.execute.js"></script> 
     19<script type="text/javascript" src="assets/endpointman/js/jquery.tooltip.v.1.1.js"></script> 
     20<script type="text/javascript" src="assets/endpointman/js/jquery.tooltip.execute.js"></script> 
     21<link href="assets/endpointman/theme/simpletooltip.css" rel="stylesheet" type="text/css" /> 
    2122<script language="javascript" type="text/javascript"> 
    2223        function popitup(url, name) { 
     
    3637        <strong><?=_('Clone of Model')?>:</strong> {$model}<br /> 
    3738        <strong><?=_('Display')?></strong> 
    38         <select name="area_list" onchange="window.location.href='config.php?edit_template=true&display=epm_templates&custom='+ document.getElementById('custom').value +'&id='+ document.getElementById('id').value +'&maxlines='+this.options[this.selectedIndex].value"> 
     39        <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"> 
    3940        {loop name="area_ava"} 
    4041        <option value="{$value.value}" {if condition="!empty($value.selected)"}selected{/if}>{$value.text}</option> 
     
    4344        <strong><?=_('Lines')?></strong> 
    4445  {/if} 
    45         <form action="config.php?display=epm_templates" method="post"> 
     46        <form action="config.php?type=tool&display=epm_templates" method="post"> 
    4647        {if condition="isset($silent_mode)"} 
    4748        <input name="silent_mode" id="silent_mode" type="hidden" value="1"> 
     
    5758        </select><br/> 
    5859        <strong><?=_('Display')?></strong> 
    59         <select name="area_list" onchange="window.location.href='config.php?edit_template=true&display=epm_templates&custom='+ document.getElementById('custom').value +'&id='+ document.getElementById('id').value +'&maxlines='+this.options[this.selectedIndex].value"> 
     60        <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"> 
    6061        {loop name="area_ava"} 
    6162        <option value="{$value.value}" {if condition="!empty($value.selected)"}selected{/if}>{$value.text}</option> 
     
    7576            {/loop} 
    7677            </select> 
    77             <a href="#" onclick="return popitup('config.php?display=epm_config&amp;quietmode=1&amp;handler=file&amp;file=popup.html.php&amp;module=endpointman&amp;pop_type=alt_cfg_edit', '{$value.name}')"><img src='{$web_path}templates/images/edit.png' ALT='<?=_('Edit')?>' border='0'></a> 
     78            <a href="#" onclick="return popitup('config.php?type=tool&display=epm_config&amp;quietmode=1&amp;handler=file&amp;file=popup.html.php&amp;module=endpointman&amp;pop_type=alt_cfg_edit', '{$value.name}')"><img src='assets/endpointman/images/edit.png' ALT='<?=_('Edit')?>' border='0'></a> 
    7879            <br/> 
    7980        {/loop} 
     
    8283        {loop name="only_configs"} 
    8384            <strong><?=_('Edit File Configurations for:')?></strong> {$value.name} 
    84             <a href="#" onclick="return popitup2('config.php?display=epm_config&amp;quietmode=1&amp;handler=file&amp;file=popup.html.php&amp;module=endpointman&amp;pop_type=alt_cfg_edit', '{$value.name}')"><img src='{$web_path}templates/images/edit.png' ALT='<?=_('Edit')?>' border='0'></a> 
     85            <a href="#" onclick="return popitup2('config.php?type=tool&display=epm_config&amp;quietmode=1&amp;handler=file&amp;file=popup.html.php&amp;module=endpointman&amp;pop_type=alt_cfg_edit', '{$value.name}')"><img src='assets/endpointman/images/edit.png' ALT='<?=_('Edit')?>' border='0'></a> 
    8586            <br/> 
    8687        {/loop} 
  • modules/branches/2.9/endpointman/templates/freepbx/template_manager.html

    r11086 r11318  
    4242    <td>{$value.model_clone}</td> 
    4343 
    44   <td align='center' width='9%'><a href="config.php?edit_template=true&display=epm_templates&custom={$value.custom}&id={$value.id}"><img src='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> 
    4545  <td align='center' width='5%'>{if condition="$value.custom == 0"} 
    46   <a href="config.php?delete_template=true&display=epm_templates&id={$value.id}"><img src='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> 
    4747  </tr> 
    4848{/loop} 
  • modules/branches/2.9/endpointman/uninstall.php

    r11086 r11318  
    1616 
    1717if (! function_exists("out")) { 
    18  function out($text) { 
    19    echo $text."<br />"; 
    20 
     18    function out($text) { 
     19        echo $text."<br />"; 
     20   
    2121} 
    2222 
    2323if (! function_exists("outn")) { 
    24  function outn($text) { 
    25    echo $text; 
    26 
     24    function outn($text) { 
     25        echo $text; 
     26   
    2727} 
    2828 
     
    6262$result = $db->query($sql); 
    6363 
    64 out("Removing ARI Module");    
    65 unlink($amp_conf['AMPWEBROOT']."/recordings/modules/phonesettings.module"); 
     64$sql = 'SELECT value FROM `admin` WHERE `variable` LIKE CONVERT(_utf8 \'version\' USING latin1) COLLATE latin1_swedish_ci'; 
     65$amp_version = $db->getOne($sql); 
    6666 
    67 unlink($amp_conf['AMPWEBROOT']."/recordings/theme/js/jquery.coda-slider-2.0.js"); 
     67//Do unlinks ourself because retrieve_conf doesn't always remove stuff... 
    6868 
    69 unlink($amp_conf['AMPWEBROOT']."/recordings/theme/js/jquery.easing.1.3.js"); 
     69//images 
     70$dir = $amp_conf['AMPWEBROOT'].'/admin/assets/endpointman/images'; 
     71foreach (glob(LOCAL_PATH."assets/images/*.*") as $filename) { 
     72    if(file_exists($dir.'/'.basename($filename)) && (readlink($dir.'/'.basename($filename)) == $filename)) { 
     73        unlink($dir.'/'.basename($filename)); 
     74    } 
     75
     76if(is_link($dir)) { 
     77    unlink($dir); 
     78
    7079 
    71 unlink($amp_conf['AMPWEBROOT']."/recordings/theme/coda-slider-2.0a.css"); 
    7280 
    73 out("Removing Symbolic Links for Images"); 
    74 foreach (glob(LOCAL_PATH."templates/images/*.*") as $filename) { 
    75     //echo "$filename size " . filesize($filename) . "<br />"; 
    76     $newloc = str_replace(stristr($filename, 'admin/'), '', $filename) . "admin/images/".basename($filename); 
    77     //echo "\t". $newloc ."<br />"; 
    78     if((file_exists($newloc)) && (is_link($newloc))) { 
    79         unlink($newloc); 
     81//javascripts 
     82$dir = $amp_conf['AMPWEBROOT'].'/admin/assets/endpointman/js'; 
     83foreach (glob(LOCAL_PATH."assets/js/*.*") as $filename) { 
     84    if(file_exists($dir.'/'.basename($filename)) && (readlink($dir.'/'.basename($filename)) == $filename)) { 
     85        unlink($dir.'/'.basename($filename)); 
     86    } 
     87
     88if(is_link($dir)) { 
     89    unlink($dir); 
     90
     91 
     92//theme 
     93$dir = $amp_conf['AMPWEBROOT'].'/admin/assets/endpointman/theme'; 
     94foreach (glob(LOCAL_PATH."assets/theme/*.*") as $filename) { 
     95    if(file_exists($dir.'/'.basename($filename)) && (readlink($dir.'/'.basename($filename)) == $filename)) { 
     96        unlink($dir.'/'.basename($filename)); 
     97    } 
     98
     99if(is_link($dir)) { 
     100    unlink($dir); 
     101
     102 
     103//ari-modules 
     104$dir = $amp_conf['AMPWEBROOT'].'/recordings/modules'; 
     105foreach (glob(LOCAL_PATH."ari/modules/*.*") as $filename) { 
     106    if(file_exists($dir.'/'.basename($filename)) && (readlink($dir.'/'.basename($filename)) == $filename)) { 
     107        unlink($dir.'/'.basename($filename)); 
    80108    } 
    81109} 
    82110 
    83 out("Removing Symbolic Links for Javascripts"); 
    84 foreach (glob(LOCAL_PATH."templates/freepbx/javascript/*.*") as $filename) { 
    85     //echo "$filename size " . filesize($filename) . "<br />"; 
    86     $newloc = str_replace(stristr($filename, 'admin/'), '', $filename) . "admin/common/".basename($filename); 
    87     //echo "\t". $newloc ."<br />"; 
    88     if((file_exists($newloc)) && (is_link($newloc))) { 
    89         unlink($newloc); 
     111//ari-images 
     112$dir = $amp_conf['AMPWEBROOT'].'/recordings/theme/images'; 
     113foreach (glob(LOCAL_PATH."ari/images/*.*") as $filename) { 
     114    if(file_exists($dir.'/'.basename($filename)) && (readlink($dir.'/'.basename($filename)) == $filename)) { 
     115        unlink($dir.'/'.basename($filename)); 
    90116    } 
    91117} 
    92118 
    93 out("Removing Symbolic Links for Stylesheets"); 
    94 foreach (glob(LOCAL_PATH."templates/freepbx/stylesheets/*.*") as $filename) { 
    95     //echo "$filename size " . filesize($filename) . "<br />"; 
    96     $newloc = str_replace(stristr($filename, 'admin/'), '', $filename) . "admin/common/".basename($filename); 
    97     //echo "\t". $newloc ."<br />"; 
    98     if((file_exists($newloc)) && (is_link($newloc))) { 
    99         unlink($newloc); 
     119//ari-js 
     120$dir = $amp_conf['AMPWEBROOT'].'/recordings/theme/js'; 
     121foreach (glob(LOCAL_PATH."ari/js/*.*") as $filename) { 
     122    if(file_exists($dir.'/'.basename($filename)) && (readlink($dir.'/'.basename($filename)) == $filename)) { 
     123        unlink($dir.'/'.basename($filename)); 
    100124    } 
    101125} 
     126 
     127//ari-theme 
     128$dir = $amp_conf['AMPWEBROOT'].'/recordings/theme'; 
     129foreach (glob(LOCAL_PATH."ari/theme/*.*") as $filename) { 
     130    if(file_exists($dir.'/'.basename($filename)) && (readlink($dir.'/'.basename($filename)) == $filename)) { 
     131        unlink($dir.'/'.basename($filename)); 
     132    } 
     133} 
     134if(!is_link($amp_conf['AMPWEBROOT'].'/admin/assets/endpointman')) { 
     135    $endpoint->rmrf($amp_conf['AMPWEBROOT'].'/admin/assets/endpointman'); 
     136}