summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6d414a5)
raw | patch | inline | side by side (parent: 6d414a5)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 3 Nov 2009 14:29:30 +0000 (14:29 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 3 Nov 2009 14:29:30 +0000 (14:29 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14734 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/gofon/gofon/fonreports/class_fonreport.inc | patch | blob | history | |
gosa-plugins/gofon/gofon/fonreports/contents.tpl | patch | blob | history |
diff --git a/gosa-plugins/gofon/gofon/fonreports/class_fonreport.inc b/gosa-plugins/gofon/gofon/fonreports/class_fonreport.inc
index a5e932a3dbffd05b912196a6f0909774eb8e6d3a..926355a19819d00246a872652d6b88c99e671a18 100644 (file)
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");
var $objectclasses = array();
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])){
msg_dialog::display(_("Configuration error"), msgPool::noserver(_("GOfon")), WARNING_DIALOG);
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;
+ }
+ }
+ }
+
$link = @mysql_pconnect($cfg['SERVER'], $cfg['LOGIN'], $cfg['PASSWORD']);
if ($link === FALSE){
msg_dialog::display(_("Error"), msgPool::dbconnect(_("GOfon"),@mysql_error(),$cfg['SERVER']),ERROR_DIALOG);
*****************/
$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");
diff --git a/gosa-plugins/gofon/gofon/fonreports/contents.tpl b/gosa-plugins/gofon/gofon/fonreports/contents.tpl
index d8cf0a47fc68ce113514a9d86dff20c070d1324b..ce2ae650832eb2a9c415b5d0078664d5ad324d4d 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}