Changeset 11816

Show
Ignore:
Timestamp:
03/15/11 03:52:52 (2 years ago)
Author:
tm1000
Message:

Updates Endpoint Manager to RC9

Files:

Legend:

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

    r11801 r11816  
    108108                            if(($lines_list) AND (isset($model)) AND (isset($line)) AND (!isset($delete)) AND (isset($temp))) { 
    109109                                //Modifying line already in the database 
    110                                 $sql = "UPDATE endpointman_line_list SET line = ".$lines_list['line'].", description =  '".$name."' WHERE  luid =" . $lines_list['luid']; 
    111                                 $endpoint->db->query($sql); 
    112  
    113                                 $sql = "UPDATE  endpointman_mac_list SET model = ".$model.", template_id =  ".$temp." WHERE id = ".$macid; 
    114                                 $endpoint->db->query($sql); 
     110                                $endpoint->update_device($macid, $model, $temp, $lines_list['luid'],$name,$lines_list['line']); 
    115111 
    116112                                $row = $endpoint->get_phone_info($macid); 
     
    122118                            } elseif((isset($model)) AND (!isset($delete)) AND (isset($line)) AND (isset($temp))) { 
    123119                                //Add line to the database 
    124                                 $sql = "INSERT INTO endpointman_line_list (mac_id, line, ext, description) VALUES (".$macid.",  ".$line.",  ".$extdisplay.",  '".$name."')"; 
    125                                 $endpoint->db->query($sql); 
    126  
    127                                 $sql = "UPDATE  endpointman_mac_list SET model = ".$model.", template_id =  ".$temp." WHERE id = ".$macid; 
    128                                 $endpoint->db->query($sql); 
     120 
     121                                if(empty($line)) { 
     122                                    $endpoint->add_line($macid, NULL, $extdisplay, $name); 
     123                                } else { 
     124                                   $endpoint->add_line($macid, $line, $extdisplay, $name); 
     125                                } 
     126                                 
     127                                $endpoint->update_device($macid, $model, $temp, NULL, NULL, NULL, FALSE); 
    129128 
    130129                                $row = $endpoint->get_phone_info($macid); 
  • modules/branches/2.9/endpointman/includes/advanced.inc

    r11618 r11816  
    77 * @package Provisioner 
    88 */ 
    9  
    10 //Set the message variable to nothing, however we can set it later and it will show up on the page 
    11 $message = NULL; 
    12 $error_message = NULL; 
    13 $endpoint->tpl->assign("message", $message); 
    14 $endpoint->tpl->assign("web_vars", "?type=$type"); 
    15  
    169echo $endpoint->tpl->draw( 'global_header' ); 
    1710if(!isset($_REQUEST['subpage'])) { 
     
    3427                if ($file['tmp_name'] > '') { 
    3528                    if (!in_array(end(explode(".", strtolower($file['name']))), $allowedExtensions)) { 
    36                         $endpoint->tpl->assign("message", "We support only CVS and TXT files")
     29                        $endpoint->message['iedl'] =  "We support only CVS and TXT files"
    3730                    } else { 
    3831                        $uploaddir = LOCAL_PATH; 
     
    7164                                                    $ext = $ext['extension']; 
    7265 
    73                                                     $sql_mac = "SELECT id FROM endpointman_mac_list WHERE mac = '".$mac."'"; 
    74                                                     $res_mac =& $endpoint->db->query($sql_mac); 
    75                                                     if($res_mac->numRows()) { 
    76                                                         $ext_id = $endpoint->db->getOne($sql_mac); 
    77                                                     } else { 
    78                                                         $sql = "INSERT INTO  endpointman_mac_list (mac, model) VALUES ('".$mac."','".$model_id."')"; 
    79                                                         $endpoint->db->query($sql); 
    80  
    81                                                         $sql = 'SELECT last_insert_id()'; 
    82                                                         $ext_id =& $endpoint->db->getOne($sql); 
    83                                                     } 
    84  
    85                                                     $sql = "INSERT INTO `endpointman_line_list` (`mac_id`, `ext`, `line`, `description`) VALUES ('".$ext_id."', '".$ext."', '".$line_id."','".$description."')"; 
    86                                                     $endpoint->db->query($sql); 
    87  
    88                                                     $message .= "Inserted Mac Address: ".$mac." & Line: ".$line_id."<br/>"; 
     66                                                    $endpoint->add_device($mac,$model_id,$ext,0,$line_id,$description); 
    8967                                                } else { 
    90                                                     $endpoint->error['csv_upload'] = 'Invalid Extension Specified'
     68                                                    $endpoint->error['csv_upload'] .= "Invalid Extension Specified on line ". $i. "<br />"
    9169                                                } 
    9270                                            } else { 
    93                                                 $endpoint->error['csv_upload'] = 'Invalid Model Specified'
     71                                                $endpoint->error['csv_upload'] .= "Invalid Model Specified on line ". $i. "<br />"
    9472                                            } 
    9573                                        } else { 
    96                                             $endpoint->error['csv_upload'] = 'Invalid Brand Specified'
     74                                            $endpoint->error['csv_upload'] .= "Invalid Brand Specified on line ". $i. "<br />"
    9775                                        } 
    9876                                    } else { 
    99                                         $endpoint->error['csv_upload'] = "Invalid Mac on line ". $i. "<br />"; 
     77                                        $endpoint->error['csv_upload'] .= "Invalid Mac on line ". $i. "<br />"; 
    10078                                    } 
    10179                                } 
     
    10482                            fclose($handle); 
    10583                            unlink(LOCAL_PATH.$_FILES['import_csv']['name']); 
    106                             $message .= "Please reboot & rebuild all imported phones<br />"; 
     84                            $endpoint->message['file_upload'] = "Please reboot & rebuild all imported phones<br />"; 
    10785                        } else { 
    108                             $this->error['file_upload'] = "Possible file upload attack!"; 
     86                            $endpoint->error['file_upload'] = "Possible file upload attack!"; 
    10987 
    11088                        } 
     
    11290                } 
    11391            } 
    114         } 
    115         $error_message = NULL; 
    116         foreach($endpoint->error as $key => $error) { 
    117             $error_message .= $error; 
    118             if($endpoint->global_cfg['debug']) { 
    119                 $error_message .= " Function: [".$key."]"; 
    120             } 
    121             $error_message .= "<br />"; 
    122         } 
    123         if(isset($message)) { 
    124             $endpoint->display_message_box($message,$endpoint->tpl,0); 
    125         } 
    126         if(isset($error_message)) { 
    127             $endpoint->display_message_box($error_message,$endpoint->tpl,1); 
    128         } 
     92        } elseif(isset($_REQUEST['action'])) { 
     93            $endpoint->error['iedl'] = "No File uploaded"; 
     94        } 
     95        $endpoint->prepare_message_box(); 
    12996        echo $endpoint->tpl->draw( 'advanced_settings_iedl' ); 
    13097        break; 
     
    185152                $endpoint->tpl->assign("package", $files_list[0]); 
    186153                $endpoint->tpl->assign("type", "upload_brand"); 
    187             } else { 
    188                 $message = $error_message; 
    189             } 
    190  
    191         } 
    192         $error_message = NULL; 
    193         foreach($endpoint->error as $key => $error) { 
    194             $error_message .= $error; 
    195             if($endpoint->global_cfg['debug']) { 
    196                 $error_message .= " Function: [".$key."]"; 
    197             } 
    198             $error_message .= "<br />"; 
    199         } 
    200         if(isset($message)) { 
    201             $endpoint->display_message_box($message,$endpoint->tpl,0); 
    202         } 
    203         if(isset($error_message)) { 
    204             $endpoint->display_message_box($error_message,$endpoint->tpl,1); 
    205         } 
    206  
     154            }  
     155        } 
     156        $endpoint->prepare_message_box(); 
    207157        echo $endpoint->tpl->draw( 'advanced_settings_manual_upload' ); 
    208158        break; 
     
    253203        } 
    254204        $endpoint->tpl->assign("brand2_list", $row_out); 
     205        $endpoint->prepare_message_box(); 
    255206        echo $endpoint->tpl->draw( 'advanced_settings_sh_manager' ); 
    256207        break; 
     
    259210            $sql = "INSERT INTO  endpointman_oui_list (oui, brand, custom) VALUES ('".$_REQUEST['oui']."',  '".$_REQUEST['rb_brand']."',  '1')"; 
    260211            $endpoint->db->query($sql); 
     212            $endpoint->message['oui_manager'] = "Added!"; 
     213        } elseif(isset($_REQUEST['oui_sub'])) { 
     214            $endpoint->error['oui_manager'] = "No OUI Set!"; 
    261215        } 
    262216        if((isset($_REQUEST['delete'])) AND ($_REQUEST['id'] > 0)) { 
    263217            $sql = "DELETE FROM endpointman_oui_list WHERE id = ". $_REQUEST['id']; 
    264218            $endpoint->db->query($sql); 
     219            $endpoint->message['oui_manager'] = "Deleted!"; 
    265220        } 
    266221        $sql = 'SELECT endpointman_oui_list.id, endpointman_oui_list.oui , endpointman_brand_list.name FROM endpointman_oui_list , endpointman_brand_list WHERE endpointman_oui_list.brand = endpointman_brand_list.id AND endpointman_oui_list.custom = 0'; 
     
    283238        $endpoint->tpl->assign("oui_list_custom", $row_out_custom); 
    284239        $endpoint->tpl->assign("brand_ava", $endpoint->brands_available()); 
    285  
    286         $error_message = NULL; 
    287         foreach($endpoint->error as $key => $error) { 
    288             $error_message .= $error; 
    289             if($endpoint->global_cfg['debug']) { 
    290                 $error_message .= " Function: [".$key."]"; 
    291             } 
    292             $error_message .= "<br />"; 
    293         } 
    294         if(isset($message)) { 
    295             $endpoint->display_message_box($message,$endpoint->tpl,0); 
    296         } 
    297         if(isset($error_message)) { 
    298             $endpoint->display_message_box($error_message,$endpoint->tpl,1); 
    299         } 
    300  
     240        $endpoint->prepare_message_box(); 
    301241        echo $endpoint->tpl->draw( 'advanced_settings_oui' ); 
    302242        break; 
     
    316256            $sql = "DELETE FROM endpointman_custom_configs WHERE id =". $_REQUEST['sql']; 
    317257            $endpoint->db->query($sql); 
    318             $message = "Deleted!"; 
     258            $endpoint->message['poce'] = "Deleted!"; 
    319259        } 
    320260        if(isset($_REQUEST['file'])) { 
     
    329269                    fwrite($wfh,$_REQUEST['config_text']); 
    330270                    fclose($wfh); 
    331                     $message = "Saved to Hard Drive!"; 
     271                    $endpoint->message['poce'] = "Saved to Hard Drive!"; 
    332272                }elseif(isset($_REQUEST['button_save_as'])) { 
    333273                    $sql = 'INSERT INTO endpointman_custom_configs (name, original_name, product_id, data) VALUES ("'.addslashes($_REQUEST['save_as_name']).'","'.addslashes($config_files[$_REQUEST['file']]).'","'.$_REQUEST['product_select'].'","'.addslashes($_REQUEST['config_text']).'")'; 
    334274                    $endpoint->db->query($sql); 
    335                     $message = "Saved to Database!"; 
     275                    $endpoint->message['poce'] = "Saved to Database!"; 
    336276                } 
    337277            } 
     
    343283            if(isset($_REQUEST['sendid'])) { 
    344284                $error = $endpoint->submit_config($row['directory'],$row['cfg_dir'],$config_files[$_REQUEST['file']],$contents); 
    345                 $message = 'Sent! Thanks :-)'; 
     285                $endpoint->message['poce'] = 'Sent! Thanks :-)'; 
    346286            } 
    347287 
     
    361301                    $sql = "UPDATE endpointman_custom_configs SET data = '".addslashes($_REQUEST['config_text'])."' WHERE id = ".$_REQUEST['sql']; 
    362302                    $endpoint->db->query($sql); 
    363                     $message = "Saved to Database!"; 
     303                    $endpoint->message['poce'] = "Saved to Database!"; 
    364304                }elseif(isset($_REQUEST['button_save_as'])) { 
    365305                    $sql = 'SELECT original_name FROM endpointman_custom_configs WHERE id = '.$_REQUEST['sql']; 
     
    368308                    $sql = "INSERT INTO endpointman_custom_configs (name, original_name, product_id, data) VALUES ('".addslashes($_REQUEST['save_as_name'])."','".addslashes($file_name)."','".$_REQUEST['product_select']."','".addslashes($_REQUEST['config_text'])."')"; 
    369309                    $endpoint->db->query($sql); 
    370                     $message = "Saved to Database!"; 
     310                    $endpoint->message['poce'] = "Saved to Database!"; 
    371311                } 
    372312            } 
     
    378318                $row22 =& $endpoint->db->getRow($sql, array(), DB_FETCHMODE_ASSOC); 
    379319                $endpoint->submit_config($row22['directory'],$row22['cfg_dir'],$row['original_name'],$row['data']); 
    380                 $message = 'Sent! Thanks! :-)'; 
     320                $endpoint->message['poce'] = 'Sent! Thanks! :-)'; 
    381321            } 
    382322 
     
    454394        } 
    455395        $endpoint->tpl->assign("product_list", $product_list); 
    456  
    457         $error_message = NULL; 
    458         foreach($endpoint->error as $key => $error) { 
    459             $error_message .= $error; 
    460             if($endpoint->global_cfg['debug']) { 
    461                 $error_message .= " Function: [".$key."]"; 
    462             } 
    463             $error_message .= "<br />"; 
    464         } 
    465         if(isset($message)) { 
    466             $endpoint->display_message_box($message,$endpoint->tpl,0); 
    467         } 
    468         if(isset($error_message)) { 
    469             $endpoint->display_message_box($error_message,$endpoint->tpl,1); 
    470         } 
    471  
     396        $endpoint->prepare_message_box(); 
    472397        echo $endpoint->tpl->draw( 'advanced_settings_poce' ); 
    473398        break; 
     
    554479            $endpoint->db->query($sql); 
    555480 
    556             $message .= "Updated!"; 
     481            $endpoint->message['advanced_settings'] = "Updated!"; 
    557482        } 
    558483        //Because we are working with global variables we probably updated them, so lets refresh those variables 
     
    601526        $endpoint->tpl->assign("brand_list", $endpoint->brands_available()); 
    602527 
    603         $error_message = NULL; 
    604         foreach($endpoint->error as $key => $error) { 
    605             $error_message .= $error; 
    606             if($endpoint->global_cfg['debug']) { 
    607                 $error_message .= " Function: [".$key."]"; 
    608             } 
    609             $error_message .= "<br />"; 
    610         } 
    611         if(isset($message)) { 
    612             $endpoint->display_message_box($message,$endpoint->tpl,0); 
    613         } 
    614         if(isset($error_message)) { 
    615             $endpoint->display_message_box($error_message,$endpoint->tpl,1); 
    616         } 
     528        $endpoint->prepare_message_box(); 
    617529 
    618530        echo $endpoint->tpl->draw( 'advanced_settings_settings' ); 
  • modules/branches/2.9/endpointman/includes/devices_manager.inc

    r11801 r11816  
    5555            case "add_line_x": 
    5656                $_REQUEST['id'] = $_REQUEST['edit_id']; 
    57                 $endpoint->add_line($_REQUEST['id']); 
     57                $mac_id = $endpoint->add_line($_REQUEST['id']); 
    5858                break; 
    5959            case "button_edit": 
     
    7474                $sql = 'SELECT * FROM endpointman_line_list WHERE mac_id = '. $_REQUEST['edit_id']; 
    7575 
    76                 $lines_list =& $endpoint->db->getAll($sql,array(),DB_FETCHMODE_ASSOC); 
     76                $lines_list = $endpoint->db->getAll($sql,array(),DB_FETCHMODE_ASSOC); 
    7777 
    7878                foreach($lines_list as $row) { 
    7979                    $sql = "SELECT description FROM devices WHERE id = ".$_REQUEST['ext_list_'.$row['luid']]; 
    80                     $name=$endpoint->db->getOne($sql); 
     80                    $name = $endpoint->db->getOne($sql); 
    8181 
    8282                    $sql = "UPDATE endpointman_line_list SET line = '".$_REQUEST['line_list_'.$row['luid']]."', ext = ".$_REQUEST['ext_list_'.$row['luid']].", description = '".$name."' WHERE luid =  ". $row['luid']; 
     
    9494            case "delete": 
    9595                $sql = 'SELECT mac_id FROM endpointman_line_list WHERE luid = '.$_REQUEST['edit_id'] ; 
    96                 $mac_id =& $endpoint->db->getOne($sql,array(),DB_FETCHMODE_ASSOC); 
     96                $mac_id = $endpoint->db->getOne($sql,array(),DB_FETCHMODE_ASSOC); 
    9797                $row = $endpoint->get_phone_info($mac_id); 
    9898 
     
    107107    case "add" : 
    108108        $mac_id = $endpoint->add_device($_REQUEST['mac'],$_REQUEST['model_list'],$_REQUEST['ext_list'],$_REQUEST['template_list'],$_REQUEST['line_list']); 
    109         $phone_info = $endpoint->get_phone_info($mac_id); 
    110         $endpoint->prepare_configs($phone_info); 
     109        if($mac_id === TRUE) { 
     110            $phone_info = $endpoint->get_phone_info($mac_id); 
     111            $endpoint->prepare_configs($phone_info); 
     112        } 
    111113        break; 
    112114    case "edit_template" : 
  • modules/branches/2.9/endpointman/includes/functions.inc

    r11801 r11816  
    280280    function add_device($mac,$model,$ext,$template=NULL,$line=NULL,$displayname=NULL) { 
    281281        $mac = $this->mac_check_clean($mac); 
    282  
    283282        if($mac) { 
    284             $sql = "SELECT id FROM endpointman_mac_list WHERE mac = '".$mac."'"; 
    285             $dup = $this->db->getOne($sql); 
    286  
    287             if($dup) { 
    288                 $this->add_line($dup, $line, $ext); 
     283            if(empty($model)) { 
     284                $this->error['add_device'] = _("You Must Select A Model From the Drop Down")."!"; 
     285                return(FALSE); 
     286            } elseif(empty($ext)) { 
     287                $this->error['add_device'] = _("You Must Select an Extension/Device From the Drop Down")."!"; 
     288                return(FALSE); 
    289289            } else { 
    290290                if($this->sync_model($model)) { 
    291                     if(empty($model)) { 
    292                         $this->error['add_device'] = _("You Must Select A Model From the Drop Down")."!"; 
    293                         return(FALSE); 
    294                     } elseif(empty($ext)) { 
    295                         $this->error['add_device'] = _("You Must Select an Extension/Device From the Drop Down")."!"; 
    296                         return(FALSE); 
     291                    $sql = "SELECT id,template_id FROM endpointman_mac_list WHERE mac = '".$mac."'"; 
     292                    $dup = $this->db->getRow($sql,array(),DB_FETCHMODE_ASSOC); 
     293 
     294                    if($dup) { 
     295                        if(!isset($template)) { 
     296                            $template = $dup['template_id']; 
     297                        } 
     298                        $sql = "UPDATE endpointman_mac_list SET model = ".$model.", template_id =  ".$template." WHERE id = ".$dup['id']; 
     299                        $this->db->query($sql); 
     300                        $return = $this->add_line($dup['id'], $line, $ext); 
     301                        if($return) { 
     302                            return($return); 
     303                        } else { 
     304                            return(FALSE); 
     305                        } 
    297306                    } else { 
    298307                        if(!isset($template)) { 
     
    325334                        $ext_id =& $this->db->getOne($sql); 
    326335 
    327                         if($line > 1) { 
    328                             $this->message['add_device'] = "You can't add a phone without the first line set!"
     336                        if(empty($line)) { 
     337                            $line = 1
    329338                        } 
    330                         $line = 1; 
    331339 
    332340                        $sql = "INSERT INTO `endpointman_line_list` (`mac_id`, `ext`, `line`, `description`) VALUES ('".$ext_id."', '".$ext."', '".$line."', '".$name."')"; 
    333341                        $this->db->query($sql); 
    334342 
    335                         $this->message['add_device'] = "Added!"
     343                        $this->message['add_device'] = "Added ".$name." to line ".$line
    336344                        return($ext_id); 
    337345                    } 
     
    342350            } 
    343351        } else { 
    344             $this->message['add_device'] = _("Invalid MAC Address")."!"; 
     352            $this->error['add_device'] = _("Invalid MAC Address")."!"; 
    345353            return(FALSE); 
    346354        } 
     
    369377 
    370378                    $sql = "INSERT INTO `endpointman_line_list` (`mac_id`, `ext`, `line`, `description`) VALUES ('".$mac_id."', '".$reg[0]['value']."', '".$lines[0]['value']."', '".$name."')"; 
     379                    $this->db->query($sql); 
     380 
     381                    $this->message['add_line'] = "Added '<i>".$name."</i>' to line '<i>".$lines[0]['value']."</i>' on device '<i>".$reg[0]['value']."</i>' <br/> Configuration Files will not be Generated until you click Save!"; 
     382                    return($mac_id); 
     383                } else { 
     384                    $this->error['add_line'] = _("No Devices/Extensions Left to Add")."!"; 
     385                    return(FALSE); 
     386                } 
     387            } else { 
     388                $this->error['add_line'] = _("No Lines Left to Add")."!"; 
     389                return(FALSE); 
     390            } 
     391        } elseif((!isset($line)) AND (isset($ext))) { 
     392            if($this->linesAvailable(NULL,$mac_id)) { 
     393                if($this->endpoint_data->all_unused_registrations()) { 
     394                    $lines = array_values($this->linesAvailable(NULL,$mac_id)); 
     395 
     396                    $sql = "INSERT INTO `endpointman_line_list` (`mac_id`, `ext`, `line`, `description`) VALUES ('".$mac_id."', '".$ext."', '".$lines[0]['value']."', '".$displayname."')"; 
    371397                    $this->db->query($sql); 
    372398 
     
    397423                $sql = "INSERT INTO `endpointman_line_list` (`mac_id`, `ext`, `line`, `description`) VALUES ('".$mac_id."', '".$ext."', '".$line."', '".$name."')"; 
    398424                $this->db->query($sql); 
    399                 $this->message['add_line'] = "Added ".$name." to line ".$line
     425                $this->message['add_line'] .= "Added ".$name." to line ".$line . "<br/>"
    400426                return($mac_id); 
    401427            } 
     
    404430    } 
    405431 
    406     function update_device($mac_id,$model,$ext,$template,$line=NULL,$name=NULL) { 
     432    function update_device($macid,$model,$template,$luid=NULL,$name=NULL,$line=NULL,$update_lines=TRUE) { 
    407433        $sql = "UPDATE endpointman_mac_list SET model = ".$model.", template_id =  ".$temp." WHERE id = ".$macid; 
    408434        $this->db->query($sql); 
    409         if(!isset($line)) { 
    410             return(TRUE); 
    411         } else { 
    412             $this->update_line($line, $name,NULL,$macid); 
    413             return(TRUE); 
    414         } 
    415     } 
    416  
    417     function update_line($line,$name,$luid=NULL,$macid=NULL) { 
     435        if($update_lines) { 
     436            if(!isset($luid)) { 
     437                $this->update_line($luid,NULL,$name,$line); 
     438                return(TRUE); 
     439            } else { 
     440                $this->update_line(NULL,$macid); 
     441                return(TRUE); 
     442            } 
     443        } 
     444    } 
     445 
     446    function update_line($luid=NULL,$macid=NULL,$name=NULL,$line=NULL) { 
    418447        if(isset($luid)) { 
    419             $sql = "UPDATE endpointman_line_list SET line = ".$line.", description =  '".$name."' WHERE  luid =" . $luid; 
     448            $sql = "SELECT * FROM endpointman_line_list WHERE luid = ".$luid; 
     449            $row = $this->db->getRow($sql, array(), DB_FETCHMODE_ASSOC); 
     450 
     451            if(!isset($name)) { 
     452                $sql = "SELECT description FROM devices WHERE id = ".$row['ext']; 
     453                $name=$this->db->getOne($sql); 
     454            } 
     455 
     456            if(!isset($line)) { 
     457                $line = $row['line']; 
     458            } 
     459 
     460            $sql = "UPDATE endpointman_line_list SET line = '".$line."', ext = ".$row['ext'].", description = '".$name."' WHERE luid =  ". $row['luid']; 
    420461            $this->db->query($sql); 
    421462            return(TRUE); 
    422463        } else { 
    423             $sql = "UPDATE endpointman_line_list SET line = ".$line.", description =  '".$name."' WHERE  luid =" . $luid; 
    424             $this->db->query($sql); 
     464            $sql = "SELECT * FROM endpointman_line_list WHERE mac_id = ".$macid; 
     465            $lines_info = $this->db->getAll($sql, array(), DB_FETCHMODE_ASSOC); 
     466            foreach($lines_info as $row) { 
     467                $sql = "SELECT description FROM devices WHERE id = ".$row['ext']; 
     468                $name=$this->db->getOne($sql); 
     469 
     470                $sql = "UPDATE endpointman_line_list SET line = '".$row['line']."', ext = ".$row['ext'].", description = '".$name."' WHERE luid =  ". $row['luid']; 
     471                $this->db->query($sql); 
     472            } 
    425473            return(TRUE); 
    426474        } 
  • modules/branches/2.9/endpointman/includes/template_manager.inc

    r10947 r11816  
    77 * @package Provisioner 
    88 */ 
    9 $message = NULL; 
    10 $error_message = NULL; 
    11  
    129$no_add = FALSE; 
    1310$default_display = FALSE; 
     
    2017 
    2118if((!$product_list) && (!$mac_list)) { 
    22     $message = _("Welcome to Endpoint Manager")."!<br />"._("You have no products (Modules) installed, click")." <a href=\"config.php?display=epm_config&type=$type\">"._("here")."</a> "._("to install some"); 
     19    $endpoint->message['general'] = _("Welcome to Endpoint Manager")."!<br />"._("You have no products (Modules) installed, click")." <a href=\"config.php?display=epm_config&type=$type\">"._("here")."</a> "._("to install some"); 
    2320    $no_add = TRUE; 
    2421} elseif(!$product_list) { 
    25     $message = "Thanks for upgrading to version 2.0! Please head on over to <a href=\"config.php?display=epm_config&type=$type\">\"Brand Configurations/Setup\"</a> to setup and install phone configurations"; 
     22    $endpoint->message['general'] = "Thanks for upgrading to version 2.0! Please head on over to <a href=\"config.php?display=epm_config&type=$type\">\"Brand Configurations/Setup\"</a> to setup and install phone configurations"; 
    2623    $no_add = TRUE; 
    2724} 
     
    3128} elseif(isset($_REQUEST['button_save'])) { 
    3229    if(($_REQUEST['model_class'] == 0) OR (empty($_REQUEST['template_name'])) OR ($_REQUEST['model_clone'] == 0)) { 
    33         $message = "No Valid Model/Template/Name Selected!"; 
     30        $endpoint->error['general'] = "No Valid Model/Template/Name Selected!"; 
    3431        $default_display = TRUE; 
    3532    } else { 
     
    4643    $endpoint->db->query($sql); 
    4744    $default_display = TRUE; 
    48     $message = _('Deleted'); 
     45    $endpoint->message['general'] = _('Deleted'); 
    4946} elseif((isset($_REQUEST['button_save_template'])) AND (isset($_REQUEST['custom']))) { 
    5047    $endpoint->save_template($_REQUEST['id'],$_REQUEST['custom'],$_REQUEST); 
    5148    $default_display = TRUE; 
    5249    if(empty($endpoint->error)) { 
    53         $message = _('Saved'); 
     50        $endpoint->message['general'] = _('Saved'); 
    5451    } 
    5552} else { 
     
    108105    $endpoint->tpl->assign("no_add", $no_add); 
    109106    $endpoint->tpl->assign("debug", $debug); 
    110  
    111     foreach($endpoint->error as $key => $error) { 
    112         $error_message .= $error; 
    113         if($endpoint->global_cfg['debug']) { 
    114             $error_message .= " Function: [".$key."]"; 
    115         } 
    116         $error_message .= "<br />"; 
    117     } 
    118     if(isset($error_message)) { 
    119         $endpoint->display_message_box($error_message,$endpoint->tpl,1); 
    120     } 
    121     if(isset($message)) { 
    122         $endpoint->display_message_box($message,$endpoint->tpl,0); 
    123     } 
    124  
     107     
     108    $endpoint->prepare_message_box(); 
    125109    echo $endpoint->tpl->draw( 'template_manager' ); 
    126110} 
  • modules/branches/2.9/endpointman/install.php

    r11618 r11816  
    9292} 
    9393 
    94 $version = "2.9.0.6"; 
     94$version = "2.9.0.7"; 
    9595 
    9696if(ep_table_exists("endpointman_global_vars")) { 
     
    180180} elseif($global_cfg['version'] == '2.9.0.5') { 
    181181    $ver = "2.9.0.5"; 
     182} elseif($global_cfg['version'] == '2.9.0.6') { 
     183    $ver = "2.9.0.6"; 
     184} elseif($global_cfg['version'] == '2.9.0.7') { 
     185    $ver = "2.9.0.7"; 
     186} elseif($global_cfg['version'] == '2.9.0.8') { 
     187    $ver = "2.9.0.8"; 
     188} elseif($global_cfg['version'] == '2.9.0.9') { 
     189    $ver = "2.9.0.9"; 
     190} elseif($global_cfg['version'] == '2.9.1.0') { 
     191    $ver = "2.9.1.0"; 
     192} elseif($global_cfg['version'] == '2.9.1.1') { 
     193    $ver = "2.9.1.1"; 
     194} elseif($global_cfg['version'] == '2.9.1.2') { 
     195    $ver = "2.9.1.2"; 
     196} elseif($global_cfg['version'] == '2.9.1.3') { 
     197    $ver = "2.9.1.3"; 
     198} elseif($global_cfg['version'] == '2.9.1.4') { 
     199    $ver = "2.9.1.4"; 
     200} elseif($global_cfg['version'] == '2.9.1.5') { 
     201    $ver = "2.9.1.5"; 
    182202} else { 
    183203    $ver = "1000"; 
     
    901921 
    902922    if($ver <= "2.9.0.4") { 
     923        out("Adding 'local' column to brand_list"); 
    903924        $sql = 'ALTER TABLE  `endpointman_brand_list` ADD  `local` INT( 1 ) NOT NULL DEFAULT  \'0\' AFTER  `cfg_ver`'; 
    904925        $db->query($sql); 
    905926    } 
    906927 
    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')"; 
     928    if($ver <= "2.9.0.7") { 
     929        out("Adding UNIQUE key to table global_vars for var_name"); 
     930        $sql = "ALTER TABLE `asterisk`.`endpointman_global_vars` ADD UNIQUE `unique` (`var_name`)"; 
     931        $db->query($sql); 
     932 
     933        out("Adding show_all_registrations to global_vars table"); 
     934        $sql = 'INSERT INTO asterisk.endpointman_global_vars (idnum, var_name, value) VALUES (NULL, "show_all_registrations", "0")'; 
    909935        $db->query($sql); 
    910936    } 
  • modules/branches/2.9/endpointman/module.xml

    r11802 r11816  
    33  <repo>standard</repo> 
    44  <name>PBX End Point Manager</name> 
    5   <version>2.9.0.3RC7</version> 
     5  <version>2.9.0.3RC9</version> 
    66  <type>tool</type> 
    77  <category>End Point Manager</category> 
     
    1616   <description>PBX End Point Manager supports automated deployment of multiple manufacturers IP telephones.</description> 
    1717   <changelog> 
    18        *2.9.0.3RC8* Fixes #4946,#4956, #4950 
     18                *2.9.0.3RC9* Fixed #4878, #4956, #4946, #4950 
    1919                *2.9.0.3RC6* Fixed Device + User Mode (http://www.freepbx.org/forum/freepbx/users/device-user-mode), #4792 
    20        *2.9.0.0* bumped for 2.9, removed errors in module.xml causing erors for online xml parsing 
     20    *2.9.0.0* bumped for 2.9, removed errors in module.xml causing erors for online xml parsing 
    2121                *2.3.2* Various Bug Fixes 
    2222                *2.3.1* Install directory case corrections 
  • modules/branches/2.9/endpointman/templates/freepbx/advanced_settings_oui.html

    r11804 r11816  
     1{if condition="isset($show_error_box)"} 
     2    {include="message_box"} 
     3{/if} 
    14<table align='center' width='30%'> 
    25<tr>