21require_once NOALYSS_INCLUDE.
'/lib/user_common.php';
48#[AllowDynamicProperties]
100 $this->aAction_detail=array();
104 $this->ag_priority=2;
109 $r =
" Follow_Up object =>";
110 $r .=
'ag_timestamp = ['. $this->ag_timestamp.
']';
111 $r .=
'dt_id = ['. $this->dt_id.
']';
112 $r .=
'ag_state = ['. $this->ag_state.
']';
113 $r .=
'd_number = ['. $this->d_number.
']';
114 $r .=
'd_filename = ['. $this->d_filename.
']';
115 $r .=
'd_mimetype = ['. $this->d_mimetype.
']';
116 $r .=
'ag_title = ['. $this->ag_title.
']';
117 $r .=
'f_id = ['. $this->f_id.
']';
118 $r .=
'ag_ref = ['. $this->ag_ref.
']';
119 $r .=
'ag_hour = ['. $this->ag_hour.
']';
120 $r .=
'ag_priority = ['. $this->ag_priority.
']';
121 $r .=
'ag_dest = ['. $this->ag_dest.
']';
122 $r .=
'ag_contact = ['. $this->ag_contact.
']';
123 $r .=
'ag_remind_date = ['. $this->ag_remind_date.
']';
124 $r .=
'f_id_dest = ['. $this->f_id_dest.
']';
125 $r .=
'ag_description = ['. $this->ag_description.
']';
143 $profile=
$cn->get_value(
"select p_id from profile_user where user_name=$1", array(
$g_user->login));
146 if (
$g_user->isAdmin() == 1) {
151 $sql=
" (ag_dest in (select p_granted from user_sec_action_profile where p_id=$profile and ua_right !='X' ) ) ";
152 }
else if ($p_mode==
'W')
154 $sql=
" ( ag_dest in (select p_granted from user_sec_action_profile where p_id=$profile and ua_right in ('W','O') ) )";
157 throw new Exception(
_(
'Securité'));
199 throw new Exception(
'class_action'.__LINE__.
'Follow_Up::Display error unknown parameter'.$p_view);
207 $date->name=
"ag_timestamp";
208 $date->id=
"ag_timestamp";
211 $remind_date=
new IDate();
213 $remind_date->name=
"ag_remind_date";
214 $remind_date->id=
"ag_remind_date";
221 $doc_type->value=$this->
db->make_array(
"select dt_id,dt_value from document_type order by dt_value", 1);
227 $desc=
new ITextArea();
228 $desc->set_enrichText(
"enrich");
229 $desc->style=
' class="itextarea" style="width:80%;margin-left:5%;"';
230 $desc->name=
"ag_comment";
232 $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
233 FROM action_gestion_comment where ag_id=$1 order by agc_id", array($this->
ag_id)
237 $operation=$this->
db->get_array(
"select ago_id,j.jr_id,j.jr_internal,j.jr_comment
238 ,to_char(j.jr_date,'DD.MM.YY') as str_date
240 from jrn as j join action_gestion_operation as ago on (j.jr_id=ago.jr_id)
241 where ag_id=$1 order by jr_date", array($this->
ag_id));
246 $iaction->value=(isset($this->action))?$this->action:
"";
250 $a=$this->
db->make_array(
"select s_id,s_value from document_state ");
256 $str_state=
$state->input();
266 if ($this->d_id!=0&&$this->d_id!=
"")
268 $h2->readonly=($p_view==
'NEW')?
false:
true;
274 $doc_ref=
"<p> Document ".$doc->anchor().
'</p>';
275 $doc_ref.=$h2->input().$d_id->input(
'd_id', $this->d_id);
286 $title->style=
'style="font-size:2rem;font-weight:bold"';
294 $ag_priority->value=array(array(
'value'=>1,
'label'=>
_(
'Haute')),
295 array(
'value'=>2,
'label'=>
_(
'Normale')),
296 array(
'value'=>3,
'label'=>
_(
'Basse'))
306 $ag_hour->javascript=
" onblur=check_hour('ag_hour');";
314 $aAg_dest=$this->
db->make_array(
"select p_id as value, ".
316 " from profile where p_id in ".
$g_user->sql_writable_profile().
" order by 2");
325 $client_label=
new ISpan();
328 $f_add_button=
new IButton(
'add_card');
329 $f_add_button->label=
_(
'Créer une nouvelle fiche');
330 $f_add_button->set_attribute(
'ipopup',
'ipop_newcard');
331 $filter=$this->
db->make_list(
'select fd_id from fiche_def ');
332 $f_add_button->set_attribute(
'filter',
$filter);
334 $f_add_button->javascript=
" select_card_type(this);";
335 $str_add_button=$f_add_button->input();
341 $tiers->get_by_qcode($this->qcode_dest);
342 $qcode_dest_label=strtoupper(
$tiers->strAttribut(1));
344 $this->f_id_dest=
$tiers->id;
348 $qcode_dest_label=($this->f_id_dest==0||trim($this->qcode_dest??
"")==
"")?
'Interne ':
'Error';
358 $w->name=
'qcode_dest';
359 $w->value=($this->f_id_dest!=0)?$this->qcode_dest:
"";
364 $w->set_dblclick(
"fill_ipopcard(this);");
365 $w->set_attribute(
'ipopup',
'ipopcard');
368 $w->set_attribute(
'label',
'qcode_dest_label');
370 $w->set_attribute(
'typecard',
$w->extra);
371 $w->set_function(
'fill_data');
372 $w->javascript=sprintf(
' onchange="fill_data_onchange(\'%s\');" ',
$w->name);
376 $sp->extra=
'class="text-"';
377 $sp->name=
'qcode_dest_label';
378 $sp->value=$qcode_dest_label;
388 if ($this->ag_contact!=0)
390 $contact=
new Fiche($this->
db, $this->ag_contact);
396 $list_contact=$this->
db->make_list(
'select fd_id from fiche_def where frd_id=16');
401 $ag_contact->set_attribute(
'label',
'ag_contact_label');
403 $ag_contact->set_attribute(
'typecard', $list_contact);
407 $spcontact=
new ISpan();
408 $spcontact->name=
'ag_contact_label';
409 $spcontact->value=
'';
410 $fiche_contact=
new Fiche($this->
db,$this->ag_contact);
412 if ($fiche_contact->id!=0)
414 $spcontact->value=strtoupper($fiche_contact->strAttribut(
ATTR_DEF_NAME)??
"");
420 $iag_ref=
new IText(
"ag_ref");
422 $iag_ref->readOnly=
false;
423 $iag_ref->css_size=
"100%";
424 $str_ag_ref=$iag_ref->input();
430 $upload->name=
"file_upload[]";
431 $upload->set_multiple(
true);
432 $upload->setAlertOnSize(
true);
435 $aAttachedFile=$this->
db->get_array(
'select d_id,d_filename,d_description,d_mimetype,'.
436 '\'export.php?act=RAW:document&
'.
437 Dossier::get().'&d_id=\
'||d_id as link'.
438 ' from document where ag_id=$1', array($this->
ag_id));
441 $aDocMod->name=
'doc_mod';
442 $aDocMod->value=$this->
db->make_array(
'select md_id,dt_value||\' : \'||md_name as md_name'.
443 ' from document_modele join document_type on (md_type=dt_id)'.
444 " where md_affect ='GES' and md_type = $1 ".
445 ' order by md_name',0,[$this->dt_id]);
446 $str_select_doc=$aDocMod->input();
448 if (empty($aDocMod->value))
449 $str_submit_generate=
"";
451 $str_submit_generate=HtmlInput::submit(
"generate",
_(
"Génére le document"));
459 $icard->extra2=
'QuickCode';
468 $r.=dossier::hidden();
470 $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"));
475 require NOALYSS_TEMPLATE.
'/follow_up-display.php';
476 $content=ob_get_contents();
483 $r.=$h_ag_id->input(
'ag_id', $this->
ag_id);
485 $r.=$hidden2->input(
'f_id_dest', $this->f_id_dest);
497 $sql=
"select ag_id,to_char (ag_timestamp,'DD.MM.YYYY') as ag_timestamp,".
498 " f_id_dest,ag_title,ag_ref,d_id,ag_type,ag_state, ag_owner, ".
499 " ag_dest, ag_hour, ag_priority, ag_contact,to_char (ag_remind_date,'DD.MM.YYYY') as ag_remind_date ".
500 " from action_gestion left join document using (ag_id) where ag_id=".$this->ag_id;
508 $this->ag_timestamp=
$row[0][
'ag_timestamp'];
509 $this->ag_contact=
$row[0][
'ag_contact'];
510 $this->f_id_dest=
$row[0][
'f_id_dest'];
511 $this->ag_title=
$row[0][
'ag_title'];
512 $this->ag_type=
$row[0][
'ag_type'];
513 $this->ag_ref=
$row[0][
'ag_ref'];
514 $this->ag_state=
$row[0][
'ag_state'];
515 $this->d_id=
$row[0][
'd_id'];
516 $this->ag_dest=
$row[0][
'ag_dest'];
517 $this->ag_hour=
$row[0][
'ag_hour'];
518 $this->ag_priority=
$row[0][
'ag_priority'];
519 $this->ag_remind_date=
$row[0][
'ag_remind_date'];
520 $this->ag_owner=
$row[0][
'ag_owner'];
523 $action_detail->set_parameter(
'ag_id', $this->
ag_id);
524 $this->aAction_detail=$action_detail->load_all();
533 $this->state=
$row[
'0'][
'ag_state'];
534 $this->ag_state=
$row[0][
'ag_state'];
537 $aexp=
new Fiche($this->
db, $this->f_id_dest);
560 $exp->get_by_qcode($this->qcode_dest);
561 $exp->id=($exp->id==0)?
null:$exp->id;
564 $contact->get_by_qcode($this->ag_contact);
566 if (trim($this->ag_title??
"")==
"")
568 $doc_mod=
new document_type($this->
db);
571 $this->ag_title=$doc_mod->dt_value;
573 $this->
ag_id=$this->
db->get_next_seq(
'action_gestion_ag_id_seq');
574 $seq_name=
"seq_doc_type_".$this->dt_id;
578 $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);
580 if ( $this->
db->get_value(
"select count(*) from action_gestion where ag_ref = $1",array(
$ag_ref)) == 0)
586 if ($this->ag_remind_date!=
null||$this->ag_remind_date!=
'')
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,to_date($13,'DD.MM.YYYY'))";
595 $this->ag_remind_date=
null;
596 $sql=
"insert into action_gestion".
597 "(ag_id,ag_timestamp,ag_type,ag_title,f_id_dest,ag_ref, ag_dest, ".
598 " ag_hour, ag_priority,ag_owner,ag_contact,ag_state,ag_remind_date) ".
599 " values ($1,to_date($2,'DD.MM.YYYY'),$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13)";
610 $_SESSION[SESSION_KEY.
'g_user'],
613 $this->ag_remind_date
617 $nb_item=
$http->post(
"nb_item",
"number",0);
619 for (
$i=0;
$i<$nb_item;
$i++)
634 $this->
db->exec_sql(
"insert into action_gestion_comment (ag_id,tech_user,agc_comment,agc_comment_raw) values ($1,$2,$3,$4)"
635 , array($this->
ag_id, $_SESSION[SESSION_KEY.
'g_user'], strip_tags($this->ag_description),$this->ag_comment));
639 $this->
db->exec_sql(
"insert into action_gestion_comment (ag_id,tech_user,agc_comment,agc_comment_raw) values ($1,$2,$3,$4)"
640 , array($this->
ag_id, $_SESSION[SESSION_KEY.
'g_user'],strip_tags($this->ag_description), $this->ag_description));
669 $sql =
" select ag.ag_id,to_char(ag.ag_timestamp,'DD.MM.YYYY') as my_date,
670 to_char(ag_remind_date,'DD.MM.YYYY') as my_remind,
674 ag_title,dt_value,ag_ref, ag_priority,ag_state,
675 coalesce((select p_name from profile where p_id=ag_dest),'Aucun groupe') as dest,
676 (select ad_value from fiche_Detail where f_id=ag.f_id_dest and ad_id=1) as name,
677 (select ad_value from fiche_Detail where f_id=ag.f_id_dest and ad_id=23) as qcode,
678 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,
679 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,
681 to_char(last_comment_date,'DD.MM.YY') last_comment_date_str
682 from action_gestion as ag
683 join document_type on (ag_type=dt_id)
684 join document_state on (ag_state=s_id)
685 left join (select agc.ag_id,max(agc.agc_date) last_comment_date from action_gestion_comment agc group by agc.ag_id) last_comment on (last_comment.ag_id=ag.ag_id)
701 $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"),
"");
702 $arg=($arg!=
"")?
"&$arg":
"";
707 $table->add(
_(
'Date Doc.'),
$url,
'order by ag_timestamp asc',
'order by ag_timestamp desc',
'da',
'dd');
710 $table->add(
_(
'Date Limite'),
$url,
'order by ag_remind_date asc nulls last',
'order by ag_remind_date desc nulls last',
'ra',
'rd');
712 $table->add(
_(
'Réf.'),
$url,
'order by ag_ref asc',
'order by ag_ref desc',
'ra',
'rd');
714 $table->add(
_(
'Etiquette'),
$url,
'order by tags asc nulls last',
'order by tags desc nulls last',
'taa',
'tad');
716 $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');
718 $table->add(
_(
'Dest/Exp'),
$url,
'order by qcode asc nulls last',
'order by qcode desc nulls last',
'ea',
'ed');
720 $table->add(
_(
'Titre'),
$url,
'order by ag_title asc',
'order by ag_title desc',
'ta',
'td');
722 $table->add(
_(
'Etat'),
$url,
'order by s_value asc',
'order by s_value desc',
'ea',
'ed');
724 $table->add(
_(
'Dernier comm.'),
$url,
'order by coalesce(last_comment_date, ag.ag_timestamp) asc',
'order by coalesce(last_comment_date, ag.ag_timestamp) desc',
'dca',
'dcd');
726 $table->add(
_(
'Priorité'),
$url,
'order by ag_priority ',
'order by ag_priority desc ',
'pra',
'prd');
732 $p_filter_doc=
" dt_id in ( $p_filter )";
734 $p_filter_doc=
" 1=1 ";
740 $step=$_SESSION[SESSION_KEY.
'g_pagesize'];
743 $page=(isset(
$_GET[
'offset']))?
$http->get(
"page",
"number"):1;
746 $limit=
" LIMIT $step OFFSET $offset ";
755 $r.=HtmlInput::filter_table(
'mylist_tb',
'1,2,3,4,5,6,7,8,9',1);
756 $r.=
'<p>'.$bar.
'</p>';
758 $r.=
'<table id="mylist_tb" class="document">';
760 $r.=
'<th name="ag_id_td" style="display:none" >'.ICheckBox::toggle_checkbox(
'ag',
'list_ag_frm').
'</th>';
761 $r.=
'<th style="width:5.57%">'.$table->get_header(0).
'</th>';
762 $r.=
'<th style="width:5.57%">'.$table->get_header(1).
'</th>';
763 $r.=
'<th style="width:5.57%">'.$table->get_header(8).
'</th>';
764 $r.=
'<th style="width:5.57%">'.$table->get_header(2).
'</th>';
765 $r.=
'<th style="width:5.57%">'.$table->get_header(5).
'</th>';
766 $r.=
'<th style="width:5.57%">'.$table->get_header(9).
'</th>';
767 $r.=
'<th style="min-width:45%">'.$table->get_header(6).
'</th>';
768 $r.=
'<th style="width:5.57%">'.$table->get_header(7).
'</th>';
769 $r.=
'<th style="max-width:10%">'.$table->get_header(3).
'</th>';
770 $r.=
'<th style="width:5.57%">'.$table->get_header(4).
'</th>';
777 $r=
'<div style="clear:both">';
778 $r.=
'<hr>'._(
"Aucun enregistrement trouvé");
785 $checkbox->set_range(
"action_followup_ck");
789 $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'].
'">';
791 $tr=(
$i%2==0)?
'even':
'odd';
792 if (
$row[
'ag_priority']<2)
796 $st=
' style="font-weight:bold; border:2px solid orange;"';
798 $date_today=date(
'Ymd');
799 if ($date_remind!=
""&&$date_remind==$date_today&&
$row[
'ag_state']!=1&&
$row[
'ag_state']!=3)
800 $st=
' style="font-weight:bold;background:orange"';
801 if ($date_remind!=
""&&$date_remind<$date_today&&
$row[
'ag_state']!=1&&
$row[
'ag_state']!=3)
802 $st=
' style="font-weight:bold;background:#FF0000;color:white;"';
803 $r.=
"<tr class=\"$tr\" $st>";
805 $r.=
'<td name="ag_id_td" style="display:none">'.$checkbox->input().
'</td>';
806 $r.=
"<td>".$href.smaller_date(
$row[
'my_date']).
'</a>'.
"</td>";
808 $r.=
"<td>".$href.smaller_date(
$row[
'my_remind']).
'</a>'.
"</td>";
809 $r.=
td(
$row[
'last_comment_date_str']);
810 $r.=
"<td>".$href.$row[
'ag_ref'].
'</a>'.
"</td>";
812 if (
$row[
'qcode']!=
'')
814 $jsexp=sprintf(
"javascript:showfiche('%s')",
$row[
'qcode']);
815 $r.=
"<td>$href".$row[
'qcode'].
'</a></td>';
823 switch (
$row[
'ag_priority'])
838 h(
$row[
'ag_title']).
"</A></td>";
839 $r.=
"<td>".$row[
's_value'].
"</td>";
841 if (
$row[
'tags']!=
""){
843 $aColor=explode(
",",
$row[
"tags_color"]);
844 $aTags=explode(
",",
$row[
"tags"]);
845 $nb_tag=count($aTags);
846 for ( $x=0;$x<$nb_tag;$x++) {
847 $r.=sprintf(
'<span style="font-size:75%%;padding:1px;border-color:transparent" class="tagcell tagcell-color%s">%s</span>',$aColor[$x],$aTags[$x]);
853 $r.=
"<td>".$href.h(
$row[
'dest']).
'</a>'.
"</td>";
859 $r.=
'<p>'.$bar.
'</p>';
873 $sql =
" $sql $query order by ag_timestamp desc $extra_sql";
874 require_once NOALYSS_TEMPLATE.
"/follow_up-view_list.php";
914 if (trim($this->qcode_dest??
"")==
"")
917 $this->f_id_dest=
null;
922 if (
$tiers->get_by_qcode($this->qcode_dest)== 1)
923 $this->f_id_dest=
null;
925 $this->f_id_dest=
$tiers->id;
928 if ($contact->get_by_qcode($this->ag_contact)== 1)
936 if (
$old->ag_ref!=$this->ag_ref)
938 $nAg_ref=$this->
db->get_value(
"select count(*) from action_gestion where ag_ref=$1", array($this->ag_ref));
941 echo
h2(
"Référence en double, référence non sauvée",
'class="error"');
942 $this->ag_ref=
$old->ag_ref;
947 if ($this->ag_remind_date!=
null)
949 $this->
db->exec_sql(
"update action_gestion set ".
950 " ag_timestamp=to_date($1,'DD.MM.YYYY'),".
956 " ag_priority = $8 ,".
958 " ag_contact = $10, ".
960 " ag_remind_date=to_date($12,'DD.MM.YYYY') ".
961 " where ag_id = $6", array(
973 $this->ag_remind_date
978 $this->
db->exec_sql(
"update action_gestion set ".
979 " ag_timestamp=to_date($1,'DD.MM.YYYY'),".
985 " ag_priority = $8 ,".
987 " ag_contact = $10, ".
989 " ag_remind_date=null ".
990 " where ag_id = $6", array(
1006 $document_saved=
$doc->upload($this->
ag_id);
1010 $nb_item=
$http->post(
"nb_item",
"number",0);
1011 for (
$i=0;
$i< $nb_item ;
$i++)
1021 if (trim(strip_tags($this->ag_comment??
"")) !=
'')
1023 $notag_comment=strip_tags($this->ag_comment);
1024 $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"
1025 , array($this->
ag_id, $_SESSION[SESSION_KEY.
'g_user'], $notag_comment,$this->ag_comment));
1028 foreach ($document_saved as $document_id) {
1029 $this->
db->exec_sql(
"insert into action_comment_document(document_id,action_gestion_comment_id) values ($1,$2)",
1030 [$document_id,$action_comment_id]);
1034 if (trim(strip_tags($this->ag_description??
""))!=
'' )
1036 if ( $this->ag_description_id <0)
1037 $this->ag_description_id = $this->
db->get_value(
"
1038 insert into action_gestion_comment (ag_id,tech_user,agc_comment,agc_comment_raw)
1039 values ($1,$2,$3,$4)
1041 , array($this->
ag_id, $_SESSION[SESSION_KEY.
'g_user'],strip_tags($this->ag_description), $this->ag_description));
1043 $this->
db->exec_sql(
"
1044 update action_gestion_comment
1045 set agc_comment = $1 ,
1046 agc_comment_raw = $2,
1049 , array(strip_tags($this->ag_description), $this->ag_description, $_SESSION[SESSION_KEY.
'g_user'],
1050 $this->ag_description_id));
1052 if ( ! empty ($document_saved)) {
1053 foreach ($document_saved as $document_id) {
1054 $this->
db->exec_sql(
"insert into action_comment_document(document_id,action_gestion_comment_id) values ($1,$2)",
1055 [$document_id,$this->ag_description_id]);
1105 $this->
ag_id=
$http->extract(
"ag_id",
"number",0);
1106 $this->ag_ref=
$http->extract(
"ag_ref",
"string",
"");
1107 $this->qcode_dest=
$http->extract(
"qcode_dest",
"string",
"");
1108 $this->f_id_dest=
$http->extract(
"f_id_dest",
"string",
null);
1109 $this->ag_timestamp=
$http->extract(
"ag_timestamp",
"string",date(
'd.m.Y'));
1111 $this->dt_id=
$http->extract(
"dt_id",
"string",
"");
1112 $this->ag_state=
$http->extract(
"ag_state",
"number",2);
1113 $this->ag_title=
$http->extract(
"ag_title",
"string",
"");
1114 $this->ag_hour=
$http->extract(
"ag_hour",
"string",
"");
1115 $this->ag_dest=
$http->extract(
"ag_dest",
"string",
$g_user->get_profile());
1116 $this->ag_priority=
$http->extract(
"ag_priority",
"string",
"2");
1117 $this->ag_contact=
$http->extract(
"ag_contact",
"string",
"");
1118 $ag_comment=trim(
$http->extract(
"ag_comment",
"raw",
""));
1119 if ( strip_tags($ag_comment) ==
'')
1120 $this->ag_comment=
'';
1122 $this->ag_comment=$ag_comment;
1125 $this->ag_description=
'';
1128 $this->ag_description_id=
$http->extract(
"ag_description_id",
"string",-1);
1129 $this->ag_remind_date=
$http->extract(
"ag_remind_date",
"string",
null);
1130 $this->operation=
$http->extract(
"operation",
"string",
null);
1131 $this->action=
$http->extract(
"action",
"string",
null);
1142 $sql=
"delete from action_gestion where ag_id=$1";
1151 for (
$i=0;
$i<
sizeof($aDoc);
$i++)
1153 $aDoc[
$i]->remove();
1167 $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 ".
1168 " from action_gestion join document_type ".
1169 " on (ag_type=dt_id) "
1170 .
"left join vw_fiche_attr on (f_id=f_id_dest) "
1171 .
"where ag_state in (2,3) "
1172 .
"and ".self::sql_security_filter($this->
db,
'R').
1173 "order by ag_timestamp desc limit $p_limit";
1184 $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 ".
1185 " from action_gestion join document_type ".
1186 " on (ag_type=dt_id)
1187 left join vw_fiche_attr on (f_id=f_id_dest)
1189 ag_state not in (1,4)
1190 and to_char(ag_remind_date,'DDMMYYYY')=to_char(now(),'DDMMYYYY')
1202 $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 ".
1203 " from action_gestion join document_type ".
1204 " on (ag_type=dt_id) left join vw_fiche_attr on (f_id=f_id_dest) where ag_state not in (1,4)
1205 and to_char(ag_remind_date,'YYMMDD') < to_char(now(),'YYMMDD') and ".self::sql_security_filter($this->
db,
'R');
1215 if (trim($this->operation??
"")==
'')
1217 $array=explode(
",", $this->operation);
1220 if ($this->
db->get_value(
"select count(*) from action_gestion_operation
1221 where ag_id=$1 and jr_id=$2", array($this->
ag_id,
$array[
$i]))==0)
1223 $this->
db->exec_sql(
"insert into action_gestion_operation (ag_id,jr_id) values ($1,$2)", array($this->
ag_id,
$array[
$i]));
1235 if ($this->op==
null)
1240 $this->
db->exec_sql(
"delete from action_gestion_operation where ago_id=$1", array(
$op[
$i]));
1253 $a=
$http->get(
"action_query",
"string",
"");
1263 $supl_hidden.=HtmlInput::hidden(
'qcode_dest',
$f->get_quick_code());
1270 require_once NOALYSS_TEMPLATE.
'/action_button.php';
1273 if ( $inner )
$w->autocomplete=0;
1275 $w->id=
$w->generate_id(
$w->name);
1281 $list=
$cn->make_list(
"select fd_id from fiche_def where frd_id in (4,8,9,14,15,16,25)");
1286 $type_doc=
new ISelect(
'tdoc');
1287 $aTDoc=
$cn->make_array(
'select dt_id,dt_value from document_type order by dt_value');
1288 $aTDoc[]=array(
'value'=>
'-1',
'label'=>
_(
'Tous les types'));
1289 $type_doc->value=$aTDoc;
1290 $type_doc->selected=(isset(
$_GET[
'tdoc']))?
$_GET[
'tdoc']:-1;
1293 $type_state=
new ISelect(
'state');
1294 $aState=
$cn->make_array(
'select s_id,s_value from document_state order by s_value');
1295 $aState[]=array(
'value'=>
'-1',
'label'=>
_(
'Tous les actions ouvertes'));
1296 $type_state->value=$aState;
1297 $type_state->selected=(isset(
$_GET[
'state']))?
$_GET[
'state']:-1;
1302 $hsExcptype_state=
new ISelect(
'hsstate');
1303 $aExcpState=
$cn->make_array(
'select s_id,s_value from document_state order by s_value');
1304 $aExcpState[]=array(
'value'=>
'-1',
'label'=>
_(
'Aucun'));
1305 $hsExcptype_state->value=$aExcpState;
1306 $hsExcptype_state->selected=(isset(
$_GET[
'hsstate']))?
$_GET[
'hsstate']:-1;
1316 $closed_action=
new ICheckBox(
'closed_action');
1317 $closed_action->selected=(isset(
$_GET[
'closed_action']))?
true:
false;
1320 $only_internal=
new ICheckBox(
'only_internal');
1321 $only_internal->selected=(isset(
$_GET[
'only_internal']))?
true:
false;
1323 $aAg_dest=
$cn->make_array(
"select p_id as value, ".
1325 " from profile where p_id in ".
1326 $g_user->sql_readable_profile().
1328 $aAg_dest[]=array(
'value'=>
'-2',
'label'=>
_(
'Tous les profils'));
1334 $osag_ref=
new IText(
"sag_ref");
1335 $osag_ref->value=
$http->get(
'sag_ref',
"string",
"");
1336 $remind_date=
new IDate(
'remind_date');
1337 $remind_date->value=
$http->get(
'remind_date',
"string",
"");
1338 $remind_date_end=
new IDate(
'remind_date_end');
1339 $remind_date_end->value=
$http->get(
'remind_date_end',
"string",
"");
1343 require_once NOALYSS_TEMPLATE.
'/action_search.php';
1353 echo \HtmlInput::button_action(
"Recherches sauvées",sprintf(
"list_filter_followup('%s','%s')",Dossier::id(),
$http->request(
"ac")));
1373 echo
'<form method="POST" id="list_ag_frm" style="display:inline">';
1374 echo HtmlInput::request_to_hidden(array(
"gDossier",
"ac",
"sb",
"sc",
"f_id"));
1375 require_once NOALYSS_TEMPLATE.
'/action_other_action.php';
1386 require_once NOALYSS_TEMPLATE.
'/followup-show-action-add.php';
1401 if (count(
$p_array[
'searchtag'])==0)
1404 $operand =
"1 = 0 ";
1420 return "and (".$query.
")";
1441 $action_query=
" and ag.ag_id= ".sql_string(
$p_array[
'ag_id']);
1442 $action_query.=
" and ".Follow_Up::sql_security_filter(
$cn,
'R');
1443 return $action_query;
1445 if (isset(
$p_array[
'action_query']) && trim(
$p_array[
'action_query']??
"") !=
"")
1447 $action_query =
$http->extract(
'action_query');
1449 $action_query=
"and (ag_title ilike '%".sql_string($action_query).
"%' ".
1450 "or ag_ref ='".trim(
sql_string($action_query??
"")).
1451 "' or ag.ag_id in (select ag_id from action_gestion_comment ".
1452 " where agc_comment ilike '%".trim(
sql_string($action_query??
"")).
"%')".
1469 $str=
" and (f_id_dest= ".$fiche->id.
" or ag.ag_id in (select ag_id from action_person as ap where ap.f_id=".
$fiche->id.
") or ag_contact=".
$fiche->id.
" )";
1474 $action_query .=
' and dt_id = '.sql_string(
$p_array[
'tdoc']);
1478 $action_query .=
' and ag_state= '.sql_string(
$p_array[
'state']);
1484 $action_query .=
' and ag_state <> '.sql_string(
$p_array[
'hsstate']);
1488 $action_query .=
" and ag_ref= '".sql_string(
$p_array[
'sag_ref']).
"'";
1491 if (isset(
$_GET[
'only_internal']))
1492 $action_query .=
' and f_id_dest=0 ';
1496 $action_query.=
" and ag_timestamp >= to_date('".$p_array[
'date_start'].
"','DD.MM.YYYY')";
1500 $action_query.=
" and ag_timestamp <= to_date('".$p_array[
'date_end'].
"','DD.MM.YYYY')";
1506 " ag_owner='".$_SESSION[SESSION_KEY.
'g_user'].
"'))";
1516 $action_query .=
" and to_date('".sql_string(
$p_array[
'$remind_date']).
"','DD.MM.YYYY')<= ag_remind_date";
1520 $action_query .=
" and to_date('".sql_string(
$p_array[
'remind_date_end']).
"','DD.MM.YYYY')>= ag_remind_date";
1525 $action_query.=
" and s_status is null ";
1531 if ( DEBUGNOALYSS > 1) {
1532 print __FILE__.__LINE__.
"QUERY = [ $action_query.$str]";
1534 return $action_query.$str;
1545 select ag_id,to_char(ag_timestamp,'DD.MM.YY') as my_date,
1547 substr(ag_title,1,40) as sub_ag_title,dt_value,ag_ref, ag_priority,ag_state,
1548 coalesce((select p_name from profile where p_id=ag_dest),'Aucun groupe') as dest,
1549 (select ad_value from fiche_Detail where f_id=ag.f_id_dest and ad_id=1) as name
1550 from action_gestion ag
1551 join document_type on (ag_type=dt_id)
1552 join document_state on (s_id=ag_state)
1559 require_once NOALYSS_TEMPLATE.
'/action_search_result.php';
1567 if (trim($this->action??
"")==
'')
1569 $array=explode(
",", $this->action);
1577 if ($this->
db->get_value(
"select count(*) from action_gestion_related
1578 where (aga_least=$1 and aga_greatest=$2) or (aga_greatest=$1 and aga_least=$2)", array(
$array[
$i], $this->
ag_id))==0)
1580 $this->
db->exec_sql(
"insert into action_gestion_related(aga_least,aga_greatest) values ($1,$2)", array($this->
ag_id,
$array[
$i]));
1596 to_char(ag_timestamp,'DD.MM.YYYY') as my_date,
1597 to_char(ag_remind_date,'DD.MM.YYYY') as my_remind,
1598 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,
1599 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,
1600 (select ad_value from fiche_Detail where f_id=ag.f_id_dest and ad_id=1) as name,
1607 coalesce((select p_name from profile where p_id=ag_dest),'Aucun groupe') as dest
1608 from action_gestion as ag
1609 join document_type on (ag.ag_type=dt_id)
1610 join document_state on(ag.ag_state=s_id)
1611 where true $p_search order by ag.ag_timestamp,ag.ag_id";
1616 $this->
db->query_to_csv(
$ret, array(
1617 array(
"title"=>
"doc id",
"type"=>
"string"),
1618 array(
"title"=>
"date",
"type"=>
"date"),
1619 array(
"title"=>
"rappel",
"type"=>
"date"),
1620 array(
"title"=>
"date dernier commentaire",
"type"=>
"date"),
1621 array(
"title"=>
"tags",
"type"=>
"string"),
1622 array(
"title"=>
"nom",
"type"=>
"string"),
1623 array(
"title"=>
"titre",
"type"=>
"string"),
1624 array(
"title"=>
"type document",
"type"=>
"string"),
1625 array(
"title"=>
"ref",
"type"=>
"string"),
1626 array(
"title"=>
"priorite",
"type"=>
"string"),
1627 array(
"title"=>
"etat",
"type"=>
"string"),
1628 array(
"title"=>
"profil",
"type"=>
"string")
1645 to_char(ag_timestamp,'DD.MM.YYYY') as my_date,
1646 to_char(ag_remind_date,'DD.MM.YYYY') as my_remind,
1647 to_char(coalesce((select max(agc_date)
1648 from action_gestion_comment as agc
1649 where agc.ag_id=ag.ag_id),ag.ag_timestamp),'DD.MM.YY HH24:MI') as last_comment,
1650 array_to_string((select array_agg(t1.t_tag)
1651 from action_tags as a1 join tags as t1 on (a1.t_id=t1.t_id)
1652 where a1.ag_id=ag.ag_id ),',') as tags,
1653 array_to_string((select array_agg(coalesce(jrn1.jr_pj_number,jrn1.jr_internal))
1654 from action_gestion_operation ago join jrn jrn1 using (jr_id)
1655 where ago.ag_id=ag.ag_id),',') as related_operation,
1656 array_to_string((select array_agg(agc2.agc_comment order by agc2.agc_date desc)
1657 from action_gestion_comment agc2 where agc2.ag_id=ag.ag_id ),'|') as action_comment,
1658 array_to_string((select array_agg(followup_id) from (select agr1.aga_least followup_id
1659 from action_gestion_related agr1
1660 where agr1.aga_greatest = ag.ag_id
1662 select agr2.aga_greatest
1664 action_gestion_related agr2
1665 where agr2.aga_least=ag.ag_id) as followup),',') follow_up,
1666 (select ad_value from fiche_Detail where f_id=ag.f_id_dest and ad_id=1) as name,
1672 coalesce((select p_name from profile where p_id=ag_dest),'Aucun groupe') as dest,
1674 to_char(last_comment_date,'DD.MM.YY') last_comment_date_str
1675from action_gestion as ag
1676join document_type on (ag.ag_type=dt_id)
1677join document_state on(ag.ag_state=s_id)
1678 left join (select agc.ag_id,max(agc.agc_date) last_comment_date from action_gestion_comment agc group by agc.ag_id) last_comment on (last_comment.ag_id=ag.ag_id)
1680 true $p_search order by ag.ag_timestamp,ag.ag_id";
1694 _(
"Date dernier commentaire "),
1699 _(
"Autres actions"),
1703 for (
$i=0;
$i<$nb_record;
$i++)
1732 select ag_id,ag_ref,ago_id,
1735 join action_gestion_operation using(ag_id)
1737 jr_id=$1", array($p_jr_id));
1747 if ($this->
ag_id==0)
1749 $sql=
'select b.ag_id,b.t_id,b.at_id,a.t_tag,a.t_color'
1751 .
' tags as a join action_tags as b on (a.t_id=b.t_id)'
1753 .
' order by a.t_tag';
1765 if ($this->
ag_id==0)
1767 $count=$this->
db->get_value(
'select count(*) from action_tags'.
1768 ' where ag_id=$1 and t_id=$2', array($this->
ag_id, $p_t_id));
1771 $sql=
' insert into action_tags (ag_id,t_id) values ($1,$2)';
1772 $this->
db->exec_sql(
$sql, array($this->
ag_id, $p_t_id));
1781 if ($this->
ag_id==0)
1783 $sql=
' delete from action_tags where ag_id=$1 and t_id=$2';
1784 $this->
db->exec_sql(
$sql, array($this->
ag_id, $p_t_id));
1798 echo
'<span class="tagcell tagcell-color'.$a_tag[
$e][
't_color'].
'">';
1799 echo $a_tag[
$e][
't_tag'];
1800 if (
$g_user->can_write_action($this->ag_id)==
true && $p_view !=
'READ')
1802 $js_remove=sprintf(
"action_tag_remove('%s','%s','%s')", dossier::id(), $this->
ag_id, $a_tag[
$e][
't_id']);
1810 if ($p_view !=
'READ' &&
$g_user->can_write_action($this->ag_id)==
true)
1812 $js=sprintf(
"onclick=\"action_tag_select('%s','%s')\"", dossier::id(), $this->
ag_id);
1813 echo HtmlInput::button(
'tag_bt',
_(
'Ajout étiquette'),
$js,
'smallbutton');
1822 for (
$i=0;
$i<count($mag_id);
$i++)
1824 if (
$g_user->can_write_action($mag_id[
$i])==
false)
1826 for (
$e=0;
$e<count($remtag);
$e++)
1829 $a->tag_remove($remtag[
$e]);
1839 for (
$i=0;
$i<count($mag_id);
$i++)
1841 if (
$g_user->can_write_action($mag_id[
$i])==
false)
1843 for (
$e=0;
$e<count($addtag);
$e++)
1846 $a->tag_add($addtag[
$e]);
1855 for (
$i=0;
$i<count($mag_id);
$i++)
1857 if (
$g_user->can_write_action($mag_id[
$i])==
false)
1868 for (
$i=0;
$i<count($mag_id);
$i++)
1870 if (
$g_user->can_read_action($mag_id[
$i])==
false)
1874 echo
'<div class="content">';
1875 echo
$a->Display(
"READ",
false,
"");
1877 echo
'<P id="breakhere"> - - </p>';
1883 $this->
db->exec_sql(
'delete from action_tags where ag_id=$1', array($this->
ag_id));
1892 for (
$i=0;
$i<count($mag_id);
$i++)
1894 if (
$g_user->can_write_action($mag_id[
$i])==
false)
1896 $cn->exec_sql(
'update action_gestion set ag_state=$1 where ag_id=$2', array(
$state, $mag_id[
$i]));
1905 for (
$i=0;
$i<count($mag_id);
$i++)
1907 if (
$g_user->can_write_action($mag_id[
$i])==
false)
1909 $cn->exec_sql(
'delete from action_gestion where ag_id=$1', array($mag_id[
$i]));
1919 if ($this->dt_id==-1)
1921 throw new Exception(
_(
'Type action invalide'), 10);
1923 if (
isDate($this->ag_timestamp)!=$this->ag_timestamp)
1924 throw new Exception(
_(
'Date invalide'), 20);
1925 if (
isDate($this->ag_remind_date)!=$this->ag_remind_date)
1926 throw new Exception(
_(
'Date invalide'), 30);
1927 if ($this->f_id_dest==0)
1928 $this->f_id_dest=
null;
1939 include NOALYSS_TEMPLATE.
'/action_display_short.php';
1949 if (
$g_user->can_add_action($this->ag_dest) == FALSE )
1951 throw new Exception(
_(
'SECURITE : Ajout impossible'));
1957 $seq_name=
"seq_doc_type_".$this->dt_id;
1962 $this->
ag_id=$this->
db->get_next_seq(
'action_gestion_ag_id_seq');
1965 $ag_ref=$this->
db->get_value(
'select dt_prefix from document_type '
1966 .
'where dt_id=$1', array($this->dt_id))
1967 .
'-'.$this->
db->get_next_seq($seq_name);
1975 $sql=
"insert into action_gestion".
1976 "(ag_id,ag_timestamp,ag_type,ag_title,f_id_dest,ag_ref, "
1978 " ag_priority,ag_owner,ag_state,ag_remind_date,ag_hour) ".
1980 .
"($1,to_date($2,'DD.MM.YYYY'),$3,$4,$5,$6,"
1982 .
"$8,$9,$10,to_date($11,'DD.MM.YYYY'),$12)";
1984 $this->
db->exec_sql(
$sql, array(
1986 $this->ag_timestamp,
1993 $_SESSION[SESSION_KEY.
'g_user'],
1995 $this->ag_remind_date,
2000 if (trim($this->ag_comment??
"")!=
'')
2004 $action_comment->tech_user= $_SESSION[SESSION_KEY.
'g_user'];
2005 $action_comment->agc_comment=$this->ag_comment;
2006 $action_comment->agc_comment_raw=$this->ag_comment;
2007 $action_comment->insert();
2017 with recursive t (aga_least,aga_greatest,depth) as (
2018 select aga_least,aga_greatest , 1
2020 action_gestion_related
2021 where aga_greatest=$1
2023 select p2.aga_least,p2.aga_greatest,depth + 1
2025 t as p1, action_gestion_related as p2
2027 p2.aga_greatest is not null and
2028 p2.aga_greatest = p1.aga_least
2029 ) select aga_least,aga_greatest,depth from t order by depth desc,aga_least asc
2030 ' , array($this->
ag_id)
2050 $sql =
"with recursive t (key_path, aga_least,aga_greatest,depth) as (
2052 aga_least::text||'-'||aga_greatest::text as key_path ,
2053 aga_least,aga_greatest , 1
2055 action_gestion_related
2056 where aga_least=$1 or aga_greatest = $1
2058 select key_path||'-'||p2.aga_greatest::text,
2059 p2.aga_least,p2.aga_greatest,depth + 1
2061 t as p1, action_gestion_related as p2
2063 p1.aga_greatest is not null and
2064 p1.aga_greatest = p2.aga_least
2066 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
2068 action_gestion join t on (ag_id=aga_greatest)
2069 join document_type on (ag_type=dt_id)
2072 $ret_array=$this->
db->get_array(
$sql,array(
$p_id));
2074 if ( empty($ret_array))
return array();
2089 $parent_id=$this->
db->get_value(
"select min( get_follow_up_tree) from comptaproc.get_follow_up_tree($1)",[$this->
ag_id]);
2091 $base=HtmlInput::request_to_string(array(
"gDossier",
"ac",
"sb",
"sc",
2092 "f_id")).
"&sa=detail";
2094 if (empty($parent_id))
2096 echo
_(
'Principal');
2103 echo
'<span class="highlight">';
2104 $xaction=sprintf(
'view_action(%d,%d,%d)', $fu_parent->ag_id,
2106 $showAction=
'<a class="line" href="javascript:'.$xaction.
'">';
2108 $fu_parent->ag_timestamp,
" ",
2109 h($fu_parent->ag_title),
2110 '('.h($fu_parent->ag_ref).
')',
2114 echo
'<ul style="padding-left:10px;list-style-type: none;">';
2117 for ($o=0; $o<count(
$action); $o++)
2122 $count_parent =$this->
db->get_value(
'select count(*) from action_gestion_related where aga_greatest = $1',array(
$action[$o][
'aga_greatest']));
2123 $direct_parent=($count_parent > 1 ) ?
_(
'direct parent ').$count_parent:
"";
2125 $margin=(
$action[$o][
'depth']>1 )?str_repeat(
" ",
$action[$o][
'depth']-1).
"⇨":
"";
2126 if ($p_view!=
'READ'&&$p_base!=
'ajax')
2128 $rmAction=sprintf(
"return confirm_box(null,'".
_(
'Voulez-vous effacer cette action ').
"', function () {remove_action('%s','%s','%s');});",
2129 dossier::id(),
$action[$o][
'aga_greatest'],
2130 $http->request(
'ag_id',
"number"));
2131 $showAction=
'<a class="line" href="'.$base.
"&ag_id=".
$action[$o][
'aga_greatest'].
'">';
2133 echo
'<li '.$class.
' id="act'.
$action[$o][
'aga_greatest'].
'">'.$margin.$showAction.$action[$o][
'str_date'].
2134 h(
$action[$o][
'title']).
'('.
h(
$action[$o][
'action_ref']).
')'.$direct_parent.
'</a>'.
" "
2141 if ($p_base==
'ajax')
2143 $xaction=sprintf(
'view_action(%d,%d,%d)',
$action[$o][
'aga_greatest'],
2145 $showAction=
'<a class="line" href="javascript:'.$xaction.
'">';
2146 echo
'<li '.$class.
' >'.$margin.$showAction.$action[$o][
'str_date'].
" ".
2147 h(
$action[$o][
'title']).
'('.
h(
$action[$o][
'action_ref']).
')'.$direct_parent.
'</a>'.
" "
2155 $showAction=
'<a class="line" href="'.$base.
"&ag_id=".
$action[$o][
'aga_greatest'].
'">';
2156 echo
'<li '.$class.
' >'.$margin.$showAction.$action[$o][
'str_date'].
" ".
2157 h(
$action[$o][
'title']).
'('.
h(
$action[$o][
'action_ref']).
')'.$direct_parent.
'</a>'.
" "
2173 $a_parent=$this->
db->get_array(
2176 ,ag1.ag_title as title
2177 ,to_char(ag1.ag_timestamp,'DD/MM/YY') as str_date
2178 ,ag1.ag_ref||' '||dt_value as action_ref
2181 join document_type on (ag_type=dt_id)
2182 join (select distinct get_follow_up_tree from comptaproc.get_follow_up_tree($1)) tree_ag
2183 on (tree_ag.get_follow_up_tree=ag1.ag_id)
2185 ", array($this->
ag_id)
2187 if ( empty($a_parent ) )
return;
2188 echo
'<ul style="padding-left:10px;list-style-type: none;">';
2189 $base=HtmlInput::request_to_string(array(
"gDossier",
"ac",
"sa",
"sb",
"sc",
2192 for ($o=0; $o<count($a_parent); $o++)
2194 $class=($this->
ag_id == $a_parent[$o][
'ag_id'])?
' class="highlight" ':
'';
2196 if ($p_view!=
'READ'&&$p_base!=
'ajax')
2198 $rmAction=sprintf(
"return confirm_box(null,'".
_(
'Voulez-vous effacer cette action ').
"', function () {remove_action('%s','%s','%s');});",
2199 dossier::id(), $a_parent[$o][
'ag_id'],
2200 $http->request(
'ag_id',
"number"));
2201 $showAction=
'<a class="line" href="'.$base.
"&ag_id=".$a_parent[$o][
'ag_id'].
'">';
2205 echo
'<li '.$class.
' id="act'.$a_parent[$o][
'ag_id'].
'">'.$showAction.$a_parent[$o][
'str_date'].
2206 h($a_parent[$o][
'title']).
'('.
h($a_parent[$o][
'action_ref']).
')'.
'</a>'.
" "
2213 if ($p_base==
'ajax')
2215 $xaction=sprintf(
'view_action(%d,%d,%d)', $a_parent[$o][
'ag_id'],
2217 $showAction=
'<a class="line" href="javascript:'.$xaction.
'">';
2218 echo
'<li '.$class.
' >'.$showAction.$a_parent[$o][
'str_date'].
" ".
2219 h($a_parent[$o][
'title']).
'('.
h($a_parent[$o][
'action_ref']).
')'.
'</a>'.
" "
2227 $showAction=
'<a class="line" href="'.$base.
"&ag_id=".$a_parent[$o][
'ag_id'].
'">';
2228 echo
'<li '.$class.
' >'.$showAction.$a_parent[$o][
'str_date'].
" ".
2229 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="")
noalyss_strlentrim($p_string)
record_log($p_message)
Record an error message into the log file of the server or in the log folder of NOALYSS Record also t...
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
if(!headers_sent())
– pour utiliser unoconv démarrer un server libreoffice commande libreoffice –headless –accept="socket...
foreach($array as $idx=> $m) $w
_("actif, passif,charge,...")
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
Class for the document template.
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.
define Class fiche and fiche def, those class are using class attribut. When adding or modifing new c...
Follow_Up Details are the details for an actions, it means the details of an order,...
class_action for manipulating actions action can be :
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
$state
State of the document.
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
catch(\Exception $e) $bar
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)