2
0
forked from Wavyzz/dolibarr

Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into

develop
This commit is contained in:
Laurent Destailleur
2024-01-10 15:14:11 +01:00
16 changed files with 135 additions and 179 deletions

View File

@@ -330,7 +330,7 @@ if ($action == 'valid') {
* View * View
*/ */
$html = new Form($db); $form = new Form($db);
$formaccounting = new FormAccounting($db); $formaccounting = new FormAccounting($db);
$title = $langs->trans("CreateMvts"); $title = $langs->trans("CreateMvts");
@@ -339,7 +339,7 @@ llxHeader('', $title);
// Confirmation to delete the command // Confirmation to delete the command
if ($action == 'delete') { if ($action == 'delete') {
$formconfirm = $html->formconfirm($_SERVER["PHP_SELF"].'?id='.$id.'&mode='.$mode, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt', $langs->transnoentitiesnoconv("RegistrationInAccounting")), 'confirm_delete', '', 0, 1); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$id.'&mode='.$mode, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt', $langs->transnoentitiesnoconv("RegistrationInAccounting")), 'confirm_delete', '', 0, 1);
print $formconfirm; print $formconfirm;
} }
@@ -374,7 +374,7 @@ if ($action == 'create') {
print '<tr>'; print '<tr>';
print '<td class="titlefieldcreate fieldrequired">'.$langs->trans("Docdate").'</td>'; print '<td class="titlefieldcreate fieldrequired">'.$langs->trans("Docdate").'</td>';
print '<td>'; print '<td>';
print $html->selectDate('', 'doc_date', '', '', '', "create_mvt", 1, 1); print $form->selectDate('', 'doc_date', '', '', '', "create_mvt", 1, 1);
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';

View File

@@ -940,7 +940,12 @@ if ($mode == 'common' || $mode == 'commonkanban') {
} else { // Module not yet activated } else { // Module not yet activated
// Set $codeenabledisable // Set $codeenabledisable
if (!empty($objMod->always_enabled)) { if (!empty($objMod->always_enabled)) {
// Should never happened // A 'always_enabled' module should not never be disabled. If this happen, we keep a link to reenable it.
$codeenabledisable .= '<!-- Message to show: an always_enabled module has been disabled -->'."\n";
$codeenabledisable .= '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$objMod->numero.'&token='.newToken().'&module_position='.$module_position.'&action=set&token='.newToken().'&value='.$modName.'&mode='.$mode.$param.'"';
$codeenabledisable .= '>';
$codeenabledisable .= img_picto($langs->trans("Disabled"), 'switch_off');
$codeenabledisable .= "</a>\n";
} elseif (!empty($objMod->disabled)) { } elseif (!empty($objMod->disabled)) {
$codeenabledisable .= $langs->trans("Disabled"); $codeenabledisable .= $langs->trans("Disabled");
} else { } else {

View File

@@ -346,7 +346,8 @@ class Boms extends DolibarrApi
$request_data->efficiency, $request_data->efficiency,
$request_data->position, $request_data->position,
$request_data->fk_bom_child, $request_data->fk_bom_child,
$request_data->import_key $request_data->import_key,
$request_data->fk_unit
); );
if ($updateRes > 0) { if ($updateRes > 0) {
@@ -391,7 +392,8 @@ class Boms extends DolibarrApi
$request_data->disable_stock_change, $request_data->disable_stock_change,
$request_data->efficiency, $request_data->efficiency,
$request_data->position, $request_data->position,
$request_data->import_key $request_data->import_key,
$request_data->fk_unit
); );
if ($updateRes > 0) { if ($updateRes > 0) {

View File

@@ -1761,13 +1761,25 @@ class BOMLine extends CommonObjectLine
* @var string description * @var string description
*/ */
public $description; public $description;
/**
* @var double qty
*/
public $qty; public $qty;
/** /**
* @var int qty frozen * @var int qty frozen
*/ */
public $qty_frozen; public $qty_frozen;
/**
* @var int disable stock change
*/
public $disable_stock_change; public $disable_stock_change;
/**
* @var double efficiency
*/
public $efficiency; public $efficiency;
/** /**
@@ -1791,12 +1803,16 @@ class BOMLine extends CommonObjectLine
*/ */
public $unit_cost = 0; public $unit_cost = 0;
/** /**
* @var Bom array of Bom in line * @var Bom array of Bom in line
*/ */
public $childBom = array(); public $childBom = array();
/**
* @var int Service unit
*/
public $fk_unit;
/** /**
* @var int Service Workstation * @var int Service Workstation
*/ */

View File

@@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2019 Maxime Kohlhaas <maxime@atm-consulting.fr> /* Copyright (C) 2019 Maxime Kohlhaas <maxime@atm-consulting.fr>
* Copyright (C) 2019-2021 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2019-2023 Frédéric France <frederic.france@netlogic.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
@@ -113,7 +113,7 @@ function bomPrepareHead($object)
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
$upload_dir = $conf->bom->dir_output."/bom/".dol_sanitizeFileName($object->ref); $upload_dir = $conf->bom->dir_output."/".dol_sanitizeFileName($object->ref);
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
$nbLinks = Link::count($db, $object->element, $object->id); $nbLinks = Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/bom/bom_document.php?id='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/bom/bom_document.php?id='.$object->id;

View File

@@ -907,8 +907,8 @@ if ($action == 'create') {
$text = ''; $text = '';
if (isset($conf->global->MAILING_LIMIT_SENDBYDAY) && getDolGlobalInt('MAILING_LIMIT_SENDBYDAY') >= 0) { if (getDolGlobalInt('MAILING_LIMIT_SENDBYDAY') > 0) {
$text .= $langs->trans('WarningLimitSendByDay', getDolGlobalString('MAILING_LIMIT_SENDBYDAY')); $text .= $langs->trans('WarningLimitSendByDay', getDolGlobalInt('MAILING_LIMIT_SENDBYDAY'));
$text .= '<br><br>'; $text .= '<br><br>';
} }
$text .= $langs->trans('ConfirmSendingEmailing').'<br>'; $text .= $langs->trans('ConfirmSendingEmailing').'<br>';

View File

@@ -41,7 +41,7 @@ $result = restrictedArea($user, 'contact', $id, 'socpeople&societe');
$result = $contact->fetch($id); $result = $contact->fetch($id);
if ($result <= 0) { if ($result <= 0) {
dol_print_error($contact->error); dol_print_error($db, $contact->error);
exit; exit;
} }

View File

@@ -1814,7 +1814,7 @@ class CMailFile
$matches = array(); $matches = array();
preg_match_all('/(?:"|\')([^"\']+\.('.implode('|', $extensions).'))(?:"|\')/Ui', $this->html, $matches); // If "xxx.ext" or 'xxx.ext' found preg_match_all('/(?:"|\')([^"\']+\.('.implode('|', $extensions).'))(?:"|\')/Ui', $this->html, $matches); // If "xxx.ext" or 'xxx.ext' found
if (!empty($matches)) { if (!empty($matches) && !empty($matches[1])) {
$i = 0; $i = 0;
// We are interested in $matches[1] only (the second set of parenthesis into regex) // We are interested in $matches[1] only (the second set of parenthesis into regex)
foreach ($matches[1] as $full) { foreach ($matches[1] as $full) {

View File

@@ -10870,373 +10870,293 @@ function dol_mimetype($file, $default = 'application/octet-stream', $mode = 0)
$mime = 'text/plain'; $mime = 'text/plain';
$imgmime = 'text.png'; $imgmime = 'text.png';
$famime = 'file-text-o'; $famime = 'file-text-o';
} } elseif (preg_match('/\.rtx$/i', $tmpfile)) {
if (preg_match('/\.rtx$/i', $tmpfile)) {
$mime = 'text/richtext'; $mime = 'text/richtext';
$imgmime = 'text.png'; $imgmime = 'text.png';
$famime = 'file-text-o'; $famime = 'file-text-o';
} } elseif (preg_match('/\.csv$/i', $tmpfile)) {
if (preg_match('/\.csv$/i', $tmpfile)) {
$mime = 'text/csv'; $mime = 'text/csv';
$imgmime = 'text.png'; $imgmime = 'text.png';
$famime = 'file-text-o'; $famime = 'file-text-o';
} } elseif (preg_match('/\.tsv$/i', $tmpfile)) {
if (preg_match('/\.tsv$/i', $tmpfile)) {
$mime = 'text/tab-separated-values'; $mime = 'text/tab-separated-values';
$imgmime = 'text.png'; $imgmime = 'text.png';
$famime = 'file-text-o'; $famime = 'file-text-o';
} } elseif (preg_match('/\.(cf|conf|log)$/i', $tmpfile)) {
if (preg_match('/\.(cf|conf|log)$/i', $tmpfile)) {
$mime = 'text/plain'; $mime = 'text/plain';
$imgmime = 'text.png'; $imgmime = 'text.png';
$famime = 'file-text-o'; $famime = 'file-text-o';
} } elseif (preg_match('/\.ini$/i', $tmpfile)) {
if (preg_match('/\.ini$/i', $tmpfile)) {
$mime = 'text/plain'; $mime = 'text/plain';
$imgmime = 'text.png'; $imgmime = 'text.png';
$srclang = 'ini'; $srclang = 'ini';
$famime = 'file-text-o'; $famime = 'file-text-o';
} } elseif (preg_match('/\.md$/i', $tmpfile)) {
if (preg_match('/\.md$/i', $tmpfile)) {
$mime = 'text/plain'; $mime = 'text/plain';
$imgmime = 'text.png'; $imgmime = 'text.png';
$srclang = 'md'; $srclang = 'md';
$famime = 'file-text-o'; $famime = 'file-text-o';
} } elseif (preg_match('/\.css$/i', $tmpfile)) {
if (preg_match('/\.css$/i', $tmpfile)) {
$mime = 'text/css'; $mime = 'text/css';
$imgmime = 'css.png'; $imgmime = 'css.png';
$srclang = 'css'; $srclang = 'css';
$famime = 'file-text-o'; $famime = 'file-text-o';
} } elseif (preg_match('/\.lang$/i', $tmpfile)) {
if (preg_match('/\.lang$/i', $tmpfile)) {
$mime = 'text/plain'; $mime = 'text/plain';
$imgmime = 'text.png'; $imgmime = 'text.png';
$srclang = 'lang'; $srclang = 'lang';
$famime = 'file-text-o'; $famime = 'file-text-o';
} } elseif (preg_match('/\.(crt|cer|key|pub)$/i', $tmpfile)) { // Certificate files
// Certificate files
if (preg_match('/\.(crt|cer|key|pub)$/i', $tmpfile)) {
$mime = 'text/plain'; $mime = 'text/plain';
$imgmime = 'text.png'; $imgmime = 'text.png';
$famime = 'file-text-o'; $famime = 'file-text-o';
} } elseif (preg_match('/\.(html|htm|shtml)$/i', $tmpfile)) { // XML based (HTML/XML/XAML)
// XML based (HTML/XML/XAML)
if (preg_match('/\.(html|htm|shtml)$/i', $tmpfile)) {
$mime = 'text/html'; $mime = 'text/html';
$imgmime = 'html.png'; $imgmime = 'html.png';
$srclang = 'html'; $srclang = 'html';
$famime = 'file-text-o'; $famime = 'file-text-o';
} } elseif (preg_match('/\.(xml|xhtml)$/i', $tmpfile)) {
if (preg_match('/\.(xml|xhtml)$/i', $tmpfile)) {
$mime = 'text/xml'; $mime = 'text/xml';
$imgmime = 'other.png'; $imgmime = 'other.png';
$srclang = 'xml'; $srclang = 'xml';
$famime = 'file-text-o'; $famime = 'file-text-o';
} } elseif (preg_match('/\.xaml$/i', $tmpfile)) {
if (preg_match('/\.xaml$/i', $tmpfile)) {
$mime = 'text/xml'; $mime = 'text/xml';
$imgmime = 'other.png'; $imgmime = 'other.png';
$srclang = 'xaml'; $srclang = 'xaml';
$famime = 'file-text-o'; $famime = 'file-text-o';
} } elseif (preg_match('/\.bas$/i', $tmpfile)) { // Languages
// Languages
if (preg_match('/\.bas$/i', $tmpfile)) {
$mime = 'text/plain'; $mime = 'text/plain';
$imgmime = 'text.png'; $imgmime = 'text.png';
$srclang = 'bas'; $srclang = 'bas';
$famime = 'file-code-o'; $famime = 'file-code-o';
} } elseif (preg_match('/\.(c)$/i', $tmpfile)) {
if (preg_match('/\.(c)$/i', $tmpfile)) {
$mime = 'text/plain'; $mime = 'text/plain';
$imgmime = 'text.png'; $imgmime = 'text.png';
$srclang = 'c'; $srclang = 'c';
$famime = 'file-code-o'; $famime = 'file-code-o';
} } elseif (preg_match('/\.(cpp)$/i', $tmpfile)) {
if (preg_match('/\.(cpp)$/i', $tmpfile)) {
$mime = 'text/plain'; $mime = 'text/plain';
$imgmime = 'text.png'; $imgmime = 'text.png';
$srclang = 'cpp'; $srclang = 'cpp';
$famime = 'file-code-o'; $famime = 'file-code-o';
} } elseif (preg_match('/\.cs$/i', $tmpfile)) {
if (preg_match('/\.cs$/i', $tmpfile)) {
$mime = 'text/plain'; $mime = 'text/plain';
$imgmime = 'text.png'; $imgmime = 'text.png';
$srclang = 'cs'; $srclang = 'cs';
$famime = 'file-code-o'; $famime = 'file-code-o';
} } elseif (preg_match('/\.(h)$/i', $tmpfile)) {
if (preg_match('/\.(h)$/i', $tmpfile)) {
$mime = 'text/plain'; $mime = 'text/plain';
$imgmime = 'text.png'; $imgmime = 'text.png';
$srclang = 'h'; $srclang = 'h';
$famime = 'file-code-o'; $famime = 'file-code-o';
} } elseif (preg_match('/\.(java|jsp)$/i', $tmpfile)) {
if (preg_match('/\.(java|jsp)$/i', $tmpfile)) {
$mime = 'text/plain'; $mime = 'text/plain';
$imgmime = 'text.png'; $imgmime = 'text.png';
$srclang = 'java'; $srclang = 'java';
$famime = 'file-code-o'; $famime = 'file-code-o';
} } elseif (preg_match('/\.php([0-9]{1})?$/i', $tmpfile)) {
if (preg_match('/\.php([0-9]{1})?$/i', $tmpfile)) {
$mime = 'text/plain'; $mime = 'text/plain';
$imgmime = 'php.png'; $imgmime = 'php.png';
$srclang = 'php'; $srclang = 'php';
$famime = 'file-code-o'; $famime = 'file-code-o';
} } elseif (preg_match('/\.phtml$/i', $tmpfile)) {
if (preg_match('/\.phtml$/i', $tmpfile)) {
$mime = 'text/plain'; $mime = 'text/plain';
$imgmime = 'php.png'; $imgmime = 'php.png';
$srclang = 'php'; $srclang = 'php';
$famime = 'file-code-o'; $famime = 'file-code-o';
} } elseif (preg_match('/\.(pl|pm)$/i', $tmpfile)) {
if (preg_match('/\.(pl|pm)$/i', $tmpfile)) {
$mime = 'text/plain'; $mime = 'text/plain';
$imgmime = 'pl.png'; $imgmime = 'pl.png';
$srclang = 'perl'; $srclang = 'perl';
$famime = 'file-code-o'; $famime = 'file-code-o';
} } elseif (preg_match('/\.sql$/i', $tmpfile)) {
if (preg_match('/\.sql$/i', $tmpfile)) {
$mime = 'text/plain'; $mime = 'text/plain';
$imgmime = 'text.png'; $imgmime = 'text.png';
$srclang = 'sql'; $srclang = 'sql';
$famime = 'file-code-o'; $famime = 'file-code-o';
} } elseif (preg_match('/\.js$/i', $tmpfile)) {
if (preg_match('/\.js$/i', $tmpfile)) {
$mime = 'text/x-javascript'; $mime = 'text/x-javascript';
$imgmime = 'jscript.png'; $imgmime = 'jscript.png';
$srclang = 'js'; $srclang = 'js';
$famime = 'file-code-o'; $famime = 'file-code-o';
} } elseif (preg_match('/\.odp$/i', $tmpfile)) { // Open office
// Open office
if (preg_match('/\.odp$/i', $tmpfile)) {
$mime = 'application/vnd.oasis.opendocument.presentation'; $mime = 'application/vnd.oasis.opendocument.presentation';
$imgmime = 'ooffice.png'; $imgmime = 'ooffice.png';
$famime = 'file-powerpoint-o'; $famime = 'file-powerpoint-o';
} } elseif (preg_match('/\.ods$/i', $tmpfile)) {
if (preg_match('/\.ods$/i', $tmpfile)) {
$mime = 'application/vnd.oasis.opendocument.spreadsheet'; $mime = 'application/vnd.oasis.opendocument.spreadsheet';
$imgmime = 'ooffice.png'; $imgmime = 'ooffice.png';
$famime = 'file-excel-o'; $famime = 'file-excel-o';
} } elseif (preg_match('/\.odt$/i', $tmpfile)) {
if (preg_match('/\.odt$/i', $tmpfile)) {
$mime = 'application/vnd.oasis.opendocument.text'; $mime = 'application/vnd.oasis.opendocument.text';
$imgmime = 'ooffice.png'; $imgmime = 'ooffice.png';
$famime = 'file-word-o'; $famime = 'file-word-o';
} } elseif (preg_match('/\.mdb$/i', $tmpfile)) { // MS Office
// MS Office
if (preg_match('/\.mdb$/i', $tmpfile)) {
$mime = 'application/msaccess'; $mime = 'application/msaccess';
$imgmime = 'mdb.png'; $imgmime = 'mdb.png';
$famime = 'file-o'; $famime = 'file-o';
} } elseif (preg_match('/\.doc[xm]?$/i', $tmpfile)) {
if (preg_match('/\.doc[xm]?$/i', $tmpfile)) {
$mime = 'application/msword'; $mime = 'application/msword';
$imgmime = 'doc.png'; $imgmime = 'doc.png';
$famime = 'file-word-o'; $famime = 'file-word-o';
} } elseif (preg_match('/\.dot[xm]?$/i', $tmpfile)) {
if (preg_match('/\.dot[xm]?$/i', $tmpfile)) {
$mime = 'application/msword'; $mime = 'application/msword';
$imgmime = 'doc.png'; $imgmime = 'doc.png';
$famime = 'file-word-o'; $famime = 'file-word-o';
} } elseif (preg_match('/\.xlt(x)?$/i', $tmpfile)) {
if (preg_match('/\.xlt(x)?$/i', $tmpfile)) {
$mime = 'application/vnd.ms-excel'; $mime = 'application/vnd.ms-excel';
$imgmime = 'xls.png'; $imgmime = 'xls.png';
$famime = 'file-excel-o'; $famime = 'file-excel-o';
} } elseif (preg_match('/\.xla(m)?$/i', $tmpfile)) {
if (preg_match('/\.xla(m)?$/i', $tmpfile)) {
$mime = 'application/vnd.ms-excel'; $mime = 'application/vnd.ms-excel';
$imgmime = 'xls.png'; $imgmime = 'xls.png';
$famime = 'file-excel-o'; $famime = 'file-excel-o';
} } elseif (preg_match('/\.xls$/i', $tmpfile)) {
if (preg_match('/\.xls$/i', $tmpfile)) {
$mime = 'application/vnd.ms-excel'; $mime = 'application/vnd.ms-excel';
$imgmime = 'xls.png'; $imgmime = 'xls.png';
$famime = 'file-excel-o'; $famime = 'file-excel-o';
} } elseif (preg_match('/\.xls[bmx]$/i', $tmpfile)) {
if (preg_match('/\.xls[bmx]$/i', $tmpfile)) {
$mime = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'; $mime = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
$imgmime = 'xls.png'; $imgmime = 'xls.png';
$famime = 'file-excel-o'; $famime = 'file-excel-o';
} } elseif (preg_match('/\.pps[mx]?$/i', $tmpfile)) {
if (preg_match('/\.pps[mx]?$/i', $tmpfile)) {
$mime = 'application/vnd.ms-powerpoint'; $mime = 'application/vnd.ms-powerpoint';
$imgmime = 'ppt.png'; $imgmime = 'ppt.png';
$famime = 'file-powerpoint-o'; $famime = 'file-powerpoint-o';
} } elseif (preg_match('/\.ppt[mx]?$/i', $tmpfile)) {
if (preg_match('/\.ppt[mx]?$/i', $tmpfile)) {
$mime = 'application/x-mspowerpoint'; $mime = 'application/x-mspowerpoint';
$imgmime = 'ppt.png'; $imgmime = 'ppt.png';
$famime = 'file-powerpoint-o'; $famime = 'file-powerpoint-o';
} } elseif (preg_match('/\.pdf$/i', $tmpfile)) { // Other
// Other
if (preg_match('/\.pdf$/i', $tmpfile)) {
$mime = 'application/pdf'; $mime = 'application/pdf';
$imgmime = 'pdf.png'; $imgmime = 'pdf.png';
$famime = 'file-pdf-o'; $famime = 'file-pdf-o';
} } elseif (preg_match('/\.bat$/i', $tmpfile)) { // Scripts
// Scripts
if (preg_match('/\.bat$/i', $tmpfile)) {
$mime = 'text/x-bat'; $mime = 'text/x-bat';
$imgmime = 'script.png'; $imgmime = 'script.png';
$srclang = 'dos'; $srclang = 'dos';
$famime = 'file-code-o'; $famime = 'file-code-o';
} } elseif (preg_match('/\.sh$/i', $tmpfile)) {
if (preg_match('/\.sh$/i', $tmpfile)) {
$mime = 'text/x-sh'; $mime = 'text/x-sh';
$imgmime = 'script.png'; $imgmime = 'script.png';
$srclang = 'bash'; $srclang = 'bash';
$famime = 'file-code-o'; $famime = 'file-code-o';
} } elseif (preg_match('/\.ksh$/i', $tmpfile)) {
if (preg_match('/\.ksh$/i', $tmpfile)) {
$mime = 'text/x-ksh'; $mime = 'text/x-ksh';
$imgmime = 'script.png'; $imgmime = 'script.png';
$srclang = 'bash'; $srclang = 'bash';
$famime = 'file-code-o'; $famime = 'file-code-o';
} } elseif (preg_match('/\.bash$/i', $tmpfile)) {
if (preg_match('/\.bash$/i', $tmpfile)) {
$mime = 'text/x-bash'; $mime = 'text/x-bash';
$imgmime = 'script.png'; $imgmime = 'script.png';
$srclang = 'bash'; $srclang = 'bash';
$famime = 'file-code-o'; $famime = 'file-code-o';
} } elseif (preg_match('/\.ico$/i', $tmpfile)) { // Images
// Images
if (preg_match('/\.ico$/i', $tmpfile)) {
$mime = 'image/x-icon'; $mime = 'image/x-icon';
$imgmime = 'image.png'; $imgmime = 'image.png';
$famime = 'file-image-o'; $famime = 'file-image-o';
} } elseif (preg_match('/\.(jpg|jpeg)$/i', $tmpfile)) {
if (preg_match('/\.(jpg|jpeg)$/i', $tmpfile)) {
$mime = 'image/jpeg'; $mime = 'image/jpeg';
$imgmime = 'image.png'; $imgmime = 'image.png';
$famime = 'file-image-o'; $famime = 'file-image-o';
} } elseif (preg_match('/\.png$/i', $tmpfile)) {
if (preg_match('/\.png$/i', $tmpfile)) {
$mime = 'image/png'; $mime = 'image/png';
$imgmime = 'image.png'; $imgmime = 'image.png';
$famime = 'file-image-o'; $famime = 'file-image-o';
} } elseif (preg_match('/\.gif$/i', $tmpfile)) {
if (preg_match('/\.gif$/i', $tmpfile)) {
$mime = 'image/gif'; $mime = 'image/gif';
$imgmime = 'image.png'; $imgmime = 'image.png';
$famime = 'file-image-o'; $famime = 'file-image-o';
} } elseif (preg_match('/\.bmp$/i', $tmpfile)) {
if (preg_match('/\.bmp$/i', $tmpfile)) {
$mime = 'image/bmp'; $mime = 'image/bmp';
$imgmime = 'image.png'; $imgmime = 'image.png';
$famime = 'file-image-o'; $famime = 'file-image-o';
} } elseif (preg_match('/\.(tif|tiff)$/i', $tmpfile)) {
if (preg_match('/\.(tif|tiff)$/i', $tmpfile)) {
$mime = 'image/tiff'; $mime = 'image/tiff';
$imgmime = 'image.png'; $imgmime = 'image.png';
$famime = 'file-image-o'; $famime = 'file-image-o';
} } elseif (preg_match('/\.svg$/i', $tmpfile)) {
if (preg_match('/\.svg$/i', $tmpfile)) {
$mime = 'image/svg+xml'; $mime = 'image/svg+xml';
$imgmime = 'image.png'; $imgmime = 'image.png';
$famime = 'file-image-o'; $famime = 'file-image-o';
} } elseif (preg_match('/\.webp$/i', $tmpfile)) {
if (preg_match('/\.webp$/i', $tmpfile)) {
$mime = 'image/webp'; $mime = 'image/webp';
$imgmime = 'image.png'; $imgmime = 'image.png';
$famime = 'file-image-o'; $famime = 'file-image-o';
} } elseif (preg_match('/\.vcs$/i', $tmpfile)) { // Calendar
// Calendar
if (preg_match('/\.vcs$/i', $tmpfile)) {
$mime = 'text/calendar'; $mime = 'text/calendar';
$imgmime = 'other.png'; $imgmime = 'other.png';
$famime = 'file-text-o'; $famime = 'file-text-o';
} } elseif (preg_match('/\.ics$/i', $tmpfile)) {
if (preg_match('/\.ics$/i', $tmpfile)) {
$mime = 'text/calendar'; $mime = 'text/calendar';
$imgmime = 'other.png'; $imgmime = 'other.png';
$famime = 'file-text-o'; $famime = 'file-text-o';
} } elseif (preg_match('/\.torrent$/i', $tmpfile)) { // Other
// Other
if (preg_match('/\.torrent$/i', $tmpfile)) {
$mime = 'application/x-bittorrent'; $mime = 'application/x-bittorrent';
$imgmime = 'other.png'; $imgmime = 'other.png';
$famime = 'file-o'; $famime = 'file-o';
} } elseif (preg_match('/\.(mp3|ogg|au|wav|wma|mid)$/i', $tmpfile)) { // Audio
// Audio
if (preg_match('/\.(mp3|ogg|au|wav|wma|mid)$/i', $tmpfile)) {
$mime = 'audio'; $mime = 'audio';
$imgmime = 'audio.png'; $imgmime = 'audio.png';
$famime = 'file-audio-o'; $famime = 'file-audio-o';
} } elseif (preg_match('/\.mp4$/i', $tmpfile)) { // Video
// Video
if (preg_match('/\.mp4$/i', $tmpfile)) {
$mime = 'video/mp4'; $mime = 'video/mp4';
$imgmime = 'video.png'; $imgmime = 'video.png';
$famime = 'file-video-o'; $famime = 'file-video-o';
} } elseif (preg_match('/\.ogv$/i', $tmpfile)) {
if (preg_match('/\.ogv$/i', $tmpfile)) {
$mime = 'video/ogg'; $mime = 'video/ogg';
$imgmime = 'video.png'; $imgmime = 'video.png';
$famime = 'file-video-o'; $famime = 'file-video-o';
} } elseif (preg_match('/\.webm$/i', $tmpfile)) {
if (preg_match('/\.webm$/i', $tmpfile)) {
$mime = 'video/webm'; $mime = 'video/webm';
$imgmime = 'video.png'; $imgmime = 'video.png';
$famime = 'file-video-o'; $famime = 'file-video-o';
} } elseif (preg_match('/\.avi$/i', $tmpfile)) {
if (preg_match('/\.avi$/i', $tmpfile)) {
$mime = 'video/x-msvideo'; $mime = 'video/x-msvideo';
$imgmime = 'video.png'; $imgmime = 'video.png';
$famime = 'file-video-o'; $famime = 'file-video-o';
} } elseif (preg_match('/\.divx$/i', $tmpfile)) {
if (preg_match('/\.divx$/i', $tmpfile)) {
$mime = 'video/divx'; $mime = 'video/divx';
$imgmime = 'video.png'; $imgmime = 'video.png';
$famime = 'file-video-o'; $famime = 'file-video-o';
} } elseif (preg_match('/\.xvid$/i', $tmpfile)) {
if (preg_match('/\.xvid$/i', $tmpfile)) {
$mime = 'video/xvid'; $mime = 'video/xvid';
$imgmime = 'video.png'; $imgmime = 'video.png';
$famime = 'file-video-o'; $famime = 'file-video-o';
} } elseif (preg_match('/\.(wmv|mpg|mpeg)$/i', $tmpfile)) {
if (preg_match('/\.(wmv|mpg|mpeg)$/i', $tmpfile)) {
$mime = 'video'; $mime = 'video';
$imgmime = 'video.png'; $imgmime = 'video.png';
$famime = 'file-video-o'; $famime = 'file-video-o';
} } elseif (preg_match('/\.(zip|rar|gz|tgz|z|cab|bz2|7z|tar|lzh|zst)$/i', $tmpfile)) { // Archive
// Archive // application/xxx where zzz is zip, ...
if (preg_match('/\.(zip|rar|gz|tgz|z|cab|bz2|7z|tar|lzh|zst)$/i', $tmpfile)) {
$mime = 'archive'; $mime = 'archive';
$imgmime = 'archive.png'; $imgmime = 'archive.png';
$famime = 'file-archive-o'; $famime = 'file-archive-o';
} // application/xxx where zzz is zip, ... } elseif (preg_match('/\.(exe|com)$/i', $tmpfile)) { // Exe
// Exe
if (preg_match('/\.(exe|com)$/i', $tmpfile)) {
$mime = 'application/octet-stream'; $mime = 'application/octet-stream';
$imgmime = 'other.png'; $imgmime = 'other.png';
$famime = 'file-o'; $famime = 'file-o';
} } elseif (preg_match('/\.(dll|lib|o|so|a)$/i', $tmpfile)) { // Lib
// Lib
if (preg_match('/\.(dll|lib|o|so|a)$/i', $tmpfile)) {
$mime = 'library'; $mime = 'library';
$imgmime = 'library.png'; $imgmime = 'library.png';
$famime = 'file-o'; $famime = 'file-o';
} } elseif (preg_match('/\.err$/i', $tmpfile)) { // phpcs:ignore
// Err
if (preg_match('/\.err$/i', $tmpfile)) {
$mime = 'error'; $mime = 'error';
$imgmime = 'error.png'; $imgmime = 'error.png';
$famime = 'file-text-o'; $famime = 'file-text-o';
} }
// Return string // Return mimetype string
if ($mode == 1) { switch ((int) $mode) {
case 1:
$tmp = explode('/', $mime); $tmp = explode('/', $mime);
return (!empty($tmp[1]) ? $tmp[1] : $tmp[0]); return (!empty($tmp[1]) ? $tmp[1] : $tmp[0]);
} case 2:
if ($mode == 2) {
return $imgmime; return $imgmime;
} case 3:
if ($mode == 3) {
return $srclang; return $srclang;
} case 4:
if ($mode == 4) {
return $famime; return $famime;
} }
return $mime; return $mime;

View File

@@ -1167,7 +1167,7 @@ function updateDictionaryInFile($module, $file, $dicts)
$dicData .= "array(" . implode(",", $conditions) . ")"; $dicData .= "array(" . implode(",", $conditions) . ")";
} elseif ($key === 'tabhelp') { } elseif ($key === 'tabhelp') {
$helpItems = array(); $helpItems = array();
foreach ($value as $key => $helpValue) { foreach ($value as $helpValue) {
$helpItems[] = "array('code'=>\$langs->trans('".$helpValue['code']."'), 'field2' => 'field2tooltip')"; $helpItems[] = "array('code'=>\$langs->trans('".$helpValue['code']."'), 'field2' => 'field2tooltip')";
} }
$dicData .= "array(" . implode(",", $helpItems) . ")"; $dicData .= "array(" . implode(",", $helpItems) . ")";

View File

@@ -165,7 +165,7 @@ class modCategorie extends DolibarrModules
} }
// Definition of vars // Definition of vars
$this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.type'=>"Type", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategoryID", 'pcat.label'=>"ParentCategoryLabel"); $this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.type'=>"Type", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategoryID", 'pcat.label'=>"ParentCategoryLabel", 'cat.color'=>"Color", 'cat.date_creation'=>"DateCreation", 'cat.tms'=>"DateLastModification");
$this->export_TypeFields_array[$r] = array('cat.rowid'=>'Numeric', 'cat.label'=>"Text", 'cat.type'=>"Numeric", 'cat.description'=>"Text", 'cat.fk_parent'=>'Numeric', 'pcat.label'=>'Text'); $this->export_TypeFields_array[$r] = array('cat.rowid'=>'Numeric', 'cat.label'=>"Text", 'cat.type'=>"Numeric", 'cat.description'=>"Text", 'cat.fk_parent'=>'Numeric', 'pcat.label'=>'Text');
$this->export_entities_array[$r] = array(); // We define here only fields that use another picto $this->export_entities_array[$r] = array(); // We define here only fields that use another picto
$this->export_help_array[$r] = array('cat.type'=>$typeexample); $this->export_help_array[$r] = array('cat.type'=>$typeexample);
@@ -182,7 +182,7 @@ class modCategorie extends DolibarrModules
$this->export_icon[$r] = $this->picto; $this->export_icon[$r] = $this->picto;
$this->export_enabled[$r] = 'isModEnabled("product") || isModEnabled("service")'; $this->export_enabled[$r] = 'isModEnabled("product") || isModEnabled("service")';
$this->export_permission[$r] = array(array("categorie", "lire"), array("produit", "export")); $this->export_permission[$r] = array(array("categorie", "lire"), array("produit", "export"));
$this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategoryID", 'pcat.label'=>"ParentCategoryLabel", 'p.rowid'=>'ProductId', 'p.ref'=>'Ref', 'p.label'=>'Label'); $this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategoryID", 'pcat.label'=>"ParentCategoryLabel", 'cat.color'=>"Color", 'cat.date_creation'=>"DateCreation", 'cat.tms'=>"DateLastModification", 'p.rowid'=>'ProductId', 'p.ref'=>'Ref', 'p.label'=>'Label');
$this->export_TypeFields_array[$r] = array('cat.rowid'=>'Numeric', 'cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'Numeric', 'pcat.label'=>'Text', 'p.rowid'=>'Numeric', 'p.ref'=>'Text', 'p.label'=>'Text'); $this->export_TypeFields_array[$r] = array('cat.rowid'=>'Numeric', 'cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'Numeric', 'pcat.label'=>'Text', 'p.rowid'=>'Numeric', 'p.ref'=>'Text', 'p.label'=>'Text');
$this->export_entities_array[$r] = array('p.rowid'=>'product', 'p.ref'=>'product', 'p.label'=>'product'); // We define here only fields that use another picto $this->export_entities_array[$r] = array('p.rowid'=>'product', 'p.ref'=>'product', 'p.label'=>'product'); // We define here only fields that use another picto
@@ -209,6 +209,7 @@ class modCategorie extends DolibarrModules
$this->export_permission[$r] = array(array("categorie", "lire"), array("fournisseur", "lire")); $this->export_permission[$r] = array(array("categorie", "lire"), array("fournisseur", "lire"));
$this->export_fields_array[$r] = array( $this->export_fields_array[$r] = array(
'cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategoryID", 'pcat.label'=>"ParentCategoryLabel", 'cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategoryID", 'pcat.label'=>"ParentCategoryLabel",
'cat.color'=>"Color", 'cat.date_creation'=>"DateCreation", 'cat.tms'=>"DateLastModification",
's.rowid'=>'IdThirdParty', 's.nom'=>'Name', 's.prefix_comm'=>"Prefix", 's.fournisseur'=>"Supplier", 's.datec'=>"DateCreation", 's.tms'=>"DateLastModification", 's.code_fournisseur'=>"SupplierCode", 's.rowid'=>'IdThirdParty', 's.nom'=>'Name', 's.prefix_comm'=>"Prefix", 's.fournisseur'=>"Supplier", 's.datec'=>"DateCreation", 's.tms'=>"DateLastModification", 's.code_fournisseur'=>"SupplierCode",
's.address'=>"Address", 's.zip'=>"Zip", 's.town'=>"Town", 'c.label'=>"Country", 'c.code'=>"CountryCode", 's.address'=>"Address", 's.zip'=>"Zip", 's.town'=>"Town", 'c.label'=>"Country", 'c.code'=>"CountryCode",
's.phone'=>"Phone", 's.fax'=>"Fax", 's.url'=>"Url", 's.email'=>"Email", 's.phone'=>"Phone", 's.fax'=>"Fax", 's.url'=>"Url", 's.email'=>"Email",
@@ -256,6 +257,7 @@ class modCategorie extends DolibarrModules
$this->export_permission[$r] = array(array("categorie", "lire"), array("societe", "export")); $this->export_permission[$r] = array(array("categorie", "lire"), array("societe", "export"));
$this->export_fields_array[$r] = array( $this->export_fields_array[$r] = array(
'cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategoryID", 'pcat.label'=>"ParentCategoryLabel", 'cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategoryID", 'pcat.label'=>"ParentCategoryLabel",
'cat.color'=>"Color", 'cat.date_creation'=>"DateCreation", 'cat.tms'=>"DateLastModification",
's.rowid'=>'IdThirdParty', 's.nom'=>'Name', 's.prefix_comm'=>"Prefix", 's.client'=>"Customer", 's.datec'=>"DateCreation", 's.tms'=>"DateLastModification", 's.code_client'=>"CustomerCode", 's.rowid'=>'IdThirdParty', 's.nom'=>'Name', 's.prefix_comm'=>"Prefix", 's.client'=>"Customer", 's.datec'=>"DateCreation", 's.tms'=>"DateLastModification", 's.code_client'=>"CustomerCode",
's.address'=>"Address", 's.zip'=>"Zip", 's.town'=>"Town", 'c.label'=>"Country", 'c.code'=>"CountryCode", 's.address'=>"Address", 's.zip'=>"Zip", 's.town'=>"Town", 'c.label'=>"Country", 'c.code'=>"CountryCode",
's.phone'=>"Phone", 's.fax'=>"Fax", 's.url'=>"Url", 's.email'=>"Email", 's.phone'=>"Phone", 's.fax'=>"Fax", 's.url'=>"Url", 's.email'=>"Email",
@@ -330,6 +332,7 @@ class modCategorie extends DolibarrModules
$this->export_permission[$r] = array(array("categorie", "lire"), array("societe", "contact", "export")); $this->export_permission[$r] = array(array("categorie", "lire"), array("societe", "contact", "export"));
$this->export_fields_array[$r] = array( $this->export_fields_array[$r] = array(
'cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategoryID", 'pcat.label'=>"ParentCategoryLabel", 'cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategoryID", 'pcat.label'=>"ParentCategoryLabel",
'cat.color'=>"Color", 'cat.date_creation'=>"DateCreation", 'cat.tms'=>"DateLastModification",
'p.rowid' => 'ContactId', 'civ.label' => 'UserTitle', 'p.lastname' => 'LastName', 'p.firstname' => 'Firstname', 'p.rowid' => 'ContactId', 'civ.label' => 'UserTitle', 'p.lastname' => 'LastName', 'p.firstname' => 'Firstname',
'p.address' => 'Address', 'p.zip' => 'Zip', 'p.town' => 'Town', 'c.code' => 'CountryCode', 'c.label' => 'Country', 'p.address' => 'Address', 'p.zip' => 'Zip', 'p.town' => 'Town', 'c.code' => 'CountryCode', 'c.label' => 'Country',
'p.birthday' => 'DateOfBirth', 'p.poste' => 'PostOrFunction', 'p.birthday' => 'DateOfBirth', 'p.poste' => 'PostOrFunction',
@@ -387,7 +390,7 @@ class modCategorie extends DolibarrModules
$this->export_icon[$r] = $this->picto; $this->export_icon[$r] = $this->picto;
$this->export_enabled[$r] = "isModEnabled('project')"; $this->export_enabled[$r] = "isModEnabled('project')";
$this->export_permission[$r] = array(array("categorie", "lire"), array("projet", "export")); $this->export_permission[$r] = array(array("categorie", "lire"), array("projet", "export"));
$this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategory", 'pcat.label'=>"ParentCategoryLabel", 'p.rowid'=>'ProjectId', 'p.ref'=>'Ref', 's.rowid'=>"IdThirdParty", 's.nom'=>"Name"); $this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategory", 'pcat.label'=>"ParentCategoryLabel", 'cat.color'=>"Color", 'cat.date_creation'=>"DateCreation", 'cat.tms'=>"DateLastModification", 'p.rowid'=>'ProjectId', 'p.ref'=>'Ref', 's.rowid'=>"IdThirdParty", 's.nom'=>"Name");
$this->export_TypeFields_array[$r] = array('cat.rowid'=>'Numeric', 'cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'Numeric', 'pcat.label'=>'Text', 'p.rowid'=>'Numeric', 'p.ref'=>'Text', 's.rowid'=>"Numeric", 's.nom'=>"Text"); $this->export_TypeFields_array[$r] = array('cat.rowid'=>'Numeric', 'cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'Numeric', 'pcat.label'=>'Text', 'p.rowid'=>'Numeric', 'p.ref'=>'Text', 's.rowid'=>"Numeric", 's.nom'=>"Text");
$this->export_entities_array[$r] = array('p.rowid'=>'project', 'p.ref'=>'project', 's.rowid'=>"company", 's.nom'=>"company"); // We define here only fields that use another picto $this->export_entities_array[$r] = array('p.rowid'=>'project', 'p.ref'=>'project', 's.rowid'=>"company", 's.nom'=>"company"); // We define here only fields that use another picto
@@ -413,7 +416,7 @@ class modCategorie extends DolibarrModules
$this->export_icon[$r] = $this->picto; $this->export_icon[$r] = $this->picto;
$this->export_enabled[$r] = 'isModEnabled("user")'; $this->export_enabled[$r] = 'isModEnabled("user")';
$this->export_permission[$r] = array(array("categorie", "lire"), array("user", "export")); $this->export_permission[$r] = array(array("categorie", "lire"), array("user", "export"));
$this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategory", 'pcat.label'=>"ParentCategoryLabel", 'p.rowid'=>'UserID', 'p.login'=>'Login', 'p.lastname'=>'Lastname', 'p.firstname'=>'Firstname'); $this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategory", 'pcat.label'=>"ParentCategoryLabel", 'cat.color'=>"Color", 'cat.date_creation'=>"DateCreation", 'cat.tms'=>"DateLastModification", 'p.rowid'=>'UserID', 'p.login'=>'Login', 'p.lastname'=>'Lastname', 'p.firstname'=>'Firstname');
$this->export_TypeFields_array[$r] = array('cat.rowid'=>"Numeric", 'cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'Numeric', 'pcat.label'=>'Text', 'p.rowid'=>'Numeric', 'p.login'=>'Text', 'p.lastname'=>'Text', 'p.firstname'=>'Text'); $this->export_TypeFields_array[$r] = array('cat.rowid'=>"Numeric", 'cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'Numeric', 'pcat.label'=>'Text', 'p.rowid'=>'Numeric', 'p.login'=>'Text', 'p.lastname'=>'Text', 'p.firstname'=>'Text');
$this->export_entities_array[$r] = array('p.rowid'=>'user', 'p.login'=>'user', 'p.lastname'=>'user', 'p.firstname'=>'user'); // We define here only fields that use another picto $this->export_entities_array[$r] = array('p.rowid'=>'user', 'p.login'=>'user', 'p.lastname'=>'user', 'p.firstname'=>'user'); // We define here only fields that use another picto

View File

@@ -313,7 +313,8 @@ class modSociete extends DolibarrModules
's.phone'=>"Text", 's.fax'=>"Text", 's.phone'=>"Text", 's.fax'=>"Text",
's.url'=>"Text", 's.email'=>"Text", 's.default_lang'=>"Text", 's.canvas' => "Text", 's.url'=>"Text", 's.email'=>"Text", 's.default_lang'=>"Text", 's.canvas' => "Text",
's.siret'=>"Text", 's.siren'=>"Text", 's.ape'=>"Text", 's.idprof4'=>"Text", 's.idprof5'=>"Text", 's.idprof6'=>"Text", 's.siret'=>"Text", 's.siren'=>"Text", 's.ape'=>"Text", 's.idprof4'=>"Text", 's.idprof5'=>"Text", 's.idprof6'=>"Text",
's.tva_intra'=>"Text", 's.capital'=>"Numeric", 's.note_private'=>"Text", 's.note_public'=>"Text", 's.tva_intra'=>"Text", 's.capital'=>"Numeric",
's.note_private'=>"Text", 's.note_public'=>"Text",
't.code'=>"List:c_typent:libelle:code", 't.code'=>"List:c_typent:libelle:code",
'ce.code'=>"List:c_effectif:libelle:code", 'ce.code'=>"List:c_effectif:libelle:code",
"cfj.libelle"=>"Text", "cfj.libelle"=>"Text",
@@ -367,11 +368,13 @@ class modSociete extends DolibarrModules
'c.rowid'=>"IdContact", 'c.civility'=>"CivilityCode", 'c.lastname'=>'Lastname', 'c.firstname'=>'Firstname', 'c.poste'=>'PostOrFunction', 'c.rowid'=>"IdContact", 'c.civility'=>"CivilityCode", 'c.lastname'=>'Lastname', 'c.firstname'=>'Firstname', 'c.poste'=>'PostOrFunction',
'c.datec'=>"DateCreation", 'c.tms'=>"DateLastModification", 'c.priv'=>"ContactPrivate", 'c.address'=>"Address", 'c.zip'=>"Zip", 'c.town'=>"Town", 'c.datec'=>"DateCreation", 'c.tms'=>"DateLastModification", 'c.priv'=>"ContactPrivate", 'c.address'=>"Address", 'c.zip'=>"Zip", 'c.town'=>"Town",
'd.nom'=>'State', 'r.nom'=>'Region', 'co.label'=>"Country", 'co.code'=>"CountryCode", 'c.phone'=>"Phone", 'c.fax'=>"Fax", 'c.phone_mobile'=>"Mobile", 'c.email'=>"EMail", 'd.nom'=>'State', 'r.nom'=>'Region', 'co.label'=>"Country", 'co.code'=>"CountryCode", 'c.phone'=>"Phone", 'c.fax'=>"Fax", 'c.phone_mobile'=>"Mobile", 'c.email'=>"EMail",
'c.note_private'=>'NotePrivate', 'c.note_public'=>"NotePublic",
'c.statut'=>"Status", 'c.statut'=>"Status",
's.rowid'=>"IdCompany", 's.nom'=>"CompanyName", 's.status'=>"Status", 's.code_client'=>"CustomerCode", 's.code_fournisseur'=>"SupplierCode", 's.rowid'=>"IdCompany", 's.nom'=>"CompanyName", 's.status'=>"Status", 's.code_client'=>"CustomerCode", 's.code_fournisseur'=>"SupplierCode",
's.code_compta'=>"AccountancyCode", 's.code_compta_fournisseur'=>"SupplierAccountancyCode", 's.code_compta'=>"AccountancyCode", 's.code_compta_fournisseur'=>"SupplierAccountancyCode",
's.client'=>'Customer', 's.fournisseur'=>'Supplier', 's.client'=>'Customer', 's.fournisseur'=>'Supplier',
's.address'=>'Address', 's.zip'=>"Zip", 's.town'=>"Town", 's.phone'=>'Phone', 's.email'=>"Email", 's.address'=>'Address', 's.zip'=>"Zip", 's.town'=>"Town", 's.phone'=>'Phone', 's.email'=>"Email",
'c.note_private'=>'NotePrivate', 'c.note_public'=>"NotePublic",
't.code'=>"ThirdPartyType" 't.code'=>"ThirdPartyType"
); );
// Add multicompany field // Add multicompany field

View File

@@ -135,7 +135,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator
// Top // Top
if ($header != '') { if ($header != '') {
$pdf->SetXY($_PosX + $xleft, $_PosY + 1); // Only 1 mm and not ytop for top text $pdf->SetXY($_PosX + $xleft, $_PosY + 1); // Only 1 mm and not ytop for top text
$pdf->Cell($this->_Width - 2 * $xleft, $this->_Line_Height, $outputlangs->convToOutputCharset($header), 0, 1, 'C'); $pdf->Cell(2 * strlen($header), $this->_Line_Height, $outputlangs->convToOutputCharset($header), 0, 1, 'C');
} }
$ytop += (empty($header) ? 0 : (1 + $this->_Line_Height)); $ytop += (empty($header) ? 0 : (1 + $this->_Line_Height));

View File

@@ -1139,7 +1139,14 @@ if ($action == 'create') {
// Confirm done // Confirm done
if ($action == 'classifydone') { if ($action == 'classifydone') {
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('CloseIntervention'), $langs->trans('ConfirmCloseIntervention'), 'confirm_done', '', 0, 1); $text = $langs->trans('ConfirmCloseIntervention');
if (isModEnabled('notification')) {
require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
$notify = new Notify($db);
$text .= '<br>';
$text .= $notify->confirmMessage('FICHINTER_CLOSE', $object->socid, $object);
}
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('CloseIntervention'), $text, 'confirm_done', '', 0, 1);
} }
// Confirm back to draft // Confirm back to draft

View File

@@ -534,7 +534,7 @@ if (count($typeleaves) == 0) {
foreach ($arrayfields as $key => $val) { foreach ($arrayfields as $key => $val) {
if (!empty($val['checked'])) { if (!empty($val['checked'])) {
if ($key == 'cp.nbHoliday') { if ($key == 'cp.nbHoliday') {
foreach ($typeleaves as $key => $val) { foreach ($typeleaves as $leave_key => $leave_val) {
$colspan++; $colspan++;
} }
} else { } else {

View File

@@ -282,7 +282,7 @@ if (count($tasksarray) > 0) {
foreach ($tasksarray as $key => $val) { // Task array are sorted by "project, position, date" foreach ($tasksarray as $key => $val) { // Task array are sorted by "project, position, date"
$task->fetch($val->id, ''); $task->fetch($val->id, '');
$idparent = ($val->fk_parent ? $val->fk_parent : '-'.$val->fk_project); // If start with -, id is a project id $idparent = ($val->fk_task_parent ? $val->fk_task_parent : '-'.$val->fk_project); // If start with -, id is a project id
$tasks[$taskcursor]['task_id'] = $val->id; $tasks[$taskcursor]['task_id'] = $val->id;
$tasks[$taskcursor]['task_alternate_id'] = ($taskcursor + 1); // An id that has same order than position (required by ganttchart) $tasks[$taskcursor]['task_alternate_id'] = ($taskcursor + 1); // An id that has same order than position (required by ganttchart)
@@ -294,7 +294,7 @@ if (count($tasksarray) > 0) {
$tasks[$taskcursor]['task_position'] = $val->rang; $tasks[$taskcursor]['task_position'] = $val->rang;
$tasks[$taskcursor]['task_planned_workload'] = $val->planned_workload; $tasks[$taskcursor]['task_planned_workload'] = $val->planned_workload;
if ($val->fk_parent != 0 && $task->hasChildren() > 0) { if ($val->fk_task_parent != 0 && $task->hasChildren() > 0) {
$tasks[$taskcursor]['task_is_group'] = 1; $tasks[$taskcursor]['task_is_group'] = 1;
$tasks[$taskcursor]['task_css'] = 'ggroupblack'; $tasks[$taskcursor]['task_css'] = 'ggroupblack';
//$tasks[$taskcursor]['task_css'] = 'gtaskblue'; //$tasks[$taskcursor]['task_css'] = 'gtaskblue';