From b5795ac97cbf55b2bf83b808f3c9c88bb6f41afa Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Sun, 7 Jan 2018 13:48:43 +0100 Subject: [PATCH] Task #1485 : by default the dialog box are fixed but can be moved --- html/js/acc_ledger.js | 16 ++++++++-------- html/js/accounting_item.js | 2 +- html/js/card.js | 12 ++++++------ html/js/scripts.js | 6 +++--- include/constant.php | 4 +++- include/lib/html_input.class.php | 7 ++++--- include/template/history_top.php | 4 ++++ include/template/ledger_detail_top.php | 4 ++-- 8 files changed, 31 insertions(+), 24 deletions(-) diff --git a/html/js/acc_ledger.js b/html/js/acc_ledger.js index 533f6d2ed..5257ed2c2 100644 --- a/html/js/acc_ledger.js +++ b/html/js/acc_ledger.js @@ -659,10 +659,10 @@ function go_next_concerned() function view_history_account(p_value, dossier) { layer++; - id = 'det' + layer; - var popup = {'id': id, 'cssclass': 'inner_box', 'html': loading(), 'drag': true}; + var idbox = 'det' + layer; + var popup = {'id': idbox, 'cssclass': 'inner_box', 'html': loading(), 'drag': false}; - var querystring={'gDossier':dossier,'act':'de','pcm_val':p_value,'div':id,'l':layer,'op':'history'}; + var querystring={'gDossier':dossier,'act':'de','pcm_val':p_value,'div':idbox,'l':layer,'op':'history'}; waiting_box(); var action = new Ajax.Request( @@ -725,15 +725,15 @@ function update_history_account(obj) function view_history_card(p_value, dossier) { layer++; - id = 'det' + layer; - var popup = {'id':id, + var idbox = 'det' + layer; + var popup = {'id':idbox, 'cssclass': 'inner_box', 'html':loading(), - 'drag':true}; + 'drag':false}; var querystring = { 'gDossier' : dossier , 'act':'de', 'f_id' : p_value , - 'div' : id , + 'div' : idbox , "l" : layer, "op":"history"}; waiting_box(); @@ -862,7 +862,7 @@ function modifyOperation(p_value, dossier) onFailure: error_box, onSuccess: function (xml, txt) { var popup = {'id': id_div, 'cssclass': 'inner_box' - , 'html': "", 'drag': true}; + , 'html': "", 'drag': false}; remove_waiting_box(); add_div(popup); success_box(xml, txt); diff --git a/html/js/accounting_item.js b/html/js/accounting_item.js index 4694f73c5..80cae00f4 100644 --- a/html/js/accounting_item.js +++ b/html/js/accounting_item.js @@ -64,7 +64,7 @@ function search_poste(obj) var div_style="top:"+sx+"px"; removeDiv('search_account'); - add_div({id:'search_account',cssclass:'inner_box',html:loading(),style:div_style,drag:true}); + add_div({id:'search_account',cssclass:'inner_box',html:loading(),style:div_style,drag:false}); var dossier=$('gDossier').value; diff --git a/html/js/card.js b/html/js/card.js index 936c470f3..bc941e6ae 100644 --- a/html/js/card.js +++ b/html/js/card.js @@ -317,8 +317,8 @@ function result_card_search(req) sx=document.body.scrollTop+60; } - var div_style="top:"+sx+"px;height:80%"; - add_div({id:'search_card',cssclass:'inner_box',html:"",style:div_style,drag:true,effect:'blinddown'}); + var div_style="top:"+sx+"px;height:auto"; + add_div({id:'search_card',cssclass:'inner_box',html:"",style:div_style,drag:false,effect:'blinddown'}); $('search_card').innerHTML=code_html; @@ -459,7 +459,7 @@ function fill_ipopcard(obj) var str_top=fixed_position(250,nTop) var str_style=str_top+";width:45em;height:auto;position:absolute"; - var popup={'id': content,'cssclass':'inner_box','style':str_style,'html':loading(),'drag':true}; + var popup={'id': content,'cssclass':'inner_box','style':str_style,'html':loading(),'drag':false}; add_div(popup); var dossier=$('gDossier').value; @@ -486,7 +486,7 @@ function fill_ipopcard(obj) if ( obj.nohistory != undefined) { queryString+='&nohistory'; } - + queryString=encodeURI(queryString); var action=new Ajax.Request ( 'ajax_misc.php', { method:'get', @@ -570,7 +570,7 @@ function select_card_type(obj) var str_style="top:"+sx+"px;height:auto"; waiting_box(); - var popup={'id': content,'cssclass':'inner_box','style':str_style,'html':"",'drag':true}; + var popup={'id': content,'cssclass':'inner_box','style':str_style,'html':"",'drag':false}; add_div(popup); @@ -658,7 +658,7 @@ function dis_blank_card(obj) var nLeft=posX; var str_style="top:"+nTop+"px;right:"+nLeft+"px;height:auto"; - var popup={'id': content,'cssclass':'inner_box','style':str_style,'html':loading(),'drag':true}; + var popup={'id': content,'cssclass':'inner_box','style':str_style,'html':loading(),'drag':false}; add_div(popup); diff --git a/html/js/scripts.js b/html/js/scripts.js index 766792083..b09ebdd6c 100644 --- a/html/js/scripts.js +++ b/html/js/scripts.js @@ -524,7 +524,7 @@ function popup_select_tva(obj) var nLeft = "15%"; var str_style = "top:" + nTop + "px;left:" + nLeft + ";right:" + nLeft + ";width:55em;height:auto"; - var popup = {'id': 'tva_select', 'cssclass': 'inner_box', 'style': str_style, 'html': code_html, 'drag': true}; + var popup = {'id': 'tva_select', 'cssclass': 'inner_box', 'style': str_style, 'html': code_html, 'drag': false}; add_div(popup); $('lk_tva_select_table').focus(); } @@ -1071,13 +1071,13 @@ function show_calc() } var sid = 'calc1'; var shtml = ''; - shtml += '
X
'; + shtml += '
X
'; shtml += '

Calculatrice

'; shtml += '
Calculatrice simplifiée: écrivez simplement les opérations que vous voulez puis la touche retour. exemple : 1+2+3*(1/5) '; shtml += '
Taper une formule (ex 20*5.1) puis enter '; var obj = {id: sid, html: shtml, - drag: true, style: '' + drag: false, style: '' }; add_div(obj); this.document.getElementById('inp').focus(); diff --git a/include/constant.php b/include/constant.php index 3e44862b2..73eaab295 100644 --- a/include/constant.php +++ b/include/constant.php @@ -310,4 +310,6 @@ define ('EXC_PARAM_VALUE',1005); define ('EXC_PARAM_TYPE',1006); define ('EXC_DUPLICATE',1200); define ('ICONON','icon-on.png'); -define ('ICONOFF','icon-off.png'); \ No newline at end of file +define ('ICONOFF','icon-off.png'); +define ("PINDG","⊕"); +define ("UNPINDG","≊"); \ No newline at end of file diff --git a/include/lib/html_input.class.php b/include/lib/html_input.class.php index 33307eedd..9bf93493b 100755 --- a/include/lib/html_input.class.php +++ b/include/lib/html_input.class.php @@ -785,7 +785,7 @@ class HtmlInput * @param type $p_draggable , if set to yes the box will be draggable * @return type */ - static function title_box($p_name,$p_div,$p_mod="close",$p_js="",$p_draggable="y") + static function title_box($p_name,$p_div,$p_mod="close",$p_js="",$p_draggable="n") { $r=""; if ($p_mod=='close'){ @@ -810,11 +810,12 @@ class HtmlInput else die (__FILE__.":".__LINE__._('Paramètre invaide')); + // If draggable : display a icon to unpin and move the dialog box if ( $p_draggable=="y") { - $drag=sprintf('', + $drag=sprintf(''.PINDG.' ', $p_div, $p_div); - $r.=$drag; + $r.=$drag; } $r.=h2($p_name,' class="title" '); diff --git a/include/template/history_top.php b/include/template/history_top.php index 259318c10..47a1bf6ff 100644 --- a/include/template/history_top.php +++ b/include/template/history_top.php @@ -9,6 +9,10 @@ $str=$_SERVER['QUERY_STRING']."&op=history&act=de&ajax=$callback"; echo ''; + printf('%s', + $div, + $div,PINDG); + echo ''; } ?> diff --git a/include/template/ledger_detail_top.php b/include/template/ledger_detail_top.php index 3327ab412..85c7a3f57 100644 --- a/include/template/ledger_detail_top.php +++ b/include/template/ledger_detail_top.php @@ -18,9 +18,9 @@ echo ''; - printf('', + printf('%s', $div, - $div); + $div,PINDG); echo ''; } ?>