27 if (!defined(
'NOREQUIRESOC')) define(
'NOREQUIRESOC',
'1');
28 if (!defined(
'NOCSRFCHECK')) define(
'NOCSRFCHECK', 1);
29 if (!defined(
'NOTOKENRENEWAL')) define(
'NOTOKENRENEWAL', 1);
30 if (!defined(
'NOLOGIN')) define(
'NOLOGIN', 1);
31 if (!defined(
'NOREQUIREMENU')) define(
'NOREQUIREMENU', 1);
32 if (!defined(
'NOREQUIREHTML')) define(
'NOREQUIREHTML', 1);
33 if (!defined(
'NOREQUIREAJAX')) define(
'NOREQUIREAJAX',
'1');
35 session_cache_limiter(
'public');
37 require_once
'../../main.inc.php';
42 if (empty($dolibarr_nocache)) header(
'Cache-Control: max-age=10800, public, must-revalidate');
43 else header(
'Cache-Control: no-cache');
63 $tradMonthsShort = array(
64 $langs->trans(
"MonthShort01"),
65 $langs->trans(
"MonthShort02"),
66 $langs->trans(
"MonthShort03"),
67 $langs->trans(
"MonthShort04"),
68 $langs->trans(
"MonthShort05"),
69 $langs->trans(
"MonthShort06"),
70 $langs->trans(
"MonthShort07"),
71 $langs->trans(
"MonthShort08"),
72 $langs->trans(
"MonthShort09"),
73 $langs->trans(
"MonthShort10"),
74 $langs->trans(
"MonthShort11"),
75 $langs->trans(
"MonthShort12")
79 $langs->trans(
"Sunday"),
80 $langs->trans(
"Monday"),
81 $langs->trans(
"Tuesday"),
82 $langs->trans(
"Wednesday"),
83 $langs->trans(
"Thursday"),
84 $langs->trans(
"Friday"),
85 $langs->trans(
"Saturday")
88 $tradDaysShort = array(
89 $langs->trans(
"ShortSunday"),
90 $langs->trans(
"ShortMonday"),
91 $langs->trans(
"ShortTuesday"),
92 $langs->trans(
"ShortWednesday"),
93 $langs->trans(
"ShortThursday"),
94 $langs->trans(
"ShortFriday"),
95 $langs->trans(
"ShortSaturday")
99 $langs->trans(
"SundayMin"),
100 $langs->trans(
"MondayMin"),
101 $langs->trans(
"TuesdayMin"),
102 $langs->trans(
"WednesdayMin"),
103 $langs->trans(
"ThursdayMin"),
104 $langs->trans(
"FridayMin"),
105 $langs->trans(
"SaturdayMin")
112 var tradMonths = <?php echo json_encode($tradMonths) ?>;
113 var tradMonthsShort = <?php echo json_encode($tradMonthsShort) ?>;
114 var tradDays = <?php echo json_encode($tradDays) ?>;
115 var tradDaysShort = <?php echo json_encode($tradDaysShort) ?>;
116 var tradDaysMin = <?php echo json_encode($tradDaysMin) ?>;
119 $(document).ready(
function() {
120 $.datepicker.setDefaults({
124 altField:
'#timestamp',
130 $.datepicker.regional[
'<?php echo $langs->defaultlang ?>'] = {
131 closeText:
'<?php echo $langs->trans("Close2") ?>',
132 prevText:
'<?php echo $langs->trans("Previous") ?>',
133 nextText:
'<?php echo $langs->trans("Next") ?>',
134 currentText:
'<?php echo $langs->trans("Now") ?>',
135 monthNames: tradMonths,
136 monthNamesShort: tradMonthsShort,
138 dayNamesShort: tradDaysShort,
139 dayNamesMin: tradDaysMin,
140 weekHeader:
'<?php echo $langs->trans("Week"); ?>',
141 dateFormat:
'<?php echo $langs->trans("FormatDateShortJQuery"); ?>',
142 firstDay: <?php echo (isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK :
'1'); ?>,
143 isRTL: <?php echo ($langs->trans(
"DIRECTION") ==
'rtl' ?
'true' :
'false'); ?>,
144 showMonthAfterYear:
false,
147 $.datepicker.setDefaults($.datepicker.regional[
'<?php echo $langs->defaultlang ?>']);
157 matches:
function (matches) {
return matches +
" <?php echo dol_escape_js($langs->transnoentitiesnoconv("Select2ResultFoundUseArrows
")); ?>"; },
158 noResults:
function () {
return "<?php echo dol_escape_js($langs->transnoentitiesnoconv("Select2NotFound
")); ?>"; },
159 inputTooShort:
function (input) {
160 var
n = input.minimum;
163 if (n > 1)
return "<?php echo dol_escape_js($langs->transnoentitiesnoconv("Select2Enter
")); ?> " + n +
" <?php echo dol_escape_js($langs->transnoentitiesnoconv("Select2MoreCharacters
")); ?>";
164 else return "<?php echo dol_escape_js($langs->transnoentitiesnoconv("Select2Enter
")); ?> " + n +
" <?php echo dol_escape_js($langs->transnoentitiesnoconv("Select2MoreCharacter
")); ?>"
166 loadMore:
function (pageNumber) {
return "<?php echo dol_escape_js($langs->transnoentitiesnoconv("Select2LoadingMoreResults
")); ?>"; },
167 searching:
function () {
return "<?php echo dol_escape_js($langs->transnoentitiesnoconv("Select2SearchInProgress
")); ?>"; }
178 if(document.getElementById)
179 theObject=document.getElementById(
id);
181 theObject=document.all[id];
186 function dpChangeDay(dateFieldID, format)
189 console.log(
"Call dpChangeDay, we save date into detailed fields from format = "+format);
196 var date=getDateFromFormat(thefield.value, format);
200 thefieldday.value=date.getDate();
201 if(thefieldday.onchange) thefieldday.onchange.call(thefieldday);
202 thefieldmonth.value=date.getMonth()+1;
203 if(thefieldmonth.onchange) thefieldmonth.onchange.call(thefieldmonth);
204 thefieldyear.value=date.getFullYear();
205 if(thefieldyear.onchange) thefieldyear.onchange.call(thefieldyear);
209 thefieldday.value=
'';
210 if(thefieldday.onchange) thefieldday.onchange.call(thefieldday);
211 thefieldmonth.value=
'';
212 if(thefieldmonth.onchange) thefieldmonth.onchange.call(thefieldmonth);
213 thefieldyear.value=
'';
214 if(thefieldyear.onchange) thefieldyear.onchange.call(thefieldyear);
231 function formatDate(date,format)
240 var year=date.getYear()+
"";
if (year.length < 4) { year=
""+(year-0+1900); }
241 var month=date.getMonth()+1;
242 var day=date.getDate();
243 var hour=date.getHours();
244 var minute=date.getMinutes();
245 var seconde=date.getSeconds();
248 while (i < format.length)
253 while ((format.charAt(j)==c) && (j < format.length))
255 substr += format.charAt(j++);
259 if (substr ==
'yyyy') { result=result+year; }
260 else if (substr ==
'yy') { result=result+year.substring(2,4); }
261 else if (substr ==
'M') { result=result+month; }
262 else if (substr ==
'MM') { result=result+(month<1||month>9?
"":
"0")+month; }
263 else if (substr ==
'd') { result=result+day; }
264 else if (substr ==
'dd') { result=result+(day<1||day>9?
"":
"0")+day; }
265 else if (substr ==
'hh') {
if (hour > 12) hour-=12; result=result+(hour<0||hour>9?
"":
"0")+hour; }
266 else if (substr ==
'HH') { result=result+(hour<0||hour>9?
"":
"0")+hour; }
267 else if (substr ==
'mm') { result=result+(minute<0||minute>9?
"":
"0")+minute; }
268 else if (substr ==
'ss') { result=result+(seconde<0||seconde>9?
"":
"0")+seconde; }
269 else { result=result+substr; }
299 function getDateFromFormat(val,format)
307 if (val ==
'')
return 0;
310 var year=now.getYear();
if (year.length < 4) { year=
""+(year-0+1900); }
311 var month=now.getMonth()+1;
312 var day=now.getDate();
313 var hour=now.getHours();
314 var minute=now.getMinutes();
315 var seconde=now.getSeconds();
321 while (i < format.length)
326 while ((format.charAt(j)==c) && (j < format.length))
330 substr += format.charAt(j++);
334 if (substr ==
"yyyy") year=getIntegerInString(val,d,4,4);
335 if (substr ==
"yy") year=
""+(getIntegerInString(val,d,2,2)-0+1900);
336 if (substr ==
"MM" ||substr ==
"M")
338 month=getIntegerInString(val,d,1,2);
339 if (month) d -= 2- month.length;
343 day=getIntegerInString(val,d,1,2);
344 if (day) d -= 2- day.length;
346 if (substr ==
"HH" ||substr ==
"hh" )
348 hour=getIntegerInString(val,d,1,2);
349 if (dhouray) d -= 2- hour.length;
352 minute=getIntegerInString(val,d,1,2);
353 if (minute) d -= 2- minute.length;
357 seconde=getIntegerInString(val,d,1,2);
358 if (seconde) d -= 2- seconde.length;
366 if (year==null||year<1) {
return 0; }
367 if (month==null||(month<1)||(month>12)) {
return 0; }
368 if (day==null||(day<1)||(day>31)) {
return 0; }
369 if (hour==null||(hour<0)||(hour>24)) {
return 0; }
370 if (minute==null||(minute<0)||(minute>60)) {
return 0; }
371 if (seconde==null||(seconde<0)||(seconde>60)) {
return 0; }
374 return new Date(year,month-1,day,hour,minute,seconde);
383 function stringIsInteger(str)
385 var digits=
"1234567890";
386 for (var i=0; i < str.length; i++)
388 if (digits.indexOf(str.charAt(i))==-1)
402 function getIntegerInString(str,i,minlength,maxlength)
404 for (var x=maxlength; x>=minlength; x--)
406 var substr=str.substring(i,i+x);
407 if (substr.length < minlength) {
return null; }
408 if (stringIsInteger(substr)) {
return substr; }
422 function urlencode(s) {
424 news=news.replace(/\+/gi,
'%2B');
425 news=news.replace(/&/gi,
'%26');
437 function htmlEntityDecodeJs(inp){
438 var replacements = {
'<':
'<',
'>':
'>',
'/':
'/',
'"':
'"',
''':
'\'',
'&':
'&',
' ':
' '};
441 for(var r in replacements){
442 inp = inp.replace(
new RegExp(r,
'g'),replacements[r]);
444 return inp.replace(/&#(\d+);/g,
function(match, dec) {
445 return String.fromCharCode(dec);
460 function ac_delay(funct,delay) {
462 setTimeout(funct,delay);
475 function cleanSerialize(expr) {
476 if (typeof(expr) !=
'string')
return '';
477 var reg =
new RegExp(
"(&)",
"g");
478 var reg2 =
new RegExp(
"[^A-Z0-9,]",
"g");
479 var liste1 = expr.replace(reg,
",");
480 return liste1.replace(reg2,
"");
494 function displayMessage(fieldId,message) {
495 var textbox = document.getElementById(fieldId);
496 if (textbox.value ==
'') {
497 textbox.style.color =
'grey';
498 textbox.value = message;
512 function hideMessage(fieldId,message) {
513 var textbox = document.getElementById(fieldId);
514 textbox.style.color =
'black';
515 if (textbox.value == message) textbox.value =
'';
532 function setConstant(url,
code, input, entity, strict, forcereload, userid, token) {
541 console.log(
"url request success forcereload="+forcereload);
542 $(
"#set_" +
code).hide();
543 $(
"#del_" +
code).show();
544 $.each(input,
function(
type, data) {
546 if (
type ==
"disabled" && strict != 1) {
547 $.each(data,
function(key, value) {
548 var newvalue=((value.search(
"^#") < 0 && value.search(
"^\.") < 0) ?
"#" :
"") + value;
549 $(newvalue).removeAttr(
"disabled");
550 if ($(newvalue).hasClass(
"butActionRefused") ==
true) {
551 $(newvalue).removeClass(
"butActionRefused");
552 $(newvalue).addClass(
"butAction");
555 }
else if (
type ==
"enabled") {
556 $.each(data,
function(key, value) {
557 var newvalue=((value.search(
"^#") < 0 && value.search(
"^\.") < 0) ?
"#" :
"") + value;
559 $(newvalue).removeAttr(
"disabled");
561 $(newvalue).attr(
"disabled",
true);
562 if ($(newvalue).hasClass(
"butAction") ==
true) {
563 $(newvalue).removeClass(
"butAction");
564 $(newvalue).addClass(
"butActionRefused");
568 }
else if (
type ==
"showhide" ||
type ==
"show") {
569 $.each(data,
function(key, value) {
570 var newvalue=((value.search(
"^#") < 0 && value.search(
"^\.") < 0) ?
"#" :
"") + value;
574 }
else if (
type ==
"set") {
575 $.each(data,
function(key, value) {
576 $(
"#set_" + key).hide();
577 $(
"#del_" + key).show();
591 }).
fail(
function(error) { location.reload(); });
607 function delConstant(url,
code, input, entity, strict, forcereload, userid, token) {
616 console.log(
"url request success forcereload="+forcereload);
617 $(
"#del_" +
code).hide();
618 $(
"#set_" +
code).show();
619 $.each(input,
function(
type, data) {
621 if (
type ==
"disabled") {
622 $.each(data,
function(key, value) {
623 var newvalue=((value.search(
"^#") < 0 && value.search(
"^\.") < 0) ?
"#" :
"") + value;
624 $(newvalue).attr(
"disabled",
true);
625 if ($(newvalue).hasClass(
"butAction") ==
true) {
626 $(newvalue).removeClass(
"butAction");
627 $(newvalue).addClass(
"butActionRefused");
630 }
else if (
type ==
"enabled" && strict != 1) {
631 $.each(data,
function(key, value) {
632 var newvalue=((value.search(
"^#") < 0 && value.search(
"^\.") < 0) ?
"#" :
"") + value;
633 $(newvalue).removeAttr(
"disabled");
634 if ($(newvalue).hasClass(
"butActionRefused") ==
true) {
635 $(newvalue).removeClass(
"butActionRefused");
636 $(newvalue).addClass(
"butAction");
640 }
else if (
type ==
"showhide" ||
type ==
"hide") {
641 $.each(data,
function(key, value) {
642 var newvalue=((value.search(
"^#") < 0 && value.search(
"^\.") < 0) ?
"#" :
"") + value;
646 }
else if (
type ==
"del") {
647 $.each(data,
function(key, value) {
648 $(
"#del_" + value).hide();
649 $(
"#set_" + value).show();
662 }).
fail(
function(error) { location.reload(); });
681 function confirmConstantAction(action, url,
code, input, box, entity, yesButton, noButton, strict, userid, token) {
682 var boxConfirm = box;
683 $(
"#confirm_" +
code)
684 .attr(
"title", boxConfirm.title)
685 .html(boxConfirm.content)
693 id :
'yesButton_' +
code,
696 if (action ==
"set") {
697 setConstant(url,
code, input, entity, strict, 0, userid, token);
698 }
else if (action ==
"del") {
699 delConstant(url,
code, input, entity, strict, 0, userid, token);
702 $(
this).dialog(
"close");
704 if (boxConfirm.method) {
705 var fnName = boxConfirm.method;
706 if (window.hasOwnProperty(fnName)) {
713 id :
'noButton_' +
code,
716 $(
this).dialog(
"close");
722 if (boxConfirm.info) {
723 $(
"#noButton_" +
code).button().hide();
737 $.widget(
"ui.combobox", {
739 minLengthToAutocomplete: 0
741 _create:
function() {
742 var savMinLengthToAutocomplete = this.options.minLengthToAutocomplete;
744 select = this.element.hide(),
745 selected = select.children(
":selected" ),
746 value = selected.val() ? selected.text() :
"";
747 var input = this.input = $(
"<input>" )
748 .insertAfter( select )
750 .attr(
'id',
'inputautocomplete'+select.attr(
'id'))
753 minLength: this.options.minLengthToAutocomplete,
754 source:
function( request, response ) {
755 var matcher =
new RegExp( $.ui.autocomplete.escapeRegex(request.term),
"i" );
756 response( select.children(
"option:enabled" ).map(
function() {
757 var text = $( this ).text();
758 if ( this.value && ( !request.term || matcher.test(text) ) )
762 "(?![^&;]+;)(?!<[^<>]*)(" +
763 $.ui.autocomplete.escapeRegex(request.term) +
764 ")(?![^<>]*>)(?![^&;]+;)",
"gi"
765 ),
"<strong>$1</strong>" ),
771 select:
function( event, ui ) {
772 ui.item.option.selected =
true;
773 self._trigger(
"selected", event, {
777 change:
function( event, ui ) {
779 var matcher =
new RegExp(
"^" + $.ui.autocomplete.escapeRegex( $(
this).val() ) +
"$",
"i" ),
781 select.children(
"option" ).each(
function() {
782 if ( $(
this ).text().match( matcher ) ) {
783 this.selected = valid =
true;
791 input.data(
"ui-autocomplete").term =
"";
797 .addClass(
"ui-widget ui-widget-content ui-corner-left dolibarrcombobox" );
799 input.data(
"ui-autocomplete")._renderItem =
function( ul, item ) {
801 .data(
"ui-autocomplete-item", item )
802 .append(
"<a>" + item.label +
"</a>" )
806 this.button = $(
"<button type=\'button\'> </button>" )
807 .attr(
"tabIndex", -1 )
808 .attr(
"title",
"Show All Items" )
809 .insertAfter( input )
812 primary:
"ui-icon-triangle-1-s"
816 .removeClass(
"ui-corner-all" )
817 .addClass(
"ui-corner-right ui-button-icon" )
820 if ( input.autocomplete(
"widget" ).is(
":visible" ) ) {
821 input.autocomplete(
"close" );
826 input.autocomplete({ minLength: 0 });
827 input.autocomplete(
"search",
"" );
828 input.autocomplete({ minLength: savMinLengthToAutocomplete });
833 destroy:
function() {
835 this.button.remove();
837 $.Widget.prototype.destroy.call(
this );
852 text = text.replace(/<br>/g,
"\n");
853 var newElem =
'<textarea id="coordsforpopup" style="border: none; width: 90%; height: 120px;">'+text+
'</textarea><br><br>'+text2;
855 $(
"#dialogforpopup").html(newElem);
856 $(
"#dialogforpopup").dialog();
857 $(
"#coordsforpopup").select();
872 var argc =
newpopup.arguments.length;
874 console.log(
"newpopup "+argv[2]+
" "+argv[3]);
875 var l = (argc > 2) ? argv[2] : 600;
876 var h = (argc > 3) ? argv[3] : 400;
877 var left = (screen.width - l)/2;
878 var top = (screen.height - h)/2;
879 var wfeatures =
"directories=0,menubar=0,status=0,resizable=0,scrollbars=1,toolbar=0,width=" + l +
",height=" + h +
",left=" + left +
",top=" + top;
880 fen=window.open(tmp,title,wfeatures);
896 var ValidImageTypes = [
"image/gif",
"image/jpeg",
"image/png",
"image/webp"];
897 var showOriginalSizeButton =
false;
899 console.log(
"document_preview A click was done. file="+file+
", type="+
type+
", title="+title);
901 if ($.inArray(
type, ValidImageTypes) < 0) {
904 var object_width=
'100%';
905 var height = ($( window ).height() - 60) * 0.90;
906 var object_height=
'98%';
908 show_preview(
'notimage');
915 var img =
new Image();
917 img.onload =
function() {
918 object_width = this.width;
919 object_height = this.height;
921 width = $( window ).width()*0.90;
922 console.log(
"object_width="+object_width+
" window width="+width);
923 if(object_width < width){
924 console.log(
"Object width is small, we set width of popup according to image width.");
925 width = object_width + 30
927 height = $( window ).height()*0.85;
928 console.log(
"object_height="+object_height+
" window height="+height);
929 if(object_height < height){
930 console.log(
"Object height is small, we set height of popup according to image height.");
931 height = object_height + 80
935 showOriginalSizeButton =
true;
938 show_preview(
'image');
944 function show_preview(mode) {
946 var newElem =
'<object name="objectpreview" data="'+file+
'" type="'+
type+
'" width="'+object_width+
'" height="'+object_height+
'" param="noparam"></object>';
949 if (mode ==
'image' && showOriginalSizeButton)
952 "<?php echo dol_escape_js($langs->transnoentitiesnoconv("OriginalSize
")); ?>":
function() { console.log(
"Click on original size"); jQuery(
".ui-dialog-content.ui-widget-content > object").css({
"max-height":
"none" }); },
953 "<?php echo dol_escape_js($langs->transnoentitiesnoconv("CloseWindow
")); ?>":
function() { $( this ).dialog(
"close" ); }
957 $(
"#dialogforpopup").html(newElem);
958 $(
"#dialogforpopup").dialog({
965 buttons: optionsbuttons
968 if (showOriginalSizeButton)
970 jQuery(
".ui-dialog-content.ui-widget-content > object").css({
"max-height":
"100%",
"width":
"auto",
"margin-left":
"auto",
"margin-right":
"auto",
"display":
"block" });
984 name =
name.replace(/[\[]/,
"\\[").replace(/[\]]/,
"\\]");
985 var regex =
new RegExp(
"[\\?&]" +
name +
"=([^&#]*)"),
986 results = regex.exec(location.search);
987 return results === null ? valueifnotfound : decodeURIComponent(results[1].replace(/\+/g,
" "));
1001 function decimalAdjust(
type, value, exp) {
1003 if (typeof exp ===
'undefined' || +exp === 0) {
1004 return Math[
type](value);
1009 if (isNaN(value) || !(typeof exp ===
'number' && exp % 1 === 0)) {
1013 value = value.toString().split(
'e');
1014 value = Math[
type](+(value[0] +
'e' + (value[1] ? (+value[1] - exp) : -exp)));
1016 value = value.toString().split(
'e');
1017 return +(value[0] +
'e' + (value[1] ? (+value[1] + exp) : exp));
1021 if (!Math.round10) {
1022 Math.round10 =
function(value, exp) {
1023 return decimalAdjust(
'round', value, exp);
1027 if (!Math.floor10) {
1028 Math.floor10 =
function(value, exp) {
1029 return decimalAdjust(
'floor', value, exp);
1034 Math.ceil10 =
function(value, exp) {
1035 return decimalAdjust(
'ceil', value, exp);
1041 function dolroundjs(number, decimals) {
return +(Math.round(number +
"e+" + decimals) +
"e-" + decimals); }
1052 var main_max_dec_shown = <?php echo (
int) str_replace(
'.',
'', $conf->global->MAIN_MAX_DECIMALS_SHOWN); ?>;
1053 var main_rounding_unit = <?php echo (
int) $conf->global->MAIN_MAX_DECIMALS_UNIT; ?>;
1054 var main_rounding_tot = <?php echo (
int) $conf->global->MAIN_MAX_DECIMALS_TOT; ?>;
1056 if (mode ==
'MU')
return amount.toFixed(main_rounding_unit);
1057 if (mode ==
'MT')
return amount.toFixed(main_rounding_tot);
1058 return 'Bad value for parameter mode';
1069 if (amount ==
'')
return '';
1074 if ($langs->transnoentitiesnoconv(
"SeparatorDecimal") !=
"SeparatorDecimal") {
1075 $dec = $langs->transnoentitiesnoconv(
"SeparatorDecimal");
1077 if ($langs->transnoentitiesnoconv(
"SeparatorThousand") !=
"SeparatorThousand") {
1078 $thousand = $langs->transnoentitiesnoconv(
"SeparatorThousand");
1080 if ($thousand ==
'Space') $thousand =
' ';
1081 print "var dec='".dol_escape_js($dec).
"'; var thousand='".
dol_escape_js($thousand).
"';\n";
1084 var main_max_dec_shown = <?php echo (
int) str_replace(
'.',
'', $conf->global->MAIN_MAX_DECIMALS_SHOWN); ?>;
1085 var main_rounding_unit = <?php echo (
int) $conf->global->MAIN_MAX_DECIMALS_UNIT; ?>;
1086 var main_rounding_tot = <?php echo (
int) $conf->global->MAIN_MAX_DECIMALS_TOT; ?>;
1088 var amount = amount.toString();
1091 var rounding = main_rounding_unit;
1092 var pos = amount.indexOf(dec);
1094 if (pos >= 0) decpart = amount.substr(pos + 1).replace(
'/0+$/i',
'');
1095 var nbdec = decpart.length;
1096 if (nbdec > rounding) rounding = nbdec;
1098 if (rounding > main_max_dec_shown) rounding = main_max_dec_shown;
1099 if (thousand !=
',' && thousand !=
'.') amount = amount.replace(
',',
'.');
1100 amount = amount.replace(
' ',
'');
1101 amount = amount.replace(thousand,
'');
1102 amount = amount.replace(dec,
'.');
1104 var res = Math.round10(amount, - rounding);
1107 console.log(
"res="+res)
1113 if (empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) && !defined(
'DISABLE_JQUERY_JNOTIFY')) {
1116 $(document).ready(
function() {
1117 if (typeof $.jnotify ==
'function')
1122 , closeLabel:
"×"
1126 , classContainer:
"jnotify-container"
1127 , classNotification:
"jnotify-notification"
1128 , classBackground:
"jnotify-background"
1129 , classClose:
"jnotify-close"
1130 , classMessage:
"jnotify-message"
1133 , beforeRemove: null
1140 $(document).ready(
function() {
1141 if (window.location !== window.parent.location ) {
1142 console.log(
"Page is detected to be into an iframe, we hide by CSS the menus");
1144 jQuery(
".side-nav-vert, .side-nav, .websitebar").hide();
1145 jQuery(
".id-container").css(
'width',
'100%');
pricejs(amount, mode)
Function similar to PHP price()
if(!empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'] country if(!empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'] typent code
dol_escape_js($stringtoescape, $mode=0, $noescapebackslashn=0)
Returns text escaped for inclusion into javascript code.
$conf db name
Only used if Module[ID]Name translation string is not found.
if(!defined('NOREQUIREMENU')) if(!function_exists("llxHeader")) top_httphead($contenttype= 'text/html', $forcenocache=0)
Show HTTP header.
select2arrayoflanguage
Set array used for select2 translations.
price2numjs(amount)
Function similar to PHP price2num()
document_preview(file, type, title)
Function show document preview.
newpopup(url, title)
Show a popup HTML page.
if(empty($user->rights->takepos->run)&&!defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) if(($conf->global->TAKEPOS_PHONE_BASIC_LAYOUT==1 &&$conf->browser->layout== 'phone')||defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) fail($message)
Abort invoice creationg with a given error message.
copyToClipboard(text, text2)
Function to output a dialog box for copy/paste.
getObjectFromID(id)
For calendar input.
print
Draft customers invoices.
getParameterByName(name, valueifnotfound)
print $_SERVER["PHP_SELF"] n
Edit parameters.
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type