diff --git a/html/ajax_card.php b/html/ajax_card.php
index fd985ff8e..9535633ea 100644
--- a/html/ajax_card.php
+++ b/html/ajax_card.php
@@ -139,9 +139,13 @@ case 'bc':
if ( $user->check_action(FICADD)==1 )
{
$r='';
+ $r=HtmlInput::button_close($ctl);
+ /* get cat. name */
+ $cat_name=$cn->get_value('select fd_label from fiche_def where fd_id=$1',
+ array($fd_id));
+ $r.=h2info(_('Nouvelle fiche ').$cat_name);
$f=new Fiche($cn);
- $popup=str_replace('_content','',$ctl);
- $r.='
';
- $html=$r;
+ $html.=$r;
+
}
break;
/*----------------------------------------------------------------------
@@ -231,11 +241,13 @@ case 'st':
*
----------------------------------------------------------------------*/
case 'sc':
+ $html=HtmlInput::button_close($ctl);
+ $html.=h2info('Nouvelle fiche');
if ( $user->check_action(FICADD)==1 )
{
$f=new Fiche($cn);
$f->insert($fd_id,$_POST);
- $html='Fiche sauvée
';
+ $html.='Fiche sauvée
';
$html.=$f->Display(true);
$js="";
if ( isset( $_POST['ref'])) $js=create_script(' window.location.reload()');
@@ -243,7 +255,7 @@ case 'sc':
}
else
{
- $html=alert(_('Action interdite'),true);
+ $html.=alert(_('Action interdite'),true);
}
break;
/*----------------------------------------------------------------------
diff --git a/html/js/acc_ledger.js b/html/js/acc_ledger.js
index 8dc7c3b0e..7aac18f6f 100644
--- a/html/js/acc_ledger.js
+++ b/html/js/acc_ledger.js
@@ -690,7 +690,7 @@ function modifyOperation(p_value,dossier)
{
layer++;
id='det'+layer;
-var popup={'id':
+ var popup={'id':
id,'cssclass':'op_detail'
,'html':
loading(),'drag':
@@ -707,7 +707,7 @@ var popup={'id':
}
);
g(id).style.top=posY-40;
- g(id).style.left=posX-10;
+ g(id).style.left=300;
}
diff --git a/html/js/accounting_item.js b/html/js/accounting_item.js
index c757a3fec..76c20cec5 100644
--- a/html/js/accounting_item.js
+++ b/html/js/accounting_item.js
@@ -76,7 +76,7 @@ function search_poste(obj)
}
var div_style="z-index:15;top:"+sx;
- add_div({id:'search_account',cssclass:'op_detail',html:loading(),style:div_style});
+ add_div({id:'search_account',cssclass:'op_detail',html:loading(),style:div_style,drag:true});
var dossier=$('gDossier').value;
diff --git a/html/js/card.js b/html/js/card.js
index 5c9414be7..568cbd118 100644
--- a/html/js/card.js
+++ b/html/js/card.js
@@ -377,14 +377,7 @@ function successFill_ipopcard(req,json)
*/
function select_card_type(obj)
{
- if ( ! $(obj).ipopup)
- {
- alert('Erreur pas d\' attribut ipopup '+obj.id);
- return;
- };
- var content=$(obj).ipopup+'_content';
- $(content).innerHTML=loading();
- showIPopup($(obj).ipopup);
+
var dossier=$('gDossier').value;
// give a filter, -1 if not
@@ -393,7 +386,23 @@ function select_card_type(obj)
{
filter=-1;
}
+ var content="select_card_div";
+ if ( $(content)){ removeDiv(content);}
+ var sx=0;
+ if ( window.scrollY)
+ {
+ sx=window.scrollY+40;
+ }
+ else
+ {
+ sx=document.body.scrollTop+60;
+ }
+ var str_style="top:"+sx+";left:10%;width:80%;height:auto";
+
+ var popup={'id': content,'cssclass':'op_detail','style':str_style,'html':loading(),'drag':true};
+
+ add_div(popup);
var queryString='?gDossier='+dossier;
queryString+='&ctl='+content;
@@ -426,7 +435,7 @@ function select_card_type(obj)
method:'get',
parameters:queryString,
onFailure:errorFid,
- onSuccess:successFill_ipopcard
+ onSuccess:fill_box
}
);
}
@@ -440,11 +449,6 @@ function select_card_type(obj)
*/
function dis_blank_card(obj)
{
- if ( ! $(obj).ipopup)
- {
- alert('Erreur pas d\' attribut ipopup '+obj.id);
- return;
- };
// first we have to take the form elt we need
var fd_id=$F('fd_id');
var ref="";
@@ -452,9 +456,16 @@ function dis_blank_card(obj)
{
ref='&ref';
}
- var content=$(obj).ipopup+'_content';
- $(content).innerHTML=loading();
- showIPopup($(obj).ipopup);
+ var content='div_new_card';
+ var nTop=posY-40;
+ var nLeft=posX-20;
+ var str_style="top:"+nTop+";left:"+nLeft+";width:35em;height:auto";
+
+ var popup={'id': content,'cssclass':'op_detail','style':str_style,'html':loading(),'drag':true};
+ if ( $(content)) {removeDiv(content);}
+ add_div(popup);
+
+
var dossier=$('gDossier').value;
var queryString='?gDossier='+dossier;
@@ -480,16 +491,11 @@ function dis_blank_card(obj)
*/
function save_card(obj)
{
- if ( ! $(obj).ipopup)
- {
- alert('Erreur pas d\' attribut ipopup '+obj.id);
- return;
- };
- var content=$(obj).ipopup+'_content';
+ var content=$(obj).ipopup;
// Data must be taken here
data=$('save_card').serialize(false);
$(content).innerHTML=loading();
- showIPopup($(obj).ipopup);
+
var dossier=$('gDossier').value;
var queryString='?gDossier='+dossier;
queryString+='&ctl='+content;
@@ -501,7 +507,7 @@ function save_card(obj)
method:'post',
parameters:queryString,
onFailure:errorFid,
- onSuccess:successFill_ipopcard
+ onSuccess:fill_box
}
);
}
diff --git a/html/js/scripts.js b/html/js/scripts.js
index b375d6fca..e37d56a1d 100644
--- a/html/js/scripts.js
+++ b/html/js/scripts.js
@@ -717,7 +717,7 @@ function success_box(req,json)
g(name_ctl).style.height='auto';
// if IE set to 60 %
if(name_ctl != 'popup')
- g(name_ctl).style.width='45%';
+ g(name_ctl).style.width='50%';
else
g(name_ctl).style.width='auto';
}