altocompta/doc/developper/html/action_8inc_8php-source.html

286 lines
34 KiB
HTML
Raw Blame History

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/action.inc.php Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.4 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a></div>
<div class="nav">
<a class="el" href="dir_000000.html">developpement</a>&nbsp;&raquo&nbsp;<a class="el" href="dir_000001.html">phpcompta-dev</a>&nbsp;&raquo&nbsp;<a class="el" href="dir_000002.html">phpcompta</a>&nbsp;&raquo&nbsp;<a class="el" href="dir_000006.html">include</a></div>
<h1>action.inc.php</h1><a href="action_8inc_8php.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 &lt;?
<a name="l00002"></a>00002 <span class="comment">/*</span>
<a name="l00003"></a>00003 <span class="comment"> * This file is part of PhpCompta.</span>
<a name="l00004"></a>00004 <span class="comment"> *</span>
<a name="l00005"></a>00005 <span class="comment"> * PhpCompta is free software; you can redistribute it and/or modify</span>
<a name="l00006"></a>00006 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
<a name="l00007"></a>00007 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
<a name="l00008"></a>00008 <span class="comment"> * (at your option) any later version.</span>
<a name="l00009"></a>00009 <span class="comment"> *</span>
<a name="l00010"></a>00010 <span class="comment"> * PhpCompta is distributed in the hope that it will be useful,</span>
<a name="l00011"></a>00011 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00012"></a>00012 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
<a name="l00013"></a>00013 <span class="comment"> * GNU General Public License for more details.</span>
<a name="l00014"></a>00014 <span class="comment"> *</span>
<a name="l00015"></a>00015 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
<a name="l00016"></a>00016 <span class="comment"> * along with PhpCompta; if not, write to the Free Software</span>
<a name="l00017"></a>00017 <span class="comment"> * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</span>
<a name="l00018"></a>00018 <span class="comment">*/</span>
<a name="l00019"></a>00019 <span class="comment">/* $Revision$ */</span>
<a name="l00020"></a>00020 <span class="comment">// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr</span>
<a name="l00024"></a>00024 <span class="comment"></span>var_dump($_POST);
<a name="l00025"></a>00025 <span class="comment">//-----------------------------------------------------</span>
<a name="l00026"></a>00026 <span class="comment">// Action</span>
<a name="l00027"></a>00027 <span class="comment">//-----------------------------------------------------</span>
<a name="l00028"></a>00028 require_once(<span class="stringliteral">"class_widget.php"</span>);
<a name="l00029"></a>00029 require_once(<span class="stringliteral">"class_action.php"</span>);
<a name="l00030"></a>00030
<a name="l00038"></a><a class="code" href="action_8inc_8php.html#a19">00038</a> function <a class="code" href="action_8inc_8php.html#a19">ShowActionList</a>($cn,$retour,$h_url)
<a name="l00039"></a>00039 {
<a name="l00040"></a>00040 <span class="comment">// show the search menu</span>
<a name="l00041"></a>00041 ?&gt;
<a name="l00042"></a>00042 &lt;div <span class="keyword">class</span>=<span class="stringliteral">"u_content"</span>&gt;
<a name="l00043"></a>00043 &lt;span&gt;
<a name="l00044"></a>00044 &lt;form method=<span class="stringliteral">"get"</span> <a class="code" href="classaction.html">action</a>=<span class="stringliteral">"commercial.php"</span>&gt;
<a name="l00045"></a>00045 &lt;?
<a name="l00046"></a>00046 <a class="code" href="balance_8php.html#a10">$a</a>=(isset($_GET['query']))?$_GET['query']:<span class="stringliteral">""</span>;
<a name="l00047"></a>00047 printf ('&lt;span&gt;Titre ou r<>f<EFBFBD>rence: &lt;input type="text" name="query" value="%s"&gt;&lt;/span&gt;',
<a name="l00048"></a>00048 $a);
<a name="l00049"></a>00049 <a class="code" href="bank_8inc_8php.html#a9">$qcode</a>=(isset($_GET['<a class="code" href="action_8inc_8php.html#a8">qcode</a>']))?$_GET['qcode']:<span class="stringliteral">""</span>;
<a name="l00050"></a>00050 echo <a class="code" href="constant_8php.html#a80">JS_SEARCH_CARD</a>;
<a name="l00051"></a>00051 <a class="code" href="admin_8inc_8php.html#a4">$w</a>=<span class="keyword">new</span> <a class="code" href="classwidget.html">widget</a>('js_search_only');
<a name="l00052"></a>00052 <a class="code" href="admin_8inc_8php.html#a4">$w</a>-&gt;name='qcode';
<a name="l00053"></a>00053 <a class="code" href="admin_8inc_8php.html#a4">$w</a>-&gt;value=<a class="code" href="bank_8inc_8php.html#a9">$qcode</a>;
<a name="l00054"></a>00054 <a class="code" href="admin_8inc_8php.html#a4">$w</a>-&gt;label='Quick Code';
<a name="l00055"></a>00055 <a class="code" href="admin_8inc_8php.html#a4">$w</a>-&gt;extra='4,9,14,16,8';
<a name="l00056"></a>00056 <a class="code" href="admin_8inc_8php.html#a4">$w</a>-&gt;table=0;
<a name="l00057"></a>00057 <a class="code" href="bank_8inc_8php.html#a12">$sp</a>= <span class="keyword">new</span> <a class="code" href="classwidget.html">widget</a>(<span class="stringliteral">"span"</span>);
<a name="l00058"></a>00058 echo <a class="code" href="bank_8inc_8php.html#a12">$sp</a>-&gt;IOValue(<span class="stringliteral">"qcode_label"</span>,<span class="stringliteral">""</span>,$qcode);
<a name="l00059"></a>00059 echo <a class="code" href="admin_8inc_8php.html#a4">$w</a>-&gt;IOValue();
<a name="l00060"></a>00060
<a name="l00061"></a>00061
<a name="l00062"></a>00062 ?&gt;
<a name="l00063"></a>00063 &lt;input type=<span class="stringliteral">"submit"</span> <a class="code" href="action_8inc_8php.html#a12">name</a>=<span class="stringliteral">"submit_query"</span> <a class="code" href="action_8inc_8php.html#a13">value</a>=<span class="stringliteral">"recherche"</span>&gt;
<a name="l00064"></a>00064 &lt;input type=<span class="stringliteral">"hidden"</span> <a class="code" href="action_8inc_8php.html#a12">name</a>=<span class="stringliteral">"sa"</span> <a class="code" href="action_8inc_8php.html#a13">value</a>=<span class="stringliteral">"list"</span>&gt;
<a name="l00065"></a>00065 &lt;input type=<span class="stringliteral">"hidden"</span> <a class="code" href="action_8inc_8php.html#a12">name</a>=<span class="stringliteral">"p_action"</span> <a class="code" href="action_8inc_8php.html#a13">value</a>=<span class="stringliteral">"suivi_courrier"</span>&gt;
<a name="l00066"></a>00066 &lt;/form&gt;
<a name="l00067"></a>00067 &lt;/span&gt;
<a name="l00068"></a>00068
<a name="l00069"></a>00069 &lt;?
<a name="l00070"></a>00070 ?&gt;
<a name="l00071"></a>00071 &lt;span&gt;
<a name="l00072"></a>00072 &lt;form method=<span class="stringliteral">"get"</span> <a class="code" href="classaction.html">action</a>=<span class="stringliteral">"commercial.php"</span>&gt;
<a name="l00073"></a>00073 &lt;input type=<span class="stringliteral">"submit"</span> <a class="code" href="action_8inc_8php.html#a12">name</a>=<span class="stringliteral">"submit_query"</span> <a class="code" href="action_8inc_8php.html#a13">value</a>=<span class="stringliteral">"Ajout Action"</span>&gt;
<a name="l00074"></a>00074 &lt;input type=<span class="stringliteral">"hidden"</span> <a class="code" href="action_8inc_8php.html#a12">name</a>=<span class="stringliteral">"p_action"</span> <a class="code" href="action_8inc_8php.html#a13">value</a>=<span class="stringliteral">"suivi_courrier"</span>&gt;
<a name="l00075"></a>00075 &lt;input type=<span class="stringliteral">"hidden"</span> <a class="code" href="action_8inc_8php.html#a12">name</a>=<span class="stringliteral">"sa"</span> <a class="code" href="action_8inc_8php.html#a13">value</a>=<span class="stringliteral">"add_action"</span>&gt;
<a name="l00076"></a>00076 &lt;input type=<span class="stringliteral">"hidden"</span> <a class="code" href="action_8inc_8php.html#a12">name</a>=<span class="stringliteral">"tiers"</span> <a class="code" href="action_8inc_8php.html#a13">value</a>=&lt;? echo <span class="charliteral">'"'</span>.$qcode.<span class="charliteral">'"'</span>;?&gt;&gt;
<a name="l00077"></a>00077 &lt;? <span class="comment">// if called from another menu, url is set</span>
<a name="l00078"></a>00078 echo <a class="code" href="action_8inc_8php.html#a2">$h_url</a>;
<a name="l00079"></a>00079 echo <a class="code" href="action_8inc_8php.html#a1">$retour</a>; ?&gt;
<a name="l00080"></a>00080 &lt;/form&gt;
<a name="l00081"></a>00081
<a name="l00082"></a>00082
<a name="l00083"></a>00083 &lt;/span&gt;
<a name="l00084"></a>00084 &lt;?
<a name="l00085"></a>00085 <span class="comment">// show the action in </span>
<a name="l00086"></a>00086 <a class="code" href="action_8inc_8php.html#a17">$act</a>=<span class="keyword">new</span> <a class="code" href="classaction.html">action</a>($cn);
<a name="l00090"></a>00090 $query=(isset ($_REQUEST['query']))?<span class="stringliteral">"and (ag_title ~* '"</span>.FormatString($_REQUEST['query']).<span class="stringliteral">"' or ag_ref ='"</span>.trim(<a class="code" href="ac__common_8php.html#a9">FormatString</a>($_REQUEST['query'])).<span class="stringliteral">"')"</span>:<span class="stringliteral">""</span>;
<a name="l00091"></a>00091 $str=<span class="stringliteral">""</span>;
<a name="l00092"></a>00092 <span class="keywordflow">if</span> ( isset($_GET['qcode'] ))
<a name="l00093"></a>00093 {
<a name="l00094"></a>00094
<a name="l00095"></a>00095 <span class="comment">// verify that qcode is not empty</span>
<a name="l00096"></a>00096 <span class="keywordflow">if</span> ( strlen(trim($_REQUEST['qcode'] )) != 0 )
<a name="l00097"></a>00097 {
<a name="l00098"></a>00098
<a name="l00099"></a>00099 <a class="code" href="impress__fiche_8php.html#a9">$fiche</a>=<span class="keyword">new</span> Fiche($cn);
<a name="l00100"></a>00100 <a class="code" href="impress__fiche_8php.html#a9">$fiche</a>-&gt;GetByQCode($_REQUEST['qcode']);
<a name="l00101"></a>00101 $str=<span class="stringliteral">" and f_id= "</span>.$fiche-&gt;id;
<a name="l00102"></a>00102 }
<a name="l00103"></a>00103 }
<a name="l00104"></a>00104
<a name="l00105"></a>00105 <a class="code" href="user__action__ach_8php.html#a2">$r</a>=$act-&gt;myList(<a class="code" href="constant_8php.html#a39">ACTION</a>,$query.$str);
<a name="l00106"></a>00106 echo <a class="code" href="user__action__ach_8php.html#a2">$r</a>;
<a name="l00107"></a>00107 }
<a name="l00108"></a>00108
<a name="l00109"></a>00109 <span class="comment">// We need a sub action (3rd level)</span>
<a name="l00110"></a>00110 <span class="comment">// show a list of already taken action </span>
<a name="l00111"></a>00111 <span class="comment">// propose to add one </span>
<a name="l00112"></a>00112 <span class="comment">// permit also a search</span>
<a name="l00113"></a>00113 <span class="comment">// show detail</span>
<a name="l00114"></a><a class="code" href="action_8inc_8php.html#a0">00114</a> <a class="code" href="action_8inc_8php.html#a0">$sub_action</a>=(isset($_REQUEST['sa']))?$_REQUEST['sa']:<span class="stringliteral">""</span>;
<a name="l00115"></a>00115
<a name="l00116"></a>00116 <span class="keywordflow">if</span> ( $sub_action == <span class="stringliteral">""</span> ) <a class="code" href="action_8inc_8php.html#a0">$sub_action</a>=<span class="stringliteral">"list"</span>;
<a name="l00117"></a>00117
<a name="l00118"></a>00118 <span class="comment">// if correction is asked go to directly to add_action</span>
<a name="l00119"></a>00119 <span class="keywordflow">if</span> (isset($_POST['corr'] ))
<a name="l00120"></a>00120 {
<a name="l00121"></a>00121 $ag_comment=rawurldecode($_POST['<a class="code" href="action_8inc_8php.html#a4">ag_comment</a>']);
<a name="l00122"></a>00122 <a class="code" href="action_8inc_8php.html#a0">$sub_action</a>=<span class="stringliteral">"add_action"</span>;
<a name="l00123"></a>00123 }
<a name="l00124"></a>00124 <span class="comment">// if this page is called from another menu (customer, supplier,...)</span>
<a name="l00125"></a>00125 <span class="comment">// a button back is added</span>
<a name="l00126"></a>00126 <span class="comment">// TODO add function for generating url, hidden tags...</span>
<a name="l00127"></a><a class="code" href="action_8inc_8php.html#a1">00127</a> <a class="code" href="action_8inc_8php.html#a1">$retour</a>='&lt;A HREF=<span class="stringliteral">"commercial.php?p_action=suivi_courrier"</span>&gt;&lt;input type=<span class="stringliteral">"button"</span> <a class="code" href="action_8inc_8php.html#a13">value</a>=<span class="stringliteral">"Retour"</span>&gt;&lt;/A&gt;';
<a name="l00128"></a><a class="code" href="action_8inc_8php.html#a2">00128</a> <a class="code" href="action_8inc_8php.html#a2">$h_url</a>=<span class="stringliteral">""</span>;
<a name="l00129"></a>00129
<a name="l00130"></a>00130 <span class="keywordflow">if</span> ( isset ($_REQUEST['url']))
<a name="l00131"></a>00131 {
<a name="l00132"></a>00132 <a class="code" href="action_8inc_8php.html#a1">$retour</a>=sprintf('&lt;A HREF=<span class="stringliteral">"%s"</span>&gt;&lt;input type=<span class="stringliteral">"button"</span> <a class="code" href="action_8inc_8php.html#a13">value</a>=<span class="stringliteral">"Retour"</span>&gt;&lt;/A&gt;',urldecode($_REQUEST['url']));
<a name="l00133"></a>00133 <a class="code" href="action_8inc_8php.html#a2">$h_url</a>=sprintf('&lt;input type=<span class="stringliteral">"hidden"</span> <a class="code" href="action_8inc_8php.html#a12">name</a>=<span class="stringliteral">"url"</span> <a class="code" href="action_8inc_8php.html#a13">value</a>=<span class="stringliteral">"%s"</span>&gt;',urldecode($_REQUEST['url']));
<a name="l00134"></a>00134 }
<a name="l00135"></a>00135 <span class="comment">//----------------------------------------------------------------------</span>
<a name="l00136"></a>00136 <span class="comment">// Update the detail</span>
<a name="l00137"></a>00137 <span class="keywordflow">if</span> ( $sub_action==<span class="stringliteral">"update"</span> )
<a name="l00138"></a>00138 {
<a name="l00139"></a>00139
<a name="l00140"></a>00140
<a name="l00141"></a>00141 <a class="code" href="action_8inc_8php.html#a17">$act</a>=<span class="keyword">new</span> <a class="code" href="classaction.html">action</a>($cn);
<a name="l00142"></a>00142
<a name="l00143"></a><a class="code" href="action_8inc_8php.html#a3">00143</a> <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;ag_id=$_POST['<a class="code" href="action_8inc_8php.html#a3">ag_id</a>'];
<a name="l00144"></a><a class="code" href="action_8inc_8php.html#a4">00144</a> <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;ag_comment=$_POST['<a class="code" href="action_8inc_8php.html#a4">ag_comment</a>'];
<a name="l00145"></a><a class="code" href="action_8inc_8php.html#a5">00145</a> <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;ag_timestamp=$_POST['<a class="code" href="action_8inc_8php.html#a5">ag_timestamp</a>'];
<a name="l00146"></a><a class="code" href="action_8inc_8php.html#a6">00146</a> <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;d_state=$_POST['<a class="code" href="action_8inc_8php.html#a6">d_state</a>'];
<a name="l00147"></a><a class="code" href="action_8inc_8php.html#a7">00147</a> <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;dt_id=(isset($_POST['<a class="code" href="action_8inc_8php.html#a7">dt_id</a>']))?$_POST['<a class="code" href="action_8inc_8php.html#a7">dt_id</a>']:0;
<a name="l00148"></a><a class="code" href="action_8inc_8php.html#a8">00148</a> <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;qcode=$_POST['<a class="code" href="action_8inc_8php.html#a8">qcode</a>'];
<a name="l00149"></a><a class="code" href="action_8inc_8php.html#a9">00149</a> <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;ag_title=$_POST['<a class="code" href="action_8inc_8php.html#a9">ag_title</a>'];
<a name="l00150"></a><a class="code" href="action_8inc_8php.html#a10">00150</a> <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;d_id=(isset($_POST['<a class="code" href="action_8inc_8php.html#a10">d_id</a>']))?$_POST['<a class="code" href="action_8inc_8php.html#a10">d_id</a>']:0;
<a name="l00151"></a>00151 <span class="keywordflow">if</span> ( $act-&gt;Update() == false ) {
<a name="l00152"></a>00152 <a class="code" href="action_8inc_8php.html#a0">$sub_action</a>=<span class="stringliteral">"detail"</span>;
<a name="l00153"></a>00153 }
<a name="l00154"></a>00154 <span class="keywordflow">else</span>
<a name="l00155"></a>00155 {
<a name="l00156"></a>00156 <a class="code" href="action_8inc_8php.html#a19">ShowActionList</a>($cn,$retour,$h_url);
<a name="l00157"></a>00157 }
<a name="l00158"></a>00158
<a name="l00159"></a>00159 }
<a name="l00160"></a>00160 <span class="comment">//--------------------------------------------------------------------------------</span>
<a name="l00161"></a>00161 <span class="comment">// Show the detail of an action</span>
<a name="l00162"></a>00162 <span class="comment">// permit the update</span>
<a name="l00163"></a>00163 <span class="keywordflow">if</span> ( $sub_action=='detail' )
<a name="l00164"></a>00164 {
<a name="l00165"></a>00165 <a class="code" href="action_8inc_8php.html#a17">$act</a>=<span class="keyword">new</span> <a class="code" href="classaction.html">action</a>($cn);
<a name="l00166"></a>00166 <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;ag_id=$_REQUEST['<a class="code" href="action_8inc_8php.html#a3">ag_id</a>'];
<a name="l00167"></a>00167 echo <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;get();
<a name="l00168"></a>00168 <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;ag_comment=<a class="code" href="ac__common_8php.html#a16">Decode</a>($act-&gt;ag_comment);
<a name="l00169"></a>00169 echo '&lt;form <a class="code" href="action_8inc_8php.html#a12">name</a>=<span class="stringliteral">"RTEDemo"</span> <a class="code" href="classaction.html">action</a>=<span class="stringliteral">"commercial.php"</span> enctype=<span class="stringliteral">"multipart/form-data"</span> method=<span class="stringliteral">"post"</span> onsubmit=<span class="stringliteral">"return submitForm();"</span> &gt;';
<a name="l00170"></a>00170 echo <a class="code" href="constant_8php.html#a80">JS_SEARCH_CARD</a>;
<a name="l00171"></a>00171 echo <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;display('UPD',<span class="keyword">false</span>);
<a name="l00172"></a>00172 echo '&lt;input type=<span class="stringliteral">"hidden"</span> name=<span class="stringliteral">"p_action"</span> <a class="code" href="action_8inc_8php.html#a13">value</a>=<span class="stringliteral">"suivi_courrier"</span>&gt;';
<a name="l00173"></a>00173 echo '&lt;input type=<span class="stringliteral">"hidden"</span> name=<span class="stringliteral">"sa"</span> <a class="code" href="action_8inc_8php.html#a13">value</a>=<span class="stringliteral">"update"</span>&gt;';
<a name="l00174"></a><a class="code" href="action_8inc_8php.html#a11">00174</a> <a class="code" href="action_8inc_8php.html#a11">$upload</a>=<span class="keyword">new</span> <a class="code" href="classwidget.html">widget</a>(<span class="stringliteral">"file"</span>);
<a name="l00175"></a><a class="code" href="action_8inc_8php.html#a12">00175</a> <a class="code" href="action_8inc_8php.html#a11">$upload</a>-&gt;name=<span class="stringliteral">"file_upload"</span>;
<a name="l00176"></a><a class="code" href="action_8inc_8php.html#a13">00176</a> <a class="code" href="action_8inc_8php.html#a11">$upload</a>-&gt;value=<span class="stringliteral">""</span>;
<a name="l00177"></a>00177 echo <span class="stringliteral">"Enregistrer le fichier "</span>.$upload-&gt;IOValue();
<a name="l00178"></a>00178 echo <a class="code" href="action_8inc_8php.html#a11">$upload</a>-&gt;Submit(<span class="stringliteral">"save"</span>,<span class="stringliteral">"Sauve"</span>);
<a name="l00179"></a>00179 echo '&lt;/form&gt;';
<a name="l00180"></a>00180 echo <a class="code" href="action_8inc_8php.html#a1">$retour</a>;
<a name="l00181"></a>00181
<a name="l00182"></a>00182 }
<a name="l00183"></a>00183
<a name="l00184"></a>00184
<a name="l00185"></a>00185 <span class="comment">//--------------------------------------------------------------------------------</span>
<a name="l00186"></a>00186 <span class="comment">// Show a list of the action</span>
<a name="l00187"></a>00187 <span class="keywordflow">if</span> ( $sub_action == <span class="stringliteral">"list"</span> )
<a name="l00188"></a>00188 <a class="code" href="action_8inc_8php.html#a19">ShowActionList</a>($cn,$retour,$h_url);
<a name="l00189"></a>00189
<a name="l00190"></a>00190 <span class="comment">//--------------------------------------------------------------------------------</span>
<a name="l00191"></a>00191 <span class="comment">// Add an action</span>
<a name="l00192"></a>00192 <span class="keywordflow">if</span> ( $sub_action == <span class="stringliteral">"add_action"</span> )
<a name="l00193"></a>00193 {
<a name="l00194"></a>00194 echo <a class="code" href="action_8inc_8php.html#a1">$retour</a>;
<a name="l00195"></a>00195 <a class="code" href="action_8inc_8php.html#a17">$act</a>=<span class="keyword">new</span> <a class="code" href="classaction.html">action</a>($cn);
<a name="l00196"></a>00196 <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;ag_id=0;
<a name="l00197"></a>00197 <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;ag_timestamp=(isset($_POST['<a class="code" href="action_8inc_8php.html#a5">ag_timestamp</a>']))?$_POST['<a class="code" href="action_8inc_8php.html#a5">ag_timestamp</a>']:<span class="stringliteral">""</span>;
<a name="l00198"></a>00198 <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;qcode=isset($_POST['tiers'])?$_REQUEST['tiers']:<span class="stringliteral">""</span>;
<a name="l00199"></a>00199 <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;d_id=0;
<a name="l00200"></a>00200 <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;dt_id=isset($_POST['<a class="code" href="action_8inc_8php.html#a7">dt_id</a>'])?$_REQUEST['<a class="code" href="action_8inc_8php.html#a7">dt_id</a>']:<span class="stringliteral">""</span>;
<a name="l00201"></a>00201 <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;d_state=(isset($_POST['<a class="code" href="action_8inc_8php.html#a6">d_state</a>']))?$_POST['<a class="code" href="action_8inc_8php.html#a6">d_state</a>']:<span class="stringliteral">""</span>;
<a name="l00202"></a><a class="code" href="action_8inc_8php.html#a14">00202</a> <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;ag_ref=<span class="stringliteral">""</span>;
<a name="l00203"></a>00203 <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;ag_title=(isset($_POST['<a class="code" href="action_8inc_8php.html#a9">ag_title</a>']))?$_POST['<a class="code" href="action_8inc_8php.html#a9">ag_title</a>']:<span class="stringliteral">""</span>;
<a name="l00204"></a>00204 echo '&lt;div <span class="keyword">class</span>=<span class="stringliteral">"u_redcontent"</span>&gt;';
<a name="l00205"></a>00205 echo JS_SEARCH_CARD;
<a name="l00206"></a>00206 <span class="comment">// Add hidden tag</span>
<a name="l00207"></a>00207 echo '&lt;form name=<span class="stringliteral">"RTEDemo"</span> <a class="code" href="classaction.html">action</a>=<span class="stringliteral">"commercial.php?p_action=suivi_courrier"</span> method=<span class="stringliteral">"post"</span> onsubmit=<span class="stringliteral">"return submitForm();"</span>&gt;';
<a name="l00208"></a>00208
<a name="l00209"></a>00209 <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;ag_comment=(isset($_POST['<a class="code" href="action_8inc_8php.html#a4">ag_comment</a>']))?<a class="code" href="ac__common_8php.html#a16">Decode</a>($_POST['<a class="code" href="action_8inc_8php.html#a4">ag_comment</a>']):<span class="stringliteral">""</span>;
<a name="l00210"></a>00210 echo <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;Display('NEW',<span class="keyword">false</span>);
<a name="l00211"></a>00211
<a name="l00212"></a>00212 echo '&lt;input type=<span class="stringliteral">"hidden"</span> name=<span class="stringliteral">"p_action"</span> <a class="code" href="action_8inc_8php.html#a13">value</a>=<span class="stringliteral">"suivi_courrier"</span>&gt;';
<a name="l00213"></a>00213 echo '&lt;input type=<span class="stringliteral">"hidden"</span> name=<span class="stringliteral">"sa"</span> <a class="code" href="action_8inc_8php.html#a13">value</a>=<span class="stringliteral">"save_action_st1"</span>&gt;';
<a name="l00214"></a>00214
<a name="l00215"></a>00215 echo <a class="code" href="action_8inc_8php.html#a2">$h_url</a>;
<a name="l00216"></a>00216 echo '&lt;input type=<span class="stringliteral">"submit"</span> name=<span class="stringliteral">"save_action_st1"</span> <a class="code" href="action_8inc_8php.html#a13">value</a>=<span class="stringliteral">"Sauver"</span>&gt;&lt;/p&gt;'.
<a name="l00217"></a>00217 '&lt;/form&gt;'.
<a name="l00218"></a>00218 '&lt;/div&gt;';
<a name="l00219"></a>00219
<a name="l00220"></a>00220 }
<a name="l00221"></a>00221 <span class="comment">//--------------------------------------------------------------------------------</span>
<a name="l00222"></a>00222 <span class="comment">// Save Action</span>
<a name="l00223"></a>00223 <span class="comment">// Stage 1 : show the result and confirm</span>
<a name="l00224"></a>00224 <span class="comment">//--------------------------------------------------------------------------------</span>
<a name="l00225"></a>00225 <span class="keywordflow">if</span> ( $sub_action == <span class="stringliteral">"save_action_st1"</span> )
<a name="l00226"></a>00226 {
<a name="l00227"></a>00227 <a class="code" href="action_8inc_8php.html#a17">$act</a>=<span class="keyword">new</span> <a class="code" href="classaction.html">action</a>($cn);
<a name="l00228"></a>00228 <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;ag_timestamp=$_POST['<a class="code" href="action_8inc_8php.html#a5">ag_timestamp</a>'];
<a name="l00229"></a>00229 <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;ag_comment=$_POST['ag_comment'];
<a name="l00230"></a>00230 <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;ag_timestamp=$_POST['<a class="code" href="action_8inc_8php.html#a5">ag_timestamp</a>'];
<a name="l00231"></a>00231 <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;d_state=$_POST['<a class="code" href="action_8inc_8php.html#a6">d_state</a>'];
<a name="l00232"></a>00232 <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;dt_id=$_POST['<a class="code" href="action_8inc_8php.html#a7">dt_id</a>'];
<a name="l00233"></a>00233 <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;qcode=$_POST['<a class="code" href="action_8inc_8php.html#a8">qcode</a>'];
<a name="l00234"></a>00234 <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;ag_title=$_POST['<a class="code" href="action_8inc_8php.html#a9">ag_title</a>'];
<a name="l00235"></a>00235 <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;d_id=0;
<a name="l00236"></a>00236 <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;ag_id=$_POST['<a class="code" href="action_8inc_8php.html#a3">ag_id</a>'];
<a name="l00237"></a>00237 echo <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;Confirm();
<a name="l00238"></a>00238 }
<a name="l00239"></a>00239 <span class="comment">//--------------------------------------------------------------------------------</span>
<a name="l00240"></a>00240 <span class="comment">// Save Action</span>
<a name="l00241"></a>00241 <span class="comment">// Stage 2 : Save the action and propose to save a file</span>
<a name="l00242"></a>00242 <span class="comment">//--------------------------------------------------------------------------------</span>
<a name="l00243"></a>00243 <span class="keywordflow">if</span> ( $sub_action == <span class="stringliteral">"save_action_st2"</span> )
<a name="l00244"></a>00244 {
<a name="l00245"></a>00245 <a class="code" href="action_8inc_8php.html#a17">$act</a>=<span class="keyword">new</span> <a class="code" href="classaction.html">action</a>($cn);
<a name="l00246"></a>00246
<a name="l00247"></a>00247 <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;ag_comment=$_POST['ag_comment'];
<a name="l00248"></a>00248 <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;ag_timestamp=$_POST['<a class="code" href="action_8inc_8php.html#a5">ag_timestamp</a>'];
<a name="l00249"></a>00249 <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;d_state=$_POST['<a class="code" href="action_8inc_8php.html#a6">d_state</a>'];
<a name="l00250"></a>00250 <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;dt_id=$_POST['<a class="code" href="action_8inc_8php.html#a7">dt_id</a>'];
<a name="l00251"></a>00251 <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;qcode=$_POST['tiers'];
<a name="l00252"></a>00252 <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;ag_title=$_POST['<a class="code" href="action_8inc_8php.html#a9">ag_title</a>'];
<a name="l00253"></a>00253 <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;d_id=0;
<a name="l00254"></a>00254
<a name="l00255"></a><a class="code" href="action_8inc_8php.html#a15">00255</a> <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;md_id=(isset($_POST['gen_doc']))?$_POST['gen_doc']:0;
<a name="l00256"></a>00256
<a name="l00257"></a><a class="code" href="action_8inc_8php.html#a16">00257</a> <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;gen=isset($_POST['p_gen'])?'on<span class="charliteral">':'</span>off';
<a name="l00258"></a>00258 <span class="comment">// insert into action_gestion</span>
<a name="l00259"></a>00259 echo <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;SaveStage2();
<a name="l00260"></a>00260 echo '&lt;A HREF=<span class="stringliteral">"commercial.php?p_action=suivi_courrier"</span>&gt;&lt;INPUT TYPE=<span class="stringliteral">"BUTTON"</span> VALUE=<span class="stringliteral">"Retour Liste"</span>&gt;&lt;/A&gt;';
<a name="l00261"></a>00261 }
<a name="l00262"></a>00262
<a name="l00263"></a>00263 <span class="comment">//--------------------------------------------------------------------------------</span>
<a name="l00264"></a>00264 <span class="comment">// Save Document</span>
<a name="l00265"></a>00265 <span class="comment">// Stage 3 : Save the document</span>
<a name="l00266"></a>00266 <span class="comment">//--------------------------------------------------------------------------------</span>
<a name="l00267"></a>00267 <span class="keywordflow">if</span> ( $sub_action == <span class="stringliteral">"save_action_st3"</span> )
<a name="l00268"></a>00268 {
<a name="l00269"></a>00269 <a class="code" href="debug_8php.html#a0">echo_debug</a>(<span class="stringliteral">"action.inc.php"</span>,__LINE__,'Stage 3');
<a name="l00270"></a><a class="code" href="action_8inc_8php.html#a17">00270</a> <a class="code" href="action_8inc_8php.html#a17">$act</a>=<span class="keyword">new</span> <a class="code" href="classaction.html">action</a>($cn);
<a name="l00271"></a>00271 <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;ag_id=$_POST['<a class="code" href="action_8inc_8php.html#a3">ag_id</a>'];
<a name="l00272"></a>00272 <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;ag_comment=$_POST['ag_comment'];
<a name="l00273"></a>00273 <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;ag_timestamp=$_POST['<a class="code" href="action_8inc_8php.html#a5">ag_timestamp</a>'];
<a name="l00274"></a>00274 <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;d_state=$_POST['<a class="code" href="action_8inc_8php.html#a6">d_state</a>'];
<a name="l00275"></a>00275 <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;dt_id=$_POST['<a class="code" href="action_8inc_8php.html#a7">dt_id</a>'];
<a name="l00276"></a>00276 <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;qcode=$_POST['<a class="code" href="action_8inc_8php.html#a8">qcode</a>'];
<a name="l00277"></a>00277 <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;ag_title=$_POST['<a class="code" href="action_8inc_8php.html#a9">ag_title</a>'];
<a name="l00278"></a><a class="code" href="action_8inc_8php.html#a18">00278</a> <a class="code" href="action_8inc_8php.html#a18">$d_id</a>=(isset($_POST['<a class="code" href="action_8inc_8php.html#a10">d_id</a>']))?$_POST['<a class="code" href="action_8inc_8php.html#a10">d_id</a>']:0;
<a name="l00279"></a>00279 echo <a class="code" href="action_8inc_8php.html#a17">$act</a>-&gt;SaveStage3($<a class="code" href="action_8inc_8php.html#a10">d_id</a>);
<a name="l00280"></a>00280
<a name="l00281"></a>00281 <a class="code" href="action_8inc_8php.html#a19">ShowActionList</a>($cn,$retour,$h_url);
<a name="l00282"></a>00282
<a name="l00283"></a>00283 }
<a name="l00284"></a>00284 <span class="comment">//---------------------------------------------------------------------</span>
<a name="l00285"></a>00285
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Wed Jun 28 02:07:23 2006 for phpcompta by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.4 </small></address>
</body>
</html>