53#[AllowDynamicProperties]
88 $this->
value=$p_value;
95 $this->attribute=array();
109 return $this->placeholder;
130 $this->attribute[]=array($p_name, $p_value);
131 $this->$p_name=$p_value;
140 $this->
value=$p_string;
160 require_once NOALYSS_INCLUDE.
'/lib/function_javascript.php';
162 if (count($this->attribute)==0)
166 for (
$i=0;
$i<count($this->attribute);
$i++)
169 $tmp1=sprintf(
"$('%s').%s='%s';", $this->
id, $name,
$value);
198 $name=($p_name!=
null)?$p_name.
'=':
'';
199 if (count($this->attribute)==0)
204 for (
$i=0;
$i<count($this->attribute);
$i++)
221 $r=
"Type ".$this->type.
"<br>";
222 $r.=
"name ".$this->name.
"<br>";
223 $r.=
"value".$this->value.
"<br>";
225 $r.=
"read only".$readonly.
"<br>";
229 static function submit($p_name, $p_value, $p_javascript=
"",
230 $p_class=
"smallbutton")
233 return '<INPUT TYPE="SUBMIT" class="'.$p_class.
'" NAME="'.$p_name.
'" ID="'.$p_name.
'_submit_id" VALUE="'.$p_value.
'" '.$p_javascript.
'>';
236 static function button($p_name, $p_value, $p_javascript=
"",
237 $p_class=
"smallbutton")
240 return '<INPUT TYPE="button" class="'.$p_class.
'" NAME="'.$p_name.
'" ID="'.$p_name.
'" VALUE="'.$p_value.
'" '.$p_javascript.
'>';
243 static function reset($p_value,$p_class=
"smallbutton")
245 return '<INPUT TYPE="RESET" class="'.$p_class.
'" VALUE="'.$p_value.
'">';
252 if ( DEBUGNOALYSS > 2) {
253 return '<span style="font-size:80%;color:blue;background-color:lightgoldenrodyellow">'.
255 '= <INPUT TYPE="text" id="'.strip_tags(
$p_id).
'" NAME="'.$p_name.
'" VALUE="'.strip_tags($p_value??
"").
'" style="color:blue;font-size:80%">'.
258 return '<INPUT TYPE="hidden" id="'.strip_tags(
$p_id).
'" NAME="'.$p_name.
'" VALUE="'.strip_tags($p_value??
"").
'">';
263 return self::hidden(
'plugin_code',
$_REQUEST[
'plugin_code']);
275 $p_javascript=
"", $p_class=
"smallbutton")
279 $href=sprintf(
' href ="%s" ', $p_value);
280 $r=sprintf(
'<span id="%s" > <A class="'.$p_class.
'" id="btn%s" style="display:inline-block;" %s %s >%s</A></span>',
281 $p_name, $p_name,
$href, $p_javascript, $p_label);
292 throw new Exception(
"DEPRECATED");
298 if ( $p_comment ==
"")
return "";
299 $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>',
309 return sprintf(
'<A class="detail" style="text-decoration:underline;display:inline" HREF="javascript:modifyOperation(%d,%d)">%s</A>',
310 $p_jr_id, dossier::id(), $p_mesg);
322 return sprintf(
'<A class="detail" style="text-decoration:underline;display:inline" HREF="javascript:view_action(%d,%d,%d)">%s</A>',
323 $ag_id, dossier::id(), $p_modify, $p_mesg);
332 return sprintf(
'<A class="detail" style="text-decoration:underline" HREF="javascript:modifyModeleDocument(%d,%d)">%s</A>',
333 $p_id, dossier::id(), $p_mesg);
341 return sprintf(
'<A class="detail" style="text-decoration:underline" HREF="javascript:removeStock(%d,%d)">%s</A>',
342 $p_id, dossier::id(), $p_mesg);
354 $view_history=sprintf(
'<A class="detail" style="text-decoration:underline;%s" HREF="javascript:view_history_card(\'%s\',\'%s\',\'%s\')" >%s</A>',
356 return $view_history;
373 $js=sprintf(
'onclick="view_history_card(\'%s\',\'%s\',\'%s\')"',
$f_id,
376 return $view_history;
387 $js=sprintf(
'onclick="view_followup_card(\'%s\',\'%s\')"',
$f_id,
390 return $view_followup;
408 $view_history=sprintf(
'<A class="detail" style="text-decoration:underline;%s" HREF="javascript:view_history_account(\'%s\',\'%s\',\'%s\')" >%s</A>',
409 $p_style, $p_account, dossier::id(),
$p_exercice, $p_mesg);
410 return $view_history;
425 $view_history=sprintf(
'<A class="detail" style="text-decoration:underline;%s" HREF="javascript:view_history_anc_account(\'%s\',\'%s\',\'%s\')" >%s</A>',
426 $p_style, $p_account, dossier::id(),
$p_exercice, $p_mesg);
427 return $view_history;
439 $ledger->javascript=
" show_cat_choice()";
443 echo
'<div id="div_cat">';
444 echo
'<h2 class="info">'._(
'Choix des categories').
'</h2>';
457 echo
'<li style="list-style-type: none;">'.$re->input().$row[
'name'].
'('.
$row[
'cat'].
')</li>';
461 $hide->label=
_(
"Valider");
462 $hide->javascript=
" hide_cat_choice() ";
466 $r=ob_get_contents();
473 $r=sprintf(
'<a href="javascript:void(0)" onclick="display_periode(%d,%d)">Modifier</a>',
474 dossier::id(),
$p_id);
486 $a->label=
_(
"Fermer");
488 $a->javascript=
"removeDiv('".$div_name.
"')";
502 $a->label=
_(
"Fermer");
504 $a->javascript=
"$('".$div_name.
"').hide()";
518 throw new Exception(
"DEPRECATED");
530 $p_class=
"button", $p_symbole=
"")
537 $r.=
'<a id="'.$id.
'" href="javascript:void(0)" class="'.$p_class.
'" onclick="'.
$javascript.
'">'.$p_symbole.h(
$action).
'</a>';
550 $p_class=
"button", $p_symbole=
"")
557 $r.=
'<input type="button" id="'.$id.
'" class="'.$p_class.
'" onclick="'.
$javascript.
'" value="'.$p_symbole.h(
$action).
'">';
567 static function image_click($p_image, $p_js, $p_message, $p_class=
"")
569 $ret=sprintf(
'<a class="nav %s" style="display:inline" title="%s"><img src="image/%s" onclick="%s"></a>',
570 $p_class, $p_message, $p_image, $p_js);
582 $p_class=
'class="button"', $p_image=
"")
589 $r.=
'<image id="'.$id.
'" '.$p_class.
' onclick="'.
$javascript.
'" src="'.$p_image.
'" />';
604 throw new Exception(
"DEPRECATED");
621 $p_nohistory=
false,$nofollowup=
false)
623 if ($pname !==
'') {$pname=
'<span class="v-large">('.$pname.
')</span>';}
625 $histo=($p_nohistory==
true)?
' ,nohistory:1':
"";
626 $followup=($nofollowup==
true)?
' ,nofollowup:1':
"";
627 $r.=sprintf(
'<a href="javascript:void(0)" %s class="detail" onclick="fill_ipopcard({qcode:\'%s\' %s %s})">%s %s</a>',
628 $p_style, $p_qcode,
$histo,$followup,$p_qcode,$pname);
643 if (count($global_array)==0)
647 if (isset($global_array [
$a]))
648 if (is_array($global_array[
$a])==
false)
654 if (count($global_array[
$a])>0)
656 foreach ($global_array[
$a] as
$value)
673 if (empty (
$array))
return "";
686 $aJson=json_decode($p_json);
687 foreach ($aJson as $key=>
$value)
740 if (count($global_array)==0)
745 if (isset($global_array [
$a]))
747 if (is_array($global_array[
$a])==
false)
749 $r.=$and.
"$a=".$global_array [
$a];
753 for (
$i=0;
$i<count($global_array[
$a]);
$i++)
755 $r.=$and.
"$a".
"[]=".$global_array[
$a][
$i];
810 $r=sprintf(
'%s_%d', $p_prefix, mt_rand(0, 999999));
894 static function title_box($p_name, $p_div, $p_mod=
"close", $p_js=
"",
895 $p_draggable=
"n",$p_enlarge=
'n',$raw=
"",
$refresh=
'')
897 $p_div=strip_tags($p_div);
898 $r=
'<div class="bxbutton">';
901 if ($p_draggable==
"y")
905 if ( $p_enlarge==
'y') {
925 $r.=
'<span id="span_'.$p_div.
'" style="float:right;margin-right:5px">'.$p_js.
"</span>";
933 throw new Exception(__FILE__.
":".__LINE__._(
"Paramètre invalide p_mod = '$p_mod'"));
938 $r.=
h2($p_name,
' class="title" ',$raw);
957 $p_url=
"javascript:void(0)";
958 $str=sprintf(
'<a id="%s" href="javascript:void(0)" class="line" title="%s">%s</a>',
959 $p_id, $p_title, $p_text);
977 $p_style=
' class="line" ', $p_title=
"click", array $p_attribute=[])
981 $p_url=
'href="javascript:void(0)"';
986 $str=sprintf(
'<a %s %s %s %s title="%s">%s</a>', $str_javascript_attr,$p_style,
$p_url, $p_js, $p_title,$p_text);
1004 if (!in_array($p_mode, array(
'R',
'W')))
1006 throw new Exception(__FILE__.
":".__LINE__.
" $p_mode invalide");
1013 $sel->value=$p_cn->make_array(
"
1015 from stock_repository join profile_sec_repository using (r_id)
1023 $sel->value=$p_cn->make_array(
"
1025 from stock_repository join profile_sec_repository using (r_id)
1047 <span class=\"icon\" ></span>
1048 <input id=\"lk_".$p_table_id.
"\" name=\"$p_name\" autocomplete=\"off\" class=\"input_text\" name=\"filter\" onkeyup=\"filter_table(this, '$p_table_id','$p_col',$start_row ,'$domid')\" type=\"text\" placeholder=\"".
_(
"Filtre rapide").
"\">
1049 <input type=\"button\" class=\"smallbutton\" onclick=\"$('lk_".$p_table_id.
"').value='';filter_table($('lk_".$p_table_id.
"'), '$p_table_id','$p_col',$start_row,'$domid' );\" value=\"X\">
1052 $r.=
' <span class="notice" style="display:none" id="info_'.$p_table_id.
'"></span>';
1070 <span class=\"icon\" ></span>
1071 <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=\"".
_(
"Filtre rapide").
"\">
1072 <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\">
1075 $r.=
' <span class="notice" style="display:none" id="info_'.$p_table_id.
'"></span>';
1089 <span class=\"icon\" ></span>
1091 <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=\"".
_(
"Filtre rapide").
"\">
1092 <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\">
1095 $r.=
' <span class="notice" style="display:none" id="info_'.$p_table_id.
'"></span>';
1116 $r.=
'<span class=" icon"></span>';
1117 $r.=sprintf(
'<input id="search_%s" type="TEXT" class="input_text" name="filter_list%s" placeholder="%s" onkeyup="filter_list(this,\'%s\')">',
1118 $p_list_id,$p_list_id,
_(
"Recherche"),$p_list_id);
1120 $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);
1127 $r=
'<A style="color:red;text-decoration:underline" href="javascript:void(0)" onclick="show_reconcile(\''.$p_div.
'\',\
''.$let.
'\')
">'.$let.$span.'</A>';
1136 static function calendar_zoom($obj)
1138 $button=new ISmallButton("calendar
", _("Calendrier
"));
1140 return $button->input();
1151 static function button_choice_ledger($p_array)
1153 extract($p_array, EXTR_SKIP);
1154 $bledger_param=json_encode(array(
1155 'dossier'=>$_REQUEST['gDossier'],
1157 'all_type'=>$all_type,
1159 'class'=>'inner_box'
1162 $bledger_param=noalyss_str_replace('"
', "'", $bledger_param);
1163 $bledger=new ISmallButton('l');
1164 $bledger->label=_("choix des journaux
");
1165 $bledger->javascript=" show_ledger_choice($bledger_param)
";
1166 $f_ledger=$bledger->input();
1168 if (isset($_REQUEST[$div.'nb_jrn']))
1170 for ($i=0; $i<$_REQUEST[$div.'nb_jrn']; $i++)
1172 if (isset($_REQUEST[$div."r_jrn
"][$i]))
1173 $hid_jrn.=HtmlInput::hidden($div.'r_jrn['.$i.']',
1174 $_REQUEST[$div."r_jrn
"][$i]);
1176 $hid_jrn.=HtmlInput::hidden($div.'nb_jrn',
1177 $_REQUEST[$div.'nb_jrn']);
1180 $hid_jrn=HtmlInput::hidden($div.'nb_jrn', 0);
1183 echo '<span id="ledger_id
'.$div.'">';
1195 static function show_receipt_document($p_jr_id, $p_name="
")
1197 $cn=\Dossier::connect();
1200 // Check the jr_id has a receipt document
1201 $array=$cn->get_array('select jr_def_id,jr_pj_name,jr_grpt_id from jrn where jr_id=$1',
1203 if (count($array)==0)
1205 if ($array[0]['jr_pj_name']=="")
1207 $str_dossier=Dossier::get();
1209 // Name is empty then use an image
1212 $image='<IMG style="width:24px;height:24px;border:0px
" SRC="image/documents.png
" title="'.h($array[0]['jr_pj_name
']).'" >';
1216 $href=http_build_query(array('gDossier'=>Dossier::id(), 'jr_id'=>$p_jr_id,
1217 'act'=>'RAW:receipt'));
1219 $r=sprintf('<A class="mtitle line
" HREF="export.php?%s
">%s</A>', $href,
1228 static function button_action_remove_operation($p_operation)
1230 $rmOperation=sprintf("confirm_box(
null,
'"._('Voulez-vous effacer cette relation
')."',
function () {remove_operation(
'%s',
'%s');});
",
1231 dossier::id(), $p_operation);
1232 $js=Icon_Action::trash("acop
".$p_operation, $rmOperation);
1238 static function button_action_add()
1240 $dossier=Dossier::id();
1241 $js=HtmlInput::button_action(_('Nouvel événement'),
1242 'action_add('.$dossier.')', 'xx', 'smallbutton');
1253 function get_node_attribute()
1256 $nb_attribute=count($this->attribute);
1257 for ($i=0; $i<$nb_attribute; $i++)
1259 $r.=sprintf(' %s="%s
" ', $this->attribute[$i][0],
1260 htmlentities($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
_("actif, passif,charge,...")
for($i=0;$i<=6;$i++) $ind
$class
Display the Plugin and for each profile were it is installed or not.
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 refresh($p_id, $javascript)
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)