Merge pull request #4362 from Dolibarr/revert-4354-patch-1
Revert "Debug of module leave requests "
This commit is contained in:
commit
36df5a7325
@ -356,7 +356,7 @@ if ($action == 'confirm_send')
|
|||||||
if ($cp->getConfCP('AlertValidatorSolde'))
|
if ($cp->getConfCP('AlertValidatorSolde'))
|
||||||
{
|
{
|
||||||
$nbopenedday=num_open_day($cp->date_debut_gmt,$cp->date_fin_gmt,0,1,$cp->halfday);
|
$nbopenedday=num_open_day($cp->date_debut_gmt,$cp->date_fin_gmt,0,1,$cp->halfday);
|
||||||
if ($nbopenedday > $cp->getCPforUser($cp->fk_user, $cp->fk_type))
|
if ($nbopenedday > $cp->getCPforUser($cp->fk_user))
|
||||||
{
|
{
|
||||||
$message.= "\n";
|
$message.= "\n";
|
||||||
$message.= $langs->transnoentities("HolidaysToValidateAlertSolde")."\n";
|
$message.= $langs->transnoentities("HolidaysToValidateAlertSolde")."\n";
|
||||||
@ -413,14 +413,14 @@ if ($action == 'confirm_valid')
|
|||||||
// Calculcate number of days consummed
|
// Calculcate number of days consummed
|
||||||
$nbopenedday=num_open_day($cp->date_debut_gmt,$cp->date_fin_gmt,0,1,$cp->halfday);
|
$nbopenedday=num_open_day($cp->date_debut_gmt,$cp->date_fin_gmt,0,1,$cp->halfday);
|
||||||
|
|
||||||
$soldeActuel = $cp->getCpforUser($cp->fk_user, $cp->fk_type);
|
$soldeActuel = $cp->getCpforUser($cp->fk_user);
|
||||||
$newSolde = $soldeActuel - ($nbopenedday * $cp->getConfCP('nbHolidayDeducted'));
|
$newSolde = $soldeActuel - ($nbopenedday * $cp->getConfCP('nbHolidayDeducted'));
|
||||||
|
|
||||||
// On ajoute la modification dans le LOG
|
// On ajoute la modification dans le LOG
|
||||||
$cp->addLogCP($user->id, $cp->fk_user, $langs->transnoentitiesnoconv("Holidays"), $newSolde, $cp->fk_type);
|
$cp->addLogCP($user->id, $cp->fk_user, $langs->transnoentitiesnoconv("Holidays"), $newSolde);
|
||||||
|
|
||||||
// Mise à jour du solde
|
// Mise à jour du solde
|
||||||
$cp->updateSoldeCP($cp->fk_user, $newSolde, $cp->fk_type);
|
$cp->updateSoldeCP($cp->fk_user, $newSolde);
|
||||||
|
|
||||||
// To
|
// To
|
||||||
$destinataire = new User($db);
|
$destinataire = new User($db);
|
||||||
@ -578,14 +578,14 @@ if ($action == 'confirm_cancel' && GETPOST('confirm') == 'yes')
|
|||||||
// Calculcate number of days consummed
|
// Calculcate number of days consummed
|
||||||
$nbopenedday=num_open_day($cp->date_debut_gmt,$cp->date_fin_gmt,0,1,$cp->halfday);
|
$nbopenedday=num_open_day($cp->date_debut_gmt,$cp->date_fin_gmt,0,1,$cp->halfday);
|
||||||
|
|
||||||
$soldeActuel = $cp->getCpforUser($cp->fk_user, $cp->fk_type);
|
$soldeActuel = $cp->getCpforUser($cp->fk_user);
|
||||||
$newSolde = $soldeActuel + ($nbopenedday * $cp->getConfCP('nbHolidayDeducted'));
|
$newSolde = $soldeActuel + ($nbopenedday * $cp->getConfCP('nbHolidayDeducted'));
|
||||||
|
|
||||||
// On ajoute la modification dans le LOG
|
// On ajoute la modification dans le LOG
|
||||||
$result1=$cp->addLogCP($user->id, $cp->fk_user, $langs->transnoentitiesnoconv("HolidaysCancelation"), $newSolde, $cp->fk_type);
|
$result1=$cp->addLogCP($user->id, $cp->fk_user, $langs->transnoentitiesnoconv("HolidaysCancelation"), $newSolde);
|
||||||
|
|
||||||
// Mise à jour du solde
|
// Mise à jour du solde
|
||||||
$result2=$cp->updateSoldeCP($cp->fk_user, $newSolde, $cp->fk_type);
|
$result2=$cp->updateSoldeCP($cp->fk_user, $newSolde);
|
||||||
|
|
||||||
if ($result1 < 0 || $result2 < 0)
|
if ($result1 < 0 || $result2 < 0)
|
||||||
{
|
{
|
||||||
@ -618,7 +618,7 @@ if ($action == 'confirm_cancel' && GETPOST('confirm') == 'yes')
|
|||||||
|
|
||||||
// From
|
// From
|
||||||
$expediteur = new User($db);
|
$expediteur = new User($db);
|
||||||
$expediteur->fetch($cp->fk_user_cancel);
|
$expediteur->fetch($cp->fk_validator);
|
||||||
$emailFrom = $expediteur->email;
|
$emailFrom = $expediteur->email;
|
||||||
|
|
||||||
// Subject
|
// Subject
|
||||||
|
|||||||
@ -819,11 +819,12 @@ class Holiday extends CommonObject
|
|||||||
* @param int $fk_type Filter on type
|
* @param int $fk_type Filter on type
|
||||||
* @return string retourne la valeur du paramètre
|
* @return string retourne la valeur du paramètre
|
||||||
*/
|
*/
|
||||||
function getConfCP($name)
|
function getConfCP($name, $fk_type=0)
|
||||||
{
|
{
|
||||||
$sql = "SELECT value";
|
$sql = "SELECT value";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."holiday_config";
|
$sql.= " FROM ".MAIN_DB_PREFIX."holiday_config";
|
||||||
$sql.= " WHERE name = '".$name."'";
|
$sql.= " WHERE name = '".$name."'";
|
||||||
|
if ($fk_type > 0) $sql.=" AND fk_type = ".$fk_type;
|
||||||
|
|
||||||
dol_syslog(get_class($this).'::getConfCP name='.$name.'', LOG_DEBUG);
|
dol_syslog(get_class($this).'::getConfCP name='.$name.'', LOG_DEBUG);
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
|
|||||||
@ -26,7 +26,6 @@ MenuConfCP=Edit balance of leaves
|
|||||||
UpdateAllCP=Update the leaves
|
UpdateAllCP=Update the leaves
|
||||||
SoldeCPUser=Leaves balance is <b>%s</b> days.
|
SoldeCPUser=Leaves balance is <b>%s</b> days.
|
||||||
ErrorEndDateCP=You must select an end date greater than the start date.
|
ErrorEndDateCP=You must select an end date greater than the start date.
|
||||||
ErrorFieldRequired=This field is required :
|
|
||||||
ErrorSQLCreateCP=An SQL error occurred during the creation:
|
ErrorSQLCreateCP=An SQL error occurred during the creation:
|
||||||
ErrorIDFicheCP=An error has occurred, the leave request does not exist.
|
ErrorIDFicheCP=An error has occurred, the leave request does not exist.
|
||||||
ReturnCP=Return to previous page
|
ReturnCP=Return to previous page
|
||||||
@ -41,7 +40,6 @@ DeleteCP=Delete
|
|||||||
ActionValidCP=Validate
|
ActionValidCP=Validate
|
||||||
ActionRefuseCP=Refuse
|
ActionRefuseCP=Refuse
|
||||||
ActionCancelCP=Cancel
|
ActionCancelCP=Cancel
|
||||||
UpdateButtonCP=Update
|
|
||||||
StatutCP=Status
|
StatutCP=Status
|
||||||
SendToValidationCP=Send to validation
|
SendToValidationCP=Send to validation
|
||||||
TitleDeleteCP=Delete the leave request
|
TitleDeleteCP=Delete the leave request
|
||||||
@ -86,6 +84,7 @@ BoxTitleLastLeaveRequests=Last %s modified leave requests
|
|||||||
HolidaysMonthlyUpdate=Monthly update
|
HolidaysMonthlyUpdate=Monthly update
|
||||||
ManualUpdate=Manual update
|
ManualUpdate=Manual update
|
||||||
HolidaysCancelation=Leave request cancelation
|
HolidaysCancelation=Leave request cancelation
|
||||||
|
|
||||||
## Configuration du Module ##
|
## Configuration du Module ##
|
||||||
ConfCP=Configuration of leave request module
|
ConfCP=Configuration of leave request module
|
||||||
DescOptionCP=Description of the option
|
DescOptionCP=Description of the option
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user