53#[AllowDynamicProperties]
87 $this->
value=$p_value;
94 $this->attribute=array();
112 $this->attribute[]=array($p_name, $p_value);
113 $this->$p_name=$p_value;
122 $this->
value=$p_string;
142 require_once NOALYSS_INCLUDE.
'/lib/function_javascript.php';
144 if (count($this->attribute)==0)
148 for (
$i=0;
$i<count($this->attribute);
$i++)
151 $tmp1=sprintf(
"$('%s').%s='%s';", $this->
id, $name,
$value);
180 $name=($p_name!=
null)?$p_name.
'=':
'';
181 if (count($this->attribute)==0)
186 for (
$i=0;
$i<count($this->attribute);
$i++)
203 $r=
"Type ".$this->type.
"<br>";
204 $r.=
"name ".$this->name.
"<br>";
205 $r.=
"value".$this->value.
"<br>";
207 $r.=
"read only".$readonly.
"<br>";
211 static function submit($p_name, $p_value, $p_javascript=
"",
212 $p_class=
"smallbutton")
215 return '<INPUT TYPE="SUBMIT" class="'.$p_class.
'" NAME="'.$p_name.
'" ID="'.$p_name.
'_submit_id" VALUE="'.$p_value.
'" '.$p_javascript.
'>';
218 static function button($p_name, $p_value, $p_javascript=
"",
219 $p_class=
"smallbutton")
222 return '<INPUT TYPE="button" class="'.$p_class.
'" NAME="'.$p_name.
'" ID="'.$p_name.
'" VALUE="'.$p_value.
'" '.$p_javascript.
'>';
227 return '<INPUT TYPE="RESET" class="smallbutton" VALUE="'.$p_value.
'">';
234 if ( DEBUGNOALYSS > 2) {
235 return '<span style="font-size:80%;color:blue;background-color:lightgoldenrodyellow">'.
237 '= <INPUT TYPE="text" id="'.strip_tags(
$p_id).
'" NAME="'.$p_name.
'" VALUE="'.strip_tags($p_value??
"").
'" style="color:blue;font-size:80%">'.
240 return '<INPUT TYPE="hidden" id="'.strip_tags(
$p_id).
'" NAME="'.$p_name.
'" VALUE="'.strip_tags($p_value??
"").
'">';
257 $p_javascript=
"", $p_class=
"smallbutton")
261 $href=sprintf(
' href ="%s" ', $p_value);
262 $r=sprintf(
'<span id="%s" > <A class="'.$p_class.
'" style="display:inline-block;" %s %s >%s</A></span>',
263 $p_name,
$href, $p_javascript, $p_label);
274 throw new Exception(
"DEPRECATED");
280 if ( $p_comment ==
"")
return "";
281 $r=sprintf(
'<A HREF="#" tabindex="-1" style="display:inline;color:red;background-color:transparent;padding-left:4px;padding-right:4px;text-decoration:none;" onmouseover="displayBulle(\'%s\')" onclick="displayBulle(\'%s\')" onmouseout="hideBulle(0)"> %s </A>',
291 return sprintf(
'<A class="detail" style="text-decoration:underline;display:inline" HREF="javascript:modifyOperation(%d,%d)">%s</A>',
304 return sprintf(
'<A class="detail" style="text-decoration:underline;display:inline" HREF="javascript:view_action(%d,%d,%d)">%s</A>',
313 return sprintf(
'<A class="detail" style="text-decoration:underline" HREF="javascript:modifyModeleDocument(%d,%d)">%s</A>',
322 return sprintf(
'<A class="detail" style="text-decoration:underline" HREF="javascript:removeStock(%d,%d)">%s</A>',
335 $view_history=sprintf(
'<A class="detail" style="text-decoration:underline;%s" HREF="javascript:view_history_card(\'%s\',\'%s\',\'%s\')" >%s</A>',
337 return $view_history;
354 $js=sprintf(
'onclick="view_history_card(\'%s\',\'%s\',\'%s\')"',
$f_id,
357 return $view_history;
368 $js=sprintf(
'onclick="view_followup_card(\'%s\',\'%s\')"',
$f_id,
371 return $view_followup;
389 $view_history=sprintf(
'<A class="detail" style="text-decoration:underline;%s" HREF="javascript:view_history_account(\'%s\',\'%s\',\'%s\')" >%s</A>',
391 return $view_history;
406 $view_history=sprintf(
'<A class="detail" style="text-decoration:underline;%s" HREF="javascript:view_history_anc_account(\'%s\',\'%s\',\'%s\')" >%s</A>',
408 return $view_history;
420 $ledger->javascript=
" show_cat_choice()";
424 echo
'<div id="div_cat">';
425 echo
'<h2 class="info">'._(
'Choix des categories').
'</h2>';
438 echo
'<li style="list-style-type: none;">'.$re->input().$row[
'name'].
'('.
$row[
'cat'].
')</li>';
442 $hide->label=_(
"Valider");
443 $hide->javascript=
" hide_cat_choice() ";
447 $r=ob_get_contents();
454 $r=sprintf(
'<a href="javascript:void(0)" onclick="display_periode(%d,%d)">Modifier</a>',
467 $a->label=_(
"Fermer");
469 $a->javascript=
"removeDiv('".$div_name.
"')";
483 $a->label=_(
"Fermer");
484 $a->javascript=
"$('".$div_name.
"').hide()";
498 throw new Exception(
"DEPRECATED");
510 $p_class=
"button", $p_symbole=
"")
517 $r.=
'<a id="'.$id.
'" href="javascript:void(0)" class="'.$p_class.
'" onclick="'.
$javascript.
'">'.$p_symbole.h(
$action).
'</a>';
530 $p_class=
"button", $p_symbole=
"")
537 $r.=
'<input type="button" id="'.$id.
'" class="'.$p_class.
'" onclick="'.
$javascript.
'" value="'.$p_symbole.h(
$action).
'">';
547 static function image_click($p_image, $p_js, $p_message, $p_class=
"")
549 $ret=sprintf(
'<a class="nav %s" style="display:inline" title="%s"><img src="image/%s" onclick="%s"></a>',
550 $p_class, $p_message, $p_image, $p_js);
562 $p_class=
'class="button"', $p_image=
"")
569 $r.=
'<image id="'.$id.
'" '.$p_class.
' onclick="'.
$javascript.
'" src="'.$p_image.
'" />';
584 throw new Exception(
"DEPRECATED");
601 $p_nohistory=
false,$nofollowup=
false)
603 if ($pname !==
'') {$pname=
'<span class="v-large">('.$pname.
')</span>';}
605 $histo=($p_nohistory==
true)?
' ,nohistory:1':
"";
606 $followup=($nofollowup==
true)?
' ,nofollowup:1':
"";
607 $r.=sprintf(
'<a href="javascript:void(0)" %s class="detail" onclick="fill_ipopcard({qcode:\'%s\' %s %s})">%s %s</a>',
608 $p_style, $p_qcode,
$histo,$followup,$p_qcode,$pname);
623 if (count($global_array)==0)
627 if (isset($global_array [
$a]))
628 if (is_array($global_array[
$a])==
false)
634 if (count($global_array[
$a])>0)
636 foreach ($global_array[
$a] as
$value)
653 if (empty (
$array))
return "";
666 $aJson=json_decode($p_json);
667 foreach ($aJson as $key=>
$value)
720 if (count($global_array)==0)
725 if (isset($global_array [
$a]))
727 if (is_array($global_array[
$a])==
false)
729 $r.=$and.
"$a=".$global_array [
$a];
733 for (
$i=0;
$i<count($global_array[
$a]);
$i++)
735 $r.=$and.
"$a".
"[]=".$global_array[
$a][
$i];
790 $r=sprintf(
'%s_%d', $p_prefix, mt_rand(0, 999999));
874 static function title_box($p_name, $p_div, $p_mod=
"close", $p_js=
"",
875 $p_draggable=
"n",$p_enlarge=
'n')
877 $p_div=strip_tags($p_div);
878 $r=
'<div class="bxbutton">';
881 if ($p_draggable==
"y")
885 if ( $p_enlarge==
'y') {
902 $r.=
'<span id="span_'.$p_div.
'" style="float:right;margin-right:5px">'.$p_js.
"</span>";
910 throw new Exception(__FILE__.
":".__LINE__._(
"Paramètre invalide p_mod = '$p_mod'"));
915 $r.=
h2($p_name,
' class="title" ');
934 $p_url=
"javascript:void(0)";
935 $str=sprintf(
'<a id="%s" href="javascript:void(0)" class="line" title="%s">%s</a>',
936 $p_id, $p_title, $p_text);
954 $p_style=
' class="line" ', $p_title=
"click", array $p_attribute=[])
958 $p_url=
'href="javascript:void(0)"';
963 $str=sprintf(
'<a %s %s %s %s title="%s">%s</a>', $str_javascript_attr,$p_style,
$p_url, $p_js, $p_title,$p_text);
981 if (!in_array($p_mode, array(
'R',
'W')))
983 throw new Exception(__FILE__.
":".__LINE__.
" $p_mode invalide");
990 $sel->value=$p_cn->make_array(
"
992 from stock_repository join profile_sec_repository using (r_id)
1000 $sel->value=$p_cn->make_array(
"
1002 from stock_repository join profile_sec_repository using (r_id)
1024 <span class=\"icon\" ></span>
1025 <input id=\"lk_".$p_table_id.
"\" name=\"$p_name\" value=\"$p_old_value\"autocomplete=\"off\" class=\"input_text\" name=\"filter\" onkeyup=\"filter_table(this, '$p_table_id','$p_col',$start_row )\" type=\"text\" placeholder=\""._(
"Recherche").
"\">
1026 <input type=\"button\" class=\"smallbutton\" onclick=\"$('lk_".$p_table_id.
"').value='';filter_table($('lk_".$p_table_id.
"'), '$p_table_id','$p_col',$start_row );\" value=\"X\">
1029 $r.=
' <span class="notice" id="info_'.$p_table_id.
'"></span>';
1043 <span class=\"icon\" ></span>
1045 <input id=\"lk_".$p_table_id.
"\" autocomplete=\"off\" class=\"input_text\" name=\"filter\" onkeyup=\"filter_table(this, '$p_table_id','$p_col',$start_row )\" type=\"text\" placeholder=\""._(
"Recherche").
"\">
1046 <input type=\"button\" class=\"smallbutton\" onclick=\"$('lk_".$p_table_id.
"').value='';filter_table($('lk_".$p_table_id.
"'), '$p_table_id','$p_col',$start_row );\" value=\"X\">
1049 $r.=
' <span class="notice" id="info_'.$p_table_id.
'"></span>';
1070 $r.=
'<span class=" icon"></span>';
1071 $r.=sprintf(
'<input id="search_%s" type="TEXT" class="input_text" name="filter_list%s" placeholder="%s" onkeyup="filter_list(this,\'%s\')">',
1072 $p_list_id,$p_list_id,_(
"Recherche"),$p_list_id);
1074 $r.=sprintf(
'<input type="button" class="smallbutton" onclick="$(\'search_%s\').value=\'\';filter_list(\'search_%s\',\'%s\')" value="x">',$p_list_id,$p_list_id,$p_list_id);
1081 $r=
'<A style="color:red;text-decoration:underline" href="javascript:void(0)" onclick="show_reconcile(\''.$p_div.
'\',\
''.$let.
'\')
">'.$let.$span.'</A>';
1090 static function calendar_zoom($obj)
1092 $button=new ISmallButton("calendar
", _("Calendrier
"));
1094 return $button->input();
1105 static function button_choice_ledger($p_array)
1107 extract($p_array, EXTR_SKIP);
1108 $bledger_param=json_encode(array(
1109 'dossier'=>$_REQUEST['gDossier'],
1111 'all_type'=>$all_type,
1113 'class'=>'inner_box'
1116 $bledger_param=noalyss_str_replace('"
', "'", $bledger_param);
1117 $bledger=new ISmallButton('l');
1118 $bledger->label=_("choix des journaux
");
1119 $bledger->javascript=" show_ledger_choice($bledger_param)
";
1120 $f_ledger=$bledger->input();
1122 if (isset($_REQUEST[$div.'nb_jrn']))
1124 for ($i=0; $i<$_REQUEST[$div.'nb_jrn']; $i++)
1126 if (isset($_REQUEST[$div."r_jrn
"][$i]))
1127 $hid_jrn.=HtmlInput::hidden($div.'r_jrn['.$i.']',
1128 $_REQUEST[$div."r_jrn
"][$i]);
1130 $hid_jrn.=HtmlInput::hidden($div.'nb_jrn',
1131 $_REQUEST[$div.'nb_jrn']);
1134 $hid_jrn=HtmlInput::hidden($div.'nb_jrn', 0);
1137 echo '<span id="ledger_id
'.$div.'">';
1149 static function show_receipt_document($p_jr_id, $p_name="
")
1154 // Check the jr_id has a receipt document
1155 $array=$cn->get_array('select jr_def_id,jr_pj_name,jr_grpt_id from jrn where jr_id=$1',
1157 if (count($array)==0)
1159 if ($array[0]['jr_pj_name']=="")
1161 $str_dossier=Dossier::get();
1163 // Name is empty then use an image
1166 $image='<IMG style="width:24px;height:24px;border:0px
" SRC="image/documents.png
" title="'.h($array[0]['jr_pj_name
']).'" >';
1170 $href=http_build_query(array('gDossier'=>Dossier::id(), 'jr_id'=>$p_jr_id,
1171 'act'=>'RAW:receipt'));
1173 $r=sprintf('<A class="mtitle line
" HREF="export.php?%s
">%s</A>', $href,
1182 static function button_action_remove_operation($p_operation)
1184 $rmOperation=sprintf("confirm_box(
null,
'"._('Voulez-vous effacer cette relation
')."',
function () {remove_operation(
'%s',
'%s');});
",
1185 dossier::id(), $p_operation);
1186 $js=Icon_Action::trash("acop
".$p_operation, $rmOperation);
1192 static function button_action_add()
1194 $dossier=Dossier::id();
1195 $js=HtmlInput::button_action(_('Nouvel événement'),
1196 'action_add('.$dossier.')', 'xx', 'smallbutton');
1207 function get_node_attribute()
1210 $nb_attribute=count($this->attribute);
1211 for ($i=0; $i<$nb_attribute; $i++)
1213 $r.=sprintf(' %s="%s
" ', $this->attribute[$i][0],
1214 $this->attribute[$i][1]);
h2($p_string, $p_class="", $raw="")
sql_string($p_string)
Fix the problem with the quote char for the database.
global $g_user
if no group available , then stop
if(headers_sent() &&DEBUGNOALYSS > 0) $html
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r
for( $i=0; $i< $nb_row; $i++)
if(!headers_sent())
– pour utiliser unoconv démarrer un server libreoffice commande libreoffice –headless –accept="socket...
for($i=0;$i<=6;$i++) $ind
Html Input , create a tag <SELECT> ... </SELECT> if readonly == true then display the label correspon...
static close($p_div)
Return a html string with an anchor which close the inside popup.
static draggable($p_div)
Display a icon for fix or move a div.
static zoom($p_div, $p_javascript)
Display a icon for zooming.
static hide($action, $javascript)
Return a html string with an anchor to hide a div, put it in the right corner.
build_javascript_attribute($pa_attribute)
build a string with the attribute that javascript can use , that string must be included in a DOM ele...
create_script($p_string)
create the HTML for adding the script tags around of the script
if( $delta< 0) elseif( $delta==0)