From a2dcdec1b52b10f647f0d2c45fa5f68f8b312985 Mon Sep 17 00:00:00 2001 From: sparkyx Date: Mon, 14 Nov 2022 22:35:10 +0100 Subject: [PATCH] Clean code : dead code, improve debug,comments --- html/do.php | 3 +++ html/js/noalyss_script.js | 34 ++++++--------------------- include/class/anc_operation.class.php | 3 ++- include/template/detail-action.php | 5 +++- 4 files changed, 16 insertions(+), 29 deletions(-) diff --git a/html/do.php b/html/do.php index 67b115ada..d24e5bf0d 100644 --- a/html/do.php +++ b/html/do.php @@ -58,6 +58,9 @@ $g_user = new Noalyss_user($cn); $http=new HttpInput(); IDate::set_firstDate($g_user->get_first_week_day()); +// check that the current user is saved into PostgreSQL setting in order to use it in PLPGSQL +\Noalyss\Dbg::echo_var(1,sprintf("current user is [%s]",$cn->get_value("select current_setting('noalyss.user_login')"))); + /* * check that the database is not empty */ diff --git a/html/js/noalyss_script.js b/html/js/noalyss_script.js index 08f2ee20e..3ab255ba2 100644 --- a/html/js/noalyss_script.js +++ b/html/js/noalyss_script.js @@ -3058,7 +3058,7 @@ function unselect_other_tab(p_tab) } } catch (e) { if (console) - console.log(e.message); + console.error(e.message); alert_box('unselect_other_tab ' + e.message); } } @@ -3870,26 +3870,7 @@ function json_concat(p_json1,p_json2) } -/** - * return a json object which is the merge of the 2 json objects - * from 2015 : Object.assign(obj1, obj2); - * @param p_json1 object 1 to merge - * @param p_json2 object 2 to merge - * @returns new json object - */ -function json_concat(p_json1,p_json2) -{ - var result = {}; - for (var key in p_json1) { - result[key] = p_json1[key]; - } - for (var key in p_json2) { - result[key] = p_json2[key]; - } - return result; - -} /** * this function unchecks other checkbox , it mimics the way a radio behaves * @param string p_click is the DOM id of the checkbox you clicked @@ -3912,7 +3893,6 @@ function uncheck_other(p_click,p_name) var operation_tag = function (p_div) { this.ctl = p_div; - console.log("ctl "+p_div); /** * Show a list of tag which can be added to the current followup document * @param {type} p_dossier @@ -3976,7 +3956,6 @@ var operation_tag = function (p_div) onFailure: ajax_misc_failure, onSuccess: function (req, j) { var answer = req.responseXML; - console.log("1-ctl "+ctl); var html = answer.getElementsByTagName('code'); if (html.length === 0) { @@ -4004,7 +3983,6 @@ var operation_tag = function (p_div) this.remove = function (p_dossier, p_jrn_id, t_id) { var ctl=this.ctl; - console.log("remove-1.ctl "+ctl); confirm_box(null, content[50], function () { try { waiting_box(); @@ -4026,7 +4004,6 @@ var operation_tag = function (p_div) var code_html = getNodeText(html[0]); code_html = unescape_xml(code_html); remove_waiting_box(); - console.log("remove-2.ctl "+ctl); $('operation_tag_td'+ctl).innerHTML = code_html; } @@ -4050,11 +4027,14 @@ function check_file_size(p_object,p_max_size) var sum_file=0; for(var i=0;i read/write otherwise 0==>readonly diff --git a/include/template/detail-action.php b/include/template/detail-action.php index 595d370ea..8bcab2cfb 100644 --- a/include/template/detail-action.php +++ b/include/template/detail-action.php @@ -1,9 +1,12 @@ 1 ){ echo __DIR__."/".__FILE__;} + //This file is part of NOALYSS and is under GPL //see licence.txt $uniq=uniqid("tab",TRUE); ?>
+