forked from Wavyzz/dolibarr
Merge remote-tracking branch 'origin/3.3' into develop
Conflicts: htdocs/holiday/class/holiday.class.php htdocs/user/fiche.php
This commit is contained in:
@@ -183,7 +183,7 @@ if ($action == 'add_action')
|
|||||||
if (! empty($conf->phenix->enabled) && GETPOST('add_phenix') == 'on') $actioncomm->use_phenix=1;
|
if (! empty($conf->phenix->enabled) && GETPOST('add_phenix') == 'on') $actioncomm->use_phenix=1;
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
if ($actioncomm->type_code == 'AC_RDV' && ($datep == '' || $datef == ''))
|
if ($actioncomm->type_code == 'AC_RDV' && ($datep == '' || ($datef == '' && empty($fulldayevent))))
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
$action = 'create';
|
$action = 'create';
|
||||||
|
|||||||
@@ -72,7 +72,16 @@ class Holiday extends CommonObject
|
|||||||
function __construct($db)
|
function __construct($db)
|
||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* updateSold
|
||||||
|
*
|
||||||
|
* @return int Return 1
|
||||||
|
*/
|
||||||
|
function updateSold()
|
||||||
|
{
|
||||||
// Mets à jour les congés payés en début de mois
|
// Mets à jour les congés payés en début de mois
|
||||||
$this->updateSoldeCP();
|
$this->updateSoldeCP();
|
||||||
|
|
||||||
@@ -81,7 +90,6 @@ class Holiday extends CommonObject
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Créer un congés payés dans la base de données
|
* Créer un congés payés dans la base de données
|
||||||
*
|
*
|
||||||
@@ -641,6 +649,7 @@ class Holiday extends CommonObject
|
|||||||
if ($withpicto && $withpicto != 2) $result.=' ';
|
if ($withpicto && $withpicto != 2) $result.=' ';
|
||||||
if ($withpicto != 2) $result.=$lien.$this->ref.$lienfin;
|
if ($withpicto != 2) $result.=$lien.$this->ref.$lienfin;
|
||||||
return $result;
|
return $result;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -861,15 +870,17 @@ class Holiday extends CommonObject
|
|||||||
// Mois actuel
|
// Mois actuel
|
||||||
$month = date('m',$now);
|
$month = date('m',$now);
|
||||||
$lastUpdate = $this->getConfCP('lastUpdate');
|
$lastUpdate = $this->getConfCP('lastUpdate');
|
||||||
$monthLastUpdate = date('m', $lastUpdate);
|
$monthLastUpdate = $lastUpdate[4].$lastUpdate[5];
|
||||||
|
//print 'month: '.$month.' '.$lastUpdate.' '.$monthLastUpdate;
|
||||||
|
|
||||||
// Si la date du mois n'est pas la même que celle sauvegardée, on met à jour le timestamp
|
// Si la date du mois n'est pas la même que celle sauvegardée, on met à jour le timestamp
|
||||||
if ($month != $monthLastUpdate)
|
if ($month != $monthLastUpdate)
|
||||||
{
|
{
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."holiday_config SET";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."holiday_config SET";
|
||||||
$sql.= " value = '".$this->db->idate($now)."'";
|
$sql.= " value = '".dol_print_date($now,'%Y%m%d%H%M%S')."'";
|
||||||
$sql.= " WHERE name = 'lastUpdate'";
|
$sql.= " WHERE name = 'lastUpdate'";
|
||||||
|
|
||||||
|
dol_syslog(get_class($this).'::updateSoldeCP sql='.$sql);
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
|
|
||||||
// On ajoute x jours à chaque utilisateurs
|
// On ajoute x jours à chaque utilisateurs
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ $sql.= " WHERE name = 'userGroup'";
|
|||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
|
|
||||||
if ($obj->value == null)
|
if ($obj->value == null || $obj->value < 0)
|
||||||
{
|
{
|
||||||
llxHeader('',$langs->trans('CPTitreMenu'));
|
llxHeader('',$langs->trans('CPTitreMenu'));
|
||||||
|
|
||||||
|
|||||||
@@ -73,6 +73,9 @@ $search_statut = GETPOST('select_statut');
|
|||||||
$holiday = new Holiday($db);
|
$holiday = new Holiday($db);
|
||||||
$holidaystatic=new Holiday($db);
|
$holidaystatic=new Holiday($db);
|
||||||
|
|
||||||
|
// Update sold
|
||||||
|
$holiday->updateSold();
|
||||||
|
|
||||||
$max_year = 5;
|
$max_year = 5;
|
||||||
$min_year = 10;
|
$min_year = 10;
|
||||||
$filter='';
|
$filter='';
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ CountryDM=Dominica
|
|||||||
CountryDO=República Dominicana
|
CountryDO=República Dominicana
|
||||||
CountryEC=Ecuador
|
CountryEC=Ecuador
|
||||||
CountryEG=Egipto
|
CountryEG=Egipto
|
||||||
CountrySV=Salvador
|
CountrySV=El Salvador
|
||||||
CountryGQ=Guinea Ecuatorial
|
CountryGQ=Guinea Ecuatorial
|
||||||
CountryER=Eritrea
|
CountryER=Eritrea
|
||||||
CountryEE=Estonia
|
CountryEE=Estonia
|
||||||
|
|||||||
@@ -324,9 +324,7 @@ if ($action == 'update' && ! $_POST["cancel"])
|
|||||||
$object->firstname = GETPOST("prenom");
|
$object->firstname = GETPOST("prenom");
|
||||||
$object->login = GETPOST("login");
|
$object->login = GETPOST("login");
|
||||||
$object->pass = GETPOST("password");
|
$object->pass = GETPOST("password");
|
||||||
if($user->admin == 1) { // A user can only be set admin by an admin
|
$object->admin = empty($user->admin)?0:GETPOST("admin"); // A user can only be set admin by an admin
|
||||||
$object->admin = GETPOST("admin");
|
|
||||||
}
|
|
||||||
$object->office_phone=GETPOST("office_phone");
|
$object->office_phone=GETPOST("office_phone");
|
||||||
$object->office_fax = GETPOST("office_fax");
|
$object->office_fax = GETPOST("office_fax");
|
||||||
$object->user_mobile= GETPOST("user_mobile");
|
$object->user_mobile= GETPOST("user_mobile");
|
||||||
|
|||||||
Reference in New Issue
Block a user