Merge branch 'develop' of https://github.com/Dolibarr/dolibarr into Add_param_color_button_action

This commit is contained in:
BB2A Anthony Berton 2022-01-26 13:03:01 +01:00
commit 656dc02e7d
53 changed files with 522 additions and 169 deletions

View File

@ -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*]

71
.github/ISSUE_TEMPLATE/bug_report.yml vendored Normal file
View File

@ -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

View File

@ -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*]

View File

@ -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

View File

@ -3,7 +3,7 @@
* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2022 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2021 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2011-2021 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2011 Remy Younes <ryounes@gmail.com> * Copyright (C) 2011 Remy Younes <ryounes@gmail.com>
* Copyright (C) 2012-2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2012-2015 Marcos García <marcosgdf@gmail.com>
@ -2408,6 +2408,31 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
$fieldValue = '0'; $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 '<td class="'.$classtd.'">'; print '<td class="'.$classtd.'">';
$transfound = 0; $transfound = 0;
$transkey = ''; $transkey = '';
@ -2426,7 +2451,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
} }
} }
if (!$transfound) { if (!$transfound) {
print '<input type="text" class="flat'.($class ? ' '.$class : '').'" value="'.dol_escape_htmltag($fieldValue).'" name="'.$fieldlist[$field].'">'; print '<input type="text" class="flat'.($class ? ' '.$class : '').'"'.($maxlength ? ' '.$maxlength : '').' value="'.dol_escape_htmltag($fieldValue).'" name="'.$fieldlist[$field].'">';
} else { } else {
print '<input type="hidden" name="'.$fieldlist[$field].'" value="'.$transkey.'">'; print '<input type="hidden" name="'.$fieldlist[$field].'" value="'.$transkey.'">';
} }

View File

@ -354,8 +354,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$formquestion = array(); $formquestion = array();
if (!empty($conf->bom->enabled)) { if (!empty($conf->bom->enabled)) {
$langs->load("mrp"); $langs->load("mrp");
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
$formproduct = new FormProduct($db);
$forcecombo = 0; $forcecombo = 0;
if ($conf->browser->name == 'ie') { if ($conf->browser->name == 'ie') {
$forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy $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(); $formquestion = array();
if (!empty($conf->bom->enabled)) { if (!empty($conf->bom->enabled)) {
$langs->load("mrp"); $langs->load("mrp");
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
$formproduct = new FormProduct($db);
$forcecombo = 0; $forcecombo = 0;
if ($conf->browser->name == 'ie') { if ($conf->browser->name == 'ie') {
$forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy $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)) { if (!empty($conf->bom->enabled)) {
$langs->load("mrp"); $langs->load("mrp");
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
$formproduct = new FormProduct($db);
$forcecombo = 0; $forcecombo = 0;
if ($conf->browser->name == 'ie') { if ($conf->browser->name == 'ie') {
$forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy

View File

@ -1,7 +1,9 @@
<?php <?php
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> /* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2020 Thibault FOUCART <support@ptibogxiv.net> * Copyright (C) 2020 Thibault FOUCART <support@ptibogxiv.net>
* Copyright (C) 2022 ATM Consulting <contact@atm-consulting.fr>
* Copyright (C) 2022 OpenDSI <support@open-dsi.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * 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 * 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 * @url GET {id}/lines
* *
* @return int * @return int
*/ */
public function getLines($id) public function getLines($id, $sqlfilters = '')
{ {
$filters = "";
if (!DolibarrApiAccess::$user->rights->propal->lire) { if (!DolibarrApiAccess::$user->rights->propal->lire) {
throw new RestException(401); throw new RestException(401);
} }
@ -294,7 +299,16 @@ class Proposals extends DolibarrApi
if (!DolibarrApi::_checkAccessToResource('propal', $this->propal->id)) { if (!DolibarrApi::_checkAccessToResource('propal', $this->propal->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); 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(); $result = array();
foreach ($this->propal->lines as $line) { foreach ($this->propal->lines as $line) {
array_push($result, $this->_cleanObjectDatas($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 int $id Id of commercial proposal to update
* @param array $request_data Commercial proposal line data * @param array $request_data Commercial proposal line data
* *
* @url POST {id}/lines * @url POST {id}/line
* *
* @return int * @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 * Update a line of given commercial proposal
* *

View File

@ -1,20 +1,22 @@
<?php <?php
/* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley <marc@ocebo.com> * Copyright (C) 2005 Marc Barilley <marc@ocebo.com>
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2013 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr> * Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2020 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2020 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2017 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2010-2017 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2012-2014 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2012-2014 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com> * Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2022 ATM Consulting <contact@atm-consulting.fr>
* Copyright (C) 2022 OpenDSI <support@open-dsi.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -1714,12 +1716,13 @@ class Propal extends CommonObject
/** /**
* Load array lines * Load array lines
* *
* @param int $only_product Return only physical products * @param int $only_product Return only physical products
* @param int $loadalsotranslation Return translation for 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; global $langs, $conf;
// phpcs:enable // phpcs:enable
@ -1738,6 +1741,9 @@ class Propal extends CommonObject
if ($only_product) { if ($only_product) {
$sql .= ' AND p.fk_product_type = 0'; $sql .= ' AND p.fk_product_type = 0';
} }
if ($filters) {
$sql .= $filters;
}
$sql .= ' ORDER by d.rang'; $sql .= ' ORDER by d.rang';
dol_syslog(get_class($this)."::fetch_lines", LOG_DEBUG); dol_syslog(get_class($this)."::fetch_lines", LOG_DEBUG);
@ -3689,12 +3695,13 @@ class Propal extends CommonObject
/** /**
* Retrieve an array of proposal lines * Retrieve an array of proposal lines
* @param string $filters Filter on other fields
* *
* @return int >0 if OK, <0 if KO * @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);
} }
/** /**

View File

@ -62,6 +62,9 @@ $label = GETPOST('label', 'alpha');
$actioncode = GETPOST('actioncode'); $actioncode = GETPOST('actioncode');
$fk_user = GETPOST('userid', 'int'); $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 // Initialize technical objects
$object = new ChargeSociales($db); $object = new ChargeSociales($db);
$extrafields = new ExtraFields($db); $extrafields = new ExtraFields($db);
@ -97,7 +100,7 @@ $result = restrictedArea($user, 'tax', $object->id, 'chargesociales', 'charges')
* Actions * 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 $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) { if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
@ -446,6 +449,8 @@ if ($id > 0) {
$object = new ChargeSociales($db); $object = new ChargeSociales($db);
$result = $object->fetch($id); $result = $object->fetch($id);
$formconfirm = '';
if ($result > 0) { if ($result > 0) {
$head = tax_prepare_head($object); $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'); $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') { if ($action == 'paid') {
$text = $langs->trans('ConfirmPaySocialContribution'); $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 // Confirmation of the removal of the Social Contribution
if ($action == 'delete') { if ($action == 'delete') {
$text = $langs->trans('ConfirmDeleteSocialContribution'); $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') { if ($action == 'edit') {
print "<form name=\"charge\" action=\"".$_SERVER["PHP_SELF"]."?id=$object->id&amp;action=update\" method=\"post\">"; print "<form name=\"charge\" action=\"".$_SERVER["PHP_SELF"]."?id=$object->id&amp;action=update\" method=\"post\">";
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';
} }
// 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'); print dol_get_fiche_head($head, 'card', $langs->trans("SocialContribution"), -1, 'bill');

View File

@ -1693,8 +1693,7 @@ class Form
if ($showempty && ! is_numeric($showempty)) { if ($showempty && ! is_numeric($showempty)) {
$textforempty = $showempty; $textforempty = $showempty;
$out .= '<option class="optiongrey" value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>'.$textforempty.'</option>'; $out .= '<option class="optiongrey" value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>'.$textforempty.'</option>';
} } else {
else {
if (($showempty == 1 || ($showempty == 3 && $num > 1)) && ! $multiple) { if (($showempty == 1 || ($showempty == 3 && $num > 1)) && ! $multiple) {
$out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>&nbsp;</option>'; $out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>&nbsp;</option>';
} }

View File

@ -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.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.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.datec'=>'DateCreation', 'p.tms'=>'DateModification', 'p.pmp'=>'PMPValue', 'p.cost_price'=>'CostPrice',
'p.seuil_stock_alerte'=>'StockLimit',
); );
$this->export_TypeFields_array[$r] = array( $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', '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.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.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', '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( $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.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.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', '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 ); // 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_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. $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.

View File

@ -32,6 +32,40 @@
-- Missing in v15 or lower -- 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'; UPDATE llx_rights_def SET perms = 'writeall' WHERE perms = 'writeall_advance' AND module = 'holiday';

View File

@ -2,6 +2,7 @@
-- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> -- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net> -- Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro> -- Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
-- Copyright (C) 2022 Juanjo Menent <jmenent@2byte.es>
-- --
-- This program is free software; you can redistribute it and/or modify -- 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 -- 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, id integer PRIMARY KEY,
code varchar(50) NOT NULL, code varchar(50) NOT NULL,
type varchar(50) DEFAULT 'system' NOT NULL, type varchar(50) DEFAULT 'system' NOT NULL,
libelle varchar(48) NOT NULL, libelle varchar(128) NOT NULL,
module varchar(50) DEFAULT NULL, module varchar(50) DEFAULT NULL,
active tinyint DEFAULT 1 NOT NULL, active tinyint DEFAULT 1 NOT NULL,
todo tinyint, -- deprecated todo tinyint, -- deprecated

View File

@ -1,6 +1,7 @@
-- ======================================================================== -- ========================================================================
-- Copyright (C) 2011 Philippe GRAND <philippe.grand@atoo-net.com> -- Copyright (C) 2011 Philippe GRAND <philippe.grand@atoo-net.com>
-- Copyright (C) 2020 Alexandre SPANGARO <aspangaro@open-dsi.fr> -- Copyright (C) 2020 Alexandre SPANGARO <aspangaro@open-dsi.fr>
-- Copyright (C) 2022 Juanjo Menent <jmenent@2byte.es>
-- --
-- This program is free software; you can redistribute it and/or modify -- 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 -- 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, rowid integer AUTO_INCREMENT PRIMARY KEY,
code varchar(30) NOT NULL, code varchar(30) NOT NULL,
label varchar(60) NOT NULL, label varchar(128) NOT NULL,
active tinyint DEFAULT 1 NOT NULL, active tinyint DEFAULT 1 NOT NULL,
position integer NOT NULL DEFAULT 0 position integer NOT NULL DEFAULT 0
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -1,6 +1,7 @@
-- ======================================================================== -- ========================================================================
-- Copyright (C) 2007-2009 Regis Houssin <regis.houssin@inodbox.com> -- Copyright (C) 2007-2009 Regis Houssin <regis.houssin@inodbox.com>
-- Copyright (C) 2008 Laurent Destailleur <eldy@users.sourceforge.net> -- Copyright (C) 2008 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2022 Juanjo Menent <jmenent@2byte.es>
-- --
-- This program is free software; you can redistribute it and/or modify -- 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 -- 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, rowid integer AUTO_INCREMENT PRIMARY KEY,
code varchar(16) NOT NULL, code varchar(16) NOT NULL,
entity integer DEFAULT 1 NOT NULL, -- multi company id entity integer DEFAULT 1 NOT NULL, -- multi company id
libelle varchar(50) NOT NULL, libelle varchar(128) NOT NULL,
coder varchar(16) NOT NULL, coder varchar(16) NOT NULL,
example varchar(16) NOT NULL example varchar(16) NOT NULL

View File

@ -1,6 +1,7 @@
-- ======================================================================== -- ========================================================================
-- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> -- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net> -- Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2022 Juanjo Menent <jmenent@2byte.es>
-- --
-- This program is free software; you can redistribute it and/or modify -- 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 -- it under the terms of the GNU General Public License as published by
@ -20,7 +21,7 @@
create table llx_c_chargesociales create table llx_c_chargesociales
( (
id integer AUTO_INCREMENT PRIMARY KEY, id integer AUTO_INCREMENT PRIMARY KEY,
libelle varchar(80), libelle varchar(128),
deductible smallint DEFAULT 0 NOT NULL, deductible smallint DEFAULT 0 NOT NULL,
active tinyint DEFAULT 1 NOT NULL, active tinyint DEFAULT 1 NOT NULL,
code varchar(12) NOT NULL, code varchar(12) NOT NULL,

View File

@ -1,6 +1,7 @@
-- ======================================================================== -- ========================================================================
-- Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> -- Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
-- Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net> -- Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2022 Juanjo Menent <jmenent@2byte.es>
-- --
-- This program is free software; you can redistribute it and/or modify -- 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 -- 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, rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
code varchar(6) NOT NULL, code varchar(6) NOT NULL,
label varchar(50), label varchar(128),
active tinyint DEFAULT 1 NOT NULL, active tinyint DEFAULT 1 NOT NULL,
module varchar(32) NULL module varchar(32) NULL
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -2,6 +2,7 @@
-- Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> -- Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net> -- Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2014 Alexandre Spangaro <aspangaro@open-dsi.fr> -- Copyright (C) 2014 Alexandre Spangaro <aspangaro@open-dsi.fr>
-- Copyright (C) 2022 Juanjo Menent <jmenent@2byte.es>
-- --
-- This program is free software; you can redistribute it and/or modify -- 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 -- 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, rowid integer PRIMARY KEY,
code varchar(2) NOT NULL, code varchar(2) NOT NULL,
code_iso varchar(3) , code_iso varchar(3) ,
label varchar(50) NOT NULL, label varchar(128) NOT NULL,
eec integer , eec integer ,
active tinyint DEFAULT 1 NOT NULL, active tinyint DEFAULT 1 NOT NULL,
favorite tinyint DEFAULT 0 NOT NULL favorite tinyint DEFAULT 0 NOT NULL

View File

@ -1,6 +1,7 @@
-- ======================================================================== -- ========================================================================
-- Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net> -- Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com> -- Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
-- Copyright (C) 2022 Juanjo Menent <jmenent@2byte.es>
-- --
-- This program is free software; you can redistribute it and/or modify -- 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 -- it under the terms of the GNU General Public License as published by
@ -20,7 +21,7 @@
create table llx_c_currencies create table llx_c_currencies
( (
code_iso varchar(3) PRIMARY KEY, code_iso varchar(3) PRIMARY KEY,
label varchar(64) NOT NULL, label varchar(128) NOT NULL,
unicode varchar(32) DEFAULT NULL, unicode varchar(32) DEFAULT NULL,
active tinyint DEFAULT 1 NOT NULL active tinyint DEFAULT 1 NOT NULL

View File

@ -1,6 +1,7 @@
-- ======================================================================== -- ========================================================================
-- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> -- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net> -- Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2022 Juanjo Menent <jmenent@2byte.es>
-- --
-- This program is free software; you can redistribute it and/or modify -- 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 -- 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, id integer PRIMARY KEY,
code varchar(12) NOT NULL, code varchar(12) NOT NULL,
libelle varchar(30), libelle varchar(128),
active tinyint DEFAULT 1 NOT NULL, active tinyint DEFAULT 1 NOT NULL,
module varchar(32) NULL module varchar(32) NULL
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -2,6 +2,7 @@
-- Copyright (C) 2012 Mikael Carlavan <mcarlavan@qis-network.com> -- Copyright (C) 2012 Mikael Carlavan <mcarlavan@qis-network.com>
-- Copyright (C) 2017 ATM Consulting <contact@atm-consulting.fr> -- Copyright (C) 2017 ATM Consulting <contact@atm-consulting.fr>
-- Copyright (C) 2017 Pierre-Henry Favre <phf@atm-consulting.fr> -- Copyright (C) 2017 Pierre-Henry Favre <phf@atm-consulting.fr>
-- Copyright (C) 2022 Juanjo Menent <jmenent@2byte.es>
-- --
-- This program is free software; you can redistribute it and/or modify -- 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 -- 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 ( CREATE TABLE IF NOT EXISTS llx_c_exp_tax_cat (
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
label varchar(48) NOT NULL, label varchar(128) NOT NULL,
entity integer DEFAULT 1 NOT NULL, entity integer DEFAULT 1 NOT NULL,
active integer DEFAULT 1 NOT NULL active integer DEFAULT 1 NOT NULL
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -1,6 +1,7 @@
-- --
-- Copyright (C) 2013 Jean-François Ferry <jfefe@aternatik.fr> -- Copyright (C) 2013 Jean-François Ferry <jfefe@aternatik.fr>
-- Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr> -- Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
-- Copyright (C) 2022 Juanjo Menent <jmenent@2byte.es>
-- --
-- This program is free software: you can redistribute it and/or modify -- 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 -- 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, rowid integer PRIMARY KEY,
pos tinyint DEFAULT 0 NOT NULL, pos tinyint DEFAULT 0 NOT NULL,
code varchar(16) NOT NULL, code varchar(16) NOT NULL,
label varchar(50), label varchar(128),
active tinyint DEFAULT 1 NOT NULL active tinyint DEFAULT 1 NOT NULL
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -1,6 +1,7 @@
-- --
-- Copyright (C) 2013 Jean-François Ferry <jfefe@aternatik.fr> -- Copyright (C) 2013 Jean-François Ferry <jfefe@aternatik.fr>
-- Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr> -- Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
-- Copyright (C) 2022 Juanjo Menent <jmenent@2byte.es>
-- --
-- This program is free software: you can redistribute it and/or modify -- 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 -- 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, rowid integer PRIMARY KEY,
pos tinyint DEFAULT 0 NOT NULL, pos tinyint DEFAULT 0 NOT NULL,
code varchar(16) NOT NULL, code varchar(16) NOT NULL,
label varchar(50), label varchar(128),
c_level tinyint DEFAULT 0 NOT NULL, c_level tinyint DEFAULT 0 NOT NULL,
active tinyint DEFAULT 1 NOT NULL active tinyint DEFAULT 1 NOT NULL
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -1,6 +1,7 @@
-- ======================================================================== -- ========================================================================
-- Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> -- Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net> -- Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2022 Juanjo Menent <jmenent@2byte.es>
-- --
-- This program is free software; you can redistribute it and/or modify -- 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 -- 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, rowid integer AUTO_INCREMENT PRIMARY KEY,
code varchar(30), code varchar(30),
libelle varchar(60), libelle varchar(128),
active tinyint default 1 NOT NULL, active tinyint default 1 NOT NULL,
module varchar(32) NULL module varchar(32) NULL
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -1,6 +1,7 @@
-- ======================================================================== -- ========================================================================
-- Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> -- Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net> -- Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2022 Juanjo Menent <jmenent@2byte.es>
-- --
-- This program is free software; you can redistribute it and/or modify -- 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 -- 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, rowid integer AUTO_INCREMENT PRIMARY KEY,
code varchar(30), code varchar(30),
label varchar(60), label varchar(128),
active tinyint default 1 NOT NULL, active tinyint default 1 NOT NULL,
module varchar(32) NULL module varchar(32) NULL
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -1,5 +1,6 @@
-- Manage Lead -- Manage Lead
-- Copyright (C) 2014 Florian HENRY <florian.henry@open-concept.pro> -- Copyright (C) 2014 Florian HENRY <florian.henry@open-concept.pro>
-- Copyright (C) 2022 Juanjo Menent <jmenent@2byte.es>
-- --
-- This program is free software: you can redistribute it and/or modify -- 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 -- 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, rowid integer AUTO_INCREMENT PRIMARY KEY,
code varchar(10), code varchar(10),
label varchar(50), label varchar(128),
position integer, position integer,
percent double(5,2), percent double(5,2),
active tinyint DEFAULT 1 NOT NULL active tinyint DEFAULT 1 NOT NULL

View File

@ -3,6 +3,7 @@
-- Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net> -- Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2014 Alexandre Spangaro <aspangaro@open-dsi.fr> -- Copyright (C) 2014 Alexandre Spangaro <aspangaro@open-dsi.fr>
-- Copyright (C) 2017 Regis Houssin <regis.houssin@inodbox.com> -- Copyright (C) 2017 Regis Houssin <regis.houssin@inodbox.com>
-- Copyright (C) 2022 Juanjo Menent <jmenent@2byte.es>
-- --
-- This program is free software; you can redistribute it and/or modify -- 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 -- 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, id integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL, -- multi company id entity integer DEFAULT 1 NOT NULL, -- multi company id
code varchar(6) NOT NULL, 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 type smallint, -- 0: input money, 1: output money, 2: input and output, 3: other
active tinyint DEFAULT 1 NOT NULL, active tinyint DEFAULT 1 NOT NULL,
accountancy_code varchar(32) NULL, accountancy_code varchar(32) NULL,

View File

@ -1,5 +1,6 @@
-- ======================================================================== -- ========================================================================
-- Copyright (C) 2007 Regis Houssin <regis.houssin@inodbox.com> -- Copyright (C) 2007 Regis Houssin <regis.houssin@inodbox.com>
-- Copyright (C) 2022 Juanjo Menent <jmenent@2byte.es>
-- --
-- This program is free software; you can redistribute it and/or modify -- 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 -- 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, rowid integer AUTO_INCREMENT PRIMARY KEY,
code varchar(16) NOT NULL, code varchar(16) NOT NULL,
label varchar(50) NOT NULL, label varchar(128) NOT NULL,
width float(6,2) DEFAULT 0, -- Largeur du papier width float(6,2) DEFAULT 0, -- Largeur du papier
height float(6,2) DEFAULT 0, -- Hauteur du papier height float(6,2) DEFAULT 0, -- Hauteur du papier
unit varchar(5) NOT NULL, -- Mesure unit unit varchar(5) NOT NULL, -- Mesure unit

View File

@ -1,5 +1,6 @@
-- ======================================================================== -- ========================================================================
-- Copyright (C) 2021 Laurent Destailleur <eldy@users.sourceforge.net> -- Copyright (C) 2021 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2022 Juanjo Menent <jmenent@2byte.es>
-- --
-- This program is free software; you can redistribute it and/or modify -- 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 -- 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, rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL, entity integer DEFAULT 1 NOT NULL,
code varchar(32) NOT NULL, code varchar(32) NOT NULL,
label varchar(64) NOT NULL, label varchar(128) NOT NULL,
active tinyint DEFAULT 1 NOT NULL active tinyint DEFAULT 1 NOT NULL
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -1,5 +1,7 @@
-- ======================================================================== -- ========================================================================
-- Copyright (C) 2020 Florian HENRY <florian.henry@scopen.fr> -- Copyright (C) 2020 Florian HENRY <florian.henry@scopen.fr>
-- Copyright (C) 2022 Juanjo Menent <jmenent@2byte.es>
-- --
-- This program is free software; you can redistribute it and/or modify -- 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 -- it under the terms of the GNU General Public License as published by
@ -19,6 +21,6 @@
CREATE TABLE llx_c_product_nature ( CREATE TABLE llx_c_product_nature (
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
code tinyint NOT NULL, code tinyint NOT NULL,
label varchar(100), label varchar(128),
active tinyint DEFAULT 1 NOT NULL active tinyint DEFAULT 1 NOT NULL
) ENGINE=innodb; ) ENGINE=innodb;

View File

@ -1,5 +1,6 @@
-- ======================================================================== -- ========================================================================
-- Copyright (C) 2012-2017 Noé Cendrier <noe.cendrier@altairis.fr> -- Copyright (C) 2012-2017 Noé Cendrier <noe.cendrier@altairis.fr>
-- Copyright (C) 2022 Juanjo Menent <jmenent@2byte.es>
-- --
-- This program is free software; you can redistribute it and/or modify -- 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 -- 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, rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer NOT NULL DEFAULT 1, entity integer NOT NULL DEFAULT 1,
code varchar(16) NOT NULL, code varchar(16) NOT NULL,
label varchar(50) NOT NULL, label varchar(128) NOT NULL,
active integer DEFAULT 1 NOT NULL active integer DEFAULT 1 NOT NULL
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -1,6 +1,7 @@
-- =================================================================== -- ===================================================================
-- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> -- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net> -- Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2022 Juanjo Menent <jmenent@2byte.es>
-- --
-- This program is free software; you can redistribute it and/or modify -- 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 -- 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, id smallint PRIMARY KEY,
code varchar(12) NOT NULL, code varchar(12) NOT NULL,
label varchar(30), label varchar(128),
active tinyint DEFAULT 1 NOT NULL active tinyint DEFAULT 1 NOT NULL
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -1,5 +1,6 @@
-- =================================================================== -- ===================================================================
-- Copyright (C) 2020 Open-Dsi <support@open-dsi.fr> -- Copyright (C) 2020 Open-Dsi <support@open-dsi.fr>
-- Copyright (C) 2022 Juanjo Menent <jmenent@2byte.es>
-- --
-- This program is free software; you can redistribute it and/or modify -- 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 -- it under the terms of the GNU General Public License as published by
@ -19,7 +20,7 @@
create table llx_c_prospectcontactlevel create table llx_c_prospectcontactlevel
( (
code varchar(12) PRIMARY KEY, code varchar(12) PRIMARY KEY,
label varchar(30), label varchar(128),
sortorder smallint, sortorder smallint,
active smallint DEFAULT 1 NOT NULL, active smallint DEFAULT 1 NOT NULL,
module varchar(32) NULL module varchar(32) NULL

View File

@ -1,5 +1,6 @@
-- =================================================================== -- ===================================================================
-- Copyright (C) 2008 Laurent Destailleur <eldy@users.sourceforge.net> -- Copyright (C) 2008 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2022 Juanjo Menent <jmenent@2byte.es>
-- --
-- This program is free software; you can redistribute it and/or modify -- 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 -- it under the terms of the GNU General Public License as published by
@ -19,7 +20,7 @@
create table llx_c_prospectlevel create table llx_c_prospectlevel
( (
code varchar(12) PRIMARY KEY, code varchar(12) PRIMARY KEY,
label varchar(30), label varchar(128),
sortorder smallint, sortorder smallint,
active smallint DEFAULT 1 NOT NULL, active smallint DEFAULT 1 NOT NULL,
module varchar(32) NULL module varchar(32) NULL

View File

@ -1,5 +1,6 @@
-- ======================================================================== -- ========================================================================
-- Copyright (C) 2005-2016 Laurent Destailleur <eldy@users.sourceforge.net> -- Copyright (C) 2005-2016 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2022 Juanjo Menent <jmenent@2byte.es>
-- --
-- This program is free software; you can redistribute it and/or modify -- 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 -- 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, rowid integer AUTO_INCREMENT PRIMARY KEY,
code varchar(32) NOT NULL, code varchar(32) NOT NULL,
label varchar(64) NOT NULL, label varchar(128) NOT NULL,
active tinyint DEFAULT 1 NOT NULL active tinyint DEFAULT 1 NOT NULL
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -1,5 +1,6 @@
-- =================================================================== -- ===================================================================
-- Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> -- Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2022 Juanjo Menent <jmenent@2byte.es>
-- --
-- This program is free software; you can redistribute it and/or modify -- 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 -- 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 entity integer DEFAULT 1 NOT NULL, -- multi company id
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
code varchar(30) NOT NULL, code varchar(30) NOT NULL,
libelle varchar(50) NOT NULL, libelle varchar(128) NOT NULL,
description text, description text,
tracking varchar(255) NULL, tracking varchar(255) NULL,
active tinyint DEFAULT 0, active tinyint DEFAULT 0,

View File

@ -2,7 +2,7 @@
create table llx_c_shipment_package_type create table llx_c_shipment_package_type
( (
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
label varchar(50) NOT NULL, -- Short name label varchar(128) NOT NULL, -- Short name
description varchar(255), -- Description description varchar(255), -- Description
active integer DEFAULT 1 NOT NULL, -- Active or not active integer DEFAULT 1 NOT NULL, -- Active or not
entity integer DEFAULT 1 NOT NULL -- Multi company id entity integer DEFAULT 1 NOT NULL -- Multi company id

View File

@ -1,6 +1,7 @@
-- ======================================================================== -- ========================================================================
-- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> -- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net> -- Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2022 Juanjo Menent <jmenent@2byte.es>
-- --
-- This program is free software; you can redistribute it and/or modify -- 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 -- 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, id integer PRIMARY KEY,
code varchar(12) NOT NULL, code varchar(12) NOT NULL,
libelle varchar(30), libelle varchar(128),
picto varchar(128), picto varchar(128),
active tinyint default 1 NOT NULL active tinyint default 1 NOT NULL
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -1,5 +1,6 @@
-- ======================================================================== -- ========================================================================
-- Copyright (C) 2020 Open-Dsi <support@open-dsi.fr> -- Copyright (C) 2020 Open-Dsi <support@open-dsi.fr>
-- Copyright (C) 2022 Juanjo Menent <jmenent@2byte.es>
-- --
-- This program is free software; you can redistribute it and/or modify -- 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 -- 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, id integer PRIMARY KEY,
code varchar(12) NOT NULL, code varchar(12) NOT NULL,
libelle varchar(30), libelle varchar(128),
picto varchar(128), picto varchar(128),
active tinyint default 1 NOT NULL active tinyint default 1 NOT NULL
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -1,6 +1,7 @@
-- ======================================================================== -- ========================================================================
-- Copyright (C) 2005 Patrick Rouillon <patrick.rouillon.net> -- Copyright (C) 2005 Patrick Rouillon <patrick.rouillon.net>
-- Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net> -- Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2022 Juanjo Menent <jmenent@2byte.es>
-- --
-- This program is free software; you can redistribute it and/or modify -- 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 -- 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, element varchar(30) NOT NULL,
source varchar(8) DEFAULT 'external' NOT NULL, source varchar(8) DEFAULT 'external' NOT NULL,
code varchar(32) NOT NULL, code varchar(32) NOT NULL,
libelle varchar(64) NOT NULL, libelle varchar(128) NOT NULL,
active tinyint DEFAULT 1 NOT NULL, active tinyint DEFAULT 1 NOT NULL,
module varchar(32) NULL, module varchar(32) NULL,
position integer NOT NULL DEFAULT 0 position integer NOT NULL DEFAULT 0

View File

@ -1,5 +1,6 @@
-- ======================================================================== -- ========================================================================
-- Copyright (C) 2018 Laurent Destailleur <eldy@users.sourceforge.net> -- Copyright (C) 2018 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2022 Juanjo Menent <jmenent@2byte.es>
-- --
-- --
-- This program is free software; you can redistribute it and/or modify -- 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, rowid integer AUTO_INCREMENT PRIMARY KEY,
code varchar(32) NOT NULL, code varchar(32) NOT NULL,
entity integer DEFAULT 1 NOT NULL, -- multi company id entity integer DEFAULT 1 NOT NULL, -- multi company id
label varchar(64) NOT NULL, label varchar(128) NOT NULL,
module varchar(32) NULL, module varchar(32) NULL,
active tinyint DEFAULT 1 NOT NULL active tinyint DEFAULT 1 NOT NULL
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -2,6 +2,7 @@
-- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> -- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net> -- Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2014 Alexandre Spangaro <aspangaro@open-dsi.fr> -- Copyright (C) 2014 Alexandre Spangaro <aspangaro@open-dsi.fr>
-- Copyright (C) 2022 Juanjo Menent <jmenent@2byte.es>
-- --
-- This program is free software; you can redistribute it and/or modify -- 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 -- 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, id integer AUTO_INCREMENT PRIMARY KEY,
code varchar(12) NOT NULL, code varchar(12) NOT NULL,
label varchar(30), label varchar(128),
type integer DEFAULT 0, -- 0=type product, 1=type service type integer DEFAULT 0, -- 0=type product, 1=type service
accountancy_code varchar(32) NULL, accountancy_code varchar(32) NULL,
active tinyint DEFAULT 1 NOT NULL, active tinyint DEFAULT 1 NOT NULL,

View File

@ -1,5 +1,6 @@
-- ======================================================================== -- ========================================================================
-- Copyright (C) 2014 Jean-François Ferry <jfefe@aternatik.fr> -- Copyright (C) 2014 Jean-François Ferry <jfefe@aternatik.fr>
-- Copyright (C) 2022 Juanjo Menent <jmenent@2byte.es>
-- --
-- --
-- This program is free software; you can redistribute it and/or modify -- 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, rowid integer AUTO_INCREMENT PRIMARY KEY,
code varchar(32) NOT NULL, code varchar(32) NOT NULL,
label varchar(64) NOT NULL, label varchar(128) NOT NULL,
active tinyint DEFAULT 1 NOT NULL active tinyint DEFAULT 1 NOT NULL
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -1,6 +1,7 @@
-- ======================================================================== -- ========================================================================
-- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> -- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net> -- Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2022 Juanjo Menent <jmenent@2byte.es>
-- --
-- This program is free software; you can redistribute it and/or modify -- 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 -- 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, id integer PRIMARY KEY,
code varchar(12) NOT NULL, 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) 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, active tinyint DEFAULT 1 NOT NULL,
module varchar(32) NULL, module varchar(32) NULL,

View File

@ -2,6 +2,7 @@
-- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> -- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net> -- Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr> -- Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr>
-- Copyright (C) 2022 Juanjo Menent <jmenent@2byte.es>
-- --
-- This program is free software; you can redistribute it and/or modify -- 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 -- 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), code varchar(3),
sortorder smallint, sortorder smallint,
scale integer, scale integer,
label varchar(50), label varchar(128),
short_label varchar(5), short_label varchar(5),
unit_type varchar(10), unit_type varchar(10),
active tinyint DEFAULT 1 NOT NULL active tinyint DEFAULT 1 NOT NULL

View File

@ -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,), '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'), //'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'), '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 $rowid;
public $ref; public $ref;
@ -829,10 +829,10 @@ class KnowledgeRecord extends CommonObject
//$langs->load("knowledgemanagement"); //$langs->load("knowledgemanagement");
$this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft');
$this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Validated'); $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_DRAFT] = $langs->transnoentitiesnoconv('Draft');
$this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Validated'); $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; $statusType = 'status'.$status;

View File

@ -1,6 +1,5 @@
<?php <?php
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2017-2021 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) ---Put here your own copyright and developer email---
* *
* This program is free software; you can redistribute it and/or modify * 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 * 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); $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 .= '<br>';
$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 .= '<br>';
$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 // Call Hook formConfirm
$parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid); $parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid);
$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $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 '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=enable&token='.newToken().'">'.$langs->trans("Enable").'</a>'."\n"; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=enable&token='.newToken().'">'.$langs->trans("Enable").'</a>'."\n";
} }
} }
*/
if ($permissiontoadd) { if ($permissiontoadd) {
if ($object->status == $object::STATUS_VALIDATED) { if ($object->status == $object::STATUS_VALIDATED) {
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=close&token='.newToken().'">'.$langs->trans("Cancel").'</a>'."\n"; print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=close&token='.newToken().'">'.$langs->trans("SetObsolete").'</a>'."\n";
} else { } else {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen&token='.newToken().'">'.$langs->trans("Re-Open").'</a>'."\n"; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen&token='.newToken().'">'.$langs->trans("Re-Open").'</a>'."\n";
} }
} }
*/
// Delete (need delete permission, or if draft, just need create/modify permission) // 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)); print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd));

View File

@ -47,4 +47,8 @@ KnowledgeRecord = Article
KnowledgeRecordExtraFields = Extrafields for Article KnowledgeRecordExtraFields = Extrafields for Article
GroupOfTicket=Group of tickets 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) 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 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" ?

View File

@ -316,6 +316,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if ($action == 'deleteline') { if ($action == 'deleteline') {
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
} }
// Clone confirmation // Clone confirmation
if ($action == 'clone') { if ($action == 'clone') {
// Create an array for form // 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); $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') { 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 .= '<br>';
$text .= $notify->confirmMessage('MYOBJECT_CLOSE', $object->socid, $object);
}*/
$formquestion = array(); $formquestion = array();
/* /*
$forcecombo=0; $forcecombo=0;

View File

@ -70,10 +70,18 @@ function addDispatchLine(index, type, mode)
mode = mode || 'qtymissing' mode = mode || 'qtymissing'
console.log("fourn/js/lib_dispatch.js.php Split line type="+type+" index="+index+" mode="+mode); 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 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 $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 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; var qtyDispatched;
if (mode === 'lessone') if (mode === 'lessone')
@ -83,7 +91,7 @@ function addDispatchLine(index, type, mode)
else else
{ {
qtyDispatched = parseFloat($("#qty_dispatched_"+index).val()) + qty; 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 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) { if (qtyDispatched == qtyOrdered && qtyDispatched > 1) {
qtyDispatched = parseFloat($("#qty_dispatched_"+index).val()) + 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(re1, '_'+index+'_'+(nbrTrs+1)));
$row.html($row.html().replace(re2, '-'+index+'-'+(nbrTrs+1))); $row.html($row.html().replace(re2, '-'+index+'-'+(nbrTrs+1)));
//create new select2 to avoid duplicate id of cloned one //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 copy selected option to new select
// TODO find solution to keep new tr's after page refresh // TODO find solution to keep new tr's after page refresh
//clear value //clear value
$row.find("input[name^='qtytoproduce']").val(''); $row.find("input[id^='"+inputId+"']").val('');
//change name of new row //change name of new row
$row.attr('name',type+'_'+index+'_'+(nbrTrs+1)); $row.attr('name',type+'_'+index+'_'+(nbrTrs+1));
//insert new row before last row //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(); $(".csswarehouse_"+index+"_"+(nbrTrs+1)+":first-child").parent("span.selection").parent(".select2").detach();
/* Suffix of lines are: index _ trs.length */ /* Suffix of lines are: index _ trs.length */
$("#qtytoproduce-"+index+"-"+(nbrTrs+1)).focus(); $("#"+inputId+"-"+index+"-"+(nbrTrs+1)).focus();
if ($("#qtytoproduce-"+index+"-"+(nbrTrs)).val() == 0) { if ($("#"+inputId+"-"+index+"-"+(nbrTrs)).val() == 0) {
$("#qtytoproduce-"+index+"-"+(nbrTrs)).val(1); $("#"+inputId+"-"+index+"-"+(nbrTrs)).val(1);
} }
var totalonallines = 0; var totalonallines = 0;
for (let i = 1; i <= nbrTrs; i++) { for (let i = 1; i <= nbrTrs; i++) {
console.log(i+" = "+parseFloat($("#qtytoproduce-"+index+"-"+i).val())); console.log(i+" = "+parseFloat($("#"+inputId+"-"+index+"-"+i).val()));
totalonallines = totalonallines + parseFloat($("#qtytoproduce-"+index+"-"+i).val()); totalonallines = totalonallines + parseFloat($("#"+inputId+"-"+index+"-"+i).val());
} }
console.log("totalonallines="+totalonallines); console.log("totalonallines="+totalonallines);
if (totalonallines == qtyOrdered && qtyOrdered > 1) { if (totalonallines == qtyOrdered && qtyOrdered > 1) {
var prevouslineqty = $("#qtytoproduce-"+index+"-"+nbrTrs).val(); var prevouslineqty = $("#"+inputId+"-"+index+"-"+nbrTrs).val();
$("#qtytoproduce-"+index+"-"+(nbrTrs)).val(1); $("#"+inputId+"-"+index+"-"+(nbrTrs)).val(1);
$("#qtytoproduce-"+index+"-"+(nbrTrs+1)).val(prevouslineqty - 1); $("#"+inputId+"-"+index+"-"+(nbrTrs+1)).val(prevouslineqty - 1);
} }
$("#qty_dispatched_"+index).val(qtyDispatched); $("#qty_dispatched_"+index).val(qtyDispatched);
@ -145,9 +153,9 @@ function addDispatchLine(index, type, mode)
$("#qty_"+(nbrTrs-1)+"_"+index).val(qty); $("#qty_"+(nbrTrs-1)+"_"+index).val(qty);
} }
// Store arbitrary data for dispatch qty input field change event // Store arbitrary data for dispatch qty input field change event
$("#qtytoproduce-"+index+(nbrTrs)).data('qty', qty); $("#"+inputId+"-"+index+(nbrTrs)).data('qty', qty);
$("#qtytoproduce-"+index+(nbrTrs)).data('type', type); $("#"+inputId+"-"+index+(nbrTrs)).data('type', type);
$("#qtytoproduce-"+index+(nbrTrs)).data('index', index); $("#"+inputId+"-"+index+(nbrTrs)).data('index', index);
} }
} }

View File

@ -838,6 +838,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$alreadyconsumed += $line2['qty']; $alreadyconsumed += $line2['qty'];
} }
$suffix = '_'.$line->id;
print '<!-- Line to dispatch '.$suffix.' -->'."\n";
// hidden fields for js function
print '<input id="qty_ordered'.$suffix.'" type="hidden" value="'.$line->qty.'">';
print '<input id="qty_dispatched'.$suffix.'" type="hidden" value="'.$alreadyconsumed.'">';
print '<tr>'; print '<tr>';
// Product // Product
print '<td>'.$tmpproduct->getNomUrl(1); print '<td>'.$tmpproduct->getNomUrl(1);
@ -976,7 +982,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if (in_array($action, array('consumeorproduce', 'consumeandproduceall'))) { if (in_array($action, array('consumeorproduce', 'consumeandproduceall'))) {
$i = 1; $i = 1;
print '<!-- Enter line to consume -->'."\n"; print '<!-- Enter line to consume -->'."\n";
print '<tr>'; print '<tr name="batch_'.$line->id.'_'.$i.'">';
print '<td><span class="opacitymedium">'.$langs->trans("ToConsume").'</span></td>'; print '<td><span class="opacitymedium">'.$langs->trans("ToConsume").'</span></td>';
$preselected = (GETPOSTISSET('qty-'.$line->id.'-'.$i) ? GETPOST('qty-'.$line->id.'-'.$i) : max(0, $line->qty - $alreadyconsumed)); $preselected = (GETPOSTISSET('qty-'.$line->id.'-'.$i) ? GETPOST('qty-'.$line->id.'-'.$i) : max(0, $line->qty - $alreadyconsumed));
if ($action == 'consumeorproduce' && !GETPOSTISSET('qty-'.$line->id.'-'.$i)) { if ($action == 'consumeorproduce' && !GETPOSTISSET('qty-'.$line->id.'-'.$i)) {
@ -989,7 +995,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
} }
// Qty // Qty
print '<td class="right"><input type="text" class="width50 right" name="qty-'.$line->id.'-'.$i.'" value="'.$preselected.'" '.$disable.' ></td>'; print '<td class="right"><input type="text" class="width50 right" id="qtytoconsume-'.$line->id.'-'.$i.'" name="qty-'.$line->id.'-'.$i.'" value="'.$preselected.'" '.$disable.'></td>';
// Cost // Cost
if ($permissiontoupdatecost && !empty($conf->global->MRP_SHOW_COST_FOR_CONSUMPTION)) { 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 ($tmpproduct->type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
if (empty($line->disable_stock_change)) { 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')); $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 { } else {
print '<span class="opacitymedium">'.$langs->trans("DisableStockChange").'</span>'; print '<span class="opacitymedium">'.$langs->trans("DisableStockChange").'</span>';
} }
@ -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 $formproduct->selectLotDataList('batch-'.$line->id.'-'.$i, 0, $line->fk_product, '', '');
} }
print '</td>'; print '</td>';
print '<td>';
if ($tmpproduct->status_batch) {
$type = 'batch';
print img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton" onClick="addDispatchLine('.$line->id.', \''.$type.'\', \'qtymissingconsume\')"');
}
print '</td>';
} }
// Action delete line // Action delete line

View File

@ -77,6 +77,9 @@ if (isset($_SESSION['email_customer'])) {
$object = new Ticket($db); $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)) { if (empty($conf->ticket->enabled)) {
accessforbidden('', 0, 0, 1); accessforbidden('', 0, 0, 1);
} }
@ -407,6 +410,11 @@ if ($action == "view_ticketlist") {
$varpage = empty($contextpage) ? $url_page_current : $contextpage; $varpage = empty($contextpage) ? $url_page_current : $contextpage;
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields $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 '<table class="liste '.($moreforfilter ? "listwithfilterbefore" : "").'">'; print '<table class="liste '.($moreforfilter ? "listwithfilterbefore" : "").'">';
// Filter bar // Filter bar

View File

@ -692,6 +692,7 @@ if ($action == 'create') {
if ($id) { if ($id) {
$head = salaries_prepare_head($object); $head = salaries_prepare_head($object);
$formconfirm = '';
if ($action === 'clone') { if ($action === 'clone') {
$formquestion = array( $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_start', 'label' => $langs->trans("DateStart"), 'value' => -1);
$formquestion[] = array('type' => 'date', 'name' => 'clone_date_end', 'label' => $langs->trans("DateEnd"), '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') { if ($action == 'paid') {
$text = $langs->trans('ConfirmPaySalary'); $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') { if ($action == 'delete') {
$text = $langs->trans('ConfirmDeleteSalary'); $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') { if ($action == 'edit') {
@ -720,6 +721,19 @@ if ($id) {
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';
} }
// 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'); print dol_get_fiche_head($head, 'card', $langs->trans("SalaryPayment"), -1, 'salary');
$linkback = '<a href="'.DOL_URL_ROOT.'/salaries/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/salaries/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';