+ *
* The table document_type are the possible actions
*/
-/*!
+/* !
* \brief class_action for manipulating actions
* action can be :
*
@@ -60,644 +61,656 @@ require_once 'class_sort_table.php';
class Follow_Up
{
- var $db; /*!< $db database connexion */
- var $ag_timestamp; /*!< $ag_timestamp document date (ag_gestion.ag_timestamp)*/
- var $dt_id; /*!< $dt_id type of the document (document_type.dt_id)*/
- var $ag_state; /*!< $ag_state stage of the document (printed, send to client...)*/
- var $d_number; /*!< $d_number number of the document*/
- var $d_filename; /*!< $d_filename filename's document */
- var $d_mimetype; /*!< $d_mimetype document's filename */
- var $ag_title; /*!< $ag_title title document */
- var $f_id; /*!< $f_id_dest fiche id (From field ) */
- var $ag_ref_ag_id; /*!< $ag_ref_ag_id concern previous action*/
- var $ag_ref; /*!< $ag_ref is the ref */
- var $ag_hour; /*!< $ag_hour is the hour of the meeting, action */
- var $ag_priority; /*!< $ag_priority is the priority 1 High, 2 medium, 3 low */
- var $ag_dest; /*!< $ag_dest person who is in charged */
- var $ag_contact; /*!< $ag_contact contact */
- var $ag_remind_date; /*!< $ag_contact contact */
- /*! constructor
- * \brief constructor
- * \param p_cn database connection
- */
- function __construct ($p_cn)
- {
- $this->db=$p_cn;
- $this->f_id=0;
- }
- //----------------------------------------------------------------------
- /*!
- * \brief Display the object, the tags for the FORM
- * are in the caller. It will be used for adding and updating
- * action
- *\note If ag_id is not equal to zero then it is an update otherwise
- * it is a new document
- *
- * \param $p_view if set to true the form will be in readonly mode (value: true or false)
- * \param $p_gen true we show the tag for generating a doc (value : true or false)
- *\param $p_base is the ac parameter
- *\param $retour is the html code for the return button
- * \note update the reference number or the document type is not allowed
- *
- *
- * \return string containing the html code
- */
- function Display($p_view,$p_gen,$p_base,$retour="")
- {
- if ( $p_view=='UPD')
- {
- $upd=true;
- $readonly=false;
- }
- elseif ($p_view=="NEW")
- {
- $upd=false;
- $readonly=false;
- }
- elseif ($p_view=='READ')
- {
- $upd=true;
- $readonly=true;
- }
- else
- {
- exit('class_action'.__LINE__.'Follow_Up::Display error unknown parameter'.$p_view);
+ var $db; /* !< $db database connexion */
+ var $ag_timestamp; /* !< $ag_timestamp document date (ag_gestion.ag_timestamp) */
+ var $dt_id; /* !< $dt_id type of the document (document_type.dt_id) */
+ var $ag_state; /* !< $ag_state stage of the document (printed, send to client...) */
+ var $d_number; /* !< $d_number number of the document */
+ var $d_filename; /* !< $d_filename filename's document */
+ var $d_mimetype; /* !< $d_mimetype document's filename */
+ var $ag_title; /* !< $ag_title title document */
+ var $f_id; /* !< $f_id_dest fiche id (From field ) */
+ var $ag_ref_ag_id; /* !< $ag_ref_ag_id concern previous action */
+ var $ag_ref; /* !< $ag_ref is the ref */
+ var $ag_hour; /* !< $ag_hour is the hour of the meeting, action */
+ var $ag_priority; /* !< $ag_priority is the priority 1 High, 2 medium, 3 low */
+ var $ag_dest; /* !< $ag_dest person who is in charged */
+ var $ag_contact; /* !< $ag_contact contact */
+ var $ag_remind_date; /* !< $ag_contact contact */
- }
- // Compute the widget
- // Date
- $date=new IDate();
- $date->readonly=$readonly;
- $date->name="ag_timestamp";
- $date->value=$this->ag_timestamp;
+ /* ! constructor
+ * \brief constructor
+ * \param p_cn database connection
+ */
- $remind_date=new IDate();
- $remind_date->readonly=$readonly;
- $remind_date->name="ag_remind_date";
- $remind_date->value=$this->ag_remind_date;
+ function __construct($p_cn)
+ {
+ $this->db = $p_cn;
+ $this->f_id = 0;
+ }
+
+ //----------------------------------------------------------------------
+ /* !
+ * \brief Display the object, the tags for the FORM
+ * are in the caller. It will be used for adding and updating
+ * action
+ * \note If ag_id is not equal to zero then it is an update otherwise
+ * it is a new document
+ *
+ * \param $p_view if set to true the form will be in readonly mode (value: true or false)
+ * \param $p_gen true we show the tag for generating a doc (value : true or false)
+ * \param $p_base is the ac parameter
+ * \param $retour is the html code for the return button
+ * \note update the reference number or the document type is not allowed
+ *
+ *
+ * \return string containing the html code
+ */
+ function Display($p_view, $p_gen, $p_base, $retour = "")
+ {
+ if ($p_view == 'UPD')
+ {
+ $upd = true;
+ $readonly = false;
+ }
+ elseif ($p_view == "NEW")
+ {
+ $upd = false;
+ $readonly = false;
+ }
+ elseif ($p_view == 'READ')
+ {
+ $upd = true;
+ $readonly = true;
+ }
+ else
+ {
+ exit('class_action' . __LINE__ . 'Follow_Up::Display error unknown parameter' . $p_view);
+ }
+ // Compute the widget
+ // Date
+ $date = new IDate();
+ $date->readonly = $readonly;
+ $date->name = "ag_timestamp";
+ $date->value = $this->ag_timestamp;
+
+ $remind_date = new IDate();
+ $remind_date->readonly = $readonly;
+ $remind_date->name = "ag_remind_date";
+ $remind_date->value = $this->ag_remind_date;
// Doc Type
- $doc_type=new ISelect();
- $doc_type->name="dt_id";
- $doc_type->value=$this->db->make_array("select dt_id,dt_value from document_type order by dt_value");
- $doc_type->selected=$this->dt_id;
- $doc_type->readonly=false;
- $str_doc_type=$doc_type->input();
+ $doc_type = new ISelect();
+ $doc_type->name = "dt_id";
+ $doc_type->value = $this->db->make_array("select dt_id,dt_value from document_type order by dt_value");
+ $doc_type->selected = $this->dt_id;
+ $doc_type->readonly = false;
+ $str_doc_type = $doc_type->input();
- // Description
- $desc=new ITextArea();
- $desc->width=70;
- $desc->heigh=5;
- $desc->name="ag_comment";
- $desc->readonly=$readonly;
- if ( strlen($desc->value) >300 )
- {
- $desc->width=120;
- $desc->heigh=40;
- }
- $acomment=$this->db->get_array("SELECT agc_id, ag_id, to_char(agc_date,'DD.MM.YYYY') as str_agc_date, agc_comment, tech_user
- FROM action_gestion_comment where ag_id=$1 order by agc_id;",
- array($this->ag_id)
- );
+ // Description
+ $desc = new ITextArea();
+ $desc->width = 70;
+ $desc->heigh = 5;
+ $desc->name = "ag_comment";
+ $desc->readonly = $readonly;
+ if (strlen($desc->value) > 300)
+ {
+ $desc->width = 120;
+ $desc->heigh = 40;
+ }
+ $acomment = $this->db->get_array("SELECT agc_id, ag_id, to_char(agc_date,'DD.MM.YYYY') as str_agc_date, agc_comment, tech_user
+ FROM action_gestion_comment where ag_id=$1 order by agc_id;", array($this->ag_id)
+ );
// List opération liées
- $operation=$this->db->get_array("select ago_id,j.jr_id,j.jr_internal,j.jr_comment from jrn as j join action_gestion_operation as ago on (j.jr_id=ago.jr_id)
- where ag_id=$1",array($this->ag_id));
- $iconcerned=new IConcerned('operation');
- // state
- // Retrieve the value
- $a=$this->db->make_array("select s_id,s_value from document_state ");
- $state=new ISelect();
- $state->readonly=$readonly;
- $state->name="ag_state";
- $state->value=$a;
- $state->selected=$this->ag_state;
- $str_state=$state->input();
+ $operation = $this->db->get_array("select ago_id,j.jr_id,j.jr_internal,j.jr_comment from jrn as j join action_gestion_operation as ago on (j.jr_id=ago.jr_id)
+ where ag_id=$1", array($this->ag_id));
+ $iconcerned = new IConcerned('operation');
- // Retrieve the value if there is an attached doc
- $doc_ref="";
- // Document id
+ // List related action
+ $action = $this->db->get_array("
+ select ag_id,substr(ag_title,1,20) as sub_title,to_char(ag_timestamp,'DD.MM.YY') as str_date ,
+ ag_timestamp
+ from action_gestion
+ where
+ ag_id in (select aga_greatest from action_gestion_related where aga_least =$1)
+ or
+ ag_id in (select aga_least from action_gestion_related where aga_greatest =$1)
+ order by ag_timestamp",array($this->ag_id));
+ $iaction=new IRelated_Action('action');
+ // state
+ // Retrieve the value
+ $a = $this->db->make_array("select s_id,s_value from document_state ");
+ $state = new ISelect();
+ $state->readonly = $readonly;
+ $state->name = "ag_state";
+ $state->value = $a;
+ $state->selected = $this->ag_state;
+ $str_state = $state->input();
- $h2=new IHidden();
- $h2->name="d_id";
- $h2->value=$this->d_id;
+ // Retrieve the value if there is an attached doc
+ $doc_ref = "";
+ // Document id
- if ( $this->d_id != 0 && $this->d_id != "" )
- {
- $h2->readonly=($p_view=='NEW')?false:true;
- $doc=new Document($this->db,$this->d_id);
- $doc->get();
- if ( strlen(trim($doc->d_lob)) != 0 )
- {
- $d_id=new IHidden();
- $doc_ref="
';
return $r;
}
diff --git a/include/class_irelated_action.php b/include/class_irelated_action.php
new file mode 100644
index 000000000..5dd18b006
--- /dev/null
+++ b/include/class_irelated_action.php
@@ -0,0 +1,71 @@
+name=$p_name;
+ $this->value=$p_value;
+ $this->amount_id=null;
+ $this->paid='';
+ }
+ /*!\brief show the html input of the widget*/
+ public function input($p_name=null,$p_value=null)
+ {
+ $this->name=($p_name==null)?$this->name:$p_name;
+ $this->value=($p_value==null)?$this->value:$p_value;
+ if ( $this->readOnly==true) return $this->display();
+
+
+
+ $r=sprintf("
+
+
+
+
+ ",
+ $this->name,
+ $this->name,
+ $this->name,
+ $this->value,
+ $this->name
+ );
+ return $r;
+ }
+ /*!\brief print in html the readonly value of the widget*/
+ public function display()
+ {
+ $r=sprintf("%s",$this->value);
+ $r.=sprintf('', $this->name,$this->value);
+ return $r;
+
+ }
+ static public function test_me()
+ {
+ }
+}
diff --git a/include/template/action_button.php b/include/template/action_button.php
new file mode 100644
index 000000000..a34d68300
--- /dev/null
+++ b/include/template/action_button.php
@@ -0,0 +1,44 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/include/template/action_search.php b/include/template/action_search.php
new file mode 100644
index 000000000..5052865ae
--- /dev/null
+++ b/include/template/action_search.php
@@ -0,0 +1,107 @@
+
+ if (! $inner ) : ?>
+