diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 432f30f2332..00000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -name: Bug report -about: Create a report to help us fix something that is broken -title: '' -labels: Bug -assignees: '' - ---- - -# Instructions -*This is a template to help you report good issues. You may use [Github Markdown](https://help.github.com/articles/getting-started-with-writing-and-formatting-on-github/) syntax to format your issue report.* -*Please:* -- *replace the bracket enclosed texts with meaningful information* -- *remove any unused sub-section* - - -# Bug -[*Short description*] - -## Environment -- **Version**: [*Affected Dolibarr version(s)*] -- **OS**: [*Server OS type and version*] -- **Web server**: [*Webserver type and version*] -- **PHP**: [*PHP version*] -- **Database**: [*Database type and version*] -- **URL(s)**: [*Affected URL(s)*] - -## Expected and actual behavior -[*Verbose description*] - -## Steps to reproduce the behavior -[*Verbose description*] - -## [Attached files](https://help.github.com/articles/issue-attachments) (Screenshots, screencasts, dolibarr.log, debugging informations…) -[*Files*] diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 00000000000..d7dc3d584e3 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,71 @@ +name: Bug report +description: Create a report to help us fix something that is broken +labels: ["Bug"] + +body: + - type: markdown + attributes: + value: | + This is a template to help you report good issues. You may use [Github Markdown](https://help.github.com/articles/getting-started-with-writing-and-formatting-on-github/) syntax to format your issue report. + + - type: textarea + id: bug + attributes: + label: Bug + description: Please give a short description of the bug + validations: + required: true + + - type: input + id: environment-version + attributes: + label: Environment Version + description: Affected Dolibarr version(s) + + - type: input + id: environment-os + attributes: + label: Environment OS + description: Server OS type and version + + - type: input + id: environment-webserver + attributes: + label: Environment Web server + description: Webserver type and version + + - type: input + id: environment-php + attributes: + label: Environment PHP + description: PHP version + + - type: input + id: environment-database + attributes: + label: Environment Database + description: Database type and version + + - type: input + id: environment-urls + attributes: + label: Environment URL(s) + description: Affected URL(s) + + - type: textarea + id: expected-behaviour + attributes: + label: Expected and actual behavior + description: Verbose description + + - type: textarea + id: reproduce + attributes: + label: Steps to reproduce the behavior + description: Verbose description + + - type: textarea + id: files + attributes: + label: Attached files + description: Screenshots, screencasts, dolibarr.log, debugging informations diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 32e2deff2c1..00000000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -name: Feature request -about: Suggest a new idea for this project -title: '' -labels: Feature request -assignees: '' - ---- - -# Instructions -*This is a template to help you report good issues. You may use [Github Markdown](https://help.github.com/articles/getting-started-with-writing-and-formatting-on-github/) syntax to format your issue report.* -*Please:* -- *replace the bracket enclosed texts with meaningful information* -- *remove any unused sub-section* - - -# Feature Request -[*Short description*] - -## Use case -[*Verbose description*] - -## Suggested implementation -[*Verbose description*] - -## Suggested steps -[*List of tasks to achieve goal*] diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 00000000000..885f3472d18 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,35 @@ +name: Feature request +description: Suggest a new idea for this project +labels: ["Feature request"] + +body: + - type: markdown + attributes: + value: | + This is a template to help you report good issues. You may use [Github Markdown](https://help.github.com/articles/getting-started-with-writing-and-formatting-on-github/) syntax to format your issue report. + + - type: textarea + id: feature-request + attributes: + label: Feature Request + description: Short description + validations: + required: true + + - type: textarea + id: use-case + attributes: + label: Use case + description: Verbose description + + - type: textarea + id: suggested-implementation + attributes: + label: Suggested implementation + description: Verbose description + + - type: textarea + id: suggested-steps + attributes: + label: Suggested steps + description: List of tasks to achieve goal diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 5245e60ad67..954b3e632ca 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2018 Laurent Destailleur * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2017 Regis Houssin - * Copyright (C) 2010-2016 Juanjo Menent + * Copyright (C) 2010-2022 Juanjo Menent * Copyright (C) 2011-2021 Philippe Grand * Copyright (C) 2011 Remy Younes * Copyright (C) 2012-2015 Marcos García @@ -2408,6 +2408,31 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') $fieldValue = '0'; } } + + // Labels Length + $maxlength = ''; + if (in_array($fieldlist[$field], array('libelle', 'label'))) { + switch ($tabname) { + case MAIN_DB_PREFIX . 'c_accounting_category': + case MAIN_DB_PREFIX . 'c_ecotaxe': + case MAIN_DB_PREFIX . 'c_email_senderprofile': + case MAIN_DB_PREFIX . 'c_forme_juridique': + case MAIN_DB_PREFIX . 'c_holiday_types': + case MAIN_DB_PREFIX . 'c_payment_term': + case MAIN_DB_PREFIX . 'c_transport_mode': + $maxlength = ' maxlength="255"'; + break; + case MAIN_DB_PREFIX . 'c_email_templates': + $maxlength = ' maxlength="180"'; + break; + case MAIN_DB_PREFIX . 'c_socialnetworks': + $maxlength = ' maxlength="150"'; + break; + default: + $maxlength = ' maxlength="128"'; + } + } + print ''; $transfound = 0; $transkey = ''; @@ -2426,7 +2451,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') } } if (!$transfound) { - print ''; + print ''; } else { print ''; } diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 748aea4ddb2..7d83a88ce55 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -354,8 +354,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $formquestion = array(); if (!empty($conf->bom->enabled)) { $langs->load("mrp"); - require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; - $formproduct = new FormProduct($db); $forcecombo = 0; if ($conf->browser->name == 'ie') { $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy @@ -384,8 +382,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $formquestion = array(); if (!empty($conf->bom->enabled)) { $langs->load("mrp"); - require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; - $formproduct = new FormProduct($db); $forcecombo = 0; if ($conf->browser->name == 'ie') { $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy @@ -415,7 +411,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (!empty($conf->bom->enabled)) { $langs->load("mrp"); require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; - $formproduct = new FormProduct($db); $forcecombo = 0; if ($conf->browser->name == 'ie') { $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy diff --git a/htdocs/comm/propal/class/api_proposals.class.php b/htdocs/comm/propal/class/api_proposals.class.php index 41ed388e044..f03d66bae54 100644 --- a/htdocs/comm/propal/class/api_proposals.class.php +++ b/htdocs/comm/propal/class/api_proposals.class.php @@ -1,7 +1,9 @@ - * Copyright (C) 2016 Laurent Destailleur - * Copyright (C) 2020 Thibault FOUCART +/* Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2016 Laurent Destailleur + * Copyright (C) 2020 Thibault FOUCART + * Copyright (C) 2022 ATM Consulting + * Copyright (C) 2022 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 @@ -274,14 +276,17 @@ class Proposals extends DolibarrApi /** * Get lines of a commercial proposal * - * @param int $id Id of commercial proposal + * @param int $id Id of commercial proposal + * @param string $sqlfilters Other criteria to filter answers separated by a comma. d is the alias for proposal lines table, p is the alias for product table. "Syntax example "(p.ref:like:'SO-%') and (d.date_start:<:'20220101')" * * @url GET {id}/lines * * @return int */ - public function getLines($id) + public function getLines($id, $sqlfilters = '') { + $filters = ""; + if (!DolibarrApiAccess::$user->rights->propal->lire) { throw new RestException(401); } @@ -294,7 +299,16 @@ class Proposals extends DolibarrApi if (!DolibarrApi::_checkAccessToResource('propal', $this->propal->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - $this->propal->getLinesArray(); + + if (!empty($sqlfilters)) { + if (!DolibarrApi::_checkFilters($sqlfilters)) { + throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters); + } + $regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)'; + $filters = " AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")"; + } + + $this->propal->getLinesArray($filters); $result = array(); foreach ($this->propal->lines as $line) { array_push($result, $this->_cleanObjectDatas($line)); @@ -308,7 +322,7 @@ class Proposals extends DolibarrApi * @param int $id Id of commercial proposal to update * @param array $request_data Commercial proposal line data * - * @url POST {id}/lines + * @url POST {id}/line * * @return int */ @@ -368,6 +382,84 @@ class Proposals extends DolibarrApi } } + /** + * Add lines to given commercial proposal + * + * @param int $id Id of commercial proposal to update + * @param array $request_data Commercial proposal line data + * + * @url POST {id}/lines + * + * @return int + */ + public function postLines($id, $request_data = null) + { + if (!DolibarrApiAccess::$user->rights->propal->creer) { + throw new RestException(401); + } + + $result = $this->propal->fetch($id); + if (!$result) { + throw new RestException(404, 'Commercial Proposal not found'); + } + + if (!DolibarrApi::_checkAccessToResource('propal', $this->propal->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + + $errors = []; + $this->db->begin(); + + foreach ($request_data as $TData) { + if (empty($TData[0])) $TData = array($TData); + + foreach ($TData as $lineData) { + $line = (object) $lineData; + + $updateRes = $this->propal->addline( + $line->desc, + $line->subprice, + $line->qty, + $line->tva_tx, + $line->localtax1_tx, + $line->localtax2_tx, + $line->fk_product, + $line->remise_percent, + 'HT', + 0, + $line->info_bits, + $line->product_type, + $line->rang, + $line->special_code, + $line->fk_parent_line, + $line->fk_fournprice, + $line->pa_ht, + $line->label, + $line->date_start, + $line->date_end, + $line->array_options, + $line->fk_unit, + $line->origin, + $line->origin_id, + $line->multicurrency_subprice, + $line->fk_remise_except + ); + + if ($updateRes < 0) { + $errors['lineLabel'] = $line->label; + $errors['msg'] = $this->propal->errors; + } + } + } + if (empty($errors)) { + $this->db->commit(); + return count($request_data); + } else { + $this->db->rollback(); + throw new RestException(400, implode(", ", $errors)); + } + } + /** * Update a line of given commercial proposal * diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index fd3bbfe7171..1c532e26147 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1,20 +1,22 @@ - * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2004-2011 Laurent Destailleur - * Copyright (C) 2005 Marc Barilley - * Copyright (C) 2005-2013 Regis Houssin - * Copyright (C) 2006 Andre Cianfarani - * Copyright (C) 2008 Raphael Bertrand - * Copyright (C) 2010-2020 Juanjo Menent - * Copyright (C) 2010-2017 Philippe Grand - * Copyright (C) 2012-2014 Christophe Battarel - * Copyright (C) 2012 Cedric Salvador - * Copyright (C) 2013 Florian Henry - * Copyright (C) 2014-2015 Marcos García - * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (C) 2018-2021 Frédéric France - * Copyright (C) 2018 Ferran Marcet +/* Copyright (C) 2002-2004 Rodolphe Quiedeville + * Copyright (C) 2004 Eric Seigne + * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2005 Marc Barilley + * Copyright (C) 2005-2013 Regis Houssin + * Copyright (C) 2006 Andre Cianfarani + * Copyright (C) 2008 Raphael Bertrand + * Copyright (C) 2010-2020 Juanjo Menent + * Copyright (C) 2010-2017 Philippe Grand + * Copyright (C) 2012-2014 Christophe Battarel + * Copyright (C) 2012 Cedric Salvador + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2014-2015 Marcos García + * Copyright (C) 2018 Nicolas ZABOURI + * Copyright (C) 2018-2021 Frédéric France + * Copyright (C) 2018 Ferran Marcet + * Copyright (C) 2022 ATM Consulting + * Copyright (C) 2022 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 @@ -1714,12 +1716,13 @@ class Propal extends CommonObject /** * Load array lines * - * @param int $only_product Return only physical products - * @param int $loadalsotranslation Return translation for products + * @param int $only_product Return only physical products + * @param int $loadalsotranslation Return translation for products + * @param string $filters Filter on other fields * - * @return int <0 if KO, >0 if OK + * @return int <0 if KO, >0 if OK */ - public function fetch_lines($only_product = 0, $loadalsotranslation = 0) + public function fetch_lines($only_product = 0, $loadalsotranslation = 0, $filters = '') { global $langs, $conf; // phpcs:enable @@ -1738,6 +1741,9 @@ class Propal extends CommonObject if ($only_product) { $sql .= ' AND p.fk_product_type = 0'; } + if ($filters) { + $sql .= $filters; + } $sql .= ' ORDER by d.rang'; dol_syslog(get_class($this)."::fetch_lines", LOG_DEBUG); @@ -3689,12 +3695,13 @@ class Propal extends CommonObject /** * Retrieve an array of proposal lines + * @param string $filters Filter on other fields * * @return int >0 if OK, <0 if KO */ - public function getLinesArray() + public function getLinesArray($filters = '') { - return $this->fetch_lines(); + return $this->fetch_lines(0, 0, $filters); } /** diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index f43f4e6ddfa..0ea9b1ba30d 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -62,6 +62,9 @@ $label = GETPOST('label', 'alpha'); $actioncode = GETPOST('actioncode'); $fk_user = GETPOST('userid', 'int'); +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('taxcard', 'globalcard')); + // Initialize technical objects $object = new ChargeSociales($db); $extrafields = new ExtraFields($db); @@ -97,7 +100,7 @@ $result = restrictedArea($user, 'tax', $object->id, 'chargesociales', 'charges') * Actions */ -$parameters = array(); +$parameters = array('socid' => $socid); $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'); @@ -446,6 +449,8 @@ if ($id > 0) { $object = new ChargeSociales($db); $result = $object->fetch($id); + $formconfirm = ''; + if ($result > 0) { $head = tax_prepare_head($object); @@ -464,25 +469,36 @@ if ($id > 0) { $formquestion[] = array('type' => 'text', 'name' => 'amount', 'label' => $langs->trans("Amount"), 'value' => price($object->amount), 'morecss' => 'width100'); } - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneTax', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 280); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneTax', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 280); } if ($action == 'paid') { $text = $langs->trans('ConfirmPaySocialContribution'); - print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans('PaySocialContribution'), $text, "confirm_paid", '', '', 2); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans('PaySocialContribution'), $text, "confirm_paid", '', '', 2); } // Confirmation of the removal of the Social Contribution if ($action == 'delete') { $text = $langs->trans('ConfirmDeleteSocialContribution'); - print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans('DeleteSocialContribution'), $text, 'confirm_delete', '', '', 2); + $formconfirm = $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans('DeleteSocialContribution'), $text, 'confirm_delete', '', '', 2); } if ($action == 'edit') { print "
id&action=update\" method=\"post\">"; print ''; } + // 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; print dol_get_fiche_head($head, 'card', $langs->trans("SocialContribution"), -1, 'bill'); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index d29fd0d5e15..ff5f5d0d0a5 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1693,8 +1693,7 @@ class Form if ($showempty && ! is_numeric($showempty)) { $textforempty = $showempty; $out .= ''; - } - else { + } else { if (($showempty == 1 || ($showempty == 3 && $num > 1)) && ! $multiple) { $out .= ''; } diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php index 00e5a7859c0..b0de609a874 100644 --- a/htdocs/core/modules/modStock.class.php +++ b/htdocs/core/modules/modStock.class.php @@ -235,19 +235,22 @@ class modStock extends DolibarrModules 'p.rowid'=>"ProductId", 'p.ref'=>"Ref", 'p.fk_product_type'=>"Type", 'p.label'=>"Label", 'p.description'=>"Description", 'p.note'=>"Note", 'p.price'=>"Price", 'p.tva_tx'=>'VAT', 'p.tosell'=>"OnSell", 'p.tobuy'=>'OnBuy', 'p.duration'=>"Duration", 'p.datec'=>'DateCreation', 'p.tms'=>'DateModification', 'p.pmp'=>'PMPValue', 'p.cost_price'=>'CostPrice', + 'p.seuil_stock_alerte'=>'StockLimit', ); $this->export_TypeFields_array[$r] = array( 'e.rowid'=>'List:entrepot:ref::stock', 'e.ref'=>'Text', 'e.lieu'=>'Text', 'e.address'=>'Text', 'e.zip'=>'Text', 'e.town'=>'Text', 'p.rowid'=>"List:product:label::product", 'p.ref'=>"Text", 'p.fk_product_type'=>"Text", 'p.label'=>"Text", 'p.description'=>"Text", 'p.note'=>"Text", 'p.price'=>"Numeric", 'p.tva_tx'=>'Numeric', 'p.tosell'=>"Boolean", 'p.tobuy'=>"Boolean", 'p.duration'=>"Duree", 'p.datec'=>'Date', 'p.tms'=>'Date', 'p.pmp'=>'Numeric', 'p.cost_price'=>'Numeric', - 'ps.reel'=>'Numeric' + 'ps.reel'=>'Numeric', + 'p.seuil_stock_alerte'=>'Numeric', ); $this->export_entities_array[$r] = array( 'p.rowid'=>"product", 'p.ref'=>"product", 'p.fk_product_type'=>"product", 'p.label'=>"product", 'p.description'=>"product", 'p.note'=>"product", 'p.price'=>"product", 'p.tva_tx'=>'product', 'p.tosell'=>"product", 'p.tobuy'=>"product", 'p.duration'=>"product", 'p.datec'=>'product', 'p.tms'=>'product', 'p.pmp'=>'product', 'p.cost_price'=>'product', - 'ps.reel'=>'stock' + 'ps.reel'=>'stock', + 'p.seuil_stock_alerte'=>'product', ); // We define here only fields that use another icon that the one defined into export_icon $this->export_aggregate_array[$r] = array('ps.reel'=>'SUM'); // TODO Not used yet $this->export_dependencies_array[$r] = array('stock'=>array('p.rowid', 'e.rowid')); // We must keep this until the aggregate_array is used. To have a unique key, if we ask a field of a child, to avoid the DISTINCT to discard them. diff --git a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql index a6be50a91a7..48292523326 100644 --- a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql +++ b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql @@ -32,6 +32,40 @@ -- Missing in v15 or lower +ALTER TABLE llx_c_availability MODIFY COLUMN label varchar(128); +ALTER TABLE llx_c_civility MODIFY COLUMN label varchar(128); +ALTER TABLE llx_c_country MODIFY COLUMN label varchar(128); +ALTER TABLE llx_c_currencies MODIFY COLUMN label varchar(128); +ALTER TABLE llx_c_effectif MODIFY COLUMN libelle varchar(128); +ALTER TABLE llx_c_exp_tax_cat MODIFY COLUMN label varchar(128); +ALTER TABLE llx_c_hrm_department MODIFY COLUMN label varchar(128); +ALTER TABLE llx_c_hrm_function MODIFY COLUMN label varchar(128); +ALTER TABLE llx_c_input_reason MODIFY COLUMN label varchar(128); +ALTER TABLE llx_c_lead_status MODIFY COLUMN label varchar(128); +ALTER TABLE llx_c_paper_format MODIFY COLUMN label varchar(128); +ALTER TABLE llx_c_partnership_type MODIFY COLUMN label varchar(128); +ALTER TABLE llx_c_product_nature MODIFY COLUMN label varchar(128); +ALTER TABLE llx_c_productbatch_qcstatus MODIFY COLUMN label varchar(128); +ALTER TABLE llx_c_propalst MODIFY COLUMN label varchar(128); +ALTER TABLE llx_c_prospectcontactlevel MODIFY COLUMN label varchar(128); +ALTER TABLE llx_c_prospectlevel MODIFY COLUMN label varchar(128); +ALTER TABLE llx_c_recruitment_origin MODIFY COLUMN label varchar(128); +ALTER TABLE llx_c_shipment_package_type MODIFY COLUMN label varchar(128); +ALTER TABLE llx_c_type_container MODIFY COLUMN label varchar(128); +ALTER TABLE llx_c_type_fees MODIFY COLUMN label varchar(128); +ALTER TABLE llx_c_type_resource MODIFY COLUMN label varchar(128); +ALTER TABLE llx_c_units MODIFY COLUMN label varchar(128); +ALTER TABLE llx_c_actioncomm MODIFY COLUMN libelle varchar(128); +ALTER TABLE llx_c_barcode_type MODIFY COLUMN libelle varchar(128); +ALTER TABLE llx_c_chargesociales MODIFY COLUMN libelle varchar(128); +ALTER TABLE llx_c_input_method MODIFY COLUMN libelle varchar(128); +ALTER TABLE llx_c_paiement MODIFY COLUMN libelle varchar(128); +ALTER TABLE llx_c_shipment_mode MODIFY COLUMN libelle varchar(128); +ALTER TABLE llx_c_stcomm MODIFY COLUMN libelle varchar(128); +ALTER TABLE llx_c_stcommcontact MODIFY COLUMN libelle varchar(128); +ALTER TABLE llx_c_type_contact MODIFY COLUMN libelle varchar(128); +ALTER TABLE llx_c_typent MODIFY COLUMN libelle varchar(128); + UPDATE llx_rights_def SET perms = 'writeall' WHERE perms = 'writeall_advance' AND module = 'holiday'; diff --git a/htdocs/install/mysql/tables/llx_c_actioncomm.sql b/htdocs/install/mysql/tables/llx_c_actioncomm.sql index a2b2dffe8a7..4ccbf4a1340 100644 --- a/htdocs/install/mysql/tables/llx_c_actioncomm.sql +++ b/htdocs/install/mysql/tables/llx_c_actioncomm.sql @@ -2,6 +2,7 @@ -- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville -- Copyright (C) 2004-2016 Laurent Destailleur -- Copyright (C) 2012 Florian Henry +-- Copyright (C) 2022 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 @@ -23,7 +24,7 @@ create table llx_c_actioncomm id integer PRIMARY KEY, code varchar(50) NOT NULL, type varchar(50) DEFAULT 'system' NOT NULL, - libelle varchar(48) NOT NULL, + libelle varchar(128) NOT NULL, module varchar(50) DEFAULT NULL, active tinyint DEFAULT 1 NOT NULL, todo tinyint, -- deprecated diff --git a/htdocs/install/mysql/tables/llx_c_availability.sql b/htdocs/install/mysql/tables/llx_c_availability.sql index 4cdc8d6203c..b36d89870b4 100644 --- a/htdocs/install/mysql/tables/llx_c_availability.sql +++ b/htdocs/install/mysql/tables/llx_c_availability.sql @@ -1,6 +1,7 @@ -- ======================================================================== -- Copyright (C) 2011 Philippe GRAND -- Copyright (C) 2020 Alexandre SPANGARO +-- Copyright (C) 2022 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 @@ -21,7 +22,7 @@ create table llx_c_availability ( rowid integer AUTO_INCREMENT PRIMARY KEY, code varchar(30) NOT NULL, - label varchar(60) NOT NULL, + label varchar(128) NOT NULL, active tinyint DEFAULT 1 NOT NULL, position integer NOT NULL DEFAULT 0 )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_c_barcode_type.sql b/htdocs/install/mysql/tables/llx_c_barcode_type.sql index fc76fab2dc9..3aaea7a5f59 100644 --- a/htdocs/install/mysql/tables/llx_c_barcode_type.sql +++ b/htdocs/install/mysql/tables/llx_c_barcode_type.sql @@ -1,6 +1,7 @@ -- ======================================================================== -- Copyright (C) 2007-2009 Regis Houssin -- Copyright (C) 2008 Laurent Destailleur +-- Copyright (C) 2022 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 +23,7 @@ create table llx_c_barcode_type rowid integer AUTO_INCREMENT PRIMARY KEY, code varchar(16) NOT NULL, entity integer DEFAULT 1 NOT NULL, -- multi company id - libelle varchar(50) NOT NULL, + libelle varchar(128) NOT NULL, coder varchar(16) NOT NULL, example varchar(16) NOT NULL diff --git a/htdocs/install/mysql/tables/llx_c_chargesociales.sql b/htdocs/install/mysql/tables/llx_c_chargesociales.sql index 9da2976348f..78b87f95152 100644 --- a/htdocs/install/mysql/tables/llx_c_chargesociales.sql +++ b/htdocs/install/mysql/tables/llx_c_chargesociales.sql @@ -1,6 +1,7 @@ -- ======================================================================== -- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville -- Copyright (C) 2004-2009 Laurent Destailleur +-- Copyright (C) 2022 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 @@ -20,7 +21,7 @@ create table llx_c_chargesociales ( id integer AUTO_INCREMENT PRIMARY KEY, - libelle varchar(80), + libelle varchar(128), deductible smallint DEFAULT 0 NOT NULL, active tinyint DEFAULT 1 NOT NULL, code varchar(12) NOT NULL, diff --git a/htdocs/install/mysql/tables/llx_c_civility.sql b/htdocs/install/mysql/tables/llx_c_civility.sql index 63fc8fca81f..9586101b254 100644 --- a/htdocs/install/mysql/tables/llx_c_civility.sql +++ b/htdocs/install/mysql/tables/llx_c_civility.sql @@ -1,6 +1,7 @@ -- ======================================================================== -- Copyright (C) 2004 Benoit Mortier -- Copyright (C) 2004 Laurent Destailleur +-- Copyright (C) 2022 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 @@ -21,7 +22,7 @@ create table llx_c_civility ( rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, code varchar(6) NOT NULL, - label varchar(50), + label varchar(128), active tinyint DEFAULT 1 NOT NULL, module varchar(32) NULL )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_c_country.sql b/htdocs/install/mysql/tables/llx_c_country.sql index 7f7ba0d4113..d97c3b90371 100644 --- a/htdocs/install/mysql/tables/llx_c_country.sql +++ b/htdocs/install/mysql/tables/llx_c_country.sql @@ -2,6 +2,7 @@ -- Copyright (C) 2001-2004 Rodolphe Quiedeville -- Copyright (C) 2004 Laurent Destailleur -- Copyright (C) 2014 Alexandre Spangaro +-- Copyright (C) 2022 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 @@ -23,7 +24,7 @@ create table llx_c_country rowid integer PRIMARY KEY, code varchar(2) NOT NULL, code_iso varchar(3) , - label varchar(50) NOT NULL, + label varchar(128) NOT NULL, eec integer , active tinyint DEFAULT 1 NOT NULL, favorite tinyint DEFAULT 0 NOT NULL diff --git a/htdocs/install/mysql/tables/llx_c_currencies.sql b/htdocs/install/mysql/tables/llx_c_currencies.sql index 1943fa6eb41..d2d66236016 100644 --- a/htdocs/install/mysql/tables/llx_c_currencies.sql +++ b/htdocs/install/mysql/tables/llx_c_currencies.sql @@ -1,6 +1,7 @@ -- ======================================================================== -- Copyright (C) 2005 Laurent Destailleur -- Copyright (C) 2012 Regis Houssin +-- Copyright (C) 2022 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 @@ -20,7 +21,7 @@ create table llx_c_currencies ( code_iso varchar(3) PRIMARY KEY, - label varchar(64) NOT NULL, + label varchar(128) NOT NULL, unicode varchar(32) DEFAULT NULL, active tinyint DEFAULT 1 NOT NULL diff --git a/htdocs/install/mysql/tables/llx_c_effectif.sql b/htdocs/install/mysql/tables/llx_c_effectif.sql index 26cab5c43da..dda78304fd9 100644 --- a/htdocs/install/mysql/tables/llx_c_effectif.sql +++ b/htdocs/install/mysql/tables/llx_c_effectif.sql @@ -1,6 +1,7 @@ -- ======================================================================== -- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville -- Copyright (C) 2004 Laurent Destailleur +-- Copyright (C) 2022 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 @@ -21,7 +22,7 @@ create table llx_c_effectif ( id integer PRIMARY KEY, code varchar(12) NOT NULL, - libelle varchar(30), + libelle varchar(128), active tinyint DEFAULT 1 NOT NULL, module varchar(32) NULL )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_c_exp_tax_cat.sql b/htdocs/install/mysql/tables/llx_c_exp_tax_cat.sql index 90c60d87b97..6b106caa355 100644 --- a/htdocs/install/mysql/tables/llx_c_exp_tax_cat.sql +++ b/htdocs/install/mysql/tables/llx_c_exp_tax_cat.sql @@ -2,6 +2,7 @@ -- Copyright (C) 2012 Mikael Carlavan -- Copyright (C) 2017 ATM Consulting -- Copyright (C) 2017 Pierre-Henry Favre +-- Copyright (C) 2022 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 @@ -20,7 +21,7 @@ CREATE TABLE IF NOT EXISTS llx_c_exp_tax_cat ( rowid integer AUTO_INCREMENT PRIMARY KEY, - label varchar(48) NOT NULL, + label varchar(128) NOT NULL, entity integer DEFAULT 1 NOT NULL, active integer DEFAULT 1 NOT NULL )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_c_hrm_department.sql b/htdocs/install/mysql/tables/llx_c_hrm_department.sql index 13380bf03b9..fbe6c67671c 100644 --- a/htdocs/install/mysql/tables/llx_c_hrm_department.sql +++ b/htdocs/install/mysql/tables/llx_c_hrm_department.sql @@ -1,6 +1,7 @@ -- -- Copyright (C) 2013 Jean-François Ferry -- Copyright (C) 2015 Alexandre Spangaro +-- Copyright (C) 2022 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 @@ -20,7 +21,7 @@ create table llx_c_hrm_department rowid integer PRIMARY KEY, pos tinyint DEFAULT 0 NOT NULL, code varchar(16) NOT NULL, - label varchar(50), + label varchar(128), active tinyint DEFAULT 1 NOT NULL )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_c_hrm_function.sql b/htdocs/install/mysql/tables/llx_c_hrm_function.sql index 3d6fc37fc2b..558893ba8d6 100644 --- a/htdocs/install/mysql/tables/llx_c_hrm_function.sql +++ b/htdocs/install/mysql/tables/llx_c_hrm_function.sql @@ -1,6 +1,7 @@ -- -- Copyright (C) 2013 Jean-François Ferry -- Copyright (C) 2015 Alexandre Spangaro +-- Copyright (C) 2022 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 @@ -20,7 +21,7 @@ create table llx_c_hrm_function rowid integer PRIMARY KEY, pos tinyint DEFAULT 0 NOT NULL, code varchar(16) NOT NULL, - label varchar(50), + label varchar(128), c_level tinyint DEFAULT 0 NOT NULL, active tinyint DEFAULT 1 NOT NULL )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_c_input_method.sql b/htdocs/install/mysql/tables/llx_c_input_method.sql index 40ed48f8fc6..fc77566e6bd 100644 --- a/htdocs/install/mysql/tables/llx_c_input_method.sql +++ b/htdocs/install/mysql/tables/llx_c_input_method.sql @@ -1,6 +1,7 @@ -- ======================================================================== -- Copyright (C) 2004-2005 Rodolphe Quiedeville -- Copyright (C) 2005-2009 Laurent Destailleur +-- Copyright (C) 2022 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 @@ -21,7 +22,7 @@ create table llx_c_input_method ( rowid integer AUTO_INCREMENT PRIMARY KEY, code varchar(30), - libelle varchar(60), + libelle varchar(128), active tinyint default 1 NOT NULL, module varchar(32) NULL )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_c_input_reason.sql b/htdocs/install/mysql/tables/llx_c_input_reason.sql index dba58dbbecc..f57a9a877ab 100644 --- a/htdocs/install/mysql/tables/llx_c_input_reason.sql +++ b/htdocs/install/mysql/tables/llx_c_input_reason.sql @@ -1,6 +1,7 @@ -- ======================================================================== -- Copyright (C) 2004-2005 Rodolphe Quiedeville -- Copyright (C) 2005-2009 Laurent Destailleur +-- Copyright (C) 2022 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 @@ -23,7 +24,7 @@ create table llx_c_input_reason ( rowid integer AUTO_INCREMENT PRIMARY KEY, code varchar(30), - label varchar(60), + label varchar(128), active tinyint default 1 NOT NULL, module varchar(32) NULL )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_c_lead_status.sql b/htdocs/install/mysql/tables/llx_c_lead_status.sql index 9027c0f6ca1..7905c5b6c05 100644 --- a/htdocs/install/mysql/tables/llx_c_lead_status.sql +++ b/htdocs/install/mysql/tables/llx_c_lead_status.sql @@ -1,5 +1,6 @@ -- Manage Lead -- Copyright (C) 2014 Florian HENRY +-- Copyright (C) 2022 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 @@ -18,7 +19,7 @@ create table llx_c_lead_status ( rowid integer AUTO_INCREMENT PRIMARY KEY, code varchar(10), - label varchar(50), + label varchar(128), position integer, percent double(5,2), active tinyint DEFAULT 1 NOT NULL diff --git a/htdocs/install/mysql/tables/llx_c_paiement.sql b/htdocs/install/mysql/tables/llx_c_paiement.sql index 739d31e946d..535e5115e85 100644 --- a/htdocs/install/mysql/tables/llx_c_paiement.sql +++ b/htdocs/install/mysql/tables/llx_c_paiement.sql @@ -3,6 +3,7 @@ -- Copyright (C) 2004-2014 Laurent Destailleur -- Copyright (C) 2014 Alexandre Spangaro -- Copyright (C) 2017 Regis Houssin +-- Copyright (C) 2022 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 @@ -24,7 +25,7 @@ create table llx_c_paiement id integer AUTO_INCREMENT PRIMARY KEY, entity integer DEFAULT 1 NOT NULL, -- multi company id code varchar(6) NOT NULL, - libelle varchar(62), + libelle varchar(128), type smallint, -- 0: input money, 1: output money, 2: input and output, 3: other active tinyint DEFAULT 1 NOT NULL, accountancy_code varchar(32) NULL, diff --git a/htdocs/install/mysql/tables/llx_c_paper_format.sql b/htdocs/install/mysql/tables/llx_c_paper_format.sql index 45c56ce379f..fd9fc672b68 100644 --- a/htdocs/install/mysql/tables/llx_c_paper_format.sql +++ b/htdocs/install/mysql/tables/llx_c_paper_format.sql @@ -1,5 +1,6 @@ -- ======================================================================== -- Copyright (C) 2007 Regis Houssin +-- Copyright (C) 2022 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 @@ -20,7 +21,7 @@ create table llx_c_paper_format ( rowid integer AUTO_INCREMENT PRIMARY KEY, code varchar(16) NOT NULL, - label varchar(50) NOT NULL, + label varchar(128) NOT NULL, width float(6,2) DEFAULT 0, -- Largeur du papier height float(6,2) DEFAULT 0, -- Hauteur du papier unit varchar(5) NOT NULL, -- Mesure unit diff --git a/htdocs/install/mysql/tables/llx_c_partnership_type.sql b/htdocs/install/mysql/tables/llx_c_partnership_type.sql index d2a4a3b7549..99841f967cb 100644 --- a/htdocs/install/mysql/tables/llx_c_partnership_type.sql +++ b/htdocs/install/mysql/tables/llx_c_partnership_type.sql @@ -1,5 +1,6 @@ -- ======================================================================== -- Copyright (C) 2021 Laurent Destailleur +-- Copyright (C) 2022 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 @@ -29,7 +30,7 @@ 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, + label varchar(128) NOT NULL, active tinyint DEFAULT 1 NOT NULL )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_c_product_nature.sql b/htdocs/install/mysql/tables/llx_c_product_nature.sql index 3c467ce7cf8..e2efdf2a981 100644 --- a/htdocs/install/mysql/tables/llx_c_product_nature.sql +++ b/htdocs/install/mysql/tables/llx_c_product_nature.sql @@ -1,5 +1,7 @@ -- ======================================================================== -- Copyright (C) 2020 Florian HENRY +-- Copyright (C) 2022 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 @@ -19,6 +21,6 @@ CREATE TABLE llx_c_product_nature ( rowid integer AUTO_INCREMENT PRIMARY KEY, code tinyint NOT NULL, - label varchar(100), + label varchar(128), active tinyint DEFAULT 1 NOT NULL ) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_c_productbatch_qcstatus.sql b/htdocs/install/mysql/tables/llx_c_productbatch_qcstatus.sql index 73daa56067a..06a2a76220d 100644 --- a/htdocs/install/mysql/tables/llx_c_productbatch_qcstatus.sql +++ b/htdocs/install/mysql/tables/llx_c_productbatch_qcstatus.sql @@ -1,5 +1,6 @@ -- ======================================================================== -- Copyright (C) 2012-2017 Noé Cendrier +-- Copyright (C) 2022 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 @@ -21,6 +22,6 @@ CREATE TABLE llx_c_productbatch_qcstatus rowid integer AUTO_INCREMENT PRIMARY KEY, entity integer NOT NULL DEFAULT 1, code varchar(16) NOT NULL, - label varchar(50) NOT NULL, + label varchar(128) NOT NULL, active integer DEFAULT 1 NOT NULL )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_c_propalst.sql b/htdocs/install/mysql/tables/llx_c_propalst.sql index 2a107b52735..7b3351a52b8 100644 --- a/htdocs/install/mysql/tables/llx_c_propalst.sql +++ b/htdocs/install/mysql/tables/llx_c_propalst.sql @@ -1,6 +1,7 @@ -- =================================================================== -- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville -- Copyright (C) 2004 Laurent Destailleur +-- Copyright (C) 2022 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 @@ -21,7 +22,7 @@ create table llx_c_propalst ( id smallint PRIMARY KEY, code varchar(12) NOT NULL, - label varchar(30), + label varchar(128), active tinyint DEFAULT 1 NOT NULL )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_c_prospectcontactlevel.sql b/htdocs/install/mysql/tables/llx_c_prospectcontactlevel.sql index 421b3452371..b9efe7967ad 100644 --- a/htdocs/install/mysql/tables/llx_c_prospectcontactlevel.sql +++ b/htdocs/install/mysql/tables/llx_c_prospectcontactlevel.sql @@ -1,5 +1,6 @@ -- =================================================================== -- Copyright (C) 2020 Open-Dsi +-- Copyright (C) 2022 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 @@ -19,7 +20,7 @@ create table llx_c_prospectcontactlevel ( code varchar(12) PRIMARY KEY, - label varchar(30), + label varchar(128), sortorder smallint, active smallint DEFAULT 1 NOT NULL, module varchar(32) NULL diff --git a/htdocs/install/mysql/tables/llx_c_prospectlevel.sql b/htdocs/install/mysql/tables/llx_c_prospectlevel.sql index 70e26dc3a26..31d3abcb5bc 100644 --- a/htdocs/install/mysql/tables/llx_c_prospectlevel.sql +++ b/htdocs/install/mysql/tables/llx_c_prospectlevel.sql @@ -1,5 +1,6 @@ -- =================================================================== -- Copyright (C) 2008 Laurent Destailleur +-- Copyright (C) 2022 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 @@ -19,7 +20,7 @@ create table llx_c_prospectlevel ( code varchar(12) PRIMARY KEY, - label varchar(30), + label varchar(128), sortorder smallint, active smallint DEFAULT 1 NOT NULL, module varchar(32) NULL diff --git a/htdocs/install/mysql/tables/llx_c_recruitment_origin.sql b/htdocs/install/mysql/tables/llx_c_recruitment_origin.sql index b18f7eb383c..2d1c6682900 100644 --- a/htdocs/install/mysql/tables/llx_c_recruitment_origin.sql +++ b/htdocs/install/mysql/tables/llx_c_recruitment_origin.sql @@ -1,5 +1,6 @@ -- ======================================================================== -- Copyright (C) 2005-2016 Laurent Destailleur +-- Copyright (C) 2022 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 @@ -28,6 +29,6 @@ create table llx_c_recruitment_origin ( rowid integer AUTO_INCREMENT PRIMARY KEY, code varchar(32) NOT NULL, - label varchar(64) NOT NULL, + label varchar(128) NOT NULL, active tinyint DEFAULT 1 NOT NULL )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_c_shipment_mode.sql b/htdocs/install/mysql/tables/llx_c_shipment_mode.sql index 6f49f682f24..4f0d584d6d7 100644 --- a/htdocs/install/mysql/tables/llx_c_shipment_mode.sql +++ b/htdocs/install/mysql/tables/llx_c_shipment_mode.sql @@ -1,5 +1,6 @@ -- =================================================================== -- Copyright (C) 2003 Rodolphe Quiedeville +-- Copyright (C) 2022 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 +23,7 @@ create table llx_c_shipment_mode entity integer DEFAULT 1 NOT NULL, -- multi company id tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, code varchar(30) NOT NULL, - libelle varchar(50) NOT NULL, + libelle varchar(128) NOT NULL, description text, tracking varchar(255) NULL, active tinyint DEFAULT 0, diff --git a/htdocs/install/mysql/tables/llx_c_shipment_package_type.sql b/htdocs/install/mysql/tables/llx_c_shipment_package_type.sql index e510352eba2..92dd861fd49 100644 --- a/htdocs/install/mysql/tables/llx_c_shipment_package_type.sql +++ b/htdocs/install/mysql/tables/llx_c_shipment_package_type.sql @@ -2,7 +2,7 @@ create table llx_c_shipment_package_type ( rowid integer AUTO_INCREMENT PRIMARY KEY, - label varchar(50) NOT NULL, -- Short name + label varchar(128) NOT NULL, -- Short name description varchar(255), -- Description active integer DEFAULT 1 NOT NULL, -- Active or not entity integer DEFAULT 1 NOT NULL -- Multi company id diff --git a/htdocs/install/mysql/tables/llx_c_stcomm.sql b/htdocs/install/mysql/tables/llx_c_stcomm.sql index 5f31666b28c..aa5d58a280f 100644 --- a/htdocs/install/mysql/tables/llx_c_stcomm.sql +++ b/htdocs/install/mysql/tables/llx_c_stcomm.sql @@ -1,6 +1,7 @@ -- ======================================================================== -- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville -- Copyright (C) 2004-2015 Laurent Destailleur +-- Copyright (C) 2022 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 @@ -21,7 +22,7 @@ create table llx_c_stcomm ( id integer PRIMARY KEY, code varchar(12) NOT NULL, - libelle varchar(30), + libelle varchar(128), picto varchar(128), active tinyint default 1 NOT NULL )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_c_stcommcontact.sql b/htdocs/install/mysql/tables/llx_c_stcommcontact.sql index c906e4f5103..7ab74e123f6 100644 --- a/htdocs/install/mysql/tables/llx_c_stcommcontact.sql +++ b/htdocs/install/mysql/tables/llx_c_stcommcontact.sql @@ -1,5 +1,6 @@ -- ======================================================================== -- Copyright (C) 2020 Open-Dsi +-- Copyright (C) 2022 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 @@ -20,7 +21,7 @@ create table llx_c_stcommcontact ( id integer PRIMARY KEY, code varchar(12) NOT NULL, - libelle varchar(30), + libelle varchar(128), picto varchar(128), active tinyint default 1 NOT NULL )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_c_type_contact.sql b/htdocs/install/mysql/tables/llx_c_type_contact.sql index c222b0fe273..4b12661657e 100644 --- a/htdocs/install/mysql/tables/llx_c_type_contact.sql +++ b/htdocs/install/mysql/tables/llx_c_type_contact.sql @@ -1,6 +1,7 @@ -- ======================================================================== -- Copyright (C) 2005 Patrick Rouillon -- Copyright (C) 2005 Laurent Destailleur +-- Copyright (C) 2022 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 @@ -32,7 +33,7 @@ create table llx_c_type_contact element varchar(30) NOT NULL, source varchar(8) DEFAULT 'external' NOT NULL, code varchar(32) NOT NULL, - libelle varchar(64) NOT NULL, + libelle varchar(128) NOT NULL, active tinyint DEFAULT 1 NOT NULL, module varchar(32) NULL, position integer NOT NULL DEFAULT 0 diff --git a/htdocs/install/mysql/tables/llx_c_type_container.sql b/htdocs/install/mysql/tables/llx_c_type_container.sql index 53a89fe873b..6de3d041669 100644 --- a/htdocs/install/mysql/tables/llx_c_type_container.sql +++ b/htdocs/install/mysql/tables/llx_c_type_container.sql @@ -1,5 +1,6 @@ -- ======================================================================== -- Copyright (C) 2018 Laurent Destailleur +-- Copyright (C) 2022 Juanjo Menent -- -- -- This program is free software; you can redistribute it and/or modify @@ -30,7 +31,7 @@ create table llx_c_type_container rowid integer AUTO_INCREMENT PRIMARY KEY, code varchar(32) NOT NULL, entity integer DEFAULT 1 NOT NULL, -- multi company id - label varchar(64) NOT NULL, + label varchar(128) NOT NULL, module varchar(32) NULL, active tinyint DEFAULT 1 NOT NULL )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_c_type_fees.sql b/htdocs/install/mysql/tables/llx_c_type_fees.sql index 3f9c49c95d7..d620e38cf69 100644 --- a/htdocs/install/mysql/tables/llx_c_type_fees.sql +++ b/htdocs/install/mysql/tables/llx_c_type_fees.sql @@ -2,6 +2,7 @@ -- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville -- Copyright (C) 2004 Laurent Destailleur -- Copyright (C) 2014 Alexandre Spangaro +-- Copyright (C) 2022 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 @@ -23,7 +24,7 @@ create table llx_c_type_fees ( id integer AUTO_INCREMENT PRIMARY KEY, code varchar(12) NOT NULL, - label varchar(30), + label varchar(128), type integer DEFAULT 0, -- 0=type product, 1=type service accountancy_code varchar(32) NULL, active tinyint DEFAULT 1 NOT NULL, diff --git a/htdocs/install/mysql/tables/llx_c_type_resource.sql b/htdocs/install/mysql/tables/llx_c_type_resource.sql index e490755b1f7..f88f502a038 100644 --- a/htdocs/install/mysql/tables/llx_c_type_resource.sql +++ b/htdocs/install/mysql/tables/llx_c_type_resource.sql @@ -1,5 +1,6 @@ -- ======================================================================== -- Copyright (C) 2014 Jean-François Ferry +-- Copyright (C) 2022 Juanjo Menent -- -- -- This program is free software; you can redistribute it and/or modify @@ -29,6 +30,6 @@ create table llx_c_type_resource ( rowid integer AUTO_INCREMENT PRIMARY KEY, code varchar(32) NOT NULL, - label varchar(64) NOT NULL, + label varchar(128) NOT NULL, active tinyint DEFAULT 1 NOT NULL )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_c_typent.sql b/htdocs/install/mysql/tables/llx_c_typent.sql index 0b15e70b15b..69253f98857 100644 --- a/htdocs/install/mysql/tables/llx_c_typent.sql +++ b/htdocs/install/mysql/tables/llx_c_typent.sql @@ -1,6 +1,7 @@ -- ======================================================================== -- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville -- Copyright (C) 2004 Laurent Destailleur +-- Copyright (C) 2022 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 @@ -21,7 +22,7 @@ create table llx_c_typent ( id integer PRIMARY KEY, code varchar(12) NOT NULL, - libelle varchar(64), + libelle varchar(128), fk_country integer NULL, -- Defined only to have specific list for countries that can't use generic list (like argentina that need type A or B) active tinyint DEFAULT 1 NOT NULL, module varchar(32) NULL, diff --git a/htdocs/install/mysql/tables/llx_c_units.sql b/htdocs/install/mysql/tables/llx_c_units.sql index 7b2424a8f54..94046d25b87 100644 --- a/htdocs/install/mysql/tables/llx_c_units.sql +++ b/htdocs/install/mysql/tables/llx_c_units.sql @@ -2,6 +2,7 @@ -- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville -- Copyright (C) 2004 Laurent Destailleur -- Copyright (C) 2012 Cédric Salvador +-- Copyright (C) 2022 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 @@ -23,7 +24,7 @@ create table llx_c_units( code varchar(3), sortorder smallint, scale integer, - label varchar(50), + label varchar(128), short_label varchar(5), unit_type varchar(10), active tinyint DEFAULT 1 NOT NULL diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php index 8629ec7bbc6..b241cb2d9e9 100644 --- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php +++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php @@ -116,7 +116,7 @@ class KnowledgeRecord extends CommonObject 'model_pdf' => array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>'1', 'position'=>1010, 'notnull'=>-1, 'visible'=>0,), //'url' => array('type'=>'varchar(255)', 'label'=>'URL', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>-1, 'csslist'=>'tdoverflow200', 'help'=>'UrlForInfoPage'), 'fk_c_ticket_category' => array('type'=>'integer:CTicketCategory:ticket/class/cticketcategory.class.php:0::pos', 'label'=>'SuggestedForTicketsInGroup', 'enabled'=>'$conf->ticket->enabled', 'position'=>512, 'notnull'=>0, 'visible'=>-1, 'help'=>'YouCanLinkArticleToATicketCategory', 'csslist'=>'minwidth200 tdoverflowmax250'), - 'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'notnull'=>1, 'visible'=>5, 'default'=>0, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Validated'),), + 'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'notnull'=>1, 'visible'=>5, 'default'=>0, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Validated', '9'=>'Obsolete'),), ); public $rowid; public $ref; @@ -829,10 +829,10 @@ class KnowledgeRecord extends CommonObject //$langs->load("knowledgemanagement"); $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Validated'); - $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled'); + $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Obsolete'); $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Validated'); - $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled'); + $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Obsolete'); } $statusType = 'status'.$status; diff --git a/htdocs/knowledgemanagement/knowledgerecord_card.php b/htdocs/knowledgemanagement/knowledgerecord_card.php index 809d69128cf..a388175dbcf 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_card.php +++ b/htdocs/knowledgemanagement/knowledgerecord_card.php @@ -1,6 +1,5 @@ - * Copyright (C) ---Put here your own copyright and developer email--- +/* Copyright (C) 2017-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 @@ -295,6 +294,56 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } + // Confirmation of action xxxx (You can use it for xxx = 'close', xxx = 'reopen', ...) + if ($action == 'close') { + $text = $langs->trans('ConfirmCloseKM', $object->ref); + /*if (! empty($conf->notification->enabled)) + { + require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; + $notify = new Notify($db); + $text .= '
'; + $text .= $notify->confirmMessage('MYOBJECT_CLOSE', $object->socid, $object); + }*/ + + $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('SetObsolete'), $text, 'confirm_close', $formquestion, 0, 1, 220); + } + + // Confirmation of action xxxx (You can use it for xxx = 'close', xxx = 'reopen', ...) + if ($action == 'reopen') { + $text = $langs->trans('ConfirmReopenKM', $object->ref); + /*if (! empty($conf->notification->enabled)) + { + require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; + $notify = new Notify($db); + $text .= '
'; + $text .= $notify->confirmMessage('MYOBJECT_CLOSE', $object->socid, $object); + }*/ + + $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('Re-Open'), $text, 'confirm_reopen', $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 @@ -428,14 +477,14 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''.$langs->trans("Enable").''."\n"; } } + */ if ($permissiontoadd) { if ($object->status == $object::STATUS_VALIDATED) { - print ''.$langs->trans("Cancel").''."\n"; + print ''.$langs->trans("SetObsolete").''."\n"; } else { print ''.$langs->trans("Re-Open").''."\n"; } } - */ // Delete (need delete permission, or if draft, just need create/modify permission) print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)); diff --git a/htdocs/langs/en_US/knowledgemanagement.lang b/htdocs/langs/en_US/knowledgemanagement.lang index 1f5e9d3905b..ee93715a5c0 100644 --- a/htdocs/langs/en_US/knowledgemanagement.lang +++ b/htdocs/langs/en_US/knowledgemanagement.lang @@ -47,4 +47,8 @@ KnowledgeRecord = Article KnowledgeRecordExtraFields = Extrafields for Article GroupOfTicket=Group of tickets YouCanLinkArticleToATicketCategory=You can link an article to a ticket group (so the article will be suggested during qualification of new tickets) -SuggestedForTicketsInGroup=Suggested for tickets when group is \ No newline at end of file +SuggestedForTicketsInGroup=Suggested for tickets when group is + +SetObsolete=Set as obsolete +ConfirmCloseKM=Do you confirm the closing of this article as obsolete ? +ConfirmReopenKM=Do you want to restore this article to status "Validated" ? \ No newline at end of file diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index a493508878c..66279849abb 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -316,6 +316,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($action == 'deleteline') { $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1); } + // Clone confirmation if ($action == 'clone') { // Create an array for form @@ -323,8 +324,17 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } - // Confirmation of action xxxx + // Confirmation of action xxxx (You can use it for xxx = 'close', xxx = 'reopen', ...) if ($action == 'xxx') { + $text = $langs->trans('ConfirmActionMyObject', $object->ref); + /*if (! empty($conf->notification->enabled)) + { + require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; + $notify = new Notify($db); + $text .= '
'; + $text .= $notify->confirmMessage('MYOBJECT_CLOSE', $object->socid, $object); + }*/ + $formquestion = array(); /* $forcecombo=0; diff --git a/htdocs/mrp/js/lib_dispatch.js.php b/htdocs/mrp/js/lib_dispatch.js.php index 8a5eef60211..d8285ac75c1 100644 --- a/htdocs/mrp/js/lib_dispatch.js.php +++ b/htdocs/mrp/js/lib_dispatch.js.php @@ -70,10 +70,18 @@ function addDispatchLine(index, type, mode) mode = mode || 'qtymissing' console.log("fourn/js/lib_dispatch.js.php Split line type="+type+" index="+index+" mode="+mode); + if(mode == 'qtymissingconsume') { + var inputId = 'qtytoconsume'; + var warehouseId = 'idwarehouse'; + } + else { + var inputId = 'qtytoproduce'; + var warehouseId = 'idwarehousetoproduce'; + } var nbrTrs = $("tr[name^='"+type+"_"+index+"']").length; // position of line for batch var $row = $("tr[name='"+type+'_'+index+"_1']").clone(true); // clone last batch line to jQuery object var qtyOrdered = parseFloat($("#qty_ordered_"+index).val()); // Qty ordered is same for all rows - var qty = parseFloat($("#qtytoproduce-"+index+"-"+nbrTrs).val()); + var qty = parseFloat($("#"+inputId+"-"+index+"-"+nbrTrs).val()); var qtyDispatched; if (mode === 'lessone') @@ -83,7 +91,7 @@ function addDispatchLine(index, type, mode) else { qtyDispatched = parseFloat($("#qty_dispatched_"+index).val()) + qty; - console.log(qty); + console.log($("#qty_dispatched_"+index).val()); // If user did not reduced the qty to dispatch on old line, we keep only 1 on old line and the rest on new line if (qtyDispatched == qtyOrdered && qtyDispatched > 1) { qtyDispatched = parseFloat($("#qty_dispatched_"+index).val()) + 1; @@ -103,11 +111,11 @@ function addDispatchLine(index, type, mode) $row.html($row.html().replace(re1, '_'+index+'_'+(nbrTrs+1))); $row.html($row.html().replace(re2, '-'+index+'-'+(nbrTrs+1))); //create new select2 to avoid duplicate id of cloned one - $row.find("select[name='"+'idwarehousetoproduce-'+index+'-'+(nbrTrs+1)+"']").select2(); + $row.find("select[name='"+warehouseId+'-'+index+'-'+(nbrTrs+1)+"']").select2(); // TODO find solution to copy selected option to new select // TODO find solution to keep new tr's after page refresh //clear value - $row.find("input[name^='qtytoproduce']").val(''); + $row.find("input[id^='"+inputId+"']").val(''); //change name of new row $row.attr('name',type+'_'+index+'_'+(nbrTrs+1)); //insert new row before last row @@ -118,20 +126,20 @@ function addDispatchLine(index, type, mode) $(".csswarehouse_"+index+"_"+(nbrTrs+1)+":first-child").parent("span.selection").parent(".select2").detach(); /* Suffix of lines are: index _ trs.length */ - $("#qtytoproduce-"+index+"-"+(nbrTrs+1)).focus(); - if ($("#qtytoproduce-"+index+"-"+(nbrTrs)).val() == 0) { - $("#qtytoproduce-"+index+"-"+(nbrTrs)).val(1); + $("#"+inputId+"-"+index+"-"+(nbrTrs+1)).focus(); + if ($("#"+inputId+"-"+index+"-"+(nbrTrs)).val() == 0) { + $("#"+inputId+"-"+index+"-"+(nbrTrs)).val(1); } var totalonallines = 0; for (let i = 1; i <= nbrTrs; i++) { - console.log(i+" = "+parseFloat($("#qtytoproduce-"+index+"-"+i).val())); - totalonallines = totalonallines + parseFloat($("#qtytoproduce-"+index+"-"+i).val()); + console.log(i+" = "+parseFloat($("#"+inputId+"-"+index+"-"+i).val())); + totalonallines = totalonallines + parseFloat($("#"+inputId+"-"+index+"-"+i).val()); } console.log("totalonallines="+totalonallines); if (totalonallines == qtyOrdered && qtyOrdered > 1) { - var prevouslineqty = $("#qtytoproduce-"+index+"-"+nbrTrs).val(); - $("#qtytoproduce-"+index+"-"+(nbrTrs)).val(1); - $("#qtytoproduce-"+index+"-"+(nbrTrs+1)).val(prevouslineqty - 1); + var prevouslineqty = $("#"+inputId+"-"+index+"-"+nbrTrs).val(); + $("#"+inputId+"-"+index+"-"+(nbrTrs)).val(1); + $("#"+inputId+"-"+index+"-"+(nbrTrs+1)).val(prevouslineqty - 1); } $("#qty_dispatched_"+index).val(qtyDispatched); @@ -145,9 +153,9 @@ function addDispatchLine(index, type, mode) $("#qty_"+(nbrTrs-1)+"_"+index).val(qty); } // Store arbitrary data for dispatch qty input field change event - $("#qtytoproduce-"+index+(nbrTrs)).data('qty', qty); - $("#qtytoproduce-"+index+(nbrTrs)).data('type', type); - $("#qtytoproduce-"+index+(nbrTrs)).data('index', index); + $("#"+inputId+"-"+index+(nbrTrs)).data('qty', qty); + $("#"+inputId+"-"+index+(nbrTrs)).data('type', type); + $("#"+inputId+"-"+index+(nbrTrs)).data('index', index); } } diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index bc1a0457325..6a5c41b77c5 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -838,6 +838,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $alreadyconsumed += $line2['qty']; } + $suffix = '_'.$line->id; + print ''."\n"; + // hidden fields for js function + print ''; + print ''; + print ''; // Product print ''.$tmpproduct->getNomUrl(1); @@ -976,7 +982,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (in_array($action, array('consumeorproduce', 'consumeandproduceall'))) { $i = 1; print ''."\n"; - print ''; + print ''; print ''.$langs->trans("ToConsume").''; $preselected = (GETPOSTISSET('qty-'.$line->id.'-'.$i) ? GETPOST('qty-'.$line->id.'-'.$i) : max(0, $line->qty - $alreadyconsumed)); if ($action == 'consumeorproduce' && !GETPOSTISSET('qty-'.$line->id.'-'.$i)) { @@ -989,7 +995,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } // Qty - print ''; + print ''; // Cost if ($permissiontoupdatecost && !empty($conf->global->MRP_SHOW_COST_FOR_CONSUMPTION)) { @@ -1004,7 +1010,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($tmpproduct->type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { if (empty($line->disable_stock_change)) { $preselected = (GETPOSTISSET('idwarehouse-'.$line->id.'-'.$i) ? GETPOST('idwarehouse-'.$line->id.'-'.$i) : ($tmpproduct->fk_default_warehouse > 0 ? $tmpproduct->fk_default_warehouse : 'ifone')); - print $formproduct->selectWarehouses($preselected, 'idwarehouse-'.$line->id.'-'.$i, '', 1, 0, $line->fk_product, '', 1, 0, null, 'maxwidth200'); + print $formproduct->selectWarehouses($preselected, 'idwarehouse-'.$line->id.'-'.$i, '', 1, 0, $line->fk_product, '', 1, 0, null, 'maxwidth200 csswarehouse_'.$line->id.'_'.$i); } else { print ''.$langs->trans("DisableStockChange").''; } @@ -1027,6 +1033,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print $formproduct->selectLotDataList('batch-'.$line->id.'-'.$i, 0, $line->fk_product, '', ''); } print ''; + print ''; + if ($tmpproduct->status_batch) { + $type = 'batch'; + print img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton" onClick="addDispatchLine('.$line->id.', \''.$type.'\', \'qtymissingconsume\')"'); + } + print ''; } // Action delete line diff --git a/htdocs/public/ticket/list.php b/htdocs/public/ticket/list.php index 8a353eea881..1a3c0c3babd 100644 --- a/htdocs/public/ticket/list.php +++ b/htdocs/public/ticket/list.php @@ -77,6 +77,9 @@ if (isset($_SESSION['email_customer'])) { $object = new Ticket($db); +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('ticketpubliclist', 'globalcard')); + if (empty($conf->ticket->enabled)) { accessforbidden('', 0, 0, 1); } @@ -407,6 +410,11 @@ if ($action == "view_ticketlist") { $varpage = empty($contextpage) ? $url_page_current : $contextpage; $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields + // allow to display information before list + $parameters=array('arrayfields'=>$arrayfields); + $reshook=$hookmanager->executeHooks('printFieldListHeader', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + print ''; // Filter bar diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index 689a2664c0a..51f8b19e226 100644 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -692,6 +692,7 @@ if ($action == 'create') { if ($id) { $head = salaries_prepare_head($object); + $formconfirm = ''; if ($action === 'clone') { $formquestion = array( @@ -702,17 +703,17 @@ if ($id) { $formquestion[] = array('type' => 'date', 'name' => 'clone_date_start', 'label' => $langs->trans("DateStart"), 'value' => -1); $formquestion[] = array('type' => 'date', 'name' => 'clone_date_end', 'label' => $langs->trans("DateEnd"), 'value' => -1); - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneSalary', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 240); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneSalary', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 240); } if ($action == 'paid') { $text = $langs->trans('ConfirmPaySalary'); - print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans('PaySalary'), $text, "confirm_paid", '', '', 2); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans('PaySalary'), $text, "confirm_paid", '', '', 2); } if ($action == 'delete') { $text = $langs->trans('ConfirmDeleteSalary'); - print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans('DeleteSalary'), $text, 'confirm_delete', '', '', 2); + $formconfirm = $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans('DeleteSalary'), $text, 'confirm_delete', '', '', 2); } if ($action == 'edit') { @@ -720,6 +721,19 @@ if ($id) { print ''; } + // Call Hook formConfirm + $parameters = array('formConfirm' => $formconfirm); + $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; + + print dol_get_fiche_head($head, 'card', $langs->trans("SalaryPayment"), -1, 'salary'); $linkback = ''.$langs->trans("BackToList").'';