';
echo JS_SEARCH_CARD;
// Add hidden tag
echo ''.
'
';
}
}
//--------------------------------------------------------------------------------
// Show the detail of an action
// permit the update
if ( $sub_action=='detail' )
{
echo '';
echo '';
$act=new action($cn);
$act->ag_id=$_REQUEST['ag_id'];
echo $act->get();
$act->ag_comment=Decode($act->ag_comment);
echo '';
echo '';
echo $retour;
echo '
';
}
//-------------------------------------------------------------------------------
// Delete an action
if ( $sub_action == 'delete' )
{
// first the confirmation
if ( ! isset ($_POST['confirm_delete']))
{
echo '';
echo '';
$act=new action($cn);
$act->ag_id=$_REQUEST['ag_id'];
echo $act->get();
$act->ag_comment=Decode($act->ag_comment);
echo JS_SEARCH_CARD;
echo $act->display('READ',false);
// display the form
echo '';
echo '
';
}
else
{
// confirmed
$act=new action($cn);
$act->ag_id=$_REQUEST['ag_id'];
$act->remove();
$sub_action="list";
}
}
//--------------------------------------------------------------------------------
// Show a list of the action
if ( $sub_action == "list" )
ShowActionList($cn,$retour,$h_url);
//--------------------------------------------------------------------------------
// Add an action
if ( $sub_action == "add_action" )
{
echo '';
echo_debug('action',__LINE__,var_export($_POST,true));
echo $retour;
$act=new action($cn);
$act->ag_id=0;
$act->ag_ref_ag_id=(isset($_POST['ag_ref_ag_id']))?$_POST['ag_ref_ag_id']:"0";
$act->ag_timestamp=(isset($_POST['ag_timestamp']))?$_POST['ag_timestamp']:"";
$act->qcode_dest=(isset($_POST['qcode_dest']))?$_REQUEST['qcode_dest']:"";
$act->qcode_exp=(isset($_POST['qcode_exp']))?$_REQUEST['qcode_exp']:"";
$act->f_id_dest=(isset($_POST['f_id_dest']))?$_POST['f_id_dest']:0;
$act->f_id_exp=(isset($_POST['f_id_exp']))?$_POST['f_id_exp']:0;
$act->d_id=0;
$act->dt_id=isset($_POST['dt_id'])?$_REQUEST['dt_id']:"";
$act->d_state=(isset($_POST['d_state']))?$_POST['d_state']:"";
$act->ag_ref="";
$act->ag_title=(isset($_POST['ag_title']))?$_POST['ag_title']:"";
echo '';
echo JS_SEARCH_CARD;
// Add hidden tag
echo ''.
'
';
}
//--------------------------------------------------------------------------------
// Save Action
// Stage 2 : Save the action and propose to save a file
//--------------------------------------------------------------------------------
if ( $sub_action == "save_action_st2" )
{
$act=new action($cn);
$act->ag_comment=$_POST['ag_comment'];
$act->ag_timestamp=$_POST['ag_timestamp'];
$act->d_state=$_POST['d_state'];
$act->dt_id=$_POST['dt_id'];
$act->qcode_dest=$_POST['qcode_dest'];
$act->qcode_exp=$_POST['qcode_exp'];
$act->f_id_dest=$_POST['f_id_dest'];
$act->f_id_exp=$_POST['f_id_exp'];
$act->ag_title=$_POST['ag_title'];
$act->d_id=0;
$act->ag_ref_ag_id=(isset($_POST['ag_ref_ag_id']))?$_POST['ag_ref_ag_id']:0;
$act->md_id=(isset($_POST['gen_doc']))?$_POST['gen_doc']:0;
$act->gen=isset($_POST['p_gen'])?'on':'off';
// insert into action_gestion
echo $act->SaveStage2();
echo '';
}
//--------------------------------------------------------------------------------
// Save Document
// Stage 3 : Save the document
//--------------------------------------------------------------------------------
if ( $sub_action == "save_action_st3" )
{
echo_debug("action.inc.php",__LINE__,'Stage 3');
$act=new action($cn);
$act->ag_id=$_POST['ag_id'];
$act->ag_ref_ag_idid=$_POST['ag_ref_ag_id'];
$act->ag_comment=$_POST['ag_comment'];
$act->ag_timestamp=$_POST['ag_timestamp'];
$act->d_state=$_POST['d_state'];
$act->dt_id=$_POST['dt_id'];
$act->qcode_dest=$_POST['qcode_dest'];
$act->qcode_exp=$_POST['qcode_exp'];
$act->ag_title=$_POST['ag_title'];
$d_id=(isset($_POST['d_id']))?$_POST['d_id']:0;
$act->ag_ref_ag_id=(isset($_POST['ag_ref_ag_id']))?$_POST['ag_ref_ag_id']:0;
echo $act->SaveStage3($d_id);
ShowActionList($cn,$retour,$h_url);
}
//---------------------------------------------------------------------
echo "