From 795396c547552df505b9ab0bccb1745129b8c96f Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Tue, 7 Dec 2010 20:10:34 +0000 Subject: [PATCH] =?UTF-8?q?0000165:=20Taille=20des=20d=C3=A9tails=20op?= =?UTF-8?q?=C3=A9rations=200000006:=20R=C3=A9=C3=A9criture=20de=20ICard?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- html/ajax_card.php | 30 ++++++++++++++------ html/js/acc_ledger.js | 4 +-- html/js/accounting_item.js | 2 +- html/js/card.js | 56 +++++++++++++++++++++----------------- html/js/scripts.js | 2 +- 5 files changed, 56 insertions(+), 38 deletions(-) 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.='
'; + $r.=''; $r.=dossier::hidden(); $r.=(isset($ref))?HtmlInput::hidden('ref',1):''; $r.=HtmlInput::hidden('fd_id',$fd_id); @@ -203,26 +207,32 @@ case 'st': } } $array=$cn->make_array($sql); + $html=HtmlInput::button_close('select_card_div'); + $html.=h2info('Choix de la catégorie'); if ( empty($array)) { - $html=_("Aucune catégorie de fiche ne correspondant à". + $html.=_("Aucune catégorie de fiche ne correspondant à". " votre demande"); $html.=$sql; } else { $r=''; + $html.='

Choississez la catégorie de fiche à laquelle vous aimeriez ajouter une fiche

'; $isel=new ISelect('fd_id'); $isel->value=$array; - $popup=str_replace('_content','',$ctl); - $r.=''; + $r.=''; $r.=dossier::hidden(); $r.=(isset($ref))?HtmlInput::hidden('ref',1):''; - $r.='

choisissez le type de fiche à ajouter

'; + $r.=$isel->input(); + $r.='

'; $r.=HtmlInput::submit('st','choix'); + $r.=HtmlInput::button('Annuler','Annuler'," onclick=\"removeDiv('$ctl')\" "); + $r.='

'; $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'; }