Merge branch 'develop' of github.com:Dolibarr/dolibarr into develop#2
This commit is contained in:
commit
9b7d0d0517
@ -6,8 +6,9 @@ build:
|
||||
analysis:
|
||||
tests:
|
||||
override:
|
||||
- php-scrutinizer-run
|
||||
|
||||
- command: php-scrutinizer-run
|
||||
idle_timeout: 500
|
||||
|
||||
imports:
|
||||
- javascript
|
||||
- php
|
||||
@ -39,9 +40,11 @@ tools:
|
||||
- build/*
|
||||
- dev/*
|
||||
- doc/*
|
||||
- test/*
|
||||
- documents/*
|
||||
- htdocs/includes/*
|
||||
- htdocs/core/class/lessc.class.php
|
||||
- node_modules/*
|
||||
- test/*
|
||||
paths:
|
||||
- htdocs/
|
||||
- scripts/
|
||||
@ -181,8 +184,10 @@ tools:
|
||||
- 'build/*'
|
||||
- 'dev/*'
|
||||
- 'doc/*'
|
||||
- 'test/*'
|
||||
- 'documents/*'
|
||||
- 'htdocs/includes/*'
|
||||
- 'node_modules/*'
|
||||
- 'test/*'
|
||||
paths: { }
|
||||
|
||||
# Similar code detection
|
||||
@ -194,8 +199,10 @@ tools:
|
||||
- 'build/*'
|
||||
- 'dev/*'
|
||||
- 'doc/*'
|
||||
- 'test/*'
|
||||
- 'documents/*'
|
||||
- 'htdocs/includes/*'
|
||||
- 'node_modules/*'
|
||||
- 'test/*'
|
||||
paths: { }
|
||||
|
||||
# Coding-Style / Bug Detection
|
||||
@ -209,8 +216,10 @@ tools:
|
||||
- 'build/*'
|
||||
- 'dev/*'
|
||||
- 'doc/*'
|
||||
- 'test/*'
|
||||
- 'documents/*'
|
||||
- 'htdocs/includes/*'
|
||||
- 'node_modules/*'
|
||||
- 'test/*'
|
||||
paths: { }
|
||||
config: { }
|
||||
path_configs: { }
|
||||
|
||||
10
.travis.yml
10
.travis.yml
@ -114,7 +114,7 @@ install:
|
||||
php-parallel-lint/php-var-dump-check ~0.4 \
|
||||
squizlabs/php_codesniffer ^3
|
||||
fi
|
||||
if [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = '7.4' ] || [ "$TRAVIS_PHP_VERSION" = '7.4.22' ]; then
|
||||
if [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = '7.4' ]; then
|
||||
composer -n require phpunit/phpunit ^7 \
|
||||
php-parallel-lint/php-parallel-lint ^1.2 \
|
||||
php-parallel-lint/php-console-highlighter ^0 \
|
||||
@ -259,7 +259,7 @@ before_script:
|
||||
# enable php-fpm
|
||||
- sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
|
||||
- |
|
||||
if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = '7.2' ] || [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = '7.4' ] || [ "$TRAVIS_PHP_VERSION" = '7.4.22' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
|
||||
if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = '7.2' ] || [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = '7.4' ] || [ "$TRAVIS_PHP_VERSION" = '8.0' ] || [ "$TRAVIS_PHP_VERSION" = '8.1' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
|
||||
# Copy the included pool
|
||||
sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf
|
||||
fi
|
||||
@ -295,7 +295,7 @@ script:
|
||||
set -e
|
||||
#parallel-lint --exclude htdocs/includes --blame .
|
||||
# Exclusions are defined in the ruleset.xml file
|
||||
if [ "$TRAVIS_PHP_VERSION" = "7.4.22" ]; then
|
||||
if [ "$TRAVIS_PHP_VERSION" = "8.1" ]; then
|
||||
parallel-lint -e php --exclude dev/tools/test/namespacemig --exclude htdocs/includes/composer --exclude htdocs/includes/myclabs --exclude htdocs/includes/phpspec --exclude dev/initdata/dbf/includes \
|
||||
--exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian \
|
||||
--exclude htdocs/includes/squizlabs/php_codesniffer --exclude htdocs/includes/jakub-onderka --exclude htdocs/includes/php-parallel-lint --exclude htdocs/includes/symfony \
|
||||
@ -310,7 +310,7 @@ script:
|
||||
# Ensure we catch errors
|
||||
set -e
|
||||
# Exclusions are defined in the ruleset.xml file
|
||||
if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_PHP_VERSION" = "7.4.22" ]; then
|
||||
if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_PHP_VERSION" = "8.1" ]; then
|
||||
phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .;
|
||||
fi
|
||||
set +e
|
||||
@ -321,7 +321,7 @@ script:
|
||||
# Ensure we catch errors
|
||||
set -e
|
||||
# Exclusions are defined in the ruleset.xml file
|
||||
if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_PHP_VERSION" = "7.4.22" ]; then
|
||||
if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_PHP_VERSION" = "8.1" ]; then
|
||||
var-dump-check --extensions php --tracy --exclude htdocs/includes --exclude test/ --exclude htdocs/public/test/ --exclude htdocs/core/lib/functions.lib.php .
|
||||
fi
|
||||
set +e
|
||||
|
||||
@ -7,6 +7,8 @@ English Dolibarr ChangeLog
|
||||
For users:
|
||||
---------------
|
||||
|
||||
NEW Minimal PHP version is now PHP 7.0 instead of PHP 5.6
|
||||
|
||||
...
|
||||
|
||||
|
||||
@ -28,7 +30,7 @@ Following changes may create regressions for some external modules, but were nec
|
||||
For users:
|
||||
---------------
|
||||
|
||||
NEW: PHP 8.0 and 8.1 compatibility (with mysql):
|
||||
NEW: PHP 8.0 and 8.1 compatibility:
|
||||
Warning!! Application works correctly with PHP 8.0 and 8.1 but you will experience a lot of PHP warnings into the PHP server
|
||||
log files (depending on your PHP setup). Removal of all PHP warnings on server side is planned for v17.
|
||||
NEW: Support for recurring purchase invoices.
|
||||
|
||||
@ -653,21 +653,28 @@ if (!empty($sortfield)) {
|
||||
// Export into a file with format defined into setup (FEC, CSV, ...)
|
||||
// Must be after definition of $sql
|
||||
if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->export) {
|
||||
// TODO Replace the fetchAll to get all ->line followed by call to ->export(). It consumew too much memory on large export. Replace this with the query($sql) and loop on each line to export them.
|
||||
// TODO Replace the fetchAll to get all ->line followed by call to ->export(). It consumes too much memory on large export.
|
||||
// Replace this with the query($sql) and loop on each line to export them.
|
||||
$result = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter, 'AND', (empty($conf->global->ACCOUNTING_REEXPORT) ? 0 : 1));
|
||||
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
} else {
|
||||
// Export files
|
||||
// Export files then exit
|
||||
$accountancyexport = new AccountancyExport($db);
|
||||
|
||||
$mimetype = $accountancyexport->getMimeType($formatexportset);
|
||||
|
||||
top_httphead($mimetype, 1);
|
||||
|
||||
// Output data on screen
|
||||
$accountancyexport->export($object->lines, $formatexportset);
|
||||
|
||||
$notifiedexportdate = GETPOST('notifiedexportdate', 'alpha');
|
||||
$notifiedvalidationdate = GETPOST('notifiedvalidationdate', 'alpha');
|
||||
|
||||
if (!empty($accountancyexport->errors)) {
|
||||
setEventMessages('', $accountancyexport->errors, 'errors');
|
||||
dol_print_error('', '', $accountancyexport->errors);
|
||||
} elseif (!empty($notifiedexportdate) || !empty($notifiedvalidationdate)) {
|
||||
// Specify as export : update field date_export or date_validated
|
||||
$error = 0;
|
||||
@ -701,11 +708,10 @@ if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->ex
|
||||
|
||||
if (!$error) {
|
||||
$db->commit();
|
||||
// setEventMessages($langs->trans("AllExportedMovementsWereRecordedAsExportedOrValidated"), null, 'mesgs');
|
||||
} else {
|
||||
$error++;
|
||||
$db->rollback();
|
||||
setEventMessages($langs->trans("NotAllExportedMovementsCouldBeRecordedAsExportedOrValidated"), null, 'errors');
|
||||
dol_print_error('', $langs->trans("NotAllExportedMovementsCouldBeRecordedAsExportedOrValidated"));
|
||||
}
|
||||
}
|
||||
exit;
|
||||
@ -861,8 +867,8 @@ if ($optioncss != '') {
|
||||
print '<input type="hidden" name="optioncss" value="'.urlencode($optioncss).'">';
|
||||
}
|
||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||
print '<input type="hidden" name="sortfield" value="'.urlencode($sortfield).'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.urlencode($sortorder).'">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
|
||||
if (count($filter)) {
|
||||
@ -883,7 +889,7 @@ if (empty($reshook)) {
|
||||
$newcardbutton .= '<span class="valignmiddle marginrightonly">'.$langs->trans("IncludeDocsAlreadyExported").'</span>';
|
||||
|
||||
if (!empty($user->rights->accounting->mouvements->export)) {
|
||||
$newcardbutton .= dolGetButtonTitle($buttonLabel, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', 'fa fa-file-export paddingleft', $_SERVER["PHP_SELF"].'?action=export_file'.($param ? '&'.$param : ''), $user->rights->accounting->mouvements->export);
|
||||
$newcardbutton .= dolGetButtonTitle($buttonLabel, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', 'fa fa-file-export paddingleft', $_SERVER["PHP_SELF"].'?action=export_file&token='.newToken().($param ? '&'.$param : ''), $user->rights->accounting->mouvements->export);
|
||||
}
|
||||
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
|
||||
@ -983,14 +989,14 @@ if (!empty($arrayfields['t.subledger_account']['checked'])) {
|
||||
print $formaccounting->select_auxaccount($search_accountancy_aux_code_end, 'search_accountancy_aux_code_end', $langs->trans('to'), 'maxwidth250', 'subledgeraccount');
|
||||
print '</div>';
|
||||
} else {
|
||||
print '<input type="text" class="maxwidth75" name="search_accountancy_aux_code" value="'.$search_accountancy_aux_code.'">';
|
||||
print '<input type="text" class="maxwidth75" name="search_accountancy_aux_code" value="'.dol_escape_htmltag($search_accountancy_aux_code).'">';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
// Label operation
|
||||
if (!empty($arrayfields['t.label_operation']['checked'])) {
|
||||
print '<td class="liste_titre">';
|
||||
print '<input type="text" size="7" class="flat" name="search_mvt_label" value="'.$search_mvt_label.'"/>';
|
||||
print '<input type="text" size="7" class="flat" name="search_mvt_label" value="'.dol_escape_htmltag($search_mvt_label).'"/>';
|
||||
print '</td>';
|
||||
}
|
||||
// Debit
|
||||
@ -1008,7 +1014,7 @@ if (!empty($arrayfields['t.credit']['checked'])) {
|
||||
// Lettering code
|
||||
if (!empty($arrayfields['t.lettering_code']['checked'])) {
|
||||
print '<td class="liste_titre center">';
|
||||
print '<input type="text" size="3" class="flat" name="search_lettering_code" value="'.$search_lettering_code.'"/>';
|
||||
print '<input type="text" size="3" class="flat" name="search_lettering_code" value="'.dol_escape_htmltag($search_lettering_code).'"/>';
|
||||
print '<br><span class="nowrap"><input type="checkbox" name="search_not_reconciled" value="notreconciled"'.($search_not_reconciled == 'notreconciled' ? ' checked' : '').'>'.$langs->trans("NotReconciled").'</span>';
|
||||
print '</td>';
|
||||
}
|
||||
@ -1116,10 +1122,10 @@ if (!empty($arrayfields['t.tms']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['t.tms']['label'], $_SERVER['PHP_SELF'], "t.tms", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
}
|
||||
if (!empty($arrayfields['t.date_export']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['t.date_export']['label'], $_SERVER['PHP_SELF'], "t.date_export", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre($arrayfields['t.date_export']['label'], $_SERVER['PHP_SELF'], "t.date_export,t.doc_date", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
}
|
||||
if (!empty($arrayfields['t.date_validated']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['t.date_validated']['label'], $_SERVER['PHP_SELF'], "t.date_validated", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre($arrayfields['t.date_validated']['label'], $_SERVER['PHP_SELF'], "t.date_validated,t.doc_date", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
}
|
||||
if (!empty($arrayfields['t.import_key']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['t.import_key']['label'], $_SERVER["PHP_SELF"], "t.import_key", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
|
||||
@ -286,6 +286,28 @@ class AccountancyExport
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the MIME type of a file
|
||||
*
|
||||
* @param int $formatexportset Id of export format
|
||||
* @return string MIME type.
|
||||
*/
|
||||
public function getMimeType($formatexportset)
|
||||
{
|
||||
$mime = 'text/csv';
|
||||
|
||||
switch ($formatexportset) {
|
||||
case self::$EXPORT_TYPE_FEC:
|
||||
$mime = 'text/tab-separated-values';
|
||||
break;
|
||||
default:
|
||||
$mime = 'text/csv';
|
||||
break;
|
||||
}
|
||||
|
||||
return $mime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function who chose which export to use with the default config, and make the export into a file
|
||||
*
|
||||
|
||||
@ -82,14 +82,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
// Creation of an optional field
|
||||
if ($action == 'create') {
|
||||
print '<div name="topofform"></div><br>';
|
||||
|
||||
@ -85,14 +85,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
// Creation of an optional field
|
||||
if ($action == 'create') {
|
||||
print "<br>";
|
||||
|
||||
@ -87,15 +87,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Creation of an optional field
|
||||
if ($action == 'create') {
|
||||
print '<br><div id="newattrib"></div>';
|
||||
|
||||
@ -83,14 +83,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Creation of an optional field
|
||||
*/
|
||||
|
||||
@ -85,14 +85,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Creation of an optional field
|
||||
*/
|
||||
|
||||
@ -82,14 +82,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Creation of an optional field
|
||||
*/
|
||||
|
||||
@ -92,14 +92,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
// Creation of an optional field
|
||||
if ($action == 'create') {
|
||||
print "<br>";
|
||||
|
||||
@ -1,147 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||
* Copyright (C) 2011-2016 Juanjo Menent <jmenent@2byte.es>ù
|
||||
* Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/admin/confexped.php
|
||||
* \ingroup produit
|
||||
* \brief Page to setup sending module
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('admin', 'sendings', 'deliveries'));
|
||||
|
||||
if (!$user->admin) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
// Shipment note
|
||||
if (isModEnabled('expedition') && empty($conf->global->MAIN_SUBMODULE_EXPEDITION)) {
|
||||
// This option should always be set to on when module is on.
|
||||
dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1", 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
/*
|
||||
if ($action == 'activate_sending')
|
||||
{
|
||||
dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1",'chaine',0,'',$conf->entity);
|
||||
header("Location: confexped.php");
|
||||
exit;
|
||||
}
|
||||
if ($action == 'disable_sending')
|
||||
{
|
||||
dolibarr_del_const($db, "MAIN_SUBMODULE_EXPEDITION",$conf->entity);
|
||||
header("Location: confexped.php");
|
||||
exit;
|
||||
}
|
||||
*/
|
||||
|
||||
// Delivery note
|
||||
if ($action == 'activate_delivery') {
|
||||
dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1", 'chaine', 0, '', $conf->entity); // We must also enable this
|
||||
dolibarr_set_const($db, "MAIN_SUBMODULE_DELIVERY", "1", 'chaine', 0, '', $conf->entity);
|
||||
header("Location: confexped.php");
|
||||
exit;
|
||||
} elseif ($action == 'disable_delivery') {
|
||||
dolibarr_del_const($db, "MAIN_SUBMODULE_DELIVERY", $conf->entity);
|
||||
header("Location: confexped.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$dir = DOL_DOCUMENT_ROOT."/core/modules/expedition/";
|
||||
$form = new Form($db);
|
||||
|
||||
llxHeader("", $langs->trans("SendingsSetup"));
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans("SendingsSetup"), $linkback, 'title_setup');
|
||||
print '<br>';
|
||||
$head = expedition_admin_prepare_head();
|
||||
|
||||
print dol_get_fiche_head($head, 'general', $langs->trans("Sendings"), -1, 'shipment');
|
||||
|
||||
// Miscellaneous parameters
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Feature").'</td>';
|
||||
print '<td width="20"> </td>';
|
||||
print '<td class="center">'.$langs->trans("Status").'</td>';
|
||||
print '</tr>'."\n";
|
||||
|
||||
// expedition activation/desactivation
|
||||
print "<tr>";
|
||||
print '<td>'.$langs->trans("SendingsAbility").'</td>';
|
||||
print '<td>';
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
print '<span class="opacitymedium">'.img_picto($langs->trans("Required"), 'switch_on').'</span>';
|
||||
/*if (empty($conf->global->MAIN_SUBMODULE_EXPEDITION))
|
||||
{
|
||||
print '<a href="confexped.php?action=activate_sending&token='.newToken().'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="confexped.php?action=disable_sending&token='.newToken().'">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
|
||||
}*/
|
||||
print "</td>";
|
||||
print '</tr>';
|
||||
|
||||
// Delivery note activate/deactivate Bon de livraison activation/desactivation
|
||||
print '<tr>';
|
||||
print '<td>';
|
||||
print $langs->trans("DeliveriesOrderAbility");
|
||||
print '<br>'.info_admin($langs->trans("NoNeedForDeliveryReceipts"), 0, 1);
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
|
||||
if (empty($conf->global->MAIN_SUBMODULE_DELIVERY)) {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=activate_delivery&token='.newToken().'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
} else {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=disable_delivery&token='.newToken().'">'.img_picto($langs->trans("Enabled"), 'switch_on').'</a>';
|
||||
}
|
||||
|
||||
print "</td>";
|
||||
print '</tr>';
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
@ -56,6 +56,39 @@ $type = 'delivery';
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||
|
||||
|
||||
// Shipment note
|
||||
if (isModEnabled('expedition') && empty($conf->global->MAIN_SUBMODULE_EXPEDITION)) {
|
||||
// This option should always be set to on when module is on.
|
||||
dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1", 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
/*
|
||||
if ($action == 'activate_sending')
|
||||
{
|
||||
dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1",'chaine',0,'',$conf->entity);
|
||||
header("Location: confexped.php");
|
||||
exit;
|
||||
}
|
||||
if ($action == 'disable_sending')
|
||||
{
|
||||
dolibarr_del_const($db, "MAIN_SUBMODULE_EXPEDITION",$conf->entity);
|
||||
header("Location: confexped.php");
|
||||
exit;
|
||||
}
|
||||
*/
|
||||
|
||||
// Delivery note
|
||||
if ($action == 'activate_delivery') {
|
||||
dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1", 'chaine', 0, '', $conf->entity); // We must also enable this
|
||||
dolibarr_set_const($db, "MAIN_SUBMODULE_DELIVERY", "1", 'chaine', 0, '', $conf->entity);
|
||||
header("Location: delivery.php");
|
||||
exit;
|
||||
} elseif ($action == 'disable_delivery') {
|
||||
dolibarr_del_const($db, "MAIN_SUBMODULE_DELIVERY", $conf->entity);
|
||||
header("Location: delivery.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($action == 'updateMask') {
|
||||
$maskconstdelivery = GETPOST('maskconstdelivery', 'alpha');
|
||||
$maskdelivery = GETPOST('maskdelivery', 'alpha');
|
||||
@ -160,6 +193,7 @@ if ($action == 'setmod') {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
@ -178,275 +212,295 @@ $head = expedition_admin_prepare_head();
|
||||
print dol_get_fiche_head($head, 'receivings', $langs->trans("Receivings"), -1, 'shipment');
|
||||
|
||||
|
||||
// Delivery numbering model
|
||||
|
||||
print load_fiche_titre($langs->trans("DeliveryOrderNumberingModules"), '', '');
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="100">'.$langs->trans("Name").'</td>';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td class="nowrap">'.$langs->trans("Example").'</td>';
|
||||
print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
|
||||
print '<td align="center" width="16">'.$langs->trans("ShortInfo").'</td>';
|
||||
print '</tr>'."\n";
|
||||
|
||||
clearstatcache();
|
||||
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$dir = dol_buildpath($reldir."core/modules/delivery/");
|
||||
|
||||
if (is_dir($dir)) {
|
||||
$handle = opendir($dir);
|
||||
if (is_resource($handle)) {
|
||||
while (($file = readdir($handle)) !== false) {
|
||||
if (preg_match('/^mod_delivery_([a-z0-9_]*)\.php$/', $file)) {
|
||||
$file = substr($file, 0, dol_strlen($file) - 4);
|
||||
|
||||
require_once $dir.$file.'.php';
|
||||
|
||||
$module = new $file;
|
||||
|
||||
if ($module->isEnabled()) {
|
||||
// Show modules according to features level
|
||||
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
|
||||
continue;
|
||||
}
|
||||
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
print '<tr class="oddeven"><td>'.$module->name."</td><td>\n";
|
||||
print $module->info();
|
||||
print '</td>';
|
||||
|
||||
// Show example of numbering module
|
||||
print '<td class="nowrap">';
|
||||
$tmp = $module->getExample();
|
||||
if (preg_match('/^Error/', $tmp)) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') {
|
||||
print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
|
||||
} else {
|
||||
print $tmp;
|
||||
}
|
||||
print '</td>'."\n";
|
||||
|
||||
print '<td class="center">';
|
||||
if ($conf->global->DELIVERY_ADDON_NUMBER == "$file") {
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
} else {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&token='.newToken().'&value='.urlencode($file).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
$delivery = new Delivery($db);
|
||||
$delivery->initAsSpecimen();
|
||||
|
||||
// Info
|
||||
$htmltooltip = '';
|
||||
$htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
|
||||
$nextval = $module->getNextValue($mysoc, $delivery);
|
||||
if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
|
||||
$htmltooltip .= ''.$langs->trans("NextValue").': ';
|
||||
if ($nextval) {
|
||||
if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
|
||||
$nextval = $langs->trans($nextval);
|
||||
}
|
||||
$htmltooltip .= $nextval.'<br>';
|
||||
} else {
|
||||
$htmltooltip .= $langs->trans($module->error).'<br>';
|
||||
}
|
||||
}
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
/*
|
||||
* Documents Models for delivery
|
||||
*/
|
||||
print '<br>';
|
||||
print load_fiche_titre($langs->trans("DeliveryOrderModel"), '', '');
|
||||
|
||||
// Defini tableau def de modele
|
||||
$type = "delivery";
|
||||
$def = array();
|
||||
|
||||
$sql = "SELECT nom";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."document_model";
|
||||
$sql .= " WHERE type = '".$db->escape($type)."'";
|
||||
$sql .= " AND entity = ".$conf->entity;
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$i = 0;
|
||||
$num_rows = $db->num_rows($resql);
|
||||
while ($i < $num_rows) {
|
||||
$array = $db->fetch_array($resql);
|
||||
array_push($def, $array[0]);
|
||||
$i++;
|
||||
}
|
||||
print '<div class="inline-block valignmiddle">'.$langs->trans("DeliveriesOrderAbility").'</div>';
|
||||
if (empty($conf->global->MAIN_SUBMODULE_DELIVERY)) {
|
||||
print ' <a class="inline-block valignmiddle" href="'.$_SERVER["PHP_SELF"].'?action=activate_delivery&token='.newToken().'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
print ' <a class="inline-block valignmiddle" href="'.$_SERVER["PHP_SELF"].'?action=disable_delivery&token='.newToken().'">'.img_picto($langs->trans("Enabled"), 'switch_on').'</a>';
|
||||
}
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="140">'.$langs->trans("Name").'</td>';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
|
||||
print '<td align="center" width="60">'.$langs->trans("Default").'</td>';
|
||||
print '<td align="center" width="32">'.$langs->trans("ShortInfo").'</td>';
|
||||
print '<td align="center" width="32">'.$langs->trans("Preview").'</td>';
|
||||
print "</tr>\n";
|
||||
print '<br><span class="opacitymedium">'.info_admin($langs->trans("NoNeedForDeliveryReceipts"), 0, 1).'</span>';
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
|
||||
clearstatcache();
|
||||
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$dir = dol_buildpath($reldir."core/modules/delivery/doc/");
|
||||
|
||||
if (is_dir($dir)) {
|
||||
$handle = opendir($dir);
|
||||
if (is_resource($handle)) {
|
||||
while (($file = readdir($handle)) !== false) {
|
||||
$filelist[] = $file;
|
||||
}
|
||||
closedir($handle);
|
||||
arsort($filelist);
|
||||
if (!empty($conf->global->MAIN_SUBMODULE_DELIVERY)) {
|
||||
// Delivery numbering model
|
||||
|
||||
foreach ($filelist as $file) {
|
||||
if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
|
||||
if (file_exists($dir.'/'.$file)) {
|
||||
$name = substr($file, 4, dol_strlen($file) - 16);
|
||||
$classname = substr($file, 0, dol_strlen($file) - 12);
|
||||
print load_fiche_titre($langs->trans("DeliveryOrderNumberingModules"), '', '');
|
||||
|
||||
require_once $dir.'/'.$file;
|
||||
$module = new $classname($db);
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="100">'.$langs->trans("Name").'</td>';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td class="nowrap">'.$langs->trans("Example").'</td>';
|
||||
print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
|
||||
print '<td align="center" width="16">'.$langs->trans("ShortInfo").'</td>';
|
||||
print '</tr>'."\n";
|
||||
|
||||
$modulequalified = 1;
|
||||
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
|
||||
$modulequalified = 0;
|
||||
}
|
||||
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
|
||||
$modulequalified = 0;
|
||||
}
|
||||
clearstatcache();
|
||||
|
||||
if ($modulequalified) {
|
||||
print '<tr class="oddeven"><td width="100">';
|
||||
print (empty($module->name) ? $name : $module->name);
|
||||
print "</td><td>\n";
|
||||
if (method_exists($module, 'info')) {
|
||||
print $module->info($langs);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$dir = dol_buildpath($reldir."core/modules/delivery/");
|
||||
|
||||
if (is_dir($dir)) {
|
||||
$handle = opendir($dir);
|
||||
if (is_resource($handle)) {
|
||||
while (($file = readdir($handle)) !== false) {
|
||||
if (preg_match('/^mod_delivery_([a-z0-9_]*)\.php$/', $file)) {
|
||||
$file = substr($file, 0, dol_strlen($file) - 4);
|
||||
|
||||
require_once $dir.$file.'.php';
|
||||
|
||||
$module = new $file;
|
||||
|
||||
if ($module->isEnabled()) {
|
||||
// Show modules according to features level
|
||||
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
|
||||
continue;
|
||||
}
|
||||
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
print '<tr class="oddeven"><td>'.$module->name."</td><td>\n";
|
||||
print $module->info();
|
||||
print '</td>';
|
||||
|
||||
// Show example of numbering module
|
||||
print '<td class="nowrap">';
|
||||
$tmp = $module->getExample();
|
||||
if (preg_match('/^Error/', $tmp)) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') {
|
||||
print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
|
||||
} else {
|
||||
print $module->description;
|
||||
print $tmp;
|
||||
}
|
||||
print '</td>'."\n";
|
||||
|
||||
print '<td class="center">';
|
||||
if ($conf->global->DELIVERY_ADDON_NUMBER == "$file") {
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
} else {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&token='.newToken().'&value='.urlencode($file).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Active
|
||||
if (in_array($name, $def)) {
|
||||
print "<td align=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'">';
|
||||
print img_picto($langs->trans("Enabled"), 'switch_on');
|
||||
print '</a>';
|
||||
print "</td>";
|
||||
} else {
|
||||
print "<td align=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
// Default
|
||||
print "<td align=\"center\">";
|
||||
if ($conf->global->DELIVERY_ADDON_PDF == "$name") {
|
||||
print img_picto($langs->trans("Default"), 'on');
|
||||
} else {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
$delivery = new Delivery($db);
|
||||
$delivery->initAsSpecimen();
|
||||
|
||||
// Info
|
||||
$htmltooltip = ''.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
|
||||
$htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
||||
$htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").'</u>:';
|
||||
$htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
|
||||
$htmltooltip = '';
|
||||
$htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
|
||||
$nextval = $module->getNextValue($mysoc, $delivery);
|
||||
if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
|
||||
$htmltooltip .= ''.$langs->trans("NextValue").': ';
|
||||
if ($nextval) {
|
||||
if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
|
||||
$nextval = $langs->trans($nextval);
|
||||
}
|
||||
$htmltooltip .= $nextval.'<br>';
|
||||
} else {
|
||||
$htmltooltip .= $langs->trans($module->error).'<br>';
|
||||
}
|
||||
}
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print '</td>';
|
||||
|
||||
// Preview
|
||||
print '<td class="center">';
|
||||
if ($module->type == 'pdf') {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||
} else {
|
||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
/*
|
||||
* Documents Models for delivery
|
||||
*/
|
||||
print '<br>';
|
||||
print load_fiche_titre($langs->trans("DeliveryOrderModel"), '', '');
|
||||
|
||||
// Defini tableau def de modele
|
||||
$type = "delivery";
|
||||
$def = array();
|
||||
|
||||
$sql = "SELECT nom";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."document_model";
|
||||
$sql .= " WHERE type = '".$db->escape($type)."'";
|
||||
$sql .= " AND entity = ".$conf->entity;
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$i = 0;
|
||||
$num_rows = $db->num_rows($resql);
|
||||
while ($i < $num_rows) {
|
||||
$array = $db->fetch_array($resql);
|
||||
array_push($def, $array[0]);
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="140">'.$langs->trans("Name").'</td>';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
|
||||
print '<td align="center" width="60">'.$langs->trans("Default").'</td>';
|
||||
print '<td align="center" width="32">'.$langs->trans("ShortInfo").'</td>';
|
||||
print '<td align="center" width="32">'.$langs->trans("Preview").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
clearstatcache();
|
||||
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$dir = dol_buildpath($reldir."core/modules/delivery/doc/");
|
||||
|
||||
if (is_dir($dir)) {
|
||||
$handle = opendir($dir);
|
||||
if (is_resource($handle)) {
|
||||
while (($file = readdir($handle)) !== false) {
|
||||
$filelist[] = $file;
|
||||
}
|
||||
closedir($handle);
|
||||
arsort($filelist);
|
||||
|
||||
foreach ($filelist as $file) {
|
||||
if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
|
||||
if (file_exists($dir.'/'.$file)) {
|
||||
$name = substr($file, 4, dol_strlen($file) - 16);
|
||||
$classname = substr($file, 0, dol_strlen($file) - 12);
|
||||
|
||||
require_once $dir.'/'.$file;
|
||||
$module = new $classname($db);
|
||||
|
||||
$modulequalified = 1;
|
||||
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
|
||||
$modulequalified = 0;
|
||||
}
|
||||
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
|
||||
$modulequalified = 0;
|
||||
}
|
||||
|
||||
if ($modulequalified) {
|
||||
print '<tr class="oddeven"><td width="100">';
|
||||
print (empty($module->name) ? $name : $module->name);
|
||||
print "</td><td>\n";
|
||||
if (method_exists($module, 'info')) {
|
||||
print $module->info($langs);
|
||||
} else {
|
||||
print $module->description;
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Active
|
||||
if (in_array($name, $def)) {
|
||||
print "<td align=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'">';
|
||||
print img_picto($langs->trans("Enabled"), 'switch_on');
|
||||
print '</a>';
|
||||
print "</td>";
|
||||
} else {
|
||||
print "<td align=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
// Default
|
||||
print "<td align=\"center\">";
|
||||
if ($conf->global->DELIVERY_ADDON_PDF == "$name") {
|
||||
print img_picto($langs->trans("Default"), 'on');
|
||||
} else {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Info
|
||||
$htmltooltip = ''.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
|
||||
$htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
||||
$htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").'</u>:';
|
||||
$htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print '</td>';
|
||||
|
||||
// Preview
|
||||
print '<td class="center">';
|
||||
if ($module->type == 'pdf') {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||
} else {
|
||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
// Other Options
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans("OtherOptions"), '', '');
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="set_DELIVERY_FREE_TEXT">';
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Parameter").'</td>';
|
||||
print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
|
||||
print '<td width="80"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2);
|
||||
$substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
|
||||
$htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
|
||||
foreach ($substitutionarray as $key => $val) {
|
||||
$htmltext .= $key.'<br>';
|
||||
}
|
||||
$htmltext .= '</i>';
|
||||
|
||||
print '<tr class="oddeven"><td colspan="2">';
|
||||
print $form->textwithpicto($langs->trans("FreeLegalTextOnDeliveryReceipts"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
|
||||
$variablename = 'DELIVERY_FREE_TEXT';
|
||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
|
||||
} else {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
}
|
||||
print '</td><td class="right">';
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
/*
|
||||
* Autres Options
|
||||
*/
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans("OtherOptions"), '', '');
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Parameter").'</td>';
|
||||
print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
|
||||
print '<td width="80"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2);
|
||||
$substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
|
||||
$htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
|
||||
foreach ($substitutionarray as $key => $val) {
|
||||
$htmltext .= $key.'<br>';
|
||||
}
|
||||
$htmltext .= '</i>';
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="set_DELIVERY_FREE_TEXT">';
|
||||
print '<tr class="oddeven"><td colspan="2">';
|
||||
print $form->textwithpicto($langs->trans("FreeLegalTextOnDeliveryReceipts"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
|
||||
$variablename = 'DELIVERY_FREE_TEXT';
|
||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
|
||||
} else {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
}
|
||||
print '</td><td class="right">';
|
||||
print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
|
||||
print "</td></tr>\n";
|
||||
print '</form>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@ -89,14 +89,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
// Creation of an optional field
|
||||
if ($action == 'create') {
|
||||
print '<br><div id="newattrib"></div>';
|
||||
|
||||
@ -90,14 +90,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
// Creation of an optional field
|
||||
if ($action == 'create') {
|
||||
print '<br><div id="newattrib"></div>';
|
||||
|
||||
@ -89,14 +89,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
// Creation of an optional field
|
||||
if ($action == 'create') {
|
||||
print '<br><div id="newattrib"></div>';
|
||||
|
||||
@ -89,14 +89,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
// Creation of an optional field
|
||||
if ($action == 'create') {
|
||||
print '<br><div id="newattrib"></div>';
|
||||
|
||||
@ -79,14 +79,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Creation of an optional field
|
||||
*/
|
||||
|
||||
@ -82,14 +82,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Creation of an optional field
|
||||
*/
|
||||
|
||||
@ -89,13 +89,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
// Creation of an optional field
|
||||
if ($action == 'create') {
|
||||
print '<br><div id="newattrib"></div>';
|
||||
|
||||
@ -90,14 +90,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
// Creation of an optional field
|
||||
if ($action == 'create') {
|
||||
print '<br><div id="newattrib"></div>';
|
||||
|
||||
@ -83,15 +83,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Creation of an optional field
|
||||
if ($action == 'create') {
|
||||
print '<br><div id="newattrib"></div>';
|
||||
|
||||
@ -83,14 +83,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
// Creation of an optional field
|
||||
if ($action == 'create') {
|
||||
print '<br><div id="newattrib"></div>';
|
||||
|
||||
@ -85,14 +85,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Creation of an optional field
|
||||
*/
|
||||
|
||||
@ -82,14 +82,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Creation of an optional field
|
||||
*/
|
||||
|
||||
@ -86,14 +86,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
// Creation of an optional field
|
||||
if ($action == 'create') {
|
||||
print '<br><div id="newattrib"></div>';
|
||||
|
||||
@ -87,14 +87,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
// Creation of an optional field
|
||||
if ($action == 'create') {
|
||||
print '<br><div id="newattrib"></div>';
|
||||
|
||||
@ -104,7 +104,7 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
if (isModEnabled('propal')) {
|
||||
print load_fiche_titre($langs->trans("Proposal"), '', '');
|
||||
print load_fiche_titre($langs->trans("Proposal"), '', 'proposal');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="more" class="noborder centpercent">';
|
||||
@ -127,7 +127,7 @@ if (isModEnabled('propal')) {
|
||||
|
||||
|
||||
if (isModEnabled('facture')) {
|
||||
print load_fiche_titre($langs->trans("Invoices"), '', '');
|
||||
print load_fiche_titre($langs->trans("Invoices"), '', 'bill');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="more" class="noborder centpercent">';
|
||||
@ -170,6 +170,42 @@ if (isModEnabled('facture')) {
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (isModEnabled('reception')) {
|
||||
print load_fiche_titre($langs->trans("Receptions"), '', 'reception');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="more" class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("RECEPTION_PDF_HIDE_ORDERED");
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('RECEPTION_PDF_HIDE_ORDERED');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("RECEPTION_PDF_HIDE_ORDERED", $arrval, $conf->global->RECEPTION_PDF_HIDE_ORDERED);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT");
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT", $arrval, $conf->global->MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
|
||||
print '<br><div class="center">';
|
||||
print '<input class="button button-save" type="submit" name="save" value="'.$langs->trans("Save").'">';
|
||||
print '</div>';
|
||||
|
||||
@ -92,14 +92,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
// Creation of an optional field
|
||||
if ($action == 'create') {
|
||||
print "<br>";
|
||||
|
||||
@ -85,13 +85,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
// Creation of an optional field
|
||||
if ($action == 'create') {
|
||||
print '<br><div id="newattrib"></div>';
|
||||
|
||||
@ -87,13 +87,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
// Creation of an optional field
|
||||
if ($action == 'create') {
|
||||
print '<br><div id="newattrib"></div>';
|
||||
|
||||
@ -89,13 +89,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
// Creation of an optional field
|
||||
if ($action == 'create') {
|
||||
print '<br><div id="newattrib"></div>';
|
||||
|
||||
@ -87,13 +87,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
// Creation of an optional field
|
||||
if ($action == 'create') {
|
||||
print '<br><div id="newattrib"></div>';
|
||||
|
||||
@ -88,13 +88,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
// Creation of an optional field
|
||||
if ($action == 'create') {
|
||||
print '<br><div id="newattrib"></div>';
|
||||
|
||||
@ -78,12 +78,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
// Creation of an optional field
|
||||
if ($action == 'create') {
|
||||
|
||||
@ -127,7 +127,6 @@ class DolibarrApi
|
||||
|
||||
unset($object->ref_previous);
|
||||
unset($object->ref_next);
|
||||
unset($object->ref_int);
|
||||
unset($object->imgWidth);
|
||||
unset($object->imgHeight);
|
||||
unset($object->barcode_type_code);
|
||||
|
||||
@ -86,14 +86,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Creation of an optional field
|
||||
*/
|
||||
|
||||
@ -86,14 +86,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Creation of an optional field
|
||||
*/
|
||||
|
||||
@ -134,6 +134,8 @@ function bomPrepareHead($object)
|
||||
//); // to remove a tab
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'bom');
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'bom', 'remove');
|
||||
|
||||
return $head;
|
||||
}
|
||||
|
||||
|
||||
@ -80,13 +80,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
// Creation of an optional field
|
||||
if ($action == 'create') {
|
||||
print '<br><div id="newattrib"></div>';
|
||||
|
||||
@ -80,13 +80,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
// Creation of an optional field
|
||||
if ($action == 'create') {
|
||||
print "<br>";
|
||||
|
||||
@ -83,13 +83,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
// Creation of an optional field
|
||||
if ($action == 'create') {
|
||||
print '<br><div id="newattrib"></div>';
|
||||
|
||||
@ -102,12 +102,6 @@ class Commande extends CommonOrder
|
||||
*/
|
||||
public $ref_client;
|
||||
|
||||
/**
|
||||
* @var string Internal ref for order
|
||||
* @deprecated
|
||||
*/
|
||||
public $ref_int;
|
||||
|
||||
/**
|
||||
* @var int Contact ID
|
||||
*/
|
||||
@ -311,7 +305,6 @@ class Commande extends CommonOrder
|
||||
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>20, 'index'=>1),
|
||||
'ref' =>array('type'=>'varchar(30)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'showoncombobox'=>1, 'position'=>25),
|
||||
'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'RefExt', 'enabled'=>1, 'visible'=>0, 'position'=>26),
|
||||
'ref_int' =>array('type'=>'varchar(255)', 'label'=>'RefInt', 'enabled'=>1, 'visible'=>0, 'position'=>27), // deprecated
|
||||
'ref_client' =>array('type'=>'varchar(255)', 'label'=>'RefCustomer', 'enabled'=>1, 'visible'=>-1, 'position'=>28),
|
||||
'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'visible'=>-1, 'notnull'=>1, 'position'=>20),
|
||||
'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>"isModEnabled('project')", 'visible'=>-1, 'position'=>25),
|
||||
@ -945,7 +938,7 @@ class Commande extends CommonOrder
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."commande (";
|
||||
$sql .= " ref, fk_soc, date_creation, fk_user_author, fk_projet, date_commande, source, note_private, note_public, ref_ext, ref_client, ref_int";
|
||||
$sql .= " ref, fk_soc, date_creation, fk_user_author, fk_projet, date_commande, source, note_private, note_public, ref_ext, ref_client";
|
||||
$sql .= ", model_pdf, fk_cond_reglement, deposit_percent, fk_mode_reglement, fk_account, fk_availability, fk_input_reason, date_livraison, fk_delivery_address";
|
||||
$sql .= ", fk_shipping_method";
|
||||
$sql .= ", fk_warehouse";
|
||||
@ -964,7 +957,6 @@ class Commande extends CommonOrder
|
||||
$sql .= ", '".$this->db->escape($this->note_public)."'";
|
||||
$sql .= ", ".($this->ref_ext ? "'".$this->db->escape($this->ref_ext)."'" : "null");
|
||||
$sql .= ", ".($this->ref_client ? "'".$this->db->escape($this->ref_client)."'" : "null");
|
||||
$sql .= ", ".($this->ref_int ? "'".$this->db->escape($this->ref_int)."'" : "null");
|
||||
$sql .= ", '".$this->db->escape($this->model_pdf)."'";
|
||||
$sql .= ", ".($this->cond_reglement_id > 0 ? ((int) $this->cond_reglement_id) : "null");
|
||||
$sql .= ", ".(!empty($this->deposit_percent) ? "'".$this->db->escape($this->deposit_percent)."'" : "null");
|
||||
@ -1827,7 +1819,7 @@ class Commande extends CommonOrder
|
||||
$sql .= ', c.fk_shipping_method';
|
||||
$sql .= ', c.fk_warehouse';
|
||||
$sql .= ', c.fk_projet as fk_project, c.remise_percent, c.remise, c.remise_absolue, c.source, c.facture as billed';
|
||||
$sql .= ', c.note_private, c.note_public, c.ref_client, c.ref_ext, c.ref_int, c.model_pdf, c.last_main_doc, c.fk_delivery_address, c.extraparams';
|
||||
$sql .= ', c.note_private, c.note_public, c.ref_client, c.ref_ext, c.model_pdf, c.last_main_doc, c.fk_delivery_address, c.extraparams';
|
||||
$sql .= ', c.fk_incoterms, c.location_incoterms';
|
||||
$sql .= ", c.fk_multicurrency, c.multicurrency_code, c.multicurrency_tx, c.multicurrency_total_ht, c.multicurrency_total_tva, c.multicurrency_total_ttc";
|
||||
$sql .= ", c.module_source, c.pos_source";
|
||||
@ -1855,9 +1847,6 @@ class Commande extends CommonOrder
|
||||
if ($ref_ext) {
|
||||
$sql .= " AND c.ref_ext='".$this->db->escape($ref_ext)."'";
|
||||
}
|
||||
if ($notused) {
|
||||
$sql .= " AND c.ref_int='".$this->db->escape($notused)."'";
|
||||
}
|
||||
|
||||
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
@ -1871,7 +1860,6 @@ class Commande extends CommonOrder
|
||||
$this->ref_client = $obj->ref_client;
|
||||
$this->ref_customer = $obj->ref_client;
|
||||
$this->ref_ext = $obj->ref_ext;
|
||||
$this->ref_int = $obj->ref_int;
|
||||
|
||||
$this->socid = $obj->fk_soc;
|
||||
$this->thirdparty = null; // Clear if another value was already set by fetch_thirdparty
|
||||
|
||||
@ -81,18 +81,8 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* Creation of an optional field
|
||||
*
|
||||
*/
|
||||
|
||||
if ($action == 'create') {
|
||||
@ -103,9 +93,7 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
* Edition of an optional field
|
||||
*
|
||||
*/
|
||||
if ($action == 'edit' && !empty($attrname)) {
|
||||
$langs->load("members");
|
||||
|
||||
@ -81,19 +81,8 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* Creation of an optional field
|
||||
*
|
||||
*/
|
||||
|
||||
if ($action == 'create') {
|
||||
@ -104,9 +93,7 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
* Edition of an optional field
|
||||
*
|
||||
*/
|
||||
if ($action == 'edit' && !empty($attrname)) {
|
||||
$langs->load("members");
|
||||
|
||||
@ -82,18 +82,8 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* Creation of an optional field
|
||||
*
|
||||
*/
|
||||
|
||||
if ($action == 'create') {
|
||||
@ -104,9 +94,7 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
* Edition of an optional field
|
||||
*
|
||||
*/
|
||||
if ($action == 'edit' && !empty($attrname)) {
|
||||
print "<br>";
|
||||
|
||||
@ -82,18 +82,8 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* Creation of an optional field
|
||||
*
|
||||
*/
|
||||
|
||||
if ($action == 'create') {
|
||||
@ -104,9 +94,7 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
* Edition of an optional field
|
||||
*
|
||||
*/
|
||||
if ($action == 'edit' && !empty($attrname)) {
|
||||
print "<br>";
|
||||
|
||||
@ -147,12 +147,6 @@ class Facture extends CommonInvoice
|
||||
public $ref_client; // deprecated; use ref_customer instead
|
||||
public $ref_customer;
|
||||
|
||||
/**
|
||||
* @var int Ref Int
|
||||
* @deprecated
|
||||
*/
|
||||
public $ref_int; // deprecated
|
||||
|
||||
//Check constants for types
|
||||
public $type = self::TYPE_STANDARD;
|
||||
|
||||
@ -305,7 +299,6 @@ class Facture extends CommonInvoice
|
||||
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>20, 'index'=>1),
|
||||
'ref_client' =>array('type'=>'varchar(255)', 'label'=>'RefCustomer', 'enabled'=>1, 'visible'=>-1, 'position'=>10),
|
||||
'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'Ref ext', 'enabled'=>1, 'visible'=>0, 'position'=>12),
|
||||
//'ref_int' =>array('type'=>'varchar(255)', 'label'=>'Ref int', 'enabled'=>1, 'visible'=>0, 'position'=>30), // deprecated
|
||||
'type' =>array('type'=>'smallint(6)', 'label'=>'Type', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>15),
|
||||
//'increment' =>array('type'=>'varchar(10)', 'label'=>'Increment', 'enabled'=>1, 'visible'=>-1, 'position'=>45),
|
||||
'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>50),
|
||||
@ -664,7 +657,7 @@ class Facture extends CommonInvoice
|
||||
$sql .= ", date_pointoftax";
|
||||
$sql .= ", note_private";
|
||||
$sql .= ", note_public";
|
||||
$sql .= ", ref_client, ref_int";
|
||||
$sql .= ", ref_client";
|
||||
$sql .= ", fk_account";
|
||||
$sql .= ", module_source, pos_source, fk_fac_rec_source, fk_facture_source, fk_user_author, fk_projet";
|
||||
$sql .= ", fk_cond_reglement, fk_mode_reglement, date_lim_reglement, model_pdf";
|
||||
@ -691,7 +684,6 @@ class Facture extends CommonInvoice
|
||||
$sql .= ", ".($this->note_private ? "'".$this->db->escape($this->note_private)."'" : "null");
|
||||
$sql .= ", ".($this->note_public ? "'".$this->db->escape($this->note_public)."'" : "null");
|
||||
$sql .= ", ".($this->ref_client ? "'".$this->db->escape($this->ref_client)."'" : "null");
|
||||
$sql .= ", ".($this->ref_int ? "'".$this->db->escape($this->ref_int)."'" : "null");
|
||||
$sql .= ", ".($this->fk_account > 0 ? $this->fk_account : 'NULL');
|
||||
$sql .= ", ".($this->module_source ? "'".$this->db->escape($this->module_source)."'" : "null");
|
||||
$sql .= ", ".($this->pos_source != '' ? "'".$this->db->escape($this->pos_source)."'" : "null");
|
||||
@ -1926,7 +1918,7 @@ class Facture extends CommonInvoice
|
||||
return -1;
|
||||
}
|
||||
|
||||
$sql = 'SELECT f.rowid,f.entity,f.ref,f.ref_client,f.ref_ext,f.ref_int,f.type,f.fk_soc';
|
||||
$sql = 'SELECT f.rowid, f.entity, f.ref, f.ref_client, f.ref_ext, f.type, f.fk_soc';
|
||||
$sql .= ', f.total_tva, f.localtax1, f.localtax2, f.total_ht, f.total_ttc, f.revenuestamp';
|
||||
$sql .= ', f.remise_percent, f.remise_absolue, f.remise';
|
||||
$sql .= ', f.datef as df, f.date_pointoftax';
|
||||
@ -1961,9 +1953,6 @@ class Facture extends CommonInvoice
|
||||
if ($ref_ext) {
|
||||
$sql .= " AND f.ref_ext='".$this->db->escape($ref_ext)."'";
|
||||
}
|
||||
if ($notused) {
|
||||
$sql .= " AND f.ref_int='".$this->db->escape($notused)."'"; // deprecated
|
||||
}
|
||||
}
|
||||
|
||||
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
||||
|
||||
@ -82,13 +82,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
// Creation of an optional field
|
||||
if ($action == 'create') {
|
||||
print '<br><div name="topofform" id="newattrib"></div>';
|
||||
|
||||
@ -82,13 +82,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
// Creation of an optional field
|
||||
if ($action == 'create') {
|
||||
print '<br><div id="newattrib"></div>';
|
||||
|
||||
@ -3363,6 +3363,8 @@ class ContratLigne extends CommonObjectLine
|
||||
|
||||
// If we change a planned date (start or end), sync dates for all services
|
||||
if (!$error && !empty($conf->global->CONTRACT_SYNC_PLANNED_DATE_OF_SERVICES)) {
|
||||
dol_syslog(get_class($this)."::update CONTRACT_SYNC_PLANNED_DATE_OF_SERVICES is on so we update date for all lines", LOG_DEBUG);
|
||||
|
||||
if ($this->date_ouverture_prevue != $this->oldcopy->date_ouverture_prevue) {
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'contratdet SET';
|
||||
$sql .= " date_ouverture_prevue = ".($this->date_ouverture_prevue != '' ? "'".$this->db->idate($this->date_ouverture_prevue)."'" : "null");
|
||||
|
||||
@ -28,8 +28,11 @@ $maxsizeint = 10;
|
||||
$mesg = array();
|
||||
|
||||
$extrasize = GETPOST('size', 'intcomma');
|
||||
$type = GETPOST('type', 'alpha');
|
||||
$param = GETPOST('param', 'alpha');
|
||||
$type = GETPOST('type', 'alphanohtml');
|
||||
$param = GETPOST('param', 'alphanohtml');
|
||||
$css = GETPOST('css', 'alphanohtml');
|
||||
$cssview = GETPOST('cssview', 'alphanohtml');
|
||||
$csslist = GETPOST('csslist', 'alphanohtml');
|
||||
|
||||
if ($type == 'double' && strpos($extrasize, ',') === false) {
|
||||
$extrasize = '24,8';
|
||||
@ -195,7 +198,8 @@ if ($action == 'add') {
|
||||
GETPOST('langfile', 'alpha'),
|
||||
1,
|
||||
(GETPOST('totalizable', 'alpha') ? 1 : 0),
|
||||
GETPOST('printable', 'alpha')
|
||||
GETPOST('printable', 'alpha'),
|
||||
array('css' => $css, 'cssview' => $cssview, 'csslist' => $csslist)
|
||||
);
|
||||
if ($result > 0) {
|
||||
setEventMessages($langs->trans('SetupSaved'), null, 'mesgs');
|
||||
@ -365,7 +369,8 @@ if ($action == 'update') {
|
||||
GETPOST('langfile'),
|
||||
GETPOST('enabled', 'alpha'),
|
||||
(GETPOST('totalizable', 'alpha') ? 1 : 0),
|
||||
GETPOST('printable', 'alpha')
|
||||
GETPOST('printable', 'alpha'),
|
||||
array('css' => $css, 'cssview' => $cssview, 'csslist' => $csslist)
|
||||
);
|
||||
if ($result > 0) {
|
||||
setEventMessages($langs->trans('SetupSaved'), null, 'mesgs');
|
||||
|
||||
@ -5156,6 +5156,8 @@ class Form
|
||||
$jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");'."\n";
|
||||
}
|
||||
|
||||
$postconfirmas = 'GET';
|
||||
|
||||
$formconfirm .= '
|
||||
resizable: false,
|
||||
height: "'.$height.'",
|
||||
@ -5184,15 +5186,19 @@ class Form
|
||||
options += "&" + inputname + "=" + encodeURIComponent(inputvalue);
|
||||
});
|
||||
}
|
||||
var urljump = pageyes + (pageyes.indexOf("?") < 0 ? "?" : "") + options;
|
||||
if (pageyes.length > 0) {
|
||||
'.$jsforcursor.'
|
||||
var post = $.post(
|
||||
var urljump = pageyes + (pageyes.indexOf("?") < 0 ? "?" : "&") + options;
|
||||
if (pageyes.length > 0) {';
|
||||
if ($postconfirmas == 'GET') {
|
||||
$formconfirm .= 'location.href = urljump;';
|
||||
} else {
|
||||
$formconfirm .= $jsforcursor;
|
||||
$formconfirm .= 'var post = $.post(
|
||||
pageyes,
|
||||
options,
|
||||
function(data) { $("body").html(data); jQuery("html,body,#id-container").removeClass("cursorwait"); }
|
||||
);
|
||||
|
||||
);';
|
||||
}
|
||||
$formconfirm .= '
|
||||
console.log("after post ok");
|
||||
}
|
||||
$(this).dialog("close");
|
||||
@ -5211,15 +5217,20 @@ class Form
|
||||
options += "&" + inputname + "=" + encodeURIComponent(inputvalue);
|
||||
});
|
||||
}
|
||||
var urljump=pageno + (pageno.indexOf("?") < 0 ? "?" : "") + options;
|
||||
var urljump=pageno + (pageno.indexOf("?") < 0 ? "?" : "&") + options;
|
||||
//alert(urljump);
|
||||
if (pageno.length > 0) {
|
||||
'.$jsforcursor.'
|
||||
var post = $.post(
|
||||
if (pageno.length > 0) {';
|
||||
if ($postconfirmas == 'GET') {
|
||||
$formconfirm .= 'location.href = urljump;';
|
||||
} else {
|
||||
$formconfirm .= $jsforcursor;
|
||||
$formconfirm .= 'var post = $.post(
|
||||
pageno,
|
||||
options,
|
||||
function(data) { $("body").html(data); jQuery("html,body,#id-container").removeClass("cursorwait"); }
|
||||
);
|
||||
);';
|
||||
}
|
||||
$formconfirm .= '
|
||||
console.log("after post ko");
|
||||
}
|
||||
$(this).dialog("close");
|
||||
|
||||
@ -1096,7 +1096,7 @@ function fillArrayOfXAxis($object, $tablealias, $labelofobject, &$arrayofxaxis,
|
||||
foreach ($object->fields as $key => $val) {
|
||||
if (empty($val['measure'])) {
|
||||
if (in_array($key, array(
|
||||
'id', 'ref_int', 'ref_ext', 'rowid', 'entity', 'last_main_doc', 'logo', 'logo_squarred', 'extraparams',
|
||||
'id', 'ref_ext', 'rowid', 'entity', 'last_main_doc', 'logo', 'logo_squarred', 'extraparams',
|
||||
'parent', 'photo', 'socialnetworks', 'webservices_url', 'webservices_key'))) {
|
||||
continue;
|
||||
}
|
||||
@ -1217,7 +1217,7 @@ function fillArrayOfGroupBy($object, $tablealias, $labelofobject, &$arrayofgroup
|
||||
foreach ($object->fields as $key => $val) {
|
||||
if (empty($val['isameasure'])) {
|
||||
if (in_array($key, array(
|
||||
'id', 'ref_int', 'ref_ext', 'rowid', 'entity', 'last_main_doc', 'logo', 'logo_squarred', 'extraparams',
|
||||
'id', 'ref_ext', 'rowid', 'entity', 'last_main_doc', 'logo', 'logo_squarred', 'extraparams',
|
||||
'parent', 'photo', 'socialnetworks', 'webservices_url', 'webservices_key'))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -402,7 +402,7 @@ function agenda_prepare_head()
|
||||
$head[$h][1] = $langs->trans("ExtraFields");
|
||||
$nbExtrafields = $extrafields->attributes['actioncomm']['count'];
|
||||
if ($nbExtrafields > 0) {
|
||||
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||
}
|
||||
$head[$h][2] = 'attributes';
|
||||
$h++;
|
||||
|
||||
@ -68,7 +68,7 @@ function assetAdminPrepareHead()
|
||||
$head[$h][1] = $langs->trans("ExtraFieldsAssetModel");
|
||||
$nbExtrafields = $extrafields->attributes['asset_model']['count'];
|
||||
if ($nbExtrafields > 0) {
|
||||
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||
}
|
||||
$head[$h][2] = 'assetmodel_extrafields';
|
||||
$h++;
|
||||
|
||||
@ -103,7 +103,7 @@ function contact_prepare_head(Contact $object)
|
||||
// Entries must be declared in modules descriptor with line
|
||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $tab, 'contact');
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $tab, 'contact', 'add', 'core');
|
||||
|
||||
// Notes
|
||||
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
|
||||
@ -147,6 +147,8 @@ function contact_prepare_head(Contact $object)
|
||||
$head[$tab][2] = 'info';
|
||||
$tab++;*/
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $tab, 'contact', 'add', 'external');
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $tab, 'contact', 'remove');
|
||||
|
||||
return $head;
|
||||
|
||||
@ -55,7 +55,7 @@ function contract_prepare_head(Contrat $object)
|
||||
// Entries must be declared in modules descriptor with line
|
||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'contract');
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'contract', 'add', 'core');
|
||||
|
||||
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
|
||||
$nbNote = 0;
|
||||
@ -96,6 +96,8 @@ function contract_prepare_head(Contrat $object)
|
||||
$head[$h][2] = 'agenda';
|
||||
$h++;
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'contract', 'add', 'external');
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'contract', 'remove');
|
||||
|
||||
return $head;
|
||||
@ -126,13 +128,13 @@ function contract_admin_prepare_head()
|
||||
// Entries must be declared in modules descriptor with line
|
||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
|
||||
complete_head_from_modules($conf, $langs, null, $head, $h, 'contract_admin');
|
||||
complete_head_from_modules($conf, $langs, null, $head, $h, 'contract_admin', 'add', 'core');
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/contrat/admin/contract_extrafields.php';
|
||||
$head[$h][1] = $langs->trans("ExtraFields");
|
||||
$nbExtrafields = $extrafields->attributes['contrat']['count'];
|
||||
if ($nbExtrafields > 0) {
|
||||
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||
}
|
||||
$head[$h][2] = 'attributes';
|
||||
$h++;
|
||||
@ -141,11 +143,13 @@ function contract_admin_prepare_head()
|
||||
$head[$h][1] = $langs->trans("ExtraFieldsLines");
|
||||
$nbExtrafields = $extrafields->attributes['contratdet']['count'];
|
||||
if ($nbExtrafields > 0) {
|
||||
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||
}
|
||||
$head[$h][2] = 'attributeslines';
|
||||
$h++;
|
||||
|
||||
complete_head_from_modules($conf, $langs, null, $head, $h, 'contract_admin', 'add', 'external');
|
||||
|
||||
complete_head_from_modules($conf, $langs, null, $head, $h, 'contract_admin', 'remove');
|
||||
|
||||
return $head;
|
||||
|
||||
@ -51,7 +51,7 @@ function donation_admin_prepare_head()
|
||||
$head[$h][1] = $langs->trans("ExtraFields");
|
||||
$nbExtrafields = $extrafields->attributes['don']['count'];
|
||||
if ($nbExtrafields > 0) {
|
||||
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||
}
|
||||
$head[$h][2] = 'attributes';
|
||||
$h++;
|
||||
@ -83,7 +83,7 @@ function donation_prepare_head($object)
|
||||
// Entries must be declared in modules descriptor with line
|
||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'donation');
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'donation', 'add', 'core');
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
|
||||
@ -118,6 +118,8 @@ function donation_prepare_head($object)
|
||||
$head[$h][2] = 'info';
|
||||
$h++;
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'donation', 'add', 'external');
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'donation', 'remove');
|
||||
|
||||
return $head;
|
||||
|
||||
@ -181,7 +181,7 @@ function ecm_admin_prepare_head()
|
||||
$head[$h][1] = $langs->trans("ExtraFieldsEcmFiles");
|
||||
$nbExtrafields = $extrafields->attributes['ecm_files']['count'];
|
||||
if ($nbExtrafields > 0) {
|
||||
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||
}
|
||||
$head[$h][2] = 'attributes_ecm_files';
|
||||
$h++;
|
||||
@ -190,7 +190,7 @@ function ecm_admin_prepare_head()
|
||||
$head[$h][1] = $langs->trans("ExtraFieldsEcmDirectories");
|
||||
$nbExtrafields = $extrafields->attributes['ecm_directories']['count'];
|
||||
if ($nbExtrafields > 0) {
|
||||
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||
}
|
||||
$head[$h][2] = 'attributes_ecm_directories';
|
||||
$h++;
|
||||
|
||||
@ -79,11 +79,12 @@ function expedition_admin_prepare_head()
|
||||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
/*
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/confexped.php";
|
||||
$head[$h][1] = $langs->trans("Setup");
|
||||
$head[$h][2] = 'general';
|
||||
$h++;
|
||||
|
||||
*/
|
||||
|
||||
if (!empty($conf->global->MAIN_SUBMODULE_EXPEDITION)) {
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/expedition.php";
|
||||
@ -107,12 +108,10 @@ function expedition_admin_prepare_head()
|
||||
$h++;
|
||||
}
|
||||
|
||||
if (!empty($conf->global->MAIN_SUBMODULE_DELIVERY)) {
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/delivery.php";
|
||||
$head[$h][1] = $langs->trans("Receivings");
|
||||
$head[$h][2] = 'receivings';
|
||||
$h++;
|
||||
}
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/delivery.php";
|
||||
$head[$h][1] = $langs->trans("Receivings");
|
||||
$head[$h][2] = 'receivings';
|
||||
$h++;
|
||||
|
||||
if (!empty($conf->global->MAIN_SUBMODULE_DELIVERY)) {
|
||||
$head[$h][0] = DOL_URL_ROOT.'/admin/delivery_extrafields.php';
|
||||
|
||||
@ -43,7 +43,7 @@ function expensereport_prepare_head($object)
|
||||
// Entries must be declared in modules descriptor with line
|
||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'expensereport');
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'expensereport', 'add', 'core');
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
|
||||
@ -80,6 +80,8 @@ function expensereport_prepare_head($object)
|
||||
$head[$h][2] = 'info';
|
||||
$h++;
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'donation', 'add', 'external');
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'expensereport', 'remove');
|
||||
|
||||
return $head;
|
||||
|
||||
@ -61,7 +61,7 @@ function fichinter_prepare_head($object)
|
||||
// Entries must be declared in modules descriptor with line
|
||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'intervention');
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'intervention', 'add', 'core');
|
||||
|
||||
// Tab to link resources
|
||||
if (isModEnabled('resource')) {
|
||||
@ -125,6 +125,8 @@ function fichinter_prepare_head($object)
|
||||
$head[$h][2] = 'info';
|
||||
$h++;
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'intervention', 'add', 'external');
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'intervention', 'remove');
|
||||
|
||||
return $head;
|
||||
|
||||
@ -83,7 +83,7 @@ function facturefourn_prepare_head($object)
|
||||
// Entries must be declared in modules descriptor with line
|
||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'supplier_invoice');
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'supplier_invoice', 'add', 'core');
|
||||
|
||||
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
|
||||
$nbNote = 0;
|
||||
@ -120,6 +120,8 @@ function facturefourn_prepare_head($object)
|
||||
$head[$h][2] = 'info';
|
||||
$h++;
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'supplier_invoice', 'add', 'external');
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'supplier_invoice', 'remove');
|
||||
|
||||
return $head;
|
||||
@ -189,7 +191,7 @@ function ordersupplier_prepare_head(CommandeFournisseur $object)
|
||||
// Entries must be declared in modules descriptor with line
|
||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'supplier_order');
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'supplier_order', 'add', 'core');
|
||||
|
||||
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
|
||||
$nbNote = 0;
|
||||
@ -229,7 +231,11 @@ function ordersupplier_prepare_head(CommandeFournisseur $object)
|
||||
}
|
||||
$head[$h][2] = 'info';
|
||||
$h++;
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'supplier_order', 'add', 'external');
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'supplier_order', 'remove');
|
||||
|
||||
return $head;
|
||||
}
|
||||
|
||||
|
||||
@ -470,6 +470,7 @@ function GETPOSTISARRAY($paramname, $method = 0)
|
||||
* 'alphanohtml'=check there is no html content and no " and no ../
|
||||
* 'aZ'=check it's a-z only
|
||||
* 'aZ09'=check it's simple alpha string (recommended for keys)
|
||||
* 'aZ09comma'=check it's a string for a sortfield or sortorder
|
||||
* 'san_alpha'=Use filter_var with FILTER_SANITIZE_STRING (do not use this for free text string)
|
||||
* 'nohtml'=check there is no html content and no " and no ../
|
||||
* 'restricthtml'=check html content is restricted to some tags only
|
||||
@ -3976,7 +3977,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
'label', 'language', 'line', 'link', 'list', 'list-alt', 'listlight', 'loan', 'lot', 'long-arrow-alt-right',
|
||||
'margin', 'map-marker-alt', 'member', 'meeting', 'money-bill-alt', 'movement', 'mrp', 'note', 'next',
|
||||
'off', 'on', 'order',
|
||||
'paiment', 'paragraph', 'play', 'pdf', 'phone', 'phoning', 'phoning_mobile', 'phoning_fax', 'playdisabled', 'previous', 'poll', 'pos', 'printer', 'product', 'propal', 'puce',
|
||||
'paiment', 'paragraph', 'play', 'pdf', 'phone', 'phoning', 'phoning_mobile', 'phoning_fax', 'playdisabled', 'previous', 'poll', 'pos', 'printer', 'product', 'propal', 'proposal', 'puce',
|
||||
'stock', 'resize', 'service', 'stats', 'trip',
|
||||
'security', 'setup', 'share-alt', 'sign-out', 'split', 'stripe', 'stripe-s', 'switch_off', 'switch_on', 'switch_on_red', 'tools', 'unlink', 'uparrow', 'user', 'user-tie', 'vcard', 'wrench',
|
||||
'github', 'google', 'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp',
|
||||
@ -4028,7 +4029,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
'intervention'=>'ambulance', 'invoice'=>'file-invoice-dollar', 'currency'=>'dollar-sign', 'multicurrency'=>'dollar-sign', 'order'=>'file-invoice',
|
||||
'error'=>'exclamation-triangle', 'warning'=>'exclamation-triangle',
|
||||
'other'=>'square',
|
||||
'playdisabled'=>'play', 'pdf'=>'file-pdf', 'poll'=>'check-double', 'pos'=>'cash-register', 'preview'=>'binoculars', 'project'=>'project-diagram', 'projectpub'=>'project-diagram', 'projecttask'=>'tasks', 'propal'=>'file-signature',
|
||||
'playdisabled'=>'play', 'pdf'=>'file-pdf', 'poll'=>'check-double', 'pos'=>'cash-register', 'preview'=>'binoculars', 'project'=>'project-diagram', 'projectpub'=>'project-diagram', 'projecttask'=>'tasks', 'propal'=>'file-signature', 'proposal'=>'file-signature',
|
||||
'partnership'=>'handshake', 'payment'=>'money-check-alt', 'payment_vat'=>'money-check-alt', 'phoning'=>'phone', 'phoning_mobile'=>'mobile-alt', 'phoning_fax'=>'fax', 'previous'=>'arrow-alt-circle-left', 'printer'=>'print', 'product'=>'cube', 'puce'=>'angle-right',
|
||||
'recent' => 'question', 'reception'=>'dolly', 'recruitmentjobposition'=>'id-card-alt', 'recruitmentcandidature'=>'id-badge',
|
||||
'resize'=>'crop', 'supplier_order'=>'dol-order_supplier', 'supplier_proposal'=>'file-signature',
|
||||
@ -4110,7 +4111,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
'holiday'=>'infobox-holiday', 'info'=>'opacityhigh', 'invoice'=>'infobox-commande',
|
||||
'knowledgemanagement'=>'infobox-contrat rotate90', 'loan'=>'infobox-bank_account',
|
||||
'payment'=>'infobox-bank_account', 'payment_vat'=>'infobox-bank_account', 'poll'=>'infobox-adherent', 'pos'=>'infobox-bank_account', 'project'=>'infobox-project', 'projecttask'=>'infobox-project',
|
||||
'propal'=>'infobox-propal', 'private'=>'infobox-project',
|
||||
'propal'=>'infobox-propal', 'proposal'=>'infobox-propal','private'=>'infobox-project',
|
||||
'reception'=>'flip', 'recruitmentjobposition'=>'infobox-adherent', 'recruitmentcandidature'=>'infobox-adherent',
|
||||
'resource'=>'infobox-action',
|
||||
'salary'=>'infobox-bank_account', 'shipment'=>'infobox-commande', 'supplier_invoice'=>'infobox-order_supplier', 'supplier_invoicea'=>'infobox-order_supplier', 'supplier_invoiced'=>'infobox-order_supplier',
|
||||
@ -9056,7 +9057,7 @@ function getLanguageCodeFromCountryCode($countrycode)
|
||||
* 'ecm' to add a tab for another ecm view
|
||||
* 'stock' to add a tab for warehouse view
|
||||
* @param string $mode 'add' to complete head, 'remove' to remove entries
|
||||
* @param string $filterorigmodule Filter on module origin. 'external' will show only external modules. 'core' only core modules. No filter by default.
|
||||
* @param string $filterorigmodule Filter on module origin: 'external' will show only external modules. 'core' only core modules. No filter (default) will add both.
|
||||
* @return void
|
||||
*/
|
||||
function complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode = 'add', $filterorigmodule = '')
|
||||
@ -10645,7 +10646,7 @@ function getFieldErrorIcon($fieldValidationErrorMsg)
|
||||
* @param string $iconClass class for icon element (Example: 'fa fa-file')
|
||||
* @param string $url the url for link
|
||||
* @param string $id attribute id of button
|
||||
* @param int $status 0 no user rights, 1 active, 2 current action or selected, -1 Feature Disabled, -2 disable Other reason use helpText as tooltip
|
||||
* @param int $status 0 no user rights, 1 active, 2 current action or selected, -1 Feature Disabled, -2 disable Other reason use param $helpText as tooltip help
|
||||
* @param array $params various params for future : recommended rather than adding more function arguments
|
||||
* @return string html button
|
||||
*/
|
||||
|
||||
@ -439,7 +439,7 @@ function dol_print_object_info($object, $usetable = 0)
|
||||
}
|
||||
|
||||
// Date approve
|
||||
if (!empty($object->date_approve)) {
|
||||
if (!empty($object->date_approve) || !empty($object->date_approval)) {
|
||||
if ($usetable) {
|
||||
print '<tr><td class="titlefield">';
|
||||
}
|
||||
@ -449,7 +449,7 @@ function dol_print_object_info($object, $usetable = 0)
|
||||
} else {
|
||||
print ': ';
|
||||
}
|
||||
print dol_print_date($object->date_approve, 'dayhour', 'tzserver');
|
||||
print dol_print_date($object->date_approve ? $object->date_approve : $object->date_approval, 'dayhour', 'tzserver');
|
||||
if ($deltadateforuser) {
|
||||
print ' <span class="opacitymedium">'.$langs->trans("CurrentHour").'</span> / '.dol_print_date($object->date_approve, "dayhour", 'tzuserrel').' <span class="opacitymedium">'.$langs->trans("ClientHour").'</span>';
|
||||
}
|
||||
|
||||
@ -52,17 +52,11 @@ function establishment_prepare_head($object)
|
||||
$head[$h][2] = 'info';
|
||||
$h++;
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'establishment', 'remove');
|
||||
|
||||
|
||||
|
||||
$head[$h][0] = dol_buildpath("/hrm/admin/setup.php", 1);
|
||||
$head[$h][1] = $langs->trans("Settings");
|
||||
$head[$h][2] = 'settings';
|
||||
$h++;
|
||||
|
||||
complete_head_from_modules($conf, $langs, null, $head, $h, 'hrm');
|
||||
|
||||
$head[$h][0] = dol_buildpath("/hrm/admin/about.php", 1);
|
||||
$head[$h][1] = $langs->trans("About");
|
||||
$head[$h][2] = 'about';
|
||||
@ -70,6 +64,9 @@ function establishment_prepare_head($object)
|
||||
|
||||
complete_head_from_modules($conf, $langs, null, $head, $h, 'hrm');
|
||||
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'establishment', 'remove');
|
||||
|
||||
return $head;
|
||||
}
|
||||
|
||||
|
||||
@ -84,7 +84,7 @@ function facture_prepare_head($object)
|
||||
// Entries must be declared in modules descriptor with line
|
||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'invoice');
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'invoice', 'add', 'core');
|
||||
|
||||
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
|
||||
$nbNote = 0;
|
||||
@ -121,6 +121,8 @@ function facture_prepare_head($object)
|
||||
$head[$h][2] = 'info';
|
||||
$h++;
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'invoice', 'add', 'external');
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'invoice', 'remove');
|
||||
|
||||
return $head;
|
||||
|
||||
@ -51,7 +51,7 @@ function loan_prepare_head($object)
|
||||
// Entries must be declared in modules descriptor with line
|
||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $tab, 'loan');
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $tab, 'loan', 'add', 'core');
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
|
||||
@ -82,6 +82,8 @@ function loan_prepare_head($object)
|
||||
$head[$tab][2] = 'info';
|
||||
$tab++;
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $tab, 'loan', 'add', 'external');
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $tab, 'loan', 'remove');
|
||||
|
||||
return $head;
|
||||
|
||||
@ -80,7 +80,7 @@ function member_prepare_head(Adherent $object)
|
||||
// Entries must be declared in modules descriptor with line
|
||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'member');
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'member', 'add', 'core');
|
||||
|
||||
$nbNote = 0;
|
||||
if (!empty($object->note_private)) {
|
||||
@ -123,6 +123,8 @@ function member_prepare_head(Adherent $object)
|
||||
$h++;
|
||||
}
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'member', 'add', 'external');
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'member', 'remove');
|
||||
|
||||
return $head;
|
||||
|
||||
@ -96,7 +96,7 @@ function commande_prepare_head(Commande $object)
|
||||
// Entries must be declared in modules descriptor with line
|
||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'order');
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'order', 'add', 'core');
|
||||
|
||||
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
|
||||
$nbNote = 0;
|
||||
@ -133,6 +133,8 @@ function commande_prepare_head(Commande $object)
|
||||
$head[$h][2] = 'info';
|
||||
$h++;
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'order', 'add', 'external');
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'order', 'remove');
|
||||
|
||||
return $head;
|
||||
|
||||
@ -153,7 +153,7 @@ function product_prepare_head($object)
|
||||
// Entries must be declared in modules descriptor with line
|
||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'product');
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'product', 'add', 'core');
|
||||
|
||||
// Notes
|
||||
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
|
||||
@ -201,8 +201,6 @@ function product_prepare_head($object)
|
||||
$head[$h][2] = 'documents';
|
||||
$h++;
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'product', 'remove');
|
||||
|
||||
// Log
|
||||
$head[$h][0] = DOL_URL_ROOT.'/product/agenda.php?id='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Events");
|
||||
@ -213,6 +211,10 @@ function product_prepare_head($object)
|
||||
$head[$h][2] = 'agenda';
|
||||
$h++;
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'product', 'add', 'external');
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'product', 'remove');
|
||||
|
||||
return $head;
|
||||
}
|
||||
|
||||
@ -312,7 +314,7 @@ function product_admin_prepare_head()
|
||||
$head[$h][1] = $langs->trans("ExtraFields");
|
||||
$nbExtrafields = $extrafields->attributes['product']['count'];
|
||||
if ($nbExtrafields > 0) {
|
||||
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||
}
|
||||
$head[$h][2] = 'attributes';
|
||||
$h++;
|
||||
@ -321,7 +323,7 @@ function product_admin_prepare_head()
|
||||
$head[$h][1] = $langs->trans("ProductSupplierExtraFields");
|
||||
$nbExtrafields = $extrafields->attributes['product_fournisseur_price']['count'];
|
||||
if ($nbExtrafields > 0) {
|
||||
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||
}
|
||||
$head[$h][2] = 'supplierAttributes';
|
||||
$h++;
|
||||
|
||||
@ -244,7 +244,7 @@ function project_prepare_head(Project $project, $moreparam = '')
|
||||
// Entries must be declared in modules descriptor with line
|
||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||
complete_head_from_modules($conf, $langs, $project, $head, $h, 'project');
|
||||
complete_head_from_modules($conf, $langs, $project, $head, $h, 'project', 'add', 'core');
|
||||
|
||||
|
||||
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
|
||||
@ -320,6 +320,8 @@ function project_prepare_head(Project $project, $moreparam = '')
|
||||
$head[$h][2] = 'agenda';
|
||||
$h++;
|
||||
|
||||
complete_head_from_modules($conf, $langs, $project, $head, $h, 'project', 'add', 'external');
|
||||
|
||||
complete_head_from_modules($conf, $langs, $project, $head, $h, 'project', 'remove');
|
||||
|
||||
return $head;
|
||||
@ -381,7 +383,7 @@ function task_prepare_head($object)
|
||||
// Entries must be declared in modules descriptor with line
|
||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'task');
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'task', 'add', 'core');
|
||||
|
||||
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
|
||||
$nbNote = 0;
|
||||
@ -425,6 +427,8 @@ function task_prepare_head($object)
|
||||
$h++;
|
||||
}
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'task', 'add', 'external');
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'task', 'remove');
|
||||
|
||||
return $head;
|
||||
@ -507,7 +511,7 @@ function project_admin_prepare_head()
|
||||
$head[$h][1] = $langs->trans("ExtraFieldsProject");
|
||||
$nbExtrafields = $extrafields->attributes['projet']['count'];
|
||||
if ($nbExtrafields > 0) {
|
||||
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||
}
|
||||
$head[$h][2] = 'attributes';
|
||||
$h++;
|
||||
@ -516,7 +520,7 @@ function project_admin_prepare_head()
|
||||
$head[$h][1] = $langs->trans("ExtraFieldsProjectTask");
|
||||
$nbExtrafields = $extrafields->attributes['projet_task']['count'];
|
||||
if ($nbExtrafields > 0) {
|
||||
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||
}
|
||||
$head[$h][2] = 'attributes_task';
|
||||
$h++;
|
||||
|
||||
@ -73,7 +73,7 @@ function propal_prepare_head($object)
|
||||
// Entries must be declared in modules descriptor with line
|
||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'propal');
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'propal', 'add', 'core');
|
||||
|
||||
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
|
||||
$nbNote = 0;
|
||||
@ -110,6 +110,8 @@ function propal_prepare_head($object)
|
||||
$head[$h][2] = 'info';
|
||||
$h++;
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'propal', 'add', 'external');
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'propal', 'remove');
|
||||
|
||||
return $head;
|
||||
@ -146,7 +148,7 @@ function propal_admin_prepare_head()
|
||||
$head[$h][1] = $langs->trans("ExtraFields");
|
||||
$nbExtrafields = $extrafields->attributes['propal']['count'];
|
||||
if ($nbExtrafields > 0) {
|
||||
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||
}
|
||||
$head[$h][2] = 'attributes';
|
||||
$h++;
|
||||
@ -155,7 +157,7 @@ function propal_admin_prepare_head()
|
||||
$head[$h][1] = $langs->trans("ExtraFieldsLines");
|
||||
$nbExtrafields = $extrafields->attributes['propaldet']['count'];
|
||||
if ($nbExtrafields > 0) {
|
||||
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||
}
|
||||
$head[$h][2] = 'attributeslines';
|
||||
$h++;
|
||||
|
||||
@ -66,7 +66,7 @@ function reception_prepare_head(Reception $object)
|
||||
// Entries must be declared in modules descriptor with line
|
||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'reception');
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'reception', 'add', 'core');
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
|
||||
@ -96,6 +96,8 @@ function reception_prepare_head(Reception $object)
|
||||
$head[$h][2] = 'note';
|
||||
$h++;
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'reception', 'add', 'external');
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'reception', 'remove');
|
||||
|
||||
return $head;
|
||||
|
||||
@ -55,7 +55,7 @@ function resource_prepare_head($object)
|
||||
// Entries must be declared in modules descriptor with line
|
||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'resource');
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'resource', 'add', 'core');
|
||||
|
||||
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
|
||||
$nbNote = 0;
|
||||
@ -99,6 +99,8 @@ function resource_prepare_head($object)
|
||||
$head[$h][2] = 'info';
|
||||
$h++;*/
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'resource', 'add', 'external');
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'resource', 'remove');
|
||||
|
||||
return $head;
|
||||
|
||||
@ -42,7 +42,7 @@ function salaries_prepare_head($object)
|
||||
// Entries must be declared in modules descriptor with line
|
||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'salaries');
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'salaries', 'add', 'core');
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
|
||||
@ -62,6 +62,8 @@ function salaries_prepare_head($object)
|
||||
$head[$h][2] = 'info';
|
||||
$h++;
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'salaries', 'add', 'external');
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'salaries', 'remove');
|
||||
|
||||
return $head;
|
||||
|
||||
@ -69,13 +69,15 @@ function stock_prepare_head($object)
|
||||
// Entries must be declared in modules descriptor with line
|
||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'stock');
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'stock', 'add', 'core');
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/product/stock/info.php?id='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Info");
|
||||
$head[$h][2] = 'info';
|
||||
$h++;
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'stock', 'add', 'external');
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'stock', 'remove');
|
||||
|
||||
return $head;
|
||||
@ -113,7 +115,7 @@ function stock_admin_prepare_head()
|
||||
$head[$h][1] = $langs->trans("ExtraFields");
|
||||
$nbExtrafields = $extrafields->attributes['entrepot']['count'];
|
||||
if ($nbExtrafields > 0) {
|
||||
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||
}
|
||||
$head[$h][2] = 'attributes';
|
||||
$h++;
|
||||
@ -122,7 +124,7 @@ function stock_admin_prepare_head()
|
||||
$head[$h][1] = $langs->trans("StockMouvementExtraFields");
|
||||
$nbExtrafields = $extrafields->attributes['stock_mouvement']['count'];
|
||||
if ($nbExtrafields > 0) {
|
||||
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||
}
|
||||
$head[$h][2] = 'stockMouvementAttributes';
|
||||
$h++;
|
||||
@ -131,7 +133,7 @@ function stock_admin_prepare_head()
|
||||
$head[$h][1] = $langs->trans("InventoryExtraFields");
|
||||
$nbExtrafields = $extrafields->attributes['inventory']['count'];
|
||||
if ($nbExtrafields > 0) {
|
||||
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||
}
|
||||
$head[$h][2] = 'inventoryAttributes';
|
||||
$h++;
|
||||
|
||||
@ -59,7 +59,7 @@ function supplier_proposal_prepare_head($object)
|
||||
// Entries must be declared in modules descriptor with line
|
||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'supplier_proposal');
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'supplier_proposal', 'add', 'core');
|
||||
|
||||
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
|
||||
$nbNote = 0;
|
||||
@ -96,6 +96,8 @@ function supplier_proposal_prepare_head($object)
|
||||
$head[$h][2] = 'info';
|
||||
$h++;
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'supplier_proposal', 'add', 'external');
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'supplier_proposal', 'remove');
|
||||
|
||||
return $head;
|
||||
|
||||
@ -49,7 +49,7 @@ function ticketAdminPrepareHead()
|
||||
$head[$h][1] = $langs->trans("ExtraFieldsTicket");
|
||||
$nbExtrafields = $extrafields->attributes['ticket']['count'];
|
||||
if ($nbExtrafields > 0) {
|
||||
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||
}
|
||||
$head[$h][2] = 'attributes';
|
||||
$h++;
|
||||
@ -102,7 +102,7 @@ function ticket_prepare_head($object)
|
||||
$h++;
|
||||
}
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'ticket');
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'ticket', 'add', 'core');
|
||||
|
||||
// Attached files
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
@ -140,6 +140,9 @@ function ticket_prepare_head($object)
|
||||
$head[$h][2] = 'tabTicketLogs';
|
||||
$h++;
|
||||
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'ticket', 'add', 'external');
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'ticket', 'remove');
|
||||
|
||||
return $head;
|
||||
|
||||
@ -274,7 +274,7 @@ function user_admin_prepare_head()
|
||||
$head[$h][1] = $langs->trans("ExtraFields")." (".$langs->trans("Users").")";
|
||||
$nbExtrafields = $extrafields->attributes['user']['count'];
|
||||
if ($nbExtrafields > 0) {
|
||||
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||
}
|
||||
$head[$h][2] = 'attributes';
|
||||
$h++;
|
||||
@ -283,7 +283,7 @@ function user_admin_prepare_head()
|
||||
$head[$h][1] = $langs->trans("ExtraFields")." (".$langs->trans("Groups").")";
|
||||
$nbExtrafields = $extrafields->attributes['usergroup']['count'];
|
||||
if ($nbExtrafields > 0) {
|
||||
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||
}
|
||||
$head[$h][2] = 'attributes_group';
|
||||
$h++;
|
||||
|
||||
@ -70,7 +70,7 @@ class modExpedition extends DolibarrModules
|
||||
);
|
||||
|
||||
// Config pages
|
||||
$this->config_page_url = array("confexped.php");
|
||||
$this->config_page_url = array("expedition.php");
|
||||
|
||||
// Dependencies
|
||||
$this->depends = array("modCommande");
|
||||
|
||||
@ -238,7 +238,6 @@ class modFacture extends DolibarrModules
|
||||
$this->import_fields_array[$r] = array(
|
||||
'f.ref' => 'InvoiceRef*',
|
||||
'f.ref_ext' => 'ExternalRef',
|
||||
'f.ref_int' => 'ExternalRef',
|
||||
'f.ref_client' => 'CutomerRef',
|
||||
'f.type' => 'Type*',
|
||||
'f.fk_soc' => 'Customer*',
|
||||
@ -292,7 +291,6 @@ class modFacture extends DolibarrModules
|
||||
$import_sample = array(
|
||||
'f.ref' => '(PROV0001)',
|
||||
'f.ref_ext' => '',
|
||||
'f.ref_int' => '',
|
||||
'f.ref_client' => '',
|
||||
'f.type' => '0',
|
||||
'f.fk_soc' => '80LIMIT',
|
||||
|
||||
@ -353,6 +353,8 @@ class pdf_squille extends ModelePdfReception
|
||||
$nexY = $tab_top + 7;
|
||||
$fk_commandefourndet = 0;
|
||||
$totalOrdered = 0;
|
||||
$totalAmount = 0;
|
||||
|
||||
// Loop on each lines
|
||||
for ($i = 0; $i < $nblines; $i++) {
|
||||
$curY = $nexY;
|
||||
@ -479,19 +481,21 @@ class pdf_squille extends ModelePdfReception
|
||||
|
||||
$pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut
|
||||
|
||||
// Description
|
||||
$pdf->SetXY($this->posxweightvol, $curY);
|
||||
$weighttxt = '';
|
||||
if ($object->lines[$i]->fk_product_type == 0 && $object->lines[$i]->product->weight) {
|
||||
$weighttxt = round($object->lines[$i]->product->weight * $object->lines[$i]->qty, 5).' '.measuringUnitString(0, "weight", $object->lines[$i]->product->weight_units);
|
||||
$weighttxt = round($object->lines[$i]->product->weight * $object->lines[$i]->qty, 5).' '.measuringUnitString(0, "weight", $object->lines[$i]->product->weight_units, 1);
|
||||
}
|
||||
$voltxt = '';
|
||||
if ($object->lines[$i]->fk_product_type == 0 && $object->lines[$i]->product->volume) {
|
||||
$voltxt = round($object->lines[$i]->product->volume * $object->lines[$i]->qty, 5).' '.measuringUnitString(0, "volume", $object->lines[$i]->product->volume_units ? $object->lines[$i]->product->volume_units : 0);
|
||||
$voltxt = round($object->lines[$i]->product->volume * $object->lines[$i]->qty, 5).' '.measuringUnitString(0, "volume", $object->lines[$i]->product->volume_units ? $object->lines[$i]->product->volume_units : 0, 1);
|
||||
}
|
||||
|
||||
$pdf->writeHTMLCell($this->posxqtyordered - $this->posxweightvol + 2, 3, $this->posxweightvol - 1, $curY, $weighttxt.(($weighttxt && $voltxt) ? '<br>' : '').$voltxt, 0, 0, false, true, 'C');
|
||||
//$pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), 3, $weighttxt.(($weighttxt && $voltxt)?'<br>':'').$voltxt,'','C');
|
||||
|
||||
// Qty ordered
|
||||
if (empty($conf->global->RECEPTION_PDF_HIDE_ORDERED)) {
|
||||
$pdf->SetXY($this->posxqtyordered, $curY);
|
||||
if ($object->lines[$i]->fk_commandefourndet != $fk_commandefourndet) {
|
||||
@ -501,15 +505,20 @@ class pdf_squille extends ModelePdfReception
|
||||
$fk_commandefourndet = $object->lines[$i]->fk_commandefourndet;
|
||||
}
|
||||
|
||||
// Qty received
|
||||
$pdf->SetXY($this->posxqtytoship, $curY);
|
||||
$pdf->MultiCell(($this->posxpuht - $this->posxqtytoship), 3, $object->lines[$i]->qty, '', 'C');
|
||||
|
||||
// Amount
|
||||
if (!empty($conf->global->MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT)) {
|
||||
$pdf->SetXY($this->posxpuht, $curY);
|
||||
$pdf->MultiCell(($this->posxtotalht - $this->posxpuht - 1), 3, price($object->lines[$i]->subprice, 0, $outputlangs), '', 'R');
|
||||
|
||||
$amountreceived = price2num($object->lines[$i]->subprice * $object->lines[$i]->qty, 'MT');
|
||||
$pdf->SetXY($this->posxtotalht, $curY);
|
||||
$pdf->MultiCell(($this->page_largeur - $this->marge_droite - $this->posxtotalht), 3, price($object->lines[$i]->total_ht, 0, $outputlangs), '', 'R');
|
||||
$pdf->MultiCell(($this->page_largeur - $this->marge_droite - $this->posxtotalht), 3, price($amountreceived, 0, $outputlangs), '', 'R');
|
||||
|
||||
$totalAmount += $amountreceived;
|
||||
}
|
||||
|
||||
$nexY += 3;
|
||||
@ -568,7 +577,7 @@ class pdf_squille extends ModelePdfReception
|
||||
}
|
||||
|
||||
// Affiche zone totaux
|
||||
$posy = $this->_tableau_tot($pdf, $object, 0, $bottomlasttab, $outputlangs, $totalOrdered);
|
||||
$posy = $this->_tableau_tot($pdf, $object, 0, $bottomlasttab, $outputlangs, $totalOrdered, $totalAmount);
|
||||
|
||||
// Pied de page
|
||||
$this->_pagefoot($pdf, $object, $outputlangs);
|
||||
@ -616,9 +625,10 @@ class pdf_squille extends ModelePdfReception
|
||||
* @param int $posy Position depart
|
||||
* @param Translate $outputlangs Objet langs
|
||||
* @param int $totalOrdered Total ordered
|
||||
* @param int $totalAmount Total amount
|
||||
* @return int Position pour suite
|
||||
*/
|
||||
protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs, $totalOrdered)
|
||||
protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs, $totalOrdered, $totalAmount = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $mysoc;
|
||||
@ -664,57 +674,62 @@ class pdf_squille extends ModelePdfReception
|
||||
}
|
||||
|
||||
if ($totalWeight != '') {
|
||||
$totalWeighttoshow = showDimensionInBestUnit($totalWeight, 0, "weight", $outputlangs);
|
||||
$totalWeighttoshow = showDimensionInBestUnit($totalWeight, 0, "weight", $outputlangs, -1, 'no', 1);
|
||||
}
|
||||
if ($totalVolume != '') {
|
||||
$totalVolumetoshow = showDimensionInBestUnit($totalVolume, 0, "volume", $outputlangs);
|
||||
$totalVolumetoshow = showDimensionInBestUnit($totalVolume, 0, "volume", $outputlangs, -1, 'no', 1);
|
||||
}
|
||||
if ($object->trueWeight) {
|
||||
$totalWeighttoshow = showDimensionInBestUnit($object->trueWeight, $object->weight_units, "weight", $outputlangs);
|
||||
$totalWeighttoshow = showDimensionInBestUnit($object->trueWeight, $object->weight_units, "weight", $outputlangs, -1, 'no', 1);
|
||||
}
|
||||
if ($object->trueVolume) {
|
||||
$totalVolumetoshow = showDimensionInBestUnit($object->trueVolume, $object->volume_units, "volume", $outputlangs);
|
||||
$totalVolumetoshow = showDimensionInBestUnit($object->trueVolume, $object->volume_units, "volume", $outputlangs, -1, 'no', 1);
|
||||
}
|
||||
|
||||
$pdf->SetFillColor(255, 255, 255);
|
||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("Total"), 0, 'L', 1);
|
||||
|
||||
$index2 = 0;
|
||||
|
||||
// Total Weight
|
||||
if ($totalWeighttoshow) {
|
||||
$pdf->SetXY($this->posxweightvol, $tab2_top + $tab2_hl * ($index + $index2));
|
||||
$pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), $tab2_hl, $totalWeighttoshow, 0, 'C', 1);
|
||||
$index2++;
|
||||
}
|
||||
if ($totalVolumetoshow) {
|
||||
$pdf->SetXY($this->posxweightvol, $tab2_top + $tab2_hl * ($index + $index2));
|
||||
$pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), $tab2_hl, $totalVolumetoshow, 0, 'C', 1);
|
||||
$index2++;
|
||||
}
|
||||
|
||||
// Total qty ordered
|
||||
if (empty($conf->global->RECEPTION_PDF_HIDE_ORDERED)) {
|
||||
$pdf->SetXY($this->posxqtyordered, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($this->posxqtytoship - $this->posxqtyordered, $tab2_hl, $totalOrdered, 0, 'C', 1);
|
||||
}
|
||||
|
||||
// Total received
|
||||
$pdf->SetXY($this->posxqtytoship, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($this->posxpuht - $this->posxqtytoship, $tab2_hl, $totalToShip, 0, 'C', 1);
|
||||
|
||||
// Amount
|
||||
if (!empty($conf->global->MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT)) {
|
||||
$pdf->SetXY($this->posxpuht, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($this->posxtotalht - $this->posxpuht, $tab2_hl, '', 0, 'C', 1);
|
||||
|
||||
$pdf->SetXY($this->posxtotalht, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxtotalht, $tab2_hl, price($object->total_ht, 0, $outputlangs), 0, 'C', 1);
|
||||
}
|
||||
|
||||
// Total Weight
|
||||
if ($totalWeighttoshow) {
|
||||
$pdf->SetXY($this->posxweightvol, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), $tab2_hl, $totalWeighttoshow, 0, 'C', 1);
|
||||
|
||||
$index++;
|
||||
}
|
||||
if ($totalVolumetoshow) {
|
||||
$pdf->SetXY($this->posxweightvol, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), $tab2_hl, $totalVolumetoshow, 0, 'C', 1);
|
||||
|
||||
$index++;
|
||||
}
|
||||
if (!$totalWeighttoshow && !$totalVolumetoshow) {
|
||||
$index++;
|
||||
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxtotalht, $tab2_hl, price($totalAmount, 0, $outputlangs), 0, 'C', 1);
|
||||
}
|
||||
|
||||
$pdf->SetTextColor(0, 0, 0);
|
||||
|
||||
$index++;
|
||||
if ($index2) {
|
||||
$index++;
|
||||
}
|
||||
|
||||
return ($tab2_top + ($tab2_hl * $index));
|
||||
}
|
||||
|
||||
@ -754,6 +769,7 @@ class pdf_squille extends ModelePdfReception
|
||||
$pdf->SetDrawColor(128, 128, 128);
|
||||
$pdf->SetFont('', '', $default_font_size - 1);
|
||||
|
||||
// Description
|
||||
if (empty($hidetop)) {
|
||||
$pdf->line($this->marge_gauche, $tab_top + 5, $this->page_largeur - $this->marge_droite, $tab_top + 5);
|
||||
|
||||
@ -761,12 +777,14 @@ class pdf_squille extends ModelePdfReception
|
||||
$pdf->MultiCell($this->posxqtyordered - $this->posxdesc, 2, $outputlangs->transnoentities("Description"), '', 'L');
|
||||
}
|
||||
|
||||
// Volume / Weight
|
||||
$pdf->line($this->posxweightvol - 1, $tab_top, $this->posxweightvol - 1, $tab_top + $tab_height);
|
||||
if (empty($hidetop)) {
|
||||
$pdf->SetXY($this->posxweightvol - 1, $tab_top + 1);
|
||||
$pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), 2, $outputlangs->transnoentities("WeightVolShort"), '', 'C');
|
||||
}
|
||||
|
||||
// Qty ordered
|
||||
if (empty($conf->global->RECEPTION_PDF_HIDE_ORDERED)) {
|
||||
$pdf->line($this->posxqtyordered - 1, $tab_top, $this->posxqtyordered - 1, $tab_top + $tab_height);
|
||||
if (empty($hidetop)) {
|
||||
@ -775,6 +793,7 @@ class pdf_squille extends ModelePdfReception
|
||||
}
|
||||
}
|
||||
|
||||
// Qty reception
|
||||
$pdf->line($this->posxqtytoship - 1, $tab_top, $this->posxqtytoship - 1, $tab_top + $tab_height);
|
||||
if (empty($hidetop)) {
|
||||
$pdf->SetXY($this->posxqtytoship, $tab_top + 1);
|
||||
@ -792,6 +811,7 @@ class pdf_squille extends ModelePdfReception
|
||||
}
|
||||
}
|
||||
|
||||
// Amount
|
||||
if (!empty($conf->global->MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT)) {
|
||||
$pdf->line($this->posxpuht - 1, $tab_top, $this->posxpuht - 1, $tab_top + $tab_height);
|
||||
if (empty($hidetop)) {
|
||||
|
||||
@ -134,6 +134,12 @@ $listofexamplesforlink = 'Societe:societe/class/societe.class.php<br>Contact:con
|
||||
jQuery("#computed_value").keyup(function() {
|
||||
init_typeoffields(jQuery('#type').val());
|
||||
});
|
||||
|
||||
/* Autofill the code with label */
|
||||
jQuery("#label").keyup(function() {
|
||||
console.log("Update new field");
|
||||
$("#attrname").val( $(this).val().replace(/[^a-zA-Z0-9_]/g, '').toLowerCase() );
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@ -145,7 +151,7 @@ $listofexamplesforlink = 'Societe:societe/class/societe.class.php<br>Contact:con
|
||||
|
||||
<table summary="listofattributes" class="border centpercent">
|
||||
<!-- Label -->
|
||||
<tr><td class="titlefieldcreate fieldrequired"><?php echo $langs->trans("LabelOrTranslationKey"); ?></td><td class="valeur"><input type="text" name="label" class="width200" value="<?php echo GETPOST('label', 'alpha'); ?>" autofocus></td></tr>
|
||||
<tr><td class="titlefieldcreate fieldrequired"><?php echo $langs->trans("LabelOrTranslationKey"); ?></td><td class="valeur"><input type="text" name="label" id="label" class="width200" value="<?php echo GETPOST('label', 'alpha'); ?>" autofocus></td></tr>
|
||||
<!-- Code -->
|
||||
<tr><td class="fieldrequired"><?php echo $langs->trans("AttributeCode"); ?></td><td class="valeur"><input type="text" name="attrname" id="attrname" size="10" value="<?php echo GETPOST('attrname', 'alpha'); ?>" pattern="\w+"> <span class="opacitymedium">(<?php echo $langs->trans("AlphaNumOnlyLowerCharsAndNoSpace"); ?>)</span></td></tr>
|
||||
<!-- Type -->
|
||||
@ -192,9 +198,9 @@ $listofexamplesforlink = 'Societe:societe/class/societe.class.php<br>Contact:con
|
||||
<!-- Unique -->
|
||||
<tr class="extra_unique"><td><?php echo $langs->trans("Unique"); ?></td><td class="valeur"><input id="unique" type="checkbox" name="unique"<?php echo (GETPOST('unique', 'alpha') ? ' checked' : ''); ?>></td></tr>
|
||||
<!-- Required -->
|
||||
<tr class="extra_required"><td><?php echo $langs->trans("Required"); ?></td><td class="valeur"><input id="required" type="checkbox" name="required"<?php echo (GETPOST('required', 'alpha') ? ' checked' : ''); ?>></td></tr>
|
||||
<tr class="extra_required"><td><?php echo $langs->trans("Mandatory"); ?></td><td class="valeur"><input id="required" type="checkbox" name="required"<?php echo (GETPOST('required', 'alpha') ? ' checked' : ''); ?>></td></tr>
|
||||
<!-- Always editable -->
|
||||
<tr class="extra_alwayseditable"><td><?php echo $langs->trans("AlwaysEditable"); ?></td><td class="valeur"><input id="alwayseditable" type="checkbox" name="alwayseditable"<?php echo ((GETPOST('alwayseditable', 'alpha') || !GETPOST('button', 'alpha')) ? ' checked' : ''); ?>></td></tr>
|
||||
<tr class="extra_alwayseditable"><td><?php echo $form->textwithpicto($langs->trans("AlwaysEditable"), $langs->trans("EditableWhenDraftOnly")); ?></td><td class="valeur"><input id="alwayseditable" type="checkbox" name="alwayseditable"<?php echo ((GETPOST('alwayseditable', 'alpha') || !GETPOST('button', 'alpha')) ? ' checked' : ''); ?>></td></tr>
|
||||
<!-- Visibility -->
|
||||
<tr><td class="extra_list"><?php echo $form->textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc")); ?>
|
||||
</td><td class="valeur"><input id="list" class="minwidth100" type="text" name="list" value="<?php echo GETPOST('list', 'int') != '' ? GETPOST('list', 'int') : '1'; ?>"></td></tr>
|
||||
@ -203,6 +209,12 @@ $listofexamplesforlink = 'Societe:societe/class/societe.class.php<br>Contact:con
|
||||
</td><td class="valeur"><input id="printable" class="minwidth100" type="text" name="printable" value="<?php echo dol_escape_htmltag(GETPOST('printable', 'int')); ?>"></td></tr>
|
||||
<!-- Totalizable -->
|
||||
<tr class="extra_totalizable"><td><?php echo $langs->trans("Totalizable"); ?></td><td class="valeur"><input id="totalizable" type="checkbox" name="totalizable"<?php echo ((GETPOST('totalizable', 'alpha') || GETPOST('button', 'alpha')) ? ' checked' : ''); ?>></td></tr>
|
||||
<!-- Css edit -->
|
||||
<tr class="help"><td><?php echo $form->textwithpicto($langs->trans("CssOnEdit"), $langs->trans("HelpCssOnEditDesc")); ?></td><td class="valeur"><input id="css" class="minwidth200" type="text" name="css" value="<?php echo dol_escape_htmltag((empty($css) ? '' : $css)); ?>"></td></tr>
|
||||
<!-- Css view -->
|
||||
<tr class="help"><td><?php echo $form->textwithpicto($langs->trans("CssOnView"), $langs->trans("HelpCssOnViewDesc")); ?></td><td class="valeur"><input id="cssview" class="minwidth200" type="text" name="cssview" value="<?php echo dol_escape_htmltag((empty($cssview) ? '' : $cssview)); ?>"></td></tr>
|
||||
<!-- Css list -->
|
||||
<tr class="help"><td><?php echo $form->textwithpicto($langs->trans("CssOnList"), $langs->trans("HelpCssOnListDesc")); ?></td><td class="valeur"><input id="csslist" class="minwidth200" type="text" name="csslist" value="<?php echo dol_escape_htmltag((empty($csslist) ? '' : $csslist)); ?>"></td></tr>
|
||||
<!-- Help tooltip -->
|
||||
<tr class="help"><td><?php echo $form->textwithpicto($langs->trans("HelpOnTooltip"), $langs->trans("HelpOnTooltipDesc")); ?></td><td class="valeur"><input id="help" class="quatrevingtpercent" type="text" name="help" value="<?php echo dol_escape_htmltag((empty($help) ? '' : $help)); ?>"></td></tr>
|
||||
<?php if (isModEnabled('multicompany')) { ?>
|
||||
|
||||
@ -167,6 +167,9 @@ $help = $extrafields->attributes[$elementtype]['help'][$attrname];
|
||||
$entitycurrentorall = $extrafields->attributes[$elementtype]['entityid'][$attrname];
|
||||
$printable = $extrafields->attributes[$elementtype]['printable'][$attrname];
|
||||
$enabled = $extrafields->attributes[$elementtype]['enabled'][$attrname];
|
||||
$css = $extrafields->attributes[$elementtype]['css'][$attrname];
|
||||
$cssview = $extrafields->attributes[$elementtype]['cssview'][$attrname];
|
||||
$csslist = $extrafields->attributes[$elementtype]['csslist'][$attrname];
|
||||
|
||||
if ((($type == 'select') || ($type == 'checkbox') || ($type == 'radio')) && is_array($param)) {
|
||||
$param_chain = '';
|
||||
@ -279,10 +282,10 @@ if (in_array($type, array_keys($typewecanchangeinto))) {
|
||||
<tr class="extra_unique"><td><?php echo $langs->trans("Unique"); ?></td><td class="valeur"><input id="unique" type="checkbox" name="unique"<?php echo ($unique ? ' checked' : ''); ?>></td></tr>
|
||||
|
||||
<!-- Required -->
|
||||
<tr class="extra_required"><td><?php echo $langs->trans("Required"); ?></td><td class="valeur"><input id="required" type="checkbox" name="required"<?php echo ($required ? ' checked' : ''); ?>></td></tr>
|
||||
<tr class="extra_required"><td><?php echo $langs->trans("Mandatory"); ?></td><td class="valeur"><input id="required" type="checkbox" name="required"<?php echo ($required ? ' checked' : ''); ?>></td></tr>
|
||||
|
||||
<!-- Always editable -->
|
||||
<tr class="extra_alwayseditable"><td><?php echo $langs->trans("AlwaysEditable"); ?></td><td class="valeur"><input id="alwayseditable" type="checkbox" name="alwayseditable"<?php echo ($alwayseditable ? ' checked' : ''); ?>></td></tr>
|
||||
<tr class="extra_alwayseditable"><td><?php echo $form->textwithpicto($langs->trans("AlwaysEditable"), $langs->trans("EditableWhenDraftOnly")); ?></td><td class="valeur"><input id="alwayseditable" type="checkbox" name="alwayseditable"<?php echo ($alwayseditable ? ' checked' : ''); ?>></td></tr>
|
||||
|
||||
<!-- Visibility -->
|
||||
<tr><td class="extra_list"><?php echo $form->textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc")); ?>
|
||||
@ -291,8 +294,19 @@ if (in_array($type, array_keys($typewecanchangeinto))) {
|
||||
<!-- Visibility for PDF-->
|
||||
<tr><td class="extra_pdf"><?php echo $form->textwithpicto($langs->trans("DisplayOnPdf"), $langs->trans("DisplayOnPdfDesc")); ?>
|
||||
</td><td class="valeur"><input id="printable" class="minwidth100" type="text" name="printable" value="<?php echo dol_escape_htmltag($printable); ?>"></td></tr>
|
||||
|
||||
<!-- Can be summed -->
|
||||
<tr class="extra_totalizable"><td><?php echo $form->textwithpicto($langs->trans("Totalizable"), $langs->trans("TotalizableDesc")); ?></td><td class="valeur"><input id="totalizable" type="checkbox" name="totalizable"<?php echo ($totalizable ? ' checked' : ''); ?>></td></tr>
|
||||
|
||||
<!-- Css edit -->
|
||||
<tr class="extra_css"><td><?php echo $form->textwithpicto($langs->trans("CssOnEdit"), $langs->trans("HelpCssOnEditDesc")); ?></td><td class="valeur"><input id="css" type="text" name="css" value="<?php echo $css ?>"></td></tr>
|
||||
|
||||
<!-- Css view -->
|
||||
<tr class="extra_cssview"><td><?php echo $form->textwithpicto($langs->trans("CssOnView"), $langs->trans("HelpCssOnViewDesc")); ?></td><td class="valeur"><input id="cssview" type="text" name="cssview" value="<?php echo $cssview; ?>"></td></tr>
|
||||
|
||||
<!-- Css list -->
|
||||
<tr class="extra_csslist"><td><?php echo $form->textwithpicto($langs->trans("CssOnList"), $langs->trans("HelpCssOnListDesc")); ?></td><td class="valeur"><input id="csslist" type="text" name="csslist" value="<?php echo $csslist; ?>"></td></tr>
|
||||
|
||||
<!-- Help tooltip -->
|
||||
<tr class="help"><td><?php echo $form->textwithpicto($langs->trans("HelpOnTooltip"), $langs->trans("HelpOnTooltipDesc")); ?></td><td class="valeur"><input id="help" class="quatrevingtpercent" type="text" name="help" value="<?php echo dol_escape_htmltag($help); ?>"></td></tr>
|
||||
|
||||
|
||||
@ -38,14 +38,25 @@ $langs->load("modulebuilder");
|
||||
<!-- BEGIN PHP TEMPLATE admin_extrafields_view.tpl.php -->
|
||||
<?php
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("DefineHereComplementaryAttributes", empty($textobject) ? '': $textobject).'</span><br>'."\n";
|
||||
print '<br>';
|
||||
$title = '<span class="opacitymedium">'.$langs->trans("DefineHereComplementaryAttributes", empty($textobject) ? '': $textobject).'</span><br>'."\n";
|
||||
//if ($action != 'create' && $action != 'edit') {
|
||||
$newcardbutton = dolGetButtonTitle($langs->trans('NewAttribute'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?action=create', '', (($action != 'create' && $action != 'edit') ? 1 : 1));
|
||||
/*} else {
|
||||
$newcardbutton = '';
|
||||
}*/
|
||||
|
||||
print '<div class="centpercent tagtable marginbottomonly">';
|
||||
print '<div class="tagtr">';
|
||||
print '<div class="tagtd inline-block valignmiddle hideonsmartphoneimp">'.$title.'</div>';
|
||||
print '<div class="tagtd right inline-block valignmiddle"">'.$newcardbutton.'</div>';
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
|
||||
// Load $extrafields->attributes
|
||||
$extrafields->fetch_name_optionals_label($elementtype);
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table summary="listofattributes" class="noborder centpercent">';
|
||||
print '<table summary="listofattributes" class="noborder centpercent small">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="left">'.$langs->trans("Position");
|
||||
@ -60,11 +71,14 @@ print '<td>'.$langs->trans("Type").'</td>';
|
||||
print '<td class="right">'.$langs->trans("Size").'</td>';
|
||||
print '<td>'.$langs->trans("ComputedFormula").'</td>';
|
||||
print '<td class="center">'.$langs->trans("Unique").'</td>';
|
||||
print '<td class="center">'.$langs->trans("Required").'</td>';
|
||||
print '<td class="center">'.$langs->trans("AlwaysEditable").'</td>';
|
||||
print '<td class="center">'.$form->textwithpicto($langs->trans("Visible"), $langs->trans("VisibleDesc")).'</td>';
|
||||
print '<td class="center">'.$langs->trans("Mandatory").'</td>';
|
||||
print '<td class="center">'.$form->textwithpicto($langs->trans("AlwaysEditable"), $langs->trans("EditableWhenDraftOnly")).'</td>';
|
||||
print '<td class="center">'.$form->textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc")).'</td>';
|
||||
print '<td class="center">'.$form->textwithpicto($langs->trans("DisplayOnPdf"), $langs->trans("DisplayOnPdfDesc")).'</td>';
|
||||
print '<td class="center">'.$form->textwithpicto($langs->trans("Totalizable"), $langs->trans("TotalizableDesc")).'</td>';
|
||||
print '<td class="center">'.$form->textwithpicto($langs->trans("CssOnEdit"), $langs->trans("HelpCssOnEditDesc")).'</td>';
|
||||
print '<td class="center">'.$form->textwithpicto($langs->trans("CssOnView"), $langs->trans("HelpCssOnViewDesc")).'</td>';
|
||||
print '<td class="center">'.$form->textwithpicto($langs->trans("CssOnList"), $langs->trans("HelpCssOnListDesc")).'</td>';
|
||||
if (isModEnabled('multicompany')) {
|
||||
print '<td class="center">'.$langs->trans("Entity").'</td>';
|
||||
}
|
||||
@ -87,14 +101,14 @@ if (isset($extrafields->attributes[$elementtype]['type']) && is_array($extrafiel
|
||||
// Position
|
||||
print "<td>".dol_escape_htmltag($extrafields->attributes[$elementtype]['pos'][$key])."</td>\n";
|
||||
// Label
|
||||
print "<td>".dol_escape_htmltag($extrafields->attributes[$elementtype]['label'][$key])."</td>\n"; // We don't translate here, we want admin to know what is the key not translated value
|
||||
print '<td title="'.dol_escape_htmltag($extrafields->attributes[$elementtype]['label'][$key]).'" class="tdoverflowmax150">'.dol_escape_htmltag($extrafields->attributes[$elementtype]['label'][$key])."</td>\n"; // We don't translate here, we want admin to know what is the key not translated value
|
||||
// Label translated
|
||||
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv($extrafields->attributes[$elementtype]['label'][$key])).'">'.dol_escape_htmltag($langs->transnoentitiesnoconv($extrafields->attributes[$elementtype]['label'][$key]))."</td>\n";
|
||||
// Key
|
||||
print "<td>".dol_escape_htmltag($key)."</td>\n";
|
||||
print '<td title="'.dol_escape_htmltag($key).'" class="tdoverflowmax100">'.dol_escape_htmltag($key)."</td>\n";
|
||||
// Type
|
||||
$typetoshow = $type2label[$extrafields->attributes[$elementtype]['type'][$key]];
|
||||
print '<td title="'.dol_escape_htmltag($typetoshow).'" class="tdoverflowmax150">';
|
||||
print '<td title="'.dol_escape_htmltag($typetoshow).'" class="tdoverflowmax100">';
|
||||
print dol_escape_htmltag($typetoshow);
|
||||
print "</td>\n";
|
||||
// Size
|
||||
@ -113,6 +127,13 @@ if (isset($extrafields->attributes[$elementtype]['type']) && is_array($extrafiel
|
||||
print '<td class="center tdoverflowmax100" title="'.dol_escape_htmltag($extrafields->attributes[$elementtype]['printable'][$key]).'">'.dol_escape_htmltag($extrafields->attributes[$elementtype]['printable'][$key])."</td>\n";
|
||||
// Summable
|
||||
print '<td class="center">'.yn($extrafields->attributes[$elementtype]['totalizable'][$key])."</td>\n";
|
||||
// CSS
|
||||
print '<td class="center tdoverflowmax100" title="'.dol_escape_htmltag($extrafields->attributes[$elementtype]['css'][$key]).'">'.dol_escape_htmltag($extrafields->attributes[$elementtype]['css'][$key])."</td>\n";
|
||||
// CSS view
|
||||
print '<td class="center tdoverflowmax100" title="'.dol_escape_htmltag($extrafields->attributes[$elementtype]['cssview'][$key]).'">'.dol_escape_htmltag($extrafields->attributes[$elementtype]['cssview'][$key])."</td>\n";
|
||||
// CSS list
|
||||
print '<td class="center tdoverflowmax100" title="'.dol_escape_htmltag($extrafields->attributes[$elementtype]['csslist'][$key]).'">'.dol_escape_htmltag($extrafields->attributes[$elementtype]['csslist'][$key])."</td>\n";
|
||||
// Multicompany
|
||||
if (isModEnabled('multicompany')) {
|
||||
print '<td class="center">';
|
||||
if (empty($extrafields->attributes[$elementtype]['entityid'][$key])) {
|
||||
@ -131,6 +152,7 @@ if (isset($extrafields->attributes[$elementtype]['type']) && is_array($extrafiel
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
// Actions
|
||||
print '<td class="right nowraponall">';
|
||||
print '<a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&attrname='.urlencode($key).'#formeditextrafield">'.img_edit().'</a>';
|
||||
print ' <a class="paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&attrname='.urlencode($key).'">'.img_delete().'</a>';
|
||||
@ -138,7 +160,7 @@ if (isset($extrafields->attributes[$elementtype]['type']) && is_array($extrafiel
|
||||
print "</tr>";
|
||||
}
|
||||
} else {
|
||||
$colspan = 14;
|
||||
$colspan = 17;
|
||||
if (isModEnabled('multicompany')) {
|
||||
$colspan++;
|
||||
}
|
||||
|
||||
@ -457,7 +457,6 @@ function cleanObjectDatas($toclean)
|
||||
|
||||
unset($toclean->ref_previous);
|
||||
unset($toclean->ref_next);
|
||||
unset($toclean->ref_int);
|
||||
|
||||
unset($toclean->projet); // Should be fk_project
|
||||
unset($toclean->project); // Should be fk_project
|
||||
|
||||
@ -78,13 +78,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
|
||||
@ -874,7 +874,6 @@ if ($action == 'create') {
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
print '<input type="hidden" name="origin" value="'.$origin.'">';
|
||||
print '<input type="hidden" name="origin_id" value="'.$object->id.'">';
|
||||
print '<input type="hidden" name="ref_int" value="'.$object->ref_int.'">';
|
||||
if (GETPOST('entrepot_id', 'int')) {
|
||||
print '<input type="hidden" name="entrepot_id" value="'.GETPOST('entrepot_id', 'int').'">';
|
||||
}
|
||||
|
||||
@ -98,12 +98,6 @@ class Expedition extends CommonObject
|
||||
*/
|
||||
public $ref_customer;
|
||||
|
||||
/**
|
||||
* @var string internal ref
|
||||
* @deprecated
|
||||
*/
|
||||
public $ref_int;
|
||||
|
||||
public $brouillon;
|
||||
|
||||
/**
|
||||
@ -304,7 +298,6 @@ class Expedition extends CommonObject
|
||||
$sql .= "ref";
|
||||
$sql .= ", entity";
|
||||
$sql .= ", ref_customer";
|
||||
$sql .= ", ref_int";
|
||||
$sql .= ", ref_ext";
|
||||
$sql .= ", date_creation";
|
||||
$sql .= ", fk_user_author";
|
||||
@ -329,7 +322,6 @@ class Expedition extends CommonObject
|
||||
$sql .= "'(PROV)'";
|
||||
$sql .= ", ".((int) $conf->entity);
|
||||
$sql .= ", ".($this->ref_customer ? "'".$this->db->escape($this->ref_customer)."'" : "null");
|
||||
$sql .= ", ".($this->ref_int ? "'".$this->db->escape($this->ref_int)."'" : "null");
|
||||
$sql .= ", ".($this->ref_ext ? "'".$this->db->escape($this->ref_ext)."'" : "null");
|
||||
$sql .= ", '".$this->db->idate($now)."'";
|
||||
$sql .= ", ".((int) $user->id);
|
||||
@ -527,7 +519,7 @@ class Expedition extends CommonObject
|
||||
return -1;
|
||||
}
|
||||
|
||||
$sql = "SELECT e.rowid, e.entity, e.ref, e.fk_soc as socid, e.date_creation, e.ref_customer, e.ref_ext, e.ref_int, e.fk_user_author, e.fk_statut, e.fk_projet as fk_project, e.billed";
|
||||
$sql = "SELECT e.rowid, e.entity, e.ref, e.fk_soc as socid, e.date_creation, e.ref_customer, e.ref_ext, e.fk_user_author, e.fk_statut, e.fk_projet as fk_project, e.billed";
|
||||
$sql .= ", e.date_valid";
|
||||
$sql .= ", e.weight, e.weight_units, e.size, e.size_units, e.width, e.height";
|
||||
$sql .= ", e.date_expedition as date_expedition, e.model_pdf, e.fk_address, e.date_delivery";
|
||||
@ -551,9 +543,6 @@ class Expedition extends CommonObject
|
||||
if ($ref_ext) {
|
||||
$sql .= " AND e.ref_ext='".$this->db->escape($ref_ext)."'";
|
||||
}
|
||||
if ($notused) {
|
||||
$sql .= " AND e.ref_int='".$this->db->escape($notused)."'";
|
||||
}
|
||||
|
||||
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
@ -567,7 +556,6 @@ class Expedition extends CommonObject
|
||||
$this->socid = $obj->socid;
|
||||
$this->ref_customer = $obj->ref_customer;
|
||||
$this->ref_ext = $obj->ref_ext;
|
||||
$this->ref_int = $obj->ref_int;
|
||||
$this->statut = $obj->fk_statut;
|
||||
$this->user_author_id = $obj->fk_user_author;
|
||||
$this->date_creation = $this->db->jdate($obj->date_creation);
|
||||
|
||||
@ -81,13 +81,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
// Creation of an optional field
|
||||
if ($action == 'create') {
|
||||
print '<br><div id="newattrib"></div>';
|
||||
|
||||
@ -82,13 +82,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
// Creation of an optional field
|
||||
if ($action == 'create') {
|
||||
print '<br><div id="newattrib"></div>';
|
||||
|
||||
@ -3507,7 +3507,7 @@ if ($action == 'create') {
|
||||
print '<td class="right'.($resteapayeraffiche ? ' amountremaintopay' : (' '.$cssforamountpaymentcomplete)).'">'.price($resteapayeraffiche).'</td><td> </td></tr>';
|
||||
|
||||
// Remainder to pay Multicurrency
|
||||
if ($object->multicurrency_code != $conf->currency || $object->multicurrency_tx != 1) {
|
||||
if (isModEnabled('multicurreny') && $object->multicurrency_code != $conf->currency || $object->multicurrency_tx != 1) {
|
||||
print '<tr><td colspan="'.$nbcols.'" class="right">';
|
||||
print '<span class="opacitymedium">';
|
||||
print $langs->trans('RemainderToPayMulticurrency');
|
||||
@ -3518,8 +3518,7 @@ if ($action == 'create') {
|
||||
print '</td>';
|
||||
print '<td class="right'.($resteapayeraffiche ? ' amountremaintopay' : (' '.$cssforamountpaymentcomplete)).'">'.(!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency).' '.price(price2num($object->multicurrency_tx*$resteapayeraffiche, 'MT')).'</td><td> </td></tr>';
|
||||
}
|
||||
} else // Credit note
|
||||
{
|
||||
} else { // Credit note
|
||||
$cssforamountpaymentcomplete = 'amountpaymentneutral';
|
||||
|
||||
// Total already paid back
|
||||
@ -3542,7 +3541,7 @@ if ($action == 'create') {
|
||||
print '<td class="right'.($resteapayeraffiche ? ' amountremaintopay' : (' '.$cssforamountpaymentcomplete)).'">'.price($sign * $resteapayeraffiche).'</td><td> </td></tr>';
|
||||
|
||||
// Remainder to pay back Multicurrency
|
||||
if ($object->multicurrency_code != $conf->currency || $object->multicurrency_tx != 1) {
|
||||
if (isModEnabled('multicurreny') && $object->multicurrency_code != $conf->currency || $object->multicurrency_tx != 1) {
|
||||
print '<tr><td colspan="'.$nbcols.'" class="right">';
|
||||
print '<span class="opacitymedium">';
|
||||
print $langs->trans('RemainderToPayBackMulticurrency');
|
||||
|
||||
@ -193,9 +193,8 @@ $arrayfields = array(
|
||||
'f.total_localtax1'=>array('label'=>$langs->transcountry("AmountLT1", $mysoc->country_code), 'checked'=>0, 'enabled'=>$mysoc->localtax1_assuj == "1", 'position'=>95),
|
||||
'f.total_localtax2'=>array('label'=>$langs->transcountry("AmountLT2", $mysoc->country_code), 'checked'=>0, 'enabled'=>$mysoc->localtax2_assuj == "1", 'position'=>100),
|
||||
'f.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0, 'position'=>115),
|
||||
'u.login'=>array('label'=>"Author", 'checked'=>1),
|
||||
'dynamount_payed'=>array('label'=>"Paid", 'checked'=>0),
|
||||
'rtp'=>array('label'=>"Rest", 'checked'=>0),
|
||||
'dynamount_payed'=>array('label'=>"Paid", 'checked'=>0, 'position'=>116),
|
||||
'rtp'=>array('label'=>"Rest", 'checked'=>0, 'position'=>117),
|
||||
'f.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)),
|
||||
'f.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)),
|
||||
'f.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)),
|
||||
@ -203,8 +202,9 @@ $arrayfields = array(
|
||||
'f.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)),
|
||||
'multicurrency_dynamount_payed'=>array('label'=>'MulticurrencyAlreadyPaid', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)),
|
||||
'multicurrency_rtp'=>array('label'=>'MulticurrencyRemainderToPay', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), // Not enabled by default because slow
|
||||
'f.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
|
||||
'f.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500),
|
||||
'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>500),
|
||||
'f.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>501),
|
||||
'f.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>502),
|
||||
'f.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
|
||||
);
|
||||
// Extra fields
|
||||
@ -1510,7 +1510,7 @@ if ($resql) {
|
||||
|
||||
// Payment condition
|
||||
if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) {
|
||||
print '<td class="tdoverflowmax125">';
|
||||
print '<td class="tdoverflowmax100">';
|
||||
$form->form_conditions_reglement($_SERVER['PHP_SELF'], $obj->fk_cond_reglement, 'none', 1);
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
@ -1519,7 +1519,7 @@ if ($resql) {
|
||||
}
|
||||
// Payment mode
|
||||
if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) {
|
||||
print '<td class="tdoverflowmax125">';
|
||||
print '<td class="tdoverflowmax100">';
|
||||
$form->form_modes_reglement($_SERVER['PHP_SELF'], $obj->fk_mode_reglement, 'none', '', -1);
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
|
||||
@ -439,7 +439,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
}
|
||||
|
||||
// Action validate (+ send email for approval)
|
||||
// Action validate (+ send email for approval to the expected approver)
|
||||
if ($action == 'confirm_send') {
|
||||
$object->fetch($id);
|
||||
|
||||
@ -1150,7 +1150,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
||||
$result = $object->fetch($id, $ref);
|
||||
|
||||
$approverexpected = new User($db);
|
||||
$approverexpected->fetch($object->fk_validator);
|
||||
$approverexpected->fetch($object->fk_validator); // Use that should be the approver
|
||||
|
||||
$userRequest = new User($db);
|
||||
$userRequest->fetch($object->fk_user);
|
||||
@ -1364,21 +1364,23 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if ($object->statut == Holiday::STATUS_APPROVED || $object->statut == Holiday::STATUS_CANCELED) {
|
||||
$approverdone = new User($db);
|
||||
$approverdone->fetch($object->fk_user_valid);
|
||||
print $approverdone->getNomUrl(-1);
|
||||
if ($object->fk_user_approve > 0) {
|
||||
$approverdone = new User($db);
|
||||
$approverdone->fetch($object->fk_user_approve);
|
||||
print $approverdone->getNomUrl(-1);
|
||||
}
|
||||
} else {
|
||||
print $approverexpected->getNomUrl(-1);
|
||||
}
|
||||
$include_users = $object->fetch_users_approver_holiday();
|
||||
if (is_array($include_users) && in_array($user->id, $include_users) && $object->statut == Holiday::STATUS_VALIDATED) {
|
||||
print '<a class="editfielda paddingleft" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=editvalidator&token='.newToken().'">'.img_edit($langs->trans("Edit")).'</a>';
|
||||
print '<a class="editfielda paddingleft" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=editvalidator">'.img_edit($langs->trans("Edit")).'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
} else {
|
||||
print '<tr>';
|
||||
print '<td class="titlefield">'.$langs->trans('ReviewedByCP').'</td>';
|
||||
print '<td class="titlefield">'.$langs->trans('ReviewedByCP').'</td>'; // Will be approved by
|
||||
print '<td>';
|
||||
$include_users = $object->fetch_users_approver_holiday();
|
||||
if (!in_array($object->fk_validator, $include_users)) { // Add the current validator to the list to not lose it when editing.
|
||||
@ -1406,7 +1408,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
||||
if ($object->statut == Holiday::STATUS_APPROVED || $object->statut == Holiday::STATUS_CANCELED) {
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('DateValidCP').'</td>';
|
||||
print '<td>'.dol_print_date($object->date_valid, 'dayhour', 'tzuser').'</td>'; // warning: date_valid is approval date on holiday module
|
||||
print '<td>'.dol_print_date($object->date_approval, 'dayhour', 'tzuser').'</td>'; // warning: date_valid is approval date on holiday module
|
||||
print '</tr>';
|
||||
}
|
||||
if ($object->statut == Holiday::STATUS_CANCELED) {
|
||||
@ -1491,8 +1493,8 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
||||
if ($object->statut == Holiday::STATUS_VALIDATED) { // If validated
|
||||
// Button Approve / Refuse
|
||||
if ($user->id == $object->fk_validator) {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=valid" class="butAction">'.$langs->trans("Approve").'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=refuse" class="butAction">'.$langs->trans("ActionRefuseCP").'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=valid&token='.newToken().'" class="butAction">'.$langs->trans("Approve").'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=refuse&token='.newToken().'" class="butAction">'.$langs->trans("ActionRefuseCP").'</a>';
|
||||
} else {
|
||||
print '<a href="#" class="butActionRefused classfortooltip" title="'.$langs->trans("NotTheAssignedApprover").'">'.$langs->trans("Approve").'</a>';
|
||||
print '<a href="#" class="butActionRefused classfortooltip" title="'.$langs->trans("NotTheAssignedApprover").'">'.$langs->trans("ActionRefuseCP").'</a>';
|
||||
|
||||
@ -421,6 +421,7 @@ class Holiday extends CommonObject
|
||||
$this->fk_validator = $obj->fk_validator;
|
||||
$this->date_valid = $this->db->jdate($obj->date_valid);
|
||||
$this->fk_user_valid = $obj->fk_user_valid;
|
||||
$this->user_validation_id = $obj->fk_user_valid;
|
||||
$this->date_approval = $this->db->jdate($obj->date_approval);
|
||||
$this->fk_user_approve = $obj->fk_user_approve;
|
||||
$this->date_refuse = $this->db->jdate($obj->date_refuse);
|
||||
@ -743,9 +744,12 @@ class Holiday extends CommonObject
|
||||
|
||||
// Update status
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."holiday SET";
|
||||
$sql .= " fk_user_valid = ".((int) $user->id).",";
|
||||
$sql .= " date_valid = '".$this->db->idate(dol_now())."',";
|
||||
if (!empty($this->statut) && is_numeric($this->statut)) {
|
||||
$sql .= " statut = ".((int) $this->statut).",";
|
||||
} else {
|
||||
$this->error = 'Property status must be a numeric value';
|
||||
$error++;
|
||||
}
|
||||
$sql .= " ref = '".$this->db->escape($num)."'";
|
||||
@ -868,7 +872,7 @@ class Holiday extends CommonObject
|
||||
$error++;
|
||||
}
|
||||
if (!empty($this->fk_validator)) {
|
||||
$sql .= " fk_validator = '".$this->db->escape($this->fk_validator)."',";
|
||||
$sql .= " fk_validator = ".((int) $this->fk_validator).",";
|
||||
} else {
|
||||
$error++;
|
||||
}
|
||||
@ -878,7 +882,7 @@ class Holiday extends CommonObject
|
||||
$sql .= " date_valid = NULL,";
|
||||
}
|
||||
if (!empty($this->fk_user_valid)) {
|
||||
$sql .= " fk_user_valid = '".$this->db->escape($this->fk_user_valid)."',";
|
||||
$sql .= " fk_user_valid = ".((int) $this->fk_user_valid).",";
|
||||
} else {
|
||||
$sql .= " fk_user_valid = NULL,";
|
||||
}
|
||||
@ -888,7 +892,7 @@ class Holiday extends CommonObject
|
||||
$sql .= " date_approval = NULL,";
|
||||
}
|
||||
if (!empty($this->fk_user_approve)) {
|
||||
$sql .= " fk_user_approve = '".$this->db->escape($this->fk_user_approve)."',";
|
||||
$sql .= " fk_user_approve = ".((int) $this->fk_user_approve).",";
|
||||
} else {
|
||||
$sql .= " fk_user_approve = NULL,";
|
||||
}
|
||||
@ -898,7 +902,7 @@ class Holiday extends CommonObject
|
||||
$sql .= " date_refuse = NULL,";
|
||||
}
|
||||
if (!empty($this->fk_user_refuse)) {
|
||||
$sql .= " fk_user_refuse = '".$this->db->escape($this->fk_user_refuse)."',";
|
||||
$sql .= " fk_user_refuse = ".((int) $this->fk_user_refuse).",";
|
||||
} else {
|
||||
$sql .= " fk_user_refuse = NULL,";
|
||||
}
|
||||
@ -908,7 +912,7 @@ class Holiday extends CommonObject
|
||||
$sql .= " date_cancel = NULL,";
|
||||
}
|
||||
if (!empty($this->fk_user_cancel)) {
|
||||
$sql .= " fk_user_cancel = '".$this->db->escape($this->fk_user_cancel)."',";
|
||||
$sql .= " fk_user_cancel = ".((int) $this->fk_user_cancel).",";
|
||||
} else {
|
||||
$sql .= " fk_user_cancel = NULL,";
|
||||
}
|
||||
@ -2289,12 +2293,6 @@ class Holiday extends CommonObject
|
||||
$auser->fetch($obj->fk_user_approval_done);
|
||||
$this->user_approve = $auser;
|
||||
}
|
||||
} else {
|
||||
if (!empty($obj->fk_user_approval_expected)) {
|
||||
$auser = new User($this->db);
|
||||
$auser->fetch($obj->fk_user_approval_expected);
|
||||
$this->user_approve = $auser;
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
@ -88,14 +88,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Creation of an optional field
|
||||
*/
|
||||
|
||||
@ -88,14 +88,6 @@ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Creation of an optional field
|
||||
*/
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user