Titre ou référence: ', $a); $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 Code'; $w->extra='4,9,14,16,8'; $w->table=0; $sp= new widget("span"); echo $sp->IOValue("qcode_label","",$qcode); echo $w->IOValue(); // printf ('Tiers QuickCode: ', // $qcode); ?>
>
GetByQCode($_REQUEST['qcode']); $str=" and f_id= ".$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'] )) $sub_action="add_action"; // if this page is called from another menu (customer, supplier,...) // a button back is added // TODO add function for generating url, hidden tags... $retour=''; $h_url=""; if ( isset ($_REQUEST['url'])) { $retour=sprintf('',urldecode($_REQUEST['url'])); $h_url=sprintf('',urldecode($_REQUEST['url'])); } ////////////////////////////////////////////////////////////////////////////////// // Show the detail of an action if ( $sub_action=='detail' ) { $act=new action($cn); $act->ag_id=$_REQUEST['ag_id']; echo $act->get(); echo $act->display(); echo $retour; } ////////////////////////////////////////////////////////////////////// // Show a list of the action if ( $sub_action == "list" ) ShowActionList($cn,$retour,$h_url); ////////////////////////////////////////////////////////////////////// // Add an action if ( $sub_action == "add_action" ) { echo $retour; echo '
'; echo JS_SEARCH_CARD; // Add hidden tag echo '
'; echo $h_url; $date=new widget("text"); $date->name="ag_timestamp"; $date->value=(isset($_POST['ag_timestamp']))?$_POST['ag_timestamp']:""; echo "

Date : "; echo $date->IOValue()."

"; // Tiers $W1=new widget("js_search"); $W1->label="Tiers"; $W1->name="tiers"; $W1->value=isset($_REQUEST['tiers'])?$_REQUEST['tiers']:""; $W1->extra="8,9,14"; // filter on frd_id $W1->extra2=0; // jrn = 0 echo "
".$W1->IOValue(); $client_label=new widget("span"); $tiers_label=""; // Retrieve name if ( $W1->value != "" ) { $tiers=new fiche($cn); $tiers->GetByQCode($W1->value); $tiers_label=$tiers->strAttribut(1); } echo $client_label->IOValue("tiers_label",$tiers_label)."
"; $doc_type=new widget("select"); $doc_type->name="dt_id"; $doc_type->value=make_array($cn,"select dt_id,dt_value from document_type where dt_id in (".ACTION.")"); echo 'Type d\' action'; $doc_type->selected=(isset($_POST['dt_id']))?$_POST['dt_id']:""; echo $doc_type->IOValue(); // state $doc_state=new widget("select"); $doc_state->name="d_state"; $doc_state->value=make_array($cn,"select s_id,s_value from document_state"); $doc_state->selected=(isset($_POST['d_state']))?$_POST['d_state']:""; echo "Etat : ".$doc_state->IOValue(); echo ''; echo ''; $title=new widget("text"); $title->name="ag_title"; $title->value=(isset($_POST['ag_title']))?$_POST['ag_title']:""; echo "

Titre : "; echo $title->IOValue()."

"; ?> Note Interne :

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=$_POST['tiers']; $act->ag_title=$_POST['ag_title']; echo $act->Confirm(); } //////////////////////////////////////////////////////////////////////////////// // 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=$_POST['tiers']; $act->ag_title=$_POST['ag_title']; $act->md_id=(isset($_POST['gen_doc']))?$_POST['gen_doc']:0; $act->gen=isset($_POST['p_gen'])?'on':'off'; 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']; $d_id=(isset($_POST['d_id']))?$_POST['d_id']:0; echo $act->SaveStage3($d_id); ShowActionList($cn,$retour,$h_url); }