summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4c60508)
raw | patch | inline | side by side (parent: 4c60508)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 2 Nov 2009 12:40:22 +0000 (12:40 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 2 Nov 2009 12:40:22 +0000 (12:40 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@14723 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/gofon/fonreports/class_fonreport.inc | patch | blob | history | |
plugins/gofon/fonreports/contents.tpl | patch | blob | history |
diff --git a/plugins/gofon/fonreports/class_fonreport.inc b/plugins/gofon/fonreports/class_fonreport.inc
index aaefaab6c392f2c44f9e3cf4d46a86b608f52e57..de59274e28b33ef58b041023df2dd1b6009345db 100644 (file)
var $ui = NULL;
var $range = 20;
var $EntryPerPage = 20;
+ var $selected_server = "";
/* attribute list for save action */
var $attributes_SO = array("start","search_for","search_base","range","month","sort_direction","sort","year");
if (isset($_GET['start'])){
$this->start= (int)$_GET['start'];
}
- foreach( array("year", "month", "search_for", "search_base") as $type){
+ foreach( array("year", "month", "search_for", "search_base","selected_server") as $type){
if (isset($_POST[$type])){
$this->$type= $_POST[$type];
}
Check Database , Table , Connection
*****************/
+ // Collect servers and allow to select the server in the ui.
+ $servers = array();
+ foreach($this->config->data['SERVERS']['FON'] as $key => $server){
+ $servers[$server['SERVER']] = $server['SERVER'];
+ }
+ $smarty->assign("servers", $servers);
+ $smarty->assign("selected_server", $this->selected_server);
+
+
/* Connecting, selecting database */
if (!isset($this->config->data['SERVERS']['FON'][0])){
print_red(_("Can't connect to phone database, no reports can be shown!"));
return($smarty->fetch(get_template_path('contents.tpl', TRUE)));
}else{
- $cfg= $this->config->data['SERVERS']['FON'][0];
+ // Get CFG for the selected server, if empty use first.
+ if($this->selected_server == ""){
+ $cfg= $this->config->data['SERVERS']['FON'][0];
+ }else{
+ foreach($this->config->data['SERVERS']['FON'] as $server){
+ if($server['SERVER'] == $this->selected_server){
+ $cfg = $server;
+ }
+ }
+ }
+
+ // Try to connect
$link = @mysql_pconnect($cfg['SERVER'], $cfg['LOGIN'], $cfg['PASSWORD']);
if ($link === FALSE){
print_red(_("Can't connect to phone database, no reports can be shown!"));
*****************/
$query = $this->CreateQuerySyntax();
- $cfg = $this->config->data['SERVERS']['FON'][0];
$link = @mysql_pconnect($cfg['SERVER'], $cfg['LOGIN'], $cfg['PASSWORD']);
@DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__,$query, "Database query");
index bd8f503fdd74b5f94d73cf121e43eabc1309c2db..67e5e1c53e170ba3075c6489e49108b999a871db 100644 (file)
<select size="1" name="search_base" title="{t}Select subtree to base search on{/t}" onChange="mainform.submit()">
{html_options options=$bases selected=$base_select}
</select>
+ {t}on{/t}
+ <select size="1" name="selected_server" title="{t}Select server to search on{/t}" onChange="mainform.submit()">
+ {html_options options=$servers selected=$selected_server}
+ </select>
{t}during{/t}
<select size="1" name="month" onChange="mainform.submit()">
{html_options options=$months selected=$month_select}