diff --git a/doc/developper/account_repository.html b/doc/developper/account_repository.html index 1f0122de0..f59c7d7d4 100644 --- a/doc/developper/account_repository.html +++ b/doc/developper/account_repository.html @@ -111,12 +111,12 @@
-
Dumped on 2006-06-26
Dumped on 2006-06-27
Tables referencing this one via Foreign Key Constraints:
- -- Index - - Schema public -
- -The user's global parameter
- - - -| F-Key | -Name | -Type | -Description | -
|---|---|---|---|
| - - - ac_users.use_login - - - - - | -user_id | -text | -
-
-
-
-
-
- PRIMARY KEY
-
-
-
-
-
-
-
-
- user's login - |
-
| - - - - | -parameter_type | -text | -
-
- PRIMARY KEY
-
-
-
-
-
-
-
-
- the type of parameter - |
-
| - - | -parameter_value | -text | -
-
-
-
-
-
- the value of parameter - |
-
Dumped on 2006-06-26
Dumped on 2006-06-27
- Index - - Schema public -
- -Action for Managing
- - - -| F-Key | -Name | -Type | -Description | -
|---|---|---|---|
| - - - - | -ag_id | -serial | -- - PRIMARY KEY - - - - - - - - - - | -
| - - | -ag_type | -integer | -- - - - - - - | -
| - - | -f_id | -integer | -- - - NOT NULL - - - - | -
| - - | -ag_title | -character varying(70) | -- - - - - - - | -
| - - | -ag_timestamp | -timestamp without time zone | -- - - - DEFAULT now() - - - | -
| - - | -ag_cal | -character(1) | -- - - - DEFAULT 'C'::bpchar - - - | -
| - - | -ag_comment | -text | -- - - - - - - | -
| - - | -ag_ref | -text | -- - - - - - - | -
- Index - - Schema public -
- -This table contains all the documents : summary and lob files
- - - -| F-Key | -Name | -Type | -Description | -
|---|---|---|---|
| - - - - | -d_id | -serial | -- - PRIMARY KEY - - - - - - - - - - | -
| - - | -ag_id | -integer | -- - - NOT NULL - - - - | -
| - - | -d_lob | -oid | -- - - - - - - | -
| - - | -d_number | -bigint | -- - - NOT NULL - - - - | -
| - - | -d_filename | -text | -- - - - - - - | -
| - - | -d_mimetype | -text | -- - - - - - - | -
| - - | -d_state | -integer | -- - - - - - - | -
- Index - - Schema public -
- -contains all the template for the documents
- - - -| F-Key | -Name | -Type | -Description | -
|---|---|---|---|
| - - - - | -md_id | -serial | -- - PRIMARY KEY - - - - - - - - - - | -
| - - | -md_name | -text | -- - - NOT NULL - - - - | -
| - - | -md_lob | -oid | -- - - - - - - | -
| - - - document_type.dt_id - - - | -md_type | -integer | -- - - - - - - NOT NULL - - - - | -
| - - | -md_filename | -text | -- - - - - - - | -
| - - | -md_mimetype | -text | -- - - - - - - | -
- Index - - Schema public -
- -State of the document
- - - -| F-Key | -Name | -Type | -Description | -
|---|---|---|---|
| - - - - | -s_id | -serial | -- - PRIMARY KEY - - - - - - - - - - | -
| - - | -s_value | -character varying(50) | -- - - NOT NULL - - - - | -
- Index - - Schema public -
- -Type of document : meeting, invoice,...
- - - -| F-Key | -Name | -Type | -Description | -
|---|---|---|---|
| - - - - | -dt_id | -serial | -- - PRIMARY KEY - - - - - - - - - - | -
| - - | -dt_value | -character varying(80) | -- - - - - - - | -
Tables referencing this one via Foreign Key Constraints:
- -- Index - - Schema public -
- -| F-Key | -Name | -Type | -Description | -
|---|---|---|---|
| - - | -f_id | -integer | -- - - - - - - | -
| - - | -name | -text | -- - - - - - - | -
| - - | -quick_code | -text | -- - - - - - - | -
| - - | -tva_num | -text | -- - - - - - - | -
| - - | -poste_comptable | -text | -- - - - - - - | -
| - - | -rue | -text | -- - - - - - - | -
| - - | -code_postal | -text | -- - - - - - - | -
| - - | -pays | -text | -- - - - - - - | -
| - - | -telephone | -text | -- - - - - - - | -
| - - | -text | -- - - - - - - | -
-SELECT a.f_id -, a.av_text AS name -, a1.av_text AS quick_code -, b.av_text AS tva_num -, c.av_text AS poste_comptable -, d.av_text AS rue -, e.av_text AS code_postal -, f.av_text AS pays -, g.av_text AS telephone -, h.av_text AS email -FROM ( - ( - ( - ( - ( - ( - ( - ( - ( - SELECT jnt_fic_att_value.jft_id - , fiche.f_id - , fiche_def.frd_id - , fiche.fd_id - , fiche_def.fd_class_base - , fiche_def.fd_label - , fiche_def.fd_create_account - , fiche_def_ref.frd_text - , fiche_def_ref.frd_class_base - , jnt_fic_att_value.ad_id - , attr_value.av_text - FROM ( - ( - ( - (fiche - JOIN fiche_def - USING (fd_id) - ) - JOIN fiche_def_ref - USING (frd_id) - ) - JOIN jnt_fic_att_value - USING (f_id) - ) - JOIN attr_value - USING (jft_id) - ) - WHERE (jnt_fic_att_value.ad_id = 1) - ) a - JOIN ( - SELECT jnt_fic_att_value.jft_id - , fiche.f_id - , fiche_def.frd_id - , fiche.fd_id - , fiche_def.fd_class_base - , fiche_def.fd_label - , fiche_def.fd_create_account - , fiche_def_ref.frd_text - , fiche_def_ref.frd_class_base - , jnt_fic_att_value.ad_id - , attr_value.av_text - FROM ( - ( - ( - (fiche - JOIN fiche_def - USING (fd_id) - ) - JOIN fiche_def_ref - USING (frd_id) - ) - JOIN jnt_fic_att_value - USING (f_id) - ) - JOIN attr_value - USING (jft_id) - ) - WHERE (jnt_fic_att_value.ad_id = 13) - ) b - USING (f_id) - ) - JOIN ( - SELECT jnt_fic_att_value.jft_id - , fiche.f_id - , fiche_def.frd_id - , fiche.fd_id - , fiche_def.fd_class_base - , fiche_def.fd_label - , fiche_def.fd_create_account - , fiche_def_ref.frd_text - , fiche_def_ref.frd_class_base - , jnt_fic_att_value.ad_id - , attr_value.av_text - FROM ( - ( - ( - (fiche - JOIN fiche_def - USING (fd_id) - ) - JOIN fiche_def_ref - USING (frd_id) - ) - JOIN jnt_fic_att_value - USING (f_id) - ) - JOIN attr_value - USING (jft_id) - ) - WHERE (jnt_fic_att_value.ad_id = 23) - ) a1 - USING (f_id) - ) - JOIN ( - SELECT jnt_fic_att_value.jft_id - , fiche.f_id - , fiche_def.frd_id - , fiche.fd_id - , fiche_def.fd_class_base - , fiche_def.fd_label - , fiche_def.fd_create_account - , fiche_def_ref.frd_text - , fiche_def_ref.frd_class_base - , jnt_fic_att_value.ad_id - , attr_value.av_text - FROM ( - ( - ( - (fiche - JOIN fiche_def - USING (fd_id) - ) - JOIN fiche_def_ref - USING (frd_id) - ) - JOIN jnt_fic_att_value - USING (f_id) - ) - JOIN attr_value - USING (jft_id) - ) - WHERE (jnt_fic_att_value.ad_id = 5) - ) c - USING (f_id) - ) - JOIN ( - SELECT jnt_fic_att_value.jft_id - , fiche.f_id - , fiche_def.frd_id - , fiche.fd_id - , fiche_def.fd_class_base - , fiche_def.fd_label - , fiche_def.fd_create_account - , fiche_def_ref.frd_text - , fiche_def_ref.frd_class_base - , jnt_fic_att_value.ad_id - , attr_value.av_text - FROM ( - ( - ( - (fiche - JOIN fiche_def - USING (fd_id) - ) - JOIN fiche_def_ref - USING (frd_id) - ) - JOIN jnt_fic_att_value - USING (f_id) - ) - JOIN attr_value - USING (jft_id) - ) - WHERE (jnt_fic_att_value.ad_id = 14) - ) d - USING (f_id) - ) - JOIN ( - SELECT jnt_fic_att_value.jft_id - , fiche.f_id - , fiche_def.frd_id - , fiche.fd_id - , fiche_def.fd_class_base - , fiche_def.fd_label - , fiche_def.fd_create_account - , fiche_def_ref.frd_text - , fiche_def_ref.frd_class_base - , jnt_fic_att_value.ad_id - , attr_value.av_text - FROM ( - ( - ( - (fiche - JOIN fiche_def - USING (fd_id) - ) - JOIN fiche_def_ref - USING (frd_id) - ) - JOIN jnt_fic_att_value - USING (f_id) - ) - JOIN attr_value - USING (jft_id) - ) - WHERE (jnt_fic_att_value.ad_id = 15) - ) e - USING (f_id) - ) - JOIN ( - SELECT jnt_fic_att_value.jft_id - , fiche.f_id - , fiche_def.frd_id - , fiche.fd_id - , fiche_def.fd_class_base - , fiche_def.fd_label - , fiche_def.fd_create_account - , fiche_def_ref.frd_text - , fiche_def_ref.frd_class_base - , jnt_fic_att_value.ad_id - , attr_value.av_text - FROM ( - ( - ( - (fiche - JOIN fiche_def - USING (fd_id) - ) - JOIN fiche_def_ref - USING (frd_id) - ) - JOIN jnt_fic_att_value - USING (f_id) - ) - JOIN attr_value - USING (jft_id) - ) - WHERE (jnt_fic_att_value.ad_id = 16) - ) f - USING (f_id) - ) - JOIN ( - SELECT jnt_fic_att_value.jft_id - , fiche.f_id - , fiche_def.frd_id - , fiche.fd_id - , fiche_def.fd_class_base - , fiche_def.fd_label - , fiche_def.fd_create_account - , fiche_def_ref.frd_text - , fiche_def_ref.frd_class_base - , jnt_fic_att_value.ad_id - , attr_value.av_text - FROM ( - ( - ( - (fiche - JOIN fiche_def - USING (fd_id) - ) - JOIN fiche_def_ref - USING (frd_id) - ) - JOIN jnt_fic_att_value - USING (f_id) - ) - JOIN attr_value - USING (jft_id) - ) - WHERE (jnt_fic_att_value.ad_id = 17) - ) g - USING (f_id) - ) -LEFT JOIN ( - SELECT jnt_fic_att_value.jft_id - , fiche.f_id - , fiche_def.frd_id - , fiche.fd_id - , fiche_def.fd_class_base - , fiche_def.fd_label - , fiche_def.fd_create_account - , fiche_def_ref.frd_text - , fiche_def_ref.frd_class_base - , jnt_fic_att_value.ad_id - , attr_value.av_text - FROM ( - ( - ( - (fiche - JOIN fiche_def - USING (fd_id) - ) - JOIN fiche_def_ref - USING (frd_id) - ) - JOIN jnt_fic_att_value - USING (f_id) - ) - JOIN attr_value - USING (jft_id) - ) - WHERE (jnt_fic_att_value.ad_id = 18) - ) h - USING (f_id) -) -WHERE (a.frd_id = 8);- - - - -
Index - Schema public @@ -7219,260 +6044,6 @@ WHERE (a.frd_id = 8); -
-declare - nParent tmp_pcmn.pcm_val_parent%type; - nCount integer; -begin - select count(*) into nCount from tmp_pcmn where pcm_val=p_id; - if nCount = 0 then - nParent=account_parent(p_id); - insert into tmp_pcmn (pcm_val,pcm_lib,pcm_val_parent) - values (p_id, p_name,nParent); - end if; -return; -end ; -- -
-declare - l_auto bool; -begin - - select fd_create_account into l_auto from fiche_def where fd_id=p_fd_id; - if l_auto is null then - l_auto:=false; - end if; - return l_auto; -end; -- -
-declare - class_base poste_comptable; - maxcode int8; -begin - -- Get the class base - select fd_class_base into class_base - from - fiche_def join fiche using (fd_id) - where - f_id=p_f_id; - raise notice 'class base %',class_base; - select max(pcm_val) into maxcode from tmp_pcmn where pcm_val = class_base; - if maxcode = class_base then - maxcode=class_base*1000+1; - end if; - raise notice 'Max code %',maxcode; -return maxcode+1; -end; -- -
-declare -nParent tmp_pcmn.pcm_val_parent%type; -sName varchar; -nNew tmp_pcmn.pcm_val%type; -bAuto bool; -nFd_id integer; -nCount integer; -begin - - -- if p_value empty - if length(trim(p_account)) != 0 then - -- does the account exist ? - select * into nCount from tmp_pcmn where pcm_val=p_account; - if nCount !=0 then - -- retrieve name - select av_text into sName from - attr_value join jnt_fic_att_value using (jft_id) - where - ad_id=1 and f_id=p_f_id; - -- get parent - nParent:=account_parent(p_account); - -- account doesn't exist we need to add id - insert into tmp_pcmn(pcm_val,pcm_lib,pcm_val_parent) - values (p_account,sName,nParent); - -- insert as card's attribute - attribut_insert(p_f_id,5,to_char(nNew,'999999999999')); - - end if; - else - select fd_id into nFd_id from fiche where f_id=p_f_id; - bAuto:= account_auto(nFd_id); - - if bAuto = true then - -- create automatically the account - -- compute the next account - nNew:=account_compute(p_f_id); -raise debug 'nNew %', nNew; - -- retrieve name - select av_text into sName from - attr_value join jnt_fic_att_value using (jft_id) - where - ad_id=1 and f_id=p_f_id; - - -- get parent - nParent:=account_parent(nNew); - -- account doesn't exist we need to add id - perform account_add (nNew,sName); - -- insert as card's attribute - perform attribut_insert(p_f_id,5,to_char(nNew,'999999999999')); - - else - perform attribut_insert(p_f_id,5,null); - end if; - - end if; - -return 0; -end; -- -
-declare - nParent tmp_pcmn.pcm_val_parent%type; - sParent varchar; - nCount integer; -begin - sParent:=to_char(p_account,'9999999999999999'); - sParent:=trim(sParent); - nParent:=0; - while nParent = 0 loop - select count(*) into nCount - from tmp_pcmn - where - pcm_val = to_number(sParent,'9999999999999999'); - if nCount != 0 then - nParent:=to_number(sParent,'9999999999999999'); - end if; - sParent:= substr(sParent,1,length(sParent)-1); - if length(sParent) <= 0 then - raise exception 'Impossible de trouver le compte parent pour %',p_account; - end if; - - end loop; - - return nParent; -end; -- -
-declare -nMax fiche.f_id%type; -nCount integer; -nParent tmp_pcmn.pcm_val_parent%type; -sName varchar; -nJft_id attr_value.jft_id%type; -begin - - -- if p_value empty - if length(trim(p_account)) != 0 then - -- does the account exist ? - select count(*) into nCount from tmp_pcmn where pcm_val=p_account; - if nCount = 0 then - -- retrieve name - select av_text into sName from - attr_value join jnt_fic_att_value using (jft_id) - where - ad_id=1 and f_id=p_f_id; - -- get parent - nParent:=fiche_account_parent(p_f_id); - -- account doesn't exist we need to add id - insert into tmp_pcmn(pcm_val,pcm_lib,pcm_val_parent) values (p_account,sName,nParent); - end if; - end if; - -- we retrieve jft_id - select jft_id into njft_id from jnt_fic_att_value where f_id=p_f_id and ad_id=5; - -- we update the account - update attr_value set av_text=p_account where jft_id=njft_id; - -return njft_id; -end; -- -
-declare
- n_jft_id integer;
-begin
- select nextval('s_jnt_fic_att_value') into n_jft_id;
- insert into jnt_fic_att_value (jft_id,f_id,ad_id) values (n_jft_id,p_f_id,p_ad_id);
- insert into attr_value (jft_id,av_text) values (n_jft_id,p_value);
-return;
-end;
-
-
- - -declare - n_poste fiche_def.fd_class_base%type; -begin - - select fd_class_base into n_poste from fiche_def join fiche using (fd_id) - where f_id=p_f_id; - if not FOUND then - raise exception 'Invalid fiche card_class_base(%)',p_f_id; - end if; -return; -end; --
-declare -ret poste_comptable; -begin - select fd_class_base into ret from fiche_def join fiche using (fd_id) where f_id=p_f_id; - if not FOUND then - raise exception '% N''existe pas',p_f_id; - end if; - return ret; -end;
- BEGIN - execute 'create sequence seq_doc_type_'||NEW.dt_id; -raise notice 'Creating sequence seq_doc_type_%',NEW.dt_id; - RETURN NEW; - END; -- -
- BEGIN - execute 'create sequence s_jrn_'||NEW.jrn_def_id; -raise notice 'Creating sequence s_jrn_%',NEW.jrn_def_id; - RETURN NEW; - END; --
1.4.4
diff --git a/doc/developper/html/ac__common_8php.html b/doc/developper/html/ac__common_8php.html
index d3845390f..b2e91d60e 100644
--- a/doc/developper/html/ac__common_8php.html
+++ b/doc/developper/html/ac__common_8php.html
@@ -283,7 +283,7 @@ Definition at line 208
References echo_error().
-Referenced by AddFiche(), AddForm(), AddModele(), action::Confirm(), fiche::CountByDef(), action::Display(), fiche::GetByQCode(), fiche::insert(), InsertJrn(), ListJrn(), RecordFin(), RecordInvoice(), RecordSell(), Remove(), parm_code::Save(), Document_modele::Save(), action::SaveStage2(), ShowActionList(), Supplier::Summary(), Customer::Summary(), contact::Summary(), Admin::Summary(), fiche::update(), UpdateComment(), UpdateFiche(), UpdateForm(), Own::UpdateRow(), and ViewJrn().
@@ -336,7 +336,7 @@ Return the period corresponding to the date.
Definition at line 355 of file ac_common.php.
-References $a, and ExecSql(). +References $a, and ExecSql().
@@ -386,7 +386,7 @@ Return the period corresponding to the date.
Definition at line 335 of file ac_common.php.
-References $a, and ExecSql(). +References $a, and ExecSql().
Referenced by ParseFormula(). @@ -445,7 +445,7 @@ Show the periode which found thanks its id.
Definition at line 315 of file ac_common.php.
-References $a, $ret, and echo_error(). +References $a, $ret, and echo_error().
@@ -611,7 +611,7 @@ Definition at line 97 References echo_debug().
-Referenced by cmpDate(), action::Confirm(), form_verify_input(), formatDate(), ListJrn(), VerifData(), VerifyOperationDate(), and ViewJrn(). +Referenced by cmpDate(), action::Confirm(), form_verify_input(), formatDate(), ListJrn(), VerifData(), VerifyOperationDate(), and ViewJrn().
@@ -709,9 +709,9 @@ make a array with the sql
Definition at line 282 of file ac_common.php.
-References $a, $i, $r, $row, label, and value. +References $a, $i, $r, $row, label, and value.
-Referenced by action::Confirm(), action::Display(), Document_modele::form(), FormAchInput(), FormVenInput(), FormVenteView(), and ShowFormTransfert(). +Referenced by action::Confirm(), action::Display(), Document_modele::form(), FormAchInput(), FormVenInput(), FormVenteView(), and ShowFormTransfert().
@@ -812,12 +812,12 @@ store the string which print
Definition at line 228 of file ac_common.php.
-References $ret, and $title. +References $ret, and $title.
Referenced by MenuAdmin(), ShowJrn(), ShowMenuAdvanced(), ShowMenuCompta(), ShowMenuDocument(), and ShowMenuParam(). -
1.4.4
diff --git a/doc/developper/html/action_8inc_8php-source.html b/doc/developper/html/action_8inc_8php-source.html
index c65c5e5b2..a693cf09c 100644
--- a/doc/developper/html/action_8inc_8php-source.html
+++ b/doc/developper/html/action_8inc_8php-source.html
@@ -32,7 +32,7 @@
00027 //-----------------------------------------------------
00028 require_once("class_widget.php");
00029 require_once("class_action.php");
-00037 function ShowActionList($cn,$retour,$h_url)
+00037 function ShowActionList($cn,$retour,$h_url)
00038 {
00039 // show the search menu
00040 ?>
@@ -40,10 +40,10 @@
00042 <span>
00043 <form method="get" action="commercial.php">
00044 <?
-00045 $a=(isset($_GET['query']))?$_GET['query']:"";
+00045 $a=(isset($_GET['query']))?$_GET['query']:"";
00046 printf ('<span>Titre ou référence: <input type="text" name="query" value="%s"></span>',
00047 $a);
-00048 $qcode=(isset($_GET['qcode']))?$_GET['qcode']:"";
+00048 $qcode=(isset($_GET['qcode']))?$_GET['qcode']:"";
00049 echo JS_SEARCH_CARD;
00050 $w=new widget('js_search_only');
00051 $w->name='qcode';
@@ -51,15 +51,15 @@
00053 $w->label='Quick Code';
00054 $w->extra='4,9,14,16,8';
00055 $w->table=0;
-00056 $sp= new widget("span");
-00057 echo $sp->IOValue("qcode_label","",$qcode);
+00056 $sp= new widget("span");
+00057 echo $sp->IOValue("qcode_label","",$qcode);
00058 echo $w->IOValue();
00059
00060
00061 ?>
-00062 <input type="submit" name="submit_query" value="recherche">
-00063 <input type="hidden" name="sa" value="list">
-00064 <input type="hidden" name="p_action" value="suivi_courrier">
+00062 <input type="submit" name="submit_query" value="recherche">
+00063 <input type="hidden" name="sa" value="list">
+00064 <input type="hidden" name="p_action" value="suivi_courrier">
00065 </form>
00066 </span>
00067
@@ -67,10 +67,10 @@
00069 ?>
00070 <span>
00071 <form method="get" action="commercial.php">
-00072 <input type="submit" name="submit_query" value="Ajout Action">
-00073 <input type="hidden" name="p_action" value="suivi_courrier">
-00074 <input type="hidden" name="sa" value="add_action">
-00075 <input type="hidden" name="tiers" value=<? echo '"'.$qcode.'"';?>>
+00072 <input type="submit" name="submit_query" value="Ajout Action">
+00073 <input type="hidden" name="p_action" value="suivi_courrier">
+00074 <input type="hidden" name="sa" value="add_action">
+00075 <input type="hidden" name="tiers" value=<? echo '"'.$qcode.'"';?>>
00076 <? // if called from another menu, url is set
00077 echo $h_url;
00078 echo $retour; ?>
@@ -80,7 +80,7 @@
00082 </span>
00083 <?
00084 // show the action in
-00085 $act=new action($cn);
+00085 $act=new action($cn);
00089 $query=(isset ($_REQUEST['query']))?"and (ag_title ~* '".FormatString($_REQUEST['query'])."' or ag_ref ='".trim(FormatString($_REQUEST['query']))."')":"";
00090 $str="";
00091 if ( isset($_REQUEST['qcode'] ))
@@ -116,184 +116,224 @@
00121 // if this page is called from another menu (customer, supplier,...)
00122 // a button back is added
00123 // TODO add function for generating url, hidden tags...
-00124 $retour='<A HREF="commercial.php?p_action=suivi_courrier"><input type="button" value="Retour"></A>';
+00124 $retour='<A HREF="commercial.php?p_action=suivi_courrier"><input type="button" value="Retour"></A>';
00125 $h_url="";
00126
00127 if ( isset ($_REQUEST['url']))
00128 {
-00129 $retour=sprintf('<A HREF="%s"><input type="button" value="Retour"></A>',urldecode($_REQUEST['url']));
-00130 $h_url=sprintf('<input type="hidden" name="url" value="%s">',urldecode($_REQUEST['url']));
+00129 $retour=sprintf('<A HREF="%s"><input type="button" value="Retour"></A>',urldecode($_REQUEST['url']));
+00130 $h_url=sprintf('<input type="hidden" name="url" value="%s">',urldecode($_REQUEST['url']));
00131 }
-00132 //--------------------------------------------------------------------------------
-00133 // Show the detail of an action
-00134 if ( $sub_action=='detail' )
+00132 //----------------------------------------------------------------------
+00133 // Update the detail
+00134 if ( $sub_action=="update" )
00135 {
-00136 $act=new action($cn);
-00137 $act->ag_id=$_REQUEST['ag_id'];
-00138 echo $act->get();
-00139 echo $act->display();
-00140 echo $retour;
-00141
-00142 }
-00143 //--------------------------------------------------------------------------------
-00144 // Show a list of the action
-00145 if ( $sub_action == "list" )
-00146 ShowActionList($cn,$retour,$h_url);
-00147
-00148 //--------------------------------------------------------------------------------
-00149 // Add an action
-00150 if ( $sub_action == "add_action" )
-00151 {
-00152 echo $retour;
-00153
-00154 echo '<div class="u_redcontent">';
-00155 echo JS_SEARCH_CARD;
-00156 // Add hidden tag
-00157 echo '<form name="RTEDemo" action="commercial.php?p_action=suivi_courrier" method="post" onsubmit="return submitForm();">';
-00158 echo $h_url;
-00159 $date=new widget("text");
-00160 $date->name="ag_timestamp";
-00161 $date->value=(isset($_POST['ag_timestamp']))?$_POST['ag_timestamp']:"";
-00162 echo "<p>Date : ";
-00163 echo $date->IOValue()."</p>";
-00164 // Tiers
-00165 $W1=new widget("js_search");
-00166 $W1->label="Tiers";
-00167 $W1->name="tiers";
-00168 $W1->value=isset($_REQUEST['tiers'])?$_REQUEST['tiers']:"";
-00169 $W1->extra="8,9,14"; // filter on frd_id
-00170 $W1->extra2=0; // jrn = 0
-00171 echo "<div class=\"no\">".$W1->IOValue();
-00172 $client_label=new widget("span");
-00173 $tiers_label="";
-00174 // Retrieve name
-00175 if ( $W1->value != "" )
-00176 {
-00177 $tiers=new fiche($cn);
-00178 $tiers->GetByQCode($W1->value);
-00179 $tiers_label=$tiers->strAttribut(1);
-00180
-00181 }
-00182 echo $client_label->IOValue("tiers_label",$tiers_label)."</div>";
-00183
-00184 $doc_type=new widget("select");
-00185 $doc_type->name="dt_id";
-00186 $doc_type->value=make_array($cn,"select dt_id,dt_value from document_type where dt_id in (".ACTION.")");
-00187 echo 'Type d\' action';
-00188 $doc_type->selected=(isset($_POST['dt_id']))?$_POST['dt_id']:"";
-00189 echo $doc_type->IOValue();
+00136
+00137
+00138 $act=new action($cn);
+00139 $act->ag_id=$_REQUEST['ag_id'];
+00140 $act->ag_comment=$_POST['ag_comment'];
+00141 $act->ag_timestamp=$_POST['ag_timestamp'];
+00142 $act->d_state=$_POST['d_state'];
+00143 $act->dt_id=(isset($_POST['dt_id']))?$_POST['dt_id']:0;
+00144 $act->qcode=$_POST['qcode'];
+00145 $act->ag_title=$_POST['ag_title'];
+00146 $act->d_id=$_POST['d_id'];
+00147 if ( $act->Update() == false ) {
+00148 $sub_action="detail";
+00149 }
+00150 else
+00151 {
+00152 ShowActionList($cn,$retour,$h_url);
+00153 }
+00154
+00155 }
+00156 //--------------------------------------------------------------------------------
+00157 // Show the detail of an action
+00158 // permit the update
+00159 if ( $sub_action=='detail' )
+00160 {
+00161 $act=new action($cn);
+00162 $act->ag_id=$_REQUEST['ag_id'];
+00163 echo $act->get();
+00164 echo '<form action="commercial.php" enctype="multipart/form-data" method="post" >';
+00165 echo $act->display(false);
+00166 echo '<input type="hidden" name="p_action" value="suivi_courrier">';
+00167 echo '<input type="hidden" name="sa" value="update">';
+00168 echo '<input type="hidden" name="ag_id" value="'.$_REQUEST['ag_id'].'">';
+00169 $upload=new widget("file");
+00170 $upload->name="file_upload";
+00171 $upload->value="";
+00172 echo "Enregistrer le fichier ".$upload->IOValue();
+00173 echo $upload->Submit("save","Sauve");
+00174 echo '</form>';
+00175 echo $retour;
+00176
+00177 }
+00178
+00179
+00180 //--------------------------------------------------------------------------------
+00181 // Show a list of the action
+00182 if ( $sub_action == "list" )
+00183 ShowActionList($cn,$retour,$h_url);
+00184
+00185 //--------------------------------------------------------------------------------
+00186 // Add an action
+00187 if ( $sub_action == "add_action" )
+00188 {
+00189 echo $retour;
00190
-00191 // state
-00192 $doc_state=new widget("select");
-00193 $doc_state->name="d_state";
-00194 $doc_state->value=make_array($cn,"select s_id,s_value from document_state");
-00195 $doc_state->selected=(isset($_POST['d_state']))?$_POST['d_state']:"";
-00196 echo "Etat : ".$doc_state->IOValue();
-00197 echo '<input type="hidden" name="p_action" value="suivi_courrier">';
-00198 echo '<input type="hidden" name="sa" value="save_action_st1">';
-00199 $title=new widget("text");
-00200 $title->name="ag_title";
-00201 $title->value=(isset($_POST['ag_title']))?$_POST['ag_title']:"";
-00202 echo "<p>Titre : ";
-00203 echo $title->IOValue()."</p>";
-00204
-00205 ?>
-00206
-00207 <?
-00208 //--------------------------------------------------------------------------------
-00209 // add here for who the action is taken (contact, client or supplier)
-00210
-00211 ?>
-00212
-00213
-00214
-00215 <script language="JavaScript" type="text/javascript">
-00216 <!--
-00217 function submitForm() {
-00218 //make sure hidden and iframe values are in sync before submitting form
-00219 //to sync only 1 rte, use updateRTE(rte)
-00220 //to sync all rtes, use updateRTEs
-00221 updateRTE('ag_comment');
-00222 //updateRTE();
-00223 //change the following line to true to submit form
-00224 return true;
-00225 }
-00226
-00227 //Usage: initRTE(imagesPath, includesPath, cssFile)
-00228 initRTE("images/", "", "");
-00229 //-->
-00230 </script>
-00231 <noscript><p><b>Javascript must be enabled to use this form.</b></p></noscript>
-00232 Note Interne :
-00233 <script language="JavaScript" type="text/javascript">
-00234 <!--
-00235 //Usage: writeRichText(fieldname, html, width, height, buttons, readOnly)
-00236 <? $a=(isset($_POST['ag_comment']))?FormatString(urldecode($_POST['ag_comment'])):""; ?>
-00237 writeRichText('ag_comment', <? printf ("'%s'",$a); ?>, 520, 200, true, false);
-00238 <? echo_debug('action.inc',__LINE__, " A = ".$a); ?>
-00239 //-->
-00240 </script>
+00191 echo '<div class="u_redcontent">';
+00192 echo JS_SEARCH_CARD;
+00193 // Add hidden tag
+00194 echo '<form name="RTEDemo" action="commercial.php?p_action=suivi_courrier" method="post" onsubmit="return submitForm();">';
+00195 echo $h_url;
+00196 $date=new widget("text");
+00197 $date->name="ag_timestamp";
+00198 $date->value=(isset($_POST['ag_timestamp']))?$_POST['ag_timestamp']:"";
+00199 echo "<p>Date : ";
+00200 echo $date->IOValue()."</p>";
+00201 // Tiers
+00202 $W1=new widget("js_search");
+00203 $W1->label="Tiers";
+00204 $W1->name="tiers";
+00205 $W1->value=isset($_REQUEST['tiers'])?$_REQUEST['tiers']:"";
+00206 $W1->extra="8,9,14"; // filter on frd_id
+00207 $W1->extra2=0; // jrn = 0
+00208 echo "<div class=\"no\">".$W1->IOValue();
+00209 $client_label=new widget("span");
+00210 $tiers_label="";
+00211 // Retrieve name
+00212 if ( $W1->value != "" )
+00213 {
+00214 $tiers=new fiche($cn);
+00215 $tiers->GetByQCode($W1->value);
+00216 $tiers_label=$tiers->strAttribut(1);
+00217
+00218 }
+00219 echo $client_label->IOValue("tiers_label",$tiers_label)."</div>";
+00220
+00221 $doc_type=new widget("select");
+00222 $doc_type->name="dt_id";
+00223 $doc_type->value=make_array($cn,"select dt_id,dt_value from document_type where dt_id in (".ACTION.")");
+00224 echo 'Type d\' action';
+00225 $doc_type->selected=(isset($_POST['dt_id']))?$_POST['dt_id']:"";
+00226 echo $doc_type->IOValue();
+00227
+00228 // state
+00229 $doc_state=new widget("select");
+00230 $doc_state->name="d_state";
+00231 $doc_state->value=make_array($cn,"select s_id,s_value from document_state");
+00232 $doc_state->selected=(isset($_POST['d_state']))?$_POST['d_state']:"";
+00233 echo "Etat : ".$doc_state->IOValue();
+00234 echo '<input type="hidden" name="p_action" value="suivi_courrier">';
+00235 echo '<input type="hidden" name="sa" value="save_action_st1">';
+00236 $title=new widget("text");
+00237 $title->name="ag_title";
+00238 $title->value=(isset($_POST['ag_title']))?$_POST['ag_title']:"";
+00239 echo "<p>Titre : ";
+00240 echo $title->IOValue()."</p>";
00241
-00242 <input type="submit" name="save_action_st1" value="Sauver"></p>
-00243 </form>
-00244 </div>
-00245 <?
-00246 }
-00247 //--------------------------------------------------------------------------------
-00248 // Save Action
-00249 // Stage 1 : show the result and confirm
-00250 //--------------------------------------------------------------------------------
-00251 if ( $sub_action == "save_action_st1" )
-00252 {
-00253 $act=new action($cn);
-00254 $act->ag_comment=$_POST['ag_comment'];
-00255 $act->ag_timestamp=$_POST['ag_timestamp'];
-00256 $act->d_state=$_POST['d_state'];
-00257 $act->dt_id=$_POST['dt_id'];
-00258 $act->qcode=$_POST['tiers'];
-00259 $act->ag_title=$_POST['ag_title'];
-00260 echo $act->Confirm();
-00261 }
-00262 //--------------------------------------------------------------------------------
-00263 // Save Action
-00264 // Stage 2 : Save the action and propose to save a file
-00265 //--------------------------------------------------------------------------------
-00266 if ( $sub_action == "save_action_st2" )
-00267 {
-00268 $act=new action($cn);
-00269 $act->ag_comment=$_POST['ag_comment'];
-00270 $act->ag_timestamp=$_POST['ag_timestamp'];
-00271 $act->d_state=$_POST['d_state'];
-00272 $act->dt_id=$_POST['dt_id'];
-00273 $act->qcode=$_POST['tiers'];
-00274 $act->ag_title=$_POST['ag_title'];
-00275
-00276
-00277 $act->md_id=(isset($_POST['gen_doc']))?$_POST['gen_doc']:0;
-00278
-00279 $act->gen=isset($_POST['p_gen'])?'on':'off';
+00242 ?>
+00243
+00244 <?
+00245 //--------------------------------------------------------------------------------
+00246 // add here for who the action is taken (contact, client or supplier)
+00247
+00248 ?>
+00249
+00250
+00251
+00252 <script language="JavaScript" type="text/javascript">
+00253 <!--
+00254 function submitForm() {
+00255 //make sure hidden and iframe values are in sync before submitting form
+00256 //to sync only 1 rte, use updateRTE(rte)
+00257 //to sync all rtes, use updateRTEs
+00258 updateRTE('ag_comment');
+00259 //updateRTE();
+00260 //change the following line to true to submit form
+00261 return true;
+00262 }
+00263
+00264 //Usage: initRTE(imagesPath, includesPath, cssFile)
+00265 initRTE("images/", "", "");
+00266 //-->
+00267 </script>
+00268 <noscript><p><b>Javascript must be enabled to use this form.</b></p></noscript>
+00269 Note Interne :
+00270 <script language="JavaScript" type="text/javascript">
+00271 <!--
+00272 //Usage: writeRichText(fieldname, html, width, height, buttons, readOnly)
+00273 <? $a=(isset($_POST['ag_comment']))?FormatString(urldecode($_POST['ag_comment'])):"";
+00274
+00275 ?>
+00276 writeRichText('ag_comment', <? printf ("'%s'",$a); ?>, 520, 200, true, false);
+00277 <? echo_debug('action.inc',__LINE__, " A = ".$a); ?>
+00278 //-->
+00279 </script>
00280
-00281 echo $act->SaveStage2();
-00282 echo '<A HREF="commercial.php?p_action=suivi_courrier"><INPUT TYPE="BUTTON" VALUE="Retour Liste"></A>';
-00283 }
-00284
-00285 //--------------------------------------------------------------------------------
-00286 // Save Document
-00287 // Stage 3 : Save the document
-00288 //--------------------------------------------------------------------------------
-00289 if ( $sub_action == "save_action_st3" )
-00290 {
-00291 echo_debug("action.inc.php",__LINE__,'Stage 3');
-00292 $act=new action($cn);
-00293 $act->ag_id=$_POST['ag_id'];
-00294 $d_id=(isset($_POST['d_id']))?$_POST['d_id']:0;
-00295 echo $act->SaveStage3($d_id);
-00296
-00297 ShowActionList($cn,$retour,$h_url);
-00298
-00299 }
-00300
-
1.4.4