From 3006e2bf75fce7c65e5f086487b7b75f6e1c8a43 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Wed, 27 Mar 2019 12:05:42 +0100 Subject: [PATCH 0001/1497] memorize line before delete (for triggers) --- htdocs/commande/class/commande.class.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 07b7a907150..6eff20da863 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1367,7 +1367,7 @@ class Commande extends CommonOrder // Check parameters if ($type < 0) return -1; - + if ($date_start && $date_end && $date_start > $date_end) { $langs->load("errors"); $this->error=$langs->trans('ErrorStartDateGreaterEnd'); @@ -2194,6 +2194,12 @@ class Commande extends CommonOrder // For triggers $line->fetch($lineid); + // Memorize previous line for triggers + $staticline=new OrderLine($this->db); + $staticline->fetch($lineid); + $staticline->fetch_optionals($lineid); + $line->oldline = $staticline; + if ($line->delete($user) > 0) { $result=$this->update_price(1); @@ -2947,7 +2953,7 @@ class Commande extends CommonOrder if (empty($txlocaltax2)) $txlocaltax2=0; if (empty($remise_percent)) $remise_percent=0; if (empty($special_code) || $special_code == 3) $special_code=0; - + if ($date_start && $date_end && $date_start > $date_end) { $langs->load("errors"); $this->error=$langs->trans('ErrorStartDateGreaterEnd'); @@ -2962,7 +2968,7 @@ class Commande extends CommonOrder $txtva=price2num($txtva); $txlocaltax1=price2num($txlocaltax1); $txlocaltax2=price2num($txlocaltax2); - + $this->db->begin(); // Calcul du total TTC et de la TVA pour la ligne a partir de From 631be04d5de1c7489af970338d94163dc174d61e Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Wed, 27 Mar 2019 12:15:50 +0100 Subject: [PATCH 0002/1497] better clone oldline and avoid emptylabel on update --- htdocs/commande/class/commande.class.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 6eff20da863..18495a68f50 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -2195,9 +2195,7 @@ class Commande extends CommonOrder $line->fetch($lineid); // Memorize previous line for triggers - $staticline=new OrderLine($this->db); - $staticline->fetch($lineid); - $staticline->fetch_optionals($lineid); + $staticline = clone $line; $line->oldline = $staticline; if ($line->delete($user) > 0) @@ -3054,7 +3052,7 @@ class Commande extends CommonOrder } $this->line->rowid=$rowid; - $this->line->label=$label; + $this->line->label=!empty($label)?$label:$this->line->oldline->label; $this->line->desc=$desc; $this->line->qty=$qty; From c860c0dc4a72c35b38dfc5aee34ba968a1e1a13b Mon Sep 17 00:00:00 2001 From: BENKE Charlene <1179011+defrance@users.noreply.github.com> Date: Thu, 26 Nov 2020 11:47:45 +0100 Subject: [PATCH 0003/1497] Add default BOM --- htdocs/install/mysql/tables/llx_product.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/install/mysql/tables/llx_product.sql b/htdocs/install/mysql/tables/llx_product.sql index 2431c884c62..a1ccf065ffa 100644 --- a/htdocs/install/mysql/tables/llx_product.sql +++ b/htdocs/install/mysql/tables/llx_product.sql @@ -100,5 +100,6 @@ create table llx_product desiredstock float DEFAULT 0, fk_unit integer DEFAULT NULL, price_autogen tinyint DEFAULT 0, + fk_default_bom integer DEFAULT NULL, fk_project integer DEFAULT NULL -- Used when product was generated by a project or is specifif to a project )ENGINE=innodb; From c2bd30a7e92445e10b6ffd0cc90b3121178d8816 Mon Sep 17 00:00:00 2001 From: BENKE Charlene <1179011+defrance@users.noreply.github.com> Date: Thu, 26 Nov 2020 11:59:00 +0100 Subject: [PATCH 0004/1497] working progress --- htdocs/install/mysql/migration/12.0.0-13.0.0.sql | 1 + htdocs/product/class/product.class.php | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql index c83755009ae..95d6d208145 100644 --- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql +++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql @@ -29,6 +29,7 @@ -- Missing in v12 or lower +ALTER TABLE llx_product ADD COLUMN fk_default_bom integer DEFAULT NULL; ALTER TABLE llx_payment_salary MODIFY COLUMN ref varchar(30) NULL; ALTER TABLE llx_payment_various MODIFY COLUMN ref varchar(30) NULL; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 03d81d4fd64..40d63c4643f 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -248,6 +248,13 @@ class Product extends CommonObject */ public $finished; + /** + * fk_default_bom indicates the default bom + * + * @var int + */ + public $fk_default_bom; + /** * We must manage lot/batch number, sell-by date and so on : '1':yes '0':no * @@ -996,6 +1003,7 @@ class Product extends CommonObject $sql .= ", tobuy = ".(int) $this->status_buy; $sql .= ", tobatch = ".((empty($this->status_batch) || $this->status_batch < 0) ? '0' : (int) $this->status_batch); $sql .= ", finished = ".((!isset($this->finished) || $this->finished < 0 || $this->finished == '') ? "null" : (int) $this->finished); + $sql .= ", fk_default_bom = ".((!isset($this->fk_default_bom) || $this->fk_default_bom < 0 || $this->fk_default_bom == '') ? "null" : (int) $this->fk_default_bom); $sql .= ", net_measure = ".($this->net_measure != '' ? "'".$this->db->escape($this->net_measure)."'" : 'null'); $sql .= ", net_measure_units = ".($this->net_measure_units != '' ? "'".$this->db->escape($this->net_measure_units)."'" : 'null'); $sql .= ", weight = ".($this->weight != '' ? "'".$this->db->escape($this->weight)."'" : 'null'); @@ -2046,7 +2054,7 @@ class Product extends CommonObject $sql .= " price_min, price_min_ttc, price_base_type, cost_price, default_vat_code, tva_tx, recuperableonly as tva_npr, localtax1_tx, localtax2_tx, localtax1_type, localtax2_type, tosell,"; $sql .= " tobuy, fk_product_type, duration, fk_default_warehouse, seuil_stock_alerte, canvas, net_measure, net_measure_units, weight, weight_units,"; $sql .= " length, length_units, width, width_units, height, height_units,"; - $sql .= " surface, surface_units, volume, volume_units, barcode, fk_barcode_type, finished,"; + $sql .= " surface, surface_units, volume, volume_units, barcode, fk_barcode_type, finished,fk_default_bom,"; $sql .= " accountancy_code_buy, accountancy_code_buy_intra, accountancy_code_buy_export,"; $sql .= " accountancy_code_sell, accountancy_code_sell_intra, accountancy_code_sell_export, stock, pmp,"; $sql .= " datec, tms, import_key, entity, desiredstock, tobatch, fk_unit,"; @@ -2107,8 +2115,10 @@ class Product extends CommonObject $this->localtax2_tx = $obj->localtax2_tx; $this->localtax1_type = $obj->localtax1_type; $this->localtax2_type = $obj->localtax2_type; - + $this->finished = $obj->finished; + $this->fk_default_bom = $obj->fk_default_bom; + $this->duration = $obj->duration; $this->duration_value = substr($obj->duration, 0, dol_strlen($obj->duration) - 1); $this->duration_unit = substr($obj->duration, -1); From 5b40950f500f5a2de2e3a7bc58c8f12b42bd70af Mon Sep 17 00:00:00 2001 From: BENKE Charlene <1179011+defrance@users.noreply.github.com> Date: Thu, 26 Nov 2020 12:45:06 +0100 Subject: [PATCH 0005/1497] Update card.php add on card --- htdocs/product/card.php | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 6fdfb82e354..5fed4bc4ca1 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -17,7 +17,7 @@ * Copyright (C) 2016 Meziane Sof * Copyright (C) 2017 Josep Lluís Amador * Copyright (C) 2019 Frédéric France - * Copyright (C) 2019-2020 Thibault FOUCART + * Copyright (C) 2019-2020 Thibault FOUCART * Copyright (C) 2020 Pierre Ardoin * * This program is free software; you can redistribute it and/or modify @@ -59,6 +59,7 @@ if (!empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/command if (!empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; if (!empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; if (!empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; +if (!empty($conf->bom->enabled)) require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php'; // Load translation files required by the page $langs->loadLangs(array('products', 'other')); @@ -454,6 +455,13 @@ if (empty($reshook)) $object->finished = null; } + $fk_default_bom = GETPOST('fk_default_bom', 'int'); + if ($fk_default_bom >= 0) { + $object->fk_default_bom = $fk_default_bom; + } else { + $object->fk_default_bom = null; + } + $units = GETPOST('units', 'int'); if ($units > 0) { $object->fk_unit = $units; @@ -1567,6 +1575,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) print $formproduct->selectProductNature('finished', $object->finished); print ''; + if ($conf->bom->enabled) { + print ''.$form->textwithpicto($langs->trans("DefaultBOM"), $langs->trans("DefaultBOMDesc")).''; + $bomkey = "Bom:bom/class/bom.class.php:0:t.status=1 AND t.fk_product=".$object->id; + print $form->selectForForms($bomkey, 'fk_default_bom', $object->fk_default_bom, 1); + print ''; + } + // Brut Weight print ''.$langs->trans("Weight").''; print ' '; @@ -2059,6 +2074,16 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) print $object->getLibFinished(); print ''; + if ($conf->bom->enabled) { + print ''.$form->textwithpicto($langs->trans("DefaultBOM"), $langs->trans("DefaultBOMDesc")).''; + if ($object->fk_default_bom) { + $bom_static = new BOM($db); + $bom_static->fetch($object->fk_default_bom); + print $bom_static->getNomUrl(1); + } + print ''; + } + // Brut Weight print ''.$langs->trans("Weight").''; if ($object->weight != '') From 98e482de71c72da6692f5fc4aeeec7019c4dec3d Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 22 Mar 2021 06:53:09 +0100 Subject: [PATCH 0006/1497] Add text for popup --- htdocs/langs/en_US/accountancy.lang | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index c635809404e..3785961246e 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -328,6 +328,9 @@ ACCOUNTING_DISABLE_BINDING_ON_PURCHASES=Disable binding & transfer in accountanc ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS=Disable binding & transfer in accountancy on expense reports (expense reports will not be taken into account in accounting) ## Export +NotifiedExportDate=Notified export date +NotifiedValidationDate=Validation of the entries (modification or deletion of the entries will not be possible) +ConfirmExportFile=Confirmation of the generation of the accounting export file ? ExportDraftJournal=Export draft journal Modelcsv=Model of export Selectmodelcsv=Select a model of export From 49faedae6fef9775b889a063921ee252aa06ffad Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 24 Mar 2021 11:56:23 +0100 Subject: [PATCH 0007/1497] Work on date_validation --- htdocs/accountancy/bookkeeping/card.php | 95 ++++++++++++------- htdocs/accountancy/bookkeeping/list.php | 51 +++++++++- .../accountancy/class/bookkeeping.class.php | 46 +++++++-- 3 files changed, 146 insertions(+), 46 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index e3cac139c08..03600781319 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2017 Florian Henry - * Copyright (C) 2013-2018 Alexandre Spangaro + * Copyright (C) 2013-2021 Alexandre Spangaro * Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2018-2020 Frédéric France * @@ -537,6 +537,22 @@ if ($action == 'create') { print ''; print ''; + // Date document creation + print ''; + print ''.$langs->trans("DateExport").''; + print ''; + print $object->date_export ? dol_print_date($object->date_export, 'dayhour') : ' '; + print ''; + print ''; + + // Date document creation + print ''; + print ''.$langs->trans("DateValidation").''; + print ''; + print $object->date_validation ? dol_print_date($object->date_validation, 'dayhour') : ' '; + print ''; + print ''; + // Validate /* print ''; @@ -619,7 +635,9 @@ if ($action == 'create') { print_liste_field_titre("LabelOperation"); print_liste_field_titre("Debit", "", "", "", "", 'class="right"'); print_liste_field_titre("Credit", "", "", "", "", 'class="right"'); - print_liste_field_titre("Action", "", "", "", "", 'width="60" class="center"'); + if (empty($object->date_validation)) { + print_liste_field_titre("Action", "", "", "", "", 'width="60" class="center"'); + } print "\n"; @@ -665,18 +683,22 @@ if ($action == 'create') { print ''.price($line->debit).''; print ''.price($line->credit).''; - print ''; - print 'id.'&piece_num='.urlencode($line->piece_num).'&mode='.urlencode($mode).'&token='.urlencode(newToken()).'">'; - print img_edit('', 0, 'class="marginrightonly"'); - print '  '; - - $actiontodelete = 'delete'; - if ($mode == '_tmp' || $action != 'delmouv') { - $actiontodelete = 'confirm_delete'; + if (empty($line->date_export) || empty($line->date_validation)) { + print ''; + print 'id . '&piece_num=' . urlencode($line->piece_num) . '&mode=' . urlencode($mode) . '&token=' . urlencode(newToken()) . '">'; + print img_edit('', 0, 'class="marginrightonly"'); + print '  '; } - print ''; - print img_delete(); + if (empty($line->date_validation)) { + $actiontodelete = 'delete'; + if ($mode == '_tmp' || $action != 'delmouv') { + $actiontodelete = 'confirm_delete'; + } + + print ''; + print img_delete(); + } print ''; print ''; @@ -691,32 +713,33 @@ if ($action == 'create') { setEventMessages(null, array($langs->trans('MvtNotCorrectlyBalanced', $total_debit, $total_credit)), 'warnings'); } - if ($action == "" || $action == 'add') { - print ''; - print ''; - print ''; - print $formaccounting->select_account('', 'accountingaccount_number', 1, array(), 1, 1, ''); - print ''; - print ''; - // TODO For the moment we keep a free input text instead of a combo. The select_auxaccount has problem because: - // It does not use the setup of "key pressed" to select a thirdparty and this hang browser on large databases. - // Also, it is not possible to use a value that is not in the list. - // Also, the label is not automatically filled when a value is selected. - if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) { - print $formaccounting->select_auxaccount('', 'subledger_account', 1); - } else { - print ''; + if (empty($object->date_export) || empty($object->date_validation)) { + if ($action == "" || $action == 'add') { + print ''; + print ''; + print ''; + print $formaccounting->select_account('', 'accountingaccount_number', 1, array(), 1, 1, ''); + print ''; + print ''; + // TODO For the moment we keep a free input text instead of a combo. The select_auxaccount has problem because: + // It does not use the setup of "key pressed" to select a thirdparty and this hang browser on large databases. + // Also, it is not possible to use a value that is not in the list. + // Also, the label is not automatically filled when a value is selected. + if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) { + print $formaccounting->select_auxaccount('', 'subledger_account', 1); + } else { + print ''; + } + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; } - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + print ''; } - print ''; - if ($mode == '_tmp' && $action == '') { print '
'; diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 40a8284adc4..dcaa16ffd4e 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2016 Florian Henry - * Copyright (C) 2013-2020 Alexandre Spangaro + * Copyright (C) 2013-2021 Alexandre Spangaro * Copyright (C) 2016-2017 Laurent Destailleur * Copyright (C) 2018-2021 Frédéric France * @@ -53,6 +53,8 @@ $search_date_modification_start = dol_mktime(0, 0, 0, GETPOST('date_modification $search_date_modification_end = dol_mktime(0, 0, 0, GETPOST('date_modification_endmonth', 'int'), GETPOST('date_modification_endday', 'int'), GETPOST('date_modification_endyear', 'int')); $search_date_export_start = dol_mktime(0, 0, 0, GETPOST('date_export_startmonth', 'int'), GETPOST('date_export_startday', 'int'), GETPOST('date_export_startyear', 'int')); $search_date_export_end = dol_mktime(0, 0, 0, GETPOST('date_export_endmonth', 'int'), GETPOST('date_export_endday', 'int'), GETPOST('date_export_endyear', 'int')); +$search_date_validation_start = dol_mktime(0, 0, 0, GETPOST('date_validation_startmonth', 'int'), GETPOST('date_validation_startday', 'int'), GETPOST('date_validation_startyear', 'int')); +$search_date_validation_end = dol_mktime(0, 0, 0, GETPOST('date_validation_endmonth', 'int'), GETPOST('date_validation_endday', 'int'), GETPOST('date_validation_endyear', 'int')); //var_dump($search_date_start);exit; if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_delmvt")) { @@ -157,6 +159,7 @@ $arrayfields = array( 't.date_creation'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0), 't.tms'=>array('label'=>$langs->trans("DateModification"), 'checked'=>0), 't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>1), + 't.date_validated'=>array('label'=>$langs->trans("DateValidation"), 'checked'=>1), ); if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) { @@ -224,6 +227,8 @@ if (empty($reshook)) { $search_date_modification_end = ''; $search_date_export_start = ''; $search_date_export_end = ''; + $search_date_validation_start = ''; + $search_date_validation_end = ''; $search_debit = ''; $search_credit = ''; $search_lettering_code = ''; @@ -328,6 +333,16 @@ if (empty($reshook)) { $tmp = dol_getdate($search_date_export_end); $param .= '&date_export_endmonth='.urlencode($tmp['mon']).'&date_export_endday='.urlencode($tmp['mday']).'&date_export_endyear='.urlencode($tmp['year']); } + if (!empty($search_date_validation_start)) { + $filter['t.date_validated>='] = $search_date_validation_start; + $tmp = dol_getdate($search_date_validation_start); + $param .= '&date_validation_startmonth='.urlencode($tmp['mon']).'&date_validation_startday='.urlencode($tmp['mday']).'&date_validation_startyear='.urlencode($tmp['year']); + } + if (!empty($search_date_validation_end)) { + $filter['t.date_validated<='] = $search_date_validation_end; + $tmp = dol_getdate($search_date_validation_end); + $param .= '&date_validation_endmonth='.urlencode($tmp['mon']).'&date_validation_endday='.urlencode($tmp['mday']).'&date_validation_endyear='.urlencode($tmp['year']); + } if (!empty($search_debit)) { $filter['t.debit'] = $search_debit; $param .= '&search_debit='.urlencode($search_debit); @@ -447,7 +462,8 @@ $sql .= " t.journal_label,"; $sql .= " t.piece_num,"; $sql .= " t.date_creation,"; $sql .= " t.tms as date_modification,"; -$sql .= " t.date_export"; +$sql .= " t.date_export,"; +$sql .= " t.date_validated as date_validation"; $sql .= ' FROM '.MAIN_DB_PREFIX.$object->table_element.' as t'; // Manage filter $sqlwhere = array(); @@ -469,6 +485,8 @@ if (count($filter) > 0) { $sqlwhere[] = $key.'\''.$db->idate($value).'\''; } elseif ($key == 't.date_export>=' || $key == 't.date_export<=') { $sqlwhere[] = $key.'\''.$db->idate($value).'\''; + } elseif ($key == 't.date_validated>=' || $key == 't.date_validated<=') { + $sqlwhere[] = $key.'\''.$db->idate($value).'\''; } elseif ($key == 't.credit' || $key == 't.debit') { $sqlwhere[] = natural_search($key, $value, 1, 1); } elseif ($key == 't.reconciled_option') { @@ -846,6 +864,17 @@ if (!empty($arrayfields['t.date_export']['checked'])) { print ''; print ''; } +// Date validation +if (!empty($arrayfields['t.date_validated']['checked'])) { + print ''; + print '
'; + print $form->selectDate($search_date_validation_start, 'date_validation_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); + print '
'; + print '
'; + print $form->selectDate($search_date_validation_end, 'date_validation_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); + print '
'; + print ''; +} // Action column print ''; $searchpicto = $form->showFilterButtons(); @@ -897,6 +926,9 @@ if (!empty($arrayfields['t.tms']['checked'])) { if (!empty($arrayfields['t.date_export']['checked'])) { print_liste_field_titre($arrayfields['t.date_export']['label'], $_SERVER['PHP_SELF'], "t.date_export", "", $param, '', $sortfield, $sortorder, 'center '); } +if (!empty($arrayfields['t.date_validated']['checked'])) { + print_liste_field_titre($arrayfields['t.date_validated']['label'], $_SERVER['PHP_SELF'], "t.date_validated", "", $param, '', $sortfield, $sortorder, 'center '); +} print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); print "\n"; @@ -939,6 +971,7 @@ while ($i < min($num, $limit)) { $line->date_creation = $db->jdate($obj->date_creation); $line->date_modification = $db->jdate($obj->date_modification); $line->date_export = $db->jdate($obj->date_export); + $line->date_validation = $db->jdate($obj->date_validation); $total_debit += $line->debit; $total_credit += $line->credit; @@ -1131,12 +1164,22 @@ while ($i < min($num, $limit)) { } } + // Validated operation date + if (!empty($arrayfields['t.date_validated']['checked'])) { + print ''.dol_print_date($line->date_validation, 'dayhour').''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Action column print ''; - if (empty($line->date_export)) { + if (empty($line->date_export) || empty($line->date_validation)) { if ($user->rights->accounting->mouvements->creer) { - print ''.img_edit().''; + print '' . img_edit() . ''; } + } + if (empty($line->date_validation)) { if ($user->rights->accounting->mouvements->supprimer) { print ''.img_delete().''; } diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 7286e954d0e..d1939b84665 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -135,7 +135,6 @@ class BookKeeping extends CommonObject /** * @var float FEC:Amount (Not necessary) - * @deprecated No more used */ public $amount; @@ -722,7 +721,9 @@ class BookKeeping extends CommonObject $sql .= " t.code_journal,"; $sql .= " t.journal_label,"; $sql .= " t.piece_num,"; - $sql .= " t.date_creation"; + $sql .= " t.date_creation,"; + $sql .= " t.date_export,"; + $sql .= " t.date_validated as date_validation"; $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.$mode.' as t'; $sql .= ' WHERE 1 = 1'; $sql .= " AND entity IN (".getEntity('accountancy').")"; @@ -763,6 +764,9 @@ class BookKeeping extends CommonObject $this->journal_label = $obj->journal_label; $this->piece_num = $obj->piece_num; $this->date_creation = $this->db->jdate($obj->date_creation); + $this->date_export = $this->db->jdate($obj->date_export); + $this->date_validation = $this->db->jdate($obj->date_validated); + $this->date_validation = $this->db->jdate($obj->date_validation); } $this->db->free($resql); @@ -828,7 +832,8 @@ class BookKeeping extends CommonObject $sql .= " t.journal_label,"; $sql .= " t.piece_num,"; $sql .= " t.date_creation,"; - $sql .= " t.date_export"; + $sql .= " t.date_export,"; + $sql .= " t.date_validated as date_validation"; // Manage filter $sqlwhere = array(); if (count($filter) > 0) { @@ -847,6 +852,8 @@ class BookKeeping extends CommonObject $sqlwhere[] = $key.'\''.$this->db->idate($value).'\''; } elseif ($key == 't.date_export>=' || $key == 't.date_export<=') { $sqlwhere[] = $key.'\''.$this->db->idate($value).'\''; + } elseif ($key == 't.date_validated>=' || $key == 't.date_validated<=') { + $sqlwhere[] = $key.'\''.$this->db->idate($value).'\''; } elseif ($key == 't.credit' || $key == 't.debit') { $sqlwhere[] = natural_search($key, $value, 1, 1); } elseif ($key == 't.reconciled_option') { @@ -920,6 +927,8 @@ class BookKeeping extends CommonObject $line->piece_num = $obj->piece_num; $line->date_creation = $this->db->jdate($obj->date_creation); $line->date_export = $this->db->jdate($obj->date_export); + $line->date_validation = $this->db->jdate($obj->date_validated); + $line->date_validation = $this->db->jdate($obj->date_validation); $this->lines[] = $line; @@ -982,6 +991,7 @@ class BookKeeping extends CommonObject $sql .= " t.date_lim_reglement,"; $sql .= " t.tms as date_modification,"; $sql .= " t.date_export"; + $sql .= " t.date_validated as date_validation,"; $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; // Manage filter $sqlwhere = array(); @@ -1003,6 +1013,8 @@ class BookKeeping extends CommonObject $sqlwhere[] = $key.'\''.$this->db->idate($value).'\''; } elseif ($key == 't.date_export>=' || $key == 't.date_export<=') { $sqlwhere[] = $key.'\''.$this->db->idate($value).'\''; + } elseif ($key == 't.date_validated>=' || $key == 't.date_validated<=') { + $sqlwhere[] = $key.'\''.$this->db->idate($value).'\''; } elseif ($key == 't.credit' || $key == 't.debit') { $sqlwhere[] = natural_search($key, $value, 1, 1); } else { @@ -1062,6 +1074,8 @@ class BookKeeping extends CommonObject $line->date_lim_reglement = $this->db->jdate($obj->date_lim_reglement); $line->date_modification = $this->db->jdate($obj->date_modification); $line->date_export = $this->db->jdate($obj->date_export); + $line->date_validation = $this->db->jdate($obj->date_validated); + $line->date_validation = $this->db->jdate($obj->date_validation); $this->lines[] = $line; @@ -1442,6 +1456,8 @@ class BookKeeping extends CommonObject $sql .= " AND code_journal = '".$this->db->escape($journal)."'"; } $sql .= " AND entity IN (".getEntity('accountancy').")"; + // Exclusion of validated entries at the time of deletion + $sql .= " AND date_validated IS NULL"; // TODO: In a future we must forbid deletion if record is inside a closed fiscal period. @@ -1591,7 +1607,8 @@ class BookKeeping extends CommonObject { global $conf; - $sql = "SELECT piece_num,doc_date,code_journal,journal_label,doc_ref,doc_type,date_creation"; + $sql = "SELECT piece_num, doc_date,code_journal, journal_label, doc_ref, doc_type,"; + $sql .= " date_creation, tms as date_modification, date_export, date_validated as date_validation"; $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element.$mode; $sql .= " WHERE piece_num = ".$piecenum; $sql .= " AND entity IN (".getEntity('accountancy').")"; @@ -1608,6 +1625,10 @@ class BookKeeping extends CommonObject $this->doc_ref = $obj->doc_ref; $this->doc_type = $obj->doc_type; $this->date_creation = $obj->date_creation; + $this->date_modification = $obj->date_modification; + $this->date_export = $obj->date_export; + $this->date_validation = $obj->date_validated; + $this->date_validation = $obj->date_validation; } else { $this->error = "Error ".$this->db->lasterror(); dol_syslog(__METHOD__.$this->error, LOG_ERR); @@ -1663,7 +1684,8 @@ class BookKeeping extends CommonObject $sql = "SELECT rowid, doc_date, doc_type,"; $sql .= " doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,"; $sql .= " numero_compte, label_compte, label_operation, debit, credit,"; - $sql .= " montant as amount, sens, fk_user_author, import_key, code_journal, journal_label, piece_num, date_creation"; + $sql .= " montant as amount, sens, fk_user_author, import_key, code_journal, journal_label, piece_num,"; + $sql .= " date_creation, tms as date_modification, date_export, date_validated as date_validation"; $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element.$mode; $sql .= " WHERE piece_num = ".$piecenum; $sql .= " AND entity IN (".getEntity('accountancy').")"; @@ -1696,6 +1718,10 @@ class BookKeeping extends CommonObject $line->journal_label = $obj->journal_label; $line->piece_num = $obj->piece_num; $line->date_creation = $obj->date_creation; + $line->date_modification = $obj->date_modification; + $line->date_export = $obj->date_export; + $line->date_validation = $obj->date_validated; + $line->date_validation = $obj->date_validation; $this->linesmvt[] = $line; } @@ -1723,7 +1749,8 @@ class BookKeeping extends CommonObject $sql = "SELECT rowid, doc_date, doc_type,"; $sql .= " doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,"; $sql .= " numero_compte, label_compte, label_operation, debit, credit,"; - $sql .= " montant as amount, sens, fk_user_author, import_key, code_journal, piece_num"; + $sql .= " montant as amount, sens, fk_user_author, import_key, code_journal, piece_num,"; + $sql .= " date_validated as date_validation"; $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element; $sql .= " WHERE entity IN (".getEntity('accountancy').")"; @@ -1758,6 +1785,8 @@ class BookKeeping extends CommonObject $line->sens = $obj->sens; $line->code_journal = $obj->code_journal; $line->piece_num = $obj->piece_num; + $line->date_validation = $obj->date_validated; + $line->date_validation = $obj->date_validation; $this->linesexport[] = $line; } @@ -2091,4 +2120,9 @@ class BookKeepingLine * @var integer|string $date_export; */ public $date_export; + + /** + * @var integer|string $date_validation; + */ + public $date_validation; } From 305b338a116f60af5583b36f8071718dc5849e7c Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 19 Apr 2021 06:03:03 +0200 Subject: [PATCH 0008/1497] Update notified --- htdocs/accountancy/bookkeeping/list.php | 36 +++++++++++++------ .../class/accountancycategory.class.php | 2 +- .../accountancy/class/bookkeeping.class.php | 4 +-- htdocs/langs/en_US/accountancy.lang | 4 +-- 4 files changed, 30 insertions(+), 16 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 9ad21bb2e0a..429aac9b877 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -524,10 +524,15 @@ if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->ex $accountancyexport = new AccountancyExport($db); $accountancyexport->export($object->lines, $formatexportset); + $notifiedexportdate = GETPOST('notifiedexportdate', 'alpha'); + $notifiedvalidationdate = GETPOST('notifiedvalidationdate', 'alpha'); + + dol_syslog("date_export/date_validated=".$notifiedexportdate.'/'.$notifiedvalidationdate, LOG_DEBUG); + if (!empty($accountancyexport->errors)) { setEventMessages('', $accountancyexport->errors, 'errors'); - } else { - // Specify as export : update field date_export + } elseif (!$notifiedexportdate || !$notifiedvalidationdate) { + // Specify as export : update field date_export or date_validated $error = 0; $db->begin(); @@ -536,8 +541,15 @@ if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->ex $now = dol_now(); $sql = " UPDATE ".MAIN_DB_PREFIX."accounting_bookkeeping"; - $sql .= " SET date_export = '".$db->idate($now)."'"; - $sql .= " , date_validated = '".$db->idate($now)."'"; + $sql .= " SET"; + if (!$notifiedexportdate && !$notifiedvalidationdate) { + $sql .= " date_export = '".$db->idate($now)."'"; + $sql .= ", date_validated = '".$db->idate($now)."'"; + } elseif (!$notifiedexportdate) { + $sql .= " date_export = '".$db->idate($now)."'"; + } elseif (!$notifiedvalidationdate) { + $sql .= " date_validated = '".$db->idate($now)."'"; + } $sql .= " WHERE rowid = ".((int) $movement->id); dol_syslog("/accountancy/bookeeping/list.php Function export_file Specify movements as exported sql=".$sql, LOG_DEBUG); @@ -551,11 +563,11 @@ if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->ex if (!$error) { $db->commit(); - // setEventMessages($langs->trans("AllExportedMovementsWereRecordedAsExported"), null, 'mesgs'); + // setEventMessages($langs->trans("AllExportedMovementsWereRecordedAsExportedOrValidated"), null, 'mesgs'); } else { $error++; $db->rollback(); - setEventMessages($langs->trans("NotAllExportedMovementsCouldBeRecordedAsExported"), null, 'errors'); + setEventMessages($langs->trans("NotAllExportedMovementsCouldBeRecordedAsExportedOrValidated"), null, 'errors'); } } exit; @@ -603,6 +615,8 @@ if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords) { llxHeader('', $title_page); +$formconfirm = ''; + if ($action == 'export_file') { $form_question = array(); @@ -614,17 +628,15 @@ if ($action == 'export_file') { ); $form_question['notifiedvalidationdate'] = array( 'name' => 'notifiedvalidationdate', - 'type' => 'checkbox', // We don't use select here, the journal_array is already a select html component + 'type' => 'checkbox', 'label' => $langs->trans('NotifiedValidationDate'), 'value' => (!empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_VALIDATION_DATE) ? 'false' : 'true'), ); - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 300); - print $formconfirm; + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 300, 600); } if ($action == 'delmouv') { $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?mvt_num='.GETPOST('mvt_num').$param, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvtPartial'), 'delmouvconfirm', '', 0, 1); - print $formconfirm; } if ($action == 'delbookkeepingyear') { $form_question = array(); @@ -664,9 +676,11 @@ if ($action == 'delbookkeepingyear') { ); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt', $langs->transnoentitiesnoconv("RegistrationInAccounting")), 'delbookkeepingyearconfirm', $form_question, '', 1, 300); - print $formconfirm; } +// Print form confirm +print $formconfirm; + //$param=''; param started before if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { $param .= '&contextpage='.urlencode($contextpage); diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index 9550933f2d8..75f1275c142 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -263,7 +263,7 @@ class AccountancyCategory // extends CommonObject if ($id) { $sql .= " WHERE t.rowid = ".((int) $id); } else { - $sql .= " WHERE t.entity IN (".getEntity('c_accounting_category').")"; // Dont't use entity if you use rowid + $sql .= " WHERE t.entity IN (".getEntity('c_accounting_category').")"; // Don't use entity if you use rowid if ($code) { $sql .= " AND t.code = '".$this->db->escape($code)."'"; } elseif ($label) { diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index afb9b502a9e..611dfcdc30c 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -993,8 +993,8 @@ class BookKeeping extends CommonObject $sql .= " t.date_creation,"; $sql .= " t.date_lim_reglement,"; $sql .= " t.tms as date_modification,"; - $sql .= " t.date_export"; - $sql .= " t.date_validated as date_validation,"; + $sql .= " t.date_export,"; + $sql .= " t.date_validated as date_validation"; $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; // Manage filter $sqlwhere = array(); diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 69d2a4e22e2..0d38544dacb 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -328,7 +328,7 @@ ACCOUNTING_DISABLE_BINDING_ON_PURCHASES=Disable binding & transfer in accountanc ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS=Disable binding & transfer in accountancy on expense reports (expense reports will not be taken into account in accounting) ## Export -NotifiedExportDate=Notified export date +NotifiedExportDate=Notified export date (modification of the entries will not be possible) NotifiedValidationDate=Validation of the entries (modification or deletion of the entries will not be possible) ConfirmExportFile=Confirmation of the generation of the accounting export file ? ExportDraftJournal=Export draft journal @@ -430,4 +430,4 @@ WarningReportNotReliable=Warning, this report is not based on the Ledger, so doe ExpenseReportJournal=Expense Report Journal InventoryJournal=Inventory Journal -NAccounts=%s accounts \ No newline at end of file +NAccounts=%s accounts From 894eb1e5a418f9e0c2d7c60490a8dfc1083bee17 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Mon, 19 Apr 2021 14:34:11 +0200 Subject: [PATCH 0009/1497] NEW : "+" and "-" to show / hide batch details on product "stock" tab --- htdocs/admin/stock.php | 15 +++++++++ htdocs/langs/en_US/stocks.lang | 3 +- htdocs/langs/fr_FR/stocks.lang | 1 + htdocs/product/stock/product.php | 56 ++++++++++++++++++++++++++++++-- 4 files changed, 71 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 39a9e5ae601..c2d64d977c3 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -758,6 +758,21 @@ if ($conf->use_javascript_ajax) { } print "\n"; print "\n"; + +if (!empty($conf->productbatch->enabled)) { + print ''; + print '' . $langs->trans("ShowAllBatchByDefault") . ''; + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('STOCK_SHOW_ALL_BATCH_BY_DEFAULT'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("STOCK_SHOW_ALL_BATCH_BY_DEFAULT", $arrval, $conf->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT); + } + print "\n"; + print "\n"; +} + print ''; print ''; diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index 1b54e53d6de..376b86fcef7 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -240,4 +240,5 @@ InventoryRealQtyHelp=Set value to 0 to reset qty
Keep field empty, or remove UpdateByScaning=Update by scaning UpdateByScaningProductBarcode=Update by scan (product barcode) UpdateByScaningLot=Update by scan (lot|serial barcode) -DisableStockChangeOfSubProduct=Deactivate the stock change for all the subproducts of this Kit during this movement. \ No newline at end of file +DisableStockChangeOfSubProduct=Deactivate the stock change for all the subproducts of this Kit during this movement. +ShowAllBatchByDefault=By default, show batch details on product "stock" tab diff --git a/htdocs/langs/fr_FR/stocks.lang b/htdocs/langs/fr_FR/stocks.lang index 444c546b853..cf178141f74 100644 --- a/htdocs/langs/fr_FR/stocks.lang +++ b/htdocs/langs/fr_FR/stocks.lang @@ -242,3 +242,4 @@ UpdateByScaning=Mise à jour par scan UpdateByScaningProductBarcode=Mettre à jour par scan (code-barres produit) UpdateByScaningLot=Mise à jour par scan (code barres lot/série) DisableStockChangeOfSubProduct=Désactiver les mouvements de stock des composants pour tout mouvement de stock de ce kit +ShowAllBatchByDefault=Dérouler par défaut le détail des lots dans l'onglet "stock" diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index d1c1ea99ff7..1b72404011b 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -9,6 +9,7 @@ * Copyright (C) 2014-2015 Cédric Gross * Copyright (C) 2015 Marcos García * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2021 Gauthier VERDOL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -522,6 +523,48 @@ if ($id > 0 || $ref) llxHeader('', $title, $helpurl); + ?> + + + + 0) { $head = product_prepare_head($object); @@ -828,7 +871,10 @@ if (!$variants) { print ''; if ((!empty($conf->productbatch->enabled)) && $object->hasbatch()) { $colspan = 3; - print ''; + print ''; + print ''.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").''; + print ''.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").''; + print ''; print ''.$langs->trans("batch_number").''; if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { $colspan--; @@ -880,7 +926,11 @@ if (!$variants) { $stock_real = price2num($obj->reel, 'MS'); print ''; - print ''.$entrepotstatic->getNomUrl(1).''; + print ''; + if(!empty($conf->productbatch->enabled)) { + print '' . (empty($conf->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT) ? '(+)' : '(-)') . ' '; + } + print $entrepotstatic->getNomUrl(1).''; print ''.$stock_real.($stock_real < 0 ? ' '.img_warning() : '').''; // PMP print ''.(price2num($object->pmp) ? price2num($object->pmp, 'MU') : '').''; @@ -934,7 +984,7 @@ if (!$variants) { print ''; print ''; } else { - print "\n".''; + print "\n".''; print img_picto($langs->trans("Tranfer"), 'uparrow', 'class="hideonsmartphone"').' '; print 'id.'">'.$langs->trans("TransferStock").''; // Disabled, because edition of stock content must use the "Correct stock menu". From a79823742f464f0bbbe5ca217debf0c37c13d37e Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 19 Apr 2021 12:41:17 +0000 Subject: [PATCH 0010/1497] Fixing style errors. --- htdocs/product/stock/product.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 1b72404011b..17b209b845a 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -927,7 +927,7 @@ if (!$variants) { $stock_real = price2num($obj->reel, 'MS'); print ''; print ''; - if(!empty($conf->productbatch->enabled)) { + if (!empty($conf->productbatch->enabled)) { print '' . (empty($conf->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT) ? '(+)' : '(-)') . ' '; } print $entrepotstatic->getNomUrl(1).''; From 2236d1b07fa6c5967d8ab46049608dc0790e188d Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Mon, 19 Apr 2021 14:46:28 +0200 Subject: [PATCH 0011/1497] FIX : Hide all and check all links always available --- htdocs/product/stock/product.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 1b72404011b..8e17eb0c885 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -545,8 +545,6 @@ if ($id > 0 || $ref) }); $("#show_all").click(function() { - $(this).hide(); - $("#hide_all").show(); $("[class^=batch_warehouse]").show(); $("[class^=collapse_batch]").html('(-) '); return false; @@ -554,8 +552,6 @@ if ($id > 0 || $ref) $("#hide_all").click(function() { $("[class^=batch_warehouse]").hide(); - $(this).hide(); - $("#show_all").show(); $("[class^=collapse_batch]").html('(+) '); return false; }); @@ -872,8 +868,8 @@ if (!$variants) { if ((!empty($conf->productbatch->enabled)) && $object->hasbatch()) { $colspan = 3; print ''; - print ''.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").''; - print ''.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").''; + print ''.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").'
'; + print ''.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").''; print ''; print ''.$langs->trans("batch_number").''; if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { From 72ea2a56ea216e803d789719d88ddfc4416b64a2 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Tue, 20 Apr 2021 10:02:53 +0200 Subject: [PATCH 0012/1497] NEW : help text --- htdocs/langs/en_US/stocks.lang | 1 + htdocs/langs/fr_FR/stocks.lang | 1 + htdocs/product/stock/product.php | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index 376b86fcef7..fa686b7baa3 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -242,3 +242,4 @@ UpdateByScaningProductBarcode=Update by scan (product barcode) UpdateByScaningLot=Update by scan (lot|serial barcode) DisableStockChangeOfSubProduct=Deactivate the stock change for all the subproducts of this Kit during this movement. ShowAllBatchByDefault=By default, show batch details on product "stock" tab +CollapseBatchDetailHelp=You can set batch detail default display in stocks module configuration diff --git a/htdocs/langs/fr_FR/stocks.lang b/htdocs/langs/fr_FR/stocks.lang index cf178141f74..53118bc6b36 100644 --- a/htdocs/langs/fr_FR/stocks.lang +++ b/htdocs/langs/fr_FR/stocks.lang @@ -243,3 +243,4 @@ UpdateByScaningProductBarcode=Mettre à jour par scan (code-barres produit) UpdateByScaningLot=Mise à jour par scan (code barres lot/série) DisableStockChangeOfSubProduct=Désactiver les mouvements de stock des composants pour tout mouvement de stock de ce kit ShowAllBatchByDefault=Dérouler par défaut le détail des lots dans l'onglet "stock" +CollapseBatchDetailHelp=Vous pouvez définir l'affichage par défaut du détail des lots dans la configuration du module stocks diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 97ccccb1cbc..b97903f0e84 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -869,7 +869,8 @@ if (!$variants) { $colspan = 3; print ''; print ''.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").'
'; - print ''.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").''; + print ''.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").' '; + print $form->textwithpicto('', $langs->trans('CollapseBatchDetailHelp'), 1, 'help', ''); print ''; print ''.$langs->trans("batch_number").''; if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { From 1b7854e69825206acea25602c6d12e6a60247d25 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 26 Apr 2021 10:15:28 +0200 Subject: [PATCH 0013/1497] added security to suggestion page index.php (securekey and id encoded) --- htdocs/public/project/index.php | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index 03f26ed2f37..65237be02ac 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -78,7 +78,23 @@ $langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", // No check on module enabled. Done later according to $validpaymentmethod $action = GETPOST('action', 'aZ09'); -$id = dol_decode(GETPOST('id'), $dolibarr_main_instance_unique_id); + +$encodedid = GETPOST('id'); +$id = dol_decode($encodedid, $dolibarr_main_instance_unique_id); + +// Getting 'securekey'.'id' from Post and decoding it +$encodedsecurekeyandid = GETPOST('securekey', 'alpha'); +$securekeyandid = dol_decode($encodedsecurekeyandid, $dolibarr_main_instance_unique_id); + +// Securekey decomposition into pure securekey and id added at the end +$securekey = substr($securekeyandid, 0, strlen($securekeyandid)-strlen($encodedid)); +$idgotfromsecurekey = dol_decode(substr($securekeyandid, -strlen($encodedid), strlen($encodedid)), $dolibarr_main_instance_unique_id); + +// We check if the securekey collected is OK and if the id collected is the same than the id in the securekey +if ($securekey != $conf->global->EVENTORGANIZATION_SECUREKEY || $idgotfromsecurekey != $id) { + print $langs->trans('MissingOrBadSecureKey'); + exit; +} // Define $urlwithroot //$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); @@ -113,15 +129,6 @@ $replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
' : '').'
'; llxHeader($head, $langs->trans("PaymentForm"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea); -// Show sandbox warning -if ((empty($paymentmethod) || $paymentmethod == 'paypal') && !empty($conf->paypal->enabled) && (!empty($conf->global->PAYPAL_API_SANDBOX) || GETPOST('forcesandbox', 'int'))) { // We can force sand box with param 'forcesandbox' - dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Paypal'), '', 'warning'); -} -if ((empty($paymentmethod) || $paymentmethod == 'stripe') && !empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'int'))) { - dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning'); -} - - print ''."\n"; print '
'."\n"; print '
'."\n"; From 45531d0f1aab5d18a0c63793239a7ab4b4fc0af2 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 26 Apr 2021 10:39:22 +0200 Subject: [PATCH 0014/1497] index suggestion page form added, needs to be improved to show only necessary fields --- htdocs/public/project/index.php | 600 +++++++++++++++++++++++++------- 1 file changed, 478 insertions(+), 122 deletions(-) diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index 65237be02ac..f493b2a379f 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -1,10 +1,11 @@ - * Copyright (C) 2006-2017 Laurent Destailleur - * Copyright (C) 2009-2012 Regis Houssin - * Copyright (C) 2018 Juanjo Menent - * Copyright (C) 2018-2019 Thibault FOUCART - * Copyright (C) 2021 Waël Almoman +/* Copyright (C) 2001-2002 Rodolphe Quiedeville + * Copyright (C) 2001-2002 Jean-Louis Bergamo + * Copyright (C) 2006-2013 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2012 J. Fernando Lagrange + * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2018 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,21 +19,22 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * - * For Paypal test: https://developer.paypal.com/ - * For Paybox test: ??? - * For Stripe test: Use credit card 4242424242424242 .More example on https://stripe.com/docs/testing - * - * Variants: - * - When option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION is on, we use the new PaymentIntent API - * - When option STRIPE_USE_NEW_CHECKOUT is on, we use the new checkout API - * - If no option set, we use old APIS (charge) */ /** - * \file htdocs/public/payment/newpayment.php - * \ingroup core - * \brief File to offer a way to make a payment for a particular Dolibarr object + * \file htdocs/public/members/new.php + * \ingroup member + * \brief Example of form to add a new member + * + * Note that you can add following constant to change behaviour of page + * MEMBER_NEWFORM_AMOUNT Default amount for auto-subscribe form + * MEMBER_NEWFORM_EDITAMOUNT 0 or 1 = Amount can be edited + * MEMBER_NEWFORM_PAYONLINE Suggest payment with paypal, paybox or stripe + * MEMBER_NEWFORM_DOLIBARRTURNOVER Show field turnover (specific for dolibarr foundation) + * MEMBER_URL_REDIRECT_SUBSCRIPTION Url to redirect once subscribe submitted + * MEMBER_NEWFORM_FORCETYPE Force type of member + * MEMBER_NEWFORM_FORCEMORPHY Force nature of member (mor/phy) + * MEMBER_NEWFORM_FORCECOUNTRYCODE Force country */ if (!defined('NOLOGIN')) { @@ -47,41 +49,52 @@ if (!defined('NOIPCHECK')) { if (!defined('NOBROWSERNOTIF')) { define('NOBROWSERNOTIF', '1'); } +if (!defined('NOIPCHECK')) { + define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +} // For MultiCompany module. -// Do not use GETPOST here, function is not defined and get of entity must be done before including main.inc.php -$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : (!empty($_GET['e']) ? (int) $_GET['e'] : (!empty($_POST['e']) ? (int) $_POST['e'] : 1)))); +// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php +// TODO This should be useless. Because entity must be retrieve from object ref and not from url. +$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); if (is_numeric($entity)) { define("DOLENTITY", $entity); } require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; -require_once DOL_DOCUMENT_ROOT.'/societe/class/societeaccount.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; +require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; -// Hook to be used by external payment modules (ie Payzen, ...) -include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; -$hookmanager = new HookManager($db); -$hookmanager->initHooks(array('newpayment')); +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/paymentterm.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -// For encryption global $dolibarr_main_instance_unique_id; +global $dolibarr_main_url_root; -// Load translation files -$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", "paybox", "paypal", "stripe")); // File with generic data - -// Security check -// No check on module enabled. Done later according to $validpaymentmethod - +// Init vars +$errmsg = ''; +$num = 0; +$error = 0; +$backtopage = GETPOST('backtopage', 'alpha'); $action = GETPOST('action', 'aZ09'); +$email = GETPOST("email"); +$societe = GETPOST("societe"); + +// Getting id from Post and decoding it $encodedid = GETPOST('id'); $id = dol_decode($encodedid, $dolibarr_main_instance_unique_id); +$project = new Project($db); +$resultproject = $project->fetch($id); +if ($resultproject < 0) { + $error++; + $errmsg .= $project->error; +} + // Getting 'securekey'.'id' from Post and decoding it $encodedsecurekeyandid = GETPOST('securekey', 'alpha'); $securekeyandid = dol_decode($encodedsecurekeyandid, $dolibarr_main_instance_unique_id); @@ -96,108 +109,447 @@ if ($securekey != $conf->global->EVENTORGANIZATION_SECUREKEY || $idgotfromsecure exit; } -// Define $urlwithroot -//$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); -//$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file -$urlwithroot = DOL_MAIN_URL_ROOT; // This is to use same domain name than current. For Paypal payment, we can use internal URL like localhost. +// Load translation files +$langs->loadLangs(array("main", "companies", "install", "other", "eventorganization")); -$project = new Project($db); -$resultproject = $project->fetch($id); -if ($resultproject < 0) { - $error++; - $errmsg .= $project->error; +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('publicnewmembercard', 'globalcard')); + +$extrafields = new ExtraFields($db); + +$user->loadDefaultValues(); + + +/** + * Show header for new member + * + * @param string $title Title + * @param string $head Head array + * @param int $disablejs More content into html header + * @param int $disablehead More content into html header + * @param array $arrayofjs Array of complementary js files + * @param array $arrayofcss Array of complementary css files + * @return void + */ +function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '') +{ + global $user, $conf, $langs, $mysoc; + + top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers + + print ''; + + // Define urllogo + $urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png'; + + if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); + } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); + } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { + $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; + } + + print '
'; + // Output html code for logo + if ($urllogo) { + print '
'; + print '
'; + print ''; + print '
'; + if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { + print ''; + } + print '
'; + } + print '
'; + + print '
'; } +/** + * Show footer for new member + * + * @return void + */ +function llxFooterVierge() +{ + print '
'; + + printCommonFooter('public'); + + print "\n"; + print "\n"; +} + + + /* * Actions */ +global $mysoc; +$parameters = array(); +// Note that $action and $object may have been modified by some hooks +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + +// Action called when page is submitted +if (empty($reshook) && $action == 'add') { + $error = 0; + + $urlback = ''; + + $db->begin(); + + if (!GETPOST("email")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."
\n"; + } + // If the price has been set, name is required for the invoice + if (!GETPOST("societe") && !empty(floatval($project->price_registration))) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Societe"))."
\n"; + } + if (GETPOST("email") && !isValidEmail(GETPOST("email"))) { + $error++; + $langs->load("errors"); + $errmsg .= $langs->trans("ErrorBadEMail", GETPOST("email"))."
\n"; + } + if (!GETPOST("country_id")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Country"))."
\n"; + } + + if (!$error) { + // Check if attendee already exists (by email and for this event) + $confattendee = new ConferenceOrBoothAttendee($db); + $resultfetchconfattendee = $confattendee->fetchAll('', '', 0, 0, array('t.fk_actioncomm'=>$id, 'customsql'=>'t.email="'.$email.'"')); + if ($resultfetchconfattendee > 0 && count($resultfetchconfattendee)>0) { + // Found confattendee + $confattendee = array_shift($resultfetchconfattendee); + } else { + // Need to create a confattendee + $confattendee->date_subscription = dol_now(); + $confattendee->email = $email; + $confattendee->fk_actioncomm = $id; + $resultconfattendee = $confattendee->create($user); + if ($resultconfattendee < 0) { + $error++; + $errmsg .= $confattendee->error; + } + } + // At this point, we have an attendee. It may not be linked to a thirdparty if we just created it + + // If the attendee has already paid + if ($confattendee->status == 1) { + $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?securekey='.dol_encode($conf->global->EVENTORGANIZATION_SECUREKEY, $dolibarr_main_instance_unique_id); + Header("Location: ".$redirection); + exit; + } + // Getting the thirdparty or creating it + $thirdparty = new Societe($db); + // Fetch using fk_soc if the attendee was already existing + if (!empty($confattendee->fk_soc)) { + $resultfetchthirdparty = $thirdparty->fetch($confattendee->fk_soc); + } else { + // Fetch using the input field by user if we just created the attendee + if (!empty($societe)) { + $resultfetchthirdparty = $thirdparty->fetch('', $societe); + if ($resultfetchthirdparty<=0) { + // Need to create a new one (not found or multiple with the same name) + $resultfetchthirdparty = 0; + } else { + // We found an unique result with that name, so we put in in fk_soc of attendee + $confattendee->fk_soc = $thirdparty->id; + $confattendee->update($user); + } + } else { + // Need to create a thirdparty (put number>0 if we do not want to create a thirdparty for free-conferences) + $resultfetchthirdparty = 0; + } + } + if ($resultfetchthirdparty<0) { + $error++; + $errmsg .= $thirdparty->error; + } elseif ($resultfetchthirdparty==0) { + // creation of a new thirdparty + if (!empty($societe)) { + $thirdparty->name = $societe; + } else { + $thirdparty->name = $email; + } + $thirdparty->address = GETPOST("address"); + $thirdparty->zip = GETPOST("zipcode"); + $thirdparty->town = GETPOST("town"); + $thirdparty->client = 2; + $thirdparty->fournisseur = 0; + $thirdparty->country_id = GETPOST("country_id", 'int'); + $thirdparty->state_id = GETPOST("state_id", 'int'); + $thirdparty->email = $email; + + // Load object modCodeTiers + $module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); + if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { + $module = substr($module, 0, dol_strlen($module) - 4); + } + $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); + foreach ($dirsociete as $dirroot) { + $res = dol_include_once($dirroot.$module.'.php'); + if ($res) { + break; + } + } + $modCodeClient = new $module($db); + + if (empty($tmpcode) && !empty($modCodeClient->code_auto)) { + $tmpcode = $modCodeClient->getNextValue($thirdparty, 0); + } + $thirdparty->code_client = $tmpcode; + $readythirdparty = $thirdparty->create($user); + if ($readythirdparty <0) { + $error++; + $errmsg .= $thirdparty->error; + } else { + $thirdparty->country_code = getCountry($thirdparty->country_id, 2, $db, $langs); + $thirdparty->country = getCountry($thirdparty->country_code, 0, $db, $langs); + $confattendee->fk_soc = $thirdparty->id; + $confattendee->update($user); + } + } + } + + if (!$error) { + $db->commit(); + if (!empty(floatval($project->price_registration))) { + $productforinvoicerow = new Product($db); + $resultprod = $productforinvoicerow->fetch($conf->global->SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION); + if ($resultprod < 0) { + $error++; + $errmsg .= $productforinvoicerow->error; + } else { + $facture = new Facture($db); + $facture->type = Facture::TYPE_STANDARD; + $facture->socid = $thirdparty->id; + $facture->paye = 0; + $facture->date = dol_now(); + $facture->cond_reglement_id = $confattendee->cond_reglement_id; + + if (empty($facture->cond_reglement_id)) { + $paymenttermstatic = new PaymentTerm($confattendee->db); + $facture->cond_reglement_id = $paymenttermstatic->getDefaultId(); + if (empty($facture->cond_reglement_id)) { + $error++; + $confattendee->error = 'ErrorNoPaymentTermRECEPFound'; + $confattendee->errors[] = $confattendee->error; + } + } + $resultfacture = $facture->create($user); + if ($resultfacture <= 0) { + $confattendee->error = $facture->error; + $confattendee->errors = $facture->errors; + $error++; + } else { + $facture->add_object_linked($confattendee->element, $confattendee->id); + } + } + + if (!$error) { + // Add line to draft invoice + $vattouse = get_default_tva($mysoc, $thirdparty, $productforinvoicerow->id); + $result = $facture->addline($langs->trans("ConferenceAttendeeFee", $conference->label, dol_print_date($conference->datep, '%d/%m/%y %H:%M:%S'), dol_print_date($conference->datep2, '%d/%m/%y %H:%M:%S')), floatval($project->price_registration), 1, $vattouse, 0, 0, $productforinvoicerow->id, 0, dol_now(), '', 0, 0, '', 'HT', 0, 1); + if ($result <= 0) { + $confattendee->error = $facture->error; + $confattendee->errors = $facture->errors; + $error++; + } + if (!$error) { + $valid = true; + $sourcetouse = 'conferencesubscription'; + $reftouse = $facture->id; + $redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?source='.$sourcetouse.'&ref='.$reftouse; + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { + $redirection .= '&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $sourcetouse . $reftouse, 2); // Use the source in the hash to avoid duplicates if the references are identical + } else { + $redirection .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; + } + } + Header("Location: ".$redirection); + exit; + } + } + } else { + // No price has been set + // Validating the subscription + $confattendee->setStatut(1); + + // Sending mail + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); + // Load traductions files required by page + $outputlangs->loadLangs(array("main", "members")); + // Get email content from template + $arraydefaultmessage = null; + + $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; + if (!empty($labeltouse)) { + $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); + } + + if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); + + $sendto = $thirdparty->email; + $from = $conf->global->MAILING_EMAIL_FROM; + $urlback = $_SERVER["REQUEST_URI"]; + + $ishtml = dol_textishtml($texttosend); // May contain urls + + $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); + + $result = $mailfile->sendfile(); + if ($result) { + dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); + } else { + dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); + } + + $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?securekey='.dol_encode($conf->global->EVENTORGANIZATION_SECUREKEY, $dolibarr_main_instance_unique_id); + Header("Location: ".$redirection); + exit; + } + //Header("Location: ".$urlback); + //exit; + } else { + $db->rollback(); + } +} /* * View */ -$head = ''; -if (!empty($conf->global->ONLINE_PAYMENT_CSS_URL)) { - $head = ''."\n"; -} +$form = new Form($db); +$formcompany = new FormCompany($db); -$conf->dol_hide_topmenu = 1; -$conf->dol_hide_leftmenu = 1; - -$replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
' : '').'
'; -llxHeader($head, $langs->trans("PaymentForm"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea); +llxHeaderVierge($langs->trans("NewSuggestion")); -print ''."\n"; -print '
'."\n"; -print ''."\n"; -print ''."\n"; -print ''."\n"; -print ''."\n"; -print ''."\n"; -print ''."\n"; -print ''; -print ''; -print "\n"; +print load_fiche_titre($langs->trans("NewSuggestion"), '', '', 0, 0, 'center'); -// Show logo (search order: logo defined by PAYMENT_LOGO_suffix, then PAYMENT_LOGO, then small company logo, large company logo, theme logo, common logo) -// Define logo and logosmall -$logosmall = $mysoc->logo_small; -$logo = $mysoc->logo; -$paramlogo = 'ONLINE_PAYMENT_LOGO_'.$suffix; -if (!empty($conf->global->$paramlogo)) { - $logosmall = $conf->global->$paramlogo; -} elseif (!empty($conf->global->ONLINE_PAYMENT_LOGO)) { - $logosmall = $conf->global->ONLINE_PAYMENT_LOGO; -} -//print ''."\n"; -// Define urllogo -$urllogo = ''; -$urllogofull = ''; -if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall)) { - $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); - $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); -} elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) { - $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); - $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); -} +print '
'; +print '
'; +print '
'; -// Output html code for logo -if ($urllogo) { - print '
'; - print '
'; - print ''; - print '
'; - if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { - print ''; - } - print '
'; -} - -print ''."\n"; - -$text = ''."\n"; +// Welcome message +$text = '
'; $text .= ''."\n"; -$text .= ''."\n";; - +$text .= ''."\n";; print $text; +print ''; -// Output payment summary form -print ''."\n"; - -print '

'.$langs->trans("EvntOrgRegistrationWelcomeMessage").'
'.$langs->trans("EvntOrgRegistrationWelcomeMessage").'
'.$langs->trans("EvntOrgRegistrationHelpMessage").' '.$id.'.

'.$project->note_public.'

'.$project->note_public.'
'; +dol_htmloutput_errors($errmsg); -$found = false; -$error = 0; -$var = false; +// Print form +print ''."\n"; +print ''; +print ''; +print ''; +print ''; +print ''; -$object = null; +print '
'; -print "\n"; +print '
'.$langs->trans("FieldsWithAreMandatory", '*').'
'; +//print $langs->trans("FieldsWithIsForPublic",'**').'
'; + +print dol_get_fiche_head(''); + +print ''; + +print ''."\n"; + +// Email +print ''."\n"; +// Company +print ''."\n"; +// Address +print ''."\n"; +// Zip / Town +print ''; +// Country +print ''; +// State +if (empty($conf->global->SOCIETE_DISABLE_STATE)) { + print ''; +} + +print "
'.$langs->trans("Email").'*
'.$langs->trans("Company"); +if (!empty(floatval($project->price_registration))) { + print '*'; +} +print '
'.$langs->trans("Address").''."\n"; +print '
'.$langs->trans('Zip').' / '.$langs->trans('Town').''; +print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6, 1); +print ' / '; +print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); +print '
'.$langs->trans('Country').'*'; +$country_id = GETPOST('country_id'); +if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { + $country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); +} +if (!$country_id && !empty($conf->geoipmaxmind->enabled)) { + $country_code = dol_user_country(); + //print $country_code; + if ($country_code) { + $new_country_id = getCountry($country_code, 3, $db, $langs); + //print 'xxx'.$country_code.' - '.$new_country_id; + if ($new_country_id) { + $country_id = $new_country_id; + } + } +} +$country_code = getCountry($country_id, 2, $db, $langs); +print $form->select_country($country_id, 'country_id'); +print '
'.$langs->trans('State').''; + if ($country_code) { + print $formcompany->select_state(GETPOST("state_id"), $country_code); + } else { + print ''; + } + print '
\n"; + +print dol_get_fiche_end(); // Show all action buttons +print '
'; print '
'; // Output introduction text if ($project->accept_conference_suggestions) { @@ -209,20 +561,24 @@ print '

'; if ($project->accept_booth_suggestions) { print ''; } +print '
'; + +print '

'; + +// Save +print '
'; +print ''; +if (!empty($backtopage)) { + print '     '; +} +print '
'; - -print '
'."\n"; - -print ''."\n"; -print '
'."\n"; -print '
'; +print "\n"; +print "
"; +print '
'; -htmlPrintOnlinePaymentFooter($mysoc, $langs, 1, $suffix, $object); - -llxFooter('', 'public'); +llxFooterVierge(); $db->close(); From bced3d60dd17cae8f3cb555f471b654aa350ed57 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 26 Apr 2021 11:11:23 +0200 Subject: [PATCH 0015/1497] added required name to the form --- htdocs/public/project/index.php | 200 ++++---------------------------- 1 file changed, 23 insertions(+), 177 deletions(-) diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index f493b2a379f..3aeab9997b5 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -208,8 +208,11 @@ if (empty($reshook) && $action == 'add') { $error++; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."
\n"; } - // If the price has been set, name is required for the invoice - if (!GETPOST("societe") && !empty(floatval($project->price_registration))) { + if (!GETPOST("lastname")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Name"))."
\n"; + } + if (!GETPOST("societe")) { $error++; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Societe"))."
\n"; } @@ -224,63 +227,12 @@ if (empty($reshook) && $action == 'add') { } if (!$error) { - // Check if attendee already exists (by email and for this event) - $confattendee = new ConferenceOrBoothAttendee($db); - $resultfetchconfattendee = $confattendee->fetchAll('', '', 0, 0, array('t.fk_actioncomm'=>$id, 'customsql'=>'t.email="'.$email.'"')); - if ($resultfetchconfattendee > 0 && count($resultfetchconfattendee)>0) { - // Found confattendee - $confattendee = array_shift($resultfetchconfattendee); - } else { - // Need to create a confattendee - $confattendee->date_subscription = dol_now(); - $confattendee->email = $email; - $confattendee->fk_actioncomm = $id; - $resultconfattendee = $confattendee->create($user); - if ($resultconfattendee < 0) { - $error++; - $errmsg .= $confattendee->error; - } - } - // At this point, we have an attendee. It may not be linked to a thirdparty if we just created it - - // If the attendee has already paid - if ($confattendee->status == 1) { - $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?securekey='.dol_encode($conf->global->EVENTORGANIZATION_SECUREKEY, $dolibarr_main_instance_unique_id); - Header("Location: ".$redirection); - exit; - } // Getting the thirdparty or creating it $thirdparty = new Societe($db); - // Fetch using fk_soc if the attendee was already existing - if (!empty($confattendee->fk_soc)) { - $resultfetchthirdparty = $thirdparty->fetch($confattendee->fk_soc); - } else { - // Fetch using the input field by user if we just created the attendee - if (!empty($societe)) { - $resultfetchthirdparty = $thirdparty->fetch('', $societe); - if ($resultfetchthirdparty<=0) { - // Need to create a new one (not found or multiple with the same name) - $resultfetchthirdparty = 0; - } else { - // We found an unique result with that name, so we put in in fk_soc of attendee - $confattendee->fk_soc = $thirdparty->id; - $confattendee->update($user); - } - } else { - // Need to create a thirdparty (put number>0 if we do not want to create a thirdparty for free-conferences) - $resultfetchthirdparty = 0; - } - } - if ($resultfetchthirdparty<0) { - $error++; - $errmsg .= $thirdparty->error; - } elseif ($resultfetchthirdparty==0) { - // creation of a new thirdparty - if (!empty($societe)) { - $thirdparty->name = $societe; - } else { - $thirdparty->name = $email; - } + $resultfetchthirdparty = $thirdparty->fetch('', $societe); + if ($resultfetchthirdparty<=0) { + // Need to create a new one (not found or multiple with the same name) + $thirdparty->name = $societe; $thirdparty->address = GETPOST("address"); $thirdparty->zip = GETPOST("zipcode"); $thirdparty->town = GETPOST("town"); @@ -315,126 +267,16 @@ if (empty($reshook) && $action == 'add') { } else { $thirdparty->country_code = getCountry($thirdparty->country_id, 2, $db, $langs); $thirdparty->country = getCountry($thirdparty->country_code, 0, $db, $langs); - $confattendee->fk_soc = $thirdparty->id; - $confattendee->update($user); } } - } - - if (!$error) { + // From there we have a thirdparty, now looking for the contact + $contact = new Contact($db); + $resultcontact = $contact->fetch('', $user, '', $email); + if ($resultcontact<=0) { + // Need to create a contact + } + // We have the contact and the thirdparty $db->commit(); - if (!empty(floatval($project->price_registration))) { - $productforinvoicerow = new Product($db); - $resultprod = $productforinvoicerow->fetch($conf->global->SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION); - if ($resultprod < 0) { - $error++; - $errmsg .= $productforinvoicerow->error; - } else { - $facture = new Facture($db); - $facture->type = Facture::TYPE_STANDARD; - $facture->socid = $thirdparty->id; - $facture->paye = 0; - $facture->date = dol_now(); - $facture->cond_reglement_id = $confattendee->cond_reglement_id; - - if (empty($facture->cond_reglement_id)) { - $paymenttermstatic = new PaymentTerm($confattendee->db); - $facture->cond_reglement_id = $paymenttermstatic->getDefaultId(); - if (empty($facture->cond_reglement_id)) { - $error++; - $confattendee->error = 'ErrorNoPaymentTermRECEPFound'; - $confattendee->errors[] = $confattendee->error; - } - } - $resultfacture = $facture->create($user); - if ($resultfacture <= 0) { - $confattendee->error = $facture->error; - $confattendee->errors = $facture->errors; - $error++; - } else { - $facture->add_object_linked($confattendee->element, $confattendee->id); - } - } - - if (!$error) { - // Add line to draft invoice - $vattouse = get_default_tva($mysoc, $thirdparty, $productforinvoicerow->id); - $result = $facture->addline($langs->trans("ConferenceAttendeeFee", $conference->label, dol_print_date($conference->datep, '%d/%m/%y %H:%M:%S'), dol_print_date($conference->datep2, '%d/%m/%y %H:%M:%S')), floatval($project->price_registration), 1, $vattouse, 0, 0, $productforinvoicerow->id, 0, dol_now(), '', 0, 0, '', 'HT', 0, 1); - if ($result <= 0) { - $confattendee->error = $facture->error; - $confattendee->errors = $facture->errors; - $error++; - } - if (!$error) { - $valid = true; - $sourcetouse = 'conferencesubscription'; - $reftouse = $facture->id; - $redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?source='.$sourcetouse.'&ref='.$reftouse; - if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { - if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { - $redirection .= '&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $sourcetouse . $reftouse, 2); // Use the source in the hash to avoid duplicates if the references are identical - } else { - $redirection .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; - } - } - Header("Location: ".$redirection); - exit; - } - } - } else { - // No price has been set - // Validating the subscription - $confattendee->setStatut(1); - - // Sending mail - require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; - $formmail = new FormMail($db); - // Set output language - $outputlangs = new Translate('', $conf); - $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); - // Load traductions files required by page - $outputlangs->loadLangs(array("main", "members")); - // Get email content from template - $arraydefaultmessage = null; - - $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; - if (!empty($labeltouse)) { - $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); - } - - if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { - $subject = $arraydefaultmessage->topic; - $msg = $arraydefaultmessage->content; - } - - $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); - complete_substitutions_array($substitutionarray, $outputlangs, $object); - - $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); - $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); - - $sendto = $thirdparty->email; - $from = $conf->global->MAILING_EMAIL_FROM; - $urlback = $_SERVER["REQUEST_URI"]; - - $ishtml = dol_textishtml($texttosend); // May contain urls - - $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); - - $result = $mailfile->sendfile(); - if ($result) { - dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); - } else { - dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); - } - - $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?securekey='.dol_encode($conf->global->EVENTORGANIZATION_SECUREKEY, $dolibarr_main_instance_unique_id); - Header("Location: ".$redirection); - exit; - } - //Header("Location: ".$urlback); - //exit; } else { $db->rollback(); } @@ -495,6 +337,10 @@ jQuery(document).ready(function () { print ''."\n"; +// Name +print ''; +print ''; +print ''; // Email print ''."\n"; // Company @@ -553,13 +399,13 @@ print '
'; print '
'; // Output introduction text if ($project->accept_conference_suggestions) { - print ''; + print ''; print '

'; } -print ''; +print ''; print '

'; if ($project->accept_booth_suggestions) { - print ''; + print ''; } print '
'; From de63c93ad4c1b832e17d324fc188d59df660b338 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 26 Apr 2021 12:09:39 +0200 Subject: [PATCH 0016/1497] wip on creating the contact --- htdocs/public/project/index.php | 50 +++++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index 3aeab9997b5..0eb2acd209f 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -274,9 +274,55 @@ if (empty($reshook) && $action == 'add') { $resultcontact = $contact->fetch('', $user, '', $email); if ($resultcontact<=0) { // Need to create a contact + $contact->socid = $thirdparty->id; + $contact->lastname = (string) GETPOST("lastname", 'alpha'); + $contact->firstname = (string) GETPOST("firstname", 'alpha'); + $contact->address = (string) GETPOST("address", 'alpha'); + $contact->zip = (string) GETPOST("zipcode", 'alpha'); + $contact->town = (string) GETPOST("town", 'alpha'); + $contact->country_id = (int) GETPOST("country_id", 'int'); + $contact->state_id = (int) GETPOST("state_id", 'int'); + $contact->email = $email; + $contact->statut = 1; //Default status to Actif + + $resultcreatecontact = $contact->create($user); + if ($resultcreatecontact<0) { + $error++; + $errmsg .= $contact->error; + } + } + + if (!$error) { + // Adding supplier tag + $category = new Categorie($db); + if (GETPOST("suggestconference")) { + // Conference case + $resultcategory = $category->fetch($conf->global->EVENTORGANIZATION_CATEG_THIRDPARTY_CONF); + } else { + // Booth case + $resultcategory = $category->fetch($conf->global->EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH); + } + + if ($resultcategory<0) { + $error++; + $errmsg .= $category->error; + } else { + $contact->setCategoriesCommon($category->id, Categorie::TYPE_CONTACT, false); + $resultupdate = $contact->update($contact->id); + if ($resultupdate <= 0) { + $error++; + $errmsg .= $contact->error; + } + } + } + + if (!$error) { + // We have the contact and the thirdparty + + + + $db->commit(); } - // We have the contact and the thirdparty - $db->commit(); } else { $db->rollback(); } From 1b4b93bc6aca0ace30a9126fa8e6f62d3f599b50 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 26 Apr 2021 14:28:37 +0200 Subject: [PATCH 0017/1497] thirdparty/contact creation seems ok --- htdocs/core/class/commonobject.class.php | 2 +- htdocs/public/project/index.php | 61 +++++++++++------------- 2 files changed, 29 insertions(+), 34 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 2c9e81b369e..18868f70271 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -9156,6 +9156,7 @@ abstract class CommonObject if ($c->fetch($add) > 0) { $result = $c->add_type($this, $type_categ); if ($result < 0) { + var_dump($result); $error++; $this->error = $c->error; $this->errors = $c->errors; @@ -9165,7 +9166,6 @@ abstract class CommonObject } } } - return $error ? -1 * $error : $ok; } diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index 0eb2acd209f..ec8f0eca312 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -65,8 +65,9 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; -require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/paymentterm.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; @@ -270,29 +271,32 @@ if (empty($reshook) && $action == 'add') { } } // From there we have a thirdparty, now looking for the contact - $contact = new Contact($db); - $resultcontact = $contact->fetch('', $user, '', $email); - if ($resultcontact<=0) { - // Need to create a contact - $contact->socid = $thirdparty->id; - $contact->lastname = (string) GETPOST("lastname", 'alpha'); - $contact->firstname = (string) GETPOST("firstname", 'alpha'); - $contact->address = (string) GETPOST("address", 'alpha'); - $contact->zip = (string) GETPOST("zipcode", 'alpha'); - $contact->town = (string) GETPOST("town", 'alpha'); - $contact->country_id = (int) GETPOST("country_id", 'int'); - $contact->state_id = (int) GETPOST("state_id", 'int'); - $contact->email = $email; - $contact->statut = 1; //Default status to Actif - - $resultcreatecontact = $contact->create($user); - if ($resultcreatecontact<0) { - $error++; - $errmsg .= $contact->error; - } - } if (!$error) { + $contact = new Contact($db); + $resultcontact = $contact->fetch('', '', '', $email); + if ($resultcontact<=0) { + // Need to create a contact + $contact->socid = $thirdparty->id; + $contact->lastname = (string) GETPOST("lastname", 'alpha'); + $contact->firstname = (string) GETPOST("firstname", 'alpha'); + $contact->address = (string) GETPOST("address", 'alpha'); + $contact->zip = (string) GETPOST("zipcode", 'alpha'); + $contact->town = (string) GETPOST("town", 'alpha'); + $contact->country_id = (int) GETPOST("country_id", 'int'); + $contact->state_id = (int) GETPOST("state_id", 'int'); + $contact->email = $email; + $contact->statut = 1; //Default status to Actif + + $resultcreatecontact = $contact->create($user); + if ($resultcreatecontact<0) { + $error++; + $errmsg .= $contact->error; + } + } + } + // Only if we created the contact + if (!$error && $resultcontact<=0) { // Adding supplier tag $category = new Categorie($db); if (GETPOST("suggestconference")) { @@ -307,9 +311,8 @@ if (empty($reshook) && $action == 'add') { $error++; $errmsg .= $category->error; } else { - $contact->setCategoriesCommon($category->id, Categorie::TYPE_CONTACT, false); - $resultupdate = $contact->update($contact->id); - if ($resultupdate <= 0) { + $resultsetcategory = $contact->setCategoriesCommon(array($category->id), CATEGORIE::TYPE_CONTACT, false); + if ($resultsetcategory <=0) { $error++; $errmsg .= $contact->error; } @@ -454,16 +457,8 @@ if ($project->accept_booth_suggestions) { print ''; } print ''; - print '

'; -// Save -print '
'; -print ''; -if (!empty($backtopage)) { - print '     '; -} -print '
'; print "\n"; From dd9c42876a381b01f1891122c2a39c064d658cd6 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 26 Apr 2021 14:29:28 +0200 Subject: [PATCH 0018/1497] cleared test modif on core --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 18868f70271..2c9e81b369e 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -9156,7 +9156,6 @@ abstract class CommonObject if ($c->fetch($add) > 0) { $result = $c->add_type($this, $type_categ); if ($result < 0) { - var_dump($result); $error++; $this->error = $c->error; $this->errors = $c->errors; @@ -9166,6 +9165,7 @@ abstract class CommonObject } } } + return $error ? -1 * $error : $ok; } From a71697375764c9c20307ec04f204e2993eac199f Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 26 Apr 2021 15:44:08 +0200 Subject: [PATCH 0019/1497] form completed, tags added to thirdparty --- htdocs/public/project/index.php | 90 ++++++++++++++++++++++++-- htdocs/societe/class/societe.class.php | 2 +- 2 files changed, 84 insertions(+), 8 deletions(-) diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index ec8f0eca312..64fbea05505 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -84,6 +84,10 @@ $action = GETPOST('action', 'aZ09'); $email = GETPOST("email"); $societe = GETPOST("societe"); +$label = GETPOST("label"); +$note = GETPOST("note"); +$datestart = GETPOST("datestart"); +$dateend = GETPOST("dateend"); // Getting id from Post and decoding it $encodedid = GETPOST('id'); @@ -205,6 +209,26 @@ if (empty($reshook) && $action == 'add') { $db->begin(); + if (!GETPOST("email")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."
\n"; + } + if (!GETPOST("label")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label"))."
\n"; + } + if (!GETPOST("note")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Note"))."
\n"; + } + if (!GETPOST("datestart")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateStart"))."
\n"; + } + if (!GETPOST("dateend")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEnd"))."
\n"; + } if (!GETPOST("email")) { $error++; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."
\n"; @@ -295,9 +319,9 @@ if (empty($reshook) && $action == 'add') { } } } - // Only if we created the contact - if (!$error && $resultcontact<=0) { - // Adding supplier tag + + if (!$error) { + // Adding supplier tag and tag from setup to thirdparty $category = new Categorie($db); if (GETPOST("suggestconference")) { // Conference case @@ -311,18 +335,58 @@ if (empty($reshook) && $action == 'add') { $error++; $errmsg .= $category->error; } else { - $resultsetcategory = $contact->setCategoriesCommon(array($category->id), CATEGORIE::TYPE_CONTACT, false); + $resultsetcategory = $thirdparty->setCategoriesCommon(array($category->id), CATEGORIE::TYPE_CUSTOMER, false); if ($resultsetcategory <=0) { $error++; - $errmsg .= $contact->error; + $errmsg .= $thirdparty->error; } + $thirdparty->fournisseur = 1; + // Load object modCodeFournisseur + $module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); + if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { + $module = substr($module, 0, dol_strlen($module) - 4); + } + $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); + foreach ($dirsociete as $dirroot) { + $res = dol_include_once($dirroot.$module.'.php'); + if ($res) { + break; + } + } + $modCodeFournisseur = new $module; + if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) { + $tmpcode = $modCodeFournisseur->getNextValue($thirdparty, 0); + } + $thirdparty->code_fournisseur = $tmpcode; + + $res = $thirdparty->update(0); } } if (!$error) { + /* // We have the contact and the thirdparty - - + $conforbooth = new ConferenceOrBooth($db); + $conforbooth->label = $label; + $conforbooth->fk_soc = $thirdparty->id; + $conforbooth->fk_project = $project->id; + $conforbooth->note = $note; + //$conforbooth->fk_action = + $conforbooth->datep =$datestart; + $conforbooth->datep2 = $dateend; + $conforbooth->datec = dol_now(); + $conforbooth->tms = dol_now(); + //$conforbooth->fk_user_author = + //$conforbooth->fk_user_mod = + $conforbooth->status = CONFERENCEORBOOTH::STATUS_SUGGESTED; + $resultconforbooth = $conforbooth->create($user); + if ($resultconforbooth<=0) { + $error++; + $errmsg .= $conforbooth->error; + } else { + //conforbooth created + var_dump('gg'); + }*/ $db->commit(); } @@ -392,6 +456,18 @@ print '
'."\n"; +// Label +print ''."\n"; +print ''."\n"; +// Note +print ''."\n"; +print ''."\n"; +// Start Date +print ''."\n"; +print ''."\n"; +// End Date +print ''."\n"; +print ''."\n"; // Company print ''."\n"; print ''."\n"; // Start Date print ''."\n"; -print ''."\n"; +print ''."\n"; // End Date print ''."\n"; -print ''."\n"; +print ''."\n"; // Company print ''; print ''; } From cedb8adfe25280ca409495e1bfcf22e108ba590f Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Tue, 27 Apr 2021 09:52:11 +0200 Subject: [PATCH 0022/1497] removal of vardump --- htdocs/societe/card.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 64a46f9d1a8..68efa8e694c 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2468,7 +2468,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if ($tmpcheck != 0 && $tmpcheck != -5) { print ' ('.$langs->trans("WrongSupplierCode").')'; } - var_dump($tmpcheck); print ''; print ''; } From bfadcfc4bb430966330672c4d8cb969ac0a23e79 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Tue, 27 Apr 2021 10:49:10 +0200 Subject: [PATCH 0023/1497] added red star on label and note, that are required --- htdocs/public/project/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index d6614c8ed29..3a40649b183 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -464,10 +464,10 @@ print ''; // Email print ''."\n"; // Label -print ''."\n"; +print ''."\n"; print ''."\n"; // Note -print ''."\n"; +print ''."\n"; print ''."\n"; // Start Date print ''."\n"; From 151819b7adbe58ed7f9f693bf7d94abb41fa3ab8 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Tue, 27 Apr 2021 11:22:40 +0200 Subject: [PATCH 0024/1497] added payment redirection to pay a booth, or status update for free booth/conference --- htdocs/langs/en_US/eventorganization.lang | 1 + htdocs/public/project/index.php | 119 ++++++++++++++++++++-- 2 files changed, 113 insertions(+), 7 deletions(-) diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 6ef39e81ff6..6d15d599789 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -107,6 +107,7 @@ MissingOrBadSecureKey = The security key is invalid or missing EvntOrgWelcomeMessage = This form allows you to register as a new participant to the conference EvntOrgDuration = This conference starts on %s and ends on %s ConferenceAttendeeFee = Conference attendee fee for the event : '%s' occurring from %s to %s +BoothLocationFee = Booth location for the event : '%s' occurring from %s to %s # # SubscriptionOk page # diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index 3a40649b183..06e46e465eb 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -371,7 +371,6 @@ if (empty($reshook) && $action == 'add') { } if (!$error) { - /* // We have the contact and the thirdparty $conforbooth = new ConferenceOrBooth($db); $conforbooth->label = $label; @@ -383,17 +382,123 @@ if (empty($reshook) && $action == 'add') { $conforbooth->datep2 = $dateend; $conforbooth->datec = dol_now(); $conforbooth->tms = dol_now(); - //$conforbooth->fk_user_author = - //$conforbooth->fk_user_mod = - $conforbooth->status = CONFERENCEORBOOTH::STATUS_SUGGESTED; $resultconforbooth = $conforbooth->create($user); if ($resultconforbooth<=0) { $error++; $errmsg .= $conforbooth->error; } else { - //conforbooth created - var_dump('gg'); - }*/ + // If this is a paying booth, we have to redirect to payment page and create an invoice + if (GETPOST("suggestbooth") && !empty(floatval($project->price_booth))) { + $productforinvoicerow = new Product($db); + $resultprod = $productforinvoicerow->fetch($conf->global->SERVICE_BOOTH_LOCATION); + if ($resultprod < 0) { + $error++; + $errmsg .= $productforinvoicerow->error; + } else { + $facture = new Facture($db); + $facture->type = Facture::TYPE_STANDARD; + $facture->socid = $thirdparty->id; + $facture->paye = 0; + $facture->date = dol_now(); + $facture->cond_reglement_id = $contact->cond_reglement_id; + + if (empty($facture->cond_reglement_id)) { + $paymenttermstatic = new PaymentTerm($contact->db); + $facture->cond_reglement_id = $paymenttermstatic->getDefaultId(); + if (empty($facture->cond_reglement_id)) { + $error++; + $contact->error = 'ErrorNoPaymentTermRECEPFound'; + $contact->errors[] = $contact->error; + } + } + $resultfacture = $facture->create($user); + if ($resultfacture <= 0) { + $contact->error = $facture->error; + $contact->errors = $facture->errors; + $error++; + } else { + $facture->add_object_linked($contact->element, $contact->id); + } + } + + if (!$error) { + // Add line to draft invoice + $vattouse = get_default_tva($mysoc, $thirdparty, $productforinvoicerow->id); + $result = $facture->addline($langs->trans("BoothLocationFee", $conforbooth->label, dol_print_date($conforbooth->datep, '%d/%m/%y %H:%M:%S'), dol_print_date($conforbooth->datep2, '%d/%m/%y %H:%M:%S')), floatval($project->price_booth), 1, $vattouse, 0, 0, $productforinvoicerow->id, 0, dol_now(), '', 0, 0, '', 'HT', 0, 1); + if ($result <= 0) { + $contact->error = $facture->error; + $contact->errors = $facture->errors; + $error++; + } + if (!$error) { + $valid = true; + $sourcetouse = 'boothlocation'; + $reftouse = $facture->id; + $redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?source='.$sourcetouse.'&ref='.$reftouse; + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { + $redirection .= '&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $sourcetouse . $reftouse, 2); // Use the source in the hash to avoid duplicates if the references are identical + } else { + $redirection .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; + } + } + Header("Location: ".$redirection); + exit; + } + } + } else { + // If no price has been set for the booth or this is a conference, we confirm it as suggested and we update + $conforbooth->setStatut(CONFERENCEORBOOTH::STATUS_SUGGESTED); + $conforbooth->update($user); + + // Sending mail + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); + // Load traductions files required by page + $outputlangs->loadLangs(array("main", "members")); + // Get email content from template + $arraydefaultmessage = null; + + $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; + if (!empty($labeltouse)) { + $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); + } + + if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); + + $sendto = $thirdparty->email; + $from = $conf->global->MAILING_EMAIL_FROM; + $urlback = $_SERVER["REQUEST_URI"]; + + $ishtml = dol_textishtml($texttosend); // May contain urls + + $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); + + $result = $mailfile->sendfile(); + if ($result) { + dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); + } else { + dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); + } + + $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?securekey='.dol_encode($conf->global->EVENTORGANIZATION_SECUREKEY, $dolibarr_main_instance_unique_id); + Header("Location: ".$redirection); + exit; + } + } $db->commit(); } From b24b297a407da6d7fc4281b5ba6d2773de3fed5d Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Tue, 27 Apr 2021 12:30:49 +0200 Subject: [PATCH 0025/1497] adaptation of the payment for the booth location case --- htdocs/langs/en_US/eventorganization.lang | 5 +- htdocs/public/payment/newpayment.php | 107 +++++++++ htdocs/public/payment/paymentok.php | 272 ++++++++++++++++++---- htdocs/public/project/index.php | 2 +- 4 files changed, 341 insertions(+), 45 deletions(-) diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 6d15d599789..eb340795a1e 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -119,5 +119,6 @@ ConfAttendeeSubscriptionConfirmation = Confirmation of your subscription to a co # # Payment page # -Attendee = Participant -PaymentConferenceAttendee = Paiement de participation à une conférence +Attendee = Attendee +PaymentConferenceAttendee = Conference attendee payment +PaymentBoothLocation = Booth location payment diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index b351367f6ea..346e5f7bdda 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -142,6 +142,23 @@ if ($source == 'conferencesubscription') { } } } +} elseif ($source == 'boothlocation') { + // Getting the amount to pay, the invoice, finding the thirdparty + $invoiceid = GETPOST('ref'); + $invoice = new Facture($db); + $resultinvoice = $invoice->fetch($invoiceid); + if ($resultinvoice <= 0) { + setEventMessages(null, $invoice->errors, "errors"); + } else { + $amount = price2num($invoice->total_ttc); + // Finding the associated thirdparty + $thirdparty = new Societe($db); + $resultthirdparty = $thirdparty->fetch($invoice->socid); + if ($resultthirdparty <= 0) { + setEventMessages(null, $thirdparty->errors, "errors"); + } + $object = $thirdparty; + } } @@ -1862,6 +1879,96 @@ if ($source == 'conferencesubscription') { print ''."\n"; } +if ($source == 'boothlocation') { + $found = true; + $langs->load("members"); + + if (GETPOST('fulltag', 'alpha')) { + $fulltag = GETPOST('fulltag', 'alpha'); + } else { + $fulltag = 'BOO='.GETPOST("booth").'.DAT='.dol_print_date(dol_now(), '%Y%m%d%H%M%S'); + if (!empty($TAG)) { + $tag = $TAG; $fulltag .= '.TAG='.$TAG; + } + } + $fulltag = dol_string_unaccent($fulltag); + + // Creditor + print ''."\n"; + + // Debitor + print ''."\n"; + + // Object + $text = ''.$langs->trans("PaymentBoothLocation").''; + if (GETPOST('desc', 'alpha')) { + $text = ''.$langs->trans(GETPOST('desc', 'alpha')).''; + } + print ''."\n"; + + // Amount + print ''."\n"; + + // Tag + print ''."\n"; + + // Shipping address + $shipToName = $thirdparty->getFullName($langs); + $shipToStreet = $thirdparty->address; + $shipToCity = $thirdparty->town; + $shipToState = $thirdparty->state_code; + $shipToCountryCode = $thirdparty->country_code; + $shipToZip = $thirdparty->zip; + $shipToStreet2 = ''; + $phoneNum = $thirdparty->phone; + if ($shipToName && $shipToStreet && $shipToCity && $shipToCountryCode && $shipToZip) { + print ''; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + } else { + print ''."\n"; + } + print ''."\n"; + print ''."\n"; + $labeldesc = $langs->trans("PaymentSubscription"); + if (GETPOST('desc', 'alpha')) { + $labeldesc = GETPOST('desc', 'alpha'); + } + print ''."\n"; +} + + if (!$found && !$mesg) { $mesg = $langs->trans("ErrorBadParameters"); } diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 3d3946927c8..d8905d86eac 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -104,7 +104,6 @@ if (empty($FULLTAG)) { } $source = GETPOST('s', 'alpha') ? GETPOST('s', 'alpha') : GETPOST('source', 'alpha'); $ref = GETPOST('ref'); -$invoiceref = GETPOST('invoice'); $suffix = GETPOST("suffix", 'aZ09'); $membertypeid = GETPOST("membertypeid", 'int'); @@ -893,48 +892,51 @@ if ($ispaymentok) { // Sending mail $thirdparty = new Societe($db); - $thirdparty->fetch($attendeetovalidate->fk_soc); - - require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; - $formmail = new FormMail($db); - // Set output language - $outputlangs = new Translate('', $conf); - $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); - // Load traductions files required by page - $outputlangs->loadLangs(array("main", "members")); - // Get email content from template - $arraydefaultmessage = null; - - $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; - if (!empty($labeltouse)) { - $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); - } - - if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { - $subject = $arraydefaultmessage->topic; - $msg = $arraydefaultmessage->content; - } - - $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); - complete_substitutions_array($substitutionarray, $outputlangs, $object); - - $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); - $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); - - $sendto = $thirdparty->email; - $from = $conf->global->MAILING_EMAIL_FROM; - $urlback = $_SERVER["REQUEST_URI"]; - - $ishtml = dol_textishtml($texttosend); // May contain urls - - $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); - - $result = $mailfile->sendfile(); - if ($result) { - dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); + $resultthirdparty = $thirdparty->fetch($attendeetovalidate->fk_soc); + if ($resultthirdparty < 0) { + setEventMessages(null, $attendeetovalidate->errors, "errors"); } else { - dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); + // Load traductions files required by page + $outputlangs->loadLangs(array("main", "members")); + // Get email content from template + $arraydefaultmessage = null; + + $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; + if (!empty($labeltouse)) { + $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); + } + + if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); + + $sendto = $thirdparty->email; + $from = $conf->global->MAILING_EMAIL_FROM; + $urlback = $_SERVER["REQUEST_URI"]; + + $ishtml = dol_textishtml($texttosend); // May contain urls + + $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); + + $result = $mailfile->sendfile(); + if ($result) { + dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); + } else { + dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); + } } } } else { @@ -951,6 +953,192 @@ if ($ispaymentok) { } } elseif (array_key_exists('BOO', $tmptag) && $tmptag['BOO'] > 0) { // @todo BOOTH CASE (to copy and adapt from above) + // Record payment + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; + $object = new Facture($db); + $result = $object->fetch($ref); + if ($result) { + $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"]; + + $paymentTypeId = 0; + if ($paymentmethod == 'paybox') { + $paymentTypeId = $conf->global->PAYBOX_PAYMENT_MODE_FOR_PAYMENTS; + } + if ($paymentmethod == 'paypal') { + $paymentTypeId = $conf->global->PAYPAL_PAYMENT_MODE_FOR_PAYMENTS; + } + if ($paymentmethod == 'stripe') { + $paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS; + } + if (empty($paymentTypeId)) { + $paymentType = $_SESSION["paymentType"]; + if (empty($paymentType)) { + $paymentType = 'CB'; + } + $paymentTypeId = dol_getIdFromCode($db, $paymentType, 'c_paiement', 'code', 'id', 1); + } + + $currencyCodeType = $_SESSION['currencyCodeType']; + + // Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time) + if (!empty($FinalPaymentAmt) && $paymentTypeId > 0) { + $resultvalidate = $object->validate($user); + if ($resultvalidate < 0) { + $postactionmessages[] = 'Cannot validate invoice'; + $ispostactionok = -1; + $error++; // Not yet supported + } else { + $db->begin(); + + // Creation of payment line + include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; + $paiement = new Paiement($db); + $paiement->datepaye = $now; + if ($currencyCodeType == $conf->currency) { + $paiement->amounts = array($object->id => $FinalPaymentAmt); // Array with all payments dispatching with invoice id + } else { + $paiement->multicurrency_amounts = array($object->id => $FinalPaymentAmt); // Array with all payments dispatching + + $postactionmessages[] = 'Payment was done in a different currency that currency expected of company'; + $ispostactionok = -1; + $error++; // Not yet supported + } + $paiement->paiementid = $paymentTypeId; + $paiement->num_payment = ''; + $paiement->note_public = 'Online payment '.dol_print_date($now, 'standard').' from '.$ipaddress; + $paiement->ext_payment_id = $TRANSACTIONID; + $paiement->ext_payment_site = $service; + + if (!$error) { + $paiement_id = $paiement->create($user, 1); // This include closing invoices and regenerating documents + if ($paiement_id < 0) { + $postactionmessages[] = $paiement->error.' '.join("
\n", $paiement->errors); + $ispostactionok = -1; + $error++; + } else { + $postactionmessages[] = 'Payment created'; + $ispostactionok = 1; + } + } + + if (!$error && !empty($conf->banque->enabled)) { + $bankaccountid = 0; + if ($paymentmethod == 'paybox') { + $bankaccountid = $conf->global->PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS; + } elseif ($paymentmethod == 'paypal') { + $bankaccountid = $conf->global->PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS; + } elseif ($paymentmethod == 'stripe') { + $bankaccountid = $conf->global->STRIPE_BANK_ACCOUNT_FOR_PAYMENTS; + } + + if ($bankaccountid > 0) { + $label = '(CustomerInvoicePayment)'; + if ($object->type == Facture::TYPE_CREDIT_NOTE) { + $label = '(CustomerInvoicePaymentBack)'; // Refund of a credit note + } + $result = $paiement->addPaymentToBank($user, 'payment', $label, $bankaccountid, '', ''); + if ($result < 0) { + $postactionmessages[] = $paiement->error.' '.join("
\n", $paiement->errors); + $ispostactionok = -1; + $error++; + } else { + $postactionmessages[] = 'Bank transaction of payment created'; + $ispostactionok = 1; + } + } else { + $postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. No way to record the payment.'; + $ispostactionok = -1; + $error++; + } + } + + if (!$error) { + // Putting the booth to "suggested" state + $booth = new ConferenceOrBooth($db); + $resultbooth = $booth->fetch($tmptag['BOO']); + if ($resultbooth < 0) { + $error++; + setEventMessages(null, $booth->errors, "errors"); + } else { + $booth->setStatut(CONFERENCEORBOOTH::STATUS_SUGGESTED); + $resultboothupdate = $booth->update($user); + if ($resultboothupdate<0) { + // Finding the thirdparty by getting the invoice + $invoice = new Facture($db); + $resultinvoice = $invoice->fetch($ref); + if ($resultinvoice<0) { + $postactionmessages[] = 'Could not find the associated invoice.'; + $ispostactionok = -1; + $error++; + } else { + $thirdparty = new Societe($db); + $resultthirdparty = $thirdparty->fetch($invoice->socid); + if ($resultthirdparty<0) { + $error++; + setEventMessages(null, $thirdparty->errors, "errors"); + } else { + // Sending mail + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); + // Load traductions files required by page + $outputlangs->loadLangs(array("main", "members")); + // Get email content from template + $arraydefaultmessage = null; + + $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; + if (!empty($labeltouse)) { + $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); + } + + if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); + + $sendto = $thirdparty->email; + $from = $conf->global->MAILING_EMAIL_FROM; + $urlback = $_SERVER["REQUEST_URI"]; + + $ishtml = dol_textishtml($texttosend); // May contain urls + + $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); + + $result = $mailfile->sendfile(); + if ($result) { + dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); + } else { + dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); + } + } + } + } + } + } + + if (!$error) { + $db->commit(); + } else { + $db->rollback(); + } + } + } else { + $postactionmessages[] = 'Failed to get a valid value for "amount paid" ('.$FinalPaymentAmt.') or "payment type" ('.$paymentType.') to record the payment of invoice '.$tmptag['ATT'].'. May be payment was already recorded.'; + $ispostactionok = -1; + } + } else { + $postactionmessages[] = 'Invoice paid '.$tmptag['ATT'].' was not found'; + $ispostactionok = -1; + } } else { // Nothing done } diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index 06e46e465eb..7eb7f263a16 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -434,7 +434,7 @@ if (empty($reshook) && $action == 'add') { $valid = true; $sourcetouse = 'boothlocation'; $reftouse = $facture->id; - $redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?source='.$sourcetouse.'&ref='.$reftouse; + $redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?source='.$sourcetouse.'&ref='.$reftouse.'&booth='.$conforbooth->id; if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { $redirection .= '&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $sourcetouse . $reftouse, 2); // Use the source in the hash to avoid duplicates if the references are identical From f2f1eaa95e9ceb8f8d89fb0726d2e3407511053c Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Tue, 27 Apr 2021 16:01:01 +0200 Subject: [PATCH 0026/1497] wip --- .../attendee_subscription.php | 28 +++++++++++-------- htdocs/public/project/index.php | 28 +++++++++---------- 2 files changed, 30 insertions(+), 26 deletions(-) diff --git a/htdocs/public/eventorganization/attendee_subscription.php b/htdocs/public/eventorganization/attendee_subscription.php index 4940f5965fe..7a377a7121a 100644 --- a/htdocs/public/eventorganization/attendee_subscription.php +++ b/htdocs/public/eventorganization/attendee_subscription.php @@ -374,15 +374,15 @@ if (empty($reshook) && $action == 'add') { $valid = true; $sourcetouse = 'conferencesubscription'; $reftouse = $facture->id; - $redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?source='.$sourcetouse.'&ref='.$reftouse; + $redirection = $dolibarr_main_url_root . '/public/payment/newpayment.php?source=' . $sourcetouse . '&ref=' . $reftouse; if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { - $redirection .= '&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $sourcetouse . $reftouse, 2); // Use the source in the hash to avoid duplicates if the references are identical + $redirection .= '&securekey=' . dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $sourcetouse . $reftouse, 2); // Use the source in the hash to avoid duplicates if the references are identical } else { - $redirection .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; + $redirection .= '&securekey=' . $conf->global->PAYMENT_SECURITY_TOKEN; } } - Header("Location: ".$redirection); + Header("Location: " . $redirection); exit; } } @@ -392,8 +392,8 @@ if (empty($reshook) && $action == 'add') { $confattendee->setStatut(1); // Sending mail - require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; + include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; $formmail = new FormMail($db); // Set output language $outputlangs = new Translate('', $conf); @@ -410,7 +410,7 @@ if (empty($reshook) && $action == 'add') { if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { $subject = $arraydefaultmessage->topic; - $msg = $arraydefaultmessage->content; + $msg = $arraydefaultmessage->content; } $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); @@ -429,19 +429,23 @@ if (empty($reshook) && $action == 'add') { $result = $mailfile->sendfile(); if ($result) { - dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); + dol_syslog("EMail sent to " . $sendto, LOG_DEBUG, 0, '_payment'); } else { - dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); + dol_syslog("Failed to send EMail to " . $sendto, LOG_ERR, 0, '_payment'); } $encodedid = dol_encode($id, $dolibarr_main_instance_unique_id); - $securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); - $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$encodedid.'&securekey='.$securekeyurl; - Header("Location: ".$redirection); + $securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY . 'conferenceorbooth' . $id, 2); + $redirection = $dolibarr_main_url_root . '/public/eventorganization/subscriptionok.php?id=' . $encodedid . '&securekey=' . $securekeyurl; + Header("Location: " . $redirection); exit; } //Header("Location: ".$urlback); //exit; + } + + if (!$error) { + $db->commit(); } else { $db->rollback(); } diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index 7eb7f263a16..bbfe55a6522 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -100,16 +100,12 @@ if ($resultproject < 0) { $errmsg .= $project->error; } -// Getting 'securekey'.'id' from Post and decoding it -$encodedsecurekeyandid = GETPOST('securekey', 'alpha'); -$securekeyandid = dol_decode($encodedsecurekeyandid, $dolibarr_main_instance_unique_id); +// Security check +$id = dol_decode($encodedid, $dolibarr_main_instance_unique_id); +$securekeyreceived = GETPOST("securekey"); +$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); -// Securekey decomposition into pure securekey and id added at the end -$securekey = substr($securekeyandid, 0, strlen($securekeyandid)-strlen($encodedid)); -$idgotfromsecurekey = dol_decode(substr($securekeyandid, -strlen($encodedid), strlen($encodedid)), $dolibarr_main_instance_unique_id); - -// We check if the securekey collected is OK and if the id collected is the same than the id in the securekey -if ($securekey != $conf->global->EVENTORGANIZATION_SECUREKEY || $idgotfromsecurekey != $id) { +if ($securekeytocompare != $securekeyreceived) { print $langs->trans('MissingOrBadSecureKey'); exit; } @@ -377,12 +373,13 @@ if (empty($reshook) && $action == 'add') { $conforbooth->fk_soc = $thirdparty->id; $conforbooth->fk_project = $project->id; $conforbooth->note = $note; - //$conforbooth->fk_action = + $conforbooth->fk_action = 63; $conforbooth->datep =$datestart; $conforbooth->datep2 = $dateend; $conforbooth->datec = dol_now(); $conforbooth->tms = dol_now(); $resultconforbooth = $conforbooth->create($user); + var_dump($conforbooth); if ($resultconforbooth<=0) { $error++; $errmsg .= $conforbooth->error; @@ -494,14 +491,17 @@ if (empty($reshook) && $action == 'add') { dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); } - $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?securekey='.dol_encode($conf->global->EVENTORGANIZATION_SECUREKEY, $dolibarr_main_instance_unique_id); + $encodedid = dol_encode($id, $dolibarr_main_instance_unique_id); + $securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); + $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$encodedid.'&securekey='.$securekeyurl; Header("Location: ".$redirection); exit; } } - - $db->commit(); } + } + if (!$error) { + $db->commit(); } else { $db->rollback(); } @@ -540,7 +540,7 @@ print ''; print ''; print ''; print ''; -print ''; +print ''; print '
'; From 5203a417fe13d91d93909817def137b334c0139b Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Tue, 27 Apr 2021 16:31:14 +0200 Subject: [PATCH 0027/1497] select array OK for event type --- htdocs/public/project/index.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index bbfe55a6522..ce3f06a4cc3 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -82,6 +82,7 @@ $error = 0; $backtopage = GETPOST('backtopage', 'alpha'); $action = GETPOST('action', 'aZ09'); +$eventtype = GETPOST("eventtype"); $email = GETPOST("email"); $societe = GETPOST("societe"); $label = GETPOST("label"); @@ -120,6 +121,8 @@ $extrafields = new ExtraFields($db); $user->loadDefaultValues(); +$cactioncomm = new CActionComm($db); +$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, 'module=\'conference@eventorganization\' OR module=\'booth@eventorganization\''); /** * Show header for new member @@ -373,13 +376,12 @@ if (empty($reshook) && $action == 'add') { $conforbooth->fk_soc = $thirdparty->id; $conforbooth->fk_project = $project->id; $conforbooth->note = $note; - $conforbooth->fk_action = 63; + $conforbooth->fk_action = $eventtype; $conforbooth->datep =$datestart; $conforbooth->datep2 = $dateend; $conforbooth->datec = dol_now(); $conforbooth->tms = dol_now(); $resultconforbooth = $conforbooth->create($user); - var_dump($conforbooth); if ($resultconforbooth<=0) { $error++; $errmsg .= $conforbooth->error; @@ -568,6 +570,9 @@ print '
'."\n"; +// Type of event +print ''."\n"; +print ''; // Label print ''."\n"; print ''."\n"; From 54b5a43006174ccfec34c9cdc57f5622d906b227 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Tue, 27 Apr 2021 17:06:25 +0200 Subject: [PATCH 0028/1497] wip --- htdocs/langs/en_US/eventorganization.lang | 1 + htdocs/public/project/index.php | 15 ++++++--------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 9ad2d45ddf4..7b5ddd8160c 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -108,6 +108,7 @@ EvntOrgWelcomeMessage = This form allows you to register as a new participant to EvntOrgDuration = This conference starts on %s and ends on %s. ConferenceAttendeeFee = Conference attendee fee for the event : '%s' occurring from %s to %s. BoothLocationFee = Booth location for the event : '%s' occurring from %s to %s +EventType = Event type # # SubscriptionOk page # diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index ce3f06a4cc3..4f376a2f10f 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -295,7 +295,6 @@ if (empty($reshook) && $action == 'add') { } } // From there we have a thirdparty, now looking for the contact - if (!$error) { $contact = new Contact($db); $resultcontact = $contact->fetch('', '', '', $email); @@ -447,9 +446,8 @@ if (empty($reshook) && $action == 'add') { } } else { // If no price has been set for the booth or this is a conference, we confirm it as suggested and we update - $conforbooth->setStatut(CONFERENCEORBOOTH::STATUS_SUGGESTED); + $conforbooth->status = CONFERENCEORBOOTH::STATUS_SUGGESTED; $conforbooth->update($user); - // Sending mail require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; @@ -492,18 +490,17 @@ if (empty($reshook) && $action == 'add') { } else { dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); } - - $encodedid = dol_encode($id, $dolibarr_main_instance_unique_id); - $securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); - $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$encodedid.'&securekey='.$securekeyurl; - Header("Location: ".$redirection); - exit; } } } } if (!$error) { $db->commit(); + $encodedid = dol_encode($id, $dolibarr_main_instance_unique_id); + $securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); + $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$encodedid.'&securekey='.$securekeyurl; + Header("Location: ".$redirection); + exit; } else { $db->rollback(); } From 15e65729f6abf38cc744e2047a04cc8134f297e7 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Tue, 27 Apr 2021 17:19:13 +0200 Subject: [PATCH 0029/1497] put company under email in the form --- htdocs/public/project/index.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index 4f376a2f10f..e4c030c9718 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -567,6 +567,9 @@ print ''."\n"; +// Company +print ''."\n"; // Type of event print ''."\n"; print ''; @@ -582,12 +585,6 @@ print ''."\n"; -// Company -print ''."\n"; // Address print ''."\n"; From 4c50d210dd0af5f0ef97b1dff27a385ead9c788d Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Thu, 6 May 2021 11:26:42 +0200 Subject: [PATCH 0030/1497] creation of the 3 main pages --- htdocs/public/project/suggestbooth.php | 1 + htdocs/public/project/suggestconference.php | 1 + htdocs/public/project/viewandvote.php | 1 + 3 files changed, 3 insertions(+) create mode 100644 htdocs/public/project/suggestbooth.php create mode 100644 htdocs/public/project/suggestconference.php create mode 100644 htdocs/public/project/viewandvote.php diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php new file mode 100644 index 00000000000..b3d9bbc7f37 --- /dev/null +++ b/htdocs/public/project/suggestbooth.php @@ -0,0 +1 @@ + Date: Thu, 6 May 2021 11:27:48 +0200 Subject: [PATCH 0031/1497] wip --- htdocs/public/project/index.php | 8 - htdocs/public/project/suggestbooth.php | 657 ++++++++++++++++++++ htdocs/public/project/suggestconference.php | 657 ++++++++++++++++++++ 3 files changed, 1314 insertions(+), 8 deletions(-) diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index e4c030c9718..fcbc786be4c 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -82,14 +82,6 @@ $error = 0; $backtopage = GETPOST('backtopage', 'alpha'); $action = GETPOST('action', 'aZ09'); -$eventtype = GETPOST("eventtype"); -$email = GETPOST("email"); -$societe = GETPOST("societe"); -$label = GETPOST("label"); -$note = GETPOST("note"); -$datestart = GETPOST("datestart"); -$dateend = GETPOST("dateend"); - // Getting id from Post and decoding it $encodedid = GETPOST('id'); $id = dol_decode($encodedid, $dolibarr_main_instance_unique_id); diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index b3d9bbc7f37..e4c030c9718 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -1 +1,658 @@ + * Copyright (C) 2001-2002 Jean-Louis Bergamo + * Copyright (C) 2006-2013 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2012 J. Fernando Lagrange + * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2018 Alexandre Spangaro + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/public/members/new.php + * \ingroup member + * \brief Example of form to add a new member + * + * Note that you can add following constant to change behaviour of page + * MEMBER_NEWFORM_AMOUNT Default amount for auto-subscribe form + * MEMBER_NEWFORM_EDITAMOUNT 0 or 1 = Amount can be edited + * MEMBER_NEWFORM_PAYONLINE Suggest payment with paypal, paybox or stripe + * MEMBER_NEWFORM_DOLIBARRTURNOVER Show field turnover (specific for dolibarr foundation) + * MEMBER_URL_REDIRECT_SUBSCRIPTION Url to redirect once subscribe submitted + * MEMBER_NEWFORM_FORCETYPE Force type of member + * MEMBER_NEWFORM_FORCEMORPHY Force nature of member (mor/phy) + * MEMBER_NEWFORM_FORCECOUNTRYCODE Force country + */ + +if (!defined('NOLOGIN')) { + define("NOLOGIN", 1); // This means this output page does not require to be logged. +} +if (!defined('NOCSRFCHECK')) { + define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. +} +if (!defined('NOIPCHECK')) { + define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +} +if (!defined('NOBROWSERNOTIF')) { + define('NOBROWSERNOTIF', '1'); +} +if (!defined('NOIPCHECK')) { + define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +} + +// For MultiCompany module. +// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php +// TODO This should be useless. Because entity must be retrieve from object ref and not from url. +$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); +if (is_numeric($entity)) { + define("DOLENTITY", $entity); +} + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/paymentterm.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; + +global $dolibarr_main_instance_unique_id; +global $dolibarr_main_url_root; + +// Init vars +$errmsg = ''; +$num = 0; +$error = 0; +$backtopage = GETPOST('backtopage', 'alpha'); +$action = GETPOST('action', 'aZ09'); + +$eventtype = GETPOST("eventtype"); +$email = GETPOST("email"); +$societe = GETPOST("societe"); +$label = GETPOST("label"); +$note = GETPOST("note"); +$datestart = GETPOST("datestart"); +$dateend = GETPOST("dateend"); + +// Getting id from Post and decoding it +$encodedid = GETPOST('id'); +$id = dol_decode($encodedid, $dolibarr_main_instance_unique_id); + +$project = new Project($db); +$resultproject = $project->fetch($id); +if ($resultproject < 0) { + $error++; + $errmsg .= $project->error; +} + +// Security check +$id = dol_decode($encodedid, $dolibarr_main_instance_unique_id); +$securekeyreceived = GETPOST("securekey"); +$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); + +if ($securekeytocompare != $securekeyreceived) { + print $langs->trans('MissingOrBadSecureKey'); + exit; +} + +// Load translation files +$langs->loadLangs(array("main", "companies", "install", "other", "eventorganization")); + +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('publicnewmembercard', 'globalcard')); + +$extrafields = new ExtraFields($db); + +$user->loadDefaultValues(); + +$cactioncomm = new CActionComm($db); +$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, 'module=\'conference@eventorganization\' OR module=\'booth@eventorganization\''); + +/** + * Show header for new member + * + * @param string $title Title + * @param string $head Head array + * @param int $disablejs More content into html header + * @param int $disablehead More content into html header + * @param array $arrayofjs Array of complementary js files + * @param array $arrayofcss Array of complementary css files + * @return void + */ +function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '') +{ + global $user, $conf, $langs, $mysoc; + + top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers + + print ''; + + // Define urllogo + $urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png'; + + if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); + } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); + } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { + $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; + } + + print '
'; + // Output html code for logo + if ($urllogo) { + print '
'; + print '
'; + print ''; + print '
'; + if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { + print ''; + } + print '
'; + } + print '
'; + + print '
'; +} + +/** + * Show footer for new member + * + * @return void + */ +function llxFooterVierge() +{ + print '
'; + + printCommonFooter('public'); + + print "\n"; + print "\n"; +} + + + +/* + * Actions + */ +global $mysoc; +$parameters = array(); +// Note that $action and $object may have been modified by some hooks +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + +// Action called when page is submitted +if (empty($reshook) && $action == 'add') { + $error = 0; + + $urlback = ''; + + $db->begin(); + + if (!GETPOST("email")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."
\n"; + } + if (!GETPOST("label")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label"))."
\n"; + } + if (!GETPOST("note")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Note"))."
\n"; + } + if (!GETPOST("datestart")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateStart"))."
\n"; + } + if (!GETPOST("dateend")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEnd"))."
\n"; + } + if (!GETPOST("email")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."
\n"; + } + if (!GETPOST("lastname")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Name"))."
\n"; + } + if (!GETPOST("societe")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Societe"))."
\n"; + } + if (GETPOST("email") && !isValidEmail(GETPOST("email"))) { + $error++; + $langs->load("errors"); + $errmsg .= $langs->trans("ErrorBadEMail", GETPOST("email"))."
\n"; + } + if (!GETPOST("country_id")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Country"))."
\n"; + } + + if (!$error) { + // Getting the thirdparty or creating it + $thirdparty = new Societe($db); + $resultfetchthirdparty = $thirdparty->fetch('', $societe); + + if ($resultfetchthirdparty<=0) { + // Need to create a new one (not found or multiple with the same name) + $thirdparty->name = $societe; + $thirdparty->address = GETPOST("address"); + $thirdparty->zip = GETPOST("zipcode"); + $thirdparty->town = GETPOST("town"); + $thirdparty->client = 2; + $thirdparty->fournisseur = 0; + $thirdparty->country_id = GETPOST("country_id", 'int'); + $thirdparty->state_id = GETPOST("state_id", 'int'); + $thirdparty->email = $email; + + // Load object modCodeTiers + $module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); + if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { + $module = substr($module, 0, dol_strlen($module) - 4); + } + $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); + foreach ($dirsociete as $dirroot) { + $res = dol_include_once($dirroot.$module.'.php'); + if ($res) { + break; + } + } + $modCodeClient = new $module($db); + + if (empty($tmpcode) && !empty($modCodeClient->code_auto)) { + $tmpcode = $modCodeClient->getNextValue($thirdparty, 0); + } + $thirdparty->code_client = $tmpcode; + $readythirdparty = $thirdparty->create($user); + if ($readythirdparty <0) { + $error++; + $errmsg .= $thirdparty->error; + } else { + $thirdparty->country_code = getCountry($thirdparty->country_id, 2, $db, $langs); + $thirdparty->country = getCountry($thirdparty->country_code, 0, $db, $langs); + } + } + // From there we have a thirdparty, now looking for the contact + if (!$error) { + $contact = new Contact($db); + $resultcontact = $contact->fetch('', '', '', $email); + if ($resultcontact<=0) { + // Need to create a contact + $contact->socid = $thirdparty->id; + $contact->lastname = (string) GETPOST("lastname", 'alpha'); + $contact->firstname = (string) GETPOST("firstname", 'alpha'); + $contact->address = (string) GETPOST("address", 'alpha'); + $contact->zip = (string) GETPOST("zipcode", 'alpha'); + $contact->town = (string) GETPOST("town", 'alpha'); + $contact->country_id = (int) GETPOST("country_id", 'int'); + $contact->state_id = (int) GETPOST("state_id", 'int'); + $contact->email = $email; + $contact->statut = 1; //Default status to Actif + + $resultcreatecontact = $contact->create($user); + if ($resultcreatecontact<0) { + $error++; + $errmsg .= $contact->error; + } + } + } + + if (!$error) { + // Adding supplier tag and tag from setup to thirdparty + $category = new Categorie($db); + if (GETPOST("suggestconference")) { + // Conference case + $resultcategory = $category->fetch($conf->global->EVENTORGANIZATION_CATEG_THIRDPARTY_CONF); + } else { + // Booth case + $resultcategory = $category->fetch($conf->global->EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH); + } + + if ($resultcategory<=0) { + $error++; + $errmsg .= $category->error; + } else { + $resultsetcategory = $thirdparty->setCategoriesCommon(array($category->id), CATEGORIE::TYPE_CUSTOMER, false); + if ($resultsetcategory < 0) { + $error++; + $errmsg .= $thirdparty->error; + } else { + $thirdparty->fournisseur = 1; + + // Load object modCodeFournisseur + $module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); + if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { + $module = substr($module, 0, dol_strlen($module) - 4); + } + $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); + foreach ($dirsociete as $dirroot) { + $res = dol_include_once($dirroot.$module.'.php'); + if ($res) { + break; + } + } + $modCodeFournisseur = new $module; + if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) { + $tmpcode = $modCodeFournisseur->getNextValue($thirdparty, 1); + } + $thirdparty->code_fournisseur = $tmpcode; + + $res = $thirdparty->update(0, $user, 1, 1, 1); + + if ($res <= 0) { + $error++; + } + } + } + } + + if (!$error) { + // We have the contact and the thirdparty + $conforbooth = new ConferenceOrBooth($db); + $conforbooth->label = $label; + $conforbooth->fk_soc = $thirdparty->id; + $conforbooth->fk_project = $project->id; + $conforbooth->note = $note; + $conforbooth->fk_action = $eventtype; + $conforbooth->datep =$datestart; + $conforbooth->datep2 = $dateend; + $conforbooth->datec = dol_now(); + $conforbooth->tms = dol_now(); + $resultconforbooth = $conforbooth->create($user); + if ($resultconforbooth<=0) { + $error++; + $errmsg .= $conforbooth->error; + } else { + // If this is a paying booth, we have to redirect to payment page and create an invoice + if (GETPOST("suggestbooth") && !empty(floatval($project->price_booth))) { + $productforinvoicerow = new Product($db); + $resultprod = $productforinvoicerow->fetch($conf->global->SERVICE_BOOTH_LOCATION); + if ($resultprod < 0) { + $error++; + $errmsg .= $productforinvoicerow->error; + } else { + $facture = new Facture($db); + $facture->type = Facture::TYPE_STANDARD; + $facture->socid = $thirdparty->id; + $facture->paye = 0; + $facture->date = dol_now(); + $facture->cond_reglement_id = $contact->cond_reglement_id; + + if (empty($facture->cond_reglement_id)) { + $paymenttermstatic = new PaymentTerm($contact->db); + $facture->cond_reglement_id = $paymenttermstatic->getDefaultId(); + if (empty($facture->cond_reglement_id)) { + $error++; + $contact->error = 'ErrorNoPaymentTermRECEPFound'; + $contact->errors[] = $contact->error; + } + } + $resultfacture = $facture->create($user); + if ($resultfacture <= 0) { + $contact->error = $facture->error; + $contact->errors = $facture->errors; + $error++; + } else { + $facture->add_object_linked($contact->element, $contact->id); + } + } + + if (!$error) { + // Add line to draft invoice + $vattouse = get_default_tva($mysoc, $thirdparty, $productforinvoicerow->id); + $result = $facture->addline($langs->trans("BoothLocationFee", $conforbooth->label, dol_print_date($conforbooth->datep, '%d/%m/%y %H:%M:%S'), dol_print_date($conforbooth->datep2, '%d/%m/%y %H:%M:%S')), floatval($project->price_booth), 1, $vattouse, 0, 0, $productforinvoicerow->id, 0, dol_now(), '', 0, 0, '', 'HT', 0, 1); + if ($result <= 0) { + $contact->error = $facture->error; + $contact->errors = $facture->errors; + $error++; + } + if (!$error) { + $valid = true; + $sourcetouse = 'boothlocation'; + $reftouse = $facture->id; + $redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?source='.$sourcetouse.'&ref='.$reftouse.'&booth='.$conforbooth->id; + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { + $redirection .= '&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $sourcetouse . $reftouse, 2); // Use the source in the hash to avoid duplicates if the references are identical + } else { + $redirection .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; + } + } + Header("Location: ".$redirection); + exit; + } + } + } else { + // If no price has been set for the booth or this is a conference, we confirm it as suggested and we update + $conforbooth->status = CONFERENCEORBOOTH::STATUS_SUGGESTED; + $conforbooth->update($user); + // Sending mail + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); + // Load traductions files required by page + $outputlangs->loadLangs(array("main", "members")); + // Get email content from template + $arraydefaultmessage = null; + + $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; + if (!empty($labeltouse)) { + $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); + } + + if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); + + $sendto = $thirdparty->email; + $from = $conf->global->MAILING_EMAIL_FROM; + $urlback = $_SERVER["REQUEST_URI"]; + + $ishtml = dol_textishtml($texttosend); // May contain urls + + $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); + + $result = $mailfile->sendfile(); + if ($result) { + dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); + } else { + dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); + } + } + } + } + } + if (!$error) { + $db->commit(); + $encodedid = dol_encode($id, $dolibarr_main_instance_unique_id); + $securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); + $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$encodedid.'&securekey='.$securekeyurl; + Header("Location: ".$redirection); + exit; + } else { + $db->rollback(); + } +} + + +/* + * View + */ + +$form = new Form($db); +$formcompany = new FormCompany($db); + +llxHeaderVierge($langs->trans("NewSuggestion")); + + +print load_fiche_titre($langs->trans("NewSuggestion"), '', '', 0, 0, 'center'); + + +print '
'; +print '
'; +print '
'; + +// Welcome message +$text = '

'; +$text .= ''."\n"; +$text .= ''."\n";; +print $text; +print ''; + +dol_htmloutput_errors($errmsg); + +// Print form +print ''."\n"; +print ''; +print ''; +print ''; +print ''; +print ''; + +print '
'; + +print '
'.$langs->trans("FieldsWithAreMandatory", '*').'
'; +//print $langs->trans("FieldsWithIsForPublic",'**').'
'; + +print dol_get_fiche_head(''); + +print ''; + +print '
lastname).'" autofocus="autofocus">
'.$langs->trans("Email").'*
*
'.$langs->trans("Label").'
'.$langs->trans("Note").'
'.$langs->trans("DateStart").'
'.$langs->trans("DateEnd").'
'.$langs->trans("Company"); if (!empty(floatval($project->price_registration))) { diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 9d449922dd2..4ce6211c767 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1322,7 +1322,7 @@ class Societe extends CommonObject } } } - + var_dump($result); if ($result >= 0) { dol_syslog(get_class($this)."::update verify ok or not done"); From c8440a62836e8cdf8d6e8764fdce17da503619e2 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 26 Apr 2021 16:17:42 +0200 Subject: [PATCH 0020/1497] fix on form dates --- htdocs/public/project/index.php | 6 ++++-- htdocs/societe/class/societe.class.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index 64fbea05505..932a36dad92 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -340,7 +340,9 @@ if (empty($reshook) && $action == 'add') { $error++; $errmsg .= $thirdparty->error; } + $thirdparty->fournisseur = 1; + // Load object modCodeFournisseur $module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { @@ -464,10 +466,10 @@ print '
'.$langs->trans("Note").'
'.$langs->trans("DateStart").'
'.$langs->trans("DateEnd").'
'.$langs->trans("Company"); if (!empty(floatval($project->price_registration))) { diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 4ce6211c767..9d449922dd2 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1322,7 +1322,7 @@ class Societe extends CommonObject } } } - var_dump($result); + if ($result >= 0) { dol_syslog(get_class($this)."::update verify ok or not done"); From a3628954b21b82bfad96b69d4fa396322778d77e Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 26 Apr 2021 17:46:30 +0200 Subject: [PATCH 0021/1497] fix for the supplier code --- htdocs/public/project/index.php | 47 ++++++++++++++++++--------------- htdocs/societe/card.php | 1 + 2 files changed, 27 insertions(+), 21 deletions(-) diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index 932a36dad92..d6614c8ed29 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -255,6 +255,7 @@ if (empty($reshook) && $action == 'add') { // Getting the thirdparty or creating it $thirdparty = new Societe($db); $resultfetchthirdparty = $thirdparty->fetch('', $societe); + if ($resultfetchthirdparty<=0) { // Need to create a new one (not found or multiple with the same name) $thirdparty->name = $societe; @@ -331,37 +332,41 @@ if (empty($reshook) && $action == 'add') { $resultcategory = $category->fetch($conf->global->EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH); } - if ($resultcategory<0) { + if ($resultcategory<=0) { $error++; $errmsg .= $category->error; } else { $resultsetcategory = $thirdparty->setCategoriesCommon(array($category->id), CATEGORIE::TYPE_CUSTOMER, false); - if ($resultsetcategory <=0) { + if ($resultsetcategory < 0) { $error++; $errmsg .= $thirdparty->error; - } + } else { + $thirdparty->fournisseur = 1; - $thirdparty->fournisseur = 1; + // Load object modCodeFournisseur + $module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); + if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { + $module = substr($module, 0, dol_strlen($module) - 4); + } + $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); + foreach ($dirsociete as $dirroot) { + $res = dol_include_once($dirroot.$module.'.php'); + if ($res) { + break; + } + } + $modCodeFournisseur = new $module; + if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) { + $tmpcode = $modCodeFournisseur->getNextValue($thirdparty, 1); + } + $thirdparty->code_fournisseur = $tmpcode; - // Load object modCodeFournisseur - $module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); - if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { - $module = substr($module, 0, dol_strlen($module) - 4); - } - $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); - foreach ($dirsociete as $dirroot) { - $res = dol_include_once($dirroot.$module.'.php'); - if ($res) { - break; + $res = $thirdparty->update(0, $user, 1, 1, 1); + + if ($res <= 0) { + $error++; } } - $modCodeFournisseur = new $module; - if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) { - $tmpcode = $modCodeFournisseur->getNextValue($thirdparty, 0); - } - $thirdparty->code_fournisseur = $tmpcode; - - $res = $thirdparty->update(0); } } diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 68efa8e694c..64a46f9d1a8 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2468,6 +2468,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if ($tmpcheck != 0 && $tmpcheck != -5) { print ' ('.$langs->trans("WrongSupplierCode").')'; } + var_dump($tmpcheck); print '
'.$langs->trans("Email").'*
'.$langs->trans("Label").'
'.$langs->trans("Label").'*
'.$langs->trans("Note").'
'.$langs->trans("Note").'*
'.$langs->trans("DateStart").'
'.$langs->trans("Creditor"); + print ''.$creditor.''; + print ''; + print '
'.$langs->trans("Attendee"); + print ''; + print $thirdparty->name; + print ''; + print '
'.$langs->trans("Designation"); + print ''.$text; + print ''; + print ''; + print '
'.$langs->trans("Amount"); + print ''; + $valtoshow = $amount; + print ''.price($valtoshow).''; + print ''; + print ''; + + // Currency + print ' '.$langs->trans("Currency".$currency).''; + print ''; + print '
'.$langs->trans("PaymentCode"); + print ''.$fulltag.''; + print ''; + print ''; + print '
*
'.$langs->trans("EventType").'*'.FORM::selectarray('eventtype', $arrayofeventtype, $eventtype).'
'.$langs->trans("Label").'*
*
'.$langs->trans("Company").'*'; +print '
'.$langs->trans("EventType").'*'.FORM::selectarray('eventtype', $arrayofeventtype, $eventtype).''."\n"; print '
'.$langs->trans("Company"); -if (!empty(floatval($project->price_registration))) { - print '*'; -} -print '
'.$langs->trans("Address").''."\n"; print '
'.$langs->trans("EvntOrgRegistrationWelcomeMessage").'
'.$langs->trans("EvntOrgRegistrationHelpMessage").' '.$id.'.

'.$project->note_public.'
'."\n"; + +// Name +print ''; +print ''; +print ''; +// Email +print ''."\n"; +// Company +print ''."\n"; +// Type of event +print ''."\n"; +print ''; +// Label +print ''."\n"; +print ''."\n"; +// Note +print ''."\n"; +print ''."\n"; +// Start Date +print ''."\n"; +print ''."\n"; +// End Date +print ''."\n"; +print ''."\n"; +// Address +print ''."\n"; +// Zip / Town +print ''; +// Country +print ''; +// State +if (empty($conf->global->SOCIETE_DISABLE_STATE)) { + print ''; +} + +print "
lastname).'" autofocus="autofocus">
'.$langs->trans("Email").'*
'.$langs->trans("Company").'*'; +print '
'.$langs->trans("EventType").'*'.FORM::selectarray('eventtype', $arrayofeventtype, $eventtype).'
'.$langs->trans("Label").'*
'.$langs->trans("Note").'*
'.$langs->trans("DateStart").'
'.$langs->trans("DateEnd").'
'.$langs->trans("Address").''."\n"; +print '
'.$langs->trans('Zip').' / '.$langs->trans('Town').''; +print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6, 1); +print ' / '; +print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); +print '
'.$langs->trans('Country').'*'; +$country_id = GETPOST('country_id'); +if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { + $country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); +} +if (!$country_id && !empty($conf->geoipmaxmind->enabled)) { + $country_code = dol_user_country(); + //print $country_code; + if ($country_code) { + $new_country_id = getCountry($country_code, 3, $db, $langs); + //print 'xxx'.$country_code.' - '.$new_country_id; + if ($new_country_id) { + $country_id = $new_country_id; + } + } +} +$country_code = getCountry($country_id, 2, $db, $langs); +print $form->select_country($country_id, 'country_id'); +print '
'.$langs->trans('State').''; + if ($country_code) { + print $formcompany->select_state(GETPOST("state_id"), $country_code); + } else { + print ''; + } + print '
\n"; + +print dol_get_fiche_end(); + + +// Show all action buttons +print '
'; +print '
'; +// Output introduction text +if ($project->accept_conference_suggestions) { + print ''; + print '

'; +} +print ''; +print '

'; +if ($project->accept_booth_suggestions) { + print ''; +} +print '
'; +print '

'; + + + +print "\n"; +print "
"; +print '
'; + + +llxFooterVierge(); + +$db->close(); diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index b3d9bbc7f37..e4c030c9718 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -1 +1,658 @@ + * Copyright (C) 2001-2002 Jean-Louis Bergamo + * Copyright (C) 2006-2013 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2012 J. Fernando Lagrange + * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2018 Alexandre Spangaro + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/public/members/new.php + * \ingroup member + * \brief Example of form to add a new member + * + * Note that you can add following constant to change behaviour of page + * MEMBER_NEWFORM_AMOUNT Default amount for auto-subscribe form + * MEMBER_NEWFORM_EDITAMOUNT 0 or 1 = Amount can be edited + * MEMBER_NEWFORM_PAYONLINE Suggest payment with paypal, paybox or stripe + * MEMBER_NEWFORM_DOLIBARRTURNOVER Show field turnover (specific for dolibarr foundation) + * MEMBER_URL_REDIRECT_SUBSCRIPTION Url to redirect once subscribe submitted + * MEMBER_NEWFORM_FORCETYPE Force type of member + * MEMBER_NEWFORM_FORCEMORPHY Force nature of member (mor/phy) + * MEMBER_NEWFORM_FORCECOUNTRYCODE Force country + */ + +if (!defined('NOLOGIN')) { + define("NOLOGIN", 1); // This means this output page does not require to be logged. +} +if (!defined('NOCSRFCHECK')) { + define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. +} +if (!defined('NOIPCHECK')) { + define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +} +if (!defined('NOBROWSERNOTIF')) { + define('NOBROWSERNOTIF', '1'); +} +if (!defined('NOIPCHECK')) { + define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +} + +// For MultiCompany module. +// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php +// TODO This should be useless. Because entity must be retrieve from object ref and not from url. +$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); +if (is_numeric($entity)) { + define("DOLENTITY", $entity); +} + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/paymentterm.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; + +global $dolibarr_main_instance_unique_id; +global $dolibarr_main_url_root; + +// Init vars +$errmsg = ''; +$num = 0; +$error = 0; +$backtopage = GETPOST('backtopage', 'alpha'); +$action = GETPOST('action', 'aZ09'); + +$eventtype = GETPOST("eventtype"); +$email = GETPOST("email"); +$societe = GETPOST("societe"); +$label = GETPOST("label"); +$note = GETPOST("note"); +$datestart = GETPOST("datestart"); +$dateend = GETPOST("dateend"); + +// Getting id from Post and decoding it +$encodedid = GETPOST('id'); +$id = dol_decode($encodedid, $dolibarr_main_instance_unique_id); + +$project = new Project($db); +$resultproject = $project->fetch($id); +if ($resultproject < 0) { + $error++; + $errmsg .= $project->error; +} + +// Security check +$id = dol_decode($encodedid, $dolibarr_main_instance_unique_id); +$securekeyreceived = GETPOST("securekey"); +$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); + +if ($securekeytocompare != $securekeyreceived) { + print $langs->trans('MissingOrBadSecureKey'); + exit; +} + +// Load translation files +$langs->loadLangs(array("main", "companies", "install", "other", "eventorganization")); + +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('publicnewmembercard', 'globalcard')); + +$extrafields = new ExtraFields($db); + +$user->loadDefaultValues(); + +$cactioncomm = new CActionComm($db); +$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, 'module=\'conference@eventorganization\' OR module=\'booth@eventorganization\''); + +/** + * Show header for new member + * + * @param string $title Title + * @param string $head Head array + * @param int $disablejs More content into html header + * @param int $disablehead More content into html header + * @param array $arrayofjs Array of complementary js files + * @param array $arrayofcss Array of complementary css files + * @return void + */ +function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '') +{ + global $user, $conf, $langs, $mysoc; + + top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers + + print ''; + + // Define urllogo + $urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png'; + + if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); + } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); + } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { + $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; + } + + print '
'; + // Output html code for logo + if ($urllogo) { + print '
'; + print '
'; + print ''; + print '
'; + if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { + print ''; + } + print '
'; + } + print '
'; + + print '
'; +} + +/** + * Show footer for new member + * + * @return void + */ +function llxFooterVierge() +{ + print '
'; + + printCommonFooter('public'); + + print "\n"; + print "\n"; +} + + + +/* + * Actions + */ +global $mysoc; +$parameters = array(); +// Note that $action and $object may have been modified by some hooks +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + +// Action called when page is submitted +if (empty($reshook) && $action == 'add') { + $error = 0; + + $urlback = ''; + + $db->begin(); + + if (!GETPOST("email")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."
\n"; + } + if (!GETPOST("label")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label"))."
\n"; + } + if (!GETPOST("note")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Note"))."
\n"; + } + if (!GETPOST("datestart")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateStart"))."
\n"; + } + if (!GETPOST("dateend")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEnd"))."
\n"; + } + if (!GETPOST("email")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."
\n"; + } + if (!GETPOST("lastname")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Name"))."
\n"; + } + if (!GETPOST("societe")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Societe"))."
\n"; + } + if (GETPOST("email") && !isValidEmail(GETPOST("email"))) { + $error++; + $langs->load("errors"); + $errmsg .= $langs->trans("ErrorBadEMail", GETPOST("email"))."
\n"; + } + if (!GETPOST("country_id")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Country"))."
\n"; + } + + if (!$error) { + // Getting the thirdparty or creating it + $thirdparty = new Societe($db); + $resultfetchthirdparty = $thirdparty->fetch('', $societe); + + if ($resultfetchthirdparty<=0) { + // Need to create a new one (not found or multiple with the same name) + $thirdparty->name = $societe; + $thirdparty->address = GETPOST("address"); + $thirdparty->zip = GETPOST("zipcode"); + $thirdparty->town = GETPOST("town"); + $thirdparty->client = 2; + $thirdparty->fournisseur = 0; + $thirdparty->country_id = GETPOST("country_id", 'int'); + $thirdparty->state_id = GETPOST("state_id", 'int'); + $thirdparty->email = $email; + + // Load object modCodeTiers + $module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); + if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { + $module = substr($module, 0, dol_strlen($module) - 4); + } + $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); + foreach ($dirsociete as $dirroot) { + $res = dol_include_once($dirroot.$module.'.php'); + if ($res) { + break; + } + } + $modCodeClient = new $module($db); + + if (empty($tmpcode) && !empty($modCodeClient->code_auto)) { + $tmpcode = $modCodeClient->getNextValue($thirdparty, 0); + } + $thirdparty->code_client = $tmpcode; + $readythirdparty = $thirdparty->create($user); + if ($readythirdparty <0) { + $error++; + $errmsg .= $thirdparty->error; + } else { + $thirdparty->country_code = getCountry($thirdparty->country_id, 2, $db, $langs); + $thirdparty->country = getCountry($thirdparty->country_code, 0, $db, $langs); + } + } + // From there we have a thirdparty, now looking for the contact + if (!$error) { + $contact = new Contact($db); + $resultcontact = $contact->fetch('', '', '', $email); + if ($resultcontact<=0) { + // Need to create a contact + $contact->socid = $thirdparty->id; + $contact->lastname = (string) GETPOST("lastname", 'alpha'); + $contact->firstname = (string) GETPOST("firstname", 'alpha'); + $contact->address = (string) GETPOST("address", 'alpha'); + $contact->zip = (string) GETPOST("zipcode", 'alpha'); + $contact->town = (string) GETPOST("town", 'alpha'); + $contact->country_id = (int) GETPOST("country_id", 'int'); + $contact->state_id = (int) GETPOST("state_id", 'int'); + $contact->email = $email; + $contact->statut = 1; //Default status to Actif + + $resultcreatecontact = $contact->create($user); + if ($resultcreatecontact<0) { + $error++; + $errmsg .= $contact->error; + } + } + } + + if (!$error) { + // Adding supplier tag and tag from setup to thirdparty + $category = new Categorie($db); + if (GETPOST("suggestconference")) { + // Conference case + $resultcategory = $category->fetch($conf->global->EVENTORGANIZATION_CATEG_THIRDPARTY_CONF); + } else { + // Booth case + $resultcategory = $category->fetch($conf->global->EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH); + } + + if ($resultcategory<=0) { + $error++; + $errmsg .= $category->error; + } else { + $resultsetcategory = $thirdparty->setCategoriesCommon(array($category->id), CATEGORIE::TYPE_CUSTOMER, false); + if ($resultsetcategory < 0) { + $error++; + $errmsg .= $thirdparty->error; + } else { + $thirdparty->fournisseur = 1; + + // Load object modCodeFournisseur + $module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); + if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { + $module = substr($module, 0, dol_strlen($module) - 4); + } + $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); + foreach ($dirsociete as $dirroot) { + $res = dol_include_once($dirroot.$module.'.php'); + if ($res) { + break; + } + } + $modCodeFournisseur = new $module; + if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) { + $tmpcode = $modCodeFournisseur->getNextValue($thirdparty, 1); + } + $thirdparty->code_fournisseur = $tmpcode; + + $res = $thirdparty->update(0, $user, 1, 1, 1); + + if ($res <= 0) { + $error++; + } + } + } + } + + if (!$error) { + // We have the contact and the thirdparty + $conforbooth = new ConferenceOrBooth($db); + $conforbooth->label = $label; + $conforbooth->fk_soc = $thirdparty->id; + $conforbooth->fk_project = $project->id; + $conforbooth->note = $note; + $conforbooth->fk_action = $eventtype; + $conforbooth->datep =$datestart; + $conforbooth->datep2 = $dateend; + $conforbooth->datec = dol_now(); + $conforbooth->tms = dol_now(); + $resultconforbooth = $conforbooth->create($user); + if ($resultconforbooth<=0) { + $error++; + $errmsg .= $conforbooth->error; + } else { + // If this is a paying booth, we have to redirect to payment page and create an invoice + if (GETPOST("suggestbooth") && !empty(floatval($project->price_booth))) { + $productforinvoicerow = new Product($db); + $resultprod = $productforinvoicerow->fetch($conf->global->SERVICE_BOOTH_LOCATION); + if ($resultprod < 0) { + $error++; + $errmsg .= $productforinvoicerow->error; + } else { + $facture = new Facture($db); + $facture->type = Facture::TYPE_STANDARD; + $facture->socid = $thirdparty->id; + $facture->paye = 0; + $facture->date = dol_now(); + $facture->cond_reglement_id = $contact->cond_reglement_id; + + if (empty($facture->cond_reglement_id)) { + $paymenttermstatic = new PaymentTerm($contact->db); + $facture->cond_reglement_id = $paymenttermstatic->getDefaultId(); + if (empty($facture->cond_reglement_id)) { + $error++; + $contact->error = 'ErrorNoPaymentTermRECEPFound'; + $contact->errors[] = $contact->error; + } + } + $resultfacture = $facture->create($user); + if ($resultfacture <= 0) { + $contact->error = $facture->error; + $contact->errors = $facture->errors; + $error++; + } else { + $facture->add_object_linked($contact->element, $contact->id); + } + } + + if (!$error) { + // Add line to draft invoice + $vattouse = get_default_tva($mysoc, $thirdparty, $productforinvoicerow->id); + $result = $facture->addline($langs->trans("BoothLocationFee", $conforbooth->label, dol_print_date($conforbooth->datep, '%d/%m/%y %H:%M:%S'), dol_print_date($conforbooth->datep2, '%d/%m/%y %H:%M:%S')), floatval($project->price_booth), 1, $vattouse, 0, 0, $productforinvoicerow->id, 0, dol_now(), '', 0, 0, '', 'HT', 0, 1); + if ($result <= 0) { + $contact->error = $facture->error; + $contact->errors = $facture->errors; + $error++; + } + if (!$error) { + $valid = true; + $sourcetouse = 'boothlocation'; + $reftouse = $facture->id; + $redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?source='.$sourcetouse.'&ref='.$reftouse.'&booth='.$conforbooth->id; + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { + $redirection .= '&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $sourcetouse . $reftouse, 2); // Use the source in the hash to avoid duplicates if the references are identical + } else { + $redirection .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; + } + } + Header("Location: ".$redirection); + exit; + } + } + } else { + // If no price has been set for the booth or this is a conference, we confirm it as suggested and we update + $conforbooth->status = CONFERENCEORBOOTH::STATUS_SUGGESTED; + $conforbooth->update($user); + // Sending mail + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); + // Load traductions files required by page + $outputlangs->loadLangs(array("main", "members")); + // Get email content from template + $arraydefaultmessage = null; + + $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; + if (!empty($labeltouse)) { + $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); + } + + if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); + + $sendto = $thirdparty->email; + $from = $conf->global->MAILING_EMAIL_FROM; + $urlback = $_SERVER["REQUEST_URI"]; + + $ishtml = dol_textishtml($texttosend); // May contain urls + + $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); + + $result = $mailfile->sendfile(); + if ($result) { + dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); + } else { + dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); + } + } + } + } + } + if (!$error) { + $db->commit(); + $encodedid = dol_encode($id, $dolibarr_main_instance_unique_id); + $securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); + $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$encodedid.'&securekey='.$securekeyurl; + Header("Location: ".$redirection); + exit; + } else { + $db->rollback(); + } +} + + +/* + * View + */ + +$form = new Form($db); +$formcompany = new FormCompany($db); + +llxHeaderVierge($langs->trans("NewSuggestion")); + + +print load_fiche_titre($langs->trans("NewSuggestion"), '', '', 0, 0, 'center'); + + +print '
'; +print '
'; +print '
'; + +// Welcome message +$text = ''.$langs->trans("EvntOrgRegistrationWelcomeMessage").'
'; +$text .= ''.$langs->trans("EvntOrgRegistrationHelpMessage").' '.$id.'.

'."\n"; +$text .= ''.$project->note_public.''."\n";; +print $text; +print '
'; + +dol_htmloutput_errors($errmsg); + +// Print form +print '
'."\n"; +print ''; +print ''; +print ''; +print ''; +print ''; + +print '
'; + +print '
'.$langs->trans("FieldsWithAreMandatory", '*').'
'; +//print $langs->trans("FieldsWithIsForPublic",'**').'
'; + +print dol_get_fiche_head(''); + +print ''; + +print ''."\n"; + +// Name +print ''; +print ''; +print ''; +// Email +print ''."\n"; +// Company +print ''."\n"; +// Type of event +print ''."\n"; +print ''; +// Label +print ''."\n"; +print ''."\n"; +// Note +print ''."\n"; +print ''."\n"; +// Start Date +print ''."\n"; +print ''."\n"; +// End Date +print ''."\n"; +print ''."\n"; +// Address +print ''."\n"; +// Zip / Town +print ''; +// Country +print ''; +// State +if (empty($conf->global->SOCIETE_DISABLE_STATE)) { + print ''; +} + +print "
lastname).'" autofocus="autofocus">
'.$langs->trans("Email").'*
'.$langs->trans("Company").'*'; +print '
'.$langs->trans("EventType").'*'.FORM::selectarray('eventtype', $arrayofeventtype, $eventtype).'
'.$langs->trans("Label").'*
'.$langs->trans("Note").'*
'.$langs->trans("DateStart").'
'.$langs->trans("DateEnd").'
'.$langs->trans("Address").''."\n"; +print '
'.$langs->trans('Zip').' / '.$langs->trans('Town').''; +print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6, 1); +print ' / '; +print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); +print '
'.$langs->trans('Country').'*'; +$country_id = GETPOST('country_id'); +if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { + $country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); +} +if (!$country_id && !empty($conf->geoipmaxmind->enabled)) { + $country_code = dol_user_country(); + //print $country_code; + if ($country_code) { + $new_country_id = getCountry($country_code, 3, $db, $langs); + //print 'xxx'.$country_code.' - '.$new_country_id; + if ($new_country_id) { + $country_id = $new_country_id; + } + } +} +$country_code = getCountry($country_id, 2, $db, $langs); +print $form->select_country($country_id, 'country_id'); +print '
'.$langs->trans('State').''; + if ($country_code) { + print $formcompany->select_state(GETPOST("state_id"), $country_code); + } else { + print ''; + } + print '
\n"; + +print dol_get_fiche_end(); + + +// Show all action buttons +print '
'; +print '
'; +// Output introduction text +if ($project->accept_conference_suggestions) { + print ''; + print '

'; +} +print ''; +print '

'; +if ($project->accept_booth_suggestions) { + print ''; +} +print '
'; +print '

'; + + + +print "
\n"; +print "
"; +print '
'; + + +llxFooterVierge(); + +$db->close(); From 10c9e9b77c3017d618209de8bd4a8cd4ec8757ae Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Thu, 6 May 2021 11:31:23 +0200 Subject: [PATCH 0032/1497] wip --- htdocs/public/project/index.php | 688 ++++++-------------------------- 1 file changed, 133 insertions(+), 555 deletions(-) diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index fcbc786be4c..ce48db9e729 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -1,11 +1,10 @@ - * Copyright (C) 2001-2002 Jean-Louis Bergamo - * Copyright (C) 2006-2013 Laurent Destailleur - * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2012 J. Fernando Lagrange - * Copyright (C) 2018-2019 Frédéric France - * Copyright (C) 2018 Alexandre Spangaro +/* Copyright (C) 2001-2002 Rodolphe Quiedeville + * Copyright (C) 2006-2017 Laurent Destailleur + * Copyright (C) 2009-2012 Regis Houssin + * Copyright (C) 2018 Juanjo Menent + * Copyright (C) 2018-2019 Thibault FOUCART + * Copyright (C) 2021 Waël Almoman * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,22 +18,21 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * For Paypal test: https://developer.paypal.com/ + * For Paybox test: ??? + * For Stripe test: Use credit card 4242424242424242 .More example on https://stripe.com/docs/testing + * + * Variants: + * - When option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION is on, we use the new PaymentIntent API + * - When option STRIPE_USE_NEW_CHECKOUT is on, we use the new checkout API + * - If no option set, we use old APIS (charge) */ /** - * \file htdocs/public/members/new.php - * \ingroup member - * \brief Example of form to add a new member - * - * Note that you can add following constant to change behaviour of page - * MEMBER_NEWFORM_AMOUNT Default amount for auto-subscribe form - * MEMBER_NEWFORM_EDITAMOUNT 0 or 1 = Amount can be edited - * MEMBER_NEWFORM_PAYONLINE Suggest payment with paypal, paybox or stripe - * MEMBER_NEWFORM_DOLIBARRTURNOVER Show field turnover (specific for dolibarr foundation) - * MEMBER_URL_REDIRECT_SUBSCRIPTION Url to redirect once subscribe submitted - * MEMBER_NEWFORM_FORCETYPE Force type of member - * MEMBER_NEWFORM_FORCEMORPHY Force nature of member (mor/phy) - * MEMBER_NEWFORM_FORCECOUNTRYCODE Force country + * \file htdocs/public/payment/newpayment.php + * \ingroup core + * \brief File to offer a way to make a payment for a particular Dolibarr object */ if (!defined('NOLOGIN')) { @@ -49,52 +47,38 @@ if (!defined('NOIPCHECK')) { if (!defined('NOBROWSERNOTIF')) { define('NOBROWSERNOTIF', '1'); } -if (!defined('NOIPCHECK')) { - define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -} // For MultiCompany module. -// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php -// TODO This should be useless. Because entity must be retrieve from object ref and not from url. -$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); +// Do not use GETPOST here, function is not defined and get of entity must be done before including main.inc.php +$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : (!empty($_GET['e']) ? (int) $_GET['e'] : (!empty($_POST['e']) ? (int) $_POST['e'] : 1)))); if (is_numeric($entity)) { define("DOLENTITY", $entity); } require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; -require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; -require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; -require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; +require_once DOL_DOCUMENT_ROOT.'/societe/class/societeaccount.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/paymentterm.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +// Hook to be used by external payment modules (ie Payzen, ...) +include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; +$hookmanager = new HookManager($db); +$hookmanager->initHooks(array('newpayment')); +// For encryption global $dolibarr_main_instance_unique_id; -global $dolibarr_main_url_root; -// Init vars -$errmsg = ''; -$num = 0; -$error = 0; -$backtopage = GETPOST('backtopage', 'alpha'); -$action = GETPOST('action', 'aZ09'); - -// Getting id from Post and decoding it -$encodedid = GETPOST('id'); -$id = dol_decode($encodedid, $dolibarr_main_instance_unique_id); - -$project = new Project($db); -$resultproject = $project->fetch($id); -if ($resultproject < 0) { - $error++; - $errmsg .= $project->error; -} +// Load translation files +$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", "paybox", "paypal", "stripe")); // File with generic data // Security check -$id = dol_decode($encodedid, $dolibarr_main_instance_unique_id); +// No check on module enabled. Done later according to $validpaymentmethod + +$action = GETPOST('action', 'aZ09'); +$id = GETPOST('id'); $securekeyreceived = GETPOST("securekey"); $securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); @@ -103,548 +87,142 @@ if ($securekeytocompare != $securekeyreceived) { exit; } -// Load translation files -$langs->loadLangs(array("main", "companies", "install", "other", "eventorganization")); +// Define $urlwithroot +//$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); +//$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file +$urlwithroot = DOL_MAIN_URL_ROOT; // This is to use same domain name than current. For Paypal payment, we can use internal URL like localhost. -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array('publicnewmembercard', 'globalcard')); - -$extrafields = new ExtraFields($db); - -$user->loadDefaultValues(); - -$cactioncomm = new CActionComm($db); -$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, 'module=\'conference@eventorganization\' OR module=\'booth@eventorganization\''); - -/** - * Show header for new member - * - * @param string $title Title - * @param string $head Head array - * @param int $disablejs More content into html header - * @param int $disablehead More content into html header - * @param array $arrayofjs Array of complementary js files - * @param array $arrayofcss Array of complementary css files - * @return void - */ -function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '') -{ - global $user, $conf, $langs, $mysoc; - - top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers - - print ''; - - // Define urllogo - $urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png'; - - if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { - $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); - } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { - $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); - } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { - $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; - } - - print '
'; - // Output html code for logo - if ($urllogo) { - print '
'; - print '
'; - print ''; - print '
'; - if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { - print ''; - } - print '
'; - } - print '
'; - - print '
'; +$project = new Project($db); +$resultproject = $project->fetch($id); +if ($resultproject < 0) { + $error++; + $errmsg .= $project->error; } -/** - * Show footer for new member - * - * @return void - */ -function llxFooterVierge() -{ - print '
'; - - printCommonFooter('public'); - - print "\n"; - print "\n"; -} - - - /* * Actions */ -global $mysoc; -$parameters = array(); -// Note that $action and $object may have been modified by some hooks -$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); -if ($reshook < 0) { - setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); -} - -// Action called when page is submitted -if (empty($reshook) && $action == 'add') { - $error = 0; - - $urlback = ''; - - $db->begin(); - - if (!GETPOST("email")) { - $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."
\n"; - } - if (!GETPOST("label")) { - $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label"))."
\n"; - } - if (!GETPOST("note")) { - $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Note"))."
\n"; - } - if (!GETPOST("datestart")) { - $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateStart"))."
\n"; - } - if (!GETPOST("dateend")) { - $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEnd"))."
\n"; - } - if (!GETPOST("email")) { - $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."
\n"; - } - if (!GETPOST("lastname")) { - $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Name"))."
\n"; - } - if (!GETPOST("societe")) { - $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Societe"))."
\n"; - } - if (GETPOST("email") && !isValidEmail(GETPOST("email"))) { - $error++; - $langs->load("errors"); - $errmsg .= $langs->trans("ErrorBadEMail", GETPOST("email"))."
\n"; - } - if (!GETPOST("country_id")) { - $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Country"))."
\n"; - } - - if (!$error) { - // Getting the thirdparty or creating it - $thirdparty = new Societe($db); - $resultfetchthirdparty = $thirdparty->fetch('', $societe); - - if ($resultfetchthirdparty<=0) { - // Need to create a new one (not found or multiple with the same name) - $thirdparty->name = $societe; - $thirdparty->address = GETPOST("address"); - $thirdparty->zip = GETPOST("zipcode"); - $thirdparty->town = GETPOST("town"); - $thirdparty->client = 2; - $thirdparty->fournisseur = 0; - $thirdparty->country_id = GETPOST("country_id", 'int'); - $thirdparty->state_id = GETPOST("state_id", 'int'); - $thirdparty->email = $email; - - // Load object modCodeTiers - $module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); - if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { - $module = substr($module, 0, dol_strlen($module) - 4); - } - $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); - foreach ($dirsociete as $dirroot) { - $res = dol_include_once($dirroot.$module.'.php'); - if ($res) { - break; - } - } - $modCodeClient = new $module($db); - - if (empty($tmpcode) && !empty($modCodeClient->code_auto)) { - $tmpcode = $modCodeClient->getNextValue($thirdparty, 0); - } - $thirdparty->code_client = $tmpcode; - $readythirdparty = $thirdparty->create($user); - if ($readythirdparty <0) { - $error++; - $errmsg .= $thirdparty->error; - } else { - $thirdparty->country_code = getCountry($thirdparty->country_id, 2, $db, $langs); - $thirdparty->country = getCountry($thirdparty->country_code, 0, $db, $langs); - } - } - // From there we have a thirdparty, now looking for the contact - if (!$error) { - $contact = new Contact($db); - $resultcontact = $contact->fetch('', '', '', $email); - if ($resultcontact<=0) { - // Need to create a contact - $contact->socid = $thirdparty->id; - $contact->lastname = (string) GETPOST("lastname", 'alpha'); - $contact->firstname = (string) GETPOST("firstname", 'alpha'); - $contact->address = (string) GETPOST("address", 'alpha'); - $contact->zip = (string) GETPOST("zipcode", 'alpha'); - $contact->town = (string) GETPOST("town", 'alpha'); - $contact->country_id = (int) GETPOST("country_id", 'int'); - $contact->state_id = (int) GETPOST("state_id", 'int'); - $contact->email = $email; - $contact->statut = 1; //Default status to Actif - - $resultcreatecontact = $contact->create($user); - if ($resultcreatecontact<0) { - $error++; - $errmsg .= $contact->error; - } - } - } - - if (!$error) { - // Adding supplier tag and tag from setup to thirdparty - $category = new Categorie($db); - if (GETPOST("suggestconference")) { - // Conference case - $resultcategory = $category->fetch($conf->global->EVENTORGANIZATION_CATEG_THIRDPARTY_CONF); - } else { - // Booth case - $resultcategory = $category->fetch($conf->global->EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH); - } - - if ($resultcategory<=0) { - $error++; - $errmsg .= $category->error; - } else { - $resultsetcategory = $thirdparty->setCategoriesCommon(array($category->id), CATEGORIE::TYPE_CUSTOMER, false); - if ($resultsetcategory < 0) { - $error++; - $errmsg .= $thirdparty->error; - } else { - $thirdparty->fournisseur = 1; - - // Load object modCodeFournisseur - $module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); - if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { - $module = substr($module, 0, dol_strlen($module) - 4); - } - $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); - foreach ($dirsociete as $dirroot) { - $res = dol_include_once($dirroot.$module.'.php'); - if ($res) { - break; - } - } - $modCodeFournisseur = new $module; - if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) { - $tmpcode = $modCodeFournisseur->getNextValue($thirdparty, 1); - } - $thirdparty->code_fournisseur = $tmpcode; - - $res = $thirdparty->update(0, $user, 1, 1, 1); - - if ($res <= 0) { - $error++; - } - } - } - } - - if (!$error) { - // We have the contact and the thirdparty - $conforbooth = new ConferenceOrBooth($db); - $conforbooth->label = $label; - $conforbooth->fk_soc = $thirdparty->id; - $conforbooth->fk_project = $project->id; - $conforbooth->note = $note; - $conforbooth->fk_action = $eventtype; - $conforbooth->datep =$datestart; - $conforbooth->datep2 = $dateend; - $conforbooth->datec = dol_now(); - $conforbooth->tms = dol_now(); - $resultconforbooth = $conforbooth->create($user); - if ($resultconforbooth<=0) { - $error++; - $errmsg .= $conforbooth->error; - } else { - // If this is a paying booth, we have to redirect to payment page and create an invoice - if (GETPOST("suggestbooth") && !empty(floatval($project->price_booth))) { - $productforinvoicerow = new Product($db); - $resultprod = $productforinvoicerow->fetch($conf->global->SERVICE_BOOTH_LOCATION); - if ($resultprod < 0) { - $error++; - $errmsg .= $productforinvoicerow->error; - } else { - $facture = new Facture($db); - $facture->type = Facture::TYPE_STANDARD; - $facture->socid = $thirdparty->id; - $facture->paye = 0; - $facture->date = dol_now(); - $facture->cond_reglement_id = $contact->cond_reglement_id; - - if (empty($facture->cond_reglement_id)) { - $paymenttermstatic = new PaymentTerm($contact->db); - $facture->cond_reglement_id = $paymenttermstatic->getDefaultId(); - if (empty($facture->cond_reglement_id)) { - $error++; - $contact->error = 'ErrorNoPaymentTermRECEPFound'; - $contact->errors[] = $contact->error; - } - } - $resultfacture = $facture->create($user); - if ($resultfacture <= 0) { - $contact->error = $facture->error; - $contact->errors = $facture->errors; - $error++; - } else { - $facture->add_object_linked($contact->element, $contact->id); - } - } - - if (!$error) { - // Add line to draft invoice - $vattouse = get_default_tva($mysoc, $thirdparty, $productforinvoicerow->id); - $result = $facture->addline($langs->trans("BoothLocationFee", $conforbooth->label, dol_print_date($conforbooth->datep, '%d/%m/%y %H:%M:%S'), dol_print_date($conforbooth->datep2, '%d/%m/%y %H:%M:%S')), floatval($project->price_booth), 1, $vattouse, 0, 0, $productforinvoicerow->id, 0, dol_now(), '', 0, 0, '', 'HT', 0, 1); - if ($result <= 0) { - $contact->error = $facture->error; - $contact->errors = $facture->errors; - $error++; - } - if (!$error) { - $valid = true; - $sourcetouse = 'boothlocation'; - $reftouse = $facture->id; - $redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?source='.$sourcetouse.'&ref='.$reftouse.'&booth='.$conforbooth->id; - if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { - if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { - $redirection .= '&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $sourcetouse . $reftouse, 2); // Use the source in the hash to avoid duplicates if the references are identical - } else { - $redirection .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; - } - } - Header("Location: ".$redirection); - exit; - } - } - } else { - // If no price has been set for the booth or this is a conference, we confirm it as suggested and we update - $conforbooth->status = CONFERENCEORBOOTH::STATUS_SUGGESTED; - $conforbooth->update($user); - // Sending mail - require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; - $formmail = new FormMail($db); - // Set output language - $outputlangs = new Translate('', $conf); - $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); - // Load traductions files required by page - $outputlangs->loadLangs(array("main", "members")); - // Get email content from template - $arraydefaultmessage = null; - - $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; - if (!empty($labeltouse)) { - $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); - } - - if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { - $subject = $arraydefaultmessage->topic; - $msg = $arraydefaultmessage->content; - } - - $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); - complete_substitutions_array($substitutionarray, $outputlangs, $object); - - $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); - $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); - - $sendto = $thirdparty->email; - $from = $conf->global->MAILING_EMAIL_FROM; - $urlback = $_SERVER["REQUEST_URI"]; - - $ishtml = dol_textishtml($texttosend); // May contain urls - - $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); - - $result = $mailfile->sendfile(); - if ($result) { - dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); - } else { - dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); - } - } - } - } - } - if (!$error) { - $db->commit(); - $encodedid = dol_encode($id, $dolibarr_main_instance_unique_id); - $securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); - $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$encodedid.'&securekey='.$securekeyurl; - Header("Location: ".$redirection); - exit; - } else { - $db->rollback(); - } -} /* * View */ -$form = new Form($db); -$formcompany = new FormCompany($db); +$head = ''; +if (!empty($conf->global->ONLINE_PAYMENT_CSS_URL)) { + $head = ''."\n"; +} -llxHeaderVierge($langs->trans("NewSuggestion")); +$conf->dol_hide_topmenu = 1; +$conf->dol_hide_leftmenu = 1; + +$replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
' : '').'
'; +llxHeader($head, $langs->trans("PaymentForm"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea); -print load_fiche_titre($langs->trans("NewSuggestion"), '', '', 0, 0, 'center'); +// Show sandbox warning +if ((empty($paymentmethod) || $paymentmethod == 'paypal') && !empty($conf->paypal->enabled) && (!empty($conf->global->PAYPAL_API_SANDBOX) || GETPOST('forcesandbox', 'int'))) { // We can force sand box with param 'forcesandbox' + dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Paypal'), '', 'warning'); +} +if ((empty($paymentmethod) || $paymentmethod == 'stripe') && !empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'int'))) { + dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning'); +} -print '
'; -print '
'; -print '
'; +print ''."\n"; +print '
'."\n"; +print '
'."\n"; +print ''."\n"; +print ''."\n"; +print ''."\n"; +print ''."\n"; +print ''."\n"; +print ''; +print ''; +print "\n"; -// Welcome message -$text = ''.$langs->trans("EvntOrgRegistrationWelcomeMessage").'
'; + +// Show logo (search order: logo defined by PAYMENT_LOGO_suffix, then PAYMENT_LOGO, then small company logo, large company logo, theme logo, common logo) +// Define logo and logosmall +$logosmall = $mysoc->logo_small; +$logo = $mysoc->logo; +$paramlogo = 'ONLINE_PAYMENT_LOGO_'.$suffix; +if (!empty($conf->global->$paramlogo)) { + $logosmall = $conf->global->$paramlogo; +} elseif (!empty($conf->global->ONLINE_PAYMENT_LOGO)) { + $logosmall = $conf->global->ONLINE_PAYMENT_LOGO; +} +//print ''."\n"; +// Define urllogo +$urllogo = ''; +$urllogofull = ''; +if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); + $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); +} elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); + $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); +} + +// Output html code for logo +if ($urllogo) { + print '
'; + print '
'; + print ''; + print '
'; + if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { + print ''; + } + print '
'; +} + +print ''."\n"; + +$text = ''."\n"; $text .= ''."\n"; -$text .= ''."\n";; +$text .= ''."\n";; + print $text; -print ''; -dol_htmloutput_errors($errmsg); +// Output payment summary form +print ''."\n"; + +print '

'.$langs->trans("EvntOrgRegistrationWelcomeMessage").'
'.$langs->trans("EvntOrgRegistrationHelpMessage").' '.$id.'.

'.$project->note_public.'
'.$project->note_public.'

'; -// Print form -print ''."\n"; -print ''; -print ''; -print ''; -print ''; -print ''; +$found = false; +$error = 0; +$var = false; -print '
'; +$object = null; -print '
'.$langs->trans("FieldsWithAreMandatory", '*').'
'; -//print $langs->trans("FieldsWithIsForPublic",'**').'
'; - -print dol_get_fiche_head(''); - -print ''; - -print ''."\n"; - -// Name -print ''; -print ''; -print ''; -// Email -print ''."\n"; -// Company -print ''."\n"; -// Type of event -print ''."\n"; -print ''; -// Label -print ''."\n"; -print ''."\n"; -// Note -print ''."\n"; -print ''."\n"; -// Start Date -print ''."\n"; -print ''."\n"; -// End Date -print ''."\n"; -print ''."\n"; -// Address -print ''."\n"; -// Zip / Town -print ''; -// Country -print ''; -// State -if (empty($conf->global->SOCIETE_DISABLE_STATE)) { - print ''; -} - -print "
lastname).'" autofocus="autofocus">
'.$langs->trans("Email").'*
'.$langs->trans("Company").'*'; -print '
'.$langs->trans("EventType").'*'.FORM::selectarray('eventtype', $arrayofeventtype, $eventtype).'
'.$langs->trans("Label").'*
'.$langs->trans("Note").'*
'.$langs->trans("DateStart").'
'.$langs->trans("DateEnd").'
'.$langs->trans("Address").''."\n"; -print '
'.$langs->trans('Zip').' / '.$langs->trans('Town').''; -print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6, 1); -print ' / '; -print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); -print '
'.$langs->trans('Country').'*'; -$country_id = GETPOST('country_id'); -if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { - $country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); -} -if (!$country_id && !empty($conf->geoipmaxmind->enabled)) { - $country_code = dol_user_country(); - //print $country_code; - if ($country_code) { - $new_country_id = getCountry($country_code, 3, $db, $langs); - //print 'xxx'.$country_code.' - '.$new_country_id; - if ($new_country_id) { - $country_id = $new_country_id; - } - } -} -$country_code = getCountry($country_id, 2, $db, $langs); -print $form->select_country($country_id, 'country_id'); -print '
'.$langs->trans('State').''; - if ($country_code) { - print $formcompany->select_state(GETPOST("state_id"), $country_code); - } else { - print ''; - } - print '
\n"; - -print dol_get_fiche_end(); +print "\n"; // Show all action buttons -print '
'; print '
'; // Output introduction text if ($project->accept_conference_suggestions) { - print ''; + print ''; print '

'; } -print ''; +print ''; print '

'; if ($project->accept_booth_suggestions) { - print ''; + print ''; } -print '
'; -print '

'; -print "\n"; -print "
"; -print ''; +print '
'."\n"; + +print ''."\n"; +print '
'."\n"; +print '
'; -llxFooterVierge(); +htmlPrintOnlinePaymentFooter($mysoc, $langs, 1, $suffix, $object); + +llxFooter('', 'public'); $db->close(); From 099ad77d44b282417187c3003479c4bc60c457a4 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Thu, 6 May 2021 11:32:07 +0200 Subject: [PATCH 0033/1497] encryption change for url --- htdocs/eventorganization/conferenceorbooth_list.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index e3ba815121c..be8770b6390 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -364,8 +364,7 @@ if ($projectid > 0) { // Link to the vote/register page print ''.$langs->trans("RegisterPage").''; - $encodedid = dol_encode($project->id, $dolibarr_main_instance_unique_id); - $linkregister = $dolibarr_main_url_root.'/public/project/index.php?id='.$encodedid; + $linkregister = $dolibarr_main_url_root.'/public/project/index.php?id='.$project->id; $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$project->id, 2); $linkregister .= '&securekey='.urlencode($encodedsecurekey); print ''.$linkregister.''; From df78aaff889bfab4b3803e07b8d4267ce47ea895 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Thu, 6 May 2021 11:49:00 +0200 Subject: [PATCH 0034/1497] now 2 distinct pages to suggest a conf or a booth --- htdocs/public/project/index.php | 45 ++++++++++++--------- htdocs/public/project/suggestbooth.php | 16 ++------ htdocs/public/project/suggestconference.php | 16 ++------ 3 files changed, 35 insertions(+), 42 deletions(-) diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index ce48db9e729..9ddfc8ce759 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -103,6 +103,23 @@ if ($resultproject < 0) { * Actions */ +if (GETPOST('suggestbooth')) { + header("Location: ".dol_buildpath('/public/project/suggestbooth.php', 1).'?id='.$id."&securekey=".$securekeyreceived); + exit; +} + +if (GETPOST('suggestconference')) { + header("Location: ".dol_buildpath('/public/project/suggestconference.php', 1).'?id='.$id."&securekey=".$securekeyreceived); + exit; +} + +if (GETPOST('viewandvote')) { + header("Location: ".dol_buildpath('/public/project/viewandvote.php', 1).'?id='.$id."&securekey=".$securekeyreceived); + exit; +} + + + /* * View @@ -119,24 +136,15 @@ $conf->dol_hide_leftmenu = 1; $replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
' : '').'
'; llxHeader($head, $langs->trans("PaymentForm"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea); - -// Show sandbox warning -if ((empty($paymentmethod) || $paymentmethod == 'paypal') && !empty($conf->paypal->enabled) && (!empty($conf->global->PAYPAL_API_SANDBOX) || GETPOST('forcesandbox', 'int'))) { // We can force sand box with param 'forcesandbox' - dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Paypal'), '', 'warning'); -} -if ((empty($paymentmethod) || $paymentmethod == 'stripe') && !empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'int'))) { - dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning'); -} - - print ''."\n"; print '
'."\n"; print '
'."\n"; print ''."\n"; print ''."\n"; print ''."\n"; -print ''."\n"; -print ''."\n"; +//print ''."\n"; +print ''."\n"; +print ''."\n"; print ''; print ''; print "\n"; @@ -200,15 +208,16 @@ print "\n"; // Show all action buttons print '
'; // Output introduction text -if ($project->accept_conference_suggestions) { - print ''; +if ($project->accept_booth_suggestions) { + print ''; print '

'; } -print ''; -print '

'; -if ($project->accept_booth_suggestions) { - print ''; +if ($project->accept_conference_suggestions) { + print ''; + print '

'; } +print ''; + diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index e4c030c9718..119741f6233 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -90,9 +90,7 @@ $note = GETPOST("note"); $datestart = GETPOST("datestart"); $dateend = GETPOST("dateend"); -// Getting id from Post and decoding it -$encodedid = GETPOST('id'); -$id = dol_decode($encodedid, $dolibarr_main_instance_unique_id); +$id = GETPOST('id'); $project = new Project($db); $resultproject = $project->fetch($id); @@ -102,7 +100,6 @@ if ($resultproject < 0) { } // Security check -$id = dol_decode($encodedid, $dolibarr_main_instance_unique_id); $securekeyreceived = GETPOST("securekey"); $securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); @@ -122,7 +119,7 @@ $extrafields = new ExtraFields($db); $user->loadDefaultValues(); $cactioncomm = new CActionComm($db); -$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, 'module=\'conference@eventorganization\' OR module=\'booth@eventorganization\''); +$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, 'module=\'booth@eventorganization\''); /** * Show header for new member @@ -322,13 +319,8 @@ if (empty($reshook) && $action == 'add') { if (!$error) { // Adding supplier tag and tag from setup to thirdparty $category = new Categorie($db); - if (GETPOST("suggestconference")) { - // Conference case - $resultcategory = $category->fetch($conf->global->EVENTORGANIZATION_CATEG_THIRDPARTY_CONF); - } else { - // Booth case - $resultcategory = $category->fetch($conf->global->EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH); - } + + $resultcategory = $category->fetch($conf->global->EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH); if ($resultcategory<=0) { $error++; diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index e4c030c9718..68ed90fc260 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -90,9 +90,7 @@ $note = GETPOST("note"); $datestart = GETPOST("datestart"); $dateend = GETPOST("dateend"); -// Getting id from Post and decoding it -$encodedid = GETPOST('id'); -$id = dol_decode($encodedid, $dolibarr_main_instance_unique_id); +$id = GETPOST('id'); $project = new Project($db); $resultproject = $project->fetch($id); @@ -102,7 +100,6 @@ if ($resultproject < 0) { } // Security check -$id = dol_decode($encodedid, $dolibarr_main_instance_unique_id); $securekeyreceived = GETPOST("securekey"); $securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); @@ -122,7 +119,7 @@ $extrafields = new ExtraFields($db); $user->loadDefaultValues(); $cactioncomm = new CActionComm($db); -$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, 'module=\'conference@eventorganization\' OR module=\'booth@eventorganization\''); +$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, 'module=\'conference@eventorganization\''); /** * Show header for new member @@ -322,13 +319,8 @@ if (empty($reshook) && $action == 'add') { if (!$error) { // Adding supplier tag and tag from setup to thirdparty $category = new Categorie($db); - if (GETPOST("suggestconference")) { - // Conference case - $resultcategory = $category->fetch($conf->global->EVENTORGANIZATION_CATEG_THIRDPARTY_CONF); - } else { - // Booth case - $resultcategory = $category->fetch($conf->global->EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH); - } + + $resultcategory = $category->fetch($conf->global->EVENTORGANIZATION_CATEG_THIRDPARTY_CONF); if ($resultcategory<=0) { $error++; From c56c7afa89f79761b18392649603ce79d343c5de Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Thu, 6 May 2021 11:59:24 +0200 Subject: [PATCH 0035/1497] update on specifications on suggesting a booth/conf since its now two separated pages --- htdocs/public/project/suggestbooth.php | 4 +- htdocs/public/project/suggestconference.php | 141 ++++++-------------- 2 files changed, 42 insertions(+), 103 deletions(-) diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index 119741f6233..bec7c1c55a1 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -378,7 +378,7 @@ if (empty($reshook) && $action == 'add') { $errmsg .= $conforbooth->error; } else { // If this is a paying booth, we have to redirect to payment page and create an invoice - if (GETPOST("suggestbooth") && !empty(floatval($project->price_booth))) { + if (!empty(floatval($project->price_booth))) { $productforinvoicerow = new Product($db); $resultprod = $productforinvoicerow->fetch($conf->global->SERVICE_BOOTH_LOCATION); if ($resultprod < 0) { @@ -437,7 +437,7 @@ if (empty($reshook) && $action == 'add') { } } } else { - // If no price has been set for the booth or this is a conference, we confirm it as suggested and we update + // If no price has been set for the booth, we confirm it as suggested and we update $conforbooth->status = CONFERENCEORBOOTH::STATUS_SUGGESTED; $conforbooth->update($user); // Sending mail diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index 68ed90fc260..fc452c740bb 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -378,110 +378,49 @@ if (empty($reshook) && $action == 'add') { $errmsg .= $conforbooth->error; } else { // If this is a paying booth, we have to redirect to payment page and create an invoice - if (GETPOST("suggestbooth") && !empty(floatval($project->price_booth))) { - $productforinvoicerow = new Product($db); - $resultprod = $productforinvoicerow->fetch($conf->global->SERVICE_BOOTH_LOCATION); - if ($resultprod < 0) { - $error++; - $errmsg .= $productforinvoicerow->error; - } else { - $facture = new Facture($db); - $facture->type = Facture::TYPE_STANDARD; - $facture->socid = $thirdparty->id; - $facture->paye = 0; - $facture->date = dol_now(); - $facture->cond_reglement_id = $contact->cond_reglement_id; + $conforbooth->status = CONFERENCEORBOOTH::STATUS_SUGGESTED; + $conforbooth->update($user); + // Sending mail + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); + // Load traductions files required by page + $outputlangs->loadLangs(array("main", "members")); + // Get email content from template + $arraydefaultmessage = null; - if (empty($facture->cond_reglement_id)) { - $paymenttermstatic = new PaymentTerm($contact->db); - $facture->cond_reglement_id = $paymenttermstatic->getDefaultId(); - if (empty($facture->cond_reglement_id)) { - $error++; - $contact->error = 'ErrorNoPaymentTermRECEPFound'; - $contact->errors[] = $contact->error; - } - } - $resultfacture = $facture->create($user); - if ($resultfacture <= 0) { - $contact->error = $facture->error; - $contact->errors = $facture->errors; - $error++; - } else { - $facture->add_object_linked($contact->element, $contact->id); - } - } + $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; + if (!empty($labeltouse)) { + $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); + } - if (!$error) { - // Add line to draft invoice - $vattouse = get_default_tva($mysoc, $thirdparty, $productforinvoicerow->id); - $result = $facture->addline($langs->trans("BoothLocationFee", $conforbooth->label, dol_print_date($conforbooth->datep, '%d/%m/%y %H:%M:%S'), dol_print_date($conforbooth->datep2, '%d/%m/%y %H:%M:%S')), floatval($project->price_booth), 1, $vattouse, 0, 0, $productforinvoicerow->id, 0, dol_now(), '', 0, 0, '', 'HT', 0, 1); - if ($result <= 0) { - $contact->error = $facture->error; - $contact->errors = $facture->errors; - $error++; - } - if (!$error) { - $valid = true; - $sourcetouse = 'boothlocation'; - $reftouse = $facture->id; - $redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?source='.$sourcetouse.'&ref='.$reftouse.'&booth='.$conforbooth->id; - if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { - if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { - $redirection .= '&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $sourcetouse . $reftouse, 2); // Use the source in the hash to avoid duplicates if the references are identical - } else { - $redirection .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; - } - } - Header("Location: ".$redirection); - exit; - } - } + if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); + + $sendto = $thirdparty->email; + $from = $conf->global->MAILING_EMAIL_FROM; + $urlback = $_SERVER["REQUEST_URI"]; + + $ishtml = dol_textishtml($texttosend); // May contain urls + + $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); + + $result = $mailfile->sendfile(); + if ($result) { + dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); } else { - // If no price has been set for the booth or this is a conference, we confirm it as suggested and we update - $conforbooth->status = CONFERENCEORBOOTH::STATUS_SUGGESTED; - $conforbooth->update($user); - // Sending mail - require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; - $formmail = new FormMail($db); - // Set output language - $outputlangs = new Translate('', $conf); - $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); - // Load traductions files required by page - $outputlangs->loadLangs(array("main", "members")); - // Get email content from template - $arraydefaultmessage = null; - - $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; - if (!empty($labeltouse)) { - $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); - } - - if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { - $subject = $arraydefaultmessage->topic; - $msg = $arraydefaultmessage->content; - } - - $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); - complete_substitutions_array($substitutionarray, $outputlangs, $object); - - $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); - $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); - - $sendto = $thirdparty->email; - $from = $conf->global->MAILING_EMAIL_FROM; - $urlback = $_SERVER["REQUEST_URI"]; - - $ishtml = dol_textishtml($texttosend); // May contain urls - - $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); - - $result = $mailfile->sendfile(); - if ($result) { - dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); - } else { - dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); - } + dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); } } } From 4d8d94bfbf254aee0af122821d8f04c42c0a0560 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Thu, 6 May 2021 12:13:49 +0200 Subject: [PATCH 0036/1497] fixes: show only correspond button on specific page, id no longer encoded in hidden parameter --- htdocs/public/project/suggestbooth.php | 13 ++----------- htdocs/public/project/suggestconference.php | 15 +++------------ 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index bec7c1c55a1..96a00434374 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -530,7 +530,7 @@ print ''. print ''; print ''; print ''; -print ''; +print ''; print ''; print '
'; @@ -625,16 +625,7 @@ print dol_get_fiche_end(); // Show all action buttons print '
'; print '
'; -// Output introduction text -if ($project->accept_conference_suggestions) { - print ''; - print '

'; -} -print ''; -print '

'; -if ($project->accept_booth_suggestions) { - print ''; -} +print ''; print '
'; print '

'; diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index fc452c740bb..1350716072b 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -469,7 +469,7 @@ print ''. print ''; print ''; print ''; -print ''; +print ''; print ''; print '
'; @@ -564,21 +564,12 @@ print dol_get_fiche_end(); // Show all action buttons print '
'; print '
'; -// Output introduction text -if ($project->accept_conference_suggestions) { - print ''; - print '

'; -} -print ''; -print '

'; -if ($project->accept_booth_suggestions) { - print ''; -} -print '
'; +print ''; print '

'; + print "\n"; print "
"; print '
'; From abeb1c644c7721bc931eaf97611d0ac6b09489da Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Thu, 6 May 2021 13:50:13 +0200 Subject: [PATCH 0037/1497] country now only required when paying a booth, dates of start and end required --- htdocs/public/project/suggestbooth.php | 13 +++++++++---- htdocs/public/project/suggestconference.php | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index 96a00434374..e8b7ad44874 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -242,7 +242,7 @@ if (empty($reshook) && $action == 'add') { $langs->load("errors"); $errmsg .= $langs->trans("ErrorBadEMail", GETPOST("email"))."
\n"; } - if (!GETPOST("country_id")) { + if (!GETPOST("country_id") && !empty(floatval($project->price_booth))) { $error++; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Country"))."
\n"; } @@ -407,6 +407,7 @@ if (empty($reshook) && $action == 'add') { $contact->errors = $facture->errors; $error++; } else { + $db->commit(); $facture->add_object_linked($contact->element, $contact->id); } } @@ -572,10 +573,10 @@ print '*'."\n"; print ''."\n"; // Start Date -print ''.$langs->trans("DateStart").''."\n"; +print ''.$langs->trans("DateStart").'*'."\n"; print ''."\n"; // End Date -print ''.$langs->trans("DateEnd").''."\n"; +print ''.$langs->trans("DateEnd").'*'."\n"; print ''."\n"; // Address print ''.$langs->trans("Address").''."\n"; @@ -587,7 +588,11 @@ print ' / '; print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); print ''; // Country -print ''.$langs->trans('Country').'*'; +print ''.$langs->trans('Country'); +if (!empty(floatval($project->price_booth))) { + print '*'; +} +print ''; $country_id = GETPOST('country_id'); if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { $country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index 1350716072b..0483312e519 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -526,7 +526,7 @@ print ' / '; print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); print ''; // Country -print ''.$langs->trans('Country').'*'; +print ''.$langs->trans('Country').''; $country_id = GETPOST('country_id'); if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { $country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); From 9c20e92e179eb86ac4f49b9321e221edcc9be662 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Thu, 6 May 2021 14:06:53 +0200 Subject: [PATCH 0038/1497] country no longer required for conf, preparation of add_contact to conforbooth (not done, commented) and page name change --- htdocs/langs/en_US/eventorganization.lang | 1 + htdocs/public/project/index.php | 2 +- htdocs/public/project/suggestbooth.php | 10 +++- htdocs/public/project/suggestconference.php | 61 +++++++++++---------- 4 files changed, 43 insertions(+), 31 deletions(-) diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 7b5ddd8160c..1d7b16c17f6 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -96,6 +96,7 @@ EvntOrgCancelled = Cancelled # # Public page # +SuggestForm = Suggestion page RegisterPage = Page for conferences or booth EvntOrgRegistrationWelcomeMessage = Welcome on the conference or booth suggestion page. EvntOrgRegistrationHelpMessage = Here, you can suggest a new conference or a new booth for the project diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index 9ddfc8ce759..b05f2b1fc6f 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -134,7 +134,7 @@ $conf->dol_hide_topmenu = 1; $conf->dol_hide_leftmenu = 1; $replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
' : '').'
'; -llxHeader($head, $langs->trans("PaymentForm"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea); +llxHeader($head, $langs->trans("SuggestForm"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea); print ''."\n"; print '
'."\n"; diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index e8b7ad44874..3db61f67129 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -377,7 +377,14 @@ if (empty($reshook) && $action == 'add') { $error++; $errmsg .= $conforbooth->error; } else { - // If this is a paying booth, we have to redirect to payment page and create an invoice + // Adding the contact to the project + /*$resultaddcontact = $conforbooth->add_contact($contact); + if ($resultaddcontact<0) { + $error++; + $errmsg .= $conforbooth->error; + } else {*/ + + // If this is a paying booth, we have to redirect to payment page and create an invoice if (!empty(floatval($project->price_booth))) { $productforinvoicerow = new Product($db); $resultprod = $productforinvoicerow->fetch($conf->global->SERVICE_BOOTH_LOCATION); @@ -484,6 +491,7 @@ if (empty($reshook) && $action == 'add') { dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); } } + //} } } } diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index 0483312e519..21cbe7d77bd 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -242,10 +242,6 @@ if (empty($reshook) && $action == 'add') { $langs->load("errors"); $errmsg .= $langs->trans("ErrorBadEMail", GETPOST("email"))."
\n"; } - if (!GETPOST("country_id")) { - $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Country"))."
\n"; - } if (!$error) { // Getting the thirdparty or creating it @@ -377,22 +373,28 @@ if (empty($reshook) && $action == 'add') { $error++; $errmsg .= $conforbooth->error; } else { - // If this is a paying booth, we have to redirect to payment page and create an invoice - $conforbooth->status = CONFERENCEORBOOTH::STATUS_SUGGESTED; - $conforbooth->update($user); - // Sending mail - require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; - $formmail = new FormMail($db); - // Set output language - $outputlangs = new Translate('', $conf); - $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); - // Load traductions files required by page - $outputlangs->loadLangs(array("main", "members")); - // Get email content from template - $arraydefaultmessage = null; + // Adding the contact to the project + /*$resultaddcontact = $conforbooth->add_contact($contact); + if ($resultaddcontact<0) { + $error++; + $errmsg .= $conforbooth->error; + } else {*/ + $conforbooth->status = CONFERENCEORBOOTH::STATUS_SUGGESTED; + $conforbooth->update($user); - $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; + // Sending mail + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); + // Load traductions files required by page + $outputlangs->loadLangs(array("main", "members")); + // Get email content from template + $arraydefaultmessage = null; + + $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; if (!empty($labeltouse)) { $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); } @@ -402,26 +404,27 @@ if (empty($reshook) && $action == 'add') { $msg = $arraydefaultmessage->content; } - $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); - complete_substitutions_array($substitutionarray, $outputlangs, $object); + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); + complete_substitutions_array($substitutionarray, $outputlangs, $object); - $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); - $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); - $sendto = $thirdparty->email; - $from = $conf->global->MAILING_EMAIL_FROM; - $urlback = $_SERVER["REQUEST_URI"]; + $sendto = $thirdparty->email; + $from = $conf->global->MAILING_EMAIL_FROM; + $urlback = $_SERVER["REQUEST_URI"]; - $ishtml = dol_textishtml($texttosend); // May contain urls + $ishtml = dol_textishtml($texttosend); // May contain urls - $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); + $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); - $result = $mailfile->sendfile(); + $result = $mailfile->sendfile(); if ($result) { dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); } else { dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); } + //} } } } From a00c9c44c35f3e98542de2b50b804638210f496f Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Thu, 6 May 2021 14:26:41 +0200 Subject: [PATCH 0039/1497] now adding contact to conforbooth, not only to thirdparty --- htdocs/public/project/suggestbooth.php | 203 ++++++++++---------- htdocs/public/project/suggestconference.php | 28 +-- 2 files changed, 115 insertions(+), 116 deletions(-) diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index 3db61f67129..bb03c0d3782 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -378,120 +378,119 @@ if (empty($reshook) && $action == 'add') { $errmsg .= $conforbooth->error; } else { // Adding the contact to the project - /*$resultaddcontact = $conforbooth->add_contact($contact); + $resultaddcontact = $conforbooth->add_contact($contact->id, 'RESPONSIBLE'); if ($resultaddcontact<0) { $error++; $errmsg .= $conforbooth->error; - } else {*/ - + } else { // If this is a paying booth, we have to redirect to payment page and create an invoice - if (!empty(floatval($project->price_booth))) { - $productforinvoicerow = new Product($db); - $resultprod = $productforinvoicerow->fetch($conf->global->SERVICE_BOOTH_LOCATION); - if ($resultprod < 0) { - $error++; - $errmsg .= $productforinvoicerow->error; - } else { - $facture = new Facture($db); - $facture->type = Facture::TYPE_STANDARD; - $facture->socid = $thirdparty->id; - $facture->paye = 0; - $facture->date = dol_now(); - $facture->cond_reglement_id = $contact->cond_reglement_id; - - if (empty($facture->cond_reglement_id)) { - $paymenttermstatic = new PaymentTerm($contact->db); - $facture->cond_reglement_id = $paymenttermstatic->getDefaultId(); - if (empty($facture->cond_reglement_id)) { - $error++; - $contact->error = 'ErrorNoPaymentTermRECEPFound'; - $contact->errors[] = $contact->error; - } - } - $resultfacture = $facture->create($user); - if ($resultfacture <= 0) { - $contact->error = $facture->error; - $contact->errors = $facture->errors; + if (!empty(floatval($project->price_booth))) { + $productforinvoicerow = new Product($db); + $resultprod = $productforinvoicerow->fetch($conf->global->SERVICE_BOOTH_LOCATION); + if ($resultprod < 0) { $error++; + $errmsg .= $productforinvoicerow->error; } else { - $db->commit(); - $facture->add_object_linked($contact->element, $contact->id); - } - } + $facture = new Facture($db); + $facture->type = Facture::TYPE_STANDARD; + $facture->socid = $thirdparty->id; + $facture->paye = 0; + $facture->date = dol_now(); + $facture->cond_reglement_id = $contact->cond_reglement_id; - if (!$error) { - // Add line to draft invoice - $vattouse = get_default_tva($mysoc, $thirdparty, $productforinvoicerow->id); - $result = $facture->addline($langs->trans("BoothLocationFee", $conforbooth->label, dol_print_date($conforbooth->datep, '%d/%m/%y %H:%M:%S'), dol_print_date($conforbooth->datep2, '%d/%m/%y %H:%M:%S')), floatval($project->price_booth), 1, $vattouse, 0, 0, $productforinvoicerow->id, 0, dol_now(), '', 0, 0, '', 'HT', 0, 1); - if ($result <= 0) { - $contact->error = $facture->error; - $contact->errors = $facture->errors; - $error++; - } - if (!$error) { - $valid = true; - $sourcetouse = 'boothlocation'; - $reftouse = $facture->id; - $redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?source='.$sourcetouse.'&ref='.$reftouse.'&booth='.$conforbooth->id; - if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { - if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { - $redirection .= '&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $sourcetouse . $reftouse, 2); // Use the source in the hash to avoid duplicates if the references are identical - } else { - $redirection .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; + if (empty($facture->cond_reglement_id)) { + $paymenttermstatic = new PaymentTerm($contact->db); + $facture->cond_reglement_id = $paymenttermstatic->getDefaultId(); + if (empty($facture->cond_reglement_id)) { + $error++; + $contact->error = 'ErrorNoPaymentTermRECEPFound'; + $contact->errors[] = $contact->error; } } - Header("Location: ".$redirection); - exit; + $resultfacture = $facture->create($user); + if ($resultfacture <= 0) { + $contact->error = $facture->error; + $contact->errors = $facture->errors; + $error++; + } else { + $db->commit(); + $facture->add_object_linked($contact->element, $contact->id); + } + } + + if (!$error) { + // Add line to draft invoice + $vattouse = get_default_tva($mysoc, $thirdparty, $productforinvoicerow->id); + $result = $facture->addline($langs->trans("BoothLocationFee", $conforbooth->label, dol_print_date($conforbooth->datep, '%d/%m/%y %H:%M:%S'), dol_print_date($conforbooth->datep2, '%d/%m/%y %H:%M:%S')), floatval($project->price_booth), 1, $vattouse, 0, 0, $productforinvoicerow->id, 0, dol_now(), '', 0, 0, '', 'HT', 0, 1); + if ($result <= 0) { + $contact->error = $facture->error; + $contact->errors = $facture->errors; + $error++; + } + if (!$error) { + $valid = true; + $sourcetouse = 'boothlocation'; + $reftouse = $facture->id; + $redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?source='.$sourcetouse.'&ref='.$reftouse.'&booth='.$conforbooth->id; + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { + $redirection .= '&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $sourcetouse . $reftouse, 2); // Use the source in the hash to avoid duplicates if the references are identical + } else { + $redirection .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; + } + } + Header("Location: ".$redirection); + exit; + } + } + } else { + // If no price has been set for the booth, we confirm it as suggested and we update + $conforbooth->status = CONFERENCEORBOOTH::STATUS_SUGGESTED; + $conforbooth->update($user); + // Sending mail + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); + // Load traductions files required by page + $outputlangs->loadLangs(array("main", "members")); + // Get email content from template + $arraydefaultmessage = null; + + $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; + if (!empty($labeltouse)) { + $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); + } + + if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); + + $sendto = $thirdparty->email; + $from = $conf->global->MAILING_EMAIL_FROM; + $urlback = $_SERVER["REQUEST_URI"]; + + $ishtml = dol_textishtml($texttosend); // May contain urls + + $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); + + $result = $mailfile->sendfile(); + if ($result) { + dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); + } else { + dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); } } - } else { - // If no price has been set for the booth, we confirm it as suggested and we update - $conforbooth->status = CONFERENCEORBOOTH::STATUS_SUGGESTED; - $conforbooth->update($user); - // Sending mail - require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; - $formmail = new FormMail($db); - // Set output language - $outputlangs = new Translate('', $conf); - $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); - // Load traductions files required by page - $outputlangs->loadLangs(array("main", "members")); - // Get email content from template - $arraydefaultmessage = null; - - $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; - if (!empty($labeltouse)) { - $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); - } - - if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { - $subject = $arraydefaultmessage->topic; - $msg = $arraydefaultmessage->content; - } - - $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); - complete_substitutions_array($substitutionarray, $outputlangs, $object); - - $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); - $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); - - $sendto = $thirdparty->email; - $from = $conf->global->MAILING_EMAIL_FROM; - $urlback = $_SERVER["REQUEST_URI"]; - - $ishtml = dol_textishtml($texttosend); // May contain urls - - $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); - - $result = $mailfile->sendfile(); - if ($result) { - dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); - } else { - dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); - } } - //} } } } diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index 21cbe7d77bd..92c53795004 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -374,11 +374,11 @@ if (empty($reshook) && $action == 'add') { $errmsg .= $conforbooth->error; } else { // Adding the contact to the project - /*$resultaddcontact = $conforbooth->add_contact($contact); + $resultaddcontact = $conforbooth->add_contact($contact->id, 'SPEAKER'); if ($resultaddcontact<0) { $error++; $errmsg .= $conforbooth->error; - } else {*/ + } else { $conforbooth->status = CONFERENCEORBOOTH::STATUS_SUGGESTED; $conforbooth->update($user); @@ -395,14 +395,14 @@ if (empty($reshook) && $action == 'add') { $arraydefaultmessage = null; $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; - if (!empty($labeltouse)) { - $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); - } + if (!empty($labeltouse)) { + $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); + } - if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { - $subject = $arraydefaultmessage->topic; - $msg = $arraydefaultmessage->content; - } + if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); complete_substitutions_array($substitutionarray, $outputlangs, $object); @@ -419,12 +419,12 @@ if (empty($reshook) && $action == 'add') { $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); $result = $mailfile->sendfile(); - if ($result) { - dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); - } else { - dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); + if ($result) { + dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); + } else { + dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); + } } - //} } } } From 2f7dd4e8070bbc3cb877c0559cba3875cd747659 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Thu, 6 May 2021 14:53:23 +0200 Subject: [PATCH 0040/1497] wip vote page --- htdocs/langs/en_US/eventorganization.lang | 4 +- htdocs/public/project/suggestbooth.php | 2 +- htdocs/public/project/suggestconference.php | 2 +- htdocs/public/project/viewandvote.php | 216 ++++++++++++++++++++ 4 files changed, 221 insertions(+), 3 deletions(-) diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 1d7b16c17f6..1940c9674c1 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -99,7 +99,9 @@ EvntOrgCancelled = Cancelled SuggestForm = Suggestion page RegisterPage = Page for conferences or booth EvntOrgRegistrationWelcomeMessage = Welcome on the conference or booth suggestion page. -EvntOrgRegistrationHelpMessage = Here, you can suggest a new conference or a new booth for the project +EvntOrgRegistrationConfHelpMessage = Here, you can suggest a new conference for the project +EvntOrgRegistrationBoothHelpMessage = Here, you can suggest a new booth for the project +EvntOrgVoteHelpMessage = Here, you can view and vote for the suggested events for the project SuggestConference = Suggest a new conference SuggestBooth = Suggest a booth ViewAndVote = View and vote for suggested events diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index bb03c0d3782..ecaf524c034 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -526,7 +526,7 @@ print '
'; // Welcome message $text = ''.$langs->trans("EvntOrgRegistrationWelcomeMessage").'
'; -$text .= ''.$langs->trans("EvntOrgRegistrationHelpMessage").' '.$id.'.

'."\n"; +$text .= ''.$langs->trans("EvntOrgRegistrationBoothHelpMessage").' '.$id.'.

'."\n"; $text .= ''.$project->note_public.''."\n";; print $text; print '
'; diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index 92c53795004..53dc9581d9a 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -460,7 +460,7 @@ print '
'; // Welcome message $text = ''.$langs->trans("EvntOrgRegistrationWelcomeMessage").'
'; -$text .= ''.$langs->trans("EvntOrgRegistrationHelpMessage").' '.$id.'.

'."\n"; +$text .= ''.$langs->trans("EvntOrgRegistrationConfHelpMessage").' '.$id.'.

'."\n"; $text .= ''.$project->note_public.''."\n";; print $text; print '
'; diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php index b3d9bbc7f37..fe7d4d2ed59 100644 --- a/htdocs/public/project/viewandvote.php +++ b/htdocs/public/project/viewandvote.php @@ -1 +1,217 @@ + * Copyright (C) 2006-2017 Laurent Destailleur + * Copyright (C) 2009-2012 Regis Houssin + * Copyright (C) 2018 Juanjo Menent + * Copyright (C) 2018-2019 Thibault FOUCART + * Copyright (C) 2021 Waël Almoman + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * For Paypal test: https://developer.paypal.com/ + * For Paybox test: ??? + * For Stripe test: Use credit card 4242424242424242 .More example on https://stripe.com/docs/testing + * + * Variants: + * - When option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION is on, we use the new PaymentIntent API + * - When option STRIPE_USE_NEW_CHECKOUT is on, we use the new checkout API + * - If no option set, we use old APIS (charge) + */ + +/** + * \file htdocs/public/payment/newpayment.php + * \ingroup core + * \brief File to offer a way to make a payment for a particular Dolibarr object + */ + +if (!defined('NOLOGIN')) { + define("NOLOGIN", 1); // This means this output page does not require to be logged. +} +if (!defined('NOCSRFCHECK')) { + define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. +} +if (!defined('NOIPCHECK')) { + define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +} +if (!defined('NOBROWSERNOTIF')) { + define('NOBROWSERNOTIF', '1'); +} + +// For MultiCompany module. +// Do not use GETPOST here, function is not defined and get of entity must be done before including main.inc.php +$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : (!empty($_GET['e']) ? (int) $_GET['e'] : (!empty($_POST['e']) ? (int) $_POST['e'] : 1)))); +if (is_numeric($entity)) { + define("DOLENTITY", $entity); +} + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; +require_once DOL_DOCUMENT_ROOT.'/societe/class/societeaccount.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +// Hook to be used by external payment modules (ie Payzen, ...) +include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; +$hookmanager = new HookManager($db); +$hookmanager->initHooks(array('newpayment')); + +// For encryption +global $dolibarr_main_instance_unique_id; + +// Load translation files +$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", "paybox", "paypal", "stripe")); // File with generic data + +// Security check +// No check on module enabled. Done later according to $validpaymentmethod + +$action = GETPOST('action', 'aZ09'); +$id = GETPOST('id'); +$securekeyreceived = GETPOST("securekey"); +$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); + +if ($securekeytocompare != $securekeyreceived) { + print $langs->trans('MissingOrBadSecureKey'); + exit; +} + +// Define $urlwithroot +//$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); +//$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file +$urlwithroot = DOL_MAIN_URL_ROOT; // This is to use same domain name than current. For Paypal payment, we can use internal URL like localhost. + +$project = new Project($db); +$resultproject = $project->fetch($id); +if ($resultproject < 0) { + $error++; + $errmsg .= $project->error; +} + +/* + * Actions + */ + +$listOfEvents = 'oui'; + + + +/* + * View + */ + +$head = ''; +if (!empty($conf->global->ONLINE_PAYMENT_CSS_URL)) { + $head = ''."\n"; +} + +$conf->dol_hide_topmenu = 1; +$conf->dol_hide_leftmenu = 1; + +$replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
' : '').'
'; +llxHeader($head, $langs->trans("SuggestForm"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea); + +print ''."\n"; +print '
'."\n"; +print '
'."\n"; +print ''."\n"; +print ''."\n"; +print ''."\n"; +//print ''."\n"; +print ''."\n"; +print ''."\n"; +print ''; +print ''; +print "\n"; + + +// Show logo (search order: logo defined by PAYMENT_LOGO_suffix, then PAYMENT_LOGO, then small company logo, large company logo, theme logo, common logo) +// Define logo and logosmall +$logosmall = $mysoc->logo_small; +$logo = $mysoc->logo; +$paramlogo = 'ONLINE_PAYMENT_LOGO_'.$suffix; +if (!empty($conf->global->$paramlogo)) { + $logosmall = $conf->global->$paramlogo; +} elseif (!empty($conf->global->ONLINE_PAYMENT_LOGO)) { + $logosmall = $conf->global->ONLINE_PAYMENT_LOGO; +} +//print ''."\n"; +// Define urllogo +$urllogo = ''; +$urllogofull = ''; +if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); + $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); +} elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); + $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); +} + +// Output html code for logo +if ($urllogo) { + print '
'; + print '
'; + print ''; + print '
'; + if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { + print ''; + } + print '
'; +} + +print ''."\n"; + +$text = ''."\n"; +$text .= ''."\n"; +$text .= ''."\n";; + +print $text; + +print $listOfEvents; + +// Output payment summary form +print ''."\n"; + +print '

'.$langs->trans("EvntOrgRegistrationWelcomeMessage").'
'.$langs->trans("EvntOrgVoteHelpMessage").' '.$id.'.

'.$project->note_public.'

'; + +$found = false; +$error = 0; +$var = false; + +$object = null; + +print "\n"; + + +// Show all action buttons +print '
'; + +print ''; + + + + +print '
'."\n"; + +print '
'."\n"; +print '
'."\n"; +print '
'; + + +htmlPrintOnlinePaymentFooter($mysoc, $langs, 1, $suffix, $object); + +llxFooter('', 'public'); + +$db->close(); From 295c63468b7ac1a22dac7db7dac89f4222a49b92 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Thu, 6 May 2021 16:32:39 +0200 Subject: [PATCH 0041/1497] wip vote page --- htdocs/langs/en_US/eventorganization.lang | 2 + htdocs/public/project/viewandvote.php | 79 ++++++++++++++++++++--- 2 files changed, 73 insertions(+), 8 deletions(-) diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 1940c9674c1..8f36876fddc 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -102,6 +102,8 @@ EvntOrgRegistrationWelcomeMessage = Welcome on the conference or booth suggestio EvntOrgRegistrationConfHelpMessage = Here, you can suggest a new conference for the project EvntOrgRegistrationBoothHelpMessage = Here, you can suggest a new booth for the project EvntOrgVoteHelpMessage = Here, you can view and vote for the suggested events for the project +ListOfSuggestedConferences = List of suggested conferences +ListOfSuggestedBooths = List of suggested booths SuggestConference = Suggest a new conference SuggestBooth = Suggest a booth ViewAndVote = View and vote for suggested events diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php index fe7d4d2ed59..89cdca7591b 100644 --- a/htdocs/public/project/viewandvote.php +++ b/htdocs/public/project/viewandvote.php @@ -63,6 +63,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societeaccount.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php'; // Hook to be used by external payment modules (ie Payzen, ...) include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; $hookmanager = new HookManager($db); @@ -102,10 +103,62 @@ if ($resultproject < 0) { /* * Actions */ +$tmpthirdparty = new Societe($db); -$listOfEvents = 'oui'; +$listOfConferences = $listOfBooths = ''.$langs->trans('Label').' + '.$langs->trans('Type').' + '.$langs->trans('DateStart').' + '.$langs->trans('DateEnd').' + '.$langs->trans('Thirdparty').' + '.$langs->trans('Note').''; +// For conferences +$sql = "SELECT a.id, a.fk_action, a.datep, a.datep2, a.label, a.fk_soc, a.note, ca.libelle + FROM ".MAIN_DB_PREFIX."actioncomm as a + INNER JOIN ".MAIN_DB_PREFIX."c_actioncomm as ca ON (a.fk_action=ca.id) + WHERE ca.module='conference@eventorganization' + AND a.status<2"; +$result = $db->query($sql); + +$i = 0; +while ($i < $db->num_rows($result)) { + $obj = $db->fetch_object($result); + + $resultthirdparty = $tmpthirdparty->fetch($obj->fk_soc); + if ($resultthirdparty) { + $thirdpartyname = $tmpthirdparty->name; + } else { + $thirdpartyname = ''; + } + + $listOfConferences .= ''.$obj->label.''.$obj->libelle.''.$obj->datep.''.$obj->datep2.''.$thirdpartyname.''.$obj->note.''; + $listOfConferences .= ''; + $i++; +} + +// For booths +$sql = "SELECT a.id, a.fk_action, a.datep, a.datep2, a.label, a.fk_soc, a.note, ca.libelle + FROM ".MAIN_DB_PREFIX."actioncomm as a + INNER JOIN ".MAIN_DB_PREFIX."c_actioncomm as ca ON (a.fk_action=ca.id) + WHERE ca.module='booth@eventorganization' + AND a.status<2"; +$result = $db->query($sql); +$i = 0; +while ($i < $db->num_rows($result)) { + $obj = $db->fetch_object($result); + + $resultthirdparty = $tmpthirdparty->fetch($obj->fk_soc); + if ($resultthirdparty) { + $thirdpartyname = $tmpthirdparty->name; + } else { + $thirdpartyname = ''; + } + + $listOfBooths .= ''.$obj->label.''.$obj->libelle.''.$obj->datep.''.$obj->datep2.''.$thirdpartyname.''.$obj->note.''; + $listOfBooths .= ''; + $i++; +} /* * View @@ -170,16 +223,26 @@ if ($urllogo) { } print '
'; } - -print ''."\n"; - +print '
'."\n"; $text = ''."\n"; -$text .= ''."\n"; +$text .= ''."\n"; $text .= ''."\n";; - print $text; +print '

'.$langs->trans("EvntOrgRegistrationWelcomeMessage").'
'.$langs->trans("EvntOrgVoteHelpMessage").' '.$id.'.

'.$langs->trans("EvntOrgVoteHelpMessage").' : "'.$project->title.'".

'.$project->note_public.'

'."\n"; -print $listOfEvents; +print dol_get_fiche_head(''); + +print ''."\n"; +print ''; +print $listOfConferences.'
'; +print '
'.$langs->trans("ListOfSuggestedConferences").'
'."\n"; + + +print ''."\n"; +print ''; +print $listOfBooths.'
'; +print '
'.$langs->trans("ListOfSuggestedBooths").'
'."\n"; +print dol_get_fiche_end(); // Output payment summary form print ''; @@ -196,7 +259,7 @@ print "\n"; // Show all action buttons print '
'; -print ''; +//print ''; From 166e15633b2d6e5ac6a0b8f2521bfedd01d6c12c Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Thu, 6 May 2021 17:30:11 +0200 Subject: [PATCH 0042/1497] factorisation --- htdocs/public/project/viewandvote.php | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php index 89cdca7591b..7b6f8776d3a 100644 --- a/htdocs/public/project/viewandvote.php +++ b/htdocs/public/project/viewandvote.php @@ -110,51 +110,44 @@ $listOfConferences = $listOfBooths = ''.$langs->trans('Label').' '.$langs->trans('DateStart').' '.$langs->trans('DateEnd').' '.$langs->trans('Thirdparty').' - '.$langs->trans('Note').''; + '.$langs->trans('Note').''; - -// For conferences $sql = "SELECT a.id, a.fk_action, a.datep, a.datep2, a.label, a.fk_soc, a.note, ca.libelle FROM ".MAIN_DB_PREFIX."actioncomm as a INNER JOIN ".MAIN_DB_PREFIX."c_actioncomm as ca ON (a.fk_action=ca.id) - WHERE ca.module='conference@eventorganization' - AND a.status<2"; -$result = $db->query($sql); + WHERE a.status<2"; +$sqlforconf = $sql." AND ca.module='conference@eventorganization'"; +$sqlforbooth = $sql." AND ca.module='booth@eventorganization'"; + + +// For conferences +$result = $db->query($sqlforconf); $i = 0; while ($i < $db->num_rows($result)) { $obj = $db->fetch_object($result); - $resultthirdparty = $tmpthirdparty->fetch($obj->fk_soc); if ($resultthirdparty) { $thirdpartyname = $tmpthirdparty->name; } else { $thirdpartyname = ''; } - $listOfConferences .= ''.$obj->label.''.$obj->libelle.''.$obj->datep.''.$obj->datep2.''.$thirdpartyname.''.$obj->note.''; $listOfConferences .= ''; $i++; } // For booths -$sql = "SELECT a.id, a.fk_action, a.datep, a.datep2, a.label, a.fk_soc, a.note, ca.libelle - FROM ".MAIN_DB_PREFIX."actioncomm as a - INNER JOIN ".MAIN_DB_PREFIX."c_actioncomm as ca ON (a.fk_action=ca.id) - WHERE ca.module='booth@eventorganization' - AND a.status<2"; -$result = $db->query($sql); +$result = $db->query($sqlforbooth); $i = 0; while ($i < $db->num_rows($result)) { $obj = $db->fetch_object($result); - $resultthirdparty = $tmpthirdparty->fetch($obj->fk_soc); if ($resultthirdparty) { $thirdpartyname = $tmpthirdparty->name; } else { $thirdpartyname = ''; } - $listOfBooths .= ''.$obj->label.''.$obj->libelle.''.$obj->datep.''.$obj->datep2.''.$thirdpartyname.''.$obj->note.''; $listOfBooths .= ''; $i++; From 27cffbddf368ec8c47c0133dfdf5560cdccc8d19 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Fri, 7 May 2021 12:21:15 +0200 Subject: [PATCH 0043/1497] vote page ok --- htdocs/langs/en_US/eventorganization.lang | 12 ++++- htdocs/public/payment/paymentok.php | 1 - htdocs/public/project/viewandvote.php | 61 +++++++++++++++++++++-- 3 files changed, 67 insertions(+), 7 deletions(-) diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 8f36876fddc..97293f3cbb0 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -98,10 +98,8 @@ EvntOrgCancelled = Cancelled # SuggestForm = Suggestion page RegisterPage = Page for conferences or booth -EvntOrgRegistrationWelcomeMessage = Welcome on the conference or booth suggestion page. EvntOrgRegistrationConfHelpMessage = Here, you can suggest a new conference for the project EvntOrgRegistrationBoothHelpMessage = Here, you can suggest a new booth for the project -EvntOrgVoteHelpMessage = Here, you can view and vote for the suggested events for the project ListOfSuggestedConferences = List of suggested conferences ListOfSuggestedBooths = List of suggested booths SuggestConference = Suggest a new conference @@ -114,6 +112,16 @@ EvntOrgDuration = This conference starts on %s and ends on %s. ConferenceAttendeeFee = Conference attendee fee for the event : '%s' occurring from %s to %s. BoothLocationFee = Booth location for the event : '%s' occurring from %s to %s EventType = Event type + +# +# Vote page +# +EvntOrgRegistrationWelcomeMessage = Welcome on the conference or booth suggestion page. +EvntOrgVoteHelpMessage = Here, you can view and vote for the suggested events for the project +VoteOk = Your vote has been accepted. +AlreadyVoted = You have already voted for this event. +VoteError = An error has occurred during the vote, please try again. + # # SubscriptionOk page # diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index bf140bdd600..5cbd3da966b 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -1068,7 +1068,6 @@ if ($ispaymentok) { $ispostactionok = -1; } } elseif (array_key_exists('BOO', $tmptag) && $tmptag['BOO'] > 0) { - // @todo BOOTH CASE (to copy and adapt from above) // Record payment include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $object = new Facture($db); diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php index 7b6f8776d3a..355156d73cb 100644 --- a/htdocs/public/project/viewandvote.php +++ b/htdocs/public/project/viewandvote.php @@ -70,7 +70,7 @@ $hookmanager = new HookManager($db); $hookmanager->initHooks(array('newpayment')); // For encryption -global $dolibarr_main_instance_unique_id; +global $dolibarr_main_instance_unique_id, $dolibarr_main_url_root; // Load translation files $langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", "paybox", "paypal", "stripe")); // File with generic data @@ -88,6 +88,14 @@ if ($securekeytocompare != $securekeyreceived) { exit; } +if (GETPOST("votestatus")=="ok") { + setEventMessage($langs->trans("VoteOk"), 'mesgs'); +} else if (GETPOST("votestatus")=="ko") { + setEventMessage($langs->trans("AlreadyVoted"), 'warnings'); +} else if (GETPOST("votestatus")=="err") { + setEventMessage($langs->trans("VoteError"), 'warnings'); +} + // Define $urlwithroot //$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); //$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file @@ -120,7 +128,6 @@ $sql = "SELECT a.id, a.fk_action, a.datep, a.datep2, a.label, a.fk_soc, a.note, $sqlforconf = $sql." AND ca.module='conference@eventorganization'"; $sqlforbooth = $sql." AND ca.module='booth@eventorganization'"; - // For conferences $result = $db->query($sqlforconf); $i = 0; @@ -133,7 +140,7 @@ while ($i < $db->num_rows($result)) { $thirdpartyname = ''; } $listOfConferences .= ''.$obj->label.''.$obj->libelle.''.$obj->datep.''.$obj->datep2.''.$thirdpartyname.''.$obj->note.''; - $listOfConferences .= ''; + $listOfConferences .= ''; $i++; } @@ -149,10 +156,56 @@ while ($i < $db->num_rows($result)) { $thirdpartyname = ''; } $listOfBooths .= ''.$obj->label.''.$obj->libelle.''.$obj->datep.''.$obj->datep2.''.$thirdpartyname.''.$obj->note.''; - $listOfBooths .= ''; + $listOfBooths .= ''; $i++; } +// Get vote result +$idvote = GETPOST("vote"); +$hashedvote = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'vote'.$idvote); + +if (strlen($idvote)) { + if ($_COOKIE['VOTE_SUGGESTED_EVENTS_'.$hashedvote]==1) { + // Has already voted + $votestatus = 'ko'; + } else { + // Has not already voted + $conforbooth = new ActionComm($db); + $resultconforbooth = $conforbooth->fetch($idvote); + if ($resultconforbooth<=0) { + $error++; + $errmsg .= $conforbooth->error; + } else { + // Cookie expiration date : start of event, or 30 days if not specified + $startdate = $conforbooth->datep; + if (strlen($startdate)) { + $timeleftbeforestartofevent = $startdate; + } else { + // Cookie duration by default + $timeleftbeforestartofevent = time()+86400*30; + } + + // Process to vote + $res = setcookie('VOTE_SUGGESTED_EVENTS_'.$hashedvote, 1, 0); + if ($res) { + $conforbooth->num_vote++; + $resupdate = $conforbooth->update($user); + if ($resupdate) { + $votestatus = 'ok'; + } else { + //Error during update + $votestatus = 'err'; + $res = setcookie('VOTE_SUGGESTED_EVENTS_'.$hashedvote, 0, 0); + } + } else { + $votestatus = 'err'; + } + } + } + header("Refresh:0;url=".dol_buildpath('/public/project/viewandvote.php?votestatus='.$votestatus.'&id='.$id.'&securekey=', 1).$securekeyreceived); +} + + /* * View */ From 5bb100de29cb305728f057584c33587527b75774 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Fri, 7 May 2021 13:02:34 +0200 Subject: [PATCH 0044/1497] conforbooth class required in paymentok to confirm the booth --- htdocs/public/payment/paymentok.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 5cbd3da966b..09ffc2318b0 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -52,6 +52,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php'; +require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; if (!empty($conf->paypal->enabled)) { require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php'; From 2169a106fa040afec242b1786999b6c012c8c642 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Fri, 7 May 2021 14:34:29 +0200 Subject: [PATCH 0045/1497] note is now saved in database --- htdocs/eventorganization/class/conferenceorbooth.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index 0df30ac61db..6227fb668ec 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -212,6 +212,7 @@ class ConferenceOrBooth extends ActionComm $this->type_id=$this->fk_action; $this->socid=$this->fk_soc; $this->datef=$this->datep2; + $this->note_private=$this->note; } /** From 6111f4394660511ec3c554e110f00b271046a2f0 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Fri, 7 May 2021 14:49:00 +0200 Subject: [PATCH 0046/1497] security fix, id was encoded where it should not be encoded --- htdocs/langs/en_US/eventorganization.lang | 1 + htdocs/public/project/suggestbooth.php | 3 +-- htdocs/public/project/suggestconference.php | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 97293f3cbb0..97090c343cf 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -98,6 +98,7 @@ EvntOrgCancelled = Cancelled # SuggestForm = Suggestion page RegisterPage = Page for conferences or booth +EvntOrgRegistrationHelpMessage = Here, you can vote for an event, or suggest a new conference or booth for the project EvntOrgRegistrationConfHelpMessage = Here, you can suggest a new conference for the project EvntOrgRegistrationBoothHelpMessage = Here, you can suggest a new booth for the project ListOfSuggestedConferences = List of suggested conferences diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index ecaf524c034..71663a7f15c 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -496,9 +496,8 @@ if (empty($reshook) && $action == 'add') { } if (!$error) { $db->commit(); - $encodedid = dol_encode($id, $dolibarr_main_instance_unique_id); $securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); - $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$encodedid.'&securekey='.$securekeyurl; + $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$id.'&securekey='.$securekeyurl; Header("Location: ".$redirection); exit; } else { diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index 53dc9581d9a..844641fc4cf 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -430,9 +430,8 @@ if (empty($reshook) && $action == 'add') { } if (!$error) { $db->commit(); - $encodedid = dol_encode($id, $dolibarr_main_instance_unique_id); $securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); - $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$encodedid.'&securekey='.$securekeyurl; + $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$id.'&securekey='.$securekeyurl; Header("Location: ".$redirection); exit; } else { From dbde0f0b02e96d0db4fd954f762cb7086f6df693 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Fri, 7 May 2021 15:05:37 +0200 Subject: [PATCH 0047/1497] fix on status change when a booth is paid --- htdocs/public/payment/paymentok.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 09ffc2318b0..390ce6ef555 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -1176,7 +1176,7 @@ if ($ispaymentok) { $error++; setEventMessages(null, $booth->errors, "errors"); } else { - $booth->setStatut(CONFERENCEORBOOTH::STATUS_SUGGESTED); + $booth->status = CONFERENCEORBOOTH::STATUS_SUGGESTED; $resultboothupdate = $booth->update($user); if ($resultboothupdate<0) { // Finding the thirdparty by getting the invoice From dfd3742d91370735775864520aa53c8428024610 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Fri, 7 May 2021 15:33:00 +0200 Subject: [PATCH 0048/1497] fix on label on payment page --- htdocs/public/payment/newpayment.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 9cadab8deb4..67323190e44 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1810,9 +1810,6 @@ if ($source == 'conferencesubscription') { // Object $text = ''.$langs->trans("PaymentConferenceAttendee").''; - if (GETPOST('desc', 'alpha')) { - $text = ''.$langs->trans(GETPOST('desc', 'alpha')).''; - } print ''.$langs->trans("Designation"); print ''.$text; print ''; @@ -1899,9 +1896,6 @@ if ($source == 'boothlocation') { // Object $text = ''.$langs->trans("PaymentBoothLocation").''; - if (GETPOST('desc', 'alpha')) { - $text = ''.$langs->trans(GETPOST('desc', 'alpha')).''; - } print ''.$langs->trans("Designation"); print ''.$text; print ''; From d344ce5e08d4392cbf5cb7006d4485835ebafb8c Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Fri, 7 May 2021 15:59:25 +0200 Subject: [PATCH 0049/1497] clean viewandvote page --- htdocs/public/project/viewandvote.php | 28 --------------------------- 1 file changed, 28 deletions(-) diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php index 355156d73cb..f167fcf1717 100644 --- a/htdocs/public/project/viewandvote.php +++ b/htdocs/public/project/viewandvote.php @@ -18,15 +18,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * - * For Paypal test: https://developer.paypal.com/ - * For Paybox test: ??? - * For Stripe test: Use credit card 4242424242424242 .More example on https://stripe.com/docs/testing - * - * Variants: - * - When option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION is on, we use the new PaymentIntent API - * - When option STRIPE_USE_NEW_CHECKOUT is on, we use the new checkout API - * - If no option set, we use old APIS (charge) */ /** @@ -288,7 +279,6 @@ print ''."\n"; print ''; print $listOfBooths.'
'; print '
'.$langs->trans("ListOfSuggestedBooths").'
'."\n"; -print dol_get_fiche_end(); // Output payment summary form print ''; @@ -301,24 +291,6 @@ $object = null; print "\n"; - -// Show all action buttons -print '
'; - -//print ''; - - - - -print ''."\n"; - -print ''."\n"; - -print ''."\n"; -print '
'."\n"; -print '
'; - - htmlPrintOnlinePaymentFooter($mysoc, $langs, 1, $suffix, $object); llxFooter('', 'public'); From c48234409b30b811b341fe254cd370e7071d5923 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Fri, 7 May 2021 16:15:13 +0200 Subject: [PATCH 0050/1497] added copyright --- htdocs/langs/en_US/eventorganization.lang | 1 + htdocs/public/eventorganization/attendee_subscription.php | 8 +------- htdocs/public/eventorganization/subscriptionok.php | 1 + htdocs/public/payment/newpayment.php | 1 + htdocs/public/payment/paymentok.php | 1 + htdocs/public/project/index.php | 7 +------ htdocs/public/project/suggestbooth.php | 8 +------- htdocs/public/project/suggestconference.php | 8 +------- htdocs/public/project/viewandvote.php | 7 +------ 9 files changed, 9 insertions(+), 33 deletions(-) diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 97090c343cf..1a663c0b713 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -1,4 +1,5 @@ # Copyright (C) 2021 Florian Henry +# Copyright (C) 2021 Dorian Vabre # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/htdocs/public/eventorganization/attendee_subscription.php b/htdocs/public/eventorganization/attendee_subscription.php index 37972628eed..82e82d58129 100644 --- a/htdocs/public/eventorganization/attendee_subscription.php +++ b/htdocs/public/eventorganization/attendee_subscription.php @@ -1,11 +1,5 @@ - * Copyright (C) 2001-2002 Jean-Louis Bergamo - * Copyright (C) 2006-2013 Laurent Destailleur - * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2012 J. Fernando Lagrange - * Copyright (C) 2018-2019 Frédéric France - * Copyright (C) 2018 Alexandre Spangaro +/* Copyright (C) 2021 Dorian Vabre * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/public/eventorganization/subscriptionok.php b/htdocs/public/eventorganization/subscriptionok.php index 02fb456f7d2..8586535f5ab 100644 --- a/htdocs/public/eventorganization/subscriptionok.php +++ b/htdocs/public/eventorganization/subscriptionok.php @@ -3,6 +3,7 @@ * Copyright (C) 2006-2013 Laurent Destailleur * Copyright (C) 2012 Regis Houssin * Copyright (C) 2021 Waël Almoman + * Copyright (C) 2021 Dorian Vabre * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 67323190e44..9de10b44cac 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -5,6 +5,7 @@ * Copyright (C) 2018 Juanjo Menent * Copyright (C) 2018-2019 Thibault FOUCART * Copyright (C) 2021 Waël Almoman + * Copyright (C) 2021 Dorian Vabre * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 390ce6ef555..8ea5d6a2587 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -4,6 +4,7 @@ * Copyright (C) 2012 Regis Houssin * Copyright (C) 2021 Waël Almoman * Copyright (C) 2021 Maxime Demarest + * Copyright (C) 2021 Dorian Vabre * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index b05f2b1fc6f..1231617768d 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -1,10 +1,5 @@ - * Copyright (C) 2006-2017 Laurent Destailleur - * Copyright (C) 2009-2012 Regis Houssin - * Copyright (C) 2018 Juanjo Menent - * Copyright (C) 2018-2019 Thibault FOUCART - * Copyright (C) 2021 Waël Almoman +/* Copyright (C) 2021 Dorian Vabre * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index 71663a7f15c..90fb7046bab 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -1,11 +1,5 @@ - * Copyright (C) 2001-2002 Jean-Louis Bergamo - * Copyright (C) 2006-2013 Laurent Destailleur - * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2012 J. Fernando Lagrange - * Copyright (C) 2018-2019 Frédéric France - * Copyright (C) 2018 Alexandre Spangaro +/* Copyright (C) 2021 Dorian Vabre * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index 844641fc4cf..c4cb3e298ec 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -1,11 +1,5 @@ - * Copyright (C) 2001-2002 Jean-Louis Bergamo - * Copyright (C) 2006-2013 Laurent Destailleur - * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2012 J. Fernando Lagrange - * Copyright (C) 2018-2019 Frédéric France - * Copyright (C) 2018 Alexandre Spangaro +/* Copyright (C) 2021 Dorian Vabre * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php index f167fcf1717..8ade643b8ce 100644 --- a/htdocs/public/project/viewandvote.php +++ b/htdocs/public/project/viewandvote.php @@ -1,10 +1,5 @@ - * Copyright (C) 2006-2017 Laurent Destailleur - * Copyright (C) 2009-2012 Regis Houssin - * Copyright (C) 2018 Juanjo Menent - * Copyright (C) 2018-2019 Thibault FOUCART - * Copyright (C) 2021 Waël Almoman +/* Copyright (C) 2021 Dorian Vabre * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by From 05bbb3dbf6dc5927946f68a210920e6e1f1333f5 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Fri, 7 May 2021 16:39:03 +0200 Subject: [PATCH 0051/1497] improved welcome msg on suggestbooth/conf pages --- htdocs/langs/en_US/eventorganization.lang | 2 ++ htdocs/public/project/suggestbooth.php | 2 +- htdocs/public/project/suggestconference.php | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 1a663c0b713..f990779b305 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -119,6 +119,8 @@ EventType = Event type # Vote page # EvntOrgRegistrationWelcomeMessage = Welcome on the conference or booth suggestion page. +EvntOrgRegistrationConfWelcomeMessage = Welcome on the conference suggestion page. +EvntOrgRegistrationBoothWelcomeMessage = Welcome on the booth suggestion page. EvntOrgVoteHelpMessage = Here, you can view and vote for the suggested events for the project VoteOk = Your vote has been accepted. AlreadyVoted = You have already voted for this event. diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index 90fb7046bab..32ca05d1b09 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -518,7 +518,7 @@ print '
'; print '
'; // Welcome message -$text = ''.$langs->trans("EvntOrgRegistrationWelcomeMessage").'
'; +$text = ''.$langs->trans("EvntOrgRegistrationBoothWelcomeMessage").'
'; $text .= ''.$langs->trans("EvntOrgRegistrationBoothHelpMessage").' '.$id.'.

'."\n"; $text .= ''.$project->note_public.''."\n";; print $text; diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index c4cb3e298ec..485d18ee2c6 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -452,7 +452,7 @@ print '
'; print '
'; // Welcome message -$text = ''.$langs->trans("EvntOrgRegistrationWelcomeMessage").'
'; +$text = ''.$langs->trans("EvntOrgRegistrationConfWelcomeMessage").'
'; $text .= ''.$langs->trans("EvntOrgRegistrationConfHelpMessage").' '.$id.'.

'."\n"; $text .= ''.$project->note_public.''."\n";; print $text; From 9ab12e24551ca712a1a6025ca3d78af540f99d14 Mon Sep 17 00:00:00 2001 From: Antonin MARCHAL Date: Fri, 7 May 2021 17:06:53 +0200 Subject: [PATCH 0052/1497] add (getNomUrl) --- htdocs/fourn/class/fournisseur.commande.class.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 331e211e5ac..3728771c8aa 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -765,7 +765,7 @@ class CommandeFournisseur extends CommonOrder */ public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $save_lastsearch_value = -1, $addlinktonotes = 0) { - global $langs, $conf, $user; + global $langs, $conf, $user, $hookmanager; $result = ''; @@ -774,7 +774,15 @@ class CommandeFournisseur extends CommonOrder if ($user->rights->fournisseur->commande->lire) { $label = ''.$langs->trans("SupplierOrder").''; if (isset($this->statut)) { - $label .= ' '.$this->getLibStatut(5); + $statusText = ' '.$this->getLibStatut(5); + $parameters = array('obj' => $this); + $reshook = $hookmanager->executeHooks('moreHtmlStatus', $parameters, $object); // Note that $action and $object may have been modified by hook + if (empty($reshook)) { + $statusText .= $hookmanager->resPrint; + } else { + $statusText = $hookmanager->resPrint; + } + $label .= $statusText; } if (!empty($this->ref)) { $label .= '
'.$langs->trans('Ref').': '.$this->ref; From c6d646f39e0ad1047493ef2960d4b3155770c3dc Mon Sep 17 00:00:00 2001 From: Antonin MARCHAL Date: Fri, 7 May 2021 17:08:36 +0200 Subject: [PATCH 0053/1497] add(prop)list --- htdocs/fourn/commande/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index d32e466444c..a294d2a4712 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -1283,6 +1283,7 @@ if ($resql) { $objectstatic->id = $obj->rowid; $objectstatic->ref = $obj->ref; + $objectstatic->socid = $obj->socid; $objectstatic->ref_supplier = $obj->ref_supplier; $objectstatic->total_ht = $obj->total_ht; $objectstatic->total_tva = $obj->total_tva; From a91d1b2e07d9262c9aeecf53f5777e9b90c6a891 Mon Sep 17 00:00:00 2001 From: Antonin MARCHAL Date: Fri, 7 May 2021 17:09:39 +0200 Subject: [PATCH 0054/1497] add(list) hook --- htdocs/fourn/commande/list.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index a294d2a4712..0aae47cd7fc 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -1537,7 +1537,15 @@ if ($resql) { } // Status if (!empty($arrayfields['cf.fk_statut']['checked'])) { - print ''.$objectstatic->LibStatut($obj->fk_statut, 5, $obj->billed).''; + $parameters = array('obj' => $obj); + $morehtmlstatus = $objectstatic->LibStatut($obj->fk_statut, 5, $obj->billed); + $reshook = $hookmanager->executeHooks('moreHtmlStatus', $parameters, $object); // Note that $action and $object may have been modified by hook + if (empty($reshook)) { + $morehtmlstatus .= $hookmanager->resPrint; + } else { + $morehtmlstatus = $hookmanager->resPrint; + } + print '' . $morehtmlstatus . ''; if (!$i) { $totalarray['nbfield']++; } From 058bef1a79d03f73c099854ebbff8c96a2029b11 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Fri, 7 May 2021 17:20:36 +0200 Subject: [PATCH 0055/1497] clean viewandvote page --- htdocs/public/project/viewandvote.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php index 8ade643b8ce..1f9b4d32dab 100644 --- a/htdocs/public/project/viewandvote.php +++ b/htdocs/public/project/viewandvote.php @@ -258,7 +258,7 @@ if ($urllogo) { print ''."\n"; $text = ''."\n"; $text .= ''."\n"; -$text .= ''."\n";; +$text .= ''."\n";; print $text; print '

'.$langs->trans("EvntOrgRegistrationWelcomeMessage").'
'.$langs->trans("EvntOrgVoteHelpMessage").' : "'.$project->title.'".

'.$project->note_public.'

'.$project->note_public.'
'."\n"; @@ -269,23 +269,15 @@ print ''.$langs->trans("ListOfSuggestedConferences").''; print $listOfConferences.'
'; print ''."\n"; +print '
'; print ''."\n"; print ''; print $listOfBooths.'
'; print '
'.$langs->trans("ListOfSuggestedBooths").'
'."\n"; -// Output payment summary form -print ''; - -$found = false; -$error = 0; -$var = false; - $object = null; -print "\n"; - htmlPrintOnlinePaymentFooter($mysoc, $langs, 1, $suffix, $object); llxFooter('', 'public'); From d86b393d6023868bedef93c4a76a9e05dce37426 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 10 May 2021 09:54:26 +0200 Subject: [PATCH 0056/1497] useless line removed --- htdocs/public/eventorganization/attendee_subscription.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/public/eventorganization/attendee_subscription.php b/htdocs/public/eventorganization/attendee_subscription.php index 82e82d58129..4fdde7c7181 100644 --- a/htdocs/public/eventorganization/attendee_subscription.php +++ b/htdocs/public/eventorganization/attendee_subscription.php @@ -425,8 +425,7 @@ if (empty($reshook) && $action == 'add') { } else { dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); } - - $encodedid = dol_encode($id, $dolibarr_main_instance_unique_id); + $securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$id.'&securekey='.$securekeyurl; Header("Location: ".$redirection); From 0dce9ee359746ca359566135e2bc04f7d773431c Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 10 May 2021 10:22:45 +0200 Subject: [PATCH 0057/1497] now using correct email templates after booth/conf suggestion --- htdocs/public/eventorganization/attendee_subscription.php | 2 +- htdocs/public/payment/newpayment.php | 1 - htdocs/public/project/suggestbooth.php | 2 +- htdocs/public/project/suggestconference.php | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/public/eventorganization/attendee_subscription.php b/htdocs/public/eventorganization/attendee_subscription.php index 4fdde7c7181..a81ac456353 100644 --- a/htdocs/public/eventorganization/attendee_subscription.php +++ b/htdocs/public/eventorganization/attendee_subscription.php @@ -425,7 +425,7 @@ if (empty($reshook) && $action == 'add') { } else { dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); } - + $securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$id.'&securekey='.$securekeyurl; Header("Location: ".$redirection); diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 9de10b44cac..574085ac623 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1954,7 +1954,6 @@ if ($source == 'boothlocation') { print ''."\n"; } - if (!$found && !$mesg) { $mesg = $langs->trans("ErrorBadParameters"); } diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index 32ca05d1b09..f510a5274f0 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -453,7 +453,7 @@ if (empty($reshook) && $action == 'add') { // Get email content from template $arraydefaultmessage = null; - $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; + $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH; if (!empty($labeltouse)) { $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); } diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index 485d18ee2c6..3eff5fad3a9 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -388,7 +388,7 @@ if (empty($reshook) && $action == 'add') { // Get email content from template $arraydefaultmessage = null; - $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; + $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF; if (!empty($labeltouse)) { $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); } From 0e62edfd42fc06056b1dfb355683151077eb251b Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 10 May 2021 12:47:09 +0200 Subject: [PATCH 0058/1497] fix error on fetching thirdparty when there is none --- htdocs/public/project/viewandvote.php | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php index 1f9b4d32dab..283d50eda8f 100644 --- a/htdocs/public/project/viewandvote.php +++ b/htdocs/public/project/viewandvote.php @@ -119,12 +119,17 @@ $result = $db->query($sqlforconf); $i = 0; while ($i < $db->num_rows($result)) { $obj = $db->fetch_object($result); - $resultthirdparty = $tmpthirdparty->fetch($obj->fk_soc); - if ($resultthirdparty) { - $thirdpartyname = $tmpthirdparty->name; + if (!empty($obj->fk_soc)) { + $resultthirdparty = $tmpthirdparty->fetch($obj->fk_soc); + if ($resultthirdparty) { + $thirdpartyname = $tmpthirdparty->name; + } else { + $thirdpartyname = ''; + } } else { $thirdpartyname = ''; } + $listOfConferences .= ''.$obj->label.''.$obj->libelle.''.$obj->datep.''.$obj->datep2.''.$thirdpartyname.''.$obj->note.''; $listOfConferences .= ''; $i++; @@ -135,12 +140,17 @@ $result = $db->query($sqlforbooth); $i = 0; while ($i < $db->num_rows($result)) { $obj = $db->fetch_object($result); - $resultthirdparty = $tmpthirdparty->fetch($obj->fk_soc); - if ($resultthirdparty) { - $thirdpartyname = $tmpthirdparty->name; + if (!empty($obj->fk_soc)) { + $resultthirdparty = $tmpthirdparty->fetch($obj->fk_soc); + if ($resultthirdparty) { + $thirdpartyname = $tmpthirdparty->name; + } else { + $thirdpartyname = ''; + } } else { $thirdpartyname = ''; } + $listOfBooths .= ''.$obj->label.''.$obj->libelle.''.$obj->datep.''.$obj->datep2.''.$thirdpartyname.''.$obj->note.''; $listOfBooths .= ''; $i++; From c5dc20b9dc611434037fe4f27fece9a7a7f5725b Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 10 May 2021 15:31:52 +0200 Subject: [PATCH 0059/1497] opti --- htdocs/public/project/viewandvote.php | 5 ++--- htdocs/societe/card.php | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php index 283d50eda8f..0f07e5e297e 100644 --- a/htdocs/public/project/viewandvote.php +++ b/htdocs/public/project/viewandvote.php @@ -180,18 +180,17 @@ if (strlen($idvote)) { // Cookie duration by default $timeleftbeforestartofevent = time()+86400*30; } - + // Process to vote - $res = setcookie('VOTE_SUGGESTED_EVENTS_'.$hashedvote, 1, 0); if ($res) { $conforbooth->num_vote++; $resupdate = $conforbooth->update($user); if ($resupdate) { $votestatus = 'ok'; + $res = setcookie('VOTE_SUGGESTED_EVENTS_'.$hashedvote, 1, 0); } else { //Error during update $votestatus = 'err'; - $res = setcookie('VOTE_SUGGESTED_EVENTS_'.$hashedvote, 0, 0); } } else { $votestatus = 'err'; diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 8102c5064f2..104f45de979 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2467,7 +2467,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; } - // Supplier code + // Su+pplier code if (((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) && $object->fournisseur) { print ''; print $langs->trans('SupplierCode').''; From ee4e8dd99f6992ee96d4f14e6a717f623a1ea45f Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 10 May 2021 15:37:25 +0200 Subject: [PATCH 0060/1497] cookies to session transition --- htdocs/public/project/viewandvote.php | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php index 0f07e5e297e..304f42d637b 100644 --- a/htdocs/public/project/viewandvote.php +++ b/htdocs/public/project/viewandvote.php @@ -74,6 +74,8 @@ if ($securekeytocompare != $securekeyreceived) { exit; } +$listofvotes = explode(',', $_SESSION["savevotes"]); + if (GETPOST("votestatus")=="ok") { setEventMessage($langs->trans("VoteOk"), 'mesgs'); } else if (GETPOST("votestatus")=="ko") { @@ -161,7 +163,7 @@ $idvote = GETPOST("vote"); $hashedvote = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'vote'.$idvote); if (strlen($idvote)) { - if ($_COOKIE['VOTE_SUGGESTED_EVENTS_'.$hashedvote]==1) { + if (in_array($hashedvote, $listofvotes)) { // Has already voted $votestatus = 'ko'; } else { @@ -172,22 +174,13 @@ if (strlen($idvote)) { $error++; $errmsg .= $conforbooth->error; } else { - // Cookie expiration date : start of event, or 30 days if not specified - $startdate = $conforbooth->datep; - if (strlen($startdate)) { - $timeleftbeforestartofevent = $startdate; - } else { - // Cookie duration by default - $timeleftbeforestartofevent = time()+86400*30; - } - // Process to vote if ($res) { $conforbooth->num_vote++; $resupdate = $conforbooth->update($user); if ($resupdate) { $votestatus = 'ok'; - $res = setcookie('VOTE_SUGGESTED_EVENTS_'.$hashedvote, 1, 0); + $_SESSION["savevotes"] = $hashedvote.','.(empty($_SESSION["savevotes"]) ? '' : $_SESSION["savevotes"]); // Save voter } else { //Error during update $votestatus = 'err'; From d71dc37a75f8d3f8dac486c130cd369c88879ef5 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 10 May 2021 15:39:39 +0200 Subject: [PATCH 0061/1497] fix --- htdocs/public/project/viewandvote.php | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php index 304f42d637b..333edd81755 100644 --- a/htdocs/public/project/viewandvote.php +++ b/htdocs/public/project/viewandvote.php @@ -175,17 +175,13 @@ if (strlen($idvote)) { $errmsg .= $conforbooth->error; } else { // Process to vote - if ($res) { - $conforbooth->num_vote++; - $resupdate = $conforbooth->update($user); - if ($resupdate) { - $votestatus = 'ok'; - $_SESSION["savevotes"] = $hashedvote.','.(empty($_SESSION["savevotes"]) ? '' : $_SESSION["savevotes"]); // Save voter - } else { - //Error during update - $votestatus = 'err'; - } + $conforbooth->num_vote++; + $resupdate = $conforbooth->update($user); + if ($resupdate) { + $votestatus = 'ok'; + $_SESSION["savevotes"] = $hashedvote.','.(empty($_SESSION["savevotes"]) ? '' : $_SESSION["savevotes"]); // Save voter } else { + //Error during update $votestatus = 'err'; } } From 7d0c3dcf6d64b61893c4d0158c2a285f14bd49bc Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 10 May 2021 15:50:29 +0200 Subject: [PATCH 0062/1497] transition done from cookies to session --- htdocs/public/project/viewandvote.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php index 333edd81755..0468a9c2e59 100644 --- a/htdocs/public/project/viewandvote.php +++ b/htdocs/public/project/viewandvote.php @@ -76,13 +76,6 @@ if ($securekeytocompare != $securekeyreceived) { $listofvotes = explode(',', $_SESSION["savevotes"]); -if (GETPOST("votestatus")=="ok") { - setEventMessage($langs->trans("VoteOk"), 'mesgs'); -} else if (GETPOST("votestatus")=="ko") { - setEventMessage($langs->trans("AlreadyVoted"), 'warnings'); -} else if (GETPOST("votestatus")=="err") { - setEventMessage($langs->trans("VoteError"), 'warnings'); -} // Define $urlwithroot //$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); @@ -186,7 +179,15 @@ if (strlen($idvote)) { } } } - header("Refresh:0;url=".dol_buildpath('/public/project/viewandvote.php?votestatus='.$votestatus.'&id='.$id.'&securekey=', 1).$securekeyreceived); + if ($votestatus=="ok") { + setEventMessage($langs->trans("VoteOk"), 'mesgs'); + } else if ($votestatus=="ko") { + setEventMessage($langs->trans("AlreadyVoted"), 'warnings'); + } else if ($votestatus=="err") { + setEventMessage($langs->trans("VoteError"), 'warnings'); + } + header("Refresh:0;url=".dol_buildpath('/public/project/viewandvote.php?id='.$id.'&securekey=', 1).$securekeyreceived); + exit; } From f6956d6a6272a14208f5b0d9da68f219f0b6751c Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 10 May 2021 15:58:54 +0200 Subject: [PATCH 0063/1497] using validate() function instead of settStatut(1) to validate an attendee --- htdocs/public/payment/paymentok.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 8ea5d6a2587..2e6cd630694 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -1006,7 +1006,7 @@ if ($ispaymentok) { if ($resultattendee < 0) { setEventMessages(null, $attendeetovalidate->errors, "errors"); } else { - $attendeetovalidate->setStatut(1); + $attendeetovalidate->validate($user); // Sending mail $thirdparty = new Societe($db); From bf25fd083404a84f90512e3f7a2342876f8dc96b Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 10 May 2021 16:04:13 +0200 Subject: [PATCH 0064/1497] confattendee merge OK to replace thirdparty --- .../class/conferenceorboothattendee.class.php | 17 +++++++++++++++++ htdocs/societe/card.php | 3 ++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index 6418d73580b..58bd38c35d8 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -1070,6 +1070,23 @@ class ConferenceOrBoothAttendee extends CommonObject return $error; } + + /** + * Function used to replace a thirdparty id with another one. + * + * @param DoliDB $db Database handler + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool + */ + public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) + { + $tables = array( + 'conferenceorboothattendee' + ); + + return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); + } } diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 104f45de979..20e8c06833d 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -270,7 +270,8 @@ if (empty($reshook)) { 'Product' => '/product/class/product.class.php', 'Project' => '/projet/class/project.class.php', 'Ticket' => '/ticket/class/ticket.class.php', - 'User' => '/user/class/user.class.php' + 'User' => '/user/class/user.class.php', + 'ConfOrBoothAttendee' => '/eventorganization/class/conferenceorboothattendee.class.php' ); //First, all core objects must update their tables From 48bbb500d3b98d1f10a29534477b5a136de5061a Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 10 May 2021 16:25:44 +0200 Subject: [PATCH 0065/1497] fix on replacing thirdparty in attendees when merging multiple thirdparties --- .../class/conferenceorboothattendee.class.php | 2 +- htdocs/societe/card.php | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index 58bd38c35d8..1cb24460523 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -1082,7 +1082,7 @@ class ConferenceOrBoothAttendee extends CommonObject public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) { $tables = array( - 'conferenceorboothattendee' + 'eventorganization_conferenceorboothattendee' ); return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 20e8c06833d..18cfdfa1f16 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -57,6 +57,10 @@ if (! empty($conf->accounting->enabled)) { if (! empty($conf->accounting->enabled)) { require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; } +if (! empty($conf->eventorganization->enabled)) { + require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php'; +} + $langs->loadLangs(array("companies", "commercial", "bills", "banks", "users")); if (!empty($conf->adherent->enabled)) { @@ -271,7 +275,7 @@ if (empty($reshook)) { 'Project' => '/projet/class/project.class.php', 'Ticket' => '/ticket/class/ticket.class.php', 'User' => '/user/class/user.class.php', - 'ConfOrBoothAttendee' => '/eventorganization/class/conferenceorboothattendee.class.php' + 'ConferenceOrBoothAttendee' => '/eventorganization/class/conferenceorboothattendee.class.php' ); //First, all core objects must update their tables From c85b75924fc205648e67eeadb95c726100c53900 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 10 May 2021 16:57:48 +0200 Subject: [PATCH 0066/1497] wip on adding a filter for the ics file + fix on class name --- htdocs/comm/action/class/actioncomm.class.php | 3 +++ htdocs/public/agenda/agendaexport.php | 3 +++ htdocs/public/project/suggestbooth.php | 2 +- htdocs/public/project/suggestconference.php | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index d8bcd0efb1b..bf6fa9fcc56 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1901,6 +1901,9 @@ class ActionComm extends CommonObject $sql .= " AND ar.fk_element = 0"; } } + if ($key == 'author') { + $sql .= " AND c.type = '".$this->db->escape($value)."'"; + } } $sql .= " AND a.datep IS NOT NULL"; // To exclude corrupted events and avoid errors in lightning/sunbird import diff --git a/htdocs/public/agenda/agendaexport.php b/htdocs/public/agenda/agendaexport.php index d40d75c0acf..00514cd026c 100644 --- a/htdocs/public/agenda/agendaexport.php +++ b/htdocs/public/agenda/agendaexport.php @@ -135,6 +135,9 @@ if (GETPOST("notolderthan", 'int')) { } else { $filters['notolderthan'] = $conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY; } +if (GETPOST("author", 'apha')) { + $filters['author'] = GETPOST("author", 'apha'); +} // Check config if (empty($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY)) { diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index f510a5274f0..65b15578b7d 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -439,7 +439,7 @@ if (empty($reshook) && $action == 'add') { } } else { // If no price has been set for the booth, we confirm it as suggested and we update - $conforbooth->status = CONFERENCEORBOOTH::STATUS_SUGGESTED; + $conforbooth->status = ConferenceOrBooth::STATUS_SUGGESTED; $conforbooth->update($user); // Sending mail require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index 3eff5fad3a9..0028f544f9f 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -373,7 +373,7 @@ if (empty($reshook) && $action == 'add') { $error++; $errmsg .= $conforbooth->error; } else { - $conforbooth->status = CONFERENCEORBOOTH::STATUS_SUGGESTED; + $conforbooth->status = ConferenceOrBooth::STATUS_SUGGESTED; $conforbooth->update($user); // Sending mail From e31d8f89f5592ae5f3a5fbc8d089b9b62c45319d Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 10 May 2021 17:13:57 +0200 Subject: [PATCH 0067/1497] wip filter --- htdocs/comm/action/class/actioncomm.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index bf6fa9fcc56..a6f9faf353f 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1902,7 +1902,7 @@ class ActionComm extends CommonObject } } if ($key == 'author') { - $sql .= " AND c.type = '".$this->db->escape($value)."'"; + $sql .= " AND u.lastname = '".$this->db->escape($value)."'"; } } From 1e90e618f04a54b3b4eee79668740acb7f95469f Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 10 May 2021 17:25:00 +0200 Subject: [PATCH 0068/1497] wip filter --- htdocs/eventorganization/conferenceorbooth_list.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index 3e480efca54..24d6853abda 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -427,7 +427,17 @@ if ($projectid > 0) { print ""; print ''.$langs->trans("EventOrganizationICSLink").''; - print ''; + // Define $urlwithroot + $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); + $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; + $getentity = ($conf->entity > 1 ? "&entity=".$conf->entity : ""); + + // Show message + $message = ''; + $message .= '
'; + $message .= '
'; + print $message; print ""; From 56d78cf12a4e57ab23868ce7caf9eda017727fa0 Mon Sep 17 00:00:00 2001 From: Quentin VIAL-GOUTEYRON Date: Wed, 12 May 2021 11:02:27 +0200 Subject: [PATCH 0069/1497] FIX missing town and zip filter in contract list sql request --- htdocs/contrat/list.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index a7b5114501f..96754e639fd 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -256,6 +256,8 @@ if ($search_email) $sql .= natural_search('s.email', $search_email); if ($search_contract) $sql .= natural_search(array('c.rowid', 'c.ref'), $search_contract); if (!empty($search_ref_customer)) $sql .= natural_search(array('c.ref_customer'), $search_ref_customer); if (!empty($search_ref_supplier)) $sql .= natural_search(array('c.ref_supplier'), $search_ref_supplier); +if ($search_zip) $sql .= natural_search(array('s.zip'), $search_zip); +if ($search_town) $sql .= natural_search(array('s.town'), $search_town); if ($search_sale > 0) { $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$search_sale; From 1bfcfc3a0ca69e8c44fb55d0d8c16b9059843056 Mon Sep 17 00:00:00 2001 From: Antonin MARCHAL Date: Wed, 12 May 2021 16:55:03 +0200 Subject: [PATCH 0070/1497] rename Hook and moved it into LibStatut method --- htdocs/fourn/class/fournisseur.commande.class.php | 7 ++++++- htdocs/fourn/commande/list.php | 10 +--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 3728771c8aa..99b64ccead4 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -690,7 +690,7 @@ class CommandeFournisseur extends CommonOrder public function LibStatut($status, $mode = 0, $billed = 0) { // phpcs:enable - global $conf, $langs; + global $conf, $langs, $hookmanager; if (empty($this->statuts) || empty($this->statutshort)) { $langs->load('orders'); @@ -749,6 +749,11 @@ class CommandeFournisseur extends CommonOrder $statusLong = $langs->transnoentitiesnoconv($this->statuts[$status]).$billedtext; $statusShort = $langs->transnoentitiesnoconv($this->statutshort[$status]); + $parameters = array('status' => $status, 'mode' => $mode, 'billed' => $billed, 'obj'=>$this); + $reshook = $hookmanager->executeHooks('diffHtmlStatus', $parameters, $object); // Note that $action and $object may have been modified by hook + if ($reshook > 0) { + return $hookmanager->resPrint; + } return dolGetStatus($statusLong, $statusShort, '', $statusClass, $mode); } diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 0aae47cd7fc..a294d2a4712 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -1537,15 +1537,7 @@ if ($resql) { } // Status if (!empty($arrayfields['cf.fk_statut']['checked'])) { - $parameters = array('obj' => $obj); - $morehtmlstatus = $objectstatic->LibStatut($obj->fk_statut, 5, $obj->billed); - $reshook = $hookmanager->executeHooks('moreHtmlStatus', $parameters, $object); // Note that $action and $object may have been modified by hook - if (empty($reshook)) { - $morehtmlstatus .= $hookmanager->resPrint; - } else { - $morehtmlstatus = $hookmanager->resPrint; - } - print '' . $morehtmlstatus . ''; + print ''.$objectstatic->LibStatut($obj->fk_statut, 5, $obj->billed).''; if (!$i) { $totalarray['nbfield']++; } From ea0d8605930e51a0e84bd38c739cdcf2cc3e3a0e Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 12 May 2021 14:55:32 +0000 Subject: [PATCH 0071/1497] Fixing style errors. --- htdocs/fourn/class/fournisseur.commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 99b64ccead4..abfe6df1edc 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -753,7 +753,7 @@ class CommandeFournisseur extends CommonOrder $reshook = $hookmanager->executeHooks('diffHtmlStatus', $parameters, $object); // Note that $action and $object may have been modified by hook if ($reshook > 0) { return $hookmanager->resPrint; - } + } return dolGetStatus($statusLong, $statusShort, '', $statusClass, $mode); } From c577d1c51eeb16c3abb33c022502d57b011aae5b Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Thu, 13 May 2021 13:35:28 +0200 Subject: [PATCH 0072/1497] FIX: Impossible to add multiple localtax2 --- htdocs/admin/dict.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index b7f65ddf91f..fbe7d924cbc 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -9,7 +9,7 @@ * Copyright (C) 2012-2015 Marcos García * Copyright (C) 2012 Christophe Battarel * Copyright (C) 2011-2016 Alexandre Spangaro - * Copyright (C) 2015 Ferran Marcet + * Copyright (C) 2015-2021 Ferran Marcet * Copyright (C) 2016 Raphaël Doursenaud * Copyright (C) 2019 Frédéric France * @@ -777,6 +777,9 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) elseif (in_array($keycode, array('joinfile', 'private', 'position', 'scale'))) { $sql .= (int) GETPOST($keycode, 'int'); } + elseif ($keycode == 'localtax2') { + $sql .= "'".GETPOST($keycode, 'alpha')."'"; + } else { $sql .= "'".$db->escape(GETPOST($keycode, 'nohtml'))."'"; } @@ -843,6 +846,9 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) elseif (in_array($keycode, array('private', 'position', 'scale'))) { $sql .= (int) GETPOST($keycode, 'int'); } + elseif ($keycode == 'localtax2') { + $sql .= "'".GETPOST($keycode, 'alpha')."'"; + } else { $sql .= "'".$db->escape(GETPOST($keycode, 'nohtml'))."'"; } From acadef72c1d8bd734573e3afdadff24271f70818 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 14 May 2021 18:01:22 +0200 Subject: [PATCH 0073/1497] Fix use supplier relative discount in replenish order creation --- htdocs/product/stock/replenish.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index dbf07c92d01..5d8e1f4a790 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -211,7 +211,9 @@ if ($action == 'order' && isset($_POST['valid'])) if ($resql && $db->num_rows($resql) > 0) { $obj = $db->fetch_object($resql); $order->fetch($obj->rowid); + $order->fetch_thirdparty(); foreach ($supplier['lines'] as $line) { + if(empty($line->remise_percent)) $line->remise_percent = $order->thirdparty->remise_supplier_percent; $result = $order->addline( $line->desc, $line->subprice, @@ -248,6 +250,7 @@ if ($action == 'order' && isset($_POST['valid'])) //trick to know which orders have been generated this way $order->source = 42; foreach ($supplier['lines'] as $line) { + if(empty($line->remise_percent)) $line->remise_percent = $order->thirdparty->remise_supplier_percent; $order->lines[] = $line; } $order->cond_reglement_id = $order->thirdparty->cond_reglement_supplier_id; From 1fbd53993f45901f5fb3d7e5c6bbf9df884e2b06 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 16 May 2021 19:07:36 +0200 Subject: [PATCH 0074/1497] Fix missing substitutionarray on ticket presend --- htdocs/ticket/card.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 6d14d29202f..a32ec67a11e 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -1297,13 +1297,23 @@ elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action = // add a message if ($action == 'presend' || $action == 'presend_addmessage') { + $outputlangs = $langs; + $newlang = ''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && !empty($_REQUEST['lang_id'])) { + $newlang = $_REQUEST['lang_id']; + } + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { + $newlang = $object->thirdparty->default_lang; + } + $arrayoffamiliestoexclude = array('objectamount'); + $action = 'add_message'; // action to use to post the message $modelmail = 'ticket_send'; // Substitution array $morehtmlright = ''; $help = ""; - $substitutionarray = array(); + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, $arrayoffamiliestoexclude, $object); if ($object->fk_soc > 0) { $object->fetch_thirdparty(); $substitutionarray['__THIRDPARTY_NAME__'] = $object->thirdparty->name; From c36f231f415eb3d6f6eeda42da629eedcb2de27b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 17 May 2021 07:34:56 +0200 Subject: [PATCH 0075/1497] Update card.php --- htdocs/ticket/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index a32ec67a11e..cb428712913 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -1299,8 +1299,8 @@ elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action = { $outputlangs = $langs; $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && !empty($_REQUEST['lang_id'])) { - $newlang = $_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + $newlang = GETPOST('lang_id', 'aZ09'); } if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { $newlang = $object->thirdparty->default_lang; From dd88f9cd767648860589be45a2a752fdd3e4a910 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 17 May 2021 07:37:01 +0200 Subject: [PATCH 0076/1497] Update card.php --- htdocs/ticket/card.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index cb428712913..857365203f8 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -1297,12 +1297,16 @@ elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action = // add a message if ($action == 'presend' || $action == 'presend_addmessage') { + if ($object->fk_soc > 0) { + $object->fetch_thirdparty(); + } + $outputlangs = $langs; $newlang = ''; if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && is_object($object->thirdparty)) { $newlang = $object->thirdparty->default_lang; } $arrayoffamiliestoexclude = array('objectamount'); @@ -1315,7 +1319,6 @@ elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action = $help = ""; $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, $arrayoffamiliestoexclude, $object); if ($object->fk_soc > 0) { - $object->fetch_thirdparty(); $substitutionarray['__THIRDPARTY_NAME__'] = $object->thirdparty->name; } $substitutionarray['__USER_SIGNATURE__'] = $user->signature; From bdf876ead4d36c340c0249c150eecf5f3619d3cb Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 17 May 2021 05:38:46 +0000 Subject: [PATCH 0077/1497] Fixing style errors. --- htdocs/ticket/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 857365203f8..186a4461bd3 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -1300,7 +1300,7 @@ elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action = if ($object->fk_soc > 0) { $object->fetch_thirdparty(); } - + $outputlangs = $langs; $newlang = ''; if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { From d4162f3076a34a26dd9ad1d651d58a0083e00d19 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 17 May 2021 08:00:33 +0200 Subject: [PATCH 0078/1497] Update card.php --- htdocs/ticket/card.php | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 186a4461bd3..5ed28094e39 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -1317,7 +1317,7 @@ elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action = // Substitution array $morehtmlright = ''; $help = ""; - $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, $arrayoffamiliestoexclude, $object); + $substitutionarray = getCommonSubstitutionArray($newlang, 0, $arrayoffamiliestoexclude, $object); if ($object->fk_soc > 0) { $substitutionarray['__THIRDPARTY_NAME__'] = $object->thirdparty->name; } @@ -1351,16 +1351,6 @@ elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action = print '
'; - // Define output language - $outputlangs = $langs; - $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && !empty($_REQUEST['lang_id'])) { - $newlang = $_REQUEST['lang_id']; - } - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { - $newlang = $object->default_lang; - } - $formticket = new FormTicket($db); $formticket->action = $action; From 7bb71dd89fa1e6552135e2f875cd00cfa174635e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 17 May 2021 09:25:18 +0200 Subject: [PATCH 0079/1497] FIX #17602 --- htdocs/admin/dict.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index f00d670d4a1..caa7a9fdc05 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -802,8 +802,8 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) if ($value == 'price' || preg_match('/^amount/i', $value)) { $_POST[$keycode] = price2num(GETPOST($keycode), 'MU'); } - elseif ($value == 'taux' || $value == 'localtax1' || $value == 'localtax2') { - $_POST[$keycode] = price2num(GETPOST($keycode), 8); + elseif ($value == 'taux' || $value == 'localtax1') { + $_POST[$keycode] = price2num(GETPOST($keycode), 8); // Note that localtax2 can be a list of rates separated by coma like X:Y:Z } elseif ($value == 'entity') { $_POST[$keycode] = getEntity($tabname[$id]); @@ -871,8 +871,8 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) if ($field == 'price' || preg_match('/^amount/i', $field)) { $_POST[$keycode] = price2num(GETPOST($keycode), 'MU'); } - elseif ($field == 'taux' || $field == 'localtax1' || $field == 'localtax2') { - $_POST[$keycode] = price2num(GETPOST($keycode), 8); + elseif ($field == 'taux' || $field == 'localtax1') { + $_POST[$keycode] = price2num(GETPOST($keycode), 8); // Note that localtax2 can be a list of rates separated by coma like X:Y:Z } elseif ($field == 'entity') { $_POST[$keycode] = getEntity($tabname[$id]); From 2f9a504dce7e44e16513a712cab815d58585ffb4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 17 May 2021 09:30:09 +0200 Subject: [PATCH 0080/1497] Fix label --- htdocs/admin/dict.php | 10 +++++----- htdocs/langs/en_US/main.lang | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index caa7a9fdc05..4bd556c5ac3 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1076,7 +1076,7 @@ if ($id) $sql = $tabsql[$id]; if (!preg_match('/ WHERE /', $sql)) $sql .= " WHERE 1 = 1"; - if ($search_country_id > 0) $sql .= " AND c.rowid = ".$search_country_id; + if ($search_country_id > 0) $sql .= " AND c.rowid = ".((int) $search_country_id); if ($search_code != '' && $id == 9) $sql .= natural_search("code_iso", $search_code); elseif ($search_code != '' && $id == 28) $sql .= natural_search("h.code", $search_code); elseif ($search_code != '' && $id == 32) $sql .= natural_search("a.code", $search_code); @@ -1150,9 +1150,9 @@ if ($id) $class = 'center'; } if ($fieldlist[$field] == 'localtax1_type') { $valuetoshow = $langs->trans("UseLocalTax")." 2"; $class = "center"; $sortable = 0; } - if ($fieldlist[$field] == 'localtax1') { $valuetoshow = $langs->trans("Rate")." 2"; $class = "center"; } + if ($fieldlist[$field] == 'localtax1') { $valuetoshow = $langs->trans("RateOfTaxN", '2'); $class = "center"; } if ($fieldlist[$field] == 'localtax2_type') { $valuetoshow = $langs->trans("UseLocalTax")." 3"; $class = "center"; $sortable = 0; } - if ($fieldlist[$field] == 'localtax2') { $valuetoshow = $langs->trans("Rate")." 3"; $class = "center"; } + if ($fieldlist[$field] == 'localtax2') { $valuetoshow = $langs->trans("RateOfTaxN", '3'); $class = "center"; } if ($fieldlist[$field] == 'organization') { $valuetoshow = $langs->trans("Organization"); } if ($fieldlist[$field] == 'lang') { $valuetoshow = $langs->trans("Language"); } if ($fieldlist[$field] == 'type') { @@ -1380,9 +1380,9 @@ if ($id) $cssprefix = 'center '; } if ($fieldlist[$field] == 'localtax1_type') { $valuetoshow = $langs->trans("UseLocalTax")." 2"; $cssprefix = "center "; $sortable = 0; } - if ($fieldlist[$field] == 'localtax1') { $valuetoshow = $langs->trans("Rate")." 2"; $cssprefix = "center "; $sortable = 0; } + if ($fieldlist[$field] == 'localtax1') { $valuetoshow = $langs->trans("RateOfTaxN", '2'); $cssprefix = "center "; $sortable = 0; } if ($fieldlist[$field] == 'localtax2_type') { $valuetoshow = $langs->trans("UseLocalTax")." 3"; $cssprefix = "center "; $sortable = 0; } - if ($fieldlist[$field] == 'localtax2') { $valuetoshow = $langs->trans("Rate")." 3"; $cssprefix = "center "; $sortable = 0; } + if ($fieldlist[$field] == 'localtax2') { $valuetoshow = $langs->trans("RateOfTaxN", '3'); $cssprefix = "center "; $sortable = 0; } if ($fieldlist[$field] == 'organization') { $valuetoshow = $langs->trans("Organization"); } if ($fieldlist[$field] == 'lang') { $valuetoshow = $langs->trans("Language"); } if ($fieldlist[$field] == 'type') { $valuetoshow = $langs->trans("Type"); } diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 5594c835ba8..39517ca2e1b 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -427,6 +427,7 @@ LT1IN=CGST LT2IN=SGST LT1GC=Additionnal cents VATRate=Tax Rate +RateOfTaxN=Rate of tax %s VATCode=Tax Rate code VATNPR=Tax Rate NPR DefaultTaxRate=Default tax rate From f923c70f380d4145153b20bcbb8037caf7ea7a4c Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Mon, 17 May 2021 10:17:54 +0200 Subject: [PATCH 0081/1497] Fix: Before there was no mistake --- htdocs/admin/dict.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index fbe7d924cbc..648537ec3f8 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -9,7 +9,7 @@ * Copyright (C) 2012-2015 Marcos García * Copyright (C) 2012 Christophe Battarel * Copyright (C) 2011-2016 Alexandre Spangaro - * Copyright (C) 2015-2021 Ferran Marcet + * Copyright (C) 2015 Ferran Marcet * Copyright (C) 2016 Raphaël Doursenaud * Copyright (C) 2019 Frédéric France * @@ -777,10 +777,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) elseif (in_array($keycode, array('joinfile', 'private', 'position', 'scale'))) { $sql .= (int) GETPOST($keycode, 'int'); } - elseif ($keycode == 'localtax2') { - $sql .= "'".GETPOST($keycode, 'alpha')."'"; - } - else { + else { $sql .= "'".$db->escape(GETPOST($keycode, 'nohtml'))."'"; } @@ -846,9 +843,6 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) elseif (in_array($keycode, array('private', 'position', 'scale'))) { $sql .= (int) GETPOST($keycode, 'int'); } - elseif ($keycode == 'localtax2') { - $sql .= "'".GETPOST($keycode, 'alpha')."'"; - } else { $sql .= "'".$db->escape(GETPOST($keycode, 'nohtml'))."'"; } From f95bd2f4396f9f159c1e872b96a16f7a84ebd92c Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 17 May 2021 11:40:36 +0200 Subject: [PATCH 0082/1497] fixw that --- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 7c9f4e6fe77..8ce23e6f9ad 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -424,7 +424,7 @@ class pdf_cyan extends ModelePDFPropales $salereparray = $object->thirdparty->getSalesRepresentatives($user); $salerepobj = new User($this->db); $salerepobj->fetch($salereparray[0]['id']); - if (!empty($salerepobj->signature)) $notetoshow = dol_concatdesc($notetoshow, $salerepobj->signature); + if (!empty($salerepobj->signature)) $notetoshow .= dol_concatdesc($notetoshow, $salerepobj->signature); } } From 547f1dd3703a625b72ee594b238c211a0a684297 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 17 May 2021 11:54:53 +0200 Subject: [PATCH 0083/1497] Fix: user rest api rights --- htdocs/user/class/api_users.class.php | 38 +++++++++++++-------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index fa139e2c69f..7c1eef84c2c 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -71,7 +71,7 @@ class Users extends DolibarrApi $obj_ret = array(); - if (!DolibarrApiAccess::$user->rights->user->user->lire) { + if (!DolibarrApiAccess::$user->rights->user->user->lire && !DolibarrApiAccess::$user->admin) { throw new RestException(401, "You are not allowed to read list of users"); } @@ -142,9 +142,9 @@ class Users extends DolibarrApi */ public function get($id, $includepermissions = 0) { - //if (!DolibarrApiAccess::$user->rights->user->user->lire) { - //throw new RestException(401); - //} + if (!DolibarrApiAccess::$user->rights->user->user->lire && !DolibarrApiAccess::$user->admin) { + throw new RestException(401); + } $result = $this->useraccount->fetch($id); if (!$result) @@ -208,9 +208,9 @@ class Users extends DolibarrApi public function post($request_data = null) { // check user authorization - //if(! DolibarrApiAccess::$user->rights->user->creer) { - // throw new RestException(401, "User creation not allowed"); - //} + if(! DolibarrApiAccess::$user->rights->user->creer && !DolibarrApiAccess::$user->admin) { + throw new RestException(401, "User creation not allowed"); + } // check mandatory fields /*if (!isset($request_data["login"])) throw new RestException(400, "login field missing"); @@ -242,9 +242,9 @@ class Users extends DolibarrApi */ public function put($id, $request_data = null) { - //if (!DolibarrApiAccess::$user->rights->user->user->creer) { - //throw new RestException(401); - //} + if (!DolibarrApiAccess::$user->rights->user->user->creer && !DolibarrApiAccess::$user->admin) { + throw new RestException(401); + } $result = $this->useraccount->fetch($id); if (!$result) @@ -299,7 +299,7 @@ class Users extends DolibarrApi { $obj_ret = array(); - if (!DolibarrApiAccess::$user->rights->user->user->lire) { + if (!DolibarrApiAccess::$user->rights->user->user->lire && !DolibarrApiAccess::$user->admin) { throw new RestException(401); } @@ -334,9 +334,9 @@ class Users extends DolibarrApi global $conf; - //if (!DolibarrApiAccess::$user->rights->user->user->supprimer) { - //throw new RestException(401); - //} + if (!DolibarrApiAccess::$user->rights->user->user->supprimer && !DolibarrApiAccess::$user->admin) { + throw new RestException(401); + } $result = $this->useraccount->fetch($id); if (!$result) { @@ -389,7 +389,7 @@ class Users extends DolibarrApi $obj_ret = array(); - if (!DolibarrApiAccess::$user->rights->user->group_advance->read) { + if (!DolibarrApiAccess::$user->rights->user->group_advance->read && !DolibarrApiAccess::$user->admin) { throw new RestException(401, "You are not allowed to read list of groups"); } @@ -463,7 +463,7 @@ class Users extends DolibarrApi { global $db, $conf; - if (!DolibarrApiAccess::$user->rights->user->group_advance->read) { + if (!DolibarrApiAccess::$user->rights->user->group_advance->read && !DolibarrApiAccess::$user->admin) { throw new RestException(401, "You are not allowed to read groups"); } @@ -486,9 +486,9 @@ class Users extends DolibarrApi */ public function delete($id) { - //if (!DolibarrApiAccess::$user->rights->user->user->supprimer) { - //throw new RestException(401); - //} + if (!DolibarrApiAccess::$user->rights->user->user->supprimer && !DolibarrApiAccess::$user->admin) { + throw new RestException(401); + } $result = $this->useraccount->fetch($id); if (!$result) { From a3aba28c95fd41c3db3b390f642b6fd05e873105 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 17 May 2021 10:06:41 +0000 Subject: [PATCH 0084/1497] Fixing style errors. --- htdocs/user/class/api_users.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index 7c1eef84c2c..39f3b302599 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -209,7 +209,7 @@ class Users extends DolibarrApi { // check user authorization if(! DolibarrApiAccess::$user->rights->user->creer && !DolibarrApiAccess::$user->admin) { - throw new RestException(401, "User creation not allowed"); + throw new RestException(401, "User creation not allowed"); } // check mandatory fields /*if (!isset($request_data["login"])) From c6aa078892f89198178258484550681ad1762e2b Mon Sep 17 00:00:00 2001 From: Antonin MARCHAL Date: Mon, 17 May 2021 13:46:01 +0200 Subject: [PATCH 0085/1497] renamed LibStatut hook + removed useless hook --- htdocs/fourn/class/fournisseur.commande.class.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index abfe6df1edc..e8d6c0ed9c9 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -750,7 +750,7 @@ class CommandeFournisseur extends CommonOrder $statusShort = $langs->transnoentitiesnoconv($this->statutshort[$status]); $parameters = array('status' => $status, 'mode' => $mode, 'billed' => $billed, 'obj'=>$this); - $reshook = $hookmanager->executeHooks('diffHtmlStatus', $parameters, $object); // Note that $action and $object may have been modified by hook + $reshook = $hookmanager->executeHooks('LibStatut', $parameters, $object); // Note that $action and $object may have been modified by hook if ($reshook > 0) { return $hookmanager->resPrint; } @@ -779,15 +779,7 @@ class CommandeFournisseur extends CommonOrder if ($user->rights->fournisseur->commande->lire) { $label = ''.$langs->trans("SupplierOrder").''; if (isset($this->statut)) { - $statusText = ' '.$this->getLibStatut(5); - $parameters = array('obj' => $this); - $reshook = $hookmanager->executeHooks('moreHtmlStatus', $parameters, $object); // Note that $action and $object may have been modified by hook - if (empty($reshook)) { - $statusText .= $hookmanager->resPrint; - } else { - $statusText = $hookmanager->resPrint; - } - $label .= $statusText; + $label = ' '.$this->getLibStatut(5); } if (!empty($this->ref)) { $label .= '
'.$langs->trans('Ref').': '.$this->ref; From 779c868eaede3368a6d5b3f8674942565df26e84 Mon Sep 17 00:00:00 2001 From: Antonin MARCHAL Date: Mon, 17 May 2021 13:48:21 +0200 Subject: [PATCH 0086/1497] fix mistake and removed hookmanager unused --- htdocs/fourn/class/fournisseur.commande.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index e8d6c0ed9c9..9b643ff1464 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -770,7 +770,7 @@ class CommandeFournisseur extends CommonOrder */ public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $save_lastsearch_value = -1, $addlinktonotes = 0) { - global $langs, $conf, $user, $hookmanager; + global $langs, $conf, $user; $result = ''; @@ -779,7 +779,7 @@ class CommandeFournisseur extends CommonOrder if ($user->rights->fournisseur->commande->lire) { $label = ''.$langs->trans("SupplierOrder").''; if (isset($this->statut)) { - $label = ' '.$this->getLibStatut(5); + $label .= ' '.$this->getLibStatut(5); } if (!empty($this->ref)) { $label .= '
'.$langs->trans('Ref').': '.$this->ref; From 6f3d19b7b63c3fb62997dc64f8a32b16065501de Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 17 May 2021 15:12:25 +0200 Subject: [PATCH 0087/1497] dol_concatdesc better than concat operator --- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 8ce23e6f9ad..2b40dffa30e 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -424,7 +424,7 @@ class pdf_cyan extends ModelePDFPropales $salereparray = $object->thirdparty->getSalesRepresentatives($user); $salerepobj = new User($this->db); $salerepobj->fetch($salereparray[0]['id']); - if (!empty($salerepobj->signature)) $notetoshow .= dol_concatdesc($notetoshow, $salerepobj->signature); + if (!empty($salerepobj->signature)) $notetoshow = dol_concatdesc($notetoshow, $salerepobj->signature); } } @@ -438,9 +438,11 @@ class pdf_cyan extends ModelePDFPropales { $tmpuser = new User($this->db); $tmpuser->fetch($object->user_author_id); - $notetoshow .= $langs->trans("CaseFollowedBy").' '.$tmpuser->getFullName($langs); - if ($tmpuser->email) $notetoshow .= ', Mail: '.$tmpuser->email; - if ($tmpuser->office_phone) $notetoshow .= ', Tel: '.$tmpuser->office_phone; + $creator_info = $langs->trans("CaseFollowedBy").' '.$tmpuser->getFullName($langs); + if ($tmpuser->email) $creator_info .= ', Mail: '.$tmpuser->email; + if ($tmpuser->office_phone) $creator_info .= ', Tel: '.$tmpuser->office_phone; + + $notetoshow = dol_concatdesc($notetoshow, $creator_info); } $tab_height = $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforsignature - $heightforfooter; From c54e010126fb1cc297f644f5bf045a26a0c0b09c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 17 May 2021 16:16:45 +0200 Subject: [PATCH 0088/1497] Fix perms on API user --- htdocs/user/class/api_users.class.php | 30 ++++++++++++++++----------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index 39f3b302599..9f5ea935372 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -71,7 +71,7 @@ class Users extends DolibarrApi $obj_ret = array(); - if (!DolibarrApiAccess::$user->rights->user->user->lire && !DolibarrApiAccess::$user->admin) { + if (!DolibarrApiAccess::$user->rights->user->user->lire && empty(DolibarrApiAccess::$user->admin)) { throw new RestException(401, "You are not allowed to read list of users"); } @@ -142,7 +142,7 @@ class Users extends DolibarrApi */ public function get($id, $includepermissions = 0) { - if (!DolibarrApiAccess::$user->rights->user->user->lire && !DolibarrApiAccess::$user->admin) { + if (!DolibarrApiAccess::$user->rights->user->user->lire && empty(DolibarrApiAccess::$user->admin)) { throw new RestException(401); } @@ -177,7 +177,11 @@ class Users extends DolibarrApi */ public function getInfo() { - $apiUser = DolibarrApiAccess::$user; + if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin)) { + throw new RestException(401, 'Not allowed'); + } + + $apiUser = DolibarrApiAccess::$user; $result = $this->useraccount->fetch($apiUser->id); if (!$result) { @@ -208,7 +212,7 @@ class Users extends DolibarrApi public function post($request_data = null) { // check user authorization - if(! DolibarrApiAccess::$user->rights->user->creer && !DolibarrApiAccess::$user->admin) { + if (empty(DolibarrApiAccess::$user->rights->user->creer) && empty(DolibarrApiAccess::$user->admin)) { throw new RestException(401, "User creation not allowed"); } // check mandatory fields @@ -242,7 +246,7 @@ class Users extends DolibarrApi */ public function put($id, $request_data = null) { - if (!DolibarrApiAccess::$user->rights->user->user->creer && !DolibarrApiAccess::$user->admin) { + if (empty(DolibarrApiAccess::$user->rights->user->user->creer) && empty(DolibarrApiAccess::$user->admin)) { throw new RestException(401); } @@ -299,7 +303,7 @@ class Users extends DolibarrApi { $obj_ret = array(); - if (!DolibarrApiAccess::$user->rights->user->user->lire && !DolibarrApiAccess::$user->admin) { + if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin)) { throw new RestException(401); } @@ -334,7 +338,7 @@ class Users extends DolibarrApi global $conf; - if (!DolibarrApiAccess::$user->rights->user->user->supprimer && !DolibarrApiAccess::$user->admin) { + if (empty(DolibarrApiAccess::$user->rights->user->user->creer) && empty(DolibarrApiAccess::$user->admin)) { throw new RestException(401); } $result = $this->useraccount->fetch($id); @@ -389,9 +393,10 @@ class Users extends DolibarrApi $obj_ret = array(); - if (!DolibarrApiAccess::$user->rights->user->group_advance->read && !DolibarrApiAccess::$user->admin) { - throw new RestException(401, "You are not allowed to read list of groups"); - } + if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin)) || + !empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty(DolibarrApiAccess::$user->rights->user->group_advance->read) && empty(DolibarrApiAccess::$user->admin)) { + throw new RestException(401, "You are not allowed to read groups"); + } // case of external user, $societe param is ignored and replaced by user's socid //$socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $societe; @@ -463,7 +468,8 @@ class Users extends DolibarrApi { global $db, $conf; - if (!DolibarrApiAccess::$user->rights->user->group_advance->read && !DolibarrApiAccess::$user->admin) { + if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin)) || + !empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty(DolibarrApiAccess::$user->rights->user->group_advance->read) && empty(DolibarrApiAccess::$user->admin)) { throw new RestException(401, "You are not allowed to read groups"); } @@ -486,7 +492,7 @@ class Users extends DolibarrApi */ public function delete($id) { - if (!DolibarrApiAccess::$user->rights->user->user->supprimer && !DolibarrApiAccess::$user->admin) { + if (empty(DolibarrApiAccess::$user->rights->user->user->supprimer) && empty(DolibarrApiAccess::$user->admin)) { throw new RestException(401); } $result = $this->useraccount->fetch($id); From 0b7f474dd37fbbbeeb0efc2ad54e1c0af75db6d0 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Mon, 17 May 2021 18:04:21 +0200 Subject: [PATCH 0089/1497] look_feel user author in list --- htdocs/comm/propal/list.php | 10 +++++----- htdocs/commande/list.php | 7 +++---- htdocs/compta/facture/list.php | 7 +++---- htdocs/projet/list.php | 4 +++- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 43c83117457..7f738f84ebe 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -1705,14 +1705,13 @@ if ($resql) { } } - $userstatic->id = $obj->fk_user_author; - $userstatic->login = $obj->login; + $userstatic->fetch($obj->fk_user_author); // Author if (!empty($arrayfields['u.login']['checked'])) { - print ''; + print ''; if ($userstatic->id) { - print $userstatic->getLoginUrl(1); + print $userstatic->getNomUrl(-1); } print "\n"; if (!$i) { @@ -1744,7 +1743,8 @@ if ($resql) { $userstatic->entity = $val['entity']; $userstatic->photo = $val['photo']; $userstatic->login = $val['login']; - $userstatic->phone = $val['phone']; + $userstatic->user_mobile = $val['user_mobile']; + $userstatic->user_mobile = $val['user_mobile']; $userstatic->job = $val['job']; $userstatic->gender = $val['gender']; //print '
': diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 3747b2107b2..d14fe1ae460 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1668,14 +1668,13 @@ if ($resql) { } } - $userstatic->id = $obj->fk_user_author; - $userstatic->login = $obj->login; + $userstatic->fetch($obj->fk_user_author); // Author if (!empty($arrayfields['u.login']['checked'])) { - print ''; + print ''; if ($userstatic->id) { - print $userstatic->getLoginUrl(1); + print $userstatic->getNomUrl(-1); } else { print ' '; } diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 14b0383fa8d..e5c08993b9f 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -1880,11 +1880,10 @@ if ($resql) { // Author if (!empty($arrayfields['u.login']['checked'])) { - $userstatic->id = $obj->fk_user_author; - $userstatic->login = $obj->login; - print ''; + $userstatic->fetch($obj->fk_user_author); + print ''; if ($userstatic->id) { - print $userstatic->getLoginUrl(1); + print $userstatic->getNomUrl(-1); } else { print ' '; } diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index a9f17f5439b..1edeb0816c2 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -1041,7 +1041,9 @@ while ($i < min($num, $limit)) { $userstatic->entity = $val['entity']; $userstatic->photo = $val['photo']; $userstatic->login = $val['login']; - $userstatic->phone = $val['phone']; + $userstatic->office_phone = $val['office_phone']; + $userstatic->office_fax = $val['office_fax']; + $userstatic->user_mobile = $val['user_mobile']; $userstatic->job = $val['job']; $userstatic->gender = $val['gender']; print ($nbofsalesrepresentative < 2) ? $userstatic->getNomUrl(-1, '', 0, 0, 12) : $userstatic->getNomUrl(-2); From 9dcf2044a96c755a8bb54dfe61163c1703b466b7 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Mon, 17 May 2021 18:33:27 +0200 Subject: [PATCH 0090/1497] Update list.php --- htdocs/comm/propal/list.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 7f738f84ebe..0f277dad14c 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -1743,7 +1743,8 @@ if ($resql) { $userstatic->entity = $val['entity']; $userstatic->photo = $val['photo']; $userstatic->login = $val['login']; - $userstatic->user_mobile = $val['user_mobile']; + $userstatic->office_phone = $val['office_phone']; + $userstatic->office_fax = $val['office_fax']; $userstatic->user_mobile = $val['user_mobile']; $userstatic->job = $val['job']; $userstatic->gender = $val['gender']; From 1a38d075a6830754de0bd68d6b14a188b2b21851 Mon Sep 17 00:00:00 2001 From: Bastien Schils <12594973+WimpyMan@users.noreply.github.com> Date: Mon, 17 May 2021 18:34:23 +0200 Subject: [PATCH 0091/1497] html.form.class.php: Fixed SQL error (projects) 1. Strings should be quoted by single quotes 2. GROUP BY declaration must list all fields from SELECT statement --- htdocs/core/class/html.form.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 7f52cb099a1..55cb6270455 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -8118,8 +8118,8 @@ class Form } // Search all projects - $sql = 'SELECT f.rowid, f.ref as fref, "nolabel" as flabel, p.rowid as pid, f.ref, - p.title, p.fk_soc, p.fk_statut, p.public,'; + $sql = "SELECT f.rowid, f.ref as fref, 'nolabel' as flabel, p.rowid as pid, f.ref, + p.title, p.fk_soc, p.fk_statut, p.public,"; $sql .= ' s.nom as name'; $sql .= ' FROM '.MAIN_DB_PREFIX.'projet as p'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON s.rowid = p.fk_soc,'; @@ -8129,7 +8129,7 @@ class Form //if ($projectsListId) $sql.= " AND p.rowid IN (".$projectsListId.")"; //if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)"; //if ($socid > 0) $sql.= " AND (p.fk_soc=".$socid." OR p.fk_soc IS NULL)"; - $sql .= " GROUP BY f.ref ORDER BY p.ref, f.ref ASC"; + $sql .= " GROUP BY f.ref, f.rowid, flabel,pid, p.title, p.fk_soc, p.fk_statut, p.public, name ORDER BY p.ref, f.ref ASC"; $resql = $this->db->query($sql); if ($resql) From 6bbd6db84bc1ec551632a6e2334bc61080a37a17 Mon Sep 17 00:00:00 2001 From: Givriz Date: Mon, 17 May 2021 18:39:08 +0200 Subject: [PATCH 0092/1497] Compatibility phpv8 --- htdocs/admin/system/modules.php | 2 +- htdocs/admin/tools/listevents.php | 2 +- htdocs/main.inc.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/system/modules.php b/htdocs/admin/system/modules.php index f3892e105bb..4a77d2452c4 100644 --- a/htdocs/admin/system/modules.php +++ b/htdocs/admin/system/modules.php @@ -277,7 +277,7 @@ if ($arrayfields['module_position']['checked']) { } // Fields from hook -$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); +$parameters = array('arrayfields'=>$arrayfields, 'param'=>empty($param) ? '' : $param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index fbc2412a9df..b894920d34e 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -245,7 +245,7 @@ if ($result) { if ($limit > 0 && $limit != $conf->liste_limit) { $param .= '&limit='.urlencode($limit); } - if ($optioncss != '') { + if (!empty($optioncss)) { $param .= '&optioncss='.urlencode($optioncss); } if ($search_code) { diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index c9a7dd21ccc..1929dcbdb37 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -928,7 +928,7 @@ if (!defined('NOLOGIN')) { $_SESSION["dol_dst_second"] = isset($dol_dst_second) ? $dol_dst_second : ''; $_SESSION["dol_screenwidth"] = isset($dol_screenwidth) ? $dol_screenwidth : ''; $_SESSION["dol_screenheight"] = isset($dol_screenheight) ? $dol_screenheight : ''; - $_SESSION["dol_company"] = $conf->global->MAIN_INFO_SOCIETE_NOM; + $_SESSION["dol_company"] = getDolGlobalString("MAIN_INFO_SOCIETE_NOM"); $_SESSION["dol_entity"] = $conf->entity; // Store value into session (values stored only if defined) if (!empty($dol_hide_topmenu)) { From a865f49d72049f7ffbb949da11386ab151fdfd16 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 17 May 2021 19:19:26 +0200 Subject: [PATCH 0093/1497] Fix phpcs --- htdocs/user/class/api_users.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index 9f5ea935372..75aedba09bd 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -180,7 +180,7 @@ class Users extends DolibarrApi if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin)) { throw new RestException(401, 'Not allowed'); } - + $apiUser = DolibarrApiAccess::$user; $result = $this->useraccount->fetch($apiUser->id); From 4236471a6f0efd9d8269837ddcdb494aeed05ee1 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 17 May 2021 22:12:01 +0200 Subject: [PATCH 0094/1497] Fix Title salary card --- htdocs/salaries/card.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index 8e2188123db..aff3e4cce92 100755 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -359,7 +359,9 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && ($user->rights->salaries- * View */ -llxHeader("", $langs->trans("Salary")); +$title = $langs->trans('Salary')." - ".$langs->trans('Card'); +$help_url = ""; +llxHeader("", $title, $help_url); $form = new Form($db); if (!empty($conf->projet->enabled)) $formproject = new FormProjets($db); From c3c760c26915af4ef39671fb0af23c31d1172901 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 17 May 2021 22:18:46 +0200 Subject: [PATCH 0095/1497] Fix Title salary document card --- htdocs/salaries/document.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/salaries/document.php b/htdocs/salaries/document.php index 4c88cefb8de..5950fc88798 100644 --- a/htdocs/salaries/document.php +++ b/htdocs/salaries/document.php @@ -91,7 +91,9 @@ include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; $form = new Form($db); -llxHeader("", $langs->trans("SalaryPayment")); +$title = $langs->trans('Salary')." - ".$langs->trans('Documents'); +$help_url = ""; +llxHeader("", $title, $help_url); if ($object->id) { $object->fetch_thirdparty(); From 91b8b6a6003ac730612abb607fc9a0c8b53ccb89 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 17 May 2021 22:41:00 +0200 Subject: [PATCH 0096/1497] Fix Title salary info card --- htdocs/salaries/info.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/salaries/info.php b/htdocs/salaries/info.php index 1b81a80189f..0f94f405fa1 100644 --- a/htdocs/salaries/info.php +++ b/htdocs/salaries/info.php @@ -53,7 +53,9 @@ restrictedArea($user, 'salaries', $object->id, 'salary', ''); * View */ -llxHeader("", $langs->trans("SalaryPayment")); +$title = $langs->trans('Salary')." - ".$langs->trans('Info'); +$help_url = ""; +llxHeader("", $title, $help_url); $object = new Salary($db); $object->fetch($id); From 58db723502a58d054ffd45749ab151551026890d Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Mon, 17 May 2021 23:27:33 +0200 Subject: [PATCH 0097/1497] thirdparty info popup list --- htdocs/comm/propal/list.php | 9 +++++++- htdocs/commande/list.php | 11 ++++++++-- htdocs/compta/facture/list.php | 40 +++++++++++++++++++--------------- htdocs/projet/list.php | 38 ++++++++++++++++++++------------ 4 files changed, 64 insertions(+), 34 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index e1ec555837f..c8173967770 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -460,9 +460,10 @@ $sql = 'SELECT'; if ($sall || $search_product_category > 0 || $search_user > 0) { $sql = 'SELECT DISTINCT'; } -$sql .= ' s.rowid as socid, s.nom as name, s.name_alias as alias, s.email, s.town, s.zip, s.fk_pays, s.client, s.code_client, '; +$sql .= ' s.rowid as socid, s.nom as name, s.name_alias as alias, s.email, s.phone, s.fax , s.address, s.town, s.zip, s.fk_pays, s.client, s.code_client, '; $sql .= " typent.code as typent_code,"; $sql .= " ava.rowid as availability,"; +$sql .= " country.code as country_code,"; $sql .= " state.code_departement as state_code, state.nom as state_name,"; $sql .= ' p.rowid, p.entity, p.note_private, p.total_ht, p.total_tva, p.total_ttc, p.localtax1, p.localtax2, p.ref, p.ref_client, p.fk_statut as status, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,p.date_livraison as ddelivery,'; $sql .= ' p.fk_multicurrency, p.multicurrency_code, p.multicurrency_tx, p.multicurrency_total_ht, p.multicurrency_total_tva, p.multicurrency_total_ttc,'; @@ -1335,9 +1336,15 @@ if ($resql) { $companystatic->id = $obj->socid; $companystatic->name = $obj->name; + $companystatic->name_alias = $obj->alias; $companystatic->client = $obj->client; $companystatic->code_client = $obj->code_client; $companystatic->email = $obj->email; + $companystatic->phone = $obj->phone; + $companystatic->address = $obj->address; + $companystatic->zip = $obj->zip; + $companystatic->town = $obj->town; + $companystatic->country_code = $obj->country_code; $projectstatic->id = $obj->project_id; $projectstatic->ref = $obj->project_ref; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 5bb8e6ccb0c..81b15623adf 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -417,9 +417,10 @@ $sql = 'SELECT'; if ($sall || $search_product_category > 0 || $search_user > 0) { $sql = 'SELECT DISTINCT'; } -$sql .= ' s.rowid as socid, s.nom as name, s.name_alias as name_alias, s.email, s.town, s.zip, s.fk_pays, s.client, s.code_client,'; +$sql .= ' s.rowid as socid, s.nom as name, s.name_alias as alias, s.email, s.phone, s.fax, s.address, s.town, s.zip, s.fk_pays, s.client, s.code_client,'; $sql .= " typent.code as typent_code,"; $sql .= " state.code_departement as state_code, state.nom as state_name,"; +$sql .= " country.code as country_code,"; $sql .= ' c.rowid, c.ref, c.total_ht, c.total_tva, c.total_ttc, c.ref_client, c.fk_user_author,'; $sql .= ' c.fk_multicurrency, c.multicurrency_code, c.multicurrency_tx, c.multicurrency_total_ht, c.multicurrency_total_tva as multicurrency_total_vat, c.multicurrency_total_ttc,'; $sql .= ' c.date_valid, c.date_commande, c.note_public, c.note_private, c.date_livraison as date_delivery, c.fk_statut, c.facture as billed,'; @@ -1383,10 +1384,16 @@ if ($resql) { $nbprod = 0; $companystatic->id = $obj->socid; - $companystatic->code_client = $obj->code_client; $companystatic->name = $obj->name; + $companystatic->name_alias = $obj->alias; $companystatic->client = $obj->client; + $companystatic->code_client = $obj->code_client; $companystatic->email = $obj->email; + $companystatic->phone = $obj->phone; + $companystatic->address = $obj->address; + $companystatic->zip = $obj->zip; + $companystatic->town = $obj->town; + $companystatic->country_code = $obj->country_code; if (!isset($getNomUrl_cache[$obj->socid])) { $getNomUrl_cache[$obj->socid] = $companystatic->getNomUrl(1, 'customer'); } diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 1ac8765171d..2a474d00fae 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -467,7 +467,7 @@ if (!empty($conf->margin->enabled)) { $bankaccountstatic = new Account($db); $facturestatic = new Facture($db); $formcompany = new FormCompany($db); -$thirdpartystatic = new Societe($db); +$companystatic = new Societe($db); $sql = 'SELECT'; if ($sall || $search_product_category > 0 || $search_user > 0) { @@ -481,7 +481,7 @@ $sql .= ' f.datef, f.date_valid, f.date_lim_reglement as datelimite, f.module_so $sql .= ' f.paye as paye, f.fk_statut, f.close_code,'; $sql .= ' f.datec as date_creation, f.tms as date_update, f.date_closing as date_closing,'; $sql .= ' f.retained_warranty, f.retained_warranty_date_limit, f.situation_final, f.situation_cycle_ref, f.situation_counter,'; -$sql .= ' s.rowid as socid, s.nom as name, s.name_alias as name_alias, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur,'; +$sql .= ' s.rowid as socid, s.nom as name, s.name_alias as alias, s.email, s.phone, s.fax, s.address, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur,'; $sql .= " typent.code as typent_code,"; $sql .= " state.code_departement as state_code, state.nom as state_name,"; $sql .= " country.code as country_code,"; @@ -714,7 +714,7 @@ if (!$sall) { $sql .= ' f.retained_warranty, f.retained_warranty_date_limit, f.situation_final, f.situation_cycle_ref, f.situation_counter,'; $sql .= ' f.fk_user_author, f.fk_multicurrency, f.multicurrency_code, f.multicurrency_tx, f.multicurrency_total_ht, f.multicurrency_total_tva,'; $sql .= ' f.multicurrency_total_tva, f.multicurrency_total_ttc,'; - $sql .= ' s.rowid, s.nom, s.name_alias, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,'; + $sql .= ' s.rowid, s.nom, s.name_alias, s.email, s.phone, s.fax, s.address, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,'; $sql .= ' typent.code,'; $sql .= ' state.code_departement, state.nom,'; $sql .= ' country.code,'; @@ -1539,16 +1539,22 @@ if ($resql) { $facturestatic->situation_cycle_ref = $obj->situation_cycle_ref; $facturestatic->situation_counter = $obj->situation_counter; } - $thirdpartystatic->id = $obj->socid; - $thirdpartystatic->name = $obj->name; - $thirdpartystatic->client = $obj->client; - $thirdpartystatic->fournisseur = $obj->fournisseur; - $thirdpartystatic->code_client = $obj->code_client; - $thirdpartystatic->code_compta_client = $obj->code_compta_client; - $thirdpartystatic->code_fournisseur = $obj->code_fournisseur; - $thirdpartystatic->code_compta_fournisseur = $obj->code_compta_fournisseur; - $thirdpartystatic->email = $obj->email; - $thirdpartystatic->country_code = $obj->country_code; + $companystatic->id = $obj->socid; + $companystatic->name = $obj->name; + $companystatic->name_alias = $obj->alias; + $companystatic->client = $obj->client; + $companystatic->fournisseur = $obj->fournisseur; + $companystatic->code_client = $obj->code_client; + $companystatic->code_compta_client = $obj->code_compta_client; + $companystatic->code_fournisseur = $obj->code_fournisseur; + $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur; + $companystatic->email = $obj->email; + $companystatic->phone = $obj->phone; + $companystatic->fax = $obj->fax; + $companystatic->address = $obj->address; + $companystatic->zip = $obj->zip; + $companystatic->town = $obj->town; + $companystatic->country_code = $obj->country_code; $projectstatic->id = $obj->project_id; $projectstatic->ref = $obj->project_ref; @@ -1570,10 +1576,10 @@ if ($resql) { $multicurrency_remaintopay = 0; } if ($facturestatic->type == Facture::TYPE_CREDIT_NOTE && $obj->paye == 1) { // If credit note closed, we take into account the amount not yet consummed - $remaincreditnote = $discount->getAvailableDiscounts($thirdpartystatic, '', 'rc.fk_facture_source='.$facturestatic->id); + $remaincreditnote = $discount->getAvailableDiscounts($companystatic, '', 'rc.fk_facture_source='.$facturestatic->id); $remaintopay = -$remaincreditnote; $totalpay = price2num($facturestatic->total_ttc - $remaintopay); - $multicurrency_remaincreditnote = $discount->getAvailableDiscounts($thirdpartystatic, '', 'rc.fk_facture_source='.$facturestatic->id, 0, 0, 1); + $multicurrency_remaincreditnote = $discount->getAvailableDiscounts($companystatic, '', 'rc.fk_facture_source='.$facturestatic->id, 0, 0, 1); $multicurrency_remaintopay = -$multicurrency_remaincreditnote; $multicurrency_totalpay = price2num($facturestatic->multicurrency_total_ttc - $multicurrency_remaintopay); } @@ -1704,9 +1710,9 @@ if ($resql) { if (!empty($arrayfields['s.nom']['checked'])) { print ''; if ($contextpage == 'poslist') { - print $thirdpartystatic->name; + print $companystatic->name; } else { - print $thirdpartystatic->getNomUrl(1, 'customer'); + print $companystatic->getNomUrl(1, 'customer'); } print ''; if (!$i) { diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index a9f17f5439b..7edc94a0a8c 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -297,7 +297,7 @@ if (empty($reshook)) { * View */ -$socstatic = new Societe($db); +$companystatic = new Societe($db); $form = new Form($db); $formother = new FormOther($db); $formproject = new FormProjets($db); @@ -330,12 +330,13 @@ if (count($listofprojectcontacttype) == 0) { } $distinct = 'DISTINCT'; // We add distinct until we are added a protection to be sure a contact of a project and task is only once. -$sql = "SELECT ".$distinct." p.rowid as id, p.ref, p.title, p.fk_statut as status, p.fk_opp_status, p.public, p.fk_user_creat"; -$sql .= ", p.datec as date_creation, p.dateo as date_start, p.datee as date_end, p.opp_amount, p.opp_percent, (p.opp_amount*p.opp_percent/100) as opp_weighted_amount, p.tms as date_update, p.budget_amount "; -$sql .= ", p.usage_opportunity, p.usage_task, p.usage_bill_time, p.usage_organize_event"; -$sql .= ", accept_conference_suggestions, accept_booth_suggestions, price_registration, price_booth"; -$sql .= ", s.rowid as socid, s.nom as name, s.email"; -$sql .= ", cls.code as opp_status_code"; +$sql = "SELECT ".$distinct." p.rowid as id, p.ref, p.title, p.fk_statut as status, p.fk_opp_status, p.public, p.fk_user_creat,"; +$sql .= " p.datec as date_creation, p.dateo as date_start, p.datee as date_end, p.opp_amount, p.opp_percent, (p.opp_amount*p.opp_percent/100) as opp_weighted_amount, p.tms as date_update, p.budget_amount,"; +$sql .= " p.usage_opportunity, p.usage_task, p.usage_bill_time, p.usage_organize_event,"; +$sql .= " accept_conference_suggestions, accept_booth_suggestions, price_registration, price_booth,"; +$sql .= " s.rowid as socid, s.nom as name, s.name_alias as alias, s.email, s.email, s.phone, s.fax, s.address, s.town, s.zip, s.fk_pays, s.client, s.code_client,"; +$sql .= " country.code as country_code,"; +$sql .= " cls.code as opp_status_code"; // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { @@ -355,6 +356,7 @@ if (is_array($extrafields->attributes[$object->table_element]['label']) && count $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (p.rowid = ef.fk_object)"; } $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid"; +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_lead_status as cls on p.fk_opp_status = cls.rowid"; // We'll need this table joined to the select in order to filter by sale // No check is done on company permission because readability is managed by public status of project and assignement. @@ -978,9 +980,17 @@ while ($i < min($num, $limit)) { $userAccess = $object->restrictedProjectArea($user); // why this ? if ($userAccess >= 0) { - $socstatic->id = $obj->socid; - $socstatic->name = $obj->name; - $socstatic->email = $obj->email; + $companystatic->id = $obj->socid; + $companystatic->name = $obj->name; + $companystatic->name_alias = $obj->alias; + $companystatic->client = $obj->client; + $companystatic->code_client = $obj->code_client; + $companystatic->email = $obj->email; + $companystatic->phone = $obj->phone; + $companystatic->address = $obj->address; + $companystatic->zip = $obj->zip; + $companystatic->town = $obj->town; + $companystatic->country_code = $obj->country_code; print ''; @@ -1009,7 +1019,7 @@ while ($i < min($num, $limit)) { if (!empty($arrayfields['s.nom']['checked'])) { print ''; if ($obj->socid) { - print $socstatic->getNomUrl(1); + print $companystatic->getNomUrl(1); } else { print ' '; } @@ -1022,9 +1032,9 @@ while ($i < min($num, $limit)) { if (!empty($arrayfields['commercial']['checked'])) { print ''; if ($obj->socid) { - $socstatic->id = $obj->socid; - $socstatic->name = $obj->name; - $listsalesrepresentatives = $socstatic->getSalesRepresentatives($user); + $companystatic->id = $obj->socid; + $companystatic->name = $obj->name; + $listsalesrepresentatives = $companystatic->getSalesRepresentatives($user); $nbofsalesrepresentative = count($listsalesrepresentatives); if ($nbofsalesrepresentative > 6) { // We print only number From ba0e95a4ff6ffa6b085628d1477c838e480597b5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 17 May 2021 23:47:16 +0200 Subject: [PATCH 0098/1497] FIX huntr CWE-79 --- htdocs/core/lib/functions.lib.php | 22 ++++++---- htdocs/main.inc.php | 29 ++++++++++++- test/phpunit/SecurityTest.php | 68 +++++++++++++++++++++---------- 3 files changed, 86 insertions(+), 33 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 8251c850ddf..a987cf03e4c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -634,17 +634,17 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null $out = checkVal($out, $check, $filter, $options); } - // Sanitizing for special parameters. There is no reason to allow the backtopage, backtolist or backtourl parameter to contains an external URL. + // Sanitizing for special parameters. + // Note: There is no reason to allow the backtopage, backtolist or backtourl parameter to contains an external URL. if ($paramname == 'backtopage' || $paramname == 'backtolist' || $paramname == 'backtourl') { - $out = str_replace('\\', '/', $out); - $out = str_replace(array(':', ';', '@'), '', $out); - + $out = str_replace('\\', '/', $out); // Can be before the loop because only 1 char is replaced. No risk to get it after other replacements. + $out = str_replace(array(':', ';', '@'), '', $out); // Can be before the loop because only 1 char is replaced. No risk to get it after other replacements. do { $oldstringtoclean = $out; $out = str_ireplace(array('javascript', 'vbscript', '&colon', '&#'), '', $out); } while ($oldstringtoclean != $out); - $out = preg_replace(array('/^[a-z]*\/\/+/i'), '', $out); + $out = preg_replace(array('/^[a-z]*\/\/+/i'), '', $out); // We remove schema*// to remove external URL } // Code for search criteria persistence. @@ -684,7 +684,7 @@ function GETPOSTINT($paramname, $method = 0, $filter = null, $options = null, $n } /** - * Return a value after checking on a rule. + * Return a value after checking on a rule. A sanitization may also have been done. * * @param string $out Value to check/clear. * @param string $check Type of check/sanitizing @@ -777,6 +777,11 @@ function checkVal($out = '', $check = 'alphanohtml', $filter = null, $options = case 'restricthtml': // Recommended for most html textarea do { $oldstringtoclean = $out; + + // We replace chars encoded with numeric HTML entities with real char (to avoid to have numeric entities used for obfuscation of injections) + $out = preg_replace_callback('/&#(x?[0-9][0-9a-f]+);/i', 'realCharForNumericEntities', $out); + $out = preg_replace('/&#x?[0-9]+/i', '', $out); // For example if we have javascript with an entities without the ; to hide the 'a' of 'javascript'. + $out = dol_string_onlythesehtmltags($out, 0, 1, 1); // We should also exclude non expected attributes @@ -797,7 +802,6 @@ function checkVal($out = '', $check = 'alphanohtml', $filter = null, $options = } - if (!function_exists('dol_getprefix')) { /** * Return a prefix to use for this Dolibarr instance, for session/cookie names or email id. @@ -9738,8 +9742,8 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url = /** * Add space between dolGetButtonTitle * - * @param string $moreClass more css class label - * @return string html of title separator + * @param string $moreClass more css class label + * @return string html of title separator */ function dolGetButtonTitleSeparator($moreClass = "") { diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index c9a7dd21ccc..7b40647ebcb 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -50,9 +50,33 @@ if (!empty($_SERVER['MAIN_SHOW_TUNING_INFO'])) { } } + +/** + * Return the real char for a numeric entities. + * This function is required by testSqlAndScriptInject(). + * + * @param string $matches String of numeric entity + * @return string New value + */ +function realCharForNumericEntities($matches) +{ + $newstringnumentity = $matches[1]; + + if (preg_match('/^x/i', $newstringnumentity)) { + $newstringnumentity = hexdec(preg_replace('/^x/i', '', $newstringnumentity)); + } + + // The numeric value we don't want as entities + if (($newstringnumentity >= 65 && $newstringnumentity <= 90) || ($newstringnumentity >= 97 && $newstringnumentity <= 122)) { + return chr((int) $newstringnumentity); + } + + return '&#'.$matches[1]; +} + /** * Security: WAF layer for SQL Injection and XSS Injection (scripts) protection (Filters on GET, POST, PHP_SELF). - * Warning: Such a protection can't be enough. It is not reliable as it will alwyas be possible to bypass this. Good protection can + * Warning: Such a protection can't be enough. It is not reliable as it will always be possible to bypass this. Good protection can * only be guaranted by escaping data during output. * * @param string $val Value brut found int $_GET, $_POST or PHP_SELF @@ -61,7 +85,7 @@ if (!empty($_SERVER['MAIN_SHOW_TUNING_INFO'])) { */ function testSqlAndScriptInject($val, $type) { - // Decode string first bcause a lot of things are obfuscated by encoding or multiple encoding. + // Decode string first because a lot of things are obfuscated by encoding or multiple encoding. // So assertEquals($expectedresult, $result, 'Error on testSqlAndScriptInject expected 0b'); - // Should detect XSS + + // Should detect attack $expectedresult=1; $_SERVER["PHP_SELF"]='/DIR WITH SPACE/htdocs/admin/index.php/'; $result=testSqlAndScriptInject($_SERVER["PHP_SELF"], 2); $this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on testSqlAndScriptInject for PHP_SELF that should detect XSS'); + $test = 'javascript:'; + $result=testSqlAndScriptInject($test, 0); + $this->assertEquals($expectedresult, $result, 'Error on testSqlAndScriptInject for javascript1. Should find an attack and did not.'); + + $test = 'javascript:'; + $result=testSqlAndScriptInject($test, 0); + $this->assertEquals($expectedresult, $result, 'Error on testSqlAndScriptInject for javascript2. Should find an attack and did not.'); + $test = 'javascript&colon;alert(1)'; $result=testSqlAndScriptInject($test, 0); - $this->assertEquals($expectedresult, $result, 'Error on testSqlAndScriptInject expected 1a'); + $this->assertEquals($expectedresult, $result, 'Error on testSqlAndScriptInject for javascript2'); $test=""; $result=testSqlAndScriptInject($test, 0); - $this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on testSqlAndScriptInject aaa'); + $this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on testSqlAndScriptInject aaa1'); $test=""; $result=testSqlAndScriptInject($test, 2); @@ -328,9 +337,12 @@ class SecurityTest extends PHPUnit\Framework\TestCase $_POST["param10"]='is_object($object) ? ($object->id < 10 ? round($object->id / 2, 2) : (2 * $user->id) * (int) substr($mysoc->zip, 1, 2)) : \'objnotdefined\''; $_POST["param11"]=' Name '; $_POST["param12"]='aaa'; + $_POST["param13"]='n n > < " XSS'; + $_POST["param13b"]='n n > < " XSS'; //$_POST["param13"]='javascript%26colon%26%23x3B%3Balert(1)'; //$_POST["param14"]='javascripT&javascript#x3a alert(1)'; + $result=GETPOST('id', 'int'); // Must return nothing print __METHOD__." result=".$result."\n"; $this->assertEquals($result, ''); @@ -343,7 +355,7 @@ class SecurityTest extends PHPUnit\Framework\TestCase print __METHOD__." result=".$result."\n"; $this->assertEquals($result, 333, 'Test on param1 with 3rd param = 2'); - // Test alpha + // Test with alpha $result=GETPOST("param2", 'alpha'); print __METHOD__." result=".$result."\n"; @@ -357,7 +369,7 @@ class SecurityTest extends PHPUnit\Framework\TestCase print __METHOD__." result=".$result."\n"; $this->assertEquals($result, 'dir'); - // Test aZ09 + // Test with aZ09 $result=GETPOST("param1", 'aZ09'); print __METHOD__." result=".$result."\n"; @@ -379,25 +391,22 @@ class SecurityTest extends PHPUnit\Framework\TestCase print __METHOD__." result=".$result."\n"; $this->assertEquals($_GET["param5"], $result); - $result=GETPOST("param6", 'alpha'); - print __METHOD__." result=".$result."\n"; - $this->assertEquals('>', $result); + // Test with nohtml $result=GETPOST("param6", 'nohtml'); print __METHOD__." result=".$result."\n"; $this->assertEquals('">', $result); - $result=GETPOST("param6b"); + // Test with alpha = alphanohtml. We must convert the html entities like n and disable all entities + + $result=GETPOST("param6", 'alphanohtml'); + print __METHOD__." result=".$result."\n"; + $this->assertEquals('>', $result); + + $result=GETPOST("param6b", 'alphanohtml'); print __METHOD__." result=".$result."\n"; $this->assertEquals('abc', $result); - // With restricthtml we must remove html open/close tag and content but not htmlentities like n - - $result=GETPOST("param7", 'restricthtml'); - print __METHOD__." result=".$result."\n"; - $this->assertEquals('"c:\this is a path~1\aaan" abcdef', $result); - - // With alphanohtml, we must convert the html entities like n and disable all entities $result=GETPOST("param8a", 'alphanohtml'); print __METHOD__." result=".$result."\n"; $this->assertEquals("Hackersvg onload='console.log(123)'", $result); @@ -434,24 +443,39 @@ class SecurityTest extends PHPUnit\Framework\TestCase print __METHOD__." result=".$result."\n"; $this->assertEquals("Name", $result, 'Test an email string with alphanohtml'); + $result=GETPOST("param13", 'alphanohtml'); + print __METHOD__." result=".$result."\n"; + $this->assertEquals('n n > < XSS', $result, 'Test that html entities are decoded with alpha'); + + // Test with alphawithlgt + $result=GETPOST("param11", 'alphawithlgt'); print __METHOD__." result=".$result."\n"; $this->assertEquals(trim($_POST["param11"]), $result, 'Test an email string with alphawithlgt'); + // Test with restricthtml we must remove html open/close tag and content but not htmlentities (we can decode html entities for ascii chars like n) + + $result=GETPOST("param6", 'restricthtml'); + print __METHOD__." result=".$result."\n"; + $this->assertEquals('">', $result); + + $result=GETPOST("param7", 'restricthtml'); + print __METHOD__." result=".$result."\n"; + $this->assertEquals('"c:\this is a path~1\aaan" abcdef', $result); + $result=GETPOST("param12", 'restricthtml'); print __METHOD__." result=".$result."\n"; $this->assertEquals(trim($_POST["param12"]), $result, 'Test a string with DOCTYPE and restricthtml'); - /*$result=GETPOST("param13", 'alphanohtml'); + $result=GETPOST("param13", 'restricthtml'); print __METHOD__." result=".$result."\n"; - $this->assertEquals(trim($_POST["param13"]), $result, 'Test a string and alphanohtml'); + $this->assertEquals('n n > < " XSS', $result, 'Test that HTML entities are decoded with restricthtml, but only for common alpha chars'); - $result=GETPOST("param14", 'alphanohtml'); + $result=GETPOST("param13b", 'restricthtml'); print __METHOD__." result=".$result."\n"; - $this->assertEquals(trim($_POST["param14"]), $result, 'Test a string and alphanohtml'); - */ + $this->assertEquals('n n > < " XSS', $result, 'Test that HTML entities are decoded with restricthtml, but only for common alpha chars'); - // Special test for GETPOST of backtopage or backtolist parameter + // Special test for GETPOST of backtopage, backtolist or backtourl parameter $_POST["backtopage"]='//www.google.com'; $result=GETPOST("backtopage"); From 6fe9fe330d8a2618801910e7c1f056fee10edfa3 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Mon, 17 May 2021 23:54:31 +0200 Subject: [PATCH 0099/1497] delete fetch --- htdocs/comm/propal/list.php | 16 ++++++++++++++-- htdocs/commande/list.php | 22 +++++++++++++++++----- htdocs/compta/facture/list.php | 25 +++++++++++++++++++------ 3 files changed, 50 insertions(+), 13 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index f086616cada..656d15114b9 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -470,7 +470,7 @@ $sql .= ' p.datec as date_creation, p.tms as date_update, p.date_cloture as date $sql .= ' p.note_public, p.note_private,'; $sql .= ' p.fk_cond_reglement,p.fk_mode_reglement,p.fk_shipping_method,p.fk_input_reason,'; $sql .= " pr.rowid as project_id, pr.ref as project_ref, pr.title as project_label,"; -$sql .= ' u.login'; +$sql .= ' u.login, u.lastname, u.firstname, u.email, u.statut, u.entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender'; if (!$user->rights->societe->client->voir && !$socid) { $sql .= ", sc.fk_soc, sc.fk_user"; } @@ -1692,7 +1692,19 @@ if ($resql) { } } - $userstatic->fetch($obj->fk_user_author); + $userstatic->id = $obj->fk_user_author; + $userstatic->login = $obj->login; + $userstatic->lastname = $obj->lastname; + $userstatic->firstname = $obj->firstname; + $userstatic->email = $obj->email; + $userstatic->statut = $obj->statut; + $userstatic->entity = $obj->entity; + $userstatic->photo = $obj->photo; + $userstatic->office_phone = $obj->office_phone; + $userstatic->office_fax = $obj->office_fax; + $userstatic->user_mobile = $obj->user_mobile; + $userstatic->job = $obj->job; + $userstatic->gender = $obj->gender; // Author if (!empty($arrayfields['u.login']['checked'])) { diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index e441f4e2a57..64d41039e93 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -424,10 +424,10 @@ $sql .= ' c.rowid, c.ref, c.total_ht, c.total_tva, c.total_ttc, c.ref_client, c. $sql .= ' c.fk_multicurrency, c.multicurrency_code, c.multicurrency_tx, c.multicurrency_total_ht, c.multicurrency_total_tva as multicurrency_total_vat, c.multicurrency_total_ttc,'; $sql .= ' c.date_valid, c.date_commande, c.note_public, c.note_private, c.date_livraison as date_delivery, c.fk_statut, c.facture as billed,'; $sql .= ' c.date_creation as date_creation, c.tms as date_update, c.date_cloture as date_cloture,'; -$sql .= " p.rowid as project_id, p.ref as project_ref, p.title as project_label,"; -$sql .= " u.login,"; -$sql .= ' c.fk_cond_reglement,c.fk_mode_reglement,c.fk_shipping_method'; -$sql .= ' ,c.fk_input_reason'; +$sql .= ' p.rowid as project_id, p.ref as project_ref, p.title as project_label,'; +$sql .= ' u.login, u.lastname, u.firstname, u.email, u.statut, u.entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender,'; +$sql .= ' c.fk_cond_reglement,c.fk_mode_reglement,c.fk_shipping_method,'; +$sql .= ' c.fk_input_reason'; if ($search_categ_cus) { $sql .= ", cc.fk_categorie, cc.fk_soc"; } @@ -1667,7 +1667,19 @@ if ($resql) { } } - $userstatic->fetch($obj->fk_user_author); + $userstatic->id = $obj->fk_user_author; + $userstatic->login = $obj->login; + $userstatic->lastname = $obj->lastname; + $userstatic->firstname = $obj->firstname; + $userstatic->email = $obj->email; + $userstatic->statut = $obj->statut; + $userstatic->entity = $obj->entity; + $userstatic->photo = $obj->photo; + $userstatic->office_phone = $obj->office_phone; + $userstatic->office_fax = $obj->office_fax; + $userstatic->user_mobile = $obj->user_mobile; + $userstatic->job = $obj->job; + $userstatic->gender = $obj->gender; // Author if (!empty($arrayfields['u.login']['checked'])) { diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index f60cec54cbb..fa703336a84 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -482,11 +482,11 @@ $sql .= ' f.paye as paye, f.fk_statut, f.close_code,'; $sql .= ' f.datec as date_creation, f.tms as date_update, f.date_closing as date_closing,'; $sql .= ' f.retained_warranty, f.retained_warranty_date_limit, f.situation_final, f.situation_cycle_ref, f.situation_counter,'; $sql .= ' s.rowid as socid, s.nom as name, s.name_alias as name_alias, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur,'; -$sql .= " typent.code as typent_code,"; -$sql .= " state.code_departement as state_code, state.nom as state_name,"; -$sql .= " country.code as country_code,"; -$sql .= " p.rowid as project_id, p.ref as project_ref, p.title as project_label,"; -$sql .= " u.login"; +$sql .= ' typent.code as typent_code,'; +$sql .= ' state.code_departement as state_code, state.nom as state_name,'; +$sql .= ' country.code as country_code,'; +$sql .= ' p.rowid as project_id, p.ref as project_ref, p.title as project_label,'; +$sql .= ' u.login, u.lastname, u.firstname, u.email, u.statut, u.entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender'; // We need dynamount_payed to be able to sort on status (value is surely wrong because we can count several lines several times due to other left join or link with contacts. But what we need is just 0 or > 0) // TODO Better solution to be able to sort on already payed or remain to pay is to store amount_payed in a denormalized field. if (!$sall) { @@ -1878,9 +1878,22 @@ if ($resql) { $totalarray['val']['f.total_ttc'] += $obj->total_ttc; } + $userstatic->id = $obj->fk_user_author; + $userstatic->login = $obj->login; + $userstatic->lastname = $obj->lastname; + $userstatic->firstname = $obj->firstname; + $userstatic->email = $obj->email; + $userstatic->statut = $obj->statut; + $userstatic->entity = $obj->entity; + $userstatic->photo = $obj->photo; + $userstatic->office_phone = $obj->office_phone; + $userstatic->office_fax = $obj->office_fax; + $userstatic->user_mobile = $obj->user_mobile; + $userstatic->job = $obj->job; + $userstatic->gender = $obj->gender; + // Author if (!empty($arrayfields['u.login']['checked'])) { - $userstatic->fetch($obj->fk_user_author); print ''; if ($userstatic->id) { print $userstatic->getNomUrl(-1); From b6dbe45242a1b1e9303b6103bf68e53535b85ad5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 May 2021 01:58:54 +0200 Subject: [PATCH 0100/1497] Fix permissions on page to move position of file --- htdocs/adherents/document.php | 2 ++ htdocs/asset/document.php | 14 ++++++----- htdocs/bom/bom_document.php | 2 ++ htdocs/comm/action/document.php | 2 ++ htdocs/comm/propal/document.php | 2 ++ htdocs/commande/document.php | 14 ++++++----- htdocs/compta/facture/document.php | 2 ++ htdocs/core/actions_linkedfiles.inc.php | 11 +++++---- htdocs/core/ajax/row.php | 24 +++++++++++++------ htdocs/core/lib/security.lib.php | 2 +- .../template/myobject_document.php | 2 +- htdocs/product/document.php | 4 ++-- htdocs/projet/document.php | 10 ++++---- htdocs/societe/document.php | 1 + htdocs/ticket/agenda.php | 5 +--- htdocs/ticket/card.php | 4 ++-- htdocs/ticket/contact.php | 23 ++++++++++++++---- htdocs/ticket/document.php | 20 ++++++++++++---- htdocs/ticket/messaging.php | 9 +++---- 19 files changed, 98 insertions(+), 55 deletions(-) diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php index 5150bea861e..f2a7c6f3f55 100644 --- a/htdocs/adherents/document.php +++ b/htdocs/adherents/document.php @@ -93,6 +93,8 @@ if ($id) { $caneditfieldmember = $user->rights->adherent->creer; } +$permissiontoadd = $canaddmember; + // Security check $result = restrictedArea($user, 'adherent', $object->id, '', '', 'socid', 'rowid', 0); diff --git a/htdocs/asset/document.php b/htdocs/asset/document.php index e6f5ed9b353..91e46269994 100644 --- a/htdocs/asset/document.php +++ b/htdocs/asset/document.php @@ -40,12 +40,6 @@ $socid = GETPOST('socid', 'int'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); -// Security check -if ($user->socid) { - $socid = $user->socid; -} -$result=restrictedArea($user, 'asset', $id, ''); - // Get parameters $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); @@ -69,6 +63,14 @@ if ($object->fetch($id)) { $upload_dir = $conf->asset->dir_output."/".dol_sanitizeFileName($object->ref); } +$permissiontoadd = $user->rights->asset->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php + +// Security check +if ($user->socid) { + $socid = $user->socid; +} +$result=restrictedArea($user, 'asset', $id, ''); + /* * Actions diff --git a/htdocs/bom/bom_document.php b/htdocs/bom/bom_document.php index c0196670cfb..e59b22c45b2 100644 --- a/htdocs/bom/bom_document.php +++ b/htdocs/bom/bom_document.php @@ -85,6 +85,8 @@ if ($id > 0 || !empty($ref)) { $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); restrictedArea($user, 'bom', $object->id, 'bom_bom', '', '', 'rowid', $isdraft); +$permissiontoadd = $user->rights->bom->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php + /* * Actions diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index f521fa2ab59..c55d4e114cc 100644 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -88,6 +88,8 @@ if ($user->socid && $socid) { $result = restrictedArea($user, 'societe', $socid); } +$permissiontoadd = $user->rights->agenda->myactions->read; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php + /* * Actions diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index 4e592c8371e..2b21c545c63 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -80,6 +80,8 @@ if (!$sortfield) { $object = new Propal($db); $object->fetch($id, $ref); +$permissiontoadd = $user->rights->propale->creer; + // Security check if (!empty($user->socid)) { $socid = $user->socid; diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index b4dddc9a1bf..c289112ee9f 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -44,12 +44,6 @@ $confirm = GETPOST('confirm'); $id = GETPOST('id', 'int'); $ref = GETPOST('ref'); -// Security check -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'commande', $id, ''); - // Get parameters $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); @@ -78,6 +72,14 @@ if (!$sortfield) { $object = new Commande($db); +$permissiontoadd = $user->rights->commande->creer; + +// Security check +if ($user->socid) { + $socid = $user->socid; +} +$result = restrictedArea($user, 'commande', $id, ''); + /* * Actions diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index 664b84d4444..16cdee4ac53 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -72,6 +72,8 @@ if ($object->fetch($id, $ref)) { $upload_dir = $conf->facture->dir_output."/".dol_sanitizeFileName($object->ref); } +$permissiontoadd = $user->rights->facture->creer; + // Security check if ($user->socid) { $socid = $user->socid; diff --git a/htdocs/core/actions_linkedfiles.inc.php b/htdocs/core/actions_linkedfiles.inc.php index 13814511297..750ed2b2d9a 100644 --- a/htdocs/core/actions_linkedfiles.inc.php +++ b/htdocs/core/actions_linkedfiles.inc.php @@ -21,13 +21,14 @@ // Variable $upload_dir must be defined when entering here. // Variable $upload_dirold may also exists. // Variable $confirm must be defined. +// If variable $permissiontoadd is defined, we check it is true. Note: A test on permission should already have been done into the restrictedArea() method called by parent page. //var_dump($upload_dir); //var_dump($upload_dirold); // Submit file/link -if (GETPOST('sendit', 'alpha') && !empty($conf->global->MAIN_UPLOAD_DOC)) { +if (GETPOST('sendit', 'alpha') && !empty($conf->global->MAIN_UPLOAD_DOC) && (!isset($permissiontoadd) || $permissiontoadd)) { if (!empty($_FILES)) { if (is_array($_FILES['userfile']['tmp_name'])) { $userfiles = $_FILES['userfile']['tmp_name']; @@ -65,7 +66,7 @@ if (GETPOST('sendit', 'alpha') && !empty($conf->global->MAIN_UPLOAD_DOC)) { } } } -} elseif (GETPOST('linkit', 'restricthtml') && !empty($conf->global->MAIN_UPLOAD_DOC)) { +} elseif (GETPOST('linkit', 'restricthtml') && !empty($conf->global->MAIN_UPLOAD_DOC) && (!isset($permissiontoadd) || $permissiontoadd)) { $link = GETPOST('link', 'alpha'); if ($link) { if (substr($link, 0, 7) != 'http://' && substr($link, 0, 8) != 'https://' && substr($link, 0, 7) != 'file://' && substr($link, 0, 7) != 'davs://') { @@ -77,7 +78,7 @@ if (GETPOST('sendit', 'alpha') && !empty($conf->global->MAIN_UPLOAD_DOC)) { // Delete file/link -if ($action == 'confirm_deletefile' && $confirm == 'yes') { +if ($action == 'confirm_deletefile' && $confirm == 'yes' && (!isset($permissiontoadd) || $permissiontoadd)) { $urlfile = GETPOST('urlfile', 'alpha', 0, null, null, 1); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). if (GETPOST('section', 'alpha')) { // For a delete from the ECM module, upload_dir is ECM root dir and urlfile contains relative path from upload_dir @@ -149,7 +150,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes') { exit; } } -} elseif ($action == 'confirm_updateline' && GETPOST('save', 'alpha') && GETPOST('link', 'alpha')) { +} elseif ($action == 'confirm_updateline' && GETPOST('save', 'alpha') && GETPOST('link', 'alpha') && (!isset($permissiontoadd) || $permissiontoadd)) { require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; $langs->load('link'); $link = new Link($db); @@ -167,7 +168,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes') { } else { //error fetching } -} elseif ($action == 'renamefile' && GETPOST('renamefilesave', 'alpha')) { +} elseif ($action == 'renamefile' && GETPOST('renamefilesave', 'alpha') && (!isset($permissiontoadd) || $permissiontoadd)) { // For documents pages, upload_dir contains already path to file from module dir, so we clean path into urlfile. if (!empty($upload_dir)) { $filenamefrom = dol_sanitizeFileName(GETPOST('renamefilefrom', 'alpha'), '_', 0); // Do not remove accents diff --git a/htdocs/core/ajax/row.php b/htdocs/core/ajax/row.php index 4662c3a1406..96dc792938f 100644 --- a/htdocs/core/ajax/row.php +++ b/htdocs/core/ajax/row.php @@ -49,6 +49,9 @@ if (!defined('NOREQUIRETRAN')) { require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/genericobject.class.php'; +// Security check +// This is done later into view. + /* * View @@ -59,16 +62,16 @@ top_httphead(); print ''."\n"; // Registering the location of boxes -if (GETPOST('roworder', 'alpha', 2) && GETPOST('table_element_line', 'aZ09', 2) - && GETPOST('fk_element', 'aZ09', 2) && GETPOST('element_id', 'int', 2)) { - $roworder = GETPOST('roworder', 'alpha', 2); - $table_element_line = GETPOST('table_element_line', 'aZ09', 2); - $fk_element = GETPOST('fk_element', 'aZ09', 2); - $element_id = GETPOST('element_id', 'int', 2); +if (GETPOST('roworder', 'alpha', 3) && GETPOST('table_element_line', 'aZ09', 3) + && GETPOST('fk_element', 'aZ09', 3) && GETPOST('element_id', 'int', 3)) { + $roworder = GETPOST('roworder', 'alpha', 3); + $table_element_line = GETPOST('table_element_line', 'aZ09', 3); + $fk_element = GETPOST('fk_element', 'aZ09', 3); + $element_id = GETPOST('element_id', 'int', 3); dol_syslog("AjaxRow roworder=".$roworder." table_element_line=".$table_element_line." fk_element=".$fk_element." element_id=".$element_id, LOG_DEBUG); - // Make test on pemrission + // Make test on permission $perm = 0; if ($table_element_line == 'propaldet' && $user->rights->propal->creer) { $perm = 1; @@ -92,6 +95,10 @@ if (GETPOST('roworder', 'alpha', 2) && GETPOST('table_element_line', 'aZ09', 2) $perm = 1; } elseif ($table_element_line == 'facture_fourn_det' && $user->rights->fourn->facture->creer) { $perm = 1; + } elseif ($table_element_line == 'ecm_files' && $fk_element == 'fk_product' && (!empty($user->rights->produit->creer) || !empty($user->rights->service->creer))) { + $perm = 1; + } elseif ($table_element_line == 'ecm_files' && $fk_element == 'fk_ticket' && !empty($user->rights->ticket->write)) { + $perm = 1; } else { $tmparray = explode('_', $table_element_line); $tmpmodule = $tmparray[0]; $tmpobject = preg_replace('/line$/', '', $tmparray[1]); @@ -101,7 +108,10 @@ if (GETPOST('roworder', 'alpha', 2) && GETPOST('table_element_line', 'aZ09', 2) } if (! $perm) { + // We should not be here. If we are not allowed to reorder rows, feature should not be visible on script. + // If we are here, it is a hack attempt, so we report a warning. print 'Bad permission to modify position of lines for object in table '.$table_element_line; + dol_syslog('Bad permission to modify position of lines for object in table '.$table_element_line.', fk_element '.$fk_element, LOG_WARNING); accessforbidden('Bad permission to modify position of lines for object in table '.$table_element_line); } diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 1440a02983f..de4d67b1647 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -350,7 +350,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f // Check write permission from module (we need to know write permission to create but also to delete drafts record or to upload files) $createok = 1; $nbko = 0; - $wemustcheckpermissionforcreate = (GETPOST('sendit', 'alpha') || GETPOST('linkit', 'alpha') || GETPOST('action', 'aZ09') == 'create' || GETPOST('action', 'aZ09') == 'update'); + $wemustcheckpermissionforcreate = (GETPOST('sendit', 'alpha') || GETPOST('linkit', 'alpha') || GETPOST('action', 'aZ09') == 'create' || GETPOST('action', 'aZ09') == 'update') || GETPOST('roworder', 'alpha', 2); $wemustcheckpermissionfordeletedraft = ((GETPOST("action", "aZ09") == 'confirm_delete' && GETPOST("confirm", "aZ09") == 'yes') || GETPOST("action", "aZ09") == 'delete'); if ($wemustcheckpermissionforcreate || $wemustcheckpermissionfordeletedraft) { diff --git a/htdocs/modulebuilder/template/myobject_document.php b/htdocs/modulebuilder/template/myobject_document.php index 8598cc3dd18..e3fa6390e93 100644 --- a/htdocs/modulebuilder/template/myobject_document.php +++ b/htdocs/modulebuilder/template/myobject_document.php @@ -124,7 +124,7 @@ if ($id > 0 || !empty($ref)) { $upload_dir = $conf->mymodule->multidir_output[$object->entity ? $object->entity : $conf->entity]."/myobject/".get_exdir(0, 0, 0, 1, $object); } -$permissiontoadd = $user->rights->mymodule->myobject->write; // Used by the include of actions_addupdatedelete.inc.php +$permissiontoadd = $user->rights->mymodule->myobject->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php // Security check (enable the most restrictive one) //if ($user->socid > 0) accessforbidden(); diff --git a/htdocs/product/document.php b/htdocs/product/document.php index af44521dc05..372e3c19bdc 100644 --- a/htdocs/product/document.php +++ b/htdocs/product/document.php @@ -113,7 +113,7 @@ if ($reshook < 0) { if (empty($reshook)) { // Delete line if product propal merge is linked to a file if (!empty($conf->global->PRODUIT_PDF_MERGE_PROPAL)) { - if ($action == 'confirm_deletefile' && $confirm == 'yes') { + if ($action == 'confirm_deletefile' && $confirm == 'yes' && $permissiontoadd) { //extract file name $urlfile = GETPOST('urlfile', 'alpha'); $filename = basename($urlfile); @@ -131,7 +131,7 @@ if (empty($reshook)) { include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; } -if ($action == 'filemerge') { +if ($action == 'filemerge' && $permissiontoadd) { $is_refresh = GETPOST('refresh'); if (empty($is_refresh)) { $filetomerge_file_array = GETPOST('filetoadd'); diff --git a/htdocs/projet/document.php b/htdocs/projet/document.php index 3f9ec04d437..6bb905d6696 100644 --- a/htdocs/projet/document.php +++ b/htdocs/projet/document.php @@ -40,11 +40,6 @@ $ref = GETPOST('ref', 'alpha'); $mine = (GETPOST('mode', 'alpha') == 'mine' ? 1 : 0); //if (! $user->rights->projet->all->lire) $mine=1; // Special for projects -// Security check -$socid = 0; -//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement. -$result = restrictedArea($user, 'projet', $id, 'projet&project'); - $object = new Project($db); include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once @@ -82,6 +77,11 @@ if (!$sortfield) { $sortfield = "name"; } +// Security check +$socid = 0; +//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement. +$result = restrictedArea($user, 'projet', $id, 'projet&project'); + /* diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php index 4ed26f67018..653069882e0 100644 --- a/htdocs/societe/document.php +++ b/htdocs/societe/document.php @@ -76,6 +76,7 @@ if ($id > 0 || !empty($ref)) { // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('thirdpartydocument', 'globalcard')); +$permissiontoadd = $user->rights->societe->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php // Security check if ($user->socid > 0) { diff --git a/htdocs/ticket/agenda.php b/htdocs/ticket/agenda.php index 9bf6cbc13c4..fee91e959aa 100644 --- a/htdocs/ticket/agenda.php +++ b/htdocs/ticket/agenda.php @@ -81,12 +81,9 @@ if (!$action) { // Security check $id = GETPOST("id", 'int'); $socid = 0; -//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement. +if ($user->socid > 0) $socid = $user->socid; $result = restrictedArea($user, 'ticket', $id, ''); -if (!$user->rights->ticket->read) { - accessforbidden(); -} // restrict access for externals users if ($user->socid > 0 && ($object->fk_soc != $user->socid)) { accessforbidden(); diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index c4c637754b4..5e2ef1e804b 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -112,8 +112,8 @@ if ($id || $track_id || $ref) { $url_page_current = DOL_URL_ROOT.'/ticket/card.php'; // Security check - Protection if external user -//if ($user->socid > 0) accessforbidden(); -//if ($user->socid > 0) $socid = $user->socid; +$socid = 0; +if ($user->socid > 0) $socid = $user->socid; $result = restrictedArea($user, 'ticket', $object->id); $triggermodname = 'TICKET_MODIFY'; diff --git a/htdocs/ticket/contact.php b/htdocs/ticket/contact.php index 7e04dd12104..8d450ffb44b 100644 --- a/htdocs/ticket/contact.php +++ b/htdocs/ticket/contact.php @@ -50,11 +50,6 @@ $source = GETPOST('source', 'alpha'); $ligne = GETPOST('ligne', 'int'); $lineid = GETPOST('lineid', 'int'); -// Protection if external user -if ($user->socid > 0) { - $socid = $user->socid; - accessforbidden(); -} // Store current page url $url_page_current = dol_buildpath('/ticket/contact.php', 1); @@ -62,6 +57,24 @@ $url_page_current = dol_buildpath('/ticket/contact.php', 1); $object = new Ticket($db); +$permissiontoadd = $user->rights->ticket->write; + +// Security check +$id = GETPOST("id", 'int'); +$socid = 0; +if ($user->socid > 0) $socid = $user->socid; +$result = restrictedArea($user, 'ticket', $object->id, ''); + +// restrict access for externals users +if ($user->socid > 0 && ($object->fk_soc != $user->socid)) { + accessforbidden(); +} +// or for unauthorized internals users +if (!$user->socid && (!empty($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY) && $object->fk_user_assign != $user->id) && !$user->rights->ticket->manage) { + accessforbidden(); +} + + /* * Actions */ diff --git a/htdocs/ticket/document.php b/htdocs/ticket/document.php index 5e4d80cd8be..8edd2787c44 100644 --- a/htdocs/ticket/document.php +++ b/htdocs/ticket/document.php @@ -43,11 +43,6 @@ $track_id = GETPOST('track_id', 'alpha'); $action = GETPOST('action', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); -// Security check -if (!$user->rights->ticket->read) { - accessforbidden(); -} - // Get parameters $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); @@ -75,6 +70,21 @@ if ($result < 0) { $upload_dir = $conf->ticket->dir_output."/".dol_sanitizeFileName($object->ref); } +$permissiontoadd = $user->rights->ticket->write; + +// Security check - Protection if external user +$result = restrictedArea($user, 'ticket', $object->id); + +// restrict access for externals users +if ($user->socid > 0 && ($object->fk_soc != $user->socid)) { + accessforbidden(); +} +// or for unauthorized internals users +if (!$user->socid && ($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY && $object->fk_user_assign != $user->id) && !$user->rights->ticket->manage) { + accessforbidden(); +} + + /* * Actions diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php index c3e70def7da..68615424abf 100644 --- a/htdocs/ticket/messaging.php +++ b/htdocs/ticket/messaging.php @@ -76,16 +76,14 @@ if (!$action) { $action = 'view'; } +$permissiontoadd = $user->rights->ticket->write; // Security check $id = GETPOST("id", 'int'); $socid = 0; -//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement. -$result = restrictedArea($user, 'ticket', $id, ''); +if ($user->socid > 0) $socid = $user->socid; +$result = restrictedArea($user, 'ticket', $object->id, ''); -if (!$user->rights->ticket->read) { - accessforbidden(); -} // restrict access for externals users if ($user->socid > 0 && ($object->fk_soc != $user->socid)) { accessforbidden(); @@ -96,7 +94,6 @@ if (!$user->socid && (!empty($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY) && } - /* * Actions */ From f51e892a97a70c224fe37061ef46a4921ca660e8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 May 2021 02:06:35 +0200 Subject: [PATCH 0101/1497] Fix phpcs --- htdocs/admin/dict.php | 28 +++++++++++++-------------- htdocs/user/class/api_users.class.php | 6 +++--- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 2004ccf86b9..d03574d473b 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -869,13 +869,13 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) { $keycode = $value; } - if ($value == 'price' || preg_match('/^amount/i', $value)) { - $_POST[$keycode] = price2num(GETPOST($keycode), 'MU'); - } elseif ($value == 'taux' || $value == 'localtax1') { - $_POST[$keycode] = price2num(GETPOST($keycode), 8); // Note that localtax2 can be a list of rates separated by coma like X:Y:Z - } elseif ($value == 'entity') { - $_POST[$keycode] = getEntity($tabname[$id]); - } + if ($value == 'price' || preg_match('/^amount/i', $value)) { + $_POST[$keycode] = price2num(GETPOST($keycode), 'MU'); + } elseif ($value == 'taux' || $value == 'localtax1') { + $_POST[$keycode] = price2num(GETPOST($keycode), 8); // Note that localtax2 can be a list of rates separated by coma like X:Y:Z + } elseif ($value == 'entity') { + $_POST[$keycode] = getEntity($tabname[$id]); + } if ($i) { $sql .= ","; @@ -938,13 +938,13 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) { $keycode = $field; } - if ($field == 'price' || preg_match('/^amount/i', $field)) { - $_POST[$keycode] = price2num(GETPOST($keycode), 'MU'); - } elseif ($field == 'taux' || $field == 'localtax1') { - $_POST[$keycode] = price2num(GETPOST($keycode), 8); // Note that localtax2 can be a list of rates separated by coma like X:Y:Z - } elseif ($field == 'entity') { - $_POST[$keycode] = getEntity($tabname[$id]); - } + if ($field == 'price' || preg_match('/^amount/i', $field)) { + $_POST[$keycode] = price2num(GETPOST($keycode), 'MU'); + } elseif ($field == 'taux' || $field == 'localtax1') { + $_POST[$keycode] = price2num(GETPOST($keycode), 8); // Note that localtax2 can be a list of rates separated by coma like X:Y:Z + } elseif ($field == 'entity') { + $_POST[$keycode] = getEntity($tabname[$id]); + } if ($i) { $sql .= ","; diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index a21db2b521b..e760997f3c8 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -48,7 +48,7 @@ class Users extends DolibarrApi public function __construct() { global $db, $conf; - + $this->db = $db; $this->useraccount = new User($this->db); } @@ -73,8 +73,8 @@ class Users extends DolibarrApi global $conf; if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin)) { - throw new RestException(401, "You are not allowed to read list of users"); - } + throw new RestException(401, "You are not allowed to read list of users"); + } $obj_ret = array(); From 9b0988e7bed846e947a0ff48abc016ee091445dc Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 18 May 2021 08:40:28 +0200 Subject: [PATCH 0102/1497] FIX Social contrib. - Missing language file --- htdocs/compta/sociales/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index 2b0c3961759..db754390e5e 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -38,7 +38,7 @@ if (!empty($conf->projet->enabled)) { } // Load translation files required by the page -$langs->loadLangs(array('compta', 'banks', 'bills', 'hrm')); +$langs->loadLangs(array('compta', 'banks', 'bills', 'hrm', 'projects')); $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); From 078fc892a2b07a871a33c4bd01cc31f07027ca79 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Tue, 18 May 2021 09:01:55 +0200 Subject: [PATCH 0103/1497] FIX : cast int --- htdocs/fichinter/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 19dd7b59b3b..31fd0ea3152 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -288,7 +288,7 @@ if (!$user->rights->societe->client->voir && empty($socid)) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($socid) { - $sql .= " AND s.rowid = ".$socid; + $sql .= " AND s.rowid = ".((int) $socid); } if ($sall) { $sql .= natural_search(array_keys($fieldstosearchall), $sall); From 2771d50ffec7712f3b4977363d433905e9a4c190 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 May 2021 11:55:56 +0200 Subject: [PATCH 0104/1497] code comment --- htdocs/product/stock/replenish.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index fe16aca2783..48d8bf2033d 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -66,7 +66,7 @@ $fourn_id = GETPOST('fourn_id', 'int'); $fk_supplier = GETPOST('fk_supplier', 'int'); $fk_entrepot = GETPOST('fk_entrepot', 'int'); -//List all visible warehouses +// List all visible warehouses $resWar = $db->query("SELECT rowid FROM " . MAIN_DB_PREFIX . "entrepot WHERE entity IN (" . $db->sanitize(getEntity('stock')) .")"); $listofqualifiedwarehousesid = ""; $count = 0; @@ -103,6 +103,7 @@ if (!$sortorder) { $sortorder = 'ASC'; } +// Define virtualdiffersfromphysical $virtualdiffersfromphysical = 0; if (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) From 6170b28c3b1419468bbb9dd05c18b057d3cf0af8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 May 2021 11:58:49 +0200 Subject: [PATCH 0105/1497] FIx #17651 --- htdocs/product/stock/replenish.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 5d8e1f4a790..d316d6cdf98 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -48,7 +48,7 @@ $hookmanager->initHooks(array('stockreplenishlist')); //checks if a product has been ordered -$action = GETPOST('action', 'alpha'); +$action = GETPOST('action', 'aZ09'); $sref = GETPOST('sref', 'alpha'); $snom = GETPOST('snom', 'alpha'); $sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); @@ -308,7 +308,7 @@ if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entre $sql = 'SELECT p.rowid, p.ref, p.label, p.description, p.price,'; -$sql .= ' p.price_ttc, p.price_base_type,p.fk_product_type,'; +$sql .= ' p.price_ttc, p.price_base_type, p.fk_product_type,'; $sql .= ' p.tms as datem, p.duration, p.tobuy,'; $sql .= ' p.desiredstock, p.seuil_stock_alerte,'; if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) { @@ -326,11 +326,8 @@ $sql .= $hookmanager->resPrint; $sql .= ' FROM '.MAIN_DB_PREFIX.'product as p'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as s ON p.rowid = s.fk_product'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'entrepot AS ent ON s.fk_entrepot = ent.rowid AND ent.entity IN('.getEntity('stock').')'; -if ($fk_supplier > 0) { - $sql .= ' INNER JOIN '.MAIN_DB_PREFIX.'product_fournisseur_price pfp ON (pfp.fk_product = p.rowid AND pfp.fk_soc = '.$fk_supplier.')'; -} if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) { - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_warehouse_properties AS pse ON (p.rowid = pse.fk_product AND pse.fk_entrepot = '.$fk_entrepot.')'; + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_warehouse_properties AS pse ON (p.rowid = pse.fk_product AND pse.fk_entrepot = '.((int) $fk_entrepot).')'; } // Add fields from hooks @@ -352,6 +349,9 @@ if ($sref) $sql .= natural_search('p.ref', $sref); if ($snom) $sql .= natural_search('p.label', $snom); $sql .= ' AND p.tobuy = 1'; if (!empty($canvas)) $sql .= ' AND p.canvas = "'.$db->escape($canvas).'"'; +if ($fk_supplier > 0) { + $sql .= ' AND EXISTS (SELECT pfp.rowid FROM '.MAIN_DB_PREFIX.'product_fournisseur_price as pfp WHERE pfp.fk_product = p.rowid AND pfp.fk_soc = '.((int) $fk_supplier).' AND pfp.entity IN ('.getEntity('product_fournisseur_price').'))'; +} $sql .= ' GROUP BY p.rowid, p.ref, p.label, p.description, p.price'; $sql .= ', p.price_ttc, p.price_base_type,p.fk_product_type, p.tms'; $sql .= ', p.duration, p.tobuy'; @@ -762,7 +762,9 @@ while ($i < ($limit ? min($num, $limit) : $num)) print ''.$alertstock.''; // Current stock (all warehouses) - print ''.$warning.$stock.''; + print ''.$warning.$stock; + print ''; + print ''; // Already ordered print ''.$ordered.' '.$picto.''; From 495d2e79f4ecec7d61326e77c448638bdc5df9f5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 May 2021 12:35:30 +0200 Subject: [PATCH 0106/1497] Update html.form.class.php --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 55cb6270455..e70337e195d 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -8129,7 +8129,7 @@ class Form //if ($projectsListId) $sql.= " AND p.rowid IN (".$projectsListId.")"; //if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)"; //if ($socid > 0) $sql.= " AND (p.fk_soc=".$socid." OR p.fk_soc IS NULL)"; - $sql .= " GROUP BY f.ref, f.rowid, flabel,pid, p.title, p.fk_soc, p.fk_statut, p.public, name ORDER BY p.ref, f.ref ASC"; + $sql .= "ORDER BY p.ref, f.ref ASC"; $resql = $this->db->query($sql); if ($resql) From 0c4884bb2c492b6d5e85ab1369e960e352ff2c6b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 May 2021 12:44:56 +0200 Subject: [PATCH 0107/1497] Fix sql error --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index e70337e195d..945897856f2 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -8129,7 +8129,7 @@ class Form //if ($projectsListId) $sql.= " AND p.rowid IN (".$projectsListId.")"; //if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)"; //if ($socid > 0) $sql.= " AND (p.fk_soc=".$socid." OR p.fk_soc IS NULL)"; - $sql .= "ORDER BY p.ref, f.ref ASC"; + $sql .= " ORDER BY p.ref, f.ref ASC"; $resql = $this->db->query($sql); if ($resql) From 74f35177ff050351e431bd023b81a0496df138f7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 May 2021 13:20:14 +0200 Subject: [PATCH 0108/1497] Fix group by --- htdocs/compta/facture/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index ed4d36382f1..7c9b71e458b 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -719,7 +719,7 @@ if (!$sall) { $sql .= ' state.code_departement, state.nom,'; $sql .= ' country.code,'; $sql .= " p.rowid, p.ref, p.title,"; - $sql .= " u.login"; + $sql .= " u.login, u.lastname, u.firstname, u.email, u.statut, u.entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender"; if ($search_categ_cus) { $sql .= ", cc.fk_categorie, cc.fk_soc"; } From 7569275d284c4aa15820da512b5ae2a48d5ccf52 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 May 2021 13:36:07 +0200 Subject: [PATCH 0109/1497] Fix generation of invoice --- htdocs/langs/en_US/projects.lang | 2 ++ htdocs/projet/class/task.class.php | 4 ++-- htdocs/projet/tasks/time.php | 33 +++++++++++++++++++----------- 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 79c974f6e24..2fda7e1df0e 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -267,9 +267,11 @@ InvoiceToUse=Draft invoice to use NewInvoice=New invoice OneLinePerTask=One line per task OneLinePerPeriod=One line per period +OneLinePerTimeSpentLine=One line for each time spent declaration RefTaskParent=Ref. Parent Task ProfitIsCalculatedWith=Profit is calculated using AddPersonToTask=Add also to tasks UsageOrganizeEvent=Usage: Event Organization PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE=Classify project as closed when all its tasks are completed (100%% progress) PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE_help=Note: existing projects with all tasks at 100 %% progress won't be affected: you will have to close them manually. This option only affects open projects. +SelectLinesOfTimeSpentToInvoice=Select lines of time spent that are unbilled, then bulk action "Generate Invoice" to bill them \ No newline at end of file diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 0f84313b75a..0b8e21f5afd 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -1351,9 +1351,9 @@ class Task extends CommonObject } /** - * Load one record of time spent + * Load properties of timespent of a task from the time spent ID. * - * @param int $id Id object + * @param int $id Id in time spent table * @return int <0 if KO, >0 if OK */ public function fetchTimeSpent($id) diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 8cac9adfd05..01622a41945 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -192,10 +192,10 @@ if ($action == 'addtimespent' && $user->rights->projet->lire) { $object->timespent_duration = GETPOSTINT("timespent_durationhour") * 60 * 60; // We store duration in seconds $object->timespent_duration += (GETPOSTINT('timespent_durationmin') ? GETPOSTINT('timespent_durationmin') : 0) * 60; // We store duration in seconds if (GETPOST("timehour") != '' && GETPOST("timehour") >= 0) { // If hour was entered - $object->timespent_date = dol_mktime(GETPOST("timehour"), GETPOST("timemin"), 0, GETPOST("timemonth"), GETPOST("timeday"), GETPOST("timeyear")); + $object->timespent_date = dol_mktime(GETPOST("timehour", 'int'), GETPOST("timemin", 'int'), 0, GETPOST("timemonth", 'int'), GETPOST("timeday", 'int'), GETPOST("timeyear", 'int')); $object->timespent_withhour = 1; } else { - $object->timespent_date = dol_mktime(12, 0, 0, GETPOST("timemonth"), GETPOST("timeday"), GETPOST("timeyear")); + $object->timespent_date = dol_mktime(12, 0, 0, GETPOST("timemonth", 'int'), GETPOST("timeday", 'int'), GETPOST("timeyear", 'int')); } $object->timespent_fk_user = GETPOST("userid", 'int'); $result = $object->addTimeSpent($user); @@ -402,7 +402,7 @@ if ($action == 'confirm_generateinvoice') { if (!$error) { if ($generateinvoicemode == 'onelineperuser') { - $arrayoftasks = array(); + $arrayoftasks = array(); foreach ($toselect as $key => $value) { // Get userid, timepent $object->fetchTimeSpent($value); @@ -437,22 +437,27 @@ if ($action == 'confirm_generateinvoice') { break; } } - } elseif ($generateinvoicemode == 'onelineperperiod') { - $arrayoftasks = array(); + } elseif ($generateinvoicemode == 'onelineperperiod') { // One line for each time spent line + $arrayoftasks = array(); foreach ($toselect as $key => $value) { // Get userid, timepent $object->fetchTimeSpent($value); + // $object->id is the task id + $ftask = new Task($db); + $ftask->fetch($object->id); + + $fuser->fetch($object->timespent_fk_user); + $username = $fuser->getFullName($langs); + $arrayoftasks[$object->timespent_id]['timespent'] = $object->timespent_duration; $arrayoftasks[$object->timespent_id]['totalvaluetodivideby3600'] = $object->timespent_duration * $object->timespent_thm; - $arrayoftasks[$object->timespent_id]['note'] = $object->timespent_note; + $arrayoftasks[$object->timespent_id]['note'] = $ftask->ref.' - '.$ftask->label.' - '.$username.($object->timespent_note ? ' - '.$object->timespent_note : ''); // TODO Add user name in note $arrayoftasks[$object->timespent_id]['user'] = $object->timespent_fk_user; } foreach ($arrayoftasks as $timespent_id => $value) { $userid = $value['user']; - $fuser->fetch($userid); //$pu_ht = $value['timespent'] * $fuser->thm; - $username = $fuser->getFullName($langs); // Define qty per hour $qtyhour = $value['timespent'] / 3600; @@ -465,6 +470,7 @@ if ($action == 'confirm_generateinvoice') { // Add lines $lineid = $tmpinvoice->addline($value['note'], $pu_ht, round($qtyhour / $prodDurationHours, 2), $txtva, $localtax1, $localtax2, ($idprod > 0 ? $idprod : 0)); + //var_dump($lineid);exit; // Update lineid into line of timespent $sql = 'UPDATE '.MAIN_DB_PREFIX.'projet_task_time SET invoice_line_id = '.((int) $lineid).', invoice_id = '.((int) $tmpinvoice->id); @@ -477,7 +483,7 @@ if ($action == 'confirm_generateinvoice') { } } } elseif ($generateinvoicemode == 'onelinepertask') { - $arrayoftasks = array(); + $arrayoftasks = array(); foreach ($toselect as $key => $value) { // Get userid, timepent $object->fetchTimeSpent($value); @@ -517,7 +523,10 @@ if ($action == 'confirm_generateinvoice') { if (!$error) { $urltoinvoice = $tmpinvoice->getNomUrl(0); - setEventMessages($langs->trans("InvoiceGeneratedFromTimeSpent", $urltoinvoice), null, 'mesgs'); + $mesg = $langs->trans("InvoiceGeneratedFromTimeSpent", '{s1}'); + $mesg = str_replace('{s1}', $urltoinvoice, $mesg); + setEventMessages($mesg, null, 'mesgs'); + //var_dump($tmpinvoice); $db->commit(); @@ -969,7 +978,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { $tmparray = array( 'onelineperuser'=>'OneLinePerUser', 'onelinepertask'=>'OneLinePerTask', - 'onelineperperiod'=>'OneLinePerPeriod', + 'onelineperperiod'=>'OneLinePerTimeSpentLine', ); print $form->selectarray('generateinvoicemode', $tmparray, 'onelineperuser', 0, 0, 0, '', 1); print ''; @@ -1315,7 +1324,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { print_liste_field_titre($arrayfields['value']['label'], $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'right '); } if (!empty($arrayfields['valuebilled']['checked'])) { - print_liste_field_titre($arrayfields['valuebilled']['label'], $_SERVER['PHP_SELF'], 'il.total_ht', '', $param, '', $sortfield, $sortorder, 'center '); + print_liste_field_titre($arrayfields['valuebilled']['label'], $_SERVER['PHP_SELF'], 'il.total_ht', '', $param, '', $sortfield, $sortorder, 'center ', $langs->trans("SelectLinesOfTimeSpentToInvoice")); } /* // Extra fields From c2cb055b0ad2ed6a5ef7f4877574047cc34ec143 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 May 2021 14:00:29 +0200 Subject: [PATCH 0110/1497] Fix look and feel v14 --- htdocs/comm/action/card.php | 2 +- htdocs/comm/action/document.php | 2 +- htdocs/comm/action/index.php | 4 ++-- htdocs/comm/action/info.php | 2 +- htdocs/comm/action/list.php | 4 ++-- htdocs/comm/action/pertype.php | 4 ++-- htdocs/comm/action/peruser.php | 4 ++-- htdocs/core/lib/functions.lib.php | 5 +++-- 8 files changed, 14 insertions(+), 13 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index f368378a281..10e96b50014 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1821,7 +1821,7 @@ if ($id > 0) { $linkback = ''; // Link to other agenda views - $linkback .= img_picto($langs->trans("BackToList"), 'object_list-alt', 'class="hideonsmartphone pictoactionview"'); + $linkback .= img_picto($langs->trans("BackToList"), 'object_list', 'class="hideonsmartphone pictoactionview"'); $linkback .= ''.$langs->trans("BackToList").''; $linkback .= ''; $linkback .= '
  • '; diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index c55d4e114cc..7465e613611 100644 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -147,7 +147,7 @@ if ($object->id > 0) { $out = ''; $out .= '
  • '.img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="hideonsmartphone pictoactionview"'); $out .= ''.$langs->trans("ViewPerUser").''; - $out .= '
  • '.img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="hideonsmartphone pictoactionview"'); + $out .= '
  • '.img_picto($langs->trans("ViewCal"), 'object_calendarmonth', 'class="hideonsmartphone pictoactionview"'); $out .= ''.$langs->trans("ViewCal").''; $out .= '
  • '.img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="hideonsmartphone pictoactionview"'); $out .= ''.$langs->trans("ViewWeek").''; diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index d5457447100..459ede423b1 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -480,13 +480,13 @@ print ''; $viewmode = ''; $viewmode .= ''; //$viewmode .= ''; -$viewmode .= img_picto($langs->trans("List"), 'object_list-alt', 'class="pictoactionview block"'); +$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewList").''; $viewmode .= ''; //$viewmode .= ''; -$viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="pictoactionview block"'); +$viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendarmonth', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewCal").''; diff --git a/htdocs/comm/action/info.php b/htdocs/comm/action/info.php index f5d1c65b267..071d6409176 100644 --- a/htdocs/comm/action/info.php +++ b/htdocs/comm/action/info.php @@ -73,7 +73,7 @@ $linkback .= ''.$langs->trans(" $out = ''; $out .= '
  • '.img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="hideonsmartphone pictoactionview"'); $out .= ''.$langs->trans("ViewPerUser").''; -$out .= '
  • '.img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="hideonsmartphone pictoactionview"'); +$out .= '
  • '.img_picto($langs->trans("ViewCal"), 'object_calendarmonth', 'class="hideonsmartphone pictoactionview"'); $out .= ''.$langs->trans("ViewCal").''; $out .= '
  • '.img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="hideonsmartphone pictoactionview"'); $out .= ''.$langs->trans("ViewWeek").''; diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 96a69403289..e3cc54f5a35 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -606,13 +606,13 @@ if ($resql) { $viewmode = ''; $viewmode .= ''; //$viewmode .= ''; - $viewmode .= img_picto($langs->trans("List"), 'object_list-alt', 'class="pictoactionview block"'); + $viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewList").''; $viewmode .= ''; //$viewmode .= ''; - $viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="pictoactionview block"'); + $viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendarmonth', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewCal").''; diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index 19f8a8ce31c..32eaccdcce1 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -416,13 +416,13 @@ $massactionbutton = ''; $viewmode = ''; $viewmode .= ''; //$viewmode .= ''; -$viewmode .= img_picto($langs->trans("List"), 'object_list-alt', 'class="pictoactionview block"'); +$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewList").''; $viewmode .= ''; //$viewmode .= ''; -$viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="pictoactionview block"'); +$viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendarmonth', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewCal").''; diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 62af33b34ee..76330d39453 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -426,13 +426,13 @@ $massactionbutton = ''; $viewmode = ''; $viewmode .= ''; //$viewmode .= ''; -$viewmode .= img_picto($langs->trans("List"), 'object_list-alt', 'class="pictoactionview block"'); +$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewList").''; $viewmode .= ''; //$viewmode .= ''; -$viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="pictoactionview block"'); +$viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendarmonth', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewCal").''; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a987cf03e4c..a4a2d736746 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3498,6 +3498,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ '1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected', 'accountancy', 'account', 'accountline', 'action', 'add', 'address', 'angle-double-down', 'angle-double-up', 'asset', 'bank_account', 'barcode', 'bank', 'bill', 'billa', 'billr', 'billd', 'bookmark', 'bom', 'bug', 'building', + 'calendar', 'calendarmonth', 'calendarweek', 'calendarday', 'calendarperuser', 'calendarpertype', 'cash-register', 'category', 'chart', 'check', 'clock', 'close_title', 'cog', 'collab', 'company', 'contact', 'country', 'contract', 'cron', 'cubes', 'multicurrency', 'delete', 'dolly', 'dollyrevert', 'donation', 'download', 'dynamicprice', 'edit', 'ellipsis-h', 'email', 'eraser', 'establishment', 'expensereport', 'external-link-alt', 'external-link-square-alt', @@ -3505,7 +3506,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'generate', 'globe', 'globe-americas', 'graph', 'grip', 'grip_title', 'group', 'help', 'holiday', 'images', 'incoterm', 'info', 'intervention', 'inventory', 'intracommreport', 'knowledgemanagement', - 'label', 'language', 'link', 'list', 'listlight', 'loan', 'lot', 'long-arrow-alt-right', + 'label', 'language', 'link', 'list', 'list-alt', 'listlight', 'loan', 'lot', 'long-arrow-alt-right', 'margin', 'map-marker-alt', 'member', 'meeting', 'money-bill-alt', 'movement', 'mrp', 'note', 'next', 'off', 'on', 'order', 'paiment', 'paragraph', 'play', 'pdf', 'phone', 'playdisabled', 'previous', 'poll', 'pos', 'printer', 'product', 'propal', 'stock', 'resize', 'service', 'stats', 'trip', @@ -3551,7 +3552,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'sign-out'=>'sign-out-alt', 'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'check'=>'check', 'bookmark'=>'star', 'bookmark'=>'star', 'bank'=>'university', 'close_title'=>'times', 'delete'=>'trash', 'edit'=>'pencil-alt', 'filter'=>'filter', - 'list-alt'=>'list-alt', 'calendar'=>'calendar-alt', 'calendarweek'=>'calendar-week', 'calendarmonth'=>'calendar-alt', 'calendarday'=>'calendar-day', 'calendarperuser'=>'table', + 'list-alt'=>'list-alt', 'calendar'=>'calendar-alt', 'calendarmonth'=>'calendar-alt', 'calendarweek'=>'calendar-week', 'calendarmonth'=>'calendar-alt', 'calendarday'=>'calendar-day', 'calendarperuser'=>'table', 'intervention'=>'ambulance', 'invoice'=>'file-invoice-dollar', 'multicurrency'=>'dollar-sign', 'order'=>'file-invoice', 'error'=>'exclamation-triangle', 'warning'=>'exclamation-triangle', 'other'=>'square', From fbaba3b81ba03767ed770d00d065c347d6f8f3f5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 May 2021 14:13:08 +0200 Subject: [PATCH 0111/1497] css --- htdocs/theme/eldy/global.inc.php | 4 ++-- htdocs/theme/md/style.css.php | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 3518518a5ef..27a889293f1 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -4929,8 +4929,8 @@ td.cal_other_month { /* ============================================================================== */ /* CSS for treeview */ -.treeview ul { background-color: transparent !important; margin-bottom: 4px !important; margin-top: 0 !important; padding-top: 4px !important; } -.treeview li { background-color: transparent !important; padding: 0 0 0 16px !important; min-height: 26px; } +.treeview ul { background-color: transparent !important; margin-bottom: 4px !important; margin-top: 0 !important; padding-top: 8px !important; } +.treeview li { background-color: transparent !important; padding: 0 0 0 16px !important; min-height: 30px; } .treeview .hover { color: var(--colortextlink) !important; text-decoration: underline !important; } .treeview .hitarea { margin-top: 3px; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 70a2ce1303e..0089248288a 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -4849,9 +4849,10 @@ td.gtaskname { /* ============================================================================== */ /* CSS for treeview */ -.treeview ul { background-color: transparent !important; margin-top: 0; } -.treeview li { background-color: transparent !important; padding: 0 0 0 16px !important; min-height: 20px; } -.treeview .hover { color: rgb() !important; text-decoration: underline !important; } +.treeview ul { background-color: transparent !important; margin-bottom: 4px !important; margin-top: 0 !important; padding-top: 8px !important; } +.treeview li { background-color: transparent !important; padding: 0 0 0 16px !important; min-height: 30px; } +.treeview .hover { color: var(--colortextlink) !important; text-decoration: underline !important; } +.treeview .hitarea { margin-top: 3px; } From 90d159fbc3b9755201fde87ee19beb257b462b34 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Tue, 18 May 2021 14:58:46 +0200 Subject: [PATCH 0112/1497] FIX : Missing hook in cibles.php (for mailing) --- htdocs/comm/mailing/cibles.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 8bfa82260b9..bf4b2e3d39c 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -66,6 +66,8 @@ $modulesdir = dolGetModulesDirs('/mailings'); $object = new Mailing($db); $result = $object->fetch($id); +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('ciblescard', 'globalcard')); /* * Actions @@ -471,6 +473,10 @@ if ($object->fetch($id) >= 0) } } // End foreach dir + $parameters = array(); + $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + print '
  • '; print '

    '; From e7ac39fe35e84585564d57170c869a62d0525b03 Mon Sep 17 00:00:00 2001 From: Damien BENOIT <48482664+Givriz@users.noreply.github.com> Date: Tue, 18 May 2021 15:23:29 +0200 Subject: [PATCH 0113/1497] Update modules.php Added $param --- htdocs/admin/system/modules.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/system/modules.php b/htdocs/admin/system/modules.php index 4a77d2452c4..150ca10a359 100644 --- a/htdocs/admin/system/modules.php +++ b/htdocs/admin/system/modules.php @@ -65,6 +65,7 @@ $arrayfields = array( ); $arrayfields = dol_sort_array($arrayfields, 'position'); +$param = ''; /* @@ -277,7 +278,7 @@ if ($arrayfields['module_position']['checked']) { } // Fields from hook -$parameters = array('arrayfields'=>$arrayfields, 'param'=>empty($param) ? '' : $param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); +$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; From 38a5dfb26343258ae2a4fed72e69377483417783 Mon Sep 17 00:00:00 2001 From: Damien BENOIT <48482664+Givriz@users.noreply.github.com> Date: Tue, 18 May 2021 15:26:55 +0200 Subject: [PATCH 0114/1497] Update listevents.php Added $optioncss --- htdocs/admin/tools/listevents.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index b894920d34e..31287cbbb8a 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -68,6 +68,7 @@ $search_user = GETPOST("search_user", "alpha"); $search_desc = GETPOST("search_desc", "alpha"); $search_ua = GETPOST("search_ua", "restricthtml"); $search_prefix_session = GETPOST("search_prefix_session", "restricthtml"); +$optioncss = GETPOST("optioncss", "aZ"); // Option for the css output (always '' except when 'print') $now = dol_now(); $nowarray = dol_getdate($now); @@ -245,7 +246,7 @@ if ($result) { if ($limit > 0 && $limit != $conf->liste_limit) { $param .= '&limit='.urlencode($limit); } - if (!empty($optioncss)) { + if ($optioncss != '') { $param .= '&optioncss='.urlencode($optioncss); } if ($search_code) { From f3803bab9143003082515fc4567459a763ef86ad Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 May 2021 16:28:30 +0200 Subject: [PATCH 0115/1497] Responsive --- .../template/core/modules/modMyModule.class.php | 4 ++-- htdocs/projet/activity/perday.php | 2 +- htdocs/projet/activity/permonth.php | 2 +- htdocs/projet/activity/perweek.php | 2 +- htdocs/theme/eldy/global.inc.php | 4 ++++ htdocs/theme/md/style.css.php | 11 +++++++++++ 6 files changed, 20 insertions(+), 5 deletions(-) diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php index d212e10998e..9db4bcb9854 100644 --- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php +++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php @@ -290,7 +290,7 @@ class modMyModule extends DolibarrModules 'fk_menu'=>'', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'type'=>'top', // This is a Top menu entry 'titre'=>'ModuleMyModuleName', - 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'), + 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth valignmiddle"'), 'mainmenu'=>'mymodule', 'leftmenu'=>'', 'url'=>'/mymodule/mymoduleindex.php', @@ -307,7 +307,7 @@ class modMyModule extends DolibarrModules 'fk_menu'=>'fk_mainmenu=mymodule', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'type'=>'left', // This is a Top menu entry 'titre'=>'MyObject', - 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'), + 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth valignmiddle"'), 'mainmenu'=>'mymodule', 'leftmenu'=>'myobject', 'url'=>'/mymodule/mymoduleindex.php', diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index b0195200dd5..56d5dfedf28 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -478,7 +478,7 @@ $formproject->selectTasks($socid ? $socid : -1, $taskid, 'taskid', 32, 0, '-- '. print '
    '; print ' '; print $formcompany->selectTypeContact($object, '', 'type', 'internal', 'rowid', 0, 'maxwidth150onsmartphone'); -print ''; +print ''; print '
    '; print '
    '; diff --git a/htdocs/projet/activity/permonth.php b/htdocs/projet/activity/permonth.php index 087fe5b8f0b..e4aea7af6c2 100644 --- a/htdocs/projet/activity/permonth.php +++ b/htdocs/projet/activity/permonth.php @@ -396,7 +396,7 @@ $formproject->selectTasks($socid ? $socid : -1, $taskid, 'taskid', 32, 0, '-- '. print '
    '; print ' '; print $formcompany->selectTypeContact($object, '', 'type', 'internal', 'rowid', 0, 'maxwidth150onsmartphone'); -print ''; +print ''; print '
    '; print '
    '; diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index 0a275cb46e3..90764f637fd 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -493,7 +493,7 @@ $formproject->selectTasks($socid ? $socid : -1, $taskid, 'taskid', 32, 0, '-- '. print '
    '; print ' '; print $formcompany->selectTypeContact($object, '', 'type', 'internal', 'rowid', 0, 'maxwidth150onsmartphone'); -print ''; +print ''; print '
    '; print '
    '; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 27a889293f1..67192c7063e 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1491,6 +1491,10 @@ select.widthcentpercentminusxx, span.widthcentpercentminusxx:not(.select2-select input.buttonpayment, button.buttonpayment, div.buttonpayment { min-width: 270px; } + + .smallonsmartphone { + font-size: 0.8em; + } } /* Force values for small screen 570 */ diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 0089248288a..866d6c9f3d7 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1495,6 +1495,17 @@ table[summary="list_of_modules"] .fa-cog { div.divphotoref { padding-right: 10px !important; } + + .poweredbyimg { + width: 48px; + } + input.buttonpayment, button.buttonpayment, div.buttonpayment { + min-width: 270px; + } + + .smallonsmartphone { + font-size: 0.8em; + } } /* Force values for small screen 570 */ From a829d8cedc719a4b799a94f39fe3b8f055200537 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 May 2021 16:31:59 +0200 Subject: [PATCH 0116/1497] css --- htdocs/projet/activity/perday.php | 6 +++--- htdocs/projet/activity/permonth.php | 8 ++++---- htdocs/projet/activity/perweek.php | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index 56d5dfedf28..b93b5158ad7 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -503,18 +503,18 @@ $includeonly = 'hierarchyme'; if (empty($user->rights->user->user->lire)) { $includeonly = array($user->id); } -$moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('User'), 'user', 'class="paddingright"').$form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200'); +$moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('User'), 'user', 'class="paddingright pictofixedwidth"').$form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200'); $moreforfilter .= '
    '; if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) { $moreforfilter .= '
    '; $moreforfilter .= '
    '; - $moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('Project'), 'project', 'class="paddingright"').''; + $moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('Project'), 'project', 'class="paddingright pictofixedwidth"').''; $moreforfilter .= '
    '; $moreforfilter .= '
    '; $moreforfilter .= '
    '; - $moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('ThirdParty'), 'company', 'class="paddingright"').''; + $moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('ThirdParty'), 'company', 'class="paddingright pictofixedwidth"').''; $moreforfilter .= '
    '; } diff --git a/htdocs/projet/activity/permonth.php b/htdocs/projet/activity/permonth.php index e4aea7af6c2..0491b9c04e5 100644 --- a/htdocs/projet/activity/permonth.php +++ b/htdocs/projet/activity/permonth.php @@ -391,7 +391,7 @@ if ($usertoprocess->id != $user->id) { $titleassigntask = $langs->transnoentities("AssignTaskToUser", $usertoprocess->getFullName($langs)); } print '
    '; -print img_picto('', 'projecttask'); +print img_picto('', 'projecttask', 'class="pictofixedwidth"'); $formproject->selectTasks($socid ? $socid : -1, $taskid, 'taskid', 32, 0, '-- '.$langs->trans("ChooseANotYetAssignedTask").' --', 1); print '
    '; print ' '; @@ -422,18 +422,18 @@ $includeonly = 'hierachyme'; if (empty($user->rights->user->user->lire)) { $includeonly = array($user->id); } -$moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('User'), 'user', 'class="paddingright"').$form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200'); +$moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('User'), 'user', 'class="paddingright pictofixedwidth"').$form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200'); $moreforfilter .= '
    '; if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) { $moreforfilter .= '
    '; $moreforfilter .= '
    '; - $moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('Project'), 'project', 'class="paddingright"').''; + $moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('Project'), 'project', 'class="paddingright pictofixedwidth"').''; $moreforfilter .= '
    '; $moreforfilter .= '
    '; $moreforfilter .= '
    '; - $moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('ThirdParty'), 'company', 'class="paddingright"').''; + $moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('ThirdParty'), 'company', 'class="paddingright pictofixedwidth"').''; $moreforfilter .= '
    '; } diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index 90764f637fd..6da7138e6d7 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -488,7 +488,7 @@ if ($usertoprocess->id != $user->id) { $titleassigntask = $langs->transnoentities("AssignTaskToUser", $usertoprocess->getFullName($langs)); } print '
    '; -print img_picto('', 'projecttask'); +print img_picto('', 'projecttask', 'class="pictofixedwidth"'); $formproject->selectTasks($socid ? $socid : -1, $taskid, 'taskid', 32, 0, '-- '.$langs->trans("ChooseANotYetAssignedTask").' --', 1, 0, 0, '', '', 'all', $usertoprocess); print '
    '; print ' '; @@ -556,18 +556,18 @@ $includeonly = 'hierarchyme'; if (empty($user->rights->user->user->lire)) { $includeonly = array($user->id); } -$moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('User'), 'user', 'class="paddingright"').$form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200'); +$moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('User'), 'user', 'class="paddingright pictofixedwidth"').$form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200'); $moreforfilter .= '
    '; if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) { $moreforfilter .= '
    '; $moreforfilter .= '
    '; - $moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('Project'), 'project', 'class="paddingright"').''; + $moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('Project'), 'project', 'class="paddingright pictofixedwidth"').''; $moreforfilter .= '
    '; $moreforfilter .= '
    '; $moreforfilter .= '
    '; - $moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('ThirdParty'), 'company', 'class="paddingright"').''; + $moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('ThirdParty'), 'company', 'class="paddingright pictofixedwidth"').''; $moreforfilter .= '
    '; } From 2974a2333296b9bed3a77bf3664a428777fae699 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 May 2021 16:54:31 +0200 Subject: [PATCH 0117/1497] css --- htdocs/categories/index.php | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index 5779558e722..041226a8131 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -218,16 +218,27 @@ foreach ($fulltree as $key => $val) { } -//print_barre_liste('', 0, $_SERVER["PHP_SELF"], '', '', '', '', 0, 0, '', 0, $newcardbutton, '', 0, 1, 1); +$nbofentries = (count($data) - 1); -print ''; +$morethan1level = 0; +foreach($data as $record) { + if (!empty($record['fk_menu'])) { + $morethan1level = 1; + } +} + + +print '
    '; print ''; -$nbofentries = (count($data) - 1); if ($nbofentries > 0) { print ''; // Date - print ''; print ''; if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { $colspan--; - print ''; + print ''; } if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { $colspan--; - print ''; + print ''; } print ''; print ''; @@ -967,10 +968,13 @@ if (!$variants) { $stock_real = price2num($obj->reel, 'MS'); print ''; print ''; + print ''; print ''; // PMP print ''; From 94c8246f6844181b5f827eec2329be2a592a842a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 May 2021 23:30:06 +0200 Subject: [PATCH 0243/1497] Debug v14 --- htdocs/product/stock/product.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 07ee7a66584..9ef7b011d12 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -969,7 +969,7 @@ if (!$variants) { print ''; print ''; print ''; if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { @@ -969,7 +971,7 @@ if (!$variants) { print ''; print ''; + $val = (GETPOSTISSET('member_'.$key) ? GETPOST('member_'.$key, 'alpha') : (empty($object->socialnetworks[$key]) ? '' : $object->socialnetworks[$key])); + print ''; } } From 9a51333662701bb8c35a873f2e4ca28f34acf75a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 26 May 2021 08:49:54 +0200 Subject: [PATCH 0247/1497] fix warning --- htdocs/societe/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 1165d6a9fd7..844dd7810f7 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1399,7 +1399,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; } print ''; - print ''; + print ''; } print ''; print ''; From 60196c04172aa2c647d6803d5657188cd48a69d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 26 May 2021 08:53:17 +0200 Subject: [PATCH 0248/1497] Update card.php --- htdocs/societe/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 844dd7810f7..aa8205bfa99 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -398,12 +398,12 @@ if (empty($reshook)) { $error++; } - if (!empty($conf->mailing->enabled) && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS==-1 && GETPOST('contact_no_email', 'int')==-1 && !empty(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL))) { + if (!empty($conf->mailing->enabled) && !empty($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS) && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS==-1 && GETPOST('contact_no_email', 'int')==-1 && !empty(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL))) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("No_Email")), null, 'errors'); } - if (!empty($conf->mailing->enabled) && GETPOST("private", 'int') == 1 && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS==-1 && GETPOST('contact_no_email', 'int')==-1 && !empty(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL))) { + if (!empty($conf->mailing->enabled) && GETPOST("private", 'int') == 1 && !empty($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS) && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS==-1 && GETPOST('contact_no_email', 'int')==-1 && !empty(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL))) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("No_Email")), null, 'errors'); } From fe6b25ede698f047f6a4864d43c95080b73c6e05 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Wed, 26 May 2021 09:48:13 +0200 Subject: [PATCH 0249/1497] fix on $value --- htdocs/comm/action/class/actioncomm.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 5790811fc2e..3943a37e5a7 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1902,10 +1902,10 @@ class ActionComm extends CommonObject } } if ($key == 'module') { - $sql .= " AND c.module LIKE '%".$value."'"; + $sql .= " AND c.module LIKE '%".$this->db->escape($value)."'"; } if ($key == 'status') { - $sql .= " AND a.status =".$value; + $sql .= " AND a.status =".((int) $value); } } From 2130be975e1e9546961b95b72d230a36f0d4d2fe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 May 2021 11:01:54 +0200 Subject: [PATCH 0250/1497] Fix perm --- test/phpunit/CMailFileTest.php | 0 test/phpunit/ContactTest.php | 0 test/phpunit/ModulesTest.php | 0 test/phpunit/PricesTest.php | 0 test/phpunit/SocieteTest.php | 0 5 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 test/phpunit/CMailFileTest.php mode change 100755 => 100644 test/phpunit/ContactTest.php mode change 100755 => 100644 test/phpunit/ModulesTest.php mode change 100755 => 100644 test/phpunit/PricesTest.php mode change 100755 => 100644 test/phpunit/SocieteTest.php diff --git a/test/phpunit/CMailFileTest.php b/test/phpunit/CMailFileTest.php old mode 100755 new mode 100644 diff --git a/test/phpunit/ContactTest.php b/test/phpunit/ContactTest.php old mode 100755 new mode 100644 diff --git a/test/phpunit/ModulesTest.php b/test/phpunit/ModulesTest.php old mode 100755 new mode 100644 diff --git a/test/phpunit/PricesTest.php b/test/phpunit/PricesTest.php old mode 100755 new mode 100644 diff --git a/test/phpunit/SocieteTest.php b/test/phpunit/SocieteTest.php old mode 100755 new mode 100644 From ded385f12ead547d46d988bfee6b57f04e534e60 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 May 2021 11:24:29 +0200 Subject: [PATCH 0251/1497] FIX #17650 #17710 --- dev/initdemo/mysqldump_dolibarr_3.5.0.sql | 2 +- test/phpunit/CommandeFournisseurTest.php | 4 ++-- test/phpunit/PdfDocTest.php | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dev/initdemo/mysqldump_dolibarr_3.5.0.sql b/dev/initdemo/mysqldump_dolibarr_3.5.0.sql index 46053d1a187..252643afb59 100644 --- a/dev/initdemo/mysqldump_dolibarr_3.5.0.sql +++ b/dev/initdemo/mysqldump_dolibarr_3.5.0.sql @@ -5503,7 +5503,7 @@ CREATE TABLE `llx_product` ( LOCK TABLES `llx_product` WRITE; /*!40000 ALTER TABLE `llx_product` DISABLE KEYS */; -INSERT INTO `llx_product` VALUES (1,'2010-07-08 14:33:17','2013-03-12 09:30:24',0,0,'PIDRESS',1,NULL,'Pink dress','A beatifull pink dress','',NULL,NULL,100.00000000,112.50000000,90.00000000,101.25000000,'HT',12.500,0,0.000,0.000,1,1,1,0,'',20,NULL,0,'','',NULL,100,0,NULL,0,NULL,0,NULL,0,2,0.00000000,NULL,1,0,NULL,0),(2,'2010-07-09 00:30:01','2013-01-19 17:31:58',0,0,'Product_P1',1,NULL,'Product P1','','','',32,0.00000000,0.00000000,0.00000000,0.00000000,'HT',12.500,0,0.000,0.000,1,1,1,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,998,0.00000000,NULL,0,0,NULL,0),(3,'2010-07-09 00:30:25','2012-12-08 13:11:14',0,0,'Service_S1',1,NULL,'Service S1','','',NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,'HT',12.500,0,0.000,0.000,1,1,1,1,'1m',NULL,NULL,0,'','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,NULL,0,0,NULL,0),(4,'2010-07-10 14:44:06','2013-01-19 17:22:48',0,0,'DECAP',1,NULL,'Decapsuleur','','',NULL,NULL,5.00000000,5.62500000,0.00000000,0.00000000,'HT',12.500,0,0.000,0.000,1,1,1,0,'',NULL,NULL,0,'','',NULL,2,-3,NULL,0,NULL,0,NULL,0,1001,10.00000000,NULL,1,0,NULL,0),(5,'2011-07-20 23:11:38','2011-07-27 17:02:59',0,0,'aaaa',1,NULL,'aaaa','cccc','bbbb','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,1,1,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,'',1,0,NULL,0),(6,'2011-07-29 22:16:44','2011-07-29 20:16:44',0,0,'Copy_of_aaaa',1,NULL,'aaaa','cccc','bbbb','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,0,1,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,'',1,0,NULL,0),(7,'2011-07-29 22:31:21','2011-07-29 20:31:21',0,0,'Copy_of_Copy_of_aaaa',1,NULL,'aaaa','cccc','bbbb','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,0,0,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,'',1,0,NULL,0),(8,'2011-07-29 22:46:54','2011-07-29 20:46:54',0,0,'Copy_of_Copy_of_Copy_of_aaaa',1,NULL,'aaaa','cccc','bbbb','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,0,0,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,'',1,0,NULL,0),(10,'2008-12-31 00:00:00','2012-12-08 13:11:14',0,0,'PR123456',1,NULL,'My product','This is a description example for record','Some note',NULL,NULL,100.00000000,110.00000000,0.00000000,0.00000000,'HT',10.000,0,0.000,0.000,NULL,0,0,0,'1y',0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,NULL,NULL,0,'20110729232310',0),(11,'2013-01-13 20:24:42','2013-01-19 17:22:48',0,0,'gh',1,NULL,'hfghf','','','',NULL,0.00000000,0.00000000,0.00000000,0.00000000,'HT',0.000,0,0.000,0.000,1,1,1,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,-1,0.00000000,'',1,0,NULL,0); +INSERT INTO `llx_product` VALUES (1,'2010-07-08 14:33:17','2013-03-12 09:30:24',0,0,'PINKDRESS',1,NULL,'Pink dress','A beatifull pink dress','',NULL,NULL,100.00000000,112.50000000,90.00000000,101.25000000,'HT',12.500,0,0.000,0.000,1,1,1,0,'',20,NULL,0,'','',NULL,100,0,NULL,0,NULL,0,NULL,0,2,0.00000000,NULL,1,0,NULL,0),(2,'2010-07-09 00:30:01','2013-01-19 17:31:58',0,0,'Product_P1',1,NULL,'Product P1','','','',32,0.00000000,0.00000000,0.00000000,0.00000000,'HT',12.500,0,0.000,0.000,1,1,1,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,998,0.00000000,NULL,0,0,NULL,0),(3,'2010-07-09 00:30:25','2012-12-08 13:11:14',0,0,'Service_S1',1,NULL,'Service S1','','',NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,'HT',12.500,0,0.000,0.000,1,1,1,1,'1m',NULL,NULL,0,'','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,NULL,0,0,NULL,0),(4,'2010-07-10 14:44:06','2013-01-19 17:22:48',0,0,'DECAP',1,NULL,'Decapsuleur','','',NULL,NULL,5.00000000,5.62500000,0.00000000,0.00000000,'HT',12.500,0,0.000,0.000,1,1,1,0,'',NULL,NULL,0,'','',NULL,2,-3,NULL,0,NULL,0,NULL,0,1001,10.00000000,NULL,1,0,NULL,0),(5,'2011-07-20 23:11:38','2011-07-27 17:02:59',0,0,'aaaa',1,NULL,'aaaa','cccc','bbbb','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,1,1,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,'',1,0,NULL,0),(6,'2011-07-29 22:16:44','2011-07-29 20:16:44',0,0,'Copy_of_aaaa',1,NULL,'aaaa','cccc','bbbb','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,0,1,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,'',1,0,NULL,0),(7,'2011-07-29 22:31:21','2011-07-29 20:31:21',0,0,'Copy_of_Copy_of_aaaa',1,NULL,'aaaa','cccc','bbbb','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,0,0,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,'',1,0,NULL,0),(8,'2011-07-29 22:46:54','2011-07-29 20:46:54',0,0,'Copy_of_Copy_of_Copy_of_aaaa',1,NULL,'aaaa','cccc','bbbb','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,0,0,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,'',1,0,NULL,0),(10,'2008-12-31 00:00:00','2012-12-08 13:11:14',0,0,'PR123456',1,NULL,'My product','This is a description example for record','Some note',NULL,NULL,100.00000000,110.00000000,0.00000000,0.00000000,'HT',10.000,0,0.000,0.000,NULL,0,0,0,'1y',0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,NULL,NULL,0,'20110729232310',0),(11,'2013-01-13 20:24:42','2013-01-19 17:22:48',0,0,'gh',1,NULL,'hfghf','','','',NULL,0.00000000,0.00000000,0.00000000,0.00000000,'HT',0.000,0,0.000,0.000,1,1,1,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,-1,0.00000000,'',1,0,NULL,0); /*!40000 ALTER TABLE `llx_product` ENABLE KEYS */; UNLOCK TABLES; diff --git a/test/phpunit/CommandeFournisseurTest.php b/test/phpunit/CommandeFournisseurTest.php index bf5922460a2..5240083512b 100644 --- a/test/phpunit/CommandeFournisseurTest.php +++ b/test/phpunit/CommandeFournisseurTest.php @@ -145,9 +145,9 @@ class CommandeFournisseurTest extends PHPUnit\Framework\TestCase $societe=new Societe($db); $societe->fetch($socid); $product=new ProductFournisseur($db); - $product->fetch(0, 'PIDRESS'); + $product->fetch(0, 'PINKDRESS'); if ($product->id <= 0) { - print "\n".__METHOD__." A product with ref PIDRESS must exists into database"; die(1); + print "\n".__METHOD__." A product with ref PINKDRESS must exists into database"; die(1); } $quantity=10; diff --git a/test/phpunit/PdfDocTest.php b/test/phpunit/PdfDocTest.php index e744aef3c2f..f7181f8a4f9 100644 --- a/test/phpunit/PdfDocTest.php +++ b/test/phpunit/PdfDocTest.php @@ -141,13 +141,13 @@ class PdfDocTest extends PHPUnit\Framework\TestCase $db=$this->savdb; $localproduct=new Product($this->savdb); - $result = $localproduct->fetch(0, 'PIDRESS'); + $result = $localproduct->fetch(0, 'PINKDRESS'); if ($result < 0) { - print "\n".__METHOD__." Failed to make the fetch of product PIDRESS. ".$localproduct->error; die(1); + print "\n".__METHOD__." Failed to make the fetch of product PINKDRESS. ".$localproduct->error; die(1); } $product_id = $localproduct->id; if ($product_id <= 0) { - print "\n".__METHOD__." A product with ref PIDRESS must exists into database"; die(1); + print "\n".__METHOD__." A product with ref PINKDRESS must exists into database. Create it manually before running the test"; die(1); } $localobject=new Facture($this->savdb); @@ -160,11 +160,11 @@ class PdfDocTest extends PHPUnit\Framework\TestCase $result=pdf_getlinedesc($localobject, 0, $langs); print __METHOD__." result=".$result."\n"; - $this->assertEquals($result, "PIDRESS - Label 1
    This is a description with a é accent
    (Country of origin: France)"); + $this->assertEquals($result, "PINKDRESS - Label 1
    This is a description with a é accent
    (Country of origin: France)"); $result=doc_getlinedesc($localobject->lines[0], $langs); print __METHOD__." result=".$result."\n"; - $this->assertEquals($result, "PIDRESS - Label 1\nThis is a description with a é accent\n(Country of origin: France)"); + $this->assertEquals($result, "PINKDRESS - Label 1\nThis is a description with a é accent\n(Country of origin: France)"); } /** From 38ef0283105ef2ea4619aefc2aeffca0219785ee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 May 2021 12:44:15 +0200 Subject: [PATCH 0252/1497] Clean code. Fix check for lot that must be unique. --- .../stock/class/mouvementstock.class.php | 116 +++++++++--------- 1 file changed, 60 insertions(+), 56 deletions(-) diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 4877bb861ab..959336c1671 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -126,27 +126,28 @@ class MouvementStock extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Add a movement of stock (in one direction only). + * This is the lowest level method to record a stock change. * $this->origin can be also be set to save the source object of movement. * - * @param User $user User object - * @param int $fk_product Id of product - * @param int $entrepot_id Id of warehouse - * @param int $qty Qty of movement (can be <0 or >0 depending on parameter type) - * @param int $type Direction of movement: - * 0=input (stock increase by a stock transfer), 1=output (stock decrease by a stock transfer), - * 2=output (stock decrease), 3=input (stock increase) - * Note that qty should be > 0 with 0 or 3, < 0 with 1 or 2. - * @param int $price Unit price HT of product, used to calculate average weighted price (AWP or PMP in french). If 0, average weighted price is not changed. - * @param string $label Label of stock movement - * @param string $inventorycode Inventory code - * @param string $datem Force date of movement + * @param User $user User object + * @param int $fk_product Id of product + * @param int $entrepot_id Id of warehouse + * @param int $qty Qty of movement (can be <0 or >0 depending on parameter type) + * @param int $type Direction of movement: + * 0=input (stock increase by a stock transfer), 1=output (stock decrease by a stock transfer), + * 2=output (stock decrease), 3=input (stock increase) + * Note that qty should be > 0 with 0 or 3, < 0 with 1 or 2. + * @param int $price Unit price HT of product, used to calculate average weighted price (AWP or PMP in french). If 0, average weighted price is not changed. + * @param string $label Label of stock movement + * @param string $inventorycode Inventory code + * @param string $datem Force date of movement * @param integer|string $eatby eat-by date. Will be used if lot does not exists yet and will be created. * @param integer|string $sellby sell-by date. Will be used if lot does not exists yet and will be created. - * @param string $batch batch number - * @param boolean $skip_batch If set to true, stock movement is done without impacting batch record - * @param int $id_product_batch Id product_batch (when skip_batch is false and we already know which record of product_batch to use) - * @param int $disablestockchangeforsubproduct Disable stock change for sub-products of kit (usefull only if product is a subproduct) - * @return int <0 if KO, 0 if fk_product is null or product id does not exists, >0 if OK + * @param string $batch batch number + * @param boolean $skip_batch If set to true, stock movement is done without impacting batch record + * @param int $id_product_batch Id product_batch (when skip_batch is false and we already know which record of product_batch to use) + * @param int $disablestockchangeforsubproduct Disable stock change for sub-products of kit (usefull only if product is a subproduct) + * @return int <0 if KO, 0 if fk_product is null or product id does not exists, >0 if OK */ public function _create($user, $fk_product, $entrepot_id, $qty, $type, $price = 0, $label = '', $inventorycode = '', $datem = '', $eatby = '', $sellby = '', $batch = '', $skip_batch = false, $id_product_batch = 0, $disablestockchangeforsubproduct = 0) { @@ -159,10 +160,10 @@ class MouvementStock extends CommonObject $error = 0; dol_syslog(get_class($this)."::_create start userid=$user->id, fk_product=$fk_product, warehouse_id=$entrepot_id, qty=$qty, type=$type, price=$price, label=$label, inventorycode=$inventorycode, datem=".$datem.", eatby=".$eatby.", sellby=".$sellby.", batch=".$batch.", skip_batch=".$skip_batch); - // start hook at beginning + // Call hook at beginning global $action, $hookmanager; $hookmanager->initHooks(array('mouvementstock')); - // Hook of thirdparty module + if (is_object($hookmanager)) { $parameters = array( 'currentcontext' => 'mouvementstock', @@ -181,11 +182,12 @@ class MouvementStock extends CommonObject 'skip_batch' => &$skip_batch, 'id_product_batch' => &$id_product_batch ); - $reshook = $hookmanager->executeHooks('stockMovementCreate', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + $reshook = $hookmanager->executeHooks('stockMovementCreate', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { - if (!empty($hookmanager->resPrint)) + if (!empty($hookmanager->resPrint)) { dol_print_error('', $hookmanager->resPrint); + } return $reshook; } elseif ($reshook > 0) { return $hookmanager->resPrint; @@ -199,7 +201,8 @@ class MouvementStock extends CommonObject $now = (!empty($datem) ? $datem : dol_now()); // Check parameters - if (empty($fk_product)) return 0; + if (!($fk_product > 0)) return 0; + if (!($entrepot_id > 0)) return 0; if (is_numeric($eatby) && $eatby < 0) { dol_syslog(get_class($this)."::_create start ErrorBadValueForParameterEatBy eatby = ".$eatby); @@ -235,15 +238,23 @@ class MouvementStock extends CommonObject dol_print_error('', "Failed to fetch product"); return -1; } - if ($product->id <= 0) { // Can happen if database is corrupted + if ($product->id <= 0) { // Can happen if database is corrupted (a product id exist in stock with product that has been removed) return 0; } + // Define if we must make the stock change (If product type is a service or if stock is used also for services) + // Only record into stock tables wil be disabled by this (the rest like writing into lot table or movement of subproucts are done) + $movestock = 0; + if ($product->type != Product::TYPE_SERVICE || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) $movestock = 1; + $this->db->begin(); - $product->load_stock('novirtual'); + // Set value $product->stock_reel and detail per warehouse into $product->stock_warehouse array + if ($movestock) { + $product->load_stock('novirtual'); + } - // Test if product require batch data. If yes, and there is not, we throw an error. + // Test if product require batch data. If yes, and there is not or values are not correct, we throw an error. if (!empty($conf->productbatch->enabled) && $product->hasbatch() && !$skip_batch) { if (empty($batch)) { $langs->load("errors"); @@ -261,7 +272,7 @@ class MouvementStock extends CommonObject // If found and eatby/sellby not defined into table and not provided, we do nothing // If not found, we add record $sql = "SELECT pb.rowid, pb.batch, pb.eatby, pb.sellby FROM ".MAIN_DB_PREFIX."product_lot as pb"; - $sql .= " WHERE pb.fk_product = ".$fk_product." AND pb.batch = '".$this->db->escape($batch)."'"; + $sql .= " WHERE pb.fk_product = ".((int) $fk_product)." AND pb.batch = '".$this->db->escape($batch)."'"; dol_syslog(get_class($this)."::_create scan serial for this product to check if eatby and sellby match", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -353,10 +364,6 @@ class MouvementStock extends CommonObject } } - // Define if we must make the stock change (If product type is a service or if stock is used also for services) - $movestock = 0; - if ($product->type != Product::TYPE_SERVICE || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) $movestock = 1; - // Check if stock is enough when qty is < 0 // Note that qty should be > 0 with type 0 or 3, < 0 with type 1 or 2. if ($movestock && $qty < 0 && empty($conf->global->STOCK_ALLOW_NEGATIVE_TRANSFER)) { @@ -391,7 +398,7 @@ class MouvementStock extends CommonObject } } - if ($movestock && $entrepot_id > 0) { // Change stock for current product, change for subproduct is done after + if ($movestock) { // Change stock for current product, change for subproduct is done after // Set $origintype, fk_origin, fk_project $fk_project = 0; if (!empty($this->origin)) { // This is set by caller for tracking reason @@ -520,27 +527,16 @@ class MouvementStock extends CommonObject } } - // Update detail stock for batch product + // Update detail of stock for the lot. if (!$error && !empty($conf->productbatch->enabled) && $product->hasbatch() && !$skip_batch) { - // check unicity for serial numbered equipments ( different for lots managed products) - if ( $product->status_batch == 2 && $qty > 0 ) { - if ( $this->getBatchCount($fk_product, $batch) > 0 ) { - $error++; - $this->errors[] = $langs->trans("SerialNumberAlreadyInUse", $batch, $product->ref); - } elseif ( $qty > 1 ) { - $error++; - $this->errors[] = $langs->trans("TooManyQtyForSerialNumber", $product->ref, $batch); - } + if ($id_product_batch > 0) { + $result = $this->createBatch($id_product_batch, $qty); + } else { + $param_batch = array('fk_product_stock' =>$fk_product_stock, 'batchnumber'=>$batch); + $result = $this->createBatch($param_batch, $qty); } - - if ( ! $error ) { - if ($id_product_batch > 0) { - $result = $this->createBatch($id_product_batch, $qty); - } else { - $param_batch = array('fk_product_stock' =>$fk_product_stock, 'batchnumber'=>$batch); - $result = $this->createBatch($param_batch, $qty); - } - if ($result < 0) $error++; + if ($result < 0) { + $error++; } } @@ -580,6 +576,16 @@ class MouvementStock extends CommonObject $result = $this->call_trigger('STOCK_MOVEMENT', $user); if ($result < 0) $error++; // End call triggers + + // Check unicity for serial numbered equipments once all movement were done. + if (!$error && !empty($conf->productbatch->enabled) && $product->hasbatch() && !$skip_batch) { + if ($product->status_batch == 2 && $qty > 0) { // We check only if we increased qty + if ($this->getBatchCount($fk_product, $batch) > 1) { + $error++; + $this->errors[] = $langs->trans("TooManyQtyForSerialNumber", $batch, $product->ref); + } + } + } } if (!$error) { @@ -1199,16 +1205,14 @@ class MouvementStock extends CommonObject } /** - * Retrieve number of equipments for a product batch + * Retrieve number of equipments for a product lot/serial * - * @param int $fk_product Product id - * @param varchar $batch batch number - * @return int <0 if KO, number of equipments if OK + * @param int $fk_product Product id + * @param string $batch batch number + * @return int <0 if KO, number of equipments found if OK */ private function getBatchCount($fk_product, $batch) { - global $conf; - $cpt = 0; $sql = "SELECT sum(pb.qty) as cpt"; From 1d5b8cbb19f82a4c6192ee1c66bd677f5ce2a9bc Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Wed, 26 May 2021 14:59:28 +0200 Subject: [PATCH 0253/1497] Fix Quadra accountancy export for due date --- htdocs/accountancy/class/accountancyexport.class.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 114d0edf35a..0459c20a380 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -498,9 +498,8 @@ class AccountancyExport $Tab['contrepartie'] = str_repeat(' ', 8); // elarifr: date format must be fixed format : 6 char ddmmyy = %d%m%yand not defined by user / dolibarr setting - if (!empty($data->date_echeance)) - //$Tab['date_echeance'] = dol_print_date($data->date_echeance, $conf->global->ACCOUNTING_EXPORT_DATE); - $Tab['date_echeance'] = dol_print_date($data->date_echeance, '%d%m%y'); // elarifr: format must be ddmmyy + if (!empty($data->date_lim_reglement)) + $Tab['date_echeance'] = dol_print_date($data->date_lim_reglement, '%d%m%y'); // elarifr: format must be ddmmyy else $Tab['date_echeance'] = '000000'; From b3a6bcd34f6b66a69b8614eadb4d1b9b8c90da0c Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Wed, 26 May 2021 15:01:31 +0200 Subject: [PATCH 0254/1497] Fix Winfic accountancy export for due date --- htdocs/accountancy/class/accountancyexport.class.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 6fd3518689d..358d0e282c8 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -617,9 +617,8 @@ class AccountancyExport $Tab['code_stat'] = str_repeat(' ', 4); - if (!empty($data->date_echeance)) - //$Tab['date_echeance'] = dol_print_date($data->date_echeance, $conf->global->ACCOUNTING_EXPORT_DATE); - $Tab['date_echeance'] = dol_print_date($data->date_echeance, '%d%m%Y'); + if (!empty($data->date_lim_reglement)) + $Tab['date_echeance'] = dol_print_date($data->date_lim_reglement, '%d%m%Y'); else $Tab['date_echeance'] = dol_print_date($data->doc_date, '%d%m%Y'); From 7c41be7f0a5069aeca89e40b3e8c4bbd8b4b8967 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 May 2021 15:22:49 +0200 Subject: [PATCH 0255/1497] FIX Navigation in list of holiday --- htdocs/holiday/view_log.php | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/htdocs/holiday/view_log.php b/htdocs/holiday/view_log.php index a2ecbe1e8b3..cd43e03f957 100644 --- a/htdocs/holiday/view_log.php +++ b/htdocs/holiday/view_log.php @@ -373,7 +373,7 @@ if (!empty($arrayfields['cpl.fk_type']['checked'])) { // Filter: Previous balance if (!empty($arrayfields['cpl.prev_solde']['checked'])) { - print '
    '; } @@ -385,7 +385,7 @@ if (!empty($arrayfields['variation']['checked'])) { // Filter: New Balance if (!empty($arrayfields['cpl.new_solde']['checked'])) { - print ''; } @@ -428,12 +428,20 @@ if (!empty($arrayfields['cpl.new_solde']['checked'])) { print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); print ''; -// TODO: $i = 0; -$i = 1; +$j = 0; +while ($j < ($page * $limit)) { + $obj = next($object->logs); + $j++; +} + +$i = 0; while ($i < min($num, $limit)) { //TODO: $obj = $db->fetch_object($resql); - $obj = next($object->logs); + $obj = current($object->logs); + if (empty($obj)) { + break; + } $holidaylogstatic->id = $obj['rowid']; $holidaylogstatic->date = $obj['date_action']; @@ -511,6 +519,7 @@ while ($i < min($num, $limit)) { print ''; $i++; + next($object->logs); } if ($log_holiday == '2') { From 48945533e43e62dffc981fe06362cbd67ade836b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 May 2021 15:22:56 +0200 Subject: [PATCH 0256/1497] Clean code --- htdocs/holiday/class/holiday.class.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index ffd394a35b3..55dd1c4bafb 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -1992,8 +1992,6 @@ class Holiday extends CommonObject */ public function fetchLog($order, $filter) { - global $langs; - $sql = "SELECT"; $sql .= " cpl.rowid,"; $sql .= " cpl.date_action,"; From 421681cda4c9ed77c8fefcaece3f18681a1fe01f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 May 2021 15:22:49 +0200 Subject: [PATCH 0257/1497] FIX Navigation in list of holiday Conflicts: htdocs/holiday/view_log.php --- htdocs/holiday/view_log.php | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/htdocs/holiday/view_log.php b/htdocs/holiday/view_log.php index 2f2e223c87c..86562ef5f96 100644 --- a/htdocs/holiday/view_log.php +++ b/htdocs/holiday/view_log.php @@ -323,7 +323,7 @@ if (!empty($arrayfields['cpl.fk_type']['checked'])) { // Filter: Previous balance if (!empty($arrayfields['cpl.prev_solde']['checked'])) { - print ''; } @@ -335,7 +335,7 @@ if (!empty($arrayfields['variation']['checked'])) { // Filter: New Balance if (!empty($arrayfields['cpl.new_solde']['checked'])) { - print ''; } @@ -360,13 +360,20 @@ if (!empty($arrayfields['cpl.new_solde']['checked'])) print_liste_field_titre($a print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); print ''; -// TODO: $i = 0; -$i = 1; -while ($i < min($num, $limit)) -{ - //TODO: $obj = $db->fetch_object($resql); +$j = 0; +while ($j < ($page * $limit)) { $obj = next($object->logs); + $j++; +} + +$i = 0; +while ($i < min($num, $limit)) { + //TODO: $obj = $db->fetch_object($resql); + $obj = current($object->logs); + if (empty($obj)) { + break; + } $holidaylogstatic->id = $obj['rowid']; $holidaylogstatic->date = $obj['date_action']; @@ -444,6 +451,7 @@ while ($i < min($num, $limit)) print ''; $i++; + next($object->logs); } if ($log_holiday == '2') { From 8dd2af42df87ff1fc8d0968c4303682695177a43 Mon Sep 17 00:00:00 2001 From: Antonin MARCHAL Date: Wed, 26 May 2021 16:44:35 +0200 Subject: [PATCH 0258/1497] fix(param) select_produits_fournisseur_list --- htdocs/core/class/html.form.class.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index a088f276463..04cfe53ef5d 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3025,6 +3025,10 @@ class Form global $langs, $conf; global $price_level, $status, $finished; + if(empty($status)){ + $status = 1; + } + $selected_input_value = ''; if (!empty($conf->use_javascript_ajax) && !empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) { if ($selected > 0) { @@ -3040,7 +3044,7 @@ class Form print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); print ($hidelabel ? '' : $langs->trans("RefOrLabel").' : ').''; } else { - print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', -1, 0, 0, $alsoproductwithnosupplierprice, $morecss, 0, $placeholder); + print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', $status, 0, 0, $alsoproductwithnosupplierprice, $morecss, 0, $placeholder); } } @@ -3054,7 +3058,7 @@ class Form * @param string $filtertype Filter on product type (''=nofilter, 0=product, 1=service) * @param string $filtre Pour filtre sql * @param string $filterkey Filtre des produits - * @param int $statut -1=Return all products, 0=Products not on sell, 1=Products on sell (not used here, a filter on tobuy is already hard coded in request) + * @param int $statut -1=Return all products, 0=Products not on buy, 1=Products on buy * @param int $outputmode 0=HTML select string, 1=Array * @param int $limit Limit of line number * @param int $alsoproductwithnosupplierprice 1=Add also product without supplier prices @@ -3107,7 +3111,9 @@ class Form $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_units u ON u.rowid = p.fk_unit"; } $sql .= " WHERE p.entity IN (".getEntity('product').")"; - $sql .= " AND p.tobuy = 1"; + if($statut != -1){ + $sql .= " AND p.tobuy = ".$statut; + } if (strval($filtertype) != '') { $sql .= " AND p.fk_product_type=".$this->db->escape($filtertype); } From 9c83bdff519aa2a6ce88ad98083efcbb79c6b184 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Wed, 26 May 2021 17:02:34 +0200 Subject: [PATCH 0259/1497] FIX : Add parameters (object and action) for user list DoActions hook --- htdocs/user/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/list.php b/htdocs/user/list.php index 1f59656dcbd..e2b4fd3889d 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -154,7 +154,7 @@ if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; } if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend' && $massaction != 'confirm_createbills') { $massaction = ''; } $parameters = array(); -$reshook = $hookmanager->executeHooks('doActions', $parameters); // Note that $action and $object may have been modified by some hooks +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if (empty($reshook)) From d11d1a2018fd17b5538550f2e7c2fe40905ffa86 Mon Sep 17 00:00:00 2001 From: Antonin MARCHAL Date: Wed, 26 May 2021 17:10:12 +0200 Subject: [PATCH 0260/1497] lint(stickler) --- htdocs/core/class/html.form.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 04cfe53ef5d..b362b177ac0 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3025,7 +3025,7 @@ class Form global $langs, $conf; global $price_level, $status, $finished; - if(empty($status)){ + if (empty($status)) { $status = 1; } @@ -3058,7 +3058,7 @@ class Form * @param string $filtertype Filter on product type (''=nofilter, 0=product, 1=service) * @param string $filtre Pour filtre sql * @param string $filterkey Filtre des produits - * @param int $statut -1=Return all products, 0=Products not on buy, 1=Products on buy + * @param int $statut -1=Return all products, 0=Products not on buy, 1=Products on buy * @param int $outputmode 0=HTML select string, 1=Array * @param int $limit Limit of line number * @param int $alsoproductwithnosupplierprice 1=Add also product without supplier prices @@ -3111,7 +3111,7 @@ class Form $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_units u ON u.rowid = p.fk_unit"; } $sql .= " WHERE p.entity IN (".getEntity('product').")"; - if($statut != -1){ + if ($statut != -1) { $sql .= " AND p.tobuy = ".$statut; } if (strval($filtertype) != '') { From c3c0ad1c8d8d980fc36bb25350971e92a3d9dcb7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 May 2021 17:20:09 +0200 Subject: [PATCH 0261/1497] Update html.form.class.php --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index b362b177ac0..bb551300e67 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3112,7 +3112,7 @@ class Form } $sql .= " WHERE p.entity IN (".getEntity('product').")"; if ($statut != -1) { - $sql .= " AND p.tobuy = ".$statut; + $sql .= " AND p.tobuy = ".((int) $statut); } if (strval($filtertype) != '') { $sql .= " AND p.fk_product_type=".$this->db->escape($filtertype); From 8b1b2019f870a2e06ad8430ac8d724028680ad8d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 May 2021 17:24:27 +0200 Subject: [PATCH 0262/1497] Update html.form.class.php --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index bb551300e67..1f90b5f4fdc 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3025,7 +3025,7 @@ class Form global $langs, $conf; global $price_level, $status, $finished; - if (empty($status)) { + if (!isset($status)) { $status = 1; } From 9952fdb6d32e2bc41f3df69d5575c9fec7fd4b58 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 May 2021 17:45:45 +0200 Subject: [PATCH 0263/1497] FIX #17648 #17712 --- htdocs/contact/card.php | 65 +++++++++++++++++++++++++++-------------- 1 file changed, 43 insertions(+), 22 deletions(-) diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index b337f0980e6..b877909cc58 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -77,12 +77,6 @@ if (!empty($canvas)) { $objcanvas->getCanvas('contact', 'contactcard', $canvas); } -// Security check -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', 'rowid', 0); // If we create a contact with no company (shared contacts), no check on write permission - // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('contactcard', 'globalcard')); @@ -96,6 +90,16 @@ if (!($object->id > 0) && $action == 'view') { exit; } +$triggermodname = 'CONTACT_MODIFY'; +$permissiontoadd = $user->rights->societe->contact->creer; + +// Security check +if ($user->socid) { + $socid = $user->socid; +} +$result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', 'rowid', 0); // If we create a contact with no company (shared contacts), no check on write permission + + /* * Actions */ @@ -144,7 +148,7 @@ if (empty($reshook)) { // Confirmation desactivation - if ($action == 'disable') { + if ($action == 'disable' && !empty($permissiontoadd)) { $object->fetch($id); if ($object->setstatus(0) < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -155,7 +159,7 @@ if (empty($reshook)) { } // Confirmation activation - if ($action == 'enable') { + if ($action == 'enable' && !empty($permissiontoadd)) { $object->fetch($id); if ($object->setstatus(1) < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -166,7 +170,7 @@ if (empty($reshook)) { } // Add contact - if ($action == 'add' && $user->rights->societe->contact->creer) { + if ($action == 'add' && !empty($permissiontoadd)) { $db->begin(); if ($canvas) { @@ -307,7 +311,7 @@ if (empty($reshook)) { } } - if ($action == 'update' && empty($cancel) && $user->rights->societe->contact->creer) { + if ($action == 'update' && empty($cancel) && !empty($permissiontoadd)) { if (!GETPOST("lastname", 'alpha')) { $error++; $errors = array($langs->trans("ErrorFieldRequired", $langs->transnoentities("Name").' / '.$langs->transnoentities("Label"))); $action = 'edit'; @@ -457,7 +461,7 @@ if (empty($reshook)) { } } - if ($action == 'setprospectcontactlevel' && $user->rights->societe->contact->creer) { + if ($action == 'setprospectcontactlevel' && !empty($permissiontoadd)) { $object->fetch($id); $object->fk_prospectlevel = GETPOST('prospect_contact_level_id', 'alpha'); $result = $object->update($object->id, $user); @@ -467,7 +471,7 @@ if (empty($reshook)) { } // set communication status - if ($action == 'setstcomm') { + if ($action == 'setstcomm' && !empty($permissiontoadd)) { $object->fetch($id); $object->stcomm_id = dol_getIdFromCode($db, GETPOST('stcomm', 'alpha'), 'c_stcommcontact'); $result = $object->update($object->id, $user); @@ -476,6 +480,31 @@ if (empty($reshook)) { } } + // Update extrafields + if ($action == "update_extras" && !empty($permissiontoadd)) { + $object->fetch(GETPOST('id', 'int')); + + $attributekey = GETPOST('attribute', 'alpha'); + $attributekeylong = 'options_'.$attributekey; + + if (GETPOSTISSET($attributekeylong.'day') && GETPOSTISSET($attributekeylong.'month') && GETPOSTISSET($attributekeylong.'year')) { + // This is properties of a date + $object->array_options['options_'.$attributekey] = dol_mktime(GETPOST($attributekeylong.'hour', 'int'), GETPOST($attributekeylong.'min', 'int'), GETPOST($attributekeylong.'sec', 'int'), GETPOST($attributekeylong.'month', 'int'), GETPOST($attributekeylong.'day', 'int'), GETPOST($attributekeylong.'year', 'int')); + //var_dump(dol_print_date($object->array_options['options_'.$attributekey]));exit; + } else { + $object->array_options['options_'.$attributekey] = GETPOST($attributekeylong, 'alpha'); + } + + $result = $object->insertExtraFields(empty($triggermodname) ? '' : $triggermodname, $user); + if ($result > 0) { + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); + $action = 'view'; + } else { + setEventMessages($object->error, $object->errors, 'errors'); + $action = 'edit_extras'; + } + } + // Actions to send emails $triggersendname = 'CONTACT_SENTBYMAIL'; $paramname = 'id'; @@ -821,11 +850,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Other attributes $parameters = array('socid' => $socid, 'objsoc' => $objsoc, 'colspan' => ' colspan="3"', 'cols' => 3); - $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit', $parameters); - } + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; print "
    '.$langs->trans("Categories").''; -if (!empty($conf->use_javascript_ajax)) { - print ''; +if ($morethan1level && !empty($conf->use_javascript_ajax)) { + print ''; } print '
    '; tree_recur($data, $data[0], 0); From ba595d8b74b8b7d03e85609ff3d59074cee1721d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 May 2021 16:56:57 +0200 Subject: [PATCH 0118/1497] Minor fix --- htdocs/categories/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index 041226a8131..d338e4d95d4 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -222,7 +222,7 @@ $nbofentries = (count($data) - 1); $morethan1level = 0; foreach($data as $record) { - if (!empty($record['fk_menu'])) { + if (!empty($record['fk_menu']) && $record['fk_menu'] > 0) { $morethan1level = 1; } } From a00ae6c918cee34bec6fcb7771fcd16c0df1d559 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 May 2021 17:00:20 +0200 Subject: [PATCH 0119/1497] css --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a4a2d736746..5e25babbf1d 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1662,7 +1662,7 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab $tabsname = str_replace("@", "", $picto); } $out .= '
    '; - $out .= ''.$langs->trans("More").'... ('.$nbintab.')'; // Do not use "reposition" class in the "More". + $out .= ''.$langs->trans("More").'... ('.$nbintab.')'; // Do not use "reposition" class in the "More". $out .= '
    '; $out .= $outmore; $out .= '
    '; From 271ba884db71b6c9dc91ab47ff127a72b1e95d12 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 May 2021 17:24:17 +0200 Subject: [PATCH 0120/1497] css --- htdocs/core/class/html.form.class.php | 13 +++++++------ htdocs/core/class/html.formactions.class.php | 2 +- htdocs/core/lib/functions.lib.php | 2 +- htdocs/societe/agenda.php | 6 +++--- htdocs/societe/card.php | 8 ++++---- htdocs/societe/price.php | 2 +- htdocs/theme/eldy/btn.inc.php | 3 ++- 7 files changed, 19 insertions(+), 17 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 2d529cd55d6..13893fe42ee 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -8123,13 +8123,14 @@ class Form /** - * Return HTML code to output a barcode + * Return HTML code to output a barcode * - * @param Object $object Object containing data to retrieve file name - * @param int $width Width of photo - * @return string HTML code to output barcode + * @param Object $object Object containing data to retrieve file name + * @param int $width Width of photo + * @param string $morecss More CSS on img of barcode + * @return string HTML code to output barcode */ - public function showbarcode(&$object, $width = 100) + public function showbarcode(&$object, $width = 100, $morecss = '') { global $conf; @@ -8150,7 +8151,7 @@ class Form // Barcode image $url = DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($object->barcode_type_coder).'&code='.urlencode($object->barcode).'&encoding='.urlencode($object->barcode_type_code); $out = ''; - $out .= ''; + $out .= ''; return $out; } diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 0380b26a392..992efb79bbf 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -304,7 +304,7 @@ class FormActions print '
    '.$label.''.dol_print_date($actioncomm->datep, 'dayhour', 'tzuserrel'); + print ''.dol_print_date($actioncomm->datep, 'dayhour', 'tzuserrel'); if ($actioncomm->datef) { $tmpa = dol_getdate($actioncomm->datep); $tmpb = dol_getdate($actioncomm->datef); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 5e25babbf1d..8d171a048b0 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1923,7 +1923,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi } if ($showbarcode) { - $morehtmlleft .= '
    '.$form->showbarcode($object).'
    '; + $morehtmlleft .= '
    '.$form->showbarcode($object, 100, 'photoref').'
    '; } if ($object->element == 'societe') { diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index 8789427c64b..ec59482b345 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -166,12 +166,12 @@ if ($socid > 0) { if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { print '
    '; - $param = '&socid='.$socid; + $param = '&socid='.urlencode($socid); if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { - $param .= '&contextpage='.$contextpage; + $param .= '&contextpage='.urlencode($contextpage); } if ($limit > 0 && $limit != $conf->liste_limit) { - $param .= '&limit='.$limit; + $param .= '&limit='.urlencode($limit); } print load_fiche_titre($langs->trans("ActionsOnCompany"), $newcardbutton, ''); diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 3493ccc3f00..4973a328023 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2844,10 +2844,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if (empty($user->socid)) { if (!empty($object->email) || $at_least_one_email_contact) { $langs->load("mails"); - print ''.$langs->trans('SendMail').''; + print ''.$langs->trans('SendMail').''."\n"; } else { $langs->load("mails"); - print ''.$langs->trans('SendMail').''; + print ''.$langs->trans('SendMail').''."\n"; } } @@ -2859,12 +2859,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $adh = new Adherent($db); $result = $adh->fetch('', '', $object->id); if ($result == 0 && ($object->client == 1 || $object->client == 3) && !empty($conf->global->MEMBER_CAN_CONVERT_CUSTOMERS_TO_MEMBERS)) { - print ''.$langs->trans("NewMember").''; + print ''.$langs->trans("NewMember").''."\n"; } } if ($user->rights->societe->supprimer) { - print ''.$langs->trans('Merge').''; + print ''.$langs->trans('Merge').''."\n"; } if ($user->rights->societe->supprimer) { diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index cc056896414..b46a6124396 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -206,7 +206,7 @@ dol_banner_tab($object, 'socid', $linkback, ($user->socid ? 0 : 1), 'rowid', 'no print '
    '; print '
    '; -print ''; +print '
    '; if (!empty($conf->global->SOCIETE_USEPREFIX)) { // Old not used prefix field print ''; diff --git a/htdocs/theme/eldy/btn.inc.php b/htdocs/theme/eldy/btn.inc.php index 6f05daba22f..d874266f81d 100644 --- a/htdocs/theme/eldy/btn.inc.php +++ b/htdocs/theme/eldy/btn.inc.php @@ -50,7 +50,8 @@ if (!empty($conf->global->THEME_DARKMODEENABLED)) { margin-bottom: 1.4em; }*/ div.tabsAction > a.butAction, div.tabsAction > a.butActionRefused, div.tabsAction > a.butActionDelete, -div.tabsAction > span.butAction, div.tabsAction > span.butActionRefused, div.tabsAction > span.butActionDelete { +div.tabsAction > span.butAction, div.tabsAction > span.butActionRefused, div.tabsAction > span.butActionDelete, +div.tabsAction > div.divButAction > span.butAction { margin-bottom: 1.4em !important; margin-right: 0px !important; } From f99b1b261a1bb7596a0cb8499dc43a30d2f43540 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 May 2021 17:25:31 +0200 Subject: [PATCH 0121/1497] Fix phpcs --- htdocs/categories/index.php | 2 +- htdocs/theme/eldy/global.inc.php | 2 +- htdocs/theme/md/style.css.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index d338e4d95d4..065b4dfa83e 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -221,7 +221,7 @@ foreach ($fulltree as $key => $val) { $nbofentries = (count($data) - 1); $morethan1level = 0; -foreach($data as $record) { +foreach ($data as $record) { if (!empty($record['fk_menu']) && $record['fk_menu'] > 0) { $morethan1level = 1; } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 67192c7063e..e451a2af30b 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1493,7 +1493,7 @@ select.widthcentpercentminusxx, span.widthcentpercentminusxx:not(.select2-select } .smallonsmartphone { - font-size: 0.8em; + font-size: 0.8em; } } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 866d6c9f3d7..1ebe047ead7 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1504,7 +1504,7 @@ table[summary="list_of_modules"] .fa-cog { } .smallonsmartphone { - font-size: 0.8em; + font-size: 0.8em; } } From 6cccd77508d2c41c5860bfa9098a1e7bd4b090da Mon Sep 17 00:00:00 2001 From: Florian Mortgat Date: Tue, 18 May 2021 17:57:23 +0200 Subject: [PATCH 0122/1497] FIX 13.0 - error message says MAIN_DISABLE_ALL_MAILS is set when it isn't + unhandled swiftmailer error (failed recipients due to RFC 2822 non-compliance) --- htdocs/core/actions_massactions.inc.php | 4 +++- htdocs/core/class/CMailFile.class.php | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 6b6d5854a1d..99f1271ff0b 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -559,8 +559,10 @@ if (!$error && $massaction == 'confirm_presend') { $resaction .= $langs->trans('ErrorFailedToSendMail', $from, $sendto); $resaction .= '
    '.$mailfile->error.'
    '; - } else { + } elseif (!empty($conf->global->MAIN_DISABLE_ALL_MAILS)) { $resaction .= '
    No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS
    '; + } else { + $resaction .= $langs->trans('ErrorFailedToSendMail', $from, $sendto) . '
    (unhandled error)
    '; } } } diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index c942127aab3..67c3387fbc8 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -894,7 +894,7 @@ class CMailFile } // send mail try { - $result = $this->mailer->send($this->message); + $result = $this->mailer->send($this->message, $failedRecipients); } catch (Exception $e) { $this->error = $e->getMessage(); } @@ -902,6 +902,9 @@ class CMailFile $res = true; if (!empty($this->error) || !$result) { + if (!empty($failedRecipients)) { + $this->error = 'Transport failed for the following addresses: "' . join('", "', $failedRecipients) . '".'; + } dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR); $res = false; } else { From 8e39eff180a2472a15d146bc5c0aab7eaf9afa11 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 May 2021 18:18:00 +0200 Subject: [PATCH 0123/1497] Look and feel v14 --- htdocs/comm/propal/list.php | 22 ++++++++-------- htdocs/commande/list.php | 8 +++--- htdocs/compta/facture/class/facture.class.php | 4 +-- htdocs/compta/facture/list.php | 4 +-- htdocs/contrat/list.php | 4 +-- htdocs/user/class/user.class.php | 26 ++++++++++++++----- 6 files changed, 41 insertions(+), 27 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index b810ab242b6..48ad9783367 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -176,8 +176,8 @@ $arrayfields = array( 'pr.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1)), 'pr.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1)), 's.nom'=>array('label'=>"ThirdParty", 'checked'=>1), - 's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>1), - 's.town'=>array('label'=>"Town", 'checked'=>1), + 's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>-1), + 's.town'=>array('label'=>"Town", 'checked'=>-1), 's.zip'=>array('label'=>"Zip", 'checked'=>1), 'state.nom'=>array('label'=>"StateShort", 'checked'=>0), 'country.code_iso'=>array('label'=>"Country", 'checked'=>0), @@ -203,7 +203,7 @@ $arrayfields = array( 'p.multicurrency_total_ht_invoiced'=>array('label'=>'MulticurrencyAmountInvoicedHT', 'checked'=>0, 'enabled'=>!empty($conf->multicurrency->enabled) && !empty($conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT)), 'p.multicurrency_total_invoiced'=>array('label'=>'MulticurrencyAmountInvoicedTTC', 'checked'=>0, 'enabled'=>!empty($conf->multicurrency->enabled) && !empty($conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT)), 'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>10), - 'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>1), + 'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>-1), 'p.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), 'p.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500), 'p.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>500), @@ -560,7 +560,7 @@ if ($search_societe_alias) { $sql .= natural_search('s.name_alias', $search_societe_alias); } if ($search_login) { - $sql .= natural_search("u.login", $search_login); + $sql .= natural_search(array("u.login", "u.firstname", "u.lastname"), $search_login); } if ($search_montant_ht != '') { $sql .= natural_search("p.total_ht", $search_montant_ht, 1); @@ -616,7 +616,7 @@ if ($search_product_category > 0) { $sql .= " AND cp.fk_categorie = ".$db->escape($search_product_category); } if ($socid > 0) { - $sql .= ' AND s.rowid = '.$socid; + $sql .= ' AND s.rowid = '.((int) $socid); } if ($search_status != '' && $search_status != '-1') { $sql .= ' AND p.fk_statut IN ('.$db->sanitize($search_status).')'; @@ -640,10 +640,10 @@ if ($search_datedelivery_end) { $sql .= " AND p.date_livraison <= '".$db->idate($search_datedelivery_end)."'"; } if ($search_sale > 0) { - $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$db->escape($search_sale); + $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $search_sale); } if ($search_user > 0) { - $sql .= " AND c.fk_c_type_contact = tc.rowid AND tc.element='propal' AND tc.source='internal' AND c.element_id = p.rowid AND c.fk_socpeople = ".$db->escape($search_user); + $sql .= " AND c.fk_c_type_contact = tc.rowid AND tc.element='propal' AND tc.source='internal' AND c.element_id = p.rowid AND c.fk_socpeople = ".((int) $search_user); } // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; @@ -907,14 +907,14 @@ if ($resql) { $moreforfilter .= '
    '; $tmptitle = $langs->trans('IncludingProductWithTag'); $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1); - $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1); + $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, (empty($conf->dol_optimize_smallscreen) ? 'maxwidth300' : 'maxwidth250'), 1); $moreforfilter .= '
    '; } if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
    '; $tmptitle = $langs->trans('CustomersProspectsCategoriesShort'); - $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$formother->select_categories('customer', $search_categ_cus, 'search_categ_cus', 1, $tmptitle); + $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$formother->select_categories('customer', $search_categ_cus, 'search_categ_cus', 1, $tmptitle, (empty($conf->dol_optimize_smallscreen) ? 'maxwidth300' : 'maxwidth250')); $moreforfilter .= '
    '; } if (!empty($conf->stock->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL)) { @@ -1715,7 +1715,7 @@ if ($resql) { // Author if (!empty($arrayfields['u.login']['checked'])) { - print '
    '; print '\n"; diff --git a/htdocs/user/list.php b/htdocs/user/list.php index a697fdf96c0..596670e6ce2 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -68,7 +68,7 @@ $pagenext = $page + 1; // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $object = new User($db); $extrafields = new ExtraFields($db); -$diroutputmassaction = $conf->mymodule->dir_output.'/temp/massgeneration/'.$user->id; +$diroutputmassaction = empty($conf->mymodule->dir_output) ? '' : $conf->mymodule->dir_output.'/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('userlist')); // Fetch optionals attributes and labels @@ -124,9 +124,9 @@ $arrayfields = array( 'u.office_phone'=>array('label'=>"PhonePro", 'checked'=>1, 'position'=>31), 'u.user_mobile'=>array('label'=>"PhoneMobile", 'checked'=>1, 'position'=>32), 'u.email'=>array('label'=>"EMail", 'checked'=>1, 'position'=>35), - 'u.api_key'=>array('label'=>"ApiKey", 'checked'=>0, 'position'=>40, "enabled"=>($conf->api->enabled && $user->admin)), + 'u.api_key'=>array('label'=>"ApiKey", 'checked'=>0, 'position'=>40, "enabled"=>(!empty($conf->api->enabled) && $user->admin)), 'u.fk_soc'=>array('label'=>"Company", 'checked'=>($contextpage == 'employeelist' ? 0 : 1), 'position'=>45), - 'u.salary'=>array('label'=>"Salary", 'checked'=>1, 'position'=>80, 'enabled'=>($conf->salaries->enabled && !empty($user->rights->salaries->readall))), + 'u.salary'=>array('label'=>"Salary", 'checked'=>1, 'position'=>80, 'enabled'=>(!empty($conf->salaries->enabled) && !empty($user->rights->salaries->readall))), 'u.datelastlogin'=>array('label'=>"LastConnexion", 'checked'=>1, 'position'=>100), 'u.datepreviouslogin'=>array('label'=>"PreviousConnexion", 'checked'=>0, 'position'=>110), 'u.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), @@ -345,7 +345,7 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // N $sql .= preg_replace('/^,/', '', $hookmanager->resPrint); $sql = preg_replace('/,\s*$/', '', $sql); $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; -if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { +if (key_exists('label', $extrafields->attributes[$object->table_element]) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (u.rowid = ef.fk_object)"; } $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON u.fk_soc = s.rowid"; @@ -577,7 +577,7 @@ if (!empty($socid)) { $newcardbutton = dolGetButtonTitle($langs->trans('NewUser'), '', 'fa fa-plus-circle', $url, '', $permissiontoadd); $moreparam = array('morecss'=>'btnTitleSelected'); -$morehtmlright .= dolGetButtonTitle($langs->trans("List"), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/user/list.php'.(($search_statut != '' && $search_statut >= 0) ? '?search_statut='.$search_statut : ''), '', 1, $moreparam); +$morehtmlright = dolGetButtonTitle($langs->trans("List"), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/user/list.php'.(($search_statut != '' && $search_statut >= 0) ? '?search_statut='.$search_statut : ''), '', 1, $moreparam); $moreparam = array('morecss'=>'marginleftonly'); $morehtmlright .= dolGetButtonTitle($langs->trans("HierarchicView"), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/user/hierarchy.php'.(($search_statut != '' && $search_statut >= 0) ? '?search_statut='.$search_statut : ''), '', 1, $moreparam); @@ -808,7 +808,7 @@ print ''."\n"; // Detect if we need a fetch on each output line $needToFetchEachLine = 0; -if (is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { +if (key_exists('computed', $extrafields->attributes[$object->table_element]) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) { if (preg_match('/\$object/', $val)) { $needToFetchEachLine++; // There is at least one compute field that use $object @@ -821,6 +821,7 @@ if (is_array($extrafields->attributes[$object->table_element]['computed']) && co // -------------------------------------------------------------------- $i = 0; $totalarray = array(); +$totalarray['nbfield'] = 0; $arrayofselected = is_array($toselect) ? $toselect : array(); while ($i < ($limit ? min($num, $limit) : $num)) { $obj = $db->fetch_object($resql); @@ -833,7 +834,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { $userstatic->id = $obj->rowid; $userstatic->admin = $obj->admin; - $userstatic->ref = $obj->label; + $userstatic->ref = empty($obj->label) ? '' : $obj->label; $userstatic->login = $obj->login; $userstatic->statut = $obj->statut; $userstatic->office_phone = $obj->office_phone; @@ -928,6 +929,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { $totalarray['nbfield']++; } } + if (empty($obj->country_code)) $obj->country_code = ''; if (!empty($arrayfields['u.office_phone']['checked'])) { print "\n"; if (!$i) { @@ -940,6 +942,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { $totalarray['nbfield']++; } } + if (empty($obj->socid)) $obj->socid = 0; if (!empty($arrayfields['u.email']['checked'])) { print '\n"; if (!$i) { From 4d422356708088006496784e4c377ac507550d54 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 May 2021 20:46:14 +0200 Subject: [PATCH 0127/1497] Complete experimental module knowledge management --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 2 ++ .../mysql/tables/llx_knowledgemanagement_knowledgerecord.sql | 1 + 2 files changed, 3 insertions(+) diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index cf5da55d719..b95ea30f8fb 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -492,12 +492,14 @@ CREATE TABLE llx_knowledgemanagement_knowledgerecord( model_pdf varchar(255), question text NOT NULL, answer text, + url varchar(255), fk_ticket integer, status integer NOT NULL -- END MODULEBUILDER FIELDS ) ENGINE=innodb; ALTER TABLE llx_knowledgemanagement_knowledgerecord ADD COLUMN fk_ticket integer; +ALTER TABLE llx_knowledgemanagement_knowledgerecord ADD COLUMN url varchar(255); create table llx_knowledgemanagement_knowledgerecord_extrafields diff --git a/htdocs/install/mysql/tables/llx_knowledgemanagement_knowledgerecord.sql b/htdocs/install/mysql/tables/llx_knowledgemanagement_knowledgerecord.sql index 5c9e4cf199f..c5332372019 100644 --- a/htdocs/install/mysql/tables/llx_knowledgemanagement_knowledgerecord.sql +++ b/htdocs/install/mysql/tables/llx_knowledgemanagement_knowledgerecord.sql @@ -28,6 +28,7 @@ CREATE TABLE llx_knowledgemanagement_knowledgerecord( model_pdf varchar(255), question text NOT NULL, answer text, + url varchar(255), fk_ticket integer, status integer NOT NULL -- END MODULEBUILDER FIELDS From dffb244776029295a1b947c4824fc71edb970b2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 18 May 2021 21:04:43 +0200 Subject: [PATCH 0128/1497] Update AutoLoader.php --- .../includes/restler/framework/Luracast/Restler/AutoLoader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/includes/restler/framework/Luracast/Restler/AutoLoader.php b/htdocs/includes/restler/framework/Luracast/Restler/AutoLoader.php index 5ed160a070a..b11506ea86c 100644 --- a/htdocs/includes/restler/framework/Luracast/Restler/AutoLoader.php +++ b/htdocs/includes/restler/framework/Luracast/Restler/AutoLoader.php @@ -263,7 +263,7 @@ class AutoLoader * @return bool false unless className now exists */ private function loadLastResort($className, $loader = null) { - $loaders = array_unique(static::$rogueLoaders); + $loaders = array_unique(static::$rogueLoaders, SORT_REGULAR); if (isset($loader)) { if (false === array_search($loader, $loaders)) static::$rogueLoaders[] = $loader; From f86e10b453c06e023db5581ec749c013902ea392 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 19 May 2021 06:37:02 +0200 Subject: [PATCH 0129/1497] FIX wrong variable fk_code_ventilation register for addline --- htdocs/fourn/class/fournisseur.facture.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index f1f5c8fb969..62a734174b3 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1830,7 +1830,7 @@ class FactureFournisseur extends CommonInvoice $this->line->remise_percent = $remise_percent; $this->line->date_start = $date_start; $this->line->date_end = $date_end; - $this->line->ventil = $ventil; + $this->line->fk_code_ventilation = $ventil; $this->line->rang = $rang; $this->line->info_bits = $info_bits; From 5fd02992c0b636cbc55e2daee9f67a8a846f516e Mon Sep 17 00:00:00 2001 From: ATM john Date: Wed, 19 May 2021 10:26:04 +0200 Subject: [PATCH 0130/1497] Remove forgotten echo --- htdocs/product/price.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index b783ad5c002..7a758137133 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -1477,7 +1477,7 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul } print ''; - print $conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL; + if (empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) print ''; print ''; print ''; From 78cf2b59c80142b2df015861fd4b1542fb622ea4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 May 2021 11:47:58 +0200 Subject: [PATCH 0131/1497] Debug feature copy-paste on smarpthone --- htdocs/core/js/lib_foot.js.php | 8 ++++---- htdocs/core/lib/functions.lib.php | 9 ++++++++- htdocs/theme/eldy/btn.inc.php | 7 ++++++- htdocs/theme/eldy/global.inc.php | 4 ++++ htdocs/theme/md/style.css.php | 4 ++++ 5 files changed, 26 insertions(+), 6 deletions(-) diff --git a/htdocs/core/js/lib_foot.js.php b/htdocs/core/js/lib_foot.js.php index c0a8844b572..20debf50f12 100644 --- a/htdocs/core/js/lib_foot.js.php +++ b/htdocs/core/js/lib_foot.js.php @@ -214,17 +214,17 @@ print ' print "\n/* JS CODE TO ENABLE ClipBoard copy paste*/\n"; print 'jQuery(\'.clipboardCPShowOnHover\').hover( function() { - console.log("We hover a value with a copy paste feature"); + console.log("We hover a value with a copy paste feature"); $(this).children(".clipboardCPButton, .clipboardCPText").show(); }, function() { - console.log("We hover out the value with a copy paste feature"); + console.log("We hover out the value with a copy paste feature"); $(this).children(".clipboardCPButton, .clipboardCPText").hide(); } );'; -print 'jQuery(\'.clipboardCPButton\').click(function() { +print 'jQuery(\'.clipboardCPButton, .clipboardCPValueToPrint\').click(function() { /* console.log(this.parentNode); */ - console.log("We click on a clipboardCPButton tag"); + console.log("We click on a clipboardCPButton or clipboardCPValueToPrint class"); if (window.getSelection) { selection = window.getSelection(); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 8d171a048b0..abf9c587b68 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -10236,7 +10236,8 @@ function readfileLowMemory($fullpath_original_file_osencoded, $method = -1) } /** - * Create a button to copy $valuetocopy in the clipboard + * Create a button to copy $valuetocopy in the clipboard. + * Code that handle the click is inside lib_foot.jsp.php * * @param string $valuetocopy The value to print * @param int $showonlyonhover Show the copy-paste button only on hover @@ -10245,6 +10246,12 @@ function readfileLowMemory($fullpath_original_file_osencoded, $method = -1) */ function showValueWithClipboardCPButton($valuetocopy, $showonlyonhover = 1, $texttoshow = '') { + global $conf; + + /*if (!empty($conf->dol_no_mouse_hover)) { + $showonlyonhover = 0; + }*/ + if ($texttoshow) { $result = ''.$valuetocopy.''.$texttoshow.''; } else { diff --git a/htdocs/theme/eldy/btn.inc.php b/htdocs/theme/eldy/btn.inc.php index d874266f81d..a05a8dc7952 100644 --- a/htdocs/theme/eldy/btn.inc.php +++ b/htdocs/theme/eldy/btn.inc.php @@ -51,7 +51,12 @@ if (!empty($conf->global->THEME_DARKMODEENABLED)) { }*/ div.tabsAction > a.butAction, div.tabsAction > a.butActionRefused, div.tabsAction > a.butActionDelete, div.tabsAction > span.butAction, div.tabsAction > span.butActionRefused, div.tabsAction > span.butActionDelete, -div.tabsAction > div.divButAction > span.butAction { +div.tabsAction > div.divButAction > span.butAction, +div.tabsAction > div.divButAction > span.butActionDelete, +div.tabsAction > div.divButAction > span.butActionRefused, +div.tabsAction > div.divButAction > a.butAction, +div.tabsAction > div.divButAction > a.butActionDelete, +div.tabsAction > div.divButAction > a.butActionRefused { margin-bottom: 1.4em !important; margin-right: 0px !important; } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index e451a2af30b..8a1cc74de8c 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -6770,10 +6770,14 @@ div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link:before /* For copy-paste feature */ /* ============================================================================== */ +span.clipboardCPValueToPrint { + display: inline-block; +} span.clipboardCPValue.hidewithsize { width: 0 !important; display: inline-block; color: transparent; + white-space: nowrap; } .clipboardCPShowOnHover .clipboardCPButton { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 1ebe047ead7..1ade055a9ef 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -6634,10 +6634,14 @@ div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link:before /* For copy-paste feature */ /* ============================================================================== */ +span.clipboardCPValueToPrint { + display: inline-block; +} span.clipboardCPValue.hidewithsize { width: 0 !important; display: inline-block; color: transparent; + white-space: nowrap; } .clipboardCPShowOnHover .clipboardCPButton { From 9219dcfecb048e9778cf4815297f792af5fed601 Mon Sep 17 00:00:00 2001 From: ATM john Date: Wed, 19 May 2021 11:52:34 +0200 Subject: [PATCH 0132/1497] Fix price log spam --- htdocs/product/class/product.class.php | 40 +++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 188bcbfd355..124990d09e1 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1534,6 +1534,38 @@ class Product extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * check if price have really change to avoid log pollution + * + * @param int $level price level to change + * @return int <0 if KO, >0 if OK + */ + private function getArrayForPriceCompare($level = 0) + { + // phpcs:enable + + $testExit = array('multiprices','multiprices_ttc','multiprices_base_type','multiprices_min','multiprices_min_ttc','multiprices_tva_tx','multiprices_recuperableonly'); + + foreach ($testExit as $field){ + if (!isset($this->$field[$level])) { + return array(); + } + } + + $lastPrice = array( + 'level' => $level ? $level : 1, + 'multiprices' => doubleval($this->multiprices[$level]), + 'multiprices_ttc' => doubleval($this->multiprices_ttc[$level]), + 'multiprices_base_type' => $this->multiprices_base_type[$level], + 'multiprices_min' => doubleval($this->multiprices_min[$level]), + 'multiprices_min_ttc' => doubleval($this->multiprices_min_ttc[$level]), + 'multiprices_tva_tx' => doubleval($this->multiprices_tva_tx[$level]), + 'multiprices_recuperableonly' => doubleval($this->multiprices_recuperableonly[$level]), + ); + + return $lastPrice; + } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -1862,6 +1894,8 @@ class Product extends CommonObject { global $conf, $langs; + $lastPriceData = $this->getArrayForPriceCompare($level); // temporary store current price before update + $id = $this->id; dol_syslog(get_class($this)."::update_price id=".$id." newprice=".$newprice." newpricebase=".$newpricebase." newminprice=".$newminprice." level=".$level." npr=".$newnpr." newdefaultvatcode=".$newdefaultvatcode); @@ -1994,7 +2028,11 @@ class Product extends CommonObject // Price by quantity $this->price_by_qty = $newpbq; - $this->_log_price($user, $level); // Save price for level into table product_price + // check if price have really change before log + $newPriceData = $this->getArrayForPriceCompare($level); + if (!empty(array_diff_assoc($newPriceData, $lastPriceData)) || empty($conf->global->PRODUIT_MULTIPRICES)) { + $this->_log_price($user, $level); // Save price for level into table product_price + } $this->level = $level; // Store level of price edited for trigger From 7b4ed859eb9f5c89466662c61b104fbc28f15090 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 May 2021 11:57:12 +0200 Subject: [PATCH 0133/1497] css --- htdocs/theme/eldy/global.inc.php | 4 ++-- htdocs/theme/md/style.css.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 8a1cc74de8c..988ac6b3ae3 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -902,8 +902,8 @@ span.fa.fa-plus-circle.paddingleft { height: 28px; vertical-align: middle; } -.divsocialnetwork:not(:first-child) { - padding-left: 20px; +.divsocialnetwork:not(:last-child) { + padding-: 20px; } div.divsearchfield { float: ; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 1ade055a9ef..e292b3850d1 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1002,8 +1002,8 @@ body[class*="colorblind-"] .text-success{ height: 28px; vertical-align: middle; } -.divsocialnetwork:not(:first-child) { - padding-left: 20px; +.divsocialnetwork:not(:last-child) { + padding-: 20px; } div.divsearchfield { float: ; From 1512abf96ab4412717c53f4877df56279a9b6921 Mon Sep 17 00:00:00 2001 From: ATM john Date: Wed, 19 May 2021 12:00:27 +0200 Subject: [PATCH 0134/1497] Remove hpcs:disable --- htdocs/product/class/product.class.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 124990d09e1..87fb839b5c9 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1534,7 +1534,6 @@ class Product extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * check if price have really change to avoid log pollution * @@ -1543,7 +1542,6 @@ class Product extends CommonObject */ private function getArrayForPriceCompare($level = 0) { - // phpcs:enable $testExit = array('multiprices','multiprices_ttc','multiprices_base_type','multiprices_min','multiprices_min_ttc','multiprices_tva_tx','multiprices_recuperableonly'); From 3bf71d456ddc80564e29631ba714fe8d6368e096 Mon Sep 17 00:00:00 2001 From: ATM john Date: Wed, 19 May 2021 12:01:47 +0200 Subject: [PATCH 0135/1497] fix doc --- htdocs/product/class/product.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 87fb839b5c9..685180e4659 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1535,10 +1535,10 @@ class Product extends CommonObject } /** - * check if price have really change to avoid log pollution + * used to check if price have really change to avoid log pollution * * @param int $level price level to change - * @return int <0 if KO, >0 if OK + * @return array */ private function getArrayForPriceCompare($level = 0) { From 90835eaab4a740fac3ad46207e54fec7dcdbae43 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 May 2021 12:08:17 +0200 Subject: [PATCH 0136/1497] css --- htdocs/theme/eldy/btn.inc.php | 17 +++++++++++++++++ htdocs/theme/md/btn.inc.php | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/htdocs/theme/eldy/btn.inc.php b/htdocs/theme/eldy/btn.inc.php index a05a8dc7952..7122c252cbe 100644 --- a/htdocs/theme/eldy/btn.inc.php +++ b/htdocs/theme/eldy/btn.inc.php @@ -308,6 +308,23 @@ div.pagination li:first-child a.btnTitle{ } } +/* rule to reduce top menu - 3rd reduction: The menu for user is on left */ +@media only screen and (max-width: global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3) ? round($nbtopmenuentries * 47, 0) + 130 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3; ?>px) /* reduction 3 */ +{ + .butAction, .butActionRefused, .butActionDelete { + font-size: 0.9em; + } +} + +/* smartphone */ +@media only screen and (max-width: 767px) +{ + .butAction, .butActionRefused, .butActionDelete { + font-size: 0.85em; + } +} + + global->MAIN_BUTTON_HIDE_UNAUTHORIZED) && (!$user->admin)) { ?> .butActionRefused, .butActionNewRefused, .btnTitle.refused { display: none !important; diff --git a/htdocs/theme/md/btn.inc.php b/htdocs/theme/md/btn.inc.php index c0d6e2c9cd7..2517415a96f 100644 --- a/htdocs/theme/md/btn.inc.php +++ b/htdocs/theme/md/btn.inc.php @@ -379,6 +379,23 @@ div.pagination .btnTitle:hover .btnTitle-label{ } } +/* rule to reduce top menu - 3rd reduction: The menu for user is on left */ +@media only screen and (max-width: global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3) ? round($nbtopmenuentries * 47, 0) + 130 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3; ?>px) /* reduction 3 */ +{ + .butAction, .butActionRefused, .butActionDelete { + font-size: 0.9em; + } +} + +/* smartphone */ +@media only screen and (max-width: 767px) +{ + .butAction, .butActionRefused, .butActionDelete { + font-size: 0.85em; + } +} + + global->MAIN_BUTTON_HIDE_UNAUTHORIZED) && (!$user->admin)) { ?> .butActionRefused, .butActionNewRefused, .btnTitle.refused { display: none !important; From 75f7ab41f036e123eb1f961d8e8be3f041b68df2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 May 2021 12:13:21 +0200 Subject: [PATCH 0137/1497] css --- htdocs/core/class/html.formfile.class.php | 2 +- htdocs/user/card.php | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 7cf9978d32b..45429512046 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -851,7 +851,7 @@ class FormFile // Show file size $size = (!empty($file['size']) ? $file['size'] : dol_filesize($filedir."/".$file["name"])); - $out .= ''; + $out .= ''; // Show file date $date = (!empty($file['date']) ? $file['date'] : dol_filemtime($filedir."/".$file["name"])); diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 332c98f56da..cd891126ba6 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -2718,9 +2718,8 @@ if ($action == 'create' || $action == 'adduserldap') { if ($action != 'edit' && $action != 'presend') { print '
    '; - /* - * Generated documents - */ + + // Generated documents $filename = dol_sanitizeFileName($object->ref); $filedir = $conf->user->dir_output."/".dol_sanitizeFileName($object->ref); $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; @@ -2741,7 +2740,6 @@ if ($action == 'create' || $action == 'adduserldap') { $formactions = new FormActions($db); $somethingshown = $formactions->showactions($object, 'user', $socid, 1); - print '
    '; } From 059c2862624efde96cc36b8aca7d26250fcbb332 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 May 2021 12:19:18 +0200 Subject: [PATCH 0138/1497] css --- htdocs/user/perms.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index e80cb6c8462..1d521c62b34 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -425,9 +425,9 @@ if ($result) { print ''; } - // Label of permission + // Descrption of permission $permlabel = (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ($langs->trans("PermissionAdvanced".$obj->id) != ("PermissionAdvanced".$obj->id)) ? $langs->trans("PermissionAdvanced".$obj->id) : (($langs->trans("Permission".$obj->id) != ("Permission".$obj->id)) ? $langs->trans("Permission".$obj->id) : $langs->trans($obj->label))); - print '\n"; diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 700c9c5ed86..6d01fcfee0a 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -339,7 +339,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) $thumbsbyrow = 6; print '
    '; - print '
    '.$langs->trans('Prefix').''.$object->prefix_comm.'
    '; + print ''; if ($userstatic->id) { print $userstatic->getNomUrl(-1); } @@ -1727,7 +1727,7 @@ if ($resql) { if (!empty($arrayfields['sale_representative']['checked'])) { // Sales representatives - print ''; + print ''; if ($obj->socid > 0) { $listsalesrepresentatives = $companystatic->getSalesRepresentatives($user); if ($listsalesrepresentatives < 0) { diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 3485011c1e6..f42b7c08de9 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -588,7 +588,7 @@ if ($search_multicurrency_montant_ttc != '') { $sql .= natural_search('c.multicurrency_total_ttc', $search_multicurrency_montant_ttc, 1); } if ($search_login) { - $sql .= natural_search("u.login", $search_login); + $sql .= natural_search(array("u.login", "u.firstname", "u.lastname"), $search_login); } if ($search_project_ref != '') { $sql .= natural_search("p.ref", $search_project_ref); @@ -1490,7 +1490,7 @@ if ($resql) { $totalarray['nbfield']++; } } - // Town + // Alias name if (!empty($arrayfields['s.name_alias']['checked'])) { print ''; print $obj->alias; @@ -1565,7 +1565,7 @@ if ($resql) { $totalarray['nbfield']++; } } - //Shipping Method + // Shipping Method if (!empty($arrayfields['c.fk_shipping_method']['checked'])) { print ''; $form->formSelectShippingMethod('', $obj->fk_shipping_method, 'none', 1); @@ -1690,7 +1690,7 @@ if ($resql) { // Author if (!empty($arrayfields['u.login']['checked'])) { - print ''; + print ''; if ($userstatic->id) { print $userstatic->getNomUrl(-1); } else { diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 549862c53cc..bb25da4e604 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -301,7 +301,7 @@ class Facture extends CommonInvoice 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>50), 'datef' =>array('type'=>'date', 'label'=>'DateInvoice', 'enabled'=>1, 'visible'=>1, 'position'=>20), 'date_valid' =>array('type'=>'date', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>22), - 'date_lim_reglement' =>array('type'=>'date', 'label'=>'DateDue', 'enabled'=>1, 'visible'=>-1, 'position'=>25), + 'date_lim_reglement' =>array('type'=>'date', 'label'=>'DateDue', 'enabled'=>1, 'visible'=>1, 'position'=>25), 'date_closing' =>array('type'=>'datetime', 'label'=>'Date closing', 'enabled'=>1, 'visible'=>-1, 'position'=>30), 'paye' =>array('type'=>'smallint(6)', 'label'=>'InvoicePaidCompletely', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>80), //'amount' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>85), @@ -310,7 +310,7 @@ class Facture extends CommonInvoice //'remise' =>array('type'=>'double', 'label'=>'Remise', 'enabled'=>1, 'visible'=>-1, 'position'=>100), 'close_code' =>array('type'=>'varchar(16)', 'label'=>'EarlyClosingReason', 'enabled'=>1, 'visible'=>-1, 'position'=>92), 'close_note' =>array('type'=>'varchar(128)', 'label'=>'EarlyClosingComment', 'enabled'=>1, 'visible'=>-1, 'position'=>93), - 'total_ht' =>array('type'=>'double(24,8)', 'label'=>'AmountHT', 'enabled'=>1, 'visible'=>-1, 'position'=>95, 'isameasure'=>1), + 'total_ht' =>array('type'=>'double(24,8)', 'label'=>'AmountHT', 'enabled'=>1, 'visible'=>1, 'position'=>95, 'isameasure'=>1), 'total_tva' =>array('type'=>'double(24,8)', 'label'=>'AmountVAT', 'enabled'=>1, 'visible'=>-1, 'position'=>100, 'isameasure'=>1), 'localtax1' =>array('type'=>'double(24,8)', 'label'=>'LT1', 'enabled'=>1, 'visible'=>-1, 'position'=>110, 'isameasure'=>1), 'localtax2' =>array('type'=>'double(24,8)', 'label'=>'LT2', 'enabled'=>1, 'visible'=>-1, 'position'=>120, 'isameasure'=>1), diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 7c9b71e458b..282aad95d89 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -632,7 +632,7 @@ if ($search_multicurrency_montant_ttc != '') { $sql .= natural_search('f.multicurrency_total_ttc', $search_multicurrency_montant_ttc, 1); } if ($search_login) { - $sql .= natural_search('u.login', $search_login); + $sql .= natural_search(array('u.login', 'u.firstname', 'u.lastname'), $search_login); } if ($search_categ_cus > 0) { $sql .= " AND cc.fk_categorie = ".$db->escape($search_categ_cus); @@ -1900,7 +1900,7 @@ if ($resql) { // Author if (!empty($arrayfields['u.login']['checked'])) { - print ''; + print ''; if ($userstatic->id) { print $userstatic->getNomUrl(-1); } else { diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 51b61c41830..e44c0411bea 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -133,10 +133,10 @@ $arrayfields = array( 's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1, 'position'=>30), 's.email'=>array('label'=>$langs->trans("ThirdPartyEmail"), 'checked'=>0, 'position'=>30), 's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>0, 'position'=>31), - 's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>0, 'position'=>32), + 's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>1, 'position'=>32), 'state.nom'=>array('label'=>$langs->trans("StateShort"), 'checked'=>0, 'position'=>33), 'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0, 'position'=>34), - 'sale_representative'=>array('label'=>$langs->trans("SaleRepresentativesOfThirdParty"), 'checked'=>1, 'position'=>80), + 'sale_representative'=>array('label'=>$langs->trans("SaleRepresentativesOfThirdParty"), 'checked'=>-1, 'position'=>80), 'c.date_contrat'=>array('label'=>$langs->trans("DateContract"), 'checked'=>1, 'position'=>45), 'c.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), 'c.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 981374996cf..b8e63ea8f19 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -2558,11 +2558,13 @@ class User extends CommonObject /** * Return clickable link of login (eventualy with picto) * - * @param int $withpicto Include picto into link - * @param string $option Sur quoi pointe le lien - * @return string Chaine avec URL + * @param int $withpictoimg Include picto into link + * @param string $option On what the link point to ('leave', 'accountancy', 'nolink', ) + * @param integer $notooltip 1=Disable tooltip on picto and name + * @param string $morecss Add more css on link + * @return string String with URL */ - public function getLoginUrl($withpicto = 0, $option = '') + public function getLoginUrl($withpictoimg = 0, $option = '', $notooltip = 0, $morecss = '') { global $langs, $user; @@ -2587,11 +2589,23 @@ class User extends CommonObject } $result .= $linkstart; - if ($withpicto) { - $result .= img_object($langs->trans("ShowUser"), 'user', 'class="paddingright"'); + if ($withpictoimg) { + $paddafterimage = ''; + if (abs($withpictoimg) == 1) { + $paddafterimage = 'style="margin-'.($langs->trans("DIRECTION") == 'rtl' ? 'left' : 'right').': 3px;"'; + } + // Only picto + if ($withpictoimg > 0) { + $picto = ''.img_object('', 'user', $paddafterimage.' '.($notooltip ? '' : 'class="paddingright classfortooltip"'), 0, 0, $notooltip ? 0 : 1).''; + } else { + // Picto must be a photo + $picto = ''.Form::showphoto('userphoto', $this, 0, 0, 0, 'userphoto'.($withpictoimg == -3 ? 'small' : ''), 'mini', 0, 1).''; + } + $result .= $picto; } $result .= $this->login; $result .= $linkend; + return $result; } From 57732d4265f36bfb1c80c50c8ad9c39b3819a1f1 Mon Sep 17 00:00:00 2001 From: gmilad <61253440+gmilad@users.noreply.github.com> Date: Tue, 18 May 2021 19:45:15 +0200 Subject: [PATCH 0124/1497] Fix issue #17608 for branch 10 Fix issue #17608 for branch 10 --- htdocs/admin/translation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index 2a9983d95b1..1a3fa4d4122 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -200,7 +200,7 @@ if ($action == 'delete') $form = new Form($db); $formadmin = new FormAdmin($db); -$wikihelp='EN:Setup|FR:Paramétrage|ES:Configuración'; +$wikihelp = 'EN:Setup_Translation|FR:Paramétrage_Traduction|ES:Configuración_Traducción'; llxHeader('', $langs->trans("Setup"), $wikihelp); $param='&mode='.$mode; From 4bb18db90516bd71c43685c71131b3a1742af23d Mon Sep 17 00:00:00 2001 From: gmilad <61253440+gmilad@users.noreply.github.com> Date: Tue, 18 May 2021 19:53:35 +0200 Subject: [PATCH 0125/1497] Fix issue #17608 for branch 11 Fix issue #17608 for branch 11 --- htdocs/admin/translation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index c641be11a59..23c2a69c127 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -197,7 +197,7 @@ if ($action == 'delete') $form = new Form($db); $formadmin = new FormAdmin($db); -$wikihelp = 'EN:Setup|FR:Paramétrage|ES:Configuración'; +$wikihelp = 'EN:Setup_Translation|FR:Paramétrage_Traduction|ES:Configuración_Traducción'; llxHeader('', $langs->trans("Setup"), $wikihelp); $param = '&mode='.$mode; From 1cf7d0cee79e344ef26ab07dc2c9c1b92c3ac0c1 Mon Sep 17 00:00:00 2001 From: Givriz Date: Tue, 18 May 2021 20:13:26 +0200 Subject: [PATCH 0126/1497] Compatibility phpv8 --- htdocs/core/class/commonobject.class.php | 2 +- htdocs/core/tpl/extrafields_add.tpl.php | 2 +- .../tpl/extrafields_list_print_fields.tpl.php | 2 +- htdocs/societe/card.php | 10 +++++----- htdocs/user/card.php | 4 ++-- htdocs/user/list.php | 17 ++++++++++------- 6 files changed, 20 insertions(+), 17 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 4b55b52dba0..3f4b2dd9ee6 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7312,7 +7312,7 @@ abstract class CommonObject $parameters = array(); $reshook = $hookmanager->executeHooks('showOptionals', $parameters, $this, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { - if (is_array($extrafields->attributes[$this->table_element]['label']) && count($extrafields->attributes[$this->table_element]['label']) > 0) { + if (key_exists('label', $extrafields->attributes[$this->table_element]) && is_array($extrafields->attributes[$this->table_element]['label']) && count($extrafields->attributes[$this->table_element]['label']) > 0) { $out .= "\n"; $out .= ' '; $out .= "\n"; diff --git a/htdocs/core/tpl/extrafields_add.tpl.php b/htdocs/core/tpl/extrafields_add.tpl.php index f194a177178..2f44bbe9c48 100644 --- a/htdocs/core/tpl/extrafields_add.tpl.php +++ b/htdocs/core/tpl/extrafields_add.tpl.php @@ -47,7 +47,7 @@ if (empty($reshook)) { if (isset($tpl_context)) { $params['tpl_context'] = $tpl_context; } - $params['cols'] = $parameters['colspanvalue']; + $params['cols'] = key_exists('colspanvalue', $parameters) ? $parameters['colspanvalue'] : ''; print $object->showOptionals($extrafields, 'create', $params); } diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index 4c56b0223cd..021ff42a9d3 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -12,7 +12,7 @@ if (empty($extrafieldsobjectkey) && is_object($object)) { // Loop to show all columns of extrafields from $obj, $extrafields and $db if (!empty($extrafieldsobjectkey)) { // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ... - if (is_array($extrafields->attributes[$extrafieldsobjectkey]['label']) && count($extrafields->attributes[$extrafieldsobjectkey]['label'])) { + if (key_exists('label', $extrafields->attributes[$extrafieldsobjectkey]) && is_array($extrafields->attributes[$extrafieldsobjectkey]['label']) && count($extrafields->attributes[$extrafieldsobjectkey]['label'])) { if (empty($extrafieldsobjectprefix)) { $extrafieldsobjectprefix = 'ef.'; } diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 4973a328023..3d03a97a59f 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -48,13 +48,13 @@ require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; if (!empty($conf->adherent->enabled)) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; } -if (! empty($conf->accounting->enabled)) { +if (!empty($conf->accounting->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; } -if (! empty($conf->accounting->enabled)) { +if (!empty($conf->accounting->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; } -if (! empty($conf->accounting->enabled)) { +if (!empty($conf->accounting->enabled)) { require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; } @@ -610,7 +610,7 @@ if (empty($reshook)) { } // Logo/Photo save - $dir = $conf->societe->multidir_output[$conf->entity]."/".$object->id."/logos/"; + $dir = $conf->societe->multidir_output[$conf->entity]."/".$object->id."/logos/"; $file_OK = is_uploaded_file($_FILES['photo']['tmp_name']); if ($file_OK) { if (image_format_supported($_FILES['photo']['name'])) { @@ -892,7 +892,7 @@ $form = new Form($db); $formfile = new FormFile($db); $formadmin = new FormAdmin($db); $formcompany = new FormCompany($db); -if (! empty($conf->accounting->enabled)) { +if (!empty($conf->accounting->enabled)) { $formaccounting = new FormAccounting($db); } diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 332c98f56da..595dd8154d6 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1110,7 +1110,7 @@ if ($action == 'create' || $action == 'adduserldap') { } // Accountancy code - if ($conf->accounting->enabled) { + if (!empty($conf->accounting->enabled)) { print '
    '.$langs->trans("AccountancyCode").''; print ''; @@ -1163,7 +1163,7 @@ if ($action == 'create' || $action == 'adduserldap') { print $langs->trans("Note"); print ''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('note', GETPOSTISSET('note') ? GETPOST('note', 'restricthtml') : '', '', 120, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_3, '90%'); + $doleditor = new DolEditor('note', GETPOSTISSET('note') ? GETPOST('note', 'restricthtml') : '', '', 120, 'dolibarr_notes', '', false, true, getDolGlobalString('FCKEDITOR_ENABLE_SOCIETE'), ROWS_3, '90%'); $doleditor->Create(); print "
    ".dol_print_phone($obj->office_phone, $obj->country_code, 0, $obj->rowid, 'AC_TEL', ' ', 'phone')."'.dol_print_email($obj->email, $obj->rowid, $obj->socid, 'AC_EMAIL', 0, 0, 1)."'.$langs->trans("PriceBase").''.$langs->trans("DefaultTaxRate").''.$langs->trans("HT").''.$langs->trans("TTC").''.dol_print_size($size, 1, 1).''.dol_print_size($size, 1, 1).' '; + print ''; print $permlabel; if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { if (preg_match('/_advance$/', $obj->perms)) { From e472d2d5d17dd9d768e1fd8b5128a12ca515754e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 May 2021 12:44:26 +0200 Subject: [PATCH 0139/1497] Fix bad permission position for external modules --- htdocs/admin/modules.php | 3 ++- htdocs/user/perms.php | 25 ++++++++++++++++++------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 142d5accb0f..1a6d99261bd 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -386,7 +386,8 @@ foreach ($modulesdir as $dir) { } $moduleposition = ($objMod->module_position ? $objMod->module_position : '50'); - if ($moduleposition == '50' && ($objMod->isCoreOrExternalModule() == 'external')) { + if ($objMod->isCoreOrExternalModule() == 'external' && $moduleposition < 100000) { + // an external module should never return a value lower than '80'. $moduleposition = '80'; // External modules at end by default } diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 1d521c62b34..cb0a093867d 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -311,21 +311,33 @@ if ($result) { while ($i < $num) { $obj = $db->fetch_object($result); - // If line is for a module that doe snot existe anymore (absent of includes/module), we ignore it + // If line is for a module that does not exist anymore (absent of includes/module), we ignore it if (empty($modules[$obj->module])) { $i++; continue; } - // Save field module_position in database if value is still zero - if (empty($obj->module_position)) { + $objMod = $modules[$obj->module]; + + // Save field module_position in database if value is wrong + if (empty($obj->module_position) || (is_object($objMod) && $objMod->isCoreOrExternalModule() == 'external' && $obj->module_position < 100000)) { if (is_object($modules[$obj->module]) && ($modules[$obj->module]->module_position > 0)) { // TODO Define familyposition - $family = $modules[$obj->module]->family_position; + //$familyposition = $modules[$obj->module]->family_position; $familyposition = 0; - $sqlupdate = 'UPDATE '.MAIN_DB_PREFIX."rights_def SET module_position = ".((int) $modules[$obj->module]->module_position).","; + + $newmoduleposition = $modules[$obj->module]->module_position; + + // Correct $newmoduleposition position for external modules + $objMod = $modules[$obj->module]; + if (is_object($objMod) && $objMod->isCoreOrExternalModule() == 'external' && $newmoduleposition < 100000) { + $newmoduleposition += 100000; + } + + $sqlupdate = 'UPDATE '.MAIN_DB_PREFIX."rights_def SET module_position = ".((int) $newmoduleposition).","; $sqlupdate .= " family_position = ".((int) $familyposition); - $sqlupdate .= " WHERE module_position = 0 AND module = '".$db->escape($obj->module)."'"; + $sqlupdate .= " WHERE module_position = ".((int) $obj->module_position)." AND module = '".$db->escape($obj->module)."'"; + $db->query($sqlupdate); } } @@ -334,7 +346,6 @@ if ($result) { $oldmod = $obj->module; // Break detected, we get objMod - $objMod = $modules[$obj->module]; $picto = ($objMod->picto ? $objMod->picto : 'generic'); // Show break line From 58ffee193f8c1ac7c54ec470191bfe7b980878c1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 May 2021 13:07:25 +0200 Subject: [PATCH 0140/1497] Debug v14 --- htdocs/admin/tools/listevents.php | 2 +- htdocs/core/lib/usergroups.lib.php | 2 +- htdocs/langs/en_US/other.lang | 2 +- htdocs/user/param_ihm.php | 36 ++++++++++++------------------ 4 files changed, 17 insertions(+), 25 deletions(-) diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index fbc2412a9df..b76836a8dde 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -372,7 +372,7 @@ if ($result) { print_liste_field_titre("UserAgent", $_SERVER["PHP_SELF"], "e.user_agent", "", $param, '', $sortfield, $sortorder); } if (!empty($arrayfields['e.prefix_session']['checked'])) { - print_liste_field_titre("PrefixSession", $_SERVER["PHP_SELF"], "e.prefix_session", "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("SuffixSessionName", $_SERVER["PHP_SELF"], "e.prefix_session", "", $param, '', $sortfield, $sortorder); } print_liste_field_titre(''); print "
    '; + print '
    '; // Title if ($foruserprofile) { diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index 95297a98859..6fc8b351b77 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -263,7 +263,7 @@ ContactCreatedByEmailCollector=Contact/address created by email collector from e ProjectCreatedByEmailCollector=Project created by email collector from email MSGID %s TicketCreatedByEmailCollector=Ticket created by email collector from email MSGID %s OpeningHoursFormatDesc=Use a - to separate opening and closing hours.
    Use a space to enter different ranges.
    Example: 8-12 14-18 -PrefixSession=Prefix for session ID +SuffixSessionName=Suffix for session name ##### Export ##### ExportsArea=Exports area diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 2856f787b52..b492e31177f 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -231,19 +231,9 @@ if ($action == 'edit') { dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); - if (!empty($conf->use_javascript_ajax)) {/* - print '';*/ - } + print dol_get_fiche_end(); + + if (!empty($conf->use_javascript_ajax)) { print ''; $out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter); - $out .= ' '; + $out .= ' '; $out .= '
    '; } diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 8874b96eda5..bd69b812200 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -454,7 +454,7 @@ function ajax_combobox($htmlname, $events = array(), $minLengthToAutocomplete = templateResult: function (data, container) { /* Format visible output into combo list */ /* Code to add class of origin OPTION propagated to the new select2
  • tag */ if (data.element) { $(container).addClass($(data.element).attr("class")); } - console.log($(data.element).attr("data-html")); + //console.log($(data.element).attr("data-html")); if (data.id == -1 && $(data.element).attr("data-html") == undefined) { return \' \'; } diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 98fb4132bb8..c92f847a1e9 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1181,7 +1181,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if ($type != 1 && !empty($conf->stock->enabled)) { // Default warehouse print '
  • '; if ($num) { + $i = 0; // Lines with values while ($i < $num) { $obj = $db->fetch_object($resql); //print_r($obj); + print ''; if ($action == 'edit' && ($rowid == (!empty($obj->rowid) ? $obj->rowid : $obj->code))) { print ''; @@ -708,6 +710,7 @@ if ($id) { print "\n"; } + $i++; } } From b9de8561a9732773a4ea27f7fec888683db02ee8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 May 2021 15:59:36 +0200 Subject: [PATCH 0223/1497] Fix regression --- htdocs/core/lib/functions.lib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index eab810692c6..45d1bdca12e 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6877,6 +6877,8 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $substitutionarray['__DATE_DELIVERY_SS__'] = (isset($object->date_livraison) ? dol_print_date($object->date_livraison, "%S") : ''); // For backward compatibility + $substitutionarray['__REFCLIENT__'] = (isset($object->ref_client) ? $object->ref_client : (isset($object->ref_customer) ? $object->ref_customer : null)); + $substitutionarray['__REFSUPPLIER__'] = (isset($object->ref_supplier) ? $object->ref_supplier : null); $substitutionarray['__SUPPLIER_ORDER_DATE_DELIVERY__'] = (isset($object->date_livraison) ? dol_print_date($object->date_livraison, 'day', 0, $outputlangs) : ''); $substitutionarray['__SUPPLIER_ORDER_DELAY_DELIVERY__'] = (isset($object->availability_code) ? ($outputlangs->transnoentities("AvailabilityType".$object->availability_code) != ('AvailabilityType'.$object->availability_code) ? $outputlangs->transnoentities("AvailabilityType".$object->availability_code) : $outputlangs->convToOutputCharset(isset($object->availability) ? $object->availability : '')) : ''); From 263f1c8101df8279bb50e7e4be03150edd169143 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Tue, 25 May 2021 17:26:56 +0200 Subject: [PATCH 0224/1497] Fix #11882 : fix of module opensurvey for datesurvey --- htdocs/opensurvey/results.php | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php index 6d12259a39f..1c7a98739d7 100644 --- a/htdocs/opensurvey/results.php +++ b/htdocs/opensurvey/results.php @@ -251,7 +251,40 @@ if (GETPOSTISSET("ajoutercolonne") && $object->format == "D") { header('Location: results.php?id='.$object->id_sondage); } } - + if ($cleinsertion >= 0) { + $sql = 'SELECT s.reponses'; + $sql .= " FROM ".MAIN_DB_PREFIX."opensurvey_user_studs as s"; + $sql .= " WHERE id_sondage = '".$db->escape($numsondage)."'"; + $resql = $db->query($sql); + if (!$resql) { + dol_print_error($db); + } else { + $num = $db->num_rows($resql); + $compteur = 0; + while ($compteur < $num) { + $obj = $db->fetch_object($resql); + $sql = 'UPDATE '.MAIN_DB_PREFIX."opensurvey_user_studs"; + if ($cleinsertion == 0) { + $sql .= " SET reponses = '0".$db->escape($obj->reponses)."'"; + } else { + $reponsesadd = str_split($obj->reponses); + $lengthresponses = count($reponsesadd); + for ($cpt = $lengthresponses; $cpt > $cleinsertion; $cpt--) { + $reponsesadd[$cpt] = $reponsesadd[$cpt-1]; + } + $reponsesadd[$cleinsertion] = '0'; + $reponsesadd = implode($reponsesadd); + $sql .= " SET reponses = '".$db->escape($reponsesadd)."'"; + } + $sql .= " WHERE id_sondage = '".$db->escape($numsondage)."'"; + $resql = $db->query($sql); + if (!$resql) { + dol_print_error($db); + } + $compteur++; + } + } + } $adresseadmin = $object->mail_admin; } else { $erreur_ajout_date = "yes"; From daababb97f3ae56e255e82cf6dd6f83e47b69e21 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 May 2021 19:39:06 +0200 Subject: [PATCH 0225/1497] Update index.php --- htdocs/takepos/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 26a62e36d6e..d51fd21279e 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -566,7 +566,7 @@ function Search2(keyCodeForEnter) { $("#prodesc" + i).text(data[i]['label']); $("#prodivdesc" + i).show(); $("#probutton" + i).text(data[i]['label']); - $("#probutton" + i).show();; + $("#probutton" + i).show(); if (data[i]['price_formated']) { $("#proprice" + i).attr("class", "productprice"); $("#proprice" + i).html(data[i]['price_formated']); From 708deaac00673e7302f489d5c704d5ea96e784e3 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 25 May 2021 17:47:28 +0000 Subject: [PATCH 0226/1497] Fixing style errors. --- htdocs/contrat/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 918bd4c256a..19a040bf091 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -290,10 +290,10 @@ if (!empty($search_ref_supplier)) { $sql .= natural_search(array('c.ref_supplier'), $search_ref_supplier); } if ($search_zip) { - $sql .= natural_search(array('s.zip'), $search_zip); + $sql .= natural_search(array('s.zip'), $search_zip); } if ($search_town) { - $sql .= natural_search(array('s.town'), $search_town); + $sql .= natural_search(array('s.town'), $search_town); } if ($search_sale > 0) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$search_sale; From 9d6e93fd0132c31241daab8557f47247ce80d50e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 May 2021 19:50:53 +0200 Subject: [PATCH 0227/1497] Update security.php --- htdocs/admin/system/security.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index 89d3a3fe251..cb28b20195d 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -278,7 +278,7 @@ print '
    '; print ''.$langs->trans("AntivirusEnabledOnUpload").': '; print empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ? '' : img_picto('', 'tick').' '; -print yn(!empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ? 1 : 0); +print yn(empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ? 0 : 1); if (!empty($conf->global->MAIN_ANTIVIRUS_COMMAND)) { print '   - '.$conf->global->MAIN_ANTIVIRUS_COMMAND; if (defined('MAIN_ANTIVIRUS_COMMAND')) { From 3dfb22b05e3605f7a4a728711e1247524f32ee9f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 May 2021 19:54:09 +0200 Subject: [PATCH 0228/1497] Update task.class.php --- htdocs/projet/class/task.class.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 97586a41f41..80333f3d9fb 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -1986,7 +1986,8 @@ class Task extends CommonObject global $conf, $langs; // For external user, no check is done on company because readability is managed by public status of project and assignement. - $socid = $user->socid; + //$socid = $user->socid; + $socid = 0; $projectstatic = new Project($this->db); $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1, $socid); @@ -2007,10 +2008,7 @@ class Task extends CommonObject $sql .= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")"; } // No need to check company, as filtering of projects must be done by getProjectsAuthorizedForUser - //if ($socid || ! $user->rights->societe->client->voir) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; - if ($socid) { - $sql .= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".((int) $socid).")"; - } + //if ($socid || ! $user->rights->societe->client->voir) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".((int) $socid).")"; // No need to check company, as filtering of projects must be done by getProjectsAuthorizedForUser // if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND ((s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id.") OR (s.rowid IS NULL))"; From 0d31db0ba5bb88d6d47f6e4c5719f4a06414b02f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 May 2021 20:11:46 +0200 Subject: [PATCH 0229/1497] Update don.class.php --- htdocs/don/class/don.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 9396f3a718a..3e0e300930d 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -390,7 +390,7 @@ class Don extends CommonObject $sql .= ", phone"; $sql .= ", phone_mobile"; $sql .= ") VALUES ("; - $sql .= "'".$this->db->idate($this->date)."'"; + $sql .= "'".$this->db->idate($this->date ? $this->date : $now)."'"; $sql .= ", ".$conf->entity; $sql .= ", ".price2num($this->amount); $sql .= ", ".($this->modepaymentid ? $this->modepaymentid : "null"); From 4b47611e23e43dddd0612486ce42181eafaf9668 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 May 2021 21:21:09 +0200 Subject: [PATCH 0230/1497] Debug v14 --- htdocs/compta/facture/class/facture.class.php | 2 +- htdocs/compta/facture/list.php | 11 +- htdocs/fourn/facture/list.php | 105 ++---------------- 3 files changed, 15 insertions(+), 103 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index bb25da4e604..6dd67d4d931 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -352,7 +352,7 @@ class Facture extends CommonInvoice 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>500), 'tms' =>array('type'=>'timestamp', 'label'=>'DateModificationShort', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500), 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>900), - 'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Status', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Validated', 2=>'Paid', 3=>'Abandonned')), + 'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Validated', 2=>'Paid', 3=>'Abandonned')), ); // END MODULEBUILDER PROPERTIES diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 42e10477a3a..fb4089fabec 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -390,17 +390,16 @@ if ($massaction == 'makepayment_confirm') { $totalcreditnotes = $objecttmp->getSumCreditNotesUsed(); $totaldeposits = $objecttmp->getSumDepositsUsed(); $objecttmp->resteapayer = price2num($objecttmp->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits, 'MT'); - if ($objecttmp->paye || $objecttmp->resteapayer == 0) { + if ($objecttmp->statut == Facture::STATUS_DRAFT) { + $error++; + setEventMessages($objecttmp->ref.' '.$langs->trans("Draft"), $objecttmp->errors, 'errors'); + } elseif ($objecttmp->paye || $objecttmp->resteapayer == 0) { $error++; setEventMessages($objecttmp->ref.' '.$langs->trans("AlreadyPaid"), $objecttmp->errors, 'errors'); } elseif ($objecttmp->resteapayer < 0) { $error++; setEventMessages($objecttmp->ref.' '.$langs->trans("AmountMustBePositive"), $objecttmp->errors, 'errors'); } - if (!($objecttmp->statut > Facture::STATUS_DRAFT)) { - $error++; - setEventMessages($objecttmp->ref.' '.$langs->trans("Draft"), $objecttmp->errors, 'errors'); - } $rsql = "SELECT pfd.rowid, pfd.traite, pfd.date_demande as date_demande"; $rsql .= " , pfd.date_traite as date_traite"; @@ -952,7 +951,7 @@ if ($resql) { ); if ($conf->prelevement->enabled && !empty($user->rights->prelevement->bons->creer)) { $langs->load("withdrawals"); - $arrayofmassactions['withdrawrequest'] = $langs->trans("MakeWithdrawRequest"); + $arrayofmassactions['withdrawrequest'] = img_picto('', 'payment', 'class="pictofixedwidth"').$langs->trans("MakeWithdrawRequest"); } if ($user->rights->facture->supprimer) { if (!empty($conf->global->INVOICE_CAN_REMOVE_DRAFT_ONLY)) { diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 4fd45d6cff0..0c4f21ae4be 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -300,17 +300,16 @@ if (empty($reshook)) { $totalcreditnotes = $objecttmp->getSumCreditNotesUsed(); $totaldeposits = $objecttmp->getSumDepositsUsed(); $objecttmp->resteapayer = price2num($objecttmp->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits, 'MT'); - if ($objecttmp->paye || $objecttmp->resteapayer == 0) { + if ($objecttmp->statut == FactureFournisseur::STATUS_DRAFT) { + $error++; + setEventMessages($objecttmp->ref.' '.$langs->trans("Draft"), $objecttmp->errors, 'errors'); + } elseif ($objecttmp->paye || $objecttmp->resteapayer == 0) { $error++; setEventMessages($objecttmp->ref.' '.$langs->trans("AlreadyPaid"), $objecttmp->errors, 'errors'); } elseif ($objecttmp->resteapayer < 0) { $error++; setEventMessages($objecttmp->ref.' '.$langs->trans("AmountMustBePositive"), $objecttmp->errors, 'errors'); } - if (!($objecttmp->statut > FactureFournisseur::STATUS_DRAFT)) { - $error++; - setEventMessages($objecttmp->ref.' '.$langs->trans("Draft"), $objecttmp->errors, 'errors'); - } $rsql = "SELECT pfd.rowid, pfd.traite, pfd.date_demande as date_demande"; $rsql .= " , pfd.date_traite as date_traite"; @@ -340,7 +339,7 @@ if (empty($reshook)) { } } - //Massive withdraw request for request with no errors + // Massive withdraw request for request with no errors if (!empty($listofbills)) { $nbwithdrawrequestok = 0; foreach ($listofbills as $aBill) { @@ -363,88 +362,6 @@ if (empty($reshook)) { } -if ($massaction == 'transfer_request') { - $langs->load("withdrawals"); - - if (!$user->rights->paymentbybanktransfer->create) { - $error++; - setEventMessages($langs->trans("NotEnoughPermissions"), null, 'errors'); - } else { - //Checking error - $error = 0; - - $arrayofselected = is_array($toselect) ? $toselect : array(); - $listofbills = array(); - foreach ($arrayofselected as $toselectid) { - $objecttmp = new FactureFournisseur($db); - $result = $objecttmp->fetch($toselectid); - if ($result > 0) { - $totalpaye = $objecttmp->getSommePaiement(); - $totalcreditnotes = $objecttmp->getSumCreditNotesUsed(); - $totaldeposits = $objecttmp->getSumDepositsUsed(); - $objecttmp->resteapayer = price2num($objecttmp->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits, 'MT'); - if ($objecttmp->paye || $objecttmp->resteapayer == 0) { - $error++; - setEventMessages($objecttmp->ref.' '.$langs->trans("AlreadyPaid"), $objecttmp->errors, 'errors'); - } elseif ($objecttmp->resteapayer < 0) { - $error++; - setEventMessages($objecttmp->ref.' '.$langs->trans("AmountMustBePositive"), $objecttmp->errors, 'errors'); - } - if (!($objecttmp->statut > FactureFournisseur::STATUS_DRAFT)) { - $error++; - setEventMessages($objecttmp->ref.' '.$langs->trans("Draft"), $objecttmp->errors, 'errors'); - } - - $rsql = "SELECT pfd.rowid, pfd.traite, pfd.date_demande as date_demande"; - $rsql .= " , pfd.date_traite as date_traite"; - $rsql .= " , pfd.amount"; - $rsql .= " , u.rowid as user_id, u.lastname, u.firstname, u.login"; - $rsql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; - $rsql .= " , ".MAIN_DB_PREFIX."user as u"; - $rsql .= " WHERE fk_facture_fourn = ".$objecttmp->id; - $rsql .= " AND pfd.fk_user_demande = u.rowid"; - $rsql .= " AND pfd.traite = 0"; - $rsql .= " ORDER BY pfd.date_demande DESC"; - - $result_sql = $db->query($rsql); - if ($result_sql) { - $numprlv = $db->num_rows($result_sql); - } - - if ($numprlv > 0) { - $error++; - setEventMessages($objecttmp->ref.' '.$langs->trans("RequestAlreadyDone"), $objecttmp->errors, 'warnings'); - } elseif (!empty($objecttmp->mode_reglement_code) && $objecttmp->mode_reglement_code != 'VIR') { - $error++; - setEventMessages($objecttmp->ref.' '.$langs->trans("BadPaymentMethod"), $objecttmp->errors, 'errors'); - } else { - $listofbills[] = $objecttmp; // $listofbills will only contains invoices with good payment method and no request already done - } - } - } - - //Massive withdraw request for request with no errors - if (!empty($listofbills)) { - $nbwithdrawrequestok = 0; - foreach ($listofbills as $aBill) { - $db->begin(); - $result = $aBill->demande_prelevement($user, $aBill->resteapayer, 'bank-transfer', 'supplier_invoice'); - if ($result > 0) { - $db->commit(); - $nbwithdrawrequestok++; - } else { - $db->rollback(); - setEventMessages($aBill->error, $aBill->errors, 'errors'); - } - } - if ($nbwithdrawrequestok > 0) { - setEventMessages($langs->trans("BankTransferRequestsDone", $nbwithdrawrequestok), null, 'mesgs'); - } - } - } -} - - /* * View */ @@ -623,7 +540,7 @@ if ($search_login) { $sql .= natural_search('u.login', $search_login); } if ($search_status != '' && $search_status >= 0) { - $sql .= " AND f.fk_statut = ".$db->escape($search_status); + $sql .= " AND f.fk_statut = ".((int) $search_status); } if ($search_paymentmode > 0) { $sql .= " AND f.fk_mode_reglement = ".((int) $search_paymentmode); @@ -646,7 +563,7 @@ if ($search_categ_sup == -2) { $sql .= " AND cs.fk_categorie IS NULL"; } if ($search_status != '' && $search_status >= 0) { - $sql .= " AND f.fk_statut = ".$search_status; + $sql .= " AND f.fk_statut = ".((int) $search_status); } if ($filter && $filter != -1) { $aFilter = explode(',', $filter); @@ -857,14 +774,10 @@ if ($resql) { //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), ); - if ($conf->paymentbybanktransfer->enabled) { - $langs->load("withdrawals"); - $arrayofmassactions['transfer_request'] = $langs->trans("MakeBankTransferOrder"); - } //if($user->rights->fournisseur->facture->creer) $arrayofmassactions['createbills']=$langs->trans("CreateInvoiceForThisCustomer"); if (!empty($conf->paymentbybanktransfer->enabled) && !empty($user->rights->paymentbybanktransfer->create)) { $langs->load('withdrawals'); - $arrayofmassactions['banktransfertrequest'] = $langs->trans("MakeBankTransferOrder"); + $arrayofmassactions['banktransfertrequest'] = img_picto('', 'payment', 'class="pictofixedwidth"').$langs->trans("MakeBankTransferOrder"); } if ($user->rights->fournisseur->facture->supprimer) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); @@ -876,7 +789,7 @@ if ($resql) { $url = DOL_URL_ROOT.'/fourn/facture/card.php?action=create'; if (!empty($socid)) { - $url .= '&socid='.$socid; + $url .= '&socid='.urlencode($socid); } $newcardbutton = dolGetButtonTitle($langs->trans('NewBill'), '', 'fa fa-plus-circle', $url, '', ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)); From bad90240bc8b6fda2ecf88489af2ae4ec22f0cc9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 May 2021 21:39:50 +0200 Subject: [PATCH 0231/1497] Update pdf_cyan.modules.php --- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 2b40dffa30e..4d2d159ec02 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -434,13 +434,12 @@ class pdf_cyan extends ModelePDFPropales $notetoshow = dol_concatdesc($notetoshow, $extranote); } - if (!empty($conf->global->MAIN_ADD_CREATOR_IN_NOTE) && $object->user_author_id > 0) - { + if (!empty($conf->global->MAIN_ADD_CREATOR_IN_NOTE) && $object->user_author_id > 0) { $tmpuser = new User($this->db); $tmpuser->fetch($object->user_author_id); $creator_info = $langs->trans("CaseFollowedBy").' '.$tmpuser->getFullName($langs); - if ($tmpuser->email) $creator_info .= ', Mail: '.$tmpuser->email; - if ($tmpuser->office_phone) $creator_info .= ', Tel: '.$tmpuser->office_phone; + if ($tmpuser->email) $creator_info .= ', '.$langs->trans("EMail").': '.$tmpuser->email; + if ($tmpuser->office_phone) $creator_info .= ', '.$langs->trans("Phone").': '.$tmpuser->office_phone; $notetoshow = dol_concatdesc($notetoshow, $creator_info); } From 9aee8a2a0b94194f25295e4778a7e89e84d16177 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 May 2021 21:53:44 +0200 Subject: [PATCH 0232/1497] FIX #17406 --- htdocs/product/class/product.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 511331e6008..2ccc5e63c8f 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5184,7 +5184,7 @@ class Product extends CommonObject * Load value ->stock_theorique of a product. Property this->id must be defined. * This function need a lot of load. If you use it on list, use a cache to execute it one for each product id. * - * @param int $includedraftpoforvirtual Include draft status of PO for virtual stock calculation + * @param int $includedraftpoforvirtual Include draft status and not yet approved Purchase Orders for virtual stock calculation * @return int < 0 if KO, > 0 if OK * @see load_stock(), loadBatchInfo() */ @@ -5223,9 +5223,9 @@ class Product extends CommonObject $stock_sending_client = $this->stats_expedition['qty']; } if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) { - $filterStatus = '1,2,3,4'; + $filterStatus = empty($conf->global->SUPPLIER_ORDER_STATUS_FOR_VIRTUAL_STOCK) ? '2,3,4' : $conf->global->SUPPLIER_ORDER_STATUS_FOR_VIRTUAL_STOCK; if (isset($includedraftpoforvirtual)) { - $filterStatus = '0,'.$filterStatus; + $filterStatus = '0,1,2,'.$filterStatus; // 1,2 may have already been inside $filterStatus but it is better to have twice than missing $filterStatus does not include them } $result = $this->load_stats_commande_fournisseur(0, $filterStatus, 1); if ($result < 0) { From c76cf60e1562d1abb1e1eff67fb6eb849ba53b00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 25 May 2021 22:09:58 +0200 Subject: [PATCH 0233/1497] Update html.form.class.php --- htdocs/core/class/html.form.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 43eb8f208db..3bd39359f33 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6,7 +6,7 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2017 Regis Houssin * Copyright (C) 2006 Andre Cianfarani - * Copyright (C) 2006 Marc Barilley/Ocebo + * Copyright (C) 2006 Marc Barilley/Ocebo logo * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2007 Patrick Raguin * Copyright (C) 2010 Juanjo Menent @@ -8208,7 +8208,7 @@ class Form } elseif ($modulepart == 'contact') { $dir = $conf->societe->multidir_output[$entity].'/contact'; if (!empty($object->photo)) { - if (dolIsAllowedForPreview($object->logo)) { + if (dolIsAllowedForPreview($object->photo)) { if ((string) $imagesize == 'mini') { $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_mini'); } elseif ((string) $imagesize == 'small') { @@ -8224,7 +8224,7 @@ class Form } elseif ($modulepart == 'userphoto') { $dir = $conf->user->dir_output; if (!empty($object->photo)) { - if (dolIsAllowedForPreview($object->logo)) { + if (dolIsAllowedForPreview($object->photo)) { if ((string) $imagesize == 'mini') { $file = get_exdir(0, 0, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_mini'); } elseif ((string) $imagesize == 'small') { @@ -8243,7 +8243,7 @@ class Form } elseif ($modulepart == 'memberphoto') { $dir = $conf->adherent->dir_output; if (!empty($object->photo)) { - if (dolIsAllowedForPreview($object->logo)) { + if (dolIsAllowedForPreview($object->photo)) { if ((string) $imagesize == 'mini') { $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini'); } elseif ((string) $imagesize == 'small') { @@ -8263,7 +8263,7 @@ class Form // Generic case to show photos $dir = $conf->$modulepart->dir_output; if (!empty($object->photo)) { - if (dolIsAllowedForPreview($object->logo)) { + if (dolIsAllowedForPreview($object->photo)) { if ((string) $imagesize == 'mini') { $file = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_mini'); } elseif ((string) $imagesize == 'small') { From 4c698ce7989a955cdd5ab98667633e9b1fa69989 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 25 May 2021 22:11:30 +0200 Subject: [PATCH 0234/1497] Update html.form.class.php --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 3bd39359f33..0f4bff6b2ba 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6,7 +6,7 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2017 Regis Houssin * Copyright (C) 2006 Andre Cianfarani - * Copyright (C) 2006 Marc Barilley/Ocebo logo + * Copyright (C) 2006 Marc Barilley/Ocebo * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2007 Patrick Raguin * Copyright (C) 2010 Juanjo Menent From 332d8c91051453f1d122359409b24115f0d306cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 25 May 2021 22:24:46 +0200 Subject: [PATCH 0235/1497] fix warnings --- htdocs/comm/action/card.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 793518ed150..245f90edf72 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1986,7 +1986,7 @@ if ($id > 0) { print ' '; // Done by - if ($conf->global->AGENDA_ENABLE_DONEBY) { + if (!empty($conf->global->AGENDA_ENABLE_DONEBY)) { print '
    '; } @@ -792,8 +792,8 @@ if (!empty($arrayfields['d.statut']['checked'])) { $liststatus = array( '-1'=>$langs->trans("Draft"), '1'=>$langs->trans("Validated"), - '0'=>$langs->trans("Resiliated"), - '-2'=>$langs->trans("Excluded") + '0'=>$langs->trans("MemberStatusResiliatedShort"), + '-2'=>$langs->trans("MemberStatusExcludedShort") ); print $form->selectarray('search_status', $liststatus, $search_status, -3); print ''; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 43eb8f208db..fec54c8d688 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6924,7 +6924,7 @@ class Form if ($addjscombo && $jsbeautify) { // Enhance with select2 include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; - $out .= ajax_combobox($htmlname); + $out .= ajax_combobox($htmlname, array(), 0, 0, 'resolve', $show_empty < 0 ? (string) $show_empty : '-1'); } $out .= ''; } // Action column From 1662d4a82997f35fd841d7d69312f05bcbfdc2c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 25 May 2021 23:14:36 +0200 Subject: [PATCH 0238/1497] fix warnings --- htdocs/fourn/commande/list.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index aba5b8060f9..e7f19d0671a 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -6,7 +6,7 @@ * Copyright (C) 2014 Marcos García * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2016 Ferran Marcet - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2021 Frédéric France * Copyright (C) 2018-2020 Charlene Benke * Copyright (C) 2019 Nicolas ZABOURI * @@ -1272,6 +1272,10 @@ if ($resql) { $i = 0; $totalarray = array(); + $totalarray['nbfield'] = 0; + $totalarray['val'] = array(); + $totalarray['val']['cf.total_ht'] = 0; + $totalarray['val']['cf.total_ttc'] = 0; while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); From 4067ac19dcf2048e251a7676b701beb34a0858c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 25 May 2021 23:17:34 +0200 Subject: [PATCH 0239/1497] fix warning --- htdocs/fichinter/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 31fd0ea3152..f96b9e62f88 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -572,6 +572,7 @@ if ($resql) { $total = 0; $i = 0; $totalarray = array(); + $totalarray['nbfield'] = 0; while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); From e316437a0e824985c13f157881b2f603c39b0cae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 25 May 2021 23:20:55 +0200 Subject: [PATCH 0240/1497] fix warning --- htdocs/adherents/subscription/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index 55cafade309..06cd77f61c4 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -477,6 +477,7 @@ print "\n"; $totalarray = array(); +$totalarray['nbfield'] = 0; while ($i < min($num, $limit)) { $obj = $db->fetch_object($result); From 8221011d7de3e244d613191bf2cea5ec045433c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 25 May 2021 23:22:43 +0200 Subject: [PATCH 0241/1497] Update list.php --- htdocs/adherents/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index b6fe79b8d68..dde013e60c4 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -891,6 +891,7 @@ print "\n"; $i = 0; $totalarray = array(); +$totalarray['nbfield'] = 0; while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); From f9d6438baeff07e9692c5f43d61b68deb93420db Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 May 2021 23:26:03 +0200 Subject: [PATCH 0242/1497] Debug v14 --- htdocs/admin/stock.php | 2 ++ htdocs/core/class/conf.class.php | 4 ++++ htdocs/langs/en_US/mrp.lang | 2 +- htdocs/product/stock/product.php | 34 ++++++++++++++++++-------------- 4 files changed, 26 insertions(+), 16 deletions(-) diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index c5e98935ebb..a4a9e91e3ff 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -744,6 +744,7 @@ if ($conf->use_javascript_ajax) { print "\n"; print "\n"; +/* Disabled. Would be better to be managed with a user cookie if (!empty($conf->productbatch->enabled)) { print ''; print ''; @@ -757,6 +758,7 @@ if (!empty($conf->productbatch->enabled)) { print "\n"; print "\n"; } +*/ print '
    '.$langs->trans("DefaultWarehouse").''; - print img_picto($langs->trans("DefaultWarehouse"), 'stock', 'pictofixedwidth'); + print img_picto($langs->trans("DefaultWarehouse"), 'stock', 'class="pictofixedwidth"'); print $formproduct->selectWarehouses(GETPOST('fk_default_warehouse'), 'fk_default_warehouse', 'warehouseopen', 1); print ' '; print ''; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 988ac6b3ae3..6c705c62489 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1027,6 +1027,7 @@ ul.attendees li { list-style-type: none; padding-top:1px; padding-bottom:1px; + line-height: 1.6em; } .googlerefreshcal { padding-top: 4px; @@ -1472,6 +1473,10 @@ select.widthcentpercentminusxx, span.widthcentpercentminusxx:not(.select2-select width: calc(100% - 40px) !important; display: inline-block; } + select.widthcentpercentminusxx, span.widthcentpercentminusxx:not(.select2-selection), input.widthcentpercentminusxx { + width: calc(100% - 70px) !important; + display: inline-block; + } .logopublicpayment #dolpaymentlogo { max-width: 260px; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index e292b3850d1..407a38ea320 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1496,6 +1496,18 @@ table[summary="list_of_modules"] .fa-cog { padding-right: 10px !important; } + .hideonsmartphone { display: none; } + .hideonsmartphoneimp { display: none !important; } + + select.minwidth100imp, select.minwidth100, select.minwidth200, select.minwidth200imp, select.minwidth300 { + width: calc(100% - 40px) !important; + display: inline-block; + } + select.widthcentpercentminusxx, span.widthcentpercentminusxx:not(.select2-selection), input.widthcentpercentminusxx { + width: calc(100% - 70px) !important; + display: inline-block; + } + .poweredbyimg { width: 48px; } @@ -1580,8 +1592,6 @@ table[summary="list_of_modules"] .fa-cog { line-height: 1.4em; } - .hideonsmartphone { display: none; } - .hideonsmartphoneimp { display: none !important; } .noenlargeonsmartphone { width : 50px !important; display: inline !important; } .maxwidthonsmartphone, #search_newcompany.ui-autocomplete-input { max-width: 100px; } .maxwidth50onsmartphone { max-width: 40px; } From f9fb296ea6cae998a0108014b22b156ac5d45e31 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 19 May 2021 13:59:36 +0200 Subject: [PATCH 0144/1497] Update llx_00_c_country.sql MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit République Tchèque -> Czech Republic Danemark -> Denmark Djibouti = Djibouti Dominique -> Dominica République Dominicaine -> Dominican Republic Equateur -> Republic of Ecuador Egypte -> Egypt Salvador -> El Salvador Guinée Equatoriale -> Equatorial Guinea Erythrée -> Eritrea --- htdocs/install/mysql/data/llx_00_c_country.sql | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/install/mysql/data/llx_00_c_country.sql b/htdocs/install/mysql/data/llx_00_c_country.sql index 296b6d0e412..bc09a7fd1f6 100644 --- a/htdocs/install/mysql/data/llx_00_c_country.sql +++ b/htdocs/install/mysql/data/llx_00_c_country.sql @@ -106,16 +106,16 @@ INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (75 INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (76,'HR','HRV','Croatie',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (77,'CU','CUB','Cuba',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (78,'CY','CYP','Cyprus',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (79,'CZ','CZE','République Tchèque',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (80,'DK','DNK','Danemark',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (79,'CZ','CZE','Czech Republic',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (80,'DK','DNK','Denmark',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (81,'DJ','DJI','Djibouti',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (82,'DM','DMA','Dominique',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (83,'DO','DOM','République Dominicaine',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (84,'EC','ECU','Equateur',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (85,'EG','EGY','Egypte',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (86,'SV','SLV','Salvador',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (87,'GQ','GNQ','Guinée Equatoriale',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (88,'ER','ERI','Erythrée',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (82,'DM','DMA','Dominica',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (83,'DO','DOM','Dominican Republic',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (84,'EC','ECU','Republic of Ecuador',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (85,'EG','EGY','Egypt',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (86,'SV','SLV','El Salvador',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (87,'GQ','GNQ','Equatorial Guinea',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (88,'ER','ERI','Eritrea',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (89,'EE','EST','Estonia',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (90,'ET','ETH','Ethiopia',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (91,'FK','FLK','Falkland Islands',1,0); From 173ef6e877a542db618db669d1793e13510b316e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 May 2021 14:04:01 +0200 Subject: [PATCH 0145/1497] Look and feel v14 --- htdocs/core/class/html.form.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 1366b8d5078..7fcad5b8fb4 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4946,16 +4946,16 @@ class Form $formconfirm .= ''."\n"; // Line title - $formconfirm .= ''."\n"; + $formconfirm .= ''."\n"; // Line text if (is_array($formquestion) && !empty($formquestion['text'])) { - $formconfirm .= ''."\n"; + $formconfirm .= ''."\n"; } // Line form fields if ($more) { - $formconfirm .= ''."\n"; } @@ -4963,10 +4963,10 @@ class Form // Line with question $formconfirm .= ''; $formconfirm .= ''; - $formconfirm .= ''; - $formconfirm .= ''; $formconfirm .= ''."\n"; $formconfirm .= '
    '.img_picto('', 'recent').' '.$title.'
    '.img_picto('', 'recent').' '.$title.'
    '.$formquestion['text'].'
    '.$formquestion['text'].'
    '."\n"; + $formconfirm .= '
    '."\n"; $formconfirm .= $more; $formconfirm .= '
    '.$question.''; + $formconfirm .= ''; $formconfirm .= $this->selectyesno("confirm", $newselectedchoice); + $formconfirm .= ''; $formconfirm .= '
    '."\n"; From 8f5c898daef6034358bb3ee4380cbbb55ebdfb04 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 May 2021 14:13:42 +0200 Subject: [PATCH 0146/1497] CSS --- htdocs/core/class/html.form.class.php | 11 +++++++---- htdocs/core/lib/functions.lib.php | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 7fcad5b8fb4..47764d448f1 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4946,7 +4946,9 @@ class Form $formconfirm .= ''."\n"; // Line title - $formconfirm .= ''."\n"; + $formconfirm .= ''."\n"; // Line text if (is_array($formquestion) && !empty($formquestion['text'])) { @@ -4964,7 +4966,7 @@ class Form $formconfirm .= ''; $formconfirm .= ''; $formconfirm .= ''; $formconfirm .= ''."\n"; @@ -7837,9 +7839,10 @@ class Form * @param bool $disabled true or false * @param int $useempty 1=Add empty line * @param int $addjscombo 1=Add js beautifier on combo box + * @param string $morecss More CSS * @return string See option */ - public function selectyesno($htmlname, $value = '', $option = 0, $disabled = false, $useempty = 0, $addjscombo = 0) + public function selectyesno($htmlname, $value = '', $option = 0, $disabled = false, $useempty = 0, $addjscombo = 0, $morecss = '') { global $langs; @@ -7852,7 +7855,7 @@ class Form $disabled = ($disabled ? ' disabled' : ''); - $resultyesno = ''."\n"; if ($useempty) { $resultyesno .= ''."\n"; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index abf9c587b68..9afa45aff26 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3516,7 +3516,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'generic', 'home', 'hrm', 'members', 'products', 'invoicing', 'partnership', 'payment', 'pencil-ruler', 'preview', 'project', 'projectpub', 'projecttask', 'refresh', 'salary', 'shipment', 'supplier_invoice', 'technic', 'ticket', 'error', 'warning', - 'reception', 'recruitmentcandidature', 'recruitmentjobposition', 'resource', + 'recent', 'reception', 'recruitmentcandidature', 'recruitmentjobposition', 'resource', 'shapes', 'supplier', 'supplier_proposal', 'supplier_order', 'supplier_invoice', 'timespent', 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda', 'uncheck', 'user-cog', 'website', 'workstation', @@ -3558,7 +3558,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'other'=>'square', 'playdisabled'=>'play', 'pdf'=>'file-pdf', 'poll'=>'check-double', 'pos'=>'cash-register', 'preview'=>'binoculars', 'project'=>'project-diagram', 'projectpub'=>'project-diagram', 'projecttask'=>'tasks', 'propal'=>'file-signature', 'partnership'=>'handshake', 'payment'=>'money-check-alt', 'phoning'=>'phone', 'phoning_mobile'=>'mobile-alt', 'phoning_fax'=>'fax', 'previous'=>'arrow-alt-circle-left', 'printer'=>'print', 'product'=>'cube', 'service'=>'concierge-bell', - 'reception'=>'dolly', 'recruitmentjobposition'=>'id-card-alt', 'recruitmentcandidature'=>'id-badge', + 'recent' => 'question', 'reception'=>'dolly', 'recruitmentjobposition'=>'id-card-alt', 'recruitmentcandidature'=>'id-badge', 'resize'=>'crop', 'supplier_order'=>'dol-order_supplier', 'supplier_proposal'=>'file-signature', 'refresh'=>'redo', 'resource'=>'laptop-house', 'security'=>'key', 'salary'=>'wallet', 'shipment'=>'dolly', 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'stripe'=>'stripe-s', From e2e6d4ba14434f52b8385bbbca5580250c6e3cc9 Mon Sep 17 00:00:00 2001 From: lvessiller Date: Wed, 19 May 2021 14:29:46 +0200 Subject: [PATCH 0147/1497] FIX keep special code on supplier order lines for external modules --- htdocs/fourn/commande/card.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 0b7eb338b69..ef127e84811 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1239,6 +1239,8 @@ if (empty($reshook)) $tva_tx = get_default_tva($soc, $mysoc, $lines[$i]->fk_product, $product_fourn_price_id); } + $object->special_code = $lines[$i]->special_code; + $result = $object->addline( $desc, $lines[$i]->subprice, From 92ccf5982a8e600cee4134ac0d8c7b12f40874a9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 May 2021 14:38:39 +0200 Subject: [PATCH 0148/1497] Fix responsive --- htdocs/comm/propal/card.php | 25 +++++++++++----------- htdocs/core/class/html.form.class.php | 30 ++++++++++++++------------- htdocs/core/lib/functions.lib.php | 2 +- 3 files changed, 29 insertions(+), 28 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 984d77e7263..5d9ae8d75a6 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1436,11 +1436,9 @@ if (empty($reshook)) { */ $form = new Form($db); -$formother = new FormOther($db); $formfile = new FormFile($db); $formpropal = new FormPropal($db); $formmargin = new FormMargin($db); -$companystatic = new Societe($db); if (!empty($conf->projet->enabled)) { $formproject = new FormProjets($db); } @@ -1582,7 +1580,7 @@ if ($action == 'create') { //$warehouse_id = $soc->warehouse_id; } else { print ''; - print ''; - - print ''; + print ''."\n"; print ''; print_liste_field_titre("AccountAccounting", $_SERVER['PHP_SELF'], "t.numero_compte", "", $param, "", $sortfield, $sortorder); @@ -298,8 +319,14 @@ if ($action != 'export_csv') { print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Balance", $_SERVER["PHP_SELF"], "", $param, "", 'class="right"', $sortfield, $sortorder); - print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $param, "", 'width="60" class="center"', $sortfield, $sortorder); - print "\n"; + + // Hook fields + $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); + $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + // Action column + print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; + print ''."\n"; $total_debit = 0; $total_credit = 0; From fbe491c4da728ed5ac85fa0eb4bf9f63d707fff8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 21 May 2021 12:17:56 +0200 Subject: [PATCH 0193/1497] FIX CWE-79 huntr --- htdocs/main.inc.php | 32 ++++++++++++++------------------ test/phpunit/SecurityTest.php | 4 ++++ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 7b40647ebcb..40bb38a54f7 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -142,27 +142,23 @@ function testSqlAndScriptInject($val, $type) } $inj += preg_match('/base\s+href/si', $val); $inj += preg_match('/=data:/si', $val); - // List of dom events is on https://www.w3schools.com/jsref/dom_obj_event.asp - $inj += preg_match('/onmouse([a-z]*)\s*=/i', $val); // onmousexxx can be set on img or any html tag like - $inj += preg_match('/ondrag([a-z]*)\s*=/i', $val); // - $inj += preg_match('/ontouch([a-z]*)\s*=/i', $val); // - $inj += preg_match('/on(abort|afterprint|beforeprint|beforeunload|blur|canplay|canplaythrough|change|click|contextmenu|copy|cut)\s*=/i', $val); - $inj += preg_match('/on(dblclick|drop|durationchange|ended|error|focus|focusin|focusout|hashchange|input|invalid)\s*=/i', $val); - $inj += preg_match('/on(keydown|keypress|keyup|load|loadeddata|loadedmetadata|loadstart|loadend|offline|online|pagehide|pageshow)\s*=/i', $val); - $inj += preg_match('/on(paste|pause|play|playing|progress|ratechange|resize|reset|scroll|search|seeking|select|show|stalled|start|submit|suspend)\s*=/i', $val); - $inj += preg_match('/on(timeupdate|toggle|unload|volumechange|waiting)\s*=/i', $val); + // List of dom events is on https://www.w3schools.com/jsref/dom_obj_event.asp and https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers + $inj += preg_match('/on(mouse|drag|key|load|touch|pointer|select|transition)([a-z]*)\s*=/i', $val); // onmousexxx can be set on img or any html tag like + $inj += preg_match('/on(abort|afterprint|animation|auxclick|beforeprint|beforeunload|blur|cancel|canplay|canplaythrough|change|click|close|contextmenu|cuechange|copy|cut)\s*=/i', $val); + $inj += preg_match('/on(lostpointercapture|dblclick|drop|durationchange|ended|error|focus|focusin|focusout|formdata|gotpointercapture|hashchange|input|invalid)\s*=/i', $val); + $inj += preg_match('/on(offline|online|pagehide|pageshow)\s*=/i', $val); + $inj += preg_match('/on(paste|pause|play|playing|progress|ratechange|reset|resize|scroll|search|seeking|show|stalled|start|submit|suspend)\s*=/i', $val); + $inj += preg_match('/on(timeupdate|toggle|unload|volumechange|waiting|wheel)\s*=/i', $val); // We refuse html into html because some hacks try to obfuscate evil strings by inserting HTML into HTML. Example: error=alert(1) to bypass test on onerror $tmpval = preg_replace('/<[^<]+>/', '', $val); - // List of dom events is on https://www.w3schools.com/jsref/dom_obj_event.asp - $inj += preg_match('/onmouse([a-z]*)\s*=/i', $tmpval); // onmousexxx can be set on img or any html tag like - $inj += preg_match('/ondrag([a-z]*)\s*=/i', $tmpval); // - $inj += preg_match('/ontouch([a-z]*)\s*=/i', $tmpval); // - $inj += preg_match('/on(abort|afterprint|beforeprint|beforeunload|blur|canplay|canplaythrough|change|click|contextmenu|copy|cut)\s*=/i', $tmpval); - $inj += preg_match('/on(dblclick|drop|durationchange|ended|error|focus|focusin|focusout|hashchange|input|invalid)\s*=/i', $tmpval); - $inj += preg_match('/on(keydown|keypress|keyup|load|loadeddata|loadedmetadata|loadstart|loadend|offline|online|pagehide|pageshow)\s*=/i', $tmpval); - $inj += preg_match('/on(paste|pause|play|playing|progress|ratechange|resize|reset|scroll|search|seeking|select|show|stalled|start|submit|suspend)\s*=/i', $tmpval); - $inj += preg_match('/on(timeupdate|toggle|unload|volumechange|waiting)\s*=/i', $tmpval); + // List of dom events is on https://www.w3schools.com/jsref/dom_obj_event.asp and https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers + $inj += preg_match('/on(mouse|drag|key|load|touch|pointer|select|transition)([a-z]*)\s*=/i', $val); // onmousexxx can be set on img or any html tag like + $inj += preg_match('/on(abort|afterprint|animation|auxclick|beforeprint|beforeunload|blur|cancel|canplay|canplaythrough|change|click|close|contextmenu|cuechange|copy|cut)\s*=/i', $tmpval); + $inj += preg_match('/on(dblclick|drop|durationchange|ended|error|focus|focusin|focusout|formdata|gotpointercapture|hashchange|input|invalid)\s*=/i', $tmpval); + $inj += preg_match('/on(lostpointercapture|offline|online|pagehide|pageshow)\s*=/i', $tmpval); + $inj += preg_match('/on(paste|pause|play|playing|progress|ratechange|reset|resize|scroll|search|seeking|show|stalled|start|submit|suspend)\s*=/i', $tmpval); + $inj += preg_match('/on(timeupdate|toggle|unload|volumechange|waiting|wheel)\s*=/i', $tmpval); //$inj += preg_match('/on[A-Z][a-z]+\*=/', $val); // To lock event handlers onAbort(), ... $inj += preg_match('/:|:|:/i', $val); // refused string ':' encoded (no reason to have it encoded) to lock 'javascript:...' diff --git a/test/phpunit/SecurityTest.php b/test/phpunit/SecurityTest.php index bd4d0e9b76d..944d4f4cbe5 100644 --- a/test/phpunit/SecurityTest.php +++ b/test/phpunit/SecurityTest.php @@ -302,6 +302,10 @@ class SecurityTest extends PHPUnit\Framework\TestCase $test="rror=alert(document.location)"; $result=testSqlAndScriptInject($test, 0); $this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on testSqlAndScriptInject kkk'); + + $test="XSS"; + $result=testSqlAndScriptInject($test, 0); + $this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on testSqlAndScriptInject lll'); } /** From a5001899ebe2f34526fa44bcacca557d5f245058 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Fri, 21 May 2021 13:32:09 +0200 Subject: [PATCH 0194/1497] Update llx_00_c_country.sql MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Nouvelle-Calédonie -> New Caledonia Nouvelle-Zélande -> New Zealand Nicaragua = Nicaragua Niger = Niger Nigeria = Nigeria Nioué -> Niue Ile Norfolk -> Norfolk Island Mariannes du Nord -> Northern Mariana Islands Norvège -> Norway Oman = Oman Pakistan = Pakistan Palaos -> Palau Territoire Palestinien Occupé -> Palestinian territories Panama = Panama Papouasie-Nouvelle-Guinée -> Papua New Guinea Paraguay = Paraguay Peru = Peru Philippines = Philippines Iles Pitcairn -> Pitcairn Islands Pologne -> Poland Porto Rico -> Puerto Rico Qatar = Qatar --- .../install/mysql/data/llx_00_c_country.sql | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/install/mysql/data/llx_00_c_country.sql b/htdocs/install/mysql/data/llx_00_c_country.sql index bc09a7fd1f6..677447f1af2 100644 --- a/htdocs/install/mysql/data/llx_00_c_country.sql +++ b/htdocs/install/mysql/data/llx_00_c_country.sql @@ -194,27 +194,27 @@ INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (40 INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (300,'CW','CUW','Curaçao',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (301,'SX','SXM','Sint Maarten',1,0); --End of antilles nederland -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (165,'NC','NCL','Nouvelle-Calédonie',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (166,'NZ','NZL','Nouvelle-Zélande',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (165,'NC','NCL','New Caledonia',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (166,'NZ','NZL','New Zealand',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (167,'NI','NIC','Nicaragua',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (168,'NE','NER','Niger',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (169,'NG','NGA','Nigeria',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (170,'NU','NIU','Nioué',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (171,'NF','NFK','Ile Norfolk',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (172,'MP','MNP','Mariannes du Nord',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (173,'NO','NOR','Norvège',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (170,'NU','NIU','Niue',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (171,'NF','NFK','Norfolk Island',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (172,'MP','MNP','Northern Mariana Islands',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (173,'NO','NOR','Norway',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (174,'OM','OMN','Oman',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (175,'PK','PAK','Pakistan',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (176,'PW','PLW','Palaos',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (177,'PS','PSE','Territoire Palestinien Occupé',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (176,'PW','PLW','Palau',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (177,'PS','PSE','Palestinian territories',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (178,'PA','PAN','Panama',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (179,'PG','PNG','Papouasie-Nouvelle-Guinée',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (179,'PG','PNG','Papua New Guinea',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (180,'PY','PRY','Paraguay',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (181,'PE','PER','Peru',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (182,'PH','PHL','Philippines',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (183,'PN','PCN','Iles Pitcairn',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (183,'PN','PCN','Pitcairn Islands',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (184,'PL','POL','Pologne',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (185,'PR','PRI','Porto Rico',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (185,'PR','PRI','Puerto Rico',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (186,'QA','QAT','Qatar',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (188,'RO','ROU','Roumanie',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (189,'RW','RWA','Rwanda',1,0); From b5af3b17d53f41bc03ca784ccf94f1acc55d1a82 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 21 May 2021 14:03:52 +0200 Subject: [PATCH 0195/1497] Update doc --- doc/images/README.md | 19 +++++++++---------- htdocs/main.inc.php | 10 +++++----- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/doc/images/README.md b/doc/images/README.md index 7422d246d40..e93c9f9c3d4 100644 --- a/doc/images/README.md +++ b/doc/images/README.md @@ -10,17 +10,16 @@ https://github.com/Dolibarr/foundation -* Few icons are / were from website led24.de -* Attention: This website is no longer available! +# LICENCE OF IMAGE RESOURCES +-------------------------------- -This is original README file for this source: -------------------------------------------------------- +* All image resources (except dolihelp.ico and doliadmin.ico) in this directory are distributed under licence CC BY-SA + +List of icons from http://led24.de/iconset/ are: +- doliadmin.ico +- dolihelp.ico + +This is original README file for the package with this 2 images: You can do whatever you want with these icons (use on web or in desktop applications) as long as you don’t pass them off as your own and remove this readme file. A credit statement and a link back to http://led24.de/iconset/ or http://led24.de/ would be appreciated. - -Follow us on twitter http://twitter.com/gasyoun or email leds24@gmail.com -512 icons 20/05/2009 -------------------------------------------------------- -List of icons from http://led24.de/iconset/ are: -- dolihelp.ico diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 40bb38a54f7..a42c3c39cd3 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -145,9 +145,9 @@ function testSqlAndScriptInject($val, $type) // List of dom events is on https://www.w3schools.com/jsref/dom_obj_event.asp and https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers $inj += preg_match('/on(mouse|drag|key|load|touch|pointer|select|transition)([a-z]*)\s*=/i', $val); // onmousexxx can be set on img or any html tag like $inj += preg_match('/on(abort|afterprint|animation|auxclick|beforeprint|beforeunload|blur|cancel|canplay|canplaythrough|change|click|close|contextmenu|cuechange|copy|cut)\s*=/i', $val); - $inj += preg_match('/on(lostpointercapture|dblclick|drop|durationchange|ended|error|focus|focusin|focusout|formdata|gotpointercapture|hashchange|input|invalid)\s*=/i', $val); - $inj += preg_match('/on(offline|online|pagehide|pageshow)\s*=/i', $val); - $inj += preg_match('/on(paste|pause|play|playing|progress|ratechange|reset|resize|scroll|search|seeking|show|stalled|start|submit|suspend)\s*=/i', $val); + $inj += preg_match('/on(dblclick|drop|durationchange|emptied|ended|error|focus|focusin|focusout|formdata|gotpointercapture|hashchange|input|invalid)\s*=/i', $val); + $inj += preg_match('/on(lostpointercapture|offline|online|pagehide|pageshow)\s*=/i', $val); + $inj += preg_match('/on(paste|pause|play|playing|progress|ratechange|reset|resize|scroll|search|seeked|seeking|show|stalled|start|submit|suspend)\s*=/i', $val); $inj += preg_match('/on(timeupdate|toggle|unload|volumechange|waiting|wheel)\s*=/i', $val); // We refuse html into html because some hacks try to obfuscate evil strings by inserting HTML into HTML. Example: error=alert(1) to bypass test on onerror @@ -155,9 +155,9 @@ function testSqlAndScriptInject($val, $type) // List of dom events is on https://www.w3schools.com/jsref/dom_obj_event.asp and https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers $inj += preg_match('/on(mouse|drag|key|load|touch|pointer|select|transition)([a-z]*)\s*=/i', $val); // onmousexxx can be set on img or any html tag like $inj += preg_match('/on(abort|afterprint|animation|auxclick|beforeprint|beforeunload|blur|cancel|canplay|canplaythrough|change|click|close|contextmenu|cuechange|copy|cut)\s*=/i', $tmpval); - $inj += preg_match('/on(dblclick|drop|durationchange|ended|error|focus|focusin|focusout|formdata|gotpointercapture|hashchange|input|invalid)\s*=/i', $tmpval); + $inj += preg_match('/on(dblclick|drop|durationchange|emptied|ended|error|focus|focusin|focusout|formdata|gotpointercapture|hashchange|input|invalid)\s*=/i', $tmpval); $inj += preg_match('/on(lostpointercapture|offline|online|pagehide|pageshow)\s*=/i', $tmpval); - $inj += preg_match('/on(paste|pause|play|playing|progress|ratechange|reset|resize|scroll|search|seeking|show|stalled|start|submit|suspend)\s*=/i', $tmpval); + $inj += preg_match('/on(paste|pause|play|playing|progress|ratechange|reset|resize|scroll|search|seeked|seeking|show|stalled|start|submit|suspend)\s*=/i', $tmpval); $inj += preg_match('/on(timeupdate|toggle|unload|volumechange|waiting|wheel)\s*=/i', $tmpval); //$inj += preg_match('/on[A-Z][a-z]+\*=/', $val); // To lock event handlers onAbort(), ... From c1c2f44e384d092e9f5d1e6836223887f39e72e7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 21 May 2021 14:16:49 +0200 Subject: [PATCH 0196/1497] Update file COPYRIGHT --- COPYRIGHT | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/COPYRIGHT b/COPYRIGHT index aedcb1be614..c43d77581a7 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -1,13 +1,24 @@ -License -------- +Copyright and license +---------------------- -Dolibarr is released under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 3 of the License, -or (at your option) any later version (GPL-3+). -More information: https://www.gnu.org/licenses/gpl-3.0.txt +The Dolibarr software as a whole is distributed under the GNU General Public License as published by the Free Software Foundation; +either version 3 of the License, or (at your option) any later version (GPL-3+). More information: https://www.gnu.org/licenses/gpl-3.0.txt. +A copy of this license is available in the COPYING file. +Dolibarr depends on third-party components and code snippets released under their own license (obviously, all compatible with the one of Dolibarr). +These dependencies are listed in the bottom of this file. -Dolibarr uses some external libraries released under different licenses. This is compatibility summary: + +The Dolibarr images resources (available in the doc directory) is distributed under the Creative Commons Attribution 4.0 International license (CC BY 4.0). + + +The name Dolibarr is a trademark initially registered by Laurent Destailleur and ceased to the Dolibarr foundation. You can use the name Dolibarr +for your own need as long as you follow the rules defined on the page https://wiki.dolibarr.org/index.php/Rules_to_use_the_brand_name_%22Dolibarr%22 +The use of the name DoliStore is also restricted to the same rules defined on https://wiki.dolibarr.org/index.php/Rules_to_use_the_brand_name_%22Dolibarr%22 + + + +Licence of dependencies of third-party components used by Dolibarr (all compatible with the Licence of Dolibarr): Component Version License GPL Compatible Usage ------------------------------------------------------------------------------------- @@ -28,7 +39,7 @@ php-iban 1.4.7 LGPL-3+ Yes PHPoAuthLib 0.8.2 MIT License Yes Library to provide oauth1 and oauth2 to different service PHPPrintIPP 1.3 GPL-2+ Yes Library to send print IPP requests PSR/Logs 1.0 Library for logs (used by DebugBar) -PSR/simple-cache ? MIT License Yes Library for cache (used by PHPSpreadSheet) +PSR/simple-cache ? MIT License Yes Library for cache (used by PHPSpreadSheet) Restler 3.1.1 LGPL-3+ Yes Library to develop REST Web services (+ swagger-ui js lib into dir explorer) Sabre 3.2.2 BSD Yes DAV support Swift Mailer 5.4.2-DEV MIT License Yes Comprehensive mailing tools for PHP @@ -63,11 +74,10 @@ Font libraries: Fontawesome 5.13 Font Awesome Free Licence Yes -For licenses compatibility informations: -https://www.gnu.org/licenses/licenses.en.html +For more licenses compatibility informations: https://www.gnu.org/licenses/licenses.en.html -Copyright / Authors +Authors ------------------- See page https://github.com/Dolibarr/dolibarr/graphs/contributors From 38bd595ebdfca44db2bff4b2d315d81bd13046cb Mon Sep 17 00:00:00 2001 From: lvessiller Date: Fri, 21 May 2021 14:18:46 +0200 Subject: [PATCH 0197/1497] NEW translate supplier order menus and button --- htdocs/core/menus/init_menu_auguria.sql | 2 +- htdocs/core/menus/standard/eldy.lib.php | 2 +- htdocs/fourn/card.php | 4 ++-- htdocs/fourn/commande/list.php | 2 +- htdocs/langs/en_US/orders.lang | 2 ++ htdocs/langs/fr_FR/orders.lang | 2 ++ htdocs/main.inc.php | 2 +- htdocs/supplier_proposal/card.php | 2 +- 8 files changed, 11 insertions(+), 7 deletions(-) diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index d9c2cad7c9f..9eb6a43f9b0 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -167,7 +167,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_proposal->enabled', __HANDLER__, 'left', 1653__+MAX_llx_menu__, 'commercial', '', 1650__+MAX_llx_menu__, '/comm/propal/stats/index.php?leftmenu=supplier_proposals&mode=supplier', 'Statistics', 1, 'supplier_proposal', '$user->rights->supplier_proposal->lire', '', 2, 2, __ENTITY__); -- Commercial - Supplier's orders insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled', __HANDLER__, 'left', 5100__+MAX_llx_menu__, 'commercial', 'orders_suppliers', 5__+MAX_llx_menu__, '/fourn/commande/index.php?mainmenu=commercial&leftmenu=orders_suppliers', 'SuppliersOrders', 0, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 6, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled', __HANDLER__, 'left', 5101__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/fourn/commande/card.php?mainmenu=commercial&action=create&leftmenu=orders_suppliers', 'NewOrder', 1, 'orders', '($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer)', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled', __HANDLER__, 'left', 5101__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/fourn/commande/card.php?mainmenu=commercial&action=create&leftmenu=orders_suppliers', 'NewSupplierOrderShort', 1, 'orders', '($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer)', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled', __HANDLER__, 'left', 5102__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers', 'List', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5103__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=0', 'StatusOrderDraftShort', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5104__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=1', 'StatusOrderValidated', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 3, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 74c66e899f4..2232b3333dd 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -959,7 +959,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM if (!empty($conf->supplier_order->enabled)) { $langs->load("orders"); $newmenu->add("/fourn/commande/index.php?leftmenu=orders_suppliers", $langs->trans("SuppliersOrders"), 0, $user->rights->fournisseur->commande->lire, '', $mainmenu, 'orders_suppliers', 400, '', '', '', img_picto('', 'supplier_order', 'class="paddingright pictofixedwidth"')); - $newmenu->add("/fourn/commande/card.php?action=create&leftmenu=orders_suppliers", $langs->trans("NewOrder"), 1, $user->rights->fournisseur->commande->creer); + $newmenu->add("/fourn/commande/card.php?action=create&leftmenu=orders_suppliers", $langs->trans("NewSupplierOrderShort"), 1, $user->rights->fournisseur->commande->creer); $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers", $langs->trans("List"), 1, $user->rights->fournisseur->commande->lire); if ($usemenuhider || empty($leftmenu) || $leftmenu == "orders_suppliers") { diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 90934062910..e9b61e53406 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -842,9 +842,9 @@ if ($object->id > 0) { if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { $langs->load("orders"); if ($object->status == 1) { - print ''.$langs->trans("AddOrder").''; + print ''.$langs->trans("AddSupplierOrderShort").''; } else { - print ''.$langs->trans("AddOrder").''; + print ''.$langs->trans("AddSupplierOrderShort").''; } } diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index fb1891051e6..aba5b8060f9 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -895,7 +895,7 @@ if ($resql) { if (!empty($socid)) { $url .= '&socid='.$socid; } - $newcardbutton = dolGetButtonTitle($langs->trans('NewOrder'), '', 'fa fa-plus-circle', $url, '', ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer)); + $newcardbutton = dolGetButtonTitle($langs->trans('NewSupplierOrderShort'), '', 'fa fa-plus-circle', $url, '', ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer)); // Lines of title fields print '
    '; diff --git a/htdocs/langs/en_US/orders.lang b/htdocs/langs/en_US/orders.lang index 87d196eb22f..5dab5b99bf1 100644 --- a/htdocs/langs/en_US/orders.lang +++ b/htdocs/langs/en_US/orders.lang @@ -11,6 +11,7 @@ OrderDate=Order date OrderDateShort=Order date OrderToProcess=Order to process NewOrder=New order +NewSupplierOrderShort=New order NewOrderSupplier=New Purchase Order ToOrder=Make order MakeOrder=Make order @@ -73,6 +74,7 @@ DeleteOrder=Delete order CancelOrder=Cancel order OrderReopened= Order %s re-open AddOrder=Create order +AddSupplierOrderShort=Create order AddPurchaseOrder=Create purchase order AddToDraftOrders=Add to draft order ShowOrder=Show order diff --git a/htdocs/langs/fr_FR/orders.lang b/htdocs/langs/fr_FR/orders.lang index 0732013a49b..9bbc7154567 100644 --- a/htdocs/langs/fr_FR/orders.lang +++ b/htdocs/langs/fr_FR/orders.lang @@ -11,6 +11,7 @@ OrderDate=Date de commande OrderDateShort=Date de commande OrderToProcess=Commande à traiter NewOrder=Nouvelle commande +NewSupplierOrderShort=Nouvelle commande NewOrderSupplier=Nouvelle Commande d'Achat ToOrder=Passer commande MakeOrder=Passer commande @@ -73,6 +74,7 @@ DeleteOrder=Supprimer la commande CancelOrder=Annuler la commande OrderReopened= Commande %s réouverte AddOrder=Créer commande +AddSupplierOrderShort=Créer commande AddPurchaseOrder=Créer commande d'achat AddToDraftOrders=Ajouter à commande brouillon ShowOrder=Afficher commande diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 7b40647ebcb..8d97a56b2f3 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2317,7 +2317,7 @@ function top_menu_quickadd() $dropDownQuickAddHtml .= ' '; diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index cad41f905ef..633f0785fe1 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1862,7 +1862,7 @@ if ($action == 'create') { // Create an order if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) && $object->statut == SupplierProposal::STATUS_SIGNED) { if ($usercancreateorder) { - print ''; + print ''; } } From 609d405685cffd0188bea6ffe5f6fec520f0bd29 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 21 May 2021 15:38:03 +0200 Subject: [PATCH 0198/1497] fix: formconfim if type radio must be :checked to get correct value --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 945897856f2..82c00e4e4f7 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4433,7 +4433,7 @@ class Form var more = ""; var inputvalue; if ($("input[name=\'" + inputname + "\']").attr("type") == "radio") { - inputvalue = $("input[name=\'" + inputname + "\']").val(); + inputvalue = $("input[name=\'" + inputname + "\']:checked").val(); } else { if ($("#" + inputname).attr("type") == "checkbox") { more = ":checked"; } inputvalue = $("#" + inputname + more).val(); From 11fa523070a805a1608ebcf0031cce66beaa34c4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 21 May 2021 15:54:11 +0200 Subject: [PATCH 0199/1497] FIX CWE-269 --- htdocs/core/lib/security.lib.php | 5 ++++- htdocs/margin/tabs/productMargins.php | 10 ++++++---- htdocs/margin/tabs/thirdpartyMargins.php | 8 ++++++-- htdocs/product/agenda.php | 16 +++++++++++++++- htdocs/product/card.php | 12 +++++++++++- htdocs/product/composition/card.php | 14 +++++++++++++- htdocs/product/document.php | 12 +++++++++++- htdocs/product/fournisseurs.php | 19 +++++++++---------- htdocs/product/note.php | 11 ++++++++++- htdocs/product/popuprop.php | 4 +--- htdocs/product/price.php | 11 ++++++++++- htdocs/product/stats/bom.php | 3 ++- htdocs/product/stats/card.php | 3 ++- htdocs/product/stats/commande.php | 6 +++--- htdocs/product/stats/commande_fournisseur.php | 3 ++- htdocs/product/stats/contrat.php | 5 ++--- htdocs/product/stats/facture.php | 2 +- htdocs/product/stats/facture_fournisseur.php | 6 +++--- htdocs/product/stats/mo.php | 5 ++--- htdocs/product/stats/propal.php | 5 +++-- htdocs/product/stats/supplier_proposal.php | 6 +++--- htdocs/product/stock/product.php | 13 +++++++++++-- htdocs/product/traduction.php | 17 ++++++++++++++++- htdocs/variants/combinations.php | 16 +++++++++++----- 24 files changed, 157 insertions(+), 55 deletions(-) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index de4d67b1647..06baefed88e 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -173,10 +173,13 @@ function dol_verifyHash($chain, $hash, $type = '0') * This method check permission on module then call checkUserAccessToObject() for permission on object (according to entity and socid of user). * * @param User $user User to check - * @param string $features Features to check (it must be module $object->element. Examples: 'societe', 'contact', 'produit&service', 'produit|service', ...) + * @param string $features Features to check (it must be module $object->element. Can be a 'or' check with 'levela|levelb'. + * Examples: 'societe', 'contact', 'produit&service', 'produit|service', ...) + * This is used to check permission $user->rights->features->... * @param int $objectid Object ID if we want to check a particular record (optional) is linked to a owned thirdparty (optional). * @param string $tableandshare 'TableName&SharedElement' with Tablename is table where object is stored. SharedElement is an optional key to define where to check entity for multicompany module. Param not used if objectid is null (optional). * @param string $feature2 Feature to check, second level of permission (optional). Can be a 'or' check with 'sublevela|sublevelb'. + * This is used to check permission $user->rights->features->feature2... * @param string $dbt_keyfield Field name for socid foreign key if not fk_soc. Not used if objectid is null (optional) * @param string $dbt_select Field name for select if not rowid. Not used if objectid is null (optional) * @param int $isdraft 1=The object with id=$objectid is a draft diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php index 4c34e04c54c..6f2337d1baf 100644 --- a/htdocs/margin/tabs/productMargins.php +++ b/htdocs/margin/tabs/productMargins.php @@ -39,10 +39,6 @@ $fieldtype = (!empty($ref) ? 'ref' : 'rowid'); if (!empty($user->socid)) { $socid = $user->socid; } -$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); -if (empty($user->rights->margins->liretous)) { - accessforbidden(); -} $object = new Product($db); @@ -63,6 +59,12 @@ if (!$sortfield) { $sortfield = "f.datef"; } +$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); + +if (empty($user->rights->margins->liretous)) { + accessforbidden(); +} + /* * View diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php index b1c569c0912..505ff9f9f31 100644 --- a/htdocs/margin/tabs/thirdpartyMargins.php +++ b/htdocs/margin/tabs/thirdpartyMargins.php @@ -33,8 +33,6 @@ $socid = GETPOST('socid', 'int'); if (!empty($user->socid)) { $socid = $user->socid; } -$result = restrictedArea($user, 'societe', '', ''); - $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); @@ -61,6 +59,12 @@ if ($socid > 0) { // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('thirdpartymargins', 'globalcard')); +$result = restrictedArea($user, 'societe', $object->id, ''); + +if (empty($user->rights->margins->liretous)) { + accessforbidden(); +} + /* * Actions diff --git a/htdocs/product/agenda.php b/htdocs/product/agenda.php index ea32e47c8a5..815014e259f 100644 --- a/htdocs/product/agenda.php +++ b/htdocs/product/agenda.php @@ -73,7 +73,21 @@ if (!$sortorder) { // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('agendathirdparty')); -$result = restrictedArea($user, 'produit|service', $id, 'product&product'); +$object = new Product($db); +if ($id > 0 || !empty($ref)) { + $object->fetch($id, $ref); +} + +if ($object->id > 0) { + if ($object->type == $object::TYPE_PRODUCT) { + restrictedArea($user, 'produit', $object->id, 'product&product', '', ''); + } + if ($object->type == $object::TYPE_SERVICE) { + restrictedArea($user, 'service', $object->id, 'product&product', '', ''); + } +} else { + restrictedArea($user, 'produit|service', 0, 'product&product', '', ''); +} /* diff --git a/htdocs/product/card.php b/htdocs/product/card.php index c92f847a1e9..61568a5510a 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -152,7 +152,17 @@ if (!empty($canvas)) { // Security check $fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : '')); $fieldtype = (!empty($id) ? 'rowid' : 'ref'); -$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); + +if ($object->id > 0) { + if ($object->type == $object::TYPE_PRODUCT) { + restrictedArea($user, 'produit', $object->id, 'product&product', '', ''); + } + if ($object->type == $object::TYPE_SERVICE) { + restrictedArea($user, 'service', $object->id, 'product&product', '', ''); + } +} else { + restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); +} // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('productcard', 'globalcard')); diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index 442232686d3..c9499bf415b 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -50,7 +50,6 @@ if (!empty($user->socid)) { } $fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : '')); $fieldtype = (!empty($ref) ? 'ref' : 'rowid'); -$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); $object = new Product($db); $objectid = 0; @@ -60,6 +59,19 @@ if ($id > 0 || !empty($ref)) { $id = $object->id; } +$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); + +if ($object->id > 0) { + if ($object->type == $object::TYPE_PRODUCT) { + restrictedArea($user, 'produit', $object->id, 'product&product', '', ''); + } + if ($object->type == $object::TYPE_SERVICE) { + restrictedArea($user, 'service', $object->id, 'product&product', '', ''); + } +} else { + restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); +} + /* * Actions diff --git a/htdocs/product/document.php b/htdocs/product/document.php index 372e3c19bdc..0b15ad7a85c 100644 --- a/htdocs/product/document.php +++ b/htdocs/product/document.php @@ -95,9 +95,19 @@ if ($id > 0 || !empty($ref)) { } $modulepart = 'produit'; + $permissiontoadd = (($object->type == Product::TYPE_PRODUCT && $user->rights->produit->creer) || ($object->type == Product::TYPE_SERVICE && $user->rights->service->creer)); -$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); +if ($object->id > 0) { + if ($object->type == $object::TYPE_PRODUCT) { + restrictedArea($user, 'produit', $object->id, 'product&product', '', ''); + } + if ($object->type == $object::TYPE_SERVICE) { + restrictedArea($user, 'service', $object->id, 'product&product', '', ''); + } +} else { + restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); +} /* diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 0d5ea9647f5..8b2a792b872 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -103,17 +103,16 @@ if ($id > 0 || $ref) { $object->fetch($id, $ref); } -$sortfield = GETPOST("sortfield", 'alpha'); -$sortorder = GETPOST("sortorder", 'alpha'); - -if (!$sortfield) { - $sortfield = "s.nom"; +if ($object->id > 0) { + if ($object->type == $object::TYPE_PRODUCT) { + restrictedArea($user, 'produit', $object->id, 'product&product', '', ''); + } + if ($object->type == $object::TYPE_SERVICE) { + restrictedArea($user, 'service', $object->id, 'product&product', '', ''); + } +} else { + restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); } -if (!$sortorder) { - $sortorder = "ASC"; -} - -$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); /* diff --git a/htdocs/product/note.php b/htdocs/product/note.php index add915181a2..fad4df3500b 100644 --- a/htdocs/product/note.php +++ b/htdocs/product/note.php @@ -51,7 +51,16 @@ if ($id > 0 || !empty($ref)) { $permissionnote = $user->rights->produit->creer; // Used by the include of actions_setnotes.inc.php -$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); +if ($object->id > 0) { + if ($object->type == $object::TYPE_PRODUCT) { + restrictedArea($user, 'produit', $object->id, 'product&product', '', ''); + } + if ($object->type == $object::TYPE_SERVICE) { + restrictedArea($user, 'service', $object->id, 'product&product', '', ''); + } +} else { + restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); +} /* diff --git a/htdocs/product/popuprop.php b/htdocs/product/popuprop.php index f23b6eae92d..5aa54b0963c 100644 --- a/htdocs/product/popuprop.php +++ b/htdocs/product/popuprop.php @@ -60,9 +60,7 @@ $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -$staticproduct = new Product($db); - -$result = restrictedArea($user, 'produit|service', 0, 'product&product'); +restrictedArea($user, 'produit|service', 0, 'product&product', '', ''); /* diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 9548643166a..295a999a778 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -82,7 +82,16 @@ if ((!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('productpricecard', 'globalcard')); -$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); +if ($object->id > 0) { + if ($object->type == $object::TYPE_PRODUCT) { + restrictedArea($user, 'produit', $object->id, 'product&product', '', ''); + } + if ($object->type == $object::TYPE_SERVICE) { + restrictedArea($user, 'service', $object->id, 'product&product', '', ''); + } +} else { + restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); +} /* diff --git a/htdocs/product/stats/bom.php b/htdocs/product/stats/bom.php index 053d9d6b1a8..505bc8ed060 100644 --- a/htdocs/product/stats/bom.php +++ b/htdocs/product/stats/bom.php @@ -41,7 +41,6 @@ $fieldtype = (!empty($ref) ? 'ref' : 'rowid'); if ($user->socid) { $socid = $user->socid; } -$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('productstatscontract')); @@ -67,6 +66,8 @@ if (!$sortfield) { $sortfield = "b.date_valid"; } +$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); + /* * View diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php index 2dae292884e..d791100ae4a 100644 --- a/htdocs/product/stats/card.php +++ b/htdocs/product/stats/card.php @@ -58,7 +58,6 @@ if (!empty($user->socid)) { // Security check $fieldvalue = (!empty($id) ? $id : $ref); $fieldtype = (!empty($ref) ? 'ref' : 'rowid'); -$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); $tmp = dol_getdate(dol_now()); $currentyear = $tmp['year']; @@ -66,6 +65,8 @@ if (empty($search_year)) { $search_year = $currentyear; } +$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); + /* * Actions diff --git a/htdocs/product/stats/commande.php b/htdocs/product/stats/commande.php index fe8016f362a..9ba4dee7081 100644 --- a/htdocs/product/stats/commande.php +++ b/htdocs/product/stats/commande.php @@ -43,13 +43,10 @@ $socid = ''; if (!empty($user->socid)) { $socid = $user->socid; } -$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('productstatsorder')); -$mesg = ''; - // Load variable for pagination $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); @@ -75,6 +72,9 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', $search_year = ''; } +$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); + + /* * View */ diff --git a/htdocs/product/stats/commande_fournisseur.php b/htdocs/product/stats/commande_fournisseur.php index bc8346e39b1..6037f608b58 100644 --- a/htdocs/product/stats/commande_fournisseur.php +++ b/htdocs/product/stats/commande_fournisseur.php @@ -42,7 +42,6 @@ $socid = ''; if (!empty($user->socid)) { $socid = $user->socid; } -$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('productstatssupplyorder')); @@ -74,6 +73,8 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', $search_year = ''; } +$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); + /* * View diff --git a/htdocs/product/stats/contrat.php b/htdocs/product/stats/contrat.php index e419593208c..f91e74edf50 100644 --- a/htdocs/product/stats/contrat.php +++ b/htdocs/product/stats/contrat.php @@ -40,13 +40,10 @@ $fieldtype = (!empty($ref) ? 'ref' : 'rowid'); if ($user->socid) { $socid = $user->socid; } -$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('productstatscontract')); -$mesg = ''; - // Load variable for pagination $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); @@ -65,6 +62,8 @@ if (!$sortfield) { $sortfield = "c.date_contrat"; } +$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); + /* * View diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index fa7d4fae24f..0681aa9b5ca 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -44,7 +44,6 @@ $socid = ''; if (!empty($user->socid)) { $socid = $user->socid; } -$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('productstatsinvoice')); @@ -77,6 +76,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', $search_year = ''; } +$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); /* diff --git a/htdocs/product/stats/facture_fournisseur.php b/htdocs/product/stats/facture_fournisseur.php index 018f1c28f02..69ef83ae5a7 100644 --- a/htdocs/product/stats/facture_fournisseur.php +++ b/htdocs/product/stats/facture_fournisseur.php @@ -44,13 +44,10 @@ $socid = ''; if (!empty($user->socid)) { $socid = $user->socid; } -$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('productstatssupplyinvoice')); -$mesg = ''; - // Load variable for pagination $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); @@ -76,6 +73,9 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', $search_year = ''; } +$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); + + /* * View */ diff --git a/htdocs/product/stats/mo.php b/htdocs/product/stats/mo.php index 1cabfd9ef85..fefb89592e7 100644 --- a/htdocs/product/stats/mo.php +++ b/htdocs/product/stats/mo.php @@ -40,13 +40,10 @@ $fieldtype = (!empty($ref) ? 'ref' : 'rowid'); if ($user->socid) { $socid = $user->socid; } -$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('productstatscontract')); -$mesg = ''; - // Load variable for pagination $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); @@ -65,6 +62,8 @@ if (!$sortfield) { $sortfield = "c.date_valid"; } +$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); + /* * View diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php index 7dfc8b6d1db..96303ac598d 100644 --- a/htdocs/product/stats/propal.php +++ b/htdocs/product/stats/propal.php @@ -48,8 +48,6 @@ $result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('productstatspropal')); -$mesg = ''; - // Load variable for pagination $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); @@ -76,6 +74,9 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', $search_year = ''; } +$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); + + /* * View */ diff --git a/htdocs/product/stats/supplier_proposal.php b/htdocs/product/stats/supplier_proposal.php index 86689786b2d..1b236ed3999 100644 --- a/htdocs/product/stats/supplier_proposal.php +++ b/htdocs/product/stats/supplier_proposal.php @@ -43,13 +43,10 @@ $socid = ''; if (!empty($user->socid)) { $socid = $user->socid; } -$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('productstatspropal')); -$mesg = ''; - // Load variable for pagination $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); @@ -76,6 +73,9 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', $search_year = ''; } +$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); + + /* * View */ diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index b97e9b6c2d2..883fff49123 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -81,8 +81,6 @@ if (!empty($batchnumber)) { if ($user->socid) { $socid = $user->socid; } -$result = restrictedArea($user, 'produit&stock', $id, 'product&product', '', '', $fieldid); - $object = new Product($db); $extrafields = new ExtraFields($db); @@ -114,6 +112,17 @@ $hookmanager->initHooks(array('stockproductcard', 'globalcard')); $error = 0; +if ($object->id > 0) { + if ($object->type == $object::TYPE_PRODUCT) { + restrictedArea($user, 'produit', $object->id, 'product&product', '', ''); + } + if ($object->type == $object::TYPE_SERVICE) { + restrictedArea($user, 'service', $object->id, 'product&product', '', ''); + } +} else { + restrictedArea($user, 'produit|service', $id, 'product&product', '', '', $fieldid); +} + /* * Actions diff --git a/htdocs/product/traduction.php b/htdocs/product/traduction.php index 45b45136410..b2c3b0d0b2f 100644 --- a/htdocs/product/traduction.php +++ b/htdocs/product/traduction.php @@ -45,7 +45,22 @@ $fieldtype = (!empty($ref) ? 'ref' : 'rowid'); if ($user->socid) { $socid = $user->socid; } -$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); + +if ($id > 0 || !empty($ref)) { + $object = new Product($db); + $object->fetch($id, $ref); +} + +if ($object->id > 0) { + if ($object->type == $object::TYPE_PRODUCT) { + restrictedArea($user, 'produit', $object->id, 'product&product', '', ''); + } + if ($object->type == $object::TYPE_SERVICE) { + restrictedArea($user, 'service', $object->id, 'product&product', '', ''); + } +} else { + restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); +} /* diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index ded3a1bb8b9..a7ad432b3ba 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -51,7 +51,6 @@ $delete_product = GETPOST('delete_product', 'alpha'); // Security check $fieldvalue = (!empty($id) ? $id : $ref); $fieldtype = (!empty($ref) ? 'ref' : 'rowid'); -$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); $prodstatic = new Product($db); $prodattr = new ProductAttribute($db); @@ -64,8 +63,6 @@ if ($id > 0 || $ref) { $selectedvariant = $_SESSION['addvariant_'.$object->id]; -$permissiontoread = $user->rights->produit->lire || $user->rights->service->lire; - // Security check if (empty($conf->variants->enabled)) { accessforbidden('Module not enabled'); @@ -73,8 +70,17 @@ if (empty($conf->variants->enabled)) { if ($user->socid > 0) { // Protection if external user accessforbidden(); } -//$result = restrictedArea($user, 'variant'); -if (!$permissiontoread) accessforbidden(); + +if ($object->id > 0) { + if ($object->type == $object::TYPE_PRODUCT) { + restrictedArea($user, 'produit', $object->id, 'product&product', '', ''); + } + if ($object->type == $object::TYPE_SERVICE) { + restrictedArea($user, 'service', $object->id, 'product&product', '', ''); + } +} else { + restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); +} /* From 67cab8c1f2538ef7cc6af384dbedb374cbfb64d5 Mon Sep 17 00:00:00 2001 From: r3dge Date: Fri, 21 May 2021 16:01:04 +0200 Subject: [PATCH 0200/1497] bug fix : replacing orders by donations and setting required field to allow post action in rest API for url donations. See issue #17700 --- htdocs/don/class/api_donations.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/don/class/api_donations.class.php b/htdocs/don/class/api_donations.class.php index 18a8563fd89..5f70ee82a2e 100644 --- a/htdocs/don/class/api_donations.class.php +++ b/htdocs/don/class/api_donations.class.php @@ -33,7 +33,7 @@ class Donations extends DolibarrApi * @var array $FIELDS Mandatory fields, checked when create and update object */ static $FIELDS = array( - 'socid' + 'amount' ); /** @@ -193,7 +193,7 @@ class Donations extends DolibarrApi }*/ if ($this->don->create(DolibarrApiAccess::$user) < 0) { - throw new RestException(500, "Error creating order", array_merge(array($this->don->error), $this->don->errors)); + throw new RestException(500, "Error creating donation", array_merge(array($this->don->error), $this->don->errors)); } return $this->don->id; @@ -355,7 +355,7 @@ class Donations extends DolibarrApi private function _validate($data) { $don = array(); - foreach (Orders::$FIELDS as $field) { + foreach (Donations::$FIELDS as $field) { if (!isset($data[$field])) throw new RestException(400, $field." field missing"); $don[$field] = $data[$field]; From fe272d32925657b0fe12482eaf56264eda8d21f2 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Fri, 21 May 2021 16:01:44 +0200 Subject: [PATCH 0201/1497] wip name of contact to add on ics file --- htdocs/comm/action/class/actioncomm.class.php | 1 + .../class/conferenceorbooth.class.php | 1 + htdocs/public/project/suggestconference.php | 15 ++++++++++++--- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 747c50c9640..5790811fc2e 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1944,6 +1944,7 @@ class ActionComm extends CommonObject $duration = ($datestart && $dateend) ? ($dateend - $datestart) : 0; $event['summary'] = $obj->label.($obj->socname ? " (".$obj->socname.")" : ""); + $event['desc'] = $obj->note; $event['startdate'] = $datestart; $event['enddate'] = $dateend; // Not required with type 'journal' diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index ff26d192301..bb8649106b9 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -215,6 +215,7 @@ class ConferenceOrBooth extends ActionComm $this->socid=$this->fk_soc; $this->datef=$this->datep2; $this->note_private=$this->note; + $this->fk_user_author=$this->fk_user_author; } /** diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index 0028f544f9f..19eb0801c6a 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -225,7 +225,11 @@ if (empty($reshook) && $action == 'add') { } if (!GETPOST("lastname")) { $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Name"))."
    \n"; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Lastname"))."
    \n"; + } + if (!GETPOST("firstname")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Firstname"))."
    \n"; } if (!GETPOST("societe")) { $error++; @@ -297,7 +301,6 @@ if (empty($reshook) && $action == 'add') { $contact->state_id = (int) GETPOST("state_id", 'int'); $contact->email = $email; $contact->statut = 1; //Default status to Actif - $resultcreatecontact = $contact->create($user); if ($resultcreatecontact<0) { $error++; @@ -362,6 +365,8 @@ if (empty($reshook) && $action == 'add') { $conforbooth->datep2 = $dateend; $conforbooth->datec = dol_now(); $conforbooth->tms = dol_now(); + $conforbooth->firstname = $contact->firstname; + $conforbooth->lastname = $contact->lastname; $resultconforbooth = $conforbooth->create($user); if ($resultconforbooth<=0) { $error++; @@ -488,10 +493,14 @@ jQuery(document).ready(function () { print '
    '.img_picto('', 'recent').' '.$title.'
    '; + $formconfirm .= img_picto('', 'recent').' '.$title; + $formconfirm .= '
    '.$question.''; - $formconfirm .= $this->selectyesno("confirm", $newselectedchoice); + $formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly'); $formconfirm .= ''; $formconfirm .= '
    '; - print img_picto('', 'company').$form->select_company('', 'socid', '(s.client = 1 OR s.client = 2 OR s.client = 3) AND status=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300 maxwidth500'); + print img_picto('', 'company').$form->select_company('', 'socid', '(s.client = 1 OR s.client = 2 OR s.client = 3) AND status=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300 maxwidth500 widthcentpercentminusxx'); // reload page to retrieve customer informations if (empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE_DISABLED)) { print ''; + '; + } print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $button, $result, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit); + $selectedfields = ''; + $moreforfilter = ''; $moreforfilter .= '
    '; @@ -283,12 +298,18 @@ if ($action != 'export_csv') { print ' '; print $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', $langs->trans('to'), array(), 1, 1, '', 'accounts'); print '
    '; + + // Fields from hook + $parameters = array('arrayfields'=>$arrayfields); + $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + + // Action column + print ''; $searchpicto = $form->showFilterButtons(); print $searchpicto; print '
    '."\n"; -// Name +// Last Name print ''; print ''; print ''; +// First Name +print ''; +print ''; +print ''; // Email print ''."\n"; // Company From 4df70dc3f49e3fa3e952d35501090687e8039043 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 21 May 2021 16:22:45 +0200 Subject: [PATCH 0202/1497] Fix CWE-269 huntr --- htdocs/ecm/dir_add_card.php | 2 +- htdocs/ecm/dir_card.php | 14 ++++++++++---- htdocs/ecm/file_card.php | 14 +++++++++----- htdocs/ecm/file_note.php | 13 ++++++++----- htdocs/ecm/index.php | 12 ++++++------ htdocs/ecm/search.php | 6 ++++++ 6 files changed, 40 insertions(+), 21 deletions(-) diff --git a/htdocs/ecm/dir_add_card.php b/htdocs/ecm/dir_add_card.php index 4cf557acde6..1416983e3a3 100644 --- a/htdocs/ecm/dir_add_card.php +++ b/htdocs/ecm/dir_add_card.php @@ -188,7 +188,7 @@ if ($action == 'add' && $permtoadd) { exit; } } -} elseif ($action == 'confirm_deletesection' && $confirm == 'yes') { +} elseif ($action == 'confirm_deletesection' && $confirm == 'yes' && $permtoadd) { // Deleting file $result = $ecmdir->delete($user); setEventMessages($langs->trans("ECMSectionWasRemoved", $ecmdir->label), null, 'mesgs'); diff --git a/htdocs/ecm/dir_card.php b/htdocs/ecm/dir_card.php index 4c93e005266..d84a7330e69 100644 --- a/htdocs/ecm/dir_card.php +++ b/htdocs/ecm/dir_card.php @@ -88,17 +88,23 @@ if ($module == 'ecm') { } // Permissions +$permtoread = 0; $permtoadd = 0; $permtoupload = 0; if ($module == 'ecm') { + $permtoread = $user->rights->ecm->read; $permtoadd = $user->rights->ecm->setup; $permtoupload = $user->rights->ecm->upload; } if ($module == 'medias') { + $permtoread = ($user->rights->mailing->lire || $user->rights->website->read); $permtoadd = ($user->rights->mailing->creer || $user->rights->website->write); $permtoupload = ($user->rights->mailing->creer || $user->rights->website->write); } +if (!$permtoread) { + accessforbidden(); +} /* @@ -106,7 +112,7 @@ if ($module == 'medias') { */ // Upload file -if (GETPOST("sendit") && !empty($conf->global->MAIN_UPLOAD_DOC)) { +if (GETPOST("sendit") && !empty($conf->global->MAIN_UPLOAD_DOC) && $permtoupload) { if (dol_mkdir($upload_dir) >= 0) { $resupload = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir."/".dol_unescapefile($_FILES['userfile']['name']), 0, 0, $_FILES['userfile']['error']); if (is_numeric($resupload) && $resupload > 0) { @@ -131,7 +137,7 @@ if (GETPOST("sendit") && !empty($conf->global->MAIN_UPLOAD_DOC)) { } // Remove file -if ($action == 'confirm_deletefile' && $confirm == 'yes') { +if ($action == 'confirm_deletefile' && $confirm == 'yes' && $permtoupload) { $langs->load("other"); $file = $upload_dir."/".GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). $ret = dol_delete_file($file); @@ -145,7 +151,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes') { } // Remove dir -if ($action == 'confirm_deletedir' && $confirm == 'yes') { +if ($action == 'confirm_deletedir' && $confirm == 'yes' && $permtoupload) { $backtourl = DOL_URL_ROOT."/ecm/index.php"; if ($module == 'medias') { $backtourl = DOL_URL_ROOT."/website/index.php?file_manager=1"; @@ -181,7 +187,7 @@ if ($action == 'confirm_deletedir' && $confirm == 'yes') { } // Update dirname or description -if ($action == 'update' && !GETPOST('cancel', 'alpha')) { +if ($action == 'update' && !GETPOST('cancel', 'alpha') && $permtoadd) { $error = 0; if ($module == 'ecm') { diff --git a/htdocs/ecm/file_card.php b/htdocs/ecm/file_card.php index 93885c2843a..14bc7e377f0 100644 --- a/htdocs/ecm/file_card.php +++ b/htdocs/ecm/file_card.php @@ -36,10 +36,6 @@ $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); -if (!$user->rights->ecm->setup) { - accessforbidden(); -} - // Get parameters $socid = GETPOST("socid", "int"); @@ -105,6 +101,14 @@ if ($result < 0) { exit; } +// Permissions +$permtoread = $user->rights->ecm->read; +$permtoadd = $user->rights->ecm->setup; +$permtoupload = $user->rights->ecm->upload; + +if (!$permtoread) { + accessforbidden(); +} /* @@ -123,7 +127,7 @@ if ($cancel) { } // Rename file -if ($action == 'update') { +if ($action == 'update' && $permtoadd) { $error = 0; $oldlabel = GETPOST('urlfile', 'alpha'); diff --git a/htdocs/ecm/file_note.php b/htdocs/ecm/file_note.php index d2f3f7b4792..505e432f982 100644 --- a/htdocs/ecm/file_note.php +++ b/htdocs/ecm/file_note.php @@ -22,7 +22,7 @@ /** * \file htdocs/ecm/file_note.php * \ingroup ecm - * \brief Fiche de notes sur une ecm file + * \brief Tab for notes on an ECM file */ require '../main.inc.php'; @@ -39,10 +39,6 @@ $ref = GETPOST('ref', 'alpha'); $socid = GETPOST('socid', 'int'); $action = GETPOST('action', 'aZ09'); -if (!$user->rights->ecm->setup) { - accessforbidden(); -} - // Get parameters $socid = GETPOST("socid", "int"); // Security check @@ -109,6 +105,13 @@ if ($result < 0) { $permissionnote = $user->rights->ecm->setup; // Used by the include of actions_setnotes.inc.php +$permtoread = $user->rights->ecm->read; + +if (!$permtoread) { + accessforbidden(); +} + + /* * Actions */ diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php index 26bf242b0f2..3a8d33343c7 100644 --- a/htdocs/ecm/index.php +++ b/htdocs/ecm/index.php @@ -34,12 +34,6 @@ require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmdirectory.class.php'; // Load translation files required by the page $langs->loadLangs(array("ecm", "companies", "other", "users", "orders", "propal", "bills", "contracts")); -// Security check -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'ecm', 0); - // Get parameters $socid = GETPOST('socid', 'int'); $action = GETPOST('action', 'aZ09'); @@ -81,6 +75,12 @@ $userstatic = new User($db); $error = 0; +// Security check +if ($user->socid) { + $socid = $user->socid; +} +$result = restrictedArea($user, 'ecm', 0); + /* * Actions diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php index 979e1d3a417..aa792e0c9d7 100644 --- a/htdocs/ecm/search.php +++ b/htdocs/ecm/search.php @@ -84,6 +84,12 @@ if (!empty($section)) { } } +$permtoread = $user->rights->ecm->read; + +if (!$permtoread) { + accessforbidden(); +} + /* * Actions From a0418fc17d0c3a131096fe8f6c3767165c2f92de Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 21 May 2021 18:53:09 +0200 Subject: [PATCH 0203/1497] FIX CWE-269 huntr - download of files of project --- htdocs/core/class/html.formfile.class.php | 9 +++- htdocs/core/lib/files.lib.php | 17 +++++- htdocs/core/lib/security.lib.php | 52 ++++++++++++++----- htdocs/ecm/index_auto.php | 8 ++- .../class/expensereport.class.php | 22 ++++---- htdocs/projet/class/task.class.php | 3 +- 6 files changed, 78 insertions(+), 33 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 45429512046..573381b8b0c 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1774,11 +1774,16 @@ class FormFile continue; // We do not show orphelins files } - print ''."\n"; + print ''."\n"; print ''; print '
    lastname).'" autofocus="autofocus">
    firstname).'" autofocus="autofocus">
    '.$langs->trans("Email").'*
    '; if ($found > 0 && is_object($this->cache_objects[$modulepart.'_'.$id.'_'.$ref])) { - print $this->cache_objects[$modulepart.'_'.$id.'_'.$ref]->getNomUrl(1, 'document'); + $tmpobject = $this->cache_objects[$modulepart.'_'.$id.'_'.$ref]; + //if (! in_array($tmpobject->element, array('expensereport'))) { + print $tmpobject->getNomUrl(1, 'document'); + //} else { + // print $tmpobject->getNomUrl(1); + //} } else { print $langs->trans("ObjectDeleted", ($id ? $id : $ref)); } diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index ce5e7129bcf..90796f402d4 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2232,7 +2232,8 @@ function dol_most_recent_file($dir, $regexfilter = '', $excludefilter = array('( } /** - * Security check when accessing to a document (used by document.php, viewimage.php and webservices) + * Security check when accessing to a document (used by document.php, viewimage.php and webservices to get documents). + * TODO Replace code that set $accesallowed by a call to restrictedArea() * * @param string $modulepart Module of document ('module', 'module_user_temp', 'module_user' or 'module_temp') * @param string $original_file Relative path with filename, relative to modulepart. @@ -2612,12 +2613,26 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, // Wrapping pour les projets if ($fuser->rights->projet->{$lire} || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; + // If we known $id of project, call checkUserAccessToObject to check permission on properties and contact of project + if ($refname && !preg_match('/^specimen/i', $original_file)) { + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + $tmpproject = new Project($db); + $tmpproject->fetch('', $refname); + $accessallowed = checkUserAccessToObject($user, array('projet'), $tmpproject->id, 'projet&project', '', '', 'rowid', ''); + } } $original_file = $conf->projet->dir_output.'/'.$original_file; $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."projet WHERE ref='".$db->escape($refname)."' AND entity IN (".getEntity('project').")"; } elseif ($modulepart == 'project_task' && !empty($conf->projet->dir_output)) { if ($fuser->rights->projet->{$lire} || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; + // If we known $id of project, call checkUserAccessToObject to check permission on properties and contact of project + if ($refname && !preg_match('/^specimen/i', $original_file)) { + include_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; + $tmptask = new Task($db); + $tmptask->fetch('', $refname); + $accessallowed = checkUserAccessToObject($user, array('projet_task'), $tmptask->id, 'projet&project', '', '', 'rowid', ''); + } } $original_file = $conf->projet->dir_output.'/'.$original_file; $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."projet WHERE ref='".$db->escape($refname)."' AND entity IN (".getEntity('project').")"; diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 06baefed88e..598802ea574 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -183,10 +183,11 @@ function dol_verifyHash($chain, $hash, $type = '0') * @param string $dbt_keyfield Field name for socid foreign key if not fk_soc. Not used if objectid is null (optional) * @param string $dbt_select Field name for select if not rowid. Not used if objectid is null (optional) * @param int $isdraft 1=The object with id=$objectid is a draft - * @return int Always 1, die process if not allowed + * @param int $mode Mode (0=default, 1=return with not die) + * @return int If mode = 0 (default): Always 1, die process if not allowed. If mode = 1: Return 0 if access not allowed. * @see dol_check_secure_access_document(), checkUserAccessToObject() */ -function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $feature2 = '', $dbt_keyfield = 'fk_soc', $dbt_select = 'rowid', $isdraft = 0) +function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $feature2 = '', $dbt_keyfield = 'fk_soc', $dbt_select = 'rowid', $isdraft = 0, $mode = 0) { global $db, $conf; global $hookmanager; @@ -231,7 +232,11 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f if (isset($hookmanager->resArray['result'])) { if ($hookmanager->resArray['result'] == 0) { - accessforbidden(); // Module returns 0, so access forbidden + if ($mode) { + return 0; + } else { + accessforbidden(); // Module returns 0, so access forbidden + } } } if ($reshook > 0) { // No other test done. @@ -346,7 +351,11 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f } if (!$readok) { - accessforbidden(); + if ($mode) { + return 0; + } else { + accessforbidden(); + } } //print "Read access is ok"; @@ -435,7 +444,11 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f } if ($wemustcheckpermissionforcreate && !$createok) { - accessforbidden(); + if ($mode) { + return 0; + } else { + accessforbidden(); + } } //print "Write access is ok"; } @@ -448,7 +461,11 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f } if (!$createuserok) { - accessforbidden(); + if ($mode) { + return 0; + } else { + accessforbidden(); + } } //print "Create user access is ok"; } @@ -523,26 +540,34 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f } if (!$deleteok && !($isdraft && $createok)) { - accessforbidden(); + if ($mode) { + return 0; + } else { + accessforbidden(); + } } //print "Delete access is ok"; } - // If we have a particular object to check permissions on, we check this object - // is linked to a company allowed to $user. + // If we have a particular object to check permissions on, we check if $user has permission + // for this given object (link to company, is contact for project, ...) if (!empty($objectid) && $objectid > 0) { $ok = checkUserAccessToObject($user, $featuresarray, $objectid, $tableandshare, $feature2, $dbt_keyfield, $dbt_select, $parentfortableentity); $params = array('objectid' => $objectid, 'features' => join(',', $featuresarray), 'features2' => $feature2); //print 'checkUserAccessToObject ok='.$ok; - return $ok ? 1 : accessforbidden('', 1, 1, 0, $params); + if ($mode) { + return $ok ? 1 : 0; + } else { + return $ok ? 1 : accessforbidden('', 1, 1, 0, $params); + } } return 1; } /** - * Check access by user to object. - * This function is also called by restrictedArea that check before if module is enabled and permissions of user compared to $action. + * Check access by user to object is ok. + * This function is also called by restrictedArea that check before if module is enabled and if permission of user for $action is ok. * * @param User $user User to check * @param array $featuresarray Features/modules to check. Example: ('user','service','member','project','task',...) @@ -555,7 +580,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f * @return bool True if user has access, False otherwise * @see restrictedArea() */ -function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableandshare = '', $feature2 = '', $dbt_keyfield = '', $dbt_select = 'rowid', $parenttableforentity = '') +function checkUserAccessToObject($user, array $featuresarray, $objectid = 0, $tableandshare = '', $feature2 = '', $dbt_keyfield = '', $dbt_select = 'rowid', $parenttableforentity = '') { global $db, $conf; @@ -689,6 +714,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $projectstatic = new Project($db); $tmps = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1, 0); + $tmparray = explode(',', $tmps); if (!in_array($objectid, $tmparray)) { return false; diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index bcfff8aa2da..d54dcf14d1e 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -440,15 +440,13 @@ if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i', $act continue; // If condition to show is ok } - $var = false; - print ''; $transfound = 0; $transkey = ''; - if (in_array($fieldlist[$field], array('label', 'libelle'))) // For label + if (in_array($fieldlist[$field], array('label', 'libelle')) and !empty($obj->code)) // For label { // Special case for labels if ($tabname == MAIN_DB_PREFIX.'c_civility') { From 89f150dd950089042499c3f529446c3b1535da63 Mon Sep 17 00:00:00 2001 From: gmilad <61253440+gmilad@users.noreply.github.com> Date: Sat, 22 May 2021 21:28:45 +0200 Subject: [PATCH 0205/1497] Fix #16100 Update utils.class.php Fix #16100 End French Forum : https://www.dolibarr.fr/forum/t/erreur-sauvegarde-dump-base-de-donnees/35009/7 --- htdocs/core/class/utils.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index bd0dec24495..da116191bbb 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -287,7 +287,7 @@ class Utils { $param .= " -d"; // No row information (no data) } - $param .= " --default-character-set=utf8"; // We always save output into utf8 charset + $param .= " --default-character-set=utf8 --no-tablespaces"; // We always save output into utf8 charset $paramcrypted = $param; $paramclear = $param; if (!empty($dolibarr_main_db_pass)) From 83245d321b5fba8809498a46713cae9786b9f941 Mon Sep 17 00:00:00 2001 From: "jove@bisquerra.com" Date: Sun, 23 May 2021 09:55:01 +0200 Subject: [PATCH 0206/1497] FIX Search bug when hide product images --- htdocs/takepos/index.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 1f9e6c32b2b..26a62e36d6e 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -289,6 +289,8 @@ function LoadProducts(position, issubcat) { if (currentcat==val.fk_parent) { $("#prodivdesc"+ishow).show(); $("#prodesc"+ishow).text(val.label); + $("#probutton"+ishow).text(val.label); + $("#probutton"+ishow).show(); $("#proprice"+ishow).attr("class", "hidden"); $("#proprice"+ishow).html(""); $("#proimg"+ishow).attr("src","genimg/index.php?query=cat&id="+val.rowid); @@ -386,6 +388,8 @@ function MoreProducts(moreorless) { if (typeof (data[idata]) == "undefined") { $("#prodivdesc"+ishow).hide(); $("#prodesc"+ishow).text(""); + $("#probutton"+ishow).text(""); + $("#probutton"+ishow).hide(); $("#proprice"+ishow).attr("class", ""); $("#proprice"+ishow).html(""); $("#proimg"+ishow).attr("src","genimg/empty.png"); @@ -396,6 +400,8 @@ function MoreProducts(moreorless) { //Only show products with status=1 (for sell) $("#prodivdesc"+ishow).show(); $("#prodesc"+ishow).text(data[parseInt(idata)]['label']); + $("#probutton"+ishow).text(data[parseInt(idata)]['label']); + $("#probutton"+ishow).show(); if (data[parseInt(idata)]['price_formated']) { $("#proprice"+ishow).attr("class", "productprice"); $("#proprice"+ishow).html(data[parseInt(idata)]['price_formated']); @@ -544,6 +550,8 @@ function Search2(keyCodeForEnter) { for (i = 0; i < ; i++) { if (typeof (data[i]) == "undefined") { $("#prodesc" + i).text(""); + $("#probutton" + i).text(""); + $("#probutton" + i).hide(); $("#proprice" + i).attr("class", "hidden"); $("#proprice" + i).html(""); $("#proimg" + i).attr("src", "genimg/empty.png"); @@ -557,6 +565,8 @@ function Search2(keyCodeForEnter) { var titlestring = ; $("#prodesc" + i).text(data[i]['label']); $("#prodivdesc" + i).show(); + $("#probutton" + i).text(data[i]['label']); + $("#probutton" + i).show();; if (data[i]['price_formated']) { $("#proprice" + i).attr("class", "productprice"); $("#proprice" + i).html(data[i]['price_formated']); From f81136231a2250e1f4767f1c0285848b8cbc73bf Mon Sep 17 00:00:00 2001 From: r3dge Date: Sun, 23 May 2021 18:09:10 +0200 Subject: [PATCH 0207/1497] fixing PUT request for donation update --- htdocs/don/class/api_donations.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/don/class/api_donations.class.php b/htdocs/don/class/api_donations.class.php index 5f70ee82a2e..1a17f6ff94c 100644 --- a/htdocs/don/class/api_donations.class.php +++ b/htdocs/don/class/api_donations.class.php @@ -302,7 +302,7 @@ class Donations extends DolibarrApi throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - $result = $this->don->valid(DolibarrApiAccess::$user, $idwarehouse, $notrigger); + $result = $this->don->valid_promesse($id, DolibarrApiAccess::$user->id, $notrigger); if ($result == 0) { throw new RestException(304, 'Error nothing done. May be object is already validated'); } From 647997af2815c04111ea4e1831230e28f7a34364 Mon Sep 17 00:00:00 2001 From: r3dge Date: Sun, 23 May 2021 18:15:00 +0200 Subject: [PATCH 0208/1497] fixing error on date --- htdocs/don/class/don.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 0717870ac42..9396f3a718a 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -390,7 +390,7 @@ class Don extends CommonObject $sql .= ", phone"; $sql .= ", phone_mobile"; $sql .= ") VALUES ("; - $sql .= "'".$this->db->idate($now)."'"; + $sql .= "'".$this->db->idate($this->date)."'"; $sql .= ", ".$conf->entity; $sql .= ", ".price2num($this->amount); $sql .= ", ".($this->modepaymentid ? $this->modepaymentid : "null"); From 7d223beae53e05c5b671f745110ffdd231779b36 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 24 May 2021 12:51:58 +0200 Subject: [PATCH 0209/1497] fix: export balance with doublequote --- htdocs/accountancy/bookkeeping/balance.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 6c15fd6615c..664f659fb46 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -158,11 +158,11 @@ if ($action == 'export_csv') foreach ($object->lines as $line) { - print length_accountg($line->numero_compte).$sep; - print $object->get_compte_desc($line->numero_compte).$sep; - print price($line->debit).$sep; - print price($line->credit).$sep; - print price($line->debit - $line->credit).$sep; + print '"'.length_accountg($line->numero_compte).'"'.$sep; + print '"'.$object->get_compte_desc($line->numero_compte).'"'.$sep; + print '"'.price($line->debit).'"'.$sep; + print '"'.price($line->credit).'"'.$sep; + print '"'.price($line->debit - $line->credit).'"'.$sep; print "\n"; } From 60176f7f5ed78b0e43a2240cb286722280c1bde7 Mon Sep 17 00:00:00 2001 From: piernov Date: Mon, 24 May 2021 18:01:27 +0200 Subject: [PATCH 0210/1497] Fix add/del user to group modifies LDAP group Adding or removing a user from a group modifies the user object on Dolibarr's side. In LDAP however, members of a group are stored in the group itself. Therefore group must be updated after adding/removing a user from it. Update group in LDAP with new list of users at the end of USER_MODIFY trigger. --- ...interface_50_modLdap_Ldapsynchro.class.php | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php b/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php index d0b91bcbe37..d92f4c3ecc4 100644 --- a/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php +++ b/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php @@ -126,6 +126,52 @@ class InterfaceLdapsynchro extends DolibarrTriggers $newparent = $object->_load_ldap_dn($info, 1); $result = $ldap->update($dn, $info, $user, $olddn, $newrdn, $newparent); + + if ($result > 0 && !empty($object->context['newgroupid'])) { // We are in context of adding a new group to user + $usergroup = new Usergroup($this->db); + + $usergroup->fetch($object->context['newgroupid']); + + $oldinfo = $usergroup->_load_ldap_info(); + $olddn = $usergroup->_load_ldap_dn($oldinfo); + + // Verify if entry exist + $container = $usergroup->_load_ldap_dn($oldinfo, 1); + $search = "(".$usergroup->_load_ldap_dn($oldinfo, 2).")"; + $records = $ldap->search($container, $search); + if (count($records) && $records['count'] == 0) + { + $olddn = ''; + } + + $info = $usergroup->_load_ldap_info(); // Contains all members, included the new one (insert already done before trigger call) + $dn = $usergroup->_load_ldap_dn($info); + + $result = $ldap->update($dn, $info, $user, $olddn); + } + + if ($result > 0 && !empty($object->context['oldgroupid'])) { // We are in context of removing a group from user + $usergroup = new Usergroup($this->db); + + $usergroup->fetch($object->context['oldgroupid']); + + $oldinfo = $usergroup->_load_ldap_info(); + $olddn = $usergroup->_load_ldap_dn($oldinfo); + + // Verify if entry exist + $container = $usergroup->_load_ldap_dn($oldinfo, 1); + $search = "(".$usergroup->_load_ldap_dn($oldinfo, 2).")"; + $records = $ldap->search($container, $search); + if (count($records) && $records['count'] == 0) + { + $olddn = ''; + } + + $info = $usergroup->_load_ldap_info(); // Contains all members, except the old one (remove already done before trigger call) + $dn = $usergroup->_load_ldap_dn($info); + + $result = $ldap->update($dn, $info, $user, $olddn); + } } if ($result < 0) $this->error = "ErrorLDAP ".$ldap->error; From cdf3b7f9a8cb92e725b5bca83d981907dd9e73e9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 May 2021 19:05:25 +0200 Subject: [PATCH 0211/1497] Fix responsive --- htdocs/adherents/admin/member.php | 6 ++++++ htdocs/adherents/admin/website.php | 4 +++- htdocs/admin/reception_setup.php | 8 +++++++- htdocs/admin/resource.php | 2 ++ htdocs/admin/user.php | 7 ++++++- htdocs/core/lib/admin.lib.php | 2 ++ htdocs/theme/eldy/global.inc.php | 3 +++ htdocs/theme/md/style.css.php | 3 +++ htdocs/user/list.php | 2 +- 9 files changed, 33 insertions(+), 4 deletions(-) diff --git a/htdocs/adherents/admin/member.php b/htdocs/adherents/admin/member.php index 925f2c9094d..621873afc94 100644 --- a/htdocs/adherents/admin/member.php +++ b/htdocs/adherents/admin/member.php @@ -197,6 +197,8 @@ print ''; print ''; print load_fiche_titre($langs->trans("MemberMainOptions"), '', ''); + +print '
    '; print ''; print ''; print ''; @@ -268,6 +270,7 @@ if ($conf->facture->enabled) { } print '
    '.$langs->trans("Description").'
    '; +print '
    '; print '
    '; print ''; @@ -338,6 +341,7 @@ if ($resql) { print load_fiche_titre($langs->trans("MembersDocModules"), '', ''); +print '
    '; print ''; print ''; print ''; @@ -446,6 +450,8 @@ foreach ($dirmodels as $reldir) { } print '
    '.$langs->trans("Name").'
    '; +print '
    '; + print "
    "; print dol_get_fiche_end(); diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php index 06796ef193c..bb320e9f48a 100644 --- a/htdocs/adherents/admin/website.php +++ b/htdocs/adherents/admin/website.php @@ -172,6 +172,7 @@ print '
    '; if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) { print '
    '; + print '
    '; print ''; print ''; @@ -234,6 +235,7 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) { print "\n"; print '
    '; + print '
    '; print '
    '; print ''; @@ -262,7 +264,7 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) { //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current print ''; print ajax_autoselect('publicurlmember'); diff --git a/htdocs/admin/reception_setup.php b/htdocs/admin/reception_setup.php index 6ea6d195040..7cc9ae3e3be 100644 --- a/htdocs/admin/reception_setup.php +++ b/htdocs/admin/reception_setup.php @@ -178,6 +178,7 @@ print dol_get_fiche_head($head, 'reception', $langs->trans("Receptions"), -1, 'r print load_fiche_titre($langs->trans("ReceptionsNumberingModules")); +print '
    '; print ''; print ''; print ''; @@ -272,8 +273,10 @@ foreach ($dirmodels as $reldir) { } } -print '
    '.$langs->trans("Name").'

    '; +print '
    '; +print ''; +print '
    '; /* * Documents models for Receptions Receipt @@ -302,6 +305,7 @@ if ($resql) { dol_print_error($db); } +print '
    '; print ''; print ''; print ''; @@ -417,6 +421,8 @@ foreach ($dirmodels as $reldir) { } print '
    '.$langs->trans("Name").'
    '; +print '
    '; + print '
    '; diff --git a/htdocs/admin/resource.php b/htdocs/admin/resource.php index b8bb566c79b..06ae59d64a3 100644 --- a/htdocs/admin/resource.php +++ b/htdocs/admin/resource.php @@ -74,6 +74,7 @@ print ''; print ''; print ''; +print '
    '; print ''; print ''; print ''."\n"; @@ -132,6 +133,7 @@ print ''; print ''; print '
    '.$langs->trans("Parameters").'
    '; +print '
    '; print ''; diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php index 0dccf65e5e7..83649d46a28 100644 --- a/htdocs/admin/user.php +++ b/htdocs/admin/user.php @@ -126,6 +126,7 @@ $head = user_admin_prepare_head(); print dol_get_fiche_head($head, 'card', $langs->trans("MenuUsersAndGroups"), -1, 'user'); +print '
    '; print ''; print ''; print ''; @@ -171,6 +172,7 @@ if ($conf->use_javascript_ajax) { print ''; print '
    '.$langs->trans("Parameter").'
    '; +print '
    '; print '
    '; @@ -197,6 +199,7 @@ if ($resql) { print load_fiche_titre($langs->trans("UsersDocModules"), '', ''); +print '
    '; print ''; print ''; print ''; @@ -306,7 +309,9 @@ foreach ($dirmodels as $reldir) { } print '
    '.$langs->trans("Name").'
    '; -print "
    "; +print '
    '; + +print '
    '; print dol_get_fiche_end(); diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 303382f285b..ae260171a0b 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1545,6 +1545,7 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '') print ''; } + print '
    '; print ''; print ''; print ''; @@ -1715,6 +1716,7 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '') } } print '
    '.$langs->trans("Description").'
    '; + print '
    '; if (!empty($strictw3c) && $strictw3c == 1) { print '
    '; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 6c705c62489..4468c36a7da 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -633,6 +633,9 @@ th .button { .quatrevingtquinzepercent { width: 95%; } +.quatrevingtpercentminusx { + width: calc(80% - 52px); +} textarea.centpercent { width: 96%; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 407a38ea320..f1fb649f4af 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -780,6 +780,9 @@ th .button { textarea.centpercent { width: 96%; } +.quatrevingtpercentminusx { + width: calc(80% - 52px); +} .small, small { font-size: 85%; } diff --git a/htdocs/user/list.php b/htdocs/user/list.php index d5df7ced259..693590ff7d2 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -188,7 +188,7 @@ if ($mode == 'employee') { accessforbidden(); } } else { - if (!$user->rights->user->user->lire && !$user->admin) { + if (empty($user->rights->user->user->lire) && empty($user->admin)) { accessforbidden(); } } From d4310f49c4237fb7453b97473f01a59147bfa310 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 May 2021 19:46:19 +0200 Subject: [PATCH 0212/1497] FIX CWE-79 - huntr - Fix option MAIN_ALLOW_SVG_FILES_AS_IMAGES --- htdocs/admin/system/security.php | 20 ++++--- htdocs/core/class/html.form.class.php | 80 +++++++++++++++------------ 2 files changed, 57 insertions(+), 43 deletions(-) diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index a4060634ff9..7f258f8f30e 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -217,7 +217,7 @@ print '
    '; print '$dolibarr_nocsrfcheck: '.$dolibarr_nocsrfcheck; if (!empty($dolibarr_nocsrfcheck)) { - print img_picto('', 'warning').'   '.$langs->trans("IfYouAreOnAProductionSetThis", 0); + print '   '.img_picto('', 'warning').' '.$langs->trans("IfYouAreOnAProductionSetThis", 0); } print '
    '; @@ -234,16 +234,18 @@ print '
    '; print '
    '; print '
    '; print '
    '; -print load_fiche_titre($langs->trans("Menu").' '.$langs->trans("SecuritySetup"), '', 'folder'); +print load_fiche_titre($langs->trans("Menu").' '.$langs->trans("SecuritySetup").' + '.$langs->trans("OtherSetup"), '', 'folder'); //print ''.$langs->trans("PasswordEncryption").': '; print 'MAIN_SECURITY_HASH_ALGO = '.(empty($conf->global->MAIN_SECURITY_HASH_ALGO) ? ''.$langs->trans("Undefined").'' : $conf->global->MAIN_SECURITY_HASH_ALGO)."   "; if (empty($conf->global->MAIN_SECURITY_HASH_ALGO)) { print '     If unset: \'md5\''; } -print '
    '; if ($conf->global->MAIN_SECURITY_HASH_ALGO != 'password_hash') { - print 'MAIN_SECURITY_SALT = '.(empty($conf->global->MAIN_SECURITY_SALT) ? ''.$langs->trans("Undefined").'' : $conf->global->MAIN_SECURITY_SALT).'
    '; + print '
    MAIN_SECURITY_SALT = '.(empty($conf->global->MAIN_SECURITY_SALT) ? ''.$langs->trans("Undefined").'' : $conf->global->MAIN_SECURITY_SALT).'
    '; +} else { + print '('.$langs->trans("Recommanded").': password_hash)'; + print '
    '; } if ($conf->global->MAIN_SECURITY_HASH_ALGO != 'password_hash') { print '
    The recommanded value for MAIN_SECURITY_HASH_ALGO is now \'password_hash\' but setting it now will make ALL existing passwords of all users not valid, so update is not possible.
    '; @@ -259,18 +261,20 @@ print '
    '; print 'MAIN_SECURITY_ANTI_SSRF_SERVER_IP = '.(empty($conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP) ? ''.$langs->trans("Undefined").'' : $conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP)."
    "; print '
    '; +print 'MAIN_ALLOW_SVG_FILES_AS_IMAGES = '.(empty($conf->global->MAIN_ALLOW_SVG_FILES_AS_IMAGES) ? '0   ('.$langs->trans("Recommanded").': 0)' : $conf->global->MAIN_ALLOW_SVG_FILES_AS_IMAGES)."
    "; +print '
    '; print 'MAIN_EXEC_USE_POPEN = '; if (empty($conf->global->MAIN_EXEC_USE_POPEN)) { - print ''.$langs->trans("Undefined").'   '; + print ''.$langs->trans("Undefined").''; } else { - print $conf->global->MAIN_EXEC_USE_POPEN.'   '; + print $conf->global->MAIN_EXEC_USE_POPEN; } if ($execmethod == 1) { - print ' --> "exec" PHP method will be used for shell commands.'; + print '   ("exec" PHP method will be used for shell commands)'; } if ($execmethod == 2) { - print ' --> "popen" PHP method will be used for shell commands.'; + print '   ("popen" PHP method will be used for shell commands)'; } print "
    "; print '
    '; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 57bbbe3a029..ea9692f2864 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -8193,41 +8193,47 @@ class Form if ($modulepart == 'societe') { $dir = $conf->societe->multidir_output[$entity]; if (!empty($object->logo)) { - if ((string) $imagesize == 'mini') { - $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs - } elseif ((string) $imagesize == 'small') { - $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_small'); - } else { - $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo; + if (dolIsAllowedForPreview($object->logo)) { + if ((string) $imagesize == 'mini') { + $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs + } elseif ((string) $imagesize == 'small') { + $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_small'); + } else { + $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo; + } + $originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo; } - $originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo; } $email = $object->email; } elseif ($modulepart == 'contact') { $dir = $conf->societe->multidir_output[$entity].'/contact'; if (!empty($object->photo)) { - if ((string) $imagesize == 'mini') { - $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_mini'); - } elseif ((string) $imagesize == 'small') { - $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_small'); - } else { - $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo; + if (dolIsAllowedForPreview($object->logo)) { + if ((string) $imagesize == 'mini') { + $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_mini'); + } elseif ((string) $imagesize == 'small') { + $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_small'); + } else { + $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo; + } + $originalfile = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo; } - $originalfile = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo; } $email = $object->email; $capture = 'user'; } elseif ($modulepart == 'userphoto') { $dir = $conf->user->dir_output; if (!empty($object->photo)) { - if ((string) $imagesize == 'mini') { - $file = get_exdir(0, 0, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_mini'); - } elseif ((string) $imagesize == 'small') { - $file = get_exdir(0, 0, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_small'); - } else { - $file = get_exdir(0, 0, 0, 0, $object, 'user').$object->photo; + if (dolIsAllowedForPreview($object->logo)) { + if ((string) $imagesize == 'mini') { + $file = get_exdir(0, 0, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_mini'); + } elseif ((string) $imagesize == 'small') { + $file = get_exdir(0, 0, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_small'); + } else { + $file = get_exdir(0, 0, 0, 0, $object, 'user').$object->photo; + } + $originalfile = get_exdir(0, 0, 0, 0, $object, 'user').$object->photo; } - $originalfile = get_exdir(0, 0, 0, 0, $object, 'user').$object->photo; } if (!empty($conf->global->MAIN_OLD_IMAGE_LINKS)) { $altfile = $object->id.".jpg"; // For backward compatibility @@ -8237,14 +8243,16 @@ class Form } elseif ($modulepart == 'memberphoto') { $dir = $conf->adherent->dir_output; if (!empty($object->photo)) { - if ((string) $imagesize == 'mini') { - $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini'); - } elseif ((string) $imagesize == 'small') { - $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small'); - } else { - $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo; + if (dolIsAllowedForPreview($object->logo)) { + if ((string) $imagesize == 'mini') { + $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini'); + } elseif ((string) $imagesize == 'small') { + $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small'); + } else { + $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo; + } + $originalfile = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo; } - $originalfile = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo; } if (!empty($conf->global->MAIN_OLD_IMAGE_LINKS)) { $altfile = $object->id.".jpg"; // For backward compatibility @@ -8255,14 +8263,16 @@ class Form // Generic case to show photos $dir = $conf->$modulepart->dir_output; if (!empty($object->photo)) { - if ((string) $imagesize == 'mini') { - $file = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_mini'); - } elseif ((string) $imagesize == 'small') { - $file = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_small'); - } else { - $file = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo; + if (dolIsAllowedForPreview($object->logo)) { + if ((string) $imagesize == 'mini') { + $file = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_mini'); + } elseif ((string) $imagesize == 'small') { + $file = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_small'); + } else { + $file = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo; + } + $originalfile = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo; } - $originalfile = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo; } if (!empty($conf->global->MAIN_OLD_IMAGE_LINKS)) { $altfile = $object->id.".jpg"; // For backward compatibility From 31af74f852f4db4fcc3e6cf46ebb346ea3e2979a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 May 2021 20:04:23 +0200 Subject: [PATCH 0213/1497] FIX CWE-269 - huntr - Can download files of an agenda event --- htdocs/core/lib/files.lib.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 90796f402d4..7e34eec5ecd 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2447,6 +2447,16 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, // Wrapping for events if ($fuser->rights->agenda->myactions->{$read}) { $accessallowed = 1; + // If we known $id of project, call checkUserAccessToObject to check permission on the given agenda event on properties and assigned users + if ($refname && !preg_match('/^specimen/i', $original_file)) { + include_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; + $tmpobject = new ActionComm($db); + $tmpobject->fetch((int) $refname); + $accessallowed = checkUserAccessToObject($user, array('agenda'), $tmpobject->id, 'actioncomm&societe', 'myactions|allactions', 'fk_soc', 'id', ''); + if ($user->socid && $tmpobject->socid) { + $accessallowed = checkUserAccessToObject($user, array('societe'), $tmpobject->socid); + } + } } $original_file = $conf->agenda->dir_output.'/'.$original_file; } elseif ($modulepart == 'category' && !empty($conf->categorie->multidir_output[$entity])) { From bb64a25638cdba35bba39b8cf44677529ca403b1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 May 2021 22:11:24 +0200 Subject: [PATCH 0214/1497] Fix CWE-269 - huntr - Fix set of email without edit user permission --- htdocs/core/class/ldap.class.php | 2 +- htdocs/user/bank.php | 82 +++++++++++++++++--------------- htdocs/user/card.php | 4 +- 3 files changed, 47 insertions(+), 41 deletions(-) diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 0f97ed878cf..a578f08f3c1 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -932,7 +932,7 @@ class Ldap * Returns an array containing a details or list of LDAP record(s) * ldapsearch -LLLx -hlocalhost -Dcn=admin,dc=parinux,dc=org -w password -b "ou=adherents,ou=people,dc=parinux,dc=org" userPassword * - * @param string $search Value of fiel to search, '*' for all. Not used if $activefilter is set. + * @param string $search Value of field to search, '*' for all. Not used if $activefilter is set. * @param string $userDn DN (Ex: ou=adherents,ou=people,dc=parinux,dc=org) * @param string $useridentifier Name of key field (Ex: uid) * @param array $attributeArray Array of fields required. Note this array must also contains field $useridentifier (Ex: sn,userPassword) diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 356e23a5de0..0b179653487 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -59,6 +59,29 @@ if ($user->socid > 0) { $socid = $user->socid; } $feature2 = (($socid && $user->rights->user->self->creer) ? '' : 'user'); + +$object = new User($db); +if ($id > 0 || !empty($ref)) { + $result = $object->fetch($id, $ref, '', 1); + $object->getrights(); +} + +$account = new UserBankAccount($db); +if (!$bankid) { + $account->fetch(0, '', $id); +} else { + $account->fetch($bankid); +} +if (empty($account->userid)) { + $account->userid = $object->id; +} + + +// Define value to know what current user can do on users +$canadduser = (!empty($user->admin) || $user->rights->user->user->creer); +$canreaduser = (!empty($user->admin) || $user->rights->user->user->lire); +$permissiontoaddbankaccount = (!empty($user->rights->salaries->write) || !empty($user->rights->hrm->employee->write) || !empty($user->rights->user->creer)); + // Ok if user->rights->salaries->read or user->rights->hrm->read //$result = restrictedArea($user, 'salaries|hrm', $id, 'user&user', $feature2); $ok = false; @@ -78,30 +101,12 @@ if (!$ok) { accessforbidden(); } -$object = new User($db); -if ($id > 0 || !empty($ref)) { - $result = $object->fetch($id, $ref, '', 1); - $object->getrights(); -} - -$account = new UserBankAccount($db); -if (!$bankid) { - $account->fetch(0, '', $id); -} else { - $account->fetch($bankid); -} -if (empty($account->userid)) { - $account->userid = $object->id; -} - -$permissiontoaddbankaccount = (!empty($user->rights->salaries->write) || !empty($user->rights->hrm->employee->write) || !empty($user->rights->user->creer)); - /* * Actions */ -if ($action == 'add' && !$cancel) { +if ($action == 'add' && !$cancel && $permissiontoaddbankaccount) { $account->userid = $object->id; $account->bank = GETPOST('bank', 'alpha'); @@ -128,7 +133,7 @@ if ($action == 'add' && !$cancel) { } } -if ($action == 'update' && !$cancel) { +if ($action == 'update' && !$cancel && $permissiontoaddbankaccount) { $account->userid = $object->id; /* @@ -199,7 +204,7 @@ if ($action == 'update' && !$cancel) { } // update personal email -if ($action == 'setpersonal_email') { +if ($action == 'setpersonal_email' && $canadduser) { $object->personal_email = (string) GETPOST('personal_email', 'alphanohtml'); $result = $object->update($user); if ($result < 0) { @@ -208,7 +213,7 @@ if ($action == 'setpersonal_email') { } // update personal mobile -if ($action == 'setpersonal_mobile') { +if ($action == 'setpersonal_mobile' && $canadduser) { $object->personal_mobile = (string) GETPOST('personal_mobile', 'alphanohtml'); $result = $object->update($user); if ($result < 0) { @@ -216,25 +221,26 @@ if ($action == 'setpersonal_mobile') { } } -// update default_c_exp_tax_cat -if ($action == 'setdefault_c_exp_tax_cat') { - $object->default_c_exp_tax_cat = GETPOST('default_c_exp_tax_cat', 'int'); - $result = $object->update($user); - if ($result < 0) { - setEventMessages($object->error, $object->errors, 'errors'); +if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { + // update default_c_exp_tax_cat + if ($action == 'setdefault_c_exp_tax_cat' && $canadduser) { + $object->default_c_exp_tax_cat = GETPOST('default_c_exp_tax_cat', 'int'); + $result = $object->update($user); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } + } + + // update default range + if ($action == 'setdefault_range' && $canadduser) { + $object->default_range = GETPOST('default_range', 'int'); + $result = $object->update($user); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } } } -// update default range -if ($action == 'setdefault_range') { - $object->default_range = GETPOST('default_range', 'int'); - $result = $object->update($user); - if ($result < 0) { - setEventMessages($object->error, $object->errors, 'errors'); - } -} - - /* * View diff --git a/htdocs/user/card.php b/htdocs/user/card.php index cb4e7350e0e..0dd7506a784 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -615,8 +615,8 @@ if (empty($reshook)) { } // Action initialisation donnees depuis record LDAP - if ($action == 'adduserldap') { - $selecteduser = $_POST['users']; + if ($action == 'adduserldap' && $canadduser) { + $selecteduser = GETPOST('users'); $required_fields = array( $conf->global->LDAP_KEY_USERS, From dd48c3ee9d334bbd83e8cf430ce3343d93fac591 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 May 2021 00:07:38 +0200 Subject: [PATCH 0215/1497] Remove deprecated __REFCLIENT__ (Replaced with __REF_CLIENT__) --- ChangeLog | 2 +- htdocs/core/lib/functions.lib.php | 4 ---- htdocs/core/tpl/card_presend.tpl.php | 2 +- htdocs/core/tpl/massactions_pre.tpl.php | 2 +- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index ec201fa378e..50a0ff10131 100644 --- a/ChangeLog +++ b/ChangeLog @@ -169,7 +169,7 @@ Following changes may create regressions for some external modules, but were nec * If your database is PostgreSql, you must use version 9.1.0 or more (Dolibarr need the SQL function CONCAT) * If your database is MySql or MariaDB, you need at least version 5.1 * Function set_price_level() has been renamed into setPriceLevel() to follow camelcase rules - +* Remove deprecated subtituion key __REFCLIENT__ (Replaced with __REF_CLIENT__) ***** ChangeLog for 13.0.3 compared to 13.0.2 ***** diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 48237bbc826..eab810692c6 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6877,10 +6877,6 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $substitutionarray['__DATE_DELIVERY_SS__'] = (isset($object->date_livraison) ? dol_print_date($object->date_livraison, "%S") : ''); // For backward compatibility - $substitutionarray['__REFCLIENT__'] = (isset($object->ref_client) ? $object->ref_client : (isset($object->ref_customer) ? $object->ref_customer : null)); - $substitutionarray['__REFSUPPLIER__'] = (isset($object->ref_supplier) ? $object->ref_supplier : null); - $substitutionarray['__REFCLIENT__'] = (isset($object->ref_client) ? $object->ref_client : (isset($object->ref_customer) ? $object->ref_customer : null)); - $substitutionarray['__REFSUPPLIER__'] = (isset($object->ref_supplier) ? $object->ref_supplier : null); $substitutionarray['__SUPPLIER_ORDER_DATE_DELIVERY__'] = (isset($object->date_livraison) ? dol_print_date($object->date_livraison, 'day', 0, $outputlangs) : ''); $substitutionarray['__SUPPLIER_ORDER_DELAY_DELIVERY__'] = (isset($object->availability_code) ? ($outputlangs->transnoentities("AvailabilityType".$object->availability_code) != ('AvailabilityType'.$object->availability_code) ? $outputlangs->transnoentities("AvailabilityType".$object->availability_code) : $outputlangs->convToOutputCharset(isset($object->availability) ? $object->availability : '')) : ''); diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index 9c1387d7d58..731cc580ea1 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -76,7 +76,7 @@ if ($action == 'presend') { if (empty($object->ref_client)) { $topicmail = $outputlangs->trans($defaulttopic, '__REF__'); } elseif (!empty($object->ref_client)) { - $topicmail = $outputlangs->trans($defaulttopic, '__REF__ (__REFCLIENT__)'); + $topicmail = $outputlangs->trans($defaulttopic, '__REF__ (__REF_CLIENT__)'); } // Build document if it not exists diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index 21150d19936..4b8680e11bb 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -149,7 +149,7 @@ if ($massaction == 'presend') { $formmail->withtofree = empty($liste) ? 1 : 0; $formmail->withtocc = 1; $formmail->withtoccc = $conf->global->MAIN_EMAIL_USECCC; - $formmail->withtopic = $langs->transnoentities($topicmail, '__REF__', '__REFCLIENT__'); + $formmail->withtopic = $langs->transnoentities($topicmail, '__REF__', '__REF_CLIENT__'); $formmail->withfile = 1; // $formmail->withfile = 2; Not yet supported in mass action $formmail->withmaindocfile = 1; // Add a checkbox "Attach also main document" From 97154f8267dd28dac5402b3f1ea498a6f7ab3154 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 May 2021 00:29:32 +0200 Subject: [PATCH 0216/1497] Fix timezone into widgets --- htdocs/core/boxes/box_accountancy_last_manual_entries.php | 2 +- htdocs/core/boxes/box_actions.php | 4 ++-- htdocs/core/boxes/box_birthdays.php | 4 ++-- htdocs/core/boxes/box_birthdays_members.php | 4 ++-- htdocs/core/boxes/box_boms.php | 2 +- htdocs/core/boxes/box_clients.php | 4 ++-- htdocs/core/boxes/box_commandes.php | 2 +- htdocs/core/boxes/box_contacts.php | 2 +- htdocs/core/boxes/box_contracts.php | 2 +- htdocs/core/boxes/box_external_rss.php | 2 +- htdocs/core/boxes/box_factures.php | 4 ++-- htdocs/core/boxes/box_factures_fourn.php | 4 ++-- htdocs/core/boxes/box_factures_fourn_imp.php | 4 ++-- htdocs/core/boxes/box_factures_imp.php | 4 ++-- htdocs/core/boxes/box_ficheinter.php | 2 +- htdocs/core/boxes/box_fournisseurs.php | 4 ++-- htdocs/core/boxes/box_goodcustomers.php | 4 ++-- htdocs/core/boxes/box_last_modified_ticket.php | 2 +- htdocs/core/boxes/box_last_ticket.php | 2 +- htdocs/core/boxes/box_lastlogin.php | 2 +- htdocs/core/boxes/box_members.php | 4 ++-- htdocs/core/boxes/box_members_last_modified.php | 4 ++-- htdocs/core/boxes/box_members_last_subscriptions.php | 2 +- htdocs/core/boxes/box_members_subscriptions_by_year.php | 2 +- htdocs/core/boxes/box_mos.php | 4 ++-- htdocs/core/boxes/box_produits.php | 4 ++-- htdocs/core/boxes/box_propales.php | 4 ++-- htdocs/core/boxes/box_prospect.php | 4 ++-- htdocs/core/boxes/box_scheduled_jobs.php | 2 +- htdocs/core/boxes/box_services_contracts.php | 4 ++-- htdocs/core/boxes/box_services_expired.php | 2 +- htdocs/core/boxes/box_supplier_orders.php | 2 +- htdocs/core/boxes/box_supplier_orders_awaiting_reception.php | 2 +- 33 files changed, 50 insertions(+), 50 deletions(-) diff --git a/htdocs/core/boxes/box_accountancy_last_manual_entries.php b/htdocs/core/boxes/box_accountancy_last_manual_entries.php index 123f9894e1e..b1e4a637046 100644 --- a/htdocs/core/boxes/box_accountancy_last_manual_entries.php +++ b/htdocs/core/boxes/box_accountancy_last_manual_entries.php @@ -116,7 +116,7 @@ class box_accountancy_last_manual_entries extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => 'class="right"', + 'td' => 'class="center nowraponall"', 'text' => dol_print_date($date, 'day'), 'asis' => 1, ); diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php index e14fdfcb457..45c9d580ad2 100644 --- a/htdocs/core/boxes/box_actions.php +++ b/htdocs/core/boxes/box_actions.php @@ -161,8 +161,8 @@ class box_actions extends ModeleBoxes ); $this->info_box_contents[$line][2] = array( - 'td' => 'class="nowrap left"', - 'text' => dol_print_date($datelimite, "dayhour"), + 'td' => 'class="center nowraponall"', + 'text' => dol_print_date($datelimite, "dayhour", 'tzuserrel'), 'asis' => 1 ); diff --git a/htdocs/core/boxes/box_birthdays.php b/htdocs/core/boxes/box_birthdays.php index d6e6296a3cc..62cfaa590ab 100644 --- a/htdocs/core/boxes/box_birthdays.php +++ b/htdocs/core/boxes/box_birthdays.php @@ -118,8 +118,8 @@ class box_birthdays extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => 'class="right"', - 'text' => dol_print_date($dateb, "day").' - '.$age.' '.$langs->trans('DurationYears') + 'td' => 'class="center nowraponall"', + 'text' => dol_print_date($dateb, "day", 'gmt').' - '.$age.' '.$langs->trans('DurationYears') ); /*$this->info_box_contents[$line][] = array( diff --git a/htdocs/core/boxes/box_birthdays_members.php b/htdocs/core/boxes/box_birthdays_members.php index 4d367a223e2..5e772ff3593 100644 --- a/htdocs/core/boxes/box_birthdays_members.php +++ b/htdocs/core/boxes/box_birthdays_members.php @@ -115,8 +115,8 @@ class box_birthdays_members extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => 'class="right"', - 'text' => dol_print_date($dateb, "day").' - '.$age.' '.$langs->trans('DurationYears') + 'td' => 'class="center nowraponall"', + 'text' => dol_print_date($dateb, "day", 'gmt').' - '.$age.' '.$langs->trans('DurationYears') ); /*$this->info_box_contents[$line][] = array( diff --git a/htdocs/core/boxes/box_boms.php b/htdocs/core/boxes/box_boms.php index d0a169321d0..ae0877c0369 100644 --- a/htdocs/core/boxes/box_boms.php +++ b/htdocs/core/boxes/box_boms.php @@ -143,7 +143,7 @@ class box_boms extends ModeleBoxes $this->info_box_contents[$line][] = array( 'td' => 'class="right"', - 'text' => dol_print_date($datem, 'day'), + 'text' => dol_print_date($datem, 'day', 'tzuserrel'), ); $this->info_box_contents[$line][] = array( diff --git a/htdocs/core/boxes/box_clients.php b/htdocs/core/boxes/box_clients.php index 56b8fa089a3..df56b510823 100644 --- a/htdocs/core/boxes/box_clients.php +++ b/htdocs/core/boxes/box_clients.php @@ -134,8 +134,8 @@ class box_clients extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => 'class="right"', - 'text' => dol_print_date($datem, "day") + 'td' => 'class="center nowraponall"', + 'text' => dol_print_date($datem, "day", 'tzuserrel') ); $this->info_box_contents[$line][] = array( diff --git a/htdocs/core/boxes/box_commandes.php b/htdocs/core/boxes/box_commandes.php index eac431918b2..6583673f8ca 100644 --- a/htdocs/core/boxes/box_commandes.php +++ b/htdocs/core/boxes/box_commandes.php @@ -180,7 +180,7 @@ class box_commandes extends ModeleBoxes $this->info_box_contents[$line][] = array( 'td' => 'class="right"', - 'text' => dol_print_date($date, 'day'), + 'text' => dol_print_date($date, 'day', 'tzuserrel'), ); $this->info_box_contents[$line][] = array( diff --git a/htdocs/core/boxes/box_contacts.php b/htdocs/core/boxes/box_contacts.php index bd69ddc0108..fada6a93bfd 100644 --- a/htdocs/core/boxes/box_contacts.php +++ b/htdocs/core/boxes/box_contacts.php @@ -161,7 +161,7 @@ class box_contacts extends ModeleBoxes $this->info_box_contents[$line][] = array( 'td' => 'class="right"', - 'text' => dol_print_date($datem, "day"), + 'text' => dol_print_date($datem, "day", 'tzuserrel'), ); $this->info_box_contents[$line][] = array( diff --git a/htdocs/core/boxes/box_contracts.php b/htdocs/core/boxes/box_contracts.php index ad19184691c..9d7b625db91 100644 --- a/htdocs/core/boxes/box_contracts.php +++ b/htdocs/core/boxes/box_contracts.php @@ -156,7 +156,7 @@ class box_contracts extends ModeleBoxes $this->info_box_contents[$line][] = array( 'td' => 'class="right"', - 'text' => dol_print_date($datec, 'day'), + 'text' => dol_print_date($datec, 'day', 'tzuserrel'), ); $this->info_box_contents[$line][] = array( diff --git a/htdocs/core/boxes/box_external_rss.php b/htdocs/core/boxes/box_external_rss.php index 7bf8a69ed03..aff48328edb 100644 --- a/htdocs/core/boxes/box_external_rss.php +++ b/htdocs/core/boxes/box_external_rss.php @@ -150,7 +150,7 @@ class box_external_rss extends ModeleBoxes //$item['atom_content'] } if (is_numeric($date)) { - $date = dol_print_date($date, "dayhour"); + $date = dol_print_date($date, "dayhour", 'tzuserrel'); } $isutf8 = utf8_check($title); diff --git a/htdocs/core/boxes/box_factures.php b/htdocs/core/boxes/box_factures.php index 9ef12a9b8f6..2a97d738cd8 100644 --- a/htdocs/core/boxes/box_factures.php +++ b/htdocs/core/boxes/box_factures.php @@ -163,7 +163,7 @@ class box_factures extends ModeleBoxes $late = ''; if ($facturestatic->hasDelay()) { - $late = img_warning(sprintf($l_due_date, dol_print_date($datelimite, 'day'))); + $late = img_warning(sprintf($l_due_date, dol_print_date($datelimite, 'day', 'tzuserrel'))); } $this->info_box_contents[$line][] = array( @@ -186,7 +186,7 @@ class box_factures extends ModeleBoxes $this->info_box_contents[$line][] = array( 'td' => 'class="right"', - 'text' => dol_print_date($date, 'day'), + 'text' => dol_print_date($date, 'day', 'tzuserrel'), ); $this->info_box_contents[$line][] = array( diff --git a/htdocs/core/boxes/box_factures_fourn.php b/htdocs/core/boxes/box_factures_fourn.php index a2ce199faee..a5d63c7b9c3 100644 --- a/htdocs/core/boxes/box_factures_fourn.php +++ b/htdocs/core/boxes/box_factures_fourn.php @@ -159,7 +159,7 @@ class box_factures_fourn extends ModeleBoxes $late = ''; if ($facturestatic->hasDelay()) { - $late = img_warning(sprintf($l_due_date, dol_print_date($datelimite, 'day'))); + $late = img_warning(sprintf($l_due_date, dol_print_date($datelimite, 'day', 'tzuserrel'))); } $this->info_box_contents[$line][] = array( @@ -189,7 +189,7 @@ class box_factures_fourn extends ModeleBoxes $this->info_box_contents[$line][] = array( 'td' => 'class="right"', - 'text' => dol_print_date($date, 'day'), + 'text' => dol_print_date($date, 'day', 'tzuserrel'), ); $this->info_box_contents[$line][] = array( diff --git a/htdocs/core/boxes/box_factures_fourn_imp.php b/htdocs/core/boxes/box_factures_fourn_imp.php index aea07802fdf..9c35055011d 100644 --- a/htdocs/core/boxes/box_factures_fourn_imp.php +++ b/htdocs/core/boxes/box_factures_fourn_imp.php @@ -150,7 +150,7 @@ class box_factures_fourn_imp extends ModeleBoxes $late = ''; if ($facturestatic->hasDelay()) { - $late = img_warning(sprintf($l_due_date, dol_print_date($datelimite, 'day'))); + $late = img_warning(sprintf($l_due_date, dol_print_date($datelimite, 'day', 'tzuserrel'))); } $tooltip = $langs->trans('SupplierInvoice').': '.($objp->ref ? $objp->ref : $objp->facid).'
    '.$langs->trans('RefSupplier').': '.$objp->ref_supplier; @@ -175,7 +175,7 @@ class box_factures_fourn_imp extends ModeleBoxes $this->info_box_contents[$line][] = array( 'td' => 'class="right"', - 'text' => dol_print_date($datelimite, 'day'), + 'text' => dol_print_date($datelimite, 'day', 'tzuserrel'), ); $this->info_box_contents[$line][] = array( diff --git a/htdocs/core/boxes/box_factures_imp.php b/htdocs/core/boxes/box_factures_imp.php index 1830dcd5c7a..391fc2e7cd0 100644 --- a/htdocs/core/boxes/box_factures_imp.php +++ b/htdocs/core/boxes/box_factures_imp.php @@ -165,7 +165,7 @@ class box_factures_imp extends ModeleBoxes $late = ''; if ($facturestatic->hasDelay()) { - $late = img_warning(sprintf($l_due_date, dol_print_date($datelimite, 'day'))); + $late = img_warning(sprintf($l_due_date, dol_print_date($datelimite, 'day', 'tzuserrel'))); } $this->info_box_contents[$line][] = array( @@ -188,7 +188,7 @@ class box_factures_imp extends ModeleBoxes $this->info_box_contents[$line][] = array( 'td' => 'class="right"', - 'text' => dol_print_date($datelimite, 'day'), + 'text' => dol_print_date($datelimite, 'day', 'tzuserrel'), ); $this->info_box_contents[$line][] = array( diff --git a/htdocs/core/boxes/box_ficheinter.php b/htdocs/core/boxes/box_ficheinter.php index 94d081483e2..edf4daa5191 100644 --- a/htdocs/core/boxes/box_ficheinter.php +++ b/htdocs/core/boxes/box_ficheinter.php @@ -145,7 +145,7 @@ class box_ficheinter extends ModeleBoxes $this->info_box_contents[$i][] = array( 'td' => 'class="right"', - 'text' => dol_print_date($datec, 'day'), + 'text' => dol_print_date($datec, 'day', 'tzuserrel'), ); $this->info_box_contents[$i][] = array( diff --git a/htdocs/core/boxes/box_fournisseurs.php b/htdocs/core/boxes/box_fournisseurs.php index d8b7f30c103..b0d5a0774fc 100644 --- a/htdocs/core/boxes/box_fournisseurs.php +++ b/htdocs/core/boxes/box_fournisseurs.php @@ -128,8 +128,8 @@ class box_fournisseurs extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => 'class="right"', - 'text' => dol_print_date($datem, "day"), + 'td' => 'class="center nowraponall"', + 'text' => dol_print_date($datem, "day", 'tzuserrel'), ); $this->info_box_contents[$line][] = array( diff --git a/htdocs/core/boxes/box_goodcustomers.php b/htdocs/core/boxes/box_goodcustomers.php index 3a4f7e63103..aef7cdc9f3d 100644 --- a/htdocs/core/boxes/box_goodcustomers.php +++ b/htdocs/core/boxes/box_goodcustomers.php @@ -126,8 +126,8 @@ class box_goodcustomers extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => 'class="right"', - 'text' => dol_print_date($datem, "day") + 'td' => 'class="center nowraponall"', + 'text' => dol_print_date($datem, "day", 'tzuserrel') ); $this->info_box_contents[$line][] = array( diff --git a/htdocs/core/boxes/box_last_modified_ticket.php b/htdocs/core/boxes/box_last_modified_ticket.php index 320a23f745b..4d5097e23ba 100644 --- a/htdocs/core/boxes/box_last_modified_ticket.php +++ b/htdocs/core/boxes/box_last_modified_ticket.php @@ -162,7 +162,7 @@ class box_last_modified_ticket extends ModeleBoxes // Date creation $this->info_box_contents[$i][$r] = array( 'td' => 'class="right"', - 'text' => dol_print_date($datec, 'dayhour') + 'text' => dol_print_date($datec, 'dayhour', 'tzuserrel') ); $r++; diff --git a/htdocs/core/boxes/box_last_ticket.php b/htdocs/core/boxes/box_last_ticket.php index 8a0e3822448..e08a54f1c87 100644 --- a/htdocs/core/boxes/box_last_ticket.php +++ b/htdocs/core/boxes/box_last_ticket.php @@ -166,7 +166,7 @@ class box_last_ticket extends ModeleBoxes // Date creation $this->info_box_contents[$i][$r] = array( 'td' => 'class="right"', - 'text' => dol_print_date($datec, 'dayhour'), + 'text' => dol_print_date($datec, 'dayhour', 'tzuserrel'), ); $r++; diff --git a/htdocs/core/boxes/box_lastlogin.php b/htdocs/core/boxes/box_lastlogin.php index a487ec5bc72..e5e11d9ba8f 100644 --- a/htdocs/core/boxes/box_lastlogin.php +++ b/htdocs/core/boxes/box_lastlogin.php @@ -93,7 +93,7 @@ class box_lastlogin extends ModeleBoxes 'text' => $langs->trans("PreviousConnexion"), ); if ($user->datepreviouslogin) { - $tmp = dol_print_date($user->datepreviouslogin, "dayhour", 'tzuser'); + $tmp = dol_print_date($user->datepreviouslogin, "dayhour", 'tzuserrel'); } else { $tmp = $langs->trans("Unknown"); } diff --git a/htdocs/core/boxes/box_members.php b/htdocs/core/boxes/box_members.php index acd3773d2f0..5865cba2530 100644 --- a/htdocs/core/boxes/box_members.php +++ b/htdocs/core/boxes/box_members.php @@ -145,8 +145,8 @@ class box_members extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => 'class="right"', - 'text' => dol_print_date($datem, "day"), + 'td' => 'class="center nowraponall"', + 'text' => dol_print_date($datem, "day", 'tzuserrel'), ); $this->info_box_contents[$line][] = array( diff --git a/htdocs/core/boxes/box_members_last_modified.php b/htdocs/core/boxes/box_members_last_modified.php index 1315ac9895b..9de6a3af12f 100644 --- a/htdocs/core/boxes/box_members_last_modified.php +++ b/htdocs/core/boxes/box_members_last_modified.php @@ -147,8 +147,8 @@ class box_members_last_modified extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => 'class="right"', - 'text' => dol_print_date($datem, "day"), + 'td' => 'class="center nowraponall"', + 'text' => dol_print_date($datem, "day", 'tzuserrel'), ); $this->info_box_contents[$line][] = array( diff --git a/htdocs/core/boxes/box_members_last_subscriptions.php b/htdocs/core/boxes/box_members_last_subscriptions.php index e08bc1073b6..3cea44c2dc3 100644 --- a/htdocs/core/boxes/box_members_last_subscriptions.php +++ b/htdocs/core/boxes/box_members_last_subscriptions.php @@ -158,7 +158,7 @@ class box_members_last_subscriptions extends ModeleBoxes $this->info_box_contents[$line][] = array( 'td' => 'class="right tdoverflowmax150 maxwidth150onsmartphone"', - 'text' => dol_print_date($this->db->jdate($obj->datem ? $obj->datem : $obj->datec), 'dayhour'), + 'text' => dol_print_date($this->db->jdate($obj->datem ? $obj->datem : $obj->datec), 'dayhour', 'tzuserrel'), ); $line++; diff --git a/htdocs/core/boxes/box_members_subscriptions_by_year.php b/htdocs/core/boxes/box_members_subscriptions_by_year.php index b6c146312bc..be835511c6b 100644 --- a/htdocs/core/boxes/box_members_subscriptions_by_year.php +++ b/htdocs/core/boxes/box_members_subscriptions_by_year.php @@ -111,7 +111,7 @@ class box_members_subscriptions_by_year extends ModeleBoxes $i = 0; while ($i < $num) { $objp = $this->db->fetch_object($result); - $year = dol_print_date($this->db->jdate($objp->dateh), "%Y"); + $year = dol_print_date($this->db->jdate($objp->dateh), "%Y", 'gmt'); $Total[$year] = (isset($Total[$year]) ? $Total[$year] : 0) + $objp->subscription; $Number[$year] = (isset($Number[$year]) ? $Number[$year] : 0) + 1; $tot += $objp->subscription; diff --git a/htdocs/core/boxes/box_mos.php b/htdocs/core/boxes/box_mos.php index b12506147bf..43d1cd411e4 100644 --- a/htdocs/core/boxes/box_mos.php +++ b/htdocs/core/boxes/box_mos.php @@ -138,8 +138,8 @@ class box_mos extends ModeleBoxes } $this->info_box_contents[$line][] = array( - 'td' => 'class="right"', - 'text' => dol_print_date($datem, 'day'), + 'td' => 'class="center nowraponall"', + 'text' => dol_print_date($datem, 'day', 'tzuserrel'), ); $this->info_box_contents[$line][] = array( diff --git a/htdocs/core/boxes/box_produits.php b/htdocs/core/boxes/box_produits.php index 44333683000..dde3b685d25 100644 --- a/htdocs/core/boxes/box_produits.php +++ b/htdocs/core/boxes/box_produits.php @@ -190,8 +190,8 @@ class box_produits extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => 'class="right"', - 'text' => dol_print_date($datem, 'day'), + 'td' => 'class="center nowraponall"', + 'text' => dol_print_date($datem, 'day', 'tzuserrel'), ); $this->info_box_contents[$line][] = array( diff --git a/htdocs/core/boxes/box_propales.php b/htdocs/core/boxes/box_propales.php index d876dad67d0..9c6376351e7 100644 --- a/htdocs/core/boxes/box_propales.php +++ b/htdocs/core/boxes/box_propales.php @@ -165,8 +165,8 @@ class box_propales extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => 'class="right"', - 'text' => dol_print_date($date, 'day'), + 'td' => 'class="center nowraponall"', + 'text' => dol_print_date($date, 'day', 'tzuserrel'), ); $this->info_box_contents[$line][] = array( diff --git a/htdocs/core/boxes/box_prospect.php b/htdocs/core/boxes/box_prospect.php index ea550b9d856..a8959202082 100644 --- a/htdocs/core/boxes/box_prospect.php +++ b/htdocs/core/boxes/box_prospect.php @@ -135,8 +135,8 @@ class box_prospect extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => 'class="right"', - 'text' => dol_print_date($datem, "day"), + 'td' => 'class="center nowraponall"', + 'text' => dol_print_date($datem, "day", 'tzuserrel'), ); $this->info_box_contents[$line][] = array( diff --git a/htdocs/core/boxes/box_scheduled_jobs.php b/htdocs/core/boxes/box_scheduled_jobs.php index 04ba2944c75..793b0cc8c79 100644 --- a/htdocs/core/boxes/box_scheduled_jobs.php +++ b/htdocs/core/boxes/box_scheduled_jobs.php @@ -156,7 +156,7 @@ class box_scheduled_jobs extends ModeleBoxes ); $this->info_box_contents[$line][] = array( 'td' => 'class="right"', - 'textnoformat' => (empty($resultarray[$line][2]) ? '' : $form->textwithpicto(dol_print_date($resultarray[$line][2], "dayhoursec"), $langs->trans("CurrentTimeZone"))) + 'textnoformat' => (empty($resultarray[$line][2]) ? '' : $form->textwithpicto(dol_print_date($resultarray[$line][2], "dayhoursec", 'tzserver'), $langs->trans("CurrentTimeZone"))) ); $this->info_box_contents[$line][] = array( 'td' => 'class="center" ', diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php index b6eb51826cc..98e2b82bb37 100644 --- a/htdocs/core/boxes/box_services_contracts.php +++ b/htdocs/core/boxes/box_services_contracts.php @@ -200,8 +200,8 @@ class box_services_contracts extends ModeleBoxes ); $this->info_box_contents[$i][] = array( - 'td' => '', - 'text' => dol_print_date($datem, 'day'), + 'td' => 'class="center nowraponall"', + 'text' => dol_print_date($datem, 'day', 'tzuserrel'), 'text2'=> $late, ); diff --git a/htdocs/core/boxes/box_services_expired.php b/htdocs/core/boxes/box_services_expired.php index 724eb9baebf..75cc1cde413 100644 --- a/htdocs/core/boxes/box_services_expired.php +++ b/htdocs/core/boxes/box_services_expired.php @@ -152,7 +152,7 @@ class box_services_expired extends ModeleBoxes $this->info_box_contents[$i][] = array( 'td' => 'class="center nowraponall"', - 'text' => dol_print_date($dateline, 'day'), + 'text' => dol_print_date($dateline, 'day', 'tzuserrel'), 'text2'=> $late, ); diff --git a/htdocs/core/boxes/box_supplier_orders.php b/htdocs/core/boxes/box_supplier_orders.php index 235e7a8e72a..0c2b97ce6b5 100644 --- a/htdocs/core/boxes/box_supplier_orders.php +++ b/htdocs/core/boxes/box_supplier_orders.php @@ -153,7 +153,7 @@ class box_supplier_orders extends ModeleBoxes $this->info_box_contents[$line][] = array( 'td' => 'class="right"', - 'text' => dol_print_date($date, 'day'), + 'text' => dol_print_date($date, 'day', 'tzuserrel'), ); $this->info_box_contents[$line][] = array( diff --git a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php index 1a8cec07155..04dabbd0ff3 100644 --- a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php +++ b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php @@ -161,7 +161,7 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes $this->info_box_contents[$line][] = array( 'td' => 'class="right"', - 'text' => $delayIcon.' '.dol_print_date($delivery_date, 'day').'', + 'text' => $delayIcon.' '.dol_print_date($delivery_date, 'day', 'tzuserrel').'', 'asis' => 1 ); From fedf7645b1184d4748218e1e805f62052b201c49 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 May 2021 12:02:33 +0200 Subject: [PATCH 0217/1497] Fix regression, can't reset parent company. --- htdocs/societe/card.php | 2 +- htdocs/societe/class/societe.class.php | 43 ++++++++++++++------------ 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 3d03a97a59f..1165d6a9fd7 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -852,7 +852,7 @@ if (empty($reshook)) { // Set parent company if ($action == 'set_thirdparty' && $user->rights->societe->creer) { $object->fetch($socid); - $result = $object->set_parent(GETPOST('parent_id', 'int')); + $result = $object->setParent(GETPOST('parent_id', 'int')); } // Set sales representatives diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 8a8dea9f7e3..e2eba54b489 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3321,34 +3321,37 @@ class Societe extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Define parent commany of current company * * @param int $id Id of thirdparty to set or '' to remove * @return int <0 if KO, >0 if OK */ - public function set_parent($id) + public function setParent($id) { - // phpcs:enable if ($this->id) { // Check if the id we want to add as parent has not already one parent that is the current id we try to update - $sameparent = $this->validateFamilyTree($id, $this->id, 0); - if ($sameparent < 0) { - return -1; - } elseif ($sameparent == 1) { - setEventMessages('ParentCompanyToAddIsAlreadyAChildOfModifiedCompany', null, 'warnings'); - return -1; - } else { - $sql = 'UPDATE '.MAIN_DB_PREFIX.'societe SET parent = '.($id > 0 ? $id : 'null').' WHERE rowid = '.((int) $this->id); - dol_syslog(get_class($this).'::set_parent', LOG_DEBUG); - $resql = $this->db->query($sql); - if ($resql) { - $this->parent = $id; - return 1; - } else { + if ($id > 0) { + $sameparent = $this->validateFamilyTree($id, $this->id, 0); + if ($sameparent < 0) { return -1; } + if ($sameparent == 1) { + setEventMessages('ParentCompanyToAddIsAlreadyAChildOfModifiedCompany', null, 'warnings'); + return -1; + } + } + + dol_syslog(get_class($this).'::setParent', LOG_DEBUG); + + $sql = 'UPDATE '.MAIN_DB_PREFIX.'societe SET parent = '.($id > 0 ? $id : 'null').' WHERE rowid = '.((int) $this->id); + + $resql = $this->db->query($sql); + if ($resql) { + $this->parent = $id; + return 1; + } else { + return -1; } } else { return -1; @@ -3369,9 +3372,9 @@ class Societe extends CommonObject dol_syslog("Too high level of parent - child for company. May be an infinite loop ?", LOG_WARNING); } - $sql = 'SELECT s.parent'; - $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s'; - $sql .= ' WHERE rowid = '.$idparent; + $sql = 'SELECT s.parent'; + $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s'; + $sql .= ' WHERE rowid = '.$idparent; $resql = $this->db->query($sql); if ($resql) { $obj = $this->db->fetch_object($resql); From 857be16e1294c3ed2e7f5e624bcc838969dff565 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 May 2021 12:03:38 +0200 Subject: [PATCH 0218/1497] Log --- htdocs/societe/class/societe.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index e2eba54b489..7554ad2fbe2 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3329,6 +3329,8 @@ class Societe extends CommonObject */ public function setParent($id) { + dol_syslog(get_class($this).'::setParent', LOG_DEBUG); + if ($this->id) { // Check if the id we want to add as parent has not already one parent that is the current id we try to update if ($id > 0) { @@ -3342,8 +3344,6 @@ class Societe extends CommonObject } } - dol_syslog(get_class($this).'::setParent', LOG_DEBUG); - $sql = 'UPDATE '.MAIN_DB_PREFIX.'societe SET parent = '.($id > 0 ? $id : 'null').' WHERE rowid = '.((int) $this->id); $resql = $this->db->query($sql); From fb6aea72b837ec464c059b9fbdafc4d799496e8d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 May 2021 12:06:29 +0200 Subject: [PATCH 0219/1497] Fix syntax error --- htdocs/fourn/class/fournisseur.facture.class.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 8586e0fc623..637f29e87b8 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1361,7 +1361,7 @@ class FactureFournisseur extends CommonInvoice } $sql .= ', fk_user_closing = '.$user->id; $sql .= ", date_closing = '".$this->db->idate($now)."'"; - $sql .= ' WHERE rowid = '.$this->id; + $sql .= ' WHERE rowid = '.((int) $this->id); $resql = $this->db->query($sql); if ($resql) { @@ -1417,18 +1417,17 @@ class FactureFournisseur extends CommonInvoice */ public function setUnpaid($user) { - global $conf, $langs; $error = 0; $this->db->begin(); $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture_fourn'; - $sql .= ' SET paye=0, fk_statut='.self::STATUS_VALIDATED.', close_code=null, close_note=null'; + $sql .= ' SET paye=0, fk_statut='.self::STATUS_VALIDATED.', close_code=null, close_note=null,'; $sql .= ' date_closing=null,'; $sql .= ' fk_user_closing=null'; - $sql .= ' WHERE rowid = '.$this->id; + $sql .= ' WHERE rowid = '.((int) $this->id); - dol_syslog("FactureFournisseur::set_unpaid", LOG_DEBUG); + dol_syslog(get_class($this)."::set_unpaid", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { // Call trigger From 71b35ef0e5be758b3faddfa7650916adc73d1536 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 May 2021 12:11:06 +0200 Subject: [PATCH 0220/1497] Fix regression - can't reset parent company --- htdocs/societe/class/societe.class.php | 33 +++++++++++++++----------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 591809389d4..47105bf9068 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3111,24 +3111,29 @@ class Societe extends CommonObject public function set_parent($id) { // phpcs:enable + dol_syslog(get_class($this).'::set_parent', LOG_DEBUG); + if ($this->id) { // Check if the id we want to add as parent has not already one parent that is the current id we try to update - $sameparent = $this->validateFamilyTree($id, $this->id, 0); - if ($sameparent < 0) { - return -1; - } elseif ($sameparent == 1) { - setEventMessages('ParentCompanyToAddIsAlreadyAChildOfModifiedCompany', null, 'warnings'); - return -1; - } else { - $sql = 'UPDATE '.MAIN_DB_PREFIX.'societe SET parent = '.($id > 0 ? $id : 'null').' WHERE rowid = '.((int) $this->id); - dol_syslog(get_class($this).'::set_parent', LOG_DEBUG); - $resql = $this->db->query($sql); - if ($resql) { - $this->parent = $id; - return 1; - } else { + if ($id > 0) { + $sameparent = $this->validateFamilyTree($id, $this->id, 0); + if ($sameparent < 0) { return -1; } + if ($sameparent == 1) { + setEventMessages('ParentCompanyToAddIsAlreadyAChildOfModifiedCompany', null, 'warnings'); + return -1; + } + } + + $sql = 'UPDATE '.MAIN_DB_PREFIX.'societe SET parent = '.($id > 0 ? $id : 'null').' WHERE rowid = '.((int) $this->id); + + $resql = $this->db->query($sql); + if ($resql) { + $this->parent = $id; + return 1; + } else { + return -1; } } else { return -1; From a840afa72a33e80cb1b83802905c17fdfe6668e0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 May 2021 15:24:28 +0200 Subject: [PATCH 0221/1497] Fix missing entry into table --- htdocs/install/mysql/data/llx_accounting_abc.sql | 6 +++--- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/htdocs/install/mysql/data/llx_accounting_abc.sql b/htdocs/install/mysql/data/llx_accounting_abc.sql index 3c178f7c70d..806d084ce85 100644 --- a/htdocs/install/mysql/data/llx_accounting_abc.sql +++ b/htdocs/install/mysql/data/llx_accounting_abc.sql @@ -174,10 +174,10 @@ INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUE INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 15,'SYSCOHADA-TG', 'Plan comptable Ouest-Africain', 1); -- Description of chart of account USA US-BASE -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 11, 'US-BASE', 'USA basic chart of accounts', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 11, 'US-BASE', 'USA basic chart of accounts', 1); -- Description of chart of account Canada CA-ENG-BASE -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 14, 'CA-ENG-BASE', 'Canadian basic chart of accounts - English', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 14, 'CA-ENG-BASE', 'Canadian basic chart of accounts - English', 1); -- Description of chart of account Mexico SAT/24-2019 -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 154, 'SAT/24-2019', 'Catalogo y codigo agrupador fiscal del 2019', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 154, 'SAT/24-2019', 'Catalogo y codigo agrupador fiscal del 2019', 1); diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index b95ea30f8fb..c9736e429c4 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -62,6 +62,11 @@ UPDATE llx_c_country SET eec = 1 WHERE code IN ('AT','BE','BG','CY','CZ','DE','D ALTER TABLE llx_export_model MODIFY COLUMN type varchar(64); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 11, 'US-BASE', 'USA basic chart of accounts', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 14, 'CA-ENG-BASE', 'Canadian basic chart of accounts - English', 1); +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 154, 'SAT/24-2019', 'Catalogo y codigo agrupador fiscal del 2019', 1); + + -- For v14 ALTER TABLE llx_product_lot ADD COLUMN eol_date datetime NULL; From d18fc6ca3c9e859be79f7d99bb6522fc37e35d46 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 May 2021 15:38:12 +0200 Subject: [PATCH 0222/1497] Fix init --- htdocs/accountancy/admin/accountmodel.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index f0fd9702009..0f4d538cfac 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -609,10 +609,12 @@ if ($id) { print '
    '.$langs->trans("ActionDoneBy").''; if ($object->userdoneid > 0) { $tmpuser = new User($db); @@ -2080,10 +2080,10 @@ if ($id > 0) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; // Reminders - if ($conf->global->AGENDA_REMINDER_EMAIL || $conf->global->AGENDA_REMINDER_BROWSER) { - $filtreuserid = $user->id; + if (!empty($conf->global->AGENDA_REMINDER_EMAIL) || !empty($conf->global->AGENDA_REMINDER_BROWSER)) { + $filteruserid = $user->id; if ($user->rights->agenda->allactions->read) { - $filtreuserid = 0; + $filteruserid = 0; } $object->loadReminders('', $filteruserid, false); From 8576cf1b725c1597008048c4510185de22fe0d4a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 May 2021 22:51:37 +0200 Subject: [PATCH 0236/1497] Fix combo when we must no hide value with key -1 --- htdocs/adherents/list.php | 6 +++--- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/lib/ajax.lib.php | 7 ++++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 1ec9d498b9d..b6fe79b8d68 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -708,7 +708,7 @@ if (!empty($arrayfields['d.morphy']['checked'])) { if (!empty($arrayfields['t.libelle']['checked'])) { print ''; $listetype = $membertypestatic->liste_array(); - print $form->selectarray("search_type", $listetype, $type, 1, 0, 0, '', 0, 32); + print $form->selectarray("search_type", $listetype, $search_type, 1, 0, 0, '', 0, 32); print ''.$actionstatic->LibStatut($obj->percent, 5, 0, $datep).'
    ' . $langs->trans("ShowAllBatchByDefault") . '
    '; diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 632cfc0311f..8766d68c25b 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -533,6 +533,10 @@ class Conf } } + if (!isset($this->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT)) { + $this->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT = 1; + } + // conf->currency if (empty($this->global->MAIN_MONNAIE)) { $this->global->MAIN_MONNAIE = 'EUR'; diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang index f47354958eb..2414a92cefb 100644 --- a/htdocs/langs/en_US/mrp.lang +++ b/htdocs/langs/en_US/mrp.lang @@ -70,7 +70,7 @@ ProductionForRef=Production of %s AutoCloseMO=Close automatically the Manufacturing Order if quantities to consume and to produce are reached NoStockChangeOnServices=No stock change on services ProductQtyToConsumeByMO=Product quantity still to consume by open MO -ProductQtyToProduceByMO=Product quentity still to produce by open MO +ProductQtyToProduceByMO=Product quantity still to produce by open MO AddNewConsumeLines=Add new line to consume ProductsToConsume=Products to consume ProductsToProduce=Products to produce diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 9b8af58e347..07ee7a66584 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -531,43 +531,44 @@ if ($id > 0 || $ref) { llxHeader('', $title, $helpurl); + if (! empty($conf->use_javascript_ajax)) { ?> - - 0) { $head = product_prepare_head($object); @@ -908,18 +909,18 @@ if (!$variants) { if ((!empty($conf->productbatch->enabled)) && $object->hasbatch()) { $colspan = 3; print '
    '; - print ''.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").'
    '; - print ''.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").' '; - print $form->textwithpicto('', $langs->trans('CollapseBatchDetailHelp'), 1, 'help', ''); + print ''.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").'   '; + print ''.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").''; + //print ' '.$form->textwithpicto('', $langs->trans('CollapseBatchDetailHelp'), 1, 'help', ''); print '
    '.$langs->trans("batch_number").''.$langs->trans("EatByDate").''.$langs->trans("EatByDate").''.$langs->trans("SellByDate").''.$langs->trans("SellByDate").'
    '; + print $entrepotstatic->getNomUrl(1); if (!empty($conf->productbatch->enabled)) { - print '' . (empty($conf->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT) ? '(+)' : '(-)') . ' '; + print ''; + print (empty($conf->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT) ? '(+)' : '(-)'); + print ''; } - print $entrepotstatic->getNomUrl(1).''.$stock_real.($stock_real < 0 ? ' '.img_warning() : '').''.(price2num($object->pmp) ? price2num($object->pmp, 'MU') : '').'
    '; print $entrepotstatic->getNomUrl(1); - if (!empty($conf->productbatch->enabled)) { + if (!empty($conf->productbatch->enabled) && $object->hasbatch()) { print ''; print (empty($conf->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT) ? '(+)' : '(-)'); print ''; From 429ebe6662b3e5256c54ffef6e080ee7a02d8214 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 25 May 2021 23:49:49 +0200 Subject: [PATCH 0244/1497] Update api_stockmovements.class.php --- htdocs/product/stock/class/api_stockmovements.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/class/api_stockmovements.class.php b/htdocs/product/stock/class/api_stockmovements.class.php index 9b022a840fc..42a03a1836a 100644 --- a/htdocs/product/stock/class/api_stockmovements.class.php +++ b/htdocs/product/stock/class/api_stockmovements.class.php @@ -95,7 +95,7 @@ class StockMovements extends DolibarrApi */ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '') { - global $db, $conf; + global $conf; $obj_ret = array(); @@ -176,7 +176,7 @@ class StockMovements extends DolibarrApi } if ($qty == 0) { - throw new RestException(503, "Making a stock movement with a quentity of 0 is not possible"); + throw new RestException(503, "Making a stock movement with a quantity of 0 is not possible"); } // Type increase or decrease From 156279d6a196aedba8592ea6b05a76e3e6b2227b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 May 2021 00:34:52 +0200 Subject: [PATCH 0245/1497] Fix nojs --- htdocs/product/stock/product.php | 78 ++++++++++++++++---------------- 1 file changed, 40 insertions(+), 38 deletions(-) diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 9ef7b011d12..5908785e1cb 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -531,43 +531,43 @@ if ($id > 0 || $ref) { llxHeader('', $title, $helpurl); - if (! empty($conf->use_javascript_ajax)) { - ?> - - + 0) { @@ -909,9 +909,11 @@ if (!$variants) { if ((!empty($conf->productbatch->enabled)) && $object->hasbatch()) { $colspan = 3; print '
    '; - print ''.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").'   '; - print ''.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").''; - //print ' '.$form->textwithpicto('', $langs->trans('CollapseBatchDetailHelp'), 1, 'help', ''); + if (!empty($conf->use_javascript_ajax)) { + print ''.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").'   '; + print ''.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").''; + //print ' '.$form->textwithpicto('', $langs->trans('CollapseBatchDetailHelp'), 1, 'help', ''); + } print ''.$langs->trans("batch_number").'
    '; print $entrepotstatic->getNomUrl(1); - if (!empty($conf->productbatch->enabled) && $object->hasbatch()) { + if (!empty($conf->use_javascript_ajax) && !empty($conf->productbatch->enabled) && $object->hasbatch()) { print ''; print (empty($conf->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT) ? '(+)' : '(-)'); print ''; From eec254f066a7f985588b49559b88ed2d86178d1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 26 May 2021 08:42:35 +0200 Subject: [PATCH 0246/1497] fix warning --- htdocs/adherents/card.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 49a3cc74182..5182a6ff778 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -6,7 +6,7 @@ * Copyright (C) 2012 Marcos García * Copyright (C) 2012-2020 Philippe Grand * Copyright (C) 2015-2018 Alexandre Spangaro - * Copyright (C) 2018-2020 Frédéric France + * Copyright (C) 2018-2021 Frédéric France * Copyright (C) 2021 Waël Almoman * * This program is free software; you can redistribute it and/or modify @@ -1088,7 +1088,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if (!$value['active']) { break; } - print '
    '.$langs->trans($value['label']).'
    '.$langs->trans($value['label']).'
    '.$form->editfieldkey($langs->trans('No_Email') .' ('.$langs->trans('Contact').')', 'contact_no_email', '', $object, 0).'browser->layout == 'phone') || empty($conf->mailing->enabled) ? ' colspan="3"' : '').'>'.$form->selectyesno('contact_no_email', (GETPOSTISSET("contact_no_email") ?GETPOST("contact_no_email", 'alpha') : $object->no_email), 1, false, 1).'browser->layout == 'phone') || empty($conf->mailing->enabled) ? ' colspan="3"' : '').'>'.$form->selectyesno('contact_no_email', (GETPOSTISSET("contact_no_email") ? GETPOST("contact_no_email", 'alpha') : (empty($object->no_email) ? 0 : 1)), 1, false, 1).'
    '.$form->editfieldkey('Web', 'url', '', $object, 0).''; + print ''; print ''; print ''; + print ''; print ''; print '
    '; + print ''; print ''; print ''; + print ''; print ''; print '

    "; @@ -1133,11 +1158,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Other attributes $parameters = array('colspan' => ' colspan="3"', 'cols'=> '3'); - $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit', $parameters); - } + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php'; $object->load_ref_elements(); From 371f2e4f378d102395037580bef9b197486e8e9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 26 May 2021 18:24:06 +0200 Subject: [PATCH 0264/1497] fix warnings --- htdocs/adherents/list.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index dde013e60c4..986abc83b7b 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -5,6 +5,7 @@ * Copyright (C) 2013-2015 Raphaël Doursenaud * Copyright (C) 2014-2016 Juanjo Menent * Copyright (C) 2018 Alexandre Spangaro + * Copyright (C) 2021 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -325,7 +326,7 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // N $sql .= preg_replace('/^,/', '', $hookmanager->resPrint); $sql = preg_replace('/,\s*$/', '', $sql); $sql .= " FROM ".MAIN_DB_PREFIX."adherent as d"; -if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { +if (!empty($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (d.rowid = ef.fk_object)"; } if (!empty($search_categ) || !empty($catid)) { @@ -1097,7 +1098,7 @@ while ($i < min($num, $limit)) { print ''; print dol_print_date($datefin, 'day'); if ($memberstatic->hasDelay()) { - $textlate .= ' ('.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($conf->adherent->subscription->warning_delay / 60 / 60 / 24) >= 0 ? '+' : '').ceil($conf->adherent->subscription->warning_delay / 60 / 60 / 24).' '.$langs->trans("days").')'; + $textlate = ' ('.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($conf->adherent->subscription->warning_delay / 60 / 60 / 24) >= 0 ? '+' : '').ceil($conf->adherent->subscription->warning_delay / 60 / 60 / 24).' '.$langs->trans("days").')'; print " ".img_warning($langs->trans("SubscriptionLate").$textlate); } print ''; From 60250443a1c91cbe17d62215a9440ebde030225b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 26 May 2021 18:55:48 +0200 Subject: [PATCH 0265/1497] fix warning --- htdocs/adherents/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 5182a6ff778..d20318090e0 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1908,7 +1908,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Reactivate - if (Adherent::STATUS_RESILIATED == $object->statut || Adherent::STATUS_EXCLUDED == $Object->statut) { + if (Adherent::STATUS_RESILIATED == $object->statut || Adherent::STATUS_EXCLUDED == $object->statut) { if ($user->rights->adherent->creer) { print ''.$langs->trans("Reenable")."\n"; } else { From 9b51699228ef234b547eb94f9f6dab4d31b517cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 26 May 2021 19:55:47 +0200 Subject: [PATCH 0266/1497] fix warnings --- htdocs/societe/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 0a3e9207a96..3999158acaa 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -11,7 +11,7 @@ * Copyright (C) 2017 Juanjo Menent * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2020 Open-Dsi - + * Copyright (C) 2021 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -221,7 +221,7 @@ $checkedprofid6 = 0; $checkprospectlevel = (in_array($contextpage, array('prospectlist')) ? 1 : 0); $checkstcomm = (in_array($contextpage, array('prospectlist')) ? 1 : 0); $arrayfields = array( - 's.rowid'=>array('label'=>"TechnicalID", 'position'=>1, 'checked'=>($conf->global->MAIN_SHOW_TECHNICAL_ID ? 1 : 0), 'enabled'=>($conf->global->MAIN_SHOW_TECHNICAL_ID ? 1 : 0)), + 's.rowid'=>array('label'=>"TechnicalID", 'position'=>1, 'checked'=>(!empty($conf->global->MAIN_SHOW_TECHNICAL_ID)), 'enabled'=>(!empty($conf->global->MAIN_SHOW_TECHNICAL_ID))), 's.nom'=>array('label'=>"ThirdPartyName", 'position'=>2, 'checked'=>1), 's.name_alias'=>array('label'=>"AliasNameShort", 'position'=>3, 'checked'=>1), 's.barcode'=>array('label'=>"Gencod", 'position'=>5, 'checked'=>1, 'enabled'=>(!empty($conf->barcode->enabled))), From 879a401724798510c93b3a1d8c0db90f532fa541 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 26 May 2021 20:00:23 +0200 Subject: [PATCH 0267/1497] fix warnings --- htdocs/societe/list.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 0a3e9207a96..1a6c0ea6baf 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -942,7 +942,7 @@ if (empty($type) || $type == 'c' || $type == 'p') { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
    '; $tmptitle = $langs->trans('Categories'); - $moreforfilter .= img_picto($tmptile, 'category', 'class="pictofixedwidth"'); + $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"'); $moreforfilter .= $formother->select_categories('customer', $search_categ_cus, 'search_categ_cus', 1, $langs->trans('CustomersProspectsCategoriesShort')); $moreforfilter .= '
    '; } @@ -953,7 +953,7 @@ if (empty($type) || $type == 'f') { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
    '; $tmptitle = $langs->trans('Categories'); - $moreforfilter .= img_picto($tmptilte, 'category', 'class="pictofixedwidth"'); + $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"'); $moreforfilter .= $formother->select_categories('supplier', $search_categ_sup, 'search_categ_sup', 1, $langs->trans('SuppliersCategoriesShort')); $moreforfilter .= '
    '; } @@ -962,8 +962,8 @@ if (empty($type) || $type == 'f') { // If the user can view prospects other than his' if ($user->rights->societe->client->voir || $socid) { $moreforfilter .= '
    '; - $tmptile = $langs->trans('SalesRepresentatives'); - $moreforfilter .= img_picto($tmptile, 'user', 'class="pictofixedwidth"'); + $tmptitle = $langs->trans('SalesRepresentatives'); + $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"'); $moreforfilter .= $formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, $langs->trans('SalesRepresentatives'), ($conf->dol_optimize_smallscreen ? 'maxwidth200' : 'maxwidth300'), 1); $moreforfilter .= '
    '; } From 0d62d3bace46532c60964c0031f6f77f9783c203 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 26 May 2021 23:36:36 +0200 Subject: [PATCH 0268/1497] fix warnings --- htdocs/contrat/list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 19a040bf091..e1166fe385a 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -494,14 +494,14 @@ $moreforfilter = ''; if ($user->rights->societe->client->voir || $socid) { $langs->load("commercial"); $moreforfilter .= '
    '; - $tmpttile = $langs->trans('ThirdPartiesOfSaleRepresentative'); + $tmptitle = $langs->trans('ThirdPartiesOfSaleRepresentative'); $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, $tmpttile, 'maxwidth250'); $moreforfilter .= '
    '; } // If the user can view other users if ($user->rights->user->user->lire) { $moreforfilter .= '
    '; - $tmpttile = $langs->trans('LinkedToSpecificUsers'); + $tmptitle = $langs->trans('LinkedToSpecificUsers'); $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_user, 'search_user', $tmpttile, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth250'); $moreforfilter .= '
    '; } @@ -509,7 +509,7 @@ if ($user->rights->user->user->lire) { if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
    '; - $tmpttile = $langs->trans('IncludingProductWithTag'); + $tmptitle = $langs->trans('IncludingProductWithTag'); $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1); $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmpttile, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1); $moreforfilter .= '
    '; From 223ece5ca5a4e14cc926aae034f6756348ec4033 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 26 May 2021 23:43:14 +0200 Subject: [PATCH 0269/1497] Update list.php --- htdocs/contrat/list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index e1166fe385a..aea778f884c 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -495,14 +495,14 @@ if ($user->rights->societe->client->voir || $socid) { $langs->load("commercial"); $moreforfilter .= '
    '; $tmptitle = $langs->trans('ThirdPartiesOfSaleRepresentative'); - $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, $tmpttile, 'maxwidth250'); + $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, $tmptitle, 'maxwidth250'); $moreforfilter .= '
    '; } // If the user can view other users if ($user->rights->user->user->lire) { $moreforfilter .= '
    '; $tmptitle = $langs->trans('LinkedToSpecificUsers'); - $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_user, 'search_user', $tmpttile, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth250'); + $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_user, 'search_user', $tmptitle, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth250'); $moreforfilter .= '
    '; } // If the user can view categories of products @@ -511,7 +511,7 @@ if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($use $moreforfilter .= '
    '; $tmptitle = $langs->trans('IncludingProductWithTag'); $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1); - $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmpttile, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1); + $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1); $moreforfilter .= '
    '; } From 4237b374dda29e08558cd13692ea3382ceb69393 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 26 May 2021 23:45:45 +0200 Subject: [PATCH 0270/1497] Update list.php --- htdocs/contrat/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index aea778f884c..cf19f1178f6 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -706,6 +706,7 @@ print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $ print "\n"; $totalarray = array(); +$totalarray['nbfield'] = 0; $typenArray = array(); $cacheCountryIDCode = array(); From 3ebe6eb014d440b7602a40252fc2fbb9ffc1caa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 27 May 2021 00:02:01 +0200 Subject: [PATCH 0271/1497] fix bad setup of MAIN_USE_BACKGROUND_ON_PDF --- htdocs/core/lib/pdf.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 1babc31b4c2..281e45baf51 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -623,8 +623,8 @@ function pdf_pagehead(&$pdf, $outputlangs, $page_height) { global $conf; - // Add a background image on document - if (!empty($conf->global->MAIN_USE_BACKGROUND_ON_PDF)) // Warning, this option make TCPDF generation being crazy and some content disappeared behind the image + // Add a background image on document only if good setup of const + if (!empty($conf->global->MAIN_USE_BACKGROUND_ON_PDF) && ($conf->global->MAIN_USE_BACKGROUND_ON_PDF != '-1')) // Warning, this option make TCPDF generation being crazy and some content disappeared behind the image { $pdf->SetAutoPageBreak(0, 0); // Disable auto pagebreak before adding image $pdf->Image($conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_USE_BACKGROUND_ON_PDF, (isset($conf->global->MAIN_USE_BACKGROUND_ON_PDF_X) ? $conf->global->MAIN_USE_BACKGROUND_ON_PDF_X : 0), (isset($conf->global->MAIN_USE_BACKGROUND_ON_PDF_Y) ? $conf->global->MAIN_USE_BACKGROUND_ON_PDF_Y : 0), 0, $page_height); From 7983ce941eabf1679eab2b5fb4a37d9a1e7cdcff Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 27 May 2021 01:52:52 +0200 Subject: [PATCH 0272/1497] Fix performance page --- htdocs/admin/system/perf.php | 101 ++++++++++++++++++++++++++++++++-- htdocs/langs/en_US/admin.lang | 7 ++- 2 files changed, 100 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/system/perf.php b/htdocs/admin/system/perf.php index b1014cc98c7..32fbe8ab41c 100644 --- a/htdocs/admin/system/perf.php +++ b/htdocs/admin/system/perf.php @@ -464,11 +464,99 @@ if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli') { print '
    '; } -// Product search +print '
    '; +print ''.$langs->trans("ComboListOptim").': '; +print '
    '; +// Product combo list +$sql = "SELECT COUNT(*) as nb"; +$sql .= " FROM ".MAIN_DB_PREFIX."product as p"; +$resql = $db->query($sql); +if ($resql) { + $limitforoptim = 5000; + $num = $db->num_rows($resql); + $obj = $db->fetch_object($resql); + $nb = $obj->nb; + if ($nb > $limitforoptim) { + if (empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) { + print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseComboOptim", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"), 'PRODUIT_USE_SEARCH_TO_SELECT'); + } else { + print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"), 'PRODUIT_USE_SEARCH_TO_SELECT', $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); + } + } else { + print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("ProductsOrServices")); + } + print '
    '; + $db->free($resql); +} +// Thirdparty combo list +$sql = "SELECT COUNT(*) as nb"; +$sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; +$resql = $db->query($sql); +if ($resql) { + $limitforoptim = 5000; + $num = $db->num_rows($resql); + $obj = $db->fetch_object($resql); + $nb = $obj->nb; + if ($nb > $limitforoptim) { + if (empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) { + print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseComboOptim", $nb, $langs->transnoentitiesnoconv("ThirdParties"), 'COMPANY_USE_SEARCH_TO_SELECT'); + } else { + print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ThirdParties"), 'COMPANY_USE_SEARCH_TO_SELECT', $conf->global->COMPANY_USE_SEARCH_TO_SELECT); + } + } else { + print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("ThirdParties")); + } + print '
    '; + $db->free($resql); +} +// Contact combo list +$sql = "SELECT COUNT(*) as nb"; +$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as s"; +$resql = $db->query($sql); +if ($resql) { + $limitforoptim = 5000; + $num = $db->num_rows($resql); + $obj = $db->fetch_object($resql); + $nb = $obj->nb; + if ($nb > $limitforoptim) { + if (empty($conf->global->CONTACT_USE_SEARCH_TO_SELECT)) { + print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseComboOptim", $nb, $langs->transnoentitiesnoconv("Contacts"), 'CONTACT_USE_SEARCH_TO_SELECT'); + } else { + print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("Contacts"), 'CONTACT_USE_SEARCH_TO_SELECT', $conf->global->CONTACT_USE_SEARCH_TO_SELECT); + } + } else { + print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("Contacts")); + } + print '
    '; + $db->free($resql); +} +// Contact combo list +$sql = "SELECT COUNT(*) as nb"; +$sql .= " FROM ".MAIN_DB_PREFIX."projet as s"; +$resql = $db->query($sql); +if ($resql) { + $limitforoptim = 5000; + $num = $db->num_rows($resql); + $obj = $db->fetch_object($resql); + $nb = $obj->nb; + if ($nb > $limitforoptim) { + if (empty($conf->global->PROJECT_USE_SEARCH_TO_SELECT)) { + print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseComboOptim", $nb, $langs->transnoentitiesnoconv("Projects"), 'PROJECT_USE_SEARCH_TO_SELECT'); + } else { + print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("Projects"), 'PROJECT_USE_SEARCH_TO_SELECT', $conf->global->PROJECT_USE_SEARCH_TO_SELECT); + } + } else { + print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("Projects")); + } + print '
    '; + $db->free($resql); +} + + print '
    '; print ''.$langs->trans("SearchOptim").': '; print '
    '; -$tab = array(); +// Product search $sql = "SELECT COUNT(*) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."product as p"; $resql = $db->query($sql); @@ -480,8 +568,9 @@ if ($resql) { if ($nb > $limitforoptim) { if (empty($conf->global->PRODUCT_DONOTSEARCH_ANYWHERE)) { print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseSearchOptim", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"), 'PRODUCT_DONOTSEARCH_ANYWHERE'); + print $langs->trans("YouHaveXObjectUseSearchOptimDesc"); } else { - print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ProductsOrServices")); + print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"), 'PRODUCT_DONOTSEARCH_ANYWHERE', $conf->global->PRODUCT_DONOTSEARCH_ANYWHERE); } } else { print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("ProductsOrServices")); @@ -491,20 +580,20 @@ if ($resql) { } // Thirdparty search -$tab = array(); $sql = "SELECT COUNT(*) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $resql = $db->query($sql); if ($resql) { - $limitforoptim = 10000; + $limitforoptim = 100000; $num = $db->num_rows($resql); $obj = $db->fetch_object($resql); $nb = $obj->nb; if ($nb > $limitforoptim) { if (empty($conf->global->COMPANY_DONOTSEARCH_ANYWHERE)) { print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseSearchOptim", $nb, $langs->transnoentitiesnoconv("ThirdParties"), 'COMPANY_DONOTSEARCH_ANYWHERE'); + print $langs->trans("YouHaveXObjectUseSearchOptimDesc"); } else { - print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ThirdParties")); + print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ThirdParties"), 'COMPANY_DONOTSEARCH_ANYWHERE', $conf->global->COMPANY_DONOTSEARCH_ANYWHERE); } } else { print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("ThirdParties")); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 78077474c96..2eaba13de3c 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1323,9 +1323,12 @@ ConditionIsCurrently=Condition is currently %s YouUseBestDriver=You use driver %s which is the best driver currently available. YouDoNotUseBestDriver=You use driver %s but driver %s is recommended. NbOfObjectIsLowerThanNoPb=You have only %s %s in the database. This does not require any particular optimization. +ComboListOptim=Combo list loading optimization SearchOptim=Search optimization -YouHaveXObjectUseSearchOptim=You have %s %s in the database. You can add the constant %s to 1 in Home-Setup-Other. Limit the search to the beginning of strings which makes it possible for the database to use indexes and you should get an immediate response. -YouHaveXObjectAndSearchOptimOn=You have %s %s in the database and constant %s is set to 1 in Home-Setup-Other. +YouHaveXObjectUseComboOptim=You have %s %s in the database. You can go into setup of module to enable loading of combo list on key pressed event. +YouHaveXObjectUseSearchOptim=You have %s %s in the database. You can add the constant %s to 1 in Home-Setup-Other. +YouHaveXObjectUseSearchOptimDesc=This limits the search to the beginning of strings which makes it possible for the database to use indexes and you should get an immediate response. +YouHaveXObjectAndSearchOptimOn=You have %s %s in the database and constant %s is set to %s in Home-Setup-Other. BrowserIsOK=You are using the %s web browser. This browser is ok for security and performance. BrowserIsKO=You are using the %s web browser. This browser is known to be a bad choice for security, performance and reliability. We recommend using Firefox, Chrome, Opera or Safari. PHPModuleLoaded=PHP component %s is loaded From 4f61286ae29a69a8c6358d1271ce1e7c734665f1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 27 May 2021 02:36:16 +0200 Subject: [PATCH 0273/1497] Small perf fix --- htdocs/comm/action/list.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index e5dba5d88db..0ecf33e5ebf 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -320,7 +320,7 @@ if ($search_title != '') { $param .= '&search_title='.urlencode($search_title); } if ($search_note != '') { - $param .= '&search_note='.$search_note; + $param .= '&search_note='.urlencode($search_note); } if (GETPOST('datestartday', 'int')) { $param .= '&datestartday='.GETPOST('datestartday', 'int'); @@ -829,7 +829,11 @@ if ($resql) { $actionstatic->location = $obj->location; $actionstatic->note_private = dol_htmlentitiesbr($obj->note); - $actionstatic->fetchResources(); + // Initialize $this->userassigned && this->socpeopleassigned array && this->userownerid + // but only if we need it + if (!empty($arrayfields['a.fk_contact']['checked'])) { + $actionstatic->fetchResources(); + } print ''; From 2caaa52e855e36576d5fbb0059f5e1e82a546ce7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 27 May 2021 02:52:51 +0200 Subject: [PATCH 0274/1497] Doc --- htdocs/comm/action/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 0ecf33e5ebf..8c6fc94e31f 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -520,6 +520,7 @@ $sql .= $db->order($sortfield, $sortorder); $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + // TODO Set and use an optimized request in $sqlforcount with no fields and no useless join to caluclate nb of records $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 From 531dee31fd4b29653b2da452eeec7d3b83642ad4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 27 May 2021 11:14:29 +0200 Subject: [PATCH 0275/1497] Fix securekey --- htdocs/public/payment/newpayment.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 287f9a576db..38732d3825f 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -254,11 +254,15 @@ $parameters = [ $reshook = $hookmanager->executeHooks('doValidatePayment', $parameters, $object, $action); // Check security token +$tmpsource = $source; +if ($tmpsource == 'membersubscription') { + $tmpsource = 'member'; +} $valid = true; if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { - if ($source && $REF) { - $token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$source.$REF, 2); // Use the source in the hash to avoid duplicates if the references are identical + if ($tmpsource && $REF) { + $token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$tmpsource.$REF, 2); // Use the source in the hash to avoid duplicates if the references are identical } else { $token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2); } @@ -770,7 +774,7 @@ $replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
    ' : '').'
    '; llxHeader($head, $langs->trans("PaymentForm"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea); // Check link validity -if ($source && in_array($ref, array('member_ref', 'contractline_ref', 'invoice_ref', 'order_ref', ''))) { +if ($source && in_array($ref, array('member_ref', 'contractline_ref', 'invoice_ref', 'order_ref', 'donation_ref', ''))) { $langs->load("errors"); dol_print_error_email('BADREFINPAYMENTFORM', $langs->trans("ErrorBadLinkSourceSetButBadValueForRef", $source, $ref)); // End of page From 5a5fa1edbb8c214b54f6bcfd43dcf9a537a08a93 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 27 May 2021 11:57:17 +0200 Subject: [PATCH 0276/1497] Fix regression amount was always empty. --- htdocs/public/payment/newpayment.php | 60 +++++++++++++++++----------- htdocs/stripe/class/stripe.class.php | 2 +- 2 files changed, 37 insertions(+), 25 deletions(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 38732d3825f..b58a57fc706 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -762,6 +762,8 @@ if ($action == 'charge' && !empty($conf->stripe->enabled)) { * View */ +$form = new Form($db); + $head = ''; if (!empty($conf->global->ONLINE_PAYMENT_CSS_URL)) { $head = ''."\n"; @@ -1483,32 +1485,42 @@ if ($source == 'member' || $source == 'membersubscription') { } if ($member->type) { - // Last member type - print ''.$langs->trans("LastMemberType"); - print ''.dol_escape_htmltag($member->type); - print "\n"; + $oldtypeid = $member->typeid; + $newtypeid = (int) (GETPOSTISSET("typeid") ? GETPOST("typeid", 'int') : $member->typeid); - require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; - $adht = new AdherentType($db); - // Amount by member type - $amountbytype = $adht->amountByType(1); - // Set the member type - $member->typeid = (int) (GETPOSTISSET("typeid") ? GETPOST("typeid", 'int') : $member->typeid); - // If we change the type of membership, we set also label of new type - $member->type = dol_getIdFromCode($db, $member->typeid, 'adherent_type', 'rowid', 'libelle'); - // Set amount for the subscription - $amount = (!empty($amountbytype[$member->typeid])) ? $amountbytype[$member->typeid] : $member->last_subscription_amount; - // list member type - if ( !$action) { - $form = new Form($db); // so we can call method selectarray - print ''.$langs->trans("NewSubscription"); - print ''; - print $form->selectarray("typeid", $adht->liste_array(1), $member->typeid, 0, 0, 0, 'onchange="window.location.replace(\''.$urlwithroot.'/public/payment/newpayment.php?source='.urlencode($source).'&ref='.urlencode($ref).'&amount='.urlencode($amount).'&typeid=\' + this.value + \'&securekey='.urlencode($SECUREKEY).'\');"', 0, 0, 0, '', '', 1); - print "\n"; - } elseif ($action == dopayment) { - print ''.$langs->trans("NewMemberType"); + if ($oldtypeid != $newtypeid && !empty($conf->global->MEMBER_ALLOW_CHANGE_OF_TYPE)) { + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; + $adht = new AdherentType($db); + // Amount by member type + $amountbytype = $adht->amountByType(1); + + // Last member type + print ''.$langs->trans("LastMemberType"); + print ''.dol_escape_htmltag($member->type); + print "\n"; + + // Set the new member type + $member->typeid = $newtypeid; + $member->type = dol_getIdFromCode($db, $newtypeid, 'adherent_type', 'rowid', 'libelle'); + + // list member type + if (!$action) { + // Set amount for the subscription + $amount = (!empty($amountbytype[$member->typeid])) ? $amountbytype[$member->typeid] : $member->last_subscription_amount; + + print ''.$langs->trans("NewSubscription"); + print ''; + print $form->selectarray("typeid", $adht->liste_array(1), $member->typeid, 0, 0, 0, 'onchange="window.location.replace(\''.$urlwithroot.'/public/payment/newpayment.php?source='.urlencode($source).'&ref='.urlencode($ref).'&amount='.urlencode($amount).'&typeid=\' + this.value + \'&securekey='.urlencode($SECUREKEY).'\');"', 0, 0, 0, '', '', 1); + print "\n"; + } elseif ($action == dopayment) { + print ''.$langs->trans("NewMemberType"); + print ''.dol_escape_htmltag($member->type); + print ''; + print "\n"; + } + } else { + print ''.$langs->trans("MemberType"); print ''.dol_escape_htmltag($member->type); - print ''; print "\n"; } } diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 7f325090b5e..5614b3c6138 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -514,7 +514,7 @@ class Stripe extends CommonObject if (!$resql) { $error++; $this->error = $this->db->lasterror(); - dol_syslog(get_class($this)."::PaymentIntent failed to insert paymentintent with id=".$paymentintent->id." into database."); + dol_syslog(get_class($this)."::PaymentIntent failed to insert paymentintent with id=".$paymentintent->id." into database.", LOG_ERR); } } } else { From 61753791b47eb270abf09d545c6e5a07754612f3 Mon Sep 17 00:00:00 2001 From: Frans Bosman Date: Thu, 27 May 2021 12:20:42 +0200 Subject: [PATCH 0277/1497] Update card.php Add Batchinfo on invoice detail lines if hidden feature INCUDE_BATCHINFO_ON_INVOICE is set --- htdocs/compta/facture/card.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index a088d94a01c..2d147c86b07 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2232,6 +2232,15 @@ if (empty($reshook)) { $mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)); setEventMessages($mesg, null, 'errors'); } else { + + // Add batchinfo if the detailline has batchinfo + + if (!empty($lines[$i]->detail_batch) && ! empty($conf->global->INCUDE_BATCHINFO_ON_INVOICE)){ + foreach ($lines[$i]->detail_batch as $batchline){ + $desc .= ' Batch: '.$batchline->batch.' aantal: '.$batchline->qty; + } + } + // Insert line $result = $object->addline($desc, $pu_ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, $remise_percent, $date_start, $date_end, 0, $info_bits, '', $price_base_type, $pu_ttc, $type, - 1, $special_code, '', 0, GETPOST('fk_parent_line'), $fournprice, $buyingprice, $label, $array_options, $_POST['progress'], '', $fk_unit, $pu_ht_devise); From c31530e7edcc308ae7775020d07a5f698b60eef5 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 27 May 2021 10:24:18 +0000 Subject: [PATCH 0278/1497] Fixing style errors. --- htdocs/compta/facture/card.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 2d147c86b07..beb9463acab 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2232,15 +2232,14 @@ if (empty($reshook)) { $mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)); setEventMessages($mesg, null, 'errors'); } else { - // Add batchinfo if the detailline has batchinfo - - if (!empty($lines[$i]->detail_batch) && ! empty($conf->global->INCUDE_BATCHINFO_ON_INVOICE)){ - foreach ($lines[$i]->detail_batch as $batchline){ - $desc .= ' Batch: '.$batchline->batch.' aantal: '.$batchline->qty; - } + + if (!empty($lines[$i]->detail_batch) && ! empty($conf->global->INCUDE_BATCHINFO_ON_INVOICE)) { + foreach ($lines[$i]->detail_batch as $batchline) { + $desc .= ' Batch: '.$batchline->batch.' aantal: '.$batchline->qty; + } } - + // Insert line $result = $object->addline($desc, $pu_ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, $remise_percent, $date_start, $date_end, 0, $info_bits, '', $price_base_type, $pu_ttc, $type, - 1, $special_code, '', 0, GETPOST('fk_parent_line'), $fournprice, $buyingprice, $label, $array_options, $_POST['progress'], '', $fk_unit, $pu_ht_devise); From ca7e52d86185e5a65be20e496f227ead8e77a05d Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Thu, 27 May 2021 13:09:03 +0200 Subject: [PATCH 0279/1497] Update llx_c_email_templates.sql - formatting - removed *tms* at eventorganization --- .../mysql/data/llx_c_email_templates.sql | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/htdocs/install/mysql/data/llx_c_email_templates.sql b/htdocs/install/mysql/data/llx_c_email_templates.sql index 5ca98be8545..acc09bad008 100644 --- a/htdocs/install/mysql/data/llx_c_email_templates.sql +++ b/htdocs/install/mysql/data/llx_c_email_templates.sql @@ -20,21 +20,24 @@ -- de l'install et tous les sigles '--' sont supprimés. -- -INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines) VALUES (0,'banque','thirdparty','',0,null,null,'(YourSEPAMandate)',1,'$conf->societe->enabled && $conf->banque->enabled && $conf->prelevement->enabled',0,'__(YourSEPAMandate)__','__(Hello)__,

    \n\n__(FindYourSEPAMandate)__ :
    \n__MYCOMPANY_NAME__
    \n__MYCOMPANY_FULLADDRESS__

    \n__(Sincerely)__
    \n__USER_SIGNATURE__',null); +-- Bank Thirdparty +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines) VALUES (0,'banque','thirdparty','',0,null,null,'(YourSEPAMandate)',1,'$conf->societe->enabled && $conf->banque->enabled && $conf->prelevement->enabled',0,'__(YourSEPAMandate)__','__(Hello)__,

    \n\n__(FindYourSEPAMandate)__ :
    \n__MYCOMPANY_NAME__
    \n__MYCOMPANY_FULLADDRESS__

    \n__(Sincerely)__
    \n__USER_SIGNATURE__',null); +-- Members +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnAutoSubscription)' ,10,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipRequestWasReceived)__','__(Hello)__ __MEMBER_FULLNAME__,

    \n\n__(ThisIsContentOfYourMembershipRequestWasReceived)__
    \n
    __ONLINE_PAYMENT_TEXT_AND_URL__
    \n

    \n__(Sincerely)__
    __USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnMemberValidation)' ,20,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasValidated)__', '__(Hello)__ __MEMBER_FULLNAME__,

    \n\n__(ThisIsContentOfYourMembershipWasValidated)__
    __(FirstName)__ : __MEMBER_FIRSTNAME__
    __(LastName)__ : __MEMBER_LASTNAME__
    __(ID)__ : __MEMBER_ID__
    \n
    __ONLINE_PAYMENT_TEXT_AND_URL__
    \n

    \n__(Sincerely)__
    __USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnNewSubscription)' ,30,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionWasRecorded)__', '__(Hello)__ __MEMBER_FULLNAME__,

    \n\n__(ThisIsContentOfYourSubscriptionWasRecorded)__
    \n\n

    \n__(Sincerely)__
    __USER_SIGNATURE__',null, 1); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingReminderForExpiredSubscription)',40,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(SubscriptionReminderEmail)__', '__(Hello)__ __MEMBER_FULLNAME__,

    \n\n__(ThisIsContentOfSubscriptionReminderEmail)__
    \n
    __ONLINE_PAYMENT_TEXT_AND_URL__
    \n

    \n__(Sincerely)__
    __USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnCancelation)' ,50,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasCanceled)__', '__(Hello)__ __MEMBER_FULLNAME__,

    \n\n__(YourMembershipWasCanceled)__
    \n

    \n__(Sincerely)__
    __USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingAnEMailToMember)' ,60,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(CardContent)__', '__(Hello)__,

    \n\n__(ThisIsContentOfYourCard)__
    \n__(ID)__ : __ID__
    \n__(Civiliyty)__ : __MEMBER_CIVILITY__
    \n__(Firstname)__ : __MEMBER_FIRSTNAME__
    \n__(Lastname)__ : __MEMBER_LASTNAME__
    \n__(Fullname)__ : __MEMBER_FULLNAME__
    \n__(Company)__ : __MEMBER_COMPANY__
    \n__(Address)__ : __MEMBER_ADDRESS__
    \n__(Zip)__ : __MEMBER_ZIP__
    \n__(Town)__ : __MEMBER_TOWN__
    \n__(Country)__ : __MEMBER_COUNTRY__
    \n__(Email)__ : __MEMBER_EMAIL__
    \n__(Birthday)__ : __MEMBER_BIRTH__
    \n__(Photo)__ : __MEMBER_PHOTO__
    \n__(Login)__ : __MEMBER_LOGIN__
    \n__(Password)__ : __MEMBER_PASSWORD__
    \n__(Phone)__ : __MEMBER_PHONE__
    \n__(PhonePerso)__ : __MEMBER_PHONEPRO__
    \n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__

    \n__(Sincerely)__
    __USER_SIGNATURE__',null, 0); -INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnAutoSubscription)' ,10,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipRequestWasReceived)__','__(Hello)__ __MEMBER_FULLNAME__,

    \n\n__(ThisIsContentOfYourMembershipRequestWasReceived)__
    \n
    __ONLINE_PAYMENT_TEXT_AND_URL__
    \n

    \n__(Sincerely)__
    __USER_SIGNATURE__',null, 0); -INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnMemberValidation)' ,20,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasValidated)__', '__(Hello)__ __MEMBER_FULLNAME__,

    \n\n__(ThisIsContentOfYourMembershipWasValidated)__
    __(FirstName)__ : __MEMBER_FIRSTNAME__
    __(LastName)__ : __MEMBER_LASTNAME__
    __(ID)__ : __MEMBER_ID__
    \n
    __ONLINE_PAYMENT_TEXT_AND_URL__
    \n

    \n__(Sincerely)__
    __USER_SIGNATURE__',null, 0); -INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnNewSubscription)' ,30,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionWasRecorded)__', '__(Hello)__ __MEMBER_FULLNAME__,

    \n\n__(ThisIsContentOfYourSubscriptionWasRecorded)__
    \n\n

    \n__(Sincerely)__
    __USER_SIGNATURE__',null, 1); -INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingReminderForExpiredSubscription)',40,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(SubscriptionReminderEmail)__', '__(Hello)__ __MEMBER_FULLNAME__,

    \n\n__(ThisIsContentOfSubscriptionReminderEmail)__
    \n
    __ONLINE_PAYMENT_TEXT_AND_URL__
    \n

    \n__(Sincerely)__
    __USER_SIGNATURE__',null, 0); -INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnCancelation)' ,50,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasCanceled)__', '__(Hello)__ __MEMBER_FULLNAME__,

    \n\n__(YourMembershipWasCanceled)__
    \n

    \n__(Sincerely)__
    __USER_SIGNATURE__',null, 0); -INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingAnEMailToMember)' ,60,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(CardContent)__', '__(Hello)__,

    \n\n__(ThisIsContentOfYourCard)__
    \n__(ID)__ : __ID__
    \n__(Civiliyty)__ : __MEMBER_CIVILITY__
    \n__(Firstname)__ : __MEMBER_FIRSTNAME__
    \n__(Lastname)__ : __MEMBER_LASTNAME__
    \n__(Fullname)__ : __MEMBER_FULLNAME__
    \n__(Company)__ : __MEMBER_COMPANY__
    \n__(Address)__ : __MEMBER_ADDRESS__
    \n__(Zip)__ : __MEMBER_ZIP__
    \n__(Town)__ : __MEMBER_TOWN__
    \n__(Country)__ : __MEMBER_COUNTRY__
    \n__(Email)__ : __MEMBER_EMAIL__
    \n__(Birthday)__ : __MEMBER_BIRTH__
    \n__(Photo)__ : __MEMBER_PHOTO__
    \n__(Login)__ : __MEMBER_LOGIN__
    \n__(Password)__ : __MEMBER_PASSWORD__
    \n__(Phone)__ : __MEMBER_PHONE__
    \n__(PhonePerso)__ : __MEMBER_PHONEPRO__
    \n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__

    \n__(Sincerely)__
    __USER_SIGNATURE__',null, 0); +-- Recruiting +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0,'recruitment','recruitmentcandidature_send','',0,null,null,'(AnswerCandidature)' ,100,'$conf->recruitment->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourCandidature)__', '__(Hello)__ __CANDIDATE_FULLNAME__,

    \n\n__(YourCandidatureAnswerMessage)__
    __ONLINE_INTERVIEW_SCHEDULER_TEXT_AND_URL__\n

    \n__(Sincerely)__
    __USER_SIGNATURE__',null, 0); -INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'recruitment','recruitmentcandidature_send','',0,null,null,'(AnswerCandidature)' ,100,'$conf->recruitment->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourCandidature)__', '__(Hello)__ __CANDIDATE_FULLNAME__,

    \n\n__(YourCandidatureAnswerMessage)__
    __ONLINE_INTERVIEW_SCHEDULER_TEXT_AND_URL__\n

    \n__(Sincerely)__
    __USER_SIGNATURE__',null, 0); - -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationEmailAskConf', 10, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskConf)__', '__(Hello)__ __THIRDPARTY_NAME__,

    __(ThisIsContentOfYourOrganizationEventConfRequestWasReceived)__

    __ONLINE_PAYMENT_TEXT_AND_URL__


    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationEmailAskBooth', 20, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskBooth)__', '__(Hello)__ __THIRDPARTY_NAME__,

    __(ThisIsContentOfYourOrganizationEventBoothRequestWasReceived)__

    __ONLINE_PAYMENT_TEXT_AND_URL__


    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationEmailSubsBooth', 30, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsBooth)__', '__(Hello)__ __THIRDPARTY_NAME__,

    __(ThisIsContentOfYourOrganizationEventBoothSubscriptionWasReceived)__

    __ONLINE_PAYMENT_TEXT_AND_URL__


    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationEmailSubsEvent', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsEvent)__', '__(Hello)__ __THIRDPARTY_NAME__,

    __(ThisIsContentOfYourOrganizationEventEventSubscriptionWasReceived)__

    __(Sincerely)__

    __MYCOMPANY_NAME__
    __USER_SIGNATURE__', null, '1', null); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationMassEmailAttendees', 50, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailAttendees)__', '__(Hello)__ __THIRDPARTY_NAME__,

    __(ThisIsContentOfYourOrganizationEventBulkMailToAttendees)__

    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationMassEmailSpeakers', 60, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailSpeakers)__', '__(Hello)__ __THIRDPARTY_NAME__,

    __(ThisIsContentOfYourOrganizationEventBulkMailToSpeakers)__

    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); +-- Event organization +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, 'EventOrganizationEmailAskConf', 10, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskConf)__', '__(Hello)__ __THIRDPARTY_NAME__,

    __(ThisIsContentOfYourOrganizationEventConfRequestWasReceived)__

    __ONLINE_PAYMENT_TEXT_AND_URL__


    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, 'EventOrganizationEmailAskBooth', 20, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskBooth)__', '__(Hello)__ __THIRDPARTY_NAME__,

    __(ThisIsContentOfYourOrganizationEventBoothRequestWasReceived)__

    __ONLINE_PAYMENT_TEXT_AND_URL__


    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, 'EventOrganizationEmailSubsBooth', 30, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsBooth)__', '__(Hello)__ __THIRDPARTY_NAME__,

    __(ThisIsContentOfYourOrganizationEventBoothSubscriptionWasReceived)__

    __ONLINE_PAYMENT_TEXT_AND_URL__


    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, 'EventOrganizationEmailSubsEvent', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsEvent)__', '__(Hello)__ __THIRDPARTY_NAME__,

    __(ThisIsContentOfYourOrganizationEventEventSubscriptionWasReceived)__

    __(Sincerely)__

    __MYCOMPANY_NAME__
    __USER_SIGNATURE__', null, '1', null); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, 'EventOrganizationMassEmailAttendees', 50, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailAttendees)__', '__(Hello)__ __THIRDPARTY_NAME__,

    __(ThisIsContentOfYourOrganizationEventBulkMailToAttendees)__

    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, 'EventOrganizationMassEmailSpeakers', 60, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailSpeakers)__', '__(Hello)__ __THIRDPARTY_NAME__,

    __(ThisIsContentOfYourOrganizationEventBulkMailToSpeakers)__

    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); From d0a8dc9df969c8432d4a0cf30a35c72407b4cd52 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Thu, 27 May 2021 13:25:00 +0200 Subject: [PATCH 0280/1497] Update llx_c_chargesociales.sql idea: fk_pays at first - id as second (based on fk_pays) --- htdocs/install/mysql/data/llx_c_chargesociales.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/install/mysql/data/llx_c_chargesociales.sql b/htdocs/install/mysql/data/llx_c_chargesociales.sql index b728d9c6414..a7e12df0d31 100644 --- a/htdocs/install/mysql/data/llx_c_chargesociales.sql +++ b/htdocs/install/mysql/data/llx_c_chargesociales.sql @@ -50,10 +50,10 @@ insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays -- -- Belgique -- -insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values (201, 'ONSS', 1,1,'TAXBEONSS' ,'2'); -insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values (210, 'Precompte professionnel', 1,1,'TAXBEPREPRO' ,'2'); -insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values (220, 'Prime existence', 1,1,'TAXBEPRIEXI' ,'2'); -insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values (230, 'Precompte immobilier', 1,1,'TAXBEPREIMMO','2'); +insert into llx_c_chargesociales (fk_pays, id, libelle, deductible, active, code) values ('2', 201, 'ONSS', 1,1,'TAXBEONSS'); +insert into llx_c_chargesociales (fk_pays, id, libelle, deductible, active, code) values ('2', 210, 'Precompte professionnel', 1,1,'TAXBEPREPRO'); +insert into llx_c_chargesociales (fk_pays, id, libelle, deductible, active, code) values ('2', 220, 'Prime existence', 1,1,'TAXBEPRIEXI'); +insert into llx_c_chargesociales (fk_pays, id, libelle, deductible, active, code) values ('2', 230, 'Precompte immobilier', 1,1,'TAXBEPREIMMO'); -- -- Austria From 61138b821078a66283fbdeccc88521f8d72cb613 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 27 May 2021 14:25:00 +0200 Subject: [PATCH 0281/1497] Fix look and feel v14 --- htdocs/user/card.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 073438bda1f..d189ced83aa 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1134,7 +1134,8 @@ if ($action == 'create' || $action == 'adduserldap') { } if (!empty($conf->global->MAIN_MULTILANGS)) { - print ''.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).''."\n"; + print ''.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0, 'string', '', 0, 0, 'id', $langs->trans("WarningNotLangOfInterface", $langs->transnoentitiesnoconv("UserGUISetup"))).''; + print ''."\n"; print img_picto('', 'language').$formadmin->select_language(GETPOST('default_lang', 'alpha') ?GETPOST('default_lang', 'alpha') : ($object->lang ? $object->lang : ''), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone'); print ''; print ''; @@ -1590,13 +1591,15 @@ if ($action == 'create' || $action == 'adduserldap') { // Default language if (!empty($conf->global->MAIN_MULTILANGS)) { + $langs->load("languages"); require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - print ''.$langs->trans("DefaultLang").''; + print ''; + print $form->textwithpicto($langs->trans("DefaultLang"), $langs->trans("WarningNotLangOfInterface", $langs->transnoentitiesnoconv("UserGUISetup"))); + print ''; //$s=picto_from_langcode($object->default_lang); //print ($s?$s.' ':''); - $langs->load("languages"); $labellang = ($object->lang ? $langs->trans('Language_'.$object->lang) : ''); - print $form->textwithpicto($labellang, $langs->trans("WarningNotLangOfInterface", $langs->transnoentitiesnoconv("UserGUISetup"))); + print $labellang; print ''; } @@ -2500,7 +2503,7 @@ if ($action == 'create' || $action == 'adduserldap') { // Default language if (!empty($conf->global->MAIN_MULTILANGS)) { - print ''.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).''."\n"; + print ''.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0, 'string', '', 0, 0, 'id', $langs->trans("WarningNotLangOfInterface", $langs->transnoentitiesnoconv("UserGUISetup"))).''."\n"; print img_picto('', 'language').$formadmin->select_language($object->lang, 'default_lang', 0, 0, 1); print ''; print ''; From e9cf33dac56fdce36bd8e7600faa47be970279cc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 27 May 2021 14:35:20 +0200 Subject: [PATCH 0282/1497] css --- htdocs/adherents/subscription/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index 06cd77f61c4..15dbfd2ec30 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -528,7 +528,7 @@ while ($i < min($num, $limit)) { // Lastname if (!empty($arrayfields['d.lastname']['checked'])) { - print ''.$adherent->getNomUrl(-1, 0, 'card', 'lastname').''; + print ''.$adherent->getNomUrl(-1, 0, 'card', 'lastname').''; if (!$i) { $totalarray['nbfield']++; } From e7f9d317c30164097790213a293d3cee472b9692 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 27 May 2021 14:45:16 +0200 Subject: [PATCH 0283/1497] css --- htdocs/adherents/subscription/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index 15dbfd2ec30..2a40524413d 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -551,7 +551,7 @@ while ($i < min($num, $limit)) { // Label if (!empty($arrayfields['t.libelle']['checked'])) { - print ''; + print ''; print $obj->note; print ''; if (!$i) { From cc0560c73dc50ca484970726f3009573fc6c0d63 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 27 May 2021 14:47:06 +0200 Subject: [PATCH 0284/1497] css --- htdocs/adherents/subscription/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index 2a40524413d..d3d84cb3624 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -528,7 +528,7 @@ while ($i < min($num, $limit)) { // Lastname if (!empty($arrayfields['d.lastname']['checked'])) { - print ''.$adherent->getNomUrl(-1, 0, 'card', 'lastname').''; + print ''.$adherent->getNomUrl(-1, 0, 'card', 'lastname').''; if (!$i) { $totalarray['nbfield']++; } From a33f6a897748480026921694b62889db79d7717c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 27 May 2021 14:57:16 +0200 Subject: [PATCH 0285/1497] css --- htdocs/adherents/list.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 986abc83b7b..838b7a6a620 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -949,7 +949,7 @@ while ($i < min($num, $limit)) { } // Firstname if (!empty($arrayfields['d.firstname']['checked'])) { - print ""; + print ''; print $obj->firstname; print "\n"; if (!$i) { @@ -958,7 +958,7 @@ while ($i < min($num, $limit)) { } // Lastname if (!empty($arrayfields['d.lastname']['checked'])) { - print ""; + print ''; print $obj->lastname; print "\n"; if (!$i) { @@ -978,13 +978,13 @@ while ($i < min($num, $limit)) { } // Company if (!empty($arrayfields['d.company']['checked'])) { - print ""; + print ''; print $companyname; print "\n"; } // Login if (!empty($arrayfields['d.login']['checked'])) { - print "".$obj->login."\n"; + print ''.$obj->login."\n"; if (!$i) { $totalarray['nbfield']++; } @@ -1009,7 +1009,7 @@ while ($i < min($num, $limit)) { if (!empty($arrayfields['t.libelle']['checked'])) { $membertypestatic->id = $obj->type_id; $membertypestatic->label = $obj->type; - print ''; + print ''; print $membertypestatic->getNomUrl(1, 32); print ''; if (!$i) { @@ -1018,7 +1018,7 @@ while ($i < min($num, $limit)) { } // Address if (!empty($arrayfields['d.address']['checked'])) { - print ''; + print ''; print $obj->address; print ''; if (!$i) { From 819e6e1122610cc5b15c94c1a89cdc741ac25fe3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 27 May 2021 14:59:44 +0200 Subject: [PATCH 0286/1497] Fix duplicate --- htdocs/adherents/list.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 838b7a6a620..749eacbbe10 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -306,7 +306,12 @@ $memberstatic = new Adherent($db); $now = dol_now(); -$sql = "SELECT d.rowid, d.ref, d.login, d.lastname, d.firstname, d.gender, d.societe as company, d.fk_soc,"; +if (!empty($search_categ) || !empty($catid)) { + $sql = "SELECT DISTINCT"; +} else { + $sql = "SELECT"; +} +$sql .= " d.rowid, d.ref, d.login, d.lastname, d.firstname, d.gender, d.societe as company, d.fk_soc,"; $sql .= " d.civility, d.datefin, d.address, d.zip, d.town, d.state_id, d.country,"; $sql .= " d.email, d.phone, d.phone_perso, d.phone_mobile, d.skype, d.birth, d.public, d.photo,"; $sql .= " d.fk_adherent_type as type_id, d.morphy, d.statut, d.datec as date_creation, d.tms as date_update,"; @@ -337,7 +342,7 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = d $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = d.state_id)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on (s.rowid = d.fk_soc)"; $sql .= ", ".MAIN_DB_PREFIX."adherent_type as t"; -$sql .= " WHERE d.fk_adherent_type = t.rowid "; +$sql .= " WHERE d.fk_adherent_type = t.rowid"; if ($catid > 0) { $sql .= " AND cm.fk_categorie = ".((int) $catid); } From 8ed24d67969bf7a5375c90da5855a898e5cd8211 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Thu, 27 May 2021 16:02:12 +0200 Subject: [PATCH 0287/1497] Add missing trigger LINERECEPTION_DELETE --- .../fournisseur.commande.dispatch.class.php | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php index 0f8b8341a3d..5457a9ee376 100644 --- a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php +++ b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php @@ -333,7 +333,6 @@ class CommandeFournisseurDispatch extends CommonObject */ public function update($user, $notrigger = 0) { - global $conf, $langs; $error = 0; // Clean parameters @@ -411,12 +410,12 @@ class CommandeFournisseurDispatch extends CommonObject } if (!$notrigger) { - // Uncomment this and change MYOBJECT to your own tag if you + // Call triggers $result = $this->call_trigger('LINERECEPTION_UPDATE', $user); if ($result < 0) { $error++; } - //// End call triggers + // End call triggers } } @@ -444,24 +443,22 @@ class CommandeFournisseurDispatch extends CommonObject */ public function delete($user, $notrigger = 0) { - global $conf, $langs; $error = 0; $this->db->begin(); if (!$error) { if (!$notrigger) { - // Uncomment this and change MYOBJECT to your own tag if you - // want this action calls a trigger. - - //// Call triggers - //$result=$this->call_trigger('MYOBJECT_DELETE',$user); - //if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} - //// End call triggers + // Call triggers + $result = $this->call_trigger('LINERECEPTION_DELETE', $user); + if ($result < 0) { + $error++; + } + // End call triggers } } - // Remove extrafields + // Remove extrafields if (!$error) { $result = $this->deleteExtraFields(); if ($result < 0) { @@ -496,7 +493,6 @@ class CommandeFournisseurDispatch extends CommonObject } - /** * Load an object from its id and create a new one in database * From 48f5cea91776bd8f3c47d1c45847844d0f2956dc Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Thu, 27 May 2021 16:03:17 +0200 Subject: [PATCH 0288/1497] Fix update receipt eatby --- htdocs/fourn/commande/dispatch.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 4b8812cf22e..2c847b9a421 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -443,7 +443,7 @@ if ($action == 'updateline' && $user->rights->fournisseur->commande->receptionne $product = $supplierorderdispatch->fk_product; $price = price2num(GETPOST('price'), '', 2); $comment = $supplierorderdispatch->comment; - $eatby = $supplierorderdispatch->fk_product; + $eatby = $supplierorderdispatch->eatby; $sellby = $supplierorderdispatch->sellby; $batch = $supplierorderdispatch->batch; From fd2d10d443d73816b78b35120d7d954b4a1ceb03 Mon Sep 17 00:00:00 2001 From: Frans Bosman Date: Thu, 27 May 2021 16:23:33 +0200 Subject: [PATCH 0289/1497] Update card.php --- htdocs/compta/facture/card.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index beb9463acab..c7c9202c18c 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -67,7 +67,7 @@ if (!empty($conf->accounting->enabled)) { } // Load translation files required by the page -$langs->loadLangs(array('bills', 'companies', 'compta', 'products', 'banks', 'main', 'withdrawals')); +$langs->loadLangs(array('bills', 'companies', 'compta', 'products', 'banks', 'main', 'withdrawals','productbatch')); if (!empty($conf->incoterm->enabled)) { $langs->load('incoterm'); } @@ -2236,7 +2236,8 @@ if (empty($reshook)) { if (!empty($lines[$i]->detail_batch) && ! empty($conf->global->INCUDE_BATCHINFO_ON_INVOICE)) { foreach ($lines[$i]->detail_batch as $batchline) { - $desc .= ' Batch: '.$batchline->batch.' aantal: '.$batchline->qty; + $desc .= ' '.$langs->trans('Batch').' '.$batchline->batch.' '.$langs->trans('printQty',$batchline->qty).' '; + } } From dfb2e547500646ddd5563fa1cf4fc8e0fe5907c2 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 27 May 2021 14:25:42 +0000 Subject: [PATCH 0290/1497] Fixing style errors. --- 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 c7c9202c18c..02fb8467e21 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2236,8 +2236,7 @@ if (empty($reshook)) { if (!empty($lines[$i]->detail_batch) && ! empty($conf->global->INCUDE_BATCHINFO_ON_INVOICE)) { foreach ($lines[$i]->detail_batch as $batchline) { - $desc .= ' '.$langs->trans('Batch').' '.$batchline->batch.' '.$langs->trans('printQty',$batchline->qty).' '; - + $desc .= ' '.$langs->trans('Batch').' '.$batchline->batch.' '.$langs->trans('printQty', $batchline->qty).' '; } } From 14fdd4d0c6ff9be688b683ae330f965e500993b7 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 27 May 2021 16:43:49 +0200 Subject: [PATCH 0291/1497] fix rollback to rollbac --- htdocs/product/inventory/inventory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index 2abc830eb7c..4344c2c7e08 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -160,7 +160,7 @@ if ($action == 'update' && !empty($user->rights->stock->mouvement->creer)) { if (! $error) { $db->commit(); } else { - $db->rollbak(); + $db->rollback(); } } From 00d60aa65a94b6b2f2e580261bceb3163907b0d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 27 May 2021 16:54:41 +0200 Subject: [PATCH 0292/1497] doxygen --- .../core/modules/supplier_invoice/doc/pdf_canelle.modules.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php index 8f6d12df1d0..07961dd3500 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -2,7 +2,7 @@ /* Copyright (C) 2010-2011 Juanjo Menent * Copyright (C) 2010-2014 Laurent Destailleur * Copyright (C) 2015 Marcos García - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2021 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1062,7 +1062,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices * @param FactureFournisseur $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output - * @return void + * @return int */ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs) { From f1b32dce17dfc86dbaf8a8726a1758f02b10260f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 27 May 2021 17:07:59 +0200 Subject: [PATCH 0293/1497] Update pdf_canelle.modules.php --- .../core/modules/supplier_invoice/doc/pdf_canelle.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php index 8f6d12df1d0..ed4f8ed6590 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -376,7 +376,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $notetoshow = convertBackOfficeMediasLinksToPublicLinks($notetoshow); $pdf->SetFont('', '', $default_font_size - 1); - $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top - 1, dol_htmlentitiesbr($object->note_public), 0, 1); + $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top - 1, dol_htmlentitiesbr($notetoshow), 0, 1); $nexY = $pdf->GetY(); $height_note = $nexY - $tab_top; From 4095c69582d5fc62bf15107283d6c38af4acb744 Mon Sep 17 00:00:00 2001 From: daraelmin Date: Thu, 27 May 2021 21:09:49 +0200 Subject: [PATCH 0294/1497] Fix #17743 newpayement source membersubscription is member Fix #17743 newpayement source membersubscription is not valid anymore @eldy I'm not sure, but the bug may still occure with external module referring to membersubscription instead of member. --- htdocs/core/lib/payments.lib.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php index 59d9eb4aa4c..4621e22d122 100644 --- a/htdocs/core/lib/payments.lib.php +++ b/htdocs/core/lib/payments.lib.php @@ -158,7 +158,7 @@ function getValidOnlinePaymentMethods($paymentmethod = '') /** * Return string with full online payment Url * - * @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'membersubscription' ...) + * @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'member' ...) * @param string $ref Ref of object * @return string Url string */ @@ -182,7 +182,7 @@ function showOnlinePaymentUrl($type, $ref) /** * Return string with HTML link for online payment * - * @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'membersubscription' ...) + * @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'member' ...) * @param string $ref Ref of object * @param string $label Text or HTML tag to display, if empty it display the URL * @return string Url string @@ -199,7 +199,7 @@ function getHtmlOnlinePaymentLink($type, $ref, $label = '') * Return string with full Url * * @param int $mode 0=True url, 1=Url formated with colors - * @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'membersubscription' ...) + * @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'member' ...) * @param string $ref Ref of object * @param int $amount Amount (required for $type='free' only) * @param string $freetag Free tag @@ -304,7 +304,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag } } elseif ($type == 'member' || $type == 'membersubscription') { $newtype = 'member'; - $out = $urltouse.'/public/payment/newpayment.php?source=membersubscription&ref='.($mode ? '' : ''); + $out = $urltouse.'/public/payment/newpayment.php?source=member&ref='.($mode ? '' : ''); if ($mode == 1) { $out .= 'member_ref'; } From 52d44bd75e1413345a4a5b86d165734d94b01a91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 27 May 2021 22:28:59 +0200 Subject: [PATCH 0295/1497] fix warnings --- htdocs/core/class/html.form.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 1f90b5f4fdc..28c3152359c 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -8325,10 +8325,10 @@ class Form $nophoto = 'company'; } else { $nophoto = '/public/theme/common/user_anonymous.png'; - if ($object->gender == 'man') { + if (!empty($object->gender) && $object->gender == 'man') { $nophoto = '/public/theme/common/user_man.png'; } - if ($object->gender == 'woman') { + if (!empty($object->gender) && $object->gender == 'woman') { $nophoto = '/public/theme/common/user_woman.png'; } } From 3b381dccc3af3a71a608ab897034fb7e34c2cf24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 27 May 2021 22:33:25 +0200 Subject: [PATCH 0296/1497] fix warnings --- htdocs/comm/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 589559ea426..95ba96abd74 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -580,9 +580,9 @@ if ($object->id > 0) { print ''; print ''; if ($action == 'edittransportmode') { - $form->formSelectTransportMode($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->fk_transport_mode, 'fk_transport_mode', 1); + $form->formSelectTransportMode($_SERVER['PHP_SELF'].'?socid='.$object->id, (!empty($object->fk_transport_mode) ? $object->fk_transport_mode : ''), 'fk_transport_mode', 1); } else { - $form->formSelectTransportMode($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->fk_transport_mode, 'none'); + $form->formSelectTransportMode($_SERVER['PHP_SELF'].'?socid='.$object->id, (!empty($object->fk_transport_mode) ? $object->fk_transport_mode : ''), 'none'); } print ""; print ''; From e1a427f1601bc2aa1224ee95e3f9034505cdeeb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 27 May 2021 22:40:26 +0200 Subject: [PATCH 0297/1497] fix warnings --- htdocs/comm/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 589559ea426..ce7d4242b6b 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -874,6 +874,7 @@ if ($object->id > 0) { $sql .= ", c.total_ttc"; $sql .= ", c.ref, c.ref_client, c.fk_statut, c.facture"; $sql .= ", c.date_commande as dc"; + $sql .= ", c.facture as billed"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c"; $sql .= " WHERE c.fk_soc = s.rowid "; $sql .= " AND s.rowid = ".$object->id; From 0b6457d83fae635dab80a6f65f21c24a8117aa83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 27 May 2021 22:44:05 +0200 Subject: [PATCH 0298/1497] fix warning --- htdocs/holiday/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index b00abadb9c3..dbc4b78be1a 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -722,6 +722,7 @@ if ($resql) { $i = 0; $totalarray = array(); + $totalarray['nbfield'] = 0; while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); From 4c1503a93bd825c1ec3571729104f9abda1cd60f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 27 May 2021 22:50:56 +0200 Subject: [PATCH 0299/1497] fix warnings --- htdocs/expensereport/class/expensereport.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 25ee6072a90..34bef81e5a2 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2015 Laurent Destailleur * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (c) 2018 Frédéric France + * Copyright (c) 2018-2021 Frédéric France * Copyright (C) 2016-2020 Ferran Marcet * * This program is free software; you can redistribute it and/or modify @@ -2478,9 +2478,9 @@ class ExpenseReport extends CommonObject $now = dol_now(); if ($option == 'toapprove') { - return ($this->datevalid ? $this->datevalid : $this->date_valid) < ($now - $conf->expensereport->approve->warning_delay); + return (!empty($this->datevalid) ? $this->datevalid : $this->date_valid) < ($now - $conf->expensereport->approve->warning_delay); } else { - return ($this->datevalid ? $this->datevalid : $this->date_valid) < ($now - $conf->expensereport->payment->warning_delay); + return (!empty($this->datevalid) ? $this->datevalid : $this->date_valid) < ($now - $conf->expensereport->payment->warning_delay); } } From d0b8a80c7a59cc87926aa1650db633a51e61cf79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 27 May 2021 22:56:20 +0200 Subject: [PATCH 0300/1497] fix warning --- htdocs/core/tpl/commonfields_add.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/commonfields_add.tpl.php b/htdocs/core/tpl/commonfields_add.tpl.php index 639be537dba..3a43f04c149 100644 --- a/htdocs/core/tpl/commonfields_add.tpl.php +++ b/htdocs/core/tpl/commonfields_add.tpl.php @@ -82,7 +82,7 @@ foreach ($object->fields as $key => $val) { } else { $value = GETPOST($key, 'alphanohtml'); } - if ($val['noteditable']) { + if (!empty($val['noteditable'])) { print $object->showOutputField($val, $key, $value, '', '', '', 0); } else { print $object->showInputField($val, $key, $value, '', '', '', 0); From ca0654323f0ab7da9e2000af21f289eeb4c481c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 27 May 2021 23:11:05 +0200 Subject: [PATCH 0301/1497] fix warnings --- htdocs/core/class/commonobject.class.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 3f4b2dd9ee6..32cffe9e4f8 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6397,7 +6397,7 @@ abstract class CommonObject $param = array(); $param['options'] = array(); $reg = array(); - $size = $this->fields[$key]['size']; + $size = !empty($this->fields[$key]['size']) ? $this->fields[$key]['size'] : 0; // Because we work on extrafields if (preg_match('/^(integer|link):(.*):(.*):(.*):(.*)/i', $val['type'], $reg)) { $param['options'] = array($reg[2].':'.$reg[3].':'.$reg[4].':'.$reg[5] => 'N'); @@ -6430,21 +6430,21 @@ abstract class CommonObject } // Special case that force options and type ($type can be integer, varchar, ...) - if (is_array($this->fields[$key]['arrayofkeyval'])) { + if (!empty($this->fields[$key]['arrayofkeyval']) && is_array($this->fields[$key]['arrayofkeyval'])) { $param['options'] = $this->fields[$key]['arrayofkeyval']; $type = 'select'; } $label = $this->fields[$key]['label']; //$elementtype=$this->fields[$key]['elementtype']; // Seems not used - $default = $this->fields[$key]['default']; - $computed = $this->fields[$key]['computed']; - $unique = $this->fields[$key]['unique']; - $required = $this->fields[$key]['required']; - $autofocusoncreate = $this->fields[$key]['autofocusoncreate']; + $default = (!empty($this->fields[$key]['default']) ? $this->fields[$key]['default'] : ''); + $computed = (!empty($this->fields[$key]['computed']) ? $this->fields[$key]['computed'] : ''); + $unique = (!empty($this->fields[$key]['unique']) ? $this->fields[$key]['unique'] : 0); + $required = (!empty($this->fields[$key]['required']) ? $this->fields[$key]['required'] : 0); + $autofocusoncreate = (!empty($this->fields[$key]['autofocusoncreate']) ? $this->fields[$key]['autofocusoncreate'] : 0); - $langfile = $this->fields[$key]['langfile']; - $list = $this->fields[$key]['list']; + $langfile = (!empty($this->fields[$key]['langfile']) ? $this->fields[$key]['langfile'] : ''); + $list = (!empty($this->fields[$key]['list']) ? $this->fields[$key]['list'] : 0); $hidden = (in_array(abs($this->fields[$key]['visible']), array(0, 2)) ? 1 : 0); $objectid = $this->id; From e87d1750415679b2556f961fedd0c2aa64775446 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Fri, 28 May 2021 09:57:21 +0200 Subject: [PATCH 0302/1497] Fix inventory/inventory.php --- htdocs/langs/en_US/stocks.lang | 1 + htdocs/product/inventory/inventory.php | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index 93cf9e9e037..977aab588a2 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -255,3 +255,4 @@ MakeMovementsAndClose=Generate movements and close AutofillWithExpected=Fill real quantity with expected quantity ShowAllBatchByDefault=By default, show batch details on product "stock" tab CollapseBatchDetailHelp=You can set batch detail default display in stocks module configuration +FieldCannotBeNegative=Field "%s" cannot be negative \ No newline at end of file diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index 2abc830eb7c..212f0404bd9 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -185,8 +185,11 @@ if ($action =='updateinventorylines' && $permissiontoadd) { if (GETPOST("id_".$lineid, 'alpha') != '') { // If a value was set ('0' or something else) $qtytoupdate = price2num(GETPOST("id_".$lineid, 'alpha'), 'MS'); - $result = $inventoryline->fetch($lineid); + if ($qtytoupdate < 0) { + $result = -1; + setEventMessages($langs->trans("FieldCannotBeNegative", $langs->transnoentitiesnoconv("RealQty")), null, 'errors'); + } if ($result > 0) { $inventoryline->qty_view = $qtytoupdate; $resultupdate = $inventoryline->update($user); @@ -251,7 +254,10 @@ if (empty($reshook)) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Product")), null, 'errors'); } - + if (GETPOST('qtytoadd') < 0) { + $error++; + setEventMessages($langs->trans("FieldCannotBeNegative", $langs->transnoentitiesnoconv("RealQty")), null, 'errors'); + } if (!$error && !empty($conf->productbatch->enabled)) { $tmpproduct = new Product($db); $result = $tmpproduct->fetch($fk_product); @@ -654,7 +660,7 @@ if ($object->id > 0) { // Real quantity print ''; if ($object->status == $object::STATUS_VALIDATED) { - $qty_view = GETPOST("id_".$obj->rowid) ? GETPOST("id_".$obj->rowid) : $obj->qty_view; + $qty_view = GETPOST("id_".$obj->rowid) && GETPOST("id_".$obj->rowid) >= 0 ? GETPOST("id_".$obj->rowid) : $obj->qty_view; $totalfound += price2num($qty_view, 'MS'); print ''; print ''; From e3a5abe20e9e1c1941d489f936b8e06edb921770 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Fri, 28 May 2021 10:02:48 +0200 Subject: [PATCH 0303/1497] Fix error name of menu knowledge management system --- htdocs/langs/en_US/knowledgemanagement.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/knowledgemanagement.lang b/htdocs/langs/en_US/knowledgemanagement.lang index 269007e60f8..68f5cced76c 100644 --- a/htdocs/langs/en_US/knowledgemanagement.lang +++ b/htdocs/langs/en_US/knowledgemanagement.lang @@ -47,7 +47,7 @@ KnowledgeManagementArea = Knowledge Management # Menu # MenuKnowledgeRecord = Knowledge base -ListOfArticles = List of articles +ListKnowledgeRecord = List of articles NewKnowledgeRecord = New article ValidateReply = Validate solution KnowledgeRecords = Articles From 05a966b93e2834a6c946dbbb00885d0c0aafe06e Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Fri, 28 May 2021 10:29:46 +0200 Subject: [PATCH 0304/1497] Fix of a bug on mass mailing --- htdocs/comm/mailing/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 86aff8a36e0..73f31f34f01 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -677,6 +677,7 @@ if (empty($reshook)) { $form = new Form($db); $htmlother = new FormOther($db); +$object->fetch($id); $help_url = 'EN:Module_EMailing|FR:Module_Mailing|ES:Módulo_Mailing'; llxHeader( '', From 11bbd2ace33c58e236ea5cb25b9a612df8fcf7f8 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 28 May 2021 10:31:54 +0200 Subject: [PATCH 0305/1497] fix: bad GETPOST test on payment module configuration --- htdocs/comm/propal/note.php | 2 +- htdocs/paybox/admin/paybox.php | 6 +++--- htdocs/paypal/admin/paypal.php | 6 +++--- htdocs/stripe/admin/stripe.php | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index 06be1179fb1..cb91a85da5f 100644 --- a/htdocs/comm/propal/note.php +++ b/htdocs/comm/propal/note.php @@ -53,7 +53,7 @@ $object = new Propal($db); $permissionnote = $user->rights->propale->creer; // Used by the include of actions_setnotes.inc.php -include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once diff --git a/htdocs/paybox/admin/paybox.php b/htdocs/paybox/admin/paybox.php index a342e58b971..b5b45dc3891 100644 --- a/htdocs/paybox/admin/paybox.php +++ b/htdocs/paybox/admin/paybox.php @@ -58,11 +58,11 @@ if ($action == 'setvalue' && $user->admin) if (!$result > 0) $error++; $result = dolibarr_set_const($db, "ONLINE_PAYMENT_CSS_URL", GETPOST('ONLINE_PAYMENT_CSS_URL', 'alpha'), 'chaine', 0, '', $conf->entity); if (!$result > 0) $error++; - $result = dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_FORM", GETPOST('ONLINE_PAYMENT_MESSAGE_FORM', 'alpha'), 'chaine', 0, '', $conf->entity); + $result = dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_FORM", GETPOST('ONLINE_PAYMENT_MESSAGE_FORM', 'restricthtml'), 'chaine', 0, '', $conf->entity); if (!$result > 0) $error++; - $result = dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_OK", GETPOST('ONLINE_PAYMENT_MESSAGE_OK', 'alpha'), 'chaine', 0, '', $conf->entity); + $result = dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_OK", GETPOST('ONLINE_PAYMENT_MESSAGE_OK', 'restricthtml'), 'chaine', 0, '', $conf->entity); if (!$result > 0) $error++; - $result = dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_KO", GETPOST('ONLINE_PAYMENT_MESSAGE_KO', 'alpha'), 'chaine', 0, '', $conf->entity); + $result = dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_KO", GETPOST('ONLINE_PAYMENT_MESSAGE_KO', 'restricthtml'), 'chaine', 0, '', $conf->entity); if (!$result > 0) $error++; $result = dolibarr_set_const($db, "ONLINE_PAYMENT_SENDEMAIL", GETPOST('ONLINE_PAYMENT_SENDEMAIL'), 'chaine', 0, '', $conf->entity); if (!$result > 0) $error++; diff --git a/htdocs/paypal/admin/paypal.php b/htdocs/paypal/admin/paypal.php index b16748f66b4..7d1c9879b9c 100644 --- a/htdocs/paypal/admin/paypal.php +++ b/htdocs/paypal/admin/paypal.php @@ -61,11 +61,11 @@ if ($action == 'setvalue' && $user->admin) if (!$result > 0) $error++; $result = dolibarr_set_const($db, "PAYPAL_ADD_PAYMENT_URL", GETPOST('PAYPAL_ADD_PAYMENT_URL', 'alpha'), 'chaine', 0, '', $conf->entity); if (!$result > 0) $error++; - $result = dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_FORM", GETPOST('ONLINE_PAYMENT_MESSAGE_FORM'), 'chaine', 0, '', $conf->entity); + $result = dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_FORM", GETPOST('ONLINE_PAYMENT_MESSAGE_FORM', 'restricthtml'), 'chaine', 0, '', $conf->entity); if (!$result > 0) $error++; - $result = dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_OK", GETPOST('ONLINE_PAYMENT_MESSAGE_OK'), 'chaine', 0, '', $conf->entity); + $result = dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_OK", GETPOST('ONLINE_PAYMENT_MESSAGE_OK', 'restricthtml'), 'chaine', 0, '', $conf->entity); if (!$result > 0) $error++; - $result = dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_KO", GETPOST('ONLINE_PAYMENT_MESSAGE_KO'), 'chaine', 0, '', $conf->entity); + $result = dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_KO", GETPOST('ONLINE_PAYMENT_MESSAGE_KO', 'restricthtml'), 'chaine', 0, '', $conf->entity); if (!$result > 0) $error++; $result = dolibarr_set_const($db, "ONLINE_PAYMENT_SENDEMAIL", GETPOST('ONLINE_PAYMENT_SENDEMAIL'), 'chaine', 0, '', $conf->entity); if (!$result > 0) $error++; diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index c304a00ce3f..25343265a5f 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -92,13 +92,13 @@ if ($action == 'setvalue' && $user->admin) $result = dolibarr_set_const($db, "ONLINE_PAYMENT_CSS_URL", GETPOST('ONLINE_PAYMENT_CSS_URL', 'alpha'), 'chaine', 0, '', $conf->entity); if (!$result > 0) $error++; - $result = dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_FORM", GETPOST('ONLINE_PAYMENT_MESSAGE_FORM', 'alpha'), 'chaine', 0, '', $conf->entity); + $result = dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_FORM", GETPOST('ONLINE_PAYMENT_MESSAGE_FORM', 'restricthtml'), 'chaine', 0, '', $conf->entity); if (!$result > 0) $error++; - $result = dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_OK", GETPOST('ONLINE_PAYMENT_MESSAGE_OK', 'alpha'), 'chaine', 0, '', $conf->entity); + $result = dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_OK", GETPOST('ONLINE_PAYMENT_MESSAGE_OK', 'restricthtml'), 'chaine', 0, '', $conf->entity); if (!$result > 0) $error++; - $result = dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_KO", GETPOST('ONLINE_PAYMENT_MESSAGE_KO', 'alpha'), 'chaine', 0, '', $conf->entity); + $result = dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_KO", GETPOST('ONLINE_PAYMENT_MESSAGE_KO', 'restricthtml'), 'chaine', 0, '', $conf->entity); if (!$result > 0) $error++; $result = dolibarr_set_const($db, "ONLINE_PAYMENT_SENDEMAIL", GETPOST('ONLINE_PAYMENT_SENDEMAIL'), 'chaine', 0, '', $conf->entity); From c4f7a8194c1b521852b61f6d776cf2db09d0f549 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 28 May 2021 10:32:53 +0200 Subject: [PATCH 0306/1497] remove space --- htdocs/comm/propal/note.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index cb91a85da5f..06be1179fb1 100644 --- a/htdocs/comm/propal/note.php +++ b/htdocs/comm/propal/note.php @@ -53,7 +53,7 @@ $object = new Propal($db); $permissionnote = $user->rights->propale->creer; // Used by the include of actions_setnotes.inc.php - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once +include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once From fed5db032a0e83b1c87d6063a2779e7659175b23 Mon Sep 17 00:00:00 2001 From: Matthias Haberl Date: Fri, 28 May 2021 11:26:55 +0200 Subject: [PATCH 0307/1497] Fix label of subaccount --- htdocs/accountancy/bookkeeping/listbysubaccount.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/bookkeeping/listbysubaccount.php b/htdocs/accountancy/bookkeeping/listbysubaccount.php index 129e695de3c..43d4acf343f 100644 --- a/htdocs/accountancy/bookkeeping/listbysubaccount.php +++ b/htdocs/accountancy/bookkeeping/listbysubaccount.php @@ -682,7 +682,7 @@ while ($i < min($num, $limit)) { print ""; print ''; if ($line->subledger_account != "" && $line->subledger_account != '-1') { - print $object->get_compte_desc($line->numero_compte).' : '.length_accounta($line->subledger_account); + print $line->subledger_label.' : '.length_accounta($line->subledger_account); } else { // Should not happen: subledger account must be null or a non empty value print ''.$langs->trans("Unknown"); From 1c75ce8862bf1e80483a673ec2d62e86ab83dd82 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 28 May 2021 14:12:22 +0200 Subject: [PATCH 0308/1497] Code comment --- htdocs/ticket/class/ticket.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 5180abe6140..61a6d15d9a1 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1112,10 +1112,10 @@ class Ticket extends CommonObject } /** - * print selected status + * Print selected status * - * @param string $selected selected status - * @return void + * @param string $selected Selected status + * @return void */ public function printSelectStatus($selected = "") { @@ -1124,9 +1124,9 @@ class Ticket extends CommonObject /** - * Charge dans cache la liste des types de tickets (paramétrable dans dictionnaire) + * Load into a cache the types of tickets (setup done into dictionaries) * - * @return int Number of lines loaded, 0 if already loaded, <0 if KO + * @return int Number of lines loaded, 0 if already loaded, <0 if KO */ public function loadCacheTypesTickets() { From 94467ea8cf7e06db9868b731aa8112f32d8f83ee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 28 May 2021 17:05:26 +0200 Subject: [PATCH 0309/1497] Fix selection --- htdocs/website/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index ef5660ce8fa..fe1bdce10d4 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -4098,9 +4098,9 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction = print $langs->trans("SearchReplaceInto"); print '
    '; print '
    '; - print ' '.$langs->trans("Content").'
    '; - print ' '.$langs->trans("Title").' | '.$langs->trans("Description").' | '.$langs->trans("Keywords").'
    '; - print ' '.$langs->trans("GlobalCSSorJS").'
    '; + print '
    '; + print '
    '; + print '
    '; print '
    '; print '
    '; From 81a94f5642b22507a07b82085412854b57d4f1d8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 28 May 2021 18:04:45 +0200 Subject: [PATCH 0310/1497] FIX option MAIN_GENERATE_SUPPLIER_PROPOSAL_WITH_PICTURE --- .../doc/pdf_aurore.modules.php | 2 +- htdocs/product/class/product.class.php | 32 +++++++++++-------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index e9e2179823b..3da4d72746b 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -239,7 +239,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdir = get_exdir($object->lines[$i]->fk_product, 2, 0, 0, $objphoto, 'product').$object->lines[$i]->fk_product."/photos/"; $dir = $conf->product->dir_output.'/'.$pdir; } else { - $pdir = get_exdir(0, 2, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; + $pdir = get_exdir(0, 0, 0, 0, $objphoto, 'product'); $dir = $conf->product->dir_output.'/'.$pdir; } diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 685180e4659..1e60a0f63d3 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5208,11 +5208,11 @@ class Product extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Retourne tableau de toutes les photos du produit + * Return an array with all photos of product found on disk. There is no sorting criteria. * - * @param string $dir Repertoire a scanner - * @param int $nbmax Nombre maximum de photos (0=pas de max) - * @return array Tableau de photos + * @param string $dir Directory to scan + * @param int $nbmax Number maxium of photos (0=no maximum) + * @return array Array of photos */ public function liste_photos($dir, $nbmax = 0) { @@ -5226,16 +5226,17 @@ class Product extends CommonObject $dir_osencoded = dol_osencode($dir); $handle = @opendir($dir_osencoded); if (is_resource($handle)) { - while (($file = readdir($handle)) !== false) - { - if (!utf8_check($file)) { $file = utf8_encode($file); // readdir returns ISO + while (($file = readdir($handle)) !== false) { + if (!utf8_check($file)) { + $file = utf8_encode($file); // readdir returns ISO } if (dol_is_file($dir.$file) && image_format_supported($file) >= 0) { $nbphoto++; - // On determine nom du fichier vignette + // We forge name of thumb. $photo = $file; $photo_vignette = ''; + $regs = array(); if (preg_match('/('.$this->regeximgext.')$/i', $photo, $regs)) { $photo_vignette = preg_replace('/'.$regs[0].'/i', '', $photo).'_small'.$regs[0]; } @@ -5245,14 +5246,17 @@ class Product extends CommonObject // Objet $obj = array(); $obj['photo'] = $photo; - if ($photo_vignette && dol_is_file($dirthumb.$photo_vignette)) { $obj['photo_vignette'] = 'thumbs/'.$photo_vignette; - } else { $obj['photo_vignette'] = ""; + if ($photo_vignette && dol_is_file($dirthumb.$photo_vignette)) { + $obj['photo_vignette'] = 'thumbs/'.$photo_vignette; + } else { + $obj['photo_vignette'] = ""; } $tabobj[$nbphoto - 1] = $obj; - // On continue ou on arrete de boucler ? - if ($nbmax && $nbphoto >= $nbmax) { break; + // Do we have to continue with next photo ? + if ($nbmax && $nbphoto >= $nbmax) { + break; } } } @@ -5265,9 +5269,9 @@ class Product extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Efface la photo du produit et sa vignette + * Delete a photo and its thumbs * - * @param string $file Chemin de l'image + * @param string $file Path to image file * @return void */ public function delete_photo($file) From f33869bf1c9432cb3a0f65c2daa14c9aac1cdebc Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 28 May 2021 18:08:01 +0200 Subject: [PATCH 0311/1497] fix: uploaddir for productlot --- htdocs/product/stock/productlot_document.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/product/stock/productlot_document.php b/htdocs/product/stock/productlot_document.php index 5b19288deff..820ad4d38bb 100644 --- a/htdocs/product/stock/productlot_document.php +++ b/htdocs/product/stock/productlot_document.php @@ -94,7 +94,9 @@ $usercanread = $user->rights->produit->lire; $usercancreate = $user->rights->produit->creer; $usercandelete = $user->rights->produit->supprimer; -$upload_dir = $conf->productbatch->multidir_output[$conf->entity]; +if (empty($upload_dir)) { + $upload_dir = $conf->productbatch->multidir_output[$conf->entity]; +} $permissiontoread = $usercanread; $permissiontoadd = $usercancreate; From 4f6385338a70ec953518b913d60726a83a6c001c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 28 May 2021 18:15:26 +0200 Subject: [PATCH 0312/1497] Fix option CAT_HIGH_QUALITY_IMAGES --- .../modules/supplier_order/doc/pdf_cornas.modules.php | 11 +++++++++-- .../supplier_order/doc/pdf_muscadet.modules.php | 11 +++++++++-- .../supplier_proposal/doc/pdf_aurore.modules.php | 11 +++++++++-- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php index c60f82e9c4a..245897e1956 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -240,8 +240,15 @@ class pdf_cornas extends ModelePDFSuppliersOrders $realpath = ''; foreach ($objphoto->liste_photos($dir, 1) as $key => $obj) { - $filename = $obj['photo']; - //if ($obj['photo_vignette']) $filename='thumbs/'.$obj['photo_vignette']; + if (empty($conf->global->CAT_HIGH_QUALITY_IMAGES)) { // If CAT_HIGH_QUALITY_IMAGES not defined, we use thumb if defined and then original photo + if ($obj['photo_vignette']) { + $filename = $obj['photo_vignette']; + } else { + $filename = $obj['photo']; + } + } else { + $filename = $obj['photo']; + } $realpath = $dir.$filename; break; } diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php index c6d9cf8da14..bb12b19c829 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -254,8 +254,15 @@ class pdf_muscadet extends ModelePDFSuppliersOrders } $realpath = ''; foreach ($objphoto->liste_photos($dir, 1) as $key => $obj) { - $filename = $obj['photo']; - //if ($obj['photo_vignette']) $filename='thumbs/'.$obj['photo_vignette']; + if (empty($conf->global->CAT_HIGH_QUALITY_IMAGES)) { // If CAT_HIGH_QUALITY_IMAGES not defined, we use thumb if defined and then original photo + if ($obj['photo_vignette']) { + $filename = $obj['photo_vignette']; + } else { + $filename = $obj['photo']; + } + } else { + $filename = $obj['photo']; + } $realpath = $dir.$filename; break; } diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index c6cc6e8d1b1..b471f65add6 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -251,8 +251,15 @@ class pdf_aurore extends ModelePDFSupplierProposal $realpath = ''; foreach ($objphoto->liste_photos($dir, 1) as $key => $obj) { - $filename = $obj['photo']; - //if ($obj['photo_vignette']) $filename='thumbs/'.$obj['photo_vignette']; + if (empty($conf->global->CAT_HIGH_QUALITY_IMAGES)) { // If CAT_HIGH_QUALITY_IMAGES not defined, we use thumb if defined and then original photo + if ($obj['photo_vignette']) { + $filename = $obj['photo_vignette']; + } else { + $filename = $obj['photo']; + } + } else { + $filename = $obj['photo']; + } $realpath = $dir.$filename; break; } From ab4941a558ff55ce00aabbc7bab1807216abd0c1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 29 May 2021 02:22:30 +0200 Subject: [PATCH 0313/1497] Fix not visible button when missing permission --- htdocs/fichinter/card.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 0b919c3eb4b..84c4fd61c62 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1606,8 +1606,9 @@ if ($action == 'create') // Validate if ($object->statut == Fichinter::STATUS_DRAFT && (count($object->lines) > 0 || !empty($conf->global->FICHINTER_DISABLE_DETAILS))) { if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->ficheinter->creer) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->ficheinter->ficheinter_advance->validate)) { - print ''; + print ''; + } else { + print '
    '.$langs->trans("Validate").'
    '; } } @@ -1640,7 +1641,7 @@ if ($action == 'create') } } - // create intervention model + // Create intervention model if ($conf->global->MAIN_FEATURES_LEVEL >= 1 && $object->statut == Fichinter::STATUS_DRAFT && $user->rights->ficheinter->creer && (count($object->lines) > 0)) { print '
    '; print ''.$langs->trans("ChangeIntoRepeatableIntervention").''; From 48867c39aaf89c0be659bba2859cc3182b214532 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 29 May 2021 04:54:53 +0200 Subject: [PATCH 0314/1497] Fix missing link to edit translation --- htdocs/admin/translation.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index acb11e70332..362b29c0163 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -563,6 +563,21 @@ if ($mode == 'searchkey') { print '   '.img_picto($langs->trans('FixOnTransifex'), 'globe').''; } } else { + // retrieve rowid + $sql = "SELECT rowid"; + $sql .= " FROM ".MAIN_DB_PREFIX."overwrite_trans"; + $sql .= " WHERE entity IN (".getEntity('overwrite_trans').")"; + $sql .= " AND transkey = '".$db->escape($key)."'"; + dol_syslog("translation::select from table", LOG_DEBUG); + $result = $db->query($sql); + if ($result) { + $obj = $db->fetch_object($result); + } + print ''.img_edit().''; + print ' '; + print ''.img_delete().''; + print '  '; + $htmltext = $langs->trans("TransKeyWithoutOriginalValue", $key); print $form->textwithpicto('', $htmltext, 1, 'warning'); } From baea57ec05617e8f95b6b1898ad2e5f434d18e58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 30 May 2021 08:38:07 +0200 Subject: [PATCH 0315/1497] force reload css after activate/desactivate module --- htdocs/admin/modules.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 1a6d99261bd..5dc660adb9b 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -8,6 +8,7 @@ * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2018 Nicolas ZABOURI + * Copyright (C) 2021 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -246,6 +247,7 @@ if ($action == 'install') { if ($action == 'set' && $user->admin) { $resarray = activateModule($value); + dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV + 1, 'chaine', 0, '', $conf->entity); if (!empty($resarray['errors'])) { setEventMessages('', $resarray['errors'], 'errors'); } else { @@ -269,6 +271,7 @@ if ($action == 'set' && $user->admin) { exit; } elseif ($action == 'reset' && $user->admin && GETPOST('confirm') == 'yes') { $result = unActivateModule($value); + dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV + 1, 'chaine', 0, '', $conf->entity); if ($result) { setEventMessages($result, null, 'errors'); } From 1834d642b3469d245fef36dd0997cdc9ae90ed96 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 30 May 2021 17:04:12 +0200 Subject: [PATCH 0316/1497] Fix phpcs --- htdocs/admin/system/perf.php | 6 +++--- htdocs/admin/system/security.php | 21 ++++++++++++++++++++- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/system/perf.php b/htdocs/admin/system/perf.php index 32fbe8ab41c..2a8dfa975cd 100644 --- a/htdocs/admin/system/perf.php +++ b/htdocs/admin/system/perf.php @@ -75,7 +75,7 @@ print '
    '; print ''.$langs->trans("Syslog").': '; $test = empty($conf->syslog->enabled); if ($test) { - print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' - '.$langs->trans("NotSlowedDownByThis"); + print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' '.$langs->trans("NotSlowedDownByThis").''; } else { if ($conf->global->SYSLOG_LEVEL > LOG_NOTICE) { print img_picto('', 'warning').' '.$langs->trans("ModuleActivatedWithTooHighLogLevel", $langs->transnoentities("Syslog")); @@ -91,7 +91,7 @@ print '
    '; print ''.$langs->trans("DebugBar").': '; $test = empty($conf->debugbar->enabled); if ($test) { - print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' - '.$langs->trans("NotSlowedDownByThis"); + print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' '.$langs->trans("NotSlowedDownByThis").''; } else { print img_picto('', 'warning').' '.$langs->trans("ModuleActivated", $langs->transnoentities("DebugBar")); //print ' '.$langs->trans("MoreInformation").' XDebug admin page'; @@ -111,7 +111,7 @@ if ($test) { print ' Memcached module admin page'; } } else { - print img_picto('', 'warning').' '.$langs->trans("MemcachedNotAvailable"); + print $langs->trans("MemcachedNotAvailable"); } print '
    '; diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index 087ad76631d..ff054a13ce0 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -66,7 +66,26 @@ if (function_exists('php_ini_loaded_file')) { print "
    \n"; // Get versionof web server -print "
    Web server - ".$langs->trans("Version").": ".$_SERVER["SERVER_SOFTWARE"]."
    \n"; +print "
    Web server - ".$langs->trans("Version").": ".$_SERVER["SERVER_SOFTWARE"]."
    \n"; +print ''.$langs->trans("DataRootServer").": ".DOL_DATA_ROOT."
    \n"; +// Web user group by default +$labeluser = dol_getwebuser('user'); +$labelgroup = dol_getwebuser('group'); +if ($labeluser && $labelgroup) { + print ''.$langs->trans("WebUserGroup")." (env vars) : ".$labeluser.':'.$labelgroup; + if (function_exists('posix_geteuid') && function_exists('posix_getpwuid')) { + $arrayofinfoofuser = posix_getpwuid(posix_geteuid()); + print ' (POSIX '.$arrayofinfoofuser['name'].':'.$arrayofinfoofuser['gecos'].':'.$arrayofinfoofuser['dir'].':'.$arrayofinfoofuser['shell'].')
    '."\n"; + } +} +// Web user group real (detected by 'id' external command) +if (function_exists('exec')) { + $arrayout = array(); $varout = 0; + exec('id', $arrayout, $varout); + if (empty($varout)) { // Test command is ok. Work only on Linux OS. + print ''.$langs->trans("WebUserGroup")." (real, 'id' command) : ".join(',', $arrayout)."
    \n"; + } +} print '
    '; print "PHP safe_mode = ".(ini_get('safe_mode') ? ini_get('safe_mode') : yn(0)).'   '.$langs->trans("Deprecated")." (removed in PHP 5.4)
    \n"; From 2f969f154e79e4d4a886fe51d655839b381830c7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 30 May 2021 17:10:38 +0200 Subject: [PATCH 0317/1497] More examples --- htdocs/admin/system/security.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index ff054a13ce0..e972581beaa 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -65,7 +65,7 @@ if (function_exists('php_ini_loaded_file')) { } print "
    \n"; -// Get versionof web server +// Get version of web server print "
    Web server - ".$langs->trans("Version").": ".$_SERVER["SERVER_SOFTWARE"]."
    \n"; print ''.$langs->trans("DataRootServer").": ".DOL_DATA_ROOT."
    \n"; // Web user group by default @@ -89,7 +89,7 @@ if (function_exists('exec')) { print '
    '; print "PHP safe_mode = ".(ini_get('safe_mode') ? ini_get('safe_mode') : yn(0)).'   '.$langs->trans("Deprecated")." (removed in PHP 5.4)
    \n"; -print "PHP open_basedir = ".(ini_get('open_basedir') ? ini_get('open_basedir') : yn(0).'   ('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("ARestrictedPath")).')')."
    \n"; +print "PHP open_basedir = ".(ini_get('open_basedir') ? ini_get('open_basedir') : yn(0).'   ('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("ARestrictedPath").', '.$langs->transnoentitiesnoconv("Example").' '.$_SERVER["DOCUMENT_ROOT"]).')')."
    \n"; print "PHP allow_url_fopen = ".(ini_get('allow_url_fopen') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_fopen') : yn(0)).'   ('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("No")).")
    \n"; print "PHP allow_url_include = ".(ini_get('allow_url_include') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_include') : yn(0)).'   ('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("No")).")
    \n"; print "PHP disable_functions = "; From d2bda7ad09137061441938d1b45ef4f6643517d2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 30 May 2021 19:01:43 +0200 Subject: [PATCH 0318/1497] Set a maxlength on fields --- htdocs/core/tpl/login.tpl.php | 4 ++-- htdocs/core/tpl/passwordforgotten.tpl.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index b5dc9b90be0..9af5bc7d7b4 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -180,7 +180,7 @@ if ($disablenofollow) { } ?> -" name="username" class="flat input-icon-user minwidth150" value="" tabindex="1" autofocus="autofocus" /> +" name="username" class="flat input-icon-user minwidth150" value="" tabindex="1" autofocus="autofocus" />
    @@ -192,7 +192,7 @@ if ($disablenofollow) { } ?> -" name="password" class="flat input-icon-password minwidth150" type="password" value="" tabindex="2" autocomplete="global->MAIN_LOGIN_ENABLE_PASSWORD_AUTOCOMPLETE) ? 'off' : 'on'; ?>" /> +" name="password" class="flat input-icon-password minwidth150" value="" tabindex="2" autocomplete="global->MAIN_LOGIN_ENABLE_PASSWORD_AUTOCOMPLETE) ? 'off' : 'on'; ?>" />
    -" id="username" name="username" class="flat input-icon-user minwidth150" value="" tabindex="1" /> +" id="username" name="username" class="flat input-icon-user minwidth150" value="" tabindex="1" />
    From 356e349944989674350a5cbba07df77706d7aeab Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 30 May 2021 20:01:29 +0200 Subject: [PATCH 0319/1497] Fix reposition --- htdocs/admin/boxes.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index 44629525a26..df691eba688 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -427,11 +427,11 @@ foreach ($boxactivated as $key => $box) { $hasprevious = ($key != 0); print ''.($key + 1).''; print ''; - print ($hasnext ? ''.img_down().' ' : ''); - print ($hasprevious ? ''.img_up().'' : ''); + print ($hasnext ? ''.img_down().' ' : ''); + print ($hasprevious ? ''.img_up().'' : ''); print ''; print ''; - print ''.img_delete().''; + print ''.img_delete().''; print ''; print ''."\n"; From ea21e1dbfbe957f3fb80ad0f89bce20c541596aa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 30 May 2021 20:19:02 +0200 Subject: [PATCH 0320/1497] Fix color selection for ticket graph --- .../core/boxes/box_graph_nb_tickets_type.php | 33 +++++++++---------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/htdocs/core/boxes/box_graph_nb_tickets_type.php b/htdocs/core/boxes/box_graph_nb_tickets_type.php index aee3e68ee5d..712c28df851 100644 --- a/htdocs/core/boxes/box_graph_nb_tickets_type.php +++ b/htdocs/core/boxes/box_graph_nb_tickets_type.php @@ -66,6 +66,10 @@ class box_graph_nb_tickets_type extends ModeleBoxes public function loadBox($max = 5) { global $conf, $user, $langs; + global $theme_datacolor, $badgeStatus8; + + require_once DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php"; + $badgeStatus0 = '#cbd3d3'; // draft $badgeStatus1 = '#bc9526'; // validated @@ -98,29 +102,22 @@ class box_graph_nb_tickets_type extends ModeleBoxes if ($resql) { $num = $this->db->num_rows($resql); $i = 0; + $newcolorkey = 0; + $colorused = array(); while ($i < $num) { $objp = $this->db->fetch_object($resql); $listofoppcode[$objp->rowid] = $objp->code; $listofopplabel[$objp->rowid] = $objp->label; - switch ($objp->code) { - case 'COM': - $colorseriesstat[$objp->rowid] = $badgeStatus1; - break; - case 'HELP': - $colorseriesstat[$objp->rowid] = $badgeStatus2; - break; - case 'ISSUE': - $colorseriesstat[$objp->rowid] = $badgeStatus3; - break; - case 'REQUEST': - $colorseriesstat[$objp->rowid] = $badgeStatus4; - break; - case 'OTHER': - $colorseriesstat[$objp->rowid] = $badgeStatus5; - break; - default: - break; + if (empty($colorused[$objp->code])) { + if ($objp->code == 'ISSUE') { + $colorused[$objp->code] = $badgeStatus8; + } else { + $colorused[$objp->code] = colorArrayToHex($theme_datacolor[$newcolorkey]); + $newcolorkey++; + } } + $colorseriesstat[$objp->rowid] = $colorused[$objp->code]; + $i++; } } else { From ab64f467f52c5e9f62d7d6cb510868355e777b1a Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Mon, 31 May 2021 09:31:38 +0200 Subject: [PATCH 0321/1497] add of a new param in selectGroupTicket --- htdocs/core/class/html.formticket.class.php | 244 ++++++++++++++------ 1 file changed, 174 insertions(+), 70 deletions(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 3cec6c19789..23c220d43df 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -569,90 +569,194 @@ class FormTicket * @param int $noadmininfo 0=Add admin info, 1=Disable admin info * @param int $maxlength Max length of label * @param string $morecss More CSS + * @param int $use_multilevel if != 0 create a multilevel select ( Do not use any of the other params) * @return void */ - public function selectGroupTickets($selected = '', $htmlname = 'ticketcategory', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss = '') + public function selectGroupTickets($selected = '', $htmlname = 'ticketcategory', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss = '', $use_multilevel = 0) { global $langs, $user; - $ticketstat = new Ticket($this->db); + if ($use_multilevel == 0) { + $ticketstat = new Ticket($this->db); - dol_syslog(get_class($this)."::selectCategoryTickets ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG); + dol_syslog(get_class($this)."::selectCategoryTickets ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG); - $ticketstat->loadCacheCategoriesTickets(); + $ticketstat->loadCacheCategoriesTickets(); - print ''; + if ($empty) { + print ''; + } - if (is_array($ticketstat->cache_category_tickets) && count($ticketstat->cache_category_tickets)) { - foreach ($ticketstat->cache_category_tickets as $id => $arraycategories) { - // Exclude some record - if ($filtertype == 'public=1') { - if (empty($arraycategories['public'])) { + if (is_array($ticketstat->cache_category_tickets) && count($ticketstat->cache_category_tickets)) { + foreach ($ticketstat->cache_category_tickets as $id => $arraycategories) { + // Exclude some record + if ($filtertype == 'public=1') { + if (empty($arraycategories['public'])) { + continue; + } + } + + // We discard empty line if showempty is on because an empty line has already been output. + if ($empty && empty($arraycategories['code'])) { continue; } + + if ($format == 0) { + print ''; } - - // We discard empty line if showempty is on because an empty line has already been output. - if ($empty && empty($arraycategories['code'])) { - continue; - } - - if ($format == 0) { - print ''; } - } - print ''; - if ($user->admin && !$noadmininfo) { - print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); - } + print ''; + if ($user->admin && !$noadmininfo) { + print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); + } - print ajax_combobox('select'.$htmlname); + print ajax_combobox('select'.$htmlname); + } else { + $groupticket=GETPOST('groupticket', 'aZ09'); + $groupticketchild=GETPOST('groupticket_child', 'aZ09'); + $arraycodenotparent[] = ""; + $stringtoprint = ''.$langs->trans("GroupOfTicket").' '; + $stringtoprint .= ''; + } + $stringtoprint .= ' '; + + $stringtoprint .= ''; + + $stringtoprint .=''; + return $stringtoprint; + } } /** From 2c6eee2528b0fc0f0edf4d7a73e297a44f525f6e Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 31 May 2021 10:26:05 +0200 Subject: [PATCH 0322/1497] Update llx_00_c_country.sql MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Roumanie -> Romania Rwanda = Rwanda Sainte-Hélène -> Saint Helena Saint-Christophe-et-Niévès -> Saint Kitts and Nevis Sainte-Lucie -> Saint Lucia Saint-Pierre-et-Miquelon -> Saint Pierre and Miquelon Saint-Vincent-et-les-Grenadines -> Saint Vincent and the Grenadines Samoa = Samoa Saint-Marin -> San Marino Sao Tomé-et-Principe -> Saint Thomas and Prince Serbie -> Serbia Seychelles = Seychelles Sierra Leone = Sierra Leone Slovaquie -> Slovakia Slovénie -> Slovenia --- .../install/mysql/data/llx_00_c_country.sql | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/install/mysql/data/llx_00_c_country.sql b/htdocs/install/mysql/data/llx_00_c_country.sql index 677447f1af2..1e2e8b69c39 100644 --- a/htdocs/install/mysql/data/llx_00_c_country.sql +++ b/htdocs/install/mysql/data/llx_00_c_country.sql @@ -216,21 +216,21 @@ INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (18 INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (184,'PL','POL','Pologne',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (185,'PR','PRI','Puerto Rico',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (186,'QA','QAT','Qatar',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (188,'RO','ROU','Roumanie',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (188,'RO','ROU','Romania',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (189,'RW','RWA','Rwanda',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (190,'SH','SHN','Sainte-Hélène',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (191,'KN','KNA','Saint-Christophe-et-Niévès',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (192,'LC','LCA','Sainte-Lucie',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (193,'PM','SPM','Saint-Pierre-et-Miquelon',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (194,'VC','VCT','Saint-Vincent-et-les-Grenadines',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (190,'SH','SHN','Saint Helena',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (191,'KN','KNA','Saint Kitts and Nevis',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (192,'LC','LCA','Saint Lucia',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (193,'PM','SPM','Saint Pierre and Miquelon',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (194,'VC','VCT','Saint Vincent and the Grenadines',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (195,'WS','WSM','Samoa',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (196,'SM','SMR','Saint-Marin',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (197,'ST','STP','Sao Tomé-et-Principe',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (198,'RS','SRB','Serbie',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (196,'SM','SMR','San Marino ',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (197,'ST','STP','Saint Thomas and Prince',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (198,'RS','SRB','Serbia',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (199,'SC','SYC','Seychelles',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (200,'SL','SLE','Sierra Leone',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (201,'SK','SVK','Slovaquie',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (202,'SI','SVN','Slovénie',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (201,'SK','SVK','Slovakia',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (202,'SI','SVN','Slovenia',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (203,'SB','SLB','Iles Salomon',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (204,'SO','SOM','Somalie',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (205,'ZA','ZAF','South Africa',1,0); From a97efdbdfa12ef4e121a556c3b5ed64822abd670 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 31 May 2021 10:31:25 +0200 Subject: [PATCH 0323/1497] Update list.php $title = $langs->trans('Supplier')." - ".$langs->trans('ProductsAndServices'); --- htdocs/fourn/product/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/product/list.php b/htdocs/fourn/product/list.php index f411d70af25..ed137fd5d86 100644 --- a/htdocs/fourn/product/list.php +++ b/htdocs/fourn/product/list.php @@ -121,7 +121,7 @@ $form = new Form($db); $productstatic = new Product($db); $companystatic = new Societe($db); -$title = $langs->trans("ProductsAndServices"); +$title = $langs->trans('Supplier')." - ".$langs->trans('ProductsAndServices'); if ($fourn_id) { $supplier = new Fournisseur($db); From fed7878d18ad9273560129fdaffdfd27f1f61645 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 31 May 2021 10:33:36 +0200 Subject: [PATCH 0324/1497] Update card.php $lineid was duplicate --- htdocs/fourn/commande/card.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 8c4aa1e2a54..21cd61536ee 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -70,8 +70,6 @@ $socid = GETPOST('socid', 'int'); $projectid = GETPOST('projectid', 'int'); $cancel = GETPOST('cancel', 'alpha'); $lineid = GETPOST('lineid', 'int'); - -$lineid = GETPOST('lineid', 'int'); $origin = GETPOST('origin', 'alpha'); $originid = (GETPOST('originid', 'int') ? GETPOST('originid', 'int') : GETPOST('origin_id', 'int')); // For backward compatibility From 7aae5be54a86d704d63ea61bf5bf878cc3b78e9a Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 31 May 2021 10:36:43 +0200 Subject: [PATCH 0325/1497] Update card.php --- htdocs/fourn/facture/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 0bc26ea8f2b..86cd9e439f9 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1791,8 +1791,8 @@ if (!empty($conf->projet->enabled)) { $now = dol_now(); $title = $langs->trans('SupplierInvoice')." - ".$langs->trans('Card'); -$helpurl = "EN:Module_Suppliers_Invoices|FR:Module_Fournisseurs_Factures|ES:Módulo_Facturas_de_proveedores"; -llxHeader('', $title, $helpurl); +$help_url = 'EN:Module_Suppliers_Invoices|FR:Module_Fournisseurs_Factures|ES:Módulo_Facturas_de_proveedores|DE:Modul_Lieferantenrechnungen'; +llxHeader('', $title, $help_url); // Mode creation if ($action == 'create') { From 55d48077a32301e509aa67925d19f07c11287e91 Mon Sep 17 00:00:00 2001 From: Christian Foellmann Date: Mon, 31 May 2021 09:26:53 +0200 Subject: [PATCH 0326/1497] ADD note to supplier order refusal --- .../interface_50_modAgenda_ActionsAuto.class.php | 7 ++++++- htdocs/fourn/commande/card.php | 14 +++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index 8e98030b484..3c7c8cb6e1c 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -544,13 +544,18 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->sendtoid = 0; } elseif ($action == 'ORDER_SUPPLIER_REFUSE') { // Load translation files required by the page - $langs->loadLangs(array("agenda", "other", "orders")); + $langs->loadLangs(array("agenda", "other", "orders", "main")); if (empty($object->actionmsg2)) { $object->actionmsg2 = $langs->transnoentities("OrderRefusedInDolibarr", $object->ref); } $object->actionmsg = $langs->transnoentities("OrderRefusedInDolibarr", $object->ref); + if (!empty($object->refuse_note)) { + $object->actionmsg .= '
    '; + $object->actionmsg .= $langs->trans("Reason") . ': '.$object->refuse_note; + } + $object->sendtoid = 0; } elseif ($action == 'ORDER_SUPPLIER_SUBMIT') { // Load translation files required by the page diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 8c4aa1e2a54..d5ff9bc229f 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -960,6 +960,9 @@ if (empty($reshook)) { } if ($action == 'confirm_refuse' && $confirm == 'yes' && $usercanapprove) { + if (GETPOST('refuse_note')) { + $object->refuse_note = GETPOST('refuse_note'); + } $result = $object->refuse($user); if ($result > 0) { header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id); @@ -1875,7 +1878,16 @@ if ($action == 'create') { // Confirmation de la desapprobation if ($action == 'refuse') { - $formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=$object->id", $langs->trans("DenyingThisOrder"), $langs->trans("ConfirmDenyingThisOrder", $object->ref), "confirm_refuse", '', 0, 1); + $formquestion = array( + array( + 'type' => 'text', + 'name' => 'refuse_note', + 'label' => $langs->trans("MotifCP"), + 'value' => '', + 'morecss' => 'minwidth300' + ) + ); + $formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=$object->id", $langs->trans("DenyingThisOrder"), $langs->trans("ConfirmDenyingThisOrder", $object->ref), "confirm_refuse", $formquestion, 0, 1); } // Confirmation de l'annulation From e1de510c389396730d4aef03ccecd780b226f3c3 Mon Sep 17 00:00:00 2001 From: TuxGasy Date: Mon, 31 May 2021 11:06:52 +0200 Subject: [PATCH 0327/1497] Do a strict comparison when check if stock is enough --- htdocs/product/stock/class/mouvementstock.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 2429a4c09c5..ec2dfbc257e 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -355,7 +355,7 @@ class MouvementStock extends CommonObject $qtyisnotenough = 0; foreach ($product->stock_warehouse[$entrepot_id]->detail_batch as $batchcursor => $prodbatch) { - if ($batch != $batchcursor) continue; + if ($batch !== $batchcursor) continue; // Do a strict comparison because $batchcursar can be an integer $foundforbatch = 1; if ($prodbatch->qty < abs($qty)) $qtyisnotenough = $prodbatch->qty; break; From ffc7ae038947c63bf3d48e6815427a25a489055f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 31 May 2021 12:02:03 +0200 Subject: [PATCH 0328/1497] Fix missing test --- htdocs/user/card.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index d189ced83aa..62d815842ce 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1789,7 +1789,9 @@ if ($action == 'create' || $action == 'adduserldap') { if ($object->datepreviouslogin) { print dol_print_date($object->datepreviouslogin, "dayhour").' ('.$langs->trans("Previous").'), '; } - print dol_print_date($object->datelastlogin, "dayhour").' ('.$langs->trans("Current").')'; + if ($object->datelastlogin) { + print dol_print_date($object->datelastlogin, "dayhour").' ('.$langs->trans("Current").')'; + } print ''; print "\n"; From 90ae16372c7d2cc0a6d8939b224230b267909744 Mon Sep 17 00:00:00 2001 From: Pierre Payet Date: Mon, 31 May 2021 12:11:16 +0200 Subject: [PATCH 0329/1497] add missing hooks in societe list.php --- htdocs/societe/list.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 0df74bc166e..fe55d05dda4 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -429,6 +429,10 @@ $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."c_stcomm as st ON s.fk_stcomm = st.id"; // We'll need this table joined to the select in order to filter by sale if ($search_sale == -2) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON sc.fk_soc = s.rowid"; elseif ($search_sale || (!$user->rights->societe->client->voir && !$socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; +// Add table from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; $sql .= " WHERE s.entity IN (".getEntity('societe').")"; if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; if ($search_sale && $search_sale != -2) $sql .= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale @@ -490,6 +494,11 @@ if (empty($reshook)) { } $sql .= $hookmanager->resPrint; +// Add GroupBy from hooks +$parameters = array('all' => $all, 'fieldstosearchall' => $fieldstosearchall); +$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; + $sql .= $db->order($sortfield, $sortorder); // Count total nb of records From 0071d63fbba31aefc51c136eacc6afb455d8fd67 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 31 May 2021 13:35:03 +0200 Subject: [PATCH 0330/1497] Fix for ro-md language --- htdocs/core/lib/functions.lib.php | 6 +++++- htdocs/langs/en_US/languages.lang | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 45d1bdca12e..61a3869fe1a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8068,7 +8068,7 @@ function picto_from_langcode($codelang, $moreatt = '') * Return default language from country code. * Return null if not found. * - * @param string $countrycode Country code like 'US', 'FR', 'CA', ... + * @param string $countrycode Country code like 'US', 'FR', 'CA', 'ES', 'MX', ... * @return string Value of locale like 'en_US', 'fr_FR', ... */ function getLanguageCodeFromCountryCode($countrycode) @@ -8092,6 +8092,9 @@ function getLanguageCodeFromCountryCode($countrycode) if ($mysoc->country_code == 'DE') { return 'de_CH'; } + if ($mysoc->country_code == 'IT') { + return 'it_CH'; + } } // Locale list taken from: @@ -8232,6 +8235,7 @@ function getLanguageCodeFromCountryCode($countrycode) 'pt-BR', 'pt-PT', 'rm-CH', + 'ro-MD', 'ro-RO', 'ru-RU', 'rw-RW', diff --git a/htdocs/langs/en_US/languages.lang b/htdocs/langs/en_US/languages.lang index 015e6dcfa25..cbc94b4481c 100644 --- a/htdocs/langs/en_US/languages.lang +++ b/htdocs/langs/en_US/languages.lang @@ -84,6 +84,7 @@ Language_nl_NL=Dutch Language_pl_PL=Polish Language_pt_BR=Portuguese (Brazil) Language_pt_PT=Portuguese +Language_ro_MD=Romanian (Moldavia) Language_ro_RO=Romanian Language_ru_RU=Russian Language_ru_UA=Russian (Ukraine) From c19f624eb5ca5e9e935e694307779db0712ea6d9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 31 May 2021 16:00:03 +0200 Subject: [PATCH 0331/1497] Code comment --- htdocs/user/group/card.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index 19b78cf06e9..0e60e70e42a 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -1,10 +1,10 @@ - * Copyright (C) 2005-2015 Laurent Destailleur - * Copyright (C) 2005-2017 Regis Houssin - * Copyright (C) 2011 Herve Prot - * Copyright (C) 2012 Florian Henry - * Copyright (C) 2018 Juanjo Menent + * Copyright (C) 2005-2021 Laurent Destailleur + * Copyright (C) 2005-2017 Regis Houssin + * Copyright (C) 2011 Herve Prot + * Copyright (C) 2012 Florian Henry + * Copyright (C) 2018 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,7 +22,7 @@ /** * \file htdocs/user/group/card.php - * \brief Onglet groupes utilisateurs + * \brief Tab of a user group */ require '../../main.inc.php'; From 2dc9ca334fa7ae9115847ee36bc7ffa2ed65c9ae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 31 May 2021 23:36:37 +0200 Subject: [PATCH 0332/1497] CSS --- htdocs/admin/system/filecheck.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index 50b27b30964..212fcc6228a 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -122,7 +122,7 @@ if (dol_is_file($xmlfile)) { print ''."\n"; if ($enableremotecheck) { print ' = '; - print '
    '; + print '
    '; } else { print ' '.$langs->trans("RemoteSignature").' = '.dol_escape_htmltag($xmlremote); if (!GETPOST('xmlremote')) { From 9d44df8a64e0857e0647ba08312a7301500f03f8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 1 Jun 2021 00:05:43 +0200 Subject: [PATCH 0333/1497] Fix escape --- htdocs/societe/list.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 0a3e9207a96..48cc882c052 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -1405,7 +1405,7 @@ while ($i < min($num, $limit)) { } if (!empty($arrayfields['s.name_alias']['checked'])) { print ''; - print $companystatic->name_alias; + print dol_escape_htmltag($companystatic->name_alias); print "\n"; if (!$i) { $totalarray['nbfield']++; @@ -1413,70 +1413,70 @@ while ($i < min($num, $limit)) { } // Barcode if (!empty($arrayfields['s.barcode']['checked'])) { - print ''.$obj->barcode.''; + print ''.dol_escape_htmltag($obj->barcode).''; if (!$i) { $totalarray['nbfield']++; } } // Customer code if (!empty($arrayfields['s.code_client']['checked'])) { - print ''.$obj->code_client.''; + print ''.dol_escape_htmltag($obj->code_client).''; if (!$i) { $totalarray['nbfield']++; } } // Supplier code if (!empty($arrayfields['s.code_fournisseur']['checked'])) { - print ''.$obj->code_fournisseur.''; + print ''.dol_escape_htmltag($obj->code_fournisseur).''; if (!$i) { $totalarray['nbfield']++; } } // Account customer code if (!empty($arrayfields['s.code_compta']['checked'])) { - print ''.$obj->code_compta.''; + print ''.dol_escape_htmltag($obj->code_compta).''; if (!$i) { $totalarray['nbfield']++; } } // Account supplier code if (!empty($arrayfields['s.code_compta_fournisseur']['checked'])) { - print ''.$obj->code_compta_fournisseur.''; + print ''.dol_escape_htmltag($obj->code_compta_fournisseur).''; if (!$i) { $totalarray['nbfield']++; } } // Address if (!empty($arrayfields['s.address']['checked'])) { - print ''.$obj->address.''; + print ''.dol_escape_htmltag($obj->address).''; if (!$i) { $totalarray['nbfield']++; } } // Zip if (!empty($arrayfields['s.zip']['checked'])) { - print "".$obj->zip."\n"; + print "".dol_escape_htmltag($obj->zip)."\n"; if (!$i) { $totalarray['nbfield']++; } } // Town if (!empty($arrayfields['s.town']['checked'])) { - print "".$obj->town."\n"; + print ''.dol_escape_htmltag($obj->town)."\n"; if (!$i) { $totalarray['nbfield']++; } } // State if (!empty($arrayfields['state.nom']['checked'])) { - print "".$obj->state_name."\n"; + print "".dol_escape_htmltag($obj->state_name)."\n"; if (!$i) { $totalarray['nbfield']++; } } // Region if (!empty($arrayfields['region.nom']['checked'])) { - print "".$obj->region_name."\n"; + print "".dol_escape_htmltag($obj->region_name)."\n"; if (!$i) { $totalarray['nbfield']++; } From d18c1ea0c0177618397c28996fde3e288eabf86b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 1 Jun 2021 00:41:51 +0200 Subject: [PATCH 0334/1497] css --- htdocs/cron/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index 2132cbc141b..28fa0287f0c 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -600,7 +600,7 @@ if ($num > 0) { print ''; // Output of last run - print ''; + print ''; if (!empty($obj->lastoutput)) { print dol_trunc(nl2br($obj->lastoutput), 50); } From a5c2ce1727044a141cbdc228c3f6680ac8115179 Mon Sep 17 00:00:00 2001 From: ATM john Date: Tue, 1 Jun 2021 08:45:45 +0200 Subject: [PATCH 0335/1497] NEW/FIX : Allow auto picking for child warehouse and taking into account of the quantities already affected in list --- htdocs/expedition/card.php | 118 +++++++++++++++++++++++++++-- htdocs/langs/en_US/deliveries.lang | 1 + htdocs/langs/fr_FR/deliveries.lang | 1 + 3 files changed, 114 insertions(+), 6 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index cc441d9f50f..8d4ed510449 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1020,7 +1020,11 @@ if ($action == 'create') { // Load shipments already done for same order $object->loadExpeditions(); - if ($numAsked) { + + $alreadyQtyBatchSetted = $alreadyQtySetted = array(); + + if ($numAsked) + { print ''; print ''.$langs->trans("Description").''; print ''.$langs->trans("QtyOrdered").''; @@ -1044,6 +1048,15 @@ if ($action == 'create') { print "\n"; } + $warehouse_id = GETPOST('entrepot_id', 'int'); + $warehousePicking = array(); + // get all warehouse children for picking + if($warehouse_id > 0){ + $warehousePicking[] = $warehouse_id; + $warehouseObj = new Entrepot($db); + $warehouseObj->get_children_warehouses($warehouse_id,$warehousePicking); + } + $indiceAsked = 0; while ($indiceAsked < $numAsked) { $product = new Product($db); @@ -1293,6 +1306,12 @@ if ($action == 'create') { $subj = 0; // Define nb of lines suggested for this order line $nbofsuggested = 0; + + uasort ( $product->stock_warehouse , function ($a, $b){ + if ($a->real == $b->real) { return 0; } + return ($a->real < $b->real) ? -1 : 1; + }); + foreach ($product->stock_warehouse as $warehouse_id => $stock_warehouse) { if ($stock_warehouse->real > 0) { $nbofsuggested++; @@ -1300,6 +1319,12 @@ if ($action == 'create') { } $tmpwarehouseObject = new Entrepot($db); foreach ($product->stock_warehouse as $warehouse_id => $stock_warehouse) { // $stock_warehouse is product_stock + + if(!empty($warehousePicking) && !in_array($warehouse_id, $warehousePicking)){ + // if a warehouse was selected by user, picking is limited to this warehouse and his children + continue; + } + $tmpwarehouseObject->fetch($warehouse_id); if ($stock_warehouse->real > 0) { $stock = + $stock_warehouse->real; // Convert it to number @@ -1309,7 +1334,32 @@ if ($action == 'create') { print ''; print ''; if ($line->product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { - print ''; + if(isset($alreadyQtySetted[$line->fk_product][intval($warehouse_id)])){ + $deliverableQty = min($quantityToBeDelivered, $stock - $alreadyQtySetted[$line->fk_product][intval($warehouse_id)]); + } + else{ + if(!isset($alreadyQtySetted[$line->fk_product])){ + $alreadyQtySetted[$line->fk_product] = array(); + } + + $deliverableQty = min($quantityToBeDelivered, $stock); + } + + if ($deliverableQty < 0) $deliverableQty = 0; + + $tooltip = ''; + if(!empty($alreadyQtySetted[$line->fk_product][intval($warehouse_id)])){ + $tooltip = ' class="classfortooltip" title="'.$langs->trans('StockQuantitiesAlreadyAllocatedOnPreviousLines').' : '.$alreadyQtySetted[$line->fk_product][intval($warehouse_id)].'" '; + } + + $alreadyQtySetted[$line->fk_product][intval($warehouse_id)] = $deliverableQty + $alreadyQtySetted[$line->fk_product][intval($warehouse_id)]; + + $inputName = 'qtyl'.$indiceAsked.'_'.$subj; + if(GETPOSTISSET($inputName)){ + $deliverableQty = GETPOST($inputName, 'int'); + } + + print ''; print ''; } else { print $langs->trans("NA"); @@ -1366,6 +1416,12 @@ if ($action == 'create') { $tmpwarehouseObject = new Entrepot($db); $productlotObject = new Productlot($db); + + uasort ( $product->stock_warehouse , function ($a, $b){ + if ($a->real == $b->real) { return 0; } + return ($a->real < $b->real) ? -1 : 1; + }); + // Define nb of lines suggested for this order line $nbofsuggested = 0; foreach ($product->stock_warehouse as $warehouse_id => $stock_warehouse) { @@ -1373,18 +1429,68 @@ if ($action == 'create') { foreach ($stock_warehouse->detail_batch as $dbatch) { $nbofsuggested++; } + + // Sort Batch priority + uasort($stock_warehouse->detail_batch, function ($a, $b) { + $compare = 0; + $multiplePow = 0; + // The comparison function must return an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second. + + // PRIORITY FOR QTY : Eliminate place with small qty first + $multiplePow++; + $multiple = pow(10, $multiplePow); + $compare += (($a->qty < $b->qty) ? -1 : 1) * $multiple; + + // PRIORITY FOR SELL EXPIRATION DATE + $multiplePow++; + $multiple = pow(10, $multiplePow); + $compare += (($a->sellby < $b->sellby) ? -1 : 1) * $multiple; + + // PRIORITY FOR CONSUMPTION EXPIRATION DATE + $multiplePow++; + $multiple = pow(10, $multiplePow); + $compare += (($a->eatby < $b->eatby) ? -1 : 1) * $multiple; + + return $compare; + }); } } + foreach ($product->stock_warehouse as $warehouse_id => $stock_warehouse) { $tmpwarehouseObject->fetch($warehouse_id); if (($stock_warehouse->real > 0) && (count($stock_warehouse->detail_batch))) { foreach ($stock_warehouse->detail_batch as $dbatch) { - //var_dump($dbatch); + $batchStock = + $dbatch->qty; // To get a numeric - $deliverableQty = min($quantityToBeDelivered, $batchStock); - if ($deliverableQty < 0) { - $deliverableQty = 0; + if(isset($alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)])){ + $deliverableQty = min($quantityToBeDelivered, $batchStock - $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)]); } + else{ + if(!isset($alreadyQtyBatchSetted[$line->fk_product])){ + $alreadyQtyBatchSetted[$line->fk_product] = array(); + } + + if(!isset($alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch])){ + $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch] = array(); + } + + $deliverableQty = min($quantityToBeDelivered, $batchStock); + } + + if ($deliverableQty < 0) $deliverableQty = 0; + + $inputName = 'qtyl'.$indiceAsked.'_'.$subj; + if(GETPOSTISSET($inputName)){ + $deliverableQty = GETPOST($inputName, 'int'); + } + + $tooltip = ''; + if(!empty($alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)])){ + $tooltip = ' class="classfortooltip" title="'.$langs->trans('StockQuantitiesAlreadyAllocatedOnPreviousLines').' : '.$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)].'" '; + } + + $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = $deliverableQty + $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)]; + print ''; print ''; print ''; diff --git a/htdocs/langs/en_US/deliveries.lang b/htdocs/langs/en_US/deliveries.lang index fdfd6404a8a..cd8a36e6c70 100644 --- a/htdocs/langs/en_US/deliveries.lang +++ b/htdocs/langs/en_US/deliveries.lang @@ -30,3 +30,4 @@ NonShippable=Not Shippable ShowShippableStatus=Show shippable status ShowReceiving=Show delivery receipt NonExistentOrder=Nonexistent order +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/fr_FR/deliveries.lang b/htdocs/langs/fr_FR/deliveries.lang index bd13cce814c..6af98a54d4f 100644 --- a/htdocs/langs/fr_FR/deliveries.lang +++ b/htdocs/langs/fr_FR/deliveries.lang @@ -30,3 +30,4 @@ NonShippable=Non expédiable ShowShippableStatus=Afficher le statut Expédiable ShowReceiving=Afficher le bon de réception NonExistentOrder=Commande inexistante +StockQuantitiesAlreadyAllocatedOnPreviousLines = Qtés de stock déja attribuées sur une ou des lignes précédentes From cf9c9ec8825e5db3da054b9ecb8eeade7126eb9b Mon Sep 17 00:00:00 2001 From: ATM john Date: Tue, 1 Jun 2021 09:07:05 +0200 Subject: [PATCH 0336/1497] fix condition --- htdocs/expedition/card.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 8d4ed510449..64d554b9780 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1155,10 +1155,9 @@ if ($action == 'create') { } else { $quantityToBeDelivered = $quantityAsked - $quantityDelivered; } - $warehouse_id = GETPOST('entrepot_id', 'int'); $warehouseObject = null; - if ($warehouse_id > 0 || !($line->fk_product > 0) || empty($conf->stock->enabled)) { // If warehouse was already selected or if product is not a predefined, we go into this part with no multiwarehouse selection + if (count($warehousePicking) == 1 || !($line->fk_product > 0) || empty($conf->stock->enabled)) { // If warehouse was already selected or if product is not a predefined, we go into this part with no multiwarehouse selection print ''; //ship from preselected location $stock = + $product->stock_warehouse[$warehouse_id]->real; // Convert to number From 3cc65989c1eee25920d816aa8b50efd5d65f52ea Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 1 Jun 2021 07:25:29 +0000 Subject: [PATCH 0337/1497] Fixing style errors. --- htdocs/expedition/card.php | 45 +++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 64d554b9780..543a67311f0 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1021,10 +1021,9 @@ if ($action == 'create') { $object->loadExpeditions(); - $alreadyQtyBatchSetted = $alreadyQtySetted = array(); + $alreadyQtyBatchSetted = $alreadyQtySetted = array(); - if ($numAsked) - { + if ($numAsked) { print ''; print ''.$langs->trans("Description").''; print ''.$langs->trans("QtyOrdered").''; @@ -1049,12 +1048,12 @@ if ($action == 'create') { } $warehouse_id = GETPOST('entrepot_id', 'int'); - $warehousePicking = array(); - // get all warehouse children for picking - if($warehouse_id > 0){ + $warehousePicking = array(); + // get all warehouse children for picking + if ($warehouse_id > 0) { $warehousePicking[] = $warehouse_id; $warehouseObj = new Entrepot($db); - $warehouseObj->get_children_warehouses($warehouse_id,$warehousePicking); + $warehouseObj->get_children_warehouses($warehouse_id, $warehousePicking); } $indiceAsked = 0; @@ -1306,7 +1305,7 @@ if ($action == 'create') { // Define nb of lines suggested for this order line $nbofsuggested = 0; - uasort ( $product->stock_warehouse , function ($a, $b){ + uasort( $product->stock_warehouse, function ($a, $b) { if ($a->real == $b->real) { return 0; } return ($a->real < $b->real) ? -1 : 1; }); @@ -1318,8 +1317,7 @@ if ($action == 'create') { } $tmpwarehouseObject = new Entrepot($db); foreach ($product->stock_warehouse as $warehouse_id => $stock_warehouse) { // $stock_warehouse is product_stock - - if(!empty($warehousePicking) && !in_array($warehouse_id, $warehousePicking)){ + if (!empty($warehousePicking) && !in_array($warehouse_id, $warehousePicking)) { // if a warehouse was selected by user, picking is limited to this warehouse and his children continue; } @@ -1333,11 +1331,10 @@ if ($action == 'create') { print ''; print ''; if ($line->product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { - if(isset($alreadyQtySetted[$line->fk_product][intval($warehouse_id)])){ + if (isset($alreadyQtySetted[$line->fk_product][intval($warehouse_id)])) { $deliverableQty = min($quantityToBeDelivered, $stock - $alreadyQtySetted[$line->fk_product][intval($warehouse_id)]); - } - else{ - if(!isset($alreadyQtySetted[$line->fk_product])){ + } else { + if (!isset($alreadyQtySetted[$line->fk_product])) { $alreadyQtySetted[$line->fk_product] = array(); } @@ -1347,14 +1344,14 @@ if ($action == 'create') { if ($deliverableQty < 0) $deliverableQty = 0; $tooltip = ''; - if(!empty($alreadyQtySetted[$line->fk_product][intval($warehouse_id)])){ + if (!empty($alreadyQtySetted[$line->fk_product][intval($warehouse_id)])) { $tooltip = ' class="classfortooltip" title="'.$langs->trans('StockQuantitiesAlreadyAllocatedOnPreviousLines').' : '.$alreadyQtySetted[$line->fk_product][intval($warehouse_id)].'" '; } $alreadyQtySetted[$line->fk_product][intval($warehouse_id)] = $deliverableQty + $alreadyQtySetted[$line->fk_product][intval($warehouse_id)]; $inputName = 'qtyl'.$indiceAsked.'_'.$subj; - if(GETPOSTISSET($inputName)){ + if (GETPOSTISSET($inputName)) { $deliverableQty = GETPOST($inputName, 'int'); } @@ -1416,7 +1413,7 @@ if ($action == 'create') { $tmpwarehouseObject = new Entrepot($db); $productlotObject = new Productlot($db); - uasort ( $product->stock_warehouse , function ($a, $b){ + uasort( $product->stock_warehouse, function ($a, $b) { if ($a->real == $b->real) { return 0; } return ($a->real < $b->real) ? -1 : 1; }); @@ -1459,17 +1456,15 @@ if ($action == 'create') { $tmpwarehouseObject->fetch($warehouse_id); if (($stock_warehouse->real > 0) && (count($stock_warehouse->detail_batch))) { foreach ($stock_warehouse->detail_batch as $dbatch) { - $batchStock = + $dbatch->qty; // To get a numeric - if(isset($alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)])){ + if (isset($alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)])) { $deliverableQty = min($quantityToBeDelivered, $batchStock - $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)]); - } - else{ - if(!isset($alreadyQtyBatchSetted[$line->fk_product])){ + } else { + if (!isset($alreadyQtyBatchSetted[$line->fk_product])) { $alreadyQtyBatchSetted[$line->fk_product] = array(); } - if(!isset($alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch])){ + if (!isset($alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch])) { $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch] = array(); } @@ -1479,12 +1474,12 @@ if ($action == 'create') { if ($deliverableQty < 0) $deliverableQty = 0; $inputName = 'qtyl'.$indiceAsked.'_'.$subj; - if(GETPOSTISSET($inputName)){ + if (GETPOSTISSET($inputName)) { $deliverableQty = GETPOST($inputName, 'int'); } $tooltip = ''; - if(!empty($alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)])){ + if (!empty($alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)])) { $tooltip = ' class="classfortooltip" title="'.$langs->trans('StockQuantitiesAlreadyAllocatedOnPreviousLines').' : '.$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)].'" '; } From c91b9d613afc5c72f27b59e554b53a75ed3cc299 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 1 Jun 2021 15:30:17 +0200 Subject: [PATCH 0338/1497] FIX: order supplier stats by category now display figures --- htdocs/commande/class/commandestats.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/commande/class/commandestats.class.php b/htdocs/commande/class/commandestats.class.php index cbb93b940de..7d98c5be996 100644 --- a/htdocs/commande/class/commandestats.class.php +++ b/htdocs/commande/class/commandestats.class.php @@ -78,6 +78,7 @@ class CommandeStats extends Stats $this->field = 'total_ht'; $this->field_line = 'total_ht'; $this->where .= " c.fk_statut > 0"; // Not draft and not cancelled + $this->categ_link=MAIN_DB_PREFIX.'categorie_societe'; } elseif ($mode == 'supplier') { @@ -87,6 +88,7 @@ class CommandeStats extends Stats $this->field = 'total_ht'; $this->field_line = 'total_ht'; $this->where .= " c.fk_statut > 2"; // Only approved & ordered + $this->categ_link=MAIN_DB_PREFIX.'categorie_fournisseur'; } //$this->where.= " AND c.fk_soc = s.rowid AND c.entity = ".$conf->entity; $this->where .= ' AND c.entity IN ('.getEntity('commande').')'; @@ -106,7 +108,7 @@ class CommandeStats extends Stats if ($categid) { - $this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_societe as cats ON cats.fk_soc = c.fk_soc'; + $this->join .= ' LEFT JOIN '.$this->categ_link.' as cats ON cats.fk_soc = c.fk_soc'; $this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie as cat ON cat.rowid = cats.fk_categorie'; $this->where .= ' AND cat.rowid = '.$categid; } From af509742e6a16910f55b9e95e21527dc1726a0b3 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Tue, 1 Jun 2021 16:34:39 +0200 Subject: [PATCH 0339/1497] Fix #17726 : holliday with advanced perms works --- htdocs/holiday/card.php | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index bab0655b4c2..97a70782e36 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -163,19 +163,23 @@ if (empty($reshook)) { $description = trim(GETPOST('description', 'restricthtml')); // Check that leave is for a user inside the hierarchy or advanced permission for all is set - if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->holiday->write)) - || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->id == $fuserid && empty($user->rights->holiday->write)) - || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->id != $fuserid && empty($user->rights->holiday->writeall_advance)) - ) { - $error++; - setEventMessages($langs->trans("NotEnoughPermissions"), null, 'errors'); + if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { + if (empty($user->rights->holiday->write)) { + $error++; + setEventMessages($langs->trans("NotEnoughPermissions"), null, 'errors'); + } elseif (!in_array($fuserid, $childids)) { + $error++; + setEventMessages($langs->trans("UserNotInHierachy"), null, 'errors'); + $action = 'create'; + } } else { - if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || empty($user->rights->holiday->writeall_advance)) { - if (!in_array($fuserid, $childids)) { - $error++; - setEventMessages($langs->trans("UserNotInHierachy"), null, 'errors'); - $action = 'create'; - } + if (empty($user->rights->holiday->write) && empty($user->rights->holiday->writeall_advance)) { + $error++; + setEventMessages($langs->trans("NotEnoughPermissions"), null, 'errors'); + } elseif (empty($user->rights->holiday->writeall_advance) && !in_array($fuserid, $childids)) { + $error++; + setEventMessages($langs->trans("UserNotInHierachy"), null, 'errors'); + $action = 'create'; } } @@ -1136,7 +1140,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') { } // On vérifie si l'utilisateur à le droit de lire cette demande - if ($cancreate) { + if ($canread) { $head = holiday_prepare_head($object); if (($action == 'edit' && $object->statut == Holiday::STATUS_DRAFT) || ($action == 'editvalidator')) { From 49f4de8728a9acc266a9e436eacfd5f8b0b98a53 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 1 Jun 2021 16:57:55 +0200 Subject: [PATCH 0340/1497] Fix massaction on cron --- htdocs/cron/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index 28fa0287f0c..80371b14889 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -202,7 +202,7 @@ if (empty($reshook)) { $permissiontodelete = $user->rights->cron->delete; $uploaddir = $conf->cron->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; - if ($permissiontoadd) { + if ($massaction && $permissiontoadd) { $tmpcron = new Cronjob($db); foreach ($toselect as $id) { $result = $tmpcron->fetch($id); From f13388122cc57b6fd9b4a8863f64a51367a51715 Mon Sep 17 00:00:00 2001 From: ATM john Date: Tue, 1 Jun 2021 21:43:05 +0200 Subject: [PATCH 0341/1497] Add fetch stock order --- htdocs/expedition/card.php | 46 +++------------------ htdocs/product/class/product.class.php | 2 + htdocs/product/class/productbatch.class.php | 8 +++- 3 files changed, 14 insertions(+), 42 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 543a67311f0..ef6c80d20d8 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1305,11 +1305,6 @@ if ($action == 'create') { // Define nb of lines suggested for this order line $nbofsuggested = 0; - uasort( $product->stock_warehouse, function ($a, $b) { - if ($a->real == $b->real) { return 0; } - return ($a->real < $b->real) ? -1 : 1; - }); - foreach ($product->stock_warehouse as $warehouse_id => $stock_warehouse) { if ($stock_warehouse->real > 0) { $nbofsuggested++; @@ -1413,42 +1408,11 @@ if ($action == 'create') { $tmpwarehouseObject = new Entrepot($db); $productlotObject = new Productlot($db); - uasort( $product->stock_warehouse, function ($a, $b) { - if ($a->real == $b->real) { return 0; } - return ($a->real < $b->real) ? -1 : 1; - }); - // Define nb of lines suggested for this order line $nbofsuggested = 0; foreach ($product->stock_warehouse as $warehouse_id => $stock_warehouse) { if (($stock_warehouse->real > 0) && (count($stock_warehouse->detail_batch))) { - foreach ($stock_warehouse->detail_batch as $dbatch) { - $nbofsuggested++; - } - - // Sort Batch priority - uasort($stock_warehouse->detail_batch, function ($a, $b) { - $compare = 0; - $multiplePow = 0; - // The comparison function must return an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second. - - // PRIORITY FOR QTY : Eliminate place with small qty first - $multiplePow++; - $multiple = pow(10, $multiplePow); - $compare += (($a->qty < $b->qty) ? -1 : 1) * $multiple; - - // PRIORITY FOR SELL EXPIRATION DATE - $multiplePow++; - $multiple = pow(10, $multiplePow); - $compare += (($a->sellby < $b->sellby) ? -1 : 1) * $multiple; - - // PRIORITY FOR CONSUMPTION EXPIRATION DATE - $multiplePow++; - $multiple = pow(10, $multiplePow); - $compare += (($a->eatby < $b->eatby) ? -1 : 1) * $multiple; - - return $compare; - }); + $nbofsuggested+=count($stock_warehouse->detail_batch); } } @@ -1478,15 +1442,15 @@ if ($action == 'create') { $deliverableQty = GETPOST($inputName, 'int'); } - $tooltip = ''; + $tooltipClass = $tooltipTitle = ''; if (!empty($alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)])) { - $tooltip = ' class="classfortooltip" title="'.$langs->trans('StockQuantitiesAlreadyAllocatedOnPreviousLines').' : '.$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)].'" '; + $tooltipClass = ' classfortooltip'; + $tooltipTitle = $langs->trans('StockQuantitiesAlreadyAllocatedOnPreviousLines').' : '.$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)]; } - $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = $deliverableQty + $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)]; print ''; - print ''; + print ''; print ''; print ''; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 2ccc5e63c8f..9d8977a2223 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5147,6 +5147,8 @@ class Product extends CommonObject $sql .= " AND w.statut IN (".$this->db->sanitize(implode(',', $warehouseStatus)).")"; } + $sql .= " ORDER BY ps.reel ".(!empty($conf->global->DO_NOT_TRY_TO_DEFRAGMENT_STOCKS_WAREHOUSE)?'DESC':'ASC'); // Note : qty ASC is important for expedition card, to avoid stock fragmentation; + dol_syslog(get_class($this)."::load_stock", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { diff --git a/htdocs/product/class/productbatch.class.php b/htdocs/product/class/productbatch.class.php index 10704f2f53e..7ac2e43740f 100644 --- a/htdocs/product/class/productbatch.class.php +++ b/htdocs/product/class/productbatch.class.php @@ -436,7 +436,7 @@ class Productbatch extends CommonObject */ public static function findAll($db, $fk_product_stock, $with_qty = 0, $fk_product = 0) { - global $langs; + global $langs, $conf; $ret = array(); $sql = "SELECT"; @@ -462,6 +462,12 @@ class Productbatch extends CommonObject $sql .= " AND t.qty <> 0"; } + $sql .= " ORDER BY "; + // TODO : use product lifo and fifo when product will implement it + if ($fk_product > 0) { $sql .= "pl.eatby ASC, pl.sellby ASC, "; } + $sql .= "t.eatby ASC, t.sellby ASC "; + $sql .= ", t.qty ".(!empty($conf->global->DO_NOT_TRY_TO_DEFRAGMENT_STOCKS_WAREHOUSE)?'DESC':'ASC'); // Note : qty ASC is important for expedition card, to avoid stock fragmentation + dol_syslog("productbatch::findAll", LOG_DEBUG); $resql = $db->query($sql); if ($resql) { From b5904e49a023354f435858c7060a1d02cf9d3a07 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 1 Jun 2021 22:43:43 +0200 Subject: [PATCH 0342/1497] NEW Add field date from/to in customer payment list --- htdocs/compta/paiement/list.php | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index 1e99cf8676f..eb6d50712c5 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -56,11 +56,10 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'p $facid = GETPOST('facid', 'int'); $socid = GETPOST('socid', 'int'); $userid = GETPOST('userid', 'int'); -$day = GETPOST('day', 'int'); -$month = GETPOST('month', 'int'); -$year = GETPOST('year', 'int'); $search_ref = GETPOST("search_ref", "alpha"); +$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int')); +$search_date_end = dol_mktime(23, 59, 59, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int')); $search_company = GETPOST("search_company", 'alpha'); $search_paymenttype = GETPOST("search_paymenttype"); $search_account = GETPOST("search_account", "int"); @@ -130,14 +129,13 @@ if (empty($reshook)) { // All tests are required to be compatible with all browsers if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { $search_ref = ''; + $search_date_start = ''; + $search_date_end = ''; $search_account = ''; $search_amount = ''; $search_paymenttype = ''; $search_payment_num = ''; $search_company = ''; - $day = ''; - $year = ''; - $month = ''; $option = ''; $toselect = ''; $search_array_options = array(); @@ -211,10 +209,15 @@ if (GETPOST("orphelins", "alpha")) { } // Search criteria - $sql .= dolSqlDateFilter("p.datep", $day, $month, $year); if ($search_ref) { $sql .= natural_search('p.ref', $search_ref); } + if ($search_date_start) { + $sql .= " AND p.datep >= '" . $db->idate($search_date_start) . "'"; + } + if ($search_date_end) { + $sql .= " AND p.datep <= '" . $db->idate($search_date_end) . "'"; + } if ($search_account > 0) { $sql .= " AND b.fk_account=".((int) $search_account); } @@ -275,6 +278,8 @@ if ($limit > 0 && $limit != $conf->liste_limit) { } $param .= (GETPOST("orphelins") ? "&orphelins=1" : ''); $param .= ($search_ref ? "&search_ref=".urlencode($search_ref) : ''); +$param .= ($search_date_start ? "&search_date_start=".urlencode($search_date_start) : ''); +$param .= ($search_date_end ? "&search_date_end=".urlencode($search_date_end) : ''); $param .= ($search_company ? "&search_company=".urlencode($search_company) : ''); $param .= ($search_amount ? "&search_amount=".urlencode($search_amount) : ''); $param .= ($search_payment_num ? "&search_payment_num=".urlencode($search_payment_num) : ''); @@ -331,11 +336,14 @@ if (!empty($arrayfields['p.ref']['checked'])) { // Filter: Date if (!empty($arrayfields['p.datep']['checked'])) { print ''; - if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) { - print ''; - } - print ''; - $formother->select_year($year ? $year : -1, 'year', 1, 20, 5); + print '
    '; + print $langs->trans('From') . ' '; + print $form->selectDate($search_date_start?$search_date_start:-1, 'search_date_start', 0, 0, 1); + print '
    '; + print '
    '; + print $langs->trans('to') . ' '; + print $form->selectDate($search_date_end?$search_date_end:-1, 'search_date_end', 0, 0, 1); + print '
    '; print ''; } From 3744ccdd286b8e33968031248884f331cbefd133 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 1 Jun 2021 22:50:55 +0200 Subject: [PATCH 0343/1497] Look & feel v14 --- htdocs/compta/paiement/list.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index eb6d50712c5..c06f8ee9cb5 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -337,12 +337,10 @@ if (!empty($arrayfields['p.ref']['checked'])) { if (!empty($arrayfields['p.datep']['checked'])) { print ''; print '
    '; - print $langs->trans('From') . ' '; - print $form->selectDate($search_date_start?$search_date_start:-1, 'search_date_start', 0, 0, 1); + print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); print '
    '; print '
    '; - print $langs->trans('to') . ' '; - print $form->selectDate($search_date_end?$search_date_end:-1, 'search_date_end', 0, 0, 1); + print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); print '
    '; print ''; } From c35124f036d75ab99dbf9a2d76abfbe4f24f2d74 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 1 Jun 2021 23:23:00 +0200 Subject: [PATCH 0344/1497] NEW Add field date from/to in supplier payment list --- htdocs/fourn/paiement/list.php | 41 ++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/htdocs/fourn/paiement/list.php b/htdocs/fourn/paiement/list.php index 6a38ae2033d..6b932ae2019 100644 --- a/htdocs/fourn/paiement/list.php +++ b/htdocs/fourn/paiement/list.php @@ -36,6 +36,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; // Load translation files required by the page $langs->loadLangs(array('companies', 'bills', 'banks', 'compta')); @@ -48,9 +49,8 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 've $socid = GETPOST('socid', 'int'); $search_ref = GETPOST('search_ref', 'alpha'); -$search_day = GETPOST('search_day', 'int'); -$search_month = GETPOST('search_month', 'int'); -$search_year = GETPOST('search_year', 'int'); +$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int')); +$search_date_end = dol_mktime(23, 59, 59, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int')); $search_company = GETPOST('search_company', 'alpha'); $search_payment_type = GETPOST('search_payment_type'); $search_cheque_num = GETPOST('search_cheque_num', 'alpha'); @@ -135,9 +135,8 @@ if (empty($reshook)) { if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers $search_ref = ''; - $search_day = ''; - $search_month = ''; - $search_year = ''; + $search_date_start = ''; + $search_date_end = ''; $search_company = ''; $search_payment_type = ''; $search_cheque_num = ''; @@ -187,7 +186,13 @@ if ($socid > 0) { if ($search_ref) { $sql .= natural_search('p.ref', $search_ref); } -$sql .= dolSqlDateFilter('p.datep', $search_day, $search_month, $search_year); +if ($search_date_start) { + $sql .= " AND p.datep >= '" . $db->idate($search_date_start) . "'"; +} +if ($search_date_end) { + $sql .=" AND p.datep <= '" . $db->idate($search_date_end) . "'"; +} + if ($search_company) { $sql .= natural_search('s.nom', $search_company); } @@ -254,14 +259,11 @@ if ($optioncss != '') { if ($search_ref) { $param .= '&search_ref='.urlencode($search_ref); } -if ($saerch_day) { - $param .= '&search_day='.urlencode($search_day); +if ($search_date_start) { + $param.= '&search_date_start='.urlencode($search_date_start); } -if ($saerch_month) { - $param .= '&search_month='.urlencode($search_month); -} -if ($search_year) { - $param .= '&search_year='.urlencode($search_year); +if ($search_date_end) { + $param.= '&search_date_end='.urlencode($search_date_end); } if ($search_company) { $param .= '&search_company='.urlencode($search_company); @@ -336,11 +338,12 @@ if (!empty($arrayfields['p.ref']['checked'])) { // Filter: Date if (!empty($arrayfields['p.datep']['checked'])) { print ''; - if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) { - print ''; - } - print ''; - $formother->select_year($search_year ? $search_year : -1, 'search_year', 1, 20, 5); + print '
    '; + print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); + print '
    '; + print '
    '; + print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); + print '
    '; print ''; } From bda42403b259550a30003cc0053d830dda862cee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Jun 2021 04:15:21 +0200 Subject: [PATCH 0345/1497] FIX Creation of reception (missing extrafields). Lose data if error. --- htdocs/reception/card.php | 84 ++++++++++++++++++++++++--------------- 1 file changed, 52 insertions(+), 32 deletions(-) diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 75f5401d401..493a400c891 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -72,7 +72,7 @@ if (!empty($conf->productbatch->enabled)) { } $origin = GETPOST('origin', 'alpha') ?GETPOST('origin', 'alpha') : 'reception'; // Example: commande, propal -$origin_id = GETPOST('id', 'int') ?GETPOST('id', 'int') : ''; +$origin_id = GETPOST('id', 'int') ? GETPOST('id', 'int') : ''; $id = $origin_id; if (empty($origin_id)) { $origin_id = GETPOST('origin_id', 'int'); // Id of order or propal @@ -86,12 +86,12 @@ if (empty($origin_id)) { $ref = GETPOST('ref', 'alpha'); $line_id = GETPOST('lineid', 'int') ?GETPOST('lineid', 'int') : ''; -$action = GETPOST('action', 'alpha'); +$action = GETPOST('action', 'alpha'); //Select mail models is same action as presend if (GETPOST('modelselected')) { $action = 'presend'; } -$confirm = GETPOST('confirm', 'alpha'); +$confirm = GETPOST('confirm', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); //PDF @@ -117,7 +117,6 @@ $permissiondellink = $user->rights->reception->creer; // Used by the include of $date_delivery = dol_mktime(GETPOST('date_deliveryhour', 'int'), GETPOST('date_deliverymin', 'int'), 0, GETPOST('date_deliverymonth', 'int'), GETPOST('date_deliveryday', 'int'), GETPOST('date_deliveryyear', 'int')); -$object = new Reception($db); if ($id > 0 || !empty($ref)) { $object->fetch($id, $ref); $object->fetch_thirdparty(); @@ -725,13 +724,13 @@ if ($action == 'create') { $classname = ucfirst($origin); } - $object = new $classname($db); - if ($object->fetch($origin_id)) { // This include the fetch_lines + $objectsrc = new $classname($db); + if ($objectsrc->fetch($origin_id)) { // This include the fetch_lines $soc = new Societe($db); - $soc->fetch($object->socid); + $soc->fetch($objectsrc->socid); $author = new User($db); - $author->fetch($object->user_author_id); + $author->fetch($objectsrc->user_author_id); if (!empty($conf->stock->enabled)) { $entrepot = new Entrepot($db); @@ -741,8 +740,7 @@ if ($action == 'create') { print ''; print ''; print ''; - print ''; - print ''; + print ''; if (GETPOST('entrepot_id', 'int')) { print ''; } @@ -754,10 +752,10 @@ if ($action == 'create') { // Ref print ''; if ($origin == 'supplierorder' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled))) { - print $langs->trans("RefOrder").''.img_object($langs->trans("ShowOrder"), 'order').' '.$object->ref; + print $langs->trans("RefOrder").''.img_object($langs->trans("ShowOrder"), 'order').' '.$objectsrc->ref; } if ($origin == 'propal' && !empty($conf->propal->enabled)) { - print $langs->trans("RefProposal").''.img_object($langs->trans("ShowProposal"), 'propal').' '.$object->ref; + print $langs->trans("RefProposal").''.img_object($langs->trans("ShowProposal"), 'propal').' '.$objectsrc->ref; } print ''; print "\n"; @@ -770,7 +768,7 @@ if ($action == 'create') { print $langs->trans('RefSupplier'); } print ''; - print ''; + print ''; print ''; print ''; @@ -782,8 +780,8 @@ if ($action == 'create') { // Project if (!empty($conf->projet->enabled)) { $projectid = GETPOST('projectid', 'int') ?GETPOST('projectid', 'int') : 0; - if (empty($projectid) && !empty($object->fk_project)) { - $projectid = $object->fk_project; + if (empty($projectid) && !empty($objectsrc->fk_project)) { + $projectid = $objectsrc->fk_project; } if ($origin == 'project') { $projectid = ($originid ? $originid : 0); @@ -802,7 +800,7 @@ if ($action == 'create') { // Date delivery planned print ''.$langs->trans("DateDeliveryPlanned").''; print ''; - $date_delivery = ($date_delivery ? $date_delivery : $object->delivery_date); // $date_delivery comes from GETPOST + $date_delivery = ($date_delivery ? $date_delivery : $objectsrc->delivery_date); // $date_delivery comes from GETPOST print $form->selectDate($date_delivery ? $date_delivery : -1, 'date_delivery', 1, 1, 1); print "\n"; print ''; @@ -810,15 +808,15 @@ if ($action == 'create') { // Note Public print ''.$langs->trans("NotePublic").''; print ''; - $doleditor = new DolEditor('note_public', $object->note_public, '', 60, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC) ? 0 : 1, ROWS_3, '90%'); + $doleditor = new DolEditor('note_public', $objectsrc->note_public, '', 60, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC) ? 0 : 1, ROWS_3, '90%'); print $doleditor->Create(1); print ""; // Note Private - if ($object->note_private && !$user->socid) { + if ($objectsrc->note_private && !$user->socid) { print ''.$langs->trans("NotePrivate").''; print ''; - $doleditor = new DolEditor('note_private', $object->note_private, '', 60, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE) ? 0 : 1, ROWS_3, '90%'); + $doleditor = new DolEditor('note_private', $objectsrc->note_private, '', 60, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE) ? 0 : 1, ROWS_3, '90%'); print $doleditor->Create(1); print ""; } @@ -861,15 +859,15 @@ if ($action == 'create') { // Other attributes $parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"', 'cols' => '3', 'socid'=>$socid); - $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $recept, $action); // Note that $action and $object may have been modified by hook + $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $recept, $action); // Note that $action and $objectsrc may have been modified by hook print $hookmanager->resPrint; - // Here $object can be of an object Order + // Here $object can be of an object Reception $extrafields->fetch_name_optionals_label($object->table_element); if (empty($reshook) && !empty($extrafields->attributes[$object->table_element]['label'])) { // copy from order - if ($object->fetch_optionals() > 0) { - $recept->array_options = array_merge($recept->array_options, $object->array_options); + if ($objectsrc->fetch_optionals() > 0) { + $recept->array_options = array_merge($recept->array_options, $objectsrc->array_options); } print $object->showOptionals($extrafields, 'edit', $parameters); } @@ -877,9 +875,9 @@ if ($action == 'create') { // Incoterms if (!empty($conf->incoterm->enabled)) { print ''; - print ''; + print ''; print ''; - print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : '')); + print $form->select_incoterms((!empty($objectsrc->fk_incoterms) ? $objectsrc->fk_incoterms : ''), (!empty($objectsrc->location_incoterms) ? $objectsrc->location_incoterms : '')); print ''; } @@ -898,12 +896,14 @@ if ($action == 'create') { print dol_get_fiche_end(); - // Reception lines $numAsked = 0; $dispatchLines = array(); foreach ($_POST as $key => $value) { + // If create form is coming from the button "Create Reception" of previous page + // without batch module enabled + $reg = array(); if (preg_match('/^product_([0-9]+)_([0-9]+)$/i', $key, $reg)) { $numAsked++; @@ -934,6 +934,25 @@ if ($action == 'create') { $fk_commandefourndet = 'fk_commandefourndet_'.$reg[1].'_'.$reg[2]; $dispatchLines[$numAsked] = array('prod' => GETPOST($prod, 'int'), 'qty' =>GETPOST($qty), 'ent' =>GETPOST($ent, 'int'), 'pu' =>GETPOST($pu), 'comment' =>GETPOST('comment'), 'fk_commandefourndet' => GETPOST($fk_commandefourndet, 'int'), 'DLC'=> $dDLC, 'DLUO'=> $dDLUO, 'lot'=> GETPOST($lot, 'alpha')); } + + // If create form is coming from same page post was sent but an error occured + if (preg_match('/^productid([0-9]+)$/i', $key, $reg)) { + $numAsked++; + + // eat-by date dispatch + // $numline=$reg[2] + 1; // line of product + $numline = $numAsked; + $prod = 'productid'.$reg[1]; + $comment = 'comment'.$reg[1]; + $qty = 'qtyl'.$reg[1]; + $ent = 'entl'.$reg[1]; + $pu = 'pul'.$reg[1]; + $lot = 'batch'.$reg[1]; + $dDLUO = dol_mktime(12, 0, 0, GETPOST('dluo'.$reg[1].'month', 'int'), GETPOST('dluo'.$reg[1].'day', 'int'), GETPOST('dluo'.$reg[1].'year', 'int')); + $dDLC = dol_mktime(12, 0, 0, GETPOST('dlc'.$reg[1].'month', 'int'), GETPOST('dlc'.$reg[1].'day', 'int'), GETPOST('dlc'.$reg[1].'year', 'int')); + $fk_commandefourndet = 'fk_commandefournisseurdet'.$reg[1]; + $dispatchLines[$numAsked] = array('prod' => GETPOST($prod, 'int'), 'qty' =>GETPOST($qty), 'ent' =>GETPOST($ent, 'int'), 'pu' =>GETPOST($pu), 'comment' =>GETPOST($comment), 'fk_commandefourndet' => GETPOST($fk_commandefourndet, 'int'), 'DLC'=> $dDLC, 'DLUO'=> $dDLUO, 'lot'=> GETPOST($lot, 'alpha')); + } } @@ -961,7 +980,7 @@ if ($action == 'create') { print ''; // Load receptions already done for same order - $object->loadReceptions(); + $objectsrc->loadReceptions(); if ($numAsked) { print ''; @@ -993,14 +1012,13 @@ if ($action == 'create') { $indiceAsked = 1; while ($indiceAsked <= $numAsked) { $product = new Product($db); - foreach ($object->lines as $supplierLine) { + foreach ($objectsrc->lines as $supplierLine) { if ($dispatchLines[$indiceAsked]['fk_commandefourndet'] == $supplierLine->id) { $line = $supplierLine; break; } } - // Show product and description $type = $line->product_type ? $line->product_type : $line->fk_product_type; // Try to enhance type detection using date_start and date_end for free lines where type @@ -1012,7 +1030,7 @@ if ($action == 'create') { $type = 1; } - print ''."\n"; + print ''."\n"; print ''."\n"; @@ -1024,6 +1042,7 @@ if ($action == 'create') { print ''; @@ -1075,13 +1094,14 @@ if ($action == 'create') { // Qty print ''; $qtyProdCom = $line->qty; // Qty already received print ''; From 5a260865dc32c90c573c3b2889bbfee0e50d555b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Jun 2021 04:15:21 +0200 Subject: [PATCH 0346/1497] FIX Creation of reception (missing extrafields). Lose data if error. Conflicts: htdocs/reception/card.php --- htdocs/reception/card.php | 105 ++++++++++++++++++++++---------------- 1 file changed, 60 insertions(+), 45 deletions(-) diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 18aa08b0d85..8b49f143176 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -62,7 +62,7 @@ if (!empty($conf->incoterm->enabled)) $langs->load('incoterm'); if (!empty($conf->productbatch->enabled)) $langs->load('productbatch'); $origin = GETPOST('origin', 'alpha') ?GETPOST('origin', 'alpha') : 'reception'; // Example: commande, propal -$origin_id = GETPOST('id', 'int') ?GETPOST('id', 'int') : ''; +$origin_id = GETPOST('id', 'int') ? GETPOST('id', 'int') : ''; $id = $origin_id; if (empty($origin_id)) $origin_id = GETPOST('origin_id', 'int'); // Id of order or propal if (empty($origin_id)) $origin_id = GETPOST('object_id', 'int'); // Id of order or propal @@ -87,7 +87,7 @@ $action = GETPOST('action', 'alpha'); if (GETPOST('modelselected')) { $action = 'presend'; } -$confirm = GETPOST('confirm', 'alpha'); +$confirm = GETPOST('confirm', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); //PDF @@ -707,14 +707,13 @@ if ($action == 'create') if ($origin == 'supplierorder')$classname = 'CommandeFournisseur'; else $classname = ucfirst($origin); - $object = new $classname($db); - if ($object->fetch($origin_id)) // This include the fetch_lines - { + $objectsrc = new $classname($db); + if ($objectsrc->fetch($origin_id)) { // This include the fetch_lines $soc = new Societe($db); - $soc->fetch($object->socid); + $soc->fetch($objectsrc->socid); $author = new User($db); - $author->fetch($object->user_author_id); + $author->fetch($objectsrc->user_author_id); if (!empty($conf->stock->enabled)) $entrepot = new Entrepot($db); @@ -722,10 +721,8 @@ if ($action == 'create') print ''; print ''; print ''; - print ''; - print ''; - if (GETPOST('entrepot_id', 'int')) - { + print ''; + if (GETPOST('entrepot_id', 'int')) { print ''; } @@ -735,13 +732,11 @@ if ($action == 'create') // Ref print ''; print "\n"; @@ -751,7 +746,7 @@ if ($action == 'create') if ($origin == 'supplier_order') print $langs->trans('SupplierOrder'); else print $langs->trans('RefSupplier'); print ''; print ''; @@ -764,8 +759,12 @@ if ($action == 'create') if (!empty($conf->projet->enabled)) { $projectid = GETPOST('projectid', 'int') ?GETPOST('projectid', 'int') : 0; - if (empty($projectid) && !empty($object->fk_project)) $projectid = $object->fk_project; - if ($origin == 'project') $projectid = ($originid ? $originid : 0); + if (empty($projectid) && !empty($objectsrc->fk_project)) { + $projectid = $objectsrc->fk_project; + } + if ($origin == 'project') { + $projectid = ($originid ? $originid : 0); + } $langs->load("projects"); print ''; @@ -779,7 +778,7 @@ if ($action == 'create') // Date delivery planned print ''; print '\n"; print ''; @@ -787,16 +786,15 @@ if ($action == 'create') // Note Public print ''; print '"; // Note Private - if ($object->note_private && !$user->socid) - { + if ($objectsrc->note_private && !$user->socid) { print ''; print '"; } @@ -837,15 +835,15 @@ if ($action == 'create') // Other attributes $parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"', 'cols' => '3', 'socid'=>$socid); - $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $recept, $action); // Note that $action and $object may have been modified by hook + $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $recept, $action); // Note that $action and $objectsrc may have been modified by hook print $hookmanager->resPrint; - // Here $object can be of an object Order + // Here $object can be of an object Reception $extrafields->fetch_name_optionals_label($object->table_element); if (empty($reshook) && !empty($extrafields->attributes[$object->table_element]['label'])) { // copy from order - if ($object->fetch_optionals() > 0) { - $recept->array_options = array_merge($recept->array_options, $object->array_options); + if ($objectsrc->fetch_optionals() > 0) { + $recept->array_options = array_merge($recept->array_options, $objectsrc->array_options); } print $object->showOptionals($extrafields, 'edit', $parameters); } @@ -854,9 +852,9 @@ if ($action == 'create') if (!empty($conf->incoterm->enabled)) { print ''; - print ''; + print ''; print ''; } @@ -876,15 +874,15 @@ if ($action == 'create') print dol_get_fiche_end(); - // Reception lines $numAsked = 0; $dispatchLines = array(); - foreach ($_POST as $key => $value) - { + foreach ($_POST as $key => $value) { + // If create form is coming from the button "Create Reception" of previous page + // without batch module enabled - if (preg_match('/^product_([0-9]+)_([0-9]+)$/i', $key, $reg)) - { + $reg = array(); + if (preg_match('/^product_([0-9]+)_([0-9]+)$/i', $key, $reg)) { $numAsked++; // $numline=$reg[2] + 1; // line of product @@ -915,6 +913,25 @@ if ($action == 'create') $fk_commandefourndet = 'fk_commandefourndet_'.$reg[1].'_'.$reg[2]; $dispatchLines[$numAsked] = array('prod' => GETPOST($prod, 'int'), 'qty' =>GETPOST($qty), 'ent' =>GETPOST($ent, 'int'), 'pu' =>GETPOST($pu), 'comment' =>GETPOST('comment'), 'fk_commandefourndet' => GETPOST($fk_commandefourndet, 'int'), 'DLC'=> $dDLC, 'DLUO'=> $dDLUO, 'lot'=> GETPOST($lot, 'alpha')); } + + // If create form is coming from same page post was sent but an error occured + if (preg_match('/^productid([0-9]+)$/i', $key, $reg)) { + $numAsked++; + + // eat-by date dispatch + // $numline=$reg[2] + 1; // line of product + $numline = $numAsked; + $prod = 'productid'.$reg[1]; + $comment = 'comment'.$reg[1]; + $qty = 'qtyl'.$reg[1]; + $ent = 'entl'.$reg[1]; + $pu = 'pul'.$reg[1]; + $lot = 'batch'.$reg[1]; + $dDLUO = dol_mktime(12, 0, 0, GETPOST('dluo'.$reg[1].'month', 'int'), GETPOST('dluo'.$reg[1].'day', 'int'), GETPOST('dluo'.$reg[1].'year', 'int')); + $dDLC = dol_mktime(12, 0, 0, GETPOST('dlc'.$reg[1].'month', 'int'), GETPOST('dlc'.$reg[1].'day', 'int'), GETPOST('dlc'.$reg[1].'year', 'int')); + $fk_commandefourndet = 'fk_commandefournisseurdet'.$reg[1]; + $dispatchLines[$numAsked] = array('prod' => GETPOST($prod, 'int'), 'qty' =>GETPOST($qty), 'ent' =>GETPOST($ent, 'int'), 'pu' =>GETPOST($pu), 'comment' =>GETPOST($comment), 'fk_commandefourndet' => GETPOST($fk_commandefourndet, 'int'), 'DLC'=> $dDLC, 'DLUO'=> $dDLUO, 'lot'=> GETPOST($lot, 'alpha')); + } } @@ -944,7 +961,7 @@ if ($action == 'create') print '
    '; print ''; // ancre pour retourner sur la ligne + print ''; // Show product and description $product_static->type = $line->fk_product_type; @@ -1067,7 +1086,7 @@ if ($action == 'create') { // Comment //$defaultcomment = 'Line create from order line id '.$line->id; - $defaultcomment = ''; + $defaultcomment = $dispatchLines[$indiceAsked]['comment']; print ''; print ''; print ''.$line->qty; print ''; + print ''; print ''; print ''; - $quantityDelivered = $object->receptions[$line->id]; + $quantityDelivered = $objectsrc->receptions[$line->id]; print $quantityDelivered; print ''; print '
    '; - if ($origin == 'supplierorder' && !empty($conf->fournisseur->enabled)) - { - print $langs->trans("RefOrder").''.img_object($langs->trans("ShowOrder"), 'order').' '.$object->ref; + if ($origin == 'supplierorder' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled))) { + print $langs->trans("RefOrder").''.img_object($langs->trans("ShowOrder"), 'order').' '.$objectsrc->ref; } - if ($origin == 'propal' && !empty($conf->propal->enabled)) - { - print $langs->trans("RefProposal").''.img_object($langs->trans("ShowProposal"), 'propal').' '.$object->ref; + if ($origin == 'propal' && !empty($conf->propal->enabled)) { + print $langs->trans("RefProposal").''.img_object($langs->trans("ShowProposal"), 'propal').' '.$objectsrc->ref; } print '
    '; - print ''; + print ''; print '
    '.$langs->trans("DateDeliveryPlanned").''; - $date_delivery = ($date_delivery ? $date_delivery : $object->delivery_date); // $date_delivery comes from GETPOST + $date_delivery = ($date_delivery ? $date_delivery : $objectsrc->delivery_date); // $date_delivery comes from GETPOST print $form->selectDate($date_delivery ? $date_delivery : -1, 'date_delivery', 1, 1, 1); print "
    '.$langs->trans("NotePublic").''; - $doleditor = new DolEditor('note_public', $object->note_public, '', 60, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%'); + $doleditor = new DolEditor('note_public', $objectsrc->note_public, '', 60, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC) ? 0 : 1, ROWS_3, '90%'); print $doleditor->Create(1); print "
    '.$langs->trans("NotePrivate").''; - $doleditor = new DolEditor('note_private', $object->note_private, '', 60, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%'); + $doleditor = new DolEditor('note_private', $objectsrc->note_private, '', 60, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE) ? 0 : 1, ROWS_3, '90%'); print $doleditor->Create(1); print "
    '; - print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : '')); + print $form->select_incoterms((!empty($objectsrc->fk_incoterms) ? $objectsrc->fk_incoterms : ''), (!empty($objectsrc->location_incoterms) ? $objectsrc->location_incoterms : '')); print '
    '; // Load receptions already done for same order - $object->loadReceptions(); + $objectsrc->loadReceptions(); if ($numAsked) { @@ -980,14 +997,13 @@ if ($action == 'create') while ($indiceAsked <= $numAsked) { $product = new Product($db); - foreach ($object->lines as $supplierLine) { + foreach ($objectsrc->lines as $supplierLine) { if ($dispatchLines[$indiceAsked]['fk_commandefourndet'] == $supplierLine->id) { $line = $supplierLine; break; } } - // Show product and description $type = $line->product_type ? $line->product_type : $line->fk_product_type; // Try to enhance type detection using date_start and date_end for free lines where type @@ -995,7 +1011,7 @@ if ($action == 'create') if (!empty($line->date_start)) $type = 1; if (!empty($line->date_end)) $type = 1; - print ''."\n"; + print ''."\n"; print ''."\n"; @@ -1008,6 +1024,7 @@ if ($action == 'create') print ''; $qtyProdCom = $line->qty; // Qty already received print ''; From 33a4c98dc3b2ecc134fdda48a0ed15a3f1d7a69c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Jun 2021 04:33:35 +0200 Subject: [PATCH 0347/1497] Fix popup --- htdocs/reception/card.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 8b49f143176..8a4d5edc611 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -1027,10 +1027,7 @@ if ($action == 'create') print ''; // Show product and description - $product_static->type = $line->fk_product_type; - $product_static->id = $line->fk_product; - $product_static->ref = $line->ref; - $product_static->status_batch = $line->product_tobatch; + $product_static = $product; $text = $product_static->getNomUrl(1); $text .= ' - '.(!empty($line->label) ? $line->label : $line->product_label); From 68579f9cda31df18f0d61789da37c96a06e0d0ef Mon Sep 17 00:00:00 2001 From: Christian Foellmann Date: Wed, 2 Jun 2021 08:17:34 +0200 Subject: [PATCH 0348/1497] fix html linebreak --- .../core/triggers/interface_50_modAgenda_ActionsAuto.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index 3c7c8cb6e1c..8e23c258d88 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -552,7 +552,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg = $langs->transnoentities("OrderRefusedInDolibarr", $object->ref); if (!empty($object->refuse_note)) { - $object->actionmsg .= '
    '; + $object->actionmsg .= '
    '; $object->actionmsg .= $langs->trans("Reason") . ': '.$object->refuse_note; } From 6d049f5c2e018603ec04219fa4586f544952ce60 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Wed, 2 Jun 2021 09:31:04 +0200 Subject: [PATCH 0349/1497] Fix #17791 : Error when loading chart of accounts --- .../mysql/data/llx_accounting_account_es.sql | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/install/mysql/data/llx_accounting_account_es.sql b/htdocs/install/mysql/data/llx_accounting_account_es.sql index b3301de496f..c3d194fab2a 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_es.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_es.sql @@ -42,7 +42,7 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, acc INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4008, 'PCG08-PYME','CAPIT', '10', '4001', 'CAPITAL', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4009, 'PCG08-PYME','CAPIT', '100', '4008', 'Capital social', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4010, 'PCG08-PYME','CAPIT', '101', '4008', 'Fondo social', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4011, 'PCG08-PYME','CAPIT', 'CAPITAL', '102', '4008', 'Capital', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4011, 'PCG08-PYME','CAPIT', '102', '4008', 'Capital', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4012, 'PCG08-PYME','CAPIT', '103', '4008', 'Socios por desembolsos no exigidos', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4013, 'PCG08-PYME','CAPIT', '1030', '4012', 'Socios por desembolsos no exigidos capital social', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4014, 'PCG08-PYME','CAPIT', '1034', '4012', 'Socios por desembolsos no exigidos capital pendiente de inscripción', 1); @@ -291,8 +291,8 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, acc INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4257, 'PCG08-PYME','EXISTENCIAS', '394', '4252', 'Deterioro de valor de los productos semiterminados', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4258, 'PCG08-PYME','EXISTENCIAS', '395', '4252', 'Deterioro de valor de los productos terminados', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4259, 'PCG08-PYME','EXISTENCIAS', '396', '4252', 'Deterioro de valor de los subproductos, residuos y materiales recuperados', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4260, 'PCG08-PYME','ACREEDORES_DEUDORES', 'PROVEEDORES', '40', '4004', 'Proveedores', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4261, 'PCG08-PYME','ACREEDORES_DEUDORES', 'PROVEEDORES', '400', '4260', 'Proveedores', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4260, 'PCG08-PYME','ACREEDORES_DEUDORES', '40', '4004', 'Proveedores', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4261, 'PCG08-PYME','ACREEDORES_DEUDORES', '400', '4260', 'Proveedores', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4262, 'PCG08-PYME','ACREEDORES_DEUDORES', '4000', '4261', 'Proveedores euros', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4263, 'PCG08-PYME','ACREEDORES_DEUDORES', '4004', '4261', 'Proveedores moneda extranjera', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4264, 'PCG08-PYME','ACREEDORES_DEUDORES', '4009', '4261', 'Proveedores facturas pendientes de recibir o formalizar', 1); @@ -314,8 +314,8 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, acc INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4280, 'PCG08-PYME','ACREEDORES_DEUDORES', '4109', '4277', 'Acreedores por prestaciones de servicios facturas pendientes de recibir o formalizar', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4281, 'PCG08-PYME','ACREEDORES_DEUDORES', '411', '4276', 'Acreedores efectos comerciales a pagar', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4282, 'PCG08-PYME','ACREEDORES_DEUDORES', '419', '4276', 'Acreedores por operaciones en común', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4283, 'PCG08-PYME','ACREEDORES_DEUDORES', 'CLIENTES', '43', '4004', 'Clientes', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4284, 'PCG08-PYME','ACREEDORES_DEUDORES', 'CLIENTES', '430', '4283', 'Clientes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4283, 'PCG08-PYME','ACREEDORES_DEUDORES', '43', '4004', 'Clientes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4284, 'PCG08-PYME','ACREEDORES_DEUDORES', '430', '4283', 'Clientes', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4285, 'PCG08-PYME','ACREEDORES_DEUDORES', '4300', '4284', 'Clientes euros', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4286, 'PCG08-PYME','ACREEDORES_DEUDORES', '4304', '4284', 'Clientes moneda extranjera', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4287, 'PCG08-PYME','ACREEDORES_DEUDORES', '4309', '4284', 'Clientes facturas pendientes de formalizar', 1); @@ -501,9 +501,9 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, acc INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4467, 'PCG08-PYME','FINAN', '567', '4462', 'Intereses pagados por anticipado', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4468, 'PCG08-PYME','FINAN', '568', '4462', 'Intereses cobrados a corto plazo', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4469, 'PCG08-PYME','FINAN', '57', '4005', 'Tesorería', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4470, 'PCG08-PYME','FINAN', 'CAJA', '570', '4469', 'Caja euros', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4470, 'PCG08-PYME','FINAN', '570', '4469', 'Caja euros', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4471, 'PCG08-PYME','FINAN', '571', '4469', 'Caja moneda extranjera', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4472, 'PCG08-PYME','FINAN', 'BANCOS', '572', '4469', 'Bancos e instituciones de crédito cc vista euros', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4472, 'PCG08-PYME','FINAN', '572', '4469', 'Bancos e instituciones de crédito cc vista euros', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4473, 'PCG08-PYME','FINAN', '573', '4469', 'Bancos e instituciones de crédito cc vista moneda extranjera', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4474, 'PCG08-PYME','FINAN', '574', '4469', 'Bancos e instituciones de crédito cuentas de ahorro euros', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4475, 'PCG08-PYME','FINAN', '575', '4469', 'Bancos e instituciones de crédito cuentas de ahorro moneda extranjera', 1); From f875bcfe09be360570096a8b610396a4574a3b09 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Wed, 2 Jun 2021 10:30:48 +0200 Subject: [PATCH 0350/1497] update ->nom field if different from ->name --- htdocs/user/class/usergroup.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index 20ac35b370f..b271eec5754 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -675,7 +675,7 @@ class UserGroup extends CommonObject { global $user, $conf; - if (empty($this->nom) && !empty($this->name)) { + if ((empty($this->nom) || $this->nom != $this->name) && !empty($this->name)) { $this->nom = $this->name; } From 89f6b66c2a8e091163a4bd8ecfe101117acbe2b0 Mon Sep 17 00:00:00 2001 From: Quentin VIAL-GOUTEYRON Date: Wed, 2 Jun 2021 10:32:30 +0200 Subject: [PATCH 0351/1497] wrong join, request too long --- htdocs/compta/stats/cabyprodserv.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index 485a6088338..46908ac6b75 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -232,7 +232,7 @@ if ($modecompta == 'CREANCES-DETTES') if ($selected_cat === -2) { // Without any category $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product"; } elseif ($selected_cat) { // Into a specific category - $sql .= ", ".MAIN_DB_PREFIX."categorie as c, ".MAIN_DB_PREFIX."categorie_product as cp"; + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON (cp.fk_product = p.rowid) INNER JOIN ".MAIN_DB_PREFIX."categorie as c ON (cp.fk_categorie = c.rowid)"; } $sql .= " WHERE l.fk_facture = f.rowid"; $sql .= " AND f.fk_statut in (1,2)"; From b8b30a9af6f6d3647e862c51e6eedf73698a383b Mon Sep 17 00:00:00 2001 From: Quentin VIAL-GOUTEYRON Date: Wed, 2 Jun 2021 10:53:04 +0200 Subject: [PATCH 0352/1497] wrong where cabyprodserv --- htdocs/compta/stats/cabyprodserv.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index 46908ac6b75..7b8f1101004 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -263,11 +263,11 @@ if ($modecompta == 'CREANCES-DETTES') } } - $sql .= " AND (p.rowid IN "; - $sql .= " (SELECT fk_product FROM ".MAIN_DB_PREFIX."categorie_product cp WHERE "; + $sql .= " AND "; + if ($subcat) $sql .= "cp.fk_categorie IN (".$listofcatsql.")"; else $sql .= "cp.fk_categorie = ".$selected_cat; - $sql .= "))"; + } if ($selected_soc > 0) $sql .= " AND soc.rowid=".$selected_soc; $sql .= " AND f.entity IN (".getEntity('invoice').")"; From de1be814d5ff2cd60c7994579c73962c839872e9 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 2 Jun 2021 09:23:50 +0000 Subject: [PATCH 0353/1497] Fixing style errors. --- htdocs/compta/stats/cabyprodserv.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index 7b8f1101004..3b00832c1a3 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -267,7 +267,6 @@ if ($modecompta == 'CREANCES-DETTES') if ($subcat) $sql .= "cp.fk_categorie IN (".$listofcatsql.")"; else $sql .= "cp.fk_categorie = ".$selected_cat; - } if ($selected_soc > 0) $sql .= " AND soc.rowid=".$selected_soc; $sql .= " AND f.entity IN (".getEntity('invoice').")"; From 3aca9bdb9e62973d0f3217589c5d6d8384cb7f48 Mon Sep 17 00:00:00 2001 From: ATM john Date: Wed, 2 Jun 2021 12:02:27 +0200 Subject: [PATCH 0354/1497] Fix warehouse id --- htdocs/expedition/card.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 264089ac48a..a4597fee291 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -2211,7 +2211,8 @@ if ($action == 'create') // only show lot numbers from src warehouse when shipping from multiple warehouses $line->fetch($detail_batch->fk_expeditiondet); } - print '
    '; + $entrepot_id = !empty($detail_batch->entrepot_id)?$detail_batch->entrepot_id:$lines[$i]->entrepot_id; + print ''; print ''; } // add a 0 qty lot row to be able to add a lot From a4d213a0c9e115c94876f471ad6c751db145957a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Jun 2021 12:29:05 +0200 Subject: [PATCH 0355/1497] Update doc --- README-FR.md | 20 ++++++++++++++++---- README.md | 5 +++-- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/README-FR.md b/README-FR.md index 77bb5a3e27a..81fdff13047 100644 --- a/README-FR.md +++ b/README-FR.md @@ -8,10 +8,12 @@ Il est simple d'utilisation et modulaire, vous permettant de n'activez que les f ![ScreenShot](https://www.dolibarr.org/medias/dolibarr_screenshot1_1920x1080.jpg) + ## LICENCE Dolibarr est distribué sous les termes de la licence GNU General Public License v3+ ou supérieure. + ## INSTALLER DOLIBARR ### Configuration simple @@ -52,6 +54,7 @@ Vous pouvez aussi utiliser un serveur Web et une base de données prise en charg - Suivez les instructions de l'installateur + ## METTRE A JOUR DOLIBARR Pour mettre à jour Dolibarr depuis une vieille version vers celle ci: @@ -64,9 +67,11 @@ Pour mettre à jour Dolibarr depuis une vieille version vers celle ci: *Note: Le processus de migration peut être lancé manuellement et plusieurs fois, sans risque, en appelant la page /install/* + ## CE QUI EST NOUVEAU -Voir fichier ChangeLog. +See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) file. + ## CE QUE DOLIBARR PEUT FAIRE @@ -82,15 +87,17 @@ Voir fichier ChangeLog. - Calendrier/Agenda partagé (avec export ical, vcal) - Suivi des opportunités et/ou projets (suivi de rentabilité incluant les factures, notes de frais, temps consommé valorisé, ...) - Gestion de contrats de services -- Gestion de stock +- Gestion de stock et inventaires - Gestion des expéditions - Gestion des demandes de congès - Gestion des notes de frais +- Gestion de recrutement - GED (Gestion Electronique de Documents) - EMailings de masse - Réalisation de sondages +- Gestion d'adhérents - Point de vente/Caisse enregistreuse -- … +- … (près de 100 modules disponibles en standard, près de 1000 autre sur la place de marché d'extensions) ### Autres modules @@ -135,31 +142,36 @@ Voir fichier ChangeLog. Dolibarr peut aussi être étendu à volonté avec l'ajout de module/applications externes développées par des développeus tiers, disponible sur [DoliStore](https://www.dolistore.com). + ## CE QUE DOLIBARR NE PEUT PAS (ENCORE) FAIRE Voici un liste de fonctionnalités pas encore gérées par Dolibarr: -- Dolibarr ne contient pas de module de Gestion de la paie. +- Dolibarr ne contient pas de module de génération de feuille de paie. - Les tâches du module de gestion de projets n'ont pas de dépendances entre elle. - Dolibarr n'embarque pas de Webmail intégré nativement. - Dolibarr ne fait pas le café (pas encore). + ## DOCUMENTATION La documentation utilisateur, développeur et traducteur est disponible sous forme de ressources de la communauté via le site [Wiki](https://wiki.dolibarr.org). + ## CONTRIBUER Ce projet existe grâce à ses nombreux contributeurs [[Contribuer](https://github.com/Dolibarr/dolibarr/blob/develop/.github/CONTRIBUTING.md)]. + ## CREDITS Dolibarr est le résultat du travail de nombreux contributeurs depuis des années et utilise des librairies d'autres contributeurs. Voir le fichier [COPYRIGHT](https://github.com/Dolibarr/dolibarr/blob/develop/COPYRIGHT) + ## ACTUALITES ET RESEAUX SOCIAUX Suivez le projet Dolibarr project sur les réseaux francophones diff --git a/README.md b/README.md index 0a3aeecb9f4..531a19e0be9 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) - Customer & Supplier Orders management - Invoices and payment management - Shipping management -- Warehouse/Stock management +- Warehouse/Stock management/Inventory - Manufacturing Orders - Bank accounts management - Direct debit orders management (European SEPA) @@ -117,11 +117,12 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) - Interventions management - Employee's leave requests management - Expense reports +- Recruitment management - Timesheets - Electronic Document Management (EDM) - Foundations members management - Point of Sale (POS) -- … +- … (around 100 modules available by default, + 1000 on the addon market place) ### Other application/modules From b5680a91d0cfc7699cd8dffc79f48136f26172ec Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Jun 2021 13:03:20 +0200 Subject: [PATCH 0356/1497] css --- htdocs/user/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/user/list.php b/htdocs/user/list.php index 693590ff7d2..ba737dfbc62 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -933,13 +933,13 @@ while ($i < ($limit ? min($num, $limit) : $num)) { } if (!empty($arrayfields['u.office_phone']['checked'])) { - print "\n"; + print '\n"; if (!$i) { $totalarray['nbfield']++; } } if (!empty($arrayfields['u.user_mobile']['checked'])) { - print "\n"; + print '\n"; if (!$i) { $totalarray['nbfield']++; } From db5bcd1b99a8bd4e4043d7bb0cb06cb86e9a0d10 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Jun 2021 13:41:08 +0200 Subject: [PATCH 0357/1497] Fix css --- htdocs/user/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/list.php b/htdocs/user/list.php index ba737dfbc62..bd82824cb05 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -992,7 +992,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { // Salary if (!empty($arrayfields['u.salary']['checked'])) { - print ''; + print ''; if (!$i) { $totalarray['nbfield']++; } From 431691cec4a4d4bf879e5366de218adbd6a3b35d Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Wed, 2 Jun 2021 15:18:45 +0200 Subject: [PATCH 0358/1497] Fix propal/index.php error on thirdparty display --- htdocs/comm/propal/index.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index 359084ddabe..3973071d1f0 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -150,7 +150,7 @@ print '
    '; */ $sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, date_cloture as datec"; -$sql .= ", s.nom as socname, s.rowid as socid, s.canvas, s.client"; +$sql .= ", s.nom as socname, s.rowid as socid, s.canvas, s.client, s.email, s.code_compta"; $sql .= " FROM ".MAIN_DB_PREFIX."propal as c"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$socid) { @@ -185,6 +185,8 @@ if ($resql) { $companystatic->name = $obj->socname; $companystatic->client = $obj->client; $companystatic->canvas = $obj->canvas; + $companystatic->email = $obj->email; + $companystatic->code_compta = $obj->code_compta; $filename = dol_sanitizeFileName($obj->ref); $filedir = $conf->propal->multidir_output[$obj->entity].'/'.dol_sanitizeFileName($obj->ref); @@ -223,7 +225,7 @@ if ($resql) { * Open (validated) proposals */ if (!empty($conf->propal->enabled) && $user->rights->propale->lire) { - $sql = "SELECT s.nom as socname, s.rowid as socid, s.canvas, s.client"; + $sql = "SELECT s.nom as socname, s.rowid as socid, s.canvas, s.client, s.email, s.code_compta"; $sql .= ", p.rowid as propalid, p.entity, p.total_ttc, p.total_ht, p.ref, p.fk_statut, p.datep as dp, p.fin_validite as dfv"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= ", ".MAIN_DB_PREFIX."propal as p"; @@ -260,6 +262,8 @@ if (!empty($conf->propal->enabled) && $user->rights->propale->lire) { $companystatic->name = $obj->socname; $companystatic->client = $obj->client; $companystatic->canvas = $obj->canvas; + $companystatic->email = $obj->email; + $companystatic->code_compta = $obj->code_compta; $filename = dol_sanitizeFileName($obj->ref); $filedir = $conf->propal->multidir_output[$obj->entity].'/'.dol_sanitizeFileName($obj->ref); From da7d821a3e18fa283cf79abe1d6a660c41b131dc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Jun 2021 15:32:39 +0200 Subject: [PATCH 0359/1497] css --- htdocs/holiday/month_report.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/holiday/month_report.php b/htdocs/holiday/month_report.php index 62991a6e0ee..966dd7e8dee 100644 --- a/htdocs/holiday/month_report.php +++ b/htdocs/holiday/month_report.php @@ -413,7 +413,7 @@ if ($num == 0) { print '
    '; } if (!empty($arrayfields['cp.description']['checked'])) { - print ''; + print ''; } print ''; From 1468761073884ccc039a2fdbc25e01051712343b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Jun 2021 16:29:38 +0200 Subject: [PATCH 0360/1497] Fix select --- htdocs/holiday/month_report.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/htdocs/holiday/month_report.php b/htdocs/holiday/month_report.php index b83d957b27f..922c313840b 100644 --- a/htdocs/holiday/month_report.php +++ b/htdocs/holiday/month_report.php @@ -138,13 +138,21 @@ $sql .= " FROM ".MAIN_DB_PREFIX."holiday cp"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user u ON cp.fk_user = u.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_holiday_types ct ON cp.fk_type = ct.rowid"; $sql .= " WHERE cp.rowid > 0"; -$sql .= " AND cp.statut = 3"; // 3 = Approved +$sql .= " AND cp.statut = ".Holiday::STATUS_APPROVED; $sql .= " AND (date_format(cp.date_debut, '%Y-%m') = '".$db->escape($year_month)."' OR date_format(cp.date_fin, '%Y-%m') = '".$db->escape($year_month)."')"; -if (!empty($search_ref)) $sql .= natural_search('cp.ref', $search_ref); -if (!empty($search_employee)) $sql .= " AND cp.fk_user = '".$db->escape($search_employee)."'"; -if (!empty($search_type)) $sql .= ' AND cp.fk_type IN ('.$db->escape($search_type).')'; -if (!empty($search_description)) $sql .= natural_search('cp.description', $search_description); +if (!empty($search_ref)) { + $sql .= natural_search('cp.ref', $search_ref); +} +if (!empty($search_employee) && $search_employee > 0) { + $sql .= " AND cp.fk_user = ".((int) $search_employee); +} +if (!empty($search_type) && $search_type != '-1') { + $sql .= ' AND cp.fk_type IN ('.$db->escape($search_type).')'; +} +if (!empty($search_description)) { + $sql .= natural_search('cp.description', $search_description); +} $sql .= $db->order($sortfield, $sortorder); From 38423ba2600303665faf18626f2a89c0f6e93504 Mon Sep 17 00:00:00 2001 From: ATM john Date: Wed, 2 Jun 2021 16:31:31 +0200 Subject: [PATCH 0361/1497] Fix wrong hook context --- htdocs/product/stock/stockatdate.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/stockatdate.php b/htdocs/product/stock/stockatdate.php index 91159984a35..8d355e5c1dc 100644 --- a/htdocs/product/stock/stockatdate.php +++ b/htdocs/product/stock/stockatdate.php @@ -45,7 +45,7 @@ if ($user->socid) { $result = restrictedArea($user, 'produit|service'); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array('stockreplenishlist')); +$hookmanager->initHooks(array('stockatdate')); //checks if a product has been ordered From e46faacac1d99c8a82eee26a0bcee616e3347936 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Wed, 2 Jun 2021 18:11:47 +0200 Subject: [PATCH 0362/1497] FIX : Add process payment with online link order --- htdocs/public/payment/paymentok.php | 101 ++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index f4b9f0feb5b..5f8f90ba72b 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -721,6 +721,107 @@ if ($ispaymentok) $postactionmessages[] = 'Invoice paid '.$tmptag['INV'].' was not found'; $ispostactionok = -1; } + } elseif (array_key_exists('ORD', $tmptag) && $tmptag['ORD'] > 0) { + // Record payment + include_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php'; + $object = new Commande($db); + $result = $object->fetch($tmptag['ORD']); + if ($result) { + $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"]; + + $paymentTypeId = 0; + if ($paymentmethod == 'paybox') $paymentTypeId = $conf->global->PAYBOX_PAYMENT_MODE_FOR_PAYMENTS; + if ($paymentmethod == 'paypal') $paymentTypeId = $conf->global->PAYPAL_PAYMENT_MODE_FOR_PAYMENTS; + if ($paymentmethod == 'stripe') $paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS; + if (empty($paymentTypeId)) { + $paymentType = $_SESSION["paymentType"]; + if (empty($paymentType)) $paymentType = 'CB'; + $paymentTypeId = dol_getIdFromCode($db, $paymentType, 'c_paiement', 'code', 'id', 1); + } + + $currencyCodeType = $_SESSION['currencyCodeType']; + + // Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time) + if (!empty($FinalPaymentAmt) && $paymentTypeId > 0) { + include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; + $invoice = new Facture($db); + $result = $invoice->createFromOrder($object, $user); + if ($result > 0) { + $object->classifyBilled($user); + $invoice->validate($user); + // Creation of payment line + include_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php'; + $paiement = new Paiement($db); + $paiement->datepaye = $now; + if ($currencyCodeType == $conf->currency) { + $paiement->amounts = array($invoice->id => $FinalPaymentAmt); // Array with all payments dispatching with invoice id + } else { + $paiement->multicurrency_amounts = array($invoice->id => $FinalPaymentAmt); // Array with all payments dispatching + + $postactionmessages[] = 'Payment was done in a different currency that currency expected of company'; + $ispostactionok = -1; + $error++; // Not yet supported + } + $paiement->paiementid = $paymentTypeId; + $paiement->num_payment = ''; + $paiement->note_public = 'Online payment ' . dol_print_date($now, 'standard') . ' from ' . $ipaddress; + $paiement->ext_payment_id = $TRANSACTIONID; + $paiement->ext_payment_site = $service; + + if (!$error) { + $paiement_id = $paiement->create($user, 1); // This include closing invoices and regenerating documents + if ($paiement_id < 0) { + $postactionmessages[] = $paiement->error . ' ' . join("
    \n", $paiement->errors); + $ispostactionok = -1; + $error++; + } else { + $postactionmessages[] = 'Payment created'; + $ispostactionok = 1; + } + } + + if (!$error && !empty($conf->banque->enabled)) { + $bankaccountid = 0; + if ($paymentmethod == 'paybox') $bankaccountid = $conf->global->PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS; + elseif ($paymentmethod == 'paypal') $bankaccountid = $conf->global->PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS; + elseif ($paymentmethod == 'stripe') $bankaccountid = $conf->global->STRIPE_BANK_ACCOUNT_FOR_PAYMENTS; + + if ($bankaccountid > 0) { + $label = '(CustomerInvoicePayment)'; + if ($object->type == Facture::TYPE_CREDIT_NOTE) $label = '(CustomerInvoicePaymentBack)'; // Refund of a credit note + $result = $paiement->addPaymentToBank($user, 'payment', $label, $bankaccountid, '', ''); + if ($result < 0) { + $postactionmessages[] = $paiement->error . ' ' . join("
    \n", $paiement->errors); + $ispostactionok = -1; + $error++; + } else { + $postactionmessages[] = 'Bank transaction of payment created'; + $ispostactionok = 1; + } + } else { + $postactionmessages[] = 'Setup of bank account to use in module ' . $paymentmethod . ' was not set. No way to record the payment.'; + $ispostactionok = -1; + $error++; + } + } + + if (!$error) { + $db->commit(); + } else { + $db->rollback(); + } + } else { + $postactionmessages[] = 'Failed to create invoice form order ' . $tmptag['ORD'] . '.'; + $ispostactionok = -1; + } + } else { + $postactionmessages[] = 'Failed to get a valid value for "amount paid" (' . $FinalPaymentAmt . ') or "payment type" (' . $paymentType . ') to record the payment of order ' . $tmptag['ORD'] . '. May be payment was already recorded.'; + $ispostactionok = -1; + } + } else { + $postactionmessages[] = 'Order paid ' . $tmptag['ORD'] . ' was not found'; + $ispostactionok = -1; + } } else { // Nothing done } From 456356ded7ac9b5271fe3d6b2e63e1fb2e818979 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Jun 2021 18:45:48 +0200 Subject: [PATCH 0363/1497] Fix migration --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index c9736e429c4..25a6a6b09e8 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -67,6 +67,13 @@ INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUE INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 154, 'SAT/24-2019', 'Catalogo y codigo agrupador fiscal del 2019', 1); +UPDATE llx_const set value = __ENCRYPT('eldy')__ WHERE __DECRYPT('value')__ = 'auguria'; +UPDATE llx_const set value = __ENCRYPT('eldy')__ WHERE __DECRYPT('value')__ = 'bureau2crea'; +UPDATE llx_const set value = __ENCRYPT('eldy')__ WHERE __DECRYPT('value')__ = 'amarok'; +UPDATE llx_const set value = __ENCRYPT('eldy')__ WHERE __DECRYPT('value')__ = 'cameleo'; +DELETE FROM llx_user_param where param = 'MAIN_THEME' and value in ('auguria', 'amarok', 'cameleo'); + + -- For v14 ALTER TABLE llx_product_lot ADD COLUMN eol_date datetime NULL; From ef032f9fa0f27eafaa8007fa7a8c4ed04857811a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 3 Jun 2021 08:33:44 +0200 Subject: [PATCH 0364/1497] fix warning --- htdocs/core/lib/project.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index ffa06ebd508..9c33744ceb0 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -2693,6 +2693,7 @@ function getTaskProgressView($task, $label = true, $progressNumber = true, $hide // define progress color according to time spend vs workload $progressBarClass = 'progress-bar-info'; + $progressCalculated = 0; if ($task->planned_workload) { $progressCalculated = round(100 * floatval($task->duration_effective) / floatval($task->planned_workload), 2); From c3d58ad044cbeb5e39979ff5963e624c4ec3b60a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 3 Jun 2021 08:36:50 +0200 Subject: [PATCH 0365/1497] fix warning --- htdocs/user/group/list.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/user/group/list.php b/htdocs/user/group/list.php index edd34dfe9b8..302d697c563 100644 --- a/htdocs/user/group/list.php +++ b/htdocs/user/group/list.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2018 Laurent Destailleur * Copyright (C) 2005-2018 Regis Houssin * Copyright (C) 2011 Herve Prot - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2021 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -34,6 +34,7 @@ $langs->load("users"); $sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); $search_group = GETPOST('search_group'); $optioncss = GETPOST('optioncss', 'alpha'); +$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) // Defini si peux lire/modifier utilisateurs et permisssions $caneditperms = ($user->admin || $user->rights->user->user->creer); From aa1ade5224f0925ff5c9b4188b46278edbbe7509 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Thu, 3 Jun 2021 09:13:48 +0200 Subject: [PATCH 0366/1497] Fix #17791 : fix for SKR03 --- .../mysql/data/llx_accounting_account_de.sql | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/htdocs/install/mysql/data/llx_accounting_account_de.sql b/htdocs/install/mysql/data/llx_accounting_account_de.sql index ddb0ab18356..d1b6b00f800 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_de.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_de.sql @@ -2725,20 +2725,20 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, acc INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3852, 'SKR04', 'Anlagevermögen', 170, 0, 'Geleistete Anzahlungen auf immaterielle Vermögensgegenstände'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3853, 'SKR04', 'Anlagevermögen', 179, 0, 'Anzahlungen auf Geschäfts- oder Firmenwert'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3854, 'SKR04', 'Anlagevermögen', 200, 0, 'Grundstücke, grundstücksgleiche Rechte und Bauten einschließlich der Bauten auf fremden Grundstück'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3855, 'SKR04', 'Anlagevermögen', 210, 3854, Grundstücksgleiche Rechte ohne Bauten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3856, 'SKR04', 'Anlagevermögen', 215, 3854, Unbebaute Grundstücke'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3857, 'SKR04', 'Anlagevermögen', 220, 3854, Grundstücksgleiche Rechte (Erbbaurecht, Dauerwohnrecht, unbebaute Grundstücke)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3858, 'SKR04', 'Anlagevermögen', 225, 3854, Grundstücke mit Substanzverkehr'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3859, 'SKR04', 'Anlagevermögen', 229, 3854, Grundstücksanteil des häuslichen Arbeitszimmers'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3860, 'SKR04', 'Anlagevermögen', 230, 3854, Bauten auf eigenen Grundstücken und grundstücksgleichen Rechten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3861, 'SKR04', 'Anlagevermögen', 235, 3854, Grundstückswerte eigener bebauter Grundstücke'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3862, 'SKR04', 'Anlagevermögen', 240, 3854, Geschäftsbauten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3863, 'SKR04', 'Anlagevermögen', 250, 3854, Fabrikbauten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3864, 'SKR04', 'Anlagevermögen', 260, 3854, Andere Bauten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3865, 'SKR04', 'Anlagevermögen', 270, 3854, Garagen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3866, 'SKR04', 'Anlagevermögen', 280, 3854, Außenanlagen für Geschäfts-, Fabrik- und andere Bauten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3867, 'SKR04', 'Anlagevermögen', 285, 3854, Hof- und Wegbefestigungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3868, 'SKR04', 'Anlagevermögen', 290, 3854, Einrichtungen für Geschäfts-. Fabrik- und andere Bauten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3855, 'SKR04', 'Anlagevermögen', 210, 3854, 'Grundstücksgleiche Rechte ohne Bauten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3856, 'SKR04', 'Anlagevermögen', 215, 3854,'Unbebaute Grundstücke'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3857, 'SKR04', 'Anlagevermögen', 220, 3854, 'Grundstücksgleiche Rechte (Erbbaurecht, Dauerwohnrecht, unbebaute Grundstücke)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3858, 'SKR04', 'Anlagevermögen', 225, 3854, 'Grundstücke mit Substanzverkehr'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3859, 'SKR04', 'Anlagevermögen', 229, 3854, 'Grundstücksanteil des häuslichen Arbeitszimmers'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3860, 'SKR04', 'Anlagevermögen', 230, 3854, 'Bauten auf eigenen Grundstücken und grundstücksgleichen Rechten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3861, 'SKR04', 'Anlagevermögen', 235, 3854, 'Grundstückswerte eigener bebauter Grundstücke'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3862, 'SKR04', 'Anlagevermögen', 240, 3854, 'Geschäftsbauten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3863, 'SKR04', 'Anlagevermögen', 250, 3854, 'Fabrikbauten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3864, 'SKR04', 'Anlagevermögen', 260, 3854, 'Andere Bauten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3865, 'SKR04', 'Anlagevermögen', 270, 3854, 'Garagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3866, 'SKR04', 'Anlagevermögen', 280, 3854, 'Außenanlagen für Geschäfts-, Fabrik- und andere Bauten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3867, 'SKR04', 'Anlagevermögen', 285, 3854, 'Hof- und Wegbefestigungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3868, 'SKR04', 'Anlagevermögen', 290, 3854, 'Einrichtungen für Geschäfts-. Fabrik- und andere Bauten'); --INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3869, 'SKR04', 'Anlagevermögen', 300, 3854, Wohnbauten'); --INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3870, 'SKR04', 'Anlagevermögen', 305, 3854, Garagen'); --INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3871, 'SKR04', 'Anlagevermögen', 310, 3854, Außenanlagen'); From 583acfbad4c18c8ba748485c584f24678521bed9 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Thu, 3 Jun 2021 09:29:12 +0200 Subject: [PATCH 0367/1497] Fix #17791 : fix at account --- htdocs/accountancy/admin/account.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 6f510ad3706..ba5bb2105d2 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -165,7 +165,7 @@ if (empty($reshook)) { } $offsetforchartofaccount += ($conf->entity * 100000000); - $result = run_sql($sqlfile, 1, $conf->entity, 1, '', 'default', 32768, 0, $offsetforchartofaccount); + $result = run_sql($sqlfile, 0, $conf->entity, 1, '', 'default', 32768, 0, $offsetforchartofaccount); if ($result > 0) { setEventMessages($langs->trans("ChartLoaded"), null, 'mesgs'); From 8f7daf7f5719355c7f6a928e637fc45da568eb9e Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Thu, 3 Jun 2021 09:32:58 +0200 Subject: [PATCH 0368/1497] Fix 17791 : fix for at account --- htdocs/accountancy/admin/account.php | 2 +- .../mysql/data/llx_accounting_account_at.sql | 642 +++++++++--------- 2 files changed, 322 insertions(+), 322 deletions(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index ba5bb2105d2..6f510ad3706 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -165,7 +165,7 @@ if (empty($reshook)) { } $offsetforchartofaccount += ($conf->entity * 100000000); - $result = run_sql($sqlfile, 0, $conf->entity, 1, '', 'default', 32768, 0, $offsetforchartofaccount); + $result = run_sql($sqlfile, 1, $conf->entity, 1, '', 'default', 32768, 0, $offsetforchartofaccount); if ($result > 0) { setEventMessages($langs->trans("ChartLoaded"), null, 'mesgs'); diff --git a/htdocs/install/mysql/data/llx_accounting_account_at.sql b/htdocs/install/mysql/data/llx_accounting_account_at.sql index c20d5877dc2..402e6893e6b 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_at.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_at.sql @@ -22,324 +22,324 @@ -- Descriptif des plans comptables autrichiens standard -- ADD 4100000 to rowid # Do no remove this comment -- -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1, 'AT-BASE','0','GROUP0','110','0','Patentrechte'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2, 'AT-BASE','0','GROUP0','120','0','Software'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3, 'AT-BASE','0','GROUP0','121','0','ERP System'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 4, 'AT-BASE','0','GROUP0','122','0','Homepage'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 5, 'AT-BASE','0','GROUP0','125','0','Software Fremdentwicklung_noch nicht aktivieren'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 6, 'AT-BASE','0','GROUP0','160','0','Umgründungsmehrwert'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 7, 'AT-BASE','0','GROUP0','250','0','Mieterinvestitionen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 8, 'AT-BASE','0','GROUP0','400','0','Maschinen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 9, 'AT-BASE','0','GROUP0','600','0','Betriebs u. Geschäftsausstattung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 10, 'AT-BASE','0','GROUP0','601','0','Ausstellungsstücke'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 11, 'AT-BASE','0','GROUP0','602','0','Leihstellungsstücke'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 12, 'AT-BASE','0','GROUP0','603','0','Getriebeprüfstand_hinten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 13, 'AT-BASE','0','GROUP0','604','0','Wuchtstand_links_AQ'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 14, 'AT-BASE','0','GROUP0','605','0','Messlabor(Messraum)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 15, 'AT-BASE','0','GROUP0','606','0','PAK-System'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 16, 'AT-BASE','0','GROUP0','607','0','Server'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 17, 'AT-BASE','0','GROUP0','608','0','EDV-Ausstattung (Hardware)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 18, 'AT-BASE','0','GROUP0','609','0','Werkstattausstattung (Werkzeug)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 19, 'AT-BASE','0','GROUP0','610','0','Wuchtprüfstand neu_noch nicht in Betrieb genommen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 20, 'AT-BASE','0','GROUP0','611','0','Messequipment/Ausstattung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 21, 'AT-BASE','0','GROUP0','630','0','PKW'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 22, 'AT-BASE','0','GROUP0','640','0','LKW'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 23, 'AT-BASE','0','GROUP0','680','0','GWG-Geschäftsausstattung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 24, 'AT-BASE','0','GROUP0','710','0','Anlagen in Bau'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 25, 'AT-BASE','1','GROUP1','1100','0','Rohstoffe'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 26, 'AT-BASE','1','GROUP1','1200','0','Bezogenen Teile'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 27, 'AT-BASE','1','GROUP1','1300','0','Hilfsstoffe und Betriebsstoffe'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 28, 'AT-BASE','1','GROUP1','1400','0','fertige Erzeugnisse'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 29, 'AT-BASE','1','GROUP1','1500','0','unfertige Erzeugnisse'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 30, 'AT-BASE','1','GROUP1','1600','0','Waren'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 31, 'AT-BASE','1','GROUP1','1700','0','Noch nicht abrechenbare Leist.'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 32, 'AT-BASE','1','GROUP1','1701','0','Bestandsveränderung laufend'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 33, 'AT-BASE','1','GROUP1','1800','0','Vorrat Verpackungsmaterial'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 34, 'AT-BASE','1','GROUP1','1810','0','Vorrat Werbematerial'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 35, 'AT-BASE','2','GROUP2','2000','0','Lieferforderungen Inland I'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 36, 'AT-BASE','2','GROUP2','2080','0','Einzelwertb. Ford. Inland'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 37, 'AT-BASE','2','GROUP2','2292','0','geleistete Anzahlungen (20%)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 38, 'AT-BASE','2','GROUP2','2293','0','gel. Anzahlungen i.g.'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 39, 'AT-BASE','2','GROUP2','2301','0','Forderung Forschungsprämie'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 40, 'AT-BASE','2','GROUP2','2302','0','Forderungen gelieferte (noch nicht fakturierte Waren)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 41, 'AT-BASE','2','GROUP2','2303','0','Vorauszahlung Leasing Server'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 42, 'AT-BASE','2','GROUP2','2306','0','Kaution Pfauengarten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 43, 'AT-BASE','2','GROUP2','2307','0','Kaution Werkstatt'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 44, 'AT-BASE','2','GROUP2','2308','0','Kaution Parkplatz PKW'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 45, 'AT-BASE','2','GROUP2','2309','0','Kaution Werkstatt'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 46, 'AT-BASE','2','GROUP2','2310','0','Kaution Studentenwohnheim'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 47, 'AT-BASE','2','GROUP2','2311','0','Kaution China'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 48, 'AT-BASE','2','GROUP2','2312','0','Vorauszahlung Xerox'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 49, 'AT-BASE','2','GROUP2','2313','0','Verrechnung Bildungsscheck'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 50, 'AT-BASE','2','GROUP2','2315','0','Aktivierung Körperschaftsteuer'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 51, 'AT-BASE','2','GROUP2','2500','0','Vorsteuer'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 52, 'AT-BASE','2','GROUP2','2501','0','Vorsteuer aus i. g. Erwerb'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 53, 'AT-BASE','2','GROUP2','2502','0','Vorsteuer reverse charge syst.'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 54, 'AT-BASE','2','GROUP2','2503','0','Vorsteuer Reverse Charge § 19/1d'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 55, 'AT-BASE','2','GROUP2','2508','0','Vorsteuer sonstige Leistungen EU'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 56, 'AT-BASE','2','GROUP2','2509','0','EUSt Forderung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 57, 'AT-BASE','2','GROUP2','2510','0','Einfuhrumsatzsteuer'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 58, 'AT-BASE','2','GROUP2','2531','0','Vorsteuer Frankreich'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 59, 'AT-BASE','2','GROUP2','2532','0','Vorsteuer Niederlande'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 60, 'AT-BASE','2','GROUP2','2533','0','Vorsteuer GB'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 61, 'AT-BASE','2','GROUP2','2534','0','Vorsteuer Belgien'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 62, 'AT-BASE','2','GROUP2','2535','0','Vorsteuer GB'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 63, 'AT-BASE','2','GROUP2','2901','0','Leasingvorauszahlung Vito'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 64, 'AT-BASE','3','GROUP3','3020','0','Rückstellung für Körperschaftsteuer'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 65, 'AT-BASE','3','GROUP3','3060','0','Rst. für Beratungskosten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 66, 'AT-BASE','3','GROUP3','3064','0','Rst. für Sonderzahlungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 67, 'AT-BASE','3','GROUP3','3072','0','Rst. für nicht konsum. Urlaube'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 68, 'AT-BASE','3','GROUP3','3214','0','Raika 40-00.800.185'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 69, 'AT-BASE','3','GROUP3','3286','0','Darlehen Dipl. Ing. REICH GMBH'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 70, 'AT-BASE','3','GROUP3','3287','0','Darlehen Dr.Höfler'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 71, 'AT-BASE','3','GROUP3','3288','0','Darlehen DI Mayrhofer'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 72, 'AT-BASE','3','GROUP3','3289','0','Darlehen AWS'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 73, 'AT-BASE','3','GROUP3','3292','0','Anzahlungen von Kunden 20 %'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 74, 'AT-BASE','3','GROUP3','3294','0','Anzahlungen von Kunden Drittland'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 75, 'AT-BASE','3','GROUP3','3300','0','Lieferverbindlichkeiten I'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 76, 'AT-BASE','3','GROUP3','3481','0','Verrechnungskto DI Mayrhofer'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 77, 'AT-BASE','3','GROUP3','3500','0','Umsatzsteuer'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 78, 'AT-BASE','3','GROUP3','3501','0','Umsatzsteuer aus i. g. Erwerb'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 79, 'AT-BASE','3','GROUP3','3502','0','USt § 19/Art 19 (reverse Charge)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 80, 'AT-BASE','3','GROUP3','3503','0','Umsatzsteuer Reverse Charge § 19/1d'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 81, 'AT-BASE','3','GROUP3','3508','0','Umsatzsteuer sonstige Leistung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 82, 'AT-BASE','3','GROUP3','3531','0','FA-Zahllast Dezember'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 83, 'AT-BASE','3','GROUP3','3533','0','Umsatzsteuer 2012'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 84, 'AT-BASE','3','GROUP3','3535','0','Umsatzsteuer 2013'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 85, 'AT-BASE','3','GROUP3','3536','0','Umsatzsteuer 2014'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 86, 'AT-BASE','3','GROUP3','3537','0','Umsatzsteuer 2015'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 87, 'AT-BASE','3','GROUP3','3632','0','Verrechnungskonto EUSt'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 88, 'AT-BASE','3','GROUP3','3892','0','Verbindlichkeiten Anzahlungsrechn.'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 89, 'AT-BASE','3','GROUP3','3898','0','Abgrenzung Sonderzahlungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 90, 'AT-BASE','4','GROUP4','4000','0','Erlöse Lieferungen 20 %'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 91, 'AT-BASE','4','GROUP4','4001','0','Erlöse i.g. Lieferung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 92, 'AT-BASE','4','GROUP4','4002','0','Erlöse Dienstleistungen EU'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 93, 'AT-BASE','4','GROUP4','4003','0','Erlöse Dienstleistungen 20 %'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 94, 'AT-BASE','4','GROUP4','4004','0','Erlöse Software 20 %'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 95, 'AT-BASE','4','GROUP4','4005','0','Erlöse Software EU'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 96, 'AT-BASE','4','GROUP4','4006','0','Evidenz Kfd. Reverse Charge'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 97, 'AT-BASE','4','GROUP4','4050','0','Erlöse 0 % Drittland'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 98, 'AT-BASE','4','GROUP4','4051','0','Erlöse Dienstleistungen Drittland'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 99, 'AT-BASE','4','GROUP4','4052','0','Erlöse Software Drittland'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 100, 'AT-BASE','4','GROUP4','4069','0','Erlöse § 19/1d Schrott'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 101, 'AT-BASE','4','GROUP4','4400','0','Kundenskonto 20 %'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 102, 'AT-BASE','4','GROUP4','4405','0','Kundenskonto 0 % Ausfuhrlieferungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 103, 'AT-BASE','4','GROUP4','4410','0','Skontoaufwand i.g. Lieferung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 104, 'AT-BASE','4','GROUP4','4413','0','Kundenskonto sonstige Leistung EU'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 105, 'AT-BASE','4','GROUP4','4420','0','Kundenskonto EU-Land A x %'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 106, 'AT-BASE','4','GROUP4','4450','0','Kundenrabatt 20%'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 107, 'AT-BASE','4','GROUP4','4500','0','Bestandsveränderungen fertige Erzeugnisse'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 108, 'AT-BASE','4','GROUP4','4510','0','Best.Veränd.Halbf.Erzeugnisse'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 109, 'AT-BASE','4','GROUP4','4519','0','Bestandsveränderung laufend'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 110, 'AT-BASE','4','GROUP4','4520','0','Best.Veränd.n.n.abger.Leist.'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 111, 'AT-BASE','4','GROUP4','4530','0','Gelieferte (noch nicht fakturierte Waren)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 112, 'AT-BASE','4','GROUP4','4580','0','Aktivierte Eigenleistung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 113, 'AT-BASE','4','GROUP4','4630','0','Erträge aus d.Abgang v.Anlagen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 114, 'AT-BASE','4','GROUP4','4801','0','Zuwendungen a.öffentl. Mitteln'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 115, 'AT-BASE','4','GROUP4','4831','0','sonstige betriebliche Erträge (nicht steuerbar)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 116, 'AT-BASE','4','GROUP4','4840','0','Sonstige Erlöse 20 %'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 117, 'AT-BASE','4','GROUP4','4850','0','Erl. Aufwandersätze'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 118, 'AT-BASE','4','GROUP4','4881','0','Versicherungsvergütungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 119, 'AT-BASE','4','GROUP4','4885','0','Zuschreibungen zum Umlaufvermögen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 120, 'AT-BASE','4','GROUP4','4950','0','Privatanteil 20 %'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 121, 'AT-BASE','4','GROUP4','4991','0','Sachbezüge 20%'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 122, 'AT-BASE','5','GROUP5','5000','0','Handelswareneinsatz'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 123, 'AT-BASE','5','GROUP5','5001','0','Materialeinkauf Fremdfertigung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 124, 'AT-BASE','5','GROUP5','5002','0','Wareneinkauf Verkauf'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 125, 'AT-BASE','5','GROUP5','5020','0','Materialeinkauf'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 126, 'AT-BASE','5','GROUP5','5090','0','Bezugskosten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 127, 'AT-BASE','5','GROUP5','5100','0','Verbrauch Rohstoffe'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 128, 'AT-BASE','5','GROUP5','5199','0','Aufwand für TW-AFA Vorräte'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 129, 'AT-BASE','5','GROUP5','5200','0','Verbrauch bezogenen Teile'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 130, 'AT-BASE','5','GROUP5','5300','0','Verbrauch Hilfsstoffe'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 131, 'AT-BASE','5','GROUP5','5400','0','Hilfsstoffverbrauch'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 132, 'AT-BASE','5','GROUP5','5440','0','Inventurveränderung Fremdbarb. + GK'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 133, 'AT-BASE','5','GROUP5','5441','0','GWG Fremdbarb. + GK'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 134, 'AT-BASE','5','GROUP5','5450','0','Verpackungsmaterial'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 135, 'AT-BASE','5','GROUP5','5800','0','Fremdleistungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 136, 'AT-BASE','5','GROUP5','5880','0','Lieferantenskonti'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 137, 'AT-BASE','5','GROUP5','5900','0','Skontoertrag ig.E. 0% (m.VST)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 138, 'AT-BASE','5','GROUP5','5920','0','Skontoertrag ig.E. 20% (m.VST)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 139, 'AT-BASE','6','GROUP6','6000','0','Löhne'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 140, 'AT-BASE','6','GROUP6','6001','0','Rückerstattung AUVA Arbeiter'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 141, 'AT-BASE','6','GROUP6','6010','0','Lehrlingsentschädigung Arb.'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 142, 'AT-BASE','6','GROUP6','6020','0','Nichtleistungslöhne'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 143, 'AT-BASE','6','GROUP6','6100','0','Leihpersonal Aufwand'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 144, 'AT-BASE','6','GROUP6','6150','0','Sonderzahlungen Arbeiter'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 145, 'AT-BASE','6','GROUP6','6200','0','Gehälter'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 146, 'AT-BASE','6','GROUP6','6201','0','Förderung AMS'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 147, 'AT-BASE','6','GROUP6','6202','0','Rückerstattung AUVA Angestellte'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 148, 'AT-BASE','6','GROUP6','6210','0','Veränderung Mehrarbeitsvergütung RSt Ang'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 149, 'AT-BASE','6','GROUP6','6211','0','Veränderung Mehrarbeitsvergütung RSt Arbeiter'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 150, 'AT-BASE','6','GROUP6','6230','0','Sonderzahlungen Angestellte'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 151, 'AT-BASE','6','GROUP6','6231','0','Dotierung RST Sonderzahlungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 152, 'AT-BASE','6','GROUP6','6255','0','Geschäftsführerbezüge'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 153, 'AT-BASE','6','GROUP6','6256','0','Geschäftsführersachbezüge'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 154, 'AT-BASE','6','GROUP6','6300','0','Sonderzahlung aliquot vorläufig'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 155, 'AT-BASE','6','GROUP6','6310','0','Dotierung Urlaubsrückstellung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 156, 'AT-BASE','6','GROUP6','6311','0','Veränderung Urlaubsrückstellung Arbeiter'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 157, 'AT-BASE','6','GROUP6','6402','0','Betriebliche Vorsorgekassa Arbeiter'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 158, 'AT-BASE','6','GROUP6','6407','0','Betriebliche Vorsorgekassa Angestellte'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 159, 'AT-BASE','6','GROUP6','6416','0','Veränderung Pensionsrückstellung (Angestellte)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 160, 'AT-BASE','6','GROUP6','6435','0','sonstige Beiträge für die Altersversorgung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 161, 'AT-BASE','6','GROUP6','6500','0','Gesetzlicher Sozialaufwand'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 162, 'AT-BASE','6','GROUP6','6600','0','Gesetzlicher Sozialaufwand Arbeiter'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 163, 'AT-BASE','6','GROUP6','6605','0','Gesetzlicher Sozialaufwand Angestellte'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 164, 'AT-BASE','6','GROUP6','6610','0','Dienstgeberbeitrag Arbeiter'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 165, 'AT-BASE','6','GROUP6','6611','0','Dienstgeberbeitrag Angestellte'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 166, 'AT-BASE','6','GROUP6','6620','0','Zuschlag zum DB'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 167, 'AT-BASE','6','GROUP6','6621','0','Zuschlag zum DB Angestellte'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 168, 'AT-BASE','6','GROUP6','6630','0','Ausgleichstaxe'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 169, 'AT-BASE','6','GROUP6','6690','0','Lohnsteuer'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 170, 'AT-BASE','6','GROUP6','6693','0','Kommunalsteuer Arbeiter'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 171, 'AT-BASE','6','GROUP6','6694','0','Kommunalsteuer Angestellte'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 172, 'AT-BASE','6','GROUP6','6700','0','Freiwilliger Sozialaufwand'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 173, 'AT-BASE','6','GROUP6','6710','0','Arbeitskleidung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 174, 'AT-BASE','6','GROUP6','6720','0','Fahrspesen Dienstnehmer'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 175, 'AT-BASE','6','GROUP6','6730','0','Weihnachtsgeschenke Arbeitnehmer'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 176, 'AT-BASE','6','GROUP6','6740','0','Betriebsveranstaltungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 177, 'AT-BASE','6','GROUP6','6750','0','Konto frei'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 178, 'AT-BASE','6','GROUP6','6760','0','Vergleichszahlung Dienstnehmer'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 179, 'AT-BASE','7','GROUP7','7030','0','Abschreibung G W G'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 180, 'AT-BASE','7','GROUP7','7070','0','Buchwert ausgeschiedener Anlagen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 181, 'AT-BASE','7','GROUP7','7080','0','Planmäßige AFA immat.WG.'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 182, 'AT-BASE','7','GROUP7','7081','0','Planmäßige Abschreibung für Sachanlagen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 183, 'AT-BASE','7','GROUP7','7100','0','Nicht abzugsfähige Vorsteuer (VStK)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 184, 'AT-BASE','7','GROUP7','7110','0','Gebühren und Abgaben_Zoll'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 185, 'AT-BASE','7','GROUP7','7111','0','Kammerumlage'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 186, 'AT-BASE','7','GROUP7','7200','0','Instandhaltung Gebäude'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 187, 'AT-BASE','7','GROUP7','7201','0','Instandhaltung Außenanlagen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 188, 'AT-BASE','7','GROUP7','7202','0','Instandh. - Maschinen u. Anl.'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 189, 'AT-BASE','7','GROUP7','7204','0','Instandhaltung und Betriebskosten Betriebs und Geschäftsgebäude'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 190, 'AT-BASE','7','GROUP7','7205','0','Verbrauchsmaterial Werkstatt'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 191, 'AT-BASE','7','GROUP7','7210','0','Müllentsorgung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 192, 'AT-BASE','7','GROUP7','7211','0','Entsorgungskosten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 193, 'AT-BASE','7','GROUP7','7230','0','Reinigungsmaterial (div. Verbrauchsmaterial)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 194, 'AT-BASE','7','GROUP7','7231','0','Berufsbekleidung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 195, 'AT-BASE','7','GROUP7','7235','0','Reinigung durch Dritte'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 196, 'AT-BASE','7','GROUP7','7240','0','LKW-Betriebskosten Vito G 437 MB'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 197, 'AT-BASE','7','GROUP7','7241','0','Leasing Mercedes Vito G 437 MB'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 198, 'AT-BASE','7','GROUP7','7250','0','KFZ Betriebskosten allgemein'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 199, 'AT-BASE','7','GROUP7','7251','0','KFZ Leasing allgemein'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 200, 'AT-BASE','7','GROUP7','7252','0','KFZ Versicherungen allgemein'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 201, 'AT-BASE','7','GROUP7','7253','0','Wachdienst'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 202, 'AT-BASE','7','GROUP7','7254','0','Konto frei'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 203, 'AT-BASE','7','GROUP7','7255','0','Aufwand Leihwagen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 204, 'AT-BASE','7','GROUP7','7256','0','PKW-Betriebskosten VW Golf G 854 SH Versuchsfahrzeug'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 205, 'AT-BASE','7','GROUP7','7257','0','Leasing VW Golf G 854 SH'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 206, 'AT-BASE','7','GROUP7','7258','0','Konto frei'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 207, 'AT-BASE','7','GROUP7','7285','0','Strom'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 208, 'AT-BASE','7','GROUP7','7286','0','Betriebskosten/Beheizung Mietobjekte'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 209, 'AT-BASE','7','GROUP7','7300','0','Transporte durch Dritte'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 210, 'AT-BASE','7','GROUP7','7330','0','Reise und Fahrtspesen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 211, 'AT-BASE','7','GROUP7','7331','0','Kilometergelder'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 212, 'AT-BASE','7','GROUP7','7360','0','Reisediäten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 213, 'AT-BASE','7','GROUP7','7380','0','Telefon'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 214, 'AT-BASE','7','GROUP7','7381','0','Internet'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 215, 'AT-BASE','7','GROUP7','7382','0','Wartung Homepage'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 216, 'AT-BASE','7','GROUP7','7390','0','Postgebühren'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 217, 'AT-BASE','7','GROUP7','7400','0','Konto frei'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 218, 'AT-BASE','7','GROUP7','7401','0','Konto frei'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 219, 'AT-BASE','7','GROUP7','7402','0','Konto frei'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 220, 'AT-BASE','7','GROUP7','7403','0','Miete Büro Linz'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 221, 'AT-BASE','7','GROUP7','7404','0','Miete Gradnerstraße'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 222, 'AT-BASE','7','GROUP7','7410','0','Maschinen u. Gerätemieten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 223, 'AT-BASE','7','GROUP7','7411','0','Wartungskosten BuG Ausstattung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 224, 'AT-BASE','7','GROUP7','7420','0','Mobilien-Leasing '); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 225, 'AT-BASE','7','GROUP7','7421','0','Konto frei'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 226, 'AT-BASE','7','GROUP7','7422','0','Leasing Server'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 227, 'AT-BASE','7','GROUP7','7423','0','Konto frei'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 228, 'AT-BASE','7','GROUP7','7424','0','Konto frei'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 229, 'AT-BASE','7','GROUP7','7480','0','Lizenzgebühren'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 230, 'AT-BASE','7','GROUP7','7540','0','Provisionen an Dritte'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 231, 'AT-BASE','7','GROUP7','7600','0','Büromaterial'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 232, 'AT-BASE','7','GROUP7','7601','0','EDV-Material'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 233, 'AT-BASE','7','GROUP7','7610','0','Drucksorten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 234, 'AT-BASE','7','GROUP7','7620','0','Fachliteratur und Zeitungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 235, 'AT-BASE','7','GROUP7','7630','0','Gästeunt. u. Zeitschriften'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 236, 'AT-BASE','7','GROUP7','7650','0','Werbeaufwand/Inserate'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 237, 'AT-BASE','7','GROUP7','7651','0','Anbahnung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 238, 'AT-BASE','7','GROUP7','7652','0','Aufwand Messen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 239, 'AT-BASE','7','GROUP7','7653','0','Konto frei'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 240, 'AT-BASE','7','GROUP7','7654','0','Inserate'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 241, 'AT-BASE','7','GROUP7','7670','0','Bewirtungskosten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 242, 'AT-BASE','7','GROUP7','7690','0','Trinkgelder u. Spenden'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 243, 'AT-BASE','7','GROUP7','7691','0','Spenden an begünstigte Institutionen/Sponsoring'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 244, 'AT-BASE','7','GROUP7','7696','0','Säumnis- und Verspätungszuschläge'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 245, 'AT-BASE','7','GROUP7','7700','0','Betriebsversicherungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 246, 'AT-BASE','7','GROUP7','7701','0','Transportversicherungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 247, 'AT-BASE','7','GROUP7','7710','0','Pflichtversich. Unternehmer'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 248, 'AT-BASE','7','GROUP7','7749','0','Aufwand Japan'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 249, 'AT-BASE','7','GROUP7','7750','0','Steuerberatung (Lohnverrechnung, Buchhaltung)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 250, 'AT-BASE','7','GROUP7','7751','0','Patentkosten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 251, 'AT-BASE','7','GROUP7','7752','0','Rechtsberatung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 252, 'AT-BASE','7','GROUP7','7753','0','Unternehmensberatung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 253, 'AT-BASE','7','GROUP7','7754','0','Aufwand tectos China'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 254, 'AT-BASE','7','GROUP7','7755','0','Wartung (Betreuung EDV)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 255, 'AT-BASE','7','GROUP7','7756','0','Lizenzgebühren Abaqus'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 256, 'AT-BASE','7','GROUP7','7757','0','Lizenzgebühren Sonstige'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 257, 'AT-BASE','7','GROUP7','7758','0','Sonstige Beratungskosten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 258, 'AT-BASE','7','GROUP7','7759','0','EDV-Beratung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 259, 'AT-BASE','7','GROUP7','7760','0','Mitgliedsbeiträge/freiwillige Beiträge'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 260, 'AT-BASE','7','GROUP7','7761','0','Prüfung Jahresabschluss'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 261, 'AT-BASE','7','GROUP7','7770','0','Aus- und Fortbildung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 262, 'AT-BASE','7','GROUP7','7775','0','Forschung und Entwicklung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 263, 'AT-BASE','7','GROUP7','7776','0','Messentwicklung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 264, 'AT-BASE','7','GROUP7','7777','0','Produktentwicklung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 265, 'AT-BASE','7','GROUP7','7785','0','Freiwillige Verbandsbeiträge'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 266, 'AT-BASE','7','GROUP7','7790','0','Spesen des Geldverkehrs'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 267, 'AT-BASE','7','GROUP7','7791','0','Kursdifferenzen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 268, 'AT-BASE','7','GROUP7','7800','0','Betriebsbedingte Schadensfälle'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 269, 'AT-BASE','7','GROUP7','7801','0','Ausgaben nicht absetzbar'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 270, 'AT-BASE','7','GROUP7','7802','0','Strafen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 271, 'AT-BASE','7','GROUP7','7805','0','Forderungsverluste 20'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 272, 'AT-BASE','7','GROUP7','7806','0','Abschreibungen auf Forderungen (EU)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 273, 'AT-BASE','7','GROUP7','7807','0','Abschreibungen auf Forderungen (Drittland)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 274, 'AT-BASE','7','GROUP7','7810','0','Zuweisung an Einzel-WB Forderungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 275, 'AT-BASE','7','GROUP7','7811','0','Zuweisung pauschale Wertberichtigungen zu Exportforderungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 276, 'AT-BASE','7','GROUP7','7812','0','Abschreibungen auf Vorräte'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 277, 'AT-BASE','7','GROUP7','7820','0','Buchwert abgegangener Sachanlagen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 278, 'AT-BASE','7','GROUP7','7840','0','Gründungskosten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 279, 'AT-BASE','7','GROUP7','7850','0','Sonstiger Aufwand'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 280, 'AT-BASE','7','GROUP7','7851','0','Sonstiger Aufwand Gewinnanteil Reich'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 281, 'AT-BASE','7','GROUP7','7930','0','Aufw. Gewährleistungsverpfl.'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 282, 'AT-BASE','7','GROUP7','7940','0','Aufwand aus Vorperioden'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 283, 'AT-BASE','8','GROUP8','8020','0','Gewinnüberrg. v. Organgesell.'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 284, 'AT-BASE','8','GROUP8','8060','0','Zinserträge'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 285, 'AT-BASE','8','GROUP8','8090','0','Ertr.a.Ant.a.and. Unternehmen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 286, 'AT-BASE','8','GROUP8','8100','0','Habenzinsen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 287, 'AT-BASE','8','GROUP8','8280','0','Zinsen f. Kredite u. Darlehen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 288, 'AT-BASE','8','GROUP8','8286','0','Kursgewinne/Kursverluste'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 289, 'AT-BASE','8','GROUP8','8288','0','Zinsen auf Lieferantenkredite'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 290, 'AT-BASE','8','GROUP8','8291','0','Sonst. Zinsen und ähnliche Aufwendungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 291, 'AT-BASE','8','GROUP8','8500','0','Körperschaftsteuer'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 292, 'AT-BASE','8','GROUP8','8505','0','Kapitalertragsteuer'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 293, 'AT-BASE','8','GROUP8','8510','0','Körperschaftsteuervorauszahl.'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 294, 'AT-BASE','8','GROUP8','8511','0','Dotierung KöSt-Rückstellung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 295, 'AT-BASE','8','GROUP8','8512','0','Aktivierung Körperschaftsteuer'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 296, 'AT-BASE','8','GROUP8','8513','0','Köst Vorperioden'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 297, 'AT-BASE','8','GROUP8','8520','0','Forschungsprämie'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 298, 'AT-BASE','8','GROUP8','8595','0','Ertrag aus der Aktivierung latenter Steuern'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 299, 'AT-BASE','8','GROUP8','8610','0','Auflösung sonstiger unversteuerter Rücklagen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 300, 'AT-BASE','8','GROUP8','8700','0','Auflösung gebundener Kapitalrücklage'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 301, 'AT-BASE','8','GROUP8','8710','0','Auflösung Rücklage für eigene Anteile'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 302, 'AT-BASE','8','GROUP8','8720','0','Auflösung nicht gebundene Kapitalrücklage'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 303, 'AT-BASE','8','GROUP8','8750','0','Auflösung gesetzliche Rücklage'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 304, 'AT-BASE','8','GROUP8','8760','0','Auflösung satzungsmäßige Rücklage'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 305, 'AT-BASE','8','GROUP8','8770','0','Auflösung andere (freie) Rücklage'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 306, 'AT-BASE','8','GROUP8','8810','0','Zuweisung sonstige unversteuerte Rücklagen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 307, 'AT-BASE','8','GROUP8','8820','0','Zuweisung Inv. Rücklage'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 308, 'AT-BASE','8','GROUP8','8890','0','Zuw.Bew.Res.GWG'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 309, 'AT-BASE','8','GROUP8','8900','0','Zuweisung gesetzliche Rücklagen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 310, 'AT-BASE','8','GROUP8','8910','0','Zuweisung satzungsmäßige Rücklagen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 311, 'AT-BASE','8','GROUP8','8920','0','Zuweisung andere (freie) Rücklagen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 312, 'AT-BASE','9','GROUP9','9390','0','Bilanzgewinn'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 313, 'AT-BASE','9','GROUP9','9391','0','Bilanzverlust'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 314, 'AT-BASE','9','GROUP9','9700','0','Wachdienst'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 315, 'AT-BASE','9','GROUP9','9991','0','Gewinnvortrag'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 316, 'AT-BASE','9','GROUP9','9993','0','Verlustvortrag'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 317, 'AT-BASE','9','GROUP9','9994','0','Verlustvortrag'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 318, 'AT-BASE','5','GROUP5','50200','0','Materialeinkauf'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 319, 'AT-BASE','6','GROUP6','60000','0','kalk. Löhne u Gehälter'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 320, 'AT-BASE','6','GROUP6','64160','0','Veränderung Pensionsrückstellung (Angestellte)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 321, 'AT-BASE','6','GROUP6','66300','0','Leistungserfassung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1, 'AT-BASE','GROUP0','110','0','Patentrechte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2, 'AT-BASE','GROUP0','120','0','Software'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3, 'AT-BASE','GROUP0','121','0','ERP System'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 4, 'AT-BASE','GROUP0','122','0','Homepage'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 5, 'AT-BASE','GROUP0','125','0','Software Fremdentwicklung_noch nicht aktivieren'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 6, 'AT-BASE','GROUP0','160','0','Umgründungsmehrwert'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 7, 'AT-BASE','GROUP0','250','0','Mieterinvestitionen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 8, 'AT-BASE','GROUP0','400','0','Maschinen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 9, 'AT-BASE','GROUP0','600','0','Betriebs u. Geschäftsausstattung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 10, 'AT-BASE','GROUP0','601','0','Ausstellungsstücke'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 11, 'AT-BASE','GROUP0','602','0','Leihstellungsstücke'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 12, 'AT-BASE','GROUP0','603','0','Getriebeprüfstand_hinten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 13, 'AT-BASE','GROUP0','604','0','Wuchtstand_links_AQ'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 14, 'AT-BASE','GROUP0','605','0','Messlabor(Messraum)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 15, 'AT-BASE','GROUP0','606','0','PAK-System'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 16, 'AT-BASE','GROUP0','607','0','Server'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 17, 'AT-BASE','GROUP0','608','0','EDV-Ausstattung (Hardware)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 18, 'AT-BASE','GROUP0','609','0','Werkstattausstattung (Werkzeug)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 19, 'AT-BASE','GROUP0','610','0','Wuchtprüfstand neu_noch nicht in Betrieb genommen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 20, 'AT-BASE','GROUP0','611','0','Messequipment/Ausstattung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 21, 'AT-BASE','GROUP0','630','0','PKW'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 22, 'AT-BASE','GROUP0','640','0','LKW'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 23, 'AT-BASE','GROUP0','680','0','GWG-Geschäftsausstattung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 24, 'AT-BASE','GROUP0','710','0','Anlagen in Bau'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 25, 'AT-BASE','GROUP1','1100','0','Rohstoffe'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 26, 'AT-BASE','GROUP1','1200','0','Bezogenen Teile'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 27, 'AT-BASE','GROUP1','1300','0','Hilfsstoffe und Betriebsstoffe'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 28, 'AT-BASE','GROUP1','1400','0','fertige Erzeugnisse'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 29, 'AT-BASE','GROUP1','1500','0','unfertige Erzeugnisse'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 30, 'AT-BASE','GROUP1','1600','0','Waren'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 31, 'AT-BASE','GROUP1','1700','0','Noch nicht abrechenbare Leist.'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 32, 'AT-BASE','GROUP1','1701','0','Bestandsveränderung laufend'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 33, 'AT-BASE','GROUP1','1800','0','Vorrat Verpackungsmaterial'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 34, 'AT-BASE','GROUP1','1810','0','Vorrat Werbematerial'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 35, 'AT-BASE','GROUP2','2000','0','Lieferforderungen Inland I'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 36, 'AT-BASE','GROUP2','2080','0','Einzelwertb. Ford. Inland'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 37, 'AT-BASE','GROUP2','2292','0','geleistete Anzahlungen (20%)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 38, 'AT-BASE','GROUP2','2293','0','gel. Anzahlungen i.g.'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 39, 'AT-BASE','GROUP2','2301','0','Forderung Forschungsprämie'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 40, 'AT-BASE','GROUP2','2302','0','Forderungen gelieferte (noch nicht fakturierte Waren)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 41, 'AT-BASE','GROUP2','2303','0','Vorauszahlung Leasing Server'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 42, 'AT-BASE','GROUP2','2306','0','Kaution Pfauengarten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 43, 'AT-BASE','GROUP2','2307','0','Kaution Werkstatt'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 44, 'AT-BASE','GROUP2','2308','0','Kaution Parkplatz PKW'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 45, 'AT-BASE','GROUP2','2309','0','Kaution Werkstatt'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 46, 'AT-BASE','GROUP2','2310','0','Kaution Studentenwohnheim'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 47, 'AT-BASE','GROUP2','2311','0','Kaution China'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 48, 'AT-BASE','GROUP2','2312','0','Vorauszahlung Xerox'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 49, 'AT-BASE','GROUP2','2313','0','Verrechnung Bildungsscheck'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 50, 'AT-BASE','GROUP2','2315','0','Aktivierung Körperschaftsteuer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 51, 'AT-BASE','GROUP2','2500','0','Vorsteuer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 52, 'AT-BASE','GROUP2','2501','0','Vorsteuer aus i. g. Erwerb'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 53, 'AT-BASE','GROUP2','2502','0','Vorsteuer reverse charge syst.'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 54, 'AT-BASE','GROUP2','2503','0','Vorsteuer Reverse Charge § 19/1d'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 55, 'AT-BASE','GROUP2','2508','0','Vorsteuer sonstige Leistungen EU'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 56, 'AT-BASE','GROUP2','2509','0','EUSt Forderung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 57, 'AT-BASE','GROUP2','2510','0','Einfuhrumsatzsteuer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 58, 'AT-BASE','GROUP2','2531','0','Vorsteuer Frankreich'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 59, 'AT-BASE','GROUP2','2532','0','Vorsteuer Niederlande'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 60, 'AT-BASE','GROUP2','2533','0','Vorsteuer GB'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 61, 'AT-BASE','GROUP2','2534','0','Vorsteuer Belgien'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 62, 'AT-BASE','GROUP2','2535','0','Vorsteuer GB'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 63, 'AT-BASE','GROUP2','2901','0','Leasingvorauszahlung Vito'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 64, 'AT-BASE','GROUP3','3020','0','Rückstellung für Körperschaftsteuer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 65, 'AT-BASE','GROUP3','3060','0','Rst. für Beratungskosten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 66, 'AT-BASE','GROUP3','3064','0','Rst. für Sonderzahlungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 67, 'AT-BASE','GROUP3','3072','0','Rst. für nicht konsum. Urlaube'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 68, 'AT-BASE','GROUP3','3214','0','Raika 40-00.800.185'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 69, 'AT-BASE','GROUP3','3286','0','Darlehen Dipl. Ing. REICH GMBH'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 70, 'AT-BASE','GROUP3','3287','0','Darlehen Dr.Höfler'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 71, 'AT-BASE','GROUP3','3288','0','Darlehen DI Mayrhofer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 72, 'AT-BASE','GROUP3','3289','0','Darlehen AWS'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 73, 'AT-BASE','GROUP3','3292','0','Anzahlungen von Kunden 20 %'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 74, 'AT-BASE','GROUP3','3294','0','Anzahlungen von Kunden Drittland'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 75, 'AT-BASE','GROUP3','3300','0','Lieferverbindlichkeiten I'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 76, 'AT-BASE','GROUP3','3481','0','Verrechnungskto DI Mayrhofer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 77, 'AT-BASE','GROUP3','3500','0','Umsatzsteuer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 78, 'AT-BASE','GROUP3','3501','0','Umsatzsteuer aus i. g. Erwerb'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 79, 'AT-BASE','GROUP3','3502','0','USt § 19/Art 19 (reverse Charge)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 80, 'AT-BASE','GROUP3','3503','0','Umsatzsteuer Reverse Charge § 19/1d'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 81, 'AT-BASE','GROUP3','3508','0','Umsatzsteuer sonstige Leistung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 82, 'AT-BASE','GROUP3','3531','0','FA-Zahllast Dezember'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 83, 'AT-BASE','GROUP3','3533','0','Umsatzsteuer 2012'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 84, 'AT-BASE','GROUP3','3535','0','Umsatzsteuer 2013'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 85, 'AT-BASE','GROUP3','3536','0','Umsatzsteuer 2014'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 86, 'AT-BASE','GROUP3','3537','0','Umsatzsteuer 2015'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 87, 'AT-BASE','GROUP3','3632','0','Verrechnungskonto EUSt'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 88, 'AT-BASE','GROUP3','3892','0','Verbindlichkeiten Anzahlungsrechn.'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 89, 'AT-BASE','GROUP3','3898','0','Abgrenzung Sonderzahlungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 90, 'AT-BASE','GROUP4','4000','0','Erlöse Lieferungen 20 %'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 91, 'AT-BASE','GROUP4','4001','0','Erlöse i.g. Lieferung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 92, 'AT-BASE','GROUP4','4002','0','Erlöse Dienstleistungen EU'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 93, 'AT-BASE','GROUP4','4003','0','Erlöse Dienstleistungen 20 %'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 94, 'AT-BASE','GROUP4','4004','0','Erlöse Software 20 %'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 95, 'AT-BASE','GROUP4','4005','0','Erlöse Software EU'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 96, 'AT-BASE','GROUP4','4006','0','Evidenz Kfd. Reverse Charge'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 97, 'AT-BASE','GROUP4','4050','0','Erlöse 0 % Drittland'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 98, 'AT-BASE','GROUP4','4051','0','Erlöse Dienstleistungen Drittland'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 99, 'AT-BASE','GROUP4','4052','0','Erlöse Software Drittland'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 100, 'AT-BASE','GROUP4','4069','0','Erlöse § 19/1d Schrott'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 101, 'AT-BASE','GROUP4','4400','0','Kundenskonto 20 %'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 102, 'AT-BASE','GROUP4','4405','0','Kundenskonto 0 % Ausfuhrlieferungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 103, 'AT-BASE','GROUP4','4410','0','Skontoaufwand i.g. Lieferung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 104, 'AT-BASE','GROUP4','4413','0','Kundenskonto sonstige Leistung EU'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 105, 'AT-BASE','GROUP4','4420','0','Kundenskonto EU-Land A x %'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 106, 'AT-BASE','GROUP4','4450','0','Kundenrabatt 20%'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 107, 'AT-BASE','GROUP4','4500','0','Bestandsveränderungen fertige Erzeugnisse'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 108, 'AT-BASE','GROUP4','4510','0','Best.Veränd.Halbf.Erzeugnisse'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 109, 'AT-BASE','GROUP4','4519','0','Bestandsveränderung laufend'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 110, 'AT-BASE','GROUP4','4520','0','Best.Veränd.n.n.abger.Leist.'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 111, 'AT-BASE','GROUP4','4530','0','Gelieferte (noch nicht fakturierte Waren)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 112, 'AT-BASE','GROUP4','4580','0','Aktivierte Eigenleistung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 113, 'AT-BASE','GROUP4','4630','0','Erträge aus d.Abgang v.Anlagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 114, 'AT-BASE','GROUP4','4801','0','Zuwendungen a.öffentl. Mitteln'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 115, 'AT-BASE','GROUP4','4831','0','sonstige betriebliche Erträge (nicht steuerbar)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 116, 'AT-BASE','GROUP4','4840','0','Sonstige Erlöse 20 %'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 117, 'AT-BASE','GROUP4','4850','0','Erl. Aufwandersätze'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 118, 'AT-BASE','GROUP4','4881','0','Versicherungsvergütungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 119, 'AT-BASE','GROUP4','4885','0','Zuschreibungen zum Umlaufvermögen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 120, 'AT-BASE','GROUP4','4950','0','Privatanteil 20 %'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 121, 'AT-BASE','GROUP4','4991','0','Sachbezüge 20%'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 122, 'AT-BASE','GROUP5','5000','0','Handelswareneinsatz'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 123, 'AT-BASE','GROUP5','5001','0','Materialeinkauf Fremdfertigung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 124, 'AT-BASE','GROUP5','5002','0','Wareneinkauf Verkauf'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 125, 'AT-BASE','GROUP5','5020','0','Materialeinkauf'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 126, 'AT-BASE','GROUP5','5090','0','Bezugskosten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 127, 'AT-BASE','GROUP5','5100','0','Verbrauch Rohstoffe'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 128, 'AT-BASE','GROUP5','5199','0','Aufwand für TW-AFA Vorräte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 129, 'AT-BASE','GROUP5','5200','0','Verbrauch bezogenen Teile'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 130, 'AT-BASE','GROUP5','5300','0','Verbrauch Hilfsstoffe'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 131, 'AT-BASE','GROUP5','5400','0','Hilfsstoffverbrauch'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 132, 'AT-BASE','GROUP5','5440','0','Inventurveränderung Fremdbarb. + GK'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 133, 'AT-BASE','GROUP5','5441','0','GWG Fremdbarb. + GK'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 134, 'AT-BASE','GROUP5','5450','0','Verpackungsmaterial'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 135, 'AT-BASE','GROUP5','5800','0','Fremdleistungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 136, 'AT-BASE','GROUP5','5880','0','Lieferantenskonti'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 137, 'AT-BASE','GROUP5','5900','0','Skontoertrag ig.E. 0% (m.VST)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 138, 'AT-BASE','GROUP5','5920','0','Skontoertrag ig.E. 20% (m.VST)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 139, 'AT-BASE','GROUP6','6000','0','Löhne'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 140, 'AT-BASE','GROUP6','6001','0','Rückerstattung AUVA Arbeiter'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 141, 'AT-BASE','GROUP6','6010','0','Lehrlingsentschädigung Arb.'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 142, 'AT-BASE','GROUP6','6020','0','Nichtleistungslöhne'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 143, 'AT-BASE','GROUP6','6100','0','Leihpersonal Aufwand'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 144, 'AT-BASE','GROUP6','6150','0','Sonderzahlungen Arbeiter'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 145, 'AT-BASE','GROUP6','6200','0','Gehälter'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 146, 'AT-BASE','GROUP6','6201','0','Förderung AMS'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 147, 'AT-BASE','GROUP6','6202','0','Rückerstattung AUVA Angestellte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 148, 'AT-BASE','GROUP6','6210','0','Veränderung Mehrarbeitsvergütung RSt Ang'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 149, 'AT-BASE','GROUP6','6211','0','Veränderung Mehrarbeitsvergütung RSt Arbeiter'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 150, 'AT-BASE','GROUP6','6230','0','Sonderzahlungen Angestellte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 151, 'AT-BASE','GROUP6','6231','0','Dotierung RST Sonderzahlungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 152, 'AT-BASE','GROUP6','6255','0','Geschäftsführerbezüge'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 153, 'AT-BASE','GROUP6','6256','0','Geschäftsführersachbezüge'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 154, 'AT-BASE','GROUP6','6300','0','Sonderzahlung aliquot vorläufig'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 155, 'AT-BASE','GROUP6','6310','0','Dotierung Urlaubsrückstellung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 156, 'AT-BASE','GROUP6','6311','0','Veränderung Urlaubsrückstellung Arbeiter'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 157, 'AT-BASE','GROUP6','6402','0','Betriebliche Vorsorgekassa Arbeiter'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 158, 'AT-BASE','GROUP6','6407','0','Betriebliche Vorsorgekassa Angestellte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 159, 'AT-BASE','GROUP6','6416','0','Veränderung Pensionsrückstellung (Angestellte)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 160, 'AT-BASE','GROUP6','6435','0','sonstige Beiträge für die Altersversorgung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 161, 'AT-BASE','GROUP6','6500','0','Gesetzlicher Sozialaufwand'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 162, 'AT-BASE','GROUP6','6600','0','Gesetzlicher Sozialaufwand Arbeiter'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 163, 'AT-BASE','GROUP6','6605','0','Gesetzlicher Sozialaufwand Angestellte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 164, 'AT-BASE','GROUP6','6610','0','Dienstgeberbeitrag Arbeiter'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 165, 'AT-BASE','GROUP6','6611','0','Dienstgeberbeitrag Angestellte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 166, 'AT-BASE','GROUP6','6620','0','Zuschlag zum DB'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 167, 'AT-BASE','GROUP6','6621','0','Zuschlag zum DB Angestellte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 168, 'AT-BASE','GROUP6','6630','0','Ausgleichstaxe'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 169, 'AT-BASE','GROUP6','6690','0','Lohnsteuer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 170, 'AT-BASE','GROUP6','6693','0','Kommunalsteuer Arbeiter'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 171, 'AT-BASE','GROUP6','6694','0','Kommunalsteuer Angestellte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 172, 'AT-BASE','GROUP6','6700','0','Freiwilliger Sozialaufwand'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 173, 'AT-BASE','GROUP6','6710','0','Arbeitskleidung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 174, 'AT-BASE','GROUP6','6720','0','Fahrspesen Dienstnehmer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 175, 'AT-BASE','GROUP6','6730','0','Weihnachtsgeschenke Arbeitnehmer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 176, 'AT-BASE','GROUP6','6740','0','Betriebsveranstaltungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 177, 'AT-BASE','GROUP6','6750','0','Konto frei'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 178, 'AT-BASE','GROUP6','6760','0','Vergleichszahlung Dienstnehmer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 179, 'AT-BASE','GROUP7','7030','0','Abschreibung G W G'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 180, 'AT-BASE','GROUP7','7070','0','Buchwert ausgeschiedener Anlagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 181, 'AT-BASE','GROUP7','7080','0','Planmäßige AFA immat.WG.'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 182, 'AT-BASE','GROUP7','7081','0','Planmäßige Abschreibung für Sachanlagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 183, 'AT-BASE','GROUP7','7100','0','Nicht abzugsfähige Vorsteuer (VStK)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 184, 'AT-BASE','GROUP7','7110','0','Gebühren und Abgaben_Zoll'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 185, 'AT-BASE','GROUP7','7111','0','Kammerumlage'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 186, 'AT-BASE','GROUP7','7200','0','Instandhaltung Gebäude'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 187, 'AT-BASE','GROUP7','7201','0','Instandhaltung Außenanlagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 188, 'AT-BASE','GROUP7','7202','0','Instandh. - Maschinen u. Anl.'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 189, 'AT-BASE','GROUP7','7204','0','Instandhaltung und Betriebskosten Betriebs und Geschäftsgebäude'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 190, 'AT-BASE','GROUP7','7205','0','Verbrauchsmaterial Werkstatt'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 191, 'AT-BASE','GROUP7','7210','0','Müllentsorgung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 192, 'AT-BASE','GROUP7','7211','0','Entsorgungskosten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 193, 'AT-BASE','GROUP7','7230','0','Reinigungsmaterial (div. Verbrauchsmaterial)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 194, 'AT-BASE','GROUP7','7231','0','Berufsbekleidung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 195, 'AT-BASE','GROUP7','7235','0','Reinigung durch Dritte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 196, 'AT-BASE','GROUP7','7240','0','LKW-Betriebskosten Vito G 437 MB'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 197, 'AT-BASE','GROUP7','7241','0','Leasing Mercedes Vito G 437 MB'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 198, 'AT-BASE','GROUP7','7250','0','KFZ Betriebskosten allgemein'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 199, 'AT-BASE','GROUP7','7251','0','KFZ Leasing allgemein'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 200, 'AT-BASE','GROUP7','7252','0','KFZ Versicherungen allgemein'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 201, 'AT-BASE','GROUP7','7253','0','Wachdienst'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 202, 'AT-BASE','GROUP7','7254','0','Konto frei'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 203, 'AT-BASE','GROUP7','7255','0','Aufwand Leihwagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 204, 'AT-BASE','GROUP7','7256','0','PKW-Betriebskosten VW Golf G 854 SH Versuchsfahrzeug'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 205, 'AT-BASE','GROUP7','7257','0','Leasing VW Golf G 854 SH'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 206, 'AT-BASE','GROUP7','7258','0','Konto frei'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 207, 'AT-BASE','GROUP7','7285','0','Strom'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 208, 'AT-BASE','GROUP7','7286','0','Betriebskosten/Beheizung Mietobjekte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 209, 'AT-BASE','GROUP7','7300','0','Transporte durch Dritte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 210, 'AT-BASE','GROUP7','7330','0','Reise und Fahrtspesen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 211, 'AT-BASE','GROUP7','7331','0','Kilometergelder'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 212, 'AT-BASE','GROUP7','7360','0','Reisediäten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 213, 'AT-BASE','GROUP7','7380','0','Telefon'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 214, 'AT-BASE','GROUP7','7381','0','Internet'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 215, 'AT-BASE','GROUP7','7382','0','Wartung Homepage'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 216, 'AT-BASE','GROUP7','7390','0','Postgebühren'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 217, 'AT-BASE','GROUP7','7400','0','Konto frei'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 218, 'AT-BASE','GROUP7','7401','0','Konto frei'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 219, 'AT-BASE','GROUP7','7402','0','Konto frei'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 220, 'AT-BASE','GROUP7','7403','0','Miete Büro Linz'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 221, 'AT-BASE','GROUP7','7404','0','Miete Gradnerstraße'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 222, 'AT-BASE','GROUP7','7410','0','Maschinen u. Gerätemieten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 223, 'AT-BASE','GROUP7','7411','0','Wartungskosten BuG Ausstattung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 224, 'AT-BASE','GROUP7','7420','0','Mobilien-Leasing '); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 225, 'AT-BASE','GROUP7','7421','0','Konto frei'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 226, 'AT-BASE','GROUP7','7422','0','Leasing Server'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 227, 'AT-BASE','GROUP7','7423','0','Konto frei'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 228, 'AT-BASE','GROUP7','7424','0','Konto frei'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 229, 'AT-BASE','GROUP7','7480','0','Lizenzgebühren'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 230, 'AT-BASE','GROUP7','7540','0','Provisionen an Dritte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 231, 'AT-BASE','GROUP7','7600','0','Büromaterial'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 232, 'AT-BASE','GROUP7','7601','0','EDV-Material'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 233, 'AT-BASE','GROUP7','7610','0','Drucksorten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 234, 'AT-BASE','GROUP7','7620','0','Fachliteratur und Zeitungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 235, 'AT-BASE','GROUP7','7630','0','Gästeunt. u. Zeitschriften'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 236, 'AT-BASE','GROUP7','7650','0','Werbeaufwand/Inserate'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 237, 'AT-BASE','GROUP7','7651','0','Anbahnung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 238, 'AT-BASE','GROUP7','7652','0','Aufwand Messen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 239, 'AT-BASE','GROUP7','7653','0','Konto frei'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 240, 'AT-BASE','GROUP7','7654','0','Inserate'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 241, 'AT-BASE','GROUP7','7670','0','Bewirtungskosten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 242, 'AT-BASE','GROUP7','7690','0','Trinkgelder u. Spenden'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 243, 'AT-BASE','GROUP7','7691','0','Spenden an begünstigte Institutionen/Sponsoring'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 244, 'AT-BASE','GROUP7','7696','0','Säumnis- und Verspätungszuschläge'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 245, 'AT-BASE','GROUP7','7700','0','Betriebsversicherungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 246, 'AT-BASE','GROUP7','7701','0','Transportversicherungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 247, 'AT-BASE','GROUP7','7710','0','Pflichtversich. Unternehmer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 248, 'AT-BASE','GROUP7','7749','0','Aufwand Japan'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 249, 'AT-BASE','GROUP7','7750','0','Steuerberatung (Lohnverrechnung, Buchhaltung)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 250, 'AT-BASE','GROUP7','7751','0','Patentkosten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 251, 'AT-BASE','GROUP7','7752','0','Rechtsberatung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 252, 'AT-BASE','GROUP7','7753','0','Unternehmensberatung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 253, 'AT-BASE','GROUP7','7754','0','Aufwand tectos China'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 254, 'AT-BASE','GROUP7','7755','0','Wartung (Betreuung EDV)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 255, 'AT-BASE','GROUP7','7756','0','Lizenzgebühren Abaqus'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 256, 'AT-BASE','GROUP7','7757','0','Lizenzgebühren Sonstige'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 257, 'AT-BASE','GROUP7','7758','0','Sonstige Beratungskosten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 258, 'AT-BASE','GROUP7','7759','0','EDV-Beratung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 259, 'AT-BASE','GROUP7','7760','0','Mitgliedsbeiträge/freiwillige Beiträge'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 260, 'AT-BASE','GROUP7','7761','0','Prüfung Jahresabschluss'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 261, 'AT-BASE','GROUP7','7770','0','Aus- und Fortbildung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 262, 'AT-BASE','GROUP7','7775','0','Forschung und Entwicklung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 263, 'AT-BASE','GROUP7','7776','0','Messentwicklung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 264, 'AT-BASE','GROUP7','7777','0','Produktentwicklung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 265, 'AT-BASE','GROUP7','7785','0','Freiwillige Verbandsbeiträge'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 266, 'AT-BASE','GROUP7','7790','0','Spesen des Geldverkehrs'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 267, 'AT-BASE','GROUP7','7791','0','Kursdifferenzen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 268, 'AT-BASE','GROUP7','7800','0','Betriebsbedingte Schadensfälle'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 269, 'AT-BASE','GROUP7','7801','0','Ausgaben nicht absetzbar'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 270, 'AT-BASE','GROUP7','7802','0','Strafen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 271, 'AT-BASE','GROUP7','7805','0','Forderungsverluste 20'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 272, 'AT-BASE','GROUP7','7806','0','Abschreibungen auf Forderungen (EU)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 273, 'AT-BASE','GROUP7','7807','0','Abschreibungen auf Forderungen (Drittland)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 274, 'AT-BASE','GROUP7','7810','0','Zuweisung an Einzel-WB Forderungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 275, 'AT-BASE','GROUP7','7811','0','Zuweisung pauschale Wertberichtigungen zu Exportforderungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 276, 'AT-BASE','GROUP7','7812','0','Abschreibungen auf Vorräte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 277, 'AT-BASE','GROUP7','7820','0','Buchwert abgegangener Sachanlagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 278, 'AT-BASE','GROUP7','7840','0','Gründungskosten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 279, 'AT-BASE','GROUP7','7850','0','Sonstiger Aufwand'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 280, 'AT-BASE','GROUP7','7851','0','Sonstiger Aufwand Gewinnanteil Reich'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 281, 'AT-BASE','GROUP7','7930','0','Aufw. Gewährleistungsverpfl.'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 282, 'AT-BASE','GROUP7','7940','0','Aufwand aus Vorperioden'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 283, 'AT-BASE','GROUP8','8020','0','Gewinnüberrg. v. Organgesell.'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 284, 'AT-BASE','GROUP8','8060','0','Zinserträge'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 285, 'AT-BASE','GROUP8','8090','0','Ertr.a.Ant.a.and. Unternehmen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 286, 'AT-BASE','GROUP8','8100','0','Habenzinsen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 287, 'AT-BASE','GROUP8','8280','0','Zinsen f. Kredite u. Darlehen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 288, 'AT-BASE','GROUP8','8286','0','Kursgewinne/Kursverluste'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 289, 'AT-BASE','GROUP8','8288','0','Zinsen auf Lieferantenkredite'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 290, 'AT-BASE','GROUP8','8291','0','Sonst. Zinsen und ähnliche Aufwendungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 291, 'AT-BASE','GROUP8','8500','0','Körperschaftsteuer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 292, 'AT-BASE','GROUP8','8505','0','Kapitalertragsteuer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 293, 'AT-BASE','GROUP8','8510','0','Körperschaftsteuervorauszahl.'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 294, 'AT-BASE','GROUP8','8511','0','Dotierung KöSt-Rückstellung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 295, 'AT-BASE','GROUP8','8512','0','Aktivierung Körperschaftsteuer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 296, 'AT-BASE','GROUP8','8513','0','Köst Vorperioden'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 297, 'AT-BASE','GROUP8','8520','0','Forschungsprämie'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 298, 'AT-BASE','GROUP8','8595','0','Ertrag aus der Aktivierung latenter Steuern'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 299, 'AT-BASE','GROUP8','8610','0','Auflösung sonstiger unversteuerter Rücklagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 300, 'AT-BASE','GROUP8','8700','0','Auflösung gebundener Kapitalrücklage'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 301, 'AT-BASE','GROUP8','8710','0','Auflösung Rücklage für eigene Anteile'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 302, 'AT-BASE','GROUP8','8720','0','Auflösung nicht gebundene Kapitalrücklage'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 303, 'AT-BASE','GROUP8','8750','0','Auflösung gesetzliche Rücklage'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 304, 'AT-BASE','GROUP8','8760','0','Auflösung satzungsmäßige Rücklage'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 305, 'AT-BASE','GROUP8','8770','0','Auflösung andere (freie) Rücklage'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 306, 'AT-BASE','GROUP8','8810','0','Zuweisung sonstige unversteuerte Rücklagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 307, 'AT-BASE','GROUP8','8820','0','Zuweisung Inv. Rücklage'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 308, 'AT-BASE','GROUP8','8890','0','Zuw.Bew.Res.GWG'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 309, 'AT-BASE','GROUP8','8900','0','Zuweisung gesetzliche Rücklagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 310, 'AT-BASE','GROUP8','8910','0','Zuweisung satzungsmäßige Rücklagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 311, 'AT-BASE','GROUP8','8920','0','Zuweisung andere (freie) Rücklagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 312, 'AT-BASE','GROUP9','9390','0','Bilanzgewinn'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 313, 'AT-BASE','GROUP9','9391','0','Bilanzverlust'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 314, 'AT-BASE','GROUP9','9700','0','Wachdienst'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 315, 'AT-BASE','GROUP9','9991','0','Gewinnvortrag'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 316, 'AT-BASE','GROUP9','9993','0','Verlustvortrag'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 317, 'AT-BASE','GROUP9','9994','0','Verlustvortrag'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 318, 'AT-BASE','GROUP5','50200','0','Materialeinkauf'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 319, 'AT-BASE','GROUP6','60000','0','kalk. Löhne u Gehälter'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 320, 'AT-BASE','GROUP6','64160','0','Veränderung Pensionsrückstellung (Angestellte)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 321, 'AT-BASE','GROUP6','66300','0','Leistungserfassung'); From fa71402a9b74393bb76e3d3df922880794a6d027 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Thu, 3 Jun 2021 09:34:49 +0200 Subject: [PATCH 0369/1497] Fix 17791 : fix for at account --- htdocs/install/mysql/data/llx_accounting_account_at.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/data/llx_accounting_account_at.sql b/htdocs/install/mysql/data/llx_accounting_account_at.sql index 402e6893e6b..f05dc2572c2 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_at.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_at.sql @@ -22,7 +22,7 @@ -- Descriptif des plans comptables autrichiens standard -- ADD 4100000 to rowid # Do no remove this comment -- -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1, 'AT-BASE','GROUP0','110','0','Patentrechte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1, 'AT-BASE','0','GROUP0','110','0','Patentrechte'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2, 'AT-BASE','GROUP0','120','0','Software'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3, 'AT-BASE','GROUP0','121','0','ERP System'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 4, 'AT-BASE','GROUP0','122','0','Homepage'); From 71856984a3555e0e90ed8b80b0f8139730c170a8 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Thu, 3 Jun 2021 09:35:31 +0200 Subject: [PATCH 0370/1497] Fix #17791 : fix for at account --- htdocs/install/mysql/data/llx_accounting_account_at.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/data/llx_accounting_account_at.sql b/htdocs/install/mysql/data/llx_accounting_account_at.sql index f05dc2572c2..402e6893e6b 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_at.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_at.sql @@ -22,7 +22,7 @@ -- Descriptif des plans comptables autrichiens standard -- ADD 4100000 to rowid # Do no remove this comment -- -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1, 'AT-BASE','0','GROUP0','110','0','Patentrechte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1, 'AT-BASE','GROUP0','110','0','Patentrechte'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2, 'AT-BASE','GROUP0','120','0','Software'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3, 'AT-BASE','GROUP0','121','0','ERP System'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 4, 'AT-BASE','GROUP0','122','0','Homepage'); From 093705a1b552d18450c968001e4eafa4d65c127e Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Thu, 3 Jun 2021 11:32:41 +0200 Subject: [PATCH 0371/1497] FIX : field name is search_status and not search_statut --- htdocs/holiday/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index cb8da24052b..cbd9b76e45e 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -106,7 +106,7 @@ $search_month_end = GETPOST('search_month_end', 'int'); $search_year_end = GETPOST('search_year_end', 'int'); $search_employee = GETPOST('search_employee', 'int'); $search_valideur = GETPOST('search_valideur', 'int'); -$search_status = GETPOST('search_statut', 'int'); +$search_status = GETPOST('search_status', 'int'); $search_type = GETPOST('search_type', 'int'); // Initialize technical objects From c534b7fcce8808189b9ef108aa69f9697e584a08 Mon Sep 17 00:00:00 2001 From: Inovea Conseil Date: Thu, 3 Jun 2021 14:36:47 +0200 Subject: [PATCH 0372/1497] FIX delete object actionComm --- htdocs/core/actions_massactions.inc.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 99f1271ff0b..3cbcd30af7f 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018 Nicolas ZABOURI + * Copyright (C) 2018-2021 Nicolas ZABOURI * Copyright (C) 2018 Juanjo Menent * Copyright (C) 2019 Ferran Marcet * Copyright (C) 2019-2021 Frédéric France @@ -1241,8 +1241,13 @@ if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == ' } if (in_array($objecttmp->element, array('societe', 'member'))) $result = $objecttmp->delete($objecttmp->id, $user, 1); - else $result = $objecttmp->delete($user); - + else { + if (get_class($objecttmp) === "ActionComm") { + $result = $objecttmp->delete(); + } else { + $result = $objecttmp->delete($user); + } + } if ($result <= 0) { setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); From ee55a5568f1985c33c865dedfc6a833350cdb8cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 3 Jun 2021 15:14:31 +0200 Subject: [PATCH 0373/1497] fix warning --- htdocs/core/tpl/commonfields_view.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/commonfields_view.tpl.php b/htdocs/core/tpl/commonfields_view.tpl.php index 4b7821c2dad..f9da77c5894 100644 --- a/htdocs/core/tpl/commonfields_view.tpl.php +++ b/htdocs/core/tpl/commonfields_view.tpl.php @@ -74,7 +74,7 @@ foreach ($object->fields as $key => $val) { if ($val['type'] == 'text') { print ' wordbreak'; } - if ($val['cssview']) { + if (!empty($val['cssview'])) { print ' '.$val['cssview']; } print '">'; From e83e399cb6f069125aa6392b955767af341cab06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 3 Jun 2021 15:19:54 +0200 Subject: [PATCH 0374/1497] fix warning --- htdocs/compta/paiement.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 12a6eb97d13..9c99fab4657 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -8,7 +8,7 @@ * Copyright (C) 2014 Raphaël Doursenaud * Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com> * Copyright (C) 2015 Juanjo Menent - * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2018-2021 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -465,7 +465,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie // Date payment print '
    '; From 0b28587e658e12ec1ab8b018c8e5c74771d28441 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 3 Jun 2021 15:28:47 +0200 Subject: [PATCH 0375/1497] fix warnings --- htdocs/compta/paiement.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 12a6eb97d13..b6a63b32466 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -598,7 +598,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; print "\n"; - $total = 0; + $total_ttc = 0; $totalrecu = 0; $totalrecucreditnote = 0; $totalrecudeposits = 0; @@ -754,15 +754,14 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie // Warning print ''; print "\n"; - $total += $objp->total; $total_ttc += $objp->total_ttc; $totalrecu += $paiement; $totalrecucreditnote += $creditnotes; From ca66cdad01f5a86728684d11da652b65fd8e3078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 3 Jun 2021 21:47:10 +0200 Subject: [PATCH 0376/1497] debug intracomm report transport mode --- htdocs/comm/card.php | 13 +++++++++++-- htdocs/core/class/commonobject.class.php | 2 +- htdocs/core/class/html.form.class.php | 4 ++-- htdocs/fourn/class/fournisseur.facture.class.php | 15 +++++++++++---- htdocs/fourn/facture/card.php | 12 ++++++------ 5 files changed, 31 insertions(+), 15 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 589559ea426..fc7378ecd93 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -184,6 +184,15 @@ if (empty($reshook)) { } } + // transport mode + if ($action == 'settransportmode' && $user->rights->societe->creer) { + $object->fetch($id); + $result = $object->setTransportMode(GETPOST('transport_mode_id', 'alpha')); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } + } + // Bank account if ($action == 'setbankaccount' && $user->rights->societe->creer) { $object->fetch($id); @@ -580,9 +589,9 @@ if ($object->id > 0) { print '
    '; print ''; // ancre pour retourner sur la ligne + print ''; // Show product and description $product_static->type = $line->fk_product_type; @@ -1049,17 +1066,15 @@ if ($action == 'create') // Qty print ''.$line->qty; - print 'id.'\' />'; - print ''; + print ''; + print ''; print ''; print ''; - - - $quantityDelivered = $object->receptions[$line->id]; + $quantityDelivered = $objectsrc->receptions[$line->id]; print $quantityDelivered; print ''; print ''.$formproduct->selectLotStock($detail_batch->fk_origin_stock, 'batchl'.$detail_batch->fk_expeditiondet.'_'.$detail_batch->fk_origin_stock, '', 1, 0, $lines[$i]->fk_product, $line->entrepot_id).''.$formproduct->selectLotStock($detail_batch->fk_origin_stock, 'batchl'.$detail_batch->fk_expeditiondet.'_'.$detail_batch->fk_origin_stock, '', 1, 0, $lines[$i]->fk_product, $entrepot_id).'
    ".dol_print_phone($obj->office_phone, $obj->country_code, 0, $obj->rowid, 'AC_TEL', ' ', 'phone')."'.dol_print_phone($obj->office_phone, $obj->country_code, 0, $obj->rowid, 'AC_TEL', ' ', 'phone')."".dol_print_phone($obj->user_mobile, $obj->country_code, 0, $obj->rowid, 'AC_TEL', ' ', 'mobile')."'.dol_print_phone($obj->user_mobile, $obj->country_code, 0, $obj->rowid, 'AC_TEL', ' ', 'mobile')."'.($obj->salary ? price($obj->salary) : '').''.($obj->salary ? price($obj->salary) : '').''.num_open_day($date_start_inmonth, $date_end_inmonth, 0, 1, $halfdayinmonth).''.dol_escape_htmltag(dolGetFirstLineOfText($obj->description)).''.dol_escape_htmltag(dolGetFirstLineOfText($obj->description)).'
    '.$langs->trans('Date').''; - $datepayment = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); + $datepayment = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); $datepayment = ($datepayment == '' ? (empty($conf->global->MAIN_AUTOFILL_DATE) ?-1 : '') : $datepayment); print $form->selectDate($datepayment, '', '', '', 0, "add_paiement", 1, 1, 0, '', '', $facture->date); print '
     
    '; //print "xx".$amounts[$invoice->id]."-".$amountsresttopay[$invoice->id]."
    "; - if ($amounts[$invoice->id] && (abs($amounts[$invoice->id]) > abs($amountsresttopay[$invoice->id])) - || $multicurrency_amounts[$invoice->id] && (abs($multicurrency_amounts[$invoice->id]) > abs($multicurrency_amountsresttopay[$invoice->id]))) { + if (!empty($amounts[$invoice->id]) && (abs($amounts[$invoice->id]) > abs($amountsresttopay[$invoice->id])) + || !empty($multicurrency_amounts[$invoice->id]) && (abs($multicurrency_amounts[$invoice->id]) > abs($multicurrency_amountsresttopay[$invoice->id]))) { print ' '.img_warning($langs->trans("PaymentHigherThanReminderToPay")); } print '
    '; print ''; if ($action == 'edittransportmode') { - $form->formSelectTransportMode($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->fk_transport_mode, 'fk_transport_mode', 1); + $form->formSelectTransportMode($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->transport_mode_id, 'transport_mode_id', 1); } else { - $form->formSelectTransportMode($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->fk_transport_mode, 'none'); + $form->formSelectTransportMode($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->transport_mode_id, 'none'); } print ""; print ''; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 3f4b2dd9ee6..33cfa7c8b32 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2566,7 +2566,7 @@ abstract class CommonObject /** * Change the transport mode methods * - * @param int $id Id of new payment method + * @param int $id Id of transport mode * @return int >0 if OK, <0 if KO */ public function setTransportMode($id) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 1f90b5f4fdc..dda350865af 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5289,9 +5289,9 @@ class Form global $langs; if ($htmlname != "none") { print ''; - print ''; + print ''; print ''; - $this->selectTransportMode($selected, $htmlname, 2, $addempty, 0, 0, $active); + $this->selectTransportMode($selected, $htmlname, 0, $addempty, 0, 0, $active); print ''; print ''; } else { diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 637f29e87b8..81533dae324 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -214,6 +214,11 @@ class FactureFournisseur extends CommonInvoice public $mode_reglement_id; public $mode_reglement_code; + /** + * @var int transport mode id + */ + public $transport_mode_id; + public $extraparams = array(); /** @@ -670,6 +675,7 @@ class FactureFournisseur extends CommonInvoice $sql .= ' s.nom as socnom, s.rowid as socid,'; $sql .= ' t.fk_incoterms, t.location_incoterms,'; $sql .= " i.libelle as label_incoterms,"; + $sql .= ' t.fk_transport_mode,'; $sql .= ' t.fk_multicurrency, t.multicurrency_code, t.multicurrency_tx, t.multicurrency_total_ht, t.multicurrency_total_tva, t.multicurrency_total_ttc'; $sql .= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as t'; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON (t.fk_soc = s.rowid)"; @@ -742,14 +748,15 @@ class FactureFournisseur extends CommonInvoice $this->fk_incoterms = $obj->fk_incoterms; $this->location_incoterms = $obj->location_incoterms; $this->label_incoterms = $obj->label_incoterms; + $this->transport_mode_id = $obj->fk_transport_mode; // Multicurrency - $this->fk_multicurrency = $obj->fk_multicurrency; + $this->fk_multicurrency = $obj->fk_multicurrency; $this->multicurrency_code = $obj->multicurrency_code; - $this->multicurrency_tx = $obj->multicurrency_tx; + $this->multicurrency_tx = $obj->multicurrency_tx; $this->multicurrency_total_ht = $obj->multicurrency_total_ht; - $this->multicurrency_total_tva = $obj->multicurrency_total_tva; - $this->multicurrency_total_ttc = $obj->multicurrency_total_ttc; + $this->multicurrency_total_tva = $obj->multicurrency_total_tva; + $this->multicurrency_total_ttc = $obj->multicurrency_total_ttc; $this->extraparams = (array) json_decode($obj->extraparams, true); diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 0bc26ea8f2b..a796ff81a0e 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1875,10 +1875,10 @@ if ($action == 'create') { $objectsrc->fetch_optionals(); $object->array_options = $objectsrc->array_options; } else { - $cond_reglement_id = $societe->cond_reglement_supplier_id; - $mode_reglement_id = $societe->mode_reglement_supplier_id; + $cond_reglement_id = $societe->cond_reglement_supplier_id; + $mode_reglement_id = $societe->mode_reglement_supplier_id; $transport_mode_id = $societe->transport_mode_supplier_id; - $fk_account = $societe->fk_account; + $fk_account = $societe->fk_account; $datetmp = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); $dateinvoice = ($datetmp == '' ? (empty($conf->global->MAIN_AUTOFILL_DATE) ?-1 : '') : $datetmp); $datetmp = dol_mktime(12, 0, 0, $_POST['echmonth'], $_POST['echday'], $_POST['echyear']); @@ -2889,12 +2889,12 @@ if ($action == 'create') { // Intracomm report if (!empty($conf->intracommreport->enabled)) { $langs->loadLangs(array("intracommreport")); - print ''; - print ''; From 350a4215445077fcb747e793f418adb95189a729 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Jun 2021 08:41:26 +0200 Subject: [PATCH 0377/1497] Update card.php --- htdocs/fourn/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index a796ff81a0e..a8a4cb63258 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2894,7 +2894,7 @@ if ($action == 'create') { print $langs->trans('IntracommReportTransportMode'); print ''; if ($action != 'editmode' && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)) { - print ''; + print ''; } print '
    '; + print '
    '; + print ''; if ($action != 'editmode' && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)) { - print ''; + print ''; } print '
    '; print $langs->trans('IntracommReportTransportMode'); print 'id.'">'.img_edit($langs->trans('SetMode'), 1).'id.'">'.img_edit().'
    '; print '
    id.'">'.img_edit().'id.'">'.img_edit().'
    '; print ''; From 3ae3137eaf9759d98a7422504496867984556f7a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Jun 2021 08:57:48 +0200 Subject: [PATCH 0378/1497] Missing picto --- htdocs/fourn/commande/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index e7f19d0671a..c02a311f633 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -881,10 +881,10 @@ if ($resql) { 'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), ); if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) { - $arrayofmassactions['createbills'] = $langs->trans("CreateInvoiceForThisSupplier"); + $arrayofmassactions['createbills'] = img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans("CreateInvoiceForThisSupplier"); } if ($user->rights->fournisseur->commande->supprimer) { - $arrayofmassactions['predelete'] = img_picto('', 'delete').$langs->trans("Delete"); + $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } if (in_array($massaction, array('presend', 'predelete', 'createbills'))) { $arrayofmassactions = array(); From 621aa9e6f368118e42ca9dffe9daaeb607ea542b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Jun 2021 09:27:33 +0200 Subject: [PATCH 0379/1497] Fix typo --- htdocs/fourn/paiement/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/paiement/list.php b/htdocs/fourn/paiement/list.php index 6a38ae2033d..4da69cfc0c1 100644 --- a/htdocs/fourn/paiement/list.php +++ b/htdocs/fourn/paiement/list.php @@ -254,10 +254,10 @@ if ($optioncss != '') { if ($search_ref) { $param .= '&search_ref='.urlencode($search_ref); } -if ($saerch_day) { +if ($search_day) { $param .= '&search_day='.urlencode($search_day); } -if ($saerch_month) { +if ($search_month) { $param .= '&search_month='.urlencode($search_month); } if ($search_year) { From 402d90554a8c421c048a941f493a787ff2e0d11d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Jun 2021 10:04:56 +0200 Subject: [PATCH 0380/1497] Clean code --- htdocs/accountancy/closure/index.php | 2 +- htdocs/accountancy/customer/index.php | 2 +- htdocs/accountancy/expensereport/index.php | 2 +- htdocs/accountancy/supplier/index.php | 2 +- htdocs/cashdesk/index_verif.php | 2 +- htdocs/public/agenda/agendaexport.php | 2 -- htdocs/public/project/index.php | 2 +- htdocs/public/project/new.php | 3 +-- 8 files changed, 7 insertions(+), 10 deletions(-) diff --git a/htdocs/accountancy/closure/index.php b/htdocs/accountancy/closure/index.php index 390c288b606..bcb3d7901f5 100644 --- a/htdocs/accountancy/closure/index.php +++ b/htdocs/accountancy/closure/index.php @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php'; // Load translation files required by the page -$langs->loadLangs(array("compta", "bills", "other", "main", "accountancy")); +$langs->loadLangs(array("compta", "bills", "other", "accountancy")); $socid = GETPOST('socid', 'int'); diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index d33f5e12312..9580e8bca37 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; // Load translation files required by the page -$langs->loadLangs(array("compta", "bills", "other", "main", "accountancy")); +$langs->loadLangs(array("compta", "bills", "other", "accountancy")); // Security check if (empty($conf->accounting->enabled)) { diff --git a/htdocs/accountancy/expensereport/index.php b/htdocs/accountancy/expensereport/index.php index b4e85fd517a..baeefa1bbfb 100644 --- a/htdocs/accountancy/expensereport/index.php +++ b/htdocs/accountancy/expensereport/index.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; // Load translation files required by the page -$langs->loadLangs(array("compta", "bills", "other", "main", "accountancy")); +$langs->loadLangs(array("compta", "bills", "other", "accountancy")); $month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1); if (GETPOST("year", 'int')) { diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index a69debeb0c0..c1a3ffe23a6 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; // Load translation files required by the page -$langs->loadLangs(array("compta", "bills", "other", "main", "accountancy")); +$langs->loadLangs(array("compta", "bills", "other", "accountancy")); // Security check if (empty($conf->accounting->enabled)) { diff --git a/htdocs/cashdesk/index_verif.php b/htdocs/cashdesk/index_verif.php index 47a1d90b76c..94e0e7009cf 100644 --- a/htdocs/cashdesk/index_verif.php +++ b/htdocs/cashdesk/index_verif.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/cashdesk/include/environnement.php'; require_once DOL_DOCUMENT_ROOT.'/cashdesk/class/Auth.class.php'; // Load translation files required by the page -$langs->loadLangs(array("main", "admin", "cashdesk")); +$langs->loadLangs(array("admin", "cashdesk")); $username = GETPOST("txtUsername"); $password = GETPOST("pwdPassword"); diff --git a/htdocs/public/agenda/agendaexport.php b/htdocs/public/agenda/agendaexport.php index 2aaeb12de23..cc255b185ed 100644 --- a/htdocs/public/agenda/agendaexport.php +++ b/htdocs/public/agenda/agendaexport.php @@ -212,9 +212,7 @@ if ($format == 'ical') { if ($format == 'rss') { $shortfilename .= '.rss'; $filename .= '.rss'; } - if ($shortfilename == 'dolibarrcalendar') { - $langs->load("main"); $langs->load("errors"); llxHeaderVierge(); print '
    '.$langs->trans("ErrorWrongValueForParameterX", 'format').'
    '; diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index ce48db9e729..013f290dc6a 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -72,7 +72,7 @@ $hookmanager->initHooks(array('newpayment')); global $dolibarr_main_instance_unique_id; // Load translation files -$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", "paybox", "paypal", "stripe")); // File with generic data +$langs->loadLangs(array("other", "dict", "bills", "companies", "errors", "paybox", "paypal", "stripe")); // File with generic data // Security check // No check on module enabled. Done later according to $validpaymentmethod diff --git a/htdocs/public/project/new.php b/htdocs/public/project/new.php index 048df9c41b3..e4a8b495d7c 100644 --- a/htdocs/public/project/new.php +++ b/htdocs/public/project/new.php @@ -60,13 +60,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; // Init vars $errmsg = ''; -$num = 0; $error = 0; $backtopage = GETPOST('backtopage', 'alpha'); $action = GETPOST('action', 'aZ09'); // Load translation files -$langs->loadLangs(array("main", "members", "companies", "install", "other")); +$langs->loadLangs(array("members", "companies", "install", "other")); // Security check if (empty($conf->projet->enabled)) { From 8c9bec3e3bdc7b62a02b987d10e814b375dc531a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Jun 2021 10:29:30 +0200 Subject: [PATCH 0381/1497] Code comment --- htdocs/expedition/class/expedition.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index f7c5a1d32a8..ea5bd17fdfb 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -468,11 +468,11 @@ class Expedition extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Create the detail (eat-by date) of the expedition line + * Create the detail of the expedition line. Create 1 record into expeditiondet for each warehouse and n record for each lot in this warehouse into expeditiondet_batch. * - * @param object $line_ext full line informations + * @param object $line_ext Objet with full information of line. $line_ext->detail_batch must be an array of ExpeditionLineBatch * @param array $array_options extrafields array - * @return int <0 if KO, >0 if OK + * @return int <0 if KO, >0 if OK */ public function create_line_batch($line_ext, $array_options = 0) { @@ -496,7 +496,7 @@ class Expedition extends CommonObject // create shipment batch lines for stockLocation foreach ($tab as $detbatch) { if ($detbatch->entrepot_id == $stockLocation) { - if (!($detbatch->create($line_id) > 0)) { // Create an expeditionlinebatch + if (!($detbatch->create($line_id) > 0)) { // Create an ExpeditionLineBatch $error++; } } From 174c6f8a455da035abceef8b7a31fefc59f9ba60 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Jun 2021 10:33:13 +0200 Subject: [PATCH 0382/1497] Update mouvementstock.class.php --- htdocs/product/stock/class/mouvementstock.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index ec2dfbc257e..ecdfdacbf44 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -355,7 +355,9 @@ class MouvementStock extends CommonObject $qtyisnotenough = 0; foreach ($product->stock_warehouse[$entrepot_id]->detail_batch as $batchcursor => $prodbatch) { - if ($batch !== $batchcursor) continue; // Do a strict comparison because $batchcursar can be an integer + if ((string) $batch != (string) $batchcursor) { // Lot '59' must be different than lot '59c' + continue; + } $foundforbatch = 1; if ($prodbatch->qty < abs($qty)) $qtyisnotenough = $prodbatch->qty; break; From e73dad30bb9a238a46d31e07449343f23225ebec Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Jun 2021 11:53:12 +0200 Subject: [PATCH 0383/1497] Warning --- htdocs/comm/mailing/card.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 86aff8a36e0..bbbebfad767 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -48,6 +48,7 @@ $confirm = GETPOST('confirm', 'alpha'); $urlfrom = GETPOST('urlfrom'); $object = new Mailing($db); + $result = $object->fetch($id); $extrafields = new ExtraFields($db); @@ -78,7 +79,7 @@ $listofmethods['mail'] = 'PHP mail function'; $listofmethods['smtps'] = 'SMTP/SMTPS socket library'; // Security check -if (!$user->rights->mailing->lire || (empty($conf->global->EXTERNAL_USERS_ARE_AUTHORIZED) && $user->socid > 0)) { +if (empty($user->rights->mailing->lire) || (empty($conf->global->EXTERNAL_USERS_ARE_AUTHORIZED) && $user->socid > 0)) { accessforbidden(); } From 1136e7dec537e58c0c4d6503b97465ae22e9750a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Jun 2021 11:57:59 +0200 Subject: [PATCH 0384/1497] Update inventory.php --- htdocs/product/inventory/inventory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index 212f0404bd9..eee7217eef3 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -254,7 +254,7 @@ if (empty($reshook)) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Product")), null, 'errors'); } - if (GETPOST('qtytoadd') < 0) { + if (price2num(GETPOST('qtytoadd'), 'MS') < 0) { $error++; setEventMessages($langs->trans("FieldCannotBeNegative", $langs->transnoentitiesnoconv("RealQty")), null, 'errors'); } From e26f0f155fdcc5c51e2c9a2ad9bc45ef7f5ec1c1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Jun 2021 12:00:54 +0200 Subject: [PATCH 0385/1497] Update inventory.php --- htdocs/product/inventory/inventory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index eee7217eef3..644e7ba2025 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -660,7 +660,7 @@ if ($object->id > 0) { // Real quantity print ''; if ($object->status == $object::STATUS_VALIDATED) { - $qty_view = GETPOST("id_".$obj->rowid) && GETPOST("id_".$obj->rowid) >= 0 ? GETPOST("id_".$obj->rowid) : $obj->qty_view; + $qty_view = GETPOST("id_".$obj->rowid) && price2num(GETPOST("id_".$obj->rowid), 'MS') >= 0 ? GETPOST("id_".$obj->rowid) : $obj->qty_view; $totalfound += price2num($qty_view, 'MS'); print ''; print ''; From c77dee0922b4b66225f08bd653acc7802f1e85ce Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Fri, 4 Jun 2021 12:27:50 +0200 Subject: [PATCH 0386/1497] changes to fetch after send --- htdocs/comm/mailing/card.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 73f31f34f01..0d321c08c09 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -408,7 +408,7 @@ if (empty($reshook)) { dol_syslog($db->error()); dol_print_error($db); } - + $object->fetch($id); $action = ''; } } @@ -677,7 +677,6 @@ if (empty($reshook)) { $form = new Form($db); $htmlother = new FormOther($db); -$object->fetch($id); $help_url = 'EN:Module_EMailing|FR:Module_Mailing|ES:Módulo_Mailing'; llxHeader( '', From e5ab721660ce528c5b53e76da76570d34f1b67a6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Jun 2021 12:30:46 +0200 Subject: [PATCH 0387/1497] Fix sanitize --- htdocs/holiday/month_report.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/holiday/month_report.php b/htdocs/holiday/month_report.php index eef3ca0dcbe..698d71e5dc7 100644 --- a/htdocs/holiday/month_report.php +++ b/htdocs/holiday/month_report.php @@ -154,7 +154,7 @@ if (!empty($search_employee) && $search_employee > 0) { $sql .= " AND cp.fk_user = ".((int) $search_employee); } if (!empty($search_type) && $search_type != '-1') { - $sql .= ' AND cp.fk_type IN ('.$db->escape($search_type).')'; + $sql .= ' AND cp.fk_type IN ('.$db->sanitize($search_type).')'; } if (!empty($search_description)) { $sql .= natural_search('cp.description', $search_description); From 01f5a5fb18fc722d644cb6e8f1f631eab26f0fd6 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Thu, 27 May 2021 16:03:17 +0200 Subject: [PATCH 0388/1497] Fix update receipt eatby --- htdocs/fourn/commande/dispatch.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 13989286e33..de09bb80ea4 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -464,7 +464,7 @@ if ($action == 'updateline' && $user->rights->fournisseur->commande->receptionne $product = $supplierorderdispatch->fk_product; $price = price2num(GETPOST('price'), '', 2); $comment = $supplierorderdispatch->comment; - $eatby = $supplierorderdispatch->fk_product; + $eatby = $supplierorderdispatch->eatby; $sellby = $supplierorderdispatch->sellby; $batch = $supplierorderdispatch->batch; From 34955b1cf9d9aab738b299850cd44a38ba5c40a5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Jun 2021 12:48:18 +0200 Subject: [PATCH 0389/1497] Fix sql --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 2 +- htdocs/install/mysql/tables/llx_product.sql | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index 25a6a6b09e8..3fb671fa9b2 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -418,7 +418,7 @@ UPDATE llx_propal SET fk_user_signature = fk_user_cloture WHERE fk_user_signatur UPDATE llx_propal SET date_signature = date_cloture WHERE date_signature IS NULL AND date_cloture IS NOT NULL; -ALTER TABLE llx_product ADD COLUMN batch_mask VARCHAR(32) NULL; +ALTER TABLE llx_product ADD COLUMN batch_mask VARCHAR(32) DEFAULT NULL; ALTER TABLE llx_product ADD COLUMN lifetime INTEGER NULL; ALTER TABLE llx_product ADD COLUMN qc_frequency INTEGER NULL; diff --git a/htdocs/install/mysql/tables/llx_product.sql b/htdocs/install/mysql/tables/llx_product.sql index 73b4473a5a4..4aad3393137 100644 --- a/htdocs/install/mysql/tables/llx_product.sql +++ b/htdocs/install/mysql/tables/llx_product.sql @@ -59,7 +59,7 @@ create table llx_product tobuy tinyint DEFAULT 1, -- Product you buy onportal tinyint DEFAULT 0, -- If it is a product you sell and you want to sell it on portal (module website must be on) tobatch tinyint DEFAULT 0 NOT NULL, -- Is it a product that need a batch management (eat-by or lot management) - batch_mask varchar(32), -- If the product has batch feature, you may want to use a batch mask per product + batch_mask varchar(32) DEFAULT NULL, -- If the product has batch feature, you may want to use a batch mask per product fk_product_type integer DEFAULT 0, -- Type of product: 0 for regular product, 1 for service, 9 for other (used by external module) duration varchar(6), seuil_stock_alerte float DEFAULT NULL, @@ -95,7 +95,7 @@ create table llx_product canvas varchar(32) DEFAULT NULL, finished tinyint DEFAULT NULL, -- see dictionnary c_product_nature lifetime integer DEFAULT NULL, - qc_frequency integer DEFAULT NULL, + qc_frequency integer DEFAULT NULL, -- Quality control periodicity hidden tinyint DEFAULT 0, -- Not used. Deprecated. import_key varchar(14), -- Import key model_pdf varchar(255), -- model save dodument used From 292d5f6a154b97ae939be55b174ebc999e88d777 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Jun 2021 12:55:03 +0200 Subject: [PATCH 0390/1497] Update card.php --- htdocs/compta/facture/card.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 02fb8467e21..c3ba878cdbf 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2232,11 +2232,10 @@ if (empty($reshook)) { $mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)); setEventMessages($mesg, null, 'errors'); } else { - // Add batchinfo if the detailline has batchinfo - - if (!empty($lines[$i]->detail_batch) && ! empty($conf->global->INCUDE_BATCHINFO_ON_INVOICE)) { + // Add batchinfo if the detail_batch array is defined + if (!empty($lines[$i]->detail_batch) && is_array($lines[$i]->detail_batch) && !empty($conf->global->INVOICE_INCUDE_DETAILS_OF_LOTS_SERIALS)) { foreach ($lines[$i]->detail_batch as $batchline) { - $desc .= ' '.$langs->trans('Batch').' '.$batchline->batch.' '.$langs->trans('printQty', $batchline->qty).' '; + $desc .= ' '.$langs->trans('Batch').' '.$batchline->batch.' '.$langs->trans('printQty', $batchline->qty).' '; } } From 43be7cf996e5c221264d3a6bcf1d1dc99ef01d10 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Jun 2021 12:56:40 +0200 Subject: [PATCH 0391/1497] Update card.php --- htdocs/compta/facture/card.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index c3ba878cdbf..9f91c462a40 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -67,7 +67,7 @@ if (!empty($conf->accounting->enabled)) { } // Load translation files required by the page -$langs->loadLangs(array('bills', 'companies', 'compta', 'products', 'banks', 'main', 'withdrawals','productbatch')); +$langs->loadLangs(array('bills', 'companies', 'compta', 'products', 'banks', 'main', 'withdrawals')); if (!empty($conf->incoterm->enabled)) { $langs->load('incoterm'); } @@ -2234,6 +2234,7 @@ if (empty($reshook)) { } else { // Add batchinfo if the detail_batch array is defined if (!empty($lines[$i]->detail_batch) && is_array($lines[$i]->detail_batch) && !empty($conf->global->INVOICE_INCUDE_DETAILS_OF_LOTS_SERIALS)) { + $langs->load('productbatch'); foreach ($lines[$i]->detail_batch as $batchline) { $desc .= ' '.$langs->trans('Batch').' '.$batchline->batch.' '.$langs->trans('printQty', $batchline->qty).' '; } From 8b5922a0df094f64ec602610b0c66f9804aa8408 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Jun 2021 12:57:43 +0200 Subject: [PATCH 0392/1497] 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 9f91c462a40..be9e23afecc 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2233,7 +2233,7 @@ if (empty($reshook)) { setEventMessages($mesg, null, 'errors'); } else { // Add batchinfo if the detail_batch array is defined - if (!empty($lines[$i]->detail_batch) && is_array($lines[$i]->detail_batch) && !empty($conf->global->INVOICE_INCUDE_DETAILS_OF_LOTS_SERIALS)) { + if (!empty($conf->productbatch->enabled) && !empty($lines[$i]->detail_batch) && is_array($lines[$i]->detail_batch) && !empty($conf->global->INVOICE_INCUDE_DETAILS_OF_LOTS_SERIALS)) { $langs->load('productbatch'); foreach ($lines[$i]->detail_batch as $batchline) { $desc .= ' '.$langs->trans('Batch').' '.$batchline->batch.' '.$langs->trans('printQty', $batchline->qty).' '; From 27018bd4b43d1e73efe0161c1124ee7aa0ec8985 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Jun 2021 14:25:32 +0200 Subject: [PATCH 0393/1497] Fix group by --- htdocs/compta/facture/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 56404aed78b..5180a9e7141 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -551,7 +551,7 @@ if (!$sall) $sql .= ' f.retained_warranty, f.retained_warranty_date_limit, f.situation_final, f.situation_cycle_ref, f.situation_counter,'; $sql .= ' f.fk_user_author, f.fk_multicurrency, f.multicurrency_code, f.multicurrency_tx, f.multicurrency_total_ht, f.multicurrency_total_tva,'; $sql .= ' f.multicurrency_total_tva, f.multicurrency_total_ttc,'; - $sql .= ' s.rowid, s.nom, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,'; + $sql .= ' s.rowid, s.nom, s.name_alias, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,'; $sql .= ' typent.code,'; $sql .= ' state.code_departement, state.nom,'; $sql .= ' country.code,'; From 2182e7fd54e299f7db7edd9bc5cecce82b6240c3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Jun 2021 14:36:52 +0200 Subject: [PATCH 0394/1497] Look and feel v14 --- htdocs/compta/facture/invoicetemplate_list.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 52dac1c462a..5f7e277076c 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -50,8 +50,7 @@ $confirm = GETPOST('confirm', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); $toselect = GETPOST('toselect', 'array'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'invoicetemplatelist'; // To manage different context of search - -$socid = GETPOST('socid', 'int'); +$optioncss = GETPOST('optioncss', 'alpha'); $socid = GETPOST('socid', 'int'); @@ -394,7 +393,7 @@ if ($resql) { if ($search_payment_term != '') { $param .= '&search_payment_term='.urlencode($search_payment_term); } - if ($search_recurring != '' && $search_recurrning != '-1') { + if ($search_recurring != '' && $search_recurring != '-1') { $param .= '&search_recurring='.urlencode($search_recurring); } if ($search_frequency > 0) { @@ -570,7 +569,7 @@ if ($resql) { if (!empty($arrayfields['s.nom']['checked'])) { print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER['PHP_SELF'], "s.nom", "", $param, "", $sortfield, $sortorder); } - if (!empty($arrayfields['f.total_total']['checked'])) { + if (!empty($arrayfields['f.total_ht']['checked'])) { print_liste_field_titre($arrayfields['f.total_ht']['label'], $_SERVER['PHP_SELF'], "f.total_ht", "", $param, 'class="right"', $sortfield, $sortorder); } if (!empty($arrayfields['f.total_tva']['checked'])) { @@ -789,12 +788,13 @@ if ($resql) { } } // Action column - print ''; + print ''; if ($user->rights->facture->creer && empty($invoicerectmp->suspended)) { if ($invoicerectmp->isMaxNbGenReached()) { print $langs->trans("MaxNumberOfGenerationReached"); } elseif (empty($objp->frequency) || $db->jdate($objp->date_when) <= $today) { print ''; + print img_picto($langs->trans("CreateBill"), 'add', 'class="paddingrightonly"'); print $langs->trans("CreateBill").''; } else { print $form->textwithpicto('', $langs->trans("DateIsNotEnough")); From 0147ffa737073733b603947ddd6aa2a7b15880f6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Jun 2021 14:38:22 +0200 Subject: [PATCH 0395/1497] Fix css --- .../triggers/interface_50_modLdap_Ldapsynchro.class.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php b/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php index 81054338b88..d4db5ebccfc 100644 --- a/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php +++ b/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php @@ -138,8 +138,7 @@ class InterfaceLdapsynchro extends DolibarrTriggers $container = $usergroup->_load_ldap_dn($oldinfo, 1); $search = "(".$usergroup->_load_ldap_dn($oldinfo, 2).")"; $records = $ldap->search($container, $search); - if (count($records) && $records['count'] == 0) - { + if (count($records) && $records['count'] == 0) { $olddn = ''; } @@ -157,12 +156,11 @@ class InterfaceLdapsynchro extends DolibarrTriggers $oldinfo = $usergroup->_load_ldap_info(); $olddn = $usergroup->_load_ldap_dn($oldinfo); - // Verify if entry exist + // Verify if an entry exists $container = $usergroup->_load_ldap_dn($oldinfo, 1); $search = "(".$usergroup->_load_ldap_dn($oldinfo, 2).")"; $records = $ldap->search($container, $search); - if (count($records) && $records['count'] == 0) - { + if (count($records) && $records['count'] == 0) { $olddn = ''; } From 56bb2bbd14e788b6f2cb643cd9506de6741124f7 Mon Sep 17 00:00:00 2001 From: TuxGasy Date: Fri, 4 Jun 2021 17:10:26 +0200 Subject: [PATCH 0396/1497] On dict, test $obj->code if empty before translation --- htdocs/admin/dict.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 2bd55c6c66a..f0b6ab5ec2b 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -2015,13 +2015,13 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') print ''; $transfound = 0; $transkey = ''; - if (in_array($fieldlist[$field], array('label', 'libelle')) and !empty($obj->code)) // For label + if (in_array($fieldlist[$field], array('label', 'libelle'))) // For label { // Special case for labels - if ($tabname == MAIN_DB_PREFIX.'c_civility') { + if ($tabname == MAIN_DB_PREFIX.'c_civility' && !empty($obj->code)) { $transkey = "Civility".strtoupper($obj->code); } - if ($tabname == MAIN_DB_PREFIX.'c_payment_term') { + if ($tabname == MAIN_DB_PREFIX.'c_payment_term' && !empty($obj->code)) { $langs->load("bills"); $transkey = "PaymentConditionShort".strtoupper($obj->code); } From 3fb1fb63b471b3f6a639a4dab7d6ce74ef68d7ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 4 Jun 2021 22:16:25 +0200 Subject: [PATCH 0397/1497] test zapier --- dev/examples/zapier/creates/thirdparty.js | 4 ++-- dev/examples/zapier/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/examples/zapier/creates/thirdparty.js b/dev/examples/zapier/creates/thirdparty.js index 3e20fd10e41..2abeef6ae4c 100644 --- a/dev/examples/zapier/creates/thirdparty.js +++ b/dev/examples/zapier/creates/thirdparty.js @@ -6,7 +6,7 @@ const createThirdparty = async (z, bundle) => { const response = await z.request({ method: 'POST', url: apiurl, - body: JSON.stringify({ + body: { name: bundle.inputData.name, name_alias: bundle.inputData.name_alias, ref_ext: bundle.inputData.ref_ext, @@ -24,7 +24,7 @@ const createThirdparty = async (z, bundle) => { code_client: bundle.inputData.code_client, code_fournisseur: bundle.inputData.code_fournisseur, sens: 'fromzapier' - }) + } }); const result = z.JSON.parse(response.content); // api returns an integer when ok, a json when ko diff --git a/dev/examples/zapier/package.json b/dev/examples/zapier/package.json index cc0768a27ef..4d5c5daa867 100644 --- a/dev/examples/zapier/package.json +++ b/dev/examples/zapier/package.json @@ -15,7 +15,7 @@ "npm": ">=5.6.0" }, "dependencies": { - "zapier-platform-core": "11.0.0" + "zapier-platform-core": "11.0.1" }, "devDependencies": { "mocha": "^5.2.0", From 3440024efebf877b219d66c55917d7ad4e0201f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 4 Jun 2021 22:35:05 +0200 Subject: [PATCH 0398/1497] test zapier --- dev/examples/zapier/triggers/thirdparty.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/dev/examples/zapier/triggers/thirdparty.js b/dev/examples/zapier/triggers/thirdparty.js index 4656f836e74..0fecd4434ce 100644 --- a/dev/examples/zapier/triggers/thirdparty.js +++ b/dev/examples/zapier/triggers/thirdparty.js @@ -56,6 +56,12 @@ const getThirdparty = (z, bundle) => { fournisseur: bundle.cleanedRequest.fournisseur, code_client: bundle.cleanedRequest.code_client, code_fournisseur: bundle.cleanedRequest.code_fournisseur, + idprof1: bundle.cleanedRequest.idprof1, + idprof2: bundle.cleanedRequest.idprof2, + idprof3: bundle.cleanedRequest.idprof3, + idprof4: bundle.cleanedRequest.idprof4, + idprof5: bundle.cleanedRequest.idprof5, + idprof6: bundle.cleanedRequest.idprof6, authorId: bundle.cleanedRequest.authorId, createdAt: bundle.cleanedRequest.createdAt, action: bundle.cleanedRequest.action @@ -170,7 +176,13 @@ module.exports = { {key: 'client', label: 'Customer/Prospect 0/1/2/3'}, {key: 'fournisseur', label: 'Supplier 0/1'}, {key: 'code_client', label: 'Customer code'}, - {key: 'code_fournisseur', label: 'Supplier code'} + {key: 'code_fournisseur', label: 'Supplier code'}, + {key: 'idprof1', label: 'Id Prof 1'}, + {key: 'idprof2', label: 'Id Prof 2'}, + {key: 'idprof3', label: 'Id Prof 3'}, + {key: 'idprof4', label: 'Id Prof 4'}, + {key: 'idprof5', label: 'Id Prof 5'}, + {key: 'idprof6', label: 'Id Prof 6'} ] } }; From c94946b934758236a82f3668ffcf969912b823a8 Mon Sep 17 00:00:00 2001 From: daraelmin Date: Fri, 4 Jun 2021 23:14:31 +0200 Subject: [PATCH 0399/1497] Fix #17743 - token was hashed with membersubscription #Fix #17743 - token was hashed with membersubscription for retro-compatibility we must try to hash token wth both "membre" ans "membersubscription" to verify unique secure key d'or member --- htdocs/public/payment/newpayment.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 377077531ae..f19aef7f79c 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -281,6 +281,9 @@ if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { if ($tmpsource && $REF) { $token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$tmpsource.$REF, 2); // Use the source in the hash to avoid duplicates if the references are identical + if ($SECUREKEY != $token) { + $token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$source.$REF, 2); // for retro-compatibility (token may have been hashed with membersubscription in external module) + } } else { $token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2); } From d327de4e80b0e0bf60e9256bd5f186f7ee00e792 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Jun 2021 23:39:52 +0200 Subject: [PATCH 0400/1497] Doc --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 531a19e0be9..34162fd5682 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ You can freely use, study, modify or distribute it according to its licence. You can use it as a standalone application or as a web application to access it from the Internet or a LAN. -Dolibarr has a large community ready to help you, free forums and [officially preferred partners ready to offer commercial support should you need it](https://partners.dolibarr.org) +Dolibarr has a large community ready to help you, free forums and [preferred partners ready to offer commercial support should you need it](https://partners.dolibarr.org) ![ScreenShot](https://www.dolibarr.org/medias/dolibarr_screenshot1_1920x1080.jpg) @@ -122,7 +122,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) - Electronic Document Management (EDM) - Foundations members management - Point of Sale (POS) -- … (around 100 modules available by default, + 1000 on the addon market place) +- … (around 100 modules available by default, 1000+ on the addon market place) ### Other application/modules From 420bf440ef32c98f08a9b6c6f50284336edf93a3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 Jun 2021 00:53:07 +0200 Subject: [PATCH 0401/1497] Update newpayment.php --- htdocs/public/payment/newpayment.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index f19aef7f79c..a0e6a1854fd 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -278,11 +278,13 @@ if ($tmpsource == 'membersubscription') { } $valid = true; if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { + $token = ''; + $tokenoldcompat = ''; if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { if ($tmpsource && $REF) { $token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$tmpsource.$REF, 2); // Use the source in the hash to avoid duplicates if the references are identical - if ($SECUREKEY != $token) { - $token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$source.$REF, 2); // for retro-compatibility (token may have been hashed with membersubscription in external module) + if ($tmpsource != $source) { + $tokenoldcompat = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$source.$REF, 2); // for retro-compatibility (token may have been hashed with membersubscription in external module) } } else { $token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2); @@ -290,7 +292,7 @@ if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { } else { $token = $conf->global->PAYMENT_SECURITY_TOKEN; } - if ($SECUREKEY != $token) { + if ($SECUREKEY != $token && $SECUREKEY != $tokenoldcompat) { if (empty($conf->global->PAYMENT_SECURITY_ACCEPT_ANY_TOKEN)) { $valid = false; // PAYMENT_SECURITY_ACCEPT_ANY_TOKEN is for backward compatibility } else { From 246cb09ba58a02b8479d21a48f9a5916c256fa29 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 Jun 2021 00:56:28 +0200 Subject: [PATCH 0402/1497] Update newpayment.php --- htdocs/public/payment/newpayment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index a0e6a1854fd..b71dd2df499 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -292,7 +292,7 @@ if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { } else { $token = $conf->global->PAYMENT_SECURITY_TOKEN; } - if ($SECUREKEY != $token && $SECUREKEY != $tokenoldcompat) { + if ($SECUREKEY != $token && (empty($tokenoldcompat) || $SECUREKEY != $tokenoldcompat)) { if (empty($conf->global->PAYMENT_SECURITY_ACCEPT_ANY_TOKEN)) { $valid = false; // PAYMENT_SECURITY_ACCEPT_ANY_TOKEN is for backward compatibility } else { From 6ae4a75ac2405562adbda1a045f5571b6b19cae5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 Jun 2021 01:04:09 +0200 Subject: [PATCH 0403/1497] Update fournisseur.commande.class.php --- htdocs/fourn/class/fournisseur.commande.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 9b643ff1464..be13ad412aa 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -749,8 +749,8 @@ class CommandeFournisseur extends CommonOrder $statusLong = $langs->transnoentitiesnoconv($this->statuts[$status]).$billedtext; $statusShort = $langs->transnoentitiesnoconv($this->statutshort[$status]); - $parameters = array('status' => $status, 'mode' => $mode, 'billed' => $billed, 'obj'=>$this); - $reshook = $hookmanager->executeHooks('LibStatut', $parameters, $object); // Note that $action and $object may have been modified by hook + $parameters = array('status' => $status, 'mode' => $mode, 'billed' => $billed); + $reshook = $hookmanager->executeHooks('LibStatut', $parameters, $this); // Note that $action and $object may have been modified by hook if ($reshook > 0) { return $hookmanager->resPrint; } From f0118183c848cbf5443bc394fa8c0cdad20e4d0e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 Jun 2021 01:11:05 +0200 Subject: [PATCH 0404/1497] Clean code --- .../class/fournisseur.commande.class.php | 2 + htdocs/public/payment/newpayment.php | 185 +++++++++--------- 2 files changed, 94 insertions(+), 93 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index d094916ef38..06f893026a5 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -156,6 +156,8 @@ class CommandeFournisseur extends CommonOrder public $user_approve_id; public $user_approve_id2; // Used when SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED is set + public $refuse_note; + public $extraparams = array(); /** diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 377077531ae..49093e0913e 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -907,7 +907,6 @@ print ''.$langs->trans("T $found = false; $error = 0; -$var = false; $object = null; @@ -923,17 +922,17 @@ if (!$source) { } // Creditor - print ''.$langs->trans("Creditor"); - print ''.$creditor.''; + print ''.$langs->trans("Creditor"); + print ''.$creditor.''; print ''; print ''."\n"; // Amount - print ''.$langs->trans("Amount"); + print ''.$langs->trans("Amount"); if (empty($amount)) { print ' ('.$langs->trans("ToComplete").')'; } - print ''; + print ''; if (empty($amount) || !is_numeric($amount)) { print ''; print ''; @@ -948,8 +947,8 @@ if (!$source) { print ''."\n"; // Tag - print ''.$langs->trans("PaymentCode"); - print ''.$fulltag.''; + print ''.$langs->trans("PaymentCode"); + print ''.$fulltag.''; print ''; print ''; print ''."\n"; @@ -995,14 +994,14 @@ if ($source == 'order') { $fulltag = dol_string_unaccent($fulltag); // Creditor - print ''.$langs->trans("Creditor"); - print ''.$creditor.''; + print ''.$langs->trans("Creditor"); + print ''.$creditor.''; print ''; print ''."\n"; // Debitor - print ''.$langs->trans("ThirdParty"); - print ''.$order->thirdparty->name.''; + print ''.$langs->trans("ThirdParty"); + print ''.$order->thirdparty->name.''; print ''."\n"; // Object @@ -1010,8 +1009,8 @@ if ($source == 'order') { if (GETPOST('desc', 'alpha')) { $text = ''.$langs->trans(GETPOST('desc', 'alpha')).''; } - print ''.$langs->trans("Designation"); - print ''.$text; + print ''.$langs->trans("Designation"); + print ''.$text; print ''; print ''; print ''; @@ -1024,11 +1023,11 @@ if ($source == 'order') { print ''."\n"; // Amount - print ''.$langs->trans("Amount"); + print ''.$langs->trans("Amount"); if (empty($amount)) { print ' ('.$langs->trans("ToComplete").')'; } - print ''; + print ''; if (empty($amount) || !is_numeric($amount)) { print ''; print ''; @@ -1043,8 +1042,8 @@ if ($source == 'order') { print ''."\n"; // Tag - print ''.$langs->trans("PaymentCode"); - print ''.$fulltag.''; + print ''.$langs->trans("PaymentCode"); + print ''.$fulltag.''; print ''; print ''; print ''."\n"; @@ -1119,14 +1118,14 @@ if ($source == 'invoice') { $fulltag = dol_string_unaccent($fulltag); // Creditor - print ''.$langs->trans("Creditor"); - print ''.$creditor.''; + print ''.$langs->trans("Creditor"); + print ''.$creditor.''; print ''; print ''."\n"; // Debitor - print ''.$langs->trans("ThirdParty"); - print ''.$invoice->thirdparty->name.''; + print ''.$langs->trans("ThirdParty"); + print ''.$invoice->thirdparty->name.''; print ''."\n"; // Object @@ -1134,8 +1133,8 @@ if ($source == 'invoice') { if (GETPOST('desc', 'alpha')) { $text = ''.$langs->trans(GETPOST('desc', 'alpha')).''; } - print ''.$langs->trans("Designation"); - print ''.$text; + print ''.$langs->trans("Designation"); + print ''.$text; print ''; print ''; print ''; @@ -1148,11 +1147,11 @@ if ($source == 'invoice') { print ''."\n"; // Amount - print ''.$langs->trans("PaymentAmount"); + print ''.$langs->trans("PaymentAmount"); if (empty($amount) && empty($object->paye)) { print ' ('.$langs->trans("ToComplete").')'; } - print ''; + print ''; if ($object->type == $object::TYPE_CREDIT_NOTE) { print ''.$langs->trans("CreditNote").''; } elseif (empty($object->paye)) { @@ -1174,8 +1173,8 @@ if ($source == 'invoice') { print ''."\n"; // Tag - print ''.$langs->trans("PaymentCode"); - print ''.$fulltag.''; + print ''.$langs->trans("PaymentCode"); + print ''.$fulltag.''; print ''; print ''; print ''."\n"; @@ -1290,14 +1289,14 @@ if ($source == 'contractline') { } // Creditor - print ''.$langs->trans("Creditor"); - print ''.$creditor.''; + print ''.$langs->trans("Creditor"); + print ''.$creditor.''; print ''; print ''."\n"; // Debitor - print ''.$langs->trans("ThirdParty"); - print ''.$contract->thirdparty->name.''; + print ''.$langs->trans("ThirdParty"); + print ''.$contract->thirdparty->name.''; print ''."\n"; // Object @@ -1319,8 +1318,8 @@ if ($source == 'contractline') { if (GETPOST('desc', 'alpha')) { $text = ''.$langs->trans(GETPOST('desc', 'alpha')).''; } - print ''.$langs->trans("Designation"); - print ''.$text; + print ''.$langs->trans("Designation"); + print ''.$text; print ''; print ''; print ''; @@ -1349,17 +1348,17 @@ if ($source == 'contractline') { $duration = $contractline->product->duration_value.' '.$dur[$contractline->product->duration_unit]; } } - print ''.$label.''; - print ''.($duration ? $duration : $qty).''; + print ''.$label.''; + print ''.($duration ? $duration : $qty).''; print ''; print ''."\n"; // Amount - print ''.$langs->trans("Amount"); + print ''.$langs->trans("Amount"); if (empty($amount)) { print ' ('.$langs->trans("ToComplete").')'; } - print ''; + print ''; if (empty($amount) || !is_numeric($amount)) { print ''; print ''; @@ -1374,8 +1373,8 @@ if ($source == 'contractline') { print ''."\n"; // Tag - print ''.$langs->trans("PaymentCode"); - print ''.$fulltag.''; + print ''.$langs->trans("PaymentCode"); + print ''.$fulltag.''; print ''; print ''; print ''."\n"; @@ -1451,14 +1450,14 @@ if ($source == 'member' || $source == 'membersubscription') { $fulltag = dol_string_unaccent($fulltag); // Creditor - print ''.$langs->trans("Creditor"); - print ''.$creditor.''; + print ''.$langs->trans("Creditor"); + print ''.$creditor.''; print ''; print ''."\n"; // Debitor - print ''.$langs->trans("Member"); - print ''; + print ''.$langs->trans("Member"); + print ''; if ($member->morphy == 'mor' && !empty($member->societe)) { print $member->societe; } else { @@ -1472,29 +1471,29 @@ if ($source == 'member' || $source == 'membersubscription') { if (GETPOST('desc', 'alpha')) { $text = ''.$langs->trans(GETPOST('desc', 'alpha')).''; } - print ''.$langs->trans("Designation"); - print ''.$text; + print ''.$langs->trans("Designation"); + print ''.$text; print ''; print ''; print ''."\n"; if ($object->datefin > 0) { - print ''.$langs->trans("DateEndSubscription"); - print ''.dol_print_date($member->datefin, 'day'); + print ''.$langs->trans("DateEndSubscription"); + print ''.dol_print_date($member->datefin, 'day'); print ''."\n"; } if ($member->last_subscription_date || $member->last_subscription_amount) { // Last subscription date - print ''.$langs->trans("LastSubscriptionDate"); - print ''.dol_print_date($member->last_subscription_date, 'day'); + print ''.$langs->trans("LastSubscriptionDate"); + print ''.dol_print_date($member->last_subscription_date, 'day'); print ''."\n"; // Last subscription amount - print ''.$langs->trans("LastSubscriptionAmount"); - print ''.price($member->last_subscription_amount); + print ''.$langs->trans("LastSubscriptionAmount"); + print ''.price($member->last_subscription_amount); print ''."\n"; if (empty($amount) && !GETPOST('newamount', 'alpha')) { @@ -1513,8 +1512,8 @@ if ($source == 'member' || $source == 'membersubscription') { $amountbytype = $adht->amountByType(1); // Last member type - print ''.$langs->trans("LastMemberType"); - print ''.dol_escape_htmltag($member->type); + print ''.$langs->trans("LastMemberType"); + print ''.dol_escape_htmltag($member->type); print "\n"; // Set the new member type @@ -1526,25 +1525,25 @@ if ($source == 'member' || $source == 'membersubscription') { // Set amount for the subscription $amount = (!empty($amountbytype[$member->typeid])) ? $amountbytype[$member->typeid] : $member->last_subscription_amount; - print ''.$langs->trans("NewSubscription"); - print ''; + print ''.$langs->trans("NewSubscription"); + print ''; print $form->selectarray("typeid", $adht->liste_array(1), $member->typeid, 0, 0, 0, 'onchange="window.location.replace(\''.$urlwithroot.'/public/payment/newpayment.php?source='.urlencode($source).'&ref='.urlencode($ref).'&amount='.urlencode($amount).'&typeid=\' + this.value + \'&securekey='.urlencode($SECUREKEY).'\');"', 0, 0, 0, '', '', 1); print "\n"; } elseif ($action == dopayment) { - print ''.$langs->trans("NewMemberType"); - print ''.dol_escape_htmltag($member->type); + print ''.$langs->trans("NewMemberType"); + print ''.dol_escape_htmltag($member->type); print ''; print "\n"; } } else { - print ''.$langs->trans("MemberType"); - print ''.dol_escape_htmltag($member->type); + print ''.$langs->trans("MemberType"); + print ''.dol_escape_htmltag($member->type); print "\n"; } } // Amount - print ''.$langs->trans("Amount"); + print ''.$langs->trans("Amount"); if (empty($amount)) { if (empty($conf->global->MEMBER_NEWFORM_AMOUNT)) { print ' ('.$langs->trans("ToComplete"); @@ -1556,7 +1555,7 @@ if ($source == 'member' || $source == 'membersubscription') { print ')'; } } - print ''; + print ''; $valtoshow = ''; if (empty($amount) || !is_numeric($amount)) { $valtoshow = price2num(GETPOST("newamount", 'alpha'), 'MT'); @@ -1601,8 +1600,8 @@ if ($source == 'member' || $source == 'membersubscription') { print ''."\n"; // Tag - print ''.$langs->trans("PaymentCode"); - print ''.$fulltag.''; + print ''.$langs->trans("PaymentCode"); + print ''.$fulltag.''; print ''; print ''; print ''."\n"; @@ -1677,14 +1676,14 @@ if ($source == 'donation') { $fulltag = dol_string_unaccent($fulltag); // Creditor - print ''.$langs->trans("Creditor"); - print ''.$creditor.''; + print ''.$langs->trans("Creditor"); + print ''.$creditor.''; print ''; print ''."\n"; // Debitor - print ''.$langs->trans("ThirdParty"); - print ''; + print ''.$langs->trans("ThirdParty"); + print ''; if ($don->morphy == 'mor' && !empty($don->societe)) { print $don->societe; } else { @@ -1698,14 +1697,14 @@ if ($source == 'donation') { if (GETPOST('desc', 'alpha')) { $text = ''.$langs->trans(GETPOST('desc', 'alpha')).''; } - print ''.$langs->trans("Designation"); - print ''.$text; + print ''.$langs->trans("Designation"); + print ''.$text; print ''; print ''; print ''."\n"; // Amount - print ''.$langs->trans("Amount"); + print ''.$langs->trans("Amount"); if (empty($amount)) { if (empty($conf->global->MEMBER_NEWFORM_AMOUNT)) { print ' ('.$langs->trans("ToComplete"); @@ -1717,7 +1716,7 @@ if ($source == 'donation') { print ')'; } } - print ''; + print ''; $valtoshow = ''; if (empty($amount) || !is_numeric($amount)) { $valtoshow = price2num(GETPOST("newamount", 'alpha'), 'MT'); @@ -1757,8 +1756,8 @@ if ($source == 'donation') { print ''."\n"; // Tag - print ''.$langs->trans("PaymentCode"); - print ''.$fulltag.''; + print ''.$langs->trans("PaymentCode"); + print ''.$fulltag.''; print ''; print ''; print ''."\n"; @@ -1811,29 +1810,29 @@ if ($source == 'conferencesubscription') { $fulltag = dol_string_unaccent($fulltag); // Creditor - print ''.$langs->trans("Creditor"); - print ''.$creditor.''; + print ''.$langs->trans("Creditor"); + print ''.$creditor.''; print ''; print ''."\n"; // Debitor - print ''.$langs->trans("Attendee"); - print ''; + print ''.$langs->trans("Attendee"); + print ''; print $thirdparty->name; print ''; print ''."\n"; // Object $text = ''.$langs->trans("PaymentConferenceAttendee").''; - print ''.$langs->trans("Designation"); - print ''.$text; + print ''.$langs->trans("Designation"); + print ''.$text; print ''; print ''; print ''."\n"; // Amount - print ''.$langs->trans("Amount"); - print ''; + print ''.$langs->trans("Amount"); + print ''; $valtoshow = $amount; print ''.price($valtoshow).''; print ''; @@ -1845,8 +1844,8 @@ if ($source == 'conferencesubscription') { print ''."\n"; // Tag - print ''.$langs->trans("PaymentCode"); - print ''.$fulltag.''; + print ''.$langs->trans("PaymentCode"); + print ''.$fulltag.''; print ''; print ''; print ''."\n"; @@ -1897,29 +1896,29 @@ if ($source == 'boothlocation') { $fulltag = dol_string_unaccent($fulltag); // Creditor - print ''.$langs->trans("Creditor"); - print ''.$creditor.''; + print ''.$langs->trans("Creditor"); + print ''.$creditor.''; print ''; print ''."\n"; // Debitor - print ''.$langs->trans("Attendee"); - print ''; + print ''.$langs->trans("Attendee"); + print ''; print $thirdparty->name; print ''; print ''."\n"; // Object $text = ''.$langs->trans("PaymentBoothLocation").''; - print ''.$langs->trans("Designation"); - print ''.$text; + print ''.$langs->trans("Designation"); + print ''.$text; print ''; print ''; print ''."\n"; // Amount - print ''.$langs->trans("Amount"); - print ''; + print ''.$langs->trans("Amount"); + print ''; $valtoshow = $amount; print ''.price($valtoshow).''; print ''; @@ -1931,8 +1930,8 @@ if ($source == 'boothlocation') { print ''."\n"; // Tag - print ''.$langs->trans("PaymentCode"); - print ''.$fulltag.''; + print ''.$langs->trans("PaymentCode"); + print ''.$fulltag.''; print ''; print ''; print ''."\n"; From 3e53ab5bfe13144ce3deee0e7fe345dac8fe31d2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 Jun 2021 01:17:16 +0200 Subject: [PATCH 0405/1497] Fix scrutinizer --- htdocs/user/class/api_users.class.php | 6 ++---- htdocs/user/class/user.class.php | 5 +++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index e760997f3c8..9fa84042c3a 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -248,8 +248,8 @@ class Users extends DolibarrApi * * @url GET /info * - * @param int $includepermissions Set this to 1 to have the array of permissions loaded (not done by default for performance purpose) - * @return array|mixed Data without useless information + * @param int $includepermissions Set this to 1 to have the array of permissions loaded (not done by default for performance purpose) + * @return array|mixed Data without useless information * * @throws RestException 401 Insufficient rights * @throws RestException 404 User or group not found @@ -371,11 +371,9 @@ class Users extends DolibarrApi if ($field == 'pass') { if ($this->useraccount->id != DolibarrApiAccess::$user->id && empty(DolibarrApiAccess::$user->rights->user->user->password)) { throw new RestException(401, 'You are not allowed to modify password of other users'); - continue; } if ($this->useraccount->id == DolibarrApiAccess::$user->id && empty(DolibarrApiAccess::$user->rights->user->self->password)) { throw new RestException(401, 'You are not allowed to modify your own password'); - continue; } } if (DolibarrApiAccess::$user->admin) { // If user for API is admin diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index b8e63ea8f19..910edce8c17 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -299,6 +299,11 @@ class User extends CommonObject */ public $nb_rights; + /** + * @var array To store list of groups of user (used by API /info for example) + */ + public $user_group_list; + /** * @var array Cache array of already loaded permissions */ From 39adaec7eb9616c543d709ab539461dec48a27af Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 Jun 2021 01:29:24 +0200 Subject: [PATCH 0406/1497] Fix var not found --- htdocs/compta/bank/class/account.class.php | 8 +++++++- htdocs/compta/charges/index.php | 10 ++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 8c29a9ffc36..e629d7620f0 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -177,6 +177,10 @@ class Account extends CommonObject * @var int ID */ public $fk_accountancy_journal; + /** + * @var string Label of journal + */ + public $accountancy_journal; /** * Currency code @@ -281,6 +285,7 @@ class Account extends CommonObject 'rappro' =>array('type'=>'smallint(6)', 'label'=>'Rappro', 'enabled'=>1, 'visible'=>-1, 'position'=>120), 'url' =>array('type'=>'varchar(128)', 'label'=>'Url', 'enabled'=>1, 'visible'=>-1, 'position'=>125), 'account_number' =>array('type'=>'varchar(32)', 'label'=>'Account number', 'enabled'=>1, 'visible'=>-1, 'position'=>130), + 'fk_accountancy_journal' =>array('type'=>'integer', 'label'=>'Accountancy journal ID', 'enabled'=>1, 'visible'=>-1, 'position'=>132), 'accountancy_journal' =>array('type'=>'varchar(20)', 'label'=>'Accountancy journal', 'enabled'=>1, 'visible'=>-1, 'position'=>135), 'currency_code' =>array('type'=>'varchar(3)', 'label'=>'Currency code', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>140), 'min_allowed' =>array('type'=>'integer', 'label'=>'Min allowed', 'enabled'=>1, 'visible'=>-1, 'position'=>145), @@ -294,7 +299,6 @@ class Account extends CommonObject 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>175), 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>180), 'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>-1, 'position'=>185), - 'fk_accountancy_journal' =>array('type'=>'integer', 'label'=>'Fk accountancy journal', 'enabled'=>1, 'visible'=>-1, 'position'=>190), ); // END MODULEBUILDER PROPERTIES @@ -311,9 +315,11 @@ class Account extends CommonObject */ const TYPE_SAVINGS = 0; + const STATUS_OPEN = 0; const STATUS_CLOSED = 1; + /** * Constructor * diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index f171546f6c1..be7c88c0a1a 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -227,9 +227,10 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) { $accountstatic->id = $obj->bid; $accountstatic->ref = $obj->bref; $accountstatic->number = $obj->bnumber; - $accountstatic->accountancy_number = $obj->account_number; - $accountstatic->accountancy_journal = $obj->accountancy_journal; + $accountstatic->account_number = $obj->account_number; + $accountstatic->fk_accountancy_journal = $obj->fk_accountancy_journal; $accountstatic->label = $obj->blabel; + print $accountstatic->getNomUrl(1); } else { print ' '; @@ -348,9 +349,10 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) { $accountstatic->id = $obj->bid; $accountstatic->ref = $obj->bref; $accountstatic->number = $obj->bnumber; - $accountstatic->accountancy_number = $obj->account_number; - $accountstatic->accountancy_journal = $obj->accountancy_journal; + $accountstatic->account_number = $obj->account_number; + $accountstatic->fk_accountancy_journal = $obj->fk_accountancy_journal; $accountstatic->label = $obj->blabel; + print $accountstatic->getNomUrl(1); } else { print ' '; From b6ba1de3b39acb2835f9fa5e4fc9fbc760631e7c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 Jun 2021 02:18:45 +0200 Subject: [PATCH 0407/1497] Fix remove use of captcha on backoffice for ticket creation --- htdocs/core/class/html.formticket.class.php | 2 +- htdocs/ticket/card.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 23c220d43df..b10ac80416f 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -259,7 +259,7 @@ class FormTicket $doleditor->Create(); print ''; - if (!empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA)) { + if ($public && !empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; print ''; print ''; diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 5e2ef1e804b..96a5ad0c120 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -53,6 +53,7 @@ $ref = GETPOST('ref', 'alpha'); $projectid = GETPOST('projectid', 'int'); $cancel = GETPOST('cancel', 'alpha'); $action = GETPOST('action', 'aZ09'); +$backtopage = GETPOST('$backtopage', 'alpha'); $notifyTiers = GETPOST("notify_tiers_at_create", 'alpha'); @@ -152,7 +153,7 @@ if (empty($reshook)) { } // Action to add an action (not a message) - if (GETPOST('add', 'alpha') && $user->rights->ticket->write) { + if (GETPOST('add', 'alpha') && !empty($user->rights->ticket->write)) { $error = 0; if (!GETPOST("subject", 'alphanohtml')) { From 865bf3b8493c4273f0e0f6e30fa05aa8ddc7c843 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 Jun 2021 02:42:49 +0200 Subject: [PATCH 0408/1497] CSS --- htdocs/theme/eldy/global.inc.php | 4 ++-- htdocs/theme/md/style.css.php | 9 +++++++-- htdocs/ticket/class/actions_ticket.class.php | 8 +++++--- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 4468c36a7da..70e5229ba28 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -348,7 +348,7 @@ a.butStatus { padding-right: 5px; background-color: transparent; color: var(--colortext) !important; - border: 2px solid var( --butactionbg); + border: 2px solid var( --butactionbg) !important; margin: 0 0.45em !important; } @@ -3894,7 +3894,7 @@ table.noborder.paymenttable { } .paymenttable tr td:first-child, .margintable tr td:first-child { - padding-left: 2px; + //padding-left: 2px; } .paymenttable, .margintable tr td { height: 22px; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index f1fb649f4af..7dd19673b5e 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -3902,14 +3902,19 @@ tr.liste_sub_total, tr.liste_sub_total td { } .paymenttable, .margintable { + margin: 0px 0px 0px 0px !important; +} +.paymenttable, .margintable:not(.margintablenotop) { border-top-width: px !important; border-top-color: rgb() !important; border-top-style: solid !important; - margin: 0px 0px 0px 0px !important; +} +.margintable.margintablenotop { + border-top-width: 0; } .paymenttable tr td:first-child, .margintable tr td:first-child { - padding-left: 2px; + //padding-left: 2px; } .paymenttable, .margintable tr td { height: 22px; diff --git a/htdocs/ticket/class/actions_ticket.class.php b/htdocs/ticket/class/actions_ticket.class.php index eb6193d58f1..b787a437899 100644 --- a/htdocs/ticket/class/actions_ticket.class.php +++ b/htdocs/ticket/class/actions_ticket.class.php @@ -192,7 +192,7 @@ class ActionsTicket // Initial message print '
    '; print '
    '; // You can use div-table-responsive-no-min if you dont need reserved height for your table - print ''; + print '
    '; print ''; } // Date end if (!empty($arrayfields['d.date_fin']['checked'])) { print ''; } // Date valid From c1757bdbd8b0476274ba452e774857fb51a8c754 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 6 Jun 2021 06:28:38 +0200 Subject: [PATCH 0427/1497] Remove warning --- htdocs/compta/paiement/list.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index b6835765c00..ee847603954 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -71,6 +71,7 @@ $search_paymenttype = GETPOST("search_paymenttype"); $search_account = GETPOST("search_account", "int"); $search_payment_num = GETPOST('search_payment_num', 'alpha'); $search_amount = GETPOST("search_amount", 'alpha'); // alpha because we must be able to search on "< x" +$search_status = GETPOST('search_status', 'intcomma'); $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); @@ -142,11 +143,13 @@ if (empty($reshook)) { $search_date_endmonth = ''; $search_date_endyear = ''; $search_date_start = ''; + $search_date_end = ''; $search_account = ''; $search_amount = ''; $search_paymenttype = ''; $search_payment_num = ''; $search_company = ''; + $search_status = ''; $option = ''; $toselect = ''; $search_array_options = array(); @@ -348,10 +351,12 @@ if ($search_all) { $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields +$massactionbutton = ''; if ($massactionbutton) { $selectedfields .= $form->showCheckAddButtons('checkforselect', 1); } +$moreforfilter = ''; print '
    '; print '
    '; print $langs->trans("InitialMessage"); print ''; @@ -391,7 +391,7 @@ class ActionsTicket { global $langs; - print '
    '; + print '

    '; + print ''; + print ''; + print '
    '; } /** From 466bc2625663f7b775dc8302e37cf21129b873d9 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 5 Jun 2021 07:16:43 +0200 Subject: [PATCH 0409/1497] Fix with search_date_startxxx --- htdocs/fourn/paiement/list.php | 42 ++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/htdocs/fourn/paiement/list.php b/htdocs/fourn/paiement/list.php index 6b932ae2019..39ad7131b24 100644 --- a/htdocs/fourn/paiement/list.php +++ b/htdocs/fourn/paiement/list.php @@ -49,13 +49,19 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 've $socid = GETPOST('socid', 'int'); $search_ref = GETPOST('search_ref', 'alpha'); -$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int')); -$search_date_end = dol_mktime(23, 59, 59, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int')); -$search_company = GETPOST('search_company', 'alpha'); +$search_date_startday = GETPOST('search_date_startday', 'int'); +$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); +$search_date_startyear = GETPOST('search_date_startyear', 'int'); +$search_date_endday = GETPOST('search_date_endday', 'int'); +$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); +$search_date_endyear = GETPOST('search_date_endyear', 'int'); +$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver +$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); +$search_company = GETPOST('search_company', 'alpha'); $search_payment_type = GETPOST('search_payment_type'); -$search_cheque_num = GETPOST('search_cheque_num', 'alpha'); +$search_cheque_num = GETPOST('search_cheque_num', 'alpha'); $search_bank_account = GETPOST('search_bank_account', 'int'); -$search_amount = GETPOST('search_amount', 'alpha'); // alpha because we must be able to search on '< x' +$search_amount = GETPOST('search_amount', 'alpha'); // alpha because we must be able to search on '< x' $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'alpha'); @@ -135,6 +141,12 @@ if (empty($reshook)) { if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers $search_ref = ''; + $search_date_startday = ''; + $search_date_startmonth = ''; + $search_date_startyear = ''; + $search_date_endday = ''; + $search_date_endmonth = ''; + $search_date_endyear = ''; $search_date_start = ''; $search_date_end = ''; $search_company = ''; @@ -259,11 +271,23 @@ if ($optioncss != '') { if ($search_ref) { $param .= '&search_ref='.urlencode($search_ref); } -if ($search_date_start) { - $param.= '&search_date_start='.urlencode($search_date_start); +if ($search_date_startday) { + $param .= '&search_date_startday='.urlencode($search_date_startday); } -if ($search_date_end) { - $param.= '&search_date_end='.urlencode($search_date_end); +if ($search_date_startmonth) { + $param .= '&search_date_startmonth='.urlencode($search_date_startmonth); +} +if ($search_date_startyear) { + $param .= '&search_date_startyear='.urlencode($search_date_startyear); +} +if ($search_date_endday) { + $param .= '&search_date_endday='.urlencode($search_date_endday); +} +if ($search_date_endmonth) { + $param .= '&search_date_endmonth='.urlencode($search_date_endmonth); +} +if ($search_date_endyear) { + $param .= '&search_date_endyear='.urlencode($search_date_endyear); } if ($search_company) { $param .= '&search_company='.urlencode($search_company); From a92bd31ce14d46b5786ad5fc303d5452a5af3b5e Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 5 Jun 2021 07:39:15 +0200 Subject: [PATCH 0410/1497] Fix search_datexxx --- htdocs/compta/paiement/list.php | 68 +++++++++++++++++++++++++-------- 1 file changed, 53 insertions(+), 15 deletions(-) diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index c06f8ee9cb5..b6835765c00 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -5,7 +5,7 @@ * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Juanjo Menent - * Copyright (C) 2017 Alexandre Spangaro + * Copyright (C) 2017-2021 Alexandre Spangaro * Copyright (C) 2018 Ferran Marcet * Copyright (C) 2018 Charlene Benke * Copyright (C) 2020 Tobias Sekan @@ -58,12 +58,18 @@ $socid = GETPOST('socid', 'int'); $userid = GETPOST('userid', 'int'); $search_ref = GETPOST("search_ref", "alpha"); -$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int')); -$search_date_end = dol_mktime(23, 59, 59, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int')); -$search_company = GETPOST("search_company", 'alpha'); -$search_paymenttype = GETPOST("search_paymenttype"); -$search_account = GETPOST("search_account", "int"); -$search_payment_num = GETPOST('search_payment_num', 'alpha'); +$search_date_startday = GETPOST('search_date_startday', 'int'); +$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); +$search_date_startyear = GETPOST('search_date_startyear', 'int'); +$search_date_endday = GETPOST('search_date_endday', 'int'); +$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); +$search_date_endyear = GETPOST('search_date_endyear', 'int'); +$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver +$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); +$search_company = GETPOST("search_company", 'alpha'); +$search_paymenttype = GETPOST("search_paymenttype"); +$search_account = GETPOST("search_account", "int"); +$search_payment_num = GETPOST('search_payment_num', 'alpha'); $search_amount = GETPOST("search_amount", 'alpha'); // alpha because we must be able to search on "< x" $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; @@ -129,8 +135,13 @@ if (empty($reshook)) { // All tests are required to be compatible with all browsers if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { $search_ref = ''; + $search_date_startday = ''; + $search_date_startmonth = ''; + $search_date_startyear = ''; + $search_date_endday = ''; + $search_date_endmonth = ''; + $search_date_endyear = ''; $search_date_start = ''; - $search_date_end = ''; $search_account = ''; $search_amount = ''; $search_paymenttype = ''; @@ -276,13 +287,40 @@ if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { if ($limit > 0 && $limit != $conf->liste_limit) { $param .= '&limit='.urlencode($limit); } -$param .= (GETPOST("orphelins") ? "&orphelins=1" : ''); -$param .= ($search_ref ? "&search_ref=".urlencode($search_ref) : ''); -$param .= ($search_date_start ? "&search_date_start=".urlencode($search_date_start) : ''); -$param .= ($search_date_end ? "&search_date_end=".urlencode($search_date_end) : ''); -$param .= ($search_company ? "&search_company=".urlencode($search_company) : ''); -$param .= ($search_amount ? "&search_amount=".urlencode($search_amount) : ''); -$param .= ($search_payment_num ? "&search_payment_num=".urlencode($search_payment_num) : ''); + +if (GETPOST("orphelins")) { + $param .= '&orphelins=1'; +} +if ($search_ref) { + $param .= '&search_ref='.urlencode($search_ref); +} +if ($search_date_startday) { + $param .= '&search_date_startday='.urlencode($search_date_startday); +} +if ($search_date_startmonth) { + $param .= '&search_date_startmonth='.urlencode($search_date_startmonth); +} +if ($search_date_startyear) { + $param .= '&search_date_startyear='.urlencode($search_date_startyear); +} +if ($search_date_endday) { + $param .= '&search_date_endday='.urlencode($search_date_endday); +} +if ($search_date_endmonth) { + $param .= '&search_date_endmonth='.urlencode($search_date_endmonth); +} +if ($search_date_endyear) { + $param .= '&search_date_endyear='.urlencode($search_date_endyear); +} +if ($search_company) { + $param .= '&search_company='.urlencode($search_company); +} +if ($search_amount != '') { + $param .= '&search_amount='.urlencode($search_amount); +} +if ($search_payment_num) { + $param .= '&search_payment_num='.urlencode($search_payment_num); +} if ($optioncss != '') { $param .= '&optioncss='.urlencode($optioncss); } From f6bc1c64144a51d2bb92e34acba8757926819a2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 5 Jun 2021 09:37:38 +0200 Subject: [PATCH 0411/1497] add trigger contact --- dev/examples/zapier/index.js | 2 ++ ...face_99_modZapier_ZapierTriggers.class.php | 19 +++++++++++++++++++ htdocs/societe/class/api_contacts.class.php | 2 +- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/dev/examples/zapier/index.js b/dev/examples/zapier/index.js index d1897673b39..d96df72e11f 100644 --- a/dev/examples/zapier/index.js +++ b/dev/examples/zapier/index.js @@ -2,6 +2,7 @@ const triggerAction = require('./triggers/action'); const triggerOrder = require('./triggers/order'); const triggerThirdparty = require('./triggers/thirdparty'); +const triggerContact = require('./triggers/contact'); const triggerTicket = require('./triggers/ticket'); const triggerUser = require('./triggers/user'); @@ -62,6 +63,7 @@ const App = { [triggerAction.key]: triggerAction, [triggerOrder.key]: triggerOrder, [triggerThirdparty.key]: triggerThirdparty, + [triggerContact.key]: triggerContact, [triggerTicket.key]: triggerTicket, [triggerUser.key]: triggerUser, }, diff --git a/htdocs/core/triggers/interface_99_modZapier_ZapierTriggers.class.php b/htdocs/core/triggers/interface_99_modZapier_ZapierTriggers.class.php index 4e808d5bf15..7d6f346449d 100644 --- a/htdocs/core/triggers/interface_99_modZapier_ZapierTriggers.class.php +++ b/htdocs/core/triggers/interface_99_modZapier_ZapierTriggers.class.php @@ -174,8 +174,27 @@ class InterfaceZapierTriggers extends DolibarrTriggers // Contacts case 'CONTACT_CREATE': + $resql = $this->db->query($sql); + while ($resql && $obj = $this->db->fetch_array($resql)) { + $cleaned = cleanObjectDatas(dol_clone($object)); + $json = json_encode($cleaned); + // call the zapierPostWebhook() function + zapierPostWebhook($obj['url'], $json); + } + $logtriggeraction = true; + break; case 'CONTACT_MODIFY': + $resql = $this->db->query($sql); + while ($resql && $obj = $this->db->fetch_array($resql)) { + $cleaned = cleanObjectDatas(dol_clone($object)); + $json = json_encode($cleaned); + // call the zapierPostWebhook() function + zapierPostWebhook($obj['url'], $json); + } + $logtriggeraction = true; + break; case 'CONTACT_DELETE': + break; case 'CONTACT_ENABLEDISABLE': break; // Products diff --git a/htdocs/societe/class/api_contacts.class.php b/htdocs/societe/class/api_contacts.class.php index f62fb894bd0..f87ca111164 100644 --- a/htdocs/societe/class/api_contacts.class.php +++ b/htdocs/societe/class/api_contacts.class.php @@ -75,7 +75,7 @@ class Contacts extends DolibarrApi throw new RestException(401, 'No permission to read contacts'); } - if ($id == 0) { + if ($id === 0) { $result = $this->contact->initAsSpecimen(); } else { $result = $this->contact->fetch($id); From 1d1c85ca98831ad4fb0bc8c406f779851cbebf28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 5 Jun 2021 09:38:33 +0200 Subject: [PATCH 0412/1497] add trigger contact --- dev/examples/zapier/triggers/contact.js | 175 ++++++++++++++++++++++++ 1 file changed, 175 insertions(+) create mode 100644 dev/examples/zapier/triggers/contact.js diff --git a/dev/examples/zapier/triggers/contact.js b/dev/examples/zapier/triggers/contact.js new file mode 100644 index 00000000000..6db4d7f5053 --- /dev/null +++ b/dev/examples/zapier/triggers/contact.js @@ -0,0 +1,175 @@ +const subscribeHook = (z, bundle) => { + // `z.console.log()` is similar to `console.log()`. + z.console.log('suscribing hook!'); + + // bundle.targetUrl has the Hook URL this app should call when an action is created. + const data = { + url: bundle.targetUrl, + event: bundle.event, + module: 'contact', + action: bundle.inputData.action + }; + + const url = bundle.authData.url + '/api/index.php/zapierapi/hook'; + + // You can build requests and our client will helpfully inject all the variables + // you need to complete. You can also register middleware to control this. + const options = { + url: url, + method: 'POST', + body: data, + }; + + // You may return a promise or a normal data structure from any perform method. + return z.request(options).then((response) => JSON.parse(response.content)); +}; + +const unsubscribeHook = (z, bundle) => { + // bundle.subscribeData contains the parsed response JSON from the subscribe + // request made initially. + z.console.log('unsuscribing hook!'); + + // You can build requests and our client will helpfully inject all the variables + // you need to complete. You can also register middleware to control this. + const options = { + url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id, + method: 'DELETE', + }; + + // You may return a promise or a normal data structure from any perform method. + return z.request(options).then((response) => JSON.parse(response.content)); +}; + +const getContact = (z, bundle) => { + // bundle.cleanedRequest will include the parsed JSON object (if it's not a + // test poll) and also a .querystring property with the URL's query string. + const contact = { + id: bundle.cleanedRequest.id, + name: bundle.cleanedRequest.name, + name_alias: bundle.cleanedRequest.name_alias, + firstname: bundle.cleanedRequest.firstname, + address: bundle.cleanedRequest.address, + zip: bundle.cleanedRequest.zip, + town: bundle.cleanedRequest.town, + email: bundle.cleanedRequest.email, + client: bundle.cleanedRequest.client, + fournisseur: bundle.cleanedRequest.fournisseur, + code_client: bundle.cleanedRequest.code_client, + code_fournisseur: bundle.cleanedRequest.code_fournisseur, + idprof1: bundle.cleanedRequest.idprof1, + idprof2: bundle.cleanedRequest.idprof2, + idprof3: bundle.cleanedRequest.idprof3, + idprof4: bundle.cleanedRequest.idprof4, + idprof5: bundle.cleanedRequest.idprof5, + idprof6: bundle.cleanedRequest.idprof6, + authorId: bundle.cleanedRequest.authorId, + createdAt: bundle.cleanedRequest.createdAt, + action: bundle.cleanedRequest.action + }; + + return [contact]; +}; + +const getFallbackRealContact = (z, bundle) => { + // For the test poll, you should get some real data, to aid the setup process. + const module = bundle.inputData.module; + const options = { + url: bundle.authData.url + '/api/index.php/contacts/0', + }; + + return z.request(options).then((response) => [JSON.parse(response.content)]); +}; + +// const getModulesChoices = (z/*, bundle*/) => { +// // For the test poll, you should get some real data, to aid the setup process. +// const options = { +// url: bundle.authData.url + '/api/index.php/zapierapi/getmoduleschoices', +// }; + +// return z.request(options).then((response) => JSON.parse(response.content)); +// }; +// const getModulesChoices = () => { +// return { +// orders: "Order", +// invoices: "Invoice", +// contacts: "Contact", +// contacts: "Contacts" +// }; +// }; + +// const getActionsChoices = (z, bundle) => { +// // For the test poll, you should get some real data, to aid the setup process. +// const module = bundle.inputData.module; +// const options = { +// url: url: bundle.authData.url + '/api/index.php/zapierapi/getactionschoices/thirparty`, +// }; + +// return z.request(options).then((response) => JSON.parse(response.content)); +// }; + +// We recommend writing your triggers separate like this and rolling them +// into the App definition at the end. +module.exports = { + key: 'contact', + + // You'll want to provide some helpful display labels and descriptions + // for users. Zapier will put them into the UX. + noun: 'Contact', + display: { + label: 'New Contact', + description: 'Triggers when a new thirdpaty action is done in Dolibarr.' + }, + + // `operation` is where the business logic goes. + operation: { + + // `inputFields` can define the fields a user could provide, + // we'll pass them in as `bundle.inputData` later. + inputFields: [ + { + key: 'action', + required: true, + type: 'string', + helpText: 'Which action of contact this should trigger on.', + choices: { + create: "Create", + modify: "Modify", + validate: "Validate", + } + } + ], + + type: 'hook', + + performSubscribe: subscribeHook, + performUnsubscribe: unsubscribeHook, + + perform: getContact, + performList: getFallbackRealContact, + + // In cases where Zapier needs to show an example record to the user, but we are unable to get a live example + // from the API, Zapier will fallback to this hard-coded sample. It should reflect the data structure of + // returned records, and have obviously dummy values that we can show to any user. + sample: { + id: 1, + createdAt: 1472069465, + lastname: 'DOE', + firstname: 'John', + authorId: 1, + action: 'create' + }, + + // If the resource can have fields that are custom on a per-user basis, define a function to fetch the custom + // field definitions. The result will be used to augment the sample. + // outputFields: () => { return []; } + // Alternatively, a static field definition should be provided, to specify labels for the fields + outputFields: [ + {key: 'id', type: "integer", label: 'ID'}, + {key: 'createdAt', label: 'Created At'}, + {key: 'lastname', label: 'Lastname'}, + {key: 'firstname', label: 'Firstname'}, + {key: 'authorId', type: "integer", label: 'Author ID'}, + {key: 'action', label: 'Action'} + ] + } +}; From e79be6f4872b3eedeb06c9bc8617250a672a6d21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 5 Jun 2021 09:41:14 +0200 Subject: [PATCH 0413/1497] add trigger contact --- dev/examples/zapier/triggers/contact.js | 12 +----------- dev/examples/zapier/triggers/thirdparty.js | 2 +- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/dev/examples/zapier/triggers/contact.js b/dev/examples/zapier/triggers/contact.js index 6db4d7f5053..547755d241d 100644 --- a/dev/examples/zapier/triggers/contact.js +++ b/dev/examples/zapier/triggers/contact.js @@ -52,16 +52,6 @@ const getContact = (z, bundle) => { zip: bundle.cleanedRequest.zip, town: bundle.cleanedRequest.town, email: bundle.cleanedRequest.email, - client: bundle.cleanedRequest.client, - fournisseur: bundle.cleanedRequest.fournisseur, - code_client: bundle.cleanedRequest.code_client, - code_fournisseur: bundle.cleanedRequest.code_fournisseur, - idprof1: bundle.cleanedRequest.idprof1, - idprof2: bundle.cleanedRequest.idprof2, - idprof3: bundle.cleanedRequest.idprof3, - idprof4: bundle.cleanedRequest.idprof4, - idprof5: bundle.cleanedRequest.idprof5, - idprof6: bundle.cleanedRequest.idprof6, authorId: bundle.cleanedRequest.authorId, createdAt: bundle.cleanedRequest.createdAt, action: bundle.cleanedRequest.action @@ -117,7 +107,7 @@ module.exports = { noun: 'Contact', display: { label: 'New Contact', - description: 'Triggers when a new thirdpaty action is done in Dolibarr.' + description: 'Triggers when a new contact action is done in Dolibarr.' }, // `operation` is where the business logic goes. diff --git a/dev/examples/zapier/triggers/thirdparty.js b/dev/examples/zapier/triggers/thirdparty.js index 0fecd4434ce..76194acbc9a 100644 --- a/dev/examples/zapier/triggers/thirdparty.js +++ b/dev/examples/zapier/triggers/thirdparty.js @@ -118,7 +118,7 @@ module.exports = { noun: 'Thirdparty', display: { label: 'New Thirdparty', - description: 'Triggers when a new thirdpaty action is done in Dolibarr.' + description: 'Triggers when a new thirdparty action is done in Dolibarr.' }, // `operation` is where the business logic goes. From 69d70d5ea8c3680691477547b44b75d144ed8c4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 5 Jun 2021 10:09:44 +0200 Subject: [PATCH 0414/1497] update connector version add trigger contact --- dev/examples/zapier/package.json | 4 ++-- dev/examples/zapier/triggers/contact.js | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dev/examples/zapier/package.json b/dev/examples/zapier/package.json index 4d5c5daa867..a9d519dec69 100644 --- a/dev/examples/zapier/package.json +++ b/dev/examples/zapier/package.json @@ -1,6 +1,6 @@ { "name": "dolibarr", - "version": "1.13.0", + "version": "1.14.0", "description": "An app for connecting Dolibarr to the Zapier platform.", "repository": "Dolibarr/dolibarr", "homepage": "https://www.dolibarr.org/", @@ -11,7 +11,7 @@ "test": "mocha --recursive" }, "engines": { - "node": "8.10.0", + "node": "14.0.0", "npm": ">=5.6.0" }, "dependencies": { diff --git a/dev/examples/zapier/triggers/contact.js b/dev/examples/zapier/triggers/contact.js index 547755d241d..2ba3bd226f8 100644 --- a/dev/examples/zapier/triggers/contact.js +++ b/dev/examples/zapier/triggers/contact.js @@ -52,6 +52,9 @@ const getContact = (z, bundle) => { zip: bundle.cleanedRequest.zip, town: bundle.cleanedRequest.town, email: bundle.cleanedRequest.email, + phone_pro: bundle.cleanedRequest.phone_pro, + phone_perso: bundle.cleanedRequest.phone_perso, + phone_mobile: bundle.cleanedRequest.phone_mobile, authorId: bundle.cleanedRequest.authorId, createdAt: bundle.cleanedRequest.createdAt, action: bundle.cleanedRequest.action @@ -158,6 +161,9 @@ module.exports = { {key: 'createdAt', label: 'Created At'}, {key: 'lastname', label: 'Lastname'}, {key: 'firstname', label: 'Firstname'}, + {key: 'phone', label: 'Phone pro'}, + {key: 'phone_perso', label: 'Phone perso'}, + {key: 'phone_mobile', label: 'Phone mobile'}, {key: 'authorId', type: "integer", label: 'Author ID'}, {key: 'action', label: 'Action'} ] From 7a93365836d0a6ad7450d3d3de193fbb1a470f8c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 Jun 2021 11:07:38 +0200 Subject: [PATCH 0415/1497] Fix bad name of var --- htdocs/core/lib/pdf.lib.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index d1c793c621c..6095abff8ee 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1325,31 +1325,31 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, $translatealsoifmodified = (!empty($conf->global->MAIN_MULTILANG_TRANSLATE_EVEN_IF_MODIFIED)); // By default if value was modified manually, we keep it (no translation because we don't have it) // TODO Instead of making a compare to see if param was modified, check that content contains reference translation. If yes, add the added part to the new translation - // ($textwasmodified is replaced with $textwasmodifiedorcompleted and we add completion). + // ($textwasnotmodified is replaced with $textwasmodifiedorcompleted and we add completion). // Set label // If we want another language, and if label is same than default language (we did force it to a specific value), we can use translation. //var_dump($outputlangs->defaultlang.' - '.$langs->defaultlang.' - '.$label.' - '.$prodser->label);exit; - $textwasmodified = ($label == $prodser->label); - if (!empty($prodser->multilangs[$outputlangs->defaultlang]["label"]) && ($textwasmodified || $translatealsoifmodified)) { + $textwasnotmodified = ($label == $prodser->label); + if (!empty($prodser->multilangs[$outputlangs->defaultlang]["label"]) && ($textwasnotmodified || $translatealsoifmodified)) { $label = $prodser->multilangs[$outputlangs->defaultlang]["label"]; } // Set desc // Manage HTML entities description test because $prodser->description is store with htmlentities but $desc no - $textwasmodified = false; + $textwasnotmodified = false; if (!empty($desc) && dol_textishtml($desc) && !empty($prodser->description) && dol_textishtml($prodser->description)) { - $textwasmodified = (strpos(dol_html_entity_decode($desc, ENT_QUOTES | ENT_HTML5), dol_html_entity_decode($prodser->description, ENT_QUOTES | ENT_HTML5)) !== false); + $textwasnotmodified = (strpos(dol_html_entity_decode($desc, ENT_QUOTES | ENT_HTML5), dol_html_entity_decode($prodser->description, ENT_QUOTES | ENT_HTML5)) !== false); } else { - $textwasmodified = ($desc == $prodser->description); + $textwasnotmodified = ($desc == $prodser->description); } - if (!empty($prodser->multilangs[$outputlangs->defaultlang]["description"]) && ($textwasmodified || $translatealsoifmodified)) { + if (!empty($prodser->multilangs[$outputlangs->defaultlang]["description"]) && ($textwasnotmodified || $translatealsoifmodified)) { $desc = $prodser->multilangs[$outputlangs->defaultlang]["description"]; } // Set note - $textwasmodified = ($note == $prodser->note); - if (!empty($prodser->multilangs[$outputlangs->defaultlang]["note"]) && ($textwasmodified || $translatealsoifmodified)) { + $textwasnotmodified = ($note == $prodser->note_public); + if (!empty($prodser->multilangs[$outputlangs->defaultlang]["note"]) && ($textwasnotmodified || $translatealsoifmodified)) { $note = $prodser->multilangs[$outputlangs->defaultlang]["note"]; } } From ddbfb5d73484954ff29a3d9e4bb67ddf948a6b89 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 Jun 2021 11:14:06 +0200 Subject: [PATCH 0416/1497] Fix translation of note of product --- htdocs/core/lib/pdf.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 6095abff8ee..880c63970f7 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1349,8 +1349,8 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, // Set note $textwasnotmodified = ($note == $prodser->note_public); - if (!empty($prodser->multilangs[$outputlangs->defaultlang]["note"]) && ($textwasnotmodified || $translatealsoifmodified)) { - $note = $prodser->multilangs[$outputlangs->defaultlang]["note"]; + if (!empty($prodser->multilangs[$outputlangs->defaultlang]["other"]) && ($textwasnotmodified || $translatealsoifmodified)) { + $note = $prodser->multilangs[$outputlangs->defaultlang]["other"]; } } } elseif ($object->element == 'facture' || $object->element == 'facturefourn') { From be97d66f5ba5e725dee3117dc90c9a29d1b15c72 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 Jun 2021 12:58:14 +0200 Subject: [PATCH 0417/1497] Look and feel v14 --- htdocs/langs/en_US/partnership.lang | 4 ++- .../admin/partnership_extrafields.php | 2 +- htdocs/partnership/admin/setup.php | 35 +++++++++++++++---- 3 files changed, 32 insertions(+), 9 deletions(-) diff --git a/htdocs/langs/en_US/partnership.lang b/htdocs/langs/en_US/partnership.lang index df9619533de..72868ab6ddf 100644 --- a/htdocs/langs/en_US/partnership.lang +++ b/htdocs/langs/en_US/partnership.lang @@ -32,10 +32,12 @@ ListOfPartnerships=List of partnership PartnershipSetup=Partnership setup PartnershipAbout=About Partnership PartnershipAboutPage=Partnership about page -partnershipforthirdpartyormember=Partnership is for a 'thirdparty' or for a 'member' +partnershipforthirdpartyormember=Partner status must be set on a 'thirdparty' or a 'member' PARTNERSHIP_IS_MANAGED_FOR=Partnership managed for PARTNERSHIP_BACKLINKS_TO_CHECK=Backlinks to check PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL=Nb of days before cancel status of partnership when subscription is expired +ReferingWebsiteCheck=Check of website referring +ReferingWebsiteCheckDesc=You can enable a feature to check that your partners has added a backlink to your website domains on their own website. # # Object diff --git a/htdocs/partnership/admin/partnership_extrafields.php b/htdocs/partnership/admin/partnership_extrafields.php index 7d819b3bbcb..f178bc893cd 100644 --- a/htdocs/partnership/admin/partnership_extrafields.php +++ b/htdocs/partnership/admin/partnership_extrafields.php @@ -98,7 +98,7 @@ llxHeader('', $title, $help_url); $linkback = ''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("PartnershipSetup"), $linkback, 'object_partnership'); +print load_fiche_titre($langs->trans("PartnershipSetup"), $linkback, 'title_setup'); $head = partnershipAdminPrepareHead(); diff --git a/htdocs/partnership/admin/setup.php b/htdocs/partnership/admin/setup.php index d681274106c..79c8c469eec 100644 --- a/htdocs/partnership/admin/setup.php +++ b/htdocs/partnership/admin/setup.php @@ -139,22 +139,22 @@ print ''; print ''; print ''; +print '
    '; // You can use div-table-responsive-no-min if you dont need reserved height for your table print ''; - print ''; -print ''; -print ''; -print ''; +print ''; +print ''; +print ''; print ''; - print ''; print ''; print ''; print ''; @@ -163,7 +163,7 @@ print ''; if ($conf->global->PARTNERSHIP_IS_MANAGED_FOR == 'member') { print ''; print ''; @@ -171,6 +171,25 @@ if ($conf->global->PARTNERSHIP_IS_MANAGED_FOR == 'member') { print ''; } +print '
    '.$langs->trans("Setting").''.$langs->trans("Value").''.$langs->trans("Examples").''.$langs->trans("Setting").''.$langs->trans("Value").''.$langs->trans("Examples").'
    '.$langs->trans("PARTNERSHIP_IS_MANAGED_FOR").''; print ''; +print ajax_combobox('select_PARTNERSHIP_IS_MANAGED_FOR'); print ''.$langs->trans("partnershipforthirdpartyormember").'
    '.$langs->trans("PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL").''; - $dnbdays = '7'; + $dnbdays = '15'; $backlinks = (!empty($conf->global->PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL)) ? $conf->global->PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL : $dnbdays; print ''; print '
    '; +print '
    '; + +print '
    '; + + +print_fiche_titre($langs->trans("ReferingWebsiteCheck"), '', ''); + +print ''.$langs->trans("ReferingWebsiteCheckDesc").'
    '; +print '
    '; + +print '
    '; // You can use div-table-responsive-no-min if you dont need reserved height for your table +print ''; + +print ''; +print ''; +print ''; +print ''; +print ''; print ''; print ''; print ''; print ''; - print '
    '.$langs->trans("Setting").''.$langs->trans("Value").''.$langs->trans("Examples").'
    '.$langs->trans("PARTNERSHIP_BACKLINKS_TO_CHECK").''; @@ -181,8 +200,10 @@ print ''.$dbacklinks.'
    '; +print '
    '; + + print '
    '; print ''; print '
    '; From 4695bbbd600c9d75eaae3dbfc9c6ad9a88c6babe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 Jun 2021 12:59:19 +0200 Subject: [PATCH 0418/1497] Trans --- htdocs/langs/en_US/partnership.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/partnership.lang b/htdocs/langs/en_US/partnership.lang index 72868ab6ddf..7decec2a003 100644 --- a/htdocs/langs/en_US/partnership.lang +++ b/htdocs/langs/en_US/partnership.lang @@ -35,7 +35,7 @@ PartnershipAboutPage=Partnership about page partnershipforthirdpartyormember=Partner status must be set on a 'thirdparty' or a 'member' PARTNERSHIP_IS_MANAGED_FOR=Partnership managed for PARTNERSHIP_BACKLINKS_TO_CHECK=Backlinks to check -PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL=Nb of days before cancel status of partnership when subscription is expired +PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL=Nb of days before cancelling status of a partnership when a subscription has expired ReferingWebsiteCheck=Check of website referring ReferingWebsiteCheckDesc=You can enable a feature to check that your partners has added a backlink to your website domains on their own website. From 36accba5c96df8c726357b3ea8cb92a2aed9cb11 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 5 Jun 2021 14:43:40 +0200 Subject: [PATCH 0419/1497] Fix date_start of last subscription --- htdocs/adherents/class/adherent.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index eeede7b3810..1d8ed358c73 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1402,7 +1402,7 @@ class Adherent extends CommonObject $this->first_subscription_amount = $obj->subscription; } $this->last_subscription_date = $this->db->jdate($obj->datec); - $this->last_subscription_date_start = $this->db->jdate($obj->datef); + $this->last_subscription_date_start = $this->db->jdate($obj->dateh); $this->last_subscription_date_end = $this->db->jdate($obj->datef); $this->last_subscription_amount = $obj->subscription; From 1e657b86212a25d006eaecbbdc7ed2fe3dd1129f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 Jun 2021 15:14:10 +0200 Subject: [PATCH 0420/1497] Fix value of showoncombobox --- htdocs/adherents/class/adherent.class.php | 6 +-- htdocs/adherents/partnership.php | 44 +++++-------------- htdocs/bom/class/bom.class.php | 2 +- htdocs/core/lib/company.lib.php | 6 +-- .../class/conferenceorbooth.class.php | 4 +- htdocs/fichinter/class/fichinter.class.php | 2 +- htdocs/hrm/class/establishment.class.php | 2 +- .../template/class/myobject.class.php | 6 +-- htdocs/mrp/class/mo.class.php | 2 +- htdocs/product/class/product.class.php | 4 +- htdocs/product/stock/class/entrepot.class.php | 2 +- htdocs/projet/class/project.class.php | 2 +- .../class/recruitmentjobposition.class.php | 2 +- htdocs/societe/class/societe.class.php | 2 +- .../workstation/class/workstation.class.php | 2 +- htdocs/zapier/class/hook.class.php | 9 ++-- 16 files changed, 35 insertions(+), 62 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index a663cea85d2..18d8746cca7 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -296,15 +296,15 @@ class Adherent extends CommonObject 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => 1, 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 15, 'index' => 1), 'ref_ext' => array('type' => 'varchar(128)', 'label' => 'Ref ext', 'enabled' => 1, 'visible' => 0, 'position' => 20), 'civility' => array('type' => 'varchar(6)', 'label' => 'Civility', 'enabled' => 1, 'visible' => -1, 'position' => 25), - 'lastname' => array('type' => 'varchar(50)', 'label' => 'Lastname', 'enabled' => 1, 'visible' => -1, 'position' => 30), - 'firstname' => array('type' => 'varchar(50)', 'label' => 'Firstname', 'enabled' => 1, 'visible' => -1, 'position' => 35), + 'lastname' => array('type' => 'varchar(50)', 'label' => 'Lastname', 'enabled' => 1, 'visible' => -1, 'position' => 30, 'showoncombobox'=>1), + 'firstname' => array('type' => 'varchar(50)', 'label' => 'Firstname', 'enabled' => 1, 'visible' => -1, 'position' => 35, 'showoncombobox'=>1), 'login' => array('type' => 'varchar(50)', 'label' => 'Login', 'enabled' => 1, 'visible' => -1, 'position' => 40), 'gender' => array('type' => 'varchar(10)', 'label' => 'Gender', 'enabled' => 1, 'visible' => -1, 'position' => 250), 'pass' => array('type' => 'varchar(50)', 'label' => 'Pass', 'enabled' => 1, 'visible' => -1, 'position' => 45), 'pass_crypted' => array('type' => 'varchar(128)', 'label' => 'Pass crypted', 'enabled' => 1, 'visible' => -1, 'position' => 50), 'fk_adherent_type' => array('type' => 'integer', 'label' => 'Fk adherent type', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 55), 'morphy' => array('type' => 'varchar(3)', 'label' => 'MorPhy', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 60), - 'societe' => array('type' => 'varchar(128)', 'label' => 'Societe', 'enabled' => 1, 'visible' => -1, 'position' => 65), + 'societe' => array('type' => 'varchar(128)', 'label' => 'Societe', 'enabled' => 1, 'visible' => -1, 'position' => 65, 'showoncombobox'=>2), 'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php', 'label' => 'ThirdParty', 'enabled' => 1, 'visible' => -1, 'position' => 70), 'address' => array('type' => 'text', 'label' => 'Address', 'enabled' => 1, 'visible' => -1, 'position' => 75), 'zip' => array('type' => 'varchar(10)', 'label' => 'Zip', 'enabled' => 1, 'visible' => -1, 'position' => 80), diff --git a/htdocs/adherents/partnership.php b/htdocs/adherents/partnership.php index 3cd70de3228..5bdf758e84f 100644 --- a/htdocs/adherents/partnership.php +++ b/htdocs/adherents/partnership.php @@ -44,43 +44,14 @@ //if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} - +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; -dol_include_once('/partnership/class/partnership.class.php'); -dol_include_once('/partnership/lib/partnership.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership.class.php'; +require_once DOL_DOCUMENT_ROOT.'/partnership/lib/partnership.lib.php'; // Load translation files required by the page $langs->loadLangs(array("companies","members","partnership", "other")); @@ -150,6 +121,12 @@ if (($action == 'update' || $action == 'edit') && $object->status != $object::ST if (empty($memberid) && $object) { $memberid = $object->fk_member; } + + +// Security check +$result = restrictedArea($user, 'adherent', $memberid, '', '', 'socid', 'rowid', 0); + + /* * Actions */ @@ -271,10 +248,9 @@ $object->fields['fk_member']['visible'] = 0; if ($object->id > 0 && $object->status == $object::STATUS_REFUSED && empty($action)) $object->fields['reason_decline_or_cancel']['visible'] = 1; $object->fields['note_public']['visible'] = 1; + /* * View - * - * Put here all code to build page */ $form = new Form($db); diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 9fe0543c4cf..220c724ad89 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -96,7 +96,7 @@ class BOM extends CommonObject 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>"Id",), 'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=> 1, 'default'=>1, 'index'=>1, 'position'=>5), 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'noteditable'=>1, 'visible'=>4, 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of BOM", 'showoncombobox'=>'1',), - 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'notnull'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'autofocusoncreate'=>1), + 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'notnull'=>1, 'searchall'=>1, 'showoncombobox'=>'2', 'autofocusoncreate'=>1), 'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>1, 'position'=>33, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing', 1=>'Disassemble'), 'css'=>'minwidth150', 'csslist'=>'minwidth150 center'), //'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>-1, 'position'=>32, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing')), 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:1:(finished IS NULL or finished <> 0)', 'label'=>'Product', 'picto'=>'product', 'enabled'=>1, 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'help'=>'ProductBOMHelp', 'css'=>'maxwidth500'), diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 99bcd2c3921..61332d8041b 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -963,9 +963,9 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '') $contactstatic->fields = array( 'name' =>array('type'=>'varchar(128)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1), - 'poste' =>array('type'=>'varchar(128)', 'label'=>'PostOrFunction', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>20), - 'address' =>array('type'=>'varchar(128)', 'label'=>'Address', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>30), - 'role' =>array('type'=>'checkbox', 'label'=>'Role', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>40), + 'poste' =>array('type'=>'varchar(128)', 'label'=>'PostOrFunction', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>2, 'index'=>1, 'position'=>20), + 'address' =>array('type'=>'varchar(128)', 'label'=>'Address', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>3, 'index'=>1, 'position'=>30), + 'role' =>array('type'=>'checkbox', 'label'=>'Role', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>4, 'index'=>1, 'position'=>40), 'statut' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>0, 'index'=>1, 'position'=>50, 'arrayofkeyval'=>array(0=>$contactstatic->LibStatut(0, 1), 1=>$contactstatic->LibStatut(1, 1))), ); diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index bb8649106b9..ae35f3eb892 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -110,8 +110,8 @@ class ConferenceOrBooth extends ActionComm 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1::eventorganization', 'label'=>'Project', 'enabled'=>'1', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1,), 'note' => array('type'=>'text', 'label'=>'Description', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>1,), 'fk_action' => array('type'=>'sellist:c_actioncomm:libelle:id::module LIKE (\'%@eventorganization\')', 'label'=>'Format', 'enabled'=>'1', 'position'=>60, 'notnull'=>1, 'visible'=>1,), - 'datep' => array('type'=>'datetime', 'label'=>'DateStart', 'enabled'=>'1', 'position'=>70, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'1',), - 'datep2' => array('type'=>'datetime', 'label'=>'DateEnd', 'enabled'=>'1', 'position'=>71, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'1',), + 'datep' => array('type'=>'datetime', 'label'=>'DateStart', 'enabled'=>'1', 'position'=>70, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'2',), + 'datep2' => array('type'=>'datetime', 'label'=>'DateEnd', 'enabled'=>'1', 'position'=>71, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'3',), 'datec' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2,), 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>'1', 'position'=>501, 'notnull'=>0, 'visible'=>-2,), 'fk_user_author' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>'1', 'position'=>510, 'notnull'=>1, 'visible'=>-2, 'foreignkey'=>'user.rowid',), diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 1c1c1ab37be..e2ac86f55bd 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -57,7 +57,7 @@ class Fichinter extends CommonObject 'datee' =>array('type'=>'date', 'label'=>'Datee', 'enabled'=>1, 'visible'=>-1, 'position'=>90), 'datet' =>array('type'=>'date', 'label'=>'Datet', 'enabled'=>1, 'visible'=>-1, 'position'=>95), 'duree' =>array('type'=>'double', 'label'=>'Duree', 'enabled'=>1, 'visible'=>-1, 'position'=>100), - 'description' =>array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>105, 'showoncombobox'=>1), + 'description' =>array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>105, 'showoncombobox'=>2), 'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>110), 'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>115), 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>120), diff --git a/htdocs/hrm/class/establishment.class.php b/htdocs/hrm/class/establishment.class.php index c63ab29a14a..c2fa520442b 100644 --- a/htdocs/hrm/class/establishment.class.php +++ b/htdocs/hrm/class/establishment.class.php @@ -133,7 +133,7 @@ class Establishment extends CommonObject 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>15, 'index'=>1), 'ref' =>array('type'=>'varchar(30)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'showoncombobox'=>1, 'position'=>20), - 'label' =>array('type'=>'varchar(128)', 'label'=>'Label', 'enabled'=>1, 'visible'=>-1, 'showoncombobox'=>1, 'position'=>22), + 'label' =>array('type'=>'varchar(128)', 'label'=>'Label', 'enabled'=>1, 'visible'=>-1, 'showoncombobox'=>2, 'position'=>22), 'address' =>array('type'=>'varchar(255)', 'label'=>'Address', 'enabled'=>1, 'visible'=>-1, 'position'=>25), 'zip' =>array('type'=>'varchar(25)', 'label'=>'Zip', 'enabled'=>1, 'visible'=>-1, 'position'=>30), 'town' =>array('type'=>'varchar(50)', 'label'=>'Town', 'enabled'=>1, 'visible'=>-1, 'position'=>35), diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index e69c5bc333d..76c6bb691f5 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -101,9 +101,9 @@ class MyObject extends CommonObject */ public $fields = array( 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'noteditable'=>1, 'notnull'=> 1, 'index'=>1, 'position'=>1, 'comment'=>'Id', 'css'=>'left'), - 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'noteditable'=>0, 'default'=>'', 'notnull'=> 1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'), - 'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=> 1, 'default'=>1, 'index'=>1, 'position'=>20), - 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1, 'css'=>'minwidth300', 'cssview'=>'wordbreak', 'help'=>'Help text', 'showoncombobox'=>1), + 'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=> 1, 'default'=>1, 'index'=>1, 'position'=>10), + 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'noteditable'=>0, 'default'=>'', 'notnull'=> 1, 'showoncombobox'=>1, 'index'=>1, 'position'=>20, 'searchall'=>1, 'comment'=>'Reference of object'), + 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1, 'css'=>'minwidth300', 'cssview'=>'wordbreak', 'help'=>'Help text', 'showoncombobox'=>2), 'amount' => array('type'=>'price', 'label'=>'Amount', 'enabled'=>1, 'visible'=>1, 'default'=>'null', 'position'=>40, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text for amount'), 'qty' => array('type'=>'real', 'label'=>'Qty', 'enabled'=>1, 'visible'=>1, 'default'=>'0', 'position'=>45, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text for quantity', 'css'=>'maxwidth75imp'), 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'picto'=>'company', 'label'=>'ThirdParty', 'visible'=> 1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'help'=>'LinkToThirparty'), diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index d48d4959fd1..115844c916d 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -103,7 +103,7 @@ class Mo extends CommonObject 'fk_bom' => array('type'=>'integer:Bom:bom/class/bom.class.php:0:t.status=1', 'filter'=>'active=1', 'label'=>'BOM', 'enabled'=>1, 'visible'=>1, 'position'=>33, 'notnull'=>-1, 'index'=>1, 'comment'=>"Original BOM", 'css'=>'minwidth100 maxwidth300', 'csslist'=>'nowraponall'), 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:0', 'label'=>'Product', 'enabled'=>1, 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'comment'=>"Product to produce", 'css'=>'maxwidth300', 'picto'=>'product'), 'qty' => array('type'=>'real', 'label'=>'QtyToProduce', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'notnull'=>1, 'comment'=>"Qty to produce", 'css'=>'width75', 'default'=>1, 'isameasure'=>1), - 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>42, 'notnull'=>-1, 'searchall'=>1, 'showoncombobox'=>'1',), + 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>42, 'notnull'=>-1, 'searchall'=>1, 'showoncombobox'=>'2',), 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1', 'label'=>'ThirdParty', 'picto'=>'company', 'enabled'=>1, 'visible'=>-1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'css'=>'maxwidth400'), 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'picto'=>'project', 'enabled'=>1, 'visible'=>-1, 'position'=>51, 'notnull'=>-1, 'index'=>1, 'css'=>'minwidth200 maxwidth400'), 'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php:0', 'label'=>'WarehouseForProduction', 'picto'=>'stock', 'enabled'=>1, 'visible'=>1, 'position'=>52, 'css'=>'maxwidth400'), diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index f76a6fec0ad..6aee9af9c60 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -433,8 +433,8 @@ class Product extends CommonObject 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'), 'ref' =>array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'), 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>5), - 'label' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'position'=>15), - 'barcode' =>array('type'=>'varchar(255)', 'label'=>'Barcode', 'enabled'=>'!empty($conf->barcode->enabled)', 'position'=>20, 'visible'=>-1, 'showoncombobox'=>1), + 'label' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>2, 'position'=>15), + 'barcode' =>array('type'=>'varchar(255)', 'label'=>'Barcode', 'enabled'=>'!empty($conf->barcode->enabled)', 'position'=>20, 'visible'=>-1, 'showoncombobox'=>3), 'fk_barcode_type' => array('type'=>'integer', 'label'=>'BarcodeType', 'enabled'=>'1', 'position'=>21, 'notnull'=>0, 'visible'=>-1,), 'note_public' =>array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>61), 'note' =>array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>62), diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index dc15e092155..35791bfd158 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -127,7 +127,7 @@ class Entrepot extends CommonObject 'ref' =>array('type'=>'varchar(255)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'showoncombobox'=>1, 'position'=>25, 'searchall'=>1), 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>30), 'description' =>array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-2, 'position'=>35, 'searchall'=>1), - 'lieu' =>array('type'=>'varchar(64)', 'label'=>'LocationSummary', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'showoncombobox'=>1, 'searchall'=>1), + 'lieu' =>array('type'=>'varchar(64)', 'label'=>'LocationSummary', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'showoncombobox'=>2, 'searchall'=>1), 'fk_parent' =>array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php:1:statut=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ParentWarehouse', 'enabled'=>1, 'visible'=>-2, 'position'=>41), 'fk_project' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>1, 'visible'=>-1, 'position'=>25), 'address' =>array('type'=>'varchar(255)', 'label'=>'Address', 'enabled'=>1, 'visible'=>-2, 'position'=>45, 'searchall'=>1), diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index ca42e8a3fd1..851703ce96b 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -224,7 +224,7 @@ class Project extends CommonObject public $fields = array( 'rowid' =>array('type'=>'integer', 'label'=>'ID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), 'ref' =>array('type'=>'varchar(50)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'showoncombobox'=>1, 'position'=>15, 'searchall'=>1), - 'title' =>array('type'=>'varchar(255)', 'label'=>'ProjectLabel', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>17, 'showoncombobox'=>1, 'searchall'=>1), + 'title' =>array('type'=>'varchar(255)', 'label'=>'ProjectLabel', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>17, 'showoncombobox'=>2, 'searchall'=>1), 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>3, 'notnull'=>1, 'position'=>19), 'fk_soc' =>array('type'=>'integer', 'label'=>'Thirdparty', 'enabled'=>1, 'visible'=>0, 'position'=>20), 'dateo' =>array('type'=>'date', 'label'=>'DateStart', 'enabled'=>1, 'visible'=>1, 'position'=>30), diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php index 86cd99e7180..2f180bcc8ec 100644 --- a/htdocs/recruitment/class/recruitmentjobposition.class.php +++ b/htdocs/recruitment/class/recruitmentjobposition.class.php @@ -102,7 +102,7 @@ class RecruitmentJobPosition extends CommonObject 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'comment'=>"Id"), 'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'position'=>5, 'notnull'=>1, 'default'=>'1', 'index'=>1), 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>4, 'noteditable'=>'1', 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'comment'=>"Reference of object"), - 'label' => array('type'=>'varchar(255)', 'label'=>'JobLabel', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth500', 'csslist'=>'tdoverflowmax300', 'showoncombobox'=>'1', 'autofocusoncreate'=>1), + 'label' => array('type'=>'varchar(255)', 'label'=>'JobLabel', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth500', 'csslist'=>'tdoverflowmax300', 'showoncombobox'=>'2', 'autofocusoncreate'=>1), 'qty' => array('type'=>'integer', 'label'=>'NbOfEmployeesExpected', 'enabled'=>'1', 'position'=>45, 'notnull'=>1, 'visible'=>1, 'default'=>'1', 'isameasure'=>'1', 'css'=>'maxwidth75imp'), 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'1', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1, 'css'=>'maxwidth500', 'picto'=>'project'), 'fk_user_recruiter' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'ResponsibleOfRecruitement', 'enabled'=>'1', 'position'=>54, 'notnull'=>1, 'visible'=>1, 'foreignkey'=>'user.rowid', 'csslist'=>'tdoverflowmax150'), diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 7554ad2fbe2..97723f83f37 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -162,7 +162,7 @@ class Societe extends CommonObject 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>25), 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>30), 'nom' =>array('type'=>'varchar(128)', 'label'=>'Nom', 'enabled'=>1, 'visible'=>-1, 'position'=>35, 'showoncombobox'=>1), - 'name_alias' =>array('type'=>'varchar(128)', 'label'=>'Name alias', 'enabled'=>1, 'visible'=>-1, 'position'=>36, 'showoncombobox'=>1), + 'name_alias' =>array('type'=>'varchar(128)', 'label'=>'Name alias', 'enabled'=>1, 'visible'=>-1, 'position'=>36, 'showoncombobox'=>2), 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>40, 'index'=>1), 'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'RefExt', 'enabled'=>1, 'visible'=>0, 'position'=>45), 'code_client' =>array('type'=>'varchar(24)', 'label'=>'CustomerCode', 'enabled'=>1, 'visible'=>-1, 'position'=>55), diff --git a/htdocs/workstation/class/workstation.class.php b/htdocs/workstation/class/workstation.class.php index d81bab42eab..5cb6baf3565 100755 --- a/htdocs/workstation/class/workstation.class.php +++ b/htdocs/workstation/class/workstation.class.php @@ -101,7 +101,7 @@ class Workstation extends CommonObject public $fields=array( 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>1, 'noteditable'=>'0', 'default'=>'', 'index'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'comment'=>"Reference of object"), - 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'showoncombobox'=>'1',), + 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'showoncombobox'=>'2',), 'type' => array('type'=>'varchar(8)', 'label'=>'Type', 'enabled'=>'1', 'position'=>32, 'default'=>1, 'notnull'=>1, 'visible'=>1, 'arrayofkeyval'=>array('HUMAN'=>'Human', 'MACHINE'=>'Machine', 'BOTH'=>'HumanMachine'),), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>61, 'notnull'=>0, 'visible'=>0,), 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>62, 'notnull'=>0, 'visible'=>0,), diff --git a/htdocs/zapier/class/hook.class.php b/htdocs/zapier/class/hook.class.php index 9197942b5c0..ba04f504da6 100644 --- a/htdocs/zapier/class/hook.class.php +++ b/htdocs/zapier/class/hook.class.php @@ -121,8 +121,7 @@ class Hook extends CommonObject 'position' => 30, 'searchall' => 1, 'css' => 'minwidth200', - 'help' => 'Hook url', - 'showoncombobox' => 1, + 'help' => 'Hook url' ), 'module' => array( 'type' => 'varchar(128)', @@ -132,8 +131,7 @@ class Hook extends CommonObject 'position' => 30, 'searchall' => 1, 'css' => 'minwidth200', - 'help' => 'Hook module', - 'showoncombobox' => 1, + 'help' => 'Hook module' ), 'action' => array( 'type' => 'varchar(128)', @@ -143,8 +141,7 @@ class Hook extends CommonObject 'position' => 30, 'searchall' => 1, 'css' => 'minwidth200', - 'help' => 'Hook action trigger', - 'showoncombobox' => 1, + 'help' => 'Hook action trigger' ), 'event' => array( 'type' => 'varchar(255)', From 7074f8d048a733e24c999049986573833aab64e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 5 Jun 2021 15:23:29 +0200 Subject: [PATCH 0421/1497] add creates --- dev/examples/zapier/creates/contact.js | 74 ++++++++++++++++++++++++++ dev/examples/zapier/creates/member.js | 74 ++++++++++++++++++++++++++ dev/examples/zapier/index.js | 4 ++ 3 files changed, 152 insertions(+) create mode 100644 dev/examples/zapier/creates/contact.js create mode 100644 dev/examples/zapier/creates/member.js diff --git a/dev/examples/zapier/creates/contact.js b/dev/examples/zapier/creates/contact.js new file mode 100644 index 00000000000..bcb849ad63d --- /dev/null +++ b/dev/examples/zapier/creates/contact.js @@ -0,0 +1,74 @@ +/*jshint esversion: 6 */ +// create a particular contact by name +const createContact = async (z, bundle) => { + const apiurl = bundle.authData.url + '/api/index.php/contacts'; + + const response = await z.request({ + method: 'POST', + url: apiurl, + body: { + name: bundle.inputData.name, + name_alias: bundle.inputData.name_alias, + ref_ext: bundle.inputData.ref_ext, + ref_int: bundle.inputData.ref_int, + address: bundle.inputData.address, + zip: bundle.inputData.zip, + town: bundle.inputData.town, + country_code: bundle.inputData.country_code, + country_id: bundle.inputData.country_id, + country: bundle.inputData.country, + phone: bundle.inputData.phone, + email: bundle.inputData.email, + sens: 'fromzapier' + } + }); + const result = z.JSON.parse(response.content); + // api returns an integer when ok, a json when ko + return result.response || {id: response}; +}; + +module.exports = { + key: 'contact', + noun: 'Contact', + + display: { + label: 'Create Contact', + description: 'Creates a contact.' + }, + + operation: { + inputFields: [ + {key: 'name', required: true}, + {key: 'name_alias', required: false}, + {key: 'address', required: false}, + {key: 'zip', required: false}, + {key: 'town', required: false}, + {key: 'email', required: false} + ], + perform: createContact, + + sample: { + id: 1, + name: 'DUPOND', + name_alias: 'DUPOND Ltd', + address: 'Rue des Canaries', + zip: '34090', + town: 'MONTPELLIER', + phone: '0123456789', + fax: '2345678901', + email: 'robot@domain.com' + }, + + outputFields: [ + {key: 'id', type: "integer", label: 'ID'}, + {key: 'name', label: 'Name'}, + {key: 'name_alias', label: 'Name alias'}, + {key: 'address', label: 'Address'}, + {key: 'zip', label: 'Zip'}, + {key: 'town', label: 'Town'}, + {key: 'phone', label: 'Phone'}, + {key: 'fax', label: 'Fax'}, + {key: 'email', label: 'Email'} + ] + } +}; diff --git a/dev/examples/zapier/creates/member.js b/dev/examples/zapier/creates/member.js new file mode 100644 index 00000000000..152f1129e79 --- /dev/null +++ b/dev/examples/zapier/creates/member.js @@ -0,0 +1,74 @@ +/*jshint esversion: 6 */ +// create a particular member by name +const createMember = async (z, bundle) => { + const apiurl = bundle.authData.url + '/api/index.php/members'; + + const response = await z.request({ + method: 'POST', + url: apiurl, + body: { + name: bundle.inputData.name, + name_alias: bundle.inputData.name_alias, + ref_ext: bundle.inputData.ref_ext, + ref_int: bundle.inputData.ref_int, + address: bundle.inputData.address, + zip: bundle.inputData.zip, + town: bundle.inputData.town, + country_code: bundle.inputData.country_code, + country_id: bundle.inputData.country_id, + country: bundle.inputData.country, + phone: bundle.inputData.phone, + email: bundle.inputData.email, + sens: 'fromzapier' + } + }); + const result = z.JSON.parse(response.content); + // api returns an integer when ok, a json when ko + return result.response || {id: response}; +}; + +module.exports = { + key: 'member', + noun: 'Member', + + display: { + label: 'Create Member', + description: 'Creates a member.' + }, + + operation: { + inputFields: [ + {key: 'name', required: true}, + {key: 'name_alias', required: false}, + {key: 'address', required: false}, + {key: 'zip', required: false}, + {key: 'town', required: false}, + {key: 'email', required: false} + ], + perform: createMember, + + sample: { + id: 1, + name: 'DUPOND', + name_alias: 'DUPOND Ltd', + address: 'Rue des Canaries', + zip: '34090', + town: 'MONTPELLIER', + phone: '0123456789', + fax: '2345678901', + email: 'robot@domain.com' + }, + + outputFields: [ + {key: 'id', type: "integer", label: 'ID'}, + {key: 'name', label: 'Name'}, + {key: 'name_alias', label: 'Name alias'}, + {key: 'address', label: 'Address'}, + {key: 'zip', label: 'Zip'}, + {key: 'town', label: 'Town'}, + {key: 'phone', label: 'Phone'}, + {key: 'fax', label: 'Fax'}, + {key: 'email', label: 'Email'} + ] + } +}; diff --git a/dev/examples/zapier/index.js b/dev/examples/zapier/index.js index d96df72e11f..94046969045 100644 --- a/dev/examples/zapier/index.js +++ b/dev/examples/zapier/index.js @@ -9,6 +9,8 @@ const triggerUser = require('./triggers/user'); const searchThirdparty = require('./searches/thirdparty'); const createThirdparty = require('./creates/thirdparty'); +const createContact = require('./creates/contact'); +const createMember = require('./creates/member'); const { config: authentication, @@ -76,6 +78,8 @@ const App = { // If you want your creates to show up, you better include it here! creates: { [createThirdparty.key]: createThirdparty, + [createContact.key]: createContact, + [createMember.key]: createMember, } }; From fb0d2cdddcc2be2f9bf1f4e47066224b8747452e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 Jun 2021 15:27:49 +0200 Subject: [PATCH 0422/1497] Debug v14 --- htdocs/core/class/html.form.class.php | 5 ++++- htdocs/partnership/class/partnership.class.php | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 0944918f815..1dd6712dba6 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6840,9 +6840,12 @@ class Form $obj = $this->db->fetch_object($resql); $label = ''; $tmparray = explode(',', $fieldstoshow); + $oldvalueforshowoncombobox = 0; foreach ($tmparray as $key => $val) { $val = preg_replace('/t\./', '', $val); - $label .= (($label && $obj->$val) ? ' - ' : '').$obj->$val; + $label .= (($label && $obj->$val) ? ($oldvalueforshowoncombobox != $objecttmp->fields[$val]['showoncombobox'] ? ' - ' : ' ') : ''); + $label .= $obj->$val; + $oldvalueforshowoncombobox = $objecttmp->fields[$val]['showoncombobox']; } if (empty($outputmode)) { if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) { diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index 77ae16d9d2d..f33a19f312e 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -198,9 +198,9 @@ class Partnership extends CommonObject ); if ($conf->global->PARTNERSHIP_IS_MANAGED_FOR == 'member') { - $this->fields['fk_member'] = array('type'=>'integer:Adherent:adherents/class/adherent.class.php:1', 'label'=>'Member', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1,); + $this->fields['fk_member'] = array('type'=>'integer:Adherent:adherents/class/adherent.class.php:1', 'label'=>'Member', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'picto'=>'member'); } else { - $this->fields['fk_soc'] = array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1,); + $this->fields['fk_soc'] = array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'picto'=>'societe'); } if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) { From 273c4c288038d5b60a5c5e931c65640e8c37724a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 Jun 2021 15:28:41 +0200 Subject: [PATCH 0423/1497] Fix typo --- htdocs/core/lib/pdf.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 6e4cc60ce53..933d8e14197 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1250,7 +1250,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, // ($textwasmodified is replaced with $textwasmodifiedorcompleted and we add completion). // Set label - // If we want another language, and if label is same than default language (we did force it to a specific value), we can use translation. + // If we want another language, and if label is same than default language (we did not force it to a specific value), we can use translation. //var_dump($outputlangs->defaultlang.' - '.$langs->defaultlang.' - '.$label.' - '.$prodser->label);exit; $textwasmodified = ($label == $prodser->label); if (!empty($prodser->multilangs[$outputlangs->defaultlang]["label"]) && ($textwasmodified || $translatealsoifmodified)) { From 70af18148b9324d91c257c10b6a5177c5a4b2986 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 Jun 2021 17:48:30 +0200 Subject: [PATCH 0424/1497] Debug modulebuilder v14 --- htdocs/core/lib/functions.lib.php | 7 ++++--- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 2 ++ htdocs/modulebuilder/template/myobject_card.php | 3 +-- htdocs/partnership/partnership_card.php | 5 ++--- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 61a3869fe1a..b018b4d2fb0 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -9671,7 +9671,7 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st /** * Function dolGetButtonAction * - * @param string $label label of button no html : use in alt attribute for accessibility $html is not empty + * @param string $label label of button without HTML : use in alt attribute for accessibility $html is not empty * @param string $html optional : content with html * @param string $actionType default, delete, danger * @param string $url the url for link @@ -9689,8 +9689,9 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url = } $attr = array( - 'class' => $class - ,'href' => empty($url) ? '' : $url + 'class' => $class, + 'href' => empty($url) ? '' : $url, + 'title' => $label ); if (empty($html)) { diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index 3fb671fa9b2..cc4b791725d 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -450,6 +450,8 @@ CREATE TABLE llx_partnership( model_pdf varchar(255) ) ENGINE=innodb; +ALTER TABLE llx_partnership ADD COLUMN last_check_backlink datetime NULL; + ALTER TABLE llx_partnership ADD INDEX idx_partnership_rowid (rowid); ALTER TABLE llx_partnership ADD INDEX idx_partnership_ref (ref); ALTER TABLE llx_partnership ADD INDEX idx_partnership_fk_soc (fk_soc); diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 1f9da9c80ae..739596b5653 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -505,8 +505,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print dolGetButtonAction($langs->trans('Validate'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes', '', $permissiontoadd); } else { $langs->load("errors"); - //print dolGetButtonAction($langs->trans('Validate'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes', '', 0); - print ''.$langs->trans("Validate").''; + print dolGetButtonAction($langs->trans("ErrorAddAtLeastOneLineFirst"), $langs->trans("Validate"), 'default', '#', '', 0); } } diff --git a/htdocs/partnership/partnership_card.php b/htdocs/partnership/partnership_card.php index b31ced3556f..f724ace839d 100644 --- a/htdocs/partnership/partnership_card.php +++ b/htdocs/partnership/partnership_card.php @@ -639,8 +639,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print dolGetButtonAction($langs->trans('Validate'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_accept&confirm=yes', '', $permissiontoadd); } else { $langs->load("errors"); - //print dolGetButtonAction($langs->trans('Accept'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_accept&confirm=yes', '', 0); - print ''.$langs->trans("Validate").''; + print dolGetButtonAction($langs->trans("ErrorAddAtLeastOneLineFirst"), $langs->trans("Validate"), 'default', '#', '', 0); } } @@ -657,7 +656,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Refuse if ($permissiontoadd) { if ($object->status != $object::STATUS_CANCELED && $object->status != $object::STATUS_REFUSED) { - print ''.$langs->trans("Refuse").''."\n"; + print dolGetButtonAction($langs->trans('Refuse'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=refuse&token='.newToken(), '', $permissiontoadd); } } From 92b6425ce0832639c7e3f19e31199405f5634d27 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 Jun 2021 18:20:07 +0200 Subject: [PATCH 0425/1497] Debug v14 --- htdocs/adherents/partnership.php | 6 ++- htdocs/langs/en_US/partnership.lang | 2 +- .../modulebuilder/template/myobject_card.php | 4 +- htdocs/partnership/partnership_card.php | 10 ++-- htdocs/societe/partnership.php | 48 +++++-------------- 5 files changed, 24 insertions(+), 46 deletions(-) diff --git a/htdocs/adherents/partnership.php b/htdocs/adherents/partnership.php index 5bdf758e84f..28b041240a3 100644 --- a/htdocs/adherents/partnership.php +++ b/htdocs/adherents/partnership.php @@ -510,20 +510,22 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (empty($reshook)) { if ($object->status == $object::STATUS_DRAFT) { - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?rowid='.$memberid.'&action=edit', '', $permissiontoadd); + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?rowid='.$memberid.'&action=edit&token='.newToken(), '', $permissiontoadd); } // Show if ($permissiontoadd) { - print dolGetButtonAction($langs->trans('ShowPartnership'), '', 'default', dol_buildpath('/partnership/partnership_card.php', 1).'?id='.$object->id, '', $permissiontoadd); + print dolGetButtonAction($langs->trans('ManagePartnership'), '', 'default', dol_buildpath('/partnership/partnership_card.php', 1).'?id='.$object->id, '', $permissiontoadd); } // Cancel + /* if ($permissiontoadd) { if ($object->status == $object::STATUS_ACCEPTED) { print dolGetButtonAction($langs->trans('Cancel'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=close&token='.newToken(), '', $permissiontoadd); } } + */ } print ''."\n"; } diff --git a/htdocs/langs/en_US/partnership.lang b/htdocs/langs/en_US/partnership.lang index 7decec2a003..6d0c7dc0ac9 100644 --- a/htdocs/langs/en_US/partnership.lang +++ b/htdocs/langs/en_US/partnership.lang @@ -50,7 +50,7 @@ DatePartnershipEnd=End date ReasonDecline=Decline reason ReasonDeclineOrCancel=Decline reason PartnershipAlreadyExist=Partnership already exist -ShowPartnership=Show partnership +ManagePartnership=Manage partnership BacklinkNotFoundOnPartnerWebsite=Backlink not found on partner website ConfirmClosePartnershipAsk=Are you sure you want to cancel this partnership? diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 739596b5653..7111b59b582 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -489,7 +489,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (empty($reshook)) { // Send if (empty($user->socid)) { - print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle'); + print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init&token='.newToken().'#formmailbeforetitle'); } // Back to draft @@ -502,7 +502,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Validate if ($object->status == $object::STATUS_DRAFT) { if (empty($object->table_element_line) || (is_array($object->lines) && count($object->lines) > 0)) { - print dolGetButtonAction($langs->trans('Validate'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes', '', $permissiontoadd); + print dolGetButtonAction($langs->trans('Validate'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes&token='.newToken(), '', $permissiontoadd); } else { $langs->load("errors"); print dolGetButtonAction($langs->trans("ErrorAddAtLeastOneLineFirst"), $langs->trans("Validate"), 'default', '#', '', 0); diff --git a/htdocs/partnership/partnership_card.php b/htdocs/partnership/partnership_card.php index f724ace839d..72e0bc22bdd 100644 --- a/htdocs/partnership/partnership_card.php +++ b/htdocs/partnership/partnership_card.php @@ -623,20 +623,20 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (empty($reshook)) { // Send if (empty($user->socid)) { - print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle'); + print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init&token='.newToken().'#formmailbeforetitle'); } // Back to draft if ($object->status != $object::STATUS_DRAFT) { - print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes', '', $permissiontoadd); + print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken(), '', $permissiontoadd); } - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit', '', $permissiontoadd); + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); // Accept if ($object->status == $object::STATUS_DRAFT) { if (empty($object->table_element_line) || (is_array($object->lines) && count($object->lines) > 0)) { - print dolGetButtonAction($langs->trans('Validate'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_accept&confirm=yes', '', $permissiontoadd); + print dolGetButtonAction($langs->trans('Validate'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_accept&confirm=yes&token='.newToken(), '', $permissiontoadd); } else { $langs->load("errors"); print dolGetButtonAction($langs->trans("ErrorAddAtLeastOneLineFirst"), $langs->trans("Validate"), 'default', '#', '', 0); @@ -655,7 +655,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Refuse if ($permissiontoadd) { - if ($object->status != $object::STATUS_CANCELED && $object->status != $object::STATUS_REFUSED) { + if ($object->status != $object::STATUS_ACCEPTED && $object->status != $object::STATUS_CANCELED && $object->status != $object::STATUS_REFUSED) { print dolGetButtonAction($langs->trans('Refuse'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=refuse&token='.newToken(), '', $permissiontoadd); } } diff --git a/htdocs/societe/partnership.php b/htdocs/societe/partnership.php index 0a5205799a9..6a45c657126 100644 --- a/htdocs/societe/partnership.php +++ b/htdocs/societe/partnership.php @@ -44,42 +44,13 @@ //if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} - +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -dol_include_once('/partnership/class/partnership.class.php'); -dol_include_once('/partnership/lib/partnership.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership.class.php'; +require_once DOL_DOCUMENT_ROOT.'/partnership/lib/partnership.lib.php'; // Load translation files required by the page $langs->loadLangs(array("companies","partnership", "other")); @@ -153,6 +124,11 @@ if (($action == 'update' || $action == 'edit') && $object->status != $object::ST if (empty($socid) && $object) { $socid = $object->fk_soc; } + +// Security check +$result = restrictedArea($user, 'societe', $socid, '&societe', '', 'fk_soc', 'rowid', 0); + + /* * Actions */ @@ -276,8 +252,6 @@ $object->fields['note_public']['visible'] = 1; /* * View - * - * Put here all code to build page */ $form = new Form($db); @@ -528,20 +502,22 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (empty($reshook)) { if ($object->status == $object::STATUS_DRAFT) { - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?socid='.$socid.'&action=edit', '', $permissiontoadd); + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?socid='.$socid.'&action=edit&token='.newtoken(), '', $permissiontoadd); } // Show if ($permissiontoadd) { - print dolGetButtonAction($langs->trans('ShowPartnership'), '', 'default', dol_buildpath('/partnership/partnership_card.php', 1).'?id='.$object->id, '', $permissiontoadd); + print dolGetButtonAction($langs->trans('ManagePartnership'), '', 'default', dol_buildpath('/partnership/partnership_card.php', 1).'?id='.$object->id, '', $permissiontoadd); } // Cancel + /* if ($permissiontoadd) { if ($object->status == $object::STATUS_ACCEPTED) { print dolGetButtonAction($langs->trans('Cancel'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=close&token='.newToken(), '', $permissiontoadd); } } + */ } print ''."\n"; } From 51bce78e6e5048c40e052c9d4e4c35d36792ec44 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 6 Jun 2021 06:05:47 +0200 Subject: [PATCH 0426/1497] NEW Add field date start/end from/to in expense report list --- htdocs/expensereport/list.php | 119 +++++++++++++++++++++++++++------- 1 file changed, 95 insertions(+), 24 deletions(-) diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index ce1dc4e3c09..1f3468d06fc 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -107,12 +107,23 @@ $search_amount_vat = GETPOST('search_amount_vat', 'alpha'); $search_amount_ttc = GETPOST('search_amount_ttc', 'alpha'); $search_status = (GETPOST('search_status', 'intcomma') != '' ?GETPOST('search_status', 'intcomma') : GETPOST('statut', 'intcomma')); -$year_start = GETPOST('year_start', 'int'); -$month_start = GETPOST('month_start', 'int'); -$day_start = GETPOST('day_start', 'int'); -$year_end = GETPOST('year_end', 'int'); -$month_end = GETPOST('month_end', 'int'); -$day_end = GETPOST('day_end', 'int'); +$search_date_startday = GETPOST('search_date_startday', 'int'); +$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); +$search_date_startyear = GETPOST('search_date_startyear', 'int'); +$search_date_startendday = GETPOST('search_date_startendday', 'int'); +$search_date_startendmonth = GETPOST('search_date_startendmonth', 'int'); +$search_date_startendyear = GETPOST('search_date_startendyear', 'int'); +$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver +$search_date_startend = dol_mktime(23, 59, 59, $search_date_startendmonth, $search_date_startendday, $search_date_startendyear); + +$search_date_endday = GETPOST('search_date_endday', 'int'); +$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); +$search_date_endyear = GETPOST('search_date_endyear', 'int'); +$search_date_endendday = GETPOST('search_date_endendday', 'int'); +$search_date_endendmonth = GETPOST('search_date_endendmonth', 'int'); +$search_date_endendyear = GETPOST('search_date_endendyear', 'int'); +$search_date_end = dol_mktime(0, 0, 0, $search_date_endmonth, $search_date_endday, $search_date_endyear); // Use tzserver +$search_date_endend = dol_mktime(23, 59, 59, $search_date_endendmonth, $search_date_endendday, $search_date_endendyear); $optioncss = GETPOST('optioncss', 'alpha'); @@ -197,11 +208,22 @@ if (empty($reshook)) { $search_amount_vat = ""; $search_amount_ttc = ""; $search_status = ""; - $month_start = ""; - $year_start = ""; - $month_end = ""; - $year_end = ""; - $day_end = ""; + $search_date_startday = ''; + $search_date_startmonth = ''; + $search_date_startyear = ''; + $search_date_startendday = ''; + $search_date_startendmonth = ''; + $search_date_startendyear = ''; + $search_date_start = ''; + $search_date_startend = ''; + $search_date_endday = ''; + $search_date_endmonth = ''; + $search_date_endyear = ''; + $search_date_endendday = ''; + $search_date_endendmonth = ''; + $search_date_endendyear = ''; + $search_date_end = ''; + $search_date_endend = ''; $toselect = ''; $search_array_options = array(); } @@ -277,9 +299,19 @@ if (!empty($search_ref)) { $sql .= natural_search('d.ref', $search_ref); } // Date Start -$sql .= dolSqlDateFilter("d.date_debut", $day_start, $month_start, $year_start); +if ($search_date_start) { + $sql .= " AND d.date_debut >= '".$db->idate($search_date_start)."'"; +} +if ($search_date_startend) { + $sql .= " AND d.date_debut <= '".$db->idate($search_date_startend)."'"; +} // Date End -$sql .= dolSqlDateFilter("d.date_fin", $day_end, $month_end, $year_end); +if ($search_date_end) { + $sql .= " AND d.date_fin >= '".$db->idate($search_date_end)."'"; +} +if ($search_date_endend) { + $sql .= " AND d.date_fin <= '".$db->idate($search_date_endend)."'"; +} if ($search_amount_ht != '') { $sql .= natural_search('d.total_ht', $search_amount_ht, 1); @@ -342,6 +374,44 @@ if ($resql) { if ($search_ref) { $param .= "&search_ref=".urlencode($search_ref); } + // Start date + if ($search_date_startday) { + $param .= '&search_date_startday='.urlencode($search_date_startday); + } + if ($search_date_startmonth) { + $param .= '&search_date_startmonth='.urlencode($search_date_startmonth); + } + if ($search_date_startyear) { + $param .= '&search_date_startyear='.urlencode($search_date_startyear); + } + if ($search_date_startendday) { + $param .= '&search_date_startendday='.urlencode($search_date_startendday); + } + if ($search_date_startendmonth) { + $param .= '&search_date_startendmonth='.urlencode($search_date_startendmonth); + } + if ($search_date_startendyear) { + $param .= '&search_date_startendyear='.urlencode($search_date_startendyear); + } + // End date + if ($search_date_endday) { + $param .= '&search_date_endday='.urlencode($search_date_endday); + } + if ($search_date_endmonth) { + $param .= '&search_date_endmonth='.urlencode($search_date_endmonth); + } + if ($search_date_endyear) { + $param .= '&search_date_endyear='.urlencode($search_date_endyear); + } + if ($search_date_endendday) { + $param .= '&search_date_endendday='.urlencode($search_date_endendday); + } + if ($search_date_endendmonth) { + $param .= '&search_date_endendmonth='.urlencode($search_date_endendmonth); + } + if ($search_date_endendyear) { + $param .= '&search_date_endendyear='.urlencode($search_date_endendyear); + } if ($search_user) { $param .= "&search_user=".urlencode($search_user); } @@ -489,22 +559,23 @@ if ($resql) { // Date start if (!empty($arrayfields['d.date_debut']['checked'])) { print '
    '; - if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) { - print ''; - } - - print ''; - $formother->select_year($year_start, 'year_start', 1, $min_year, $max_year); + print '
    '; + print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); + print '
    '; + print '
    '; + print $form->selectDate($search_date_startend ? $search_date_startend : -1, 'search_date_startend', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); + print '
    '; print '
    '; - if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) { - print ''; - } - print ''; - $formother->select_year($year_end, 'year_end', 1, $min_year, $max_year); + print '
    '; + print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); + print '
    '; + print '
    '; + print $form->selectDate($search_date_endend ? $search_date_endend : -1, 'search_date_endend', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); + print '
    '; print '
    '; From 678f24f2b3f33079c0757ac674880e10e141832d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 6 Jun 2021 09:57:59 +0200 Subject: [PATCH 0428/1497] try to fix search --- dev/examples/zapier/searches/thirdparty.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/dev/examples/zapier/searches/thirdparty.js b/dev/examples/zapier/searches/thirdparty.js index 8f72b9270e5..009780ea7fb 100644 --- a/dev/examples/zapier/searches/thirdparty.js +++ b/dev/examples/zapier/searches/thirdparty.js @@ -22,7 +22,7 @@ module.exports = { } ], - perform: (z, bundle) => { + perform: async (z, bundle) => { const url = bundle.authData.url + '/api/index.php/thirdparties/'; // Put the search value in a query param. The details of how to build @@ -32,8 +32,18 @@ module.exports = { sqlfilters: "t.nom like \'%"+bundle.inputData.name+"%\'" } }; - - return z.request(url, options).then(response => JSON.parse(response.content)); + const response = await z.request({ + url: url, + skipThrowForStatus: true, + params: { + sqlfilters: "t.nom like \'%"+bundle.inputData.name+"%\'" + } + }); + //z.console.log(response); + if (response.status != 200) { + return []; + } + return response.json; }, // In cases where Zapier needs to show an example record to the user, but we are unable to get a live example From 3c51eac66ff9ffaab68fb1a91e15ae966831c514 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 6 Jun 2021 10:07:01 +0200 Subject: [PATCH 0429/1497] try to fix search --- dev/examples/zapier/searches/thirdparty.js | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/examples/zapier/searches/thirdparty.js b/dev/examples/zapier/searches/thirdparty.js index 009780ea7fb..93c32975992 100644 --- a/dev/examples/zapier/searches/thirdparty.js +++ b/dev/examples/zapier/searches/thirdparty.js @@ -34,6 +34,7 @@ module.exports = { }; const response = await z.request({ url: url, + // this parameter avoid throwing errors and let us manage them skipThrowForStatus: true, params: { sqlfilters: "t.nom like \'%"+bundle.inputData.name+"%\'" From efb5ec2901e577705022be02d16d8d35228d6f3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 6 Jun 2021 10:32:04 +0200 Subject: [PATCH 0430/1497] search by name or email --- dev/examples/zapier/searches/thirdparty.js | 18 +++++++++++++++++- htdocs/core/lib/functions2.lib.php | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/dev/examples/zapier/searches/thirdparty.js b/dev/examples/zapier/searches/thirdparty.js index 93c32975992..2a6d2c6e207 100644 --- a/dev/examples/zapier/searches/thirdparty.js +++ b/dev/examples/zapier/searches/thirdparty.js @@ -19,6 +19,12 @@ module.exports = { type: 'string', label: 'Name', helpText: 'Name to limit to the search to (i.e. The company or %company%).' + }, + { + key: 'email', + type: 'string', + label: 'Email', + helpText: 'Email to limit to the search to.' } ], @@ -32,12 +38,22 @@ module.exports = { sqlfilters: "t.nom like \'%"+bundle.inputData.name+"%\'" } }; + let filter = ''; + if (bundle.inputData.name) { + filter = "t.nom like \'%"+bundle.inputData.name+"%\'"; + } + if (bundle.inputData.email) { + if (bundle.inputData.name) { + filter += " and "; + } + filter += "t.email like \'"+bundle.inputData.email+"\'"; + } const response = await z.request({ url: url, // this parameter avoid throwing errors and let us manage them skipThrowForStatus: true, params: { - sqlfilters: "t.nom like \'%"+bundle.inputData.name+"%\'" + sqlfilters: filter } }); //z.console.log(response); diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index e279ced2a3d..d963763d788 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1043,7 +1043,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $ $regType = array(); if (preg_match('/\{(t+)\}/i', $mask, $regType)) { $masktype = $regType[1]; - $masktype_value = substr(preg_replace('/^TE_/', '', $objsoc->typent_code), 0, dol_strlen($regType[1])); // get n first characters of thirdpaty typent_code (where n is length in mask) + $masktype_value = substr(preg_replace('/^TE_/', '', $objsoc->typent_code), 0, dol_strlen($regType[1])); // get n first characters of thirdparty typent_code (where n is length in mask) $masktype_value = str_pad($masktype_value, dol_strlen($regType[1]), "#", STR_PAD_RIGHT); // we fill on right with # to have same number of char than into mask } else { $masktype = ''; From 6348b777e132cbddea422d15d7ec72c694916c50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 6 Jun 2021 12:12:12 +0200 Subject: [PATCH 0431/1497] add contact search --- dev/examples/zapier/index.js | 2 + dev/examples/zapier/searches/contact.js | 95 ++++++++++++++++++++++ dev/examples/zapier/searches/thirdparty.js | 5 -- 3 files changed, 97 insertions(+), 5 deletions(-) create mode 100644 dev/examples/zapier/searches/contact.js diff --git a/dev/examples/zapier/index.js b/dev/examples/zapier/index.js index 94046969045..044415a7ddd 100644 --- a/dev/examples/zapier/index.js +++ b/dev/examples/zapier/index.js @@ -7,6 +7,7 @@ const triggerTicket = require('./triggers/ticket'); const triggerUser = require('./triggers/user'); const searchThirdparty = require('./searches/thirdparty'); +const searchContact = require('./searches/contact'); const createThirdparty = require('./creates/thirdparty'); const createContact = require('./creates/contact'); @@ -73,6 +74,7 @@ const App = { // If you want your searches to show up, you better include it here! searches: { [searchThirdparty.key]: searchThirdparty, + [searchContact.key]: searchContact, }, // If you want your creates to show up, you better include it here! diff --git a/dev/examples/zapier/searches/contact.js b/dev/examples/zapier/searches/contact.js new file mode 100644 index 00000000000..b52b8d3e367 --- /dev/null +++ b/dev/examples/zapier/searches/contact.js @@ -0,0 +1,95 @@ +module.exports = { + key: 'contact', + + // You'll want to provide some helpful display labels and descriptions + // for users. Zapier will put them into the UX. + noun: 'Contact', + display: { + label: 'Find a Contact', + description: 'Search for contact.' + }, + + // `operation` is where we make the call to your API to do the search + operation: { + // This search only has one search field. Your searches might have just one, or many + // search fields. + inputFields: [ + { + key: 'lastname', + type: 'string', + label: 'Lastname', + helpText: 'Lastname to limit to the search to (i.e. The company or %company%).' + }, + { + key: 'email', + type: 'string', + label: 'Email', + helpText: 'Email to limit to the search to.' + } + ], + + perform: async (z, bundle) => { + const url = bundle.authData.url + '/api/index.php/contacts/'; + + // Put the search value in a query param. The details of how to build + // a search URL will depend on how your API works. + let filter = ''; + if (bundle.inputData.lastname) { + filter = "t.lastname like \'%"+bundle.inputData.name+"%\'"; + } + if (bundle.inputData.email) { + if (bundle.inputData.lastname) { + filter += " and "; + } + filter += "t.email like \'"+bundle.inputData.email+"\'"; + } + const response = await z.request({ + url: url, + // this parameter avoid throwing errors and let us manage them + skipThrowForStatus: true, + params: { + sqlfilters: filter + } + }); + //z.console.log(response); + if (response.status != 200) { + return []; + } + return response.json; + }, + + // In cases where Zapier needs to show an example record to the user, but we are unable to get a live example + // from the API, Zapier will fallback to this hard-coded sample. It should reflect the data structure of + // returned records, and have obviously dummy values that we can show to any user. + sample: { + id: 1, + createdAt: 1472069465, + name: 'DOE', + firstname: 'John', + authorId: 1, + directions: '1. Boil Noodles\n2.Serve with sauce', + style: 'italian' + }, + + // If the resource can have fields that are custom on a per-user basis, define a function to fetch the custom + // field definitions. The result will be used to augment the sample. + // outputFields: () => { return []; } + // Alternatively, a static field definition should be provided, to specify labels for the fields + outputFields: [ + { + key: 'id', + type: "integer", + label: 'ID' + }, + {key: 'createdAt', type: "integer", label: 'Created At'}, + {key: 'name', label: 'Name'}, + {key: 'firstname', label: 'Firstname'}, + {key: 'directions', label: 'Directions'}, + {key: 'authorId', type: "integer", label: 'Author ID'}, + { + key: 'style', + label: 'Style' + } + ] + } +}; diff --git a/dev/examples/zapier/searches/thirdparty.js b/dev/examples/zapier/searches/thirdparty.js index 2a6d2c6e207..e1e6878f5b3 100644 --- a/dev/examples/zapier/searches/thirdparty.js +++ b/dev/examples/zapier/searches/thirdparty.js @@ -33,11 +33,6 @@ module.exports = { // Put the search value in a query param. The details of how to build // a search URL will depend on how your API works. - const options = { - params: { - sqlfilters: "t.nom like \'%"+bundle.inputData.name+"%\'" - } - }; let filter = ''; if (bundle.inputData.name) { filter = "t.nom like \'%"+bundle.inputData.name+"%\'"; From 1aca7efce3d739b079ed8fa0249830fe841b76d3 Mon Sep 17 00:00:00 2001 From: ATM john Date: Sun, 6 Jun 2021 13:15:03 +0200 Subject: [PATCH 0432/1497] Fix childtablesoncascade doc --- htdocs/core/class/commonobject.class.php | 2 +- htdocs/societe/class/societe.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index f2c61bc86a3..1d0509d7483 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -440,7 +440,7 @@ abstract class CommonObject /** * @var array List of child tables. To know object to delete on cascade. - * if name like with @ClassNAme:FilePathClass;ParentFkFieldName' it will + * if name like with @ClassNAme:FilePathClass:ParentFkFieldName' it will * call method deleteByParentField(parentId,ParentFkFieldName) to fetch and delete child object */ protected $childtablesoncascade = array(); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index f10cead50fd..9687485eb10 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -84,7 +84,7 @@ class Societe extends CommonObject /** * @var array List of child tables. To know object to delete on cascade. - * if name like with @ClassNAme:FilePathClass;ParentFkFieldName' it will call method deleteByParentField (with parentId as parameters) and FieldName to fetch and delete child object + * if name like with @ClassNAme:FilePathClass:ParentFkFieldName' it will call method deleteByParentField (with parentId as parameters) and FieldName to fetch and delete child object */ protected $childtablesoncascade = array( "societe_prices", From a1bb7129dab6ebb2f457ed32efa0025354bebb36 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 6 Jun 2021 15:29:49 +0200 Subject: [PATCH 0433/1497] Debug v14 --- htdocs/adherents/partnership.php | 10 ++++--- htdocs/core/lib/member.lib.php | 30 ++++++++++++++++++-- htdocs/core/modules/modPartnership.class.php | 4 +-- htdocs/cron/list.php | 3 +- htdocs/langs/en_US/partnership.lang | 3 ++ htdocs/partnership/admin/setup.php | 5 ++-- 6 files changed, 40 insertions(+), 15 deletions(-) diff --git a/htdocs/adherents/partnership.php b/htdocs/adherents/partnership.php index 28b041240a3..3dab1f86064 100644 --- a/htdocs/adherents/partnership.php +++ b/htdocs/adherents/partnership.php @@ -449,6 +449,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print $formconfirm; + // TODO Replace this card into a list of all partnerships. + + // Object card // ------------------------------------------------------------ $linkback = ''.$langs->trans("BackToList").''; @@ -498,6 +501,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print dol_get_fiche_end(); + + + // Buttons for actions if ($action != 'presend') { @@ -509,10 +515,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } if (empty($reshook)) { - if ($object->status == $object::STATUS_DRAFT) { - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?rowid='.$memberid.'&action=edit&token='.newToken(), '', $permissiontoadd); - } - // Show if ($permissiontoadd) { print dolGetButtonAction($langs->trans('ManagePartnership'), '', 'default', dol_buildpath('/partnership/partnership_card.php', 1).'?id='.$object->id, '', $permissiontoadd); diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php index 484f34c265c..fc274e0d624 100644 --- a/htdocs/core/lib/member.lib.php +++ b/htdocs/core/lib/member.lib.php @@ -63,6 +63,33 @@ function member_prepare_head(Adherent $object) $h++; } + $tabtoadd = (!empty(getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR')) && getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR') == 'member') ? 'member' : 'thirdparty'; + + if ($tabtoadd == 'member') { + if (!empty($user->rights->partnership->read)) { + $nbPartnership = is_array($object->partnerships) ? count($object->partnerships) : 0; + $head[$h][0] = DOL_URL_ROOT.'/adherents/partnership.php?rowid='.$object->id; + $head[$h][1] = $langs->trans("Partnership"); + $head[$h][2] = 'partnership'; + if ($nbPartnership > 0) { + $head[$h][1] .= ''.$nbPartnership.''; + } + $h++; + } + } else { + if (!empty($user->rights->partnership->read)) { + $nbPartnership = is_array($object->partnerships) ? count($object->partnerships) : 0; + $head[$h][0] = DOL_URL_ROOT.'/societe/partnership.php?socid='.$object->id; + $head[$h][1] = $langs->trans("Partnership"); + $head[$h][2] = 'partnership'; + if ($nbPartnership > 0) { + $head[$h][1] .= ''.$nbPartnership.''; + } + $h++; + } + } + + // Show more tabs from modules // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab @@ -70,9 +97,6 @@ function member_prepare_head(Adherent $object) complete_head_from_modules($conf, $langs, $object, $head, $h, 'member'); $nbNote = 0; - if (!empty($object->note)) { - $nbNote++; - } if (!empty($object->note_private)) { $nbNote++; } diff --git a/htdocs/core/modules/modPartnership.class.php b/htdocs/core/modules/modPartnership.class.php index d12cd610238..889f18cde73 100644 --- a/htdocs/core/modules/modPartnership.class.php +++ b/htdocs/core/modules/modPartnership.class.php @@ -180,10 +180,8 @@ class modPartnership extends DolibarrModules $tabtoadd = (!empty(getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR')) && getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR') == 'member') ? 'member' : 'thirdparty'; if ($tabtoadd == 'member') { - $this->tabs[] = array('data'=>'member:+partnership:Partnership:partnership@partnership:$user->rights->partnership->read:/adherents/partnership.php?rowid=__ID__'); $fk_mainmenu = "members"; } else { - $this->tabs[] = array('data'=>'thirdparty:+partnership:Partnership:partnership@partnership:$user->rights->partnership->read:/societe/partnership.php?socid=__ID__'); $fk_mainmenu = "companies"; } @@ -258,7 +256,7 @@ class modPartnership extends DolibarrModules $this->cronjobs = array( 0 => array('priority'=>60, 'label'=>'CancelPartnershipForExpiredMembers', 'jobtype'=>'method', 'class'=>'/partnership/class/partnershiputils.class.php', 'objectname'=>'PartnershipUtils', 'method'=>'doCancelStatusOfMemberPartnership', 'parameters'=>'', 'comment'=>'Cancel status of partnership when subscription is expired + x days.', 'frequency'=>1, 'unitfrequency'=>86400, 'status'=>1, 'test'=>'$conf->partnership->enabled', 'datestart'=>$datestart), - 1 => array('priority'=>61, 'label'=>'CheckDolibarrBacklink', 'jobtype'=>'method', 'class'=>'/partnership/class/partnershiputils.class.php', 'objectname'=>'PartnershipUtils', 'method'=>'doWarningOfPartnershipIfDolibarrBacklinkNotfound', 'parameters'=>'', 'comment'=>'Warning of partnership if Dolibarr backlink not found on partner website.', 'frequency'=>1, 'unitfrequency'=>86400, 'status'=>0, 'test'=>'$conf->partnership->enabled', 'datestart'=>$datestart), + 1 => array('priority'=>61, 'label'=>'PartnershipCheckBacklink', 'jobtype'=>'method', 'class'=>'/partnership/class/partnershiputils.class.php', 'objectname'=>'PartnershipUtils', 'method'=>'doWarningOfPartnershipIfDolibarrBacklinkNotfound', 'parameters'=>'', 'comment'=>'Warning of partnership if Dolibarr backlink not found on partner website.', 'frequency'=>1, 'unitfrequency'=>86400, 'status'=>0, 'test'=>'$conf->partnership->enabled', 'datestart'=>$datestart), ); // Permissions provided by this module diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index 80371b14889..4d829258b2b 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -1,7 +1,7 @@ - * Copyright (C) 2013-2019 Laurent Destailleur + * Copyright (C) 2013-2021 Laurent Destailleur * Copyright (C) 2019 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -24,7 +24,6 @@ * \brief Lists Jobs */ - require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/cron/class/cronjob.class.php'; diff --git a/htdocs/langs/en_US/partnership.lang b/htdocs/langs/en_US/partnership.lang index 6d0c7dc0ac9..04fe88b3442 100644 --- a/htdocs/langs/en_US/partnership.lang +++ b/htdocs/langs/en_US/partnership.lang @@ -20,6 +20,9 @@ ModulePartnershipName=Partnership management PartnershipDescription=Module Partnership management PartnershipDescriptionLong= Module Partnership management +CancelPartnershipForExpiredMembers=Partnership: Cancel partnership of members with expired subscriptions +PartnershipCheckBacklink=Partnership: Check referring backlink + # # Menu # diff --git a/htdocs/partnership/admin/setup.php b/htdocs/partnership/admin/setup.php index 79c8c469eec..7fa0ef62b5e 100644 --- a/htdocs/partnership/admin/setup.php +++ b/htdocs/partnership/admin/setup.php @@ -193,11 +193,10 @@ print ''; print ''; print ''; -print ''; +print ''; print ''; print '
    '.$langs->trans("PARTNERSHIP_BACKLINKS_TO_CHECK").''; -$dbacklinks = 'dolibarr.org|dolibarr.fr|dolibarr.es'; -$backlinks = (!empty($conf->global->PARTNERSHIP_BACKLINKS_TO_CHECK)) ? $conf->global->PARTNERSHIP_BACKLINKS_TO_CHECK : $dbacklinks; +$backlinks = (empty($conf->global->PARTNERSHIP_BACKLINKS_TO_CHECK) ? '' : $conf->global->PARTNERSHIP_BACKLINKS_TO_CHECK); print ''; print ''.$dbacklinks.'dolibarr.org|dolibarr.fr|dolibarr.es
    '; From 9f177a0c63c07269497f3894e68db37441f3787f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 6 Jun 2021 16:36:41 +0200 Subject: [PATCH 0434/1497] Debug v14 --- htdocs/adherents/partnership.php | 388 ++++-------------- htdocs/admin/dict.php | 4 +- htdocs/core/modules/modPartnership.class.php | 21 +- .../install/mysql/migration/13.0.0-14.0.0.sql | 14 +- .../mysql/tables/llx_c_partnership_type.sql | 35 ++ htdocs/langs/en_US/partnership.lang | 2 + .../partnership/class/partnership.class.php | 27 +- htdocs/partnership/partnership_card.php | 51 +-- htdocs/societe/partnership.php | 346 +++------------- 9 files changed, 200 insertions(+), 688 deletions(-) create mode 100644 htdocs/install/mysql/tables/llx_c_partnership_type.sql diff --git a/htdocs/adherents/partnership.php b/htdocs/adherents/partnership.php index 3dab1f86064..cf0e11d70e0 100644 --- a/htdocs/adherents/partnership.php +++ b/htdocs/adherents/partnership.php @@ -57,8 +57,7 @@ require_once DOL_DOCUMENT_ROOT.'/partnership/lib/partnership.lib.php'; $langs->loadLangs(array("companies","members","partnership", "other")); // Get parameters -$id = GETPOST('id', 'int'); -$memberid = GETPOST('rowid', 'int'); +$id = GETPOST('rowid', 'int') ? GETPOST('rowid', 'int') : GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); @@ -68,9 +67,9 @@ $backtopage = GETPOST('backtopage', 'alpha'); $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); //$lineid = GETPOST('lineid', 'int'); -$member = new Adherent($db); -if ($memberid > 0) { - $member->fetch($memberid); +$object = new Adherent($db); +if ($id > 0) { + $object->fetch($id); } // Initialize technical objects @@ -112,19 +111,13 @@ if (empty($conf->partnership->enabled)) accessforbidden(); if (empty($permissiontoread)) accessforbidden(); if ($action == 'edit' && empty($permissiontoadd)) accessforbidden(); -$partnershipid = $object->fetch(0, "", $memberid); -if (empty($action) && empty($partnershipid)) { - $action = 'create'; -} -if (($action == 'update' || $action == 'edit') && $object->status != $object::STATUS_DRAFT) accessforbidden(); - -if (empty($memberid) && $object) { - $memberid = $object->fk_member; +if (($action == 'update' || $action == 'edit') && $object->status != $object::STATUS_DRAFT) { + accessforbidden(); } // Security check -$result = restrictedArea($user, 'adherent', $memberid, '', '', 'socid', 'rowid', 0); +$result = restrictedArea($user, 'adherent', $id, '', '', 'socid', 'rowid', 0); /* @@ -143,102 +136,7 @@ $date_end = dol_mktime(0, 0, 0, GETPOST('date_partnership_endmonth', 'int'), GET if (empty($reshook)) { $error = 0; - $backtopage = dol_buildpath('/partnership/partnership.php', 1).'?rowid='.($memberid > 0 ? $memberid : '__ID__'); - - $triggermodname = 'PARTNERSHIP_MODIFY'; // Name of trigger action code to execute when we modify record - - if ($action == 'add' && $permissiontoread) { - $error = 0; - - $db->begin(); - - $now = dol_now(); - - if (!$error) { - $old_start_date = $object->date_partnership_start; - - $object->fk_member = $memberid; - $object->date_partnership_start = (!GETPOST('date_partnership_start')) ? '' : $date_start; - $object->date_partnership_end = (!GETPOST('date_partnership_end')) ? '' : $date_end; - $object->note_public = GETPOST('note_public', 'restricthtml'); - $object->date_creation = $now; - $object->fk_user_creat = $user->id; - $object->entity = $conf->entity; - - // Fill array 'array_options' with data from add form - $ret = $extrafields->setOptionalsFromPost(null, $object); - if ($ret < 0) { - $error++; - } - } - - if (!$error) { - $result = $object->create($user); - if ($result < 0) { - $error++; - if ($result == -4) { - setEventMessages($langs->trans("ErrorRefAlreadyExists"), null, 'errors'); - } else { - setEventMessages($object->error, $object->errors, 'errors'); - } - } - } - - if ($error) { - $db->rollback(); - $action = 'create'; - } else { - $db->commit(); - } - } elseif ($action == 'update' && $permissiontoread) { - $error = 0; - - $db->begin(); - - $now = dol_now(); - - if (!$error) { - $object->oldcopy = clone $object; - - $old_start_date = $object->date_partnership_start; - - $object->date_partnership_start = (!GETPOST('date_partnership_start')) ? '' : $date_start; - $object->date_partnership_end = (!GETPOST('date_partnership_end')) ? '' : $date_end; - $object->note_public = GETPOST('note_public', 'restricthtml'); - $object->fk_user_creat = $user->id; - $object->fk_user_modif = $user->id; - - // Fill array 'array_options' with data from add form - $ret = $extrafields->setOptionalsFromPost(null, $object); - if ($ret < 0) { - $error++; - } - } - - if (!$error) { - $result = $object->update($user); - if ($result < 0) { - $error++; - if ($result == -4) { - setEventMessages($langs->trans("ErrorRefAlreadyExists"), null, 'errors'); - } else { - setEventMessages($object->error, $object->errors, 'errors'); - } - } - } - - if ($error) { - $db->rollback(); - $action = 'edit'; - } else { - $db->commit(); - } - } elseif ($action == 'confirm_close' || $action == 'update_extras') { - include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; - - header("Location: ".$_SERVER['PHP_SELF']."?rowid=".$memberid); - exit; - } + $backtopage = dol_buildpath('/partnership/partnership.php', 1).'?rowid='.($id > 0 ? $id : '__ID__'); // Actions when linking object each other include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; @@ -261,11 +159,11 @@ llxHeader('', $title); $form = new Form($db); -if ($memberid) { +if ($id > 0) { $langs->load("members"); - $member = new Adherent($db); - $result = $member->fetch($memberid); + $object = new Adherent($db); + $result = $object->fetch($id); if (!empty($conf->notification->enabled)) { $langs->load("mails"); @@ -273,13 +171,13 @@ if ($memberid) { $adht->fetch($object->typeid); - $head = member_prepare_head($member); + $head = member_prepare_head($object); print dol_get_fiche_head($head, 'partnership', $langs->trans("ThirdParty"), -1, 'user'); $linkback = ''.$langs->trans("BackToList").''; - dol_banner_tab($member, 'rowid', $linkback); + dol_banner_tab($object, 'rowid', $linkback); print '
    '; @@ -288,21 +186,21 @@ if ($memberid) { // Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { - print ''.$langs->trans("Login").' / '.$langs->trans("Id").''.$member->login.' '; + print ''.$langs->trans("Login").' / '.$langs->trans("Id").''.$object->login.' '; } // Type print ''.$langs->trans("Type").''.$adht->getNomUrl(1)."\n"; // Morphy - print ''.$langs->trans("MemberNature").''.$member->getmorphylib().''; + print ''.$langs->trans("MemberNature").''.$object->getmorphylib().''; print ''; // Company - print ''.$langs->trans("Company").''.$member->company.''; + print ''.$langs->trans("Company").''.$object->company.''; // Civility - print ''.$langs->trans("UserTitle").''.$member->getCivilityLabel().' '; + print ''.$langs->trans("UserTitle").''.$object->getCivilityLabel().' '; print ''; print ''; @@ -310,200 +208,13 @@ if ($memberid) { print '
    '; print dol_get_fiche_end(); - - $params = ''; - - print '
    '; } else { dol_print_error('', 'Parameter rowid not defined'); } -// Part to create -if ($action == 'create') { - print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("Partnership")), '', ''); - - $backtopageforcancel = DOL_URL_ROOT.'/partnership/partnership.php?rowid='.$memberid; - - print '
    '; - print ''; - print ''; - print ''; - print ''; - - if ($backtopage) { - print ''; - } - if ($backtopageforcancel) { - print ''; - } - - print dol_get_fiche_head(array(), ''); - - print ''."\n"; - - // Common attributes - include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php'; - - // Other attributes - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; - - print '
    '."\n"; - - print dol_get_fiche_end(); - - print '
    '; - print ''; - print '  '; - // print ''; // Cancel for create does not post form if we don't know the backtopage - print '
    '; - - print '
    '; -} - -// Part to edit record -if (($partnershipid || $ref) && $action == 'edit') { - print load_fiche_titre($langs->trans("Partnership"), '', ''); - - $backtopageforcancel = DOL_URL_ROOT.'/partnership/partnership.php?rowid='.$memberid; - - print '
    '; - print ''; - print ''; - print ''; - print ''; - if ($backtopage) { - print ''; - } - if ($backtopageforcancel) { - print ''; - } - - print dol_get_fiche_head(); - - print ''."\n"; - - // Common attributes - include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php'; - - // Other attributes - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php'; - - print '
    '; - - print dol_get_fiche_end(); - - print '
    '; - print '   '; - print '
    '; - - print '
    '; -} // Part to show record if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) { - print load_fiche_titre($langs->trans("PartnershipDedicatedToThisMember", $langs->transnoentitiesnoconv("Partnership")), '', ''); - - $res = $object->fetch_optionals(); - - // $head = partnershipPrepareHead($object); - // print dol_get_fiche_head($head, 'card', $langs->trans("Partnership"), -1, $object->picto); - - $linkback = ''; - dol_banner_tab($object, 'id', $linkback, 0, 'rowid', 'ref'); - - $formconfirm = ''; - - // Close confirmation - if ($action == 'close') { - // Create an array for form - $formquestion = array(); - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClose'), $langs->trans('ConfirmClosePartnershipAsk', $object->ref), 'confirm_close', $formquestion, 'yes', 1); - } - // Reopon confirmation - if ($action == 'reopen') { - // Create an array for form - $formquestion = array(); - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToReopon'), $langs->trans('ConfirmReoponAsk', $object->ref), 'confirm_reopen', $formquestion, 'yes', 1); - } - - // Refuse confirmatio - if ($action == 'refuse') { - //Form to close proposal (signed or not) - $formquestion = array( - array('type' => 'text', 'name' => 'reason_decline_or_cancel', 'label' => $langs->trans("Note"), 'morecss' => 'reason_decline_or_cancel', 'value' => '') // Field to complete private note (not replace) - ); - - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ReasonDecline'), $text, 'confirm_refuse', $formquestion, '', 1, 250); - } - - // Call Hook formConfirm - $parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid); - $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - if (empty($reshook)) { - $formconfirm .= $hookmanager->resPrint; - } elseif ($reshook > 0) { - $formconfirm = $hookmanager->resPrint; - } - - // Print form confirm - print $formconfirm; - - - // TODO Replace this card into a list of all partnerships. - - - // Object card - // ------------------------------------------------------------ - $linkback = ''.$langs->trans("BackToList").''; - - print '
    '; - print '
    '; - print '
    '; - print ''."\n"; - - // Common attributes - //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field - //unset($object->fields['fk_project']); // Hide field already shown in banner - //unset($object->fields['fk_member']); // Hide field already shown in banner - include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; - - // End of subscription date - $fadherent = new Adherent($db); - $fadherent->fetch($object->fk_member); - print ''; - - // Other attributes. Fields from hook formObjectOptions and Extrafields. - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; - - print '
    '.$langs->trans("SubscriptionEndDate").''; - if ($fadherent->datefin) { - print dol_print_date($fadherent->datefin, 'day'); - if ($fadherent->hasDelay()) { - print " ".img_warning($langs->trans("Late")); - } - } else { - if (!$adht->subscription) { - print $langs->trans("SubscriptionNotRecorded"); - if ($fadherent->statut > 0) { - print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled - } - } else { - print $langs->trans("SubscriptionNotReceived"); - if ($fadherent->statut > 0) { - print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled - } - } - } - print '
    '; - print '
    '; - - print '
    '; - - print dol_get_fiche_end(); - - - - // Buttons for actions if ($action != 'presend') { @@ -517,20 +228,65 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (empty($reshook)) { // Show if ($permissiontoadd) { - print dolGetButtonAction($langs->trans('ManagePartnership'), '', 'default', dol_buildpath('/partnership/partnership_card.php', 1).'?id='.$object->id, '', $permissiontoadd); + print dolGetButtonAction($langs->trans('AddPartnership'), '', 'default', DOL_URL_ROOT.'/partnership/partnership_card.php?action=create&fk_member='.$object->id.'&backtopage='.urlencode(DOL_URL_ROOT.'/adherents/partnership.php?id='.$object->id), '', $permissiontoadd); } - - // Cancel - /* - if ($permissiontoadd) { - if ($object->status == $object::STATUS_ACCEPTED) { - print dolGetButtonAction($langs->trans('Cancel'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=close&token='.newToken(), '', $permissiontoadd); - } - } - */ } print '
    '."\n"; } + + + //$morehtmlright = 'partnership/partnership_card.php?action=create&backtopage=%2Fdolibarr%2Fhtdocs%2Fpartnership%2Fpartnership_list.php'; + $morehtmlright = ''; + + print load_fiche_titre($langs->trans("PartnershipDedicatedToThisMember", $langs->transnoentitiesnoconv("Partnership")), $morehtmlright, ''); + + $memberid = $object->id; + + + // TODO Replace this card with the list of all partnerships. + + $object = new Partnership($db); + $partnershipid = $object->fetch(0, "", $memberid); + + if ($partnershipid > 0) { + print '
    '; + print '
    '; + print '
    '; + print ''."\n"; + + // Common attributes + //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field + //unset($object->fields['fk_project']); // Hide field already shown in banner + //unset($object->fields['fk_member']); // Hide field already shown in banner + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; + + // End of subscription date + $fadherent = new Adherent($db); + $fadherent->fetch($object->fk_member); + print ''; + + print '
    '.$langs->trans("SubscriptionEndDate").''; + if ($fadherent->datefin) { + print dol_print_date($fadherent->datefin, 'day'); + if ($fadherent->hasDelay()) { + print " ".img_warning($langs->trans("Late")); + } + } else { + if (!$adht->subscription) { + print $langs->trans("SubscriptionNotRecorded"); + if ($fadherent->statut > 0) { + print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled + } + } else { + print $langs->trans("SubscriptionNotReceived"); + if ($fadherent->statut > 0) { + print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled + } + } + } + print '
    '; + print '
    '; + } } // End of page diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index d03574d473b..650c0016f9a 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -100,7 +100,7 @@ $hookmanager->initHooks(array('admin')); // Put here declaration of dictionaries properties // Sort order to show dictionary (0 is space). All other dictionaries (added by modules) will be at end of this. -$taborder = array(9, 0, 4, 3, 2, 0, 1, 8, 19, 16, 39, 27, 40, 38, 0, 5, 11, 0, 6, 0, 29, 0, 33, 34, 32, 24, 28, 17, 35, 36, 0, 10, 23, 12, 13, 7, 0, 14, 0, 22, 20, 18, 21, 41, 0, 15, 30, 0, 37, 42, 0, 25, 0, 43, 0); +$taborder = array(9, 0, 4, 3, 2, 0, 1, 8, 19, 16, 39, 27, 40, 38, 0, 5, 11, 0, 6, 0, 29, 0, 33, 34, 32, 24, 28, 17, 35, 36, 0, 10, 23, 12, 13, 7, 0, 14, 0, 22, 20, 18, 21, 41, 0, 15, 30, 0, 37, 42, 0,43, 0, 25, 0); // Name of SQL tables of dictionaries $tabname = array(); @@ -608,7 +608,7 @@ $tabcomplete = array( 'c_prospectcontactlevel'=>array('picto'=>'company'), 'c_stcommcontact'=>array('picto'=>'company'), 'c_product_nature'=>array('picto'=>'product'), - 'c_productbatch_qcstatus'=>array('picto'=>'batch'), + 'c_productbatch_qcstatus'=>array('picto'=>'lot'), ); diff --git a/htdocs/core/modules/modPartnership.class.php b/htdocs/core/modules/modPartnership.class.php index 889f18cde73..d7041eca754 100644 --- a/htdocs/core/modules/modPartnership.class.php +++ b/htdocs/core/modules/modPartnership.class.php @@ -212,30 +212,27 @@ class modPartnership extends DolibarrModules // 'user' to add a tab in user view // Dictionaries - $this->dictionaries = array(); - /* Example: $this->dictionaries=array( 'langs'=>'partnership@partnership', // List of tables we want to see into dictonnary editor - 'tabname'=>array(MAIN_DB_PREFIX."table1", MAIN_DB_PREFIX."table2", MAIN_DB_PREFIX."table3"), + 'tabname'=>array(MAIN_DB_PREFIX."c_partnership_type"), // Label of tables - 'tablib'=>array("Table1", "Table2", "Table3"), + 'tablib'=>array("PartnershipType"), // Request to select fields - 'tabsql'=>array('SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table1 as f', 'SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table2 as f', 'SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table3 as f'), + 'tabsql'=>array('SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'c_partnership_type as f WHERE f.entity = '.$conf->entity), // Sort order - 'tabsqlsort'=>array("label ASC", "label ASC", "label ASC"), + 'tabsqlsort'=>array("label ASC"), // List of fields (result of select to show dictionary) - 'tabfield'=>array("code,label", "code,label", "code,label"), + 'tabfield'=>array("code,label"), // List of fields (list of fields to edit a record) - 'tabfieldvalue'=>array("code,label", "code,label", "code,label"), + 'tabfieldvalue'=>array("code,label"), // List of fields (list of fields for insert) - 'tabfieldinsert'=>array("code,label", "code,label", "code,label"), + 'tabfieldinsert'=>array("code,label"), // Name of columns with primary key (try to always name it 'rowid') - 'tabrowid'=>array("rowid", "rowid", "rowid"), + 'tabrowid'=>array("rowid"), // Condition to show each dictionary - 'tabcond'=>array($conf->partnership->enabled, $conf->partnership->enabled, $conf->partnership->enabled) + 'tabcond'=>array($conf->partnership->enabled) ); - */ // Boxes/Widgets // Add here list of php file(s) stored in partnership/core/boxes that contains a class to show a widget. diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index cc4b791725d..741d92a88a1 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -173,7 +173,9 @@ CREATE TABLE llx_workstation_workstation_usergroup( fk_workstation integer ) ENGINE=innodb; -CREATE TABLE llx_c_producbatch_qcstatus( +DROP TABLE llx_c_producbatch_qcstatus; -- delete table with bad name + +CREATE TABLE llx_c_productbatch_qcstatus( rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, entity integer NOT NULL DEFAULT 1, code varchar(16) NOT NULL, @@ -532,3 +534,13 @@ INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) VALUE INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) VALUES ('CONTACT_MODIFY','Contact address update','Executed when a contact is updated','contact',51); +create table llx_c_partnership_type +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + entity integer DEFAULT 1 NOT NULL, + code varchar(32) NOT NULL, + label varchar(64) NOT NULL, + active tinyint DEFAULT 1 NOT NULL +)ENGINE=innodb; + + diff --git a/htdocs/install/mysql/tables/llx_c_partnership_type.sql b/htdocs/install/mysql/tables/llx_c_partnership_type.sql new file mode 100644 index 00000000000..23d5a89e16c --- /dev/null +++ b/htdocs/install/mysql/tables/llx_c_partnership_type.sql @@ -0,0 +1,35 @@ +-- ======================================================================== +-- Copyright (C) 2021 Laurent Destailleur +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- Defini les types de contact d'un element sert de reference pour +-- la table llx_element_contact +-- +-- element est le nom de la table utilisant le type de contact. +-- i.e. contact, facture, projet, societe (sans le llx_ devant). +-- Libelle est un texte decrivant le type de contact. +-- active precise si cette valeur est 'active' ou 'archive'. +-- +-- ======================================================================== + +create table llx_c_partnership_type +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + entity integer DEFAULT 1 NOT NULL, + code varchar(32) NOT NULL, + label varchar(64) NOT NULL, + active tinyint DEFAULT 1 NOT NULL +)ENGINE=innodb; + diff --git a/htdocs/langs/en_US/partnership.lang b/htdocs/langs/en_US/partnership.lang index 04fe88b3442..3a653e29967 100644 --- a/htdocs/langs/en_US/partnership.lang +++ b/htdocs/langs/en_US/partnership.lang @@ -20,6 +20,7 @@ ModulePartnershipName=Partnership management PartnershipDescription=Module Partnership management PartnershipDescriptionLong= Module Partnership management +AddPartnership=Add partnership CancelPartnershipForExpiredMembers=Partnership: Cancel partnership of members with expired subscriptions PartnershipCheckBacklink=Partnership: Check referring backlink @@ -56,6 +57,7 @@ PartnershipAlreadyExist=Partnership already exist ManagePartnership=Manage partnership BacklinkNotFoundOnPartnerWebsite=Backlink not found on partner website ConfirmClosePartnershipAsk=Are you sure you want to cancel this partnership? +PartnershipType=Partnership type # # Template Mail diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index f33a19f312e..d04d0c335eb 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -105,7 +105,7 @@ class Partnership extends CommonObject /** * @var int rowid * @deprecated - * @see id + * @see $id */ public $rowid; @@ -180,6 +180,7 @@ class Partnership extends CommonObject 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>4, 'noteditable'=>'1', 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'comment'=>"Reference of object"), 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => 1, 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 15, 'index' => 1), + //'fk_type' => array('type' => 'integer:PartnershipType:partnership/class/partnershiptype.class.php', 'label' => 'Type', 'default' => 1, 'enabled' => 1, 'visible' => 1, 'position' => 20), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>61, 'notnull'=>0, 'visible'=>0,), 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>62, 'notnull'=>0, 'visible'=>0,), 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2,), @@ -353,15 +354,16 @@ class Partnership extends CommonObject * * @param int $id Id of object to load * @param string $ref Ref of object - * @param int $fk_soc_or_member fk_soc or fk_member + * @param int $fk_soc fk_soc + * @param int $fk_member fk_member * @return int >0 if OK, <0 if KO, 0 if not found */ - public function fetch($id, $ref = null, $fk_soc_or_member = null) + public function fetch($id, $ref = null, $fk_member = null, $fk_soc = null) { global $conf; // Check parameters - if (empty($id) && empty($ref) && empty($fk_soc_or_member)) { + if (empty($id) && empty($ref) && empty($fk_member) && empty($fk_soc)) { return -1; } @@ -375,7 +377,7 @@ class Partnership extends CommonObject $sql .= ' FROM '.MAIN_DB_PREFIX.'partnership as p'; if ($id) { - $sql .= " WHERE p.rowid=".$id; + $sql .= " WHERE p.rowid=".((int) $id); } else { $sql .= " WHERE p.entity IN (0,".getEntity('partnership').")"; // Dont't use entity if you use rowid } @@ -384,14 +386,13 @@ class Partnership extends CommonObject $sql .= " AND p.ref='".$this->db->escape($ref)."'"; } - if ($fk_soc_or_member) { - $sql .= ' AND'; - if ($conf->global->PARTNERSHIP_IS_MANAGED_FOR == 'member') - $sql .= ' p.fk_member = '; - else $sql .= ' p.fk_soc = '; - $sql .= $fk_soc_or_member; - $sql .= ' ORDER BY p.date_partnership_end DESC'; + if ($fk_member > 0) { + $sql .= ' AND p.fk_member = '.((int) $fk_member); } + if ($fk_soc > 0) { + $sql .= ' AND p.fk_soc = '.((int) $fk_soc); + } + $sql .= ' ORDER BY p.date_partnership_end DESC'; dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $result = $this->db->query($sql); @@ -420,8 +421,6 @@ class Partnership extends CommonObject $this->import_key = $obj->import_key; $this->model_pdf = $obj->model_pdf; - $this->lines = array(); - // Retrieve all extrafield // fetch optionals attributes and labels $this->fetch_optionals(); diff --git a/htdocs/partnership/partnership_card.php b/htdocs/partnership/partnership_card.php index 72e0bc22bdd..21c5cbdf68b 100644 --- a/htdocs/partnership/partnership_card.php +++ b/htdocs/partnership/partnership_card.php @@ -44,41 +44,12 @@ //if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} - +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; -dol_include_once('/partnership/class/partnership.class.php'); -dol_include_once('/partnership/lib/partnership.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership.class.php'; +require_once DOL_DOCUMENT_ROOT.'/partnership/lib/partnership.lib.php'; // Load translation files required by the page $langs->loadLangs(array("partnership", "other")); @@ -164,21 +135,11 @@ if (empty($reshook)) { $fk_partner = ($managedfor == 'member') ? GETPOST('fk_member', 'int') : GETPOST('fk_soc', 'int'); $obj_partner = ($managedfor == 'member') ? $object->fk_member : $object->fk_soc; - if ($action == 'add' || ($action == 'update' && $obj_partner != $fk_partner)) { - $fpartnership = new Partnership($db); - - $partnershipid = $fpartnership->fetch(0, "", $fk_partner); - if ($partnershipid > 0) { - setEventMessages($langs->trans('PartnershipAlreadyExist').' : '.$fpartnership->getNomUrl(0, '', 1), '', 'errors'); - $action = ($action == 'add') ? 'create' : 'edit'; - } - } - - $triggermodname = 'PARTNERSHIP_MODIFY'; // Name of trigger action code to execute when we modify record - // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; + $triggermodname = 'PARTNERSHIP_MODIFY'; // Name of trigger action code to execute when we modify record + // Action accept object if ($action == 'confirm_accept' && $confirm == 'yes' && $permissiontoadd) { $result = $object->accept($user); @@ -275,8 +236,6 @@ if ($object->id > 0 && $object->status == $object::STATUS_REFUSED) $object->fiel /* * View - * - * Put here all code to build page */ $form = new Form($db); diff --git a/htdocs/societe/partnership.php b/htdocs/societe/partnership.php index 6a45c657126..d109421fe8d 100644 --- a/htdocs/societe/partnership.php +++ b/htdocs/societe/partnership.php @@ -48,6 +48,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; +require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership.class.php'; require_once DOL_DOCUMENT_ROOT.'/partnership/lib/partnership.lib.php'; @@ -70,11 +71,12 @@ $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); $socid = GETPOST('socid', 'int'); if (!empty($user->socid)) { $socid = $user->socid; + $id = $socid; } -$societe = new Societe($db); -if ($socid > 0) { - $societe->fetch($socid); +$object = new Societe($db); +if ($id > 0) { + $object->fetch($id); } // Initialize technical objects @@ -115,18 +117,13 @@ if (empty($conf->partnership->enabled)) accessforbidden(); if (empty($permissiontoread)) accessforbidden(); if ($action == 'edit' && empty($permissiontoadd)) accessforbidden(); -$partnershipid = $object->fetch(0, "", $socid); -if (empty($action) && empty($partnershipid)) { - $action = 'create'; +if (($action == 'update' || $action == 'edit') && $object->status != $object::STATUS_DRAFT && !empty($user->socid)) { + accessforbidden(); } -if (($action == 'update' || $action == 'edit') && $object->status != $object::STATUS_DRAFT && !empty($user->socid)) accessforbidden(); -if (empty($socid) && $object) { - $socid = $object->fk_soc; -} // Security check -$result = restrictedArea($user, 'societe', $socid, '&societe', '', 'fk_soc', 'rowid', 0); +$result = restrictedArea($user, 'societe', $id, '&societe', '', 'fk_soc', 'rowid', 0); /* @@ -145,102 +142,7 @@ $date_end = dol_mktime(0, 0, 0, GETPOST('date_partnership_endmonth', 'int'), GET if (empty($reshook)) { $error = 0; - $backtopage = dol_buildpath('/partnership/partnership.php', 1).'?socid='.($socid > 0 ? $socid : '__ID__'); - - $triggermodname = 'PARTNERSHIP_MODIFY'; // Name of trigger action code to execute when we modify record - - if ($action == 'add' && $permissiontoread) { - $error = 0; - - $db->begin(); - - $now = dol_now(); - - if (!$error) { - $old_start_date = $object->date_partnership_start; - - $object->fk_soc = $socid; - $object->date_partnership_start = (!GETPOST('date_partnership_start')) ? '' : $date_start; - $object->date_partnership_end = (!GETPOST('date_partnership_end')) ? '' : $date_end; - $object->note_public = GETPOST('note_public', 'restricthtml'); - $object->date_creation = $now; - $object->fk_user_creat = $user->id; - $object->entity = $conf->entity; - - // Fill array 'array_options' with data from add form - $ret = $extrafields->setOptionalsFromPost(null, $object); - if ($ret < 0) { - $error++; - } - } - - if (!$error) { - $result = $object->create($user); - if ($result < 0) { - $error++; - if ($result == -4) { - setEventMessages($langs->trans("ErrorRefAlreadyExists"), null, 'errors'); - } else { - setEventMessages($object->error, $object->errors, 'errors'); - } - } - } - - if ($error) { - $db->rollback(); - $action = 'create'; - } else { - $db->commit(); - } - } elseif ($action == 'update' && $permissiontoread) { - $error = 0; - - $db->begin(); - - $now = dol_now(); - - if (!$error) { - $object->oldcopy = clone $object; - - $old_start_date = $object->date_partnership_start; - - $object->date_partnership_start = (!GETPOST('date_partnership_start')) ? '' : $date_start; - $object->date_partnership_end = (!GETPOST('date_partnership_end')) ? '' : $date_end; - $object->note_public = GETPOST('note_public', 'restricthtml'); - $object->fk_user_creat = $user->id; - $object->fk_user_modif = $user->id; - - // Fill array 'array_options' with data from add form - $ret = $extrafields->setOptionalsFromPost(null, $object); - if ($ret < 0) { - $error++; - } - } - - if (!$error) { - $result = $object->update($user); - if ($result < 0) { - $error++; - if ($result == -4) { - setEventMessages($langs->trans("ErrorRefAlreadyExists"), null, 'errors'); - } else { - setEventMessages($object->error, $object->errors, 'errors'); - } - } - } - - if ($error) { - $db->rollback(); - $action = 'edit'; - } else { - $db->commit(); - } - } elseif ($action == 'confirm_close' || $action == 'update_extras') { - include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; - - header("Location: ".$_SERVER['PHP_SELF']."?socid=".$socid); - exit; - } + $backtopage = dol_buildpath('/partnership/partnership.php', 1).'?id='.($id > 0 ? $id : '__ID__'); // Actions when linking object each other include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; @@ -250,6 +152,7 @@ $object->fields['fk_soc']['visible'] = 0; if ($object->id > 0 && $object->status == $object::STATUS_REFUSED && empty($action)) $object->fields['reason_decline_or_cancel']['visible'] = 1; $object->fields['note_public']['visible'] = 1; + /* * View */ @@ -262,25 +165,22 @@ llxHeader('', $title); $form = new Form($db); -if ($socid) { - require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; - require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; - +if ($id > 0) { $langs->load("companies"); - $societe = new Societe($db); - $result = $societe->fetch($socid); + $object = new Societe($db); + $result = $object->fetch($id); if (!empty($conf->notification->enabled)) { $langs->load("mails"); } - $head = societe_prepare_head($societe); + $head = societe_prepare_head($object); print dol_get_fiche_head($head, 'partnership', $langs->trans("ThirdParty"), -1, 'company'); $linkback = ''.$langs->trans("BackToList").''; - dol_banner_tab($societe, 'socid', $linkback, ($user->socid ? 0 : 1), 'rowid', 'nom'); + dol_banner_tab($object, 'socid', $linkback, ($user->socid ? 0 : 1), 'rowid', 'nom'); print '
    '; @@ -310,7 +210,8 @@ if ($socid) { if ($tmpcheck != 0 && $tmpcheck != -5) { print ' ('.$langs->trans("WrongSupplierCode").')'; } - print ''; + print ''; + print ''; } print ''; @@ -318,178 +219,12 @@ if ($socid) { print '
    '; print dol_get_fiche_end(); - - $params = ''; - - print '
    '; } else { - dol_print_error('', 'Parameter socid not defined'); -} - -// Part to create -if ($action == 'create') { - print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("Partnership")), '', ''); - - $backtopageforcancel = DOL_URL_ROOT.'/partnership/partnership.php?socid='.$socid; - - print '
    '; - print ''; - print ''; - print ''; - print ''; - - if ($backtopage) { - print ''; - } - if ($backtopageforcancel) { - print ''; - } - - print dol_get_fiche_head(array(), ''); - - print ''."\n"; - - // Common attributes - include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php'; - - // Other attributes - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; - - print '
    '."\n"; - - print dol_get_fiche_end(); - - print '
    '; - print ''; - print '  '; - // print ''; // Cancel for create does not post form if we don't know the backtopage - print '
    '; - - print '
    '; -} - -// Part to edit record -if (($partnershipid || $ref) && $action == 'edit') { - print load_fiche_titre($langs->trans("Partnership"), '', ''); - - $backtopageforcancel = DOL_URL_ROOT.'/partnership/partnership.php?socid='.$socid; - - print '
    '; - print ''; - print ''; - print ''; - print ''; - if ($backtopage) { - print ''; - } - if ($backtopageforcancel) { - print ''; - } - - print dol_get_fiche_head(); - - print ''."\n"; - - // Common attributes - include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php'; - - // Other attributes - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php'; - - print '
    '; - - print dol_get_fiche_end(); - - print '
    '; - print '   '; - print '
    '; - - print '
    '; + dol_print_error('', 'Parameter id not defined'); } // Part to show record if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) { - print load_fiche_titre($langs->trans("PartnershipDedicatedToThisThirdParty", $langs->transnoentitiesnoconv("Partnership")), '', ''); - - $res = $object->fetch_optionals(); - - // $head = partnershipPrepareHead($object); - // print dol_get_fiche_head($head, 'card', $langs->trans("Partnership"), -1, $object->picto); - - $linkback = ''; - dol_banner_tab($object, 'id', $linkback, 0, 'rowid', 'ref'); - - $formconfirm = ''; - - // Close confirmation - if ($action == 'close') { - // Create an array for form - $formquestion = array(); - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClose'), $langs->trans('ConfirmClosePartnershipAsk', $object->ref), 'confirm_close', $formquestion, 'yes', 1); - } - // Reopon confirmation - if ($action == 'reopen') { - // Create an array for form - $formquestion = array(); - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToReopon'), $langs->trans('ConfirmReoponAsk', $object->ref), 'confirm_reopen', $formquestion, 'yes', 1); - } - - // Refuse confirmatio - if ($action == 'refuse') { - //Form to close proposal (signed or not) - $formquestion = array( - array('type' => 'text', 'name' => 'reason_decline_or_cancel', 'label' => $langs->trans("Note"), 'morecss' => 'reason_decline_or_cancel', 'value' => '') // Field to complete private note (not replace) - ); - - // if (!empty($conf->notification->enabled)) { - // require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; - // $notify = new Notify($db); - // $formquestion = array_merge($formquestion, array( - // array('type' => 'onecolumn', 'value' => $notify->confirmMessage('PROPAL_CLOSE_SIGNED', $object->socid, $object)), - // )); - // } - - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ReasonDecline'), $text, 'confirm_refuse', $formquestion, '', 1, 250); - } - - // Call Hook formConfirm - $parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid); - $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - if (empty($reshook)) { - $formconfirm .= $hookmanager->resPrint; - } elseif ($reshook > 0) { - $formconfirm = $hookmanager->resPrint; - } - - // Print form confirm - print $formconfirm; - - - // Object card - // ------------------------------------------------------------ - $linkback = ''.$langs->trans("BackToList").''; - - print '
    '; - print '
    '; - print '
    '; - print ''."\n"; - - // Common attributes - //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field - //unset($object->fields['fk_project']); // Hide field already shown in banner - //unset($object->fields['fk_soc']); // Hide field already shown in banner - include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; - - // Other attributes. Fields from hook formObjectOptions and Extrafields. - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; - - print '
    '; - print '
    '; - - print '
    '; - - print dol_get_fiche_end(); - // Buttons for actions if ($action != 'presend') { @@ -501,26 +236,43 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } if (empty($reshook)) { - if ($object->status == $object::STATUS_DRAFT) { - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?socid='.$socid.'&action=edit&token='.newtoken(), '', $permissiontoadd); - } - // Show if ($permissiontoadd) { - print dolGetButtonAction($langs->trans('ManagePartnership'), '', 'default', dol_buildpath('/partnership/partnership_card.php', 1).'?id='.$object->id, '', $permissiontoadd); + print dolGetButtonAction($langs->trans('AddPartnership'), '', 'default', DOL_URL_ROOT.'/partnership/partnership_card.php?action=create&fk_soc='.$object->id.'&backtopage='.urlencode(DOL_URL_ROOT.'/societe/partnership.php?id='.$object->id), '', $permissiontoadd); } - - // Cancel - /* - if ($permissiontoadd) { - if ($object->status == $object::STATUS_ACCEPTED) { - print dolGetButtonAction($langs->trans('Cancel'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=close&token='.newToken(), '', $permissiontoadd); - } - } - */ } print '
    '."\n"; } + + + //$morehtmlright = 'partnership/partnership_card.php?action=create&backtopage=%2Fdolibarr%2Fhtdocs%2Fpartnership%2Fpartnership_list.php'; + $morehtmlright = ''; + + print load_fiche_titre($langs->trans("PartnershipDedicatedToThisThirdParty", $langs->transnoentitiesnoconv("Partnership")), $morehtmlright, ''); + + $socid = $object->id; + + + // TODO Replace this card with the list of all partnerships. + + $object = new Partnership($db); + $partnershipid = $object->fetch(0, '', 0, $socid); + + if ($partnershipid > 0) { + print '
    '; + print '
    '; + print '
    '; + print ''."\n"; + + // Common attributes + //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field + //unset($object->fields['fk_project']); // Hide field already shown in banner + //unset($object->fields['fk_member']); // Hide field already shown in banner + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; + + print '
    '; + print '
    '; + } } // End of page From 46a06f8e9512bbff7c48e51ceee11af025a58082 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 6 Jun 2021 16:37:45 +0200 Subject: [PATCH 0435/1497] Fix phpcs --- htdocs/admin/dict.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 650c0016f9a..b8bf1a5998a 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -100,7 +100,7 @@ $hookmanager->initHooks(array('admin')); // Put here declaration of dictionaries properties // Sort order to show dictionary (0 is space). All other dictionaries (added by modules) will be at end of this. -$taborder = array(9, 0, 4, 3, 2, 0, 1, 8, 19, 16, 39, 27, 40, 38, 0, 5, 11, 0, 6, 0, 29, 0, 33, 34, 32, 24, 28, 17, 35, 36, 0, 10, 23, 12, 13, 7, 0, 14, 0, 22, 20, 18, 21, 41, 0, 15, 30, 0, 37, 42, 0,43, 0, 25, 0); +$taborder = array(9, 0, 4, 3, 2, 0, 1, 8, 19, 16, 39, 27, 40, 38, 0, 5, 11, 0, 6, 0, 29, 0, 33, 34, 32, 24, 28, 17, 35, 36, 0, 10, 23, 12, 13, 7, 0, 14, 0, 22, 20, 18, 21, 41, 0, 15, 30, 0, 37, 42, 0, 43, 0, 25, 0); // Name of SQL tables of dictionaries $tabname = array(); From cc24013d42b5b515c3087713f0bcfa54a381804d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 6 Jun 2021 17:13:18 +0200 Subject: [PATCH 0436/1497] Update partnership_agenda.php --- htdocs/partnership/partnership_agenda.php | 55 ++--------------------- 1 file changed, 3 insertions(+), 52 deletions(-) diff --git a/htdocs/partnership/partnership_agenda.php b/htdocs/partnership/partnership_agenda.php index 51f417399df..799aadd24cd 100644 --- a/htdocs/partnership/partnership_agenda.php +++ b/htdocs/partnership/partnership_agenda.php @@ -22,63 +22,14 @@ * \brief Tab of events on Partnership */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification - // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -dol_include_once('/partnership/class/partnership.class.php'); -dol_include_once('/partnership/lib/partnership.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership.class.php'; +require_once DOL_DOCUMENT_ROOT.'/partnership/lib/partnership.lib.php'; // Load translation files required by the page From 83cd127f0b28b6aa154bfb1b400a0a5377e060d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 6 Jun 2021 17:14:02 +0200 Subject: [PATCH 0437/1497] Update partnership_card.php --- htdocs/partnership/partnership_card.php | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/htdocs/partnership/partnership_card.php b/htdocs/partnership/partnership_card.php index 21c5cbdf68b..4fc4b08adb1 100644 --- a/htdocs/partnership/partnership_card.php +++ b/htdocs/partnership/partnership_card.php @@ -22,27 +22,6 @@ * \brief Page to create/edit/view partnership */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification - // Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; From 5fecaa2a5bde91cc98f164609ff79c42c4f8d082 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 6 Jun 2021 17:15:36 +0200 Subject: [PATCH 0438/1497] Update partnership_contact.php --- htdocs/partnership/partnership_contact.php | 35 +++------------------- 1 file changed, 4 insertions(+), 31 deletions(-) diff --git a/htdocs/partnership/partnership_contact.php b/htdocs/partnership/partnership_contact.php index 632047acf25..1c416cf690c 100644 --- a/htdocs/partnership/partnership_contact.php +++ b/htdocs/partnership/partnership_contact.php @@ -22,41 +22,14 @@ * \brief Tab for contacts linked to Partnership */ + // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -dol_include_once('/partnership/class/partnership.class.php'); -dol_include_once('/partnership/lib/partnership.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership.class.php'; +require_once DOL_DOCUMENT_ROOT.'/partnership/lib/partnership.lib.php'; // Load translation files required by the page $langs->loadLangs(array("partnership", "companies", "other", "mails")); From 4ac3576a7493936d759352a2f38da568e1a7c3f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 6 Jun 2021 17:16:27 +0200 Subject: [PATCH 0439/1497] Update partnership_document.php --- htdocs/partnership/partnership_document.php | 55 ++------------------- 1 file changed, 3 insertions(+), 52 deletions(-) diff --git a/htdocs/partnership/partnership_document.php b/htdocs/partnership/partnership_document.php index d6f89c07d00..e7fae7ee7ff 100644 --- a/htdocs/partnership/partnership_document.php +++ b/htdocs/partnership/partnership_document.php @@ -22,64 +22,15 @@ * \brief Tab for documents linked to Partnership */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification - // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -dol_include_once('/partnership/class/partnership.class.php'); -dol_include_once('/partnership/lib/partnership.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership.class.php'; +require_once DOL_DOCUMENT_ROOT.'/partnership/lib/partnership.lib.php'; // Load translation files required by the page $langs->loadLangs(array("partnership", "companies", "other", "mails")); From 0eb61a6063472efcf244d2541bd8756d6929c1b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 6 Jun 2021 17:17:50 +0200 Subject: [PATCH 0440/1497] Update partnership_list.php --- htdocs/partnership/partnership_list.php | 67 ++++--------------------- 1 file changed, 9 insertions(+), 58 deletions(-) diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index 1ae90d0d4cf..457d0345c31 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -22,57 +22,8 @@ * \brief List page for partnership */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification - // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; @@ -80,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; // load partnership libraries -require_once __DIR__.'/class/partnership.class.php'; +require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership.class.php'; // for other modules //dol_include_once('/othermodule/class/otherobject.class.php'); @@ -88,12 +39,12 @@ require_once __DIR__.'/class/partnership.class.php'; // Load translation files required by the page $langs->loadLangs(array("partnership", "members", "other")); -$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... +$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? -$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation -$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button -$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list +$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation +$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button +$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'partnershiplist'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') @@ -113,9 +64,9 @@ $pageprev = $page - 1; $pagenext = $page + 1; // Initialize technical objects -$object = new Partnership($db); -$extrafields = new ExtraFields($db); -$adherent = new Adherent($db); +$object = new Partnership($db); +$extrafields = new ExtraFields($db); +$adherent = new Adherent($db); $diroutputmassaction = $conf->partnership->dir_output.'/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('partnershiplist')); // Note that conf->hooks_modules contains array From b1ff123155e9672c377adf18bde07be089667365 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 6 Jun 2021 17:19:20 +0200 Subject: [PATCH 0441/1497] Update partnership_note.php --- htdocs/partnership/partnership_note.php | 59 +++---------------------- 1 file changed, 5 insertions(+), 54 deletions(-) diff --git a/htdocs/partnership/partnership_note.php b/htdocs/partnership/partnership_note.php index 29a59f67ef4..b9607e5aeb6 100644 --- a/htdocs/partnership/partnership_note.php +++ b/htdocs/partnership/partnership_note.php @@ -22,69 +22,20 @@ * \brief Tab for notes on Partnership */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification - // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; -dol_include_once('/partnership/class/partnership.class.php'); -dol_include_once('/partnership/lib/partnership.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership.class.php'; +require_once DOL_DOCUMENT_ROOT.'/partnership/lib/partnership.lib.php'; // Load translation files required by the page $langs->loadLangs(array("partnership", "companies")); // Get parameters $id = GETPOST('id', 'int'); -$ref = GETPOST('ref', 'alpha'); +$ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); -$cancel = GETPOST('cancel', 'aZ09'); +$cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); // Initialize technical objects From 594cd90c4b1dd97d419a272b14eb0fb03d2fa411 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 6 Jun 2021 17:22:20 +0200 Subject: [PATCH 0442/1497] Update partnershipindex.php --- htdocs/partnership/partnershipindex.php | 68 +++++-------------------- 1 file changed, 12 insertions(+), 56 deletions(-) diff --git a/htdocs/partnership/partnershipindex.php b/htdocs/partnership/partnershipindex.php index 8076f105dbb..536729a473d 100644 --- a/htdocs/partnership/partnershipindex.php +++ b/htdocs/partnership/partnershipindex.php @@ -25,35 +25,7 @@ */ // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; @@ -100,8 +72,7 @@ print '
    '; /* BEGIN MODULEBUILDER DRAFT MYOBJECT // Draft MyObject -if (! empty($conf->partnership->enabled) && $user->rights->partnership->read) -{ +if (! empty($conf->partnership->enabled) && $user->rights->partnership->read) { $langs->load("orders"); $sql = "SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.tva as total_tva, c.total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas"; @@ -116,8 +87,7 @@ if (! empty($conf->partnership->enabled) && $user->rights->partnership->read) if ($socid) $sql.= " AND c.fk_soc = ".$socid; $resql = $db->query($sql); - if ($resql) - { + if ($resql) { $total = 0; $num = $db->num_rows($resql); @@ -126,12 +96,9 @@ if (! empty($conf->partnership->enabled) && $user->rights->partnership->read) print ''.$langs->trans("DraftMyObjects").($num?''.$num.'':'').''; $var = true; - if ($num > 0) - { + if ($num > 0) { $i = 0; - while ($i < $num) - { - + while ($i < $num) { $obj = $db->fetch_object($resql); print ''; @@ -150,23 +117,16 @@ if (! empty($conf->partnership->enabled) && $user->rights->partnership->read) $i++; $total += $obj->total_ttc; } - if ($total>0) - { - + if ($total>0) { print ''.$langs->trans("Total").''.price($total).""; } - } - else - { - + } else { print ''.$langs->trans("NoOrder").''; } print "
    "; $db->free($resql); - } - else - { + } else { dol_print_error($db); } } @@ -181,8 +141,7 @@ $max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT; /* BEGIN MODULEBUILDER LASTMODIFIED MYOBJECT // Last modified myobject -if (! empty($conf->partnership->enabled) && $user->rights->partnership->read) -{ +if (! empty($conf->partnership->enabled) && $user->rights->partnership->read) { $sql = "SELECT s.rowid, s.ref, s.label, s.date_creation, s.tms"; $sql.= " FROM ".MAIN_DB_PREFIX."partnership_myobject as s"; //if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -193,8 +152,7 @@ if (! empty($conf->partnership->enabled) && $user->rights->partnership->read) $sql .= $db->plimit($max, 0); $resql = $db->query($sql); - if ($resql) - { + if ($resql) { $num = $db->num_rows($resql); $i = 0; @@ -205,10 +163,8 @@ if (! empty($conf->partnership->enabled) && $user->rights->partnership->read) print ''; print ''.$langs->trans("DateModificationShort").''; print ''; - if ($num) - { - while ($i < $num) - { + if ($num) { + while ($i < $num) { $objp = $db->fetch_object($resql); $myobjectstatic->id=$objp->rowid; From ccc35326a52f85b7a0710345cc1593b588b667a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 6 Jun 2021 17:25:44 +0200 Subject: [PATCH 0443/1497] Update partnershiputils.class.php --- htdocs/partnership/class/partnershiputils.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/partnership/class/partnershiputils.class.php b/htdocs/partnership/class/partnershiputils.class.php index 992fca2703e..aef1bf18e49 100644 --- a/htdocs/partnership/class/partnershiputils.class.php +++ b/htdocs/partnership/class/partnershiputils.class.php @@ -28,10 +28,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; -dol_include_once('partnership/lib/partnership.lib.php'); -dol_include_once('/partnership/class/partnership.class.php'); +require_once DOL_DOCUMENT_ROOT.'/partnership/lib/partnership.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership.class.php'; -require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"; +require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; /** * Class with cron tasks of Partnership module From 8a359c9009edc7c0e2363253d8474244b4788560 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 6 Jun 2021 17:34:03 +0200 Subject: [PATCH 0444/1497] Update partnership.class.php --- htdocs/partnership/class/partnership.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index d04d0c335eb..125dacb1e53 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -354,8 +354,8 @@ class Partnership extends CommonObject * * @param int $id Id of object to load * @param string $ref Ref of object - * @param int $fk_soc fk_soc * @param int $fk_member fk_member + * @param int $fk_soc fk_soc * @return int >0 if OK, <0 if KO, 0 if not found */ public function fetch($id, $ref = null, $fk_member = null, $fk_soc = null) From e11656a3e3daa847875f2c99fca54fe1906e1adb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 6 Jun 2021 17:44:06 +0200 Subject: [PATCH 0445/1497] add member search --- dev/examples/zapier/index.js | 2 + dev/examples/zapier/searches/member.js | 88 ++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 dev/examples/zapier/searches/member.js diff --git a/dev/examples/zapier/index.js b/dev/examples/zapier/index.js index 044415a7ddd..9567c120bb0 100644 --- a/dev/examples/zapier/index.js +++ b/dev/examples/zapier/index.js @@ -8,6 +8,7 @@ const triggerUser = require('./triggers/user'); const searchThirdparty = require('./searches/thirdparty'); const searchContact = require('./searches/contact'); +const searchMember = require('./searches/member'); const createThirdparty = require('./creates/thirdparty'); const createContact = require('./creates/contact'); @@ -75,6 +76,7 @@ const App = { searches: { [searchThirdparty.key]: searchThirdparty, [searchContact.key]: searchContact, + [searchMember.key]: searchMember, }, // If you want your creates to show up, you better include it here! diff --git a/dev/examples/zapier/searches/member.js b/dev/examples/zapier/searches/member.js new file mode 100644 index 00000000000..f1a84061146 --- /dev/null +++ b/dev/examples/zapier/searches/member.js @@ -0,0 +1,88 @@ +module.exports = { + key: 'member', + + // You'll want to provide some helpful display labels and descriptions + // for users. Zapier will put them into the UX. + noun: 'Member', + display: { + label: 'Find a Member', + description: 'Search for member.' + }, + + // `operation` is where we make the call to your API to do the search + operation: { + // This search only has one search field. Your searches might have just one, or many + // search fields. + inputFields: [ + { + key: 'lastname', + type: 'string', + label: 'Lastname', + helpText: 'Lastname to limit to the search to (i.e. The company or %company%).' + }, + { + key: 'email', + type: 'string', + label: 'Email', + helpText: 'Email to limit to the search to.' + } + ], + + perform: async (z, bundle) => { + const url = bundle.authData.url + '/api/index.php/members/'; + + // Put the search value in a query param. The details of how to build + // a search URL will depend on how your API works. + let filter = ''; + if (bundle.inputData.lastname) { + filter = "t.lastname like \'%" + bundle.inputData.name + "%\'"; + } + if (bundle.inputData.email) { + if (bundle.inputData.lastname) { + filter += " and "; + } + filter += "t.email like \'" + bundle.inputData.email + "\'"; + } + const response = await z.request({ + url: url, + // this parameter avoid throwing errors and let us manage them + skipThrowForStatus: true, + params: { + sqlfilters: filter + } + }); + //z.console.log(response); + if (response.status != 200) { + return []; + } + return response.json; + }, + + // In cases where Zapier needs to show an example record to the user, but we are unable to get a live example + // from the API, Zapier will fallback to this hard-coded sample. It should reflect the data structure of + // returned records, and have obviously dummy values that we can show to any user. + sample: { + id: 1, + createdAt: 1472069465, + name: 'DOE', + firstname: 'John', + authorId: 1, + }, + + // If the resource can have fields that are custom on a per-user basis, define a function to fetch the custom + // field definitions. The result will be used to augment the sample. + // outputFields: () => { return []; } + // Alternatively, a static field definition should be provided, to specify labels for the fields + outputFields: [ + { + key: 'id', + type: "integer", + label: 'ID' + }, + { key: 'createdAt', type: "integer", label: 'Created At' }, + { key: 'name', label: 'Name' }, + { key: 'firstname', label: 'Firstname' }, + { key: 'authorId', type: "integer", label: 'Author ID' }, + ] + } +}; From 8401fa3ce778bf31fbecf5ceff48b2a0b8f03333 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 6 Jun 2021 17:57:48 +0200 Subject: [PATCH 0446/1497] add trigger member --- dev/examples/zapier/index.js | 2 + dev/examples/zapier/triggers/member.js | 171 ++++++++++++++++++ ...face_99_modZapier_ZapierTriggers.class.php | 22 ++- 3 files changed, 193 insertions(+), 2 deletions(-) create mode 100644 dev/examples/zapier/triggers/member.js diff --git a/dev/examples/zapier/index.js b/dev/examples/zapier/index.js index 9567c120bb0..fdd1ed29a53 100644 --- a/dev/examples/zapier/index.js +++ b/dev/examples/zapier/index.js @@ -5,6 +5,7 @@ const triggerThirdparty = require('./triggers/thirdparty'); const triggerContact = require('./triggers/contact'); const triggerTicket = require('./triggers/ticket'); const triggerUser = require('./triggers/user'); +const triggerMember = require('./triggers/member'); const searchThirdparty = require('./searches/thirdparty'); const searchContact = require('./searches/contact'); @@ -70,6 +71,7 @@ const App = { [triggerContact.key]: triggerContact, [triggerTicket.key]: triggerTicket, [triggerUser.key]: triggerUser, + [triggerMember.key]: triggerMember, }, // If you want your searches to show up, you better include it here! diff --git a/dev/examples/zapier/triggers/member.js b/dev/examples/zapier/triggers/member.js new file mode 100644 index 00000000000..3385cdca625 --- /dev/null +++ b/dev/examples/zapier/triggers/member.js @@ -0,0 +1,171 @@ +const subscribeHook = (z, bundle) => { + // `z.console.log()` is similar to `console.log()`. + z.console.log('suscribing hook!'); + + // bundle.targetUrl has the Hook URL this app should call when an action is created. + const data = { + url: bundle.targetUrl, + event: bundle.event, + module: 'member', + action: bundle.inputData.action + }; + + const url = bundle.authData.url + '/api/index.php/zapierapi/hook'; + + // You can build requests and our client will helpfully inject all the variables + // you need to complete. You can also register middleware to control this. + const options = { + url: url, + method: 'POST', + body: data, + }; + + // You may return a promise or a normal data structure from any perform method. + return z.request(options).then((response) => JSON.parse(response.content)); +}; + +const unsubscribeHook = (z, bundle) => { + // bundle.subscribeData contains the parsed response JSON from the subscribe + // request made initially. + z.console.log('unsuscribing hook!'); + + // You can build requests and our client will helpfully inject all the variables + // you need to complete. You can also register middleware to control this. + const options = { + url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id, + method: 'DELETE', + }; + + // You may return a promise or a normal data structure from any perform method. + return z.request(options).then((response) => JSON.parse(response.content)); +}; + +const getMember = (z, bundle) => { + // bundle.cleanedRequest will include the parsed JSON object (if it's not a + // test poll) and also a .querystring property with the URL's query string. + const member = { + id: bundle.cleanedRequest.id, + name: bundle.cleanedRequest.name, + name_alias: bundle.cleanedRequest.name_alias, + firstname: bundle.cleanedRequest.firstname, + address: bundle.cleanedRequest.address, + zip: bundle.cleanedRequest.zip, + town: bundle.cleanedRequest.town, + email: bundle.cleanedRequest.email, + phone_pro: bundle.cleanedRequest.phone_pro, + phone_perso: bundle.cleanedRequest.phone_perso, + phone_mobile: bundle.cleanedRequest.phone_mobile, + authorId: bundle.cleanedRequest.authorId, + createdAt: bundle.cleanedRequest.createdAt, + action: bundle.cleanedRequest.action + }; + + return [member]; +}; + +const getFallbackRealMember = (z, bundle) => { + // For the test poll, you should get some real data, to aid the setup process. + const module = bundle.inputData.module; + const options = { + url: bundle.authData.url + '/api/index.php/members/0', + }; + + return z.request(options).then((response) => [JSON.parse(response.content)]); +}; + +// const getModulesChoices = (z/*, bundle*/) => { +// // For the test poll, you should get some real data, to aid the setup process. +// const options = { +// url: bundle.authData.url + '/api/index.php/zapierapi/getmoduleschoices', +// }; + +// return z.request(options).then((response) => JSON.parse(response.content)); +// }; +// const getModulesChoices = () => { +// return { +// orders: "Order", +// invoices: "Invoice", +// members: "Member", +// members: "Members" +// }; +// }; + +// const getActionsChoices = (z, bundle) => { +// // For the test poll, you should get some real data, to aid the setup process. +// const module = bundle.inputData.module; +// const options = { +// url: url: bundle.authData.url + '/api/index.php/zapierapi/getactionschoices/thirparty`, +// }; + +// return z.request(options).then((response) => JSON.parse(response.content)); +// }; + +// We recommend writing your triggers separate like this and rolling them +// into the App definition at the end. +module.exports = { + key: 'member', + + // You'll want to provide some helpful display labels and descriptions + // for users. Zapier will put them into the UX. + noun: 'Member', + display: { + label: 'New Member', + description: 'Triggers when a new member action is done in Dolibarr.' + }, + + // `operation` is where the business logic goes. + operation: { + + // `inputFields` can define the fields a user could provide, + // we'll pass them in as `bundle.inputData` later. + inputFields: [ + { + key: 'action', + required: true, + type: 'string', + helpText: 'Which action of member this should trigger on.', + choices: { + create: "Create", + modify: "Modify", + validate: "Validate", + } + } + ], + + type: 'hook', + + performSubscribe: subscribeHook, + performUnsubscribe: unsubscribeHook, + + perform: getMember, + performList: getFallbackRealMember, + + // In cases where Zapier needs to show an example record to the user, but we are unable to get a live example + // from the API, Zapier will fallback to this hard-coded sample. It should reflect the data structure of + // returned records, and have obviously dummy values that we can show to any user. + sample: { + id: 1, + createdAt: 1472069465, + lastname: 'DOE', + firstname: 'John', + authorId: 1, + action: 'create' + }, + + // If the resource can have fields that are custom on a per-user basis, define a function to fetch the custom + // field definitions. The result will be used to augment the sample. + // outputFields: () => { return []; } + // Alternatively, a static field definition should be provided, to specify labels for the fields + outputFields: [ + {key: 'id', type: "integer", label: 'ID'}, + {key: 'createdAt', label: 'Created At'}, + {key: 'lastname', label: 'Lastname'}, + {key: 'firstname', label: 'Firstname'}, + {key: 'phone', label: 'Phone pro'}, + {key: 'phone_perso', label: 'Phone perso'}, + {key: 'phone_mobile', label: 'Phone mobile'}, + {key: 'authorId', type: "integer", label: 'Author ID'}, + {key: 'action', label: 'Action'} + ] + } +}; diff --git a/htdocs/core/triggers/interface_99_modZapier_ZapierTriggers.class.php b/htdocs/core/triggers/interface_99_modZapier_ZapierTriggers.class.php index 7d6f346449d..8025f0c0293 100644 --- a/htdocs/core/triggers/interface_99_modZapier_ZapierTriggers.class.php +++ b/htdocs/core/triggers/interface_99_modZapier_ZapierTriggers.class.php @@ -339,10 +339,28 @@ class InterfaceZapierTriggers extends DolibarrTriggers // case 'LINEFICHINTER_DELETE': // Members - // case 'MEMBER_CREATE': + case 'MEMBER_CREATE': + $resql = $this->db->query($sql); + while ($resql && $obj = $this->db->fetch_array($resql)) { + $cleaned = cleanObjectDatas(dol_clone($object)); + $json = json_encode($cleaned); + // call the zapierPostWebhook() function + zapierPostWebhook($obj['url'], $json); + } + $logtriggeraction = true; + break; + case 'MEMBER_MODIFY': + $resql = $this->db->query($sql); + while ($resql && $obj = $this->db->fetch_array($resql)) { + $cleaned = cleanObjectDatas(dol_clone($object)); + $json = json_encode($cleaned); + // call the zapierPostWebhook() function + zapierPostWebhook($obj['url'], $json); + } + $logtriggeraction = true; + break; // case 'MEMBER_VALIDATE': // case 'MEMBER_SUBSCRIPTION': - // case 'MEMBER_MODIFY': // case 'MEMBER_NEW_PASSWORD': // case 'MEMBER_RESILIATE': // case 'MEMBER_DELETE': From a47df8246899ee2500b44373c94db12eef46ba27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 6 Jun 2021 19:14:42 +0200 Subject: [PATCH 0447/1497] fix warning --- htdocs/societe/partnership.php | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/htdocs/societe/partnership.php b/htdocs/societe/partnership.php index d109421fe8d..912307a5675 100644 --- a/htdocs/societe/partnership.php +++ b/htdocs/societe/partnership.php @@ -22,27 +22,6 @@ * \brief Page to create/edit/view partnership */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification - // Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; @@ -80,8 +59,8 @@ if ($id > 0) { } // Initialize technical objects -$object = new Partnership($db); -$extrafields = new ExtraFields($db); +$object = new Partnership($db); +$extrafields = new ExtraFields($db); $diroutputmassaction = $conf->partnership->dir_output.'/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('partnershipthirdparty', 'globalcard')); // Note that conf->hooks_modules contains array @@ -112,7 +91,7 @@ $usercanclose = $user->rights->partnership->write; // Used by the include of $upload_dir = $conf->partnership->multidir_output[isset($object->entity) ? $object->entity : 1]; -if ($conf->global->PARTNERSHIP_IS_MANAGED_FOR != 'thirdparty') accessforbidden(); +if (!empty($conf->global->PARTNERSHIP_IS_MANAGED_FOR) && $conf->global->PARTNERSHIP_IS_MANAGED_FOR != 'thirdparty') accessforbidden(); if (empty($conf->partnership->enabled)) accessforbidden(); if (empty($permissiontoread)) accessforbidden(); if ($action == 'edit' && empty($permissiontoadd)) accessforbidden(); From d54d4da8cd6ee03b0d4948d4ed095df13f3922fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 6 Jun 2021 19:18:02 +0200 Subject: [PATCH 0448/1497] Update setup.php --- htdocs/partnership/admin/setup.php | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/htdocs/partnership/admin/setup.php b/htdocs/partnership/admin/setup.php index 7fa0ef62b5e..3f933c2bc94 100644 --- a/htdocs/partnership/admin/setup.php +++ b/htdocs/partnership/admin/setup.php @@ -23,32 +23,7 @@ */ // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; global $langs, $user; @@ -160,7 +135,7 @@ print ''.$langs->trans("partnershipforthirdparty print ''; -if ($conf->global->PARTNERSHIP_IS_MANAGED_FOR == 'member') { +if (!empty($conf->global->PARTNERSHIP_IS_MANAGED_FOR) && $conf->global->PARTNERSHIP_IS_MANAGED_FOR == 'member') { print ''.$langs->trans("PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL").''; print ''; $dnbdays = '15'; From f3a3ce90e12a017aa245eb0bcb7a7d30f815353c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 6 Jun 2021 21:18:23 +0200 Subject: [PATCH 0449/1497] Update partnership_card.php --- htdocs/partnership/partnership_card.php | 32 ------------------------- 1 file changed, 32 deletions(-) diff --git a/htdocs/partnership/partnership_card.php b/htdocs/partnership/partnership_card.php index 4fc4b08adb1..29789072773 100644 --- a/htdocs/partnership/partnership_card.php +++ b/htdocs/partnership/partnership_card.php @@ -225,22 +225,6 @@ $title = $langs->trans("Partnership"); $help_url = ''; llxHeader('', $title, $help_url); -// Example : Adding jquery code -print ''; - - // Part to create if ($action == 'create') { print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("Partnership")), '', 'object_'.$object->picto); @@ -373,22 +357,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToRefuse'), $text, 'confirm_refuse', $formquestion, '', 1, 250); } - // Confirmation of action xxxx - if ($action == 'xxx') { - $formquestion = array(); - /* - $forcecombo=0; - if ($conf->browser->name == 'ie') $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy - $formquestion = array( - // 'text' => $langs->trans("ConfirmClone"), - // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), - // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), - // array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo)) - ); - */ - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220); - } - // Call Hook formConfirm $parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid); $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook From ffb1b232d4540d6bc34b9d6787495c9729461583 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 6 Jun 2021 21:27:48 +0200 Subject: [PATCH 0450/1497] Fix Withdraw - link is missing in llx_bank_url when the debit is rejected --- .../compta/paiement/class/paiement.class.php | 26 ++++++++++++++----- .../class/rejetprelevement.class.php | 14 +++++++--- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 221ff3de042..76709332f06 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -2,13 +2,14 @@ /* Copyright (C) 2002-2004 Rodolphe Quiedeville * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005 Marc Barilley / Ocebo - * Copyright (C) 2012 Cédric Salvador - * Copyright (C) 2014 Raphaël Doursenaud - * Copyright (C) 2014 Marcos García - * Copyright (C) 2015 Juanjo Menent - * Copyright (C) 2018 Ferran Marcet - * Copyright (C) 2018 Thibault FOUCART - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2012 Cédric Salvador + * Copyright (C) 2014 Raphaël Doursenaud + * Copyright (C) 2014 Marcos García + * Copyright (C) 2015 Juanjo Menent + * Copyright (C) 2018 Ferran Marcet + * Copyright (C) 2018 Thibault FOUCART + * Copyright (C) 2018 Frédéric France + * Copyright (C) 2021 OpenDsi * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -748,6 +749,17 @@ class Paiement extends CommonObject ); } + // Add link 'InvoiceRefused' in bank_url + if (! $error && $label == '(InvoiceRefused)') { + $result=$acc->add_url_line( + $bank_line_id, + $this->id_prelevement, + DOL_URL_ROOT.'/compta/prelevement/card.php?id=', + $this->num_prelevement, + 'withdraw' + ); + } + if (! $error && ! $notrigger) { // Appel des triggers diff --git a/htdocs/compta/prelevement/class/rejetprelevement.class.php b/htdocs/compta/prelevement/class/rejetprelevement.class.php index 740a1e47784..f1e6eab552a 100644 --- a/htdocs/compta/prelevement/class/rejetprelevement.class.php +++ b/htdocs/compta/prelevement/class/rejetprelevement.class.php @@ -1,7 +1,8 @@ - * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2010-2013 Juanjo Menent +/* Copyright (C) 2005 Rodolphe Quiedeville + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2010-2013 Juanjo Menent + * Copyright (C) 2021 OpenDsi * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -95,6 +96,10 @@ class RejetPrelevement $bankaccount = $conf->global->PRELEVEMENT_ID_BANKACCOUNT; $facs = $this->getListInvoices(1); + require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php'; + $lipre = new LignePrelevement($this->db, $user); + $lipre->fetch($id); + $this->db->begin(); // Insert refused line into database @@ -154,6 +159,9 @@ class RejetPrelevement $pai->datepaye = $date_rejet; $pai->paiementid = 3; // type of payment: withdrawal $pai->num_paiement = $fac->ref; + $pai->num_payment = $fac->ref; + $pai->id_prelevement = $this->bon_id; + $pai->num_prelevement = $lipre->bon_ref; if ($pai->create($this->user) < 0) // we call with no_commit { From a586afd8b33d2cd8fd1cfdfe8a9df7c099ad0904 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 6 Jun 2021 21:35:39 +0200 Subject: [PATCH 0451/1497] clean code --- htdocs/admin/knowledgemanagement.php | 28 +--------- htdocs/admin/knowledgerecord_extrafields.php | 27 +-------- .../class/knowledgerecord.class.php | 2 +- .../knowledgemanagementindex.php | 30 +--------- .../knowledgerecord_agenda.php | 55 +------------------ .../knowledgerecord_card.php | 55 +------------------ .../knowledgerecord_contact.php | 34 +----------- .../knowledgerecord_document.php | 55 +------------------ .../knowledgerecord_list.php | 53 +----------------- .../knowledgerecord_note.php | 55 +------------------ .../lib/knowledgemanagement.lib.php | 6 +- ...nowledgemanagement_knowledgerecord.lib.php | 10 ++-- .../partnership/class/partnership.class.php | 2 +- 13 files changed, 31 insertions(+), 381 deletions(-) diff --git a/htdocs/admin/knowledgemanagement.php b/htdocs/admin/knowledgemanagement.php index 5bc994bb086..b8434773f67 100644 --- a/htdocs/admin/knowledgemanagement.php +++ b/htdocs/admin/knowledgemanagement.php @@ -23,32 +23,8 @@ */ // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; + global $langs, $user; // Libraries diff --git a/htdocs/admin/knowledgerecord_extrafields.php b/htdocs/admin/knowledgerecord_extrafields.php index 823366e1fbe..d6c94e4ceeb 100644 --- a/htdocs/admin/knowledgerecord_extrafields.php +++ b/htdocs/admin/knowledgerecord_extrafields.php @@ -27,32 +27,7 @@ */ // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/knowledgemanagement/lib/knowledgemanagement.lib.php'; diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php index 4d46794aaf8..85d8a1bcb9e 100644 --- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php +++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php @@ -17,7 +17,7 @@ */ /** - * \file class/knowledgerecord.class.php + * \file htdocs/knowledgemanagement/class/knowledgerecord.class.php * \ingroup knowledgemanagement * \brief This file is a CRUD class file for KnowledgeRecord (Create/Read/Update/Delete) */ diff --git a/htdocs/knowledgemanagement/knowledgemanagementindex.php b/htdocs/knowledgemanagement/knowledgemanagementindex.php index 86ea3f10e08..f4fc767e9d5 100644 --- a/htdocs/knowledgemanagement/knowledgemanagementindex.php +++ b/htdocs/knowledgemanagement/knowledgemanagementindex.php @@ -25,35 +25,7 @@ */ // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; diff --git a/htdocs/knowledgemanagement/knowledgerecord_agenda.php b/htdocs/knowledgemanagement/knowledgerecord_agenda.php index 5144b736b98..7853aa7e2ff 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_agenda.php +++ b/htdocs/knowledgemanagement/knowledgerecord_agenda.php @@ -22,63 +22,14 @@ * \brief Tab of events on KnowledgeRecord */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification - // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -dol_include_once('/knowledgemanagement/class/knowledgerecord.class.php'); -dol_include_once('/knowledgemanagement/lib/knowledgemanagement_knowledgerecord.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/knowledgemanagement/class/knowledgerecord.class.php'; +require_once DOL_DOCUMENT_ROOT.'/knowledgemanagement/lib/knowledgemanagement_knowledgerecord.lib.php'; // Load translation files required by the page diff --git a/htdocs/knowledgemanagement/knowledgerecord_card.php b/htdocs/knowledgemanagement/knowledgerecord_card.php index f4e949a8603..b33ecb652f7 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_card.php +++ b/htdocs/knowledgemanagement/knowledgerecord_card.php @@ -22,63 +22,14 @@ * \brief Page to create/edit/view knowledgerecord */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification - // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; -dol_include_once('/knowledgemanagement/class/knowledgerecord.class.php'); -dol_include_once('/knowledgemanagement/lib/knowledgemanagement_knowledgerecord.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/knowledgemanagement/class/knowledgerecord.class.php'; +require_once DOL_DOCUMENT_ROOT.'/knowledgemanagement/lib/knowledgemanagement_knowledgerecord.lib.php'; // Load translation files required by the page $langs->loadLangs(array("knowledgemanagement", "other")); diff --git a/htdocs/knowledgemanagement/knowledgerecord_contact.php b/htdocs/knowledgemanagement/knowledgerecord_contact.php index e5af4a54611..1eb80efafa1 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_contact.php +++ b/htdocs/knowledgemanagement/knowledgerecord_contact.php @@ -23,40 +23,12 @@ */ // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -dol_include_once('/knowledgemanagement/class/knowledgerecord.class.php'); -dol_include_once('/knowledgemanagement/lib/knowledgemanagement_knowledgerecord.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/knowledgemanagement/class/knowledgerecord.class.php'; +require_once DOL_DOCUMENT_ROOT.'/knowledgemanagement/lib/knowledgemanagement_knowledgerecord.lib.php'; // Load translation files required by the page $langs->loadLangs(array("knowledgemanagement", "companies", "other", "mails")); diff --git a/htdocs/knowledgemanagement/knowledgerecord_document.php b/htdocs/knowledgemanagement/knowledgerecord_document.php index 5261fde7118..4a572ee22bb 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_document.php +++ b/htdocs/knowledgemanagement/knowledgerecord_document.php @@ -22,64 +22,15 @@ * \brief Tab for documents linked to KnowledgeRecord */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification - // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -dol_include_once('/knowledgemanagement/class/knowledgerecord.class.php'); -dol_include_once('/knowledgemanagement/lib/knowledgemanagement_knowledgerecord.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/knowledgemanagement/class/knowledgerecord.class.php'; +require_once DOL_DOCUMENT_ROOT.'/knowledgemanagement/lib/knowledgemanagement_knowledgerecord.lib.php'; // Load translation files required by the page $langs->loadLangs(array("knowledgemanagement", "companies", "other", "mails")); diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index bd4c8829be5..c886d6931a0 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -22,64 +22,15 @@ * \brief List page for knowledgerecord */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification - // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; // load knowledgemanagement libraries -require_once __DIR__.'/class/knowledgerecord.class.php'; +require_once DOL_DOCUMENT_ROOT.'/knowledgemanagement/class/knowledgerecord.class.php'; // for other modules //dol_include_once('/othermodule/class/otherobject.class.php'); diff --git a/htdocs/knowledgemanagement/knowledgerecord_note.php b/htdocs/knowledgemanagement/knowledgerecord_note.php index 31c15ff2064..bcf9fb9b801 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_note.php +++ b/htdocs/knowledgemanagement/knowledgerecord_note.php @@ -22,60 +22,11 @@ * \brief Tab for notes on KnowledgeRecord */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification - // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; -dol_include_once('/knowledgemanagement/class/knowledgerecord.class.php'); -dol_include_once('/knowledgemanagement/lib/knowledgemanagement_knowledgerecord.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/knowledgemanagement/class/knowledgerecord.class.php'; +require_once DOL_DOCUMENT_ROOT.'/knowledgemanagement/lib/knowledgemanagement_knowledgerecord.lib.php'; // Load translation files required by the page $langs->loadLangs(array("knowledgemanagement", "companies")); diff --git a/htdocs/knowledgemanagement/lib/knowledgemanagement.lib.php b/htdocs/knowledgemanagement/lib/knowledgemanagement.lib.php index ba81dd49057..0b07e7b46e8 100644 --- a/htdocs/knowledgemanagement/lib/knowledgemanagement.lib.php +++ b/htdocs/knowledgemanagement/lib/knowledgemanagement.lib.php @@ -35,18 +35,18 @@ function knowledgemanagementAdminPrepareHead() $h = 0; $head = array(); - $head[$h][0] = dol_buildpath("/admin/knowledgemanagement.php", 1); + $head[$h][0] = DOL_URL_ROOT.'/admin/knowledgemanagement.php'; $head[$h][1] = $langs->trans("Setup"); $head[$h][2] = 'setup'; $h++; - $head[$h][0] = dol_buildpath("admin/knowledgerecord_extrafields.php", 1); + $head[$h][0] = DOL_URL_ROOT.'/admin/knowledgerecord_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields"); $head[$h][2] = 'extra'; $h++; - /*$head[$h][0] = dol_buildpath("/knowledgemanagement/admin/about.php", 1); + /*$head[$h][0] = DOL_URL_ROOT.'/knowledgemanagement/admin/about.php'; $head[$h][1] = $langs->trans("About"); $head[$h][2] = 'about'; $h++;*/ diff --git a/htdocs/knowledgemanagement/lib/knowledgemanagement_knowledgerecord.lib.php b/htdocs/knowledgemanagement/lib/knowledgemanagement_knowledgerecord.lib.php index 1da21a3e413..e70b4654d19 100644 --- a/htdocs/knowledgemanagement/lib/knowledgemanagement_knowledgerecord.lib.php +++ b/htdocs/knowledgemanagement/lib/knowledgemanagement_knowledgerecord.lib.php @@ -16,7 +16,7 @@ */ /** - * \file lib/knowledgemanagement_knowledgerecord.lib.php + * \file htdocs/knowledgemanagementlib/knowledgemanagement_knowledgerecord.lib.php * \ingroup knowledgemanagement * \brief Library files with common functions for KnowledgeRecord */ @@ -36,7 +36,7 @@ function knowledgerecordPrepareHead($object) $h = 0; $head = array(); - $head[$h][0] = dol_buildpath("/knowledgemanagement/knowledgerecord_card.php", 1).'?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT.'/knowledgemanagement/knowledgerecord_card.php?id='.$object->id; $head[$h][1] = $langs->trans("KnowledgeRecord"); $head[$h][2] = 'card'; $h++; @@ -49,7 +49,7 @@ function knowledgerecordPrepareHead($object) if (!empty($object->note_public)) { $nbNote++; } - $head[$h][0] = dol_buildpath('/knowledgemanagement/knowledgerecord_note.php', 1).'?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT.'/knowledgemanagement/knowledgerecord_note.php?id='.$object->id; $head[$h][1] = $langs->trans('Notes'); if ($nbNote > 0) { $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ''.$nbNote.'' : ''); @@ -63,7 +63,7 @@ function knowledgerecordPrepareHead($object) $upload_dir = $conf->knowledgemanagement->dir_output."/knowledgerecord/".dol_sanitizeFileName($object->ref); $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); $nbLinks = Link::count($db, $object->element, $object->id); - $head[$h][0] = dol_buildpath("/knowledgemanagement/knowledgerecord_document.php", 1).'?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT.'/knowledgemanagement/knowledgerecord_document.php?id='.$object->id; $head[$h][1] = $langs->trans('Documents'); if (($nbFiles + $nbLinks) > 0) { $head[$h][1] .= ''.($nbFiles + $nbLinks).''; @@ -71,7 +71,7 @@ function knowledgerecordPrepareHead($object) $head[$h][2] = 'document'; $h++; - $head[$h][0] = dol_buildpath("/knowledgemanagement/knowledgerecord_agenda.php", 1).'?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT.'/knowledgemanagement/knowledgerecord_agenda.php?id='.$object->id; $head[$h][1] = $langs->trans("Events"); $head[$h][2] = 'agenda'; $h++; diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index f33a19f312e..78eb60a3ab3 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -197,7 +197,7 @@ class Partnership extends CommonObject 'reason_decline_or_cancel' => array('type'=>'text', 'label'=>'ReasonDeclineOrCancel', 'enabled'=>'1', 'position'=>64, 'notnull'=>0, 'visible'=>-2,), ); - if ($conf->global->PARTNERSHIP_IS_MANAGED_FOR == 'member') { + if (!empty($conf->global->PARTNERSHIP_IS_MANAGED_FOR) && $conf->global->PARTNERSHIP_IS_MANAGED_FOR == 'member') { $this->fields['fk_member'] = array('type'=>'integer:Adherent:adherents/class/adherent.class.php:1', 'label'=>'Member', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'picto'=>'member'); } else { $this->fields['fk_soc'] = array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'picto'=>'societe'); From a06fb441d300617b3f9c2a7a24c0b8bf5335f835 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 6 Jun 2021 21:40:47 +0200 Subject: [PATCH 0452/1497] clean code --- .../knowledgemanagementindex.php | 18 +++++++----------- .../knowledgerecord_note.php | 6 +++--- .../lib/knowledgemanagement.lib.php | 2 +- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/htdocs/knowledgemanagement/knowledgemanagementindex.php b/htdocs/knowledgemanagement/knowledgemanagementindex.php index f4fc767e9d5..8add69ae86d 100644 --- a/htdocs/knowledgemanagement/knowledgemanagementindex.php +++ b/htdocs/knowledgemanagement/knowledgemanagementindex.php @@ -19,7 +19,7 @@ */ /** - * \file knowledgemanagement/knowledgemanagementindex.php + * \file htdocs/knowledgemanagement/knowledgemanagementindex.php * \ingroup knowledgemanagement * \brief Home page of knowledgemanagement top menu */ @@ -148,13 +148,12 @@ END MODULEBUILDER DRAFT MYOBJECT */ print '
    '; -$NBMAX = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT; -$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT; +$NBMAX = (empty($conf->global->MAIN_SIZE_SHORTLIST_LIMIT) ? 25 : $conf->global->MAIN_SIZE_SHORTLIST_LIMIT); +$max = $NBMAX; /* BEGIN MODULEBUILDER LASTMODIFIED MYOBJECT // Last modified myobject -if (! empty($conf->knowledgemanagement->enabled) && $user->rights->knowledgemanagement->read) -{ +if (! empty($conf->knowledgemanagement->enabled) && $user->rights->knowledgemanagement->read) { $sql = "SELECT s.rowid, s.ref, s.label, s.date_creation, s.tms"; $sql.= " FROM ".MAIN_DB_PREFIX."knowledgemanagement_myobject as s"; //if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -165,8 +164,7 @@ if (! empty($conf->knowledgemanagement->enabled) && $user->rights->knowledgemana $sql .= $db->plimit($max, 0); $resql = $db->query($sql); - if ($resql) - { + if ($resql) { $num = $db->num_rows($resql); $i = 0; @@ -177,10 +175,8 @@ if (! empty($conf->knowledgemanagement->enabled) && $user->rights->knowledgemana print ''; print ''.$langs->trans("DateModificationShort").''; print ''; - if ($num) - { - while ($i < $num) - { + if ($num) { + while ($i < $num) { $objp = $db->fetch_object($resql); $myobjectstatic->id=$objp->rowid; diff --git a/htdocs/knowledgemanagement/knowledgerecord_note.php b/htdocs/knowledgemanagement/knowledgerecord_note.php index bcf9fb9b801..a6a9974a9c8 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_note.php +++ b/htdocs/knowledgemanagement/knowledgerecord_note.php @@ -17,7 +17,7 @@ */ /** - * \file knowledgerecord_note.php + * \file htdocs/knowledgemanagement/knowledgerecord_note.php * \ingroup knowledgemanagement * \brief Tab for notes on KnowledgeRecord */ @@ -33,9 +33,9 @@ $langs->loadLangs(array("knowledgemanagement", "companies")); // Get parameters $id = GETPOST('id', 'int'); -$ref = GETPOST('ref', 'alpha'); +$ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); -$cancel = GETPOST('cancel', 'aZ09'); +$cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); // Initialize technical objects diff --git a/htdocs/knowledgemanagement/lib/knowledgemanagement.lib.php b/htdocs/knowledgemanagement/lib/knowledgemanagement.lib.php index 0b07e7b46e8..12db6245087 100644 --- a/htdocs/knowledgemanagement/lib/knowledgemanagement.lib.php +++ b/htdocs/knowledgemanagement/lib/knowledgemanagement.lib.php @@ -16,7 +16,7 @@ */ /** - * \file knowledgemanagement/lib/knowledgemanagement.lib.php + * \file htdocs/knowledgemanagement/lib/knowledgemanagement.lib.php * \ingroup knowledgemanagement * \brief Library files with common functions for KnowledgeManagement */ From a63d3364b4bdd72b40c0fbe5739747d4b18d2cc9 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 6 Jun 2021 22:51:27 +0200 Subject: [PATCH 0453/1497] Fix links in box last MO --- htdocs/core/boxes/box_mos.php | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/htdocs/core/boxes/box_mos.php b/htdocs/core/boxes/box_mos.php index 43d1cd411e4..d7f7a8f72ae 100644 --- a/htdocs/core/boxes/box_mos.php +++ b/htdocs/core/boxes/box_mos.php @@ -86,12 +86,15 @@ class box_mos extends ModeleBoxes if ($user->rights->mrp->read) { $sql = "SELECT p.ref as product_ref"; + $sql .= ", p.rowid as productid"; + $sql .= ", p.tosell"; + $sql .= ", p.tobuy"; + $sql .= ", p.tobatch"; $sql .= ", c.rowid"; $sql .= ", c.date_creation"; $sql .= ", c.tms"; $sql .= ", c.ref"; $sql .= ", c.status"; - //$sql.= ", c.fk_user_valid"; $sql .= " FROM ".MAIN_DB_PREFIX."product as p"; $sql .= ", ".MAIN_DB_PREFIX."mrp_mo as c"; $sql .= " WHERE c.fk_product = p.rowid"; @@ -110,9 +113,12 @@ class box_mos extends ModeleBoxes $datem = $this->db->jdate($objp->tms); $mostatic->id = $objp->rowid; $mostatic->ref = $objp->ref; - $mostatic->id = $objp->socid; $mostatic->status = $objp->status; + $productstatic->id = $objp->productid; $productstatic->ref = $objp->product_ref; + $productstatic->status = $objp->tosell; + $productstatic->status_buy = $objp->tobuy; + $productstatic->status_batch = $objp->tobatch; $this->info_box_contents[$line][] = array( 'td' => 'class="nowraponall"', @@ -126,17 +132,6 @@ class box_mos extends ModeleBoxes 'asis' => 1, ); - if (!empty($conf->global->MRP_BOX_LAST_MOS_SHOW_VALIDATE_USER)) { - if ($objp->fk_user_valid > 0) { - $userstatic->fetch($objp->fk_user_valid); - } - $this->info_box_contents[$line][] = array( - 'td' => 'class="right"', - 'text' => (($objp->fk_user_valid > 0) ? $userstatic->getNomUrl(1) : ''), - 'asis' => 1, - ); - } - $this->info_box_contents[$line][] = array( 'td' => 'class="center nowraponall"', 'text' => dol_print_date($datem, 'day', 'tzuserrel'), From 242f8b2544833f8d8d70ab6dd300782511717e21 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 7 Jun 2021 01:23:34 +0200 Subject: [PATCH 0454/1497] Debug v14 --- htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php | 5 +++-- htdocs/core/boxes/box_graph_new_vs_close_ticket.php | 2 +- htdocs/core/boxes/box_graph_ticket_by_severity.php | 9 +++++---- htdocs/langs/en_US/ticket.lang | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php b/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php index 18ce00d0af3..baa822dcf29 100644 --- a/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php +++ b/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php @@ -168,8 +168,9 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes $totalnb += $value['data']; } $px1->SetData($data); - $px1->setShowLegend(2); - $px1->SetType(array('bar')); + //$px1->setShowLegend(2); + $px1->setShowLegend(0); + $px1->SetType(array('bars')); $px1->SetLegend(array($langs->trans('BoxNumberOfTicketByDay'))); $px1->SetMaxValue($px1->GetCeilMaxValue()); $px1->SetHeight(192); diff --git a/htdocs/core/boxes/box_graph_new_vs_close_ticket.php b/htdocs/core/boxes/box_graph_new_vs_close_ticket.php index bd835d6cc07..5b17c335f3f 100644 --- a/htdocs/core/boxes/box_graph_new_vs_close_ticket.php +++ b/htdocs/core/boxes/box_graph_new_vs_close_ticket.php @@ -149,7 +149,7 @@ class box_graph_new_vs_close_ticket extends ModeleBoxes } $stringtoprint .= '
    '; $this->info_box_contents[][]=array( - 'td' => 'center', + 'td' => 'class="center"', 'text' => $stringtoprint ); } else { diff --git a/htdocs/core/boxes/box_graph_ticket_by_severity.php b/htdocs/core/boxes/box_graph_ticket_by_severity.php index ce769da4752..787e9cebb33 100644 --- a/htdocs/core/boxes/box_graph_ticket_by_severity.php +++ b/htdocs/core/boxes/box_graph_ticket_by_severity.php @@ -30,7 +30,6 @@ require_once DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"; */ class box_graph_ticket_by_severity extends ModeleBoxes { - public $boxcode = "box_ticket_by_severity"; public $boximg = "ticket"; public $boxlabel; @@ -168,16 +167,18 @@ class box_graph_ticket_by_severity extends ModeleBoxes $mesg = $px1->isGraphKo(); $totalnb = 0; if (!$mesg) { - $px1->SetDataColor(array_values($colorseriesstat)); + //$px1->SetDataColor(array_values($colorseriesstat)); $data = array(); $legend = array(); foreach ($dataseries as $value) { $data[] = array($value['label'], $value['data']); $totalnb += $value['data']; } + $px1->SetData($data); - $px1->setShowLegend(2); - $px1->SetType(array('pie')); + //$px1->setShowLegend(2); + $px1->setShowLegend(0); + $px1->SetType(array('bars')); $px1->SetLegend($legend); $px1->SetMaxValue($px1->GetCeilMaxValue()); //$px1->SetHeight($HEIGHT); diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang index 50fa8c970ae..0f87504a0a5 100644 --- a/htdocs/langs/en_US/ticket.lang +++ b/htdocs/langs/en_US/ticket.lang @@ -304,7 +304,7 @@ BoxLastModifiedTicket=Latest modified tickets BoxLastModifiedTicketDescription=Latest %s modified tickets BoxLastModifiedTicketContent= BoxLastModifiedTicketNoRecordedTickets=No recent modified tickets -BoxTicketType=Number of open tickets by type +BoxTicketType=Distribution of open tickets by type BoxTicketSeverity=Number of open tickets by severity BoxNoTicketSeverity=No tickets opened BoxTicketLastXDays=Number of new tickets by days the last %s days From d6cbb9007ff6234c2f757c46724258b961c3ad17 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 7 Jun 2021 01:43:24 +0200 Subject: [PATCH 0455/1497] Debug ticket form to add a local file --- htdocs/core/class/html.formticket.class.php | 10 ++++++---- htdocs/core/lib/functions.lib.php | 3 ++- htdocs/public/ticket/view.php | 11 +++++++++-- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index b10ac80416f..f4e076640c4 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -1099,6 +1099,8 @@ class FormTicket print ''; } + $uselocalbrowser = false; + // Intro // External users can't send message email if ($user->rights->ticket->write && !$user->socid) { @@ -1109,15 +1111,15 @@ class FormTicket print ''; include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $uselocalbrowser = true; - $doleditor = new DolEditor('mail_intro', $mail_intro, '100%', 90, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_2, 70); + $doleditor = new DolEditor('mail_intro', $mail_intro, '100%', 90, 'dolibarr_details', '', false, $uselocalbrowser, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_2, 70); $doleditor->Create(); print ''; } // MESSAGE + $defaultmessage = ""; if (is_object($arraydefaultmessage) && $arraydefaultmessage->content) { $defaultmessage = $arraydefaultmessage->content; @@ -1147,7 +1149,7 @@ class FormTicket //$toolbarname = 'dolibarr_details'; $toolbarname = 'dolibarr_notes'; include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('message', $defaultmessage, '100%', 200, $toolbarname, '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_5, 70); + $doleditor = new DolEditor('message', $defaultmessage, '100%', 200, $toolbarname, '', false, $uselocalbrowser, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_5, 70); $doleditor->Create(); print ''; @@ -1159,7 +1161,7 @@ class FormTicket print $form->textwithpicto('', $langs->trans("TicketMessageMailSignatureHelp"), 1, 'help'); print ''; include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('mail_signature', $mail_signature, '100%', 150, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_2, 70); + $doleditor = new DolEditor('mail_signature', $mail_signature, '100%', 150, 'dolibarr_details', '', false, $uselocalbrowser, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_2, 70); $doleditor->Create(); print ''; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index b018b4d2fb0..165d9c503a4 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3499,7 +3499,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'accountancy', 'account', 'accountline', 'action', 'add', 'address', 'angle-double-down', 'angle-double-up', 'asset', 'bank_account', 'barcode', 'bank', 'bill', 'billa', 'billr', 'billd', 'bookmark', 'bom', 'bug', 'building', 'calendar', 'calendarmonth', 'calendarweek', 'calendarday', 'calendarperuser', 'calendarpertype', - 'cash-register', 'category', 'chart', 'check', 'clock', 'close_title', 'cog', 'collab', 'company', 'contact', 'country', 'contract', 'cron', 'cubes', 'multicurrency', + 'cash-register', 'category', 'chart', 'check', 'clock', 'close_title', 'cog', 'collab', 'company', 'contact', 'country', 'contract', 'conversation', 'cron', 'cubes', + 'multicurrency', 'delete', 'dolly', 'dollyrevert', 'donation', 'download', 'dynamicprice', 'edit', 'ellipsis-h', 'email', 'eraser', 'establishment', 'expensereport', 'external-link-alt', 'external-link-square-alt', 'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'autofill', 'folder', 'folder-open', 'folder-plus', diff --git a/htdocs/public/ticket/view.php b/htdocs/public/ticket/view.php index 2f70ded9914..3fec075160b 100644 --- a/htdocs/public/ticket/view.php +++ b/htdocs/public/ticket/view.php @@ -234,6 +234,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a // Ref print ''.$langs->trans("Ref").''; + print img_picto('', 'ticket', 'class="pictofixedwidth"'); print dol_escape_htmltag($object->dao->ref); print ''; @@ -244,7 +245,9 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a // Subject print ''.$langs->trans("Subject").''; + print ''; print dol_escape_htmltag($object->dao->subject); + print ''; print ''; // Statut @@ -259,6 +262,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a // Category print ''.$langs->trans("Category").''; + print img_picto('', 'category', 'class="pictofixedwidth"'); print dol_escape_htmltag($object->dao->category_label); print ''; @@ -278,8 +282,10 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a $langs->load("users"); $fuser = new User($db); $fuser->fetch($object->dao->fk_user_create); + print img_picto('', 'user', 'class="pictofixedwidth"'); print $fuser->getFullName($langs); } else { + print img_picto('', 'email', 'class="pictofixedwidth"'); print dol_escape_htmltag($object->dao->origin_email); } @@ -304,6 +310,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a if ($object->dao->fk_user_assign > 0) { $fuser = new User($db); $fuser->fetch($object->dao->fk_user_assign); + print img_picto('', 'user', 'class="pictofixedwidth"'); print $fuser->getFullName($langs, 1); } print ''; @@ -320,7 +327,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a print '
    '; if ($action == 'presend') { - print load_fiche_titre($langs->trans('TicketAddMessage'), '', 'messages@ticket'); + print load_fiche_titre($langs->trans('TicketAddMessage'), '', 'conversation'); $formticket = new FormTicket($db); @@ -364,7 +371,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a } // Message list - print load_fiche_titre($langs->trans('TicketMessagesList'), '', 'object_conversation'); + print load_fiche_titre($langs->trans('TicketMessagesList'), '', 'conversation'); $object->viewTicketMessages(false, true, $object->dao); } else { print ''; From beca3c8ad30bc307c228e8a746bcfdc0c774cd95 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 7 Jun 2021 01:51:56 +0200 Subject: [PATCH 0456/1497] Debug v14 --- htdocs/public/ticket/list.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/htdocs/public/ticket/list.php b/htdocs/public/ticket/list.php index 1e1eb08dd5e..3c5dfffba17 100644 --- a/htdocs/public/ticket/list.php +++ b/htdocs/public/ticket/list.php @@ -561,14 +561,19 @@ if ($action == "view_ticketlist") { // Ref if (!empty($arrayfields['t.ref']['checked'])) { print ''; + print ''; + print img_picto('', 'ticket', 'class="paddingrightonly"'); print $obj->ref; + print ''; print ''; } // Subject if (!empty($arrayfields['t.subject']['checked'])) { print ''; - print ''.$obj->subject.''; + print ''; + print $obj->subject; + print ''; print ''; } @@ -602,13 +607,14 @@ if ($action == "view_ticketlist") { // Message author if (!empty($arrayfields['t.fk_user_create']['checked'])) { - print ''; + print ''; if ($obj->fk_user_create > 0) { $user_create->firstname = (!empty($obj->user_create_firstname) ? $obj->user_create_firstname : ''); $user_create->name = (!empty($obj->user_create_lastname) ? $obj->user_create_lastname : ''); $user_create->id = (!empty($obj->fk_user_create) ? $obj->fk_user_create : ''); print $user_create->getFullName($langs); } else { + print img_picto('', 'email', 'class="paddingrightonly"'); print $langs->trans('Email'); } print ''; @@ -617,10 +623,11 @@ if ($action == "view_ticketlist") { // Assigned author if (!empty($arrayfields['t.fk_user_assign']['checked'])) { print ''; - if ($obj->fk_user_assig > 0) { + if ($obj->fk_user_assign > 0) { $user_assign->firstname = (!empty($obj->user_assign_firstname) ? $obj->user_assign_firstname : ''); $user_assign->lastname = (!empty($obj->user_assign_lastname) ? $obj->user_assign_lastname : ''); $user_assign->id = (!empty($obj->fk_user_assign) ? $obj->fk_user_assign : ''); + print img_picto('', 'user', 'class="paddingrightonly"'); print $user_assign->getFullName($langs); } print ''; From 2dbf9537b3be79350d0e2855230270b24c0de505 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 7 Jun 2021 08:59:47 +0200 Subject: [PATCH 0457/1497] Update llx_c_chargesociales.sql --- .../mysql/data/llx_c_chargesociales.sql | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/htdocs/install/mysql/data/llx_c_chargesociales.sql b/htdocs/install/mysql/data/llx_c_chargesociales.sql index a7e12df0d31..afc8afea2f8 100644 --- a/htdocs/install/mysql/data/llx_c_chargesociales.sql +++ b/htdocs/install/mysql/data/llx_c_chargesociales.sql @@ -50,20 +50,20 @@ insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays -- -- Belgique -- -insert into llx_c_chargesociales (fk_pays, id, libelle, deductible, active, code) values ('2', 201, 'ONSS', 1,1,'TAXBEONSS'); -insert into llx_c_chargesociales (fk_pays, id, libelle, deductible, active, code) values ('2', 210, 'Precompte professionnel', 1,1,'TAXBEPREPRO'); -insert into llx_c_chargesociales (fk_pays, id, libelle, deductible, active, code) values ('2', 220, 'Prime existence', 1,1,'TAXBEPRIEXI'); -insert into llx_c_chargesociales (fk_pays, id, libelle, deductible, active, code) values ('2', 230, 'Precompte immobilier', 1,1,'TAXBEPREIMMO'); +insert into llx_c_chargesociales (fk_pays, id, libelle, deductible, active, code) values (2, 201, 'ONSS', 1,1,'TAXBEONSS'); +insert into llx_c_chargesociales (fk_pays, id, libelle, deductible, active, code) values (2, 210, 'Precompte professionnel', 1,1,'TAXBEPREPRO'); +insert into llx_c_chargesociales (fk_pays, id, libelle, deductible, active, code) values (2, 220, 'Prime existence', 1,1,'TAXBEPRIEXI'); +insert into llx_c_chargesociales (fk_pays, id, libelle, deductible, active, code) values (2, 230, 'Precompte immobilier', 1,1,'TAXBEPREIMMO'); -- -- Austria -- -insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values (4101, 'Krankenversicherung', 1,1,'TAXATKV' ,'41'); -insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values (4102, 'Unfallversicherung', 1,1,'TAXATUV' ,'41'); -insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values (4103, 'Pensionsversicherung', 1,1,'TAXATPV' ,'41'); -insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values (4104, 'Arbeitslosenversicherung', 1,1,'TAXATAV' ,'41'); -insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values (4105, 'Insolvenzentgeltsicherungsfond', 1,1,'TAXATIESG' ,'41'); -insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values (4106, 'Wohnbauförderung', 1,1,'TAXATWF' ,'41'); -insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values (4107, 'Arbeiterkammerumlage', 1,1,'TAXATAK' ,'41'); -insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values (4108, 'Mitarbeitervorsorgekasse', 1,1,'TAXATMVK' ,'41'); -insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values (4109, 'Familienlastenausgleichsfond', 1,1,'TAXATFLAF' ,'41'); +insert into llx_c_chargesociales (fk_pays, id, libelle, deductible, active, code) values (41, 4101, 'Krankenversicherung', 1,1,'TAXATKV'); +insert into llx_c_chargesociales (fk_pays, id, libelle, deductible, active, code) values (41, 4102, 'Unfallversicherung', 1,1,'TAXATUV'); +insert into llx_c_chargesociales (fk_pays, id, libelle, deductible, active, code) values (41, 4103, 'Pensionsversicherung', 1,1,'TAXATPV'); +insert into llx_c_chargesociales (fk_pays, id, libelle, deductible, active, code) values (41, 4104, 'Arbeitslosenversicherung', 1,1,'TAXATAV'); +insert into llx_c_chargesociales (fk_pays, id, libelle, deductible, active, code) values (41, 4105, 'Insolvenzentgeltsicherungsfond', 1,1,'TAXATIESG'); +insert into llx_c_chargesociales (fk_pays, id, libelle, deductible, active, code) values (41, 4106, 'Wohnbauförderung', 1,1,'TAXATWF'); +insert into llx_c_chargesociales (fk_pays, id, libelle, deductible, active, code) values (41, 4107, 'Arbeiterkammerumlage', 1,1,'TAXATAK'); +insert into llx_c_chargesociales (fk_pays, id, libelle, deductible, active, code) values (41, 4108, 'Mitarbeitervorsorgekasse', 1,1,'TAXATMVK'); +insert into llx_c_chargesociales (fk_pays, id, libelle, deductible, active, code) values (41, 4109, 'Familienlastenausgleichsfond', 1,1,'TAXATFLAF'); From e74c57167ee9971cebe6d55d2dd10ac4bf98a62c Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 7 Jun 2021 09:39:05 +0200 Subject: [PATCH 0458/1497] Update README.md --- README.md | 85 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 56 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 34162fd5682..736925bec72 100644 --- a/README.md +++ b/README.md @@ -97,41 +97,68 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) ### Main application/modules (all optional) -- Customers, Prospects (Leads) and/or Suppliers directory + Contacts -- Members/Membership management -- Products and/or Services catalog -- Commercial proposals management -- Customer & Supplier Orders management -- Invoices and payment management -- Shipping management -- Warehouse/Stock management/Inventory -- Manufacturing Orders -- Bank accounts management -- Direct debit orders management (European SEPA) -- Accounting management -- Shared calendar/agenda (with ical and vcal export for third party tools integration) -- Opportunities or Leads management -- Projects & Tasks management -- Ticket System -- Contracts management -- Interventions management -- Employee's leave requests management -- Expense reports -- Recruitment management -- Timesheets -- Electronic Document Management (EDM) -- Foundations members management -- Point of Sale (POS) -- … (around 100 modules available by default, 1000+ on the addon market place) +- Third-Parties Management: Customers, Prospects (Leads) and/or Suppliers + Contacts +- Members/Membership/Foundation management + + Product Management +- Products and/or Services catalog +- Stock / Warehouse management + Inventory +- Barcodes +- Batches / Lots / Serials +- Product Variants +- Bill of Materials +- Manufacturing Orders + + Customer/Sales Management +- Customers/Prospects + Contacts management +- Opportunities or Leads management +- Commercial proposals management +- Customer Orders management +- Contracts/Subscription management +- Interventions management +- Ticket System +- Shipping management +- Customer Invoices/Credit notes and payment management +- Point of Sale (POS) + + Supplier/Purchase Management +- Suppliers/Vendors + Contacts +- Supplier (price) requests +- Purchase Order management +- Delivery/Receiption +- Supplier Invoices/credit notes and payment management + + Finance / Accounting +- Invoices / Payments +- Bank accounts management +- Direct debit orders management (European SEPA) +- Accounting management +- Donations management +- Loan management +- Margins +- Reports + + +- Shared calendar/agenda (with ical and vcal export for third party tools integration) +- Projects & Tasks management +- Ticket System + +- Employee's leave requests management +- Expense reports +- Recruitment management +- Timesheets + +- (around 100 modules available by default, 1000+ on the addon market place) + ### Other application/modules +- Electronic Document Management (EDM) - Bookmarks management -- Donations management - Reporting - Surveys - Data export/import -- Barcodes support +- Barcodes - Margin calculations - LDAP connectivity - ClickToDial integration @@ -139,7 +166,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) - RSS integration - Skype integration - Payment platforms integration (PayPal, Stripe, Paybox...) -- … +- ### Other general features From 80af5e2216dd3a91ed20c9ca3e4a9c4a78600e4e Mon Sep 17 00:00:00 2001 From: Quentin VIAL-GOUTEYRON Date: Mon, 7 Jun 2021 10:05:24 +0200 Subject: [PATCH 0459/1497] keep where but remove join --- htdocs/compta/stats/cabyprodserv.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index 7b8f1101004..fce5a9740a2 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -231,8 +231,6 @@ if ($modecompta == 'CREANCES-DETTES') $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON l.fk_product = p.rowid"; if ($selected_cat === -2) { // Without any category $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product"; - } elseif ($selected_cat) { // Into a specific category - $sql .= " INNER JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON (cp.fk_product = p.rowid) INNER JOIN ".MAIN_DB_PREFIX."categorie as c ON (cp.fk_categorie = c.rowid)"; } $sql .= " WHERE l.fk_facture = f.rowid"; $sql .= " AND f.fk_statut in (1,2)"; @@ -263,10 +261,13 @@ if ($modecompta == 'CREANCES-DETTES') } } + $sql .= " AND (p.rowid IN "; + $sql .= " (SELECT fk_product FROM ".MAIN_DB_PREFIX."categorie_product cp WHERE "; $sql .= " AND "; if ($subcat) $sql .= "cp.fk_categorie IN (".$listofcatsql.")"; else $sql .= "cp.fk_categorie = ".$selected_cat; + $sql .= "))"; } if ($selected_soc > 0) $sql .= " AND soc.rowid=".$selected_soc; From 4f6a5cf5f7694c9a9eb5c000a13b0c8c99b96484 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 7 Jun 2021 10:08:31 +0200 Subject: [PATCH 0460/1497] Debug v14 --- htdocs/adherents/class/adherent.class.php | 40 +++++++++++++++++++---- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 18d8746cca7..b7852280ddf 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -260,9 +260,9 @@ class Adherent extends CommonObject public $datefin; - // From member table - // Fields loaded by fetch_subscriptions() + // Fields loaded by fetch_subscriptions() from member table + public $first_subscription_date; public $first_subscription_amount; @@ -277,6 +277,12 @@ class Adherent extends CommonObject public $subscriptions = array(); + + // Fields loaded by fetchPartnerships() from partnership table + + public $partnerships = array(); + + /** * @var Adherent To contains a clone of this when we need to save old properties of object */ @@ -1439,11 +1445,12 @@ class Adherent extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Function to get member subscriptions data - * first_subscription_date, first_subscription_date_start, first_subscription_date_end, first_subscription_amount - * last_subscription_date, last_subscription_date_start, last_subscription_date_end, last_subscription_amount + * Function to get member subscriptions data: + * subscriptions, + * first_subscription_date, first_subscription_date_start, first_subscription_date_end, first_subscription_amount + * last_subscription_date, last_subscription_date_start, last_subscription_date_end, last_subscription_amount * - * @return int <0 si KO, >0 si OK + * @return int <0 if KO, >0 if OK */ public function fetch_subscriptions() { @@ -1503,6 +1510,27 @@ class Adherent extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Function to get partnerships array + * + * @param string $mode 'member' or 'thirdparty' + * @return int <0 if KO, >0 if OK + */ + public function fetchPartnerships($mode) + { + // phpcs:enable + global $langs; + + require_once DOL_DOCUMENT_ROOT.'/parntership/class/partnership.class.php'; + + + $this->partnerships[] = array(); + + return 1; + } + + /** * Insert subscription into database and eventually add links to banks, mailman, etc... * From 98aa374185cb8996d9a4194695f77db35cddbeeb Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 7 Jun 2021 08:10:05 +0000 Subject: [PATCH 0461/1497] Fixing style errors. --- htdocs/compta/stats/cabyprodserv.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index fce5a9740a2..f7c215270d4 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -268,7 +268,6 @@ if ($modecompta == 'CREANCES-DETTES') if ($subcat) $sql .= "cp.fk_categorie IN (".$listofcatsql.")"; else $sql .= "cp.fk_categorie = ".$selected_cat; $sql .= "))"; - } if ($selected_soc > 0) $sql .= " AND soc.rowid=".$selected_soc; $sql .= " AND f.entity IN (".getEntity('invoice').")"; From af913cd29f1412481858ca796508520bded4e414 Mon Sep 17 00:00:00 2001 From: Quentin VIAL-GOUTEYRON Date: Mon, 7 Jun 2021 10:10:42 +0200 Subject: [PATCH 0462/1497] remove and --- htdocs/compta/stats/cabyprodserv.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index fce5a9740a2..da9927c2e20 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -263,8 +263,6 @@ if ($modecompta == 'CREANCES-DETTES') $sql .= " AND (p.rowid IN "; $sql .= " (SELECT fk_product FROM ".MAIN_DB_PREFIX."categorie_product cp WHERE "; - $sql .= " AND "; - if ($subcat) $sql .= "cp.fk_categorie IN (".$listofcatsql.")"; else $sql .= "cp.fk_categorie = ".$selected_cat; $sql .= "))"; From 0144d6c0fdba1c38f9c60535cd6911b83c32ea73 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 7 Jun 2021 11:30:46 +0200 Subject: [PATCH 0463/1497] Inventory is now stable feature --- htdocs/core/menus/standard/eldy.lib.php | 28 ++++++++++++------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 2232b3333dd..7f6121fb07d 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1598,21 +1598,19 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM } // Inventory - if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { - if (!empty($conf->stock->enabled)) { - $langs->load("stocks"); - if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { - $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("Inventories"), 0, $user->rights->stock->lire, '', $mainmenu, 'stock', 0, '', '', '', img_picto('', 'inventory', 'class="pictofixedwidth"')); - if ($usemenuhider || empty($leftmenu) || $leftmenu == "stock_inventories") { - $newmenu->add("/product/inventory/card.php?action=create&leftmenu=stock_inventories", $langs->trans("NewInventory"), 1, $user->rights->stock->creer); - $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("List"), 1, $user->rights->stock->lire); - } - } else { - $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("Inventories"), 0, $user->rights->stock->inventory_advance->read, '', $mainmenu, 'stock', 0, '', '', '', img_picto('', 'inventory', 'class="pictofixedwidth"')); - if ($usemenuhider || empty($leftmenu) || $leftmenu == "stock_inventories") { - $newmenu->add("/product/inventory/card.php?action=create&leftmenu=stock_inventories", $langs->trans("NewInventory"), 1, $user->rights->stock->inventory_advance->write); - $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("List"), 1, $user->rights->stock->inventory_advance->read); - } + if (!empty($conf->stock->enabled)) { + $langs->load("stocks"); + if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { + $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("Inventories"), 0, $user->rights->stock->lire, '', $mainmenu, 'stock', 0, '', '', '', img_picto('', 'inventory', 'class="pictofixedwidth"')); + if ($usemenuhider || empty($leftmenu) || $leftmenu == "stock_inventories") { + $newmenu->add("/product/inventory/card.php?action=create&leftmenu=stock_inventories", $langs->trans("NewInventory"), 1, $user->rights->stock->creer); + $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("List"), 1, $user->rights->stock->lire); + } + } else { + $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("Inventories"), 0, $user->rights->stock->inventory_advance->read, '', $mainmenu, 'stock', 0, '', '', '', img_picto('', 'inventory', 'class="pictofixedwidth"')); + if ($usemenuhider || empty($leftmenu) || $leftmenu == "stock_inventories") { + $newmenu->add("/product/inventory/card.php?action=create&leftmenu=stock_inventories", $langs->trans("NewInventory"), 1, $user->rights->stock->inventory_advance->write); + $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("List"), 1, $user->rights->stock->inventory_advance->read); } } } From cac63ddd3fcd64e39df0431c562cb78684be52ae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 7 Jun 2021 12:16:11 +0200 Subject: [PATCH 0464/1497] Add missing translation --- htdocs/langs/en_US/languages.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/languages.lang b/htdocs/langs/en_US/languages.lang index cbc94b4481c..598eec1fdca 100644 --- a/htdocs/langs/en_US/languages.lang +++ b/htdocs/langs/en_US/languages.lang @@ -3,6 +3,7 @@ Language_am_ET=Ethiopian Language_ar_AR=Arabic Language_ar_EG=Arabic (Egypt) Language_ar_SA=Arabic +Language_ar_TN=Arabic (Tunisia) Language_az_AZ=Azerbaijani Language_bn_BD=Bengali Language_bn_IN=Bengali (India) From e64c27e1c308f1157f24442020aad31f22a2f111 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Tue, 8 Jun 2021 10:27:33 +0200 Subject: [PATCH 0465/1497] FIX : need to add payment sum to getlibstatus function in object linked block --- htdocs/compta/facture/tpl/linkedobjectblock.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php index a02a0fc1682..1e18eb6bfeb 100644 --- a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php +++ b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php @@ -85,7 +85,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) } } print ''; - print ''.$objectlink->getLibStatut(3).''; + print ''.$objectlink->getLibStatut(3, $objectlink->getSommePaiement()).''; print ''.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').''; print "\n"; } From b1c3a7cf4864ff8568569c0f1926c2f6cd590c9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 8 Jun 2021 10:38:34 +0200 Subject: [PATCH 0466/1497] avoid fatal error --- htdocs/compta/facture/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 60e5d4eb52a..8f5ac173d7f 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3208,7 +3208,7 @@ if ($action == 'create') $facids = $facturestatic->list_qualified_avoir_invoices($soc->id); if ($facids < 0) { - dol_print_error($db, $facturestatic); + dol_print_error($db, $facturestatic->error, $facturestatic->errors); exit; } $optionsav = ""; @@ -3656,7 +3656,7 @@ if ($action == 'create') $result = $object->fetch($id, $ref); if ($result <= 0) { - dol_print_error($db, $object->error); + dol_print_error($db, $object->error, $object->errors); exit(); } From 37433ffee7cfa54ba9d6e268e95a599635bf25c1 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Tue, 8 Jun 2021 11:39:04 +0200 Subject: [PATCH 0467/1497] verify vat change to update multiprice --- htdocs/product/price.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index dd56aa42318..27d39779338 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -349,6 +349,7 @@ if (empty($reshook)) $newprice = price2num($newprice, 'MU'); $newprice_min = price2num($val['price_min'], 'MU'); + $newvattx = price2num($val['vat_tx'], 'MU'); if (!empty($conf->global->PRODUCT_MINIMUM_RECOMMENDED_PRICE) && $newprice_min < $maxpricesupplier) { setEventMessages($langs->trans("MinimumPriceLimit", price($maxpricesupplier, 0, '', 1, - 1, - 1, 'auto')), null, 'errors'); @@ -356,11 +357,10 @@ if (empty($reshook)) break; } - if ($object->multiprices[$key] != $newprice || $object->multiprices_min[$key] != $newprice_min || $object->multiprices_base_type[$key] != $val['price_base_type']) + if ($object->multiprices[$key] != $newprice || $object->multiprices_min[$key] != $newprice_min || $object->multiprices_base_type[$key] != $val['price_base_type'] || $object->multiprices_tva_tx[$key] != $newvattx) $res = $object->updatePrice($newprice, $val['price_base_type'], $user, $val['vat_tx'], $newprice_min, $key, $val['npr'], $psq, 0, $val['localtaxes_array'], $val['default_vat_code']); else $res = 0; - if ($res < 0) { $error++; setEventMessages($object->error, $object->errors, 'errors'); From 7e95c5ec207ee1c07349dbdb8e846671c4837f28 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 8 Jun 2021 11:40:50 +0200 Subject: [PATCH 0468/1497] Clean code --- htdocs/product/card.php | 87 +++++++++++++++-------------- htdocs/product/composition/card.php | 12 +++- htdocs/product/stock/product.php | 12 +++- htdocs/variants/combinations.php | 19 +++++-- 4 files changed, 79 insertions(+), 51 deletions(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 61568a5510a..1b732cd721e 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1974,14 +1974,14 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
    '; print '
    '; - print ''; + print '
    '; // Type if (!empty($conf->product->enabled) && !empty($conf->service->enabled)) { $typeformat = 'select;0:'.$langs->trans("Product").',1:'.$langs->trans("Service"); print ''; } @@ -1996,7 +1996,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; } print '
    '; print (empty($conf->global->PRODUCT_DENY_CHANGE_PRODUCT_TYPE)) ? $form->editfieldkey("Type", 'fk_product_type', $object->type, $object, $usercancreate, $typeformat) : $langs->trans('Type'); - print ''; + print ''; print $form->editfieldval("Type", 'fk_product_type', $object->type, $object, $usercancreate, $typeformat); print '
    id.'">'.img_edit($langs->trans('Edit'), 1).'
    '; - print ''; + print ''; if ($action == 'editbarcodetype' || $action == 'editbarcode') { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbarcode.class.php'; $formbarcode = new FormBarCode($db); @@ -2022,7 +2022,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print 'id.'">'.img_edit($langs->trans('Edit'), 1).''; } print ''; - print ''; + print ''; if ($action == 'editbarcode') { $tmpcode = GETPOSTISSET('barcode') ? GETPOST('barcode') : $object->barcode; if (empty($tmpcode) && !empty($modBarCodeProduct->code_auto)) { @@ -2042,10 +2042,25 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''."\n"; } + // Batch number management (to batch) + if (!empty($conf->productbatch->enabled)) { + if ($object->isProduct() || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { + print ''.$langs->trans("ManageLotSerial").''; + print $object->getLibStatut(0, 2); + print ''; + if ((($object->status_batch == '1' &&$conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS && $conf->global->PRODUCTBATCH_LOT_ADDON == 'mod_lot_advanced') + || ($object->status_batch == '2' && $conf->global->PRODUCTBATCH_SN_ADDON == 'mod_sn_advanced' && $conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS))) { + print ''.$langs->trans("ManageLotMask").''; + print $object->batch_mask; + print ''; + } + } + } + // Accountancy sell code print ''; print $langs->trans("ProductAccountancySellCode"); - print ''; + print ''; if (!empty($conf->accounting->enabled)) { if (!empty($object->accountancy_code_sell)) { $accountingaccount = new AccountingAccount($db); @@ -2062,7 +2077,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if ($mysoc->isInEEC()) { print ''; print $langs->trans("ProductAccountancySellIntraCode"); - print ''; + print ''; if (!empty($conf->accounting->enabled)) { if (!empty($object->accountancy_code_sell_intra)) { $accountingaccount2 = new AccountingAccount($db); @@ -2079,7 +2094,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Accountancy sell code export print ''; print $langs->trans("ProductAccountancySellExportCode"); - print ''; + print ''; if (!empty($conf->accounting->enabled)) { if (!empty($object->accountancy_code_sell_export)) { $accountingaccount3 = new AccountingAccount($db); @@ -2095,7 +2110,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Accountancy buy code print ''; print $langs->trans("ProductAccountancyBuyCode"); - print ''; + print ''; if (!empty($conf->accounting->enabled)) { if (!empty($object->accountancy_code_buy)) { $accountingaccount4 = new AccountingAccount($db); @@ -2112,7 +2127,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if ($mysoc->isInEEC()) { print ''; print $langs->trans("ProductAccountancyBuyIntraCode"); - print ''; + print ''; if (!empty($conf->accounting->enabled)) { if (!empty($object->accountancy_code_buy_intra)) { $accountingaccount5 = new AccountingAccount($db); @@ -2129,7 +2144,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Accountancy buy code export print ''; print $langs->trans("ProductAccountancyBuyExportCode"); - print ''; + print ''; if (!empty($conf->accounting->enabled)) { if (!empty($object->accountancy_code_buy_export)) { $accountingaccount6 = new AccountingAccount($db); @@ -2142,26 +2157,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } print ''; - // Batch number management (to batch) - if (!empty($conf->productbatch->enabled)) { - if ($object->isProduct() || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { - print ''.$langs->trans("ManageLotSerial").''; - print $object->getLibStatut(0, 2); - print ''; - if ((($object->status_batch == '1' &&$conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS && $conf->global->PRODUCTBATCH_LOT_ADDON == 'mod_lot_advanced') - || ($object->status_batch == '2' && $conf->global->PRODUCTBATCH_SN_ADDON == 'mod_sn_advanced' && $conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS))) { - print ''.$langs->trans("ManageLotMask").''; - print $object->batch_mask; - print ''; - } - } - } - // Description - print ''.$langs->trans("Description").''.(dol_textishtml($object->description) ? $object->description : dol_nl2br($object->description, 1, true)).''; + print ''.$langs->trans("Description").''.(dol_textishtml($object->description) ? $object->description : dol_nl2br($object->description, 1, true)).''; // Public URL - print ''.$langs->trans("PublicUrl").''; + print ''.$langs->trans("PublicUrl").''; print dol_print_url($object->url); print ''; @@ -2184,7 +2184,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $prodstatic->fetch($combination->fk_product_parent); // Parent product - print ''.$langs->trans("ParentProduct").''; + print ''.$langs->trans("ParentProduct").''; print $prodstatic->getNomUrl(1); print ''; } @@ -2195,11 +2195,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
    '; print '
    '; - print ''; + print '
    '; if ($object->isService()) { // Duration - print ''; } else { // Nature - print ''; // Brut Weight - print ''; } } @@ -2285,10 +2286,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Custom code if (!$object->isService() && empty($conf->global->PRODUCT_DISABLE_CUSTOM_INFO)) { - print ''; + print ''; // Origin country code - print ''; - print ''; + print ''.$object->lifetime.''; + print ''; } // Other attributes - $parameters = array('colspan' => ' colspan="'.(2 + (($showphoto || $showbarcode) ? 1 : 0)).'"', 'cols' => (2 + (($showphoto || $showbarcode) ? 1 : 0))); + $parameters = array(); include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; // Categories if ($conf->categorie->enabled) { - print '"; } @@ -2315,7 +2316,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Note private if (!empty($conf->global->MAIN_DISABLE_NOTES_TAB)) { print ' '."\n"; - print ''."\n"; + print ''."\n"; print ' '."\n"; } diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index c9499bf415b..e1250f10cb3 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -200,7 +200,7 @@ print dol_get_fiche_head($head, 'subproduct', $titre, -1, $picto); if ($id > 0 || !empty($ref)) { /* - * Fiche en mode edition + * Product card */ if ($user->rights->produit->lire || $user->rights->service->lire) { $linkback = ''.$langs->trans("BackToList").''; @@ -218,6 +218,16 @@ if ($id > 0 || !empty($ref)) { print '
    '.$langs->trans("Duration").''.$object->duration_value.' '; + print '
    '.$langs->trans("Duration").''.$object->duration_value.' '; if ($object->duration_value > 1) { $dur = array("i"=>$langs->trans("Minute"), "h"=>$langs->trans("Hours"), "d"=>$langs->trans("Days"), "w"=>$langs->trans("Weeks"), "m"=>$langs->trans("Months"), "y"=>$langs->trans("Years")); } elseif ($object->duration_value > 0) { @@ -2210,12 +2210,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
    '.$form->textwithpicto($langs->trans("NatureOfProductShort"), $langs->trans("NatureOfProductDesc")).''; + print '
    '.$form->textwithpicto($langs->trans("NatureOfProductShort"), $langs->trans("NatureOfProductDesc")).''; print $object->getLibFinished(); print '
    '.$langs->trans("Weight").''; + print '
    '.$langs->trans("Weight").''; if ($object->weight != '') { print $object->weight." ".measuringUnitString(0, "weight", $object->weight_units); } else { @@ -2225,7 +2225,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if (empty($conf->global->PRODUCT_DISABLE_SIZE)) { // Brut Length - print '
    '.$langs->trans("Length").' x '.$langs->trans("Width").' x '.$langs->trans("Height").''; + print '
    '.$langs->trans("Length").' x '.$langs->trans("Width").' x '.$langs->trans("Height").''; if ($object->length != '' || $object->width != '' || $object->height != '') { print $object->length; if ($object->width) { @@ -2242,7 +2242,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } if (empty($conf->global->PRODUCT_DISABLE_SURFACE)) { // Brut Surface - print '
    '.$langs->trans("Surface").''; + print '
    '.$langs->trans("Surface").''; if ($object->surface != '') { print $object->surface." ".measuringUnitString(0, "surface", $object->surface_units); } else { @@ -2252,7 +2252,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } if (empty($conf->global->PRODUCT_DISABLE_VOLUME)) { // Brut Volume - print '
    '.$langs->trans("Volume").''; + print '
    '.$langs->trans("Volume").''; if ($object->volume != '') { print $object->volume." ".measuringUnitString(0, "volume", $object->volume_units); } else { @@ -2263,12 +2263,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if (!empty($conf->global->PRODUCT_ADD_NET_MEASURE)) { // Net Measure - print '
    '.$langs->trans("NetMeasure").''; + print '
    '.$langs->trans("NetMeasure").''; if ($object->net_measure != '') { print $object->net_measure." ".measuringUnitString($object->net_measure_units); } else { print ' '; } + print '
    '.$langs->trans("CustomCode").''.$object->customcode.'
    '.$langs->trans("CustomCode").''.$object->customcode.'
    '.$langs->trans("Origin").''.getCountry($object->country_id, 0, $db); + print '
    '.$langs->trans("Origin").''.getCountry($object->country_id, 0, $db); if (!empty($object->state_id)) { print ' - '.getState($object->state_id, 0, $db); } @@ -2297,17 +2298,17 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Quality Control if (!empty($conf->global->PRODUCT_LOT_ENABLE_QUALITY_CONTROL)) { - print '
    '.$langs->trans("LifeTime").''.$object->lifetime.'
    '.$langs->trans("QCFrequency").''.$object->qc_frequency.'
    '.$langs->trans("LifeTime").'
    '.$langs->trans("QCFrequency").''.$object->qc_frequency.'
    '.$langs->trans("Categories").''; + print '
    '.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_PRODUCT, 1); print "
    '.$langs->trans("NotePrivate").''.(dol_textishtml($object->note_private) ? $object->note_private : dol_nl2br($object->note_private, 1, true)).'
    '.$langs->trans("NotePrivate").''.(dol_textishtml($object->note_private) ? $object->note_private : dol_nl2br($object->note_private, 1, true)).'
    '; + // Type + if (!empty($conf->product->enabled) && !empty($conf->service->enabled)) { + $typeformat = 'select;0:'.$langs->trans("Product").',1:'.$langs->trans("Service"); + print ''; + } + // Nature if ($object->type != Product::TYPE_SERVICE) { print ''; @@ -558,6 +558,10 @@ function show_stats_for_company($product, $socid) print ''; print ''; } + $reshook = $hookmanager->executeHooks('addmoreproductstat', $parameters, $product); // Note that $action and $object may have been modified by some hooks + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + + print $hookmanager->resPrint; return $nblines++; } From 5131ab5199b39605745544bae20429a98883476c Mon Sep 17 00:00:00 2001 From: John BOTELLA Date: Tue, 8 Jun 2021 12:36:08 +0200 Subject: [PATCH 0472/1497] Fix php 7 warning : Only variables should be passed by reference --- htdocs/core/modules/modFournisseur.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index d39d67775f5..39b2f3d3237 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -489,7 +489,8 @@ class modFournisseur extends DolibarrModules case 'sellist': $tmp = ''; $tmpparam = unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null - if ($tmpparam['options'] && is_array($tmpparam['options'])) $tmp = array_shift(array_keys($tmpparam['options'])); + $array_keys = array_keys($tmpparam['options']); + if ($tmpparam['options'] && is_array($tmpparam['options'])) $tmp = array_shift($array_keys); if (preg_match('/[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/', $tmp)) $typeFilter = "List:".$tmp; break; } From 1aeb91eb9a3ab439f66fb5717e3dff8de8a95b38 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 8 Jun 2021 13:44:11 +0200 Subject: [PATCH 0473/1497] FIX entry menus that has been lost in v13 Look and feel v14 --- htdocs/compta/stats/cabyprodserv.php | 6 ++- htdocs/compta/stats/casoc.php | 9 +++-- htdocs/compta/stats/index.php | 12 ++++-- htdocs/compta/stats/supplier_turnover.php | 30 +++++++++++--- .../stats/supplier_turnover_by_prodserv.php | 6 ++- .../stats/supplier_turnover_by_thirdparty.php | 14 ++++--- htdocs/core/menus/standard/eldy.lib.php | 39 ++++++++++++++----- 7 files changed, 82 insertions(+), 34 deletions(-) diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index d48a931ca2c..83eb9ce68b9 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -391,7 +391,8 @@ if ($modecompta == 'CREANCES-DETTES') { // Category filter print ''; print ''; print '\n"; // Loop on each record - $sign = 1; $cash = $bank = $cheque = $other = 0; - $totalarray = array(); + $totalqty = 0; $cachebankaccount = array(); + $transactionspertype = array(); $amountpertype = array(); + + $totalarray = array(); while ($i < $num) { $objp = $db->fetch_object($resql); + $totalqty += $objp->qty; + + if (empty($cachebankaccount[$objp->bankid])) { $bankaccounttmp = new Account($db); $bankaccounttmp->fetch($objp->bankid); @@ -243,25 +250,42 @@ if ($resql) { $totalarray['nbfield']++; } - // Bank account - print '\n"; @@ -327,21 +351,21 @@ if ($resql) { print '
    '; print '

    '; - print $langs->trans("Cash").': '.price($cash).''; + print $langs->trans("Cash").' '.($transactionspertype['CASH']?'('.$transactionspertype['CASH'].')':'').': '.price($cash).''; if ($object->status == $object::STATUS_VALIDATED && $cash != $object->cash) { print ' <> '.$langs->trans("Declared").': '.price($object->cash).''; } print "
    "; //print '
    '; - print $langs->trans("PaymentTypeCHQ").': '.price($cheque).''; + print $langs->trans("PaymentTypeCHQ").' '.($transactionspertype['CHQ']?'('.$transactionspertype['CHQ'].')':'').': '.price($cheque).''; if ($object->status == $object::STATUS_VALIDATED && $cheque != $object->cheque) { print ' <> '.$langs->trans("Declared").': '.price($object->cheque).''; } print "
    "; //print '
    '; - print $langs->trans("PaymentTypeCB").': '.price($bank).''; + print $langs->trans("PaymentTypeCB").' '.($transactionspertype['CB']?'('.$transactionspertype['CB'].')':'').': '.price($bank).''; if ($object->status == $object::STATUS_VALIDATED && $bank != $object->card) { print ' <> '.$langs->trans("Declared").': '.price($object->card).''; } @@ -349,11 +373,11 @@ if ($resql) { // print '
    '; if ($other) { - print ''.$langs->trans("Other").': '.price($other).""; + print ''.$langs->trans("Other").' '.($transactionspertype['OTHER']?'('.$transactionspertype['OTHER'].')':'').': '.price($other).""; print '
    '; } - print $langs->trans("Total").': '.price($cash + $cheque + $bank + $other).''; + print $langs->trans("Total").' ('.$totalqty.' '.$langs->trans("Articles").') : '.price($cash + $cheque + $bank + $other).''; print '

    '; print '
    '; From cfa268e0d30147011abaeb6e37f629e019f261d3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Jun 2021 04:13:57 +0200 Subject: [PATCH 0484/1497] Fix we must add total vat on cash fence receipts (Ticket Z) --- htdocs/compta/cashcontrol/report.php | 35 ++++++++++++++-------------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/htdocs/compta/cashcontrol/report.php b/htdocs/compta/cashcontrol/report.php index 15345584f73..fb6e75c68c4 100644 --- a/htdocs/compta/cashcontrol/report.php +++ b/htdocs/compta/cashcontrol/report.php @@ -120,10 +120,9 @@ $sql.=" OR b.fk_account=".$conf->global->CASHDESK_ID_BANKACCOUNT_CB; $sql.=" OR b.fk_account=".$conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE; $sql.=")"; */ -$sql = "SELECT f.rowid as facid, f.ref, f.datef as do, pf.amount as amount, b.fk_account as bankid, cp.code, SUM(fd.qty) as qty"; -$sql .= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf, ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."paiement as p, ".MAIN_DB_PREFIX."c_paiement as cp, ".MAIN_DB_PREFIX."bank as b,"; -$sql .= " ".MAIN_DB_PREFIX."facturedet as fd"; -$sql .= " WHERE pf.fk_facture = f.rowid AND p.rowid = pf.fk_paiement AND cp.id = p.fk_paiement AND p.fk_bank = b.rowid AND fd.fk_facture = f.rowid"; +$sql = "SELECT f.rowid as facid, f.ref, f.datef as do, pf.amount as amount, b.fk_account as bankid, cp.code"; +$sql .= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf, ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."paiement as p, ".MAIN_DB_PREFIX."c_paiement as cp, ".MAIN_DB_PREFIX."bank as b"; +$sql .= " WHERE pf.fk_facture = f.rowid AND p.rowid = pf.fk_paiement AND cp.id = p.fk_paiement AND p.fk_bank = b.rowid"; $sql .= " AND f.module_source = '".$db->escape($posmodule)."'"; $sql .= " AND f.pos_source = '".$db->escape($terminalid)."'"; $sql .= " AND f.paye = 1"; @@ -145,7 +144,6 @@ if ($syear && !$smonth) { } else { dol_print_error('', 'Year not defined'); } -$sql .= " GROUP BY f.rowid, f.ref, f.datef, pf.amount, b.fk_account, cp.code"; $resql = $db->query($sql); if ($resql) { @@ -161,8 +159,8 @@ if ($resql) { print $langs->trans("CashControl")." - ".$langs->trans("Draft"); } print ""; - print $langs->trans("DateCreationShort").": ".dol_print_date($object->date_creation, 'dayhour'); - print '
    '.$mysoc->name; + print $mysoc->name; + print '
    '.$langs->trans("DateCreationShort").": ".dol_print_date($object->date_creation, 'dayhour'); $userauthor = $object->fk_user_valid; if (empty($userauthor)) { $userauthor = $object->fk_user_creat; @@ -201,7 +199,9 @@ if ($resql) { $cash = $bank = $cheque = $other = 0; $totalqty = 0; + $totalvat = 0; $cachebankaccount = array(); + $cacheinvoiceid = array(); $transactionspertype = array(); $amountpertype = array(); @@ -209,9 +209,7 @@ if ($resql) { while ($i < $num) { $objp = $db->fetch_object($resql); - $totalqty += $objp->qty; - - + // Load bankaccount if (empty($cachebankaccount[$objp->bankid])) { $bankaccounttmp = new Account($db); $bankaccounttmp->fetch($objp->bankid); @@ -223,14 +221,13 @@ if ($resql) { $invoicetmp->fetch($objp->facid); - /*if ($first == "yes") - { - print '
    '; - print ''; - print ''; - print ''; - $first = "no"; - }*/ + if (empty($cacheinvoiceid[$objp->facid])) { + $cacheinvoiceid[$objp->facid] = $objp->facid; // First time this invoice is found into list of invoice x payments + foreach($invoicetmp->lines as $line) { + $totalqty += $line->qty; + $totalvat += $line->total_tva; + } + } print ''; @@ -378,6 +375,8 @@ if ($resql) { } print $langs->trans("Total").' ('.$totalqty.' '.$langs->trans("Articles").') : '.price($cash + $cheque + $bank + $other).''; + print '
    '.$langs->trans("TotalVAT").' : '.price($totalvat).''; + // TODO Add total localtaxes. print ''; print ''; From a4f3792cec80c7f5bcc9d52f7f4a7fb79143239e Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 9 Jun 2021 07:42:05 +0200 Subject: [PATCH 0485/1497] FIX Missing link to language file --- htdocs/user/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 40ff6625163..9b747d9c713 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -92,7 +92,7 @@ $result = restrictedArea($user, 'user', $id, 'user', $feature2); if ($user->id <> $id && !$canreaduser) accessforbidden(); // Load translation files required by page -$langs->loadLangs(array('users', 'companies', 'ldap', 'admin', 'hrm', 'stocks')); +$langs->loadLangs(array('users', 'companies', 'ldap', 'admin', 'hrm', 'stocks', 'other')); $object = new User($db); $extrafields = new ExtraFields($db); From a141d722ad3477f3e1afa501c727278911e6f4e0 Mon Sep 17 00:00:00 2001 From: MOREAU FRANCK Date: Wed, 9 Jun 2021 08:39:06 +0200 Subject: [PATCH 0486/1497] Adding hooks on product stat in order to allow to expand stat on other modules stickler-ci test corrections --- htdocs/core/lib/product.lib.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index e87e63666ef..4b249a1cc9a 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -559,11 +559,12 @@ function show_stats_for_company($product, $socid) print ''; } $parameters = array('socid'=>$socid); - $reshook = $hookmanager->executeHooks('addmoreproductstat', $parameters, $product,$nblines); // Note that $action and $object may have been modified by some hooks + $reshook = $hookmanager->executeHooks('addmoreproductstat', $parameters, $product, $nblines); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - + print $hookmanager->resPrint; + return $nblines++; } From 7317aad41f76c944b21618df2caf3346788520e8 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Wed, 9 Jun 2021 11:08:38 +0200 Subject: [PATCH 0487/1497] FIX: projet time spent: also restrict to X months back for update and delete --- htdocs/projet/class/task.class.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 1b64f0d9a66..e974532f545 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -1465,6 +1465,17 @@ class Task extends CommonObject if (empty($this->timespent_datehour)) $this->timespent_datehour = $this->timespent_date; if (isset($this->timespent_note)) $this->timespent_note = trim($this->timespent_note); + if (! empty($conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS)) { + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; + $restrictBefore = dol_time_plus_duree(dol_now(), - $conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS, 'm'); + + if ($this->timespent_date < $restrictBefore) { + $this->error = $langs->trans('TimeRecordingRestrictedToNMonthsBack', $conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS); + $this->errors[] = $this->error; + return -1; + } + } + $this->db->begin(); $sql = "UPDATE ".MAIN_DB_PREFIX."projet_task_time SET"; @@ -1530,6 +1541,17 @@ class Task extends CommonObject $error = 0; + if (! empty($conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS)) { + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; + $restrictBefore = dol_time_plus_duree(dol_now(), - $conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS, 'm'); + + if ($this->timespent_date < $restrictBefore) { + $this->error = $langs->trans('TimeRecordingRestrictedToNMonthsBack', $conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS); + $this->errors[] = $this->error; + return -1; + } + } + $this->db->begin(); $sql = "DELETE FROM ".MAIN_DB_PREFIX."projet_task_time"; From c62c668c68e9456cd36864de6ecbf3c5d95af2e0 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 9 Jun 2021 09:29:22 +0000 Subject: [PATCH 0488/1497] Fixing style errors. --- htdocs/projet/class/task.class.php | 54 +++++++++++++++--------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index f46869382a5..05ce98b8896 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -1158,16 +1158,16 @@ class Task extends CommonObject $this->timespent_datehour = $this->timespent_date; } - if (! empty($conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS)) { - require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; - $restrictBefore = dol_time_plus_duree(dol_now(), - $conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS, 'm'); + if (! empty($conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS)) { + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; + $restrictBefore = dol_time_plus_duree(dol_now(), - $conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS, 'm'); - if ($this->timespent_date < $restrictBefore) { - $this->error = $langs->trans('TimeRecordingRestrictedToNMonthsBack', $conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS); - $this->errors[] = $this->error; - return -1; - } - } + if ($this->timespent_date < $restrictBefore) { + $this->error = $langs->trans('TimeRecordingRestrictedToNMonthsBack', $conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS); + $this->errors[] = $this->error; + return -1; + } + } $this->db->begin(); @@ -1531,16 +1531,16 @@ class Task extends CommonObject $this->timespent_note = trim($this->timespent_note); } - if (! empty($conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS)) { - require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; - $restrictBefore = dol_time_plus_duree(dol_now(), - $conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS, 'm'); + if (! empty($conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS)) { + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; + $restrictBefore = dol_time_plus_duree(dol_now(), - $conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS, 'm'); - if ($this->timespent_date < $restrictBefore) { - $this->error = $langs->trans('TimeRecordingRestrictedToNMonthsBack', $conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS); - $this->errors[] = $this->error; - return -1; - } - } + if ($this->timespent_date < $restrictBefore) { + $this->error = $langs->trans('TimeRecordingRestrictedToNMonthsBack', $conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS); + $this->errors[] = $this->error; + return -1; + } + } $this->db->begin(); @@ -1608,16 +1608,16 @@ class Task extends CommonObject $error = 0; - if (! empty($conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS)) { - require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; - $restrictBefore = dol_time_plus_duree(dol_now(), - $conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS, 'm'); + if (! empty($conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS)) { + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; + $restrictBefore = dol_time_plus_duree(dol_now(), - $conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS, 'm'); - if ($this->timespent_date < $restrictBefore) { - $this->error = $langs->trans('TimeRecordingRestrictedToNMonthsBack', $conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS); - $this->errors[] = $this->error; - return -1; - } - } + if ($this->timespent_date < $restrictBefore) { + $this->error = $langs->trans('TimeRecordingRestrictedToNMonthsBack', $conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS); + $this->errors[] = $this->error; + return -1; + } + } $this->db->begin(); From 4b6fb7dd47eec16fba08c9e0da51d3ec1a974864 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Wed, 9 Jun 2021 12:26:28 +0200 Subject: [PATCH 0489/1497] FIX : auto rounding on "_FORMATED_" tags --- htdocs/core/lib/functions.lib.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 4d450768fe7..51b7442defe 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6453,11 +6453,11 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, if ($onlykey != 2 || $mysoc->useLocalTax(1)) $substitutionarray['__AMOUNT_TAX2__'] = is_object($object) ? $object->total_localtax1 : ''; if ($onlykey != 2 || $mysoc->useLocalTax(2)) $substitutionarray['__AMOUNT_TAX3__'] = is_object($object) ? $object->total_localtax2 : ''; - $substitutionarray['__AMOUNT_FORMATED__'] = is_object($object) ? ($object->total_ttc ? price($object->total_ttc, 0, $outputlangs, 0, 0, -1, $conf->currency) : null) : ''; - $substitutionarray['__AMOUNT_EXCL_TAX_FORMATED__'] = is_object($object) ? ($object->total_ht ? price($object->total_ht, 0, $outputlangs, 0, 0, -1, $conf->currency) : null) : ''; - $substitutionarray['__AMOUNT_VAT_FORMATED__'] = is_object($object) ? ($object->total_vat ? price($object->total_vat, 0, $outputlangs, 0, 0, -1, $conf->currency) : ($object->total_tva ? price($object->total_tva, 0, $outputlangs, 0, 0, -1, $conf->currency) : null)) : ''; - if ($onlykey != 2 || $mysoc->useLocalTax(1)) $substitutionarray['__AMOUNT_TAX2_FORMATED__'] = is_object($object) ? ($object->total_localtax1 ? price($object->total_localtax1, 0, $outputlangs, 0, 0, -1, $conf->currency) : null) : ''; - if ($onlykey != 2 || $mysoc->useLocalTax(2)) $substitutionarray['__AMOUNT_TAX3_FORMATED__'] = is_object($object) ? ($object->total_localtax2 ? price($object->total_localtax2, 0, $outputlangs, 0, 0, -1, $conf->currency) : null) : ''; + $substitutionarray['__AMOUNT_FORMATED__'] = is_object($object) ? ($object->total_ttc ? price($object->total_ttc, 0, $outputlangs, 0, -1, -1, $conf->currency) : null) : ''; + $substitutionarray['__AMOUNT_EXCL_TAX_FORMATED__'] = is_object($object) ? ($object->total_ht ? price($object->total_ht, 0, $outputlangs, 0, -1, -1, $conf->currency) : null) : ''; + $substitutionarray['__AMOUNT_VAT_FORMATED__'] = is_object($object) ? ($object->total_vat ? price($object->total_vat, 0, $outputlangs, 0, -1, -1, $conf->currency) : ($object->total_tva ? price($object->total_tva, 0, $outputlangs, 0, 0, -1, $conf->currency) : null)) : ''; + if ($onlykey != 2 || $mysoc->useLocalTax(1)) $substitutionarray['__AMOUNT_TAX2_FORMATED__'] = is_object($object) ? ($object->total_localtax1 ? price($object->total_localtax1, 0, $outputlangs, 0, -1, -1, $conf->currency) : null) : ''; + if ($onlykey != 2 || $mysoc->useLocalTax(2)) $substitutionarray['__AMOUNT_TAX3_FORMATED__'] = is_object($object) ? ($object->total_localtax2 ? price($object->total_localtax2, 0, $outputlangs, 0, -1, -1, $conf->currency) : null) : ''; // TODO Add keys for foreign multicurrency From 5d9aa40065c68cb5f837570b1d229f119ffeca81 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Wed, 9 Jun 2021 12:40:34 +0200 Subject: [PATCH 0490/1497] FIX: holiday list: bad right for mass deletion --- htdocs/holiday/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index 18df214f4c6..7e77ef45d35 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -381,7 +381,7 @@ if ($resql) //'builddoc'=>$langs->trans("PDFMerge"), //'presend'=>$langs->trans("SendByMail"), ); - if ($user->rights->holiday->supprimer) $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); + if ($user->rights->holiday->delete) $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); if (in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array(); $massactionbutton = $form->selectMassAction('', $arrayofmassactions); From c375668ab6d87612490377787ac5a233196ef11d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Jun 2021 12:41:53 +0200 Subject: [PATCH 0491/1497] Clean code --- htdocs/admin/system/security.php | 2 +- htdocs/core/lib/geturl.lib.php | 7 +++++-- test/phpunit/SecurityTest.php | 11 ++++++++--- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index e972581beaa..5214808985d 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -277,7 +277,7 @@ if ($conf->global->MAIN_SECURITY_HASH_ALGO != 'password_hash') { print '
    '; -print 'MAIN_SECURITY_ANTI_SSRF_SERVER_IP = '.(empty($conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP) ? ''.$langs->trans("Undefined").'' : $conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP)."
    "; +print 'MAIN_SECURITY_ANTI_SSRF_SERVER_IP = '.(empty($conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP) ? ''.$langs->trans("Undefined").'   ('.$langs->trans("Example").': static-ips-of-server - '.$langs->trans("Note").': common loopback ip like 127.*.*.*, [::1] are already added)' : $conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP)."
    "; print '
    '; print 'MAIN_ALLOW_SVG_FILES_AS_IMAGES = '.(empty($conf->global->MAIN_ALLOW_SVG_FILES_AS_IMAGES) ? '0   ('.$langs->trans("Recommanded").': 0)' : $conf->global->MAIN_ALLOW_SVG_FILES_AS_IMAGES)."
    "; diff --git a/htdocs/core/lib/geturl.lib.php b/htdocs/core/lib/geturl.lib.php index 9feddb6f7f5..f87e7b7b4cd 100644 --- a/htdocs/core/lib/geturl.lib.php +++ b/htdocs/core/lib/geturl.lib.php @@ -24,7 +24,9 @@ /** * Function to get a content from an URL (use proxy if proxy defined). * Support Dolibarr setup for timeout and proxy. - * Enhancement of CURL to add an anti SSRF protection. + * Enhancement of CURL to add an anti SSRF protection: + * - you can set MAIN_SECURITY_ANTI_SSRF_SERVER_IP to set static ip of server + * - common local lookup ips like 127.*.*.* are automatically added * * @param string $url URL to call. * @param string $postorget 'POST', 'GET', 'HEAD', 'PUT', 'PUTALREADYFORMATED', 'POSTALREADYFORMATED', 'DELETE' @@ -199,12 +201,13 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation = } } if ($localurl == 1) { // Only local url allowed (dangerous, may allow to get metadata on server or make internal port scanning) + // Deny ips NOT like 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 0.0.0.0/8, 169.254.0.0/16, 127.0.0.0/8 et 240.0.0.0/4, ::1/128, ::/128, ::ffff:0:0/96, fe80::/10... if (filter_var($iptocheck, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) { $info['http_code'] = 400; $info['content'] = 'Error bad hostname '.$iptocheck.'. Must be a local URL.'; break; } - if (!empty($conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP) && !in_array($iptocheck, explode(',', '127.0.0.1,::1,'.$conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP))) { + if (!empty($conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP) && !in_array($iptocheck, explode(',', $conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP))) { $info['http_code'] = 400; $info['content'] = 'Error bad hostname IP (IP is not a local IP defined into list MAIN_SECURITY_SERVER_IP). Must be a local URL in allowed list.'; break; diff --git a/test/phpunit/SecurityTest.php b/test/phpunit/SecurityTest.php index 944d4f4cbe5..f889a6c542b 100644 --- a/test/phpunit/SecurityTest.php +++ b/test/phpunit/SecurityTest.php @@ -703,17 +703,22 @@ class SecurityTest extends PHPUnit\Framework\TestCase $url = 'http://127.0.0.1'; $tmp = getURLContent($url, 'GET', '', 0, array(), array('http', 'https'), 0); // Only external URL print __METHOD__." url=".$url."\n"; - $this->assertEquals(400, $tmp['http_code'], 'GET url to '.$url.' that is a local URL'); // Test we receive an error because localtest.me is not an external URL + $this->assertEquals(400, $tmp['http_code'], 'GET url to '.$url.' that is a local URL'); // Test we receive an error because 127.0.0.1 is not an external URL + + $url = 'http://127.0.2.1'; + $tmp = getURLContent($url, 'GET', '', 0, array(), array('http', 'https'), 0); // Only external URL + print __METHOD__." url=".$url."\n"; + $this->assertEquals(400, $tmp['http_code'], 'GET url to '.$url.' that is a local URL'); // Test we receive an error because 127.0.2.1 is not an external URL $url = 'https://169.254.0.1'; $tmp = getURLContent($url, 'GET', '', 0, array(), array('http', 'https'), 0); // Only external URL print __METHOD__." url=".$url."\n"; - $this->assertEquals(400, $tmp['http_code'], 'GET url to '.$url.' that is a local URL'); // Test we receive an error because localtest.me is not an external URL + $this->assertEquals(400, $tmp['http_code'], 'GET url to '.$url.' that is a local URL'); // Test we receive an error because 169.254.0.1 is not an external URL $url = 'http://[::1]'; $tmp = getURLContent($url, 'GET', '', 0, array(), array('http', 'https'), 0); // Only external URL print __METHOD__." url=".$url."\n"; - $this->assertEquals(400, $tmp['http_code'], 'GET url to '.$url.' that is a local URL'); // Test we receive an error because localtest.me is not an external URL + $this->assertEquals(400, $tmp['http_code'], 'GET url to '.$url.' that is a local URL'); // Test we receive an error because [::1] is not an external URL /*$url = 'localtest.me'; $tmp = getURLContent($url, 'GET', '', 0, array(), array('http', 'https'), 0); // Only external URL From 14e3d04e25eceb52baafa43202f69759bf08717e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Jun 2021 13:02:17 +0200 Subject: [PATCH 0492/1497] Add more info on security page --- htdocs/admin/system/security.php | 14 ++++++++++++++ htdocs/langs/en_US/admin.lang | 6 ++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index 5214808985d..b076cd020be 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -245,8 +245,22 @@ if (empty($dolibarr_main_restrict_ip)) { print ''.$langs->trans("None").''; //print ' ('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("IPsOfUsers")).')'; } + print '
    '; +if (empty($conf->global->SECURITY_DISABLE_TEST_ON_OBFUSCATED_CONF)) { + print '$dolibarr_main_db_pass: '; + if (!empty($dolibarr_main_db_pass) && !preg_match('/^crypted:/', $dolibarr_main_db_pass)) { + print img_picto('', 'warning').' '.$langs->trans("DatabasePasswordNotObfuscated").'   ('.$langs->trans("Recommanded").': '.$langs->trans("SetOptionTo", $langs->transnoentitiesnoconv("MainDbPasswordFileConfEncrypted"), yn(1)).')'; + //print ' ('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("IPsOfUsers")).')'; + } else { + print img_picto('', 'tick').' '.$langs->trans(""); + } + + print '
    '; +} + + // Menu security diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index b7618f64739..5ae901dc7b2 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -221,8 +221,8 @@ NotCompatible=This module does not seem compatible with your Dolibarr %s (Min %s CompatibleAfterUpdate=This module requires an update to your Dolibarr %s (Min %s - Max %s). SeeInMarkerPlace=See in Market place SeeSetupOfModule=See setup of module %s +SetOptionTo=Set option %s to %s Updated=Updated -Nouveauté=Novelty AchatTelechargement=Buy / Download GoModuleSetupArea=To deploy/install a new module, go to the Module setup area: %s. DoliStoreDesc=DoliStore, the official market place for Dolibarr ERP/CRM external modules @@ -2141,4 +2141,6 @@ ModuleUpdateAvailable=An update is available NoExternalModuleWithUpdate=No updates found for external modules SwaggerDescriptionFile=Swagger API description file (for use with redoc for example) YouEnableDeprecatedWSAPIsUseRESTAPIsInstead=You enabled deprecated WS API. You should use REST API instead. -RandomlySelectedIfSeveral=Randomly selected if several pictures are available \ No newline at end of file +RandomlySelectedIfSeveral=Randomly selected if several pictures are available +DatabasePasswordObfuscated=Database password obfucated in conf file +DatabasePasswordNotObfuscated=Database password obfucated in conf file From a78d29bb710cd913c6de7853a4c3f1a35645b3a4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Jun 2021 13:05:32 +0200 Subject: [PATCH 0493/1497] Fix trans --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 5ae901dc7b2..2939d93b0c6 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1191,7 +1191,7 @@ SetupDescription4=%s -> %s

    This software is a suite of m SetupDescription5=Other Setup menu entries manage optional parameters. AuditedSecurityEvents=Security events that are audited NoSecurityEventsAreAduited=No security events are audited. You can enable them from menu %s -Audit=Audit +Audit=Security events InfoDolibarr=About Dolibarr InfoBrowser=About Browser InfoOS=About OS From 997674aebc8af3e4d3042096ff3f9ab8f86b82cc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Jun 2021 13:15:47 +0200 Subject: [PATCH 0494/1497] Fix trans --- htdocs/langs/en_US/admin.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 2939d93b0c6..ef97369f040 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2142,5 +2142,5 @@ NoExternalModuleWithUpdate=No updates found for external modules SwaggerDescriptionFile=Swagger API description file (for use with redoc for example) YouEnableDeprecatedWSAPIsUseRESTAPIsInstead=You enabled deprecated WS API. You should use REST API instead. RandomlySelectedIfSeveral=Randomly selected if several pictures are available -DatabasePasswordObfuscated=Database password obfucated in conf file -DatabasePasswordNotObfuscated=Database password obfucated in conf file +DatabasePasswordObfuscated=Database password is obfuscated in conf file +DatabasePasswordNotObfuscated=Database password is NOT obfuscated in conf file From 458ef9f8daacc73830ae7f481dc10e05a8682061 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Jun 2021 13:31:00 +0200 Subject: [PATCH 0495/1497] Fix security test --- htdocs/admin/system/security.php | 4 ++-- htdocs/filefunc.inc.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index b076cd020be..85ad40775d2 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -250,11 +250,11 @@ print '
    '; if (empty($conf->global->SECURITY_DISABLE_TEST_ON_OBFUSCATED_CONF)) { print '$dolibarr_main_db_pass: '; - if (!empty($dolibarr_main_db_pass) && !preg_match('/^crypted:/', $dolibarr_main_db_pass)) { + if (!empty($dolibarr_main_db_pass) && empty($dolibarr_main_db_encrypted_pass)) { print img_picto('', 'warning').' '.$langs->trans("DatabasePasswordNotObfuscated").'   ('.$langs->trans("Recommanded").': '.$langs->trans("SetOptionTo", $langs->transnoentitiesnoconv("MainDbPasswordFileConfEncrypted"), yn(1)).')'; //print ' ('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("IPsOfUsers")).')'; } else { - print img_picto('', 'tick').' '.$langs->trans(""); + print img_picto('', 'tick').' '.$langs->trans("DatabasePasswordObfuscated"); } print '
    '; diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 2c7795b9ac8..777fde21885 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -349,7 +349,7 @@ if ((!empty($dolibarr_main_db_pass) && preg_match('/crypted:/i', $dolibarr_main_ if (!empty($dolibarr_main_db_pass) && preg_match('/crypted:/i', $dolibarr_main_db_pass)) { $dolibarr_main_db_pass = preg_replace('/crypted:/i', '', $dolibarr_main_db_pass); $dolibarr_main_db_pass = dol_decode($dolibarr_main_db_pass); - $dolibarr_main_db_encrypted_pass = $dolibarr_main_db_pass; // We need to set this as it is used to know the password was initially crypted + $dolibarr_main_db_encrypted_pass = $dolibarr_main_db_pass; // We need to set this so we can use it later to know the password was initially crypted } else { $dolibarr_main_db_pass = dol_decode($dolibarr_main_db_encrypted_pass); } From e915e3403c8030d3dc8c98f064f309af09d966b9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Jun 2021 13:36:37 +0200 Subject: [PATCH 0496/1497] Trans --- htdocs/langs/fr_FR/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index e9b5ddf5c4e..ecaa4b6e600 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -1584,7 +1584,7 @@ NotInstalled=Non installé. NotSlowedDownByThis=Non ralenti par cela. NotRiskOfLeakWithThis=Pas de risque de fuite de données avec cela. ApplicativeCache=Cache applicatif -MemcachedNotAvailable=Aucun cache applicatif trouvé. Vous pouvez accélérer les performances de Dolibarr en installant un serveur de cache Memcached et un module de cache applicatif exploitant ce serveur.
    Plus d'info icihttps://wiki.dolibarr.org/index.php/Module_MemCached.
    Notez que de nombreux hébergeurs low-cost ne fournissent pas de tels serveurs de cache dans leur infrastructure. +MemcachedNotAvailable=Aucun cache applicatif trouvé. Vous pouvez accélérer les performances de Dolibarr en installant un serveur de cache Memcached et un module de cache applicatif exploitant ce serveur.
    Plus d'info ici https://wiki.dolibarr.org/index.php/Module_MemCached.
    Notez que de nombreux hébergeurs low-cost ne fournissent pas de tels serveurs de cache dans leur infrastructure. MemcachedModuleAvailableButNotSetup=Le module memcached pour le cache applicatif a été trouvé mais la configuration de ce module n'est pas complète. MemcachedAvailableAndSetup=Le module memcached dédié à l'utilisation du serveur de cache memcached est activé. OPCodeCache=Cache OPCode From d4ca6bf42a358b96982ce8f29adab250956ff1ab Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Jun 2021 13:56:03 +0200 Subject: [PATCH 0497/1497] Clean code --- htdocs/admin/system/security.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index 85ad40775d2..3e01a99cb61 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -228,7 +228,7 @@ print '
    '; print '
    '; print load_fiche_titre($langs->trans("ConfigurationFile").' ('.$conffile.')', '', 'folder'); -print '$dolibarr_main_prod: '.$dolibarr_main_prod; +print '$dolibarr_main_prod: '.($dolibarr_main_prod ? $dolibarr_main_prod : '0'); if (empty($dolibarr_main_prod)) { print '   '.img_picto('', 'warning').' '.$langs->trans("IfYouAreOnAProductionSetThis", 1); } From 0a23cf029d8460dea8c802ad0014e830d23c3b30 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Wed, 9 Jun 2021 14:13:50 +0200 Subject: [PATCH 0498/1497] using strlen instead of count --- htdocs/core/class/CSMSFile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/CSMSFile.class.php b/htdocs/core/class/CSMSFile.class.php index a02f00fbac9..1ea2434a27f 100644 --- a/htdocs/core/class/CSMSFile.class.php +++ b/htdocs/core/class/CSMSFile.class.php @@ -75,7 +75,7 @@ class CSMSFile return -1; } - dol_syslog("CSMSFile::CSMSFile: MAIN_SMS_SENDMODE=".$conf->global->MAIN_SMS_SENDMODE." charset=".$conf->file->character_set_client." from=".$from.", to=".$to.", msg length=".count($msg), LOG_DEBUG); + dol_syslog("CSMSFile::CSMSFile: MAIN_SMS_SENDMODE=".$conf->global->MAIN_SMS_SENDMODE." charset=".$conf->file->character_set_client." from=".$from.", to=".$to.", msg length=".strlen($msg), LOG_DEBUG); dol_syslog("CSMSFile::CSMSFile: deferred=".$deferred." priority=".$priority." class=".$class, LOG_DEBUG); // Action according to choosed sending method From fb46ece9061a87bc289e1998d234a559a5c32565 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Jun 2021 15:36:47 +0200 Subject: [PATCH 0499/1497] Fix yogosha 6347 --- htdocs/accountancy/admin/categories_list.php | 2 +- .../class/accountancycategory.class.php | 4 +- .../class/accountingaccount.class.php | 4 +- .../accountancy/class/bookkeeping.class.php | 4 +- htdocs/accountancy/journal/bankjournal.php | 2 +- htdocs/adherents/class/adherent.class.php | 6 +-- .../adherents/class/adherent_type.class.php | 2 +- htdocs/adherents/class/api_members.class.php | 6 +-- htdocs/adherents/class/subscription.class.php | 8 ++-- htdocs/api/class/api_setup.class.php | 10 ++-- htdocs/asset/class/asset_type.class.php | 4 +- htdocs/bom/class/bom.class.php | 4 +- htdocs/bookmarks/bookmarks.lib.php | 2 +- htdocs/bookmarks/list.php | 2 +- htdocs/categories/class/categorie.class.php | 6 +-- htdocs/comm/action/class/actioncomm.class.php | 4 +- htdocs/comm/action/index.php | 4 +- htdocs/comm/action/pertype.php | 2 +- htdocs/comm/action/peruser.php | 4 +- htdocs/comm/contact.php | 8 ---- htdocs/comm/propal/class/propal.class.php | 10 ++-- htdocs/comm/propal/index.php | 8 ++-- htdocs/comm/propal/list.php | 12 ++--- htdocs/comm/prospect/index.php | 8 ++-- htdocs/commande/class/commande.class.php | 10 ++-- htdocs/commande/customer.php | 3 -- htdocs/commande/index.php | 8 ++-- htdocs/commande/list.php | 2 +- htdocs/compta/bank/bankentries_list.php | 2 +- htdocs/compta/bank/class/account.class.php | 4 +- .../bank/class/api_bankaccounts.class.php | 2 +- htdocs/compta/bank/line.php | 2 +- htdocs/compta/bank/releve.php | 2 +- htdocs/compta/bank/various_payment/list.php | 10 ++-- htdocs/compta/clients.php | 20 +++----- .../facture/class/api_invoices.class.php | 2 +- .../facture/class/facture-rec.class.php | 16 +++---- htdocs/compta/facture/class/facture.class.php | 6 +-- htdocs/compta/facture/list.php | 12 ++--- htdocs/compta/index.php | 6 +-- .../compta/localtax/class/localtax.class.php | 2 +- htdocs/compta/localtax/index.php | 4 +- htdocs/compta/paiement/cheque/card.php | 2 +- htdocs/compta/paiement/cheque/list.php | 2 +- htdocs/compta/paiement/tovalidate.php | 2 +- .../class/bonprelevement.class.php | 2 +- .../class/rejetprelevement.class.php | 6 +-- htdocs/compta/prelevement/fiche-rejet.php | 6 +-- htdocs/compta/recap-compta.php | 2 +- htdocs/compta/resultat/clientfourn.php | 2 +- htdocs/compta/sociales/list.php | 6 +-- htdocs/compta/stats/cabyuser.php | 2 +- htdocs/compta/stats/index.php | 2 +- htdocs/compta/stats/supplier_turnover.php | 4 +- .../stats/supplier_turnover_by_thirdparty.php | 2 +- htdocs/compta/tva/class/tva.class.php | 2 +- htdocs/compta/tva/list.php | 6 +-- htdocs/contact/class/contact.class.php | 16 +++---- htdocs/contact/list.php | 12 ++--- htdocs/contrat/class/contrat.class.php | 8 ++-- htdocs/contrat/index.php | 2 +- htdocs/contrat/list.php | 8 ++-- htdocs/contrat/services_list.php | 2 +- htdocs/core/class/commonobject.class.php | 26 +++++----- htdocs/core/class/discount.class.php | 2 +- htdocs/core/class/extrafields.class.php | 6 +-- htdocs/core/class/html.form.class.php | 12 ++--- .../core/class/html.formaccounting.class.php | 2 +- .../class/html.formintervention.class.php | 4 +- htdocs/core/class/html.formmail.class.php | 6 +-- .../class/html.formsocialcontrib.class.php | 2 +- htdocs/core/class/infobox.class.php | 8 ++-- htdocs/core/class/menubase.class.php | 4 +- htdocs/core/class/notify.class.php | 10 ++-- htdocs/core/lib/agenda.lib.php | 4 +- htdocs/core/lib/company.lib.php | 8 ++-- htdocs/core/lib/fourn.lib.php | 2 +- htdocs/core/lib/invoice.lib.php | 8 ++-- htdocs/core/lib/sendings.lib.php | 2 +- htdocs/core/lib/ticket.lib.php | 2 +- htdocs/core/lib/usergroups.lib.php | 2 +- htdocs/core/modules/DolibarrModules.class.php | 6 +-- .../core/modules/mailings/pomme.modules.php | 2 +- .../modules/mailings/thirdparties.modules.php | 6 +-- .../thirdparties_services_expired.modules.php | 2 +- .../movement/doc/pdf_standard.modules.php | 4 +- .../doc/doc_generic_project_odt.modules.php | 2 +- .../task/doc/doc_generic_task_odt.modules.php | 2 +- .../modules/rapport/pdf_paiement.class.php | 2 +- .../stock/doc/pdf_standard.modules.php | 2 +- .../class/actions_datapolicy.class.php | 2 +- htdocs/don/class/api_donations.class.php | 2 +- htdocs/don/class/don.class.php | 8 ++-- htdocs/ecm/class/ecmfiles.class.php | 2 +- .../conferenceorboothattendee_list.php | 2 +- htdocs/expedition/card.php | 2 +- .../expedition/class/api_shipments.class.php | 2 +- htdocs/expedition/class/expedition.class.php | 6 +-- .../class/expeditionbatch.class.php | 2 +- htdocs/expedition/list.php | 8 ++-- htdocs/expedition/shipment.php | 2 +- .../class/expensereport.class.php | 28 +++++------ htdocs/fichinter/card-rec.php | 2 +- htdocs/fichinter/class/fichinter.class.php | 4 +- .../class/api_supplier_invoices.class.php | 2 +- .../fourn/class/api_supplier_orders.class.php | 2 +- .../class/fournisseur.commande.class.php | 2 +- .../fourn/class/fournisseur.facture.class.php | 12 ++--- .../fourn/class/fournisseur.product.class.php | 8 ++-- htdocs/fourn/commande/index.php | 6 +-- htdocs/fourn/commande/list.php | 8 ++-- htdocs/fourn/contact.php | 2 +- htdocs/fourn/facture/list.php | 4 +- htdocs/fourn/index.php | 4 +- htdocs/fourn/product/list.php | 4 +- htdocs/fourn/recap-fourn.php | 2 +- htdocs/holiday/class/holiday.class.php | 4 +- htdocs/hrm/class/establishment.class.php | 8 ++-- htdocs/hrm/index.php | 4 +- htdocs/install/upgrade2.php | 18 +++---- htdocs/intracommreport/list.php | 4 +- .../knowledgemanagementindex.php | 2 +- htdocs/loan/class/loan.class.php | 6 +-- htdocs/margin/agentMargins.php | 4 +- htdocs/margin/tabs/productMargins.php | 2 +- .../template/class/api_mymodule.class.php | 4 +- .../modulebuilder/template/mymoduleindex.php | 2 +- htdocs/mrp/class/api_mos.class.php | 4 +- .../class/opensurveysondage.class.php | 6 +-- .../class/partnershiputils.class.php | 4 +- htdocs/partnership/partnershipindex.php | 2 +- htdocs/product/ajax/products.php | 4 +- .../product/actions_card_product.class.php | 8 ++-- .../service/actions_card_service.class.php | 18 +++---- htdocs/product/class/api_products.class.php | 4 +- htdocs/product/class/product.class.php | 48 +++++++++---------- htdocs/product/class/productbatch.class.php | 6 +-- .../class/propalmergepdfproduct.class.php | 4 +- .../class/price_global_variable.class.php | 2 +- .../price_global_variable_updater.class.php | 8 ++-- htdocs/product/index.php | 6 +-- htdocs/product/list.php | 2 +- htdocs/product/popuprop.php | 2 +- htdocs/product/reassort.php | 2 +- htdocs/product/reassortlot.php | 2 +- htdocs/product/stats/bom.php | 7 ++- htdocs/product/stats/commande.php | 4 +- htdocs/product/stats/commande_fournisseur.php | 4 +- htdocs/product/stats/contrat.php | 2 +- htdocs/product/stats/facture.php | 2 +- htdocs/product/stats/facture_fournisseur.php | 2 +- htdocs/product/stats/mo.php | 2 +- htdocs/product/stats/propal.php | 2 +- htdocs/product/stats/supplier_proposal.php | 2 +- htdocs/product/stock/card.php | 2 +- htdocs/product/stock/class/entrepot.class.php | 6 +-- htdocs/product/stock/product.php | 2 +- htdocs/product/stock/stockatdate.php | 4 +- htdocs/projet/activity/index.php | 2 +- htdocs/projet/class/api_projects.class.php | 2 +- htdocs/projet/class/project.class.php | 20 ++++---- htdocs/projet/class/projectstats.class.php | 4 +- htdocs/projet/class/task.class.php | 14 +++--- htdocs/projet/index.php | 2 +- htdocs/projet/list.php | 6 +-- htdocs/projet/tasks/list.php | 9 +--- htdocs/projet/tasks/time.php | 2 +- .../public/emailing/mailing-unsubscribe.php | 2 +- htdocs/reception/card.php | 4 +- htdocs/reception/index.php | 6 +-- htdocs/reception/list.php | 4 +- htdocs/recruitment/recruitmentindex.php | 2 +- htdocs/resource/class/dolresource.class.php | 6 +-- htdocs/salaries/class/salary.class.php | 6 +-- htdocs/salaries/list.php | 4 +- htdocs/salaries/payments.php | 2 +- htdocs/societe/class/api_contacts.class.php | 2 +- .../societe/class/api_thirdparties.class.php | 6 +-- .../class/companybankaccount.class.php | 4 +- htdocs/societe/class/societe.class.php | 8 ++-- htdocs/societe/list.php | 10 ++-- htdocs/societe/notify/card.php | 12 ++--- htdocs/societe/paymentmodes.php | 4 +- .../class/supplier_proposal.class.php | 6 +-- htdocs/supplier_proposal/index.php | 4 +- htdocs/supplier_proposal/list.php | 2 +- htdocs/takepos/floors.php | 2 +- htdocs/takepos/invoice.php | 2 +- htdocs/ticket/class/api_tickets.class.php | 4 +- htdocs/ticket/class/ticket.class.php | 5 +- htdocs/user/class/api_users.class.php | 2 +- htdocs/user/class/user.class.php | 6 +-- htdocs/user/class/usergroup.class.php | 12 ++--- htdocs/user/list.php | 2 +- htdocs/webservices/server_invoice.php | 2 +- htdocs/webservices/server_order.php | 2 +- .../webservices/server_productorservice.php | 6 +-- .../webservices/server_supplier_invoice.php | 2 +- htdocs/webservices/server_thirdparty.php | 6 +-- 199 files changed, 507 insertions(+), 533 deletions(-) diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index c5091ef4207..9a8a84893fe 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -444,7 +444,7 @@ if ($search_country_id > 0) { } else { $sql .= " WHERE "; } - $sql .= " (a.fk_country = ".$search_country_id." OR a.fk_country = 0)"; + $sql .= " (a.fk_country = ".((int) $search_country_id)." OR a.fk_country = 0)"; } // If sort order is "country", we use country_code instead diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index d8e1598d1ac..aa200c770e4 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -675,7 +675,7 @@ class AccountancyCategory // extends CommonObject $sql .= " FROM ".MAIN_DB_PREFIX."c_accounting_category as c"; $sql .= " WHERE c.active = 1"; $sql .= " AND c.entity = ".$conf->entity; - $sql .= " AND (c.fk_country = ".$mysoc->country_id." OR c.fk_country = 0)"; + $sql .= " AND (c.fk_country = ".((int) $mysoc->country_id)." OR c.fk_country = 0)"; $sql .= " AND cat.rowid = t.fk_accounting_category"; $sql .= " AND t.entity = ".$conf->entity; $sql .= " ORDER BY cat.position ASC"; @@ -806,7 +806,7 @@ class AccountancyCategory // extends CommonObject if ($categorytype >= 0) { $sql .= " AND c.category_type = 1"; } - $sql .= " AND (c.fk_country = ".$mysoc->country_id." OR c.fk_country = 0)"; + $sql .= " AND (c.fk_country = ".((int) $mysoc->country_id)." OR c.fk_country = 0)"; $sql .= " ORDER BY c.position ASC"; $resql = $this->db->query($sql); diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 28601380ac1..99a0dc0dc48 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -602,7 +602,7 @@ class AccountingAccount extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."accounting_account "; $sql .= "SET ".$fieldtouse." = '0'"; - $sql .= " WHERE rowid = ".$this->db->escape($id); + $sql .= " WHERE rowid = ".((int) $id); dol_syslog(get_class($this)."::accountDeactivate ".$fieldtouse." sql=".$sql, LOG_DEBUG); $result = $this->db->query($sql); @@ -640,7 +640,7 @@ class AccountingAccount extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."accounting_account"; $sql .= " SET ".$fieldtouse." = '1'"; - $sql .= " WHERE rowid = ".$this->db->escape($id); + $sql .= " WHERE rowid = ".((int) $id); dol_syslog(get_class($this)."::account_activate ".$fieldtouse." sql=".$sql, LOG_DEBUG); $result = $this->db->query($sql); diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 3594bb26fc8..97ad7767be5 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -294,7 +294,7 @@ class BookKeeping extends CommonObject $sql = "SELECT count(*) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element; $sql .= " WHERE doc_type = '".$this->db->escape($this->doc_type)."'"; - $sql .= " AND fk_doc = ".$this->fk_doc; + $sql .= " AND fk_doc = ".((int) $this->fk_doc); if (!empty($conf->global->ACCOUNTANCY_ENABLE_FKDOCDET)) { // DO NOT USE THIS IN PRODUCTION. This will generate a lot of trouble into reports and will corrupt database (by generating duplicate entries. $sql .= " AND fk_docdet = " . $this->fk_docdet; // This field can be 0 if record is for several lines @@ -312,7 +312,7 @@ class BookKeeping extends CommonObject $sqlnum = "SELECT piece_num"; $sqlnum .= " FROM ".MAIN_DB_PREFIX.$this->table_element; $sqlnum .= " WHERE doc_type = '".$this->db->escape($this->doc_type)."'"; // For example doc_type = 'bank' - $sqlnum .= " AND fk_doc = ".$this->fk_doc; + $sqlnum .= " AND fk_doc = ".((int) $this->fk_doc); if (!empty($conf->global->ACCOUNTANCY_ENABLE_FKDOCDET)) { // fk_docdet is rowid into llx_bank or llx_facturedet or llx_facturefourndet, or ... $sqlnum .= " AND fk_docdet = ".((int) $this->fk_docdet); diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 76984d55fba..32670b15575 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -1320,7 +1320,7 @@ function getSourceDocRef($val, $typerecord) if ($typerecord == 'payment') { $sqlmid = 'SELECT payfac.fk_facture as id, f.ref as ref'; $sqlmid .= " FROM ".MAIN_DB_PREFIX."paiement_facture as payfac, ".MAIN_DB_PREFIX."facture as f"; - $sqlmid .= " WHERE payfac.fk_facture = f.rowid AND payfac.fk_paiement=".$val["paymentid"]; + $sqlmid .= " WHERE payfac.fk_facture = f.rowid AND payfac.fk_paiement=".((int) $val["paymentid"]); $ref = $langs->transnoentitiesnoconv("Invoice"); } elseif ($typerecord == 'payment_supplier') { $sqlmid = 'SELECT payfac.fk_facturefourn as id, f.ref'; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 4c0c602cbc1..91f01d19f89 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -598,8 +598,8 @@ class Adherent extends CommonObject if ($this->user_id) { // Add link to user $sql = "UPDATE ".MAIN_DB_PREFIX."user SET"; - $sql .= " fk_member = ".$this->id; - $sql .= " WHERE rowid = ".$this->user_id; + $sql .= " fk_member = ".((int) $this->id); + $sql .= " WHERE rowid = ".((int) $this->user_id); dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql = $this->db->query($sql); if (!$resql) { @@ -728,7 +728,7 @@ class Adherent extends CommonObject if (!empty($this->oldcopy) && $this->typeid != $this->oldcopy->typeid) { $sql2 = "SELECT libelle as label"; $sql2 .= " FROM ".MAIN_DB_PREFIX."adherent_type"; - $sql2 .= " WHERE rowid = ".$this->typeid; + $sql2 .= " WHERE rowid = ".((int) $this->typeid); $resql2 = $this->db->query($sql2); if ($resql2) { while ($obj = $this->db->fetch_object($resql2)) { diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 0104f8f36e8..1cb9fcdb12c 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -362,7 +362,7 @@ class AdherentType extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."adherent_type "; $sql .= "SET "; - $sql .= "statut = ".$this->status.","; + $sql .= "statut = ".((int) $this->status).","; $sql .= "libelle = '".$this->db->escape($this->label)."',"; $sql .= "morphy = '".$this->db->escape($this->morphy)."',"; $sql .= "subscription = '".$this->db->escape($this->subscription)."',"; diff --git a/htdocs/adherents/class/api_members.class.php b/htdocs/adherents/class/api_members.class.php index 5573961456f..d57a01510d4 100644 --- a/htdocs/adherents/class/api_members.class.php +++ b/htdocs/adherents/class/api_members.class.php @@ -228,12 +228,12 @@ class Members extends DolibarrApi } $sql .= ' WHERE t.entity IN ('.getEntity('adherent').')'; if (!empty($typeid)) { - $sql .= ' AND t.fk_adherent_type='.$typeid; + $sql .= ' AND t.fk_adherent_type='.((int) $typeid); } // Select members of given category if ($category > 0) { - $sql .= " AND c.fk_categorie = ".$this->db->escape($category); - $sql .= " AND c.fk_member = t.rowid "; + $sql .= " AND c.fk_categorie = ".((int) $category); + $sql .= " AND c.fk_member = t.rowid"; } // Add sql filters if ($sqlfilters) { diff --git a/htdocs/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php index 1285b12b2d0..bb5cdd20bd5 100644 --- a/htdocs/adherents/class/subscription.class.php +++ b/htdocs/adherents/class/subscription.class.php @@ -267,14 +267,14 @@ class Subscription extends CommonObject } $sql = "UPDATE ".MAIN_DB_PREFIX."subscription SET "; - $sql .= " fk_type = ".$this->fk_type.","; - $sql .= " fk_adherent = ".$this->fk_adherent.","; + $sql .= " fk_type = ".((int) $this->fk_type).","; + $sql .= " fk_adherent = ".((int) $this->fk_adherent).","; $sql .= " note=".($this->note ? "'".$this->db->escape($this->note)."'" : 'null').","; $sql .= " subscription = ".price2num($this->amount).","; $sql .= " dateadh='".$this->db->idate($this->dateh)."',"; $sql .= " datef='".$this->db->idate($this->datef)."',"; $sql .= " datec='".$this->db->idate($this->datec)."',"; - $sql .= " fk_bank = ".($this->fk_bank ? $this->fk_bank : 'null'); + $sql .= " fk_bank = ".($this->fk_bank ? ((int) $this->fk_bank) : 'null'); $sql .= " WHERE rowid = ".$this->id; dol_syslog(get_class($this)."::update", LOG_DEBUG); @@ -341,7 +341,7 @@ class Subscription extends CommonObject } if (!$error) { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."subscription WHERE rowid = ".$this->id; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."subscription WHERE rowid = ".((int) $this->id); dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index 15d31140874..1f59762c865 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -200,7 +200,7 @@ class Setup extends DolibarrApi $sql = "SELECT id, code, type, libelle as label, module"; $sql .= " FROM ".MAIN_DB_PREFIX."c_paiement as t"; $sql .= " WHERE t.entity IN (".getEntity('c_paiement').")"; - $sql .= " AND t.active = ".$active; + $sql .= " AND t.active = ".((int) $active); // Add sql filters if ($sqlfilters) { if (!DolibarrApi::_checkFilters($sqlfilters)) { @@ -1055,7 +1055,7 @@ class Setup extends DolibarrApi $sql = "SELECT rowid AS id, zip, town, fk_county, fk_pays AS fk_country"; $sql .= " FROM ".MAIN_DB_PREFIX."c_ziptown as t"; - $sql .= " AND t.active = ".$active; + $sql .= " AND t.active = ".((int) $active); if ($zipcode) { $sql .= " AND t.zip LIKE '%".$this->db->escape($zipcode)."%'"; } @@ -1125,7 +1125,7 @@ class Setup extends DolibarrApi $sql = "SELECT rowid as id, code, sortorder, libelle as label, libelle_facture as descr, type_cdr, nbjour, decalage, module"; $sql .= " FROM ".MAIN_DB_PREFIX."c_payment_term as t"; $sql .= " WHERE t.entity IN (".getEntity('c_payment_term').")"; - $sql .= " AND t.active = ".$active; + $sql .= " AND t.active = ".((int) $active); // Add sql filters if ($sqlfilters) { if (!DolibarrApi::_checkFilters($sqlfilters)) { @@ -1183,7 +1183,7 @@ class Setup extends DolibarrApi $sql = "SELECT rowid as id, code, libelle as label, description, tracking, module"; $sql .= " FROM ".MAIN_DB_PREFIX."c_shipment_mode as t"; $sql .= " WHERE t.entity IN (".getEntity('c_shipment_mode').")"; - $sql .= " AND t.active = ".$active; + $sql .= " AND t.active = ".((int) $active); // Add sql filters if ($sqlfilters) { if (!DolibarrApi::_checkFilters($sqlfilters)) { @@ -1307,7 +1307,7 @@ class Setup extends DolibarrApi $sql = "SELECT t.rowid, t.entity, t.code, t.label, t.url, t.icon, t.active"; $sql .= " FROM ".MAIN_DB_PREFIX."c_socialnetworks as t"; $sql .= " WHERE t.entity IN (".getEntity('c_socialnetworks').")"; - $sql .= " AND t.active = ".$active; + $sql .= " AND t.active = ".((int) $active); // Add sql filters if ($sqlfilters) { if (!DolibarrApi::_checkFilters($sqlfilters)) { diff --git a/htdocs/asset/class/asset_type.class.php b/htdocs/asset/class/asset_type.class.php index 36c654c28ba..335cd63115a 100644 --- a/htdocs/asset/class/asset_type.class.php +++ b/htdocs/asset/class/asset_type.class.php @@ -332,7 +332,7 @@ class AssetType extends CommonObject /** * Return array of Asset objects for asset type this->id (or all if this->id not defined) * - * @param string $excludefilter Filter to exclude. This parameter must not be provided by input of users + * @param string $excludefilter Filter string to exclude. This parameter must not be provided by input of users * @param int $mode 0=Return array of asset instance * 1=Return array of asset instance without extra data * 2=Return array of asset id only @@ -347,7 +347,7 @@ class AssetType extends CommonObject $sql = "SELECT a.rowid"; $sql .= " FROM ".MAIN_DB_PREFIX."asset as a"; $sql .= " WHERE a.entity IN (".getEntity('asset').")"; - $sql .= " AND a.fk_asset_type = ".$this->id; + $sql .= " AND a.fk_asset_type = ".((int) $this->id); if (!empty($excludefilter)) { $sql .= ' AND ('.$excludefilter.')'; } diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 220c724ad89..728bdef6cf6 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -614,8 +614,8 @@ class BOM extends CommonObject $sql .= " SET ref = '".$this->db->escape($num)."',"; $sql .= " status = ".self::STATUS_VALIDATED.","; $sql .= " date_valid='".$this->db->idate($now)."',"; - $sql .= " fk_user_valid = ".$user->id; - $sql .= " WHERE rowid = ".$this->id; + $sql .= " fk_user_valid = ".((int) $user->id); + $sql .= " WHERE rowid = ".((int) $this->id); dol_syslog(get_class($this)."::validate()", LOG_DEBUG); $resql = $this->db->query($sql); diff --git a/htdocs/bookmarks/bookmarks.lib.php b/htdocs/bookmarks/bookmarks.lib.php index 199944165b4..a977ae57fbc 100644 --- a/htdocs/bookmarks/bookmarks.lib.php +++ b/htdocs/bookmarks/bookmarks.lib.php @@ -80,7 +80,7 @@ function printDropdownBookmarksList() // Menu with list of bookmarks $sql = "SELECT rowid, title, url, target FROM ".MAIN_DB_PREFIX."bookmark"; - $sql .= " WHERE (fk_user = ".$user->id." OR fk_user is NULL OR fk_user = 0)"; + $sql .= " WHERE (fk_user = ".((int) $user->id)." OR fk_user is NULL OR fk_user = 0)"; $sql .= " AND entity IN (".getEntity('bookmarks').")"; $sql .= " ORDER BY position"; if ($resql = $db->query($sql)) { diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php index 7d644d3a103..17be6be9cef 100644 --- a/htdocs/bookmarks/list.php +++ b/htdocs/bookmarks/list.php @@ -98,7 +98,7 @@ $sql .= " FROM ".MAIN_DB_PREFIX."bookmark as b LEFT JOIN ".MAIN_DB_PREFIX."user $sql .= " WHERE 1=1"; $sql .= " AND b.entity IN (".getEntity('bookmark').")"; if (!$user->admin) { - $sql .= " AND (b.fk_user = ".$user->id." OR b.fk_user is NULL OR b.fk_user = 0)"; + $sql .= " AND (b.fk_user = ".((int) $user->id)." OR b.fk_user is NULL OR b.fk_user = 0)"; } $sql .= $db->order($sortfield.", position", $sortorder); diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 5f30a96c9c1..b98cff5b3a5 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -774,7 +774,7 @@ class Categorie extends CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_".(empty($this->MAP_CAT_TABLE[$type]) ? $type : $this->MAP_CAT_TABLE[$type]); $sql .= " WHERE fk_categorie = ".$this->id; - $sql .= " AND fk_".(empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type])." = ".$obj->id; + $sql .= " AND fk_".(empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type])." = ".((int) $obj->id); dol_syslog(get_class($this).'::del_type', LOG_DEBUG); if ($this->db->query($sql)) { @@ -1303,7 +1303,7 @@ class Categorie extends CommonObject $sql .= " FROM ".MAIN_DB_PREFIX."categorie as c "; $sql .= " WHERE c.entity IN (".getEntity('category').")"; $sql .= " AND c.type = ".((int) $type); - $sql .= " AND c.fk_parent = ".$this->fk_parent; + $sql .= " AND c.fk_parent = ".((int) $this->fk_parent); $sql .= " AND c.label = '".$this->db->escape($this->label)."'"; dol_syslog(get_class($this)."::already_exists", LOG_DEBUG); @@ -1552,7 +1552,7 @@ class Categorie extends CommonObject // Generation requete recherche $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."categorie"; - $sql .= " WHERE type = ".$this->MAP_ID[$type]; + $sql .= " WHERE type = ".((int) $this->MAP_ID[$type]); $sql .= " AND entity IN (".getEntity('category').")"; if ($nom) { if (!$exact) { diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 3943a37e5a7..38acaac0fc9 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1896,7 +1896,7 @@ class ActionComm extends CommonObject $userforfilter = new User($this->db); $result = $userforfilter->fetch('', $logint); if ($result > 0) { - $sql .= " AND ar.fk_element = ".$userforfilter->id; + $sql .= " AND ar.fk_element = ".((int) $userforfilter->id); } elseif ($result < 0 || $condition == '=') { $sql .= " AND ar.fk_element = 0"; } @@ -2410,7 +2410,7 @@ class ActionComm extends CommonObject // Delete also very old past events (we do not keep more than 1 month record in past) $sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm_reminder"; $sql .= " WHERE dateremind < '".$this->db->idate($now - (3600 * 24 * 32))."'"; - $sql .= " AND status = ".$actionCommReminder::STATUS_DONE; + $sql .= " AND status = ".((int) $actionCommReminder::STATUS_DONE); $resql = $this->db->query($sql); if (!$resql) { diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 459ede423b1..465f1be8701 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -741,10 +741,10 @@ if ($status == 'todo') { if ($filtert > 0 || $usergroup > 0) { $sql .= " AND ("; if ($filtert > 0) { - $sql .= "ar.fk_element = ".$filtert; + $sql .= "ar.fk_element = ".((int) $filtert); } if ($usergroup > 0) { - $sql .= ($filtert > 0 ? " OR " : "")." ugu.fk_usergroup = ".$usergroup; + $sql .= ($filtert > 0 ? " OR " : "")." ugu.fk_usergroup = ".((int) $usergroup); } $sql .= ")"; } diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index 32eaccdcce1..b39d6c3141d 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -616,7 +616,7 @@ if ($filtert > 0 || $usergroup > 0) { $sql .= "ar.fk_element = ".$filtert; } if ($usergroup > 0) { - $sql .= ($filtert > 0 ? " OR " : "")." ugu.fk_usergroup = ".$usergroup; + $sql .= ($filtert > 0 ? " OR " : "")." ugu.fk_usergroup = ".((int) $usergroup); } $sql .= ")"; } diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 76330d39453..10d9871c4c9 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -637,7 +637,7 @@ if ($filtert > 0 || $usergroup > 0) { $sql .= "ar.fk_element = ".$filtert; } if ($usergroup > 0) { - $sql .= ($filtert > 0 ? " OR " : "")." ugu.fk_usergroup = ".$usergroup; + $sql .= ($filtert > 0 ? " OR " : "")." ugu.fk_usergroup = ".((int) $usergroup); } $sql .= ")"; } @@ -899,7 +899,7 @@ while ($currentdaytoshow < $lastdaytoshow) { } $sql .= " WHERE u.statut = 1 AND u.entity IN (".getEntity('user').")"; if ($usergroup > 0) { - $sql .= " AND ug.fk_usergroup = ".$usergroup; + $sql .= " AND ug.fk_usergroup = ".((int) $usergroup); } //print $sql; $resql = $db->query($sql); diff --git a/htdocs/comm/contact.php b/htdocs/comm/contact.php index 9945ca0e186..1d74cba61cd 100644 --- a/htdocs/comm/contact.php +++ b/htdocs/comm/contact.php @@ -104,23 +104,15 @@ if ($type == "f") { if ($socid) { $sql .= " AND s.rowid = ".((int) $socid); } - -if (dol_strlen($stcomm)) { - $sql .= " AND s.fk_stcomm=".$db->escape($stcomm); -} - if (!empty($search_lastname)) { $sql .= " AND p.name LIKE '%".$db->escape($search_lastname)."%'"; } - if (!empty($search_firstname)) { $sql .= " AND p.firstname LIKE '%".$db->escape($search_firstname)."%'"; } - if (!empty($search_company)) { $sql .= " AND s.nom LIKE '%".$db->escape($search_company)."%'"; } - if (!empty($contactname)) { // acces a partir du module de recherche $sql .= " AND (p.name LIKE '%".$db->escape($contactname)."%' OR lower(p.firstname) LIKE '%".$db->escape($contactname)."%') "; $sortfield = "p.name"; diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index c544f5f7fe9..6c670c82364 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -2463,12 +2463,12 @@ class Propal extends CommonObject $error = 0; $sql = "UPDATE ".MAIN_DB_PREFIX."propal"; - $sql .= " SET fk_statut = ".$status.","; + $sql .= " SET fk_statut = ".((int) $status).","; if (!empty($note)) { $sql .= " note_private = '".$this->db->escape($note)."',"; } $sql .= " date_cloture=NULL, fk_user_cloture=NULL"; - $sql .= " WHERE rowid = ".$this->id; + $sql .= " WHERE rowid = ".((int) $this->id); $this->db->begin(); @@ -4305,7 +4305,7 @@ class PropaleLigne extends CommonObjectLine } $sql .= ", fk_parent_line=".($this->fk_parent_line > 0 ? $this->fk_parent_line : "null"); if (!empty($this->rang)) { - $sql .= ", rang=".$this->rang; + $sql .= ", rang=".((int) $this->rang); } $sql .= ", date_start=".(!empty($this->date_start) ? "'".$this->db->idate($this->date_start)."'" : "null"); $sql .= ", date_end=".(!empty($this->date_end) ? "'".$this->db->idate($this->date_end)."'" : "null"); @@ -4317,7 +4317,7 @@ class PropaleLigne extends CommonObjectLine $sql .= ", multicurrency_total_tva=".price2num($this->multicurrency_total_tva).""; $sql .= ", multicurrency_total_ttc=".price2num($this->multicurrency_total_ttc).""; - $sql .= " WHERE rowid = ".$this->id; + $sql .= " WHERE rowid = ".((int) $this->id); dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); @@ -4365,7 +4365,7 @@ class PropaleLigne extends CommonObjectLine $sql .= " total_ht=".price2num($this->total_ht, 'MT').""; $sql .= ",total_tva=".price2num($this->total_tva, 'MT').""; $sql .= ",total_ttc=".price2num($this->total_ttc, 'MT').""; - $sql .= " WHERE rowid = ".$this->rowid; + $sql .= " WHERE rowid = ".((int) $this->rowid); dol_syslog("PropaleLigne::update_total", LOG_DEBUG); diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index 3973071d1f0..7ff3e405499 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -88,7 +88,7 @@ if (!empty($conf->propal->enabled)) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($socid) { - $sql .= " AND p.fk_soc = ".$socid; + $sql .= " AND p.fk_soc = ".((int) $socid); } $resql = $db->query($sql); @@ -160,7 +160,7 @@ $sql .= " WHERE c.entity IN (".getEntity($propalstatic->element).")"; $sql .= " AND c.fk_soc = s.rowid"; //$sql.= " AND c.fk_statut > 2"; if ($socid) { - $sql .= " AND c.fk_soc = ".$socid; + $sql .= " AND c.fk_soc = ".((int) $socid); } if (!$user->rights->societe->client->voir && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; @@ -318,7 +318,7 @@ if (! empty($conf->propal->enabled)) $sql.= " WHERE c.fk_soc = s.rowid"; $sql.= " AND c.entity = ".$conf->entity; $sql.= " AND c.fk_statut = 1"; - if ($socid) $sql.= " AND c.fk_soc = ".$socid; + if ($socid) $sql.= " AND c.fk_soc = ".((int) $socid); if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; $sql.= " ORDER BY c.rowid DESC"; @@ -393,7 +393,7 @@ if (! empty($conf->propal->enabled)) $sql.= " WHERE c.fk_soc = s.rowid"; $sql.= " AND c.entity = ".$conf->entity; $sql.= " AND c.fk_statut = 2 "; - if ($socid) $sql.= " AND c.fk_soc = ".$socid; + if ($socid) $sql.= " AND c.fk_soc = ".((int) $socid); if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; $sql.= " ORDER BY c.rowid DESC"; diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index ceb945d1e72..95d461eac39 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -593,27 +593,27 @@ if ($sall) { $sql .= natural_search(array_keys($fieldstosearchall), $sall); } if ($search_categ_cus > 0) { - $sql .= " AND cc.fk_categorie = ".$db->escape($search_categ_cus); + $sql .= " AND cc.fk_categorie = ".((int) $search_categ_cus); } if ($search_categ_cus == -2) { $sql .= " AND cc.fk_categorie IS NULL"; } if ($search_fk_cond_reglement > 0) { - $sql .= " AND p.fk_cond_reglement = ".$db->escape($search_fk_cond_reglement); + $sql .= " AND p.fk_cond_reglement = ".((int) $search_fk_cond_reglement); } if ($search_fk_shipping_method > 0) { - $sql .= " AND p.fk_shipping_method = ".$db->escape($search_fk_shipping_method); + $sql .= " AND p.fk_shipping_method = ".((int) $search_fk_shipping_method); } if ($search_fk_input_reason > 0) { - $sql .= " AND p.fk_input_reason = ".$db->escape($search_fk_input_reason); + $sql .= " AND p.fk_input_reason = ".((int) $search_fk_input_reason); } if ($search_fk_mode_reglement > 0) { - $sql .= " AND p.fk_mode_reglement = ".$db->escape($search_fk_mode_reglement); + $sql .= " AND p.fk_mode_reglement = ".((int) $search_fk_mode_reglement); } if ($search_product_category > 0) { - $sql .= " AND cp.fk_categorie = ".$db->escape($search_product_category); + $sql .= " AND cp.fk_categorie = ".((int) $search_product_category); } if ($socid > 0) { $sql .= ' AND s.rowid = '.((int) $socid); diff --git a/htdocs/comm/prospect/index.php b/htdocs/comm/prospect/index.php index 8883e0af6f3..d2f60c36212 100644 --- a/htdocs/comm/prospect/index.php +++ b/htdocs/comm/prospect/index.php @@ -87,7 +87,7 @@ $sql .= " WHERE s.fk_stcomm = st.id"; $sql .= " AND s.client IN (2, 3)"; $sql .= " AND s.entity IN (".getEntity($companystatic->element).")"; if (!$user->rights->societe->client->voir && !$socid) { - $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; + $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } $sql .= " GROUP BY st.id"; $sql .= " ORDER BY st.id"; @@ -129,7 +129,7 @@ if (!empty($conf->propal->enabled) && $user->rights->propale->lire) { $sql .= " AND p.fk_soc = s.rowid"; $sql .= " AND p.entity IN (".getEntity('propal').")"; if (!$user->rights->societe->client->voir && !$socid) { - $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; + $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } $resql = $db->query($sql); @@ -191,7 +191,7 @@ if (!empty($conf->propal->enabled) && $user->rights->propale->lire) { $sql .= " AND p.fk_statut = 1"; $sql .= " AND p.entity IN (".getEntity('propal').")"; if (!$user->rights->societe->client->voir && !$socid) { - $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; + $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { $sql .= " AND s.rowid = ".((int) $socid); @@ -250,7 +250,7 @@ if (!$user->rights->societe->client->voir && !$socid) { $sql .= " WHERE s.fk_stcomm = 1"; $sql .= " AND s.entity IN (".getEntity($companystatic->element).")"; if (!$user->rights->societe->client->voir && !$socid) { - $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; + $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } $sql .= " ORDER BY s.tms ASC"; $sql .= $db->plimit(15, 0); diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index c0851dfee1d..c19cc6c379f 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -2539,7 +2539,7 @@ class Commande extends CommonOrder $sql = "UPDATE ".MAIN_DB_PREFIX."commande"; $sql .= " SET date_commande = ".($date ? "'".$this->db->idate($date)."'" : 'null'); - $sql .= " WHERE rowid = ".$this->id." AND fk_statut = ".self::STATUS_DRAFT; + $sql .= " WHERE rowid = ".$this->id." AND fk_statut = ".((int) self::STATUS_DRAFT); dol_syslog(__METHOD__, LOG_DEBUG); $resql = $this->db->query($sql); @@ -4559,14 +4559,14 @@ class OrderLine extends CommonOrderLine } $sql .= " , fk_product_fournisseur_price=".(!empty($this->fk_fournprice) ? $this->fk_fournprice : "null"); $sql .= " , buy_price_ht='".price2num($this->pa_ht)."'"; - $sql .= " , info_bits=".$this->info_bits; - $sql .= " , special_code=".$this->special_code; + $sql .= " , info_bits=".((int) $this->info_bits); + $sql .= " , special_code=".((int) $this->special_code); $sql .= " , date_start=".(!empty($this->date_start) ? "'".$this->db->idate($this->date_start)."'" : "null"); $sql .= " , date_end=".(!empty($this->date_end) ? "'".$this->db->idate($this->date_end)."'" : "null"); $sql .= " , product_type=".$this->product_type; $sql .= " , fk_parent_line=".(!empty($this->fk_parent_line) ? $this->fk_parent_line : "null"); if (!empty($this->rang)) { - $sql .= ", rang=".$this->rang; + $sql .= ", rang=".((int) $this->rang); } $sql .= " , fk_unit=".(!$this->fk_unit ? 'NULL' : $this->fk_unit); @@ -4576,7 +4576,7 @@ class OrderLine extends CommonOrderLine $sql .= " , multicurrency_total_tva=".price2num($this->multicurrency_total_tva).""; $sql .= " , multicurrency_total_ttc=".price2num($this->multicurrency_total_ttc).""; - $sql .= " WHERE rowid = ".$this->rowid; + $sql .= " WHERE rowid = ".((int) $this->rowid); dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); diff --git a/htdocs/commande/customer.php b/htdocs/commande/customer.php index 6dfa898a024..62f8c4772f6 100644 --- a/htdocs/commande/customer.php +++ b/htdocs/commande/customer.php @@ -89,9 +89,6 @@ $sql .= " AND s.entity IN (".getEntity('societe').")"; if (!$user->rights->societe->client->voir && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; } -if (dol_strlen($stcomm)) { - $sql .= " AND s.fk_stcomm=".$stcomm; -} if (GETPOST("search_nom")) { $sql .= natural_search("s.nom", GETPOST("search_nom")); } diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index 48f1f600126..73f40668cea 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -166,7 +166,7 @@ $sql .= " WHERE c.fk_soc = s.rowid"; $sql .= " AND c.entity IN (".getEntity('commande').")"; //$sql.= " AND c.fk_statut > 2"; if ($socid) { - $sql .= " AND c.fk_soc = ".$socid; + $sql .= " AND c.fk_soc = ".((int) $socid); } if (!$user->rights->societe->client->voir && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; @@ -250,7 +250,7 @@ if (!empty($conf->commande->enabled)) { $sql .= " AND c.entity IN (".getEntity('commande').")"; $sql .= " AND c.fk_statut = ".Commande::STATUS_VALIDATED; if ($socid) { - $sql .= " AND c.fk_soc = ".$socid; + $sql .= " AND c.fk_soc = ".((int) $socid); } if (!$user->rights->societe->client->voir && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; @@ -337,9 +337,9 @@ if (!empty($conf->commande->enabled)) { } $sql .= " WHERE c.fk_soc = s.rowid"; $sql .= " AND c.entity IN (".getEntity('commande').")"; - $sql .= " AND c.fk_statut = ".Commande::STATUS_ACCEPTED; + $sql .= " AND c.fk_statut = ".((int) Commande::STATUS_ACCEPTED); if ($socid) { - $sql .= " AND c.fk_soc = ".$socid; + $sql .= " AND c.fk_soc = ".((int) $socid); } if (!$user->rights->societe->client->voir && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index f42b7c08de9..98bbd00b351 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -473,7 +473,7 @@ if ($search_user > 0) { $sql .= ' WHERE c.fk_soc = s.rowid'; $sql .= ' AND c.entity IN ('.getEntity('commande').')'; if ($search_product_category > 0) { - $sql .= " AND cp.fk_categorie = ".$search_product_category; + $sql .= " AND cp.fk_categorie = ".((int) $search_product_category); } if ($socid > 0) { $sql .= ' AND s.rowid = '.((int) $socid); diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 0a9784fce75..666621cbdd6 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -1181,7 +1181,7 @@ if ($resql) { $sqlforbalance .= " ".MAIN_DB_PREFIX."bank as b"; $sqlforbalance .= " WHERE b.fk_account = ba.rowid"; $sqlforbalance .= " AND ba.entity IN (".getEntity('bank_account').")"; - $sqlforbalance .= " AND b.fk_account = ".$search_account; + $sqlforbalance .= " AND b.fk_account = ".((int) $search_account); $sqlforbalance .= " AND (b.datev < '".$db->idate($db->jdate($objp->dv))."' OR (b.datev = '".$db->idate($db->jdate($objp->dv))."' AND (b.dateo < '".$db->idate($db->jdate($objp->do))."' OR (b.dateo = '".$db->idate($db->jdate($objp->do))."' AND b.rowid < ".$objp->rowid."))))"; $resqlforbalance = $db->query($sqlforbalance); //print $sqlforbalance; diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index e629d7620f0..0d97ed69a07 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1070,7 +1070,7 @@ class Account extends CommonObject if (!$error) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_account"; - $sql .= " WHERE rowid = ".$this->rowid; + $sql .= " WHERE rowid = ".((int) $this->rowid); dol_syslog(get_class($this)."::delete", LOG_DEBUG); $result = $this->db->query($sql); @@ -2090,7 +2090,7 @@ class AccountLine extends CommonObject $sql .= " amount = ".price2num($this->amount).","; $sql .= " datev='".$this->db->idate($this->datev)."',"; $sql .= " dateo='".$this->db->idate($this->dateo)."'"; - $sql .= " WHERE rowid = ".$this->rowid; + $sql .= " WHERE rowid = ".((int) $this->rowid); dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); diff --git a/htdocs/compta/bank/class/api_bankaccounts.class.php b/htdocs/compta/bank/class/api_bankaccounts.class.php index 10357155295..fd7ed1838f2 100644 --- a/htdocs/compta/bank/class/api_bankaccounts.class.php +++ b/htdocs/compta/bank/class/api_bankaccounts.class.php @@ -77,7 +77,7 @@ class BankAccounts extends DolibarrApi $sql .= ' WHERE t.entity IN ('.getEntity('bank_account').')'; // Select accounts of given category if ($category > 0) { - $sql .= " AND c.fk_categorie = ".$this->db->escape($category)." AND c.fk_account = t.rowid "; + $sql .= " AND c.fk_categorie = ".((int) $category)." AND c.fk_account = t.rowid"; } // Add sql filters if ($sqlfilters) { diff --git a/htdocs/compta/bank/line.php b/htdocs/compta/bank/line.php index c84f52ffee1..2c33085aa6d 100644 --- a/htdocs/compta/bank/line.php +++ b/htdocs/compta/bank/line.php @@ -173,7 +173,7 @@ if ($user->rights->banque->modifier && $action == "update") { $sql .= " datev = '".$db->idate($dateval)."',"; } } - $sql .= " fk_account = ".$actarget->id; + $sql .= " fk_account = ".((int) $actarget->id); $sql .= " WHERE rowid = ".((int) $acline->id); $result = $db->query($sql); diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index f45d2a64af4..167c809a8b1 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -606,7 +606,7 @@ if (empty($numref)) { $sql .= ", ".MAIN_DB_PREFIX."bank_class as cl"; $sql .= " WHERE ct.rowid = cl.fk_categ"; $sql .= " AND ct.entity = ".$conf->entity; - $sql .= " AND cl.lineid = ".$objp->rowid; + $sql .= " AND cl.lineid = ".((int) $objp->rowid); $resc = $db->query($sql); if ($resc) { diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index f78e004f571..dda68a096a1 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -250,19 +250,19 @@ if ($search_amount_cred) { $sql .= natural_search("v.amount", $search_amount_cred, 1); } if ($search_bank_account > 0) { - $sql .= " AND b.fk_account=".$db->escape($search_bank_account); + $sql .= " AND b.fk_account = ".((int) $search_bank_account); } if ($search_bank_entry > 0) { - $sql .= " AND b.fk_account=".$db->escape($search_bank_account); + $sql .= " AND b.fk_account = ".((int) $search_bank_account); } if ($search_accountancy_account > 0) { - $sql .= " AND v.accountancy_code=".$db->escape($search_accountancy_account); + $sql .= " AND v.accountancy_code = ".((int) $search_accountancy_account); } if ($search_accountancy_subledger > 0) { - $sql .= " AND v.subledger_account=".$db->escape($search_accountancy_subledger); + $sql .= " AND v.subledger_account = ".((int) $search_accountancy_subledger); } if ($typeid > 0) { - $sql .= " AND v.fk_typepayment=".$typeid; + $sql .= " AND v.fk_typepayment=".((int) $typeid); } if ($search_all) { $sql .= natural_search(array_keys($fieldstosearchall), $search_all); diff --git a/htdocs/compta/clients.php b/htdocs/compta/clients.php index 60924dae644..b0a4716b7e1 100644 --- a/htdocs/compta/clients.php +++ b/htdocs/compta/clients.php @@ -71,7 +71,7 @@ llxHeader(); $thirdpartystatic = new Societe($db); if ($action == 'note') { - $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET note='".$db->escape($note)."' WHERE rowid=".$socid; + $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET note='".$db->escape($note)."' WHERE rowid=".((int) $socid); $result = $db->query($sql); } @@ -107,29 +107,21 @@ if (!$user->rights->societe->client->voir && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; } if (dol_strlen($stcomm)) { - $sql .= " AND s.fk_stcomm=".$stcomm; + $sql .= " AND s.fk_stcomm=".((int) $stcomm); } -if ($socname) { - $sql .= natural_search("s.nom", $socname); - $sortfield = "s.nom"; - $sortorder = "ASC"; -} -if ($_GET["search_nom"]) { +if (GETPOST("search_nom")) { $sql .= natural_search("s.nom", GETPOST("search_nom")); } -if ($_GET["search_compta"]) { +if (GETPOST("search_compta")) { $sql .= natural_search("s.code_compta", GETPOST("search_compta")); } -if ($_GET["search_code_client"]) { +if (GETPOST("search_code_client")) { $sql .= natural_search("s.code_client", GETPOST("search_code_client")); } -if (dol_strlen($begin)) { - $sql .= natural_search("s.nom", $begin); -} if ($socid) { $sql .= " AND s.rowid = ".((int) $socid); } -$sql .= " ORDER BY $sortfield $sortorder "; +$sql .= " ORDER BY $sortfield $sortorder"; $sql .= $db->plimit($conf->liste_limit + 1, $offset); //print $sql; diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index 84b4df207a5..3dfa5f70603 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -217,7 +217,7 @@ class Invoices extends DolibarrApi } // Insert sale filter if ($search_sale > 0) { - $sql .= " AND sc.fk_user = ".$search_sale; + $sql .= " AND sc.fk_user = ".((int) $search_sale); } // Add sql filters if ($sqlfilters) { diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 286b5a1ccea..7d2ffe9e022 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -470,9 +470,9 @@ class FactureRec extends CommonInvoice $error = 0; $sql = "UPDATE ".MAIN_DB_PREFIX."facture_rec SET"; - $sql .= " fk_soc = ".$this->fk_soc; + $sql .= " fk_soc = ".((int) $this->fk_soc); // TODO Add missing fields - $sql .= " WHERE rowid = ".$this->id; + $sql .= " WHERE rowid = ".((int) $this->id); dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); @@ -1136,12 +1136,12 @@ class FactureRec extends CommonInvoice $sql .= ", qty=".price2num($qty); $sql .= ", tva_tx=".price2num($txtva); $sql .= ", vat_src_code='".$this->db->escape($vat_src_code)."'"; - $sql .= ", localtax1_tx=".$txlocaltax1; + $sql .= ", localtax1_tx=".((float) $txlocaltax1); $sql .= ", localtax1_type='".$this->db->escape($localtaxes_type[0])."'"; - $sql .= ", localtax2_tx=".$txlocaltax2; + $sql .= ", localtax2_tx=".((float) $txlocaltax2); $sql .= ", localtax2_type='".$this->db->escape($localtaxes_type[2])."'"; $sql .= ", fk_product=".(!empty($fk_product) ? "'".$this->db->escape($fk_product)."'" : "null"); - $sql .= ", product_type=".$product_type; + $sql .= ", product_type=".((int) $product_type); $sql .= ", remise_percent='".price2num($remise_percent)."'"; $sql .= ", subprice='".price2num($pu_ht)."'"; $sql .= ", total_ht='".price2num($total_ht)."'"; @@ -2124,11 +2124,11 @@ class FactureLigneRec extends CommonInvoiceLine $sql .= ", total_localtax2=".price2num($this->total_localtax2); $sql .= ", total_ttc=".price2num($this->total_ttc); } - $sql .= ", rang=".$this->rang; - $sql .= ", special_code=".$this->special_code; + $sql .= ", rang=".((int) $this->rang); + $sql .= ", special_code=".((int) $this->special_code); $sql .= ", fk_unit=".($this->fk_unit ? "'".$this->db->escape($this->fk_unit)."'" : "null"); $sql .= ", fk_contract_line=".($this->fk_contract_line ? $this->fk_contract_line : "null"); - $sql .= " WHERE rowid = ".$this->id; + $sql .= " WHERE rowid = ".((int) $this->id); $this->db->begin(); diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 6dd67d4d931..40a14eb1711 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -4105,7 +4105,7 @@ class Facture extends CommonInvoice $sql .= " AND pf.fk_paiement IS NULL"; // Aucun paiement deja fait $sql .= " AND ff.fk_statut IS NULL"; // Renvoi vrai si pas facture de remplacement if ($socid > 0) { - $sql .= " AND f.fk_soc = ".$socid; + $sql .= " AND f.fk_soc = ".((int) $socid); } $sql .= " ORDER BY f.ref"; @@ -5594,7 +5594,7 @@ class FactureLigne extends CommonInvoiceLine $sql .= ", buy_price_ht=".(($this->pa_ht || $this->pa_ht === 0 || $this->pa_ht === '0') ? price2num($this->pa_ht) : "null"); // $this->pa_ht should always be defined (set to 0 or to sell price depending on option) $sql .= ", fk_parent_line=".($this->fk_parent_line > 0 ? $this->fk_parent_line : "null"); if (!empty($this->rang)) { - $sql .= ", rang=".$this->rang; + $sql .= ", rang=".((int) $this->rang); } $sql .= ", situation_percent=".$this->situation_percent; $sql .= ", fk_unit=".(!$this->fk_unit ? 'NULL' : $this->fk_unit); @@ -5606,7 +5606,7 @@ class FactureLigne extends CommonInvoiceLine $sql .= ", multicurrency_total_tva=".price2num($this->multicurrency_total_tva).""; $sql .= ", multicurrency_total_ttc=".price2num($this->multicurrency_total_ttc).""; - $sql .= " WHERE rowid = ".$this->rowid; + $sql .= " WHERE rowid = ".((int) $this->rowid); dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index fb4089fabec..a375bc677f2 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -546,7 +546,7 @@ if (!$user->rights->societe->client->voir && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($search_product_category > 0) { - $sql .= " AND cp.fk_categorie = ".$db->escape($search_product_category); + $sql .= " AND cp.fk_categorie = ".((int) $search_product_category); } if ($socid > 0) { $sql .= ' AND s.rowid = '.((int) $socid); @@ -634,7 +634,7 @@ if ($search_login) { $sql .= natural_search(array('u.login', 'u.firstname', 'u.lastname'), $search_login); } if ($search_categ_cus > 0) { - $sql .= " AND cc.fk_categorie = ".$db->escape($search_categ_cus); + $sql .= " AND cc.fk_categorie = ".((int) $search_categ_cus); } if ($search_categ_cus == -2) { $sql .= " AND cc.fk_categorie IS NULL"; @@ -659,10 +659,10 @@ if ($search_status != '-1' && $search_status != '') { } if ($search_paymentmode > 0) { - $sql .= " AND f.fk_mode_reglement = ".$db->escape($search_paymentmode); + $sql .= " AND f.fk_mode_reglement = ".((int) $search_paymentmode); } if ($search_paymentterms > 0) { - $sql .= " AND f.fk_cond_reglement = ".$db->escape($search_paymentterms); + $sql .= " AND f.fk_cond_reglement = ".((int) $search_paymentterms); } if ($search_module_source) { $sql .= natural_search("f.module_source", $search_module_source); @@ -692,10 +692,10 @@ if ($option == 'late') { $sql .= " AND f.date_lim_reglement < '".$db->idate(dol_now() - $conf->facture->client->warning_delay)."'"; } if ($search_sale > 0) { - $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".(int) $search_sale; + $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $search_sale); } if ($search_user > 0) { - $sql .= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='facture' AND tc.source='internal' AND ec.element_id = f.rowid AND ec.fk_socpeople = ".$search_user; + $sql .= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='facture' AND tc.source='internal' AND ec.element_id = f.rowid AND ec.fk_socpeople = ".((int) $search_user); } // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index e33ddc35610..18519955bf6 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -138,7 +138,7 @@ if (!empty($conf->facture->enabled) && !empty($user->rights->facture->lire)) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($socid) { - $sql .= " AND f.fk_soc = ".$socid; + $sql .= " AND f.fk_soc = ".((int) $socid); } // Add where from hooks $parameters = array(); @@ -283,7 +283,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($socid) { - $sql .= " AND ff.fk_soc = ".$socid; + $sql .= " AND ff.fk_soc = ".((int) $socid); } // Add where from hooks $parameters = array(); @@ -593,7 +593,7 @@ if (!empty($conf->facture->enabled) && !empty($conf->commande->enabled) && $user $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($socid) { - $sql .= " AND c.fk_soc = ".$socid; + $sql .= " AND c.fk_soc = ".((int) $socid); } $sql .= " AND c.fk_statut = ".Commande::STATUS_CLOSED; $sql .= " AND c.facture = 0"; diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php index dc133977202..115dce99c9e 100644 --- a/htdocs/compta/localtax/class/localtax.class.php +++ b/htdocs/compta/localtax/class/localtax.class.php @@ -170,7 +170,7 @@ class Localtax extends CommonObject // Update request $sql = "UPDATE ".MAIN_DB_PREFIX."localtax SET"; - $sql .= " localtaxtype=".$this->ltt.","; + $sql .= " localtaxtype=".((int) $this->ltt).","; $sql .= " tms='".$this->db->idate($this->tms)."',"; $sql .= " datep='".$this->db->idate($this->datep)."',"; $sql .= " datev='".$this->db->idate($this->datev)."',"; diff --git a/htdocs/compta/localtax/index.php b/htdocs/compta/localtax/index.php index 86fa3fe52f0..f9ea0ac02d9 100644 --- a/htdocs/compta/localtax/index.php +++ b/htdocs/compta/localtax/index.php @@ -584,7 +584,7 @@ $sql .= "SELECT SUM(amount) as mm, date_format(f.datev,'%Y-%m') as dm, 'claimed' $sql .= " FROM ".MAIN_DB_PREFIX."localtax as f"; $sql .= " WHERE f.entity = ".$conf->entity; $sql .= " AND (f.datev >= '".$db->idate($date_start)."' AND f.datev <= '".$db->idate($date_end)."')"; -$sql .= " AND localtaxtype=".$localTaxType; +$sql .= " AND localtaxtype=".((int) $localTaxType); $sql .= " GROUP BY dm"; $sql .= " UNION "; @@ -593,7 +593,7 @@ $sql .= "SELECT SUM(amount) as mm, date_format(f.datep,'%Y-%m') as dm, 'paid' as $sql .= " FROM ".MAIN_DB_PREFIX."localtax as f"; $sql .= " WHERE f.entity = ".$conf->entity; $sql .= " AND (f.datep >= '".$db->idate($date_start)."' AND f.datep <= '".$db->idate($date_end)."')"; -$sql .= " AND localtaxtype=".$localTaxType; +$sql .= " AND localtaxtype=".((int) $localTaxType); $sql .= " GROUP BY dm"; $sql .= " ORDER BY dm ASC, mode ASC"; diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index 04eee81ced0..32f81532ecf 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -606,7 +606,7 @@ if ($action == 'new') { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiement as p ON p.fk_bank = b.rowid"; $sql .= " WHERE ba.entity IN (".getEntity('bank_account').")"; $sql .= " AND b.fk_type= 'CHQ'"; - $sql .= " AND b.fk_bordereau = ".$object->id; + $sql .= " AND b.fk_bordereau = ".((int) $object->id); $sql .= $db->order($sortfield, $sortorder); $resql = $db->query($sql); diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php index 0c4a6d9c478..f4d6c9e2686 100644 --- a/htdocs/compta/paiement/cheque/list.php +++ b/htdocs/compta/paiement/cheque/list.php @@ -104,7 +104,7 @@ if ($search_ref) { $sql .= natural_search("bc.ref", $search_ref); } if ($search_account > 0) { - $sql .= " AND bc.fk_bank_account=".$search_account; + $sql .= " AND bc.fk_bank_account = ".((int) $search_account); } if ($search_amount) { $sql .= natural_search("bc.amount", price2num($search_amount)); diff --git a/htdocs/compta/paiement/tovalidate.php b/htdocs/compta/paiement/tovalidate.php index 4e464243df6..6b811bc2d13 100644 --- a/htdocs/compta/paiement/tovalidate.php +++ b/htdocs/compta/paiement/tovalidate.php @@ -78,7 +78,7 @@ if ($socid) { } $sql .= " WHERE p.entity IN (".getEntity('invoice').')'; if ($socid) { - $sql .= " AND f.fk_soc = ".$socid; + $sql .= " AND f.fk_soc = ".((int) $socid); } $sql .= " AND p.statut = 0"; diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index dbf2d67778a..f69c7b476a2 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -203,7 +203,7 @@ class BonPrelevement extends CommonObject $sql = "SELECT rowid"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_lignes"; $sql .= " WHERE fk_prelevement_bons = ".$this->id; - $sql .= " AND fk_soc =".$client_id; + $sql .= " AND fk_soc =".((int) $client_id); $sql .= " AND code_banque = '".$this->db->escape($code_banque)."'"; $sql .= " AND code_guichet = '".$this->db->escape($code_guichet)."'"; $sql .= " AND number = '".$this->db->escape($number)."'"; diff --git a/htdocs/compta/prelevement/class/rejetprelevement.class.php b/htdocs/compta/prelevement/class/rejetprelevement.class.php index 0faea8a159c..dcf3c1a8bc5 100644 --- a/htdocs/compta/prelevement/class/rejetprelevement.class.php +++ b/htdocs/compta/prelevement/class/rejetprelevement.class.php @@ -329,7 +329,7 @@ class RejetPrelevement $sql = "SELECT pr.date_rejet as dr, motif, afacturer"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_rejet as pr"; - $sql .= " WHERE pr.fk_prelevement_lignes =".$rowid; + $sql .= " WHERE pr.fk_prelevement_lignes =".((int) $rowid); $resql = $this->db->query($sql); if ($resql) { @@ -345,11 +345,11 @@ class RejetPrelevement return 0; } else { - dol_syslog("RejetPrelevement::Fetch Erreur rowid=$rowid numrows=0"); + dol_syslog("RejetPrelevement::Fetch Erreur rowid=".$rowid." numrows=0"); return -1; } } else { - dol_syslog("RejetPrelevement::Fetch Erreur rowid=$rowid"); + dol_syslog("RejetPrelevement::Fetch Erreur rowid=".$rowid); return -2; } } diff --git a/htdocs/compta/prelevement/fiche-rejet.php b/htdocs/compta/prelevement/fiche-rejet.php index 928be9c4245..8711f663d55 100644 --- a/htdocs/compta/prelevement/fiche-rejet.php +++ b/htdocs/compta/prelevement/fiche-rejet.php @@ -170,15 +170,15 @@ $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; $sql .= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl"; $sql .= " , ".MAIN_DB_PREFIX."societe as s"; $sql .= " , ".MAIN_DB_PREFIX."prelevement_rejet as pr"; -$sql .= " WHERE p.rowid=".$object->id; +$sql .= " WHERE p.rowid=".((int) $object->id); $sql .= " AND pl.fk_prelevement_bons = p.rowid"; $sql .= " AND p.entity = ".$conf->entity; $sql .= " AND pl.fk_soc = s.rowid"; $sql .= " AND pl.statut = 3 "; $sql .= " AND pr.fk_prelevement_lignes = pl.rowid"; -if ($socid) { +/*if ($socid) { $sql .= " AND s.rowid = ".((int) $socid); -} +}*/ $sql .= " ORDER BY pl.amount DESC"; // Count total nb of records diff --git a/htdocs/compta/recap-compta.php b/htdocs/compta/recap-compta.php index 3abdf04ae1b..d98a6aab251 100644 --- a/htdocs/compta/recap-compta.php +++ b/htdocs/compta/recap-compta.php @@ -189,7 +189,7 @@ if ($id > 0) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON p.fk_user_creat = u.rowid"; $sql .= " WHERE pf.fk_paiement = p.rowid"; $sql .= " AND p.entity = ".$conf->entity; - $sql .= " AND pf.fk_facture = ".$fac->id; + $sql .= " AND pf.fk_facture = ".((int) $fac->id); $sql .= " ORDER BY p.datep ASC, p.rowid ASC"; $resqlp = $db->query($sql); diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index bd871fd3ea3..5aca25466a3 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -403,7 +403,7 @@ if ($modecompta == 'BOOKKEEPING') { } $sql .= " AND f.entity IN (".getEntity('invoice').")"; if ($socid) { - $sql .= " AND f.fk_soc = ".$socid; + $sql .= " AND f.fk_soc = ".((int) $socid); } $sql .= " GROUP BY name, socid"; $sql .= $db->order($sortfield, $sortorder); diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index db754390e5e..a4deec56715 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -218,7 +218,7 @@ if ($search_amount) { $sql .= natural_search("cs.amount", $search_amount, 1); } if ($search_status != '' && $search_status >= 0) { - $sql .= " AND cs.paye = ".$db->escape($search_status); + $sql .= " AND cs.paye = ".((int) $search_status); } $sql .= dolSqlDateFilter("cs.periode", $search_day_lim, $search_month_lim, $search_year_lim); //$sql.= dolSqlDateFilter("cs.periode", 0, 0, $year); @@ -230,8 +230,8 @@ if ($year > 0) { $sql .= "OR (cs.periode IS NULL AND date_format(cs.date_ech, '%Y') = '".$db->escape($year)."')"; $sql .= ")"; } -if ($search_typeid) { - $sql .= " AND cs.fk_type=".$db->escape($search_typeid); +if ($search_typeid > 0) { + $sql .= " AND cs.fk_type = ".((int) $search_typeid); } $sql .= " GROUP BY cs.rowid, cs.fk_type, cs.fk_user, cs.amount, cs.date_ech, cs.libelle, cs.paye, cs.periode, c.libelle, cs.fk_account, ba.label, ba.ref, ba.number, ba.account_number, ba.iban_prefix, ba.bic, ba.currency_code, ba.clos, pay.code, u.lastname"; if (!empty($conf->projet->enabled)) { diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php index 63798baf62f..8e3169f1e8c 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -262,7 +262,7 @@ if ($modecompta == 'CREANCES-DETTES') { } $sql .= " AND f.entity IN (".getEntity('invoice').")"; if ($socid) { - $sql .= " AND f.fk_soc = ".$socid; + $sql .= " AND f.fk_soc = ".((int) $socid); } $sql .= " GROUP BY u.rowid, u.lastname, u.firstname"; $sql .= " ORDER BY u.rowid"; diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index 05bbbab99d3..e7ec8c61db7 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -681,7 +681,7 @@ print ''; AND p.facture =0"; if ($socid) { - $sql .= " AND f.fk_soc = ".$socid; + $sql .= " AND f.fk_soc = ".((int) $socid); } $sql .= " GROUP BY p.rowid"; diff --git a/htdocs/compta/stats/supplier_turnover.php b/htdocs/compta/stats/supplier_turnover.php index 0afcb72da2d..7273e8ed529 100644 --- a/htdocs/compta/stats/supplier_turnover.php +++ b/htdocs/compta/stats/supplier_turnover.php @@ -197,7 +197,7 @@ if ($modecompta == 'CREANCES-DETTES') { $sql .= " AND f.type IN (0,2)"; $sql .= " AND f.entity IN (".getEntity('supplier_invoice').")"; if ($socid) { - $sql .= " AND f.fk_soc = ".$socid; + $sql .= " AND f.fk_soc = ".((int) $socid); } } elseif ($modecompta == "RECETTES-DEPENSES") { $sql = "SELECT date_format(p.datep,'%Y-%m') as dm, sum(pf.amount) as amount_ttc"; @@ -208,7 +208,7 @@ if ($modecompta == 'CREANCES-DETTES') { $sql .= " AND pf.fk_facturefourn = f.rowid"; $sql .= " AND f.entity IN (".getEntity('supplier_invoice').")"; if ($socid) { - $sql .= " AND f.fk_soc = ".$socid; + $sql .= " AND f.fk_soc = ".((int) $socid); } } elseif ($modecompta == "BOOKKEEPING") { $pcgverid = $conf->global->CHARTOFACCOUNTS; diff --git a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php index a97e15d1499..0ea8418381d 100644 --- a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php +++ b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php @@ -301,7 +301,7 @@ if ($search_country > 0) { } $sql .= " AND f.entity IN (".getEntity('supplier_invoice').")"; if ($socid) { - $sql .= " AND f.fk_soc = ".$socid; + $sql .= " AND f.fk_soc = ".((int) $socid); } $sql .= " GROUP BY s.rowid, s.nom, s.zip, s.town, s.fk_pays"; $sql .= " ORDER BY s.rowid"; diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index daed5b19f5e..45d3d2e74b4 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -207,7 +207,7 @@ class Tva extends CommonObject $sql .= " amount=".price2num($this->amount).","; $sql .= " label='".$this->db->escape($this->label)."',"; $sql .= " note='".$this->db->escape($this->note)."',"; - $sql .= " fk_user_creat=".$this->fk_user_creat.","; + $sql .= " fk_user_creat=".((int) $this->fk_user_creat).","; $sql .= " fk_user_modif=".($this->fk_user_modif > 0 ? $this->fk_user_modif : $user->id).""; $sql .= " WHERE rowid=".((int) $this->id); diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index 17237732cea..69ce8ae8ae5 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -171,16 +171,16 @@ if (!empty($search_datepayment_end)) { $sql .= ' AND t.datep <= "'.$db->idate($search_datepayment_end).'"'; } if (!empty($search_type) && $search_type > 0) { - $sql .= ' AND t.fk_typepayment='.$search_type; + $sql .= ' AND t.fk_typepayment = '.((int) $search_type); } if (!empty($search_account) && $search_account > 0) { - $sql .= ' AND t.fk_account='.$search_account; + $sql .= ' AND t.fk_account = '.((int) $search_account); } if (!empty($search_amount)) { $sql .= natural_search('t.amount', price2num(trim($search_amount)), 1); } if ($search_status != '' && $search_status >= 0) { - $sql .= " AND t.paye = ".$db->escape($search_status); + $sql .= " AND t.paye = ".((int) $search_status); } $sql .= " GROUP BY t.rowid, t.amount, t.label, t.datev, t.datep, t.paye, t.fk_typepayment, t.fk_account, ba.label, ba.ref, ba.number, ba.account_number, ba.iban_prefix, ba.bic, ba.currency_code, ba.clos, t.num_payment, pst.code"; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 78e4ffae99b..e1f987ac2f4 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -591,11 +591,11 @@ class Contact extends CommonObject if (isset($this->stcomm_id)) { $sql .= ", fk_stcommcontact = ".($this->stcomm_id > 0 || $this->stcomm_id == -1 ? $this->stcomm_id : "0"); } - $sql .= ", statut = ".$this->db->escape($this->statut); + $sql .= ", statut = ".((int) $this->statut); $sql .= ", fk_user_modif=".($user->id > 0 ? "'".$this->db->escape($user->id)."'" : "NULL"); $sql .= ", default_lang=".($this->default_lang ? "'".$this->db->escape($this->default_lang)."'" : "NULL"); - $sql .= ", entity = ".$this->db->escape($this->entity); - $sql .= " WHERE rowid=".$this->db->escape($id); + $sql .= ", entity = ".((int) $this->entity); + $sql .= " WHERE rowid=".((int) $id); dol_syslog(get_class($this)."::update", LOG_DEBUG); $result = $this->db->query($sql); @@ -1221,7 +1221,7 @@ class Contact extends CommonObject $obj = $this->db->fetch_object($resql); $sqldel = "DELETE FROM ".MAIN_DB_PREFIX."element_contact"; - $sqldel .= " WHERE rowid = ".$obj->rowid; + $sqldel .= " WHERE rowid = ".((int) $obj->rowid); dol_syslog(__METHOD__, LOG_DEBUG); $result = $this->db->query($sqldel); if (!$result) { @@ -1324,7 +1324,7 @@ class Contact extends CommonObject $sql = "SELECT c.rowid, c.datec as datec, c.fk_user_creat,"; $sql .= " c.tms as tms, c.fk_user_modif"; $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as c"; - $sql .= " WHERE c.rowid = ".$this->db->escape($id); + $sql .= " WHERE c.rowid = ".((int) $id); $resql = $this->db->query($sql); if ($resql) { @@ -1770,10 +1770,10 @@ class Contact extends CommonObject $sql = "SELECT sc.fk_socpeople as id, sc.fk_c_type_contact"; $sql .= " FROM ".MAIN_DB_PREFIX."c_type_contact tc"; $sql .= ", ".MAIN_DB_PREFIX."societe_contacts sc"; - $sql .= " WHERE sc.fk_soc =".$this->socid; + $sql .= " WHERE sc.fk_soc =".((int) $this->socid); $sql .= " AND sc.fk_c_type_contact=tc.rowid"; - $sql .= " AND tc.element='".$this->db->escape($element)."'"; - $sql .= " AND tc.active=1"; + $sql .= " AND tc.element = '".$this->db->escape($element)."'"; + $sql .= " AND tc.active = 1"; dol_syslog(__METHOD__, LOG_DEBUG); $resql = $this->db->query($sql); diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 74e3c704739..5ef0a10deb5 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -392,7 +392,7 @@ if (!$user->rights->societe->client->voir && !$socid) { //restriction $sql .= " AND (sc.fk_user = ".$user->id." OR p.fk_soc IS NULL)"; } if (!empty($userid)) { // propre au commercial - $sql .= " AND p.fk_user_creat=".$db->escape($userid); + $sql .= " AND p.fk_user_creat=".((int) $userid); } if ($search_level) { $sql .= natural_search("p.fk_prospectcontactlevel", join(',', $search_level), 3); @@ -414,19 +414,19 @@ if ($search_priv != '0' && $search_priv != '1') { } if ($search_categ > 0) { - $sql .= " AND cc.fk_categorie = ".$db->escape($search_categ); + $sql .= " AND cc.fk_categorie = ".((int) $search_categ); } if ($search_categ == -2) { $sql .= " AND cc.fk_categorie IS NULL"; } if ($search_categ_thirdparty > 0) { - $sql .= " AND cs.fk_categorie = ".$db->escape($search_categ_thirdparty); + $sql .= " AND cs.fk_categorie = ".((int) $search_categ_thirdparty); } if ($search_categ_thirdparty == -2) { $sql .= " AND cs.fk_categorie IS NULL"; } if ($search_categ_supplier > 0) { - $sql .= " AND cs2.fk_categorie = ".$db->escape($search_categ_supplier); + $sql .= " AND cs2.fk_categorie = ".((int) $search_categ_supplier); } if ($search_categ_supplier == -2) { $sql .= " AND cs2.fk_categorie IS NULL"; @@ -495,10 +495,10 @@ if (count($search_roles) > 0) { $sql .= " AND p.rowid IN (SELECT sc.fk_socpeople FROM ".MAIN_DB_PREFIX."societe_contacts as sc WHERE sc.fk_c_type_contact IN (".$db->sanitize(implode(',', $search_roles))."))"; } if ($search_no_email != '' && $search_no_email >= 0) { - $sql .= " AND p.no_email = ".$db->escape($search_no_email); + $sql .= " AND p.no_email = ".((int) $search_no_email); } if ($search_status != '' && $search_status >= 0) { - $sql .= " AND p.statut = ".$db->escape($search_status); + $sql .= " AND p.statut = ".((int) $search_status); } if ($search_import_key) { $sql .= natural_search("p.import_key", $search_import_key); diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 186e4ee5761..0275baeb3a9 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -3066,9 +3066,9 @@ class ContratLigne extends CommonObjectLine // Update request $sql = "UPDATE ".MAIN_DB_PREFIX."contratdet SET"; - $sql .= " fk_contrat=".$this->fk_contrat.","; + $sql .= " fk_contrat=".((int) $this->fk_contrat).","; $sql .= " fk_product=".($this->fk_product ? "'".$this->db->escape($this->fk_product)."'" : 'null').","; - $sql .= " statut=".$this->statut.","; + $sql .= " statut=".((int) $this->statut).","; $sql .= " label='".$this->db->escape($this->label)."',"; $sql .= " description='".$this->db->escape($this->description)."',"; $sql .= " date_commande=".($this->date_commande != '' ? "'".$this->db->idate($this->date_commande)."'" : "null").","; @@ -3373,11 +3373,11 @@ class ContratLigne extends CommonObjectLine $this->db->begin(); - $sql = "UPDATE ".MAIN_DB_PREFIX."contratdet SET statut = ".ContratLigne::STATUS_CLOSED.","; + $sql = "UPDATE ".MAIN_DB_PREFIX."contratdet SET statut = ".((int) ContratLigne::STATUS_CLOSED).","; $sql .= " date_cloture = '".$this->db->idate($date_end)."',"; $sql .= " fk_user_cloture = ".$user->id.","; $sql .= " commentaire = '".$this->db->escape($comment)."'"; - $sql .= " WHERE rowid = ".$this->id." AND statut = ".ContratLigne::STATUS_OPEN; + $sql .= " WHERE rowid = ".$this->id." AND statut = ".((int) ContratLigne::STATUS_OPEN); $resql = $this->db->query($sql); if ($resql) { diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index aed4cba2fe1..a5e3da943b7 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -250,7 +250,7 @@ if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($socid) { - $sql .= " AND c.fk_soc = ".$socid; + $sql .= " AND c.fk_soc = ".((int) $socid); } $resql = $db->query($sql); diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index cf19f1178f6..ccb36830844 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -265,10 +265,10 @@ if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) { $sql .= " AND s.fk_typent IN (".$db->sanitize($db->escape($search_type_thirdparty)).')'; } if ($search_product_category > 0) { - $sql .= " AND cp.fk_categorie = ".$search_product_category; + $sql .= " AND cp.fk_categorie = ".((int) $search_product_category); } if ($socid) { - $sql .= " AND s.rowid = ".$db->escape($socid); + $sql .= " AND s.rowid = ".((int) $socid); } if (!$user->rights->societe->client->voir && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; @@ -296,13 +296,13 @@ if ($search_town) { $sql .= natural_search(array('s.town'), $search_town); } if ($search_sale > 0) { - $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$search_sale; + $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $search_sale); } if ($sall) { $sql .= natural_search(array_keys($fieldstosearchall), $sall); } if ($search_user > 0) { - $sql .= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='contrat' AND tc.source='internal' AND ec.element_id = c.rowid AND ec.fk_socpeople = ".$search_user; + $sql .= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='contrat' AND tc.source='internal' AND ec.element_id = c.rowid AND ec.fk_socpeople = ".((int) $search_user); } // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index a0ecc6b4be8..8368bffbab2 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -257,7 +257,7 @@ if ($search_product_category > 0) { $sql .= " WHERE c.entity = ".$conf->entity; $sql .= " AND c.rowid = cd.fk_contrat"; if ($search_product_category > 0) { - $sql .= " AND cp.fk_categorie = ".$search_product_category; + $sql .= " AND cp.fk_categorie = ".((int) $search_product_category); } $sql .= " AND c.fk_soc = s.rowid"; if (!$user->rights->societe->client->voir && !$socid) { diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 9e312bee679..f3c68711edd 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -531,7 +531,7 @@ abstract class CommonObject $sql .= " WHERE entity IN (".getEntity($element).")"; if ($id > 0) { - $sql .= " AND rowid = ".$db->escape($id); + $sql .= " AND rowid = ".((int) $id); } elseif ($ref) { $sql .= " AND ref = '".$db->escape($ref)."'"; } elseif ($ref_ext) { @@ -542,7 +542,7 @@ abstract class CommonObject return -1; } if ($ref || $ref_ext) { - $sql .= " AND entity = ".$conf->entity; + $sql .= " AND entity = ".((int) $conf->entity); } dol_syslog(get_class()."::isExistingObject", LOG_DEBUG); @@ -1278,7 +1278,7 @@ abstract class CommonObject } $sql .= " AND tc.active=1"; if ($status >= 0) { - $sql .= " AND ec.statut = ".$status; + $sql .= " AND ec.statut = ".((int) $status); } $sql .= " ORDER BY t.lastname ASC"; @@ -1926,7 +1926,7 @@ abstract class CommonObject if ($format == 'text') { $sql .= $field." = '".$this->db->escape($value)."'"; } elseif ($format == 'int') { - $sql .= $field." = ".$this->db->escape($value); + $sql .= $field." = ".((int) $value); } elseif ($format == 'date') { $sql .= $field." = ".($value ? "'".$this->db->idate($value)."'" : "null"); } @@ -3709,19 +3709,19 @@ abstract class CommonObject $sql .= " WHERE "; if ($justsource || $justtarget) { if ($justsource) { - $sql .= "fk_source = ".$sourceid." AND sourcetype = '".$this->db->escape($sourcetype)."'"; + $sql .= "fk_source = ".((int) $sourceid)." AND sourcetype = '".$this->db->escape($sourcetype)."'"; if ($withtargettype) { $sql .= " AND targettype = '".$this->db->escape($targettype)."'"; } } elseif ($justtarget) { - $sql .= "fk_target = ".$targetid." AND targettype = '".$this->db->escape($targettype)."'"; + $sql .= "fk_target = ".((int) $targetid)." AND targettype = '".$this->db->escape($targettype)."'"; if ($withsourcetype) { $sql .= " AND sourcetype = '".$this->db->escape($sourcetype)."'"; } } } else { - $sql .= "(fk_source = ".$sourceid." AND sourcetype = '".$this->db->escape($sourcetype)."')"; - $sql .= " ".$clause." (fk_target = ".$targetid." AND targettype = '".$this->db->escape($targettype)."')"; + $sql .= "(fk_source = ".((int) $sourceid)." AND sourcetype = '".$this->db->escape($sourcetype)."')"; + $sql .= " ".$clause." (fk_target = ".((int) $targetid)." AND targettype = '".$this->db->escape($targettype)."')"; } $sql .= ' ORDER BY '.$orderby; @@ -4106,12 +4106,12 @@ abstract class CommonObject } $sql = "UPDATE ".MAIN_DB_PREFIX.$elementTable; - $sql .= " SET ".$fieldstatus." = ".$status; + $sql .= " SET ".$fieldstatus." = ".((int) $status); // If status = 1 = validated, update also fk_user_valid if ($status == 1 && $elementTable == 'expensereport') { $sql .= ", fk_user_valid = ".$user->id; } - $sql .= " WHERE rowid=".$elementId; + $sql .= " WHERE rowid=".((int) $elementId); dol_syslog(get_class($this)."::setStatut", LOG_DEBUG); if ($this->db->query($sql)) { @@ -7122,11 +7122,11 @@ abstract class CommonObject $sql .= ' as main'; } if ($selectkey == 'rowid' && empty($value)) { - $sql .= " WHERE ".$selectkey."=0"; + $sql .= " WHERE ".$selectkey." = 0"; } elseif ($selectkey == 'rowid') { - $sql .= " WHERE ".$selectkey."=".$this->db->escape($value); + $sql .= " WHERE ".$selectkey." = ".((int) $value); } else { - $sql .= " WHERE ".$selectkey."='".$this->db->escape($value)."'"; + $sql .= " WHERE ".$selectkey." = '".$this->db->escape($value)."'"; } //$sql.= ' AND entity = '.$conf->entity; diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index 32d7faa1557..aaf0f315c1b 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -292,7 +292,7 @@ class DiscountAbsolute $sql .= " FROM ".MAIN_DB_PREFIX."societe_remise_except"; $sql .= " WHERE (fk_facture_line IS NOT NULL"; // Not used as absolute simple discount $sql .= " OR fk_facture IS NOT NULL)"; // Not used as credit note and not used as deposit - $sql .= " AND fk_facture_source = ".$this->fk_facture_source; + $sql .= " AND fk_facture_source = ".((int) $this->fk_facture_source); //$sql.=" AND rowid != ".$this->id; dol_syslog(get_class($this)."::delete Check if we can remove discount", LOG_DEBUG); diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index dc3726f2634..2f8b0871a83 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1722,11 +1722,11 @@ class ExtraFields $sql .= ' as main'; } if ($selectkey == 'rowid' && empty($value)) { - $sql .= " WHERE ".$selectkey."=0"; + $sql .= " WHERE ".$selectkey." = 0"; } elseif ($selectkey == 'rowid') { - $sql .= " WHERE ".$selectkey."=".$this->db->escape($value); + $sql .= " WHERE ".$selectkey." = ".((int) $value); } else { - $sql .= " WHERE ".$selectkey."='".$this->db->escape($value)."'"; + $sql .= " WHERE ".$selectkey." = '".$this->db->escape($value)."'"; } //$sql.= ' AND entity = '.$conf->entity; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 1dd6712dba6..e084757fe28 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2497,18 +2497,18 @@ class Form } if ($finished == 0) { - $sql .= " AND p.finished = ".$finished; + $sql .= " AND p.finished = ".((int) $finished); } elseif ($finished == 1) { - $sql .= " AND p.finished = ".$finished; + $sql .= " AND p.finished = ".((int) $finished); if ($status >= 0) { - $sql .= " AND p.tosell = ".$status; + $sql .= " AND p.tosell = ".((int) $status); } } elseif ($status >= 0) { - $sql .= " AND p.tosell = ".$status; + $sql .= " AND p.tosell = ".((int) $status); } // Filter by product type if (strval($filtertype) != '') { - $sql .= " AND p.fk_product_type = ".$filtertype; + $sql .= " AND p.fk_product_type = ".((int) $filtertype); } elseif (empty($conf->product->enabled)) { // when product module is disabled, show services only $sql .= " AND p.fk_product_type = 1"; } elseif (empty($conf->service->enabled)) { // when service module is disabled, show products only @@ -3828,7 +3828,6 @@ class Form $sql = "SELECT id, code, libelle as label, type, active"; $sql .= " FROM ".MAIN_DB_PREFIX."c_paiement"; $sql .= " WHERE entity IN (".getEntity('c_paiement').")"; - //if ($active >= 0) $sql.= " AND active = ".$active; $resql = $this->db->query($sql); if ($resql) { @@ -4061,7 +4060,6 @@ class Form $sql = "SELECT rowid, code, label, active"; $sql .= " FROM ".MAIN_DB_PREFIX."c_transport_mode"; $sql .= " WHERE entity IN (".getEntity('c_transport_mode').")"; - //if ($active >= 0) $sql.= " AND active = ".$active; $resql = $this->db->query($sql); if ($resql) { diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index a57e39f1779..fbfde88198b 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -242,7 +242,7 @@ class FormAccounting extends Form $sql .= " WHERE c.active = 1"; $sql .= " AND c.category_type = 0"; if (empty($allcountries)) { - $sql .= " AND c.fk_country = ".$mysoc->country_id; + $sql .= " AND c.fk_country = ".((int) $mysoc->country_id); } $sql .= " ORDER BY c.label ASC"; } else { diff --git a/htdocs/core/class/html.formintervention.class.php b/htdocs/core/class/html.formintervention.class.php index aa0259ba288..7058e80b1d7 100644 --- a/htdocs/core/class/html.formintervention.class.php +++ b/htdocs/core/class/html.formintervention.class.php @@ -77,14 +77,14 @@ class FormIntervention if ($socid == '0') { $sql .= " AND (f.fk_soc = 0 OR f.fk_soc IS NULL)"; } else { - $sql .= " AND f.fk_soc = ".$socid; + $sql .= " AND f.fk_soc = ".((int) $socid); } } dol_syslog(get_class($this)."::select_intervention", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { - $out .= ''; if ($showempty) { $out .= ''; } diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index a9da488907d..00c1c4236c4 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1275,10 +1275,10 @@ class FormMail extends Form $sql .= " AND entity IN (".getEntity('c_email_templates').")"; $sql .= " AND (private = 0 OR fk_user = ".$user->id.")"; // Get all public or private owned if ($active >= 0) { - $sql .= " AND active = ".$active; + $sql .= " AND active = ".((int) $active); } if ($label) { - $sql .= " AND label ='".$db->escape($label)."'"; + $sql .= " AND label = '".$db->escape($label)."'"; } if (!($id > 0) && $languagetosearch) { $sql .= " AND (lang = '".$db->escape($languagetosearch)."'".($languagetosearchmain ? " OR lang = '".$db->escape($languagetosearchmain)."'" : "")." OR lang IS NULL OR lang = '')"; @@ -1434,7 +1434,7 @@ class FormMail extends Form $sql .= " AND entity IN (".getEntity('c_email_templates').")"; $sql .= " AND (private = 0 OR fk_user = ".$user->id.")"; // See all public templates or templates I own. if ($active >= 0) { - $sql .= " AND active = ".$active; + $sql .= " AND active = ".((int) $active); } //if (is_object($outputlangs)) $sql.= " AND (lang = '".$this->db->escape($outputlangs->defaultlang)."' OR lang IS NULL OR lang = '')"; // Return all languages $sql .= $this->db->order("position,lang,label", "ASC"); diff --git a/htdocs/core/class/html.formsocialcontrib.class.php b/htdocs/core/class/html.formsocialcontrib.class.php index 8a40eed9da8..3455b572888 100644 --- a/htdocs/core/class/html.formsocialcontrib.class.php +++ b/htdocs/core/class/html.formsocialcontrib.class.php @@ -76,7 +76,7 @@ class FormSocialContrib $sql = "SELECT c.id, c.libelle as type"; $sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; $sql .= " WHERE c.active = 1"; - $sql .= " AND c.fk_pays = ".$mysoc->country_id; + $sql .= " AND c.fk_pays = ".((int) $mysoc->country_id); $sql .= " ORDER BY c.libelle ASC"; } else { $sql = "SELECT c.id, c.libelle as type"; diff --git a/htdocs/core/class/infobox.class.php b/htdocs/core/class/infobox.class.php index 076dace54f0..545d3c12274 100644 --- a/htdocs/core/class/infobox.class.php +++ b/htdocs/core/class/infobox.class.php @@ -105,7 +105,7 @@ class InfoBox $sql .= " WHERE b.box_id = d.rowid"; $sql .= " AND b.entity IN (0,".$conf->entity.")"; if ($zone >= 0) { - $sql .= " AND b.position = ".$zone; + $sql .= " AND b.position = ".((int) $zone); } if (is_object($user)) { $sql .= " AND b.fk_user IN (0,".$user->id.")"; @@ -116,7 +116,7 @@ class InfoBox } else { // available $sql = "SELECT d.rowid as box_id, d.file, d.note, d.tms"; $sql .= " FROM ".MAIN_DB_PREFIX."boxes_def as d"; - $sql .= " WHERE d.entity IN (0,".$conf->entity.")"; + $sql .= " WHERE d.entity IN (0, ".$conf->entity.")"; } dol_syslog(get_class()."::listBoxes get default box list for mode=".$mode." userid=".(is_object($user) ? $user->id : '')."", LOG_DEBUG); @@ -254,8 +254,8 @@ class InfoBox // Delete all lines $sql = "DELETE FROM ".MAIN_DB_PREFIX."boxes"; $sql .= " WHERE entity = ".$conf->entity; - $sql .= " AND fk_user = ".$userid; - $sql .= " AND position = ".$zone; + $sql .= " AND fk_user = ".((int) $userid); + $sql .= " AND position = ".((int) $zone); dol_syslog(get_class()."::saveboxorder", LOG_DEBUG); $result = $db->query($sql); diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index 65fdaff9645..6f024c91b0b 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -352,10 +352,10 @@ class Menubase $sql .= " type='".$this->db->escape($this->type)."',"; $sql .= " mainmenu='".$this->db->escape($this->mainmenu)."',"; $sql .= " leftmenu='".$this->db->escape($this->leftmenu)."',"; - $sql .= " fk_menu=".$this->fk_menu.","; + $sql .= " fk_menu=".((int) $this->fk_menu).","; $sql .= " fk_mainmenu=".($this->fk_mainmenu ? "'".$this->db->escape($this->fk_mainmenu)."'" : "null").","; $sql .= " fk_leftmenu=".($this->fk_leftmenu ? "'".$this->db->escape($this->fk_leftmenu)."'" : "null").","; - $sql .= " position=".($this->position > 0 ? $this->position : 0).","; + $sql .= " position=".($this->position > 0 ? ((int) $this->position) : 0).","; $sql .= " url='".$this->db->escape($this->url)."',"; $sql .= " target='".$this->db->escape($this->target)."',"; $sql .= " titre='".$this->db->escape($this->title)."',"; diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 345ec5b38e3..6b32799bc89 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -176,7 +176,7 @@ class Notify $sqlnotifcode = ''; if ($notifcode) { if (is_numeric($notifcode)) { - $sqlnotifcode = " AND n.fk_action = ".$notifcode; // Old usage + $sqlnotifcode = " AND n.fk_action = ".((int) $notifcode); // Old usage } else { $sqlnotifcode = " AND a.code = '".$this->db->escape($notifcode)."'"; // New usage } @@ -195,7 +195,7 @@ class Notify $sql .= $sqlnotifcode; $sql .= " AND s.entity IN (".getEntity('societe').")"; if ($socid > 0) { - $sql .= " AND s.rowid = ".$socid; + $sql .= " AND s.rowid = ".((int) $socid); } dol_syslog(__METHOD__." ".$notifcode.", ".$socid."", LOG_DEBUG); @@ -233,7 +233,7 @@ class Notify $sql .= $sqlnotifcode; $sql .= " AND c.entity IN (".getEntity('user').")"; if ($userid > 0) { - $sql .= " AND c.rowid = ".$userid; + $sql .= " AND c.rowid = ".((int) $userid); } dol_syslog(__METHOD__." ".$notifcode.", ".$socid."", LOG_DEBUG); @@ -380,11 +380,11 @@ class Notify $sql .= " AND n.fk_soc = s.rowid"; $sql .= " AND c.statut = 1"; if (is_numeric($notifcode)) { - $sql .= " AND n.fk_action = ".$notifcode; // Old usage + $sql .= " AND n.fk_action = ".((int) $notifcode); // Old usage } else { $sql .= " AND a.code = '".$this->db->escape($notifcode)."'"; // New usage } - $sql .= " AND s.rowid = ".$object->socid; + $sql .= " AND s.rowid = ".((int) $object->socid); $sql .= "\nUNION\n"; } diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 939e6514c13..ef635b259ff 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -168,7 +168,7 @@ function show_array_actions_to_do($max = 5) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($socid) { - $sql .= " AND s.rowid = ".$socid; + $sql .= " AND s.rowid = ".((int) $socid); } $sql .= " ORDER BY a.datep DESC, a.id DESC"; $sql .= $db->plimit($max, 0); @@ -284,7 +284,7 @@ function show_array_last_actions_done($max = 5) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($socid) { - $sql .= " AND s.rowid = ".$socid; + $sql .= " AND s.rowid = ".((int) $socid); } $sql .= " ORDER BY a.datep2 DESC"; $sql .= $db->plimit($max, 0); diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 61332d8041b..5abc6bfc2ac 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -227,7 +227,7 @@ function societe_prepare_head(Societe $object) if (empty($conf->stripe->enabled)) { $sql .= " AND n.stripe_card_ref IS NULL"; } else { - $sql .= " AND (n.stripe_card_ref IS NULL OR (n.stripe_card_ref IS NOT NULL AND n.status = ".$servicestatus."))"; + $sql .= " AND (n.stripe_card_ref IS NULL OR (n.stripe_card_ref IS NOT NULL AND n.status = ".((int) $servicestatus)."))"; } $resql = $db->query($sql); @@ -1448,7 +1448,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin if (is_object($objcon) && $objcon->id > 0) { $force_filter_contact = true; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm_resources as r ON a.id = r.fk_actioncomm"; - $sql .= " AND r.element_type = '".$db->escape($objcon->table_element)."' AND r.fk_element = ".$objcon->id; + $sql .= " AND r.element_type = '".$db->escape($objcon->table_element)."' AND r.fk_element = ".((int) $objcon->id); } if (is_object($filterobj) && in_array(get_class($filterobj), array('Societe', 'Client', 'Fournisseur'))) { @@ -1457,7 +1457,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin $sql .= " INNER JOIN ".MAIN_DB_PREFIX."element_resources as er"; $sql .= " ON er.resource_type = 'dolresource'"; $sql .= " AND er.element_id = a.id"; - $sql .= " AND er.resource_id = ".$filterobj->id; + $sql .= " AND er.resource_id = ".((int) $filterobj->id); } elseif (is_object($filterobj) && get_class($filterobj) == 'Project') { /* Nothing */ } elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent') { @@ -1940,7 +1940,7 @@ function show_subsidiaries($conf, $langs, $db, $object) $sql = "SELECT s.rowid, s.client, s.fournisseur, s.nom as name, s.name_alias, s.email, s.address, s.zip, s.town, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur, s.canvas"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; - $sql .= " WHERE s.parent = ".$object->id; + $sql .= " WHERE s.parent = ".((int) $object->id); $sql .= " AND s.entity IN (".getEntity('societe').")"; $sql .= " ORDER BY s.nom"; diff --git a/htdocs/core/lib/fourn.lib.php b/htdocs/core/lib/fourn.lib.php index 68910357269..efc9f60147c 100644 --- a/htdocs/core/lib/fourn.lib.php +++ b/htdocs/core/lib/fourn.lib.php @@ -59,7 +59,7 @@ function facturefourn_prepare_head($object) $nbStandingOrders = 0; $sql = "SELECT COUNT(pfd.rowid) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; - $sql .= " WHERE pfd.fk_facture_fourn = ".$object->id; + $sql .= " WHERE pfd.fk_facture_fourn = ".((int) $object->id); $sql .= " AND pfd.ext_payment_id IS NULL"; $resql = $db->query($sql); if ($resql) { diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index 16891214ca5..0cbb89ae47b 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -734,7 +734,7 @@ function getDraftSupplierTable($maxCount = 500, $socid = 0) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($socid) { - $sql .= " AND f.fk_soc = ".$socid; + $sql .= " AND f.fk_soc = ".((int) $socid); } // Add where from hooks $parameters = array(); @@ -950,7 +950,7 @@ function getPurchaseInvoiceLatestEditTable($maxCount = 5, $socid = 0) $sql .= " WHERE f.fk_soc = s.rowid"; $sql .= " AND f.entity IN (".getEntity('facture_fourn').")"; if ($socid) { - $sql .= " AND f.fk_soc = ".$socid; + $sql .= " AND f.fk_soc = ".((int) $socid); } if (!$user->rights->societe->client->voir && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; @@ -1062,7 +1062,7 @@ function getCustomerInvoiceUnpaidOpenTable($maxCount = 500, $socid = 0) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($socid) { - $sql .= " AND f.fk_soc = ".$socid; + $sql .= " AND f.fk_soc = ".((int) $socid); } // Add where from hooks $parameters = array(); @@ -1250,7 +1250,7 @@ function getPurchaseInvoiceUnpaidOpenTable($maxCount = 500, $socid = 0) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($socid) { - $sql .= " AND ff.fk_soc = ".$socid; + $sql .= " AND ff.fk_soc = ".((int) $socid); } // Add where from hooks $parameters = array(); diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php index 880019d7b97..0814c0f4825 100644 --- a/htdocs/core/lib/sendings.lib.php +++ b/htdocs/core/lib/sendings.lib.php @@ -246,7 +246,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON obj.fk_product = p.rowid"; //TODO Add link to expeditiondet_batch $sql .= " WHERE e.entity IN (".getEntity('expedition').")"; - $sql .= " AND obj.fk_".$origin." = ".$origin_id; + $sql .= " AND obj.fk_".$origin." = ".((int) $origin_id); $sql .= " AND obj.rowid = ed.fk_origin_line"; $sql .= " AND ed.fk_expedition = e.rowid"; if ($filter) { diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index 4d9d4bb2fa2..0ba7f56c615 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -336,7 +336,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no if (is_object($objcon) && $objcon->id > 0) { $force_filter_contact = true; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm_resources as r ON a.id = r.fk_actioncomm"; - $sql .= " AND r.element_type = '".$db->escape($objcon->table_element)."' AND r.fk_element = ".$objcon->id; + $sql .= " AND r.element_type = '".$db->escape($objcon->table_element)."' AND r.fk_element = ".((int) $objcon->id); } if (is_object($filterobj) && get_class($filterobj) == 'Societe') { diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 6d01fcfee0a..cd9ae5ad297 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -110,7 +110,7 @@ function user_prepare_head($object) $nbNote = 0; $sql = "SELECT COUNT(n.rowid) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."notify_def as n"; - $sql .= " WHERE fk_user = ".$object->id; + $sql .= " WHERE fk_user = ".((int) $object->id); $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 5fbfc05a9fb..3b7cc0d1184 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -1371,7 +1371,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it if ($command) { $sql .= " AND command = '".$this->db->escape($command)."'"; } - $sql .= " AND entity = ".$entity; // Must be exact entity + $sql .= " AND entity = ".((int) $entity); // Must be exact entity $now = dol_now(); @@ -1612,7 +1612,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $sql = "SELECT count(*)"; $sql .= " FROM ".MAIN_DB_PREFIX."const"; $sql .= " WHERE ".$this->db->decrypt('name')." = '".$this->db->escape($name)."'"; - $sql .= " AND entity = ".$entity; + $sql .= " AND entity = ".((int) $entity); $result = $this->db->query($sql); if ($result) { @@ -2197,7 +2197,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $sql = "DELETE FROM ".MAIN_DB_PREFIX."const"; $sql .= " WHERE ".$this->db->decrypt('name')." LIKE '".$this->db->escape($this->const_name)."_".strtoupper($key)."'"; - $sql .= " AND entity = ".$entity; + $sql .= " AND entity = ".((int) $entity); dol_syslog(get_class($this)."::delete_const_".$key."", LOG_DEBUG); if (!$this->db->query($sql)) { diff --git a/htdocs/core/modules/mailings/pomme.modules.php b/htdocs/core/modules/mailings/pomme.modules.php index 03334e62322..a2a54c02c55 100644 --- a/htdocs/core/modules/mailings/pomme.modules.php +++ b/htdocs/core/modules/mailings/pomme.modules.php @@ -171,7 +171,7 @@ class mailing_pomme extends MailingTargets $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; $sql .= " WHERE u.email <> ''"; // u.email IS NOT NULL est implicite dans ce test $sql .= " AND u.entity IN (0,".$conf->entity.")"; - $sql .= " AND u.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")"; + $sql .= " AND u.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".((int) $mailing_id).")"; if (GETPOSTISSET("filter") && GETPOST("filter") == '1') { $sql .= " AND u.statut=1"; } diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php index b3b88224df6..f764c3f5f71 100644 --- a/htdocs/core/modules/mailings/thirdparties.modules.php +++ b/htdocs/core/modules/mailings/thirdparties.modules.php @@ -77,7 +77,7 @@ class mailing_thirdparties extends MailingTargets $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= " WHERE s.email <> ''"; $sql .= " AND s.entity IN (".getEntity('societe').")"; - $sql .= " AND s.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")"; + $sql .= " AND s.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".((int) $mailing_id).")"; } else { $addFilter = ""; if (GETPOSTISSET("filter_client") && GETPOST("filter_client") <> '-1') { @@ -112,7 +112,7 @@ class mailing_thirdparties extends MailingTargets $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."categorie_societe as cs, ".MAIN_DB_PREFIX."categorie as c"; $sql .= " WHERE s.email <> ''"; $sql .= " AND s.entity IN (".getEntity('societe').")"; - $sql .= " AND s.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")"; + $sql .= " AND s.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".((int) $mailing_id).")"; $sql .= " AND cs.fk_soc = s.rowid"; $sql .= " AND c.rowid = cs.fk_categorie"; $sql .= " AND c.rowid=".((int) GETPOST('filter', 'int')); @@ -122,7 +122,7 @@ class mailing_thirdparties extends MailingTargets $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."categorie_fournisseur as cs, ".MAIN_DB_PREFIX."categorie as c"; $sql .= " WHERE s.email <> ''"; $sql .= " AND s.entity IN (".getEntity('societe').")"; - $sql .= " AND s.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")"; + $sql .= " AND s.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".((int) $mailing_id).")"; $sql .= " AND cs.fk_soc = s.rowid"; $sql .= " AND c.rowid = cs.fk_categorie"; $sql .= " AND c.rowid=".((int) GETPOST('filter', 'int')); diff --git a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php index 7b5d4f38737..4c848b69ac0 100644 --- a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php +++ b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php @@ -110,7 +110,7 @@ class mailing_thirdparties_services_expired extends MailingTargets $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c"; $sql .= ", ".MAIN_DB_PREFIX."contratdet as cd, ".MAIN_DB_PREFIX."product as p"; $sql .= " WHERE s.entity IN (".getEntity('societe').")"; - $sql .= " AND s.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")"; + $sql .= " AND s.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".((int) $mailing_id).")"; $sql .= " AND s.rowid = c.fk_soc AND cd.fk_contrat = c.rowid AND s.email != ''"; $sql .= " AND cd.statut= 4 AND cd.fk_product=p.rowid AND p.ref = '".$this->db->escape($product)."'"; $sql .= " AND cd.date_fin_validite < '".$this->db->idate($now)."'"; diff --git a/htdocs/core/modules/movement/doc/pdf_standard.modules.php b/htdocs/core/modules/movement/doc/pdf_standard.modules.php index 82d930a1aac..872890958ff 100644 --- a/htdocs/core/modules/movement/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/movement/doc/pdf_standard.modules.php @@ -529,8 +529,8 @@ class pdf_stdandard extends ModelePDFMovement if (!empty($conf->global->MAIN_MULTILANGS)) { // si l'option est active $sql = "SELECT label"; $sql .= " FROM ".MAIN_DB_PREFIX."product_lang"; - $sql .= " WHERE fk_product=".$objp->rowid; - $sql .= " AND lang='".$this->db->escape($langs->getDefaultLang())."'"; + $sql .= " WHERE fk_product = ".((int) $objp->rowid); + $sql .= " AND lang = '".$this->db->escape($langs->getDefaultLang())."'"; $sql .= " LIMIT 1"; $result = $this->db->query($sql); diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index d007b421fd7..da95e841728 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -742,7 +742,7 @@ class doc_generic_project_odt extends ModelePDFProjects $sql .= ", u.lastname, u.firstname, t.thm"; $sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time as t"; $sql .= " , ".MAIN_DB_PREFIX."user as u"; - $sql .= " WHERE t.fk_task =".$task->id; + $sql .= " WHERE t.fk_task =".((int) $task->id); $sql .= " AND t.fk_user = u.rowid"; $sql .= " ORDER BY t.task_date DESC"; diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index 2d263aae6c0..0662e1a5a76 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -657,7 +657,7 @@ class doc_generic_task_odt extends ModelePDFTask $sql .= ", u.lastname, u.firstname"; $sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time as t"; $sql .= " , ".MAIN_DB_PREFIX."user as u"; - $sql .= " WHERE t.fk_task =".$object->id; + $sql .= " WHERE t.fk_task =".((int) $object->id); $sql .= " AND t.fk_user = u.rowid"; $sql .= " ORDER BY t.task_date DESC"; diff --git a/htdocs/core/modules/rapport/pdf_paiement.class.php b/htdocs/core/modules/rapport/pdf_paiement.class.php index b69ebdeb828..9f85aca1aff 100644 --- a/htdocs/core/modules/rapport/pdf_paiement.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement.class.php @@ -209,7 +209,7 @@ class pdf_paiement $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; } if (!empty($socid)) { - $sql .= " AND s.rowid = ".$socid; + $sql .= " AND s.rowid = ".((int) $socid); } // If global param PAYMENTS_REPORT_GROUP_BY_MOD is set, payement are ordered by paiement_code if (!empty($conf->global->PAYMENTS_REPORT_GROUP_BY_MOD)) { diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php index a57b996086b..b0cc07dcb62 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php @@ -315,7 +315,7 @@ class pdf_standard extends ModelePDFStock $sql .= " FROM ".MAIN_DB_PREFIX."product_stock as ps, ".MAIN_DB_PREFIX."product as p"; $sql .= " WHERE ps.fk_product = p.rowid"; $sql .= " AND ps.reel <> 0"; // We do not show if stock is 0 (no product in this warehouse) - $sql .= " AND ps.fk_entrepot = ".$object->id; + $sql .= " AND ps.fk_entrepot = ".((int) $object->id); $sql .= $this->db->order($sortfield, $sortorder); //dol_syslog('List products', LOG_DEBUG); diff --git a/htdocs/datapolicy/class/actions_datapolicy.class.php b/htdocs/datapolicy/class/actions_datapolicy.class.php index cbcaceec743..7a3ba77fb5a 100644 --- a/htdocs/datapolicy/class/actions_datapolicy.class.php +++ b/htdocs/datapolicy/class/actions_datapolicy.class.php @@ -121,7 +121,7 @@ class ActionsDatapolicy if ($object->update($object->id, $user, 0)) { // On supprime les contacts associé - $sql = "DELETE FROM ".MAIN_DB_PREFIX."socpeople WHERE fk_soc = ".$object->id; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."socpeople WHERE fk_soc = ".((int) $object->id); $this->db->query($sql); setEventMessages($langs->trans('ANONYMISER_SUCCESS'), array()); diff --git a/htdocs/don/class/api_donations.class.php b/htdocs/don/class/api_donations.class.php index 3ae04c64833..cfd9e8ccd8b 100644 --- a/htdocs/don/class/api_donations.class.php +++ b/htdocs/don/class/api_donations.class.php @@ -123,7 +123,7 @@ class Donations extends DolibarrApi $sql .= " AND t.fk_soc = sc.fk_soc"; } if ($thirdparty_ids) { - $sql .= " AND t.fk_soc = ".$thirdparty_ids." "; + $sql .= " AND t.fk_soc = ".((int) $thirdparty_ids)." "; } // Add sql filters diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 56062868d86..181b3fc0ca3 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -476,8 +476,8 @@ class Don extends CommonObject $sql .= ",address='".$this->db->escape($this->address)."'"; $sql .= ",zip='".$this->db->escape($this->zip)."'"; $sql .= ",town='".$this->db->escape($this->town)."'"; - $sql .= ",fk_country = ".($this->country_id > 0 ? $this->country_id : '0'); - $sql .= ",public=".$this->public; + $sql .= ",fk_country = ".($this->country_id > 0 ? ((int) $this->country_id) : '0'); + $sql .= ",public=".((int) $this->public); $sql .= ",fk_projet=".($this->fk_project > 0 ? $this->fk_project : 'null'); $sql .= ",note_private=".(!empty($this->note_private) ? ("'".$this->db->escape($this->note_private)."'") : "NULL"); $sql .= ",note_public=".(!empty($this->note_public) ? ("'".$this->db->escape($this->note_public)."'") : "NULL"); @@ -486,8 +486,8 @@ class Don extends CommonObject $sql .= ",email='".$this->db->escape(trim($this->email))."'"; $sql .= ",phone='".$this->db->escape(trim($this->phone))."'"; $sql .= ",phone_mobile='".$this->db->escape(trim($this->phone_mobile))."'"; - $sql .= ",fk_statut=".$this->statut; - $sql .= " WHERE rowid = ".$this->id; + $sql .= ",fk_statut=".((int) $this->statut); + $sql .= " WHERE rowid = ".((int) $this->id); dol_syslog(get_class($this)."::Update", LOG_DEBUG); $resql = $this->db->query($sql); diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php index b292dd33429..035a7aee9c6 100644 --- a/htdocs/ecm/class/ecmfiles.class.php +++ b/htdocs/ecm/class/ecmfiles.class.php @@ -425,7 +425,7 @@ class EcmFiles extends CommonObject //$sql .= " AND t.entity = ".$conf->entity; // hashforshare already unique } elseif ($src_object_type && $src_object_id) { // Warning: May return several record, and only first one is returned ! - $sql .= " AND t.src_object_type ='".$this->db->escape($src_object_type)."' AND t.src_object_id = ".$this->db->escape($src_object_id); + $sql .= " AND t.src_object_type = '".$this->db->escape($src_object_type)."' AND t.src_object_id = ".((int) $src_object_id); $sql .= " AND t.entity = ".$conf->entity; } else { $sql .= ' AND t.rowid = '.((int) $id); // rowid already unique diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index e282da6a4d9..6ece0bc115e 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -234,7 +234,7 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $obje $sql .= preg_replace('/^,/', '', $hookmanager->resPrint); $sql = preg_replace('/,\s*$/', '', $sql); $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; -$sql .= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm as a on a.id=t.fk_actioncomm AND a.id=".$confOrBooth->id; +$sql .= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm as a on a.id=t.fk_actioncomm AND a.id=".((int) $confOrBooth->id); if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; } diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index ae643ee688a..02ac007d30f 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1982,7 +1982,7 @@ if ($action == 'create') { //if ($conf->delivery_note->enabled) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."delivery as l ON l.fk_expedition = e.rowid LEFT JOIN ".MAIN_DB_PREFIX."deliverydet as ld ON ld.fk_delivery = l.rowid AND obj.rowid = ld.fk_origin_line"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON obj.fk_product = p.rowid"; $sql .= " WHERE e.entity IN (".getEntity('expedition').")"; - $sql .= " AND obj.fk_".$origin." = ".$origin_id; + $sql .= " AND obj.fk_".$origin." = ".((int) $origin_id); $sql .= " AND obj.rowid = ed.fk_origin_line"; $sql .= " AND ed.fk_expedition = e.rowid"; //if ($filter) $sql.= $filter; diff --git a/htdocs/expedition/class/api_shipments.class.php b/htdocs/expedition/class/api_shipments.class.php index dcd619da76e..2a4b6765b4e 100644 --- a/htdocs/expedition/class/api_shipments.class.php +++ b/htdocs/expedition/class/api_shipments.class.php @@ -140,7 +140,7 @@ class Shipments extends DolibarrApi } // Insert sale filter if ($search_sale > 0) { - $sql .= " AND sc.fk_user = ".$search_sale; + $sql .= " AND sc.fk_user = ".((int) $search_sale); } // Add sql filters if ($sqlfilters) { diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index ea5bd17fdfb..ee7324a22c4 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -2125,7 +2125,7 @@ class Expedition extends CommonObject if (!empty($this->shipping_method_id)) { $sql = "SELECT em.code, em.tracking"; $sql .= " FROM ".MAIN_DB_PREFIX."c_shipment_mode as em"; - $sql .= " WHERE em.rowid = ".$this->shipping_method_id; + $sql .= " WHERE em.rowid = ".((int) $this->shipping_method_id); $resql = $this->db->query($sql); if ($resql) { @@ -2981,8 +2981,8 @@ class ExpeditionLigne extends CommonObjectLine // update line $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET"; $sql .= " fk_entrepot = ".($this->entrepot_id > 0 ? $this->entrepot_id : 'null'); - $sql .= " , qty = ".$qty; - $sql .= " WHERE rowid = ".$this->id; + $sql .= " , qty = ".((float) price2num($qty, 'MS')); + $sql .= " WHERE rowid = ".((int) $this->id); if (!$this->db->query($sql)) { $this->errors[] = $this->db->lasterror()." - sql=$sql"; diff --git a/htdocs/expedition/class/expeditionbatch.class.php b/htdocs/expedition/class/expeditionbatch.class.php index 736cfba6e42..03066869450 100644 --- a/htdocs/expedition/class/expeditionbatch.class.php +++ b/htdocs/expedition/class/expeditionbatch.class.php @@ -186,7 +186,7 @@ class ExpeditionLineBatch extends CommonObject } $sql .= " FROM ".MAIN_DB_PREFIX.self::$_table_element." as eb"; if ($fk_product > 0) { - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_lot as pl ON pl.batch = eb.batch AND pl.fk_product = ".$fk_product; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_lot as pl ON pl.batch = eb.batch AND pl.fk_product = ".((int) $fk_product); } $sql .= " WHERE fk_expeditiondet=".(int) $id_line_expdet; diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index a1070d02ef1..5a110d33f2a 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -282,7 +282,7 @@ if ($search_user > 0) { } $sql .= " WHERE e.entity IN (".getEntity('expedition').")"; if ($search_product_category > 0) { - $sql .= " AND cp.fk_categorie = ".$search_product_category; + $sql .= " AND cp.fk_categorie = ".((int) $search_product_category); } if ($socid > 0) { $sql .= ' AND s.rowid = '.$socid; @@ -292,7 +292,7 @@ if (!$user->rights->societe->client->voir && !$socid) { // Internal user with no $sql .= " AND sc.fk_user = ".$user->id; } if ($socid) { - $sql .= " AND e.fk_soc = ".$socid; + $sql .= " AND e.fk_soc = ".((int) $socid); } if ($search_status <> '' && $search_status >= 0) { $sql .= " AND e.fk_statut = ".((int) $search_status); @@ -322,7 +322,7 @@ if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) { $sql .= " AND s.fk_typent IN (".$db->sanitize($search_type_thirdparty).')'; } if ($search_sale > 0) { - $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$search_sale; + $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $search_sale); } if ($search_user > 0) { // The contact on a shipment is also the contact of the order. @@ -353,7 +353,7 @@ if ($sall) { $sql .= natural_search(array_keys($fieldstosearchall), $sall); } if ($search_categ_cus > 0) { - $sql .= " AND cc.fk_categorie = ".$db->escape($search_categ_cus); + $sql .= " AND cc.fk_categorie = ".((int) $search_categ_cus); } if ($search_categ_cus == -2) { $sql .= " AND cc.fk_categorie IS NULL"; diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 8f5903dd988..42b8630bd3c 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -626,7 +626,7 @@ if ($id > 0 || !empty($ref)) { $sql .= ' p.surface, p.surface_units, p.volume, p.volume_units'; $sql .= " FROM ".MAIN_DB_PREFIX."commandedet as cd"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid"; - $sql .= " WHERE cd.fk_commande = ".$object->id; + $sql .= " WHERE cd.fk_commande = ".((int) $object->id); $sql .= " ORDER BY cd.rang, cd.rowid"; //print $sql; diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 34bef81e5a2..6cd3531f82d 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -990,9 +990,9 @@ class ExpenseReport extends CommonObject $total_ttc = $total_ht + $total_tva; $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET"; - $sql .= " total_ht = ".$total_ht; - $sql .= " , total_ttc = ".$total_ttc; - $sql .= " , total_tva = ".$total_tva; + $sql .= " total_ht = ".price2num($total_ht, 'MT'); + $sql .= " , total_ttc = ".price2num($total_ttc, 'MT'); + $sql .= " , total_tva = ".price2num($total_tva, 'MT'); $sql .= " WHERE rowid = ".((int) $id); $result = $this->db->query($sql); if ($result) : @@ -2811,30 +2811,30 @@ class ExpenseReportLine // Update line in database $sql = "UPDATE ".MAIN_DB_PREFIX."expensereport_det SET"; $sql .= " comments='".$this->db->escape($this->comments)."'"; - $sql .= ",value_unit=".$this->db->escape($this->value_unit); - $sql .= ",qty=".$this->db->escape($this->qty); + $sql .= ",value_unit = ".((float) $this->value_unit); + $sql .= ",qty=".((float) $this->qty); $sql .= ",date='".$this->db->idate($this->date)."'"; - $sql .= ",total_ht=".$this->db->escape($this->total_ht).""; - $sql .= ",total_tva=".$this->db->escape($this->total_tva).""; - $sql .= ",total_ttc=".$this->db->escape($this->total_ttc).""; - $sql .= ",tva_tx=".$this->db->escape($this->vatrate); + $sql .= ",total_ht=".((float) price2num($this->total_ht, 'MT')).""; + $sql .= ",total_tva=".((float) price2num($this->total_tva, 'MT')).""; + $sql .= ",total_ttc=".((float) price2num($this->total_ttc, 'MT')).""; + $sql .= ",tva_tx=".((float) $this->vatrate); $sql .= ",vat_src_code='".$this->db->escape($this->vat_src_code)."'"; $sql .= ",rule_warning_message='".$this->db->escape($this->rule_warning_message)."'"; $sql .= ",fk_c_exp_tax_cat=".$this->db->escape($this->fk_c_exp_tax_cat); - $sql .= ",fk_ecm_files=".($this->fk_ecm_files > 0 ? $this->fk_ecm_files : 'null'); + $sql .= ",fk_ecm_files=".($this->fk_ecm_files > 0 ? ((int) $this->fk_ecm_files) : 'null'); if ($this->fk_c_type_fees) { - $sql .= ",fk_c_type_fees=".$this->db->escape($this->fk_c_type_fees); + $sql .= ",fk_c_type_fees = ".((int) $this->fk_c_type_fees); } else { $sql .= ",fk_c_type_fees=null"; } if ($this->fk_project > 0) { - $sql .= ",fk_projet=".$this->db->escape($this->fk_project); + $sql .= ",fk_projet=".((int) $this->fk_project); } else { $sql .= ",fk_projet=null"; } - $sql .= " WHERE rowid = ".$this->db->escape($this->rowid ? $this->rowid : $this->id); + $sql .= " WHERE rowid = ".((int) ($this->rowid ? $this->rowid : $this->id)); - dol_syslog("ExpenseReportLine::update sql=".$sql); + dol_syslog("ExpenseReportLine::update"); $resql = $this->db->query($sql); if ($resql) { diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index fb031d81583..44ff46b233c 100644 --- a/htdocs/fichinter/card-rec.php +++ b/htdocs/fichinter/card-rec.php @@ -388,7 +388,7 @@ if ($action == 'create') { $sql = 'SELECT l.rowid, l.description, l.duree'; $sql .= " FROM ".MAIN_DB_PREFIX."fichinterdet as l"; - $sql .= " WHERE l.fk_fichinter= ".$object->id; + $sql .= " WHERE l.fk_fichinter= ".((int) $object->id); //$sql.= " AND l.fk_product is null "; $sql .= " ORDER BY l.rang"; diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index e2ac86f55bd..2e9d8a4a9b1 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -379,8 +379,8 @@ class Fichinter extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."fichinter SET "; $sql .= "description = '".$this->db->escape($this->description)."'"; - $sql .= ", duree = ".$this->duration; - $sql .= ", fk_projet = ".$this->fk_project; + $sql .= ", duree = ".((int) $this->duration); + $sql .= ", fk_projet = ".((int) $this->fk_project); $sql .= ", note_private = ".($this->note_private ? "'".$this->db->escape($this->note_private)."'" : "null"); $sql .= ", note_public = ".($this->note_public ? "'".$this->db->escape($this->note_public)."'" : "null"); $sql .= ", fk_user_modif = ".$user->id; diff --git a/htdocs/fourn/class/api_supplier_invoices.class.php b/htdocs/fourn/class/api_supplier_invoices.class.php index 34939bb599a..df1bf36b723 100644 --- a/htdocs/fourn/class/api_supplier_invoices.class.php +++ b/htdocs/fourn/class/api_supplier_invoices.class.php @@ -155,7 +155,7 @@ class SupplierInvoices extends DolibarrApi } // Insert sale filter if ($search_sale > 0) { - $sql .= " AND sc.fk_user = ".$search_sale; + $sql .= " AND sc.fk_user = ".((int) $search_sale); } // Add sql filters if ($sqlfilters) { diff --git a/htdocs/fourn/class/api_supplier_orders.class.php b/htdocs/fourn/class/api_supplier_orders.class.php index 09c9209629f..d4eedcd0fd9 100644 --- a/htdocs/fourn/class/api_supplier_orders.class.php +++ b/htdocs/fourn/class/api_supplier_orders.class.php @@ -171,7 +171,7 @@ class SupplierOrders extends DolibarrApi } // Insert sale filter if ($search_sale > 0) { - $sql .= " AND sc.fk_user = ".$search_sale; + $sql .= " AND sc.fk_user = ".((int) $search_sale); } // Add sql filters if ($sqlfilters) { diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index e2196d5595d..d9ca371c133 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -3058,7 +3058,7 @@ class CommandeFournisseur extends CommonOrder if ($this->methode_commande_id > 0) { $sql = "SELECT rowid, code, libelle as label"; $sql .= " FROM ".MAIN_DB_PREFIX.'c_input_method'; - $sql .= " WHERE active=1 AND rowid = ".$this->db->escape($this->methode_commande_id); + $sql .= " WHERE active=1 AND rowid = ".((int) $this->methode_commande_id); $resql = $this->db->query($sql); if ($resql) { diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 81533dae324..a48d00c820b 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -3401,7 +3401,7 @@ class SupplierInvoiceLine extends CommonObjectLine $sql .= ", pu_ttc = ".price2num($this->pu_ttc); $sql .= ", qty = ".price2num($this->qty); $sql .= ", remise_percent = ".price2num($this->remise_percent); - if ($this->fk_remise_except) $sql.= ", fk_remise_except=".$this->fk_remise_except; + if ($this->fk_remise_except) $sql.= ", fk_remise_except=".((int) $this->fk_remise_except); else $sql.= ", fk_remise_except=null"; $sql .= ", vat_src_code = '".$this->db->escape(empty($this->vat_src_code) ? '' : $this->vat_src_code)."'"; $sql .= ", tva_tx = ".price2num($this->tva_tx); @@ -3414,10 +3414,10 @@ class SupplierInvoiceLine extends CommonObjectLine $sql .= ", total_localtax1= ".price2num($this->total_localtax1); $sql .= ", total_localtax2= ".price2num($this->total_localtax2); $sql .= ", total_ttc = ".price2num($this->total_ttc); - $sql .= ", fk_product = ".$fk_product; - $sql .= ", product_type = ".$this->product_type; - $sql .= ", info_bits = ".$this->info_bits; - $sql .= ", fk_unit = ".$fk_unit; + $sql .= ", fk_product = ".((int) $fk_product); + $sql .= ", product_type = ".((int) $this->product_type); + $sql .= ", info_bits = ".((int) $this->info_bits); + $sql .= ", fk_unit = ".((int) $fk_unit); // Multicurrency $sql .= " , multicurrency_subprice=".price2num($this->multicurrency_subprice).""; @@ -3425,7 +3425,7 @@ class SupplierInvoiceLine extends CommonObjectLine $sql .= " , multicurrency_total_tva=".price2num($this->multicurrency_total_tva).""; $sql .= " , multicurrency_total_ttc=".price2num($this->multicurrency_total_ttc).""; - $sql .= " WHERE rowid = ".$this->id; + $sql .= " WHERE rowid = ".((int) $this->id); dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 21b4ec377a2..2172af578e9 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -789,14 +789,14 @@ class ProductFournisseur extends Product $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."product_fournisseur_price as pfp"; $sql .= " WHERE s.entity IN (".getEntity('societe').")"; $sql .= " AND pfp.entity = ".$conf->entity; // only current entity - $sql .= " AND pfp.fk_product = ".$prodid; + $sql .= " AND pfp.fk_product = ".((int) $prodid); $sql .= " AND pfp.fk_soc = s.rowid"; $sql .= " AND s.status = 1"; // only enabled society if ($qty > 0) { - $sql .= " AND pfp.quantity <= ".$qty; + $sql .= " AND pfp.quantity <= ".((float) $qty); } if ($socid > 0) { - $sql .= ' AND pfp.fk_soc = '.$socid; + $sql .= ' AND pfp.fk_soc = '.((int) $socid); } dol_syslog(get_class($this)."::find_min_price_product_fournisseur", LOG_DEBUG); @@ -1001,7 +1001,7 @@ class ProductFournisseur extends Product $sql .= " WHERE pfp.entity IN (".getEntity('productprice').")"; $sql .= " AND pfpl.fk_user = u.rowid"; $sql .= " AND pfp.rowid = pfpl.fk_product_fournisseur"; - $sql .= " AND pfpl.fk_product_fournisseur = ".$product_fourn_price_id; + $sql .= " AND pfpl.fk_product_fournisseur = ".((int) $product_fourn_price_id); if (empty($sortfield)) { $sql .= " ORDER BY pfpl.datec"; } else { diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php index eef851c6d73..1ea5db20b59 100644 --- a/htdocs/fourn/commande/index.php +++ b/htdocs/fourn/commande/index.php @@ -183,7 +183,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU $sql .= " AND c.entity IN (".getEntity("supplier_order").")"; // Thirdparty sharing is mandatory with supplier order sharing $sql .= " AND c.fk_statut = 0"; if (!empty($socid)) { - $sql .= " AND c.fk_soc = ".$socid; + $sql .= " AND c.fk_soc = ".((int) $socid); } if (!$user->rights->societe->client->voir && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; @@ -290,7 +290,7 @@ $sql .= " WHERE c.fk_soc = s.rowid"; $sql .= " AND c.entity = ".$conf->entity; //$sql.= " AND c.fk_statut > 2"; if (!empty($socid)) { - $sql .= " AND c.fk_soc = ".$socid; + $sql .= " AND c.fk_soc = ".((int) $socid); } if (!$user->rights->societe->client->voir && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; @@ -359,7 +359,7 @@ if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX $sql.= " WHERE c.fk_soc = s.rowid"; $sql.= " AND c.entity = ".$conf->entity; $sql.= " AND c.fk_statut = 1"; -if ($socid) $sql.= " AND c.fk_soc = ".$socid; +if ($socid) $sql.= " AND c.fk_soc = ".((int) $socid); if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; $sql.= " ORDER BY c.rowid DESC"; diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index d8959ada7c0..25f71f85eb4 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -651,7 +651,7 @@ $sql .= $hookmanager->resPrint; $sql .= ' WHERE cf.fk_soc = s.rowid'; $sql .= ' AND cf.entity IN ('.getEntity('supplier_order').')'; if ($socid > 0) { - $sql .= " AND s.rowid = ".$socid; + $sql .= " AND s.rowid = ".((int) $socid); } if (!$user->rights->societe->client->voir && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; @@ -672,10 +672,10 @@ if ($search_request_author) { $sql .= natural_search(array('u.lastname', 'u.firstname', 'u.login'), $search_request_author); } if ($search_billed != '' && $search_billed >= 0) { - $sql .= " AND cf.billed = ".$db->escape($search_billed); + $sql .= " AND cf.billed = ".((int) $search_billed); } if ($search_product_category > 0) { - $sql .= " AND cp.fk_categorie = ".$search_product_category; + $sql .= " AND cp.fk_categorie = ".((int) $search_product_category); } //Required triple check because statut=0 means draft filter if (GETPOST('statut', 'intcomma') !== '') { @@ -705,7 +705,7 @@ if ($search_company) { $sql .= natural_search('s.nom', $search_company); } if ($search_sale > 0) { - $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$db->escape($search_sale); + $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $search_sale); } if ($search_user > 0) { $sql .= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='supplier_order' AND tc.source='internal' AND ec.element_id = cf.rowid AND ec.fk_socpeople = ".$db->escape($search_user); diff --git a/htdocs/fourn/contact.php b/htdocs/fourn/contact.php index 82c8df6ac66..3196ffed7ac 100644 --- a/htdocs/fourn/contact.php +++ b/htdocs/fourn/contact.php @@ -94,7 +94,7 @@ if ($contactname) { } if ($socid) { - $sql .= " AND s.rowid = ".$socid; + $sql .= " AND s.rowid = ".((int) $socid); } $sql .= " ORDER BY $sortfield $sortorder "; diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 0c4f21ae4be..8578f82137d 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -451,10 +451,10 @@ if (!$user->rights->societe->client->voir && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($search_product_category > 0) { - $sql .= " AND cp.fk_categorie = ".$search_product_category; + $sql .= " AND cp.fk_categorie = ".((int) $search_product_category); } if ($socid > 0) { - $sql .= ' AND s.rowid = '.$socid; + $sql .= ' AND s.rowid = '.((int) $socid); } if ($search_ref) { if (is_numeric($search_ref)) { diff --git a/htdocs/fourn/index.php b/htdocs/fourn/index.php index 4a761ea8b70..8d124f46350 100644 --- a/htdocs/fourn/index.php +++ b/htdocs/fourn/index.php @@ -172,7 +172,7 @@ if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_S $sql .= " AND ff.entity = ".$conf->entity; $sql .= " AND ff.fk_statut = 0"; if ($socid) { - $sql .= " AND f.fk_soc = ".$socid; + $sql .= " AND f.fk_soc = ".((int) $socid); } $resql = $db->query($sql); @@ -243,7 +243,7 @@ if (!$user->rights->societe->client->voir && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($socid) { - $sql .= " AND s.rowid = ".$socid; + $sql .= " AND s.rowid = ".((int) $socid); } $sql .= " ORDER BY s.tms DESC"; $sql .= $db->plimit($max, 0); diff --git a/htdocs/fourn/product/list.php b/htdocs/fourn/product/list.php index ed137fd5d86..5ecec959614 100644 --- a/htdocs/fourn/product/list.php +++ b/htdocs/fourn/product/list.php @@ -174,10 +174,10 @@ if ($snom) { $sql .= natural_search('p.label', $snom); } if ($catid) { - $sql .= " AND cp.fk_categorie = ".$catid; + $sql .= " AND cp.fk_categorie = ".((int) $catid); } if ($fourn_id > 0) { - $sql .= " AND ppf.fk_soc = ".$fourn_id; + $sql .= " AND ppf.fk_soc = ".((int) $fourn_id); } // Add WHERE filters from hooks diff --git a/htdocs/fourn/recap-fourn.php b/htdocs/fourn/recap-fourn.php index adeaf7b1447..353083bd717 100644 --- a/htdocs/fourn/recap-fourn.php +++ b/htdocs/fourn/recap-fourn.php @@ -134,7 +134,7 @@ if ($socid > 0) { $sql .= " ".MAIN_DB_PREFIX."paiementfourn as p"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON p.fk_user_author = u.rowid"; $sql .= " WHERE pf.fk_paiementfourn = p.rowid"; - $sql .= " AND pf.fk_facturefourn = ".$fac->id; + $sql .= " AND pf.fk_facturefourn = ".((int) $fac->id); $resqlp = $db->query($sql); if ($resqlp) { diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 55dd1c4bafb..7e3585bd5bc 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -1477,7 +1477,7 @@ class Holiday extends CommonObject if ($num > 0) { // Update for user $sql = "UPDATE ".MAIN_DB_PREFIX."holiday_users SET"; - $sql .= " nb_holiday = ".$nbHoliday; + $sql .= " nb_holiday = ".((int) $nbHoliday); $sql .= " WHERE fk_user = ".(int) $userID." AND fk_type = ".(int) $fk_type; $result = $this->db->query($sql); if (!$result) { @@ -1487,7 +1487,7 @@ class Holiday extends CommonObject } else { // Insert for user $sql = "INSERT INTO ".MAIN_DB_PREFIX."holiday_users(nb_holiday, fk_user, fk_type) VALUES ("; - $sql .= $nbHoliday; + $sql .= ((int) $nbHoliday); $sql .= ", ".(int) $userID.", ".(int) $fk_type.")"; $result = $this->db->query($sql); if (!$result) { diff --git a/htdocs/hrm/class/establishment.class.php b/htdocs/hrm/class/establishment.class.php index c2fa520442b..2cac4a1352b 100644 --- a/htdocs/hrm/class/establishment.class.php +++ b/htdocs/hrm/class/establishment.class.php @@ -264,10 +264,10 @@ class Establishment extends CommonObject $sql .= ", zip = '".$this->db->escape($this->zip)."'"; $sql .= ", town = '".$this->db->escape($this->town)."'"; $sql .= ", fk_country = ".($this->country_id > 0 ? $this->country_id : 'null'); - $sql .= ", status = ".$this->db->escape($this->status); - $sql .= ", fk_user_mod = ".$user->id; - $sql .= ", entity = ".$this->entity; - $sql .= " WHERE rowid = ".$this->id; + $sql .= ", status = ".((int) $this->status); + $sql .= ", fk_user_mod = ".((int) $user->id); + $sql .= ", entity = ".((int) $this->entity); + $sql .= " WHERE rowid = ".((int) $this->id); dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); $result = $this->db->query($sql); diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index 50fd4c3f521..2315edc100c 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -190,7 +190,7 @@ if (!empty($conf->holiday->enabled) && $user->rights->holiday->read) { $sql .= ' AND x.fk_user IN ('.$db->sanitize(join(',', $childids)).')'; } //if (!$user->rights->societe->client->voir && !$user->socid) $sql.= " AND x.fk_soc = s. rowid AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; - //if (!empty($socid)) $sql.= " AND x.fk_soc = ".$socid; + //if (!empty($socid)) $sql.= " AND x.fk_soc = ".((int) $socid); $sql .= $db->order("x.tms", "DESC"); $sql .= $db->plimit($max, 0); @@ -271,7 +271,7 @@ if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->lire) $sql .= ' AND x.fk_user_author IN ('.$db->sanitize(join(',', $childids)).')'; } //if (!$user->rights->societe->client->voir && !$user->socid) $sql.= " AND x.fk_soc = s. rowid AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; - //if (!empty($socid)) $sql.= " AND x.fk_soc = ".$socid; + //if (!empty($socid)) $sql.= " AND x.fk_soc = ".((int) $socid); $sql .= $db->order("x.tms", "DESC"); $sql .= $db->plimit($max, 0); diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index f94e461398b..23acc7d4a1b 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -1183,7 +1183,7 @@ function migrate_contracts_date2($db, $langs, $conf) print $langs->trans('MigrationContractsInvalidDateFix', $obj->cref, $obj->date_contrat, $obj->datemin)."
    \n"; $sql = "UPDATE ".MAIN_DB_PREFIX."contrat"; $sql .= " SET date_contrat='".$db->idate($datemin)."'"; - $sql .= " WHERE rowid=".$obj->cref; + $sql .= " WHERE rowid = ".((int) $obj->cref); $resql2 = $db->query($sql); if (!$resql2) { dol_print_error($db); @@ -1275,8 +1275,8 @@ function migrate_contracts_open($db, $langs, $conf) print $langs->trans('MigrationReopenThisContract', $obj->cref)."
    \n"; $sql = "UPDATE ".MAIN_DB_PREFIX."contrat"; - $sql .= " SET statut=1"; - $sql .= " WHERE rowid=".$obj->cref; + $sql .= " SET statut = 1"; + $sql .= " WHERE rowid = ".((int) $obj->cref); $resql2 = $db->query($sql); if (!$resql2) { dol_print_error($db); @@ -2835,8 +2835,8 @@ function migrate_project_task_time($db, $langs, $conf) $newtime = $hour + $min; $sql2 = "UPDATE ".MAIN_DB_PREFIX."projet_task_time SET"; - $sql2 .= " task_duration = ".$newtime; - $sql2 .= " WHERE rowid = ".$obj->rowid; + $sql2 .= " task_duration = ".((int) $newtime); + $sql2 .= " WHERE rowid = ".((int) $obj->rowid); $resql2 = $db->query($sql2); if (!$resql2) { @@ -2865,7 +2865,7 @@ function migrate_project_task_time($db, $langs, $conf) if ($oldtime > 0) { foreach ($totaltime as $taskid => $total_duration) { $sql = "UPDATE ".MAIN_DB_PREFIX."projet_task SET"; - $sql .= " duration_effective = ".$total_duration; + $sql .= " duration_effective = ".((int) $total_duration); $sql .= " WHERE rowid = ".((int) $taskid); $resql = $db->query($sql); @@ -2945,7 +2945,7 @@ function migrate_customerorder_shipping($db, $langs, $conf) $sqlUpdate = "UPDATE ".MAIN_DB_PREFIX."expedition SET"; $sqlUpdate .= " ref_customer = '".$db->escape($obj->ref_client)."'"; $sqlUpdate .= ", date_delivery = '".$db->escape($obj->delivery_date ? $obj->delivery_date : 'null')."'"; - $sqlUpdate .= " WHERE rowid = ".$obj->shipping_id; + $sqlUpdate .= " WHERE rowid = ".((int) $obj->shipping_id); $result = $db->query($sqlUpdate); if (!$result) { @@ -3407,8 +3407,8 @@ function migrate_categorie_association($db, $langs, $conf) $obj = $db->fetch_object($resql); $sqlUpdate = "UPDATE ".MAIN_DB_PREFIX."categorie SET "; - $sqlUpdate .= "fk_parent = ".$obj->fk_categorie_mere; - $sqlUpdate .= " WHERE rowid = ".$obj->fk_categorie_fille; + $sqlUpdate .= "fk_parent = ".((int) $obj->fk_categorie_mere); + $sqlUpdate .= " WHERE rowid = ".((int) $obj->fk_categorie_fille); $result = $db->query($sqlUpdate); if (!$result) { diff --git a/htdocs/intracommreport/list.php b/htdocs/intracommreport/list.php index 1ba796026c6..686bd16d5de 100644 --- a/htdocs/intracommreport/list.php +++ b/htdocs/intracommreport/list.php @@ -237,8 +237,8 @@ if (dol_strlen($search_type) && $search_type != '-1') { if ($search_ref) $sql .= natural_search('i.ref', $search_ref); if ($search_label) $sql .= natural_search('i.label', $search_label); if ($search_barcode) $sql .= natural_search('i.barcode', $search_barcode); -if (isset($search_tosell) && dol_strlen($search_tosell) > 0 && $search_tosell!=-1) $sql.= " AND i.tosell = ".$db->escape($search_tosell); -if (isset($search_tobuy) && dol_strlen($search_tobuy) > 0 && $search_tobuy!=-1) $sql.= " AND i.tobuy = ".$db->escape($search_tobuy); +if (isset($search_tosell) && dol_strlen($search_tosell) > 0 && $search_tosell!=-1) $sql.= " AND i.tosell = ".((int) $search_tosell); +if (isset($search_tobuy) && dol_strlen($search_tobuy) > 0 && $search_tobuy!=-1) $sql.= " AND i.tobuy = ".((int) $search_tobuy); if (dol_strlen($canvas) > 0) $sql.= " AND i.canvas = '".$db->escape($canvas)."'"; */ diff --git a/htdocs/knowledgemanagement/knowledgemanagementindex.php b/htdocs/knowledgemanagement/knowledgemanagementindex.php index 86ea3f10e08..0402ab07710 100644 --- a/htdocs/knowledgemanagement/knowledgemanagementindex.php +++ b/htdocs/knowledgemanagement/knowledgemanagementindex.php @@ -113,7 +113,7 @@ if (! empty($conf->knowledgemanagement->enabled) && $user->rights->knowledgemana $sql.= " AND c.fk_statut = 0"; $sql.= " AND c.entity IN (".getEntity('commande').")"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; - if ($socid) $sql.= " AND c.fk_soc = ".$socid; + if ($socid) $sql.= " AND c.fk_soc = ".((int) $socid); $resql = $db->query($sql); if ($resql) diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php index b628de1b68b..b5c0ffc0add 100644 --- a/htdocs/loan/class/loan.class.php +++ b/htdocs/loan/class/loan.class.php @@ -356,12 +356,12 @@ class Loan extends CommonObject $sql .= " capital='".price2num($this->db->escape($this->capital))."',"; $sql .= " datestart='".$this->db->idate($this->datestart)."',"; $sql .= " dateend='".$this->db->idate($this->dateend)."',"; - $sql .= " nbterm=".$this->nbterm.","; - $sql .= " rate=".$this->db->escape($this->rate).","; + $sql .= " nbterm=".((float) $this->nbterm).","; + $sql .= " rate=".((float) $this->rate).","; $sql .= " accountancy_account_capital = '".$this->db->escape($this->account_capital)."',"; $sql .= " accountancy_account_insurance = '".$this->db->escape($this->account_insurance)."',"; $sql .= " accountancy_account_interest = '".$this->db->escape($this->account_interest)."',"; - $sql .= " fk_projet=".(empty($this->fk_project) ? 'NULL' : $this->fk_project).","; + $sql .= " fk_projet=".(empty($this->fk_project) ? 'NULL' : ((int) $this->fk_project)).","; $sql .= " fk_user_modif = ".$user->id.","; $sql .= " insurance_amount = '".price2num($this->db->escape($this->insurance_amount))."'"; $sql .= " WHERE rowid=".((int) $this->id); diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index 1ac670c4a7f..5f8c7320cd1 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -171,9 +171,9 @@ $sql .= ' AND s.entity IN ('.getEntity('societe').')'; $sql .= " AND d.fk_facture = f.rowid"; if ($agentid > 0) { if (!empty($conf->global->AGENT_CONTACT_TYPE)) { - $sql .= " AND ((e.fk_socpeople IS NULL AND sc.fk_user = ".$agentid.") OR (e.fk_socpeople IS NOT NULL AND e.fk_socpeople = ".$agentid."))"; + $sql .= " AND ((e.fk_socpeople IS NULL AND sc.fk_user = ".((int) $agentid).") OR (e.fk_socpeople IS NOT NULL AND e.fk_socpeople = ".((int) $agentid)."))"; } else { - $sql .= " AND sc.fk_user = ".$agentid; + $sql .= " AND sc.fk_user = ".((int) $agentid); } } if (!empty($startdate)) { diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php index 6f2337d1baf..a5e6e6af6e9 100644 --- a/htdocs/margin/tabs/productMargins.php +++ b/htdocs/margin/tabs/productMargins.php @@ -158,7 +158,7 @@ if ($id > 0 || !empty($ref)) { $sql .= " AND f.fk_statut > 0"; $sql .= " AND f.entity IN (".getEntity('invoice').")"; $sql .= " AND d.fk_facture = f.rowid"; - $sql .= " AND d.fk_product =".$object->id; + $sql .= " AND d.fk_product = ".((int) $object->id); if (!$user->rights->societe->client->voir && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; } diff --git a/htdocs/modulebuilder/template/class/api_mymodule.class.php b/htdocs/modulebuilder/template/class/api_mymodule.class.php index bc52cf7378f..faeb22a095b 100644 --- a/htdocs/modulebuilder/template/class/api_mymodule.class.php +++ b/htdocs/modulebuilder/template/class/api_mymodule.class.php @@ -145,14 +145,14 @@ class MyModuleApi extends DolibarrApi $sql .= " AND t.fk_soc = sc.fk_soc"; } if ($restrictonsocid && $socid) { - $sql .= " AND t.fk_soc = ".$socid; + $sql .= " AND t.fk_soc = ".((int) $socid); } if ($restrictonsocid && $search_sale > 0) { $sql .= " AND t.rowid = sc.fk_soc"; // Join for the needed table to filter by sale } // Insert sale filter if ($restrictonsocid && $search_sale > 0) { - $sql .= " AND sc.fk_user = ".$search_sale; + $sql .= " AND sc.fk_user = ".((int) $search_sale); } if ($sqlfilters) { if (!DolibarrApi::_checkFilters($sqlfilters)) { diff --git a/htdocs/modulebuilder/template/mymoduleindex.php b/htdocs/modulebuilder/template/mymoduleindex.php index 2d262aeeb36..990a6d91bfa 100644 --- a/htdocs/modulebuilder/template/mymoduleindex.php +++ b/htdocs/modulebuilder/template/mymoduleindex.php @@ -113,7 +113,7 @@ if (! empty($conf->mymodule->enabled) && $user->rights->mymodule->read) $sql.= " AND c.fk_statut = 0"; $sql.= " AND c.entity IN (".getEntity('commande').")"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; - if ($socid) $sql.= " AND c.fk_soc = ".$socid; + if ($socid) $sql.= " AND c.fk_soc = ".((int) $socid); $resql = $db->query($sql); if ($resql) diff --git a/htdocs/mrp/class/api_mos.class.php b/htdocs/mrp/class/api_mos.class.php index a2558fe6252..0ece243dc39 100644 --- a/htdocs/mrp/class/api_mos.class.php +++ b/htdocs/mrp/class/api_mos.class.php @@ -137,14 +137,14 @@ class Mos extends DolibarrApi $sql .= " AND t.fk_soc = sc.fk_soc"; } if ($restrictonsocid && $socid) { - $sql .= " AND t.fk_soc = ".$socid; + $sql .= " AND t.fk_soc = ".((int) $socid); } if ($restrictonsocid && $search_sale > 0) { $sql .= " AND t.rowid = sc.fk_soc"; // Join for the needed table to filter by sale } // Insert sale filter if ($restrictonsocid && $search_sale > 0) { - $sql .= " AND sc.fk_user = ".$search_sale; + $sql .= " AND sc.fk_user = ".((int) $search_sale); } if ($sqlfilters) { if (!DolibarrApi::_checkFilters($sqlfilters)) { diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index e11fb65184a..e35abff84bb 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -321,9 +321,9 @@ class Opensurveysondage extends CommonObject $sql .= " date_fin=".(dol_strlen($this->date_fin) != 0 ? "'".$this->db->idate($this->date_fin)."'" : 'null').","; $sql .= " status=".(isset($this->status) ? "'".$this->db->escape($this->status)."'" : "null").","; $sql .= " format=".(isset($this->format) ? "'".$this->db->escape($this->format)."'" : "null").","; - $sql .= " mailsonde=".(isset($this->mailsonde) ? $this->db->escape($this->mailsonde) : "null").","; - $sql .= " allow_comments=".$this->db->escape($this->allow_comments).","; - $sql .= " allow_spy=".$this->db->escape($this->allow_spy); + $sql .= " mailsonde=".(isset($this->mailsonde) ? ((int) $this->mailsonde) : "null").","; + $sql .= " allow_comments=".((int) $this->allow_comments).","; + $sql .= " allow_spy=".((int) $this->allow_spy); $sql .= " WHERE id_sondage='".$this->db->escape($this->id_sondage)."'"; $this->db->begin(); diff --git a/htdocs/partnership/class/partnershiputils.class.php b/htdocs/partnership/class/partnershiputils.class.php index 992fca2703e..04f5db251e5 100644 --- a/htdocs/partnership/class/partnershiputils.class.php +++ b/htdocs/partnership/class/partnershiputils.class.php @@ -102,7 +102,7 @@ class PartnershipUtils $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."adherent_type as dty on (dty.rowid = d.fk_adherent_type)"; $sql .= " WHERE fk_member > 0"; $sql .= " AND (d.datefin < '".$this->db->idate($datetotest)."' AND dty.subscription = 1)"; - $sql .= " AND p.status = ".$partnership::STATUS_ACCEPTED; // Only accepted not yet canceled + $sql .= " AND p.status = ".((int) $partnership::STATUS_ACCEPTED); // Only accepted not yet canceled $sql .= $this->db->order('d.rowid', 'ASC'); // Limit is managed into loop later @@ -263,7 +263,7 @@ class PartnershipUtils $sql .= " WHERE 1 = 1"; $sql .= " AND p.".$fk_partner." > 0"; - $sql .= " AND p.status = ".$partnership::STATUS_ACCEPTED; // Only accepted not yet canceled + $sql .= " AND p.status = ".((int) $partnership::STATUS_ACCEPTED); // Only accepted not yet canceled $sql .= " AND (p.last_check_backlink IS NULL OR p.last_check_backlink <= '".$this->db->idate($now - 7 * 24 * 3600)."')"; // Every week, check that website contains a link to dolibarr. $sql .= $this->db->order('p.rowid', 'ASC'); // Limit is managed into loop later diff --git a/htdocs/partnership/partnershipindex.php b/htdocs/partnership/partnershipindex.php index 8076f105dbb..ce7a17b8fce 100644 --- a/htdocs/partnership/partnershipindex.php +++ b/htdocs/partnership/partnershipindex.php @@ -113,7 +113,7 @@ if (! empty($conf->partnership->enabled) && $user->rights->partnership->read) $sql.= " AND c.fk_statut = 0"; $sql.= " AND c.entity IN (".getEntity('commande').")"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; - if ($socid) $sql.= " AND c.fk_soc = ".$socid; + if ($socid) $sql.= " AND c.fk_soc = ".((int) $socid); $resql = $db->query($sql); if ($resql) diff --git a/htdocs/product/ajax/products.php b/htdocs/product/ajax/products.php index 901e2b387e3..ac2e70e3287 100644 --- a/htdocs/product/ajax/products.php +++ b/htdocs/product/ajax/products.php @@ -122,8 +122,8 @@ if (!empty($action) && $action == 'fetch' && !empty($id)) { // Price by qty if (!empty($price_by_qty_rowid) && $price_by_qty_rowid >= 1 && (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))) { // If we need a particular price related to qty $sql = "SELECT price, unitprice, quantity, remise_percent"; - $sql .= " FROM ".MAIN_DB_PREFIX."product_price_by_qty "; - $sql .= " WHERE rowid=".$price_by_qty_rowid.""; + $sql .= " FROM ".MAIN_DB_PREFIX."product_price_by_qty"; + $sql .= " WHERE rowid = ".((int) $price_by_qty_rowid); $result = $db->query($sql); if ($result) { diff --git a/htdocs/product/canvas/product/actions_card_product.class.php b/htdocs/product/canvas/product/actions_card_product.class.php index 3bda877af62..d155abdc2c2 100644 --- a/htdocs/product/canvas/product/actions_card_product.class.php +++ b/htdocs/product/canvas/product/actions_card_product.class.php @@ -349,11 +349,11 @@ class ActionsCardProduct } } - if (isset($_GET["tosell"]) && dol_strlen($_GET["tosell"]) > 0) { - $sql .= " AND p.tosell = ".$this->db->escape($_GET["tosell"]); + if (GETPOSTISSET("tosell")) { + $sql .= " AND p.tosell = ".((int) GETPOST("tosell", "int")); } - if (isset($_GET["canvas"]) && dol_strlen($_GET["canvas"]) > 0) { - $sql .= " AND p.canvas = '".$this->db->escape($_GET["canvas"])."'"; + if (GETPOSTISSET("canvas")) { + $sql .= " AND p.canvas = '".$this->db->escape(GETPOST("canvas"))."'"; } $sql .= $this->db->order($sortfield, $sortorder); $sql .= $this->db->plimit($limit + 1, $offset); diff --git a/htdocs/product/canvas/service/actions_card_service.class.php b/htdocs/product/canvas/service/actions_card_service.class.php index 53e0df73212..c4296dc63a8 100644 --- a/htdocs/product/canvas/service/actions_card_service.class.php +++ b/htdocs/product/canvas/service/actions_card_service.class.php @@ -298,29 +298,29 @@ class ActionsCardService $sql .= " AND (p.ref LIKE '%".$this->db->escape($sall)."%' OR p.label LIKE '%".$this->db->escape($sall)."%' OR p.description LIKE '%".$this->db->escape($sall)."%' OR p.note LIKE '%".$this->db->escape($sall)."%')"; } if ($sref) { - $sql .= " AND p.ref LIKE '%".$sref."%'"; + $sql .= " AND p.ref LIKE '%".$this->db->escape($sref)."%'"; } if ($search_barcode) { - $sql .= " AND p.barcode LIKE '%".$search_barcode."%'"; + $sql .= " AND p.barcode LIKE '%".$this->db->escape($search_barcode)."%'"; } if ($snom) { $sql .= " AND p.label LIKE '%".$this->db->escape($snom)."%'"; } - if (isset($_GET["tosell"]) && dol_strlen($_GET["tosell"]) > 0) { - $sql .= " AND p.tosell = ".$this->db->escape($_GET["tosell"]); + if (GETPOSTISSET("tosell")) { + $sql .= " AND p.tosell = ".((int) GETPOST("tosell", 'int')); } - if (isset($_GET["canvas"]) && dol_strlen($_GET["canvas"]) > 0) { - $sql .= " AND p.canvas = '".$this->db->escape($_GET["canvas"])."'"; + if (GETPOSTISSET("canvas")) { + $sql .= " AND p.canvas = '".$this->db->escape(GETPOST("canvas"))."'"; } if ($catid) { - $sql .= " AND cp.fk_categorie = ".$catid; + $sql .= " AND cp.fk_categorie = ".((int) $catid); } if ($fourn_id > 0) { - $sql .= " AND p.rowid = pfp.fk_product AND pfp.fk_soc = ".$fourn_id; + $sql .= " AND p.rowid = pfp.fk_product AND pfp.fk_soc = ".((int) $fourn_id); } // Insert categ filter if ($search_categ) { - $sql .= " AND cp.fk_categorie = ".$this->db->escape($search_categ); + $sql .= " AND cp.fk_categorie = ".((int) $search_categ); } $sql .= $this->db->order($sortfield, $sortorder); $sql .= $this->db->plimit($limit + 1, $offset); diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index b4e860a1069..2e0d21b0456 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -206,8 +206,8 @@ class Products extends DolibarrApi // Select products of given category if ($category > 0) { - $sql .= " AND c.fk_categorie = ".$this->db->escape($category); - $sql .= " AND c.fk_product = t.rowid "; + $sql .= " AND c.fk_categorie = ".((int) $category); + $sql .= " AND c.fk_product = t.rowid"; } if ($mode == 1) { // Show only products diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 6aee9af9c60..1afd1e74e23 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1055,16 +1055,16 @@ class Product extends CommonObject $sql .= " SET label = '".$this->db->escape($this->label)."'"; if ($updatetype && ($this->isProduct() || $this->isService())) { - $sql .= ", fk_product_type = ".$this->type; + $sql .= ", fk_product_type = ".((int) $this->type); } $sql .= ", ref = '".$this->db->escape($this->ref)."'"; $sql .= ", ref_ext = ".(!empty($this->ref_ext) ? "'".$this->db->escape($this->ref_ext)."'" : "null"); $sql .= ", default_vat_code = ".($this->default_vat_code ? "'".$this->db->escape($this->default_vat_code)."'" : "null"); - $sql .= ", tva_tx = ".$this->tva_tx; - $sql .= ", recuperableonly = ".$this->tva_npr; - $sql .= ", localtax1_tx = ".$this->localtax1_tx; - $sql .= ", localtax2_tx = ".$this->localtax2_tx; + $sql .= ", tva_tx = ".((float) $this->tva_tx); + $sql .= ", recuperableonly = ".((int) $this->tva_npr); + $sql .= ", localtax1_tx = ".((float) $this->localtax1_tx); + $sql .= ", localtax2_tx = ".((float) $this->localtax2_tx); $sql .= ", localtax1_type = ".($this->localtax1_type != '' ? "'".$this->db->escape($this->localtax1_type)."'" : "'0'"); $sql .= ", localtax2_type = ".($this->localtax2_type != '' ? "'".$this->db->escape($this->localtax2_type)."'" : "'0'"); @@ -2391,8 +2391,8 @@ class Product extends CommonObject $sql .= " price_base_type, tva_tx, default_vat_code, tosell, price_by_qty, rowid, recuperableonly"; $sql .= " FROM ".MAIN_DB_PREFIX."product_price"; $sql .= " WHERE entity IN (".getEntity('productprice').")"; - $sql .= " AND price_level=".$i; - $sql .= " AND fk_product = ".$this->id; + $sql .= " AND price_level=".((int) $i); + $sql .= " AND fk_product = ".((int) $this->id); $sql .= " ORDER BY date_price DESC, rowid DESC"; $sql .= " LIMIT 1"; $resql = $this->db->query($sql); @@ -2501,7 +2501,7 @@ class Product extends CommonObject $sql .= " price_base_type, tva_tx, default_vat_code, tosell, price_by_qty, rowid, recuperableonly"; $sql .= " FROM ".MAIN_DB_PREFIX."product_price"; $sql .= " WHERE entity IN (".getEntity('productprice').")"; - $sql .= " AND price_level=".$i; + $sql .= " AND price_level=".((int) $i); $sql .= " AND fk_product = ".$this->id; $sql .= " ORDER BY date_price DESC, rowid DESC"; $sql .= " LIMIT 1"; @@ -2613,7 +2613,7 @@ class Product extends CommonObject $sql .= " AND mp.fk_product =".$this->id; $sql .= " AND mp.role ='".$this->db->escape($role)."'"; if ($socid > 0) { - $sql .= " AND c.fk_soc = ".$socid; + $sql .= " AND c.fk_soc = ".((int) $socid); } $result = $this->db->query($sql); @@ -2739,7 +2739,7 @@ class Product extends CommonObject } //$sql.= " AND pr.fk_statut != 0"; if ($socid > 0) { - $sql .= " AND p.fk_soc = ".$socid; + $sql .= " AND p.fk_soc = ".((int) $socid); } $result = $this->db->query($sql); @@ -2814,7 +2814,7 @@ class Product extends CommonObject } //$sql.= " AND pr.fk_statut != 0"; if ($socid > 0) { - $sql .= " AND p.fk_soc = ".$socid; + $sql .= " AND p.fk_soc = ".((int) $socid); } $result = $this->db->query($sql); @@ -2869,7 +2869,7 @@ class Product extends CommonObject $sql .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($socid > 0) { - $sql .= " AND c.fk_soc = ".$socid; + $sql .= " AND c.fk_soc = ".((int) $socid); } if ($filtrestatut <> '') { $sql .= " AND c.fk_statut in (".$this->db->sanitize($filtrestatut).")"; @@ -2971,7 +2971,7 @@ class Product extends CommonObject $sql .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($socid > 0) { - $sql .= " AND c.fk_soc = ".$socid; + $sql .= " AND c.fk_soc = ".((int) $socid); } if ($filtrestatut != '') { $sql .= " AND c.fk_statut in (".$this->db->sanitize($filtrestatut).")"; // Peut valoir 0 @@ -3033,7 +3033,7 @@ class Product extends CommonObject $sql .= " AND e.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($socid > 0) { - $sql .= " AND e.fk_soc = ".$socid; + $sql .= " AND e.fk_soc = ".((int) $socid); } if ($filtrestatut <> '') { $sql .= " AND c.fk_statut IN (".$this->db->sanitize($filtrestatut).")"; @@ -3114,7 +3114,7 @@ class Product extends CommonObject $sql .= " AND cf.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($socid > 0) { - $sql .= " AND cf.fk_soc = ".$socid; + $sql .= " AND cf.fk_soc = ".((int) $socid); } if ($filtrestatut <> '') { $sql .= " AND cf.fk_statut IN (".$this->db->sanitize($filtrestatut).")"; @@ -3170,7 +3170,7 @@ class Product extends CommonObject $sql .= " AND m.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($socid > 0) { - $sql .= " AND m.fk_soc = ".$socid; + $sql .= " AND m.fk_soc = ".((int) $socid); } if ($filtrestatut <> '') { $sql .= " AND m.status IN (".$this->db->sanitize($filtrestatut).")"; @@ -3265,7 +3265,7 @@ class Product extends CommonObject } //$sql.= " AND c.statut != 0"; if ($socid > 0) { - $sql .= " AND c.fk_soc = ".$socid; + $sql .= " AND c.fk_soc = ".((int) $socid); } $result = $this->db->query($sql); @@ -3339,7 +3339,7 @@ class Product extends CommonObject } //$sql.= " AND f.fk_statut != 0"; if ($socid > 0) { - $sql .= " AND f.fk_soc = ".$socid; + $sql .= " AND f.fk_soc = ".((int) $socid); } $result = $this->db->query($sql); @@ -3413,7 +3413,7 @@ class Product extends CommonObject } //$sql.= " AND f.fk_statut != 0"; if ($socid > 0) { - $sql .= " AND f.fk_soc = ".$socid; + $sql .= " AND f.fk_soc = ".((int) $socid); } $result = $this->db->query($sql); @@ -3655,7 +3655,7 @@ class Product extends CommonObject $sql .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($socid > 0) { - $sql .= " AND p.fk_soc = ".$socid; + $sql .= " AND p.fk_soc = ".((int) $socid); } $sql .= $morefilter; $sql .= " GROUP BY date_format(p.datep,'%Y%m')"; @@ -3758,7 +3758,7 @@ class Product extends CommonObject $sql .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($socid > 0) { - $sql .= " AND c.fk_soc = ".$socid; + $sql .= " AND c.fk_soc = ".((int) $socid); } $sql .= $morefilter; $sql .= " GROUP BY date_format(c.date_commande,'%Y%m')"; @@ -3809,7 +3809,7 @@ class Product extends CommonObject $sql .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($socid > 0) { - $sql .= " AND c.fk_soc = ".$socid; + $sql .= " AND c.fk_soc = ".((int) $socid); } $sql .= $morefilter; $sql .= " GROUP BY date_format(c.date_commande,'%Y%m')"; @@ -3863,7 +3863,7 @@ class Product extends CommonObject $sql .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($socid > 0) { - $sql .= " AND c.fk_soc = ".$socid; + $sql .= " AND c.fk_soc = ".((int) $socid); } $sql .= $morefilter; $sql .= " GROUP BY date_format(c.date_contrat,'%Y%m')"; @@ -3916,7 +3916,7 @@ class Product extends CommonObject $sql .= " AND d.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($socid > 0) { - $sql .= " AND d.fk_soc = ".$socid; + $sql .= " AND d.fk_soc = ".((int) $socid); } $sql .= $morefilter; $sql .= " GROUP BY date_format(d.date_valid,'%Y%m')"; diff --git a/htdocs/product/class/productbatch.class.php b/htdocs/product/class/productbatch.class.php index 10704f2f53e..529284af464 100644 --- a/htdocs/product/class/productbatch.class.php +++ b/htdocs/product/class/productbatch.class.php @@ -384,7 +384,7 @@ class Productbatch extends CommonObject $sql .= " t.qty,"; $sql .= " t.import_key"; $sql .= " FROM ".MAIN_DB_PREFIX.self::$_table_element." as t"; - $sql .= " WHERE fk_product_stock=".$fk_product_stock; + $sql .= " WHERE fk_product_stock=".((int) $fk_product_stock); if (!empty($eatby)) { array_push($where, " eatby = '".$this->db->idate($eatby)."'"); // deprecated @@ -454,10 +454,10 @@ class Productbatch extends CommonObject } $sql .= " FROM ".MAIN_DB_PREFIX."product_batch as t"; if ($fk_product > 0) { - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_lot as pl ON pl.fk_product = ".$fk_product." AND pl.batch = t.batch"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_lot as pl ON pl.fk_product = ".((int) $fk_product)." AND pl.batch = t.batch"; // TODO May add extrafields to ? } - $sql .= " WHERE fk_product_stock=".$fk_product_stock; + $sql .= " WHERE fk_product_stock=".((int) $fk_product_stock); if ($with_qty) { $sql .= " AND t.qty <> 0"; } diff --git a/htdocs/product/class/propalmergepdfproduct.class.php b/htdocs/product/class/propalmergepdfproduct.class.php index a1d92cc492a..0b5ea0cc2a6 100644 --- a/htdocs/product/class/propalmergepdfproduct.class.php +++ b/htdocs/product/class/propalmergepdfproduct.class.php @@ -408,10 +408,10 @@ class Propalmergepdfproduct extends CommonObject if (!$error) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."propal_merge_pdf_product"; - $sql .= " WHERE fk_product=".$product_id; + $sql .= " WHERE fk_product = ".((int) $product_id); if ($conf->global->MAIN_MULTILANGS && !empty($lang_id)) { - $sql .= " AND lang='".$this->db->escape($lang_id)."'"; + $sql .= " AND lang = '".$this->db->escape($lang_id)."'"; } dol_syslog(__METHOD__, LOG_DEBUG); diff --git a/htdocs/product/dynamic_price/class/price_global_variable.class.php b/htdocs/product/dynamic_price/class/price_global_variable.class.php index 5286b932ca7..0404f0bd97a 100644 --- a/htdocs/product/dynamic_price/class/price_global_variable.class.php +++ b/htdocs/product/dynamic_price/class/price_global_variable.class.php @@ -182,7 +182,7 @@ class PriceGlobalVariable $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET"; $sql .= " code = ".(isset($this->code) ? "'".$this->db->escape($this->code)."'" : "''").","; $sql .= " description = ".(isset($this->description) ? "'".$this->db->escape($this->description)."'" : "''").","; - $sql .= " value = ".$this->value; + $sql .= " value = ".((float) $this->value); $sql .= " WHERE rowid = ".$this->id; $this->db->begin(); diff --git a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php index 172c004a2d7..4272beb44bc 100644 --- a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php +++ b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php @@ -200,12 +200,12 @@ class PriceGlobalVariableUpdater // Update request $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET"; - $sql .= " type = ".$this->type.","; + $sql .= " type = ".((int) $this->type).","; $sql .= " description = ".(isset($this->description) ? "'".$this->db->escape($this->description)."'" : "''").","; $sql .= " parameters = ".(isset($this->parameters) ? "'".$this->db->escape($this->parameters)."'" : "''").","; - $sql .= " fk_variable = ".$this->fk_variable.","; - $sql .= " update_interval = ".$this->update_interval.","; - $sql .= " next_update = ".$this->next_update.","; + $sql .= " fk_variable = ".((int) $this->fk_variable).","; + $sql .= " update_interval = ".((int) $this->update_interval).","; + $sql .= " next_update = ".((int) $this->next_update).","; $sql .= " last_status = ".(isset($this->last_status) ? "'".$this->db->escape($this->last_status)."'" : "''"); $sql .= " WHERE rowid = ".$this->id; diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 0e709f54f99..4aaaf3a0fa7 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -287,7 +287,7 @@ if ((!empty($conf->product->enabled) || !empty($conf->service->enabled)) && ($us $sql .= " FROM ".MAIN_DB_PREFIX."product as p"; $sql .= " WHERE p.entity IN (".getEntity($product_static->element, 1).")"; if ($type != '') { - $sql .= " AND p.fk_product_type = ".$type; + $sql .= " AND p.fk_product_type = ".((int) $type); } // Add where from hooks $parameters = array(); @@ -445,8 +445,8 @@ function activitytrim($product_type) $sql .= " WHERE f.entity IN (".getEntity('invoice').")"; $sql .= " AND f.rowid = fd.fk_facture"; $sql .= " AND pf.fk_facture = f.rowid"; - $sql .= " AND pf.fk_paiement= p.rowid"; - $sql .= " AND fd.product_type=".$product_type; + $sql .= " AND pf.fk_paiement = p.rowid"; + $sql .= " AND fd.product_type = ".((int) $product_type); $sql .= " AND p.datep >= '".$db->idate(dol_get_first_day($yearofbegindate), 1)."'"; $sql .= " GROUP BY annee, mois "; $sql .= " ORDER BY annee, mois "; diff --git a/htdocs/product/list.php b/htdocs/product/list.php index eb3fc71d53a..0c922fab0dd 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -451,7 +451,7 @@ if (dol_strlen($canvas) > 0) { $sql .= " AND p.canvas = '".$db->escape($canvas)."'"; } if ($catid > 0) { - $sql .= " AND cp.fk_categorie = ".$catid; + $sql .= " AND cp.fk_categorie = ".((int) $catid); } if ($catid == -2) { $sql .= " AND cp.fk_categorie IS NULL"; diff --git a/htdocs/product/popuprop.php b/htdocs/product/popuprop.php index 5aa54b0963c..8ffae0bee8c 100644 --- a/htdocs/product/popuprop.php +++ b/htdocs/product/popuprop.php @@ -211,7 +211,7 @@ if ($mode && $mode != '-1') { if (!empty($conf->global->MAIN_MULTILANGS)) { // si l'option est active $sql = "SELECT label"; $sql .= " FROM ".MAIN_DB_PREFIX."product_lang"; - $sql .= " WHERE fk_product=".$prodid; + $sql .= " WHERE fk_product = ".((int) $prodid); $sql .= " AND lang='".$db->escape($langs->getDefaultLang())."'"; $sql .= " LIMIT 1"; diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index 342acb49b6e..f8db6915409 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -190,7 +190,7 @@ if ($fourn_id > 0) { } // Insert categ filter if ($search_categ) { - $sql .= " AND cp.fk_categorie = ".$db->escape($search_categ); + $sql .= " AND cp.fk_categorie = ".((int) $search_categ); } $sql .= " GROUP BY p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,"; $sql .= " p.fk_product_type, p.tms, p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock"; diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index 38b16cea44a..ea9901a3794 100644 --- a/htdocs/product/reassortlot.php +++ b/htdocs/product/reassortlot.php @@ -179,7 +179,7 @@ if ($fourn_id > 0) { } // Insert categ filter if ($search_categ) { - $sql .= " AND cp.fk_categorie = ".$db->escape($search_categ); + $sql .= " AND cp.fk_categorie = ".((int) $search_categ); } if ($search_warehouse) { $sql .= natural_search("e.ref", $search_warehouse); diff --git a/htdocs/product/stats/bom.php b/htdocs/product/stats/bom.php index 505bc8ed060..8db7c63d83e 100644 --- a/htdocs/product/stats/bom.php +++ b/htdocs/product/stats/bom.php @@ -138,7 +138,7 @@ if ($id > 0 || !empty($ref)) { $sql .= " FROM ".MAIN_DB_PREFIX."bom_bom as b"; $sql .= " WHERE "; $sql .= " b.entity IN (".getEntity('bom').")"; - $sql .= " AND b.fk_product =".$product->id; + $sql .= " AND b.fk_product = ".((int) $product->id); $sql .= $db->order($sortfield, $sortorder); // Count total nb of records @@ -184,9 +184,8 @@ if ($id > 0 || !empty($ref)) { $sql .= " SUM(bl.qty) as qty_toconsume"; $sql .= " FROM ".MAIN_DB_PREFIX."bom_bom as b"; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."bom_bomline as bl ON bl.fk_bom=b.rowid"; - $sql .= " WHERE "; - $sql .= " b.entity IN (".getEntity('bom').")"; - $sql .= " AND bl.fk_product=".$product->id; + $sql .= " WHERE b.entity IN (".getEntity('bom').")"; + $sql .= " AND bl.fk_product = ".((int) $product->id); $sql .= " GROUP BY b.rowid, b.ref, b.date_valid, b.status"; $sql .= $db->order($sortfield, $sortorder); diff --git a/htdocs/product/stats/commande.php b/htdocs/product/stats/commande.php index 9ba4dee7081..623306536b7 100644 --- a/htdocs/product/stats/commande.php +++ b/htdocs/product/stats/commande.php @@ -151,7 +151,7 @@ if ($id > 0 || !empty($ref)) { $sql .= " WHERE c.fk_soc = s.rowid"; $sql .= " AND c.entity IN (".getEntity('commande').")"; $sql .= " AND d.fk_commande = c.rowid"; - $sql .= " AND d.fk_product =".$product->id; + $sql .= " AND d.fk_product = ".((int) $product->id); if (!empty($search_month)) { $sql .= ' AND MONTH(c.date_commande) IN ('.$db->sanitize($search_month).')'; } @@ -159,7 +159,7 @@ if ($id > 0 || !empty($ref)) { $sql .= ' AND YEAR(c.date_commande) IN ('.$db->sanitize($search_year).')'; } if (!$user->rights->societe->client->voir && !$socid) { - $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; + $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { $sql .= " AND c.fk_soc = ".((int) $socid); diff --git a/htdocs/product/stats/commande_fournisseur.php b/htdocs/product/stats/commande_fournisseur.php index 6037f608b58..e42905811a8 100644 --- a/htdocs/product/stats/commande_fournisseur.php +++ b/htdocs/product/stats/commande_fournisseur.php @@ -152,7 +152,7 @@ if ($id > 0 || !empty($ref)) { $sql .= " WHERE c.fk_soc = s.rowid"; $sql .= " AND c.entity = ".$conf->entity; $sql .= " AND d.fk_commande = c.rowid"; - $sql .= " AND d.fk_product =".$product->id; + $sql .= " AND d.fk_product = ".((int) $product->id); if (!empty($search_month)) { $sql .= ' AND MONTH(c.date_commande) IN ('.$db->sanitize($search_month).')'; } @@ -160,7 +160,7 @@ if ($id > 0 || !empty($ref)) { $sql .= ' AND YEAR(c.date_commande) IN ('.$db->sanitize($search_year).')'; } if (!$user->rights->societe->client->voir && !$socid) { - $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; + $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { $sql .= " AND c.fk_soc = ".((int) $socid); diff --git a/htdocs/product/stats/contrat.php b/htdocs/product/stats/contrat.php index f91e74edf50..f71c907a430 100644 --- a/htdocs/product/stats/contrat.php +++ b/htdocs/product/stats/contrat.php @@ -142,7 +142,7 @@ if ($id > 0 || !empty($ref)) { $sql .= " WHERE c.rowid = cd.fk_contrat"; $sql .= " AND c.fk_soc = s.rowid"; $sql .= " AND c.entity IN (".getEntity('contract').")"; - $sql .= " AND cd.fk_product =".$product->id; + $sql .= " AND cd.fk_product = ".((int) $product->id); if (!$user->rights->societe->client->voir && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; } diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index 0681aa9b5ca..b8a83e847c2 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -168,7 +168,7 @@ if ($id > 0 || !empty($ref)) { $sql .= " WHERE f.fk_soc = s.rowid"; $sql .= " AND f.entity IN (".getEntity('invoice').")"; $sql .= " AND d.fk_facture = f.rowid"; - $sql .= " AND d.fk_product =".$product->id; + $sql .= " AND d.fk_product = ".((int) $product->id); if (!empty($search_month)) { $sql .= ' AND MONTH(f.datef) IN ('.$db->sanitize($search_month).')'; } diff --git a/htdocs/product/stats/facture_fournisseur.php b/htdocs/product/stats/facture_fournisseur.php index 69ef83ae5a7..2ad05313762 100644 --- a/htdocs/product/stats/facture_fournisseur.php +++ b/htdocs/product/stats/facture_fournisseur.php @@ -151,7 +151,7 @@ if ($id > 0 || !empty($ref)) { $sql .= " WHERE f.fk_soc = s.rowid"; $sql .= " AND f.entity IN (".getEntity('facture_fourn').")"; $sql .= " AND d.fk_facture_fourn = f.rowid"; - $sql .= " AND d.fk_product =".$product->id; + $sql .= " AND d.fk_product = ".((int) $product->id); if (!empty($search_month)) { $sql .= ' AND MONTH(f.datef) IN ('.$db->sanitize($search_month).')'; } diff --git a/htdocs/product/stats/mo.php b/htdocs/product/stats/mo.php index fefb89592e7..81bb29650db 100644 --- a/htdocs/product/stats/mo.php +++ b/htdocs/product/stats/mo.php @@ -137,7 +137,7 @@ if ($id > 0 || !empty($ref)) { $sql .= ", ".MAIN_DB_PREFIX."mrp_production as cd"; $sql .= " WHERE c.rowid = cd.fk_mo"; $sql .= " AND c.entity IN (".getEntity('mo').")"; - $sql .= " AND cd.fk_product =".$product->id; + $sql .= " AND cd.fk_product = ".((int) $product->id); if ($socid) { $sql .= " AND s.rowid = ".((int) $socid); } diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php index 96303ac598d..f2a26d4af73 100644 --- a/htdocs/product/stats/propal.php +++ b/htdocs/product/stats/propal.php @@ -153,7 +153,7 @@ if ($id > 0 || !empty($ref)) { $sql .= " WHERE p.fk_soc = s.rowid"; $sql .= " AND p.entity IN (".getEntity('propal').")"; $sql .= " AND d.fk_propal = p.rowid"; - $sql .= " AND d.fk_product =".$product->id; + $sql .= " AND d.fk_product = ".((int) $product->id); if (!empty($search_month)) { $sql .= ' AND MONTH(p.datep) IN ('.$db->sanitize($search_month).')'; } diff --git a/htdocs/product/stats/supplier_proposal.php b/htdocs/product/stats/supplier_proposal.php index 1b236ed3999..3de03aa73c1 100644 --- a/htdocs/product/stats/supplier_proposal.php +++ b/htdocs/product/stats/supplier_proposal.php @@ -152,7 +152,7 @@ if ($id > 0 || !empty($ref)) { $sql .= " WHERE p.fk_soc = s.rowid"; $sql .= " AND p.entity IN (".getEntity('supplier_proposal').")"; $sql .= " AND d.fk_supplier_proposal = p.rowid"; - $sql .= " AND d.fk_product =".$product->id; + $sql .= " AND d.fk_product = ".((int) $product->id); if (!empty($search_month)) { $sql .= ' AND MONTH(p.datep) IN ('.$db->sanitize($search_month).')'; } diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 91284944397..55ab129edee 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -645,7 +645,7 @@ if ($action == 'create') { $sql .= " WHERE ps.fk_product = p.rowid"; $sql .= " AND ps.reel <> 0"; // We do not show if stock is 0 (no product in this warehouse) - $sql .= " AND ps.fk_entrepot = ".$object->id; + $sql .= " AND ps.fk_entrepot = ".((int) $object->id); if ($separatedPMP) { $sql .= " AND pa.fk_product = p.rowid AND pa.entity = ". (int) $conf->entity; diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 35791bfd158..c7516066e7f 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -293,17 +293,17 @@ class Entrepot extends CommonObject $this->town = trim($this->town); $this->country_id = ($this->country_id > 0 ? $this->country_id : 0); - $sql = "UPDATE ".MAIN_DB_PREFIX."entrepot "; + $sql = "UPDATE ".MAIN_DB_PREFIX."entrepot"; $sql .= " SET ref = '".$this->db->escape($this->label)."'"; $sql .= ", fk_parent = ".(($this->fk_parent > 0) ? $this->fk_parent : "NULL"); $sql .= ", fk_project = ".(($this->fk_project > 0) ? $this->fk_project : "NULL"); $sql .= ", description = '".$this->db->escape($this->description)."'"; - $sql .= ", statut = ".$this->statut; + $sql .= ", statut = ".((int) $this->statut); $sql .= ", lieu = '".$this->db->escape($this->lieu)."'"; $sql .= ", address = '".$this->db->escape($this->address)."'"; $sql .= ", zip = '".$this->db->escape($this->zip)."'"; $sql .= ", town = '".$this->db->escape($this->town)."'"; - $sql .= ", fk_pays = ".$this->country_id; + $sql .= ", fk_pays = ".((int) $this->country_id); $sql .= ", phone = '".$this->db->escape($this->phone)."'"; $sql .= ", fax = '".$this->db->escape($this->fax)."'"; $sql .= " WHERE rowid = ".((int) $id); diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 0220df610e4..ef1393dfb63 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -951,7 +951,7 @@ if (!$variants) { $sql .= " WHERE ps.reel != 0"; $sql .= " AND ps.fk_entrepot = e.rowid"; $sql .= " AND e.entity IN (".getEntity('stock').")"; - $sql .= " AND ps.fk_product = ".$object->id; + $sql .= " AND ps.fk_product = ".((int) $object->id); $sql .= " ORDER BY e.ref"; $entrepotstatic = new Entrepot($db); diff --git a/htdocs/product/stock/stockatdate.php b/htdocs/product/stock/stockatdate.php index 52addeba637..77923d9e7c9 100644 --- a/htdocs/product/stock/stockatdate.php +++ b/htdocs/product/stock/stockatdate.php @@ -136,10 +136,10 @@ if ($date && $dateIsValid) { // Avoid heavy sql if mandatory date is not defined $sql .= " AND w.statut IN (".$db->sanitize(implode(',', $warehouseStatus)).")"; } if ($productid > 0) { - $sql .= " AND ps.fk_product = ".$productid; + $sql .= " AND ps.fk_product = ".((int) $productid); } if ($fk_warehouse > 0) { - $sql .= " AND ps.fk_entrepot = ".$fk_warehouse; + $sql .= " AND ps.fk_entrepot = ".((int) $fk_warehouse); } $sql .= " GROUP BY fk_product, fk_entrepot"; //print $sql; diff --git a/htdocs/projet/activity/index.php b/htdocs/projet/activity/index.php index 0191cc74ef8..60484eb4f17 100644 --- a/htdocs/projet/activity/index.php +++ b/htdocs/projet/activity/index.php @@ -425,7 +425,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_SH $sql .= " AND ect.fk_c_type_contact IN (".$db->sanitize(join(',', array_keys($listoftaskcontacttype))).") AND ect.element_id = t.rowid AND ect.fk_socpeople = ".$user->id; } if ($socid) { - $sql .= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; + $sql .= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".((int) $socid).")"; } $sql .= " AND p.fk_statut=1"; $sql .= " GROUP BY p.ref, p.title, p.rowid, p.fk_statut, p.fk_opp_status, p.public, t.label, t.rowid, t.planned_workload, t.duration_effective, t.progress, t.dateo, t.datee"; diff --git a/htdocs/projet/class/api_projects.class.php b/htdocs/projet/class/api_projects.class.php index b0b94264fb0..38f525626ba 100644 --- a/htdocs/projet/class/api_projects.class.php +++ b/htdocs/projet/class/api_projects.class.php @@ -146,7 +146,7 @@ class Projects extends DolibarrApi } // Select projects of given category if ($category > 0) { - $sql .= " AND c.fk_categorie = ".$this->db->escape($category)." AND c.fk_project = t.rowid "; + $sql .= " AND c.fk_categorie = ".((int) $category)." AND c.fk_project = t.rowid "; } // Add sql filters if ($sqlfilters) { diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 851703ce96b..e381aaabfb3 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -486,7 +486,7 @@ class Project extends CommonObject $sql .= ", title = '".$this->db->escape($this->title)."'"; $sql .= ", description = '".$this->db->escape($this->description)."'"; $sql .= ", fk_soc = ".($this->socid > 0 ? $this->socid : "null"); - $sql .= ", fk_statut = ".$this->statut; + $sql .= ", fk_statut = ".((int) $this->statut); $sql .= ", fk_opp_status = ".((is_numeric($this->opp_status) && $this->opp_status > 0) ? $this->opp_status : 'null'); $sql .= ", opp_percent = ".((is_numeric($this->opp_percent) && $this->opp_percent != '') ? $this->opp_percent : 'null'); $sql .= ", public = ".($this->public ? 1 : 0); @@ -1777,13 +1777,13 @@ class Project extends CommonObject if ($tableName == "actioncomm") { $sql .= " SET fk_project=".$this->id; - $sql .= " WHERE id=".$elementSelectId; + $sql .= " WHERE id=".((int) $elementSelectId); } elseif ($tableName == "entrepot") { $sql .= " SET fk_project=".$this->id; - $sql .= " WHERE rowid=".$elementSelectId; + $sql .= " WHERE rowid=".((int) $elementSelectId); } else { $sql .= " SET fk_projet=".$this->id; - $sql .= " WHERE rowid=".$elementSelectId; + $sql .= " WHERE rowid=".((int) $elementSelectId); } dol_syslog(get_class($this)."::update_element", LOG_DEBUG); @@ -1813,10 +1813,10 @@ class Project extends CommonObject if ($tableName == "actioncomm") { $sql .= " SET fk_project=NULL"; - $sql .= " WHERE id=".$elementSelectId; + $sql .= " WHERE id=".((int) $elementSelectId); } else { $sql .= " SET ".$projectfield."=NULL"; - $sql .= " WHERE rowid=".$elementSelectId; + $sql .= " WHERE rowid=".((int) $elementSelectId); } dol_syslog(get_class($this)."::remove_element", LOG_DEBUG); @@ -1888,10 +1888,10 @@ class Project extends CommonObject $sql .= " AND (ptt.task_date >= '".$this->db->idate($datestart)."' "; $sql .= " AND ptt.task_date <= '".$this->db->idate(dol_time_plus_duree($datestart, 1, 'w') - 1)."')"; if ($taskid) { - $sql .= " AND ptt.fk_task=".$taskid; + $sql .= " AND ptt.fk_task=".((int) $taskid); } if (is_numeric($userid)) { - $sql .= " AND ptt.fk_user=".$userid; + $sql .= " AND ptt.fk_user=".((int) $userid); } //print $sql; @@ -1951,10 +1951,10 @@ class Project extends CommonObject $sql .= " AND (ptt.task_date >= '".$this->db->idate($datestart)."' "; $sql .= " AND ptt.task_date <= '".$this->db->idate(dol_time_plus_duree($datestart, 1, 'm') - 1)."')"; if ($task_id) { - $sql .= " AND ptt.fk_task=".$taskid; + $sql .= " AND ptt.fk_task=".((int) $taskid); } if (is_numeric($userid)) { - $sql .= " AND ptt.fk_user=".$userid; + $sql .= " AND ptt.fk_user=".((int) $userid); } //print $sql; diff --git a/htdocs/projet/class/projectstats.class.php b/htdocs/projet/class/projectstats.class.php index 42c5ae2135f..1845e303704 100644 --- a/htdocs/projet/class/projectstats.class.php +++ b/htdocs/projet/class/projectstats.class.php @@ -68,7 +68,7 @@ class ProjectStats extends Stats $sql .= ", ".MAIN_DB_PREFIX."c_lead_status as cls"; $sql .= $this->buildWhere(); // For external user, no check is done on company permission because readability is managed by public status of project and assignement. - //if ($socid > 0) $sql.= " AND t.fk_soc = ".$socid; + //if ($socid > 0) $sql.= " AND t.fk_soc = ".((int) $socid); // No check is done on company permission because readability is managed by public status of project and assignement. //if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND ((s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id.") OR (s.rowid IS NULL))"; $sql .= " AND t.fk_opp_status = cls.rowid"; @@ -133,7 +133,7 @@ class ProjectStats extends Stats // $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "societe_commerciaux as sc ON sc.fk_soc=t.fk_soc AND sc.fk_user=" . $user->id; $sql .= $this->buildWhere(); // For external user, no check is done on company permission because readability is managed by public status of project and assignement. - //if ($socid > 0) $sql.= " AND t.fk_soc = ".$socid; + //if ($socid > 0) $sql.= " AND t.fk_soc = ".((int) $socid); // No check is done on company permission because readability is managed by public status of project and assignement. //if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND ((s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id.") OR (s.rowid IS NULL))"; $sql .= " GROUP BY year"; diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 9f81218ba8d..bd25398776e 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -854,7 +854,7 @@ class Task extends CommonObject $sql .= " AND p.rowid = ec.element_id"; $sql .= " AND ctc.rowid = ec.fk_c_type_contact"; $sql .= " AND ctc.element = 'project'"; - $sql .= " AND ec.fk_socpeople = ".$filteronprojuser; + $sql .= " AND ec.fk_socpeople = ".((int) $filteronprojuser); $sql .= " AND ec.statut = 4"; $sql .= " AND ctc.source = 'internal'"; } @@ -863,12 +863,12 @@ class Task extends CommonObject $sql .= " AND p.rowid = ec2.element_id"; $sql .= " AND ctc2.rowid = ec2.fk_c_type_contact"; $sql .= " AND ctc2.element = 'project_task'"; - $sql .= " AND ec2.fk_socpeople = ".$filterontaskuser; + $sql .= " AND ec2.fk_socpeople = ".((int) $filterontaskuser); $sql .= " AND ec2.statut = 4"; $sql .= " AND ctc2.source = 'internal'"; } if ($socid) { - $sql .= " AND p.fk_soc = ".$socid; + $sql .= " AND p.fk_soc = ".((int) $socid); } if ($projectid) { $sql .= " AND p.rowid IN (".$this->db->sanitize($projectid).")"; @@ -1525,10 +1525,10 @@ class Task extends CommonObject $sql .= " task_date = '".$this->db->idate($this->timespent_date)."',"; $sql .= " task_datehour = '".$this->db->idate($this->timespent_datehour)."',"; $sql .= " task_date_withhour = ".(empty($this->timespent_withhour) ? 0 : 1).","; - $sql .= " task_duration = ".$this->timespent_duration.","; - $sql .= " fk_user = ".$this->timespent_fk_user.","; + $sql .= " task_duration = ".((int) $this->timespent_duration).","; + $sql .= " fk_user = ".((int) $this->timespent_fk_user).","; $sql .= " note = ".(isset($this->timespent_note) ? "'".$this->db->escape($this->timespent_note)."'" : "null"); - $sql .= " WHERE rowid = ".$this->timespent_id; + $sql .= " WHERE rowid = ".((int) $this->timespent_id); dol_syslog(get_class($this)."::updateTimeSpent", LOG_DEBUG); if ($this->db->query($sql)) { @@ -2082,7 +2082,7 @@ class Task extends CommonObject // No need to check company, as filtering of projects must be done by getProjectsAuthorizedForUser //if ($socid || ! $user->rights->societe->client->voir) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; if ($socid) { - $sql .= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; + $sql .= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".((int) $socid).")"; } if (!$user->rights->societe->client->voir && !$socid) { $sql .= " AND ((s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id.") OR (s.rowid IS NULL))"; diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index d8c875d2933..aa9d9a8a437 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -213,7 +213,7 @@ if ($mine || empty($user->rights->projet->all->lire)) { $sql .= " AND p.rowid IN (".$db->sanitize($projectsListId).")"; // If we have this test true, it also means projectset is not 2 } if ($socid) { - $sql .= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; + $sql .= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".((int) $socid).")"; } $sql .= " ORDER BY p.tms DESC"; $sql .= $db->plimit($max, 0); diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index aa1229ccb42..c95ae10e79a 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -402,12 +402,12 @@ if ($search_status >= 0) { if ($search_status == 99) { $sql .= " AND p.fk_statut <> 2"; } else { - $sql .= " AND p.fk_statut = ".$db->escape($search_status); + $sql .= " AND p.fk_statut = ".((int) $search_status); } } if ($search_opp_status) { if (is_numeric($search_opp_status) && $search_opp_status > 0) { - $sql .= " AND p.fk_opp_status = ".$db->escape($search_opp_status); + $sql .= " AND p.fk_opp_status = ".((int) $search_opp_status); } if ($search_opp_status == 'all') { $sql .= " AND (p.fk_opp_status IS NOT NULL AND p.fk_opp_status <> -1)"; @@ -423,7 +423,7 @@ if ($search_opp_status) { } } if ($search_public != '') { - $sql .= " AND p.public = ".$db->escape($search_public); + $sql .= " AND p.public = ".((int) $search_public); } // For external user, no check is done on company permission because readability is managed by public status of project and assignement. //if ($socid > 0) $sql.= " AND s.rowid = ".((int) $socid); diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index e842b409eae..bbb7b1e51f9 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -39,6 +39,7 @@ $massaction = GETPOST('massaction', 'alpha'); $show_files = GETPOST('show_files', 'int'); $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); +$optioncss = GETPOST('optioncss', 'aZ09'); $id = GETPOST('id', 'int'); @@ -382,12 +383,9 @@ if ($search_projectstatus >= 0) { if ($search_projectstatus == 99) { $sql .= " AND p.fk_statut <> 2"; } else { - $sql .= " AND p.fk_statut = ".$db->escape($search_projectstatus); + $sql .= " AND p.fk_statut = ".((int) $search_projectstatus); } } -if ($search_public != '') { - $sql .= " AND p.public = ".$db->escape($search_public); -} if ($search_project_user > 0) { $sql .= " AND ecp.fk_c_type_contact IN (".$db->sanitize(join(',', array_keys($listofprojectcontacttype))).") AND ecp.element_id = p.rowid AND ecp.fk_socpeople = ".$search_project_user; } @@ -512,9 +510,6 @@ if ($search_projectstatus != '') { if ((is_numeric($search_opp_status) && $search_opp_status >= 0) || in_array($search_opp_status, array('all', 'none'))) { $param .= '&search_opp_status='.urlencode($search_opp_status); } -if ($search_public != '') { - $param .= '&search_public='.urlencode($search_public); -} if ($search_project_user != '') { $param .= '&search_project_user='.urlencode($search_project_user); } diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 01622a41945..a9316bcedcd 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -1043,7 +1043,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { $sql .= " ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."user as u"; $sql .= " WHERE t.fk_user = u.rowid AND t.fk_task = pt.rowid"; if (empty($projectidforalltimes)) { - $sql .= " AND t.fk_task =".$object->id; + $sql .= " AND t.fk_task =".((int) $object->id); } else { $sql .= " AND pt.fk_projet IN (".$db->sanitize($projectidforalltimes).")"; } diff --git a/htdocs/public/emailing/mailing-unsubscribe.php b/htdocs/public/emailing/mailing-unsubscribe.php index 9c39dafa18d..6648bafd07a 100644 --- a/htdocs/public/emailing/mailing-unsubscribe.php +++ b/htdocs/public/emailing/mailing-unsubscribe.php @@ -127,7 +127,7 @@ if (!empty($tag) && ($unsuscrib == '1')) { // Update status of mail in recipient mailing list table $statut = '3'; - $sql = "UPDATE ".MAIN_DB_PREFIX."mailing_cibles SET statut=".$statut." WHERE tag='".$db->escape($tag)."'"; + $sql = "UPDATE ".MAIN_DB_PREFIX."mailing_cibles SET statut=".((int) $statut)." WHERE tag = '".$db->escape($tag)."'"; $resql = $db->query($sql); if (!$resql) { diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index cd34b0f916f..531fdf9c23a 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -1699,10 +1699,10 @@ if ($action == 'create') { //if ($conf->delivery_note->enabled) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."delivery as l ON l.fk_reception = e.rowid LEFT JOIN ".MAIN_DB_PREFIX."deliverydet as ld ON ld.fk_delivery = l.rowid AND obj.rowid = ld.fk_origin_line"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON obj.fk_product = p.rowid"; $sql .= " WHERE e.entity IN (".getEntity('reception').")"; - $sql .= " AND obj.fk_commande = ".$origin_id; + $sql .= " AND obj.fk_commande = ".((int) $origin_id); $sql .= " AND obj.rowid = ed.fk_commandefourndet"; $sql .= " AND ed.fk_reception = e.rowid"; - $sql .= " AND ed.fk_reception !=".$object->id; + $sql .= " AND ed.fk_reception !=".(int) $object->id); //if ($filter) $sql.= $filter; $sql .= " ORDER BY obj.fk_product"; diff --git a/htdocs/reception/index.php b/htdocs/reception/index.php index 9eadc3be41a..7cb26dee0ca 100644 --- a/htdocs/reception/index.php +++ b/htdocs/reception/index.php @@ -94,7 +94,7 @@ if (!$user->rights->societe->client->voir && !$socid) { $sql .= $clause." e.fk_statut = 0"; $sql .= " AND e.entity IN (".getEntity('reception').")"; if ($socid) { - $sql .= " AND c.fk_soc = ".$socid; + $sql .= " AND c.fk_soc = ".((int) $socid); } $resql = $db->query($sql); @@ -160,7 +160,7 @@ if (!$user->rights->societe->client->voir && !$socid) { } $sql .= " AND e.fk_statut = 1"; if ($socid) { - $sql .= " AND c.fk_soc = ".$socid; + $sql .= " AND c.fk_soc = ".((int) $socid); } $sql .= " ORDER BY e.date_delivery DESC"; $sql .= $db->plimit($max, 0); @@ -219,7 +219,7 @@ $sql .= " WHERE c.fk_soc = s.rowid"; $sql .= " AND c.entity IN (".getEntity('supplier_order').")"; $sql .= " AND c.fk_statut IN (".CommandeFournisseur::STATUS_ORDERSENT.", ".CommandeFournisseur::STATUS_RECEIVED_PARTIALLY.")"; if ($socid > 0) { - $sql .= " AND c.fk_soc = ".$socid; + $sql .= " AND c.fk_soc = ".((int) $socid); } if (!$user->rights->societe->client->voir && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index 7295b3df75a..a6ecd37cc6d 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -454,10 +454,10 @@ if (!$user->rights->societe->client->voir && !$socid) { // Internal user with no $sql .= " AND sc.fk_user = ".$user->id; } if ($socid) { - $sql .= " AND e.fk_soc = ".$socid; + $sql .= " AND e.fk_soc = ".((int) $socid); } if ($search_status <> '' && $search_status >= 0) { - $sql .= " AND e.fk_statut = ".$search_status; + $sql .= " AND e.fk_statut = ".((int) $search_status); } if ($search_billed != '' && $search_billed >= 0) { $sql .= ' AND e.billed = '.((int) $search_billed); diff --git a/htdocs/recruitment/recruitmentindex.php b/htdocs/recruitment/recruitmentindex.php index 7e369fe6bb2..d3f97e6f3d1 100644 --- a/htdocs/recruitment/recruitmentindex.php +++ b/htdocs/recruitment/recruitmentindex.php @@ -255,7 +255,7 @@ if (! empty($conf->recruitment->enabled) && $user->rights->recruitment->read) $sql.= " AND c.fk_statut = 0"; $sql.= " AND c.entity IN (".getEntity('commande').")"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; - if ($socid) $sql.= " AND c.fk_soc = ".$socid; + if ($socid) $sql.= " AND c.fk_soc = ".((int) $socid); $resql = $db->query($sql); if ($resql) diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index 4979a883d9c..91f68951842 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -200,7 +200,7 @@ class Dolresource extends CommonObject $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element." as t"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_type_resource as ty ON ty.code=t.fk_code_type_resource"; if ($id) { - $sql .= " WHERE t.rowid = ".$this->db->escape($id); + $sql .= " WHERE t.rowid = ".((int) $id); } else { $sql .= " WHERE t.ref = '".$this->db->escape($ref)."'"; } @@ -415,7 +415,7 @@ class Dolresource extends CommonObject dol_syslog(get_class($this), LOG_DEBUG); if ($this->db->query($sql)) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."element_resources"; - $sql .= " WHERE element_type='resource' AND resource_id =".$this->db->escape($rowid); + $sql .= " WHERE element_type='resource' AND resource_id = ".((int) $rowid); dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql = $this->db->query($sql); if (!$resql) { @@ -831,7 +831,7 @@ class Dolresource extends CommonObject // Links beetween objects are stored in this table $sql = 'SELECT rowid, resource_id, resource_type, busy, mandatory'; $sql .= ' FROM '.MAIN_DB_PREFIX.'element_resources'; - $sql .= " WHERE element_id=".$element_id." AND element_type='".$this->db->escape($element)."'"; + $sql .= " WHERE element_id=".((int) $element_id)." AND element_type='".$this->db->escape($element)."'"; if ($resource_type) { $sql .= " AND resource_type LIKE '%".$this->db->escape($resource_type)."%'"; } diff --git a/htdocs/salaries/class/salary.class.php b/htdocs/salaries/class/salary.class.php index e7f1af66e0c..2f87fdd99d2 100644 --- a/htdocs/salaries/class/salary.class.php +++ b/htdocs/salaries/class/salary.class.php @@ -132,14 +132,13 @@ class Salary extends CommonObject // Update request $sql = "UPDATE ".MAIN_DB_PREFIX."salary SET"; - $sql .= " tms='".$this->db->idate(dol_now())."',"; - $sql .= " fk_user=".$this->fk_user.","; + $sql .= " fk_user=".((int) $this->fk_user).","; /*$sql .= " datep='".$this->db->idate($this->datep)."',"; $sql .= " datev='".$this->db->idate($this->datev)."',";*/ $sql .= " amount=".price2num($this->amount).","; $sql .= " fk_projet=".((int) $this->fk_project).","; - $sql .= " fk_typepayment=".$this->type_payment.","; + $sql .= " fk_typepayment=".((int) $this->type_payment).","; $sql .= " label='".$this->db->escape($this->label)."',"; $sql .= " datesp='".$this->db->idate($this->datesp)."',"; $sql .= " dateep='".$this->db->idate($this->dateep)."',"; @@ -147,7 +146,6 @@ class Salary extends CommonObject $sql .= " fk_bank=".($this->fk_bank > 0 ? (int) $this->fk_bank : "null").","; $sql .= " fk_user_author=".((int) $this->fk_user_author).","; $sql .= " fk_user_modif=".($this->fk_user_modif > 0 ? (int) $this->fk_user_modif : (int) $user->id); - $sql .= " WHERE rowid=".((int) $this->id); dol_syslog(get_class($this)."::update", LOG_DEBUG); diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php index 382e05e4f0d..b4abbb04a26 100644 --- a/htdocs/salaries/list.php +++ b/htdocs/salaries/list.php @@ -273,10 +273,10 @@ if ($search_account > 0) { $sql .= " AND s.fk_account=".((int) $search_account); } if ($search_status != '' && $search_status >= 0) { - $sql .= " AND s.paye = ".$db->escape($search_status); + $sql .= " AND s.paye = ".((int) $search_status); } if ($search_type_id) { - $sql .= " AND s.fk_typepayment=".$search_type_id; + $sql .= " AND s.fk_typepayment=".((int) $search_type_id); } $sql .= " GROUP BY u.rowid, u.lastname, u.firstname, u.login, u.email, u.admin, u.salary, u.fk_soc, u.statut,"; $sql .= " s.rowid, s.fk_account, s.paye, s.fk_user, s.amount, s.salary, s.label, s.datesp, s.dateep, s.fk_typepayment, s.fk_bank,"; diff --git a/htdocs/salaries/payments.php b/htdocs/salaries/payments.php index f0602e88a5c..7af7fa4d986 100644 --- a/htdocs/salaries/payments.php +++ b/htdocs/salaries/payments.php @@ -218,7 +218,7 @@ if ($search_fk_bank) $sql .= " AND s.fk_bank=".((int) $search_fk_bank); if ($search_chq_number) $sql .= natural_search(array('s.num_payment'), $search_chq_number); if ($search_type_id > 0) { - $sql .= " AND s.fk_typepayment=".$search_type_id; + $sql .= " AND s.fk_typepayment=".((int) $search_type_id); } $sql .= $db->order($sortfield, $sortorder); diff --git a/htdocs/societe/class/api_contacts.class.php b/htdocs/societe/class/api_contacts.class.php index f62fb894bd0..f8cd7f9d7ea 100644 --- a/htdocs/societe/class/api_contacts.class.php +++ b/htdocs/societe/class/api_contacts.class.php @@ -210,7 +210,7 @@ class Contacts extends DolibarrApi // Select contacts of given category if ($category > 0) { - $sql .= " AND c.fk_categorie = ".$this->db->escape($category); + $sql .= " AND c.fk_categorie = ".((int) $category); $sql .= " AND c.fk_socpeople = t.rowid "; } diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index 253a35e710c..0257b692b62 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -178,11 +178,11 @@ class Thirdparties extends DolibarrApi // Select thirdparties of given category if ($category > 0) { if (!empty($mode) && $mode != 4) { - $sql .= " AND c.fk_categorie = ".$this->db->escape($category)." AND c.fk_soc = t.rowid"; + $sql .= " AND c.fk_categorie = ".((int) $category)." AND c.fk_soc = t.rowid"; } elseif (!empty($mode) && $mode == 4) { - $sql .= " AND cc.fk_categorie = ".$this->db->escape($category)." AND cc.fk_soc = t.rowid"; + $sql .= " AND cc.fk_categorie = ".((int) $category)." AND cc.fk_soc = t.rowid"; } else { - $sql .= " AND ((c.fk_categorie = ".$this->db->escape($category)." AND c.fk_soc = t.rowid) OR (cc.fk_categorie = ".$this->db->escape($category)." AND cc.fk_soc = t.rowid))"; + $sql .= " AND ((c.fk_categorie = ".((int) $category)." AND c.fk_soc = t.rowid) OR (cc.fk_categorie = ".((int) $category)." AND cc.fk_soc = t.rowid))"; } } diff --git a/htdocs/societe/class/companybankaccount.class.php b/htdocs/societe/class/companybankaccount.class.php index 3e410019b22..6c52359979e 100644 --- a/htdocs/societe/class/companybankaccount.class.php +++ b/htdocs/societe/class/companybankaccount.class.php @@ -156,10 +156,10 @@ class CompanyBankAccount extends Account $sql .= ",cle_rib='".$this->db->escape($this->cle_rib)."'"; $sql .= ",bic='".$this->db->escape($this->bic)."'"; $sql .= ",iban_prefix = '".$this->db->escape($this->iban)."'"; - $sql .= ",domiciliation='".$this->db->escape($this->domiciliation)."'"; + $sql .= ",domiciliation = '".$this->db->escape($this->domiciliation)."'"; $sql .= ",proprio = '".$this->db->escape($this->proprio)."'"; $sql .= ",owner_address = '".$this->db->escape($this->owner_address)."'"; - $sql .= ",default_rib = ".$this->default_rib; + $sql .= ",default_rib = ".((int) $this->default_rib); if ($conf->prelevement->enabled) { $sql .= ",frstrecur = '".$this->db->escape($this->frstrecur)."'"; $sql .= ",rum = '".$this->db->escape($this->rum)."'"; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 97723f83f37..149801a65e2 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1386,7 +1386,7 @@ class Societe extends CommonObject $sql .= ",tva_assuj = ".($this->tva_assuj != '' ? "'".$this->db->escape($this->tva_assuj)."'" : "null"); $sql .= ",tva_intra = '".$this->db->escape($this->tva_intra)."'"; - $sql .= ",status = ".$this->status; + $sql .= ",status = ".((int) $this->status); // Local taxes $sql .= ",localtax1_assuj = ".($this->localtax1_assuj != '' ? "'".$this->db->escape($this->localtax1_assuj)."'" : "null"); @@ -1449,7 +1449,7 @@ class Societe extends CommonObject $sql .= ",webservices_key = ".(!empty($this->webservices_key) ? "'".$this->db->escape($this->webservices_key)."'" : "null"); //Incoterms - $sql .= ", fk_incoterms = ".$this->fk_incoterms; + $sql .= ", fk_incoterms = ".((int) $this->fk_incoterms); $sql .= ", location_incoterms = ".(!empty($this->location_incoterms) ? "'".$this->db->escape($this->location_incoterms)."'" : "null"); if ($customer) { @@ -3941,8 +3941,8 @@ class Societe extends CommonObject } $sql = "UPDATE ".MAIN_DB_PREFIX."adherent"; - $sql .= " SET fk_soc=".$this->id; - $sql .= " WHERE rowid=".$member->id; + $sql .= " SET fk_soc = ".((int) $this->id); + $sql .= " WHERE rowid = ".((int) $member->id); $resql = $this->db->query($sql); if ($resql) { diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index bf39dbc608c..5935ac43b70 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -288,7 +288,7 @@ if ($action == "change") { // Change customer for TakePOS $invoice->module_source = 'takepos'; $invoice->pos_source = $_SESSION["takeposterminal"]; $placeid = $invoice->create($user); - $sql = "UPDATE ".MAIN_DB_PREFIX."facture set ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")' where rowid=".$placeid; + $sql = "UPDATE ".MAIN_DB_PREFIX."facture set ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")' where rowid = ".((int) $placeid); $db->query($sql); } @@ -526,13 +526,13 @@ if (!$user->rights->fournisseur->lire) { if ($search_sale == -2) { $sql .= " AND sc.fk_user IS NULL"; } elseif ($search_sale > 0) { - $sql .= " AND sc.fk_user = ".$db->escape($search_sale); + $sql .= " AND sc.fk_user = ".((int) $search_sale); } if ($search_categ_cus > 0) { - $sql .= " AND cc.fk_categorie = ".$db->escape($search_categ_cus); + $sql .= " AND cc.fk_categorie = ".((int) $search_categ_cus); } if ($search_categ_sup > 0) { - $sql .= " AND cs.fk_categorie = ".$db->escape($search_categ_sup); + $sql .= " AND cs.fk_categorie = ".((int) $search_categ_sup); } if ($search_categ_cus == -2) { $sql .= " AND cc.fk_categorie IS NULL"; @@ -667,7 +667,7 @@ $parameters = array('socid' => $socid); $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook if (empty($reshook)) { if ($socid) { - $sql .= " AND s.rowid = ".$socid; + $sql .= " AND s.rowid = ".((int) $socid); } } $sql .= $hookmanager->resPrint; diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index 55ae070363a..7e4a1084ec1 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -34,8 +34,8 @@ $langs->loadLangs(array("companies", "mails", "admin", "other", "errors")); $socid = GETPOST("socid", 'int'); $action = GETPOST('action', 'aZ09'); -$contactid = GETPOST('contactid'); // May be an int or 'thirdparty' -$actionid = GETPOST('actionid'); +$contactid = GETPOST('contactid', 'alpha'); // May be an int or 'thirdparty' +$actionid = GETPOST('actionid', 'int'); $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') // Security check @@ -98,10 +98,10 @@ if (empty($reshook)) { $db->begin(); $sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def"; - $sql .= " WHERE fk_soc=".$socid." AND fk_contact=".$contactid." AND fk_action=".$actionid; + $sql .= " WHERE fk_soc=".((int) $socid)." AND fk_contact=".((int) $contactid)." AND fk_action=".((int) $actionid); if ($db->query($sql)) { $sql = "INSERT INTO ".MAIN_DB_PREFIX."notify_def (datec,fk_soc, fk_contact, fk_action)"; - $sql .= " VALUES ('".$db->idate($now)."',".$socid.",".$contactid.",".$actionid.")"; + $sql .= " VALUES ('".$db->idate($now)."',".((int) $socid).",".((int) $contactid).",".((int) $actionid).")"; if (!$db->query($sql)) { $error++; @@ -230,7 +230,7 @@ if ($result > 0) { $sql .= " ".MAIN_DB_PREFIX."socpeople c"; $sql .= " WHERE a.rowid = n.fk_action"; $sql .= " AND c.rowid = n.fk_contact"; - $sql .= " AND c.fk_soc = ".$object->id; + $sql .= " AND c.fk_soc = ".((int) $object->id); $resql = $db->query($sql); if ($resql) { @@ -399,7 +399,7 @@ if ($result > 0) { $sql .= " ".MAIN_DB_PREFIX."notify as n "; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as c ON n.fk_contact = c.rowid"; $sql .= " WHERE a.rowid = n.fk_action"; - $sql .= " AND n.fk_soc = ".$object->id; + $sql .= " AND n.fk_soc = ".((int) $object->id); $sql .= $db->order($sortfield, $sortorder); // Count total nb of records diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index ed392c0c0a1..2d2869fd1cc 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -977,8 +977,8 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' $sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX."societe_rib"; $sql .= " WHERE type in ('card')"; - $sql .= " AND fk_soc = ".$object->id; - $sql .= " AND status = ".$servicestatus; + $sql .= " AND fk_soc = ".((int) $object->id); + $sql .= " AND status = ".((int) $servicestatus); $resql = $db->query($sql); if ($resql) { diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 47793509bab..5906db24ee7 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -3211,7 +3211,7 @@ class SupplierProposalLine extends CommonObjectLine $sql = "UPDATE ".MAIN_DB_PREFIX."supplier_proposaldet SET"; $sql .= " description='".$this->db->escape($this->desc)."'"; $sql .= " , label=".(!empty($this->label) ? "'".$this->db->escape($this->label)."'" : "null"); - $sql .= " , product_type=".$this->product_type; + $sql .= " , product_type=".((int) $this->product_type); $sql .= " , date_start=".($this->date_start ? "'".$this->db->idate($this->date_start)."'" : "null"); $sql .= " , date_end=".($this->date_end ? "'".$this->db->idate($this->date_end)."'" : "null"); $sql .= " , tva_tx='".price2num($this->tva_tx)."'"; @@ -3233,11 +3233,11 @@ class SupplierProposalLine extends CommonObjectLine $sql .= " , fk_product_fournisseur_price=".(!empty($this->fk_fournprice) ? "'".$this->db->escape($this->fk_fournprice)."'" : "null"); $sql .= " , buy_price_ht=".price2num($this->pa_ht); if (strlen($this->special_code)) { - $sql .= " , special_code=".$this->special_code; + $sql .= " , special_code=".((int) $this->special_code); } $sql .= " , fk_parent_line=".($this->fk_parent_line > 0 ? $this->fk_parent_line : "null"); if (!empty($this->rang)) { - $sql .= ", rang=".$this->rang; + $sql .= ", rang=".((int) $this->rang); } $sql .= " , ref_fourn=".(!empty($this->ref_fourn) ? "'".$this->db->escape($this->ref_fourn)."'" : "null"); $sql .= " , fk_unit=".($this->fk_unit ? $this->fk_unit : 'null'); diff --git a/htdocs/supplier_proposal/index.php b/htdocs/supplier_proposal/index.php index 75eba410d0f..85f5f96c1af 100644 --- a/htdocs/supplier_proposal/index.php +++ b/htdocs/supplier_proposal/index.php @@ -173,7 +173,7 @@ if (!empty($conf->supplier_proposal->enabled)) { $sql .= " AND c.entity = ".$conf->entity; $sql .= " AND c.fk_statut = 0"; if ($socid) { - $sql .= " AND c.fk_soc = ".$socid; + $sql .= " AND c.fk_soc = ".((int) $socid); } if (!$user->rights->societe->client->voir && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; @@ -231,7 +231,7 @@ $sql .= " WHERE c.fk_soc = s.rowid"; $sql .= " AND c.entity = ".$conf->entity; //$sql.= " AND c.fk_statut > 2"; if ($socid) { - $sql .= " AND c.fk_soc = ".$socid; + $sql .= " AND c.fk_soc = ".((int) $socid); } if (!$user->rights->societe->client->voir && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 3b9a7892310..5fcafb2fdc4 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -382,7 +382,7 @@ if ($search_sale > 0) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $search_sale); } if ($search_user > 0) { - $sql .= " AND c.fk_c_type_contact = tc.rowid AND tc.element='supplier_proposal' AND tc.source='internal' AND c.element_id = sp.rowid AND c.fk_socpeople = ".$search_user; + $sql .= " AND c.fk_c_type_contact = tc.rowid AND tc.element='supplier_proposal' AND tc.source='internal' AND c.element_id = sp.rowid AND c.fk_socpeople = ".((int) $search_user); } // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; diff --git a/htdocs/takepos/floors.php b/htdocs/takepos/floors.php index 92d7e8288e1..0aa45028ddd 100644 --- a/htdocs/takepos/floors.php +++ b/htdocs/takepos/floors.php @@ -70,7 +70,7 @@ if (empty($user->rights->takepos->run)) { */ if ($action == "getTables") { - $sql = "SELECT rowid, entity, label, leftpos, toppos, floor FROM ".MAIN_DB_PREFIX."takepos_floor_tables where floor=".$floor; + $sql = "SELECT rowid, entity, label, leftpos, toppos, floor FROM ".MAIN_DB_PREFIX."takepos_floor_tables where floor = ".((int) $floor); $resql = $db->query($sql); $rows = array(); while ($row = $db->fetch_array($resql)) { diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 6582ec96172..60276c545ca 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -478,7 +478,7 @@ if (($action == "addline" || $action == "freezone") && $placeid == 0) { if ($placeid < 0) { dol_htmloutput_errors($invoice->error, $invoice->errors, 1); } - $sql = "UPDATE ".MAIN_DB_PREFIX."facture set ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")' where rowid=".$placeid; + $sql = "UPDATE ".MAIN_DB_PREFIX."facture set ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")' where rowid = ".((int) $placeid); $db->query($sql); } } diff --git a/htdocs/ticket/class/api_tickets.class.php b/htdocs/ticket/class/api_tickets.class.php index 7f2d2cf1be0..e104d425bf4 100644 --- a/htdocs/ticket/class/api_tickets.class.php +++ b/htdocs/ticket/class/api_tickets.class.php @@ -262,7 +262,7 @@ class Tickets extends DolibarrApi $sql .= " AND t.fk_soc = sc.fk_soc"; } if ($socid > 0) { - $sql .= " AND t.fk_soc = ".$socid; + $sql .= " AND t.fk_soc = ".((int) $socid); } if ($search_sale > 0) { $sql .= " AND t.rowid = sc.fk_soc"; // Join for the needed table to filter by sale @@ -270,7 +270,7 @@ class Tickets extends DolibarrApi // Insert sale filter if ($search_sale > 0) { - $sql .= " AND sc.fk_user = ".$search_sale; + $sql .= " AND sc.fk_user = ".((int) $search_sale); } // Add sql filters if ($sqlfilters) { diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 61a6d15d9a1..f4e92ecab18 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1829,19 +1829,22 @@ class Ticket extends CommonObject public function searchSocidByEmail($email, $type = '0', $filters = array(), $clause = 'AND') { $thirdparties = array(); + $case = 0; + $exact = 0; // Generation requete recherche $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe"; $sql .= " WHERE entity IN (".getEntity('ticket', 1).")"; if (!empty($type)) { if ($type == 1 || $type == 2) { - $sql .= " AND client = ".$type; + $sql .= " AND client = ".((int) $type); } elseif ($type == 3) { $sql .= " AND fournisseur = 1"; } } if (!empty($email)) { if (!$exact) { + $regs = array(); if (preg_match('/^([\*])?[^*]+([\*])?$/', $email, $regs) && count($regs) > 1) { $email = str_replace('*', '%', $email); } else { diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index 9fa84042c3a..e0cbd849092 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -93,7 +93,7 @@ class Users extends DolibarrApi // Select products of given category if ($category > 0) { - $sql .= " AND c.fk_categorie = ".$this->db->escape($category); + $sql .= " AND c.fk_categorie = ".((int) $category); $sql .= " AND c.fk_user = t.rowid"; } diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 910edce8c17..ec09aafeef5 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1418,10 +1418,10 @@ class User extends CommonObject $result = $this->create($user, 1); if ($result > 0) { $sql = "UPDATE ".MAIN_DB_PREFIX."user"; - $sql .= " SET fk_socpeople=".$contact->id; + $sql .= " SET fk_socpeople=".((int) $contact->id); $sql .= ", civility='".$this->db->escape($contact->civility_code)."'"; if ($contact->socid > 0) { - $sql .= ", fk_soc=".$contact->socid; + $sql .= ", fk_soc=".((int) $contact->socid); } $sql .= " WHERE rowid=".((int) $this->id); @@ -1517,7 +1517,7 @@ class User extends CommonObject if ($result > 0 && $member->fk_soc) { // If member is linked to a thirdparty $sql = "UPDATE ".MAIN_DB_PREFIX."user"; - $sql .= " SET fk_soc=".$member->fk_soc; + $sql .= " SET fk_soc=".((int) $member->fk_soc); $sql .= " WHERE rowid=".((int) $this->id); dol_syslog(get_class($this)."::create_from_member", LOG_DEBUG); diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index cacaeb54fc1..083b1bcc18c 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -194,7 +194,7 @@ class UserGroup extends CommonObject $sql .= " FROM ".MAIN_DB_PREFIX."usergroup as g,"; $sql .= " ".MAIN_DB_PREFIX."usergroup_user as ug"; $sql .= " WHERE ug.fk_usergroup = g.rowid"; - $sql .= " AND ug.fk_user = ".$userid; + $sql .= " AND ug.fk_user = ".((int) $userid); if (!empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && !$user->entity) { $sql .= " AND g.entity IS NOT NULL"; } else { @@ -359,7 +359,7 @@ class UserGroup extends CommonObject //print "$module-$perms-$subperms"; $sql = "SELECT id"; $sql .= " FROM ".MAIN_DB_PREFIX."rights_def"; - $sql .= " WHERE entity = ".$entity; + $sql .= " WHERE entity = ".((int) $entity); if (!empty($whereforadd) && $whereforadd != 'allmodules') { $sql .= " AND ".$whereforadd; } @@ -438,8 +438,8 @@ class UserGroup extends CommonObject // les caracteristiques module, perms et subperms de ce droit. $sql = "SELECT module, perms, subperms"; $sql .= " FROM ".MAIN_DB_PREFIX."rights_def"; - $sql .= " WHERE id = '".$this->db->escape($rid)."'"; - $sql .= " AND entity = ".$entity; + $sql .= " WHERE id = ".((int) $rid); + $sql .= " AND entity = ".((int) $entity); $result = $this->db->query($sql); if ($result) { @@ -454,8 +454,8 @@ class UserGroup extends CommonObject dol_print_error($this->db); } - // Where pour la liste des droits a supprimer - $wherefordel = "id=".$this->db->escape($rid); + // Where for the list of permissions to delete + $wherefordel = "id = ".((int) $rid); // Suppression des droits induits if ($subperms == 'lire' || $subperms == 'read') { $wherefordel .= " OR (module='".$this->db->escape($module)."' AND perms='".$this->db->escape($perms)."' AND subperms IS NOT NULL)"; diff --git a/htdocs/user/list.php b/htdocs/user/list.php index bd82824cb05..62372df637a 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -423,7 +423,7 @@ if ($search_categ == -2) { $sql .= " AND cu.fk_categorie IS NULL"; } if ($search_warehouse > 0) { - $sql .= " AND u.fk_warehouse = ".$db->escape($search_warehouse); + $sql .= " AND u.fk_warehouse = ".((int) $search_warehouse); } if ($mode == 'employee' && empty($user->rights->salaries->readall)) { $sql .= " AND u.rowid IN (".$db->sanitize(join(',', $childids)).")"; diff --git a/htdocs/webservices/server_invoice.php b/htdocs/webservices/server_invoice.php index d1382ac7c62..3fa61960b8c 100644 --- a/htdocs/webservices/server_invoice.php +++ b/htdocs/webservices/server_invoice.php @@ -425,7 +425,7 @@ function getInvoicesForThirdParty($authentication, $idthirdparty) $sql .= ' FROM '.MAIN_DB_PREFIX.'facture as f'; $sql .= " WHERE f.entity IN (".getEntity('invoice').")"; if ($idthirdparty != 'all') { - $sql .= " AND f.fk_soc = ".$db->escape($idthirdparty); + $sql .= " AND f.fk_soc = ".((int) $idthirdparty); } $resql = $db->query($sql); diff --git a/htdocs/webservices/server_order.php b/htdocs/webservices/server_order.php index 8f3d5af17e6..73769d43cec 100644 --- a/htdocs/webservices/server_order.php +++ b/htdocs/webservices/server_order.php @@ -537,7 +537,7 @@ function getOrdersForThirdParty($authentication, $idthirdparty) $sql .= ' FROM '.MAIN_DB_PREFIX.'commande as c'; $sql .= " WHERE c.entity = ".$conf->entity; if ($idthirdparty != 'all') { - $sql .= " AND c.fk_soc = ".$db->escape($idthirdparty); + $sql .= " AND c.fk_soc = ".((int) $idthirdparty); } diff --git a/htdocs/webservices/server_productorservice.php b/htdocs/webservices/server_productorservice.php index 95b7246d021..35997d16d6e 100644 --- a/htdocs/webservices/server_productorservice.php +++ b/htdocs/webservices/server_productorservice.php @@ -916,13 +916,13 @@ function getListOfProductsOrServices($authentication, $filterproduct) $sql .= " WHERE entity=".$conf->entity; foreach ($filterproduct as $key => $val) { if ($key == 'type' && $val >= 0) { - $sql .= " AND fk_product_type = ".$db->escape($val); + $sql .= " AND fk_product_type = ".((int) $val); } if ($key == 'status_tosell') { - $sql .= " AND tosell = ".$db->escape($val); + $sql .= " AND tosell = ".((int) $val); } if ($key == 'status_tobuy') { - $sql .= " AND tobuy = ".$db->escape($val); + $sql .= " AND tobuy = ".((int) $val); } } $resql = $db->query($sql); diff --git a/htdocs/webservices/server_supplier_invoice.php b/htdocs/webservices/server_supplier_invoice.php index 2a17ea15265..6803133d527 100644 --- a/htdocs/webservices/server_supplier_invoice.php +++ b/htdocs/webservices/server_supplier_invoice.php @@ -358,7 +358,7 @@ function getSupplierInvoicesForThirdParty($authentication, $idthirdparty) //$sql.=" WHERE f.fk_soc = s.rowid AND nom = '".$db->escape($idthirdparty)."'"; $sql .= " WHERE f.entity = ".$conf->entity; if ($idthirdparty != 'all') { - $sql .= " AND f.fk_soc = ".$db->escape($idthirdparty); + $sql .= " AND f.fk_soc = ".((int) $idthirdparty); } $resql = $db->query($sql); diff --git a/htdocs/webservices/server_thirdparty.php b/htdocs/webservices/server_thirdparty.php index c256e975217..dbf2f3dd125 100644 --- a/htdocs/webservices/server_thirdparty.php +++ b/htdocs/webservices/server_thirdparty.php @@ -707,13 +707,13 @@ function getListOfThirdParties($authentication, $filterthirdparty) $sql .= " AND s.name LIKE '%".$db->escape($val)."%'"; } if ($key == 'client' && (int) $val > 0) { - $sql .= " AND s.client = ".$db->escape($val); + $sql .= " AND s.client = ".((int) $val); } if ($key == 'supplier' && (int) $val > 0) { - $sql .= " AND s.fournisseur = ".$db->escape($val); + $sql .= " AND s.fournisseur = ".((int) $val); } if ($key == 'category' && (int) $val > 0) { - $sql .= " AND s.rowid IN (SELECT fk_soc FROM ".MAIN_DB_PREFIX."categorie_societe WHERE fk_categorie=".$db->escape($val).") "; + $sql .= " AND s.rowid IN (SELECT fk_soc FROM ".MAIN_DB_PREFIX."categorie_societe WHERE fk_categorie = ".((int) $val).") "; } } dol_syslog("Function: getListOfThirdParties", LOG_DEBUG); From 4e1fe23b7e1a83d34b45c51348968d415626085c Mon Sep 17 00:00:00 2001 From: Nicolas Date: Wed, 9 Jun 2021 15:48:31 +0200 Subject: [PATCH 0500/1497] FIX: add check display payment link if invoice module is enabled --- htdocs/commande/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 1ef37552f1f..4913731efb5 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2633,7 +2633,7 @@ if ($action == 'create' && $usercancreate) $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem, $compatibleImportElementsList); // Show online payment link - $useonlinepayment = (!empty($conf->paypal->enabled) || !empty($conf->stripe->enabled) || !empty($conf->paybox->enabled)); + $useonlinepayment = ((!empty($conf->paypal->enabled) || !empty($conf->stripe->enabled) || !empty($conf->paybox->enabled)) && !empty($conf->facture->enabled)); if (!empty($conf->global->ORDER_HIDE_ONLINE_PAYMENT_ON_ORDER)) $useonlinepayment = 0; if ($object->statut != Commande::STATUS_DRAFT && $useonlinepayment) { From 2681d581075c69544b67cb1bd491b848896f46ea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Jun 2021 16:37:15 +0200 Subject: [PATCH 0501/1497] FIx CVE ID: CVE-2021-33816 --- htdocs/core/class/utils.class.php | 2 +- htdocs/website/index.php | 25 +++++++++++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index a4f6bb11706..bdd6cc2b83a 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -594,7 +594,7 @@ class Utils * Execute a CLI command. * * @param string $command Command line to execute. - * @param string $outputfile Output file (used only when method is 2). For exemple $conf->admin->dir_temp.'/out.tmp'; + * @param string $outputfile A path for an output file (used only when method is 2). For example: $conf->admin->dir_temp.'/out.tmp'; * @param int $execmethod 0=Use default method (that is 1 by default), 1=Use the PHP 'exec', 2=Use the 'popen' method * @return array array('result'=>...,'output'=>...,'error'=>...). result = 0 means OK. */ diff --git a/htdocs/website/index.php b/htdocs/website/index.php index fe1bdce10d4..9361aae865f 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -1998,8 +1998,12 @@ if ($usercanedit && (($action == 'updatesource' || $action == 'updatecontent' || // Security analysis $phpfullcodestring = dolKeepOnlyPhpCode($objectpage->content); - //print dol_escape_htmltag($phpfullcodestring);exit; - $forbiddenphpcommands = array("exec", "passthru", "system", "shell_exec", "proc_open", "eval", "dol_eval"); + + // First check forbidden commands + $forbiddenphpcommands = array(); + if (empty($conf->global->WEBSITE_PHP_ALLOW_EXEC)) { // If option is not on, we disallow functions to execute commands + $forbiddenphpcommands = array("exec", "passthru", "shell_exec", "system", "proc_open", "popen", "eval", "dol_eval", "executeCLI"); + } if (empty($conf->global->WEBSITE_PHP_ALLOW_WRITE)) { // If option is not on, we disallow functions to write files $forbiddenphpcommands = array_merge($forbiddenphpcommands, array("fopen", "file_put_contents", "fputs", "fputscsv", "fwrite", "fpassthru", "unlink", "mkdir", "rmdir", "symlink", "touch", "umask")); } @@ -2015,6 +2019,23 @@ if ($usercanedit && (($action == 'updatesource' || $action == 'updatecontent' || } } } + // This char can be used to execute RCE for example using with echo `ls` + $forbiddenphpchars = array(); + if (empty($conf->global->WEBSITE_PHP_ALLOW_DANGEROUS_CHARS)) { // If option is not on, we disallow functions to execute commands + $forbiddenphpchars = array("`"); + } + foreach ($forbiddenphpchars as $forbiddenphpchar) { + if (preg_match('/'.$forbiddenphpchar.'/ms', $phpfullcodestring)) { + $error++; + setEventMessages($langs->trans("DynamicPHPCodeContainsAForbiddenInstruction", $forbiddenphpchar), null, 'errors'); + if ($action == 'updatesource') { + $action = 'editsource'; + } + if ($action == 'updatecontent') { + $action = 'editcontent'; + } + } + } if (empty($user->rights->website->writephp)) { if ($phpfullcodestringold != $phpfullcodestring) { From 0b7b12685fac454c450430dfdb100dc72f3778c4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Jun 2021 16:41:43 +0200 Subject: [PATCH 0502/1497] Clean code --- htdocs/core/lib/functions2.lib.php | 51 ------------------------------ 1 file changed, 51 deletions(-) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index e279ced2a3d..37f78563c02 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -2679,57 +2679,6 @@ if (!function_exists('dolEscapeXML')) { } -/** - * Return automatic or manual in current language - * - * @param string $automaticmanual Value to test (1, 'automatic', 'true' or 0, 'manual', 'false') - * @param integer $case 1=Yes/No, 0=yes/no, 2=Disabled checkbox, 3=Disabled checkbox + Automatic/Manual - * @param int $color 0=texte only, 1=Text is formated with a color font style ('ok' or 'error'), 2=Text is formated with 'ok' color. - * @return string HTML string - */ -function autoOrManual($automaticmanual, $case = 1, $color = 0) -{ - global $langs; - $result = 'unknown'; - $classname = ''; - if ($automaticmanual == 1 || strtolower($automaticmanual) == 'automatic' || strtolower($automaticmanual) == 'true') { // A mettre avant test sur no a cause du == 0 - $result = $langs->trans('automatic'); - if ($case == 1 || $case == 3) { - $result = $langs->trans("Automatic"); - } - if ($case == 2) { - $result = ''; - } - if ($case == 3) { - $result = ' '.$result; - } - - $classname = 'ok'; - } elseif ($automaticmanual == 0 || strtolower($automaticmanual) == 'manual' || strtolower($automaticmanual) == 'false') { - $result = $langs->trans("manual"); - if ($case == 1 || $case == 3) { - $result = $langs->trans("Manual"); - } - if ($case == 2) { - $result = ''; - } - if ($case == 3) { - $result = ' '.$result; - } - - if ($color == 2) { - $classname = 'ok'; - } else { - $classname = 'error'; - } - } - if ($color) { - return ''.$result.''; - } - return $result; -} - - /** * Convert links to local wrapper to medias files into a string into a public external URL readable on internet * From c37c3713928a6d2216ceaa2b04e21f436081a7c3 Mon Sep 17 00:00:00 2001 From: lvessiller Date: Wed, 9 Jun 2021 17:18:01 +0200 Subject: [PATCH 0503/1497] FIX clone invoice with acount line --- .../triggers/interface_90_modSociete_ContactRoles.class.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php b/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php index 0ee3cdb73ab..b15113c9c08 100644 --- a/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php +++ b/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php @@ -84,11 +84,7 @@ class InterfaceContactRoles extends DolibarrTriggers if (is_array($TContact) && ! empty($TContact)) { $TContactAlreadyLinked = array(); if ($object->id > 0) { - $cloneFrom = dol_clone($object, 1); - - if (! empty($cloneFrom->id)) { - $TContactAlreadyLinked = array_merge($cloneFrom->liste_contact(- 1, 'external'), $cloneFrom->liste_contact(- 1, 'internal')); - } + $TContactAlreadyLinked = array_merge($object->liste_contact(- 1, 'external'), $object->liste_contact(- 1, 'internal')); } foreach ($TContact as $i => $infos) { From f1c94ac659175c78fc5034dab2d0510eadf4a567 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Jun 2021 17:44:42 +0200 Subject: [PATCH 0504/1497] NEW Reduce scope of dol_eval function. --- htdocs/core/lib/functions.lib.php | 19 +++++++++++++ test/phpunit/SecurityTest.php | 44 +++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 165d9c503a4..61f268d7871 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7995,6 +7995,25 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1) global $obj; // To get $obj used into list when dol_eval is used for computed fields and $obj is not yet $object global $soc; // For backward compatibility + // Replace dangerous char (used for RCE), we allow only PHP variable testing. + if (strpos($s, '`') !== false) { + return 'Bad string syntax to evaluate: '.$s; + } + + // We block using of php exec or php file functions + $forbiddenphpcommands = array("exec(", "passthru(", "shell_exec(", "system(", "proc_open(", "popen(", "eval(", "dol_eval(", "executeCLI("); + $forbiddenphpcommands = array_merge($forbiddenphpcommands, array("fopen(", "file_put_contents(", "fputs(", "fputscsv(", "fwrite(", "fpassthru(", "unlink(", "mkdir(", "rmdir(", "symlink(", "touch(", "umask(")); + $forbiddenphpcommands = array_merge($forbiddenphpcommands, array('function(', '$$', 'call_user_func(', '_SESSION', '_COOKIE')); + do { + $oldstringtoclean = $s; + $s = str_ireplace($forbiddenphpcommands, '__forbiddenstring__', $s); + //$s = preg_replace('/\$[a-zA-Z0-9_\->\$]+\(/i', '', $s); // Remove $function( call and $mycall->mymethod( + } while ($oldstringtoclean != $s); + + if (strpos($s, '__forbiddenstring__') !== false) { + return 'Bad string syntax to evaluate: '.$s; + } + //print $s."
    \n"; if ($returnvalue) { if ($hideerrors) { diff --git a/test/phpunit/SecurityTest.php b/test/phpunit/SecurityTest.php index f889a6c542b..b1a32249ffc 100644 --- a/test/phpunit/SecurityTest.php +++ b/test/phpunit/SecurityTest.php @@ -777,4 +777,48 @@ class SecurityTest extends PHPUnit\Framework\TestCase $result=dol_sanitizeFileName('bad file --evilparam'); $this->assertEquals('bad file _evilparam', $result); } + + /** + * testDolEval + * + * @return void + */ + public function testDolEval() + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + $result=dol_eval('1==1', 1, 0); + print "result = ".$result."\n"; + $this->assertTrue($result); + + $result=dol_eval('1==2', 1, 0); + print "result = ".$result."\n"; + $this->assertFalse($result); + + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + include_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; + $result=dol_eval('(($reloadedobj = new Task($db)) && ($reloadedobj->fetchNoCompute($object->id) > 0) && ($secondloadedobj = new Project($db)) && ($secondloadedobj->fetchNoCompute($reloadedobj->fk_project) > 0)) ? $secondloadedobj->ref: "Parent project not found"', 1, 1); + print "result = ".$result."\n"; + $this->assertEquals('Parent project not found', $result); + + $result=dol_eval('$a=function() { }; $a;', 1, 1); + print "result = ".$result."\n"; + $this->assertContains('Bad string syntax to evaluate', $result); + + $result=dol_eval('$a=exec("ls");', 1, 1); + print "result = ".$result."\n"; + $this->assertContains('Bad string syntax to evaluate', $result); + + $result=dol_eval('$a="test"; $$a;', 1, 0); + print "result = ".$result."\n"; + $this->assertContains('Bad string syntax to evaluate', $result); + + $result=dol_eval('`ls`', 1, 0); + print "result = ".$result."\n"; + $this->assertContains('Bad string syntax to evaluate', $result); + } } From f472ff4fd9aac82fc75b2c454d357bb90c1eec49 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Jun 2021 17:47:27 +0200 Subject: [PATCH 0505/1497] Add phpunit for dol_eval --- htdocs/core/lib/functions.lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 61f268d7871..1857be0146c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8003,7 +8003,8 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1) // We block using of php exec or php file functions $forbiddenphpcommands = array("exec(", "passthru(", "shell_exec(", "system(", "proc_open(", "popen(", "eval(", "dol_eval(", "executeCLI("); $forbiddenphpcommands = array_merge($forbiddenphpcommands, array("fopen(", "file_put_contents(", "fputs(", "fputscsv(", "fwrite(", "fpassthru(", "unlink(", "mkdir(", "rmdir(", "symlink(", "touch(", "umask(")); - $forbiddenphpcommands = array_merge($forbiddenphpcommands, array('function(', '$$', 'call_user_func(', '_SESSION', '_COOKIE')); + $forbiddenphpcommands = array_merge($forbiddenphpcommands, array('function(', '$$', 'call_user_func(')); + $forbiddenphpcommands = array_merge($forbiddenphpcommands, array('global', '_ENV', '_SESSION', '_COOKIE', '_GET', '_POST', '_REQUEST')); do { $oldstringtoclean = $s; $s = str_ireplace($forbiddenphpcommands, '__forbiddenstring__', $s); From 16f1210e8afddd451ead51fce9fadff0cf360c83 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Jun 2021 17:50:21 +0200 Subject: [PATCH 0506/1497] Fix phpcs --- htdocs/compta/cashcontrol/report.php | 2 +- htdocs/partnership/class/partnership.class.php | 2 +- htdocs/product/card.php | 8 ++++---- htdocs/reception/card.php | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/compta/cashcontrol/report.php b/htdocs/compta/cashcontrol/report.php index fb6e75c68c4..de597a608dc 100644 --- a/htdocs/compta/cashcontrol/report.php +++ b/htdocs/compta/cashcontrol/report.php @@ -223,7 +223,7 @@ if ($resql) { if (empty($cacheinvoiceid[$objp->facid])) { $cacheinvoiceid[$objp->facid] = $objp->facid; // First time this invoice is found into list of invoice x payments - foreach($invoicetmp->lines as $line) { + foreach ($invoicetmp->lines as $line) { $totalqty += $line->qty; $totalvat += $line->total_tva; } diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index d04d0c335eb..125dacb1e53 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -354,8 +354,8 @@ class Partnership extends CommonObject * * @param int $id Id of object to load * @param string $ref Ref of object - * @param int $fk_soc fk_soc * @param int $fk_member fk_member + * @param int $fk_soc fk_soc * @return int >0 if OK, <0 if KO, 0 if not found */ public function fetch($id, $ref = null, $fk_member = null, $fk_soc = null) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 1b732cd721e..5067b9ce838 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -2050,10 +2050,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; if ((($object->status_batch == '1' &&$conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS && $conf->global->PRODUCTBATCH_LOT_ADDON == 'mod_lot_advanced') || ($object->status_batch == '2' && $conf->global->PRODUCTBATCH_SN_ADDON == 'mod_sn_advanced' && $conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS))) { - print '
    '; - } + print ''; + } } } diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 531fdf9c23a..c9a638e7cde 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -1702,7 +1702,7 @@ if ($action == 'create') { $sql .= " AND obj.fk_commande = ".((int) $origin_id); $sql .= " AND obj.rowid = ed.fk_commandefourndet"; $sql .= " AND ed.fk_reception = e.rowid"; - $sql .= " AND ed.fk_reception !=".(int) $object->id); + $sql .= " AND ed.fk_reception !=".((int) $object->id); //if ($filter) $sql.= $filter; $sql .= " ORDER BY obj.fk_product"; From c00bef83a8d919aeb624c9cf23adf653d28aacf1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Jun 2021 18:05:56 +0200 Subject: [PATCH 0507/1497] Fix php unit --- htdocs/fourn/class/fournisseur.facture.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index a48d00c820b..377f09028df 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -3417,7 +3417,7 @@ class SupplierInvoiceLine extends CommonObjectLine $sql .= ", fk_product = ".((int) $fk_product); $sql .= ", product_type = ".((int) $this->product_type); $sql .= ", info_bits = ".((int) $this->info_bits); - $sql .= ", fk_unit = ".((int) $fk_unit); + $sql .= ", fk_unit = ".($fk_unit > 0 ? (int) $fk_unit : 'null'); // Multicurrency $sql .= " , multicurrency_subprice=".price2num($this->multicurrency_subprice).""; From e4d3fd4861d6f384dd575bb61efcc67814bc3f63 Mon Sep 17 00:00:00 2001 From: prolyfix Date: Wed, 9 Jun 2021 23:09:31 +0200 Subject: [PATCH 0508/1497] bug resolution: exception when a user test the send mail functionality, an exception is thrown: $object is null in the method_exists's function. and thus not allowed. Adding is_object resolve the problem --- htdocs/core/actions_sendmails.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index b4e583387c9..83a823edeb2 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -345,7 +345,7 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST $subject = make_substitutions($subject, $substitutionarray); $message = make_substitutions($message, $substitutionarray); - if (method_exists($object, 'makeSubstitution')) { + if (is_object($object) && method_exists($object, 'makeSubstitution')) { $subject = $object->makeSubstitution($subject); $message = $object->makeSubstitution($message); } From f3d54aada5df4794466b5010c12486218bc4178d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Jun 2021 23:48:28 +0200 Subject: [PATCH 0509/1497] Clean code --- htdocs/adherents/class/adherent.class.php | 2 -- htdocs/societe/class/societe.class.php | 24 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 91f01d19f89..5a69c30abdb 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1510,7 +1510,6 @@ class Adherent extends CommonObject } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Function to get partnerships array * @@ -1519,7 +1518,6 @@ class Adherent extends CommonObject */ public function fetchPartnerships($mode) { - // phpcs:enable global $langs; require_once DOL_DOCUMENT_ROOT.'/parntership/class/partnership.class.php'; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 149801a65e2..e20643fb589 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -740,6 +740,12 @@ class Societe extends CommonObject public $multicurrency_code; + // Fields loaded by fetchPartnerships() + + public $partnerships = array(); + + + /** * @var Account|string Default BAN account */ @@ -4806,4 +4812,22 @@ class Societe extends CommonObject return -1; } } + + /** + * Function to get partnerships array + * + * @param string $mode 'member' or 'thirdparty' + * @return int <0 if KO, >0 if OK + */ + public function fetchPartnerships($mode) + { + global $langs; + + require_once DOL_DOCUMENT_ROOT.'/parntership/class/partnership.class.php'; + + + $this->partnerships[] = array(); + + return 1; + } } From 9b7795dc44ebabda3eaf0944a531f445471f7d86 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Jun 2021 23:55:56 +0200 Subject: [PATCH 0510/1497] Debug v14 --- htdocs/partnership/admin/setup.php | 2 +- .../class/partnershiputils.class.php | 19 +++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/htdocs/partnership/admin/setup.php b/htdocs/partnership/admin/setup.php index 7fa0ef62b5e..97e21647b81 100644 --- a/htdocs/partnership/admin/setup.php +++ b/htdocs/partnership/admin/setup.php @@ -177,7 +177,7 @@ print ''; print '
    '; -print_fiche_titre($langs->trans("ReferingWebsiteCheck"), '', ''); +print load_fiche_titre($langs->trans("ReferingWebsiteCheck"), '', ''); print ''.$langs->trans("ReferingWebsiteCheckDesc").'
    '; print '
    '; diff --git a/htdocs/partnership/class/partnershiputils.class.php b/htdocs/partnership/class/partnershiputils.class.php index 04f5db251e5..7cf01c2957c 100644 --- a/htdocs/partnership/class/partnershiputils.class.php +++ b/htdocs/partnership/class/partnershiputils.class.php @@ -27,12 +27,11 @@ require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; - -dol_include_once('partnership/lib/partnership.lib.php'); -dol_include_once('/partnership/class/partnership.class.php'); - -require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"; +require_once DOL_DOCUMENT_ROOT.'/partnership/lib/partnership.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership.class.php'; +require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; + /** * Class with cron tasks of Partnership module */ @@ -273,6 +272,7 @@ class PartnershipUtils $numofexpiredmembers = $this->db->num_rows($resql); $somethingdoneonpartnership = 0; $ifetchpartner = 0; + $websitenotfound = ''; while ($ifetchpartner < $numofexpiredmembers) { $ifetchpartner++; @@ -393,11 +393,10 @@ class PartnershipUtils /** * Action to check if Dolibarr backlink not found on partner website * - * CAN BE A CRON TASK - * @param $website Partner's website - * @return int 0 if KO, 1 if OK + * @param $website Website Partner's website + * @return int 0 if KO, 1 if OK */ - public function checkDolibarrBacklink($website = null) + private function checkDolibarrBacklink($website = null) { global $conf, $langs, $user; @@ -406,7 +405,7 @@ class PartnershipUtils $webcontent = ''; // $website = 'https://nextgestion.com/'; // For Test - $tmpgeturl = getURLContent($website); + $tmpgeturl = getURLContent($website, 'GET', '', 1, array(), array('http', 'https'), 0); if ($tmpgeturl['curl_error_no']) { $error++; dol_syslog('Error getting '.$website.': '.$tmpgeturl['curl_error_msg']); From 7b31ef0ff3ba416fd0c8c4c5c20a3000365adcd4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 10 Jun 2021 00:00:49 +0200 Subject: [PATCH 0511/1497] Fix warnings --- htdocs/comm/action/list.php | 3 ++- htdocs/comm/action/rapport/index.php | 3 ++- htdocs/compta/prelevement/line.php | 3 ++- htdocs/modulebuilder/template/myobject_list.php | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 8c6fc94e31f..8bf35df622d 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -106,7 +106,8 @@ $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); -if ($page == -1 || $page == null) { +if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { + // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; } $offset = $limit * $page; diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php index a90bc1cf5a3..9b6238ca0de 100644 --- a/htdocs/comm/action/rapport/index.php +++ b/htdocs/comm/action/rapport/index.php @@ -43,7 +43,8 @@ $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); -if ($page == -1 || $page == null) { +if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { + // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; } $offset = $limit * $page; diff --git a/htdocs/compta/prelevement/line.php b/htdocs/compta/prelevement/line.php index bc3a06c2e6d..5aa7344eea5 100644 --- a/htdocs/compta/prelevement/line.php +++ b/htdocs/compta/prelevement/line.php @@ -51,7 +51,8 @@ $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortorder = GETPOST('sortorder', 'aZ09comma'); $sortfield = GETPOST('sortfield', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); -if ($page == -1 || $page == null) { +if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { + // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; } $offset = $limit * $page; diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 05cce2ba934..e2c817c12cc 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -105,8 +105,9 @@ $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { + // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; -} // If $page is not defined, or '' or -1 or if we click on clear filters +} $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; From 067f37e22e46864822507906a03449dd3373cf93 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 10 Jun 2021 00:09:38 +0200 Subject: [PATCH 0512/1497] Clean code --- .../contact/canvas/actions_contactcard_common.class.php | 6 +----- .../canvas/default/tpl/contactcard_create.tpl.php | 5 ----- htdocs/contact/card.php | 4 +--- htdocs/contact/class/contact.class.php | 9 ++++----- htdocs/contact/perso.php | 4 ++-- htdocs/core/class/commondocgenerator.class.php | 1 - htdocs/datapolicy/class/actions_datapolicy.class.php | 1 - htdocs/install/upgrade2.php | 2 +- htdocs/webservices/server_contact.php | 4 +--- 9 files changed, 10 insertions(+), 26 deletions(-) diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index 0e80df07676..f63f25b2a18 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -283,10 +283,7 @@ abstract class ActionsContactCardCommon // phpcs:enable global $langs, $mysoc; - $this->object->old_name = GETPOST("old_name"); - $this->object->old_firstname = GETPOST("old_firstname"); - - $this->object->socid = GETPOST("socid"); + $this->object->socid = GETPOST("socid", 'int'); $this->object->lastname = GETPOST("name"); $this->object->firstname = GETPOST("firstname"); $this->object->civility_id = GETPOST("civility_id"); @@ -301,7 +298,6 @@ abstract class ActionsContactCardCommon $this->object->phone_mobile = GETPOST("phone_mobile"); $this->object->fax = GETPOST("fax"); $this->object->email = GETPOST("email"); - $this->object->jabberid = GETPOST("jabberid"); $this->object->priv = GETPOST("priv"); $this->object->note = GETPOST("note", "restricthtml"); $this->object->canvas = GETPOST("canvas"); diff --git a/htdocs/contact/canvas/default/tpl/contactcard_create.tpl.php b/htdocs/contact/canvas/default/tpl/contactcard_create.tpl.php index bd5cf24e195..a6c134d0a9a 100644 --- a/htdocs/contact/canvas/default/tpl/contactcard_create.tpl.php +++ b/htdocs/contact/canvas/default/tpl/contactcard_create.tpl.php @@ -109,11 +109,6 @@ echo $this->control->tpl['ajax_selectcountry']; ?>
    - - - - - diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index b877909cc58..d185815b51a 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -297,7 +297,7 @@ if (empty($reshook)) { $object->old_lastname = (string) GETPOST("old_lastname", 'alpha'); $object->old_firstname = (string) GETPOST("old_firstname", 'alpha'); - $result = $object->delete(); + $result = $object->delete(); // TODO Add $user as first param if ($result > 0) { if ($backtopage) { header("Location: ".$backtopage); @@ -443,8 +443,6 @@ if (empty($reshook)) { } } - $object->old_lastname = ''; - $object->old_firstname = ''; $action = 'view'; } else { setEventMessages($object->error, $object->errors, 'errors'); diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index e1f987ac2f4..86d38c5b3e1 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -545,8 +545,6 @@ class Contact extends CommonObject $this->phone_pro = trim($this->phone_pro); $this->phone_perso = trim($this->phone_perso); $this->phone_mobile = trim($this->phone_mobile); - $this->jabberid = trim($this->jabberid); - $this->skype = trim($this->skype); $this->photo = trim($this->photo); $this->fax = trim($this->fax); $this->zip = (empty($this->zip) ? '' : trim($this->zip)); @@ -1190,10 +1188,11 @@ class Contact extends CommonObject } /** - * Efface le contact de la base + * Delete a contact from database + * // TODO Add $user as first param * - * @param int $notrigger Disable all trigger - * @return int <0 if KO, >0 if OK + * @param int $notrigger Disable all trigger + * @return int <0 if KO, >0 if OK */ public function delete($notrigger = 0) { diff --git a/htdocs/contact/perso.php b/htdocs/contact/perso.php index 628c73b0afc..261ffebf29c 100644 --- a/htdocs/contact/perso.php +++ b/htdocs/contact/perso.php @@ -60,8 +60,8 @@ if ($action == 'update' && !GETPOST("cancel") && $user->rights->societe->contact $result = $object->update_perso($id, $user); if ($result > 0) { - $object->old_name = ''; - $object->old_firstname = ''; + $object->oldcopy = clone $object; + // Logo/Photo save $dir = $conf->societe->dir_output.'/contact/'.get_exdir($object->id, 0, 0, 1, $object, 'contact').'/photos'; diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 30ea40fbbb2..6e91d9d175b 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -321,7 +321,6 @@ abstract class CommonDocGenerator $array_key.'_statut' => $object->statut, $array_key.'_code' => $object->code, $array_key.'_email' => $object->email, - $array_key.'_jabberid' => $object->jabberid, // deprecated $array_key.'_phone_pro' => $object->phone_pro, $array_key.'_phone_perso' => $object->phone_perso, $array_key.'_phone_mobile' => $object->phone_mobile, diff --git a/htdocs/datapolicy/class/actions_datapolicy.class.php b/htdocs/datapolicy/class/actions_datapolicy.class.php index 7a3ba77fb5a..e54086149fe 100644 --- a/htdocs/datapolicy/class/actions_datapolicy.class.php +++ b/htdocs/datapolicy/class/actions_datapolicy.class.php @@ -196,7 +196,6 @@ class ActionsDatapolicy echo $object->phone_pro.';'; echo $object->phone_perso.';'; echo $object->phone_mobile.';'; - echo $object->jabberid.';'; echo dol_print_date($object->birth).';'; exit; } elseif ($parameters['currentcontext'] == 'contactcard' && $action == 'send_datapolicy') { diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 23acc7d4a1b..e814e69574a 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -4710,7 +4710,7 @@ function migrate_contacts_socialnetworks() $db->begin(); print '
    '; + print (empty($conf->global->PRODUCT_DENY_CHANGE_PRODUCT_TYPE)) ? $form->editfieldkey("Type", 'fk_product_type', $object->type, $object, $usercancreate, $typeformat) : $langs->trans('Type'); + print ''; + print $form->editfieldval("Type", 'fk_product_type', $object->type, $object, $usercancreate, $typeformat); + print '
    '.$langs->trans("Nature").''; diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 5908785e1cb..0220df610e4 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -596,8 +596,18 @@ if ($id > 0 || $ref) { print ''; + // Type + if (!empty($conf->product->enabled) && !empty($conf->service->enabled)) { + $typeformat = 'select;0:'.$langs->trans("Product").',1:'.$langs->trans("Service"); + print ''; + } + if ($conf->productbatch->enabled) { - print ''; } diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index a7ad432b3ba..0d9de5d857f 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -356,15 +356,25 @@ if (!empty($id) || !empty($ref)) { $linkback = ''.$langs->trans("BackToList").''; $object->next_prev_filter = " fk_product_type = ".$object->type; - dol_banner_tab($object, 'ref', $linkback, ($user->socid ? 0 : 1), 'ref', '', '', '', 0, '', '', 1); + dol_banner_tab($object, 'ref', $linkback, ($user->socid ? 0 : 1), 'ref', '', '', '', 0, '', ''); print '
    '; print '
    '; - print '
    '; + print (empty($conf->global->PRODUCT_DENY_CHANGE_PRODUCT_TYPE)) ? $form->editfieldkey("Type", 'fk_product_type', $object->type, $object, $usercancreate, $typeformat) : $langs->trans('Type'); + print ''; + print $form->editfieldval("Type", 'fk_product_type', $object->type, $object, $usercancreate, $typeformat); + print '
    '.$langs->trans("ManageLotSerial").''; + print '
    '.$langs->trans("ManageLotSerial").''; print $object->getLibStatut(0, 2); print '
    '; + print '
    '; + + // Type + if (!empty($conf->product->enabled) && !empty($conf->service->enabled)) { + $typeformat = 'select;0:'.$langs->trans("Product").',1:'.$langs->trans("Service"); + print ''; + } // TVA - print '\n"; - - - print "
    '; + print (empty($conf->global->PRODUCT_DENY_CHANGE_PRODUCT_TYPE)) ? $form->editfieldkey("Type", 'fk_product_type', $object->type, $object, $usercancreate, $typeformat) : $langs->trans('Type'); + print ''; + print $form->editfieldval("Type", 'fk_product_type', $object->type, $object, $usercancreate, $typeformat); + print '
    '.$langs->trans("DefaultTaxRate").''; + print '
    '.$langs->trans("DefaultTaxRate").''; $positiverates = ''; if (price2num($object->tva_tx)) { @@ -415,9 +425,6 @@ if (!empty($id) || !empty($ref)) { } print "
    \n"; print ''; From 0ea0966b09c32b8605b3384b1daff44d9259f479 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 8 Jun 2021 12:01:05 +0200 Subject: [PATCH 0469/1497] 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 8f5ac173d7f..54994eaf187 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3123,7 +3123,7 @@ if ($action == 'create') // Type de facture $facids = $facturestatic->list_replacable_invoices($soc->id); if ($facids < 0) { - dol_print_error($db, $facturestatic); + dol_print_error($db, $facturestatic->error, $facturestatic->errors); exit(); } $options = ""; From 4e530c2486c7c4255c9b20a6e1ddf7816afdfd66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 8 Jun 2021 12:05:45 +0200 Subject: [PATCH 0470/1497] Update card.php --- htdocs/fourn/facture/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 80491d5edfe..530a0d22766 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1867,7 +1867,7 @@ if ($action == 'create') // Type invoice $facids = $facturestatic->list_replacable_supplier_invoices($societe->id); if ($facids < 0) { - dol_print_error($db, $facturestatic); + dol_print_error($db, $facturestatic->error, $facturestatic->errors); exit(); } $options = ""; @@ -1933,7 +1933,7 @@ if ($action == 'create') $facids = $facturestatic->list_qualified_avoir_supplier_invoices($societe->id); if ($facids < 0) { - dol_print_error($db, $facturestatic); + dol_print_error($db, $facturestatic->error, $facturestatic->errors); exit; } $optionsav = ""; From 207dc1df5528cf74dea92f82930645bf1da30d6f Mon Sep 17 00:00:00 2001 From: MOREAU FRANCK Date: Tue, 8 Jun 2021 12:34:26 +0200 Subject: [PATCH 0471/1497] Adding hooks on product stat in order to allow to expand stat on other modules --- htdocs/core/lib/product.lib.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 9825b2dac2c..a63871689b4 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -362,7 +362,7 @@ function show_stats_for_company($product, $socid) { global $conf, $langs, $user, $db; $form = new Form($db); - + $hookmanager->initHooks(array('productstats')); $nblines = 0; print '
    '; - print $langs->trans("Category").': '.$formother->select_categories(Categorie::TYPE_PRODUCT, $selected_cat, 'search_categ', true); + print img_picto('', 'category', 'class="paddingrightonly"'); + print $formother->select_categories(Categorie::TYPE_PRODUCT, $selected_cat, 'search_categ', 0, $langs->trans("Category")); print ' '; print $langs->trans("SubCats").'? '; print ''; - print $langs->trans("ThirdParty").': '.$form->select_thirdparty_list($selected_soc, 'search_soc', '', 1); + print img_picto('', 'company', 'class="paddingrightonly"'); + print $form->select_thirdparty_list($selected_soc, 'search_soc', '', $langs->trans("ThirdParty")); print ''; diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index af3f2bc8a53..10f7956c6b7 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -405,7 +405,8 @@ print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; - print ''; + print ''; print ''; $first = "no"; }*/ @@ -232,8 +246,8 @@ if ($resql) { // Bank account print '
    '; -print $langs->trans("Category").': '.$formother->select_categories(Categorie::TYPE_CUSTOMER, $selected_cat, 'search_categ', true); +print img_picto('', 'category', 'class="paddingrightonly"'); +print $formother->select_categories(Categorie::TYPE_CUSTOMER, $selected_cat, 'search_categ', 0, $langs->trans("Category")); print ' '; print $langs->trans("SubCats").'? '; print ''; print '
    '; -print ''; +print ''; print ''; -print ''; +print ''; print ''; -print ''; +print ''; print ''; print $form->select_country($search_country, 'search_country'); diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index b93d3c507b3..05bbbab99d3 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -149,9 +149,11 @@ if ($modecompta == "CREANCES-DETTES") { $name = $langs->trans("Turnover"); $calcmode = $langs->trans("CalcModeDebt"); //$calcmode.='
    ('.$langs->trans("SeeReportInInputOutputMode",'','').')'; - $calcmode .= '
    ('.$langs->trans("SeeReportInBookkeepingMode", '{link1}', '{link2}').')'; - $calcmode = str_replace('{link1}', '', $calcmode); - $calcmode = str_replace('{link2}', '', $calcmode); + if (!empty($conf->accounting->enabled)) { + $calcmode .= '
    ('.$langs->trans("SeeReportInBookkeepingMode", '{link1}', '{link2}').')'; + $calcmode = str_replace('{link1}', '', $calcmode); + $calcmode = str_replace('{link2}', '', $calcmode); + } $periodlink = ($year_start ? "".img_previous()." ".img_next()."" : ""); $description = $langs->trans("RulesCADue"); if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { @@ -164,8 +166,10 @@ if ($modecompta == "CREANCES-DETTES") { } elseif ($modecompta == "RECETTES-DEPENSES") { $name = $langs->trans("TurnoverCollected"); $calcmode = $langs->trans("CalcModeEngagement"); - //$calcmode.='
    ('.$langs->trans("SeeReportInDueDebtMode",'','').')'; + //$calcmode .= '
    ('.$langs->trans("SeeReportInDueDebtMode",'','').')'; + //if (!empty($conf->accounting->enabled)) { //$calcmode.='
    ('.$langs->trans("SeeReportInBookkeepingMode",'','').')'; + //} $periodlink = ($year_start ? "".img_previous()." ".img_next()."" : ""); $description = $langs->trans("RulesCAIn"); $description .= $langs->trans("DepositsAreIncluded"); diff --git a/htdocs/compta/stats/supplier_turnover.php b/htdocs/compta/stats/supplier_turnover.php index bb341c6a3a5..0afcb72da2d 100644 --- a/htdocs/compta/stats/supplier_turnover.php +++ b/htdocs/compta/stats/supplier_turnover.php @@ -128,23 +128,31 @@ llxHeader(); $form = new Form($db); +// TODO Report from bookkeeping not yet available, so we switch on report on business events +if ($modecompta == "BOOKKEEPING") { + $modecompta = "CREANCES-DETTES"; +} +if ($modecompta == "BOOKKEEPINGCOLLECTED") { + $modecompta = "RECETTES-DEPENSES"; +} + // Affiche en-tete du rapport if ($modecompta == "CREANCES-DETTES") { $name = $langs->trans("PurchaseTurnover"); $calcmode = $langs->trans("CalcModeDebt"); - $calcmode .= '
    ('.$langs->trans("SeeReportInBookkeepingMode", '{link1}', '{link2}').')'; - $calcmode = str_replace('{link1}', '', $calcmode); - $calcmode = str_replace('{link2}', '', $calcmode); + if (!empty($conf->accounting->enabled)) { + $calcmode .= '
    ('.$langs->trans("SeeReportInBookkeepingMode", '{link1}', '{link2}').')'; + $calcmode = str_replace('{link1}', '', $calcmode); + $calcmode = str_replace('{link2}', '', $calcmode); + } $periodlink = ($year_start ? "".img_previous()." ".img_next()."" : ""); $description = $langs->trans("RulesPurchaseTurnoverDue"); - $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } elseif ($modecompta == "RECETTES-DEPENSES") { $name = $langs->trans("PurchaseTurnoverCollected"); $calcmode = $langs->trans("CalcModeEngagement"); $periodlink = ($year_start ? "".img_previous()." ".img_next()."" : ""); $description = $langs->trans("RulesPurchaseTurnoverIn"); - $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } elseif ($modecompta == "BOOKKEEPING") { $name = $langs->trans("PurchaseTurnover"); @@ -154,9 +162,19 @@ if ($modecompta == "CREANCES-DETTES") { $calcmode = str_replace('{link2}', '', $calcmode); $periodlink = ($year_start ? "".img_previous()." ".img_next()."" : ""); $description = $langs->trans("RulesPurchaseTurnoverOfExpenseAccounts"); - $builddate = dol_now(); + //$exportlink=$langs->trans("NotYetAvailable"); +} elseif ($modecompta == "BOOKKEEPINGCOLLECTED") { + $name = $langs->trans("PurchaseTurnoverCollected"); + $calcmode = $langs->trans("CalcModeBookkeeping"); + $calcmode .= '
    ('.$langs->trans("SeeReportInDueDebtMode", '{link1}', '{link2}').')'; + $calcmode = str_replace('{link1}', '', $calcmode); + $calcmode = str_replace('{link2}', '', $calcmode); + $periodlink = ($year_start ? "".img_previous()." ".img_next()."" : ""); + $description = $langs->trans("RulesPurchaseTurnoverCollectedOfExpenseAccounts"); //$exportlink=$langs->trans("NotYetAvailable"); } + +$builddate = dol_now(); $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver'); $period .= ' - '; $period .= $form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver'); diff --git a/htdocs/compta/stats/supplier_turnover_by_prodserv.php b/htdocs/compta/stats/supplier_turnover_by_prodserv.php index 1af51249433..4e92325a323 100644 --- a/htdocs/compta/stats/supplier_turnover_by_prodserv.php +++ b/htdocs/compta/stats/supplier_turnover_by_prodserv.php @@ -345,7 +345,8 @@ if ($modecompta == 'CREANCES-DETTES') { // Category filter print '
    '; - print $langs->trans("Category").': '.$formother->select_categories(Categorie::TYPE_PRODUCT, $selected_cat, 'search_categ', true); + print img_picto('', 'category', 'class="paddingrightonly"'); + print $formother->select_categories(Categorie::TYPE_PRODUCT, $selected_cat, 'search_categ', 0, $langs->trans("Category")); print ' '; print $langs->trans("SubCats").'? '; print ''; - print $langs->trans("ThirdParty").': '.$form->select_thirdparty_list($selected_soc, 'search_soc', '', 1); + print img_picto('', 'company', 'class="paddingrightonly"'); + print $form->select_thirdparty_list($selected_soc, 'search_soc', '', $langs->trans("ThirdParty")); print ''; diff --git a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php index b1b1f219f53..a97e15d1499 100644 --- a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php +++ b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php @@ -200,18 +200,19 @@ if ($modecompta == "CREANCES-DETTES") { $calcmode = $langs->trans("CalcModeDebt"); //$calcmode.='
    ('.$langs->trans("SeeReportInInputOutputMode",'','').')'; $description = $langs->trans("RulesPurchaseTurnoverDue"); - $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } elseif ($modecompta == "RECETTES-DEPENSES") { $name = $langs->trans("PurchaseTurnoverCollected").', '.$langs->trans("ByThirdParties"); $calcmode = $langs->trans("CalcModeEngagement"); //$calcmode.='
    ('.$langs->trans("SeeReportInDueDebtMode",'','').')'; $description = $langs->trans("RulesPurchaseTurnoverIn"); - $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } elseif ($modecompta == "BOOKKEEPING") { + // TODO } elseif ($modecompta == "BOOKKEEPINGCOLLECTED") { + // TODO } +$builddate = dol_now(); $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver'); $period .= ' - '; $period .= $form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver'); @@ -344,7 +345,8 @@ print ''; print ''; print ''; print ''; print ''; print ''."\n"; From fa4786a3f64083895c257863c8d2b5ed463c0776 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 8 Jun 2021 16:19:21 +0200 Subject: [PATCH 0477/1497] Fix permission --- htdocs/adherents/document.php | 2 +- htdocs/asset/document.php | 2 +- htdocs/bom/bom_document.php | 2 +- htdocs/comm/action/document.php | 2 +- htdocs/comm/propal/document.php | 2 +- htdocs/commande/document.php | 2 +- htdocs/compta/bank/account_statement_document.php | 2 +- htdocs/compta/bank/document.php | 2 +- htdocs/compta/bank/various_payment/document.php | 2 +- htdocs/compta/deplacement/document.php | 2 +- htdocs/compta/facture/document.php | 2 +- htdocs/compta/sociales/document.php | 2 +- htdocs/compta/tva/document.php | 2 +- htdocs/contact/document.php | 2 +- htdocs/contrat/document.php | 2 +- htdocs/don/document.php | 2 +- htdocs/expedition/document.php | 2 +- htdocs/expensereport/document.php | 2 +- htdocs/fichinter/document.php | 2 +- htdocs/fourn/commande/document.php | 2 +- htdocs/holiday/document.php | 2 +- htdocs/loan/document.php | 2 +- htdocs/modulebuilder/template/myobject_document.php | 4 ++-- htdocs/mrp/mo_document.php | 2 +- htdocs/product/stock/productlot_document.php | 1 - htdocs/projet/document.php | 2 +- htdocs/projet/tasks/document.php | 2 +- htdocs/recruitment/recruitmentcandidature_document.php | 2 +- htdocs/recruitment/recruitmentjobposition_document.php | 2 +- htdocs/resource/document.php | 2 +- htdocs/salaries/document.php | 2 +- htdocs/societe/document.php | 2 +- htdocs/supplier_proposal/document.php | 2 +- htdocs/ticket/document.php | 2 +- htdocs/user/document.php | 2 +- 35 files changed, 35 insertions(+), 36 deletions(-) diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php index f2a7c6f3f55..98c0e026139 100644 --- a/htdocs/adherents/document.php +++ b/htdocs/adherents/document.php @@ -182,7 +182,7 @@ if ($id > 0) { print dol_get_fiche_end(); $modulepart = 'member'; - $permission = $user->rights->adherent->creer; + $permissiontoadd = $user->rights->adherent->creer; $permtoedit = $user->rights->adherent->creer; $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; diff --git a/htdocs/asset/document.php b/htdocs/asset/document.php index 91e46269994..b4ee3a0a175 100644 --- a/htdocs/asset/document.php +++ b/htdocs/asset/document.php @@ -128,7 +128,7 @@ if ($id > 0 || !empty($ref)) { print dol_get_fiche_end(); $modulepart = 'asset'; - $permission = $user->rights->asset->write; + $permissiontoadd = $user->rights->asset->write; $permtoedit = $user->rights->asset->write; $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; diff --git a/htdocs/bom/bom_document.php b/htdocs/bom/bom_document.php index e59b22c45b2..9952423da99 100644 --- a/htdocs/bom/bom_document.php +++ b/htdocs/bom/bom_document.php @@ -147,7 +147,7 @@ if ($object->id) { print dol_get_fiche_end(); $modulepart = 'bom'; - $permission = $user->rights->bom->write; + $permissiontoadd = $user->rights->bom->write; $permtoedit = $user->rights->bom->write; $param = '&id='.$object->id; diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 7465e613611..eb1ac59cfe0 100644 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -287,7 +287,7 @@ if ($object->id > 0) { $modulepart = 'actions'; - $permission = $user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create; + $permissiontoadd = $user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create; $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index 2b21c545c63..a60f892274c 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -189,7 +189,7 @@ if ($object->id > 0) { print dol_get_fiche_end(); $modulepart = 'propal'; - $permission = $user->rights->propal->creer; + $permissiontoadd = $user->rights->propal->creer; $permtoedit = $user->rights->propal->creer; $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index c289112ee9f..f8cc503e0ec 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -184,7 +184,7 @@ if ($id > 0 || !empty($ref)) { print dol_get_fiche_end(); $modulepart = 'commande'; - $permission = $user->rights->commande->creer; + $permissiontoadd = $user->rights->commande->creer; $permtoedit = $user->rights->commande->creer; $param = '&id='.$object->id.'&entity='.(!empty($object->entity) ? $object->entity : $conf->entity); include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; diff --git a/htdocs/compta/bank/account_statement_document.php b/htdocs/compta/bank/account_statement_document.php index 4f317c1a9ed..03209ad7673 100644 --- a/htdocs/compta/bank/account_statement_document.php +++ b/htdocs/compta/bank/account_statement_document.php @@ -183,7 +183,7 @@ if ($id > 0 || !empty($ref)) { $modulepart = 'bank'; - $permission = $user->rights->banque->modifier; + $permissiontoadd = $user->rights->banque->modifier; $permtoedit = $user->rights->banque->modifier; $param = '&id='.$object->id.'&num='.urlencode($numref); $moreparam = '&num='.urlencode($numref); diff --git a/htdocs/compta/bank/document.php b/htdocs/compta/bank/document.php index f97dbca114b..ec46002b031 100644 --- a/htdocs/compta/bank/document.php +++ b/htdocs/compta/bank/document.php @@ -136,7 +136,7 @@ if ($id > 0 || !empty($ref)) { $modulepart = 'bank'; - $permission = $user->rights->banque->modifier; + $permissiontoadd = $user->rights->banque->modifier; $permtoedit = $user->rights->banque->modifier; $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; diff --git a/htdocs/compta/bank/various_payment/document.php b/htdocs/compta/bank/various_payment/document.php index ce793f7e6ee..1b5fd5fd383 100644 --- a/htdocs/compta/bank/various_payment/document.php +++ b/htdocs/compta/bank/various_payment/document.php @@ -150,7 +150,7 @@ if ($object->id) { print dol_get_fiche_end(); $modulepart = 'banque'; - $permission = $user->rights->banque->modifier; + $permissiontoadd = $user->rights->banque->modifier; $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { diff --git a/htdocs/compta/deplacement/document.php b/htdocs/compta/deplacement/document.php index bd4437715d8..cdb4b5f0f0f 100644 --- a/htdocs/compta/deplacement/document.php +++ b/htdocs/compta/deplacement/document.php @@ -126,7 +126,7 @@ if ($object->id) { print ''; $modulepart = 'deplacement'; - $permission = $user->rights->deplacement->creer; + $permissiontoadd = $user->rights->deplacement->creer; $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index 16cdee4ac53..5196216c57c 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -181,7 +181,7 @@ if ($id > 0 || !empty($ref)) { print dol_get_fiche_end(); $modulepart = 'facture'; - $permission = $user->rights->facture->creer; + $permissiontoadd = $user->rights->facture->creer; $permtoedit = $user->rights->facture->creer; $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; diff --git a/htdocs/compta/sociales/document.php b/htdocs/compta/sociales/document.php index 3335174d86f..1fbfdfa296a 100644 --- a/htdocs/compta/sociales/document.php +++ b/htdocs/compta/sociales/document.php @@ -164,7 +164,7 @@ if ($object->id) { print dol_get_fiche_end(); $modulepart = 'tax'; - $permission = $user->rights->tax->charges->creer; + $permissiontoadd = $user->rights->tax->charges->creer; $permtoedit = $user->rights->tax->charges->creer; $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; diff --git a/htdocs/compta/tva/document.php b/htdocs/compta/tva/document.php index eee1abcd2f5..e2f0dcec96d 100644 --- a/htdocs/compta/tva/document.php +++ b/htdocs/compta/tva/document.php @@ -150,7 +150,7 @@ if ($object->id) { print dol_get_fiche_end(); - $permission = $user->rights->tax->charges->creer; + $permissiontoadd = $user->rights->tax->charges->creer; $permtoedit = $user->rights->tax->charges->creer; $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; diff --git a/htdocs/contact/document.php b/htdocs/contact/document.php index e980b0ee94c..3005c6b7827 100644 --- a/htdocs/contact/document.php +++ b/htdocs/contact/document.php @@ -182,7 +182,7 @@ if ($object->id) { print dol_get_fiche_end(); $modulepart = 'contact'; - $permission = $user->rights->societe->contact->creer; + $permissiontoadd = $user->rights->societe->contact->creer; $permtoedit = $user->rights->societe->contact->creer; $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index 1dd87fd75e3..0d66204f81d 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -192,7 +192,7 @@ if ($object->id) { print dol_get_fiche_end(); $modulepart = 'contract'; - $permission = $user->rights->contrat->creer; + $permissiontoadd = $user->rights->contrat->creer; $permtoedit = $user->rights->contrat->creer; $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; diff --git a/htdocs/don/document.php b/htdocs/don/document.php index 0bd4edbc77b..374306bc7b0 100644 --- a/htdocs/don/document.php +++ b/htdocs/don/document.php @@ -188,7 +188,7 @@ if ($object->id) { print dol_get_fiche_end(); $modulepart = 'don'; - $permission = $user->rights->don->creer; + $permissiontoadd = $user->rights->don->creer; $permtoedit = $user->rights->don->creer; $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; diff --git a/htdocs/expedition/document.php b/htdocs/expedition/document.php index c392187d607..200a4b67aac 100644 --- a/htdocs/expedition/document.php +++ b/htdocs/expedition/document.php @@ -177,7 +177,7 @@ if ($id > 0 || !empty($ref)) { print dol_get_fiche_end(); $modulepart = 'expedition'; - $permission = $user->rights->expedition->creer; + $permissiontoadd = $user->rights->expedition->creer; $permtoedit = $user->rights->expedition->creer; $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; diff --git a/htdocs/expensereport/document.php b/htdocs/expensereport/document.php index 147f0842e4c..d7ecea8fcc9 100644 --- a/htdocs/expensereport/document.php +++ b/htdocs/expensereport/document.php @@ -154,7 +154,7 @@ if ($object->id) { $modulepart = 'expensereport'; - $permission = $user->rights->expensereport->creer; + $permissiontoadd = $user->rights->expensereport->creer; $permtoedit = $user->rights->expensereport->creer; $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; diff --git a/htdocs/fichinter/document.php b/htdocs/fichinter/document.php index 576e6be0e5e..71f52212978 100644 --- a/htdocs/fichinter/document.php +++ b/htdocs/fichinter/document.php @@ -170,7 +170,7 @@ if ($object->id) { print dol_get_fiche_end(); $modulepart = 'ficheinter'; - $permission = $user->rights->ficheinter->creer; + $permissiontoadd = $user->rights->ficheinter->creer; $permtoedit = $user->rights->ficheinter->creer; $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; diff --git a/htdocs/fourn/commande/document.php b/htdocs/fourn/commande/document.php index 5bb8baf4879..c38751fc138 100644 --- a/htdocs/fourn/commande/document.php +++ b/htdocs/fourn/commande/document.php @@ -178,7 +178,7 @@ if ($object->id > 0) { $modulepart = 'commande_fournisseur'; - $permission = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); + $permissiontoadd = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); $permtoedit = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; diff --git a/htdocs/holiday/document.php b/htdocs/holiday/document.php index d1be99b0446..063a3330ffd 100644 --- a/htdocs/holiday/document.php +++ b/htdocs/holiday/document.php @@ -349,7 +349,7 @@ if ($object->id) { $modulepart = 'holiday'; - $permission = $user->rights->holiday->write; + $permissiontoadd = $user->rights->holiday->write; $permtoedit = $user->rights->holiday->write; $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; diff --git a/htdocs/loan/document.php b/htdocs/loan/document.php index 85c958dd545..97c0ea56b15 100644 --- a/htdocs/loan/document.php +++ b/htdocs/loan/document.php @@ -160,7 +160,7 @@ if ($object->id) { print dol_get_fiche_end(); $modulepart = 'loan'; - $permission = $user->rights->loan->write; + $permissiontoadd = $user->rights->loan->write; $permtoedit = $user->rights->loan->write; $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; diff --git a/htdocs/modulebuilder/template/myobject_document.php b/htdocs/modulebuilder/template/myobject_document.php index e3fa6390e93..2db325b8b41 100644 --- a/htdocs/modulebuilder/template/myobject_document.php +++ b/htdocs/modulebuilder/template/myobject_document.php @@ -233,8 +233,8 @@ if ($object->id) { print dol_get_fiche_end(); $modulepart = 'mymodule'; - //$permission = $user->rights->mymodule->myobject->write; - $permission = 1; + //$permissiontoadd = $user->rights->mymodule->myobject->write; + $permissiontoadd = 1; //$permtoedit = $user->rights->mymodule->myobject->write; $permtoedit = 1; $param = '&id='.$object->id; diff --git a/htdocs/mrp/mo_document.php b/htdocs/mrp/mo_document.php index 96041171da6..101d26223f5 100644 --- a/htdocs/mrp/mo_document.php +++ b/htdocs/mrp/mo_document.php @@ -179,7 +179,7 @@ if ($object->id) { print dol_get_fiche_end(); $modulepart = 'mrp'; - $permission = $user->rights->mrp->write; + $permissiontoadd = $user->rights->mrp->write; $permtoedit = $user->rights->mrp->write; $param = '&id='.$object->id; diff --git a/htdocs/product/stock/productlot_document.php b/htdocs/product/stock/productlot_document.php index 820ad4d38bb..08b565c90a0 100644 --- a/htdocs/product/stock/productlot_document.php +++ b/htdocs/product/stock/productlot_document.php @@ -193,7 +193,6 @@ if ($object->id) { print dol_get_fiche_end(); - $permission = ($user->rights->produit->creer); $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { diff --git a/htdocs/projet/document.php b/htdocs/projet/document.php index 6bb905d6696..b088dcf7141 100644 --- a/htdocs/projet/document.php +++ b/htdocs/projet/document.php @@ -165,7 +165,7 @@ if ($object->id > 0) { print dol_get_fiche_end(); $modulepart = 'project'; - $permission = ($userWrite > 0); + $permissiontoadd = ($userWrite > 0); $permtoedit = ($userWrite > 0); include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index 575f949bb75..d9c49001dfc 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -324,7 +324,7 @@ if ($object->id > 0) { $param .= '&withproject=1'; } $modulepart = 'project_task'; - $permission = $user->rights->projet->creer; + $permissiontoadd = $user->rights->projet->creer; $permtoedit = $user->rights->projet->creer; $relativepathwithnofile = dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref).'/'; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; diff --git a/htdocs/recruitment/recruitmentcandidature_document.php b/htdocs/recruitment/recruitmentcandidature_document.php index 24b9f6d4e67..2e8c29cf2fe 100644 --- a/htdocs/recruitment/recruitmentcandidature_document.php +++ b/htdocs/recruitment/recruitmentcandidature_document.php @@ -212,7 +212,7 @@ if ($object->id) { print dol_get_fiche_end(); $modulepart = 'recruitment'; - $permission = $user->rights->recruitment->recruitmentjobposition->write; + $permissiontoadd = $user->rights->recruitment->recruitmentjobposition->write; $permtoedit = $user->rights->recruitment->recruitmentjobposition->write; $param = '&id='.$object->id; diff --git a/htdocs/recruitment/recruitmentjobposition_document.php b/htdocs/recruitment/recruitmentjobposition_document.php index e8ede6f0bdd..43d80901f3d 100644 --- a/htdocs/recruitment/recruitmentjobposition_document.php +++ b/htdocs/recruitment/recruitmentjobposition_document.php @@ -211,7 +211,7 @@ if ($object->id) { print dol_get_fiche_end(); $modulepart = 'recruitment'; - $permission = $user->rights->recruitment->recruitmentjobposition->write; + $permissiontoadd = $user->rights->recruitment->recruitmentjobposition->write; $permtoedit = $user->rights->recruitment->recruitmentjobposition->write; $param = '&id='.$object->id; diff --git a/htdocs/resource/document.php b/htdocs/resource/document.php index 6f4c714fac4..fec869d5620 100644 --- a/htdocs/resource/document.php +++ b/htdocs/resource/document.php @@ -139,7 +139,7 @@ if ($object->id > 0) { print dol_get_fiche_end(); $modulepart = 'dolresource'; - $permission = $user->rights->resource->write; + $permissiontoadd = $user->rights->resource->write; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { diff --git a/htdocs/salaries/document.php b/htdocs/salaries/document.php index 5950fc88798..ea21b49159c 100644 --- a/htdocs/salaries/document.php +++ b/htdocs/salaries/document.php @@ -149,7 +149,7 @@ if ($object->id) { print dol_get_fiche_end(); $modulepart = 'salaries'; - $permission = $user->rights->salaries->write; + $permissiontoadd = $user->rights->salaries->write; $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php index 653069882e0..0b8376e4f88 100644 --- a/htdocs/societe/document.php +++ b/htdocs/societe/document.php @@ -176,7 +176,7 @@ if ($object->id) { print dol_get_fiche_end(); $modulepart = 'societe'; - $permission = $user->rights->societe->creer; + $permissiontoadd = $user->rights->societe->creer; $permtoedit = $user->rights->societe->creer; $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; diff --git a/htdocs/supplier_proposal/document.php b/htdocs/supplier_proposal/document.php index eaf02981966..580c0f0974e 100644 --- a/htdocs/supplier_proposal/document.php +++ b/htdocs/supplier_proposal/document.php @@ -163,7 +163,7 @@ if ($object->id > 0) { print dol_get_fiche_end(); $modulepart = 'supplier_proposal'; - $permission = $user->rights->supplier_proposal->creer; + $permissiontoadd = $user->rights->supplier_proposal->creer; $permtoedit = $user->rights->supplier_proposal->creer; $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; diff --git a/htdocs/ticket/document.php b/htdocs/ticket/document.php index 8edd2787c44..d534e8a1123 100644 --- a/htdocs/ticket/document.php +++ b/htdocs/ticket/document.php @@ -203,7 +203,7 @@ if ($object->id) { //$object->ref = $object->track_id; // For compatibility we use track ID for directory $modulepart = 'ticket'; - $permission = $user->rights->ticket->write; + $permissiontoadd = $user->rights->ticket->write; $permtoedit = $user->rights->ticket->write; $param = '&id='.$object->id; diff --git a/htdocs/user/document.php b/htdocs/user/document.php index 297243f36ef..8cf6c2b2a81 100644 --- a/htdocs/user/document.php +++ b/htdocs/user/document.php @@ -176,7 +176,7 @@ if ($object->id) { $modulepart = 'user'; - $permission = $user->rights->user->user->creer; + $permissiontoadd = $user->rights->user->user->creer; $permtoedit = $user->rights->user->user->creer; $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; From af6bbe23cad2c28c33fb65adc6d58eadbc083a5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 8 Jun 2021 17:39:13 +0200 Subject: [PATCH 0478/1497] add warning if outstanding limit is exceeded --- 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 b5bd94f0c2e..8b5f757ad0e 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2294,6 +2294,7 @@ if ($action == 'create') { print $langs->trans('OutstandingBill'); print ''; From 4b8dfc1abe8744df3f8a42c107894f58da948266 Mon Sep 17 00:00:00 2001 From: MOREAU FRANCK Date: Tue, 8 Jun 2021 18:11:59 +0200 Subject: [PATCH 0479/1497] Adding hooks on product stat in order to allow to expand stat on other modules --- htdocs/core/lib/product.lib.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index b22207c5dda..e87e63666ef 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -558,9 +558,10 @@ function show_stats_for_company($product, $socid) print ''; print ''; } - $reshook = $hookmanager->executeHooks('addmoreproductstat', $parameters, $product); // Note that $action and $object may have been modified by some hooks + $parameters = array('socid'=>$socid); + $reshook = $hookmanager->executeHooks('addmoreproductstat', $parameters, $product,$nblines); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - + print $hookmanager->resPrint; return $nblines++; From 6733d278d8775cab97e49afb47348c595e00510b Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Tue, 8 Jun 2021 18:13:18 +0200 Subject: [PATCH 0480/1497] NEW: project time spent: conf to prevent recording time after X months --- htdocs/core/lib/project.lib.php | 50 ++++++++++++++++++++++++++---- htdocs/langs/en_US/admin.lang | 1 + htdocs/langs/en_US/projects.lang | 1 + htdocs/projet/admin/project.php | 15 +++++++++ htdocs/projet/class/task.class.php | 12 +++++++ 5 files changed, 73 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index aaa1e144202..d48d37a9539 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -1076,6 +1076,13 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr $oldprojectforbreak = (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT) ? 0 : -1); // 0 to start break , -1 no break } + $restrictBefore = null; + + if (! empty($conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS)) { + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; + $restrictBefore = dol_time_plus_duree(dol_now(), - $conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS, 'm'); + } + //dol_syslog('projectLinesPerDay inc='.$inc.' preselectedday='.$preselectedday.' task parent id='.$parent.' level='.$level." count(lines)=".$numlines." count(lineswithoutlevel0)=".count($lineswithoutlevel0)); for ($i = 0; $i < $numlines; $i++) { @@ -1307,6 +1314,10 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr $disabledtask = 1; } + if ($restrictBefore && $preselectedday < $restrictBefore) { + $disabledtask = 1; + } + // Form to add new time print ''; +print ''; + +print ''; +print ''; + +print ''; +print ''; print '
    '; -print $langs->trans("Category").': '.$formother->select_categories(Categorie::TYPE_SUPPLIER, $selected_cat, 'search_categ', true); +print img_picto('', 'category', 'class="paddingrightonly"'); +print $formother->select_categories(Categorie::TYPE_SUPPLIER, $selected_cat, 'search_categ', 0, $langs->trans("Category")); print ' '; print $langs->trans("SubCats").'? '; print ''; print '
    '; -print ''; +print ''; print ''; -print ''; +print ''; print ''; -print ''; +print ''; print ''; print $form->select_country($search_country, 'search_country'); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 7f6121fb07d..80ea1d5ea7b 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1373,7 +1373,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $modecompta = 'CREANCES-DETTES'; if (!empty($conf->accounting->enabled) && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { - $modecompta = 'BOOKKEEPING'; // Not yet implemented. Should be BOOKKEEPINGCOLLECTED + $modecompta = 'BOOKKEEPING'; // Not yet implemented. } if ($modecompta && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled))) { if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { @@ -1384,7 +1384,9 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM } $modecompta = 'RECETTES-DEPENSES'; - //if (! empty($conf->accounting->enabled) && ! empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') $modecompta=''; // Not yet implemented. Should be BOOKKEEPINGCOLLECTED + if (!empty($conf->accounting->enabled) && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { + $modecompta = 'BOOKKEEPINGCOLLECTED'; // Not yet implemented. + } if ($modecompta && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled))) { if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { $newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnoverCollected"), 2, $user->rights->accounting->comptarapport->lire); @@ -1410,7 +1412,6 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $newmenu->add("/compta/resultat/compteres.php?leftmenu=report","Compte de resultat",2,$user->rights->compta->resultat->lire); $newmenu->add("/compta/resultat/bilan.php?leftmenu=report","Bilan",2,$user->rights->compta->resultat->lire); */ - $newmenu->add("/compta/stats/index.php?leftmenu=report", $langs->trans("ReportTurnover"), 1, $user->rights->compta->resultat->lire); /* $newmenu->add("/compta/stats/cumul.php?leftmenu=report","Cumule",2,$user->rights->compta->resultat->lire); @@ -1419,14 +1420,32 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $newmenu->add("/compta/stats/comp.php?leftmenu=report","Transforme",2,$user->rights->compta->resultat->lire); } */ - $newmenu->add("/compta/stats/casoc.php?leftmenu=report", $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/stats/cabyuser.php?leftmenu=report", $langs->trans("ByUsers"), 2, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=report", $langs->trans("ByProductsAndServices"), 2, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/stats/byratecountry.php?leftmenu=report", $langs->trans("ByVatRate"), 2, $user->rights->compta->resultat->lire); + + $modecompta = 'CREANCES-DETTES'; + $newmenu->add("/compta/stats/index.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ReportTurnover"), 1, $user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/casoc.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/cabyuser.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByUsers"), 2, $user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 2, $user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/byratecountry.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByVatRate"), 2, $user->rights->compta->resultat->lire); + + $modecompta = 'RECETTES-DEPENSES'; + $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportTurnoverCollected"), 1, $user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByUsers"), 2, $user->rights->compta->resultat->lire); + //Achats - $newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report", $langs->trans("ReportPurchaseTurnover"), 1, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report", $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/stats/supplier_turnover_by_prodserv.php?leftmenu=accountancy_report", $langs->trans("ByProductsAndServices"), 2, $user->rights->compta->resultat->lire); + $modecompta = 'CREANCES-DETTES'; + $newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnover"), 1, $user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/supplier_turnover_by_prodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 2, $user->rights->compta->resultat->lire); + + /* + $modecompta = 'RECETTES-DEPENSES'; + $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnoverCollected"), 1, $user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByUsers"), 2, $user->rights->compta->resultat->lire); + */ + // Journals $newmenu->add("/compta/journal/sellsjournal.php?leftmenu=report", $langs->trans("SellsJournal"), 1, $user->rights->compta->resultat->lire, '', '', '', 50); $newmenu->add("/compta/journal/purchasesjournal.php?leftmenu=report", $langs->trans("PurchasesJournal"), 1, $user->rights->compta->resultat->lire, '', '', '', 51); From 2e6650924560ee5eca40da063cf0b0b4aebdff01 Mon Sep 17 00:00:00 2001 From: MOREAU FRANCK Date: Tue, 8 Jun 2021 15:47:20 +0200 Subject: [PATCH 0474/1497] Adding hooks on product stat in order to allow to expand stat on other modules --- htdocs/core/lib/product.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index a63871689b4..b22207c5dda 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -360,7 +360,7 @@ function product_lot_admin_prepare_head() */ function show_stats_for_company($product, $socid) { - global $conf, $langs, $user, $db; + global $conf, $langs, $user, $db, $hookmanager; $form = new Form($db); $hookmanager->initHooks(array('productstats')); $nblines = 0; From 6eab0f56619eb204b594857ce783cd25f2def604 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 8 Jun 2021 15:49:26 +0200 Subject: [PATCH 0475/1497] Fix css --- htdocs/comm/propal/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 48ad9783367..ceb945d1e72 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -1419,7 +1419,7 @@ if ($resql) { if (!empty($arrayfields['pr.ref']['checked'])) { // Project ref - print ''; + print ''; if ($obj->project_id > 0) { print $projectstatic->getNomUrl(1); } From facf594b2da40a8462b7b744c4a8040896daed9c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 8 Jun 2021 16:01:26 +0200 Subject: [PATCH 0476/1497] FIX Date of invoice generated from membership must be current date --- htdocs/adherents/class/adherent.class.php | 3 ++- htdocs/public/payment/newpayment.php | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index b7852280ddf..4c0c602cbc1 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1740,7 +1740,8 @@ class Adherent extends CommonObject } } $invoice->socid = $this->fk_soc; - $invoice->date = $datesubscription; + //$invoice->date = $datesubscription; + $invoice->date = dol_now(); // Possibility to add external linked objects with hooks $invoice->linked_objects['subscription'] = $subscriptionid; diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 3a7f9a4ed9f..fb95432256d 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1419,6 +1419,8 @@ if ($source == 'contractline') { // Payment on member subscription if ($source == 'member' || $source == 'membersubscription') { + $newsource = 'member'; + $found = true; $langs->load("members"); @@ -1478,7 +1480,7 @@ if ($source == 'member' || $source == 'membersubscription') { } print '
    '.$langs->trans("Designation"); print ''.$text; - print ''; + print ''; print ''; print '
    '; $arrayoutstandingbills = $soc->getOutstandingBills(); + print ($arrayoutstandingbills['opened'] > $soc->outstanding_limit ? img_warning() : ''); print price($arrayoutstandingbills['opened']).' / '; print price($soc->outstanding_limit, 0, $langs, 1, - 1, - 1, $conf->currency); print '
    '; $tableCell = $form->selectDate($preselectedday, $lines[$i]->id, 1, 1, 2, "addtime", 0, 0, $disabledtask); @@ -1451,6 +1462,13 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ $oldprojectforbreak = (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT) ? 0 : -1); // 0 = start break, -1 = never break } + $restrictBefore = null; + + if (! empty($conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS)) { + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; + $restrictBefore = dol_time_plus_duree(dol_now(), - $conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS, 'm'); + } + for ($i = 0; $i < $numlines; $i++) { if ($parent == 0) $level = 0; @@ -1708,6 +1726,12 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ $cssweekend = 'weekend'; } + $disabledtaskday = $disabledtask; + + if (! $disabledtask && $restrictBefore && $tmpday < $restrictBefore) { + $disabledtaskday = 1; + } + $tableCell = ''; //$tableCell .= 'idw='.$idw.' '.$conf->global->MAIN_START_WEEK.' '.$numstartworkingday.'-'.$numendworkingday; $placeholder = ''; @@ -1717,7 +1741,7 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ //$placeholder=' placeholder="00:00"'; //$tableCell.='+'; } - $tableCell .= ''; @@ -1812,6 +1836,13 @@ function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, & $oldprojectforbreak = (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT) ? 0 : -1); // 0 = start break, -1 = never break } + $restrictBefore = null; + + if (! empty($conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS)) { + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; + $restrictBefore = dol_time_plus_duree(dol_now(), - $conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS, 'm'); + } + for ($i = 0; $i < $numlines; $i++) { if ($parent == 0) $level = 0; @@ -1954,10 +1985,11 @@ function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, & $tableCell = ''; $modeinput = 'hours'; $TFirstDay = getFirstDayOfEachWeek($TWeek, date('Y', $firstdaytoshow)); $TFirstDay[reset($TWeek)] = 1; - foreach ($TFirstDay as &$fday) { - $fday--; - } - foreach ($TWeek as $weekNb) + + $firstdaytoshowarray = dol_getdate($firstdaytoshow); + $year = $firstdaytoshowarray['year']; + $month = $firstdaytoshowarray['mon']; + foreach ($TWeek as $weekIndex => $weekNb) { $weekWorkLoad = $projectstatic->monthWorkLoadPerTask[$weekNb][$lines[$i]->id]; $totalforeachweek[$weekNb] += $weekWorkLoad; @@ -1966,6 +1998,12 @@ function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, & if ($weekWorkLoad > 0) $alreadyspent = convertSecondToTime($weekWorkLoad, 'allhourmin'); $alttitle = $langs->trans("AddHereTimeSpentForWeek", $weekNb); + $disabledtaskweek = $disabledtask; + $firstdayofweek = dol_mktime(0, 0, 0, $month, $TFirstDay[$weekIndex], $year); + + if (! $disabledtask && $restrictBefore && $firstdayofweek < $restrictBefore) { + $disabledtaskweek = 1; + } $tableCell = ''; $placeholder = ''; @@ -1976,7 +2014,7 @@ function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, & //$tableCell.='+'; } - $tableCell .= ''; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index f5770bad737..446f01a5446 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -81,6 +81,7 @@ NumberOfBytes=Number of Bytes SearchString=Search string NotAvailableWhenAjaxDisabled=Not available when Ajax disabled AllowToSelectProjectFromOtherCompany=On document of a third party, can choose a project linked to another third party +TimesheetPreventAfterFollowingMonths=Prevent recording time spent after the following number of months JavascriptDisabled=JavaScript disabled UsePreviewTabs=Use preview tabs ShowPreview=Show preview diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 2aedbd53377..9fea85e7d1e 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -139,6 +139,7 @@ NoTasks=No tasks for this project LinkedToAnotherCompany=Linked to other third party TaskIsNotAssignedToUser=Task not assigned to user. Use button '%s' to assign task now. ErrorTimeSpentIsEmpty=Time spent is empty +TimeRecordingRestrictedToNMonthsBack=Time recording is restricted to %s months back ThisWillAlsoRemoveTasks=This action will also delete all tasks of project (%s tasks at the moment) and all inputs of time spent. IfNeedToUseOtherObjectKeepEmpty=If some objects (invoice, order, ...), belonging to another third party, must be linked to the project to create, keep this empty to have the project being multi third parties. CloneTasks=Clone tasks diff --git a/htdocs/projet/admin/project.php b/htdocs/projet/admin/project.php index f36aae34c4f..143f75b72ab 100644 --- a/htdocs/projet/admin/project.php +++ b/htdocs/projet/admin/project.php @@ -242,6 +242,11 @@ elseif ($action == 'setdoc') $projectToSelect = GETPOST('projectToSelect', 'alpha'); dolibarr_set_const($db, 'PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY', $projectToSelect, 'chaine', 0, '', $conf->entity); //Allow to disable this configuration if empty value } + if (GETPOST('PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS')) + { + $timesheetFreezeDuration = GETPOST('timesheetFreezeDuration', 'alpha'); + dolibarr_set_const($db, 'PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS', intval($timesheetFreezeDuration), 'chaine', 0, '', $conf->entity); //Allow to disable this configuration if empty value + } } @@ -839,6 +844,16 @@ print ''; print '
    '.$langs->trans("TimesheetPreventAfterFollowingMonths").''; +print ' '; +print ''; +print '
    '; diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index b4733de05ae..1b64f0d9a66 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -1095,6 +1095,18 @@ class Task extends CommonObject if (isset($this->timespent_note)) $this->timespent_note = trim($this->timespent_note); if (empty($this->timespent_datehour)) $this->timespent_datehour = $this->timespent_date; + if (! empty($conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS)) { + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; + $restrictBefore = dol_time_plus_duree(dol_now(), - $conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS, 'm'); + + if ($this->timespent_date < $restrictBefore) { + $this->error = $langs->trans('TimeRecordingRestrictedToNMonthsBack', $conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS); + $this->errors[] = $this->error; + return -1; + } + } + + $this->db->begin(); $sql = "INSERT INTO ".MAIN_DB_PREFIX."projet_task_time ("; From 71dbb8733d5516b02b0d8c1e418f69059fbc6ebf Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 8 Jun 2021 20:18:31 +0200 Subject: [PATCH 0481/1497] fix: #17827 --- htdocs/projet/document.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/document.php b/htdocs/projet/document.php index b088dcf7141..df31724d07c 100644 --- a/htdocs/projet/document.php +++ b/htdocs/projet/document.php @@ -164,7 +164,7 @@ if ($object->id > 0) { print dol_get_fiche_end(); - $modulepart = 'project'; + $modulepart = 'projet'; $permissiontoadd = ($userWrite > 0); $permtoedit = ($userWrite > 0); include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; From 27f803cab0e73b2fb2bf69a7fe67be604b8acc54 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Jun 2021 03:35:22 +0200 Subject: [PATCH 0482/1497] Fix receipt of cash fence must contains more legal information --- .../cashcontrol/class/cashcontrol.class.php | 19 +-- htdocs/compta/cashcontrol/report.php | 108 ++++++++++-------- 2 files changed, 71 insertions(+), 56 deletions(-) diff --git a/htdocs/compta/cashcontrol/class/cashcontrol.class.php b/htdocs/compta/cashcontrol/class/cashcontrol.class.php index a59816eebd7..59580cb7c46 100644 --- a/htdocs/compta/cashcontrol/class/cashcontrol.class.php +++ b/htdocs/compta/cashcontrol/class/cashcontrol.class.php @@ -93,10 +93,12 @@ class CashControl extends CommonObject 'year_close' =>array('type'=>'integer', 'label'=>'Year close', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>50, 'css'=>'center'), 'month_close' =>array('type'=>'integer', 'label'=>'Month close', 'enabled'=>1, 'visible'=>1, 'position'=>55, 'css'=>'center'), 'day_close' =>array('type'=>'integer', 'label'=>'Day close', 'enabled'=>1, 'visible'=>1, 'position'=>60, 'css'=>'center'), - 'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>490), 'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500), + 'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>502), 'tms' =>array('type'=>'timestamp', 'label'=>'Tms', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>505), - 'import_key' =>array('type'=>'varchar(14)', 'label'=>'Import key', 'enabled'=>1, 'visible'=>0, 'position'=>510), + 'fk_user_creat' =>array('type'=>'integer:User', 'label'=>'userCreation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>600), + 'fk_user_valid' =>array('type'=>'integer:User', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>602), + 'import_key' =>array('type'=>'varchar(14)', 'label'=>'Import key', 'enabled'=>1, 'visible'=>0, 'position'=>700), 'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'position'=>1000, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Brouillon', '1'=>'Validated')), ); @@ -115,21 +117,24 @@ class CashControl extends CommonObject public $cheque; public $card; - /** - * @var integer|string $date_valid - */ - public $date_valid; - /** * @var integer|string date_creation */ public $date_creation; + public $fk_user_creat; /** * @var integer|string $date_modification */ public $date_modification; + /** + * @var integer|string $date_valid + */ + public $date_valid; + public $fk_user_valid; + + const STATUS_DRAFT = 0; const STATUS_VALIDATED = 1; const STATUS_CLOSED = 1; // For the moment CLOSED = VALIDATED diff --git a/htdocs/compta/cashcontrol/report.php b/htdocs/compta/cashcontrol/report.php index 653161ca3bc..12dff9d460a 100644 --- a/htdocs/compta/cashcontrol/report.php +++ b/htdocs/compta/cashcontrol/report.php @@ -26,7 +26,7 @@ /** * \file htdocs/compta/cashcontrol/report.php * \ingroup cashdesk|takepos - * \brief List of bank transactions + * \brief List of sales from POS */ if (!defined('NOREQUIREMENU')) { @@ -36,6 +36,8 @@ if (!defined('NOBROWSERNOTIF')) { define('NOBROWSERNOTIF', '1'); // Disable browser notification } +$_GET['optioncss'] = "print"; + require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/cashcontrol/class/cashcontrol.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; @@ -48,10 +50,8 @@ $langs->loadLangs(array("bills", "banks")); $id = GETPOST('id', 'int'); -$_GET['optioncss'] = "print"; - -$cashcontrol = new CashControl($db); -$cashcontrol->fetch($id); +$object = new CashControl($db); +$object->fetch($id); //$limit = GETPOST('limit')?GETPOST('limit', 'int'):$conf->liste_limit; $sortorder = 'ASC'; @@ -67,19 +67,19 @@ $arrayfields = array( 'b.credit'=>array('label'=>$langs->trans("Credit"), 'checked'=>1, 'position'=>605), ); -$syear = $cashcontrol->year_close; -$smonth = $cashcontrol->month_close; -$sday = $cashcontrol->day_close; +$syear = $object->year_close; +$smonth = $object->month_close; +$sday = $object->day_close; -$posmodule = $cashcontrol->posmodule; -$terminalid = $cashcontrol->posnumber; +$posmodule = $object->posmodule; +$terminalid = $object->posnumber; // Security check if ($user->socid > 0) { // Protection if external user //$socid = $user->socid; accessforbidden(); } -if (!$user->rights->cashdesk->run && !$user->rights->takepos->run) { +if (empty($user->rights->cashdesk->run) && empty($user->rights->takepos->run)) { accessforbidden(); } @@ -106,8 +106,8 @@ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu ON bu.fk_bank = b.rowid AND $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON bu.url_id = f.rowid"; $sql.= " WHERE b.fk_account = ba.rowid"; // Define filter on invoice -$sql.= " AND f.module_source = '".$db->escape($cashcontrol->posmodule)."'"; -$sql.= " AND f.pos_source = '".$db->escape($cashcontrol->posnumber)."'"; +$sql.= " AND f.module_source = '".$db->escape($object->posmodule)."'"; +$sql.= " AND f.pos_source = '".$db->escape($object->posnumber)."'"; $sql.= " AND f.entity IN (".getEntity('facture').")"; // Define filter on data if ($syear && ! $smonth) $sql.= " AND dateo BETWEEN '".$db->idate(dol_get_first_day($syear, 1))."' AND '".$db->idate(dol_get_last_day($syear, 12))."'"; @@ -151,19 +151,33 @@ if ($resql) { $i = 0; print "\n"; - print "

    "; - if ($cashcontrol->status != $cashcontrol::STATUS_DRAFT) { - print $langs->trans("CashControl")." ".$cashcontrol->id; + print '
    '; + print '

    '; + if ($object->status != $object::STATUS_DRAFT) { + print $langs->trans("CashControl")." ".$object->id; } else { print $langs->trans("CashControl")." - ".$langs->trans("Draft"); } - print "
    ".$langs->trans("DateCreationShort").": ".dol_print_date($cashcontrol->date_creation, 'dayhour'); - print "

    "; + print "

    "; + print $langs->trans("DateCreationShort").": ".dol_print_date($object->date_creation, 'dayhour'); + print '
    '.$mysoc->name; + $userauthor = $object->fk_user_valid; + if (empty($userauthor)) { + $userauthor = $object->fk_user_creat; + } + + $uservalid = new User($db); + if ($userauthor > 0) { + $uservalid->fetch($userauthor); + print '
    '.$langs->trans("Author").': '.$uservalid->getFullName($langs); + } + print '
    '.$langs->trans("Period").': '.$object->year_close.($object->month_close ? '-'.$object->month_close : '').($object->day_close ? '-'.$object->day_close : ''); + print '
    '; $invoicetmp = new Facture($db); print "

    "; - print $langs->trans("InitialBankBalance").' - '.$langs->trans("Cash")." : ".price($cashcontrol->opening); + print $langs->trans("InitialBankBalance").' - '.$langs->trans("Cash").' : '.price($object->opening).''; print "

    "; print '
    '; @@ -206,7 +220,7 @@ if ($resql) { { print '
    '.$langs->trans("InitialBankBalance").' - '.$langs->trans("Cash").''.price($cashcontrol->opening).''.price($object->opening).'
    '; print $bankaccount->getNomUrl(1); - if ($cashcontrol->posmodule == "takepos") { - $var1 = 'CASHDESK_ID_BANKACCOUNT_CASH'.$cashcontrol->posnumber; + if ($object->posmodule == "takepos") { + $var1 = 'CASHDESK_ID_BANKACCOUNT_CASH'.$object->posnumber; } else { $var1 = 'CASHDESK_ID_BANKACCOUNT_CASH'; } @@ -305,48 +319,44 @@ if ($resql) { include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; print "
    "; + print ""; - //$cash = $amountpertype['LIQ'] + $cashcontrol->opening; - $cash = price2num($cash + $cashcontrol->opening, 'MT'); + //$cash = $amountpertype['LIQ'] + $object->opening; + $cash = price2num($cash + $object->opening, 'MT'); - print '

    '; - print $langs->trans("Cash").": ".price($cash); - if ($cashcontrol->status == $cashcontrol::STATUS_VALIDATED && $cash != $cashcontrol->cash) { - print ' <> '.$langs->trans("Declared").': '.price($cashcontrol->cash).''; + print '
    '; + print '

    '; + + print $langs->trans("Cash").': '.price($cash).''; + if ($object->status == $object::STATUS_VALIDATED && $cash != $object->cash) { + print ' <> '.$langs->trans("Declared").': '.price($object->cash).''; } - print "

    "; + print "
    "; //print '
    '; - print $langs->trans("PaymentTypeCHQ").": ".price($cheque); - if ($cashcontrol->status == $cashcontrol::STATUS_VALIDATED && $cheque != $cashcontrol->cheque) { - print ' <> '.$langs->trans("Declared").': '.price($cashcontrol->cheque).''; + print $langs->trans("PaymentTypeCHQ").': '.price($cheque).''; + if ($object->status == $object::STATUS_VALIDATED && $cheque != $object->cheque) { + print ' <> '.$langs->trans("Declared").': '.price($object->cheque).''; } - print "

    "; + print "
    "; //print '
    '; - print $langs->trans("PaymentTypeCB").": ".price($bank); - if ($cashcontrol->status == $cashcontrol::STATUS_VALIDATED && $bank != $cashcontrol->card) { - print ' <> '.$langs->trans("Declared").': '.price($cashcontrol->card).''; + print $langs->trans("PaymentTypeCB").': '.price($bank).''; + if ($object->status == $object::STATUS_VALIDATED && $bank != $object->card) { + print ' <> '.$langs->trans("Declared").': '.price($object->card).''; } - print "

    "; + print "
    "; // print '
    '; if ($other) { - print '
    '.$langs->trans("Other").": ".price($other)."

    "; + print ''.$langs->trans("Other").': '.price($other).""; + print '
    '; } - print "

    "; - //save totals to DB - /* - $sql = "UPDATE ".MAIN_DB_PREFIX."pos_cash_fence "; - $sql .= "SET"; - $sql .= " cash='".$db->escape($cash)."'"; - $sql .= ", card='".$db->escape($bank)."'"; - $sql .= " where rowid = ".((int) $id); - $db->query($sql); - */ + print $langs->trans("Total").': '.price($cash + $cheque + $bank + $other).''; - print "

    "; + print ''; + print ''; print ''; From f17e7a6979a9373183943d0afb906a69f41f0df3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Jun 2021 03:54:19 +0200 Subject: [PATCH 0483/1497] Add more info --- htdocs/compta/cashcontrol/report.php | 50 ++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 13 deletions(-) diff --git a/htdocs/compta/cashcontrol/report.php b/htdocs/compta/cashcontrol/report.php index 12dff9d460a..15345584f73 100644 --- a/htdocs/compta/cashcontrol/report.php +++ b/htdocs/compta/cashcontrol/report.php @@ -120,9 +120,10 @@ $sql.=" OR b.fk_account=".$conf->global->CASHDESK_ID_BANKACCOUNT_CB; $sql.=" OR b.fk_account=".$conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE; $sql.=")"; */ -$sql = "SELECT f.rowid as facid, f.ref, f.datef as do, pf.amount as amount, b.fk_account as bankid, cp.code"; -$sql .= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf, ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."paiement as p, ".MAIN_DB_PREFIX."c_paiement as cp, ".MAIN_DB_PREFIX."bank as b"; -$sql .= " WHERE pf.fk_facture = f.rowid AND p.rowid = pf.fk_paiement AND cp.id = p.fk_paiement AND p.fk_bank = b.rowid"; +$sql = "SELECT f.rowid as facid, f.ref, f.datef as do, pf.amount as amount, b.fk_account as bankid, cp.code, SUM(fd.qty) as qty"; +$sql .= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf, ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."paiement as p, ".MAIN_DB_PREFIX."c_paiement as cp, ".MAIN_DB_PREFIX."bank as b,"; +$sql .= " ".MAIN_DB_PREFIX."facturedet as fd"; +$sql .= " WHERE pf.fk_facture = f.rowid AND p.rowid = pf.fk_paiement AND cp.id = p.fk_paiement AND p.fk_bank = b.rowid AND fd.fk_facture = f.rowid"; $sql .= " AND f.module_source = '".$db->escape($posmodule)."'"; $sql .= " AND f.pos_source = '".$db->escape($terminalid)."'"; $sql .= " AND f.paye = 1"; @@ -144,6 +145,7 @@ if ($syear && !$smonth) { } else { dol_print_error('', 'Year not defined'); } +$sql .= " GROUP BY f.rowid, f.ref, f.datef, pf.amount, b.fk_account, cp.code"; $resql = $db->query($sql); if ($resql) { @@ -196,15 +198,20 @@ if ($resql) { print "
    '; - print $bankaccount->getNomUrl(1); if ($object->posmodule == "takepos") { $var1 = 'CASHDESK_ID_BANKACCOUNT_CASH'.$object->posnumber; } else { $var1 = 'CASHDESK_ID_BANKACCOUNT_CASH'; } + + // Bank account + print ''; + print $bankaccount->getNomUrl(1); if ($objp->code == 'CHQ') { $cheque += $objp->amount; + if (empty($transactionspertype[$objp->code])) { + $transactionspertype[$objp->code] = 0; + } + $transactionspertype[$objp->code] += 1; } elseif ($objp->code == 'CB') { $bank += $objp->amount; + if (empty($transactionspertype[$objp->code])) { + $transactionspertype[$objp->code] = 0; + } + $transactionspertype[$objp->code] += 1; } else { if ($conf->global->$var1 == $bankaccount->id) { $cash += $objp->amount; // } elseif ($conf->global->$var2 == $bankaccount->id) $bank+=$objp->amount; //elseif ($conf->global->$var3 == $bankaccount->id) $cheque+=$objp->amount; + if (empty($transactionspertype['CASH'])) { + $transactionspertype['CASH'] = 0; + } + $transactionspertype['CASH'] += 1; } else { $other += $objp->amount; + if (empty($transactionspertype['OTHER'])) { + $transactionspertype['OTHER'] = 0; + } + $transactionspertype['OTHER'] += 1; } } print "
    '.$langs->trans("InitialBankBalance").' - '.$langs->trans("Cash").''.price($object->opening).'
    '.$langs->trans("ManageLotMask").''; - print $object->batch_mask; - print '
    '.$langs->trans("ManageLotMask").''; + print $object->batch_mask; + print '
    trans("IM"); ?>
    trans("ContactVisibility"); ?> control->tpl['select_visibility']; ?>
    '; $sql = 'SELECT rowid, socialnetworks'; - $sql .= ', jabberid, skype, twitter, facebook, linkedin, instagram, snapchat, googleplus, youtube, whatsapp FROM '.MAIN_DB_PREFIX.'socpeople WHERE '; + $sql .= ', jabberid, skype, twitter, facebook, linkedin, instagram, snapchat, googleplus, youtube, whatsapp FROM '.MAIN_DB_PREFIX.'socpeople WHERE'; $sql .= " jabberid IS NOT NULL OR jabberid <> ''"; $sql .= " OR skype IS NOT NULL OR skype <> ''"; $sql .= " OR twitter IS NOT NULL OR twitter <> ''"; diff --git a/htdocs/webservices/server_contact.php b/htdocs/webservices/server_contact.php index a28371443d5..37d86dcded9 100644 --- a/htdocs/webservices/server_contact.php +++ b/htdocs/webservices/server_contact.php @@ -492,8 +492,7 @@ function getContactsForThirdParty($authentication, $idthirdparty) $sql .= " c.fk_pays as country_id,"; $sql .= " c.fk_departement as state_id,"; $sql .= " c.birthday,"; - $sql .= " c.poste, c.phone, c.phone_perso, c.phone_mobile, c.fax, c.email, c.jabberid,"; - //$sql.= " c.priv, c.note, c.default_lang, c.canvas,"; + $sql .= " c.poste, c.phone, c.phone_perso, c.phone_mobile, c.fax, c.email,"; $sql .= " co.label as country, co.code as country_code,"; $sql .= " d.nom as state, d.code_departement as state_code,"; $sql .= " u.rowid as user_id, u.login as user_login,"; @@ -545,7 +544,6 @@ function getContactsForThirdParty($authentication, $idthirdparty) 'phone_mobile' => $contact->phone_mobile ? $contact->phone_mobile : '', 'email' => $contact->email ? $contact->email : '', - 'jabberid' => $contact->jabberid ? $contact->jabberid : '', 'priv' => $contact->priv ? $contact->priv : '', 'mail' => $contact->mail ? $contact->mail : '', From 3cc478b1335ad6f4e422d770125b73c332b6f035 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 10 Jun 2021 00:13:23 +0200 Subject: [PATCH 0513/1497] Fix use of get url --- htdocs/blockedlog/class/authority.class.php | 22 +++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/htdocs/blockedlog/class/authority.class.php b/htdocs/blockedlog/class/authority.class.php index 4ec3fc6d07e..7240aaf0151 100644 --- a/htdocs/blockedlog/class/authority.class.php +++ b/htdocs/blockedlog/class/authority.class.php @@ -71,7 +71,7 @@ class BlockedLogAuthority $this->blockchain = ''; - if (is_array($bocks)) { + if (is_array($blocks)) { foreach ($blocks as &$b) { $this->blockchain .= $b->signature; } @@ -299,16 +299,18 @@ class BlockedLogAuthority $signature = $block_static->getSignature(); - foreach ($blocks as &$block) { - $url = $conf->global->BLOCKEDLOG_AUTHORITY_URL.'/blockedlog/ajax/authority.php?s='.$signature.'&b='.$block->signature; + if (is_array($blocks)) { + foreach ($blocks as &$block) { + $url = $conf->global->BLOCKEDLOG_AUTHORITY_URL.'/blockedlog/ajax/authority.php?s='.$signature.'&b='.$block->signature; - $res = file_get_contents($url); - echo $block->signature.' '.$url.' '.$res.'
    '; - if ($res === 'blockalreadyadded' || $res === 'blockadded') { - $block->setCertified(); - } else { - $this->error = $langs->trans('ImpossibleToContactAuthority ', $url); - return -1; + $res = getURLContent($url); + echo $block->signature.' '.$url.' '.$res.'
    '; + if ($res === 'blockalreadyadded' || $res === 'blockadded') { + $block->setCertified(); + } else { + $this->error = $langs->trans('ImpossibleToContactAuthority ', $url); + return -1; + } } } From 9afe8e54a7d164153339e3306d5eb9661067977d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 10 Jun 2021 00:41:15 +0200 Subject: [PATCH 0514/1497] Fix --- htdocs/compta/facture/index.php | 4 ++-- htdocs/core/lib/invoice.lib.php | 24 +++++++++++++++--------- htdocs/fourn/facture/index.php | 4 ++-- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/htdocs/compta/facture/index.php b/htdocs/compta/facture/index.php index 0b2f4538636..66a2fccaf08 100644 --- a/htdocs/compta/facture/index.php +++ b/htdocs/compta/facture/index.php @@ -59,8 +59,8 @@ print load_fiche_titre($langs->trans("CustomersInvoicesArea"), '', 'bill'); print '
    '; print '
    '; - -print getCustomerInvoicePieChart($socid); +print getNumberInvoicesPieChart('customers'); +//print getCustomerInvoicePieChart($socid); print '
    '; print getCustomerInvoiceDraftTable($max, $socid); diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index 0cbb89ae47b..43cff7d3c3e 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -458,8 +458,9 @@ function getPurchaseInvoicePieChart($socid = 0) /** * Return an HTML table that contains a pie chart of the number of customers or supplier invoices - * @param string $mode Can be customer or fourn - * @return string A HTML table that contains a pie chart of customers or supplier invoices + * + * @param string $mode Can be 'customers' or 'suppliers' + * @return string A HTML table that contains a pie chart of customers or supplier invoices */ function getNumberInvoicesPieChart($mode) { @@ -487,13 +488,17 @@ function getNumberInvoicesPieChart($mode) $sql .= ", sum(".$db->ifsql("f.date_lim_reglement > '".date_format($datenowadd30, 'Y-m-d')."'", 1, 0).") as nbnotlate30"; if ($mode == 'customers') { $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; - } elseif ($mode == 'fourn') { + } elseif ($mode == 'fourn' || $mode == 'suppliers') { $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; } else { return ''; } $sql .= " WHERE f.type <> 2"; $sql .= " AND f.fk_statut = 1"; + if (isset($user->socid) && $user->socid > 0) { + $sql .= " AND f.fk_soc = ".((int) $user->socid); + } + $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); @@ -519,14 +524,15 @@ function getNumberInvoicesPieChart($mode) $result = '
    '; $result .= ''; $result .= ''; - $result .= ''; - } elseif ($mode == 'fourn') { - $result .= $langs->trans("SupplierInvoice").''; + $result .= $langs->trans("CustomerInvoice"); + } elseif ($mode == 'fourn' || $mode == 'suppliers') { + $result .= $langs->trans("SupplierInvoice"); } else { return ''; } + $result .= ''; $result .= ''; $dolgraph = new DolGraph(); @@ -539,13 +545,13 @@ function getNumberInvoicesPieChart($mode) $dolgraph->setWidth('300'); if ($mode == 'customers') { $dolgraph->draw('idgraphcustomerinvoices'); - } elseif ($mode == 'fourn') { + } elseif ($mode == 'fourn' || $mode == 'suppliers') { $dolgraph->draw('idgraphfourninvoices'); } else { return ''; } $result .= ''; - $result .= ''; + $result .= ''; $result .= ''; $result .= '
    '.$langs->trans("Statistics").' - '; + $result .= ''.$langs->trans("Statistics").' - '; if ($mode == 'customers') { - $result .= $langs->trans("CustomerInvoice").'
    '.$dolgraph->show($total ? 0 : 1).''.$dolgraph->show($total ? 0 : 1).'
    '; $result .= '
    '; diff --git a/htdocs/fourn/facture/index.php b/htdocs/fourn/facture/index.php index e76426f54c2..c695eed9285 100644 --- a/htdocs/fourn/facture/index.php +++ b/htdocs/fourn/facture/index.php @@ -58,8 +58,8 @@ print load_fiche_titre($langs->trans("SupplierInvoicesArea"), '', 'supplier_invo print '
    '; print '
    '; - -print getPurchaseInvoicePieChart($socid); +print getNumberInvoicesPieChart('suppliers'); +//print getPurchaseInvoicePieChart($socid); print '
    '; print getDraftSupplierTable($maxDraftCount, $socid); From c40bc085b2dd309bd09118172d4084599eafd651 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 10 Jun 2021 00:55:10 +0200 Subject: [PATCH 0515/1497] Fix v14 --- htdocs/core/lib/invoice.lib.php | 40 +++++++++++++++++++-------------- htdocs/langs/en_US/bills.lang | 1 + 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index 43cff7d3c3e..b6618b5df26 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -505,6 +505,7 @@ function getNumberInvoicesPieChart($mode) $i = 0; $total = 0; $dataseries = array(); + while ($i < $num) { $obj = $db->fetch_object($resql); $dataseries = array(array($langs->trans('InvoiceLate30Days'),$obj->nblate30) @@ -520,21 +521,22 @@ function getNumberInvoicesPieChart($mode) } $colorseries = array($badgeStatus8, $badgeStatus1, $badgeStatus3, $badgeStatus4, $badgeStatus11, '-'.$badgeStatus11); - if ($conf->use_javascript_ajax) { - $result = '
    '; - $result .= ''; - $result .= ''; - $result .= ''; - $result .= ''; + $result = '
    '; + $result .= '
    '.$langs->trans("Statistics").' - '; - if ($mode == 'customers') { - $result .= $langs->trans("CustomerInvoice"); - } elseif ($mode == 'fourn' || $mode == 'suppliers') { - $result .= $langs->trans("SupplierInvoice"); - } else { - return ''; - } - $result .= '
    '; + $result .= ''; + $result .= ''; + $result .= ''; + + if ($conf->use_javascript_ajax) { $dolgraph = new DolGraph(); $dolgraph->SetData($dataseries); $dolgraph->SetDataColor(array_values($colorseries)); @@ -551,11 +553,15 @@ function getNumberInvoicesPieChart($mode) return ''; } $result .= ''; - $result .= ''; + $result .= ''; $result .= ''; - $result .= '
    '.$langs->trans("Statistics").' - '; + if ($mode == 'customers') { + $result .= $langs->trans("CustomerInvoice"); + } elseif ($mode == 'fourn' || $mode == 'suppliers') { + $result .= $langs->trans("SupplierInvoice"); + } else { + return ''; + } + $result .= '
    '.$dolgraph->show($total ? 0 : 1).''.$dolgraph->show($total ? 0 : $langs->trans("NoOpenInvoice")).'
    '; - $result .= '
    '; + } else { + // Print text lines } + + $result .= '
    '; + $result .= '
    '; + return $result; } else { dol_print_error($db); diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 940da4e35b4..0c660de8e22 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -259,6 +259,7 @@ DateMaxPayment=Payment due on DateInvoice=Invoice date DatePointOfTax=Point of tax NoInvoice=No invoice +NoOpenInvoice=No open invoice ClassifyBill=Classify invoice SupplierBillsToPay=Unpaid vendor invoices CustomerBillsUnpaid=Unpaid customer invoices From ea0db5a574db32eab922845e924b2577eccc1eab Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 10 Jun 2021 01:10:35 +0200 Subject: [PATCH 0516/1497] Fix popup of invoice --- htdocs/core/lib/functions.lib.php | 8 ++++++-- htdocs/core/lib/invoice.lib.php | 16 ++++++++++++---- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 1857be0146c..dd4d8cba1f2 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3515,7 +3515,9 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'github', 'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp', 'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top', 'commercial', 'companies', 'generic', 'home', 'hrm', 'members', 'products', 'invoicing', - 'partnership', 'payment', 'pencil-ruler', 'preview', 'project', 'projectpub', 'projecttask', 'question', 'refresh', 'salary', 'shipment', 'supplier_invoice', 'technic', 'ticket', + 'partnership', 'payment', 'pencil-ruler', 'preview', 'project', 'projectpub', 'projecttask', 'question', 'refresh', 'salary', 'shipment', + 'supplier_invoice', 'supplier_invoicea', 'supplier_invoicer', 'supplier_invoiced', + 'technic', 'ticket', 'error', 'warning', 'recent', 'reception', 'recruitmentcandidature', 'recruitmentjobposition', 'resource', 'shapes', 'supplier', 'supplier_proposal', 'supplier_order', 'supplier_invoice', @@ -3536,7 +3538,9 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $arrayconvpictotofa = array( 'account'=>'university', 'accountline'=>'receipt', 'accountancy'=>'search-dollar', 'action'=>'calendar-alt', 'add'=>'plus-circle', 'address'=> 'address-book', 'asset'=>'money-check-alt', 'autofill'=>'fill', - 'bank_account'=>'university', 'bill'=>'file-invoice-dollar', 'billa'=>'file-excel', 'billr'=>'file-invoice-dollar', 'supplier_invoicea'=>'file-excel', 'billd'=>'file-medical', 'supplier_invoiced'=>'file-medical', + 'bank_account'=>'university', + 'bill'=>'file-invoice-dollar', 'billa'=>'file-excel', 'billr'=>'file-invoice-dollar', 'billd'=>'file-medical', + 'supplier_invoice'=>'file-invoice-dollar', 'supplier_invoicea'=>'file-excel', 'supplier_invoicer'=>'file-invoice-dollar', 'supplier_invoiced'=>'file-medical', 'bom'=>'shapes', 'chart'=>'chart-line', 'company'=>'building', 'contact'=>'address-book', 'contract'=>'suitcase', 'collab'=>'people-arrows', 'conversation'=>'comments', 'country'=>'globe-americas', 'cron'=>'business-time', 'donation'=>'file-alt', 'dynamicprice'=>'hand-holding-usd', diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index b6618b5df26..c328d659b93 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -854,8 +854,8 @@ function getCustomerInvoiceLatestEditTable($maxCount = 5, $socid = 0) { global $conf, $db, $langs, $user; - $sql = "SELECT f.rowid, f.entity, f.ref, f.fk_statut as status, f.paye, s.nom as socname, s.rowid as socid, s.canvas, s.client,"; - $sql .= " f.datec"; + $sql = "SELECT f.rowid, f.entity, f.ref, f.fk_statut as status, f.paye, f.type, f.total_ht, f.total_tva, f.total_ttc, f.datec,"; + $sql .= " s.nom as socname, s.rowid as socid, s.canvas, s.client"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$socid) { @@ -904,6 +904,10 @@ function getCustomerInvoiceLatestEditTable($maxCount = 5, $socid = 0) $objectstatic->ref = $obj->ref; $objectstatic->paye = $obj->paye; $objectstatic->statut = $obj->status; + $objectstatic->total_ht = $obj->total_ht; + $objectstatic->total_tva = $obj->total_tva; + $objectstatic->total_ttc = $obj->total_ttc; + $objectstatic->type = $obj->type; $companystatic->id = $obj->socid; $companystatic->name = $obj->socname; @@ -952,8 +956,8 @@ function getPurchaseInvoiceLatestEditTable($maxCount = 5, $socid = 0) { global $conf, $db, $langs, $user; - $sql = "SELECT f.rowid, f.entity, f.ref, f.fk_statut as status, f.paye, s.nom as socname, s.rowid as socid, s.canvas, s.client,"; - $sql .= " f.datec"; + $sql = "SELECT f.rowid, f.entity, f.ref, f.fk_statut as status, f.paye, f.total_ht, f.total_tva, f.total_ttc, f.type, f.ref_supplier, f.datec,"; + $sql .= " s.nom as socname, s.rowid as socid, s.canvas, s.client"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$socid) { @@ -1002,6 +1006,10 @@ function getPurchaseInvoiceLatestEditTable($maxCount = 5, $socid = 0) $objectstatic->ref = $obj->ref; $objectstatic->paye = $obj->paye; $objectstatic->statut = $obj->status; + $objectstatic->total_ht = $obj->total_ht; + $objectstatic->total_tva = $obj->total_tva; + $objectstatic->total_ttc = $obj->total_ttc; + $objectstatic->type = $obj->type; $companystatic->id = $obj->socid; $companystatic->name = $obj->socname; From 4c89a1146c1553c8cdda1693057e7e06617f9a5c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 10 Jun 2021 01:13:50 +0200 Subject: [PATCH 0517/1497] Fix popup --- htdocs/compta/index.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 18519955bf6..8db217747ef 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -267,7 +267,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU $langs->load("boxes"); $facstatic = new FactureFournisseur($db); - $sql = "SELECT ff.rowid, ff.ref, ff.fk_statut as status, ff.libelle, ff.total_ht, ff.total_tva, ff.total_ttc, ff.tms, ff.paye"; + $sql = "SELECT ff.rowid, ff.ref, ff.fk_statut as status, ff.type, ff.libelle, ff.total_ht, ff.total_tva, ff.total_ttc, ff.tms, ff.paye, ff.ref_supplier"; $sql .= ", s.nom as name"; $sql .= ", s.rowid as socid"; $sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.email"; @@ -290,7 +290,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU $reshook = $hookmanager->executeHooks('printFieldListWhereSupplierLastModified', $parameters); $sql .= $hookmanager->resPrint; - $sql .= " GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.tva, ff.total_tva, ff.total_ttc, ff.tms, ff.paye,"; + $sql .= " GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.type, ff.libelle, ff.total_ht, ff.tva, ff.total_tva, ff.total_ttc, ff.tms, ff.paye, ff.ref_supplier,"; $sql .= " s.nom, s.rowid, s.code_fournisseur, s.code_compta_fournisseur, s.email"; $sql .= " ORDER BY ff.tms DESC "; $sql .= $db->plimit($max, 0); @@ -332,6 +332,8 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU $facstatic->total_ttc = $obj->total_ttc; $facstatic->statut = $obj->status; $facstatic->paye = $obj->paye; + $facstatic->type = $obj->type; + $facstatic->ref_supplier = $obj->ref_supplier; $thirdpartystatic->id = $obj->socid; $thirdpartystatic->name = $obj->name; From ae6d2ba9b51013747c650926e445a7b914b067e7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 10 Jun 2021 01:56:20 +0200 Subject: [PATCH 0518/1497] Fix missing user creation/modif of template invoice --- .../compta/facture/invoicetemplate_list.php | 51 +++++++++++++++++-- htdocs/compta/facture/list.php | 2 +- 2 files changed, 47 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 5f7e277076c..af6678ffd71 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -137,9 +137,11 @@ $arrayfields = array( 'f.nb_gen_done'=>array('label'=>"NbOfGenerationDoneShort", 'checked'=>1), 'f.date_last_gen'=>array('label'=>"DateLastGenerationShort", 'checked'=>1), 'f.date_when'=>array('label'=>"NextDateToExecutionShort", 'checked'=>1), - 'status'=>array('label'=>"Status", 'checked'=>1, 'position'=>100), - 'f.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), - 'f.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500), + 'f.fk_user_author'=>array('label'=>"UserCreation", 'checked'=>0, 'position'=>500), + 'f.fk_user_modif'=>array('label'=>"UserModification", 'checked'=>0, 'position'=>505), + 'f.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>520), + 'f.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>525), + 'status'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000), ); // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; @@ -240,6 +242,7 @@ if (!empty($conf->projet->enabled)) { } $companystatic = new Societe($db); $invoicerectmp = new FactureRec($db); +$tmpuser = new User($db); $now = dol_now(); $tmparray = dol_getdate($now); @@ -252,7 +255,7 @@ $today = dol_mktime(23, 59, 59, $tmparray['mon'], $tmparray['mday'], $tmparray[' $sql = "SELECT s.nom as name, s.rowid as socid, f.rowid as facid, f.titre as title, f.total_ht, f.total_tva, f.total_ttc, f.frequency, f.unit_frequency,"; $sql .= " f.nb_gen_done, f.nb_gen_max, f.date_last_gen, f.date_when, f.suspended,"; -$sql .= " f.datec, f.tms,"; +$sql .= " f.datec, f.fk_user_author, f.tms, f.fk_user_modif,"; $sql .= " f.fk_cond_reglement, f.fk_mode_reglement"; // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { @@ -274,7 +277,7 @@ if (!$user->rights->societe->client->voir && !$socid) { $sql .= " WHERE f.fk_soc = s.rowid"; $sql .= ' AND f.entity IN ('.getEntity('invoice').')'; if (!$user->rights->societe->client->voir && !$socid) { - $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; + $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($search_ref) { $sql .= natural_search('f.titre', $search_ref); @@ -534,6 +537,16 @@ if ($resql) { $parameters = array('arrayfields'=>$arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; + // User creation + if (!empty($arrayfields['f.fk_user_author']['checked'])) { + print ''; + print ''; + } + // User modification + if (!empty($arrayfields['f.fk_user_modif']['checked'])) { + print ''; + print ''; + } // Date creation if (!empty($arrayfields['f.datec']['checked'])) { print ''; @@ -602,6 +615,12 @@ if ($resql) { if (!empty($arrayfields['f.date_when']['checked'])) { print_liste_field_titre($arrayfields['f.date_when']['label'], $_SERVER['PHP_SELF'], "f.date_when", "", $param, 'align="center"', $sortfield, $sortorder); } + if (!empty($arrayfields['f.fk_user_author']['checked'])) { + print_liste_field_titre($arrayfields['f.fk_user_author']['label'], $_SERVER['PHP_SELF'], "f.fk_user_author", "", $param, 'align="center"', $sortfield, $sortorder); + } + if (!empty($arrayfields['f.fk_user_modif']['checked'])) { + print_liste_field_titre($arrayfields['f.fk_user_modif']['label'], $_SERVER['PHP_SELF'], "f.fk_user_modif", "", $param, 'align="center"', $sortfield, $sortorder); + } if (!empty($arrayfields['f.datec']['checked'])) { print_liste_field_titre($arrayfields['f.datec']['label'], $_SERVER['PHP_SELF'], "f.datec", "", $param, 'align="center"', $sortfield, $sortorder); } @@ -754,6 +773,28 @@ if ($resql) { $totalarray['nbfield']++; } } + if (!empty($arrayfields['f.fk_user_author']['checked'])) { + print ''; + if ($objp->fk_user_author > 0) { + $tmpuser->fetch($objp->fk_user_author); + print $tmpuser->getNomUrl(1); + } + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + if (!empty($arrayfields['f.fk_user_modif']['checked'])) { + print ''; + if ($objp->fk_user_author > 0) { + $tmpuser->fetch($objp->fk_user_author); + print $tmpuser->getNomUrl(1); + } + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } if (!empty($arrayfields['f.datec']['checked'])) { print ''; print dol_print_date($db->jdate($objp->datec), 'dayhour'); diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index a375bc677f2..de6c3f66065 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -240,7 +240,7 @@ $arrayfields = array( 'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous || empty($conf->global->DISPLAY_MARGIN_RATES) ? 0 : 1)), 'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous || empty($conf->global->DISPLAY_MARK_RATES) ? 0 : 1)), 'f.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), - 'f.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500), + 'f.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>502), 'f.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES))), 'f.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'position'=>511, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES))), 'f.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000), From 5f925d9e3b183f32bf8ea0d455b2d66edcf9c53f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 10 Jun 2021 02:10:58 +0200 Subject: [PATCH 0519/1497] Fix total -> total_ht --- htdocs/compta/facture/invoicetemplate_list.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index af6678ffd71..19da4b97f63 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -654,6 +654,9 @@ if ($resql) { $invoicerectmp->nb_gen_max = $objp->nb_gen_max; $invoicerectmp->nb_gen_done = $objp->nb_gen_done; $invoicerectmp->ref = $objp->title; + $invoicerectmp->total_ht = $objp->total_ht; + $invoicerectmp->total_tva = $objp->total_tva; + $invoicerectmp->total_ttc = $objp->total_ttc; print ''; @@ -673,7 +676,7 @@ if ($resql) { } } if (!empty($arrayfields['f.total_ht']['checked'])) { - print ''.price($objp->total).''."\n"; + print ''.price($objp->total_ht).''."\n"; if (!$i) { $totalarray['nbfield']++; } From 53af424a3dc082ace87de3ba16804b4fe5acc7dd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 10 Jun 2021 02:12:29 +0200 Subject: [PATCH 0520/1497] Fix total tva --- htdocs/compta/facture/invoicetemplate_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 19da4b97f63..c60690ce96b 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -686,7 +686,7 @@ if ($resql) { $totalarray['val']['f.total_ht'] += $objp->total_ht; } if (!empty($arrayfields['f.total_tva']['checked'])) { - print ''.price($objp->total_vat).''."\n"; + print ''.price($objp->total_tva).''."\n"; if (!$i) { $totalarray['nbfield']++; } From 3d26ad4cf8f67c8f7d94defc87f3f4a6d66a74c4 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Thu, 10 Jun 2021 05:59:29 +0200 Subject: [PATCH 0521/1497] NEW Add field date from/to in supplier invoice list --- htdocs/fourn/facture/list.php | 158 +++++++++++++++++++++++----------- 1 file changed, 106 insertions(+), 52 deletions(-) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 8578f82137d..72ca65bc409 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -1,17 +1,18 @@ - * Copyright (C) 2004-2019 Laurent Destailleur - * Copyright (C) 2005-2013 Regis Houssin - * Copyright (C) 2013-2019 Philippe Grand - * Copyright (C) 2013 Florian Henry - * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2015 Marcos García - * Copyright (C) 2015-2007 Juanjo Menent - * Copyright (C) 2015 Abbes Bahfir - * Copyright (C) 2015-2016 Ferran Marcet - * Copyright (C) 2017 Josep Lluís Amador - * Copyright (C) 2018 Charlene Benke - * Copyright (C) 2018-2020 Frédéric France +/* Copyright (C) 2002-2006 Rodolphe Quiedeville + * Copyright (C) 2004-2019 Laurent Destailleur + * Copyright (C) 2005-2013 Regis Houssin + * Copyright (C) 2013-2019 Philippe Grand + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2013 Cédric Salvador + * Copyright (C) 2015 Marcos García + * Copyright (C) 2015-2007 Juanjo Menent + * Copyright (C) 2015 Abbes Bahfir + * Copyright (C) 2015-2016 Ferran Marcet + * Copyright (C) 2017 Josep Lluís Amador + * Copyright (C) 2018 Charlene Benke + * Copyright (C) 2018-2020 Frédéric France + * Copyright (C) 2019-2021 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -101,12 +102,22 @@ $search_country = GETPOST("search_country", 'int'); $search_type_thirdparty = GETPOST("search_type_thirdparty", 'int'); $search_user = GETPOST('search_user', 'int'); $search_sale = GETPOST('search_sale', 'int'); -$day = GETPOST('day', 'int'); -$month = GETPOST('month', 'int'); -$year = GETPOST('year', 'int'); -$day_lim = GETPOST('day_lim', 'int'); -$month_lim = GETPOST('month_lim', 'int'); -$year_lim = GETPOST('year_lim', 'int'); +$search_date_startday = GETPOST('search_date_startday', 'int'); +$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); +$search_date_startyear = GETPOST('search_date_startyear', 'int'); +$search_date_endday = GETPOST('search_date_endday', 'int'); +$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); +$search_date_endyear = GETPOST('search_date_endyear', 'int'); +$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver +$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); +$search_datelimit_startday = GETPOST('search_datelimit_startday', 'int'); +$search_datelimit_startmonth = GETPOST('search_datelimit_startmonth', 'int'); +$search_datelimit_startyear = GETPOST('search_datelimit_startyear', 'int'); +$search_datelimit_endday = GETPOST('search_datelimit_endday', 'int'); +$search_datelimit_endmonth = GETPOST('search_datelimit_endmonth', 'int'); +$search_datelimit_endyear = GETPOST('search_datelimit_endyear', 'int'); +$search_datelimit_start = dol_mktime(0, 0, 0, $search_datelimit_startmonth,$search_datelimit_startday, $search_datelimit_startyear); +$search_datelimit_end = dol_mktime(23, 59, 59, $search_datelimit_endmonth,$search_datelimit_endday, $search_datelimit_endyear); $toselect = GETPOST('toselect', 'array'); $search_btn = GETPOST('button_search', 'alpha'); $search_remove_btn = GETPOST('button_removefilter', 'alpha'); @@ -257,12 +268,22 @@ if (empty($reshook)) { $search_type = ''; $search_country = ''; $search_type_thirdparty = ''; - $year = ""; - $month = ""; - $day = ""; - $year_lim = ""; - $month_lim = ""; - $day_lim = ""; + $search_date_startday = ''; + $search_date_startmonth = ''; + $search_date_startyear = ''; + $search_date_endday = ''; + $search_date_endmonth = ''; + $search_date_endyear = ''; + $search_date_start = ''; + $search_date_end = ''; + $search_datelimit_startday = ''; + $search_datelimit_startmonth = ''; + $search_datelimit_startyear = ''; + $search_datelimit_endday = ''; + $search_datelimit_endmonth = ''; + $search_datelimit_endyear = ''; + $search_datelimit_start = ''; + $search_datelimit_end = ''; $toselect = ''; $search_array_options = array(); $filter = ''; @@ -548,8 +569,18 @@ if ($search_paymentmode > 0) { if ($search_paymentcond > 0) { $sql .= " AND f.fk_cond_reglement = ".((int) $search_paymentcond); } -$sql .= dolSqlDateFilter("f.datef", $day, $month, $year); -$sql .= dolSqlDateFilter("f.date_lim_reglement", $day_lim, $month_lim, $year_lim); +if ($search_date_start) { + $sql .= " AND f.datef >= '" . $db->idate($search_date_start) . "'"; +} +if ($search_date_end) { + $sql .= " AND f.datef <= '" . $db->idate($search_date_end) . "'"; +} +if ($search_datelimit_start) { + $sql .= " AND f.date_lim_reglement >= '" . $db->idate($search_datelimit_start) . "'"; +} +if ($search_datelimit_end) { + $sql .= " AND f.date_lim_reglement <= '" . $db->idate($search_datelimit_end) . "'"; +} if ($option == 'late') { $sql .= " AND f.date_lim_reglement < '".$db->idate(dol_now() - $conf->facture->fournisseur->warning_delay)."'"; } @@ -669,23 +700,41 @@ if ($resql) { if ($search_all) { $param .= '&search_all='.urlencode($search_all); } - if ($day) { - $param .= '&day='.urlencode($day); + if ($search_date_startday) { + $param .= '&search_date_startday='.urlencode($search_date_startday); } - if ($month) { - $param .= '&month='.urlencode($month); + if ($search_date_startmonth) { + $param .= '&search_date_startmonth='.urlencode($search_date_startmonth); } - if ($year) { - $param .= '&year='.urlencode($year); + if ($search_date_startyear) { + $param .= '&search_date_startyear='.urlencode($search_date_startyear); } - if ($day_lim) { - $param .= '&day_lim='.urlencode($day_lim); + if ($search_date_endday) { + $param .= '&search_date_endday='.urlencode($search_date_endday); } - if ($month_lim) { - $param .= '&month_lim='.urlencode($month_lim); + if ($search_date_endmonth) { + $param .= '&search_date_endmonth='.urlencode($search_date_endmonth); } - if ($year_lim) { - $param .= '&year_lim='.urlencode($year_lim); + if ($search_date_endyear) { + $param .= '&search_date_endyear='.urlencode($search_date_endyear); + } + if ($search_datelimit_startday) { + $param .= '&search_datelimit_startday='.urlencode($search_datelimit_startday); + } + if ($search_datelimit_startmonth) { + $param .= '&search_datelimit_startmonth='.urlencode($search_datelimit_startmonth); + } + if ($search_datelimit_startyear) { + $param .= '&search_datelimit_startyear='.urlencode($search_datelimit_startyear); + } + if ($search_datelimit_endday) { + $param .= '&search_datelimit_endday='.urlencode($search_datelimit_endday); + } + if ($search_datelimit_endmonth) { + $param .= '&search_datelimit_endmonth='.urlencode($search_datelimit_endmonth); + } + if ($search_datelimit_endyear) { + $param .= '&search_datelimit_endyear='.urlencode($search_datelimit_endyear); } if ($search_ref) { $param .= '&search_ref='.urlencode($search_ref); @@ -956,23 +1005,28 @@ if ($resql) { } // Date invoice if (!empty($arrayfields['f.datef']['checked'])) { - print ''; - if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) { - print ''; - } - print ''; - $formother->select_year($year ? $year : -1, 'year', 1, 20, 5); + print ''; + print '
    '; + print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); + print '
    '; + print '
    '; + print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); + print '
    '; print ''; } // Date due if (!empty($arrayfields['f.date_lim_reglement']['checked'])) { - print ''; - if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) { - print ''; - } - print ''; - $formother->select_year($year_lim ? $year_lim : -1, 'year_lim', 1, 20, 5); - print '
    '; + print ''; + print '
    '; + /* + print $langs->trans('From').' '; + print $form->selectDate($search_datelimit_start ? $search_datelimit_start : -1, 'search_datelimit_start', 0, 0, 1); + print '
    '; + print '
    '; + print $langs->trans('to').' ';*/ + print $form->selectDate($search_datelimit_end ? $search_datelimit_end : -1, 'search_datelimit_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("Before")); + print '
    '.$langs->trans("Alert"); + print '
    '; print ''; } // Project From 17bdd0b5bcc0bbe78028a1115c101bc4ae5fc818 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 10 Jun 2021 04:03:51 +0000 Subject: [PATCH 0522/1497] Fixing style errors. --- htdocs/fourn/facture/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 72ca65bc409..04dd46035b3 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -116,8 +116,8 @@ $search_datelimit_startyear = GETPOST('search_datelimit_startyear', 'int'); $search_datelimit_endday = GETPOST('search_datelimit_endday', 'int'); $search_datelimit_endmonth = GETPOST('search_datelimit_endmonth', 'int'); $search_datelimit_endyear = GETPOST('search_datelimit_endyear', 'int'); -$search_datelimit_start = dol_mktime(0, 0, 0, $search_datelimit_startmonth,$search_datelimit_startday, $search_datelimit_startyear); -$search_datelimit_end = dol_mktime(23, 59, 59, $search_datelimit_endmonth,$search_datelimit_endday, $search_datelimit_endyear); +$search_datelimit_start = dol_mktime(0, 0, 0, $search_datelimit_startmonth, $search_datelimit_startday, $search_datelimit_startyear); +$search_datelimit_end = dol_mktime(23, 59, 59, $search_datelimit_endmonth, $search_datelimit_endday, $search_datelimit_endyear); $toselect = GETPOST('toselect', 'array'); $search_btn = GETPOST('button_search', 'alpha'); $search_remove_btn = GETPOST('button_removefilter', 'alpha'); From b216c81c60305513415c7c9b1086d55df75eac0f Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Thu, 10 Jun 2021 06:22:03 +0200 Subject: [PATCH 0523/1497] FIX Customer invoice list - Pagination lost search_date_xxx information --- htdocs/compta/facture/list.php | 74 ++++++++++++++++++++++++++++------ 1 file changed, 61 insertions(+), 13 deletions(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index f655de32646..94326852d31 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -13,7 +13,7 @@ * Copyright (C) 2015-2016 Ferran Marcet * Copyright (C) 2017 Josep Lluís Amador * Copyright (C) 2018 Charlene Benke - * Copyright (C) 2019 Alexandre Spangaro + * Copyright (C) 2019-2021 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -105,12 +105,30 @@ $search_country = GETPOST("search_country", 'int'); $search_type_thirdparty = GETPOST("search_type_thirdparty", 'int'); $search_user = GETPOST('search_user', 'int'); $search_sale = GETPOST('search_sale', 'int'); -$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int')); -$search_date_end = dol_mktime(23, 59, 59, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int')); -$search_date_valid_start = dol_mktime(0, 0, 0, GETPOST('search_date_valid_startmonth', 'int'), GETPOST('search_date_valid_startday', 'int'), GETPOST('search_date_valid_startyear', 'int')); -$search_date_valid_end = dol_mktime(23, 59, 59, GETPOST('search_date_valid_endmonth', 'int'), GETPOST('search_date_valid_endday', 'int'), GETPOST('search_date_valid_endyear', 'int')); -$search_datelimit_start = dol_mktime(0, 0, 0, GETPOST('search_datelimit_startmonth', 'int'), GETPOST('search_datelimit_startday', 'int'), GETPOST('search_datelimit_startyear', 'int')); -$search_datelimit_end = dol_mktime(23, 59, 59, GETPOST('search_datelimit_endmonth', 'int'), GETPOST('search_datelimit_endday', 'int'), GETPOST('search_datelimit_endyear', 'int')); +$search_date_startday = GETPOST('search_date_startday', 'int'); +$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); +$search_date_startyear = GETPOST('search_date_startyear', 'int'); +$search_date_endday = GETPOST('search_date_endday', 'int'); +$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); +$search_date_endyear = GETPOST('search_date_endyear', 'int'); +$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver +$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); +$search_date_valid_startday = GETPOST('search_date_valid_startday', 'int'); +$search_date_valid_startmonth = GETPOST('search_date_valid_startmonth', 'int'); +$search_date_valid_startyear = GETPOST('search_date_valid_startyear', 'int'); +$search_date_valid_endday = GETPOST('search_date_valid_endday', 'int'); +$search_date_valid_endmonth = GETPOST('search_date_valid_endmonth', 'int'); +$search_date_valid_endyear = GETPOST('search_date_valid_endyear', 'int'); +$search_date_valid_start = dol_mktime(0, 0, 0, $search_date_valid_startmonth, $search_date_valid_startday, $search_date_valid_startyear); +$search_date_valid_end = dol_mktime(23, 59, 59, $search_date_valid_endmonth, $search_date_valid_endday, $search_date_valid_endyear); +$search_datelimit_startday = GETPOST('search_datelimit_startday', 'int'); +$search_datelimit_startmonth = GETPOST('search_datelimit_startmonth', 'int'); +$search_datelimit_startyear = GETPOST('search_datelimit_startyear', 'int'); +$search_datelimit_endday = GETPOST('search_datelimit_endday', 'int'); +$search_datelimit_endmonth = GETPOST('search_datelimit_endmonth', 'int'); +$search_datelimit_endyear = GETPOST('search_datelimit_endyear', 'int'); +$search_datelimit_start = dol_mktime(0, 0, 0, $search_datelimit_startmonth, $search_datelimit_startday, $search_datelimit_startyear); +$search_datelimit_end = dol_mktime(23, 59, 59, $search_datelimit_endmonth, $search_datelimit_endday, $search_datelimit_endyear); $search_categ_cus = trim(GETPOST("search_categ_cus", 'int')); $search_btn = GETPOST('button_search', 'alpha'); $search_remove_btn = GETPOST('button_removefilter', 'alpha'); @@ -273,10 +291,28 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', $search_type = ''; $search_country = ''; $search_type_thirdparty = ''; + $search_date_startday = ''; + $search_date_startmonth = ''; + $search_date_startyear = ''; + $search_date_endday = ''; + $search_date_endmonth = ''; + $search_date_endyear = ''; $search_date_start = ''; $search_date_end = ''; + $search_date_valid_startday = ''; + $search_date_valid_startmonth = ''; + $search_date_valid_startyear = ''; + $search_date_valid_endday = ''; + $search_date_valid_endmonth = ''; + $search_date_valid_endyear = ''; $search_date_valid_start = ''; $search_date_valid_end = ''; + $search_datelimit_startday = ''; + $search_datelimit_startmonth = ''; + $search_datelimit_startyear = ''; + $search_datelimit_endday = ''; + $search_datelimit_endmonth = ''; + $search_datelimit_endyear = ''; $search_datelimit_start = ''; $search_datelimit_end = ''; $option = ''; @@ -623,12 +659,24 @@ if ($resql) if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage); if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit); if ($sall) $param .= '&sall='.urlencode($sall); - if ($search_date_start) $param .= '&search_date_start='.urlencode($search_date_start); - if ($search_date_end) $param .= '&search_date_end='.urlencode($search_date_end); - if ($search_date_valid_start) $param .= '&search_date_valid_start='.urlencode($search_date_valid_start); - if ($search_date_valid_end) $param .= '&search_date_valid_end='.urlencode($search_date_valid_end); - if ($search_datelimit_start) $param .= '&search_datelimit_start='.urlencode($search_datelimit_start); - if ($search_datelimit_end) $param .= '&search_datelimit_end='.urlencode($search_datelimit_end); + if ($search_date_startday) $param .= '&search_date_startday='.urlencode($search_date_startday); + if ($search_date_startmonth) $param .= '&search_date_startmonth='.urlencode($search_date_startmonth); + if ($search_date_startyear) $param .= '&search_date_startyear='.urlencode($search_date_startyear); + if ($search_date_endday) $param .= '&search_date_endday='.urlencode($search_date_endday); + if ($search_date_endmonth) $param .= '&search_date_endmonth='.urlencode($search_date_endmonth); + if ($search_date_endyear) $param .= '&search_date_endyear='.urlencode($search_date_endyear); + if ($search_date_valid_startday) $param .= '&search_date_valid_startday='.urlencode($search_date_valid_startday); + if ($search_date_valid_startmonth) $param .= '&search_date_valid_startmonth='.urlencode($search_date_valid_startmonth); + if ($search_date_valid_startyear) $param .= '&search_date_valid_startyear='.urlencode($search_date_valid_startyear); + if ($search_date_valid_endday) $param .= '&search_date_valid_endday='.urlencode($search_date_valid_endday); + if ($search_date_valid_endmonth) $param .= '&search_date_valid_endmonth='.urlencode($search_date_valid_endmonth); + if ($search_date_valid_endyear) $param .= '&search_date_valid_endyear='.urlencode($search_date_valid_endyear); + if ($search_datelimit_startday) $param .= '&search_datelimit_startday='.urlencode($search_datelimit_startday); + if ($search_datelimit_startmonth) $param .= '&search_datelimit_startmonth='.urlencode($search_datelimit_startmonth); + if ($search_datelimit_startyear) $param .= '&search_datelimit_startyear='.urlencode($search_datelimit_startyear); + if ($search_datelimit_endday) $param .= '&search_datelimit_endday='.urlencode($search_datelimit_endday); + if ($search_datelimit_endmonth) $param .= '&search_datelimit_endmonth='.urlencode($search_datelimit_endmonth); + if ($search_datelimit_endyear) $param .= '&search_datelimit_endyear='.urlencode($search_datelimit_endyear); if ($search_ref) $param .= '&search_ref='.urlencode($search_ref); if ($search_refcustomer) $param .= '&search_refcustomer='.urlencode($search_refcustomer); if ($search_project_ref) $param .= '&search_project_ref='.urlencode($search_project_ref); From 08186fdff155b6b261bba852cc6002e1554df5cf Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Thu, 10 Jun 2021 06:28:09 +0200 Subject: [PATCH 0524/1497] Fix warning - search_societe is already present --- htdocs/compta/facture/list.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 94326852d31..a704280a9f4 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -530,7 +530,6 @@ if ($search_zip) $sql .= natural_search("s.zip", $search_zip); if ($search_state) $sql .= natural_search("state.nom", $search_state); if ($search_country) $sql .= " AND s.fk_pays IN (".$db->escape($search_country).')'; if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$db->escape($search_type_thirdparty).')'; -if ($search_company) $sql .= natural_search('s.nom', $search_company); if ($search_montant_ht != '') $sql .= natural_search('f.total', $search_montant_ht, 1); if ($search_montant_vat != '') $sql .= natural_search('f.tva', $search_montant_vat, 1); if ($search_montant_localtax1 != '') $sql .= natural_search('f.localtax1', $search_montant_localtax1, 1); From c0c773dd1d285fa27278bf2fba60c737e3bd4420 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 10 Jun 2021 11:32:09 +0200 Subject: [PATCH 0525/1497] css --- htdocs/public/demo/index.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index e39a332d3fb..bbb4a85aadf 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -118,7 +118,7 @@ if (empty($reshook)) { 'mailmanspip', 'notification', 'oauth', 'syslog', 'user', 'webservices', 'workflow', // Extended modules 'memcached', 'numberwords', 'zipautofillfr'); - $alwayshiddenuncheckedmodules = array('collab', 'dav', 'debugbar', 'emailcollector', 'ftp', 'hrm', 'modulebuilder', 'printing', 'webservicesclient', 'zappier', + $alwayshiddenuncheckedmodules = array('cashdesk', 'collab', 'dav', 'debugbar', 'emailcollector', 'ftp', 'hrm', 'modulebuilder', 'printing', 'webservicesclient', 'zappier', // Extended modules 'awstats', 'bittorrent', 'bootstrap', 'cabinetmed', 'cmcic', 'concatpdf', 'customfield', 'datapolicy', 'deplacement', 'dolicloud', 'filemanager', 'lightbox', 'mantis', 'monitoring', 'moretemplates', 'multicompany', 'nltechno', 'numberingpack', 'openstreetmap', 'ovh', 'phenix', 'phpsysinfo', 'pibarcode', 'postnuke', 'dynamicprices', 'receiptprinter', 'selectbank', 'skincoloreditor', 'submiteverywhere', 'survey', 'thomsonphonebook', 'topten', 'tvacerfa', 'voyage', 'webcalendar', 'webmail'); @@ -352,13 +352,13 @@ foreach ($demoprofiles as $profilearray) { if (empty($profilearray['url'])) { print ''; // Scan directories @@ -168,7 +168,7 @@ class doc_generic_contract_odt extends ModelePDFContract // Add input to upload a new template file. $texte .= '
    '.$langs->trans("UploadNewTemplate").' '; $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= '
    '; $texte .= ''; diff --git a/htdocs/core/modules/contract/mod_contract_magre.php b/htdocs/core/modules/contract/mod_contract_magre.php index d696ac06fdd..dcaee5eadbc 100644 --- a/htdocs/core/modules/contract/mod_contract_magre.php +++ b/htdocs/core/modules/contract/mod_contract_magre.php @@ -85,7 +85,7 @@ class mod_contract_magre extends ModelNumRefContracts $tooltip .= $langs->trans("GenericMaskCodes5"); $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/delivery/mod_delivery_saphir.php b/htdocs/core/modules/delivery/mod_delivery_saphir.php index af1900803c8..d5ac288b52a 100644 --- a/htdocs/core/modules/delivery/mod_delivery_saphir.php +++ b/htdocs/core/modules/delivery/mod_delivery_saphir.php @@ -83,7 +83,7 @@ class mod_delivery_saphir extends ModeleNumRefDeliveryOrder // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php index 797530a6c13..163392ead88 100644 --- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php +++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php @@ -182,7 +182,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition // Add input to upload a new template file. $texte .= '
    '.$langs->trans("UploadNewTemplate").' '; $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= '
    '; $texte .= ''; diff --git a/htdocs/core/modules/expedition/mod_expedition_ribera.php b/htdocs/core/modules/expedition/mod_expedition_ribera.php index 0303dfde3dc..79bbcbdb481 100644 --- a/htdocs/core/modules/expedition/mod_expedition_ribera.php +++ b/htdocs/core/modules/expedition/mod_expedition_ribera.php @@ -80,7 +80,7 @@ class mod_expedition_ribera extends ModelNumRefExpedition $tooltip .= $langs->trans("GenericMaskCodes5"); $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/expensereport/mod_expensereport_sand.php b/htdocs/core/modules/expensereport/mod_expensereport_sand.php index 195667692f1..482b8c06431 100644 --- a/htdocs/core/modules/expensereport/mod_expensereport_sand.php +++ b/htdocs/core/modules/expensereport/mod_expensereport_sand.php @@ -82,7 +82,7 @@ class mod_expensereport_sand extends ModeleNumRefExpenseReport // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index eb48373a443..ffba0717332 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -158,7 +158,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures $texte .= $conf->global->FACTURE_ADDON_PDF_ODT_PATH; $texte .= ''; $texte .= '
    '; - $texte .= ''; + $texte .= ''; $texte .= '
    '; // Scan directories @@ -181,7 +181,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures // Add input to upload a new template file. $texte .= '
    '.$langs->trans("UploadNewTemplate").' '; $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= '
    '; $texte .= ''; diff --git a/htdocs/core/modules/facture/mod_facture_mercure.php b/htdocs/core/modules/facture/mod_facture_mercure.php index 70fde36f549..32e06f285a9 100644 --- a/htdocs/core/modules/facture/mod_facture_mercure.php +++ b/htdocs/core/modules/facture/mod_facture_mercure.php @@ -76,7 +76,7 @@ class mod_facture_mercure extends ModeleNumRefFactures // Setting the prefix $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceStandard").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; @@ -84,17 +84,17 @@ class mod_facture_mercure extends ModeleNumRefFactures // Prefix setting of replacement invoices $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceReplacement").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= ''; // Prefix setting of credit note $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceAvoir").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= ''; // Prefix setting of deposit $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceDeposit").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/fichinter/mod_arctic.php b/htdocs/core/modules/fichinter/mod_arctic.php index fa5dd49f0fa..91025817a9d 100644 --- a/htdocs/core/modules/fichinter/mod_arctic.php +++ b/htdocs/core/modules/fichinter/mod_arctic.php @@ -84,7 +84,7 @@ class mod_arctic extends ModeleNumRefFicheinter // Setting the prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; diff --git a/htdocs/core/modules/holiday/mod_holiday_immaculate.php b/htdocs/core/modules/holiday/mod_holiday_immaculate.php index b8cb33f550e..000c7881561 100644 --- a/htdocs/core/modules/holiday/mod_holiday_immaculate.php +++ b/htdocs/core/modules/holiday/mod_holiday_immaculate.php @@ -85,7 +85,7 @@ class mod_holiday_immaculate extends ModelNumRefHolidays $tooltip .= $langs->trans("GenericMaskCodes5"); $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php index 5ff5a1f767a..9a14e96bc28 100644 --- a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php +++ b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php @@ -154,7 +154,7 @@ class doc_generic_member_odt extends ModelePDFMember $texte .= $conf->global->MEMBER_ADDON_PDF_ODT_PATH; $texte .= ''; $texte .= '
    '; - $texte .= ''; + $texte .= ''; $texte .= '
    '; // Scan directories @@ -171,7 +171,7 @@ class doc_generic_member_odt extends ModelePDFMember // Add input to upload a new template file. $texte .= '
    '.$langs->trans("UploadNewTemplate").' '; $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= '
    '; $texte .= ''; diff --git a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php index 374ae5b4337..860e07d7d36 100644 --- a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php +++ b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php @@ -158,7 +158,7 @@ class doc_generic_mo_odt extends ModelePDFMo $texte .= $conf->global->MRP_MO_ADDON_PDF_ODT_PATH; $texte .= ''; $texte .= '
    '; - $texte .= ''; + $texte .= ''; $texte .= '
    '; // Scan directories diff --git a/htdocs/core/modules/mrp/mod_mo_advanced.php b/htdocs/core/modules/mrp/mod_mo_advanced.php index 3d70ded1ba2..14292f7f896 100644 --- a/htdocs/core/modules/mrp/mod_mo_advanced.php +++ b/htdocs/core/modules/mrp/mod_mo_advanced.php @@ -80,7 +80,7 @@ class mod_mo_advanced extends ModeleNumRefMos // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; diff --git a/htdocs/core/modules/payment/mod_payment_ant.php b/htdocs/core/modules/payment/mod_payment_ant.php index 10926805721..dca32b26505 100644 --- a/htdocs/core/modules/payment/mod_payment_ant.php +++ b/htdocs/core/modules/payment/mod_payment_ant.php @@ -82,7 +82,7 @@ class mod_payment_ant extends ModeleNumRefPayments // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; diff --git a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php index 19a752d5be7..d038acd7ee5 100644 --- a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php +++ b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php @@ -161,7 +161,7 @@ class doc_generic_product_odt extends ModelePDFProduct $texte .= $conf->global->PRODUCT_ADDON_PDF_ODT_PATH; $texte .= ''; $texte .= '
    '; - $texte .= ''; + $texte .= ''; $texte .= '
    '; // Scan directories diff --git a/htdocs/core/modules/product/mod_codeproduct_elephant.php b/htdocs/core/modules/product/mod_codeproduct_elephant.php index 0a302c0fb6b..5936476e079 100644 --- a/htdocs/core/modules/product/mod_codeproduct_elephant.php +++ b/htdocs/core/modules/product/mod_codeproduct_elephant.php @@ -116,7 +116,7 @@ class mod_codeproduct_elephant extends ModeleProductCode // Parametrage du prefix customers $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("ProductCodeModel").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; @@ -124,7 +124,7 @@ class mod_codeproduct_elephant extends ModeleProductCode // Parametrage du prefix suppliers $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("ServiceCodeModel").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/product_batch/mod_lot_advanced.php b/htdocs/core/modules/product_batch/mod_lot_advanced.php index c580d8915c9..0bbb124d14b 100644 --- a/htdocs/core/modules/product_batch/mod_lot_advanced.php +++ b/htdocs/core/modules/product_batch/mod_lot_advanced.php @@ -80,7 +80,7 @@ class mod_lot_advanced extends ModeleNumRefBatch // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; diff --git a/htdocs/core/modules/product_batch/mod_sn_advanced.php b/htdocs/core/modules/product_batch/mod_sn_advanced.php index 74f36a55fe6..8117b9e6c6e 100644 --- a/htdocs/core/modules/product_batch/mod_sn_advanced.php +++ b/htdocs/core/modules/product_batch/mod_sn_advanced.php @@ -80,7 +80,7 @@ class mod_sn_advanced extends ModeleNumRefBatch // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index da95e841728..c085f1eeaac 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -449,7 +449,7 @@ class doc_generic_project_odt extends ModelePDFProjects $texte .= $conf->global->PROJECT_ADDON_PDF_ODT_PATH; $texte .= ''; $texte .= '
    '; - $texte .= ''; + $texte .= ''; $texte .= '
    '; // Scan directories diff --git a/htdocs/core/modules/project/mod_project_universal.php b/htdocs/core/modules/project/mod_project_universal.php index 3ab4079c1b7..480d19396c3 100644 --- a/htdocs/core/modules/project/mod_project_universal.php +++ b/htdocs/core/modules/project/mod_project_universal.php @@ -83,7 +83,7 @@ class mod_project_universal extends ModeleNumRefProjects // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index 0662e1a5a76..a04e2e9c14a 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -416,7 +416,7 @@ class doc_generic_task_odt extends ModelePDFTask $texte .= $conf->global->PROJECT_TASK_ADDON_PDF_ODT_PATH; $texte .= ''; $texte .= '
    '; - $texte .= ''; + $texte .= ''; $texte .= '
    '; // Scan directories diff --git a/htdocs/core/modules/project/task/mod_task_universal.php b/htdocs/core/modules/project/task/mod_task_universal.php index 011ac381254..3a6ef89f3fb 100644 --- a/htdocs/core/modules/project/task/mod_task_universal.php +++ b/htdocs/core/modules/project/task/mod_task_universal.php @@ -83,7 +83,7 @@ class mod_task_universal extends ModeleNumRefTask // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index 4a292d4a97b..e7eade5de02 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -160,7 +160,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales $texte .= $conf->global->PROPALE_ADDON_PDF_ODT_PATH; $texte .= ''; $texte .= '
    '; - $texte .= ''; + $texte .= ''; $texte .= '
    '; // Scan directories @@ -209,7 +209,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales // Add input to upload a new template file. $texte .= '
    '.$langs->trans("UploadNewTemplate").' '; $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= '
    '; $texte .= ''; diff --git a/htdocs/core/modules/propale/mod_propale_saphir.php b/htdocs/core/modules/propale/mod_propale_saphir.php index 5fb7eeaa6fb..ce78f341319 100644 --- a/htdocs/core/modules/propale/mod_propale_saphir.php +++ b/htdocs/core/modules/propale/mod_propale_saphir.php @@ -85,7 +85,7 @@ class mod_propale_saphir extends ModeleNumRefPropales // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; diff --git a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php index 13a05b3378d..d70ecca00ad 100644 --- a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php +++ b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php @@ -153,7 +153,7 @@ class doc_generic_reception_odt extends ModelePdfReception $texte .= $conf->global->RECEPTION_ADDON_PDF_ODT_PATH; $texte .= ''; $texte .= '
    '; - $texte .= ''; + $texte .= ''; $texte .= '
    '; // Scan directories diff --git a/htdocs/core/modules/reception/mod_reception_moonstone.php b/htdocs/core/modules/reception/mod_reception_moonstone.php index bcab451ab9e..0d0ced20eb4 100644 --- a/htdocs/core/modules/reception/mod_reception_moonstone.php +++ b/htdocs/core/modules/reception/mod_reception_moonstone.php @@ -61,7 +61,7 @@ class mod_reception_moonstone extends ModelNumRefReception $tooltip .= $langs->trans("GenericMaskCodes5"); $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php index 1822a5b8c95..9045ed0b281 100644 --- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php +++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php @@ -141,7 +141,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc $texte .= ''; $texte .= ''; $texte .= '  '; - $texte .= ''; + $texte .= ''; $texte .= ''; $texte .= ''; $texte .= ''; @@ -167,7 +167,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc // Add input to upload a new template file. $texte .= '
    '.$langs->trans("UploadNewTemplate").' '; $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= '
    '; $texte .= ''; diff --git a/htdocs/core/modules/societe/mod_codeclient_elephant.php b/htdocs/core/modules/societe/mod_codeclient_elephant.php index 9ddf77abe44..705564e7e8e 100644 --- a/htdocs/core/modules/societe/mod_codeclient_elephant.php +++ b/htdocs/core/modules/societe/mod_codeclient_elephant.php @@ -132,7 +132,7 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode // Parametrage du prefix customers $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("CustomerCodeModel").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; @@ -140,7 +140,7 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode // Parametrage du prefix suppliers $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("SupplierCodeModel").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php index 2819adea021..e2d474d2dd2 100644 --- a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php +++ b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php @@ -155,7 +155,7 @@ class doc_generic_stock_odt extends ModelePDFStock $texte .= $conf->global->STOCK_ADDON_PDF_ODT_PATH; $texte .= ''; $texte .= '
    '; - $texte .= ''; + $texte .= ''; $texte .= '
    '; // Scan directories @@ -179,7 +179,7 @@ class doc_generic_stock_odt extends ModelePDFStock // Add input to upload a new template file. $texte .= '
    '.$langs->trans("UploadNewTemplate").' '; $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= '
    '; $texte .= ''; diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php index 3cf0a4a209e..57d5798c29e 100644 --- a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php +++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php @@ -93,7 +93,7 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices // Setting the prefix $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceStandard").')'; $texte .= ':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; @@ -101,19 +101,19 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices // Prefix setting of credit note $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceAvoir").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= ''; if ($conf->global->MAIN_FEATURE_LEVEL >= 2) { // Parametrage du prefix des replacement $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceReplacement").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= ''; } // Prefix setting of deposit $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceDeposit").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php index 9e9799f44c6..b7fd399edef 100644 --- a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php +++ b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php @@ -159,7 +159,7 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders $texte .= $conf->global->SUPPLIER_ORDER_ADDON_PDF_ODT_PATH; $texte .= ''; $texte .= '
    '; - $texte .= ''; + $texte .= ''; $texte .= '
    '; // Scan directories diff --git a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php index a609eeade08..c691b1448ef 100644 --- a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php +++ b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php @@ -85,7 +85,7 @@ class mod_commande_fournisseur_orchidee extends ModeleNumRefSuppliersOrders // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; diff --git a/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php b/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php index 8f3b7ad36df..19e632a6264 100644 --- a/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php +++ b/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php @@ -82,7 +82,7 @@ class mod_supplier_payment_brodator extends ModeleNumRefSupplierPayments // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; diff --git a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php index 4b761f8099b..7e300c68643 100644 --- a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php @@ -162,7 +162,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal $texte .= $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_PATH; $texte .= ''; $texte .= '
    '; - $texte .= ''; + $texte .= ''; $texte .= '
    '; // Scan directories diff --git a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php index adf53aed4e6..3b8754d9928 100644 --- a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php +++ b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php @@ -85,7 +85,7 @@ class mod_supplier_proposal_saphir extends ModeleNumRefSupplierProposal // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; diff --git a/htdocs/core/modules/takepos/mod_takepos_ref_universal.php b/htdocs/core/modules/takepos/mod_takepos_ref_universal.php index e6487db6ed1..d103dbe3b0b 100644 --- a/htdocs/core/modules/takepos/mod_takepos_ref_universal.php +++ b/htdocs/core/modules/takepos/mod_takepos_ref_universal.php @@ -79,7 +79,7 @@ class mod_takepos_ref_universal extends ModeleNumRefTakepos // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; diff --git a/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php b/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php index eb90baef7e5..d1d3763fb2e 100644 --- a/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php +++ b/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php @@ -150,7 +150,7 @@ class doc_generic_ticket_odt extends ModelePDFTicket $texte .= $conf->global->TICKET_ADDON_PDF_ODT_PATH; $texte .= ''; $texte .= '
    '; - $texte .= ''; + $texte .= ''; $texte .= '
    '; // Scan directories @@ -167,7 +167,7 @@ class doc_generic_ticket_odt extends ModelePDFTicket // Add input to upload a new template file. $texte .= '
    '.$langs->trans("UploadNewTemplate").' '; $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= '
    '; $texte .= ''; diff --git a/htdocs/core/modules/ticket/mod_ticket_universal.php b/htdocs/core/modules/ticket/mod_ticket_universal.php index 1a528359221..f60b1f16481 100644 --- a/htdocs/core/modules/ticket/mod_ticket_universal.php +++ b/htdocs/core/modules/ticket/mod_ticket_universal.php @@ -81,7 +81,7 @@ class mod_ticket_universal extends ModeleNumRefTicket // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; diff --git a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php index fb24e2782c9..035a99fe744 100644 --- a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php +++ b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php @@ -159,7 +159,7 @@ class doc_generic_user_odt extends ModelePDFUser $texte .= $conf->global->USER_ADDON_PDF_ODT_PATH; $texte .= ''; $texte .= '
    '; - $texte .= ''; + $texte .= ''; $texte .= '
    '; // Scan directories @@ -199,7 +199,7 @@ class doc_generic_user_odt extends ModelePDFUser // Add input to upload a new template file. $texte .= '
    '.$langs->trans("UploadNewTemplate").' '; $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= '
    '; $texte .= ''; diff --git a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php index 45a9469753e..04d9957458b 100644 --- a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php +++ b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php @@ -162,7 +162,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup $texte .= $conf->global->USERGROUP_ADDON_PDF_ODT_PATH; $texte .= ''; $texte .= '
    '; - $texte .= ''; + $texte .= ''; $texte .= '
    '; // Scan directories diff --git a/htdocs/core/modules/workstation/mod_workstation_advanced.php b/htdocs/core/modules/workstation/mod_workstation_advanced.php index 4e23219581c..bf783542c75 100755 --- a/htdocs/core/modules/workstation/mod_workstation_advanced.php +++ b/htdocs/core/modules/workstation/mod_workstation_advanced.php @@ -80,7 +80,7 @@ class mod_workstation_advanced extends ModeleNumRefWorkstation // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; diff --git a/htdocs/ftp/admin/ftpclient.php b/htdocs/ftp/admin/ftpclient.php index 12ee32a496f..cd24a3a881a 100644 --- a/htdocs/ftp/admin/ftpclient.php +++ b/htdocs/ftp/admin/ftpclient.php @@ -190,13 +190,13 @@ if (!function_exists('ftp_connect')) { print ''; print ''.$langs->trans("User").''; - print ''; + print ''; print 'myftplogin'; print ''; print ''; print ''.$langs->trans("Password").''; - print ''; + print ''; print 'myftppassword'; print ''; diff --git a/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_advanced.php b/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_advanced.php index 14c3b334ee1..48efbfbc8eb 100644 --- a/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_advanced.php +++ b/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_advanced.php @@ -79,7 +79,7 @@ class mod_knowledgerecord_advanced extends ModeleNumRefKnowledgeRecord // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php index 3e389c1757f..d64c80c9355 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php @@ -157,7 +157,7 @@ class doc_generic_myobject_odt extends ModelePDFMyObject $texte .= $conf->global->MYMODULE_MYOBJECT_ADDON_PDF_ODT_PATH; $texte .= ''; $texte .= '
    '; - $texte .= ''; + $texte .= ''; $texte .= '
    '; // Scan directories diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php index 9c685e65d9a..72b46b96416 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php @@ -79,7 +79,7 @@ class mod_myobject_advanced extends ModeleNumRefMyObject // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php index 1c7a98739d7..ff5198c006a 100644 --- a/htdocs/opensurvey/results.php +++ b/htdocs/opensurvey/results.php @@ -1007,7 +1007,7 @@ if (empty($testligneamodifier)) { print ''."\n"; print ''."\n"; print ''."\n"; - print ''."\n"; + print ''."\n"; print ''."\n"; for ($i = 0; $i < $nbcolonnes; $i++) { diff --git a/htdocs/partnership/core/modules/partnership/mod_partnership_advanced.php b/htdocs/partnership/core/modules/partnership/mod_partnership_advanced.php index 0b293d19a35..a536bb59600 100644 --- a/htdocs/partnership/core/modules/partnership/mod_partnership_advanced.php +++ b/htdocs/partnership/core/modules/partnership/mod_partnership_advanced.php @@ -79,7 +79,7 @@ class mod_partnership_advanced extends ModeleNumRefPartnership // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; diff --git a/htdocs/product/admin/dynamic_prices.php b/htdocs/product/admin/dynamic_prices.php index fdd42bd34d7..d90ea7090f7 100644 --- a/htdocs/product/admin/dynamic_prices.php +++ b/htdocs/product/admin/dynamic_prices.php @@ -213,17 +213,17 @@ if ($action == 'create_variable' || $action == 'edit_variable') { //Code print ''; print ''.$langs->trans("Variable").''; - print ''; + print ''; print ''; //Description print ''; print ''.$langs->trans("Description").''; - print ''; + print ''; print ''; //Value print ''; print ''.$langs->trans("Value").''; - print ''; + print ''; print ''; print ''; @@ -310,7 +310,7 @@ if ($action == 'create_updater' || $action == 'edit_updater') { //Description print ''; print ''.$langs->trans("Description").''; - print ''; + print ''; print ''; //Type print ''; diff --git a/htdocs/product/card.php b/htdocs/product/card.php index c3c91b40537..170853b9c2b 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1117,7 +1117,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $inherited_mask_lot = $conf->global->LOT_ADVANCED_MASK; $inherited_mask_sn = $conf->global->SN_ADVANCED_MASK; print ''; - print $form->textwithpicto('', $tooltip, 1, 1); + print $form->textwithpicto('', $tooltip, 1, 1); print ''."\n"; } if (!GETPOSTISSET("no_email") && !empty($object->email)) { - $result=$object->getNoEmail(); - if ($result<0) { + $result = $object->getNoEmail(); + if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } } print ''; print ''; - print ''.$form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOST("no_email", 'int') : $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS), 1, false, ($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS==-1)).''; + print ''.$form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOST("no_email", 'int') : $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS), 1, false, ($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == -1)).''; print ''; } @@ -1078,8 +1078,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''."\n"; } if (!GETPOSTISSET("no_email") && !empty($object->email)) { - $result=$object->getNoEmail(); - if ($result<0) { + $result = $object->getNoEmail(); + if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -1313,8 +1313,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Unsubscribe opt-out if (!empty($conf->mailing->enabled)) { - $result=$object->getNoEmail(); - if ($result<0) { + $result = $object->getNoEmail(); + if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } print ''.$langs->trans("No_Email").''.yn($object->no_email).''; diff --git a/htdocs/core/boxes/box_graph_new_vs_close_ticket.php b/htdocs/core/boxes/box_graph_new_vs_close_ticket.php index 5b17c335f3f..f2e2170a1b8 100644 --- a/htdocs/core/boxes/box_graph_new_vs_close_ticket.php +++ b/htdocs/core/boxes/box_graph_new_vs_close_ticket.php @@ -89,7 +89,7 @@ class box_graph_new_vs_close_ticket extends ModeleBoxes $data = array(); $totalnb = 0; $sql = "SELECT COUNT(t.datec) as nb"; - $sql .= " FROM " . MAIN_DB_PREFIX . "ticket as t"; + $sql .= " FROM ".MAIN_DB_PREFIX."ticket as t"; $sql .= " WHERE CAST(t.datec AS DATE) = CURRENT_DATE"; $sql .= " AND t.fk_statut <> 8"; $sql .= " GROUP BY CAST(t.datec AS DATE)"; @@ -107,7 +107,7 @@ class box_graph_new_vs_close_ticket extends ModeleBoxes dol_print_error($this->db); } $sql = "SELECT COUNT(t.date_close) as nb"; - $sql .= " FROM " . MAIN_DB_PREFIX . "ticket as t"; + $sql .= " FROM ".MAIN_DB_PREFIX."ticket as t"; $sql .= " WHERE CAST(t.date_close AS DATE) = CURRENT_DATE"; $sql .= " AND t.fk_statut = 8"; $sql .= " GROUP BY CAST(t.date_close AS DATE)"; @@ -148,7 +148,7 @@ class box_graph_new_vs_close_ticket extends ModeleBoxes $stringtoprint .= $px1->show($totalnb ? 0 : 1); } $stringtoprint .= ''; - $this->info_box_contents[][]=array( + $this->info_box_contents[][] = array( 'td' => 'class="center"', 'text' => $stringtoprint ); diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index c328d659b93..3838829f8cd 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -508,16 +508,16 @@ function getNumberInvoicesPieChart($mode) while ($i < $num) { $obj = $db->fetch_object($resql); - $dataseries = array(array($langs->trans('InvoiceLate30Days'),$obj->nblate30) - ,array($langs->trans('InvoiceLate15Days'),$obj->nblate15-$obj->nblate30) - ,array($langs->trans('InvoiceLateMinus15Days'),$obj->nblatenow-$obj->nblate15) - ,array($langs->trans('InvoiceNotLate'),$obj->nbnotlatenow-$obj->nbnotlate15) - ,array($langs->trans('InvoiceNotLate15Days'),$obj->nbnotlate15-$obj->nbnotlate30) - ,array($langs->trans('InvoiceNotLate30Days'),$obj->nbnotlate30)); + $dataseries = array(array($langs->trans('InvoiceLate30Days'), $obj->nblate30) + ,array($langs->trans('InvoiceLate15Days'), $obj->nblate15 - $obj->nblate30) + ,array($langs->trans('InvoiceLateMinus15Days'), $obj->nblatenow - $obj->nblate15) + ,array($langs->trans('InvoiceNotLate'), $obj->nbnotlatenow - $obj->nbnotlate15) + ,array($langs->trans('InvoiceNotLate15Days'), $obj->nbnotlate15 - $obj->nbnotlate30) + ,array($langs->trans('InvoiceNotLate30Days'), $obj->nbnotlate30)); $i++; } foreach ($dataseries as $key=>$value) { - $total+=$value[1]; + $total += $value[1]; } $colorseries = array($badgeStatus8, $badgeStatus1, $badgeStatus3, $badgeStatus4, $badgeStatus11, '-'.$badgeStatus11); @@ -615,7 +615,7 @@ function getCustomerInvoiceDraftTable($maxCount = 500, $socid = 0) $sql .= " s.nom, s.rowid, s.email, s.code_client, s.code_compta, s.code_fournisseur, s.code_compta_fournisseur,"; $sql .= " cc.rowid, cc.code"; if (!$user->rights->societe->client->voir && !$socid) { - $sql.= ", sc.fk_soc, sc.fk_user"; + $sql .= ", sc.fk_soc, sc.fk_user"; } // Add Group from hooks diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index f5840712807..0c825672f65 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -714,7 +714,7 @@ class FactureFournisseur extends CommonInvoice $this->remise = $obj->remise; $this->close_code = $obj->close_code; $this->close_note = $obj->close_note; - $this->tva = $obj->tva; + $this->tva = $obj->tva; $this->total_localtax1 = $obj->localtax1; $this->total_localtax2 = $obj->localtax2; $this->total_ht = $obj->total_ht; @@ -729,7 +729,7 @@ class FactureFournisseur extends CommonInvoice $this->fk_project = $obj->fk_project; $this->cond_reglement_id = $obj->fk_cond_reglement; $this->cond_reglement_code = $obj->cond_reglement_code; - $this->cond_reglement = $obj->cond_reglement_label; // deprecated + $this->cond_reglement = $obj->cond_reglement_label; // deprecated $this->cond_reglement_label = $obj->cond_reglement_label; $this->cond_reglement_doc = $obj->cond_reglement_doc; $this->fk_account = $obj->fk_account; @@ -3234,8 +3234,8 @@ class SupplierInvoiceLine extends CommonObjectLine $this->ref_supplier = $obj->ref_supplier; $this->product_desc = $obj->product_desc; - $this->subprice = $obj->pu_ht; - $this->pu_ht = $obj->pu_ht; + $this->subprice = $obj->pu_ht; + $this->pu_ht = $obj->pu_ht; $this->pu_ttc = $obj->pu_ttc; $this->tva_tx = $obj->tva_tx; $this->localtax1_tx = $obj->localtax1_tx; @@ -3245,7 +3245,7 @@ class SupplierInvoiceLine extends CommonObjectLine $this->qty = $obj->qty; $this->remise_percent = $obj->remise_percent; - $this->fk_remise_except = $obj->fk_remise_except; + $this->fk_remise_except = $obj->fk_remise_except; $this->tva = $obj->total_tva; // deprecated $this->total_ht = $obj->total_ht; $this->total_tva = $obj->total_tva; @@ -3401,8 +3401,8 @@ class SupplierInvoiceLine extends CommonObjectLine $sql .= ", pu_ttc = ".price2num($this->pu_ttc); $sql .= ", qty = ".price2num($this->qty); $sql .= ", remise_percent = ".price2num($this->remise_percent); - if ($this->fk_remise_except) $sql.= ", fk_remise_except=".((int) $this->fk_remise_except); - else $sql.= ", fk_remise_except=null"; + if ($this->fk_remise_except) $sql .= ", fk_remise_except=".((int) $this->fk_remise_except); + else $sql .= ", fk_remise_except=null"; $sql .= ", vat_src_code = '".$this->db->escape(empty($this->vat_src_code) ? '' : $this->vat_src_code)."'"; $sql .= ", tva_tx = ".price2num($this->tva_tx); $sql .= ", localtax1_tx = ".price2num($this->localtax1_tx); @@ -3633,7 +3633,7 @@ class SupplierInvoiceLine extends CommonObjectLine if ($discount->fk_facture_line > 0) { if (empty($noerrorifdiscountalreadylinked)) { $this->error = $langs->trans("ErrorDiscountAlreadyUsed", $discount->id); - dol_syslog(get_class($this) . "::insert Error " . $this->error, LOG_ERR); + dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR); $this->db->rollback(); return -3; } @@ -3641,20 +3641,20 @@ class SupplierInvoiceLine extends CommonObjectLine $result = $discount->link_to_invoice($this->rowid, 0); if ($result < 0) { $this->error = $discount->error; - dol_syslog(get_class($this) . "::insert Error " . $this->error, LOG_ERR); + dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR); $this->db->rollback(); return -3; } } } else { $this->error = $langs->trans("ErrorADiscountThatHasBeenRemovedIsIncluded"); - dol_syslog(get_class($this) . "::insert Error " . $this->error, LOG_ERR); + dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR); $this->db->rollback(); return -3; } } else { $this->error = $discount->error; - dol_syslog(get_class($this) . "::insert Error " . $this->error, LOG_ERR); + dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR); $this->db->rollback(); return -3; } diff --git a/htdocs/partnership/admin/setup.php b/htdocs/partnership/admin/setup.php index 4005be154a1..25567b137db 100644 --- a/htdocs/partnership/admin/setup.php +++ b/htdocs/partnership/admin/setup.php @@ -134,8 +134,8 @@ print ''; if (!empty($conf->global->PARTNERSHIP_IS_MANAGED_FOR) && $conf->global->PARTNERSHIP_IS_MANAGED_FOR == 'member') { print ''.$langs->trans("PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL").''; print ''; - $dnbdays = '15'; - $backlinks = (!empty($conf->global->PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL)) ? $conf->global->PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL : $dnbdays; + $dnbdays = '15'; + $backlinks = (!empty($conf->global->PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL)) ? $conf->global->PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL : $dnbdays; print ''; print ''; print ''.$dnbdays.''; @@ -164,7 +164,7 @@ print ''; print ''.$langs->trans("PARTNERSHIP_BACKLINKS_TO_CHECK").''; print ''; -$backlinks = (empty($conf->global->PARTNERSHIP_BACKLINKS_TO_CHECK) ? '' : $conf->global->PARTNERSHIP_BACKLINKS_TO_CHECK); +$backlinks = (empty($conf->global->PARTNERSHIP_BACKLINKS_TO_CHECK) ? '' : $conf->global->PARTNERSHIP_BACKLINKS_TO_CHECK); print ''; print ''; print 'dolibarr.org|dolibarr.fr|dolibarr.es'; diff --git a/htdocs/partnership/class/partnershiputils.class.php b/htdocs/partnership/class/partnershiputils.class.php index 7cf01c2957c..0588b9e5df2 100644 --- a/htdocs/partnership/class/partnershiputils.class.php +++ b/htdocs/partnership/class/partnershiputils.class.php @@ -37,9 +37,9 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; */ class PartnershipUtils { - public $db; //!< To store db handler - public $error; //!< To return error code (or message) - public $errors=array(); //!< To return several error codes (or messages) + public $db; //!< To store db handler + public $error; //!< To return error code (or message) + public $errors = array(); //!< To return several error codes (or messages) /** @@ -71,19 +71,19 @@ class PartnershipUtils } $partnership = new Partnership($this->db); - $MAXPERCALL = (empty($conf->global->PARTNERSHIP_MAX_EXPIRATION_CANCEL_PER_CALL) ? 25 : $conf->global->PARTNERSHIP_MAX_EXPIRATION_CANCEL_PER_CALL); // Limit to 25 per call + $MAXPERCALL = (empty($conf->global->PARTNERSHIP_MAX_EXPIRATION_CANCEL_PER_CALL) ? 25 : $conf->global->PARTNERSHIP_MAX_EXPIRATION_CANCEL_PER_CALL); // Limit to 25 per call $langs->loadLangs(array("partnership", "member")); - $error = 0; - $erroremail = ''; - $this->output = ''; - $this->error = ''; + $error = 0; + $erroremail = ''; + $this->output = ''; + $this->error = ''; $partnershipsprocessed = array(); - $gracedelay=$conf->global->PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL; + $gracedelay = $conf->global->PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL; if ($gracedelay < 1) { - $this->error='BadValueForDelayBeforeCancelCheckSetup'; + $this->error = 'BadValueForDelayBeforeCancelCheckSetup'; return -1; } @@ -116,7 +116,7 @@ class PartnershipUtils $obj = $this->db->fetch_object($resql); if ($obj) { - if (! empty($partnershipsprocessed[$obj->rowid])) continue; + if (!empty($partnershipsprocessed[$obj->rowid])) continue; if ($somethingdoneonpartnership >= $MAXPERCALL) { dol_syslog("We reach the limit of ".$MAXPERCALL." partnership processed, so we quit loop for this batch doCancelStatusOfMemberPartnership to avoid to reach email quota.", LOG_WARNING); @@ -142,7 +142,7 @@ class PartnershipUtils else $this->errors = $object->errors; } } else { - $partnershipsprocessed[$object->id]=$object->ref; + $partnershipsprocessed[$object->id] = $object->ref; // Send an email to inform member $labeltemplate = '(SendingEmailOnPartnershipCanceled)'; @@ -152,21 +152,21 @@ class PartnershipUtils // Send deployment email include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $formmail=new FormMail($this->db); + $formmail = new FormMail($this->db); // Define output language $outputlangs = $langs; $newlang = ''; if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09'); - if (! empty($newlang)) { + if (!empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); - $outputlangs->loadLangs(array('main','member','partnership')); + $outputlangs->loadLangs(array('main', 'member', 'partnership')); } - $arraydefaultmessage=$formmail->getEMailTemplate($this->db, 'partnership_send', $user, $outputlangs, 0, 1, $labeltemplate); + $arraydefaultmessage = $formmail->getEMailTemplate($this->db, 'partnership_send', $user, $outputlangs, 0, 1, $labeltemplate); - $substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object); + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object); complete_substitutions_array($substitutionarray, $outputlangs, $object); $subject = make_substitutions($arraydefaultmessage->topic, $substitutionarray, $outputlangs); @@ -179,7 +179,7 @@ class PartnershipUtils $cmail = new CMailFile($subject, $to, $from, $msg, array(), array(), array(), '', '', 0, 1); $result = $cmail->sendfile(); - if (! $result || $cmail->error) { + if (!$result || $cmail->error) { $erroremail .= ($erroremail ? ', ' : '').$cmail->error; $this->errors[] = $cmail->error; if (is_array($cmail->errors) && count($cmail->errors) > 0) $this->errors += $cmail->errors; @@ -193,18 +193,18 @@ class PartnershipUtils $this->error = $this->db->lasterror(); } - if (! $error) { + if (!$error) { $this->db->commit(); $this->output = $numofexpiredmembers.' expired partnership members found'."\n"; - if ($erroremail) $this->output.='. Got errors when sending some email : '.$erroremail; + if ($erroremail) $this->output .= '. Got errors when sending some email : '.$erroremail; } else { $this->db->rollback(); $this->output = "Rollback after error\n"; - $this->output.= $numofexpiredmembers.' expired partnership members found'."\n"; - if ($erroremail) $this->output.='. Got errors when sending some email : '.$erroremail; + $this->output .= $numofexpiredmembers.' expired partnership members found'."\n"; + if ($erroremail) $this->output .= '. Got errors when sending some email : '.$erroremail; } - return ($error ? 1: 0); + return ($error ? 1 : 0); } @@ -222,19 +222,19 @@ class PartnershipUtils $managedfor = $conf->global->PARTNERSHIP_IS_MANAGED_FOR; $partnership = new Partnership($this->db); - $MAXPERCALL = (empty($conf->global->PARTNERSHIP_MAX_WARNING_BACKLINK_PER_CALL) ? 10 : $conf->global->PARTNERSHIP_MAX_WARNING_BACKLINK_PER_CALL); // Limit to 10 per call + $MAXPERCALL = (empty($conf->global->PARTNERSHIP_MAX_WARNING_BACKLINK_PER_CALL) ? 10 : $conf->global->PARTNERSHIP_MAX_WARNING_BACKLINK_PER_CALL); // Limit to 10 per call $langs->loadLangs(array("partnership", "member")); - $error = 0; - $erroremail = ''; - $this->output = ''; - $this->error = ''; + $error = 0; + $erroremail = ''; + $this->output = ''; + $this->error = ''; $partnershipsprocessed = array(); - $gracedelay=$conf->global->PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL; + $gracedelay = $conf->global->PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL; if ($gracedelay < 1) { - $this->error='BadValueForDelayBeforeCancelCheckSetup'; + $this->error = 'BadValueForDelayBeforeCancelCheckSetup'; return -1; } @@ -269,16 +269,16 @@ class PartnershipUtils $resql = $this->db->query($sql); if ($resql) { - $numofexpiredmembers = $this->db->num_rows($resql); + $numofexpiredmembers = $this->db->num_rows($resql); $somethingdoneonpartnership = 0; - $ifetchpartner = 0; + $ifetchpartner = 0; $websitenotfound = ''; while ($ifetchpartner < $numofexpiredmembers) { $ifetchpartner++; $obj = $this->db->fetch_object($resql); if ($obj) { - if (! empty($partnershipsprocessed[$obj->rowid])) continue; + if (!empty($partnershipsprocessed[$obj->rowid])) continue; if ($somethingdoneonpartnership >= $MAXPERCALL) { dol_syslog("We reach the limit of ".$MAXPERCALL." partnership processed, so we quit loop for this batch doWarningOfPartnershipIfDolibarrBacklinkNotfound to avoid to reach email quota.", LOG_WARNING); @@ -318,21 +318,21 @@ class PartnershipUtils // Send deployment email include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $formmail=new FormMail($this->db); + $formmail = new FormMail($this->db); // Define output language $outputlangs = $langs; $newlang = ''; if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09'); - if (! empty($newlang)) { + if (!empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); - $outputlangs->loadLangs(array('main','member','partnership')); + $outputlangs->loadLangs(array('main', 'member', 'partnership')); } - $arraydefaultmessage=$formmail->getEMailTemplate($this->db, 'partnership_send', $user, $outputlangs, 0, 1, $labeltemplate); + $arraydefaultmessage = $formmail->getEMailTemplate($this->db, 'partnership_send', $user, $outputlangs, 0, 1, $labeltemplate); - $substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object); + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object); complete_substitutions_array($substitutionarray, $outputlangs, $object); $subject = make_substitutions($arraydefaultmessage->topic, $substitutionarray, $outputlangs); @@ -343,7 +343,7 @@ class PartnershipUtils $cmail = new CMailFile($subject, $to, $from, $msg, array(), array(), array(), '', '', 0, 1); $result = $cmail->sendfile(); - if (! $result || $cmail->error) { + if (!$result || $cmail->error) { $erroremail .= ($erroremail ? ', ' : '').$cmail->error; $this->errors[] = $cmail->error; if (is_array($cmail->errors) && count($cmail->errors) > 0) $this->errors += $cmail->errors; @@ -360,7 +360,7 @@ class PartnershipUtils $object->reason_decline_or_cancel = ''; } - $partnershipsprocessed[$object->id]=$object->ref; + $partnershipsprocessed[$object->id] = $object->ref; $object->last_check_backlink = $this->db->idate($now); @@ -372,22 +372,22 @@ class PartnershipUtils $this->error = $this->db->lasterror(); } - if (! $error) { + if (!$error) { $this->db->commit(); $this->output = $numofexpiredmembers.' partnership checked'."\n"; - if ($erroremail) $this->output.='. Got errors when sending some email : '.$erroremail."\n"; - if ($emailnotfound) $this->output.='. Email not found for some partner : '.$emailnotfound."\n"; - if ($websitenotfound) $this->output.='. Website not found for some partner : '.$websitenotfound."\n"; + if ($erroremail) $this->output .= '. Got errors when sending some email : '.$erroremail."\n"; + if ($emailnotfound) $this->output .= '. Email not found for some partner : '.$emailnotfound."\n"; + if ($websitenotfound) $this->output .= '. Website not found for some partner : '.$websitenotfound."\n"; } else { $this->db->rollback(); $this->output = "Rollback after error\n"; - $this->output.= $numofexpiredmembers.' partnership checked'."\n"; - if ($erroremail) $this->output.='. Got errors when sending some email : '.$erroremail."\n"; - if ($emailnotfound) $this->output.='. Email not found for some partner : '.$emailnotfound."\n"; - if ($websitenotfound) $this->output.='. Website not found for some partner : '.$websitenotfound."\n"; + $this->output .= $numofexpiredmembers.' partnership checked'."\n"; + if ($erroremail) $this->output .= '. Got errors when sending some email : '.$erroremail."\n"; + if ($emailnotfound) $this->output .= '. Email not found for some partner : '.$emailnotfound."\n"; + if ($websitenotfound) $this->output .= '. Website not found for some partner : '.$websitenotfound."\n"; } - return ($error ? 1: 0); + return ($error ? 1 : 0); } /** diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index c8bb93ccb7d..79f51be6ca9 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -82,7 +82,7 @@ if ($managedfor != 'member' && $sortfield == 'd.datefin') $sortfield = ''; // Default sort order (if not yet defined by previous GETPOST) if (!$sortfield) { - reset($object->fields); // Reset is required to avoid key() to return null. + reset($object->fields); // Reset is required to avoid key() to return null. $sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition. } if (!$sortorder) { @@ -136,8 +136,8 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); -$permissiontoread = $user->rights->partnership->read; -$permissiontoadd = $user->rights->partnership->write; +$permissiontoread = $user->rights->partnership->read; +$permissiontoadd = $user->rights->partnership->write; $permissiontodelete = $user->rights->partnership->delete; // Security check @@ -305,13 +305,13 @@ foreach ($search as $key => $val) { } } else { if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') { - $columnName=preg_replace('/(_dtstart|_dtend)$/', '', $key); + $columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key); if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) { if (preg_match('/_dtstart$/', $key)) { - $sql .= " AND t." . $columnName . " >= '" . $db->idate($search[$key]) . "'"; + $sql .= " AND t.".$columnName." >= '".$db->idate($search[$key])."'"; } if (preg_match('/_dtend$/', $key)) { - $sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'"; + $sql .= " AND t.".$columnName." <= '".$db->idate($search[$key])."'"; } } } @@ -538,7 +538,7 @@ foreach ($object->fields as $key => $val) { print ''; if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); - } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:')=== 0)) { + } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) { print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth125', 1); } elseif (!preg_match('/^(date|timestamp|datetime)/', $val['type'])) { print ''; diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 170853b9c2b..1b04a77083c 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -315,11 +315,11 @@ if (empty($reshook)) { $object->type = $type; $object->status = GETPOST('statut'); - $object->status_buy = GETPOST('statut_buy'); + $object->status_buy = GETPOST('statut_buy'); $object->status_batch = GETPOST('status_batch'); $object->batch_mask = GETPOST('batch_mask'); - $object->barcode_type = GETPOST('fk_barcode_type'); + $object->barcode_type = GETPOST('fk_barcode_type'); $object->barcode = GETPOST('barcode'); // Set barcode_type_xxx from barcode_type id $stdobject = new GenericObject($db); @@ -1620,10 +1620,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $tooltip .= $langs->trans("GenericMaskCodes5"); print ''.$langs->trans("ManageLotMask").''; if ($object->status_batch == '1' && $conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS && $conf->global->PRODUCTBATCH_LOT_ADDON == 'mod_lot_advanced') { - $mask = ! empty($object->batch_mask) ? $object->batch_mask : $conf->global->LOT_ADVANCED_MASK; + $mask = !empty($object->batch_mask) ? $object->batch_mask : $conf->global->LOT_ADVANCED_MASK; } if ($object->status_batch == '2' && $conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS && $conf->global->PRODUCTBATCH_SN_ADDON == 'mod_sn_advanced') { - $mask = ! empty($object->batch_mask) ? $object->batch_mask : $conf->global->SN_ADVANCED_MASK; + $mask = !empty($object->batch_mask) ? $object->batch_mask : $conf->global->SN_ADVANCED_MASK; } $inherited_mask_lot = $conf->global->LOT_ADVANCED_MASK; $inherited_mask_sn = $conf->global->SN_ADVANCED_MASK; @@ -2011,7 +2011,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $formbarcode = new FormBarCode($db); } - $fk_barcode_type=''; + $fk_barcode_type = ''; if ($action == 'editbarcodetype') { print $formbarcode->formBarcodeType($_SERVER['PHP_SELF'].'?id='.$object->id, $object->barcode_type, 'fk_barcode_type'); $fk_barcode_type = $object->barcode_type; @@ -2057,7 +2057,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''.$langs->trans("ManageLotSerial").''; print $object->getLibStatut(0, 2); print ''; - if ((($object->status_batch == '1' &&$conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS && $conf->global->PRODUCTBATCH_LOT_ADDON == 'mod_lot_advanced') + if ((($object->status_batch == '1' && $conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS && $conf->global->PRODUCTBATCH_LOT_ADDON == 'mod_lot_advanced') || ($object->status_batch == '2' && $conf->global->PRODUCTBATCH_SN_ADDON == 'mod_sn_advanced' && $conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS))) { print ''.$langs->trans("ManageLotMask").''; print $object->batch_mask; diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 55ab129edee..876ced9892c 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -169,7 +169,7 @@ if (empty($reshook)) { // Modification entrepot if ($action == 'update' && !$cancel) { if ($object->fetch($id)) { - $object->label = GETPOST("libelle"); + $object->label = GETPOST("libelle"); $object->fk_parent = GETPOST("fk_parent"); $object->fk_project = GETPOST('projectid'); $object->description = GETPOST("desc"); @@ -179,8 +179,8 @@ if (empty($reshook)) { $object->zip = GETPOST("zipcode"); $object->town = GETPOST("town"); $object->country_id = GETPOST("country_id"); - $object->phone = GETPOST("phone"); - $object->fax = GETPOST("fax"); + $object->phone = GETPOST("phone"); + $object->fax = GETPOST("fax"); // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost(null, $object); @@ -648,7 +648,7 @@ if ($action == 'create') { $sql .= " AND ps.fk_entrepot = ".((int) $object->id); if ($separatedPMP) { - $sql .= " AND pa.fk_product = p.rowid AND pa.entity = ". (int) $conf->entity; + $sql .= " AND pa.fk_product = p.rowid AND pa.entity = ".(int) $conf->entity; } $sql .= $db->order($sortfield, $sortorder); diff --git a/htdocs/salaries/payments.php b/htdocs/salaries/payments.php index 8b0c774cc6a..28cf3f821cf 100644 --- a/htdocs/salaries/payments.php +++ b/htdocs/salaries/payments.php @@ -28,7 +28,9 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php'; require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; -if (!empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; +if (!empty($conf->accounting->enabled)) { + require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; +} // Load translation files required by the page $langs->loadLangs(array("compta", "salaries", "bills", "hrm")); @@ -52,8 +54,12 @@ if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST( $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -if (!$sortfield) $sortfield = "s.datep,s.rowid"; -if (!$sortorder) $sortorder = "DESC,DESC"; +if (!$sortfield) { + $sortfield = "s.datep,s.rowid"; +} +if (!$sortorder) { + $sortorder = "DESC,DESC"; +} // Initialize technical objects $object = new PaymentSalary($db); @@ -66,8 +72,12 @@ $extrafields->fetch_name_optionals_label($object->table_element); $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); -if (!$sortfield) $sortfield = "s.datep,s.rowid"; -if (!$sortorder) $sortorder = "DESC,DESC"; +if (!$sortfield) { + $sortfield = "s.datep,s.rowid"; +} +if (!$sortorder) { + $sortorder = "DESC,DESC"; +} $search_ref = GETPOST('search_ref', 'int'); $search_ref_salary = GETPOST('search_ref_salary', 'int'); @@ -89,7 +99,9 @@ if (!GETPOST('search_type_id', 'int')) { $filterarray = explode('-', $newfiltre); foreach ($filterarray as $val) { $part = explode(':', $val); - if ($part[0] == 's.fk_typepayment') $search_type_id = $part[1]; + if ($part[0] == 's.fk_typepayment') { + $search_type_id = $part[1]; + } } } else { $search_type_id = GETPOST('search_type_id', 'int'); @@ -133,7 +145,9 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa $parameters = array(); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks -if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} if (empty($reshook)) { // Selection of new fields @@ -203,21 +217,47 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.ro $sql .= " ".MAIN_DB_PREFIX."user as u"; $sql .= " WHERE u.rowid = sal.fk_user"; $sql .= " AND s.entity IN (".getEntity('payment_salaries').")"; -if (empty($user->rights->salaries->readall)) $sql .= " AND s.fk_user IN (".$db->sanitize(join(',', $childids)).")"; +if (empty($user->rights->salaries->readall)) { + $sql .= " AND s.fk_user IN (".$db->sanitize(join(',', $childids)).")"; +} // Search criteria -if ($search_ref) $sql .= " AND s.rowid=".((int) $search_ref); -if ($search_ref_salary) $sql .= " AND sal.rowid=".((int) $search_ref_salary); -if ($search_user) $sql .= natural_search(array('u.login', 'u.lastname', 'u.firstname', 'u.email'), $search_user); -if ($search_label) $sql .= natural_search(array('sal.label'), $search_label); -if ($search_date_start) $sql .= " AND s.datep >= '".$db->idate($search_date_start)."'"; -if ($search_date_end) $sql .= " AND s.datep <= '".$db->idate($search_date_end)."'"; -if ($search_dateep_start) $sql .= " AND sal.dateep >= '".$db->idate($search_dateep_start)."'"; -if ($search_dateep_end) $sql .= " AND sal.dateep <= '".$db->idate($search_dateep_end)."'"; -if ($search_amount) $sql .= natural_search("s.amount", $search_amount, 1); -if ($search_account > 0) $sql .= " AND b.fk_account=".((int) $search_account); -if ($search_fk_bank) $sql .= " AND s.fk_bank=".((int) $search_fk_bank); -if ($search_chq_number) $sql .= natural_search(array('s.num_payment'), $search_chq_number); +if ($search_ref) { + $sql .= " AND s.rowid=".((int) $search_ref); +} +if ($search_ref_salary) { + $sql .= " AND sal.rowid=".((int) $search_ref_salary); +} +if ($search_user) { + $sql .= natural_search(array('u.login', 'u.lastname', 'u.firstname', 'u.email'), $search_user); +} +if ($search_label) { + $sql .= natural_search(array('sal.label'), $search_label); +} +if ($search_date_start) { + $sql .= " AND s.datep >= '".$db->idate($search_date_start)."'"; +} +if ($search_date_end) { + $sql .= " AND s.datep <= '".$db->idate($search_date_end)."'"; +} +if ($search_dateep_start) { + $sql .= " AND sal.dateep >= '".$db->idate($search_dateep_start)."'"; +} +if ($search_dateep_end) { + $sql .= " AND sal.dateep <= '".$db->idate($search_dateep_end)."'"; +} +if ($search_amount) { + $sql .= natural_search("s.amount", $search_amount, 1); +} +if ($search_account > 0) { + $sql .= " AND b.fk_account=".((int) $search_account); +} +if ($search_fk_bank) { + $sql .= " AND s.fk_bank=".((int) $search_fk_bank); +} +if ($search_chq_number) { + $sql .= natural_search(array('s.num_payment'), $search_chq_number); +} if ($search_type_id > 0) { $sql .= " AND s.fk_typepayment=".((int) $search_type_id); @@ -238,7 +278,9 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit))) { $num = $nbtotalofrecords; } else { - if ($limit) $sql .= $db->plimit($limit + 1, $offset); + if ($limit) { + $sql .= $db->plimit($limit + 1, $offset); + } $resql = $db->query($sql); if (!$resql) { @@ -257,21 +299,51 @@ llxHeader('', $title, $help_url); $arrayofselected = is_array($toselect) ? $toselect : array(); $param = ''; -if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage); -if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit); -if ($search_type_id) $param .= '&search_type_id='.urlencode($search_type_id); -if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss); -if ($search_ref) $param .= '&search_ref='.urlencode($search_ref); -if ($search_ref_salary) $param .= '&search_ref_salary='.urlencode($search_ref_salary); -if ($search_user) $param .= '&search_user='.urlencode($search_user); -if ($search_label) $param .= '&search_label='.urlencode($search_label); -if ($search_fk_bank) $param .= '&search_fk_bank='.urlencode($search_fk_bank); -if ($search_chq_number) $param .= '&search_chq_number='.urlencode($search_chq_number); -if ($search_account) $param .= '&search_account='.urlencode($search_account); -if ($search_date_start) $param .= '&search_date_startday='.urlencode(GETPOST('search_date_startday', 'int')).'&search_date_startmonth='.urlencode(GETPOST('search_date_startmonth', 'int')).'&search_date_startyear='.urlencode(GETPOST('search_date_startyear', 'int')); -if ($search_dateep_start) $param .= '&search_dateep_startday='.urlencode(GETPOST('search_dateep_startday', 'int')).'&search_dateep_startmonth='.urlencode(GETPOST('search_dateep_startmonth', 'int')).'&search_dateep_startyear='.urlencode(GETPOST('search_dateep_startyear', 'int')); -if ($search_date_end) $param .= '&search_date_endday='.urlencode(GETPOST('search_date_endday', 'int')).'&search_date_endmonth='.urlencode(GETPOST('search_date_endmonth', 'int')).'&search_date_endyear='.urlencode(GETPOST('search_date_endyear', 'int')); -if ($search_dateep_end) $param .= '&search_dateep_endday='.urlencode(GETPOST('search_dateep_endday', 'int')).'&search_dateep_endmonth='.urlencode(GETPOST('search_dateep_endmonth', 'int')).'&search_dateep_endyear='.urlencode(GETPOST('search_dateep_endyear', 'int')); +if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { + $param .= '&contextpage='.urlencode($contextpage); +} +if ($limit > 0 && $limit != $conf->liste_limit) { + $param .= '&limit='.urlencode($limit); +} +if ($search_type_id) { + $param .= '&search_type_id='.urlencode($search_type_id); +} +if ($optioncss != '') { + $param .= '&optioncss='.urlencode($optioncss); +} +if ($search_ref) { + $param .= '&search_ref='.urlencode($search_ref); +} +if ($search_ref_salary) { + $param .= '&search_ref_salary='.urlencode($search_ref_salary); +} +if ($search_user) { + $param .= '&search_user='.urlencode($search_user); +} +if ($search_label) { + $param .= '&search_label='.urlencode($search_label); +} +if ($search_fk_bank) { + $param .= '&search_fk_bank='.urlencode($search_fk_bank); +} +if ($search_chq_number) { + $param .= '&search_chq_number='.urlencode($search_chq_number); +} +if ($search_account) { + $param .= '&search_account='.urlencode($search_account); +} +if ($search_date_start) { + $param .= '&search_date_startday='.urlencode(GETPOST('search_date_startday', 'int')).'&search_date_startmonth='.urlencode(GETPOST('search_date_startmonth', 'int')).'&search_date_startyear='.urlencode(GETPOST('search_date_startyear', 'int')); +} +if ($search_dateep_start) { + $param .= '&search_dateep_startday='.urlencode(GETPOST('search_dateep_startday', 'int')).'&search_dateep_startmonth='.urlencode(GETPOST('search_dateep_startmonth', 'int')).'&search_dateep_startyear='.urlencode(GETPOST('search_dateep_startyear', 'int')); +} +if ($search_date_end) { + $param .= '&search_date_endday='.urlencode(GETPOST('search_date_endday', 'int')).'&search_date_endmonth='.urlencode(GETPOST('search_date_endmonth', 'int')).'&search_date_endyear='.urlencode(GETPOST('search_date_endyear', 'int')); +} +if ($search_dateep_end) { + $param .= '&search_dateep_endday='.urlencode(GETPOST('search_dateep_endday', 'int')).'&search_dateep_endmonth='.urlencode(GETPOST('search_dateep_endmonth', 'int')).'&search_dateep_endyear='.urlencode(GETPOST('search_dateep_endyear', 'int')); +} // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; @@ -281,11 +353,15 @@ $arrayofmassactions = array( //'buildsepa'=>$langs->trans("BuildSepa"), // TODO ); //if ($permissiontodelete) $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array(); +if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { + $arrayofmassactions = array(); +} $massactionbutton = $form->selectMassAction('', $arrayofmassactions); print '
    '; -if ($optioncss != '') print ''; +if ($optioncss != '') { + print ''; +} print ''; print ''; print ''; @@ -294,7 +370,9 @@ print ''; print ''; $url = DOL_URL_ROOT.'/salaries/card.php?action=create'; -if (!empty($socid)) $url .= '&socid='.$socid; +if (!empty($socid)) { + $url .= '&socid='.$socid; +} $newcardbutton = dolGetButtonTitle($langs->trans('NewSalaryPayment'), '', 'fa fa-plus-circle', $url, '', $user->rights->salaries->write); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $totalnboflines, 'object_payment', 0, $newcardbutton, '', $limit, 0, 0, 1); @@ -413,7 +491,10 @@ print ''."\n"; $needToFetchEachLine = 0; if (is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) { - if (preg_match('/\$object/', $val)) $needToFetchEachLine++; // There is at least one compute field that use $object + if (preg_match('/\$object/', $val)) { + $needToFetchEachLine++; + } + // There is at least one compute field that use $object } } @@ -424,7 +505,10 @@ $total = 0; $totalarray = array(); while ($i < ($limit ? min($num, $limit) : $num)) { $obj = $db->fetch_object($resql); - if (empty($obj)) break; // Should not happen + if (empty($obj)) { + break; + } + // Should not happen // Store properties in $object $object->setVarsFromFetchObj($obj); @@ -449,22 +533,32 @@ while ($i < ($limit ? min($num, $limit) : $num)) { // Ref print "".$paymentsalstatic->getNomUrl(1)."\n"; - if (!$i) $totalarray['nbfield']++; + if (!$i) { + $totalarray['nbfield']++; + } print "".$salstatic->getNomUrl(1)."\n"; - if (!$i) $totalarray['nbfield']++; + if (!$i) { + $totalarray['nbfield']++; + } // Label payment print "".dol_trunc($obj->label, 40)."\n"; - if (!$i) $totalarray['nbfield']++; + if (!$i) { + $totalarray['nbfield']++; + } // Date end period print ''.dol_print_date($db->jdate($obj->dateep), 'day')."\n"; - if (!$i) $totalarray['nbfield']++; + if (!$i) { + $totalarray['nbfield']++; + } // Date payment print ''.dol_print_date($db->jdate($obj->datep), 'day')."\n"; - if (!$i) $totalarray['nbfield']++; + if (!$i) { + $totalarray['nbfield']++; + } // Date value /*print ''.dol_print_date($db->jdate($obj->datev), 'day')."\n"; @@ -472,15 +566,21 @@ while ($i < ($limit ? min($num, $limit) : $num)) { // Employee print "".$userstatic->getNomUrl(1)."\n"; - if (!$i) $totalarray['nbfield']++; + if (!$i) { + $totalarray['nbfield']++; + } // Type print ''.$langs->trans("PaymentTypeShort".$obj->payment_code).''; - if (!$i) $totalarray['nbfield']++; + if (!$i) { + $totalarray['nbfield']++; + } // Chq number print ''.$obj->num_payment.''; - if (!$i) $totalarray['nbfield']++; + if (!$i) { + $totalarray['nbfield']++; + } // Account if (!empty($conf->banque->enabled)) { @@ -489,7 +589,9 @@ while ($i < ($limit ? min($num, $limit) : $num)) { $accountlinestatic->id = $obj->fk_bank; print $accountlinestatic->getNomUrl(1); print ''; - if (!$i) $totalarray['nbfield']++; + if (!$i) { + $totalarray['nbfield']++; + } print ''; if ($obj->fk_bank > 0) { @@ -514,15 +616,23 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if ($accountstatic->id > 0) { print $accountstatic->getNomUrl(1); } - } else print ' '; + } else { + print ' '; + } print ''; - if (!$i) $totalarray['nbfield']++; + if (!$i) { + $totalarray['nbfield']++; + } } // Amount print ''.price($obj->amount).''; - if (!$i) $totalarray['nbfield']++; - if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'totalttcfield'; + if (!$i) { + $totalarray['nbfield']++; + } + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 'totalttcfield'; + } $totalarray['val']['totalttcfield'] += $obj->amount; // Extra fields @@ -535,11 +645,15 @@ while ($i < ($limit ? min($num, $limit) : $num)) { print ''; if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined $selected = 0; - if (in_array($object->id, $arrayofselected)) $selected = 1; + if (in_array($object->id, $arrayofselected)) { + $selected = 1; + } print ''; } print ''; - if (!$i) $totalarray['nbfield']++; + if (!$i) { + $totalarray['nbfield']++; + } print ''."\n"; @@ -553,7 +667,10 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; // If no record found if ($num == 0) { $colspan = 1; - foreach ($arrayfields as $key => $val) { if (!empty($val['checked'])) $colspan++; } + foreach ($arrayfields as $key => $val) { if (!empty($val['checked'])) { + $colspan++; + } + } print ''.$langs->trans("NoRecordFound").''; } diff --git a/htdocs/societe/partnership.php b/htdocs/societe/partnership.php index 912307a5675..9cb065d2c3b 100644 --- a/htdocs/societe/partnership.php +++ b/htdocs/societe/partnership.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership.class.php'; require_once DOL_DOCUMENT_ROOT.'/partnership/lib/partnership.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("companies","partnership", "other")); +$langs->loadLangs(array("companies", "partnership", "other")); // Get parameters $id = GETPOST('id', 'int'); @@ -82,19 +82,27 @@ foreach ($object->fields as $key => $val) { // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. -$permissiontoread = $user->rights->partnership->read; -$permissiontoadd = $user->rights->partnership->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php +$permissiontoread = $user->rights->partnership->read; +$permissiontoadd = $user->rights->partnership->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php $permissiontodelete = $user->rights->partnership->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); -$permissionnote = $user->rights->partnership->write; // Used by the include of actions_setnotes.inc.php +$permissionnote = $user->rights->partnership->write; // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->rights->partnership->write; // Used by the include of actions_dellink.inc.php -$usercanclose = $user->rights->partnership->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php -$upload_dir = $conf->partnership->multidir_output[isset($object->entity) ? $object->entity : 1]; +$usercanclose = $user->rights->partnership->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php +$upload_dir = $conf->partnership->multidir_output[isset($object->entity) ? $object->entity : 1]; -if (!empty($conf->global->PARTNERSHIP_IS_MANAGED_FOR) && $conf->global->PARTNERSHIP_IS_MANAGED_FOR != 'thirdparty') accessforbidden(); -if (empty($conf->partnership->enabled)) accessforbidden(); -if (empty($permissiontoread)) accessforbidden(); -if ($action == 'edit' && empty($permissiontoadd)) accessforbidden(); +if (!empty($conf->global->PARTNERSHIP_IS_MANAGED_FOR) && $conf->global->PARTNERSHIP_IS_MANAGED_FOR != 'thirdparty') { + accessforbidden(); +} +if (empty($conf->partnership->enabled)) { + accessforbidden(); +} +if (empty($permissiontoread)) { + accessforbidden(); +} +if ($action == 'edit' && empty($permissiontoadd)) { + accessforbidden(); +} if (($action == 'update' || $action == 'edit') && $object->status != $object::STATUS_DRAFT && !empty($user->socid)) { accessforbidden(); @@ -128,7 +136,9 @@ if (empty($reshook)) { } $object->fields['fk_soc']['visible'] = 0; -if ($object->id > 0 && $object->status == $object::STATUS_REFUSED && empty($action)) $object->fields['reason_decline_or_cancel']['visible'] = 1; +if ($object->id > 0 && $object->status == $object::STATUS_REFUSED && empty($action)) { + $object->fields['reason_decline_or_cancel']['visible'] = 1; +} $object->fields['note_public']['visible'] = 1; From afa1e117c5a371003b32271b4d7286f100e7e4e5 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 14 Jun 2021 13:37:39 +0000 Subject: [PATCH 0628/1497] Fixing style errors. --- htdocs/salaries/payments.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/salaries/payments.php b/htdocs/salaries/payments.php index 28cf3f821cf..bfc795ebcef 100644 --- a/htdocs/salaries/payments.php +++ b/htdocs/salaries/payments.php @@ -550,9 +550,9 @@ while ($i < ($limit ? min($num, $limit) : $num)) { // Date end period print ''.dol_print_date($db->jdate($obj->dateep), 'day')."\n"; - if (!$i) { - $totalarray['nbfield']++; - } + if (!$i) { + $totalarray['nbfield']++; + } // Date payment print ''.dol_print_date($db->jdate($obj->datep), 'day')."\n"; @@ -668,7 +668,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; if ($num == 0) { $colspan = 1; foreach ($arrayfields as $key => $val) { if (!empty($val['checked'])) { - $colspan++; + $colspan++; } } print ''.$langs->trans("NoRecordFound").''; From 33553f33476efd363b93cf6c5257943b560b59a0 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Mon, 14 Jun 2021 17:01:59 +0200 Subject: [PATCH 0629/1497] FIX : same thing on supplier orders --- htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php b/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php index 1b85082616a..1e5ed8c724c 100644 --- a/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php +++ b/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php @@ -65,7 +65,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) echo ''.price($objectlink->total_ht).''; } } ?> - getLibStatut(3); ?> + getLibStatut(3, $objectlink->getSommePaiement()); ?> ">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?> Date: Mon, 14 Jun 2021 17:08:16 +0200 Subject: [PATCH 0630/1497] FIX : method exists --- htdocs/compta/facture/tpl/linkedobjectblock.tpl.php | 5 ++++- htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php index 1e18eb6bfeb..1b81446c243 100644 --- a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php +++ b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php @@ -85,7 +85,10 @@ foreach ($linkedObjectBlock as $key => $objectlink) } } print ''; - print ''.$objectlink->getLibStatut(3, $objectlink->getSommePaiement()).''; + print ''; + if(method_exists($objectlink, 'getSommePaiement')) print $objectlink->getLibStatut(3, $objectlink->getSommePaiement()); + else print $objectlink->getLibStatut(3); + print ''; print ''.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').''; print "\n"; } diff --git a/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php b/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php index 1e5ed8c724c..5bb6e45a8c8 100644 --- a/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php +++ b/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php @@ -65,7 +65,10 @@ foreach ($linkedObjectBlock as $key => $objectlink) echo ''.price($objectlink->total_ht).''; } } ?> - getLibStatut(3, $objectlink->getSommePaiement()); ?> + getLibStatut(3, $objectlink->getSommePaiement()); + else echo $objectlink->getLibStatut(3); + ?> ">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?> Date: Mon, 14 Jun 2021 15:10:24 +0000 Subject: [PATCH 0631/1497] Fixing style errors. --- htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php b/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php index 5bb6e45a8c8..20969cddf22 100644 --- a/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php +++ b/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php @@ -66,9 +66,9 @@ foreach ($linkedObjectBlock as $key => $objectlink) } } ?> getLibStatut(3, $objectlink->getSommePaiement()); + if(method_exists($objectlink, 'getSommePaiement')) echo $objectlink->getLibStatut(3, $objectlink->getSommePaiement()); else echo $objectlink->getLibStatut(3); - ?> + ?> ">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?> Date: Mon, 14 Jun 2021 18:45:02 +0200 Subject: [PATCH 0632/1497] Clean code --- htdocs/admin/user.php | 1 + htdocs/fourn/commande/card.php | 31 +++++++++++++++++++++++-------- htdocs/fourn/commande/list.php | 5 +++-- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php index 83649d46a28..6d8cfe21f00 100644 --- a/htdocs/admin/user.php +++ b/htdocs/admin/user.php @@ -109,6 +109,7 @@ if ($action == 'set_default') { } } + /* * View */ diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 44a712969c1..6e89abbf953 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -66,6 +66,11 @@ $id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'purchaseordercard'; // To manage different context of search + +$backtopage = GETPOST('backtopage', 'alpha'); +$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); + $socid = GETPOST('socid', 'int'); $projectid = GETPOST('projectid', 'int'); $cancel = GETPOST('cancel', 'alpha'); @@ -151,12 +156,16 @@ if ($reshook < 0) { } if (empty($reshook)) { - if ($cancel) { - if (!empty($backtopage)) { - header("Location: ".$backtopage); - exit; + $backurlforlist = DOL_URL_ROOT.'/fourn/commande/list.php'.($socid > 0 ? '&socid='.((int) $socid) : ''); + + if (empty($backtopage) || ($cancel && empty($id))) { + if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { + if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { + $backtopage = $backurlforlist; + } else { + $backtopage = DOL_URL_ROOT.'/fourn/commande/card.php?id='.($id > 0 ? $id : '__ID__'); + } } - $action = ''; } include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once @@ -1573,10 +1582,16 @@ if ($action == 'create') { print ''; print ''; print ''; - print ''."\n"; print ''; print ''; print ''; + if ($backtopage) { + print ''; + } + if ($backtopageforcancel) { + print ''; + } + if (!empty($currency_tx)) { print ''; } @@ -1592,9 +1607,9 @@ if ($action == 'create') { print ''.$langs->trans('Supplier').''; print ''; - if ($socid > 0) { + if ($societe->id > 0) { print $societe->getNomUrl(1); - print ''; + print ''; } else { print img_picto('', 'company').$form->select_company((empty($socid) ? '' : $socid), 'socid', 's.fournisseur=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); // reload page to retrieve customer informations diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 25f71f85eb4..c644f9e35a5 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -892,8 +892,9 @@ if ($resql) { $massactionbutton = $form->selectMassAction('', $arrayofmassactions); $url = DOL_URL_ROOT.'/fourn/commande/card.php?action=create'; - if (!empty($socid)) { - $url .= '&socid='.$socid; + if ($socid > 0) { + $url .= '&socid='.((int) $socid); + $url .= '&backtopage='.urlencode(DOL_URL_ROOT.'/fourn/commande/list.php?socid='.((int) $socid)); } $newcardbutton = dolGetButtonTitle($langs->trans('NewSupplierOrderShort'), '', 'fa fa-plus-circle', $url, '', ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer)); From a79afeaf02fe23c0e8d2c9c46c2a45248dabff7b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 14 Jun 2021 19:58:12 +0200 Subject: [PATCH 0633/1497] Add info to allow debug of email collector --- .../class/emailcollector.class.php | 2 +- htdocs/langs/en_US/main.lang | 1 + htdocs/projet/class/project.class.php | 1 + htdocs/projet/list.php | 18 +++++++++++++++++- 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index b01f1883d53..ec5e33d8bb3 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -1539,7 +1539,7 @@ class EmailCollector extends CommonObject // Make Operation dol_syslog("Execute action ".$operation['type']." actionparam=".$operation['actionparam'].' thirdpartystatic->id='.$thirdpartystatic->id.' contactstatic->id='.$contactstatic->id.' projectstatic->id='.$projectstatic->id); - dol_syslog("Execute action fk_element_id=".$fk_element_id." fk_element_type=".$fk_element_type); + dol_syslog("Execute action fk_element_id=".$fk_element_id." fk_element_type=".$fk_element_type); // If a Dolibarr tracker id is found, we should now the id of object $actioncode = 'EMAIL_IN'; // If we scan the Sent box, we use the code for out email diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 39517ca2e1b..86c38e39b8b 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1117,3 +1117,4 @@ UpdateForAllLines=Update for all lines OnHold=On hold Civility=Civility InformationOnLinkToContract=This amount is only the total of all the lines of the contract. No notion of time is taken into consideration. +EmailMsgID=Email MsgID diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index c6e9799afa7..54e0f87a358 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -206,6 +206,7 @@ class Project extends CommonObject 'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserCreation', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>210), 'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModification', 'enabled'=>1, 'visible'=>0, 'position'=>215), 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>0, 'position'=>220), + 'email_msgid'=>array('type'=>'varchar(255)', 'label'=>'EmailMsgID', 'enabled'=>1, 'visible'=>-1, 'position'=>250, 'help'=>'EmailMsgIDWhenSourceisEmail'), 'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>500) ); // END MODULEBUILDER PROPERTIES diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 4438a9ce217..96c960e58d1 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -25,7 +25,7 @@ /** * \file htdocs/projet/list.php - * \ingroup projet + * \ingroup project * \brief Page to list projects */ @@ -300,6 +300,7 @@ if (count($listofprojectcontacttype) == 0) $listofprojectcontacttype[0] = '0'; / $distinct = 'DISTINCT'; // We add distinct until we are added a protection to be sure a contact of a project and task is only once. $sql = "SELECT ".$distinct." p.rowid as id, p.ref, p.title, p.fk_statut as status, p.fk_opp_status, p.public, p.fk_user_creat"; $sql .= ", p.datec as date_creation, p.dateo as date_start, p.datee as date_end, p.opp_amount, p.opp_percent, (p.opp_amount*p.opp_percent/100) as opp_weighted_amount, p.tms as date_update, p.budget_amount, p.usage_opportunity, p.usage_task, p.usage_bill_time"; +$sql .= ", p.email_msgid"; $sql .= ", s.rowid as socid, s.nom as name, s.email"; $sql .= ", cls.code as opp_status_code"; // Add fields from extrafields @@ -668,6 +669,12 @@ if (!empty($arrayfields['p.tms']['checked'])) print ''; print ''; } +if (!empty($arrayfields['p.email_msgid']['checked'])) +{ + // Email msg id + print ''; + print ''; +} if (!empty($arrayfields['p.fk_statut']['checked'])) { print ''; @@ -710,6 +717,7 @@ $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // No print $hookmanager->resPrint; if (!empty($arrayfields['p.datec']['checked'])) print_liste_field_titre($arrayfields['p.datec']['label'], $_SERVER["PHP_SELF"], "p.datec", "", $param, '', $sortfield, $sortorder, 'center nowrap '); if (!empty($arrayfields['p.tms']['checked'])) print_liste_field_titre($arrayfields['p.tms']['label'], $_SERVER["PHP_SELF"], "p.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap '); +if (!empty($arrayfields['p.email_msgid']['checked'])) print_liste_field_titre($arrayfields['p.email_msgid']['label'], $_SERVER["PHP_SELF"], "p.email_msgid", "", $param, '', $sortfield, $sortorder, 'center '); if (!empty($arrayfields['p.fk_statut']['checked'])) print_liste_field_titre($arrayfields['p.fk_statut']['label'], $_SERVER["PHP_SELF"], "p.fk_statut", "", $param, '', $sortfield, $sortorder, 'right '); print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); print "\n"; @@ -948,6 +956,14 @@ while ($i < min($num, $limit)) print ''; if (!$i) $totalarray['nbfield']++; } + // Email MsgID + if (!empty($arrayfields['p.email_msgid']['checked'])) + { + print ''; + print $obj->email_msgid; + print ''; + if (!$i) $totalarray['nbfield']++; + } // Status if (!empty($arrayfields['p.fk_statut']['checked'])) { From d154ec2344f67756552f0e35b98595341cea9c36 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 14 Jun 2021 20:06:52 +0200 Subject: [PATCH 0634/1497] FIX Collector to create lead was broken --- htdocs/comm/action/class/actioncomm.class.php | 4 ++++ htdocs/projet/class/project.class.php | 4 +++- htdocs/ticket/class/ticket.class.php | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index f7e0ef6acb1..d094fb0bab4 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -683,6 +683,10 @@ class ActionComm extends CommonObject { global $langs; + if (empty($id) && empty($ref) && empty($ref_ext) && empty($email_msgid)) { + return -1; + } + $sql = "SELECT a.id,"; $sql .= " a.id as ref,"; $sql .= " a.entity,"; diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 54e0f87a358..c5dd1045f03 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -526,7 +526,9 @@ class Project extends CommonObject { global $conf; - if (empty($id) && empty($ref)) return -1; + if (empty($id) && empty($ref) && empty($ref_ext) && empty($email_msgid)) { + return -1; + } $sql = "SELECT rowid, entity, ref, title, description, public, datec, opp_amount, budget_amount,"; $sql .= " tms, dateo, datee, date_close, fk_soc, fk_user_creat, fk_user_modif, fk_user_close, fk_statut as status, fk_opp_status, opp_percent,"; diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 5f95c7f0dc5..20d63cea600 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -529,7 +529,7 @@ class Ticket extends CommonObject global $langs; // Check parameters - if (!$id && !$track_id && !$ref && !$email_msgid) { + if (empty($id) && empty($ref) && empty($track_id) && empty($email_msgid)) { $this->error = 'ErrorWrongParameters'; dol_print_error(get_class($this)."::fetch ".$this->error); return -1; From 7e7800c1103967fa119f4846bcf2d5503798cb5a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 14 Jun 2021 20:37:21 +0200 Subject: [PATCH 0635/1497] Fix phpcs --- htdocs/projet/list.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 502f2bed071..cd532ecd048 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -1304,8 +1304,7 @@ while ($i < min($num, $limit)) { } } // Email MsgID - if (!empty($arrayfields['p.email_msgid']['checked'])) - { + if (!empty($arrayfields['p.email_msgid']['checked'])) { print ''; print $obj->email_msgid; print ''; From 41549af751b2551480dd02a4581474ea09f05897 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 14 Jun 2021 21:45:11 +0200 Subject: [PATCH 0636/1497] Update llx_00_c_country.sql MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Iles Salomon -> Solomon Islands Somalie -> Somalia South Africa Iles Géorgie du Sud et Sandwich du Sud -> South Georgia and the South Sandwich Islands Sri Lanka = Sri Lanka Soudan -> Sudan Suriname = Suriname Iles Svalbard et Jan Mayen -> Svalbard and Jan Mayen Swaziland = Swaziland & new also: Eswatini Syrie -> Syria --- htdocs/install/mysql/data/llx_00_c_country.sql | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/install/mysql/data/llx_00_c_country.sql b/htdocs/install/mysql/data/llx_00_c_country.sql index 1e2e8b69c39..6cf703829a5 100644 --- a/htdocs/install/mysql/data/llx_00_c_country.sql +++ b/htdocs/install/mysql/data/llx_00_c_country.sql @@ -231,16 +231,16 @@ INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (19 INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (200,'SL','SLE','Sierra Leone',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (201,'SK','SVK','Slovakia',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (202,'SI','SVN','Slovenia',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (203,'SB','SLB','Iles Salomon',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (204,'SO','SOM','Somalie',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (203,'SB','SLB','Solomon Islands',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (204,'SO','SOM','Somalia',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (205,'ZA','ZAF','South Africa',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (206,'GS','SGS','Iles Géorgie du Sud et Sandwich du Sud',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (206,'GS','SGS','South Georgia and the South Sandwich Islands ',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (207,'LK','LKA','Sri Lanka',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (208,'SD','SDN','Soudan',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (208,'SD','SDN','Sudan',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (209,'SR','SUR','Suriname',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (210,'SJ','SJM','Iles Svalbard et Jan Mayen',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (211,'SZ','SWZ','Swaziland',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (212,'SY','SYR','Syrie',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (210,'SJ','SJM','Svalbard and Jan Mayen',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (211,'SZ','SWZ','Swaziland / Eswatini',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (212,'SY','SYR','Syria',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (213,'TW','TWN','Taïwan',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (214,'TJ','TJK','Tadjikistan',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (215,'TZ','TZA','Tanzanie',1,0); From 0b4105880e1c3d89c7ad080ea20ec0be305a93f2 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 14 Jun 2021 21:59:37 +0200 Subject: [PATCH 0637/1497] Update ChangeLog --- ChangeLog | 52 +++++++++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/ChangeLog b/ChangeLog index 95a4a7a3ae6..5808fbf313f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16,19 +16,12 @@ NEW: A lot of fix into english text after a small proofreading campaign (still n NEW: All main menu entries are using the picto of the module NEW: Add a copy to clipboard button on some fields NEW: Add an example of scheduled job to send email reminder for unpaid invoices -NEW: Accountancy - Add FEC import -NEW: Accountancy - Add a confirmation form with options on export -NEW: Accountancy - Add select date from/to in already bind customer and supplier list -NEW: Accountancy - Format FEC - Add new field DateLimitReglmt -NEW: Accountancy - In ledger & journals, show link on bank transaction -NEW: Accountancy - Possibility to filter on journals in balance -NEW: Accountancy - Add a page to list subledger accounts -NEW: add the Channel column into the list of orders NEW: Add a check to avoid an invoice date in the future NEW: Add some color and picto for the direction of movement +NEW: add the column "Channel" into the list of orders NEW: Add the column "alias" of company in the list of proposal, order, invoice NEW: Add the column "Office phone" and "User mobile" in user list -NEW: Add the column "Price level"in thirdparty list +NEW: Add the column "Price level" in thirdparty list NEW: Add some company information in the dropdown login menu NEW: Add constant MAIN_BUGTRACK_URL to set a custom url to redirect to when clicking on link "declare a bug" NEW: Add contact tag and bulk email status on the thirdparty + contact create form @@ -92,13 +85,22 @@ NEW: When a doc file is shared, link is visible from the main page of doc. NEW: #16378 More E-Mail Contact substitution Values for better salutation NEW: option to keep the "Automatically create a total payment" checkbox empty on the tax creation page + Accountancy +NEW: Accountancy - Add FEC import +NEW: Accountancy - Add a confirmation form with options on export +NEW: Accountancy - Add select date from/to in already bind customer and supplier list +NEW: Accountancy - Format FEC - Add new field DateLimitReglmt +NEW: Accountancy - In ledger & journals, show link on bank transaction +NEW: Accountancy - Possibility to filter on journals in balance +NEW: Accountancy - Add a page to list subledger accounts + ECM/GED -NEW: Add db fields note_public and note_private for ECM module -NEW: Can filter files in GED on status Shared/Not shared +NEW: add DB fields note_public and note_private for ECM module +NEW: Can filter files in ECM/GED on status Shared/Not shared Members NEW: #17292 default subscription amount by adherent type -NEW: Option to automatically create a login/user when a new subscription of a member is done online +NEW: option to automatically create a login/user when a new subscription of a member is done online NEW: option to select membership type on the online payment page for membership subscription or renewal Projects/Tasks @@ -122,17 +124,17 @@ NEW: option for TakePOS to show the total price without tax NEW: more permissions in TakePOS (can edit added line, can modify once order sent to kitchen) Third-Parties -NEW: Can set a Warehouse on a Thirdparty +NEW: can set a warehouse on a Thirdparty Tickets NEW: can use captcha on public page to create a ticket #16347 NEW: can set if a ticket group is visible on public interface or not Warehouse -NEW: Can make massive stock transfers from a CSV file -NEW: Stock movement list - Add more complete date field -NEW: Can set a Warehouse on a Thirdparty +NEW: can make massive stock transfers from a CSV file +NEW: Stock movement list - add more complete date field NEW: can set a warehouse in a proposal +NEW: can set a warehouse on a Thirdparty Website Module NEW: #17113 Can upload a favicon in website module @@ -147,10 +149,10 @@ NEW: start new experimental module Knowledge Management NEW: start new experimental module Workstations Management new Options -NEW: Add option CONTRACT_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared -NEW: Add option SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared -NEW: Add option MAIN_SECURITY_ANTI_SSRF_SERVER_IP to define list of IPs that are local IPs -NEW: Add option SOCIETE_DISABLE_WORKFORCE to hide staff field +NEW: add option CONTRACT_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared +NEW: add option SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared +NEW: add option MAIN_SECURITY_ANTI_SSRF_SERVER_IP to define list of IPs that are local IPs +NEW: add option SOCIETE_DISABLE_WORKFORCE to hide staff field For developers: @@ -164,10 +166,7 @@ NEW: Add experimental repair script to switch to dynamic row format and utf8mb4 NEW: add form confirm hook on company card NEW: Add function showValueWithClipboardCPButton() to add a copy/paste NEW: Add hook addSectionECMAuto method to add custom diretory into ECM auto files -NEW: Add native compression in rest apis -NEW: Product Variants API, add variant stock to response by parameter NEW: Upgrade Stripe PHP lib to 7.67.0 -NEW: Add link to OpenAPI specifications xml file in REST API module setup: swagger.json file can be included into external tools like redoc NEW: Support sepa_debit in stripe paymentmethods list NEW: Update doleditor.class.php for easily activate SCAYT NEW: Add triggers in the function add_object_linked(), updateObjectLinked() and deleteObjectLinked() @@ -181,8 +180,11 @@ NEW: unit selection on object edit line NEW: #13739 #17390 Product API route added to get product stock and product with or without variants APIs -NEW: API Add option $includeifobjectisused to get a product -NEW: API Get the list of product ids only +NEW: API add option $includeifobjectisused to get a product +NEW: API get the list of product ids only +NEW: add native compression in REST APIs +NEW: Product Variants API, add variant stock to response by parameter +NEW: add link to OpenAPI specifications XML file in REST API module setup: swagger.json file can be included into external tools like redoc WARNING: From 3b9936f7e21934f31b78114171e0b5f6b4602494 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 15 Jun 2021 01:18:17 +0200 Subject: [PATCH 0638/1497] Fix responsive --- htdocs/admin/accountant.php | 8 +++--- htdocs/admin/boxes.php | 2 +- htdocs/admin/company.php | 36 ++++++++++++++----------- htdocs/admin/company_socialnetworks.php | 7 +++-- htdocs/admin/ihm.php | 4 +-- htdocs/admin/menus/index.php | 4 +-- htdocs/admin/security.php | 21 ++++++++++----- htdocs/admin/translation.php | 17 +++--------- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/lib/treeview.lib.php | 7 +++-- htdocs/theme/eldy/global.inc.php | 4 +++ htdocs/theme/md/style.css.php | 4 +++ 12 files changed, 63 insertions(+), 53 deletions(-) diff --git a/htdocs/admin/accountant.php b/htdocs/admin/accountant.php index 56c9605c460..1e924699cd5 100644 --- a/htdocs/admin/accountant.php +++ b/htdocs/admin/accountant.php @@ -144,23 +144,23 @@ print ''."\n"; print ''; print img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright'); -print ''; +print ''; print ''."\n"; print ''; print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright'); -print ''; +print ''; print ''."\n"; print ''; print img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright'); -print ''; +print ''; print ''."\n"; // Web print ''; print img_picto('', 'globe', '', false, 0, 0, '', 'paddingright'); -print ''; +print ''; print ''."\n"; // Code diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index ae33ef3b6fa..56971457f76 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -422,7 +422,7 @@ foreach ($boxactivated as $key => $box) { $hasnext = ($key < (count($boxactivated) - 1)); $hasprevious = ($key != 0); print ''.($key + 1).''; - print ''; + print ''; print ($hasnext ? ''.img_down().' ' : ''); print ($hasprevious ? ''.img_up().'' : ''); print ''; diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 0c6da346285..804ed9934bf 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -418,7 +418,7 @@ print ''; print img_picto('', 'globe-americas', 'class="paddingrightonly"'); -print $form->select_country($mysoc->country_id, 'country_id'); +print $form->select_country($mysoc->country_id, 'country_id', '', 0); if ($user->admin) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } @@ -441,25 +441,25 @@ print ''."\n"; // Phone print ''; print img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright'); -print ''; +print ''; print ''."\n"; // Fax print ''; print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright'); -print ''; +print ''; print ''."\n"; // Email print ''; print img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright'); -print ''; +print ''; print ''."\n"; // Web print ''; print img_picto('', 'globe', '', false, 0, 0, '', 'paddingright'); -print ''; +print ''; print ''."\n"; // Barcode @@ -467,19 +467,19 @@ if (!empty($conf->barcode->enabled)) { print ''; print ''; print ''; - print ''; + print ''; print ''; } // Logo print ''; -print '
    '; -print ''; +print '
    '; +print ''; print '
    '; if (!empty($mysoc->logo_small)) { if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { print '
    '; - print ''; + print ''; print '
    '; } elseif (!empty($mysoc->logo)) { if (!file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) { @@ -487,10 +487,12 @@ if (!empty($mysoc->logo_small)) { } $imgThumbSmall = vignette($conf->mycompany->dir_output.'/logos/'.$mysoc->logo, $maxwidthmini, $maxheightmini, '_small', $quality); print '
    '; - print ''; + print ''; print '
    '; } - print ''; + print ''; } elseif (!empty($mysoc->logo)) { if (file_exists($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { print '
    '; @@ -508,8 +510,8 @@ print ''; // Logo (squarred) print ''; -print '
    '; -print ''; +print '
    '; +print ''; print '
    '; if (!empty($mysoc->logo_squarred_small)) { if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_small)) { @@ -551,20 +553,21 @@ print ''; print '
    '; // IDs of the company (country-specific) +print '
    '; print ''; -print ''; +print ''; $langs->load("companies"); // Managing Director(s) print ''; +print ''; // GDPR contact print ''; +print 'global->MAIN_INFO_GDPR) ? $conf->global->MAIN_INFO_GDPR : ''))).'">'; // Capital print ''; - - // VAT - print ''; - - // Unit price - print ''; - - // Unit price with tax - print ''; - - // Quantity - print ''; - - //print ''; - //print ''; - - // Picture - print ''; - - print ''; - - print ''; } - $i++; - } - } + $tredited = 'tredited'; + include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_addfile.tpl.php'; + include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_linktofile.tpl.php'; - // Add a new line - if (($object->status == ExpenseReport::STATUS_DRAFT || $object->status == ExpenseReport::STATUS_REFUSED) - && $action != 'editline' - && $user->rights->expensereport->creer) { + print ''; + + print ''; + + // Select date + print ''; + + // Select project + if (!empty($conf->projet->enabled)) { + print ''; + } + + // Select type + print ''; + + if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { + print ''; + } + + // Add comments + print ''; + + // VAT + print ''; + + // Unit price + print ''; + + // Unit price with tax + print ''; + + // Quantity + print ''; + + //print ''; + //print ''; + + // Picture + print ''; + + print ''; + + print ''; + } + + $i++; + } + } + + // Add a new line + if (($object->status == ExpenseReport::STATUS_DRAFT || $object->status == ExpenseReport::STATUS_REFUSED) + && $action != 'editline' + && $user->rights->expensereport->creer) { $colspan = 11; - if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { - $colspan++; - } - if (!empty($conf->projet->enabled)) { - $colspan++; - } - if ($action != 'editline') { - $colspan++; - } + if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { + $colspan++; + } + if (!empty($conf->projet->enabled)) { + $colspan++; + } + if ($action != 'editline') { + $colspan++; + } $nbFiles = $nbLinks = 0; $arrayoffiles = array(); - if (empty($conf->global->EXPENSEREPORT_DISABLE_ATTACHMENT_ON_LINES)) { - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; - require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; - $upload_dir = $conf->expensereport->dir_output."/".dol_sanitizeFileName($object->ref); - $arrayoffiles = dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png|'.preg_quote(dol_sanitizeFileName($object->ref.'.pdf'), '/').')$'); - $nbFiles = count($arrayoffiles); - $nbLinks = Link::count($db, $object->element, $object->id); - } + if (empty($conf->global->EXPENSEREPORT_DISABLE_ATTACHMENT_ON_LINES)) { + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; + $upload_dir = $conf->expensereport->dir_output."/".dol_sanitizeFileName($object->ref); + $arrayoffiles = dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png|'.preg_quote(dol_sanitizeFileName($object->ref.'.pdf'), '/').')$'); + $nbFiles = count($arrayoffiles); + $nbLinks = Link::count($db, $object->element, $object->id); + } // Add line with link to add new file or attach to an existing file print ''; @@ -2334,11 +2333,11 @@ if ($action == 'create') { print ''.$langs->trans("UploadANewFileNow"); print img_picto($langs->trans("UploadANewFileNow"), 'chevron-down', '', false, 0, 0, '', 'marginleftonly'); print ''; - if (empty($conf->global->EXPENSEREPORT_DISABLE_ATTACHMENT_ON_LINES)) { - print '   -   '.$langs->trans("AttachTheNewLineToTheDocument"); - print img_picto($langs->trans("AttachTheNewLineToTheDocument"), 'chevron-down', '', false, 0, 0, '', 'marginleftonly'); - print ''; - } + if (empty($conf->global->EXPENSEREPORT_DISABLE_ATTACHMENT_ON_LINES)) { + print '   -   '.$langs->trans("AttachTheNewLineToTheDocument"); + print img_picto($langs->trans("AttachTheNewLineToTheDocument"), 'chevron-down', '', false, 0, 0, '', 'marginleftonly'); + print ''; + } print ''."\n"; print ''."\n"; print ''; - include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_addfile.tpl.php'; include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_linktofile.tpl.php'; + include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_addfile.tpl.php'; print ''; print ''; print ''; - if (!empty($conf->projet->enabled)) { - print ''; - } + if (!empty($conf->projet->enabled)) { + print ''; + } print ''; - if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { - print ''; - } + if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { + print ''; + } print ''; print ''; print ''; @@ -2415,23 +2414,23 @@ if ($action == 'create') { print ''; // Select project - if (!empty($conf->projet->enabled)) { - print ''; - } + if (!empty($conf->projet->enabled)) { + print ''; + } // Select type print ''; - if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { - print ''; - } + if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { + print ''; + } // Add comments print ''; @@ -2465,15 +2464,15 @@ if ($action == 'create') { // Picture print ''; - if ($action != 'editline') { - print ''; - print ''; - } + if ($action != 'editline') { + print ''; + print ''; + } print ''; print ''; - } // Fin si c'est payé/validé + } // Fin si c'est payé/validé print '
    '.$langs->trans("CompanyIds").''.$langs->trans("Value").'
    '.$langs->trans("CompanyIds").''.$langs->trans("Value").'
    '; -print '
    '; print $form->textwithpicto($langs->trans("GDPRContact"), $langs->trans("GDPRContactDesc")); print ''; -print 'global->MAIN_INFO_GDPR) ? $conf->global->MAIN_INFO_GDPR : ''))).'">
    '; @@ -656,6 +659,7 @@ print ''; - print ''; - print $form->load_tva('vatrate', (GETPOSTISSET("vatrate") ? GETPOST("vatrate") : $line->vatrate), $mysoc, '', 0, 0, '', false, 1); - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''.$langs->trans('AmountHT').''.$langs->trans('AmountTTC').''; - //print $line->fk_ecm_files; - print ''; - print ''; - print ''; - print '
    '; - print '
    '; + print $form->selectDate($line->date, 'date'); + print ''; + $formproject->select_projects(-1, $line->fk_project, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth300'); + print ''; + print $formexpensereport->selectTypeExpenseReport($line->fk_c_type_fees, 'fk_c_type_fees'); + print ''; + $params = array('fk_expense' => $object->id, 'fk_expense_det' => $line->rowid, 'date' => $line->dates); + print $form->selectExpenseCategories($line->fk_c_exp_tax_cat, 'fk_c_exp_tax_cat', 1, array(), 'fk_c_type_fees', $userauthor->default_c_exp_tax_cat, $params); + print ''; + print ''; + print ''; + print $form->load_tva('vatrate', (GETPOSTISSET("vatrate") ? GETPOST("vatrate") : $line->vatrate), $mysoc, '', 0, 0, '', false, 1); + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''.$langs->trans('AmountHT').''.$langs->trans('AmountTTC').''; + //print $line->fk_ecm_files; + print ''; + print ''; + print ''; + print '
    '; + print '
    '.$langs->trans('Date').''.$form->textwithpicto($langs->trans('Project'), $langs->trans("ClosedProjectsAreHidden")).''.$form->textwithpicto($langs->trans('Project'), $langs->trans("ClosedProjectsAreHidden")).''.$langs->trans('Type').''.$langs->trans('CarCategory').''.$langs->trans('CarCategory').''.$langs->trans('Description').''.$langs->trans('VAT').''.$langs->trans('PriceUHT').''; - $formproject->select_projects(-1, $fk_project, 'fk_project', 0, 0, 1, -1, 0, 0, 0, '', 0, 0, 'maxwidth300'); - print ''; + $formproject->select_projects(-1, $fk_project, 'fk_project', 0, 0, 1, -1, 0, 0, 0, '', 0, 0, 'maxwidth300'); + print ''; print $formexpensereport->selectTypeExpenseReport($fk_c_type_fees, 'fk_c_type_fees', 1); print ''; - $params = array('fk_expense' => $object->id); - print $form->selectExpenseCategories('', 'fk_c_exp_tax_cat', 1, array(), 'fk_c_type_fees', $userauthor->default_c_exp_tax_cat, $params, 0); - print ''; + $params = array('fk_expense' => $object->id); + print $form->selectExpenseCategories('', 'fk_c_exp_tax_cat', 1, array(), 'fk_c_type_fees', $userauthor->default_c_exp_tax_cat, $params, 0); + print ''; @@ -2441,9 +2440,9 @@ if ($action == 'create') { // Select VAT print ''; $defaultvat = -1; - if (!empty($conf->global->EXPENSEREPORT_NO_DEFAULT_VAT)) { - $conf->global->MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS = 'none'; - } + if (!empty($conf->global->EXPENSEREPORT_NO_DEFAULT_VAT)) { + $conf->global->MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS = 'none'; + } print $form->load_tva('vatrate', ($vatrate != '' ? $vatrate : $defaultvat), $mysoc, '', 0, 0, '', false, 1); print '
    '; print '
    '; @@ -2501,11 +2500,15 @@ if ($action == 'create') { print ''; print dol_get_fiche_end(); - } - } else { - dol_print_error($db); } + } else { + dol_print_error($db); } +} else { + print 'Record not found'; + + llxFooter(); + exit(1); } /* diff --git a/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php b/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php index 640f4c17b5d..42be03263a8 100644 --- a/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php +++ b/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php @@ -18,6 +18,7 @@ if (empty($conf->global->EXPENSEREPORT_DISABLE_ATTACHMENT_ON_LINES)) { $modulepart = 'expensereport'; $maxheightmini = 48; $relativepath = (!empty($object->ref) ?dol_sanitizeFileName($object->ref) : '').'/'; $filei = 0; + // Loop on each attached file foreach ($arrayoffiles as $file) { $urlforhref = array(); $filei++; @@ -77,7 +78,7 @@ if (empty($conf->global->EXPENSEREPORT_DISABLE_ATTACHMENT_ON_LINES)) { } if (empty($urlforhref) || empty($thumbshown)) { - print ''; + print ''; } else { print ''; } @@ -85,7 +86,12 @@ if (empty($conf->global->EXPENSEREPORT_DISABLE_ATTACHMENT_ON_LINES)) { print $thumbshown ? $thumbshown : img_mime($minifile); - print '
    '; + print '
    '; + if (empty($urlforhref) || empty($thumbshown)) { + print ''; + } else { + print ''; + } } print '
    '; $checked = ''; @@ -106,7 +112,7 @@ if (empty($conf->global->EXPENSEREPORT_DISABLE_ATTACHMENT_ON_LINES)) { if (!empty($filenamelinked) && $filenamelinked == $file['relativename']) { $checked = ' checked'; } - print '
    '; + print '
    '; print ''; print '
    '; From bbb2cdfbdf19823d9a86d25c00b2960f68389437 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 19 Jun 2021 19:24:32 +0200 Subject: [PATCH 0736/1497] Prepare 13.0.4 --- 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 e6c0ef4a176..a24a404262e 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', '13.0.3'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c +if (!defined('DOL_VERSION')) define('DOL_VERSION', '13.0.4'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (!defined('EURO')) define('EURO', chr(128)); From 5d6b26ddb7474f991138df7b5472ee2a3ed5529d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 19 Jun 2021 19:45:13 +0200 Subject: [PATCH 0737/1497] Fix css --- htdocs/public/members/new.php | 8 ++++++-- htdocs/public/onlinesign/newonlinesign.php | 5 +++++ htdocs/public/payment/newpayment.php | 5 +++++ htdocs/public/payment/paymentko.php | 5 +++++ htdocs/public/payment/paymentok.php | 5 +++++ htdocs/public/recruitment/view.php | 5 +++++ 6 files changed, 31 insertions(+), 2 deletions(-) diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index cddfd0524b1..46aac8dce3b 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -119,14 +119,18 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $ if ($urllogo) { print '
    '; print '
    '; - print ''; + print ''; print '
    '; if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { print ''; } print '
    '; } + if (!empty($conf->global->MEMBER_IMAGE_PUBLIC_REGISTRATION)) { + print '
    '; + print ''; + print '
    '; + } print '
    '; print '
    '; diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index 56690f78a42..c656b04fef9 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -189,6 +189,11 @@ if ($urllogo) } print '
    '; } +if (!empty($conf->global->PROPOSAL_IMAGE_PUBLIC_SIGN)) { + print '
    '; + print ''; + print '
    '; +} // Output introduction text $text = ''; diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index bda291b8d8a..9cecbc90885 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -792,6 +792,11 @@ if ($urllogo) } print '
    '; } +if (!empty($conf->global->MAIN_IMAGE_PUBLIC_PAYMENT)) { + print '
    '; + print ''; + print '
    '; +} diff --git a/htdocs/public/payment/paymentko.php b/htdocs/public/payment/paymentko.php index b99c4a39392..218cf77215b 100644 --- a/htdocs/public/payment/paymentko.php +++ b/htdocs/public/payment/paymentko.php @@ -242,6 +242,11 @@ if ($urllogo) } print '
    '; } +if (!empty($conf->global->MAIN_IMAGE_PUBLIC_PAYMENT)) { + print '
    '; + print ''; + print '
    '; +} print '

    '; diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index f4b9f0feb5b..60d763593fe 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -182,6 +182,11 @@ if ($urllogo) } print '
    '; } +if (!empty($conf->global->MAIN_IMAGE_PUBLIC_PAYMENT)) { + print '
    '; + print ''; + print '
    '; +} print '


    '; diff --git a/htdocs/public/recruitment/view.php b/htdocs/public/recruitment/view.php index b8858b921e9..d1546dc4a02 100644 --- a/htdocs/public/recruitment/view.php +++ b/htdocs/public/recruitment/view.php @@ -216,6 +216,11 @@ if ($urllogo) } print '
    '; } +if (!empty($conf->global->RECRUITMENT_IMAGE_PUBLIC_PAYMENT)) { + print '
    '; + print ''; + print '
    '; +} // Output introduction text $text = ''; From 414b5e612fae0eae285dffab5d164b1ac5bc4bc5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 19 Jun 2021 22:11:16 +0200 Subject: [PATCH 0738/1497] Better info on upload size limit --- htdocs/core/class/html.formfile.class.php | 3 ++- htdocs/langs/en_US/main.lang | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 47506d5cbfa..83258f9c1cd 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -218,9 +218,10 @@ class FormFile if (!empty($conf->global->MAIN_UPLOAD_DOC)) { if ($perm) { + $menudolibarrsetupmax = $langs->transnoentitiesnoconv("Home").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("Security"); $langs->load('other'); $out .= ' '; - $out .= info_admin($langs->trans("ThisLimitIsDefinedInSetup", $max, $maxphptoshow), 1); + $out .= info_admin($langs->trans("ThisLimitIsDefinedInSetupAt", $menudolibarrsetupmax, $max, $maxphptoshowparam, $maxphptoshow), 1); } } else { $out .= ' ('.$langs->trans("UploadDisabled").')'; diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 23b1fb9413e..863b94af564 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -730,6 +730,7 @@ MenuMembers=Members MenuAgendaGoogle=Google agenda MenuTaxesAndSpecialExpenses=Taxes | Special expenses ThisLimitIsDefinedInSetup=Dolibarr limit (Menu home-setup-security): %s Kb, PHP limit: %s Kb +ThisLimitIsDefinedInSetupAt=Dolibarr limit (Menu %s): %s Kb, PHP limit (Param %s): %s Kb NoFileFound=No documents uploaded CurrentUserLanguage=Current language CurrentTheme=Current theme From 4a3da84098979afc2dd5655f3727d9df70fcf308 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 19 Jun 2021 23:52:52 +0200 Subject: [PATCH 0739/1497] Clean code --- htdocs/core/ajax/ajaxdirpreview.php | 11 +++---- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/class/html.formfile.class.php | 36 ++++++++++++++--------- htdocs/core/lib/functions.lib.php | 30 ++++++++++--------- htdocs/core/tpl/filemanager.tpl.php | 5 ++-- htdocs/website/index.php | 7 +++-- 6 files changed, 53 insertions(+), 38 deletions(-) diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index cf619f70de6..09292dd4991 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -54,8 +54,8 @@ if (!isset($mode) || $mode != 'noajax') { // For ajax call $search_doc_ref = GETPOST('search_doc_ref', 'alpha'); $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; - $sortfield = GETPOST("sortfield", 'alpha'); - $sortorder = GETPOST("sortorder", 'alpha'); + $sortfield = GETPOST("sortfield", 'aZ09comma'); + $sortorder = GETPOST("sortorder", 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); if (empty($page) || $page == -1) { $page = 0; @@ -82,8 +82,8 @@ if (!isset($mode) || $mode != 'noajax') { // For ajax call //exit; } } -} else // For no ajax call -{ +} else { + // For no ajax call $rootdirfordoc = $conf->ecm->dir_output; $ecmdir = new EcmDirectory($db); @@ -376,7 +376,7 @@ if ($type == 'directory') { // When we show list of files for ECM files, $filearray contains file list, and directory is defined with modulepart + section into $param // When we show list of files for a directory, $filearray ciontains file list, and directory is defined with modulepart + $relativepath //var_dump("section=".$section." title=".$title." modulepart=".$modulepart." useinecm=".$useinecm." perm=".$perm." relativepath=".$relativepath." param=".$param." url=".$url); - $formfile->list_of_documents($filearray, '', $modulepart, $param, 1, $relativepath, $perm, $useinecm, $textifempty, $maxlengthname, $title, $url, 0, $perm); + $formfile->list_of_documents($filearray, '', $modulepart, $param, 1, $relativepath, $perm, $useinecm, $textifempty, $maxlengthname, $title, $url, 0, $perm, '', $sortfield, $sortorder); } } @@ -430,6 +430,7 @@ if ($useajax || $action == 'delete') { } if ($useajax) { + print ''."\n"; print ''; + jQuery(document).ready(function () { + jQuery(".button_'.$name.'").click(function () { + console.log("Open popup with jQuery(...).dialog() on URL '.dol_escape_js(DOL_URL_ROOT.$url).'") + var $dialog = $(\'
    \').html(\'\') + .dialog({ + autoOpen: false, + modal: true, + height: (window.innerHeight - 150), + width: \'80%\', + title: "'.dol_escape_js($label).'" + }); + $dialog.dialog(\'open\'); + }); + }); + '; return $out; } diff --git a/htdocs/core/tpl/filemanager.tpl.php b/htdocs/core/tpl/filemanager.tpl.php index d8bbe0c7cc0..41e7c937d6a 100644 --- a/htdocs/core/tpl/filemanager.tpl.php +++ b/htdocs/core/tpl/filemanager.tpl.php @@ -128,7 +128,7 @@ $nameforformuserfile = 'formuserfileecm'; print '
    '; -// To attach new file +// For to attach a new file if ((!empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) || !empty($section)) { if ((empty($section) || $section == -1) && ($module != 'medias')) { ?> @@ -141,10 +141,11 @@ if ((!empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE } $sectiondir = GETPOST('file', 'alpha') ?GETPOST('file', 'alpha') : GETPOST('section_dir', 'alpha'); + print ''."\n"; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; $formfile = new FormFile($db); - $formfile->form_attach_new_file($_SERVER["PHP_SELF"], 'none', 0, ($section ? $section : -1), $permtoupload, 48, null, '', 0, '', 0, $nameforformuserfile, '', $sectiondir); + print $formfile->form_attach_new_file($_SERVER["PHP_SELF"], 'none', 0, ($section ? $section : -1), $permtoupload, 48, null, '', 0, '', 0, $nameforformuserfile, '', $sectiondir, 0, 0, 0, 1); } else { print ' '; } diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 9361aae865f..531a4a11d9f 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -403,8 +403,10 @@ if ($sortfield) { if ($sortorder) { $backtopage .= '&sortorder='.urlencode($sortorder); } -include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; +include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; // This manage 'sendit' action when submitting new file. + $backtopage = $savbacktopage; +//var_dump($backtopage); var_dump($action); if ($action == 'renamefile') { // Must be after include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; If action were renamefile, we set it to 'file_manager' $action = 'file_manager'; @@ -2647,7 +2649,7 @@ if (!GETPOST('hide_websitemenu')) { $out .= ' jQuery("#website").change(function () {'; $out .= ' console.log("We select "+jQuery("#website option:selected").val());'; $out .= ' if (jQuery("#website option:selected").val() == \'-2\') {'; - $out .= ' window.location.href = "'.$urltocreatenewwebsite.'";'; + $out .= ' window.location.href = "'.dol_escape_js($urltocreatenewwebsite).'";'; $out .= ' } else {'; $out .= ' window.location.href = "'.$_SERVER["PHP_SEFL"].'?website="+jQuery("#website option:selected").val();'; $out .= ' }'; @@ -4039,6 +4041,7 @@ if ($action == 'editfile' || $action == 'file_manager' || $action == 'convertimg print '

    '; //print '
    '.$langs->trans("FeatureNotYetAvailable").''; + $module = 'medias'; if (empty($url)) { $url = DOL_URL_ROOT.'/website/index.php'; // Must be an url without param From bf460526c055e5c44cb1f376614e0d3f16145eca Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Jun 2021 00:27:24 +0200 Subject: [PATCH 0740/1497] Add warning when submiting file larger than post_max_size. --- htdocs/core/actions_linkedfiles.inc.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/actions_linkedfiles.inc.php b/htdocs/core/actions_linkedfiles.inc.php index 750ed2b2d9a..e0bb6174948 100644 --- a/htdocs/core/actions_linkedfiles.inc.php +++ b/htdocs/core/actions_linkedfiles.inc.php @@ -26,6 +26,9 @@ //var_dump($upload_dir); //var_dump($upload_dirold); +if (GETPOST('uploadform', 'int') && empty($_FILES)) { + print "Error: The PHP parameter 'post_max_size' is too low. All POST parameters and FILES were set to empty.\n"; +} // Submit file/link if (GETPOST('sendit', 'alpha') && !empty($conf->global->MAIN_UPLOAD_DOC) && (!isset($permissiontoadd) || $permissiontoadd)) { From 0e80784de973f632de90eddf257394704e02aa6e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Jun 2021 00:32:25 +0200 Subject: [PATCH 0741/1497] Add warning to help understand bug of post_max_size. --- htdocs/core/actions_linkedfiles.inc.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/core/actions_linkedfiles.inc.php b/htdocs/core/actions_linkedfiles.inc.php index e0bb6174948..3e2438f63d3 100644 --- a/htdocs/core/actions_linkedfiles.inc.php +++ b/htdocs/core/actions_linkedfiles.inc.php @@ -26,8 +26,14 @@ //var_dump($upload_dir); //var_dump($upload_dirold); -if (GETPOST('uploadform', 'int') && empty($_FILES)) { - print "Error: The PHP parameter 'post_max_size' is too low. All POST parameters and FILES were set to empty.\n"; + +// Protection to understand what happen when submitting files larger than post_max_size +if (GETPOST('uploadform', 'int') && empty($_POST) && empty($_FILES)) { + dol_syslog("The PHP parameter 'post_max_size' is too low. All POST parameters and FILES were set to empty."); + $langs->loadLangs(array("errors", "install")); + print $langs->trans("ErrorFileSizeTooLarge").' '; + print $langs->trans("ErrorGoBackAndCorrectParameters"); + die; } // Submit file/link From 8df981504931e1808476c48b47a22486404c347c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Jun 2021 01:04:16 +0200 Subject: [PATCH 0742/1497] Add warning to help understand bug of post_max_size. --- htdocs/core/class/html.formfile.class.php | 4 +++- htdocs/core/tpl/filemanager.tpl.php | 3 ++- htdocs/website/index.php | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 9fde21d24de..7a1f2101ee7 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -77,7 +77,7 @@ class FormFile * @param string $htmlname Name and id of HTML form ('formuserfile' by default, 'formuserfileecm' when used to upload a file in ECM) * @param string $accept Specifies the types of files accepted (This is not a security check but an user interface facility. eg '.pdf,image/*' or '.png,.jpg' or 'video/*') * @param string $sectiondir If upload must be done inside a particular directory (if sectiondir defined, sectionid must not be) - * @param int $usewithoutform 0=Default, 1=Disable
    and style to use in existing area + * @param int $usewithoutform 0=Default, 1=Disable and to use in existing form area, 2=Disable the tag only * @param int $capture 1=Add tag capture="capture" to force use of micro or video recording to generate file. When setting this to 1, you must also provide a value for $accept. * @param int $disablemulti 0=Default, 1=Disable multiple file upload * @param int $nooutput 0=Output result with print, 1=Return result @@ -129,6 +129,8 @@ class FormFile $url .= (strpos($url, '?') === false ? '?' : '&').'uploadform=1'; $out .= ''."\n"; + } + if (empty($usewithoutform) || $usewithoutform == 2) { $out .= ''."\n"; $out .= ''."\n"; $out .= ''."\n"; diff --git a/htdocs/core/tpl/filemanager.tpl.php b/htdocs/core/tpl/filemanager.tpl.php index 41e7c937d6a..57a95c48ece 100644 --- a/htdocs/core/tpl/filemanager.tpl.php +++ b/htdocs/core/tpl/filemanager.tpl.php @@ -16,6 +16,7 @@ * * Output code for the filemanager * $module must be defined ('ecm', 'medias', ...) + * $formalreadyopen can be set to 1 to avoid to open the to submit files a second time */ // Protection to avoid direct call of template @@ -145,7 +146,7 @@ if ((!empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE print ''."\n"; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; $formfile = new FormFile($db); - print $formfile->form_attach_new_file($_SERVER["PHP_SELF"], 'none', 0, ($section ? $section : -1), $permtoupload, 48, null, '', 0, '', 0, $nameforformuserfile, '', $sectiondir, 0, 0, 0, 1); + print $formfile->form_attach_new_file($_SERVER["PHP_SELF"], 'none', 0, ($section ? $section : -1), $permtoupload, 48, null, '', 0, '', 0, $nameforformuserfile, '', $sectiondir, empty($formalreadyopen) ? 0 : $formalreadyopen, 0, 0, 1); } else { print ' '; } diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 531a4a11d9f..aa2b357a794 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2506,7 +2506,8 @@ $moreheadjs .= ''."\n"; llxHeader($moreheadcss.$moreheadjs, $langs->trans("WebsiteSetup"), $helpurl, '', 0, 0, $arrayofjs, $arrayofcss, '', '', ''."\n".'
    '); print "\n"; -print ''; +print ''."\n"; +print ''; print ''; print ''; @@ -4043,6 +4044,7 @@ if ($action == 'editfile' || $action == 'file_manager' || $action == 'convertimg $module = 'medias'; + $formalreadyopen = 2; // So the form to submit a new file will not be opened another time inside the core/tpl/filemanager.tpl.php if (empty($url)) { $url = DOL_URL_ROOT.'/website/index.php'; // Must be an url without param } From 597bdee0bc39263eb37b809c66a754152b6331c5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Jun 2021 01:39:07 +0200 Subject: [PATCH 0743/1497] Trans --- htdocs/langs/en_US/admin.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 4d28f2160c6..efe674e7ca8 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2144,3 +2144,4 @@ YouEnableDeprecatedWSAPIsUseRESTAPIsInstead=You enabled deprecated WS API. You s RandomlySelectedIfSeveral=Randomly selected if several pictures are available DatabasePasswordObfuscated=Database password is obfuscated in conf file DatabasePasswordNotObfuscated=Database password is NOT obfuscated in conf file +APIsAreNotEnabled=APIs modules are not enabled \ No newline at end of file From 2efd432946455daf5dd026d874a2f272cecded16 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Jun 2021 01:54:55 +0200 Subject: [PATCH 0744/1497] Fix list of security events enabled --- htdocs/admin/system/security.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index 3e01a99cb61..dcf980cf907 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -329,6 +329,7 @@ $securityevent = new Events($db); $eventstolog = $securityevent->eventstolog; print ''.$langs->trans("AuditedSecurityEvents").': '; +$out = ''; if (!empty($eventstolog) && is_array($eventstolog)) { // Loop on each event type $i = 0; @@ -338,18 +339,22 @@ if (!empty($eventstolog) && is_array($eventstolog)) { $value = empty($conf->global->$key) ? '' : $conf->global->$key; if ($value) { if ($i > 0) { - print ', '; + $out .= ', '; } - print ''.$key.''; + $out .= ''.$key.''; $i++; } } } - print '
    '; -} else { + print $out; +} + +if (empty($out)) { print img_warning().' '.$langs->trans("NoSecurityEventsAreAduited", $langs->transnoentities("Home").' - '.$langs->transnoentities("Setup").' - '.$langs->transnoentities("Audit")).'
    '; } +print '
    '; + // Modules/Applications From 4b6427f92041f76d4262babe53c4772d646bd202 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Jun 2021 01:55:56 +0200 Subject: [PATCH 0745/1497] Fix menu entry --- htdocs/admin/system/security.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index dcf980cf907..a838a107d82 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -350,7 +350,7 @@ if (!empty($eventstolog) && is_array($eventstolog)) { } if (empty($out)) { - print img_warning().' '.$langs->trans("NoSecurityEventsAreAduited", $langs->transnoentities("Home").' - '.$langs->transnoentities("Setup").' - '.$langs->transnoentities("Audit")).'
    '; + print img_warning().' '.$langs->trans("NoSecurityEventsAreAduited", $langs->transnoentities("Home").' - '.$langs->transnoentities("Setup").' - '.$langs->transnoentities("Security")).'
    '; } print '
    '; From 6e27ae6029b18c00667daf26bb8b37f271d9b6c2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Jun 2021 01:56:26 +0200 Subject: [PATCH 0746/1497] Fix path --- htdocs/admin/system/security.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index a838a107d82..0b2f2678521 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -350,7 +350,7 @@ if (!empty($eventstolog) && is_array($eventstolog)) { } if (empty($out)) { - print img_warning().' '.$langs->trans("NoSecurityEventsAreAduited", $langs->transnoentities("Home").' - '.$langs->transnoentities("Setup").' - '.$langs->transnoentities("Security")).'
    '; + print img_warning().' '.$langs->trans("NoSecurityEventsAreAduited", $langs->transnoentities("Home").' - '.$langs->transnoentities("Setup").' - '.$langs->transnoentities("Security").' - '.$langs->transnoentities("Audit")).'
    '; } print '
    '; From ce818d4f449833312b23eaa86519419e0a957e62 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Jun 2021 03:41:45 +0200 Subject: [PATCH 0747/1497] Debug doc templates of ODF --- .../mrp/doc/doc_generic_mo_odt.modules.php | 11 ++++++----- .../doc/doc_generic_myobject_odt.modules.php | 19 +++++++++++-------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php index 860e07d7d36..57c175a0112 100644 --- a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php +++ b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php @@ -175,7 +175,7 @@ class doc_generic_mo_odt extends ModelePDFMo $texte .= '
    '; // Show list of found files foreach ($listoffiles as $file) { - $texte .= '- '.$file['name'].' '.img_picto('', 'listlight').'
    '; + $texte .= '- '.$file['name'].' '.img_picto('', 'listlight').'
    '; } $texte .= '
    '; } @@ -284,7 +284,7 @@ class doc_generic_mo_odt extends ModelePDFMo //print "file=".$file; //print "conf->societe->dir_temp=".$conf->societe->dir_temp; - dol_mkdir($conf->bom->dir_temp); + dol_mkdir($conf->mrp->dir_temp); // If CUSTOMER contact defined on order, we use it @@ -379,14 +379,15 @@ class doc_generic_mo_odt extends ModelePDFMo foreach ($tmparray as $key => $value) { try { - if (preg_match('/logo$/', $key)) { // Image + if (preg_match('/logo$/', $key)) { + // Image if (file_exists($value)) { $odfHandler->setImage($key, $value); } else { $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - } else // Text - { + } else { + // Text $odfHandler->setVars($key, $value, true, 'UTF-8'); } } catch (OdfException $e) { diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php index d64c80c9355..3836381e5cc 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php @@ -86,7 +86,7 @@ class doc_generic_myobject_odt extends ModelePDFMyObject $this->marge_basse = 0; $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva COMMANDE_TVAOPTION + $this->option_tva = 0; // Gere option tva $this->option_modereg = 0; // Affiche mode reglement $this->option_condreg = 0; // Affiche conditions reglement $this->option_codeproduitservice = 0; // Affiche code produit-service @@ -135,7 +135,8 @@ class doc_generic_myobject_odt extends ModelePDFMyObject $tmpdir = trim($tmpdir); $tmpdir = preg_replace('/DOL_DATA_ROOT/', DOL_DATA_ROOT, $tmpdir); if (!$tmpdir) { - unset($listofdir[$key]); continue; + unset($listofdir[$key]); + continue; } if (!is_dir($tmpdir)) { $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); @@ -173,7 +174,7 @@ class doc_generic_myobject_odt extends ModelePDFMyObject if ($nbofiles) { $texte .= ''; } @@ -195,7 +196,7 @@ class doc_generic_myobject_odt extends ModelePDFMyObject /** * Function to build a document on disk using the generic odt module. * - * @param Commande $object Object source to build document + * @param MyObject $object Object source to build document * @param Translate $outputlangs Lang output object * @param string $srctemplatepath Full path of source filename for generator using a template file * @param int $hidedetails Do not show line details @@ -229,11 +230,11 @@ class doc_generic_myobject_odt extends ModelePDFMyObject $outputlangs->loadLangs(array("main", "dict", "companies", "bills")); - if ($conf->commande->dir_output) { + if ($conf->mymodule->dir_output) { // If $object is id instead of object if (!is_object($object)) { $id = $object; - $object = new Commande($this->db); + $object = new MyObject($this->db); $result = $object->fetch($id); if ($result < 0) { dol_print_error($this->db, $object->error); @@ -241,7 +242,9 @@ class doc_generic_myobject_odt extends ModelePDFMyObject } } - $dir = $conf->commande->multidir_output[isset($object->entity) ? $object->entity : 1]; + $object->fetch_thirdparty(); + + $dir = $conf->mymodule->multidir_output[isset($object->entity) ? $object->entity : 1]; $objectref = dol_sanitizeFileName($object->ref); if (!preg_match('/specimen/i', $objectref)) { $dir .= "/".$objectref; @@ -331,7 +334,7 @@ class doc_generic_myobject_odt extends ModelePDFMyObject $odfHandler = new odf( $srctemplatepath, array( - 'PATH_TO_TMP' => $conf->commande->dir_temp, + 'PATH_TO_TMP' => $conf->mymodule->dir_temp, 'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy. 'DELIMITER_LEFT' => '{', 'DELIMITER_RIGHT' => '}' From 1a6647e6909df223b9899b4c0d512d5cd24de80f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Jun 2021 04:10:25 +0200 Subject: [PATCH 0748/1497] Debug v14 --- htdocs/core/class/html.formfile.class.php | 6 +++--- htdocs/core/modules/mrp/modules_mo.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 7a1f2101ee7..04b104ff0f1 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -356,7 +356,7 @@ class FormFile * Return a string to show the box with list of available documents for object. * This also set the property $this->numoffiles * - * @param string $modulepart Module the files are related to ('propal', 'facture', 'facture_fourn', 'mymodule', 'mymodule:nameofsubmodule', 'mymodule_temp', ...) + * @param string $modulepart Module the files are related to ('propal', 'facture', 'facture_fourn', 'mymodule', 'mymodule:myobject', 'mymodule_temp', ...) * @param string $modulesubdir Existing (so sanitized) sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if file is not into subdir of module. * @param string $filedir Directory to scan * @param string $urlsource Url of origin page (for return) @@ -678,7 +678,7 @@ class FormFile $res = include_once $file; } - $class = 'ModelePDF'.$submodulepart; + $class = 'ModelePDF'.ucfirst($submodulepart); if (class_exists($class)) { $modellist = call_user_func($class.'::liste_modeles', $this->db); @@ -740,7 +740,7 @@ class FormFile if (($allowgenifempty || (is_array($modellist) && count($modellist) > 0)) && !empty($conf->global->MAIN_MULTILANGS) && !$forcenomultilang && (!empty($modellist) || $showempty)) { include_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; $formadmin = new FormAdmin($this->db); - $defaultlang = $codelang ? $codelang : $langs->getDefaultLang(); + $defaultlang = ($codelang && $codelang != 'auto') ? $codelang : $langs->getDefaultLang(); $morecss = 'maxwidth150'; if ($conf->browser->layout == 'phone') { $morecss = 'maxwidth100'; diff --git a/htdocs/core/modules/mrp/modules_mo.php b/htdocs/core/modules/mrp/modules_mo.php index 82a1a9f3b56..454df89bcde 100644 --- a/htdocs/core/modules/mrp/modules_mo.php +++ b/htdocs/core/modules/mrp/modules_mo.php @@ -52,7 +52,7 @@ abstract class ModelePDFMo extends CommonDocGenerator // phpcs:enable global $conf; - $type = 'mo'; + $type = 'mrp'; $list = array(); include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; From e3e2dfd7648fe5cd03714ce888be9b43026eb4ed Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Jun 2021 05:11:46 +0200 Subject: [PATCH 0749/1497] Fix generation of ODT (test if temporary directory is writable) --- .../core/class/commondocgenerator.class.php | 6 +-- htdocs/core/class/commonobject.class.php | 44 ++++++++++--------- .../barcode/doc/phpbarcode.modules.php | 5 +++ .../barcode/doc/tcpdfbarcode.modules.php | 6 +++ .../bom/doc/doc_generic_bom_odt.modules.php | 6 ++- .../doc/doc_generic_order_odt.modules.php | 6 ++- .../doc/doc_generic_contract_odt.modules.php | 6 ++- .../doc/doc_generic_shipment_odt.modules.php | 6 ++- .../doc/doc_generic_invoice_odt.modules.php | 6 ++- .../doc/doc_generic_member_odt.class.php | 6 ++- .../mrp/doc/doc_generic_mo_odt.modules.php | 16 +++++-- .../doc/doc_generic_product_odt.modules.php | 6 ++- .../doc/doc_generic_project_odt.modules.php | 5 +++ .../task/doc/doc_generic_task_odt.modules.php | 5 +++ .../doc/doc_generic_proposal_odt.modules.php | 6 ++- .../doc/doc_generic_reception_odt.modules.php | 6 ++- .../societe/doc/doc_generic_odt.modules.php | 5 +++ .../doc/doc_generic_stock_odt.modules.php | 6 ++- ...doc_generic_supplier_order_odt.modules.php | 8 +++- ..._generic_supplier_proposal_odt.modules.php | 6 ++- .../doc/doc_generic_ticket_odt.modules.php | 16 ++++--- .../user/doc/doc_generic_user_odt.modules.php | 6 ++- .../doc/doc_generic_usergroup_odt.modules.php | 6 ++- .../doc/doc_generic_myobject_odt.modules.php | 6 ++- htdocs/mrp/lib/mrp_mo.lib.php | 2 +- htdocs/mrp/mo_card.php | 17 ++++--- 26 files changed, 162 insertions(+), 57 deletions(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 6e91d9d175b..2a5e3391eb9 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -489,7 +489,7 @@ abstract class CommonDocGenerator $array_key.'_remain_to_pay'=>price2num($object->total_ttc - $remain_to_pay, 'MT') ); - if (method_exists($object, 'getTotalDiscount')) { + if (method_exists($object, 'getTotalDiscount') && in_array(get_class($object), array('Proposal', 'Commande', 'Facture', 'SupplierProposal', 'CommandeFournisseur', 'FactureFournisseur'))) { $resarray[$array_key.'_total_discount_ht_locale'] = price($object->getTotalDiscount(), 0, $outputlangs); $resarray[$array_key.'_total_discount_ht'] = price2num($object->getTotalDiscount()); } else { @@ -532,10 +532,10 @@ abstract class CommonDocGenerator } // @GS: Calculate total up and total discount percentage - // Note that this added fields correspond to nothing in Dolibarr (Dolibarr manage discount on lines not globally) + // Note that this added fields does not match a field into database in Dolibarr (Dolibarr manage discount on lines not as a global property of object) $resarray['object_total_up'] = $totalUp; $resarray['object_total_up_locale'] = price($resarray['object_total_up'], 0, $outputlangs); - if (method_exists($object, 'getTotalDiscount')) { + if (method_exists($object, 'getTotalDiscount') && in_array(get_class($object), array('Proposal', 'Commande', 'Facture', 'SupplierProposal', 'CommandeFournisseur', 'FactureFournisseur'))) { $totalDiscount = $object->getTotalDiscount(); } else { $totalDiscount = 0; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index c927b833c71..eeae94ff880 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4334,37 +4334,41 @@ abstract class CommonObject /** * Function that returns the total amount HT of discounts applied for all lines. * - * @return float + * @return float|string Total amout of discount */ public function getTotalDiscount() { - $total_discount = 0.00; + if (!empty($this->table_element_line) ) { + $total_discount = 0.00; - $sql = "SELECT subprice as pu_ht, qty, remise_percent, total_ht"; - $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element."det"; - $sql .= " WHERE ".$this->fk_element." = ".$this->id; + $sql = "SELECT subprice as pu_ht, qty, remise_percent, total_ht"; + $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element_line; + $sql .= " WHERE ".$this->fk_element." = ".$this->id; - dol_syslog(get_class($this).'::getTotalDiscount', LOG_DEBUG); - $resql = $this->db->query($sql); - if ($resql) { - $num = $this->db->num_rows($resql); - $i = 0; - while ($i < $num) { - $obj = $this->db->fetch_object($resql); + dol_syslog(get_class($this).'::getTotalDiscount', LOG_DEBUG); + $resql = $this->db->query($sql); + if ($resql) { + $num = $this->db->num_rows($resql); + $i = 0; + while ($i < $num) { + $obj = $this->db->fetch_object($resql); - $pu_ht = $obj->pu_ht; - $qty = $obj->qty; - $total_ht = $obj->total_ht; + $pu_ht = $obj->pu_ht; + $qty = $obj->qty; + $total_ht = $obj->total_ht; - $total_discount_line = floatval(price2num(($pu_ht * $qty) - $total_ht, 'MT')); - $total_discount += $total_discount_line; + $total_discount_line = floatval(price2num(($pu_ht * $qty) - $total_ht, 'MT')); + $total_discount += $total_discount_line; - $i++; + $i++; + } } + + //print $total_discount; exit; + return price2num($total_discount); } - //print $total_discount; exit; - return price2num($total_discount); + return null; } diff --git a/htdocs/core/modules/barcode/doc/phpbarcode.modules.php b/htdocs/core/modules/barcode/doc/phpbarcode.modules.php index 56c2a12fee6..fe36f7604c2 100644 --- a/htdocs/core/modules/barcode/doc/phpbarcode.modules.php +++ b/htdocs/core/modules/barcode/doc/phpbarcode.modules.php @@ -186,6 +186,11 @@ class modPhpbarcode extends ModeleBarCode global $conf, $filebarcode; dol_mkdir($conf->barcode->dir_temp); + if (!is_writable($conf->barcode->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->barcode->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } $file = $conf->barcode->dir_temp.'/barcode_'.$code.'_'.$encoding.'.png'; diff --git a/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php b/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php index 90b7cd4f543..df9ec39546d 100644 --- a/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php +++ b/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php @@ -158,6 +158,12 @@ class modTcpdfbarcode extends ModeleBarCode global $conf, $_GET; dol_mkdir($conf->barcode->dir_temp); + if (!is_writable($conf->barcode->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->barcode->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } + $file = $conf->barcode->dir_temp.'/barcode_'.$code.'_'.$encoding.'.png'; $tcpdfEncoding = $this->getTcpdfEncodingType($encoding); diff --git a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php index 30d93aedfa0..ce85203930f 100644 --- a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php +++ b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php @@ -278,7 +278,11 @@ class doc_generic_bom_odt extends ModelePDFBom //print "conf->societe->dir_temp=".$conf->societe->dir_temp; dol_mkdir($conf->bom->dir_temp); - + if (!is_writable($conf->bom->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->bom->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } // If CUSTOMER contact defined on order, we use it $usecontact = false; diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index 603394b9797..e7fe92ba9f9 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -290,7 +290,11 @@ class doc_generic_order_odt extends ModelePDFCommandes //print "conf->societe->dir_temp=".$conf->societe->dir_temp; dol_mkdir($conf->commande->dir_temp); - + if (!is_writable($conf->commande->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->commande->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } // If CUSTOMER contact defined on order, we use it $usecontact = false; diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php index 2b3e2905907..c8d1748124a 100644 --- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php +++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php @@ -278,7 +278,11 @@ class doc_generic_contract_odt extends ModelePDFContract //print "conf->contrat->dir_temp=".$conf->contrat->dir_temp; dol_mkdir($conf->contrat->dir_temp); - + if (!is_writable($conf->contrat->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->contrat->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } // If CUSTOMER contact defined on contract, we use it $usecontact = false; diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php index 163392ead88..2eaca54b697 100644 --- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php +++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php @@ -290,7 +290,11 @@ class doc_generic_shipment_odt extends ModelePdfExpedition //print "conf->societe->dir_temp=".$conf->societe->dir_temp; dol_mkdir($conf->expedition->dir_temp); - + if (!is_writable($conf->expedition->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->expedition->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } // If SHIPMENT contact defined on invoice, we use it $usecontact = false; diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index ffba0717332..98269a0f019 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -291,7 +291,11 @@ class doc_generic_invoice_odt extends ModelePDFFactures //print "conf->societe->dir_temp=".$conf->societe->dir_temp; dol_mkdir($conf->facture->dir_temp); - + if (!is_writable($conf->facture->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->facture->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } // If BILLING contact defined on invoice, we use it $usecontact = false; diff --git a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php index 9a14e96bc28..120efe93cf7 100644 --- a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php +++ b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php @@ -279,7 +279,11 @@ class doc_generic_member_odt extends ModelePDFMember //print "conf->adherent->dir_temp=".$conf->adherent->dir_temp; dol_mkdir($conf->adherent->dir_temp); - + if (!is_writable($conf->adherent->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->adherent->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } // If CUSTOMER contact defined on member, we use it $usecontact = false; diff --git a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php index 57c175a0112..ac920d69269 100644 --- a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php +++ b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php @@ -285,7 +285,11 @@ class doc_generic_mo_odt extends ModelePDFMo //print "conf->societe->dir_temp=".$conf->societe->dir_temp; dol_mkdir($conf->mrp->dir_temp); - + if (!is_writable($conf->mrp->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->mrp->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } // If CUSTOMER contact defined on order, we use it $usecontact = false; @@ -342,11 +346,13 @@ class doc_generic_mo_odt extends ModelePDFMo dol_syslog($e->getMessage(), LOG_INFO); return -1; } + // After construction $odfHandler->contentXml contains content and // [!-- BEGIN row.lines --]*[!-- END row.lines --] has been replaced by // [!-- BEGIN lines --]*[!-- END lines --] //print html_entity_decode($odfHandler->__toString()); //print exit; + /* // Make substitutions into odt of freetext @@ -394,6 +400,7 @@ class doc_generic_mo_odt extends ModelePDFMo dol_syslog($e->getMessage(), LOG_INFO); } } + // Replace tags of lines try { $foundtagforlines = 1; @@ -404,6 +411,7 @@ class doc_generic_mo_odt extends ModelePDFMo $foundtagforlines = 0; dol_syslog($e->getMessage(), LOG_INFO); } + if ($foundtagforlines) { $linenumber = 0; foreach ($object->lines as $line) { @@ -446,14 +454,14 @@ class doc_generic_mo_odt extends ModelePDFMo $parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray); $reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks - + */ // Write new file if (!empty($conf->global->MAIN_ODT_AS_PDF)) { try { $odfHandler->exportAsAttachedPDF($file); } catch (Exception $e) { $this->error = $e->getMessage(); - dol_syslog($e->getMessage(), LOG_INFO); + dol_syslog('Error in exportAsAttachedPDF: '.$e->getMessage(), LOG_INFO); return -1; } } else { @@ -461,7 +469,7 @@ class doc_generic_mo_odt extends ModelePDFMo $odfHandler->saveToDisk($file); } catch (Exception $e) { $this->error = $e->getMessage(); - dol_syslog($e->getMessage(), LOG_INFO); + dol_syslog('Error in saveToDisk: '.$e->getMessage(), LOG_INFO); return -1; } } diff --git a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php index d038acd7ee5..b2d45a7ab6e 100644 --- a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php +++ b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php @@ -302,7 +302,11 @@ class doc_generic_product_odt extends ModelePDFProduct //print "conf->product->dir_temp=".$conf->product->dir_temp; dol_mkdir($conf->product->dir_temp); - + if (!is_writable($conf->product->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->product->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } // If CUSTOMER contact defined on product, we use it $usecontact = false; diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index c085f1eeaac..52d56812d68 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -574,6 +574,11 @@ class doc_generic_project_odt extends ModelePDFProjects //print "conf->societe->dir_temp=".$conf->societe->dir_temp; dol_mkdir($conf->projet->dir_temp); + if (!is_writable($conf->projet->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->projet->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } // If PROJECTLEADER contact defined on project, we use it $usecontact = false; diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index a04e2e9c14a..961dab003e1 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -524,6 +524,11 @@ class doc_generic_task_odt extends ModelePDFTask //print "conf->societe->dir_temp=".$conf->societe->dir_temp; dol_mkdir($conf->projet->dir_temp); + if (!is_writable($conf->task->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->task->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } $socobject = $project->thirdparty; diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index e7eade5de02..e892e9a7252 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -318,7 +318,11 @@ class doc_generic_proposal_odt extends ModelePDFPropales //print "conf->propal->dir_temp=".$conf->propal->dir_temp; dol_mkdir($conf->propal->multidir_temp[$object->entity]); - + if (!is_writable($conf->propal->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->propal->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } // If CUSTOMER contact defined on proposal, we use it $usecontact = false; diff --git a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php index d70ecca00ad..a6701fe8bcd 100644 --- a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php +++ b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php @@ -282,7 +282,11 @@ class doc_generic_reception_odt extends ModelePdfReception //print "conf->societe->dir_temp=".$conf->societe->dir_temp; dol_mkdir($conf->reception->dir_temp); - + if (!is_writable($conf->reception->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->reception->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } // If BILLING contact defined on invoice, we use it $usecontact = false; diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php index 9045ed0b281..900c7e465df 100644 --- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php +++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php @@ -266,6 +266,11 @@ class doc_generic_odt extends ModeleThirdPartyDoc //exit; dol_mkdir($conf->societe->multidir_temp[$object->entity]); + if (!is_writable($conf->societe->multidir_temp[$object->entity])) { + $this->error = "Failed to write in temp directory ".$conf->societe->multidir_temp[$object->entity]; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } // Open and load template require_once ODTPHP_PATH.'odf.php'; diff --git a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php index e2d474d2dd2..ccd66610f55 100644 --- a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php +++ b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php @@ -291,7 +291,11 @@ class doc_generic_stock_odt extends ModelePDFStock //print "conf->product->dir_temp=".$conf->product->dir_temp; dol_mkdir($conf->product->dir_temp); - + if (!is_writable($conf->product->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->product->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } // If CUSTOMER contact defined on stock, we use it $usecontact = false; diff --git a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php index b7fd399edef..285ea50bebe 100644 --- a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php +++ b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php @@ -280,8 +280,12 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders //print "file=".$file; //print "conf->societe->dir_temp=".$conf->societe->dir_temp; - dol_mkdir($conf->commande->dir_temp); - + dol_mkdir($conf->fournisseur->commande->dir_temp); + if (!is_writable($conf->fournisseur->commande->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->fournisseur->commande->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } // If CUSTOMER contact defined on order, we use it $usecontact = false; diff --git a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php index 7e300c68643..ead5664c04a 100644 --- a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php @@ -315,7 +315,11 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal //print "conf->propal->dir_temp=".$conf->propal->dir_temp; dol_mkdir($conf->supplier_proposal->dir_temp); - + if (!is_writable($conf->supplier_proposal->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->supplier_proposal->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } // If BILLING contact defined on invoice, we use it $usecontact = false; diff --git a/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php b/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php index d1d3763fb2e..1bb48b82b42 100644 --- a/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php +++ b/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php @@ -222,7 +222,7 @@ class doc_generic_ticket_odt extends ModelePDFTicket // Load translation files required by the page $outputlangs->loadLangs(array("main", "companies", "bills", "dict")); - if ($conf->user->dir_output) { + if ($conf->ticket->dir_output) { // If $object is id instead of object if (!is_object($object)) { $id = $object; @@ -236,7 +236,7 @@ class doc_generic_ticket_odt extends ModelePDFTicket $object->fetch_thirdparty(); - $dir = $conf->user->dir_output; + $dir = $conf->ticket->dir_output; $objectref = dol_sanitizeFileName($object->ref); if (!preg_match('/specimen/i', $objectref)) { $dir .= "/".$objectref; @@ -274,10 +274,14 @@ class doc_generic_ticket_odt extends ModelePDFTicket //print "newdir=".$dir; //print "newfile=".$newfile; //print "file=".$file; - //print "conf->user->dir_temp=".$conf->user->dir_temp; - - dol_mkdir($conf->user->dir_temp); + //print "conf->ticket->dir_temp=".$conf->ticket->dir_temp; + dol_mkdir($conf->ticket->dir_temp); + if (!is_writable($conf->ticket->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->ticket->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } // If CUSTOMER contact defined on user, we use it $usecontact = false; @@ -306,7 +310,7 @@ class doc_generic_ticket_odt extends ModelePDFTicket $odfHandler = new odf( $srctemplatepath, array( - 'PATH_TO_TMP' => $conf->user->dir_temp, + 'PATH_TO_TMP' => $conf->ticket->dir_temp, 'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy. 'DELIMITER_LEFT' => '{', 'DELIMITER_RIGHT' => '}' diff --git a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php index 035a99fe744..80bbd0f2905 100644 --- a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php +++ b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php @@ -309,7 +309,11 @@ class doc_generic_user_odt extends ModelePDFUser //print "conf->user->dir_temp=".$conf->user->dir_temp; dol_mkdir($conf->user->dir_temp); - + if (!is_writable($conf->user->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->user->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } // If CUSTOMER contact defined on user, we use it $usecontact = false; diff --git a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php index 04d9957458b..9ea1a27f045 100644 --- a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php +++ b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php @@ -299,7 +299,11 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup //print "conf->user->dir_temp=".$conf->user->dir_temp; dol_mkdir($conf->user->dir_temp); - + if (!is_writable($conf->user->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->user->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } // If CUSTOMER contact defined on user, we use it $usecontact = false; diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php index 3836381e5cc..a74de9d7f9b 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php @@ -284,7 +284,11 @@ class doc_generic_myobject_odt extends ModelePDFMyObject //print "conf->societe->dir_temp=".$conf->societe->dir_temp; dol_mkdir($conf->mymodule->dir_temp); - + if (!is_writable($conf->mymodule->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->mymodule->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } // If CUSTOMER contact defined on order, we use it $usecontact = false; diff --git a/htdocs/mrp/lib/mrp_mo.lib.php b/htdocs/mrp/lib/mrp_mo.lib.php index 62f74ce016e..8fe07df89c1 100644 --- a/htdocs/mrp/lib/mrp_mo.lib.php +++ b/htdocs/mrp/lib/mrp_mo.lib.php @@ -78,7 +78,7 @@ function moPrepareHead($object) require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; - $upload_dir = $conf->mrp->dir_output."/mo/".dol_sanitizeFileName($object->ref); + $upload_dir = $conf->mrp->dir_output."/".dol_sanitizeFileName($object->ref); $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); $nbLinks = Link::count($db, $object->element, $object->id); $head[$h][0] = dol_buildpath("/mrp/mo_document.php", 1).'?id='.$object->id; diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index 093604df9a1..fad22645cd5 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -138,6 +138,16 @@ if (empty($reshook)) { // Actions when printing a doc from card include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; + // Action to build doc + include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; + + if ($action == 'set_thirdparty' && $permissiontoadd) { + $object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, 'MO_MODIFY'); + } + if ($action == 'classin' && $permissiontoadd) { + $object->setProject(GETPOST('projectid', 'int')); + } + // Actions to send emails $triggersendname = 'MO_SENTBYMAIL'; $autocopy = 'MAIN_MAIL_AUTOCOPY_MO_TO'; @@ -147,13 +157,6 @@ if (empty($reshook)) { // Action to move up and down lines of object //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once - if ($action == 'set_thirdparty' && $permissiontoadd) { - $object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, 'MO_MODIFY'); - } - if ($action == 'classin' && $permissiontoadd) { - $object->setProject(GETPOST('projectid', 'int')); - } - // Action close produced if ($action == 'confirm_produced' && $confirm == 'yes' && $permissiontoadd) { $result = $object->setStatut($object::STATUS_PRODUCED, 0, '', 'MRP_MO_PRODUCED'); From e61d60e12546085957194dc2b221b71b8aa8860f Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 20 Jun 2021 10:49:05 +0200 Subject: [PATCH 0750/1497] internationalization --- .../supplier_order/doc/pdf_cornas.modules.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php index 245897e1956..dc898c98cb5 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -148,13 +148,13 @@ class pdf_cornas extends ModelePDFSuppliersOrders $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION - $this->option_modereg = 1; // Affiche mode reglement - $this->option_condreg = 1; // Affiche conditions reglement - $this->option_codeproduitservice = 1; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION + $this->option_modereg = 1; // Display payment mode + $this->option_condreg = 1; // Display payment terms + $this->option_codeproduitservice = 1; // Display product-service code + $this->option_multilang = 1; //Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 1; // Support add of a watermark on drafts From fa3e75c68a4fa5b353db18b06e02889618984c88 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 20 Jun 2021 10:58:20 +0200 Subject: [PATCH 0751/1497] internationalization --- .../doc/doc_generic_myobject_odt.modules.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php index a74de9d7f9b..b7ea52d939d 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php @@ -85,13 +85,13 @@ class doc_generic_myobject_odt extends ModelePDFMyObject $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva - $this->option_modereg = 0; // Affiche mode reglement - $this->option_condreg = 0; // Affiche conditions reglement - $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION + $this->option_modereg = 0; // Display payment mode + $this->option_condreg = 0; // Display payment terms + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts From 33ffb8b943e40f49a8bcceded6b21017e889ab7e Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 20 Jun 2021 11:01:38 +0200 Subject: [PATCH 0752/1497] internationalization --- htdocs/core/modules/bank/doc/pdf_ban.modules.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/bank/doc/pdf_ban.modules.php b/htdocs/core/modules/bank/doc/pdf_ban.modules.php index 1bbf2e14cc0..a87817cdc73 100644 --- a/htdocs/core/modules/bank/doc/pdf_ban.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_ban.modules.php @@ -72,9 +72,9 @@ class pdf_ban extends ModeleBankAccountDoc $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; - $this->option_logo = 1; // Affiche logo FAC_PDF_LOGO - $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION - $this->option_codeproduitservice = 1; // Affiche code produit-service + $this->option_logo = 1; // Display logo FAC_PDF_LOGO + $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION + $this->option_codeproduitservice = 1; // Display product-service code // Retrieves transmitter $this->emetteur = $mysoc; From e5f43cc67890430c43150fb42aaef8bb3ce14926 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 20 Jun 2021 11:03:28 +0200 Subject: [PATCH 0753/1497] internationalization --- htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php index f1ebc5bf64f..49e311f1c89 100644 --- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php @@ -75,9 +75,9 @@ class pdf_sepamandate extends ModeleBankAccountDoc $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; - $this->option_logo = 1; // Affiche logo FAC_PDF_LOGO - $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION - $this->option_codeproduitservice = 1; // Affiche code produit-service + $this->option_logo = 1; // Display logo FAC_PDF_LOGO + $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION + $this->option_codeproduitservice = 1; //Display product-service code // Retrieves transmitter $this->emetteur = $mysoc; From f4199ca99ee4a14de5184e54ee06f089db318445 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 20 Jun 2021 11:06:04 +0200 Subject: [PATCH 0754/1497] internationalization --- .../doc/doc_generic_order_odt.modules.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index e7fe92ba9f9..239ec7639ec 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -3,7 +3,7 @@ * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2014 Marcos García * Copyright (C) 2016 Charlie Benke - * Copyright (C) 2018-2019 Philippe Grand + * Copyright (C) 2018-2021 Philippe Grand * Copyright (C) 2018-2019 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -85,13 +85,13 @@ class doc_generic_order_odt extends ModelePDFCommandes $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva COMMANDE_TVAOPTION - $this->option_modereg = 0; // Affiche mode reglement - $this->option_condreg = 0; // Affiche conditions reglement - $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat option COMMANDE_TVAOPTION + $this->option_modereg = 0; // Display payment mode + $this->option_condreg = 0; // Display payment terms + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts From d3a9b03c89fd20870892b5b235d5746eb41c5502 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 20 Jun 2021 11:08:53 +0200 Subject: [PATCH 0755/1497] internationalization --- .../doc/doc_generic_contract_odt.modules.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php index c8d1748124a..b1e441175d9 100644 --- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php +++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php @@ -84,13 +84,13 @@ class doc_generic_contract_odt extends ModelePDFContract $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva CONTRACT_TVAOPTION - $this->option_modereg = 0; // Affiche mode reglement - $this->option_condreg = 0; // Affiche conditions reglement - $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat CONTRACT_TVAOPTION + $this->option_modereg = 0; // Display payment mode + $this->option_condreg = 0; // Display payment terms + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts From e2ef205036fe641326a0620557e18635a053071d Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 20 Jun 2021 11:11:41 +0200 Subject: [PATCH 0756/1497] internationalization --- .../doc/doc_generic_shipment_odt.modules.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php index 2eaca54b697..8a2b6b2b121 100644 --- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php +++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php @@ -3,7 +3,7 @@ * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2014 Marcos García * Copyright (C) 2016 Charlie Benke - * Copyright (C) 2018-2019 Philippe Grand + * Copyright (C) 2018-2021 Philippe Grand * Copyright (C) 2018-2019 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -86,13 +86,13 @@ class doc_generic_shipment_odt extends ModelePdfExpedition $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva EXPEDITION_TVAOPTION - $this->option_modereg = 0; // Affiche mode reglement - $this->option_condreg = 0; // Affiche conditions reglement - $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat option EXPEDITION_TVAOPTION + $this->option_modereg = 0; // Display payment mode + $this->option_condreg = 0; // Display payment terms + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts From 0d60323e4101df3d7861889069f8ca25d14038cf Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 20 Jun 2021 11:13:31 +0200 Subject: [PATCH 0757/1497] internationalization --- htdocs/core/modules/expedition/doc/pdf_espadon.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 42999248026..aed43ea40ac 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -139,7 +139,7 @@ class pdf_espadon extends ModelePdfExpedition $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; - $this->option_logo = 1; + $this->option_logo = 1; // Display logo // Get source company $this->emetteur = $mysoc; From f8187eb70e86436bf671fba5cbdaf09a80e43b7e Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 20 Jun 2021 11:16:03 +0200 Subject: [PATCH 0758/1497] internationalization --- .../expensereport/doc/pdf_standard.modules.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index 1815321ab18..b1f48450d0d 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -1,7 +1,7 @@ * Copyright (C) 2015 Alexandre Spangaro - * Copyright (C) 2016-2019 Philippe Grand + * Copyright (C) 2016-2021 Philippe Grand * Copyright (C) 2018-2020 Frédéric France * Copyright (C) 2018 Francis Appels * Copyright (C) 2019 Markus Welters @@ -151,13 +151,13 @@ class pdf_standard extends ModeleExpenseReport $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION - $this->option_modereg = 1; // Affiche mode reglement - $this->option_condreg = 1; // Affiche conditions reglement - $this->option_codeproduitservice = 1; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION + $this->option_modereg = 1; // Display payment mode + $this->option_condreg = 1; // Display payment terms + $this->option_codeproduitservice = 1; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 1; // Support add of a watermark on drafts From 5977fe23e72ca138e30e21fcdd026c4a1485ca78 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 20 Jun 2021 11:18:07 +0200 Subject: [PATCH 0759/1497] internationalization --- .../doc/doc_generic_invoice_odt.modules.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index 98269a0f019..0d360269d46 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -85,13 +85,13 @@ class doc_generic_invoice_odt extends ModelePDFFactures $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva FACTURE_TVAOPTION - $this->option_modereg = 0; // Affiche mode reglement - $this->option_condreg = 0; // Affiche conditions reglement - $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION + $this->option_modereg = 0; // Display payment mode + $this->option_condreg = 0; // Display payment terms + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts From e5083d18af86f8610ae5ba114011dc990df46b22 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 20 Jun 2021 11:20:20 +0200 Subject: [PATCH 0760/1497] internationalization --- .../member/doc/doc_generic_member_odt.class.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php index 120efe93cf7..939c78f32e3 100644 --- a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php +++ b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php @@ -81,13 +81,13 @@ class doc_generic_member_odt extends ModelePDFMember $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva MEMBER_TVAOPTION - $this->option_modereg = 0; // Affiche mode reglement - $this->option_condreg = 0; // Affiche conditions reglement - $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION + $this->option_modereg = 0; // Display payment mode + $this->option_condreg = 0; // Display payment terms + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts From 9acbb984a1f9c54a45e5f93af0110f7565572264 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 20 Jun 2021 11:22:17 +0200 Subject: [PATCH 0761/1497] internationalization --- htdocs/core/modules/movement/doc/pdf_standard.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/movement/doc/pdf_standard.modules.php b/htdocs/core/modules/movement/doc/pdf_standard.modules.php index 872890958ff..e029c4d5d66 100644 --- a/htdocs/core/modules/movement/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/movement/doc/pdf_standard.modules.php @@ -137,12 +137,12 @@ class pdf_stdandard extends ModelePDFMovement $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; - $this->option_logo = 1; // Affiche logo - $this->option_codestockservice = 0; // Affiche code stock-service - $this->option_multilang = 1; // Dispo en plusieurs langues + $this->option_logo = 1; // Display logo + $this->option_codestockservice = 0; // Display stock-service code + $this->option_multilang = 1; // Available in several languages $this->option_freetext = 0; // Support add of a personalised text - // Recupere emetteur + // Get source company $this->emetteur = $mysoc; if (!$this->emetteur->country_code) { $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined From ddaa9ecfc1a5b85a336b97761bba6ce284bfe3a2 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 20 Jun 2021 11:24:36 +0200 Subject: [PATCH 0762/1497] internationalization --- .../mrp/doc/doc_generic_mo_odt.modules.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php index ac920d69269..e93ecd1af0a 100644 --- a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php +++ b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php @@ -3,7 +3,7 @@ * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2014 Marcos García * Copyright (C) 2016 Charlie Benke - * Copyright (C) 2018-2019 Philippe Grand + * Copyright (C) 2018-2021 Philippe Grand * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -85,18 +85,18 @@ class doc_generic_mo_odt extends ModelePDFMo $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva - $this->option_modereg = 0; // Affiche mode reglement - $this->option_condreg = 0; // Affiche conditions reglement - $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat option + $this->option_modereg = 0; // Display payment mode + $this->option_condreg = 0; // Display payment terms + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts - // Recupere emetteur + // Get source company $this->emetteur = $mysoc; if (!$this->emetteur->country_code) { $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined From 93512fd501c21180233b419e9d35265a9086947f Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 20 Jun 2021 11:26:25 +0200 Subject: [PATCH 0763/1497] internationalization --- .../doc/doc_generic_product_odt.modules.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php index b2d45a7ab6e..1acf50dd95a 100644 --- a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php +++ b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php @@ -83,18 +83,18 @@ class doc_generic_product_odt extends ModelePDFProduct $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva PRODUCT_TVAOPTION - $this->option_modereg = 0; // Affiche mode reglement - $this->option_condreg = 0; // Affiche conditions reglement - $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat option PRODUCT_TVAOPTION + $this->option_modereg = 0; // Display payment mode + $this->option_condreg = 0; // Display payment terms + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts - // Recupere emetteur + // Get source company $this->emetteur = $mysoc; if (!$this->emetteur->country_code) { $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined From 9ccc9d0d3d44dff8addf1244ee9fd4d125dabb3f Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 20 Jun 2021 11:27:49 +0200 Subject: [PATCH 0764/1497] internationalization --- htdocs/core/modules/product/doc/pdf_standard.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php index 99b6ff69236..815fc4d1c66 100644 --- a/htdocs/core/modules/product/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php @@ -137,12 +137,12 @@ class pdf_standard extends ModelePDFProduct $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; - $this->option_logo = 1; // Affiche logo - $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues + $this->option_logo = 1; // Display logo + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 1; // Available in several languages $this->option_freetext = 0; // Support add of a personalised text - // Recupere emetteur + // Get source company $this->emetteur = $mysoc; if (!$this->emetteur->country_code) { $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined From 12079447618448e0956bcaa655f30f96808fd5b9 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 20 Jun 2021 11:29:47 +0200 Subject: [PATCH 0765/1497] internationalization --- .../doc/doc_generic_project_odt.modules.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index 52d56812d68..233180630b0 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -120,18 +120,18 @@ class doc_generic_project_odt extends ModelePDFProjects $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva COMMANDE_TVAOPTION - $this->option_modereg = 0; // Affiche mode reglement - $this->option_condreg = 0; // Affiche conditions reglement - $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat option COMMANDE_TVAOPTION + $this->option_modereg = 0; // Display payment mode + $this->option_condreg = 0; // Display payment terms + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts - // Recupere emetteur + // Get source company $this->emetteur = $mysoc; if (!$this->emetteur->pays_code) { $this->emetteur->pays_code = substr($langs->defaultlang, -2); // Par defaut, si n'etait pas defini From 748c10c2f9722c9560745f0f2e2f6f5b5d4a7c11 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 20 Jun 2021 11:32:25 +0200 Subject: [PATCH 0766/1497] internationalization --- .../task/doc/doc_generic_task_odt.modules.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index 961dab003e1..566c7f07a2e 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -121,21 +121,21 @@ class doc_generic_task_odt extends ModelePDFTask $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva COMMANDE_TVAOPTION - $this->option_modereg = 0; // Affiche mode reglement - $this->option_condreg = 0; // Affiche conditions reglement - $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 0; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat option COMMANDE_TVAOPTION + $this->option_modereg = 0; // Display payment mode + $this->option_condreg = 0; // Display payment terms + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 0; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts - // Recupere emetteur + // Get source company $this->emetteur = $mysoc; if (!$this->emetteur->pays_code) { - $this->emetteur->pays_code = substr($langs->defaultlang, -2); // Par defaut, si n'etait pas defini + $this->emetteur->pays_code = substr($langs->defaultlang, -2); // By default, if was not defined } } From 14af45057cfb8f5796f9159b8908f70191520995 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 20 Jun 2021 11:35:37 +0200 Subject: [PATCH 0767/1497] internationalization --- .../doc/doc_generic_proposal_odt.modules.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index e892e9a7252..9c7e0af4df0 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -82,18 +82,18 @@ class doc_generic_proposal_odt extends ModelePDFPropales $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva PROPALE_TVAOPTION - $this->option_modereg = 0; // Affiche mode reglement - $this->option_condreg = 0; // Affiche conditions reglement - $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat option PROPALE_TVAOPTION + $this->option_modereg = 0; // Display payment mode + $this->option_condreg = 0; // Display payment terms + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts - // Recupere emetteur + // Get source company $this->emetteur = $mysoc; if (!$this->emetteur->country_code) { $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined From b07d2f257a9f00633ac65598e0f318279c15eeb6 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 20 Jun 2021 11:37:51 +0200 Subject: [PATCH 0768/1497] internationalization --- .../doc/doc_generic_reception_odt.modules.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php index a6701fe8bcd..93dbc4995b4 100644 --- a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php +++ b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php @@ -80,18 +80,18 @@ class doc_generic_reception_odt extends ModelePdfReception $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva RECEPTION_TVAOPTION - $this->option_modereg = 0; // Affiche mode reglement - $this->option_condreg = 0; // Affiche conditions reglement - $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat option RECEPTION_TVAOPTION + $this->option_modereg = 0; // Display payment mode + $this->option_condreg = 0; // Display payment terms + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts - // Recupere emetteur + // Get source company $this->emetteur = $mysoc; if (!$this->emetteur->country_code) { $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined From 057e78d8c37a8eb2920a88cefd6977f583f35f04 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 20 Jun 2021 11:40:54 +0200 Subject: [PATCH 0769/1497] internationalization --- htdocs/core/modules/reception/doc/pdf_squille.modules.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index 0e4474b6b8c..f7ba7a42842 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -32,7 +32,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; */ class pdf_squille extends ModelePdfReception { - public $emetteur; // Objet societe qui emet + /** + * Issuer + * @var Societe object that emits + */ + public $emetteur; /** @@ -58,7 +62,7 @@ class pdf_squille extends ModelePdfReception $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; - $this->option_logo = 1; + $this->option_logo = 1; // Display logo // Get source company $this->emetteur = $mysoc; From a4e63a1a26288292cd5bd0f3d6d126ad7b5fce99 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 20 Jun 2021 11:43:05 +0200 Subject: [PATCH 0770/1497] internationalization --- htdocs/core/modules/societe/doc/doc_generic_odt.modules.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php index 900c7e465df..fdafb22e96b 100644 --- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php +++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php @@ -76,12 +76,12 @@ class doc_generic_odt extends ModeleThirdPartyDoc $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo + $this->option_logo = 1; // Display logo // Retrieves transmitter $this->emetteur = $mysoc; if (!$this->emetteur->country_code) { - $this->emetteur->country_code = substr($langs->defaultlang, -2); // Par defaut, si n'etait pas defini + $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined } } From d60d15883f3be08591971cff40c4687fc3dbcb0b Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 20 Jun 2021 11:46:22 +0200 Subject: [PATCH 0771/1497] internationalization --- .../stock/doc/doc_generic_stock_odt.modules.php | 16 ++++++++-------- .../modules/stock/doc/pdf_standard.modules.php | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php index ccd66610f55..5ca5019588a 100644 --- a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php +++ b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php @@ -82,18 +82,18 @@ class doc_generic_stock_odt extends ModelePDFStock $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva STOCK_TVAOPTION - $this->option_modereg = 0; // Affiche mode reglement - $this->option_condreg = 0; // Affiche conditions reglement - $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat option STOCK_TVAOPTION + $this->option_modereg = 0; // Display payment mode + $this->option_condreg = 0; // Display payment terms + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts - // Recupere emetteur + // Get source company $this->emetteur = $mysoc; if (!$this->emetteur->country_code) { $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php index b0cc07dcb62..ebc109151d6 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php @@ -137,12 +137,12 @@ class pdf_standard extends ModelePDFStock $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; - $this->option_logo = 1; // Affiche logo - $this->option_codestockservice = 0; // Affiche code stock-service - $this->option_multilang = 1; // Dispo en plusieurs langues + $this->option_logo = 1; // Display logo + $this->option_codestockservice = 0; // Display product-service code + $this->option_multilang = 1; // Available in several languages $this->option_freetext = 0; // Support add of a personalised text - // Recupere emetteur + // Get source company $this->emetteur = $mysoc; if (!$this->emetteur->country_code) { $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined From c06fcd36fb33f699f39378ea13c4ab91224c2ec8 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 20 Jun 2021 11:48:30 +0200 Subject: [PATCH 0772/1497] internationalization --- .../doc/doc_generic_supplier_order_odt.modules.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php index 285ea50bebe..3a2775bef82 100644 --- a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php +++ b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php @@ -86,13 +86,13 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva COMMANDE_TVAOPTION - $this->option_modereg = 0; // Affiche mode reglement - $this->option_condreg = 0; // Affiche conditions reglement - $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat option COMMANDE_TVAOPTION + $this->option_modereg = 0; // Display payment mode + $this->option_condreg = 0; // Display payment terms + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts From e33db2876a0e8cad33500034a919bfa54748b58b Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 20 Jun 2021 11:51:02 +0200 Subject: [PATCH 0773/1497] internationalization --- .../doc_generic_supplier_proposal_odt.modules.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php index ead5664c04a..717818448ec 100644 --- a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php @@ -84,13 +84,13 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva PROPALE_TVAOPTION - $this->option_modereg = 0; // Affiche mode reglement - $this->option_condreg = 0; // Affiche conditions reglement - $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat option PROPALE_TVAOPTION + $this->option_modereg = 0; // Display payment mode + $this->option_condreg = 0; // Display payment terms + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts From 1480123f7d2418a814192ec953d07adadc33043b Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 20 Jun 2021 11:53:21 +0200 Subject: [PATCH 0774/1497] internationalization --- .../supplier_proposal/doc/pdf_aurore.modules.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index cbcec7cfdd9..5bd9b8cf339 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -145,13 +145,13 @@ class pdf_aurore extends ModelePDFSupplierProposal $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION - $this->option_modereg = 1; // Affiche mode reglement - $this->option_condreg = 1; // Affiche conditions reglement - $this->option_codeproduitservice = 1; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 1; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION + $this->option_modereg = 1; // Display payment mode + $this->option_condreg = 1; // Display payment terms + $this->option_codeproduitservice = 1; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 1; // Displays if there has been a discount $this->option_credit_note = 1; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 1; //Support add of a watermark on drafts From dbee213db195d1137364164602f98a37ae8330cb Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 20 Jun 2021 11:54:51 +0200 Subject: [PATCH 0775/1497] internationalization --- .../modules/ticket/doc/doc_generic_ticket_odt.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php b/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php index 1bb48b82b42..2e6172d4181 100644 --- a/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php +++ b/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php @@ -81,13 +81,13 @@ class doc_generic_ticket_odt extends ModelePDFTicket $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva USER_TVAOPTION - $this->option_multilang = 1; // Dispo en plusieurs langues + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat option USER_TVAOPTION + $this->option_multilang = 1; // Available in several languages $this->option_freetext = 0; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts - // Recupere emetteur + // Get source company $this->emetteur = $mysoc; if (!$this->emetteur->country_code) { $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined From fb13d74467ef522a6b8d84ae4b346d4681349b57 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 20 Jun 2021 11:56:49 +0200 Subject: [PATCH 0776/1497] internationalization --- .../user/doc/doc_generic_user_odt.modules.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php index 80bbd0f2905..b0d98a525df 100644 --- a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php +++ b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php @@ -81,18 +81,18 @@ class doc_generic_user_odt extends ModelePDFUser $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva USER_TVAOPTION - $this->option_modereg = 0; // Affiche mode reglement - $this->option_condreg = 0; // Affiche conditions reglement - $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat option USER_TVAOPTION + $this->option_modereg = 0; // Display payment mode + $this->option_condreg = 0; // Display payment terms + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts - // Recupere emetteur + // Get source company $this->emetteur = $mysoc; if (!$this->emetteur->country_code) { $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined From ae293d61c6ad63ece0d8f181b6160b5ba70bd541 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 20 Jun 2021 11:59:02 +0200 Subject: [PATCH 0777/1497] internationalization --- .../doc/doc_generic_usergroup_odt.modules.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php index 9ea1a27f045..5a1bca6377d 100644 --- a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php +++ b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php @@ -84,18 +84,18 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva USERGROUP_TVAOPTION - $this->option_modereg = 0; // Affiche mode reglement - $this->option_condreg = 0; // Affiche conditions reglement - $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat option USERGROUP_TVAOPTION + $this->option_modereg = 0; // Display payment mode + $this->option_condreg = 0; // Display payment terms + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts - // Recupere emetteur + // Get source company $this->emetteur = $mysoc; if (!$this->emetteur->country_code) { $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined From 5bde0dbc16f59b95cda7ffbf681109c20e5d2072 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 20 Jun 2021 12:00:27 +0200 Subject: [PATCH 0778/1497] internationalization --- .../modules/mymodule/doc/doc_generic_myobject_odt.modules.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php index b7ea52d939d..f3228915592 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php @@ -3,7 +3,7 @@ * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2014 Marcos García * Copyright (C) 2016 Charlie Benke - * Copyright (C) 2018-2019 Philippe Grand + * Copyright (C) 2018-2021 Philippe Grand * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -96,7 +96,7 @@ class doc_generic_myobject_odt extends ModelePDFMyObject $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts - // Recupere emetteur + // Get source company $this->emetteur = $mysoc; if (!$this->emetteur->country_code) { $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined From ebe7b696a6614ac321fbf9f747f4c9466fc5fad9 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 20 Jun 2021 12:02:52 +0200 Subject: [PATCH 0779/1497] internationalization --- ...eric_recruitmentjobposition_odt.modules.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php b/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php index 47867e40c5f..06b24ec8b65 100644 --- a/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php +++ b/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php @@ -3,7 +3,7 @@ * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2014 Marcos García * Copyright (C) 2016 Charlie Benke - * Copyright (C) 2018-2019 Philippe Grand + * Copyright (C) 2018-2021 Philippe Grand * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -85,18 +85,18 @@ class doc_generic_recruitmentjobposition_odt extends ModelePDFRecruitmentJobPosi $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva COMMANDE_TVAOPTION - $this->option_modereg = 0; // Affiche mode reglement - $this->option_condreg = 0; // Affiche conditions reglement - $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat option COMMANDE_TVAOPTION + $this->option_modereg = 0; // Display payment mode + $this->option_condreg = 0; // Display payment terms + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts - // Recupere emetteur + // Get source company $this->emetteur = $mysoc; if (!$this->emetteur->country_code) { $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined From a9dd5e87641739f23603d9531e0885dd9f7760b3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Jun 2021 12:52:04 +0200 Subject: [PATCH 0780/1497] Fix css hidoneprint --- htdocs/core/class/html.formother.class.php | 2 +- htdocs/theme/eldy/global.inc.php | 2 +- htdocs/theme/md/style.css.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 46858191c7b..d352b996ef2 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -1177,7 +1177,7 @@ class FormOther $selectboxlist .= ''; $selectboxlist .= ''; $selectboxlist .= ''; - $selectboxlist .= Form::selectarray('boxcombo', $arrayboxtoactivatelabel, -1, $langs->trans("ChooseBoxToAdd").'...', 0, 0, '', 0, 0, 0, 'ASC', 'maxwidth150onsmartphone', 0, 'hidden selected', 0, 1); + $selectboxlist .= Form::selectarray('boxcombo', $arrayboxtoactivatelabel, -1, $langs->trans("ChooseBoxToAdd").'...', 0, 0, '', 0, 0, 0, 'ASC', 'maxwidth150onsmartphone hideonprint', 0, 'hidden selected', 0, 1); if (empty($conf->use_javascript_ajax)) { $selectboxlist .= ' '; } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index e039779c96d..d223a70fbc9 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1652,7 +1652,7 @@ table.tableforfield tr>td:first-of-type, tr.trforfield>td:first-of-type, div.tab } -.hideonprint { display: none; } +.hideonprint { display: none !important; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 2c91aa0299b..5027c1501e9 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1668,7 +1668,7 @@ table.tableforfield tr>td:first-of-type, tr.trforfield>td:first-of-type, div.tab } -.hideonprint { display: none; } +.hideonprint { display: none !important; } From 831cc4f4b71b7f8849d08a6318aa7261d4856083 Mon Sep 17 00:00:00 2001 From: daraelmin Date: Sun, 20 Jun 2021 14:19:05 +0200 Subject: [PATCH 0781/1497] Fix 17986 error on comparing integer and string in strict sql --- htdocs/adherents/class/adherentstats.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/adherents/class/adherentstats.class.php b/htdocs/adherents/class/adherentstats.class.php index 62d0e03e27e..e042331b9eb 100644 --- a/htdocs/adherents/class/adherentstats.class.php +++ b/htdocs/adherents/class/adherentstats.class.php @@ -92,7 +92,7 @@ class AdherentStats extends Stats $sql = "SELECT date_format(p.dateadh,'%m') as dm, count(*)"; $sql .= " FROM ".$this->from; //if (!$user->rights->societe->client->voir && !$user->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql .= " WHERE date_format(p.dateadh,'%Y') = ".((int) $year); + $sql .= " WHERE date_format(p.dateadh,'%Y') = '".((int) $year)."'"; $sql .= " AND ".$this->where; $sql .= " GROUP BY dm"; $sql .= $this->db->order('dm', 'DESC'); @@ -133,7 +133,7 @@ class AdherentStats extends Stats $sql = "SELECT date_format(p.dateadh,'%m') as dm, sum(p.".$this->field.")"; $sql .= " FROM ".$this->from; //if (!$user->rights->societe->client->voir && !$user->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql .= " WHERE date_format(p.dateadh,'%Y') = ".((int) $year); + $sql .= " WHERE date_format(p.dateadh,'%Y') = '".((int) $year)."'"; $sql .= " AND ".$this->where; $sql .= " GROUP BY dm"; $sql .= $this->db->order('dm', 'DESC'); @@ -154,7 +154,7 @@ class AdherentStats extends Stats $sql = "SELECT date_format(p.dateadh,'%m') as dm, avg(p.".$this->field.")"; $sql .= " FROM ".$this->from; //if (!$user->rights->societe->client->voir && !$this->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql .= " WHERE date_format(p.dateadh,'%Y') = ".((int) $year); + $sql .= " WHERE date_format(p.dateadh,'%Y') = '".((int) $year)."'"; $sql .= " AND ".$this->where; $sql .= " GROUP BY dm"; $sql .= $this->db->order('dm', 'DESC'); From a54a955a652515a933ab14a0bbf118a96350583e Mon Sep 17 00:00:00 2001 From: daraelmin Date: Sun, 20 Jun 2021 15:40:32 +0200 Subject: [PATCH 0782/1497] Use year() instead of date_format --- htdocs/adherents/class/adherentstats.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/adherents/class/adherentstats.class.php b/htdocs/adherents/class/adherentstats.class.php index e042331b9eb..ea106e4b4c5 100644 --- a/htdocs/adherents/class/adherentstats.class.php +++ b/htdocs/adherents/class/adherentstats.class.php @@ -92,7 +92,7 @@ class AdherentStats extends Stats $sql = "SELECT date_format(p.dateadh,'%m') as dm, count(*)"; $sql .= " FROM ".$this->from; //if (!$user->rights->societe->client->voir && !$user->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql .= " WHERE date_format(p.dateadh,'%Y') = '".((int) $year)."'"; + $sql .= " WHERE YEAR(p.dateadh) = ".((int) $year); $sql .= " AND ".$this->where; $sql .= " GROUP BY dm"; $sql .= $this->db->order('dm', 'DESC'); @@ -133,7 +133,7 @@ class AdherentStats extends Stats $sql = "SELECT date_format(p.dateadh,'%m') as dm, sum(p.".$this->field.")"; $sql .= " FROM ".$this->from; //if (!$user->rights->societe->client->voir && !$user->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql .= " WHERE date_format(p.dateadh,'%Y') = '".((int) $year)."'"; + $sql .= " WHERE YEAR(p.dateadh) = ".((int) $year); $sql .= " AND ".$this->where; $sql .= " GROUP BY dm"; $sql .= $this->db->order('dm', 'DESC'); @@ -154,7 +154,7 @@ class AdherentStats extends Stats $sql = "SELECT date_format(p.dateadh,'%m') as dm, avg(p.".$this->field.")"; $sql .= " FROM ".$this->from; //if (!$user->rights->societe->client->voir && !$this->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql .= " WHERE date_format(p.dateadh,'%Y') = '".((int) $year)."'"; + $sql .= " WHERE YEAR(p.dateadh) = ".((int) $year); $sql .= " AND ".$this->where; $sql .= " GROUP BY dm"; $sql .= $this->db->order('dm', 'DESC'); From 4739694ad7dc4e00df1410c00251d99bba4d1de9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 20 Jun 2021 16:24:58 +0200 Subject: [PATCH 0783/1497] fix php warning --- htdocs/core/class/html.formfile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 04b104ff0f1..831b0f50f04 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -870,7 +870,7 @@ class FormFile // Show share link $out .= ''; - if ($file['share']) { + if (!empty($file['share'])) { // Define $urlwithroot $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file From 4e7af173a64d0efc4ac0301527a84729cc3d4777 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 20 Jun 2021 16:33:41 +0200 Subject: [PATCH 0784/1497] fix php warnings --- htdocs/societe/project.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/project.php b/htdocs/societe/project.php index d2ad361034f..1bf43864cdd 100644 --- a/htdocs/societe/project.php +++ b/htdocs/societe/project.php @@ -6,6 +6,7 @@ * Copyright (C) 2007 Patrick Raguin * Copyright (C) 2010 Juanjo Menent * Copyright (C) 2015 Marcos García + * Copyright (C) 2021 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -129,8 +130,8 @@ if ($socid) { print dol_get_fiche_end(); $params = ''; - - $newcardbutton .= dolGetButtonTitle($langs->trans("NewProject"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/card.php?action=create&socid='.$object->id.'&backtopage='.urlencode($backtopage), '', 1, $params); + $backtopage = $_SERVER['PHP_SELF'].'?socid='.$object->id; + $newcardbutton = dolGetButtonTitle($langs->trans("NewProject"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/card.php?action=create&socid='.$object->id.'&backtopage='.urlencode($backtopage), '', 1, $params); print '
    '; From 68b8a6a916650dd90028d6345579ad66581947fe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Jun 2021 16:35:49 +0200 Subject: [PATCH 0785/1497] css --- htdocs/compta/paiement/card.php | 2 +- htdocs/core/boxes/box_clients.php | 2 +- htdocs/core/boxes/box_ficheinter.php | 2 +- htdocs/core/boxes/box_goodcustomers.php | 2 +- htdocs/core/boxes/box_prospect.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index c971ccbf4fd..2b65ad4a84a 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -392,7 +392,7 @@ if ($resql) { print "\n"; // Third party - print ''; + print ''; print $thirdpartystatic->getNomUrl(1); print ''; diff --git a/htdocs/core/boxes/box_clients.php b/htdocs/core/boxes/box_clients.php index df56b510823..3c83d7521f2 100644 --- a/htdocs/core/boxes/box_clients.php +++ b/htdocs/core/boxes/box_clients.php @@ -128,7 +128,7 @@ class box_clients extends ModeleBoxes $thirdpartystatic->entity = $objp->entity; $this->info_box_contents[$line][] = array( - 'td' => '', + 'td' => 'class="tdoverflowmax150"', 'text' => $thirdpartystatic->getNomUrl(1), 'asis' => 1, ); diff --git a/htdocs/core/boxes/box_ficheinter.php b/htdocs/core/boxes/box_ficheinter.php index edf4daa5191..7179be0cfbb 100644 --- a/htdocs/core/boxes/box_ficheinter.php +++ b/htdocs/core/boxes/box_ficheinter.php @@ -138,7 +138,7 @@ class box_ficheinter extends ModeleBoxes ); $this->info_box_contents[$i][] = array( - 'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"', + 'td' => 'class="tdoverflowmax150"', 'text' => $thirdpartystatic->getNomUrl(1), 'asis' => 1, ); diff --git a/htdocs/core/boxes/box_goodcustomers.php b/htdocs/core/boxes/box_goodcustomers.php index aef7cdc9f3d..ab425ceac87 100644 --- a/htdocs/core/boxes/box_goodcustomers.php +++ b/htdocs/core/boxes/box_goodcustomers.php @@ -120,7 +120,7 @@ class box_goodcustomers extends ModeleBoxes $nbimpaye = $objp->nbfact - $objp->nbfactpaye; $this->info_box_contents[$line][] = array( - 'td' => '', + 'td' => 'class="tdoverflowmax150"', 'text' => $thirdpartystatic->getNomUrl(1), 'asis' => 1, ); diff --git a/htdocs/core/boxes/box_prospect.php b/htdocs/core/boxes/box_prospect.php index a8959202082..7489cc997ea 100644 --- a/htdocs/core/boxes/box_prospect.php +++ b/htdocs/core/boxes/box_prospect.php @@ -129,7 +129,7 @@ class box_prospect extends ModeleBoxes $thirdpartystatic->entity = $objp->entity; $this->info_box_contents[$line][] = array( - 'td' => '', + 'td' => 'class="tdoverflowmax150"', 'text' => $thirdpartystatic->getNomUrl(1), 'asis' => 1, ); From 5ad999e46de0dc5c0a2498391f691ccb27517d17 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Jun 2021 16:39:30 +0200 Subject: [PATCH 0786/1497] css --- htdocs/core/boxes/box_actions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php index 45c9d580ad2..121137fd1a6 100644 --- a/htdocs/core/boxes/box_actions.php +++ b/htdocs/core/boxes/box_actions.php @@ -148,14 +148,14 @@ class box_actions extends ModeleBoxes $label = empty($objp->label) ? $objp->type_label : $objp->label; $this->info_box_contents[$line][0] = array( - 'td' => '', + 'td' => 'class="tdoverflowmax200"', 'text' => $actionstatic->getNomUrl(1), 'text2'=> $late, 'asis' => 1 ); $this->info_box_contents[$line][1] = array( - 'td' => '', + 'td' => 'class="tdoverflowmax100"', 'text' => ($societestatic->id > 0 ? $societestatic->getNomUrl(1) : ''), 'asis' => 1 ); From f486595e13ef66dd16994d60f3dd5199b35d10c9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Jun 2021 16:55:22 +0200 Subject: [PATCH 0787/1497] Fix dolSqlDateFilter --- htdocs/core/lib/date.lib.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 0dde3a93159..864fea050a0 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -294,32 +294,35 @@ function convertSecondToTime($iSecond, $format = 'all', $lengthOfDay = 86400, $l /** - * Generate a SQL string to make a filter into a range (for second of date until last second of date) + * Generate a SQL string to make a filter into a range (for second of date until last second of date). + * This method allows to maje SQL request that will deal correctly the timezone of server. * * @param string $datefield Name of SQL field where apply sql date filter * @param int $day_date Day date * @param int $month_date Month date * @param int $year_date Year date * @param int $excludefirstand Exclude first and + * @param mixed $gm False or 0 or 'tzserver' = Return date to compare with server TZ, * @return string $sqldate String with SQL filter */ -function dolSqlDateFilter($datefield, $day_date, $month_date, $year_date, $excludefirstand = 0) +function dolSqlDateFilter($datefield, $day_date, $month_date, $year_date, $excludefirstand = 0, $gm = false) { global $db; $sqldate = ""; if ($month_date > 0) { if ($year_date > 0 && empty($day_date)) { - $sqldate .= ($excludefirstand ? "" : " AND ").$datefield." BETWEEN '".$db->idate(dol_get_first_day($year_date, $month_date, false)); - $sqldate .= "' AND '".$db->idate(dol_get_last_day($year_date, $month_date, false))."'"; + $sqldate .= ($excludefirstand ? "" : " AND ").$datefield." BETWEEN '".$db->idate(dol_get_first_day($year_date, $month_date, $gm)); + $sqldate .= "' AND '".$db->idate(dol_get_last_day($year_date, $month_date, $gm))."'"; } elseif ($year_date > 0 && !empty($day_date)) { - $sqldate .= ($excludefirstand ? "" : " AND ").$datefield." BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month_date, $day_date, $year_date)); - $sqldate .= "' AND '".$db->idate(dol_mktime(23, 59, 59, $month_date, $day_date, $year_date))."'"; + $sqldate .= ($excludefirstand ? "" : " AND ").$datefield." BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month_date, $day_date, $year_date, $gm)); + $sqldate .= "' AND '".$db->idate(dol_mktime(23, 59, 59, $month_date, $day_date, $year_date, $gm))."'"; } else { + // This case is not reliable on TZ, but we should not need it. $sqldate .= ($excludefirstand ? "" : " AND ")." date_format( ".$datefield.", '%c') = '".$db->escape($month_date)."'"; } } elseif ($year_date > 0) { - $sqldate .= ($excludefirstand ? "" : " AND ").$datefield." BETWEEN '".$db->idate(dol_get_first_day($year_date, 1, false)); - $sqldate .= "' AND '".$db->idate(dol_get_last_day($year_date, 12, false))."'"; + $sqldate .= ($excludefirstand ? "" : " AND ").$datefield." BETWEEN '".$db->idate(dol_get_first_day($year_date, 1, $gm)); + $sqldate .= "' AND '".$db->idate(dol_get_last_day($year_date, 12, $gm))."'"; } return $sqldate; } From c820193d11b6e7d775659913eba638d2d68f2a25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 20 Jun 2021 17:01:41 +0200 Subject: [PATCH 0788/1497] remove not used var and fix php warnings --- htdocs/admin/agenda_extsites.php | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index 9ce55583d99..272da835741 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -3,6 +3,7 @@ * Copyright (C) 2011-2015 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2016 Raphaël Doursenaud + * Copyright (C) 2021 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -158,14 +159,6 @@ print dol_get_fiche_head($head, 'extsites', $langs->trans("Agenda"), -1, 'action print ''.$langs->trans("AgendaExtSitesDesc")."
    \n"; print "
    \n"; - -$selectedvalue = $conf->global->AGENDA_DISABLE_EXT; -if ($selectedvalue == 1) { - $selectedvalue = 0; -} else { - $selectedvalue = 1; -} - print ""; print ""; @@ -226,15 +219,15 @@ while ($i <= $MAXAGENDA) { // Nb print '"; // Name - print ''; + print ''; // URL - print ''; + print ''; // Offset TZ - print ''; + print ''; // Color (Possible colors are limited by Google) print ''; print ""; $i++; From d4fc23678a17907af58594e42935bec9f3ec19ee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Jun 2021 17:12:18 +0200 Subject: [PATCH 0789/1497] Add phpunit test for dolSqlDateFilter() --- test/phpunit/DateLibTest.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/phpunit/DateLibTest.php b/test/phpunit/DateLibTest.php index 7ff09de495e..7c6cda9f997 100644 --- a/test/phpunit/DateLibTest.php +++ b/test/phpunit/DateLibTest.php @@ -528,4 +528,26 @@ class DateLibTest extends PHPUnit\Framework\TestCase return 1; } + + /** + * testDolSqlDateFilter + * + * @return int + */ + public function testDolSqlDateFilter() + { + global $conf; + + $result = dolSqlDateFilter('field1', 0, 0, 1970, 0); + print __METHOD__." result = ".$result."\n"; + $this->assertEquals(" AND field1 BETWEEN '1970-01-01 00:00:00' AND '1970-12-31 23:59:59'", $result, 'Test dolSqlDateFilter 1'); + + /* If server/company is in TZ America/Bahia, and we need range with a date set in GMT + $result = dolSqlDateFilter('field1', 0, 0, 1970, 0, 'gmt'); + print __METHOD__." result = ".$result."\n"; + $this->assertEquals(" AND field1 BETWEEN '1969-12-31 21:00:00' AND '1970-12-31 20:59:59'", $result, 'Test dolSqlDateFilter 2'); + */ + + return 1; + } } From cfd7c610db7d1ae960c8e601be519c2348752f41 Mon Sep 17 00:00:00 2001 From: daraelmin Date: Sun, 20 Jun 2021 17:14:28 +0200 Subject: [PATCH 0790/1497] Use dolSqlDateFilter instead of SQL function YEAR --- htdocs/adherents/class/adherentstats.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/adherents/class/adherentstats.class.php b/htdocs/adherents/class/adherentstats.class.php index ea106e4b4c5..bf8cf92bc33 100644 --- a/htdocs/adherents/class/adherentstats.class.php +++ b/htdocs/adherents/class/adherentstats.class.php @@ -92,7 +92,7 @@ class AdherentStats extends Stats $sql = "SELECT date_format(p.dateadh,'%m') as dm, count(*)"; $sql .= " FROM ".$this->from; //if (!$user->rights->societe->client->voir && !$user->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql .= " WHERE YEAR(p.dateadh) = ".((int) $year); + $sql .= " WHERE ".dolSqlDateFilter('p.dateadh', 0, 0, $year, 1); $sql .= " AND ".$this->where; $sql .= " GROUP BY dm"; $sql .= $this->db->order('dm', 'DESC'); @@ -133,7 +133,7 @@ class AdherentStats extends Stats $sql = "SELECT date_format(p.dateadh,'%m') as dm, sum(p.".$this->field.")"; $sql .= " FROM ".$this->from; //if (!$user->rights->societe->client->voir && !$user->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql .= " WHERE YEAR(p.dateadh) = ".((int) $year); + $sql .= " WHERE ".dolSqlDateFilter('p.dateadh', 0, 0, $year, 1); $sql .= " AND ".$this->where; $sql .= " GROUP BY dm"; $sql .= $this->db->order('dm', 'DESC'); @@ -154,7 +154,7 @@ class AdherentStats extends Stats $sql = "SELECT date_format(p.dateadh,'%m') as dm, avg(p.".$this->field.")"; $sql .= " FROM ".$this->from; //if (!$user->rights->societe->client->voir && !$this->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql .= " WHERE YEAR(p.dateadh) = ".((int) $year); + $sql .= " WHERE ".dolSqlDateFilter('p.dateadh', 0, 0, $year, 1); $sql .= " AND ".$this->where; $sql .= " GROUP BY dm"; $sql .= $this->db->order('dm', 'DESC'); From 65110411ac40d76da0aeb901233b875329c124a9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Jun 2021 17:20:12 +0200 Subject: [PATCH 0791/1497] Doc --- htdocs/core/lib/date.lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 864fea050a0..fe21071901a 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -302,7 +302,8 @@ function convertSecondToTime($iSecond, $format = 'all', $lengthOfDay = 86400, $l * @param int $month_date Month date * @param int $year_date Year date * @param int $excludefirstand Exclude first and - * @param mixed $gm False or 0 or 'tzserver' = Return date to compare with server TZ, + * @param mixed $gm False or 0 or 'tzserver' = Input date fields are date info in the server TZ. True or 1 or 'gmt' = Input are date info in GMT TZ. + * Note: In database, dates are always fot the server TZ. * @return string $sqldate String with SQL filter */ function dolSqlDateFilter($datefield, $day_date, $month_date, $year_date, $excludefirstand = 0, $gm = false) From 002471b1fe1177c81bfa4cefd36707dbf3bf12f3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Jun 2021 17:25:58 +0200 Subject: [PATCH 0792/1497] Update adherentstats.class.php --- htdocs/adherents/class/adherentstats.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/adherents/class/adherentstats.class.php b/htdocs/adherents/class/adherentstats.class.php index bf8cf92bc33..cfa83290551 100644 --- a/htdocs/adherents/class/adherentstats.class.php +++ b/htdocs/adherents/class/adherentstats.class.php @@ -92,7 +92,7 @@ class AdherentStats extends Stats $sql = "SELECT date_format(p.dateadh,'%m') as dm, count(*)"; $sql .= " FROM ".$this->from; //if (!$user->rights->societe->client->voir && !$user->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql .= " WHERE ".dolSqlDateFilter('p.dateadh', 0, 0, $year, 1); + $sql .= " WHERE ".dolSqlDateFilter('p.dateadh', 0, 0, (int) $year, 1); $sql .= " AND ".$this->where; $sql .= " GROUP BY dm"; $sql .= $this->db->order('dm', 'DESC'); @@ -133,7 +133,7 @@ class AdherentStats extends Stats $sql = "SELECT date_format(p.dateadh,'%m') as dm, sum(p.".$this->field.")"; $sql .= " FROM ".$this->from; //if (!$user->rights->societe->client->voir && !$user->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql .= " WHERE ".dolSqlDateFilter('p.dateadh', 0, 0, $year, 1); + $sql .= " WHERE ".dolSqlDateFilter('p.dateadh', 0, 0, (int) $year, 1); $sql .= " AND ".$this->where; $sql .= " GROUP BY dm"; $sql .= $this->db->order('dm', 'DESC'); @@ -154,7 +154,7 @@ class AdherentStats extends Stats $sql = "SELECT date_format(p.dateadh,'%m') as dm, avg(p.".$this->field.")"; $sql .= " FROM ".$this->from; //if (!$user->rights->societe->client->voir && !$this->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql .= " WHERE ".dolSqlDateFilter('p.dateadh', 0, 0, $year, 1); + $sql .= " WHERE ".dolSqlDateFilter('p.dateadh', 0, 0, (int) $year, 1); $sql .= " AND ".$this->where; $sql .= " GROUP BY dm"; $sql .= $this->db->order('dm', 'DESC'); From 40afa5b1cc6e4f0cd294c304aa143835291c7a48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 20 Jun 2021 18:21:10 +0200 Subject: [PATCH 0793/1497] fix warning there is already an array called $option --- htdocs/admin/syslog.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php index dfdc53e0f18..a0454a5c8b2 100644 --- a/htdocs/admin/syslog.php +++ b/htdocs/admin/syslog.php @@ -180,8 +180,8 @@ if (!$defaultsyslogfacility) { if (!$defaultsyslogfile) { $defaultsyslogfile = 'dolibarr.log'; } - -if ($conf->global->MAIN_MODULE_MULTICOMPANY && $user->entity) { +$optionmc = ''; +if (!empty($conf->global->MAIN_MODULE_MULTICOMPANY) && $user->entity) { print '
    '.$langs->trans("ContactSuperAdminForChange").'
    '; $option = 'disabled'; } @@ -199,7 +199,7 @@ print ''; print '
    '.$langs->trans("AgendaExtNb", $key)."'; //print $formadmin->selectColor($conf->global->$color, "google_agenda_color".$key, $colorlist); - print $formother->selectColor((GETPOST("AGENDA_EXT_COLOR".$key) ?GETPOST("AGENDA_EXT_COLOR".$key) : $conf->global->$color), "AGENDA_EXT_COLOR".$key, 'extsitesconfig', 1, '', 'hideifnotset'); + print $formother->selectColor((GETPOST("AGENDA_EXT_COLOR".$key) ?GETPOST("AGENDA_EXT_COLOR".$key) : getDolGlobalString($color)), "AGENDA_EXT_COLOR".$key, 'extsitesconfig', 1, '', 'hideifnotset'); print '
    '; print ''; print ''; -print ''; +print ''; print "\n"; foreach ($syslogModules as $moduleName) { From cff5edd6047b9173bef737c9a40ccffdfff536ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 20 Jun 2021 18:24:00 +0200 Subject: [PATCH 0794/1497] Update syslog.php --- htdocs/admin/syslog.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php index a0454a5c8b2..7a885c0b74f 100644 --- a/htdocs/admin/syslog.php +++ b/htdocs/admin/syslog.php @@ -279,11 +279,11 @@ print ''; print '
    '.$langs->trans("Type").''.$langs->trans("Value").'
    '; print ''; print ''; -print ''; +print ''; print "\n"; print ''; -print ''; print ''."\n"; print ''; -// Example with a yes / no select +/* No more need for this, you can set that a profile is public when saving it. print ''; print ''; print ''; print ''; +*/ print ''; print ''; diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index d352b996ef2..991e3cb37cc 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -110,7 +110,7 @@ class FormOther * @param string $htmlname Nom de la zone select * @param string $type Type des modeles recherches * @param int $useempty Show an empty value in list - * @param int $fk_user User that has created the template (this is set to null to get all export model when EXPORTS_SHARE_MODELS is on) + * @param int $fk_user User we want templates * @return void */ public function select_export_model($selected = '', $htmlname = 'exportmodelid', $type = '', $useempty = 0, $fk_user = null) @@ -121,8 +121,8 @@ class FormOther $sql = "SELECT rowid, label, fk_user"; $sql .= " FROM ".MAIN_DB_PREFIX."export_model"; $sql .= " WHERE type = '".$this->db->escape($type)."'"; - if (!empty($fk_user)) { - $sql .= " AND fk_user IN (0, ".$fk_user.")"; // An export model + if (empty($conf->global->EXPORTS_SHARE_MODELS)) { // EXPORTS_SHARE_MODELS means all templates are visible, whatever is owner. + $sql .= " AND fk_user IN (0, ".((int) $fk_user).")"; } $sql .= " ORDER BY label"; $result = $this->db->query($sql); @@ -132,6 +132,8 @@ class FormOther print ''; } + $tmpuser = new User($this->db); + $num = $this->db->num_rows($result); $i = 0; while ($i < $num) { @@ -140,8 +142,7 @@ class FormOther $label = $obj->label; if ($obj->fk_user == 0) { $label .= ' ('.$langs->trans("Everybody").')'; - } elseif (!empty($conf->global->EXPORTS_SHARE_MODELS) && empty($fk_user) && is_object($user) && $user->id != $obj->fk_user) { - $tmpuser = new User($this->db); + } elseif ($obj->fk_user > 0) { $tmpuser->fetch($obj->fk_user); $label .= ' ('.$tmpuser->getFullName($langs).')'; } @@ -171,7 +172,7 @@ class FormOther * @param string $htmlname Nom de la zone select * @param string $type Type des modeles recherches * @param int $useempty Affiche valeur vide dans liste - * @param int $fk_user User that has created the template (this is set to null to get all export model when EXPORTS_SHARE_MODELS is on) + * @param int $fk_user User that has created the template * @return void */ public function select_import_model($selected = '', $htmlname = 'importmodelid', $type = '', $useempty = 0, $fk_user = null) @@ -182,10 +183,10 @@ class FormOther $sql = "SELECT rowid, label, fk_user"; $sql .= " FROM ".MAIN_DB_PREFIX."import_model"; $sql .= " WHERE type = '".$this->db->escape($type)."'"; - if (!empty($fk_user)) { - $sql .= " AND fk_user IN (0, ".$fk_user.")"; // An export model + if (empty($conf->global->EXPORTS_SHARE_MODELS)) { // EXPORTS_SHARE_MODELS means all templates are visible, whatever is owner. + $sql .= " AND fk_user IN (0, ".((int) $fk_user).")"; } - $sql .= " ORDER BY rowid"; + $sql .= " ORDER BY label"; $result = $this->db->query($sql); if ($result) { print ''; print '
    '; print ''.$langs->trans("SelectExportFields").' '; - if (empty($conf->global->EXPORTS_SHARE_MODELS)) { - $htmlother->select_export_model($exportmodelid, 'exportmodelid', $datatoexport, 1, $user->id); - } else { - $htmlother->select_export_model($exportmodelid, 'exportmodelid', $datatoexport, 1); - } + $htmlother->select_export_model($exportmodelid, 'exportmodelid', $datatoexport, 1, $user->id); print ' '; print ''; print '
    '; @@ -1007,20 +1004,28 @@ if ($step == 4 && $datatoexport) { print '
    '.$langs->trans("Parameter").''.$langs->trans("Value").'
    '.$langs->trans("SyslogLevel").''; $texte .= ''; $texte .= ''; - if ($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT > 0) { + if (!empty($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT)) { $texte .= ''; $texte .= ''; $texte .= ''; @@ -166,7 +166,7 @@ class doc_generic_user_odt extends ModelePDFUser if (count($listofdir)) { $texte .= $langs->trans("NumberOfModelFilesFound").': '.count($listoffiles).''; - if ($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT > 0) { + if (!empty($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT)) { // Model for creation $list = ModelePDFUser::liste_modeles($this->db); $texte .= ''; From 9ee95562004e35f4582609dd62fa6179607a9e7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 20 Jun 2021 18:37:43 +0200 Subject: [PATCH 0796/1497] Update user.php --- htdocs/admin/user.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php index 6d8cfe21f00..da3a1913d64 100644 --- a/htdocs/admin/user.php +++ b/htdocs/admin/user.php @@ -268,7 +268,7 @@ foreach ($dirmodels as $reldir) { // Defaut print '\n"; /* - echo '
    '; - echo '
    '; - echo '
    '; - echo show_day_events($db, $day, $month, $year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, -1); - echo '
    '."\n"; - echo "
    \n"; - */ + echo '
    '; + echo '
    '; + echo '
    '; + echo show_day_events($db, $day, $month, $year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, -1); + echo '
    '."\n"; + echo "
    \n"; + */ echo '
    '; - if ($conf->global->USER_ADDON_PDF == $name) { + if (getDolGlobalString('USER_ADDON_PDF_ODT') == $name) { print img_picto($langs->trans("Default"), 'on'); } else { print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; From c9c3cef5d768830cad64496c16d2a629fb32d493 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 20 Jun 2021 20:15:19 +0200 Subject: [PATCH 0797/1497] Update syslog.php --- htdocs/admin/syslog.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php index 7a885c0b74f..10b3d1bd47b 100644 --- a/htdocs/admin/syslog.php +++ b/htdocs/admin/syslog.php @@ -183,7 +183,7 @@ if (!$defaultsyslogfile) { $optionmc = ''; if (!empty($conf->global->MAIN_MODULE_MULTICOMPANY) && $user->entity) { print '
    '.$langs->trans("ContactSuperAdminForChange").'
    '; - $option = 'disabled'; + $optionmc = 'disabled'; } From c8326c1365a54f060c7a5358219df6cc3ff6feb5 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 20 Jun 2021 21:55:48 +0200 Subject: [PATCH 0798/1497] FIX Accoutancy Limit date payment not register on purchases operations --- htdocs/accountancy/journal/purchasesjournal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index 42bff74097f..5238ee993e1 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -92,7 +92,7 @@ if (!GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end)) $date_end = dol_get_last_day($pastmonthyear, $pastmonth, false); } -$sql = "SELECT f.rowid, f.ref as ref, f.type, f.datef as df, f.libelle,f.ref_supplier, f.date_lim_reglement as dlf, f.close_code,"; +$sql = "SELECT f.rowid, f.ref as ref, f.type, f.datef as df, f.libelle,f.ref_supplier, f.date_lim_reglement as dlr, f.close_code,"; $sql .= " fd.rowid as fdid, fd.description, fd.product_type, fd.total_ht, fd.tva as total_tva, fd.total_localtax1, fd.total_localtax2, fd.tva_tx, fd.total_ttc, fd.vat_src_code,"; $sql .= " s.rowid as socid, s.nom as name, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,"; $sql .= " p.accountancy_code_buy , aa.rowid as fk_compte, aa.account_number as compte, aa.label as label_compte"; From 0dc16b135d27d30c546808ddcd7c3df1924a7b34 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 21 Jun 2021 00:05:01 +0200 Subject: [PATCH 0799/1497] FIX allow disabling of a module (not dangerous) even if pb with token. --- htdocs/admin/modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 56b6e6e1f01..674cbbf52f5 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -28,7 +28,7 @@ * \brief Page to activate/disable all modules */ -if (!defined('CSRFCHECK_WITH_TOKEN')) { +if (!defined('CSRFCHECK_WITH_TOKEN') && (empty($_GET['action']) || $_GET['action'] != 'reset')) { // We do not force security to disable modules so we can do it if problem define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET } From 9fd06537b7961c1594d1d0c60fa55aa7bce95575 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 21 Jun 2021 10:42:20 +0200 Subject: [PATCH 0800/1497] move admin warnings on top instead bottom --- htdocs/index.php | 62 +++++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 32 deletions(-) diff --git a/htdocs/index.php b/htdocs/index.php index 7eaf517b321..0f457b0f40b 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2017 Regis Houssin * Copyright (C) 2011-2012 Juanjo Menent * Copyright (C) 2015 Marcos García + * Copyright (C) 2021 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -101,7 +102,36 @@ if (!empty($conf->global->MAIN_MOTD)) { } } +/* + * Show security warnings + */ +// Security warning repertoire install existe (si utilisateur admin) +if ($user->admin && empty($conf->global->MAIN_REMOVE_INSTALL_WARNING)) { + $message = ''; + + // Check if install lock file is present + $lockfile = DOL_DATA_ROOT.'/install.lock'; + if (!empty($lockfile) && !file_exists($lockfile) && is_dir(DOL_DOCUMENT_ROOT."/install")) { + $langs->load("errors"); + //if (! empty($message)) $message.='
    '; + $message .= info_admin($langs->trans("WarningLockFileDoesNotExists", DOL_DATA_ROOT).' '.$langs->trans("WarningUntilDirRemoved", DOL_DOCUMENT_ROOT."/install"), 0, 0, '1', 'clearboth'); + } + + // Conf files must be in read only mode + if (is_writable($conffile)) { + $langs->load("errors"); + //$langs->load("other"); + //if (! empty($message)) $message.='
    '; + $message .= info_admin($langs->transnoentities("WarningConfFileMustBeReadOnly").' '.$langs->trans("WarningUntilDirRemoved", DOL_DOCUMENT_ROOT."/install"), 0, 0, '1', 'clearboth'); + } + + if ($message) { + print $message; + //$message.='
    '; + //print info_admin($langs->trans("WarningUntilDirRemoved",DOL_DOCUMENT_ROOT."/install")); + } +} /* * Dashboard Dolibarr states (statistics) @@ -722,38 +752,6 @@ print $boxlist; print ''; - -/* - * Show security warnings - */ - -// Security warning repertoire install existe (si utilisateur admin) -if ($user->admin && empty($conf->global->MAIN_REMOVE_INSTALL_WARNING)) { - $message = ''; - - // Check if install lock file is present - $lockfile = DOL_DATA_ROOT.'/install.lock'; - if (!empty($lockfile) && !file_exists($lockfile) && is_dir(DOL_DOCUMENT_ROOT."/install")) { - $langs->load("errors"); - //if (! empty($message)) $message.='
    '; - $message .= info_admin($langs->trans("WarningLockFileDoesNotExists", DOL_DATA_ROOT).' '.$langs->trans("WarningUntilDirRemoved", DOL_DOCUMENT_ROOT."/install"), 0, 0, '1', 'clearboth'); - } - - // Conf files must be in read only mode - if (is_writable($conffile)) { - $langs->load("errors"); - //$langs->load("other"); - //if (! empty($message)) $message.='
    '; - $message .= info_admin($langs->transnoentities("WarningConfFileMustBeReadOnly").' '.$langs->trans("WarningUntilDirRemoved", DOL_DOCUMENT_ROOT."/install"), 0, 0, '1', 'clearboth'); - } - - if ($message) { - print $message; - //$message.='
    '; - //print info_admin($langs->trans("WarningUntilDirRemoved",DOL_DOCUMENT_ROOT."/install")); - } -} - //print 'mem='.memory_get_usage().' - '.memory_get_peak_usage(); // End of page From 59a7d5b89d1ed250bb91cab2c1fe0a7b4197a604 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 21 Jun 2021 11:13:30 +0200 Subject: [PATCH 0801/1497] Introduce option MAIN_USE_VAT_COMPANIES_IN_EEC_WITH_INVALID_VAT_ID_ARE_INDIVIDUAL --- htdocs/core/lib/functions.lib.php | 35 ++++++++++++++++++------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 531af8fe73a..20b944b4da2 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5867,36 +5867,41 @@ function get_default_tva(Societe $thirdparty_seller, Societe $thirdparty_buyer, } // Si (vendeur et acheteur dans Communaute europeenne) et (bien vendu = moyen de transports neuf comme auto, bateau, avion) alors TVA par defaut=0 (La TVA doit etre paye par l'acheteur au centre d'impots de son pays et non au vendeur). Fin de regle. - // Not supported + // 'VATRULE 3' - Not supported // Si (vendeur et acheteur dans Communaute europeenne) et (acheteur = entreprise) alors TVA par defaut=0. Fin de regle // Si (vendeur et acheteur dans Communaute europeenne) et (acheteur = particulier) alors TVA par defaut=TVA du produit vendu. Fin de regle if (($seller_in_cee && $buyer_in_cee)) { $isacompany = $thirdparty_buyer->isACompany(); - if ($isacompany) { - if (!empty($conf->global->MAIN_USE_VAT_OF_PRODUCT_FOR_COMPANIES_IN_EEC_WITH_INVALID_VAT_ID)) { - require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - if (!isValidVATID($thirdparty_buyer)) { - //print 'VATRULE 6'; - return get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournprice); - } + if ($isacompany && !empty($conf->global->MAIN_USE_VAT_COMPANIES_IN_EEC_WITH_INVALID_VAT_ID_ARE_INDIVIDUAL)) { + require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; + if (!isValidVATID($thirdparty_buyer)) { + $isacompany = 0; } - //print 'VATRULE 3'; - return 0; - } else { + } + + if (!$isacompany) { //print 'VATRULE 4'; return get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournprice); + } else { + //print 'VATRULE 5'; + return 0; } } - // Si (vendeur en France et acheteur hors Communaute europeenne et acheteur particulier) alors TVA par defaut=TVA du produit vendu. Fin de regle - if (!empty($conf->global->MAIN_USE_VAT_OF_PRODUCT_FOR_INDIVIDUAL_CUSTOMER_OUT_OF_EEC) && empty($buyer_in_cee) && !$thirdparty_buyer->isACompany()) { - return get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournprice); + // Si (vendeur dans Communaute europeene et acheteur hors Communaute europeenne et acheteur particulier) alors TVA par defaut=TVA du produit vendu. Fin de regle + // I don't see any use case that need this rule + if (!empty($conf->global->MAIN_USE_VAT_OF_PRODUCT_FOR_INDIVIDUAL_CUSTOMER_OUT_OF_EEC) && empty($buyer_in_cee)) { + $isacompany = $thirdparty_buyer->isACompany(); + if (!$isacompany) { + return get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournprice); + //print 'VATRULE extra'; + } } // Sinon la TVA proposee par defaut=0. Fin de regle. // Rem: Cela signifie qu'au moins un des 2 est hors Communaute europeenne et que le pays differe - //print 'VATRULE 5'; + //print 'VATRULE 6'; return 0; } From 5bfd82e5284211673f9030953a096354d3e0f97d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 21 Jun 2021 11:23:53 +0200 Subject: [PATCH 0802/1497] Clean code --- ChangeLog | 1 + htdocs/core/lib/company.lib.php | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1fdb321822f..ef4f01d84c7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -225,6 +225,7 @@ Following changes may create regressions for some external modules, but were nec * If your database is MySQL or MariaDB, you need at least version 5.1 * Function set_price_level() has been renamed into setPriceLevel() to follow camelcase rules * removed deprecated subtituion key __REFCLIENT__ (replaced with __REF_CLIENT__) +* Removed constant MAIN_COUNTRIES_IN_EEC. You can now set if country is in Europe or not from the dictionary of countries. ***** ChangeLog for 13.0.3 compared to 13.0.2 ***** diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index f6d07e32f01..21b6f9a68e4 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -715,10 +715,7 @@ function getCountriesInEEC() global $conf, $db; $country_code_in_EEC = array(); - if (!empty($conf->global->MAIN_COUNTRIES_IN_EEC)) { - // For example MAIN_COUNTRIES_IN_EEC = 'AT,BE,BG,CY,CZ,DE,DK,EE,ES,FI,FR,GB,GR,HR,NL,HU,IE,IM,IT,LT,LU,LV,MC,MT,PL,PT,RO,SE,SK,SI,UK' - $country_code_in_EEC = explode(',', $conf->global->MAIN_COUNTRIES_IN_EEC); - } elseif (!empty($conf->cache['country_code_in_EEC'])) { + if (!empty($conf->cache['country_code_in_EEC'])) { // Use of cache to reduce number of database requests $country_code_in_EEC = $conf->cache['country_code_in_EEC']; } else { From bb8d5cec1b88759e06d6642c20d2f0f65b55b3fe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 21 Jun 2021 11:36:28 +0200 Subject: [PATCH 0803/1497] More complete management of MAIN_USE_VAT_COMPANIES_IN_EEC_WITH_INVALID_VAT_ID_ARE_INDIVIDUAL --- htdocs/core/lib/functions.lib.php | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 20b944b4da2..fed3f697cb6 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5811,12 +5811,12 @@ function get_product_localtax_for_country($idprod, $local, $thirdparty_seller) /** * Function that return vat rate of a product line (according to seller, buyer and product vat rate) - * Si vendeur non assujeti a TVA, TVA par defaut=0. Fin de regle. - * Si le (pays vendeur = pays acheteur) alors TVA par defaut=TVA du produit vendu. Fin de regle. - * Si (vendeur et acheteur dans Communaute europeenne) et (bien vendu = moyen de transports neuf comme auto, bateau, avion) alors TVA par defaut=0 (La TVA doit etre paye par acheteur au centre d'impots de son pays et non au vendeur). Fin de regle. - * Si (vendeur et acheteur dans Communaute europeenne) et (acheteur = particulier ou entreprise sans num TVA intra) alors TVA par defaut=TVA du produit vendu. Fin de regle - * Si (vendeur et acheteur dans Communaute europeenne) et (acheteur = entreprise avec num TVA) intra alors TVA par defaut=0. Fin de regle - * Sinon TVA proposee par defaut=0. Fin de regle. + * VATRULE 1: Si vendeur non assujeti a TVA, TVA par defaut=0. Fin de regle. + * VATRULE 2: Si le (pays vendeur = pays acheteur) alors TVA par defaut=TVA du produit vendu. Fin de regle. + * VATRULE 3: Si (vendeur et acheteur dans Communaute europeenne) et (bien vendu = moyen de transports neuf comme auto, bateau, avion) alors TVA par defaut=0 (La TVA doit etre paye par acheteur au centre d'impots de son pays et non au vendeur). Fin de regle. + * VATRULE 4: Si (vendeur et acheteur dans Communaute europeenne) et (acheteur = particulier) alors TVA par defaut=TVA du produit vendu. Fin de regle + * VATRULE 5: Si (vendeur et acheteur dans Communaute europeenne) et (acheteur = entreprise) alors TVA par defaut=0. Fin de regle + * VATRULE 6: Sinon TVA proposee par defaut=0. Fin de regle. * * @param Societe $thirdparty_seller Objet societe vendeuse * @param Societe $thirdparty_buyer Objet societe acheteuse @@ -5845,9 +5845,19 @@ function get_default_tva(Societe $thirdparty_seller, Societe $thirdparty_buyer, // If services are eServices according to EU Council Directive 2002/38/EC (http://ec.europa.eu/taxation_customs/taxation/vat/traders/e-commerce/article_1610_en.htm) // we use the buyer VAT. if (!empty($conf->global->SERVICE_ARE_ECOMMERCE_200238EC)) { - if ($seller_in_cee && $buyer_in_cee && !$thirdparty_buyer->isACompany()) { - //print 'VATRULE 0'; - return get_product_vat_for_country($idprod, $thirdparty_buyer, $idprodfournprice); + if ($seller_in_cee && $buyer_in_cee) { + $isacompany = $thirdparty_buyer->isACompany(); + if ($isacompany && !empty($conf->global->MAIN_USE_VAT_COMPANIES_IN_EEC_WITH_INVALID_VAT_ID_ARE_INDIVIDUAL)) { + require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; + if (!isValidVATID($thirdparty_buyer)) { + $isacompany = 0; + } + } + + if (!$isacompany) { + //print 'VATRULE 0'; + return get_product_vat_for_country($idprod, $thirdparty_buyer, $idprodfournprice); + } } } @@ -5890,7 +5900,7 @@ function get_default_tva(Societe $thirdparty_seller, Societe $thirdparty_buyer, } // Si (vendeur dans Communaute europeene et acheteur hors Communaute europeenne et acheteur particulier) alors TVA par defaut=TVA du produit vendu. Fin de regle - // I don't see any use case that need this rule + // I don't see any use case that need this rule. if (!empty($conf->global->MAIN_USE_VAT_OF_PRODUCT_FOR_INDIVIDUAL_CUSTOMER_OUT_OF_EEC) && empty($buyer_in_cee)) { $isacompany = $thirdparty_buyer->isACompany(); if (!$isacompany) { From ab2e50ef49d9b20d98a3a0dffcd6752940564538 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 21 Jun 2021 12:46:03 +0200 Subject: [PATCH 0804/1497] Fix css --- htdocs/comm/action/index.php | 62 ++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 465f1be8701..d619fafe850 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -363,9 +363,9 @@ if ($action == 'show_day') { //print dol_print_date($firstdaytoshow,'dayhour').' '.dol_print_date($lastdaytoshow,'dayhour'); /*$title = $langs->trans("DoneAndToDoActions"); -if ($status == 'done') $title = $langs->trans("DoneActions"); -if ($status == 'todo') $title = $langs->trans("ToDoActions"); -*/ + if ($status == 'done') $title = $langs->trans("DoneActions"); + if ($status == 'todo') $title = $langs->trans("ToDoActions"); + */ $param = ''; if ($actioncode || GETPOSTISSET('search_actioncode')) { @@ -454,13 +454,13 @@ $param .= '&year='.$year.'&month='.$month.($day ? '&day='.$day : ''); /*$tabactive = ''; -if ($action == 'show_month') $tabactive = 'cardmonth'; -if ($action == 'show_week') $tabactive = 'cardweek'; -if ($action == 'show_day') $tabactive = 'cardday'; -if ($action == 'show_list') $tabactive = 'cardlist'; -if ($action == 'show_pertuser') $tabactive = 'cardperuser'; -if ($action == 'show_pertype') $tabactive = 'cardpertype'; -*/ + if ($action == 'show_month') $tabactive = 'cardmonth'; + if ($action == 'show_week') $tabactive = 'cardweek'; + if ($action == 'show_day') $tabactive = 'cardday'; + if ($action == 'show_list') $tabactive = 'cardlist'; + if ($action == 'show_pertuser') $tabactive = 'cardperuser'; + if ($action == 'show_pertype') $tabactive = 'cardpertype'; + */ $paramnoaction = preg_replace('/action=[a-z_]+/', '', $param); $paramnoactionodate = preg_replace('/action=[a-z_]+/', '', $paramnodate); @@ -502,14 +502,12 @@ $viewmode .= img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="p //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewDay").''; -$viewmode .= ''; +$viewmode .= ''; //$viewmode .= ''; $viewmode .= img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewPerUser").''; -$viewmode .= ''; - // Add more views from hooks $parameters = array(); $object = null; $reshook = $hookmanager->executeHooks('addCalendarView', $parameters, $object, $action); @@ -519,6 +517,8 @@ if (empty($reshook)) { $viewmode = $hookmanager->resPrint; } +$viewmode .= ''; // To add a space before the navigation tools + $newcardbutton = ''; if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) { @@ -925,13 +925,13 @@ if ($showbirthday) { $eventarray[$daykey][] = $event; /*$loop = true; - $daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee); - do { - $eventarray[$daykey][] = $event; - $daykey += 60 * 60 * 24; - if ($daykey > $event->date_end_in_calendar) $loop = false; - } while ($loop); - */ + $daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee); + do { + $eventarray[$daykey][] = $event; + $daykey += 60 * 60 * 24; + if ($daykey > $event->date_end_in_calendar) $loop = false; + } while ($loop); + */ $i++; } } else { @@ -1543,13 +1543,13 @@ if (empty($action) || $action == 'show_month') { // View by month echo "
    '; print ''; @@ -1793,10 +1793,10 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa } else { if ($user->rights->agenda->allactions->create || (($event->authorid == $user->id || $event->userownerid == $user->id) && $user->rights->agenda->myactions->create)) { - $cssclass .= " movable cursormove"; - } else { - $cssclass .= " unmovable"; - } + $cssclass .= " movable cursormove"; + } else { + $cssclass .= " unmovable"; + } } $h = ''; $nowrapontd = 1; From aca190d97723be3310aef5c26da7909a776eb0ba Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 21 Jun 2021 12:46:24 +0200 Subject: [PATCH 0805/1497] Fix css --- htdocs/comm/action/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index d619fafe850..9b76329d8da 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1794,9 +1794,9 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa if ($user->rights->agenda->allactions->create || (($event->authorid == $user->id || $event->userownerid == $user->id) && $user->rights->agenda->myactions->create)) { $cssclass .= " movable cursormove"; - } else { - $cssclass .= " unmovable"; - } + } else { + $cssclass .= " unmovable"; + } } $h = ''; $nowrapontd = 1; From ac8564dc34f3df651970e31873ab1371b809689b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 21 Jun 2021 13:06:40 +0200 Subject: [PATCH 0806/1497] Fix disable token renewal on .css.php, .js.php and .json.php --- htdocs/main.inc.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 437e024a3ae..2301ca75161 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -413,15 +413,17 @@ if ((!empty($conf->global->MAIN_VERSION_LAST_UPGRADE) && ($conf->global->MAIN_VE } // Creation of a token against CSRF vulnerabilities -if (!defined('NOTOKENRENEWAL')) -{ - // Rolling token at each call ($_SESSION['token'] contains token of previous page) - if (isset($_SESSION['newtoken'])) $_SESSION['token'] = $_SESSION['newtoken']; +if (!defined('NOTOKENRENEWAL')) { + // No token renewal on .css.php, .js.php and .json.php + if (!preg_match('/\.(css|js|json)\.php$/', $_SERVER["PHP_SELF"])) { + // Rolling token at each call ($_SESSION['token'] contains token of previous page) + if (isset($_SESSION['newtoken'])) $_SESSION['token'] = $_SESSION['newtoken']; - // Save in $_SESSION['newtoken'] what will be next token. Into forms, we will add param token = $_SESSION['newtoken'] - $token = dol_hash(uniqid(mt_rand(), true)); // Generates a hash of a random number - $_SESSION['newtoken'] = $token; - dol_syslog("NEW TOKEN reclaimed by : " . $_SERVER['PHP_SELF'], LOG_DEBUG); + // Save in $_SESSION['newtoken'] what will be next token. Into forms, we will add param token = $_SESSION['newtoken'] + $token = dol_hash(uniqid(mt_rand(), true)); // Generates a hash of a random number + $_SESSION['newtoken'] = $token; + dol_syslog("NEW TOKEN generated by : " . $_SERVER['PHP_SELF'], LOG_DEBUG); + } } //dol_syslog("aaaa - ".defined('NOCSRFCHECK')." - ".$dolibarr_nocsrfcheck." - ".$conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN." - ".$_SERVER['REQUEST_METHOD']." - ".GETPOST('token', 'alpha').' '.$_SESSION['token']); From 5697e86c090b98b051b57cdf6022200a51dd597a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 21 Jun 2021 14:11:59 +0200 Subject: [PATCH 0807/1497] Fix columns for export/import profile --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 9 ++++++--- htdocs/install/mysql/tables/llx_export_model.sql | 2 +- htdocs/install/mysql/tables/llx_import_model.sql | 3 ++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index deb40d9c7fd..8caf6e9a401 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -67,9 +67,6 @@ insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) UPDATE llx_c_country SET eec = 1 WHERE code IN ('AT','BE','BG','CY','CZ','DE','DK','EE','ES','FI','FR','GR','HR','NL','HU','IE','IM','IT','LT','LU','LV','MC','MT','PL','PT','RO','SE','SK','SI'); -ALTER TABLE llx_export_model MODIFY COLUMN type varchar(64); - - INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 11, 'US-BASE', 'USA basic chart of accounts', 1); INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 14, 'CA-ENG-BASE', 'Canadian basic chart of accounts - English', 1); INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 154, 'SAT/24-2019', 'Catalogo y codigo agrupador fiscal del 2019', 1); @@ -84,6 +81,12 @@ DELETE FROM llx_user_param where param = 'MAIN_THEME' and value in ('auguria', ' -- For v14 +ALTER TABLE llx_import_model MODIFY COLUMN type varchar(64); +ALTER TABLE llx_export_model MODIFY COLUMN type varchar(64); + +ALTER TABLE llx_import_model ADD COLUMN entity integer DEFAULT 0 NOT NULL; +ALTER TABLE llx_export_model ADD COLUMN entity integer DEFAULT 0 NOT NULL; + ALTER TABLE llx_product_lot ADD COLUMN eol_date datetime NULL; ALTER TABLE llx_product_lot ADD COLUMN manufacturing_date datetime NULL; ALTER TABLE llx_product_lot ADD COLUMN scrapping_date datetime NULL; diff --git a/htdocs/install/mysql/tables/llx_export_model.sql b/htdocs/install/mysql/tables/llx_export_model.sql index 7e68eab4ad5..cfdb2fdc530 100644 --- a/htdocs/install/mysql/tables/llx_export_model.sql +++ b/htdocs/install/mysql/tables/llx_export_model.sql @@ -22,10 +22,10 @@ create table llx_export_model ( rowid integer AUTO_INCREMENT PRIMARY KEY, + entity integer DEFAULT 0, -- by default on all entities for compatibility fk_user integer DEFAULT 0 NOT NULL, label varchar(50) NOT NULL, type varchar(64) NOT NULL, field text NOT NULL, filter text - )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_import_model.sql b/htdocs/install/mysql/tables/llx_import_model.sql index 2a110a2d80a..ceb3ae9f323 100644 --- a/htdocs/install/mysql/tables/llx_import_model.sql +++ b/htdocs/install/mysql/tables/llx_import_model.sql @@ -21,8 +21,9 @@ create table llx_import_model ( rowid integer AUTO_INCREMENT PRIMARY KEY, + entity integer DEFAULT 0 NOT NULL, -- by default on all entities for compatibility fk_user integer DEFAULT 0 NOT NULL, label varchar(50) NOT NULL, - type varchar(50) NOT NULL, + type varchar(64) NOT NULL, field text NOT NULL )ENGINE=innodb; From 31db1dc412549476fd2713f0be0628f5676c6f30 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 21 Jun 2021 15:03:45 +0200 Subject: [PATCH 0808/1497] Fix management of visibility of export/import templates. --- htdocs/admin/export.php | 3 +- htdocs/core/class/html.formother.class.php | 24 +++++++------- htdocs/exports/class/export.class.php | 8 ++--- htdocs/exports/export.php | 37 +++++++++++++++------- htdocs/imports/class/import.class.php | 19 +++++++++-- htdocs/imports/import.php | 34 +++++++++++++++++--- 6 files changed, 89 insertions(+), 36 deletions(-) diff --git a/htdocs/admin/export.php b/htdocs/admin/export.php index b83b15571b8..9b154e88789 100644 --- a/htdocs/admin/export.php +++ b/htdocs/admin/export.php @@ -86,13 +86,14 @@ print '
     
    '.$langs->trans("EXPORTS_SHARE_MODELS").' '; print ajax_constantonoff('EXPORTS_SHARE_MODELS'); print '
    '.$langs->trans("ExportCsvSeparator").'
    '; print ''; print ''; - print ''; + print ''; + print ''; print ''; print ''; - print ''; + print ''; + print ''; + $tmpuser = new User($db); + // List of existing export profils - $sql = "SELECT rowid, label"; + $sql = "SELECT rowid, label, fk_user, entity"; $sql .= " FROM ".MAIN_DB_PREFIX."export_model"; $sql .= " WHERE type = '".$db->escape($datatoexport)."'"; - if (empty($conf->global->EXPORTS_SHARE_MODELS)) { - $sql .= " AND fk_user=".$user->id; + if (empty($conf->global->EXPORTS_SHARE_MODELS)) { // EXPORTS_SHARE_MODELS means all templates are visible, whatever is owner. + $sql .= " AND fk_user IN (0, ".((int) $user->id).")"; } $sql .= " ORDER BY rowid"; $resql = $db->query($sql); @@ -1029,9 +1034,19 @@ if ($step == 4 && $datatoexport) { $i = 0; while ($i < $num) { $obj = $db->fetch_object($resql); + print ''; + print ''; + print ''; } else { print ''; @@ -157,7 +164,9 @@ $coldisplay++; $coldisplay++; print ''; if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { @@ -176,12 +185,14 @@ $coldisplay++; '; } From 0dce34f52776141f69e534becc05c9fcc98faec1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 1 Jul 2021 19:06:16 +0200 Subject: [PATCH 0969/1497] Fix trans --- htdocs/langs/en_US/salaries.lang | 6 +++--- htdocs/salaries/class/salary.class.php | 3 +++ htdocs/user/bank.php | 29 ++++++++++++-------------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/htdocs/langs/en_US/salaries.lang b/htdocs/langs/en_US/salaries.lang index cc28f87d883..504f0fbcc16 100644 --- a/htdocs/langs/en_US/salaries.lang +++ b/htdocs/langs/en_US/salaries.lang @@ -17,8 +17,8 @@ TJM=Average daily rate CurrentSalary=Current salary THMDescription=This value may be used to calculate the cost of time consumed on a project entered by users if module project is used TJMDescription=This value is currently for information only and is not used for any calculation -LastSalaries=Latest %s salary payments -AllSalaries=All salary payments +LastSalaries=Latest %s salaries +AllSalaries=All salaries SalariesStatistics=Salary statistics SalariesAndPayments=Salaries and payments -ConfirmDeleteSalaryPayment=Do you want to delete this payment of salary ? \ No newline at end of file +ConfirmDeleteSalaryPayment=Do you want to delete this salary payment ? \ No newline at end of file diff --git a/htdocs/salaries/class/salary.class.php b/htdocs/salaries/class/salary.class.php index 2f87fdd99d2..35ceb8a1931 100644 --- a/htdocs/salaries/class/salary.class.php +++ b/htdocs/salaries/class/salary.class.php @@ -502,6 +502,9 @@ class Salary extends CommonObject if ($this->datesp && $this->dateep) { $label .= '
    '.$langs->trans('Period').': '.dol_print_date($this->datesp, 'day').' - '.dol_print_date($this->dateep, 'day'); } + if (isset($this->amount)) { + $label .= '
    '.$langs->trans('Amount').': '.price($this->amount); + } $url = DOL_URL_ROOT.'/salaries/card.php?id='.$this->id; diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 0b179653487..fc9002e13fb 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -366,12 +366,12 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac $payment_salary = new PaymentSalary($db); $salary = new Salary($db); - $sql = "SELECT s.rowid as sid, s.ref as sref, s.label, s.datesp, s.dateep, s.paye, SUM(ps.amount) as alreadypaid"; + $sql = "SELECT s.rowid as sid, s.ref as sref, s.label, s.datesp, s.dateep, s.paye, s.amount, SUM(ps.amount) as alreadypaid"; $sql .= " FROM ".MAIN_DB_PREFIX."salary as s"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."payment_salary as ps ON (s.rowid = ps.fk_salary)"; $sql .= " WHERE s.fk_user = ".$object->id; $sql .= " AND s.entity IN (".getEntity('salary').")"; - $sql .= " GROUP BY s.rowid, s.ref, s.label, s.datesp, s.dateep, s.paye"; + $sql .= " GROUP BY s.rowid, s.ref, s.label, s.datesp, s.dateep, s.paye, s.amount"; $sql .= " ORDER BY s.dateep DESC"; $resql = $db->query($sql); @@ -381,7 +381,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac print '
    '.$langs->trans("ExportModelName").' '.$langs->trans("Visibility").'
    '; + print ''; + $arrayvisibility = array('private'=>$langs->trans("Private"), 'all'=>$langs->trans("Everybody")); + print $form->selectarray('visibility', $arrayvisibility, 'private'); + print ''; print ''; print '
    '; print $obj->label; - print ''; + print ''; + if (empty($obj->fk_user)) { + print $langs->trans("Everybody"); + } else { + $tmpuser->fetch($obj->fk_user); + print $tmpuser->getNomUrl(1); + } + print ''; print 'rowid.'">'; print img_delete(); print ''; diff --git a/htdocs/imports/class/import.class.php b/htdocs/imports/class/import.class.php index 567aaf754a8..44ec5935d49 100644 --- a/htdocs/imports/class/import.class.php +++ b/htdocs/imports/class/import.class.php @@ -55,6 +55,12 @@ class Import */ public $errors = array(); + // To store import templates + public $hexa; // List of fields in the export profile + public $datatoimport; + public $model_name; // Name of export profile + public $fk_user; + /** * Constructor @@ -266,11 +272,18 @@ class Import $this->db->begin(); $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'import_model ('; - $sql .= 'fk_user, label, type, field'; + $sql .= 'fk_user,'; + $sql .= ' label,'; + $sql .= ' type,'; + $sql .= ' field'; $sql .= ')'; - $sql .= " VALUES (".($user->id > 0 ? $user->id : 0).", '".$this->db->escape($this->model_name)."', '".$this->db->escape($this->datatoimport)."', '".$this->db->escape($this->hexa)."')"; + $sql .= " VALUES ("; + $sql .= (isset($this->fk_user) ? (int) $this->fk_user : 'null').","; + $sql .= " '".$this->db->escape($this->model_name)."',"; + $sql .= " '".$this->db->escape($this->datatoimport)."',"; + $sql .= " '".$this->db->escape($this->hexa)."'"; + $sql .= ")"; - dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { $this->db->commit(); diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 20a846123f1..4c5975ecb43 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -226,6 +226,7 @@ if ($action == 'add_import_model') { $objimport->model_name = $import_name; $objimport->datatoimport = $datatoimport; $objimport->hexa = $hexa; + $objimport->fk_user = (GETPOST('visibility', 'aZ09') == 'all' ? 0 : $user->id); $result = $objimport->create($user); if ($result >= 0) { @@ -968,7 +969,7 @@ if ($step == 4 && $datatoimport) { $s = str_replace('{s1}', img_picto('', 'grip_title', '', false, 0, 0, '', '', 0), $s); print $s; print ' '; - $htmlother->select_import_model($importmodelid, 'importmodelid', $datatoimport, 1); + $htmlother->select_import_model($importmodelid, 'importmodelid', $datatoimport, 1, $user->id); print ''; print ''; print ''; @@ -1249,28 +1250,51 @@ if ($step == 4 && $datatoimport) { print ''; print ''; print ''; - print ''; + print ''; + print ''; print ''; print ''; - print ''; + print ''; + print ''; // List of existing import profils - $sql = "SELECT rowid, label"; + $sql = "SELECT rowid, label, fk_user, entity"; $sql .= " FROM ".MAIN_DB_PREFIX."import_model"; $sql .= " WHERE type = '".$db->escape($datatoimport)."'"; + if (empty($conf->global->EXPORTS_SHARE_MODELS)) { // EXPORTS_SHARE_MODELS means all templates are visible, whatever is owner. + $sql .= " AND fk_user IN (0, ".((int) $user->id).")"; + } $sql .= " ORDER BY rowid"; + $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); + + $tmpuser = new user($db); + $i = 0; while ($i < $num) { $obj = $db->fetch_object($resql); + print ''; + print ''; + print ''; print ''; print ''; print '
    '.$langs->trans("ImportModelName").' '.$langs->trans("Visibility").'
    '; + print ''; + $arrayvisibility = array('private'=>$langs->trans("Private"), 'all'=>$langs->trans("Everybody")); + print $form->selectarray('visibility', $arrayvisibility, 'private'); + print ''; print ''; print '
    '; print $obj->label; - print ''; + print ''; + if (empty($obj->fk_user)) { + print $langs->trans("Everybody"); + } else { + $tmpuser->fetch($obj->fk_user); + print $tmpuser->getNomUrl(1); + } + print ''; print 'rowid.'&filetoimport='.urlencode($filetoimport).'">'; print img_delete(); print ''; From f48b2812a3d263da54e08818168e8f68a1e9d5be Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 21 Jun 2021 15:26:14 +0200 Subject: [PATCH 0809/1497] Doc --- ChangeLog | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ef4f01d84c7..98c22d90bf7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -64,7 +64,7 @@ NEW: VAT payment request and VAT payment are now 2 different steps in workflow o NEW: VAT report - Optimisation & collapse by rate NEW: When a doc file is shared, link is visible from the main page of doc. NEW: #16378 more E-Mail Contact substitution Values for better salutation -NEW: option to keep the "Automatically create a total payment" checkbox empty on the tax creation page +NEW: option to keep the "Automatically create the payment" checkbox empty on the tax creation page Accountancy NEW: Accountancy - Add FEC import @@ -285,7 +285,6 @@ FIX: test must be === and not == FIX: test on link type FIX: type link extrafield case for advanced target emailing FIX: Write right on document ->>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git ***** ChangeLog for 13.0.2 compared to 13.0.1 ***** From 05bb2c720d06501eb6e744996201e0b9c5b0bd7e Mon Sep 17 00:00:00 2001 From: damien clochard Date: Mon, 21 Jun 2021 18:24:52 +0200 Subject: [PATCH 0810/1497] FIX #17996: Avoid implicit type casts for llx_adherent_type.subscription The llx_adherent_type.subscription column is VARCHAR so we need to compare it with a string, not an int. --- htdocs/adherents/list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 7a4a7d5bc1f..d669270b565 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -363,13 +363,13 @@ if ($search_type > 0) { $sql .= " AND t.rowid=".((int) $search_type); } if ($search_filter == 'withoutsubscription') { - $sql .= " AND (datefin IS NULL OR t.subscription = 0)"; + $sql .= " AND (datefin IS NULL OR t.subscription = '0')"; } if ($search_filter == 'uptodate') { - $sql .= " AND (datefin >= '".$db->idate($now)."' OR t.subscription = 0)"; + $sql .= " AND (datefin >= '".$db->idate($now)."' OR t.subscription = '0')"; } if ($search_filter == 'outofdate') { - $sql .= " AND (datefin < '".$db->idate($now)."' AND t.subscription = 1)"; + $sql .= " AND (datefin < '".$db->idate($now)."' AND t.subscription = '1')"; } if ($search_status != '') { // Peut valoir un nombre ou liste de nombre separes par virgules From a0b594fbdc5b490a99107a10903aea89d87c5a3b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 21 Jun 2021 19:47:43 +0200 Subject: [PATCH 0811/1497] Debug emailcollector --- htdocs/admin/emailcollector_card.php | 28 +-- htdocs/core/class/commonobject.class.php | 10 +- htdocs/core/class/translate.class.php | 2 +- .../class/emailcollector.class.php | 5 +- .../template/class/myobject.class.php | 4 + test/phpunit/AllTests.php | 4 + test/phpunit/EmailCollector.php | 235 ++++++++++++++++++ 7 files changed, 269 insertions(+), 19 deletions(-) create mode 100644 test/phpunit/EmailCollector.php diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index 724c4ab6dd4..4e2c9e34bf9 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -482,13 +482,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; // Filters - print '
    '; - print ''; - print ''; + print '
    '; + print '
    '; + print ''; print ''; print ''; // Add filter - print ''; + print ''; print ''; echo ''; // Fields for situation invoice -if ($this->situation_cycle_ref) { +if (isset($this->situation_cycle_ref) && $this->situation_cycle_ref) { print ''; print ''; } diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 8e9d72d40b4..3b4bb3cfdcb 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -132,7 +132,7 @@ if (($line->info_bits & 2) == 2) { } } } else { - $format = $conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE ? 'dayhour' : 'day'; + $format = (isset($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE) && $conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE) ? 'dayhour' : 'day'; if ($line->fk_product > 0) { print $form->textwithtooltip($text, $description, 3, '', '', $i, 0, (!empty($line->fk_parent_line) ?img_picto('', 'rightarrow') : '')); @@ -288,7 +288,7 @@ if (!empty($line->remise_percent) && $line->special_code != 3) { } // Fields for situation invoices -if ($this->situation_cycle_ref) { +if (isset($this->situation_cycle_ref) && $this->situation_cycle_ref) { include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; $coldisplay++; print ''; diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index c4e8a1d7226..3ed7441afa5 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -301,3 +301,4 @@ ErrorActionCommPropertyUserowneridNotDefined=User's owner is required ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary CheckVersionFail=Version check fail ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it +ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. From 796b2d201acb9938b903fb2afa297db289ecc93e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Jun 2021 18:17:27 +0200 Subject: [PATCH 0932/1497] Enhance the sanitizing. --- htdocs/core/lib/functions.lib.php | 8 ++++++-- htdocs/main.inc.php | 9 +++++---- test/phpunit/SecurityTest.php | 10 +++++----- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index e3b288aff8e..87a4b966056 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -778,8 +778,12 @@ function checkVal($out = '', $check = 'alphanohtml', $filter = null, $options = do { $oldstringtoclean = $out; - // We replace chars encoded with numeric HTML entities with real char (to avoid to have numeric entities used for obfuscation of injections) - $out = preg_replace_callback('/&#(x?[0-9][0-9a-f]+);/i', 'realCharForNumericEntities', $out); + // We replace chars from a/A to z/Z encoded with numeric HTML entities with the real char so we won't loose the chars at the next step. + // No need to use a loop here, this step is not to sanitize (this is done at next step, this is to try to save chars, even if they are + // using a non coventionnel way to be encoded, to not have them sanitized just after) + $out = preg_replace_callback('/&#(x?[0-9][0-9a-f]+;?)/i', 'realCharForNumericEntities', $out); + + // Now we remove all remaining HTML entities staring with a number. We don't want such entities. $out = preg_replace('/&#x?[0-9]+/i', '', $out); // For example if we have javascript with an entities without the ; to hide the 'a' of 'javascript'. $out = dol_string_onlythesehtmltags($out, 0, 1, 1); diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 93388190275..b66b5f5b211 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -53,7 +53,7 @@ if (!empty($_SERVER['MAIN_SHOW_TUNING_INFO'])) { /** * Return the real char for a numeric entities. - * This function is required by testSqlAndScriptInject(). + * WARNING: This function is required by testSqlAndScriptInject() and the GETPOST 'restricthtml'. Regex calling must be similar. * * @param string $matches String of numeric entity * @return string New value @@ -61,17 +61,18 @@ if (!empty($_SERVER['MAIN_SHOW_TUNING_INFO'])) { function realCharForNumericEntities($matches) { $newstringnumentity = $matches[1]; + //print '$newstringnumentity='.$newstringnumentity; if (preg_match('/^x/i', $newstringnumentity)) { - $newstringnumentity = hexdec(preg_replace('/^x/i', '', $newstringnumentity)); + $newstringnumentity = hexdec(preg_replace('/;$/', '', preg_replace('/^x/i', '', $newstringnumentity))); } - // The numeric value we don't want as entities + // The numeric value we don't want as entities because they encode ascii char, and why using html entities on ascii except for haking ? if (($newstringnumentity >= 65 && $newstringnumentity <= 90) || ($newstringnumentity >= 97 && $newstringnumentity <= 122)) { return chr((int) $newstringnumentity); } - return '&#'.$matches[1]; + return '&#'.$matches[1]; // Value will be unchanged because regex was /&#( )/ } /** diff --git a/test/phpunit/SecurityTest.php b/test/phpunit/SecurityTest.php index 7e93f7673f2..08d4ec88703 100644 --- a/test/phpunit/SecurityTest.php +++ b/test/phpunit/SecurityTest.php @@ -345,7 +345,7 @@ class SecurityTest extends PHPUnit\Framework\TestCase $_GET["param5"]="a_1-b"; $_POST["param6"]="">assertEquals('">', $result); $result=GETPOST("param7", 'restricthtml'); - print __METHOD__." result=".$result."\n"; - $this->assertEquals('"c:\this is a path~1\aaan" abcdef', $result); + print __METHOD__." result param7 = ".$result."\n"; + $this->assertEquals('"c:\this is a path~1\aaan &#x;;;;" abcdef', $result); $result=GETPOST("param12", 'restricthtml'); print __METHOD__." result=".$result."\n"; @@ -488,11 +488,11 @@ class SecurityTest extends PHPUnit\Framework\TestCase $result=GETPOST("param13", 'restricthtml'); print __METHOD__." result=".$result."\n"; - $this->assertEquals('n n > < " XSS', $result, 'Test that HTML entities are decoded with restricthtml, but only for common alpha chars'); + $this->assertEquals('n n > < " XSS', $result, 'Test 13 that HTML entities are decoded with restricthtml, but only for common alpha chars'); $result=GETPOST("param13b", 'restricthtml'); print __METHOD__." result=".$result."\n"; - $this->assertEquals('n n > < " XSS', $result, 'Test that HTML entities are decoded with restricthtml, but only for common alpha chars'); + $this->assertEquals('n n > < " XSS', $result, 'Test 13b that HTML entities are decoded with restricthtml, but only for common alpha chars'); // Special test for GETPOST of backtopage, backtolist or backtourl parameter From 7aeb652c66a7cfff1e43fbbfe8985fed14b5b770 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Jun 2021 18:22:36 +0200 Subject: [PATCH 0933/1497] Better sanitizing, fix phpcs --- .../reception/doc/pdf_squille.modules.php | 3 +-- .../doc/pdf_standard_myobject.modules.php | 16 ++++++++-------- ...standard_recruitmentjobposition.modules.php | 18 +++++++++--------- 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index 2f4427d7566..68ceb87ba96 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -145,8 +145,7 @@ class pdf_squille extends ModelePdfReception $objphoto = new Product($this->db); $objphoto->fetch($object->lines[$i]->fk_product); - if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) - { + if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) { $pdir = get_exdir($object->lines[$i]->fk_product, 2, 0, 0, $objphoto, 'product').$object->lines[$i]->fk_product."/photos/"; $dir = $conf->product->dir_output.'/'.$pdir; } else { diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php index e5e352def43..43457d6620d 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php @@ -240,14 +240,14 @@ class pdf_standard_myobject extends ModelePDFMyObject { if (empty($object->lines[$i]->fk_product)) continue; - //var_dump($objphoto->ref);exit; - if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) { - $pdir[0] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; - $pdir[1] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; - } else { - $pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product'); // default - $pdir[1] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; // alternative - } + //var_dump($objphoto->ref);exit; + if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) { + $pdir[0] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; + $pdir[1] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; + } else { + $pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product'); // default + $pdir[1] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; // alternative + } $arephoto = false; foreach ($pdir as $midir) diff --git a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php index 4600377ee01..4c6cb84783a 100644 --- a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php +++ b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php @@ -251,15 +251,15 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio { if (empty($object->lines[$i]->fk_product)) continue; - $objphoto->fetch($object->lines[$i]->fk_product); - //var_dump($objphoto->ref);exit; - if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) { - $pdir[0] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; - $pdir[1] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; - } else { - $pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product'); // default - $pdir[1] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; // alternative - } + $objphoto->fetch($object->lines[$i]->fk_product); + //var_dump($objphoto->ref);exit; + if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) { + $pdir[0] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; + $pdir[1] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; + } else { + $pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product'); // default + $pdir[1] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; // alternative + } $arephoto = false; foreach ($pdir as $midir) From 0f020d5b203e5724b17e3e5f05c2eb0d4aa6b991 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Jun 2021 19:05:18 +0200 Subject: [PATCH 0934/1497] Fix for phpv8 --- htdocs/core/lib/geturl.lib.php | 2 +- htdocs/main.inc.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/geturl.lib.php b/htdocs/core/lib/geturl.lib.php index f87e7b7b4cd..3398189a771 100644 --- a/htdocs/core/lib/geturl.lib.php +++ b/htdocs/core/lib/geturl.lib.php @@ -223,7 +223,7 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation = // Set CURLOPT_CONNECT_TO so curl will not try another resolution that may give a different result. Possible only on PHP v7+ if (defined('CURLOPT_CONNECT_TO')) { - $connect_to = array(sprintf("%s:%d:%s:%d", $newUrlArray['host'], $newUrlArray['port'], $iptocheck, $newUrlArray['port'])); + $connect_to = array(sprintf("%s:%d:%s:%d", $newUrlArray['host'], empty($newUrlArray['port'])?'':$newUrlArray['port'], $iptocheck, empty($newUrlArray['port'])?'':$newUrlArray['port'])); //var_dump($newUrlArray); //var_dump($connect_to); curl_setopt($ch, CURLOPT_CONNECT_TO, $connect_to); diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index b66b5f5b211..bd0d77d3389 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -60,11 +60,11 @@ if (!empty($_SERVER['MAIN_SHOW_TUNING_INFO'])) { */ function realCharForNumericEntities($matches) { - $newstringnumentity = $matches[1]; - //print '$newstringnumentity='.$newstringnumentity; + $newstringnumentity = preg_replace('/;$/', '', $matches[1]); + //print ' $newstringnumentity='.$newstringnumentity; if (preg_match('/^x/i', $newstringnumentity)) { - $newstringnumentity = hexdec(preg_replace('/;$/', '', preg_replace('/^x/i', '', $newstringnumentity))); + $newstringnumentity = hexdec(preg_replace('/^x/i', '', $newstringnumentity)); } // The numeric value we don't want as entities because they encode ascii char, and why using html entities on ascii except for haking ? From 56787bc292074f4f576b1386f1c3073a246c8971 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Jun 2021 19:14:03 +0200 Subject: [PATCH 0935/1497] 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 265f515233f..1f6a03ca351 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2367,7 +2367,7 @@ if (empty($reshook)) { $line = new FactureLigne($db); $line->fetch(GETPOST('lineid', 'int')); $percent = $line->get_prev_progress($object->id); - $progress = floatval(GETPOST('progress', 'int')); + $progress = price2num(GETPOST('progress', 'alpha')); if ($object->type == Facture::TYPE_CREDIT_NOTE && $object->situation_cycle_ref > 0) { // in case of situation credit note From 2860e12b6558c1bb5dfd39a1e9072b530ad70ffb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Jun 2021 19:16:29 +0200 Subject: [PATCH 0936/1497] Update objectline_view.tpl.php --- htdocs/core/tpl/objectline_view.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 3b4bb3cfdcb..c0339c28fc4 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -132,7 +132,7 @@ if (($line->info_bits & 2) == 2) { } } } else { - $format = (isset($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE) && $conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE) ? 'dayhour' : 'day'; + $format = (!empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE) ? 'dayhour' : 'day'); if ($line->fk_product > 0) { print $form->textwithtooltip($text, $description, 3, '', '', $i, 0, (!empty($line->fk_parent_line) ?img_picto('', 'rightarrow') : '')); From d379151da6a4543294f68cc70ee3f2e630fbd7af Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Jun 2021 19:19:38 +0200 Subject: [PATCH 0937/1497] Fix doc --- test/phpunit/KnowledgeRecordTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/phpunit/KnowledgeRecordTest.php b/test/phpunit/KnowledgeRecordTest.php index fc6f385e25d..5e4d9a0d301 100644 --- a/test/phpunit/KnowledgeRecordTest.php +++ b/test/phpunit/KnowledgeRecordTest.php @@ -87,7 +87,7 @@ class KnowledgeRecordTest extends PHPUnit\Framework\TestCase $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. if (empty($conf->knowledgemanagement->enabled)) { - print __METHOD__." module knowledgemanagement order must be enabled.\n"; die(1); + print __METHOD__." module knowledgemanagement must be enabled.\n"; die(1); } } From d59dfcb08a11c10323c75b2e35e424af4a02e059 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Jun 2021 19:21:35 +0200 Subject: [PATCH 0938/1497] Update list.php --- htdocs/accountancy/customer/list.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 5ce9f5e13e8..97d94a42f00 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -739,11 +739,13 @@ if ($result) { $s .= (empty($objp->code_sell_p) ? ''.$langs->trans("NotDefined").'' : length_accountg($objp->code_sell_p)); print $form->textwithpicto($s, $shelp, 1, $ttype, '', 0, 2, '', 1); } else { - print '
    '; - $s = '2. '.(($objp->type_l == 1) ? $langs->trans("ThisService") : $langs->trans("ThisProduct")).': '; - $shelp = ''; - $s .= $langs->trans("NotDefined"); - print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1); + if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) { + print '
    '; + $s = '2. '.(($objp->type_l == 1) ? $langs->trans("ThisService") : $langs->trans("ThisProduct")).': '; + $shelp = ''; + $s .= $langs->trans("NotDefined"); + print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1); + } } if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) { print '
    '; From c74060d02cdc3da264a8c1ab4bdc5b5aa7805b6a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Jun 2021 19:24:46 +0200 Subject: [PATCH 0939/1497] Fix lost change in merge --- htdocs/accountancy/customer/list.php | 12 +++++------- htdocs/societe/card.php | 6 ++---- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 97d94a42f00..5ce9f5e13e8 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -739,13 +739,11 @@ if ($result) { $s .= (empty($objp->code_sell_p) ? ''.$langs->trans("NotDefined").'' : length_accountg($objp->code_sell_p)); print $form->textwithpicto($s, $shelp, 1, $ttype, '', 0, 2, '', 1); } else { - if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) { - print '
    '; - $s = '2. '.(($objp->type_l == 1) ? $langs->trans("ThisService") : $langs->trans("ThisProduct")).': '; - $shelp = ''; - $s .= $langs->trans("NotDefined"); - print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1); - } + print '
    '; + $s = '2. '.(($objp->type_l == 1) ? $langs->trans("ThisService") : $langs->trans("ThisProduct")).': '; + $shelp = ''; + $s .= $langs->trans("NotDefined"); + print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1); } if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) { print '
    '; diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index a2b229147fa..8e1d03411cd 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1659,8 +1659,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); print $formaccounting->select_account($accountancy_code_buy, 'accountancy_code_buy', 1, null, 1, 1, ''); print '
    '; - } else // For external software - { + } else { // For external software // Accountancy_code_sell print ''; print ''; - } else // For external software - { + } else { // For external software // Accountancy_code_sell print ''; print ''; - print '\n"; - print ''; + print ''; print ""; From 94974af738d9e15edfd1f3f5397fce775aeb291a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 30 Jun 2021 01:52:54 +0200 Subject: [PATCH 0943/1497] trans --- htdocs/knowledgemanagement/knowledgerecord_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index efaf99b63a9..173ec749e2a 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -202,7 +202,7 @@ $now = dol_now(); //$help_url="EN:Module_KnowledgeRecord|FR:Module_KnowledgeRecord_FR|ES:Módulo_KnowledgeRecord"; $help_url = ''; -$title = $langs->trans('ListOfArticles'); +$title = $langs->trans('ListKnowledgeRecord'); $morejs = array(); $morecss = array(); From f95b5be971ded339888d57099c3af77288b73538 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 30 Jun 2021 04:55:22 +0200 Subject: [PATCH 0944/1497] FIX Accountancy - Clean virtual zero on the import --- htdocs/core/modules/import/import_csv.modules.php | 6 +++++- htdocs/core/modules/import/import_xlsx.modules.php | 6 +++++- htdocs/core/modules/modAccounting.class.php | 6 +++--- htdocs/core/modules/modProduct.class.php | 8 +++++++- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index 52b7af1fee5..6bec94d6130 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -624,7 +624,11 @@ class ImportCsv extends ModeleImports } elseif ($objimport->array_import_convertvalue[0][$val]['rule'] == 'numeric') { $newval = price2num($newval); } elseif ($objimport->array_import_convertvalue[0][$val]['rule'] == 'accountingaccount') { - $newval = rtrim($newval, "0"); + if (empty($conf->global->ACCOUNTING_MANAGE_ZERO)) { + $newval = rtrim(trim($newval), "0"); + } else { + $newval = trim($newval); + } } //print 'Val to use as insert is '.$newval.'
    '; diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index abc2a80abc9..0378180475d 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -665,7 +665,11 @@ class ImportXlsx extends ModeleImports } elseif ($objimport->array_import_convertvalue[0][$val]['rule'] == 'numeric') { $newval = price2num($newval); } elseif ($objimport->array_import_convertvalue[0][$val]['rule'] == 'accountingaccount') { - $newval = rtrim($newval, "0"); + if (empty($conf->global->ACCOUNTING_MANAGE_ZERO)) { + $newval = rtrim(trim($newval), "0"); + } else { + $newval = trim($newval); + } } //print 'Val to use as insert is '.$newval.'
    '; diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php index f86a2078c9e..d6127f65b83 100644 --- a/htdocs/core/modules/modAccounting.class.php +++ b/htdocs/core/modules/modAccounting.class.php @@ -297,9 +297,9 @@ class modAccounting extends DolibarrModules ); $this->import_fieldshidden_array[$r] = array('b.doc_type'=>'const-import_from_external', 'b.fk_doc'=>'const-0', 'b.fk_docdet'=>'const-0', 'b.fk_user_author'=>'user->id', 'b.date_creation'=>'const-'.dol_print_date(dol_now(), 'standard')); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent) $this->import_regex_array[$r] = array('b.doc_date'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$'); - $this->import_convertvalue_array[$r]=array( - 'b.numero_compte'=>array('rule'=>'accountingaccount'), - 'b.subledger_account'=>array('rule'=>'accountingaccount') + $this->import_convertvalue_array[$r] = array( + 'b.numero_compte' => array('rule' => 'accountingaccount'), + 'b.subledger_account' => array('rule' => 'accountingaccount') ); $this->import_examplevalues_array[$r] = array( 'b.piece_num'=>'123 (!!! use next value not already used)', diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index 3459973a699..37cda4b7b30 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -572,7 +572,13 @@ class modProduct extends DolibarrModules 'class' => 'CProductNature', 'method' => 'fetch', 'dict' => 'DictionaryProductNature' - ), + ), + 'p.accountancy_code_sell'=>array('rule'=>'accountingaccount'), + 'p.accountancy_code_sell_intra'=>array('rule'=>'accountingaccount'), + 'p.accountancy_code_sell_export'=>array('rule'=>'accountingaccount'), + 'p.accountancy_code_buy'=>array('rule'=>'accountingaccount'), + 'p.accountancy_code_buy_intra'=>array('rule'=>'accountingaccount'), + 'p.accountancy_code_buy_export'=>array('rule'=>'accountingaccount'), ); $this->import_regex_array[$r] = array( From 94416072d8a5ae072cfeed77781fb5db8b88c59f Mon Sep 17 00:00:00 2001 From: Florian Mortgat Date: Wed, 30 Jun 2021 09:34:49 +0200 Subject: [PATCH 0945/1497] FIX after PR feedback: remove uses of `keyword` attribute of EcmFiles (use `keywords` instead) --- htdocs/core/lib/files.lib.php | 4 ++-- htdocs/ecm/class/ecmfiles.class.php | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 8e44e30f445..5b2f9fa7f4b 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1785,13 +1785,13 @@ function addFileIntoDatabaseIndex($dir, $file, $fullpathorig = '', $mode = 'uplo $ecmfile->fullpath_orig = $fullpathorig; $ecmfile->gen_or_uploaded = $mode; $ecmfile->description = ''; // indexed content - $ecmfile->keyword = ''; // keyword content + $ecmfile->keywords = ''; // keyword content if (is_object($object) && $object->id > 0) { $ecmfile->src_object_id = $object->id; if (isset($object->table_element)) $ecmfile->src_object_type = $object->table_element; if (isset($object->src_object_description)) $ecmfile->description = $object->src_object_description; - if (isset($object->src_object_keyword)) $ecmfile->keyword = $object->src_object_keyword; + if (isset($object->src_object_keywords)) $ecmfile->keywords = $object->src_object_keywords; } if ($setsharekey) { diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php index df18aa13d2f..035a7aee9c6 100644 --- a/htdocs/ecm/class/ecmfiles.class.php +++ b/htdocs/ecm/class/ecmfiles.class.php @@ -288,7 +288,6 @@ class EcmFiles extends CommonObject $sql .= 'fullpath_orig,'; $sql .= 'description,'; $sql .= 'keywords,'; - $sql .= 'keyword,'; $sql .= 'cover,'; $sql .= 'position,'; $sql .= 'gen_or_uploaded,'; @@ -310,7 +309,6 @@ class EcmFiles extends CommonObject $sql .= ' '.(!isset($this->fullpath_orig) ? 'NULL' : "'".$this->db->escape($this->fullpath_orig)."'").','; $sql .= ' '.(!isset($this->description) ? 'NULL' : "'".$this->db->escape($this->description)."'").','; $sql .= ' '.(!isset($this->keywords) ? 'NULL' : "'".$this->db->escape($this->keywords)."'").','; - $sql .= ' '.(!isset($this->keyword) ? 'NULL' : "'".$this->db->escape($this->keyword)."'").','; $sql .= ' '.(!isset($this->cover) ? 'NULL' : "'".$this->db->escape($this->cover)."'").','; $sql .= ' '.$maxposition.','; $sql .= ' '.(!isset($this->gen_or_uploaded) ? 'NULL' : "'".$this->db->escape($this->gen_or_uploaded)."'").','; From 0b5e231dd5cbd63a4e00dd3ebfef1479eab60cbf Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Wed, 30 Jun 2021 10:18:14 +0200 Subject: [PATCH 0946/1497] add labels and export only latest prices --- htdocs/core/modules/modProduct.class.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index 3459973a699..dc769451e67 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -322,7 +322,7 @@ class modProduct extends DolibarrModules $this->export_code[$r] = $this->rights_class.'_'.$r; $this->export_label[$r] = "ProductsMultiPrice"; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_permission[$r] = array(array("produit", "export")); - $this->export_fields_array[$r] = array('p.rowid'=>"Id", 'p.ref'=>"Ref", + $this->export_fields_array[$r] = array('p.rowid'=>"Id", 'p.ref'=>"Ref", 'p.label'=>"Label", 'pr.price_base_type'=>"PriceBase", 'pr.price_level'=>"PriceLevel", 'pr.price'=>"PriceLevelUnitPriceHT", 'pr.price_ttc'=>"PriceLevelUnitPriceTTC", 'pr.price_min'=>"MinPriceLevelUnitPriceHT", 'pr.price_min_ttc'=>"MinPriceLevelUnitPriceTTC", @@ -337,7 +337,7 @@ class modProduct extends DolibarrModules // 'p.price_base_type'=>"Text",'p.price'=>"Numeric",'p.price_ttc'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean", // 'p.datec'=>'Date','p.tms'=>'Date' //); - $this->export_entities_array[$r] = array('p.rowid'=>"product", 'p.ref'=>"product", + $this->export_entities_array[$r] = array('p.rowid'=>"product", 'p.ref'=>"product", 'p.label'=>"Label", 'pr.price_base_type'=>"product", 'pr.price_level'=>"product", 'pr.price'=>"product", 'pr.price_ttc'=>"product", 'pr.price_min'=>"product", 'pr.price_min_ttc'=>"product", @@ -348,6 +348,8 @@ class modProduct extends DolibarrModules $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'product as p'; $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_price as pr ON p.rowid = pr.fk_product AND pr.entity = '.$conf->entity; // export prices only for the current entity $this->export_sql_end[$r] .= ' WHERE p.entity IN ('.getEntity('product').')'; // For product and service profile + $this->export_sql_end[$r] .= ' AND pr.date_price = (SELECT MAX(pr2.date_price) FROM '.MAIN_DB_PREFIX.'product_price as pr2 WHERE pr2.fk_product = pr.fk_product)'; + $this->export_sql_end[$r] .= ' ORDER BY p.ref, pr.price_level'; } if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { @@ -356,7 +358,7 @@ class modProduct extends DolibarrModules $this->export_code[$r] = $this->rights_class.'_'.$r; $this->export_label[$r] = "ProductsPricePerCustomer"; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_permission[$r] = array(array("produit", "export")); - $this->export_fields_array[$r] = array('p.rowid'=>"Id", 'p.ref'=>"Ref", + $this->export_fields_array[$r] = array('p.rowid'=>"Id", 'p.ref'=>"Ref", 'p.label'=>"Label", 's.nom'=>'ThirdParty', 'pr.price_base_type'=>"PriceBase", 'pr.price'=>"PriceUnitPriceHT", 'pr.price_ttc'=>"PriceUnitPriceTTC", @@ -367,7 +369,7 @@ class modProduct extends DolibarrModules if (is_object($mysoc) && $usenpr) { $this->export_fields_array[$r]['pr.recuperableonly'] = 'NPR'; } - $this->export_entities_array[$r] = array('p.rowid'=>"product", 'p.ref'=>"product", + $this->export_entities_array[$r] = array('p.rowid'=>"product", 'p.ref'=>"product", 'p.label'=>"Label", 's.nom'=>'company', 'pr.price_base_type'=>"product", 'pr.price'=>"product", 'pr.price_ttc'=>"product", From 4f2e579bb2c5966a86ea7e33149a35589ea8797a Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Wed, 30 Jun 2021 10:21:31 +0200 Subject: [PATCH 0947/1497] add labels and export only latest prices --- htdocs/core/modules/modProduct.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index dc769451e67..62e355d8e6a 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -348,7 +348,7 @@ class modProduct extends DolibarrModules $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'product as p'; $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_price as pr ON p.rowid = pr.fk_product AND pr.entity = '.$conf->entity; // export prices only for the current entity $this->export_sql_end[$r] .= ' WHERE p.entity IN ('.getEntity('product').')'; // For product and service profile - $this->export_sql_end[$r] .= ' AND pr.date_price = (SELECT MAX(pr2.date_price) FROM '.MAIN_DB_PREFIX.'product_price as pr2 WHERE pr2.fk_product = pr.fk_product)'; + $this->export_sql_end[$r] .= ' AND pr.date_price = (SELECT MAX(pr2.date_price) FROM '.MAIN_DB_PREFIX.'product_price as pr2 WHERE pr2.fk_product = pr.fk_product)'; // export only latest prices not full history $this->export_sql_end[$r] .= ' ORDER BY p.ref, pr.price_level'; } From dcd4d5362247db1bda448c64b6b6760108b5e5d1 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Wed, 30 Jun 2021 10:22:00 +0200 Subject: [PATCH 0948/1497] Fix php 8 warning in adherents list --- htdocs/adherents/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index d669270b565..1c93b247dfc 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -65,6 +65,7 @@ $search_filter = GETPOST("search_filter", 'alpha'); $search_status = GETPOST("search_status", 'intcomma'); $catid = GETPOST("catid", 'int'); $optioncss = GETPOST('optioncss', 'alpha'); +$socid = GETPOST('socid', 'int'); $filter = GETPOST("filter", 'alpha'); if ($filter) { From 2ab97d522d523507c7fefd966c351d2945827b0d Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Wed, 30 Jun 2021 10:30:46 +0200 Subject: [PATCH 0949/1497] Fix php 8.0 warning societe index --- htdocs/societe/index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index f5a4392a0c0..14901dc8a9c 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -185,6 +185,7 @@ $thirdpartygraph .= '
    '; $thirdpartygraph .= '
    '.$form->textwithpicto($langs->trans("Filters"), $langs->trans("EmailCollectorFilterDesc")).'
    '; $arrayoftypes = array( 'from'=>array('label'=>'MailFrom', 'data-placeholder'=>$langs->trans('SearchString')), @@ -518,7 +518,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea 'isnotanswer'=>array('label'=>'IsNotAnAnswer', 'data-noparam'=>1), 'isanswer'=>array('label'=>'IsAnAnswer', 'data-noparam'=>1) ); - print $form->selectarray('filtertype', $arrayoftypes, '', 1, 0, 0, '', 1, 0, 0, '', 'maxwidth500', 1, '', 2); + print $form->selectarray('filtertype', $arrayoftypes, '', 1, 0, 0, '', 1, 0, 0, '', 'maxwidth300', 1, '', 2); print "\n"; print ''; - $arrayofselected = is_array($toselect) ? $toselect : array(); $param = ''; diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php index 056a73328dc..1d994e25177 100644 --- a/htdocs/asset/list.php +++ b/htdocs/asset/list.php @@ -305,21 +305,6 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ llxHeader('', $title, $help_url); -// Example : Adding jquery code -print ''; - $arrayofselected = is_array($toselect) ? $toselect : array(); $param = ''; diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index fbd219a298b..b598b95ae0a 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -244,22 +244,6 @@ $title = $langs->trans('BOM'); $help_url ='EN:Module_BOM'; llxHeader('', $title, $help_url); -// Example : Adding jquery code -print ''; - - // Part to create if ($action == 'create') { print load_fiche_titre($langs->trans("NewBOM"), '', 'bom'); diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php index ab8451c9e59..ec7af37940c 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_list.php +++ b/htdocs/compta/cashcontrol/cashcontrol_list.php @@ -343,21 +343,6 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'classforhorizontalscrolloftabs'); -// Example : Adding jquery code -print ''; - $arrayofselected = is_array($toselect) ? $toselect : array(); $param = ''; diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index b51823242f8..d7f7cdb8bb1 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -253,20 +253,6 @@ if ($projectid > 0) { llxHeader('', $title, $help_url); -// Example : Adding jquery code -print ''; if ($projectid > 0) { // To verify role of users diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 9a689c79a08..cac59593950 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -212,19 +212,19 @@ $help_url = ''; llxHeader('', $title, $help_url); // Example : Adding jquery code -print ''; +// print ''; // Part to create diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 41561a5a45b..abc8b879d33 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -386,19 +386,19 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'classforhorizontalscrolloftabs'); // Example : Adding jquery code -print ''; +// print ''; $arrayofselected = is_array($toselect) ? $toselect : array(); diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index fad22645cd5..b6cc502bd60 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -201,20 +201,6 @@ $title = $langs->trans('Mo')." - ".$langs->trans("Card"); llxHeader('', $title, ''); -// Example : Adding jquery code -print ''; // Part to create diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index 1883517470c..731a7bcfc50 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -299,20 +299,6 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ llxHeader('', $title, $help_url); -// Example : Adding jquery code -print ''; $arrayofselected = is_array($toselect) ? $toselect : array(); diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index 79f51be6ca9..49d46c652fd 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -398,20 +398,6 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'classforhorizontalscrolloftabs'); -// Example : Adding jquery code -print ''; $arrayofselected = is_array($toselect) ? $toselect : array(); diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php index 6a29a414ed7..5ec359e5d8a 100644 --- a/htdocs/product/inventory/card.php +++ b/htdocs/product/inventory/card.php @@ -168,20 +168,6 @@ $help_url = 'EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks|DE:Modul_Best llxHeader('', $title, $help_url); -// Example : Adding jquery code -print ''; // Part to create diff --git a/htdocs/recruitment/recruitmentcandidature_card.php b/htdocs/recruitment/recruitmentcandidature_card.php index 4826dc735ef..a1e98ded601 100644 --- a/htdocs/recruitment/recruitmentcandidature_card.php +++ b/htdocs/recruitment/recruitmentcandidature_card.php @@ -305,21 +305,6 @@ $title = $langs->trans("RecruitmentCandidature"); $help_url = ''; llxHeader('', $title, $help_url); -// Example : Adding jquery code -print ''; - // Part to create if ($action == 'create') { diff --git a/htdocs/recruitment/recruitmentcandidature_list.php b/htdocs/recruitment/recruitmentcandidature_list.php index 1caeb05095f..7a5a88bc6c4 100644 --- a/htdocs/recruitment/recruitmentcandidature_list.php +++ b/htdocs/recruitment/recruitmentcandidature_list.php @@ -348,21 +348,6 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ llxHeader('', $title, $help_url); -// Example : Adding jquery code -print ''; - $arrayofselected = is_array($toselect) ? $toselect : array(); $param = ''; diff --git a/htdocs/recruitment/recruitmentjobposition_list.php b/htdocs/recruitment/recruitmentjobposition_list.php index 6475a60a8ed..7ccad1de16a 100644 --- a/htdocs/recruitment/recruitmentjobposition_list.php +++ b/htdocs/recruitment/recruitmentjobposition_list.php @@ -349,21 +349,6 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ llxHeader('', $title, $help_url); -// Example : Adding jquery code -print ''; - $arrayofselected = is_array($toselect) ? $toselect : array(); $param = ''; diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php index 2074873a031..cf4d26b2c33 100644 --- a/htdocs/website/websiteaccount_card.php +++ b/htdocs/website/websiteaccount_card.php @@ -117,22 +117,6 @@ $formfile = new FormFile($db); llxHeader('', 'WebsiteAccount', ''); -// Example : Adding jquery code -print ''; - - // Part to create if ($action == 'create') { print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("WebsiteAccount"))); diff --git a/htdocs/workstation/workstation_card.php b/htdocs/workstation/workstation_card.php index 673b1db935d..5b63ca2d481 100755 --- a/htdocs/workstation/workstation_card.php +++ b/htdocs/workstation/workstation_card.php @@ -159,7 +159,7 @@ $help_url = 'EN:Module_Workstation'; llxHeader('', $title, $help_url); -// Example : Adding jquery code +// jquery code ?> '; + $sql .= $this->db->order('ctc.pos', 'ASC'); + $resql = $this->db->query($sql); + if ($resql) { + $num_rows = $this->db->num_rows($resql); + $i = 0; + $arrayidused=array(); + while ($i < $num_rows) { + $obj = $this->db->fetch_object($resql); + if ($obj) { + $grouprowid = $obj->rowid; + $groupvalue = $obj->code; + $grouplabel = $obj->label; + $isparent = $obj->isparent; + $fatherid = $obj->fk_parent; + $arrayidused[] = $grouprowid; + $groupcodefather = $obj->codefather; + if ($isparent == 'NOTPARENT') { + $arraycodenotparent[] = $groupvalue; + } + $iselected = $groupticketchild == $obj->code ?'selected':''; + $stringtoprint .= ''; + if (empty($tabscript[$groupcodefather])) { + $tabscript[$groupcodefather] = 'if($("#'.$htmlname.($levelid > 1 ?'_child_'.$levelid-1:'').'")[0].value == "'.dol_escape_js($groupcodefather).'"){ + $(".'.$htmlname.'_'.dol_escape_htmltag($fatherid).'_child_'.$levelid.'").show() + console.log("We show childs tickets of '.$groupcodefather.' group ticket") + }else{ + $(".'.$htmlname.'_'.dol_escape_htmltag($fatherid).'_child_'.$levelid.'").hide() + console.log("We hide childs tickets of '.$groupcodefather.' group ticket") + }'; + } + } + $i++; + } + } else { + dol_print_error($this->db); + } + $stringtoprint .=''; + + $stringtoprint .=''; + } return $stringtoprint; } } From b83f57da4897b22406602a4f06a96d93a322afe1 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Tue, 29 Jun 2021 16:26:48 +0200 Subject: [PATCH 0927/1497] Fix some proposal php 8 warning --- htdocs/comm/index.php | 2 ++ htdocs/comm/propal/class/propal.class.php | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 0a39e596ba3..9d0d9f1befc 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -65,6 +65,8 @@ $socid = GETPOST("socid", 'int'); if ($user->socid > 0) { $action = ''; $id = $user->socid; +} else { + $id = 0; } restrictedArea($user, 'societe', $id, '&societe', '', 'fk_soc', 'rowid', 0); diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 6c670c82364..940e0156c7e 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -2535,12 +2535,12 @@ class Propal extends CommonObject $resql = $this->db->query($sql); if ($resql) { // Status self::STATUS_REFUSED by default - $modelpdf = $conf->global->PROPALE_ADDON_PDF_ODT_CLOSED ? $conf->global->PROPALE_ADDON_PDF_ODT_CLOSED : $this->model_pdf; + $modelpdf = !empty($conf->global->PROPALE_ADDON_PDF_ODT_CLOSED) ? $conf->global->PROPALE_ADDON_PDF_ODT_CLOSED : $this->model_pdf; $trigger_name = 'PROPAL_CLOSE_REFUSED'; if ($status == self::STATUS_SIGNED) { // Status self::STATUS_SIGNED $trigger_name = 'PROPAL_CLOSE_SIGNED'; - $modelpdf = $conf->global->PROPALE_ADDON_PDF_ODT_TOBILL ? $conf->global->PROPALE_ADDON_PDF_ODT_TOBILL:$this->model_pdf; + $modelpdf = !empty($conf->global->PROPALE_ADDON_PDF_ODT_TOBILL) ? $conf->global->PROPALE_ADDON_PDF_ODT_TOBILL : $this->model_pdf; // The connected company is classified as a client $soc=new Societe($this->db); From b8f5dc74d70bcb831a1690712562d2b6ba243fa6 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Tue, 29 Jun 2021 16:30:36 +0200 Subject: [PATCH 0928/1497] Some order php 8 warning --- htdocs/commande/class/commande.class.php | 2 +- htdocs/commande/tpl/linkedobjectblock.tpl.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 2805f4556d3..f601606be33 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1368,7 +1368,7 @@ class Commande extends CommonOrder } // Possibility to add external linked objects with hooks $this->linked_objects[$this->origin] = $this->origin_id; - if (is_array($object->other_linked_objects) && !empty($object->other_linked_objects)) { + if (isset($object->other_linked_objects) && is_array($object->other_linked_objects) && !empty($object->other_linked_objects)) { $this->linked_objects = array_merge($this->linked_objects, $object->other_linked_objects); } diff --git a/htdocs/commande/tpl/linkedobjectblock.tpl.php b/htdocs/commande/tpl/linkedobjectblock.tpl.php index 428589aa844..a0641c4c493 100644 --- a/htdocs/commande/tpl/linkedobjectblock.tpl.php +++ b/htdocs/commande/tpl/linkedobjectblock.tpl.php @@ -47,7 +47,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { } echo '
    '.$langs->trans("CustomerOrder"); - if (!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) { + if (!empty($showImportButton) && !empty($conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES)) { print ' '; From e4f61d430f9dc55aa8a630cf70c5cf11d0133547 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Tue, 29 Jun 2021 16:33:24 +0200 Subject: [PATCH 0929/1497] Invoice php 8 issue and warnings. Seems if ("" < 0) is true in php 8 --- htdocs/compta/facture/card.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 585cabc1be4..6ec837fe1d1 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -112,7 +112,12 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object if ($id > 0 || !empty($ref)) { if ($action != 'add') { - $ret = $object->fetch($id, $ref, '', '', $conf->global->INVOICE_USE_SITUATION); + if (empty($conf->global->INVOICE_USE_SITUATION)) { + $fetch_situation = false; + } else { + $fetch_situation = true; + } + $ret = $object->fetch($id, $ref, '', '', $fetch_situation); } } @@ -607,7 +612,7 @@ if (empty($reshook)) { } // Check for mandatory fields in invoice - $array_to_check = array('REF_CUSTOMER'=>'RefCustomer'); + $array_to_check = array('REF_CLIENT'=>'RefCustomer'); foreach ($array_to_check as $key => $val) { $keymin = strtolower($key); $vallabel = $object->$keymin; @@ -2362,21 +2367,22 @@ if (empty($reshook)) { $line = new FactureLigne($db); $line->fetch(GETPOST('lineid', 'int')); $percent = $line->get_prev_progress($object->id); + $progress = floatval(GETPOST('progress', 'int')); if ($object->type == Facture::TYPE_CREDIT_NOTE && $object->situation_cycle_ref > 0) { // in case of situation credit note - if (GETPOST('progress') >= 0) { + if ($progress >= 0) { $mesg = $langs->trans("CantBeNullOrPositive"); setEventMessages($mesg, null, 'warnings'); $error++; $result = -1; - } elseif (GETPOST('progress') < $line->situation_percent) { // TODO : use a modified $line->get_prev_progress($object->id) result + } elseif ($progress < $line->situation_percent) { // TODO : use a modified $line->get_prev_progress($object->id) result $mesg = $langs->trans("CantBeLessThanMinPercent"); setEventMessages($mesg, null, 'warnings'); $error++; $result = -1; } - } elseif (GETPOST('progress') < $percent) { + } elseif ($progress < $percent) { $mesg = '
    '.$langs->trans("CantBeLessThanMinPercent").'
    '; setEventMessages($mesg, null, 'warnings'); $error++; From 0d7fccc7b30b00b241f85d5b1e28fdbbf19042e3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Jun 2021 16:33:53 +0200 Subject: [PATCH 0930/1497] Fix test --- test/other/test_serialize.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/other/test_serialize.php b/test/other/test_serialize.php index 2fdfffaef3e..74d1d40e025 100644 --- a/test/other/test_serialize.php +++ b/test/other/test_serialize.php @@ -3,7 +3,10 @@ $path = __DIR__ . '/'; + $res=@include_once $path.'/../htdocs/master.inc.php'; +$res=@include_once $path.'/../../htdocs/master.inc.php'; +if (! $res) @include_once '../../master.inc.php'; if (! $res) @include_once '../master.inc.php'; if (! $res) @include_once './master.inc.php'; include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; From 051bb3f3ef8d7f31706f81457a6435af235581f6 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Tue, 29 Jun 2021 16:37:07 +0200 Subject: [PATCH 0931/1497] Fix some core php8 warnings. Fixing php 8 warnings seems also to solve some situations like a paiment condition removed from dictionary can not be selected. --- htdocs/core/class/html.form.class.php | 7 ++++++- htdocs/core/tpl/ajaxrow.tpl.php | 1 - htdocs/core/tpl/objectline_title.tpl.php | 2 +- htdocs/core/tpl/objectline_view.tpl.php | 4 ++-- htdocs/langs/en_US/errors.lang | 1 + 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 33e2ed8b972..0b1504d229a 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5085,7 +5085,12 @@ class Form } else { if ($selected) { $this->load_cache_conditions_paiements(); - print $this->cache_conditions_paiements[$selected]['label']; + if (isset($this->cache_conditions_paiements[$selected])) { + print $this->cache_conditions_paiements[$selected]['label']; + } else { + $langs->load('errors'); + print $langs->trans('ErrorNotInDictionaryPaymentConditions'); + } } else { print " "; } diff --git a/htdocs/core/tpl/ajaxrow.tpl.php b/htdocs/core/tpl/ajaxrow.tpl.php index 6d6df3a5408..88c643c641d 100644 --- a/htdocs/core/tpl/ajaxrow.tpl.php +++ b/htdocs/core/tpl/ajaxrow.tpl.php @@ -79,7 +79,6 @@ $(document).ready(function(){ function() { console.log("tableDND end of ajax call"); if (reloadpage == 1) { - //console.log(''); global->PRODUCT_USE_UNITS)) { print '
    '.$langs->trans('ReductionShort').''.$langs->trans('Progress').''.$form->textwithpicto($langs->trans('TotalHT100Short'), $langs->trans('UnitPriceXQtyLessDiscount')).''.$line->situation_percent.'%
    '.$langs->trans("ProductAccountancySellCode").''; @@ -2364,8 +2363,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; print $formaccounting->select_account($object->accountancy_code_buy, 'accountancy_code_buy', 1, '', 1, 1); print '
    '.$langs->trans("ProductAccountancySellCode").''; From c7befd9acc929cd1f3e3e2969a1ad2d07ce15397 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Jun 2021 19:49:26 +0200 Subject: [PATCH 0940/1497] Fix php8 (related to #18019) --- htdocs/core/class/commonobject.class.php | 6 +++--- htdocs/core/lib/files.lib.php | 6 +++--- htdocs/core/photos_resize.php | 4 ++-- htdocs/ecm/file_card.php | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 789bfb4e8b2..ec9449eba8f 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -940,7 +940,7 @@ abstract class CommonObject $ecmfile->fullpath_orig = ''; $ecmfile->gen_or_uploaded = 'generated'; $ecmfile->description = ''; // indexed content - $ecmfile->keyword = ''; // keyword content + $ecmfile->keywords = ''; // keyword content $ecmfile->share = getRandomPassword(true); $result = $ecmfile->create($user); if ($result < 0) @@ -5261,7 +5261,7 @@ abstract class CommonObject $ecmfile->fullpath_orig = ''; $ecmfile->gen_or_uploaded = 'generated'; $ecmfile->description = ''; // indexed content - $ecmfile->keyword = ''; // keyword content + $ecmfile->keywords = ''; // keyword content $result = $ecmfile->update($user); if ($result < 0) { setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings'); @@ -5274,7 +5274,7 @@ abstract class CommonObject $ecmfile->fullpath_orig = ''; $ecmfile->gen_or_uploaded = 'generated'; $ecmfile->description = ''; // indexed content - $ecmfile->keyword = ''; // keyword content + $ecmfile->keywords = ''; // keyword content $ecmfile->src_object_type = $this->table_element; $ecmfile->src_object_id = $this->id; diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 7e34eec5ecd..05d8c6c4ec5 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -377,7 +377,7 @@ function completeFileArrayWithDatabaseInfo(&$filearray, $relativedir) $ecmfile->fullpath_orig = $filearray[$key]['fullname']; $ecmfile->gen_or_uploaded = 'unknown'; $ecmfile->description = ''; // indexed content - $ecmfile->keyword = ''; // keyword content + $ecmfile->keywords = ''; // keyword content $result = $ecmfile->create($user); if ($result < 0) { setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings'); @@ -933,7 +933,7 @@ function dol_move($srcfile, $destfile, $newmask = 0, $overwriteifexists = 1, $te $ecmfile->fullpath_orig = $srcfile; $ecmfile->gen_or_uploaded = 'unknown'; $ecmfile->description = ''; // indexed content - $ecmfile->keyword = ''; // keyword content + $ecmfile->keywords = ''; // keyword content $resultecm = $ecmfile->create($user); if ($resultecm < 0) { setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings'); @@ -1785,7 +1785,7 @@ function addFileIntoDatabaseIndex($dir, $file, $fullpathorig = '', $mode = 'uplo $ecmfile->fullpath_orig = $fullpathorig; $ecmfile->gen_or_uploaded = $mode; $ecmfile->description = ''; // indexed content - $ecmfile->keyword = ''; // keyword content + $ecmfile->keywords = ''; // keyword content if (is_object($object) && $object->id > 0) { $ecmfile->src_object_id = $object->id; diff --git a/htdocs/core/photos_resize.php b/htdocs/core/photos_resize.php index 7c7813fbe14..374f381c098 100644 --- a/htdocs/core/photos_resize.php +++ b/htdocs/core/photos_resize.php @@ -383,7 +383,7 @@ if ($action == 'confirm_resize' && GETPOSTISSET("file") && GETPOSTISSET("sizex") $ecmfile->fullpath_orig = $fullpath; $ecmfile->gen_or_uploaded = 'unknown'; $ecmfile->description = ''; // indexed content - $ecmfile->keyword = ''; // keyword content + $ecmfile->keywords = ''; // keyword content $result = $ecmfile->create($user); if ($result < 0) { setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings'); @@ -448,7 +448,7 @@ if ($action == 'confirm_crop') { $ecmfile->fullpath_orig = $fullpath; $ecmfile->gen_or_uploaded = 'unknown'; $ecmfile->description = ''; // indexed content - $ecmfile->keyword = ''; // keyword content + $ecmfile->keywords = ''; // keyword content $result = $ecmfile->create($user); if ($result < 0) { setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings'); diff --git a/htdocs/ecm/file_card.php b/htdocs/ecm/file_card.php index 14bc7e377f0..5ca1667ac9f 100644 --- a/htdocs/ecm/file_card.php +++ b/htdocs/ecm/file_card.php @@ -205,7 +205,7 @@ if ($action == 'update' && $permtoadd) { $object->fullpath_orig = ''; $object->gen_or_uploaded = 'unknown'; $object->description = ''; // indexed content - $object->keyword = ''; // keyword content + $object->keywords = ''; // keyword content $result = $object->create($user); if ($result < 0) { setEventMessages($object->error, $object->errors, 'warnings'); From 6f128123292ffa521adbb63fe7efcac69f33cfae Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 29 Jun 2021 23:07:20 +0200 Subject: [PATCH 0941/1497] FIX Accountancy - Clean virtual zero on the import --- htdocs/core/modules/import/import_csv.modules.php | 2 ++ htdocs/core/modules/import/import_xlsx.modules.php | 2 ++ htdocs/core/modules/modAccounting.class.php | 7 +++++++ 3 files changed, 11 insertions(+) diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index 1768029b97e..52b7af1fee5 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -623,6 +623,8 @@ class ImportCsv extends ModeleImports } } elseif ($objimport->array_import_convertvalue[0][$val]['rule'] == 'numeric') { $newval = price2num($newval); + } elseif ($objimport->array_import_convertvalue[0][$val]['rule'] == 'accountingaccount') { + $newval = rtrim($newval, "0"); } //print 'Val to use as insert is '.$newval.'
    '; diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index d90a52755e3..abc2a80abc9 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -664,6 +664,8 @@ class ImportXlsx extends ModeleImports } } elseif ($objimport->array_import_convertvalue[0][$val]['rule'] == 'numeric') { $newval = price2num($newval); + } elseif ($objimport->array_import_convertvalue[0][$val]['rule'] == 'accountingaccount') { + $newval = rtrim($newval, "0"); } //print 'Val to use as insert is '.$newval.'
    '; diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php index 21618c56bc9..f86a2078c9e 100644 --- a/htdocs/core/modules/modAccounting.class.php +++ b/htdocs/core/modules/modAccounting.class.php @@ -297,6 +297,10 @@ class modAccounting extends DolibarrModules ); $this->import_fieldshidden_array[$r] = array('b.doc_type'=>'const-import_from_external', 'b.fk_doc'=>'const-0', 'b.fk_docdet'=>'const-0', 'b.fk_user_author'=>'user->id', 'b.date_creation'=>'const-'.dol_print_date(dol_now(), 'standard')); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent) $this->import_regex_array[$r] = array('b.doc_date'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$'); + $this->import_convertvalue_array[$r]=array( + 'b.numero_compte'=>array('rule'=>'accountingaccount'), + 'b.subledger_account'=>array('rule'=>'accountingaccount') + ); $this->import_examplevalues_array[$r] = array( 'b.piece_num'=>'123 (!!! use next value not already used)', 'b.doc_date'=>dol_print_date(dol_now(), "%Y-%m-%d"), @@ -350,6 +354,8 @@ class modAccounting extends DolibarrModules 'b.sens'=>'rule-computeSens' ); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent) $this->import_convertvalue_array[$r]=array( + 'b.numero_compte'=>array('rule'=>'accountingaccount'), + 'b.subledger_account'=>array('rule'=>'accountingaccount'), 'b.montant' => array('rule' => 'compute', 'classfile' => '/accountancy/class/accountancyimport.class.php', 'class' => 'AccountancyImport', 'method' => 'computeAmount', 'element' => 'Accountancy'), 'b.sens' => array('rule' => 'compute', 'classfile' => '/accountancy/class/accountancyimport.class.php', 'class' => 'AccountancyImport', 'method' => 'computeDirection', 'element' => 'Accountancy'), ); @@ -395,6 +401,7 @@ class modAccounting extends DolibarrModules $this->import_fields_array[$r] = array('aa.fk_pcg_version'=>"Chartofaccounts*", 'aa.account_number'=>"AccountAccounting*", 'aa.label'=>"Label*", 'aa.account_parent'=>"Accountparent", "aa.fk_accounting_category"=>"AccountingCategory", "aa.pcg_type"=>"Pcgtype*", 'aa.active'=>'Status*', 'aa.datec'=>"DateCreation"); $this->import_regex_array[$r] = array('aa.fk_pcg_version'=>'pcg_version@'.MAIN_DB_PREFIX.'accounting_system', 'aa.account_number'=>'^.{1,32}$', 'aa.label'=>'^.{1,255}$', 'aa.account_parent'=>'^.{0,32}$', 'aa.fk_accounting_category'=>'rowid@'.MAIN_DB_PREFIX.'c_accounting_category', 'aa.pcg_type'=>'^.{1,20}$', 'aa.active'=>'^0|1$', 'aa.datec'=>'^\d{4}-\d{2}-\d{2}$'); $this->import_convertvalue_array[$r] = array( + 'aa.account_number'=>array('rule'=>'accountingaccount'), 'aa.account_parent'=>array('rule'=>'fetchidfromref', 'classfile'=>'/accountancy/class/accountingaccount.class.php', 'class'=>'AccountingAccount', 'method'=>'fetch', 'element'=>'AccountingAccount'), 'aa.fk_accounting_category'=>array('rule'=>'fetchidfromcodeorlabel', 'classfile'=>'/accountancy/class/accountancycategory.class.php', 'class'=>'AccountancyCategory', 'method'=>'fetch', 'dict'=>'DictionaryAccountancyCategory'), ); From 5e37c2ef74664c2608620e149cbfe60fa69391bf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 30 Jun 2021 01:36:49 +0200 Subject: [PATCH 0942/1497] CSS --- htdocs/product/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 4aaaf3a0fa7..cab4f537c5d 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -354,10 +354,10 @@ if ((!empty($conf->product->enabled) || !empty($conf->service->enabled)) && ($us print '
    '; + print ''; print $product_static->getNomUrl(1, '', 16); print "'.dol_trunc($objp->label, 32).''.dol_escape_htmltag($objp->label).'"; print dol_print_date($db->jdate($objp->datem), 'day'); print "
    '; $thirdpartygraph .= '
    '; +$thirdpartycateggraph = ''; if (!empty($conf->categorie->enabled) && !empty($conf->global->CATEGORY_GRAPHSTATS_ON_THIRDPARTIES)) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $elementtype = 'societe'; From 3b4ea5c5af71d6fb2ab46895a01e59112bfeec1e Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Wed, 30 Jun 2021 10:56:09 +0200 Subject: [PATCH 0950/1497] use formintervention --- htdocs/core/class/html.form.class.php | 141 ------------------ .../class/html.formintervention.class.php | 13 +- htdocs/projet/tasks/time.php | 5 +- 3 files changed, 12 insertions(+), 147 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 8d0f1931763..0b1504d229a 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -8746,147 +8746,6 @@ class Form return $out; } - /** - * Output a combo list with interventions qualified for a third party - * - * @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id) - * @param int $selected Id intervention preselected - * @param string $htmlname Name of HTML select - * @param int $maxlength Maximum length of label - * @param int $option_only Return only html options lines without the select tag - * @param string $show_empty Add an empty line ('1' or string to show for empty line) - * @param int $discard_closed Discard closed projects (0=Keep,1=hide completely,2=Disable) - * @param int $forcefocus Force focus on field (works with javascript only) - * @param int $disabled Disabled - * @param string $morecss More css added to the select component - * @param string $projectsListId ''=Automatic filter on project allowed. List of id=Filter on project ids. - * @param string $showproject 'all' = Show project info, ''=Hide project info - * @param User $usertofilter User object to use for filtering - * @return int Nbr of project if OK, <0 if KO - */ - public function selectIntervention($socid = -1, $selected = '', $htmlname = 'interid', $maxlength = 24, $option_only = 0, $show_empty = '1', $discard_closed = 0, $forcefocus = 0, $disabled = 0, $morecss = 'maxwidth500', $projectsListId = '', $showproject = 'all', $usertofilter = null) - { - global $user, $conf, $langs; - - require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; - - if (is_null($usertofilter)) { - $usertofilter = $user; - } - - $out = ''; - - $hideunselectables = false; - if (!empty($conf->global->PROJECT_HIDE_UNSELECTABLES)) $hideunselectables = true; - - if (empty($projectsListId)) { - if (empty($usertofilter->rights->projet->all->lire)) { - $projectstatic = new Project($this->db); - $projectsListId = $projectstatic->getProjectsAuthorizedForUser($usertofilter, 0, 1); - } - } - - // Search all projects - $sql = 'SELECT i.rowid, i.ref as ref, p.fk_soc, p.fk_statut, p.public,'; - $sql .= ' s.nom as name'; - $sql .= ' FROM '.MAIN_DB_PREFIX.'projet as p'; - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON s.rowid = p.fk_soc,'; - $sql .= ' '.MAIN_DB_PREFIX.'fichinter as i'; - $sql .= " WHERE p.entity IN (".getEntity('project').")"; - $sql .= " AND i.fk_projet = p.rowid AND i.fk_statut=0"; //Brouillons seulement - if ($projectsListId) $sql.= " AND p.rowid IN (".$projectsListId.")"; - if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)"; - if ($socid > 0) $sql.= " AND (p.fk_soc=".$socid." OR p.fk_soc IS NULL)"; - $sql .= " GROUP BY i.ref ORDER BY p.ref, i.ref ASC"; - - $resql = $this->db->query($sql); - if ($resql) { - // Use select2 selector - if (!empty($conf->use_javascript_ajax)) { - include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; - $comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus); - $out .= $comboenhancement; - $morecss = 'minwidth200imp maxwidth500'; - } - - if (empty($option_only)) { - $out .= ''; - } - - print $out; - - $this->db->free($resql); - return $num; - } else { - dol_print_error($this->db); - return -1; - } - } - /** * Output a combo list with invoices qualified for a third party * diff --git a/htdocs/core/class/html.formintervention.class.php b/htdocs/core/class/html.formintervention.class.php index 7058e80b1d7..b9564c6aa52 100644 --- a/htdocs/core/class/html.formintervention.class.php +++ b/htdocs/core/class/html.formintervention.class.php @@ -57,10 +57,11 @@ class FormIntervention * @param int $selected Id intervention preselected * @param string $htmlname Nom de la zone html * @param int $maxlength Maximum length of label - * @param int $showempty Show empty line + * @param int $showempty Show empty line ('1' or string to show for empty line) + * @param int $draftonly Show only drafts intervention * @return int Nbre of project if OK, <0 if KO */ - public function select_interventions($socid = -1, $selected = '', $htmlname = 'interventionid', $maxlength = 16, $showempty = 1) + public function select_interventions($socid = -1, $selected = '', $htmlname = 'interventionid', $maxlength = 16, $showempty = 1, $draftonly = false) { // phpcs:enable global $db, $user, $conf, $langs; @@ -80,13 +81,17 @@ class FormIntervention $sql .= " AND f.fk_soc = ".((int) $socid); } } + if ($draftonly) $sql .= " AND f.fk_statut = 0"; dol_syslog(get_class($this)."::select_intervention", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { $out .= '
    '; - $form->selectIntervention($projectstatic->thirdparty->id, '', 'interid', 24, 0, $langs->trans('NewInter'), - 1, 0, 0, 'maxwidth500', '', 'all'); + $forminter = new FormIntervention($db); + print $forminter->select_interventions($projectstatic->thirdparty->id, '', 'interid', 24, $langs->trans('NewInter'), true); print '
    '; From 8772c53723ed13e655deba058aceb9f7fa1a531a Mon Sep 17 00:00:00 2001 From: atm-arnaud Date: Wed, 30 Jun 2021 12:37:21 +0200 Subject: [PATCH 0951/1497] FIX deposit can create credit note in payment conf --- 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 31c42e5ba9e..e15b2722800 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -5260,7 +5260,7 @@ elseif ($id > 0 || !empty($ref)) } // Create a credit note - if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA) && $object->statut > 0 && $usercancreate) + if (($object->type == Facture::TYPE_STANDARD || ($object->type == Facture::TYPE_DEPOSIT && empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS) ) || $object->type == Facture::TYPE_PROFORMA) && $object->statut > 0 && $usercancreate) { if (!$objectidnext) { From 51456741d97337329bde1f8fd0b8fa8861db1036 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 30 Jun 2021 12:43:44 +0200 Subject: [PATCH 0952/1497] FIX Can't edit replacement invoice FIX Status of invoice when making a replacement invoice --- htdocs/compta/facture/card.php | 6 ++--- htdocs/compta/facture/class/facture.class.php | 26 +++++++++++------- htdocs/core/tpl/objectline_edit.tpl.php | 27 ++++++++++++++----- 3 files changed, 39 insertions(+), 20 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 54994eaf187..b3a33b11d1b 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3131,10 +3131,10 @@ if ($action == 'create') foreach ($facids as $facparam) { $options .= ''; } } diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 4ae9fe197fe..63a7b2f8e21 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -3927,8 +3927,8 @@ class Facture extends CommonInvoice * Invoices matching the following rules are returned: * (Status validated or abandonned for a reason 'other') + not payed + no payment at all + not already replaced * - * @param int $socid Id thirdparty - * @return array|int Array of invoices ('id'=>id, 'ref'=>ref, 'status'=>status, 'paymentornot'=>0/1) + * @param int $socid Id thirdparty + * @return array|int Array of invoices ('id'=>id, 'ref'=>ref, 'status'=>status, 'paymentornot'=>0/1) */ public function list_replacable_invoices($socid = 0) { @@ -3937,17 +3937,19 @@ class Facture extends CommonInvoice $return = array(); - $sql = "SELECT f.rowid as rowid, f.ref, f.fk_statut,"; + $sql = "SELECT f.rowid as rowid, f.ref, f.fk_statut as status, f.paye as paid,"; $sql .= " ff.rowid as rowidnext"; + //$sql .= ", SUM(pf.amount) as alreadypaid"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON f.rowid = pf.fk_facture"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture as ff ON f.rowid = ff.fk_facture_source"; $sql .= " WHERE (f.fk_statut = ".self::STATUS_VALIDATED." OR (f.fk_statut = ".self::STATUS_ABANDONED." AND f.close_code = '".self::CLOSECODE_ABANDONED."'))"; $sql .= " AND f.entity IN (".getEntity('invoice').")"; - $sql .= " AND f.paye = 0"; // Pas classee payee completement - $sql .= " AND pf.fk_paiement IS NULL"; // Aucun paiement deja fait - $sql .= " AND ff.fk_statut IS NULL"; // Renvoi vrai si pas facture de remplacement - if ($socid > 0) $sql .= " AND f.fk_soc = ".$socid; + $sql .= " AND f.paye = 0"; // Not paid completely + $sql .= " AND pf.fk_paiement IS NULL"; // No payment already done + $sql .= " AND ff.fk_statut IS NULL"; // Return true if it is not a replacement invoice + if ($socid > 0) $sql .= " AND f.fk_soc = ".((int) $socid); + //$sql .= " GROUP BY f.rowid, f.ref, f.fk_statut, f.paye, ff.rowid"; $sql .= " ORDER BY f.ref"; dol_syslog(get_class($this)."::list_replacable_invoices", LOG_DEBUG); @@ -3956,9 +3958,13 @@ class Facture extends CommonInvoice { while ($obj = $this->db->fetch_object($resql)) { - $return[$obj->rowid] = array('id' => $obj->rowid, - 'ref' => $obj->ref, - 'status' => $obj->fk_statut); + $return[$obj->rowid] = array( + 'id' => $obj->rowid, + 'ref' => $obj->ref, + 'status' => $obj->status, + 'paid' => $obj->paid, + 'alreadypaid' => 0 + ); } //print_r($return); return $return; diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index bc6b87a3353..685cc78fe67 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -109,9 +109,16 @@ $coldisplay++; $reshook = $hookmanager->executeHooks('formEditProductOptions', $parameters, $this, $action); } + $situationinvoicelinewithparent = 0; + if ($line->fk_prev_id != null && in_array($object->element, array('facture', 'facturedet'))) { + if ($object->type == $object::TYPE_SITUATION) { // The constant TYPE_SITUATION exists only for object invoice + // Set constant to disallow editing during a situation cycle + $situationinvoicelinewithparent = 1; + } + } + // Do not allow editing during a situation cycle - if ($line->fk_prev_id == null) - { + if (!$situationinvoicelinewithparent) { // editor wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $nbrows = ROWS_2; @@ -149,7 +156,7 @@ $coldisplay++; } $coldisplay++; - if ($line->fk_prev_id == null) { + if (!$situationinvoicelinewithparent) { print '
    '.$form->load_tva('tva_tx', $line->tva_tx.($line->vat_src_code ? (' ('.$line->vat_src_code.')') : ''), $seller, $buyer, 0, $line->info_bits, $line->product_type, false, 1).'%fk_prev_id != null) print ' readonly'; + if ($situationinvoicelinewithparent) { + print ' readonly'; + } print '> info_bits & 2) != 2) { - // I comment this because it shows info even when not required + // I comment warning of stock because it shows the info even when it should not. // for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated // must also not be output for most entities (proposal, intervention, ...) //if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." "; print 'fk_prev_id != null) print ' readonly'; + if ($situationinvoicelinewithparent) { // Do not allow editing during a situation cycle + print ' readonly'; + } print '>'; } else { ?>   @@ -202,7 +213,9 @@ $coldisplay++; info_bits & 2) != 2) { print 'fk_prev_id != null) print ' readonly'; + if ($situationinvoicelinewithparent) { + print ' readonly'; + } print '>%'; } else { ?>   From a914ffa42c0861febd39256a6415297558f8edb1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 30 Jun 2021 15:00:04 +0200 Subject: [PATCH 0953/1497] CSS --- htdocs/core/lib/project.lib.php | 2 +- htdocs/projet/tasks.php | 2 +- htdocs/projet/tasks/time.php | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index d20a0348d3d..93c061310a5 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -849,7 +849,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t // Contacts of task if (count($arrayfields) > 0 && !empty($arrayfields['c.assigned']['checked'])) { - print ''; + print ''; foreach (array('internal', 'external') as $source) { $tab = $lines[$i]->liste_contact(-1, $source); $num = count($tab); diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 9de05d67e29..d4b5bf89bbf 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -902,7 +902,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third } */ if (!empty($arrayfields['c.assigned']['checked'])) { - print_liste_field_titre($arrayfields['c.assigned']['label'], $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'right ', ''); + print_liste_field_titre($arrayfields['c.assigned']['label'], $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'center ', ''); } // Extra fields $disablesortlink = 1; diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index a9316bcedcd..bbe9671faf3 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -1410,7 +1410,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { // By User if (!empty($arrayfields['author']['checked'])) { - print ''; + print ''; if ($action == 'editline' && $_GET['lineid'] == $task_time->rowid) { if (empty($object->id)) { $object->fetch($id); @@ -1441,7 +1441,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { // Note if (!empty($arrayfields['t.note']['checked'])) { - print ''; + print ''; if ($action == 'editline' && $_GET['lineid'] == $task_time->rowid) { print ''; } else { @@ -1773,7 +1773,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { // Note if (!empty($arrayfields['t.note']['checked'])) { - print ''; + print ''; if ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid) { print ''; } else { From ac6cb5853e7c6406681a4ca7e5d8a5339871e0d5 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Wed, 30 Jun 2021 15:35:55 +0200 Subject: [PATCH 0954/1497] fix for multientity --- htdocs/core/modules/modProduct.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index 62e355d8e6a..5b0a1c06b85 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -348,7 +348,7 @@ class modProduct extends DolibarrModules $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'product as p'; $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_price as pr ON p.rowid = pr.fk_product AND pr.entity = '.$conf->entity; // export prices only for the current entity $this->export_sql_end[$r] .= ' WHERE p.entity IN ('.getEntity('product').')'; // For product and service profile - $this->export_sql_end[$r] .= ' AND pr.date_price = (SELECT MAX(pr2.date_price) FROM '.MAIN_DB_PREFIX.'product_price as pr2 WHERE pr2.fk_product = pr.fk_product)'; // export only latest prices not full history + $this->export_sql_end[$r] .= ' AND pr.date_price = (SELECT MAX(pr2.date_price) FROM '.MAIN_DB_PREFIX.'product_price as pr2 WHERE pr2.fk_product = pr.fk_product AND pr2.entity IN ('.getEntity('product').'))'; // export only latest prices not full history $this->export_sql_end[$r] .= ' ORDER BY p.ref, pr.price_level'; } From bda36337cd005fbe25f6e68d7cdfecabf35fcaaa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 30 Jun 2021 17:14:19 +0200 Subject: [PATCH 0955/1497] Prepare fix #yogosha6443 --- htdocs/api/class/api_setup.class.php | 2 +- htdocs/blockedlog/class/blockedlog.class.php | 2 - htdocs/compta/bank/treso.php | 26 ++- htdocs/core/class/commonobject.class.php | 19 -- htdocs/core/class/extrafields.class.php | 4 +- htdocs/core/commonfieldsinexport.inc.php | 2 +- htdocs/core/extrafieldsinexport.inc.php | 4 +- htdocs/core/lib/functions.lib.php | 21 +- .../modules/export/export_csv.modules.php | 4 +- .../export/export_excel2007.modules.php | 4 +- .../modules/export/export_tsv.modules.php | 4 +- htdocs/core/modules/modFournisseur.class.php | 211 ++---------------- .../install/mysql/tables/llx_oauth_token.sql | 4 +- test/phpunit/JsonLibTest.php | 9 + 14 files changed, 78 insertions(+), 238 deletions(-) diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index 1f59762c865..f5f301e9c16 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -1013,7 +1013,7 @@ class Setup extends DolibarrApi $list[$tab->elementtype][$tab->name]['computed'] = $tab->fieldcomputed; $list[$tab->elementtype][$tab->name]['unique'] = $tab->fieldunique; $list[$tab->elementtype][$tab->name]['required'] = $tab->fieldrequired; - $list[$tab->elementtype][$tab->name]['param'] = ($tab->param ? unserialize($tab->param) : ''); + $list[$tab->elementtype][$tab->name]['param'] = ($tab->param ? jsonOrUnserialize($tab->param) : ''); // This may be a string encoded with serialise() or json_encode() $list[$tab->elementtype][$tab->name]['pos'] = $tab->pos; $list[$tab->elementtype][$tab->name]['alwayseditable'] = $tab->alwayseditable; $list[$tab->elementtype][$tab->name]['perms'] = $tab->perms; diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index 366d7042d77..112456480e1 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -777,10 +777,8 @@ class BlockedLog public function dolDecodeBlockedData($data, $mode = 0) { try { - //include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; //include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $aaa = unserialize($data); - //$aaa = unserialize($data); } catch (Exception $e) { //print $e->getErrs); } diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index 6ccd953a68b..d9b54ad1c3d 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -163,8 +163,8 @@ if (GETPOST("account") || GETPOST("ref")) { $sqls[] = $sql; // Social contributions - $sql = " SELECT 'social_contribution' as family, cs.rowid as objid, cs.libelle as ref, (-1*cs.amount) as total_ttc, ccs.libelle as type, cs.date_ech as dlr"; - $sql .= ", cs.fk_account"; + $sql = " SELECT 'social_contribution' as family, cs.rowid as objid, cs.libelle as ref, (-1*cs.amount) as total_ttc, ccs.libelle as type, cs.date_ech as dlr,"; + $sql .= " 0 as socid, 'noname' as name, 0 as fournisseur"; $sql .= " FROM ".MAIN_DB_PREFIX."chargesociales as cs"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_chargesociales as ccs ON cs.fk_type = ccs.id"; $sql .= " WHERE cs.entity = ".$conf->entity; @@ -188,7 +188,18 @@ if (GETPOST("account") || GETPOST("ref")) { $resql = $db->query($sql); if ($resql) { while ($sqlobj = $db->fetch_object($resql)) { - $tab_sqlobj[] = $sqlobj; + $tmpobj = new stdClass(); + $tmpobj->family = $sqlobj->family; + $tmpobj->objid = $sqlobj->objid; + $tmpobj->ref = $sqlobj->ref; + $tmpobj->total_ttc = $sqlobj->total_ttc; + $tmpobj->type = $sqlobj->type; + $tmpobj->dlt = $sqlobj->dlr; + $tmpobj->socid = $sqlobj->socid; + $tmpobj->name = $sqlobj->name; + $tmpobj->fournisseur = $sqlobj->fournisseur; + + $tab_sqlobj[] = $tmpobj; $tab_sqlobjOrder[] = $db->jdate($sqlobj->dlr); } $db->free($resql); @@ -201,15 +212,6 @@ if (GETPOST("account") || GETPOST("ref")) { if (!$error) { array_multisort($tab_sqlobjOrder, $tab_sqlobj); - // Apply distinct filter - foreach ($tab_sqlobj as $key => $value) { - $tab_sqlobj[$key] = "'".serialize($value)."'"; - } - $tab_sqlobj = array_unique($tab_sqlobj); - foreach ($tab_sqlobj as $key => $value) { - $tab_sqlobj[$key] = unserialize(trim($value, "'")); - } - $num = count($tab_sqlobj); $i = 0; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index ec9449eba8f..5467490ea0e 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -8167,15 +8167,6 @@ abstract class CommonObject } else { $queryarray[$field] = $this->db->idate($this->{$field}); } - } elseif ($this->isArray($info)) { - if (!empty($this->{$field})) { - if (!is_array($this->{$field})) { - $this->{$field} = array($this->{$field}); - } - $queryarray[$field] = serialize($this->{$field}); - } else { - $queryarray[$field] = null; - } } elseif ($this->isDuration($info)) { // $this->{$field} may be null, '', 0, '0', 123, '123' if ((isset($this->{$field}) && $this->{$field} != '') || !empty($info['notnull'])) { @@ -8236,16 +8227,6 @@ abstract class CommonObject } else { $this->{$field} = $db->jdate($obj->{$field}); } - } elseif ($this->isArray($info)) { - if (!empty($obj->{$field})) { - $this->{$field} = @unserialize($obj->{$field}); - // Hack for data not in UTF8 - if ($this->{$field } === false) { - @unserialize(utf8_decode($obj->{$field})); - } - } else { - $this->{$field} = array(); - } } elseif ($this->isInt($info)) { if ($field == 'rowid') { $this->id = (int) $obj->{$field}; diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index b4d7f1a74df..54d812aeafb 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -936,7 +936,7 @@ class ExtraFields $this->attribute_computed[$tab->name] = $tab->fieldcomputed; $this->attribute_unique[$tab->name] = $tab->fieldunique; $this->attribute_required[$tab->name] = $tab->fieldrequired; - $this->attribute_param[$tab->name] = ($tab->param ? unserialize($tab->param) : ''); + $this->attribute_param[$tab->name] = ($tab->param ? jsonOrUnserialize($tab->param) : ''); $this->attribute_pos[$tab->name] = $tab->pos; $this->attribute_alwayseditable[$tab->name] = $tab->alwayseditable; $this->attribute_perms[$tab->name] = (strlen($tab->perms) == 0 ? 1 : $tab->perms); @@ -954,7 +954,7 @@ class ExtraFields $this->attributes[$tab->elementtype]['computed'][$tab->name] = $tab->fieldcomputed; $this->attributes[$tab->elementtype]['unique'][$tab->name] = $tab->fieldunique; $this->attributes[$tab->elementtype]['required'][$tab->name] = $tab->fieldrequired; - $this->attributes[$tab->elementtype]['param'][$tab->name] = ($tab->param ? unserialize($tab->param) : ''); + $this->attributes[$tab->elementtype]['param'][$tab->name] = ($tab->param ? jsonOrUnserialize($tab->param) : ''); $this->attributes[$tab->elementtype]['pos'][$tab->name] = $tab->pos; $this->attributes[$tab->elementtype]['alwayseditable'][$tab->name] = $tab->alwayseditable; $this->attributes[$tab->elementtype]['perms'][$tab->name] = (strlen($tab->perms) == 0 ? 1 : $tab->perms); diff --git a/htdocs/core/commonfieldsinexport.inc.php b/htdocs/core/commonfieldsinexport.inc.php index a02a21afdd6..3b201e4f10a 100644 --- a/htdocs/core/commonfieldsinexport.inc.php +++ b/htdocs/core/commonfieldsinexport.inc.php @@ -37,7 +37,7 @@ if (class_exists($keyforclass)) { /* * case 'sellist': * $tmp=''; - * $tmpparam=unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null + * $tmpparam=jsonOrUnserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null * if ($tmpparam['options'] && is_array($tmpparam['options'])) { * $tmpkeys=array_keys($tmpparam['options']); * $tmp=array_shift($tmpkeys); diff --git a/htdocs/core/extrafieldsinexport.inc.php b/htdocs/core/extrafieldsinexport.inc.php index 861ef142c25..70dd0077e57 100644 --- a/htdocs/core/extrafieldsinexport.inc.php +++ b/htdocs/core/extrafieldsinexport.inc.php @@ -39,7 +39,7 @@ if ($resql) { // This can fail when class is used on old database (during mig case 'checkbox': case 'select': if (!empty($conf->global->EXPORT_LABEL_FOR_SELECT)) { - $tmpparam = unserialize($obj->param); // $tmpparam may be array with 'options' = array(key1=>val1, key2=>val2 ...) + $tmpparam = jsonOrUnserialize($obj->param); // $tmpparam may be array with 'options' = array(key1=>val1, key2=>val2 ...) if ($tmpparam['options'] && is_array($tmpparam['options'])) { $typeFilter = "Select:".$obj->param; } @@ -47,7 +47,7 @@ if ($resql) { // This can fail when class is used on old database (during mig break; case 'sellist': $tmp = ''; - $tmpparam = unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null + $tmpparam = jsonOrUnserialize($obj->param); // $tmp may be array 'options' => array 'c_currencies:code_iso:code_iso' => null if ($tmpparam['options'] && is_array($tmpparam['options'])) { $tmpkeys = array_keys($tmpparam['options']); $tmp = array_shift($tmpkeys); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 87a4b966056..33a073920ff 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -993,7 +993,7 @@ function dol_buildpath($path, $type = 0, $returnemptyifnotfound = 0) function dol_clone($object, $native = 0) { if (empty($native)) { - $myclone = unserialize(serialize($object)); + $myclone = unserialize(serialize($object)); // serialize then unserialize is hack to be sure to have a new object for all fields } else { $myclone = clone $object; // PHP clone is a shallow copy only, not a real clone, so properties of references will keep the reference (refering to the same target/variable) } @@ -10301,9 +10301,10 @@ function readfileLowMemory($fullpath_original_file_osencoded, $method = -1) */ function showValueWithClipboardCPButton($valuetocopy, $showonlyonhover = 1, $texttoshow = '') { + /* global $conf; - /*if (!empty($conf->dol_no_mouse_hover)) { + if (!empty($conf->dol_no_mouse_hover)) { $showonlyonhover = 0; }*/ @@ -10315,3 +10316,19 @@ function showValueWithClipboardCPButton($valuetocopy, $showonlyonhover = 1, $tex return $result; } + + +/** + * Decode an encode string. The string can be encoded in json format (recommended) or with serialize (avoid this) + * + * @param string $stringtodecode String to decode (json or serialize coded) + */ +function jsonOrUnserialize($stringtodecode) +{ + $result = json_decode($stringtodecode); + if ($result === null) { + $result = unserialize($stringtodecode); + } + + return $result; +} diff --git a/htdocs/core/modules/export/export_csv.modules.php b/htdocs/core/modules/export/export_csv.modules.php index 2d15f3999d0..88ae937bb6d 100644 --- a/htdocs/core/modules/export/export_csv.modules.php +++ b/htdocs/core/modules/export/export_csv.modules.php @@ -277,8 +277,8 @@ class ExportCsv extends ModeleExports $newvalue = $this->csvClean($newvalue, $outputlangs->charset_output); - if (preg_match('/^Select:/i', $typefield, $reg) && $typefield = substr($typefield, 7)) { - $array = unserialize($typefield); + if (preg_match('/^Select:/i', $typefield) && $typefield = substr($typefield, 7)) { + $array = json_decode($typefield, true); $array = $array['options']; $newvalue = $array[$newvalue]; } diff --git a/htdocs/core/modules/export/export_excel2007.modules.php b/htdocs/core/modules/export/export_excel2007.modules.php index 370fc49df7e..54842ff8278 100644 --- a/htdocs/core/modules/export/export_excel2007.modules.php +++ b/htdocs/core/modules/export/export_excel2007.modules.php @@ -315,8 +315,8 @@ class ExportExcel2007 extends ModeleExports $newvalue = $this->excel_clean($newvalue); $typefield = isset($array_types[$code]) ? $array_types[$code] : ''; - if (preg_match('/^Select:/i', $typefield, $reg) && $typefield = substr($typefield, 7)) { - $array = unserialize($typefield); + if (preg_match('/^Select:/i', $typefield) && $typefield = substr($typefield, 7)) { + $array = json_decode($typefield, true); $array = $array['options']; $newvalue = $array[$newvalue]; } diff --git a/htdocs/core/modules/export/export_tsv.modules.php b/htdocs/core/modules/export/export_tsv.modules.php index c93787a762c..7718dd3e350 100644 --- a/htdocs/core/modules/export/export_tsv.modules.php +++ b/htdocs/core/modules/export/export_tsv.modules.php @@ -252,8 +252,8 @@ class ExportTsv extends ModeleExports $newvalue = $this->tsv_clean($newvalue, $outputlangs->charset_output); - if (preg_match('/^Select:/i', $typefield, $reg) && $typefield = substr($typefield, 7)) { - $array = unserialize($typefield); + if (preg_match('/^Select:/i', $typefield) && $typefield = substr($typefield, 7)) { + $array = json_decode($typefield, true); $array = $array['options']; $newvalue = $array[$newvalue]; } diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index 41107d5c34a..5d71a5abdc8 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -285,7 +285,7 @@ class modFournisseur extends DolibarrModules $r++; $this->export_code[$r] = $this->rights_class.'_'.$r; $this->export_label[$r] = 'Vendor invoices and lines of invoices'; - $this->export_icon[$r] = 'bill'; + $this->export_icon[$r] = 'invoice'; $this->export_permission[$r] = array(array("fournisseur", "facture", "export")); $this->export_fields_array[$r] = array( 's.rowid'=>"IdCompany", 's.nom'=>'CompanyName', 'ps.nom'=>'ParentCompany', 's.address'=>'Address', 's.zip'=>'Zip', 's.town'=>'Town', 'c.code'=>'CountryCode', 's.phone'=>'Phone', @@ -328,81 +328,14 @@ class modFournisseur extends DolibarrModules ); $this->export_dependencies_array[$r] = array('invoice_line'=>'fd.rowid', 'product'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them // Add extra fields object - $sql = "SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture_fourn' AND entity IN (0, ".$conf->entity.")"; - $resql = $this->db->query($sql); - if ($resql) { // This can fail when class is used on old database (during migration for example) - while ($obj = $this->db->fetch_object($resql)) { - $fieldname = 'extra.'.$obj->name; - $fieldlabel = ucfirst($obj->label); - $typeFilter = "Text"; - switch ($obj->type) { - case 'int': - case 'double': - case 'price': - $typeFilter = "Numeric"; - break; - case 'date': - case 'datetime': - $typeFilter = "Date"; - break; - case 'boolean': - $typeFilter = "Boolean"; - break; - case 'sellist': - $tmp = ''; - $tmpparam = unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null - if ($tmpparam['options'] && is_array($tmpparam['options'])) { - $var = array_keys($tmpparam['options']); - $tmp = array_shift($var); - } - if (preg_match('/[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/', $tmp)) { - $typeFilter = "List:".$tmp; - } - break; - } - $this->export_fields_array[$r][$fieldname] = $fieldlabel; - $this->export_TypeFields_array[$r][$fieldname] = $typeFilter; - $this->export_entities_array[$r][$fieldname] = 'invoice'; - } - } - // End add extra fields - // Add extra fields line - $sql = "SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture_fourn_det' AND entity IN (0, ".$conf->entity.")"; - $resql = $this->db->query($sql); - if ($resql) { // This can fail when class is used on old database (during migration for example) - while ($obj = $this->db->fetch_object($resql)) { - $fieldname = 'extraline.'.$obj->name; - $fieldlabel = ucfirst($obj->label); - $typeFilter = "Text"; - switch ($obj->type) { - case 'int': - case 'double': - case 'price': - $typeFilter = "Numeric"; - break; - case 'date': - case 'datetime': - $typeFilter = "Date"; - break; - case 'boolean': - $typeFilter = "Boolean"; - break; - case 'sellist': - $tmp = ''; - $tmpparam = unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null - if ($tmpparam['options'] && is_array($tmpparam['options'])) { - $tmp = array_shift(array_keys($tmpparam['options'])); - } - if (preg_match('/[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/', $tmp)) { - $typeFilter = "List:".$tmp; - } - break; - } - $this->export_fields_array[$r][$fieldname] = $fieldlabel; - $this->export_TypeFields_array[$r][$fieldname] = $typeFilter; - $this->export_entities_array[$r][$fieldname] = 'invoice_line'; - } - } + $keyforselect = 'facture_fourn'; + $keyforelement = 'invoice'; + $keyforaliasextra = 'extra'; + include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; + $keyforselect = 'facture_fourn_det'; + $keyforelement = 'invoice_line'; + $keyforaliasextra = 'extraline'; + include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; // End add extra fields line $this->export_sql_start[$r] = 'SELECT DISTINCT '; $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'societe as s'; @@ -426,7 +359,7 @@ class modFournisseur extends DolibarrModules $r++; $this->export_code[$r] = $this->rights_class.'_'.$r; $this->export_label[$r] = 'Factures fournisseurs et reglements'; - $this->export_icon[$r] = 'bill'; + $this->export_icon[$r] = 'invoice'; $this->export_permission[$r] = array(array("fournisseur", "facture", "export")); $this->export_fields_array[$r] = array( 's.rowid'=>"IdCompany", 's.nom'=>'CompanyName', 's.address'=>'Address', 's.zip'=>'Zip', 's.town'=>'Town', 'c.code'=>'CountryCode', 's.phone'=>'Phone', @@ -465,43 +398,10 @@ class modFournisseur extends DolibarrModules 'p.datep'=>'payment', 'p.num_paiement'=>'payment', 'p.fk_bank'=>'account', 'project.rowid'=>'project', 'project.ref'=>'project', 'project.title'=>'project'); $this->export_dependencies_array[$r] = array('payment'=>'p.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them // Add extra fields object - $sql = "SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture_fourn' AND entity IN (0, ".$conf->entity.")"; - $resql = $this->db->query($sql); - if ($resql) { // This can fail when class is used on old database (during migration for example) - while ($obj = $this->db->fetch_object($resql)) { - $fieldname = 'extra.'.$obj->name; - $fieldlabel = ucfirst($obj->label); - $typeFilter = "Text"; - switch ($obj->type) { - case 'int': - case 'double': - case 'price': - $typeFilter = "Numeric"; - break; - case 'date': - case 'datetime': - $typeFilter = "Date"; - break; - case 'boolean': - $typeFilter = "Boolean"; - break; - case 'sellist': - $tmp = ''; - $tmpparam = unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null - if ($tmpparam['options'] && is_array($tmpparam['options'])) { - $array_keys = array_keys($tmpparam['options']); - $tmp = array_shift($array_keys); - } - if (preg_match('/[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/', $tmp)) { - $typeFilter = "List:".$tmp; - } - break; - } - $this->export_fields_array[$r][$fieldname] = $fieldlabel; - $this->export_TypeFields_array[$r][$fieldname] = $typeFilter; - $this->export_entities_array[$r][$fieldname] = 'invoice'; - } - } + $keyforselect = 'facture_fourn'; + $keyforelement = 'invoice'; + $keyforaliasextra = 'extra'; + include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; // End add extra fields object $this->export_sql_start[$r] = 'SELECT DISTINCT '; $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'societe as s'; @@ -564,83 +464,16 @@ class modFournisseur extends DolibarrModules ); $this->export_dependencies_array[$r] = array('order_line'=>'fd.rowid', 'product'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them // Add extra fields object - $sql = "SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'commande_fournisseur' AND entity IN (0, ".$conf->entity.")"; - $resql = $this->db->query($sql); - if ($resql) { // This can fail when class is used on old database (during migration for example) - while ($obj = $this->db->fetch_object($resql)) { - $fieldname = 'extra.'.$obj->name; - $fieldlabel = ucfirst($obj->label); - $typeFilter = "Text"; - switch ($obj->type) { - case 'int': - case 'double': - case 'price': - $typeFilter = "Numeric"; - break; - case 'date': - case 'datetime': - $typeFilter = "Date"; - break; - case 'boolean': - $typeFilter = "Boolean"; - break; - case 'sellist': - $tmp = ''; - $tmpparam = unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null - $tmpkey = array_keys($tmpparam['options']); - if ($tmpparam['options'] && is_array($tmpparam['options'])) { - $tmp = array_shift($tmpkey); - } - if (preg_match('/[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/', $tmp)) { - $typeFilter = "List:".$tmp; - } - break; - } - $this->export_fields_array[$r][$fieldname] = $fieldlabel; - $this->export_TypeFields_array[$r][$fieldname] = $typeFilter; - $this->export_entities_array[$r][$fieldname] = 'order'; - } - } + $keyforselect = 'commande_fournisseur'; + $keyforelement = 'order'; + $keyforaliasextra = 'extra'; + include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; // End add extra fields object // Add extra fields line - $sql = "SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'commande_fournisseurdet' AND entity IN (0, ".$conf->entity.")"; - $resql = $this->db->query($sql); - if ($resql) { // This can fail when class is used on old database (during migration for example) - while ($obj = $this->db->fetch_object($resql)) { - $fieldname = 'extraline.'.$obj->name; - $fieldlabel = ucfirst($obj->label); - $typeFilter = "Text"; - switch ($obj->type) { - case 'int': - case 'double': - case 'price': - $typeFilter = "Numeric"; - break; - case 'date': - case 'datetime': - $typeFilter = "Date"; - break; - case 'boolean': - $typeFilter = "Boolean"; - break; - case 'sellist': - $tmp = ''; - $tmpparam = unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null - - if ($tmpparam['options'] && is_array($tmpparam['options'])) { - $tmpparam_param_key = array_keys($tmpparam['options']); - $tmp = array_shift($tmpparam_param_key); - } - if (preg_match('/[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/', $tmp)) { - $typeFilter = "List:".$tmp; - } - break; - } - $this->export_fields_array[$r][$fieldname] = $fieldlabel; - $this->export_TypeFields_array[$r][$fieldname] = $typeFilter; - $this->export_entities_array[$r][$fieldname] = 'order_line'; - } - } + $keyforselect = 'commande_fournisseurdet'; + $keyforelement = 'order_line'; + $keyforaliasextra = 'extraline'; + include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; // End add extra fields line $this->export_sql_start[$r] = 'SELECT DISTINCT '; $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'societe as s'; diff --git a/htdocs/install/mysql/tables/llx_oauth_token.sql b/htdocs/install/mysql/tables/llx_oauth_token.sql index 7674f7f3455..62542d13401 100644 --- a/htdocs/install/mysql/tables/llx_oauth_token.sql +++ b/htdocs/install/mysql/tables/llx_oauth_token.sql @@ -18,8 +18,8 @@ CREATE TABLE llx_oauth_token ( rowid integer AUTO_INCREMENT PRIMARY KEY, service varchar(36), -- What king of key or token: 'Google', 'Stripe', 'auth-public-key', ... - token text, -- token in serialize() format, of an object StdOAuth2Token of library phpoauth2 - tokenstring text, -- token in text or json format. Value depends on 'service'. For example for an OAUTH service: '{"access_token": "sk_test_cccc", "refresh_token": "rt_aaa", "token_type": "bearer", ..., "scope": "read_write"} + token text, -- token in serialize format, of an object StdOAuth2Token of library phpoauth2. Deprecated, use tokenstring instead. + tokenstring text, -- token in json or text format. Value depends on 'service'. For example for an OAUTH service: '{"access_token": "sk_test_cccc", "refresh_token": "rt_aaa", "token_type": "bearer", ..., "scope": "read_write"} fk_soc integer, -- Id of thirdparty in llx_societe fk_user integer, -- Id of user in llx_user fk_adherent integer, -- Id of member in llx_adherent diff --git a/test/phpunit/JsonLibTest.php b/test/phpunit/JsonLibTest.php index ddb62a90204..a8619ae08c5 100644 --- a/test/phpunit/JsonLibTest.php +++ b/test/phpunit/JsonLibTest.php @@ -161,6 +161,15 @@ class JsonLibTest extends PHPUnit\Framework\TestCase $this->savlangs=$langs; $this->savdb=$db; + // Try to decode a string encoded with serialize + $encoded = 'a:1:{s:7:"options";a:3:{s:3:"app";s:11:"Application";s:6:"system";s:6:"System";s:6:"option";s:6:"Option";}}'; + $decoded=json_decode($encoded, true); + $this->assertEquals(null, $decoded, 'test to json_decode() a string that was encoded with serialize()'); + + $encoded = 'rubishstring!aa{bcd'; + $decoded=json_decode($encoded, true); + $this->assertEquals(null, $decoded, 'test to json_decode() a string that was encoded with serialize()'); + // Do a test with an array starting with 0 $arraytotest=array(0=>array('key'=>1,'value'=>'PRODREF','label'=>'Product ref with é and special chars \\ \' "')); $arrayencodedexpected='[{"key":1,"value":"PRODREF","label":"Product ref with \u00e9 and special chars \\\\ \' \""}]'; From bf7f8f7c459c6988d41db1d9ba21aa1204969175 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 30 Jun 2021 17:28:23 +0200 Subject: [PATCH 0956/1497] Fix phpcs --- htdocs/core/lib/functions.lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 33a073920ff..28c553d747c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -10321,7 +10321,8 @@ function showValueWithClipboardCPButton($valuetocopy, $showonlyonhover = 1, $tex /** * Decode an encode string. The string can be encoded in json format (recommended) or with serialize (avoid this) * - * @param string $stringtodecode String to decode (json or serialize coded) + * @param string $stringtodecode String to decode (json or serialize coded) + * @return mixed The decoded object. */ function jsonOrUnserialize($stringtodecode) { From 4cff865c6b09c994d13d3d759c59e9abc6666dab Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 30 Jun 2021 18:22:40 +0200 Subject: [PATCH 0957/1497] Trans --- htdocs/admin/clicktodial.php | 11 ++++++++--- htdocs/core/modules/modClickToDial.class.php | 5 +++-- htdocs/langs/en_US/admin.lang | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index 7b1c94de1ec..25ada4d2d89 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005-2020 Laurent Destailleur + * Copyright (C) 2005-2021 Laurent Destailleur * Copyright (C) 2011-2013 Juanjo Menent * * This program is free software; you can redistribute it and/or modify @@ -20,7 +20,7 @@ /** * \file htdocs/admin/clicktodial.php * \ingroup clicktodial - * \brief Page to setup module clicktodial + * \brief Page to setup module ClickToDial */ require '../main.inc.php'; @@ -99,7 +99,12 @@ print ''; -print $langs->trans("Example").':
    http://myphoneserver/mypage?login=__LOGIN__&password=__PASS__&caller=__PHONEFROM__&called=__PHONETO__'; +print '
    '; +print ''; +print $langs->trans("Example").':
    '; +print 'http://myphoneserver/mypage?login=__LOGIN__&password=__PASS__&caller=__PHONEFROM__&called=__PHONETO__
    '; +print 'sip:__PHONETO__@my.sip.server'; +print '
    '; //if (! empty($user->clicktodial_url)) //{ diff --git a/htdocs/core/modules/modClickToDial.class.php b/htdocs/core/modules/modClickToDial.class.php index f28659bbd5d..18f1e6befeb 100644 --- a/htdocs/core/modules/modClickToDial.class.php +++ b/htdocs/core/modules/modClickToDial.class.php @@ -18,7 +18,7 @@ /** * \defgroup clicktodial Module clicktodial - * \brief Module pour gerer l'appel automatique + * \brief Module to manage a ClickToDial system * \file htdocs/core/modules/modClickToDial.class.php * \ingroup clicktodial * \brief Description and activation file for the module Click to Dial @@ -46,7 +46,8 @@ class modClickToDial extends DolibarrModules $this->family = "interface"; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i', '', get_class($this)); - $this->description = "Gestion du Click To Dial"; + $this->description = "Integration of a ClickToDial system (Asterisk, ...)"; + $this->descriptionlong = "Support a Click To Dial feature with a SIP system. When clicking on a phone number, your phone system automatically call the callee."; $this->version = 'dolibarr'; // 'development' or 'experimental' or 'dolibarr' or version diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index a05c9e7ea97..0fef25c033a 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1778,7 +1778,7 @@ ClickToDialSetup=Click To Dial module setup ClickToDialUrlDesc=Url called when a click on phone picto is done. In URL, you can use tags
    __PHONETO__ that will be replaced with the phone number of person to call
    __PHONEFROM__ that will be replaced with phone number of calling person (yours)
    __LOGIN__ that will be replaced with clicktodial login (defined on user card)
    __PASS__ that will be replaced with clicktodial password (defined on user card). ClickToDialDesc=This module change phone numbers, when using a desktop computer, into clickable links. A click will call the number. This can be used to start the phone call when using a soft phone on your desktop or when using a CTI system based on SIP protocol for example. Note: When using a smartphone, phone numbers are always clickable. ClickToDialUseTelLink=Use just a link "tel:" on phone numbers -ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or a software interface installed on the same computer as the browser, and called when you click on a link in your browser that starts with "tel:". If you need a full server solution (no need of local software installation), you must set this to "No" and fill next field. +ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or a software interface, installed on the same computer as the browser, and called when you click on a link starting with "tel:" in your browser. If you need link that start with "sip:" or a full server solution (no need of local software installation), you must set this to "No" and fill next field. ##### Point Of Sale (CashDesk) ##### CashDesk=Point of Sale CashDeskSetup=Point of Sales module setup From 1de165a6cdea46a4d4765252e657d3f9c2d828d9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 30 Jun 2021 18:34:04 +0200 Subject: [PATCH 0958/1497] css --- htdocs/projet/element.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index a6e3af11979..7fcfe3bc92b 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -1030,7 +1030,7 @@ foreach ($listofreferent as $key => $value) { $addform .= ''; $addform .= ''; $addform .= ''; - $addform .= ''; + $addform .= ''; $addform .= '
    '.$langs->trans("SelectElement").''.$selectList.'
    '; $addform .= ''; $addform .= ''; @@ -1039,7 +1039,7 @@ foreach ($listofreferent as $key => $value) { if (empty($conf->global->PROJECT_CREATE_ON_OVERVIEW_DISABLED) && $urlnew) { $addform .= '
    '; if ($testnew) { - $addform .= ''.($buttonnew ? $langs->trans($buttonnew) : $langs->trans("Create")).''; + $addform .= ''.($buttonnew ? $langs->trans($buttonnew) : $langs->trans("Create")).''; } elseif (empty($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)) { $addform .= ''.($buttonnew ? $langs->trans($buttonnew) : $langs->trans("Create")).''; } From 1a63a379cc447c3ddc07dd1c9c715db9efe11141 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 1 Jul 2021 03:03:59 +0200 Subject: [PATCH 0959/1497] Fix missing permission --- htdocs/comm/propal/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index d99c8b81b2c..1b0b57afc7a 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -226,6 +226,7 @@ if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { } else { $permissiontovalidate = $user->rights->propal->creer; $permissiontoclose = $user->rights->propal->creer; + $permissiontosendbymail = $user->rights->propale->lire; } From 5b34ea6c228210fd613d5f813d94e32f2030ebce Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 1 Jul 2021 03:06:40 +0200 Subject: [PATCH 0960/1497] FIX permission to close a proposal when using advanced permissions --- htdocs/comm/propal/card.php | 11 ++++++++--- htdocs/comm/propal/list.php | 6 +++++- htdocs/core/modules/modPropale.class.php | 3 ++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 175486dcca0..c220e1f320d 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2520,9 +2520,14 @@ if ($action == 'create') } // Close as accepted/refused - if ($object->statut == Propal::STATUS_VALIDATED && $usercanclose) { - print 'global->MAIN_JUMP_TAG) ? '' : '#close').'"'; - print '>'.$langs->trans('SetAcceptedRefused').''; + if ($object->statut == Propal::STATUS_VALIDATED) { + if ($usercanclose) { + print 'global->MAIN_JUMP_TAG) ? '' : '#close').'"'; + print '>'.$langs->trans('SetAcceptedRefused').''; + } else { + print ''.$langs->trans('SetAcceptedRefused').''; + } } // Clone diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index fcd8f067e01..e5700fca445 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -114,7 +114,11 @@ if (!$sortorder) $sortorder = 'DESC'; $permissiontoread = $user->rights->propal->lire; $permissiontoadd = $user->rights->propal->write; $permissiontodelete = $user->rights->propal->supprimer; -$permissiontoclose = $user->rights->propal->cloturer; +if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { + $permissiontoclose = $user->rights->propale->propal_advance->close; +} else { + $permissiontoclose = $user->rights->propal->creer; +} // Security check $module = 'propal'; diff --git a/htdocs/core/modules/modPropale.class.php b/htdocs/core/modules/modPropale.class.php index c0ffa6f0811..9b40a236511 100644 --- a/htdocs/core/modules/modPropale.class.php +++ b/htdocs/core/modules/modPropale.class.php @@ -157,7 +157,8 @@ class modPropale extends DolibarrModules $this->rights[$r][1] = 'Close commercial proposals'; // libelle de la permission $this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour) $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut - $this->rights[$r][4] = 'cloturer'; + $this->rights[$r][4] = 'propal_advance'; + $this->rights[$r][5] = 'close'; $r++; $this->rights[$r][0] = 27; // id de la permission From 9b71f1e16b5d699c6f0375f0fc192509b585325c Mon Sep 17 00:00:00 2001 From: Nicolas Date: Thu, 1 Jul 2021 11:55:06 +0200 Subject: [PATCH 0961/1497] fix : move check if invoice module is enabled into paymentok.php --- htdocs/commande/card.php | 2 +- htdocs/public/payment/paymentok.php | 119 +++++++++++++++------------- 2 files changed, 63 insertions(+), 58 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 4913731efb5..1ef37552f1f 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2633,7 +2633,7 @@ if ($action == 'create' && $usercancreate) $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem, $compatibleImportElementsList); // Show online payment link - $useonlinepayment = ((!empty($conf->paypal->enabled) || !empty($conf->stripe->enabled) || !empty($conf->paybox->enabled)) && !empty($conf->facture->enabled)); + $useonlinepayment = (!empty($conf->paypal->enabled) || !empty($conf->stripe->enabled) || !empty($conf->paybox->enabled)); if (!empty($conf->global->ORDER_HIDE_ONLINE_PAYMENT_ON_ORDER)) $useonlinepayment = 0; if ($object->statut != Commande::STATUS_DRAFT && $useonlinepayment) { diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 5f8f90ba72b..d6d4da28c9e 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -742,80 +742,85 @@ if ($ispaymentok) $currencyCodeType = $_SESSION['currencyCodeType']; // Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time) - if (!empty($FinalPaymentAmt) && $paymentTypeId > 0) { - include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; - $invoice = new Facture($db); - $result = $invoice->createFromOrder($object, $user); - if ($result > 0) { - $object->classifyBilled($user); - $invoice->validate($user); - // Creation of payment line - include_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php'; - $paiement = new Paiement($db); - $paiement->datepaye = $now; - if ($currencyCodeType == $conf->currency) { - $paiement->amounts = array($invoice->id => $FinalPaymentAmt); // Array with all payments dispatching with invoice id - } else { - $paiement->multicurrency_amounts = array($invoice->id => $FinalPaymentAmt); // Array with all payments dispatching - - $postactionmessages[] = 'Payment was done in a different currency that currency expected of company'; - $ispostactionok = -1; - $error++; // Not yet supported - } - $paiement->paiementid = $paymentTypeId; - $paiement->num_payment = ''; - $paiement->note_public = 'Online payment ' . dol_print_date($now, 'standard') . ' from ' . $ipaddress; - $paiement->ext_payment_id = $TRANSACTIONID; - $paiement->ext_payment_site = $service; - - if (!$error) { - $paiement_id = $paiement->create($user, 1); // This include closing invoices and regenerating documents - if ($paiement_id < 0) { - $postactionmessages[] = $paiement->error . ' ' . join("
    \n", $paiement->errors); - $ispostactionok = -1; - $error++; + if (!empty($conf->banque->enabled)) { + if (!empty($FinalPaymentAmt) && $paymentTypeId > 0 ) { + include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; + $invoice = new Facture($db); + $result = $invoice->createFromOrder($object, $user); + if ($result > 0) { + $object->classifyBilled($user); + $invoice->validate($user); + // Creation of payment line + include_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php'; + $paiement = new Paiement($db); + $paiement->datepaye = $now; + if ($currencyCodeType == $conf->currency) { + $paiement->amounts = array($invoice->id => $FinalPaymentAmt); // Array with all payments dispatching with invoice id } else { - $postactionmessages[] = 'Payment created'; - $ispostactionok = 1; + $paiement->multicurrency_amounts = array($invoice->id => $FinalPaymentAmt); // Array with all payments dispatching + + $postactionmessages[] = 'Payment was done in a different currency that currency expected of company'; + $ispostactionok = -1; + $error++; // Not yet supported } - } + $paiement->paiementid = $paymentTypeId; + $paiement->num_payment = ''; + $paiement->note_public = 'Online payment ' . dol_print_date($now, 'standard') . ' from ' . $ipaddress; + $paiement->ext_payment_id = $TRANSACTIONID; + $paiement->ext_payment_site = ''; - if (!$error && !empty($conf->banque->enabled)) { - $bankaccountid = 0; - if ($paymentmethod == 'paybox') $bankaccountid = $conf->global->PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS; - elseif ($paymentmethod == 'paypal') $bankaccountid = $conf->global->PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS; - elseif ($paymentmethod == 'stripe') $bankaccountid = $conf->global->STRIPE_BANK_ACCOUNT_FOR_PAYMENTS; - - if ($bankaccountid > 0) { - $label = '(CustomerInvoicePayment)'; - if ($object->type == Facture::TYPE_CREDIT_NOTE) $label = '(CustomerInvoicePaymentBack)'; // Refund of a credit note - $result = $paiement->addPaymentToBank($user, 'payment', $label, $bankaccountid, '', ''); - if ($result < 0) { + if (!$error) { + $paiement_id = $paiement->create($user, 1); // This include closing invoices and regenerating documents + if ($paiement_id < 0) { $postactionmessages[] = $paiement->error . ' ' . join("
    \n", $paiement->errors); $ispostactionok = -1; $error++; } else { - $postactionmessages[] = 'Bank transaction of payment created'; + $postactionmessages[] = 'Payment created'; $ispostactionok = 1; } - } else { - $postactionmessages[] = 'Setup of bank account to use in module ' . $paymentmethod . ' was not set. No way to record the payment.'; - $ispostactionok = -1; - $error++; } - } - if (!$error) { - $db->commit(); + if (!$error && !empty($conf->banque->enabled)) { + $bankaccountid = 0; + if ($paymentmethod == 'paybox') $bankaccountid = $conf->global->PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS; + elseif ($paymentmethod == 'paypal') $bankaccountid = $conf->global->PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS; + elseif ($paymentmethod == 'stripe') $bankaccountid = $conf->global->STRIPE_BANK_ACCOUNT_FOR_PAYMENTS; + + if ($bankaccountid > 0) { + $label = '(CustomerInvoicePayment)'; + if ($object->type == Facture::TYPE_CREDIT_NOTE) $label = '(CustomerInvoicePaymentBack)'; // Refund of a credit note + $result = $paiement->addPaymentToBank($user, 'payment', $label, $bankaccountid, '', ''); + if ($result < 0) { + $postactionmessages[] = $paiement->error . ' ' . join("
    \n", $paiement->errors); + $ispostactionok = -1; + $error++; + } else { + $postactionmessages[] = 'Bank transaction of payment created'; + $ispostactionok = 1; + } + } else { + $postactionmessages[] = 'Setup of bank account to use in module ' . $paymentmethod . ' was not set. No way to record the payment.'; + $ispostactionok = -1; + $error++; + } + } + + if (!$error) { + $db->commit(); + } else { + $db->rollback(); + } } else { - $db->rollback(); + $postactionmessages[] = 'Failed to create invoice form order ' . $tmptag['ORD'] . '.'; + $ispostactionok = -1; } } else { - $postactionmessages[] = 'Failed to create invoice form order ' . $tmptag['ORD'] . '.'; + $postactionmessages[] = 'Failed to get a valid value for "amount paid" (' . $FinalPaymentAmt . ') or "payment type" (' . $paymentType . ') to record the payment of order ' . $tmptag['ORD'] . '. May be payment was already recorded.'; $ispostactionok = -1; } } else { - $postactionmessages[] = 'Failed to get a valid value for "amount paid" (' . $FinalPaymentAmt . ') or "payment type" (' . $paymentType . ') to record the payment of order ' . $tmptag['ORD'] . '. May be payment was already recorded.'; + $postactionmessages[] = 'Invoice module is not enable'; $ispostactionok = -1; } } else { From 3e6eeeb977fca91c09e645cf8718ee05d50e6365 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Thu, 1 Jul 2021 11:59:00 +0200 Subject: [PATCH 0962/1497] fix : remove comments --- htdocs/public/payment/paymentok.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index d6d4da28c9e..18fef28d1c2 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -722,7 +722,6 @@ if ($ispaymentok) $ispostactionok = -1; } } elseif (array_key_exists('ORD', $tmptag) && $tmptag['ORD'] > 0) { - // Record payment include_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php'; $object = new Commande($db); $result = $object->fetch($tmptag['ORD']); @@ -761,7 +760,7 @@ if ($ispaymentok) $postactionmessages[] = 'Payment was done in a different currency that currency expected of company'; $ispostactionok = -1; - $error++; // Not yet supported + $error++; } $paiement->paiementid = $paymentTypeId; $paiement->num_payment = ''; From b102dc619fad8f7c679c930fd5520f4bb06d7aaf Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 1 Jul 2021 10:15:55 +0000 Subject: [PATCH 0963/1497] Fixing style errors. --- htdocs/public/payment/paymentok.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 71c338cb6fc..5bb3f4de0fc 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -916,17 +916,17 @@ if ($ispaymentok) { } } else { $postactionmessages[] = 'Order paid ' . $tmptag['ORD'] . ' was not found'; - $ispostactionok = -1; - } - } elseif (array_key_exists('DON', $tmptag) && $tmptag['DON'] > 0) { + $ispostactionok = -1; + } + } elseif (array_key_exists('DON', $tmptag) && $tmptag['DON'] > 0) { include_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; $don = new Don($db); $result = $don->fetch($tmptag['DON']); - if ($result) { + if ($result) { $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"]; - - $paymentTypeId = 0; - if ($paymentmethod == 'paybox') { + + $paymentTypeId = 0; + if ($paymentmethod == 'paybox') { $paymentTypeId = $conf->global->PAYBOX_PAYMENT_MODE_FOR_PAYMENTS; } if ($paymentmethod == 'paypal') { @@ -940,9 +940,9 @@ if ($ispaymentok) { if (empty($paymentType)) { $paymentType = 'CB'; } - $paymentTypeId = dol_getIdFromCode($db, $paymentType, 'c_paiement', 'code', 'id', 1); + $paymentTypeId = dol_getIdFromCode($db, $paymentType, 'c_paiement', 'code', 'id', 1); } - + $currencyCodeType = $_SESSION['currencyCodeType']; // Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time) From 9392624e54d301fc0b36690ef201c292677410f5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 1 Jul 2021 13:36:04 +0200 Subject: [PATCH 0964/1497] Fix deletion of line on replacement invoice --- htdocs/core/tpl/objectline_view.tpl.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 428fac31789..3463de14240 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -315,6 +315,15 @@ if ($outputalsopricetotalwithtax) { } if ($this->statut == 0 && ($object_rights->creer) && $action != 'selectlines') { + + $situationinvoicelinewithparent = 0; + if ($line->fk_prev_id != null && in_array($object->element, array('facture', 'facturedet'))) { + if ($object->type == $object::TYPE_SITUATION) { // The constant TYPE_SITUATION exists only for object invoice + // Set constant to disallow editing during a situation cycle + $situationinvoicelinewithparent = 1; + } + } + print '
    '; $coldisplay++; if (($line->info_bits & 2) == 2 || !empty($disableedit)) { @@ -326,7 +335,7 @@ if ($this->statut == 0 && ($object_rights->creer) && $action != 'selectlines') { print ''; $coldisplay++; - if (($line->fk_prev_id == null) && empty($disableremove)) { //La suppression n'est autorisée que si il n'y a pas de ligne dans une précédente situation + if (!$situationinvoicelinewithparent && empty($disableremove)) { // For situation invoice, deletion is not possible if there is a parent company. print 'id.'">'; print img_delete(); print ''; From 3aa24cccffd35d1a087be7f909023c9389e93df0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 1 Jul 2021 15:15:35 +0200 Subject: [PATCH 0965/1497] fix can't remove extrafield date or datetime value --- htdocs/core/class/commonobject.class.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 91c09f1226a..417cb3042b7 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5739,10 +5739,12 @@ abstract class CommonObject $this->array_options["options_".$key] = price2num($this->array_options["options_".$key]); break; case 'date': - $this->array_options["options_".$key] = $this->db->idate($this->array_options["options_".$key]); - break; case 'datetime': - $this->array_options["options_".$key] = $this->db->idate($this->array_options["options_".$key]); + if (empty($this->array_options["options_".$key])) { + $this->array_options["options_".$key] = null; + } else { + $this->array_options["options_".$key] = $this->db->idate($this->array_options["options_".$key]); + } break; /* case 'link': @@ -5790,7 +5792,11 @@ abstract class CommonObject } if ($linealreadyfound) { - $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element."_extrafields SET ".$key." = '".$this->db->escape($this->array_options["options_".$key])."'"; + if ($this->array_options["options_".$key] === null) { + $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element."_extrafields SET ".$key." = null"; + } else { + $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element."_extrafields SET ".$key." = '".$this->db->escape($this->array_options["options_".$key])."'"; + } $sql .= " WHERE fk_object = ".$this->id; } else { $result = $this->insertExtraFields('', $user); From de847250b11287ca812ffe30702468a7bd97af7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20David?= Date: Thu, 1 Jul 2021 17:55:54 +0200 Subject: [PATCH 0966/1497] NEW #18046 Add ticket categories data model --- .../mysql/tables/llx_categorie_ticket.key.sql | 21 +++++++++++++++++++ .../mysql/tables/llx_categorie_ticket.sql | 21 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 htdocs/install/mysql/tables/llx_categorie_ticket.key.sql create mode 100644 htdocs/install/mysql/tables/llx_categorie_ticket.sql diff --git a/htdocs/install/mysql/tables/llx_categorie_ticket.key.sql b/htdocs/install/mysql/tables/llx_categorie_ticket.key.sql new file mode 100644 index 00000000000..012b9a9eadc --- /dev/null +++ b/htdocs/install/mysql/tables/llx_categorie_ticket.key.sql @@ -0,0 +1,21 @@ +-- Copyright (C) 2021 EOXIA +-- +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see https://www.gnu.org/licenses/. + +ALTER TABLE llx_categorie_ticket ADD PRIMARY KEY pk_categorie_ticket (fk_categorie, fk_ticket); +ALTER TABLE llx_categorie_ticket ADD INDEX idx_categorie_ticket_fk_categorie (fk_categorie); +ALTER TABLE llx_categorie_ticket ADD INDEX idx_categorie_ticket_fk_ticket (fk_ticket); + +ALTER TABLE llx_categorie_ticket ADD CONSTRAINT fk_categorie_ticket_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid); +ALTER TABLE llx_categorie_ticket ADD CONSTRAINT fk_categorie_ticket_ticket_rowid FOREIGN KEY (fk_ticket) REFERENCES llx_ticket (rowid); diff --git a/htdocs/install/mysql/tables/llx_categorie_ticket.sql b/htdocs/install/mysql/tables/llx_categorie_ticket.sql new file mode 100644 index 00000000000..16ab92522c6 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_categorie_ticket.sql @@ -0,0 +1,21 @@ +-- Copyright (C) 2021 EOXIA +-- +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see https://www.gnu.org/licenses/. + +create table llx_categorie_ticket +( + fk_categorie integer NOT NULL, + fk_ticket integer NOT NULL, + import_key varchar(14) +)ENGINE=innodb; From 664af6ad1f10d9e6200acfb40fbabb531787c126 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 1 Jul 2021 18:22:33 +0200 Subject: [PATCH 0967/1497] Fix trans --- htdocs/langs/en_US/salaries.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/salaries.lang b/htdocs/langs/en_US/salaries.lang index 6b4fdc94163..cc28f87d883 100644 --- a/htdocs/langs/en_US/salaries.lang +++ b/htdocs/langs/en_US/salaries.lang @@ -20,5 +20,5 @@ TJMDescription=This value is currently for information only and is not used for LastSalaries=Latest %s salary payments AllSalaries=All salary payments SalariesStatistics=Salary statistics -# Export SalariesAndPayments=Salaries and payments +ConfirmDeleteSalaryPayment=Do you want to delete this payment of salary ? \ No newline at end of file From 414da8345649384f5a959b99f7a7afd42760414b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 1 Jul 2021 18:45:07 +0200 Subject: [PATCH 0968/1497] Fix colspan --- htdocs/salaries/payments.php | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/htdocs/salaries/payments.php b/htdocs/salaries/payments.php index bfc795ebcef..c2805cfbd93 100644 --- a/htdocs/salaries/payments.php +++ b/htdocs/salaries/payments.php @@ -124,6 +124,22 @@ foreach ($object->fields as $key => $val) { } } +// Definition of array of fields for columns +$arrayfields = array(); +foreach ($object->fields as $key => $val) { + // If $val['visible']==0, then we never show the field + if (!empty($val['visible'])) { + $visible = (int) dol_eval($val['visible'], 1); + $arrayfields['t.'.$key] = array( + 'label'=>$val['label'], + 'checked'=>(($visible < 0) ? 0 : 1), + 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)), + 'position'=>$val['position'], + 'help'=>$val['help'] + ); + } +} + $permissiontoread = $user->rights->salaries->read; $permissiontoadd = $user->rights->salaries->write; $permissiontodelete = $user->rights->salaries->delete; @@ -666,11 +682,13 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; // If no record found if ($num == 0) { - $colspan = 1; - foreach ($arrayfields as $key => $val) { if (!empty($val['checked'])) { + /*$colspan = 1; + foreach ($arrayfields as $key => $val) { + if (!empty($val['checked'])) { $colspan++; - } - } + } + }*/ + $colspan = 12; print '
    '.$langs->trans("NoRecordFound").'
    '; print ''; - print '\n"; - print ''; + print ''; print ''; $i++; } From 110b0fecf5cc040e1de44f981619c77522deadc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20David?= Date: Thu, 1 Jul 2021 19:30:00 +0200 Subject: [PATCH 0970/1497] NEW #18046 Add ticket categories views --- htdocs/categories/viewcat.php | 90 +++++++++++++++++++++++++++++- htdocs/langs/fr_FR/categories.lang | 2 + htdocs/ticket/card.php | 18 +++++- 3 files changed, 108 insertions(+), 2 deletions(-) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index eeca990ef28..12263d8df2c 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -142,6 +142,11 @@ if ($id > 0 && $removeelem > 0) { $tmpobject = new User($db); $result = $tmpobject->fetch($removeelem); $elementtype = 'user'; + } elseif ($type == Categorie::TYPE_TICKET && $user->rights->ticket->write) { + require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; + $tmpobject = new Ticket($db); + $result = $tmpobject->fetch($removeelem); + $elementtype = 'ticket'; } $result = $object->del_type($tmpobject, $elementtype); @@ -167,7 +172,8 @@ if ($user->rights->categorie->supprimer && $action == 'confirm_delete' && $confi if ($elemid && $action == 'addintocategory' && (($type == Categorie::TYPE_PRODUCT && ($user->rights->produit->creer || $user->rights->service->creer)) || ($type == Categorie::TYPE_CUSTOMER && $user->rights->societe->creer) || - ($type == Categorie::TYPE_SUPPLIER && $user->rights->societe->creer) + ($type == Categorie::TYPE_SUPPLIER && $user->rights->societe->creer) || + ($type == Categorie::TYPE_TICKET && $user->rights->ticket->write) )) { if ($type == Categorie::TYPE_PRODUCT) { require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; @@ -181,6 +187,10 @@ if ($elemid && $action == 'addintocategory' && require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; $newobject = new Societe($db); $elementtype = 'supplier'; + } elseif ($type == Categorie::TYPE_TICKET) { + require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; + $newobject = new Ticket($db); + $elementtype = 'ticket'; } $result = $newobject->fetch($elemid); @@ -1024,6 +1034,84 @@ if ($type == Categorie::TYPE_WAREHOUSE) { } } +if ($type == Categorie::TYPE_TICKET) +{ + $permission = ($user->rights->categorie->creer || $user->rights->categorie->creer); + + $tickets = $object->getObjectsInCateg($type, 0, $limit, $offset); + if ($tickets < 0) + { + dol_print_error($db, $object->error, $object->errors); + } else { + // Form to add record into a category + $showclassifyform = 1; + if ($showclassifyform) + { + print '
    '; + print '
    '; + print ''; + print ''; + print ''; + print ''; + print ''; + print '
    '; + print ''; print ''; @@ -389,16 +389,17 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac while ($i < $num && $i < $MAXLIST) { $objp = $db->fetch_object($resql); - $payment_salary->id = $objp->rowid; - $payment_salary->ref = $objp->ref; - $payment_salary->datep = $db->jdate($objp->datep); - $salary->id = $objp->sid; $salary->ref = $objp->sref ? $objp->sref : $objp->sid; $salary->label = $objp->label; $salary->datesp = $db->jdate($objp->datesp); $salary->dateep = $db->jdate($objp->dateep); $salary->paye = $objp->paye; + $salary->amount = $objp->amount; + + $payment_salary->id = $objp->rowid; + $payment_salary->ref = $objp->ref; + $payment_salary->datep = $db->jdate($objp->datep); print ''; print '\n"; print '\n"; - //print ''; + print ''; print ''; print ''; @@ -416,7 +417,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac $db->free($resql); if ($num <= 0) { - print '
    '.$langs->trans("LastSalaries", ($num <= $MAXLIST ? "" : $MAXLIST)).''.$langs->trans("AllSalaries").''.$num.''; print '
    '.$langs->trans("LastSalaries", ($num <= $MAXLIST ? "" : $MAXLIST)).''.$langs->trans("AllSalaries").''.$num.'
    '; @@ -407,7 +408,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac print ''.dol_print_date($db->jdate($objp->datesp), 'day')."'.dol_print_date($db->jdate($objp->dateep), 'day')."'.price($objp->amount).''.price($objp->amount).''.$salary->getLibStatut(5, $objp->alreadypaid).'
    '.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print "
    "; } else { @@ -424,9 +425,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac } } - /* - * Last holidays - */ + // Latest leave requests if (!empty($conf->holiday->enabled) && ($user->rights->holiday->readall || ($user->rights->holiday->read && $object->id == $user->id)) ) { @@ -478,9 +477,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac } } - /* - * Last expense report - */ + // Latest expense report if (!empty($conf->expensereport->enabled) && ($user->rights->expensereport->readall || ($user->rights->expensereport->lire && $object->id == $user->id)) ) { @@ -516,7 +513,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac print '
    '; print $exp->getNomUrl(1); print ''.dol_print_date($db->jdate($objp->date_debut), 'day')."'.price($objp->total_ttc).''.price($objp->total_ttc).''.$exp->LibStatut($objp->status, 5).'
    '; + print ''; + print ''; + print '
    '; + print $langs->trans("AddTicketIntoCategory").'  '; + $form->select_tickets('', 'elemid'); + print '
    '; + print ''; + } + + print '
    '; + print ''; + print ''; + print ''; + print ''; + print ''; + + print '
    '; + $param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($tickets); $nbtotalofrecords = ''; $newcardbutton = ''; + print_barre_liste($langs->trans("Ticket"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'ticket', 0, $newcardbutton, '', $limit); + + + print ''."\n"; + print ''."\n"; + + if (count($tickets) > 0) + { + $i = 0; + foreach ($tickets as $ticket) + { + $i++; + if ($i > $limit) break; + + print "\t".''."\n"; + print '\n"; + print '\n"; + // Link to delete from category + print ''; + print "\n"; + } + } else { + print ''; + } + print "
    '.$langs->trans("Ref").'
    '; + print $ticket->getNomUrl(1); + print "'.$ticket->label."'; + if ($permission) + { + print ""; + print $langs->trans("DeleteFromCat"); + print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', false, 0, 0, '', 'paddingleft'); + print ""; + } + print '
    '.$langs->trans("ThisCategoryHasNoItems").'
    \n"; + + print '
    '."\n"; + } +} // End of page llxFooter(); diff --git a/htdocs/langs/fr_FR/categories.lang b/htdocs/langs/fr_FR/categories.lang index 4b806e1edbd..20bfb122c75 100644 --- a/htdocs/langs/fr_FR/categories.lang +++ b/htdocs/langs/fr_FR/categories.lang @@ -17,6 +17,7 @@ ContactsCategoriesArea=Espace tags/catégories de contacts AccountsCategoriesArea=Espace des tags/categories de comptes bancaires ProjectsCategoriesArea=Espace des tags/catégories des projets UsersCategoriesArea=Espace des tags/catégories des utilisateurs +TicketsCategoriesArea=Espace tags/catégories des tickets SubCats=Sous-catégories CatList=Liste des tags/catégories CatListAll=Liste de toutes les catégories (de tous types) @@ -90,6 +91,7 @@ CategorieRecursivHelp=Si l'option est activé, quand un produit est ajouté dans AddProductServiceIntoCategory=Ajouter le produit/service suivant AddCustomerIntoCategory=Assigner cette catégorie au client AddSupplierIntoCategory=Assigner cette catégorie au fournisseur +AddTicketIntoCategory=Assigner cette catégorie au ticket ShowCategory=Afficher tag/catégorie ByDefaultInList=Par défaut dans la liste ChooseCategory=Choisissez une catégorie diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 5faa7b201b7..9be858fd795 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -31,6 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; if (!empty($conf->projet->enabled)) { include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; @@ -202,6 +203,10 @@ if (empty($reshook)) { $contactid = GETPOST('contactid', 'int'); $type_contact = GETPOST("type", 'alpha'); + // Category association + $categories = GETPOST('categories', 'array'); + $object->setCategories($categories); + if ($contactid > 0 && $type_contact) { $typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type')); $result = $object->add_contact($contactid, $typeid, 'external'); @@ -312,7 +317,11 @@ if (empty($reshook)) { $object->severity_code = GETPOST('severity_code', 'alpha'); $ret = $object->update($user); - if ($ret <= 0) { + if ($ret > 0) { + // Category association + $categories = GETPOST('categories', 'array'); + $object->setCategories($categories); + } else { $error++; } @@ -1054,6 +1063,13 @@ if ($action == 'create' || $action == 'presend') { print ''; } + // Categories + if ($conf->categorie->enabled) { + print ''.$langs->trans("Categories").''; + print $form->showCategories($object->id, Categorie::TYPE_TICKET, 1); + print ""; + } + // Other attributes include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; From 079608fe00c1296787ba57fb7734c7fdee5f33af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20David?= Date: Fri, 2 Jul 2021 10:26:03 +0200 Subject: [PATCH 0971/1497] NEW #18046 Add ticket ticket categories functions --- htdocs/categories/class/categorie.class.php | 13 +- htdocs/core/class/html.form.class.php | 219 ++++++++++++++++++++ htdocs/core/class/html.formticket.class.php | 9 + htdocs/core/modules/modTicket.class.php | 13 ++ htdocs/ticket/class/ticket.class.php | 45 ++++ 5 files changed, 296 insertions(+), 3 deletions(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index b98cff5b3a5..caeab5b8ddd 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -34,6 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; +require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; @@ -56,6 +57,7 @@ class Categorie extends CommonObject const TYPE_WAREHOUSE = 'warehouse'; const TYPE_ACTIONCOMM = 'actioncomm'; const TYPE_WEBSITE_PAGE = 'website_page'; + const TYPE_TICKET = 'ticket'; /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png @@ -78,7 +80,8 @@ class Categorie extends CommonObject 'bank_line' => 8, 'warehouse' => 9, 'actioncomm' => 10, - 'website_page' => 11 + 'website_page' => 11, + 'ticket' => 12 ); /** @@ -98,7 +101,8 @@ class Categorie extends CommonObject 8 => 'bank_line', 9 => 'warehouse', 10 => 'actioncomm', - 11 => 'website_page' + 11 => 'website_page', + 12 => 'ticket' ); /** @@ -141,7 +145,8 @@ class Categorie extends CommonObject 'project' => 'Project', 'warehouse'=> 'Entrepot', 'actioncomm' => 'ActionComm', - 'website_page' => 'WebsitePage' + 'website_page' => 'WebsitePage', + 'ticket' => 'Ticket' ); /** @@ -234,6 +239,8 @@ class Categorie extends CommonObject * @see Categorie::TYPE_WAREHOUSE * @see Categorie::TYPE_ACTIONCOMM * @see Categorie::TYPE_WEBSITE_PAGE + * @see Categorie::TYPE_TICKET + */ public $type; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 0b1504d229a..2d648ef1fd9 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6578,6 +6578,225 @@ class Form return; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return list of tickets in Ajax if Ajax activated or go to select_tickets_list + * + * @param int $selected Preselected tickets + * @param string $htmlname Name of HTML select field (must be unique in page). + * @param int $limit Limit on number of returned lines + * @param int $status Ticket status + * @param string $selected_input_value Value of preselected input text (for use with ajax) + * @param int $hidelabel Hide label (0=no, 1=yes, 2=show search icon (before) and placeholder, 3 search icon after) + * @param array $ajaxoptions Options for ajax_autocompleter + * @param int $socid Thirdparty Id (to get also price dedicated to this customer) + * @param string $showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text. + * @param int $forcecombo Force to use combo box + * @param string $morecss Add more css on select + * @param array $selected_combinations Selected combinations. Format: array([attrid] => attrval, [...]) + * @param string $nooutput No print, return the output into a string + * @return void|string + */ + public function select_tickets($selected = '', $htmlname = 'ticketid', $filtertype = '', $limit = 0, $status = 1, $selected_input_value = '', $hidelabel = 0, $ajaxoptions = array(), $socid = 0, $showempty = '1', $forcecombo = 0, $morecss = '', $selected_combinations = null, $nooutput = 0) + { + // phpcs:enable + global $langs, $conf; + + $out = ''; + + // check parameters + if (is_null($ajaxoptions)) $ajaxoptions = array(); + + if (!empty($conf->use_javascript_ajax) && !empty($conf->global->TICKET_USE_SEARCH_TO_SELECT)) + { + $placeholder = ''; + + if ($selected && empty($selected_input_value)) + { + require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; + $tickettmpselect = new Ticket($this->db); + $tickettmpselect->fetch($selected); + $selected_input_value = $tickettmpselect->ref; + unset($tickettmpselect); + } + + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); + + if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel").' : '; + elseif ($hidelabel > 1) { + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; + if ($hidelabel == 2) { + $out .= img_picto($langs->trans("Search"), 'search'); + } + } + $out .= 'global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />'; + if ($hidelabel == 3) { + $out .= img_picto($langs->trans("Search"), 'search'); + } + } else { + $out .= $this->select_tickets_list($selected, $htmlname, $filtertype, $limit, $status, 0, $socid, $showempty, $forcecombo, $morecss); + } + + if (empty($nooutput)) print $out; + else return $out; + } + + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return list of tickets. + * Called by select_tickets. + * + * @param int $selected Preselected ticket + * @param string $htmlname Name of select html + * @param string $filtertype Filter on ticket type + * @param int $limit Limit on number of returned lines + * @param string $filterkey Filter on product + * @param int $status Ticket status + * @param int $outputmode 0=HTML select string, 1=Array + * @param string $showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text. + * @param int $forcecombo Force to use combo box + * @param string $morecss Add more css on select + * @return array Array of keys for json + */ + public function select_tickets_list($selected = '', $htmlname = 'ticketid', $filtertype = '', $limit = 20, $filterkey = '', $status = 1, $outputmode = 0, $showempty = '1', $forcecombo = 0, $morecss = '') + { + // phpcs:enable + global $langs, $conf, $user, $db; + + $out = ''; + $outarray = array(); + + $selectFields = " p.rowid, p.ref, p.message"; + + $sql = "SELECT "; + $sql .= $selectFields; + $sql .= " FROM ".MAIN_DB_PREFIX."ticket as p"; + $sql .= ' WHERE p.entity IN ('.getEntity('ticket').')'; + + // Add criteria on ref/label + if ($filterkey != '') + { + $sql .= ' AND ('; + $prefix = empty($conf->global->TICKET_DONOTSEARCH_ANYWHERE) ? '%' : ''; // Can use index if PRODUCT_DONOTSEARCH_ANYWHERE is on + // For natural search + $scrit = explode(' ', $filterkey); + $i = 0; + if (count($scrit) > 1) $sql .= "("; + foreach ($scrit as $crit) + { + if ($i > 0) $sql .= " AND "; + $sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'"; + $sql .= ")"; + $i++; + } + if (count($scrit) > 1) $sql .= ")"; + $sql .= ')'; + } + + $sql .= $this->db->plimit($limit, 0); + + // Build output string + dol_syslog(get_class($this)."::select_tickets_list search tickets", LOG_DEBUG); + $result = $this->db->query($sql); + if ($result) + { + require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; + require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php'; + + $num = $this->db->num_rows($result); + + $events = null; + + if (!$forcecombo) + { + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; + $out .= ajax_combobox($htmlname, $events, $conf->global->TICKET_USE_SEARCH_TO_SELECT); + } + + $out .= ''; + + $this->db->free($result); + + if (empty($outputmode)) return $out; + return $outarray; + } else { + dol_print_error($db); + } + } + + /** + * constructTicketListOption. + * This define value for &$opt and &$optJson. + * + * @param resource $objp Result set of fetch + * @param string $opt Option (var used for returned value in string option format) + * @param string $optJson Option (var used for returned value in json format) + * @param string $selected Preselected value + * @param string $filterkey Filter key to highlight + * @return void + */ + protected function constructTicketListOption(&$objp, &$opt, &$optJson, $selected, $filterkey = '') + { + global $langs, $conf, $user, $db; + + $outkey = ''; + $outval = ''; + $outref = ''; + $outlabel = ''; + $outtype = ''; + + $label = $objp->label; + + $outkey = $objp->rowid; + $outref = $objp->ref; + $outlabel = $objp->label; + $outtype = $objp->fk_product_type; + + $opt = '\n"; + $optJson = array('key'=>$outkey, 'value'=>$outref, 'type'=>$outtypem); + } + /** * Generic method to select a component from a combo list. diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index daafa88333f..2178a02cb89 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -272,6 +272,15 @@ class FormTicket print ''; } + //Categories + if ($conf->categorie->enabled) { + // Categories + print ''.$langs->trans("Categories").''; + $cate_arbo = $form->select_all_categories(Categorie::TYPE_TICKET, '', 'parent', 64, 0, 1); + print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, GETPOST('categories', 'array'), '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0); + print ""; + } + // Attached files if (!empty($this->withfile)) { // Define list of attached files diff --git a/htdocs/core/modules/modTicket.class.php b/htdocs/core/modules/modTicket.class.php index 8b1a1dc8525..2a717ae4f42 100644 --- a/htdocs/core/modules/modTicket.class.php +++ b/htdocs/core/modules/modTicket.class.php @@ -283,6 +283,19 @@ class modTicket extends DolibarrModules 'target' => '', 'user' => 0); $r++; + + $this->menu[$r] = array('fk_menu' => 'fk_mainmenu=ticket,fk_leftmenu=ticket', + 'type' => 'left', + 'titre' => 'Categories', + 'mainmenu' => 'ticket', + 'url' => '/categories/index.php?type=12', + 'langs' => 'ticket', + 'position' => 107, + 'enabled' => '$conf->categorie->enabled', + 'perms' => '$user->rights->ticket->read', + 'target' => '', + 'user' => 0); + $r++; } /** diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 89f239db6c6..36d90c5519d 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -2497,6 +2497,51 @@ class Ticket extends CommonObject return array('listofpaths'=>$listofpaths, 'listofnames'=>$listofnames, 'listofmimes'=>$mimetype); } + /** + * Sets object to supplied categories. + * + * Deletes object from existing categories not supplied. + * Adds it to non existing supplied categories. + * Existing categories are left untouch. + * + * @param int[]|int $categories Category or categories IDs + * @return void + */ + public function setCategories($categories) + { + // Handle single category + if (!is_array($categories)) { + $categories = array($categories); + } + + // Get current categories + include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; + $c = new Categorie($this->db); + $existing = $c->containing($this->id, Categorie::TYPE_TICKET, 'id'); + + // Diff + if (is_array($existing)) { + $to_del = array_diff($existing, $categories); + $to_add = array_diff($categories, $existing); + } else { + $to_del = array(); // Nothing to delete + $to_add = $categories; + } + + // Process + foreach ($to_del as $del) { + if ($c->fetch($del) > 0) { + $c->del_type($this, Categorie::TYPE_TICKET); + } + } + foreach ($to_add as $add) { + if ($c->fetch($add) > 0) { + $c->add_type($this, Categorie::TYPE_TICKET); + } + } + + return; + } /** * Add new message on a ticket (private/public area). Can also send it be email if GETPOST('send_email', 'int') is set. From 7c072c7960bf6535e80efe147e49a303b37a54a9 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Fri, 2 Jul 2021 10:47:57 +0200 Subject: [PATCH 0972/1497] Fix Error type ent in fourn/commande/list.php --- htdocs/fourn/commande/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index c644f9e35a5..bd5686b71f1 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -1406,7 +1406,7 @@ if ($resql) { // Type ent if (!empty($arrayfields['typent.code']['checked'])) { print ''; - if (count($typenArray) == 0) { + if (empty($typenArray)) { $typenArray = $formcompany->typent_array(1); } print $typenArray[$obj->typent_code]; From 783257706ca6c20776efe59ea84852a04281adbc Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 2 Jul 2021 10:53:51 +0200 Subject: [PATCH 0973/1497] fix: payment ok should trigger PAYMENTONLINE_PAYMENT_OK even on custom object --- htdocs/public/payment/paymentok.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 60d763593fe..fb23e57d1ed 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -746,6 +746,12 @@ if ($ispaymentok) $result = $object->call_trigger('PAYMENTONLINE_PAYMENT_OK', $user); if ($result < 0) $error++; // End call triggers + } elseif (get_class($object)=='stdClass') { + //In some case $object is not instanciate (for paiement on custom object) We need to deal with payment + include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; + $paiement = new Paiement($db); + $result = $paiement->call_trigger('PAYMENTONLINE_PAYMENT_OK', $user); + if ($result < 0) $error++; } print $langs->trans("YourPaymentHasBeenRecorded")."
    \n"; From 97938f489ef937662de07ddbe020c133e01eaeb4 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Fri, 2 Jul 2021 11:35:26 +0200 Subject: [PATCH 0974/1497] FIX: holiday: status filter parameter has been renamed but not in links it was used --- htdocs/core/menus/standard/eldy.lib.php | 10 +++++----- htdocs/holiday/class/holiday.class.php | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index ed835a3d4c0..76d51069885 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1755,11 +1755,11 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $newmenu->add("/holiday/card.php?mainmenu=hrm&leftmenu=holiday&action=create", $langs->trans("New"), 1, $user->rights->holiday->write); $newmenu->add("/holiday/list.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("List"), 1, $user->rights->holiday->read); if ($usemenuhider || empty($leftmenu) || $leftmenu == "hrm") { - $newmenu->add("/holiday/list.php?search_statut=1&mainmenu=hrm&leftmenu=hrm", $langs->trans("DraftCP"), 2, $user->rights->holiday->read); - $newmenu->add("/holiday/list.php?search_statut=2&mainmenu=hrm&leftmenu=hrm", $langs->trans("ToReviewCP"), 2, $user->rights->holiday->read); - $newmenu->add("/holiday/list.php?search_statut=3&mainmenu=hrm&leftmenu=hrm", $langs->trans("ApprovedCP"), 2, $user->rights->holiday->read); - $newmenu->add("/holiday/list.php?search_statut=4&mainmenu=hrm&leftmenu=hrm", $langs->trans("CancelCP"), 2, $user->rights->holiday->read); - $newmenu->add("/holiday/list.php?search_statut=5&mainmenu=hrm&leftmenu=hrm", $langs->trans("RefuseCP"), 2, $user->rights->holiday->read); + $newmenu->add("/holiday/list.php?search_status=1&mainmenu=hrm&leftmenu=hrm", $langs->trans("DraftCP"), 2, $user->rights->holiday->read); + $newmenu->add("/holiday/list.php?search_status=2&mainmenu=hrm&leftmenu=hrm", $langs->trans("ToReviewCP"), 2, $user->rights->holiday->read); + $newmenu->add("/holiday/list.php?search_status=3&mainmenu=hrm&leftmenu=hrm", $langs->trans("ApprovedCP"), 2, $user->rights->holiday->read); + $newmenu->add("/holiday/list.php?search_status=4&mainmenu=hrm&leftmenu=hrm", $langs->trans("CancelCP"), 2, $user->rights->holiday->read); + $newmenu->add("/holiday/list.php?search_status=5&mainmenu=hrm&leftmenu=hrm", $langs->trans("RefuseCP"), 2, $user->rights->holiday->read); } $newmenu->add("/holiday/define_holiday.php?mainmenu=hrm&action=request", $langs->trans("MenuConfCP"), 1, $user->rights->holiday->read); $newmenu->add("/holiday/month_report.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("MenuReportMonth"), 1, $user->rights->holiday->readall); diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index f61c0a66ca8..717e9a07c58 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -2248,7 +2248,7 @@ class Holiday extends CommonObject $response->warning_delay = $conf->holiday->approve->warning_delay / 60 / 60 / 24; $response->label = $langs->trans("HolidaysToApprove"); $response->labelShort = $langs->trans("ToApprove"); - $response->url = DOL_URL_ROOT.'/holiday/list.php?search_statut=2&mainmenu=hrm&leftmenu=holiday'; + $response->url = DOL_URL_ROOT.'/holiday/list.php?search_status=2&mainmenu=hrm&leftmenu=holiday'; $response->img = img_object('', "holiday"); while ($obj = $this->db->fetch_object($resql)) From 3c5bc3fef421b34feb50a1d30b148dc4f0b1e015 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Fri, 2 Jul 2021 11:53:32 +0200 Subject: [PATCH 0975/1497] fix division by zero on of create --- htdocs/mrp/class/mo.class.php | 2 +- htdocs/mrp/tpl/originproductline.tpl.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index f8ff5751221..1369741e07d 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -649,7 +649,7 @@ class Mo extends CommonObject if ($line->qty_frozen) { $moline->qty = $line->qty; // Qty to consume does not depends on quantity to produce } else { - $moline->qty = price2num(($line->qty / $bom->qty) * $this->qty / $line->efficiency, 'MS'); // Calculate with Qty to produce and more presition + $moline->qty = price2num(($line->qty / ( ! empty($bom->qty) ? $bom->qty : 1 ) ) * $this->qty / ( ! empty($line->efficiency) ? $line->efficiency : 1 ), 'MS'); // Calculate with Qty to produce and more presition } if ($moline->qty <= 0) { $error++; diff --git a/htdocs/mrp/tpl/originproductline.tpl.php b/htdocs/mrp/tpl/originproductline.tpl.php index 6f3b63f6d4e..f149a75589f 100644 --- a/htdocs/mrp/tpl/originproductline.tpl.php +++ b/htdocs/mrp/tpl/originproductline.tpl.php @@ -25,7 +25,7 @@ if (empty($conf) || !is_object($conf)) if (!is_object($form)) $form = new Form($db); -$qtytoconsumeforline = $this->tpl['qty'] / $this->tpl['efficiency']; +$qtytoconsumeforline = $this->tpl['qty'] / ( ! empty($this->tpl['efficiency']) ? $this->tpl['efficiency'] : 1 ); /*if ((empty($this->tpl['qty_frozen']) && $this->tpl['qty_bom'] > 1)) { $qtytoconsumeforline = $qtytoconsumeforline / $this->tpl['qty_bom']; }*/ From 3bf268796cd415328353c8494241d43a3aeaecfe Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Fri, 2 Jul 2021 12:47:42 +0200 Subject: [PATCH 0976/1497] Fix #18063 : search filter status lost "Back to list" --- htdocs/fourn/class/fournisseur.commande.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index daa943ffee9..f315661b90c 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -3017,13 +3017,13 @@ class CommandeFournisseur extends CommonOrder $response->warning_delay = $conf->commande->fournisseur->warning_delay / 60 / 60 / 24; $response->label = $langs->trans("SuppliersOrdersToProcess"); $response->labelShort = $langs->trans("Opened"); - $response->url = DOL_URL_ROOT.'/fourn/commande/list.php?statut=1,2&mainmenu=commercial&leftmenu=orders_suppliers'; + $response->url = DOL_URL_ROOT.'/fourn/commande/list.php?search_status=1,2&mainmenu=commercial&leftmenu=orders_suppliers'; $response->img = img_object('', "order"); if ($mode === 'awaiting') { $response->label = $langs->trans("SuppliersOrdersAwaitingReception"); $response->labelShort = $langs->trans("AwaitingReception"); - $response->url = DOL_URL_ROOT.'/fourn/commande/list.php?statut=3,4&mainmenu=commercial&leftmenu=orders_suppliers'; + $response->url = DOL_URL_ROOT.'/fourn/commande/list.php?search_status=3,4&mainmenu=commercial&leftmenu=orders_suppliers'; } while ($obj = $this->db->fetch_object($resql)) { From 903adadcc45df890e1b01abf1734df63e74ba928 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Fri, 2 Jul 2021 10:47:57 +0200 Subject: [PATCH 0977/1497] Fix Error type ent in fourn/commande/list.php --- htdocs/fourn/commande/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index bf8e53e8b82..d1946cc9b4c 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -1407,7 +1407,7 @@ if ($resql) { // Type ent if (!empty($arrayfields['typent.code']['checked'])) { print ''; - if (count($typenArray) == 0) { + if (empty($typenArray)) { $typenArray = $formcompany->typent_array(1); } print $typenArray[$obj->typent_code]; From 2a30c699acf30879342fc73774f0b4eaa944f65e Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Fri, 2 Jul 2021 12:47:42 +0200 Subject: [PATCH 0978/1497] Fix #18063 : search filter status lost "Back to list" --- htdocs/fourn/class/fournisseur.commande.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index daa943ffee9..f315661b90c 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -3017,13 +3017,13 @@ class CommandeFournisseur extends CommonOrder $response->warning_delay = $conf->commande->fournisseur->warning_delay / 60 / 60 / 24; $response->label = $langs->trans("SuppliersOrdersToProcess"); $response->labelShort = $langs->trans("Opened"); - $response->url = DOL_URL_ROOT.'/fourn/commande/list.php?statut=1,2&mainmenu=commercial&leftmenu=orders_suppliers'; + $response->url = DOL_URL_ROOT.'/fourn/commande/list.php?search_status=1,2&mainmenu=commercial&leftmenu=orders_suppliers'; $response->img = img_object('', "order"); if ($mode === 'awaiting') { $response->label = $langs->trans("SuppliersOrdersAwaitingReception"); $response->labelShort = $langs->trans("AwaitingReception"); - $response->url = DOL_URL_ROOT.'/fourn/commande/list.php?statut=3,4&mainmenu=commercial&leftmenu=orders_suppliers'; + $response->url = DOL_URL_ROOT.'/fourn/commande/list.php?search_status=3,4&mainmenu=commercial&leftmenu=orders_suppliers'; } while ($obj = $this->db->fetch_object($resql)) { From 8bade0e4e7c06d163670f533dd4e7dd7f69c0628 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 2 Jul 2021 16:11:42 +0200 Subject: [PATCH 0979/1497] Fix add permission --- htdocs/comm/propal/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index e5700fca445..d92ec87ca29 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -112,7 +112,7 @@ if (!$sortfield) $sortfield = 'p.ref'; if (!$sortorder) $sortorder = 'DESC'; $permissiontoread = $user->rights->propal->lire; -$permissiontoadd = $user->rights->propal->write; +$permissiontoadd = $user->rights->propal->creer; $permissiontodelete = $user->rights->propal->supprimer; if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { $permissiontoclose = $user->rights->propale->propal_advance->close; From e35ecdf58d4280c528eb236c629325824293b091 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 Jul 2021 17:58:37 +0200 Subject: [PATCH 0980/1497] Fix trans --- htdocs/langs/en_US/users.lang | 4 ++-- htdocs/user/group/card.php | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/langs/en_US/users.lang b/htdocs/langs/en_US/users.lang index a14db3882b0..841ee0f3daf 100644 --- a/htdocs/langs/en_US/users.lang +++ b/htdocs/langs/en_US/users.lang @@ -97,8 +97,8 @@ LoginToCreate=Login to create NameToCreate=Name of third party to create YourRole=Your roles YourQuotaOfUsersIsReached=Your quota of active users is reached ! -NbOfUsers=No. of users -NbOfPermissions=No. of permissions +NbOfUsers=Number of users +NbOfPermissions=Number of permissions DontDowngradeSuperAdmin=Only a superadmin can downgrade a superadmin HierarchicalResponsible=Supervisor HierarchicView=Hierarchical view diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index 0e60e70e42a..5c1e16e4a0c 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -428,6 +428,7 @@ if ($action == 'create') { * Group members */ + print '
    '; // You can use div-table-responsive-no-min if you dont need reserved height for your table print ''; print ''; print ''; @@ -440,7 +441,7 @@ if ($action == 'create') { if (!empty($object->members)) { foreach ($object->members as $useringroup) { print ''; - print ''; } print "
    '.$langs->trans("Login").'
    '; + print ''; print $useringroup->getNomUrl(-1, '', 0, 0, 24, 0, 'login'); if ($useringroup->admin && !$useringroup->entity) { print img_picto($langs->trans("SuperAdministrator"), 'redstar'); @@ -465,6 +466,7 @@ if ($action == 'create') { print '
    '.$langs->trans("None").'
    "; + print '
    '; } print "
    "; From 7fb094602228edef5b08713a6533df36fbbb8b72 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 Jul 2021 18:09:48 +0200 Subject: [PATCH 0981/1497] Fix link --- htdocs/user/class/usergroup.class.php | 10 +++++++--- htdocs/user/group/list.php | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index 083b1bcc18c..1f0bb2891c6 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -711,7 +711,7 @@ class UserGroup extends CommonObject * Use this->id,this->lastname, this->firstname * * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto, -1=Include photo into link, -2=Only picto photo, -3=Only photo very small) - * @param string $option On what the link point to ('nolink', ) + * @param string $option On what the link point to ('nolink', 'permissions') * @param integer $notooltip 1=Disable tooltip on picto and name * @param string $morecss Add more css on link * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking @@ -730,12 +730,16 @@ class UserGroup extends CommonObject $result = ''; $label = ''; $label .= '
    '; - $label .= ''.$langs->trans("Group").'
    '; + $label .= img_picto('', 'group').' '.$langs->trans("Group").'
    '; $label .= ''.$langs->trans('Name').': '.$this->name; $label .= '
    '.$langs->trans("Description").': '.$this->note; $label .= '
    '; - $url = DOL_URL_ROOT.'/user/group/card.php?id='.$this->id; + if ($option == 'permissions') { + $url = DOL_URL_ROOT.'/user/group/perms.php?id='.$this->id; + } else { + $url = DOL_URL_ROOT.'/user/group/card.php?id='.$this->id; + } if ($option != 'nolink') { // Add param to save lastsearch_values or not diff --git a/htdocs/user/group/list.php b/htdocs/user/group/list.php index 302d697c563..493383076b0 100644 --- a/htdocs/user/group/list.php +++ b/htdocs/user/group/list.php @@ -122,7 +122,7 @@ if (empty($reshook)) { llxHeader(); -$sql = "SELECT g.rowid, g.nom as name, g.note, g.entity, g.datec, COUNT(DISTINCT ugu.fk_user) as nb, COUNT(DISTINCT ugr.fk_id) as nbpermissions"; +$sql = "SELECT g.rowid, g.nom as name, g.note, g.entity, g.datec, g.tms as datem, COUNT(DISTINCT ugu.fk_user) as nb, COUNT(DISTINCT ugr.fk_id) as nbpermissions"; $sql .= " FROM ".MAIN_DB_PREFIX."usergroup as g"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_usergroup = g.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_rights as ugr ON ugr.fk_usergroup = g.rowid"; @@ -137,7 +137,7 @@ if (!empty($search_group)) { if ($sall) { $sql .= natural_search(array("g.nom", "g.note"), $sall); } -$sql .= " GROUP BY g.rowid, g.nom, g.note, g.entity, g.datec"; +$sql .= " GROUP BY g.rowid, g.nom, g.note, g.entity, g.datec, g.tms"; $sql .= $db->order($sortfield, $sortorder); $resql = $db->query($sql); @@ -197,6 +197,7 @@ if ($resql) { print_liste_field_titre("NbOfUsers", $_SERVER["PHP_SELF"], "nb", $param, "", '', $sortfield, $sortorder, 'center '); print_liste_field_titre("NbOfPermissions", $_SERVER["PHP_SELF"], "nbpermissions", $param, "", '', $sortfield, $sortorder, 'center '); print_liste_field_titre("DateCreationShort", $_SERVER["PHP_SELF"], "g.datec", $param, "", '', $sortfield, $sortorder, 'center '); + print_liste_field_titre("DateLastModification", $_SERVER["PHP_SELF"], "g.tms", $param, "", '', $sortfield, $sortorder, 'center '); print_liste_field_titre("", $_SERVER["PHP_SELF"]); print "\n"; @@ -222,8 +223,11 @@ if ($resql) { print ''.$mc->label.''; } print ''.$obj->nb.''; - print ''.$obj->nbpermissions.''; + print ''; + print ''.$obj->nbpermissions.''; + print ''; print ''.dol_print_date($db->jdate($obj->datec), "dayhour").''; + print ''.dol_print_date($db->jdate($obj->datem), "dayhour").''; print ''; print "\n"; $i++; From bb0daa4f0d953cdc42e40755561ec81bdeaf5303 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 Jul 2021 18:11:01 +0200 Subject: [PATCH 0982/1497] Prepare v14 --- 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 777fde21885..8aa64da85f1 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -34,7 +34,7 @@ if (!defined('DOL_APPLICATION_TITLE')) { define('DOL_APPLICATION_TITLE', 'Dolibarr'); } if (!defined('DOL_VERSION')) { - define('DOL_VERSION', '14.0.0-beta'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c + define('DOL_VERSION', '14.0.0'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c } if (!defined('EURO')) { From 8a3b92a32dcdbe6ba3526cb8b13d388d0b1ba1a6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 Jul 2021 18:30:58 +0200 Subject: [PATCH 0983/1497] Fix filter --- htdocs/holiday/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index c62185d5f2a..ece1f9c9ec7 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -117,7 +117,7 @@ $search_month_end = GETPOST('search_month_end', 'int'); $search_year_end = GETPOST('search_year_end', 'int'); $search_employee = GETPOST('search_employee', 'int'); $search_valideur = GETPOST('search_valideur', 'int'); -$search_status = GETPOST('search_status', 'int'); +$search_status = GETPOSTISSET('search_status') ? GETPOST('search_status', 'int') : GETPOST('search_statut', 'int'); $search_type = GETPOST('search_type', 'int'); // Initialize technical objects From 30f9eb9f23fc1998f853d39c7e114117b3fbf5b0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 Jul 2021 18:32:52 +0200 Subject: [PATCH 0984/1497] Fix phpcs --- htdocs/core/tpl/objectline_view.tpl.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 3f7e1616aff..56aba732c6b 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -354,7 +354,6 @@ if ($outputalsopricetotalwithtax) { } if ($this->statut == 0 && ($object_rights->creer) && $action != 'selectlines') { - $situationinvoicelinewithparent = 0; if ($line->fk_prev_id != null && in_array($object->element, array('facture', 'facturedet'))) { if ($object->type == $object::TYPE_SITUATION) { // The constant TYPE_SITUATION exists only for object invoice From df498def86d9f640f807ea02b4d7560dc3f48651 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 Jul 2021 18:38:43 +0200 Subject: [PATCH 0985/1497] Fix css --- htdocs/contact/class/contact.class.php | 6 +++--- htdocs/contact/list.php | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index a5f408f4299..165a7bf7bc3 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -100,15 +100,15 @@ class Contact extends CommonObject 'firstname' =>array('type'=>'varchar(50)', 'label'=>'Firstname', 'enabled'=>1, 'visible'=>1, 'position'=>50, 'showoncombobox'=>1, 'searchall'=>1), 'address' =>array('type'=>'varchar(255)', 'label'=>'Address', 'enabled'=>1, 'visible'=>-1, 'position'=>55), 'zip' =>array('type'=>'varchar(25)', 'label'=>'Zip', 'enabled'=>1, 'visible'=>1, 'position'=>60), - 'town' =>array('type'=>'text', 'label'=>'Town', 'enabled'=>1, 'visible'=>1, 'position'=>65), + 'town' =>array('type'=>'text', 'label'=>'Town', 'enabled'=>1, 'visible'=>-1, 'position'=>65), 'fk_departement' =>array('type'=>'integer', 'label'=>'Fk departement', 'enabled'=>1, 'visible'=>3, 'position'=>70), 'fk_pays' =>array('type'=>'integer', 'label'=>'Fk pays', 'enabled'=>1, 'visible'=>3, 'position'=>75), 'birthday' =>array('type'=>'date', 'label'=>'Birthday', 'enabled'=>1, 'visible'=>3, 'position'=>80), 'poste' =>array('type'=>'varchar(80)', 'label'=>'PostOrFunction', 'enabled'=>1, 'visible'=>-1, 'position'=>85), 'phone' =>array('type'=>'varchar(30)', 'label'=>'Phone', 'enabled'=>1, 'visible'=>1, 'position'=>90, 'searchall'=>1), - 'phone_perso' =>array('type'=>'varchar(30)', 'label'=>'PhonePerso', 'enabled'=>1, 'visible'=>1, 'position'=>95, 'searchall'=>1), + 'phone_perso' =>array('type'=>'varchar(30)', 'label'=>'PhonePerso', 'enabled'=>1, 'visible'=>-1, 'position'=>95, 'searchall'=>1), 'phone_mobile' =>array('type'=>'varchar(30)', 'label'=>'PhoneMobile', 'enabled'=>1, 'visible'=>1, 'position'=>100, 'searchall'=>1), - 'fax' =>array('type'=>'varchar(30)', 'label'=>'Fax', 'enabled'=>1, 'visible'=>1, 'position'=>105, 'searchall'=>1), + 'fax' =>array('type'=>'varchar(30)', 'label'=>'Fax', 'enabled'=>1, 'visible'=>-1, 'position'=>105, 'searchall'=>1), 'email' =>array('type'=>'varchar(255)', 'label'=>'Email', 'enabled'=>1, 'visible'=>1, 'position'=>110, 'searchall'=>1), 'socialnetworks' =>array('type'=>'text', 'label'=>'SocialNetworks', 'enabled'=>1, 'visible'=>3, 'position'=>115), 'photo' =>array('type'=>'varchar(255)', 'label'=>'Photo', 'enabled'=>1, 'visible'=>3, 'position'=>170), diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index fe8e20bac9c..e5a9ab3f0d6 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -1097,28 +1097,28 @@ while ($i < min($num, $limit)) { } // Phone if (!empty($arrayfields['p.phone']['checked'])) { - print ''.dol_print_phone($obj->phone_pro, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'phone').''; + print ''.dol_print_phone($obj->phone_pro, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'phone').''; if (!$i) { $totalarray['nbfield']++; } } // Phone perso if (!empty($arrayfields['p.phone_perso']['checked'])) { - print ''.dol_print_phone($obj->phone_perso, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'phone').''; + print ''.dol_print_phone($obj->phone_perso, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'phone').''; if (!$i) { $totalarray['nbfield']++; } } // Phone mobile if (!empty($arrayfields['p.phone_mobile']['checked'])) { - print ''.dol_print_phone($obj->phone_mobile, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'mobile').''; + print ''.dol_print_phone($obj->phone_mobile, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'mobile').''; if (!$i) { $totalarray['nbfield']++; } } // Fax if (!empty($arrayfields['p.fax']['checked'])) { - print ''.dol_print_phone($obj->fax, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'fax').''; + print ''.dol_print_phone($obj->fax, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'fax').''; if (!$i) { $totalarray['nbfield']++; } From affe6d963196dfbb5f6bc31bb28a481a8b87e417 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 Jul 2021 19:00:58 +0200 Subject: [PATCH 0986/1497] Sync transifex --- htdocs/fourn/facture/list.php | 14 +- htdocs/fourn/paiement/list.php | 6 +- htdocs/langs/am_ET/deliveries.lang | 2 + htdocs/langs/am_ET/exports.lang | 3 +- htdocs/langs/ar_EG/website.lang | 1 + htdocs/langs/ar_IQ/deliveries.lang | 1 + htdocs/langs/ar_IQ/exports.lang | 3 +- htdocs/langs/ar_SA/exports.lang | 3 +- htdocs/langs/az_AZ/deliveries.lang | 2 + htdocs/langs/az_AZ/exports.lang | 3 +- htdocs/langs/bg_BG/deliveries.lang | 2 + htdocs/langs/bg_BG/exports.lang | 3 +- htdocs/langs/bn_BD/deliveries.lang | 2 + htdocs/langs/bn_BD/exports.lang | 3 +- htdocs/langs/bn_IN/deliveries.lang | 2 + htdocs/langs/bn_IN/exports.lang | 3 +- htdocs/langs/bs_BA/deliveries.lang | 2 + htdocs/langs/bs_BA/exports.lang | 3 +- htdocs/langs/ca_ES/deliveries.lang | 2 + htdocs/langs/ca_ES/exports.lang | 7 +- htdocs/langs/cs_CZ/deliveries.lang | 2 + htdocs/langs/cs_CZ/exports.lang | 3 +- htdocs/langs/da_DK/accountancy.lang | 3 +- htdocs/langs/da_DK/admin.lang | 1 + htdocs/langs/da_DK/deliveries.lang | 2 + htdocs/langs/da_DK/exports.lang | 3 +- htdocs/langs/da_DK/knowledgemanagement.lang | 10 +- htdocs/langs/da_DK/languages.lang | 2 + htdocs/langs/da_DK/products.lang | 3 +- htdocs/langs/da_DK/stocks.lang | 6 +- htdocs/langs/da_DK/ticket.lang | 11 +- htdocs/langs/de_AT/admin.lang | 1 + htdocs/langs/de_AT/salaries.lang | 3 + htdocs/langs/de_AT/users.lang | 2 + htdocs/langs/de_AT/website.lang | 2 + htdocs/langs/de_CH/website.lang | 1 + htdocs/langs/de_DE/deliveries.lang | 1 + htdocs/langs/de_DE/exports.lang | 7 +- htdocs/langs/el_CY/admin.lang | 1 + htdocs/langs/el_CY/users.lang | 3 + htdocs/langs/el_CY/website.lang | 2 + htdocs/langs/el_GR/deliveries.lang | 2 + htdocs/langs/el_GR/exports.lang | 3 +- htdocs/langs/en_AU/admin.lang | 1 + htdocs/langs/en_AU/salaries.lang | 3 + htdocs/langs/en_AU/users.lang | 3 + htdocs/langs/en_AU/website.lang | 2 + htdocs/langs/en_CA/admin.lang | 1 + htdocs/langs/en_CA/salaries.lang | 3 + htdocs/langs/en_CA/users.lang | 3 + htdocs/langs/en_CA/website.lang | 2 + htdocs/langs/en_GB/admin.lang | 1 + htdocs/langs/en_IN/admin.lang | 1 + htdocs/langs/en_IN/salaries.lang | 3 + htdocs/langs/en_IN/users.lang | 3 + htdocs/langs/en_IN/website.lang | 2 + htdocs/langs/en_SG/admin.lang | 1 + htdocs/langs/en_SG/salaries.lang | 3 + htdocs/langs/en_SG/users.lang | 3 + htdocs/langs/en_SG/website.lang | 2 + htdocs/langs/es_AR/admin.lang | 1 + htdocs/langs/es_BO/admin.lang | 1 + htdocs/langs/es_BO/salaries.lang | 3 + htdocs/langs/es_BO/users.lang | 3 + htdocs/langs/es_BO/website.lang | 2 + htdocs/langs/es_CL/exports.lang | 1 - htdocs/langs/es_CL/main.lang | 1 + htdocs/langs/es_CL/products.lang | 1 - htdocs/langs/es_CO/main.lang | 1 + htdocs/langs/es_CO/ticket.lang | 3 - htdocs/langs/es_CO/users.lang | 2 + htdocs/langs/es_CO/website.lang | 2 + htdocs/langs/es_DO/admin.lang | 1 + htdocs/langs/es_DO/salaries.lang | 3 + htdocs/langs/es_DO/users.lang | 3 + htdocs/langs/es_DO/website.lang | 2 + htdocs/langs/es_EC/exports.lang | 1 - htdocs/langs/es_EC/main.lang | 1 + htdocs/langs/es_EC/ticket.lang | 3 - htdocs/langs/es_ES/accountancy.lang | 9 +- htdocs/langs/es_ES/admin.lang | 11 +- htdocs/langs/es_ES/deliveries.lang | 1 + htdocs/langs/es_ES/errors.lang | 2 +- htdocs/langs/es_ES/exports.lang | 3 +- htdocs/langs/es_ES/knowledgemanagement.lang | 10 +- htdocs/langs/es_ES/languages.lang | 2 + htdocs/langs/es_ES/main.lang | 4 +- htdocs/langs/es_ES/products.lang | 3 +- htdocs/langs/es_ES/stocks.lang | 6 +- htdocs/langs/es_ES/ticket.lang | 11 +- htdocs/langs/es_GT/admin.lang | 1 + htdocs/langs/es_GT/salaries.lang | 3 + htdocs/langs/es_GT/users.lang | 3 + htdocs/langs/es_GT/website.lang | 2 + htdocs/langs/es_HN/admin.lang | 1 + htdocs/langs/es_HN/salaries.lang | 3 + htdocs/langs/es_HN/users.lang | 3 + htdocs/langs/es_HN/website.lang | 2 + htdocs/langs/es_MX/users.lang | 2 + htdocs/langs/es_PA/admin.lang | 1 + htdocs/langs/es_PA/salaries.lang | 3 + htdocs/langs/es_PA/users.lang | 3 + htdocs/langs/es_PA/website.lang | 2 + htdocs/langs/es_PE/admin.lang | 1 + htdocs/langs/es_PE/users.lang | 2 + htdocs/langs/es_PY/admin.lang | 1 + htdocs/langs/es_PY/salaries.lang | 3 + htdocs/langs/es_PY/users.lang | 3 + htdocs/langs/es_PY/website.lang | 2 + htdocs/langs/es_US/admin.lang | 1 + htdocs/langs/es_US/salaries.lang | 3 + htdocs/langs/es_US/users.lang | 3 + htdocs/langs/es_US/website.lang | 2 + htdocs/langs/es_UY/admin.lang | 1 + htdocs/langs/es_UY/salaries.lang | 3 + htdocs/langs/es_UY/users.lang | 3 + htdocs/langs/es_UY/website.lang | 2 + htdocs/langs/es_VE/admin.lang | 1 + htdocs/langs/es_VE/users.lang | 3 + htdocs/langs/es_VE/website.lang | 2 + htdocs/langs/et_EE/deliveries.lang | 2 + htdocs/langs/et_EE/exports.lang | 3 +- htdocs/langs/eu_ES/deliveries.lang | 2 + htdocs/langs/eu_ES/exports.lang | 3 +- htdocs/langs/fa_IR/deliveries.lang | 2 + htdocs/langs/fa_IR/exports.lang | 3 +- htdocs/langs/fi_FI/deliveries.lang | 2 + htdocs/langs/fi_FI/exports.lang | 3 +- htdocs/langs/fr_BE/admin.lang | 1 + htdocs/langs/fr_BE/salaries.lang | 3 + htdocs/langs/fr_BE/users.lang | 3 + htdocs/langs/fr_BE/website.lang | 2 + htdocs/langs/fr_CA/admin.lang | 1 + htdocs/langs/fr_CA/products.lang | 1 - htdocs/langs/fr_CA/users.lang | 2 + htdocs/langs/fr_CA/website.lang | 1 + htdocs/langs/fr_CH/admin.lang | 1 + htdocs/langs/fr_CH/salaries.lang | 3 + htdocs/langs/fr_CH/users.lang | 3 + htdocs/langs/fr_CH/website.lang | 2 + htdocs/langs/fr_CI/admin.lang | 1 + htdocs/langs/fr_CI/salaries.lang | 3 + htdocs/langs/fr_CI/users.lang | 3 + htdocs/langs/fr_CI/website.lang | 2 + htdocs/langs/fr_CM/admin.lang | 1 + htdocs/langs/fr_CM/salaries.lang | 3 + htdocs/langs/fr_CM/users.lang | 3 + htdocs/langs/fr_CM/website.lang | 2 + htdocs/langs/fr_FR/compta.lang | 10 +- htdocs/langs/fr_FR/exports.lang | 3 +- htdocs/langs/fr_GA/admin.lang | 1 + htdocs/langs/fr_GA/salaries.lang | 3 + htdocs/langs/fr_GA/users.lang | 3 + htdocs/langs/fr_GA/website.lang | 2 + htdocs/langs/gl_ES/deliveries.lang | 1 + htdocs/langs/gl_ES/exports.lang | 3 +- htdocs/langs/he_IL/deliveries.lang | 2 + htdocs/langs/he_IL/exports.lang | 3 +- htdocs/langs/hi_IN/deliveries.lang | 2 + htdocs/langs/hi_IN/exports.lang | 3 +- htdocs/langs/hr_HR/deliveries.lang | 2 + htdocs/langs/hr_HR/exports.lang | 3 +- htdocs/langs/hu_HU/deliveries.lang | 2 + htdocs/langs/hu_HU/exports.lang | 3 +- htdocs/langs/id_ID/deliveries.lang | 2 + htdocs/langs/id_ID/exports.lang | 3 +- htdocs/langs/is_IS/deliveries.lang | 2 + htdocs/langs/is_IS/exports.lang | 3 +- htdocs/langs/it_CH/salaries.lang | 3 + htdocs/langs/it_CH/users.lang | 3 + htdocs/langs/it_IT/deliveries.lang | 1 + htdocs/langs/it_IT/exports.lang | 3 +- htdocs/langs/ja_JP/accountancy.lang | 3 +- htdocs/langs/ja_JP/admin.lang | 1 + htdocs/langs/ja_JP/deliveries.lang | 4 +- htdocs/langs/ja_JP/exports.lang | 3 +- htdocs/langs/ja_JP/knowledgemanagement.lang | 10 +- htdocs/langs/ja_JP/languages.lang | 2 + htdocs/langs/ja_JP/products.lang | 3 +- htdocs/langs/ja_JP/stocks.lang | 6 +- htdocs/langs/ja_JP/ticket.lang | 11 +- htdocs/langs/ka_GE/deliveries.lang | 2 + htdocs/langs/ka_GE/exports.lang | 3 +- htdocs/langs/km_KH/deliveries.lang | 2 + htdocs/langs/km_KH/exports.lang | 3 +- htdocs/langs/kn_IN/deliveries.lang | 2 + htdocs/langs/kn_IN/exports.lang | 3 +- htdocs/langs/ko_KR/deliveries.lang | 2 + htdocs/langs/ko_KR/exports.lang | 3 +- htdocs/langs/lo_LA/deliveries.lang | 2 + htdocs/langs/lo_LA/exports.lang | 3 +- htdocs/langs/lt_LT/deliveries.lang | 2 + htdocs/langs/lt_LT/exports.lang | 3 +- htdocs/langs/lv_LV/accountancy.lang | 57 +++---- htdocs/langs/lv_LV/admin.lang | 151 ++++++++--------- htdocs/langs/lv_LV/agenda.lang | 12 +- htdocs/langs/lv_LV/assets.lang | 14 +- htdocs/langs/lv_LV/banks.lang | 12 +- htdocs/langs/lv_LV/bills.lang | 32 ++-- htdocs/langs/lv_LV/blockedlog.lang | 4 +- htdocs/langs/lv_LV/boxes.lang | 28 ++-- htdocs/langs/lv_LV/cashdesk.lang | 20 +-- htdocs/langs/lv_LV/categories.lang | 24 +-- htdocs/langs/lv_LV/commercial.lang | 5 +- htdocs/langs/lv_LV/companies.lang | 36 ++--- htdocs/langs/lv_LV/compta.lang | 58 +++---- htdocs/langs/lv_LV/cron.lang | 2 +- htdocs/langs/lv_LV/deliveries.lang | 2 + htdocs/langs/lv_LV/dict.lang | 2 +- htdocs/langs/lv_LV/donations.lang | 2 +- htdocs/langs/lv_LV/ecm.lang | 8 +- htdocs/langs/lv_LV/errors.lang | 40 ++--- htdocs/langs/lv_LV/eventorganization.lang | 162 +++++++++---------- htdocs/langs/lv_LV/exports.lang | 5 +- htdocs/langs/lv_LV/externalsite.lang | 2 +- htdocs/langs/lv_LV/holiday.lang | 32 ++-- htdocs/langs/lv_LV/hrm.lang | 2 +- htdocs/langs/lv_LV/knowledgemanagement.lang | 36 ++--- htdocs/langs/lv_LV/languages.lang | 6 +- htdocs/langs/lv_LV/mails.lang | 6 +- htdocs/langs/lv_LV/main.lang | 54 +++---- htdocs/langs/lv_LV/margins.lang | 2 +- htdocs/langs/lv_LV/members.lang | 60 +++---- htdocs/langs/lv_LV/modulebuilder.lang | 10 +- htdocs/langs/lv_LV/mrp.lang | 8 +- htdocs/langs/lv_LV/orders.lang | 4 +- htdocs/langs/lv_LV/other.lang | 12 +- htdocs/langs/lv_LV/partnership.lang | 80 ++++----- htdocs/langs/lv_LV/productbatch.lang | 42 ++--- htdocs/langs/lv_LV/products.lang | 31 ++-- htdocs/langs/lv_LV/projects.lang | 22 +-- htdocs/langs/lv_LV/propal.lang | 2 +- htdocs/langs/lv_LV/receptions.lang | 2 +- htdocs/langs/lv_LV/recruitment.lang | 2 +- htdocs/langs/lv_LV/salaries.lang | 5 +- htdocs/langs/lv_LV/sendings.lang | 2 +- htdocs/langs/lv_LV/stocks.lang | 58 +++---- htdocs/langs/lv_LV/supplier_proposal.lang | 4 + htdocs/langs/lv_LV/ticket.lang | 43 ++--- htdocs/langs/lv_LV/trips.lang | 8 +- htdocs/langs/lv_LV/users.lang | 8 +- htdocs/langs/lv_LV/website.lang | 16 +- htdocs/langs/lv_LV/withdrawals.lang | 11 +- htdocs/langs/lv_LV/zapier.lang | 4 +- htdocs/langs/mk_MK/deliveries.lang | 2 + htdocs/langs/mk_MK/exports.lang | 3 +- htdocs/langs/mn_MN/deliveries.lang | 2 + htdocs/langs/mn_MN/exports.lang | 3 +- htdocs/langs/nb_NO/deliveries.lang | 1 + htdocs/langs/nb_NO/exports.lang | 3 +- htdocs/langs/ne_NP/deliveries.lang | 2 + htdocs/langs/ne_NP/exports.lang | 3 +- htdocs/langs/nl_BE/admin.lang | 1 + htdocs/langs/nl_BE/ticket.lang | 1 - htdocs/langs/nl_BE/website.lang | 1 + htdocs/langs/nl_NL/deliveries.lang | 1 + htdocs/langs/nl_NL/exports.lang | 3 +- htdocs/langs/pl_PL/deliveries.lang | 10 +- htdocs/langs/pl_PL/exports.lang | 113 ++++++------- htdocs/langs/pt_AO/admin.lang | 2 + htdocs/langs/pt_AO/salaries.lang | 3 + htdocs/langs/pt_AO/website.lang | 2 + htdocs/langs/pt_BR/deliveries.lang | 1 + htdocs/langs/pt_BR/exports.lang | 1 + htdocs/langs/pt_BR/products.lang | 1 - htdocs/langs/pt_BR/ticket.lang | 2 - htdocs/langs/pt_PT/deliveries.lang | 2 + htdocs/langs/pt_PT/exports.lang | 3 +- htdocs/langs/ro_RO/deliveries.lang | 38 ++--- htdocs/langs/ro_RO/exports.lang | 169 ++++++++++---------- htdocs/langs/ru_UA/salaries.lang | 3 + htdocs/langs/ru_UA/users.lang | 3 + htdocs/langs/ru_UA/website.lang | 2 + htdocs/langs/sk_SK/deliveries.lang | 2 + htdocs/langs/sk_SK/exports.lang | 3 +- htdocs/langs/sl_SI/deliveries.lang | 2 + htdocs/langs/sl_SI/exports.lang | 3 +- htdocs/langs/sq_AL/deliveries.lang | 2 + htdocs/langs/sq_AL/exports.lang | 3 +- htdocs/langs/sr_RS/deliveries.lang | 2 + htdocs/langs/sr_RS/exports.lang | 3 +- htdocs/langs/sw_SW/deliveries.lang | 2 + htdocs/langs/sw_SW/exports.lang | 3 +- htdocs/langs/th_TH/deliveries.lang | 2 + htdocs/langs/th_TH/exports.lang | 3 +- htdocs/langs/tr_TR/deliveries.lang | 2 + htdocs/langs/tr_TR/exports.lang | 3 +- htdocs/langs/uk_UA/deliveries.lang | 2 + htdocs/langs/uk_UA/exports.lang | 3 +- htdocs/langs/vi_VN/deliveries.lang | 2 + htdocs/langs/vi_VN/exports.lang | 3 +- htdocs/langs/zh_CN/deliveries.lang | 2 + htdocs/langs/zh_CN/exports.lang | 3 +- htdocs/langs/zh_HK/deliveries.lang | 2 + htdocs/langs/zh_HK/exports.lang | 3 +- htdocs/langs/zh_TW/admin.lang | 45 +++--- htdocs/langs/zh_TW/agenda.lang | 12 +- htdocs/langs/zh_TW/boxes.lang | 32 ++-- htdocs/langs/zh_TW/cashdesk.lang | 20 +-- htdocs/langs/zh_TW/companies.lang | 6 +- htdocs/langs/zh_TW/compta.lang | 22 +-- htdocs/langs/zh_TW/deliveries.lang | 1 + htdocs/langs/zh_TW/errors.lang | 86 +++++----- htdocs/langs/zh_TW/eventorganization.lang | 6 +- htdocs/langs/zh_TW/exports.lang | 3 +- htdocs/langs/zh_TW/holiday.lang | 44 ++--- htdocs/langs/zh_TW/hrm.lang | 2 +- htdocs/langs/zh_TW/languages.lang | 6 +- htdocs/langs/zh_TW/main.lang | 54 +++---- htdocs/langs/zh_TW/margins.lang | 2 +- htdocs/langs/zh_TW/members.lang | 60 +++---- htdocs/langs/zh_TW/mrp.lang | 8 +- htdocs/langs/zh_TW/orders.lang | 4 +- htdocs/langs/zh_TW/other.lang | 12 +- htdocs/langs/zh_TW/partnership.lang | 80 ++++----- htdocs/langs/zh_TW/productbatch.lang | 40 ++--- htdocs/langs/zh_TW/products.lang | 31 ++-- htdocs/langs/zh_TW/projects.lang | 22 +-- htdocs/langs/zh_TW/propal.lang | 2 +- htdocs/langs/zh_TW/receptions.lang | 2 +- htdocs/langs/zh_TW/recruitment.lang | 28 ++-- htdocs/langs/zh_TW/salaries.lang | 5 +- htdocs/langs/zh_TW/sendings.lang | 8 +- htdocs/langs/zh_TW/stocks.lang | 48 +++--- htdocs/langs/zh_TW/supplier_proposal.lang | 58 +++---- htdocs/langs/zh_TW/ticket.lang | 15 +- 326 files changed, 1697 insertions(+), 1293 deletions(-) create mode 100644 htdocs/langs/de_AT/salaries.lang create mode 100644 htdocs/langs/de_AT/website.lang create mode 100644 htdocs/langs/el_CY/users.lang create mode 100644 htdocs/langs/el_CY/website.lang create mode 100644 htdocs/langs/en_AU/salaries.lang create mode 100644 htdocs/langs/en_AU/users.lang create mode 100644 htdocs/langs/en_AU/website.lang create mode 100644 htdocs/langs/en_CA/salaries.lang create mode 100644 htdocs/langs/en_CA/users.lang create mode 100644 htdocs/langs/en_CA/website.lang create mode 100644 htdocs/langs/en_IN/salaries.lang create mode 100644 htdocs/langs/en_IN/users.lang create mode 100644 htdocs/langs/en_IN/website.lang create mode 100644 htdocs/langs/en_SG/salaries.lang create mode 100644 htdocs/langs/en_SG/users.lang create mode 100644 htdocs/langs/en_SG/website.lang create mode 100644 htdocs/langs/es_BO/salaries.lang create mode 100644 htdocs/langs/es_BO/users.lang create mode 100644 htdocs/langs/es_BO/website.lang create mode 100644 htdocs/langs/es_CO/website.lang create mode 100644 htdocs/langs/es_DO/salaries.lang create mode 100644 htdocs/langs/es_DO/users.lang create mode 100644 htdocs/langs/es_DO/website.lang create mode 100644 htdocs/langs/es_GT/salaries.lang create mode 100644 htdocs/langs/es_GT/users.lang create mode 100644 htdocs/langs/es_GT/website.lang create mode 100644 htdocs/langs/es_HN/salaries.lang create mode 100644 htdocs/langs/es_HN/users.lang create mode 100644 htdocs/langs/es_HN/website.lang create mode 100644 htdocs/langs/es_PA/salaries.lang create mode 100644 htdocs/langs/es_PA/users.lang create mode 100644 htdocs/langs/es_PA/website.lang create mode 100644 htdocs/langs/es_PY/salaries.lang create mode 100644 htdocs/langs/es_PY/users.lang create mode 100644 htdocs/langs/es_PY/website.lang create mode 100644 htdocs/langs/es_US/salaries.lang create mode 100644 htdocs/langs/es_US/users.lang create mode 100644 htdocs/langs/es_US/website.lang create mode 100644 htdocs/langs/es_UY/salaries.lang create mode 100644 htdocs/langs/es_UY/users.lang create mode 100644 htdocs/langs/es_UY/website.lang create mode 100644 htdocs/langs/es_VE/users.lang create mode 100644 htdocs/langs/es_VE/website.lang create mode 100644 htdocs/langs/fr_BE/salaries.lang create mode 100644 htdocs/langs/fr_BE/users.lang create mode 100644 htdocs/langs/fr_BE/website.lang create mode 100644 htdocs/langs/fr_CH/salaries.lang create mode 100644 htdocs/langs/fr_CH/users.lang create mode 100644 htdocs/langs/fr_CH/website.lang create mode 100644 htdocs/langs/fr_CI/salaries.lang create mode 100644 htdocs/langs/fr_CI/users.lang create mode 100644 htdocs/langs/fr_CI/website.lang create mode 100644 htdocs/langs/fr_CM/salaries.lang create mode 100644 htdocs/langs/fr_CM/users.lang create mode 100644 htdocs/langs/fr_CM/website.lang create mode 100644 htdocs/langs/fr_GA/salaries.lang create mode 100644 htdocs/langs/fr_GA/users.lang create mode 100644 htdocs/langs/fr_GA/website.lang create mode 100644 htdocs/langs/it_CH/salaries.lang create mode 100644 htdocs/langs/it_CH/users.lang create mode 100644 htdocs/langs/pt_AO/admin.lang create mode 100644 htdocs/langs/pt_AO/salaries.lang create mode 100644 htdocs/langs/pt_AO/website.lang create mode 100644 htdocs/langs/ru_UA/salaries.lang create mode 100644 htdocs/langs/ru_UA/users.lang create mode 100644 htdocs/langs/ru_UA/website.lang diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 9d5343c47c4..5e4cc3fc05e 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -45,10 +45,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; -if (!$user->rights->fournisseur->facture->lire) { - accessforbidden(); -} - // Load translation files required by the page $langs->loadLangs(array('products', 'bills', 'companies', 'projects')); @@ -214,6 +210,16 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +if ((empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) + || (empty($conf->supplier_invoice->enabled) && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD))) { + accessforbidden(); +} +if ((empty($user->rights->fournisseur->facture->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) + || (empty($user->rights->supplier_invoice->lire) && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD))) { + accessforbidden(); +} + + /* * Actions diff --git a/htdocs/fourn/paiement/list.php b/htdocs/fourn/paiement/list.php index 4da69cfc0c1..40d36e5e4f6 100644 --- a/htdocs/fourn/paiement/list.php +++ b/htdocs/fourn/paiement/list.php @@ -112,10 +112,12 @@ if ($user->socid) { // require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; // $object = new PaiementFourn($db); // restrictedArea($user, $object->element); -if ((empty($conf->fournisseur->enabled) && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_invoice->enabled)) { +if ((empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) + || (empty($conf->supplier_invoice->enabled) && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD))) { accessforbidden(); } -if (!$user->rights->fournisseur->facture->lire || !$user->rights->supplier_invoice->lire) { +if ((empty($user->rights->fournisseur->facture->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) + || (empty($user->rights->supplier_invoice->lire) && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD))) { accessforbidden(); } diff --git a/htdocs/langs/am_ET/deliveries.lang b/htdocs/langs/am_ET/deliveries.lang index 1f48c01de75..cd8a36e6c70 100644 --- a/htdocs/langs/am_ET/deliveries.lang +++ b/htdocs/langs/am_ET/deliveries.lang @@ -27,5 +27,7 @@ Recipient=Recipient ErrorStockIsNotEnough=There's not enough stock Shippable=Shippable NonShippable=Not Shippable +ShowShippableStatus=Show shippable status ShowReceiving=Show delivery receipt NonExistentOrder=Nonexistent order +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/am_ET/exports.lang b/htdocs/langs/am_ET/exports.lang index a0eb7161ef2..cb652229825 100644 --- a/htdocs/langs/am_ET/exports.lang +++ b/htdocs/langs/am_ET/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Type of line (0=product, 1=service) FileWithDataToImport=File with data to import FileToImport=Source file to import FileMustHaveOneOfFollowingFormat=File to import must have one of following formats -DownloadEmptyExample=Download template file with field content information (* are mandatory fields) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Choose the file format to use as import file format by clicking on the %s icon to select it... ChooseFileToImport=Upload file then click on the %s icon to select file as source import file... SourceFileFormat=Source file format diff --git a/htdocs/langs/ar_EG/website.lang b/htdocs/langs/ar_EG/website.lang index 4f2ff392475..5bc16ab4864 100644 --- a/htdocs/langs/ar_EG/website.lang +++ b/htdocs/langs/ar_EG/website.lang @@ -9,3 +9,4 @@ WEBSITE_ALIASALT=أسماء الصفحات / الأسماء المستعارة WEBSITE_ALIASALTDesc=استخدم هنا قائمة بأسماء / أسماء مستعارة أخرى بحيث يمكن الوصول إلى الصفحة أيضًا باستخدام هذه الأسماء / الأسماء المستعارة الأخرى (على سبيل المثال ، الاسم القديم بعد إعادة تسمية الاسم المستعار للحفاظ على الرابط الخلفي في عمل الرابط / الاسم القديم). النحو هو:
    Alternativename1 ، و Alternativename2 ، ... WEBSITE_CSS_URL=عنوان URL لملف CSS الخارجي WEBSITE_CSS_INLINE=محتوى ملف CSS (مشترك لجميع الصفحات) +PreviewOfSiteNotYetAvailable=Preview of your website %s not yet available. You must first 'Import a full website template' or just 'Add a page/container'. diff --git a/htdocs/langs/ar_IQ/deliveries.lang b/htdocs/langs/ar_IQ/deliveries.lang index fdfd6404a8a..cd8a36e6c70 100644 --- a/htdocs/langs/ar_IQ/deliveries.lang +++ b/htdocs/langs/ar_IQ/deliveries.lang @@ -30,3 +30,4 @@ NonShippable=Not Shippable ShowShippableStatus=Show shippable status ShowReceiving=Show delivery receipt NonExistentOrder=Nonexistent order +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/ar_IQ/exports.lang b/htdocs/langs/ar_IQ/exports.lang index a0eb7161ef2..cb652229825 100644 --- a/htdocs/langs/ar_IQ/exports.lang +++ b/htdocs/langs/ar_IQ/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Type of line (0=product, 1=service) FileWithDataToImport=File with data to import FileToImport=Source file to import FileMustHaveOneOfFollowingFormat=File to import must have one of following formats -DownloadEmptyExample=Download template file with field content information (* are mandatory fields) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Choose the file format to use as import file format by clicking on the %s icon to select it... ChooseFileToImport=Upload file then click on the %s icon to select file as source import file... SourceFileFormat=Source file format diff --git a/htdocs/langs/ar_SA/exports.lang b/htdocs/langs/ar_SA/exports.lang index 53ce1753324..41308469daa 100644 --- a/htdocs/langs/ar_SA/exports.lang +++ b/htdocs/langs/ar_SA/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Type of line (0=product, 1=نوع الخط (0= منت FileWithDataToImport=ملف استيراد البيانات FileToImport=مصدر لاستيراد ملف FileMustHaveOneOfFollowingFormat=File to import must have one of following formats -DownloadEmptyExample=Download template file with field content information (* are mandatory fields) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Choose the file format to use as import file format by clicking on the %s icon to select it... ChooseFileToImport=Upload file then click on the %s icon to select file as source import file... SourceFileFormat=مصدر تنسيق ملف diff --git a/htdocs/langs/az_AZ/deliveries.lang b/htdocs/langs/az_AZ/deliveries.lang index 1f48c01de75..cd8a36e6c70 100644 --- a/htdocs/langs/az_AZ/deliveries.lang +++ b/htdocs/langs/az_AZ/deliveries.lang @@ -27,5 +27,7 @@ Recipient=Recipient ErrorStockIsNotEnough=There's not enough stock Shippable=Shippable NonShippable=Not Shippable +ShowShippableStatus=Show shippable status ShowReceiving=Show delivery receipt NonExistentOrder=Nonexistent order +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/az_AZ/exports.lang b/htdocs/langs/az_AZ/exports.lang index a0eb7161ef2..cb652229825 100644 --- a/htdocs/langs/az_AZ/exports.lang +++ b/htdocs/langs/az_AZ/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Type of line (0=product, 1=service) FileWithDataToImport=File with data to import FileToImport=Source file to import FileMustHaveOneOfFollowingFormat=File to import must have one of following formats -DownloadEmptyExample=Download template file with field content information (* are mandatory fields) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Choose the file format to use as import file format by clicking on the %s icon to select it... ChooseFileToImport=Upload file then click on the %s icon to select file as source import file... SourceFileFormat=Source file format diff --git a/htdocs/langs/bg_BG/deliveries.lang b/htdocs/langs/bg_BG/deliveries.lang index b3ce159a9d2..f6ad8076ae9 100644 --- a/htdocs/langs/bg_BG/deliveries.lang +++ b/htdocs/langs/bg_BG/deliveries.lang @@ -27,5 +27,7 @@ Recipient=Получател ErrorStockIsNotEnough=Няма достатъчна наличност Shippable=Годно за изпращане NonShippable=Негодно за изпращане +ShowShippableStatus=Show shippable status ShowReceiving=Показване на разписка за доставка NonExistentOrder=Несъществуваща поръчка +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/bg_BG/exports.lang b/htdocs/langs/bg_BG/exports.lang index f371671587f..8abaa3d6bf5 100644 --- a/htdocs/langs/bg_BG/exports.lang +++ b/htdocs/langs/bg_BG/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Тип ред (0 = продукт, 1 = услуга) FileWithDataToImport=Файл с данни за импортиране FileToImport=Входен файл за импортиране FileMustHaveOneOfFollowingFormat=Файлът за импортиране трябва да бъде в един от следните формати -DownloadEmptyExample=Изтегляне на шаблонния файл с информация за съдържанието на полето (* са задължителни полета) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Изберете формата на файла, който да използвате като формат за импортиране, като кликнете върху иконата на %s, за да го изберете... ChooseFileToImport=Прикачете файл, след това кликнете върху иконата %s, за да изберете файла като източник при импортиране... SourceFileFormat=Формат на входния файл diff --git a/htdocs/langs/bn_BD/deliveries.lang b/htdocs/langs/bn_BD/deliveries.lang index 1f48c01de75..cd8a36e6c70 100644 --- a/htdocs/langs/bn_BD/deliveries.lang +++ b/htdocs/langs/bn_BD/deliveries.lang @@ -27,5 +27,7 @@ Recipient=Recipient ErrorStockIsNotEnough=There's not enough stock Shippable=Shippable NonShippable=Not Shippable +ShowShippableStatus=Show shippable status ShowReceiving=Show delivery receipt NonExistentOrder=Nonexistent order +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/bn_BD/exports.lang b/htdocs/langs/bn_BD/exports.lang index a0eb7161ef2..cb652229825 100644 --- a/htdocs/langs/bn_BD/exports.lang +++ b/htdocs/langs/bn_BD/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Type of line (0=product, 1=service) FileWithDataToImport=File with data to import FileToImport=Source file to import FileMustHaveOneOfFollowingFormat=File to import must have one of following formats -DownloadEmptyExample=Download template file with field content information (* are mandatory fields) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Choose the file format to use as import file format by clicking on the %s icon to select it... ChooseFileToImport=Upload file then click on the %s icon to select file as source import file... SourceFileFormat=Source file format diff --git a/htdocs/langs/bn_IN/deliveries.lang b/htdocs/langs/bn_IN/deliveries.lang index 1f48c01de75..cd8a36e6c70 100644 --- a/htdocs/langs/bn_IN/deliveries.lang +++ b/htdocs/langs/bn_IN/deliveries.lang @@ -27,5 +27,7 @@ Recipient=Recipient ErrorStockIsNotEnough=There's not enough stock Shippable=Shippable NonShippable=Not Shippable +ShowShippableStatus=Show shippable status ShowReceiving=Show delivery receipt NonExistentOrder=Nonexistent order +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/bn_IN/exports.lang b/htdocs/langs/bn_IN/exports.lang index a0eb7161ef2..cb652229825 100644 --- a/htdocs/langs/bn_IN/exports.lang +++ b/htdocs/langs/bn_IN/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Type of line (0=product, 1=service) FileWithDataToImport=File with data to import FileToImport=Source file to import FileMustHaveOneOfFollowingFormat=File to import must have one of following formats -DownloadEmptyExample=Download template file with field content information (* are mandatory fields) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Choose the file format to use as import file format by clicking on the %s icon to select it... ChooseFileToImport=Upload file then click on the %s icon to select file as source import file... SourceFileFormat=Source file format diff --git a/htdocs/langs/bs_BA/deliveries.lang b/htdocs/langs/bs_BA/deliveries.lang index 1d1cc2fba9b..4ccb70f6a24 100644 --- a/htdocs/langs/bs_BA/deliveries.lang +++ b/htdocs/langs/bs_BA/deliveries.lang @@ -27,5 +27,7 @@ Recipient=Primalac ErrorStockIsNotEnough=There's not enough stock Shippable=Shippable NonShippable=Not Shippable +ShowShippableStatus=Show shippable status ShowReceiving=Show delivery receipt NonExistentOrder=Nonexistent order +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/bs_BA/exports.lang b/htdocs/langs/bs_BA/exports.lang index 30e7e97e5a5..c030d48d370 100644 --- a/htdocs/langs/bs_BA/exports.lang +++ b/htdocs/langs/bs_BA/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Type of line (0=product, 1=service) FileWithDataToImport=File with data to import FileToImport=Source file to import FileMustHaveOneOfFollowingFormat=File to import must have one of following formats -DownloadEmptyExample=Download template file with field content information (* are mandatory fields) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Choose the file format to use as import file format by clicking on the %s icon to select it... ChooseFileToImport=Upload file then click on the %s icon to select file as source import file... SourceFileFormat=Source file format diff --git a/htdocs/langs/ca_ES/deliveries.lang b/htdocs/langs/ca_ES/deliveries.lang index f1dd899fea4..b6d8fbf55f8 100644 --- a/htdocs/langs/ca_ES/deliveries.lang +++ b/htdocs/langs/ca_ES/deliveries.lang @@ -27,5 +27,7 @@ Recipient=Destinatari ErrorStockIsNotEnough=No hi ha estoc suficient Shippable=Es pot enviar NonShippable=No es pot enviar +ShowShippableStatus=Mostra l'estat d'enviament ShowReceiving=Mostra el rebut d'entrega NonExistentOrder=Comanda inexistent +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/ca_ES/exports.lang b/htdocs/langs/ca_ES/exports.lang index f66769a30f7..f0ebbe4d451 100644 --- a/htdocs/langs/ca_ES/exports.lang +++ b/htdocs/langs/ca_ES/exports.lang @@ -33,7 +33,7 @@ FormatedImport=Assistent d'importació FormatedImportDesc1=Aquest mòdul us permet actualitzar les dades existents o afegir nous objectes a la base de dades d'un fitxer sense coneixements tècnics, utilitzant un assistent. FormatedImportDesc2=El primer pas és triar el tipus de dades que voleu importar, a continuació, el format del fitxer font, a continuació, els camps que voleu importar. FormatedExport=Assistent d'exportació -FormatedExportDesc1=Aquestes eines permeten l'exportació de dades personalitzades mitjançant un assistent, per ajudar-vos en el procés sense necessitat de coneixements tècnics. +FormatedExportDesc1=Aquestes eines permeten exportar dades personalitzades mitjançant un assistent per a ajudar-vos en el procés sense necessitat de coneixements tècnics. FormatedExportDesc2=El primer pas és triar un conjunt de dades predefinit, després els camps que voleu exportar i en quin ordre. FormatedExportDesc3=Quan se seleccionen les dades per a exportar, podeu triar el format del fitxer de sortida. Sheet=Fulla @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Tipus de línia (0=producte, 1=servei) FileWithDataToImport=Arxiu que conté les dades a importar FileToImport=Arxiu origen a importar FileMustHaveOneOfFollowingFormat=El fitxer a importar ha de tenir un dels següents formats -DownloadEmptyExample=Baixeu un fitxer de plantilla amb informació de contingut de camp (* són camps obligatoris) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Trieu el format del fitxer que voleu utilitzar com a format de fitxer d'importació fent clic a la icona %s per seleccionar-lo ... ChooseFileToImport=Pengeu un fitxer i feu clic a la icona %s per seleccionar el fitxer com a fitxer d'importació d'origen ... SourceFileFormat=Format de l'arxiu origen @@ -80,7 +81,7 @@ SelectAtLeastOneField=Bascular com a mínim un camp origen a la columna de camps SelectFormat=Seleccioneu aquest format de fitxer d'importació RunImportFile=Importa dades NowClickToRunTheImport=Comproveu els resultats de la simulació d'importació. Corregiu els errors i torneu a provar.
    Quan la simulació no informa d'errors, pot procedir a importar les dades a la base de dades. -DataLoadedWithId=Les dades importades tindran un camp addicional a cada taula de base de dades amb aquest identificador d'importació: %s , per permetre que es pugui cercar en el cas d'investigar un problema relacionat amb aquesta importació. +DataLoadedWithId=Les dades importades tindran un camp addicional a cada taula de base de dades amb aquest identificador d'importació: %s , per a permetre que es pugui cercar en el cas d'investigar un problema relacionat amb aquesta importació. ErrorMissingMandatoryValue=Les dades obligatòries estan buides al fitxer de codi font %s . TooMuchErrors=Encara hi ha 0xaek83365837f %s
    altres línies d'origen amb errors, però la producció ha estat limitada. TooMuchWarnings=Encara hi ha %s altres línies d'origen amb advertències, però la producció ha estat limitada. diff --git a/htdocs/langs/cs_CZ/deliveries.lang b/htdocs/langs/cs_CZ/deliveries.lang index e38b668da7f..5941d685f1b 100644 --- a/htdocs/langs/cs_CZ/deliveries.lang +++ b/htdocs/langs/cs_CZ/deliveries.lang @@ -27,5 +27,7 @@ Recipient=Příjemce ErrorStockIsNotEnough=Dostatečné množství není skladem Shippable=Doručitelné NonShippable=Nedoručitelné +ShowShippableStatus=Show shippable status ShowReceiving=Zobrazit potvrzení o doručení NonExistentOrder=Neexistující objednávka +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/cs_CZ/exports.lang b/htdocs/langs/cs_CZ/exports.lang index 34c0d9b41d6..f185c884609 100644 --- a/htdocs/langs/cs_CZ/exports.lang +++ b/htdocs/langs/cs_CZ/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Použitý typ řádku (0 = produkt, 1 = služba) FileWithDataToImport=Soubor s daty pro import FileToImport=Zdrojový soubor k importu FileMustHaveOneOfFollowingFormat=Importovaný soubor musí mít jeden z následujících formátů -DownloadEmptyExample=Stáhnout soubor šablony s informacemi o obsahu pole (* jsou povinná pole) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Vyberte formát souboru, který chcete použít jako formát souboru importu klepnutím na ikonu %s pro jeho výběr ... ChooseFileToImport=Pro nahrání souboru klepněte na ikonku %s pro výběr souboru jako zdrojový soubor importu ... SourceFileFormat=Zdrojový soubor diff --git a/htdocs/langs/da_DK/accountancy.lang b/htdocs/langs/da_DK/accountancy.lang index 374c373fffe..4153f9133a9 100644 --- a/htdocs/langs/da_DK/accountancy.lang +++ b/htdocs/langs/da_DK/accountancy.lang @@ -48,7 +48,8 @@ CountriesNotInEEC=Lande ikke i EU CountriesInEECExceptMe=Lande i EU undtagen %s CountriesExceptMe=Alle lande undtagen %s AccountantFiles=Eksporter kildedokumenter -ExportAccountingSourceDocHelp=Med dette værktøj kan du eksportere de kildehændelser (liste og PDF-filer), der blev brugt til at generere din regnskab. For at eksportere dine tidsskrifter skal du bruge menuindgangen %s - %s. +ExportAccountingSourceDocHelp=Med dette værktøj kan du eksportere de kildehændelser (liste i CSV og PDF-filer), der blev brugt til at generere din regnskab. +ExportAccountingSourceDocHelp2=For at eksportere dine tidsskrifter skal du bruge menuindgangen %s - %s. VueByAccountAccounting=Vis efter regnskabskonto VueBySubAccountAccounting=Vis efter regnskabsmæssig underkonto diff --git a/htdocs/langs/da_DK/admin.lang b/htdocs/langs/da_DK/admin.lang index 060f9b2a504..25c27871bd5 100644 --- a/htdocs/langs/da_DK/admin.lang +++ b/htdocs/langs/da_DK/admin.lang @@ -2144,3 +2144,4 @@ YouEnableDeprecatedWSAPIsUseRESTAPIsInstead=Du aktiverede forældet WS API. Du s RandomlySelectedIfSeveral=Valgt tilfældigt, hvis der er flere billeder tilgængelige DatabasePasswordObfuscated=Databaseadgangskode er tilsløret i conf-fil DatabasePasswordNotObfuscated=Databaseadgangskode er IKKE tilsløret i conf-fil +APIsAreNotEnabled=API-moduler er ikke aktiveret diff --git a/htdocs/langs/da_DK/deliveries.lang b/htdocs/langs/da_DK/deliveries.lang index d4ea903643c..f5bb5bc9ae1 100644 --- a/htdocs/langs/da_DK/deliveries.lang +++ b/htdocs/langs/da_DK/deliveries.lang @@ -27,5 +27,7 @@ Recipient=Modtager ErrorStockIsNotEnough=Der er ikke nok lager Shippable=Fragtvarer NonShippable=Kan ikke sendes +ShowShippableStatus=Vis status, der kan sendes ShowReceiving=Vis leverings kvittering NonExistentOrder=ikke-eksisterende ordre +StockQuantitiesAlreadyAllocatedOnPreviousLines = Lagermængder, der allerede er tildelt på tidligere linjer diff --git a/htdocs/langs/da_DK/exports.lang b/htdocs/langs/da_DK/exports.lang index 3b1b4072def..374aad967a5 100644 --- a/htdocs/langs/da_DK/exports.lang +++ b/htdocs/langs/da_DK/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Strækningstype (0= produkt, 1= tjeneste) FileWithDataToImport=Fil med data til at importere FileToImport=Kildefilen til at importere FileMustHaveOneOfFollowingFormat=Fil, der skal importeres, skal have et af følgende formater -DownloadEmptyExample=Download skabelonfil med feltindholdsinformation (* er obligatoriske felter) +DownloadEmptyExample=Download skabelonfil med feltindholdsoplysninger +StarAreMandatory=* er obligatoriske felter ChooseFormatOfFileToImport=Vælg det filformat, der skal bruges som importfilformat, ved at klikke på ikonet %s for at vælge det ... ChooseFileToImport=Upload fil og klik derefter på ikonet %s for at vælge fil som kilde importfil ... SourceFileFormat=Kilde filformat diff --git a/htdocs/langs/da_DK/knowledgemanagement.lang b/htdocs/langs/da_DK/knowledgemanagement.lang index fbd9de8b1ee..b3035583a95 100644 --- a/htdocs/langs/da_DK/knowledgemanagement.lang +++ b/htdocs/langs/da_DK/knowledgemanagement.lang @@ -37,15 +37,7 @@ About = Om KnowledgeManagementAbout = Om Knowledge Management KnowledgeManagementAboutPage = Videnstyring om side -# -# Sample page -# KnowledgeManagementArea = Videnshåndtering - - -# -# Menu -# MenuKnowledgeRecord = Videnbase ListKnowledgeRecord = Liste over artikler NewKnowledgeRecord = Ny artikel @@ -53,3 +45,5 @@ ValidateReply = Valider løsning KnowledgeRecords = Artikler KnowledgeRecord = Artikel KnowledgeRecordExtraFields = Ekstra felter til artikel +GroupOfTicket=Gruppe af billetter +YouCanLinkArticleToATicketCategory=Du kan linke en artikel til en billetgruppe (så artiklen vil blive foreslået under kvalificeringen af nye billetter) diff --git a/htdocs/langs/da_DK/languages.lang b/htdocs/langs/da_DK/languages.lang index bf7456b4cfd..1ca08b5f366 100644 --- a/htdocs/langs/da_DK/languages.lang +++ b/htdocs/langs/da_DK/languages.lang @@ -4,6 +4,7 @@ Language_ar_AR=Arabisk Language_ar_EG=Arabisk (Egypten) Language_ar_SA=Arabisk Language_ar_TN=Arabisk (Tunesien) +Language_ar_IQ=Arabisk (Irak) Language_az_AZ=Aserbajdsjansk Language_bn_BD=Bengali Language_bn_IN=Bengali (Indien) @@ -83,6 +84,7 @@ Language_ne_NP=nepalesisk Language_nl_BE=Hollandsk (Belgien) Language_nl_NL=Hollandske Language_pl_PL=Polsk +Language_pt_AO=Portugisisk (Angola) Language_pt_BR=Portugisisk (Brasilien) Language_pt_PT=Portugisisk Language_ro_MD=Rumænsk (Moldavien) diff --git a/htdocs/langs/da_DK/products.lang b/htdocs/langs/da_DK/products.lang index 0daacebcd03..8c90dd9aa44 100644 --- a/htdocs/langs/da_DK/products.lang +++ b/htdocs/langs/da_DK/products.lang @@ -277,7 +277,7 @@ PriceByCustomer=Forskellige priser for hver kunde PriceCatalogue=En enkelt salgspris pr. Produkt / service PricingRule=Regler for salgspriser AddCustomerPrice=Tilføj pris ved kunde -ForceUpdateChildPriceSoc=Indstil samme pris på kundernes datterselskaber +ForceUpdateChildPriceSoc=Angiv samme pris på kundens datterselskaber PriceByCustomerLog=Log af tidligere kundepriser MinimumPriceLimit=Minimumsprisen kan ikke være lavere end %s MinimumRecommendedPrice=Minimum anbefalet pris er: %s @@ -296,6 +296,7 @@ ComposedProductIncDecStock=Forøg / sænk lagerbeholdning ved forældreændring ComposedProduct=Børneprodukter MinSupplierPrice=Min købskurs MinCustomerPrice=Mindste salgspris +NoDynamicPrice=Ingen dynamisk pris DynamicPriceConfiguration=Dynamisk priskonfiguration DynamicPriceDesc=Du kan definere matematiske formler til beregning af kunde- eller leverandørpriser. Sådanne formler kan bruge alle matematiske operatorer, nogle konstanter og variabler. Du kan her definere de variabler, du vil bruge. Hvis variablen har brug for en automatisk opdatering, kan du definere den eksterne URL, så Dolibarr kan opdatere værdien automatisk. AddVariable=Tilføj variabel diff --git a/htdocs/langs/da_DK/stocks.lang b/htdocs/langs/da_DK/stocks.lang index 5cfede398e2..05a8fbbf978 100644 --- a/htdocs/langs/da_DK/stocks.lang +++ b/htdocs/langs/da_DK/stocks.lang @@ -60,7 +60,7 @@ EnhancedValueOfWarehouses=Lager værdi UserWarehouseAutoCreate=Opret et brugerlager automatisk, når du opretter en bruger AllowAddLimitStockByWarehouse=Administrer også værdi for minimum og ønsket lager pr. Parring (produktlager) ud over værdien for minimum og ønsket lager pr. Produkt RuleForWarehouse=Regel for lagre -WarehouseAskWarehouseOnThirparty=Indstil et lager på tredjepart +WarehouseAskWarehouseOnThirparty=Indstil et lager på tredjeparter WarehouseAskWarehouseDuringPropal=Sæt et lager på kommercielle forslag WarehouseAskWarehouseDuringOrder=Indstil et lager med salgsordrer UserDefaultWarehouse=Indstil et lager til brugere @@ -167,8 +167,8 @@ MovementTransferStock=Lageroverførsel af produkt %s til et andet lager InventoryCodeShort=Inv./Mov. kode NoPendingReceptionOnSupplierOrder=Ingen afventende modtagelse på grund af åben indkøbsordre ThisSerialAlreadyExistWithDifferentDate=Dette parti / serienummer ( %s ) eksisterer allerede, men med forskellige eatby eller sellby dato (fundet %s men du skrev %s ) -OpenAll=Åbn for alle handlinger -OpenInternal=Åben kun for interne handlinger +OpenAnyMovement=Åben (alle bevægelser) +OpenInternal=Åben (kun intern bevægelse) UseDispatchStatus=Brug en forsendelsesstatus (godkend / afvis) til produktlinjer ved modtagelse af indkøbsordrer OptionMULTIPRICESIsOn=Mulighed for "flere priser pr. Segment" er på. Det betyder, at et produkt har flere salgspriser, så værdien til salg ikke kan beregnes ProductStockWarehouseCreated=Lagergrænse for alarm og ønsket optimal lager korrekt oprettet diff --git a/htdocs/langs/da_DK/ticket.lang b/htdocs/langs/da_DK/ticket.lang index d668d4dabb9..ef63445750d 100644 --- a/htdocs/langs/da_DK/ticket.lang +++ b/htdocs/langs/da_DK/ticket.lang @@ -34,7 +34,8 @@ TicketDictResolution=Opgave - Afsluttet TicketTypeShortCOM=Kommercielt spørgsmål TicketTypeShortHELP=Anmodning om hjælp -TicketTypeShortISSUE=Problem, fejl eller problemer +TicketTypeShortISSUE=Problem eller fejl +TicketTypeShortPROBLEM=Problem TicketTypeShortREQUEST=Skift eller anmodning om forbedring TicketTypeShortPROJET=Projekt TicketTypeShortOTHER=Andre @@ -54,14 +55,15 @@ TypeContact_ticket_internal_SUPPORTTEC=Tildelt bruger TypeContact_ticket_external_SUPPORTCLI=Kundekontakt / hændelsesporing TypeContact_ticket_external_CONTRIBUTOR=Ekstern bidragyder -OriginEmail=Email kilde +OriginEmail=E-mail reporter Notify_TICKET_SENTBYMAIL=Send opgaver besked via Email # Status Read=Læs Assigned=Tildelt InProgress=I gang -NeedMoreInformation=Venter på information +NeedMoreInformation=Venter på reporterfeedback +NeedMoreInformationShort=Venter på feedback Answered=Besvaret Waiting=Venter Closed=Lukket @@ -160,7 +162,7 @@ CreatedBy=Lavet af NewTicket=Ny opgave SubjectAnswerToTicket=Opgave svar TicketTypeRequest=Anmodningstype -TicketCategory=Gruppe +TicketCategory=Billetkategorisering SeeTicket=Se opgave TicketMarkedAsRead=Opgaven er blevet markeret som læst TicketReadOn=Læs videre @@ -211,6 +213,7 @@ TicketMessageHelp=Kun denne tekst gemmes i meddelelseslisten på billetkort. TicketMessageSubstitutionReplacedByGenericValues=Substitutionsvariabler erstattes af generiske værdier. TimeElapsedSince=Tid forløbet siden TicketTimeToRead=Tid forløbet før læst +TicketTimeElapsedBeforeSince=Forløbet tid før / siden TicketContacts=Kontakter billet TicketDocumentsLinked=Dokumenter knyttet til opgaven ConfirmReOpenTicket=Bekræft genåbne denne opgave? diff --git a/htdocs/langs/de_AT/admin.lang b/htdocs/langs/de_AT/admin.lang index 34368689cf1..084f4086695 100644 --- a/htdocs/langs/de_AT/admin.lang +++ b/htdocs/langs/de_AT/admin.lang @@ -148,6 +148,7 @@ LDAPSynchronization=LDAP Synchronisierung LDAPFunctionsNotAvailableOnPHP=LDAP Funktionen nicht verfügbar in Deinem PHP LDAPFieldFullname=vollständiger Name ClickToDialSetup=Click-to-Dial-Moduleinstellungen +ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or a software interface installed on the same computer as the browser, and called when you click on a link in your browser that starts with "tel:". If you need a full server solution (no need of local software installation), you must set this to "No" and fill next field. MailToSendShipment=Sendungen MailToSendIntervention=Eingriffe OperationParamDesc=Define the values to use for the object of the action, or how to extract values. For example:
    objproperty1=SET:the value to set
    objproperty2=SET:a value with replacement of __objproperty1__
    objproperty3=SETIFEMPTY:value used if objproperty3 is not already defined
    objproperty4=EXTRACT:HEADER:X-Myheaderkey:\\s*([^\\s]*)
    options_myextrafield1=EXTRACT:SUBJECT:([^\n]*)
    object.objproperty5=EXTRACT:BODY:My company name is\\s([^\\s]*)

    Use a ; char as separator to extract or set several properties. diff --git a/htdocs/langs/de_AT/salaries.lang b/htdocs/langs/de_AT/salaries.lang new file mode 100644 index 00000000000..c9bd3bec17b --- /dev/null +++ b/htdocs/langs/de_AT/salaries.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - salaries +LastSalaries=Latest %s salary payments +AllSalaries=All salary payments diff --git a/htdocs/langs/de_AT/users.lang b/htdocs/langs/de_AT/users.lang index 271a945e1f3..80a15bddaf3 100644 --- a/htdocs/langs/de_AT/users.lang +++ b/htdocs/langs/de_AT/users.lang @@ -5,3 +5,5 @@ PasswordChangedAndSentTo=Passwort geändert und an %s gesandt. PasswordChangeRequestSent=Antrag auf eine Änderung das Passworts für %s an %s gesandt. LinkedToDolibarrUser=Mit Systembenutzer verknüpfen LinkedToDolibarrThirdParty=Mit Partner verknüpfen +NbOfUsers=No. of users +NbOfPermissions=No. of permissions diff --git a/htdocs/langs/de_AT/website.lang b/htdocs/langs/de_AT/website.lang new file mode 100644 index 00000000000..910cff6b702 --- /dev/null +++ b/htdocs/langs/de_AT/website.lang @@ -0,0 +1,2 @@ +# Dolibarr language file - Source file is en_US - website +PreviewOfSiteNotYetAvailable=Preview of your website %s not yet available. You must first 'Import a full website template' or just 'Add a page/container'. diff --git a/htdocs/langs/de_CH/website.lang b/htdocs/langs/de_CH/website.lang index 8504c7c5535..687f5a43d7d 100644 --- a/htdocs/langs/de_CH/website.lang +++ b/htdocs/langs/de_CH/website.lang @@ -5,6 +5,7 @@ WEBSITE_TYPE_CONTAINER=Seiten - / Containertyp WEBSITE_PAGE_EXAMPLE=Webseite als Vorlage benutzen WEBSITE_ALIASALT=Zusätzliche Seitennamen / Aliase WEBSITE_CSS_URL=URL zu externer CSS Datei +PreviewOfSiteNotYetAvailable=Preview of your website %s not yet available. You must first 'Import a full website template' or just 'Add a page/container'. ViewSiteInNewTab=Webauftritt in neuem Tab anzeigen SetAsHomePage=Als Startseite definieren WebsiteAccounts=Webseitenkonten diff --git a/htdocs/langs/de_DE/deliveries.lang b/htdocs/langs/de_DE/deliveries.lang index c3c906b07e4..e2b3395ea88 100644 --- a/htdocs/langs/de_DE/deliveries.lang +++ b/htdocs/langs/de_DE/deliveries.lang @@ -30,3 +30,4 @@ NonShippable=Nicht versandfertig ShowShippableStatus=Versandstatus anzeigen ShowReceiving=Zustellbestätigung anzeigen NonExistentOrder=Auftrag existiert nicht +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/de_DE/exports.lang b/htdocs/langs/de_DE/exports.lang index 911f2646c68..4afed3a9e25 100644 --- a/htdocs/langs/de_DE/exports.lang +++ b/htdocs/langs/de_DE/exports.lang @@ -30,10 +30,10 @@ ExportCsvSeparator=CSV-Trennzeichen ImportCsvSeparator=CSV-Trennzeichen Step=Schritt FormatedImport=Import-Assistent -FormatedImportDesc1=Mit diesem Modul können Sie vorhandene Daten aktualisieren oder mithilfe eines Assistenten neue Objekte aus einer Datei in die Datenbank einfügen, ohne über technische Kenntnisse zu verfügen. +FormatedImportDesc1=Dieses Modul ermöglicht den Import personalisierter Daten mithilfe eines Assistenten.\nTechnische Kenntnisse sind hierbei nicht erforderlich. FormatedImportDesc2=Zunächst müssen Sie die Art der zu importierenden Daten, dann das Format der Quelldatei und dann die zu importierenden Felder auswählen. FormatedExport=Export-Assistent -FormatedExportDesc1=Diese Tools ermöglichen den Export personalisierter Daten mithilfe eines Assistenten, um Sie dabei zu unterstützen, ohne dass technische Kenntnisse erforderlich sind. +FormatedExportDesc1=Dieses Modul ermöglicht den Export personalisierter Daten mithilfe eines Assistenten.\nTechnische Kenntnisse sind hierbei nicht erforderlich. FormatedExportDesc2=Der erste Schritt besteht darin, einen vordefinierten Datensatz auszuwählen und dann anzugeben, welche Felder in welcher Reihenfolge exportiert werden sollen. FormatedExportDesc3=Wenn zu exportierende Daten ausgewählt sind, können Sie das Format der Ausgabedatei auswählen. Sheet=Blatt @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Art der Zeile (0=Produkt, 1=Leistung) FileWithDataToImport=Datei mit zu importierenden Daten FileToImport=Quelldatei für Import FileMustHaveOneOfFollowingFormat=Die zu importierende Datei muss eines der folgenden Formate haben -DownloadEmptyExample=Vorlagendatei mit Feldinhaltsinformationen herunterladen (* sind Pflichtfelder) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Wählen Sie das Dateiformat aus, das als Importdateiformat verwendet werden soll, indem Sie auf das Symbol %s klicken, um es auszuwählen ... ChooseFileToImport=Datei hochladen und dann auf das Symbol %s klicken, um die Datei als Quell-Importdatei auszuwählen ... SourceFileFormat=Quelldateiformat diff --git a/htdocs/langs/el_CY/admin.lang b/htdocs/langs/el_CY/admin.lang index 74ee870f906..e2d4c78a52e 100644 --- a/htdocs/langs/el_CY/admin.lang +++ b/htdocs/langs/el_CY/admin.lang @@ -1,2 +1,3 @@ # Dolibarr language file - Source file is en_US - admin +ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or a software interface installed on the same computer as the browser, and called when you click on a link in your browser that starts with "tel:". If you need a full server solution (no need of local software installation), you must set this to "No" and fill next field. EmailCollectorLoadThirdPartyHelp=You can use this action to use the email content to find and load an existing thirdparty in your database. The found (or created) thirdparty will be used for following actions that need it. In the parameter field you can use for example 'EXTRACT:BODY:Name:\\s([^\\s]*)' if you want to extract the name of the thirdparty from a string 'Name: name to find' found into the body. diff --git a/htdocs/langs/el_CY/users.lang b/htdocs/langs/el_CY/users.lang new file mode 100644 index 00000000000..4a412122b08 --- /dev/null +++ b/htdocs/langs/el_CY/users.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - users +NbOfUsers=No. of users +NbOfPermissions=No. of permissions diff --git a/htdocs/langs/el_CY/website.lang b/htdocs/langs/el_CY/website.lang new file mode 100644 index 00000000000..910cff6b702 --- /dev/null +++ b/htdocs/langs/el_CY/website.lang @@ -0,0 +1,2 @@ +# Dolibarr language file - Source file is en_US - website +PreviewOfSiteNotYetAvailable=Preview of your website %s not yet available. You must first 'Import a full website template' or just 'Add a page/container'. diff --git a/htdocs/langs/el_GR/deliveries.lang b/htdocs/langs/el_GR/deliveries.lang index cdb0fc9be46..5ec67327cf4 100644 --- a/htdocs/langs/el_GR/deliveries.lang +++ b/htdocs/langs/el_GR/deliveries.lang @@ -27,5 +27,7 @@ Recipient=Παραλήπτης ErrorStockIsNotEnough=Δεν υπάρχει αρκετό απόθεμα Shippable=Για Αποστολή NonShippable=Δεν αποστέλλονται +ShowShippableStatus=Show shippable status ShowReceiving=Show delivery receipt NonExistentOrder=Ανύπαρκτη σειρά +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/el_GR/exports.lang b/htdocs/langs/el_GR/exports.lang index 28459f2238d..d61a2aa3779 100644 --- a/htdocs/langs/el_GR/exports.lang +++ b/htdocs/langs/el_GR/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Type of line (0=product, 1=service) FileWithDataToImport=File with data to import FileToImport=Source file to import FileMustHaveOneOfFollowingFormat=Το αρχείο για εισαγωγή πρέπει να έχει μία από τις ακόλουθες μορφές -DownloadEmptyExample=Λήψη αρχείου προτύπου με πληροφορίες περιεχομένου πεδίου (* είναι υποχρεωτικά πεδία) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Επιλέξτε τη μορφή αρχείου που θα χρησιμοποιηθεί ως μορφή αρχείου εισαγωγής κάνοντας κλικ στο εικονίδιο %s για να το επιλέξετε ... ChooseFileToImport=Μεταφορτώστε το αρχείο και κάντε κλικ στο εικονίδιο %s για να επιλέξετε αρχείο ως αρχείο εισαγωγής πηγής ... SourceFileFormat=Source file format diff --git a/htdocs/langs/en_AU/admin.lang b/htdocs/langs/en_AU/admin.lang index 0980facb414..7cac2619318 100644 --- a/htdocs/langs/en_AU/admin.lang +++ b/htdocs/langs/en_AU/admin.lang @@ -3,6 +3,7 @@ OldVATRates=Old GST rate NewVATRates=New GST rate DictionaryVAT=GST Rates or Sales Tax Rates OptionVatMode=GST due +ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or a software interface installed on the same computer as the browser, and called when you click on a link in your browser that starts with "tel:". If you need a full server solution (no need of local software installation), you must set this to "No" and fill next field. LinkColor=Colour of links OperationParamDesc=Define the values to use for the object of the action, or how to extract values. For example:
    objproperty1=SET:the value to set
    objproperty2=SET:a value with replacement of __objproperty1__
    objproperty3=SETIFEMPTY:value used if objproperty3 is not already defined
    objproperty4=EXTRACT:HEADER:X-Myheaderkey:\\s*([^\\s]*)
    options_myextrafield1=EXTRACT:SUBJECT:([^\n]*)
    object.objproperty5=EXTRACT:BODY:My company name is\\s([^\\s]*)

    Use a ; char as separator to extract or set several properties. EmailCollectorLoadThirdPartyHelp=You can use this action to use the email content to find and load an existing thirdparty in your database. The found (or created) thirdparty will be used for following actions that need it. In the parameter field you can use for example 'EXTRACT:BODY:Name:\\s([^\\s]*)' if you want to extract the name of the thirdparty from a string 'Name: name to find' found into the body. diff --git a/htdocs/langs/en_AU/salaries.lang b/htdocs/langs/en_AU/salaries.lang new file mode 100644 index 00000000000..c9bd3bec17b --- /dev/null +++ b/htdocs/langs/en_AU/salaries.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - salaries +LastSalaries=Latest %s salary payments +AllSalaries=All salary payments diff --git a/htdocs/langs/en_AU/users.lang b/htdocs/langs/en_AU/users.lang new file mode 100644 index 00000000000..4a412122b08 --- /dev/null +++ b/htdocs/langs/en_AU/users.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - users +NbOfUsers=No. of users +NbOfPermissions=No. of permissions diff --git a/htdocs/langs/en_AU/website.lang b/htdocs/langs/en_AU/website.lang new file mode 100644 index 00000000000..910cff6b702 --- /dev/null +++ b/htdocs/langs/en_AU/website.lang @@ -0,0 +1,2 @@ +# Dolibarr language file - Source file is en_US - website +PreviewOfSiteNotYetAvailable=Preview of your website %s not yet available. You must first 'Import a full website template' or just 'Add a page/container'. diff --git a/htdocs/langs/en_CA/admin.lang b/htdocs/langs/en_CA/admin.lang index 62dd510c5e0..4f26613c7ae 100644 --- a/htdocs/langs/en_CA/admin.lang +++ b/htdocs/langs/en_CA/admin.lang @@ -2,6 +2,7 @@ LocalTax1Management=PST Management CompanyZip=Postal code LDAPFieldZip=Postal code +ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or a software interface installed on the same computer as the browser, and called when you click on a link in your browser that starts with "tel:". If you need a full server solution (no need of local software installation), you must set this to "No" and fill next field. FormatZip=Postal code OperationParamDesc=Define the values to use for the object of the action, or how to extract values. For example:
    objproperty1=SET:the value to set
    objproperty2=SET:a value with replacement of __objproperty1__
    objproperty3=SETIFEMPTY:value used if objproperty3 is not already defined
    objproperty4=EXTRACT:HEADER:X-Myheaderkey:\\s*([^\\s]*)
    options_myextrafield1=EXTRACT:SUBJECT:([^\n]*)
    object.objproperty5=EXTRACT:BODY:My company name is\\s([^\\s]*)

    Use a ; char as separator to extract or set several properties. EmailCollectorLoadThirdPartyHelp=You can use this action to use the email content to find and load an existing thirdparty in your database. The found (or created) thirdparty will be used for following actions that need it. In the parameter field you can use for example 'EXTRACT:BODY:Name:\\s([^\\s]*)' if you want to extract the name of the thirdparty from a string 'Name: name to find' found into the body. diff --git a/htdocs/langs/en_CA/salaries.lang b/htdocs/langs/en_CA/salaries.lang new file mode 100644 index 00000000000..c9bd3bec17b --- /dev/null +++ b/htdocs/langs/en_CA/salaries.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - salaries +LastSalaries=Latest %s salary payments +AllSalaries=All salary payments diff --git a/htdocs/langs/en_CA/users.lang b/htdocs/langs/en_CA/users.lang new file mode 100644 index 00000000000..4a412122b08 --- /dev/null +++ b/htdocs/langs/en_CA/users.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - users +NbOfUsers=No. of users +NbOfPermissions=No. of permissions diff --git a/htdocs/langs/en_CA/website.lang b/htdocs/langs/en_CA/website.lang new file mode 100644 index 00000000000..910cff6b702 --- /dev/null +++ b/htdocs/langs/en_CA/website.lang @@ -0,0 +1,2 @@ +# Dolibarr language file - Source file is en_US - website +PreviewOfSiteNotYetAvailable=Preview of your website %s not yet available. You must first 'Import a full website template' or just 'Add a page/container'. diff --git a/htdocs/langs/en_GB/admin.lang b/htdocs/langs/en_GB/admin.lang index 0ed13e41f0f..fd5b1c3f7df 100644 --- a/htdocs/langs/en_GB/admin.lang +++ b/htdocs/langs/en_GB/admin.lang @@ -44,6 +44,7 @@ DictionaryAccountancyJournal=Finance journals CompanyZip=Postcode LDAPFieldZip=Postcode GenbarcodeLocation=Barcode generation command line tool (used by internal engine for some bar code types). Must be compatible with "genbarcode".
    For example: /usr/local/bin/genbarcode +ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or a software interface installed on the same computer as the browser, and called when you click on a link in your browser that starts with "tel:". If you need a full server solution (no need of local software installation), you must set this to "No" and fill next field. FormatZip=Postcode OperationParamDesc=Define the values to use for the object of the action, or how to extract values. For example:
    objproperty1=SET:the value to set
    objproperty2=SET:a value with replacement of __objproperty1__
    objproperty3=SETIFEMPTY:value used if objproperty3 is not already defined
    objproperty4=EXTRACT:HEADER:X-Myheaderkey:\\s*([^\\s]*)
    options_myextrafield1=EXTRACT:SUBJECT:([^\n]*)
    object.objproperty5=EXTRACT:BODY:My company name is\\s([^\\s]*)

    Use a ; char as separator to extract or set several properties. EmailCollectorLoadThirdPartyHelp=You can use this action to use the email content to find and load an existing thirdparty in your database. The found (or created) thirdparty will be used for following actions that need it. In the parameter field you can use for example 'EXTRACT:BODY:Name:\\s([^\\s]*)' if you want to extract the name of the thirdparty from a string 'Name: name to find' found into the body. diff --git a/htdocs/langs/en_IN/admin.lang b/htdocs/langs/en_IN/admin.lang index 4b3c42b80b1..dd7034100a9 100644 --- a/htdocs/langs/en_IN/admin.lang +++ b/htdocs/langs/en_IN/admin.lang @@ -13,6 +13,7 @@ ProposalsNumberingModules=Quotation numbering models ProposalsPDFModules=Quotation documents models FreeLegalTextOnProposal=Free text on quotations WatermarkOnDraftProposal=Watermark on draft quotations (none if empty) +ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or a software interface installed on the same computer as the browser, and called when you click on a link in your browser that starts with "tel:". If you need a full server solution (no need of local software installation), you must set this to "No" and fill next field. MailToSendProposal=Customer quotations OperationParamDesc=Define the values to use for the object of the action, or how to extract values. For example:
    objproperty1=SET:the value to set
    objproperty2=SET:a value with replacement of __objproperty1__
    objproperty3=SETIFEMPTY:value used if objproperty3 is not already defined
    objproperty4=EXTRACT:HEADER:X-Myheaderkey:\\s*([^\\s]*)
    options_myextrafield1=EXTRACT:SUBJECT:([^\n]*)
    object.objproperty5=EXTRACT:BODY:My company name is\\s([^\\s]*)

    Use a ; char as separator to extract or set several properties. EmailCollectorLoadThirdPartyHelp=You can use this action to use the email content to find and load an existing thirdparty in your database. The found (or created) thirdparty will be used for following actions that need it. In the parameter field you can use for example 'EXTRACT:BODY:Name:\\s([^\\s]*)' if you want to extract the name of the thirdparty from a string 'Name: name to find' found into the body. diff --git a/htdocs/langs/en_IN/salaries.lang b/htdocs/langs/en_IN/salaries.lang new file mode 100644 index 00000000000..c9bd3bec17b --- /dev/null +++ b/htdocs/langs/en_IN/salaries.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - salaries +LastSalaries=Latest %s salary payments +AllSalaries=All salary payments diff --git a/htdocs/langs/en_IN/users.lang b/htdocs/langs/en_IN/users.lang new file mode 100644 index 00000000000..4a412122b08 --- /dev/null +++ b/htdocs/langs/en_IN/users.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - users +NbOfUsers=No. of users +NbOfPermissions=No. of permissions diff --git a/htdocs/langs/en_IN/website.lang b/htdocs/langs/en_IN/website.lang new file mode 100644 index 00000000000..910cff6b702 --- /dev/null +++ b/htdocs/langs/en_IN/website.lang @@ -0,0 +1,2 @@ +# Dolibarr language file - Source file is en_US - website +PreviewOfSiteNotYetAvailable=Preview of your website %s not yet available. You must first 'Import a full website template' or just 'Add a page/container'. diff --git a/htdocs/langs/en_SG/admin.lang b/htdocs/langs/en_SG/admin.lang index c1d306ec390..25265594de5 100644 --- a/htdocs/langs/en_SG/admin.lang +++ b/htdocs/langs/en_SG/admin.lang @@ -1,3 +1,4 @@ # Dolibarr language file - Source file is en_US - admin +ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or a software interface installed on the same computer as the browser, and called when you click on a link in your browser that starts with "tel:". If you need a full server solution (no need of local software installation), you must set this to "No" and fill next field. OperationParamDesc=Define the values to use for the object of the action, or how to extract values. For example:
    objproperty1=SET:the value to set
    objproperty2=SET:a value with replacement of __objproperty1__
    objproperty3=SETIFEMPTY:value used if objproperty3 is not already defined
    objproperty4=EXTRACT:HEADER:X-Myheaderkey:\\s*([^\\s]*)
    options_myextrafield1=EXTRACT:SUBJECT:([^\n]*)
    object.objproperty5=EXTRACT:BODY:My company name is\\s([^\\s]*)

    Use a ; char as separator to extract or set several properties. EmailCollectorLoadThirdPartyHelp=You can use this action to use the email content to find and load an existing thirdparty in your database. The found (or created) thirdparty will be used for following actions that need it. In the parameter field you can use for example 'EXTRACT:BODY:Name:\\s([^\\s]*)' if you want to extract the name of the thirdparty from a string 'Name: name to find' found into the body. diff --git a/htdocs/langs/en_SG/salaries.lang b/htdocs/langs/en_SG/salaries.lang new file mode 100644 index 00000000000..c9bd3bec17b --- /dev/null +++ b/htdocs/langs/en_SG/salaries.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - salaries +LastSalaries=Latest %s salary payments +AllSalaries=All salary payments diff --git a/htdocs/langs/en_SG/users.lang b/htdocs/langs/en_SG/users.lang new file mode 100644 index 00000000000..4a412122b08 --- /dev/null +++ b/htdocs/langs/en_SG/users.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - users +NbOfUsers=No. of users +NbOfPermissions=No. of permissions diff --git a/htdocs/langs/en_SG/website.lang b/htdocs/langs/en_SG/website.lang new file mode 100644 index 00000000000..910cff6b702 --- /dev/null +++ b/htdocs/langs/en_SG/website.lang @@ -0,0 +1,2 @@ +# Dolibarr language file - Source file is en_US - website +PreviewOfSiteNotYetAvailable=Preview of your website %s not yet available. You must first 'Import a full website template' or just 'Add a page/container'. diff --git a/htdocs/langs/es_AR/admin.lang b/htdocs/langs/es_AR/admin.lang index 831d264dea4..2c3e48b8ff6 100644 --- a/htdocs/langs/es_AR/admin.lang +++ b/htdocs/langs/es_AR/admin.lang @@ -523,6 +523,7 @@ LDAPFieldCompany=Compañía ViewProductDescInFormAbility=Mostrar descripción de productos en formularios (de otro forma es mostrado en una venta emergente tooltip popup) Target=Destino Sell=Vender +ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or a software interface installed on the same computer as the browser, and called when you click on a link in your browser that starts with "tel:". If you need a full server solution (no need of local software installation), you must set this to "No" and fill next field. PositionIntoComboList=Posición de la línea en las listas de combo SellTaxRate=Tasa de impuesto de venta RecuperableOnly=Sí, para el IVA "No percibido pero recuperable" dedicado a algún estado de Francia. Mantenga el valor en "No" en todos los demás casos. diff --git a/htdocs/langs/es_BO/admin.lang b/htdocs/langs/es_BO/admin.lang index c1d306ec390..25265594de5 100644 --- a/htdocs/langs/es_BO/admin.lang +++ b/htdocs/langs/es_BO/admin.lang @@ -1,3 +1,4 @@ # Dolibarr language file - Source file is en_US - admin +ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or a software interface installed on the same computer as the browser, and called when you click on a link in your browser that starts with "tel:". If you need a full server solution (no need of local software installation), you must set this to "No" and fill next field. OperationParamDesc=Define the values to use for the object of the action, or how to extract values. For example:
    objproperty1=SET:the value to set
    objproperty2=SET:a value with replacement of __objproperty1__
    objproperty3=SETIFEMPTY:value used if objproperty3 is not already defined
    objproperty4=EXTRACT:HEADER:X-Myheaderkey:\\s*([^\\s]*)
    options_myextrafield1=EXTRACT:SUBJECT:([^\n]*)
    object.objproperty5=EXTRACT:BODY:My company name is\\s([^\\s]*)

    Use a ; char as separator to extract or set several properties. EmailCollectorLoadThirdPartyHelp=You can use this action to use the email content to find and load an existing thirdparty in your database. The found (or created) thirdparty will be used for following actions that need it. In the parameter field you can use for example 'EXTRACT:BODY:Name:\\s([^\\s]*)' if you want to extract the name of the thirdparty from a string 'Name: name to find' found into the body. diff --git a/htdocs/langs/es_BO/salaries.lang b/htdocs/langs/es_BO/salaries.lang new file mode 100644 index 00000000000..c9bd3bec17b --- /dev/null +++ b/htdocs/langs/es_BO/salaries.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - salaries +LastSalaries=Latest %s salary payments +AllSalaries=All salary payments diff --git a/htdocs/langs/es_BO/users.lang b/htdocs/langs/es_BO/users.lang new file mode 100644 index 00000000000..4a412122b08 --- /dev/null +++ b/htdocs/langs/es_BO/users.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - users +NbOfUsers=No. of users +NbOfPermissions=No. of permissions diff --git a/htdocs/langs/es_BO/website.lang b/htdocs/langs/es_BO/website.lang new file mode 100644 index 00000000000..910cff6b702 --- /dev/null +++ b/htdocs/langs/es_BO/website.lang @@ -0,0 +1,2 @@ +# Dolibarr language file - Source file is en_US - website +PreviewOfSiteNotYetAvailable=Preview of your website %s not yet available. You must first 'Import a full website template' or just 'Add a page/container'. diff --git a/htdocs/langs/es_CL/exports.lang b/htdocs/langs/es_CL/exports.lang index d30d032606e..a419b15a966 100644 --- a/htdocs/langs/es_CL/exports.lang +++ b/htdocs/langs/es_CL/exports.lang @@ -36,7 +36,6 @@ TypeOfLineServiceOrProduct=Tipo de línea (0 = producto, 1 = servicio) FileWithDataToImport=Archivo con datos para importar FileToImport=Archivo fuente para importar FileMustHaveOneOfFollowingFormat=El archivo a importar debe tener uno de los siguientes formatos. -DownloadEmptyExample=Descargar archivo de plantilla con información de contenido de campo (* son campos obligatorios) ChooseFormatOfFileToImport=Elija el formato de archivo que se usará como formato de archivo de importación haciendo clic en el icono %s para seleccionarlo ... SourceFileFormat=Formato de archivo fuente FieldsInSourceFile=Campos en el archivo fuente diff --git a/htdocs/langs/es_CL/main.lang b/htdocs/langs/es_CL/main.lang index f67ea6b4eee..80f355253ea 100644 --- a/htdocs/langs/es_CL/main.lang +++ b/htdocs/langs/es_CL/main.lang @@ -269,6 +269,7 @@ ResultKo=Fracaso Reporting=Informes Drafts=Borrador Opened=Abierto +OpenAll=Abrir todo) ClosedAll=Cerrado (todos) Size=tamaño Topic=Tema diff --git a/htdocs/langs/es_CL/products.lang b/htdocs/langs/es_CL/products.lang index 7795586ce04..f09d02e994c 100644 --- a/htdocs/langs/es_CL/products.lang +++ b/htdocs/langs/es_CL/products.lang @@ -127,7 +127,6 @@ PriceByCustomer=Diferentes precios para cada cliente PriceCatalogue=Un único precio de venta por producto / servicio PricingRule=Reglas para los precios de venta. AddCustomerPrice=Agregar precio por cliente -ForceUpdateChildPriceSoc=Establezca el mismo precio en las subsidiarias de los clientes PriceByCustomerLog=Registro de precios anteriores de los clientes MinimumPriceLimit=El precio mínimo no puede ser inferior a %s PriceExpressionSelected=Expresión de precio seleccionado diff --git a/htdocs/langs/es_CO/main.lang b/htdocs/langs/es_CO/main.lang index 26b4e7b349c..0a9505ada84 100644 --- a/htdocs/langs/es_CO/main.lang +++ b/htdocs/langs/es_CO/main.lang @@ -155,6 +155,7 @@ NoOpenedElementToProcess=Ningún elemento abierto para procesar Categories=Etiquetas / categorías Category=Etiqueta / categoría ValidatedToProduce=Validado (Para producir) +OpenAll=Abrir (todo) ClosedAll=Cerrado (todo) Topic=Tema LateDesc=Un elemento se define como Retrasado según la configuración del sistema en el menú Inicio - Configuración - Alertas. diff --git a/htdocs/langs/es_CO/ticket.lang b/htdocs/langs/es_CO/ticket.lang index 8d0457e7d49..e194d4fa18f 100644 --- a/htdocs/langs/es_CO/ticket.lang +++ b/htdocs/langs/es_CO/ticket.lang @@ -6,17 +6,14 @@ Permission56005=Ver tickets de todos los terceros (no efectivo para usuarios ext TicketDictType=Ticket - Tipos TicketDictCategory=Entrada - Groupes TicketDictSeverity=Ticket - Severidades -TicketTypeShortISSUE=Problema, error o problema MenuTicketMyAssign=Mis entradas MenuTicketMyAssignNonClosed=Mis entradas abiertas MenuListNonClosed=Entradas abiertas TypeContact_ticket_internal_CONTRIBUTOR=Contribuyente TypeContact_ticket_external_SUPPORTCLI=Contacto con el cliente / seguimiento de incidentes TypeContact_ticket_external_CONTRIBUTOR=Colaborador externo -OriginEmail=Fuente de correo electrónico Notify_TICKET_SENTBYMAIL=Enviar mensaje de ticket por correo electrónico Read=Leer -NeedMoreInformation=Esperando información Waiting=Esperando Type=Tipo MailToSendTicketMessage=Para enviar correo electrónico desde el mensaje del ticket diff --git a/htdocs/langs/es_CO/users.lang b/htdocs/langs/es_CO/users.lang index b6c1a01ffe9..f0ab77f3da1 100644 --- a/htdocs/langs/es_CO/users.lang +++ b/htdocs/langs/es_CO/users.lang @@ -1,2 +1,4 @@ # Dolibarr language file - Source file is en_US - users MenuUsersAndGroups=Usuarios y Grupos +NbOfUsers=No. of users +NbOfPermissions=No. of permissions diff --git a/htdocs/langs/es_CO/website.lang b/htdocs/langs/es_CO/website.lang new file mode 100644 index 00000000000..910cff6b702 --- /dev/null +++ b/htdocs/langs/es_CO/website.lang @@ -0,0 +1,2 @@ +# Dolibarr language file - Source file is en_US - website +PreviewOfSiteNotYetAvailable=Preview of your website %s not yet available. You must first 'Import a full website template' or just 'Add a page/container'. diff --git a/htdocs/langs/es_DO/admin.lang b/htdocs/langs/es_DO/admin.lang index 6dbaf311a2a..81c0cd3e1a0 100644 --- a/htdocs/langs/es_DO/admin.lang +++ b/htdocs/langs/es_DO/admin.lang @@ -7,5 +7,6 @@ Permission93=Eliminar impuestos e ITBIS DictionaryVAT=Tasa de ITBIS (Impuesto sobre ventas en EEUU) UnitPriceOfProduct=Precio unitario sin ITBIS de un producto OptionVatMode=Opción de carga de ITBIS +ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or a software interface installed on the same computer as the browser, and called when you click on a link in your browser that starts with "tel:". If you need a full server solution (no need of local software installation), you must set this to "No" and fill next field. OperationParamDesc=Define the values to use for the object of the action, or how to extract values. For example:
    objproperty1=SET:the value to set
    objproperty2=SET:a value with replacement of __objproperty1__
    objproperty3=SETIFEMPTY:value used if objproperty3 is not already defined
    objproperty4=EXTRACT:HEADER:X-Myheaderkey:\\s*([^\\s]*)
    options_myextrafield1=EXTRACT:SUBJECT:([^\n]*)
    object.objproperty5=EXTRACT:BODY:My company name is\\s([^\\s]*)

    Use a ; char as separator to extract or set several properties. EmailCollectorLoadThirdPartyHelp=You can use this action to use the email content to find and load an existing thirdparty in your database. The found (or created) thirdparty will be used for following actions that need it. In the parameter field you can use for example 'EXTRACT:BODY:Name:\\s([^\\s]*)' if you want to extract the name of the thirdparty from a string 'Name: name to find' found into the body. diff --git a/htdocs/langs/es_DO/salaries.lang b/htdocs/langs/es_DO/salaries.lang new file mode 100644 index 00000000000..c9bd3bec17b --- /dev/null +++ b/htdocs/langs/es_DO/salaries.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - salaries +LastSalaries=Latest %s salary payments +AllSalaries=All salary payments diff --git a/htdocs/langs/es_DO/users.lang b/htdocs/langs/es_DO/users.lang new file mode 100644 index 00000000000..4a412122b08 --- /dev/null +++ b/htdocs/langs/es_DO/users.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - users +NbOfUsers=No. of users +NbOfPermissions=No. of permissions diff --git a/htdocs/langs/es_DO/website.lang b/htdocs/langs/es_DO/website.lang new file mode 100644 index 00000000000..910cff6b702 --- /dev/null +++ b/htdocs/langs/es_DO/website.lang @@ -0,0 +1,2 @@ +# Dolibarr language file - Source file is en_US - website +PreviewOfSiteNotYetAvailable=Preview of your website %s not yet available. You must first 'Import a full website template' or just 'Add a page/container'. diff --git a/htdocs/langs/es_EC/exports.lang b/htdocs/langs/es_EC/exports.lang index b1f9927f4d1..87bb1574d61 100644 --- a/htdocs/langs/es_EC/exports.lang +++ b/htdocs/langs/es_EC/exports.lang @@ -36,7 +36,6 @@ TypeOfLineServiceOrProduct=Tipo de línea (0 = producto, 1 = servicio) FileWithDataToImport=Archivo con datos para importar FileToImport=Archivo de origen para importar FileMustHaveOneOfFollowingFormat=El archivo a importar debe tener uno de los siguientes formatos. -DownloadEmptyExample=Descargar archivo de plantilla con información de contenido de campo (* son campos obligatorios) ChooseFormatOfFileToImport=Elija el formato de archivo para usar como formato de archivo de importación haciendo clic en el icono %s para seleccionarlo ... SourceFileFormat=Formato del archivo fuente FieldsInSourceFile=Campos del archivo de origen diff --git a/htdocs/langs/es_EC/main.lang b/htdocs/langs/es_EC/main.lang index bf25355ae9c..66619747638 100644 --- a/htdocs/langs/es_EC/main.lang +++ b/htdocs/langs/es_EC/main.lang @@ -276,6 +276,7 @@ ResultKo=Fallo Reporting=Informes Validated=validado Opened=Abierto +OpenAll=Abrir (todo) ClosedAll=Cerrado (todos) Topic=Tema ByCompanies=Por cliente diff --git a/htdocs/langs/es_EC/ticket.lang b/htdocs/langs/es_EC/ticket.lang index de9e0c92141..4e80f1e8378 100644 --- a/htdocs/langs/es_EC/ticket.lang +++ b/htdocs/langs/es_EC/ticket.lang @@ -4,15 +4,12 @@ Permission56005=Vea los tickets de todos los cliente/proveedor (no es efectivo p TicketDictType=Tipos - Tickets TicketDictCategory=Ticket - Grupos TicketDictSeverity=Ticket - Prioridades -TicketTypeShortISSUE=Problema o Error ErrorBadEmailAddress=Campo '%s' incorrecto MenuListNonClosed=Tikests abiertos TypeContact_ticket_internal_CONTRIBUTOR=Contribuyente TypeContact_ticket_external_SUPPORTCLI=Contacto con el cliente / seguimiento de incidentes -OriginEmail=Origen del correo electrónico Notify_TICKET_SENTBYMAIL=Enviar mensaje del ticket por correo electrónico Read=Leer -NeedMoreInformation=Esperando información Waiting=Esperando Type=Tipo MailToSendTicketMessage=Para enviar un correo electrónico desde un ticket diff --git a/htdocs/langs/es_ES/accountancy.lang b/htdocs/langs/es_ES/accountancy.lang index 67422fcdc78..dfdb3fd42b7 100644 --- a/htdocs/langs/es_ES/accountancy.lang +++ b/htdocs/langs/es_ES/accountancy.lang @@ -48,7 +48,8 @@ CountriesNotInEEC=Países no incluidos en la CEE CountriesInEECExceptMe=Países en la CEE excepto %s CountriesExceptMe=Todos los países excepto %s AccountantFiles=Exportar documentos de origen -ExportAccountingSourceDocHelp=Con esta herramienta, puede exportar los eventos de origen (lista y PDF) que se utilizaron para generar su contabilidad. Para exportar sus diarios, use la entrada de menú %s - %s. +ExportAccountingSourceDocHelp=Con esta herramienta, puede exportar los eventos de origen (lista en CSV y PDF) que se utilizaron para generar su contabilidad. +ExportAccountingSourceDocHelp2=Para exportar sus diarios, use la entrada de menú %s - %s. VueByAccountAccounting=Ver por cuenta contable VueBySubAccountAccounting=Ver por subcuenta contable @@ -328,9 +329,9 @@ ACCOUNTING_DISABLE_BINDING_ON_PURCHASES=Deshabilitar la vinculación y transfere ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS=Desactive la vinculación y transferencia en contabilidad en informes de gastos (los informes de gastos no se tendrán en cuenta en la contabilidad) ## Export -NotifiedExportDate=Notified export date (modification of the entries will not be possible) -NotifiedValidationDate=Validation of the entries (modification or deletion of the entries will not be possible) -ConfirmExportFile=Confirmation of the generation of the accounting export file ? +NotifiedExportDate=Fecha de exportación notificada (no será posible modificar las entradas) +NotifiedValidationDate=Validación de las entradas (no será posible modificar o eliminar las entradas) +ConfirmExportFile=¿Confirmación de la generación del archivo de exportación contable? ExportDraftJournal=Exportar libro borrador Modelcsv=Modelo de exportación Selectmodelcsv=Seleccione un modelo de exportación diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index 6071cf40a9c..9dcd8620ca1 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -562,7 +562,7 @@ Module53Desc=Gestión de servicios Module54Name=Contratos/Suscripciones Module54Desc=Gestión de contratos (servicios o suscripciones recurrentes) Module55Name=Códigos de barras -Module55Desc=Barcode or QR code management +Module55Desc=Gestión de códigos de barras o códigos QR Module56Name=Pago por transferencia bancaria Module56Desc=Gestión de pagos a proveedores mediante órdenes de transferencia bancaria. Incluye la generación de archivos SEPA para países europeos. Module57Name=Pagos por domiciliación bancaria @@ -849,10 +849,10 @@ Permission402=Crear/modificar haberes Permission403=Validar haberes Permission404=Eliminar haberes Permission430=Usa barra de debug -Permission511=Read salaries and payments (yours and subordinates) -Permission512=Create/modify salaries and payments -Permission514=Delete salaries and payments -Permission517=Read salaries and payments everybody +Permission511=Leer salarios y pagos (suyos y subordinados) +Permission512=Crear / modificar salarios y pagos +Permission514=Eliminar salarios y pagos +Permission517=Leer sueldos y pagos de todos Permission519=Exportar salarios Permission520=Consultar Créditos Permission522=Crear/modificar Créditos @@ -2144,3 +2144,4 @@ YouEnableDeprecatedWSAPIsUseRESTAPIsInstead=Habilitó la API WS obsoleta. En su RandomlySelectedIfSeveral=Seleccionado aleatoriamente si hay varias imágenes disponibles DatabasePasswordObfuscated=La contraseña de la base de datos está oculta en el archivo conf DatabasePasswordNotObfuscated=La contraseña de la base de datos NO está oculta en el archivo conf +APIsAreNotEnabled=Los módulos de API no están habilitados diff --git a/htdocs/langs/es_ES/deliveries.lang b/htdocs/langs/es_ES/deliveries.lang index f766e2d6734..e7778831157 100644 --- a/htdocs/langs/es_ES/deliveries.lang +++ b/htdocs/langs/es_ES/deliveries.lang @@ -30,3 +30,4 @@ NonShippable=No enviable ShowShippableStatus=Mostrar estado del envío ShowReceiving=Mostrar nota de recepción NonExistentOrder=Pedido inexistente +StockQuantitiesAlreadyAllocatedOnPreviousLines = Cantidades de stock ya asignadas en líneas anteriores diff --git a/htdocs/langs/es_ES/errors.lang b/htdocs/langs/es_ES/errors.lang index 3528cd3411d..2f59947aba4 100644 --- a/htdocs/langs/es_ES/errors.lang +++ b/htdocs/langs/es_ES/errors.lang @@ -11,7 +11,7 @@ ErrorBadValueForParamNotAString=Valor incorrecto para su parámetro. Generalment ErrorRefAlreadyExists=La referencia %s ya existe. ErrorLoginAlreadyExists=El login %s ya existe. ErrorGroupAlreadyExists=El grupo %s ya existe. -ErrorEmailAlreadyExists=Email %s already exists. +ErrorEmailAlreadyExists=El correo electrónico %s ya existe. ErrorRecordNotFound=Registro no encontrado ErrorFailToCopyFile=Error al copiar el archivo '%s' en '%s'. ErrorFailToCopyDir=Error al copiar el directorio '%s' en '%s'. diff --git a/htdocs/langs/es_ES/exports.lang b/htdocs/langs/es_ES/exports.lang index 9a0e7decd49..9efcdbaae44 100644 --- a/htdocs/langs/es_ES/exports.lang +++ b/htdocs/langs/es_ES/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Tipo de línea (0=producto, 1=servicio) FileWithDataToImport=Archivo que contiene los datos a importar FileToImport=Archivo origen a importar FileMustHaveOneOfFollowingFormat=El archivo de importación debe tener uno de los siguientes formatos -DownloadEmptyExample=Descargar una plantilla con la información de los contenidos de los campos (los marcados con * son obligatorios) +DownloadEmptyExample=Descargar archivo de plantilla con información de contenido de campo +StarAreMandatory=* son campos obligatorios ChooseFormatOfFileToImport=Elija el formato de archivo que desea importar haciendo en la imagen %s para seleccionarlo... ChooseFileToImport=Cargue el archivo y luego haga clic en el icono %s para seleccionar el archivo como archivo de importación de origen ... SourceFileFormat=Formato del archivo origen diff --git a/htdocs/langs/es_ES/knowledgemanagement.lang b/htdocs/langs/es_ES/knowledgemanagement.lang index 3c760eaac50..9a7f688b94b 100644 --- a/htdocs/langs/es_ES/knowledgemanagement.lang +++ b/htdocs/langs/es_ES/knowledgemanagement.lang @@ -37,15 +37,7 @@ About = Acerca de KnowledgeManagementAbout = Acerca de la Gestión del Conocimiento KnowledgeManagementAboutPage = Gestión del Conocimiento sobre la página -# -# Sample page -# KnowledgeManagementArea = Gestión del Conocimiento - - -# -# Menu -# MenuKnowledgeRecord = Base de Conocimientos ListKnowledgeRecord = Lista de articulos NewKnowledgeRecord = Articulo nuevo @@ -53,3 +45,5 @@ ValidateReply = Validar solución KnowledgeRecords = Artículos KnowledgeRecord = Artículo KnowledgeRecordExtraFields = Campos adicionales para el artículo +GroupOfTicket=Grupo de tickets +YouCanLinkArticleToATicketCategory=Puede vincular un artículo a un grupo de tickets (por lo que el artículo se sugerirá durante la calificación de nuevos tickets) diff --git a/htdocs/langs/es_ES/languages.lang b/htdocs/langs/es_ES/languages.lang index 1a3480bec23..88bd2e399a0 100644 --- a/htdocs/langs/es_ES/languages.lang +++ b/htdocs/langs/es_ES/languages.lang @@ -4,6 +4,7 @@ Language_ar_AR=Árabe Language_ar_EG=Árabe (Egipto) Language_ar_SA=Árabe Language_ar_TN=Árabe (Túnez) +Language_ar_IQ=Árabe (Irak) Language_az_AZ=Azerbaiyano Language_bn_BD=Bengalí Language_bn_IN=Bengalí (India) @@ -83,6 +84,7 @@ Language_ne_NP=Nepalí Language_nl_BE=Neerlandés (Bélgica) Language_nl_NL=Holandés Language_pl_PL=Polaco +Language_pt_AO=Portugués (Angola) Language_pt_BR=Portugués (Brasil) Language_pt_PT=Portugués Language_ro_MD=Rumano (Moldavia) diff --git a/htdocs/langs/es_ES/main.lang b/htdocs/langs/es_ES/main.lang index 151b6de8f7d..9fd6092f046 100644 --- a/htdocs/langs/es_ES/main.lang +++ b/htdocs/langs/es_ES/main.lang @@ -730,7 +730,7 @@ MenuMembers=Miembros MenuAgendaGoogle=Agenda Google MenuTaxesAndSpecialExpenses=Impuestos | Gastos especiales ThisLimitIsDefinedInSetup=Límite Dolibarr (Menú inicio-configuración-seguridad): %s Kb, PHP limit: %s Kb -ThisLimitIsDefinedInSetupAt=Dolibarr limit (Menu %s): %s Kb, PHP limit (Param %s): %s Kb +ThisLimitIsDefinedInSetupAt=Límite Dolibarr (Menú %s): %s Kb, Límite PHP (Param %s): %s Kb NoFileFound=No se cargaron documentos CurrentUserLanguage=Idioma actual CurrentTheme=Tema actual @@ -1136,4 +1136,4 @@ CategTypeNotFound=No se encontró ningún tipo de etiqueta para el tipo de regis CopiedToClipboard=Copiado al portapapeles InformationOnLinkToContract=Esta cantidad es solo el total de todas las líneas del contrato. No se toma en consideración ninguna noción de tiempo. ConfirmCancel=Estas seguro que quieres cancelar -EmailMsgID=Email MsgID +EmailMsgID=MsgID de correo electrónico diff --git a/htdocs/langs/es_ES/products.lang b/htdocs/langs/es_ES/products.lang index 521840692ad..06c1af87189 100644 --- a/htdocs/langs/es_ES/products.lang +++ b/htdocs/langs/es_ES/products.lang @@ -277,7 +277,7 @@ PriceByCustomer=Cambiar precios para cada cliente PriceCatalogue=Un precio único de venta por producto/servicio PricingRule=Reglas para precios de venta AddCustomerPrice=Añadir precio a cliente -ForceUpdateChildPriceSoc=Establecer el mismo precio en las filiales de los clientes +ForceUpdateChildPriceSoc=Establecer el mismo precio en las subsidiarias del cliente PriceByCustomerLog=Historial de precios a clientes MinimumPriceLimit=El precio mínimo no puede ser menor que %s MinimumRecommendedPrice=El precio mínimo recomendado es: %s @@ -296,6 +296,7 @@ ComposedProductIncDecStock=Incrementar/Decrementar stock al cambiar su padre ComposedProduct=Sub-producto MinSupplierPrice=Precio mínimo de compra MinCustomerPrice=Precio de venta mínimo +NoDynamicPrice=Sin precio dinámico DynamicPriceConfiguration=Configuración de precio dinámico DynamicPriceDesc=Puede establecer funciones matemáticas para calcular los precios de cliente o proveedor. Esta función puede utilizar todos los operadores matemáticos, algunas constantes y variables. Puede definir aquí las variables que desea utilizar y si la variable necesita una actualización automática, la URL externa que debe utilizarse para pedirle a Dolibarr que actualice automáticamente el valor. AddVariable=Añadir variable diff --git a/htdocs/langs/es_ES/stocks.lang b/htdocs/langs/es_ES/stocks.lang index 51c70a2409b..fa6354bcf4f 100644 --- a/htdocs/langs/es_ES/stocks.lang +++ b/htdocs/langs/es_ES/stocks.lang @@ -60,7 +60,7 @@ EnhancedValueOfWarehouses=Valor de stocks UserWarehouseAutoCreate=Crear automáticamente existencias/almacén propio del usuario en la creación del usuario AllowAddLimitStockByWarehouse=Administrar también el valor del stock mínimo y deseado de la cupla (producto-almacén) además del valor del stock mínimo y deseado por producto RuleForWarehouse=Regla para almacenes -WarehouseAskWarehouseOnThirparty=Establecer un almacén en un tercero +WarehouseAskWarehouseOnThirparty=Establecer un almacén en terceros WarehouseAskWarehouseDuringPropal=Establecer un almacén en presupuestos comerciales WarehouseAskWarehouseDuringOrder=Indicar un almacén en pedidos de clientes UserDefaultWarehouse=Indicar un almacén en usuarios @@ -167,8 +167,8 @@ MovementTransferStock=Transferencia de stock del producto %s a otro almacén InventoryCodeShort=Código Inv./Mov. NoPendingReceptionOnSupplierOrder=No existen recepciones pendientes ya que el pedido está abierto ThisSerialAlreadyExistWithDifferentDate=Este número de lote/serie (%s) ya existe, pero con una fecha de caducidad o venta diferente (encontrada %s pero ha introducido %s). -OpenAll=Abierto para todas las acciones -OpenInternal=Abierto para acciones internas +OpenAnyMovement=Abierto (todo movimiento) +OpenInternal=Abierto (solo movimiento interno) UseDispatchStatus=Utilice un estado (aprobar/rechazar) para las líneas de las recepciones de los pedidos a proveedor OptionMULTIPRICESIsOn=La opción "varios precios por segmento" está activada. Esto significa que un producto tiene varios precio de venta, por lo que el valor de venta no puede calcularse ProductStockWarehouseCreated=Límite stock para alertas y stock óptimo deseado creado correctamente diff --git a/htdocs/langs/es_ES/ticket.lang b/htdocs/langs/es_ES/ticket.lang index c022e7d79a9..9385e5cf360 100644 --- a/htdocs/langs/es_ES/ticket.lang +++ b/htdocs/langs/es_ES/ticket.lang @@ -34,7 +34,8 @@ TicketDictResolution=Ticket - Resolución TicketTypeShortCOM=Pregunta comercial TicketTypeShortHELP=Solicitud de ayuda funcional -TicketTypeShortISSUE=Asunto, error o problema +TicketTypeShortISSUE=Problema o error +TicketTypeShortPROBLEM=Problema TicketTypeShortREQUEST=Solicitud de cambio o mejora TicketTypeShortPROJET=Proyecto TicketTypeShortOTHER=Otro @@ -54,14 +55,15 @@ TypeContact_ticket_internal_SUPPORTTEC=Usuario asignado TypeContact_ticket_external_SUPPORTCLI=Contacto cliente / seguimiento de incidentes TypeContact_ticket_external_CONTRIBUTOR=Contribuidor externo -OriginEmail=Origen E-Mail +OriginEmail=Remitente de correo electrónico Notify_TICKET_SENTBYMAIL=Enviar mensaje de ticket por e-mail # Status Read=Leido Assigned=Asignado InProgress=En progreso -NeedMoreInformation=En espera de información +NeedMoreInformation=Esperando comentarios del remitente +NeedMoreInformationShort=Esperando comentarios Answered=Contestado Waiting=En espera Closed=Cerrado @@ -160,7 +162,7 @@ CreatedBy=Creado por NewTicket=Nuevo ticket SubjectAnswerToTicket=Respuesta TicketTypeRequest=Tipo de solicitud -TicketCategory=Grupo +TicketCategory=Categorización de tickets SeeTicket=Ver ticket TicketMarkedAsRead=El ticket ha sido marcado como leído TicketReadOn=Leído el @@ -211,6 +213,7 @@ TicketMessageHelp=Solo este texto se guardará en la lista de mensajes en la fic TicketMessageSubstitutionReplacedByGenericValues=Las variables de sustitución se reemplazan por valores genéricos. TimeElapsedSince=Tiempo transcurrido desde TicketTimeToRead=Tiempo transcurrido antes de leer el ticket +TicketTimeElapsedBeforeSince=Tiempo transcurrido antes / desde TicketContacts=Contactos del ticket TicketDocumentsLinked=Documentos relacionados con el ticket ConfirmReOpenTicket=¿Está seguro de querer reabrir este ticket? diff --git a/htdocs/langs/es_GT/admin.lang b/htdocs/langs/es_GT/admin.lang index c1d306ec390..25265594de5 100644 --- a/htdocs/langs/es_GT/admin.lang +++ b/htdocs/langs/es_GT/admin.lang @@ -1,3 +1,4 @@ # Dolibarr language file - Source file is en_US - admin +ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or a software interface installed on the same computer as the browser, and called when you click on a link in your browser that starts with "tel:". If you need a full server solution (no need of local software installation), you must set this to "No" and fill next field. OperationParamDesc=Define the values to use for the object of the action, or how to extract values. For example:
    objproperty1=SET:the value to set
    objproperty2=SET:a value with replacement of __objproperty1__
    objproperty3=SETIFEMPTY:value used if objproperty3 is not already defined
    objproperty4=EXTRACT:HEADER:X-Myheaderkey:\\s*([^\\s]*)
    options_myextrafield1=EXTRACT:SUBJECT:([^\n]*)
    object.objproperty5=EXTRACT:BODY:My company name is\\s([^\\s]*)

    Use a ; char as separator to extract or set several properties. EmailCollectorLoadThirdPartyHelp=You can use this action to use the email content to find and load an existing thirdparty in your database. The found (or created) thirdparty will be used for following actions that need it. In the parameter field you can use for example 'EXTRACT:BODY:Name:\\s([^\\s]*)' if you want to extract the name of the thirdparty from a string 'Name: name to find' found into the body. diff --git a/htdocs/langs/es_GT/salaries.lang b/htdocs/langs/es_GT/salaries.lang new file mode 100644 index 00000000000..c9bd3bec17b --- /dev/null +++ b/htdocs/langs/es_GT/salaries.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - salaries +LastSalaries=Latest %s salary payments +AllSalaries=All salary payments diff --git a/htdocs/langs/es_GT/users.lang b/htdocs/langs/es_GT/users.lang new file mode 100644 index 00000000000..4a412122b08 --- /dev/null +++ b/htdocs/langs/es_GT/users.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - users +NbOfUsers=No. of users +NbOfPermissions=No. of permissions diff --git a/htdocs/langs/es_GT/website.lang b/htdocs/langs/es_GT/website.lang new file mode 100644 index 00000000000..910cff6b702 --- /dev/null +++ b/htdocs/langs/es_GT/website.lang @@ -0,0 +1,2 @@ +# Dolibarr language file - Source file is en_US - website +PreviewOfSiteNotYetAvailable=Preview of your website %s not yet available. You must first 'Import a full website template' or just 'Add a page/container'. diff --git a/htdocs/langs/es_HN/admin.lang b/htdocs/langs/es_HN/admin.lang index c1d306ec390..25265594de5 100644 --- a/htdocs/langs/es_HN/admin.lang +++ b/htdocs/langs/es_HN/admin.lang @@ -1,3 +1,4 @@ # Dolibarr language file - Source file is en_US - admin +ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or a software interface installed on the same computer as the browser, and called when you click on a link in your browser that starts with "tel:". If you need a full server solution (no need of local software installation), you must set this to "No" and fill next field. OperationParamDesc=Define the values to use for the object of the action, or how to extract values. For example:
    objproperty1=SET:the value to set
    objproperty2=SET:a value with replacement of __objproperty1__
    objproperty3=SETIFEMPTY:value used if objproperty3 is not already defined
    objproperty4=EXTRACT:HEADER:X-Myheaderkey:\\s*([^\\s]*)
    options_myextrafield1=EXTRACT:SUBJECT:([^\n]*)
    object.objproperty5=EXTRACT:BODY:My company name is\\s([^\\s]*)

    Use a ; char as separator to extract or set several properties. EmailCollectorLoadThirdPartyHelp=You can use this action to use the email content to find and load an existing thirdparty in your database. The found (or created) thirdparty will be used for following actions that need it. In the parameter field you can use for example 'EXTRACT:BODY:Name:\\s([^\\s]*)' if you want to extract the name of the thirdparty from a string 'Name: name to find' found into the body. diff --git a/htdocs/langs/es_HN/salaries.lang b/htdocs/langs/es_HN/salaries.lang new file mode 100644 index 00000000000..c9bd3bec17b --- /dev/null +++ b/htdocs/langs/es_HN/salaries.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - salaries +LastSalaries=Latest %s salary payments +AllSalaries=All salary payments diff --git a/htdocs/langs/es_HN/users.lang b/htdocs/langs/es_HN/users.lang new file mode 100644 index 00000000000..4a412122b08 --- /dev/null +++ b/htdocs/langs/es_HN/users.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - users +NbOfUsers=No. of users +NbOfPermissions=No. of permissions diff --git a/htdocs/langs/es_HN/website.lang b/htdocs/langs/es_HN/website.lang new file mode 100644 index 00000000000..910cff6b702 --- /dev/null +++ b/htdocs/langs/es_HN/website.lang @@ -0,0 +1,2 @@ +# Dolibarr language file - Source file is en_US - website +PreviewOfSiteNotYetAvailable=Preview of your website %s not yet available. You must first 'Import a full website template' or just 'Add a page/container'. diff --git a/htdocs/langs/es_MX/users.lang b/htdocs/langs/es_MX/users.lang index ddd9b610db2..217c37db5fe 100644 --- a/htdocs/langs/es_MX/users.lang +++ b/htdocs/langs/es_MX/users.lang @@ -11,3 +11,5 @@ DisableAUser=Deshabilitar un usuario EnableAUser=Habilitar un usuario LastName=Apellido FirstName=Nombre(s) +NbOfUsers=No. of users +NbOfPermissions=No. of permissions diff --git a/htdocs/langs/es_PA/admin.lang b/htdocs/langs/es_PA/admin.lang index f0c05a924c9..01d1912f886 100644 --- a/htdocs/langs/es_PA/admin.lang +++ b/htdocs/langs/es_PA/admin.lang @@ -1,4 +1,5 @@ # Dolibarr language file - Source file is en_US - admin VersionUnknown=Desconocido +ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or a software interface installed on the same computer as the browser, and called when you click on a link in your browser that starts with "tel:". If you need a full server solution (no need of local software installation), you must set this to "No" and fill next field. OperationParamDesc=Define the values to use for the object of the action, or how to extract values. For example:
    objproperty1=SET:the value to set
    objproperty2=SET:a value with replacement of __objproperty1__
    objproperty3=SETIFEMPTY:value used if objproperty3 is not already defined
    objproperty4=EXTRACT:HEADER:X-Myheaderkey:\\s*([^\\s]*)
    options_myextrafield1=EXTRACT:SUBJECT:([^\n]*)
    object.objproperty5=EXTRACT:BODY:My company name is\\s([^\\s]*)

    Use a ; char as separator to extract or set several properties. EmailCollectorLoadThirdPartyHelp=You can use this action to use the email content to find and load an existing thirdparty in your database. The found (or created) thirdparty will be used for following actions that need it. In the parameter field you can use for example 'EXTRACT:BODY:Name:\\s([^\\s]*)' if you want to extract the name of the thirdparty from a string 'Name: name to find' found into the body. diff --git a/htdocs/langs/es_PA/salaries.lang b/htdocs/langs/es_PA/salaries.lang new file mode 100644 index 00000000000..c9bd3bec17b --- /dev/null +++ b/htdocs/langs/es_PA/salaries.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - salaries +LastSalaries=Latest %s salary payments +AllSalaries=All salary payments diff --git a/htdocs/langs/es_PA/users.lang b/htdocs/langs/es_PA/users.lang new file mode 100644 index 00000000000..4a412122b08 --- /dev/null +++ b/htdocs/langs/es_PA/users.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - users +NbOfUsers=No. of users +NbOfPermissions=No. of permissions diff --git a/htdocs/langs/es_PA/website.lang b/htdocs/langs/es_PA/website.lang new file mode 100644 index 00000000000..910cff6b702 --- /dev/null +++ b/htdocs/langs/es_PA/website.lang @@ -0,0 +1,2 @@ +# Dolibarr language file - Source file is en_US - website +PreviewOfSiteNotYetAvailable=Preview of your website %s not yet available. You must first 'Import a full website template' or just 'Add a page/container'. diff --git a/htdocs/langs/es_PE/admin.lang b/htdocs/langs/es_PE/admin.lang index 6ab8ad59b97..80e43a5bb33 100644 --- a/htdocs/langs/es_PE/admin.lang +++ b/htdocs/langs/es_PE/admin.lang @@ -8,6 +8,7 @@ Permission93=Eliminar impuestos e IGV DictionaryVAT=Tasa de IGV o tasa de impuesto a las ventas UnitPriceOfProduct=Precio unitario sin IGV de un producto OptionVatMode=IGV adeudado +ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or a software interface installed on the same computer as the browser, and called when you click on a link in your browser that starts with "tel:". If you need a full server solution (no need of local software installation), you must set this to "No" and fill next field. MailToSendInvoice=Facturas de Clientes OperationParamDesc=Define the values to use for the object of the action, or how to extract values. For example:
    objproperty1=SET:the value to set
    objproperty2=SET:a value with replacement of __objproperty1__
    objproperty3=SETIFEMPTY:value used if objproperty3 is not already defined
    objproperty4=EXTRACT:HEADER:X-Myheaderkey:\\s*([^\\s]*)
    options_myextrafield1=EXTRACT:SUBJECT:([^\n]*)
    object.objproperty5=EXTRACT:BODY:My company name is\\s([^\\s]*)

    Use a ; char as separator to extract or set several properties. EmailCollectorLoadThirdPartyHelp=You can use this action to use the email content to find and load an existing thirdparty in your database. The found (or created) thirdparty will be used for following actions that need it. In the parameter field you can use for example 'EXTRACT:BODY:Name:\\s([^\\s]*)' if you want to extract the name of the thirdparty from a string 'Name: name to find' found into the body. diff --git a/htdocs/langs/es_PE/users.lang b/htdocs/langs/es_PE/users.lang index 185c0f9f101..c25a9be3f4e 100644 --- a/htdocs/langs/es_PE/users.lang +++ b/htdocs/langs/es_PE/users.lang @@ -2,3 +2,5 @@ DisableUser=Inhabilitar DeleteUser=Borrar DeleteGroup=Borrar +NbOfUsers=No. of users +NbOfPermissions=No. of permissions diff --git a/htdocs/langs/es_PY/admin.lang b/htdocs/langs/es_PY/admin.lang index c1d306ec390..25265594de5 100644 --- a/htdocs/langs/es_PY/admin.lang +++ b/htdocs/langs/es_PY/admin.lang @@ -1,3 +1,4 @@ # Dolibarr language file - Source file is en_US - admin +ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or a software interface installed on the same computer as the browser, and called when you click on a link in your browser that starts with "tel:". If you need a full server solution (no need of local software installation), you must set this to "No" and fill next field. OperationParamDesc=Define the values to use for the object of the action, or how to extract values. For example:
    objproperty1=SET:the value to set
    objproperty2=SET:a value with replacement of __objproperty1__
    objproperty3=SETIFEMPTY:value used if objproperty3 is not already defined
    objproperty4=EXTRACT:HEADER:X-Myheaderkey:\\s*([^\\s]*)
    options_myextrafield1=EXTRACT:SUBJECT:([^\n]*)
    object.objproperty5=EXTRACT:BODY:My company name is\\s([^\\s]*)

    Use a ; char as separator to extract or set several properties. EmailCollectorLoadThirdPartyHelp=You can use this action to use the email content to find and load an existing thirdparty in your database. The found (or created) thirdparty will be used for following actions that need it. In the parameter field you can use for example 'EXTRACT:BODY:Name:\\s([^\\s]*)' if you want to extract the name of the thirdparty from a string 'Name: name to find' found into the body. diff --git a/htdocs/langs/es_PY/salaries.lang b/htdocs/langs/es_PY/salaries.lang new file mode 100644 index 00000000000..c9bd3bec17b --- /dev/null +++ b/htdocs/langs/es_PY/salaries.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - salaries +LastSalaries=Latest %s salary payments +AllSalaries=All salary payments diff --git a/htdocs/langs/es_PY/users.lang b/htdocs/langs/es_PY/users.lang new file mode 100644 index 00000000000..4a412122b08 --- /dev/null +++ b/htdocs/langs/es_PY/users.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - users +NbOfUsers=No. of users +NbOfPermissions=No. of permissions diff --git a/htdocs/langs/es_PY/website.lang b/htdocs/langs/es_PY/website.lang new file mode 100644 index 00000000000..910cff6b702 --- /dev/null +++ b/htdocs/langs/es_PY/website.lang @@ -0,0 +1,2 @@ +# Dolibarr language file - Source file is en_US - website +PreviewOfSiteNotYetAvailable=Preview of your website %s not yet available. You must first 'Import a full website template' or just 'Add a page/container'. diff --git a/htdocs/langs/es_US/admin.lang b/htdocs/langs/es_US/admin.lang index c1d306ec390..25265594de5 100644 --- a/htdocs/langs/es_US/admin.lang +++ b/htdocs/langs/es_US/admin.lang @@ -1,3 +1,4 @@ # Dolibarr language file - Source file is en_US - admin +ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or a software interface installed on the same computer as the browser, and called when you click on a link in your browser that starts with "tel:". If you need a full server solution (no need of local software installation), you must set this to "No" and fill next field. OperationParamDesc=Define the values to use for the object of the action, or how to extract values. For example:
    objproperty1=SET:the value to set
    objproperty2=SET:a value with replacement of __objproperty1__
    objproperty3=SETIFEMPTY:value used if objproperty3 is not already defined
    objproperty4=EXTRACT:HEADER:X-Myheaderkey:\\s*([^\\s]*)
    options_myextrafield1=EXTRACT:SUBJECT:([^\n]*)
    object.objproperty5=EXTRACT:BODY:My company name is\\s([^\\s]*)

    Use a ; char as separator to extract or set several properties. EmailCollectorLoadThirdPartyHelp=You can use this action to use the email content to find and load an existing thirdparty in your database. The found (or created) thirdparty will be used for following actions that need it. In the parameter field you can use for example 'EXTRACT:BODY:Name:\\s([^\\s]*)' if you want to extract the name of the thirdparty from a string 'Name: name to find' found into the body. diff --git a/htdocs/langs/es_US/salaries.lang b/htdocs/langs/es_US/salaries.lang new file mode 100644 index 00000000000..c9bd3bec17b --- /dev/null +++ b/htdocs/langs/es_US/salaries.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - salaries +LastSalaries=Latest %s salary payments +AllSalaries=All salary payments diff --git a/htdocs/langs/es_US/users.lang b/htdocs/langs/es_US/users.lang new file mode 100644 index 00000000000..4a412122b08 --- /dev/null +++ b/htdocs/langs/es_US/users.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - users +NbOfUsers=No. of users +NbOfPermissions=No. of permissions diff --git a/htdocs/langs/es_US/website.lang b/htdocs/langs/es_US/website.lang new file mode 100644 index 00000000000..910cff6b702 --- /dev/null +++ b/htdocs/langs/es_US/website.lang @@ -0,0 +1,2 @@ +# Dolibarr language file - Source file is en_US - website +PreviewOfSiteNotYetAvailable=Preview of your website %s not yet available. You must first 'Import a full website template' or just 'Add a page/container'. diff --git a/htdocs/langs/es_UY/admin.lang b/htdocs/langs/es_UY/admin.lang index c1d306ec390..25265594de5 100644 --- a/htdocs/langs/es_UY/admin.lang +++ b/htdocs/langs/es_UY/admin.lang @@ -1,3 +1,4 @@ # Dolibarr language file - Source file is en_US - admin +ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or a software interface installed on the same computer as the browser, and called when you click on a link in your browser that starts with "tel:". If you need a full server solution (no need of local software installation), you must set this to "No" and fill next field. OperationParamDesc=Define the values to use for the object of the action, or how to extract values. For example:
    objproperty1=SET:the value to set
    objproperty2=SET:a value with replacement of __objproperty1__
    objproperty3=SETIFEMPTY:value used if objproperty3 is not already defined
    objproperty4=EXTRACT:HEADER:X-Myheaderkey:\\s*([^\\s]*)
    options_myextrafield1=EXTRACT:SUBJECT:([^\n]*)
    object.objproperty5=EXTRACT:BODY:My company name is\\s([^\\s]*)

    Use a ; char as separator to extract or set several properties. EmailCollectorLoadThirdPartyHelp=You can use this action to use the email content to find and load an existing thirdparty in your database. The found (or created) thirdparty will be used for following actions that need it. In the parameter field you can use for example 'EXTRACT:BODY:Name:\\s([^\\s]*)' if you want to extract the name of the thirdparty from a string 'Name: name to find' found into the body. diff --git a/htdocs/langs/es_UY/salaries.lang b/htdocs/langs/es_UY/salaries.lang new file mode 100644 index 00000000000..c9bd3bec17b --- /dev/null +++ b/htdocs/langs/es_UY/salaries.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - salaries +LastSalaries=Latest %s salary payments +AllSalaries=All salary payments diff --git a/htdocs/langs/es_UY/users.lang b/htdocs/langs/es_UY/users.lang new file mode 100644 index 00000000000..4a412122b08 --- /dev/null +++ b/htdocs/langs/es_UY/users.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - users +NbOfUsers=No. of users +NbOfPermissions=No. of permissions diff --git a/htdocs/langs/es_UY/website.lang b/htdocs/langs/es_UY/website.lang new file mode 100644 index 00000000000..910cff6b702 --- /dev/null +++ b/htdocs/langs/es_UY/website.lang @@ -0,0 +1,2 @@ +# Dolibarr language file - Source file is en_US - website +PreviewOfSiteNotYetAvailable=Preview of your website %s not yet available. You must first 'Import a full website template' or just 'Add a page/container'. diff --git a/htdocs/langs/es_VE/admin.lang b/htdocs/langs/es_VE/admin.lang index 271cb2be3a5..3eaf5ae876c 100644 --- a/htdocs/langs/es_VE/admin.lang +++ b/htdocs/langs/es_VE/admin.lang @@ -30,5 +30,6 @@ WatermarkOnDraftSupplierProposal=Marca de agua en solicitudes de precios a prove LDAPMemberObjectClassListExample=Lista de ObjectClass que definen los atributos de un registro (ej: top,inetOrgPerson o top,user for active directory) LDAPUserObjectClassListExample=Lista de ObjectClass que definen los atributos de un registro (ej: top,inetOrgPerson o top,user for active directory) LDAPContactObjectClassListExample=Lista de objectClass que definen los atributos de un registro (ej: top,inetOrgPerson o top,user for active directory) +ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or a software interface installed on the same computer as the browser, and called when you click on a link in your browser that starts with "tel:". If you need a full server solution (no need of local software installation), you must set this to "No" and fill next field. OperationParamDesc=Define the values to use for the object of the action, or how to extract values. For example:
    objproperty1=SET:the value to set
    objproperty2=SET:a value with replacement of __objproperty1__
    objproperty3=SETIFEMPTY:value used if objproperty3 is not already defined
    objproperty4=EXTRACT:HEADER:X-Myheaderkey:\\s*([^\\s]*)
    options_myextrafield1=EXTRACT:SUBJECT:([^\n]*)
    object.objproperty5=EXTRACT:BODY:My company name is\\s([^\\s]*)

    Use a ; char as separator to extract or set several properties. EmailCollectorLoadThirdPartyHelp=You can use this action to use the email content to find and load an existing thirdparty in your database. The found (or created) thirdparty will be used for following actions that need it. In the parameter field you can use for example 'EXTRACT:BODY:Name:\\s([^\\s]*)' if you want to extract the name of the thirdparty from a string 'Name: name to find' found into the body. diff --git a/htdocs/langs/es_VE/users.lang b/htdocs/langs/es_VE/users.lang new file mode 100644 index 00000000000..4a412122b08 --- /dev/null +++ b/htdocs/langs/es_VE/users.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - users +NbOfUsers=No. of users +NbOfPermissions=No. of permissions diff --git a/htdocs/langs/es_VE/website.lang b/htdocs/langs/es_VE/website.lang new file mode 100644 index 00000000000..910cff6b702 --- /dev/null +++ b/htdocs/langs/es_VE/website.lang @@ -0,0 +1,2 @@ +# Dolibarr language file - Source file is en_US - website +PreviewOfSiteNotYetAvailable=Preview of your website %s not yet available. You must first 'Import a full website template' or just 'Add a page/container'. diff --git a/htdocs/langs/et_EE/deliveries.lang b/htdocs/langs/et_EE/deliveries.lang index c08d77986b4..69449b457ca 100644 --- a/htdocs/langs/et_EE/deliveries.lang +++ b/htdocs/langs/et_EE/deliveries.lang @@ -27,5 +27,7 @@ Recipient=Vastuvõtja ErrorStockIsNotEnough=There's not enough stock Shippable=Shippable NonShippable=Not Shippable +ShowShippableStatus=Show shippable status ShowReceiving=Show delivery receipt NonExistentOrder=Nonexistent order +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/et_EE/exports.lang b/htdocs/langs/et_EE/exports.lang index ed1048c18f3..d3524c6c436 100644 --- a/htdocs/langs/et_EE/exports.lang +++ b/htdocs/langs/et_EE/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Rea liik (0=toode, 1=teenus) FileWithDataToImport=Imporditavate andmetega fai FileToImport=Imporditav lähtefai FileMustHaveOneOfFollowingFormat=File to import must have one of following formats -DownloadEmptyExample=Download template file with field content information (* are mandatory fields) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Choose the file format to use as import file format by clicking on the %s icon to select it... ChooseFileToImport=Upload file then click on the %s icon to select file as source import file... SourceFileFormat=Lähtefaili formaat diff --git a/htdocs/langs/eu_ES/deliveries.lang b/htdocs/langs/eu_ES/deliveries.lang index 1f48c01de75..cd8a36e6c70 100644 --- a/htdocs/langs/eu_ES/deliveries.lang +++ b/htdocs/langs/eu_ES/deliveries.lang @@ -27,5 +27,7 @@ Recipient=Recipient ErrorStockIsNotEnough=There's not enough stock Shippable=Shippable NonShippable=Not Shippable +ShowShippableStatus=Show shippable status ShowReceiving=Show delivery receipt NonExistentOrder=Nonexistent order +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/eu_ES/exports.lang b/htdocs/langs/eu_ES/exports.lang index bcb14df4934..15648132025 100644 --- a/htdocs/langs/eu_ES/exports.lang +++ b/htdocs/langs/eu_ES/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Type of line (0=product, 1=service) FileWithDataToImport=File with data to import FileToImport=Source file to import FileMustHaveOneOfFollowingFormat=File to import must have one of following formats -DownloadEmptyExample=Download template file with field content information (* are mandatory fields) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Choose the file format to use as import file format by clicking on the %s icon to select it... ChooseFileToImport=Upload file then click on the %s icon to select file as source import file... SourceFileFormat=Source file format diff --git a/htdocs/langs/fa_IR/deliveries.lang b/htdocs/langs/fa_IR/deliveries.lang index 9874e159bd4..212ff06390f 100644 --- a/htdocs/langs/fa_IR/deliveries.lang +++ b/htdocs/langs/fa_IR/deliveries.lang @@ -27,5 +27,7 @@ Recipient=دریافت کننده ErrorStockIsNotEnough=این سهام به اندازه کافی وجود ندارد Shippable=حمل و نقلی NonShippable=حمل و نقلی نیست +ShowShippableStatus=Show shippable status ShowReceiving=نمایش رسید تحویل NonExistentOrder=سفارش ناقص +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/fa_IR/exports.lang b/htdocs/langs/fa_IR/exports.lang index c514c0638f1..d7f97893e3d 100644 --- a/htdocs/langs/fa_IR/exports.lang +++ b/htdocs/langs/fa_IR/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=نوع سطر (0 = محصول، 1 = خدمات) FileWithDataToImport=فایل حاوی داده برای وارد کردن FileToImport=فایل منبع برای واردکردن FileMustHaveOneOfFollowingFormat=فایلی که وارد می‌شود باید یکی از انواع زیر باشد -DownloadEmptyExample=دریافت فایل قالب با اطلاعات محتوای بخش‌ها ( * بخش‌های الزامی است) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=انتخاب نوع فایل برای استفاده به‌عنوان فایل واردات با کلیک بر روی نمادک %s برای انتخاب آن ... ChooseFileToImport=فایل را بالاگذاری کرده و سپس روی نشانک %s کلیک کرده تا به‌عنوان فایل منبع واردات استفاده شود. SourceFileFormat=نوع فایل منبع diff --git a/htdocs/langs/fi_FI/deliveries.lang b/htdocs/langs/fi_FI/deliveries.lang index abae1108dc9..57f53382a71 100644 --- a/htdocs/langs/fi_FI/deliveries.lang +++ b/htdocs/langs/fi_FI/deliveries.lang @@ -27,5 +27,7 @@ Recipient=Vastaanottaja ErrorStockIsNotEnough=Varaston saldo ei riitä Shippable=Toimitettavissa NonShippable=Ei toimitettavissa +ShowShippableStatus=Show shippable status ShowReceiving=Näytä lähetyslista NonExistentOrder=Tilausta ei ole järjestelmässä +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/fi_FI/exports.lang b/htdocs/langs/fi_FI/exports.lang index 446bb468010..c97b7b37722 100644 --- a/htdocs/langs/fi_FI/exports.lang +++ b/htdocs/langs/fi_FI/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Type of line (0= tuotteen, 1= palvelu) FileWithDataToImport=Tiedoston tiedot tuoda FileToImport=Lähdetiedostoa tuoda FileMustHaveOneOfFollowingFormat=File to import must have one of following formats -DownloadEmptyExample=Download template file with field content information (* are mandatory fields) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Choose the file format to use as import file format by clicking on the %s icon to select it... ChooseFileToImport=Upload file then click on the %s icon to select file as source import file... SourceFileFormat=Lähde tiedostomuoto diff --git a/htdocs/langs/fr_BE/admin.lang b/htdocs/langs/fr_BE/admin.lang index 5d24a311ccd..96140bd1362 100644 --- a/htdocs/langs/fr_BE/admin.lang +++ b/htdocs/langs/fr_BE/admin.lang @@ -17,5 +17,6 @@ IfModuleEnabled=Note: oui ne fonctionne que si le module %s est activé Module20Name=Propales Module30Name=Factures Target=Objectif +ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or a software interface installed on the same computer as the browser, and called when you click on a link in your browser that starts with "tel:". If you need a full server solution (no need of local software installation), you must set this to "No" and fill next field. OperationParamDesc=Define the values to use for the object of the action, or how to extract values. For example:
    objproperty1=SET:the value to set
    objproperty2=SET:a value with replacement of __objproperty1__
    objproperty3=SETIFEMPTY:value used if objproperty3 is not already defined
    objproperty4=EXTRACT:HEADER:X-Myheaderkey:\\s*([^\\s]*)
    options_myextrafield1=EXTRACT:SUBJECT:([^\n]*)
    object.objproperty5=EXTRACT:BODY:My company name is\\s([^\\s]*)

    Use a ; char as separator to extract or set several properties. EmailCollectorLoadThirdPartyHelp=You can use this action to use the email content to find and load an existing thirdparty in your database. The found (or created) thirdparty will be used for following actions that need it. In the parameter field you can use for example 'EXTRACT:BODY:Name:\\s([^\\s]*)' if you want to extract the name of the thirdparty from a string 'Name: name to find' found into the body. diff --git a/htdocs/langs/fr_BE/salaries.lang b/htdocs/langs/fr_BE/salaries.lang new file mode 100644 index 00000000000..c9bd3bec17b --- /dev/null +++ b/htdocs/langs/fr_BE/salaries.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - salaries +LastSalaries=Latest %s salary payments +AllSalaries=All salary payments diff --git a/htdocs/langs/fr_BE/users.lang b/htdocs/langs/fr_BE/users.lang new file mode 100644 index 00000000000..4a412122b08 --- /dev/null +++ b/htdocs/langs/fr_BE/users.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - users +NbOfUsers=No. of users +NbOfPermissions=No. of permissions diff --git a/htdocs/langs/fr_BE/website.lang b/htdocs/langs/fr_BE/website.lang new file mode 100644 index 00000000000..910cff6b702 --- /dev/null +++ b/htdocs/langs/fr_BE/website.lang @@ -0,0 +1,2 @@ +# Dolibarr language file - Source file is en_US - website +PreviewOfSiteNotYetAvailable=Preview of your website %s not yet available. You must first 'Import a full website template' or just 'Add a page/container'. diff --git a/htdocs/langs/fr_CA/admin.lang b/htdocs/langs/fr_CA/admin.lang index 61a863bf5a2..98e4baf170d 100644 --- a/htdocs/langs/fr_CA/admin.lang +++ b/htdocs/langs/fr_CA/admin.lang @@ -177,6 +177,7 @@ OptionVatMode=TPS/TVH due AGENDA_SHOW_LINKED_OBJECT=Afficher l'objet lié dans la vue d'agenda ClickToDialUrlDesc=Url appelle quand un clic sur le picto du téléphone est terminé. Dans l'URL, vous pouvez utiliser des tags sur __ PHONETO __ qui sera remplacé par le numéro de téléphone de la personne à appeler __ PHONEFROM __ qui sera remplacé par le numéro de téléphone de l'appel Personne (votre)
    __ LOGIN __ qui sera remplacé par login clicktodial (défini sur la carte utilisateur)
    __ PASS __ qui sera remplacé par le mot de passe clicktodial (défini sur l'utilisateur carte). ClickToDialUseTelLink=Utilisez juste un lien "tel: " sur les numéros de téléphone +ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or a software interface installed on the same computer as the browser, and called when you click on a link in your browser that starts with "tel:". If you need a full server solution (no need of local software installation), you must set this to "No" and fill next field. EndPointIs=Les clients SOAP doivent envoyer leurs demandes au point d'extrémité Dolibarr disponible à l'URL ApiSetup=Configuration du module API ApiDesc=En activant ce module , Dolibarr devenir un serveur REST pour fournir des services Web divers . diff --git a/htdocs/langs/fr_CA/products.lang b/htdocs/langs/fr_CA/products.lang index 947742b3356..6e3f9b4042e 100644 --- a/htdocs/langs/fr_CA/products.lang +++ b/htdocs/langs/fr_CA/products.lang @@ -120,7 +120,6 @@ ResetBarcodeForAllRecords=Définissez la valeur du code-barres pour tous les enr PriceByCustomer=Différents prix pour chaque client PriceCatalogue=Un prix de vente unique par produit / service AddCustomerPrice=Ajouter un prix par client -ForceUpdateChildPriceSoc=Définir le même prix sur les filiales clientes PriceByCustomerLog=Enregistrement des prix clients précédents MinimumPriceLimit=Le prix minimum ne peut pas être inférieur à %s PriceExpressionSelected=Expression de prix choisie diff --git a/htdocs/langs/fr_CA/users.lang b/htdocs/langs/fr_CA/users.lang index 81db7ef3370..e38af3483dc 100644 --- a/htdocs/langs/fr_CA/users.lang +++ b/htdocs/langs/fr_CA/users.lang @@ -10,3 +10,5 @@ LastUsersCreated=Derniers %s utilisateurs créés ConfirmCreateContact=Êtes-vous sûr de vouloir créer un compte Dolibarr pour ce contact? ConfirmCreateLogin=Êtes-vous sûr de vouloir créer un compte Dolibarr pour ce membre? ConfirmCreateThirdParty=Êtes-vous sûr de vouloir créer un tiers pour ce membre? +NbOfUsers=No. of users +NbOfPermissions=No. of permissions diff --git a/htdocs/langs/fr_CA/website.lang b/htdocs/langs/fr_CA/website.lang index 5255b2f9da5..f37354f9d32 100644 --- a/htdocs/langs/fr_CA/website.lang +++ b/htdocs/langs/fr_CA/website.lang @@ -4,6 +4,7 @@ WEBSITE_PAGENAME=Nom / alias de la page WEBSITE_CSS_URL=URL du fichier CSS externe MediaFiles=Médiathèque EditMenu=Menu Edition +PreviewOfSiteNotYetAvailable=Preview of your website %s not yet available. You must first 'Import a full website template' or just 'Add a page/container'. ViewSiteInNewTab=Afficher le site dans un nouvel onglet ViewPageInNewTab=Afficher la page dans un nouvel onglet ViewWebsiteInProduction=Afficher le site Web à l'aide d'URL d'accueil diff --git a/htdocs/langs/fr_CH/admin.lang b/htdocs/langs/fr_CH/admin.lang index c1d306ec390..25265594de5 100644 --- a/htdocs/langs/fr_CH/admin.lang +++ b/htdocs/langs/fr_CH/admin.lang @@ -1,3 +1,4 @@ # Dolibarr language file - Source file is en_US - admin +ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or a software interface installed on the same computer as the browser, and called when you click on a link in your browser that starts with "tel:". If you need a full server solution (no need of local software installation), you must set this to "No" and fill next field. OperationParamDesc=Define the values to use for the object of the action, or how to extract values. For example:
    objproperty1=SET:the value to set
    objproperty2=SET:a value with replacement of __objproperty1__
    objproperty3=SETIFEMPTY:value used if objproperty3 is not already defined
    objproperty4=EXTRACT:HEADER:X-Myheaderkey:\\s*([^\\s]*)
    options_myextrafield1=EXTRACT:SUBJECT:([^\n]*)
    object.objproperty5=EXTRACT:BODY:My company name is\\s([^\\s]*)

    Use a ; char as separator to extract or set several properties. EmailCollectorLoadThirdPartyHelp=You can use this action to use the email content to find and load an existing thirdparty in your database. The found (or created) thirdparty will be used for following actions that need it. In the parameter field you can use for example 'EXTRACT:BODY:Name:\\s([^\\s]*)' if you want to extract the name of the thirdparty from a string 'Name: name to find' found into the body. diff --git a/htdocs/langs/fr_CH/salaries.lang b/htdocs/langs/fr_CH/salaries.lang new file mode 100644 index 00000000000..c9bd3bec17b --- /dev/null +++ b/htdocs/langs/fr_CH/salaries.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - salaries +LastSalaries=Latest %s salary payments +AllSalaries=All salary payments diff --git a/htdocs/langs/fr_CH/users.lang b/htdocs/langs/fr_CH/users.lang new file mode 100644 index 00000000000..4a412122b08 --- /dev/null +++ b/htdocs/langs/fr_CH/users.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - users +NbOfUsers=No. of users +NbOfPermissions=No. of permissions diff --git a/htdocs/langs/fr_CH/website.lang b/htdocs/langs/fr_CH/website.lang new file mode 100644 index 00000000000..910cff6b702 --- /dev/null +++ b/htdocs/langs/fr_CH/website.lang @@ -0,0 +1,2 @@ +# Dolibarr language file - Source file is en_US - website +PreviewOfSiteNotYetAvailable=Preview of your website %s not yet available. You must first 'Import a full website template' or just 'Add a page/container'. diff --git a/htdocs/langs/fr_CI/admin.lang b/htdocs/langs/fr_CI/admin.lang index c1d306ec390..25265594de5 100644 --- a/htdocs/langs/fr_CI/admin.lang +++ b/htdocs/langs/fr_CI/admin.lang @@ -1,3 +1,4 @@ # Dolibarr language file - Source file is en_US - admin +ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or a software interface installed on the same computer as the browser, and called when you click on a link in your browser that starts with "tel:". If you need a full server solution (no need of local software installation), you must set this to "No" and fill next field. OperationParamDesc=Define the values to use for the object of the action, or how to extract values. For example:
    objproperty1=SET:the value to set
    objproperty2=SET:a value with replacement of __objproperty1__
    objproperty3=SETIFEMPTY:value used if objproperty3 is not already defined
    objproperty4=EXTRACT:HEADER:X-Myheaderkey:\\s*([^\\s]*)
    options_myextrafield1=EXTRACT:SUBJECT:([^\n]*)
    object.objproperty5=EXTRACT:BODY:My company name is\\s([^\\s]*)

    Use a ; char as separator to extract or set several properties. EmailCollectorLoadThirdPartyHelp=You can use this action to use the email content to find and load an existing thirdparty in your database. The found (or created) thirdparty will be used for following actions that need it. In the parameter field you can use for example 'EXTRACT:BODY:Name:\\s([^\\s]*)' if you want to extract the name of the thirdparty from a string 'Name: name to find' found into the body. diff --git a/htdocs/langs/fr_CI/salaries.lang b/htdocs/langs/fr_CI/salaries.lang new file mode 100644 index 00000000000..c9bd3bec17b --- /dev/null +++ b/htdocs/langs/fr_CI/salaries.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - salaries +LastSalaries=Latest %s salary payments +AllSalaries=All salary payments diff --git a/htdocs/langs/fr_CI/users.lang b/htdocs/langs/fr_CI/users.lang new file mode 100644 index 00000000000..4a412122b08 --- /dev/null +++ b/htdocs/langs/fr_CI/users.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - users +NbOfUsers=No. of users +NbOfPermissions=No. of permissions diff --git a/htdocs/langs/fr_CI/website.lang b/htdocs/langs/fr_CI/website.lang new file mode 100644 index 00000000000..910cff6b702 --- /dev/null +++ b/htdocs/langs/fr_CI/website.lang @@ -0,0 +1,2 @@ +# Dolibarr language file - Source file is en_US - website +PreviewOfSiteNotYetAvailable=Preview of your website %s not yet available. You must first 'Import a full website template' or just 'Add a page/container'. diff --git a/htdocs/langs/fr_CM/admin.lang b/htdocs/langs/fr_CM/admin.lang index c1d306ec390..25265594de5 100644 --- a/htdocs/langs/fr_CM/admin.lang +++ b/htdocs/langs/fr_CM/admin.lang @@ -1,3 +1,4 @@ # Dolibarr language file - Source file is en_US - admin +ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or a software interface installed on the same computer as the browser, and called when you click on a link in your browser that starts with "tel:". If you need a full server solution (no need of local software installation), you must set this to "No" and fill next field. OperationParamDesc=Define the values to use for the object of the action, or how to extract values. For example:
    objproperty1=SET:the value to set
    objproperty2=SET:a value with replacement of __objproperty1__
    objproperty3=SETIFEMPTY:value used if objproperty3 is not already defined
    objproperty4=EXTRACT:HEADER:X-Myheaderkey:\\s*([^\\s]*)
    options_myextrafield1=EXTRACT:SUBJECT:([^\n]*)
    object.objproperty5=EXTRACT:BODY:My company name is\\s([^\\s]*)

    Use a ; char as separator to extract or set several properties. EmailCollectorLoadThirdPartyHelp=You can use this action to use the email content to find and load an existing thirdparty in your database. The found (or created) thirdparty will be used for following actions that need it. In the parameter field you can use for example 'EXTRACT:BODY:Name:\\s([^\\s]*)' if you want to extract the name of the thirdparty from a string 'Name: name to find' found into the body. diff --git a/htdocs/langs/fr_CM/salaries.lang b/htdocs/langs/fr_CM/salaries.lang new file mode 100644 index 00000000000..c9bd3bec17b --- /dev/null +++ b/htdocs/langs/fr_CM/salaries.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - salaries +LastSalaries=Latest %s salary payments +AllSalaries=All salary payments diff --git a/htdocs/langs/fr_CM/users.lang b/htdocs/langs/fr_CM/users.lang new file mode 100644 index 00000000000..4a412122b08 --- /dev/null +++ b/htdocs/langs/fr_CM/users.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - users +NbOfUsers=No. of users +NbOfPermissions=No. of permissions diff --git a/htdocs/langs/fr_CM/website.lang b/htdocs/langs/fr_CM/website.lang new file mode 100644 index 00000000000..910cff6b702 --- /dev/null +++ b/htdocs/langs/fr_CM/website.lang @@ -0,0 +1,2 @@ +# Dolibarr language file - Source file is en_US - website +PreviewOfSiteNotYetAvailable=Preview of your website %s not yet available. You must first 'Import a full website template' or just 'Add a page/container'. diff --git a/htdocs/langs/fr_FR/compta.lang b/htdocs/langs/fr_FR/compta.lang index 6ee3e204b0a..4628673fd9e 100644 --- a/htdocs/langs/fr_FR/compta.lang +++ b/htdocs/langs/fr_FR/compta.lang @@ -286,9 +286,9 @@ ReportPurchaseTurnover=Chiffre d'affaires d'achat facturé ReportPurchaseTurnoverCollected=Chiffre d'affaires d'achat encaissé IncludeVarpaysInResults = Inclure les paiements divers dans les rapports IncludeLoansInResults = Inclure les prêts dans les rapports -InvoiceLate30Days = Factures impayés à échéance dépassé de plus de 30 jours -InvoiceLate15Days = Factures impayés à échéance dépassé de plus de 15 jours +InvoiceLate30Days = Factures en retard > 30 jours +InvoiceLate15Days = Factures en retard > 15 jours InvoiceLateMinus15Days = Factures en retard -InvoiceNotLate = Règlements à recevoir dans moins de 15 jours -InvoiceNotLate15Days = Règlements à recevoir dans 15 jours -InvoiceNotLate30Days = Règlements à recevoir dans les 30 jours +InvoiceNotLate = A recevoir < 15 jours +InvoiceNotLate15Days = A recevoir dans 15 jours +InvoiceNotLate30Days = A recevoir dans 30 jours diff --git a/htdocs/langs/fr_FR/exports.lang b/htdocs/langs/fr_FR/exports.lang index c3c426daf4e..8f9c38a45dd 100644 --- a/htdocs/langs/fr_FR/exports.lang +++ b/htdocs/langs/fr_FR/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Type de ligne (0=produit, 1=service) FileWithDataToImport=Fichier contenant les données à importer FileToImport=Fichier source à importer FileMustHaveOneOfFollowingFormat=Le fichier à importer doit avoir un des formats suivants -DownloadEmptyExample=Télécharger fichier vierge exemple (* sont les champs obligatoires) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Choisissez le format de fichier à importer en cliquant sur le pictogramme %s pour le sélectionner… ChooseFileToImport=Ajoutez le fichier à importer puis cliquez sur le pictogramme %s pour le sélectionner comme fichier source d'import… SourceFileFormat=Format du fichier source diff --git a/htdocs/langs/fr_GA/admin.lang b/htdocs/langs/fr_GA/admin.lang index 8c6135dc874..6455856627f 100644 --- a/htdocs/langs/fr_GA/admin.lang +++ b/htdocs/langs/fr_GA/admin.lang @@ -1,5 +1,6 @@ # Dolibarr language file - Source file is en_US - admin Module20Name=Devis Module30Name=Factures +ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or a software interface installed on the same computer as the browser, and called when you click on a link in your browser that starts with "tel:". If you need a full server solution (no need of local software installation), you must set this to "No" and fill next field. OperationParamDesc=Define the values to use for the object of the action, or how to extract values. For example:
    objproperty1=SET:the value to set
    objproperty2=SET:a value with replacement of __objproperty1__
    objproperty3=SETIFEMPTY:value used if objproperty3 is not already defined
    objproperty4=EXTRACT:HEADER:X-Myheaderkey:\\s*([^\\s]*)
    options_myextrafield1=EXTRACT:SUBJECT:([^\n]*)
    object.objproperty5=EXTRACT:BODY:My company name is\\s([^\\s]*)

    Use a ; char as separator to extract or set several properties. EmailCollectorLoadThirdPartyHelp=You can use this action to use the email content to find and load an existing thirdparty in your database. The found (or created) thirdparty will be used for following actions that need it. In the parameter field you can use for example 'EXTRACT:BODY:Name:\\s([^\\s]*)' if you want to extract the name of the thirdparty from a string 'Name: name to find' found into the body. diff --git a/htdocs/langs/fr_GA/salaries.lang b/htdocs/langs/fr_GA/salaries.lang new file mode 100644 index 00000000000..c9bd3bec17b --- /dev/null +++ b/htdocs/langs/fr_GA/salaries.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - salaries +LastSalaries=Latest %s salary payments +AllSalaries=All salary payments diff --git a/htdocs/langs/fr_GA/users.lang b/htdocs/langs/fr_GA/users.lang new file mode 100644 index 00000000000..4a412122b08 --- /dev/null +++ b/htdocs/langs/fr_GA/users.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - users +NbOfUsers=No. of users +NbOfPermissions=No. of permissions diff --git a/htdocs/langs/fr_GA/website.lang b/htdocs/langs/fr_GA/website.lang new file mode 100644 index 00000000000..910cff6b702 --- /dev/null +++ b/htdocs/langs/fr_GA/website.lang @@ -0,0 +1,2 @@ +# Dolibarr language file - Source file is en_US - website +PreviewOfSiteNotYetAvailable=Preview of your website %s not yet available. You must first 'Import a full website template' or just 'Add a page/container'. diff --git a/htdocs/langs/gl_ES/deliveries.lang b/htdocs/langs/gl_ES/deliveries.lang index 49996ef672a..60e8ca17833 100644 --- a/htdocs/langs/gl_ES/deliveries.lang +++ b/htdocs/langs/gl_ES/deliveries.lang @@ -30,3 +30,4 @@ NonShippable=Non enviable ShowShippableStatus=Amosar estado de envío ShowReceiving=Mostrar nota de recepción NonExistentOrder=Pedimento inexistente +StockQuantitiesAlreadyAllocatedOnPreviousLines = Cantidades de stock xa asignadas en liñas anteriores diff --git a/htdocs/langs/gl_ES/exports.lang b/htdocs/langs/gl_ES/exports.lang index aeb080ad0b7..49bed28e022 100644 --- a/htdocs/langs/gl_ES/exports.lang +++ b/htdocs/langs/gl_ES/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Tipo de liña (0=producto, 1=servizo) FileWithDataToImport=Ficheiro cos datos a importar FileToImport=Ficheiro orixe a importar FileMustHaveOneOfFollowingFormat=O ficheiro de importación debe conter un dos seguintes formatos -DownloadEmptyExample=Descargar ficheiro de exemplo baleiro +DownloadEmptyExample=Descargue un ficheiro de modelo con información de contido do campo +StarAreMandatory=* son campos obrigatorios ChooseFormatOfFileToImport=Escolla o formato de ficheiro que desexa importar e prema na imaxe %s para seleccionalo... ChooseFileToImport=Escolla o ficheiro de importación e faga clic na imaxe %s para seleccionalo como ficheiro orixe de importación... SourceFileFormat=Formato do ficheiro orixe diff --git a/htdocs/langs/he_IL/deliveries.lang b/htdocs/langs/he_IL/deliveries.lang index 1f48c01de75..cd8a36e6c70 100644 --- a/htdocs/langs/he_IL/deliveries.lang +++ b/htdocs/langs/he_IL/deliveries.lang @@ -27,5 +27,7 @@ Recipient=Recipient ErrorStockIsNotEnough=There's not enough stock Shippable=Shippable NonShippable=Not Shippable +ShowShippableStatus=Show shippable status ShowReceiving=Show delivery receipt NonExistentOrder=Nonexistent order +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/he_IL/exports.lang b/htdocs/langs/he_IL/exports.lang index a0eb7161ef2..cb652229825 100644 --- a/htdocs/langs/he_IL/exports.lang +++ b/htdocs/langs/he_IL/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Type of line (0=product, 1=service) FileWithDataToImport=File with data to import FileToImport=Source file to import FileMustHaveOneOfFollowingFormat=File to import must have one of following formats -DownloadEmptyExample=Download template file with field content information (* are mandatory fields) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Choose the file format to use as import file format by clicking on the %s icon to select it... ChooseFileToImport=Upload file then click on the %s icon to select file as source import file... SourceFileFormat=Source file format diff --git a/htdocs/langs/hi_IN/deliveries.lang b/htdocs/langs/hi_IN/deliveries.lang index 1f48c01de75..cd8a36e6c70 100644 --- a/htdocs/langs/hi_IN/deliveries.lang +++ b/htdocs/langs/hi_IN/deliveries.lang @@ -27,5 +27,7 @@ Recipient=Recipient ErrorStockIsNotEnough=There's not enough stock Shippable=Shippable NonShippable=Not Shippable +ShowShippableStatus=Show shippable status ShowReceiving=Show delivery receipt NonExistentOrder=Nonexistent order +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/hi_IN/exports.lang b/htdocs/langs/hi_IN/exports.lang index a0eb7161ef2..cb652229825 100644 --- a/htdocs/langs/hi_IN/exports.lang +++ b/htdocs/langs/hi_IN/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Type of line (0=product, 1=service) FileWithDataToImport=File with data to import FileToImport=Source file to import FileMustHaveOneOfFollowingFormat=File to import must have one of following formats -DownloadEmptyExample=Download template file with field content information (* are mandatory fields) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Choose the file format to use as import file format by clicking on the %s icon to select it... ChooseFileToImport=Upload file then click on the %s icon to select file as source import file... SourceFileFormat=Source file format diff --git a/htdocs/langs/hr_HR/deliveries.lang b/htdocs/langs/hr_HR/deliveries.lang index b74558fbdd7..56123a13cd5 100644 --- a/htdocs/langs/hr_HR/deliveries.lang +++ b/htdocs/langs/hr_HR/deliveries.lang @@ -27,5 +27,7 @@ Recipient=Primatelj ErrorStockIsNotEnough=Nema dovoljno robe na skladištu Shippable=Isporuka moguća NonShippable=Isporuka nije moguća +ShowShippableStatus=Show shippable status ShowReceiving=Prikaži dostavnu primku NonExistentOrder=Nonexistent order +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/hr_HR/exports.lang b/htdocs/langs/hr_HR/exports.lang index f214e7f85dd..c9238c0cdcf 100644 --- a/htdocs/langs/hr_HR/exports.lang +++ b/htdocs/langs/hr_HR/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Type of line (0=product, 1=service) FileWithDataToImport=File with data to import FileToImport=Source file to import FileMustHaveOneOfFollowingFormat=File to import must have one of following formats -DownloadEmptyExample=Download template file with field content information (* are mandatory fields) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Choose the file format to use as import file format by clicking on the %s icon to select it... ChooseFileToImport=Upload file then click on the %s icon to select file as source import file... SourceFileFormat=Source file format diff --git a/htdocs/langs/hu_HU/deliveries.lang b/htdocs/langs/hu_HU/deliveries.lang index f7656297b0f..c907a121477 100644 --- a/htdocs/langs/hu_HU/deliveries.lang +++ b/htdocs/langs/hu_HU/deliveries.lang @@ -27,5 +27,7 @@ Recipient=Címzett ErrorStockIsNotEnough=Nincs elég raktáron Shippable=Szállítható NonShippable=Nem szállítható +ShowShippableStatus=Show shippable status ShowReceiving=Mutassa az átvételi elismervényt NonExistentOrder=Nem létező megrendelés +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/hu_HU/exports.lang b/htdocs/langs/hu_HU/exports.lang index 207e255a0f7..c8945321c10 100644 --- a/htdocs/langs/hu_HU/exports.lang +++ b/htdocs/langs/hu_HU/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Vonal típusa (0 = a termék, 1 = szolgáltatás) FileWithDataToImport=File adatokat importálni FileToImport=Forrás fájlt importálni FileMustHaveOneOfFollowingFormat=File to import must have one of following formats -DownloadEmptyExample=Download template file with field content information (* are mandatory fields) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Choose the file format to use as import file format by clicking on the %s icon to select it... ChooseFileToImport=Upload file then click on the %s icon to select file as source import file... SourceFileFormat=Forrás fájlformátum diff --git a/htdocs/langs/id_ID/deliveries.lang b/htdocs/langs/id_ID/deliveries.lang index e04f7ef16e6..ef3921e9540 100644 --- a/htdocs/langs/id_ID/deliveries.lang +++ b/htdocs/langs/id_ID/deliveries.lang @@ -27,5 +27,7 @@ Recipient=Penerima ErrorStockIsNotEnough=Tidak ada stok yang cukup Shippable=Dapat dikirim NonShippable=Tidak Dapat Dikirim +ShowShippableStatus=Show shippable status ShowReceiving=Tampilkan tanda terima pengiriman NonExistentOrder=Pesanan tidak ada +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/id_ID/exports.lang b/htdocs/langs/id_ID/exports.lang index 39cc5685c18..85901957857 100644 --- a/htdocs/langs/id_ID/exports.lang +++ b/htdocs/langs/id_ID/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Jenis garis (0 = produk, 1 = layanan) FileWithDataToImport=File dengan data untuk diimpor FileToImport=Sumber file untuk diimpor FileMustHaveOneOfFollowingFormat=File yang akan diimpor harus memiliki salah satu format berikut -DownloadEmptyExample=Unduh file template dengan informasi konten bidang (* adalah bidang wajib) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Pilih format file untuk digunakan sebagai format file impor dengan mengklik ikon %s untuk memilihnya ... ChooseFileToImport=Unggah file kemudian klik ikon %s untuk memilih file sebagai file impor sumber ... SourceFileFormat=Format file sumber diff --git a/htdocs/langs/is_IS/deliveries.lang b/htdocs/langs/is_IS/deliveries.lang index 74a29497802..3d037b8919e 100644 --- a/htdocs/langs/is_IS/deliveries.lang +++ b/htdocs/langs/is_IS/deliveries.lang @@ -27,5 +27,7 @@ Recipient=Viðtakandi ErrorStockIsNotEnough=There's not enough stock Shippable=Shippable NonShippable=Not Shippable +ShowShippableStatus=Show shippable status ShowReceiving=Show delivery receipt NonExistentOrder=Nonexistent order +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/is_IS/exports.lang b/htdocs/langs/is_IS/exports.lang index a9f6a31bddf..05defcccffc 100644 --- a/htdocs/langs/is_IS/exports.lang +++ b/htdocs/langs/is_IS/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Tegund línu (0 = vara, 1 = þjónustu) FileWithDataToImport=Skrá með upplýsingum til að flytja inn FileToImport=Frumskrár að flytja inn FileMustHaveOneOfFollowingFormat=File to import must have one of following formats -DownloadEmptyExample=Download template file with field content information (* are mandatory fields) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Choose the file format to use as import file format by clicking on the %s icon to select it... ChooseFileToImport=Upload file then click on the %s icon to select file as source import file... SourceFileFormat=Heimild skráarsnið diff --git a/htdocs/langs/it_CH/salaries.lang b/htdocs/langs/it_CH/salaries.lang new file mode 100644 index 00000000000..c9bd3bec17b --- /dev/null +++ b/htdocs/langs/it_CH/salaries.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - salaries +LastSalaries=Latest %s salary payments +AllSalaries=All salary payments diff --git a/htdocs/langs/it_CH/users.lang b/htdocs/langs/it_CH/users.lang new file mode 100644 index 00000000000..4a412122b08 --- /dev/null +++ b/htdocs/langs/it_CH/users.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - users +NbOfUsers=No. of users +NbOfPermissions=No. of permissions diff --git a/htdocs/langs/it_IT/deliveries.lang b/htdocs/langs/it_IT/deliveries.lang index a24bb962dac..723f46c4c0f 100644 --- a/htdocs/langs/it_IT/deliveries.lang +++ b/htdocs/langs/it_IT/deliveries.lang @@ -30,3 +30,4 @@ NonShippable=Non disponibile per spedizione ShowShippableStatus=Mostra lo stato di spedizione ShowReceiving=Mostra ricevuta di consegna NonExistentOrder=Ordine inesistente +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/it_IT/exports.lang b/htdocs/langs/it_IT/exports.lang index 5b616c68eaf..5a5e6dd1820 100644 --- a/htdocs/langs/it_IT/exports.lang +++ b/htdocs/langs/it_IT/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Linea tipo (0 = prodotto, servizio = 1) FileWithDataToImport=File con i dati da importare FileToImport=File da importare FileMustHaveOneOfFollowingFormat=File da importare deve avere uno dei seguenti formati -DownloadEmptyExample=Download esempio di fonte file vuoto +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Scegliete il formato di file da utilizzare per l'importazione cliccando sull'icona %s ChooseFileToImport=Scegli il file da importare e poi clicca sull'icona %s SourceFileFormat=Fonte formato di file diff --git a/htdocs/langs/ja_JP/accountancy.lang b/htdocs/langs/ja_JP/accountancy.lang index f398117d37c..bf9dc355840 100644 --- a/htdocs/langs/ja_JP/accountancy.lang +++ b/htdocs/langs/ja_JP/accountancy.lang @@ -48,7 +48,8 @@ CountriesNotInEEC=EECにない国 CountriesInEECExceptMe=%sを除くEECの国 CountriesExceptMe=%sを除くすべての国 AccountantFiles=ソースドキュメントのエクスポート -ExportAccountingSourceDocHelp=このツールを使用すると、会計処理の生成に使用されたソースイベント(リストとPDF)をエクスポートできる。仕訳をエクスポートするには、メニューエントリ%s-%sを使用する。 +ExportAccountingSourceDocHelp=このツールを使用すると、会計の生成に使用されたソースイベント(CSVおよびPDFのリスト)をエクスポートできる。 +ExportAccountingSourceDocHelp2=ジャーナルをエクスポートするには、メニューエントリ%s --%sを使用。 VueByAccountAccounting=会計科目順に表示 VueBySubAccountAccounting=アカウンティングサブアカウントで表示 diff --git a/htdocs/langs/ja_JP/admin.lang b/htdocs/langs/ja_JP/admin.lang index a21a12947f7..09c80dc7550 100644 --- a/htdocs/langs/ja_JP/admin.lang +++ b/htdocs/langs/ja_JP/admin.lang @@ -2144,3 +2144,4 @@ YouEnableDeprecatedWSAPIsUseRESTAPIsInstead=非推奨のWS APIが有効化され RandomlySelectedIfSeveral=画像が複数ある場合はランダムに選択 DatabasePasswordObfuscated=データベースのパスワードは conf ファイルで難読化されている DatabasePasswordNotObfuscated=データベースのパスワードは conf ファイルで難読化されていない +APIsAreNotEnabled=APIモジュールが有効になっていない diff --git a/htdocs/langs/ja_JP/deliveries.lang b/htdocs/langs/ja_JP/deliveries.lang index fd9cbcae01d..950d219d9cb 100644 --- a/htdocs/langs/ja_JP/deliveries.lang +++ b/htdocs/langs/ja_JP/deliveries.lang @@ -9,7 +9,7 @@ DeliveryStateSaved=保存された配送状態 SetDeliveryDate=出荷の日付を設定する ValidateDeliveryReceipt=配送の領収書を検証する ValidateDeliveryReceiptConfirm=この配送領収書を検証してもよいか? -DeleteDeliveryReceipt=配送済みメッセージを削除する +DeleteDeliveryReceipt=配送済メッセージを削除する DeleteDeliveryReceiptConfirm=領収書%s を削除してもよいか? DeliveryMethod=配送方法 TrackingNumber=追跡番号 @@ -27,5 +27,7 @@ Recipient=受領者 ErrorStockIsNotEnough=在庫が不足 Shippable=発送可能 NonShippable=発送不可 +ShowShippableStatus=出荷可能なステータスを表示する ShowReceiving=配送領収書を表示する NonExistentOrder=存在しない注文 +StockQuantitiesAlreadyAllocatedOnPreviousLines = 前の行にすでに割り当てられている在庫数量 diff --git a/htdocs/langs/ja_JP/exports.lang b/htdocs/langs/ja_JP/exports.lang index 326ea5ad052..ae3f4eaff99 100644 --- a/htdocs/langs/ja_JP/exports.lang +++ b/htdocs/langs/ja_JP/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=回線の種類(0 =製品、1 =サービス) FileWithDataToImport=インポートするデータを持つファイル FileToImport=インポートするソースファイル FileMustHaveOneOfFollowingFormat=インポートするファイルは、次のいずれかの形式である必要がある -DownloadEmptyExample=フィールドコンテンツ情報を含むテンプレートファイルをダウンロードする(*は必須フィールド ) +DownloadEmptyExample=フィールドコンテンツ情報を含むテンプレートファイルをダウンロードする +StarAreMandatory=*は必須フィールド ChooseFormatOfFileToImport=%sアイコンをクリックして選択し、インポートファイル形式として使用するファイル形式を選択する... ChooseFileToImport=ファイルをアップロードし、%sアイコンをクリックして、ソースインポートファイルとしてファイルを選択する。 SourceFileFormat=ソースファイルの形式 diff --git a/htdocs/langs/ja_JP/knowledgemanagement.lang b/htdocs/langs/ja_JP/knowledgemanagement.lang index cb54cb27245..db45e5e7daa 100644 --- a/htdocs/langs/ja_JP/knowledgemanagement.lang +++ b/htdocs/langs/ja_JP/knowledgemanagement.lang @@ -37,15 +37,7 @@ About = 約 KnowledgeManagementAbout = 知識管理について KnowledgeManagementAboutPage = 知識管理に関するページ -# -# Sample page -# KnowledgeManagementArea = 知識管理 - - -# -# Menu -# MenuKnowledgeRecord = 知識ベース ListKnowledgeRecord = 記事一覧 NewKnowledgeRecord = 新しい記事 @@ -53,3 +45,5 @@ ValidateReply = ソリューションを検証する KnowledgeRecords = 記事 KnowledgeRecord = 記事 KnowledgeRecordExtraFields = 記事のエクストラフィールド +GroupOfTicket=チケットのグループ +YouCanLinkArticleToATicketCategory=記事をチケットグループにリンクできる(新規チケット認定時に記事が提案されるようになる) diff --git a/htdocs/langs/ja_JP/languages.lang b/htdocs/langs/ja_JP/languages.lang index 65ea4f02be5..06b8e61f2c4 100644 --- a/htdocs/langs/ja_JP/languages.lang +++ b/htdocs/langs/ja_JP/languages.lang @@ -4,6 +4,7 @@ Language_ar_AR=アラビア語 Language_ar_EG=アラビア語(エジプト) Language_ar_SA=アラビア語 Language_ar_TN=アラビア語 (チュニジア) +Language_ar_IQ=アラビア語(イラク) Language_az_AZ=アゼルバイジャン語 Language_bn_BD=ベンガル語 Language_bn_IN=ベンガル語(インド) @@ -83,6 +84,7 @@ Language_ne_NP=ネパール語 Language_nl_BE=オランダ語 (ベルギー) Language_nl_NL=オランダ語 Language_pl_PL=ポーランド語 +Language_pt_AO=ポルトガル語(アンゴラ) Language_pt_BR=ポルトガル語 (ブラジル) Language_pt_PT=ポルトガル語 Language_ro_MD=ルーマニア語 (モルダビア) diff --git a/htdocs/langs/ja_JP/products.lang b/htdocs/langs/ja_JP/products.lang index 86f4f8816f2..486cd6736c5 100644 --- a/htdocs/langs/ja_JP/products.lang +++ b/htdocs/langs/ja_JP/products.lang @@ -277,7 +277,7 @@ PriceByCustomer=顧客ごとに異なる価格 PriceCatalogue=製品/サービスごとの単一の販売価格 PricingRule=販売価格のルール AddCustomerPrice=顧客ごとに価格を追加 -ForceUpdateChildPriceSoc=顧客子会社に同じ価格を設定する +ForceUpdateChildPriceSoc=顧客の子会社に同じ価格を設定する PriceByCustomerLog=以前の顧客価格のログ MinimumPriceLimit=最低価格は%sより低くすることはできない MinimumRecommendedPrice=最小推奨価格は次のとおり:%s @@ -296,6 +296,7 @@ ComposedProductIncDecStock=親の変更時に在庫を増減する ComposedProduct=子供向け製品 MinSupplierPrice=最小購入価格 MinCustomerPrice=最低販売価格 +NoDynamicPrice=動的価格でない DynamicPriceConfiguration=動的な価格構成 DynamicPriceDesc=数式を定義して、顧客または仕入先の価格を計算できる。このような数式では、すべての数学演算子、一部の定数および変数を使用できる。ここで、使用する変数を定義できる。変数に自動更新が必要な場合は、外部URLを定義して、Dolibarrが値を自動的に更新できるようにすることができる。 AddVariable=変数を追加 diff --git a/htdocs/langs/ja_JP/stocks.lang b/htdocs/langs/ja_JP/stocks.lang index 96bb184fe6f..7c6c6baa8c2 100644 --- a/htdocs/langs/ja_JP/stocks.lang +++ b/htdocs/langs/ja_JP/stocks.lang @@ -60,7 +60,7 @@ EnhancedValueOfWarehouses=倉庫の値 UserWarehouseAutoCreate=ユーザーの作成時にユーザー倉庫を自動的に作成する AllowAddLimitStockByWarehouse=製品ごとの最小在庫と希望在庫の値に加えて、ペアリングごとの最小在庫と希望在庫の値(製品倉庫)も管理する。 RuleForWarehouse=倉庫のルール -WarehouseAskWarehouseOnThirparty=取引先に倉庫を設定する +WarehouseAskWarehouseOnThirparty=取引先に倉庫を設置する WarehouseAskWarehouseDuringPropal=商業提案に倉庫を設定する WarehouseAskWarehouseDuringOrder=販売注文に倉庫を設定する UserDefaultWarehouse=ユーザーに倉庫を設定する @@ -167,8 +167,8 @@ MovementTransferStock=製品%sの別の倉庫への在庫移転 InventoryCodeShort=Inv./Mov。コード NoPendingReceptionOnSupplierOrder=注文書が開いているため、保留中の受付はない ThisSerialAlreadyExistWithDifferentDate=ロット/シリアル 番号 (%s) は異なる賞味期限または販売期限で ( %s が見つかったが、入力したのは %s). -OpenAll=すべてのアクションに対して開く -OpenInternal=内部アクションのためにのみ開く +OpenAnyMovement=開く(全移動) +OpenInternal=オープン(内部移動のみ) UseDispatchStatus=発注書受付の製品ラインにディスパッチステータス(承認/拒否)を使用する OptionMULTIPRICESIsOn=オプション「セグメントごとのいくつかの価格」がオンになっている。これは、製品に複数の販売価格があるため、販売価値を計算できないことを意味する ProductStockWarehouseCreated=アラートの在庫制限と希望する最適在庫が正しく作成された diff --git a/htdocs/langs/ja_JP/ticket.lang b/htdocs/langs/ja_JP/ticket.lang index ac4a6290b3f..d128c8c37bc 100644 --- a/htdocs/langs/ja_JP/ticket.lang +++ b/htdocs/langs/ja_JP/ticket.lang @@ -34,7 +34,8 @@ TicketDictResolution=チケット-解決策 TicketTypeShortCOM=商業的な質問 TicketTypeShortHELP=機能的なヘルプのリクエスト -TicketTypeShortISSUE=問題、バグまたは問題 +TicketTypeShortISSUE=問題またはバグ +TicketTypeShortPROBLEM=問題 TicketTypeShortREQUEST=変更または拡張リクエスト TicketTypeShortPROJET=プロジェクト TicketTypeShortOTHER=その他 @@ -54,14 +55,15 @@ TypeContact_ticket_internal_SUPPORTTEC=割り当てられたユーザー TypeContact_ticket_external_SUPPORTCLI=顧客連絡/インシデント追跡 TypeContact_ticket_external_CONTRIBUTOR=外部寄稿者 -OriginEmail=メールソース +OriginEmail=メールレポーター Notify_TICKET_SENTBYMAIL=メールでチケットメッセージを送信する # Status Read=読む Assigned=割り当て済 InProgress=進行中 -NeedMoreInformation=情報を待っている +NeedMoreInformation=記者のフィードバック待機中 +NeedMoreInformationShort=フィードバック待機中 Answered=答えた Waiting=待っている Closed=閉じた @@ -160,7 +162,7 @@ CreatedBy=によって作成された NewTicket=新規チケット SubjectAnswerToTicket=チケットの回答 TicketTypeRequest=リクエストの種類 -TicketCategory=グループ +TicketCategory=チケット分類 SeeTicket=チケットを見る TicketMarkedAsRead=チケットは既読としてマークされている TicketReadOn=読む @@ -211,6 +213,7 @@ TicketMessageHelp=このテキストのみがチケットカードのメッセ TicketMessageSubstitutionReplacedByGenericValues=置換変数は一般的な値に置き換えられます。 TimeElapsedSince=からの経過時間 TicketTimeToRead=読み取るまでの経過時間 +TicketTimeElapsedBeforeSince=前後の経過時間 TicketContacts=連絡先チケット TicketDocumentsLinked=チケットにリンクされているドキュメント ConfirmReOpenTicket=このチケットを再度開くことを確認するか? diff --git a/htdocs/langs/ka_GE/deliveries.lang b/htdocs/langs/ka_GE/deliveries.lang index 1f48c01de75..cd8a36e6c70 100644 --- a/htdocs/langs/ka_GE/deliveries.lang +++ b/htdocs/langs/ka_GE/deliveries.lang @@ -27,5 +27,7 @@ Recipient=Recipient ErrorStockIsNotEnough=There's not enough stock Shippable=Shippable NonShippable=Not Shippable +ShowShippableStatus=Show shippable status ShowReceiving=Show delivery receipt NonExistentOrder=Nonexistent order +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/ka_GE/exports.lang b/htdocs/langs/ka_GE/exports.lang index a0eb7161ef2..cb652229825 100644 --- a/htdocs/langs/ka_GE/exports.lang +++ b/htdocs/langs/ka_GE/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Type of line (0=product, 1=service) FileWithDataToImport=File with data to import FileToImport=Source file to import FileMustHaveOneOfFollowingFormat=File to import must have one of following formats -DownloadEmptyExample=Download template file with field content information (* are mandatory fields) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Choose the file format to use as import file format by clicking on the %s icon to select it... ChooseFileToImport=Upload file then click on the %s icon to select file as source import file... SourceFileFormat=Source file format diff --git a/htdocs/langs/km_KH/deliveries.lang b/htdocs/langs/km_KH/deliveries.lang index 1f48c01de75..cd8a36e6c70 100644 --- a/htdocs/langs/km_KH/deliveries.lang +++ b/htdocs/langs/km_KH/deliveries.lang @@ -27,5 +27,7 @@ Recipient=Recipient ErrorStockIsNotEnough=There's not enough stock Shippable=Shippable NonShippable=Not Shippable +ShowShippableStatus=Show shippable status ShowReceiving=Show delivery receipt NonExistentOrder=Nonexistent order +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/km_KH/exports.lang b/htdocs/langs/km_KH/exports.lang index a0eb7161ef2..cb652229825 100644 --- a/htdocs/langs/km_KH/exports.lang +++ b/htdocs/langs/km_KH/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Type of line (0=product, 1=service) FileWithDataToImport=File with data to import FileToImport=Source file to import FileMustHaveOneOfFollowingFormat=File to import must have one of following formats -DownloadEmptyExample=Download template file with field content information (* are mandatory fields) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Choose the file format to use as import file format by clicking on the %s icon to select it... ChooseFileToImport=Upload file then click on the %s icon to select file as source import file... SourceFileFormat=Source file format diff --git a/htdocs/langs/kn_IN/deliveries.lang b/htdocs/langs/kn_IN/deliveries.lang index 1f48c01de75..cd8a36e6c70 100644 --- a/htdocs/langs/kn_IN/deliveries.lang +++ b/htdocs/langs/kn_IN/deliveries.lang @@ -27,5 +27,7 @@ Recipient=Recipient ErrorStockIsNotEnough=There's not enough stock Shippable=Shippable NonShippable=Not Shippable +ShowShippableStatus=Show shippable status ShowReceiving=Show delivery receipt NonExistentOrder=Nonexistent order +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/kn_IN/exports.lang b/htdocs/langs/kn_IN/exports.lang index a0eb7161ef2..cb652229825 100644 --- a/htdocs/langs/kn_IN/exports.lang +++ b/htdocs/langs/kn_IN/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Type of line (0=product, 1=service) FileWithDataToImport=File with data to import FileToImport=Source file to import FileMustHaveOneOfFollowingFormat=File to import must have one of following formats -DownloadEmptyExample=Download template file with field content information (* are mandatory fields) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Choose the file format to use as import file format by clicking on the %s icon to select it... ChooseFileToImport=Upload file then click on the %s icon to select file as source import file... SourceFileFormat=Source file format diff --git a/htdocs/langs/ko_KR/deliveries.lang b/htdocs/langs/ko_KR/deliveries.lang index 19a2ebe4d02..b3a63cc4e78 100644 --- a/htdocs/langs/ko_KR/deliveries.lang +++ b/htdocs/langs/ko_KR/deliveries.lang @@ -27,5 +27,7 @@ Recipient=Recipient ErrorStockIsNotEnough=There's not enough stock Shippable=Shippable NonShippable=Not Shippable +ShowShippableStatus=Show shippable status ShowReceiving=Show delivery receipt NonExistentOrder=Nonexistent order +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/ko_KR/exports.lang b/htdocs/langs/ko_KR/exports.lang index fda64411c9f..445f09b42a4 100644 --- a/htdocs/langs/ko_KR/exports.lang +++ b/htdocs/langs/ko_KR/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Type of line (0=product, 1=service) FileWithDataToImport=File with data to import FileToImport=Source file to import FileMustHaveOneOfFollowingFormat=File to import must have one of following formats -DownloadEmptyExample=Download template file with field content information (* are mandatory fields) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Choose the file format to use as import file format by clicking on the %s icon to select it... ChooseFileToImport=Upload file then click on the %s icon to select file as source import file... SourceFileFormat=Source file format diff --git a/htdocs/langs/lo_LA/deliveries.lang b/htdocs/langs/lo_LA/deliveries.lang index 1f48c01de75..cd8a36e6c70 100644 --- a/htdocs/langs/lo_LA/deliveries.lang +++ b/htdocs/langs/lo_LA/deliveries.lang @@ -27,5 +27,7 @@ Recipient=Recipient ErrorStockIsNotEnough=There's not enough stock Shippable=Shippable NonShippable=Not Shippable +ShowShippableStatus=Show shippable status ShowReceiving=Show delivery receipt NonExistentOrder=Nonexistent order +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/lo_LA/exports.lang b/htdocs/langs/lo_LA/exports.lang index a0eb7161ef2..cb652229825 100644 --- a/htdocs/langs/lo_LA/exports.lang +++ b/htdocs/langs/lo_LA/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Type of line (0=product, 1=service) FileWithDataToImport=File with data to import FileToImport=Source file to import FileMustHaveOneOfFollowingFormat=File to import must have one of following formats -DownloadEmptyExample=Download template file with field content information (* are mandatory fields) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Choose the file format to use as import file format by clicking on the %s icon to select it... ChooseFileToImport=Upload file then click on the %s icon to select file as source import file... SourceFileFormat=Source file format diff --git a/htdocs/langs/lt_LT/deliveries.lang b/htdocs/langs/lt_LT/deliveries.lang index ea5c1f3265a..0c394aef77d 100644 --- a/htdocs/langs/lt_LT/deliveries.lang +++ b/htdocs/langs/lt_LT/deliveries.lang @@ -27,5 +27,7 @@ Recipient=Gavėjas ErrorStockIsNotEnough=Nėra pakankamai atsargų Shippable=Pristatomas NonShippable=Nepristatomas +ShowShippableStatus=Show shippable status ShowReceiving=Show delivery receipt NonExistentOrder=Nonexistent order +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/lt_LT/exports.lang b/htdocs/langs/lt_LT/exports.lang index b42cd43974d..6e8e3929002 100644 --- a/htdocs/langs/lt_LT/exports.lang +++ b/htdocs/langs/lt_LT/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Eilutės tipas (0 = produktas, 1 = paslaugos) FileWithDataToImport=Failas su duomenimis importui FileToImport=Šaltinio failas importui FileMustHaveOneOfFollowingFormat=File to import must have one of following formats -DownloadEmptyExample=Download template file with field content information (* are mandatory fields) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Choose the file format to use as import file format by clicking on the %s icon to select it... ChooseFileToImport=Upload file then click on the %s icon to select file as source import file... SourceFileFormat=Šaltinio failo formatas diff --git a/htdocs/langs/lv_LV/accountancy.lang b/htdocs/langs/lv_LV/accountancy.lang index e0eeea0b8a2..ce348d56481 100644 --- a/htdocs/langs/lv_LV/accountancy.lang +++ b/htdocs/langs/lv_LV/accountancy.lang @@ -48,7 +48,8 @@ CountriesNotInEEC=Valstis, kas nav EEK valstīs CountriesInEECExceptMe=Valstis EEK, izņemot %s CountriesExceptMe=Visas valstis, izņemot %s AccountantFiles=Eksportēt pirmdokumentus -ExportAccountingSourceDocHelp=Izmantojot šo rīku, varat eksportēt avota notikumus (sarakstu un PDF failus), kas tika izmantoti grāmatvedības ģenerēšanai. Lai eksportētu žurnālus, izmantojiet izvēlnes ierakstu %s - %s. +ExportAccountingSourceDocHelp=Izmantojot šo rīku, varat eksportēt avota notikumus (sarakstu CSV un PDF formātā), kas tika izmantoti grāmatvedības ģenerēšanai. +ExportAccountingSourceDocHelp2=Lai eksportētu žurnālus, izmantojiet izvēlnes ierakstu %s - %s. VueByAccountAccounting=Skatīt pēc grāmatvedības konta VueBySubAccountAccounting=Skatīt pēc grāmatvedības apakškonta @@ -131,7 +132,7 @@ InvoiceLinesDone=Iesaistīto rēķinu līnijas ExpenseReportLines=Izdevumu atskaites līnijas, kas saistītas ExpenseReportLinesDone=Saistītās izdevumu pārskatu līnijas IntoAccount=Bind line ar grāmatvedības kontu -TotalForAccount=Total accounting account +TotalForAccount=Kopējais grāmatvedības konts Ventilate=Saistīt @@ -158,7 +159,7 @@ ACCOUNTING_LENGTH_AACCOUNT=Trešo pušu grāmatvedības kontu garums (ja iestat ACCOUNTING_MANAGE_ZERO=Atļaujiet pārvaldīt atšķirīgu skaitu nulles grāmatvedības konta beigās. Nepieciešamas dažas valstis (piemēram, Šveice). Ja iestatījums ir izslēgts (noklusējums), varat iestatīt šādus divus parametrus, lai pieprasītu lietojumprogrammai pievienot virtuālās nulles. BANK_DISABLE_DIRECT_INPUT=Atspējot tiešu darījumu reģistrāciju bankas kontā ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL=Iespējot eksporta projektu žurnālā -ACCOUNTANCY_COMBO_FOR_AUX=Enable combo list for subsidiary account (may be slow if you have a lot of third parties, break ability to search on a part of value) +ACCOUNTANCY_COMBO_FOR_AUX=Iespējot kombinēto sarakstu meitas kontam (tas var būt lēns, ja jums ir daudz trešo pušu, pārtraukt iespēju meklēt daļu vērtības) ACCOUNTING_DATE_START_BINDING=Definējiet datumu, lai sāktu iesiešanu un pārskaitīšanu grāmatvedībā. Zem šī datuma darījumi netiks pārnesti uz grāmatvedību. ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER=Pārsūtot grāmatvedību, pēc noklusējuma atlasiet periodu @@ -202,14 +203,14 @@ Docref=Atsauce LabelAccount=Konta nosaukums LabelOperation=Etiķetes darbība Sens=Virziens -AccountingDirectionHelp=For an accounting account of a customer, use Credit to record a payment you have received
    For an accounting account of a supplier, use Debit to record a payment you made +AccountingDirectionHelp=Klienta grāmatvedības kontā izmantojiet kredītu, lai reģistrētu saņemto maksājumu
    Piegādātāja grāmatvedības kontā izmantojiet Debets, lai reģistrētu veikto maksājumu LetteringCode=Burtu kods Lettering=Burti Codejournal=Žurnāls JournalLabel=Žurnāla etiķete NumPiece=Gabala numurs TransactionNumShort=Num. darījums -AccountingCategory=Custom group +AccountingCategory=Pielāgota grupa GroupByAccountAccounting=Grupēt pēc galvenās grāmatas konta GroupBySubAccountAccounting=Grupēt pēc apakšzinēja konta AccountingAccountGroupsDesc=Šeit jūs varat definēt dažas grāmatvedības kontu grupas. Tie tiks izmantoti personificētiem grāmatvedības pārskatiem. @@ -297,7 +298,7 @@ NoNewRecordSaved=Neviens ieraksts žurnālistikai nav ListOfProductsWithoutAccountingAccount=Produktu saraksts, uz kuriem nav saistīta kāds grāmatvedības konts ChangeBinding=Mainiet saites Accounted=Uzskaitīts virsgrāmatā -NotYetAccounted=Not yet accounted in the ledger +NotYetAccounted=Vēl nav uzskaitīti virsgrāmatā ShowTutorial=Rādīt apmācību NotReconciled=Nesaskaņots WarningRecordWithoutSubledgerAreExcluded=Brīdinājums: visas darbības, kurās nav definēts apakškārtas konts, tiek filtrētas un izslēgtas no šī skata @@ -328,9 +329,9 @@ ACCOUNTING_DISABLE_BINDING_ON_PURCHASES=Atspējot saistīšanu un pārsūtīšan ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS=Atspējojiet grāmatvedībā iesiešanu un pārskaitīšanu izdevumu pārskatos (grāmatvedībā netiks ņemti vērā izdevumu pārskati) ## Export -NotifiedExportDate=Notified export date (modification of the entries will not be possible) -NotifiedValidationDate=Validation of the entries (modification or deletion of the entries will not be possible) -ConfirmExportFile=Confirmation of the generation of the accounting export file ? +NotifiedExportDate=Paziņots eksporta datums (ierakstus nevarēs modificēt) +NotifiedValidationDate=Ierakstu validācija (modificēt vai dzēst ierakstus nebūs iespējams) +ConfirmExportFile=Apstiprinājums par grāmatvedības eksporta faila ģenerēšanu? ExportDraftJournal=Eksporta žurnāla projekts Modelcsv=Eksporta modulis Selectmodelcsv=Atlasiet eksporta modeli @@ -405,29 +406,29 @@ UseMenuToSetBindindManualy=Līnijas, kas vēl nav saistītas, izmantojiet izvēl ## Import ImportAccountingEntries=Grāmatvedības ieraksti -ImportAccountingEntriesFECFormat=Accounting entries - FEC format -FECFormatJournalCode=Code journal (JournalCode) -FECFormatJournalLabel=Label journal (JournalLib) -FECFormatEntryNum=Piece number (EcritureNum) -FECFormatEntryDate=Piece date (EcritureDate) -FECFormatGeneralAccountNumber=General account number (CompteNum) -FECFormatGeneralAccountLabel=General account label (CompteLib) -FECFormatSubledgerAccountNumber=Subledger account number (CompAuxNum) -FECFormatSubledgerAccountLabel=Subledger account number (CompAuxLib) +ImportAccountingEntriesFECFormat=Grāmatvedības ieraksti - FEC formāts +FECFormatJournalCode=Kodu žurnāls (JournalCode) +FECFormatJournalLabel=Iezīmju žurnāls (JournalLib) +FECFormatEntryNum=Gabala numurs (EcritureNum) +FECFormatEntryDate=Gabala datums (EcritureDate) +FECFormatGeneralAccountNumber=Vispārējais konta numurs (CompteNum) +FECFormatGeneralAccountLabel=Vispārīga konta iezīme (CompteLib) +FECFormatSubledgerAccountNumber=Zemesgrāmatas konta numurs (CompAuxNum) +FECFormatSubledgerAccountLabel=Zemesgrāmatas konta numurs (CompAuxLib) FECFormatPieceRef=Piece ref (PieceRef) -FECFormatPieceDate=Piece date creation (PieceDate) -FECFormatLabelOperation=Label operation (EcritureLib) -FECFormatDebit=Debit (Debit) -FECFormatCredit=Credit (Credit) -FECFormatReconcilableCode=Reconcilable code (EcritureLet) -FECFormatReconcilableDate=Reconcilable date (DateLet) -FECFormatValidateDate=Piece date validated (ValidDate) -FECFormatMulticurrencyAmount=Multicurrency amount (Montantdevise) -FECFormatMulticurrencyCode=Multicurrency code (Idevise) +FECFormatPieceDate=Gabala datuma izveide (PieceDate) +FECFormatLabelOperation=Etiķetes darbība (EcritureLib) +FECFormatDebit=Debets (debets) +FECFormatCredit=Kredīts (kredīts) +FECFormatReconcilableCode=Saskaņojams kods (EcritureLet) +FECFormatReconcilableDate=Samierināms datums (DateLet) +FECFormatValidateDate=Gabala datums ir validēts (ValidDate) +FECFormatMulticurrencyAmount=Daudzvalūtu summa (Montantdevise) +FECFormatMulticurrencyCode=Daudzvalūtu kods (Idevise) DateExport=Eksporta datums WarningReportNotReliable=Brīdinājums. Šis pārskats nav balstīts uz grāmatvedi, tādēļ tajā nav darījumu, kas Manuāli ir manuāli modificēts. Ja žurnāls ir atjaunināts, grāmatvedības skats ir precīzāks. ExpenseReportJournal=Izdevumu atskaites žurnāls InventoryJournal=Inventāra žurnāls -NAccounts=%s accounts +NAccounts=%s konti diff --git a/htdocs/langs/lv_LV/admin.lang b/htdocs/langs/lv_LV/admin.lang index 05a605ecedf..ae71ef1b18c 100644 --- a/htdocs/langs/lv_LV/admin.lang +++ b/htdocs/langs/lv_LV/admin.lang @@ -37,7 +37,7 @@ UnlockNewSessions=Noņemt savienojuma bloķēšanu YourSession=Jūsu sesija Sessions=Lietotāju sesijas WebUserGroup=Web servera lietotājs/grupa -PermissionsOnFiles=Permissions on files +PermissionsOnFiles=Atļaujas failiem PermissionsOnFilesInWebRoot=Atļaujas failiem tīmekļa saknes direktorijā PermissionsOnFile=Atļaujas failā %s NoSessionFound=Šķiet, ka jūsu PHP konfigurācija neļauj iekļaut aktīvās sesijas. Direktorija, kuru izmanto sesiju saglabāšanai (%s), var būt aizsargāta (piemēram, ar OS atļaujām vai PHP direktīvu open_basedir). @@ -63,8 +63,8 @@ IfModuleEnabled=Piezīme: jā, ir efektīva tikai tad, ja modulis %s ir i RemoveLock=Ja ir, noņemiet/pārdēvējiet failu %s, lai varētu izmantot atjaunināšanas/instalēšanas rīku. RestoreLock=Atjaunojiet failu %s tikai ar lasīšanas atļauju, lai atspējotu jebkādu turpmāku atjaunināšanas/instalēšanas rīka izmantošanu. SecuritySetup=Drošības iestatījumi -PHPSetup=PHP setup -OSSetup=OS setup +PHPSetup=PHP iestatīšana +OSSetup=OS iestatīšana SecurityFilesDesc=Šeit definējiet ar drošību saistītās iespējas failu augšupielādei. ErrorModuleRequirePHPVersion=Kļūda, šim modulim ir nepieciešama PHP versija %s vai augstāka ErrorModuleRequireDolibarrVersion=Kļūda, šim modulim nepieciešama Dolibarr versija %s vai augstāka @@ -157,7 +157,7 @@ SystemToolsAreaDesc=Šī sadaļa nodrošina administrēšanas funkcijas. Izmanto Purge=Tīrīt PurgeAreaDesc=Šī lapa ļauj izdzēst visus Dolibarr ģenerētos vai glabātos failus (pagaidu faili vai visi faili %s direktorijā). Šīs funkcijas izmantošana parasti nav nepieciešama. Tas tiek nodrošināts kā risinājums lietotājiem, kuru Dolibarr uztur pakalpojumu sniedzējs, kas nepiedāvā atļaujas, lai dzēstu tīmekļa servera ģenerētos failus. PurgeDeleteLogFile=Dzēsiet žurnāla failus, tostarp %s, kas definēti Syslog modulim (nav datu pazaudēšanas riska). -PurgeDeleteTemporaryFiles=Delete all log and temporary files (no risk of losing data). Parameter can be 'tempfilesold', 'logfiles' or both 'tempfilesold+logfiles'. Note: Deletion of temporary files is done only if the temp directory was created more than 24 hours ago. +PurgeDeleteTemporaryFiles=Izdzēsiet visus žurnāla un pagaidu failus (nav datu zaudēšanas riska). Parametrs var būt “tempfilesold”, “logfiles” vai abi “tempfilesold + logfiles”. Piezīme. Pagaidu failu dzēšana tiek veikta tikai tad, ja temp direktorija tika izveidota vairāk nekā pirms 24 stundām. PurgeDeleteTemporaryFilesShort=Dzēst žurnālu un pagaidu failus PurgeDeleteAllFilesInDocumentsDir=Dzēsiet visus failus direktorijā: %s .
    Tas izdzēsīs visus radītos dokumentus, kas saistīti ar elementiem (trešajām personām, rēķiniem utt.), ECM modulī augšupielādētiem failiem, datu bāzes rezerves izgāztuvēm un pagaidu failus. PurgeRunNow=Tīrīt tagad @@ -221,7 +221,7 @@ NotCompatible=Šis modulis, šķiet, nav savietojams ar jūsu Dolibarr %s (Min % CompatibleAfterUpdate=Šis modulis prasa atjaunināt Dolibarr %s (Min %s - Maks %s). SeeInMarkerPlace=Skatiet Marketplace SeeSetupOfModule=See setup of module %s -SetOptionTo=Set option %s to %s +SetOptionTo=Iestatiet opciju %s uz %s Updated=Atjaunots AchatTelechargement=Pirkt / lejupielādēt GoModuleSetupArea=Lai izvietotu / instalētu jaunu moduli, dodieties uz moduļa iestatīšanas apgabalu: %s . @@ -235,7 +235,7 @@ BoxesAvailable=Pieejamie logrīki BoxesActivated=Logrīki aktivizēti ActivateOn=Aktivizēt ActiveOn=Aktivizēts -ActivatableOn=Activatable on +ActivatableOn=Aktivizējams SourceFile=Avota fails AvailableOnlyIfJavascriptAndAjaxNotDisabled=Pieejams tikai tad, ja JavaScript nav atslēgts Required=Nepieciešams @@ -351,10 +351,10 @@ LastActivationAuthor=Jaunākais aktivizētāja autors LastActivationIP=Jaunākā aktivizācijas IP adrese UpdateServerOffline=Atjaunināšanas serveris bezsaistē WithCounter=Pārvaldīt skaitītāju -GenericMaskCodes=You may enter any numbering mask. In this mask, the following tags can be used:
    {000000} corresponds to a number which will be incremented on each %s. Enter as many zeros as the desired length of the counter. The counter will be completed by zeros from the left in order to have as many zeros as the mask.
    {000000+000} same as the previous one but an offset corresponding to the number to the right of the + sign is applied starting on the first %s.
    {000000@x} same as the previous one but the counter is reset to zero when month x is reached (x between 1 and 12, or 0 to use the early months of fiscal year defined in your configuration, or 99 to reset to zero every month). If this option is used and x is 2 or higher, then the sequence {yy}{mm} or {yyyy}{mm} is also required.
    {dd} day (01 to 31).
    {mm} month (01 to 12).
    {yy}, {yyyy} or {y} year over 2, 4 or 1 numbers.
    -GenericMaskCodes2={cccc} the client code on n characters
    {cccc000} the client code on n characters is followed by a counter dedicated to the customer. This counter dedicated to customer is reset at same time as the global counter.
    {tttt} The code of third party type on n characters (see menu Home - Setup - Dictionary - Types of third parties). If you add this tag, the counter will be different for each type of third party.
    +GenericMaskCodes=Jūs varat ievadīt jebkuru numerācijas masku. Šajā maskā var izmantot šādus tagus:
    {000000} atbilst skaitlim, kas tiks palielināts katrā %s. Ievadiet tik daudz nulles, cik vēlamais skaitītāja garums. Skaitītāju aizpildīs ar nulli no kreisās puses, lai tajā būtu tikpat daudz nulles kā maskā.
    {000000 + 000} tāds pats kā iepriekšējais, bet nobīde, kas atbilst skaitlim pa labi no zīmes +, tiek piemērota, sākot ar pirmo %s.
    {000000 @ x} tāds pats kā iepriekšējais, bet skaitītājs tiek atiestatīts uz nulli, kad ir sasniegts mēnesis x (x no 1 līdz 12, vai 0, lai izmantotu jūsu konfigurācijā definētos fiskālā gada sākuma mēnešus, vai no 99 līdz katru mēnesi atiestatīt uz nulli). Ja tiek izmantota šī opcija un x ir 2 vai lielāks, ir nepieciešama arī secība {yy} {mm} vai {gggg} {mm}.
    {dd} diena (no 01 līdz 31).
    {mm} mēnesis (no 01 līdz 12).
    {yy} , {yyyy} vai {y} a09a4b
    +GenericMaskCodes2= {cccc} klienta kods uz n rakstzīmēm
    {cccc000} a09a4b739f17fz Šis klientam veltītais skaitītājs tiek atiestatīts vienlaikus ar globālo skaitītāju.
    {tttt} Trešās puses tipa kods uz n rakstzīmēm (skatiet izvēlni Sākums - Iestatīšana - Vārdnīca - Trešo personu veidi). Ja pievienosit šo tagu, katram trešās puses tipam skaitītājs būs atšķirīgs.
    GenericMaskCodes3=Visas citas rakstzīmes masku paliks neskartas.
    Atstarpes nav atļautas.
    -GenericMaskCodes3EAN=All other characters in the mask will remain intact (except * or ? in 13th position in EAN13).
    Spaces are not allowed.
    In EAN13, the last character after the last } in 13th position should be * or ? . It will be replaced by the calculated key.
    +GenericMaskCodes3EAN=Visas pārējās maskas rakstzīmes paliks neskartas (izņemot * vai? EAN13 13. pozīcijā).
    Atstarpes nav atļautas.
    EAN13, pēdējam rakstzīmei pēc pēdējā} 13. pozīcijā jābūt * vai? . To aizstās aprēķinātā atslēga.
    GenericMaskCodes4a=Piemērs 99. %s no trešās personas TheCompany, ar datumu 2007-01-31:
    GenericMaskCodes4b=Piemērs trešā persona veidota 2007-03-01:
    GenericMaskCodes4c=Piemērs produkts veidots 2007-03-01:
    @@ -399,7 +399,7 @@ SecurityToken=Atslēga uz drošu saiti NoSmsEngine=Nav pieejams neviens SMS sūtītāja pārvaldnieks. SMS sūtītāja pārvaldnieks nav instalēts ar noklusējuma izplatīšanu, jo tie ir atkarīgi no ārēja piegādātāja, bet jūs varat atrast kādu no %s PDF=PDF PDFDesc=Globālās iespējas PDF ģenerēšanai -PDFOtherDesc=PDF Option specific to some modules +PDFOtherDesc=PDF opcija, kas raksturīga dažiem moduļiem PDFAddressForging=Noteikumi par adreses sadaļu HideAnyVATInformationOnPDF=Slēpt visu informāciju, kas saistīta ar pārdošanas nodokli / PVN PDFRulesForSalesTax=Pārdošanas nodokļa / PVN noteikumi @@ -450,8 +450,8 @@ ExtrafieldParamHelpPassword=Atstājot šo lauku tukšu, tas nozīmē, ka šī v ExtrafieldParamHelpselect=Vērtību sarakstam jābūt rindām ar formāta atslēgu, vērtība (kur atslēga nevar būt '0')

    , piemēram,: 1, vērtība1
    2, vērtība2
    kods3, vērtība3 < br> ...

    Lai saraksts būtu atkarīgs no cita papildinošā atribūtu saraksta:
    1, vērtība1 | opcijas_ vecāku_līmeņa kods : vecāku_skava
    2, vērtība2 | opcijas_ vecāku saraksts_code : parent_key

    Lai saraksts būtu atkarīgs no cita saraksta:
    1, vērtība1 | vecāku saraksts_code : vecāku_skava
    2, vērtība2 | vecāku saraksts_code : vecāku_poga ExtrafieldParamHelpcheckbox=Vērtību sarakstam jābūt rindām ar formāta atslēgu, vērtība (kur atslēga nevar būt '0')

    , piemēram,: 1, vērtība1
    2, vērtība2
    3, vērtība3 < br> ... ExtrafieldParamHelpradio=Vērtību sarakstam jābūt rindām ar formāta atslēgu, vērtība (kur atslēga nevar būt '0')

    , piemēram,: 1, vērtība1
    2, vērtība2
    3, vērtība3 < br> ... -ExtrafieldParamHelpsellist=List of values comes from a table
    Syntax: table_name:label_field:id_field::filtersql
    Example: c_typent:libelle:id::filtersql

    - id_field is necessarly a primary int key
    - filtersql is a SQL condition. It can be a simple test (eg active=1) to display only active value
    You can also use $ID$ in filter which is the current id of current object
    To use a SELECT into the filter use the keyword $SEL$ to bypass anti-injection protection.
    if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)

    In order to have the list depending on another complementary attribute list:
    c_typent:libelle:id:options_parent_list_code|parent_column:filter

    In order to have the list depending on another list:
    c_typent:libelle:id:parent_list_code|parent_column:filter -ExtrafieldParamHelpchkbxlst=List of values comes from a table
    Syntax: table_name:label_field:id_field::filtersql
    Example: c_typent:libelle:id::filtersql

    filter can be a simple test (eg active=1) to display only active value
    You can also use $ID$ in filter witch is the current id of current object
    To do a SELECT in filter use $SEL$
    if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)

    In order to have the list depending on another complementary attribute list:
    c_typent:libelle:id:options_parent_list_code|parent_column:filter

    In order to have the list depending on another list:
    c_typent:libelle:id:parent_list_code|parent_column:filter +ExtrafieldParamHelpsellist=Vērtību saraksts tiek iegūts no tabulas
    Sintakse: table_name: label_field: id_field :: filtersql
    Piemērs: c_typent: libelle: id :: filtersql

    - id_f0 af2 ir a2_fails ir obligāts. Tas var būt vienkāršs tests (piemēram, aktīvs = 1), lai parādītu tikai aktīvo vērtību
    . Filtrā var izmantot arī $ ID $, kas ir pašreizējā objekta
    ID. Lai filtrā izmantotu SELECT, izmantojiet atslēgvārdu $ SEL $ apiet pretinjekcijas aizsardzību.
    , ja vēlaties filtrēt ekstrefieldos, izmantojiet sintaksi extra.fieldcode = ... (kur lauka kods ir extrafield kods)

    Lai saraksts būtu atkarīgs no cita papildu atribūtu saraksta:
    :
    parent_list_code | parent_column: filter

    Lai saraksts būtu atkarīgs no cita saraksta:
    c_typent: libelle: ID: a04927 +ExtrafieldParamHelpchkbxlst=Vērtību saraksts nāk no tabulas
    Sintakse: table_name: label_field: id_field :: filtersql
    Piemērs: c_typent: libelle: id :: filtersql

    tikai aktīvs displejs var izmantot arī $ ID $ filtrā. ragana ir pašreizējā objekta
    ID. Lai atlasītu filtru, izmantojiet $ SEL $
    , ja vēlaties filtrēt ekstra laukos, izmantojiet sintaksi extra.fieldcode = ... (kur lauka kods ir kods extrafield)

    lai būtu sarakstu atkarībā citā papildu atribūtu saraksta:
    c_typent: Libelle: id: options_ parent_list_code | parent_column: filtrs

    lai iegūtu sarakstu, atkarībā no citu sarakstā:
    c_typent: libelle: id: parent_list_code | parent_column: filtrs ExtrafieldParamHelplink=Parametriem jābūt ObjectName: Classpath
    Sintakse: ObjectName: Classpath ExtrafieldParamHelpSeparator=Vienkārša atdalītāja atstāšana tukša
    Iestatiet to uz 1 sabrūkošajam atdalītājam (pēc noklusējuma atveriet jaunu sesiju, pēc tam katras lietotāja sesijai tiek saglabāts statuss)
    Iestatiet to uz 2 sabrukušajam atdalītājam (jaunajai sesijai pēc noklusējuma sabrūk, pēc tam katras lietotāja sesijas laikā tiek saglabāts statuss) LibraryToBuildPDF=Bibliotēka, ko izmanto PDF veidošanai @@ -548,7 +548,7 @@ Module40Desc=Pārdevēju un pirkumu vadība (pirkumu pasūtījumi un rēķini pa Module42Name=Atkļūdošanas žurnāli Module42Desc=Žurnalēšana (fails, syslog, ...). Šādi žurnāli ir paredzēti tehniskiem / atkļūdošanas nolūkiem. Module43Name=Atkļūdošanas josla -Module43Desc=A tool for developper adding a debug bar in your browser. +Module43Desc=Izstrādātāja rīks, kas pārlūkprogrammā pievieno atkļūdošanas joslu. Module49Name=Redaktors Module49Desc=Redaktora vadība Module50Name=Produkti @@ -562,7 +562,7 @@ Module53Desc=Pakalpojumu pārvaldība Module54Name=Līgumi / Abonementi Module54Desc=Līgumu (pakalpojumu vai regulāru abonēšanas) vadība Module55Name=Svītrkodi -Module55Desc=Barcode or QR code management +Module55Desc=Svītrkodu vai QR kodu pārvaldība Module56Name=Maksājums ar pārskaitījumu Module56Desc=Piegādātāju norēķinu vadīšana ar kredīta pārveduma rīkojumiem. Tas ietver SEPA faila ģenerēšanu Eiropas valstīm. Module57Name=Maksājumi ar tiešo debetu @@ -648,13 +648,13 @@ Module2900Desc=GeoIP MaxMind pārveidošanu iespējas Module3200Name=Nemainīgi arhīvi Module3200Desc=Iespējojiet nemainīgu biznesa notikumu žurnālu. Notikumi tiek arhivēti reāllaikā. Žurnāls ir tikai lasāmu tabulu ķēdes notikumus, kurus var eksportēt. Šis modulis dažās valstīs var būt obligāts. Module3400Name=Sociālie tīkli -Module3400Desc=Enable Social Networks fields into third parties and addresses (skype, twitter, facebook, ...). +Module3400Desc=Iespējojiet sociālo tīklu laukus trešajām pusēm un adresēm (skype, twitter, facebook, ...). Module4000Name=HRM Module4000Desc=Cilvēkresursu vadība (departamenta vadība, darbinieku līgumi un jūtas) Module5000Name=Multi-kompānija Module5000Desc=Ļauj jums pārvaldīt vairākus uzņēmumus -Module6000Name=Inter-modules Workflow -Module6000Desc=Workflow management between different modules (automatic creation of object and/or automatic status change) +Module6000Name=Starpmoduļu darbplūsma +Module6000Desc=Darbplūsmas pārvaldība starp dažādiem moduļiem (automātiska objekta izveidošana un / vai automātiska statusa maiņa) Module10000Name=Mājas lapas Module10000Desc=Izveidojiet vietnes (publiskas) ar WYSIWYG redaktoru. Šī ir tīmekļa pārziņa vai izstrādātāja orientēta CMS (labāk ir zināt HTML un CSS valodu). Vienkārši iestatiet savu tīmekļa serveri (Apache, Nginx, ...), lai norādītu uz atvēlēto Dolibarr direktoriju, lai tas būtu tiešsaistē internetā ar savu domēna vārdu. Module20000Name=Atvaļinājumu pieprasījumu pārvaldība @@ -815,8 +815,8 @@ PermissionAdvanced253=Izveidot/mainīt iekšējoss/ārējos lietotājus un atļa Permission254=Izveidot/mainīt ārējos lietotājus tikai Permission255=Mainīt citu lietotāju paroli Permission256=Izdzēst vai bloķēt citus lietotājus -Permission262=Extend access to all third parties AND their objects (not only third parties for which the user is a sale representative).
    Not effective for external users (always limited to themselves for proposals, orders, invoices, contracts, etc.).
    Not effective for projects (only rules on project permissions, visibility and assignment matters). -Permission263=Extend access to all third parties WITHOUT their objects (not only third parties for which the user is a sale representative).
    Not effective for external users (always limited to themselves for proposals, orders, invoices, contracts, etc.).
    Not effective for projects (only rules on project permissions, visibility and assignment matters). +Permission262=Paplašiniet piekļuvi visām trešajām personām UN viņu objektiem (ne tikai trešajām pusēm, kuru lietotājs ir pārdošanas pārstāvis).
    Nav efektīvs ārējiem lietotājiem (vienmēr tikai un vienīgi attiecībā uz priekšlikumiem, pasūtījumiem, rēķiniem, līgumiem utt.)
    Nav spēkā projektiem (tikai noteikumi par projekta atļaujām, redzamību un piešķiršanas jautājumiem). +Permission263=Paplašiniet piekļuvi visām trešajām pusēm BEZ viņu objektiem (ne tikai trešajām personām, kuru lietotājs ir pārdošanas pārstāvis).
    Nav efektīvs ārējiem lietotājiem (vienmēr tikai un vienīgi attiecībā uz priekšlikumiem, pasūtījumiem, rēķiniem, līgumiem utt.)
    Nav spēkā projektiem (tikai noteikumi par projekta atļaujām, redzamību un piešķiršanas jautājumiem). Permission271=Lasīt CA Permission272=Lasīt rēķinus Permission273=Izrakstīt rēķinus @@ -849,10 +849,10 @@ Permission402=Izveidot/mainīt atlaides Permission403=Apstiprināt atlaides Permission404=Dzēst atlaides Permission430=Izmantot Debug Bar -Permission511=Read salaries and payments (yours and subordinates) -Permission512=Create/modify salaries and payments -Permission514=Delete salaries and payments -Permission517=Read salaries and payments everybody +Permission511=Lasiet algas un maksājumus (jūsu un padoto) +Permission512=Izveidojiet / modificējiet algas un maksājumus +Permission514=Dzēst algas un maksājumus +Permission517=Lasiet algas un maksājumus visiem Permission519=Eksportēt algas Permission520=Lasīt aizdevumus Permission522=Izveidot / labot aizdevumus @@ -966,8 +966,8 @@ Permission23003=Dzēst ieplānoto uzdevumu Permission23004=Izpildīt ieplānoto uzdevumu Permission50101=Izmantot tirdzniecības vietu (SimplePOS) Permission50151=Izmantot tirdzniecības vietu (TakePOS) -Permission50152=Edit sales lines -Permission50153=Edit ordered sales lines +Permission50152=Rediģēt pārdošanas rindas +Permission50153=Rediģēt pasūtītās pārdošanas līnijas Permission50201=Lasīt darījumus Permission50202=Importēt darījumus Permission50330=Lasīt Zapier objektus @@ -1042,12 +1042,12 @@ DictionaryMeasuringUnits=Mērvienības DictionarySocialNetworks=Sociālie tīkli DictionaryProspectStatus=Prospekta statuss uzņēmumiem DictionaryProspectContactStatus=Prospekta statuss kontaktiem -DictionaryHolidayTypes=Leave - Types of leave +DictionaryHolidayTypes=Atvaļinājums - atvaļinājuma veidi DictionaryOpportunityStatus=Vadošais statuss projektu / vadībai DictionaryExpenseTaxCat=Izdevumu pārskats - transporta kategorijas DictionaryExpenseTaxRange=Izdevumu pārskats - diapazons pēc transporta kategorijas DictionaryTransportMode=Intracomm pārskats - transporta veids -DictionaryBatchStatus=Product lot/serial Quality Control status +DictionaryBatchStatus=Produkta partijas / sērijas kvalitātes kontroles statuss TypeOfUnit=Vienības veids SetupSaved=Iestatījumi saglabāti SetupNotSaved=Iestatīšana nav saglabāta @@ -1164,7 +1164,7 @@ DoNotSuggestPaymentMode=Neieteikt NoActiveBankAccountDefined=Nav definēts aktīvs bankas konts OwnerOfBankAccount=Bankas konta īpašnieks %s BankModuleNotActive=Bankas kontu modulis nav ieslēgts -ShowBugTrackLink=Define the link "%s" (empty to not display this link, 'github' for the link to the Dolibarr project or define directly an url 'https://...') +ShowBugTrackLink=Definējiet saiti " %s " (tukša, lai nerādītu šo saiti, 'github' saitei uz Dolibarr projektu vai tieši definējiet URL 'https: // ...') Alerts=Brīdinājumi DelaysOfToleranceBeforeWarning=Kavēšanās, pirms tiek parādīts brīdinājuma brīdinājums par: DelaysOfToleranceDesc=Iestatiet aizkavi pirms brīdinājuma ikonas %s parādīšanas ekrānā par novēloto elementu. @@ -1189,9 +1189,9 @@ SetupDescription2=Šīs divas sadaļas ir obligātas (divi pirmie ieraksti iesta SetupDescription3=  %s -> %s

    Pamata parametri, ko izmanto, lai pielāgotu ar jūsu lietojumprogrammu saistīto noklusējuma uzvedību (piemēram, valstij). SetupDescription4=  %s -> %s

    Šī programmatūra ir daudzu moduļu / lietojumprogrammu komplekts. Ar jūsu vajadzībām saistītajiem moduļiem jābūt iespējotiem un konfigurētiem. Parādīsies izvēlnes ieraksti, aktivizējot šos moduļus. SetupDescription5=Citi iestatījumu izvēlnes ieraksti pārvalda izvēles parametrus. -AuditedSecurityEvents=Security events that are audited -NoSecurityEventsAreAduited=No security events are audited. You can enable them from menu %s -Audit=Security events +AuditedSecurityEvents=Drošības pasākumi, kas tiek pārbaudīti +NoSecurityEventsAreAduited=Netiek pārbaudīti nekādi drošības notikumi. Tos var iespējot no izvēlnes %s +Audit=Drošības notikumi InfoDolibarr=Par Dolibarr InfoBrowser=Pārlūkprogrammas info InfoOS=Par OS @@ -1258,8 +1258,8 @@ RunningUpdateProcessMayBeRequired=Šķiet, ka nepieciešams veikt atjaunināšan YouMustRunCommandFromCommandLineAfterLoginToUser=Jums ir palaist šo komandu no komandrindas pēc pieteikšanās uz apvalks ar lietotāju %s, vai jums ir pievienot-W iespēju beigās komandrindas, lai sniegtu %s paroli. YourPHPDoesNotHaveSSLSupport=SSL funkcijas, kas nav pieejama jūsu PHP DownloadMoreSkins=Vairāki izskati lejupielādei -SimpleNumRefModelDesc=Returns the reference number in the format %syymm-nnnn where yy is the year, mm is the month and nnnn is a sequential auto-incrementing number with no reset -SimpleNumRefNoDateModelDesc=Returns the reference number in the format %s-nnnn where nnnn is a sequential auto-incrementing number with no reset +SimpleNumRefModelDesc=Atgriež atsauces numuru formātā %syymm-nnnn, kur yy ir gads, mm ir mēnesis un nnnn ir secīgs automātiski palielināms skaitlis bez atiestatīšanas +SimpleNumRefNoDateModelDesc=Atgriež atsauces numuru formātā %s-nnnn, kur nnnn ir secīgs automātiski pieaugošs skaitlis bez atiestatīšanas ShowProfIdInAddress=Rādīt profesionālo ID ar adresēm ShowVATIntaInAddress=Slēpt Kopienas iekšējo PVN numuru ar adresēm TranslationUncomplete=Daļējs tulkojums @@ -1277,7 +1277,7 @@ MAIN_PROXY_HOST=Starpniekserveris: nosaukums/adrese MAIN_PROXY_PORT=Starpniekserveris: ports MAIN_PROXY_USER=Starpniekserveris: pieteikšanās/lietotājs MAIN_PROXY_PASS=Starpniekserveris: parole -DefineHereComplementaryAttributes=Define any additional / custom attributes that must be added to: %s +DefineHereComplementaryAttributes=Definējiet visus papildu / pielāgotos atribūtus, kas jāpievieno: %s ExtraFields=Papildus atribūti ExtraFieldsLines=Papildinošas atribūti (līnijas) ExtraFieldsLinesRec=Papildu atribūti (veidņu rēķinu līnijas) @@ -1323,12 +1323,12 @@ ConditionIsCurrently=Stāvoklis šobrīd ir %s YouUseBestDriver=Jūs izmantojat draiveri %s, kas ir labākais šobrīd pieejams draiveris. YouDoNotUseBestDriver=Jūs izmantojat draiveri %s, bet ieteicams ir %s. NbOfObjectIsLowerThanNoPb=Jums datu bāzē ir tikai %s %s. Tam nav nepieciešama īpaša optimizācija. -ComboListOptim=Combo list loading optimization +ComboListOptim=Kombinētā saraksta ielādes optimizācija SearchOptim=Meklēšanas optimizācija -YouHaveXObjectUseComboOptim=You have %s %s in the database. You can go into setup of module to enable loading of combo list on key pressed event. -YouHaveXObjectUseSearchOptim=You have %s %s in the database. You can add the constant %s to 1 in Home-Setup-Other. -YouHaveXObjectUseSearchOptimDesc=This limits the search to the beginning of strings which makes it possible for the database to use indexes and you should get an immediate response. -YouHaveXObjectAndSearchOptimOn=You have %s %s in the database and constant %s is set to %s in Home-Setup-Other. +YouHaveXObjectUseComboOptim=Jums datu bāzē ir %s %s. Jūs varat pāriet uz moduļa iestatīšanu, lai iespējotu kombinēto sarakstu ielādēšanu uz taustiņa nospiešanas notikuma. +YouHaveXObjectUseSearchOptim=Jums datu bāzē ir %s %s. Pastāvīgo %s var pievienot vienumam 1 sadaļā Mājas iestatīšana - Cits. +YouHaveXObjectUseSearchOptimDesc=Tas ierobežo meklēšanu tikai virkņu sākumā, kas ļauj datu bāzei izmantot indeksus, un jums nekavējoties jāsaņem atbilde. +YouHaveXObjectAndSearchOptimOn=Jums datu bāzē ir %s %s, un konstante %s ir iestatīta uz %s sadaļā Home-Setup-Other. BrowserIsOK=Jūs izmantojat tīmekļa pārlūku %s. Šī pārlūkprogramma ir droša un ātrdarbīgs. BrowserIsKO=Jūs izmantojat tīmekļa pārlūku %s. Šī pārlūka informācija ir slikta izvēle drošībai, veiktspējai un uzticamībai. Mēs iesakām izmantot Firefox, Chrome, Opera vai Safari. PHPModuleLoaded=Tiek ielādēts PHP komponents %s @@ -1440,7 +1440,7 @@ MemberMainOptions=Galvenās iespējas AdherentLoginRequired= Pārvaldīt Pieteikšanos katram dalībniekam AdherentMailRequired=Lai izveidotu jaunu dalībnieku, nepieciešams e-pasts MemberSendInformationByMailByDefault=Rūtiņu, lai nosūtītu pasta apstiprinājums locekļiem (validāciju vai jauns abonements) ir ieslēgts pēc noklusējuma -MemberCreateAnExternalUserForSubscriptionValidated=Create an external user login for each new member subscription validated +MemberCreateAnExternalUserForSubscriptionValidated=Katram apstiprinātam jaunam dalībnieka abonementam izveidojiet ārēju lietotāja pieteikuminformāciju VisitorCanChooseItsPaymentMode=Apmeklētājs var izvēlēties no pieejamiem maksājumu veidiem MEMBER_REMINDER_EMAIL=Iespējot automātisku atgādinājumu pa e-pastu par beidzies abonementi. Piezīme. Modulim %s jābūt iespējotai un pareizi iestatītai, lai nosūtītu atgādinājumus. MembersDocModules=Dokumentu veidnes dokumentiem, kas ģenerēti no dalībnieku ieraksta @@ -1525,7 +1525,7 @@ LDAPFieldLoginUnix=Lietotājs (Unix) LDAPFieldLoginExample=Piemērs: uid LDAPFilterConnection=Meklēšanas filtrs LDAPFilterConnectionExample=Piemērs: & (objectClass = inetOrgPerson) -LDAPGroupFilterExample=Example: &(objectClass=groupOfUsers) +LDAPGroupFilterExample=Piemērs: & (objectClass = groupOfUsers) LDAPFieldLoginSamba=Lietotāja vārds (samba, Aktīvā direktorija) LDAPFieldLoginSambaExample=Piemērs: kāds konta nosaukums LDAPFieldFullname=Vārds un uzvārds @@ -1757,11 +1757,11 @@ YourCompanyDoesNotUseVAT=Jūsu uzņēmumam ir noteikts, ka PVN netiek izmantots AccountancyCode=Grāmatvedības kods AccountancyCodeSell=Tirdzniecība kontu. kods AccountancyCodeBuy=Iegādes konta. kods -CREATE_NEW_VAT_WITHOUT_AUTO_PAYMENT=Keep the checkbox “Automatically create the payment” empty by default when creating a new tax +CREATE_NEW_VAT_WITHOUT_AUTO_PAYMENT=Veidojot jaunu nodokli, pēc noklusējuma turiet izvēles rūtiņu “Automātiski izveidot maksājumu” tukšu ##### Agenda ##### AgendaSetup=Notikumi un kārtības modulis uzstādīšana PasswordTogetVCalExport=Galvenais atļaut eksporta saiti -SecurityKey = Security Key +SecurityKey = Drošības atslēga PastDelayVCalExport=Neeksportē notikums, kuri vecāki par AGENDA_USE_EVENT_TYPE=Izmantojiet notikumu tipus (tiek pārvaldīti izvēlnē Iestatīšana -> Vārdnīcas -> Darba kārtības notikumu veids). AGENDA_USE_EVENT_TYPE_DEFAULT=Veidojot notikuma veidlapu, automātiski iestatiet šo noklusējuma vērtību @@ -1771,7 +1771,7 @@ AGENDA_DEFAULT_VIEW=Kuru skatu vēlaties atvērt pēc noklusējuma, izvēloties AGENDA_REMINDER_BROWSER=Iespējojiet notikuma atgādinājumu lietotāja pārlūkprogrammā (Kad ir atgādinājuma datums, pārlūkprogramma parāda uznirstošo logu. Katrs lietotājs var atspējot šādus paziņojumus pārlūka paziņojumu iestatījumos). AGENDA_REMINDER_BROWSER_SOUND=Iespējot skaņas paziņojumu AGENDA_REMINDER_EMAIL=Iespējojiet notikuma atgādinājumu , nosūtot e-pastus (katram notikumam var noteikt atgādinājuma opciju / aizkavi). -AGENDA_REMINDER_EMAIL_NOTE=Note: The frequency of the scheduled job %s must be enough to be sure that the remind are sent at the correct moment. +AGENDA_REMINDER_EMAIL_NOTE=Piezīme: Plānotā darba %s biežumam jābūt pietiekamam, lai pārliecinātos, ka atgādinājums tiek nosūtīts pareizajā brīdī. AGENDA_SHOW_LINKED_OBJECT=Parādīt saistīto objektu darba kārtībā ##### Clicktodial ##### ClickToDialSetup=Klikšķiniet lai Dial moduļa uzstādīšanas @@ -1902,7 +1902,7 @@ BackgroundTableLineOddColor=Background color for odd table lines BackgroundTableLineEvenColor=Background color for even table lines MinimumNoticePeriod=Minimum notice period (Your leave request must be done before this delay) NbAddedAutomatically=Number of days added to counters of users (automatically) each month -EnterAnyCode=This field contains a reference to identify the line. Enter any value of your choice, but without special characters. +EnterAnyCode=Šajā laukā ir norāde, lai identificētu līniju. Ievadiet jebkuru izvēlēto vērtību, bet bez īpašām rakstzīmēm. Enter0or1=Ievadiet 0 vai 1 UnicodeCurrency=Ievadiet šeit starp aplikācijām, baitu skaitļu sarakstu, kas attēlo valūtas simbolu. Piemēram: attiecībā uz $ ievadiet [36] - Brazīlijas reālajam R $ [82,36] - par € ievadiet [8364] ColorFormat=RGB krāsa ir HEX formātā, piemēram: FF0000 @@ -1987,11 +1987,11 @@ MAIN_PDF_MARGIN_RIGHT=Labā puse PDF failā MAIN_PDF_MARGIN_TOP=Galvene PDF failā MAIN_PDF_MARGIN_BOTTOM=Kājene PDF failā MAIN_DOCUMENTS_LOGO_HEIGHT=Logotipa augstums PDF formātā -MAIN_GENERATE_PROPOSALS_WITH_PICTURE=Add picture on proposal line -MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING=Add electronic sign in PDF +MAIN_GENERATE_PROPOSALS_WITH_PICTURE=Pievienojiet attēlu uz piedāvājuma līnijas +MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING=Pievienojiet elektronisko pierakstu PDF formātā NothingToSetup=Šim modulim nav nepieciešama īpaša iestatīšana. SetToYesIfGroupIsComputationOfOtherGroups=Iestatiet to uz "jā", ja šī grupa ir citu grupu aprēķins -EnterCalculationRuleIfPreviousFieldIsYes=Enter calculation rule if previous field was set to Yes.
    For example:
    CODEGRP1+CODEGRP2 +EnterCalculationRuleIfPreviousFieldIsYes=Ievadiet aprēķina kārtulu, ja iepriekšējais lauks bija iestatīts uz Jā.
    Piemēram:
    CODEGRP1 + CODEGRP2 SeveralLangugeVariatFound=Atrasti vairāki valodu varianti RemoveSpecialChars=Noņemt īpašās rakstzīmes COMPANY_AQUARIUM_CLEAN_REGEX=Regex filtrs tīrajai vērtībai (COMPANY_AQUARIUM_CLEAN_REGEX) @@ -2007,7 +2007,7 @@ SocialNetworkSetup=Moduļa Sociālo tīklu iestatīšana EnableFeatureFor=Iespējot funkcijas %s VATIsUsedIsOff=Piezīme. Izvēlnē %s - %s izvēlētā pārdošanas nodokļa vai PVN izmantošana ir iestatīta uz Izslēgts , tāpēc pārdošanas nodoklis vai izmantotais PVN vienmēr būs 0 pārdošanai. SwapSenderAndRecipientOnPDF=Pārsūtīt sūtītāja un adresāta adreses pozīciju PDF dokumentos -FeatureSupportedOnTextFieldsOnly=Warning, feature supported on text fields and combo lists only. Also an URL parameter action=create or action=edit must be set OR page name must end with 'new.php' to trigger this feature. +FeatureSupportedOnTextFieldsOnly=Brīdinājums, funkcija tiek atbalstīta tikai teksta laukos un kombinētajos sarakstos. Lai aktivizētu šo funkciju, ir jāiestata arī URL parametrs action = create vai action = edit. VAI lapas nosaukumam jābeidzas ar “new.php”. EmailCollector=E-pasta savācējs EmailCollectorDescription=Pievienojiet ieplānoto darbu un iestatīšanas lapu, lai regulāri skenētu e-pasta kastes (izmantojot IMAP protokolu) un ierakstītu savā pieteikumā saņemtos e-pasta ziņojumus pareizajā vietā un / vai automātiski izveidotu ierakstus (piemēram, vadus). NewEmailCollector=Jauns e-pasta savācējs @@ -2074,11 +2074,11 @@ UseDebugBar=Izmantojiet atkļūdošanas joslu DEBUGBAR_LOGS_LINES_NUMBER=Pēdējo žurnālu rindu skaits, kas jāsaglabā konsolē WarningValueHigherSlowsDramaticalyOutput=Brīdinājums, augstākas vērtības palēnina dramatisko izeju ModuleActivated=Modulis %s ir aktivizēts un palēnina saskarni -ModuleActivatedWithTooHighLogLevel=Module %s is activated with a too high logging level (try to use a lower level for better performances and security) -ModuleSyslogActivatedButLevelNotTooVerbose=Module %s is activated and log level (%s) is correct (not too verbose) +ModuleActivatedWithTooHighLogLevel=Modulis %s tiek aktivizēts ar pārāk augstu mežizstrādes līmeni (labākai veiktspējai un drošībai mēģiniet izmantot zemāku līmeni) +ModuleSyslogActivatedButLevelNotTooVerbose=Modulis %s ir aktivizēts un žurnāla līmenis (%s) ir pareizs (ne pārāk daudzbalsīgs) IfYouAreOnAProductionSetThis=Ja izmantojat ražošanas vidi, šim rekvizītam ir jāiestata kā %s. AntivirusEnabledOnUpload=Augšupielādētajos failos ir iespējota antivīruss -SomeFilesOrDirInRootAreWritable=Some files or directories are not in a read-only mode +SomeFilesOrDirInRootAreWritable=Daži faili vai direktoriji nav tikai lasīšanas režīmā EXPORTS_SHARE_MODELS=Eksporta modeļi ir kopīgi ar visiem ExportSetup=Moduļa Eksportēšana iestatīšana ImportSetup=Moduļa importēšanas iestatīšana @@ -2102,8 +2102,8 @@ MakeAnonymousPing=Izveidojiet anonīmu Ping '+1' Dolibarr pamata serverim (to ve FeatureNotAvailableWithReceptionModule=Funkcija nav pieejama, ja ir iespējota moduļa uztveršana EmailTemplate=E-pasta veidne EMailsWillHaveMessageID=E-pastam būs tags “Atsauces”, kas atbilst šai sintaksei -PDF_SHOW_PROJECT=Show project on document -ShowProjectLabel=Project Label +PDF_SHOW_PROJECT=Parādīt projektu dokumentā +ShowProjectLabel=Projekta etiķete PDF_USE_ALSO_LANGUAGE_CODE=Ja vēlaties, lai daži PDF faili tiktu dublēti 2 dažādās valodās tajā pašā ģenerētajā PDF failā, jums šeit ir jāiestata šī otrā valoda, lai ģenerētais PDF saturētu vienā un tajā pašā lappusē 2 dažādas valodas, vienu izvēloties, ģenerējot PDF, un šo ( tikai dažas PDF veidnes to atbalsta). Vienā PDF formātā atstājiet tukšumu 1 valodā. FafaIconSocialNetworksDesc=Šeit ievadiet FontAwesome ikonas kodu. Ja jūs nezināt, kas ir FontAwesome, varat izmantot vispārīgo vērtību fa-adrešu grāmata. RssNote=Piezīme. Katra RSS plūsmas definīcija nodrošina logrīku, kas jums jāiespējo, lai tas būtu pieejams informācijas panelī @@ -2118,29 +2118,30 @@ SwitchThisForABetterSecurity=Lai nodrošinātu lielāku drošību, ieteicams šo DictionaryProductNature= Produkta veids CountryIfSpecificToOneCountry=Valsts (ja tā ir konkrēta valsts) YouMayFindSecurityAdviceHere=Šeit varat atrast drošības konsultācijas -ModuleActivatedMayExposeInformation=This PHP extension may expose sensitive data. If you don't need it, disable it. +ModuleActivatedMayExposeInformation=Šis PHP paplašinājums var atklāt konfidenciālus datus. Ja jums tas nav nepieciešams, atspējojiet to. ModuleActivatedDoNotUseInProduction=Izstrādei paredzētais modulis ir iespējots. Neiespējojiet to ražošanas vidē. CombinationsSeparator=Atdalītāja raksturs produktu kombinācijām SeeLinkToOnlineDocumentation=Piemēru skatiet saiti uz tiešsaistes dokumentēšanu augšējā izvēlnē SHOW_SUBPRODUCT_REF_IN_PDF=Ja tiek izmantots moduļa %s līdzeklis "%s", parādiet sīkāku informāciju par komplekta apakšproduktiem PDF formātā. AskThisIDToYourBank=Lai iegūtu šo ID, sazinieties ar savu banku -AdvancedModeOnly=Permision available in Advanced permission mode only -ConfFileIsReadableOrWritableByAnyUsers=The conf file is readable or writable by any users. Give permission to web server user and group only. -MailToSendEventOrganization=Event Organization -AGENDA_EVENT_DEFAULT_STATUS=Default event status when creating a event from the form -YouShouldDisablePHPFunctions=You should disable PHP functions -IfCLINotRequiredYouShouldDisablePHPFunctions=Except if you need to run system commands in custom code, you shoud disable PHP functions -PHPFunctionsRequiredForCLI=For shell purpose (like scheduled job backup or running an anitivurs program), you must keep PHP functions -NoWritableFilesFoundIntoRootDir=No writable files or directories of the common programs were found into your root directory (Good) -RecommendedValueIs=Recommended: %s -NotRecommended=Not recommanded -ARestrictedPath=A restricted path -CheckForModuleUpdate=Check for external modules updates -CheckForModuleUpdateHelp=This action will connect to editors of external modules to check if a new version is available. -ModuleUpdateAvailable=An update is available -NoExternalModuleWithUpdate=No updates found for external modules -SwaggerDescriptionFile=Swagger API description file (for use with redoc for example) -YouEnableDeprecatedWSAPIsUseRESTAPIsInstead=You enabled deprecated WS API. You should use REST API instead. -RandomlySelectedIfSeveral=Randomly selected if several pictures are available -DatabasePasswordObfuscated=Database password is obfuscated in conf file -DatabasePasswordNotObfuscated=Database password is NOT obfuscated in conf file +AdvancedModeOnly=Atļauja ir pieejama tikai papildu atļauju režīmā +ConfFileIsReadableOrWritableByAnyUsers=Conf fails ir lasāms vai rakstāms visiem lietotājiem. Piešķirt atļauju tikai tīmekļa servera lietotājam un grupai. +MailToSendEventOrganization=Pasākuma organizēšana +AGENDA_EVENT_DEFAULT_STATUS=Noklusējuma notikuma statuss, veidojot notikumu no formas +YouShouldDisablePHPFunctions=Jums vajadzētu atspējot PHP funkcijas +IfCLINotRequiredYouShouldDisablePHPFunctions=PHP funkcijas ir jāatspējo, izņemot gadījumus, kad sistēmas komandas ir jāpalaiž pielāgotā kodā +PHPFunctionsRequiredForCLI=Apvalka vajadzībām (piemēram, ieplānota darba dublēšana vai anitivurs programmas palaišana) jums ir jāsaglabā PHP funkcijas +NoWritableFilesFoundIntoRootDir=Jūsu saknes direktorijā netika atrasti ierasto failu vai direktoriju kopējās programmas (labi) +RecommendedValueIs=Ieteicams: %s +NotRecommended=Nav ieteikts +ARestrictedPath=Ierobežots ceļš +CheckForModuleUpdate=Pārbaudiet, vai nav atjaunināti ārējie moduļi +CheckForModuleUpdateHelp=Šī darbība izveidos savienojumu ar ārējo moduļu redaktoriem, lai pārbaudītu, vai ir pieejama jauna versija. +ModuleUpdateAvailable=Ir pieejams atjauninājums +NoExternalModuleWithUpdate=Ārējiem moduļiem nav atrasti atjauninājumi +SwaggerDescriptionFile=Swagger API apraksta fails (piemēram, lietošanai ar pārorientēšanu) +YouEnableDeprecatedWSAPIsUseRESTAPIsInstead=Jūs iespējojāt novecojušu WS API. Tā vietā jums vajadzētu izmantot REST API. +RandomlySelectedIfSeveral=Nejauši izvēlēts, ja ir pieejami vairāki attēli +DatabasePasswordObfuscated=Datu bāzes parole ir neskaidra konf failā +DatabasePasswordNotObfuscated=Datu bāzes parole NAV apmulsināta conf failā +APIsAreNotEnabled=API moduļi nav iespējoti diff --git a/htdocs/langs/lv_LV/agenda.lang b/htdocs/langs/lv_LV/agenda.lang index f985c7f994e..d2525186222 100644 --- a/htdocs/langs/lv_LV/agenda.lang +++ b/htdocs/langs/lv_LV/agenda.lang @@ -4,7 +4,7 @@ Actions=Notikumi Agenda=Darba kārtība TMenuAgenda=Darba kārtība Agendas=Darba kārtības -LocalAgenda=Default calendar +LocalAgenda=Noklusējuma kalendārs ActionsOwnedBy=Notikums pieder ActionsOwnedByShort=Īpašnieks AffectedTo=Piešķirts @@ -20,7 +20,7 @@ MenuToDoActions=Visi nepabeigtie pasākumi MenuDoneActions=Visi izbeigtie notikumi MenuToDoMyActions=Mani nepabeigtie notikumi MenuDoneMyActions=Mani izbeigtie notikumi -ListOfEvents=List of events (default calendar) +ListOfEvents=Notikumu saraksts (noklusējuma kalendārs) ActionsAskedBy=Notikumu ziņoja ActionsToDoBy=Pasākums piešķirts ActionsDoneBy=Pasākumi, ko veikuši @@ -38,7 +38,7 @@ ActionsEvents=Pasākumi, par kuriem Dolibarr radīs prasību kārtībā automāt EventRemindersByEmailNotEnabled=Pasākumu atgādinājumi pa e-pastu netika iespējoti %s moduļa iestatījumos. ##### Agenda event labels ##### NewCompanyToDolibarr=Trešā puse izveidota %s -COMPANY_MODIFYInDolibarr=Third party %s modified +COMPANY_MODIFYInDolibarr=Trešā puse %s modificēta COMPANY_DELETEInDolibarr=Izdzēsta trešā persona %s ContractValidatedInDolibarr=Līgumi %s apstiprināti CONTRACT_DELETEInDolibarr=Līgums %s svītrots @@ -88,7 +88,7 @@ OrderDeleted=Pasūtījums dzēsts InvoiceDeleted=Rēķins dzēsts DraftInvoiceDeleted=Rēķina melnraksts ir izdzēsts CONTACT_CREATEInDolibarr=Kontaktpersona %s ir izveidota -CONTACT_MODIFYInDolibarr=Contact %s modified +CONTACT_MODIFYInDolibarr=Saziņa %s ir modificēta CONTACT_DELETEInDolibarr=Kontaktpersona %s ir izdzēsta PRODUCT_CREATEInDolibarr=Produkts %s ir izveidots PRODUCT_MODIFYInDolibarr=Produkts %s ir labots @@ -121,7 +121,7 @@ MRP_MO_UNVALIDATEInDolibarr=MO iestatīts uz melnraksta statusu MRP_MO_PRODUCEDInDolibarr=MO ražots MRP_MO_DELETEInDolibarr=MO ir izdzēsts MRP_MO_CANCELInDolibarr=MO atcelts -PAIDInDolibarr=%s paid +PAIDInDolibarr=%s samaksāts ##### End agenda events ##### AgendaModelModule=Dokumentu veidnes notikumam DateActionStart=Sākuma datums @@ -133,7 +133,7 @@ AgendaUrlOptions4=logint=%s to restrict output to actions assigned to use AgendaUrlOptionsProject= project = __ PROJECT_ID __ , lai ierobežotu izlaidi darbībām, kas saistītas ar projektu __ PROJECT_ID __ . AgendaUrlOptionsNotAutoEvent= notactiontype = systemauto , lai izslēgtu automātiskus notikumus. AgendaUrlOptionsIncludeHolidays=  includeholidays = 1 , lai iekļautu svētku pasākumus. -AgendaShowBirthdayEvents=Birthdays of contacts +AgendaShowBirthdayEvents=Kontaktu dzimšanas dienas AgendaHideBirthdayEvents=Slēpt kontaktu dzimšanas dienas Busy=Aizņemts ExportDataset_event1=Notikumu saraksts diff --git a/htdocs/langs/lv_LV/assets.lang b/htdocs/langs/lv_LV/assets.lang index 7779c6b5ec0..29583351333 100644 --- a/htdocs/langs/lv_LV/assets.lang +++ b/htdocs/langs/lv_LV/assets.lang @@ -22,7 +22,7 @@ AccountancyCodeAsset = Grāmatvedības kods (aktīvs) AccountancyCodeDepreciationAsset = Grāmatvedības kods (nolietojuma aktīvu konts) AccountancyCodeDepreciationExpense = Grāmatvedības kods (nolietojuma izmaksu konts) NewAssetType=Jauns aktīvu veids -AssetsTypeSetup=Aktīvu veidu iestatīšana +AssetsTypeSetup=Aktīvu veida iestatīšana AssetTypeModified=Pamatlīdzekļu veids pārveidots AssetType=Aktīva veids AssetsLines=Aktīvi @@ -42,7 +42,7 @@ ModuleAssetsDesc = Aktīvu apraksts AssetsSetup = Aktīvu uzstādīšana Settings = Iestatījumi AssetsSetupPage = Aktīvu iestatīšanas lapa -ExtraFieldsAssetsType = Papildu atribūti (Assets type) +ExtraFieldsAssetsType = Papildu atribūti (aktīvu veids) AssetsType=Aktīva veids AssetsTypeId=Aktīva veida id AssetsTypeLabel=Aktīva veida nosaukums @@ -55,5 +55,13 @@ MenuAssets = Aktīvi MenuNewAsset = Jauns aktīvs MenuTypeAssets = Ierakstiet aktīvus MenuListAssets = Saraksts -MenuNewTypeAssets = Jauns veids +MenuNewTypeAssets = Jauns MenuListTypeAssets = Saraksts + +# +# Module +# +Asset=Aktīvs +NewAssetType=Jauns aktīvu veids +NewAsset=Jauns aktīvs +ConfirmDeleteAsset=Vai tiešām vēlaties dzēst šo īpašumu? diff --git a/htdocs/langs/lv_LV/banks.lang b/htdocs/langs/lv_LV/banks.lang index 7fefb3ed206..ca4bcbbb463 100644 --- a/htdocs/langs/lv_LV/banks.lang +++ b/htdocs/langs/lv_LV/banks.lang @@ -109,13 +109,13 @@ SocialContributionPayment=Sociālā/fiskālā nodokļa samaksa BankTransfer=Kredīta pārvedums BankTransfers=Kredīta pārvedumi MenuBankInternalTransfer=Iekšējā pārsūtīšana -TransferDesc=Use internal transfer to transfer from one account to another, the application will write two records: a debit in the source account and a credit in the target account. The same amount, label and date will be used for this transaction. +TransferDesc=Izmantojiet iekšējo pārskaitījumu, lai pārsūtītu no viena konta uz citu, lietojumprogramma ierakstīs divus ierakstus: debets avota kontā un kredīts mērķa kontā. Šim darījumam tiks izmantota tā pati summa, etiķete un datums. TransferFrom=No TransferTo=Kam TransferFromToDone=No %s nodošana %s par %s %s ir ierakstīta. CheckTransmitter=Nosūtītājs ValidateCheckReceipt=Vai apstiprināt šo čeku? -ConfirmValidateCheckReceipt=Are you sure that you want to submit this check receipt for validation? No changes are possible it's done. +ConfirmValidateCheckReceipt=Vai tiešām vēlaties iesniegt šo čeku apstiprināšanai? Tas nav izdarīts. DeleteCheckReceipt=Dzēst šo čeku? ConfirmDeleteCheckReceipt=Vai tiešām vēlaties dzēst šo čeka kvīti? BankChecks=Bankas čeki @@ -128,7 +128,7 @@ ConfirmDeleteTransaction=Vai tiešām vēlaties dzēst šo ierakstu? ThisWillAlsoDeleteBankRecord=Tas arī izdzēš izveidotos bankas darījumus BankMovements=Kustība PlannedTransactions=Plānotie darījumi -Graph=Graphs +Graph=Grafiki ExportDataset_banque_1=Banku darījumi un konta izraksts ExportDataset_banque_2=Depozīta kvīts TransactionOnTheOtherAccount=Pārskaitījums uz otru kontu @@ -142,7 +142,7 @@ AllAccounts=Visi bankas un naudas konti BackToAccount=Atpakaļ uz kontu ShowAllAccounts=Parādīt visiem kontiem FutureTransaction=Nākotnes darījums. Nevar saskaņot. -SelectChequeTransactionAndGenerate=Select/filter the checks which are to be included in the check deposit receipt. Then, click on "Create". +SelectChequeTransactionAndGenerate=Atlasiet / filtrējiet čekus, kas jāiekļauj čeku depozīta kvītī. Pēc tam noklikšķiniet uz "Izveidot". InputReceiptNumber=Choose the bank statement related with the conciliation. Use a sortable numeric value: YYYYMM or YYYYMMDD EventualyAddCategory=Galu galā, norādiet kategoriju, kurā klasificēt ierakstus ToConciliate=Saskaņot? @@ -174,11 +174,11 @@ YourSEPAMandate=Jūsu SEPA mandāts FindYourSEPAMandate=Tas ir jūsu SEPA mandāts, lai pilnvarotu mūsu uzņēmumu veikt tiešā debeta pasūtījumu savai bankai. Atgriezt to parakstu (skenēt parakstīto dokumentu) vai nosūtīt pa pastu uz AutoReportLastAccountStatement=Veicot saskaņošanu, automātiski aizpildiet lauka “bankas izraksta numurs” ar pēdējo izraksta numuru CashControl=POS kases kontrole -NewCashFence=New cash desk opening or closing +NewCashFence=Jaunas kases atvēršana vai aizvēršana BankColorizeMovement=Krāsojiet kustības BankColorizeMovementDesc=Ja šī funkcija ir iespējota, jūs varat izvēlēties īpašu fona krāsu debeta vai kredīta pārvietošanai BankColorizeMovementName1=Debeta kustības fona krāsa BankColorizeMovementName2=Kredīta aprites fona krāsa IfYouDontReconcileDisableProperty=Ja dažos bankas kontos neveicat bankas saskaņošanu, atspējojiet rekvizītu "%s", lai noņemtu šo brīdinājumu. NoBankAccountDefined=Nav noteikts bankas konts -NoRecordFoundIBankcAccount=No record found in bank account. Commonly, this occurs when a record has been deleted manually from the list of transaction in the bank account (for example during a reconciliation of the bank account). Another reason is that the payment was recorded when the module "%s" was disabled. +NoRecordFoundIBankcAccount=Bankas kontā nav atrasts neviens ieraksts. Parasti tas notiek, ja ieraksts ir manuāli izdzēsts no bankas konta darījumu saraksta (piemēram, bankas konta saskaņošanas laikā). Vēl viens iemesls ir tas, ka maksājums tika reģistrēts, kad tika atspējots modulis "%s". diff --git a/htdocs/langs/lv_LV/bills.lang b/htdocs/langs/lv_LV/bills.lang index 90ad7a9ad47..e5220e44b61 100644 --- a/htdocs/langs/lv_LV/bills.lang +++ b/htdocs/langs/lv_LV/bills.lang @@ -55,7 +55,7 @@ CustomerInvoice=Klienta rēķins CustomersInvoices=Klienta rēķini SupplierInvoice=Piegādātāja rēķins SuppliersInvoices=Piegādātāja rēķini -SupplierInvoiceLines=Vendor invoice lines +SupplierInvoiceLines=Pārdevēja rēķina rindas SupplierBill=Piegādātāja rēķins SupplierBills=Piegādātāja rēķini Payment=Maksājums @@ -82,8 +82,8 @@ PaymentsAlreadyDone=Jau samaksāts PaymentsBackAlreadyDone=Jau veiktas atmaksas PaymentRule=Maksājuma noteikums PaymentMode=Maksājuma veids -DefaultPaymentMode=Default Payment Type -DefaultBankAccount=Default Bank Account +DefaultPaymentMode=Noklusējuma maksājuma veids +DefaultBankAccount=Noklusējuma bankas konts PaymentTypeDC=Debet karte/ kredīt karte PaymentTypePP=PayPal IdPaymentMode=Maksājuma veids (id) @@ -120,7 +120,7 @@ ConvertExcessPaidToReduc=Konvertēt pārsniegto summu par atlaidi EnterPaymentReceivedFromCustomer=Ievadiet no klienta saņemto naudas summu EnterPaymentDueToCustomer=Veikt maksājumu dēļ klientam DisabledBecauseRemainderToPayIsZero=Disabled because remaining unpaid is zero -PriceBase=Base price +PriceBase=Bāzes cena BillStatus=Rēķina statuss StatusOfGeneratedInvoices=Izveidoto rēķinu statuss BillStatusDraft=Melnraksts (jāapstiprina) @@ -259,7 +259,7 @@ DateMaxPayment=Jāapmaksā līdz DateInvoice=Rēķina datums DatePointOfTax=Nodokļu punkts NoInvoice=Nav rēķinu -NoOpenInvoice=No open invoice +NoOpenInvoice=Nav atvērta rēķina ClassifyBill=Klasificēt rēķinu SupplierBillsToPay=Neapmaksāti pārdevēja rēķini CustomerBillsUnpaid=Neapmaksātie klienta rēķini @@ -377,7 +377,7 @@ DateLastGeneration=Jaunākais veidošanas datums DateLastGenerationShort=Datuma pēdējais gen. MaxPeriodNumber=Maks. rēķinu veidošanas skaits NbOfGenerationDone=Rēķina paaudzes skaits jau ir pabeigts -NbOfGenerationOfRecordDone=Number of record generation already done +NbOfGenerationOfRecordDone=Jau veikto ierakstu ģenerēšanas skaits NbOfGenerationDoneShort=Veicamās paaudzes skaits MaxGenerationReached=Maksimālais sasniegto paaudžu skaits InvoiceAutoValidate=Rēķinus automātiski apstiprināt @@ -418,7 +418,7 @@ PaymentCondition14DENDMONTH=14 dienu laikā pēc mēneša beigām FixAmount=Fiksēta summa - 1 rinda ar etiķeti '%s' VarAmount=Mainīgais apjoms (%% kop.) VarAmountOneLine=Mainīgā summa (%% kopā) - 1 rinda ar etiķeti '%s' -VarAmountAllLines=Variable amount (%% tot.) - all lines from origin +VarAmountAllLines=Mainīga summa (%% tot.) - visas līnijas no sākuma # PaymentType PaymentTypeVIR=Bankas pārskaitījums PaymentTypeShortVIR=Bankas pārskaitījums @@ -455,7 +455,7 @@ RegulatedOn=Regulēta uz ChequeNumber=Pārbaudiet N ° ChequeOrTransferNumber=Pārbaudiet / Transfer N ° ChequeBordereau=Pārbaudīt grafiku -ChequeMaker=Check/Transfer sender +ChequeMaker=Pārbaudīt / pārsūtīt sūtītāju ChequeBank=Čeka izsniegšanas banka CheckBank=Čeks NetToBePaid=Neto jāmaksā @@ -499,16 +499,16 @@ Cash=Skaidra nauda Reported=Kavējas DisabledBecausePayments=Nav iespējams, kopš šeit ir daži no maksājumiem CantRemovePaymentWithOneInvoicePaid=Nevar dzēst maksājumu, jo eksistē kaut viens rēķins, kas klasificēts kā samaksāts -CantRemovePaymentVATPaid=Can't remove payment since VAT declaration is classified paid -CantRemovePaymentSalaryPaid=Can't remove payment since salary is classified paid +CantRemovePaymentVATPaid=Nevar noņemt maksājumu, jo PVN deklarācija ir klasificēta kā apmaksāta +CantRemovePaymentSalaryPaid=Nevar noņemt maksājumu, jo alga ir klasificēta kā samaksāta ExpectedToPay=Gaidāmais maksājums CantRemoveConciliatedPayment=Nevar noņemt saskaņoto maksājumu PayedByThisPayment=Samaksāts ar šo maksājumu ClosePaidInvoicesAutomatically=Automātiski klasificējiet visus standarta, priekšapmaksas vai rezerves rēķinus kā “Apmaksāts”, ja maksājums ir pilnībā veikts. ClosePaidCreditNotesAutomatically=Automātiski klasificējiet visas kredītzīmes kā "Apmaksātu", kad atmaksa tiek veikta pilnībā. ClosePaidContributionsAutomatically=Automātiski klasificējiet visas sociālās vai fiskālās iemaksas kā "Apmaksātās", ja maksājums tiek veikts pilnībā. -ClosePaidVATAutomatically=Classify automatically VAT declaration as "Paid" when payment is done entirely. -ClosePaidSalaryAutomatically=Classify automatically salary as "Paid" when payment is done entirely. +ClosePaidVATAutomatically=Ja maksājums tiek veikts pilnībā, automātiski klasificējiet PVN deklarāciju kā “Apmaksāts”. +ClosePaidSalaryAutomatically=Ja maksājums tiek veikts pilnībā, klasificējiet algu automātiski kā “Maksātu”. AllCompletelyPayedInvoiceWillBeClosed=Visi rēķini, kuriem nav jāmaksā, tiks automātiski aizvērti ar statusu "Paid". ToMakePayment=Maksāt ToMakePaymentBack=Atmaksāt @@ -521,10 +521,10 @@ YouMustCreateStandardInvoiceFirstDesc=Vispirms vispirms jāizveido standarta rē PDFCrabeDescription=Rēķina PDF veidne Krabis. Pilna rēķina veidne (vecā Sponge veidnes ieviešana) PDFSpongeDescription=Rēķina PDF veidne Sponge. Pilnīga rēķina veidne PDFCrevetteDescription=Rēķina PDF veidne Crevette. Pabeigta rēķina veidne situāciju rēķiniem -TerreNumRefModelDesc1=Return number in the format %syymm-nnnn for standard invoices and %syymm-nnnn for credit notes where yy is year, mm is month and nnnn is a sequencial auto-incrementing number with no break and no return to 0 -MarsNumRefModelDesc1=Return number in the format %syymm-nnnn for standard invoices, %syymm-nnnn for replacement invoices, %syymm-nnnn for down payment invoices and %syymm-nnnn for credit notes where yy is year, mm is month and nnnn is a sequencial auto-incrementing number with no break and no return to 0 +TerreNumRefModelDesc1=Atgriešanās numurs formātā %syymm-nnnn standarta rēķiniem un %syymm-nnnn kredītzīmēm, kur yy ir gads, mm ir mēnesis, un nnnn ir secīgs automātiski palielināms skaitlis bez pārtraukuma un bez atgriešanās pie 0 +MarsNumRefModelDesc1=Atgriešanas numurs formātā %syymm-nnnn standarta rēķiniem, %syymm-nnnn aizstājējrēķiniem, %syymm-nnnn priekšapmaksas rēķiniem un %syymn-nnnn ir bez pārtraukuma un bez atgriešanās pie 0 TerreNumRefModelError=Rēķinu sākot ar syymm $ jau pastāv un nav saderīgs ar šo modeli secību. Noņemt to vai pārdēvēt to aktivizētu šo moduli. -CactusNumRefModelDesc1=Return number in the format %syymm-nnnn for standard invoices, %syymm-nnnn for credit notes and %syymm-nnnn for down payment invoices where yy is year, mm is month and nnnn is a sequencial auto-incrementing number with no break and no return to 0 +CactusNumRefModelDesc1=Atgriešanās numurs formātā %syymm-nnnn standarta rēķiniem, %syymm-nnnn kredītzīmēm un %syymm-nnnn priekšapmaksas rēķiniem, kur yy ir gads, mm ir mēnesis, un nnnn nav secīgs automātiskais pārtraukums. 0 EarlyClosingReason=Priekšlaicīgas slēgšanas iemesls EarlyClosingComment=Priekšlaicīgās slēgšanas piezīme ##### Types de contacts ##### @@ -590,4 +590,4 @@ FacParentLine=Rēķinu rindas vecāks SituationTotalRayToRest=Atlikušais maksājums bez nodokļa PDFSituationTitle=Situācija Nr. %d SituationTotalProgress=Kopējais progress %d %% -SearchUnpaidInvoicesWithDueDate=Search unpaid invoices with a due date = %s +SearchUnpaidInvoicesWithDueDate=Meklēt neapmaksātos rēķinos ar termiņu = %s diff --git a/htdocs/langs/lv_LV/blockedlog.lang b/htdocs/langs/lv_LV/blockedlog.lang index 3318d1d334c..79ac073bbad 100644 --- a/htdocs/langs/lv_LV/blockedlog.lang +++ b/htdocs/langs/lv_LV/blockedlog.lang @@ -8,7 +8,7 @@ BrowseBlockedLog=Nepārveidojami žurnāli ShowAllFingerPrintsMightBeTooLong=Rādīt visus arhivētos žurnālus (var būt daudz) ShowAllFingerPrintsErrorsMightBeTooLong=Rādīt visus nederīgos arhīva žurnālus (var būt garš) DownloadBlockChain=Lejupielādējiet pirkstu nospiedumus -KoCheckFingerprintValidity=Arhivēts žurnāla ieraksts nav derīgs. Tas nozīmē, ka kāds (hakeris?) Ir mainījis dažus šī ieraksta datus pēc tā ierakstīšanas vai ir izdzēsis iepriekšējo arhivēto ierakstu (pārbaudiet, vai pastāv līnija ar iepriekšējo #). +KoCheckFingerprintValidity=Arhivētais žurnāla ieraksts nav derīgs. Tas nozīmē, ka kāds (hakeris?) Ir pārveidojis dažus šī ieraksta datus pēc to ierakstīšanas, vai ir izdzēsis iepriekšējo arhivēto ierakstu (pārbaudiet, vai pastāv rinda ar iepriekšējo #) vai ir mainījusi iepriekšējā ieraksta kontrolsummu. OkCheckFingerprintValidity=Arhivēts žurnāla ieraksts ir derīgs. Dati par šo līniju netika mainīti un ieraksts seko iepriekšējam. OkCheckFingerprintValidityButChainIsKo=Arhivētais žurnāls šķiet derīgs salīdzinājumā ar iepriekšējo, bet ķēde agrāk tika bojāta. AddedByAuthority=Uzglabāti tālvadības iestādē @@ -35,7 +35,7 @@ logDON_DELETE=Ziedojuma loģiska dzēšana logMEMBER_SUBSCRIPTION_CREATE=Dalībnieka abonements izveidots logMEMBER_SUBSCRIPTION_MODIFY=Dalībnieku abonēšana ir labota logMEMBER_SUBSCRIPTION_DELETE=Locekļu abonēšanas loģiskā dzēšana -logCASHCONTROL_VALIDATE=Cash desk closing recording +logCASHCONTROL_VALIDATE=Kases slēgšanas ieraksts BlockedLogBillDownload=Klientu rēķinu lejupielāde BlockedLogBillPreview=Klienta rēķina priekšskatījums BlockedlogInfoDialog=Žurnāla detaļas diff --git a/htdocs/langs/lv_LV/boxes.lang b/htdocs/langs/lv_LV/boxes.lang index e861854a92e..bc76a9b79d3 100644 --- a/htdocs/langs/lv_LV/boxes.lang +++ b/htdocs/langs/lv_LV/boxes.lang @@ -18,13 +18,13 @@ BoxLastActions=Jaunākās darbības BoxLastContracts=Jaunākie līgumi BoxLastContacts=Jaunākie kontakti/adreses BoxLastMembers=Jaunākie dalībnieki -BoxLastModifiedMembers=Latest modified members -BoxLastMembersSubscriptions=Latest member subscriptions +BoxLastModifiedMembers=Jaunākie modificētie dalībnieki +BoxLastMembersSubscriptions=Jaunākie dalībnieku abonementi BoxFicheInter=Jaunākās intervences BoxCurrentAccounts=Atvērto kontu atlikums BoxTitleMemberNextBirthdays=Šī mēneša dzimšanas dienas (dalībnieki) -BoxTitleMembersByType=Members by type -BoxTitleMembersSubscriptionsByYear=Members Subscriptions by year +BoxTitleMembersByType=Locekļi pēc veida +BoxTitleMembersSubscriptionsByYear=Dalībnieku abonēšana pēc gada BoxTitleLastRssInfos=Jaunākās %s ziņas no %s BoxTitleLastProducts=Produkti / Pakalpojumi: pēdējais %s modificēts BoxTitleProductsAlertStock=Produkti: krājumu brīdinājums @@ -46,11 +46,11 @@ BoxMyLastBookmarks=Grāmatzīmes: jaunākās %s BoxOldestExpiredServices=Vecākais aktīvais beidzies pakalpojums BoxLastExpiredServices=Jaunākie %s vecākie kontakti ar aktīviem derīguma termiņa beigām BoxTitleLastActionsToDo=Jaunākās %s darbības, ko darīt -BoxTitleLastContracts=Latest %s contracts which were modified -BoxTitleLastModifiedDonations=Latest %s donations which were modified -BoxTitleLastModifiedExpenses=Latest %s expense reports which were modified -BoxTitleLatestModifiedBoms=Latest %s BOMs which were modified -BoxTitleLatestModifiedMos=Latest %s Manufacturing Orders which were modified +BoxTitleLastContracts=Jaunākie %s līgumi, kas tika mainīti +BoxTitleLastModifiedDonations=Jaunākie %s ziedojumi, kas tika mainīti +BoxTitleLastModifiedExpenses=Jaunākie %s izdevumu pārskati, kas tika mainīti +BoxTitleLatestModifiedBoms=Jaunākās %s moduļi +BoxTitleLatestModifiedMos=Jaunākie %s ražošanas pasūtījumi, kas tika mainīti BoxTitleLastOutstandingBillReached=Pārsniegti klienti ar maksimālo nesamaksāto summu BoxGlobalActivity=Global darbība (pavadzīmes, priekšlikumi, rīkojumi) BoxGoodCustomers=Labi klienti @@ -112,9 +112,9 @@ BoxTitleLastCustomerShipments=Jaunākie %s klientu sūtījumi NoRecordedShipments=Nav reģistrēts klienta sūtījums BoxCustomersOutstandingBillReached=Ir sasniegti klienti ar ierobežojumu # Pages -UsersHome=Home users and groups -MembersHome=Home Membership -ThirdpartiesHome=Home Thirdparties -TicketsHome=Home Tickets -AccountancyHome=Home Accountancy +UsersHome=Mājas lietotāji un grupas +MembersHome=Dalība mājās +ThirdpartiesHome=Mājas trešās puses +TicketsHome=Mājas biļetes +AccountancyHome=Mājas grāmatvedība ValidatedProjects=Apstiprināti projekti diff --git a/htdocs/langs/lv_LV/cashdesk.lang b/htdocs/langs/lv_LV/cashdesk.lang index bedf85060f9..fa44b524a1d 100644 --- a/htdocs/langs/lv_LV/cashdesk.lang +++ b/htdocs/langs/lv_LV/cashdesk.lang @@ -41,8 +41,8 @@ Floor=Stāvs AddTable=Pievienot tabulu Place=Vieta TakeposConnectorNecesary=Ir nepieciešams "TakePOS Connector" -OrderPrinters=Add a button to send the order to some given printers, without payment (for example to send an order to a kitchen) -NotAvailableWithBrowserPrinter=Not available when printer for receipt is set to browser: +OrderPrinters=Pievienojiet pogu, lai pasūtījumu nosūtītu dažiem norādītajiem printeriem bez maksas (piemēram, lai nosūtītu pasūtījumu uz virtuvi) +NotAvailableWithBrowserPrinter=Nav pieejams, ja printeris saņemšanai ir iestatīts uz pārlūku: SearchProduct=Meklēt produktu Receipt=Saņemšana Header=Galvene @@ -57,9 +57,9 @@ Paymentnumpad=Padeves veids maksājuma ievadīšanai Numberspad=Numbers Pad BillsCoinsPad=Monētas un banknotes DolistorePosCategory=TakePOS moduļi un citi POS risinājumi Dolibarr -TakeposNeedsCategories=TakePOS needs at least one product categorie to work -TakeposNeedsAtLeastOnSubCategoryIntoParentCategory=TakePOS needs at least 1 product category under the category %s to work -OrderNotes=Can add some notes to each ordered items +TakeposNeedsCategories=Lai darbotos, TakePOS ir nepieciešama vismaz viena produktu kategorija +TakeposNeedsAtLeastOnSubCategoryIntoParentCategory=Lai darbotos, TakePOS nepieciešama vismaz viena produktu kategorija kategorijā %s +OrderNotes=Var pievienot dažas piezīmes katram pasūtītajam priekšmetam CashDeskBankAccountFor=Noklusējuma konts, ko izmantot maksājumiem NoPaimementModesDefined=TakePOS konfigurācijā nav definēts paiment režīms TicketVatGrouped=Grupējiet PVN pēc likmes biļetēs | kvītis @@ -84,7 +84,7 @@ InvoiceIsAlreadyValidated=Rēķins jau ir apstiprināts NoLinesToBill=Nav rēķinu CustomReceipt=Pielāgota kvīts ReceiptName=Kvīts nosaukums -ProductSupplements=Manage supplements of products +ProductSupplements=Pārvaldiet produktu papildinājumus SupplementCategory=Papildinājuma kategorija ColorTheme=Krāsu tēma Colorful=Krāsains @@ -94,7 +94,7 @@ Browser=Pārlūkprogramma BrowserMethodDescription=Vienkārša un ērta kvīts drukāšana. Tikai daži parametri, lai konfigurētu kvīti. Drukājiet, izmantojot pārlūku. TakeposConnectorMethodDescription=Ārējs modulis ar papildu funkcijām. Iespēja drukāt no mākoņa. PrintMethod=Drukas metode -ReceiptPrinterMethodDescription=Powerful method with a lot of parameters. Full customizable with templates. The server hosting the application can't be in the Cloud (must be able to reach the printers in your network). +ReceiptPrinterMethodDescription=Jaudīga metode ar daudziem parametriem. Pilnībā pielāgojams ar veidnēm. Serveris, kurā mitinās lietojumprogramma, nevar atrasties mākonī (tam jāspēj sasniegt jūsu tīkla printerus). ByTerminal=Ar termināli TakeposNumpadUsePaymentIcon=Izmantojiet ikonu, nevis tekstu uz numpad numura maksāšanas pogām CashDeskRefNumberingModules=Numerācijas modulis tirdzniecības vietu tirdzniecībai @@ -102,7 +102,7 @@ CashDeskGenericMaskCodes6 =  
    {TN} tagu izmanto, lai pievienotu te TakeposGroupSameProduct=Grupējiet tās pašas produktu līnijas StartAParallelSale=Sāciet jaunu paralēlu izpārdošanu SaleStartedAt=Pārdošana sākās vietnē %s -ControlCashOpening=Open the "Control cash" popup when opening the POS +ControlCashOpening=Atverot POS, atveriet uznirstošo logu “Kontrolēt skaidru naudu” CloseCashFence=Aizveriet kases kontroli CashReport=Skaidras naudas pārskats MainPrinterToUse=Galvenais izmantojamais printeris @@ -126,5 +126,5 @@ ModuleReceiptPrinterMustBeEnabled=Vispirms jābūt iespējotam moduļa saņemša AllowDelayedPayment=Atļaut kavētu maksājumu PrintPaymentMethodOnReceipts=Izdrukājiet maksājuma veidu uz biļetēm | WeighingScale=Svari -ShowPriceHT = Display the column with the price excluding tax (on screen) -ShowPriceHTOnReceipt = Display the column with the price excluding tax (on receipt) +ShowPriceHT = Parādīt kolonnu ar cenu bez nodokļiem (ekrānā) +ShowPriceHTOnReceipt = Parādīt kolonnu ar cenu bez nodokļiem (saņemot) diff --git a/htdocs/langs/lv_LV/categories.lang b/htdocs/langs/lv_LV/categories.lang index 9be0e84b700..17b9a57000f 100644 --- a/htdocs/langs/lv_LV/categories.lang +++ b/htdocs/langs/lv_LV/categories.lang @@ -3,20 +3,20 @@ Rubrique=Etiķete/Sadaļa Rubriques=Etiķetes/Sadaļas RubriquesTransactions=Tags/Categories of transactions categories=etiķetes/sadaļas -NoCategoryYet=No tag/category of this type has been created +NoCategoryYet=Šāda veida tags / kategorija nav izveidota In=Uz AddIn=Pievienot modify=modificēt Classify=Klasificēt CategoriesArea=Etiķešu/Sadaļu sadaļa -ProductsCategoriesArea=Product/Service tags/categories area -SuppliersCategoriesArea=Vendor tags/categories area -CustomersCategoriesArea=Customer tags/categories area -MembersCategoriesArea=Member tags/categories area -ContactsCategoriesArea=Contact tags/categories area -AccountsCategoriesArea=Bank account tags/categories area -ProjectsCategoriesArea=Project tags/categories area -UsersCategoriesArea=User tags/categories area +ProductsCategoriesArea=Produktu / pakalpojumu tagu / kategoriju apgabals +SuppliersCategoriesArea=Pārdevēja tagu / kategoriju apgabals +CustomersCategoriesArea=Klientu tagu / kategoriju apgabals +MembersCategoriesArea=Dalībnieku tagu / kategoriju apgabals +ContactsCategoriesArea=Kontaktu tagu / kategoriju apgabals +AccountsCategoriesArea=Bankas kontu tagi / kategoriju apgabals +ProjectsCategoriesArea=Projekta tagu / kategoriju apgabals +UsersCategoriesArea=Lietotāju tagu / kategoriju apgabals SubCats=Apakšsadaļas CatList=Atslēgvārdu/sadaļu saraksts CatListAll=Tagu / kategoriju saraksts (visi veidi) @@ -93,7 +93,7 @@ AddSupplierIntoCategory=Piešķirt kategoriju piegādātājam ShowCategory=Show tag/category ByDefaultInList=By default in list ChooseCategory=Izvēlies sadaļu -StocksCategoriesArea=Warehouse Categories -ActionCommCategoriesArea=Event Categories +StocksCategoriesArea=Noliktavas kategorijas +ActionCommCategoriesArea=Pasākumu kategorijas WebsitePagesCategoriesArea=Lapu konteineru kategorijas -UseOrOperatorForCategories=Use 'OR' operator for categories +UseOrOperatorForCategories=Kategorijām izmantojiet operatoru “OR” diff --git a/htdocs/langs/lv_LV/commercial.lang b/htdocs/langs/lv_LV/commercial.lang index 294d6b7c321..2a5b51abed4 100644 --- a/htdocs/langs/lv_LV/commercial.lang +++ b/htdocs/langs/lv_LV/commercial.lang @@ -64,10 +64,11 @@ ActionAC_SHIP=Nosūtīt piegādi pa pastu ActionAC_SUP_ORD=Nosūtiet pirkumu pa pastu ActionAC_SUP_INV=Nosūtiet pārdevēju rēķinu pa pastu ActionAC_OTH=Cits -ActionAC_OTH_AUTO=Automātiski ievietoti notikumi +ActionAC_OTH_AUTO=Cits auto ActionAC_MANUAL=Manuāli ievietoti notikumi ActionAC_AUTO=Automātiski ievietoti notikumi -ActionAC_OTH_AUTOShort=Auto +ActionAC_OTH_AUTOShort=Cits +ActionAC_EVENTORGANIZATION=Pasākumu organizēšanas pasākumi Stats=Tirdzniecības statistika StatusProsp=Prospekta statuss DraftPropals=Izstrādā komerciālos priekšlikumus diff --git a/htdocs/langs/lv_LV/companies.lang b/htdocs/langs/lv_LV/companies.lang index f9471964586..046527ed90e 100644 --- a/htdocs/langs/lv_LV/companies.lang +++ b/htdocs/langs/lv_LV/companies.lang @@ -2,9 +2,9 @@ ErrorCompanyNameAlreadyExists=Uzņēmuma nosaukums %s jau pastāv. Izvēlieties citu. ErrorSetACountryFirst=Izvēlieties vispirms valsti SelectThirdParty=Izvēlieties trešo pusi -ConfirmDeleteCompany=Are you sure you want to delete this company and all related information? +ConfirmDeleteCompany=Vai tiešām vēlaties dzēst šo uzņēmumu un visu saistīto informāciju? DeleteContact=Izdzēst kontaktu / adresi -ConfirmDeleteContact=Are you sure you want to delete this contact and all related information? +ConfirmDeleteContact=Vai tiešām vēlaties dzēst šo kontaktpersonu un visu saistīto informāciju? MenuNewThirdParty=Jauna trešā persona MenuNewCustomer=Jauns klients MenuNewProspect=Jauns prospekts @@ -43,10 +43,10 @@ Individual=Privātpersona ToCreateContactWithSameName=Automātiski izveidos kontaktu / adresi ar tādu pašu informāciju kā trešā persona trešās puses ietvaros. Vairumā gadījumu pat tad, ja jūsu trešā persona ir fiziska persona, pietiek ar trešās personas izveidošanu vien. ParentCompany=Mātes uzņēmums Subsidiaries=Filiāles -ReportByMonth=Report per month -ReportByCustomers=Report per customer -ReportByThirdparties=Report per thirdparty -ReportByQuarter=Report per rate +ReportByMonth=Pārskats mēnesī +ReportByCustomers=Pārskats par katru klientu +ReportByThirdparties=Ziņojums par katru trešo personu +ReportByQuarter=Ziņot par likmi CivilityCode=Pieklājība kods RegisteredOffice=Juridiskā adrese Lastname=Uzvārds @@ -69,7 +69,7 @@ PhoneShort=Telefons Skype=Skype Call=Zvanīt Chat=Čats -PhonePro=Bus. phone +PhonePro=Autobuss. tālruni PhonePerso=Pers. telefons PhoneMobile=Mobilais No_Email=Atteikties no lielapjoma pasta sūtījumiem @@ -173,17 +173,17 @@ ProfId1ES=Prof ID 1 (CIF / NIF) ProfId2ES=Prof Id 2 (Sociālās apdrošināšanas numurs) ProfId3ES=Prof Id 3 (CNAE) ProfId4ES=Prof Id 4 (Collegiate numurs) -ProfId5ES=Prof Id 5 (EORI number) +ProfId5ES=Prof Id 5 (EORI numurs) ProfId6ES=- ProfId1FR=Prof ID 1 (Sirēnas) ProfId2FR=Prof Id 2 (SIRET) ProfId3FR=Prof Id 3 (NBS, vecais APE) ProfId4FR=Prof Id 4 (RCS / RM) -ProfId5FR=Prof Id 5 (numéro EORI) +ProfId5FR=Prof Id 5 (numoro EORI) ProfId6FR=- ProfId1ShortFR=SIREN ProfId2ShortFR=SIRET -ProfId3ShortFR=NAF +ProfId3ShortFR=NBS ProfId4ShortFR=RCS ProfId5ShortFR=EORI ProfId6ShortFR=- @@ -239,7 +239,7 @@ ProfId1PT=Prof ID 1 (NIPC) ProfId2PT=Prof Id 2 (Sociālās apdrošināšanas numurs) ProfId3PT=Prof Id 3 (Tirdzniecības Ieraksta numurs) ProfId4PT=Prof Id 4 (konservatorija) -ProfId5PT=Prof Id 5 (EORI number) +ProfId5PT=Prof Id 5 (EORI numurs) ProfId6PT=- ProfId1SN=RC ProfId2SN=NINEA @@ -263,7 +263,7 @@ ProfId1RO=1. prof. ID (CUI) ProfId2RO=Prof Id 2 (Nr. Manmatriculare) ProfId3RO=3. profils (CAEN) ProfId4RO=Prof Id 5 (EUID) -ProfId5RO=Prof Id 5 (EORI number) +ProfId5RO=Prof Id 5 (EORI numurs) ProfId6RO=- ProfId1RU=Prof ID 1 (BIN) ProfId2RU=Prof Id 2 (INN) @@ -331,7 +331,7 @@ CustomerCodeDesc=Klienta kods, unikāls visiem klientiem SupplierCodeDesc=Pārdevēja kods, unikāls visiem pārdevējiem RequiredIfCustomer=Nepieciešams, ja trešā puse ir klients vai perspektīva RequiredIfSupplier=Nepieciešams, ja trešā puse ir pārdevējs -ValidityControledByModule=Validity controlled by the module +ValidityControledByModule=Derīgumu kontrolē modulis ThisIsModuleRules=Noteikumi šim modulim ProspectToContact=Perspektīva ar ko sazināties CompanyDeleted=Kompānija "%s" dzēsta no datubāzes. @@ -439,22 +439,22 @@ ListSuppliersShort=Pārdevēju saraksts ListProspectsShort=Perspektīvu saraksts ListCustomersShort=Klientu saraksts ThirdPartiesArea=Trešās puses/Kontakti -LastModifiedThirdParties=Latest %s Third Parties which were modified -UniqueThirdParties=Total number of Third Parties +LastModifiedThirdParties=Jaunākās %s Trešās puses, kas tika modificētas +UniqueThirdParties=Kopējais trešo personu skaits InActivity=Atvērts ActivityCeased=Slēgts ThirdPartyIsClosed=Trešā persona ir slēgta -ProductsIntoElements=List of products/services mapped to %s +ProductsIntoElements=Produktu / pakalpojumu saraksts, kas kartēti ar %s CurrentOutstandingBill=Current outstanding bill OutstandingBill=Maks. par izcilu rēķinu OutstandingBillReached=Maks. par izcilu rēķinu OrderMinAmount=Minimālā pasūtījuma summa -MonkeyNumRefModelDesc=Return a number in the format %syymm-nnnn for the customer code and %syymm-nnnn for the vendor code where yy is year, mm is month and nnnn is a sequencial auto-incrementing number with no break and no return to 0. +MonkeyNumRefModelDesc=Klienta kodam atgrieziet skaitli formātā %syymm-nnnn un pārdevēja kodam %syymm-nnnn, kur yy ir gads, mm ir mēnesis, un nnnn ir secīgs automātiskās pieauguma skaitlis bez pārtraukuma un bez atgriešanās uz 0. LeopardNumRefModelDesc=Kods ir bez maksas. Šo kodu var mainīt jebkurā laikā. ManagingDirectors=Menedžera(u) vārds (CEO, direktors, prezidents...) MergeOriginThirdparty=Duplicate third party (third party you want to delete) MergeThirdparties=Apvienot trešās puses -ConfirmMergeThirdparties=Are you sure you want to merge the chosen third party with the current one? All linked objects (invoices, orders, ...) will be moved to the current third party, after which the chosen third party will be deleted. +ConfirmMergeThirdparties=Vai tiešām vēlaties apvienot izvēlēto trešo pusi ar pašreizējo? Visi saistītie objekti (rēķini, pasūtījumi, ...) tiks pārvietoti uz pašreizējo trešo pusi, pēc tam izvēlētā trešā puse tiks izdzēsta. ThirdpartiesMergeSuccess=Trešās puses ir apvienotas SaleRepresentativeLogin=Tirdzniecības pārstāvja pieteikšanās SaleRepresentativeFirstname=Tirdzniecības pārstāvja vārds diff --git a/htdocs/langs/lv_LV/compta.lang b/htdocs/langs/lv_LV/compta.lang index 9e153347a87..28483b81d2f 100644 --- a/htdocs/langs/lv_LV/compta.lang +++ b/htdocs/langs/lv_LV/compta.lang @@ -65,7 +65,7 @@ LT2SupplierIN=SGST pirkumi VATCollected=Iekasētais PVN StatusToPay=Jāsamaksā SpecialExpensesArea=Sadaļa visiem īpašajiem maksājumiem -VATExpensesArea=Area for all TVA payments +VATExpensesArea=Platība visiem TVA maksājumiem SocialContribution=Sociālais vai fiskālais nodoklis SocialContributions=Sociālie vai fiskālie nodokļi SocialContributionsDeductibles=Atskaitāmi sociālie vai fiskālie nodokļi @@ -86,7 +86,7 @@ PaymentCustomerInvoice=Klienta rēķina apmaksa PaymentSupplierInvoice=pārdevēja rēķina apmaksa PaymentSocialContribution=Social/fiscal tax payment PaymentVat=PVN maksājumi -AutomaticCreationPayment=Automatically record the payment +AutomaticCreationPayment=Automātiski reģistrēt maksājumu ListPayment=Maksājumu saraksts ListOfCustomerPayments=Klientu maksājumu saraksts ListOfSupplierPayments=Pārdevēja maksājumu saraksts @@ -106,8 +106,8 @@ LT2PaymentES=IRPF Maksājumu LT2PaymentsES=IRPF Maksājumi VATPayment=Tirdzniecības nodokļa samaksa VATPayments=Tirdzniecības nodokļa maksājumi -VATDeclarations=VAT declarations -VATDeclaration=VAT declaration +VATDeclarations=PVN deklarācijas +VATDeclaration=PVN deklarācija VATRefund=PVN atmaksa NewVATPayment=Jauns apgrozījuma nodokļa maksājums NewLocalTaxPayment=Jauns nodokļa %s maksājums @@ -135,20 +135,20 @@ NewCheckReceipt=Jauna atlaide NewCheckDeposit=Jauns pārbaude depozīts NewCheckDepositOn=Izveidot kvīti par depozīta kontā: %s NoWaitingChecks=No checks awaiting deposit. -DateChequeReceived=Check receiving date +DateChequeReceived=Pārbaudiet saņemšanas datumu NbOfCheques=Pārbaužu skaits PaySocialContribution=Maksāt sociālo/fiskālo nodokli -PayVAT=Pay a VAT declaration -PaySalary=Pay a salary card -ConfirmPaySocialContribution=Are you sure you want to classify this social or fiscal tax as paid ? -ConfirmPayVAT=Are you sure you want to classify this VAT declaration as paid ? -ConfirmPaySalary=Are you sure you want to classify this salary card as paid? +PayVAT=Samaksājiet PVN deklarāciju +PaySalary=Samaksājiet algas karti +ConfirmPaySocialContribution=Vai tiešām vēlaties klasificēt šo sociālo vai fiskālo nodokli kā samaksātu? +ConfirmPayVAT=Vai tiešām vēlaties klasificēt šo PVN deklarāciju kā apmaksātu? +ConfirmPaySalary=Vai tiešām vēlaties klasificēt šo algas karti kā apmaksātu? DeleteSocialContribution=Dzēst sociālo vai fiskālo nodokļu maksājumu -DeleteVAT=Delete a VAT declaration -DeleteSalary=Delete a salary card -ConfirmDeleteSocialContribution=Are you sure you want to delete this social/fiscal tax payment ? -ConfirmDeleteVAT=Are you sure you want to delete this VAT declaration ? -ConfirmDeleteSalary=Are you sure you want to delete this salary? +DeleteVAT=Dzēst PVN deklarāciju +DeleteSalary=Dzēst algas karti +ConfirmDeleteSocialContribution=Vai tiešām vēlaties dzēst šo sociālā / fiskālā nodokļa maksājumu? +ConfirmDeleteVAT=Vai tiešām vēlaties dzēst šo PVN deklarāciju? +ConfirmDeleteSalary=Vai tiešām vēlaties dzēst šo algu? ExportDataset_tax_1=Sociālie un fiskālie nodokļi un maksājumi CalcModeVATDebt=Mode %sVAT par saistību accounting%s. CalcModeVATEngagement=Mode %sVAT par ienākumu-expense%sS. @@ -175,7 +175,7 @@ RulesResultInOut=- It includes the real payments made on invoices, expenses, VAT RulesCADue=- Tajā ir iekļauti klienta rēķini, par kuriem ir samaksāts.
    - tas ir balstīts uz šo rēķinu apmaksas datumu.
    RulesCAIn=- Tas ietver visus no klientiem saņemto rēķinu faktiskos maksājumus.
    - Tas ir balstīts uz šo rēķinu apmaksas datumu RulesCATotalSaleJournal=Tas ietver visas kredītlīnijas no pārdošanas žurnāla. -RulesSalesTurnoverOfIncomeAccounts=It includes (credit - debit) of lines for product accounts in group INCOME +RulesSalesTurnoverOfIncomeAccounts=Tas ietver (kredīts - debets) rindas produktu kontiem IENĀKUMS RulesAmountOnInOutBookkeepingRecord=Tas ietver jūsu Ledger ierakstu ar grāmatvedības kontiem, kuriem ir grupa "IZDEVUMS" vai "IENĀKUMS" RulesResultBookkeepingPredefined=Tas ietver jūsu Ledger ierakstu ar grāmatvedības kontiem, kuriem ir grupa "IZDEVUMS" vai "IENĀKUMS" RulesResultBookkeepingPersonalized=Tas rāda jūsu grāmatvedībā ierakstu ar grāmatvedības kontiem grupējot pēc personalizētām grupām @@ -196,7 +196,7 @@ VATReportByThirdParties=Trešo personu pārdošanas nodokļa pārskats VATReportByCustomers=Pārdošanas nodokļa pārskats pēc klienta VATReportByCustomersInInputOutputMode=Ziņojums klientu PVN iekasē un izmaksā VATReportByQuartersInInputOutputMode=Ienākuma nodokļa likmes aprēķins par iekasēto un samaksāto nodokli -VATReportShowByRateDetails=Show details of this rate +VATReportShowByRateDetails=Parādīt detalizētu informāciju par šo likmi LT1ReportByQuarters=Ziņot par nodokli 2 pēc likmes LT2ReportByQuarters=Ziņojiet par nodokli 3 pēc likmes LT1ReportByQuartersES=Report by RE rate @@ -231,7 +231,7 @@ Pcg_subtype=PCG apakštipu InvoiceLinesToDispatch=Rēķina līnijas nosūtīšanas ByProductsAndServices=Pēc produkta un pakalpojuma RefExt=Ārējā ref -ToCreateAPredefinedInvoice=To create a template invoice, create a standard invoice, then, without validating it, click on button "%s". +ToCreateAPredefinedInvoice=Lai izveidotu rēķina veidni, izveidojiet standarta rēķinu, pēc tam, to neapstiprinot, noklikšķiniet uz pogas "%s". LinkedOrder=Saite uz pasūtījumu Mode1=Metode 1 Mode2=Metode 2 @@ -249,8 +249,8 @@ ACCOUNTING_ACCOUNT_CUSTOMER_Desc=Īpašais grāmatvedības konts, kas noteikts t ACCOUNTING_ACCOUNT_SUPPLIER=Pārdevēja trešo personu grāmatvedības konts ACCOUNTING_ACCOUNT_SUPPLIER_Desc=Trešās puses kartē noteiktais īpašais grāmatvedības konts tiks izmantots tikai Subledger grāmatvedībai. Tas tiks izmantots galvenajai grāmatai un Subledger grāmatvedības noklusējuma vērtība, ja nav definēts īpašs pārdevēja grāmatvedības konts trešajā pusē. ConfirmCloneTax=Apstipriniet sociālā / fiskālā nodokļa klonu -ConfirmCloneVAT=Confirm the clone of a VAT declaration -ConfirmCloneSalary=Confirm the clone of a salary +ConfirmCloneVAT=Apstipriniet PVN deklarācijas klonu +ConfirmCloneSalary=Apstipriniet algas klonu CloneTaxForNextMonth=Klonēt nākošam mēnesim SimpleReport=Vienkāršs pārskats AddExtraReport=Papildu pārskati (pievienojiet ārvalstu un valsts klientu pārskatu) @@ -269,8 +269,8 @@ AccountingAffectation=Grāmatvedības uzskaite LastDayTaxIsRelatedTo=Nodokļa pēdējā diena ir saistīta ar VATDue=Pieprasītais pārdošanas nodoklis ClaimedForThisPeriod=Pretendē uz periodu -PaidDuringThisPeriod=Paid for this period -PaidDuringThisPeriodDesc=This is the sum of all payments linked to VAT declarations which have an end-of-period date in the selected date range +PaidDuringThisPeriod=Samaksāts par šo periodu +PaidDuringThisPeriodDesc=Šī ir visu to maksājumu summa, kas saistīti ar PVN deklarācijām un kuru izvēlētajā datumu diapazonā ir perioda beigu datums ByVatRate=Ar pārdošanas nodokļa likmi TurnoverbyVatrate=Apgrozījums, par kuru tiek aprēķināta pārdošanas nodokļa likme TurnoverCollectedbyVatrate=Apgrozījums, kas iegūts, pārdodot nodokli @@ -281,14 +281,14 @@ PurchaseTurnoverCollected=Apkopots pirkumu apgrozījums RulesPurchaseTurnoverDue=- Tajā ir iekļauti piegādātāja rēķini par samaksu neatkarīgi no tā, vai tie ir samaksāti.
    - tas ir balstīts uz šo rēķinu izrakstīšanas datumu.
    RulesPurchaseTurnoverIn=- Tas ietver visus faktiskos rēķinu maksājumus, kas veikti piegādātājiem.
    - tas ir balstīts uz šo rēķinu apmaksas datumu
    RulesPurchaseTurnoverTotalPurchaseJournal=Tas ietver visas pirkuma žurnāla debeta līnijas. -RulesPurchaseTurnoverOfExpenseAccounts=It includes (debit - credit) of lines for product accounts in group EXPENSE +RulesPurchaseTurnoverOfExpenseAccounts=Tas ietver (debets - kredīts) līnijas produktu kontiem grupā EXPENSE ReportPurchaseTurnover=Par pirkuma apgrozījumu izrakstīts rēķins ReportPurchaseTurnoverCollected=Apkopots pirkumu apgrozījums IncludeVarpaysInResults = Pārskatos iekļaujiet dažādus maksājumus IncludeLoansInResults = Iekļaujiet pārskatos aizdevumus -InvoiceLate30Days = Invoices late > 30 days -InvoiceLate15Days = Invoices late > 15 days -InvoiceLateMinus15Days = Invoices late -InvoiceNotLate = To be collected < 15 days -InvoiceNotLate15Days = To be collected in 15 days -InvoiceNotLate30Days = To be collected in 30 days +InvoiceLate30Days = Rēķini nokavēti> 30 dienas +InvoiceLate15Days = Rēķini nokavēti> 15 dienas +InvoiceLateMinus15Days = Kavēti rēķini +InvoiceNotLate = Jāsavāc <15 dienas +InvoiceNotLate15Days = Tiek savākts 15 dienu laikā +InvoiceNotLate30Days = Tiek savākts 30 dienu laikā diff --git a/htdocs/langs/lv_LV/cron.lang b/htdocs/langs/lv_LV/cron.lang index 12595393d64..062d5230372 100644 --- a/htdocs/langs/lv_LV/cron.lang +++ b/htdocs/langs/lv_LV/cron.lang @@ -60,7 +60,7 @@ CronErrEndDateStartDt=Beigu datums nevar būt pirms sākuma datuma StatusAtInstall=Statuss moduļa instalācijā CronStatusActiveBtn=Grafiks CronStatusInactiveBtn=Izslēgt -CronTaskInactive=This job is disabled (not scheduled) +CronTaskInactive=Šis darbs ir atspējots (nav ieplānots) CronId=Id CronClassFile=Faila nosaukums ar klasi CronModuleHelp=Dolibarr moduļu direktorijas nosaukums (arī darbojas ar ārēju Dolibarr moduli).
    Piemēram, lai izsauktu Dolibarr produkta objektu /htdocs/product/class/product.class.php iegūšanas metodi, moduļa vērtība ir
    produkts diff --git a/htdocs/langs/lv_LV/deliveries.lang b/htdocs/langs/lv_LV/deliveries.lang index fa28f02fb09..cfe026979d6 100644 --- a/htdocs/langs/lv_LV/deliveries.lang +++ b/htdocs/langs/lv_LV/deliveries.lang @@ -27,5 +27,7 @@ Recipient=Saņēmējs ErrorStockIsNotEnough=Nav pietiekami daudz krājumu Shippable=Shippable NonShippable=Nav nosūtāms +ShowShippableStatus=Rādīt pārsūtāmo statusu ShowReceiving=Rādīt piegādes kvīti NonExistentOrder=Neeksistējošs pasūtījums +StockQuantitiesAlreadyAllocatedOnPreviousLines = Krājumu daudzumi, kas jau piešķirti iepriekšējās rindās diff --git a/htdocs/langs/lv_LV/dict.lang b/htdocs/langs/lv_LV/dict.lang index a56b6837c4a..1b232c953ca 100644 --- a/htdocs/langs/lv_LV/dict.lang +++ b/htdocs/langs/lv_LV/dict.lang @@ -290,7 +290,7 @@ CurrencyXOF=CFA franki BCEAO CurrencySingXOF=CFA Franc BCEAO CurrencyXPF=KZP franki CurrencySingXPF=CFP Franc -CurrencyCentEUR=centiem +CurrencyCentEUR=centi CurrencyCentSingEUR=cents CurrencyCentINR=paisa CurrencyCentSingINR=paise diff --git a/htdocs/langs/lv_LV/donations.lang b/htdocs/langs/lv_LV/donations.lang index e9ae4ae5464..26019bfad78 100644 --- a/htdocs/langs/lv_LV/donations.lang +++ b/htdocs/langs/lv_LV/donations.lang @@ -7,7 +7,6 @@ AddDonation=Izveidot ziedojumu NewDonation=Jauns ziedojums DeleteADonation=Dzēst ziedojumu ConfirmDeleteADonation=Vai tiešām vēlaties dzēst šo ziedojumu? -ShowDonation=Rādīt ziedojumu PublicDonation=Sabiedrības ziedojums DonationsArea=Ziedojumu sadaļa DonationStatusPromiseNotValidated=Sagataves solījums @@ -33,3 +32,4 @@ DONATION_ART238=Show article 238 from CGI if you are concerned DONATION_ART885=Show article 885 from CGI if you are concerned DonationPayment=Ziedojuma maksājums DonationValidated=Ziedojums %s apstiprināts +DonationUseThirdparties=Izmantojiet esošo donoru kā donoru koordinātas diff --git a/htdocs/langs/lv_LV/ecm.lang b/htdocs/langs/lv_LV/ecm.lang index 459119bffcd..d3549d4d369 100644 --- a/htdocs/langs/lv_LV/ecm.lang +++ b/htdocs/langs/lv_LV/ecm.lang @@ -41,7 +41,7 @@ FileNotYetIndexedInDatabase=Fails vēl nav indeksēts datu bāzē (mēģiniet to ExtraFieldsEcmFiles=Extrafields Ecm failus ExtraFieldsEcmDirectories=Extrafields Ecm direktoriji ECMSetup=ECM iestatīšana -GenerateImgWebp=Duplicate all images with another version with .webp format -ConfirmGenerateImgWebp=If you confirm, you will generate an image in .webp format for all images currently into this folder (subfolders are not included)... -ConfirmImgWebpCreation=Confirm all images duplication -SucessConvertImgWebp=Images successfully duplicated +GenerateImgWebp=Dublējiet visus attēlus ar citu versiju ar .webp formātu +ConfirmGenerateImgWebp=Ja apstiprināsit, visiem šajā mapē esošajiem attēliem tiks ģenerēts attēls .webp formātā (apakšmapes nav iekļautas) ... +ConfirmImgWebpCreation=Apstipriniet visu attēlu dublēšanos +SucessConvertImgWebp=Attēli ir veiksmīgi dublēti diff --git a/htdocs/langs/lv_LV/errors.lang b/htdocs/langs/lv_LV/errors.lang index 5df40e192b9..d90bd6c508b 100644 --- a/htdocs/langs/lv_LV/errors.lang +++ b/htdocs/langs/lv_LV/errors.lang @@ -4,14 +4,14 @@ NoErrorCommitIsDone=Nav kļūda, mēs apstiprinam # Errors ErrorButCommitIsDone=Kļūdas atrasta, bet mēs apstiprinājām neskatoties uz to -ErrorBadEMail=Email %s is incorrect -ErrorBadMXDomain=Email %s seems incorrect (domain has no valid MX record) -ErrorBadUrl=Url %s is incorrect +ErrorBadEMail=E-pasts %s nav pareizs +ErrorBadMXDomain=E-pasts %s šķiet nepareizs (domēnam nav derīga MX ieraksta) +ErrorBadUrl=URL %s nav pareizs ErrorBadValueForParamNotAString=Jūsu parametra nepareiza vērtība. Tas parasti parādās, ja trūkst tulkojuma. ErrorRefAlreadyExists=Atsauce %s jau pastāv. ErrorLoginAlreadyExists=Lietotājs %s jau pastāv. ErrorGroupAlreadyExists=Grupa %s jau pastāv. -ErrorEmailAlreadyExists=Email %s already exists. +ErrorEmailAlreadyExists=E-pasts %s jau pastāv. ErrorRecordNotFound=Ierakstīt nav atrasts. ErrorFailToCopyFile=Neizdevās nokopēt failu '%s' uz '%s'. ErrorFailToCopyDir=Neizdevās kopēt direktoriju '%s' uz ' %s'. @@ -47,8 +47,8 @@ ErrorWrongDate=Datums nav pareizs ErrorFailedToWriteInDir=Neizdevās ierakstīt direktorijā %s ErrorFoundBadEmailInFile=Atrasts nepareiza e-pasta sintakse %s līnijām failā (piemērs line %s ar e-pasta = %s) ErrorUserCannotBeDelete=Lietotāju nevar izdzēst. Varbūt tas ir saistīts ar Dolibarr vienībām. -ErrorFieldsRequired=Some required fields have been left blank. -ErrorSubjectIsRequired=The email subject is required +ErrorFieldsRequired=Daži obligāti aizpildāmie lauki ir atstāti tukši. +ErrorSubjectIsRequired=Nepieciešama e-pasta tēma ErrorFailedToCreateDir=Neizdevās izveidot direktoriju. Pārbaudiet, vai Web servera lietotājam ir tiesības rakstīt uz Dolibarr dokumentus direktorijā. Ja parametrs safe_mode ir iespējots uz šo PHP, pārbaudiet, Dolibarr php faili pieder web servera lietotājam (vai grupa). ErrorNoMailDefinedForThisUser=Nav definēts e-pasts šim lietotājam ErrorSetupOfEmailsNotComplete=E-pastu iestatīšana nav pabeigta @@ -60,7 +60,7 @@ ErrorDirNotFound=Directory %s nav atrasts (Bad ceļš, aplamas tiesības ErrorFunctionNotAvailableInPHP=Funkcija %s ir nepieciešama šī funkcija, bet nav pieejams šajā versijā / uzstādīšanas PHP. ErrorDirAlreadyExists=Direrktorija ar šādu nosaukumu jau pastāv. ErrorFileAlreadyExists=Fails ar šādu nosaukumu jau eksistē. -ErrorDestinationAlreadyExists=Another file with the name %s already exists. +ErrorDestinationAlreadyExists=Jau pastāv cits fails ar nosaukumu %s . ErrorPartialFile=Serveris failu nav saņemis pilnīgi. ErrorNoTmpDir=Pagaidu direktorija %s neeksistē. ErrorUploadBlockedByAddon=Augšupielāde bloķēja ar PHP/Apache spraudni. @@ -118,7 +118,7 @@ ErrorCantReadFile=Neizdevās nolasīt failu '%s' ErrorCantReadDir=Neizdevās nolasīt katalogu '%s' ErrorBadLoginPassword=Nepareiza vērtība lietotājvārdam vai parolei ErrorLoginDisabled=Jūsu konts ir bloķēts -ErrorFailedToRunExternalCommand=Failed to run external command. Check it is available and runnable by your PHP server user. Check also the command is not protected on shell level by a security layer like apparmor. +ErrorFailedToRunExternalCommand=Neizdevās palaist ārējo komandu. Pārbaudiet, vai tas ir pieejams un darbojas jūsu PHP servera lietotājam. Pārbaudiet arī, vai komandu čaulas līmenī neaizsargā tāds drošības slānis kā apparmor. ErrorFailedToChangePassword=Neizdevās nomainīt paroli ErrorLoginDoesNotExists=Lietotāju ar pieteikšanos %s nevar atrast. ErrorLoginHasNoEmail=Šim lietotājam nav e-pasta adrese. Process atcelts. @@ -227,9 +227,9 @@ ErrorAPageWithThisNameOrAliasAlreadyExists=Lapā / konteinerā %s %s
    ir ieslēgta. WarningCreateSubAccounts=Brīdinājums: jūs nevarat izveidot tieši apakškontu, jums ir jāizveido trešā puse vai lietotājs un jāpiešķir viņiem grāmatvedības kods, lai tos atrastu šajā sarakstā WarningAvailableOnlyForHTTPSServers=Pieejams tikai tad, ja tiek izmantots HTTPS drošais savienojums. -WarningModuleXDisabledSoYouMayMissEventHere=Module %s has not been enabled. So you may miss a lot of event here. -ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary -CheckVersionFail=Version check fail -ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it +WarningModuleXDisabledSoYouMayMissEventHere=Modulis %s nav iespējots. Tāpēc jūs varat izlaist daudz notikumu šeit. +ErrorActionCommPropertyUserowneridNotDefined=Nepieciešams lietotāja īpašnieks +ErrorActionCommBadType=Atlasītais notikuma veids (id: %n, kods: %s) nepastāv notikuma veida vārdnīcā +CheckVersionFail=Versijas pārbaude neizdevās +ErrorWrongFileName=Faila nosaukumā nedrīkst būt __SOMETHING__ diff --git a/htdocs/langs/lv_LV/eventorganization.lang b/htdocs/langs/lv_LV/eventorganization.lang index 70a2a0146c2..d28955ce942 100644 --- a/htdocs/langs/lv_LV/eventorganization.lang +++ b/htdocs/langs/lv_LV/eventorganization.lang @@ -17,127 +17,127 @@ # # Generic # -ModuleEventOrganizationName = Event Organization -EventOrganizationDescription = Event Organization through Module Project -EventOrganizationDescriptionLong= Manage Event organization for conference, attendees, speaker, and attendees, with public subcription page +ModuleEventOrganizationName = Pasākuma organizēšana +EventOrganizationDescription = Pasākuma organizēšana, izmantojot moduļu projektu +EventOrganizationDescriptionLong= Pārvaldiet konferences, dalībnieku, runātāju un dalībnieku pasākuma organizēšanu ar publisku abonēšanas lapu # # Menu # -EventOrganizationMenuLeft = Organized events -EventOrganizationConferenceOrBoothMenuLeft = Conference Or Booth +EventOrganizationMenuLeft = Organizēja pasākumus +EventOrganizationConferenceOrBoothMenuLeft = Konference vai stends # # Admin page # -EventOrganizationSetup = Event Organization setup +EventOrganizationSetup = Pasākuma organizācijas iestatīšana Settings = Iestatījumi -EventOrganizationSetupPage = Event Organization setup page -EVENTORGANIZATION_TASK_LABEL = Label of tasks to create automatically when project is validated -EVENTORGANIZATION_TASK_LABELTooltip = When you validate an organized event, some tasks can be automatically created in the project

    For example:
    Send Call for Conference
    Send Call for Booth
    Receive call for conferences
    Receive call for Booth
    Open subscriptions to events for attendees
    Send remind of event to speakers
    Send remind of event to Booth hoster
    Send remind of event to attendees -EVENTORGANIZATION_CATEG_THIRDPARTY_CONF = Category to add to third-parties automatically created when someone suggests a conference -EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH = Category to add to third-parties automatically created when they suggests a booth -EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF = Template of email to send after receiving a suggestion of a conference. -EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH = Template of email to send after receiving a suggestion of a booth. -EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH = Template of email to send after a subscription to a booth has been paid. -EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT = Template of email to send after a subscription to an event has been paid. -EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_SPEAKER = Template of email of massaction to attendes -EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES = Template of email of massaction to speakers -EVENTORGANIZATION_FILTERATTENDEES_CAT = Filter thirdpartie's select list in attendees creation card/form with category -EVENTORGANIZATION_FILTERATTENDEES_TYPE = Filter thirdpartie's select list in attendees creation card/form with customer type +EventOrganizationSetupPage = Pasākuma organizācijas iestatīšanas lapa +EVENTORGANIZATION_TASK_LABEL = Uzdevumu iezīme, kas jāizveido automātiski, kad projekts ir apstiprināts +EVENTORGANIZATION_TASK_LABELTooltip = Apstiprinot organizētu notikumu, dažus uzdevumus var automātiski izveidot projektā

    Piemēram:
    Sūtīt konferences zvanu
    Sūtīt zvanu stendam
    A032fccfz19bz0 A032fccfz19bz002 Saņemt konferences zvanu03 atgādināt par notikumu runātājiem
    Nosūtīt atgādinājumu par notikumu Booth hoster
    Nosūtīt atgādinājumu par pasākumu dalībniekiem +EVENTORGANIZATION_CATEG_THIRDPARTY_CONF = Kategorija, ko pievienot trešajām pusēm, tiek automātiski izveidota, kad kāds iesaka konferenci +EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH = Kategorija, ko pievienot trešajām pusēm, tiek automātiski izveidota, kad viņi iesaka stendu +EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF = E-pasta ziņojuma veidne, kas jānosūta pēc konferences ieteikuma saņemšanas. +EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH = E-pasta ziņojuma veidne, kas jānosūta pēc stenda ieteikuma saņemšanas. +EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH = E-pasta ziņojuma veidne, kas jānosūta pēc tam, kad ir samaksāts abonēšanas stends. +EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT = E-pasta ziņojuma veidne, kas jānosūta pēc pasākuma abonēšanas apmaksas. +EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_SPEAKER = Masveida dalībnieku e-pasta veidne +EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES = Masu sarunu e-pasta ziņojuma veidne +EVENTORGANIZATION_FILTERATTENDEES_CAT = Filtrējiet trešās puses atlasīto sarakstu dalībnieku izveides kartītē / veidlapā ar kategoriju +EVENTORGANIZATION_FILTERATTENDEES_TYPE = Filtrējiet trešās puses atlasīto sarakstu dalībnieku izveidošanas kartītē / veidlapā ar klienta tipu # # Object # -EventOrganizationConfOrBooth= Conference Or Booth -ManageOrganizeEvent = Manage event organisation -ConferenceOrBooth = Conference Or Booth -ConferenceOrBoothTab = Conference Or Booth -AmountOfSubscriptionPaid = Amount of subscription paid -DateSubscription = Date of subscription -ConferenceOrBoothAttendee = Conference Or Booth Attendee +EventOrganizationConfOrBooth= Konference vai stends +ManageOrganizeEvent = Pārvaldīt pasākumu organizēšanu +ConferenceOrBooth = Konference vai stends +ConferenceOrBoothTab = Konference vai stends +AmountOfSubscriptionPaid = Apmaksātā abonēšanas summa +DateSubscription = Abonēšanas datums +ConferenceOrBoothAttendee = Konferences vai stenda apmeklētājs # # Template Mail # -YourOrganizationEventConfRequestWasReceived = Your request for conference was received -YourOrganizationEventBoothRequestWasReceived = Your request for booth was received -EventOrganizationEmailAskConf = Request for conference -EventOrganizationEmailAskBooth = Request for booth -EventOrganizationEmailSubsBooth = Subscription for booth -EventOrganizationEmailSubsEvent = Subscription for an event -EventOrganizationMassEmailAttendees = Communication to attendees -EventOrganizationMassEmailSpeakers = Communication to speakers +YourOrganizationEventConfRequestWasReceived = Jūsu konferences pieprasījums tika saņemts +YourOrganizationEventBoothRequestWasReceived = Jūsu pieprasījums pēc stenda tika saņemts +EventOrganizationEmailAskConf = Pieprasījums pēc konferences +EventOrganizationEmailAskBooth = Pieprasījums pēc stenda +EventOrganizationEmailSubsBooth = Stenda abonēšana +EventOrganizationEmailSubsEvent = Pasākuma abonēšana +EventOrganizationMassEmailAttendees = Saziņa ar apmeklētājiem +EventOrganizationMassEmailSpeakers = Saziņa ar runātājiem # # Event # -AllowUnknownPeopleSuggestConf=Allow unknown people to suggest conferences -AllowUnknownPeopleSuggestConfHelp=Allow unknown people to suggest conferences -AllowUnknownPeopleSuggestBooth=Allow unknown people to suggest booth -AllowUnknownPeopleSuggestBoothHelp=Allow unknown people to suggest booth -PriceOfRegistration=Price of registration -PriceOfRegistrationHelp=Price of registration -PriceOfBooth=Subscription price to stand a booth -PriceOfBoothHelp=Subscription price to stand a booth -EventOrganizationICSLink=Link ICS for events -ConferenceOrBoothInformation=Conference Or Booth informations -Attendees = Attendees -DownloadICSLink = Download ICS link -EVENTORGANIZATION_SECUREKEY = Secure Key of the public registration link to a conference -SERVICE_BOOTH_LOCATION = Service used for the invoice row about a booth location -SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION = Service used for the invoice row about an attendee subscription to a conference +AllowUnknownPeopleSuggestConf=Ļaujiet nezināmiem cilvēkiem ieteikt konferences +AllowUnknownPeopleSuggestConfHelp=Ļaujiet nezināmiem cilvēkiem ieteikt konferences +AllowUnknownPeopleSuggestBooth=Ļaujiet nezināmiem cilvēkiem ieteikt kabīni +AllowUnknownPeopleSuggestBoothHelp=Ļaujiet nezināmiem cilvēkiem ieteikt kabīni +PriceOfRegistration=Reģistrācijas cena +PriceOfRegistrationHelp=Reģistrācijas cena +PriceOfBooth=Abonēšanas cena, lai stāvētu kabīnē +PriceOfBoothHelp=Abonēšanas cena, lai stāvētu kabīnē +EventOrganizationICSLink=Saistiet notikumu ICS +ConferenceOrBoothInformation=Konferences vai stenda informācija +Attendees = Dalībnieki +DownloadICSLink = Lejupielādēt ICS saiti +EVENTORGANIZATION_SECUREKEY = Konferences publiskās reģistrācijas saites drošā atslēga +SERVICE_BOOTH_LOCATION = Pakalpojums, kas izmantots rēķinu rindai par kabīnes atrašanās vietu +SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION = Pakalpojums, kas tiek izmantots rēķina rindā par konferences dalībnieka abonementu # # Status # EvntOrgDraft = Melnraksts -EvntOrgSuggested = Suggested -EvntOrgConfirmed = Confirmed -EvntOrgNotQualified = Not Qualified +EvntOrgSuggested = Ieteikts +EvntOrgConfirmed = Apstiprināts +EvntOrgNotQualified = Nav kvalificēts EvntOrgDone = Darīts -EvntOrgCancelled = Cancelled +EvntOrgCancelled = Atcelts # # Public page # -SuggestForm = Suggestion page -RegisterPage = Page for conferences or booth -EvntOrgRegistrationHelpMessage = Here, you can vote for an event, or suggest a new conference or booth for the project -EvntOrgRegistrationConfHelpMessage = Here, you can suggest a new conference for the project -EvntOrgRegistrationBoothHelpMessage = Here, you can suggest a new booth for the project -ListOfSuggestedConferences = List of suggested conferences -ListOfSuggestedBooths = List of suggested booths -SuggestConference = Suggest a new conference -SuggestBooth = Suggest a booth -ViewAndVote = View and vote for suggested events -PublicAttendeeSubscriptionPage = Public link of registration to a conference -MissingOrBadSecureKey = The security key is invalid or missing -EvntOrgWelcomeMessage = This form allows you to register as a new participant to the conference : '%s' -EvntOrgDuration = This conference starts on %s and ends on %s. -ConferenceAttendeeFee = Conference attendee fee for the event : '%s' occurring from %s to %s. -BoothLocationFee = Booth location for the event : '%s' occurring from %s to %s +SuggestForm = Ieteikumu lapa +RegisterPage = Konferenču vai stenda lapa +EvntOrgRegistrationHelpMessage = Šeit jūs varat balsot par pasākumu vai ieteikt jaunu konferenci vai stendu projektam +EvntOrgRegistrationConfHelpMessage = Šeit jūs varat ieteikt jaunu projekta konferenci +EvntOrgRegistrationBoothHelpMessage = Šeit jūs varat ieteikt jaunu stendu projektam +ListOfSuggestedConferences = Ieteicamo konferenču saraksts +ListOfSuggestedBooths = Ieteicamo kabīņu saraksts +SuggestConference = Ieteikt jaunu konferenci +SuggestBooth = Ieteikt stendu +ViewAndVote = Skatiet ierosinātos pasākumus un balsojiet par tiem +PublicAttendeeSubscriptionPage = Publiska reģistrācijas saite ar konferenci +MissingOrBadSecureKey = Drošības atslēga nav derīga vai tās nav +EvntOrgWelcomeMessage = Šī veidlapa ļauj reģistrēties kā jaunam konferences dalībniekam: '%s' +EvntOrgDuration = Šī konference sākas ar %s un beidzas ar %s. +ConferenceAttendeeFee = Konferences dalībnieka maksa par pasākumu: '%s', kas notiek no %s līdz %s. +BoothLocationFee = Pasākuma stenda atrašanās vieta: '%s', kas notiek no %s līdz %s EventType = Pasākuma veids # # Vote page # -EvntOrgRegistrationWelcomeMessage = Welcome on the conference or booth suggestion page. -EvntOrgRegistrationConfWelcomeMessage = Welcome on the conference suggestion page. -EvntOrgRegistrationBoothWelcomeMessage = Welcome on the booth suggestion page. -EvntOrgVoteHelpMessage = Here, you can view and vote for the suggested events for the project -VoteOk = Your vote has been accepted. -AlreadyVoted = You have already voted for this event. -VoteError = An error has occurred during the vote, please try again. +EvntOrgRegistrationWelcomeMessage = Laipni lūdzam konferences vai stenda ieteikumu lapā. +EvntOrgRegistrationConfWelcomeMessage = Laipni lūdzam konferences ieteikumu lapā. +EvntOrgRegistrationBoothWelcomeMessage = Laipni lūdzam stenda ieteikumu lapā. +EvntOrgVoteHelpMessage = Šeit jūs varat apskatīt ierosinātos projekta pasākumus un balsot par tiem +VoteOk = Jūsu balsojums ir pieņemts. +AlreadyVoted = Jūs jau esat balsojis par šo notikumu. +VoteError = Balsojuma laikā radās kļūda. Lūdzu, mēģiniet vēlreiz. # # SubscriptionOk page # -SubscriptionOk = Your subscription to this conference has been validated +SubscriptionOk = Jūsu abonements šai konferencei ir apstiprināts # # Subscription validation mail # -ConfAttendeeSubscriptionConfirmation = Confirmation of your subscription to a conference +ConfAttendeeSubscriptionConfirmation = Konferences abonēšanas apstiprinājums # # Payment page # -Attendee = Attendee -PaymentConferenceAttendee = Conference attendee payment -PaymentBoothLocation = Booth location payment +Attendee = Dalībnieks +PaymentConferenceAttendee = Konferences dalībnieka samaksa +PaymentBoothLocation = Kabīnes atrašanās vietas maksājums diff --git a/htdocs/langs/lv_LV/exports.lang b/htdocs/langs/lv_LV/exports.lang index c7732d16a4b..62971ec4f46 100644 --- a/htdocs/langs/lv_LV/exports.lang +++ b/htdocs/langs/lv_LV/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Veids (0=produkts, 1=pakalpojums) FileWithDataToImport=Fails ar datiem, lai importētu FileToImport=Avota fails, kas jāimportē FileMustHaveOneOfFollowingFormat=Importa failam ir jābūt šādam formātam -DownloadEmptyExample=Lejupielādēt veidlapas failu ar lauka satura informāciju (* ir obligāti aizpildāmie lauki) +DownloadEmptyExample=Lejupielādējiet veidnes failu ar lauka satura informāciju +StarAreMandatory=* ir obligāti aizpildāmi lauki ChooseFormatOfFileToImport=Izvēlieties faila formātu, ko izmantot kā importa faila formātu, noklikšķinot uz %s ikonas, lai to atlasītu ... ChooseFileToImport=Augšupielādējiet failu, pēc tam noklikšķiniet uz %s ikonas, lai atlasītu failu kā avota importa failu ... SourceFileFormat=Avota faila formāts @@ -133,4 +134,4 @@ KeysToUseForUpdates=Atslēga (sleja), ko izmantot esošo datu atjaunināšan NbInsert=Ievietoto līniju skaits: %s NbUpdate=Atjaunināto līniju skaits: %s MultipleRecordFoundWithTheseFilters=Ar šiem filtriem tika atrasti vairāki ieraksti: %s -StocksWithBatch=Stocks and location (warehouse) of products with batch/serial number +StocksWithBatch=Produktu krājumi un atrašanās vieta (noliktava) ar partijas / sērijas numuru diff --git a/htdocs/langs/lv_LV/externalsite.lang b/htdocs/langs/lv_LV/externalsite.lang index 925c1286ec8..23725bd616a 100644 --- a/htdocs/langs/lv_LV/externalsite.lang +++ b/htdocs/langs/lv_LV/externalsite.lang @@ -1,5 +1,5 @@ # Dolibarr language file - Source file is en_US - externalsite ExternalSiteSetup=Ārējo vietņu iestatīšana -ExternalSiteURL=External Site URL of HTML iframe content +ExternalSiteURL=HTML iframe satura ārējās vietnes URL ExternalSiteModuleNotComplete=Modulis ExternalSite nav pareizi konfigurēts. ExampleMyMenuEntry=Manas izvēlnes ieraksti diff --git a/htdocs/langs/lv_LV/holiday.lang b/htdocs/langs/lv_LV/holiday.lang index 79611027bf4..013c4b1a1b9 100644 --- a/htdocs/langs/lv_LV/holiday.lang +++ b/htdocs/langs/lv_LV/holiday.lang @@ -13,7 +13,7 @@ ToReviewCP=Gaida apstiprināšanu ApprovedCP=Apstiprināts CancelCP=Atcelts RefuseCP=Atteikts -ValidatorCP=Asistents +ValidatorCP=Apstiprinātājs ListeCP=Atvaļinājuma saraksts Leave=Atstāt pieprasījumu LeaveId=Atvaļinājuma ID @@ -39,11 +39,11 @@ TitreRequestCP=Atstāt pieprasījumu TypeOfLeaveId=Atvaļinājuma ID veids TypeOfLeaveCode=Atvaļinājuma kods TypeOfLeaveLabel=Atvaļinājuma veids -NbUseDaysCP=Patērēto atvaļinājuma dienu skaits -NbUseDaysCPHelp=Aprēķinā tiek ņemtas vērā vārdnīcā noteiktās brīvās dienas un brīvdienas. -NbUseDaysCPShort=Patērētās dienas -NbUseDaysCPShortInMonth=Mēneša laikā patērētās dienas -DayIsANonWorkingDay=%s nav darba diena +NbUseDaysCP=Izmantoto atvaļinājumu dienu skaits +NbUseDaysCPHelp=Aprēķinā tiek ņemtas vērā vārdnīcā noteiktās brīvdienas un brīvdienas. +NbUseDaysCPShort=Atvaļinājuma dienas +NbUseDaysCPShortInMonth=Atvaļinājuma dienas mēnesī +DayIsANonWorkingDay=%s ir darba diena DateStartInMonth=Sākuma datums mēnesī DateEndInMonth=Mēneša beigu datums EditCP=Rediģēt @@ -55,7 +55,7 @@ TitleDeleteCP=Dzēst atvaļinājuma pieprasījumu ConfirmDeleteCP=Apstiprināt šī atvaļinājuma pieprasījuma dzēšanu? ErrorCantDeleteCP=Kļūda, Jums nav tiesību izdzēst šo atvaļinājuma pieprasījumu. CantCreateCP=Jums nav tiesību veikt atvaļinājumu pieprasījumus. -InvalidValidatorCP=Jūsu atvaļinājuma pieprasījumam jāizvēlas apstiprinātājs. +InvalidValidatorCP=Atvaļinājuma pieprasījumam jums jāizvēlas apstiprinātājs. NoDateDebut=Jums ir jāizvēlas sākuma datums. NoDateFin=Jums ir jāizvēlas beigu datums. ErrorDureeCP=Jūsu atvaļinājuma pieprasījumā nav darba dienas. @@ -80,14 +80,14 @@ UserCP=Lietotājs ErrorAddEventToUserCP=Pievienojot ārpuskārtas atvaļinājumu, radās kļūda. AddEventToUserOkCP=Par ārkārtas atvaļinājumu papildinājums ir pabeigta. MenuLogCP=Skatīt izmaiņu žurnālus -LogCP=Pieejamo atvaļinājumu dienu atjauninājumu žurnāls -ActionByCP=Veic -UserUpdateCP=Lietotājam +LogCP=Visu atjauninājumu žurnāls “Atvaļinājuma atlikums” +ActionByCP=Atjaunināja +UserUpdateCP=Atjaunināts PrevSoldeCP=Iepriekšējā bilance NewSoldeCP=Jana Bilance alreadyCPexist=Šajā periodā atvaļinājuma pieprasījums jau ir veikts. -FirstDayOfHoliday=Pirmā atvaļinājuma diena -LastDayOfHoliday=Pēdēja atvaļinājuma diena +FirstDayOfHoliday=Atvaļinājuma sākuma diena +LastDayOfHoliday=Atvaļinājuma beigu diena BoxTitleLastLeaveRequests=Jaunākie %s labotie atvaļinājumu pieprasījumi HolidaysMonthlyUpdate=Ikmēneša atjauninājums ManualUpdate=Manuāla aktualizēšana @@ -104,8 +104,8 @@ LEAVE_SICK=Slimības lapa LEAVE_OTHER=Cits atvaļinājums LEAVE_PAID_FR=Apmaksāts atvaļinājums ## Configuration du Module ## -LastUpdateCP=Jaunākais atvaļinājumu piešķiršanas atjauninājums -MonthOfLastMonthlyUpdate=Pēdējā automātiskā atvaļinājuma piešķiršanas mēneša pēdējā mēneša laikā +LastUpdateCP=Pēdējā automātiskā atvaļinājumu piešķiršanas atjaunināšana +MonthOfLastMonthlyUpdate=Atvaļinājumu sadalījuma pēdējās automātiskās atjaunināšanas mēnesis UpdateConfCPOK=Veiksmīgi atjaunināta. Module27130Name= Atvaļinājuma pieprasījumu pārvaldība Module27130Desc= Atvaļinājumu pieprasījumu vadīšana @@ -125,8 +125,8 @@ HolidaysCanceledBody=Jūsu atvaļinājuma pieprasījums no %s līdz %s ir atcelt FollowedByACounter=1: Šāda veida atvaļinājumam jāievēro skaitītājs. Skaitījtājs tiek palielināts manuāli vai automātiski, un, ja atvaļinājuma pieprasījums ir apstiprināts, skaitītājs tiek samazināts.
    0: neseko skaitītājs. NoLeaveWithCounterDefined=There is no leave types defined that need to be followed by a counter GoIntoDictionaryHolidayTypes=Iet uz Sākums - Iestatīšana - Vārdnīcas - Atvaļinājuma veids , lai iestatītu dažādu veidu lapas. -HolidaySetup=Moduļa brīvdienas uzstādīšana -HolidaysNumberingModules=Atvaļinājuma pieprasījumu numerācijas modeļi +HolidaySetup=Moduļa atvaļinājums iestatīšana +HolidaysNumberingModules=Numerācijas modeļi atvaļinājumu pieprasījumiem TemplatePDFHolidays=PDF veidne atvaļinājumu pieprasīšanai FreeLegalTextOnHolidays=Brīvs teksts PDF WatermarkOnDraftHolidayCards=Ūdenszīmes uz atvaļinājuma pieprasījumiem diff --git a/htdocs/langs/lv_LV/hrm.lang b/htdocs/langs/lv_LV/hrm.lang index fb12bb86555..4a22ad40b4e 100644 --- a/htdocs/langs/lv_LV/hrm.lang +++ b/htdocs/langs/lv_LV/hrm.lang @@ -9,7 +9,7 @@ ConfirmDeleteEstablishment=Vai tiešām vēlaties dzēst šo uzņēmumu? OpenEtablishment=Atvērts uzņēmums CloseEtablishment=Aizvērt uzņēmumu # Dictionary -DictionaryPublicHolidays=Leave - Public holidays +DictionaryPublicHolidays=Atvaļinājums - svētku dienas DictionaryDepartment=HRM - Department list DictionaryFunction=HRM - darba vietas # Module diff --git a/htdocs/langs/lv_LV/knowledgemanagement.lang b/htdocs/langs/lv_LV/knowledgemanagement.lang index 92b3a320067..bb146a13017 100644 --- a/htdocs/langs/lv_LV/knowledgemanagement.lang +++ b/htdocs/langs/lv_LV/knowledgemanagement.lang @@ -18,38 +18,32 @@ # # Module label 'ModuleKnowledgeManagementName' -ModuleKnowledgeManagementName = Knowledge Management System +ModuleKnowledgeManagementName = Zināšanu pārvaldības sistēma # Module description 'ModuleKnowledgeManagementDesc' -ModuleKnowledgeManagementDesc=Manage a Knowledge Management (KM) or Help-Desk base +ModuleKnowledgeManagementDesc=Pārvaldiet zināšanu pārvaldības (KM) vai palīdzības dienesta bāzi # # Admin page # -KnowledgeManagementSetup = Knowledge Management System setup +KnowledgeManagementSetup = Zināšanu pārvaldības sistēmas iestatīšana Settings = Iestatījumi -KnowledgeManagementSetupPage = Knowledge Management System setup page +KnowledgeManagementSetupPage = Zināšanu pārvaldības sistēmas iestatīšanas lapa # # About page # About = Par -KnowledgeManagementAbout = About Knowledge Management -KnowledgeManagementAboutPage = Knowledge Management about page +KnowledgeManagementAbout = Par zināšanu pārvaldību +KnowledgeManagementAboutPage = Zināšanu pārvaldība par lapu -# -# Sample page -# -KnowledgeManagementArea = Knowledge Management - - -# -# Menu -# -MenuKnowledgeRecord = Knowledge base -ListKnowledgeRecord = List of articles -NewKnowledgeRecord = New article -ValidateReply = Validate solution -KnowledgeRecords = Articles +KnowledgeManagementArea = Zināšanu pārvaldība +MenuKnowledgeRecord = Zināšanu bāze +ListKnowledgeRecord = Rakstu saraksts +NewKnowledgeRecord = Jauns raksts +ValidateReply = Apstipriniet šķīdumu +KnowledgeRecords = Raksti KnowledgeRecord = Raksts -KnowledgeRecordExtraFields = Extrafields for Article +KnowledgeRecordExtraFields = Raksta paplašinājumi +GroupOfTicket=Biļešu grupa +YouCanLinkArticleToATicketCategory=Rakstu var saistīt ar biļešu grupu (tāpēc raksts tiks ieteikts jauno biļešu kvalifikācijas iegūšanas laikā) diff --git a/htdocs/langs/lv_LV/languages.lang b/htdocs/langs/lv_LV/languages.lang index 248390f73a0..7dee3237fc3 100644 --- a/htdocs/langs/lv_LV/languages.lang +++ b/htdocs/langs/lv_LV/languages.lang @@ -3,7 +3,8 @@ Language_am_ET=Etiopietis Language_ar_AR=Arābu Language_ar_EG=Arābu (Ēģipte) Language_ar_SA=Arābu -Language_ar_TN=Arabic (Tunisia) +Language_ar_TN=Arābu (Tunisija) +Language_ar_IQ=Arābu (Irāka) Language_az_AZ=Azerbaidžāņi Language_bn_BD=Bengali Language_bn_IN=Bengāļu (Indija) @@ -83,9 +84,10 @@ Language_ne_NP=Nepālietis Language_nl_BE=Holandiešu (Beļģijas) Language_nl_NL=Holandiešu Language_pl_PL=Poļu +Language_pt_AO=Portugāļu (Angola) Language_pt_BR=Portugāļu (Brazīlija) Language_pt_PT=Portugāļu -Language_ro_MD=Romanian (Moldavia) +Language_ro_MD=Rumāņu (Moldāvija) Language_ro_RO=Rumāņu Language_ru_RU=Krievu Language_ru_UA=Krievu (Ukraina) diff --git a/htdocs/langs/lv_LV/mails.lang b/htdocs/langs/lv_LV/mails.lang index a959d345f2b..e6768ebf724 100644 --- a/htdocs/langs/lv_LV/mails.lang +++ b/htdocs/langs/lv_LV/mails.lang @@ -15,7 +15,7 @@ MailToUsers=Lietotājam (-iem) MailCC=Kopēt MailToCCUsers=Kopēt lietotājiem (-iem) MailCCC=Kešatmiņas kopija -MailTopic=Email subject +MailTopic=E-pasta tēma MailText=Ziņa MailFile=Pievienotie faili MailMessage=E-pasta saturs @@ -131,8 +131,8 @@ NoNotificationsWillBeSent=Šim notikuma veidam un uzņēmumam nav plānoti autom ANotificationsWillBeSent=1 automātisks paziņojums tiks nosūtīts pa e-pastu SomeNotificationsWillBeSent=%s automātiskie paziņojumi tiks nosūtīti pa e-pastu AddNewNotification=Abonējiet jaunu automātisku e-pasta paziņojumu (mērķis / notikums) -ListOfActiveNotifications=List of all active subscriptions (targets/events) for automatic email notification -ListOfNotificationsDone=List of all automatic email notifications sent +ListOfActiveNotifications=Visu aktīvo abonementu (mērķu / notikumu) saraksts automātiskai e-pasta paziņošanai +ListOfNotificationsDone=Visu nosūtīto automātisko e-pasta paziņojumu saraksts MailSendSetupIs=Configuration of email sending has been setup to '%s'. This mode can't be used to send mass emailing. MailSendSetupIs2=You must first go, with an admin account, into menu %sHome - Setup - EMails%s to change parameter '%s' to use mode '%s'. With this mode, you can enter setup of the SMTP server provided by your Internet Service Provider and use Mass emailing feature. MailSendSetupIs3=If you have any questions on how to setup your SMTP server, you can ask to %s. diff --git a/htdocs/langs/lv_LV/main.lang b/htdocs/langs/lv_LV/main.lang index 0b76b3bbb10..0343778b95e 100644 --- a/htdocs/langs/lv_LV/main.lang +++ b/htdocs/langs/lv_LV/main.lang @@ -180,7 +180,7 @@ SaveAndNew=Saglabāt un jaunu TestConnection=Savienojuma pārbaude ToClone=Klonēt ConfirmCloneAsk=Vai tiešām vēlaties klonēt objektu %s ? -ConfirmClone=Choose the data you want to clone: +ConfirmClone=Izvēlieties datus, kurus vēlaties klonēt: NoCloneOptionsSpecified=Nav datu klons noteikts. Of=no Go=Iet @@ -246,7 +246,7 @@ DefaultModel=Noklusējuma doc veidne Action=Notikums About=Par Number=Numurs -NumberByMonth=Total reports by month +NumberByMonth=Kopējais pārskatu skaits mēnesī AmountByMonth=Summa šķirota pēc mēneša nosaukuma Numero=Numurs Limit=Ierobežot @@ -278,7 +278,7 @@ DateModificationShort=Modif. datums IPModification=Modifikācijas IP DateLastModification=Jaunākais labošanas datums DateValidation=Apstiprināšanas datums -DateSigning=Signing date +DateSigning=Parakstīšanas datums DateClosing=Beigu datums DateDue=Izpildes datums DateValue=Valutēšanas datums @@ -341,8 +341,8 @@ KiloBytes=Kilobaiti MegaBytes=Megabaiti GigaBytes=Gigabaiti TeraBytes=Terabaiti -UserAuthor=Ceated by -UserModif=Updated by +UserAuthor=Apkrāpts ar +UserModif=Atjaunināja b=b. Kb=Kb Mb=Mb @@ -362,7 +362,7 @@ UnitPriceHTCurrency=Vienības cena (izņemot) (valūta) UnitPriceTTC=Vienības cena PriceU=UP PriceUHT=UP (neto) -PriceUHTCurrency=U.P (net) (currency) +PriceUHTCurrency=ASV (neto) (valūta) PriceUTTC=U.P. (inc. tax) Amount=Summa AmountInvoice=Rēķina summa @@ -390,8 +390,8 @@ AmountTotal=Kopējā summa AmountAverage=Vidējā summa PriceQtyMinHT=Cenu daudzums min. (bez nodokļiem) PriceQtyMinHTCurrency=Cenu daudzums min. (bez nodokļa) (valūta) -PercentOfOriginalObject=Percent of original object -AmountOrPercent=Amount or percent +PercentOfOriginalObject=Oriģinālā objekta procenti +AmountOrPercent=Summa vai procenti Percentage=Procentuālā attiecība Total=Kopsumma SubTotal=Starpsumma @@ -430,7 +430,7 @@ LT1IN=CGST LT2IN=SGST LT1GC=Papildu centi VATRate=Nodokļa likme -RateOfTaxN=Rate of tax %s +RateOfTaxN=Nodokļa likme %s VATCode=Nodokļu likmes kods VATNPR=Nodokļa likme NPR DefaultTaxRate=Noklusētā nodokļa likme @@ -730,8 +730,8 @@ MenuMembers=Dalībnieki MenuAgendaGoogle=Google darba kārtība MenuTaxesAndSpecialExpenses=Nodokļi | Īpašie izdevumi ThisLimitIsDefinedInSetup=Dolibarr robeža (Menu mājas uzstādīšana-drošība): %s Kb, PHP robeža: %s Kb -ThisLimitIsDefinedInSetupAt=Dolibarr limit (Menu %s): %s Kb, PHP limit (Param %s): %s Kb -NoFileFound=No documents uploaded +ThisLimitIsDefinedInSetupAt=Dolibarr limits (izvēlne %s): %s Kb, PHP ierobežojums (Param %s): %s Kb +NoFileFound=Nav augšupielādēts neviens dokuments CurrentUserLanguage=Pašreizējā valoda CurrentTheme=Pašreizējā tēma CurrentMenuManager=Pašreizējais izvēlnes pārvaldnieks @@ -847,7 +847,7 @@ XMoreLines=%s līnija(as) slēptas ShowMoreLines=Parādīt vairāk / mazāk rindas PublicUrl=Publiskā saite AddBox=Pievienot info logu -SelectElementAndClick=Select an element and click on %s +SelectElementAndClick=Atlasiet elementu un noklikšķiniet uz %s PrintFile=Drukāt failu %s ShowTransaction=Rādīt ierakstu bankas kontā ShowIntervention=Rādīt iejaukšanās @@ -858,8 +858,8 @@ Denied=Aizliegts ListOf=%s saraksts ListOfTemplates=Saraksts ar veidnēm Gender=Dzimums -Genderman=Male -Genderwoman=Female +Genderman=Vīrietis +Genderwoman=Sieviete Genderother=Cits ViewList=Saraksta skats ViewGantt=Ganta skats @@ -906,10 +906,10 @@ ViewAccountList=Skatīt virsgrāmatu ViewSubAccountList=Skatīt apakškonta virsgrāmatu RemoveString=Noņemt virkni '%s' SomeTranslationAreUncomplete=Dažas piedāvātās valodas var būt tikai daļēji tulkotas vai var saturēt kļūdas. Lūdzu, palīdziet labot savu valodu, reģistrējoties https://transifex.com/projects/p/dolibarr/ , lai pievienotu savus uzlabojumus. -DirectDownloadLink=Public download link -PublicDownloadLinkDesc=Only the link is required to download the file -DirectDownloadInternalLink=Private download link -PrivateDownloadLinkDesc=You need to be logged and you need permissions to view or download the file +DirectDownloadLink=Publiska lejupielādes saite +PublicDownloadLinkDesc=Lai lejupielādētu failu, nepieciešama tikai saite +DirectDownloadInternalLink=Privāta lejupielādes saite +PrivateDownloadLinkDesc=Lai skatītu vai lejupielādētu failu, jums ir jāpiesakās un jums ir vajadzīgas atļaujas Download=Lejupielādēt DownloadDocument=Lejupielādēt dokumentu ActualizeCurrency=Atjaunināt valūtas kursu @@ -1022,7 +1022,7 @@ SearchIntoContacts=Kontakti SearchIntoMembers=Dalībnieki SearchIntoUsers=Lietotāji SearchIntoProductsOrServices=Preces un pakalpojumi -SearchIntoBatch=Lots / Serials +SearchIntoBatch=Daudz / sērijas SearchIntoProjects=Projekti SearchIntoMO=Ražošanas pasūtījumi SearchIntoTasks=Uzdevumi @@ -1059,13 +1059,13 @@ KeyboardShortcut=Tastatūras saīsne AssignedTo=Piešķirts Deletedraft=Dzēst melnrakstu ConfirmMassDraftDeletion=Projekta masveida dzēšanas apstiprinājums -FileSharedViaALink=File shared with a public link +FileSharedViaALink=Fails ir kopīgots ar publisku saiti SelectAThirdPartyFirst=Vispirms izvēlieties trešo pusi ... YouAreCurrentlyInSandboxMode=Pašlaik esat %s "smilšu kastes" režīmā Inventory=Inventārs AnalyticCode=Analītiskais kods TMenuMRP=MRP -ShowCompanyInfos=Show company infos +ShowCompanyInfos=Rādīt uzņēmuma informāciju ShowMoreInfos=Rādīt vairāk informācijas NoFilesUploadedYet=Lūdzu, vispirms augšupielādējiet dokumentu SeePrivateNote=Skatīt privāto piezīmi @@ -1074,7 +1074,7 @@ ValidFrom=Derīgs no ValidUntil=Derīgs līdz NoRecordedUsers=Nav lietotāju ToClose=Aizvērt -ToRefuse=To refuse +ToRefuse=Atteikties ToProcess=Jāapstrādā ToApprove=Apstiprināt GlobalOpenedElemView=Globālais izskats @@ -1129,11 +1129,11 @@ UpdateForAllLines=Atjauninājums visām līnijām OnHold=On hold Civility=Laipnība AffectTag=Ietekmēt tagu -CreateExternalUser=Create external user +CreateExternalUser=Izveidot ārēju lietotāju ConfirmAffectTag=Masveida tagu ietekme ConfirmAffectTagQuestion=Vai tiešām vēlaties ietekmēt atlasītā (-o) ieraksta (-u) %s tagus? CategTypeNotFound=Ierakstu veidam nav atrasts neviens tagu tips -CopiedToClipboard=Copied to clipboard -InformationOnLinkToContract=This amount is only the total of all the lines of the contract. No notion of time is taken into consideration. -ConfirmCancel=Are you sure you want to cancel -EmailMsgID=Email MsgID +CopiedToClipboard=Kopēts starpliktuvē +InformationOnLinkToContract=Šī summa ir tikai visu līguma rindu kopsumma. Laika jēdziens netiek ņemts vērā. +ConfirmCancel=Vai tiešām vēlaties atcelt +EmailMsgID=Nosūtīt e-pastu MsgID diff --git a/htdocs/langs/lv_LV/margins.lang b/htdocs/langs/lv_LV/margins.lang index 92c24a82dc9..6a5520e8680 100644 --- a/htdocs/langs/lv_LV/margins.lang +++ b/htdocs/langs/lv_LV/margins.lang @@ -22,7 +22,7 @@ ProductService=Produkts vai pakalpojums AllProducts=Visi produkti un pakalpojumi ChooseProduct/Service=Izvēlies preci vai pakalpojumu ForceBuyingPriceIfNull=Force buying/cost price to selling price if not defined -ForceBuyingPriceIfNullDetails=If buying/cost price not provided when we add a new line, and this option is "ON", the margin will be 0 on the new line (buying/cost price = selling price). If this option is "OFF" (recommended), margin will be equal to the value suggested by default (and may be 100% if no default value can be found). +ForceBuyingPriceIfNullDetails=Ja pirkšanas / pašizmaksa nav norādīta, kad pievienojam jaunu rindu, un šī opcija ir “IESLĒGTS”, jaunajā rindā starpība būs 0 (pirkšanas / pašizmaksa = pārdošanas cena). Ja šī opcija ir "OFF" (ieteicams), starpība būs vienāda ar noklusējuma ieteikto vērtību (un, ja noklusējuma vērtību nevar atrast, tā var būt 100%). MARGIN_METHODE_FOR_DISCOUNT=Maržinālā metode pasaules atlaides UseDiscountAsProduct=Kā produktu UseDiscountAsService=Kā pakalpojums diff --git a/htdocs/langs/lv_LV/members.lang b/htdocs/langs/lv_LV/members.lang index 37bfdb2018b..966a410adef 100644 --- a/htdocs/langs/lv_LV/members.lang +++ b/htdocs/langs/lv_LV/members.lang @@ -15,24 +15,24 @@ ErrorMemberIsAlreadyLinkedToThisThirdParty=Vēl viens dalībnieks (nosaukums: globāla-> MYMODULE_MYOPTION) VisibleDesc=Vai lauks ir redzams? (Piemēri: 0 = nekad nav redzams, 1 = redzams sarakstā un izveidojiet / atjauniniet / skatiet veidlapas, 2 = ir redzams tikai sarakstā, 3 = ir redzams tikai izveides / atjaunināšanas / skata formā (nav sarakstā), 4 = ir redzams sarakstā un tikai atjaunināt / skatīt formu (neveidot), 5 = redzama tikai saraksta beigu skata formā (neveidot, ne atjaunināt).

    Negatīvas vērtības līdzekļu izmantošana lauka pēc noklusējuma netiek parādīta, bet to var atlasīt apskatei).

    Tas var būt izteiciens, piemēram:
    preg_match ('/ public /', $ _SERVER ['PHP_SELF'])? 0: 1
    ($ user-> rights-> rights- -DisplayOnPdfDesc=Display this field on compatible PDF documents, you can manage position with "Position" field.
    Currently, known compatibles PDF models are : eratosthene (order), espadon (ship), sponge (invoices), cyan (propal/quotation), cornas (supplier order)

    For document :
    0 = not displayed
    1 = display
    2 = display only if not empty

    For document lines :
    0 = not displayed
    1 = displayed in a column
    3 = display in line description column after the description
    4 = display in description column after the description only if not empty +DisplayOnPdfDesc=Parādiet šo lauku saderīgos PDF dokumentos, pozīciju var pārvaldīt, izmantojot lauku “Pozīcija”.
    Pašlaik zināmie saderīgie PDF modeļi ir: eratosthene (pasūtījums), espadon (kuģis), sūklis (rēķini), ciāns (propāls / citāts), radzenes (piegādātāja pasūtījums) = displejs
    2 = parādīt tikai tad, ja nav iztukšot

    dokumentu līnijas:
    0 = nav redzama
    1 = parādīti kolonnā
    3 = displeja līnija apraksta slejā pēc apraksta
    4 = displeja apraksta ailē pēc tam, kad apraksts tikai tad, ja tas nav tukšs DisplayOnPdf=Displejs PDF formātā IsAMeasureDesc=Vai lauka vērtību var uzkrāties, lai kopsumma tiktu iekļauta sarakstā? (Piemēri: 1 vai 0) SearchAllDesc=Vai laukums tiek izmantots, lai veiktu meklēšanu no ātrās meklēšanas rīka? (Piemēri: 1 vai 0) @@ -133,9 +133,9 @@ IncludeDocGeneration=Es gribu no objekta ģenerēt dažus dokumentus IncludeDocGenerationHelp=Ja to atzīmēsit, tiks izveidots kāds kods, lai ierakstam pievienotu rūtiņu “Ģenerēt dokumentu”. ShowOnCombobox=Rādīt vērtību kombinētajā lodziņā KeyForTooltip=Rīka padoma atslēga -CSSClass=CSS for edit/create form -CSSViewClass=CSS for read form -CSSListClass=CSS for list +CSSClass=CSS rediģēšanas / izveides veidlapai +CSSViewClass=CSS lasāmai formai +CSSListClass=CSS sarakstam NotEditable=Nav rediģējams ForeignKey=Sveša atslēga TypeOfFieldsHelp=Lauku tips:
    varchar (99), double (24,8), real, text, html, datetime, timestamp, integer, integer: ClassName: reliapath / to / classfile.class.php [: 1 [: filter]] ('1' nozīmē mēs pievienojam pogu + pēc kombināta, lai izveidotu ierakstu; “filtrs” var būt “status = 1 UN fk_user = __USER_ID UN entītija (piemēram, __SHARED_ENTITIES__)”. @@ -143,4 +143,4 @@ AsciiToHtmlConverter=Ascii uz HTML pārveidotāju AsciiToPdfConverter=Ascii uz PDF pārveidotāju TableNotEmptyDropCanceled=Tabula nav tukša. Dzēšana tika atcelta. ModuleBuilderNotAllowed=Moduļu veidotājs ir pieejams, bet nav atļauts jūsu lietotājam. -ImportExportProfiles=Import and export profiles +ImportExportProfiles=Importēt un eksportēt profilus diff --git a/htdocs/langs/lv_LV/mrp.lang b/htdocs/langs/lv_LV/mrp.lang index 0ac6b6843af..25d867bbd20 100644 --- a/htdocs/langs/lv_LV/mrp.lang +++ b/htdocs/langs/lv_LV/mrp.lang @@ -13,7 +13,7 @@ BOMsSetup=Moduļa BOM iestatīšana ListOfBOMs=Materiālu rēķinu saraksts - BOM ListOfManufacturingOrders=Ražošanas pasūtījumu saraksts NewBOM=Jauns materiālu saraksts -ProductBOMHelp=Product to create (or disassemble) with this BOM.
    Note: Products with the property 'Nature of product' = 'Raw material' are not visible into this list. +ProductBOMHelp=Produkts, kuru izveidot (vai izjaukt) ar šo BOM.
    Piezīme: Produkti ar īpašību 'Produkta veids' = 'Izejvielas' šajā sarakstā nav redzami. BOMsNumberingModules=BOM numerācijas veidnes BOMsModelModule=BOM dokumentu veidnes MOsNumberingModules=MO numerācijas veidnes @@ -39,7 +39,7 @@ DateStartPlannedMo=Plānots sākuma datums DateEndPlannedMo=Plānots datuma beigas KeepEmptyForAsap=Tukša nozīmē “cik drīz vien iespējams” EstimatedDuration=Paredzamais ilgums -EstimatedDurationDesc=Estimated duration to manufacture (or disassemble) this product using this BOM +EstimatedDurationDesc=Paredzamais šī produkta izgatavošanas (vai demontāžas) ilgums, izmantojot šo BOM ConfirmValidateBom=Vai tiešām vēlaties apstiprināt BOM ar atsauci %s (jūs to varēsit izmantot, lai izveidotu jaunus ražošanas pasūtījumus) ConfirmCloseBom=Vai tiešām vēlaties atcelt šo BOM (jūs to vairs nevarēsit izmantot, lai izveidotu jaunus ražošanas pasūtījumus)? ConfirmReopenBom=Vai tiešām vēlaties atkārtoti atvērt šo BOM (jūs to varēsit izmantot, lai izveidotu jaunus ražošanas pasūtījumus) @@ -63,14 +63,14 @@ ConsumeAndProduceAll=Patērēt un ražot visu Manufactured=Izgatavots TheProductXIsAlreadyTheProductToProduce=Pievienojamais produkts jau ir produkts, ko ražot. ForAQuantityOf=Par saražoto daudzumu %s -ForAQuantityToConsumeOf=For a quantity to disassemble of %s +ForAQuantityToConsumeOf=Lai izjauktu daudzumu %s ConfirmValidateMo=Vai tiešām vēlaties apstiprināt šo ražošanas pasūtījumu? ConfirmProductionDesc=Noklikšķinot uz “%s”, jūs apstiprināsit noteikto daudzumu patēriņu un / vai ražošanu. Tas arī atjauninās krājumus un reģistrēs krājumu kustību. ProductionForRef=%s ražošana AutoCloseMO=Automātiski aizveriet ražošanas pasūtījumu, ja ir sasniegti patērējamie un saražotie daudzumi NoStockChangeOnServices=Pakalpojumu krājumi nemainās ProductQtyToConsumeByMO=Produkta daudzums, ko vēl vajadzētu patērēt atvērtā MO -ProductQtyToProduceByMO=Product quantity still to produce by open MO +ProductQtyToProduceByMO=Produkta daudzums, kas vēl jāražo ar atvērtu MO AddNewConsumeLines=Pievienojiet jaunu rindu patērēšanai ProductsToConsume=Produkti, kurus patērēt ProductsToProduce=Izgatavojamie produkti diff --git a/htdocs/langs/lv_LV/orders.lang b/htdocs/langs/lv_LV/orders.lang index 1dc27b5f27c..1f8d5768509 100644 --- a/htdocs/langs/lv_LV/orders.lang +++ b/htdocs/langs/lv_LV/orders.lang @@ -17,8 +17,8 @@ ToOrder=Veicot pasūtījumu MakeOrder=Veicot pasūtījumu SupplierOrder=Pirkuma pasūtījums SuppliersOrders=Pirkuma pasūtījumi -SaleOrderLines=Sale order lines -PurchaseOrderLines=Puchase order lines +SaleOrderLines=Izpārdošanas pasūtījumu līnijas +PurchaseOrderLines=Puchase pasūtījuma līnijas SuppliersOrdersRunning=Pašreizējie pirkumu pasūtījumi CustomerOrder=Pārdošanas pasūtījums CustomersOrders=Pārdošanas pasūtījumi diff --git a/htdocs/langs/lv_LV/other.lang b/htdocs/langs/lv_LV/other.lang index 04863c42be0..64cae5e5bc6 100644 --- a/htdocs/langs/lv_LV/other.lang +++ b/htdocs/langs/lv_LV/other.lang @@ -114,7 +114,7 @@ DemoCompanyAll=Uzņēmums ar vairākām darbībām (visi galvenie moduļi) CreatedBy=Izveidoja %s ModifiedBy=Laboja %s ValidatedBy=Apstiprināja %s -SignedBy=Signed by %s +SignedBy=Parakstījis %s ClosedBy=Slēdza %s CreatedById=Lietotāja id kurš izveidojis ModifiedById=Lietotāja id kurš veica pēdējās izmaiņas @@ -129,7 +129,7 @@ ClosedByLogin=Lietotājs, kurš slēdzis FileWasRemoved=Fails %s tika dzēsts DirWasRemoved=Katalogs %s tika dzēsts FeatureNotYetAvailable=Funkcija pašreizējā versijā vēl nav pieejama -FeatureNotAvailableOnDevicesWithoutMouse=Feature not available on devices without mouse +FeatureNotAvailableOnDevicesWithoutMouse=Funkcija nav pieejama ierīcēs bez peles FeaturesSupported=Atbalstītās funkcijas Width=Platums Height=Augstums @@ -184,7 +184,7 @@ EnableGDLibraryDesc=Instalējiet vai iespējojiet GD bibliotēku savā PHP insta ProfIdShortDesc=Prof ID %s ir informācija, atkarībā no trešās puses valstīm.
    Piemēram, attiecībā uz valstu %s, tas ir kods %s. DolibarrDemo=Dolibarr ERP/CRM demo StatsByNumberOfUnits=Statistics for sum of qty of products/services -StatsByNumberOfEntities=Statistics for number of referring entities (no. of invoices, or orders...) +StatsByNumberOfEntities=Statistika par nosūtītāju skaitu (rēķinu vai pasūtījumu skaits ...) NumberOfProposals=Priekšlikumu skaits NumberOfCustomerOrders=Pārdošanas pasūtījumu skaits NumberOfCustomerInvoices=Klientu rēķinu skaits @@ -246,7 +246,7 @@ NewKeyIs=Tas ir jūsu jaunās atslēgas, lai pieteiktos NewKeyWillBe=Jūsu jaunais galvenais, lai pieteiktos uz programmatūru, būs ClickHereToGoTo=Klikšķiniet šeit, lai dotos uz %s YouMustClickToChange=Jums ir Taču vispirms noklikšķiniet uz šīs saites, lai apstiprinātu šo paroles maiņa -ConfirmPasswordChange=Confirm password change +ConfirmPasswordChange=Apstipriniet paroles maiņu ForgetIfNothing=Ja Jums nav lūgt šīs izmaiņas, vienkārši aizmirst šo e-pastu. Jūsu akreditācijas dati tiek glabāti drošībā. IfAmountHigherThan=Ja summa pārsniedz %s SourcesRepository=Repository for sources @@ -264,7 +264,7 @@ ContactCreatedByEmailCollector=Kontaktpersona / adrese, ko izveidojis e-pasta ko ProjectCreatedByEmailCollector=Projekts, ko izveidojis e-pasta savācējs no e-pasta MSGID %s TicketCreatedByEmailCollector=Biļete, ko izveidojis e-pasta kolekcionārs no e-pasta MSGID %s OpeningHoursFormatDesc=Izmantojiet taustiņu -, lai nodalītu darba un aizvēršanas stundas.
    Izmantojiet atstarpi, lai ievadītu dažādus diapazonus.
    Piemērs: 8.-12 -SuffixSessionName=Suffix for session name +SuffixSessionName=Sesijas nosaukuma sufikss ##### Export ##### ExportsArea=Eksportēšanas sadaļa @@ -290,4 +290,4 @@ PopuProp=Produkti / pakalpojumi pēc popularitātes priekšlikumos PopuCom=Produkti / pakalpojumi pēc popularitātes pasūtījumos ProductStatistics=Produktu/pakalpojumu statistika NbOfQtyInOrders=Daudzums pasūtījumos -SelectTheTypeOfObjectToAnalyze=Select an object to view its statistics... +SelectTheTypeOfObjectToAnalyze=Atlasiet objektu, lai skatītu tā statistiku ... diff --git a/htdocs/langs/lv_LV/partnership.lang b/htdocs/langs/lv_LV/partnership.lang index d9de28dd450..bc720b88482 100644 --- a/htdocs/langs/lv_LV/partnership.lang +++ b/htdocs/langs/lv_LV/partnership.lang @@ -16,66 +16,66 @@ # # Generic # -ModulePartnershipName=Partnership management -PartnershipDescription=Module Partnership management -PartnershipDescriptionLong= Module Partnership management +ModulePartnershipName=Partnerības vadība +PartnershipDescription=Partnerības vadības modulis +PartnershipDescriptionLong= Partnerības vadības modulis -AddPartnership=Add partnership -CancelPartnershipForExpiredMembers=Partnership: Cancel partnership of members with expired subscriptions -PartnershipCheckBacklink=Partnership: Check referring backlink +AddPartnership=Pievienojiet partnerību +CancelPartnershipForExpiredMembers=Partnerība: atceļ partnerību ar abonementiem, kuriem beidzies derīguma termiņš +PartnershipCheckBacklink=Partnerība: pārbaudiet atsauces saiti # # Menu # -NewPartnership=New Partnership -ListOfPartnerships=List of partnership +NewPartnership=Jauna partnerība +ListOfPartnerships=Partnerības saraksts # # Admin page # -PartnershipSetup=Partnership setup -PartnershipAbout=About Partnership -PartnershipAboutPage=Partnership about page -partnershipforthirdpartyormember=Partner status must be set on a 'thirdparty' or a 'member' -PARTNERSHIP_IS_MANAGED_FOR=Partnership managed for -PARTNERSHIP_BACKLINKS_TO_CHECK=Backlinks to check -PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL=Nb of days before cancelling status of a partnership when a subscription has expired -ReferingWebsiteCheck=Check of website referring -ReferingWebsiteCheckDesc=You can enable a feature to check that your partners has added a backlink to your website domains on their own website. +PartnershipSetup=Partnerības iestatīšana +PartnershipAbout=Par partnerību +PartnershipAboutPage=Partnerība par lapu +partnershipforthirdpartyormember=Partnera statusam jābūt iestatītam “trešajai pusei” vai “dalībniekam” +PARTNERSHIP_IS_MANAGED_FOR=Partnerattiecības pārvaldītas +PARTNERSHIP_BACKLINKS_TO_CHECK=Atpakaļsaites, lai pārbaudītu +PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL=Nb dienas pirms partnerības statusa atcelšanas, kad abonements ir beidzies +ReferingWebsiteCheck=Vietnes atsauces pārbaude +ReferingWebsiteCheckDesc=Varat iespējot funkciju, lai pārbaudītu, vai jūsu partneri ir pievienojuši atpakaļsaišu jūsu vietnes domēniem savā vietnē. # # Object # -DeletePartnership=Delete a partnership -PartnershipDedicatedToThisThirdParty=Partnership dedicated to this third party -PartnershipDedicatedToThisMember=Partnership dedicated to this member +DeletePartnership=Dzēst partnerību +PartnershipDedicatedToThisThirdParty=Partnerība, kas veltīta šai trešajai pusei +PartnershipDedicatedToThisMember=Šim dalībniekam veltīta partnerība DatePartnershipStart=Sākuma datums DatePartnershipEnd=Beigu datums -ReasonDecline=Decline reason -ReasonDeclineOrCancel=Decline reason -PartnershipAlreadyExist=Partnership already exist -ManagePartnership=Manage partnership -BacklinkNotFoundOnPartnerWebsite=Backlink not found on partner website -ConfirmClosePartnershipAsk=Are you sure you want to cancel this partnership? -PartnershipType=Partnership type +ReasonDecline=Noraidīt iemeslu +ReasonDeclineOrCancel=Noraidīt iemeslu +PartnershipAlreadyExist=Partnerattiecības jau pastāv +ManagePartnership=Pārvaldiet partnerību +BacklinkNotFoundOnPartnerWebsite=Atpakaļsaite nav atrasta partnera vietnē +ConfirmClosePartnershipAsk=Vai tiešām vēlaties atcelt šo partnerību? +PartnershipType=Partnerības veids # # Template Mail # -SendingEmailOnPartnershipWillSoonBeCanceled=Partnership will soon be canceled -SendingEmailOnPartnershipRefused=Partnership refused -SendingEmailOnPartnershipAccepted=Partnership accepted -SendingEmailOnPartnershipCanceled=Partnership canceled +SendingEmailOnPartnershipWillSoonBeCanceled=Partnerība drīz tiks atcelta +SendingEmailOnPartnershipRefused=Partnerība atteikta +SendingEmailOnPartnershipAccepted=Partnerība pieņemta +SendingEmailOnPartnershipCanceled=Partnerattiecības atceltas -YourPartnershipWillSoonBeCanceledTopic=Partnership will soon be canceled -YourPartnershipRefusedTopic=Partnership refused -YourPartnershipAcceptedTopic=Partnership accepted -YourPartnershipCanceledTopic=Partnership canceled +YourPartnershipWillSoonBeCanceledTopic=Partnerība drīz tiks atcelta +YourPartnershipRefusedTopic=Partnerība atteikta +YourPartnershipAcceptedTopic=Partnerība pieņemta +YourPartnershipCanceledTopic=Partnerattiecības atceltas -YourPartnershipWillSoonBeCanceledContent=We inform you that your partnership will soon be canceled (Backlink not found) -YourPartnershipRefusedContent=We inform you that your partnership request has been refused. -YourPartnershipAcceptedContent=We inform you that your partnership request has been accepted. -YourPartnershipCanceledContent=We inform you that your partnership has been canceled. +YourPartnershipWillSoonBeCanceledContent=Mēs jūs informējam, ka jūsu partnerība drīz tiks atcelta (atpakaļsaite nav atrasta) +YourPartnershipRefusedContent=Mēs jūs informējam, ka jūsu partnerības pieprasījums ir noraidīts. +YourPartnershipAcceptedContent=Mēs jūs informējam, ka jūsu partnerības pieprasījums ir pieņemts. +YourPartnershipCanceledContent=Mēs jūs informējam, ka jūsu partnerattiecības ir atceltas. # # Status @@ -84,4 +84,4 @@ PartnershipDraft=Melnraksts PartnershipAccepted=Pieņemts PartnershipRefused=Atteikts PartnershipCanceled=Atcelts -PartnershipManagedFor=Partners are +PartnershipManagedFor=Partneri ir diff --git a/htdocs/langs/lv_LV/productbatch.lang b/htdocs/langs/lv_LV/productbatch.lang index 2f03a347eee..7e54bf7debd 100644 --- a/htdocs/langs/lv_LV/productbatch.lang +++ b/htdocs/langs/lv_LV/productbatch.lang @@ -1,10 +1,10 @@ # ProductBATCH language file - Source file is en_US - ProductBATCH ManageLotSerial=Izmantot partijas / sērijas numuru -ProductStatusOnBatch=Yes (lot required) -ProductStatusOnSerial=Yes (unique serial number required) +ProductStatusOnBatch=Jā (nepieciešama partija) +ProductStatusOnSerial=Jā (nepieciešams unikāls sērijas numurs) ProductStatusNotOnBatch=Nav (partija / sērijas numurs netiek izmantots) -ProductStatusOnBatchShort=Lot -ProductStatusOnSerialShort=Serial +ProductStatusOnBatchShort=Daudz +ProductStatusOnSerialShort=Seriāls ProductStatusNotOnBatchShort=Nē Batch=Lot/seriāls atleast1batchfield=Eat-by date or Sell-by date or Lot/Serial number @@ -24,22 +24,22 @@ ProductLotSetup=Moduļu partijas / sērijas uzstādīšana ShowCurrentStockOfLot=Parādīt pašreizējo krājumu par pāris produktu / partiju ShowLogOfMovementIfLot=Rādīt žurnālu par kustību pāriem produktam / partijai StockDetailPerBatch=Krājumu dati par partiju -SerialNumberAlreadyInUse=Serial number %s is already used for product %s -TooManyQtyForSerialNumber=You can only have one product %s for serial number %s -BatchLotNumberingModules=Options for automatic generation of batch products managed by lots -BatchSerialNumberingModules=Options for automatic generation of batch products managed by serial numbers -ManageLotMask=Custom mask -CustomMasks=Adds an option to define mask in the product card -LotProductTooltip=Adds an option in the product card to define a dedicated batch number mask -SNProductTooltip=Adds an option in the product card to define a dedicated serial number mask -QtyToAddAfterBarcodeScan=Qty to add for each barcode/lot/serial scanned -LifeTime=Life span (in days) -EndOfLife=End of life -ManufacturingDate=Manufacturing date -DestructionDate=Destruction date -FirstUseDate=First use date -QCFrequency=Quality control frequency (in days) +SerialNumberAlreadyInUse=Sērijas numurs %s jau tiek izmantots produktam %s +TooManyQtyForSerialNumber=Jums var būt tikai viens produkts %s sērijas numuram %s +BatchLotNumberingModules=Iespējas automātiskai sērijveida produktu ģenerēšanai, ko pārvalda partijas +BatchSerialNumberingModules=Iespējas automātiskai sērijveida produktu ģenerēšanai, kurus pārvalda sērijas numuri +ManageLotMask=Pielāgota maska +CustomMasks=Produkta kartē tiek pievienota iespēja definēt masku +LotProductTooltip=Produkta kartē tiek pievienota opcija, lai noteiktu īpašu partijas numura masku +SNProductTooltip=Produkta kartē tiek pievienota opcija, lai noteiktu īpašu sērijas numura masku +QtyToAddAfterBarcodeScan=Katram skenētajam svītrkodam / partijai / sērijai jāpievieno daudzums +LifeTime=Mūža ilgums (dienās) +EndOfLife=Dzīves beigas +ManufacturingDate=Ražošanas datums +DestructionDate=Iznīcināšanas datums +FirstUseDate=Pirmās lietošanas datums +QCFrequency=Kvalitātes kontroles biežums (dienās) #Traceability - qc status -OutOfOrder=Out of order -InWorkingOrder=In working order +OutOfOrder=Nedarbojas +InWorkingOrder=Darba kārtībā diff --git a/htdocs/langs/lv_LV/products.lang b/htdocs/langs/lv_LV/products.lang index b3ca5f5434a..e5a50f0a6ca 100644 --- a/htdocs/langs/lv_LV/products.lang +++ b/htdocs/langs/lv_LV/products.lang @@ -43,7 +43,7 @@ ServicesOnSaleOnly=Pakalpojumi pārdošanai ServicesOnPurchaseOnly=Pakalpojumi tikai pirkšanai ServicesNotOnSell=Pakalpojumi, kas nav paredzēti pārdošanai un nav paredzēti pirkšanai ServicesOnSellAndOnBuy=Services for sale and for purchase -LastModifiedProductsAndServices=Latest %s products/services which were modified +LastModifiedProductsAndServices=Jaunākie %s produkti / pakalpojumi, kas tika modificēti LastRecordedProducts=Jaunākie ieraksti %s LastRecordedServices=Jaunākie %s reģistrētie pakalpojumi CardProduct0=Produkts @@ -73,12 +73,12 @@ SellingPrice=Pārdošanas cena SellingPriceHT=Pārdošanas cena (bez nodokļa) SellingPriceTTC=Pārdošanas cena (ar PVN) SellingMinPriceTTC=Minimālā pārdošanas cena (ieskaitot nodokli) -CostPriceDescription=This price field (excl. tax) can be used to capture the average amount this product costs to your company. It may be any price you calculate yourself, for example, from the average buying price plus average production and distribution cost. +CostPriceDescription=Šo cenu lauku (bez nodokļiem) var izmantot, lai attēlotu vidējo summu, ko šis produkts izmaksā jūsu uzņēmumam. Tā var būt jebkura cena, kuru pats aprēķināt, piemēram, no vidējās pirkšanas cenas plus vidējās ražošanas un izplatīšanas izmaksas. CostPriceUsage=Šo vērtību var izmantot, lai aprēķinātu peļņu. SoldAmount=Pārdošanas apjoms PurchasedAmount=Iegādātā summa NewPrice=Jaunā cena -MinPrice=Min. selling price +MinPrice=Min. pārdošanas cena EditSellingPriceLabel=Labot pārdošanas cenas nosaukumu CantBeLessThanMinPrice=Pārdošanas cena nevar būt zemāka par minimālo pieļaujamo šī produkta (%s bez PVN). Šis ziņojums var būt arī parādās, ja esat ievadījis pārāk lielu atlaidi. ContractStatusClosed=Slēgts @@ -141,7 +141,7 @@ VATRateForSupplierProduct=PVN likme (šim pārdevējam / produktam) DiscountQtyMin=Atlaide šim daudzumam. NoPriceDefinedForThisSupplier=Šim pārdevējam / produktam nav noteikta cena / daudzums NoSupplierPriceDefinedForThisProduct=Šim produktam nav noteikta pārdevēja cena / daudzums -PredefinedItem=Predefined item +PredefinedItem=Iepriekš definēts vienums PredefinedProductsToSell=Iepriekš definēts produkts PredefinedServicesToSell=Iepriekš definēts pakalpojums PredefinedProductsAndServicesToSell=Iepriekš definēti produkti/pakalpojumi, kurus pārdot @@ -157,11 +157,11 @@ ListServiceByPopularity=Pakalpojumu saraksts pēc pārdošanas popularitātes Finished=Ražota prece RowMaterial=Izejviela ConfirmCloneProduct=Vai jūs tiešām vēlaties klonēt šo produktu vai pakalpojumu %s? -CloneContentProduct=Clone all main information of the product/service +CloneContentProduct=Klonējiet visu galveno informāciju par produktu / pakalpojumu ClonePricesProduct=Klonēt cenas -CloneCategoriesProduct=Clone linked tags/categories -CloneCompositionProduct=Clone virtual products/services -CloneCombinationsProduct=Clone the product variants +CloneCategoriesProduct=Klonējiet saistītos tagus / kategorijas +CloneCompositionProduct=Klonējiet virtuālos produktus / pakalpojumus +CloneCombinationsProduct=Klonējiet produktu variantus ProductIsUsed=Šis produkts tiek izmantots NewRefForClone=Ref. jaunu produktu / pakalpojumu SellingPrices=Pārdošanas cenas @@ -170,12 +170,12 @@ CustomerPrices=Klienta cenas SuppliersPrices=Pārdevēja cenas SuppliersPricesOfProductsOrServices=Pārdevēja cenas (produktiem vai pakalpojumiem) CustomCode=Muita | prece | HS kods -CountryOrigin=Country of origin -RegionStateOrigin=Region of origin -StateOrigin=State|Province of origin -Nature=Nature of product (raw/manufactured) +CountryOrigin=Izcelsmes valsts +RegionStateOrigin=Izcelsmes reģions +StateOrigin=Valsts | Izcelsmes province +Nature=Produkta veids (neapstrādāts / ražots) NatureOfProductShort=Produkta veids -NatureOfProductDesc=Raw material or manufactured product +NatureOfProductDesc=Izejviela vai ražots produkts ShortLabel=Īsais nosaukums Unit=Vienība p=u. @@ -277,7 +277,7 @@ PriceByCustomer=Dažādas cenas katram klientam PriceCatalogue=Viena produkta/pakalpojuma pārdošanas cena PricingRule=Noteikumi par pārdošanas cenām AddCustomerPrice=Pievienot cenu katram klientam -ForceUpdateChildPriceSoc=Iestatiet to pašu cenu klientu meitasuzņēmumiem +ForceUpdateChildPriceSoc=Nosakiet to pašu cenu klienta meitasuzņēmumiem PriceByCustomerLog=Log of previous customer prices MinimumPriceLimit=Minimum price can't be lower then %s MinimumRecommendedPrice=Minimālā ieteicamā cena ir: %s @@ -296,6 +296,7 @@ ComposedProductIncDecStock=Increase/Decrease stock on parent change ComposedProduct=Apakš produkti MinSupplierPrice=Minimālā iepirkuma cena MinCustomerPrice=Minimālā pārdošanas cena +NoDynamicPrice=Nav dinamiskas cenas DynamicPriceConfiguration=Dynamic price configuration DynamicPriceDesc=Jūs varat noteikt matemātiskās formulas, lai aprēķinātu Klienta vai pārdevēja cenas. Šādas formulas var izmantot visus matemātiskos operatorus, dažas konstantes un mainīgos. Šeit varat definēt mainīgos, kurus vēlaties izmantot. Ja mainīgajam nepieciešams automātisks atjauninājums, varat definēt ārējo URL, lai Dolibarr varētu automātiski atjaunināt vērtību. AddVariable=Pievienot mainīgo @@ -314,7 +315,7 @@ LastUpdated=Pēdējo reizi atjaunots CorrectlyUpdated=Pareizi atjaunināts PropalMergePdfProductActualFile=Files use to add into PDF Azur are/is PropalMergePdfProductChooseFile=Izvēlieties PDF failus -IncludingProductWithTag=Include products/services with tag +IncludingProductWithTag=Iekļaujiet produktus / pakalpojumus ar tagu DefaultPriceRealPriceMayDependOnCustomer=Noklusējuma cena, reālā cena var būt atkarīga no klienta WarningSelectOneDocument=Please select at least one document DefaultUnitToShow=Vienība diff --git a/htdocs/langs/lv_LV/projects.lang b/htdocs/langs/lv_LV/projects.lang index 19f959ab524..0391b4e8434 100644 --- a/htdocs/langs/lv_LV/projects.lang +++ b/htdocs/langs/lv_LV/projects.lang @@ -10,19 +10,19 @@ PrivateProject=Projekta kontakti ProjectsImContactFor=Projekti, par kuriem tieši esmu kontaktpersona AllAllowedProjects=All project I can read (mine + public) AllProjects=Visi projekti -MyProjectsDesc=This view is limited to the projects that you are a contact for +MyProjectsDesc=Šis skats attiecas tikai uz projektiem, ar kuriem esat kontaktpersona ProjectsPublicDesc=Šo viedokli iepazīstina visus projektus jums ir atļauts lasīt. TasksOnProjectsPublicDesc=This view presents all tasks on projects you are allowed to read. ProjectsPublicTaskDesc=This view presents all projects and tasks you are allowed to read. ProjectsDesc=Šo viedokli iepazīstina visus projektus (jūsu lietotāja atļaujas piešķirt jums atļauju skatīt visu). TasksOnProjectsDesc=Šis skats atspoguļo visus uzdevumus visos projektos (jūsu lietotāja atļaujas piešķir jums atļauju apskatī visu). -MyTasksDesc=This view is limited to the projects or tasks that you are a contact for +MyTasksDesc=Šis skats attiecas tikai uz projektiem vai uzdevumiem, ar kuriem esat kontaktpersona OnlyOpenedProject=Only open projects are visible (projects in draft or closed status are not visible). ClosedProjectsAreHidden=Slēgtie projekti nav redzami. TasksPublicDesc=Šo viedokli iepazīstina visus projektus un uzdevumus, jums ir atļauts lasīt. TasksDesc=Šo viedokli iepazīstina visus projektus un uzdevumus (jūsu lietotāja atļaujas piešķirt jums atļauju skatīt visu). AllTaskVisibleButEditIfYouAreAssigned=Visi uzdevumi kvalificētiem projektiem ir redzami, taču jūs varat ievadīt laiku tikai tam uzdevumam, kas piešķirts izvēlētajam lietotājam. Piešķirt uzdevumu, ja uz to ir jāievada laiks. -OnlyYourTaskAreVisible=Only tasks assigned to you are visible. If you need to enter time on a task and if the task is not visible here, then you need to assign the task to yourself. +OnlyYourTaskAreVisible=Ir redzami tikai jums piešķirtie uzdevumi. Ja jums jāievada uzdevuma izpildes laiks un ja uzdevums šeit nav redzams, jums tas jāpiešķir sev. ImportDatasetTasks=Projektu uzdevumi ProjectCategories=Projekta tagi / sadaļas NewProject=Jauns projekts @@ -89,7 +89,7 @@ TimeConsumed=Patērēts ListOfTasks=Uzdevumu saraksts GoToListOfTimeConsumed=Pāriet uz patērētā laika sarakstu GanttView=Ganta skats -ListWarehouseAssociatedProject=List of warehouses associated to the project +ListWarehouseAssociatedProject=Ar projektu saistīto noliktavu saraksts ListProposalsAssociatedProject=Ar projektu saistīto komerciālo priekšlikumu saraksts ListOrdersAssociatedProject=Ar projektu saistīto pārdošanas pasūtījumu saraksts ListInvoicesAssociatedProject=Saraksts ar klienta rēķiniem, kas saistīti ar projektu @@ -202,7 +202,7 @@ ResourceNotAssignedToTheTask=Uzdevumam nav piešķirts NoUserAssignedToTheProject=Neviens lietotājs nav piešķirts šim projektam TimeSpentBy=Pavadītais laiks TasksAssignedTo=Uzdevumi, kas piešķirti -AssignTaskToMe=Assign task to myself +AssignTaskToMe=Piešķiriet sev uzdevumu AssignTaskToUser=Piešķirt uzdevumu %s SelectTaskToAssign=Atlasiet uzdevumu, lai piešķirtu ... AssignTask=Piešķirt @@ -267,11 +267,11 @@ InvoiceToUse=Izmantojamais rēķina projekts NewInvoice=Jauns rēķins OneLinePerTask=Viena rinda katram uzdevumam OneLinePerPeriod=Viena rindiņa vienam periodam -OneLinePerTimeSpentLine=One line for each time spent declaration +OneLinePerTimeSpentLine=Viena rinda par katru pavadīto deklarāciju RefTaskParent=Ref. Vecāku uzdevums ProfitIsCalculatedWith=Peļņa tiek aprēķināta, izmantojot -AddPersonToTask=Add also to tasks -UsageOrganizeEvent=Usage: Event Organization -PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE=Classify project as closed when all its tasks are completed (100%% progress) -PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE_help=Note: existing projects with all tasks at 100 %% progress won't be affected: you will have to close them manually. This option only affects open projects. -SelectLinesOfTimeSpentToInvoice=Select lines of time spent that are unbilled, then bulk action "Generate Invoice" to bill them +AddPersonToTask=Pievienojiet arī uzdevumiem +UsageOrganizeEvent=Lietošana: Pasākumu organizēšana +PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE=Klasificējiet projektu kā slēgtu, kad visi tā uzdevumi ir izpildīti (progress 100%%) +PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE_help=Piezīme: esošie projekti ar visiem 100%% uzdevumiem netiks ietekmēti: tie būs jāaizver manuāli. Šī opcija ietekmē tikai atvērtos projektus. +SelectLinesOfTimeSpentToInvoice=Atlasiet pavadītās laika rindas, kas nav izrakstītas, un pēc tam veiciet lielapjoma darbību “Ģenerēt rēķinu”, lai par tām izrakstītu rēķinus diff --git a/htdocs/langs/lv_LV/propal.lang b/htdocs/langs/lv_LV/propal.lang index 868562cdf15..ae0c9ace708 100644 --- a/htdocs/langs/lv_LV/propal.lang +++ b/htdocs/langs/lv_LV/propal.lang @@ -59,7 +59,7 @@ ConfirmClonePropal=Vai tiešām vēlaties klonēt komerciālo priekšlikumu ConfirmReOpenProp=Are you sure you want to open back the commercial proposal %s? ProposalsAndProposalsLines=Commercial priekšlikumu un līnijas ProposalLine=Priekšlikuma līnija -ProposalLines=Proposal lines +ProposalLines=Priekšlikuma rindas AvailabilityPeriod=Pieejamība kavēšanās SetAvailability=Uzstādīt pieejamību kavēšanos AfterOrder=pēc pasūtījuma diff --git a/htdocs/langs/lv_LV/receptions.lang b/htdocs/langs/lv_LV/receptions.lang index 8c62d5199b5..42d3e64e35a 100644 --- a/htdocs/langs/lv_LV/receptions.lang +++ b/htdocs/langs/lv_LV/receptions.lang @@ -44,4 +44,4 @@ ValidateOrderFirstBeforeReception=Vispirms jums ir jāapstiprina pasūtījums, l ReceptionsNumberingModules=Pieņemšanas numurēšanas modulis ReceptionsReceiptModel=Pieņemšanas dokumentu veidnes NoMorePredefinedProductToDispatch=Vairs nav iepriekš nosūtītu produktu -ReceptionExist=A reception exists +ReceptionExist=Reģistratūra pastāv diff --git a/htdocs/langs/lv_LV/recruitment.lang b/htdocs/langs/lv_LV/recruitment.lang index 40957c1b2df..d85ea93e206 100644 --- a/htdocs/langs/lv_LV/recruitment.lang +++ b/htdocs/langs/lv_LV/recruitment.lang @@ -72,5 +72,5 @@ YourCandidatureAnswerMessage=Paldies par jūsu pieteikumu.
    ... JobClosedTextCandidateFound=Darba vieta ir slēgta. Amats ir aizpildīts. JobClosedTextCanceled=Darba vieta ir slēgta. ExtrafieldsJobPosition=Papildu atribūti (amata vietas) -ExtrafieldsApplication=Complementary attributes (job applications) +ExtrafieldsApplication=Papildu atribūti (darba pieteikumi) MakeOffer=Uztaisīt piedāvājumu diff --git a/htdocs/langs/lv_LV/salaries.lang b/htdocs/langs/lv_LV/salaries.lang index 816227ad4cb..711751a30b5 100644 --- a/htdocs/langs/lv_LV/salaries.lang +++ b/htdocs/langs/lv_LV/salaries.lang @@ -2,12 +2,15 @@ SALARIES_ACCOUNTING_ACCOUNT_PAYMENT=Grāmatvedības konts, ko izmanto trešām pusēm SALARIES_ACCOUNTING_ACCOUNT_PAYMENT_Desc=Lietotāja kartē norādītais grāmatvedības konts tiks izmantots tikai pakārtotajam grāmatvedim. Šis viens tiks izmantots General Ledger un noklusējuma vērtība Subledged grāmatvedībai, ja lietotāja definēts lietotāju grāmatvedības konts nav definēts. SALARIES_ACCOUNTING_ACCOUNT_CHARGE=Grāmatvedības konts pēc noklusējuma algu maksājumiem +CREATE_NEW_SALARY_WITHOUT_AUTO_PAYMENT=Pēc noklusējuma, veidojot algu, atstājiet tukšu opciju "Automātiski izveidot kopējo maksājumu" Salary=Alga Salaries=Algas -NewSalaryPayment=Jauna algas izmaksa +NewSalary=Jauna alga +NewSalaryPayment=Jauna algas karte AddSalaryPayment=Pievienot algas maksājumu SalaryPayment=Algas maksājums SalariesPayments=Algu maksājumi +SalariesPaymentsOf=Algas maksājumi %s ShowSalaryPayment=Rādīt algu maksājumus THM=Vidējā stundas cena TJM=Vidējā dienas likme diff --git a/htdocs/langs/lv_LV/sendings.lang b/htdocs/langs/lv_LV/sendings.lang index ae1c4042f5d..af79dcd83ee 100644 --- a/htdocs/langs/lv_LV/sendings.lang +++ b/htdocs/langs/lv_LV/sendings.lang @@ -43,7 +43,7 @@ ConfirmValidateSending=Vai jūs tiešām vēlaties apstiprināt šo sūtījumu a ConfirmCancelSending=Vai esat pārliecināts, ka vēlaties atcelt šo sūtījumu? DocumentModelMerou=Merou A5 modelis WarningNoQtyLeftToSend=Uzmanību, nav produktu kuri gaida nosūtīšanu. -StatsOnShipmentsOnlyValidated=Statistics are only for validated shipments. Date used is the date of validation of shipment (planned delivery date is not always known) +StatsOnShipmentsOnlyValidated=Statistika attiecas tikai uz apstiprinātiem sūtījumiem. Izmantotais datums ir sūtījuma apstiprināšanas datums (plānotais piegādes datums ne vienmēr ir zināms) DateDeliveryPlanned=Plānotais piegādes datums RefDeliveryReceipt=Ref piegādes kvīts StatusReceipt=Piegādes kvīts statuss diff --git a/htdocs/langs/lv_LV/stocks.lang b/htdocs/langs/lv_LV/stocks.lang index f6c3d4166fe..e3a3f3764a0 100644 --- a/htdocs/langs/lv_LV/stocks.lang +++ b/htdocs/langs/lv_LV/stocks.lang @@ -19,8 +19,8 @@ Stock=Krājums Stocks=Krājumi MissingStocks=Trūkst krājumu StockAtDate=Krājumi datumā -StockAtDateInPast=Date in the past -StockAtDateInFuture=Date in the future +StockAtDateInPast=Datums pagātnē +StockAtDateInFuture=Datums nākotnē StocksByLotSerial=Krājumi pēc partijas/sērijas LotSerial=Daudz / sērijas nr LotSerialList=Partijas saraksts / sērijas nr @@ -37,8 +37,8 @@ AllWarehouses=Visas noliktavas IncludeEmptyDesiredStock=Iekļaujiet arī negatīvo krājumu ar nenoteiktu vēlamo krājumu IncludeAlsoDraftOrders=Iekļaujiet arī pasūtījumu projektus Location=Vieta -LocationSummary=Short name of location -NumberOfDifferentProducts=Number of unique products +LocationSummary=Īss atrašanās vietas nosaukums +NumberOfDifferentProducts=Unikālo produktu skaits NumberOfProducts=Kopējais produktu skaits LastMovement=Pēdējā pārvietošana LastMovements=Pēdējās pārvietošanas @@ -60,8 +60,8 @@ EnhancedValueOfWarehouses=Noliktavas vērtība UserWarehouseAutoCreate=Lietotāja noliktavas izveide, izveidojot lietotāju AllowAddLimitStockByWarehouse=Pārvaldiet arī minimālā un vēlamā krājuma vērtību pārī (produkta noliktava), papildus minimālā un vēlamā krājuma vērtībai vienam produktam RuleForWarehouse=Noteikumi noliktavām -WarehouseAskWarehouseOnThirparty=Set a warehouse on third-party -WarehouseAskWarehouseDuringPropal=Set a warehouse on Commercial proposals +WarehouseAskWarehouseOnThirparty=Iestatiet noliktavu trešajām pusēm +WarehouseAskWarehouseDuringPropal=Iestatiet komerciālu priekšlikumu noliktavu WarehouseAskWarehouseDuringOrder=Iestatiet noliktavu pārdošanas pasūtījumiem UserDefaultWarehouse=Iestatiet noliktavu lietotājiem MainDefaultWarehouse=Noklusētā noliktava @@ -89,23 +89,23 @@ NoPredefinedProductToDispatch=Nav iepriekš produktu šo objektu. Līdz ar to na DispatchVerb=Nosūtīšana StockLimitShort=Brīdinājuma limits StockLimit=Krājumu brīdinājuma limits -StockLimitDesc=(empty) means no warning.
    0 can be used to trigger a warning as soon as the stock is empty. +StockLimitDesc=(tukšs) nozīmē, ka nav brīdinājuma.
    0 var izmantot, lai aktivizētu brīdinājumu, tiklīdz krājums ir tukšs. PhysicalStock=Fiziskais krājums RealStock=Rālie krājumi RealStockDesc=Fiziskā / reālā krājumi ir krājumi, kas pašlaik atrodas noliktavās. RealStockWillAutomaticallyWhen=Reālais krājums tiks mainīts saskaņā ar šo noteikumu (kā noteikts Stock modulī): VirtualStock=Virtuālie krājumi VirtualStockAtDate=Virtuālais krājums datumā -VirtualStockAtDateDesc=Virtual stock once all the pending orders that are planned to be processed before the chosen date will be finished +VirtualStockAtDateDesc=Virtuālais krājums, kad tiks pabeigti visi neapstiprinātie pasūtījumi, kurus plānots apstrādāt pirms izvēlētā datuma VirtualStockDesc=Virtuālais krājums ir aprēķinātais krājums, kas pieejams, kad visas atvērtās / neapstiprinātās darbības (kas ietekmē krājumus) ir aizvērtas (saņemti pirkumu pasūtījumi, nosūtīti pārdošanas pasūtījumi, saražoti ražošanas pasūtījumi utt.) -AtDate=At date +AtDate=Datumā IdWarehouse=Id noliktava DescWareHouse=Apraksts noliktava LieuWareHouse=Lokālā noliktava WarehousesAndProducts=Noliktavas un produkti WarehousesAndProductsBatchDetail=Noliktavas un produkti (ar informāciju par partiju/sēriju) AverageUnitPricePMPShort=Vidējā svērtā cena -AverageUnitPricePMPDesc=The input average unit price we had to expense to get 1 unit of product into our stock. +AverageUnitPricePMPDesc=Ievadītā vidējā vienības cena, kas mums bija jātērē, lai iegūtu 1 produkta vienību mūsu krājumos. SellPriceMin=Pārdošanas Vienības cena EstimatedStockValueSellShort=Pārdošanas cena EstimatedStockValueSell=Pārdošanas cena @@ -145,7 +145,7 @@ Replenishments=Papildinājumus NbOfProductBeforePeriod=Produktu daudzums %s noliktavā pirms izvēlētā perioda (< %s) NbOfProductAfterPeriod=Produktu daudzums %s krājumā pēc izvēlētā perioda (>%s) MassMovement=Masveida pārvietošana -SelectProductInAndOutWareHouse=Select a source warehouse and a target warehouse, a product and a quantity then click "%s". Once this is done for all required movements, click on "%s". +SelectProductInAndOutWareHouse=Atlasiet avota noliktavu un mērķa noliktavu, produktu un daudzumu, pēc tam noklikšķiniet uz "%s". Kad tas ir izdarīts visām nepieciešamajām kustībām, noklikšķiniet uz "%s". RecordMovement=Ierakstīt pārvietošanu ReceivingForSameOrder=Receipts for this order StockMovementRecorded=Krājumu pārvietošana saglabāta @@ -154,7 +154,7 @@ StockMustBeEnoughForInvoice=Krājumu līmenim ir jābūt pietiekamam, lai produk StockMustBeEnoughForOrder=Krājuma līmenim ir jābūt pietiekamam, lai produktu / pakalpojumu pasūtītam pēc pasūtījuma (pārbaudiet, vai pašreizējā reālā krājumā tiek pievienota rinda, lai kāds būtu noteikums automātiskai krājumu maiņai). StockMustBeEnoughForShipment= Krājumu līmenim ir jābūt pietiekamam, lai produktu / pakalpojumu nosūtītu sūtījumam (pārbaudiet pašreizējo reālo krājumu, pievienojot līniju sūtījumā neatkarīgi no automātiskās krājumu maiņas) MovementLabel=Kustības marķējums -TypeMovement=Direction of movement +TypeMovement=Kustības virziens DateMovement=Pārvietošanas datums InventoryCode=Movement or inventory code IsInPackage=Contained into package @@ -167,8 +167,8 @@ MovementTransferStock=Stock transfer of product %s into another warehouse InventoryCodeShort=Inv./Mov. code NoPendingReceptionOnSupplierOrder=Nav atvērta saņemšanas, jo atvērts pirkuma pasūtījums ThisSerialAlreadyExistWithDifferentDate=This lot/serial number (%s) already exists but with different eatby or sellby date (found %s but you enter %s). -OpenAll=Atvērt visām darbībām -OpenInternal=Atveras tikai iekšējām darbībām +OpenAnyMovement=Atvērt (visas kustības) +OpenInternal=Atvērta (tikai iekšēja kustība) UseDispatchStatus=Izmantojiet nosūtīšanas statusu (apstipriniet / noraidiet) produktu līnijām pirkuma pasūtījuma saņemšanā OptionMULTIPRICESIsOn=Ir ieslēgta opcija "vairākas cenas par segmentu". Tas nozīmē, ka produktam ir vairākas pārdošanas cenas, tāpēc pārdošanas vērtību nevar aprēķināt ProductStockWarehouseCreated=Brīdinājuma krājuma limits un pareizi izveidots vēlamais optimālais krājums @@ -183,7 +183,7 @@ inventoryCreatePermission=Izveidot jaunu inventāru inventoryReadPermission=Skatīt krājumus inventoryWritePermission=Atjaunināt krājumus inventoryValidatePermission=Pārbaudīt inventāru -inventoryDeletePermission=Delete inventory +inventoryDeletePermission=Dzēst krājumus inventoryTitle=Inventārs inventoryListTitle=Inventāri inventoryListEmpty=Netiek veikta neviena inventarizācija @@ -236,23 +236,23 @@ StockIsRequiredToChooseWhichLotToUse=Lai izvēlētos izmantojamo partiju, ir nep ForceTo=Piespiest līdz AlwaysShowFullArbo=Parādiet pilnu noliktavas koku uznirstošajās noliktavu saitēs (Brīdinājums: tas var dramatiski samazināt veiktspēju) StockAtDatePastDesc=Šeit varat apskatīt krājumus (reālos krājumus) noteiktā datumā pagātnē -StockAtDateFutureDesc=You can view here the stock (virtual stock) at a given date in the future +StockAtDateFutureDesc=Šeit varat apskatīt akcijas (virtuālās akcijas) noteiktā datumā nākotnē CurrentStock=Pašreizējais krājums InventoryRealQtyHelp=Iestatiet vērtību 0, lai atiestatītu daudzumu
    . Saglabājiet lauku tukšu vai noņemiet līniju, lai paliktu nemainīgs -UpdateByScaning=Fill real qty by scaning +UpdateByScaning=Aizpildiet reālo daudzumu, skenējot UpdateByScaningProductBarcode=Atjaunināšana, skenējot (produkta svītrkods) UpdateByScaningLot=Atjaunināt, skenējot (partija | sērijas svītrkods) DisableStockChangeOfSubProduct=Deaktivizējiet krājumu maiņu visiem šī komplekta apakšproduktiem šīs kustības laikā. -ImportFromCSV=Import CSV list of movement -ChooseFileToImport=Upload file then click on the %s icon to select file as source import file... -SelectAStockMovementFileToImport=select a stock movement file to import -InfoTemplateImport=Uploaded file needs to have this format (* are mandatory fields):
    Source Warehouse* | Target Warehouse* | Product* | Quantity* | Lot/serial number
    CSV character separator must be "%s" -LabelOfInventoryMovemement=Inventory %s +ImportFromCSV=Importēt CSV kustību sarakstu +ChooseFileToImport=Augšupielādējiet failu, pēc tam noklikšķiniet uz ikonas %s, lai atlasītu failu kā avota importēšanas failu ... +SelectAStockMovementFileToImport=atlasiet importējamo krājumu kustības failu +InfoTemplateImport=Augšupielādētajam failam ir jābūt šādam formātam (* ir obligāti aizpildāmi lauki):
    Avota noliktava * | Mērķa noliktava * | Produkts * | Daudzums * | Partijas / sērijas numuram
    CSV rakstzīmju atdalītājam jābūt " %s " +LabelOfInventoryMovemement=Inventārs %s ReOpen=Atvērt pa jaunu -ConfirmFinish=Do you confirm the closing of the inventory ? This will generate all stock movements to update your stock to the real qty you entered into the inventory. -ObjectNotFound=%s not found -MakeMovementsAndClose=Generate movements and close -AutofillWithExpected=Fill real quantity with expected quantity -ShowAllBatchByDefault=By default, show batch details on product "stock" tab -CollapseBatchDetailHelp=You can set batch detail default display in stocks module configuration -FieldCannotBeNegative=Field "%s" cannot be negative +ConfirmFinish=Vai jūs apstiprināt inventāra slēgšanu? Tas ģenerēs visas krājumu kustības, lai atjauninātu krājumus līdz reālajam daudzumam, kuru ievadījāt krājumā. +ObjectNotFound=%s nav atrasts +MakeMovementsAndClose=Ģenerējiet kustības un aizveriet +AutofillWithExpected=Aizpildiet reālo daudzumu ar paredzamo daudzumu +ShowAllBatchByDefault=Pēc noklusējuma parādīt partijas informāciju cilnē “Akciju” +CollapseBatchDetailHelp=Krājumu moduļa konfigurācijā varat iestatīt partijas detaļu noklusējuma attēlojumu +FieldCannotBeNegative=Lauks "%s" nevar būt negatīvs diff --git a/htdocs/langs/lv_LV/supplier_proposal.lang b/htdocs/langs/lv_LV/supplier_proposal.lang index a092448a3fc..cffb1a4b837 100644 --- a/htdocs/langs/lv_LV/supplier_proposal.lang +++ b/htdocs/langs/lv_LV/supplier_proposal.lang @@ -13,6 +13,7 @@ SupplierProposalArea=Pārdevēju piedāvājumu apgabals SupplierProposalShort=Pārdevēja piedāvājums SupplierProposals=Pārdevēja priekšlikumi SupplierProposalsShort=Pārdevēja priekšlikumi +AskPrice=Cenas pieprasījums NewAskPrice=Jauns cenas pieprasījums ShowSupplierProposal=Rādīt cenas pieprasījumu AddSupplierProposal=Izveidot cenas pieprasījumu @@ -52,3 +53,6 @@ SupplierProposalsToClose=Pārdevēja priekšlikumi slēgt SupplierProposalsToProcess=Pārdevēja priekšlikumi apstrādāt LastSupplierProposals=Jaunākie %s cenu pieprasījumi AllPriceRequests=Visi pieprasījumi +TypeContact_supplier_proposal_external_SHIPPING=Piegādes gadījumā sazinieties ar pārdevēja kontaktu +TypeContact_supplier_proposal_external_BILLING=Pārdevēja kontaktpersona norēķinu veikšanai +TypeContact_supplier_proposal_external_SERVICE=Pārstāvis turpinot darboties priekšlikums diff --git a/htdocs/langs/lv_LV/ticket.lang b/htdocs/langs/lv_LV/ticket.lang index 9d71f3f79b6..72e4141fcde 100644 --- a/htdocs/langs/lv_LV/ticket.lang +++ b/htdocs/langs/lv_LV/ticket.lang @@ -34,7 +34,8 @@ TicketDictResolution=Biļete - izšķirtspēja TicketTypeShortCOM=Tirdzniecības jautājums TicketTypeShortHELP=Funkcionālās palīdzības pieprasījums -TicketTypeShortISSUE=Izdošana, kļūda vai problēma +TicketTypeShortISSUE=Izdevums vai kļūda +TicketTypeShortPROBLEM=Problēma TicketTypeShortREQUEST=Mainīt vai uzlabot pieprasījumu TicketTypeShortPROJET=Projekts TicketTypeShortOTHER=Cits @@ -54,14 +55,15 @@ TypeContact_ticket_internal_SUPPORTTEC=Piešķirtais lietotājs TypeContact_ticket_external_SUPPORTCLI=Klientu kontaktu / incidentu izsekošana TypeContact_ticket_external_CONTRIBUTOR=Ārējais ieguldītājs -OriginEmail=E-pasta avots +OriginEmail=E-pasta reportieris Notify_TICKET_SENTBYMAIL=Sūtīt biļeti pa e-pastu # Status Read=Lasīt Assigned=Piešķirts InProgress=Procesā -NeedMoreInformation=Gaida informāciju +NeedMoreInformation=Gaida reportiera atsauksmes +NeedMoreInformationShort=Gaida atsauksmes Answered=Atbildēts Waiting=Gaida Closed=Slēgts @@ -70,8 +72,8 @@ Deleted=Dzēsts # Dict Type=Veids Severity=Smagums -TicketGroupIsPublic=Group is public -TicketGroupIsPublicDesc=If a ticket group is public, it will be visible in the form when creating a ticket from the public interface +TicketGroupIsPublic=Grupa ir publiska +TicketGroupIsPublicDesc=Ja biļešu grupa ir publiska, tā būs redzama formā, veidojot biļeti no publiskās saskarnes # Email templates MailToSendTicketMessage=Lai nosūtītu e-pastu no pieteikuma @@ -116,8 +118,8 @@ TicketsShowModuleLogo=Parādiet moduļa logotipi publiskajā saskarnē TicketsShowModuleLogoHelp=Iespējojiet šo opciju, lai slēptu logotipa moduli publiskās saskarnes lapās TicketsShowCompanyLogo=Parādīt uzņēmuma logotipi publiskā saskarnē TicketsShowCompanyLogoHelp=Iespējojiet šo opciju, lai slēptu galvenā uzņēmuma logotipi publiskās saskarnes lapās -TicketsEmailAlsoSendToMainAddress=Also send a notification to the main email address -TicketsEmailAlsoSendToMainAddressHelp=Enable this option to also send an email to the address defined into setup "%s" (see tab "%s") +TicketsEmailAlsoSendToMainAddress=Nosūtiet arī paziņojumu uz galveno e-pasta adresi +TicketsEmailAlsoSendToMainAddressHelp=Iespējojiet šo opciju, lai nosūtītu e-pastu arī uz adresi, kas definēta iestatījumā "%s" (skatiet cilni "%s"). TicketsLimitViewAssignedOnly=Ierobežot displeju līdz pašreizējam lietotājam piešķirtajām biļetēm (nav efektīvs ārējiem lietotājiem, vienmēr ierobežojiet to ar trešo personu, kurai tie ir atkarīgi) TicketsLimitViewAssignedOnlyHelp=Tiks redzamas tikai pašreizējam lietotājam piešķirtās biļetes. Neattiecas uz lietotāju ar biļešu pārvaldīšanas tiesībām. TicketsActivatePublicInterface=Aktivizēt publisko saskarni @@ -128,10 +130,10 @@ TicketNumberingModules=Čeku numerācijas modulis TicketsModelModule=Biļešu dokumentu veidnes TicketNotifyTiersAtCreation=Paziņot trešajai pusei radīšanas laikā TicketsDisableCustomerEmail=Vienmēr atspējojiet e-pasta ziņojumus, ja biļete tiek veidota no publiskās saskarnes -TicketsPublicNotificationNewMessage=Send email(s) when a new message/comment is added to a ticket +TicketsPublicNotificationNewMessage=Sūtīt e-pastu (-us), kad biļetei tiek pievienots jauns ziņojums / komentārs TicketsPublicNotificationNewMessageHelp=Sūtiet e-pastu (s), kad no publiskās saskarnes tiek pievienots jauns ziņojums (piešķirtajam lietotājam vai paziņojumu e-pastu uz (atjaunināt) un / vai paziņojumu e-pastu uz) TicketPublicNotificationNewMessageDefaultEmail=Paziņojumu e-pasts adresātam (atjaunināt) -TicketPublicNotificationNewMessageDefaultEmailHelp=Send an email to this address for each new message notifications if the ticket doesn't have a user assigned to it or if the user doesn't have any known email. +TicketPublicNotificationNewMessageDefaultEmailHelp=Nosūtiet e-pastu uz šo adresi par katru jaunu ziņojumu paziņojumu, ja biļetei nav piešķirts lietotājs vai ja lietotājam nav zināms e-pasts. # # Index & list page # @@ -160,7 +162,7 @@ CreatedBy=Izveidojis NewTicket=Jauns notikums SubjectAnswerToTicket=Pieteikuma atbilde TicketTypeRequest=Pieprasījuma veids -TicketCategory=Grupa +TicketCategory=Biļešu kategorizēšana SeeTicket=Apskatīt pieteikumu TicketMarkedAsRead=Pieteikums ir atzīmēts kā lasīts TicketReadOn=Izlasīts @@ -211,6 +213,7 @@ TicketMessageHelp=Tikai šis teksts tiks saglabāts ziņojumu sarakstā uz biļe TicketMessageSubstitutionReplacedByGenericValues=Mainīšanas mainīgos aizstāj ar vispārējām vērtībām. TimeElapsedSince=Laiks pagājis kopš TicketTimeToRead=Laiks, kas pagājis pirms izlasīšanas +TicketTimeElapsedBeforeSince=Laiks, kas pagājis pirms / kopš TicketContacts=Kontakti biļete TicketDocumentsLinked=Ar biļeti saistītie dokumenti ConfirmReOpenTicket=Vai apstiprināt atkārtotu pieteikuma atvēršanu ? @@ -304,13 +307,13 @@ BoxLastModifiedTicket=Jaunākie labotie pieteikumi BoxLastModifiedTicketDescription=Jaunākās %s lanbotās biļetes BoxLastModifiedTicketContent= BoxLastModifiedTicketNoRecordedTickets=Nav nesen labotu pieteikumu -BoxTicketType=Distribution of open tickets by type -BoxTicketSeverity=Number of open tickets by severity -BoxNoTicketSeverity=No tickets opened -BoxTicketLastXDays=Number of new tickets by days the last %s days -BoxTicketLastXDayswidget = Number of new tickets by days the last X days -BoxNoTicketLastXDays=No new tickets the last %s days -BoxNumberOfTicketByDay=Number of new tickets by day -BoxNewTicketVSClose=Number of today's new tickets versus today's closed tickets -TicketCreatedToday=Ticket created today -TicketClosedToday=Ticket closed today +BoxTicketType=Atvērto biļešu sadalījums pa veidiem +BoxTicketSeverity=Atvērto biļešu skaits pēc smaguma pakāpes +BoxNoTicketSeverity=Netika atvērta neviena biļete +BoxTicketLastXDays=Jauno biļešu skaits pa dienām pēdējās %s dienās +BoxTicketLastXDayswidget = Jauno biļešu skaits pa dienām pēdējās X dienās +BoxNoTicketLastXDays=Pēdējās %s dienās nav jaunu biļešu +BoxNumberOfTicketByDay=Jauno biļešu skaits dienā +BoxNewTicketVSClose=Šodienas jauno biļešu skaits pret šodienas slēgtajām biļetēm +TicketCreatedToday=Biļete izveidota šodien +TicketClosedToday=Biļete šodien ir slēgta diff --git a/htdocs/langs/lv_LV/trips.lang b/htdocs/langs/lv_LV/trips.lang index 39090aec17a..b6825952b39 100644 --- a/htdocs/langs/lv_LV/trips.lang +++ b/htdocs/langs/lv_LV/trips.lang @@ -33,7 +33,7 @@ ExpenseReportCanceledMessage=Izdevumu pārskats %s tika atcelts.
    - Lietotā ExpenseReportPaid=Izdevumu pārskats tika samaksāts ExpenseReportPaidMessage=Izmaksu pārskats %s tika samaksāts.
    - Lietotājs: %s
    - Maksā: %s
    Uzklikšķināt šeit, lai parādītu izdevumu pārskatu: %s TripId=Id expense report -AnyOtherInThisListCanValidate=Person to inform for validation. +AnyOtherInThisListCanValidate=Persona, kas jāinformē par pieprasījuma apstiprināšanu. TripSociete=Uzņēmuma informācija TripNDF=Informācijas izdevumu pārskats PDFStandardExpenseReports=Standard template to generate a PDF document for expense report @@ -106,11 +106,11 @@ ConfirmBrouillonnerTrip=Vai tiešām vēlaties pārvietot šo izdevumu pārskatu SaveTrip=Validate expense report ConfirmSaveTrip=Vai tiešām vēlaties apstiprināt šo izdevumu pārskatu? NoTripsToExportCSV=No expense report to export for this period. -ExpenseReportPayment=Expense report payment +ExpenseReportPayment=Izdevumu pārskata maksājums ExpenseReportsToApprove=Izdevumu ziņojumi jāapstiprina ExpenseReportsToPay=Izdevumu pārskati kas jāsamaksā ConfirmCloneExpenseReport=Vai tiešām vēlaties klonēt šo izdevumu pārskatu? -ExpenseReportsIk=Izdevumu pārskats, kurā ir indekss +ExpenseReportsIk=Nobraukuma maksu konfigurēšana ExpenseReportsRules=Izdevumu pārskatu noteikumi ExpenseReportIkDesc=Varat mainīt kilometru izdevumu aprēķinu pa kategorijām un diapazoniem, kurus tie iepriekš ir definējuši. d ir attālums kilometros ExpenseReportRulesDesc=Jūs varat izveidot vai atjaunināt visus aprēķina noteikumus. Šī daļa tiks izmantota, ja lietotājs izveidos jaunu izdevumu pārskatu @@ -145,7 +145,7 @@ nolimitbyEX_DAY=pēc dienas (bez ierobežojuma) nolimitbyEX_MON=pa mēnešiem (bez ierobežojumiem) nolimitbyEX_YEA=pa gadiem (bez ierobežojumiem) nolimitbyEX_EXP=pēc rindas (bez ierobežojuma) -CarCategory=Automašīnu sadaļa +CarCategory=Transportlīdzekļa kategorija ExpenseRangeOffset=Kompensācijas summa: %s RangeIk=Nobraukums AttachTheNewLineToTheDocument=Pievienojiet rindu augšupielādētajam dokumentam diff --git a/htdocs/langs/lv_LV/users.lang b/htdocs/langs/lv_LV/users.lang index 9a902874c9c..8f0731e79c4 100644 --- a/htdocs/langs/lv_LV/users.lang +++ b/htdocs/langs/lv_LV/users.lang @@ -12,7 +12,7 @@ PasswordChangedTo=Parole mainīts: %s SubjectNewPassword=Jūsu jaunā parole %s GroupRights=Grupas atļaujas UserRights=Lietotāja atļaujas -Credentials=Credentials +Credentials=Akreditācijas dati UserGUISetup=Lietotāja displeja iestatīšana DisableUser=Bloķēt DisableAUser=Bloķēt lietotāju @@ -73,7 +73,7 @@ ExportDataset_user_1=Lietotāji un to īpašības DomainUser=Domēna lietotājs %s Reactivate=Aktivizēt CreateInternalUserDesc=Šī veidlapa ļauj izveidot iekšējo lietotāju savā uzņēmumā/organizācijā. Lai izveidotu ārēju lietotāju (klientu, pārdevēju utt.), Izmantojiet trešās puses kontakta kartītes pogu “Izveidot Dolibarr lietotāju”. -InternalExternalDesc=An internal user is a user that is part of your company/organization, or is a partner user outside of your organization that may need to see more data than data related to his company (the permission system will define what he can or can't see or do).
    An external user is a customer, vendor or other that must view ONLY data related to himself (Creating an external user for a third-party can be done from the contact record of the third-party).

    In both cases, you must grant permissions on the features that the user need. +InternalExternalDesc=Iekšējais lietotājs ir lietotājs, kas ir jūsu uzņēmuma / organizācijas daļa vai ir partnera lietotājs ārpus jūsu organizācijas un kuram, iespējams, būs jāredz vairāk datu nekā ar viņa uzņēmumu saistīto datu (atļauju sistēma noteiks, ko viņš var vai var neredzu un neredzu).
    Ārējs lietotājs ir klients, pārdevējs vai cits lietotājs, kuram ir jāskata TIKAI ar sevi saistītie dati (Ārēja lietotāja izveidošanu trešajai pusei var veikt no trešās puses kontaktu ieraksta).

    Abos gadījumos jums jāpiešķir atļaujas lietotājam nepieciešamajām funkcijām. PermissionInheritedFromAGroup=Atļauja piešķirta, jo mantojis no viena lietotāja grupai. Inherited=Iedzimta UserWillBe=Izveidotais lietotājs būs @@ -106,7 +106,7 @@ UseTypeFieldToChange=Izmantojiet lauka veids, lai mainītu OpenIDURL=OpenID URL LoginUsingOpenID=Izmantojiet OpenID, lai pieteiktos WeeklyHours=Nostrādātais laiks (nedēļā) -ExpectedWorkedHours=Expected hours worked per week +ExpectedWorkedHours=Paredzamās nostrādātās stundas nedēļā ColorUser=Lietotāja krāsa DisabledInMonoUserMode=Atspējots uzturēšanas režīmā UserAccountancyCode=Lietotāja grāmatvedības kods @@ -116,7 +116,7 @@ DateOfEmployment=Nodarbināšanas datums DateEmployment=Nodarbinātība DateEmploymentstart=Nodarbinātības sākuma datums DateEmploymentEnd=Nodarbinātības beigu datums -RangeOfLoginValidity=Access validity date range +RangeOfLoginValidity=Piekļuves derīguma datumu diapazons CantDisableYourself=Jūs nevarat atspējot savu lietotāja ierakstu ForceUserExpenseValidator=Spēka izdevumu pārskata apstiprinātājs ForceUserHolidayValidator=Piespiedu atvaļinājuma pieprasījuma validētājs diff --git a/htdocs/langs/lv_LV/website.lang b/htdocs/langs/lv_LV/website.lang index 6fe5bbf285a..e70ddb84bac 100644 --- a/htdocs/langs/lv_LV/website.lang +++ b/htdocs/langs/lv_LV/website.lang @@ -51,7 +51,7 @@ ReadPerm=Lasīt WritePerm=Rakstīt TestDeployOnWeb=Pārbaudiet / izvietojiet tīmeklī PreviewSiteServedByWebServer=Preview %s in a new tab.

    The %s will be served by an external web server (like Apache, Nginx, IIS). You must install and setup this server before to point to directory:
    %s
    URL served by external server:
    %s -PreviewSiteServedByDolibarr=Preview %s in a new tab.

    The %s will be served by Dolibarr server so it does not need any extra web server (like Apache, Nginx, IIS) to be installed.
    The inconvenient is that the URLs of pages are not user friendly and start with the path of your Dolibarr.
    URL served by Dolibarr:
    %s

    To use your own external web server to serve this web site, create a virtual host on your web server that points on directory
    %s
    then enter the name of this virtual server in the properties of this website and click on the link "Test/Deploy on the web". +PreviewSiteServedByDolibarr= Priekšskatīt %s jaunā cilnē.

    %s apkalpos Dolibarr serveris, tāpēc tam nav nepieciešams instalēt papildu tīmekļa serveri (piemēram, Apache, Nginx, IIS).
    Neērti ir tas, ka lapu vietrāži URL nav lietotājam draudzīgi un sākas ar jūsu Dolibarr ceļu.
    URL apkalpo Dolibarr:
    %s

    Lai izmantotu savu ārējo web serveri, lai kalpotu šo tīmekļa vietni, izveidot virtuālo uzņēmējas jūsu tīmekļa serverī, kas norāda uz direktoriju
    %s
    tad ievadiet nosaukumu šī virtuālā servera šīs vietnes rekvizītos un noklikšķiniet uz saites "Pārbaudīt / izvietot tīmeklī". VirtualHostUrlNotDefined=Virtuālā resursdatora adrese, kuru apkalpo ārējs tīmekļa serveris, nav definēts NoPageYet=Vēl nav nevienas lapas YouCanCreatePageOrImportTemplate=Jūs varat izveidot jaunu lapu vai importēt pilnu vietnes veidni @@ -137,11 +137,11 @@ PagesRegenerated=reģenerēta %s lapa (s) / konteiners (-i) RegenerateWebsiteContent=Atjaunojiet tīmekļa vietnes kešatmiņas failus AllowedInFrames=Atļauts rāmjos DefineListOfAltLanguagesInWebsiteProperties=Vietņu rekvizītos definējiet visu pieejamo valodu sarakstu. -GenerateSitemaps=Generate website sitemap file -ConfirmGenerateSitemaps=If you confirm, you will erase the existing sitemap file... -ConfirmSitemapsCreation=Confirm sitemap generation -SitemapGenerated=Sitemap file %s generated +GenerateSitemaps=Ģenerēt vietnes vietnes kartes failu +ConfirmGenerateSitemaps=Ja apstiprināsit, jūs izdzēsīsit esošo vietnes kartes failu ... +ConfirmSitemapsCreation=Apstipriniet vietnes kartes ģenerēšanu +SitemapGenerated=Vietnes kartes fails %s ģenerēts ImportFavicon=Favicon -ErrorFaviconType=Favicon must be png -ErrorFaviconSize=Favicon must be sized 16x16, 32x32 or 64x64 -FaviconTooltip=Upload an image which needs to be a png (16x16, 32x32 or 64x64) +ErrorFaviconType=Favicon jābūt png +ErrorFaviconSize=Favicon izmēram jābūt 16x16, 32x32 vai 64x64 +FaviconTooltip=Augšupielādējiet attēlu, kuram jābūt png (16x16, 32x32 vai 64x64) diff --git a/htdocs/langs/lv_LV/withdrawals.lang b/htdocs/langs/lv_LV/withdrawals.lang index f547e315cce..1e31473dc70 100644 --- a/htdocs/langs/lv_LV/withdrawals.lang +++ b/htdocs/langs/lv_LV/withdrawals.lang @@ -42,9 +42,10 @@ LastWithdrawalReceipt=Jaunākie %s tiešā debeta ieņēmumi MakeWithdrawRequest=Izveidojiet tiešā debeta maksājumu pieprasījumu MakeBankTransferOrder=Veiciet kredīta pārveduma pieprasījumu WithdrawRequestsDone=%s reģistrēti tiešā debeta maksājumu pieprasījumi -BankTransferRequestsDone=%s credit transfer requests recorded +BankTransferRequestsDone=%s reģistrēti kredīta pārveduma pieprasījumi ThirdPartyBankCode=Trešās puses bankas kods NoInvoiceCouldBeWithdrawed=Netika veiksmīgi norakstīts rēķins. Pārbaudiet, vai rēķini ir norādīti uzĦēmumiem ar derīgu IBAN un IBAN ir UMR (unikālas pilnvaras atsauce) ar režīmu %s . +WithdrawalCantBeCreditedTwice=Šī izņemšanas kvīts jau ir atzīmēta kā ieskaitīta; to nevar izdarīt divreiz, jo tas potenciāli radītu maksājumu un bankas ierakstu dublikātus. ClassCredited=Klasificēt kreditēts ClassCreditedConfirm=Vai tiešām vēlaties klasificēt šo atsaukuma kvīti kā kredītu jūsu bankas kontā? TransData=Darījuma datums @@ -132,8 +133,8 @@ SEPARCUR=SEPA CUR SEPAFRST=SEPA vispirms ExecutionDate=Izpildes datums CreateForSepa=Izveidojiet tiešā debeta failu -ICS=Creditor Identifier CI for direct debit -ICSTransfer=Creditor Identifier CI for bank transfer +ICS=Kreditora identifikators CI tiešajam debetam +ICSTransfer=Kreditora identifikators CI bankas pārskaitījumam END_TO_END="EndToEndId" SEPA XML tag - katram darījumam piešķirts unikāls ID USTRD="Nestrukturēts" SEPA XML tag ADDDAYS=Pievienojiet dienas izpildes datumam @@ -148,5 +149,5 @@ InfoRejectSubject=Tiešais debeta maksājuma uzdevums ir noraidīts InfoRejectMessage=Labdien,

    banka noraidījusi rēķina %s tiešā debeta maksājuma uzdevumu saistībā ar uzņēmumu %s ar summu %s.

    -
    %s ModeWarning=Iespēja reālā režīmā nav noteikts, mēs pārtraucam pēc šīs simulācijas ErrorCompanyHasDuplicateDefaultBAN=Uzņēmumam ar ID %s ir vairāk nekā viens noklusējuma bankas konts. Nevar uzzināt, kuru izmantot. -ErrorICSmissing=Missing ICS in Bank account %s -TotalAmountOfdirectDebitOrderDiffersFromSumOfLines=Total amount of direct debit order differs from sum of lines +ErrorICSmissing=Bankas kontā %s trūkst ICS +TotalAmountOfdirectDebitOrderDiffersFromSumOfLines=Tiešā debeta rīkojuma kopējā summa atšķiras no rindu summas diff --git a/htdocs/langs/lv_LV/zapier.lang b/htdocs/langs/lv_LV/zapier.lang index c524a9afb6f..48a4287c4ee 100644 --- a/htdocs/langs/lv_LV/zapier.lang +++ b/htdocs/langs/lv_LV/zapier.lang @@ -17,5 +17,5 @@ ModuleZapierForDolibarrName = Zapier priekš Dolibarr ModuleZapierForDolibarrDesc = Par zapier Dolibarr moduli ZapierForDolibarrSetup=Zapier iestatīšana Dolibarr ZapierDescription=Saskarne ar Zapier -ZapierAbout=About the module Zapier -ZapierSetupPage=There is no need for a setup on Dolibarr side to use Zapier. However, you must generate and publish a package on zapier to be able to use Zapier with Dolibarr. See documentation on this wiki page. +ZapierAbout=Par moduli Zapier +ZapierSetupPage=Lai izmantotu Zapier, Dolibarr pusē nav nepieciešama iestatīšana. Tomēr, lai varētu izmantot Zapier ar Dolibarr, jums ir jāizveido un jāpublicē pakete zapier. Skatiet šīs wiki lapas dokumentāciju . diff --git a/htdocs/langs/mk_MK/deliveries.lang b/htdocs/langs/mk_MK/deliveries.lang index 1f48c01de75..cd8a36e6c70 100644 --- a/htdocs/langs/mk_MK/deliveries.lang +++ b/htdocs/langs/mk_MK/deliveries.lang @@ -27,5 +27,7 @@ Recipient=Recipient ErrorStockIsNotEnough=There's not enough stock Shippable=Shippable NonShippable=Not Shippable +ShowShippableStatus=Show shippable status ShowReceiving=Show delivery receipt NonExistentOrder=Nonexistent order +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/mk_MK/exports.lang b/htdocs/langs/mk_MK/exports.lang index a0eb7161ef2..cb652229825 100644 --- a/htdocs/langs/mk_MK/exports.lang +++ b/htdocs/langs/mk_MK/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Type of line (0=product, 1=service) FileWithDataToImport=File with data to import FileToImport=Source file to import FileMustHaveOneOfFollowingFormat=File to import must have one of following formats -DownloadEmptyExample=Download template file with field content information (* are mandatory fields) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Choose the file format to use as import file format by clicking on the %s icon to select it... ChooseFileToImport=Upload file then click on the %s icon to select file as source import file... SourceFileFormat=Source file format diff --git a/htdocs/langs/mn_MN/deliveries.lang b/htdocs/langs/mn_MN/deliveries.lang index 1f48c01de75..cd8a36e6c70 100644 --- a/htdocs/langs/mn_MN/deliveries.lang +++ b/htdocs/langs/mn_MN/deliveries.lang @@ -27,5 +27,7 @@ Recipient=Recipient ErrorStockIsNotEnough=There's not enough stock Shippable=Shippable NonShippable=Not Shippable +ShowShippableStatus=Show shippable status ShowReceiving=Show delivery receipt NonExistentOrder=Nonexistent order +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/mn_MN/exports.lang b/htdocs/langs/mn_MN/exports.lang index a0eb7161ef2..cb652229825 100644 --- a/htdocs/langs/mn_MN/exports.lang +++ b/htdocs/langs/mn_MN/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Type of line (0=product, 1=service) FileWithDataToImport=File with data to import FileToImport=Source file to import FileMustHaveOneOfFollowingFormat=File to import must have one of following formats -DownloadEmptyExample=Download template file with field content information (* are mandatory fields) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Choose the file format to use as import file format by clicking on the %s icon to select it... ChooseFileToImport=Upload file then click on the %s icon to select file as source import file... SourceFileFormat=Source file format diff --git a/htdocs/langs/nb_NO/deliveries.lang b/htdocs/langs/nb_NO/deliveries.lang index 97f8ad9cdac..31485f7bafa 100644 --- a/htdocs/langs/nb_NO/deliveries.lang +++ b/htdocs/langs/nb_NO/deliveries.lang @@ -30,3 +30,4 @@ NonShippable=Kan ikke sendes ShowShippableStatus=Vis status sendingsklar ShowReceiving=Vis leveringskvittering NonExistentOrder=Ikkeeksisterende ordre +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/nb_NO/exports.lang b/htdocs/langs/nb_NO/exports.lang index e4e5740d9ee..666dc723afa 100644 --- a/htdocs/langs/nb_NO/exports.lang +++ b/htdocs/langs/nb_NO/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Linjetype (0=vare, 1=tjeneste) FileWithDataToImport=Fil med data som skal importeres FileToImport=Kildefilen du vil importere FileMustHaveOneOfFollowingFormat=Fil som skal importeres må ha ett av følgende formater -DownloadEmptyExample=Last ned malfil med feltinnholdsinformasjon (* er obligatoriske felt) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Velg filformatet som skal brukes som importfilformat ved å klikke på %s-ikonet for å velge det ... ChooseFileToImport=Last opp fil og klikk deretter på %s ikonet for å velge fil som kilde-importfil ... SourceFileFormat=Kildefil-format diff --git a/htdocs/langs/ne_NP/deliveries.lang b/htdocs/langs/ne_NP/deliveries.lang index 1f48c01de75..cd8a36e6c70 100644 --- a/htdocs/langs/ne_NP/deliveries.lang +++ b/htdocs/langs/ne_NP/deliveries.lang @@ -27,5 +27,7 @@ Recipient=Recipient ErrorStockIsNotEnough=There's not enough stock Shippable=Shippable NonShippable=Not Shippable +ShowShippableStatus=Show shippable status ShowReceiving=Show delivery receipt NonExistentOrder=Nonexistent order +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/ne_NP/exports.lang b/htdocs/langs/ne_NP/exports.lang index a0eb7161ef2..cb652229825 100644 --- a/htdocs/langs/ne_NP/exports.lang +++ b/htdocs/langs/ne_NP/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Type of line (0=product, 1=service) FileWithDataToImport=File with data to import FileToImport=Source file to import FileMustHaveOneOfFollowingFormat=File to import must have one of following formats -DownloadEmptyExample=Download template file with field content information (* are mandatory fields) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Choose the file format to use as import file format by clicking on the %s icon to select it... ChooseFileToImport=Upload file then click on the %s icon to select file as source import file... SourceFileFormat=Source file format diff --git a/htdocs/langs/nl_BE/admin.lang b/htdocs/langs/nl_BE/admin.lang index d13852849fd..3755e870c31 100644 --- a/htdocs/langs/nl_BE/admin.lang +++ b/htdocs/langs/nl_BE/admin.lang @@ -234,6 +234,7 @@ YouMustEnableOneModule=Je moet minstens 1 module aktiveren BillsPDFModules=Factuur documentsjablonen LDAPGlobalParameters=Globale instellingen LDAPPassword=Beheerderswachtwoord +ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or a software interface installed on the same computer as the browser, and called when you click on a link in your browser that starts with "tel:". If you need a full server solution (no need of local software installation), you must set this to "No" and fill next field. SalariesSetup=Setup van module salarissen MailToSendProposal=Klant voorstellen MailToSendInvoice=Klantfacturen diff --git a/htdocs/langs/nl_BE/ticket.lang b/htdocs/langs/nl_BE/ticket.lang index f1e3f473db3..25cd0e0dc63 100644 --- a/htdocs/langs/nl_BE/ticket.lang +++ b/htdocs/langs/nl_BE/ticket.lang @@ -5,7 +5,6 @@ Permission56003=Tickets verwijderen Permission56005=Bekijk tickets van alle externe partijen (niet effectief voor externe gebruikers, altijd beperkt tot de derde partij waarvan ze afhankelijk zijn) TicketDictCategory=Ticket - Groepen TicketDictSeverity=Ticket - Gradaties -TicketTypeShortISSUE=Probleem, bug of probleem TicketTypeShortREQUEST=Verander- of verbeteringsverzoek TicketTypeShortOTHER=Ander ErrorBadEmailAddress=Veld '%s' onjuist diff --git a/htdocs/langs/nl_BE/website.lang b/htdocs/langs/nl_BE/website.lang index e8f0a2d4af0..96584adea66 100644 --- a/htdocs/langs/nl_BE/website.lang +++ b/htdocs/langs/nl_BE/website.lang @@ -3,6 +3,7 @@ DeleteWebsite=Verwijder website WEBSITE_CSS_URL=URL van extern CSS bestand MediaFiles=Mediabibliotheek EditMenu=Bewerk menu +PreviewOfSiteNotYetAvailable=Preview of your website %s not yet available. You must first 'Import a full website template' or just 'Add a page/container'. ViewSiteInNewTab=Bekijk de site in een nieuwe tab ViewPageInNewTab=Bekijk de pagina in een nieuwe tab SetAsHomePage=Zet als Homepagina diff --git a/htdocs/langs/nl_NL/deliveries.lang b/htdocs/langs/nl_NL/deliveries.lang index 329c2b74ad0..99c87f7f7af 100644 --- a/htdocs/langs/nl_NL/deliveries.lang +++ b/htdocs/langs/nl_NL/deliveries.lang @@ -30,3 +30,4 @@ NonShippable=Niet verzendbaar ShowShippableStatus=Toon verzendstatus ShowReceiving=Toon afleverbon NonExistentOrder=Niet bestaande order +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/nl_NL/exports.lang b/htdocs/langs/nl_NL/exports.lang index 5ea7b305541..65e9a9ed814 100644 --- a/htdocs/langs/nl_NL/exports.lang +++ b/htdocs/langs/nl_NL/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Type van de regel (0=product, 1=dienst) FileWithDataToImport=Bestand met te importeren gegevens FileToImport=Te importeren bronbestand FileMustHaveOneOfFollowingFormat=Het te importeren bestand moet een van de volgende indelingen hebben -DownloadEmptyExample=Sjabloonbestand downloaden met veldinhoudsinformatie (* zijn verplichte velden) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Kies de bestandsindeling die u als importbestandsindeling wilt gebruiken door op het pictogram %s te klikken om deze te selecteren ... ChooseFileToImport=Upload het bestand en klik vervolgens op het pictogram %s om het bestand te selecteren als bronimportbestand ... SourceFileFormat=Bestandsformaat van het bronbestand diff --git a/htdocs/langs/pl_PL/deliveries.lang b/htdocs/langs/pl_PL/deliveries.lang index 336a696e731..8d0ea676b8d 100644 --- a/htdocs/langs/pl_PL/deliveries.lang +++ b/htdocs/langs/pl_PL/deliveries.lang @@ -2,7 +2,7 @@ Delivery=Dostawa DeliveryRef=Numer referencyjny dostawy DeliveryCard=Karta przyjęcia -DeliveryOrder=Delivery receipt +DeliveryOrder=Kwit dostawy DeliveryDate=Data dostawy CreateDeliveryOrder=Generuj przyjęcie dostawy DeliveryStateSaved=Stan dostawy zapisany @@ -18,14 +18,16 @@ StatusDeliveryCanceled=Anulowano StatusDeliveryDraft=Projekt StatusDeliveryValidated=Przyjęto # merou PDF model -NameAndSignature=Name and Signature: +NameAndSignature=Imię i nazwisko oraz podpis: ToAndDate=To___________________________________ na ____ / _____ / __________ GoodStatusDeclaration=Otrzymano towary w dobrym stanie, -Deliverer=Deliverer: +Deliverer=Dostawca: Sender=Nadawca Recipient=Odbiorca ErrorStockIsNotEnough=Brak wystarczającego zapasu w magazynie Shippable=Możliwa wysyłka NonShippable=Nie do wysyłki +ShowShippableStatus=Pokaż status do wysyłki ShowReceiving=Pokaż przyjęte dostawy -NonExistentOrder=Nonexistent order +NonExistentOrder=Nieistniejący porządek +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/pl_PL/exports.lang b/htdocs/langs/pl_PL/exports.lang index 4a291b908d4..d30ec56438b 100644 --- a/htdocs/langs/pl_PL/exports.lang +++ b/htdocs/langs/pl_PL/exports.lang @@ -1,61 +1,62 @@ # Dolibarr language file - Source file is en_US - exports ExportsArea=Eksporty ImportArea=Import -NewExport=New Export -NewImport=New Import +NewExport=Nowy eksport +NewImport=Nowy import ExportableDatas=Eksportowalny zbiór danych ImportableDatas=Importowalny zbiór danych SelectExportDataSet=Wybierz zbiór danych, który chcesz wyeksportować... SelectImportDataSet=Wybierz zbiór danych, który chcesz zaimportować... -SelectExportFields=Choose the fields you want to export, or select a predefined export profile -SelectImportFields=Choose the source file fields you want to import and their target field in database by moving them up and down with anchor %s, or select a predefined import profile: +SelectExportFields=Wybierz pola, które chcesz wyeksportować, lub wybierz predefiniowany profil eksportu +SelectImportFields=Wybierz pola pliku źródłowego, które chcesz zaimportować, i ich pole docelowe w bazie danych, przesuwając je w górę iw dół za pomocą kotwicy %s lub wybierz wstępnie zdefiniowany profil importu: NotImportedFields=Obszary plik przywożonych źródła nie -SaveExportModel=Save your selections as an export profile/template (for reuse). -SaveImportModel=Save this import profile (for reuse) ... +SaveExportModel=Zapisz swoje wybory jako profil / szablon eksportu (do ponownego wykorzystania). +SaveImportModel=Zapisz ten profil importu (do ponownego wykorzystania) ... ExportModelName=Nazwa profilu eksportowego -ExportModelSaved=Export profile saved as %s. +ExportModelSaved=Profil eksportu zapisany jako %s . ExportableFields=Wywóz pola ExportedFields=Eksportowane pola ImportModelName=Importuj nazwę profilu -ImportModelSaved=Import profile saved as %s. +ImportModelSaved=Importuj profil zapisany jako %s . DatasetToExport=Zbiór danych do eksportu DatasetToImport=Dataset importować ChooseFieldsOrdersAndTitle=Wybierz kolejność pól... FieldsTitle=Obszary tytuł FieldTitle=pole tytuł -NowClickToGenerateToBuildExportFile=Now, select the file format in the combo box and click on "Generate" to build the export file... -AvailableFormats=Available Formats +NowClickToGenerateToBuildExportFile=Teraz wybierz format pliku w polu kombi i kliknij „Generuj”, aby zbudować plik eksportu ... +AvailableFormats=Dostępne formaty LibraryShort=Biblioteka -ExportCsvSeparator=Csv caracter separator -ImportCsvSeparator=Csv caracter separator +ExportCsvSeparator=Separator znaków CSV +ImportCsvSeparator=Separator znaków CSV Step=Krok -FormatedImport=Import Assistant -FormatedImportDesc1=This module allows you to update existing data or add new objects into the database from a file without technical knowledge, using an assistant. -FormatedImportDesc2=First step is to choose the kind of data you want to import, then the format of the source file, then the fields you want to import. -FormatedExport=Export Assistant -FormatedExportDesc1=These tools allow the export of personalized data using an assistant, to help you in the process without requiring technical knowledge. -FormatedExportDesc2=First step is to choose a predefined dataset, then which fields you want to export, and in which order. -FormatedExportDesc3=When data to export are selected, you can choose the format of the output file. +FormatedImport=Asystent importu +FormatedImportDesc1=Moduł ten umożliwia aktualizację istniejących danych lub dodawanie nowych obiektów do bazy danych z pliku bez wiedzy technicznej, przy pomocy asystenta. +FormatedImportDesc2=Pierwszym krokiem jest wybór rodzaju danych, które chcesz zaimportować, następnie format pliku źródłowego, a następnie pola, które chcesz zaimportować. +FormatedExport=Asystent Eksportu +FormatedExportDesc1=Narzędzia te pozwalają na eksport spersonalizowanych danych za pomocą asystenta, aby pomóc Ci w procesie bez konieczności posiadania wiedzy technicznej. +FormatedExportDesc2=Pierwszym krokiem jest wybranie predefiniowanego zbioru danych, a następnie pól, które chcesz wyeksportować, oraz w jakiej kolejności. +FormatedExportDesc3=Po wybraniu danych do wyeksportowania można wybrać format pliku wyjściowego. Sheet=Arkusz NoImportableData=Nr przywozowe danych (bez modułu z definicji pozwalają na import danych) FileSuccessfullyBuilt=Wygenerowano plik -SQLUsedForExport=SQL Request used to extract data +SQLUsedForExport=Żądanie SQL używane do wyodrębniania danych LineId=Identyfikator linii LineLabel=Etykieta linii LineDescription=Opis pozycji LineUnitPrice=Cena jednostkowa pozycji LineVATRate=Stawka VAT pozycji LineQty=Ilość dla pozycji -LineTotalHT=Amount excl. tax for line +LineTotalHT=Kwota bez podatek za linię LineTotalTTC=Kwota z podatkiem dla pozycji LineTotalVAT=Kwota podatku VAT dla pozycji TypeOfLineServiceOrProduct=Rodzaj pozycji (0=produkt, 1=usługa) FileWithDataToImport=Plik z danymi do importu FileToImport=Plik źródłowy do zaimportowania -FileMustHaveOneOfFollowingFormat=File to import must have one of following formats -DownloadEmptyExample=Download template file with field content information (* are mandatory fields) -ChooseFormatOfFileToImport=Choose the file format to use as import file format by clicking on the %s icon to select it... -ChooseFileToImport=Upload file then click on the %s icon to select file as source import file... +FileMustHaveOneOfFollowingFormat=Plik do zaimportowania musi mieć jeden z następujących formatów +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields +ChooseFormatOfFileToImport=Wybierz format pliku, który ma być używany jako format pliku importu, klikając ikonę %s, aby go wybrać ... +ChooseFileToImport=Prześlij plik, a następnie kliknij ikonę %s, aby wybrać plik jako źródłowy plik importu ... SourceFileFormat=Format pliku źródłowego FieldsInSourceFile=Pola w pliku źródłowym FieldsInTargetDatabase=Pola docelowe w bazie danych Dolibarr (wytłuszczenie = obowiązkowe) @@ -70,57 +71,57 @@ FieldsTarget=Pola docelowe FieldTarget=Pole docelowe FieldSource=Pole źródłowe NbOfSourceLines=Liczba linii w pliku źródłowym -NowClickToTestTheImport=Check that the file format (field and string delimiters) of your file matches the options shown and that you have omitted the header line, or these will be flagged as errors in the following simulation.
    Click on the "%s" button to run a check of the file structure/contents and simulate the import process.
    No data will be changed in your database. -RunSimulateImportFile=Run Import Simulation +NowClickToTestTheImport=Sprawdź, czy format pliku (ograniczniki pól i ciągów znaków) w Twoim pliku jest zgodny z przedstawionymi opcjami i czy pominięto wiersz nagłówka, w przeciwnym razie zostaną one oflagowane jako błędy w następnej symulacji.
    Kliknij przycisk „ %s ”, aby sprawdzić strukturę / zawartość pliku i zasymulować proces importu.
    Żadne dane w Twojej bazie danych nie zostaną zmienione . +RunSimulateImportFile=Uruchom symulację importu FieldNeedSource=To pole wymaga danych z pliku źródłowego SomeMandatoryFieldHaveNoSource=Niektóre z pól obowiązkowych nie ma źródła danych z pliku InformationOnSourceFile=Informacje o pliku źródłowego InformationOnTargetTables=Informacji na temat docelowego pola SelectAtLeastOneField=Switch co najmniej jednego źródła pola w kolumnie pól do wywozu SelectFormat=Wybierz ten format pliku importu -RunImportFile=Import Data -NowClickToRunTheImport=Check the results of the import simulation. Correct any errors and re-test.
    When the simulation reports no errors you may proceed to import the data into the database. -DataLoadedWithId=The imported data will have an additional field in each database table with this import id: %s, to allow it to be searchable in the case of investigating a problem related to this import. -ErrorMissingMandatoryValue=Mandatory data is empty in the source file for field %s. -TooMuchErrors=There are still %s other source lines with errors but output has been limited. -TooMuchWarnings=There are still %s other source lines with warnings but output has been limited. +RunImportFile=Zaimportować dane +NowClickToRunTheImport=Sprawdź wyniki symulacji importu. Popraw wszystkie błędy i przeprowadź ponownie test.
    Gdy symulacja nie wykaże żadnych błędów, możesz przystąpić do importu danych do bazy danych. +DataLoadedWithId=Zaimportowane dane będą miały dodatkowe pole w każdej tabeli bazy danych o tym identyfikatorze importu: %s , aby umożliwić ich przeszukiwanie w przypadku badania problemu związanego z tym importem. +ErrorMissingMandatoryValue=Obowiązkowe dane są puste w pliku źródłowym dla pola %s . +TooMuchErrors=Nadal istnieją %s innych wierszy źródłowych z błędami, ale dane wyjściowe są ograniczone. +TooMuchWarnings=Nadal istnieją %s inne wiersze źródłowe z ostrzeżeniami, ale dane wyjściowe są ograniczone. EmptyLine=Pusty wiersz (zostanie odrzucona) -CorrectErrorBeforeRunningImport=You must correct all errors before running the definitive import. +CorrectErrorBeforeRunningImport=Musisz poprawić wszystkie błędy przed uruchomieniem ostatecznego importu. FileWasImported=Plik został przywieziony z %s numerycznych. -YouCanUseImportIdToFindRecord=You can find all the imported records in your database by filtering on field import_key='%s'. +YouCanUseImportIdToFindRecord=Możesz znaleźć wszystkie zaimportowane rekordy w swojej bazie danych, filtrując według pola import_key = '%s' . NbOfLinesOK=Liczba linii bez błędów i żadnych ostrzeżeń: %s. NbOfLinesImported=Liczba linii zaimportowany: %s. DataComeFromNoWhere=Wartości, aby dodać pochodzi z nigdzie w pliku źródłowym. DataComeFromFileFieldNb=Wartość do dodania pochodzi z pola numer %s w pliku źródłowym. -DataComeFromIdFoundFromRef=Value that comes from field number %s of source file will be used to find the id of the parent object to use (so the object %s that has the ref. from source file must exist in the database). -DataComeFromIdFoundFromCodeId=Code that comes from field number %s of source file will be used to find the id of the parent object to use (so the code from source file must exist in the dictionary %s). Note that if you know the id, you can also use it in the source file instead of the code. Import should work in both cases. +DataComeFromIdFoundFromRef=Wartość pochodząca z pola o numerze %s pliku źródłowego zostanie użyta do znalezienia identyfikatora obiektu nadrzędnego do użycia (więc obiekt %s a09a4b739f17f8 musi istnieć w pliku źródłowym. +DataComeFromIdFoundFromCodeId=Kod pochodzący z pola o numerze %s pliku źródłowego zostanie użyty do znalezienia identyfikatora obiektu nadrzędnego do użycia (więc kod z pliku źródłowego musi istnieć w słowniku %s39f17f). Zauważ, że jeśli znasz identyfikator, możesz go również użyć w pliku źródłowym zamiast w kodzie. Import powinien działać w obu przypadkach. DataIsInsertedInto=Dane pochodzące z pliku źródłowego zostaną wstawione w następujące pola: -DataIDSourceIsInsertedInto=The id of parent object was found using the data in the source file, will be inserted into the following field: +DataIDSourceIsInsertedInto=Identyfikator obiektu nadrzędnego został znaleziony przy użyciu danych w pliku źródłowym, zostanie wstawiony w następujące pole: DataCodeIDSourceIsInsertedInto=Id linii macierzystej znaleźć z kodem, zostaną włączone do następnego pola: SourceRequired=Wartość danych jest obowiązkowe SourceExample=Przykład możliwych wartości danych ExampleAnyRefFoundIntoElement=Wszelkie ref dla %s elementów ExampleAnyCodeOrIdFoundIntoDictionary=Każdy kod (lub identyfikator) znajduje się w słowniku% s -CSVFormatDesc=Comma Separated Value file format (.csv).
    This is a text file format where fields are separated by a separator [ %s ]. If separator is found inside a field content, field is rounded by round character [ %s ]. Escape character to escape round character is [ %s ]. -Excel95FormatDesc=Excel file format (.xls)
    This is the native Excel 95 format (BIFF5). -Excel2007FormatDesc=Excel file format (.xlsx)
    This is the native Excel 2007 format (SpreadsheetML). +CSVFormatDesc= Wartość oddzielona przecinkami Format pliku (.csv).
    Jest to format pliku tekstowego, w którym pola są oddzielone separatorem [%s]. Jeśli separator znajduje się w treści pola, pole jest zaokrąglane okrągłym znakiem [%s]. Znak ucieczki do rundy ucieczki to [%s]. +Excel95FormatDesc= Format pliku programu Excel (.xls)
    Jest to natywny format programu Excel 95 (BIFF5). +Excel2007FormatDesc= Format pliku programu Excel (.xlsx)
    Jest to natywny format programu Excel 2007 (SpreadsheetML). TsvFormatDesc=Tab separacji format Wartość (.tsv)
    Jest to format pliku tekstowego, gdzie pola są oddzielone tabulator [TAB]. -ExportFieldAutomaticallyAdded=Field %s was automatically added. It will avoid you to have similar lines to be treated as duplicate record (with this field added, all lines will own their own id and will differ). -CsvOptions=CSV format options -Separator=Field Separator -Enclosure=String Delimiter +ExportFieldAutomaticallyAdded=Pole %s zostało dodane automatycznie. Pozwoli to uniknąć sytuacji, w których podobne wiersze będą traktowane jako zduplikowany rekord (po dodaniu tego pola wszystkie wiersze będą miały własny identyfikator i będą się różnić). +CsvOptions=Opcje formatu CSV +Separator=Separator pól +Enclosure=Separator ciągów SpecialCode=Specjalny kod ExportStringFilter=%% Umożliwia zastąpienie jednego lub więcej znaków w tekście -ExportDateFilter=YYYY, YYYYMM, YYYYMMDD: filters by one year/month/day
    YYYY+YYYY, YYYYMM+YYYYMM, YYYYMMDD+YYYYMMDD: filters over a range of years/months/days
    > YYYY, > YYYYMM, > YYYYMMDD: filters on all following years/months/days
    < YYYY, < YYYYMM, < YYYYMMDD: filters on all previous years/months/days -ExportNumericFilter=NNNNN filters by one value
    NNNNN+NNNNN filters over a range of values
    < NNNNN filters by lower values
    > NNNNN filters by higher values +ExportDateFilter=RRRR, RRRRMM, RRRRMMDD: filtry według jednego roku / miesiąca / dnia
    RRRR + RRRR, RRRRMM + RRRRMM, RRRRMMDD + RRRRMMDD: filtry w zakresie lat / miesięcy / dni / dni: RRRR / m / dni kolejne lata / miesiące / dni
    NNNNN + NNNNN filtruje w zakresie wartości

    > NNNNN filtruje według wyższych wartości ImportFromLine=Import rozpocznij od linii numer EndAtLineNb=Zakończ na linii numer -ImportFromToLine=Limit range (From - To). Eg. to omit header line(s). -SetThisValueTo2ToExcludeFirstLine=For example, set this value to 3 to exclude the 2 first lines.
    If the header lines are NOT omitted, this will result in multiple errors in the Import Simulation. -KeepEmptyToGoToEndOfFile=Keep this field empty to process all lines to the end of the file. -SelectPrimaryColumnsForUpdateAttempt=Select column(s) to use as primary key for an UPDATE import -UpdateNotYetSupportedForThisImport=Update is not supported for this type of import (only insert) -NoUpdateAttempt=No update attempt was performed, only insert +ImportFromToLine=Zakres graniczny (od - do). Na przykład. pominąć linię (y) nagłówka. +SetThisValueTo2ToExcludeFirstLine=Na przykład ustaw tę wartość na 3, aby wykluczyć 2 pierwsze wiersze.
    Jeśli wiersze nagłówka NIE zostaną pominięte, spowoduje to wiele błędów w symulacji importu. +KeepEmptyToGoToEndOfFile=Pozostaw to pole puste, aby przetworzyć wszystkie wiersze do końca pliku. +SelectPrimaryColumnsForUpdateAttempt=Wybierz kolumny, które będą używane jako klucz podstawowy do importu UPDATE +UpdateNotYetSupportedForThisImport=Aktualizacja nie jest obsługiwana dla tego typu importu (tylko wstaw) +NoUpdateAttempt=Nie podjęto próby aktualizacji, tylko włóż ImportDataset_user_1=Użytkownicy (pracownicy lub nie) i ustawienia ComputedField=Obliczone pole ## filters @@ -129,8 +130,8 @@ FilteredFields=Filtrowane pola FilteredFieldsValues=Wartość dla filtra FormatControlRule=Zasada kontroli formatu ## imports updates -KeysToUseForUpdates=Key (column) to use for updating existing data +KeysToUseForUpdates=Klucz (kolumna) do użycia dla aktualizacji istniejących danych NbInsert=ilość wprowadzonych linii: %s NbUpdate=Ilość zaktualizowanych linii: %s -MultipleRecordFoundWithTheseFilters=Multiple records have been found with these filters: %s -StocksWithBatch=Stocks and location (warehouse) of products with batch/serial number +MultipleRecordFoundWithTheseFilters=Znaleziono wiele rekordów z tymi filtrami: %s +StocksWithBatch=Stany i lokalizacja (magazyn) produktów z numerem partii / serii diff --git a/htdocs/langs/pt_AO/admin.lang b/htdocs/langs/pt_AO/admin.lang new file mode 100644 index 00000000000..4b09f74acdb --- /dev/null +++ b/htdocs/langs/pt_AO/admin.lang @@ -0,0 +1,2 @@ +# Dolibarr language file - Source file is en_US - admin +ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or a software interface installed on the same computer as the browser, and called when you click on a link in your browser that starts with "tel:". If you need a full server solution (no need of local software installation), you must set this to "No" and fill next field. diff --git a/htdocs/langs/pt_AO/salaries.lang b/htdocs/langs/pt_AO/salaries.lang new file mode 100644 index 00000000000..c9bd3bec17b --- /dev/null +++ b/htdocs/langs/pt_AO/salaries.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - salaries +LastSalaries=Latest %s salary payments +AllSalaries=All salary payments diff --git a/htdocs/langs/pt_AO/website.lang b/htdocs/langs/pt_AO/website.lang new file mode 100644 index 00000000000..910cff6b702 --- /dev/null +++ b/htdocs/langs/pt_AO/website.lang @@ -0,0 +1,2 @@ +# Dolibarr language file - Source file is en_US - website +PreviewOfSiteNotYetAvailable=Preview of your website %s not yet available. You must first 'Import a full website template' or just 'Add a page/container'. diff --git a/htdocs/langs/pt_BR/deliveries.lang b/htdocs/langs/pt_BR/deliveries.lang index 7c5fec6ed99..ad1c983b4a0 100644 --- a/htdocs/langs/pt_BR/deliveries.lang +++ b/htdocs/langs/pt_BR/deliveries.lang @@ -19,5 +19,6 @@ Sender=Remetente ErrorStockIsNotEnough=Não existe estoque suficiente Shippable=Disponivel para envio NonShippable=Não disponivel para envio +ShowShippableStatus=Mostrar status entregável ShowReceiving=Mostrar recibo de entrega NonExistentOrder=Pedido inexistente diff --git a/htdocs/langs/pt_BR/exports.lang b/htdocs/langs/pt_BR/exports.lang index 4475adb3a39..2e11c55f5aa 100644 --- a/htdocs/langs/pt_BR/exports.lang +++ b/htdocs/langs/pt_BR/exports.lang @@ -68,3 +68,4 @@ ComputedField=Campo computado SelectFilterFields=Se você deseja filtrar alguns valores, apenas os valores de entrada aqui. FilteredFieldsValues=Valor para o filtro MultipleRecordFoundWithTheseFilters=Múltiplos registros foram encontrados com esses filtros: %s +StocksWithBatch=Estoques e localização (armazém) de produtos com lote / número de série diff --git a/htdocs/langs/pt_BR/products.lang b/htdocs/langs/pt_BR/products.lang index ae31027f0ab..a4293c94ace 100644 --- a/htdocs/langs/pt_BR/products.lang +++ b/htdocs/langs/pt_BR/products.lang @@ -133,7 +133,6 @@ ResetBarcodeForAllRecords=Definir o valor do código de barras para todos os reg PriceByCustomer=Preços diferenteas para cada cliente PriceCatalogue=Um único preço de venda por produto/serviço AddCustomerPrice=Adicionar preço por cliente -ForceUpdateChildPriceSoc=Situado mesmo preço em outros pedidos dos clientes PriceByCustomerLog=Registros de preços de cliente anteriores MinimumPriceLimit=Preço mínimo não pode ser inferior, em seguida %s MinimumRecommendedPrice=Preço minimo recomendado é : %s diff --git a/htdocs/langs/pt_BR/ticket.lang b/htdocs/langs/pt_BR/ticket.lang index b88555bee7f..6c7827f0c15 100644 --- a/htdocs/langs/pt_BR/ticket.lang +++ b/htdocs/langs/pt_BR/ticket.lang @@ -8,7 +8,6 @@ TicketDictCategory=Tickets - Grupos TicketDictSeverity=Tickets - Gravidades TicketDictResolution=Ticket - Resolução TicketTypeShortHELP=Pedido de ajuda funcional -TicketTypeShortISSUE=Questão, bug ou problema TicketTypeShortREQUEST=Solicitação de alteração ou aprimoramento TicketTypeShortOTHER=Outros TicketSeverityShortLOW=Baixa @@ -18,7 +17,6 @@ MenuTicketMyAssignNonClosed=Meus tickets abertos MenuListNonClosed=Tickets abertos TypeContact_ticket_external_CONTRIBUTOR=Contribuidor externo Notify_TICKET_SENTBYMAIL=Envio do ticket por e-mail -NeedMoreInformation=Aguardando informação Waiting=Aguardando Severity=Gravidade MailToSendTicketMessage=Para enviar e-mail da mensagem do ticket diff --git a/htdocs/langs/pt_PT/deliveries.lang b/htdocs/langs/pt_PT/deliveries.lang index 35cad55eb41..c8777e9fdf1 100644 --- a/htdocs/langs/pt_PT/deliveries.lang +++ b/htdocs/langs/pt_PT/deliveries.lang @@ -27,5 +27,7 @@ Recipient=Destinatário ErrorStockIsNotEnough=Não existe stock suficiente Shippable= Transportável NonShippable=Não Transportável +ShowShippableStatus=Show shippable status ShowReceiving=Mostrar recibo da entrega NonExistentOrder=Nonexistent order +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/pt_PT/exports.lang b/htdocs/langs/pt_PT/exports.lang index 083e48f5527..49f2eee70c0 100644 --- a/htdocs/langs/pt_PT/exports.lang +++ b/htdocs/langs/pt_PT/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Tipo de linha (0= produto, serviço de 1=) FileWithDataToImport=Arquivo com os dados de importação FileToImport=Fonte ficheiro a importar FileMustHaveOneOfFollowingFormat=O arquivo a ser importado deve ter um dos seguintes formatos -DownloadEmptyExample=Faça o download do arquivo de modelo com informações sobre o conteúdo do campo (* são campos obrigatórios) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Escolha o formato de arquivo para usar como formato de arquivo de importação clicando no ícone %s para selecioná-lo ... ChooseFileToImport=Carregar arquivo, em seguida, clique no ícone %s para selecionar o arquivo como arquivo de importação de origem ... SourceFileFormat=Formato de arquivo de origem diff --git a/htdocs/langs/ro_RO/deliveries.lang b/htdocs/langs/ro_RO/deliveries.lang index 53e4e7d825b..7537953cb21 100644 --- a/htdocs/langs/ro_RO/deliveries.lang +++ b/htdocs/langs/ro_RO/deliveries.lang @@ -1,31 +1,33 @@ # Dolibarr language file - Source file is en_US - deliveries Delivery=Livrare DeliveryRef=Ref Livrare -DeliveryCard=Chitanta card +DeliveryCard=Notă de livrare DeliveryOrder=Bon de livrare -DeliveryDate=Data de livrare -CreateDeliveryOrder=Generați chitanța de livrare -DeliveryStateSaved=Stare livrare salvata +DeliveryDate=Dată de livrare +CreateDeliveryOrder=Generați nota de livrare +DeliveryStateSaved=Stare livrare salvată SetDeliveryDate=Setaţi data de expediere -ValidateDeliveryReceipt=Validare recepţie livrare -ValidateDeliveryReceiptConfirm=Sigur doriți să validați această chitanță de livrare? -DeleteDeliveryReceipt=Ştergeţi recepţie livrare -DeleteDeliveryReceiptConfirm=Sigur doriți să ștergeți chitanța de livrare %s ? -DeliveryMethod=Metoda de livrare -TrackingNumber=Număr de urmărire -DeliveryNotValidated=Livrare nevalidată -StatusDeliveryCanceled=Anulata -StatusDeliveryDraft=Draft +ValidateDeliveryReceipt=Validare notă de livrare +ValidateDeliveryReceiptConfirm=Sigur doriți să validați această notă de livrare? +DeleteDeliveryReceipt=Ştergere notă de livrare +DeleteDeliveryReceiptConfirm=Sigur doriți să ștergeți nota de livrare %s? +DeliveryMethod=Metodă de livrare +TrackingNumber=Număr de urmărire AWB +DeliveryNotValidated=Livrare nevalidată +StatusDeliveryCanceled=Anulată +StatusDeliveryDraft=Schiţă StatusDeliveryValidated=Primit # merou PDF model NameAndSignature=Numele și semnătura: -ToAndDate=To___________________________________ pe ____ / _____ / __________ -GoodStatusDeclaration=Au primit bunurile în bună stare de mai sus, -Deliverer=Expeditor: +ToAndDate=Către___________________________________ pe data de ____ / _____ / __________ +GoodStatusDeclaration=Au primit bunurile de mai sus, în stare bună, +Deliverer=Livrator: Sender=Expeditor -Recipient=Recipient +Recipient=Destinatar ErrorStockIsNotEnough=Nu există stoc suficient Shippable=Livrabil NonShippable=Nelivrabil +ShowShippableStatus=Afișare status de expediere ShowReceiving= Afișare notă de recepție -NonExistentOrder=Ordin inexistent +NonExistentOrder=Comandă inexistentă +StockQuantitiesAlreadyAllocatedOnPreviousLines = Cantități de stoc deja alocate pe liniile anterioare diff --git a/htdocs/langs/ro_RO/exports.lang b/htdocs/langs/ro_RO/exports.lang index 08f9a64d27e..28c2266d9f6 100644 --- a/htdocs/langs/ro_RO/exports.lang +++ b/htdocs/langs/ro_RO/exports.lang @@ -1,136 +1,137 @@ # Dolibarr language file - Source file is en_US - exports ExportsArea=Exporturi ImportArea=Import -NewExport=Exportul nou -NewImport=Importul nou -ExportableDatas=Exportabil de date -ImportableDatas=Importable de date -SelectExportDataSet=Alegeţi de date pe care doriţi să le export ... -SelectImportDataSet=Alegeţi de date pe care doriţi să o import ... +NewExport=Export nou +NewImport=Import nou +ExportableDatas=Set de date exportabil +ImportableDatas=Set de date importabil +SelectExportDataSet=Alege setul de date pe care doreşti să-l exporţi... +SelectImportDataSet=Alege setul de date pe care doreşti să-l imporţi... SelectExportFields=Alegeți câmpurile pe care doriți să le exportați sau selectați un profil de export predefinit -SelectImportFields=Alegeți câmpurile sursă de fișier pe care doriți să le importați și câmpul țintă în baza de date deplasându-le în sus și în jos cu ancora %s sau selectând un profil predefinit de import: -NotImportedFields=Câmpurile fişierului sursă nu importate +SelectImportFields=Alege câmpurile din fișierul sursă pe care doreşti să le imporți și câmpurile țintă din baza de date deplasându-te în sus și în jos cu ancora %s sau selectând un profil predefinit de import: +NotImportedFields=Câmpurile fişierului sursă nu au fost importate SaveExportModel=Salvați selecțiile ca profil de export/șablon (pentru reutilizare). SaveImportModel=Salvați acest profil de import (pentru reutilizare) ... -ExportModelName=Export profil nume -ExportModelSaved=Exportați profilul salvat ca %s . +ExportModelName=Nume profil export date +ExportModelSaved=Exportați profilul salvat ca %s. ExportableFields=Câmpuri exportabile ExportedFields=Câmpuri exportate -ImportModelName=Import profil nume -ImportModelSaved=Profilul de import a fost salvat ca %s . -DatasetToExport=De date la export -DatasetToImport=De date pentru a importa -ChooseFieldsOrdersAndTitle=Alegeţi câmpurile pentru ... -FieldsTitle=Câmpuri titlu -FieldTitle=Domeniul titlu +ImportModelName=Nume profil import date +ImportModelSaved=Profilul de import a fost salvat ca %s. +DatasetToExport=Set de date de exportat +DatasetToImport=Import fişier în set de date +ChooseFieldsOrdersAndTitle=Alegeţi ordinea câmpurilor... +FieldsTitle=Câmpuri titlu +FieldTitle=Titlu câmp NowClickToGenerateToBuildExportFile=Acum, selectați formatul de fișier în caseta combo și faceți clic pe "Generare" pentru a construi fișierul de export ... AvailableFormats=Formate disponibile -LibraryShort=Biblioteca +LibraryShort=Bibliotecă ExportCsvSeparator=Separator caractere CSV ImportCsvSeparator=Separator caractere CSV -Step=Pasul +Step=Pas FormatedImport=Asistent import FormatedImportDesc1=Acest modul vă permite să actualizați datele existente sau să adăugați obiecte noi în baza de date dintr-un fișier fără cunoștințe tehnice, utilizând un asistent. -FormatedImportDesc2=Primul pas este să alegeți tipul de date pe care doriți să îl importați, apoi formatul fișierului sursă, apoi câmpurile pe care doriți să le importați. +FormatedImportDesc2=Primul pas este să alegi tipul de date pe care doreşti să-l imporți, apoi formatul fișierului sursă, apoi câmpurile pe care vrei să le imporți. FormatedExport=Asistent export -FormatedExportDesc1=Aceste instrumente permit exportul de date personalizate folosind un asistent, pentru a vă ajuta în acest proces fără a necesita cunoștințe tehnice. +FormatedExportDesc1=Aceste instrumente permit exportul de date personalizate folosind un asistent, pentru a te ajuta în acest proces fără a necesita cunoștințe tehnice. FormatedExportDesc2=Primul pas este să alegeți un set de date predefinit, apoi câmpurile pe care doriți să le exportați și în ce ordine. FormatedExportDesc3=Când sunt selectate datele de export, puteți alege formatul fișierului de ieșire. Sheet=Foaie -NoImportableData=Nu importable de date (nu cu modul de definiţii, pentru a permite importul de date) +NoImportableData=Date neimportabile (niciun modul cu definiţii care să permită importul) FileSuccessfullyBuilt=Fișierul generat SQLUsedForExport=Interogare SQL utilizată pentru extragerea datelor -LineId=Id-ul de linie -LineLabel=Eticheta linie -LineDescription=Descriere de linie -LineUnitPrice=Preţul unitar de linie -LineVATRate=TVA de linie -LineQty=Cantitate de linie -LineTotalHT=Cantitate excl. taxa pentru linie -LineTotalTTC=Suma cu taxa de linie -LineTotalVAT=Suma TVA pentru linia +LineId=Id linie +LineLabel=Etichetă linie +LineDescription=Descriere linie +LineUnitPrice=Preţul unitar pentru linie +LineVATRate=Cota TVA pentru linie +LineQty=Cantitate pentru linie +LineTotalHT=Valoarea fără taxe pentru linie +LineTotalTTC=Valoarea cu taxe pentru linie +LineTotalVAT=Valoare TVA pentru linie TypeOfLineServiceOrProduct=Tip de linie (0= produs, 1= serviciu) FileWithDataToImport=Fişiere cu date de import FileToImport=Fişierul sursă de import FileMustHaveOneOfFollowingFormat=Fișierul de import trebuie să aibă unul din următoarele formate -DownloadEmptyExample=Descărcați fișierul șablon cu informații despre conținutul câmpului (* sunt câmpuri obligatorii) -ChooseFormatOfFileToImport=Alegeți formatul de fișier pentru a fi utilizat ca format de fișier de import făcând clic pe pictograma %s pentru a o selecta ... -ChooseFileToImport=Încărcați fișierul, apoi dați clic pe pictograma %s pentru a selecta fișierul ca fișier de import al sursei ... -SourceFileFormat=Sursa Format fişier -FieldsInSourceFile=Câmpuri in fişierul sursă -FieldsInTargetDatabase=Câmpuri-țintă în baza de date Dolibarr (bold = obligatoriu) +DownloadEmptyExample=Descărcare fișier șablon cu informații despre conținutul câmpului +StarAreMandatory=* sunt câmpuri obligatorii +ChooseFormatOfFileToImport=Alegeți formatul de fișier care va fi utilizat ca format de fișier de import făcând clic pe pictograma %s pentru selecţie... +ChooseFileToImport=Încărcați fișierul, apoi dați clic pe pictograma %s pentru a selecta fișierul ca sursă de import... +SourceFileFormat=Format fişier sursă +FieldsInSourceFile=Câmpuri în fişierul sursă +FieldsInTargetDatabase=Câmpuri-țintă în baza de date a sistemului (bold = obligatoriu) Field=Câmp NoFields=Niciun câmp -MoveField=Mutare coloana %s domeniul număr +MoveField=Mută câmpul coloană cu numărul %s ExampleOfImportFile=Example_of_import_file -SaveImportProfile=Salvaţi acest profil de import -ErrorImportDuplicateProfil=Nu am putut salva acest profil de import cu acest nume. Un profil existent deja cu acest nume. +SaveImportProfile=Salvează acest profil de import +ErrorImportDuplicateProfil=Nu am putut salva profilul de import cu acest nume. Un profil există deja cu acest nume. TablesTarget=Tabelele vizate FieldsTarget=Câmpuri vizate FieldTarget=Câmp vizat -FieldSource=Sursa de câmp +FieldSource=Câmp sursă NbOfSourceLines=Numărul de linii în fişierul sursă -NowClickToTestTheImport=Verificați dacă formatul fișierului (câmpurile și delimitatorii de șir) al fișierului dvs. corespunde opțiunilor afișate și că ați omis linia antetului sau acestea vor fi semnalate ca erori în următoarea simulare.
    Faceți clic pe butonul " %s " pentru a rula o verificare a structurii / conținutului fișierelor și a simula procesul de importare.
    Nu se vor schimba date în baza dumneavoastră de date . +NowClickToTestTheImport=Verifică dacă formatul fișierului (câmpurile și delimitatorii de șir) din fișierul tău corespunde opțiunilor afișate și că ai omis linia antetului; acestea vor fi semnalate ca erori în următoarea simulare.
    Faceți clic pe butonul " %s " pentru a rula o verificare a structurii/conținutului fișierelor și a simula procesul de importare.
    Nu se vor modifica informaţii din baza de date . RunSimulateImportFile=Rulați simularea de import FieldNeedSource=Acest câmp cere date din fişierul sursă -SomeMandatoryFieldHaveNoSource=Unele câmpuri obligatorii nu au nicio sursă de date de la dosar -InformationOnSourceFile=Informaţii privind fişier sursă +SomeMandatoryFieldHaveNoSource=Unele câmpuri obligatorii nu au nicio sursă de date din fişier +InformationOnSourceFile=Informaţii privind fişierul sursă InformationOnTargetTables=Informaţii privind câmpurile ţintă SelectAtLeastOneField=Comută cel puțin un câmp sursă în coloana de câmpuri de exportat -SelectFormat=Alegeţi acest fişier format de import -RunImportFile=Importați date -NowClickToRunTheImport=Verificați rezultatele simulării de import. Corectați orice eroare și retestați.
    Când simularea nu raportează erori, puteți continua să importați datele în baza de date. +SelectFormat=Alege acest format de fişier de import +RunImportFile=Import date +NowClickToRunTheImport=Verifică rezultatele simulării de import. Corectează orice eroare și re-testează.
    Când simularea nu mai raportează erori, poţi importa datele în baza de date. DataLoadedWithId=Datele importate vor avea un câmp suplimentar în fiecare tabelă de bază de date cu acest id de import: %s , pentru a permite ca acesta să poată fi căutat în cazul investigării unei probleme legate de acest import. -ErrorMissingMandatoryValue=Datele obligatorii sunt goale în fișierul sursă pentru câmpul %s . -TooMuchErrors=Există încă %s alte linii sursă cu erori, dar ieșirea a fost limitată. -TooMuchWarnings=Există încă %s alte linii sursă cu avertismente, dar ieșirea a fost limitată. -EmptyLine=linie goală (vor fi aruncate) -CorrectErrorBeforeRunningImport=Trebuie să trebuie să corectaţi toate erorile înainte ca să ruleze importul definitiv. -FileWasImported=Dosarul a fost importat cu %s număr. -YouCanUseImportIdToFindRecord=Puteți găsi toate înregistrările importate în baza dvs. de date prin filtrarea pe câmpul import_key = '%s' . -NbOfLinesOK=Numărul de linii fără erori şi fără avertismente: %s. -NbOfLinesImported=Numărul de linii cu succes importate: %s. -DataComeFromNoWhere=Valoare pentru a introduce vine de nicăieri în fişierul sursă. -DataComeFromFileFieldNb=Valoare pentru a introduce %s vine de la numărul de câmp în fişierul sursă. -DataComeFromIdFoundFromRef=Valoarea care vine de la numărul câmpului %s din fișierul sursă va fi utilizată pentru a găsi id-ul obiectului parental de folosit (astfel încât obiectul %s care are ref. din fișierul sursă trebuie să existe în baza de date). -DataComeFromIdFoundFromCodeId=Codul care vine de la numărul de câmp %s din fișierul sursă va fi folosit pentru a găsi id-ul obiectului parental de folosit (astfel încât codul din fișierul sursă trebuie să existe în dicționar %s ). Rețineți că, dacă cunoașteți idul, îl puteți utiliza și în fișierul sursă în locul codului. Importul ar trebui să funcționeze în ambele cazuri. -DataIsInsertedInto=Datele provin din fişierul sursă va fi inserat în câmpul de următoarele: -DataIDSourceIsInsertedInto=ID-ul obiectului părinte a fost găsit utilizând datele din fișierul sursă, va fi introdus în câmpul următor: -DataCodeIDSourceIsInsertedInto=ID-ul de linie de la mamă găsit codul, va fi introdus în câmpul următorul text: -SourceRequired=valoarea datelor este obligatorie -SourceExample=Exemplu de valoare posibilă de date -ExampleAnyRefFoundIntoElement=Orice Ref gasit pentru %s element +ErrorMissingMandatoryValue=Date obligatorii sunt necompletate în fișierul sursă pentru câmpul %s. +TooMuchErrors=Există încă %s alte linii sursă cu erori, dar afişarea a fost limitată. +TooMuchWarnings=Există încă %s alte linii sursă cu avertismente, dar afişarea a fost limitată. +EmptyLine=Linie goală (va fi ignorată) +CorrectErrorBeforeRunningImport=Trebuie să corectezi toate erorile înainte de a rula importul definitiv. +FileWasImported=Fişierul a fost importat cu numărul %s. +YouCanUseImportIdToFindRecord=Găsiţi toate înregistrările importate în baza de date filtrând pe câmpul import_key = '%s'. +NbOfLinesOK=Număr de linii fără erori şi fără avertismente: %s. +NbOfLinesImported=Număr de linii importate cu succes: %s. +DataComeFromNoWhere=Valoarea de inserare necunoscută în fişierul sursă. +DataComeFromFileFieldNb=Valoarea de introdus vine din câmpul cu numărul %s din fişierul sursă. +DataComeFromIdFoundFromRef=Valoarea care provine din câmpul cu numărul %s din fișierul sursă va fi utilizată pentru a găsi id-ul obiectului părinte care se va folosi (astfel încât obiectul %s care are referinţa din fișierul sursă trebuie să existe în baza de date). +DataComeFromIdFoundFromCodeId=Codul care provine din câmpul cu numărul %s din fișierul sursă va fi folosit pentru a găsi id-ul obiectului părinte utilizat (deci codul din fișierul sursă trebuie să existe în dicționarul %s). Reține că, dacă cunoști id-ul, îl poți utiliza și în fișierul sursă în locul codului. Importul ar trebui să funcționeze în ambele cazuri. +DataIsInsertedInto=Datele care provin din fişierul sursă vor fi inserate în următorul câmp: +DataIDSourceIsInsertedInto=ID-ul obiectului părinte a fost găsit utilizând datele din fișierul sursă, va fi introdus în următorul câmp: +DataCodeIDSourceIsInsertedInto=ID-ul liniei părinte găsit în cod, va fi introdus în următorul câmp: +SourceRequired=Valoarea de tip dată este obligatorie +SourceExample=Exemplu de valoare posibilă +ExampleAnyRefFoundIntoElement=Orice referinţă gasită pentru elementul %s ExampleAnyCodeOrIdFoundIntoDictionary=Orice cod (sau id) găsit în dicţionarul %s -CSVFormatDesc= Valoarea separată prin virgulă formatul de fișier (.csv).
    Acesta este un format de fișier text în care câmpurile sunt separate printr-un separator [%s]. Dacă separatorul se găsește într-un conținut de câmp, câmpul este rotunjit de caracterul rotund [%s]. Caracterul ESC pentru a scăpa de caracterul rotund este [%s]. -Excel95FormatDesc= Excel format (.xls)
    Acesta este formatul nativ Excel 95 (BIFF5). -Excel2007FormatDesc= Excel format fișier (.xlsx)
    Acesta este formatul nativ Excel 2007 (SpreadsheetML). -TsvFormatDesc= Tab Separat Valoare format de fișier (.tsv)
    Acesta este un format de fișier text în care câmpurile sunt separate printr-un tabulator [tab]. -ExportFieldAutomaticallyAdded=Câmpul %s a fost adăugat automat. Va evita să aveți linii similare pentru a fi tratate ca înregistrări duplicate (cu acest câmp adăugat, toate liniile vor avea propriul id și vor diferi). -CsvOptions=Optiuni de format CSV +CSVFormatDesc=Formatul de fişier (.csv) Valoare separată prin virgulă .
    Acesta este un format de fișier text în care câmpurile sunt separate printr-un separator [%s]. Dacă separatorul se găsește într-un câmp de conţinut, câmpul este trunchiat de caracterul [%s]. Caracterul de evadare este [%s]. +Excel95FormatDesc=Formatul de fişier Excel (.xls)
    Acesta este formatul nativ Excel 95 (BIFF5). +Excel2007FormatDesc=Formatul de fişier Excel (.xlsx)
    Acesta este formatul nativ Excel 2007 (SpreadsheetML). +TsvFormatDesc=Formatul de fişier (.tsv) Valori separate prin Tab
    Acesta este un format de fișier text în care câmpurile sunt separate printr-un tabulator [tab]. +ExportFieldAutomaticallyAdded=Câmpul %s a fost adăugat automat. Se va evita introducerea de linii similare considerate ca înregistrări duplicate (cu acest câmp adăugat, toate liniile vor avea propriul id și vor diferi). +CsvOptions=Opţiuni format CSV Separator=Separator de câmp Enclosure=Delimitator de şir SpecialCode=Cod special -ExportStringFilter=%% permite înlocuirea unuia sau mai multor caractere in text -ExportDateFilter=AAAA, AAAALL, AAAALLZZ: filtre pe un an / lună / zi
    AAAA + AAAA, AAAALL + AAAALL, AAAALLZZ + AAAALLZZ: filtre pe o perioadă de ani / luni / zile
    > AAAA, > AAAALL, > AAAALLZZ: filtre pentru toți anii / lunile / zilele urmatori
    NNNNN + NNNNN filtrează peste un interval de valori
    Filtre NNNNN prin valori mai mici
    > Filtre NNNNN prin valori mai mari -ImportFromLine=Importul pornind de la linia numărul +ExportStringFilter=%% permite înlocuirea unuia sau mai multor caractere în text +ExportDateFilter=YYYY, YYYYMM, YYYYMMDD: filtre după an/lună/zi
    YYYY+YYYY, YYYYMM+YYYYMM, YYYYMMDD+YYYYMMDD: filtre pe o perioadă de ani/luni/zile
    > YYYY, > YYYYMM, > YYYYMMDD: filtre pentru toţi anii/lunile/zilele următoare
    < YYYY, < YYYYMM, < YYYYMMDD: filtre pentru toți anii/lunile/zilele anterioare +ExportNumericFilter=NNNNN filtrează după o valoare
    NNNNN + NNNNN filtrează după un interval de valori
    < NNNNN filtrează după valori mai mici
    > NNNNN după valori mai mari +ImportFromLine=Importă începând cu linia numărul EndAtLineNb=Sfârșit la linia numărul ImportFromToLine=Interval limită (De la - Până la). Ex. pentru a omite linia(ile) de cap de tabel. -SetThisValueTo2ToExcludeFirstLine=De exemplu, setați această valoare la 3 pentru a exclude primele 2 linii.
    Dacă liniile de antet NU sunt omise, aceasta va duce la mai multe erori în simularea importului. +SetThisValueTo2ToExcludeFirstLine=De exemplu, setează această valoare la 3 pentru a exclude primele 2 linii.
    Dacă liniile de antet NU sunt omise, aceasta va duce la mai multe erori în simularea importului. KeepEmptyToGoToEndOfFile=Păstrați acest câmp gol pentru a procesa toate liniile până la sfârșitul fișierului. -SelectPrimaryColumnsForUpdateAttempt=Selectați coloana (coloanele) de utilizat ca cheie primară pentru o importare UPDATE -UpdateNotYetSupportedForThisImport=Actualizarea nu este acceptată pentru acest tip de import (inserați numai) -NoUpdateAttempt=Nu a fost efectuată nicio încercare de actualizare, se introduce numai +SelectPrimaryColumnsForUpdateAttempt=Selectează coloana(coloanele) de utilizat ca cheie primară pentru un import cu actualizare UPDATE +UpdateNotYetSupportedForThisImport=Actualizarea nu este acceptată pentru acest tip de import (doar inserare) +NoUpdateAttempt=Nu a fost efectuată nicio încercare de actualizare, doar se inserează ImportDataset_user_1=Utilizatori (angajați sau nu) și proprietăți -ComputedField=Câmpul calculat +ComputedField=Câmp calculat ## filters SelectFilterFields=Dacă doriți să filtrați pe anumite valori, doar introduceţi valorile aici. FilteredFields=Câmpuri filtrate FilteredFieldsValues=Valoare pentru filtru FormatControlRule=Regula de control a formatelor ## imports updates -KeysToUseForUpdates=Tastă (coloană) de utilizat pentru actualizarea datelor -NbInsert=Numărul liniilor inserate: %s -NbUpdate=Numărul liniilor actualizate: %s +KeysToUseForUpdates=Cheie (coloană) de utilizat pentru actualizarea datelor existente +NbInsert=Număr linii inserate: %s +NbUpdate=Număr linii actualizate: %s MultipleRecordFoundWithTheseFilters=Au fost găsite mai multe înregistrări cu ajutorul acestor filtre: %s StocksWithBatch=Stocuri și locație (depozit) a produselor cu număr de lot/serie diff --git a/htdocs/langs/ru_UA/salaries.lang b/htdocs/langs/ru_UA/salaries.lang new file mode 100644 index 00000000000..c9bd3bec17b --- /dev/null +++ b/htdocs/langs/ru_UA/salaries.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - salaries +LastSalaries=Latest %s salary payments +AllSalaries=All salary payments diff --git a/htdocs/langs/ru_UA/users.lang b/htdocs/langs/ru_UA/users.lang new file mode 100644 index 00000000000..4a412122b08 --- /dev/null +++ b/htdocs/langs/ru_UA/users.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - users +NbOfUsers=No. of users +NbOfPermissions=No. of permissions diff --git a/htdocs/langs/ru_UA/website.lang b/htdocs/langs/ru_UA/website.lang new file mode 100644 index 00000000000..910cff6b702 --- /dev/null +++ b/htdocs/langs/ru_UA/website.lang @@ -0,0 +1,2 @@ +# Dolibarr language file - Source file is en_US - website +PreviewOfSiteNotYetAvailable=Preview of your website %s not yet available. You must first 'Import a full website template' or just 'Add a page/container'. diff --git a/htdocs/langs/sk_SK/deliveries.lang b/htdocs/langs/sk_SK/deliveries.lang index bbbd23eb949..a9399816f13 100644 --- a/htdocs/langs/sk_SK/deliveries.lang +++ b/htdocs/langs/sk_SK/deliveries.lang @@ -27,5 +27,7 @@ Recipient=Príjemca ErrorStockIsNotEnough=There's not enough stock Shippable=Shippable NonShippable=Not Shippable +ShowShippableStatus=Show shippable status ShowReceiving=Show delivery receipt NonExistentOrder=Nonexistent order +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/sk_SK/exports.lang b/htdocs/langs/sk_SK/exports.lang index a9991f8c0fd..27c4c0f4a2d 100644 --- a/htdocs/langs/sk_SK/exports.lang +++ b/htdocs/langs/sk_SK/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Použitý typ linky (0 = produkt, 1 = služba) FileWithDataToImport=Súbor s dátami pre import FileToImport=Zdrojový súbor na import FileMustHaveOneOfFollowingFormat=File to import must have one of following formats -DownloadEmptyExample=Download template file with field content information (* are mandatory fields) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Choose the file format to use as import file format by clicking on the %s icon to select it... ChooseFileToImport=Upload file then click on the %s icon to select file as source import file... SourceFileFormat=Zdrojový súbor diff --git a/htdocs/langs/sl_SI/deliveries.lang b/htdocs/langs/sl_SI/deliveries.lang index 6c10f871fba..a2045ed2786 100644 --- a/htdocs/langs/sl_SI/deliveries.lang +++ b/htdocs/langs/sl_SI/deliveries.lang @@ -27,5 +27,7 @@ Recipient=Prejemnik ErrorStockIsNotEnough=Zaloga je premajhna Shippable=Možna odprema NonShippable=Ni možna odprema +ShowShippableStatus=Show shippable status ShowReceiving=Show delivery receipt NonExistentOrder=Nonexistent order +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/sl_SI/exports.lang b/htdocs/langs/sl_SI/exports.lang index e48218574d6..9b77df1cc21 100644 --- a/htdocs/langs/sl_SI/exports.lang +++ b/htdocs/langs/sl_SI/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Tip vrstice (0=proizvod, 1=storitev) FileWithDataToImport=Datoteka s podatki za uvoz FileToImport=Izvorna datoteka za uvoz FileMustHaveOneOfFollowingFormat=File to import must have one of following formats -DownloadEmptyExample=Download template file with field content information (* are mandatory fields) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Choose the file format to use as import file format by clicking on the %s icon to select it... ChooseFileToImport=Upload file then click on the %s icon to select file as source import file... SourceFileFormat=Format izvorne datoteke diff --git a/htdocs/langs/sq_AL/deliveries.lang b/htdocs/langs/sq_AL/deliveries.lang index 903710c110d..05b090f1123 100644 --- a/htdocs/langs/sq_AL/deliveries.lang +++ b/htdocs/langs/sq_AL/deliveries.lang @@ -27,5 +27,7 @@ Recipient=Recipient ErrorStockIsNotEnough=There's not enough stock Shippable=Shippable NonShippable=Not Shippable +ShowShippableStatus=Show shippable status ShowReceiving=Show delivery receipt NonExistentOrder=Nonexistent order +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/sq_AL/exports.lang b/htdocs/langs/sq_AL/exports.lang index a0eb7161ef2..cb652229825 100644 --- a/htdocs/langs/sq_AL/exports.lang +++ b/htdocs/langs/sq_AL/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Type of line (0=product, 1=service) FileWithDataToImport=File with data to import FileToImport=Source file to import FileMustHaveOneOfFollowingFormat=File to import must have one of following formats -DownloadEmptyExample=Download template file with field content information (* are mandatory fields) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Choose the file format to use as import file format by clicking on the %s icon to select it... ChooseFileToImport=Upload file then click on the %s icon to select file as source import file... SourceFileFormat=Source file format diff --git a/htdocs/langs/sr_RS/deliveries.lang b/htdocs/langs/sr_RS/deliveries.lang index 0ab45d43795..6590466b478 100644 --- a/htdocs/langs/sr_RS/deliveries.lang +++ b/htdocs/langs/sr_RS/deliveries.lang @@ -27,5 +27,7 @@ Recipient=Primalac ErrorStockIsNotEnough=Nema dovoljno zaliha Shippable=Isporučivo NonShippable=Nije isporučivo +ShowShippableStatus=Show shippable status ShowReceiving=Show delivery receipt NonExistentOrder=Nonexistent order +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/sr_RS/exports.lang b/htdocs/langs/sr_RS/exports.lang index 41f2f5ed861..6ad60fe9e52 100644 --- a/htdocs/langs/sr_RS/exports.lang +++ b/htdocs/langs/sr_RS/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Tip linije (0=proizvod, 1=usluga) FileWithDataToImport=Fajl sa podacima za import FileToImport=Izvorni fajl za import FileMustHaveOneOfFollowingFormat=File to import must have one of following formats -DownloadEmptyExample=Download template file with field content information (* are mandatory fields) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Choose the file format to use as import file format by clicking on the %s icon to select it... ChooseFileToImport=Upload file then click on the %s icon to select file as source import file... SourceFileFormat=Format izvornog fajla diff --git a/htdocs/langs/sw_SW/deliveries.lang b/htdocs/langs/sw_SW/deliveries.lang index 1f48c01de75..cd8a36e6c70 100644 --- a/htdocs/langs/sw_SW/deliveries.lang +++ b/htdocs/langs/sw_SW/deliveries.lang @@ -27,5 +27,7 @@ Recipient=Recipient ErrorStockIsNotEnough=There's not enough stock Shippable=Shippable NonShippable=Not Shippable +ShowShippableStatus=Show shippable status ShowReceiving=Show delivery receipt NonExistentOrder=Nonexistent order +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/sw_SW/exports.lang b/htdocs/langs/sw_SW/exports.lang index a0eb7161ef2..cb652229825 100644 --- a/htdocs/langs/sw_SW/exports.lang +++ b/htdocs/langs/sw_SW/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Type of line (0=product, 1=service) FileWithDataToImport=File with data to import FileToImport=Source file to import FileMustHaveOneOfFollowingFormat=File to import must have one of following formats -DownloadEmptyExample=Download template file with field content information (* are mandatory fields) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Choose the file format to use as import file format by clicking on the %s icon to select it... ChooseFileToImport=Upload file then click on the %s icon to select file as source import file... SourceFileFormat=Source file format diff --git a/htdocs/langs/th_TH/deliveries.lang b/htdocs/langs/th_TH/deliveries.lang index cac9f569166..84b94f406b3 100644 --- a/htdocs/langs/th_TH/deliveries.lang +++ b/htdocs/langs/th_TH/deliveries.lang @@ -27,5 +27,7 @@ Recipient=ผู้รับ ErrorStockIsNotEnough=มีไม่มากพอที่หุ้น Shippable=shippable NonShippable=ไม่ shippable +ShowShippableStatus=Show shippable status ShowReceiving=Show delivery receipt NonExistentOrder=Nonexistent order +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/th_TH/exports.lang b/htdocs/langs/th_TH/exports.lang index 4ec434b49a1..c378db35d2c 100644 --- a/htdocs/langs/th_TH/exports.lang +++ b/htdocs/langs/th_TH/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=ประเภทของสาย (0 = ผลิ FileWithDataToImport=ไฟล์ที่มีข้อมูลที่จะนำเข้า FileToImport=แหล่งที่มาของไฟล์ที่จะนำเข้า FileMustHaveOneOfFollowingFormat=File to import must have one of following formats -DownloadEmptyExample=Download template file with field content information (* are mandatory fields) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Choose the file format to use as import file format by clicking on the %s icon to select it... ChooseFileToImport=Upload file then click on the %s icon to select file as source import file... SourceFileFormat=แหล่งที่มาของรูปแบบไฟล์ diff --git a/htdocs/langs/tr_TR/deliveries.lang b/htdocs/langs/tr_TR/deliveries.lang index 9e7fe45cb1e..0bb2ba24e55 100644 --- a/htdocs/langs/tr_TR/deliveries.lang +++ b/htdocs/langs/tr_TR/deliveries.lang @@ -27,5 +27,7 @@ Recipient=Alıcı ErrorStockIsNotEnough=Yeterli stok yok Shippable=Sevkedilebilir NonShippable=Sevkedilemez +ShowShippableStatus=Show shippable status ShowReceiving=Teslimat Fişini göster NonExistentOrder=Mevcut olmayan sipariş +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/tr_TR/exports.lang b/htdocs/langs/tr_TR/exports.lang index a909d78355e..b57587b63a8 100644 --- a/htdocs/langs/tr_TR/exports.lang +++ b/htdocs/langs/tr_TR/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Satır türü (0 = ürün, 1 = hizmet) FileWithDataToImport=İçe aktarılacak verileri içeren dosya FileToImport=İçe aktarılacak kaynak dosya FileMustHaveOneOfFollowingFormat=İçe aktarılacak dosya aşağıdaki formatlardan biri olmalıdır -DownloadEmptyExample=Şablon dosyasını alan içeriği bilgisiyle indir (* olanlar zorunlu alanlardır) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Kullanmak istediğiniz içe aktarma dosya biçimini, %s simgesine tıklayarak seçin... ChooseFileToImport=Dosyayı yükleyin ve daha sonra bu dosyayı kaynak içe aktarma dosyası olarak seçmek için %s simgesine tıklayın... SourceFileFormat=Kaynak dosya biçimi diff --git a/htdocs/langs/uk_UA/deliveries.lang b/htdocs/langs/uk_UA/deliveries.lang index e285559f004..590ee2a0dfe 100644 --- a/htdocs/langs/uk_UA/deliveries.lang +++ b/htdocs/langs/uk_UA/deliveries.lang @@ -27,5 +27,7 @@ Recipient=Recipient ErrorStockIsNotEnough=There's not enough stock Shippable=Shippable NonShippable=Not Shippable +ShowShippableStatus=Show shippable status ShowReceiving=Show delivery receipt NonExistentOrder=Nonexistent order +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/uk_UA/exports.lang b/htdocs/langs/uk_UA/exports.lang index e075edfbcbe..317badfbf30 100644 --- a/htdocs/langs/uk_UA/exports.lang +++ b/htdocs/langs/uk_UA/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Type of line (0=product, 1=service) FileWithDataToImport=File with data to import FileToImport=Source file to import FileMustHaveOneOfFollowingFormat=File to import must have one of following formats -DownloadEmptyExample=Download template file with field content information (* are mandatory fields) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Choose the file format to use as import file format by clicking on the %s icon to select it... ChooseFileToImport=Upload file then click on the %s icon to select file as source import file... SourceFileFormat=Source file format diff --git a/htdocs/langs/vi_VN/deliveries.lang b/htdocs/langs/vi_VN/deliveries.lang index 5156d289e9c..46fd7d5197d 100644 --- a/htdocs/langs/vi_VN/deliveries.lang +++ b/htdocs/langs/vi_VN/deliveries.lang @@ -27,5 +27,7 @@ Recipient=Người nhận ErrorStockIsNotEnough=Không có đủ tồn kho Shippable=Vận chuyển được NonShippable=Không vận chuyển được +ShowShippableStatus=Show shippable status ShowReceiving=Hiển thị biên nhận giao hàng NonExistentOrder=Đơn hàng không tồn tại +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/vi_VN/exports.lang b/htdocs/langs/vi_VN/exports.lang index f15be790dc6..2cdb1136e64 100644 --- a/htdocs/langs/vi_VN/exports.lang +++ b/htdocs/langs/vi_VN/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Loại dòng (0 = sản phẩm, dịch vụ = 1) FileWithDataToImport=Tập tin với dữ liệu để nhập FileToImport=Tập tin nguồn để nhập dữ liệu FileMustHaveOneOfFollowingFormat=Tệp để nhập phải có một trong các định dạng sau -DownloadEmptyExample=Tải xuống tệp mẫu với thông tin nội dung trường (* là các trường bắt buộc) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Chọn định dạng tệp để sử dụng làm định dạng tệp nhập bằng cách nhấp vào biểu tượng %s để chọn ... ChooseFileToImport=Tải lên tệp sau đó nhấp vào biểu tượng %s để lựa chọn tệp là tệp nguồn nhập SourceFileFormat=Định dạng tệp nguồn diff --git a/htdocs/langs/zh_CN/deliveries.lang b/htdocs/langs/zh_CN/deliveries.lang index 38c9b4fc09e..af63b1c926c 100644 --- a/htdocs/langs/zh_CN/deliveries.lang +++ b/htdocs/langs/zh_CN/deliveries.lang @@ -27,5 +27,7 @@ Recipient=接收方 ErrorStockIsNotEnough=库存不足 Shippable=可运输 NonShippable=不可运输 +ShowShippableStatus=Show shippable status ShowReceiving=显示送达回执 NonExistentOrder=Nonexistent order +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/zh_CN/exports.lang b/htdocs/langs/zh_CN/exports.lang index 11cfd2fcb7e..3836e3d001e 100644 --- a/htdocs/langs/zh_CN/exports.lang +++ b/htdocs/langs/zh_CN/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=型号明细(0 =表示产品,1 =表示服务) FileWithDataToImport=与数据文件导入 FileToImport=源文件导入 FileMustHaveOneOfFollowingFormat=File to import must have one of following formats -DownloadEmptyExample=Download template file with field content information (* are mandatory fields) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Choose the file format to use as import file format by clicking on the %s icon to select it... ChooseFileToImport=Upload file then click on the %s icon to select file as source import file... SourceFileFormat=源文件格式 diff --git a/htdocs/langs/zh_HK/deliveries.lang b/htdocs/langs/zh_HK/deliveries.lang index 1f48c01de75..cd8a36e6c70 100644 --- a/htdocs/langs/zh_HK/deliveries.lang +++ b/htdocs/langs/zh_HK/deliveries.lang @@ -27,5 +27,7 @@ Recipient=Recipient ErrorStockIsNotEnough=There's not enough stock Shippable=Shippable NonShippable=Not Shippable +ShowShippableStatus=Show shippable status ShowReceiving=Show delivery receipt NonExistentOrder=Nonexistent order +StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/zh_HK/exports.lang b/htdocs/langs/zh_HK/exports.lang index a0eb7161ef2..cb652229825 100644 --- a/htdocs/langs/zh_HK/exports.lang +++ b/htdocs/langs/zh_HK/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=Type of line (0=product, 1=service) FileWithDataToImport=File with data to import FileToImport=Source file to import FileMustHaveOneOfFollowingFormat=File to import must have one of following formats -DownloadEmptyExample=Download template file with field content information (* are mandatory fields) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=Choose the file format to use as import file format by clicking on the %s icon to select it... ChooseFileToImport=Upload file then click on the %s icon to select file as source import file... SourceFileFormat=Source file format diff --git a/htdocs/langs/zh_TW/admin.lang b/htdocs/langs/zh_TW/admin.lang index d7d1e9d7cf5..365ca72b6e7 100644 --- a/htdocs/langs/zh_TW/admin.lang +++ b/htdocs/langs/zh_TW/admin.lang @@ -37,7 +37,7 @@ UnlockNewSessions=移除連線鎖定 YourSession=您的程序 Sessions=用戶程序 WebUserGroup=網頁伺服器用戶/組別 -PermissionsOnFiles=Permissions on files +PermissionsOnFiles=檔案權限 PermissionsOnFilesInWebRoot=網站根目錄中檔案的權限 PermissionsOnFile=檔案%s的權限 NoSessionFound=您的PHP設定似乎不允許列出活動程序。用於保存程序的資料夾( %s )可能受到保護(例如,通過OS權限或PHP指令open_basedir)。 @@ -221,7 +221,7 @@ NotCompatible=此模組似乎不相容您 Dolibarr %s (適用最低版本 %s - CompatibleAfterUpdate=此模組需要升級您的 Dolibarr %s (最低版本%s -最高版本 %s)。 SeeInMarkerPlace=在市場可以看到 SeeSetupOfModule=請參閱模組%s的設定 -SetOptionTo=Set option %s to %s +SetOptionTo=將選項%s設定為%s Updated=升級 AchatTelechargement=購買 / 下載 GoModuleSetupArea=要部署/安裝新模組,請前往模組設定區域: %s 。 @@ -399,7 +399,7 @@ SecurityToken=安全的網址的金鑰 NoSmsEngine=沒有可用的簡訊發送管理器.由於依賴於外部供應商,所以預設發布版本未安裝簡訊發送管理器,但是您可以在%s上找到它們。 PDF=PDF格式 PDFDesc=生成PDF 的全域選項 -PDFOtherDesc=PDF Option specific to some modules +PDFOtherDesc=某些模組的特別PDF 選項 PDFAddressForging=規則給地址的部分 HideAnyVATInformationOnPDF=隱藏與銷售稅/營業稅相關的所有訊息 PDFRulesForSalesTax=銷售稅 / 營業稅規則 @@ -648,13 +648,13 @@ Module2900Desc=GeoIP Maxmind轉換功能 Module3200Name=不可改變的檔案 Module3200Desc=啟用不可更改的商業事件日誌。事件是即時存檔的。日誌是可以匯出的鍊式事件的唯讀表格。在某些國家/地區,此模組可能是必需的。 Module3400Name=社群網路 -Module3400Desc=Enable Social Networks fields into third parties and addresses (skype, twitter, facebook, ...). +Module3400Desc=啟用合作方與地址的社群網路欄位 (skype, twitter, facebook, ...). Module4000Name=人資 Module4000Desc=人力資源管理(部門、員工合約及感受的管理) Module5000Name=多重公司 Module5000Desc=允許您管理多重公司 -Module6000Name=Inter-modules Workflow -Module6000Desc=Workflow management between different modules (automatic creation of object and/or automatic status change) +Module6000Name=內部模組工作流程 +Module6000Desc=模組工作流管理(自動建立項目和/或自動更改狀態) Module10000Name=網站 Module10000Desc=使用所見即所得編輯器建立網站(公共)。這是一個面向網站管理員或面向開發人員的CMS(最好了解HTML和CSS語言)。只需將您的Web伺服器(Apache,Nginx等)設定為指向專用的Dolibarr資料夾,即可使用您自己的網域名稱在Internet上連線。 Module20000Name=休假申請管理 @@ -2102,8 +2102,8 @@ MakeAnonymousPing=對Dolibarr基金會服務器進行匿名Ping'+1'(僅在安 FeatureNotAvailableWithReceptionModule=啟用接收模組後,此功能不可用 EmailTemplate=電子郵件模板 EMailsWillHaveMessageID=電子郵件將具有與此語法匹配的標籤“參考” -PDF_SHOW_PROJECT=Show project on document -ShowProjectLabel=Project Label +PDF_SHOW_PROJECT=在文件中顯示專案 +ShowProjectLabel=專案標籤 PDF_USE_ALSO_LANGUAGE_CODE=如果您要在生成同一的PDF中以兩種不同的語言複製一些文字,則必須在此處設置第二種語言讓生成的PDF在同一頁中包含兩種不同的語言,選擇的可以用來生成PDF跟另一種語言(只有少數PDF模板支援此功能)。PDF只有一種語言則留空。 FafaIconSocialNetworksDesc=在此處輸入FontAwesome圖示的代碼。如果您不知道什麼是FontAwesome,則可以使用通用值fa-address-book。 RssNote=注意:每個RSS feed定義都提供一個小部件,您必須啟用該小部件才能使其在儀表板中看到 @@ -2118,29 +2118,30 @@ SwitchThisForABetterSecurity=建議將此值變更為%s以提高安全性 DictionaryProductNature= 產品性質 CountryIfSpecificToOneCountry=國家(如果特定於給定國家) YouMayFindSecurityAdviceHere=您可以在這裡找到安全建議 -ModuleActivatedMayExposeInformation=This PHP extension may expose sensitive data. If you don't need it, disable it. -ModuleActivatedDoNotUseInProduction=A module designed for the development has been enabled. Do not enable it on a production environment. +ModuleActivatedMayExposeInformation=這個 PHP外掛可能會暴露敏感資料。如果您不需要它,請關閉它。 +ModuleActivatedDoNotUseInProduction=為研發所設計的一個模組已經啟用。請不要在正式生產環境中使用。 CombinationsSeparator=產品組合的分隔符號 SeeLinkToOnlineDocumentation=有關範例,請參見選單上的線上文件連結。 SHOW_SUBPRODUCT_REF_IN_PDF=If the feature "%s" of module %s is used, show details of subproducts of a kit on PDF. AskThisIDToYourBank=請聯絡您的銀行以獲取此ID AdvancedModeOnly=Permision available in Advanced permission mode only ConfFileIsReadableOrWritableByAnyUsers=The conf file is readable or writable by any users. Give permission to web server user and group only. -MailToSendEventOrganization=Event Organization +MailToSendEventOrganization=事件組織 AGENDA_EVENT_DEFAULT_STATUS=Default event status when creating a event from the form -YouShouldDisablePHPFunctions=You should disable PHP functions +YouShouldDisablePHPFunctions=您應該停用 PHP 功能 IfCLINotRequiredYouShouldDisablePHPFunctions=Except if you need to run system commands in custom code, you shoud disable PHP functions PHPFunctionsRequiredForCLI=For shell purpose (like scheduled job backup or running an anitivurs program), you must keep PHP functions -NoWritableFilesFoundIntoRootDir=No writable files or directories of the common programs were found into your root directory (Good) -RecommendedValueIs=Recommended: %s -NotRecommended=Not recommanded -ARestrictedPath=A restricted path -CheckForModuleUpdate=Check for external modules updates +NoWritableFilesFoundIntoRootDir=在您的根目錄中找不到一般程式可寫入的檔案或目錄(好) +RecommendedValueIs=建議:%s +NotRecommended=不建議 +ARestrictedPath=受限路徑 +CheckForModuleUpdate=檢查外部模組更新 CheckForModuleUpdateHelp=This action will connect to editors of external modules to check if a new version is available. -ModuleUpdateAvailable=An update is available -NoExternalModuleWithUpdate=No updates found for external modules +ModuleUpdateAvailable=有可用的更新 +NoExternalModuleWithUpdate=未找到外部模組的更新 SwaggerDescriptionFile=Swagger API description file (for use with redoc for example) YouEnableDeprecatedWSAPIsUseRESTAPIsInstead=You enabled deprecated WS API. You should use REST API instead. -RandomlySelectedIfSeveral=Randomly selected if several pictures are available -DatabasePasswordObfuscated=Database password is obfuscated in conf file -DatabasePasswordNotObfuscated=Database password is NOT obfuscated in conf file +RandomlySelectedIfSeveral=有多張圖片時隨機選擇 +DatabasePasswordObfuscated=資料庫密碼在conf檔案中為加密 +DatabasePasswordNotObfuscated=資料庫密碼在conf檔案中不是加密 +APIsAreNotEnabled=未啟用 API 模組 diff --git a/htdocs/langs/zh_TW/agenda.lang b/htdocs/langs/zh_TW/agenda.lang index 9b4f589916b..0995ebd2ab4 100644 --- a/htdocs/langs/zh_TW/agenda.lang +++ b/htdocs/langs/zh_TW/agenda.lang @@ -4,7 +4,7 @@ Actions=事件 Agenda=應辦事項 TMenuAgenda=應辦事項 Agendas=應辦事項 -LocalAgenda=Default calendar +LocalAgenda=預設行事曆 ActionsOwnedBy=事件承辦人 ActionsOwnedByShort=承辦人 AffectedTo=指定給 @@ -20,7 +20,7 @@ MenuToDoActions=全部未完成事件 MenuDoneActions=全部已停止事件 MenuToDoMyActions=我的未完成事件 MenuDoneMyActions=我的已停止事件 -ListOfEvents=List of events (default calendar) +ListOfEvents=事件清單(預設行事曆) ActionsAskedBy=誰的事件報表 ActionsToDoBy=事件指定給 ActionsDoneBy=由誰完成事件 @@ -38,7 +38,7 @@ ActionsEvents=Dolibarr 會在待辦事項中自動建立行動事件 EventRemindersByEmailNotEnabled=電子郵件事件提醒未在%s模組設定中啟用。 ##### Agenda event labels ##### NewCompanyToDolibarr=合作方 %s 已建立 -COMPANY_MODIFYInDolibarr=Third party %s modified +COMPANY_MODIFYInDolibarr= 合作方%s已變更 COMPANY_DELETEInDolibarr=合作方%s已刪除 ContractValidatedInDolibarr=合約 %s 已驗證 CONTRACT_DELETEInDolibarr=合約%s已刪除 @@ -88,7 +88,7 @@ OrderDeleted=訂單已刪除 InvoiceDeleted=發票已刪除 DraftInvoiceDeleted=發票草稿已刪除 CONTACT_CREATEInDolibarr=聯絡人%s已建立 -CONTACT_MODIFYInDolibarr=Contact %s modified +CONTACT_MODIFYInDolibarr=聯絡人%s已變更 CONTACT_DELETEInDolibarr=聯絡人%s已刪除 PRODUCT_CREATEInDolibarr=產品 %s 已建立 PRODUCT_MODIFYInDolibarr=產品 %s 已修改 @@ -121,7 +121,7 @@ MRP_MO_UNVALIDATEInDolibarr=MO已設定為草稿狀態 MRP_MO_PRODUCEDInDolibarr=MO已生產 MRP_MO_DELETEInDolibarr=MO已刪除 MRP_MO_CANCELInDolibarr=MO已取消 -PAIDInDolibarr=%s paid +PAIDInDolibarr=%s已付款 ##### End agenda events ##### AgendaModelModule=事件的文件範本 DateActionStart=開始日期 @@ -133,7 +133,7 @@ AgendaUrlOptions4=logint = %s將限制輸出分配給用戶%s ( AgendaUrlOptionsProject=project=PROJECT_ID 將限制輸出為已連結專案操作 PROJECT_ID. AgendaUrlOptionsNotAutoEvent=notactiontype = systemauto排除自動事件。 AgendaUrlOptionsIncludeHolidays=設定includeholidays=1以包括假期活動。 -AgendaShowBirthdayEvents=Birthdays of contacts +AgendaShowBirthdayEvents=聯絡人生日 AgendaHideBirthdayEvents=隱藏連絡人生日 Busy=忙錄 ExportDataset_event1=待辦行程事件清單 diff --git a/htdocs/langs/zh_TW/boxes.lang b/htdocs/langs/zh_TW/boxes.lang index d093fea93e2..2d7399e21f9 100644 --- a/htdocs/langs/zh_TW/boxes.lang +++ b/htdocs/langs/zh_TW/boxes.lang @@ -18,13 +18,13 @@ BoxLastActions=最新活動 BoxLastContracts=最新合約 BoxLastContacts=最新通訊錄/地址 BoxLastMembers=最新會員 -BoxLastModifiedMembers=Latest modified members -BoxLastMembersSubscriptions=Latest member subscriptions +BoxLastModifiedMembers=最新已修改會員 +BoxLastMembersSubscriptions=最新會員訂閱 BoxFicheInter=最新干預 BoxCurrentAccounts=開啟帳戶餘額 BoxTitleMemberNextBirthdays=本月生日(會員) -BoxTitleMembersByType=Members by type -BoxTitleMembersSubscriptionsByYear=Members Subscriptions by year +BoxTitleMembersByType=依類型會員 +BoxTitleMembersSubscriptionsByYear=依年份會員訂閱 BoxTitleLastRssInfos=來自%s的最新%s筆消息 BoxTitleLastProducts=產品/服務:最新%s筆已修改 BoxTitleProductsAlertStock=產品:庫存警報 @@ -32,8 +32,8 @@ BoxTitleLastSuppliers=最新%s位已記錄供應商 BoxTitleLastModifiedSuppliers=供應商:最新的%s位已修改 BoxTitleLastModifiedCustomers=客戶:最新%s位已修改 BoxTitleLastCustomersOrProspects=最新%s位客戶或潛在方 -BoxTitleLastCustomerBills=最近%s修改的客戶發票 -BoxTitleLastSupplierBills=最近%s修改的供應商發票 +BoxTitleLastCustomerBills=最新%s張已修改客戶發票 +BoxTitleLastSupplierBills=最新%s張已修改的供應商發票 BoxTitleLastModifiedProspects=潛在方:最新%s位已修改 BoxTitleLastModifiedMembers=最新%s位會員 BoxTitleLastFicheInter=最新%s筆已修改干預措施 @@ -46,11 +46,11 @@ BoxMyLastBookmarks=書籤:最新%s筆 BoxOldestExpiredServices=最舊的活動已過期服務 BoxLastExpiredServices=具有活動已過期服務的最新%s位最早聯絡人 BoxTitleLastActionsToDo=最新%s次動作 -BoxTitleLastContracts=Latest %s contracts which were modified -BoxTitleLastModifiedDonations=Latest %s donations which were modified -BoxTitleLastModifiedExpenses=Latest %s expense reports which were modified -BoxTitleLatestModifiedBoms=Latest %s BOMs which were modified -BoxTitleLatestModifiedMos=Latest %s Manufacturing Orders which were modified +BoxTitleLastContracts=最新%s位聯絡人已修改 +BoxTitleLastModifiedDonations=最新%s筆捐款已修改 +BoxTitleLastModifiedExpenses=最新%s筆費用報表已修改 +BoxTitleLatestModifiedBoms=最新%s筆BOM已修改 +BoxTitleLatestModifiedMos=最新%s筆生產訂單已修改 BoxTitleLastOutstandingBillReached=超過最大未償還額的客戶 BoxGlobalActivity=全球活動(發票、提案/建議書、訂單) BoxGoodCustomers=好客戶 @@ -112,9 +112,9 @@ BoxTitleLastCustomerShipments=最新%s筆客戶發貨 NoRecordedShipments=沒有已記錄的客戶發貨 BoxCustomersOutstandingBillReached=達到最大客戶數 # Pages -UsersHome=Home users and groups -MembersHome=Home Membership -ThirdpartiesHome=Home Thirdparties -TicketsHome=Home Tickets -AccountancyHome=Home Accountancy +UsersHome=使用者與群組首頁 +MembersHome=會員首頁 +ThirdpartiesHome=合作方首頁 +TicketsHome=服務單首頁 +AccountancyHome=會計首頁 ValidatedProjects=已驗證的專案 diff --git a/htdocs/langs/zh_TW/cashdesk.lang b/htdocs/langs/zh_TW/cashdesk.lang index 76a92cdbec5..62c009bf199 100644 --- a/htdocs/langs/zh_TW/cashdesk.lang +++ b/htdocs/langs/zh_TW/cashdesk.lang @@ -41,8 +41,8 @@ Floor=樓 AddTable=新增表格 Place=地點 TakeposConnectorNecesary=需要“ TakePOS連接器” -OrderPrinters=Add a button to send the order to some given printers, without payment (for example to send an order to a kitchen) -NotAvailableWithBrowserPrinter=Not available when printer for receipt is set to browser: +OrderPrinters=增加一個按鈕將訂單傳送到某些特定的印表機,無需付款(例如將訂單傳送到廚房) +NotAvailableWithBrowserPrinter=當收據印表機設定為瀏覽器時不可用: SearchProduct=搜尋商品 Receipt=收據 Header=頁首 @@ -57,9 +57,9 @@ Paymentnumpad=輸入付款的便籤類型 Numberspad=號碼便籤 BillsCoinsPad=硬幣和紙幣便籤 DolistorePosCategory=用於Dolibarr的TakePOS模組與其他POS解決方案 -TakeposNeedsCategories=TakePOS needs at least one product categorie to work -TakeposNeedsAtLeastOnSubCategoryIntoParentCategory=TakePOS needs at least 1 product category under the category %s to work -OrderNotes=Can add some notes to each ordered items +TakeposNeedsCategories=TakePOS 需要至少一個產品類別才能正常使用 +TakeposNeedsAtLeastOnSubCategoryIntoParentCategory=TakePOS 需要在類別 %s 下至少有 1 個產品類別才能正常使用 +OrderNotes=可以為每個訂購的項目增加一些註解 CashDeskBankAccountFor=用於付款的預設帳戶 NoPaimementModesDefined=在 TakePOS 設定中未定義付款方式 TicketVatGrouped=按銷售單中的費率合計營業稅 @@ -84,7 +84,7 @@ InvoiceIsAlreadyValidated=發票已通過驗證 NoLinesToBill=無計費項目 CustomReceipt=自訂收據 ReceiptName=收據名稱 -ProductSupplements=Manage supplements of products +ProductSupplements=管理產品的補充 SupplementCategory=補充品類別 ColorTheme=顏色主題 Colorful=彩色 @@ -94,7 +94,7 @@ Browser=瀏覽器 BrowserMethodDescription=簡易列印收據。僅需幾個參數即可設定收據。通過瀏覽器列印。 TakeposConnectorMethodDescription=具有附加功能的外部模組。可以從雲端列印。 PrintMethod=列印方式 -ReceiptPrinterMethodDescription=Powerful method with a lot of parameters. Full customizable with templates. The server hosting the application can't be in the Cloud (must be able to reach the printers in your network). +ReceiptPrinterMethodDescription=具有大量參數的強大方法。完全可定制的模板。程式的伺服器不能位於雲端當中(必須能夠使用您網路中的印表機)。 ByTerminal=依照站台 TakeposNumpadUsePaymentIcon=在小鍵盤的付款按鈕上使用圖示而不是文字 CashDeskRefNumberingModules=POS銷售編號模組 @@ -102,7 +102,7 @@ CashDeskGenericMaskCodes6 =
    {TN} 標籤用於增加站台 TakeposGroupSameProduct=群組相同產品線 StartAParallelSale=開啟新的平行銷售 SaleStartedAt=銷售開始於%s -ControlCashOpening=Open the "Control cash" popup when opening the POS +ControlCashOpening=開啟POS時跳出"控制收銀" CloseCashFence=關閉收銀台控制 CashReport=現金報告 MainPrinterToUse=要使用的主印表機 @@ -126,5 +126,5 @@ ModuleReceiptPrinterMustBeEnabled=必須先啟用收據印表機模組 AllowDelayedPayment=允許延遲付款 PrintPaymentMethodOnReceipts=在收據上列印付款方式 WeighingScale=秤重 -ShowPriceHT = Display the column with the price excluding tax (on screen) -ShowPriceHTOnReceipt = Display the column with the price excluding tax (on receipt) +ShowPriceHT = 顯示不包含稅金的欄位(在畫面中) +ShowPriceHTOnReceipt = 顯示不包含稅金的欄位(在發票/收據中) diff --git a/htdocs/langs/zh_TW/companies.lang b/htdocs/langs/zh_TW/companies.lang index 53a11b64ace..4fa44fbc166 100644 --- a/htdocs/langs/zh_TW/companies.lang +++ b/htdocs/langs/zh_TW/companies.lang @@ -179,7 +179,7 @@ ProfId1FR=Prof Id 1 (SIREN) ProfId2FR=Prof Id 2 (SIRET) ProfId3FR=Prof Id 3 (NAF, old APE) ProfId4FR=Prof Id 4 (RCS/RM) -ProfId5FR=Prof Id 5 (numéro EORI) +ProfId5FR=專業ID5(歐盟增值稅號EORI) ProfId6FR=- ProfId1ShortFR=SIREN ProfId2ShortFR=SIRET @@ -331,7 +331,7 @@ CustomerCodeDesc=客戶代碼,每個客戶都有一個號碼 SupplierCodeDesc=供應商代碼,每個供應商都有一個號碼 RequiredIfCustomer=若合作方屬於客戶或潛在方,則必需填入 RequiredIfSupplier=若合作方是供應商,則必需填入 -ValidityControledByModule=Validity controlled by the module +ValidityControledByModule=已確定由模組控制 ThisIsModuleRules=此模組的規則 ProspectToContact=需聯絡的潛在方 CompanyDeleted=已從資料庫中刪除“%s”公司。 @@ -439,7 +439,7 @@ ListSuppliersShort=供應商清單 ListProspectsShort=潛在方清單 ListCustomersShort=客戶清單 ThirdPartiesArea=合作方/通訊錄 -LastModifiedThirdParties=Latest %s Third Parties which were modified +LastModifiedThirdParties=最新已修改合作方%s UniqueThirdParties=Total number of Third Parties InActivity=開放 ActivityCeased=關閉 diff --git a/htdocs/langs/zh_TW/compta.lang b/htdocs/langs/zh_TW/compta.lang index 7182e21ce6d..cde0f870a95 100644 --- a/htdocs/langs/zh_TW/compta.lang +++ b/htdocs/langs/zh_TW/compta.lang @@ -65,7 +65,7 @@ LT2SupplierIN=SGST購買品 VATCollected=已收取營業稅 StatusToPay=付款 SpecialExpensesArea=所有特殊付款區域 -VATExpensesArea=Area for all TVA payments +VATExpensesArea=TVA 付款區域 SocialContribution=社會稅或財政稅 SocialContributions=社會稅或財政稅 SocialContributionsDeductibles=可抵扣的社會稅或財政稅 @@ -86,7 +86,7 @@ PaymentCustomerInvoice=客戶發票付款 PaymentSupplierInvoice=供應商發票付款 PaymentSocialContribution=社會/財政稅款付款 PaymentVat=營業稅付款 -AutomaticCreationPayment=Automatically record the payment +AutomaticCreationPayment=自動記錄付款 ListPayment=付款清單 ListOfCustomerPayments=客戶付款清單 ListOfSupplierPayments=供應商付款清單 @@ -135,7 +135,7 @@ NewCheckReceipt=新折扣 NewCheckDeposit=新的支票存款 NewCheckDepositOn=建立帳戶存款收據:%s NoWaitingChecks=沒有支票等待存入。 -DateChequeReceived=Check receiving date +DateChequeReceived=確認收到日期 NbOfCheques=支票數量 PaySocialContribution=支付社會/財政稅 PayVAT=支付稅金申報 @@ -146,9 +146,9 @@ ConfirmPaySalary=您確定要將此薪資卡分類為已付款嗎? DeleteSocialContribution=刪除社會或財政稅金 DeleteVAT=刪除稅金申報 DeleteSalary=刪除薪資卡 -ConfirmDeleteSocialContribution=Are you sure you want to delete this social/fiscal tax payment ? -ConfirmDeleteVAT=Are you sure you want to delete this VAT declaration ? -ConfirmDeleteSalary=Are you sure you want to delete this salary? +ConfirmDeleteSocialContribution=您確定要刪除此社會/財政稅款嗎? +ConfirmDeleteVAT=您確定要刪除此增值稅申報單嗎? +ConfirmDeleteSalary=您確定要刪除此薪資嗎? ExportDataset_tax_1=社會和財政稅金及繳稅 CalcModeVATDebt=%s承諾會計營業稅%s模式. CalcModeVATEngagement=%s收入-支出營業稅%s模式. @@ -250,7 +250,7 @@ ACCOUNTING_ACCOUNT_SUPPLIER=供應商合作方使用的會計科目 ACCOUNTING_ACCOUNT_SUPPLIER_Desc=合作方卡上定義的專用會計科目將僅用於子帳會計。如果未定義第三方的專用供應商會計科目,則此科目將用於“總帳”,並作為“子帳”會計的預設值。 ConfirmCloneTax=確認複製社會/財政稅 ConfirmCloneVAT=確認複製稅金申報 -ConfirmCloneSalary=Confirm the clone of a salary +ConfirmCloneSalary=確認複製薪資 CloneTaxForNextMonth=為下個月複製此稅 SimpleReport=簡易報告 AddExtraReport=其他報告(增加外國和國家客戶報告) @@ -269,7 +269,7 @@ AccountingAffectation=會計分配 LastDayTaxIsRelatedTo=稅期的最後一天 VATDue=要求營業稅 ClaimedForThisPeriod=要求的期間 -PaidDuringThisPeriod=Paid for this period +PaidDuringThisPeriod=本期支付 PaidDuringThisPeriodDesc=This is the sum of all payments linked to VAT declarations which have an end-of-period date in the selected date range ByVatRate=依營業稅率 TurnoverbyVatrate=依營業稅率開票的營業額 @@ -286,9 +286,9 @@ ReportPurchaseTurnover=已開票營業額 ReportPurchaseTurnoverCollected=採購營業額 IncludeVarpaysInResults = 在報告中包括各種付款 IncludeLoansInResults = 在報告中包括貸款 -InvoiceLate30Days = Invoices late > 30 days -InvoiceLate15Days = Invoices late > 15 days -InvoiceLateMinus15Days = Invoices late +InvoiceLate30Days = 發票延遲 > 30 天 +InvoiceLate15Days = 發票延遲 > 15 天 +InvoiceLateMinus15Days = 發票延遲 InvoiceNotLate = To be collected < 15 days InvoiceNotLate15Days = To be collected in 15 days InvoiceNotLate30Days = To be collected in 30 days diff --git a/htdocs/langs/zh_TW/deliveries.lang b/htdocs/langs/zh_TW/deliveries.lang index 489be238c4e..6d6c7d15554 100644 --- a/htdocs/langs/zh_TW/deliveries.lang +++ b/htdocs/langs/zh_TW/deliveries.lang @@ -30,3 +30,4 @@ NonShippable=無法運送 ShowShippableStatus=顯示可運送狀態 ShowReceiving=顯示交貨單 NonExistentOrder=不存在的訂單 +StockQuantitiesAlreadyAllocatedOnPreviousLines = 已在先前的行上分配庫存數量 diff --git a/htdocs/langs/zh_TW/errors.lang b/htdocs/langs/zh_TW/errors.lang index 2b1162b14e3..2448ae31222 100644 --- a/htdocs/langs/zh_TW/errors.lang +++ b/htdocs/langs/zh_TW/errors.lang @@ -4,14 +4,14 @@ NoErrorCommitIsDone=我們保證沒有錯誤 # Errors ErrorButCommitIsDone=發現錯誤,但儘管如此我們仍進行驗證 -ErrorBadEMail=Email %s is incorrect -ErrorBadMXDomain=Email %s seems incorrect (domain has no valid MX record) -ErrorBadUrl=Url %s is incorrect +ErrorBadEMail=電子郵件 %s 不正確 +ErrorBadMXDomain=電子郵件 %s 似乎不正確(網域沒有有效的 MX 記錄) +ErrorBadUrl=網址 %s 不正確 ErrorBadValueForParamNotAString=您的參數值錯誤。一般在轉譯遺失時產生。 -ErrorRefAlreadyExists=Reference %s already exists. +ErrorRefAlreadyExists=參考%s已經存在。 ErrorLoginAlreadyExists=登入者%s已經存在。 ErrorGroupAlreadyExists=群組%s已經存在。 -ErrorEmailAlreadyExists=Email %s already exists. +ErrorEmailAlreadyExists=電子郵件 %s 已存在。 ErrorRecordNotFound=記錄沒有找到。 ErrorFailToCopyFile=無法將檔案'%s'複製到'%s' ErrorFailToCopyDir=無法將資料夾'%s' 複製到'%s'. @@ -39,7 +39,7 @@ ErrorBadSupplierCodeSyntax=供應商代碼語法錯誤 ErrorSupplierCodeRequired=需要供應商代碼 ErrorSupplierCodeAlreadyUsed=供應商代碼已使用 ErrorBadParameters=錯誤的參數 -ErrorWrongParameters=Wrong or missing parameters +ErrorWrongParameters=錯誤或缺少參數 ErrorBadValueForParameter=參數"%s"中的錯誤值 "%s'" ErrorBadImageFormat=圖片檔案格式不支援(您的PHP不支援轉換此格式圖片) ErrorBadDateFormat="%s"日期格式錯誤 @@ -47,11 +47,11 @@ ErrorWrongDate=日期不正確! ErrorFailedToWriteInDir=無法寫入資料夾%s ErrorFoundBadEmailInFile=找到電子郵件文件中的%s行語法不正確(例如電子郵件%s行 =%s) ErrorUserCannotBeDelete=無法刪除用戶。也許它與Dolibarr實體相關。 -ErrorFieldsRequired=Some required fields have been left blank. -ErrorSubjectIsRequired=The email subject is required +ErrorFieldsRequired=一些必填欄位已留空。 +ErrorSubjectIsRequired=電子郵件主題為必填 ErrorFailedToCreateDir=無法建立資料夾。檢查網頁伺服器中的用戶有權限寫入Dolibarr檔案資料夾。如果PHP使用了參數safe_mode,檢查網頁伺服器的用戶(或群組)擁有Dolibarr php檔案。 ErrorNoMailDefinedForThisUser=沒有此用戶的定義郵件 -ErrorSetupOfEmailsNotComplete=Setup of emails is not complete +ErrorSetupOfEmailsNotComplete=電子郵件設定未完成 ErrorFeatureNeedJavascript=此功能需要啟動Javascript。需要變更請前往設定 - 顯示。 ErrorTopMenuMustHaveAParentWithId0=一個類型'頂部'選單不能有一個母選單。在母選單填入0或選擇一個類型為'左'的選單。 ErrorLeftMenuMustHaveAParentId=一個類型為'左'的選單必須有一個母選單的ID。 @@ -60,7 +60,7 @@ ErrorDirNotFound=未找到資料夾%s(錯誤的路徑,錯誤的權限 ErrorFunctionNotAvailableInPHP=此功能需要函數%s,但是無法在此PHP版本中使用。 ErrorDirAlreadyExists=具有此名稱的資料夾已經存在。 ErrorFileAlreadyExists=具有此名稱的檔案已經存在。 -ErrorDestinationAlreadyExists=Another file with the name %s already exists. +ErrorDestinationAlreadyExists=檔案名稱%s已存在 ErrorPartialFile=伺服器未完整的收到檔案。 ErrorNoTmpDir=臨時指示%s不存在。 ErrorUploadBlockedByAddon=PHP / Apache的插件已阻擋上傳。 @@ -80,7 +80,7 @@ ErrorExportDuplicateProfil=此匯出設定已存在此設定檔案名稱。 ErrorLDAPSetupNotComplete=Dolibarr與LDAP的匹配不完整。 ErrorLDAPMakeManualTest=.ldif檔案已在資料夾%s中.請以命令行手動讀取以得到更多的錯誤信息。 ErrorCantSaveADoneUserWithZeroPercentage=如果填寫了“完成者”欄位,則無法使用“狀態未開始”保存操作。 -ErrorRefAlreadyExists=Reference %s already exists. +ErrorRefAlreadyExists=參考%s已經存在。 ErrorPleaseTypeBankTransactionReportName=請輸入必須在報告條目中的銀行對帳單名稱(格式YYYYMM或YYYYMMDD) ErrorRecordHasChildren=因為有子記錄所以刪除失敗。 ErrorRecordHasAtLeastOneChildOfType=項目至少有一個子類別%s @@ -118,7 +118,7 @@ ErrorCantReadFile=無法讀取檔案'%s' ErrorCantReadDir=無法讀取資料夾'%s' ErrorBadLoginPassword=錯誤的帳號或密碼 ErrorLoginDisabled=您的帳戶已被停用 -ErrorFailedToRunExternalCommand=Failed to run external command. Check it is available and runnable by your PHP server user. Check also the command is not protected on shell level by a security layer like apparmor. +ErrorFailedToRunExternalCommand=無法執行外部命令。檢查它是可用並且可執行在PHP的伺服器上。同樣地請確認此命令在Shell層級中不被如apparmor的安全層級保護。 ErrorFailedToChangePassword=無法更改密碼 ErrorLoginDoesNotExists=找不到登入名稱%s的用戶。 ErrorLoginHasNoEmail=這位用戶沒有電子郵件地址。程序中止。 @@ -141,8 +141,8 @@ ErrorNewValueCantMatchOldValue=新值不能等於舊值 ErrorFailedToValidatePasswordReset=重置密碼失敗。可能是重新初始化已經完成(此連結只能使用一次)。如果不是,請嘗試再重置密碼一次。 ErrorToConnectToMysqlCheckInstance=連結資料庫失敗。檢查資料庫伺服器是否正在執行(例如mysql / mariadb,您可以使用“ sudo service mysql start”命令行啟動它)。 ErrorFailedToAddContact=新增聯絡人失敗 -ErrorDateMustBeBeforeToday=The date must be lower than today -ErrorDateMustBeInFuture=The date must be greater than today +ErrorDateMustBeBeforeToday=日期必須早於今天 +ErrorDateMustBeInFuture=日期必須晚於今天 ErrorPaymentModeDefinedToWithoutSetup=付款方式已設定為%s類型,但模組“發票”尚未完整定義要為此付款方式顯示的資訊設定。 ErrorPHPNeedModule=錯誤,您的PHP必須安裝模組%s才能使用此功能。 ErrorOpenIDSetupNotComplete=您設定了Dolibarr設定檔案以允許OpenID身份驗證,但未將OpenID的服務網址定義為常數%s @@ -221,15 +221,15 @@ ErrorChooseBetweenFreeEntryOrPredefinedProduct=您必須選擇商品是否為預 ErrorDiscountLargerThanRemainToPaySplitItBefore=您嘗試使用的折扣大於剩餘的折扣。將之前的折扣分成2個較小的折扣。 ErrorFileNotFoundWithSharedLink=找不到檔案。可能是共享金鑰最近被修改或檔案被刪除了。 ErrorProductBarCodeAlreadyExists=產品條碼%s已存在於另一個產品參考上。 -ErrorNoteAlsoThatSubProductCantBeFollowedByLot=Note also that using kits to have auto increase/decrease of subproducts is not possible when at least one subproduct (or subproduct of subproducts) needs a serial/lot number. +ErrorNoteAlsoThatSubProductCantBeFollowedByLot=請注意使用Kit時,如果一個子產品(或子產品的子產品)需要序號/批號時,無法自動增加/減少子產品。 ErrorDescRequiredForFreeProductLines=對於帶有免費產品的行,必須進行描述說明 ErrorAPageWithThisNameOrAliasAlreadyExists=此頁面/容器%s與您嘗試使用的名稱/別名相同 ErrorDuringChartLoad=載入會計科目表時出錯。如果幾個帳戶沒有被載入,您仍然可以手動輸入。 ErrorBadSyntaxForParamKeyForContent=參數keyforcontent的語法錯誤。必須具有以%s或%s開頭的值 ErrorVariableKeyForContentMustBeSet=錯誤,必須設定名稱為%s(帶有文字內容)或%s(帶有外部網址)的常數。 -ErrorURLMustEndWith=URL %s must end %s +ErrorURLMustEndWith=網址 %s 必須以 %s 結尾 ErrorURLMustStartWithHttp=網址 %s 必須以 http://或https://開始 -ErrorHostMustNotStartWithHttp=Host name %s must NOT start with http:// or https:// +ErrorHostMustNotStartWithHttp=主機名稱 %s 不能以 http:// 或 https:// 開頭 ErrorNewRefIsAlreadyUsed=錯誤,新參考已被使用 ErrorDeletePaymentLinkedToAClosedInvoiceNotPossible=錯誤,無法刪除連結到已關閉發票的付款。 ErrorSearchCriteriaTooSmall=搜尋條件太小。 @@ -247,23 +247,23 @@ ErrorBatchNoFoundEnoughQuantityForProductInWarehouse=倉庫“ %s”中產品“ ErrorOnlyOneFieldForGroupByIsPossible=“群組依據”只能使用1個欄位(其他欄位則被丟棄) ErrorTooManyDifferentValueForSelectedGroupBy=為欄位“ %s ”發現了太多不同的值(多於 %s ),因此我們不能將其用作“分組依據”。 “分組依據”欄位已刪除。也許您想將其用作X軸? ErrorReplaceStringEmpty=錯誤,要替換的字串為空 -ErrorProductNeedBatchNumber=Error, product '%s' need a lot/serial number -ErrorProductDoesNotNeedBatchNumber=Error, product '%s' does not accept a lot/serial number -ErrorFailedToReadObject=Error, failed to read object of type %s -ErrorParameterMustBeEnabledToAllwoThisFeature=Error, parameter %s must be enabled into conf/conf.php to allow use of Command Line Interface by the internal job scheduler -ErrorLoginDateValidity=Error, this login is outside the validity date range -ErrorValueLength=Length of field '%s' must be higher than '%s' -ErrorReservedKeyword=The word '%s' is a reserved keyword -ErrorNotAvailableWithThisDistribution=Not available with this distribution +ErrorProductNeedBatchNumber=錯誤,產品“ %s ”需要批號/序號 +ErrorProductDoesNotNeedBatchNumber=錯誤,產品“ %s ”不接受批號/序號 +ErrorFailedToReadObject=錯誤,無法讀取 %s 類型的項目 +ErrorParameterMustBeEnabledToAllwoThisFeature=錯誤,必須在 conf/conf.php 中啟用參數%s以允許內部命令列工作排程界面使用 +ErrorLoginDateValidity=錯誤,此登錄超過有效日期範圍 +ErrorValueLength=欄位“ %s ”的長度必須大於“ %s" +ErrorReservedKeyword=單詞“ %s ”是保留關鍵字 +ErrorNotAvailableWithThisDistribution=不適用於此發行版本 ErrorPublicInterfaceNotEnabled=未啟用公共界面 -ErrorLanguageRequiredIfPageIsTranslationOfAnother=The language of new page must be defined if it is set as a translation of another page -ErrorLanguageMustNotBeSourceLanguageIfPageIsTranslationOfAnother=The language of new page must not be the source language if it is set as a translation of another page -ErrorAParameterIsRequiredForThisOperation=A parameter is mandatory for this operation -ErrorDateIsInFuture=Error, the date can't be in the future -ErrorAnAmountWithoutTaxIsRequired=Error, amount is mandatory -ErrorAPercentIsRequired=Error, please fill in the percentage correctly -ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of account -ErrorFailedToFindEmailTemplate=Failed to find template with code name %s +ErrorLanguageRequiredIfPageIsTranslationOfAnother=如果將新頁面設定為其他頁面的翻譯,則必須定義新頁面的語言 +ErrorLanguageMustNotBeSourceLanguageIfPageIsTranslationOfAnother=如果新頁面的語言為另一頁面的翻譯,則該語言不得為來源語言 +ErrorAParameterIsRequiredForThisOperation=此操作必須有一個參數 +ErrorDateIsInFuture=錯誤,日期不能是未來 +ErrorAnAmountWithoutTaxIsRequired=錯誤,金額為必填項目 +ErrorAPercentIsRequired=錯誤,請正確填寫百分比 +ErrorYouMustFirstSetupYourChartOfAccount=您必須先設定會計項目表 +ErrorFailedToFindEmailTemplate=無法找到代號為 %s 的模板 # Warnings WarningParamUploadMaxFileSizeHigherThanPostMaxSize=您的PHP參數upload_max_filesize(%s)高於PHP參數post_max_size(%s)。這不是相同的設定。 @@ -289,15 +289,15 @@ WarningYourLoginWasModifiedPleaseLogin=您的登入名稱已修改。為了安 WarningAnEntryAlreadyExistForTransKey=此語言的翻譯密鑰條目已存在 WarningNumberOfRecipientIsRestrictedInMassAction=警告,在清單上使用批次操作時,其他收件人的數量限制為%s WarningDateOfLineMustBeInExpenseReportRange=警告,行的日期不在費用報告的範圍內 -WarningProjectDraft=Project is still in draft mode. Don't forget to validate it if you plan to use tasks. +WarningProjectDraft=專案仍處於草案模式。如果您計劃使用任務,請不要忘記驗證它。 WarningProjectClosed=專案已關閉。您必須先重新打開它。 WarningSomeBankTransactionByChequeWereRemovedAfter=在產生包括它們的收據之後,一些銀行交易將被刪除。因此支票的數量和收據的數量可能與清單中的數量和總數有所不同。 -WarningFailedToAddFileIntoDatabaseIndex=Warning, failed to add file entry into ECM database index table -WarningTheHiddenOptionIsOn=Warning, the hidden option %s is on. -WarningCreateSubAccounts=Warning, you can't create directly a sub account, you must create a third party or an user and assign them an accounting code to find them in this list -WarningAvailableOnlyForHTTPSServers=Available only if using HTTPS secured connection. -WarningModuleXDisabledSoYouMayMissEventHere=Module %s has not been enabled. So you may miss a lot of event here. -ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary -CheckVersionFail=Version check fail -ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it +WarningFailedToAddFileIntoDatabaseIndex=警告,無法將檔案條目增加到 ECM 資料庫索引表中 +WarningTheHiddenOptionIsOn=警告,隱藏選項 %s 已開啟。 +WarningCreateSubAccounts=警告,您不能直接建立子帳戶,您必須建立合作方或用戶並為其分配會計代碼才能在此清單中找到它們 +WarningAvailableOnlyForHTTPSServers=僅在使用 HTTPS 安全連線時可用。 +WarningModuleXDisabledSoYouMayMissEventHere=模組 %s 尚未啟用。所以你可能會在這裡錯過很多事件。 +ErrorActionCommPropertyUserowneridNotDefined=需要用戶的擁有者 +ErrorActionCommBadType=選擇的事件類型(id:%n,代碼:%s)在事件類型分類中不存在 +CheckVersionFail=版本檢查失敗 +ErrorWrongFileName=檔案名稱中不可以有__SOMETHING__ diff --git a/htdocs/langs/zh_TW/eventorganization.lang b/htdocs/langs/zh_TW/eventorganization.lang index 7db22c3484a..603424ac9b2 100644 --- a/htdocs/langs/zh_TW/eventorganization.lang +++ b/htdocs/langs/zh_TW/eventorganization.lang @@ -17,8 +17,8 @@ # # Generic # -ModuleEventOrganizationName = Event Organization -EventOrganizationDescription = Event Organization through Module Project +ModuleEventOrganizationName = 事件組織 +EventOrganizationDescription = 使用專案模組組織事件 EventOrganizationDescriptionLong= Manage Event organization for conference, attendees, speaker, and attendees, with public subcription page # # Menu @@ -31,7 +31,7 @@ EventOrganizationConferenceOrBoothMenuLeft = Conference Or Booth # EventOrganizationSetup = Event Organization setup Settings = 設定 -EventOrganizationSetupPage = Event Organization setup page +EventOrganizationSetupPage = 事件組織設定頁面 EVENTORGANIZATION_TASK_LABEL = Label of tasks to create automatically when project is validated EVENTORGANIZATION_TASK_LABELTooltip = When you validate an organized event, some tasks can be automatically created in the project

    For example:
    Send Call for Conference
    Send Call for Booth
    Receive call for conferences
    Receive call for Booth
    Open subscriptions to events for attendees
    Send remind of event to speakers
    Send remind of event to Booth hoster
    Send remind of event to attendees EVENTORGANIZATION_CATEG_THIRDPARTY_CONF = Category to add to third-parties automatically created when someone suggests a conference diff --git a/htdocs/langs/zh_TW/exports.lang b/htdocs/langs/zh_TW/exports.lang index 721e44dfde2..13c3a18d0de 100644 --- a/htdocs/langs/zh_TW/exports.lang +++ b/htdocs/langs/zh_TW/exports.lang @@ -53,7 +53,8 @@ TypeOfLineServiceOrProduct=類型(0 =產品,1 =服務) FileWithDataToImport=匯入有資料的檔案 FileToImport=欲匯入的來源檔案 FileMustHaveOneOfFollowingFormat=要匯入的檔案必須是以下格式 -DownloadEmptyExample=下載帶有欄位內容資料的範本檔案(*為必填欄位) +DownloadEmptyExample=Download template file with field content information +StarAreMandatory=* are mandatory fields ChooseFormatOfFileToImport=通過點選%s圖示選擇要匯入的檔案格式... ChooseFileToImport=上傳檔案,然後點擊%s圖示以選擇要匯入的檔案... SourceFileFormat=來源檔案格式 diff --git a/htdocs/langs/zh_TW/holiday.lang b/htdocs/langs/zh_TW/holiday.lang index 72b939ec843..2fcd554e4f3 100644 --- a/htdocs/langs/zh_TW/holiday.lang +++ b/htdocs/langs/zh_TW/holiday.lang @@ -1,5 +1,5 @@ # Dolibarr language file - Source file is en_US - holiday -HRM=人資 +HRM=人力資源 Holidays=休假 CPTitreMenu=休假 MenuReportMonth=月結單 @@ -13,7 +13,7 @@ ToReviewCP=等待批准 ApprovedCP=已批准 CancelCP=已取消 RefuseCP=已拒絕 -ValidatorCP=批准人 +ValidatorCP=Approver ListeCP=休假清單 Leave=休假申請 LeaveId=休假編號 @@ -39,11 +39,11 @@ TitreRequestCP=休假申請 TypeOfLeaveId=休假ID類型 TypeOfLeaveCode=休假代碼類型 TypeOfLeaveLabel=休假標籤類型 -NbUseDaysCP=已休假天數 -NbUseDaysCPHelp=此計算考慮了字典中定義的非工作日和假期。 -NbUseDaysCPShort=已休假天數 -NbUseDaysCPShortInMonth=已休假天數(月) -DayIsANonWorkingDay=%s是非工作日 +NbUseDaysCP=Number of days of leave used +NbUseDaysCPHelp=The calculation takes into account the non-working days and the holidays defined in the dictionary. +NbUseDaysCPShort=Days of leave +NbUseDaysCPShortInMonth=Days of leave in month +DayIsANonWorkingDay=%s is a non-working day DateStartInMonth=開始日期(月份) DateEndInMonth=結束日期(月份) EditCP=編輯 @@ -55,7 +55,7 @@ TitleDeleteCP=刪除休假申請 ConfirmDeleteCP=確認刪除此休假申請嗎? ErrorCantDeleteCP=錯誤,您無權刪除此休假申請。 CantCreateCP=您無權提出休假申請。 -InvalidValidatorCP=您必須為休假申請選擇批准人。 +InvalidValidatorCP=You must choose the approver for your leave request. NoDateDebut=您必須選擇開始日期。 NoDateFin=您必須選擇結束日期。 ErrorDureeCP=您的休假申請不包含工作日。 @@ -80,14 +80,14 @@ UserCP=用戶 ErrorAddEventToUserCP=增加特殊假期時發生錯誤。 AddEventToUserOkCP=特別假期的增加已經完成。 MenuLogCP=檢視變更日誌 -LogCP=可用假期更新日誌 -ActionByCP=執行者 -UserUpdateCP=對於用戶 +LogCP=Log of all updates made to "Balance of Leave" +ActionByCP=更新者 +UserUpdateCP=Updated for PrevSoldeCP=剩餘假期 NewSoldeCP=新剩餘假期 alreadyCPexist=在此期間之休假申請已完成。 -FirstDayOfHoliday=假期的第一天 -LastDayOfHoliday=假期的最後一天 +FirstDayOfHoliday=Beginning day of leave request +LastDayOfHoliday=Ending day of leave request BoxTitleLastLeaveRequests=最新%s筆已修改的休假申請 HolidaysMonthlyUpdate=每月更新 ManualUpdate=手動更新 @@ -99,13 +99,13 @@ LastHolidays=最新%s的休假申請 AllHolidays=所有休假申請 HalfDay=半天 NotTheAssignedApprover=您不是分配的批准人 -LEAVE_PAID=帶薪休假 +LEAVE_PAID=年假 LEAVE_SICK=病假 -LEAVE_OTHER=其他休假 -LEAVE_PAID_FR=帶薪休假 +LEAVE_OTHER=事假 +LEAVE_PAID_FR=年假 ## Configuration du Module ## -LastUpdateCP=假期分配的最新自動更新 -MonthOfLastMonthlyUpdate=假期分配的最新自動月更新 +LastUpdateCP=Last automatic update of leave allocation +MonthOfLastMonthlyUpdate=Month of last automatic update of leave allocation UpdateConfCPOK=已更新成功。 Module27130Name= 休假管理 Module27130Desc= 休假管理 @@ -125,10 +125,10 @@ HolidaysCanceledBody=您從%s到%s的休假申請已被取消。 FollowedByACounter=1:這種類型的休假需有計數器追蹤。計數器手動或自動遞增,並且當休假申請通過驗證後,計數器遞減。
    0:沒有被計數器追蹤。 NoLeaveWithCounterDefined=沒有休假類型被定義成需要被計數器追蹤 GoIntoDictionaryHolidayTypes=前往首頁-設定-字典-休假類型以設定不同類型的休假。 -HolidaySetup=假期模組的設定 -HolidaysNumberingModules=休假申請編號模型 +HolidaySetup=Setup of module Leave +HolidaysNumberingModules=Numbering models for leave requests TemplatePDFHolidays=休假PDF範本 -FreeLegalTextOnHolidays=PDF上的自由正文 -WatermarkOnDraftHolidayCards=休假申請草案上的水印 +FreeLegalTextOnHolidays=PDF上的自由文字 +WatermarkOnDraftHolidayCards=休假申請草案上的浮水印 HolidaysToApprove=可批准假期 NobodyHasPermissionToValidateHolidays=沒有人有權限驗證假期 diff --git a/htdocs/langs/zh_TW/hrm.lang b/htdocs/langs/zh_TW/hrm.lang index 240980f71d7..9a981ea4d89 100644 --- a/htdocs/langs/zh_TW/hrm.lang +++ b/htdocs/langs/zh_TW/hrm.lang @@ -9,7 +9,7 @@ ConfirmDeleteEstablishment=您確定要刪除此營業所嗎? OpenEtablishment=開啟營業所 CloseEtablishment=關閉營業所 # Dictionary -DictionaryPublicHolidays=Leave - Public holidays +DictionaryPublicHolidays=休假 - 公共假期 DictionaryDepartment=HRM-部門清單 DictionaryFunction=人力資源管理-職位 # Module diff --git a/htdocs/langs/zh_TW/languages.lang b/htdocs/langs/zh_TW/languages.lang index e8199dc4fd9..bd3940ba997 100644 --- a/htdocs/langs/zh_TW/languages.lang +++ b/htdocs/langs/zh_TW/languages.lang @@ -3,7 +3,8 @@ Language_am_ET=衣索比亞 Language_ar_AR=阿拉伯語 Language_ar_EG=阿拉伯語(埃及) Language_ar_SA=阿拉伯語 -Language_ar_TN=Arabic (Tunisia) +Language_ar_TN=阿拉伯語(突尼斯) +Language_ar_IQ=阿拉伯語(伊拉克) Language_az_AZ=亞塞拜然 Language_bn_BD=孟加拉語 Language_bn_IN=孟加拉語(印度) @@ -83,9 +84,10 @@ Language_ne_NP=尼泊爾語 Language_nl_BE=荷蘭語(比利時) Language_nl_NL=荷蘭人 Language_pl_PL=波蘭語 +Language_pt_AO=葡萄牙語(安哥拉) Language_pt_BR=葡萄牙語(巴西) Language_pt_PT=葡萄牙語 -Language_ro_MD=Romanian (Moldavia) +Language_ro_MD=羅馬尼亞語(摩爾達維亞) Language_ro_RO=羅馬尼亞語 Language_ru_RU=俄語 Language_ru_UA=俄語(烏克蘭) diff --git a/htdocs/langs/zh_TW/main.lang b/htdocs/langs/zh_TW/main.lang index 911e650e96a..68196c1bc0c 100644 --- a/htdocs/langs/zh_TW/main.lang +++ b/htdocs/langs/zh_TW/main.lang @@ -180,7 +180,7 @@ SaveAndNew=儲存並新增 TestConnection=測試連線 ToClone=複製 ConfirmCloneAsk=您確定要複製物件 %s? -ConfirmClone=Choose the data you want to clone: +ConfirmClone=選擇要複製的資料: NoCloneOptionsSpecified=沒有已定義要複製的資料。 Of=的 Go=前往 @@ -246,7 +246,7 @@ DefaultModel=預設文件範本 Action=事件 About=關於 Number=數量 -NumberByMonth=Total reports by month +NumberByMonth=每月報告總數 AmountByMonth=每月金額 Numero=數量 Limit=限制 @@ -278,7 +278,7 @@ DateModificationShort=修改日 IPModification=修改IP DateLastModification=最新修改日期 DateValidation=驗證日期 -DateSigning=Signing date +DateSigning=簽名日期 DateClosing=關閉日期 DateDue=截止日期 DateValue=值的日期 @@ -341,8 +341,8 @@ KiloBytes=KB MegaBytes=MB GigaBytes=GB TeraBytes=TB -UserAuthor=Ceated by -UserModif=Updated by +UserAuthor=建立者 +UserModif=更新者 b=b. Kb=Kb Mb=Mb @@ -362,7 +362,7 @@ UnitPriceHTCurrency=單價(不含)(貨幣) UnitPriceTTC=單位價格 PriceU=單價 PriceUHT=單價(淨) -PriceUHTCurrency=U.P (net) (currency) +PriceUHTCurrency=U.P(淨值)(貨幣) PriceUTTC=單價(含稅) Amount=金額 AmountInvoice=發票金額 @@ -390,8 +390,8 @@ AmountTotal=總金額 AmountAverage=平均金額 PriceQtyMinHT=最小數量價格(不含稅) PriceQtyMinHTCurrency=最小數量價格(不含稅)(貨幣) -PercentOfOriginalObject=Percent of original object -AmountOrPercent=Amount or percent +PercentOfOriginalObject=原始項目的百分比 +AmountOrPercent=金額或百分比 Percentage=百分比 Total=總計 SubTotal=小計 @@ -430,7 +430,7 @@ LT1IN=CGST LT2IN=SGST LT1GC=附加美分 VATRate=稅率 -RateOfTaxN=Rate of tax %s +RateOfTaxN=稅率%s VATCode=稅率代碼 VATNPR=NPR 稅率 DefaultTaxRate=預設稅率 @@ -730,8 +730,8 @@ MenuMembers=會員 MenuAgendaGoogle=Google 行事曆 MenuTaxesAndSpecialExpenses=稅金|特別費用 ThisLimitIsDefinedInSetup=Dolibarr 的限制(選單 首頁 - 設定 - 安全): %s Kb, PHP的限制:%s Kb -ThisLimitIsDefinedInSetupAt=Dolibarr limit (Menu %s): %s Kb, PHP limit (Param %s): %s Kb -NoFileFound=No documents uploaded +ThisLimitIsDefinedInSetupAt=Dolibarr限制 (選單%s): %s Kb, PHP限制(參數 %s): %s Kb +NoFileFound=沒有上傳文件 CurrentUserLanguage=目前語言 CurrentTheme=目前主題 CurrentMenuManager=目前選單管理器 @@ -847,7 +847,7 @@ XMoreLines=%s 行(數)被隱藏 ShowMoreLines=顯示更多/更少行數 PublicUrl=公開網址 AddBox=增加盒子 -SelectElementAndClick=Select an element and click on %s +SelectElementAndClick=選擇一個元件並且點選%s PrintFile=列印檔案 %s ShowTransaction=在銀行帳戶中顯示交易 ShowIntervention=顯示干預 @@ -858,8 +858,8 @@ Denied=已拒絕 ListOf=%s 清單 ListOfTemplates=範本清單 Gender=性別 -Genderman=Male -Genderwoman=Female +Genderman=男性 +Genderwoman=女性 Genderother=其他 ViewList=檢視清單 ViewGantt=甘特圖 @@ -906,10 +906,10 @@ ViewAccountList=檢視總帳 ViewSubAccountList=檢視子帳戶總帳 RemoveString=移除字串‘%s’ SomeTranslationAreUncomplete=提供的某些語言可能僅被部分翻譯,或者可能包含錯誤。請通過註冊https://transifex.com/projects/p/dolibarr/來進行改進,以幫助修正您的語言。 -DirectDownloadLink=Public download link -PublicDownloadLinkDesc=Only the link is required to download the file -DirectDownloadInternalLink=Private download link -PrivateDownloadLinkDesc=You need to be logged and you need permissions to view or download the file +DirectDownloadLink=公共下載連結 +PublicDownloadLinkDesc=只需要連結即可下載檔案 +DirectDownloadInternalLink=私人下載連結 +PrivateDownloadLinkDesc=您需要登錄,並且需要有查看或下載檔案的權限 Download=下載 DownloadDocument=下載文件 ActualizeCurrency=更新匯率 @@ -1022,7 +1022,7 @@ SearchIntoContacts=通訊錄 SearchIntoMembers=會員 SearchIntoUsers=用戶 SearchIntoProductsOrServices=產品或服務 -SearchIntoBatch=Lots / Serials +SearchIntoBatch=批號/序號 SearchIntoProjects=專案 SearchIntoMO=製造訂單 SearchIntoTasks=任務 @@ -1059,13 +1059,13 @@ KeyboardShortcut=快捷鍵 AssignedTo=指定人 Deletedraft=刪除草稿 ConfirmMassDraftDeletion=草稿批次刪除確認 -FileSharedViaALink=File shared with a public link +FileSharedViaALink=通過公共連結共享的檔案 SelectAThirdPartyFirst=先選擇合作方(客戶/供應商)... YouAreCurrentlyInSandboxMode=您目前在 %s "沙盒" 模式 Inventory=庫存 AnalyticCode=分析代碼 TMenuMRP=製造資源計劃(MRP) -ShowCompanyInfos=Show company infos +ShowCompanyInfos=顯示公司資訊 ShowMoreInfos=顯示更多信息 NoFilesUploadedYet=請先上傳文件 SeePrivateNote=查看私人筆記 @@ -1074,7 +1074,7 @@ ValidFrom=有效期自 ValidUntil=有效期至 NoRecordedUsers=無使用者 ToClose=關閉 -ToRefuse=To refuse +ToRefuse=拒絕 ToProcess=處理 ToApprove=核准 GlobalOpenedElemView=全域顯示 @@ -1129,11 +1129,11 @@ UpdateForAllLines=更新所有行 OnHold=On hold Civility=稱謂或頭銜 AffectTag=影響標籤 -CreateExternalUser=Create external user +CreateExternalUser=建立外部用戶 ConfirmAffectTag=批量標籤影響 ConfirmAffectTagQuestion=您確定要影響對%s所選記錄的標籤嗎? CategTypeNotFound=找不到記錄類型的標籤類型 -CopiedToClipboard=Copied to clipboard -InformationOnLinkToContract=This amount is only the total of all the lines of the contract. No notion of time is taken into consideration. -ConfirmCancel=Are you sure you want to cancel -EmailMsgID=Email MsgID +CopiedToClipboard=複製到剪貼簿 +InformationOnLinkToContract=這個金額只是合約所有行的總和。沒有考慮時間的因素。 +ConfirmCancel=您確定要取消? +EmailMsgID=電子郵件訊息 ID diff --git a/htdocs/langs/zh_TW/margins.lang b/htdocs/langs/zh_TW/margins.lang index b3cc74b2402..dc68a99e36a 100644 --- a/htdocs/langs/zh_TW/margins.lang +++ b/htdocs/langs/zh_TW/margins.lang @@ -22,7 +22,7 @@ ProductService=產品或服務 AllProducts=所有產品和服務 ChooseProduct/Service=選擇產品或服務 ForceBuyingPriceIfNull=如果未定義,強制將買入/成本價轉換為賣價 -ForceBuyingPriceIfNullDetails=If buying/cost price not provided when we add a new line, and this option is "ON", the margin will be 0 on the new line (buying/cost price = selling price). If this option is "OFF" (recommended), margin will be equal to the value suggested by default (and may be 100% if no default value can be found). +ForceBuyingPriceIfNullDetails=如果我們增加新行時未提供買入/成本價,且此選項為“ON”,則新行的利潤將為 0(買入/成本價 = 賣價)。如果此選項為“OFF”(推薦),則利潤將預設等於建議值(如果找不到預設值,則可能為 100%)。 MARGIN_METHODE_FOR_DISCOUNT=全球折扣的利潤規則 UseDiscountAsProduct=作為產品 UseDiscountAsService=作為服務 diff --git a/htdocs/langs/zh_TW/members.lang b/htdocs/langs/zh_TW/members.lang index 68771cc7892..e6b83cbef57 100644 --- a/htdocs/langs/zh_TW/members.lang +++ b/htdocs/langs/zh_TW/members.lang @@ -15,24 +15,24 @@ ErrorMemberIsAlreadyLinkedToThisThirdParty=另一名會員(名稱:%s ErrorUserPermissionAllowsToLinksToItselfOnly=出於安全原因,必須授予您編輯所有用戶的權限,以便能夠將會員連結到其他用戶。 SetLinkToUser=連結Dolibarr用戶 SetLinkToThirdParty=連接到Dolibarr合作方 -MembersCards=Business cards for members +MembersCards=會員名片 MembersList=會員清單 MembersListToValid=草案會員清單(待確認) MembersListValid=有效會員清單 MembersListUpToDate=最新訂閱的有效會員清單 MembersListNotUpToDate=訂閱過期的有效會員清單 -MembersListExcluded=List of excluded members +MembersListExcluded=排除會員的清單 MembersListResiliated=已被終止會員清單 MembersListQualified=合格會員清單 MenuMembersToValidate=草案會員 MenuMembersValidated=已驗證會員 -MenuMembersExcluded=Excluded members +MenuMembersExcluded=排除會員 MenuMembersResiliated=已終止會員 MembersWithSubscriptionToReceive=可接收訂閱會員 MembersWithSubscriptionToReceiveShort=接收訂閱 DateSubscription=訂閱日期 DateEndSubscription=訂閱結束日期 -EndSubscription=Subscription Ends +EndSubscription=訂閱結束 SubscriptionId=訂閱編號 WithoutSubscription=沒有訂閱 MemberId=會員編號 @@ -49,12 +49,12 @@ MemberStatusActiveLate=訂閱已過期 MemberStatusActiveLateShort=已過期 MemberStatusPaid=訂閱最新 MemberStatusPaidShort=最新 -MemberStatusExcluded=Excluded member -MemberStatusExcludedShort=Excluded +MemberStatusExcluded=排除會員 +MemberStatusExcludedShort=排除 MemberStatusResiliated=已終止成員 MemberStatusResiliatedShort=已終止 MembersStatusToValid=草案會員 -MembersStatusExcluded=Excluded members +MembersStatusExcluded=排除會員 MembersStatusResiliated=已終止會員 MemberStatusNoSubscription=已驗證(無需訂閱) MemberStatusNoSubscriptionShort=已驗證 @@ -83,12 +83,12 @@ WelcomeEMail=歡迎電子郵件 SubscriptionRequired=需要訂閱 DeleteType=刪除 VoteAllowed=允許投票 -Physical=Individual -Moral=Corporation -MorAndPhy=Corporation and Individual -Reenable=Re-Enable -ExcludeMember=Exclude a member -ConfirmExcludeMember=Are you sure you want to exclude this member ? +Physical=個人 +Moral=公司 +MorAndPhy=公司和個人 +Reenable=重新啟用 +ExcludeMember=排除會員 +ConfirmExcludeMember=您確定要排除此會員嗎? ResiliateMember=終止會員 ConfirmResiliateMember=您確定要終止此會員嗎? DeleteMember=刪除會員 @@ -144,7 +144,7 @@ DescADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION=電子郵件範本,用於會員 DescADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION=電子郵件範本,用於新的訂閱記錄時向會員發送電子郵件 DescADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION=電子郵件範本, 用於訂閱即將到期時發送電子郵件提醒 DescADHERENT_EMAIL_TEMPLATE_CANCELATION=電子郵件範本,用於在會員取消時向會員發送電子郵件 -DescADHERENT_EMAIL_TEMPLATE_EXCLUSION=Email template to use to send email to a member on member exclusion +DescADHERENT_EMAIL_TEMPLATE_EXCLUSION=用於會員排除時向會員發出電子郵件的模板 DescADHERENT_MAIL_FROM=自動發送電子郵件之發件人電子郵件 DescADHERENT_ETIQUETTE_TYPE=標籤頁格式 DescADHERENT_ETIQUETTE_TEXT=會員地址列表文字 @@ -170,31 +170,31 @@ DocForLabels=產生地址表 SubscriptionPayment=訂閱付款 LastSubscriptionDate=最新訂閱付款的日期 LastSubscriptionAmount=最新訂閱金額 -LastMemberType=Last Member type +LastMemberType=最新的會員類型 MembersStatisticsByCountries=會員統計(國家/城市) MembersStatisticsByState=會員統計(州/省) MembersStatisticsByTown=會員統計(城鎮) MembersStatisticsByRegion=會員統計(地區) -NbOfMembers=Total number of members -NbOfActiveMembers=Total number of current active members +NbOfMembers=會員總數 +NbOfActiveMembers=目前活躍會員數 NoValidatedMemberYet=無已驗證的會員 -MembersByCountryDesc=This screen shows you the statistics of members by countries. Graphs and charts depend on the availability of the Google online graph service as well as on the availability of a working internet connection. -MembersByStateDesc=This screen show you statistics of members by state/provinces/canton. -MembersByTownDesc=This screen show you statistics of members by town. -MembersByNature=This screen show you statistics of members by nature. -MembersByRegion=This screen show you statistics of members by region. +MembersByCountryDesc=此畫面顯示依國家/地區劃分的會員統計資訊。圖形取決於Google線上圖形服務,並且僅可在網路連線正常時可用。 +MembersByStateDesc=此畫面依州/省顯示有關會員的統計資訊。 +MembersByTownDesc=此畫面顯示依城市劃分的會員統計資訊。 +MembersByNature=此畫面依性質顯示有關會員的統計資訊。 +MembersByRegion=此畫面依區域顯示有關會員的統計資訊。 MembersStatisticsDesc=選擇要讀取的統計訊息... MenuMembersStats=統計 -LastMemberDate=Latest membership date +LastMemberDate=最新入會日期 LatestSubscriptionDate=最新訂閱日期 -MemberNature=Nature of the member -MembersNature=Nature of the members -Public=Information is public +MemberNature=會員性質 +MembersNature=會員性質 +Public=資訊是公開的 NewMemberbyWeb=增加了新會員。等待核准 NewMemberForm=新會員表格 -SubscriptionsStatistics=Subscriptions statistics +SubscriptionsStatistics=訂閱統計 NbOfSubscriptions=訂閱數 -AmountOfSubscriptions=Amount collected from subscriptions +AmountOfSubscriptions=訂閱金額 TurnoverOrBudget=營業額(對於公司)或預算(對於財團) DefaultAmount=預設訂閱金額 CanEditAmount=訪客可以選擇/編輯其訂閱金額 @@ -213,5 +213,5 @@ SendReminderForExpiredSubscription=當訂閱即將到期時,通過電子郵件 MembershipPaid=本期已支付的會費(直到%s) YouMayFindYourInvoiceInThisEmail=您可在此電子郵件中找到發票 XMembersClosed=%s會員已關閉 -XExternalUserCreated=%s external user(s) created -ForceMemberNature=Force member nature (Individual or Corporation) +XExternalUserCreated=已建立%s位外部用戶 +ForceMemberNature=強制會員性質(個人或公司) diff --git a/htdocs/langs/zh_TW/mrp.lang b/htdocs/langs/zh_TW/mrp.lang index 2f4bfbfa146..f257a5fc7f3 100644 --- a/htdocs/langs/zh_TW/mrp.lang +++ b/htdocs/langs/zh_TW/mrp.lang @@ -13,7 +13,7 @@ BOMsSetup=BOM模組設定 ListOfBOMs=物料清單-BOM ListOfManufacturingOrders=製造訂單清單 NewBOM=新物料清單 -ProductBOMHelp=Product to create (or disassemble) with this BOM.
    Note: Products with the property 'Nature of product' = 'Raw material' are not visible into this list. +ProductBOMHelp=使用此物料清單建立(或拆解)產品。
    注記:具有"產品屬性"的產品="原料"不會顯示於此清單 BOMsNumberingModules=BOM編號範本 BOMsModelModule=BOM文件範本 MOsNumberingModules=MO編號範本 @@ -39,7 +39,7 @@ DateStartPlannedMo=計劃開始日期 DateEndPlannedMo=計劃結束日期 KeepEmptyForAsap=空白表示“盡快” EstimatedDuration=預計時間 -EstimatedDurationDesc=Estimated duration to manufacture (or disassemble) this product using this BOM +EstimatedDurationDesc=使用此物料清單製造(或拆解)此產品的預計工期 ConfirmValidateBom=您確定要使用參考%s來驗證物料清單(您將能夠使用它來建立新的製造訂單) ConfirmCloseBom=您確定要取消此物料清單(您將無法再使用它來建立新的製造訂單)? ConfirmReopenBom=您確定要重新打開此物料清單嗎(您將能夠使用它來建立新的製造訂單) @@ -63,14 +63,14 @@ ConsumeAndProduceAll=消耗並生產所有產品 Manufactured=已製造 TheProductXIsAlreadyTheProductToProduce=要增加的產品已經是要生產的產品。 ForAQuantityOf=數量為%s -ForAQuantityToConsumeOf=For a quantity to disassemble of %s +ForAQuantityToConsumeOf=%s中拆解的數量 ConfirmValidateMo=您確定要驗證此製造訂單嗎? ConfirmProductionDesc=通過點擊“%s”,您將驗證數量設定的消耗量和/或生產量。這還將更新庫存並記錄庫存動向。 ProductionForRef=生產%s AutoCloseMO=如果達到消耗和生產的數量,則自動關閉製造訂單 NoStockChangeOnServices=服務無庫存變化 ProductQtyToConsumeByMO=開放MO仍要消耗的產品數量 -ProductQtyToProduceByMO=Product quantity still to produce by open MO +ProductQtyToProduceByMO=產品數量仍由開放MO生產 AddNewConsumeLines=增加新的行來使用 ProductsToConsume=消耗的產品 ProductsToProduce=生產的產品 diff --git a/htdocs/langs/zh_TW/orders.lang b/htdocs/langs/zh_TW/orders.lang index 2f23c61d0db..37fbc2d0e30 100644 --- a/htdocs/langs/zh_TW/orders.lang +++ b/htdocs/langs/zh_TW/orders.lang @@ -17,8 +17,8 @@ ToOrder=製作訂單 MakeOrder=製作訂單 SupplierOrder=採購訂單 SuppliersOrders=採購訂單 -SaleOrderLines=Sale order lines -PurchaseOrderLines=Puchase order lines +SaleOrderLines=銷售訂單行 +PurchaseOrderLines=採購訂單行 SuppliersOrdersRunning=目前的採購訂單 CustomerOrder=銷售訂單 CustomersOrders=銷售訂單 diff --git a/htdocs/langs/zh_TW/other.lang b/htdocs/langs/zh_TW/other.lang index 15b6f7aec08..ad8c0fde085 100644 --- a/htdocs/langs/zh_TW/other.lang +++ b/htdocs/langs/zh_TW/other.lang @@ -114,7 +114,7 @@ DemoCompanyAll=有多項活動的公司(所有主要模組) CreatedBy=由%s建立 ModifiedBy=由%s修改 ValidatedBy=由%s驗證 -SignedBy=Signed by %s +SignedBy=由%s簽署 ClosedBy=由%s關閉 CreatedById=建立的用戶ID ModifiedById=進行最新更改的用戶ID @@ -129,7 +129,7 @@ ClosedByLogin=已關閉的用戶登入名稱 FileWasRemoved=檔案%s已刪除 DirWasRemoved=資料夾%s已刪除 FeatureNotYetAvailable=此功能在目前版本中尚不可用 -FeatureNotAvailableOnDevicesWithoutMouse=Feature not available on devices without mouse +FeatureNotAvailableOnDevicesWithoutMouse=沒有滑鼠的設備上不可用的功能 FeaturesSupported=已支援功能 Width=寬度 Height=高度 @@ -184,7 +184,7 @@ EnableGDLibraryDesc=在PHP安裝上安裝或啟用GD程式庫以使用此選項 ProfIdShortDesc=Prof Id %s的資訊取決於合作方國家/地區。
    例如,對於國家%s ,其代碼為%s 。 DolibarrDemo=Dolibarr的ERP / CRM的DEMO StatsByNumberOfUnits=產品/服務數量統計 -StatsByNumberOfEntities=Statistics for number of referring entities (no. of invoices, or orders...) +StatsByNumberOfEntities=參考實體數量的統計數據(發票數量或訂單數量...) NumberOfProposals=提案/建議書的數量 NumberOfCustomerOrders=銷售訂單數量 NumberOfCustomerInvoices=客戶發票數量 @@ -246,7 +246,7 @@ NewKeyIs=這是您的新登入密碼 NewKeyWillBe=您用於登入軟體的新密鑰將為 ClickHereToGoTo=點擊這裡前往%s YouMustClickToChange=您必須先點擊以下連結驗證此密碼更改 -ConfirmPasswordChange=Confirm password change +ConfirmPasswordChange=確認密碼變更 ForgetIfNothing=如果您沒有請求此更改,請忽略此電子郵件。您的憑證仍保持安全狀態。 IfAmountHigherThan=如果金額高於 %s SourcesRepository=資料庫 @@ -264,7 +264,7 @@ ContactCreatedByEmailCollector=電子郵件收集器從電子郵件MSGID %s建 ProjectCreatedByEmailCollector=電子郵件收集器從電子郵件MSGID %s建立的專案 TicketCreatedByEmailCollector=電子郵件收集器從電子郵件MSGID %s建立的服務單 OpeningHoursFormatDesc=使用-分隔營業開始時間和營業結束時間。
    使用空格輸入不同的範圍。
    範例:8-12 14-18 -SuffixSessionName=Suffix for session name +SuffixSessionName=程序名稱的後綴 ##### Export ##### ExportsArea=出口地區 @@ -290,4 +290,4 @@ PopuProp=依照在提案中受歡迎程度列出的產品/服務 PopuCom=依照在訂單中受歡迎程度列出的產品/服務 ProductStatistics=產品/服務統計 NbOfQtyInOrders=訂單數量 -SelectTheTypeOfObjectToAnalyze=Select an object to view its statistics... +SelectTheTypeOfObjectToAnalyze=選擇一個項目以查看其統計資訊... diff --git a/htdocs/langs/zh_TW/partnership.lang b/htdocs/langs/zh_TW/partnership.lang index 34be595010d..f28af8cf442 100644 --- a/htdocs/langs/zh_TW/partnership.lang +++ b/htdocs/langs/zh_TW/partnership.lang @@ -16,66 +16,66 @@ # # Generic # -ModulePartnershipName=Partnership management -PartnershipDescription=Module Partnership management -PartnershipDescriptionLong= Module Partnership management +ModulePartnershipName=合作夥伴關係管理 +PartnershipDescription=合作夥伴管理模組 +PartnershipDescriptionLong= 合作夥伴管理模組 -AddPartnership=Add partnership -CancelPartnershipForExpiredMembers=Partnership: Cancel partnership of members with expired subscriptions -PartnershipCheckBacklink=Partnership: Check referring backlink +AddPartnership=增加合作夥伴 +CancelPartnershipForExpiredMembers=合作夥伴:取消訂閱過期會員的合作關係 +PartnershipCheckBacklink=合作夥伴:檢查參考反向連結 # # Menu # -NewPartnership=New Partnership -ListOfPartnerships=List of partnership +NewPartnership=新合作夥伴 +ListOfPartnerships=合作夥伴清單 # # Admin page # -PartnershipSetup=Partnership setup -PartnershipAbout=About Partnership -PartnershipAboutPage=Partnership about page -partnershipforthirdpartyormember=Partner status must be set on a 'thirdparty' or a 'member' -PARTNERSHIP_IS_MANAGED_FOR=Partnership managed for -PARTNERSHIP_BACKLINKS_TO_CHECK=Backlinks to check -PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL=Nb of days before cancelling status of a partnership when a subscription has expired -ReferingWebsiteCheck=Check of website referring -ReferingWebsiteCheckDesc=You can enable a feature to check that your partners has added a backlink to your website domains on their own website. +PartnershipSetup=合作夥伴設定 +PartnershipAbout=關於合作夥伴 +PartnershipAboutPage=合作夥伴關於頁面 +partnershipforthirdpartyormember=合作夥伴狀態必須設定為“合作方”或“會員” +PARTNERSHIP_IS_MANAGED_FOR=夥伴關係管理 +PARTNERSHIP_BACKLINKS_TO_CHECK=要檢查的反向連結 +PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL=訂閱到期後取消合作關係狀態前的 Nb 天 +ReferingWebsiteCheck=檢查網站參考 +ReferingWebsiteCheckDesc=您可以啟用一項功能來檢查您的合作夥伴是否在他們自己的網站上增加了指向您網站網域的反向連結。 # # Object # -DeletePartnership=Delete a partnership -PartnershipDedicatedToThisThirdParty=Partnership dedicated to this third party -PartnershipDedicatedToThisMember=Partnership dedicated to this member +DeletePartnership=刪除合作夥伴 +PartnershipDedicatedToThisThirdParty=致力於此合作方的合作夥伴 +PartnershipDedicatedToThisMember=致力於此會員的合作夥伴 DatePartnershipStart=開始日期 DatePartnershipEnd=結束日期 -ReasonDecline=Decline reason -ReasonDeclineOrCancel=Decline reason -PartnershipAlreadyExist=Partnership already exist -ManagePartnership=Manage partnership -BacklinkNotFoundOnPartnerWebsite=Backlink not found on partner website -ConfirmClosePartnershipAsk=Are you sure you want to cancel this partnership? -PartnershipType=Partnership type +ReasonDecline=拒絕原因 +ReasonDeclineOrCancel=拒絕原因 +PartnershipAlreadyExist=合作夥伴已存在 +ManagePartnership=管理合作夥伴 +BacklinkNotFoundOnPartnerWebsite=在合作夥伴網站上找不到反向連結 +ConfirmClosePartnershipAsk=您確定要取消此合作關係嗎? +PartnershipType=合作夥伴類型 # # Template Mail # -SendingEmailOnPartnershipWillSoonBeCanceled=Partnership will soon be canceled -SendingEmailOnPartnershipRefused=Partnership refused -SendingEmailOnPartnershipAccepted=Partnership accepted -SendingEmailOnPartnershipCanceled=Partnership canceled +SendingEmailOnPartnershipWillSoonBeCanceled=合作關係即將取消 +SendingEmailOnPartnershipRefused=已拒絕合作 +SendingEmailOnPartnershipAccepted=已接受合作 +SendingEmailOnPartnershipCanceled=已取消合作夥伴 -YourPartnershipWillSoonBeCanceledTopic=Partnership will soon be canceled -YourPartnershipRefusedTopic=Partnership refused -YourPartnershipAcceptedTopic=Partnership accepted -YourPartnershipCanceledTopic=Partnership canceled +YourPartnershipWillSoonBeCanceledTopic=合作關係即將取消 +YourPartnershipRefusedTopic=已拒絕合作 +YourPartnershipAcceptedTopic=已接受合作 +YourPartnershipCanceledTopic=已取消合作 -YourPartnershipWillSoonBeCanceledContent=We inform you that your partnership will soon be canceled (Backlink not found) -YourPartnershipRefusedContent=We inform you that your partnership request has been refused. -YourPartnershipAcceptedContent=We inform you that your partnership request has been accepted. -YourPartnershipCanceledContent=We inform you that your partnership has been canceled. +YourPartnershipWillSoonBeCanceledContent=我們通知您,您的合作夥伴關係即將取消(未找到反向連結) +YourPartnershipRefusedContent=我們通知您,您的合作請求已被拒絕。 +YourPartnershipAcceptedContent=我們通知您,您的合作請求已被接受。 +YourPartnershipCanceledContent=我們通知您,您的合作夥伴關係已被取消。 # # Status @@ -84,4 +84,4 @@ PartnershipDraft=草稿 PartnershipAccepted=已接受 PartnershipRefused=已拒絕 PartnershipCanceled=已取消 -PartnershipManagedFor=Partners are +PartnershipManagedFor=合作夥伴是 diff --git a/htdocs/langs/zh_TW/productbatch.lang b/htdocs/langs/zh_TW/productbatch.lang index 82f4324aa0e..e97a9eb8d05 100644 --- a/htdocs/langs/zh_TW/productbatch.lang +++ b/htdocs/langs/zh_TW/productbatch.lang @@ -1,10 +1,10 @@ # ProductBATCH language file - Source file is en_US - ProductBATCH ManageLotSerial=使用批次/序號數字 -ProductStatusOnBatch=Yes (lot required) -ProductStatusOnSerial=Yes (unique serial number required) +ProductStatusOnBatch=是(需要批號/序號) +ProductStatusOnSerial=是(需要唯一的批號/序號) ProductStatusNotOnBatch=不是(不使用批次/序號) -ProductStatusOnBatchShort=Lot -ProductStatusOnSerialShort=Serial +ProductStatusOnBatchShort=批號 +ProductStatusOnSerialShort=序號 ProductStatusNotOnBatchShort=No Batch=批次/序號 atleast1batchfield=有效日期或銷售日期或批次/序號 @@ -24,22 +24,22 @@ ProductLotSetup=批次/序號模組的設定 ShowCurrentStockOfLot=顯示關聯產品/批次的目前庫存 ShowLogOfMovementIfLot=顯示產品/批次的移動記錄 StockDetailPerBatch=每批次的庫存詳細資料 -SerialNumberAlreadyInUse=Serial number %s is already used for product %s -TooManyQtyForSerialNumber=You can only have one product %s for serial number %s -BatchLotNumberingModules=Options for automatic generation of batch products managed by lots -BatchSerialNumberingModules=Options for automatic generation of batch products managed by serial numbers -ManageLotMask=Custom mask -CustomMasks=Adds an option to define mask in the product card -LotProductTooltip=Adds an option in the product card to define a dedicated batch number mask -SNProductTooltip=Adds an option in the product card to define a dedicated serial number mask -QtyToAddAfterBarcodeScan=Qty to add for each barcode/lot/serial scanned -LifeTime=Life span (in days) -EndOfLife=End of life -ManufacturingDate=Manufacturing date -DestructionDate=Destruction date -FirstUseDate=First use date -QCFrequency=Quality control frequency (in days) +SerialNumberAlreadyInUse= 序號%s已經被產品%s使用 +TooManyQtyForSerialNumber=序號%s只能使用在產品%s上 +BatchLotNumberingModules=依批號自動產生批次產品的選項 +BatchSerialNumberingModules=依序號自動產生批次產品的選項 +ManageLotMask=自定義遮罩 +CustomMasks=在產品卡中增加一個定義遮罩的選項 +LotProductTooltip=在產品卡中增加一個定義專用批號遮罩的選項 +SNProductTooltip=在產品卡中增加一個定義專用序號遮罩的選項 +QtyToAddAfterBarcodeScan=每一個已掃描的條碼/批號/序號要增加的數量 +LifeTime=有效期(天) +EndOfLife=已到期 +ManufacturingDate=生產日期 +DestructionDate=銷毀日期 +FirstUseDate=首次使用日期 +QCFrequency=品質控制頻率(天) #Traceability - qc status OutOfOrder=Out of order -InWorkingOrder=In working order +InWorkingOrder=在生產訂單中 diff --git a/htdocs/langs/zh_TW/products.lang b/htdocs/langs/zh_TW/products.lang index e34cc1f39a4..1885cb18f9d 100644 --- a/htdocs/langs/zh_TW/products.lang +++ b/htdocs/langs/zh_TW/products.lang @@ -43,7 +43,7 @@ ServicesOnSaleOnly=僅供銷售服務 ServicesOnPurchaseOnly=僅供採購服務 ServicesNotOnSell=無法銷售與採購之服務 ServicesOnSellAndOnBuy=可供銷售與購買之服務 -LastModifiedProductsAndServices=Latest %s products/services which were modified +LastModifiedProductsAndServices=最新%s筆已修改的產品/服務 LastRecordedProducts=最新 %s 紀錄的產品 LastRecordedServices=最新%s 紀錄的服務 CardProduct0=產品 @@ -73,12 +73,12 @@ SellingPrice=售價 SellingPriceHT=售價(不含稅) SellingPriceTTC=售價(含稅) SellingMinPriceTTC=最低售價(含稅) -CostPriceDescription=This price field (excl. tax) can be used to capture the average amount this product costs to your company. It may be any price you calculate yourself, for example, from the average buying price plus average production and distribution cost. +CostPriceDescription=此價格欄位(不含稅)可用於取得該產品給貴公司的平均價格。它可以是您自己計算的任何價格,例如,根據平均購買價格加上平均生產和分銷成本得出的價格。 CostPriceUsage=此值可用於利潤計算。 SoldAmount=銷售數量 PurchasedAmount=購買數量 NewPrice=新價格 -MinPrice=Min. selling price +MinPrice=最低售價 EditSellingPriceLabel=修改售價標籤 CantBeLessThanMinPrice=售價不能低於該產品的最低售價(%s 不含稅)。如果你輸入的折扣過高也會出現此訊息。 ContractStatusClosed=已關閉 @@ -141,7 +141,7 @@ VATRateForSupplierProduct=營業稅率(此供應商/產品) DiscountQtyMin=此數量的折扣。 NoPriceDefinedForThisSupplier=沒有此供應商/產品定義的價格/數量 NoSupplierPriceDefinedForThisProduct=沒有定義此產品供應商價格/數量 -PredefinedItem=Predefined item +PredefinedItem=預定義項目 PredefinedProductsToSell=預定義產品 PredefinedServicesToSell=預定義服務 PredefinedProductsAndServicesToSell=預定義的可銷售產品/服務 @@ -157,11 +157,11 @@ ListServiceByPopularity=熱門服務列表 Finished=成品 RowMaterial=原材料 ConfirmCloneProduct=您確定要複製產品或服務%s嗎? -CloneContentProduct=Clone all main information of the product/service +CloneContentProduct=複製產品/服務的所有主要資訊 ClonePricesProduct=複製價格 -CloneCategoriesProduct=Clone linked tags/categories -CloneCompositionProduct=Clone virtual products/services -CloneCombinationsProduct=Clone the product variants +CloneCategoriesProduct=複製已連結標籤/類別 +CloneCompositionProduct=複製虛擬產品/服務 +CloneCombinationsProduct=複製產品變異 ProductIsUsed=該產品是用於 NewRefForClone=新的產品/服務參考 SellingPrices=銷售價格 @@ -170,12 +170,12 @@ CustomerPrices=客戶價格 SuppliersPrices=供應商價格 SuppliersPricesOfProductsOrServices=供應商價格(產品或服務) CustomCode=海關|商品| HS碼 -CountryOrigin=Country of origin -RegionStateOrigin=Region of origin -StateOrigin=State|Province of origin -Nature=Nature of product (raw/manufactured) +CountryOrigin=原產地 +RegionStateOrigin=原產地 +StateOrigin=州|原產地 +Nature=產品性質(原料/成品) NatureOfProductShort=產品性質 -NatureOfProductDesc=Raw material or manufactured product +NatureOfProductDesc=原料或成品 ShortLabel=短標籤 Unit=單位 p=u. @@ -277,7 +277,7 @@ PriceByCustomer=每個客戶的價格不同 PriceCatalogue=每個產品/服務的單次銷售價格 PricingRule=售價規則 AddCustomerPrice=依客戶新增價格 -ForceUpdateChildPriceSoc=為客戶子公司設置相同的價格 +ForceUpdateChildPriceSoc=為客戶子公司設定相同的價格 PriceByCustomerLog=舊客戶價格的日誌 MinimumPriceLimit=最低價格不能低於%s MinimumRecommendedPrice=最低建議價格是:%s @@ -296,6 +296,7 @@ ComposedProductIncDecStock=母產品變更時增加/減少庫存 ComposedProduct=子產品 MinSupplierPrice=最低採購價格 MinCustomerPrice=最低銷售價格 +NoDynamicPrice=沒有動態價格 DynamicPriceConfiguration=動態價格設置 DynamicPriceDesc=您可以定義數學公式來計算客戶或供應商的價格。這樣的公式可以使用所有數學運算符,一些常數和變數。您可以在此處定義要使用的變數。如果變數需要自動更新,則可以定義外部URL以允許Dolibarr自動更新值。 AddVariable=增加變數 @@ -314,7 +315,7 @@ LastUpdated=最新更新 CorrectlyUpdated=更新成功 PropalMergePdfProductActualFile=用於增加到PDF Azur的文件是 PropalMergePdfProductChooseFile=選擇PDF文件 -IncludingProductWithTag=Include products/services with tag +IncludingProductWithTag=包含有標籤的產品/服務 DefaultPriceRealPriceMayDependOnCustomer=預設價格,實際價格可能取決於客戶 WarningSelectOneDocument=請至少選擇一份文件 DefaultUnitToShow=單位 diff --git a/htdocs/langs/zh_TW/projects.lang b/htdocs/langs/zh_TW/projects.lang index 7057f38a761..5137b622b09 100644 --- a/htdocs/langs/zh_TW/projects.lang +++ b/htdocs/langs/zh_TW/projects.lang @@ -10,19 +10,19 @@ PrivateProject=專案聯絡人 ProjectsImContactFor=我是聯絡人的專案 AllAllowedProjects=我可以讀取的所有專案(我的+公共項目) AllProjects=所有專案 -MyProjectsDesc=This view is limited to the projects that you are a contact for +MyProjectsDesc=此檢視僅顯示您為聯絡人之專案 ProjectsPublicDesc=此檢視顯示您被允許讀取的所有專案。 TasksOnProjectsPublicDesc=此檢視顯示您可讀取之專案的所有任務。 ProjectsPublicTaskDesc=此檢視顯示所有您可以讀取之專案與任務。 ProjectsDesc=此檢視顯示全部專案(您的用戶權限授予您檢視所有內容)。 TasksOnProjectsDesc=此檢視顯示所有專案上的所有任務(您的用戶權限授予您檢視所有內容)。 -MyTasksDesc=This view is limited to the projects or tasks that you are a contact for +MyTasksDesc=此檢視僅顯示您是聯絡人之專案或任務 OnlyOpenedProject=僅顯示開放專案(不顯示草案或是已關閉狀態之專案) ClosedProjectsAreHidden=不顯示已關閉專案 TasksPublicDesc=此檢視顯示您可讀取之所有專案及任務。 TasksDesc=此檢視顯示所有專案及任務(您的用戶權限授予您查看所有內容)。 AllTaskVisibleButEditIfYouAreAssigned=合格專案的所有任務都可見,但是您只能輸入分配給所選用戶之任務的時間。如果需要輸入時間,請分配任務。 -OnlyYourTaskAreVisible=Only tasks assigned to you are visible. If you need to enter time on a task and if the task is not visible here, then you need to assign the task to yourself. +OnlyYourTaskAreVisible=僅顯示分配給您的任務。如果您需要輸入時間並且看不見任務,則您需要將任務分配給自己。 ImportDatasetTasks=專案任務 ProjectCategories=專案標籤/類別 NewProject=新專案 @@ -89,7 +89,7 @@ TimeConsumed=已消耗 ListOfTasks=任務清單 GoToListOfTimeConsumed=前往工作時間清單 GanttView=甘特圖 -ListWarehouseAssociatedProject=List of warehouses associated to the project +ListWarehouseAssociatedProject=與專案有關的倉庫清單 ListProposalsAssociatedProject=與專案有關的商業建議書清單 ListOrdersAssociatedProject=與專案相關的銷售訂單清單 ListInvoicesAssociatedProject=與專案相關的客戶發票清單 @@ -202,7 +202,7 @@ ResourceNotAssignedToTheTask=未分配給任務 NoUserAssignedToTheProject=沒有分配給此專案的用戶 TimeSpentBy=花費時間者 TasksAssignedTo=任務分配給 -AssignTaskToMe=Assign task to myself +AssignTaskToMe=分配任務給自己 AssignTaskToUser=將任務分配給%s SelectTaskToAssign=選擇要分配的任務... AssignTask=分配 @@ -267,11 +267,11 @@ InvoiceToUse=發票草稿 NewInvoice=新發票 OneLinePerTask=每個任務一行 OneLinePerPeriod=每個週期一行 -OneLinePerTimeSpentLine=One line for each time spent declaration +OneLinePerTimeSpentLine=一行為一筆時間花費申報 RefTaskParent=參考上層任務 ProfitIsCalculatedWith=利潤計算是使用 -AddPersonToTask=Add also to tasks -UsageOrganizeEvent=Usage: Event Organization -PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE=Classify project as closed when all its tasks are completed (100%% progress) -PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE_help=Note: existing projects with all tasks at 100 %% progress won't be affected: you will have to close them manually. This option only affects open projects. -SelectLinesOfTimeSpentToInvoice=Select lines of time spent that are unbilled, then bulk action "Generate Invoice" to bill them +AddPersonToTask=也增加到任務 +UsageOrganizeEvent=用途:事件組織 +PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE=當所有任務完成時將專案分類為關閉(進度100%%) +PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE_help=注意:所有任務進度為 100%% 的現有專案不會受到影響:您必須手動關閉它們。此選項僅影響打開的專案。 +SelectLinesOfTimeSpentToInvoice=選擇未計費的時間行,然後批次操作“產生發票”來計費 diff --git a/htdocs/langs/zh_TW/propal.lang b/htdocs/langs/zh_TW/propal.lang index ba1758df186..acdb64c9cc0 100644 --- a/htdocs/langs/zh_TW/propal.lang +++ b/htdocs/langs/zh_TW/propal.lang @@ -59,7 +59,7 @@ ConfirmClonePropal=您確定您要完整複製商業提案/建議書%s? ConfirmReOpenProp=您確定要再打開商業提案/建議書%s嗎? ProposalsAndProposalsLines=商業提案/建議書和行 ProposalLine=提案/建議書行 -ProposalLines=Proposal lines +ProposalLines=提案/建議書行 AvailabilityPeriod=交貨期 SetAvailability=設定交貨期 AfterOrder=訂單後 diff --git a/htdocs/langs/zh_TW/receptions.lang b/htdocs/langs/zh_TW/receptions.lang index 07092969024..798b7f6efcb 100644 --- a/htdocs/langs/zh_TW/receptions.lang +++ b/htdocs/langs/zh_TW/receptions.lang @@ -44,4 +44,4 @@ ValidateOrderFirstBeforeReception=您必須先驗證訂單,然後才能進行 ReceptionsNumberingModules=收貨編號模組 ReceptionsReceiptModel=收貨用文件範本 NoMorePredefinedProductToDispatch=沒有更多預定義的產品要調度 -ReceptionExist=A reception exists +ReceptionExist=有櫃台 diff --git a/htdocs/langs/zh_TW/recruitment.lang b/htdocs/langs/zh_TW/recruitment.lang index f1f347585b2..beb5762cbe2 100644 --- a/htdocs/langs/zh_TW/recruitment.lang +++ b/htdocs/langs/zh_TW/recruitment.lang @@ -50,27 +50,27 @@ PositionsToBeFilled=工作職位 ListOfPositionsToBeFilled=工作職位清單 NewPositionToBeFilled=新職位 -JobOfferToBeFilled=Job position to be filled +JobOfferToBeFilled=職位空缺 ThisIsInformationOnJobPosition=工作職位空缺訊息 ContactForRecruitment=招聘連絡人 EmailRecruiter=電子郵件招聘者 ToUseAGenericEmail=使用普通電子郵件。如果未定義,將使用招聘負責人的電子郵件 -NewCandidature=New application -ListOfCandidatures=List of applications +NewCandidature=新申請 +ListOfCandidatures=申請清單 RequestedRemuneration=要求的薪資 ProposedRemuneration=擬議薪資 ContractProposed=擬議合約 ContractSigned=合約已簽訂 -ContractRefused=Contract refused -RecruitmentCandidature=Application +ContractRefused=合約被拒絕 +RecruitmentCandidature=申請 JobPositions=工作職位 -RecruitmentCandidatures=Applications +RecruitmentCandidatures=申請 InterviewToDo=面試事項 -AnswerCandidature=Application answer -YourCandidature=Your application -YourCandidatureAnswerMessage=Thanks you for your application.
    ... -JobClosedTextCandidateFound=The job position is closed. The position has been filled. -JobClosedTextCanceled=The job position is closed. -ExtrafieldsJobPosition=Complementary attributes (job positions) -ExtrafieldsApplication=Complementary attributes (job applications) -MakeOffer=Make an offer +AnswerCandidature=申請回覆 +YourCandidature=您的申請 +YourCandidatureAnswerMessage=感謝您的申請。
    ... +JobClosedTextCandidateFound=此職位已關閉。此職位已招聘完成。 +JobClosedTextCanceled=此職位已關閉。 +ExtrafieldsJobPosition=補充屬性(職位) +ExtrafieldsApplication=補充屬性(工作申請) +MakeOffer=開價 diff --git a/htdocs/langs/zh_TW/salaries.lang b/htdocs/langs/zh_TW/salaries.lang index f741a3a051c..d3fc9900a41 100644 --- a/htdocs/langs/zh_TW/salaries.lang +++ b/htdocs/langs/zh_TW/salaries.lang @@ -2,12 +2,15 @@ SALARIES_ACCOUNTING_ACCOUNT_PAYMENT=用戶合作方使用的會計帳戶 SALARIES_ACCOUNTING_ACCOUNT_PAYMENT_Desc=用戶卡上定義的專用會計帳戶將僅用於子帳會計。如果未定義用戶專用的用戶帳戶,則此帳戶將用於“總帳”,並作為“子帳”帳戶的默認值。 SALARIES_ACCOUNTING_ACCOUNT_CHARGE=默認支付薪資的會計帳戶 +CREATE_NEW_SALARY_WITHOUT_AUTO_PAYMENT=預設,當建立薪資時將"自動建立所有支付"選項留空 Salary=薪資 Salaries=薪資 -NewSalaryPayment=新支付薪資 +NewSalary=新薪資 +NewSalaryPayment=新薪資卡 AddSalaryPayment=新增支付薪資 SalaryPayment=支付薪資 SalariesPayments=支付薪資 +SalariesPaymentsOf=%s 的薪資支付 ShowSalaryPayment=顯示支付薪資 THM=平均時薪 TJM=平均日薪 diff --git a/htdocs/langs/zh_TW/sendings.lang b/htdocs/langs/zh_TW/sendings.lang index ef3e9fc3a8d..fcdd10a92c7 100644 --- a/htdocs/langs/zh_TW/sendings.lang +++ b/htdocs/langs/zh_TW/sendings.lang @@ -43,14 +43,14 @@ ConfirmValidateSending=您確定要使用參考%s驗證此出貨嗎? ConfirmCancelSending=您確定要取消此出貨嗎? DocumentModelMerou=Merou A5 範本 WarningNoQtyLeftToSend=警告,沒有等待出貨的產品。 -StatsOnShipmentsOnlyValidated=Statistics are only for validated shipments. Date used is the date of validation of shipment (planned delivery date is not always known) +StatsOnShipmentsOnlyValidated=統計數據僅適用於經過驗證的出貨。日期是使用出貨驗證日期(並不是總是知道計劃的出貨日期) DateDeliveryPlanned=預計交貨日期 RefDeliveryReceipt=參考交貨收據 -StatusReceipt=交貨收據狀態 +StatusReceipt=送貨單狀態 DateReceived=收貨日期 ClassifyReception=收貨分類 -SendShippingByEMail=通過電子郵件發送出貨 -SendShippingRef=提交出貨%s +SendShippingByEMail=通過電子郵件寄送出貨 +SendShippingRef=提交出貨%s ActionsOnShipping=出貨事件 LinkToTrackYourPackage=連結追踪您的包裹 ShipmentCreationIsDoneFromOrder=目前,新建立出貨已經由訂單卡完成。 diff --git a/htdocs/langs/zh_TW/stocks.lang b/htdocs/langs/zh_TW/stocks.lang index 39839073299..318a92ed1a9 100644 --- a/htdocs/langs/zh_TW/stocks.lang +++ b/htdocs/langs/zh_TW/stocks.lang @@ -60,7 +60,7 @@ EnhancedValueOfWarehouses=倉庫價值 UserWarehouseAutoCreate=新增用戶時自動新增用戶倉庫 AllowAddLimitStockByWarehouse=除了每個產品的最小和期望庫存值之外,還管理每個配對(產品倉庫)的最小和期望庫存值 RuleForWarehouse=倉庫規則 -WarehouseAskWarehouseOnThirparty=Set a warehouse on third-party +WarehouseAskWarehouseOnThirparty=為合作方設定倉庫 WarehouseAskWarehouseDuringPropal=為商業提案/建議書設定一個倉庫 WarehouseAskWarehouseDuringOrder=在銷售訂單上設定一個倉庫 UserDefaultWarehouse=在用戶上設定一個倉庫 @@ -89,15 +89,15 @@ NoPredefinedProductToDispatch=沒有此專案的預定義產品。因此無需 DispatchVerb=調度 StockLimitShort=警報限制 StockLimit=庫存限制的警報 -StockLimitDesc=(empty) means no warning.
    0 can be used to trigger a warning as soon as the stock is empty. +StockLimitDesc=(空白)表示沒有警告。
    0 可用於庫存為0時立即觸發警告。 PhysicalStock=實體庫存 RealStock=實際庫存 RealStockDesc=實體/實際庫存是目前倉庫中的庫存。 RealStockWillAutomaticallyWhen=實際庫存將根據以下規則(在“庫存”模組中定義)進行修改: VirtualStock=虛擬庫存 VirtualStockAtDate=截至日期的虛擬庫存 -VirtualStockAtDateDesc=Virtual stock once all the pending orders that are planned to be processed before the chosen date will be finished -VirtualStockDesc=Virtual stock is the calculated stock available once all open/pending actions (that affect stocks) are closed (purchase orders received, sales orders shipped, manufacturing orders produced, etc) +VirtualStockAtDateDesc=虛擬庫存將於即將執行的待辦訂單所選擇的日期前完成 +VirtualStockDesc=虛擬庫存是在所有未完成/待辦操作(影響庫存)關閉(收到採購訂單、銷售訂單發貨、生產製造訂單等)後計算出的庫存 AtDate=目前 IdWarehouse=編號倉庫 DescWareHouse=說明倉庫 @@ -105,7 +105,7 @@ LieuWareHouse=本地化倉庫 WarehousesAndProducts=倉庫和產品 WarehousesAndProductsBatchDetail=倉庫和產品(有批次/序列的詳細信息) AverageUnitPricePMPShort=加權平均價格 -AverageUnitPricePMPDesc=The input average unit price we had to expense to get 1 unit of product into our stock. +AverageUnitPricePMPDesc=我們取得一單位產品進入我們庫存所需要的花費為平均輸入單價 SellPriceMin=銷售單價 EstimatedStockValueSellShort=銷售價值 EstimatedStockValueSell=銷售價值 @@ -123,9 +123,9 @@ DesiredStockDesc=該庫存量將是用於補貨功能中補充庫存的值。 StockToBuy=訂購 Replenishment=補貨 ReplenishmentOrders=補貨單 -VirtualDiffersFromPhysical=According to increase/decrease stock options, physical stock and virtual stock (physical stock + open orders) may differ -UseRealStockByDefault=Use real stock, instead of virtual stock, for replenishment feature -ReplenishmentCalculation=Amount to order will be (desired quantity - real stock) instead of (desired quantity - virtual stock) +VirtualDiffersFromPhysical=根據新增/減少庫存選項,真實庫存與虛擬庫存(真實庫存加開放訂單)也許不同 +UseRealStockByDefault=為補貨功能使用真實庫存而不是虛擬庫存 +ReplenishmentCalculation=訂購數量將是(需求數量 - 實際庫存)而不是(需求數量 - 虛擬庫存) UseVirtualStock=使用虛擬庫存 UsePhysicalStock=使用實體庫存 CurentSelectionMode=目前選擇模式 @@ -134,7 +134,7 @@ CurentlyUsingPhysicalStock=實體庫存 RuleForStockReplenishment=補貨規則 SelectProductWithNotNullQty=選擇至少一個數量不為空的產品和一個供應商 AlertOnly= 只警告 -IncludeProductWithUndefinedAlerts = Include also negative stock for products with no desired quantity defined, to restore them to 0 +IncludeProductWithUndefinedAlerts = 也包括未定義需求數量產品的負庫存,將其恢復為 0 WarehouseForStockDecrease=倉庫%s將用於減少庫存 WarehouseForStockIncrease=倉庫%s將用於庫存增加 ForThisWarehouse=用於這個倉庫 @@ -145,7 +145,7 @@ Replenishments=補貨 NbOfProductBeforePeriod=選則期間以前產品%s庫存的數量(<%s) NbOfProductAfterPeriod=選則期間之後產品%s庫存的數量(> %s) MassMovement=全部活動 -SelectProductInAndOutWareHouse=Select a source warehouse and a target warehouse, a product and a quantity then click "%s". Once this is done for all required movements, click on "%s". +SelectProductInAndOutWareHouse=選擇一個來源倉庫,目標倉庫,產品與數量然後點選"%s"。當所有移動後完成後請點選"%s"。 RecordMovement=記錄轉移 ReceivingForSameOrder=此訂單的收據 StockMovementRecorded=庫存變動已記錄 @@ -154,7 +154,7 @@ StockMustBeEnoughForInvoice=庫存水平必須足以將產品/服務新增到發 StockMustBeEnoughForOrder=庫存水平必須足以將產品/服務新增到訂單中(將此筆加到訂單中時,無論自動庫存更改的規則如何,都要對當前實際庫存進行檢查) StockMustBeEnoughForShipment= 庫存水平必須足以將產品/服務新增到發貨中(將此筆加到發貨中時,無論自動庫存更改的規則如何,都要對當前實際庫存進行檢查) MovementLabel=產品移動標籤 -TypeMovement=Direction of movement +TypeMovement=移動方向 DateMovement=移動日期 InventoryCode=移動或庫存代碼 IsInPackage=包含在包裝中 @@ -167,8 +167,8 @@ MovementTransferStock=將產品%s庫存轉移到另一個倉庫 InventoryCodeShort=庫存/移動碼 NoPendingReceptionOnSupplierOrder=由於是未完成採購訂單,沒有待處理的接收處 ThisSerialAlreadyExistWithDifferentDate=此批號/序列號( %s )已存在,但入庫日期或出庫日期不同(找到%s,但您輸入%s )。 -OpenAll=打開所有活動 -OpenInternal=僅開啟內部活動 +OpenAnyMovement=開啟(所有移動) +OpenInternal=開啟(只有內部移動) UseDispatchStatus=產品在採購訂單接收處時,使用一個調度狀態(批准/拒絕) OptionMULTIPRICESIsOn=選項“分段價格”已啟用。這意味著一個產品有多個售價,因此無法計算出銷售價值 ProductStockWarehouseCreated=已正確產生庫存限制警報和需求最佳庫存 @@ -236,23 +236,23 @@ StockIsRequiredToChooseWhichLotToUse=庫存需要選擇要使用的批次 ForceTo=強制到 AlwaysShowFullArbo=在倉庫連結的彈出窗口上顯示完整的倉庫樹狀圖(警告:這可能會大大降低性能) StockAtDatePastDesc=您可以在此處檢視給定之過去日期的庫存(實際庫存) -StockAtDateFutureDesc=You can view here the stock (virtual stock) at a given date in the future +StockAtDateFutureDesc=您可以在此檢視未來某一天的庫存(虛擬庫存) CurrentStock=目前庫存 InventoryRealQtyHelp=將值設定為0以重置數量
    保持欄位為空或刪除行以保持不變 -UpdateByScaning=Fill real qty by scaning +UpdateByScaning=使用掃描填入實際數量 UpdateByScaningProductBarcode=掃描更新(產品條碼) UpdateByScaningLot=掃描更新(批次|序列條碼) -DisableStockChangeOfSubProduct=Deactivate the stock change for all the subproducts of this Kit during this movement. +DisableStockChangeOfSubProduct=在此移動期間停止此組合所有子產品的庫存變化。 ImportFromCSV=匯入CSV移動清單 ChooseFileToImport=上傳檔案,然後點擊%s圖示以選擇要匯入的檔案... SelectAStockMovementFileToImport=選擇要匯入的庫存移動檔案 -InfoTemplateImport=Uploaded file needs to have this format (* are mandatory fields):
    Source Warehouse* | Target Warehouse* | Product* | Quantity* | Lot/serial number
    CSV character separator must be "%s" +InfoTemplateImport=上傳的檔案需要採用這種格式(*為必填欄位):
    來源倉庫* |目標倉庫* |產品* |數量* |批號/序號
    CSV 字元分隔符號必須是“ %s ” LabelOfInventoryMovemement=%s的庫存 ReOpen=重新打開 -ConfirmFinish=Do you confirm the closing of the inventory ? This will generate all stock movements to update your stock to the real qty you entered into the inventory. -ObjectNotFound=%s not found -MakeMovementsAndClose=Generate movements and close -AutofillWithExpected=Fill real quantity with expected quantity -ShowAllBatchByDefault=By default, show batch details on product "stock" tab -CollapseBatchDetailHelp=You can set batch detail default display in stocks module configuration -FieldCannotBeNegative=Field "%s" cannot be negative +ConfirmFinish=您確定要關閉此盤點嗎?這將使得產生所有庫存移動並且更新您庫存中的真實數量。 +ObjectNotFound=未發現%s +MakeMovementsAndClose=產生移動並關閉 +AutofillWithExpected=用預期數量填入實際數量 +ShowAllBatchByDefault=預設,在產品"庫存"分頁顯示批次詳細資料 +CollapseBatchDetailHelp=您可以在庫存模組設定中設定預設顯示批次詳細資料 +FieldCannotBeNegative=欄位“%s”不能為負值 diff --git a/htdocs/langs/zh_TW/supplier_proposal.lang b/htdocs/langs/zh_TW/supplier_proposal.lang index 7bb87f2607e..b029b7f1ee2 100644 --- a/htdocs/langs/zh_TW/supplier_proposal.lang +++ b/htdocs/langs/zh_TW/supplier_proposal.lang @@ -1,27 +1,28 @@ # Dolibarr language file - Source file is en_US - supplier_proposal SupplierProposal=供應商商業提案/建議書 supplier_proposalDESC=管理對供應商的價格要求 -SupplierProposalNew=新價格要求 -CommRequest=價格要求 -CommRequests=請求報價 -SearchRequest=搜尋要求 -DraftRequests=草擬要求 +SupplierProposalNew=新供應商報價 +CommRequest=供應商報價 +CommRequests=供應商報價 +SearchRequest=搜尋供應商報價 +DraftRequests=供應商報價草案 SupplierProposalsDraft=供應商提案/建議書草稿 LastModifiedRequests=最新%s的價格要求 -RequestsOpened=公開價格要求 +RequestsOpened=打開的報價 SupplierProposalArea=供應商提案/建議書區 SupplierProposalShort=供應商提案/建議書 SupplierProposals=供應商提案/建議書 SupplierProposalsShort=供應商提案/建議書 -NewAskPrice=新價格要求 -ShowSupplierProposal=顯示價格要求 -AddSupplierProposal=新增價格要求 +AskPrice=供應商報價 +NewAskPrice=新供應商報價 +ShowSupplierProposal=顯示供應商報價 +AddSupplierProposal=建立供應商價格報價 SupplierProposalRefFourn=供應商參考 SupplierProposalDate=交貨日期 SupplierProposalRefFournNotice=在關閉成為“已接受”之前,請確認供應商的參考。 -ConfirmValidateAsk=您確定要以名稱%s驗證此價格要求嗎? -DeleteAsk=刪除要求 -ValidateAsk=驗證要求 +ConfirmValidateAsk=您確定要以名稱%s驗證此供應商報價嗎? +DeleteAsk=刪除供應商報價 +ValidateAsk=驗證供應商報價 SupplierProposalStatusDraft=草案(等待驗證) SupplierProposalStatusValidated=已驗證(要求已打開) SupplierProposalStatusClosed=已關閉 @@ -32,23 +33,26 @@ SupplierProposalStatusValidatedShort=已驗證 SupplierProposalStatusClosedShort=已關閉 SupplierProposalStatusSignedShort=已接受 SupplierProposalStatusNotSignedShort=已拒絕 -CopyAskFrom=複製現有要求以建立價格要求 -CreateEmptyAsk=新增空白的要求 -ConfirmCloneAsk=您確定要複製價格請求%s嗎? -ConfirmReOpenAsk=您確定要重新打開價格請求%s嗎? -SendAskByMail=使用郵件發送價格要求 -SendAskRef=傳送價格要求%s -SupplierProposalCard=要求卡 -ConfirmDeleteAsk=您確定要刪除此價格要求%s嗎? -ActionsOnSupplierProposal=價格要求紀錄 +CopyAskFrom=複製現有報價以建立供應商報價 +CreateEmptyAsk=建立空白的供應商報價 +ConfirmCloneAsk=您確定要複製供應商報價%s嗎? +ConfirmReOpenAsk=您確定要重新打開供應商報價%s嗎? +SendAskByMail=使用郵件發送供應商報價 +SendAskRef=傳送供應商報價%s +SupplierProposalCard=供應商報價需求卡 +ConfirmDeleteAsk=您確定要刪除供應商報價%s嗎? +ActionsOnSupplierProposal=供應商報價事件 DocModelAuroreDescription=完整的需求模組(logo...) -CommercialAsk=價格要求 -DefaultModelSupplierProposalCreate=預設模型新增 -DefaultModelSupplierProposalToBill=關閉價格要求時的預設範本(已接受) -DefaultModelSupplierProposalClosed=關閉價格要求時的預設範本(已拒絕) +CommercialAsk=供應商報價 +DefaultModelSupplierProposalCreate=預設模型建立 +DefaultModelSupplierProposalToBill=關閉供應商報價時的預設範本(已接受) +DefaultModelSupplierProposalClosed=關閉供應商報價時的預設範本(已拒絕) ListOfSupplierProposals=要求供應商提案/建議書清單 ListSupplierProposalsAssociatedProject=專案中供應商提案/建議書清單 SupplierProposalsToClose=將供應商提案/建議書結案 SupplierProposalsToProcess=將處理供應商提案/建議書 -LastSupplierProposals=最新%s價格要求 -AllPriceRequests=所有要求 +LastSupplierProposals=最新%s的供應商報價 +AllPriceRequests=所有供應商報價 +TypeContact_supplier_proposal_external_SHIPPING=供應商出貨聯絡人 +TypeContact_supplier_proposal_external_BILLING=供應商發票聯絡人 +TypeContact_supplier_proposal_external_SERVICE=提案/建議書聯絡人 diff --git a/htdocs/langs/zh_TW/ticket.lang b/htdocs/langs/zh_TW/ticket.lang index ed96eadd5bc..b4dfb98e9a6 100644 --- a/htdocs/langs/zh_TW/ticket.lang +++ b/htdocs/langs/zh_TW/ticket.lang @@ -34,7 +34,8 @@ TicketDictResolution=服務單-決議 TicketTypeShortCOM=商業問題 TicketTypeShortHELP=請求有用的幫助 -TicketTypeShortISSUE=錯誤或問題 +TicketTypeShortISSUE=問題或錯誤 +TicketTypeShortPROBLEM=問題 TicketTypeShortREQUEST=變更或增強要求 TicketTypeShortPROJET=專案 TicketTypeShortOTHER=其他 @@ -54,14 +55,15 @@ TypeContact_ticket_internal_SUPPORTTEC=已分配用戶 TypeContact_ticket_external_SUPPORTCLI=客戶聯絡人/事件追踪 TypeContact_ticket_external_CONTRIBUTOR=外部合作者 -OriginEmail=電子郵件來源 +OriginEmail=電子郵件作者 Notify_TICKET_SENTBYMAIL=以電子郵件發送服務單訊息 # Status Read=已讀取 Assigned=已分配 InProgress=進行中 -NeedMoreInformation=等待訊息 +NeedMoreInformation=等待作者回覆 +NeedMoreInformationShort=等待回覆 Answered=已回覆 Waiting=等待中 Closed=已關閉 @@ -117,7 +119,7 @@ TicketsShowModuleLogoHelp=啟用此選項可在公共界面的頁面中隱藏商 TicketsShowCompanyLogo=在公共界面上顯示公司商標 TicketsShowCompanyLogoHelp=啟用此選項可在公共界面的頁面中隱藏主要公司的商標 TicketsEmailAlsoSendToMainAddress=同時向主要電子郵件地址寄送通知 -TicketsEmailAlsoSendToMainAddressHelp=Enable this option to also send an email to the address defined into setup "%s" (see tab "%s") +TicketsEmailAlsoSendToMainAddressHelp=啟用此選項會同時寄送一封Email至設定中預設的電子信箱"%s"(查看分頁"%s") TicketsLimitViewAssignedOnly=限制顯示分配給目前用戶的服務單。(對外部用戶無效,始終被限制於他們所依賴的合作方) TicketsLimitViewAssignedOnlyHelp=僅顯示分配給目前用戶的服務單。不適用於具有服務單管理權限的用戶。 TicketsActivatePublicInterface=啟用公共界面 @@ -131,7 +133,7 @@ TicketsDisableCustomerEmail=從公共界面建立服務單時,始終禁用電 TicketsPublicNotificationNewMessage=當有新的訊息/意見新增到服務單時寄送Email TicketsPublicNotificationNewMessageHelp=當公共界面有新增訊息時寄送電子郵件(給已分配用戶或寄送通知電子郵件給(更新)與/或通知電子郵件給) TicketPublicNotificationNewMessageDefaultEmail=通知電子郵件寄送到(更新) -TicketPublicNotificationNewMessageDefaultEmailHelp=Send an email to this address for each new message notifications if the ticket doesn't have a user assigned to it or if the user doesn't have any known email. +TicketPublicNotificationNewMessageDefaultEmailHelp=如果服務單未分配給用戶或是用戶沒有已知的電子郵件則為每一個新訊息提醒寄送一封電子郵件至這個信箱 # # Index & list page # @@ -160,7 +162,7 @@ CreatedBy=建立者 NewTicket=新服務單 SubjectAnswerToTicket=服務單回應 TicketTypeRequest=需求類型 -TicketCategory=群組 +TicketCategory=服務單分類 SeeTicket=查閱服務單 TicketMarkedAsRead=服務單已標記為已讀 TicketReadOn=繼續讀取 @@ -211,6 +213,7 @@ TicketMessageHelp=此段文字將會被儲存在服務單卡片的訊息清單 TicketMessageSubstitutionReplacedByGenericValues=替換變量將被替換為一般值。 TimeElapsedSince=已經過時間 TicketTimeToRead=讀取前經過的時間 +TicketTimeElapsedBeforeSince=之前/之後經過的時間 TicketContacts=聯絡人服務單 TicketDocumentsLinked=已連結到服務單的文件 ConfirmReOpenTicket=您確定要重新開啟此服務單嗎? From ab1ba5bc6adaf6a184d1834f064bbe6bb16b3242 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 Jul 2021 19:26:04 +0200 Subject: [PATCH 0987/1497] css --- htdocs/compta/bank/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index 67599ffff0e..c1b446a9dd0 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -564,7 +564,7 @@ foreach ($accounts as $key => $type) { // Account number if (!empty($arrayfields['b.account_number']['checked'])) { - print ''; + print ''; if (!empty($conf->accounting->enabled) && !empty($objecttmp->account_number)) { $accountingaccount = new AccountingAccount($db); $accountingaccount->fetch('', $objecttmp->account_number, 1); From d51599f8f1819c115b037c98311c7fb919c61921 Mon Sep 17 00:00:00 2001 From: Lenin Rivas <53640168+leninrivas@users.noreply.github.com> Date: Sat, 3 Jul 2021 22:41:16 -0500 Subject: [PATCH 0988/1497] Update unicode and name of currency --- htdocs/install/mysql/data/llx_c_currencies.sql | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/data/llx_c_currencies.sql b/htdocs/install/mysql/data/llx_c_currencies.sql index 478c263af4c..df887d68be7 100644 --- a/htdocs/install/mysql/data/llx_c_currencies.sql +++ b/htdocs/install/mysql/data/llx_c_currencies.sql @@ -7,6 +7,7 @@ -- Copyright (C) 2007 Patrick Raguin -- Copyright (C) 2011 Juanjo Menent -- Copyright (C) 2020 Udo Tamm +-- Copyright (C) 2021 Lenin Rivas -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by @@ -50,7 +51,7 @@ INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'BDT' INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'BYR', '[112,46]', 1, 'Belarus Ruble'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'BZD', '[66,90,36]', 1, 'Belize Dollar'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'BMD', '[36]', 1, 'Bermuda Dollar'); -INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'BOB', '[36,98]', 1, 'Bolivia Boliviano'); +INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'BOB', '[66,115]', 1, 'Bolivia Boliviano'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'BAM', '[75,77]', 1, 'Bosnia and Herzegovina Convertible Marka'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'BWP', '[80]', 1, 'Botswana Pula'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'BGN', '[1083,1074]', 1, 'Bulgaria Lev'); @@ -70,6 +71,7 @@ INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'CZK' INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'DKK', '[107,114]', 1, 'Denmark Krone'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'DOP', '[82,68,36]', 1, 'Dominican Republic Peso'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'XCD', '[36]', 1, 'East Caribbean Dollar'); +INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'ECS', '[83,47,46]', 1, 'Ecuador Sucre'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'EGP', '[163]', 1, 'Egypt Pound'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'SVC', '[36]', 1, 'El Salvador Colon'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'EEK', '[107,114]', 1, 'Estonia Kroon'); @@ -126,7 +128,7 @@ INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'OMR' INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'PKR', '[8360]', 1, 'Pakistan Rupee'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'PAB', '[66,47,46]', 1, 'Panama Balboa'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'PYG', '[71,115]', 1, 'Paraguay Guarani'); -INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'PEN', '[83,47,46]', 1, 'Peru Nuevo Sol'); +INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'PEN', '[83,47]', 1, 'Perú Sol'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'PHP', '[8369]', 1, 'Philippines Peso'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'PLN', '[122,322]', 1, 'Poland Zloty'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'QAR', '[65020]', 1, 'Qatar Riyal'); From cb7ac94e15d94b509707f165d248d2402273aaca Mon Sep 17 00:00:00 2001 From: damien clochard Date: Sun, 4 Jul 2021 14:27:51 +0200 Subject: [PATCH 0989/1497] FIX #18085: Migration 13 to 14 : Explicit cast when changing the type of llx_c_ticket_category.pos --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index a01f589aa20..c10e4aa5282 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -428,6 +428,10 @@ create table llx_eventorganization_conferenceorboothattendee_extrafields ALTER TABLE llx_eventorganization_conferenceorboothattendee_extrafields ADD INDEX idx_conferenceorboothattendee_fk_object(fk_object); ALTER TABLE llx_c_ticket_category ADD COLUMN public integer DEFAULT 0; + +-- VPGSQL8.2 ALTER TABLE llx_c_ticket_category ALTER COLUMN pos TYPE INTEGER USING pos::INTEGER; +-- VPGSQL8.2 ALTER TABLE llx_c_ticket_category ALTER COLUMN pos SET NOT NULL; +-- VPGSQL8.2 ALTER TABLE llx_c_ticket_category ALTER COLUMN pos SET DEFAULT 0; ALTER TABLE llx_c_ticket_category MODIFY COLUMN pos integer DEFAULT 0 NOT NULL; From 744a95ce7e5fc3227c8f712ad7ad1bccacfd14fb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 4 Jul 2021 18:30:20 +0200 Subject: [PATCH 0990/1497] Fix var init --- htdocs/admin/index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/admin/index.php b/htdocs/admin/index.php index 396570b2155..aa571644871 100644 --- a/htdocs/admin/index.php +++ b/htdocs/admin/index.php @@ -51,6 +51,7 @@ if (!empty($conf->global->MAIN_MOTD_SETUPPAGE)) { $conf->global->MAIN_MOTD_SETUPPAGE = preg_replace('//i', '
    ', $conf->global->MAIN_MOTD_SETUPPAGE); if (!empty($conf->global->MAIN_MOTD_SETUPPAGE)) { $i = 0; + $reg = array(); while (preg_match('/__\(([a-zA-Z|@]+)\)__/i', $conf->global->MAIN_MOTD_SETUPPAGE, $reg) && $i < 100) { $tmp = explode('|', $reg[1]); if (!empty($tmp[1])) { From 0cccfb1cee8a5cd53c9bfcf31fcefd432707a81f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 4 Jul 2021 19:23:04 +0200 Subject: [PATCH 0991/1497] Fix phpcs v14 --- htdocs/adherents/card.php | 10 +- htdocs/admin/accountant.php | 13 +- htdocs/admin/company.php | 16 +- htdocs/admin/pdf.php | 24 +- htdocs/admin/pdf_other.php | 3 +- htdocs/admin/security.php | 2 +- htdocs/compta/bank/card.php | 14 +- htdocs/contact/card.php | 2 + htdocs/core/class/html.formadmin.class.php | 2 + htdocs/core/lib/functions.lib.php | 6 +- htdocs/langs/en_US/admin.lang | 4 +- .../template/class/myobject.class.php | 2 +- .../modulebuilder/template/myobject_list.php | 6 +- htdocs/product/card.php | 24 +- .../inventory/class/inventory.class.php | 35 +-- htdocs/product/inventory/list.php | 205 +++++++++++------- htdocs/product/list.php | 8 +- htdocs/societe/card.php | 2 + htdocs/theme/eldy/global.inc.php | 2 +- htdocs/theme/md/style.css.php | 18 +- htdocs/user/card.php | 2 + 21 files changed, 241 insertions(+), 159 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index da84fd5bf6b..7c5d074d51e 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1054,6 +1054,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Country $object->country_id = $object->country_id ? $object->country_id : $mysoc->country_id; print ''.$langs->trans('Country').''; + print img_picto('', 'country', 'class="pictofixedwidth"'); print $form->select_country(GETPOSTISSET('country_id') ? GETPOST('country_id', 'alpha') : $object->country_id, 'country_id'); if ($user->admin) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); @@ -1064,6 +1065,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if (empty($conf->global->MEMBER_DISABLE_STATE)) { print ''.$langs->trans('State').''; if ($object->country_id) { + print img_picto('', 'state', 'class="pictofixedwidth"'); print $formcompany->select_state(GETPOSTISSET('state_id') ? GETPOST('state_id', 'int') : $object->state_id, $object->country_code); } else { print $countrynotdefined; @@ -1303,6 +1305,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Country //$object->country_id=$object->country_id?$object->country_id:$mysoc->country_id; // In edit mode we don't force to company country if not defined print ''.$langs->trans('Country').''; + print img_picto('', 'country', 'class="pictofixedwidth"'); print $form->select_country(GETPOSTISSET("country_id") ? GETPOST("country_id", "alpha") : $object->country_id, 'country_id'); if ($user->admin) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); @@ -1312,21 +1315,22 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // State if (empty($conf->global->MEMBER_DISABLE_STATE)) { print ''.$langs->trans('State').''; + print img_picto('', 'state', 'class="pictofixedwidth"'); print $formcompany->select_state($object->state_id, GETPOSTISSET("country_id") ? GETPOST("country_id", "alpha") : $object->country_id); print ''; } // Pro phone print ''.$langs->trans("PhonePro").''; - print ''.img_picto('', 'object_phoning').' phone).'">'; + print ''.img_picto('', 'object_phoning', 'class="pictofixedwidth"').' phone).'">'; // Personal phone print ''.$langs->trans("PhonePerso").''; - print ''.img_picto('', 'object_phoning').' phone_perso).'">'; + print ''.img_picto('', 'object_phoning', 'class="pictofixedwidth"').' phone_perso).'">'; // Mobile phone print ''.$langs->trans("PhoneMobile").''; - print ''.img_picto('', 'object_phoning_mobile').' phone_mobile).'">'; + print ''.img_picto('', 'object_phoning_mobile', 'class="pictofixedwidth"').' phone_mobile).'">'; if (!empty($conf->socialnetworks->enabled)) { foreach ($socialnetworks as $key => $value) { diff --git a/htdocs/admin/accountant.php b/htdocs/admin/accountant.php index 1e924699cd5..7c82775abad 100644 --- a/htdocs/admin/accountant.php +++ b/htdocs/admin/accountant.php @@ -131,7 +131,7 @@ print ''; -print img_picto('', 'globe-americas', 'class="paddingrightonly"'); +print img_picto('', 'globe-americas', 'class="pictofixedwidth"'); print $form->select_country((GETPOSTISSET('country_id') ? GETPOST('country_id', 'int') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY) ? $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY : '')), 'country_id'); if ($user->admin) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); @@ -139,27 +139,28 @@ if ($user->admin) { print ''."\n"; print ''; -$formcompany->select_departement((GETPOSTISSET('state_id') ? GETPOST('state_id', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_STATE) ? $conf->global->MAIN_INFO_ACCOUNTANT_STATE : '')), (GETPOSTISSET('country_id') ? GETPOST('country_id', 'int') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY) ? $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY : '')), 'state_id'); +print img_picto('', 'state', 'class="pictofixedwidth"'); +print $formcompany->select_state((GETPOSTISSET('state_id') ? GETPOST('state_id', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_STATE) ? $conf->global->MAIN_INFO_ACCOUNTANT_STATE : '')), (GETPOSTISSET('country_id') ? GETPOST('country_id', 'int') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY) ? $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY : '')), 'state_id'); print ''."\n"; print ''; -print img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright'); +print img_picto('', 'object_phoning', '', false, 0, 0, '', 'pictofixedwidth'); print ''; print ''."\n"; print ''; -print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright'); +print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'pictofixedwidth'); print ''; print ''."\n"; print ''; -print img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright'); +print img_picto('', 'object_email', '', false, 0, 0, '', 'pictofixedwidth'); print ''; print ''."\n"; // Web print ''; -print img_picto('', 'globe', '', false, 0, 0, '', 'paddingright'); +print img_picto('', 'globe', '', false, 0, 0, '', 'pictofixedwidth'); print ''; print ''."\n"; diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 804ed9934bf..d2dac38b500 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -417,7 +417,7 @@ print ''; -print img_picto('', 'globe-americas', 'class="paddingrightonly"'); +print img_picto('', 'globe-americas', 'class="pictofixedwidth"'); print $form->select_country($mysoc->country_id, 'country_id', '', 0); if ($user->admin) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); @@ -430,35 +430,37 @@ if (!empty($conf->global->MAIN_INFO_SOCIETE_STATE)) { $tmp = explode(':', $conf->global->MAIN_INFO_SOCIETE_STATE); $state_id = $tmp[0]; } -$formcompany->select_departement($state_id, $mysoc->country_code, 'state_id'); +print img_picto('', 'state', 'class="pictofixedwidth"'); +print $formcompany->select_state($state_id, $mysoc->country_code, 'state_id'); print ''."\n"; // Currency print ''; +print img_picto('', 'multicurrency', 'class="pictofixedwidth"'); print $form->selectCurrency($conf->currency, "currency"); print ''."\n"; // Phone print ''; -print img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright'); +print img_picto('', 'object_phoning', '', false, 0, 0, '', 'pictofixedwidth'); print ''; print ''."\n"; // Fax print ''; -print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright'); +print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'pictofixedwidth'); print ''; print ''."\n"; // Email print ''; -print img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright'); +print img_picto('', 'object_email', '', false, 0, 0, '', 'pictofixedwidth'); print ''; print ''."\n"; // Web print ''; -print img_picto('', 'globe', '', false, 0, 0, '', 'paddingright'); +print img_picto('', 'globe', '', false, 0, 0, '', 'pictofixedwidth'); print ''; print ''."\n"; @@ -466,7 +468,7 @@ print ''."\n"; if (!empty($conf->barcode->enabled)) { print ''; print ''; - print ''; + print ''; print ''; print ''; } diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 7d7b5e36a40..d5873e2a50e 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -371,17 +371,7 @@ print $formadmin->select_language($selected, 'PDF_USE_ALSO_LANGUAGE_CODE', 0, nu //} print ''; -//Desc - -print ''.$langs->trans("HideDescOnPDF").''; -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_HIDE_DESC'); -} else { - print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DESC', (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC)) ? $conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC : 0, 1); -} -print ''; - -//Ref +// Ref print ''.$langs->trans("HideRefOnPDF").''; if ($conf->use_javascript_ajax) { @@ -391,7 +381,17 @@ if ($conf->use_javascript_ajax) { } print ''; -//Details +// Desc + +print ''.$langs->trans("HideDescOnPDF").''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_HIDE_DESC'); +} else { + print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DESC', (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC)) ? $conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC : 0, 1); +} +print ''; + +// Details print ''.$langs->trans("HideDetailsOnPDF").''; if ($conf->use_javascript_ajax) { diff --git a/htdocs/admin/pdf_other.php b/htdocs/admin/pdf_other.php index 03c27fd3721..f836b8f0f0c 100644 --- a/htdocs/admin/pdf_other.php +++ b/htdocs/admin/pdf_other.php @@ -116,10 +116,11 @@ print ''; print ''; print '
    '; - +/* print '
    '; print ''; print '
    '; +*/ print ''; diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index e94dd6bad39..064fb5650a4 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -251,7 +251,7 @@ foreach ($arrayhandler as $key => $module) { } elseif ($tmp == 'NotConfigured') { print $langs->trans($tmp); } else { - print $tmp; + print ''.$tmp.''; } print ''."\n"; diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index 7f1c830d45b..ea9f7799849 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -399,7 +399,8 @@ if ($action == 'create') { // State print ''.$langs->trans('State').''; if ($selectedcode) { - $formcompany->select_departement(GETPOSTISSET("account_state_id") ? GETPOST("account_state_id") : '', $selectedcode, 'account_state_id'); + print img_picto('', 'state', 'class="pictofixedwidth"'); + print $formcompany->select_state(GETPOSTISSET("account_state_id") ? GETPOST("account_state_id") : '', $selectedcode, 'account_state_id'); } else { print $countrynotdefined; } @@ -407,7 +408,10 @@ if ($action == 'create') { // Web print ''.$langs->trans("Web").''; - print ''; + print ''; + print img_picto('', 'globe', 'class="pictofixedwidth"'); + print ''; + print ''; // Tags-Categories if ($conf->categorie->enabled) { @@ -865,6 +869,7 @@ if ($action == 'create') { if (!$selectedcode) { $selectedcode = $conf->currency; } + print img_picto('', 'multicurrency', 'class="pictofixedwidth"'); print $form->selectCurrency((GETPOSTISSET("account_currency_code") ? GETPOST("account_currency_code") : $selectedcode), 'account_currency_code'); //print $langs->trans("Currency".$conf->currency); //print ''; @@ -897,6 +902,7 @@ if ($action == 'create') { // State print ''.$langs->trans('State').''; if ($selectedcode) { + print img_picto('', 'state', 'class="pictofixedwidth"'); print $formcompany->select_state(GETPOSTISSET("account_state_id") ? GETPOST("account_state_id") : $object->state_id, $selectedcode, 'account_state_id'); } else { print $countrynotdefined; @@ -925,7 +931,9 @@ if ($action == 'create') { // Web print ''.$langs->trans("Web").''; - print 'url).'">'; + print ''; + print img_picto('', 'globe', 'class="pictofixedwidth"'); + print 'url).'">'; print ''; // Tags-Categories diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index dea4f9d185d..469869f00e9 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -726,6 +726,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } if ($object->country_id) { + print img_picto('', 'state', 'class="pictofixedwidth"'); print $formcompany->select_state(GETPOST("state_id", 'alpha') ? GETPOST("state_id", 'alpha') : $object->state_id, $object->country_code, 'state_id'); } else { print $countrynotdefined; @@ -1019,6 +1020,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; } + print img_picto('', 'state', 'class="pictofixedwidth"'); print $formcompany->select_state(GETPOSTISSET('state_id') ? GETPOST('state_id', 'alpha') : $object->state_id, $object->country_code, 'state_id'); print ''; } diff --git a/htdocs/core/class/html.formadmin.class.php b/htdocs/core/class/html.formadmin.class.php index 411b45e03a7..d45f952d8b2 100644 --- a/htdocs/core/class/html.formadmin.class.php +++ b/htdocs/core/class/html.formadmin.class.php @@ -444,6 +444,8 @@ class FormAdmin } $out .= ''; + $out .= ajax_combobox($htmlname); + return $out; } } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 28c553d747c..28da21926ab 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3522,7 +3522,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top', 'commercial', 'companies', 'generic', 'home', 'hrm', 'members', 'products', 'invoicing', 'partnership', 'payment', 'pencil-ruler', 'preview', 'project', 'projectpub', 'projecttask', 'question', 'refresh', 'salary', 'shipment', - 'supplier_invoice', 'supplier_invoicea', 'supplier_invoicer', 'supplier_invoiced', + 'state', 'supplier_invoice', 'supplier_invoicea', 'supplier_invoicer', 'supplier_invoiced', 'technic', 'ticket', 'error', 'warning', 'recent', 'reception', 'recruitmentcandidature', 'recruitmentjobposition', 'resource', @@ -3572,7 +3572,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'recent' => 'question', 'reception'=>'dolly', 'recruitmentjobposition'=>'id-card-alt', 'recruitmentcandidature'=>'id-badge', 'resize'=>'crop', 'supplier_order'=>'dol-order_supplier', 'supplier_proposal'=>'file-signature', 'refresh'=>'redo', 'resource'=>'laptop-house', - 'security'=>'key', 'salary'=>'wallet', 'shipment'=>'dolly', 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'stripe'=>'stripe-s', + 'state'=>'map-marked', 'security'=>'key', 'salary'=>'wallet', 'shipment'=>'dolly', 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'stripe'=>'stripe-s', 'supplier'=>'building', 'supplier_invoice'=>'file-invoice-dollar', 'technic'=>'cogs', 'ticket'=>'ticket-alt', 'timespent'=>'clock', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach', 'title_agenda'=>'calendar-alt', @@ -3673,7 +3673,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'partnership'=>'#6c6aa8', 'playdisabled'=>'#ccc', 'printer'=>'#444', 'projectpub'=>'#986c6a', 'reception'=>'#a69944', 'resize'=>'#444', 'rss'=>'#cba', //'shipment'=>'#a69944', 'security'=>'#999', 'stats'=>'#444', 'switch_off'=>'#999', 'technic'=>'#999', 'timespent'=>'#555', - 'uncheck'=>'#800', 'uparrow'=>'#555', 'user-cog'=>'#999', 'country'=>'#aaa', 'globe-americas'=>'#aaa', + 'uncheck'=>'#800', 'uparrow'=>'#555', 'user-cog'=>'#999', 'country'=>'#aaa', 'globe-americas'=>'#aaa', 'state'=>'#aaa', 'website'=>'#304', 'workstation'=>'#a69944' ); if (isset($arrayconvpictotocolor[$pictowithouttext])) { diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 0fef25c033a..2a726e9eefe 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1260,8 +1260,8 @@ YourPHPDoesNotHaveSSLSupport=SSL functions not available in your PHP DownloadMoreSkins=More skins to download SimpleNumRefModelDesc=Returns the reference number in the format %syymm-nnnn where yy is the year, mm is the month and nnnn is a sequential auto-incrementing number with no reset SimpleNumRefNoDateModelDesc=Returns the reference number in the format %s-nnnn where nnnn is a sequential auto-incrementing number with no reset -ShowProfIdInAddress=Show professional id with addresses -ShowVATIntaInAddress=Hide intra-Community VAT number with addresses +ShowProfIdInAddress=Show professional ID with addresses +ShowVATIntaInAddress=Hide intra-Community VAT number TranslationUncomplete=Partial translation MAIN_DISABLE_METEO=Disable meteorological view MeteoStdMod=Standard mode diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 41ea75ec515..f07a0f04a10 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -84,7 +84,7 @@ class MyObject extends CommonObject * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...). * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). - * 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'maxwidth200', 'wordbreak', 'tdoverflowmax200' + * 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'maxwidth200', 'wordbreak', 'tdoverflowmax200', 'minwidth300 maxwidth500 widthcentpercentminusx' * 'help' is a 'TranslationString' to use to show a tooltip on field. You can also use 'TranslationString:keyfortooltiponlick' for a tooltip on click. * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index abc8b879d33..76d736a5670 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -328,7 +328,8 @@ $sql .= $hookmanager->resPrint; /* If a group by is required $sql.= " GROUP BY "; -foreach($object->fields as $key => $val) { +foreach($object->fields as $key => $val) +{ $sql.='t.'.$key.', '; } // Add fields from extrafields @@ -337,7 +338,7 @@ if (! empty($extrafields->attributes[$object->table_element]['label'])) { } // Add where from hooks $parameters=array(); -$reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters, $object); // Note that $action and $object may have been modified by hook +$reshook=$hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; $sql=preg_replace('/,\s*$/','', $sql); */ @@ -452,6 +453,7 @@ print ''; print ''; print ''; +print ''; print ''; $newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/mymodule/myobject_card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 0aff87cc28b..3d5afd1b16c 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1106,11 +1106,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Product specific batch number management $status_batch = GETPOST('status_batch'); if ($status_batch !== '0') { + $langs->load("admin"); $tooltip = $langs->trans("GenericMaskCodes", $langs->transnoentities("Batch"), $langs->transnoentities("Batch")); - $tooltip .= $langs->trans("GenericMaskCodes2"); - $tooltip .= $langs->trans("GenericMaskCodes3"); - $tooltip .= $langs->trans("GenericMaskCodes4a", $langs->transnoentities("Batch"), $langs->transnoentities("Batch")); - $tooltip .= $langs->trans("GenericMaskCodes5"); + $tooltip .= '
    '.$langs->trans("GenericMaskCodes2"); + $tooltip .= '
    '.$langs->trans("GenericMaskCodes3"); + $tooltip .= '
    '.$langs->trans("GenericMaskCodes4a", $langs->transnoentities("Batch"), $langs->transnoentities("Batch")); + $tooltip .= '
    '.$langs->trans("GenericMaskCodes5"); if (($conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS && $conf->global->PRODUCTBATCH_LOT_ADDON == 'mod_lot_advanced') || ($conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS && $conf->global->PRODUCTBATCH_SN_ADDON == 'mod_sn_advanced')) { print ''.$langs->trans("ManageLotMask").''; @@ -1301,7 +1302,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''.$langs->trans("CountryOrigin").''; print ''; print img_picto('', 'globe-americas', 'class="paddingrightonly"'); - print $form->select_country((GETPOSTISSET('country_id') ? GETPOST('country_id') : $object->country_id), 'country_id', '', 0, 'minwidth300 widthcentpercentminusx'); + print $form->select_country((GETPOSTISSET('country_id') ? GETPOST('country_id') : $object->country_id), 'country_id', '', 0, 'minwidth300 widthcentpercentminusx maxwidth500'); if ($user->admin) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } @@ -1316,6 +1317,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''.$form->editfieldkey('StateOrigin', 'state_id', '', $object, 0).''; } + print img_picto('', 'state', 'class="pictofixedwidth"'); print $formcompany->select_state($object->state_id, $object->country_code); print ''; } @@ -1627,11 +1629,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print $form->selectarray('status_batch', $statutarray, $object->status_batch); print ''; if ($object->status_batch !== '0') { + $langs->load("admin"); $tooltip = $langs->trans("GenericMaskCodes", $langs->transnoentities("Batch"), $langs->transnoentities("Batch")); - $tooltip .= $langs->trans("GenericMaskCodes2"); - $tooltip .= $langs->trans("GenericMaskCodes3"); - $tooltip .= $langs->trans("GenericMaskCodes4a", $langs->transnoentities("Batch"), $langs->transnoentities("Batch")); - $tooltip .= $langs->trans("GenericMaskCodes5"); + $tooltip .= '
    '.$langs->trans("GenericMaskCodes2"); + $tooltip .= '
    '.$langs->trans("GenericMaskCodes3"); + $tooltip .= '
    '.$langs->trans("GenericMaskCodes4a", $langs->transnoentities("Batch"), $langs->transnoentities("Batch")); + $tooltip .= '
    '.$langs->trans("GenericMaskCodes5"); print ''.$langs->trans("ManageLotMask").''; if ($object->status_batch == '1' && $conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS && $conf->global->PRODUCTBATCH_LOT_ADDON == 'mod_lot_advanced') { $mask = !empty($object->batch_mask) ? $object->batch_mask : $conf->global->LOT_ADVANCED_MASK; @@ -1724,6 +1727,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Public Url if (empty($conf->global->PRODUCT_DISABLE_PUBLIC_URL)) { print ''.$langs->trans("PublicUrl").''; + print img_picto('', 'globe', 'class="pictofixedwidth"'); print ''; print ''; } @@ -1732,6 +1736,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if ($object->isProduct() && !empty($conf->stock->enabled)) { // Default warehouse print ''.$langs->trans("DefaultWarehouse").''; + print img_picto($langs->trans("DefaultWarehouse"), 'stock', 'class="pictofixedwidth"'); print $formproduct->selectWarehouses($object->fk_default_warehouse, 'fk_default_warehouse', 'warehouseopen', 1); print ' '; print ''; @@ -1835,6 +1840,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''.$form->editfieldkey('StateOrigin', 'state_id', '', $object, 0).''; } + print img_picto('', 'state', 'class="pictofixedwidth"'); print $formcompany->select_state($object->state_id, $object->country_code); print ''; print ''; diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index 1adc9189892..9fb74c96f83 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -65,24 +65,29 @@ class Inventory extends CommonObject const STATUS_CANCELED = 9; /** - * 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') + * 'type' field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter]]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'text:none', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" * 'label' the translation key. - * 'enabled' is a condition when the field must be managed. + * 'picto' is code of a picto to show before value in forms + * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM) + * 'position' is the sort order of field. + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) * 'noteditable' says if field is not editable (1 or 0) - * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). - * 'default' is a default value for creation (can still be replaced by the global setup of default values) + * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. * 'index' if we want an index in database. * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...). - * 'position' is the sort order of field. * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). - * 'css' is the CSS style to use on field. For example: 'maxwidth200' - * 'help' is a string visible as a tooltip on field - * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'maxwidth200', 'wordbreak', 'tdoverflowmax200', 'minwidth300 maxwidth500 widthcentpercentminusx' + * 'help' is a 'TranslationString' to use to show a tooltip on field. You can also use 'TranslationString:keyfortooltiponlick' for a tooltip on click. * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record - * 'arrayofkeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel") + * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. + * 'arrayofkeyval' to set a list of values if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel"). Note that type can be 'integer' or 'varchar' + * 'autofocusoncreate' to have field having the focus on a create form. Only 1 field should have this property set to 1. + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * + * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. */ // BEGIN MODULEBUILDER PROPERTIES @@ -93,17 +98,17 @@ class Inventory extends CommonObject 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'visible'=>-1, 'enabled'=>1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>'Id',), 'ref' => array('type'=>'varchar(64)', 'label'=>'Ref', 'visible'=>1, 'enabled'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>'Reference of object', 'css'=>'maxwidth200'), 'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>20, 'notnull'=>1, 'index'=>1,), - 'title' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>25, 'css'=>'minwidth300'), - 'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php', 'label'=>'Warehouse', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'index'=>1, 'help'=>'InventoryForASpecificWarehouse'), - 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php', 'label'=>'Product', 'visible'=>1, 'enabled'=>1, 'position'=>32, 'index'=>1, 'help'=>'InventoryForASpecificProduct'), + 'title' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>25, 'css'=>'minwidth300', 'csslist'=>'tdoverflowmax200'), + 'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php', 'label'=>'Warehouse', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'index'=>1, 'help'=>'InventoryForASpecificWarehouse', 'picto'=>'stock', 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist'=>'tdoverflowmax200'), + 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php', 'label'=>'Product', 'visible'=>1, 'enabled'=>1, 'position'=>32, 'index'=>1, 'help'=>'InventoryForASpecificProduct', 'picto'=>'product', 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist'=>'tdoverflowmax200'), 'date_inventory' => array('type'=>'date', 'label'=>'DateValue', 'visible'=>1, 'enabled'=>1, 'position'=>35), 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>500), 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>501), 'date_validation' => array('type'=>'datetime', 'label'=>'DateValidation', 'visible'=>-2, 'enabled'=>1, 'position'=>502), - 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>510, 'foreignkey'=>'user.rowid'), - 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>511), - 'fk_user_valid' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'visible'=>-2, 'enabled'=>1, 'position'=>512), + 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>510, 'foreignkey'=>'user.rowid', 'csslist'=>'tdoverflowmax200'), + 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>511, 'csslist'=>'tdoverflowmax200'), + 'fk_user_valid' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'visible'=>-2, 'enabled'=>1, 'position'=>512, 'csslist'=>'tdoverflowmax200'), 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>0, 'position'=>1000), 'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>4, 'enabled'=>1, 'position'=>1000, 'notnull'=>1, 'default'=>0, 'index'=>1, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Validated', 2=>'Recorded', 9=>'Canceled')) diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index 84f9bc137b6..7d792c82ec1 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -49,8 +49,9 @@ $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { + // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action $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; @@ -66,12 +67,59 @@ $search_array_options = $extrafields->getOptionalsFromPost($object->table_elemen // Default sort order (if not yet defined by previous GETPOST) if (!$sortfield) { + reset($object->fields); // Reset is required to avoid key() to return null. $sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition. } if (!$sortorder) { $sortorder = "ASC"; } +// Initialize array of search criterias +$search_all = GETPOST('search_all', 'alphanohtml'); +$search = array(); +foreach ($object->fields as $key => $val) { + if (GETPOST('search_'.$key, 'alpha') !== '') { + $search[$key] = GETPOST('search_'.$key, 'alpha'); + } + if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); + } +} + +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array(); +foreach ($object->fields as $key => $val) { + if (!empty($val['searchall'])) { + $fieldstosearchall['t.'.$key] = $val['label']; + } +} + +// Definition of array of fields for columns +$arrayfields = array(); +foreach ($object->fields as $key => $val) { + // If $val['visible']==0, then we never show the field + if (!empty($val['visible'])) { + $visible = (int) dol_eval($val['visible'], 1); + $arrayfields['t.'.$key] = array( + 'label'=>$val['label'], + 'checked'=>(($visible < 0) ? 0 : 1), + 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)), + 'position'=>$val['position'], + 'help'=>$val['help'] + ); + } +} +// Extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; + +$object->fields = dol_sort_array($object->fields, 'position'); +$arrayfields = dol_sort_array($arrayfields, 'position'); + +$permissiontoread = $user->rights->stock->lire; +$permissiontoadd = $user->rights->stock->creer; +$permissiontodelete = $user->rights->stock->supprimer; + // Security check $socid = 0; if ($user->socid > 0) { // Protection if external user @@ -84,58 +132,14 @@ if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { $result = restrictedArea($user, 'stock', $objectid, '', 'inventory_advance'); } -// Initialize array of search criterias -$search_all = GETPOST("search_all", 'alpha'); -$search = array(); -foreach ($object->fields as $key => $val) { - if (GETPOST('search_'.$key, 'alpha')) { - $search[$key] = GETPOST('search_'.$key, 'alpha'); - } -} - -// List of fields to search into when doing a "search in all" -$fieldstosearchall = array(); -foreach ($object->fields as $key => $val) { - if (!empty($val['searchall'])) { - $fieldstosearchall['t.'.$key] = $val['label']; - } -} - -// Definition of fields for list -$arrayfields = array(); -foreach ($object->fields as $key => $val) { - // If $val['visible']==0, then we never show the field - if (!empty($val['visible'])) { - $arrayfields['t.'.$key] = array('label'=>$val['label'], 'checked'=>(($val['visible'] < 0) ? 0 : 1), 'enabled'=>($val['enabled'] && ($val['visible'] != 3)), 'position'=>$val['position']); - } -} -// Extra fields -if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0) { - foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - if (!empty($extrafields->attributes[$object->table_element]['list'][$key])) { - $arrayfields["ef.".$key] = array( - 'label'=>$extrafields->attributes[$object->table_element]['label'][$key], - 'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1), - 'position'=>$extrafields->attributes[$object->table_element]['pos'][$key], - 'enabled'=>(abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3 && $extrafields->attributes[$object->table_element]['perms'][$key]) - ); - } - } -} -$object->fields = dol_sort_array($object->fields, 'position'); -$arrayfields = dol_sort_array($arrayfields, 'position'); - -$permissiontoread = $user->rights->stock->lire; -$permissiontoadd = $user->rights->stock->creer; -$permissiontodelete = $user->rights->stock->supprimer; - /* * Actions */ if (GETPOST('cancel', 'alpha')) { - $action = 'list'; $massaction = ''; + $action = 'list'; + $massaction = ''; } if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; @@ -155,8 +159,12 @@ if (empty($reshook)) { if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers foreach ($object->fields as $key => $val) { $search[$key] = ''; + if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + $search[$key.'_dtstart'] = ''; + $search[$key.'_dtend'] = ''; + } } - $toselect = ''; + $toselect = array(); $search_array_options = array(); } if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha') @@ -184,18 +192,18 @@ $now = dol_now(); //$help_url="EN:Module_Inventory|FR:Module_Inventory_FR|ES:Módulo_Inventory"; $help_url = ''; $title = $langs->trans('ListOfInventories'); +$morejs = array(); +$morecss = array(); // Build and execute select // -------------------------------------------------------------------- $sql = 'SELECT '; -foreach ($object->fields as $key => $val) { - $sql .= 't.'.$key.', '; -} +$sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.' as options_'.$key.', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key.', ' : ''); } } // Add fields from hooks @@ -204,29 +212,48 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $obje $sql .= preg_replace('/^,/', '', $hookmanager->resPrint); $sql = preg_replace('/,\s*$/', '', $sql); $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; -if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { +if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; } +// Add table from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; if ($object->ismultientitymanaged == 1) { $sql .= " WHERE t.entity IN (".getEntity($object->element).")"; } else { $sql .= " WHERE 1 = 1"; } foreach ($search as $key => $val) { - if ($key == 'status' && $search[$key] == -1) { - continue; - } - $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); - if (strpos($object->fields[$key]['type'], 'integer:') === 0) { - if ($search[$key] == '-1') { - $search[$key] = ''; + if (array_key_exists($key, $object->fields)) { + if ($key == 'status' && $search[$key] == -1) { + continue; + } + $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); + if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) { + if ($search[$key] == '-1' || $search[$key] === '0') { + $search[$key] = ''; + } + $mode_search = 2; + } + if ($search[$key] != '') { + $sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search)); + } + } else { + if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') { + $columnName=preg_replace('/(_dtstart|_dtend)$/', '', $key); + if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) { + if (preg_match('/_dtstart$/', $key)) { + $sql .= " AND t." . $columnName . " >= '" . $db->idate($search[$key]) . "'"; + } + if (preg_match('/_dtend$/', $key)) { + $sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'"; + } + } } - $mode_search = 2; - } - if ($search[$key] != '') { - $sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search)); } } + if ($search_all) { $sql .= natural_search(array_keys($fieldstosearchall), $search_all); } @@ -239,7 +266,7 @@ $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $objec $sql .= $hookmanager->resPrint; /* If a group by is required -$sql.= " GROUP BY " +$sql.= " GROUP BY "; foreach($object->fields as $key => $val) { $sql.='t.'.$key.', '; @@ -250,7 +277,7 @@ if (! empty($extrafields->attributes[$object->table_element]['label'])) { } // Add where from hooks $parameters=array(); -$reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters); // Note that $action and $object may have been modified by hook +$reshook=$hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; $sql=preg_replace('/,\s*$/','', $sql); */ @@ -296,7 +323,7 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ // Output page // -------------------------------------------------------------------- -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'classforhorizontalscrolloftabs'); $arrayofselected = is_array($toselect) ? $toselect : array(); @@ -321,6 +348,10 @@ if ($optioncss != '') { } // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; +// Add $param from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook +$param .= $hookmanager->resPrint; // List of mass actions available $arrayofmassactions = array( @@ -337,7 +368,7 @@ if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'pr } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); -print '
    '; +print ''."\n"; if ($optioncss != '') { print ''; } @@ -351,7 +382,7 @@ print ''; $newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/inventory/card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); -print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit); +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); // Add code for pre mass action (confirmation or email presend form) $topicmail = "Information"; @@ -391,31 +422,38 @@ $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfi $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
    '; // You can use div-table-responsive-no-min if you dont need reserved height for your table -print ''."\n"; +print '
    '."\n"; // Fields title search // -------------------------------------------------------------------- print ''; foreach ($object->fields as $key => $val) { - $cssforfield = (empty($val['css']) ? '' : $val['css']); + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); if ($key == 'status') { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; - } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID') { + } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { $cssforfield .= ($cssforfield ? ' ' : '').'right'; } if (!empty($arrayfields['t.'.$key]['checked'])) { print ''; } @@ -439,14 +477,14 @@ print ''."\n"; // -------------------------------------------------------------------- print ''; foreach ($object->fields as $key => $val) { - $cssforfield = (empty($val['css']) ? '' : $val['css']); + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); if ($key == 'status') { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; - } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID') { + } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { $cssforfield .= ($cssforfield ? ' ' : '').'right'; } if (!empty($arrayfields['t.'.$key]['checked'])) { @@ -466,7 +504,7 @@ print ''."\n"; // Detect if we need a fetch on each output line $needToFetchEachLine = 0; -if (is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { +if (isset($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) { if (preg_match('/\$object/', $val)) { $needToFetchEachLine++; // There is at least one compute field that use $object @@ -478,6 +516,7 @@ if (is_array($extrafields->attributes[$object->table_element]['computed']) && co // -------------------------------------------------------------------- $i = 0; $totalarray = array(); +$totalarray['nbfield'] = 0; while ($i < ($limit ? min($num, $limit) : $num)) { $obj = $db->fetch_object($resql); if (empty($obj)) { @@ -490,7 +529,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { // Show here line of result print ''; foreach ($object->fields as $key => $val) { - $cssforfield = (empty($val['css']) ? '' : $val['css']); + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif ($key == 'status') { @@ -503,7 +542,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; } - if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'status') { + if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) { $cssforfield .= ($cssforfield ? ' ' : '').'right'; } @@ -511,6 +550,8 @@ while ($i < ($limit ? min($num, $limit) : $num)) { print ''; if ($key == 'status') { print $object->getLibStatut(5); + } elseif ($key == 'rowid') { + print $object->showOutputField($val, $key, $object->id, ''); } else { print $object->showOutputField($val, $key, $object->$key, ''); } diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 4ec2fcbadb1..a975dc2c21b 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -1023,11 +1023,15 @@ if ($resql) { } // Country if (!empty($arrayfields['p.fk_country']['checked'])) { - print ''; + print ''; } // State if (!empty($arrayfields['p.fk_state']['checked'])) { - print ''; + print ''; } // Accountancy code sell if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_sell']['checked'])) { diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 8e1d03411cd..e7e8c10d20c 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1385,6 +1385,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } if ($object->country_id) { + print img_picto('', 'state', 'class="pictofixedwidth"'); print $formcompany->select_state($object->state_id, $object->country_code); } else { print $countrynotdefined; @@ -2068,6 +2069,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 89cb19c129b..6046a960b45 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -209,7 +209,7 @@ input, select { margin-bottom: 1px; margin-top: 1px; } -#mainbody input.button:not(.buttongen):not(.bordertransp) { +#mainbody input.button:not(.buttongen):not(.bordertransp), #mainbody a.button:not(.buttongen):not(.bordertransp) { background: var(--butactionbg); color: #FFF !important; border-radius: 3px; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 5ad564ea5c0..aa87a36f01d 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1507,10 +1507,10 @@ table[summary="list_of_modules"] .fa-cog { div.divphotoref { padding-right: 10px !important; } - + .hideonsmartphone { display: none; } .hideonsmartphoneimp { display: none !important; } - + select.minwidth100imp, select.minwidth100, select.minwidth200, select.minwidth200imp, select.minwidth300 { width: calc(100% - 40px) !important; display: inline-block; @@ -1519,11 +1519,11 @@ table[summary="list_of_modules"] .fa-cog { width: calc(100% - 70px) !important; display: inline-block; } - + input.maxwidthinputfileonsmartphone { width: 175px; } - + .poweredbyimg { width: 48px; } @@ -3090,11 +3090,11 @@ div.tabsElem a { } div.tabBar { color: #; - padding-top: 16px; - padding-left: 16px; - padding-right: 16px; - padding-bottom: 16px; - margin: 0px 0px 16px 0px; + padding-top: 21px; + padding-left: 18px; + padding-right: 18px; + padding-bottom: 18px; + margin: 0px 0px 18px 0px; -webkit-border-radius: 3px; border-radius: 3px; border-right: 1px solid #BBB; diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 135e2072fdf..ef7136e2450 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1040,6 +1040,7 @@ if ($action == 'create' || $action == 'adduserldap') { // State if (empty($conf->global->USER_DISABLE_STATE)) { print ''; } @@ -2363,6 +2364,7 @@ if ($action == 'create' || $action == 'adduserldap') { if (empty($conf->global->USER_DISABLE_STATE)) { print ''; } @@ -559,7 +599,7 @@ print ''."\n"; // Detect if we need a fetch on each output line $needToFetchEachLine = 0; -if (is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { +if (isset($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) { if (preg_match('/\$object/', $val)) { $needToFetchEachLine++; // There is at least one compute field that use $object @@ -572,6 +612,7 @@ if (is_array($extrafields->attributes[$object->table_element]['computed']) && co // -------------------------------------------------------------------- $i = 0; $totalarray = array(); +$totalarray['nbfield'] = 0; while ($i < ($limit ? min($num, $limit) : $num)) { $obj = $db->fetch_object($resql); if (empty($obj)) { @@ -597,17 +638,16 @@ while ($i < ($limit ? min($num, $limit) : $num)) { $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; } - if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'status' && empty($val['arrayofkeyval'])) { + if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) { $cssforfield .= ($cssforfield ? ' ' : '').'right'; } - if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) { - $cssforfield = 'tdoverflowmax100'; - } if (!empty($arrayfields['t.'.$key]['checked'])) { print ''; if ($key == 'status') { print $object->getLibStatut(5); + } elseif ($key == 'rowid') { + print $object->showOutputField($val, $key, $object->id, ''); } else { print $object->showOutputField($val, $key, $object->$key, ''); } diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 0fe08bb1a4a..3996b5e49bd 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -97,23 +97,23 @@ class BOM extends CommonObject 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>"Id",), 'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=> 1, 'default'=>1, 'index'=>1, 'position'=>5), 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'noteditable'=>1, 'visible'=>4, 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of BOM", 'showoncombobox'=>'1',), - 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'notnull'=>1, 'searchall'=>1, 'showoncombobox'=>'2', 'autofocusoncreate'=>1), + 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'notnull'=>1, 'searchall'=>1, 'showoncombobox'=>'2', 'autofocusoncreate'=>1, 'css'=>'maxwidth300', 'csslist'=>'tdoverflowmax200'), 'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>1, 'position'=>33, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing', 1=>'Disassemble'), 'css'=>'minwidth150', 'csslist'=>'minwidth150 center'), //'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>-1, 'position'=>32, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing')), - 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:1:(finished IS NULL or finished <> 0)', 'label'=>'Product', 'picto'=>'product', 'enabled'=>1, 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'help'=>'ProductBOMHelp', 'css'=>'maxwidth500'), + 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:1:(finished IS NULL or finished <> 0)', 'label'=>'Product', 'picto'=>'product', 'enabled'=>1, 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'help'=>'ProductBOMHelp', 'css'=>'maxwidth500', 'csslist'=>'tdoverflowmax100'), 'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>60, 'notnull'=>-1,), 'qty' => array('type'=>'real', 'label'=>'Quantity', 'enabled'=>1, 'visible'=>1, 'default'=>1, 'position'=>55, 'notnull'=>1, 'isameasure'=>'1', 'css'=>'maxwidth75imp'), //'efficiency' => array('type'=>'real', 'label'=>'ManufacturingEfficiency', 'enabled'=>1, 'visible'=>-1, 'default'=>1, 'position'=>100, 'notnull'=>0, 'css'=>'maxwidth50imp', 'help'=>'ValueOfMeansLossForProductProduced'), 'duration' => array('type'=>'duration', 'label'=>'EstimatedDuration', 'enabled'=>1, 'visible'=>-1, 'position'=>101, 'notnull'=>-1, 'css'=>'maxwidth50imp', 'help'=>'EstimatedDurationDesc'), - 'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php:0', 'label'=>'WarehouseForProduction', 'picto'=>'stock', 'enabled'=>1, 'visible'=>-1, 'position'=>102, 'css'=>'maxwidth500'), + 'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php:0', 'label'=>'WarehouseForProduction', 'picto'=>'stock', 'enabled'=>1, 'visible'=>-1, 'position'=>102, 'css'=>'maxwidth500', 'csslist'=>'tdoverflowmax100'), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>-2, 'position'=>161, 'notnull'=>-1,), 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>-2, 'position'=>162, 'notnull'=>-1,), 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>300, 'notnull'=>1,), 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'position'=>501, 'notnull'=>1,), 'date_valid' => array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-2, 'position'=>502, 'notnull'=>0,), - 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserCreation', 'picto'=>'user', 'enabled'=>1, 'visible'=>-2, 'position'=>510, 'notnull'=>1, 'foreignkey'=>'user.rowid',), - 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'picto'=>'user', 'enabled'=>1, 'visible'=>-2, 'position'=>511, 'notnull'=>-1,), - 'fk_user_valid' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'picto'=>'user', 'enabled'=>1, 'visible'=>-2, 'position'=>512, 'notnull'=>0,), + 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserCreation', 'picto'=>'user', 'enabled'=>1, 'visible'=>-2, 'position'=>510, 'notnull'=>1, 'foreignkey'=>'user.rowid', 'csslist'=>'tdoverflowmax100'), + 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'picto'=>'user', 'enabled'=>1, 'visible'=>-2, 'position'=>511, 'notnull'=>-1, 'csslist'=>'tdoverflowmax100'), + 'fk_user_valid' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'picto'=>'user', 'enabled'=>1, 'visible'=>-2, 'position'=>512, 'notnull'=>0, 'csslist'=>'tdoverflowmax100'), 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000, 'notnull'=>-1,), 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>1010), 'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>2, 'position'=>1000, 'notnull'=>1, 'default'=>0, 'index'=>1, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Enabled', 9=>'Disabled')), @@ -786,6 +786,9 @@ class BOM extends CommonObject } $label .= '
    '; $label .= ''.$langs->trans('Ref').': '.$this->ref; + if (isset($this->label)) { + $label .= '
    '.$langs->trans('Label').': '.$this->label; + } $url = DOL_URL_ROOT.'/bom/bom_card.php?id='.$this->id; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 28da21926ab..13358074514 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3610,13 +3610,13 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ } if (in_array($pictowithouttext, array('dollyrevert', 'member', 'members', 'contract', 'group', 'resource', 'shipment'))) { - $morecss = 'em092'; + $morecss .= ' em092'; } if (in_array($pictowithouttext, array('conferenceorbooth', 'collab', 'eventorganization', 'holiday', 'info', 'project', 'workstation'))) { - $morecss = 'em088'; + $morecss .= ' em088'; } if (in_array($pictowithouttext, array('asset', 'intervention', 'payment', 'loan', 'partnership', 'stock', 'technic'))) { - $morecss = 'em080'; + $morecss .= ' em080'; } // Define $marginleftonlyshort diff --git a/htdocs/core/tpl/commonfields_add.tpl.php b/htdocs/core/tpl/commonfields_add.tpl.php index 3a43f04c149..d1d378e7e60 100644 --- a/htdocs/core/tpl/commonfields_add.tpl.php +++ b/htdocs/core/tpl/commonfields_add.tpl.php @@ -63,7 +63,7 @@ foreach ($object->fields as $key => $val) { print ''; print '
    '; print '
    '; if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { - print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); - } elseif (strpos($val['type'], 'integer:') === 0) { - print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth150', 1); - } elseif (!preg_match('/^(date|timestamp)/', $val['type'])) { - print ''; + print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); + } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) { + print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', 'maxwidth125', 1); + } elseif (!preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + print ''; + } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + print '
    '; + print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); + print '
    '; + print '
    '; + print $form->selectDate($search[$key.'_dtend'] ? $search[$key.'_dtend'] : '', "search_".$key."_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); + print '
    '; } print '
    '.$form->select_country($search_country, 'search_country', '', 0).''; + print $form->select_country($search_country, 'search_country', '', 0); + print ''.$formcompany->select_state($search_state, $search_country).''; + print $formcompany->select_state($search_state, $search_country); + print '
    '.$form->editfieldkey('State', 'state_id', '', $object, 0).''; } + print img_picto('', 'state', 'class="pictofixedwidth"'); print $formcompany->select_state($object->state_id, $object->country_code); print '
    '.$form->editfieldkey('State', 'state_id', '', $object, 0).''; + print img_picto('', 'state', 'class="pictofixedwidth"'); print $formcompany->select_state($object->state_id, $object->country_code, 'state_id'); print '
    '.$form->editfieldkey('State', 'state_id', '', $object, 0).''; if ($caneditfield) { + print img_picto('', 'state', 'class="pictofixedwidth"'); print $formcompany->select_state($object->state_id, $object->country_code, 'state_id'); } else { print $object->state_label; From 5853aa4c1e4da2f7e3f503ad470f4b72454c3ae6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 4 Jul 2021 20:08:34 +0200 Subject: [PATCH 0992/1497] Look and feel v14 --- htdocs/bom/bom_list.php | 100 +++++++++----- htdocs/bom/class/bom.class.php | 15 ++- htdocs/core/lib/functions.lib.php | 6 +- htdocs/core/tpl/commonfields_add.tpl.php | 2 +- htdocs/core/tpl/commonfields_edit.tpl.php | 2 +- .../template/class/myobject.class.php | 2 +- .../modulebuilder/template/myobject_list.php | 6 +- htdocs/mrp/class/mo.class.php | 17 ++- htdocs/mrp/mo_list.php | 123 ++++++++++++------ 9 files changed, 182 insertions(+), 91 deletions(-) diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index a47b1692ca9..6b54e8a4044 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -83,6 +83,10 @@ foreach ($object->fields as $key => $val) { if (GETPOST('search_'.$key, 'alpha') !== '') { $search[$key] = GETPOST('search_'.$key, 'alpha'); } + if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); + } } // List of fields to search into when doing a "search in all" @@ -131,7 +135,8 @@ $result = restrictedArea($user, 'bom'); */ if (GETPOST('cancel', 'alpha')) { - $action = 'list'; $massaction = ''; + $action = 'list'; + $massaction = ''; } if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; @@ -151,6 +156,10 @@ if (empty($reshook)) { if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers foreach ($object->fields as $key => $val) { $search[$key] = ''; + if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + $search[$key.'_dtstart'] = ''; + $search[$key.'_dtend'] = ''; + } } $toselect = array(); $search_array_options = array(); @@ -277,18 +286,18 @@ $now = dol_now(); $help_url = 'EN:Module_BOM'; $title = $langs->trans('ListOfBOMs'); +$morejs = array(); +$morecss = array(); // Build and execute select // -------------------------------------------------------------------- $sql = 'SELECT '; -foreach ($object->fields as $key => $val) { - $sql .= 't.'.$key.', '; -} +$sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.' as options_'.$key.', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key.', ' : ''); } } // Add fields from hooks @@ -297,33 +306,52 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $obje $sql .= preg_replace('/^,/', '', $hookmanager->resPrint); $sql = preg_replace('/,\s*$/', '', $sql); $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; -if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { +if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; } +// Add table from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; if ($object->ismultientitymanaged == 1) { $sql .= " WHERE t.entity IN (".getEntity($object->element).")"; } else { $sql .= " WHERE 1 = 1"; } foreach ($search as $key => $val) { - if ($key == 'status' && $search[$key] == -1) { + if (array_key_exists($key, $object->fields)) { + if ($key == 'status' && $search[$key] == -1) { continue; - } - $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); - if (strpos($object->fields[$key]['type'], 'integer:') === 0) { - if ($search[$key] == '-1') { - $search[$key] = ''; } - $mode_search = 2; - } - if ($search[$key] != '') { - $sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search)); + $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); + if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) { + if ($search[$key] == '-1' || $search[$key] === '0') { + $search[$key] = ''; + } + $mode_search = 2; + } + if ($search[$key] != '') { + $sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search)); + } + } else { + if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') { + $columnName=preg_replace('/(_dtstart|_dtend)$/', '', $key); + if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) { + if (preg_match('/_dtstart$/', $key)) { + $sql .= " AND t." . $columnName . " >= '" . $db->idate($search[$key]) . "'"; + } + if (preg_match('/_dtend$/', $key)) { + $sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'"; + } + } + } } } if ($search_all) { $sql .= natural_search(array_keys($fieldstosearchall), $search_all); } +//$sql.= dolSqlDateFilter("t.field", $search_xxxday, $search_xxxmonth, $search_xxxyear); // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks @@ -332,7 +360,7 @@ $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $objec $sql .= $hookmanager->resPrint; /* If a group by is required -$sql.= " GROUP BY " +$sql.= " GROUP BY "; foreach($object->fields as $key => $val) { $sql.='t.'.$key.', '; @@ -345,7 +373,7 @@ if (! empty($extrafields->attributes[$object->table_element]['label'])) { } // Add where from hooks $parameters=array(); -$reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters); // Note that $action and $object may have been modified by hook +$reshook=$hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; $sql=preg_replace('/,\s*$/','', $sql); */ @@ -391,7 +419,7 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ // Output page // -------------------------------------------------------------------- -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', ''); $arrayofselected = is_array($toselect) ? $toselect : array(); @@ -416,6 +444,10 @@ if ($optioncss != '') { } // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; +// Add $param from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook +$param .= $hookmanager->resPrint; // List of mass actions available $arrayofmassactions = array( @@ -431,7 +463,7 @@ if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'pr } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); -print ''; +print ''."\n"; if ($optioncss != '') { print ''; } @@ -440,11 +472,12 @@ print ''; print ''; print ''; +print ''; print ''; $newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/bom/bom_card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $user->rights->bom->write); -print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bom', 0, $newcardbutton, '', $limit, 0, 0, 1); +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); // Add code for pre mass action (confirmation or email presend form) $topicmail = "SendBillOfMaterialsRef"; @@ -504,11 +537,18 @@ foreach ($object->fields as $key => $val) { if (!empty($arrayfields['t.'.$key]['checked'])) { print ''; if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { - print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); + print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) { - print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth125', 1); - } elseif (!preg_match('/^(date|timestamp)/', $val['type'])) { - print ''; + print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', 'maxwidth125', 1); + } elseif (!preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + print ''; + } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + print '
    '; + print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); + print '
    '; + print '
    '; + print $form->selectDate($search[$key.'_dtend'] ? $search[$key.'_dtend'] : '', "search_".$key."_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); + print '
    '; } print '
    '; if (!empty($val['picto'])) { - print img_picto('', $val['picto']); + print img_picto('', $val['picto'], '', false, 0, 0, '', 'pictofixedwidth'); } if (in_array($val['type'], array('int', 'integer'))) { $value = GETPOST($key, 'int'); diff --git a/htdocs/core/tpl/commonfields_edit.tpl.php b/htdocs/core/tpl/commonfields_edit.tpl.php index 9fef2d2f2b9..bc74421e808 100644 --- a/htdocs/core/tpl/commonfields_edit.tpl.php +++ b/htdocs/core/tpl/commonfields_edit.tpl.php @@ -63,7 +63,7 @@ foreach ($object->fields as $key => $val) { print ''; if (!empty($val['picto'])) { - print img_picto('', $val['picto']); + print img_picto('', $val['picto'], '', false, 0, 0, '', 'pictofixedwidth'); } if (in_array($val['type'], array('int', 'integer'))) { $value = GETPOSTISSET($key) ?GETPOST($key, 'int') : $object->$key; diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index f07a0f04a10..65af15cffa8 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -84,7 +84,7 @@ class MyObject extends CommonObject * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...). * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). - * 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'maxwidth200', 'wordbreak', 'tdoverflowmax200', 'minwidth300 maxwidth500 widthcentpercentminusx' + * 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'cssview'=>'wordbreak', 'csslist'=>'tdoverflowmax200' * 'help' is a 'TranslationString' to use to show a tooltip on field. You can also use 'TranslationString:keyfortooltiponlick' for a tooltip on click. * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 76d736a5670..0081ec28551 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -334,7 +334,9 @@ foreach($object->fields as $key => $val) } // Add fields from extrafields if (! empty($extrafields->attributes[$object->table_element]['label'])) { - foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : ''); + foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : ''); + } } // Add where from hooks $parameters=array(); @@ -384,7 +386,7 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ // Output page // -------------------------------------------------------------------- -llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'classforhorizontalscrolloftabs'); +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', ''); // Example : Adding jquery code // print ''; -print ''."\n"; + print '
    ' . "\n"; -// Email -print ''."\n"; -// Company -print ''."\n"; -// Address -print ''."\n"; -// Zip / Town -print ''; -// Country -print '' . "\n"; + // Company + print '' . "\n"; + // Address + print '' . "\n"; + // Zip / Town + print ''; + // Country + print ''; -// State -if (empty($conf->global->SOCIETE_DISABLE_STATE)) { - print ''; + // State + if (empty($conf->global->SOCIETE_DISABLE_STATE)) { + print ''; + } + + print "
    '.$langs->trans("Email").'*
    '.$langs->trans("Company"); -if (!empty(floatval($project->price_registration))) { - print '*'; -} -print '
    '.$langs->trans("Address").''."\n"; -print '
    '.$langs->trans('Zip').' / '.$langs->trans('Town').''; -print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6, 1); -print ' / '; -print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); -print '
    '.$langs->trans('Country').'*'; -$country_id = GETPOST('country_id'); -if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { - $country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); -} -if (!$country_id && !empty($conf->geoipmaxmind->enabled)) { - $country_code = dol_user_country(); - //print $country_code; - if ($country_code) { - $new_country_id = getCountry($country_code, 3, $db, $langs); - //print 'xxx'.$country_code.' - '.$new_country_id; - if ($new_country_id) { - $country_id = $new_country_id; + // Email + print '
    ' . $langs->trans("Email") . '*
    ' . $langs->trans("Company"); + if (!empty(floatval($project->price_registration))) { + print '*'; + } + print '
    ' . $langs->trans("Address") . '' . "\n"; + print '
    ' . $langs->trans('Zip') . ' / ' . $langs->trans('Town') . ''; + print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6, 1); + print ' / '; + print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); + print '
    ' . $langs->trans('Country') . '*'; + $country_id = GETPOST('country_id'); + if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { + $country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); + } + if (!$country_id && !empty($conf->geoipmaxmind->enabled)) { + $country_code = dol_user_country(); + //print $country_code; + if ($country_code) { + $new_country_id = getCountry($country_code, 3, $db, $langs); + //print 'xxx'.$country_code.' - '.$new_country_id; + if ($new_country_id) { + $country_id = $new_country_id; + } } } -} -$country_code = getCountry($country_id, 2, $db, $langs); -print $form->select_country($country_id, 'country_id'); -print '
    '.$langs->trans('State').''; - if ($country_code) { - print $formcompany->select_state(GETPOST("state_id"), $country_code); - } else { - print ''; - } + $country_code = getCountry($country_id, 2, $db, $langs); + print $form->select_country($country_id, 'country_id'); print '
    ' . $langs->trans('State') . ''; + if ($country_code) { + print $formcompany->select_state(GETPOST("state_id"), $country_code); + } else { + print ''; + } + print '
    \n"; + + print dol_get_fiche_end(); + + // Save + print '
    '; + print ''; + if (!empty($backtopage)) { + print '     '; + } + print '
    '; + + + print "\n"; + print "
    "; + print ''; } -print "
    \n"; - -print dol_get_fiche_end(); - -// Save -print '
    '; -print ''; -if (!empty($backtopage)) { - print '     '; -} -print '
    '; - - -print "\n"; -print "
    "; -print '
    '; - - llxFooterVierge(); $db->close(); diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index 6329441778f..43a4b989687 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -405,6 +405,7 @@ if (empty($reshook) && $action == 'add') { $facture->paye = 0; $facture->date = dol_now(); $facture->cond_reglement_id = $contact->cond_reglement_id; + $facture->fk_project = $project->id; if (empty($facture->cond_reglement_id)) { $paymenttermstatic = new PaymentTerm($contact->db); @@ -569,7 +570,7 @@ jQuery(document).ready(function () { print ''."\n"; // Name -print ''; +print ''; print ''; print ''; // Email @@ -577,21 +578,6 @@ print ''."\n"; -// Type of event -print ''."\n"; -print ''; -// Label -print ''."\n"; -print ''."\n"; -// Note -print ''."\n"; -print ''."\n"; -// Start Date -print ''."\n"; -print ''."\n"; -// End Date -print ''."\n"; -print ''."\n"; // Address print ''."\n"; @@ -603,9 +589,8 @@ print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'se print ''; // Country print ''; } +// Type of event +print ''."\n"; +print ''; +// Label +print ''."\n"; +print ''."\n"; +// Note +print ''."\n"; +print ''."\n"; +// Start Date +print ''."\n"; +print ''."\n"; +// End Date +print ''."\n"; +print ''."\n"; + print "
    lastname).'" autofocus="autofocus">
    '.$langs->trans("Email").'*'.$langs->trans("Company").'*'; print '
    '.$langs->trans("EventType").'*'.FORM::selectarray('eventtype', $arrayofeventtype, $eventtype).'
    '.$langs->trans("Label").'*
    '.$langs->trans("Note").'*
    '.$langs->trans("DateStart").'*
    '.$langs->trans("DateEnd").'*
    '.$langs->trans("Address").''."\n"; print '
    '.$langs->trans('Country'); -if (!empty(floatval($project->price_booth))) { - print '*'; -} +print '*'; + print ''; $country_id = GETPOST('country_id'); if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { @@ -635,6 +620,22 @@ if (empty($conf->global->SOCIETE_DISABLE_STATE)) { } print '
    '.$langs->trans("EventType").'*'.FORM::selectarray('eventtype', $arrayofeventtype, $eventtype).'
    '.$langs->trans("LabelOfBooth").'*
    '.$langs->trans("Description").'*
    '.$langs->trans("DateStart").'*
    '.$langs->trans("DateEnd").'*
    \n"; diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index 00b093ba215..d63f2d2d98d 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -508,11 +508,11 @@ jQuery(document).ready(function () { print ''."\n"; // Last Name -print ''; +print ''; print ''; print ''; // First Name -print ''; +print ''; print ''; print ''; // Email @@ -520,21 +520,6 @@ print ''."\n"; -// Type of event -print ''."\n"; -print ''; -// Label -print ''."\n"; -print ''."\n"; -// Note -print ''."\n"; -print ''."\n"; -// Start Date -print ''."\n"; -print ''."\n"; -// End Date -print ''."\n"; -print ''."\n"; // Address print ''."\n"; @@ -574,6 +559,22 @@ if (empty($conf->global->SOCIETE_DISABLE_STATE)) { } print ''; } +// Type of event +print ''."\n"; +print ''; +// Label +print ''."\n"; +print ''."\n"; +// Note +print ''."\n"; +print ''."\n"; +// Start Date +print ''."\n"; +print ''."\n"; +// End Date +print ''."\n"; +print ''."\n"; + print "
    lastname).'" autofocus="autofocus">
    firstname).'" autofocus="autofocus">
    '.$langs->trans("Email").'*'.$langs->trans("Company").'*'; print '
    '.$langs->trans("EventType").'*'.FORM::selectarray('eventtype', $arrayofeventtype, $eventtype).'
    '.$langs->trans("Label").'*
    '.$langs->trans("Note").'*
    '.$langs->trans("DateStart").'
    '.$langs->trans("DateEnd").'
    '.$langs->trans("Address").''."\n"; print '
    '.$langs->trans("EventType").'*'.FORM::selectarray('eventtype', $arrayofeventtype, $eventtype).'
    '.$langs->trans("LabelOfconference").'*
    '.$langs->trans("Description").'*
    '.$langs->trans("DateStart").'
    '.$langs->trans("DateEnd").'
    \n"; From ca53abcef2abe690e5dbd1463e1294f3a210ae35 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 5 Jul 2021 15:35:05 +0200 Subject: [PATCH 1011/1497] fix email template type --- .../class/conferenceorbooth.class.php | 2 +- htdocs/install/mysql/data/llx_c_email_templates.sql | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index 10ed5668c63..bb84bbe37bd 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -108,7 +108,7 @@ class ConferenceOrBooth extends ActionComm 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>0, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'help'=>"Help text", 'showoncombobox'=>'1',), 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty",), 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1::eventorganization', 'label'=>'Project', 'enabled'=>'1', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1,), - 'note' => array('type'=>'text', 'label'=>'Description', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>1, 'csslist'=>'small'), + 'note' => array('type'=>'text', 'label'=>'Description', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>1), 'fk_action' => array('type'=>'sellist:c_actioncomm:libelle:id::module LIKE (\'%@eventorganization\')', 'label'=>'Format', 'enabled'=>'1', 'position'=>60, 'notnull'=>1, 'visible'=>1,), 'datep' => array('type'=>'datetime', 'label'=>'DateStart', 'enabled'=>'1', 'position'=>70, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'2',), 'datep2' => array('type'=>'datetime', 'label'=>'DateEnd', 'enabled'=>'1', 'position'=>71, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'3',), diff --git a/htdocs/install/mysql/data/llx_c_email_templates.sql b/htdocs/install/mysql/data/llx_c_email_templates.sql index acc09bad008..e2b1cd65077 100644 --- a/htdocs/install/mysql/data/llx_c_email_templates.sql +++ b/htdocs/install/mysql/data/llx_c_email_templates.sql @@ -35,9 +35,9 @@ INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0,'recruitment','recruitmentcandidature_send','',0,null,null,'(AnswerCandidature)' ,100,'$conf->recruitment->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourCandidature)__', '__(Hello)__ __CANDIDATE_FULLNAME__,

    \n\n__(YourCandidatureAnswerMessage)__
    __ONLINE_INTERVIEW_SCHEDULER_TEXT_AND_URL__\n

    \n__(Sincerely)__
    __USER_SIGNATURE__',null, 0); -- Event organization -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, 'EventOrganizationEmailAskConf', 10, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskConf)__', '__(Hello)__ __THIRDPARTY_NAME__,

    __(ThisIsContentOfYourOrganizationEventConfRequestWasReceived)__

    __ONLINE_PAYMENT_TEXT_AND_URL__


    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, 'EventOrganizationEmailAskBooth', 20, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskBooth)__', '__(Hello)__ __THIRDPARTY_NAME__,

    __(ThisIsContentOfYourOrganizationEventBoothRequestWasReceived)__

    __ONLINE_PAYMENT_TEXT_AND_URL__


    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, 'EventOrganizationEmailSubsBooth', 30, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsBooth)__', '__(Hello)__ __THIRDPARTY_NAME__,

    __(ThisIsContentOfYourOrganizationEventBoothSubscriptionWasReceived)__

    __ONLINE_PAYMENT_TEXT_AND_URL__


    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, 'EventOrganizationEmailSubsEvent', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsEvent)__', '__(Hello)__ __THIRDPARTY_NAME__,

    __(ThisIsContentOfYourOrganizationEventEventSubscriptionWasReceived)__

    __(Sincerely)__

    __MYCOMPANY_NAME__
    __USER_SIGNATURE__', null, '1', null); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, 'EventOrganizationMassEmailAttendees', 50, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailAttendees)__', '__(Hello)__ __THIRDPARTY_NAME__,

    __(ThisIsContentOfYourOrganizationEventBulkMailToAttendees)__

    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, 'EventOrganizationMassEmailSpeakers', 60, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailSpeakers)__', '__(Hello)__ __THIRDPARTY_NAME__,

    __(ThisIsContentOfYourOrganizationEventBulkMailToSpeakers)__

    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, 'EventOrganizationEmailAskConf', 10, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskConf)__', '__(Hello)__ __THIRDPARTY_NAME__,

    __(ThisIsContentOfYourOrganizationEventConfRequestWasReceived)__

    __ONLINE_PAYMENT_TEXT_AND_URL__


    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, 'EventOrganizationEmailAskBooth', 20, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskBooth)__', '__(Hello)__ __THIRDPARTY_NAME__,

    __(ThisIsContentOfYourOrganizationEventBoothRequestWasReceived)__

    __ONLINE_PAYMENT_TEXT_AND_URL__


    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, 'EventOrganizationEmailSubsBooth', 30, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsBooth)__', '__(Hello)__ __THIRDPARTY_NAME__,

    __(ThisIsContentOfYourOrganizationEventBoothSubscriptionWasReceived)__

    __ONLINE_PAYMENT_TEXT_AND_URL__


    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, 'EventOrganizationEmailSubsEvent', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsEvent)__', '__(Hello)__ __THIRDPARTY_NAME__,

    __(ThisIsContentOfYourOrganizationEventEventSubscriptionWasReceived)__

    __(Sincerely)__

    __MYCOMPANY_NAME__
    __USER_SIGNATURE__', null, '1', null); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, 'EventOrganizationMassEmailAttendees', 50, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailAttendees)__', '__(Hello)__ __THIRDPARTY_NAME__,

    __(ThisIsContentOfYourOrganizationEventBulkMailToAttendees)__

    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, 'EventOrganizationMassEmailSpeakers', 60, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailSpeakers)__', '__(Hello)__ __THIRDPARTY_NAME__,

    __(ThisIsContentOfYourOrganizationEventBulkMailToSpeakers)__

    __(Sincerely)__
    __USER_SIGNATURE__', null, '1', null); From 03f8557aaf33e842199a413811eeba2b1bf9efc9 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 5 Jul 2021 15:36:41 +0200 Subject: [PATCH 1012/1497] fix template email --- htdocs/admin/eventorganization.php | 12 ++++++------ htdocs/public/project/suggestbooth.php | 2 +- htdocs/public/project/suggestconference.php | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/eventorganization.php b/htdocs/admin/eventorganization.php index a57df57d782..53d27efeba2 100644 --- a/htdocs/admin/eventorganization.php +++ b/htdocs/admin/eventorganization.php @@ -54,12 +54,12 @@ $arrayofparameters = array( 'EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1), //'EVENTORGANIZATION_FILTERATTENDEES_CAT'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1), //'EVENTORGANIZATION_FILTERATTENDEES_TYPE'=>array('type'=>'thirdparty_type:', 'enabled'=>1), - 'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF'=>array('type'=>'emailtemplate:eventorganization_send', 'enabled'=>1), - 'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH'=>array('type'=>'emailtemplate:eventorganization_send', 'enabled'=>1), - 'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH'=>array('type'=>'emailtemplate:eventorganization_send', 'enabled'=>1), - 'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT'=>array('type'=>'emailtemplate:eventorganization_send', 'enabled'=>1), - 'EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_SPEAKER'=>array('type'=>'emailtemplate:eventorganization_send', 'enabled'=>1), - 'EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES'=>array('type'=>'emailtemplate:eventorganization_send', 'enabled'=>1), + 'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1), + 'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1), + 'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1), + 'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1), + 'EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_SPEAKER'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1), + 'EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1), 'EVENTORGANIZATION_SECUREKEY'=>array('type'=>'securekey', 'enabled'=>1), 'SERVICE_BOOTH_LOCATION'=>array('type'=>'product', 'enabled'=>1), 'SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION'=>array('type'=>'product', 'enabled'=>1), diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index 43a4b989687..3ab8e165c7e 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -470,7 +470,7 @@ if (empty($reshook) && $action == 'add') { $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH; if (!empty($labeltouse)) { - $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); + $arraydefaultmessage = $formmail->getEMailTemplate($db, 'conferenceorbooth', $user, $outputlangs, $labeltouse, 1, ''); } if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index d63f2d2d98d..399969bc80d 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -409,7 +409,7 @@ if (empty($reshook) && $action == 'add') { $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF; if (!empty($labeltouse)) { - $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); + $arraydefaultmessage = $formmail->getEMailTemplate($db, 'conferenceorbooth', $user, $outputlangs, $labeltouse, 1, ''); } if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { From 22c45fe7cc33a901a1bba1386d31458f8f8ca333 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 5 Jul 2021 15:44:11 +0200 Subject: [PATCH 1013/1497] Trans --- htdocs/langs/en_US/products.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index fecbe7450c2..bf34efe3f79 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -341,7 +341,7 @@ ProductSheet=Product sheet ServiceSheet=Service sheet PossibleValues=Possible values GoOnMenuToCreateVairants=Go on menu %s - %s to prepare attribute variants (like colors, size, ...) -UseProductFournDesc=Add a feature to define the descriptions of products defined by the vendors in addition to descriptions for customers +UseProductFournDesc=Add a feature to define the product description defined by the vendors (for each vendor reference) in addition to the description for customers ProductSupplierDescription=Vendor description for the product UseProductSupplierPackaging=Use packaging on supplier prices (recalculate quantities according to packaging set on supplier price when adding/updating line in supplier documents) PackagingForThisProduct=Packaging From 8b07e99e05a9ed3c57bdc00c6a469fbbaa5672ef Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 5 Jul 2021 16:08:47 +0200 Subject: [PATCH 1014/1497] Fix for ' inserted by CKEditor instead of ' --- htdocs/core/lib/functions.lib.php | 6 +++++- test/phpunit/SecurityTest.php | 9 +++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 13358074514..da93b01fc26 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -778,12 +778,16 @@ function checkVal($out = '', $check = 'alphanohtml', $filter = null, $options = do { $oldstringtoclean = $out; + // Ckeditor use the numeric entitic for apostrophe so we force it to text entity (all other special chars are correctly + // encoded using text entities). This is a fix for CKeditor. + $out = preg_replace('/'/i', ''', $out); + // We replace chars from a/A to z/Z encoded with numeric HTML entities with the real char so we won't loose the chars at the next step. // No need to use a loop here, this step is not to sanitize (this is done at next step, this is to try to save chars, even if they are // using a non coventionnel way to be encoded, to not have them sanitized just after) $out = preg_replace_callback('/&#(x?[0-9][0-9a-f]+;?)/i', 'realCharForNumericEntities', $out); - // Now we remove all remaining HTML entities staring with a number. We don't want such entities. + // Now we remove all remaining HTML entities starting with a number. We don't want such entities. $out = preg_replace('/&#x?[0-9]+/i', '', $out); // For example if we have javascript with an entities without the ; to hide the 'a' of 'javascript'. $out = dol_string_onlythesehtmltags($out, 0, 1, 1); diff --git a/test/phpunit/SecurityTest.php b/test/phpunit/SecurityTest.php index 08d4ec88703..d75ec962020 100644 --- a/test/phpunit/SecurityTest.php +++ b/test/phpunit/SecurityTest.php @@ -321,6 +321,10 @@ class SecurityTest extends PHPUnit\Framework\TestCase $test="XSS"; $result=testSqlAndScriptInject($test, 0); $this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on testSqlAndScriptInject lll'); + + $test="Text with ' encoded with the numeric html entity converted into text entity ' (like when submited by CKEditor)"; + $result=testSqlAndScriptInject($test, 0); + $this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on testSqlAndScriptInject mmm'); } /** @@ -358,6 +362,7 @@ class SecurityTest extends PHPUnit\Framework\TestCase $_POST["param12"]='aaa'; $_POST["param13"]='n n > < " XSS'; $_POST["param13b"]='n n > < " XSS'; + $_POST["param14"]="Text with ' encoded with the numeric html entity converted into text entity ' (like when submited by CKEditor)"; //$_POST["param13"]='javascript%26colon%26%23x3B%3Balert(1)'; //$_POST["param14"]='javascripT&javascript#x3a alert(1)'; @@ -494,6 +499,10 @@ class SecurityTest extends PHPUnit\Framework\TestCase print __METHOD__." result=".$result."\n"; $this->assertEquals('n n > < " XSS', $result, 'Test 13b that HTML entities are decoded with restricthtml, but only for common alpha chars'); + $result=GETPOST("param14", 'restricthtml'); + print __METHOD__." result=".$result."\n"; + $this->assertEquals("Text with ' encoded with the numeric html entity converted into text entity ' (like when submited by CKEditor)", $result, 'Test 14'); + // Special test for GETPOST of backtopage, backtolist or backtourl parameter $_POST["backtopage"]='//www.google.com'; From eea90cef566b3cd234476f59eb8327b328d52c19 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Mon, 5 Jul 2021 16:31:33 +0200 Subject: [PATCH 1015/1497] FIX: holiday: balances not updated correctly with pgsql because of case sensitivity --- htdocs/holiday/class/holiday.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 2e61c014532..b7a8d41f699 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -2112,7 +2112,7 @@ class Holiday extends CommonObject { global $mysoc; - $sql = "SELECT rowid, code, label, affect, delay, newByMonth"; + $sql = "SELECT rowid, code, label, affect, delay, newbymonth"; $sql .= " FROM ".MAIN_DB_PREFIX."c_holiday_types"; $sql .= " WHERE (fk_country IS NULL OR fk_country = ".$mysoc->country_id.')'; if ($active >= 0) $sql .= " AND active = ".((int) $active); @@ -2126,7 +2126,7 @@ class Holiday extends CommonObject { while ($obj = $this->db->fetch_object($result)) { - $types[$obj->rowid] = array('rowid'=> $obj->rowid, 'code'=> $obj->code, 'label'=>$obj->label, 'affect'=>$obj->affect, 'delay'=>$obj->delay, 'newByMonth'=>$obj->newByMonth); + $types[$obj->rowid] = array('rowid'=> $obj->rowid, 'code'=> $obj->code, 'label'=>$obj->label, 'affect'=>$obj->affect, 'delay'=>$obj->delay, 'newByMonth'=>$obj->newbymonth); } return $types; From d414bcb572f4459a863dcdf05a88f68faedc3793 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 5 Jul 2021 17:08:10 +0200 Subject: [PATCH 1016/1497] Fix phpcs --- htdocs/core/tpl/objectline_view.tpl.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 3463de14240..444d847e25a 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -314,8 +314,7 @@ if ($outputalsopricetotalwithtax) { $coldisplay++; } -if ($this->statut == 0 && ($object_rights->creer) && $action != 'selectlines') { - +if ($this->statut == 0 && !empty($object_rights->creer) && $action != 'selectlines') { $situationinvoicelinewithparent = 0; if ($line->fk_prev_id != null && in_array($object->element, array('facture', 'facturedet'))) { if ($object->type == $object::TYPE_SITUATION) { // The constant TYPE_SITUATION exists only for object invoice From 87f9530272925f0d651f59337a35661faeb6f377 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 5 Jul 2021 17:29:10 +0200 Subject: [PATCH 1017/1497] Fix report by Ahsan Aziz (can reset the password of another user that did not request password reset). --- htdocs/user/passwordforgotten.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php index cb149f1e481..63f33b5f8ec 100644 --- a/htdocs/user/passwordforgotten.php +++ b/htdocs/user/passwordforgotten.php @@ -87,14 +87,14 @@ if (empty($reshook)) { // Validate new password if ($action == 'validatenewpassword' && $username && $passworduidhash) { $edituser = new User($db); - $result = $edituser->fetch('', $_GET["username"]); + $result = $edituser->fetch('', $username); if ($result < 0) { $message = '
    '.dol_escape_htmltag($langs->trans("ErrorLoginDoesNotExists", $username)).'
    '; } else { global $dolibarr_main_instance_unique_id; //print $edituser->pass_temp.'-'.$edituser->id.'-'.$dolibarr_main_instance_unique_id.' '.$passworduidhash; - if (dol_verifyHash($edituser->pass_temp.'-'.$edituser->id.'-'.$dolibarr_main_instance_unique_id, $passworduidhash)) { + if ($edituser->pass_temp && dol_verifyHash($edituser->pass_temp.'-'.$edituser->id.'-'.$dolibarr_main_instance_unique_id, $passworduidhash)) { // Clear session unset($_SESSION['dol_login']); $_SESSION['dol_loginmesg'] = $langs->trans('NewPasswordValidated'); // Save message for the session page From f648185839689cf70fd3fcb254b2ce7313ba6c87 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 5 Jul 2021 17:34:25 +0200 Subject: [PATCH 1018/1497] Fix phpcs --- htdocs/core/lib/security2.lib.php | 4 ++-- test/phpunit/SecurityTest.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php index 523b8ccf2cb..4408e2ccd52 100644 --- a/htdocs/core/lib/security2.lib.php +++ b/htdocs/core/lib/security2.lib.php @@ -476,8 +476,8 @@ function getRandomPassword($generic = false, $replaceambiguouschars = null, $len } $generated_password = str_shuffle($randomCode); - } else // Old platform, non cryptographic random - { + } else { + // Old platform, non cryptographic random $max = strlen($lowercase) - 1; for ($x = 0; $x < $nbofchar; $x++) { $tmp = mt_rand(0, $max); diff --git a/test/phpunit/SecurityTest.php b/test/phpunit/SecurityTest.php index d75ec962020..63c52ac60c5 100644 --- a/test/phpunit/SecurityTest.php +++ b/test/phpunit/SecurityTest.php @@ -323,8 +323,8 @@ class SecurityTest extends PHPUnit\Framework\TestCase $this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on testSqlAndScriptInject lll'); $test="Text with ' encoded with the numeric html entity converted into text entity ' (like when submited by CKEditor)"; - $result=testSqlAndScriptInject($test, 0); - $this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on testSqlAndScriptInject mmm'); + $result=testSqlAndScriptInject($test, 0); // result must be 0 + $this->assertEquals(0, $result, 'Error on testSqlAndScriptInject mmm'); } /** From 65adb16191c3d1751922267f374b19ed78247a58 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 5 Jul 2021 17:55:17 +0200 Subject: [PATCH 1019/1497] Fix increase entrophy of default password generation. --- .../generate/modGeneratePassStandard.class.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php b/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php index e091b5069e9..a358f916429 100644 --- a/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php +++ b/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php @@ -99,7 +99,7 @@ class modGeneratePassStandard extends ModeleGenPassword $password = ""; // define possible characters - $possible = "0123456789bcdfghjkmnpqrstvwxyz"; + $possible = "0123456789qwertyuiopasdfghjklzxcvbnmASDFGHJKLZXCVBNMQWERTYUIOP"; // set up a counter $i = 0; @@ -107,10 +107,13 @@ class modGeneratePassStandard extends ModeleGenPassword // add random characters to $password until $length is reached while ($i < $this->length) { // pick a random character from the possible ones - $char = substr($possible, mt_rand(0, dol_strlen($possible) - 1), 1); + if (function_exists('random_int')) { // Cryptographic random + $char = substr($possible, random_int(0, dol_strlen($possible) - 1), 1); + } else { + $char = substr($possible, mt_rand(0, dol_strlen($possible) - 1), 1); + } - // we don't want this character if it's already in the password - if (!strstr($password, $char)) { + if (substr_count($password, $char) <= 6) { // we don't want this character if it's already 5 times in the password $password .= $char; $i++; } From a14c68e996d39cf315a89a4b6ceedc70bfc0871b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 5 Jul 2021 18:14:52 +0200 Subject: [PATCH 1020/1497] Fix Hide sensitive key on info page --- htdocs/admin/system/dolibarr.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index 9af09164469..f1ba888d2ca 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -400,8 +400,10 @@ foreach ($configfileparameters as $key => $value) { if (in_array($newkey, array('dolibarr_main_db_pass', 'dolibarr_main_auth_ldap_admin_pass'))) { if (empty($dolibarr_main_prod)) { print ''; + print showValueWithClipboardCPButton(${$newkey}, 0, '********'); + } else { + print '**********'; } - print '**********'; } elseif ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/', ${$newkey})) { print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT'); } elseif ($newkey == 'dolibarr_main_document_root_alt') { @@ -420,9 +422,14 @@ foreach ($configfileparameters as $key => $value) { } } elseif ($newkey == 'dolibarr_main_instance_unique_id') { //print $conf->file->instance_unique_id; - global $dolibarr_main_cookie_cryptkey; - $valuetoshow = ${$newkey} ? ${$newkey} : $dolibarr_main_cookie_cryptkey; // Use $dolibarr_main_instance_unique_id first then $dolibarr_main_cookie_cryptkey - print $valuetoshow; + global $dolibarr_main_cookie_cryptkey, $dolibarr_main_instance_unique_id; + $valuetoshow = $dolibarr_main_instance_unique_id ? $dolibarr_main_instance_unique_id : $dolibarr_main_cookie_cryptkey; // Use $dolibarr_main_instance_unique_id first then $dolibarr_main_cookie_cryptkey + if (empty($dolibarr_main_prod)) { + print ''; + print showValueWithClipboardCPButton($valuetoshow, 0, '********'); + } else { + print '**********'; + } if (empty($valuetoshow)) { print img_warning("EditConfigFileToAddEntry", 'dolibarr_main_instance_unique_id'); } From 38d272e31ad77167cc4c9bbdb3280832d2e2446c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 5 Jul 2021 18:16:52 +0200 Subject: [PATCH 1021/1497] Better position of fields --- htdocs/admin/system/dolibarr.php | 103 ++++++++++++++++--------------- 1 file changed, 52 insertions(+), 51 deletions(-) diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index f1ba888d2ca..38c6cdc446a 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -309,57 +309,58 @@ print '
    '; // Parameters in conf.php file (when a parameter start with ?, it is shown only if defined) $configfileparameters = array( - 'dolibarr_main_url_root' => $langs->trans("URLRoot"), - '?dolibarr_main_url_root_alt' => $langs->trans("URLRoot").' (alt)', - 'dolibarr_main_document_root'=> $langs->trans("DocumentRootServer"), - '?dolibarr_main_document_root_alt' => $langs->trans("DocumentRootServer").' (alt)', - 'dolibarr_main_data_root' => $langs->trans("DataRootServer"), - 'dolibarr_main_instance_unique_id' => $langs->trans("InstanceUniqueID"), - 'separator1' => '', - 'dolibarr_main_db_host' => $langs->trans("DatabaseServer"), - 'dolibarr_main_db_port' => $langs->trans("DatabasePort"), - 'dolibarr_main_db_name' => $langs->trans("DatabaseName"), - 'dolibarr_main_db_type' => $langs->trans("DriverType"), - 'dolibarr_main_db_user' => $langs->trans("DatabaseUser"), - 'dolibarr_main_db_pass' => $langs->trans("DatabasePassword"), - 'dolibarr_main_db_character_set' => $langs->trans("DBStoringCharset"), - 'dolibarr_main_db_collation' => $langs->trans("DBSortingCollation"), - '?dolibarr_main_db_prefix' => $langs->trans("Prefix"), - 'separator2' => '', - 'dolibarr_main_authentication' => $langs->trans("AuthenticationMode"), - '?multicompany_transverse_mode'=> $langs->trans("MultiCompanyMode"), - 'separator'=> '', - '?dolibarr_main_auth_ldap_login_attribute' => 'dolibarr_main_auth_ldap_login_attribute', - '?dolibarr_main_auth_ldap_host' => 'dolibarr_main_auth_ldap_host', - '?dolibarr_main_auth_ldap_port' => 'dolibarr_main_auth_ldap_port', - '?dolibarr_main_auth_ldap_version' => 'dolibarr_main_auth_ldap_version', - '?dolibarr_main_auth_ldap_dn' => 'dolibarr_main_auth_ldap_dn', - '?dolibarr_main_auth_ldap_admin_login' => 'dolibarr_main_auth_ldap_admin_login', - '?dolibarr_main_auth_ldap_admin_pass' => 'dolibarr_main_auth_ldap_admin_pass', - '?dolibarr_main_auth_ldap_debug' => 'dolibarr_main_auth_ldap_debug', - 'separator3' => '', - '?dolibarr_lib_ADODB_PATH' => 'dolibarr_lib_ADODB_PATH', - '?dolibarr_lib_FPDF_PATH' => 'dolibarr_lib_FPDF_PATH', - '?dolibarr_lib_TCPDF_PATH' => 'dolibarr_lib_TCPDF_PATH', - '?dolibarr_lib_FPDI_PATH' => 'dolibarr_lib_FPDI_PATH', - '?dolibarr_lib_TCPDI_PATH' => 'dolibarr_lib_TCPDI_PATH', - '?dolibarr_lib_NUSOAP_PATH' => 'dolibarr_lib_NUSOAP_PATH', - '?dolibarr_lib_GEOIP_PATH' => 'dolibarr_lib_GEOIP_PATH', - '?dolibarr_lib_ODTPHP_PATH' => 'dolibarr_lib_ODTPHP_PATH', - '?dolibarr_lib_ODTPHP_PATHTOPCLZIP' => 'dolibarr_lib_ODTPHP_PATHTOPCLZIP', - '?dolibarr_js_CKEDITOR' => 'dolibarr_js_CKEDITOR', - '?dolibarr_js_JQUERY' => 'dolibarr_js_JQUERY', - '?dolibarr_js_JQUERY_UI' => 'dolibarr_js_JQUERY_UI', - '?dolibarr_font_DOL_DEFAULT_TTF' => 'dolibarr_font_DOL_DEFAULT_TTF', - '?dolibarr_font_DOL_DEFAULT_TTF_BOLD' => 'dolibarr_font_DOL_DEFAULT_TTF_BOLD', - 'separator4' => '', - 'dolibarr_main_prod' => 'Production mode (Hide all error messages)', - 'dolibarr_main_restrict_os_commands' => 'Restrict CLI commands for backups', - 'dolibarr_main_restrict_ip' => 'Restrict access to some IPs only', - '?dolibarr_mailing_limit_sendbyweb' => 'Limit nb of email sent by page', - '?dolibarr_mailing_limit_sendbycli' => 'Limit nb of email sent by cli', - '?dolibarr_strict_mode' => 'Strict mode is on/off', - '?dolibarr_nocsrfcheck' => 'Disable CSRF security checks' + 'dolibarr_main_prod' => 'Production mode (Hide all error messages)', + 'separator0' => '', + 'dolibarr_main_url_root' => $langs->trans("URLRoot"), + '?dolibarr_main_url_root_alt' => $langs->trans("URLRoot").' (alt)', + 'dolibarr_main_document_root'=> $langs->trans("DocumentRootServer"), + '?dolibarr_main_document_root_alt' => $langs->trans("DocumentRootServer").' (alt)', + 'dolibarr_main_data_root' => $langs->trans("DataRootServer"), + 'dolibarr_main_instance_unique_id' => $langs->trans("InstanceUniqueID"), + 'separator1' => '', + 'dolibarr_main_db_host' => $langs->trans("DatabaseServer"), + 'dolibarr_main_db_port' => $langs->trans("DatabasePort"), + 'dolibarr_main_db_name' => $langs->trans("DatabaseName"), + 'dolibarr_main_db_type' => $langs->trans("DriverType"), + 'dolibarr_main_db_user' => $langs->trans("DatabaseUser"), + 'dolibarr_main_db_pass' => $langs->trans("DatabasePassword"), + 'dolibarr_main_db_character_set' => $langs->trans("DBStoringCharset"), + 'dolibarr_main_db_collation' => $langs->trans("DBSortingCollation"), + '?dolibarr_main_db_prefix' => $langs->trans("DatabasePrefix"), + 'separator2' => '', + 'dolibarr_main_authentication' => $langs->trans("AuthenticationMode"), + '?multicompany_transverse_mode'=> $langs->trans("MultiCompanyMode"), + 'separator'=> '', + '?dolibarr_main_auth_ldap_login_attribute' => 'dolibarr_main_auth_ldap_login_attribute', + '?dolibarr_main_auth_ldap_host' => 'dolibarr_main_auth_ldap_host', + '?dolibarr_main_auth_ldap_port' => 'dolibarr_main_auth_ldap_port', + '?dolibarr_main_auth_ldap_version' => 'dolibarr_main_auth_ldap_version', + '?dolibarr_main_auth_ldap_dn' => 'dolibarr_main_auth_ldap_dn', + '?dolibarr_main_auth_ldap_admin_login' => 'dolibarr_main_auth_ldap_admin_login', + '?dolibarr_main_auth_ldap_admin_pass' => 'dolibarr_main_auth_ldap_admin_pass', + '?dolibarr_main_auth_ldap_debug' => 'dolibarr_main_auth_ldap_debug', + 'separator3' => '', + '?dolibarr_lib_ADODB_PATH' => 'dolibarr_lib_ADODB_PATH', + '?dolibarr_lib_FPDF_PATH' => 'dolibarr_lib_FPDF_PATH', + '?dolibarr_lib_TCPDF_PATH' => 'dolibarr_lib_TCPDF_PATH', + '?dolibarr_lib_FPDI_PATH' => 'dolibarr_lib_FPDI_PATH', + '?dolibarr_lib_TCPDI_PATH' => 'dolibarr_lib_TCPDI_PATH', + '?dolibarr_lib_NUSOAP_PATH' => 'dolibarr_lib_NUSOAP_PATH', + '?dolibarr_lib_GEOIP_PATH' => 'dolibarr_lib_GEOIP_PATH', + '?dolibarr_lib_ODTPHP_PATH' => 'dolibarr_lib_ODTPHP_PATH', + '?dolibarr_lib_ODTPHP_PATHTOPCLZIP' => 'dolibarr_lib_ODTPHP_PATHTOPCLZIP', + '?dolibarr_js_CKEDITOR' => 'dolibarr_js_CKEDITOR', + '?dolibarr_js_JQUERY' => 'dolibarr_js_JQUERY', + '?dolibarr_js_JQUERY_UI' => 'dolibarr_js_JQUERY_UI', + '?dolibarr_font_DOL_DEFAULT_TTF' => 'dolibarr_font_DOL_DEFAULT_TTF', + '?dolibarr_font_DOL_DEFAULT_TTF_BOLD' => 'dolibarr_font_DOL_DEFAULT_TTF_BOLD', + 'separator4' => '', + 'dolibarr_main_restrict_os_commands' => 'Restrict CLI commands for backups', + 'dolibarr_main_restrict_ip' => 'Restrict access to some IPs only', + '?dolibarr_mailing_limit_sendbyweb' => 'Limit nb of email sent by page', + '?dolibarr_mailing_limit_sendbycli' => 'Limit nb of email sent by cli', + '?dolibarr_strict_mode' => 'Strict mode is on/off', + '?dolibarr_nocsrfcheck' => 'Disable CSRF security checks' ); print '
    '; From 3ac72fe73c70cd35788f8be7141021a2294403b4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 5 Jul 2021 18:19:02 +0200 Subject: [PATCH 1022/1497] Fix --- htdocs/admin/system/dolibarr.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index 38c6cdc446a..0271488b65a 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -310,13 +310,13 @@ print '
    '; // Parameters in conf.php file (when a parameter start with ?, it is shown only if defined) $configfileparameters = array( 'dolibarr_main_prod' => 'Production mode (Hide all error messages)', + 'dolibarr_main_instance_unique_id' => $langs->trans("InstanceUniqueID"), 'separator0' => '', 'dolibarr_main_url_root' => $langs->trans("URLRoot"), '?dolibarr_main_url_root_alt' => $langs->trans("URLRoot").' (alt)', 'dolibarr_main_document_root'=> $langs->trans("DocumentRootServer"), '?dolibarr_main_document_root_alt' => $langs->trans("DocumentRootServer").' (alt)', 'dolibarr_main_data_root' => $langs->trans("DataRootServer"), - 'dolibarr_main_instance_unique_id' => $langs->trans("InstanceUniqueID"), 'separator1' => '', 'dolibarr_main_db_host' => $langs->trans("DatabaseServer"), 'dolibarr_main_db_port' => $langs->trans("DatabasePort"), From abb1ad6bf0469eccd2b58beb20bdabc18fc36e22 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 5 Jul 2021 18:46:27 +0200 Subject: [PATCH 1023/1497] Fix sql injection --- htdocs/compta/bank/class/account.class.php | 4 ++-- htdocs/compta/sociales/class/cchargesociales.class.php | 8 ++++---- htdocs/societe/card.php | 2 +- htdocs/societe/class/societe.class.php | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 46d1bb93684..8619ff25dae 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -829,8 +829,8 @@ class Account extends CommonObject $sql .= ",min_desired = ".($this->min_desired != '' ? price2num($this->min_desired) : "null"); $sql .= ",comment = '".$this->db->escape($this->comment)."'"; - $sql .= ",state_id = ".($this->state_id > 0 ? $this->state_id : "null"); - $sql .= ",fk_pays = ".($this->country_id > 0 ? $this->country_id : "null"); + $sql .= ",state_id = ".($this->state_id > 0 ? ((int) $this->state_id) : "null"); + $sql .= ",fk_pays = ".($this->country_id > 0 ? ((int) $this->country_id) : "null"); $sql .= ",ics = '".$this->db->escape($this->ics)."'"; $sql .= ",ics_transfer = '".$this->db->escape($this->ics_transfer)."'"; diff --git a/htdocs/compta/sociales/class/cchargesociales.class.php b/htdocs/compta/sociales/class/cchargesociales.class.php index 8cfadd84f4f..ee9a270b283 100644 --- a/htdocs/compta/sociales/class/cchargesociales.class.php +++ b/htdocs/compta/sociales/class/cchargesociales.class.php @@ -260,13 +260,13 @@ class Cchargesociales // Update request $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element.' SET'; $sql .= ' libelle = '.(isset($this->libelle) ? "'".$this->db->escape($this->libelle)."'" : "null").','; - $sql .= ' deductible = '.(isset($this->deductible) ? $this->deductible : "null").','; - $sql .= ' active = '.(isset($this->active) ? $this->active : "null").','; + $sql .= ' deductible = '.(isset($this->deductible) ? ((int) $this->deductible) : "null").','; + $sql .= ' active = '.(isset($this->active) ? ((int) $this->active) : "null").','; $sql .= ' code = '.(isset($this->code) ? "'".$this->db->escape($this->code)."'" : "null").','; - $sql .= ' fk_pays = '.(isset($this->fk_pays) ? $this->fk_pays : "null").','; + $sql .= ' fk_pays = '.((isset($this->fk_pays) && $this->fk_pays > 0) ? ((int) $this->fk_pays) : "null").','; $sql .= ' module = '.(isset($this->module) ? "'".$this->db->escape($this->module)."'" : "null").','; $sql .= ' accountancy_code = '.(isset($this->accountancy_code) ? "'".$this->db->escape($this->accountancy_code)."'" : "null"); - $sql .= ' WHERE id='.$this->id; + $sql .= ' WHERE id='.((int) $this->id); $this->db->begin(); diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index e7e8c10d20c..ba4023dbba9 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -554,7 +554,7 @@ if (empty($reshook)) { } // We set country_id, country_code and country for the selected country - $object->country_id = GETPOST('country_id') != '' ?GETPOST('country_id') : $mysoc->country_id; + $object->country_id = GETPOST('country_id', 'int') != '' ? GETPOST('country_id', 'int') : $mysoc->country_id; if ($object->country_id) { $tmparray = getCountry($object->country_id, 'all'); $object->country_code = $tmparray['code']; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index a213cca5577..eff2ba39c21 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -894,7 +894,7 @@ class Societe extends CommonObject $sql .= ", ".(!empty($user->id) ? ((int) $user->id) : "null"); $sql .= ", ".(!empty($this->typent_id) ? ((int) $this->typent_id) : "null"); $sql .= ", ".(!empty($this->canvas) ? "'".$this->db->escape($this->canvas)."'" : "null"); - $sql .= ", ".$this->status; + $sql .= ", ".((int) $this->status); $sql .= ", ".(!empty($this->ref_ext) ? "'".$this->db->escape($this->ref_ext)."'" : "null"); $sql .= ", 0"; $sql .= ", ".(int) $this->fk_incoterms; @@ -1369,13 +1369,13 @@ class Societe extends CommonObject $sql .= ",zip = ".(!empty($this->zip) ? "'".$this->db->escape($this->zip)."'" : "null"); $sql .= ",town = ".(!empty($this->town) ? "'".$this->db->escape($this->town)."'" : "null"); - $sql .= ",fk_departement = '".(!empty($this->state_id) ? $this->state_id : '0')."'"; - $sql .= ",fk_pays = '".(!empty($this->country_id) ? $this->country_id : '0')."'"; + $sql .= ",fk_departement = ".((!empty($this->state_id) && $this->state_id > 0) ? ((int) $this->state_id) : 'null'); + $sql .= ",fk_pays = ".((!empty($this->country_id) && $this->country_id > 0) ? ((int) $this->country_id) : 'null'); $sql .= ",phone = ".(!empty($this->phone) ? "'".$this->db->escape($this->phone)."'" : "null"); $sql .= ",fax = ".(!empty($this->fax) ? "'".$this->db->escape($this->fax)."'" : "null"); $sql .= ",email = ".(!empty($this->email) ? "'".$this->db->escape($this->email)."'" : "null"); - $sql .= ", socialnetworks = '".$this->db->escape(json_encode($this->socialnetworks))."'"; + $sql .= ",socialnetworks = '".$this->db->escape(json_encode($this->socialnetworks))."'"; $sql .= ",url = ".(!empty($this->url) ? "'".$this->db->escape($this->url)."'" : "null"); $sql .= ",parent = ".($this->parent > 0 ? $this->parent : "null"); From e2d7de31460a1c4de7aa410874910d96c47f3701 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 5 Jul 2021 18:56:24 +0200 Subject: [PATCH 1024/1497] css --- htdocs/core/tpl/login.tpl.php | 2 +- htdocs/core/tpl/passwordforgotten.tpl.php | 2 +- htdocs/theme/eldy/global.inc.php | 7 ++++++- htdocs/theme/md/style.css.php | 7 ++++++- htdocs/user/passwordforgotten.php | 4 ++-- 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 9af5bc7d7b4..e668d1e6d58 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -356,7 +356,7 @@ if (!empty($conf->global->MAIN_EASTER_EGG_COMMITSTRIP)) { -