From 1d3f12bb1bf3c3bb7140e3d1b3de8b3531f56865 Mon Sep 17 00:00:00 2001 From: Furkan Date: Tue, 19 Mar 2024 12:24:47 +0000 Subject: [PATCH] #11583 - Done --- js/app/views/CatalogUI.js | 14 ++++---------- php/classes/TimeTableMgr.php | 8 ++++++++ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/js/app/views/CatalogUI.js b/js/app/views/CatalogUI.js index 763b65f..042e743 100644 --- a/js/app/views/CatalogUI.js +++ b/js/app/views/CatalogUI.js @@ -158,16 +158,10 @@ Ext.define('amdaUI.CatalogUI', { updateSurveyDates : function(res){ if (this.TTGrid.getStore().getTotalCount() <= 0) return; - - if(! this.object.get('surveyStart') ){ - this.object.set('surveyStart', res['minStart']); - this.status.isModified = true; - } - if(! this.object.get('surveyStop') ){ - this.object.set('surveyStop', res['maxStop']); - this.status.isModified = true; - } - }, + this.object.set('surveyStart', res['minStart']); + this.object.set('surveyStop', res['maxStop']); + this.status.isModified = true; + }, createTT: function (catId) { var ttObj = Ext.create('amdaModel.TimeTable'); diff --git a/php/classes/TimeTableMgr.php b/php/classes/TimeTableMgr.php index f9dfc2b..81c1029 100644 --- a/php/classes/TimeTableMgr.php +++ b/php/classes/TimeTableMgr.php @@ -541,6 +541,14 @@ class TimeTableMgr extends AmdaObjectMgr $this->objectDom->documentElement->appendChild($newInterval); } + // Update SurveyStart & SurveyStop + $surveyStartNodes = $objToGet->getElementsByTagName('surveyStart'); + $surveyStopNodes = $objToGet->getElementsByTagName('surveyStop'); + if ($surveyStartNodes->length > 0 && $surveyStopNodes->length > 0) { + $surveyStartNodes->item(0)->nodeValue = TimeUtils::stamp2iso($minStart); + $surveyStopNodes->item(0)->nodeValue = TimeUtils::stamp2iso($maxStop); + } + //save modifications $this->id = $id; $this->resFileName = USERTTDIR . $this->id . '.xml'; -- libgit2 0.21.2