79 $this->
value=$p_value;
86 $this->attribute=array();
100 $this->attribute[]=array($p_name,$p_value);
101 $this->$p_name=$p_value;
111 require_once NOALYSS_INCLUDE.
'/lib/function_javascript.php';
113 if ( count($this->attribute) == 0)
return "";
116 for ($i=0;$i< count($this->attribute);$i++)
119 $tmp1=sprintf(
"$('%s').%s='%s';",
150 $name=($p_name != null)?$p_name.
'=':
'';
151 if ( count($this->attribute) == 0)
return $name.
"{}";
155 for ($i=0;$i< count($this->attribute);$i++)
158 $tmp1=sprintf($and.
"'%s':'%s'",
173 echo
"Type ".$this->type.
"<br>";
174 echo
"name ".$this->name.
"<br>";
175 echo
"value". $this->
value.
"<br>";
176 $readonly=($this->readonly==
false)?
"false":
"true";
177 echo
"read only".$readonly.
"<br>";
179 static function submit ($p_name,$p_value,$p_javascript=
"",$p_class=
"smallbutton")
182 return '<INPUT TYPE="SUBMIT" class="'.$p_class.
'" NAME="'.$p_name.
'" ID="'.$p_name.
'_submit_id" VALUE="'.$p_value.
'" '.$p_javascript.
'>';
184 static function button ($p_name,$p_value,$p_javascript=
"",$p_class=
"smallbutton")
187 return '<INPUT TYPE="button" class="'.$p_class.
'" NAME="'.$p_name.
'" ID="'.$p_name.
'" VALUE="'.$p_value.
'" '.$p_javascript.
'>';
192 return '<INPUT TYPE="RESET" class="smallbutton" VALUE="'.$p_value.
'">';
197 return '<INPUT TYPE="hidden" id="'.$p_id.
'" NAME="'.$p_name.
'" VALUE="'.$p_value.
'">';
202 return self::hidden(
'plugin_code',
$_REQUEST[
'plugin_code']);
212 static function button_anchor($p_label,$p_value,$p_name=
"",$p_javascript=
"",$p_class=
"button")
214 $r=sprintf(
'<span id="%s" > <A class="'.$p_class.
'" style="display:inline;" href="%s" %s >%s</A></span>',
223 $r=
'<A HREF="#" tabindex="-1" style="display:inline;color:black;background-color:yellow;padding-left:4px;width:2em;padding-right:4px;text-decoration:none;" onmouseover="showBulle(\''.$p_comment.
'\')
" onclick="showBulle(\
''.$p_comment.
'\')
" onmouseout="hideBulle(0)
">?</A>';
226 static function warnbulle($p_comment)
234 static function detail_op($p_jr_id,$p_mesg)
237 $p_jr_id,dossier::id(),$p_mesg);
246 static function detail_action($ag_id,$p_mesg,$p_modify=1)
249 $ag_id,dossier::id(),$p_modify,$p_mesg);
254 static function detail_modele_document($p_id,$p_mesg)
257 $p_id,dossier::id(),$p_mesg);
263 static function remove_stock($p_id,$p_mesg)
266 $p_id,dossier::id(),$p_mesg);
272 static function history_card($f_id,$p_mesg,$p_style="
")
285 $js= sprintf(
'onclick="view_history_card(\'%s\',\'%s\')"',
296 $view_history= sprintf(
'<A class="detail" style="text-decoration:underline;%s" HREF="javascript:view_history_account(\'%s\',\'%s\')" >%s</A>',
320 echo
'<div id="div_jrn'.$div.
'" >';
322 echo
'<div style="padding:5px">';
323 echo
'<form method="GET" id="'.$div.
'search_frm" onsubmit="return hide_ledger_choice(\''.
$div.
'search_frm\')">';
325 echo _(
'Filtre ').HtmlInput::filter_table(
$div.
'tb_jrn',
'0,1,2', 2);
326 echo
'<table class="result" id="'.$div.
'tb_jrn">';
329 echo
th(_(
'Description'));
334 echo
HtmlInput::button(
'sel_'.
$div,_(
'Inverser la sélection'),
' onclick = "toggle_checkbox(\''.
"{$div}search_frm".
'\')
"');
337 for ($e=0;$e<count($p_array);$e++)
340 $r=new ICheckBox($div.'r_jrn'.$e,$row['jrn_def_id']);
341 $idx=$row['jrn_def_id'];
342 if ( $p_selected != null && in_array($row['jrn_def_id'],$p_selected))
346 $class=($e%2==0)?' class="even
" ':' class="odd
" ';
347 echo '<tr '.$class.'>';
348 echo '<td style="white-space: nowrap
">'.$r->input().$row['jrn_def_name'].'</td>';
349 echo '<td >'.$row['jrn_def_description'].'</td>';
350 echo '<td >'.$row['jrn_def_type'].'</td>';
355 echo HtmlInput::hidden('div',$div);
356 echo HtmlInput::submit('save',_('Valider'));
357 echo HtmlInput::button_close($div."jrn_search
");
362 $ret=ob_get_contents();
370 static function select_cat($array_cat)
373 $ledger=new ISmallButton('l');
374 $ledger->label=_("Catégorie
");
376 echo $ledger->input();
378 /* create a hidden div for the ledger */
379 echo '<div id="div_cat
">';
380 echo '<h2 class="info
">'._('Choix des categories').'</h2>';
381 $selected=(isset($_GET['r_cat']))?$_GET['r_cat']:null;
384 for ($e=0;$e<count($array_cat);$e++)
387 $re=new ICheckBox('r_cat['.$e.']',$row['cat']);
389 if ( $selected != null && isset($selected[$e]))
393 echo '<li style="list-
style-
type: none;
">'.$re->input().$row['name'].'('.$row['cat'].')</li>';
397 $hide=new IButton('l2');
398 $hide->label=_("Valider
");
403 $r=ob_get_contents();
407 static function display_periode($p_id)
419 static function button_close($div_name)
421 $a=new IButton('Fermer');
422 $a->label=_("Fermer
");
423 $a->javascript="removeDiv(
'".$div_name."')
";
434 static function button_hide($div_name)
436 $a=new IButton('Fermer');
437 $a->label=_("Fermer
");
438 $a->javascript="$(
'".$div_name."').
hide()
";
448 static function anchor_close($div,$p_js="
")
451 $r.='<div class="bxbutton
">';
452 $r.= '<A id="close_div
" class="input_text
" onclick="removeDiv(\
''.
$div.
'\');
'.$p_js.'">⨉</A>';
461 static function button_action($action,$javascript,$id="xx
",$p_class="button")
464 $id=HtmlInput::generate_id("xx
");
467 $r.='<input type="button" id="'.$id.'" class="'.$p_class.'" onclick="'.$javascript.'" value="'.h($action).'">';
477 static function image_click($p_image,$p_js,$p_message)
479 $ret=sprintf('<a class="nav
" style="display:
inline" href="#
" title="%s
"><img src="image/%s
" onclick="%s
"></a>',
480 $p_message,$p_image,$p_js);
491 static function button_image($javascript,$id="xx
",$p_class='class="button"',$p_image="")
494 $id=HtmlInput::generate_id("xx
");
497 $r.='<image id="'.$id.'" '.$p_class.' onclick="'.$javascript.'" src="'.$p_image.'" />';
508 static function anchor_hide($action,$javascript)
512 $r.= '<span id="close_div
" class="input_text
" onclick="'.$javascript.'">'.$action.'</span>';
520 static function print_window()
523 $r.=HtmlInput::button('print','Imprimer','onclick="
window.print();
"');
529 static function card_detail($p_qcode,$pname='',$p_style="
",$p_nohistory=false)
531 //if ($pname=='')$pname=$p_qcode;
533 $histo=($p_nohistory==true)?' ,nohistory:1':"";
535 $p_style,$p_qcode,
$histo,$pname,$p_qcode);
549 if ( count($global_array )==0)
return '';
552 if (isset($global_array [$a]))
553 if (is_array($global_array[$a]) ==
false ) {
556 if (count($global_array[$a]) > 0)
558 foreach ($global_array[$a] as
$value)
574 $aJson=json_decode($p_json);
627 if ( count($global_array )==0)
return '';
631 if (isset($global_array [$a]))
633 if (is_array($global_array[$a]) ==
false ) {
634 $r.=$and.
"$a=".$global_array [
$a];
636 for ($i=0;$i<count($global_array[$a]);$i++) {
637 $r.=$and.
"$a".
"[]=".$global_array[
$a][$i];
691 $r=sprintf(
'%s_%d',$p_prefix,mt_rand(0,999999));
764 if ($mod==
'zoom') {
$r=
'<span id="span_'.$div.
'" style="float:right;margin-right:5px;padding-top:3px">'.
HtmlInput::anchor(
"⬜",
"",$p_js,
' name="small'.
$div.
'" id="close_div" class="input_text" ').
'</span>'; }
else
765 if ( $mod ==
'custom') {
$r=
'<span id="span_'.$div.
'" style="float:right;margin-right:5px">'.$p_js.
"</span>";}
else
766 if ( $mod ==
'none') {
$r=
"" ; }
768 die (__FILE__.
":".__LINE__._(
'Paramètre invaide'));
786 $p_url=
"javascript:void(0)";
787 $str=sprintf(
'<a id="%s" href="javascript:void(0)" class="line" title="%s">%s</a>',
788 $p_id,$p_title,$p_text);
801 static function anchor($p_text,
$p_url=
"",$p_js=
"",$p_style=
' class="line" ')
805 $p_url=
"javascript:void(0)";
809 $str=sprintf(
'<a %s href="%s" %s>%s</a>',
810 $p_style,
$p_url,$p_js,$p_text);
827 if ( ! in_array($p_mode,array(
'R',
'W') ) )
829 throw new Exception (__FILE__.
":".__LINE__.
" $p_mode invalide");
836 $sel->value=$p_cn->make_array(
"
838 from stock_repository join profile_sec_repository using (r_id)
846 $sel->value=$p_cn->make_array(
"
848 from stock_repository join profile_sec_repository using (r_id)
859 <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\">
860 <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\">
863 $r.=
' <span class="notice" id="info_'.$p_table_id.
'"></span>';
870 <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\">
871 <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\">
874 $r.=
' <span class="notice" id="info_'.$p_table_id.
'"></span>';
880 $r =
'<A style="color:red;text-decoration:underline" href="javascript:void(0)" onclick="show_reconcile(\'' . $p_div .
'\',\
'' .
$let .
'\')
">' . $let.$span . '</A>';
888 static function calendar_zoom($obj)
890 $button=new ISmallButton("calendar
", _("Calendrier
"));
892 return $button->input();
902 static function button_choice_ledger($p_array)
904 extract ($p_array, EXTR_SKIP);
905 $bledger_param = json_encode(array(
906 'dossier' => $_REQUEST['gDossier'],
908 'all_type' => $all_type,
913 $bledger_param = str_replace('"
', "'", $bledger_param);
914 $bledger = new ISmallButton('l');
915 $bledger->label = _("choix des journaux
");
917 $f_ledger = $bledger->input();
919 if (isset($_REQUEST[$div . 'nb_jrn']))
921 for ($i = 0; $i < $_REQUEST[$div . 'nb_jrn']; $i++)
923 if (isset($_REQUEST[$div . "r_jrn
"][$i]))
924 $hid_jrn.=HtmlInput::hidden($div . 'r_jrn[' . $i . ']', $_REQUEST[$div . "r_jrn
"][$i]);
926 $hid_jrn.=HtmlInput::hidden($div . 'nb_jrn', $_REQUEST[$div . 'nb_jrn']);
929 $hid_jrn = HtmlInput::hidden($div . 'nb_jrn', 0);
932 echo '<span id="ledger_id
' . $div . '">';
943 static function show_receipt_document($p_jr_id,$p_name="
")
948 // Check the jr_id has a receipt document
949 $array=$cn->get_array('select jr_def_id,jr_pj_name,jr_grpt_id from jrn where jr_id=$1',array($p_jr_id));
950 if (count($array)==0) return "";
951 if ($array[0]['jr_pj_name'] == "") return "";
952 $str_dossier=Dossier::get();
954 // Name is empty then use an image
955 if ( $p_name == "") {
956 $image='<IMG style="width:24px;
height:24px;border:0px
" SRC="image/documents.png
" title="' . h($array[0]['jr_pj_name
']) . '" >';
960 $href=http_build_query(array('gDossier'=>Dossier::id(),'jr_id'=>$p_jr_id,'act'=>'RAW:receipt'));
962 $r=sprintf('<A class="mtitle line
" HREF="export.php?%s
">%s</A>', $href, $image);
970 static function button_action_remove_operation($p_operation)
975 $js= '<a class="tinybutton
" id="acop
'.$p_operation.'" href="javascript:void(0)
" onclick="'.$rmOperation.'">'.SMALLX.'</a>';
978 static function button_action_add_concerned_card($p_agid)
980 $dossier=Dossier::id();
982 obj={dossier:$dossier,ag_id:$p_agid};action_add_concerned_card(obj);
984 $js=HtmlInput::button_action(_('Ajout autres'), $javascript,'xx','smallbutton');
987 static function button_action_add()
989 $dossier=Dossier::id();
990 $js=HtmlInput::button_action(_('Nouvel événement'),'action_add('.$dossier.')','xx','smallbutton');
function confirm_box(p_obj, p_message, p_callback_true)
Confirm a form thanks a modal dialog Box, it returns true if we agree otherwise false.
function view_history_card(p_value, dossier)
Change the view of card history.
sql_string($p_string)
Fix the problem with the quote char for the database.
function show_cat_choice()
show the cat of ledger choice
h2($p_string, $p_class="", $raw="")
th($p_string, $p_extra='', $raw='')
for($i=0;$i< count($a);$i++)
function show_ledger_choice(json_obj)
show the ledger choice
function modifyModeleDocument(p_value, dossier)
function modifyOperation(p_value, dossier)
Show the details of an operation.
if($show_row!=0) margin right
for($e=0;$e< count($array);$e++) $desc readOnly
function hideBulle(p_ctl)
function removeDiv(elt)
remove a object created with add_div
function showBulle(p_ctl)
function view_action(ag_id, dossier, modify)
Calendar prototype hide
Hides the calendar.
global $g_user
Find the default module or the first one.
if(!isset($_REQUEST['p_jrn'])) else $Ledger id
if($q[$e]['j_qcode']!= '') else $view_history
function hide_cat_choice()
hide the cat of ledger choice
if(defined("RECOVER")) position
function remove_operation(p_dossier, p_id)
remove the concerned operation of an action
for($i=0;$i<=6;$i++) $ind
function removeStock(s_id, p_dossier)
remove an attached document of an action
function fill_ipopcard(obj)
show the ipopup window and display the details of a card, to work some attribute must be set ...
create_script($p_string)
create the HTML for adding the script tags around of the script
if(count($last_operation)>0) text decoration