From c3f07dd2e08bd6b8cf67da2b76b1577d98de5014 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 9 Oct 2018 19:28:52 +0200 Subject: [PATCH 01/31] define $code for all execution paths --- htdocs/societe/class/societe.class.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 729995a81d0..de5ce919a64 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1837,24 +1837,28 @@ class Societe extends CommonObject if (! empty($conf->global->SOCIETE_ADD_REF_IN_LIST) && (!empty($withpicto))) { + $code = ''; if (($this->client) && (! empty ( $this->code_client )) && ($conf->global->SOCIETE_ADD_REF_IN_LIST == 1 || $conf->global->SOCIETE_ADD_REF_IN_LIST == 2 ) - ) - $code = $this->code_client . ' - '; + ) { + $code .= $this->code_client . ' - '; + } if (($this->fournisseur) && (! empty ( $this->code_fournisseur )) && ($conf->global->SOCIETE_ADD_REF_IN_LIST == 1 || $conf->global->SOCIETE_ADD_REF_IN_LIST == 3 ) - ) - $code .= $this->code_fournisseur . ' - '; + ) { + $code .= $this->code_fournisseur . ' - '; + } - if ($conf->global->SOCIETE_ADD_REF_IN_LIST == 1) - $name =$code.' '.$name; - else - $name =$code; + if ($conf->global->SOCIETE_ADD_REF_IN_LIST == 1) { + $name = $code.' '.$name; + } else { + $name = $code; + } } if (!empty($this->name_alias)) $name .= ' ('.$this->name_alias.')'; From 8fc4e2066f483965a7811f642c5d0a2e358b4c1f Mon Sep 17 00:00:00 2001 From: jfefe Date: Wed, 10 Oct 2018 18:18:02 +0200 Subject: [PATCH 02/31] FIX : position 0 for emails templates Closes #9548 #8737 #9478 --- htdocs/admin/mails_templates.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 394742c7d2a..206191f5967 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -319,10 +319,11 @@ if (empty($reshook)) if ($i) $sql.=","; $sql.= $field."="; -// print $keycode.' - '.$_POST[$keycode].'
'; - if ($_POST[$keycode] == '' || ($keycode != 'langcode' && $keycode != 'private' && empty($_POST[$keycode]))) $sql.="null"; // lang must be '' if not defined so the unique key that include lang will work - elseif ($_POST[$keycode] == '0' && $keycode == 'langcode') $sql.="''"; // lang must be '' if not defined so the unique key that include lang will work - elseif ($keycode == 'private') $sql.=((int) $_POST[$keycode]); // private must be 0 or 1 + //print $keycode.' - '.$_POST[$keycode].'
'; + if ($_POST[$keycode] == '' || ($keycode != 'langcode' && $keycode != 'position' && $keycode != 'private' && empty($_POST[$keycode]))) $sql.="null"; // lang must be '' if not defined so the unique key that include lang will work + elseif ($_POST[$keycode] == '0' && $keycode == 'langcode') $sql.="''"; // lang must be '' if not defined so the unique key that include lang will work + elseif ($keycode == 'private') $sql.=((int) $_POST[$keycode]); // private must be 0 or 1 + elseif ($keycode == 'position') $sql.=((int) $_POST[$keycode]); else $sql.="'".$db->escape($_POST[$keycode])."'"; $i++; } From ee225a2b8bc7f714e82ac8fb46e3b142a14cc433 Mon Sep 17 00:00:00 2001 From: John BOTELLA Date: Thu, 11 Oct 2018 10:14:22 +0200 Subject: [PATCH 03/31] FIX situation prev percent --- htdocs/compta/facture/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 8834d93d162..bf84114129f 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1535,6 +1535,7 @@ if (empty($reshook)) { $line->origin = $object->origin; $line->origin_id = $line->id; + $line->fk_prev_id = $line->id; $line->fetch_optionals($line->id); $line->situation_percent = $line->get_prev_progress($object->id); // get good progress including credit note From 92686100b23d63c25865e49a4aac01b0d1ad74df Mon Sep 17 00:00:00 2001 From: John BOTELLA Date: Thu, 11 Oct 2018 10:51:54 +0200 Subject: [PATCH 04/31] Fix count on no countable object --- htdocs/compta/facture/card.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 8834d93d162..aeb145a7ea2 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3250,8 +3250,7 @@ if ($action == 'create') print '' . $langs->trans($newclassname) . '' . $objectsrc->getNomUrl(1); // We check if Origin document (id and type is known) has already at least one invoice attached to it $objectsrc->fetchObjectLinked($originid,$origin,'','facture'); - $cntinvoice=count($objectsrc->linkedObjects['facture']); - if ($cntinvoice>=1) + if(!empty($objectsrc->linkedObjects['facture']) && is_array($objectsrc->linkedObjects['facture'])) { setEventMessages('WarningBillExist', null, 'warnings'); echo ' ('.$langs->trans('LatestRelatedBill').end($objectsrc->linkedObjects['facture'])->getNomUrl(1).')'; From ced40384436d3c94e87910cce049c100a31bee49 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 11 Oct 2018 11:56:52 +0200 Subject: [PATCH 05/31] FIX qty not visible for a lot when making shipment on a dedicated stock --- ChangeLog | 2 +- htdocs/core/lib/pdf.lib.php | 2 +- htdocs/core/lib/sendings.lib.php | 2 +- htdocs/expedition/card.php | 19 +++--- htdocs/expedition/class/expedition.class.php | 18 +++--- .../class/expeditionbatch.class.php | 58 +++++++++---------- 6 files changed, 51 insertions(+), 50 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0d1bbfbf379..2449730bf8e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -86,7 +86,7 @@ NEW: Add a tab to specify accountant/auditor of the company NEW: Add Date delivery and Availability on Propals List NEW: Add date in goods reception supplier order table NEW: Add delivery_time_days of suppliers in export profile -NEW: Add Docments'tab to expedition module +NEW: Add Documents'tab to expedition module NEW: Use dol_print_phone in thirdparty list page to format phone NEW: Add entry for the GDPR contact NEW: Add extrafield type "html" diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 671a3d6cbc3..73de27cafac 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1376,7 +1376,7 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl if ($detail->eatby) $dte[]=$outputlangs->transnoentitiesnoconv('printEatby',dol_print_date($detail->eatby, $format, false, $outputlangs)); if ($detail->sellby) $dte[]=$outputlangs->transnoentitiesnoconv('printSellby',dol_print_date($detail->sellby, $format, false, $outputlangs)); if ($detail->batch) $dte[]=$outputlangs->transnoentitiesnoconv('printBatch',$detail->batch); - $dte[]=$outputlangs->transnoentitiesnoconv('printQty',$detail->dluo_qty); + $dte[]=$outputlangs->transnoentitiesnoconv('printQty',$detail->qty); $libelleproduitservice.= "__N__ ".implode(" - ", $dte); } } diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php index 71c287f7119..b79b1d094da 100644 --- a/htdocs/core/lib/sendings.lib.php +++ b/htdocs/core/lib/sendings.lib.php @@ -364,7 +364,7 @@ function show_list_sending_receive($origin,$origin_id,$filter='') $detail.= $langs->trans("Batch").': '.$dbatch->batch; $detail.= ' - '.$langs->trans("SellByDate").': '.dol_print_date($dbatch->sellby,"day"); $detail.= ' - '.$langs->trans("EatByDate").': '.dol_print_date($dbatch->eatby,"day"); - $detail.= ' - '.$langs->trans("Qty").': '.$dbatch->dluo_qty; + $detail.= ' - '.$langs->trans("Qty").': '.$dbatch->qty; $detail.= '
'; } print $form->textwithtooltip(img_picto('', 'object_barcode').' '.$langs->trans("DetailBatchNumber"),$detail); diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 49bded5a45b..0f45ca61804 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -649,7 +649,7 @@ if (empty($reshook)) $qty = "qtyl".$detail_batch->fk_expeditiondet.'_'.$detail_batch->id; $batch_id = GETPOST($batch,'int'); $batch_qty = GETPOST($qty, 'int'); - if (! empty($batch_id) && ($batch_id != $detail_batch->fk_origin_stock || $batch_qty != $detail_batch->dluo_qty)) + if (! empty($batch_id) && ($batch_id != $detail_batch->fk_origin_stock || $batch_qty != $detail_batch->qty)) { if ($lotStock->fetch($batch_id) > 0 && $line->fetch($detail_batch->fk_expeditiondet) > 0) // $line is ExpeditionLine { @@ -666,7 +666,7 @@ if (empty($reshook)) $line->detail_batch->batch = $lotStock->batch; $line->detail_batch->id = $detail_batch->id; $line->detail_batch->entrepot_id = $lotStock->warehouseid; - $line->detail_batch->dluo_qty = $batch_qty; + $line->detail_batch->qty = $batch_qty; if ($line->update($user) < 0) { setEventMessages($line->error, $line->errors, 'errors'); $error++; @@ -720,7 +720,7 @@ if (empty($reshook)) $line->detail_batch->fk_origin_stock = $batch_id; $line->detail_batch->batch = $lotStock->batch; $line->detail_batch->entrepot_id = $lotStock->warehouseid; - $line->detail_batch->dluo_qty = $batch_qty; + $line->detail_batch->qty = $batch_qty; if ($line->update($user) < 0) { setEventMessages($line->error, $line->errors, 'errors'); $error++; @@ -741,7 +741,7 @@ if (empty($reshook)) $line->detail_batch[0]->fk_origin_stock = $batch_id; $line->detail_batch[0]->batch = $lotStock->batch; $line->detail_batch[0]->entrepot_id = $lotStock->warehouseid; - $line->detail_batch[0]->dluo_qty = $batch_qty; + $line->detail_batch[0]->qty = $batch_qty; if ($object->create_line_batch($line, $line->array_options) < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -1306,6 +1306,7 @@ if ($action == 'create') { // Product need lot print ''; // end line and start a new one for lot/serial + print ''; $staticwarehouse=new Entrepot($db); if ($warehouse_id > 0) $staticwarehouse->fetch($warehouse_id); @@ -1323,7 +1324,7 @@ if ($action == 'create') print ''; if (is_object($product->stock_warehouse[$warehouse_id]) && count($product->stock_warehouse[$warehouse_id]->detail_batch)) { - foreach ($product->stock_warehouse[$warehouse_id]->detail_batch as $dbatch) + foreach ($product->stock_warehouse[$warehouse_id]->detail_batch as $dbatch) // $dbatch is instance of Productbatch { //var_dump($dbatch); $batchStock = + $dbatch->qty; // To get a numeric @@ -1344,7 +1345,7 @@ if ($action == 'create') $detail.= $langs->trans("Batch").': '.$dbatch->batch; $detail.= ' - '.$langs->trans("SellByDate").': '.dol_print_date($dbatch->sellby,"day"); $detail.= ' - '.$langs->trans("EatByDate").': '.dol_print_date($dbatch->eatby,"day"); - $detail.= ' - '.$langs->trans("Qty").': '.$dbatch->dluo_qty; + $detail.= ' - '.$langs->trans("Qty").': '.$dbatch->qty; $detail.= '
'; print $detail; @@ -2242,7 +2243,7 @@ else if ($id || $ref) { print ''; // Qty to ship or shipped - print '' . '' . ''; + print '' . '' . ''; // Batch number managment if ($lines[$i]->entrepot_id == 0) { @@ -2354,12 +2355,12 @@ else if ($id || $ref) if ($lines[$i]->product_tobatch) { $detail = ''; - foreach ($lines[$i]->detail_batch as $dbatch) + foreach ($lines[$i]->detail_batch as $dbatch) // $dbatch is instance of ExpeditionLineBatch { $detail.= $langs->trans("Batch").': '.$dbatch->batch; $detail.= ' - '.$langs->trans("SellByDate").': '.dol_print_date($dbatch->sellby,"day"); $detail.= ' - '.$langs->trans("EatByDate").': '.dol_print_date($dbatch->eatby,"day"); - $detail.= ' - '.$langs->trans("Qty").': '.$dbatch->dluo_qty; + $detail.= ' - '.$langs->trans("Qty").': '.$dbatch->qty; $detail.= '
'; } print $form->textwithtooltip(img_picto('', 'object_barcode').' '.$langs->trans("DetailBatchNumber"),$detail); diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 5728d60932a..5848c1b9d9d 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -415,7 +415,7 @@ class Expedition extends CommonObject { if ($detbatch->entrepot_id) { - $stockLocationQty[$detbatch->entrepot_id] += $detbatch->dluo_qty; + $stockLocationQty[$detbatch->entrepot_id] += $detbatch->qty; } } // create shipment lines @@ -931,7 +931,7 @@ class Expedition extends CommonObject $this->error=$linebatch->error; return -1; } - $linebatch->dluo_qty=$value['q']; + $linebatch->qty=$value['q']; $tab[]=$linebatch; if ($conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT) @@ -940,7 +940,7 @@ class Expedition extends CommonObject $prod_batch = new Productbatch($this->db); $prod_batch->fetch($value['id_batch']); - if ($prod_batch->qty < $linebatch->dluo_qty) + if ($prod_batch->qty < $linebatch->qty) { $langs->load("errors"); $this->errors[]=$langs->trans('ErrorStockIsNotEnoughToAddProductOnShipment', $prod_batch->fk_product); @@ -1164,7 +1164,7 @@ class Expedition extends CommonObject // We use warehouse selected for each line foreach($lotArray as $lot) { - $result=$mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $lot->dluo_qty, 0, $langs->trans("ShipmentDeletedInDolibarr", $this->ref), $lot->eatby, $lot->sellby, $lot->batch); // Price is set to 0, because we don't want to see WAP changed + $result=$mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $lot->qty, 0, $langs->trans("ShipmentDeletedInDolibarr", $this->ref), $lot->eatby, $lot->sellby, $lot->batch); // Price is set to 0, because we don't want to see WAP changed if ($result < 0) { $error++;$this->errors=$this->errors + $mouvS->errors; @@ -2572,7 +2572,7 @@ class ExpeditionLigne extends CommonObjectLine $this->errors[]='ErrorBadParameters'; $error++; } - $qty = price2num($this->detail_batch[0]->dluo_qty); + $qty = price2num($this->detail_batch[0]->qty); } } else if (! empty($this->detail_batch)) @@ -2586,7 +2586,7 @@ class ExpeditionLigne extends CommonObjectLine $this->errors[]='ErrorBadParameters'; $error++; } - $qty = price2num($this->detail_batch->dluo_qty); + $qty = price2num($this->detail_batch->qty); } // check parameters @@ -2624,7 +2624,7 @@ class ExpeditionLigne extends CommonObjectLine { if ($expedition_batch_id != $lot->id) { - $remainingQty += $lot->dluo_qty; + $remainingQty += $lot->qty; } } $qty += $remainingQty; @@ -2652,7 +2652,7 @@ class ExpeditionLigne extends CommonObjectLine $error++; } } - if (! $error && $this->detail_batch->dluo_qty > 0) + if (! $error && $this->detail_batch->qty > 0) { // create lot expedition line if (isset($lot->id)) @@ -2662,7 +2662,7 @@ class ExpeditionLigne extends CommonObjectLine $shipmentLot->eatby = $lot->eatby; $shipmentLot->sellby = $lot->sellby; $shipmentLot->entrepot_id = $this->detail_batch->entrepot_id; - $shipmentLot->dluo_qty = $this->detail_batch->dluo_qty; + $shipmentLot->qty = $this->detail_batch->qty; $shipmentLot->fk_origin_stock = $batch_id; if ($shipmentLot->create($this->id) < 0) { diff --git a/htdocs/expedition/class/expeditionbatch.class.php b/htdocs/expedition/class/expeditionbatch.class.php index d94baee2a43..227566d8382 100644 --- a/htdocs/expedition/class/expeditionbatch.class.php +++ b/htdocs/expedition/class/expeditionbatch.class.php @@ -34,7 +34,7 @@ class ExpeditionLineBatch extends CommonObject var $sellby; var $eatby; var $batch; - var $dluo_qty; + var $qty; var $entrepot_id; var $fk_origin_stock; var $fk_expeditiondet; @@ -58,41 +58,41 @@ class ExpeditionLineBatch extends CommonObject */ function fetchFromStock($id_stockdluo) { - $sql = "SELECT"; - $sql.= " pb.batch,"; - $sql.= " pl.sellby,"; - $sql.= " pl.eatby,"; - $sql.= " ps.fk_entrepot"; + $sql = "SELECT"; + $sql.= " pb.batch,"; + $sql.= " pl.sellby,"; + $sql.= " pl.eatby,"; + $sql.= " ps.fk_entrepot"; - $sql.= " FROM ".MAIN_DB_PREFIX."product_batch as pb"; - $sql.= " JOIN ".MAIN_DB_PREFIX."product_stock as ps on pb.fk_product_stock=ps.rowid"; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."product_lot as pl on pl.batch = pb.batch AND pl.fk_product = ps.fk_product"; - $sql.= " WHERE pb.rowid = ".(int) $id_stockdluo; + $sql.= " FROM ".MAIN_DB_PREFIX."product_batch as pb"; + $sql.= " JOIN ".MAIN_DB_PREFIX."product_stock as ps on pb.fk_product_stock=ps.rowid"; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."product_lot as pl on pl.batch = pb.batch AND pl.fk_product = ps.fk_product"; + $sql.= " WHERE pb.rowid = ".(int) $id_stockdluo; - dol_syslog(get_class($this)."::fetch", LOG_DEBUG); - $resql=$this->db->query($sql); - if ($resql) - { - if ($this->db->num_rows($resql)) - { - $obj = $this->db->fetch_object($resql); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); + $resql=$this->db->query($sql); + if ($resql) + { + if ($this->db->num_rows($resql)) + { + $obj = $this->db->fetch_object($resql); $this->sellby = $this->db->jdate($obj->sellby); $this->eatby = $this->db->jdate($obj->eatby); $this->batch = $obj->batch; $this->entrepot_id= $obj->fk_entrepot; $this->fk_origin_stock=(int) $id_stockdluo; - } - $this->db->free($resql); + } + $this->db->free($resql); - return 1; - } - else - { - $this->error="Error ".$this->db->lasterror(); - return -1; - } - } + return 1; + } + else + { + $this->error="Error ".$this->db->lasterror(); + return -1; + } + } /** * Create an expeditiondet_batch DB record link to an expedtiondet record @@ -118,7 +118,7 @@ class ExpeditionLineBatch extends CommonObject $sql.= " ".(! isset($this->sellby) || dol_strlen($this->sellby)==0?'NULL':("'".$this->db->idate($this->sellby))."'").","; $sql.= " ".(! isset($this->eatby) || dol_strlen($this->eatby)==0?'NULL':("'".$this->db->idate($this->eatby))."'").","; $sql.= " ".(! isset($this->batch)?'NULL':("'".$this->db->escape($this->batch)."'")).","; - $sql.= " ".(! isset($this->dluo_qty)?'NULL':$this->dluo_qty).","; + $sql.= " ".(! isset($this->qty)?'NULL':$this->qty).","; $sql.= " ".(! isset($this->fk_origin_stock)?'NULL':$this->fk_origin_stock); $sql.= ")"; @@ -218,7 +218,7 @@ class ExpeditionLineBatch extends CommonObject $tmp->id = $obj->rowid; $tmp->fk_origin_stock = $obj->fk_origin_stock; $tmp->fk_expeditiondet = $obj->fk_expeditiondet; - $tmp->dluo_qty = $obj->qty; + $tmp->qty = $obj->qty; $ret[]=$tmp; $i++; From e1e1599a6d9ce293a223d2d8db4a712b652a8a97 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 11 Oct 2018 11:59:14 +0200 Subject: [PATCH 06/31] FIX shared link ko on proposals --- htdocs/core/lib/files.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 15e8c003417..210626f461c 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2496,7 +2496,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, //$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."fichinter WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity; } // Wrapping pour les propales - else if ($modulepart == 'propal' && !empty($conf->propal->multidir_output[$entity])) + else if (($modulepart == 'propal' || $modulepart == 'propale') && !empty($conf->propal->multidir_output[$entity])) { if ($fuser->rights->propale->{$lire} || preg_match('/^specimen/i',$original_file)) { From 88ff7241f5b848aac28394142b8a876e85424aef Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 11 Oct 2018 13:12:13 +0200 Subject: [PATCH 07/31] FIX Quick hack to solve pb of bad definition of public holidays --- htdocs/core/lib/date.lib.php | 23 +++++++++++++++++++++++ test/phpunit/DateLibTest.php | 20 ++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index ea1dbe237de..23f4ebd1186 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -573,6 +573,8 @@ function dol_get_first_day_week($day,$month,$year,$gm=false) */ function num_public_holiday($timestampStart, $timestampEnd, $countrycode='FR', $lastday=0) { + global $conf; + $nbFerie = 0; // Check to ensure we use correct parameters @@ -588,6 +590,27 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode='FR', $ $jour = date("d", $timestampStart); $mois = date("m", $timestampStart); $annee = date("Y", $timestampStart); + + + // Check into var $conf->global->HOLIDAY_MORE_DAYS MM-DD,YYYY-MM-DD, ... + if (! empty($conf->global->HOLIDAY_MORE_PUBLIC_HOLIDAYS)) + { + $arrayofdaystring=explode(',',$conf->global->HOLIDAY_MORE_PUBLIC_HOLIDAYS); + foreach($arrayofdaystring as $daystring) + { + $tmp=explode('-',$daystring); + var_dump($tmp); + if ($tmp[2]) + { + if ($tmp[0] == $annee && $tmp[1] == $mois && $tmp[2] == $jour) $ferie=true; + } + else + { + if ($tmp[0] == $mois && $tmp[1] == $jour) $ferie=true; + } + } + } + if ($countrycode == 'FR') { $countryfound=1; diff --git a/test/phpunit/DateLibTest.php b/test/phpunit/DateLibTest.php index 1290523abc1..e0cd1fab31b 100644 --- a/test/phpunit/DateLibTest.php +++ b/test/phpunit/DateLibTest.php @@ -205,6 +205,26 @@ class DateLibTest extends PHPUnit_Framework_TestCase $result=num_public_holiday($date1,$date2,'XX',1); print __METHOD__." result=".$result."\n"; $this->assertEquals(2,$result,'NumPublicHoliday for XX'); // 1 opened day, 2 closed days (even if country unknown) + + $conf->global->HOLIDAY_MORE_PUBLIC_HOLIDAYS='12-13,2019-12-14'; + + $date1=dol_mktime(0, 0, 0, 12, 13, 2018); + $date2=dol_mktime(0, 0, 0, 12, 13, 2018); + $result=num_public_holiday($date1,$date2,'YY',1); + print __METHOD__." result=".$result."\n"; + $this->assertEquals(1,$result,'NumPublicHoliday for YY the 2018-12-13'); // 0 opened day, 1 closed days (even if country unknown) + + $date1=dol_mktime(0, 0, 0, 12, 14, 2018); + $date2=dol_mktime(0, 0, 0, 12, 14, 2018); + $result=num_public_holiday($date1,$date2,'YY',1); + print __METHOD__." result=".$result."\n"; + $this->assertEquals(0,$result,'NumPublicHoliday for YY the 2018-12-14'); // 1 opened day, 0 closed days (even if country unknown) + + $date1=dol_mktime(0, 0, 0, 12, 14, 2019); + $date2=dol_mktime(0, 0, 0, 12, 14, 2019); + $result=num_public_holiday($date1,$date2,'YY',1); + print __METHOD__." result=".$result."\n"; + $this->assertEquals(1,$result,'NumPublicHoliday for YY the 2019-12-14'); // 0 opened day, 1 closed days (even if country unknown) } /** From e6f179b6cb348207deb9ed5c8b488224e5e575e2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 11 Oct 2018 13:33:44 +0200 Subject: [PATCH 08/31] Fix look --- htdocs/product/stock/productlot_card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/product/stock/productlot_card.php b/htdocs/product/stock/productlot_card.php index 4c614155042..7c2f4f148ad 100644 --- a/htdocs/product/stock/productlot_card.php +++ b/htdocs/product/stock/productlot_card.php @@ -390,6 +390,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print '
'; print ''.$langs->trans("ShowLogOfMovementIfLot").'
'; + print '
'; } From 4b32c8e100c0cf2c53f72651ba2ee11a43d9e662 Mon Sep 17 00:00:00 2001 From: atm-ph Date: Thu, 11 Oct 2018 14:24:55 +0200 Subject: [PATCH 09/31] Fix extrafield contact typed as date isn't show in the list from 'contact/address' tab of company --- htdocs/core/tpl/extrafields_list_print_fields.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index e77d0ee0eaf..855794da2d6 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -21,7 +21,7 @@ if (! empty($extrafieldsobjectkey)) // New method: $extrafieldsobject can be 'so if ($align) print ' align="'.$align.'"'; print '>'; $tmpkey='options_'.$key; - if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$key], array('date', 'datetime', 'timestamp'))) + if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$key], array('date', 'datetime', 'timestamp')) && !preg_match('/^[0-9]{10}$/', $obj->$tmpkey)) { $value = $db->jdate($obj->$tmpkey); } From 79420593f44aa1e320847d9c8e8da9ef245fa05d Mon Sep 17 00:00:00 2001 From: atm-ph Date: Thu, 11 Oct 2018 17:14:22 +0200 Subject: [PATCH 10/31] Fix display 0 (as virtual stock) instead of empty string --- htdocs/product/reassort.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index ccd01e56db7..a915594c4de 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -338,7 +338,7 @@ if ($resql) // Real stock print ''; if ($objp->seuil_stock_alerte != '' && ($objp->stock_physique < $objp->seuil_stock_alerte)) print img_warning($langs->trans("StockTooLow")).' '; - print $objp->stock_physique; + print $objp->stock_physique|0; print ''; // Details per warehouse From 817920f282c517ad39cbf4d0d17392c56dde16ef Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Oct 2018 17:36:49 +0200 Subject: [PATCH 11/31] Prepare 6.0.8 --- ChangeLog | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/ChangeLog b/ChangeLog index 405aaa9ed9d..1bffab94cda 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,37 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 6.0.8 compared to 6.0.7 ***** +FIX: #8762 +FIX: #9032 +FIX: case when we valid form with keyboard +FIX: clause must not be there +FIX: dol_delete_file must work in a context without db handler loaded +FIX: entity test must be on product_fourn_price table and not product table +FIX: Fetch shipping will now fetch project id +FIX: $fk_account is always empty, must be $soc->fk_account +FIX: getEntity project and not projet +FIX: If we enable 3 steps for supplier order approbation, we must no… +FIX: If we enable 3 steps for supplier order approbation, we must not delete all fourn rights def. +FIX: Keep supplier proposal price for supplier order +FIX: langs fr +FIX: missing filters during ordering +FIX: missing filters during reordering +FIX: need to filter on aa.entity for same accounting accounts available in several entities +FIX: page must always be 0 when we search +FIX: page must always be 0 when we search (to avoid case : when we're on page 3 and we're looking for a precise thirdparty, we stay on page 3 and nothing's displaied) +FIX: PDF address: handle when contact thirdparty different from document thirdparty +FIX: propal: correctly preset project when creating with origin/originid +FIX: pu_ht_devise was not converted to numeric so decimals were lost +FIX: pu_ht_devise was not converted to numeric so decimals were lost when calculating total_ht_devise +FIX: remain to pay for credit note was wrong on invoice list +FIX: shipment: fk_proje(c)t not handled in fetch() and update() methods +FIX: showOptionals: column mismatches +FIX: sometimes amounts are identical but php find them different. +FIX: test is_erasable() must be done before call function delete() +FIX: test is_erasable() must be done before call function delete() too to avoid delete invoice with &action=delete in url +FIX: we must see number of all shared projects +FIX: wrong var name ***** ChangeLog for 6.0.7 compared to 6.0.6 ***** FIX: #8023 From 1ab6cd4b59b542422131cc2e52ab7d5572d5c858 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Oct 2018 17:51:32 +0200 Subject: [PATCH 12/31] Update card.php --- htdocs/compta/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index aeb145a7ea2..6f24d1f86fb 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3250,7 +3250,7 @@ if ($action == 'create') print '' . $langs->trans($newclassname) . '' . $objectsrc->getNomUrl(1); // We check if Origin document (id and type is known) has already at least one invoice attached to it $objectsrc->fetchObjectLinked($originid,$origin,'','facture'); - if(!empty($objectsrc->linkedObjects['facture']) && is_array($objectsrc->linkedObjects['facture'])) + if (is_array($objectsrc->linkedObjects['facture']) && count($objectsrc->linkedObjects['facture']) >= 1) { setEventMessages('WarningBillExist', null, 'warnings'); echo ' ('.$langs->trans('LatestRelatedBill').end($objectsrc->linkedObjects['facture'])->getNomUrl(1).')'; From afd9b4ea1a793ffcee8de396e24dc9a21a71ef4d Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio Date: Fri, 12 Oct 2018 18:19:17 +0200 Subject: [PATCH 13/31] FIX: propal pdf: missing parenthesis for customs code --- htdocs/comm/propal/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 2fdaadd1d59..c21e6ebec10 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -868,6 +868,7 @@ if (empty($reshook)) // Add custom code and origin country into description if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) { + $tmptxt = '('; // Define output language if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { $outputlangs = $langs; From 60a5444c1408cbcd3c9f56e4d2b83349f0f63377 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Oct 2018 18:50:33 +0200 Subject: [PATCH 14/31] Fix app name to match Stripe advice --- htdocs/stripe/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/stripe/config.php b/htdocs/stripe/config.php index defbc620cc8..d25176c21b4 100644 --- a/htdocs/stripe/config.php +++ b/htdocs/stripe/config.php @@ -54,5 +54,5 @@ else } \Stripe\Stripe::setApiKey($stripearrayofkeys['secret_key']); -\Stripe\Stripe::setAppInfo("Stripe", DOL_VERSION, "https://www.dolibarr.org"); // add dolibarr version +\Stripe\Stripe::setAppInfo("Dolibarr StripeModule", DOL_VERSION, "https://www.dolibarr.org"); // add dolibarr version \Stripe\Stripe::setApiVersion("2018-07-27"); // force version API From 2d2b9a030cc8b3f8c477c012aa62616509813268 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Oct 2018 19:01:01 +0200 Subject: [PATCH 15/31] Fix app name to match Stripe advice --- htdocs/stripe/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/stripe/config.php b/htdocs/stripe/config.php index d25176c21b4..7aa22678d7a 100644 --- a/htdocs/stripe/config.php +++ b/htdocs/stripe/config.php @@ -54,5 +54,5 @@ else } \Stripe\Stripe::setApiKey($stripearrayofkeys['secret_key']); -\Stripe\Stripe::setAppInfo("Dolibarr StripeModule", DOL_VERSION, "https://www.dolibarr.org"); // add dolibarr version +\Stripe\Stripe::setAppInfo("Dolibarr Stripe", DOL_VERSION, "https://www.dolibarr.org"); // add dolibarr version \Stripe\Stripe::setApiVersion("2018-07-27"); // force version API From d4b02c05524b89ecfb70c78b45be3e293fb484ff Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Oct 2018 19:03:03 +0200 Subject: [PATCH 16/31] Release 6.0.8 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 9ab5de809b9..41fcff97fd8 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -31,7 +31,7 @@ */ if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr'); -if (! defined('DOL_VERSION')) define('DOL_VERSION','6.0.8'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c +if (! defined('DOL_VERSION')) define('DOL_VERSION','6.0.9'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (! defined('EURO')) define('EURO',chr(128)); From bb606df5e064351715196bd7b1528e3629c53e10 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Oct 2018 19:12:20 +0200 Subject: [PATCH 17/31] Prepare 7.0.4 --- ChangeLog | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/ChangeLog b/ChangeLog index bdbb165903d..0a74e1b6f8e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,63 @@ English Dolibarr ChangeLog -------------------------------------------------------------- + +***** ChangeLog for 7.0.4 compared to 7.0.3 ***** +FIX: #8984 button create expense report +FIX: #9032 +FIX: #9161 +FIX: #9328 +FIX: According to french law, if seller is in France and buyer isn't in UE and isn't a company, TVA used = TVA product +FIX: Add calls to fetchComments function +FIX: better compatibility with multicompany +FIX: case when we valid form with keyboard +FIX: character making error on bill list +FIX: check !empty exclude select element +FIX: combo into popup become crazy with IE10 +FIX: combo of stock in popup are crazy in IE +FIX: Deletion of files in migration +FIX: exclude element of the select +FIX: extrafieldkey +FIX: Fetch function will fetch comments +FIX: Fetch task will now fetch comments +FIX: filter supplier invoice list by societe name. +FIX: $fk_account is always empty, must be $soc->fk_account +FIX: Force stripe api version to avoid trouble if we update stripe api +FIX: getEntity project and not projet +FIX: Get templates in a forced language +FIX: global $mysoc missing (to avoid php notice on lines 279, 280 & 281) +FIX: Injection +FIX: invoice stats: situation invoices were not counted +FIX: keep context filter on contact list on change column displayed +FIX: Keep same project when creating shipping from order +FIX: langs fr +FIX: Lose filter on payment type or category after a sort on invoice list +FIX: Missing behavior +FIX: missing hook to edit sql +FIX: multicompany compatibility ! +FIX: need to filter on current entity on replenish +FIX: Option MAIN_DISABLE_NOTES_TAB #9611 +FIX: page must always be 0 when we search (to avoid case : when we're on page 3 and we're looking for a precise thirdparty, we stay on page 3 and nothing's displaied) +FIX: Pagination on related item pages +FIX: Pagination on withdraw request list +FIX: PDF address: handle when contact thirdparty different from document thirdparty +FIX: PHP warning, undefined index notnull +FIX: Product marge tabs on product card +FIX: Product margin tab and credit note +FIX: propal: correctly preset project when creating with origin/originid +FIX: remain to pay for credit note was wrong on invoice list +FIX: remove debug +FIX: Remove fetchComments from project and task fetch function +FIX: remove rowid for multicompany compatibility +FIX: Search on Ref project on order list +FIX: search on ref project on propal list +FIX: showOptionals: column mismatches +FIX: SQL Injections reported by mu shcor (ADLab of Venustech) +FIX: stock replenish with multientity +FIX: table llx_chargessociales doesn't exists +FIX: we must see number of all shared projects +FIX: when stock is empty for current entity but > 0 in other entity, until this commit product wasn't displaied on replenishment, it must depends on multientity stock sharing + ***** ChangeLog for 7.0.3 compared to 7.0.2 ***** FIX: 7.0 task contact card without withproject parameters FIX: #8722 From bd60fe6ffda132beacb69bfd492c04f4212f9a61 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Oct 2018 19:13:11 +0200 Subject: [PATCH 18/31] Prepare 7.0.4 --- ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index 0a74e1b6f8e..61b3f85edb3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -58,6 +58,11 @@ FIX: stock replenish with multientity FIX: table llx_chargessociales doesn't exists FIX: we must see number of all shared projects FIX: when stock is empty for current entity but > 0 in other entity, until this commit product wasn't displaied on replenishment, it must depends on multientity stock sharing +FIX: when we're just admin and not super admin, if we create new user with transverse mode, we don't see it then we can't add him in usergroup +FIX: wrong function name +FIX: Wrong position of firstname lastname +FIX: wrong value for module part and return access denied +FIX: Wrong variable and trigger name ***** ChangeLog for 7.0.3 compared to 7.0.2 ***** FIX: 7.0 task contact card without withproject parameters From d8edb1f6b864639c2ecbb40f7de104358010097a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Oct 2018 20:28:26 +0200 Subject: [PATCH 19/31] Fix regression in online payment --- htdocs/public/payment/newpayment.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index cedca6cae73..3afd590da53 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -413,7 +413,7 @@ if ($action == 'charge' && ! empty($conf->stripe->enabled)) $dol_type=(GETPOST('s', 'alpha') ? GETPOST('s', 'alpha') : GETPOST('source', 'alpha')); $dol_id=GETPOST('dol_id', 'int'); $vatnumber = GETPOST('vatnumber','alpha'); - $savesource=GETPOST('savesource', 'int'); + $savesource=GETPOSTISSET('savesource')?GETPOST('savesource', 'int'):1; dol_syslog("stripeToken = ".$stripeToken, LOG_DEBUG, 0, '_stripe'); dol_syslog("email = ".$email, LOG_DEBUG, 0, '_stripe'); @@ -454,9 +454,11 @@ if ($action == 'charge' && ! empty($conf->stripe->enabled)) $customer = $stripe->customerStripe($thirdparty, $stripeacc, $servicestatus, 1); // Create Stripe card from Token - if (! empty($savesource)) { - $card = $customer->sources->create(array("source" => $stripeToken, "metadata" => $metadata)); - } else { $card = $stripeToken; } + if ($savesource) { + $card = $customer->sources->create(array("source" => $stripeToken, "metadata" => $metadata)); + } else { + $card = $stripeToken; + } if (empty($card)) { @@ -467,9 +469,9 @@ if ($action == 'charge' && ! empty($conf->stripe->enabled)) } else { - if (! empty($FULLTAG)) $metadata["FULLTAG"] = $FULLTAG; - if (! empty($dol_id)) $metadata["dol_id"] = $dol_id; - if (! empty($dol_type)) $metadata["dol_type"] = $dol_type; + if (! empty($FULLTAG)) $metadata["FULLTAG"] = $FULLTAG; + if (! empty($dol_id)) $metadata["dol_id"] = $dol_id; + if (! empty($dol_type)) $metadata["dol_type"] = $dol_type; dol_syslog("Create charge on card ".$card->id, LOG_DEBUG, 0, '_stripe'); $charge = \Stripe\Charge::create(array( From b78932b9f7679cec79d97cf6b0046c6bdec3bde4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Oct 2018 21:11:40 +0200 Subject: [PATCH 20/31] Prepare 7.0.5 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index adfe8cea7e9..dbc0e4bda8c 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -31,7 +31,7 @@ */ if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr'); -if (! defined('DOL_VERSION')) define('DOL_VERSION','7.0.4'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c +if (! defined('DOL_VERSION')) define('DOL_VERSION','7.0.5'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (! defined('EURO')) define('EURO',chr(128)); From e2748953c3a7e8b0de07f504124bcc183ec90efb Mon Sep 17 00:00:00 2001 From: atm-ph Date: Fri, 12 Oct 2018 22:31:47 +0200 Subject: [PATCH 21/31] Fix print extrafield date in list --- htdocs/core/tpl/extrafields_list_print_fields.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index 855794da2d6..6d72c63ab41 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -21,7 +21,7 @@ if (! empty($extrafieldsobjectkey)) // New method: $extrafieldsobject can be 'so if ($align) print ' align="'.$align.'"'; print '>'; $tmpkey='options_'.$key; - if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$key], array('date', 'datetime', 'timestamp')) && !preg_match('/^[0-9]{10}$/', $obj->$tmpkey)) + if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$key], array('date', 'datetime', 'timestamp')) && !is_numeric($obj->$tmpkey)) { $value = $db->jdate($obj->$tmpkey); } From 0f8ac57c854c292e0349a9c247d87513d7180893 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 12 Oct 2018 22:34:23 +0200 Subject: [PATCH 22/31] remove var_dump --- htdocs/core/lib/date.lib.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 23f4ebd1186..8985a4e7621 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -599,7 +599,6 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode='FR', $ foreach($arrayofdaystring as $daystring) { $tmp=explode('-',$daystring); - var_dump($tmp); if ($tmp[2]) { if ($tmp[0] == $annee && $tmp[1] == $mois && $tmp[2] == $jour) $ferie=true; From e19453450dcb24a55b9e5a65aea01dd8d0133e29 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 13 Oct 2018 19:57:34 +0200 Subject: [PATCH 23/31] Fix closing tag --- htdocs/modulebuilder/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index d406f6918a0..f6646813843 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1564,7 +1564,7 @@ elseif (! empty($module)) print '
'; - print ' '.$langs->trans("PageForLib").' : '.($realpathtolib?'':'').$pathtolib.($realpathtodocument?'':'').''; + print ' '.$langs->trans("PageForLib").' : '.($realpathtolib?'':'').$pathtolib.($realpathtolib?'':'').''; print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; print ' '.$langs->trans("Image").' : '.($realpathtopicto?'':'').$pathtopicto.($realpathtopicto?'':'').''; From 47d98ab69d504e6259036b6850438a7a62167301 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 15 Oct 2018 11:04:29 +0200 Subject: [PATCH 24/31] FIX content lost when editing a label with " --- htdocs/projet/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 449242f0594..b92df257dd7 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -754,7 +754,7 @@ elseif ($object->id > 0) // Label print ''.$langs->trans("Label").''; - print ''; + print ''; // Status print ''.$langs->trans("Status").''; From 9afc53ca06f366069ad9a057c878025dff6be208 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 15 Oct 2018 01:47:44 +0200 Subject: [PATCH 25/31] Fix remove step in accountancy if module expense report not used --- htdocs/accountancy/index.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index 2881de98132..9a3767bd8e4 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -146,9 +146,12 @@ if ($conf->accounting->enabled) print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsSuppliers"), ''.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("SuppliersVentilation").'')."\n"; print "
\n"; - $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("ExpenseReports"), ''.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'')."\n"; - print "
\n"; + if (! empty($conf->expensereport->enabled) || ! empty($conf->deplacement->enabled)) + { + $step++; + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("ExpenseReports"), ''.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'')."\n"; + print "
\n"; + } $step++; print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescWriteRecords", chr(64+$step), $langs->transnoentitiesnoconv("Journalization"), $langs->transnoentitiesnoconv("WriteBookKeeping"))."\n"; From aa6996e2d08ffff028304487b7a1c048b70ac24e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 14 Oct 2018 23:47:38 +0200 Subject: [PATCH 26/31] Fix pagination show two times the same account on balance of accounts --- htdocs/accountancy/bookkeeping/balance.php | 23 ++++++++++++------- .../accountancy/class/bookkeeping.class.php | 9 ++++++-- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 284ead4fb56..4022b9a9407 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -41,6 +41,21 @@ $page = GETPOST("page"); $sortorder = GETPOST("sortorder", 'alpha'); $sortfield = GETPOST("sortfield", 'alpha'); $action = GETPOST('action', 'alpha'); +if (GETPOST("exportcsv",'alpha')) $action = 'export_csv'; + +// Load variable for pagination +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; +$sortfield = GETPOST('sortfield','alpha'); +$sortorder = GETPOST('sortorder','alpha'); +$page = GETPOST('page','int'); +if (empty($page) || $page == -1 || GETPOST('button_search','alpha') || GETPOST('button_removefilter','alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +//if (! $sortfield) $sortfield="p.date_fin"; +//if (! $sortorder) $sortorder="DESC"; + + $search_date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int')); $search_date_end = dol_mktime(0, 0, 0, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int')); @@ -53,14 +68,6 @@ if ($search_accountancy_code_end == - 1) { $search_accountancy_code_end = ''; } -if (GETPOST("exportcsv",'alpha')) $action = 'export_csv'; - - -$limit = GETPOST('limit','int')?GETPOST('limit', 'int'):$conf->liste_limit; -if (empty($page) || $page < 0) { $page = 0; } - -$offset = $limit * $page; - $object = new BookKeeping($db); $formaccounting = new FormAccounting($db); diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index f7fed2e2b5b..4a2037aa92c 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -986,16 +986,21 @@ class BookKeeping extends CommonObject } $resql = $this->db->query($sql); - if ($resql) { + if ($resql) + { $num = $this->db->num_rows($resql); - while ( $obj = $this->db->fetch_object($resql) ) { + $i = 0; + while ($obj = $this->db->fetch_object($resql) && $i < $num) + { $line = new BookKeepingLine(); $line->numero_compte = $obj->numero_compte; $line->debit = $obj->debit; $line->credit = $obj->credit; $this->lines[] = $line; + + $i++; } $this->db->free($resql); From e29fb85cec94ae39cfa775df23af8c652ba810bb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 14 Oct 2018 23:57:07 +0200 Subject: [PATCH 27/31] Fix limit --- htdocs/accountancy/class/bookkeeping.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 4a2037aa92c..e751cf1899f 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -991,7 +991,7 @@ class BookKeeping extends CommonObject $num = $this->db->num_rows($resql); $i = 0; - while ($obj = $this->db->fetch_object($resql) && $i < $num) + while (($obj = $this->db->fetch_object($resql)) && ($i < min($limit, $num))) { $line = new BookKeepingLine(); From 2684767b19f6b715953ee9fab63251d343222f44 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 15 Oct 2018 00:06:16 +0200 Subject: [PATCH 28/31] Fix pagination Conflicts: htdocs/accountancy/bookkeeping/balance.php --- htdocs/accountancy/bookkeeping/balance.php | 33 +++++++++++++--------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 4022b9a9407..fa1f4b396d5 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -103,23 +103,27 @@ if ($sortorder == "") if ($sortfield == "") $sortfield = "t.numero_compte"; -$options = ''; + +$param=''; +if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); +if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); + $filter = array (); if (! empty($search_date_start)) { $filter['t.doc_date>='] = $search_date_start; - $options .= '&date_startmonth=' . GETPOST('date_startmonth', 'int') . '&date_startday=' . GETPOST('date_startday', 'int') . '&date_startyear=' . GETPOST('date_startyear', 'int'); + $param .= '&date_startmonth=' . GETPOST('date_startmonth', 'int') . '&date_startday=' . GETPOST('date_startday', 'int') . '&date_startyear=' . GETPOST('date_startyear', 'int'); } if (! empty($search_date_end)) { $filter['t.doc_date<='] = $search_date_end; - $options .= '&date_endmonth=' . GETPOST('date_endmonth', 'int') . '&date_endday=' . GETPOST('date_endday', 'int') . '&date_endyear=' . GETPOST('date_endyear', 'int'); + $param .= '&date_endmonth=' . GETPOST('date_endmonth', 'int') . '&date_endday=' . GETPOST('date_endday', 'int') . '&date_endyear=' . GETPOST('date_endyear', 'int'); } if (! empty($search_accountancy_code_start)) { $filter['t.numero_compte>='] = $search_accountancy_code_start; - $options .= '&search_accountancy_code_start=' . $search_accountancy_code_start; + $param .= '&search_accountancy_code_start=' . $search_accountancy_code_start; } if (! empty($search_accountancy_code_end)) { $filter['t.numero_compte<='] = $search_accountancy_code_end; - $options .= '&search_accountancy_code_end=' . $search_accountancy_code_end; + $param .= '&search_accountancy_code_end=' . $search_accountancy_code_end; } @@ -141,8 +145,8 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x', * View */ -if ($action == 'export_csv') { - +if ($action == 'export_csv') +{ $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV; $filename = 'balance'; @@ -194,7 +198,8 @@ else { print ''; $button = 'global->ACCOUNTING_EXPORT_FORMAT.')" />'; - print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $options, $sortfield, $sortorder, $button, $result, $result, 'title_accountancy', 0); + + print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $button, $result, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit); $moreforfilter = ''; @@ -232,12 +237,12 @@ else { print ''; print ''; - print_liste_field_titre("AccountAccounting", $_SERVER['PHP_SELF'], "t.numero_compte", "", $options, "", $sortfield, $sortorder); - print_liste_field_titre("Label", $_SERVER['PHP_SELF'], "t.label_operation", "", $options, "", $sortfield, $sortorder); - print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $options, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $options, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre("Balance", $_SERVER["PHP_SELF"], "", $options, "", 'align="right"', $sortfield, $sortorder); - print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $options, "", 'width="60" align="center"', $sortfield, $sortorder); + print_liste_field_titre("AccountAccounting", $_SERVER['PHP_SELF'], "t.numero_compte", "", $param, "", $sortfield, $sortorder); + print_liste_field_titre("Label", $_SERVER['PHP_SELF'], "t.label_operation", "", $param, "", $sortfield, $sortorder); + print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Balance", $_SERVER["PHP_SELF"], "", $param, "", 'align="right"', $sortfield, $sortorder); + print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $param, "", 'width="60" align="center"', $sortfield, $sortorder); print "\n"; $total_debit = 0; From 35f9371343a983085cfc54fb76151a750701074d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 16 Oct 2018 03:30:17 +0200 Subject: [PATCH 29/31] Fix missing es translation string --- htdocs/core/class/notify.class.php | 37 ++++++++++++++++-------------- htdocs/langs/es_ES/other.lang | 1 + 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 7a1b55f5bd2..5a5356b2dd5 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -368,6 +368,7 @@ class Notify { $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang($obj->default_lang); + $outputlangs->load("other"); } $subject = '['.$mysoc->name.'] '.$outputlangs->transnoentitiesnoconv("DolibarrNotification"); @@ -377,72 +378,72 @@ class Notify $link='/compta/facture/card.php?facid='.$object->id; $dir_output = $conf->facture->dir_output; $object_type = 'facture'; - $mesg = $langs->transnoentitiesnoconv("EMailTextInvoiceValidated",$newref); + $mesg = $outputlangs->transnoentitiesnoconv("EMailTextInvoiceValidated",$newref); break; case 'BILL_PAYED': $link='/compta/facture/card.php?facid='.$object->id; $dir_output = $conf->facture->dir_output; $object_type = 'facture'; - $mesg = $langs->transnoentitiesnoconv("EMailTextInvoicePayed",$newref); + $mesg = $outputlangs->transnoentitiesnoconv("EMailTextInvoicePayed",$newref); break; case 'ORDER_VALIDATE': $link='/commande/card.php?id='.$object->id; $dir_output = $conf->commande->dir_output; $object_type = 'order'; - $mesg = $langs->transnoentitiesnoconv("EMailTextOrderValidated",$newref); + $mesg = $outputlangs->transnoentitiesnoconv("EMailTextOrderValidated",$newref); break; case 'PROPAL_VALIDATE': $link='/comm/propal/card.php?id='.$object->id; $dir_output = $conf->propal->multidir_output[$object->entity]; $object_type = 'propal'; - $mesg = $langs->transnoentitiesnoconv("EMailTextProposalValidated",$newref); + $mesg = $outputlangs->transnoentitiesnoconv("EMailTextProposalValidated",$newref); break; case 'PROPAL_CLOSE_SIGNED': $link='/comm/propal/card.php?id='.$object->id; $dir_output = $conf->propal->multidir_output[$object->entity]; $object_type = 'propal'; - $mesg = $langs->transnoentitiesnoconv("EMailTextProposalClosedSigned",$newref); + $mesg = $outputlangs->transnoentitiesnoconv("EMailTextProposalClosedSigned",$newref); break; case 'FICHINTER_ADD_CONTACT': $link='/fichinter/card.php?id='.$object->id; $dir_output = $conf->ficheinter->dir_output; $object_type = 'ficheinter'; - $mesg = $langs->transnoentitiesnoconv("EMailTextInterventionAddedContact",$object->ref); + $mesg = $outputlangs->transnoentitiesnoconv("EMailTextInterventionAddedContact",$newref); break; case 'FICHINTER_VALIDATE': $link='/fichinter/card.php?id='.$object->id; $dir_output = $conf->ficheinter->dir_output; $object_type = 'ficheinter'; - $mesg = $langs->transnoentitiesnoconv("EMailTextInterventionValidated",$object->ref); + $mesg = $outputlangs->transnoentitiesnoconv("EMailTextInterventionValidated",$newref); break; case 'ORDER_SUPPLIER_VALIDATE': $link='/fourn/commande/card.php?id='.$object->id; $dir_output = $conf->fournisseur->commande->dir_output; $object_type = 'order_supplier'; - $mesg = $langs->transnoentitiesnoconv("Hello").",\n\n"; - $mesg.= $langs->transnoentitiesnoconv("EMailTextOrderValidatedBy",$object->ref,$user->getFullName($langs)); - $mesg.= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n"; + $mesg = $outputlangs->transnoentitiesnoconv("Hello").",\n\n"; + $mesg.= $outputlangs->transnoentitiesnoconv("EMailTextOrderValidatedBy",$newref,$user->getFullName($langs)); + $mesg.= "\n\n".$outputlangs->transnoentitiesnoconv("Sincerely").".\n\n"; break; case 'ORDER_SUPPLIER_APPROVE': $link='/fourn/commande/card.php?id='.$object->id; $dir_output = $conf->fournisseur->commande->dir_output; $object_type = 'order_supplier'; - $mesg = $langs->transnoentitiesnoconv("Hello").",\n\n"; - $mesg.= $langs->transnoentitiesnoconv("EMailTextOrderApprovedBy",$newref,$user->getFullName($langs)); - $mesg.= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n"; + $mesg = $outputlangs->transnoentitiesnoconv("Hello").",\n\n"; + $mesg.= $outputlangs->transnoentitiesnoconv("EMailTextOrderApprovedBy",$newref,$user->getFullName($langs)); + $mesg.= "\n\n".$outputlangs->transnoentitiesnoconv("Sincerely").".\n\n"; break; case 'ORDER_SUPPLIER_REFUSE': $link='/fourn/commande/card.php?id='.$object->id; $dir_output = $conf->fournisseur->commande->dir_output; $object_type = 'order_supplier'; - $mesg = $langs->transnoentitiesnoconv("Hello").",\n\n"; - $mesg.= $langs->transnoentitiesnoconv("EMailTextOrderRefusedBy",$newref,$user->getFullName($langs)); - $mesg.= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n"; + $mesg = $outputlangs->transnoentitiesnoconv("Hello").",\n\n"; + $mesg.= $outputlangs->transnoentitiesnoconv("EMailTextOrderRefusedBy",$newref,$user->getFullName($langs)); + $mesg.= "\n\n".$outputlangs->transnoentitiesnoconv("Sincerely").".\n\n"; break; case 'SHIPPING_VALIDATE': $dir_output = $conf->expedition->dir_output.'/sending/'; $object_type = 'order_supplier'; - $mesg = $langs->transnoentitiesnoconv("EMailTextExpeditionValidated",$newref); + $mesg = $outputlangs->transnoentitiesnoconv("EMailTextExpeditionValidated",$newref); break; } $ref = dol_sanitizeFileName($newref); @@ -651,6 +652,8 @@ class Notify $message.= $langs->transnoentities("YouReceiveMailBecauseOfNotification2",$application,$mysoc->name)."\n"; $message.= "\n"; $message.= $mesg; + //if ($link) $message.= "\n" . $urlwithroot . $link; // link already added around the ref into the text + $message = nl2br($message); // Replace keyword __SUPERVISOREMAIL__ diff --git a/htdocs/langs/es_ES/other.lang b/htdocs/langs/es_ES/other.lang index 137bbac42d6..acdc769a7c5 100644 --- a/htdocs/langs/es_ES/other.lang +++ b/htdocs/langs/es_ES/other.lang @@ -188,6 +188,7 @@ NumberOfUnitsSupplierInvoices=Número de unidades en las facturas de proveedores EMailTextInterventionAddedContact=Se le ha asignado la intervención %s EMailTextInterventionValidated=Ficha intervención %s validada EMailTextInvoiceValidated=Factura %s validada +EMailTextInvoicePayed=La factura %s ha sido pagada. EMailTextProposalValidated=El presupuesto %s que le concierne ha sido validado. EMailTextProposalClosedSigned=El presupuesto %s ha sido cerrado y firmado. EMailTextOrderValidated=El pedido %s que le concierne ha sido validado. From 70366e9d91fd675b7f21a80ff923b105208474bc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 16 Oct 2018 03:31:33 +0200 Subject: [PATCH 30/31] Missing translation --- htdocs/core/class/notify.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 5a5356b2dd5..c226fb647d0 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -368,7 +368,7 @@ class Notify { $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang($obj->default_lang); - $outputlangs->load("other"); + $outputlangs->loadLangs(array("main","other")); } $subject = '['.$mysoc->name.'] '.$outputlangs->transnoentitiesnoconv("DolibarrNotification"); From 08fa0deb2459a56dfe805139c199adeb151eab74 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 16 Oct 2018 18:41:50 +0200 Subject: [PATCH 31/31] FIX Bad label on delete button --- htdocs/expensereport/payment/card.php | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/htdocs/expensereport/payment/card.php b/htdocs/expensereport/payment/card.php index 2876d512c52..29ac7e38862 100644 --- a/htdocs/expensereport/payment/card.php +++ b/htdocs/expensereport/payment/card.php @@ -42,6 +42,13 @@ if ($user->societe_id) $socid=$user->societe_id; $object = new PaymentExpenseReport($db); +if ($id > 0) +{ + $result=$object->fetch($id); + if (! $result) dol_print_error($db,'Failed to get payment id '.$id); +} + + /* * Actions */ @@ -77,10 +84,10 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->expensere $db->commit(); $factures=array(); // TODO Get all id of invoices linked to this payment - foreach($factures as $id) + foreach($factures as $invoiceid) { $fac = new Facture($db); - $fac->fetch($id); + $fac->fetch($invoiceid); $outputlangs = $langs; if (! empty($_REQUEST['lang_id'])) @@ -110,12 +117,6 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->expensere llxHeader('', $langs->trans("ExpenseReportPayment")); -if ($id > 0) -{ - $result=$object->fetch($id); - if (! $result) dol_print_error($db,'Failed to get payment id '.$id); -} - $form = new Form($db); $head = payment_expensereport_prepare_head($object); @@ -265,9 +266,11 @@ if ($resql) print ''.$expensereport->getLibStatut(4,$objp->amount).''; print "\n"; + if ($objp->paid == 1) // If at least one invoice is paid, disable delete { - $disable_delete = 1; + $disable_delete = 2; + $title_button = $langs->trans("CantRemovePaymentWithOneInvoicePaid"); } $total = $total + $objp->amount; $i++; @@ -303,7 +306,7 @@ if ($action == '') } else { - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } } }