request("sa", "string", "anc_menu");
//---------------------------------------------------------------------------
// action
// Compute the redcontent div
//---------------------------------------------------------------------------
// show the form for adding a pa
if ($sa=="add_pa")
{
$new=new Anc_Plan($cn);
if ($new->isAppend()==true)
{
$ret.= '
';
$ret.=HtmlInput::title_box(_('Nouveau plan'), '', 'none');
$ret.= '';
$ret.= '
';
}
else
{
$ret.= '';
$ret.= '
'._("Mise à jour").'
';
$ret.= '
';
/**
* Detail now
*/
$count=0;
$new=new Anc_Plan($cn, $_REQUEST['pa_id']);
$new->get();
$array=$new->get_poste_analytique(" order by po_name");
$ret.='
';
$ret.='
';
$ret.="";
$ret.="| "._("Nom")." ";
$ret.=" | "._("Montant")." ";
$ret.=" | "._("Description")." ";
$ret.=" | "._("Groupe")." | ";
$ret.=""._("Plan A")." ";
$ret.=" |
";
$class="";
foreach ($array as $obj)
{
$count++;
if ($count%2==0)
$class="even";
else
$class="odd";
$ret.="";
$ret.="| ".
''.
h($obj->name).
'';
" | "
;
$ret.="".$obj->amount." | ";
$ret.="".h($obj->description)." | ";
$ret.="".$obj->ga_id." | ";
$ret.="".h($new->name)." | ";
$ret.="
";
}
$ret.="
";
// ---> montre form pour ajouter po
$ret.=HtmlInput::button_anchor(_('Ajout'),
"?ac=".$_REQUEST['ac']."&sa=po_add&pa_id=".$_GET['pa_id']."&".$str_dossier,
'', '', 'smallbutton');
$href=http_build_query(array('ac'=>$_REQUEST['ac'], 'gDossier'=>$_REQUEST['gDossier']));
$ret.= '
'._('Retour').'';
$ret.= '
';
}
//---------------------------------------------------------------------------
// Show lmenu
//
//---------------------------------------------------------------------------
if ($sa=='anc_menu')
{
$obj=new Anc_Plan($cn);
$list=$obj->get_list();
if (empty($list))
{
echo '
';
if (!isset($_REQUEST['sa']))
echo '
'.
_("Aucun plan analytique n'est défini").
'
';
}
else
{
echo '
';
}
}
//---------------------------------------------------------------------------
// show the content part
//
//
//---------------------------------------------------------------------------
echo $ret;