[Mapbender-commits] r8731 - in trunk/mapbender: http/classes http/php http/plugins tools
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu Oct 24 03:21:49 PDT 2013
Author: armin11
Date: 2013-10-24 03:21:49 -0700 (Thu, 24 Oct 2013)
New Revision: 8731
Modified:
trunk/mapbender/http/classes/class_iso19139.php
trunk/mapbender/http/classes/class_wms.php
trunk/mapbender/http/php/mb_getWmsData.php
trunk/mapbender/http/php/mod_updateWMS.php
trunk/mapbender/http/plugins/mb_metadata_server.php
trunk/mapbender/http/plugins/mb_wms_scheduler_select.js
trunk/mapbender/http/plugins/mb_wms_scheduler_server.php
trunk/mapbender/tools/mod_runScheduler.php
Log:
Enhance possibility for steering which kind of metadata should be overwritten from wms information when updating service.
Modified: trunk/mapbender/http/classes/class_iso19139.php
===================================================================
--- trunk/mapbender/http/classes/class_iso19139.php 2013-10-24 06:23:07 UTC (rev 8730)
+++ trunk/mapbender/http/classes/class_iso19139.php 2013-10-24 10:21:49 UTC (rev 8731)
@@ -216,23 +216,23 @@
//create mapbenders internal category objects
//first for topic categories
foreach ($this->isoCategoryKeys as $isoKey) {
- $e = new mb_exception("class_iso19139.php: look for iso key: ".$isoKey);
+ $e = new mb_notice("class_iso19139.php: look for iso key: ".$isoKey);
//test if key is found in hash
- $e = new mb_exception("class_iso19139.php: found: ".$topicCatHash[trim($isoKey)]);
+ $e = new mb_notice("class_iso19139.php: found: ".$topicCatHash[trim($isoKey)]);
if (is_int($topicCatHash[trim($isoKey)])) {
- $e = new mb_exception("class_iso19139.php: isoCategories entry added: ".$topicCatHash[trim($isoKey)]);
+ $e = new mb_notice("class_iso19139.php: isoCategories entry added: ".$topicCatHash[trim($isoKey)]);
$this->isoCategories[] = $topicCatHash[trim($isoKey)];
}
}
//debug output:
foreach ($this->isoCategories as $category) {
- $e = new mb_exception("class_iso19139.php: isocat: ".$category);
+ $e = new mb_notice("class_iso19139.php: isocat: ".$category);
}
foreach ($this->inspireCategories as $category) {
- $e = new mb_exception("class_iso19139.php: inspirecat: ".$category);
+ $e = new mb_notice("class_iso19139.php: inspirecat: ".$category);
}
foreach ($this->customCategories as $category) {
- $e = new mb_exception("class_iso19139.php: customcat: ".$category);
+ $e = new mb_notice("class_iso19139.php: customcat: ".$category);
}
$this->downloadLinks = $iso19139Xml->xpath('/gmd:MD_Metadata/gmd:distributionInfo/gmd:MD_Distribution/gmd:transferOptions/gmd:MD_DigitalTransferOptions/gmd:onLine/gmd:CI_OnlineResource[gmd:function/gmd:CI_OnLineFunctionCode/@codeListValue="download"]/gmd:linkage/gmd:URL');
/*<gmd:extent><gmd:EX_Extent><gmd:geographicElement><gmd:EX_GeographicBoundingBox><gmd:westBoundLongitude><gco:Decimal>5</gco:Decimal></gmd:westBoundLongitude><gmd:eastBoundLongitude><gco:Decimal>10</gco:Decimal></gmd:eastBoundLongitude><gmd:southBoundLatitude><gco:Decimal>48</gco:Decimal></gmd:southBoundLatitude><gmd:northBoundLatitude><gco:Decimal>52</gco:Decimal></gmd:northBoundLatitude></gmd:EX_GeographicBoundingBox></gmd:geographicElement></gmd:EX_Extent></gmd:extent>*/
Modified: trunk/mapbender/http/classes/class_wms.php
===================================================================
--- trunk/mapbender/http/classes/class_wms.php 2013-10-24 06:23:07 UTC (rev 8730)
+++ trunk/mapbender/http/classes/class_wms.php 2013-10-24 10:21:49 UTC (rev 8731)
@@ -910,7 +910,6 @@
//add id for isoCategory
if (is_int($topicCatHash[trim($element['value'])])) {
$this->objLayer[$cnt_layer]->layer_md_topic_category_id[] = (integer)$topicCatHash[trim($element['value'])];
- $e = new mb_exception("class_wms.php iso keyword added: ".(integer)$topicCatHash[trim($element['value'])]);
}
break;
case "GEMET - INSPIRE themes":
@@ -1041,7 +1040,7 @@
$this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["maxx"] = $element['attributes']['maxy'];
$this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["maxy"] = $element['attributes']['maxx'];
}else{
- $e = new mb_exception("class_wms: createObjFromXML: WMS 1.3.0 ELSE");
+ //$e = new mb_exception("class_wms: createObjFromXML: WMS 1.3.0 ELSE");
$this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["minx"] = $element['attributes']['minx'];
$this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["miny"] = $element['attributes']['miny'];
$this->objLayer[$cnt_layer]->layer_epsg[$cnt_epsg]["maxx"] = $element['attributes']['maxx'];
@@ -1999,6 +1998,7 @@
$e = new mb_notice("class_wms.php: layerid: ".$l_id." inspiredownload: ".$this->objLayer[$i]->inspire_download);
$res = db_prep_query($sql,$v,$t);
if($this->overwrite == true){
+ $e = new mb_notice("class_wms.php - overwrite has been activated");
$sql = "UPDATE layer SET ";
$sql .= "layer_title = $1, ";
$sql .= "layer_abstract = $2 ";
@@ -2012,6 +2012,9 @@
db_rollback();
}
else {
+ if ($this->overwriteCategories == true) {
+ $e = new mb_notice("class_wms.php - overwrite categories has been activated");
+ }
# save the id of each layer: set param2 true
$this->objLayer[$i]->db_id = $l_id;
if (!$updateMetadataOnly) {
@@ -2026,6 +2029,7 @@
//$this->insertLayerCategories($i); //Don't overwrite layer categories by default any longer - it will make problems - maybe the wms 1.3.0 possibilities are a better way
}
if($this->overwriteCategories == true){
+ //$e = new mb_exception("class_wsm.php - insertLayerCategories!");
$this->insertLayerCategories($i);
}
}
@@ -2389,6 +2393,7 @@
}
function insertLayerCategories($i){
+
global $con;
$types = array("md_topic", "inspire", "custom");
foreach ($types as $cat) {
@@ -2398,6 +2403,7 @@
$res = db_prep_query($sql,$v,$t);
$attr = "layer_{$cat}_category_id";
$k = $this->objLayer[$i]->$attr;
+ //$e = new mb_exception("class_wms: delete category: ".$attr." from db for layer ".$this->objLayer[$i]->db_id);
for ($j = 0; $j < count($k); $j++) {
$sql = "INSERT INTO layer_{$cat}_category (fkey_layer_id, fkey_{$cat}_category_id) VALUES ($1, $2)";
$v = array($this->objLayer[$i]->db_id, $k[$j]);
Modified: trunk/mapbender/http/php/mb_getWmsData.php
===================================================================
--- trunk/mapbender/http/php/mb_getWmsData.php 2013-10-24 06:23:07 UTC (rev 8730)
+++ trunk/mapbender/http/php/mb_getWmsData.php 2013-10-24 10:21:49 UTC (rev 8731)
@@ -120,7 +120,12 @@
}
if(empty($_POST['rss_news'])) {
$mywms->setGeoRss = false;
- }
+ }
+ if(empty($_POST['overwrite_categories'])) {
+ $mywms->overwriteCategories = false;
+ } else {
+ $mywms->overwriteCategories = true;
+ }
if ($useAuthentication) {
$mywms->updateObjInDB($myWMS,false, $changedLayerArray, $auth);
} else {
Modified: trunk/mapbender/http/php/mod_updateWMS.php
===================================================================
--- trunk/mapbender/http/php/mod_updateWMS.php 2013-10-24 06:23:07 UTC (rev 8730)
+++ trunk/mapbender/http/php/mod_updateWMS.php 2013-10-24 10:21:49 UTC (rev 8731)
@@ -167,6 +167,7 @@
"authPassword" : authPassword,
"publishRss" : $("#rss_news").attr("checked"),
"publishTwitter" : $("#twitter_news").attr("checked"),
+ "overwriteCategories" : $("#overwrite_categories").attr("checked"),
"dbOldNames": dbOldNameArray,
"dbCurrentNames": dbCurrentNameArray
};
@@ -441,6 +442,13 @@
if (defined("GEO_RSS_FILE") && GEO_RSS_FILE != "") {
echo"<input type='checkbox' name='rss_news' id='rss_news' checked='checked'>Publish via RSS<br>";
}
+ if (!MD_OVERWRITE) {
+ echo"<input type='checkbox' name='overwrite_md' id='overwrite_md'>Overwrite edited metadata - all changes wich are made via metadata editor will be lost!<br>";
+ } else {
+ echo"<input type='checkbox' name='overwrite_md' id='overwrite_md' checked='checked'>Overwrite edited metadata - all changes wich are made via metadata editor will be lost!<br>";
+ }
+
+ echo"<input type='checkbox' name='overwrite_categories' id='overwrite_categories'>Overwrite layer categories with categories from service (maybe avaiable from wms 1.3.0+)<br>";
echo"<input type='checkbox' name='compare_dialog' id='compare_dialog'><label for='compare_dialog'>Use compare dialog</label><br>";
echo "<input type='button' value='Preview Capabilities' onclick='window.open(this.form.myURL.value,\"\",\"\")'> ";
echo "<input type='button' value='Upload Capabilities' onclick='validate()'> ";
@@ -474,9 +482,13 @@
$mywms->optimizeWMS();
echo "<br />";
- if (!MD_OVERWRITE) {
+
+ //if (!MD_OVERWRITE) {
+ if(empty($_POST['overwrite_md'])) {
$mywms->overwrite=false;
- }
+ } else {
+ $mywms->overwrite=true;
+ }
//possibility to see update information in georss and/or twitter channel
if(empty($_POST['twitter_news'])) {
$mywms->twitterNews = false;
@@ -484,6 +496,11 @@
if(empty($_POST['rss_news'])) {
$mywms->setGeoRss = false;
}
+ if(empty($_POST['overwrite_categories'])) {
+ $mywms->overwriteCategories = false; //- is default for class_wms.php
+ } else {
+ $mywms->overwriteCategories = true;
+ }
//set values for default variables -> 4 parameters for authenticated services 3 for services without authentication - no metadataUpdate = false, changedLayers = null
if ($imrHttpAuth != 'none') {
$mywms->updateObjInDB($myWMS,false,null,$auth);
Modified: trunk/mapbender/http/plugins/mb_metadata_server.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_server.php 2013-10-24 06:23:07 UTC (rev 8730)
+++ trunk/mapbender/http/plugins/mb_metadata_server.php 2013-10-24 10:21:49 UTC (rev 8731)
@@ -573,33 +573,35 @@
if (defined("TWITTER_NEWS") && TWITTER_NEWS == true && $ajaxResponse->getParameter("twitterNews") == true) {
$wms->twitterNews = true;
$twitterIsConfigured = true;
- $e = new mb_exception("twitter configured");
+ //$e = new mb_exception("twitter configured");
} else {
+ $wms->twitterNews = false;
$twitterIsConfigured = false;
- $e = new mb_exception("twitter not configured");
+ //$e = new mb_exception("twitter not configured");
}
if(defined("GEO_RSS_FILE") && GEO_RSS_FILE != "" && $ajaxResponse->getParameter("setGeoRss") == true) {
$wms->setGeoRss = true;
$rssIsConfigured = true;
- $e = new mb_exception("rss configured");
+ //$e = new mb_exception("rss configured");
} else {
$rssIsConfigured = false;
$wms->setGeoRss = false;
- $e = new mb_exception("rss not configured");
+ //$e = new mb_exception("rss not configured");
}
$messResult = "Updated WMS metadata for ID " . $wmsId.". ";
//Add helpful hint if publishing is demanded, but not configured in mapbender.conf - do this before update object - cause otherwise it will not give back the right attributes
- if ($wms->twitterNews && !$twitterIsConfigured) {
+ if (!$wms->twitterNews && ($ajaxResponse->getParameter("twitterNews") == true)) {
$messResult .= " Publishing via twitter was requested, but this is not configured. Please check your mapbender.conf! ";
}
- if ($wms->setGeoRss && !$rssIsConfigured) {
+ if (!$wms->setGeoRss && ($ajaxResponse->getParameter("setGeoRss") == true)) {
$messResult .= " Publishing via rss was requested, but this is not configured. Please check your mapbender.conf! ";
}
//try {
$e = new mb_exception("update object in db");
- $wms->updateObjInDB($wmsId,true);
+ $wms->overwriteCategories = true;
+ $wms->updateObjInDB($wmsId,true);
//}
//catch (Exception $e) {
// $ajaxResponse->setSuccess(false);
Modified: trunk/mapbender/http/plugins/mb_wms_scheduler_select.js
===================================================================
--- trunk/mapbender/http/plugins/mb_wms_scheduler_select.js 2013-10-24 06:23:07 UTC (rev 8730)
+++ trunk/mapbender/http/plugins/mb_wms_scheduler_select.js 2013-10-24 10:21:49 UTC (rev 8731)
@@ -78,6 +78,9 @@
editFormHtml += "<fieldset><legend>Overwrite edited metadata:</legend>";
editFormHtml += "<input type='checkbox' id='scheduler_overwrite'/>";
editFormHtml += "</fieldset>";
+ editFormHtml += "<fieldset><legend>Overwrite edited layer categories:</legend>";
+ editFormHtml += "<input type='checkbox' id='scheduler_overwrite_categories'/>";
+ editFormHtml += "</fieldset>";
editFormHtml += "</form>";
editFormHtml += "</div>";
@@ -115,13 +118,19 @@
} else {
scheduler_overwrite = 0;
}
+ if ($('#scheduler_overwrite_categories').attr("checked") == true) {
+ scheduler_overwrite_categories = 1;
+ } else {
+ scheduler_overwrite_categories = 0;
+ }
data = {
scheduler_interval: $('#scheduler_interval').val(),
scheduler_publish: scheduler_publish,
wms_id: obj.wms_id,
scheduler_searchable: scheduler_searchable,
scheduler_mail: scheduler_mail,
- scheduler_overwrite: scheduler_overwrite
+ scheduler_overwrite: scheduler_overwrite,
+ scheduler_overwrite_categories: scheduler_overwrite_categories
};
//push infos to server
that.updateWmsSchedule(schedulerId, data);
@@ -153,6 +162,10 @@
if (obj.scheduler_overwrite == 1) {
$("#scheduler_overwrite").attr({'checked':'checked'});
}
+
+ if (obj.scheduler_overwrite_categories == 1) {
+ $("#scheduler_overwrite_categories").attr({'checked':'checked'});
+ }
}
});
req.send();
@@ -183,6 +196,9 @@
addFormHtml += "<fieldset><legend>Overwrite edited metadata:</legend>";
addFormHtml += "<input type='checkbox' id='scheduler_overwrite'/>";
addFormHtml += "</fieldset>";
+ addFormHtml += "<fieldset><legend>Overwrite edited layer categories:</legend>";
+ addFormHtml += "<input type='checkbox' id='scheduler_overwrite_categories'/>";
+ addFormHtml += "</fieldset>";
addFormHtml += "</form>";
addFormHtml += "</div>";
@@ -220,13 +236,20 @@
} else {
scheduler_overwrite = 0;
}
+ if ($('#scheduler_overwrite_categories').attr("checked") == true) {
+ scheduler_overwrite_categories = 1;
+ } else {
+ scheduler_overwrite_categories = 0;
+ }
+
data = {
scheduler_interval: $('#scheduler_interval').val(),
scheduler_publish: scheduler_publish,
wms_id: $("#scheduler_wms").val(),
scheduler_searchable: scheduler_searchable,
scheduler_mail: scheduler_mail,
- scheduler_overwrite: scheduler_overwrite
+ scheduler_overwrite: scheduler_overwrite,
+ scheduler_overwrite_categories: scheduler_overwrite_categories
};
//push infos to server
that.insertWmsSchedule(data);
Modified: trunk/mapbender/http/plugins/mb_wms_scheduler_server.php
===================================================================
--- trunk/mapbender/http/plugins/mb_wms_scheduler_server.php 2013-10-24 06:23:07 UTC (rev 8730)
+++ trunk/mapbender/http/plugins/mb_wms_scheduler_server.php 2013-10-24 10:21:49 UTC (rev 8731)
@@ -35,7 +35,7 @@
$wmsSchedulerList = implode(",", $wmsSchedulerIdArray);
$sql = <<<SQL
-SELECT scheduler_id, wms_id, wms_title, to_timestamp(wms_timestamp), last_status, fkey_upload_id, scheduler_interval,scheduler_mail,scheduler_publish,scheduler_searchable,scheduler_overwrite, scheduler_status FROM (SELECT scheduler_id, wms_id, fkey_wms_id, wms_title, wms_timestamp, scheduler_interval,scheduler_mail,scheduler_publish,scheduler_searchable,scheduler_overwrite,scheduler_status FROM scheduler INNER JOIN wms ON scheduler.fkey_wms_id=wms.wms_id WHERE scheduler.scheduler_id IN ($wmsSchedulerList)) AS test LEFT OUTER JOIN mb_wms_availability ON test.fkey_wms_id = mb_wms_availability.fkey_wms_id;
+SELECT scheduler_id, wms_id, wms_title, to_timestamp(wms_timestamp), last_status, fkey_upload_id, scheduler_interval,scheduler_mail,scheduler_publish,scheduler_searchable,scheduler_overwrite,scheduler_overwrite_categories, scheduler_status FROM (SELECT scheduler_id, wms_id, fkey_wms_id, wms_title, wms_timestamp, scheduler_interval,scheduler_mail,scheduler_publish,scheduler_searchable,scheduler_overwrite,scheduler_overwrite_categories,scheduler_status FROM scheduler INNER JOIN wms ON scheduler.fkey_wms_id=wms.wms_id WHERE scheduler.scheduler_id IN ($wmsSchedulerList)) AS test LEFT OUTER JOIN mb_wms_availability ON test.fkey_wms_id = mb_wms_availability.fkey_wms_id;
SQL;
$res = db_query($sql);
@@ -53,6 +53,7 @@
_mb("publish"),
_mb("searchable"),
_mb("overwrite"),
+ _mb("overwrite categories"),
_mb("update status"),
_mb("action")
),
@@ -75,7 +76,7 @@
$wmsSchedulerId = $ajaxResponse->getParameter("id");
$sql = <<<SQL
-SELECT scheduler_id, wms_id, wms_title, wms_owner, scheduler_interval,scheduler_mail,scheduler_publish, scheduler_overwrite, scheduler_searchable FROM scheduler INNER JOIN wms ON scheduler.fkey_wms_id=wms.wms_id WHERE scheduler.scheduler_id = $1;
+SELECT scheduler_id, wms_id, wms_title, wms_owner, scheduler_interval,scheduler_mail,scheduler_publish, scheduler_overwrite, scheduler_overwrite_categories, scheduler_searchable FROM scheduler INNER JOIN wms ON scheduler.fkey_wms_id=wms.wms_id WHERE scheduler.scheduler_id = $1;
SQL;
$v = array($wmsSchedulerId);
@@ -97,6 +98,7 @@
$resultObj["scheduler_mail"] = $row["scheduler_mail"];
$resultObj["scheduler_publish"] = $row["scheduler_publish"];
$resultObj["scheduler_overwrite"] = $row["scheduler_overwrite"];
+ $resultObj["scheduler_overwrite_categories"] = $row["scheduler_overwrite_categories"];
$resultObj["scheduler_searchable"] = $row["scheduler_searchable"];
}
$ajaxResponse->setResult($resultObj);
@@ -109,12 +111,12 @@
$sql = <<<SQL
INSERT INTO scheduler (scheduler_type,fkey_wms_id,scheduler_interval,scheduler_publish,
-scheduler_searchable,scheduler_overwrite,scheduler_mail,scheduler_change) VALUES
-('wms', $1, $2, $3, $4, $5, $6, now());
+scheduler_searchable,scheduler_overwrite,scheduler_overwrite_categories,scheduler_mail,scheduler_change) VALUES
+('wms', $1, $2, $3, $4, $5, $6, $7, now());
SQL;
- $v = array($data->wms_id, $data->scheduler_interval, $data->scheduler_publish, $data->scheduler_searchable, $data->scheduler_overwrite, $data->scheduler_mail);
- $t = array('i','s','i','i','i','i');
+ $v = array($data->wms_id, $data->scheduler_interval, $data->scheduler_publish, $data->scheduler_searchable, $data->scheduler_overwrite, $data->scheduler_overwrite_categories, $data->scheduler_mail);
+ $t = array('i','s','i','i','i','i','i');
try {
$res = db_prep_query($sql,$v,$t);
}
@@ -138,11 +140,11 @@
$sql = <<<SQL
-UPDATE scheduler SET scheduler_interval = $2, scheduler_publish = $3, scheduler_searchable = $4, scheduler_overwrite = $5, scheduler_mail = $6, scheduler_change = now() WHERE scheduler_id = $1
+UPDATE scheduler SET scheduler_interval = $2, scheduler_publish = $3, scheduler_searchable = $4, scheduler_overwrite = $5, scheduler_mail = $6, scheduler_overwrite_categories = $7, scheduler_change = now() WHERE scheduler_id = $1
SQL;
- $v = array($schedulerId, $data->scheduler_interval, $data->scheduler_publish, $data->scheduler_searchable, $data->scheduler_overwrite, $data->scheduler_mail);
- $t = array('i','s','i','i','i','i');
+ $v = array($schedulerId, $data->scheduler_interval, $data->scheduler_publish, $data->scheduler_searchable, $data->scheduler_overwrite, $data->scheduler_mail, $data->scheduler_overwrite_categories);
+ $t = array('i','s','i','i','i','i','i');
try {
$res = db_prep_query($sql,$v,$t);
}
@@ -158,7 +160,7 @@
$sql = <<<SQL
-SELECT scheduler_id, wms_id, wms_title, wms_owner, scheduler_interval,scheduler_mail,scheduler_publish, scheduler_overwrite, scheduler_searchable FROM scheduler INNER JOIN wms ON scheduler.fkey_wms_id=wms.wms_id WHERE scheduler.scheduler_id = $1;
+SELECT scheduler_id, wms_id, wms_title, wms_owner, scheduler_interval,scheduler_mail,scheduler_publish, scheduler_overwrite, scheduler_overwrite_categories, scheduler_searchable FROM scheduler INNER JOIN wms ON scheduler.fkey_wms_id=wms.wms_id WHERE scheduler.scheduler_id = $1;
SQL;
$v = array($schedulerId);
@@ -181,6 +183,7 @@
$resultObj["scheduler_mail"] = $row["scheduler_mail"];
$resultObj["scheduler_publish"] = $row["scheduler_publish"];
$resultObj["scheduler_overwrite"] = $row["scheduler_overwrite"];
+ $resultObj["scheduler_overwrite_categories"] = $row["scheduler_overwrite_categories"];
$resultObj["scheduler_searchable"] = $row["scheduler_searchable"];
}
$ajaxResponse->setResult($resultObj);
Modified: trunk/mapbender/tools/mod_runScheduler.php
===================================================================
--- trunk/mapbender/tools/mod_runScheduler.php 2013-10-24 06:23:07 UTC (rev 8730)
+++ trunk/mapbender/tools/mod_runScheduler.php 2013-10-24 10:21:49 UTC (rev 8731)
@@ -4,9 +4,9 @@
$sql = <<<SQL
SELECT scheduler_id, wms_id, wms_title, to_timestamp(wms_timestamp)::date AS last_change, last_status, fkey_upload_id, wms_upload_url,
-scheduler_interval,scheduler_mail,scheduler_publish,scheduler_searchable,scheduler_overwrite,
+scheduler_interval,scheduler_mail,scheduler_publish,scheduler_searchable,scheduler_overwrite, scheduler_overwrite_categories,
scheduler_status FROM (SELECT scheduler_id, wms_id, fkey_wms_id, wms_title, wms_timestamp,
-scheduler_interval,scheduler_mail,scheduler_publish,scheduler_searchable,scheduler_overwrite,
+scheduler_interval,scheduler_mail,scheduler_publish,scheduler_searchable,scheduler_overwrite,scheduler_overwrite_categories,
scheduler_status,wms_upload_url FROM scheduler
INNER JOIN wms ON scheduler.fkey_wms_id=wms.wms_id ) AS test
LEFT OUTER JOIN mb_wms_availability ON test.fkey_wms_id = mb_wms_availability.fkey_wms_id;
@@ -30,6 +30,7 @@
"scheduler_publish" => $row['scheduler_publish'],
"scheduler_searchable" => $row['scheduler_searchable'],
"scheduler_overwrite" => $row['scheduler_overwrite'],
+ "scheduler_overwrite_categories" => $row['scheduler_overwrite_categories'],
"scheduler_status" => $row['scheduler_status']
);
@@ -84,7 +85,13 @@
echo "overwrite md = false\n";
$updateWms->overwrite=false;
}
-
+ //check overwrite categories attribute
+ if (!$wmsToUpdate[$i]['scheduler_overwrite_categories']) {
+ echo "overwrite categories = false\n";
+ } else {
+ echo "overwrite categories = true\n";
+ $updateWms->overwriteCategories=true;
+ }
//check publish attribute for geoRss and twitter attribute in class_wms.php
if ($wmsToUpdate[$i]['scheduler_publish'] == 1) {
require_once dirname(__FILE__) . "/../http/classes/class_twitter.php";
@@ -97,7 +104,7 @@
$updateWms->setGeoRss=false;
echo "publish = false\n";
}
-
+ die();
$updateObjInDb = $updateWms->updateObjInDB($wmsToUpdate[$i]['wms_id']);
if(!$updateObjInDb) {
$errorMsg = "Error while updating wms object in database";
More information about the Mapbender_commits
mailing list