From 9ec349f4103c13670be8994a45268f47ad0fba2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 1 Sep 2015 10:56:55 +0200 Subject: [PATCH 1/7] FIX [ bug #3432 ] Spaces should be removed from IBAN when formatting it Close #3432 --- ChangeLog | 1 + htdocs/core/lib/pdf.lib.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f62facbdc36..6886a87017f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,7 @@ FIX: Not showing task extrafields when creating from left menu FIX [ bug #3288 ] Tasks box is not properly drawn FIX [ bug #3211 ] Outstading bill amount of a client showed wrong amounts FIX [ bug #3321 ] Users with certain permissions were shown a "forbidden access" page even if they had the rights +FIX [ bug #3432 ] Spaces should be removed from IBAN when formatting it NEW: Created new ContratLigne::insert function diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 794ba7ac2af..326d9e7d24f 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -631,7 +631,8 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default if ($account->getCountryCode() == 'IN') $ibankey="IFSC"; if (! empty($account->iban)) { - $ibanDisplay_temp = $outputlangs->convToOutputCharset($account->iban); + //Remove whitespaces to ensure we are dealing with the format we expect + $ibanDisplay_temp = str_replace(' ', '', $outputlangs->convToOutputCharset($account->iban)); $ibanDisplay = ""; for($i = 0; $i < dol_strlen($ibanDisplay_temp); $i++) From c4f9bde14d78244b949143bee76f4ac4864cbc5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 1 Sep 2015 11:09:37 +0200 Subject: [PATCH 2/7] FIX [ bug #3431 ] Invoice bank account is not respected Close #3431 --- ChangeLog | 1 + htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f62facbdc36..605e19be781 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,7 @@ FIX: Not showing task extrafields when creating from left menu FIX [ bug #3288 ] Tasks box is not properly drawn FIX [ bug #3211 ] Outstading bill amount of a client showed wrong amounts FIX [ bug #3321 ] Users with certain permissions were shown a "forbidden access" page even if they had the rights +FIX [ bug #3431 ] Invoice bank account is not respected NEW: Created new ContratLigne::insert function diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 6d1f5636b85..df98beaaad3 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -868,9 +868,9 @@ class pdf_crabe extends ModelePDFFactures // If payment mode not forced or forced to VIR, show payment with BAN if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR') { - if (! empty($object->fk_bank) || ! empty($conf->global->FACTURE_RIB_NUMBER)) + if (! empty($object->fk_account) || ! empty($conf->global->FACTURE_RIB_NUMBER)) { - $bankid=(empty($object->fk_bank)?$conf->global->FACTURE_RIB_NUMBER:$object->fk_bank); + $bankid=(empty($object->fk_account)?$conf->global->FACTURE_RIB_NUMBER:$object->fk_account); $account = new Account($this->db); $account->fetch($bankid); From 3134950dbea66387d859597c69641388eab45110 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 1 Sep 2015 11:19:05 +0200 Subject: [PATCH 3/7] FIX [ bug #3383 ] Company name is overlapped with company direction in PDF models Close #3383 --- ChangeLog | 1 + htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 4 +++- htdocs/core/modules/commande/doc/pdf_proforma.modules.php | 4 +++- htdocs/core/modules/contract/doc/pdf_strato.modules.php | 4 +++- htdocs/core/modules/expedition/doc/pdf_merou.modules.php | 8 +++++--- htdocs/core/modules/expedition/doc/pdf_rouget.modules.php | 4 +++- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 6 ++++-- htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php | 4 +++- htdocs/core/modules/livraison/doc/pdf_typhon.modules.php | 4 +++- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 4 +++- .../modules/supplier_invoice/pdf/pdf_canelle.modules.php | 4 +++- .../modules/supplier_order/pdf/pdf_muscadet.modules.php | 4 +++- 12 files changed, 37 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index f62facbdc36..8d74943b05b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,7 @@ FIX: Not showing task extrafields when creating from left menu FIX [ bug #3288 ] Tasks box is not properly drawn FIX [ bug #3211 ] Outstading bill amount of a client showed wrong amounts FIX [ bug #3321 ] Users with certain permissions were shown a "forbidden access" page even if they had the rights +FIX [ bug #3383 ] Company name is overlapped with company direction in PDF models NEW: Created new ContratLigne::insert function diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index cbe711ab7df..9365f4a96bd 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -1259,9 +1259,11 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetFont('','B', $default_font_size); $pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L'); + $posy = $pdf->getY(); + // Show recipient information $pdf->SetFont('','', $default_font_size - 1); - $pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($carac_client_name,50)*4)); + $pdf->SetXY($posx+2,$posy); $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L'); } diff --git a/htdocs/core/modules/commande/doc/pdf_proforma.modules.php b/htdocs/core/modules/commande/doc/pdf_proforma.modules.php index 2b8aaa21818..670870421cb 100644 --- a/htdocs/core/modules/commande/doc/pdf_proforma.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_proforma.modules.php @@ -1219,9 +1219,11 @@ class pdf_proforma extends ModelePDFCommandes $pdf->SetFont('','B', $default_font_size); $pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L'); + $posy = $pdf->getY(); + // Show recipient information $pdf->SetFont('','', $default_font_size - 1); - $pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($carac_client_name,50)*4)); + $pdf->SetXY($posx+2,$posy); $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L'); } diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index f9ad83b944d..60636e0db2f 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -647,9 +647,11 @@ class pdf_strato extends ModelePDFContract $pdf->SetFont('','B', $default_font_size); $pdf->MultiCell($widthrecbox, 4, $this->recipient->name, 0, 'L'); + $posy = $pdf->getY(); + // Show recipient information $pdf->SetFont('','', $default_font_size - 1); - $pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($this->recipient->name,50)*4)); + $pdf->SetXY($posx+2,$posy); $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L'); } } diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index 312e8bc5e1f..c424d7a2ae3 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -652,9 +652,11 @@ class pdf_merou extends ModelePdfExpedition $pdf->SetXY($blDestX,$Yoff); $pdf->MultiCell($blW,3, $carac_client_name, 0, 'L'); + $posy = $pdf->getY(); + // Show recipient information - $pdf->SetFont('','', $default_font_size - 3); - $pdf->SetXY($blDestX,$Yoff+(dol_nboflines_bis($carac_client_name,50)*4)); - $pdf->MultiCell($blW,2, $carac_client, 0, 'L'); + $pdf->SetFont('','', $default_font_size - 1); + $pdf->SetXY($posx+2,$posy); + $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L'); } } diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 847cf98aa36..25651ebc1a7 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -674,9 +674,11 @@ class pdf_rouget extends ModelePdfExpedition $pdf->SetFont('','B', $default_font_size); $pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L'); + $posy = $pdf->getY(); + // Show recipient information $pdf->SetFont('','', $default_font_size - 1); - $pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($carac_client_name,50)*4)); + $pdf->SetXY($posx+2,$posy); $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L'); } diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 6d1f5636b85..24bfca0969a 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1506,11 +1506,13 @@ class pdf_crabe extends ModelePDFFactures // Show recipient name $pdf->SetXY($posx+2,$posy+3); $pdf->SetFont('','B', $default_font_size); - $pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L'); + $pdf->MultiCell($widthrecbox, 2, $carac_client_name, 0, 'L'); + + $posy = $pdf->getY(); // Show recipient information $pdf->SetFont('','', $default_font_size - 1); - $pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($carac_client_name,50)*4)); + $pdf->SetXY($posx+2,$posy); $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L'); } diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 9f2bf42c98d..80f4b4fc3ec 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -643,9 +643,11 @@ class pdf_soleil extends ModelePDFFicheinter $pdf->SetFont('','B', $default_font_size); $pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L'); + $posy = $pdf->getY(); + // Show recipient information $pdf->SetFont('','', $default_font_size - 1); - $pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($carac_client_name,50)*4)); + $pdf->SetXY($posx+2,$posy); $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L'); } } diff --git a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php index e3e9be99411..365fbef4cdf 100644 --- a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php @@ -854,9 +854,11 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->SetFont('','B', $default_font_size); $pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L'); + $posy = $pdf->getY(); + // Show recipient information $pdf->SetFont('','', $default_font_size - 1); - $pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($carac_client_name,50)*4)); + $pdf->SetXY($posx+2,$posy); $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L'); } diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index daf6dfd7f37..b15f5059eb4 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1389,9 +1389,11 @@ class pdf_azur extends ModelePDFPropales $pdf->SetFont('','B', $default_font_size); $pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L'); + $posy = $pdf->getY(); + // Show recipient information $pdf->SetFont('','', $default_font_size - 1); - $pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($carac_client_name,50)*4)); + $pdf->SetXY($posx+2,$posy); $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L'); } diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index effd8d58dbc..03256fbc9ee 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -1044,9 +1044,11 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->SetFont('','B', $default_font_size); $pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L'); + $posy = $pdf->getY(); + // Show recipient information $pdf->SetFont('','', $default_font_size - 1); - $pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($carac_client_name,50)*4)); + $pdf->SetXY($posx+2,$posy); $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L'); } } diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index f814eaefb46..a20971fa181 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -1098,9 +1098,11 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetFont('','B', $default_font_size); $pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L'); + $posy = $pdf->getY(); + // Show recipient information $pdf->SetFont('','', $default_font_size - 1); - $pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($carac_client_name,50)*4)); + $pdf->SetXY($posx+2,$posy); $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L'); } } From 216827b1d823f9cb9de588590f3c94b0e4031d5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 1 Sep 2015 11:26:59 +0200 Subject: [PATCH 4/7] FIX [ bug #3358 ] Tasks box does not work with PostgreSQL Close #358 --- ChangeLog | 1 + htdocs/core/boxes/box_task.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f62facbdc36..6464517b1ba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,7 @@ FIX: Not showing task extrafields when creating from left menu FIX [ bug #3288 ] Tasks box is not properly drawn FIX [ bug #3211 ] Outstading bill amount of a client showed wrong amounts FIX [ bug #3321 ] Users with certain permissions were shown a "forbidden access" page even if they had the rights +FIX [ bug #3358 ] Tasks box does not work with PostgreSQL NEW: Created new ContratLigne::insert function diff --git a/htdocs/core/boxes/box_task.php b/htdocs/core/boxes/box_task.php index b0070e2a4f3..815db7daefb 100644 --- a/htdocs/core/boxes/box_task.php +++ b/htdocs/core/boxes/box_task.php @@ -80,7 +80,7 @@ class box_task extends ModeleBoxes $sql = "SELECT pt.fk_statut, count(pt.rowid) as nb, sum(ptt.task_duration) as durationtot, sum(pt.planned_workload) as plannedtot"; $sql.= " FROM ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."projet_task_time as ptt"; - $sql.= " WHERE DATE_FORMAT(pt.datec,'%Y') = ".date("Y")." "; + $sql.= " WHERE DATE_FORMAT(pt.datec,'%Y') = '".date("Y")."' "; $sql.= " AND pt.rowid = ptt.fk_task"; $sql.= " GROUP BY pt.fk_statut "; $sql.= " ORDER BY pt.fk_statut DESC"; From 8bf093a7ce38584072701a3ada62d96afb8dfb41 Mon Sep 17 00:00:00 2001 From: philippe grand Date: Thu, 3 Sep 2015 12:12:10 +0200 Subject: [PATCH 5/7] fix : Typo --- htdocs/core/modules/modHoliday.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modHoliday.class.php b/htdocs/core/modules/modHoliday.class.php index e45b40a3f57..bacbd28141b 100644 --- a/htdocs/core/modules/modHoliday.class.php +++ b/htdocs/core/modules/modHoliday.class.php @@ -141,7 +141,7 @@ class modHoliday extends DolibarrModules $r++; $this->rights[$r][0] = 20002; // Permission id (must not be already used) - $this->rights[$r][1] = 'Create/modify hollidays for everybody'; // Permission label + $this->rights[$r][1] = 'Create/modify holidays for everybody'; // Permission label $this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][4] = 'write_all'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) $this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) From 2d5331b8f860e3cc03b8b57d3f1d37abce7633da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 1 Sep 2015 16:25:34 +0200 Subject: [PATCH 6/7] FIX [ #3460 ] Selected bank account was not saved when an error happened when trying to create a customer invoice Close #3460 --- ChangeLog | 1 + htdocs/compta/facture.php | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index cf99ec9012f..e70e48a493a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -22,6 +22,7 @@ FIX [ bug #3288 ] Tasks box is not properly drawn FIX [ bug #3211 ] Outstading bill amount of a client showed wrong amounts FIX [ bug #3321 ] Users with certain permissions were shown a "forbidden access" page even if they had the rights FIX [ bug #3426 ] Unable to create an invoice from a contract with extrafields +FIX [ bug #3460 ] Bank account is not saved when creating a customer invoice and facing an error message NEW: Created new ContratLigne::insert function diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index b360f6b6315..dc04004653f 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -2121,6 +2121,10 @@ if ($action == 'create') print ''; // Bank Account + if (isset($_POST['fk_account'])) { + $fk_account = $_POST['fk_account']; + } + print '' . $langs->trans('BankAccount') . ''; $form->select_comptes($fk_account, 'fk_account', 0, '', 1); print ''; From fed70b1376d640ff8a2e16eb1764971c7e9bcc06 Mon Sep 17 00:00:00 2001 From: philippe grand Date: Thu, 3 Sep 2015 12:57:57 +0200 Subject: [PATCH 7/7] translation missing --- htdocs/holiday/card.php | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index bbffe26cf9c..c887c111ed2 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -51,12 +51,12 @@ $now=dol_now(); * Actions */ -// Si création de la demande +// If create a request if ($action == 'create') { $cp = new Holiday($db); - // Si pas le droit de créer une demande + // If no right to create a request if (($userid == $user->id && empty($user->rights->holiday->write)) || ($userid != $user->id && empty($user->rights->holiday->write_all))) { $error++; @@ -81,21 +81,21 @@ if ($action == 'create') $description = trim(GETPOST('description')); $userID = GETPOST('userID'); - // Si pas de date de début + // If no start date if (empty($date_debut)) { header('Location: card.php?action=request&error=nodatedebut'); exit; } - // Si pas de date de fin + // If no end date if (empty($date_fin)) { header('Location: card.php?action=request&error=nodatefin'); exit; } - // Si date de début après la date de fin + // If start date after end date if ($date_debut > $date_fin) { header('Location: card.php?action=request&error=datefin'); @@ -110,7 +110,7 @@ if ($action == 'create') exit; } - // Si aucun jours ouvrés dans la demande + // If there is no Business Days within request $nbopenedday=num_open_day($date_debut_gmt, $date_fin_gmt, 0, 1, $halfday); if($nbopenedday < 0.5) { @@ -118,7 +118,7 @@ if ($action == 'create') exit; } - // Si pas de validateur choisi + // If no validator designated if ($valideur < 1) { header('Location: card.php?action=request&error=Valideur'); @@ -134,7 +134,7 @@ if ($action == 'create') $verif = $cp->create($userid); - // Si pas d'erreur SQL on redirige vers la fiche de la demande + // If no SQL error we redirect to the request card if ($verif > 0) { header('Location: card.php?id='.$verif); @@ -142,7 +142,7 @@ if ($action == 'create') } else { - // Sinon on affiche le formulaire de demande avec le message d'erreur SQL + // Otherwise we display the request form with the SQL error message header('Location: card.php?action=request&error=SQL_Create&msg='.$cp->error); exit; } @@ -162,7 +162,7 @@ if ($action == 'update') else if ($starthalfday == 'afternoon') $halfday=-1; else if ($endhalfday == 'morning') $halfday=1; - // Si pas le droit de modifier une demande + // If no right to modify a request if (! $user->rights->holiday->write) { header('Location: card.php?action=request&error=CantUpdate'); @@ -174,40 +174,40 @@ if ($action == 'update') $canedit=(($user->id == $cp->fk_user && $user->rights->holiday->write) || ($user->id != $cp->fk_user && $user->rights->holiday->write_all)); - // Si en attente de validation + // If under validation if ($cp->statut == 1) { - // Si c'est le créateur ou qu'il a le droit de tout lire / modifier + // If this is the requestor or has read/write rights if ($canedit) { $valideur = $_POST['valideur']; $description = trim($_POST['description']); - // Si pas de date de début + // If no start date if (empty($_POST['date_debut_'])) { header('Location: card.php?id='.$_POST['holiday_id'].'&action=edit&error=nodatedebut'); exit; } - // Si pas de date de fin + // If no end date if (empty($_POST['date_fin_'])) { header('Location: card.php?id='.$_POST['holiday_id'].'&action=edit&error=nodatefin'); exit; } - // Si date de début après la date de fin + // If start date after end date if ($date_debut > $date_fin) { header('Location: card.php?id='.$_POST['holiday_id'].'&action=edit&error=datefin'); exit; } - // Si pas de valideur choisi + // If no validator designated if ($valideur < 1) { header('Location: card.php?id='.$_POST['holiday_id'].'&action=edit&error=Valideur'); exit; } - // Si pas de jours ouvrés dans la demande + // If there is no Business Days within request $nbopenedday=num_open_day($date_debut_gmt, $date_fin_gmt, 0, 1, $halfday); if ($nbopenedday < 0.5) { @@ -230,7 +230,7 @@ if ($action == 'update') } else { - // Sinon on affiche le formulaire de demande avec le message d'erreur SQL + // Otherwise we display the request form with the SQL error message header('Location: card.php?id='.$_POST['holiday_id'].'&action=edit&error=SQL_Create&msg='.$cp->error); exit; } @@ -241,7 +241,7 @@ if ($action == 'update') } } -// Si suppression de la demande +// If delete of request if ($action == 'confirm_delete' && GETPOST('confirm') == 'yes') { if($user->rights->holiday->delete) @@ -255,7 +255,7 @@ if ($action == 'confirm_delete' && GETPOST('confirm') == 'yes') $canedit=(($user->id == $cp->fk_user && $user->rights->holiday->write) || ($user->id != $cp->fk_user && $user->rights->holiday->write_all)); - // Si c'est bien un brouillon + // If this is a rough draft if ($cp->statut == 1 || $cp->statut == 3) { // Si l'utilisateur à le droit de lire cette demande, il peut la supprimer