0000165: Taille des détails opérations
0000006: Réécriture de ICard
This commit is contained in:
parent
625706bb12
commit
795396c547
5 changed files with 56 additions and 38 deletions
|
|
@ -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.='<form id="save_card" method="POST" onsubmit="this.ipopup=\''.$popup.'\';save_card(this);return false;" >';
|
||||
$r.='<form id="save_card" method="POST" onsubmit="this.ipopup=\''.$ctl.'\';save_card(this);return false;" >';
|
||||
$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.='<p class="notice"> Choississez la catégorie de fiche à laquelle vous aimeriez ajouter une fiche</p>';
|
||||
$isel=new ISelect('fd_id');
|
||||
$isel->value=$array;
|
||||
$popup=str_replace('_content','',$ctl);
|
||||
$r.='<form id="sel_type" method="GET" onsubmit="this.ipopup=\''.$popup.'\';dis_blank_card(this);return false;" >';
|
||||
$r.='<form id="sel_type" method="GET" onsubmit="this.ipopup='.$ctl.';dis_blank_card(this);return false;" >';
|
||||
$r.=dossier::hidden();
|
||||
$r.=(isset($ref))?HtmlInput::hidden('ref',1):'';
|
||||
$r.='<p>choisissez le type de fiche à ajouter</p>';
|
||||
|
||||
$r.=$isel->input();
|
||||
$r.='<p>';
|
||||
$r.=HtmlInput::submit('st','choix');
|
||||
$r.=HtmlInput::button('Annuler','Annuler'," onclick=\"removeDiv('$ctl')\" ");
|
||||
$r.='</p>';
|
||||
$r.='</form>';
|
||||
$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='<h2 class="notice">Fiche sauvée</h2>';
|
||||
$html.='<h2 class="notice">Fiche sauvée</h2>';
|
||||
$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;
|
||||
/*----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue