svn+ssh://danydb@svn/svn/phpcompta/branches/rel430 ........ r2258 | danydb | 2008-12-18 23:21:00 +0100 (Thu, 18 Dec 2008) | 1 line Add debug ........ r2262 | danydb | 2008-12-19 22:38:25 +0100 (Fri, 19 Dec 2008) | 1 line Add a local admin ........ r2270 | danydb | 2008-12-21 20:11:26 +0100 (Sun, 21 Dec 2008) | 1 line Doc. remove the useless todo list ........ r2271 | danydb | 2008-12-22 21:18:46 +0100 (Mon, 22 Dec 2008) | 3 lines Remove obsolete functions insertRapt, deleteRapt and getconcerned Remove obsolete file user_update ........ r2272 | danydb | 2008-12-22 21:21:46 +0100 (Mon, 22 Dec 2008) | 2 lines Remove obsolete function isFicheOfJrn ........ r2273 | danydb | 2008-12-22 21:44:28 +0100 (Mon, 22 Dec 2008) | 1 line Improve Invoice : add the username ........ r2287 | danydb | 2009-01-13 21:37:07 +0100 (Tue, 13 Jan 2009) | 1 line Code cleaning replace GetConcerned by Acc_Reconciliation ........ r2288 | danydb | 2009-01-13 21:38:40 +0100 (Tue, 13 Jan 2009) | 1 line Add a comment on jrn operation ........ r2289 | danydb | 2009-01-13 21:40:13 +0100 (Tue, 13 Jan 2009) | 1 line Code cleaning : add comments to the code ........ r2290 | danydb | 2009-01-13 21:40:46 +0100 (Tue, 13 Jan 2009) | 1 line Code cleaning replace GetConcerned by Acc_Reconciliation ........ r2291 | danydb | 2009-01-13 21:41:35 +0100 (Tue, 13 Jan 2009) | 1 line Code cleaning replace GetConcerned by Acc_Reconciliation ........ r2292 | danydb | 2009-01-13 21:42:15 +0100 (Tue, 13 Jan 2009) | 1 line Add documentation about new tags ........ r2293 | danydb | 2009-01-13 21:43:22 +0100 (Tue, 13 Jan 2009) | 1 line Code cleaning start rewriting of the security part ........ r2294 | danydb | 2009-01-14 20:09:18 +0100 (Wed, 14 Jan 2009) | 1 line Improve : template of security + security code ........ r2295 | danydb | 2009-01-14 20:21:51 +0100 (Wed, 14 Jan 2009) | 1 line Improve security : add new variable ........ r2296 | danydb | 2009-01-14 20:39:58 +0100 (Wed, 14 Jan 2009) | 1 line Improve security : modify layout ........ r2297 | danydb | 2009-01-15 19:21:47 +0100 (Thu, 15 Jan 2009) | 1 line Improve security : user setting ........ r2299 | danydb | 2009-01-15 19:28:56 +0100 (Thu, 15 Jan 2009) | 2 lines Clean code : can_request doens't have a connx parameter ........ r2300 | danydb | 2009-01-16 19:12:47 +0100 (Fri, 16 Jan 2009) | 1 line Improve Ecriture directe libelle : new widget js_search_card_control ........ r2301 | danydb | 2009-01-16 22:29:39 +0100 (Fri, 16 Jan 2009) | 1 line Improve Quick Writing : remove span, and update the comment field ........ r2302 | danydb | 2009-01-16 23:01:24 +0100 (Fri, 16 Jan 2009) | 1 line Improve cosmetic : GL + remove the select topmenu ........ r2303 | danydb | 2009-01-19 08:41:09 +0100 (Mon, 19 Jan 2009) | 1 line Cosmetic : a inline ........ r2304 | danydb | 2009-01-20 23:03:59 +0100 (Tue, 20 Jan 2009) | 6 lines Code Cleaning Security : remove obsolete files & function Class_user : add new functions for the security Only the menu in text mode with a break line ........ r2305 | danydb | 2009-01-20 23:05:01 +0100 (Tue, 20 Jan 2009) | 1 line code cleaning rewriting of Security ........ r2306 | danydb | 2009-01-21 21:13:15 +0100 (Wed, 21 Jan 2009) | 1 line Security printing unicode and fix some bugs ........ r2309 | danydb | 2009-01-26 19:56:28 +0100 (Mon, 26 Jan 2009) | 1 line ADD : company without VAT ........ r2310 | danydb | 2009-01-26 23:33:14 +0100 (Mon, 26 Jan 2009) | 1 line Add : no vat for Purchase ledger ........ r2312 | danydb | 2009-01-28 19:57:30 +0100 (Wed, 28 Jan 2009) | 1 line Integration ........ r2313 | danydb | 2009-01-28 22:46:27 +0100 (Wed, 28 Jan 2009) | 1 line Work with or without VAT ........ r2314 | danydb | 2009-01-29 22:18:57 +0100 (Thu, 29 Jan 2009) | 2 lines Remove debug info ........ r2315 | danydb | 2009-01-29 23:23:14 +0100 (Thu, 29 Jan 2009) | 1 line ADD the possibility to enter a piece number ........ r2316 | danydb | 2009-01-31 23:20:00 +0100 (Sat, 31 Jan 2009) | 1 line Documentation ........ r2317 | danydb | 2009-02-04 20:14:54 +0100 (Wed, 04 Feb 2009) | 1 line Template for ledger ........ r2318 | danydb | 2009-02-05 15:52:58 +0100 (Thu, 05 Feb 2009) | 1 line Add PJ setting + default in Ledger, fix bug in listJrn ........ r2319 | danydb | 2009-02-05 17:09:56 +0100 (Thu, 05 Feb 2009) | 2 lines Search by PJ ........ r2320 | danydb | 2009-02-05 17:23:24 +0100 (Thu, 05 Feb 2009) | 1 line Finished with pj ........ r2321 | danydb | 2009-02-05 18:11:35 +0100 (Thu, 05 Feb 2009) | 1 line PJ is readonly ........ r2322 | danydb | 2009-02-05 20:10:34 +0100 (Thu, 05 Feb 2009) | 1 line Saldo : write the first saldo (ajax) ........ r2324 | danydb | 2009-02-06 00:07:50 +0100 (Fri, 06 Feb 2009) | 5 lines Add database script Cosmetic (menu) Fix Bug ........ r2325 | danydb | 2009-02-06 14:07:07 +0100 (Fri, 06 Feb 2009) | 1 line Improve Pj seq ........ r2326 | danydb | 2009-02-09 22:47:23 +0100 (Mon, 09 Feb 2009) | 6 lines Fix Bug privilege (compta_ven) Fix if the pj is empty do not increment the sequence (class_acc_operation) Fix remove PJ if pj is empty (modify_op.php) Cosmetic do not print PJ if pj is null or empty (listing) ........ r2327 | danydb | 2009-02-10 21:04:48 +0100 (Tue, 10 Feb 2009) | 5 lines Fix bug in PJ seq Fix bug in export jrn csv Improve avoid the removal of vat rate Add security for card ........ r2328 | danydb | 2009-02-12 20:26:36 +0100 (Thu, 12 Feb 2009) | 4 lines Cosmetic menu_tool Impression add tag PJ Cosmetic menu administration ........ r2329 | danydb | 2009-02-12 21:43:19 +0100 (Thu, 12 Feb 2009) | 5 lines filter the folder the local admin can access add a function check_dossier which must be implemented everywhere Printing with PJ NoAccess default = javascript ........ r2330 | danydb | 2009-02-14 18:11:49 +0100 (Sat, 14 Feb 2009) | 2 lines improve add libelle for balance csv ........ r2331 | danydb | 2009-02-14 19:10:56 +0100 (Sat, 14 Feb 2009) | 7 lines Balance csv add label Bug Financial ledger list BUG period access BUG stock access IMPROVE list ledger with PJ ........ r2332 | danydb | 2009-02-15 18:21:59 +0100 (Sun, 15 Feb 2009) | 1 line Bug order was not saved for report ........ r2333 | danydb | 2009-02-15 18:22:17 +0100 (Sun, 15 Feb 2009) | 1 line Add security for normal user ........ r2334 | danydb | 2009-02-15 18:23:24 +0100 (Sun, 15 Feb 2009) | 3 lines Bug forget to import class ........ r2335 | danydb | 2009-02-17 21:33:17 +0100 (Tue, 17 Feb 2009) | 5 lines Fix quick writing let write Fix card priv Remove button if no priv to add card or cancel an op ........ r2336 | danydb | 2009-02-19 21:01:36 +0100 (Thu, 19 Feb 2009) | 4 lines Check for CA common Bug with the repository ........ r2337 | danydb | 2009-02-19 21:50:35 +0100 (Thu, 19 Feb 2009) | 2 lines Test the parameter security part ........
422 lines
14 KiB
PHP
422 lines
14 KiB
PHP
|
|
<?php
|
|
/*
|
|
* This file is part of PhpCompta.
|
|
*
|
|
* PhpCompta is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* PhpCompta is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with PhpCompta; if not, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
*/
|
|
/* $Revision$ */
|
|
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
|
|
/*! \file
|
|
* \brief Page who manage the different action (meeting, letter)
|
|
*/
|
|
$User->can_request(GECOUR);
|
|
|
|
//-----------------------------------------------------
|
|
// Action
|
|
//-----------------------------------------------------
|
|
require_once("class_widget.php");
|
|
require_once("class_action.php");
|
|
|
|
/*!\brief Show the list of action, this code should be common
|
|
* to several webpage. But for the moment we keep like that
|
|
* because it is used only by this file.
|
|
*\param $cn database connection
|
|
* \param $retour button for going back
|
|
* \param $h_url calling url
|
|
*/
|
|
function ShowActionList($cn,$retour,$h_url)
|
|
{
|
|
// show the search menu
|
|
?>
|
|
<div>
|
|
<span style="position:float;float:left">
|
|
<form method="get" action="commercial.php">
|
|
<?php
|
|
echo dossier::hidden();
|
|
$a=(isset($_GET['query']))?$_GET['query']:"";
|
|
$qcode=(isset($_GET['qcode']))?$_GET['qcode']:"";
|
|
echo JS_SEARCH_CARD;
|
|
$w=new widget('js_search_only');
|
|
$w->name='qcode';
|
|
$w->value=$qcode;
|
|
$w->label='Quick Code1';
|
|
$w->extra='4,9,14,16,8';
|
|
$w->table=0;
|
|
echo '<span>';
|
|
echo $w->IOValue();
|
|
printf ('Titre ou référence: <input type="text" name="query" value="%s"></span>',
|
|
$a);
|
|
|
|
|
|
$sp= new widget("span");
|
|
echo $sp->IOValue("qcode_label","",$qcode);
|
|
|
|
|
|
?>
|
|
|
|
<input type="submit" name="submit_query" value="recherche">
|
|
<input type="hidden" name="sa" value="list">
|
|
<input type="hidden" name="p_action" value="suivi_courrier">
|
|
</form>
|
|
</span>
|
|
|
|
<span style="float:right">
|
|
<form method="get" action="commercial.php">
|
|
<?php echo dossier::hidden(); ?>
|
|
<input type="submit" name="submit_query" value="Ajout Action">
|
|
<input type="hidden" name="p_action" value="suivi_courrier">
|
|
<input type="hidden" name="sa" value="add_action">
|
|
<!-- <input type="hidden" name="qcode_dest" value=<?php echo '"'.$qcode_dest.'"';?> -->
|
|
<?php // if called from another menu, url is set
|
|
echo $h_url;
|
|
echo $retour; ?>
|
|
</form>
|
|
</span>
|
|
</div>
|
|
<div class="content">
|
|
|
|
<?php
|
|
// show the action in
|
|
$act=new action($cn);
|
|
/*! \brief
|
|
* \note The field 'recherche' is about a part of the title or a ref. number
|
|
*/
|
|
$query="";
|
|
|
|
if ( isset($_REQUEST['query']) )
|
|
{
|
|
$com=urlencode($_REQUEST['query']);
|
|
// if a query is request build the sql stmt
|
|
$query="and (ag_title ~* '".FormatString($_REQUEST['query'])."' ".
|
|
"or ag_ref ='".trim(FormatString($_REQUEST['query'])).
|
|
"' or ag_comment ~* '$com'".
|
|
")";
|
|
}
|
|
|
|
$str="";
|
|
if ( isset($_GET['qcode'] ))
|
|
{
|
|
|
|
// verify that qcode is not empty
|
|
if ( strlen(trim($_REQUEST['qcode'] )) != 0 )
|
|
{
|
|
|
|
$fiche=new Fiche($cn);
|
|
$fiche->get_by_qcode($_REQUEST['qcode']);
|
|
// if quick code not found then nothing
|
|
if ( $fiche->id == 0 )
|
|
$str=' and false ';
|
|
else
|
|
$str=" and (f_id_exp= ".$fiche->id." or ".
|
|
"f_id_dest=".$fiche->id.")";
|
|
|
|
}
|
|
}
|
|
|
|
$r=$act->myList(ACTION,$query.$str);
|
|
echo $r;
|
|
}
|
|
|
|
// We need a sub action (3rd level)
|
|
// show a list of already taken action
|
|
// propose to add one
|
|
// permit also a search
|
|
// show detail
|
|
$sub_action=(isset($_REQUEST['sa']))?$_REQUEST['sa']:"";
|
|
|
|
if ( $sub_action == "" ) $sub_action="list";
|
|
|
|
// if correction is asked go to directly to add_action
|
|
if (isset($_POST['corr'] ))
|
|
{
|
|
$ag_comment=urldecode($_POST['ag_comment']);
|
|
$sub_action="add_action";
|
|
}
|
|
// if this page is called from another menu (customer, supplier,...)
|
|
// a button back is added
|
|
$retour="";
|
|
$h_url="";
|
|
|
|
if ( isset ($_REQUEST['url']))
|
|
{
|
|
$retour=widget::button_href('Retour',urldecode($_REQUEST['url']));
|
|
$h_url=sprintf('<input type="hidden" name="url" value="%s">',urldecode($_REQUEST['url']));
|
|
}
|
|
//----------------------------------------------------------------------
|
|
// Update the detail
|
|
// Add a new action related to this one or update
|
|
//----------------------------------------------------------------------
|
|
if ( $sub_action=="update" )
|
|
{
|
|
// Update the modification
|
|
if ( isset($_POST['save']))
|
|
{
|
|
$act=new action($cn);
|
|
$act=new action($cn);
|
|
|
|
$act->ag_id=$_POST['ag_id'];
|
|
$act->ag_comment=$_POST['ag_comment'];
|
|
$act->ag_timestamp=$_POST['ag_timestamp'];
|
|
$act->d_state=$_POST['d_state'];
|
|
$act->dt_id=(isset($_POST['dt_id']))?$_POST['dt_id']:0;
|
|
$act->qcode_exp=$_POST['qcode_exp'];
|
|
$act->qcode_dest=$_POST['qcode_dest'];
|
|
$act->ag_title=$_POST['ag_title'];
|
|
$act->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;
|
|
|
|
if ( $act->Update() == false ) {
|
|
$sub_action="detail";
|
|
}
|
|
else
|
|
{
|
|
ShowActionList($cn,$retour,$h_url);
|
|
}
|
|
}
|
|
//----------------------------------------------------------------------
|
|
// Add a related action
|
|
//----------------------------------------------------------------------
|
|
if ( isset ($_POST['add_action_here']) )
|
|
{
|
|
$act=new action($cn);
|
|
$act->ag_ref_ag_id=$_POST['ag_id'];
|
|
|
|
//----------------------------------------
|
|
// puis comme ajout normal (copier / coller )
|
|
echo $retour;
|
|
$act->ag_id=0;
|
|
$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->ag_ref_ag_id=$_POST['ag_id'];
|
|
$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->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 '<div class="content">';
|
|
echo JS_SEARCH_CARD;
|
|
// Add hidden tag
|
|
echo '<form name="RTEDemo" action="commercial.php?p_action=suivi_courrier" method="post" onsubmit="return submitForm();">';
|
|
|
|
// $act->ag_comment=(isset($_POST['ag_comment']))?Decode($_POST['ag_comment']):"";
|
|
echo dossier::hidden();
|
|
$act->ag_comment="";
|
|
echo_debug("action.inc",__LINE__,"call display");
|
|
echo $act->Display('NEW',false);
|
|
|
|
echo '<input type="hidden" name="p_action" value="suivi_courrier">';
|
|
echo '<input type="hidden" name="sa" value="save_action_st2">';
|
|
|
|
echo $h_url;
|
|
echo '<input type="submit" name="save_action_st2" value="Enregistrer"></p>'.
|
|
'</form>'.
|
|
'</div>';
|
|
|
|
}
|
|
|
|
|
|
}
|
|
//--------------------------------------------------------------------------------
|
|
// Show the detail of an action
|
|
// permit the update
|
|
if ( $sub_action=='detail' )
|
|
{
|
|
echo '<div class="content">';
|
|
echo '<div style="float:right">';
|
|
echo '<A class="mtitle" HREF="commercial.php?p_action=suivi_courrier&'.$str_dossier.'"><input type="button" value="Retour"></A>';
|
|
echo '</div>';
|
|
$act=new action($cn);
|
|
$act->ag_id=$_REQUEST['ag_id'];
|
|
echo $act->get();
|
|
$act->ag_comment=Decode($act->ag_comment);
|
|
echo '<form name="RTEDemo" action="commercial.php?p_action=suivi_courrier" enctype="multipart/form-data" method="post" onsubmit="return submitForm();" >';
|
|
echo dossier::hidden();
|
|
echo JS_SEARCH_CARD;
|
|
echo $act->display('UPD',false);
|
|
echo '<input type="hidden" name="p_action" value="suivi_courrier">';
|
|
echo '<input type="hidden" name="sa" value="update">';
|
|
$upload=new widget("file");
|
|
$upload->name="file_upload";
|
|
$upload->value="";
|
|
echo "Enregistrer le fichier ".$upload->IOValue();
|
|
echo widget::submit("save","Sauve");
|
|
echo widget::submit("add_action_here","Ajoute une action à celle-ci");
|
|
echo '</form>';
|
|
echo '<form action="commercial.php" method="post" >';
|
|
echo dossier::hidden();
|
|
|
|
echo widget::submit("delete","Efface cette action");
|
|
echo '<input type="hidden" name="p_action" value="suivi_courrier">';
|
|
echo '<input type="hidden" name="sa" value="delete">';
|
|
echo '<input type="hidden" name="ag_id" value="'.$act->ag_id.'">';
|
|
echo '</form>';
|
|
|
|
echo $retour;
|
|
|
|
echo '</div>';
|
|
}
|
|
//-------------------------------------------------------------------------------
|
|
// Delete an action
|
|
if ( $sub_action == 'delete' )
|
|
{
|
|
// first the confirmation
|
|
if ( ! isset ($_POST['confirm_delete']))
|
|
{
|
|
echo '<div class="u_redcontent">';
|
|
echo '<A class="mtitle" HREF="commercial.php?p_action=suivi_courrier&'.$str_dossier.'"><input type="button" value="Retour"></A>';
|
|
$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 '<form action="commercial.php?p_action=suivi_courrier" method="post" >';
|
|
echo dossier::hidden();
|
|
|
|
echo '<input type="hidden" name="p_action" value="suivi_courrier">';
|
|
echo '<input type="hidden" name="sa" value="delete">';
|
|
echo '<input type="hidden" name="ag_id" value="'.$act->ag_id.'">';
|
|
$upload=new widget("text");
|
|
echo widget::submit("confirm_delete","Confirmer l'effacement");
|
|
|
|
echo '</form>';
|
|
|
|
|
|
|
|
echo '</div>';
|
|
|
|
}
|
|
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 '<div style="float:right">';
|
|
echo '<A class="one" HREF="commercial.php?p_action=suivi_courrier&'.$str_dossier.'"><input type="button" value="Retour"></A>';
|
|
echo '</div>';
|
|
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 '<div class="u_redcontent">';
|
|
echo JS_SEARCH_CARD;
|
|
// Add hidden tag
|
|
echo '<form name="RTEDemo" action="commercial.php?p_action=suivi_courrier" method="post" onsubmit="return submitForm();">';
|
|
echo dossier::hidden();
|
|
|
|
|
|
$act->ag_comment=(isset($_POST['ag_comment']))?Decode($_POST['ag_comment']):"";
|
|
echo_debug("action.inc",__LINE__,"call display");
|
|
echo $act->Display('NEW',false);
|
|
|
|
echo '<input type="hidden" name="p_action" value="suivi_courrier">';
|
|
echo '<input type="hidden" name="sa" value="save_action_st2">';
|
|
|
|
echo $h_url;
|
|
echo '<input type="submit" name="save_action_st2" value="Enregistrer"></p>'.
|
|
'</form>'.
|
|
'</div>';
|
|
|
|
}
|
|
//--------------------------------------------------------------------------------
|
|
// 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 '<A class="one" HREF="commercial.php?p_action=suivi_courrier&'.$str_dossier.'"><INPUT TYPE="BUTTON" VALUE="Retour Liste"></A>';
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------
|
|
// 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 "</div>";
|
|
?>
|