request("jrn","string", -1);
$request_ac=$http->request("ac","string", "");
$request_sa=$http->request("sa","string", "");
$get_jrn=$http->get('jrn',"string",-1);
echo '
';
echo '
';
// if $_REQUEST[sa] == del delete the predefined operation
if ( $request_sa == 'del')
{
$op=new Pre_operation($cn);
$http=new HttpInput();
$op->od_id=$http->request('od_id',"string",-1);
if (isNumber($op->od_id)==1 && $op->od_id != -1 )
{
$op->delete();
}
$request_sa='jrn';
}
// if $_REQUEST[sa] == jrn show the predefined operation for this
// ledger
if ( $request_sa== 'jrn' )
{
$op=new Pre_operation($cn);
$op->set_jrn($get_jrn);
$is_ods = $cn->get_value("select count(*)
from jrn_def where
jrn_def_id=$1
and jrn_def_type='ODS'", array($get_jrn));
$op->od_direct = ($is_ods > 0) ? 't' : 'f';
$array = $op->get_list_ledger();
if (empty($array) == true)
{
echo _("Aucun enregistrement");
return;
}
echo HtmlInput::filter_table('preod_table', '0', 0);
echo '
';
$count=0;
foreach ($array as $row )
{
if ( $count %2 == 0 )
echo '';
else
echo '
';
$count++;
echo ''.h($row['od_name']).' | ';
echo ''.h($row['od_description']).' | ';
echo '';
echo '';
echo ' | ';
$b=HtmlInput::button('mod'.$row['od_id'],"Modifier","onclick=\"mod_predf_op('".dossier::id()."','".$row['od_id']."');\"");
echo td($b);
echo '
';
}
echo '
';
}
echo '
';
?>