Changeset 4348

Show
Ignore:
Timestamp:
07/10/07 20:45:41 (6 years ago)
Author:
gregmac
Message:

Merged 2.3.views branch back to main 2.3:

r4341 r4342 r4343 r4344 r4345 r4346 r4347

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/branches/2.3/amp_conf/htdocs/admin/common/mainstyle.css

    r4113 r4348  
    200200} 
    201201 
     202 
     203#nav #nav-tabs li, #nav #nav-tabs li a { 
     204  display:inline; 
     205  padding-left:0 
     206} 
     207#nav #nav-tabs { 
     208  margin-bottom:0; 
     209  padding-left:12px; 
     210} 
     211#nav #nav-tabs li { 
     212  border-top:#ccc; 
     213  margin-right:12px; 
     214} 
     215#nav #nav-tabs li a{ 
     216  font-weight:bold; 
     217} 
     218#nav #nav-tabs li.tabs-selected { 
     219  border-top:2px solid #ff8a00; 
     220} 
     221 
     222 
     223/***** report nav *****/ 
     224#reportnav {  
     225  position:absolute;  
     226  top:55px;  
     227  left:10px;  
     228  border:1; 
     229  padding: 0 0 0 0; 
     230  list-style-type: none; 
     231  font-size:12px; 
     232  border-right:1px solid black; 
     233} 
     234#reportnav ul { 
     235  margin:0; 
     236  padding:0; 
     237} 
     238#reportnav  li { 
     239  display: inline; 
     240  border-left:1px solid black; 
     241  padding-left:6px; 
     242  padding-right:6px; 
     243} 
    202244/***** footer *****/ 
    203245#footer { 
  • freepbx/branches/2.3/amp_conf/htdocs/admin/config.php

    r4336 r4348  
    1212//GNU General Public License for more details. 
    1313 
    14 $title = "FreePBX administration"; 
    15  
    1614$type = isset($_REQUEST['type'])?$_REQUEST['type']:'setup'; 
    1715$display = isset($_REQUEST['display'])?$_REQUEST['display']:''; 
     
    2220 
    2321// determine module type to show, default to 'setup' 
    24 if($type == "tool") { 
    25   $message = "Tools"; 
    26   $fpbx_menu = array( 
    27     'modules' => array('category' => 'System Administration', 'name' => 'Module Admin', 'sort' => 0) 
    28   ); 
    29 } elseif($type == "cdrcost") { 
    30   $message = "Call Cost"; 
    31 } else { 
    32   $message = "Setup"; 
    33 
    34  
    35 require_once('common/php-asmanager.php'); 
    36 require_once('functions.inc.php'); 
    37  
    38 // get settings 
    39 $amp_conf = parse_amportal_conf("/etc/amportal.conf"); 
    40 $asterisk_conf  = parse_asterisk_conf(rtrim($amp_conf["ASTETCDIR"],"/")."/asterisk.conf"); 
    41 $astman   = new AGI_AsteriskManager(); 
    42 //if (! $res = $astman->connect("127.0.0.1:".$amp_conf["ASTMANAGERPORT"], $amp_conf["AMPMGRUSER"] , $amp_conf["AMPMGRPASS"])) { 
    43  
    44 if (!isset($amp_conf["ASTMANAGERPROXYPORT"]) || !$res = $astman->connect("127.0.0.1:".$amp_conf["ASTMANAGERPROXYPORT"], $amp_conf["AMPMGRUSER"] , $amp_conf["AMPMGRPASS"])) { 
    45   if (!$res = $astman->connect("127.0.0.1:".$amp_conf["ASTMANAGERPORT"], $amp_conf["AMPMGRUSER"] , $amp_conf["AMPMGRPASS"])) { 
    46     unset( $astman ); 
    47   } 
    48 
    49  
    50 session_start(); 
    51 include 'header_auth.php'; 
     22$type_names = array( 
     23  'tool'=>'Tools', 
     24  'setup'=>'Setup', 
     25  'cdrcost'=>'Call Cost', 
     26); 
     27 
     28include('header.php'); 
    5229 
    5330// get all enabled modules 
     
    5532$active_modules = module_getinfo(false, MODULE_STATUS_ENABLED); 
    5633 
     34// initialize menu with module admin 
     35$fpbx_menu = array( 
     36  'modules' => array('type'=>'tool', 'category' => 'System Administration', 'name' => 'Module Admin', 'sort' => 0) 
     37); 
     38 
    5739// include any module global functions 
    5840// add module sections to $fpbx_menu 
     41$types = array(); 
    5942if(is_array($active_modules)){ 
    6043  foreach($active_modules as $key => $module) { 
     
    7053      // loop through the types 
    7154      foreach($module['items'] as $itemKey => $item) { 
    72         if ($item['type'] == $type) { 
    73           // item is an assoc array, with at least array(name=>, category=>, type=>) 
    74           $fpbx_menu[$itemKey] = $item; 
    75         } 
    76       } 
    77      
    78     } 
    79      
     55        if (!in_array($item['type'], $types)) { 
     56          $types[] = $item['type']; 
     57        } 
     58        // item is an assoc array, with at least array(name=>, category=>, type=>) 
     59        $fpbx_menu[$itemKey] = $item; 
     60      } 
     61    } 
    8062  } 
    8163} 
     64sort($types); 
    8265 
    8366// new gui hooks 
     
    132115} 
    133116 
    134 if (!$quietmode) { 
    135   if (is_array($fpbx_menu)) { 
    136     $category = Array(); 
    137     $sort = Array(); 
    138     $name = Array(); 
    139     // Sorting menu by category and name 
    140     foreach ($fpbx_menu as $key => $row) { 
    141       $category[$key] = $row['category']; 
    142       $sort[$key] = $row['sort']; 
    143       $name[$key] = $row['name']; 
    144     } 
    145      
    146     if ($amp_conf['USECATEGORIES']) { 
    147       array_multisort( 
    148         $category, SORT_ASC,  
    149         $sort, SORT_ASC, SORT_NUMERIC,  
    150         $name, SORT_ASC,  
    151         $fpbx_menu 
    152       ); 
    153     } else { 
    154       array_multisort( 
    155         $sort, SORT_ASC, SORT_NUMERIC,  
    156         $name, SORT_ASC,  
    157         $fpbx_menu 
    158       ); 
    159     } 
    160      
    161     // Printing menu 
    162     echo "<div id=\"nav\"><ul>\n"; 
    163      
    164     $prev_category = ''; 
    165      
    166     foreach ($fpbx_menu as $key => $row) { 
    167       if ($amp_conf['USECATEGORIES'] && ($row['category'] != $prev_category)) { 
    168         echo "\t\t<li>"._($row['category'])."</li>\n"; 
    169         $prev_category = $row['category']; 
    170       } 
    171        
    172       $href = isset($row['href']) ? $row['href'] : "config.php?type=".$type."&amp;display=".$key; 
    173       $extra_attributes = ''; 
    174       if (isset($row['target'])) { 
    175         $extra_attributes .= ' target="'.$row['target'].'"'; 
    176       } 
    177        
    178       echo "\t<li" . 
    179         (($display==$key) ? ' class="current"':'') . 
    180         '><a href="'.$href.'" '.$extra_attributes.' >'._($row['name'])."</a></li>\n"; 
    181        
    182     } 
    183     echo "</ul></div>\n\n"; 
    184   } 
    185  
    186   echo "<div id=\"wrapper\"><div id=\"background-wrapper\">\n"; 
    187    
    188   echo "<div id=\"left-corner\"></div>\n"; 
    189   echo "<div id=\"right-corner\"></div>\n"; 
    190    
    191   echo "<div class=\"content\">\n"; 
    192  
    193  
    194   echo "<noscript><div class=\"attention\">"._("WARNING: Javascript is disabled in your browser. The FreePBX administration interface requires Javascript to run properly. Please enable javascript or switch to another  browser that supports it.")."</div></noscript>"; 
    195 } 
    196  
    197117 
    198118 
    199119// check access 
    200120if ( ($display != '') && !isset($fpbx_menu[$display]) ) { 
    201   $display = "noaccess"; 
     121  showview("noaccess"); 
     122  exit; 
    202123} 
    203124 
     
    218139  $currentcomponent->buildconfigpage(); 
    219140} 
     141 
     142//  note: we buffer all the output from the 'page' being loaded.. 
     143// This may change in the future, with proper returns, but for now, it's a simple  
     144// way to support the old page.item.php include module format. 
     145ob_start(); 
    220146 
    221147// show the appropriate page 
     
    281207    } 
    282208  break; 
    283   case 'noaccess': 
    284     echo "<h2>"._("Not found")."</h2>"; 
    285     echo "<p>"._("The section you requested does not exist or you do not have access to it.")."</p>"; 
    286   break; 
    287209  case 'modules': 
    288210    include 'page.modules.php'; 
     
    290212  case '': 
    291213    if ($astman) { 
     214/* 
    292215      printf( "<h2>%s</h2>", dgettext("welcome page", "Welcome to FreePBX.") ); 
    293216 
     
    377300      echo _("Asterisk may not be running."); 
    378301      echo "</div></p>\n"; 
     302*/ 
     303      showview('welcome', array('AMP_CONF' => &$amp_conf)); 
     304    } else { 
     305      // no manager, no connection to asterisk 
     306      showview('welcome_nomanager', array('mgruser' => $amp_conf["AMPMGRUSER"])); 
    379307    } 
    380308  break; 
    381    
    382 
    383  
    384 if (!$quietmode) { 
    385   echo "\t</div> <!-- /content -->\n"; 
    386    
    387   include('footer.php'); 
    388   echo "</div></div> <!-- /background-wrapper, /wrapper -->\n"; 
    389  
    390   echo "</div> <!-- /page -->\n"; 
    391   echo "</body>\n"; 
    392   echo "</html>\n"; 
    393 
     309
     310 
     311if ($quietmode) { 
     312  // send the output buffer 
     313  ob_end_flush(); 
     314} else { 
     315  $admin_template = $template = array(); 
     316 
     317 
     318  $admin_template['content'] = ob_get_contents(); 
     319  ob_end_clean(); 
     320 
     321  // build the admin interface (with menu) 
     322  $admin_template['fpbx_types'] = $types; 
     323  $admin_template['fpbx_type_names'] = $type_names; 
     324  $admin_template['fpbx_menu'] = $fpbx_menu; 
     325  $admin_template['fpbx_usecategories'] = $amp_conf['USECATEGORIES']; 
     326  $admin_template['fpbx_type'] = $type; 
     327  $admin_template['display'] = $display; 
     328 
     329  // then load it and put it into the main freepbx interface 
     330  $template['content'] = loadview('freepbx_admin', $admin_template); 
     331 
     332  // setup main template 
     333  $template['display'] = $display; 
     334  $template['title'] = "FreePBX administration"; 
     335  $template['amp_conf'] = &$amp_conf; 
     336 
     337 
     338  showview('freepbx', $template); 
     339
     340 
    394341?> 
  • freepbx/branches/2.3/amp_conf/htdocs/admin/header.php

    r4338 r4348  
    1212//GNU General Public License for more details. 
    1313 
    14 // helper function, to draw the upper links 
    15 function print_sub_tool( $name, $page, $is_current, $href=NULL, $new_window=false ) 
    16 
    17   if (!is_file($page)) 
    18     return; 
    19  
    20   $html = "<li"; 
     14/** Loads a view (from the views/ directory) with a number of named parameters created as local variables. 
     15 * @param  string   The name of the view. 
     16 * @param  array    The parameters to pass. Note that the key will be turned into a variable name for use by the view. 
     17 *                  For example, passing array('foo'=>'bar'); will create a variable $foo that can be used by 
     18 *                  the code in the view. 
     19 */ 
     20function loadview($viewname, $parameters = false) { 
     21  ob_start(); 
     22  showview($viewname, $parameters); 
     23  $contents = ob_get_contents(); 
     24  ob_end_clean(); 
     25  return $contents; 
     26
     27/** Outputs the contents of a view. 
     28 * @param  string   The name of the view. 
     29 * @param  array    The parameters to pass. Note that the key will be turned into a variable name for use by the view. 
     30 *                  For example, passing array('foo'=>'bar'); will create a variable $foo that can be used by 
     31 *                  the code in the view. 
     32 */ 
     33function showview($viewname, $parameters = false) { 
     34  if (is_array($parameters)) { 
     35    extract($parameters); 
     36  } 
    2137   
    22   if ($is_current) 
    23     $html .= " class=\"current\""; 
    24      
    25   $html .= "><a "; 
    26   if ($href == NULL) 
    27     $href .= $page; 
    28  
    29   if ($new_window != NULL) 
    30     $html .= "target=\"_blank\" "; 
    31  
    32   $html .= "href=\"$href\">$name</a></li>"; 
    33  
    34   print("\t\t$html\n"); 
     38  $viewname = str_replace('..','.',$viewname); // protect against going to subdirectories 
     39  if (file_exists('views/'.$viewname.'.php')) { 
     40    include('views/'.$viewname.'.php'); 
     41  } 
    3542} 
    36  
    37  
    38 // start output buffering 
    39 ob_start(); 
    4043 
    4144//get the current file name 
    4245$currentFile = $_SERVER["PHP_SELF"]; 
    43 $parts = Explode('/', $currentFile); 
     46$parts = explode('/', $currentFile); 
    4447//header('Content-type: text/html; charset=utf-8'); 
    4548$currentFile = $parts[count($parts) - 1]; 
     49//todo: can this be removed? what is it used for? 
     50 
    4651 
    4752// Emulate gettext extension functions if gettext is not available 
     
    6267} 
    6368 
    64  
     69// setup locale 
    6570if (extension_loaded('gettext')) { 
    6671  if (isset($_COOKIE['lang'])) { 
     
    7479  textdomain('amp'); 
    7580} 
     81 
    7682 
    7783// systems running on sqlite3 (or pgsql) this function is not available 
     
    9399} 
    94100 
    95 if (!$quietmode) { 
     101// include base functions 
     102require_once('functions.inc.php'); 
     103require_once('common/php-asmanager.php'); 
     104 
     105// get settings 
     106$amp_conf = parse_amportal_conf("/etc/amportal.conf"); 
     107$asterisk_conf  = parse_asterisk_conf(rtrim($amp_conf["ASTETCDIR"],"/")."/asterisk.conf"); 
     108$astman   = new AGI_AsteriskManager(); 
     109 
     110// attempt to connect to asterisk manager proxy 
     111if (!isset($amp_conf["ASTMANAGERPROXYPORT"]) || !$res = $astman->connect("127.0.0.1:".$amp_conf["ASTMANAGERPROXYPORT"], $amp_conf["AMPMGRUSER"] , $amp_conf["AMPMGRPASS"])) { 
     112  // attempt to connect directly to asterisk, if no proxy or if proxy failed 
     113  if (!$res = $astman->connect("127.0.0.1:".$amp_conf["ASTMANAGERPORT"], $amp_conf["AMPMGRUSER"] , $amp_conf["AMPMGRPASS"])) { 
     114    // couldn't connect at all 
     115    unset( $astman ); 
     116  } 
     117
     118 
     119// always run a session 
     120session_start(); 
     121 
     122// do authentication - header_auth exits if unauthorized 
     123include('header_auth.php'); 
     124 
    96125?> 
    97 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
    98  
    99 <html> 
    100  
    101 <head> 
    102   <title><?php  echo _($title) ?></title> 
    103   <meta http-equiv="Content-Type" content="text/html"> 
    104   <link href="common/mainstyle.css" rel="stylesheet" type="text/css"> 
    105   <link rel="shortcut icon" type="image/vnd.microsoft.icon" href="favicon.ico" > 
    106   <!--[if IE]> 
    107   <link href="common/ie.css" rel="stylesheet" type="text/css"> 
    108   <![endif]-->   
    109   <meta http-equiv="Content-Type" content="text/html;charset=utf-8" > 
    110 <?php  
    111   // check if in the amp configuration the user has set that 
    112   // he wants to use an alternative style-sheet. 
    113   // on Xorcom's TS1, it's used when the system is in rescue mode. 
    114   if (isset($amp_conf["ALTERNATIVE_CSS"])) 
    115   { 
    116     if (($amp_conf["ALTERNATIVE_CSS"] == "1") || 
    117       ($amp_conf["ALTERNATIVE_CSS"] == "yes") || 
    118       ($amp_conf["ALTERNATIVE_CSS"] == "true")) 
    119       echo "\t<link href=\"common/mainstyle-alternative.css\" rel=\"stylesheet\" type=\"text/css\">"; 
    120   } 
    121  
    122   if (isset($display) && is_file("modules/{$display}/{$display}.css")) { 
    123     echo "\t<link href=\"modules/{$display}/{$display}.css\" rel=\"stylesheet\" type=\"text/css\">\n"; 
    124   } 
    125 ?> 
    126    
    127   <script type="text/javascript" src="common/script.js.php"></script> 
    128   <script type="text/javascript" src="common/jquery.js"></script> 
    129 <!--[if IE]> 
    130     <style type="text/css">div.inyourface a{position:absolute;}</style> 
    131 <![endif]--> 
    132 </head> 
    133  
    134 <body onload="body_loaded();"  <? 
    135 // Check if it's a RIGHT TO LEFT character set (eg, hebrew, arabic, whatever) 
    136 //$_COOKIE['lang']="he_IL"; 
    137 if (isset($_COOKIE['lang']) && $_COOKIE['lang']==="he_IL")  
    138   echo "dir=\"rtl\""; 
    139  
    140 ?> > 
    141 <div id="page"> 
    142   <div id="header"> 
    143 <?php 
    144        
    145   echo "\t\t<div id=\"version\">"; 
    146   echo sprintf(_("%s %s on %s"),  
    147     "<a href=\"index.php\">"._("FreePBX")."</a>", 
    148     getversion(), 
    149     "<a href=\"http".(isset($_SERVER['HTTPS'])&&$_SERVER['HTTPS']!=''?'s':'')."://".$_SERVER['HTTP_HOST']."\">".$_SERVER["SERVER_NAME"]."</a>" 
    150      ); 
    151   echo "</div>\n"; 
    152  
    153   echo "\t\t<ul id=\"metanav\">\n"; 
    154   print_sub_tool( _("Management"), "manage.php" , $currentFile=='manage.php' ); 
    155   print_sub_tool( _("Setup")     , "config.php" , $currentFile=='config.php' && isset($_REQUEST['type']) && ($_REQUEST['type']=='setup' || $_REQUEST['type'] == ""), "config.php?type=setup", false ); 
    156   print_sub_tool( _("Tools")     , "config.php" , $currentFile=='config.php' && isset($_REQUEST['type']) && $_REQUEST['type']=='tool' , "config.php?type=tool", false ); 
    157   print_sub_tool( _("Reports")   , "reports.php", $currentFile=='reports.php' ); 
    158   print_sub_tool( _("Panel")     , "panel.php"  , $currentFile=='panel.php' ); 
    159   print_sub_tool( _("Recordings"), "../recordings/index.php"  ,0, NULL, true ); 
    160 ?> 
    161   <li><a href="http://support.freepbx.org" title="FreePBX Support" target="_blank">Help</a></li> 
    162 <?php 
    163   echo "\t\t</ul>\n"; 
    164  
    165   $freepbx_alt = _("FreePBX"); 
    166   $freepbx_logo = (isset($amp_conf["AMPADMINLOGO"]) && is_file($amp_conf["AMPWEBROOT"]."/admin/images/".$amp_conf["AMPADMINLOGO"])) ? $amp_conf["AMPADMINLOGO"] : 'freepbx_small.png'; 
    167   echo "\t\t<div id=\"logo\"><a href=\"http://www.freepbx.org\" target=\"_blank\" title=\"".$freepbx_alt."\"><img src=\"images/".$freepbx_logo."\" alt=\"".$freepbx_alt."\" /></a></div>\n"; 
    168  
    169   echo "\t</div>"; 
    170  
    171   // need reload bar - hidden by default 
    172   echo "\n\t\t<div class=\"attention\" id=\"need_reload_block\" style=\"display:none;\"><a href=\"javascript:void(null);\" onclick=\"amp_apply_changes();\" class=\"info\">"; 
    173   echo _("Apply Configuration Changes"); 
    174   echo "<span>".sprintf(_("You have made changes to the configuration that have not yet been applied. When you are ". 
    175            "finished making all changes, click on %s to put them into effect."), "<strong>"._("Apply Configuration Changes")."</strong>"); 
    176   echo "</span></a></div>\n\n"; 
    177  
    178  
    179   echo "\t<div id=\"message\">"; 
    180  
    181 // TODO: this is ugly, need to code this better! 
    182 //       mixing php + html is bad! 
    183   if (extension_loaded('gettext')) { 
    184     if (!isset($_COOKIE['lang'])) { 
    185       $_COOKIE['lang'] = "en_US"; 
    186     }  
    187 ?> 
    188 &nbsp;&nbsp;&nbsp;<?php echo _("Language:") ?> 
    189 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    190     <select onchange="javascript:changeLang(this.value)"> 
    191     <option value="en_US" <? echo ($_COOKIE['lang']=="en_US" ? "selected" : "") ?> >English</option> 
    192     <option value="fr_FR" <? echo ($_COOKIE['lang']=="fr_FR" ? "selected" : "") ?> >Fran&ccedil;ais</option> 
    193     <option value="de_DE" <? echo ($_COOKIE['lang']=="de_DE" ? "selected" : "") ?> >Deutsch</option> 
    194     <option value="it_IT" <? echo ($_COOKIE['lang']=="it_IT" ? "selected" : "") ?> >Italiano</option> 
    195     <option value="es_ES" <? echo ($_COOKIE['lang']=="es_ES" ? "selected" : "") ?> >Espa&ntilde;ol</option> 
    196     <option value="ru_RU" <? echo ($_COOKIE['lang']=="ru_RU" ? "selected" : "") ?> >Russki</option> 
    197     <option value="pt_PT" <? echo ($_COOKIE['lang']=="pt_PT" ? "selected" : "") ?> >Portuguese</option> 
    198     <option value="he_IL" <? echo ($_COOKIE['lang']=="he_IL" ? "selected" : "") ?> >Hebrew</option> 
    199     </select> 
    200 <?php 
    201   } 
    202 ?> 
    203  
    204 <script type="text/javascript"> 
    205 <!-- 
    206 function changeLang(lang) { 
    207   document.cookie='lang='+lang; 
    208   window.location.reload(); 
    209 } 
    210 //--> 
    211 </script> 
    212  
    213 <?php 
    214   if ( isset($_SESSION['AMP_user']) &&  $amp_conf['AUTHTYPE'] != 'none' ) { 
    215     echo _('Logged in: ').$_SESSION['AMP_user']->username; 
    216     echo ' (<a href="http'.(isset($_SERVER['HTTPS'])&&$_SERVER['HTTPS']!=''?'s':'').'://'; 
    217  
    218     if (!ereg('MSIE', $_SERVER['HTTP_USER_AGENT'])) { 
    219       // use other logout for Firefox and other browsers  
    220       echo 'logout:logout@'; 
    221     } 
    222  
    223     $pathLength = strrpos($_SERVER['PHP_SELF'],'/'); 
    224     $logoutPath = ($pathLength === false) ? '' : substr($_SERVER['PHP_SELF'],0,$pathLength); 
    225  
    226     echo $_SERVER['HTTP_HOST'].$logoutPath.'/logout.php">Logout</a>)&nbsp;::&nbsp;'; 
    227   } 
    228   echo _($message); 
    229 ?></div> 
    230  
    231 <?php 
    232 } // End 'quietmode' check 
    233 ?> 
  • freepbx/branches/2.3/amp_conf/htdocs/admin/header_auth.php

    r4170 r4348  
    110110} 
    111111 
    112 include 'header.php'; 
     112//todo .. delete  // include 'header.php'; 
    113113 
    114114if ( !(isset($result) ? $result : false) ) { 
    115   echo "\t<br><br><br><br><center><h2>"; 
    116   echo _("You must log in first before you can access this page."); 
    117   echo "</h2></center><br><br><br><br>\n";  
    118   include 'footer.php'; 
     115  showview("noaccess"); 
    119116  exit; 
    120117} 
  • freepbx/branches/2.3/amp_conf/htdocs/admin/panel.php

    r4170 r4348  
    1717$message="Flash Operator Panel"; 
    1818 
    19 require_once('functions.inc.php')
     19include 'header.php'
    2020 
    21 // get settings 
    22 $amp_conf = parse_amportal_conf("/etc/amportal.conf"); 
    23  
    24 include 'header_auth.php'; 
     21showview('panel', array('title'=>$title, 'deptname' => $_SESSION["AMP_user"]->_deptname)); 
    2522?> 
    26 </div> 
    27 <iframe width="97%" height="600" frameborder="0" align="top" src="../panel/index_amp.php?context=<?php echo $_SESSION["AMP_user"]->_deptname?>"></iframe> 
    28  
    29 </body> 
    30 </html> 
  • freepbx/branches/2.3/amp_conf/htdocs/admin/reports.php

    r4170 r4348  
    1717$message="Call Detail Reports"; 
    1818 
    19 require_once('functions.inc.php'); 
    20  
    21 // get settings 
    22 $amp_conf = parse_amportal_conf("/etc/amportal.conf"); 
     19include 'header.php'; 
    2320 
    2421// BUILD an SQL clause for any AMP User restrictions 
    25 session_register('AMP_SQL'); 
     22//session_register('AMP_SQL'); 
    2623$low = $_SESSION["AMP_user"]->_extension_low; 
    2724$high = $_SESSION["AMP_user"]->_extension_high; 
     
    3532} 
    3633 
    37 include 'header_auth.php'; 
    38  
    3934$display=1; 
    4035if (isset($_REQUEST['display'])) { 
     
    4338 
    4439// setup menu  
    45 $amp_sections = array( 
     40$menu = array( 
    4641    1=>_("Call Logs"), 
    4742    2=>_("Compare Calls"), 
     
    5146 
    5247echo "<div id=\"cdr\"><ul id=\"metanav\">"; 
    53 foreach ($amp_sections as $key=>$value) { 
     48foreach ($menu as $key=>$value) { 
    5449  echo "<li class=\"".(($display==$key) ? 'current':'')."\"><a href=\"reports.php?display=".$key."\">".$value."</a></li>"; 
    5550} 
     
    5954// Changes for -- AMP -- commented in: 
    6055// cdr.php, defines.php, call-log.php, call-comp.php, graph_hourdetail.php, graph_statbar.php, graph_pie.php 
     56 
     57showview('reports', array('title'=>$title, 'display'=>$display, 'menu' => $menu)); 
    6158?> 
    6259</div> 
    6360 
    64 <iframe width="100%" height="600" frameborder="0" align="top" scrolling="yes" src="cdr/cdr.php?s=<?php echo $display; echo ($display=='1' ? '&posted=1' : '');?>"></iframe
     61<!-- iframe width="100%" height="600" frameborder="0" align="top" scrolling="yes" src="cdr/cdr.php?s=<?php echo $display; echo ($display=='1' ? '&posted=1' : '');?>"></iframe> --
    6562