Corrected translation key

This commit is contained in:
Marcos García 2013-04-26 17:19:14 +02:00
parent ed5a00a79d
commit 652e0c1b5f

View File

@ -38,7 +38,7 @@ class Holiday extends CommonObject
var $errors=array(); var $errors=array();
var $rowid; var $rowid;
var $ref; var $ref;
var $fk_user; var $fk_user;
var $date_create=''; var $date_create='';
@ -82,12 +82,12 @@ class Holiday extends CommonObject
*/ */
function updateSold() 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();
// Vérifie le nombre d'utilisateur et mets à jour si besoin // Vérifie le nombre d'utilisateur et mets à jour si besoin
$this->verifNbUsers($this->countActiveUsers(),$this->getConfCP('nbUser')); $this->verifNbUsers($this->countActiveUsers(),$this->getConfCP('nbUser'));
return 1; return 1;
} }
/** /**
@ -364,11 +364,11 @@ class Holiday extends CommonObject
$sql.= " cp.fk_user_cancel,"; $sql.= " cp.fk_user_cancel,";
$sql.= " cp.detail_refuse,"; $sql.= " cp.detail_refuse,";
$sql.= " uu.name as user_lastname,"; $sql.= " uu.name as user_lastname,";
$sql.= " uu.firstname as user_firstname,"; $sql.= " uu.firstname as user_firstname,";
$sql.= " ua.name as validator_lastname,"; $sql.= " ua.name as validator_lastname,";
$sql.= " ua.firstname as validator_firstname"; $sql.= " ua.firstname as validator_firstname";
$sql.= " FROM ".MAIN_DB_PREFIX."holiday as cp, ".MAIN_DB_PREFIX."user as uu, ".MAIN_DB_PREFIX."user as ua"; $sql.= " FROM ".MAIN_DB_PREFIX."holiday as cp, ".MAIN_DB_PREFIX."user as uu, ".MAIN_DB_PREFIX."user as ua";
$sql.= " WHERE cp.fk_user = uu.rowid AND cp.fk_validator = ua.rowid "; // Hack pour la recherche sur le tableau $sql.= " WHERE cp.fk_user = uu.rowid AND cp.fk_validator = ua.rowid "; // Hack pour la recherche sur le tableau
@ -469,7 +469,7 @@ class Holiday extends CommonObject
} else { } else {
$error++; $error++;
} }
$sql.= " halfday = ".$this->halfday.","; $sql.= " halfday = ".$this->halfday.",";
if(!empty($this->statut) && is_numeric($this->statut)) { if(!empty($this->statut) && is_numeric($this->statut)) {
$sql.= " statut = '".$this->statut."',"; $sql.= " statut = '".$this->statut."',";
} else { } else {
@ -611,8 +611,8 @@ class Holiday extends CommonObject
foreach($this->holiday as $infos_CP) foreach($this->holiday as $infos_CP)
{ {
if ($infos_CP['statut'] == 4) continue; // ignore not validated holidays if ($infos_CP['statut'] == 4) continue; // ignore not validated holidays
if ($infos_CP['statut'] == 5) continue; // ignore not validated holidays if ($infos_CP['statut'] == 5) continue; // ignore not validated holidays
// TODO Also use halfday for the check // TODO Also use halfday for the check
if ($dateDebut >= $infos_CP['date_debut'] && $dateDebut <= $infos_CP['date_fin'] || $dateFin <= $infos_CP['date_fin'] && $dateFin >= $infos_CP['date_debut']) if ($dateDebut >= $infos_CP['date_debut'] && $dateDebut <= $infos_CP['date_fin'] || $dateFin <= $infos_CP['date_fin'] && $dateFin >= $infos_CP['date_debut'])
@ -626,42 +626,42 @@ class Holiday extends CommonObject
} }
/** /**
* Return clicable name (with picto eventually) * Return clicable name (with picto eventually)
* *
* @param int $withpicto 0=_No picto, 1=Includes the picto in the linkn, 2=Picto only * @param int $withpicto 0=_No picto, 1=Includes the picto in the linkn, 2=Picto only
* @return string String with URL * @return string String with URL
*/ */
function getNomUrl($withpicto=0) function getNomUrl($withpicto=0)
{ {
global $langs; global $langs;
$result=''; $result='';
$lien = '<a href="'.DOL_URL_ROOT.'/holiday/fiche.php?id='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/holiday/fiche.php?id='.$this->id.'">';
$lienfin='</a>'; $lienfin='</a>';
$picto='holiday'; $picto='holiday';
$label=$langs->trans("Show").': '.$this->ref; $label=$langs->trans("Show").': '.$this->ref;
if ($withpicto) $result.=($lien.img_object($label,$picto).$lienfin); if ($withpicto) $result.=($lien.img_object($label,$picto).$lienfin);
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;
} }
/** /**
* Returns the label status * Returns the label status
* *
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
* @return string Label * @return string Label
*/ */
function getLibStatut($mode=0) function getLibStatut($mode=0)
{ {
return $this->LibStatut($this->statut, $mode, $this->date_debut); return $this->LibStatut($this->statut, $mode, $this->date_debut);
} }
/** /**
* Returns the label of a statut * Returns the label of a statut
@ -683,26 +683,26 @@ class Holiday extends CommonObject
if ($statut == 4) return $langs->trans('CancelCP'); if ($statut == 4) return $langs->trans('CancelCP');
if ($statut == 5) return $langs->trans('RefuseCP'); if ($statut == 5) return $langs->trans('RefuseCP');
} }
if ($mode == 2) if ($mode == 2)
{ {
$pictoapproved='statut6'; $pictoapproved='statut6';
if (! empty($startdate) && $startdate > dol_now()) $pictoapproved='statut4'; if (! empty($startdate) && $startdate > dol_now()) $pictoapproved='statut4';
if ($statut == 1) return img_picto($langs->trans('DraftCP'),'statut0').' '.$langs->trans('DraftCP'); // Draft if ($statut == 1) return img_picto($langs->trans('DraftCP'),'statut0').' '.$langs->trans('DraftCP'); // Draft
if ($statut == 2) return img_picto($langs->trans('ToValidateCP'),'statut1').' '.$langs->trans('ToValidateCP'); // Waiting approval if ($statut == 2) return img_picto($langs->trans('ToValidateCP'),'statut1').' '.$langs->trans('ToValidateCP'); // Waiting approval
if ($statut == 3) return img_picto($langs->trans('ValidateCP'),$pictoapproved).' '.$langs->trans('ValidateCP'); if ($statut == 3) return img_picto($langs->trans('ValidateCP'),$pictoapproved).' '.$langs->trans('ValidateCP');
if ($statut == 4) return img_picto($langs->trans('CancelCP'),'statut5').' '.$langs->trans('CancelCP'); if ($statut == 4) return img_picto($langs->trans('CancelCP'),'statut5').' '.$langs->trans('CancelCP');
if ($statut == 5) return img_picto($langs->trans('RefuseCP'),'statut5').' '.$langs->trans('RefuseCP'); if ($statut == 5) return img_picto($langs->trans('RefuseCP'),'statut5').' '.$langs->trans('RefuseCP');
} }
if ($mode == 5) if ($mode == 5)
{ {
$pictoapproved='statut6'; $pictoapproved='statut6';
if (! empty($startdate) && $startdate > dol_now()) $pictoapproved='statut4'; if (! empty($startdate) && $startdate > dol_now()) $pictoapproved='statut4';
if ($statut == 1) return $langs->trans('DraftCP').' '.img_picto($langs->trans('DraftCP'),'statut0'); // Draft if ($statut == 1) return $langs->trans('DraftCP').' '.img_picto($langs->trans('DraftCP'),'statut0'); // Draft
if ($statut == 2) return $langs->trans('ToValidateCP').' '.img_picto($langs->trans('ToValidateCP'),'statut1'); // Waiting approval if ($statut == 2) return $langs->trans('ToValidateCP').' '.img_picto($langs->trans('ToValidateCP'),'statut1'); // Waiting approval
if ($statut == 3) return $langs->trans('ValidateCP').' '.img_picto($langs->trans('ValidateCP'),$pictoapproved); if ($statut == 3) return $langs->trans('ValidateCP').' '.img_picto($langs->trans('ValidateCP'),$pictoapproved);
if ($statut == 4) return $langs->trans('CancelCP').' '.img_picto($langs->trans('CancelCP'),'statut5'); if ($statut == 4) return $langs->trans('CancelCP').' '.img_picto($langs->trans('CancelCP'),'statut5');
if ($statut == 5) return $langs->trans('RefuseCP').' '.img_picto($langs->trans('RefuseCP'),'statut5'); if ($statut == 5) return $langs->trans('RefuseCP').' '.img_picto($langs->trans('RefuseCP'),'statut5');
} }
return $statut; return $statut;
} }
@ -897,7 +897,7 @@ class Holiday extends CommonObject
$new_solde = $now_holiday + $this->getConfCP('nbHolidayEveryMonth'); $new_solde = $now_holiday + $this->getConfCP('nbHolidayEveryMonth');
// On ajoute la modification dans le LOG // On ajoute la modification dans le LOG
$this->addLogCP($user->id,$users[$i]['rowid'], $langs->trans('Event').': '.$langs->trans('HolidaysMonthlyAssignment'),$new_solde); $this->addLogCP($user->id,$users[$i]['rowid'], $langs->trans('Event').': '.$langs->trans('HolidaysMonthlyUpdate'),$new_solde);
$i++; $i++;
} }