[Mapbender-commits] r9148 - in trunk/mapbender/http: classes plugins
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu Jan 22 01:17:06 PST 2015
Author: verenadiewald
Date: 2015-01-22 01:17:06 -0800 (Thu, 22 Jan 2015)
New Revision: 9148
Modified:
trunk/mapbender/http/classes/class_wms_owsproxy_log.php
trunk/mapbender/http/plugins/mb_owsproxy_log_csv.js
Log:
bugfix in owsproxy_log: confirm message when deleting all log entries for all wms of selected user
Modified: trunk/mapbender/http/classes/class_wms_owsproxy_log.php
===================================================================
--- trunk/mapbender/http/classes/class_wms_owsproxy_log.php 2015-01-21 15:27:33 UTC (rev 9147)
+++ trunk/mapbender/http/classes/class_wms_owsproxy_log.php 2015-01-22 09:17:06 UTC (rev 9148)
@@ -271,15 +271,23 @@
// $t = array('i', "t", "t");
// $sql = "DELETE FROM mb_proxy_log WHERE fkey_wms_id = $1"
// ." AND proxy_log_timestamp >= $2 AND proxy_log_timestamp <= $3";
- $v = array($this->wmsId, $this->timeFrom, $this->timeTo, $this->mb_user_id);
- $t = array('i', "t", "t", "i");
+ $v = array($this->timeFrom, $this->timeTo, $this->mb_user_id);
+ $t = array("t", "t", "i");
$sql = "DELETE FROM mb_proxy_log"
." WHERE log_id in("
." SELECT m.log_id"
." FROM mb_proxy_log AS m INNER JOIN wms AS w ON"
- ." (m.fkey_wms_id = w.wms_id AND w.wms_owner=$4"
- ." AND m.fkey_wms_id = $1 AND m.proxy_log_timestamp >= $2"
- ." AND m.proxy_log_timestamp <= $3)"
+ ." (m.fkey_wms_id = w.wms_id AND w.wms_owner=$3";
+ $inOffset = 4;
+ foreach(explode(",",$this->wmsId) as $wms) {
+ $v[] = trim($wms);
+ $t[] = "i";
+ $inParams[] = "$".$inOffset;
+ $inOffset++;
+ }
+ $sql .= " AND m.fkey_wms_id IN (" .implode(",",$inParams) .")";
+ $sql .= " AND m.proxy_log_timestamp >= $1"
+ ." AND m.proxy_log_timestamp <= $2)"
.")";
$result = db_prep_query($sql,$v,$t);
$resnum = pg_affected_rows($result);
@@ -302,9 +310,17 @@
$t = array('i', "t", "t", "i");
$whereWms = "";
if($this->wmsId !== null && $this->wmsId != "") {
- $whereWms = " AND m.fkey_wms_id = $5";
- $v[] = $this->wmsId;
- $t[] = 'i';
+ $whereWms = " AND m.fkey_wms_id IN (";
+ $inOffset = 5;
+ foreach(explode(",",$this->wmsId) as $wms) {
+ $v[] = trim($wms);
+ $t[] = "i";
+ $inParams[] = "$".$inOffset;
+ $inOffset++;
+ }
+ $whereWms .= implode(",",$inParams);
+
+ $whereWms .= ")";
}
$sql = "DELETE FROM mb_proxy_log"
." WHERE log_id in("
Modified: trunk/mapbender/http/plugins/mb_owsproxy_log_csv.js
===================================================================
--- trunk/mapbender/http/plugins/mb_owsproxy_log_csv.js 2015-01-21 15:27:33 UTC (rev 9147)
+++ trunk/mapbender/http/plugins/mb_owsproxy_log_csv.js 2015-01-22 09:17:06 UTC (rev 9148)
@@ -58,13 +58,27 @@
}
this.deleteData = function(e){
+ if(lastRequestData.wmsId == -1) {
+ var delMsg = "Die Logeinträge ALLER vorhandenen Dienste aus der Liste werden gelöscht. Soll diese Aktion ausgeführt werden?";
+ }
+ else {
var delMsg = "Die Logeinträge werden gelöscht. Soll diese Aktion ausgeführt werden?";
+ }
var delConfirm = confirm(delMsg);
if(delConfirm == true){
var a = 0;
if (lastRequestData != null){
var parameter = lastRequestData;
parameter['function'] = "deleteServiceLogs";
+ if(lastRequestData.wmsId == -1) {
+ var allServices = new Array();
+ $('#wmsId option').each(function(){
+ if(this.value != "" && this.value != -1) {
+ allServices.push(this.value);
+ }
+ });
+ parameter['wmsId'] = allServices.join(',');
+ }
that.loadJson(parameter);
}
}
@@ -427,4 +441,4 @@
});
});
-});
\ No newline at end of file
+});
More information about the Mapbender_commits
mailing list