21 require_once NOALYSS_INCLUDE.
'/lib/class_itextarea.php';
22 require_once NOALYSS_INCLUDE.
'/lib/class_idate.php';
23 require_once NOALYSS_INCLUDE.
'/lib/class_iselect.php';
24 require_once NOALYSS_INCLUDE.
'/lib/class_ihidden.php';
25 require_once NOALYSS_INCLUDE.
'/lib/class_itext.php';
26 require_once NOALYSS_INCLUDE.
'/lib/class_ispan.php';
27 require_once NOALYSS_INCLUDE.
'/lib/class_icard.php';
28 require_once NOALYSS_INCLUDE.
'/lib/class_icheckbox.php';
29 require_once NOALYSS_INCLUDE.
'/lib/class_ifile.php';
30 require_once NOALYSS_INCLUDE.
'/class/class_fiche.php';
31 require_once NOALYSS_INCLUDE.
'/class/class_document.php';
32 require_once NOALYSS_INCLUDE.
'/class/class_document_type.php';
33 require_once NOALYSS_INCLUDE.
'/class/class_document_modele.php';
34 require_once NOALYSS_INCLUDE.
'/lib/user_common.php';
35 require_once NOALYSS_INCLUDE.
'/class/class_follow_up_detail.php';
36 require_once NOALYSS_INCLUDE.
'/lib/class_inum.php';
37 require_once NOALYSS_INCLUDE.
'/lib/class_sort_table.php';
38 require_once NOALYSS_INCLUDE.
'/lib/class_irelated_action.php';
39 require_once NOALYSS_INCLUDE.
'/class/class_tag.php';
40 require_once NOALYSS_INCLUDE.
'/class/class_default_menu.php';
103 $this->aAction_detail=array();
118 $profile=
$cn->get_value(
"select p_id from profile_user where user_name=$1", array($g_user->login));
123 $sql=
" (ag_dest in (select p_granted from user_sec_action_profile where p_id=$profile ) ) ";
124 }
else if ($p_mode==
'W')
126 $sql=
" ( ag_dest in (select p_granted from user_sec_action_profile where p_id=$profile and ua_right='W' ) )";
128 error_log(_(
'Securité'));
129 throw new Exception(_(
'Securité'));
159 elseif ($p_view==
"NEW")
163 $this->ag_ref=_(
"Nouveau");
165 elseif ($p_view==
'READ')
172 throw new Exception(
'class_action'.__LINE__.
'Follow_Up::Display error unknown parameter'.$p_view);
177 $date->readOnly=$readonly;
178 $date->name=
"ag_timestamp";
179 $date->id=
"ag_timestamp";
182 $remind_date=
new IDate();
183 $remind_date->readOnly=$readonly;
184 $remind_date->name=
"ag_remind_date";
185 $remind_date->id=
"ag_remind_date";
192 $doc_type->value=$this->
db->make_array(
"select dt_id,dt_value from document_type order by dt_value", 1);
198 $desc=
new ITextArea();
199 $desc->style=
' class="itextarea" style="width:80%;margin-left:0px"';
200 $desc->name=
"ag_comment";
201 $desc->readOnly=$readonly;
202 $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, tech_user
203 FROM action_gestion_comment where ag_id=$1 order by agc_id", array($this->
ag_id)
207 $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
208 from jrn as j join action_gestion_operation as ago on (j.jr_id=ago.jr_id)
209 where ag_id=$1 order by jr_date", array($this->
ag_id));
214 $iaction->value=(isset($this->action))?$this->action:
"";
218 $a=$this->
db->make_array(
"select s_id,s_value from document_state ");
220 $state->readOnly=$readonly;
221 $state->name=
"ag_state";
224 $str_state=$state->input();
234 if ($this->d_id!=0&&$this->d_id!=
"")
236 $h2->readonly=($p_view==
'NEW')?
false:
true;
242 $doc_ref=
"<p> Document ".$doc->anchor().
'</p>';
243 $doc_ref.=$h2->input().$d_id->input(
'd_id', $this->d_id);
250 $title->readOnly=$readonly;
261 $ag_priority->value=array(array(
'value'=>1,
'label'=>_(
'Haute')),
262 array(
'value'=>2,
'label'=>_(
'Moyenne')),
263 array(
'value'=>3,
'label'=>_(
'Basse'))
273 $ag_hour->javascript=
" onblur=check_hour('ag_hour');";
281 $aAg_dest=$this->
db->make_array(
"select p_id as value, ".
283 " from profile where p_id in ".$g_user->get_writable_profile().
"order by 2");
292 $client_label=
new ISpan();
295 $f_add_button=
new IButton(
'add_card');
296 $f_add_button->label=_(
'Créer une nouvelle fiche');
297 $f_add_button->set_attribute(
'ipopup',
'ipop_newcard');
298 $filter=$this->
db->make_list(
'select fd_id from fiche_def ');
299 $f_add_button->set_attribute(
'filter', $filter);
301 $f_add_button->javascript=
" select_card_type(this);";
302 $str_add_button=$f_add_button->input();
305 if ($this->qcode_dest!=
NOTFOUND&&strlen(
trim($this->qcode_dest))!=0)
308 $tiers->get_by_qcode($this->qcode_dest);
309 $qcode_dest_label=$tiers->strAttribut(1);
310 $this->f_id_dest=$tiers->id;
314 $qcode_dest_label=($this->f_id_dest==0||
trim($this->qcode_dest)==
"")?
'Interne ':
'Error';
322 $w->readOnly=$readonly;
324 $w->name=
'qcode_dest';
325 $w->value=($this->f_id_dest!=0)?$this->qcode_dest:
"";
327 $list_recipient=$this->
db->make_list(
'select fd_id from fiche_def where frd_id in (14,25,8,9,16)');
330 $w->set_dblclick(
"fill_ipopcard(this);");
331 $w->set_attribute(
'ipopup',
'ipopcard');
334 $w->set_attribute(
'label',
'qcode_dest_label');
336 $w->set_attribute(
'typecard',
$w->extra);
337 $w->set_function(
'fill_data');
338 $w->javascript=sprintf(
' onchange="fill_data_onchange(\'%s\');" ',
$w->name);
341 $sp->name=
'qcode_dest_label';
342 $sp->value=$qcode_dest_label;
353 if ($this->ag_contact!=0)
355 $contact=
new Fiche($this->
db, $this->ag_contact);
361 $list_contact=$this->
db->make_list(
'select fd_id from fiche_def where frd_id=16');
366 $ag_contact->set_attribute(
'label',
'ag_contact_label');
368 $ag_contact->set_attribute(
'typecard', $list_contact);
372 $spcontact=
new ISpan();
373 $spcontact->name=
'ag_contact_label';
374 $spcontact->value=
'';
375 $fiche_contact=
new Fiche($this->
db);
376 $fiche_contact->get_by_qcode($this->ag_contact);
377 if ($fiche_contact->id!=0)
379 $spcontact->value=$fiche_contact->strAttribut(
ATTR_DEF_NAME);
384 $iag_ref=
new IText(
"ag_ref");
386 $iag_ref->readOnly=($p_view==
"NEW"||$p_view==
'READ')?
true:
false;
387 $str_ag_ref=$iag_ref->input();
393 $upload->name=
"file_upload[]";
394 $upload->readOnly=$readonly;
396 $aAttachedFile=$this->
db->get_array(
'select d_id,d_filename,d_description,d_mimetype,'.
398 Dossier::get().'&d_id=\
'||d_id as link'.
399 ' from document where ag_id=$1', array($this->
ag_id));
402 $aDocMod->name=
'doc_mod';
403 $aDocMod->value=$this->
db->make_array(
'select md_id,dt_value||\' : \'||md_name as md_name'.
404 ' from document_modele join document_type on (md_type=dt_id)'.
405 ' order by md_name');
406 $str_select_doc=$aDocMod->input();
408 if (empty($aDocMod->value))
409 $str_submit_generate=
"";
419 $icard->extra2=
'QuickCode';
429 $itva->in_table=
true;
432 $article_count=(count($this->aAction_detail)==0)?
MAX_ARTICLE:count($this->aAction_detail);
436 for ($i=0; $i<$article_count; $i++)
444 $icard->name=
"e_march".$i;
445 $tmp_ad=(isset($this->aAction_detail[$i]))?$this->aAction_detail[$i]:
false;
446 $icard->readOnly=$readonly;
452 $f=$tmp_ad->get_parameter(
'qcode');
456 $icard->value=$march->get_quick_code();
460 $icard->set_dblclick(
"fill_ipopcard(this);");
462 $icard->set_attribute(
'label',
"e_march".$i.
"_label");
464 $icard->set_attribute(
'typecard', $icard->extra);
465 $icard->set_attribute(
'ipopup',
'ipopcard');
466 $icard->set_function(
'fill_data');
467 $icard->javascript=sprintf(
' onchange="fill_data_onchange(\'%s\');" ', $icard->name);
469 $aArticle[$i][
'fid']=$icard->search().$icard->input();
471 $text->javascript=
' onchange="clean_tva('.$i.
');compute_ledger('.$i.
')"';
472 $text->css_size=
"100%";
473 $text->name=
"e_march".$i.
"_label";
474 $text->id=
"e_march".$i.
"_label";
476 $text->value=($tmp_ad)?$tmp_ad->get_parameter(
'text'):
"";
477 $text->readOnly=$readonly;
478 $aArticle[$i][
'desc']=$text->input();
480 $num->javascript=
' onchange="format_number(this,4);clean_tva('.$i.
');compute_ledger('.$i.
')"';
481 $num->name=
"e_march".$i.
"_price";
482 $num->id=
"e_march".$i.
"_price";
484 $num->readOnly=$readonly;
485 $num->value=($tmp_ad)?$tmp_ad->get_parameter(
'price_unit'):0;
486 $aArticle[$i][
'pu']=
$num->input();
488 $num->name=
"e_quant".$i;
489 $num->id=
"e_quant".$i;
491 $num->value=($tmp_ad)?$tmp_ad->get_parameter(
'quantity'):0;
492 $aArticle[$i][
'quant']=
$num->input();
494 $itva->name=
'e_march'.$i.
'_tva_id';
495 $itva->id=
'e_march'.$i.
'_tva_id';
496 $itva->value=($tmp_ad)?$tmp_ad->get_parameter(
'tva_id'):0;
497 $itva->readOnly=$readonly;
498 $itva->js=
' onchange="format_number(this);clean_tva('.$i.
');compute_ledger('.$i.
')"';
499 $itva->set_attribute(
'compute', $i);
501 $aArticle[$i][
'tvaid']=$itva->input();
503 $num->name=
"e_march".$i.
"_tva_amount";
504 $num->id=
"e_march".$i.
"_tva_amount";
505 $num->value=($tmp_ad)?$tmp_ad->get_parameter(
'tva_amount'):0;
506 $num->javascript=
" onchange=\"compute_ledger('".$i.
" ')\"";
508 $aArticle[$i][
'tva']=
$num->input();
511 $num->name=
"tvac_march".$i;
512 $num->id=
"tvac_march".$i;
513 $num->value=($tmp_ad)?$tmp_ad->get_parameter(
'total'):0;
515 $aArticle[$i][
'tvac']=
$num->input();
516 $tot_item=bcadd($tot_item,
$num->value);
524 $r.=dossier::hidden();
528 $r.=$Hid->input(
"nb_item", $article_count);
529 $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"));
534 require NOALYSS_TEMPLATE.
'/detail-action.php';
542 $r.=$h_ag_id->input(
'ag_id', $this->
ag_id);
544 $r.=$hidden2->input(
'f_id_dest', $this->f_id_dest);
556 $sql=
"select ag_id,to_char (ag_timestamp,'DD.MM.YYYY') as ag_timestamp,".
557 " f_id_dest,ag_title,ag_ref,d_id,ag_type,ag_state, ag_owner, ".
558 " ag_dest, ag_hour, ag_priority, ag_contact,to_char (ag_remind_date,'DD.MM.YYYY') as ag_remind_date ".
559 " from action_gestion left join document using (ag_id) where ag_id=".$this->ag_id;
567 $this->ag_timestamp=
$row[0][
'ag_timestamp'];
568 $this->ag_contact=
$row[0][
'ag_contact'];
569 $this->f_id_dest=
$row[0][
'f_id_dest'];
570 $this->ag_title=
$row[0][
'ag_title'];
571 $this->ag_type=
$row[0][
'ag_type'];
572 $this->ag_ref=
$row[0][
'ag_ref'];
573 $this->ag_state=
$row[0][
'ag_state'];
574 $this->d_id=
$row[0][
'd_id'];
575 $this->ag_dest=
$row[0][
'ag_dest'];
576 $this->ag_hour=
$row[0][
'ag_hour'];
577 $this->ag_priority=
$row[0][
'ag_priority'];
578 $this->ag_remind_date=
$row[0][
'ag_remind_date'];
579 $this->ag_owner=
$row[0][
'ag_owner'];
582 $action_detail->set_parameter(
'ag_id', $this->
ag_id);
583 $this->aAction_detail=$action_detail->load_all();
592 $this->state=
$row[
'0'][
'ag_state'];
593 $this->ag_state=
$row[0][
'ag_state'];
595 $this->dt_id=$this->ag_type;
596 $aexp=
new Fiche($this->
db, $this->f_id_dest);
614 $seq_name=
"seq_doc_type_".$this->dt_id;
620 $exp->get_by_qcode($this->qcode_dest);
621 $exp->id=($exp->id==0)?null:$exp->id;
626 if (
trim($this->ag_title)==
"")
628 $doc_mod=
new document_type($this->
db);
631 $this->ag_title=$doc_mod->dt_value;
633 $this->
ag_id=$this->
db->get_next_seq(
'action_gestion_ag_id_seq');
636 $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);
640 if ($this->ag_remind_date!=null||$this->ag_remind_date!=
'')
642 $sql=
"insert into action_gestion".
643 "(ag_id,ag_timestamp,ag_type,ag_title,f_id_dest,ag_ref, ag_dest, ".
644 " ag_hour, ag_priority,ag_owner,ag_contact,ag_state,ag_remind_date) ".
645 " values ($1,to_date($2,'DD.MM.YYYY'),$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,to_date($13,'DD.MM.YYYY'))";
649 $this->ag_remind_date=null;
650 $sql=
"insert into action_gestion".
651 "(ag_id,ag_timestamp,ag_type,ag_title,f_id_dest,ag_ref, ag_dest, ".
652 " ag_hour, ag_priority,ag_owner,ag_contact,ag_state,ag_remind_date) ".
653 " values ($1,to_date($2,'DD.MM.YYYY'),$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13)";
667 $this->ag_remind_date
672 for ($i=0; $i<
$_POST[
'nb_item']; $i++)
675 $act->from_array($_POST, $i);
685 if (
trim($this->ag_comment)!=
'')
687 $this->
db->exec_sql(
"insert into action_gestion_comment (ag_id,tech_user,agc_comment) values ($1,$2,$3)"
688 , array($this->
ag_id, $_SESSION[
'g_user'], $this->ag_comment));
702 function myList($p_base, $p_filter=
"", $p_search=
"")
705 $url=
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")).
'&'.$p_base;
708 $table->add(
'Date Doc.',
$url,
'order by ag_timestamp asc',
'order by ag_timestamp desc',
'da',
'dd');
709 $table->add(
'Date Comm.',
$url,
'order by last_comment',
'order by last_comment desc',
'dca',
'dcd');
710 $table->add(
'Date Limite',
$url,
'order by ag_remind_date asc',
'order by ag_remind_date desc',
'ra',
'rd');
711 $table->add(
'Tag',
$url,
'order by tags asc',
'order by tags desc',
'taa',
'tad');
712 $table->add(
'Réf.',
$url,
'order by ag_ref asc',
'order by ag_ref desc',
'ra',
'rd');
713 $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');
714 $table->add(
'Dest/Exp',
$url,
'order by name asc',
'order by name desc',
'ea',
'ed');
715 $table->add(
'Titre',
$url,
'order by ag_title asc',
'order by ag_title desc',
'ta',
'td');
720 if (strlen(
trim($p_filter))!=0)
721 $p_filter_doc=
" dt_id in ( $p_filter )";
723 $p_filter_doc=
" 1=1 ";
726 select ag_id,to_char(ag_timestamp,'DD.MM.YYYY') as my_date,
727 to_char(ag_remind_date,'DD.MM.YYYY') as my_remind,
728 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,
729 coalesce((select max(agc_date) from action_gestion_comment as agc where agc.ag_id=ag.ag_id),ag_timestamp) as last_comment,
732 ag_title,dt_value,ag_ref, ag_priority,ag_state,
733 coalesce((select p_name from profile where p_id=ag_dest),'Aucun groupe') as dest,
734 (select ad_value from fiche_Detail where f_id=ag.f_id_dest and ad_id=1) as name,
735 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
736 from action_gestion as ag
737 join document_type on (ag_type=dt_id)
738 join document_state on (ag_state=s_id)
739 where $p_filter_doc $p_search $sort";
741 $step=$_SESSION[
'g_pagesize'];
745 $limit=
" LIMIT $step OFFSET $offset ";
754 $r.=
'<p>'.$bar.
'</p>';
755 $r.=
'<table class="document">';
757 $r.=
'<th name="ag_id_td" style="display:none" >'.ICheckBox::toggle_checkbox(
'ag',
'list_ag_frm').
'</th>';
758 $r.=
'<th>'.$table->get_header(0).
'</th>';
759 $r.=
'<th>'.$table->get_header(1).
'</th>';
760 $r.=
'<th>'.$table->get_header(2).
'</th>';
761 $r.=
'<th>'.$table->get_header(3).
'</th>';
762 $r.=
'<th>'.$table->get_header(4).
'</th>';
763 $r.=
'<th>'.$table->get_header(5).
'</th>';
764 $r.=
'<th>'.$table->get_header(6).
'</th>';
765 $r.=
'<th>'.$table->get_header(7).
'</th>';
771 if (
sizeof($a_row)==0 or $a_row==
false)
773 $r=
'<div style="clear:both">';
774 $r.=
'<hr>Aucun enregistrement trouvé';
778 $today=date(
'd.m.Y');
782 foreach ($a_row as
$row)
784 $href=
'<A class="document" HREF="do.php?'.$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'].
'">';
786 $tr=($i%2==0)?
'even':
'odd';
787 if ($row[
'ag_priority']<2)
790 if ($row[
'my_date']==$today)
791 $st=
' style="font-weight:bold; border:2px solid orange;"';
792 $date_remind=
format_date($row[
'my_remind'],
'DD.MM.YYYY',
'YYYYMMDD');
793 $date_today=date(
'Ymd');
794 if ($date_remind!=
""&&$date_remind==$date_today&&$row[
'ag_state']!=1&&$row[
'ag_state']!=3)
795 $st=
' style="font-weight:bold;background:orange"';
796 if ($date_remind!=
""&&$date_remind<$date_today&&$row[
'ag_state']!=1&&$row[
'ag_state']!=3)
797 $st=
' style="font-weight:bold;background:#FF0000;color:white;"';
798 $r.=
"<tr class=\"$tr\" $st>";
800 $r.=
'<td name="ag_id_td" style="display:none">'.$checkbox->input().
'</td>';
801 $r.=
"<td>".$href.smaller_date($row[
'my_date']).
'</a>'.
"</td>";
802 $r.=
"<td>".$href.$row[
'str_last_comment'].
'</a>'.
"</td>";
803 $r.=
"<td>".$href.smaller_date($row[
'my_remind']).
'</a>'.
"</td>";
804 $r.=
"<td>".$href.h($row[
'tags']).
'</a>'.
"</td>";
805 $r.=
"<td>".$href.$row[
'ag_ref'].
'</a>'.
"</td>";
806 $r.=
"<td>".$href.h($row[
'dest']).
'</a>'.
"</td>";
810 $fexp->id=$row[
'f_id_dest'];
813 $qexp=($qcode_dest==
NOTFOUND)?
"Interne":$qcode_dest;
814 $jsexp=sprintf(
"javascript:showfiche('%s')", $qexp);
815 if ($qexp!=
'Interne')
817 $r.=
"<td>$href".$qexp.
" : ".$fexp->getName().
'</a></td>';
820 $r.=
"<td>$href Interne </a></td>";
826 h($row[
'ag_title']).
"</A></td>";
831 switch ($row[
'ag_priority'])
845 $r.=
"<td>".$ref.
"</td>";
851 $r.=
'<p>'.$bar.
'</p>';
869 if (
trim($this->qcode_dest)==
"")
872 $this->f_id_dest=null;
877 if ($tiers->get_by_qcode($this->qcode_dest)==-1)
880 $this->f_id_dest=$tiers->id;
883 if ($contact->get_by_qcode($this->ag_contact)==-1)
892 if (
$old->ag_ref!=$this->ag_ref)
894 $nAg_ref=$this->
db->get_value(
"select count(*) from action_gestion where ag_ref=$1", array($this->ag_ref));
897 echo
h2(
"Référence en double, référence non sauvée",
'class="error"');
898 $this->ag_ref=
$old->ag_ref;
903 if ($this->ag_remind_date!=null)
905 $this->
db->exec_sql(
"update action_gestion set ".
906 " ag_timestamp=to_date($1,'DD.MM.YYYY'),".
912 " ag_priority = $8 ,".
914 " ag_contact = $10, ".
916 " ag_remind_date=to_date($12,'DD.MM.YYYY') ".
917 " where ag_id = $6", array(
929 $this->ag_remind_date
934 $this->
db->exec_sql(
"update action_gestion set ".
935 " ag_timestamp=to_date($1,'DD.MM.YYYY'),".
941 " ag_priority = $8 ,".
943 " ag_contact = $10, ".
945 " ag_remind_date=null ".
946 " where ag_id = $6", array(
965 for ($i=0; $i<
$_POST[
'nb_item']; $i++)
968 $act->from_array($_POST, $i);
975 if (
trim($this->ag_comment)!=
'')
977 $this->
db->exec_sql(
"insert into action_gestion_comment (ag_id,tech_user,agc_comment) values ($1,$2,$3)"
978 , array($this->
ag_id, $_SESSION[
'g_user'], $this->ag_comment));
993 $mod=
new Document_Modele($this->
db, $md_id);
995 $doc->f_id=$this->f_id_dest;
1026 $this->qcode_dest=(isset(
$p_array[
'qcode_dest']))?
$p_array[
'qcode_dest']:
"";
1027 $this->f_id_dest=(isset(
$p_array[
'f_id_dest']))?
$p_array[
'f_id_dest']:null;
1028 $this->ag_timestamp=(isset(
$p_array[
'ag_timestamp']))?
$p_array[
'ag_timestamp']:date(
'd.m.Y');
1029 $this->qcode_dest=(isset(
$p_array[
'qcode_dest']))?
$p_array[
'qcode_dest']:
"";
1035 $this->ag_dest=(isset(
$p_array[
'ag_dest']))?
$p_array[
'ag_dest']:$g_user->get_profile();
1036 $this->ag_priority=(isset(
$p_array[
'ag_priority']))?
$p_array[
'ag_priority']:2;
1037 $this->ag_contact=(isset(
$p_array[
'ag_contact']))?
$p_array[
'ag_contact']:
"";
1038 $this->ag_comment=(isset(
$p_array[
'ag_comment']))?
$p_array[
'ag_comment']:
"";
1039 $this->ag_remind_date=(isset(
$p_array[
'ag_remind_date']))?
$p_array[
'ag_remind_date']:null;
1040 $this->operation=(isset(
$p_array[
'operation']))?
$p_array[
'operation']:null;
1057 $sql=
"delete from action_gestion where ag_id=$1";
1066 for ($i=0; $i<
sizeof($aDoc); $i++)
1068 $aDoc[$i]->remove();
1082 $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 ".
1083 " from action_gestion join document_type ".
1084 " on (ag_type=dt_id) "
1085 .
"left join vw_fiche_attr on (f_id=f_id_dest) "
1086 .
"where ag_state in (2,3) "
1087 .
"and ".self::sql_security_filter($this->
db,
'R').
1088 "order by ag_timestamp desc limit $p_limit";
1099 $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 ".
1100 " from action_gestion join document_type ".
1101 " on (ag_type=dt_id)
1102 left join vw_fiche_attr on (f_id=f_id_dest)
1104 ag_state not in (1,4)
1105 and to_char(ag_remind_date,'DDMMYYYY')=to_char(now(),'DDMMYYYY')
1106 and ". self::sql_security_filter($this->
db,
'R');
1117 $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 ".
1118 " from action_gestion join document_type ".
1119 " on (ag_type=dt_id) left join vw_fiche_attr on (f_id=f_id_dest) where ag_state not in (1,4)
1120 and ag_remind_date < now() and ".self::sql_security_filter($this->
db,
'R');
1130 if (
trim($this->operation)==
'')
1132 $array=explode(
",", $this->operation);
1133 for ($i=0; $i<count(
$array); $i++)
1135 if ($this->
db->get_value(
"select count(*) from action_gestion_operation
1136 where ag_id=$1 and jr_id=$2", array($this->
ag_id,
$array[$i]))==0)
1138 $this->
db->exec_sql(
"insert into action_gestion_operation (ag_id,jr_id) values ($1,$2)", array($this->
ag_id,
$array[$i]));
1150 if ($this->op==null)
1153 for ($i=0; $i<count(
$op); $i++)
1155 $this->
db->exec_sql(
"delete from action_gestion_operation where ago_id=$1", array(
$op[$i]));
1167 $a=(isset(
$_GET[
'action_query']))?
$_GET[
'action_query']:
"";
1187 require_once NOALYSS_TEMPLATE.
'/action_button.php';
1190 if ( $inner )
$w->autocomplete=0;
1192 $w->id=
$w->generate_id(
$w->name);
1198 $list=
$cn->make_list(
"select fd_id from fiche_def where frd_id in (4,8,9,14,15,16,25)");
1203 $type_doc=
new ISelect(
'tdoc');
1204 $aTDoc=
$cn->make_array(
'select dt_id,dt_value from document_type order by dt_value');
1205 $aTDoc[]=array(
'value'=>
'-1',
'label'=>_(
'Tous les types'));
1206 $type_doc->value=$aTDoc;
1207 $type_doc->selected=(isset(
$_GET[
'tdoc']))?
$_GET[
'tdoc']:-1;
1210 $type_state=
new ISelect(
'state');
1211 $aState=
$cn->make_array(
'select s_id,s_value from document_state order by s_value');
1212 $aState[]=array(
'value'=>
'-1',
'label'=>_(
'Tous les Etats'));
1213 $type_state->value=$aState;
1214 $type_state->selected=(isset(
$_GET[
'state']))?
$_GET[
'state']:-1;
1219 $hsExcptype_state=
new ISelect(
'hsstate');
1220 $aExcpState=
$cn->make_array(
'select s_id,s_value from document_state order by s_value');
1221 $aExcpState[]=array(
'value'=>
'-1',
'label'=>_(
'Aucun'));
1222 $hsExcptype_state->value=$aExcpState;
1223 $hsExcptype_state->selected=(isset(
$_GET[
'hsstate']))?
$_GET[
'hsstate']:-1;
1233 $closed_action=
new ICheckBox(
'closed_action');
1234 $closed_action->selected=(isset(
$_GET[
'closed_action']))?
true:
false;
1237 $only_internal=
new ICheckBox(
'only_internal');
1238 $only_internal->selected=(isset(
$_GET[
'only_internal']))?
true:
false;
1240 $aAg_dest=
$cn->make_array(
"select p_id as value, ".
1242 " from profile where p_id in ".
1243 $g_user->get_readable_profile().
1245 $aAg_dest[]=array(
'value'=>
'-2',
'label'=>_(
'Tous les profiles'));
1251 $osag_ref=
new IText(
"sag_ref");
1252 $osag_ref->value=(isset(
$_GET[
'sag_ref']))?
$_GET[
'sag_ref']:
"";
1253 $remind_date=
new IDate(
'remind_date');
1254 $remind_date->value=(isset(
$_GET[
'remind_date']))?
$_GET[
'remind_date']:
"";
1255 $remind_date_end=
new IDate(
'remind_date_end');
1256 $remind_date_end->value=(isset(
$_GET[
'remind_date_end']))?
$_GET[
'remind_date_end']:
"";
1260 require_once NOALYSS_TEMPLATE.
'/action_search.php';
1279 echo
'<form method="POST" id="list_ag_frm" style="display:inline">';
1281 require_once NOALYSS_TEMPLATE.
'/action_other_action.php';
1299 if (count($searchtag)==0)
1301 for ($i=0; $i<count($searchtag); $i++)
1304 $query .=
' and ag_id in (select ag_id from action_tags where t_id= '.
sql_string($searchtag[$i]).
')';
1327 $action_query=
"and (ag_title ~* '".sql_string(
$_REQUEST[
'action_query']).
"' ".
1329 "' or ag_id in (select ag_id from action_gestion_comment where agc_comment ~* '".trim(
sql_string(
$_REQUEST[
'action_query'])).
"')".
1346 $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.
") )";
1349 if (isset($tdoc)&&$tdoc!=-1)
1351 $action_query .=
' and dt_id = '.sql_string($tdoc);
1353 if (isset($state)&&$state!=-1)
1355 $action_query .=
' and ag_state= '.sql_string($state);
1357 if (isset($hsstate)&&$hsstate!=-1)
1359 $action_query .=
' and ag_state <> '.sql_string($hsstate);
1361 if (isset($sag_ref)&&
trim($sag_ref)!=
"")
1363 $query .=
' and ag_ref= \''.sql_string($sag_ref).
"'";
1366 if (isset(
$_GET[
'only_internal']))
1367 $action_query .=
' and f_id_dest=0 ';
1371 $action_query.=
" and ag_timestamp >= to_date('$date_start','DD.MM.YYYY')";
1373 if (isset($date_end)&&
isDate($date_end)!=null)
1375 $action_query.=
" and ag_timestamp <= to_date('$date_end','DD.MM.YYYY')";
1377 if (isset($ag_dest_query)&&$ag_dest_query!=-2)
1379 $action_query.=
" and ((ag_dest = ".sql_string($ag_dest_query).
" and ".self::sql_security_filter(
$cn,
"R").
") or ".
1380 "(ag_dest = ".sql_string($ag_dest_query).
" and ".self::sql_security_filter(
$cn,
"R").
" and ".
1381 " ag_owner='".$_SESSION[
'g_user'].
"'))";
1385 $action_query .=
" and (ag_owner='".$_SESSION[
'g_user'].
"' or ".self::sql_security_filter(
$cn,
"R").
" or ag_dest=-1 )";
1391 $action_query=
" and ag_id= ".sql_string(
$ag_id);
1393 if (isset($remind_date)&&$remind_date!=
""&&
isDate($remind_date)==$remind_date)
1395 $action_query .=
" and to_date('".sql_string($remind_date).
"','DD.MM.YYYY')<= ag_remind_date";
1397 if (isset($remind_date_end)&&$remind_date_end!=
""&&
isDate($remind_date_end)==$remind_date_end)
1399 $action_query .=
" and to_date('".sql_string($remind_date_end).
"','DD.MM.YYYY')>= ag_remind_date";
1401 if (!isset($closed_action))
1403 $action_query.=
" and s_status is null ";
1405 if (isset($searchtag))
1409 return $action_query.$str;
1420 select ag_id,to_char(ag_timestamp,'DD.MM.YY') as my_date,
1422 substr(ag_title,1,40) as sub_ag_title,dt_value,ag_ref, ag_priority,ag_state,
1423 coalesce((select p_name from profile where p_id=ag_dest),'Aucun groupe') as dest,
1424 (select ad_value from fiche_Detail where f_id=action_gestion.f_id_dest and ad_id=1) as name
1426 join document_type on (ag_type=dt_id)
1427 join document_state on (s_id=ag_state)
1434 require_once NOALYSS_TEMPLATE.
'/action_search_result.php';
1442 if (
trim($this->action)==
'')
1444 $array=explode(
",", $this->action);
1445 for ($i=0; $i<count(
$array); $i++)
1452 if ($this->
db->get_value(
"select count(*) from action_gestion_related
1453 where (aga_least=$1 and aga_greatest=$2) or (aga_greatest=$1 and aga_least=$2)", array(
$array[$i], $this->
ag_id))==0)
1455 $this->
db->exec_sql(
"insert into action_gestion_related(aga_least,aga_greatest) values ($1,$2)", array($this->
ag_id,
$array[$i]));
1469 $p_search=self::create_query($this->
db,
$p_array);
1472 to_char(ag_timestamp,'DD.MM.YYYY') as my_date,
1473 to_char(ag_remind_date,'DD.MM.YYYY') as my_remind,
1474 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,
1475 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,
1476 (select ad_value from fiche_Detail where f_id=ag.f_id_dest and ad_id=1) as name,
1483 coalesce((select p_name from profile where p_id=ag_dest),'Aucun groupe') as dest
1484 from action_gestion as ag
1485 join document_type on (ag.ag_type=dt_id)
1486 join document_state on(ag.ag_state=s_id)
1487 where true $p_search order by ag.ag_timestamp,ag.ag_id";
1492 $this->
db->query_to_csv(
$ret, array(
1493 array(
"title"=>
"doc id",
"type"=>
"string"),
1494 array(
"title"=>
"date",
"type"=>
"date"),
1495 array(
"title"=>
"rappel",
"type"=>
"date"),
1496 array(
"title"=>
"date dernier commentaire",
"type"=>
"date"),
1497 array(
"title"=>
"tags",
"type"=>
"string"),
1498 array(
"title"=>
"nom",
"type"=>
"string"),
1499 array(
"title"=>
"titre",
"type"=>
"string"),
1500 array(
"title"=>
"type document",
"type"=>
"string"),
1501 array(
"title"=>
"ref",
"type"=>
"string"),
1502 array(
"title"=>
"priorite",
"type"=>
"string"),
1503 array(
"title"=>
"etat",
"type"=>
"string"),
1504 array(
"title"=>
"profil",
"type"=>
"string")
1513 select ag_id,ag_ref,ago_id,
1516 join action_gestion_operation using(ag_id)
1518 jr_id=$1", array($p_jr_id));
1528 if ($this->
ag_id==0)
1530 $sql=
'select b.ag_id,b.t_id,b.at_id,a.t_tag'
1532 .
' tags as a join action_tags as b on (a.t_id=b.t_id)'
1534 .
' order by a.t_tag';
1546 if ($this->
ag_id==0)
1548 $count=$this->
db->get_value(
'select count(*) from action_tags'.
1549 ' where ag_id=$1 and t_id=$2', array($this->
ag_id, $p_t_id));
1552 $sql=
' insert into action_tags (ag_id,t_id) values ($1,$2)';
1553 $this->
db->exec_sql(
$sql, array($this->
ag_id, $p_t_id));
1562 if ($this->
ag_id==0)
1564 $sql=
' delete from action_tags where ag_id=$1 and t_id=$2';
1565 $this->
db->exec_sql(
$sql, array($this->
ag_id, $p_t_id));
1579 echo
'<span style="border:1px solid black;margin-right:5px;">';
1580 echo $a_tag[
$e][
't_tag'];
1581 if ($g_user->can_write_action($this->ag_id)==
true)
1583 $js_remove=sprintf(
"onclick=\"action_tag_remove('%s','%s','%s')\"",
dossier::id(), $this->
ag_id, $a_tag[
$e][
't_id']);
1584 echo
HtmlInput::anchor(
SMALLX,
"javascript:void(0)", $js_remove,
' class="smallbutton" style="padding:0px;display:inline" ');
1591 if ($g_user->can_write_action($this->ag_id)==
true)
1602 for ($i=0; $i<count($mag_id); $i++)
1604 if ($g_user->can_write_action($mag_id[$i])==
false)
1606 for (
$e=0;
$e<count($remtag);
$e++)
1609 $a->tag_remove($remtag[
$e]);
1619 for ($i=0; $i<count($mag_id); $i++)
1621 if ($g_user->can_write_action($mag_id[$i])==
false)
1623 for (
$e=0;
$e<count($addtag);
$e++)
1626 $a->tag_add($addtag[
$e]);
1635 for ($i=0; $i<count($mag_id); $i++)
1637 if ($g_user->can_write_action($mag_id[$i])==
false)
1648 for ($i=0; $i<count($mag_id); $i++)
1650 if ($g_user->can_read_action($mag_id[$i])==
false)
1654 echo
'<div class="content">';
1655 echo
$a->Display(
"READ",
false,
"");
1657 echo
'<P id="breakhere"> - - </p>';
1663 $this->
db->exec_sql(
'delete from action_tags where ag_id=$1', array($this->
ag_id));
1672 for ($i=0; $i<count($mag_id); $i++)
1674 if ($g_user->can_write_action($mag_id[$i])==
false)
1676 $cn->exec_sql(
'update action_gestion set ag_state=$1 where ag_id=$2', array($state, $mag_id[$i]));
1685 for ($i=0; $i<count($mag_id); $i++)
1687 if ($g_user->can_write_action($mag_id[$i])==
false)
1689 $cn->exec_sql(
'delete from action_gestion where ag_id=$1', array($mag_id[$i]));
1699 if ($this->dt_id==-1)
1701 throw new Exception(_(
'Type action invalide'), 10);
1703 if (
isDate($this->ag_timestamp)!=$this->ag_timestamp)
1704 throw new Exception(_(
'Date invalide'), 20);
1705 if (
isDate($this->ag_remind_date)!=$this->ag_remind_date)
1706 throw new Exception(_(
'Date invalide'), 30);
1707 if ($this->f_id_dest==0)
1708 $this->f_id_dest=null;
1719 if ($g_user->can_write_action($this->ag_id))
1724 $count=$this->
db->get_value(
'select count(*) from action_person where f_id=$1 and ag_id=$2', array($p_fiche_id, $this->
ag_id));
1727 $this->
db->exec_sql(
'insert into action_person (ag_id,f_id) values ($1,$2)', array($this->
ag_id, $p_fiche_id));
1740 if ($g_user->can_write_action($this->ag_id))
1742 $this->
db->exec_sql(
'delete from action_person where ag_id = $1 and f_id = $2', array($this->
ag_id, $p_fiche_id));
1752 $a_linked=$this->
db->get_array(
'select ap_id,f_id from action_person where ag_id=$1', array($this->
ag_id));
1753 if (count($a_linked)==0)
1755 for ($i=0; $i<count($a_linked); $i++)
1758 $qc=
$fiche->get_quick_code();
1759 $js_remove=sprintf(
"onclick=\"action_remove_concerned('%s','%s','%s')\"",
dossier::id(), $a_linked[$i][
'f_id'], $this->
ag_id);
1760 echo
'<span style="border:1px solid black;margin-right:5px;">';
1762 echo
HtmlInput::anchor(
SMALLX,
"javascript:void(0)", $js_remove,
' class="smallbutton" style="padding:0px;display:inline" ');
1775 include NOALYSS_TEMPLATE.
'/action_display_short.php';
1785 if ($g_user->can_add_action($this->ag_dest) == FALSE )
1787 throw new Exception(_(
'SECURITE : Ajout impossible'));
1793 $seq_name=
"seq_doc_type_".$this->dt_id;
1798 $this->
ag_id=$this->
db->get_next_seq(
'action_gestion_ag_id_seq');
1801 $ag_ref=$this->
db->get_value(
'select dt_prefix from document_type '
1802 .
'where dt_id=$1', array($this->dt_id))
1803 .
'-'.$this->
db->get_next_seq($seq_name);
1811 $sql=
"insert into action_gestion".
1812 "(ag_id,ag_timestamp,ag_type,ag_title,f_id_dest,ag_ref, "
1814 " ag_priority,ag_owner,ag_state,ag_remind_date,ag_hour) ".
1816 .
"($1,to_date($2,'DD.MM.YYYY'),$3,$4,$5,$6,"
1818 .
"$8,$9,$10,to_date($11,'DD.MM.YYYY'),$12)";
1820 $this->
db->exec_sql(
$sql, array(
1822 $this->ag_timestamp,
1829 $_SESSION[
'g_user'],
1831 $this->ag_remind_date,
1836 if (
trim($this->ag_comment)!=
'')
1838 $this->
db->exec_sql(
"insert into action_gestion_comment (ag_id,tech_user,agc_comment) values ($1,$2,$3)"
1839 , array($this->
ag_id, $_SESSION[
'g_user'], $this->ag_comment));
1848 with recursive t (aga_least,aga_greatest,depth) as (
1849 select aga_least,aga_greatest , 1
1851 action_gestion_related
1852 where aga_greatest=$1
1854 select p2.aga_least,p2.aga_greatest,depth + 1
1856 t as p1, action_gestion_related as p2
1858 p2.aga_greatest is not null and
1859 p2.aga_greatest = p1.aga_least
1860 ) select * from t order by depth desc limit 1
1861 ' , array($this->
ag_id)
1864 return $value[0][
'aga_least'];
1881 $sql =
"with recursive t (key_path, aga_least,aga_greatest,depth) as (
1883 aga_least::text||'-'||aga_greatest::text as key_path ,
1884 aga_least,aga_greatest , 1
1886 action_gestion_related
1889 select key_path||'-'||p2.aga_greatest::text,
1890 p2.aga_least,p2.aga_greatest,depth + 1
1892 t as p1, action_gestion_related as p2
1894 p1.aga_greatest is not null and
1895 p1.aga_greatest = p2.aga_least
1897 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
1899 action_gestion join t on (ag_id=aga_greatest)
1900 join document_type on (ag_type=dt_id)
1904 $ret_array=$this->
db->get_array(
$sql,array(
$p_id));
1906 if ( empty($ret_array))
return array();
1928 echo _(
'Principal');
1935 echo
'<span class="highlight">';
1936 $xaction=sprintf(
'view_action(%d,%d,%d)', $fu_parent->ag_id,
1938 $showAction=
'<a class="line" href="javascript:'.$xaction.
'">';
1940 $fu_parent->ag_timestamp,
" ",
1941 h($fu_parent->ag_title),
1942 '('.h($fu_parent->ag_ref).
')',
1947 echo
'<ul style="padding-left:10px;list-style-type: none;">';
1949 for ($o=0; $o<count(
$action); $o++)
1954 $count_parent =$this->
db->get_value(
'select count(*) from action_gestion_related where aga_greatest = $1',array(
$action[$o][
'aga_greatest']));
1955 $direct_parent=($count_parent > 1 ) ? _(
'direct parent ').$count_parent:
"";
1957 $margin=(
$action[$o][
'depth']>1 )?str_repeat(
" ",
$action[$o][
'depth']-1).
"⇨":
"";
1958 if ($p_view!=
'READ'&&$p_base!=
'ajax')
1960 $rmAction=sprintf(
"return confirm_box(null,'"._(
'Voulez-vous effacer cette action ').
"', function () {remove_action('%s','%s','%s');});",
1963 $showAction=
'<a class="line" href="'.$base.
"&ag_id=".
$action[$o][
'aga_greatest'].
'">';
1964 $js=
'<a class="tinybutton" id="acact'.$action[$o][
'aga_greatest'].
'" href="javascript:void(0)" onclick="'.$rmAction.
'">'.
SMALLX.
'</a>';
1965 echo
'<li '.$class.
' id="act'.
$action[$o][
'aga_greatest'].
'">'.$margin.$showAction.$action[$o][
'str_date'].
1966 h(
$action[$o][
'title']).
'('.
h(
$action[$o][
'action_ref']).
')'.$direct_parent.
'</a>'.
" "
1973 if ($p_base==
'ajax')
1975 $xaction=sprintf(
'view_action(%d,%d,%d)',
$action[$o][
'aga_greatest'],
1977 $showAction=
'<a class="line" href="javascript:'.$xaction.
'">';
1978 echo
'<li '.$class.
' >'.$margin.$showAction.$action[$o][
'str_date'].
" ".
1979 h(
$action[$o][
'title']).
'('.
h(
$action[$o][
'action_ref']).
')'.$direct_parent.
'</a>'.
" "
1987 $showAction=
'<a class="line" href="'.$base.
"&ag_id=".
$action[$o][
'aga_greatest'].
'">';
1988 echo
'<li '.$class.
' >'.$margin.$showAction.$action[$o][
'str_date'].
" ".
1989 h(
$action[$o][
'sub_title']).
'('.
h(
$action[$o][
'action_ref']).
')'.$direct_parent.
'</a>'.
" "
2004 $a_parent=$this->
db->get_array(
2006 select ag_id,ag_title as title ,to_char(ag_timestamp,'DD/MM/YY') as str_date,ag_ref||' '||dt_value as action_ref
2009 join document_type on (ag_type=dt_id)
2010 where ag_id in (select aga_least from action_gestion_related where aga_greatest = $1)
2012 ", array($this->
ag_id)
2014 if ( empty($a_parent ) )
return;
2015 echo
'<ul style="padding-left:10px;list-style-type: none;">';
2018 for ($o=0; $o<count($a_parent); $o++)
2020 $class=($this->
ag_id == $a_parent[$o][
'ag_id'])?
' class="highlight" ':
'';
2022 if ($p_view!=
'READ'&&$p_base!=
'ajax')
2024 $rmAction=sprintf(
"return confirm_box(null,'"._(
'Voulez-vous effacer cette action ').
"', function () {remove_action('%s','%s','%s');});",
2027 $showAction=
'<a class="line" href="'.$base.
"&ag_id=".$a_parent[$o][
'ag_id'].
'">';
2028 $js=
'<a class="tinybutton" id="acact'.$a_parent[$o][
'ag_id'].
'" href="javascript:void(0)" onclick="'.$rmAction.
'">'.
SMALLX.
'</a>';
2029 echo
'<li '.$class.
' id="act'.$a_parent[$o][
'ag_id'].
'">'.$showAction.$a_parent[$o][
'str_date'].
2030 h($a_parent[$o][
'title']).
'('.
h($a_parent[$o][
'action_ref']).
')'.
'</a>'.
" "
2037 if ($p_base==
'ajax')
2039 $xaction=sprintf(
'view_action(%d,%d,%d)', $a_parent[$o][
'ag_id'],
2041 $showAction=
'<a class="line" href="javascript:'.$xaction.
'">';
2042 echo
'<li '.$class.
' >'.$showAction.$a_parent[$o][
'str_date'].
" ".
2043 h($a_parent[$o][
'title']).
'('.
h($a_parent[$o][
'action_ref']).
')'.
'</a>'.
" "
2051 $showAction=
'<a class="line" href="'.$base.
"&ag_id=".$a_parent[$o][
'ag_id'].
'">';
2052 echo
'<li '.$class.
' >'.$showAction.$a_parent[$o][
'str_date'].
" ".
2053 h($a_parent[$o][
'sub_title']).
'('.
h($a_parent[$o][
'action_ref']).
')'.
'</a>'.
" "
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...
get_last($p_limit)
return the last p_limit operation into an array, there is a security on user
static fetch_all($ret)
wrapper for the function pg_fetch_all
if($g_user->check_dossier(dossier::id(), true)=='X') $op
static get_all_operation($p_jr_id)
tag_add($p_t_id)
show the tags of the current objet normally used by ajax.
static action_remove($cn, $p_array)
sql_string($p_string)
Fix the problem with the quote char for the database.
td($p_string='', $p_extra='')
surround the string with td
static num_row($ret)
wrapper for the function pg_NumRows
Class Document corresponds to the table document.
get_today()
get the action where the remind day is today
static short_list($cn, $p_sql)
Show the result of a search in an inner windows, the result is limited to 25.
for($i=0;$i< count($aHeading);$i++) $sort
h2($p_string, $p_class="", $raw="")
$aAttachedFile[$i]['d_filename']
th($p_string, $p_extra='', $raw='')
$operation
$operation string related operation
tag_remove($p_t_id)
remove the tags of the current objet normally used by ajax
Display($p_view, $p_gen, $p_base, $retour="")
Display the object, the tags for the FORM are in the caller.
insert_action()
Insert a related action into the table action_gestion_related.
static sql_security_filter($cn, $p_mode)
Create a filter based on the current user,.
display_children($p_view, $p_base)
Display the tree of childrens of the current Action + related parents.
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
insert_linked_card($p_fiche_id)
Add another concerned (tiers, supplier...)
static filter_by_tag($cn, $p_array=null)
Create a subquery to filter thanks the selected tag.
foreach($array as $idx=> $m) $w
get_late()
get the action where the remind day is today
static escape_string($p_string)
wrapper for the function pg_escape_string
Follow_Up Details are the details for an actions, it means the details of an order, delivery order, submit a quote... this class is linked to the table action_detail.
get_parent()
Return the first parent of the event tree, or -1 if not found.
static display_search($cn, $inner=false)
Display only a search box for searching an action.
save_short()
Add an event , with the minimum of informations, used in Dashboard and Scheduler. ...
class_action for manipulating actions action can be :
navigation_bar($p_offset, $p_line, $p_size=0, $p_page=1, $p_javascript="")
Create a navigation_bar (pagesize)
static create_query($cn, $p_array=null)
Get date from $_GET and create the sql stmt for the query.
define Class fiche and fiche def, those class are using class attribut. When adding or modifing new c...
static action_set_state($cn, $p_array)
global $g_user
Find the default module or the first one.
fromArray($p_array)
put an array in the variable member, the indice is the member name
tag_cell()
show the cell content in Display for the tags called also by ajax
get_children($p_id)
Compute an array of the complete tree depending of $p_id.
generate_document($md_id, $p_array)
generate the document and add it to the action
function trim(s)
remove trailing and heading space
static action_tag_add($cn, $p_array)
if(!isset($_REQUEST['p_jrn'])) else $Ledger id
static id()
return the $_REQUEST['gDossier'] after a check
h($p_string)
to protect again bad characters which can lead to a cross scripting attack the string to be diplayed ...
tag_get()
get the tags of the current objet
display_parent($p_view, $p_base)
Display the list of parent of the current Follow_Up.
insert_operation()
insert a related operation
Description of class_syn_sort_table.
static show_action_list($cn, $p_base)
show a list of documents
remove_linked_card($p_fiche_id)
Remove another concerned (tiers, supplier...)
verify()
Verify that data are correct.
myList($p_base, $p_filter="", $p_search="")
myList($p_base, $p_filter = "", $p_search = "") Show list of action by default if sorted on date ...
Input HTML for the card show buttons, in the file, you have to add card.js How to use : ...
display_linked()
Display the other concerned (tiers, supplier...)
display_short()
display a small form to enter a new event
__construct($p_cn, $p_id=0)
constructor
$action
$action string related action
save()
Save the document and propose to save the generated document or to upload one, the data are included ...
static action_tag_remove($cn, $p_array)
export_csv($p_array)
export to CSV the query the p_array has
remove_operation_deprecated()
remove a related operation
static action_print($cn, $p_array)
static action_tag_clear($cn, $p_array)
Html Input : Input a date format dd.mm.yyyy The property title should be set to indicate what it is e...
This class handles only the numeric input, the input will call a javascript to change comma to period...