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;
|
||||
|
||||
// Check parameters
|
||||
if ($actioncomm->type_code == 'AC_RDV' && ($datep == '' || $datef == ''))
|
||||
if ($actioncomm->type_code == 'AC_RDV' && ($datep == '' || ($datef == '' && empty($fulldayevent))))
|
||||
{
|
||||
$error++;
|
||||
$action = 'create';
|
||||
|
||||
@@ -72,7 +72,16 @@ class Holiday extends CommonObject
|
||||
function __construct($db)
|
||||
{
|
||||
$this->db = $db;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* updateSold
|
||||
*
|
||||
* @return int Return 1
|
||||
*/
|
||||
function updateSold()
|
||||
{
|
||||
// Mets à jour les congés payés en début de mois
|
||||
$this->updateSoldeCP();
|
||||
|
||||
@@ -81,7 +90,6 @@ class Holiday extends CommonObject
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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 != 2) $result.=$lien.$this->ref.$lienfin;
|
||||
return $result;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -861,15 +870,17 @@ class Holiday extends CommonObject
|
||||
// Mois actuel
|
||||
$month = date('m',$now);
|
||||
$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
|
||||
if ($month != $monthLastUpdate)
|
||||
{
|
||||
$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'";
|
||||
|
||||
dol_syslog(get_class($this).'::updateSoldeCP sql='.$sql);
|
||||
$result = $this->db->query($sql);
|
||||
|
||||
// On ajoute x jours à chaque utilisateurs
|
||||
|
||||
@@ -50,7 +50,7 @@ $sql.= " WHERE name = 'userGroup'";
|
||||
$result = $db->query($sql);
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
if ($obj->value == null)
|
||||
if ($obj->value == null || $obj->value < 0)
|
||||
{
|
||||
llxHeader('',$langs->trans('CPTitreMenu'));
|
||||
|
||||
|
||||
@@ -73,6 +73,9 @@ $search_statut = GETPOST('select_statut');
|
||||
$holiday = new Holiday($db);
|
||||
$holidaystatic=new Holiday($db);
|
||||
|
||||
// Update sold
|
||||
$holiday->updateSold();
|
||||
|
||||
$max_year = 5;
|
||||
$min_year = 10;
|
||||
$filter='';
|
||||
|
||||
@@ -85,7 +85,7 @@ CountryDM=Dominica
|
||||
CountryDO=República Dominicana
|
||||
CountryEC=Ecuador
|
||||
CountryEG=Egipto
|
||||
CountrySV=Salvador
|
||||
CountrySV=El Salvador
|
||||
CountryGQ=Guinea Ecuatorial
|
||||
CountryER=Eritrea
|
||||
CountryEE=Estonia
|
||||
|
||||
@@ -324,9 +324,7 @@ if ($action == 'update' && ! $_POST["cancel"])
|
||||
$object->firstname = GETPOST("prenom");
|
||||
$object->login = GETPOST("login");
|
||||
$object->pass = GETPOST("password");
|
||||
if($user->admin == 1) { // A user can only be set admin by an admin
|
||||
$object->admin = GETPOST("admin");
|
||||
}
|
||||
$object->admin = empty($user->admin)?0:GETPOST("admin"); // A user can only be set admin by an admin
|
||||
$object->office_phone=GETPOST("office_phone");
|
||||
$object->office_fax = GETPOST("office_fax");
|
||||
$object->user_mobile= GETPOST("user_mobile");
|
||||
|
||||
Reference in New Issue
Block a user