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.
'>';
245 return '<INPUT TYPE="RESET" class="smallbutton" 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>',
332 return sprintf(
'<A class="detail" style="text-decoration:underline" HREF="javascript:modifyModeleDocument(%d,%d)">%s</A>',
341 return sprintf(
'<A class="detail" style="text-decoration:underline" HREF="javascript:removeStock(%d,%d)">%s</A>',
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>',
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>',
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");
503 $a->javascript=
"$('".$div_name.
"').hide()";
517 throw new Exception(
"DEPRECATED");
529 $p_class=
"button", $p_symbole=
"")
536 $r.=
'<a id="'.$id.
'" href="javascript:void(0)" class="'.$p_class.
'" onclick="'.
$javascript.
'">'.$p_symbole.h(
$action).
'</a>';
549 $p_class=
"button", $p_symbole=
"")
556 $r.=
'<input type="button" id="'.$id.
'" class="'.$p_class.
'" onclick="'.
$javascript.
'" value="'.$p_symbole.h(
$action).
'">';
566 static function image_click($p_image, $p_js, $p_message, $p_class=
"")
568 $ret=sprintf(
'<a class="nav %s" style="display:inline" title="%s"><img src="image/%s" onclick="%s"></a>',
569 $p_class, $p_message, $p_image, $p_js);
581 $p_class=
'class="button"', $p_image=
"")
588 $r.=
'<image id="'.$id.
'" '.$p_class.
' onclick="'.
$javascript.
'" src="'.$p_image.
'" />';
603 throw new Exception(
"DEPRECATED");
620 $p_nohistory=
false,$nofollowup=
false)
622 if ($pname !==
'') {$pname=
'<span class="v-large">('.$pname.
')</span>';}
624 $histo=($p_nohistory==
true)?
' ,nohistory:1':
"";
625 $followup=($nofollowup==
true)?
' ,nofollowup:1':
"";
626 $r.=sprintf(
'<a href="javascript:void(0)" %s class="detail" onclick="fill_ipopcard({qcode:\'%s\' %s %s})">%s %s</a>',
627 $p_style, $p_qcode,
$histo,$followup,$p_qcode,$pname);
642 if (count($global_array)==0)
646 if (isset($global_array [
$a]))
647 if (is_array($global_array[
$a])==
false)
653 if (count($global_array[
$a])>0)
655 foreach ($global_array[
$a] as
$value)
672 if (empty (
$array))
return "";
685 $aJson=json_decode($p_json);
686 foreach ($aJson as $key=>
$value)
739 if (count($global_array)==0)
744 if (isset($global_array [
$a]))
746 if (is_array($global_array[
$a])==
false)
748 $r.=$and.
"$a=".$global_array [
$a];
752 for (
$i=0;
$i<count($global_array[
$a]);
$i++)
754 $r.=$and.
"$a".
"[]=".$global_array[
$a][
$i];
809 $r=sprintf(
'%s_%d', $p_prefix, mt_rand(0, 999999));
893 static function title_box($p_name, $p_div, $p_mod=
"close", $p_js=
"",
894 $p_draggable=
"n",$p_enlarge=
'n',$raw=
"")
896 $p_div=strip_tags($p_div);
897 $r=
'<div class="bxbutton">';
900 if ($p_draggable==
"y")
904 if ( $p_enlarge==
'y') {
921 $r.=
'<span id="span_'.$p_div.
'" style="float:right;margin-right:5px">'.$p_js.
"</span>";
929 throw new Exception(__FILE__.
":".__LINE__._(
"Paramètre invalide p_mod = '$p_mod'"));
934 $r.=
h2($p_name,
' class="title" ',$raw);
953 $p_url=
"javascript:void(0)";
954 $str=sprintf(
'<a id="%s" href="javascript:void(0)" class="line" title="%s">%s</a>',
955 $p_id, $p_title, $p_text);
973 $p_style=
' class="line" ', $p_title=
"click", array $p_attribute=[])
977 $p_url=
'href="javascript:void(0)"';
982 $str=sprintf(
'<a %s %s %s %s title="%s">%s</a>', $str_javascript_attr,$p_style,
$p_url, $p_js, $p_title,$p_text);
1000 if (!in_array($p_mode, array(
'R',
'W')))
1002 throw new Exception(__FILE__.
":".__LINE__.
" $p_mode invalide");
1009 $sel->value=$p_cn->make_array(
"
1011 from stock_repository join profile_sec_repository using (r_id)
1019 $sel->value=$p_cn->make_array(
"
1021 from stock_repository join profile_sec_repository using (r_id)
1042 <span class=\"icon\" ></span>
1043 <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").
"\">
1044 <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\">
1047 $r.=
' <span class="notice" id="info_'.$p_table_id.
'"></span>';
1061 <span class=\"icon\" ></span>
1063 <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").
"\">
1064 <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\">
1067 $r.=
' <span class="notice" id="info_'.$p_table_id.
'"></span>';
1088 $r.=
'<span class=" icon"></span>';
1089 $r.=sprintf(
'<input id="search_%s" type="TEXT" class="input_text" name="filter_list%s" placeholder="%s" onkeyup="filter_list(this,\'%s\')">',
1090 $p_list_id,$p_list_id,
_(
"Recherche"),$p_list_id);
1092 $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);
1099 $r=
'<A style="color:red;text-decoration:underline" href="javascript:void(0)" onclick="show_reconcile(\''.$p_div.
'\',\
''.$let.
'\')
">'.$let.$span.'</A>';
1108 static function calendar_zoom($obj)
1110 $button=new ISmallButton("calendar
", _("Calendrier
"));
1112 return $button->input();
1123 static function button_choice_ledger($p_array)
1125 extract($p_array, EXTR_SKIP);
1126 $bledger_param=json_encode(array(
1127 'dossier'=>$_REQUEST['gDossier'],
1129 'all_type'=>$all_type,
1131 'class'=>'inner_box'
1134 $bledger_param=noalyss_str_replace('"
', "'", $bledger_param);
1135 $bledger=new ISmallButton('l');
1136 $bledger->label=_("choix des journaux
");
1137 $bledger->javascript=" show_ledger_choice($bledger_param)
";
1138 $f_ledger=$bledger->input();
1140 if (isset($_REQUEST[$div.'nb_jrn']))
1142 for ($i=0; $i<$_REQUEST[$div.'nb_jrn']; $i++)
1144 if (isset($_REQUEST[$div."r_jrn
"][$i]))
1145 $hid_jrn.=HtmlInput::hidden($div.'r_jrn['.$i.']',
1146 $_REQUEST[$div."r_jrn
"][$i]);
1148 $hid_jrn.=HtmlInput::hidden($div.'nb_jrn',
1149 $_REQUEST[$div.'nb_jrn']);
1152 $hid_jrn=HtmlInput::hidden($div.'nb_jrn', 0);
1155 echo '<span id="ledger_id
'.$div.'">';
1167 static function show_receipt_document($p_jr_id, $p_name="
")
1172 // Check the jr_id has a receipt document
1173 $array=$cn->get_array('select jr_def_id,jr_pj_name,jr_grpt_id from jrn where jr_id=$1',
1175 if (count($array)==0)
1177 if ($array[0]['jr_pj_name']=="")
1179 $str_dossier=Dossier::get();
1181 // Name is empty then use an image
1184 $image='<IMG style="width:24px;height:24px;border:0px
" SRC="image/documents.png
" title="'.h($array[0]['jr_pj_name
']).'" >';
1188 $href=http_build_query(array('gDossier'=>Dossier::id(), 'jr_id'=>$p_jr_id,
1189 'act'=>'RAW:receipt'));
1191 $r=sprintf('<A class="mtitle line
" HREF="export.php?%s
">%s</A>', $href,
1200 static function button_action_remove_operation($p_operation)
1202 $rmOperation=sprintf("confirm_box(
null,
'"._('Voulez-vous effacer cette relation
')."',
function () {remove_operation(
'%s',
'%s');});
",
1203 dossier::id(), $p_operation);
1204 $js=Icon_Action::trash("acop
".$p_operation, $rmOperation);
1210 static function button_action_add()
1212 $dossier=Dossier::id();
1213 $js=HtmlInput::button_action(_('Nouvel événement'),
1214 'action_add('.$dossier.')', 'xx', 'smallbutton');
1225 function get_node_attribute()
1228 $nb_attribute=count($this->attribute);
1229 for ($i=0; $i<$nb_attribute; $i++)
1231 $r.=sprintf(' %s="%s
" ', $this->attribute[$i][0],
1232 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
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)