diff --git a/doc/developper/account_repository.html b/doc/developper/account_repository.html index f59c7d7d4..b1d6e38e2 100644 --- a/doc/developper/account_repository.html +++ b/doc/developper/account_repository.html @@ -111,12 +111,12 @@
-
Dumped on 2006-06-27
Dumped on 2006-06-28
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-27
Dumped on 2006-06-28
+ 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 @@ -6044,6 +7203,278 @@ FROM ( +
+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 + modified action_gestion%rowtype; + begin + modified:=NEW; + modified.ag_comment:=replace(modified.ag_comment,'%0A',''); + modified.ag_comment:=replace(modified.ag_comment,'%0D',''); + return modified; +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 b2e91d60e..f4a75f53e 100644
--- a/doc/developper/html/ac__common_8php.html
+++ b/doc/developper/html/ac__common_8php.html
@@ -62,6 +62,9 @@
+
+
|
+
| + + | +
+
+ +Decode the html for the widegt richtext and remove newline. + +
+Definition at line 371 of file ac_common.php. |
+
@@ -283,7 +324,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(), action::Update(), UpdateComment(), UpdateFiche(), UpdateForm(), Own::UpdateRow(), and ViewJrn().
+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(), action::Update(), UpdateComment(), UpdateFiche(), UpdateForm(), Own::UpdateRow(), and ViewJrn().
@@ -336,7 +377,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 +427,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 +486,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 +652,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().
@@ -653,7 +694,7 @@ check if the argument is a number
Definition at line 76 of file ac_common.php.
-Referenced by AddFiche(), AddModele(), ComputeTotalVat(), ComputeVat(), DeleteRapt(), form_verify_input(), FormAchInput(), FormAchView(), FormODS(), FormVenInput(), FormVenteView(), fiche::insert(), InsertRapt(), RecordFin(), RecordInvoice(), RecordODS(), RecordSell(), Remove(), Document_modele::Save(), and fiche::update().
+Referenced by AddFiche(), AddModele(), ComputeTotalVat(), ComputeVat(), DeleteRapt(), form_verify_input(), FormAchInput(), FormAchView(), FormODS(), FormVenInput(), FormVenteView(), fiche::insert(), InsertRapt(), RecordFin(), RecordInvoice(), RecordODS(), RecordSell(), Remove(), Document_modele::Save(), and fiche::update().
@@ -709,9 +750,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 +853,12 @@ store the string which print
Definition at line 228 of file ac_common.php.
-References $ret, and $title.
+References $ret.
Referenced by MenuAdmin(), ShowJrn(), ShowMenuAdvanced(), ShowMenuCompta(), ShowMenuDocument(), and ShowMenuParam().
-
Generated on Tue Jun 27 01:39:29 2006 for phpcompta by
+
Generated on Wed Jun 28 02:07:24 2006 for phpcompta by
1.4.4
diff --git a/doc/developper/html/action_8inc_8php-source.html b/doc/developper/html/action_8inc_8php-source.html
index a693cf09c..58fcf2297 100644
--- a/doc/developper/html/action_8inc_8php-source.html
+++ b/doc/developper/html/action_8inc_8php-source.html
@@ -27,313 +27,259 @@
00018 */
00019 /* $Revision$ */
00020 // Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-00025 //-----------------------------------------------------
+00024 var_dump($_POST);
+00025 //-----------------------------------------------------
00026 // Action
00027 //-----------------------------------------------------
00028 require_once("class_widget.php");
00029 require_once("class_action.php");
-00037 function ShowActionList($cn,$retour,$h_url)
-00038 {
-00039 // show the search menu
-00040 ?>
-00041 <div class="u_content">
-00042 <span>
-00043 <form method="get" action="commercial.php">
-00044 <?
-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']:"";
-00049 echo JS_SEARCH_CARD;
-00050 $w=new widget('js_search_only');
-00051 $w->name='qcode';
-00052 $w->value=$qcode;
-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);
-00058 echo $w->IOValue();
-00059
+00030
+00038 function ShowActionList($cn,$retour,$h_url)
+00039 {
+00040 // show the search menu
+00041 ?>
+00042 <div class="u_content">
+00043 <span>
+00044 <form method="get" action="commercial.php">
+00045 <?
+00046 $a=(isset($_GET['query']))?$_GET['query']:"";
+00047 printf ('<span>Titre ou référence: <input type="text" name="query" value="%s"></span>',
+00048 $a);
+00049 $qcode=(isset($_GET['qcode']))?$_GET['qcode']:"";
+00050 echo JS_SEARCH_CARD;
+00051 $w=new widget('js_search_only');
+00052 $w->name='qcode';
+00053 $w->value=$qcode;
+00054 $w->label='Quick Code';
+00055 $w->extra='4,9,14,16,8';
+00056 $w->table=0;
+00057 $sp= new widget("span");
+00058 echo $sp->IOValue("qcode_label","",$qcode);
+00059 echo $w->IOValue();
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">
-00065 </form>
-00066 </span>
-00067
-00068 <?
-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.'"';?>>
-00076 <? // if called from another menu, url is set
-00077 echo $h_url;
-00078 echo $retour; ?>
-00079 </form>
-00080
+00061
+00062 ?>
+00063 <input type="submit" name="submit_query" value="recherche">
+00064 <input type="hidden" name="sa" value="list">
+00065 <input type="hidden" name="p_action" value="suivi_courrier">
+00066 </form>
+00067 </span>
+00068
+00069 <?
+00070 ?>
+00071 <span>
+00072 <form method="get" action="commercial.php">
+00073 <input type="submit" name="submit_query" value="Ajout Action">
+00074 <input type="hidden" name="p_action" value="suivi_courrier">
+00075 <input type="hidden" name="sa" value="add_action">
+00076 <input type="hidden" name="tiers" value=<? echo '"'.$qcode.'"';?>>
+00077 <? // if called from another menu, url is set
+00078 echo $h_url;
+00079 echo $retour; ?>
+00080 </form>
00081
-00082 </span>
-00083 <?
-00084 // show the action in
-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'] ))
-00092 {
-00093
-00094 // verify that qcode is not empty
-00095 if ( strlen(trim($_REQUEST['qcode'] )) != 0 )
-00096 {
-00097
-00098 $fiche=new Fiche($cn);
-00099 $fiche->GetByQCode($_REQUEST['qcode']);
-00100 $str=" and f_id= ".$fiche->id;
-00101 }
-00102 }
-00103
-00104 $r=$act->myList(ACTION,$query.$str);
-00105 echo $r;
-00106 }
-00107
-00108 // We need a sub action (3rd level)
-00109 // show a list of already taken action
-00110 // propose to add one
-00111 // permit also a search
-00112 // show detail
-00113 $sub_action=(isset($_REQUEST['sa']))?$_REQUEST['sa']:"";
-00114
-00115 if ( $sub_action == "" ) $sub_action="list";
-00116
-00117 // if correction is asked go to directly to add_action
-00118 if (isset($_POST['corr'] ))
-00119 $sub_action="add_action";
-00120
-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>';
-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']));
-00131 }
-00132 //----------------------------------------------------------------------
-00133 // Update the detail
-00134 if ( $sub_action=="update" )
-00135 {
-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
+00082
+00083 </span>
+00084 <?
+00085 // show the action in
+00086 $act=new action($cn);
+00090 $query=(isset ($_REQUEST['query']))?"and (ag_title ~* '".FormatString($_REQUEST['query'])."' or ag_ref ='".trim(FormatString($_REQUEST['query']))."')":"";
+00091 $str="";
+00092 if ( isset($_GET['qcode'] ))
+00093 {
+00094
+00095 // verify that qcode is not empty
+00096 if ( strlen(trim($_REQUEST['qcode'] )) != 0 )
+00097 {
+00098
+00099 $fiche=new Fiche($cn);
+00100 $fiche->GetByQCode($_REQUEST['qcode']);
+00101 $str=" and f_id= ".$fiche->id;
+00102 }
+00103 }
+00104
+00105 $r=$act->myList(ACTION,$query.$str);
+00106 echo $r;
+00107 }
+00108
+00109 // We need a sub action (3rd level)
+00110 // show a list of already taken action
+00111 // propose to add one
+00112 // permit also a search
+00113 // show detail
+00114 $sub_action=(isset($_REQUEST['sa']))?$_REQUEST['sa']:"";
+00115
+00116 if ( $sub_action == "" ) $sub_action="list";
+00117
+00118 // if correction is asked go to directly to add_action
+00119 if (isset($_POST['corr'] ))
+00120 {
+00121 $ag_comment=rawurldecode($_POST['ag_comment']);
+00122 $sub_action="add_action";
+00123 }
+00124 // if this page is called from another menu (customer, supplier,...)
+00125 // a button back is added
+00126 // TODO add function for generating url, hidden tags...
+00127 $retour='<A HREF="commercial.php?p_action=suivi_courrier"><input type="button" value="Retour"></A>';
+00128 $h_url="";
+00129
+00130 if ( isset ($_REQUEST['url']))
+00131 {
+00132 $retour=sprintf('<A HREF="%s"><input type="button" value="Retour"></A>',urldecode($_REQUEST['url']));
+00133 $h_url=sprintf('<input type="hidden" name="url" value="%s">',urldecode($_REQUEST['url']));
+00134 }
+00135 //----------------------------------------------------------------------
+00136 // Update the detail
+00137 if ( $sub_action=="update" )
+00138 {
+00139
+00140
+00141 $act=new action($cn);
+00142
+00143 $act->ag_id=$_POST['ag_id'];
+00144 $act->ag_comment=$_POST['ag_comment'];
+00145 $act->ag_timestamp=$_POST['ag_timestamp'];
+00146 $act->d_state=$_POST['d_state'];
+00147 $act->dt_id=(isset($_POST['dt_id']))?$_POST['dt_id']:0;
+00148 $act->qcode=$_POST['qcode'];
+00149 $act->ag_title=$_POST['ag_title'];
+00150 $act->d_id=(isset($_POST['d_id']))?$_POST['d_id']:0;
+00151 if ( $act->Update() == false ) {
+00152 $sub_action="detail";
+00153 }
+00154 else
+00155 {
+00156 ShowActionList($cn,$retour,$h_url);
+00157 }
+00158
+00159 }
+00160 //--------------------------------------------------------------------------------
+00161 // Show the detail of an action
+00162 // permit the update
+00163 if ( $sub_action=='detail' )
+00164 {
+00165 $act=new action($cn);
+00166 $act->ag_id=$_REQUEST['ag_id'];
+00167 echo $act->get();
+00168 $act->ag_comment=Decode($act->ag_comment);
+00169 echo '<form name="RTEDemo" action="commercial.php" enctype="multipart/form-data" method="post" onsubmit="return submitForm();" >';
+00170 echo JS_SEARCH_CARD;
+00171 echo $act->display('UPD',false);
+00172 echo '<input type="hidden" name="p_action" value="suivi_courrier">';
+00173 echo '<input type="hidden" name="sa" value="update">';
+00174 $upload=new widget("file");
+00175 $upload->name="file_upload";
+00176 $upload->value="";
+00177 echo "Enregistrer le fichier ".$upload->IOValue();
+00178 echo $upload->Submit("save","Sauve");
+00179 echo '</form>';
+00180 echo $retour;
+00181
+00182 }
+00183
+00184
00185 //--------------------------------------------------------------------------------
-00186 // Add an action
-00187 if ( $sub_action == "add_action" )
-00188 {
-00189 echo $retour;
-00190
-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 ?>
-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 <input type="submit" name="save_action_st1" value="Sauver"></p>
-00282 </form>
-00283 </div>
-00284 <?
-00285 }
-00286 //--------------------------------------------------------------------------------
-00287 // Save Action
-00288 // Stage 1 : show the result and confirm
-00289 //--------------------------------------------------------------------------------
-00290 if ( $sub_action == "save_action_st1" )
-00291 {
-00292 $act=new action($cn);
-00293 $act->ag_comment=$_POST['ag_comment'];
-00294 $act->ag_timestamp=$_POST['ag_timestamp'];
-00295 $act->d_state=$_POST['d_state'];
-00296 $act->dt_id=$_POST['dt_id'];
-00297 $act->qcode=$_POST['tiers'];
-00298 $act->ag_title=$_POST['ag_title'];
-00299 echo $act->Confirm();
-00300 }
-00301 //--------------------------------------------------------------------------------
-00302 // Save Action
-00303 // Stage 2 : Save the action and propose to save a file
-00304 //--------------------------------------------------------------------------------
-00305 if ( $sub_action == "save_action_st2" )
-00306 {
-00307 $act=new action($cn);
-00308 $act->ag_comment=$_POST['ag_comment'];
-00309 $act->ag_timestamp=$_POST['ag_timestamp'];
-00310 $act->d_state=$_POST['d_state'];
-00311 $act->dt_id=$_POST['dt_id'];
-00312 $act->qcode=$_POST['tiers'];
-00313 $act->ag_title=$_POST['ag_title'];
-00314
-00315
-00316 $act->md_id=(isset($_POST['gen_doc']))?$_POST['gen_doc']:0;
-00317
-00318 $act->gen=isset($_POST['p_gen'])?'on':'off';
-00319
-00320 echo $act->SaveStage2();
-00321 echo '<A HREF="commercial.php?p_action=suivi_courrier"><INPUT TYPE="BUTTON" VALUE="Retour Liste"></A>';
-00322 }
-00323
-00324 //--------------------------------------------------------------------------------
-00325 // Save Document
-00326 // Stage 3 : Save the document
-00327 //--------------------------------------------------------------------------------
-00328 if ( $sub_action == "save_action_st3" )
-00329 {
-00330 echo_debug("action.inc.php",__LINE__,'Stage 3');
-00331 $act=new action($cn);
-00332 $act->ag_id=$_POST['ag_id'];
-00333 $d_id=(isset($_POST['d_id']))?$_POST['d_id']:0;
-00334 echo $act->SaveStage3($d_id);
-00335
-00336 ShowActionList($cn,$retour,$h_url);
-00337
-00338 }
-00339 //---------------------------------------------------------------------
-00340
-
Generated on Tue Jun 27 01:39:27 2006 for phpcompta by
+00186 // Show a list of the action
+00187 if ( $sub_action == "list" )
+00188 ShowActionList($cn,$retour,$h_url);
+00189
+00190 //--------------------------------------------------------------------------------
+00191 // Add an action
+00192 if ( $sub_action == "add_action" )
+00193 {
+00194 echo $retour;
+00195 $act=new action($cn);
+00196 $act->ag_id=0;
+00197 $act->ag_timestamp=(isset($_POST['ag_timestamp']))?$_POST['ag_timestamp']:"";
+00198 $act->qcode=isset($_POST['tiers'])?$_REQUEST['tiers']:"";
+00199 $act->d_id=0;
+00200 $act->dt_id=isset($_POST['dt_id'])?$_REQUEST['dt_id']:"";
+00201 $act->d_state=(isset($_POST['d_state']))?$_POST['d_state']:"";
+00202 $act->ag_ref="";
+00203 $act->ag_title=(isset($_POST['ag_title']))?$_POST['ag_title']:"";
+00204 echo '<div class="u_redcontent">';
+00205 echo JS_SEARCH_CARD;
+00206 // Add hidden tag
+00207 echo '<form name="RTEDemo" action="commercial.php?p_action=suivi_courrier" method="post" onsubmit="return submitForm();">';
+00208
+00209 $act->ag_comment=(isset($_POST['ag_comment']))?Decode($_POST['ag_comment']):"";
+00210 echo $act->Display('NEW',false);
+00211
+00212 echo '<input type="hidden" name="p_action" value="suivi_courrier">';
+00213 echo '<input type="hidden" name="sa" value="save_action_st1">';
+00214
+00215 echo $h_url;
+00216 echo '<input type="submit" name="save_action_st1" value="Sauver"></p>'.
+00217 '</form>'.
+00218 '</div>';
+00219
+00220 }
+00221 //--------------------------------------------------------------------------------
+00222 // Save Action
+00223 // Stage 1 : show the result and confirm
+00224 //--------------------------------------------------------------------------------
+00225 if ( $sub_action == "save_action_st1" )
+00226 {
+00227 $act=new action($cn);
+00228 $act->ag_timestamp=$_POST['ag_timestamp'];
+00229 $act->ag_comment=$_POST['ag_comment'];
+00230 $act->ag_timestamp=$_POST['ag_timestamp'];
+00231 $act->d_state=$_POST['d_state'];
+00232 $act->dt_id=$_POST['dt_id'];
+00233 $act->qcode=$_POST['qcode'];
+00234 $act->ag_title=$_POST['ag_title'];
+00235 $act->d_id=0;
+00236 $act->ag_id=$_POST['ag_id'];
+00237 echo $act->Confirm();
+00238 }
+00239 //--------------------------------------------------------------------------------
+00240 // Save Action
+00241 // Stage 2 : Save the action and propose to save a file
+00242 //--------------------------------------------------------------------------------
+00243 if ( $sub_action == "save_action_st2" )
+00244 {
+00245 $act=new action($cn);
+00246
+00247 $act->ag_comment=$_POST['ag_comment'];
+00248 $act->ag_timestamp=$_POST['ag_timestamp'];
+00249 $act->d_state=$_POST['d_state'];
+00250 $act->dt_id=$_POST['dt_id'];
+00251 $act->qcode=$_POST['tiers'];
+00252 $act->ag_title=$_POST['ag_title'];
+00253 $act->d_id=0;
+00254
+00255 $act->md_id=(isset($_POST['gen_doc']))?$_POST['gen_doc']:0;
+00256
+00257 $act->gen=isset($_POST['p_gen'])?'on':'off';
+00258 // insert into action_gestion
+00259 echo $act->SaveStage2();
+00260 echo '<A HREF="commercial.php?p_action=suivi_courrier"><INPUT TYPE="BUTTON" VALUE="Retour Liste"></A>';
+00261 }
+00262
+00263 //--------------------------------------------------------------------------------
+00264 // Save Document
+00265 // Stage 3 : Save the document
+00266 //--------------------------------------------------------------------------------
+00267 if ( $sub_action == "save_action_st3" )
+00268 {
+00269 echo_debug("action.inc.php",__LINE__,'Stage 3');
+00270 $act=new action($cn);
+00271 $act->ag_id=$_POST['ag_id'];
+00272 $act->ag_comment=$_POST['ag_comment'];
+00273 $act->ag_timestamp=$_POST['ag_timestamp'];
+00274 $act->d_state=$_POST['d_state'];
+00275 $act->dt_id=$_POST['dt_id'];
+00276 $act->qcode=$_POST['qcode'];
+00277 $act->ag_title=$_POST['ag_title'];
+00278 $d_id=(isset($_POST['d_id']))?$_POST['d_id']:0;
+00279 echo $act->SaveStage3($d_id);
+00280
+00281 ShowActionList($cn,$retour,$h_url);
+00282
+00283 }
+00284 //---------------------------------------------------------------------
+00285
+
Generated on Wed Jun 28 02:07:23 2006 for phpcompta by
1.4.4