Merge remote-tracking branch 'Upstream/develop' into develop-search
This commit is contained in:
commit
bacf5290d3
@ -63,7 +63,7 @@ class box_actions extends ModeleBoxes
|
||||
if ($user->rights->agenda->myactions->read)
|
||||
{
|
||||
$sql = "SELECT a.id, a.label, a.datep as dp, a.percent as percentage,";
|
||||
$sql.= " ta.code,";
|
||||
$sql.= " ta.code, ta.libelle as type_label,";
|
||||
$sql.= " s.nom as name, s.rowid as socid";
|
||||
$sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm AS ta, ";
|
||||
$sql.= MAIN_DB_PREFIX."actioncomm AS a)";
|
||||
@ -96,7 +96,7 @@ class box_actions extends ModeleBoxes
|
||||
if ($objp->percentage >= 0 && $objp->percentage < 100 && $datelimite < ($now - $delay_warning)) $late=img_warning($langs->trans("Late"));
|
||||
|
||||
//($langs->transnoentities("Action".$objp->code)!=("Action".$objp->code) ? $langs->transnoentities("Action".$objp->code) : $objp->label)
|
||||
$label=$objp->label;
|
||||
$label=empty($objp->label)?$objp->type_label:$objp->label;
|
||||
|
||||
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
|
||||
'logo' => ("action"),
|
||||
|
||||
@ -566,9 +566,10 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode='FR')
|
||||
$nbFerie = 0;
|
||||
|
||||
// Check to ensure we use correct parameters
|
||||
if ((($timestampEnd - $timestampStart) % 86400) != 0) return 'ErrorDates must use same hour and be GMT dates';
|
||||
if ((($timestampEnd - $timestampStart) % 86400) != 0) return 'ErrorDates must use same hours and must be GMT dates';
|
||||
|
||||
while ($timestampStart < $timestampEnd) // Loop end when equals
|
||||
$i=0;
|
||||
while ($timestampStart < $timestampEnd && ($i < 50000)) // Loop end when equals (Test on i is a security loop to avoid infinite loop)
|
||||
{
|
||||
$ferie=false;
|
||||
$countryfound=0;
|
||||
@ -576,7 +577,6 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode='FR')
|
||||
$jour = date("d", $timestampStart);
|
||||
$mois = date("m", $timestampStart);
|
||||
$annee = date("Y", $timestampStart);
|
||||
|
||||
if ($countrycode == 'FR')
|
||||
{
|
||||
$countryfound=1;
|
||||
@ -722,8 +722,10 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode='FR')
|
||||
if ($ferie) $nbFerie++;
|
||||
|
||||
// Increase number of days (on go up into loop)
|
||||
$jour++;
|
||||
$timestampStart=dol_mktime(0,0,0,$mois,$jour,$annee,1); // Generate GMT date for next day
|
||||
$timestampStart=dol_time_plus_duree($timestampStart, 1, 'd');
|
||||
//var_dump($jour.' '.$mois.' '.$annee.' '.$timestampStart);
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
return $nbFerie;
|
||||
@ -764,13 +766,16 @@ function num_between_day($timestampStart, $timestampEnd, $lastday=0)
|
||||
* @param int $inhour 0: return number of days, 1: return number of hours
|
||||
* @param int $lastday We include last day, 0: no, 1:yes
|
||||
* @param int $halfday Tag to define half day when holiday start and end
|
||||
* @param string $countrycode Country code (company country code if not defined)
|
||||
* @return int Number of days or hours
|
||||
*/
|
||||
function num_open_day($timestampStart, $timestampEnd, $inhour=0, $lastday=0, $halfday=0)
|
||||
function num_open_day($timestampStart, $timestampEnd, $inhour=0, $lastday=0, $halfday=0, $country_code='')
|
||||
{
|
||||
global $langs;
|
||||
global $langs,$mysoc;
|
||||
|
||||
dol_syslog('num_open_day timestampStart='.$timestampStart.' timestampEnd='.$timestampEnd.' bit='.$lastday);
|
||||
if (empty($country_code)) $country_code=$mysoc->country_code;
|
||||
|
||||
dol_syslog('num_open_day timestampStart='.$timestampStart.' timestampEnd='.$timestampEnd.' bit='.$lastday.' country_code='.$country_code);
|
||||
|
||||
// Check parameters
|
||||
if (! is_int($timestampStart) && ! is_float($timestampStart)) return 'ErrorBadParameter_num_open_day';
|
||||
@ -779,7 +784,9 @@ function num_open_day($timestampStart, $timestampEnd, $inhour=0, $lastday=0, $ha
|
||||
//print 'num_open_day timestampStart='.$timestampStart.' timestampEnd='.$timestampEnd.' bit='.$lastday;
|
||||
if ($timestampStart < $timestampEnd)
|
||||
{
|
||||
$nbOpenDay = num_between_day($timestampStart, $timestampEnd, $lastday) - num_public_holiday($timestampStart, $timestampEnd, $lastday);
|
||||
$numdays = num_between_day($timestampStart, $timestampEnd, $lastday);
|
||||
$numholidays = num_public_holiday($timestampStart, $timestampEnd, $country_code);
|
||||
$nbOpenDay = $numdays - $numholidays;
|
||||
$nbOpenDay.= " " . $langs->trans("Days");
|
||||
if ($inhour == 1 && $nbOpenDay <= 3) $nbOpenDay = $nbOpenDay*24 . $langs->trans("HourShort");
|
||||
return $nbOpenDay - (($inhour == 1 ? 12 : 0.5) * abs($halfday));
|
||||
|
||||
@ -44,7 +44,7 @@ class modSyncSupplierWebServices extends DolibarrModules
|
||||
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
||||
$this->name = preg_replace('/^mod/i','',get_class($this));
|
||||
$this->description = "Enable the client for external supplier web services";
|
||||
$this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version
|
||||
$this->version = 'experimental'; // 'experimental' or 'dolibarr' or version
|
||||
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
|
||||
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
|
||||
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user