diff --git a/htdocs/core/class/commonobjectline.class.php b/htdocs/core/class/commonobjectline.class.php index bed227eb408..91d4245ff88 100644 --- a/htdocs/core/class/commonobjectline.class.php +++ b/htdocs/core/class/commonobjectline.class.php @@ -53,7 +53,7 @@ abstract class CommonObjectLine extends CommonObject /** * Returns the translation key from units dictionary. * A langs->trans() must be called on result to get translated value. - * + * * @param string $type Label type (long or short) * @return string|int <0 if ko, label if ok */ @@ -94,4 +94,3 @@ abstract class CommonObjectLine extends CommonObject // For the moment we use the extends on CommonObject until PHP min is 5.4 so use Traits. } - diff --git a/htdocs/core/class/vcard.class.php b/htdocs/core/class/vcard.class.php index 8bdeb3e43b7..abd63fa5ef4 100644 --- a/htdocs/core/class/vcard.class.php +++ b/htdocs/core/class/vcard.class.php @@ -155,7 +155,7 @@ class vCard * @return void */ function setBirthday($date) - { + { // $date format is YYYY-MM-DD - RFC 2425 and RFC 2426 $this->properties["BDAY"] = dol_print_date($date, 'dayrfc'); } diff --git a/htdocs/core/js/lib_photosresize.js b/htdocs/core/js/lib_photosresize.js index 9c4c6671b1e..35511746f21 100644 --- a/htdocs/core/js/lib_photosresize.js +++ b/htdocs/core/js/lib_photosresize.js @@ -22,7 +22,7 @@ /* Enable jcrop plugin onto id cropbox */ jQuery(function() { jQuery('#cropbox').Jcrop({ - onSelect: updateCoords, + onSelect: updateCoords, onChange: updateCoords }); }); diff --git a/htdocs/core/js/listview.js b/htdocs/core/js/listview.js index de3113d0fae..f5ee0af6568 100644 --- a/htdocs/core/js/listview.js +++ b/htdocs/core/js/listview.js @@ -22,28 +22,28 @@ var Listview_include = true; function Listview_OrderDown(idListe, column) { var base_url = document.location.href; - + base_url = Listview_recup_form_param(idListe,base_url); base_url = Listview_removeParam(base_url,'Listview['+encodeURIComponent(idListe)+'][orderBy]'); - + base_url = Listview_removeParam(base_url,'get-all-for-export'); - + document.location.href=Listview_modifyUrl(base_url,"Listview["+encodeURIComponent(idListe)+"][orderBy]["+encodeURIComponent(column)+"]","DESC"); } function Listview_OrderUp(idListe, column) { - + var base_url = document.location.href; - + base_url = Listview_recup_form_param(idListe,base_url); base_url = Listview_removeParam(base_url,'Listview['+encodeURIComponent(idListe)+'][orderBy]'); - + base_url = Listview_removeParam(base_url,'get-all-for-export'); - + document.location.href=Listview_modifyUrl(base_url,"Listview["+encodeURIComponent(idListe)+"][orderBy]["+encodeURIComponent(column)+"]","ASC"); } function Listview_modifyUrl(strURL,paramName,paramNewValue){ if (strURL.indexOf(paramName+'=')!=-1){ - + var strFirstPart=strURL.substring(0,strURL.indexOf(paramName+'=',0))+paramName+'='; var strLastPart=""; if (strURL.indexOf('&',strFirstPart.length-1)>0) @@ -56,55 +56,55 @@ function Listview_modifyUrl(strURL,paramName,paramNewValue){ else strURL+='?'+paramName+'='+paramNewValue; } - + return strURL; } function Listview_removeParam(strURL, paramMask) { var cpt=0; var url = ''; - + while(strURL.indexOf(paramMask)!=-1 && cpt++ <50){ var strFirstPart= strURL.substring(0,strURL.indexOf(paramMask)-1); - + var strLastPart=''; if (strURL.indexOf('&',strFirstPart.length+1)>0) { - strLastPart = strURL.substring(strURL.indexOf('&',strFirstPart.length+1),strURL.length); + strLastPart = strURL.substring(strURL.indexOf('&',strFirstPart.length+1),strURL.length); } - + url = strFirstPart+strLastPart; - + } - + if(url=='')url = strURL; - + return url; } function Listview_recup_form_param(idListe,base_url) { - + $('#'+idListe+' tr.barre-recherche [listviewtbs],#'+idListe+' tr.barre-recherche-head input,#'+idListe+' tr.barre-recherche-head select,#'+idListe+' div.tabsAction input[listviewtbs]').each(function(i,item) { if($(item).attr("name")) { base_url = Listview_modifyUrl(base_url, $(item).attr("name") , $(item).val()); } - + }); - + return base_url; } function Listview_GoToPage(idListe,pageNumber){ - + var base_url = document.location.href; - + base_url = Listview_recup_form_param(idListe,base_url); base_url =Listview_modifyUrl(base_url,"Listview["+encodeURIComponent(idListe)+"][page]",pageNumber); - + base_url = Listview_removeParam(base_url,'get-all-for-export'); - + document.location.href=base_url; } function Listview_submitSearch(obj) { - + $form = $(obj).closest('form'); console.log($form); if($form.length>0){ @@ -113,20 +113,20 @@ function Listview_submitSearch(obj) { } function Listview_launch_downloadAs(mode,url,token,session_name) { $('#listviewdAS_export_form').remove(); - + $form = $('
'); $form.append(''); $form.append(''); $form.append(''); - + $('body').append($form); - + $('#listviewdAS_export_form').submit(); - + } function Listview_downloadAs(obj, mode,url,token,session_name) { - + $form = $(obj).closest('form'); $div = $form.find('div.tabsAction'); $div.append(''); @@ -134,33 +134,33 @@ function Listview_downloadAs(obj, mode,url,token,session_name) { $div.append(''); $div.append(''); $div.append(''); - + Listview_submitSearch(obj); } $(document).ready(function() { $('tr.barre-recherche input').keypress(function(e) { if(e.which == 13) { - + var id_list = $(this).closest('table').attr('id'); - + $('#'+id_list+' .list-search-link').click(); - + } }); - + var $_GET = {}; - + document.location.search.replace(/\??(?:([^=]+)=([^&]*)&?)/g, function () { function decode(s) { return decodeURIComponent(s.split("+").join(" ")); } - + $_GET[decode(arguments[1])] = decode(arguments[2]); }); - + if(typeof $_GET["get-all-for-export"] != "undefined") { Listview_launch_downloadAs($_GET['mode'],$_GET['url'],$_GET['token'],$_GET['session_name']); } - + }); diff --git a/htdocs/core/js/timesheet.js b/htdocs/core/js/timesheet.js index de8b24af96c..44180b42acb 100644 --- a/htdocs/core/js/timesheet.js +++ b/htdocs/core/js/timesheet.js @@ -24,9 +24,9 @@ function regexEvent(objet,evt,type) { case 'days': var regex= /^[0-9]{1}([.,]{1}[0-9]{1})?$/; - + if(regex.test(objet.value) ) - { + { var tmp=objet.value.replace(',','.'); if(tmp<=1.5){ var tmpint=parseInt(tmp); @@ -41,13 +41,13 @@ function regexEvent(objet,evt,type) }else{ objet.value= '0'; } - break; + break; case 'hours': var regex= /^[0-9]{1,2}:[0-9]{2}$/; var regex2=/^[0-9]{1,2}$/; var regex3= /^[0-9]{1}([.,]{1}[0-9]{1,2})?$/; if(!regex.test(objet.value)) - { + { if(regex2.test(objet.value)) objet.value=objet.value+':00'; else if(regex3.test(objet.value)) { @@ -63,25 +63,25 @@ function regexEvent(objet,evt,type) //var regex= /^[0-9:]{1}$/; //alert(event.charCode); var charCode = (evt.which) ? evt.which : event.keyCode; - + if(((charCode >= 48) && (charCode <= 57)) || //num (charCode===46) || (charCode===8)||// comma & periode (charCode === 58) || (charCode==44) )// : & all charcode { // ((charCode>=96) && (charCode<=105)) || //numpad return true; - + }else { return false; } - - break; + + break; default: break; } -} - +} + function pad(n) { return (n < 10) ? ("0" + n) : n; @@ -95,7 +95,7 @@ function parseTime(timeStr, dt) if (!dt) { dt = new Date(); } - + var time = timeStr.match(/(\d+)(?::(\d\d))?\s*(p?)/i); if (!time) { return -1; @@ -107,7 +107,7 @@ function parseTime(timeStr, dt) else { hours += (hours < 12 && time[3]) ? 12 : 0; } - + dt.setHours(hours); dt.setMinutes(parseInt(time[2], 10) || 0); dt.setSeconds(0, 0); @@ -122,10 +122,10 @@ function updateTotal(days,mode) { var total = new Date(0); total.setHours(0); - total.setMinutes(0); + total.setMinutes(0); var nbline = document.getElementById('numberOfLines').value; for (var i=-1; i