Task #1485 : by default the dialog box are fixed but can be moved

This commit is contained in:
Dany De Bontridder 2018-01-07 13:48:43 +01:00
parent 7a0bca608b
commit b5795ac97c
8 changed files with 31 additions and 24 deletions

View file

@ -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);

View file

@ -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;

View file

@ -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);

View file

@ -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 += '<div style="float:right;height:10px;display:block;margin-top:2px;margin-right:2px"><span id="pin_calc1"><a class="input_text" onclick="pin(\'calc1\')" id="close_div">&#8778;</a></span> <a onclick="removeDiv(\'calc1\');" href="javascript:void(0)" id="close_div">X</a></div>';
shtml += '<div style="float:right;height:10px;display:block;margin-top:2px;margin-right:2px"><span id="pin_calc1"><a class="input_text" onclick="pin(\'calc1\')" id="close_div">&#8853;</a></span> <a onclick="removeDiv(\'calc1\');" href="javascript:void(0)" id="close_div">X</a></div>';
shtml += '<div> <h2 class="title">Calculatrice</h2></div>';
shtml += '<form name="calc_line" method="GET" onSubmit="cal();return false;" >Calculatrice simplifiée: écrivez simplement les opérations que vous voulez puis la touche retour. exemple : 1+2+3*(1/5) <input class="input_text" type="text" size="30" id="inp" name="calculator"> <input type="button" value="Efface tout" class="button" onClick="Clean();return false;" > <input type="button" class="button" value="Fermer" onClick="removeDiv(\'calc1\')" >';
shtml += '</form><span class="highligth" style="display:block" id="sub_total"> Taper une formule (ex 20*5.1) puis enter </span><span style="display:block" id="listing"> </span>';
var obj = {id: sid, html: shtml,
drag: true, style: ''
drag: false, style: ''
};
add_div(obj);
this.document.getElementById('inp').focus();

View file

@ -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');
define ('ICONOFF','icon-off.png');
define ("PINDG","&#8853;");
define ("UNPINDG","&#8778;");

View file

@ -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('<span id="pin_%s" style="float:right;margin:0px;padding:0px;font-size:120%%;border-width:0px" ><a class="input_text" onclick="pin(\'%s\')" id="close_div">&#8778; </a></span>',
$drag=sprintf('<span id="pin_%s" style="float:right;margin:0px;padding:0px;font-size:120%%;border-width:0px" ><a class="input_text" onclick="pin(\'%s\')" id="close_div">'.PINDG.' </a></span>',
$p_div,
$p_div);
$r.=$drag;
$r.=$drag;
}
$r.=h2($p_name,' class="title" ');

View file

@ -9,6 +9,10 @@
$str=$_SERVER['QUERY_STRING']."&op=history&act=de&ajax=$callback";
echo '<A id="close_div" HREF="javascript:void(0)" onclick="var a=window.open(\'popup.php?'.$str.'\',\'\',\'fullscreen=yes,location=no,menubar=no,toolbar=no,scrollbars=yes,resizable=yes,statusbar=no,menubar=no,status=no,location=no\'); a.focus();removeDiv(\''.$div.'\')">&#11036
</A>';
printf('<span id="pin_%s" style="margin:0px;padding:0px;margin-right:6px;padding-top:2px;font-size:120%%;border-width:0px" ><a class="input_text" onclick="pin(\'%s\')" id="close_div">%s</a></span>',
$div,
$div,PINDG);
echo '<A id="close_div" HREF="javascript:void(0)" onclick="removeDiv(\''.$div.'\');">&#10761;</A>';
}
?>

View file

@ -18,9 +18,9 @@
echo '<A id="close_div" title="'.$msg_pop.'" onclick="var a=window.open(\'popup.php?'.$str.'\',\'\',\'titlebar=no,location=no,statusbar=no,menubar=no,toolbar=no,fullscreen=yes,scrollbars=yes,resizable=yes,status=no\'); a.focus();removeDiv(\''.$div.'\')">&#11036;
</A>';
printf('<span id="pin_%s" style="margin:0px;padding:0px;margin-right:6px;padding-top:2px;font-size:120%%;border-width:0px" ><a class="input_text" onclick="pin(\'%s\')" id="close_div">&#8778;</a></span>',
printf('<span id="pin_%s" style="margin:0px;padding:0px;margin-right:6px;padding-top:2px;font-size:120%%;border-width:0px" ><a class="input_text" onclick="pin(\'%s\')" id="close_div">%s</a></span>',
$div,
$div);
$div,PINDG);
echo '<A id="close_div" title="'.$msg_close.'" onclick="removeDiv(\''.$div.'\');">&#10761;</A>';
}
?>