From 7336525021488cb34e2ec117c36b5935385bdb81 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Tue, 21 Mar 2023 16:56:35 +0100 Subject: [PATCH] - rueckstelldatum default zwei wochen --- .../system/infocenter/Rueckstellung.php | 21 +----------- public/js/infocenter/rueckstellung.js | 32 +++---------------- 2 files changed, 5 insertions(+), 48 deletions(-) diff --git a/application/controllers/system/infocenter/Rueckstellung.php b/application/controllers/system/infocenter/Rueckstellung.php index c30c258ba..c45e187ad 100644 --- a/application/controllers/system/infocenter/Rueckstellung.php +++ b/application/controllers/system/infocenter/Rueckstellung.php @@ -104,26 +104,7 @@ class Rueckstellung extends Auth_Controller $this->outputJsonSuccess(getData($result)); } - - /** - * Gets the End date of the current Studienjahr - */ - public function getStudienjahrEnd() - { - $this->load->model('organisation/studienjahr_model', 'StudienjahrModel'); - - $result = $this->_ci->StudienjahrModel->getCurrStudienjahr(); - - $json = null; - - if (hasData($result)) - { - $json = $result->retval[0]->ende; - } - - $this->outputJsonSuccess(array($json)); - } - + /** * Retrieve the UID of the logged user and checks if it is valid */ diff --git a/public/js/infocenter/rueckstellung.js b/public/js/infocenter/rueckstellung.js index dbecb99f8..adc99f439 100644 --- a/public/js/infocenter/rueckstellung.js +++ b/public/js/infocenter/rueckstellung.js @@ -111,33 +111,6 @@ var Rueckstellung = { } ); }, - getStudienjahrEnd: function() - { - FHC_AjaxClient.ajaxCallGet( - CONTROLLER_RUECKSTELLUNG_URL + "/getStudienjahrEnd", - null, - { - successCallback: function(data, textStatus, jqXHR) { - if (FHC_AjaxClient.hasData(data)) - { - var engdate = $.datepicker.parseDate("yy-mm-dd", FHC_AjaxClient.getData(data)[0]); - - if (engdate.getDate() === 31) - engdate.setDate(engdate.getDate() - 1); - engdate.setMonth(engdate.getMonth() + 3); - - var gerdate = $.datepicker.formatDate("dd.mm.yy", engdate); - $("#rueckstellungdate").val(gerdate); - } - }, - errorCallback: function() - { - FHC_DialogLib.alertError("error when getting Studienjahr end"); - }, - veilTimeout: 0 - } - ); - }, _refreshRueckstellung: function(rueckstellungobj) { var personid = $("#hiddenpersonid").val(); @@ -189,7 +162,10 @@ var Rueckstellung = { ''); Rueckstellung.getStatus(); - Rueckstellung.getStudienjahrEnd(); + + var rueckstelldate = new Date(); + rueckstelldate.setDate(rueckstelldate.getDate() + 14); + $('#rueckstellungdate').attr("value", $.datepicker.formatDate("dd.mm.yy", rueckstelldate)); $("#rueckstellungdate").datepicker({ "dateFormat": "dd.mm.yy",