21require_once NOALYSS_INCLUDE.
'/lib/user_common.php';
95 $this->aAction_detail=array();
104 $r =
" Follow_Up object =>";
105 $r .=
'ag_timestamp = ['. $this->ag_timestamp.
']';
106 $r .=
'dt_id = ['. $this->dt_id.
']';
107 $r .=
'ag_state = ['. $this->ag_state.
']';
108 $r .=
'd_number = ['. $this->d_number.
']';
109 $r .=
'd_filename = ['. $this->d_filename.
']';
110 $r .=
'd_mimetype = ['. $this->d_mimetype.
']';
111 $r .=
'ag_title = ['. $this->ag_title.
']';
112 $r .=
'f_id = ['. $this->f_id.
']';
113 $r .=
'ag_ref = ['. $this->ag_ref.
']';
114 $r .=
'ag_hour = ['. $this->ag_hour.
']';
115 $r .=
'ag_priority = ['. $this->ag_priority.
']';
116 $r .=
'ag_dest = ['. $this->ag_dest.
']';
117 $r .=
'ag_contact = ['. $this->ag_contact.
']';
118 $r .=
'ag_remind_date = ['. $this->ag_remind_date.
']';
119 $r .=
'f_id_dest = ['. $this->f_id_dest.
']';
120 $r .=
'ag_description = ['. $this->ag_description.
']';
138 $profile=
$cn->get_value(
"select p_id from profile_user where user_name=$1", array(
$g_user->login));
141 if (
$g_user->isAdmin() == 1) {
146 $sql=
" (ag_dest in (select p_granted from user_sec_action_profile where p_id=$profile and ua_right !='X' ) ) ";
147 }
else if ($p_mode==
'W')
149 $sql=
" ( ag_dest in (select p_granted from user_sec_action_profile where p_id=$profile and ua_right in ('W','O') ) )";
152 throw new Exception(_(
'Securité'));
194 throw new Exception(
'class_action'.__LINE__.
'Follow_Up::Display error unknown parameter'.$p_view);
202 $date->name=
"ag_timestamp";
203 $date->id=
"ag_timestamp";
206 $remind_date=
new IDate();
208 $remind_date->name=
"ag_remind_date";
209 $remind_date->id=
"ag_remind_date";
216 $doc_type->value=$this->
db->make_array(
"select dt_id,dt_value from document_type order by dt_value", 1);
222 $desc=
new ITextArea();
223 $desc->set_enrichText(
"enrich");
224 $desc->style=
' class="itextarea" style="width:80%;margin-left:5%;"';
225 $desc->name=
"ag_comment";
227 $acomment=$this->
db->get_array(
"SELECT agc_id, ag_id, to_char(agc_date,'DD.MM.YYYY HH24:MI') as str_agc_date, agc_comment, agc_comment_raw,tech_user
228 FROM action_gestion_comment where ag_id=$1 order by agc_id", array($this->
ag_id)
232 $operation=$this->
db->get_array(
"select ago_id,j.jr_id,j.jr_internal,j.jr_comment,to_char(j.jr_date,'DD.MM.YY') as str_date
233 from jrn as j join action_gestion_operation as ago on (j.jr_id=ago.jr_id)
234 where ag_id=$1 order by jr_date", array($this->
ag_id));
239 $iaction->value=(isset($this->action))?$this->action:
"";
243 $a=$this->
db->make_array(
"select s_id,s_value from document_state ");
246 $state->name=
"ag_state";
249 $str_state=$state->input();
257 $h2->value=$this->d_id;
259 if ($this->d_id!=0&&$this->d_id!=
"")
261 $h2->readonly=($p_view==
'NEW')?
false:
true;
267 $doc_ref=
"<p> Document ".$doc->anchor().
'</p>';
268 $doc_ref.=$h2->input().$d_id->input(
'd_id', $this->d_id);
279 $title->style=
'style="font-size:2rem;font-weight:bold"';
287 $ag_priority->value=array(array(
'value'=>1,
'label'=>_(
'Haute')),
288 array(
'value'=>2,
'label'=>_(
'Normale')),
289 array(
'value'=>3,
'label'=>_(
'Basse'))
299 $ag_hour->javascript=
" onblur=check_hour('ag_hour');";
307 $aAg_dest=$this->
db->make_array(
"select p_id as value, ".
309 " from profile where p_id in ".$g_user->sql_writable_profile().
" order by 2");
318 $client_label=
new ISpan();
321 $f_add_button=
new IButton(
'add_card');
322 $f_add_button->label=_(
'Créer une nouvelle fiche');
323 $f_add_button->set_attribute(
'ipopup',
'ipop_newcard');
324 $filter=$this->
db->make_list(
'select fd_id from fiche_def ');
325 $f_add_button->set_attribute(
'filter',
$filter);
327 $f_add_button->javascript=
" select_card_type(this);";
328 $str_add_button=$f_add_button->input();
334 $tiers->get_by_qcode($this->qcode_dest);
335 $qcode_dest_label=strtoupper(
$tiers->strAttribut(1));
337 $this->f_id_dest=
$tiers->id;
341 $qcode_dest_label=($this->f_id_dest==0||trim($this->qcode_dest??
"")==
"")?
'Interne ':
'Error';
351 $w->name=
'qcode_dest';
352 $w->value=($this->f_id_dest!=0)?$this->qcode_dest:
"";
357 $w->set_dblclick(
"fill_ipopcard(this);");
358 $w->set_attribute(
'ipopup',
'ipopcard');
361 $w->set_attribute(
'label',
'qcode_dest_label');
363 $w->set_attribute(
'typecard',
$w->extra);
364 $w->set_function(
'fill_data');
365 $w->javascript=sprintf(
' onchange="fill_data_onchange(\'%s\');" ',
$w->name);
369 $sp->extra=
'class="text-"';
370 $sp->name=
'qcode_dest_label';
371 $sp->value=$qcode_dest_label;
381 if ($this->ag_contact!=0)
383 $contact=
new Fiche($this->
db, $this->ag_contact);
389 $list_contact=$this->
db->make_list(
'select fd_id from fiche_def where frd_id=16');
390 $ag_contact->extra=$list_contact;
394 $ag_contact->set_attribute(
'label',
'ag_contact_label');
396 $ag_contact->set_attribute(
'typecard', $list_contact);
400 $spcontact=
new ISpan();
401 $spcontact->name=
'ag_contact_label';
402 $spcontact->value=
'';
403 $fiche_contact=
new Fiche($this->
db,$this->ag_contact);
405 if ($fiche_contact->id!=0)
407 $spcontact->value=strtoupper($fiche_contact->strAttribut(
ATTR_DEF_NAME)??
"");
413 $iag_ref=
new IText(
"ag_ref");
415 $iag_ref->readOnly=
false;
416 $str_ag_ref=$iag_ref->input();
422 $upload->name=
"file_upload[]";
423 $upload->set_multiple(
true);
424 $upload->setAlertOnSize(
true);
427 $aAttachedFile=$this->
db->get_array(
'select d_id,d_filename,d_description,d_mimetype,'.
428 '\'export.php?act=RAW:document&
'.
429 Dossier::get().'&d_id=\
'||d_id as link'.
430 ' from document where ag_id=$1', array($this->
ag_id));
433 $aDocMod->name=
'doc_mod';
434 $aDocMod->value=$this->
db->make_array(
'select md_id,dt_value||\' : \'||md_name as md_name'.
435 ' from document_modele join document_type on (md_type=dt_id)'.
436 " where md_affect ='GES' and md_type = $1 ".
437 ' order by md_name',0,[$this->dt_id]);
438 $str_select_doc=$aDocMod->input();
440 if (empty($aDocMod->value))
441 $str_submit_generate=
"";
451 $icard->extra2=
'QuickCode';
460 $r.=dossier::hidden();
462 $r.=
HtmlInput::request_to_hidden(array(
"closed_action",
"remind_date_end",
"remind_date",
"sag_ref",
"only_internal",
"state",
"qcode",
"ag_dest_query",
"action_query",
"tdoc",
"date_start",
"date_end",
"hsstate",
"searchtag"));
467 require NOALYSS_TEMPLATE.
'/follow_up-display.php';
475 $r.=$h_ag_id->input(
'ag_id', $this->
ag_id);
477 $r.=$hidden2->input(
'f_id_dest', $this->f_id_dest);
489 $sql=
"select ag_id,to_char (ag_timestamp,'DD.MM.YYYY') as ag_timestamp,".
490 " f_id_dest,ag_title,ag_ref,d_id,ag_type,ag_state, ag_owner, ".
491 " ag_dest, ag_hour, ag_priority, ag_contact,to_char (ag_remind_date,'DD.MM.YYYY') as ag_remind_date ".
492 " from action_gestion left join document using (ag_id) where ag_id=".$this->ag_id;
500 $this->ag_timestamp=
$row[0][
'ag_timestamp'];
501 $this->ag_contact=
$row[0][
'ag_contact'];
502 $this->f_id_dest=
$row[0][
'f_id_dest'];
503 $this->ag_title=
$row[0][
'ag_title'];
504 $this->ag_type=
$row[0][
'ag_type'];
505 $this->ag_ref=
$row[0][
'ag_ref'];
506 $this->ag_state=
$row[0][
'ag_state'];
507 $this->d_id=
$row[0][
'd_id'];
508 $this->ag_dest=
$row[0][
'ag_dest'];
509 $this->ag_hour=
$row[0][
'ag_hour'];
510 $this->ag_priority=
$row[0][
'ag_priority'];
511 $this->ag_remind_date=
$row[0][
'ag_remind_date'];
512 $this->ag_owner=
$row[0][
'ag_owner'];
515 $action_detail->set_parameter(
'ag_id', $this->
ag_id);
516 $this->aAction_detail=$action_detail->load_all();
525 $this->state=
$row[
'0'][
'ag_state'];
526 $this->ag_state=
$row[0][
'ag_state'];
528 $this->dt_id=$this->ag_type;
529 $aexp=
new Fiche($this->
db, $this->f_id_dest);
552 $exp->get_by_qcode($this->qcode_dest);
553 $exp->id=($exp->id==0)?
null:$exp->id;
558 if (trim($this->ag_title??
"")==
"")
560 $doc_mod=
new document_type($this->
db);
563 $this->ag_title=$doc_mod->dt_value;
565 $this->
ag_id=$this->
db->get_next_seq(
'action_gestion_ag_id_seq');
566 $seq_name=
"seq_doc_type_".$this->dt_id;
570 $ag_ref=$this->
db->get_value(
'select dt_prefix from document_type where dt_id=$1', array($this->dt_id)).
'-'.$this->
db->get_next_seq($seq_name);
572 if ( $this->
db->get_value(
"select count(*) from action_gestion where ag_ref = $1",array(
$ag_ref)) == 0)
578 if ($this->ag_remind_date!=
null||$this->ag_remind_date!=
'')
580 $sql=
"insert into action_gestion".
581 "(ag_id,ag_timestamp,ag_type,ag_title,f_id_dest,ag_ref, ag_dest, ".
582 " ag_hour, ag_priority,ag_owner,ag_contact,ag_state,ag_remind_date) ".
583 " values ($1,to_date($2,'DD.MM.YYYY'),$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,to_date($13,'DD.MM.YYYY'))";
587 $this->ag_remind_date=
null;
588 $sql=
"insert into action_gestion".
589 "(ag_id,ag_timestamp,ag_type,ag_title,f_id_dest,ag_ref, ag_dest, ".
590 " ag_hour, ag_priority,ag_owner,ag_contact,ag_state,ag_remind_date) ".
591 " values ($1,to_date($2,'DD.MM.YYYY'),$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13)";
602 $_SESSION[SESSION_KEY.
'g_user'],
605 $this->ag_remind_date
609 $nb_item=
$http->post(
"nb_item",
"number",0);
611 for (
$i=0;
$i<$nb_item;
$i++)
626 $this->
db->exec_sql(
"insert into action_gestion_comment (ag_id,tech_user,agc_comment,agc_comment_raw) values ($1,$2,$3,$4)"
627 , array($this->
ag_id, $_SESSION[SESSION_KEY.
'g_user'], strip_tags($this->ag_description),$this->ag_comment));
631 $this->
db->exec_sql(
"insert into action_gestion_comment (ag_id,tech_user,agc_comment,agc_comment_raw) values ($1,$2,$3,$4)"
632 , array($this->
ag_id, $_SESSION[SESSION_KEY.
'g_user'],strip_tags($this->ag_description), $this->ag_description));
661 $sql =
" select ag_id,to_char(ag_timestamp,'DD.MM.YYYY') as my_date,
662 to_char(ag_remind_date,'DD.MM.YYYY') as my_remind,
663 to_char(coalesce((select max(agc_date) from action_gestion_comment as agc where agc.ag_id=ag.ag_id),ag_timestamp),'DD.MM.YY') as str_last_comment,
664 coalesce((select max(agc_date) from action_gestion_comment as agc where agc.ag_id=ag.ag_id),ag_timestamp) as last_comment,
668 ag_title,dt_value,ag_ref, ag_priority,ag_state,
669 coalesce((select p_name from profile where p_id=ag_dest),'Aucun groupe') as dest,
670 (select ad_value from fiche_Detail where f_id=ag.f_id_dest and ad_id=1) as name,
671 (select ad_value from fiche_Detail where f_id=ag.f_id_dest and ad_id=23) as qcode,
672 array_to_string((select array_agg(t1.t_tag) from action_tags as a1 join tags as t1 on (a1.t_id=t1.t_id) where a1.ag_id=ag.ag_id ),',') as tags,
673 array_to_string((select array_agg(t1.t_color) from action_tags as a1 join tags as t1 on (a1.t_id=t1.t_id) where a1.ag_id=ag.ag_id ),',') as tags_color
674 from action_gestion as ag
675 join document_type on (ag_type=dt_id)
676 join document_state on (ag_state=s_id)
692 $arg=
HtmlInput::get_to_string(array(
"closed_action",
"remind_date_end",
"remind_date",
"sag_ref",
"only_internal",
"state",
"qcode",
"ag_dest_query",
"action_query",
"tdoc",
"date_start",
"date_end",
"hsstate",
"searchtag"),
"");
697 $table->add(_(
'Date Doc.'),
$url,
'order by ag_timestamp asc',
'order by ag_timestamp desc',
'da',
'dd');
700 $table->add(_(
'Date Limite'),
$url,
'order by ag_remind_date asc nulls last',
'order by ag_remind_date desc nulls last',
'ra',
'rd');
702 $table->add(_(
'Réf.'),
$url,
'order by ag_ref asc',
'order by ag_ref desc',
'ra',
'rd');
704 $table->add(_(
'Etiquette'),
$url,
'order by tags asc nulls last',
'order by tags desc nulls last',
'taa',
'tad');
706 $table->add(_(
'Groupe'),
$url,
"order by coalesce((select p_name from profile where p_id=ag_dest),'Aucun groupe')",
"order by coalesce((select p_name from profile where p_id=ag_dest),'Aucun groupe') desc",
'dea',
'ded');
708 $table->add(_(
'Dest/Exp'),
$url,
'order by qcode asc nulls last',
'order by qcode desc nulls last',
'ea',
'ed');
710 $table->add(_(
'Titre'),
$url,
'order by ag_title asc',
'order by ag_title desc',
'ta',
'td');
712 $table->add(_(
'Etat'),
$url,
'order by s_value asc',
'order by s_value desc',
'ea',
'ed');
718 $p_filter_doc=
" dt_id in ( $p_filter )";
720 $p_filter_doc=
" 1=1 ";
726 $step=$_SESSION[SESSION_KEY.
'g_pagesize'];
730 $limit=
" LIMIT $step OFFSET $offset ";
739 $r.=
HtmlInput::filter_table(
'mylist_tb',
'1,2,3,4,5,6,7,8,9',1);
740 $r.=
'<p>'.$bar.
'</p>';
742 $r.=
'<table id="mylist_tb" class="document">';
744 $r.=
'<th name="ag_id_td" style="display:none" >'.ICheckBox::toggle_checkbox(
'ag',
'list_ag_frm').
'</th>';
745 $r.=
'<th style="width:5.57%">'.$table->get_header(0).
'</th>';
746 $r.=
'<th style="width:5.57%">'.$table->get_header(1).
'</th>';
747 $r.=
'<th style="width:5.57%">'.$table->get_header(2).
'</th>';
748 $r.=
'<th style="width:5.57%">'.$table->get_header(5).
'</th>';
750 $r.=
th(
'Priorité',
'style="width:5.57%"');
751 $r.=
'<th style="min-width:45%">'.$table->get_header(6).
'</th>';
752 $r.=
'<th style="width:5.57%">'.$table->get_header(7).
'</th>';
753 $r.=
'<th style="max-width:10%">'.$table->get_header(3).
'</th>';
754 $r.=
'<th style="width:5.57%">'.$table->get_header(4).
'</th>';
761 $r=
'<div style="clear:both">';
762 $r.=
'<hr>'._(
"Aucun enregistrement trouvé");
766 $today=date(
'd.m.Y');
769 $checkbox->set_range(
"action_followup_ck");
773 $href=
'<A class="document" HREF="'.$p_base.HtmlInput::get_to_string(array(
"closed_action",
"remind_date_end",
"remind_date",
"sag_ref",
"only_internal",
"state",
"gDossier",
"qcode",
"ag_dest_query",
"action_query",
"tdoc",
"date_start",
"date_end",
"hsstate",
"searchtag",
"ac"),
"").
'&sa=detail&ag_id='.
$row[
'ag_id'].
'" title="'.
$row[
'name'].
'">';
775 $tr=(
$i%2==0)?
'even':
'odd';
776 if (
$row[
'ag_priority']<2)
779 if (
$row[
'my_date']==$today)
780 $st=
' style="font-weight:bold; border:2px solid orange;"';
782 $date_today=date(
'Ymd');
783 if ($date_remind!=
""&&$date_remind==$date_today&&
$row[
'ag_state']!=1&&
$row[
'ag_state']!=3)
784 $st=
' style="font-weight:bold;background:orange"';
785 if ($date_remind!=
""&&$date_remind<$date_today&&
$row[
'ag_state']!=1&&
$row[
'ag_state']!=3)
786 $st=
' style="font-weight:bold;background:#FF0000;color:white;"';
787 $r.=
"<tr class=\"$tr\" $st>";
789 $r.=
'<td name="ag_id_td" style="display:none">'.$checkbox->input().
'</td>';
790 $r.=
"<td>".$href.smaller_date(
$row[
'my_date']).
'</a>'.
"</td>";
792 $r.=
"<td>".$href.smaller_date(
$row[
'my_remind']).
'</a>'.
"</td>";
793 $r.=
"<td>".$href.$row[
'ag_ref'].
'</a>'.
"</td>";
795 if (
$row[
'qcode']!=
'')
797 $jsexp=sprintf(
"javascript:showfiche('%s')",
$row[
'qcode']);
798 $r.=
"<td>$href".$row[
'qcode'].
'</a></td>';
806 switch (
$row[
'ag_priority'])
821 h(
$row[
'ag_title']).
"</A></td>";
822 $r.=
"<td>".$row[
's_value'].
"</td>";
824 if (
$row[
'tags']!=
""){
826 $aColor=explode(
",",
$row[
"tags_color"]);
827 $aTags=explode(
",",
$row[
"tags"]);
828 $nb_tag=count($aTags);
829 for ( $x=0;$x<$nb_tag;$x++) {
830 $r.=sprintf(
'<span style="font-size:75%%;padding:1px;border-color:transparent" class="tagcell tagcell-color%s">%s</span>',$aColor[$x],$aTags[$x]);
836 $r.=
"<td>".$href.h(
$row[
'dest']).
'</a>'.
"</td>";
850 $r.=
'<p>'.$bar.
'</p>';
864 $sql =
" $sql $query order by ag_timestamp desc $extra_sql";
865 require_once NOALYSS_TEMPLATE.
"/follow_up-view_list.php";
905 if (trim($this->qcode_dest??
"")==
"")
908 $this->f_id_dest=
null;
913 if (
$tiers->get_by_qcode($this->qcode_dest)== 1)
914 $this->f_id_dest=
null;
916 $this->f_id_dest=
$tiers->id;
919 if ($contact->get_by_qcode($this->ag_contact)== 1)
927 if (
$old->ag_ref!=$this->ag_ref)
929 $nAg_ref=$this->
db->get_value(
"select count(*) from action_gestion where ag_ref=$1", array($this->ag_ref));
932 echo
h2(
"Référence en double, référence non sauvée",
'class="error"');
933 $this->ag_ref=
$old->ag_ref;
938 if ($this->ag_remind_date!=
null)
940 $this->
db->exec_sql(
"update action_gestion set ".
941 " ag_timestamp=to_date($1,'DD.MM.YYYY'),".
947 " ag_priority = $8 ,".
949 " ag_contact = $10, ".
951 " ag_remind_date=to_date($12,'DD.MM.YYYY') ".
952 " where ag_id = $6", array(
964 $this->ag_remind_date
969 $this->
db->exec_sql(
"update action_gestion set ".
970 " ag_timestamp=to_date($1,'DD.MM.YYYY'),".
976 " ag_priority = $8 ,".
978 " ag_contact = $10, ".
980 " ag_remind_date=null ".
981 " where ag_id = $6", array(
997 $document_saved=
$doc->upload($this->
ag_id);
1001 $nb_item=
$http->post(
"nb_item",
"number",0);
1002 for (
$i=0;
$i< $nb_item ;
$i++)
1012 if (trim(strip_tags($this->ag_comment??
"")) !=
'')
1014 $notag_comment=strip_tags($this->ag_comment);
1015 $action_comment_id=$this->
db->get_value(
"insert into action_gestion_comment (ag_id,tech_user,agc_comment,agc_comment_raw) values ($1,$2,$3,$4) returning agc_id"
1016 , array($this->
ag_id, $_SESSION[SESSION_KEY.
'g_user'], $notag_comment,$this->ag_comment));
1019 foreach ($document_saved as $document_id) {
1020 $this->
db->exec_sql(
"insert into action_comment_document(document_id,action_gestion_comment_id) values ($1,$2)",
1021 [$document_id,$action_comment_id]);
1025 if (trim(strip_tags($this->ag_description??
""))!=
'' )
1027 if ( $this->ag_description_id <0)
1028 $this->ag_description_id = $this->
db->get_value(
"
1029 insert into action_gestion_comment (ag_id,tech_user,agc_comment,agc_comment_raw)
1030 values ($1,$2,$3,$4)
1032 , array($this->
ag_id, $_SESSION[SESSION_KEY.
'g_user'],strip_tags($this->ag_description), $this->ag_description));
1034 $this->
db->exec_sql(
"
1035 update action_gestion_comment
1036 set agc_comment = $1 ,
1037 agc_comment_raw = $2,
1040 , array(strip_tags($this->ag_description), $this->ag_description, $_SESSION[SESSION_KEY.
'g_user'],
1041 $this->ag_description_id));
1043 if ( ! empty ($document_saved)) {
1044 foreach ($document_saved as $document_id) {
1045 $this->
db->exec_sql(
"insert into action_comment_document(document_id,action_gestion_comment_id) values ($1,$2)",
1046 [$document_id,$this->ag_description_id]);
1063 $mod=
new Document_Modele($this->
db, $md_id);
1096 $this->
ag_id=
$http->extract(
"ag_id",
"number",0);
1097 $this->ag_ref=
$http->extract(
"ag_ref",
"string",
"");
1098 $this->qcode_dest=
$http->extract(
"qcode_dest",
"string",
"");
1099 $this->f_id_dest=
$http->extract(
"f_id_dest",
"string",
null);
1100 $this->ag_timestamp=
$http->extract(
"ag_timestamp",
"string",date(
'd.m.Y'));
1102 $this->dt_id=
$http->extract(
"dt_id",
"string",
"");
1103 $this->ag_state=
$http->extract(
"ag_state",
"number",2);
1104 $this->ag_title=
$http->extract(
"ag_title",
"string",
"");
1105 $this->ag_hour=
$http->extract(
"ag_hour",
"string",
"");
1106 $this->ag_dest=
$http->extract(
"ag_dest",
"string",
$g_user->get_profile());
1107 $this->ag_priority=
$http->extract(
"ag_priority",
"string",
"2");
1108 $this->ag_contact=
$http->extract(
"ag_contact",
"string",
"");
1109 $ag_comment=trim(
$http->extract(
"ag_comment",
"raw",
""));
1110 if ( strip_tags($ag_comment) ==
'')
1111 $this->ag_comment=
'';
1113 $this->ag_comment=$ag_comment;
1116 $this->ag_description=
'';
1119 $this->ag_description_id=
$http->extract(
"ag_description_id",
"string",-1);
1120 $this->ag_remind_date=
$http->extract(
"ag_remind_date",
"string",
null);
1121 $this->operation=
$http->extract(
"operation",
"string",
null);
1122 $this->action=
$http->extract(
"action",
"string",
null);
1133 $sql=
"delete from action_gestion where ag_id=$1";
1142 for (
$i=0;
$i<
sizeof($aDoc);
$i++)
1144 $aDoc[
$i]->remove();
1158 $sql=
"select coalesce(vw_name,'Interne') as vw_name,ag_hour,quick_code,ag_id,ag_title,ag_ref, dt_value,to_char(ag_timestamp,'DD.MM.YYYY') as ag_timestamp_fmt,ag_timestamp ".
1159 " from action_gestion join document_type ".
1160 " on (ag_type=dt_id) "
1161 .
"left join vw_fiche_attr on (f_id=f_id_dest) "
1162 .
"where ag_state in (2,3) "
1163 .
"and ".self::sql_security_filter($this->
db,
'R').
1164 "order by ag_timestamp desc limit $p_limit";
1175 $sql=
"select ag_ref,ag_hour,coalesce(vw_name,'Interne') as vw_name,ag_id,ag_title,ag_ref, dt_value,to_char(ag_remind_date,'DD.MM.YYYY') as ag_timestamp_fmt,ag_timestamp ".
1176 " from action_gestion join document_type ".
1177 " on (ag_type=dt_id)
1178 left join vw_fiche_attr on (f_id=f_id_dest)
1180 ag_state not in (1,4)
1181 and to_char(ag_remind_date,'DDMMYYYY')=to_char(now(),'DDMMYYYY')
1193 $sql=
"select ag_ref,ag_hour,coalesce(vw_name,'Interne') as vw_name,ag_id,ag_title,ag_ref, dt_value,to_char(ag_remind_date,'DD.MM.YYYY') as ag_timestamp_fmt,ag_timestamp ".
1194 " from action_gestion join document_type ".
1195 " on (ag_type=dt_id) left join vw_fiche_attr on (f_id=f_id_dest) where ag_state not in (1,4)
1196 and to_char(ag_remind_date,'YYMMDD') < to_char(now(),'YYMMDD') and ".self::sql_security_filter($this->
db,
'R');
1206 if (trim($this->operation??
"")==
'')
1208 $array=explode(
",", $this->operation);
1211 if ($this->
db->get_value(
"select count(*) from action_gestion_operation
1212 where ag_id=$1 and jr_id=$2", array($this->
ag_id,
$array[
$i]))==0)
1214 $this->
db->exec_sql(
"insert into action_gestion_operation (ag_id,jr_id) values ($1,$2)", array($this->
ag_id,
$array[$i]));
1226 if ($this->op==
null)
1231 $this->
db->exec_sql(
"delete from action_gestion_operation where ago_id=$1", array(
$op[
$i]));
1244 $a=
$http->get(
"action_query",
"string",
"");
1261 require_once NOALYSS_TEMPLATE.
'/action_button.php';
1264 if ( $inner )
$w->autocomplete=0;
1266 $w->id=
$w->generate_id(
$w->name);
1272 $list=
$cn->make_list(
"select fd_id from fiche_def where frd_id in (4,8,9,14,15,16,25)");
1277 $type_doc=
new ISelect(
'tdoc');
1278 $aTDoc=
$cn->make_array(
'select dt_id,dt_value from document_type order by dt_value');
1279 $aTDoc[]=array(
'value'=>
'-1',
'label'=>_(
'Tous les types'));
1280 $type_doc->value=$aTDoc;
1281 $type_doc->selected=(isset(
$_GET[
'tdoc']))?
$_GET[
'tdoc']:-1;
1284 $type_state=
new ISelect(
'state');
1285 $aState=
$cn->make_array(
'select s_id,s_value from document_state order by s_value');
1286 $aState[]=array(
'value'=>
'-1',
'label'=>_(
'Tous les actions ouvertes'));
1287 $type_state->value=$aState;
1288 $type_state->selected=(isset(
$_GET[
'state']))?
$_GET[
'state']:-1;
1293 $hsExcptype_state=
new ISelect(
'hsstate');
1294 $aExcpState=
$cn->make_array(
'select s_id,s_value from document_state order by s_value');
1295 $aExcpState[]=array(
'value'=>
'-1',
'label'=>_(
'Aucun'));
1296 $hsExcptype_state->value=$aExcpState;
1297 $hsExcptype_state->selected=(isset(
$_GET[
'hsstate']))?
$_GET[
'hsstate']:-1;
1307 $closed_action=
new ICheckBox(
'closed_action');
1308 $closed_action->selected=(isset(
$_GET[
'closed_action']))?
true:
false;
1311 $only_internal=
new ICheckBox(
'only_internal');
1312 $only_internal->selected=(isset(
$_GET[
'only_internal']))?
true:
false;
1314 $aAg_dest=
$cn->make_array(
"select p_id as value, ".
1316 " from profile where p_id in ".
1317 $g_user->sql_readable_profile().
1319 $aAg_dest[]=array(
'value'=>
'-2',
'label'=>_(
'Tous les profils'));
1325 $osag_ref=
new IText(
"sag_ref");
1326 $osag_ref->value=
$http->get(
'sag_ref',
"string",
"");
1327 $remind_date=
new IDate(
'remind_date');
1328 $remind_date->value=
$http->get(
'remind_date',
"string",
"");
1329 $remind_date_end=
new IDate(
'remind_date_end');
1330 $remind_date_end->value=
$http->get(
'remind_date_end',
"string",
"");
1334 require_once NOALYSS_TEMPLATE.
'/action_search.php';
1344 echo \HtmlInput::button_action(
"Recherches sauvées",sprintf(
"list_filter_followup('%s','%s')",
Dossier::id(),
$http->request(
"ac")));
1364 echo
'<form method="POST" id="list_ag_frm" style="display:inline">';
1366 require_once NOALYSS_TEMPLATE.
'/action_other_action.php';
1377 require_once NOALYSS_TEMPLATE.
'/followup-show-action-add.php';
1392 if (count(
$p_array[
'searchtag'])==0)
1395 $operand =
"1 = 0 ";
1411 return "and (".$query.
")";
1432 $action_query=
" and ag_id= ".sql_string(
$p_array[
'ag_id']);
1434 return $action_query;
1438 $action_query =
$http->extract(
'action_query');
1440 $action_query=
"and (ag_title ilike '%".sql_string($action_query).
"%' ".
1441 "or ag_ref ='".trim(
sql_string($action_query??
"")).
1442 "' or ag_id in (select ag_id from action_gestion_comment ".
1443 " where agc_comment ilike '%".trim(
sql_string($action_query??
"")).
"%')".
1460 $str=
" and (f_id_dest= ".$fiche->id.
" or ag_id in (select ag_id from action_person as ap where ap.f_id=".
$fiche->id.
") or ag_contact=".
$fiche->id.
" )";
1465 $action_query .=
' and dt_id = '.sql_string(
$p_array[
'tdoc']);
1469 $action_query .=
' and ag_state= '.sql_string(
$p_array[
'state']);
1475 $action_query .=
' and ag_state <> '.sql_string(
$p_array[
'hsstate']);
1479 $action_query .=
" and ag_ref= '".sql_string(
$p_array[
'sag_ref']).
"'";
1482 if (isset(
$_GET[
'only_internal']))
1483 $action_query .=
' and f_id_dest=0 ';
1487 $action_query.=
" and ag_timestamp >= to_date('".$p_array[
'date_start'].
"','DD.MM.YYYY')";
1491 $action_query.=
" and ag_timestamp <= to_date('".$p_array[
'date_end'].
"','DD.MM.YYYY')";
1497 " ag_owner='".$_SESSION[SESSION_KEY.
'g_user'].
"'))";
1507 $action_query .=
" and to_date('".sql_string(
$p_array[
'$remind_date']).
"','DD.MM.YYYY')<= ag_remind_date";
1511 $action_query .=
" and to_date('".sql_string(
$p_array[
'remind_date_end']).
"','DD.MM.YYYY')>= ag_remind_date";
1516 $action_query.=
" and s_status is null ";
1522 if ( DEBUGNOALYSS > 1) {
1523 print __FILE__.__LINE__.
"QUERY = [ $action_query.$str]";
1525 return $action_query.$str;
1536 select ag_id,to_char(ag_timestamp,'DD.MM.YY') as my_date,
1538 substr(ag_title,1,40) as sub_ag_title,dt_value,ag_ref, ag_priority,ag_state,
1539 coalesce((select p_name from profile where p_id=ag_dest),'Aucun groupe') as dest,
1540 (select ad_value from fiche_Detail where f_id=action_gestion.f_id_dest and ad_id=1) as name
1542 join document_type on (ag_type=dt_id)
1543 join document_state on (s_id=ag_state)
1550 require_once NOALYSS_TEMPLATE.
'/action_search_result.php';
1558 if (trim($this->action??
"")==
'')
1560 $array=explode(
",", $this->action);
1568 if ($this->
db->get_value(
"select count(*) from action_gestion_related
1569 where (aga_least=$1 and aga_greatest=$2) or (aga_greatest=$1 and aga_least=$2)", array(
$array[
$i], $this->
ag_id))==0)
1571 $this->
db->exec_sql(
"insert into action_gestion_related(aga_least,aga_greatest) values ($1,$2)", array($this->
ag_id,
$array[$i]));
1587 to_char(ag_timestamp,'DD.MM.YYYY') as my_date,
1588 to_char(ag_remind_date,'DD.MM.YYYY') as my_remind,
1589 to_char(coalesce((select max(agc_date) from action_gestion_comment as agc where agc.ag_id=ag_id),ag_timestamp),'DD.MM.YY') as last_comment,
1590 array_to_string((select array_agg(t1.t_tag) from action_tags as a1 join tags as t1 on (a1.t_id=t1.t_id) where a1.ag_id=ag.ag_id ),',') as tags,
1591 (select ad_value from fiche_Detail where f_id=ag.f_id_dest and ad_id=1) as name,
1598 coalesce((select p_name from profile where p_id=ag_dest),'Aucun groupe') as dest
1599 from action_gestion as ag
1600 join document_type on (ag.ag_type=dt_id)
1601 join document_state on(ag.ag_state=s_id)
1602 where true $p_search order by ag.ag_timestamp,ag.ag_id";
1607 $this->
db->query_to_csv(
$ret, array(
1608 array(
"title"=>
"doc id",
"type"=>
"string"),
1609 array(
"title"=>
"date",
"type"=>
"date"),
1610 array(
"title"=>
"rappel",
"type"=>
"date"),
1611 array(
"title"=>
"date dernier commentaire",
"type"=>
"date"),
1612 array(
"title"=>
"tags",
"type"=>
"string"),
1613 array(
"title"=>
"nom",
"type"=>
"string"),
1614 array(
"title"=>
"titre",
"type"=>
"string"),
1615 array(
"title"=>
"type document",
"type"=>
"string"),
1616 array(
"title"=>
"ref",
"type"=>
"string"),
1617 array(
"title"=>
"priorite",
"type"=>
"string"),
1618 array(
"title"=>
"etat",
"type"=>
"string"),
1619 array(
"title"=>
"profil",
"type"=>
"string")
1636 to_char(ag_timestamp,'DD.MM.YYYY') as my_date,
1637 to_char(ag_remind_date,'DD.MM.YYYY') as my_remind,
1638 to_char(coalesce((select max(agc_date)
1639 from action_gestion_comment as agc
1640 where agc.ag_id=ag.ag_id),ag.ag_timestamp),'DD.MM.YY HH24:MI') as last_comment,
1641 array_to_string((select array_agg(t1.t_tag)
1642 from action_tags as a1 join tags as t1 on (a1.t_id=t1.t_id)
1643 where a1.ag_id=ag.ag_id ),',') as tags,
1644 array_to_string((select array_agg(coalesce(jrn1.jr_pj_number,jrn1.jr_internal))
1645 from action_gestion_operation ago join jrn jrn1 using (jr_id)
1646 where ago.ag_id=ag.ag_id),',') as related_operation,
1647 array_to_string((select array_agg(agc2.agc_comment order by agc2.agc_date desc)
1648 from action_gestion_comment agc2 where agc2.ag_id=ag.ag_id ),'|') as action_comment,
1649 array_to_string((select array_agg(followup_id) from (select agr1.aga_least followup_id
1650 from action_gestion_related agr1
1651 where agr1.aga_greatest = ag.ag_id
1653 select agr2.aga_greatest
1655 action_gestion_related agr2
1656 where agr2.aga_least=ag.ag_id) as followup),',') follow_up,
1657 (select ad_value from fiche_Detail where f_id=ag.f_id_dest and ad_id=1) as name,
1663 coalesce((select p_name from profile where p_id=ag_dest),'Aucun groupe') as dest
1664from action_gestion as ag
1665join document_type on (ag.ag_type=dt_id)
1666join document_state on(ag.ag_state=s_id)
1668 true $p_search order by ag.ag_timestamp,ag.ag_id";
1682 _(
"Date dernier commentaire "),
1687 _(
"Autres actions"),
1691 for (
$i=0;
$i<$nb_record;
$i++)
1720 select ag_id,ag_ref,ago_id,
1723 join action_gestion_operation using(ag_id)
1725 jr_id=$1", array($p_jr_id));
1735 if ($this->
ag_id==0)
1737 $sql=
'select b.ag_id,b.t_id,b.at_id,a.t_tag,a.t_color'
1739 .
' tags as a join action_tags as b on (a.t_id=b.t_id)'
1741 .
' order by a.t_tag';
1753 if ($this->
ag_id==0)
1755 $count=$this->
db->get_value(
'select count(*) from action_tags'.
1756 ' where ag_id=$1 and t_id=$2', array($this->
ag_id, $p_t_id));
1759 $sql=
' insert into action_tags (ag_id,t_id) values ($1,$2)';
1760 $this->
db->exec_sql(
$sql, array($this->
ag_id, $p_t_id));
1769 if ($this->
ag_id==0)
1771 $sql=
' delete from action_tags where ag_id=$1 and t_id=$2';
1772 $this->
db->exec_sql(
$sql, array($this->
ag_id, $p_t_id));
1786 echo
'<span class="tagcell tagcell-color'.$a_tag[
$e][
't_color'].
'">';
1787 echo $a_tag[
$e][
't_tag'];
1788 if (
$g_user->can_write_action($this->ag_id)==
true && $p_view !=
'READ')
1790 $js_remove=sprintf(
"action_tag_remove('%s','%s','%s')",
dossier::id(), $this->
ag_id, $a_tag[
$e][
't_id']);
1798 if ($p_view !=
'READ' &&
$g_user->can_write_action($this->ag_id)==
true)
1810 for (
$i=0;
$i<count($mag_id);
$i++)
1812 if (
$g_user->can_write_action($mag_id[
$i])==
false)
1814 for (
$e=0;
$e<count($remtag);
$e++)
1817 $a->tag_remove($remtag[
$e]);
1827 for (
$i=0;
$i<count($mag_id);
$i++)
1829 if (
$g_user->can_write_action($mag_id[
$i])==
false)
1831 for (
$e=0;
$e<count($addtag);
$e++)
1834 $a->tag_add($addtag[
$e]);
1843 for (
$i=0;
$i<count($mag_id);
$i++)
1845 if (
$g_user->can_write_action($mag_id[
$i])==
false)
1856 for (
$i=0;
$i<count($mag_id);
$i++)
1858 if (
$g_user->can_read_action($mag_id[
$i])==
false)
1862 echo
'<div class="content">';
1863 echo
$a->Display(
"READ",
false,
"");
1865 echo
'<P id="breakhere"> - - </p>';
1871 $this->
db->exec_sql(
'delete from action_tags where ag_id=$1', array($this->
ag_id));
1880 for (
$i=0;
$i<count($mag_id);
$i++)
1882 if (
$g_user->can_write_action($mag_id[
$i])==
false)
1884 $cn->exec_sql(
'update action_gestion set ag_state=$1 where ag_id=$2', array($state, $mag_id[
$i]));
1893 for (
$i=0;
$i<count($mag_id);
$i++)
1895 if (
$g_user->can_write_action($mag_id[
$i])==
false)
1897 $cn->exec_sql(
'delete from action_gestion where ag_id=$1', array($mag_id[
$i]));
1907 if ($this->dt_id==-1)
1909 throw new Exception(_(
'Type action invalide'), 10);
1911 if (
isDate($this->ag_timestamp)!=$this->ag_timestamp)
1912 throw new Exception(_(
'Date invalide'), 20);
1913 if (
isDate($this->ag_remind_date)!=$this->ag_remind_date)
1914 throw new Exception(_(
'Date invalide'), 30);
1915 if ($this->f_id_dest==0)
1916 $this->f_id_dest=
null;
1927 include NOALYSS_TEMPLATE.
'/action_display_short.php';
1937 if (
$g_user->can_add_action($this->ag_dest) == FALSE )
1939 throw new Exception(_(
'SECURITE : Ajout impossible'));
1945 $seq_name=
"seq_doc_type_".$this->dt_id;
1950 $this->
ag_id=$this->
db->get_next_seq(
'action_gestion_ag_id_seq');
1953 $ag_ref=$this->
db->get_value(
'select dt_prefix from document_type '
1954 .
'where dt_id=$1', array($this->dt_id))
1955 .
'-'.$this->
db->get_next_seq($seq_name);
1963 $sql=
"insert into action_gestion".
1964 "(ag_id,ag_timestamp,ag_type,ag_title,f_id_dest,ag_ref, "
1966 " ag_priority,ag_owner,ag_state,ag_remind_date,ag_hour) ".
1968 .
"($1,to_date($2,'DD.MM.YYYY'),$3,$4,$5,$6,"
1970 .
"$8,$9,$10,to_date($11,'DD.MM.YYYY'),$12)";
1972 $this->
db->exec_sql(
$sql, array(
1974 $this->ag_timestamp,
1981 $_SESSION[SESSION_KEY.
'g_user'],
1983 $this->ag_remind_date,
1988 if (trim($this->ag_comment??
"")!=
'')
1990 $this->
db->exec_sql(
"insert into action_gestion_comment (ag_id,tech_user,agc_comment) values ($1,$2,$3)"
1991 , array($this->
ag_id, $_SESSION[SESSION_KEY.
'g_user'], $this->ag_comment));
2001 with recursive t (aga_least,aga_greatest,depth) as (
2002 select aga_least,aga_greatest , 1
2004 action_gestion_related
2005 where aga_greatest=$1
2007 select p2.aga_least,p2.aga_greatest,depth + 1
2009 t as p1, action_gestion_related as p2
2011 p2.aga_greatest is not null and
2012 p2.aga_greatest = p1.aga_least
2013 ) select aga_least,aga_greatest,depth from t order by depth desc,aga_least asc
2014 ' , array($this->
ag_id)
2034 $sql =
"with recursive t (key_path, aga_least,aga_greatest,depth) as (
2036 aga_least::text||'-'||aga_greatest::text as key_path ,
2037 aga_least,aga_greatest , 1
2039 action_gestion_related
2040 where aga_least=$1 or aga_greatest = $1
2042 select key_path||'-'||p2.aga_greatest::text,
2043 p2.aga_least,p2.aga_greatest,depth + 1
2045 t as p1, action_gestion_related as p2
2047 p1.aga_greatest is not null and
2048 p1.aga_greatest = p2.aga_least
2050 select key_path,aga_greatest,ag_title as title,depth ,to_char(ag_timestamp,'DD/MM/YY') as str_date,ag_ref||' '||dt_value as action_ref
2052 action_gestion join t on (ag_id=aga_greatest)
2053 join document_type on (ag_type=dt_id)
2056 $ret_array=$this->
db->get_array(
$sql,array(
$p_id));
2058 if ( empty($ret_array))
return array();
2073 $parent_id=$this->
db->get_value(
"select min( get_follow_up_tree) from comptaproc.get_follow_up_tree($1)",[$this->
ag_id]);
2076 "f_id")).
"&sa=detail";
2078 if (empty($parent_id))
2080 echo _(
'Principal');
2087 echo
'<span class="highlight">';
2088 $xaction=sprintf(
'view_action(%d,%d,%d)', $fu_parent->ag_id,
2090 $showAction=
'<a class="line" href="javascript:'.$xaction.
'">';
2092 $fu_parent->ag_timestamp,
" ",
2093 h($fu_parent->ag_title),
2094 '('.h($fu_parent->ag_ref).
')',
2098 echo
'<ul style="padding-left:10px;list-style-type: none;">';
2101 for ($o=0; $o<count(
$action); $o++)
2103 $class=($this->
ag_id == $action[$o][
'aga_greatest'])?
' class="highlight" ':
'';
2106 $count_parent =$this->
db->get_value(
'select count(*) from action_gestion_related where aga_greatest = $1',array(
$action[$o][
'aga_greatest']));
2107 $direct_parent=($count_parent > 1 ) ? _(
'direct parent ').$count_parent:
"";
2109 $margin=(
$action[$o][
'depth']>1 )?str_repeat(
" ",
$action[$o][
'depth']-1).
"⇨":
"";
2110 if ($p_view!=
'READ'&&$p_base!=
'ajax')
2112 $rmAction=sprintf(
"return confirm_box(null,'"._(
'Voulez-vous effacer cette action ').
"', function () {remove_action('%s','%s','%s');});",
2114 $http->request(
'ag_id',
"number"));
2115 $showAction=
'<a class="line" href="'.$base.
"&ag_id=".
$action[$o][
'aga_greatest'].
'">';
2117 echo
'<li '.$class.
' id="act'.
$action[$o][
'aga_greatest'].
'">'.$margin.$showAction.$action[$o][
'str_date'].
2118 h(
$action[$o][
'title']).
'('.
h(
$action[$o][
'action_ref']).
')'.$direct_parent.
'</a>'.
" "
2125 if ($p_base==
'ajax')
2127 $xaction=sprintf(
'view_action(%d,%d,%d)',
$action[$o][
'aga_greatest'],
2129 $showAction=
'<a class="line" href="javascript:'.$xaction.
'">';
2130 echo
'<li '.$class.
' >'.$margin.$showAction.$action[$o][
'str_date'].
" ".
2131 h(
$action[$o][
'title']).
'('.
h(
$action[$o][
'action_ref']).
')'.$direct_parent.
'</a>'.
" "
2139 $showAction=
'<a class="line" href="'.$base.
"&ag_id=".
$action[$o][
'aga_greatest'].
'">';
2140 echo
'<li '.$class.
' >'.$margin.$showAction.$action[$o][
'str_date'].
" ".
2141 h(
$action[$o][
'title']).
'('.
h(
$action[$o][
'action_ref']).
')'.$direct_parent.
'</a>'.
" "
2157 $a_parent=$this->
db->get_array(
2160 ,ag1.ag_title as title
2161 ,to_char(ag1.ag_timestamp,'DD/MM/YY') as str_date
2162 ,ag1.ag_ref||' '||dt_value as action_ref
2165 join document_type on (ag_type=dt_id)
2166 join (select distinct get_follow_up_tree from comptaproc.get_follow_up_tree($1)) tree_ag
2167 on (tree_ag.get_follow_up_tree=ag1.ag_id)
2169 ", array($this->
ag_id)
2171 if ( empty($a_parent ) )
return;
2172 echo
'<ul style="padding-left:10px;list-style-type: none;">';
2176 for ($o=0; $o<count($a_parent); $o++)
2178 $class=($this->
ag_id == $a_parent[$o][
'ag_id'])?
' class="highlight" ':
'';
2180 if ($p_view!=
'READ'&&$p_base!=
'ajax')
2182 $rmAction=sprintf(
"return confirm_box(null,'"._(
'Voulez-vous effacer cette action ').
"', function () {remove_action('%s','%s','%s');});",
2184 $http->request(
'ag_id',
"number"));
2185 $showAction=
'<a class="line" href="'.$base.
"&ag_id=".$a_parent[$o][
'ag_id'].
'">';
2189 echo
'<li '.$class.
' id="act'.$a_parent[$o][
'ag_id'].
'">'.$showAction.$a_parent[$o][
'str_date'].
2190 h($a_parent[$o][
'title']).
'('.
h($a_parent[$o][
'action_ref']).
')'.
'</a>'.
" "
2197 if ($p_base==
'ajax')
2199 $xaction=sprintf(
'view_action(%d,%d,%d)', $a_parent[$o][
'ag_id'],
2201 $showAction=
'<a class="line" href="javascript:'.$xaction.
'">';
2202 echo
'<li '.$class.
' >'.$showAction.$a_parent[$o][
'str_date'].
" ".
2203 h($a_parent[$o][
'title']).
'('.
h($a_parent[$o][
'action_ref']).
')'.
'</a>'.
" "
2211 $showAction=
'<a class="line" href="'.$base.
"&ag_id=".$a_parent[$o][
'ag_id'].
'">';
2212 echo
'<li '.$class.
' >'.$showAction.$a_parent[$o][
'str_date'].
" ".
2213 h($a_parent[$o][
'sub_title']).
'('.
h($a_parent[$o][
'action_ref']).
')'.
'</a>'.
" "
format_date($p_date, $p_from_format='YYYY-MM-DD', $p_to_format='DD.MM.YYYY')
format the date, when taken from the database the format is MM-DD-YYYY
h2($p_string, $p_class="", $raw="")
th($p_string, $p_extra='', $raw='')
noalyss_strlentrim($p_string)
record_log($p_message)
Record an error message into the log file of the server.
sql_string($p_string)
Fix the problem with the quote char for the database.
td($p_string='', $p_extra='')
surround the string with td
global $g_user
if no group available , then stop
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r
h( $row[ 'oa_description'])
catch(Exception $ex) $doc_type
foreach($array as $idx=> $m) $w
static fetch_all($ret)
wrapper for the function pg_fetch_all
static escape_string($p_string)
wrapper for the function pg_escape_string
static fetch_array($ret, $p_indice=0, $p_mode=PGSQL_ASSOC)
wrapper for the function pg_fetch_array
static num_row($ret)
wrapper for the function pg_num_rows
static can_add_comment($p_id)
Returns true if we can add a comment , or false if it is not possible.
static is_enable_comment($p_document_type)
returns true if comment are available otherwise false
Class Document corresponds to the table document.
static id()
return the 'gDossier' value after a check
define Class fiche and fiche def, those class are using class attribut. When adding or modifing new c...
get_by_qcode($p_qcode=null, $p_all=true)
Retrieve a card thx his quick_code complete the object,, set the id member of the object or set it to...
Follow_Up Details are the details for an actions, it means the details of an order,...
verify()
Verify that data are correct.
static filter_by_tag($cn, $p_array=null)
Create a subquery to filter thanks the selected tag.
static display_saved_search()
display a form with the saved search
static show_action_add($pa_param)
Show a button for adding follow-up action, display the FORM.
view_list($query, $extra_sql="")
display list of followup , used with card
update()
Update the data into the database, the field ag_description could contain some HTML tags and must be ...
remove_operation_deprecated()
remove a related operation
display($p_view, $p_gen, $p_base, $retour="")
Display the object, the tags for the FORM are in the caller.
get_parent()
Return the first parent of the event tree, or -1 if not found.
export_csv($p_array)
export to CSV the query the p_array has
$action
$action string related action
static action_tag_remove($cn, $p_array)
static sql_security_filter($cn, $p_mode)
Create a filter based on the current user,.
static short_list($cn, $p_sql)
Show the result of a search in an inner windows, the result is limited to 25.
save()
Save the document and propose to save the generated document or to upload one, the data are included ...
static action_remove($cn, $p_array)
get_late()
get the action where the remind day is today
static SQL_list_action()
return the SQL to make a list of actions Colum :
export_csv_detail($p_array)
export to CSV the detailled actions (tags, comment, related operations...), it could be a query in $p...
save_short()
Add an event , with the minimum of informations, used in Dashboard and Scheduler.
static action_set_state($cn, $p_array)
$operation
$operation string related operation
get_children($p_id)
Compute an array of the complete tree depending of $p_id.
__construct($p_cn, $p_id=0)
constructor
$aAction_detail
Array of action details.
display_short()
display a small form to enter a new event
display_parent($p_view, $p_base)
Display the list of parent of the current Follow_Up.
fromArray($p_array)
put an array in the variable member, the indice is the member name
myList($p_base, $p_filter="", $p_search="")
myList($p_base, $p_filter = "", $p_search = "") Show list of action by default if sorted on date
static get_all_operation($p_jr_id)
tag_remove($p_t_id)
remove the tags of the current objet normally used by ajax
static show_action_list($cn, $p_base)
show a list of documents
static create_query($cn, $p_array=null)
Get date from $_GET and create the sql stmt for the query.
get_today()
get the action where the remind day is today
tag_add($p_t_id)
show the tags of the current objet normally used by ajax.
display_children($p_view, $p_base)
Display the tree of childrens of the current Action + related parents.
tag_cell($p_view='UPD')
show the cell content in Display for the tags called also by ajax
static action_tag_clear($cn, $p_array)
get_last($p_limit)
return the last p_limit operation into an array, there is a security on user
insert_operation()
insert a related operation
static action_print($cn, $p_array)
tag_get()
get the tags of the current objet
static display_search($cn, $inner=false)
Display only a search box for searching an action.
static action_tag_add($cn, $p_array)
insert_action()
Insert a related action into the table action_gestion_related.
generate_document($md_id, $p_array)
generate the document and add it to the action
Input HTML for the card show buttons, in the file, you have to add card.js How to use :
static javascript_set_range($p_name)
Before calling this function , you must set a range with the function set_range.
Html Input : Input a date format dd.mm.yyyy The property title should be set to indicate what it is e...
Html Input for uploading file, must be in a form with enctype="multipart/form-data".
This class handles only the numeric input, the input will call a javascript to change comma to period...
Html Input , create a tag <SELECT> ... </SELECT> if readonly == true then display the label correspon...
static trash($p_id, $p_javascript)
Display the icon of a trashbin.
Manage the CSV : manage files and write CSV record.
Description of class_syn_sort_table.
Tag operations or actions to linked them together.
const NOTFOUND(!defined("SYSINFO_DISPLAY"))
const ATTR_DEF_FIRST_NAME
if( $delta< 0) elseif( $delta==0)
< tr id="row_currency">< td style="border:1px solid "><?=$default_currency-> get_code()?></td >< td style $iconcerned
for($i=0;$i< count($aHeading);$i++) $sort
navigation_bar($p_offset, $p_line, $p_size=0, $p_page=1, $p_javascript="")
Create a navigation_bar (pagesize)