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

This commit is contained in:
Florian HENRY 2022-03-18 08:42:19 +01:00
commit 93e8c57d78
203 changed files with 4078 additions and 2501 deletions

View File

@ -50,7 +50,7 @@ jobs:
env: DB=postgresql
- stage: PHP 5.6-7.4
if: type = pull_request OR type = push
php: '7.4'
php: '7.4.22'
env: DB=mysql
- stage: PHP Dev
if: type = push AND branch = develop
@ -106,7 +106,7 @@ install:
php-parallel-lint/php-console-highlighter ^0 \
squizlabs/php_codesniffer ^3
fi
if [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = '7.4' ]; then
if [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = '7.4' ] || [ "$TRAVIS_PHP_VERSION" = '7.4.22' ]; then
composer -n require phpunit/phpunit ^7 \
php-parallel-lint/php-parallel-lint ^1.2 \
php-parallel-lint/php-console-highlighter ^0 \
@ -241,7 +241,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" = '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" = '7.4.22' ] || [ "$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
@ -276,7 +276,7 @@ script:
set -e
#parallel-lint --exclude htdocs/includes --blame .
# Exclusions are defined in the ruleset.xml file
if [ "$TRAVIS_PHP_VERSION" = "7.4" ]; then
if [ "$TRAVIS_PHP_VERSION" = "7.4.22" ]; 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 \
@ -291,7 +291,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" ]; then
if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_PHP_VERSION" = "7.4.22" ]; 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

View File

@ -3,6 +3,7 @@ English Dolibarr ChangeLog
--------------------------------------------------------------
***** ChangeLog for 16.0.0 compared to 15.0.0 *****
For users:
@ -21,12 +22,41 @@ For developers:
---------------
NEW:
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
* verifCond('stringtoevaluate') now return false when string contains a bad syntax content instead of true.
* The deprecated mdethod thirdparty_doc_create() has been removed. You can use the generateDocument() instead.
***** ChangeLog for 15.0.1 compared to 15.0.0 *****
FIX: #19777 #20281
FIX: bad position of extrafields for interventions
FIX: Blocking situation when a payment was deleted in bank.
FIX: creation of the shipment if order contains services
FIX: Drag and drop line of files on join files tab
FIX: Error management on mass action "Approve holiday"
FIX: error with php8
FIX: in case of VAT refund, negative amount must be allowed
FIX: invoice pdf: lines originating from deposits were not detailed anymore
FIX: Invoice - When you create an invoice for a given thirdparty, fk_account is not retrieved from company card
FIX: list of visible type of event was not correctly filtered
FIX: Missing or bad permissions
FIX: Missing the field date start/end in export supplier invoice/order
FIX: On large proposal or invoice, fix n(n+1) sql into a n sql.
FIX: options should not exists on invoices
FIX: payment not completed when using Paypal.
FIX: permission to download files of expense report with readall.
FIX- Preview icon in documents list PDF in the admin page third-party
FIX: shipping list, e.shipping_method_id should be e.fk_shipping_method.
FIX: Show product photo on Supplier order Cornas model.
FIX: User name in ManufacturingOrder
FIX: viewimage.php blocks requests with multicompany from other enties
FIX: #yogosha9048
FIX: #yogosha9054
FIX: #yogosha9095
***** ChangeLog for 15.0.0 compared to 14.0.0 *****
@ -36,6 +66,7 @@ For users:
NEW: Online proposal signature
NEW: Can define some max limit on expense report (per period, per type or expense, ...)
NEW: Provide a special pages for bookmarks and multicompany for a better use of some mobile applications (like DoliDroid)
NEW: Allow the use of __NEWREF__ to get for example the new reference a draft order will get after validation.
NEW: Add option to disable globaly some notifications emails.
NEW: #18401 Add __NEWREF__ subtitute to get new object reference.

View File

@ -64,6 +64,10 @@ class AccountancyExport
public static $EXPORT_TYPE_FEC = 1000;
public static $EXPORT_TYPE_FEC2 = 1010;
/**
* @var DoliDB Database handler
*/
public $db;
/**
* @var string[] Error codes (or messages)

View File

@ -39,6 +39,24 @@
*/
class AccountancyImport
{
/**
* @var DoliDB Database handler
*/
public $db;
/**
* Constructor
*
* @param DoliDb $db Database handler
*/
public function __construct(DoliDB $db)
{
global $conf;
$this->db = $db;
}
/**
* Compute amount
*

View File

@ -497,7 +497,7 @@ if ($result) {
print '</td>';
print '<td class="tdoverflowonsmartphone">';
$text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->description));
$text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->description, 1));
$trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description);
print '</td>';

View File

@ -637,7 +637,7 @@ if ($result) {
// Description
print '<td class="tdoverflowonsmartphone small">';
$text = dolGetFirstLineOfText(dol_string_nohtmltag($facture_static_det->desc));
$text = dolGetFirstLineOfText(dol_string_nohtmltag($facture_static_det->desc, 1));
$trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
print $form->textwithtooltip(dol_trunc($text, $trunclength), $facture_static_det->desc);
print '</td>';

View File

@ -405,7 +405,7 @@ if ($result) {
// Fees description -- Can be null
print '<td>';
$text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->comments));
$text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->comments, 1));
$trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->comments);
print '</td>';

View File

@ -481,7 +481,7 @@ if ($result) {
// Fees description -- Can be null
print '<td>';
$text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->comments));
$text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->comments, 1));
$trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->comments);
print '</td>';

View File

@ -412,8 +412,13 @@ if ($action == 'writebookkeeping') {
$bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add
$bookkeeping->thirdparty_code = $companystatic->code_client;
$bookkeeping->subledger_account = '';
$bookkeeping->subledger_label = '';
if ($k == getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT')) {
$bookkeeping->subledger_account = $tabcompany[$key]['code_compta'];
$bookkeeping->subledger_label = $tabcompany[$key]['name'];
} else {
$bookkeeping->subledger_account = '';
$bookkeeping->subledger_label = '';
}
$bookkeeping->numero_compte = $k;
$bookkeeping->label_compte = $label_account;
@ -886,6 +891,13 @@ if (empty($action) || $action == 'view') {
print "</td>";
// Subledger account
print "<td>";
if ($k == getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT')) {
if (($accountoshow == "") || $accountoshow == 'NotDefined') {
print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>';
} else {
print length_accounta($tabcompany[$key]['code_compta']);
}
}
print '</td>';
$companystatic->id = $tabcompany[$key]['id'];
$companystatic->name = $tabcompany[$key]['name'];

View File

@ -502,7 +502,7 @@ if ($result) {
print '</td>';
print '<td class="tdoverflowonsmartphone">';
$text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->description));
$text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->description, 1));
$trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description);
print '</td>';

View File

@ -644,7 +644,7 @@ if ($result) {
// Description
print '<td class="tdoverflowonsmartphone small">';
$text = dolGetFirstLineOfText(dol_string_nohtmltag($facturefourn_static_det->desc));
$text = dolGetFirstLineOfText(dol_string_nohtmltag($facturefourn_static_det->desc, 1));
$trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
print $form->textwithtooltip(dol_trunc($text, $trunclength), $facturefourn_static_det->desc);
print '</td>';

View File

@ -1719,8 +1719,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '<tr><td>'.$langs->trans("MemberNature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>';
print '</tr>';
print '</td></tr>';
// Company
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.dol_escape_htmltag($object->company).'</td></tr>';
@ -1737,9 +1735,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if ($user->admin) {
print '<!-- '.$langs->trans("Crypted").': '.$object->pass_indatabase_crypted.' -->';
}
print '<span class="opacitymedium"'.$langs->trans("Hidden").'</span>';
print '<span class="opacitymedium">'.$langs->trans("Hidden").'</span>';
}
if ((!empty($object->pass) || !empty($object->pass_crypted)) && empty($object->user_id)) {
if (!empty($object->pass_indatabase) && empty($object->user_id)) { // Show warning only for old password still in clear (does not happen anymore)
$langs->load("errors");
$htmltext = $langs->trans("WarningPasswordSetWithNoAccount");
print ' '.$form->textwithpicto('', $htmltext, 1, 'warning');
@ -1778,7 +1776,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '<div class="fichehalfright">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border tableforfield tableforfield centpercent">';
print '<table class="border tableforfield centpercent">';
// Tags / Categories
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
@ -1853,18 +1851,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
print '</td></tr>';
// VCard
/*
print '<tr><td>';
print $langs->trans("VCard").'</td><td colspan="3">';
print '<a href="'.DOL_URL_ROOT.'/adherents/vcard.php?id='.$object->id.'">';
print img_picto($langs->trans("Download").' vcard', 'vcard.png', 'class="paddingrightonly"');
print $langs->trans("Download");
print img_picto($langs->trans("Download").' vcard', 'download', 'class="paddingleft"');
print '</a>';
print '</td></tr>';
*/
print "</table>\n";
print "</div></div>\n";

View File

@ -501,7 +501,7 @@ if ($rowid > 0) {
// Login
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
print '<tr><td class="titlefield">'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.$object->login.'&nbsp;</td></tr>';
print '<tr><td class="titlefield">'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.dol_escape_htmltag($object->login).'</td></tr>';
}
// Type
@ -512,25 +512,24 @@ if ($rowid > 0) {
print '</tr>';
// Company
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$object->company.'</td></tr>';
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.dol_escape_htmltag($object->company).'</td></tr>';
// Civility
print '<tr><td>'.$langs->trans("UserTitle").'</td><td class="valeur">'.$object->getCivilityLabel().'&nbsp;</td>';
print '<tr><td>'.$langs->trans("UserTitle").'</td><td class="valeur">'.$object->getCivilityLabel().'</td>';
print '</tr>';
// Password
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
print '<tr><td>'.$langs->trans("Password").'</td><td>'.preg_replace('/./i', '*', $object->pass);
print '<tr><td>'.$langs->trans("Password").'</td><td>';
if ($object->pass) {
print preg_replace('/./i', '*', $object->pass);
} else {
if ($user->admin) {
print $langs->trans("Crypted").': '.$object->pass_indatabase_crypted;
} else {
print $langs->trans("Hidden");
print '<!-- '.$langs->trans("Crypted").': '.$object->pass_indatabase_crypted.' -->';
}
print '<span class="opacitymedium">'.$langs->trans("Hidden").'</span>';
}
if ((!empty($object->pass) || !empty($object->pass_crypted)) && empty($object->user_id)) {
if (!empty($object->pass_indatabase) && empty($object->user_id)) { // Show warning only for old password still in clear (does not happen anymore)
$langs->load("errors");
$htmltext = $langs->trans("WarningPasswordSetWithNoAccount");
print ' '.$form->textwithpicto('', $htmltext, 1, 'warning');
@ -546,15 +545,17 @@ if ($rowid > 0) {
print " ".img_warning($langs->trans("Late"));
}
} else {
if (!$adht->subscription) {
if ($object->need_subscription == 0) {
print $langs->trans("SubscriptionNotNeeded");
} elseif (!$adht->subscription) {
print $langs->trans("SubscriptionNotRecorded");
if ($object->statut > 0) {
print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled
if (Adherent::STATUS_VALIDATED == $object->statut) {
print " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft, not excluded and not resiliated
}
} else {
print $langs->trans("SubscriptionNotReceived");
if ($object->statut > 0) {
print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled
if (Adherent::STATUS_VALIDATED == $object->statut) {
print " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft, not excluded and not resiliated
}
}
}
@ -563,18 +564,13 @@ if ($rowid > 0) {
print '</table>';
print '</div>';
print '<div class="fichehalfright">';
print '<div class="fichehalfright">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border tableforfield centpercent">';
// Birthday
print '<tr><td class="titlefield">'.$langs->trans("DateOfBirth").'</td><td class="valeur">'.dol_print_date($object->birth, 'day').'</td></tr>';
// Public
print '<tr><td>'.$langs->trans("Public").'</td><td class="valeur">'.yn($object->public).'</td></tr>';
// Categories
// Tags / Categories
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
print '<tr><td>'.$langs->trans("Categories").'</td>';
print '<td colspan="2">';
@ -582,6 +578,12 @@ if ($rowid > 0) {
print '</td></tr>';
}
// Birth Date
print '<tr><td class="titlefield">'.$langs->trans("DateOfBirth").'</td><td class="valeur">'.dol_print_date($object->birth, 'day').'</td></tr>';
// Public
print '<tr><td>'.$langs->trans("Public").'</td><td class="valeur">'.yn($object->public).'</td></tr>';
// Other attributes
$cols = 2;
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
@ -663,8 +665,6 @@ if ($rowid > 0) {
print dol_get_fiche_end();
print '</form>';
/*
* Action bar

View File

@ -23,7 +23,7 @@ if (empty($conf) || !is_object($conf)) {
exit;
}
echo "<!-- BEGIN PHP TEMPLATE adherents/tpl/linkedopjectblock.tpl.php -->\n";
echo "<!-- BEGIN PHP TEMPLATE adherents/tpl/linkedobjectblock.tpl.php -->\n";
global $user;

View File

@ -8,7 +8,7 @@
* Copyright (C) 2011 Remy Younes <ryounes@gmail.com>
* Copyright (C) 2012-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@ltairis.fr>
* Copyright (C) 2011-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2011-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2019-2020 Frédéric France <frederic.france@netlogic.fr>
@ -201,7 +201,7 @@ $tabsql = array();
$tabsql[1] = "SELECT f.rowid as rowid, f.code, f.libelle, c.code as country_code, c.label as country, f.active FROM ".MAIN_DB_PREFIX."c_forme_juridique as f, ".MAIN_DB_PREFIX."c_country as c WHERE f.fk_pays=c.rowid";
$tabsql[2] = "SELECT d.rowid as rowid, d.code_departement as code, d.nom as libelle, d.fk_region as region_id, r.nom as region, c.code as country_code, c.label as country, d.active FROM ".MAIN_DB_PREFIX."c_departements as d, ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_country as c WHERE d.fk_region=r.code_region and r.fk_pays=c.rowid and r.active=1 and c.active=1";
$tabsql[3] = "SELECT r.rowid as rowid, r.code_region as state_code, r.nom as libelle, r.fk_pays as country_id, c.code as country_code, c.label as country, r.active FROM ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_country as c WHERE r.fk_pays=c.rowid and c.active=1";
$tabsql[4] = "SELECT c.rowid as rowid, c.code, c.label, c.active, c.favorite FROM ".MAIN_DB_PREFIX."c_country AS c";
$tabsql[4] = "SELECT c.rowid as rowid, c.code, c.label, c.active, c.favorite, c.eec FROM ".MAIN_DB_PREFIX."c_country AS c";
$tabsql[5] = "SELECT c.rowid as rowid, c.code as code, c.label, c.active FROM ".MAIN_DB_PREFIX."c_civility AS c";
$tabsql[6] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.type, a.active, a.module, a.color, a.position FROM ".MAIN_DB_PREFIX."c_actioncomm AS a";
$tabsql[7] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.accountancy_code as accountancy_code, c.code as country_code, c.label as country, a.fk_pays as country_id, a.active FROM ".MAIN_DB_PREFIX."c_chargesociales AS a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_pays=c.rowid and c.active=1";
@ -669,8 +669,8 @@ if ($id == 11) {
asort($elementList);
$sourceList = array(
'internal' => $langs->trans('Internal'),
'external' => $langs->trans('External')
'internal' => $langs->trans('Internal'),
'external' => $langs->trans('External')
);
}
@ -737,12 +737,12 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) {
}
if ((!GETPOSTISSET($value) || GETPOST($value) == '')
&& (!in_array($value, array('decalage', 'module', 'accountancy_code', 'accountancy_code_sell', 'accountancy_code_buy', 'tracking', 'picto')) // Fields that are not mandatory
&& ($id != 10 || ($value != 'code' && $value != 'note')) // Field code and note is not mandatory for dictionary table 10
)
) {
$ok = 0;
$fieldnamekey = $value;
// We take translate key of field
&& ($id != 10 || ($value != 'code' && $value != 'note')) // Field code and note is not mandatory for dictionary table 10
)
) {
$ok = 0;
$fieldnamekey = $value;
// We take translate key of field
if ($fieldnamekey == 'libelle' || ($fieldnamekey == 'label')) {
$fieldnamekey = 'Label';
}
@ -792,7 +792,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) {
$fieldnamekey = 'UseByDefault';
}
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors');
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors');
}
}
// Other checks
@ -1093,6 +1093,45 @@ if ($action == 'disable_favorite') {
}
}
// Is in EEC - Activate
if ($action == 'activate_eec') {
if ($tabrowid[$id]) {
$rowidcol = $tabrowid[$id];
} else {
$rowidcol = "rowid";
}
if ($rowid) {
$sql = "UPDATE ".$tabname[$id]." SET eec = 1 WHERE ".$rowidcol."='".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
} elseif ($code) {
$sql = "UPDATE ".$tabname[$id]." SET eec = 1 WHERE code='".dol_escape_htmltag($code)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
}
$result = $db->query($sql);
if (!$result) {
dol_print_error($db);
}
}
// Is in EEC - Disable
if ($action == 'disable_eec') {
if ($tabrowid[$id]) {
$rowidcol = $tabrowid[$id];
} else {
$rowidcol = "rowid";
}
if ($rowid) {
$sql = "UPDATE ".$tabname[$id]." SET eec = 0 WHERE ".$rowidcol."='".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
} elseif ($code) {
$sql = "UPDATE ".$tabname[$id]." SET eec = 0 WHERE code='".dol_escape_htmltag($code)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
}
$result = $db->query($sql);
if (!$result) {
dol_print_error($db);
}
}
/*
* View
@ -1452,6 +1491,7 @@ if ($id) {
if ($id == 4) {
$tdsoffields .= '<td></td>';
$tdsoffields .= '<td></td>';
}
$tdsoffields .= '<td>';
$tdsoffields .= '<input type="hidden" name="id" value="'.$id.'">';
@ -1496,6 +1536,7 @@ if ($id) {
if ($id == 4) {
print '<td></td>';
print '<td></td>';
}
print '<td colspan="3" class="center">';
if ($action != 'edit') {
@ -1569,6 +1610,7 @@ if ($id) {
}
if ($id == 4) {
print '<td></td>';
print '<td></td>';
}
print '<td class="liste_titre"></td>';
print '<td class="liste_titre right" colspan="2">';
@ -1592,10 +1634,10 @@ if ($id) {
// Determines the name of the field in relation to the possible names
// in data dictionaries
$showfield = 1; // By defaut
$showfield = 1; // By default
$cssprefix = '';
$sortable = 1;
$valuetoshow = ucfirst($value); // By defaut
$valuetoshow = ucfirst($value); // By default
$valuetoshow = $langs->trans($valuetoshow); // try to translate
// Special cases
@ -1794,8 +1836,9 @@ if ($id) {
print getTitleFieldOfList($newvaluetoshow, 0, $_SERVER["PHP_SELF"], ($sortable ? $value : ''), ($page ? 'page='.$page.'&' : ''), $param, '', $sortfield, $sortorder, $cssprefix);
}
}
// Favorite - Only activated on country dictionary
// Favorite & EEC - Only activated on country dictionary
if ($id == 4) {
print getTitleFieldOfList($langs->trans("InEEC"), 0, $_SERVER["PHP_SELF"], "eec", ($page ? 'page='.$page.'&' : ''), $param, 'align="center"', $sortfield, $sortorder, '', 0, $langs->trans("CountryIsInEEC"));
print getTitleFieldOfList($langs->trans("Favorite"), 0, $_SERVER["PHP_SELF"], "favorite", ($page ? 'page='.$page.'&' : ''), $param, 'align="center"', $sortfield, $sortorder);
}
@ -2089,10 +2132,19 @@ if ($id) {
}
$url .= '&';
// Favorite
// Favorite & EEC
// Only activated on country dictionary
if ($id == 4) {
print '<td class="nowrap center">';
// Is in EEC
if ($iserasable) {
print '<a class="reposition" href="'.$url.'action='.$acts[$obj->eec].'_eec&token='.newToken().'">'.$actl[$obj->eec].'</a>';
} else {
print $langs->trans("AlwaysActive");
}
print '</td>';
print '<td class="nowrap center">';
// Favorite
if ($iserasable) {
print '<a class="reposition" href="'.$url.'action='.$acts[$obj->favorite].'_favorite&token='.newToken().'">'.$actl[$obj->favorite].'</a>';
} else {
@ -2359,10 +2411,10 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
} elseif ($value == 'unit') {
print '<td>';
$units = array(
'mm' => $langs->trans('SizeUnitmm'),
'cm' => $langs->trans('SizeUnitcm'),
'point' => $langs->trans('SizeUnitpoint'),
'inch' => $langs->trans('SizeUnitinch')
'mm' => $langs->trans('SizeUnitmm'),
'cm' => $langs->trans('SizeUnitcm'),
'point' => $langs->trans('SizeUnitpoint'),
'inch' => $langs->trans('SizeUnitinch')
);
print $form->selectarray('unit', $units, (!empty($obj->{$value}) ? $obj->{$value}:''), 0, 0, 0);
print '</td>';

View File

@ -46,11 +46,12 @@ if ($action == 'test' || $action == 'send') {
$substitutionarrayfortest = array(
'__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT,
'__CHECK_READ__' => (!empty($object) && is_object($object) && is_object($object->thirdparty)) ? '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$object->thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>' : '',
'__USER_LOGIN__' => $user->login,
'__USER_EMAIL__' => $user->email,
'__USER_SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? $usersignature : ''), // Done into actions_sendmails
'__ID__' => 'RecipientIdRecord',
//'__EMAIL__' => 'RecipientEMail', // Done into actions_sendmails
'__CHECK_READ__' => (!empty($object) && is_object($object) && is_object($object->thirdparty)) ? '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$object->thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>' : '',
'__USER_SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? $usersignature : ''), // Done into actions_sendmails
'__LOGIN__' => 'RecipientLogin',
'__LASTNAME__' => 'RecipientLastname',
'__FIRSTNAME__' => 'RecipientFirstname',
'__ADDRESS__'=> 'RecipientAddress',
@ -662,7 +663,7 @@ if ($action == 'edit') {
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_DKIM_ENABLED").'</td><td>';
if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('swiftmailer'))) {
if (function_exists('openssl_open')) {
print yn($conf->global->MAIN_MAIL_EMAIL_DKIM_ENABLED);
print yn(getDolGlobalInt('MAIN_MAIL_EMAIL_DKIM_ENABLED'));
} else {
print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
}
@ -762,9 +763,18 @@ if ($action == 'edit') {
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").'</td>';
print '<td>';
if (!empty($conf->global->MAIN_MAIL_AUTOCOPY_TO)) {
print $conf->global->MAIN_MAIL_AUTOCOPY_TO;
if (!isValidEmail($conf->global->MAIN_MAIL_AUTOCOPY_TO)) {
print img_warning($langs->trans("ErrorBadEMail"));
$listofemail = explode(',', $conf->global->MAIN_MAIL_AUTOCOPY_TO);
$i = 0;
foreach ($listofemail as $key => $val) {
if ($i) {
print ', ';
}
$val = trim($val);
print $val;
if (!isValidEmail($val, 0, 1)) {
print img_warning($langs->trans("ErrorBadEMail", $val));
}
$i++;
}
} else {
print '&nbsp;';
@ -887,7 +897,6 @@ if ($action == 'edit') {
}
setEventMessages($errormsg, null, 'errors');
print $errormsg;
}
print '<br>';
}

View File

@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$langs->loadLangs(array('companies', 'products', 'admin', 'mails', 'other', 'errors'));
$action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'alpha');
$cancel = GETPOST('cancel', 'aZ09');
if (!$user->admin) {
accessforbidden();
@ -40,17 +40,22 @@ if (!$user->admin) {
$usersignature = $user->signature;
// For action = test or send, we ensure that content is not html, even for signature, because this we want a test with NO html.
if ($action == 'test' || $action == 'send') {
$usersignature = dol_string_nohtmltag($usersignature);
$usersignature = dol_string_nohtmltag($usersignature, 2);
}
$substitutionarrayfortest = array(
'__LOGIN__' => $user->login,
'__ID__' => 'TESTIdRecord',
'__EMAIL__' => 'TESTEMail',
'__LASTNAME__' => 'TESTLastname',
'__FIRSTNAME__' => 'TESTFirstname',
'__USER_SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? $usersignature : ''),
//'__PERSONALIZED__' => 'TESTPersonalized' // Hiden because not used yet
'__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT,
'__ID__' => 'RecipientIdRecord',
//'__EMAIL__' => 'RecipientEMail', // Done into actions_sendmails
'__CHECK_READ__' => (!empty($object) && is_object($object) && is_object($object->thirdparty)) ? '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$object->thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>' : '',
'__USER_SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? $usersignature : ''), // Done into actions_sendmails
'__LOGIN__' => $user->login,
'__LASTNAME__' => 'RecipientLastname',
'__FIRSTNAME__' => 'RecipientFirstname',
'__ADDRESS__'=> 'RecipientAddress',
'__ZIP__'=> 'RecipientZip',
'__TOWN_'=> 'RecipientTown',
'__COUNTRY__'=> 'RecipientCountry'
);
complete_substitutions_array($substitutionarrayfortest, $langs);
@ -86,10 +91,10 @@ $trackid = (($action == 'testhtml') ? "testhtml" : "test");
$sendcontext = 'emailing'; // Force to use dedicated context of setup for emailing
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
if ($action == 'presend' && GETPOST('trackid') == 'test') {
if ($action == 'presend' && GETPOST('trackid', 'alphanohtml') == 'test') {
$action = 'test';
}
if ($action == 'presend' && GETPOST('trackid') == 'testhtml') {
if ($action == 'presend' && GETPOST('trackid', 'alphanohtml') == 'testhtml') {
$action = 'testhtml';
}
@ -271,12 +276,15 @@ if ($action == 'edit') {
// Host server
print '<tr class="oddeven hideifdefault"><td>';
print '<tr class="oddeven hideifdefault">';
if (!$conf->use_javascript_ajax && $linuxlike && $conf->global->MAIN_MAIL_SENDMODE_EMAILING == 'mail') {
print '<td>';
print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike");
print '</td><td>';
print $langs->trans("SeeLocalSendMailSetup");
print '<span class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
print '</td>';
} else {
print '<td>';
$mainserver = (!empty($conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING) ? $conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING : '');
$smtpserver = ini_get('SMTP') ?ini_get('SMTP') : $langs->transnoentities("Undefined");
if ($linuxlike) {
@ -287,17 +295,19 @@ if ($action == 'edit') {
print '</td><td>';
// SuperAdministrator access only
if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) {
print '<input class="flat" id="MAIN_MAIL_SMTP_SERVER_EMAILING" name="MAIN_MAIL_SMTP_SERVER_EMAILING" size="18" value="'.$mainserver.'">';
print '<input class="flat minwidth300" id="MAIN_MAIL_SMTP_SERVER_EMAILING" name="MAIN_MAIL_SMTP_SERVER_EMAILING" size="18" value="'.$mainserver.'">';
print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_EMAILING_sav" name="MAIN_MAIL_SMTP_SERVER_EMAILING_sav" value="'.$mainserver.'">';
print '<span id="smtp_server_mess">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
print '<span id="smtp_server_mess" class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
print ' <span class="opacitymedium smtp_method">'.$langs->trans("SeeLinkToOnlineDocumentation").'</span>';
} else {
$text = !empty($mainserver) ? $mainserver : $smtpserver;
$htmltext = $langs->trans("ContactSuperAdminForChange");
print $form->textwithpicto($text, $htmltext, 1, 'superadmin');
print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_EMAILING" name="MAIN_MAIL_SMTP_SERVER_EMAILING" value="'.$mainserver.'">';
}
print '</td>';
}
print '</td></tr>';
print '</tr>';
// Port
@ -305,7 +315,7 @@ if ($action == 'edit') {
if (!$conf->use_javascript_ajax && $linuxlike && $conf->global->MAIN_MAIL_SENDMODE_EMAILING == 'mail') {
print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike");
print '</td><td>';
print $langs->trans("SeeLocalSendMailSetup");
print '<span class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
} else {
$mainport = (!empty($conf->global->MAIN_MAIL_SMTP_PORT_EMAILING) ? $conf->global->MAIN_MAIL_SMTP_PORT_EMAILING : '');
$smtpport = ini_get('smtp_port') ?ini_get('smtp_port') : $langs->transnoentities("Undefined");
@ -319,7 +329,7 @@ if ($action == 'edit') {
if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) {
print '<input class="flat" id="MAIN_MAIL_SMTP_PORT_EMAILING" name="MAIN_MAIL_SMTP_PORT_EMAILING" size="3" value="'.$mainport.'">';
print '<input type="hidden" id="MAIN_MAIL_SMTP_PORT_EMAILING_sav" name="MAIN_MAIL_SMTP_PORT_EMAILING_sav" value="'.$mainport.'">';
print '<span id="smtp_port_mess">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
print '<span id="smtp_port_mess" class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
} else {
$text = (!empty($mainport) ? $mainport : $smtpport);
$htmltext = $langs->trans("ContactSuperAdminForChange");
@ -360,7 +370,6 @@ if ($action == 'edit') {
}
// TLS
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_EMAIL_TLS").'</td><td>';
if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) {
if (function_exists('openssl_open')) {
@ -374,7 +383,6 @@ if ($action == 'edit') {
print '</td></tr>';
// STARTTLS
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").'</td><td>';
if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) {
if (function_exists('openssl_open')) {
@ -388,7 +396,6 @@ if ($action == 'edit') {
print '</td></tr>';
// SMTP_ALLOW_SELF_SIGNED_EMAILING
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").'</td><td>';
if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) {
if (function_exists('openssl_open')) {
@ -414,6 +421,7 @@ if ($action == 'edit') {
print '<span class="opacitymedium">'.$langs->trans("EMailsDesc")."</span><br>\n";
print "<br><br>\n";
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
@ -460,7 +468,7 @@ if ($action == 'edit') {
print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
}
} else {
print yn(0).' ('.$langs->trans("NotSupported").')';
print '<span class="opacitymedium">'.yn(0).' ('.$langs->trans("NotSupported").')</span>';
}
print '</td></tr>';
@ -492,6 +500,7 @@ if ($action == 'edit') {
}
print '</table>';
print '</div>';
print dol_get_fiche_end();
@ -543,6 +552,7 @@ if ($action == 'edit') {
// Run the test to connect
if ($action == 'testconnect') {
print '<div id="formmailaftertstconnect" name="formmailaftertstconnect"></div>';
print load_fiche_titre($langs->trans("DoTestServerAvailability"));
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
@ -573,16 +583,18 @@ if ($action == 'edit') {
// Cree l'objet formulaire mail
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
$formmail->trackid = (($action == 'testhtml') ? "testhtml" : "test");
$formmail->fromname = (GETPOSTISSET('fromname') ? GETPOST('fromname', 'restricthtml') : $conf->global->MAIN_MAIL_EMAIL_FROM);
$formmail->frommail = (GETPOSTISSET('frommail') ? GETPOST('frommail', 'restricthtml') : $conf->global->MAIN_MAIL_EMAIL_FROM);
$formmail->trackid = (($action == 'testhtml') ? "testhtml" : "test");
$formmail->fromid = $user->id;
$formmail->fromalsorobot = 1;
$formmail->withfromreadonly = 0;
$formmail->withsubstit = 0;
$formmail->withfrom = 1;
$formmail->witherrorsto = 1;
$formmail->withto = (!GETPOST('sendto') ? GETPOST('sendto', 'restricthtml') : ($user->email ? $user->email : 1));
$formmail->withtocc = (!GETPOST(['sendtocc']) ? GETPOST('sendtocc', 'restricthtml') : 1); // ! empty to keep field if empty
$formmail->withtoccc = (!GETPOST(['sendtoccc']) ? GETPOST('sendtoccc', 'restricthtml') : 1); // ! empty to keep field if empty
$formmail->withto = (GETPOSTISSET('sendto') ? GETPOST('sendto', 'restricthtml') : ($user->email ? $user->email : 1));
$formmail->withtocc = (GETPOSTISSET(['sendtocc']) ? GETPOST('sendtocc', 'restricthtml') : 1); // ! empty to keep field if empty
$formmail->withtoccc = (GETPOSTISSET(['sendtoccc']) ? GETPOST('sendtoccc', 'restricthtml') : 1); // ! empty to keep field if empty
$formmail->withtopic = (GETPOSTISSET('subject') ? GETPOST('subject') : $langs->trans("Test"));
$formmail->withtopicreadonly = 0;
$formmail->withfile = 2;
@ -601,7 +613,7 @@ if ($action == 'edit') {
$formmail->param["returnurl"] = $_SERVER["PHP_SELF"];
// Init list of files
if (GETPOST("mode") == 'init') {
if (GETPOST("mode", "aZ09") == 'init') {
$formmail->clear_attached_files();
}

View File

@ -205,7 +205,7 @@ if (!empty($conf->expedition->enabled)) {
$elementList['shipping_send'] = img_picto('', 'dolly', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendShipment'));
}
if (!empty($conf->reception->enabled)) {
$elementList['reception_send'] = img_picto('', 'dolly', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendReception'));
$elementList['reception_send'] = img_picto('', 'dollyrevert', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendReception'));
}
if (!empty($conf->ficheinter->enabled)) {
$elementList['fichinter_send'] = img_picto('', 'intervention', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendIntervention'));

View File

@ -332,8 +332,8 @@ foreach ($TCurrency as &$currency) {
print '<input type="hidden" name="fk_multicurrency" value="'.$currency->id.'">';
print '1 '.$conf->currency.' = ';
print '<input type="text" name="rate" class="width75 right" value="'.($currency->rate->rate ? $currency->rate->rate : '').'" size="13">&nbsp;'.$currency->code.'&nbsp;';
print '<input type="submit" name="updatecurrency" class="button button-edit" value="'.$langs->trans("Modify").'">&nbsp;';
print '<input type="submit" name="deletecurrency" class="button" value="'.$langs->trans("Delete").'">';
print '<input type="submit" name="updatecurrency" class="button button-edit smallpaddingimp" value="'.$langs->trans("Modify").'">&nbsp;';
print '<input type="submit" name="deletecurrency" class="button smallpaddingimp" value="'.$langs->trans("Delete").'">';
print '</form>';
print '</td></tr>';
}

View File

@ -267,6 +267,7 @@ $constantes = array();
foreach ($listofnotifiedevents as $notifiedevent) {
$label = $langs->trans("Notify_".$notifiedevent['code']); //!=$langs->trans("Notify_".$notifiedevent['code'])?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label'];
$elementLabel = $langs->trans(ucfirst($notifiedevent['elementtype']));
$model = $notifiedevent['elementtype'].'_send';
if ($notifiedevent['elementtype'] == 'order_supplier') {
$elementLabel = $langs->trans('SupplierOrder');

View File

@ -36,6 +36,14 @@ if (!$user->admin) {
}
$action = GETPOST('action', 'aZ09');
$sortfield = GETPOST('sortfield', 'aZ09');
$sortorder = GETPOST('sortorder', 'aZ09');
if (empty($sortfield)) {
$sortfield = 'date';
}
if (empty($sortorder)) {
$sortorder = 'desc';
}
$upload_dir = $conf->admin->dir_temp;
@ -73,8 +81,6 @@ if ($action == 'updateform') {
} else {
setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile', 'alpha')), null, 'errors');
}
Header('Location: '.$_SERVER["PHP_SELF"]);
exit;
}
@ -190,7 +196,7 @@ $formfile = new FormFile($db);
$formfile->form_attach_new_file($_SERVER['PHP_SELF'], $langs->trans("FormToTestFileUploadForm"), 0, 0, 1, 50, '', '', 1, '', 0);
// List of document
$filearray = dol_dir_list($upload_dir, "files", 0, '', '', 'name', SORT_ASC, 1);
$filearray = dol_dir_list($upload_dir, "files", 0, '', '', $sortfield, $sortorder == 'desc' ? SORT_DESC : SORT_ASC, 1);
$formfile->list_of_documents($filearray, null, 'admin_temp', '');
// End of page

View File

@ -203,6 +203,12 @@ if ($action == 'setvarother') {
if (!($res > 0)) {
$error++;
}
$param_auto_notify_close = GETPOST('TICKET_NOTIFY_AT_CLOSING', 'alpha');
$res = dolibarr_set_const($db, 'TICKET_NOTIFY_AT_CLOSING', $param_auto_notify_close, 'chaine', 0, '', $conf->entity);
if (!($res > 0)) {
$error++;
}
}
@ -530,6 +536,21 @@ print $form->textwithpicto('', $langs->trans("TicketsAutoAssignTicketHelp"), 1,
print '</td>';
print '</tr>';
// Auto notify contacts when closing the ticket
print '<tr class="oddeven"><td>'.$langs->trans("TicketsAutoNotifyClose").'</td>';
print '<td class="left">';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('TICKET_NOTIFY_AT_CLOSING');
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("TICKET_NOTIFY_AT_CLOSING", $arrval, $conf->global->TICKET_NOTIFY_AT_CLOSING);
}
print '</td>';
print '<td class="center">';
print $form->textwithpicto('', $langs->trans("TicketsAutoNotifyCloseHelp"), 1, 'help');
print '</td>';
print '</tr>';
if (!$conf->use_javascript_ajax) {
print '</form>';
}

View File

@ -327,33 +327,6 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
print $form->textwithpicto('', $langs->trans("TicketPublicInterfaceTextHelpMessageHelpAdmin"), 1, 'help');
print '</td></tr>';
// Activate email creation to user
print '<tr class="pair"><td>'.$langs->trans("TicketsDisableCustomerEmail").'</td>';
print '<td class="left">';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('TICKET_DISABLE_CUSTOMER_MAILS');
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("TICKET_DISABLE_CUSTOMER_MAILS", $arrval, $conf->global->TICKET_DISABLE_CUSTOMER_MAILS);
}
print '</td>';
print '<td class="center">';
print $form->textwithpicto('', $langs->trans("TicketsDisableEmailHelp"), 1, 'help');
print '</td>';
print '</tr>';
// Texte de création d'un ticket
$mail_mesg_new = $conf->global->TICKET_MESSAGE_MAIL_NEW ? $conf->global->TICKET_MESSAGE_MAIL_NEW : $langs->trans('TicketNewEmailBody');
print '<tr><td>'.$langs->trans("TicketNewEmailBodyLabel").'</label>';
print '</td><td>';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor('TICKET_MESSAGE_MAIL_NEW', $mail_mesg_new, '100%', 120, 'dolibarr_mailings', '', false, true, $conf->global->FCKEDITOR_ENABLE_MAIL, ROWS_2, 70);
$doleditor->Create();
print '</td>';
print '<td class="center">';
print $form->textwithpicto('', $langs->trans("TicketNewEmailBodyHelp"), 1, 'help');
print '</td></tr>';
// Url public interface
$url_interface = $conf->global->TICKET_URL_PUBLIC_INTERFACE;
print '<tr><td>'.$langs->trans("TicketUrlPublicInterfaceLabelAdmin").'</label>';
@ -364,8 +337,45 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
print $form->textwithpicto('', $langs->trans("TicketUrlPublicInterfaceHelpAdmin"), 1, 'help');
print '</td></tr>';
print '</table>';
print '<br><br>';
print_fiche_titre($langs->trans("Emails"));
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
// Activate email creation to user
print '<tr class="pair"><td>';
print $form->textwithpicto($langs->trans("TicketsDisableCustomerEmail"), $langs->trans("TicketsDisableEmailHelp"), 1, 'help');
print '</td>';
print '<td class="left">';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('TICKET_DISABLE_CUSTOMER_MAILS');
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("TICKET_DISABLE_CUSTOMER_MAILS", $arrval, $conf->global->TICKET_DISABLE_CUSTOMER_MAILS);
}
print '</td>';
print '</tr>';
// Text of email after creatio of a ticket
$mail_mesg_new = $conf->global->TICKET_MESSAGE_MAIL_NEW ? $conf->global->TICKET_MESSAGE_MAIL_NEW : $langs->trans('TicketNewEmailBody');
print '<tr><td>';
print $form->textwithpicto($langs->trans("TicketNewEmailBodyLabel"), $langs->trans("TicketNewEmailBodyHelp"), 1, 'help');
print '</label>';
print '</td><td>';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor('TICKET_MESSAGE_MAIL_NEW', $mail_mesg_new, '100%', 120, 'dolibarr_mailings', '', false, true, $conf->global->FCKEDITOR_ENABLE_MAIL, ROWS_2, 70);
$doleditor->Create();
print '</td>';
print '</tr>';
// Activate email notification when a new message is added
print '<tr class="pair"><td>'.$langs->trans("TicketsPublicNotificationNewMessage").'</td>';
print '<tr class="pair"><td>';
print $form->textwithpicto($langs->trans("TicketsPublicNotificationNewMessage"), $langs->trans("TicketsPublicNotificationNewMessageHelp"), 1, 'help');
print '</td>';
print '<td class="left">';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED');
@ -374,19 +384,15 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
print $form->selectarray("TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED", $arrval, $conf->global->TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED);
}
print '</td>';
print '<td align="center">';
print $form->textwithpicto('', $langs->trans("TicketsPublicNotificationNewMessageHelp"), 1, 'help');
print '</td>';
print '</tr>';
// Send notification when a new message is added to a email if a user is not assigned to the ticket
print '<tr><td>'.$langs->trans("TicketPublicNotificationNewMessageDefaultEmail").'</label>';
print '<tr><td>';
print $form->textwithpicto($langs->trans("TicketPublicNotificationNewMessageDefaultEmail"), $langs->trans("TicketPublicNotificationNewMessageDefaultEmailHelp"), 1, 'help');
print '</td><td>';
print '<input type="text" name="TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL" value="'.$conf->global->TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL.'" size="40" ></td>';
print '</td>';
print '<td align="center">';
print $form->textwithpicto('', $langs->trans("TicketPublicNotificationNewMessageDefaultEmailHelp"), 1, 'help');
print '</td></tr>';
print '</tr>';
print '</table>';
print '</div>';

View File

@ -137,7 +137,8 @@ $dirtocompress = basename($fulldirtocompress);
if ($compression == 'zip') {
$file .= '.zip';
$excludefiles = '/(\.back|\.old|\.log|\.pdf_preview-.*\.png|[\/\\\]temp[\/\\\]|documents[\/\\\]admin[\/\\\]documents[\/\\\])/i';
$excludefiles = '/(\.back|\.old|\.log|\.pdf_preview-.*\.png|[\/\\\]temp[\/\\\]|[\/\\\]admin[\/\\\]documents[\/\\\])/i';
//var_dump($fulldirtocompress);
//var_dump($outputdir."/".$file);exit;

View File

@ -41,7 +41,7 @@ https://**yourdolibarr.tld**/mydolibarr/api/index.php/otherservice?DOLAPIKEY=**a
Develop an API
--------------
The API uses Lucarast Restler framework. Please check documentation https://www.luracast.com/products/restler and examples http://help.luracast.com/restler/examples/
The API uses Lucarast Restler framework. Please check documentation https://www.luracast.com/products/restler and examples https://restler3.luracast.com/examples/index.html
Github contains also useful information : https://github.com/Luracast/Restler

View File

@ -23,7 +23,7 @@ if (empty($conf) || !is_object($conf)) {
exit;
}
print "<!-- BEGIN PHP TEMPLATE commande/tpl/linkedopjectblock.tpl.php -->\n";
print "<!-- BEGIN PHP TEMPLATE commande/tpl/linkedobjectblock.tpl.php -->\n";
global $user;
global $noMoreLinkedObjectBlockAfter;

View File

@ -24,7 +24,7 @@ if (empty($conf) || !is_object($conf)) {
exit;
}
print "<!-- BEGIN PHP TEMPLATE bom/tpl/linkedopjectblock.tpl.php -->\n";
print "<!-- BEGIN PHP TEMPLATE bom/tpl/linkedobjectblock.tpl.php -->\n";
global $user, $db;
global $noMoreLinkedObjectBlockAfter;

View File

@ -1,36 +0,0 @@
CACHE MANIFEST
# version 2013-05-21 13:30:21
# Note: If this file is dynamic, it must return MIME text/cache-manifest
# Note: Order of CACHE, NETWORK and FALLBACK section does not change behaviour
" Note:
# Files listed under CACHE will be ALWAYS cached after they are loaded.
# And they will be always used from Cache after (even after refresh).
CACHE:
theme/dolibarr_logo.svg
support/
support/index.php
support/default.css
support/helpcenter.png
support/internet.png
support/mail.png
support/pagemaster.png
support/redstar.png
support/star.png
support/who.png
# The NETWORK section contains the path to a folder to ensure that requests
# to load resources will use internet.
# CACHE has priority on NETWORK, so usage is useless
NETWORK:
/
# The FALLBACK section contains entries that provide a backup strategy.
# If the browser is unable to retrieve the original content, the fallback resource will be used.
# In the example above, we display a static image in case the dynamic one is unavailable.
FALLBACK:
#/ public/notice.php
#theme/eldy/img/* theme/md/img/*

View File

@ -133,7 +133,9 @@ if (empty($nosearch)) {
print '</span>';
print "</td>\n";
print "\t\t<td>";
print dolGetFirstLineOfText($cat->description);
$text = dolGetFirstLineOfText(dol_string_nohtmltag($cat->description, 1));
$trunclength = 48;
print $form->textwithtooltip(dol_trunc($text, $trunclength), $cat->description);
print "</td>\n";
print "\t</tr>\n";
}

View File

@ -186,35 +186,55 @@ class CActionComm
$qualified = 1;
// $obj->type can be system, systemauto, module, moduleauto, xxx, xxxauto
// $obj->type can be 'system', 'systemauto', 'module', 'moduleauto', 'xxx', 'xxxauto'
// Note: type = system... than type of event is added among other standard events.
// type = module... then type of event is grouped into module defined into module = myobject@mymodule. Example: Event organization or external modules
// type = xxx... then type of event is added into list as a new flat value (not grouped). Example: Agefod external module
if ($qualified && $onlyautoornot > 0 && preg_match('/^system/', $obj->type) && !preg_match('/^AC_OTH/', $obj->code)) {
$qualified = 0; // We discard detailed system events. We keep only the 2 generic lines (AC_OTH and AC_OTH_AUTO)
}
if ($qualified && !empty($obj->module)) {
if ($obj->module == 'invoice' && empty($conf->facture->enabled) && empty($user->facture->lire)) {
$qualified = 0;
//var_dump($obj->type.' '.$obj->module.' '); var_dump($user->rights->facture->lire);
$qualified = 0;
// Special cases
if ($obj->module == 'invoice' && !empty($conf->facture->enabled) && !empty($user->rights->facture->lire)) {
$qualified = 1;
}
if ($obj->module == 'order' && empty($conf->commande->enabled) && empty($user->commande->lire)) {
$qualified = 0;
if ($obj->module == 'order' && !empty($conf->commande->enabled) && empty($user->rights->commande->lire)) {
$qualified = 1;
}
if ($obj->module == 'propal' && empty($conf->propal->enabled) && empty($user->propale->lire)) {
$qualified = 0;
if ($obj->module == 'propal' && !empty($conf->propal->enabled) && !empty($user->rights->propale->lire)) {
$qualified = 1;
}
if ($obj->module == 'invoice_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && empty($user->fournisseur->facture->lire)) || (!empty($conf->supplier_invoice->enabled) && empty($user->supplier_invoice->lire)))) {
$qualified = 0;
if ($obj->module == 'invoice_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && !empty($user->rights->fournisseur->facture->lire)) || (!empty($conf->rights->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire)))) {
$qualified = 1;
}
if ($obj->module == 'order_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && empty($user->fournisseur->commande->lire)) || (empty($conf->supplier_order->enabled) && empty($user->supplier_order->lire)))) {
$qualified = 0;
if ($obj->module == 'order_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && !empty($user->rights->fournisseur->commande->lire)) || (empty($conf->rights->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)))) {
$qualified = 1;
}
if ($obj->module == 'shipping' && empty($conf->expedition->enabled) && empty($user->expedition->lire)) {
$qualified = 0;
if ($obj->module == 'shipping' && !empty($conf->expedition->enabled) && !empty($user->rights->expedition->lire)) {
$qualified = 1;
}
if (preg_match('/@eventorganization/', $obj->module) && empty($conf->eventorganization->enabled) && empty($user->eventorganization->read)) {
$qualified = 0;
// For the generic case with type = 'module...' and module = 'myobject@mymodule'
$regs = array();
if (preg_match('/^module/', $obj->type)) {
if (preg_match('/^(.+)@(.+)$/', $obj->module, $regs)) {
$tmpobject = $regs[1];
$tmpmodule = $regs[2];
//var_dump($user->$tmpmodule);
if ($tmpmodule && isset($conf->$tmpmodule) && !empty($conf->$tmpmodule->enabled) && (!empty($user->rights->$tmpmodule->read) || !empty($user->rights->$tmpmodule->lire) || !empty($user->rights->$tmpmodule->$tmpobject->read) || !empty($user->rights->$tmpmodule->$tmpobject->lire))) {
$qualified = 1;
}
}
}
if (!preg_match('/^system/', $obj->type) && isset($conf->{$obj->module}) && empty($conf->{$obj->module}->enabled)) {
$qualified = 0;
// For the case type is not 'system...' neither 'module', we just check module is on
if (! in_array($obj->type, array('system', 'systemauto', 'module', 'moduleauto'))) {
$tmpmodule = $obj->module;
//var_dump($tmpmodule);
if ($tmpmodule && isset($conf->$tmpmodule) && !empty($conf->$tmpmodule->enabled)) {
$qualified = 1;
}
}
}

View File

@ -49,10 +49,11 @@ if (empty($conf->global->AGENDA_EXT_NB)) {
}
$MAXAGENDA = $conf->global->AGENDA_EXT_NB;
$filter = GETPOST("search_filter", 'alpha', 3) ?GETPOST("search_filter", 'alpha', 3) : GETPOST("filter", 'alpha', 3);
$filtert = GETPOST("search_filtert", "int", 3) ?GETPOST("search_filtert", "int", 3) : GETPOST("filtert", "int", 3);
$usergroup = GETPOST("search_usergroup", "int", 3) ?GETPOST("search_usergroup", "int", 3) : GETPOST("usergroup", "int", 3);
$showbirthday = empty($conf->use_javascript_ajax) ?GETPOST("showbirthday", "int") : 1;
$check_holiday = GETPOST('check_holiday', 'int');
$filter = GETPOST("search_filter", 'alpha', 3) ? GETPOST("search_filter", 'alpha', 3) : GETPOST("filter", 'alpha', 3);
$filtert = GETPOST("search_filtert", "int", 3) ? GETPOST("search_filtert", "int", 3) : GETPOST("filtert", "int", 3);
$usergroup = GETPOST("search_usergroup", "int", 3) ? GETPOST("search_usergroup", "int", 3) : GETPOST("usergroup", "int", 3);
$showbirthday = empty($conf->use_javascript_ajax) ? GETPOST("showbirthday", "int") : 1;
// If not choice done on calendar owner (like on left menu link "Agenda"), we filter on user.
if (empty($filtert) && empty($conf->global->AGENDA_ALL_CALENDARS)) {
@ -207,16 +208,16 @@ if (GETPOST("viewperuser", 'alpha') || $mode == 'show_peruser') {
}
/*
if ($action == 'delete_action' && $user->rights->agenda->delete) {
$event = new ActionComm($db);
$event->fetch($actionid);
$event->fetch_optionals();
$event->fetch_userassigned();
$event->oldcopy = clone $event;
if ($action == 'delete_action' && $user->rights->agenda->delete) {
$event = new ActionComm($db);
$event->fetch($actionid);
$event->fetch_optionals();
$event->fetch_userassigned();
$event->oldcopy = clone $event;
$result = $event->delete();
}
*/
$result = $event->delete();
}
*/
/*
@ -579,10 +580,10 @@ if (!empty($conf->use_javascript_ajax)) { // If javascript on
$s .= '</script>'."\n";
// Local calendar
$s .= '<div class="nowrap inline-block minheight30"><input type="checkbox" id="check_mytasks" name="check_mytasks" checked disabled> '.$langs->trans("LocalAgenda").' &nbsp; </div>';
$s .= '<div class="nowrap inline-block minheight30"><input type="checkbox" id="check_mytasks" name="check_mytasks" value="1" checked disabled> '.$langs->trans("LocalAgenda").' &nbsp; </div>';
// Holiday calendar
$s .= '<div class="nowrap inline-block minheight30"><input type="checkbox" id="check_holiday" name="check_holiday" class="check_holiday"><label for="check_holiday"> <span class="check_holiday_text">'.$langs->trans("Holidays").'</span></label> &nbsp; </div>';
$s .= '<div class="nowrap inline-block minheight30"><input type="checkbox" id="check_holiday" name="check_holiday" value="1" class="check_holiday"'.($check_holiday ? ' checked' : '').'><label for="check_holiday"> <span class="check_holiday_text">'.$langs->trans("Holidays").'</span></label> &nbsp; </div>';
// External calendars
if (is_array($showextcals) && count($showextcals) > 0) {
@ -607,13 +608,13 @@ if (!empty($conf->use_javascript_ajax)) { // If javascript on
foreach ($showextcals as $val) {
$htmlname = md5($val['name']);
if (!empty($val['default'])) {
if (!empty($val['default']) || GETPOST('check_ext'.$htmlname, 'int')) {
$default = "checked";
} else {
$default = '';
}
$s .= '<div class="nowrap inline-block minheight30"><input type="checkbox" id="check_ext'.$htmlname.'" name="check_ext'.$htmlname.'" '.$default.'> <label for="check_ext'.$htmlname.'">'.$val['name'].'</label> &nbsp; </div>';
$s .= '<div class="nowrap inline-block minheight30"><input type="checkbox" id="check_ext'.$htmlname.'" name="check_ext'.$htmlname.'" value="1" '.$default.'> <label for="check_ext'.$htmlname.'">'.$val['name'].'</label> &nbsp; </div>';
}
}
@ -848,6 +849,7 @@ if ($resql) {
$event->fk_project = $obj->fk_project;
$event->socid = $obj->fk_soc;
$event->thirdparty_id = $obj->fk_soc;
$event->contact_id = $obj->fk_contact;
// Defined date_start_in_calendar and date_end_in_calendar property
@ -890,13 +892,13 @@ if ($resql) {
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee, 'gmt'); // $mois, $jour, $annee has been set for user tz
$daykeyend = dol_mktime(0, 0, 0, $moisend, $jourend, $anneeend, 'gmt'); // $moisend, $jourend, $anneeend has been set for user tz
/*
print 'GMT '.$event->date_start_in_calendar.' '.dol_print_date($event->date_start_in_calendar, 'dayhour', 'gmt').'<br>';
print 'TZSERVER '.$event->date_start_in_calendar.' '.dol_print_date($event->date_start_in_calendar, 'dayhour', 'tzserver').'<br>';
print 'TZUSERREL '.$event->date_start_in_calendar.' '.dol_print_date($event->date_start_in_calendar, 'dayhour', 'tzuserrel').'<br>';
print 'GMT '.$event->date_end_in_calendar.' '.dol_print_date($event->date_end_in_calendar, 'dayhour', 'gmt').'<br>';
print 'TZSERVER '.$event->date_end_in_calendar.' '.dol_print_date($event->date_end_in_calendar, 'dayhour', 'tzserver').'<br>';
print 'TZUSER '.$event->date_end_in_calendar.' '.dol_print_date($event->date_end_in_calendar, 'dayhour', 'tzuserrel').'<br>';
*/
print 'GMT '.$event->date_start_in_calendar.' '.dol_print_date($event->date_start_in_calendar, 'dayhour', 'gmt').'<br>';
print 'TZSERVER '.$event->date_start_in_calendar.' '.dol_print_date($event->date_start_in_calendar, 'dayhour', 'tzserver').'<br>';
print 'TZUSERREL '.$event->date_start_in_calendar.' '.dol_print_date($event->date_start_in_calendar, 'dayhour', 'tzuserrel').'<br>';
print 'GMT '.$event->date_end_in_calendar.' '.dol_print_date($event->date_end_in_calendar, 'dayhour', 'gmt').'<br>';
print 'TZSERVER '.$event->date_end_in_calendar.' '.dol_print_date($event->date_end_in_calendar, 'dayhour', 'tzserver').'<br>';
print 'TZUSER '.$event->date_end_in_calendar.' '.dol_print_date($event->date_end_in_calendar, 'dayhour', 'tzuserrel').'<br>';
*/
do {
//if ($event->id==408)
//print 'daykey='.$daykey.' daykeyend='.$daykeyend.' '.dol_print_date($daykey, 'dayhour', 'gmt').' - '.dol_print_date($event->datep, 'dayhour', 'gmt').' '.dol_print_date($event->datef, 'dayhour', 'gmt').'<br>';

View File

@ -943,8 +943,8 @@ while ($i < min($num, $limit)) {
// Description
if (!empty($arrayfields['a.note']['checked'])) {
print '<td class="tdoverflowonsmartphone">';
$text = dolGetFirstLineOfText(dol_string_nohtmltag($actionstatic->note_private, 0));
print $form->textwithtooltip(dol_trunc($text, 40), $actionstatic->note_private);
$text = dolGetFirstLineOfText(dol_string_nohtmltag($actionstatic->note_private, 1));
print $form->textwithtooltip(dol_trunc($text, 48), $actionstatic->note_private);
print '</td>';
}

View File

@ -10,6 +10,7 @@
* Copyright (C) 2015-2021 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2020 Open-Dsi <support@open-dsi.fr>
* Copyright (C) 2022 Anthony Berton <anthony.berton@bb2a.fr>
*
* 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
@ -38,6 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
if (!empty($conf->facture->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
}
@ -112,6 +114,7 @@ $cancel = GETPOST('cancel', 'alpha');
$object = new Client($db);
$extrafields = new ExtraFields($db);
$formfile = new FormFile($db);
// fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);
@ -859,6 +862,36 @@ if ($object->id > 0) {
$propal_static->total_tva = $objp->total_tva;
$propal_static->total_ttc = $objp->total_ttc;
print $propal_static->getNomUrl(1);
// Preview
$filedir = $conf->propal->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref);
$file_list = null;
if (!empty($filedir)) {
$file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
}
if (is_array($file_list)) {
// Defined relative dir to DOL_DATA_ROOT
$relativedir = '';
if ($filedir) {
$relativedir = preg_replace('/^'.preg_quote(DOL_DATA_ROOT, '/').'/', '', $filedir);
$relativedir = preg_replace('/^[\\/]/', '', $relativedir);
}
// Get list of files stored into database for same relative directory
if ($relativedir) {
completeFileArrayWithDatabaseInfo($file_list, $relativedir);
//var_dump($sortfield.' - '.$sortorder);
if (!empty($sortfield) && !empty($sortorder)) { // If $sortfield is for example 'position_name', we will sort on the property 'position_name' (that is concat of position+name)
$file_list = dol_sort_array($file_list, $sortfield, $sortorder);
}
}
$relativepath = dol_sanitizeFileName($objp->ref).'/'.dol_sanitizeFileName($objp->ref).'.pdf';
print $formfile->showPreview($file_list, $propal_static->element, $relativepath, 0, $param);
}
// $filename = dol_sanitizeFileName($objp->ref);
// $filedir = $conf->propal->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref);
// $urlsource = '/comm/propal/card.php?id='.$objp->cid;
// print $formfile->getDocumentsLink($propal_static->element, $filename, $filedir);
if (($db->jdate($objp->date_limit) < ($now - $conf->propal->cloture->warning_delay)) && $objp->fk_statut == $propal_static::STATUS_VALIDATED) {
print " ".img_warning();
}
@ -940,7 +973,38 @@ if ($object->id > 0) {
print '<tr class="oddeven">';
print '<td class="nowraponall">';
print $commande_static->getNomUrl(1);
print '</td><td class="right" width="80px">'.dol_print_date($db->jdate($objp->dc), 'day')."</td>\n";
// Preview
$filedir = $conf->commande->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref);
$file_list = null;
if (!empty($filedir)) {
$file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
}
if (is_array($file_list)) {
// Defined relative dir to DOL_DATA_ROOT
$relativedir = '';
if ($filedir) {
$relativedir = preg_replace('/^'.preg_quote(DOL_DATA_ROOT, '/').'/', '', $filedir);
$relativedir = preg_replace('/^[\\/]/', '', $relativedir);
}
// Get list of files stored into database for same relative directory
if ($relativedir) {
completeFileArrayWithDatabaseInfo($file_list, $relativedir);
//var_dump($sortfield.' - '.$sortorder);
if (!empty($sortfield) && !empty($sortorder)) { // If $sortfield is for example 'position_name', we will sort on the property 'position_name' (that is concat of position+name)
$file_list = dol_sort_array($file_list, $sortfield, $sortorder);
}
}
$relativepath = dol_sanitizeFileName($objp->ref).'/'.dol_sanitizeFileName($objp->ref).'.pdf';
print $formfile->showPreview($file_list, $commande_static->element, $relativepath, 0, $param);
}
// $filename = dol_sanitizeFileName($objp->ref);
// $filedir = $conf->order->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref);
// $urlsource = '/commande/card.php?id='.$objp->cid;
// print $formfile->getDocumentsLink($commande_static->element, $filename, $filedir);
print '</td>';
print '<td class="right" width="80px">'.dol_print_date($db->jdate($objp->dc), 'day')."</td>\n";
print '<td class="right" style="min-width: 60px">'.price($objp->total_ht).'</td>';
print '<td class="right" style="min-width: 60px" class="nowrap">'.$commande_static->LibStatut($objp->fk_statut, $objp->facture, 5).'</td></tr>';
$i++;
@ -1003,6 +1067,35 @@ if ($object->id > 0) {
print '<tr class="oddeven">';
print '<td class="nowraponall">';
print $sendingstatic->getNomUrl(1);
// Preview
$filedir = $conf->expedition->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref);
$file_list = null;
if (!empty($filedir)) {
$file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
}
if (is_array($file_list)) {
// Defined relative dir to DOL_DATA_ROOT
$relativedir = '';
if ($filedir) {
$relativedir = preg_replace('/^'.preg_quote(DOL_DATA_ROOT, '/').'/', '', $filedir);
$relativedir = preg_replace('/^[\\/]/', '', $relativedir);
}
// Get list of files stored into database for same relative directory
if ($relativedir) {
completeFileArrayWithDatabaseInfo($file_list, $relativedir);
//var_dump($sortfield.' - '.$sortorder);
if (!empty($sortfield) && !empty($sortorder)) { // If $sortfield is for example 'position_name', we will sort on the property 'position_name' (that is concat of position+name)
$file_list = dol_sort_array($file_list, $sortfield, $sortorder);
}
}
$relativepath = dol_sanitizeFileName($objp->ref).'/'.dol_sanitizeFileName($objp->ref).'.pdf';
print $formfile->showPreview($file_list, $sendingstatic->element, $relativepath, 0, $param);
}
// $filename = dol_sanitizeFileName($objp->ref);
// $filedir = $conf->expedition->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref);
// $urlsource = '/expedition/card.php?id='.$objp->cid;
// print $formfile->getDocumentsLink($sendingstatic->element, $filename, $filedir);
print '</td>';
if ($objp->date_creation > 0) {
print '<td class="right" width="80px">'.dol_print_date($db->jdate($objp->date_creation), 'day').'</td>';
@ -1076,6 +1169,35 @@ if ($object->id > 0) {
print '<tr class="oddeven">';
print '<td class="nowraponall">';
print $contrat->getNomUrl(1, 12);
// Preview
$filedir = $conf->contrat->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref);
$file_list = null;
if (!empty($filedir)) {
$file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
}
if (is_array($file_list)) {
// Defined relative dir to DOL_DATA_ROOT
$relativedir = '';
if ($filedir) {
$relativedir = preg_replace('/^'.preg_quote(DOL_DATA_ROOT, '/').'/', '', $filedir);
$relativedir = preg_replace('/^[\\/]/', '', $relativedir);
}
// Get list of files stored into database for same relative directory
if ($relativedir) {
completeFileArrayWithDatabaseInfo($file_list, $relativedir);
//var_dump($sortfield.' - '.$sortorder);
if (!empty($sortfield) && !empty($sortorder)) { // If $sortfield is for example 'position_name', we will sort on the property 'position_name' (that is concat of position+name)
$file_list = dol_sort_array($file_list, $sortfield, $sortorder);
}
}
$relativepath = dol_sanitizeFileName($objp->ref).'/'.dol_sanitizeFileName($objp->ref).'.pdf';
print $formfile->showPreview($file_list, $contrat->element, $relativepath, 0, $param);
}
// $filename = dol_sanitizeFileName($objp->ref);
// $filedir = $conf->contrat->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref);
// $urlsource = '/contrat/card.php?id='.$objp->cid;
// print $formfile->getDocumentsLink($contrat->element, $filename, $filedir);
print $late;
print "</td>\n";
print '<td class="nowrap">'.dol_trunc($objp->refsup, 12)."</td>\n";
@ -1137,6 +1259,35 @@ if ($object->id > 0) {
print '<tr class="oddeven">';
print '<td class="nowraponall">';
print $fichinter_static->getNomUrl(1);
// Preview
$filedir = $conf->fichinter->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref);
$file_list = null;
if (!empty($filedir)) {
$file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
}
if (is_array($file_list)) {
// Defined relative dir to DOL_DATA_ROOT
$relativedir = '';
if ($filedir) {
$relativedir = preg_replace('/^'.preg_quote(DOL_DATA_ROOT, '/').'/', '', $filedir);
$relativedir = preg_replace('/^[\\/]/', '', $relativedir);
}
// Get list of files stored into database for same relative directory
if ($relativedir) {
completeFileArrayWithDatabaseInfo($file_list, $relativedir);
//var_dump($sortfield.' - '.$sortorder);
if (!empty($sortfield) && !empty($sortorder)) { // If $sortfield is for example 'position_name', we will sort on the property 'position_name' (that is concat of position+name)
$file_list = dol_sort_array($file_list, $sortfield, $sortorder);
}
}
$relativepath = dol_sanitizeFileName($objp->ref).'/'.dol_sanitizeFileName($objp->ref).'.pdf';
print $formfile->showPreview($file_list, $fichinter_static->element, $relativepath, 0, $param);
}
// $filename = dol_sanitizeFileName($objp->ref);
// $filedir = $conf->fichinter->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref);
// $urlsource = '/fichinter/card.php?id='.$objp->cid;
// print $formfile->getDocumentsLink($fichinter_static->element, $filename, $filedir);
print '</td>'."\n";
//print '<td class="right" width="80px">'.dol_print_date($db->jdate($objp->startdate)).'</td>'."\n";
print '<td class="right" style="min-width: 60px">'.convertSecondToTime($objp->duration).'</td>'."\n";
@ -1213,6 +1364,7 @@ if ($object->id > 0) {
print '<td class="nowrap">';
print $invoicetemplate->getNomUrl(1);
print '</td>';
if ($objp->frequency && $objp->date_last_gen > 0) {
print '<td class="right" width="80px">'.dol_print_date($db->jdate($objp->date_last_gen), 'day').'</td>';
} else {
@ -1301,6 +1453,35 @@ if ($object->id > 0) {
print '<tr class="oddeven">';
print '<td class="nowraponall">';
print $facturestatic->getNomUrl(1);
// Preview
$filedir = $conf->facture->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref);
$file_list = null;
if (!empty($filedir)) {
$file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
}
if (is_array($file_list)) {
// Defined relative dir to DOL_DATA_ROOT
$relativedir = '';
if ($filedir) {
$relativedir = preg_replace('/^'.preg_quote(DOL_DATA_ROOT, '/').'/', '', $filedir);
$relativedir = preg_replace('/^[\\/]/', '', $relativedir);
}
// Get list of files stored into database for same relative directory
if ($relativedir) {
completeFileArrayWithDatabaseInfo($file_list, $relativedir);
//var_dump($sortfield.' - '.$sortorder);
if (!empty($sortfield) && !empty($sortorder)) { // If $sortfield is for example 'position_name', we will sort on the property 'position_name' (that is concat of position+name)
$file_list = dol_sort_array($file_list, $sortfield, $sortorder);
}
}
$relativepath = dol_sanitizeFileName($objp->ref).'/'.dol_sanitizeFileName($objp->ref).'.pdf';
print $formfile->showPreview($file_list, $facturestatic->element, $relativepath, 0, $param);
}
// $filename = dol_sanitizeFileName($objp->ref);
// $filedir = $conf->facture->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref);
// $urlsource = '/compta/facture/card.php?id='.$objp->cid;
//print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir);
print '</td>';
if ($objp->df > 0) {
print '<td class="right" width="80px">'.dol_print_date($db->jdate($objp->df), 'day').'</td>';

View File

@ -30,7 +30,7 @@ if (empty($conf) || !is_object($conf)) {
}
print "<!-- BEGIN PHP TEMPLATE comm/propal/tpl/linkedopjectblock.tpl.php -->\n";
print "<!-- BEGIN PHP TEMPLATE comm/propal/tpl/linkedobjectblock.tpl.php -->\n";
global $user;

View File

@ -1369,7 +1369,7 @@ if (empty($reshook)) {
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to build doc
$upload_dir = !empty($conf->propal->multidir_output[$object->entity])?$conf->propal->multidir_output[$object->entity]:$conf->propal->dir_output;
$upload_dir = !empty($conf->commande->multidir_output[$object->entity])?$conf->commande->multidir_output[$object->entity]:$conf->commande->dir_output;
$permissiontoadd = $usercancreate;
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';

View File

@ -3666,9 +3666,10 @@ class Commande extends CommonOrder
* @param int $notooltip 1=Disable tooltip
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @param int $addlinktonotes Add link to notes
* @param string $target attribute target for link
* @return string String with URL
*/
public function getNomUrl($withpicto = 0, $option = '', $max = 0, $short = 0, $notooltip = 0, $save_lastsearch_value = -1, $addlinktonotes = 0)
public function getNomUrl($withpicto = 0, $option = '', $max = 0, $short = 0, $notooltip = 0, $save_lastsearch_value = -1, $addlinktonotes = 0, $target = '')
{
global $conf, $langs, $user, $hookmanager;
@ -3722,7 +3723,7 @@ class Commande extends CommonOrder
$label .= '<br><b>'.$langs->trans('AmountTTC').':</b> '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
}
if (!empty($this->date)) {
$label .= '<br><b>'.$langs->trans('Date').':</b> '.dol_print_date($this->date, 'dayhour');
$label .= '<br><b>'.$langs->trans('Date').':</b> '.dol_print_date($this->date, 'day');
}
if (!empty($this->delivery_date)) {
$label .= '<br><b>'.$langs->trans('DeliveryDate').':</b> '.dol_print_date($this->delivery_date, 'dayhour');
@ -3737,6 +3738,11 @@ class Commande extends CommonOrder
}
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' class="classfortooltip"';
$target_value=array('_self', '_blank', '_parent', '_top');
if (in_array($target, $target_value)) {
$linkclose .= ' target="'.dol_escape_htmltag($target).'"';
}
}
$linkstart = '<a href="'.$url.'"';

View File

@ -23,7 +23,7 @@ if (empty($conf) || !is_object($conf)) {
exit;
}
print "<!-- BEGIN PHP TEMPLATE commande/tpl/linkedopjectblock.tpl.php -->\n";
print "<!-- BEGIN PHP TEMPLATE commande/tpl/linkedobjectblock.tpl.php -->\n";
global $user;
global $noMoreLinkedObjectBlockAfter;

View File

@ -60,10 +60,11 @@ $newbankreceipt = GETPOST('newbankreceipt', 'alpha');
// Security check
$fieldid = (!empty($ref) ? $ref : $id);
$fieldname = isset($ref) ? 'ref' : 'rowid';
$fieldname = (!empty($ref) ? 'ref' : 'rowid');
if ($user->socid) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'banque', $fieldid, 'bank_account', '', '', $fieldname);
if ($user->rights->banque->consolidate && $action == 'dvnext' && !empty($dvid)) {

View File

@ -4818,6 +4818,7 @@ if ($action == 'create') {
// List of previous situation invoices
if (($object->situation_cycle_ref > 0) && !empty($conf->global->INVOICE_USE_SITUATION)) {
print '<!-- List of situation invoices -->';
print '<table class="noborder situationstable" width="100%">';
print '<tr class="liste_titre">';
@ -4956,15 +4957,16 @@ if ($action == 'create') {
// List of payments already done
print '<!-- List of payments already done -->';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder paymenttable centpercent">';
print '<tr class="liste_titre">';
print '<td class="liste_titre">'.($object->type == Facture::TYPE_CREDIT_NOTE ? $langs->trans("PaymentsBack") : $langs->trans('Payments')).'</td>';
print '<td class="liste_titre">'.$langs->trans('Date').'</td>';
print '<td class="liste_titre">'.$langs->trans('Type').'</td>';
print '<td class="liste_titre"><span class="hideonsmartphone">'.$langs->trans('Date').'</span></td>';
print '<td class="liste_titre"><span class="hideonsmartphone">'.$langs->trans('Type').'</span></td>';
if (!empty($conf->banque->enabled)) {
print '<td class="liste_titre">'.$langs->trans('BankAccount').'</td>';
print '<td class="liste_titre"><span class="hideonsmartphone">'.$langs->trans('BankAccount').'</span></td>';
}
print '<td class="liste_titre right">'.$langs->trans('Amount').'</td>';
print '<td class="liste_titre" width="18">&nbsp;</td>';

View File

@ -721,7 +721,6 @@ if ($resql) {
if (!empty($arrayfields['f.titre']['checked'])) {
print '<td class="nowrap tdoverflowmax200">';
print $invoicerectmp->getNomUrl(1);
print "</a>";
print "</td>\n";
if (!$i) {
$totalarray['nbfield']++;
@ -765,7 +764,7 @@ if ($resql) {
}
// Payment term
if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) {
print '<td class="right">';
print '<td class="tdoverflowmax150">';
$form->form_conditions_reglement('', $objp->fk_cond_reglement, 'none');
print '</td>'."\n";
if (!$i) {
@ -774,7 +773,7 @@ if ($resql) {
}
// Payment mode
if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) {
print '<td class="right">';
print '<td class="tdoverflowmax150">';
$form->form_modes_reglement('', $objp->fk_mode_reglement, 'none');
print '</td>'."\n";
if (!$i) {

View File

@ -23,7 +23,7 @@ if (empty($conf) || !is_object($conf)) {
exit;
}
print "<!-- BEGIN PHP TEMPLATE compta/facture/tpl/linkedopjectblock.tpl.php -->\n";
print "<!-- BEGIN PHP TEMPLATE compta/facture/tpl/linkedobjectblock.tpl.php -->\n";
global $user;
global $noMoreLinkedObjectBlockAfter;
@ -45,7 +45,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
$trclass .= ' liste_sub_total';
}
print '<tr class="'.$trclass.'" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" >';
print '<td class="linkedcol-element">';
print '<td class="linkedcol-element tdoverflowmax100">';
switch ($objectlink->type) {
case Facture::TYPE_REPLACEMENT:
echo $langs->trans("InvoiceReplacement");

View File

@ -24,7 +24,7 @@ if (empty($conf) || !is_object($conf)) {
}
print "<!-- BEGIN PHP TEMPLATE compta/facture/tpl/linkedopjectblockForRec.tpl.php -->\n";
print "<!-- BEGIN PHP TEMPLATE compta/facture/tpl/linkedobjectblockForRec.tpl.php -->\n";
global $user;
@ -46,7 +46,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
}
?>
<tr class="<?php echo $trclass; ?>" >
<td class="linkedcol-element"><?php echo $langs->trans("RepeatableInvoice"); ?></td>
<td class="linkedcol-element tdoverflowmax100"><?php echo $langs->trans("RepeatableInvoice"); ?></td>
<td class="linkedcol-name"><!-- nowraponall because ref is a label --><?php echo $objectlink->getNomUrl(1); ?></td>
<td class="linkedcol-ref" align="center"></td>
<td class="linkedcol-date" align="center"><?php echo dol_print_date($objectlink->date_when, 'day'); ?></td>

View File

@ -41,12 +41,7 @@ $ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha');
// Security check
$fieldname = (!empty($ref) ? 'ref' : 'rowid');
if ($user->socid) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'cheque', $id, 'bordereau_cheque', '', 'fk_user_author', $fieldname);
$object = new RemiseCheque($db);
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
@ -63,11 +58,22 @@ if (empty($page) || $page == -1) {
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$offset = $limit * $page;
$dir = $conf->bank->dir_output.'/checkdeposits/';
$upload_dir = $conf->bank->multidir_output[$object->entity ? $object->entity : $conf->entity]."/checkdeposits";
$filterdate = dol_mktime(0, 0, 0, GETPOST('fdmonth'), GETPOST('fdday'), GETPOST('fdyear'));
$filteraccountid = GETPOST('accountid', 'int');
$object = new RemiseCheque($db);
// Security check
$fieldname = (!empty($ref) ? 'ref' : 'rowid');
if ($user->socid) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'cheque', $id, 'bordereau_cheque', '', 'fk_user_author', $fieldname);
$usercanread = $user->rights->banque->cheque;
$usercancreate = $user->rights->banque->cheque;
$usercandelete = $user->rights->banque->cheque;
/*
@ -241,7 +247,9 @@ if ($action == 'builddoc' && $user->rights->banque->cheque) {
$langs->load("other");
$file = $dir.get_exdir($object->ref, 0, 1, 0, $object, 'cheque').GETPOST('file');
$filetodelete = GETPOST('file', 'alpha');
$file = $upload_dir.'/'.$filetodelete;
$ret = dol_delete_file($file, 0, 0, 0, $object);
if ($ret) {
setEventMessages($langs->trans("FileWasRemoved", GETPOST('file')), null, 'mesgs');
@ -634,6 +642,12 @@ if ($action == 'new') {
$i = 1;
if ($num > 0) {
while ($objp = $db->fetch_object($resql)) {
$paymentstatic->id = $objp->pid;
$paymentstatic->ref = $objp->pref;
$accountlinestatic->id = $objp->rowid;
$accountlinestatic->ref = $objp->ref;
print '<tr class="oddeven">';
print '<td class="center">'.$i.'</td>';
print '<td class="center">'.dol_print_date($db->jdate($objp->date), 'day').'</td>'; // Operation date
@ -643,8 +657,6 @@ if ($action == 'new') {
print '<td class="right"><span class="amount">'.price($objp->amount).'</span></td>';
// Link to payment
print '<td class="center">';
$paymentstatic->id = $objp->pid;
$paymentstatic->ref = $objp->pref;
if ($paymentstatic->id) {
print $paymentstatic->getNomUrl(1);
} else {
@ -653,8 +665,6 @@ if ($action == 'new') {
print '</td>';
// Link to bank transaction
print '<td class="center">';
$accountlinestatic->id = $objp->rowid;
$accountlinestatic->ref = $objp->ref;
if ($accountlinestatic->id > 0) {
print $accountlinestatic->getNomUrl(1);
} else {
@ -664,10 +674,10 @@ if ($action == 'new') {
// Action button
print '<td class="right">';
if ($object->statut == 0) {
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=remove&amp;lineid='.$objp->rowid.'">'.img_delete().'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=remove&token='.newToken().'&lineid='.$objp->rowid.'">'.img_delete().'</a>';
}
if ($object->statut == 1 && $objp->statut != 2) {
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=reject_check&amp;lineid='.$objp->rowid.'">'.img_picto($langs->trans("RejectCheck"), 'disable').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reject_check&token='.newToken().'&lineid='.$objp->rowid.'">'.img_picto($langs->trans("RejectCheck"), 'disable').'</a>';
}
if ($objp->statut == 2) {
print ' &nbsp; '.img_picto($langs->trans('CheckRejected'), 'statut8').'</a>';
@ -723,11 +733,13 @@ print '</div>';
if ($action != 'new') {
if ($object->statut == 1) {
$filename = dol_sanitizeFileName($object->ref);
$filedir = $dir.get_exdir($object->ref, 0, 1, 0, $object, 'checkdeposits');
// Documents
$objref = dol_sanitizeFileName($object->ref);
$filedir = $upload_dir.'/'.$objref;
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
print $formfile->showdocuments('remisecheque', $filename, $filedir, $urlsource, 1, 1);
$genallowed = $usercancreate;
$delallowed = $usercandelete;
print $formfile->showdocuments('remisecheque', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang);
print '<br>';
}

View File

@ -615,6 +615,7 @@ class RemiseCheque extends CommonObject
// We save charset_output to restore it because write_file can change it if needed for
// output format that does not support UTF8.
$sav_charseSupprimert_output = $outputlangs->charset_output;
$result = $docmodel->write_file($this, $conf->bank->dir_output.'/checkdeposits', $this->ref, $outputlangs);
if ($result > 0) {
//$outputlangs->charset_output=$sav_charset_output;

View File

@ -83,7 +83,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y
}
}
if ($amounts[key($amounts)] <= 0) {
if (empty($amounts[key($amounts)])) {
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")), null, 'errors');
$action = 'create';

View File

@ -139,7 +139,7 @@ class ChargeSociales extends CommonObject
{
$sql = "SELECT cs.rowid, cs.date_ech";
$sql .= ", cs.libelle as label, cs.fk_type, cs.amount, cs.fk_projet as fk_project, cs.paye, cs.periode, cs.import_key";
$sql .= ", cs.fk_account, cs.fk_mode_reglement, cs.fk_user";
$sql .= ", cs.fk_account, cs.fk_mode_reglement, cs.fk_user, note_public, note_private";
$sql .= ", c.libelle as type_label";
$sql .= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle';
$sql .= " FROM ".MAIN_DB_PREFIX."chargesociales as cs";
@ -172,6 +172,8 @@ class ChargeSociales extends CommonObject
$this->amount = $obj->amount;
$this->fk_project = $obj->fk_project;
$this->fk_user = $obj->fk_user;
$this->note_public = $obj->note_public;
$this->note_private = $obj->note_private;
$this->paye = $obj->paye;
$this->periode = $this->db->jdate($obj->periode);
$this->import_key = $this->import_key;

View File

@ -81,7 +81,7 @@ $object->info($id);
$head = tax_prepare_head($object);
print dol_get_fiche_head($head, 'info', $langs->trans("SocialContribution"), -1, 'bill');
print dol_get_fiche_head($head, 'info', $langs->trans("SocialContribution"), -1, $object->picto);
$morehtmlref = '<div class="refidno">';
// Label of social contribution
@ -115,7 +115,7 @@ print '<div class="underbanner clearboth"></div>';
print '<br>';
print '<table width="100%"><tr><td>';
print '<table class="centpercent"><tr><td>';
dol_print_object_info($object);
print '</td></tr></table>';

View File

@ -0,0 +1,135 @@
<?php
/* Copyright (C) 2007-2022 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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/compta/sociales/note.php
* \ingroup tax
* \brief Tab for notes on Taxes
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
if (!empty($conf->projet->enabled)) {
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
// Load translation files required by the page
$langs->loadLangs(array('compta', 'bills'));
// Get parameters
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'aZ09');
$backtopage = GETPOST('backtopage', 'alpha');
$object = new ChargeSociales($db);
if ($id > 0) {
$object->fetch($id);
}
// Security check
$socid = GETPOST('socid', 'int');
if ($user->socid) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'tax', $object->id, 'chargesociales', 'charges');
$permissiontoread = $user->rights->tax->charges->lire;
$permissiontoadd = $user->rights->tax->charges->creer;
$permissionnote = $user->rights->tax->charges->creer; // Used by the include of actions_setnotes.inc.php
/*
* Actions
*/
$parameters = array();
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
if (empty($reshook)) {
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
}
/*
* View
*/
$form = new Form($db);
$title = $langs->trans("SocialContribution").' - '.$langs->trans("Note");
$help_url = 'EN:Module_Taxes_and_social_contributions|FR:Module Taxes et dividendes|ES:M&oacute;dulo Impuestos y cargas sociales (IVA, impuestos)';
llxHeader('', $title, $help_url);
if ($id > 0 || !empty($ref)) {
$object->fetch_thirdparty();
$head = tax_prepare_head($object);
print dol_get_fiche_head($head, 'note', $langs->trans("SocialContribution"), -1, $object->picto);
$morehtmlref = '<div class="refidno">';
// Label of social contribution
$morehtmlref .= $form->editfieldkey("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1);
$morehtmlref .= $form->editfieldval("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1);
// Project
if (!empty($conf->projet->enabled)) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' : ';
if (!empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
$morehtmlref .= ' : '.$proj->getNomUrl(1);
if ($proj->title) {
$morehtmlref .= ' - '.dol_escape_htmltag($proj->title);
}
} else {
$morehtmlref .= '';
}
}
$morehtmlref .= '</div>';
// Object card
// ------------------------------------------------------------
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/sociales/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
//$object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
$cssclass = "titlefield";
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
print '</div>';
print dol_get_fiche_end();
}
// End of page
llxFooter();
$db->close();

View File

@ -2027,62 +2027,73 @@ if ($action == 'create') {
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) {
$params = array(
'attr' => array(
'title' => '',
'class' => 'classfortooltip'
)
);
// Send
if (empty($user->socid)) {
if ($object->statut == 1) {
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->contrat->creer)) {
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&token='.newToken().'&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').'</a></div>';
print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&token='.newToken().'&mode=init#formmailbeforetitle', '', true, $params);
} else {
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">'.$langs->trans('SendMail').'</a></div>';
print dolGetButtonAction($langs->trans('SendMail'), '', 'default', '#', '', false, $params);
}
}
}
if ($object->statut == 0 && $nbofservices) {
if ($user->rights->contrat->creer) {
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=valid&amp;token='.newToken().'">'.$langs->trans("Validate").'</a></div>';
print dolGetButtonAction($langs->trans('Validate'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=valid&amp;token='.newToken(), '', true, $params);
} else {
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("Validate").'</a></div>';
$params['attr']['title'] = $langs->trans("NotEnoughPermissions");
print dolGetButtonAction($langs->trans('Validate'), '', 'default', '#', '', false, $params);
}
}
if ($object->statut == 1) {
if ($user->rights->contrat->creer) {
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen&token='.newToken().'">'.$langs->trans("Modify").'</a></div>';
print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen&token='.newToken(), '', true, $params);
} else {
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("Modify").'</a></div>';
$params['attr']['title'] = $langs->trans("NotEnoughPermissions");
print dolGetButtonAction($langs->trans('Modify'), '', 'default', '#', '', false, $params);
}
}
if (!empty($conf->commande->enabled) && $object->statut > 0 && $object->nbofservicesclosed < $nbofservices) {
$langs->load("orders");
if ($user->rights->commande->creer) {
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/commande/card.php?action=create&token='.newToken().'&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->thirdparty->id.'">'.$langs->trans("CreateOrder").'</a></div>';
print dolGetButtonAction($langs->trans('CreateOrder'), '', 'default', DOL_URL_ROOT.'/commande/card.php?action=create&token='.newToken().'&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->thirdparty->id, '', true, $params);
} else {
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("CreateOrder").'</a></div>';
$params['attr']['title'] = $langs->trans("NotEnoughPermissions");
print dolGetButtonAction($langs->trans('CreateOrder'), '', 'default', '#', '', false, $params);
}
}
if (!empty($conf->facture->enabled) && $object->statut > 0) {
$langs->load("bills");
if ($user->rights->facture->creer) {
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->thirdparty->id.'">'.$langs->trans("CreateBill").'</a></div>';
print dolGetButtonAction($langs->trans('CreateBill'), '', 'default', DOL_URL_ROOT.'/compta/facture/card.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->thirdparty->id, '', true, $params);
} else {
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("CreateBill").'</a></div>';
$params['attr']['title'] = $langs->trans("NotEnoughPermissions");
print dolGetButtonAction($langs->trans('CreateBill'), '', 'default', '#', '', false, $params);
}
}
if ($object->nbofservicesclosed > 0 || $object->nbofserviceswait > 0) {
if ($user->rights->contrat->activer) {
print '<div class="inline-block divButAction"><a class="butAction" id="btnactivateall" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=activate&amp;token='.newToken().'">'.$langs->trans("ActivateAllContracts").'</a></div>';
print dolGetButtonAction($langs->trans('ActivateAllContracts'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=activate&amp;token='.newToken(), '', true, $params);
} else {
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" id="btnactivateall" href="#">'.$langs->trans("ActivateAllContracts").'</a></div>';
print dolGetButtonAction($langs->trans('ActivateAllContracts'), '', 'default', '#', '', false, $params);
}
}
if ($object->nbofservicesclosed < $nbofservices) {
if ($user->rights->contrat->desactiver) {
print '<div class="inline-block divButAction"><a class="butAction" id="btncloseall" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=close&amp;token='.newToken().'">'.$langs->trans("CloseAllContracts").'</a></div>';
print dolGetButtonAction($langs->trans('CloseAllContracts'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=close&amp;token='.newToken(), '', true, $params);
} else {
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" id="btncloseall" href="#">'.$langs->trans("CloseAllContracts").'</a></div>';
print dolGetButtonAction($langs->trans('CloseAllContracts'), '', 'default', '#', '', false, $params);
}
//if (! $numactive)
@ -2104,16 +2115,17 @@ if ($action == 'create') {
// Clone
if ($user->rights->contrat->creer) {
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;socid='.$object->socid.'&amp;action=clone&amp;token='.newToken().'&amp;object='.$object->element.'">'.$langs->trans("ToClone").'</a></div>';
print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;socid='.$object->socid.'&amp;action=clone&amp;token='.newToken(), '', true, $params);
}
// On peut supprimer entite si
// - Droit de creer + mode brouillon (erreur creation)
// - Droit de supprimer
if (($user->rights->contrat->creer && $object->statut == $object::STATUS_DRAFT) || $user->rights->contrat->supprimer) {
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken().'">'.$langs->trans("Delete").'</a></div>';
print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), '', true, $params);
} else {
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'">'.$langs->trans("Delete").'</a></div>';
$params['attr']['title'] = $langs->trans("NotAllowed");
print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), '', false, $params);
}
}

View File

@ -23,7 +23,7 @@ if (empty($conf) || !is_object($conf)) {
}
print "<!-- BEGIN PHP TEMPLATE contrat/tpl/linkedopjectblock.tpl.php -->\n";
print "<!-- BEGIN PHP TEMPLATE contrat/tpl/linkedobjectblock.tpl.php -->\n";
global $user;

View File

@ -635,6 +635,7 @@ if ($massaction == 'confirm_createbills') { // Create bills from orders.
$TFact = array();
$TFactThird = array();
$TFactThirdNbLines = array();
$nb_bills_created = 0;
$lastid= 0;
@ -685,6 +686,7 @@ if ($massaction == 'confirm_createbills') { // Create bills from orders.
$lastid = $objecttmp->id;
$TFactThird[$cmd->socid] = $objecttmp;
$TFactThirdNbLines[$cmd->socid] = 0; //init nblines to have lines ordered by expedition and rang
} else {
$langs->load("errors");
$errors[] = $cmd->ref.' : '.$langs->trans($objecttmp->error);
@ -774,6 +776,11 @@ if ($massaction == 'confirm_createbills') { // Create bills from orders.
$objecttmp->context['createfromclone'];
$rang = $lines[$i]->rang;
//there may already be rows from previous orders
if (!empty($createbills_onebythird))
$rang = $TFactThirdNbLines[$cmd->socid];
$result = $objecttmp->addline(
$desc,
$lines[$i]->subprice,
@ -791,7 +798,7 @@ if ($massaction == 'confirm_createbills') { // Create bills from orders.
'HT',
0,
$product_type,
$lines[$i]->rang,
$rang,
$lines[$i]->special_code,
$objecttmp->origin,
$lines[$i]->rowid,
@ -806,6 +813,8 @@ if ($massaction == 'confirm_createbills') { // Create bills from orders.
);
if ($result > 0) {
$lineid = $result;
if (!empty($createbills_onebythird)) //increment rang to keep order
$TFactThirdNbLines[$rcp->socid]++;
} else {
$lineid = 0;
$error++;
@ -1579,17 +1588,20 @@ if (!$error && ($massaction == 'approveleave' || ($action == 'approveleave' && $
$nbok = 0;
foreach ($toselect as $toselectid) {
$result = $objecttmp->fetch($toselectid);
if ($result>0) {
if ($objecttmp->statut == Holiday::STATUS_VALIDATED && $user->id == $objecttmp->fk_validator) {
if ($result > 0) {
if ($objecttmp->statut != Holiday::STATUS_VALIDATED) {
setEventMessages($langs->trans('StatusOfRefMustBe', $objecttmp->ref, $langs->transnoentitiesnoconv('Validated')), null, 'warnings');
continue;
}
if ($user->id == $objecttmp->fk_validator) {
$objecttmp->oldcopy = dol_clone($objecttmp);
$objecttmp->date_valid = dol_now();
$objecttmp->fk_user_valid = $user->id;
$objecttmp->statut = Holiday::STATUS_APPROVED;
$db->begin();
$verif = $objecttmp->approve($user);
if ($verif <= 0) {
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
$error++;
@ -1664,14 +1676,9 @@ if (!$error && ($massaction == 'approveleave' || ($action == 'approveleave' && $
}
}
}
if (!$error) {
$db->commit();
$nbok++;
} else {
$db->rollback();
$action = '';
}
} else {
$langs->load("errors");
setEventMessages($langs->trans('ErrorNotApproverForHoliday', $objecttmp->ref), null, 'errors');
}
} else {
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
@ -1683,7 +1690,7 @@ if (!$error && ($massaction == 'approveleave' || ($action == 'approveleave' && $
if (!$error) {
if ($nbok > 1) {
setEventMessages($langs->trans("RecordsApproved", $nbok), null, 'mesgs');
} else {
} elseif ($nbok == 1) {
setEventMessages($langs->trans("RecordAproved"), null, 'mesgs');
}
$db->commit();

View File

@ -81,8 +81,6 @@ if (GETPOST('roworder', 'alpha', 3) && GETPOST('table_element_line', 'aZ09', 3)
$perm = 1;
} elseif ($table_element_line == 'facturedet_rec' && $user->rights->facture->creer) {
$perm = 1;
} elseif ($table_element_line == 'ecm_files' && $user->rights->ecm->creer) {
$perm = 1;
} elseif ($table_element_line == 'emailcollector_emailcollectoraction' && $user->admin) {
$perm = 1;
} elseif ($table_element_line == 'bom_bomline' && $user->rights->bom->write) {
@ -97,10 +95,18 @@ if (GETPOST('roworder', 'alpha', 3) && GETPOST('table_element_line', 'aZ09', 3)
$perm = 1;
} elseif ($table_element_line == 'facture_fourn_det_rec' && $user->rights->fournisseur->facture->creer) {
$perm = 1;
} elseif ($table_element_line == 'ecm_files' && $fk_element == 'fk_product' && (!empty($user->rights->produit->creer) || !empty($user->rights->service->creer))) {
$perm = 1;
} elseif ($table_element_line == 'ecm_files' && $fk_element == 'fk_ticket' && !empty($user->rights->ticket->write)) {
$perm = 1;
} elseif ($table_element_line == 'ecm_files') { // Used when of page "documents.php"
if (!empty($user->rights->ecm->creer)) {
$perm = 1;
} elseif ($fk_element == 'fk_product' && (!empty($user->rights->produit->creer) || !empty($user->rights->service->creer))) {
$perm = 1;
} elseif ($fk_element == 'fk_ticket' && !empty($user->rights->ticket->write)) {
$perm = 1;
} elseif ($fk_element == 'fk_holiday' && !empty($user->rights->holiday->write)) {
$perm = 1;
} elseif ($fk_element == 'fk_soc' && !empty($user->rights->societe->creer)) {
$perm = 1;
}
} elseif ($table_element_line == 'product_association' && $fk_element == 'fk_product' && (!empty($user->rights->produit->creer) || !empty($user->rights->service->creer))) {
$perm = 1;
} elseif ($table_element_line == 'projet_task' && $fk_element == 'fk_projet' && $user->rights->projet->creer) {

View File

@ -162,7 +162,7 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes
$this->info_box_contents[$line][] = array(
'td' => 'class="right"',
'text' => $delayIcon.'<span class="classfortooltip" title="'.$langs->trans('DateDeliveryPlanned').'"><i class="fa fa-dolly" ></i> '.($delivery_date ? dol_print_date($delivery_date, 'day', 'tzuserrel') : '').'</span>',
'text' => $delayIcon.'<span class="classfortooltip" title="'.$langs->trans('DateDeliveryPlanned').'"><i class="fa fa-flip-dolly" ></i> '.($delivery_date ? dol_print_date($delivery_date, 'day', 'tzuserrel') : '').'</span>',
'asis' => 1
);

View File

@ -140,7 +140,7 @@ class CMailFile
*/
public function __construct($subject, $to, $from, $msg, $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array(), $addr_cc = "", $addr_bcc = "", $deliveryreceipt = 0, $msgishtml = 0, $errors_to = '', $css = '', $trackid = '', $moreinheader = '', $sendcontext = 'standard', $replyto = '')
{
global $conf, $dolibarr_main_data_root;
global $conf, $dolibarr_main_data_root, $user;
// Clean values of $mimefilename_list
if (is_array($mimefilename_list)) {
@ -251,9 +251,31 @@ class CMailFile
}
}
// Add autocopy to if not already in $to (Note: Adding bcc for specific modules are also done from pages)
if (!empty($conf->global->MAIN_MAIL_AUTOCOPY_TO) && !preg_match('/'.preg_quote($conf->global->MAIN_MAIL_AUTOCOPY_TO, '/').'/i', $to)) {
$addr_bcc .= ($addr_bcc ? ', ' : '').$conf->global->MAIN_MAIL_AUTOCOPY_TO;
// Add auto copy to if not already in $to (Note: Adding bcc for specific modules are also done from pages)
// For example MAIN_MAIL_AUTOCOPY_TO can be 'email@example.com, __USER_EMAIL__, ...'
if (!empty($conf->global->MAIN_MAIL_AUTOCOPY_TO)) {
$listofemailstoadd = explode(',', $conf->global->MAIN_MAIL_AUTOCOPY_TO);
foreach ($listofemailstoadd as $key => $val) {
$emailtoadd = $listofemailstoadd[$key];
if (trim($emailtoadd) == '__USER_EMAIL__') {
if (!empty($user) && !empty($user->email)) {
$emailtoadd = $user->email;
} else {
$emailtoadd = '';
}
}
if ($emailtoadd && preg_match('/'.preg_quote($emailtoadd, '/').'/i', $to)) {
$emailtoadd = ''; // Email already in the "To"
}
if ($emailtoadd) {
$listofemailstoadd[$key] = $emailtoadd;
} else {
unset($listofemailstoadd[$key]);
}
}
if (!empty($listofemailstoadd)) {
$addr_bcc .= ($addr_bcc ? ', ' : '').join(', ', $listofemailstoadd);
}
}
$this->subject = $subject;

View File

@ -7067,6 +7067,8 @@ abstract class CommonObject
$paramforthenewlink = '';
$paramforthenewlink .= (GETPOSTISSET('action') ? '&action='.GETPOST('action', 'aZ09') : '');
$paramforthenewlink .= (GETPOSTISSET('id') ? '&id='.GETPOST('id', 'int') : '');
$paramforthenewlink .= (GETPOSTISSET('origin') ? '&origin='.GETPOST('origin', 'aZ09') : '');
$paramforthenewlink .= (GETPOSTISSET('originid') ? '&originid='.GETPOST('originid', 'int') : '');
$paramforthenewlink .= '&fk_'.strtolower($class).'=--IDFORBACKTOPAGE--';
// TODO Add Javascript code to add input fields already filled into $paramforthenewlink so we won't loose them when going back to main page
$out .= '<a class="butActionNew" title="'.$langs->trans("New").'" href="'.$url_path.'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF'].($paramforthenewlink ? '?'.$paramforthenewlink : '')).'"><span class="fa fa-plus-circle valignmiddle"></span></a>';

View File

@ -165,7 +165,7 @@ class Conf
/**
* Load setup values into conf object (read llx_const) for a specified entity
* Note that this->db->xxx, this->file->xxx and this->multicompany have been already loaded when setValues is called.
* Note that this->db->xxx, this->file->xxx and this->multicompany have been already loaded when setEntityValues is called.
*
* @param DoliDB $db Database handler
* @param int $entity Entity to get
@ -616,15 +616,15 @@ class Conf
if (!empty($this->productbatch->enabled)) {
$this->global->STOCK_CALCULATE_ON_BILL = 0;
$this->global->STOCK_CALCULATE_ON_VALIDATE_ORDER = 0;
$this->global->STOCK_CALCULATE_ON_SHIPMENT = 1;
$this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE = 0;
if (empty($this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) $this->global->STOCK_CALCULATE_ON_SHIPMENT = 1;
if (empty($this->global->STOCK_CALCULATE_ON_SHIPMENT)) $this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE = 1;
$this->global->STOCK_CALCULATE_ON_SUPPLIER_BILL = 0;
$this->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER = 0;
if (empty($this->reception->enabled)) {
$this->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER = 1;
} else {
$this->global->STOCK_CALCULATE_ON_RECEPTION = 1;
$this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE = 0;
if (empty($this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) $this->global->STOCK_CALCULATE_ON_RECEPTION = 1;
if (empty($this->global->STOCK_CALCULATE_ON_RECEPTION)) $this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE = 1;
}
}

View File

@ -642,14 +642,14 @@ class dolReceiptPrinter extends Printer
case 'DOL_PRINT_OBJECT_LINES':
foreach ($object->lines as $line) {
if ($line->fk_product) {
$spacestoadd = $nbcharactbyline - strlen($line->ref) - strlen($line->qty) - 10 - 1;
$spacestoadd = $nbcharactbyline - strlen($line->ref) - strlen($line->qty) - strlen($line->subprice) - 10 - 1;
$spaces = str_repeat(' ', $spacestoadd > 0 ? $spacestoadd : 0);
$this->printer->text($line->ref.$spaces.$line->qty.' '.str_pad(price($line->total_ttc), 10, ' ', STR_PAD_LEFT)."\n");
$this->printer->text(strip_tags(htmlspecialchars_decode($line->product_label))."\n");
$this->printer->text($line->ref . $spaces . $line->qty . str_pad(price($line->subprice), 10, ' ', STR_PAD_LEFT) . ' ' . str_pad(price($line->total_ttc), 10, ' ', STR_PAD_LEFT) . "\n");
$this->printer->text(strip_tags(htmlspecialchars_decode($line->product_label))."\n \n");
} else {
$spacestoadd = $nbcharactbyline - strlen($line->description) - strlen($line->qty) - 10 - 1;
$spacestoadd = $nbcharactbyline - strlen($line->description) - strlen($line->qty) - strlen($line->subprice) - 10 - 1;
$spaces = str_repeat(' ', $spacestoadd > 0 ? $spacestoadd : 0);
$this->printer->text($line->description.$spaces.$line->qty.' '.str_pad(price($line->total_ttc), 10, ' ', STR_PAD_LEFT)."\n");
$this->printer->text($line->description.$spaces.$line->qty.' '.str_pad(price($line->subprice), 10, ' ', STR_PAD_LEFT).' '.str_pad(price($line->total_ttc), 10, ' ', STR_PAD_LEFT)."\n");
}
}
break;

View File

@ -16,7 +16,7 @@
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2012-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2014-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018-2021 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018-2022 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2018 Christophe Battarel <christophe@altairis.fr>
@ -791,7 +791,7 @@ class Form
// Warning: if you set submit button to disabled, post using 'Enter' will no more work if there is no another input submit. So we add a hidden button
$ret .= '<input type="submit" name="confirmmassactioninvisible" style="display: none" tabindex="-1">'; // Hidden button BEFORE so it is the one used when we submit with ENTER.
$ret .= '<input type="submit" disabled name="confirmmassaction"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display: none"').' class="button small'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'confirmed" value="'.dol_escape_htmltag($langs->trans("Confirm")).'">';
$ret .= '<input type="submit" disabled name="confirmmassaction"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display: none"').' class="button smallpaddingimp'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'confirmed" value="'.dol_escape_htmltag($langs->trans("Confirm")).'">';
$ret .= '</div>';
if (!empty($conf->use_javascript_ajax)) {
@ -1320,6 +1320,7 @@ class Form
{
// phpcs:enable
global $conf, $user, $langs;
global $hookmanager;
$out = '';
$num = 0;
@ -1367,6 +1368,10 @@ class Form
if (!empty($excludeids)) {
$sql .= " AND s.rowid NOT IN (".$this->db->sanitize(join(',', $excludeids)).")";
}
// Add where from hooks
$parameters = array();
$reshook = $hookmanager->executeHooks('selectThirdpartyListWhere', $parameters); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
// Add criteria
if ($filterkey && $filterkey != '') {
$sql .= " AND (";
@ -1679,6 +1684,10 @@ class Form
if (!empty($conf->global->CONTACT_HIDE_INACTIVE_IN_COMBOBOX)) {
$sql .= " AND sp.statut <> 0";
}
// Add where from hooks
$parameters = array();
$reshook = $hookmanager->executeHooks('selectContactListWhere', $parameters); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
$sql .= " ORDER BY sp.lastname ASC";
dol_syslog(get_class($this)."::selectcontacts", LOG_DEBUG);
@ -2462,6 +2471,7 @@ class Form
{
// phpcs:enable
global $langs, $conf;
global $hookmanager;
$out = '';
$outarray = array();
@ -2607,6 +2617,10 @@ class Form
} elseif (empty($conf->service->enabled)) { // when service module is disabled, show products only
$sql .= " AND p.fk_product_type = 0";
}
// Add where from hooks
$parameters = array();
$reshook = $hookmanager->executeHooks('selectProductsListWhere', $parameters); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
// Add criteria on ref/label
if ($filterkey != '') {
$sql .= ' AND (';
@ -3180,6 +3194,7 @@ class Form
{
// phpcs:enable
global $langs, $conf, $user;
global $hookmanager;
$out = '';
$outarray = array();
@ -3229,6 +3244,10 @@ class Form
if (!empty($filtre)) {
$sql .= " ".$filtre;
}
// Add where from hooks
$parameters = array();
$reshook = $hookmanager->executeHooks('selectSuppliersProductsListWhere', $parameters); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
// Add criteria on ref/label
if ($filterkey != '') {
$sql .= ' AND (';
@ -5131,7 +5150,7 @@ class Form
$formconfirm .= '<td class="valid">'.$question.'</td>';
$formconfirm .= '<td class="valid center">';
$formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly');
$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton" type="submit" value="'.$langs->trans("Validate").'">';
$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="'.$langs->trans("Validate").'">';
$formconfirm .= '</td>';
$formconfirm .= '</tr>'."\n";
@ -5202,6 +5221,7 @@ class Form
$out .= '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
$out .= '</form>';
} else {
$out .= '<span class="project_head_block">';
if ($selected) {
$projet = new Project($this->db);
$projet->fetch($selected);
@ -5209,6 +5229,7 @@ class Form
} else {
$out .= "&nbsp;";
}
$out .= '</span>';
}
if (empty($nooutput)) {
@ -6678,7 +6699,7 @@ class Form
// phpcs:enable
global $langs;
$retstring = '';
$retstring = '<span class="nowraponall">';
$hourSelected = 0;
$minSelected = 0;
@ -6710,7 +6731,7 @@ class Form
if ($typehour != 'text') {
$retstring .= ' '.$langs->trans('HourShort');
} else {
$retstring .= '<span class="hideonsmartphone">:</span>';
$retstring .= '<span class="">:</span>';
}
// Minutes
@ -6738,7 +6759,7 @@ class Form
$retstring .= ' '.$langs->trans('MinuteShort');
}
//$retstring.="&nbsp;";
$retstring.="</span>";
if (!empty($nooutput)) {
return $retstring;
@ -8585,6 +8606,7 @@ class Form
print '<br><form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinkedbyref' . $key . '">';
print '<input type="hidden" name="id" value="' . $object->id . '">';
print '<input type="hidden" name="action" value="addlinkbyref">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="addlink" value="' . $key . '">';
print '<table class="noborder">';
print '<tr>';

View File

@ -360,8 +360,8 @@ class FormFile
* This also set the property $this->numoffiles
*
* @param string $modulepart Module the files are related to ('propal', 'facture', 'facture_fourn', 'mymodule', 'mymodule:MyObject', 'mymodule_temp', ...)
* @param string $modulesubdir Existing (so sanitized) sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if file is not into subdir of module.
* @param string $filedir Directory to scan
* @param string $modulesubdir Existing (so sanitized) sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if file is not into a subdir of module.
* @param string $filedir Directory to scan (must not end with a /). Example: '/mydolibarrdocuments/facture/FAYYMM-1234'
* @param string $urlsource Url of origin page (for return)
* @param int|string[] $genallowed Generation is allowed (1/0 or array list of templates)
* @param int $delallowed Remove is allowed (1/0)
@ -1283,12 +1283,22 @@ class FormFile
}
print '<td></td>';
print '<td></td>';
if (!$disablemove) {
if (empty($disablemove) && count($filearray) > 1) {
print '<td></td>';
}
print "</tr>\n";
}
// Get list of files stored into database for same relative directory
if ($relativedir) {
completeFileArrayWithDatabaseInfo($filearray, $relativedir);
//var_dump($sortfield.' - '.$sortorder);
if ($sortfield && $sortorder) { // If $sortfield is for example 'position_name', we will sort on the property 'position_name' (that is concat of position+name)
$filearray = dol_sort_array($filearray, $sortfield, $sortorder);
}
}
print '<tr class="liste_titre nodrag nodrop">';
//print $url.' sortfield='.$sortfield.' sortorder='.$sortorder;
print_liste_field_titre('Documents2', $url, "name", "", $param, '', $sortfield, $sortorder, 'left ');
@ -1301,21 +1311,11 @@ class FormFile
print_liste_field_titre('');
// Action button
print_liste_field_titre('');
if (!$disablemove) {
if (empty($disablemove) && count($filearray) > 1) {
print_liste_field_titre('');
}
print "</tr>\n";
// Get list of files stored into database for same relative directory
if ($relativedir) {
completeFileArrayWithDatabaseInfo($filearray, $relativedir);
//var_dump($sortfield.' - '.$sortorder);
if ($sortfield && $sortorder) { // If $sortfield is for example 'position_name', we will sort on the property 'position_name' (that is concat of position+name)
$filearray = dol_sort_array($filearray, $sortfield, $sortorder);
}
}
$nboffiles = count($filearray);
if ($nboffiles > 0) {
include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
@ -1506,22 +1506,22 @@ class FormFile
if (!empty($conf->global->MAIN_ECM_DISABLE_JS)) {
$useajax = 0;
}
print '<a href="'.((($useinecm && $useinecm != 6) && $useajax) ? '#' : ($url.'?action=deletefile&token='.newToken().'&urlfile='.urlencode($filepath).$param)).'" class="'.($useajax ? 'reposition ' : '').'deletefilelink" rel="'.$filepath.'">'.img_delete().'</a>';
print '<a href="'.((($useinecm && $useinecm != 6) && $useajax) ? '#' : ($url.'?action=deletefile&token='.newToken().'&urlfile='.urlencode($filepath).$param)).'" class="reposition deletefilelink" rel="'.$filepath.'">'.img_delete().'</a>';
}
print "</td>";
if (empty($disablemove)) {
if (empty($disablemove) && count($filearray) > 1) {
if ($nboffiles > 1 && $conf->browser->layout != 'phone') {
print '<td class="linecolmove tdlineupdown center">';
if ($i > 0) {
print '<a class="lineupdown" href="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'&action=up&rowid='.$line->id.'">'.img_up('default', 0, 'imgupforline').'</a>';
}
if ($i < $nboffiles - 1) {
if ($i < ($nboffiles - 1)) {
print '<a class="lineupdown" href="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'&action=down&rowid='.$line->id.'">'.img_down('default', 0, 'imgdownforline').'</a>';
}
print '</td>';
} else {
print '<td'.(($conf->browser->layout != 'phone' && empty($disablemove)) ? ' class="linecolmove tdlineupdown center"' : ' class="linecolmove center"').'>';
print '<td'.(($conf->browser->layout != 'phone') ? ' class="linecolmove tdlineupdown center"' : ' class="linecolmove center"').'>';
print '</td>';
}
}
@ -1531,7 +1531,7 @@ class FormFile
print '<input type="submit" class="button button-save" name="renamefilesave" value="'.dol_escape_htmltag($langs->trans("Save")).'">';
print '<input type="submit" class="button button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
print '</td>';
if (empty($disablemove)) {
if (empty($disablemove) && count($filearray) > 1) {
print '<td class="right"></td>';
}
}
@ -1542,7 +1542,7 @@ class FormFile
}
if ($nboffiles == 0) {
$colspan = '6';
if (empty($disablemove)) {
if (empty($disablemove) && count($filearray) > 1) {
$colspan++; // 6 columns or 7
}
print '<tr class="oddeven"><td colspan="'.$colspan.'">';
@ -2032,7 +2032,7 @@ class FormFile
print '<form action="'.$_SERVER['PHP_SELF'].($param ? '?'.$param : '').'" method="POST">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<table width="100%" class="liste noborder nobottom">';
print '<table class="liste noborder nobottom centpercent">';
print '<tr class="liste_titre">';
print_liste_field_titre(
$langs->trans("Links"),
@ -2117,7 +2117,7 @@ class FormFile
print '<td class="right">';
print '<a href="'.$_SERVER['PHP_SELF'].'?action=update&linkid='.$link->id.$param.'&token='.newToken().'" class="editfilelink editfielda reposition" >'.img_edit().'</a>'; // id= is included into $param
if ($permissiontodelete) {
print ' &nbsp; <a class="deletefilelink" href="'.$_SERVER['PHP_SELF'].'?action=delete&token='.newToken().'&linkid='.$link->id.$param.'">'.img_delete().'</a>'; // id= is included into $param
print ' &nbsp; <a class="deletefilelink reposition" href="'.$_SERVER['PHP_SELF'].'?action=deletelink&token='.newToken().'&linkid='.((int) $link->id).$param.'">'.img_delete().'</a>'; // id= is included into $param
} else {
print '&nbsp;';
}

View File

@ -1250,7 +1250,7 @@ class FormMail extends Form
* Return templates of email with type = $type_template or type = 'all'.
* This search into table c_email_templates. Used by the get_form function.
*
* @param DoliDB $db Database handler
* @param DoliDB $dbs Database handler
* @param string $type_template Get message for model/type=$type_template, type='all' also included.
* @param User $user Get template public or limited to this user
* @param Translate $outputlangs Output lang object
@ -1259,7 +1259,7 @@ class FormMail extends Form
* @param string $label Label of template
* @return ModelMail|integer One instance of ModelMail or -1 if error
*/
public function getEMailTemplate($db, $type_template, $user, $outputlangs, $id = 0, $active = 1, $label = '')
public function getEMailTemplate($dbs, $type_template, $user, $outputlangs, $id = 0, $active = 1, $label = '')
{
global $conf, $langs;
@ -1279,18 +1279,18 @@ class FormMail extends Form
}
$sql = "SELECT rowid, module, label, type_template, topic, joinfiles, content, content_lines, lang";
$sql .= " FROM ".$db->prefix().'c_email_templates';
$sql .= " WHERE (type_template='".$db->escape($type_template)."' OR type_template='all')";
$sql .= " FROM ".$dbs->prefix().'c_email_templates';
$sql .= " WHERE (type_template='".$dbs->escape($type_template)."' OR type_template='all')";
$sql .= " AND entity IN (".getEntity('c_email_templates').")";
$sql .= " AND (private = 0 OR fk_user = ".((int) $user->id).")"; // Get all public or private owned
if ($active >= 0) {
$sql .= " AND active = ".((int) $active);
}
if ($label) {
$sql .= " AND label = '".$db->escape($label)."'";
$sql .= " AND label = '".$dbs->escape($label)."'";
}
if (!($id > 0) && $languagetosearch) {
$sql .= " AND (lang = '".$db->escape($languagetosearch)."'".($languagetosearchmain ? " OR lang = '".$db->escape($languagetosearchmain)."'" : "")." OR lang IS NULL OR lang = '')";
$sql .= " AND (lang = '".$dbs->escape($languagetosearch)."'".($languagetosearchmain ? " OR lang = '".$dbs->escape($languagetosearchmain)."'" : "")." OR lang IS NULL OR lang = '')";
}
if ($id > 0) {
$sql .= " AND rowid=".(int) $id;
@ -1299,22 +1299,22 @@ class FormMail extends Form
$sql .= " AND position=0";
}
if ($languagetosearch) {
$sql .= $db->order("position,lang,label", "ASC,DESC,ASC"); // We want line with lang set first, then with lang null or ''
$sql .= $dbs->order("position,lang,label", "ASC,DESC,ASC"); // We want line with lang set first, then with lang null or ''
} else {
$sql .= $db->order("position,lang,label", "ASC,ASC,ASC"); // If no language provided, we give priority to lang not defined
$sql .= $dbs->order("position,lang,label", "ASC,ASC,ASC"); // If no language provided, we give priority to lang not defined
}
//$sql .= $db->plimit(1);
//$sql .= $dbs->plimit(1);
//print $sql;
$resql = $db->query($sql);
$resql = $dbs->query($sql);
if (!$resql) {
dol_print_error($db);
dol_print_error($dbs);
return -1;
}
// Get first found
while (1) {
$obj = $db->fetch_object($resql);
$obj = $dbs->fetch_object($resql);
if ($obj) {
// If template is for a module, check module is enabled; if not, take next template
@ -1386,7 +1386,8 @@ class FormMail extends Form
}
}
$db->free($resql);
$dbs->free($resql);
return $ret;
}

View File

@ -88,7 +88,7 @@ class FormOther
$stringaddbarcode = str_replace("tmphtml", $htmltoreplaceby, $stringaddbarcode);
$out .= $stringaddbarcode.' <input type="text" name="barcodeproductqty" class="width50 right" value="1"><br>';
$out .= '<br>';
$out .= '<textarea type="text" name="barcodelist" class="centpercent" autofocus rows="'.ROWS_3.'" placeholder="'.dol_escape_htmltag($langs->trans("ScanOrTypeOrCopyPasteYouBarCode")).'"></textarea>';
$out .= '<textarea type="text" name="barcodelist" class="centpercent" autofocus rows="'.ROWS_3.'" placeholder="'.dol_escape_htmltag($langs->trans("ScanOrTypeOrCopyPasteYourBarCodes")).'"></textarea>';
/*print '<br>'.$langs->trans("or").'<br>';
@ -110,7 +110,7 @@ class FormOther
$out .= 'jQuery("#scantoolmessage").text("");';
$out .= '});'."\n";
$out .= '$("#exec'.dol_escape_js($jstoexecuteonadd).'").click(function(){
console.log("We call js to execute '.dol_escape_js($jstoexecuteonadd).'");
console.log("We call js to execute \''.dol_escape_js($jstoexecuteonadd).'\'");
'.dol_escape_js($jstoexecuteonadd).'();
return false; /* We want to stay on the scan tool */
})';

View File

@ -608,7 +608,7 @@ class Notify
$mimefilename_list[] = $ref.".pdf";
}
$parameters = array('notifcode'=>$notifcode, 'sendto'=>$sendto, 'replyto'=>$replyto, 'file'=>$filename_list, 'mimefile'=>$mimetype_list, 'filename'=>$mimefilename_list);
$parameters = array('notifcode'=>$notifcode, 'sendto'=>$sendto, 'replyto'=>$replyto, 'file'=>$filename_list, 'mimefile'=>$mimetype_list, 'filename'=>$mimefilename_list, 'outputlangs'=>$outputlangs, 'labeltouse'=>$labeltouse);
if (!isset($action)) {
$action = '';
}

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2021 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2022 Anthony Berton <anthony.berton@bb2a.fr>
*
* 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
@ -394,9 +395,9 @@ class Utils
continue;
}
fwrite($handle, $read.($execmethod == 2 ? '' : "\n"));
if (preg_match('/'.preg_quote('-- Dump completed').'/i', $read)) {
if (preg_match('/'.preg_quote('-- Dump completed', '/').'/i', $read)) {
$ok = 1;
} elseif (preg_match('/'.preg_quote('SET SQL_NOTES=@OLD_SQL_NOTES').'/i', $read)) {
} elseif (preg_match('/'.preg_quote('SET SQL_NOTES=@OLD_SQL_NOTES', '/').'/i', $read)) {
$ok = 1;
}
}
@ -847,8 +848,13 @@ class Utils
$resarray = $utils->executeCLI($command, $outfile);
if ($resarray['result'] != '0') {
$this->error = $resarray['error'].' '.$resarray['output'];
$this->errors[] = $this->error;
}
$result = ($resarray['result'] == 0) ? 1 : 0;
if ($result < 0 && empty($this->errors)) {
$this->error = $langs->trans("ErrorFailToGenerateFile", $FILENAMEDOC);
$this->errors[] = $this->error;
}
// Build PDF doc
$command = $conf->global->MODULEBUILDER_ASCIIDOCTORPDF.' '.$destfile.' -n -o '.$dirofmoduledoc.'/'.$FILENAMEDOCPDF;
@ -856,8 +862,13 @@ class Utils
$resarray = $utils->executeCLI($command, $outfile);
if ($resarray['result'] != '0') {
$this->error = $resarray['error'].' '.$resarray['output'];
$this->errors[] = $this->error;
}
$result = ($resarray['result'] == 0) ? 1 : 0;
if ($result < 0 && empty($this->errors)) {
$this->error = $langs->trans("ErrorFailToGenerateFile", $FILENAMEDOCPDF);
$this->errors[] = $this->error;
}
chdir($currentdir);
} else {
@ -868,8 +879,6 @@ class Utils
return 1;
} else {
$error++;
$langs->load("errors");
$this->error = $langs->trans("ErrorFailToGenerateFile", $outputfiledoc);
}
} else {
$error++;
@ -1176,4 +1185,112 @@ class Utils
return 1;
}
/**
* Make a send last backup of database or fil in param
* CAN BE A CRON TASK
*
* @param string $sendto Recipients emails
* @param string $from Sender email
* @param string $subject Topic/Subject of mail
* @param string $message Message
* @param string $filename List of files to attach (full path of filename on file system)
* @param string $filter Filter file send
* @return int 0 if OK, < 0 if KO (this function is used also by cron so only 0 is OK)
*/
public function sendBackup($sendto = '', $from = '', $subject = '', $message = '', $filename = '', $filter = '')
{
global $conf, $langs;
$filepath = '';
$output = '';
$error = 0;
if (!empty($from)) {
$from = dol_escape_htmltag($from);
} elseif (!empty($conf->global->MAIN_INFO_SOCIETE_MAIL)) {
$from = dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_MAIL);
} else {
$error++;
}
if (!empty($sendto)) {
$sendto = dol_escape_htmltag($sendto);
} elseif (!empty($conf->global->MAIN_INFO_SOCIETE_MAIL)) {
$from = dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_MAIL);
} else {
$error++;
}
if (!empty($subject)) {
$subject = dol_escape_htmltag($subject);
} else {
$subject = dol_escape_htmltag($langs->trans('MakeSendLocalDatabaseDumpShort'));
}
if (empty($message)) {
$message = dol_escape_htmltag($langs->trans('MakeSendLocalDatabaseDumpShort'));
}
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
if ($filename) {
if (dol_is_file($conf->admin->dir_output.'/backup/'.$filename)) {
$tmpfiles = dol_most_recent_file($conf->admin->dir_output.'/backup', $filename);
}
} else {
$tmpfiles = dol_most_recent_file($conf->admin->dir_output.'/backup', $filter);
}
if ($tmpfiles) {
foreach ($tmpfiles as $key => $val) {
if ($key == 'fullname') {
$filepath = array($val);
$filesize = dol_filesize($val);
}
if ($key == 'type') {
$mimetype = array($val);
}
if ($key == 'relativename') {
$filename = array($val);
}
}
}
if ($filepath) {
if ($filesize > 100000000) {
$output = 'Sorry, last backup file is too large to be send by email';
$error++;
}
} else {
$output = 'No backup file found';
$error++;
}
if (!$error) {
include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, '', '', 0, -1);
if ($mailfile->error) {
$error++;
$output = $mailfile->error;
}
}
if (!$error) {
$result = $mailfile->sendfile();
if ($result <= 0) {
$error++;
$output = $mailfile->error;
}
}
dol_syslog(__METHOD__, LOG_DEBUG);
$this->error = $error;
$this->output = $output;
if ($result == true) {
return 0;
} else {
return $result;
}
}
}

View File

@ -65,6 +65,7 @@ function SetCurrentFolder( resourceType, folderPath )
function OnSubmit()
{
console.log("Click on OnSubmit");
if ( document.getElementById('NewFile').value.length == 0 )
{
alert( 'Please select a file from your computer' );
@ -80,6 +81,8 @@ function OnSubmit()
function OnUploadCompleted( errorNumber, data )
{
console.log("errorNumber = "+errorNumber);
// Reset the Upload Worker Frame.
window.parent.frames['frmUploadWorker'].location = 'javascript:void(0)' ;
@ -106,7 +109,7 @@ function OnUploadCompleted( errorNumber, data )
alert( 'A file with the same name is already available. The uploaded file has been renamed to "' + data + '"' );
break;
case 202:
alert( 'Invalid file' );
alert( 'Invalid file (Bad extension)' );
break;
default:
alert( 'Error on file upload. Error number: ' + errorNumber );

View File

@ -203,12 +203,17 @@ function FileUpload($resourceType, $currentFolder, $sCommand, $CKEcallback = '')
$oFile = isset($_FILES['NewFile']) ? $_FILES['NewFile'] : $_FILES['upload'];
// $resourceType should be 'Image';
$detectHtml = 0;
// Map the virtual path to the local server path.
$sServerDir = ServerMapFolder($resourceType, $currentFolder, $sCommand);
// Get the uploaded file name.
$sFileName = $oFile['name'];
$sFileName = SanitizeFileName($sFileName);
//$sFileName = SanitizeFileName($sFileName);
$sFileName = dol_sanitizeFileName($sFileName);
$sOriginalFileName = $sFileName;
@ -216,6 +221,8 @@ function FileUpload($resourceType, $currentFolder, $sCommand, $CKEcallback = '')
$sExtension = substr($sFileName, (strrpos($sFileName, '.') + 1));
$sExtension = strtolower($sExtension);
//var_dump($Config);
/*
if (isset($Config['SecureImageUploads'])) {
if (($isImageValid = IsImageValid($oFile['tmp_name'], $sExtension)) === false) {
$sErrorNumber = '202';
@ -228,6 +235,14 @@ function FileUpload($resourceType, $currentFolder, $sCommand, $CKEcallback = '')
$sErrorNumber = '202';
}
}
*/
include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
$isImageValid = image_format_supported($sFileName) > 0 ? true : false;
if (!$isImageValid) {
$sErrorNumber = '202';
}
// Check if it is an allowed extension.
if (!$sErrorNumber && IsAllowedExt($sExtension, $resourceType)) {
@ -241,7 +256,8 @@ function FileUpload($resourceType, $currentFolder, $sCommand, $CKEcallback = '')
$sFileName = RemoveExtension($sOriginalFileName).'('.$iCounter.').'.$sExtension;
$sErrorNumber = '201';
} else {
move_uploaded_file($oFile['tmp_name'], $sFilePath);
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
dol_move_uploaded_file($oFile['tmp_name'], $sFilePath, 0, 0);
if (is_file($sFilePath)) {
if (isset($Config['ChmodOnUpload']) && !$Config['ChmodOnUpload']) {

View File

@ -408,7 +408,8 @@ EOF;
}
$rpl = array('\\' => '\\\\', '"' => '\\"');
echo 'window.parent.OnUploadCompleted('.$errorNumber.',"'.strtr($fileUrl, $rpl).'","'.strtr($fileName, $rpl).'", "'.strtr($customMsg, $rpl).'");';
echo 'console.log('.$errorNumber.');';
echo 'window.parent.OnUploadCompleted('.$errorNumber.', "'.strtr($fileUrl, $rpl).'", "'.strtr($fileName, $rpl).'", "'.strtr($customMsg, $rpl).'");';
echo '</script>';
exit;
}

View File

@ -22,11 +22,12 @@
* This is the "File Uploader" for PHP.
*/
require 'config.php';
require 'config.php'; // This include the main.inc.php
require 'util.php';
require 'io.php';
require 'commands.php';
/**
* SendError
*
@ -63,6 +64,7 @@ if (!IsAllowedType($sType)) {
}
// @CHANGE
//FileUpload( $sType, $sCurrentFolder, $sCommand )

View File

@ -1187,9 +1187,9 @@ $(document).ready(function() {
});
<?php } ?>
// Force to hide menus when page is inside an iFrame
// Force to hide menus when page is inside an iFrame so we can show any page into a dialog popup
$(document).ready(function() {
if (window.location !== window.parent.location ) {
if (window.location && window.location.pathname.indexOf("externalsite/frametop.php") == -1 && window.location !== window.parent.location ) {
console.log("Page is detected to be into an iframe, we hide by CSS the menus");
// The page is in an iframe
jQuery(".side-nav-vert, .side-nav, .websitebar").hide();

View File

@ -3465,14 +3465,18 @@ function dol_print_address($address, $htmlid, $element, $id, $noprint = 0, $char
*
* @param string $address email (Ex: "toto@examle.com". Long form "John Do <johndo@example.com>" will be false)
* @param int $acceptsupervisorkey If 1, the special string '__SUPERVISOREMAIL__' is also accepted as valid
* @param int $acceptuserkey If 1, the special string '__USER_EMAIL__' is also accepted as valid
* @return boolean true if email syntax is OK, false if KO or empty string
* @see isValidMXRecord()
*/
function isValidEmail($address, $acceptsupervisorkey = 0)
function isValidEmail($address, $acceptsupervisorkey = 0, $acceptuserkey = 0)
{
if ($acceptsupervisorkey && $address == '__SUPERVISOREMAIL__') {
return true;
}
if ($acceptuserkey && $address == '__USER_EMAIL__') {
return true;
}
if (filter_var($address, FILTER_VALIDATE_EMAIL)) {
return true;
}
@ -8344,7 +8348,7 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1'
if ($onlysimplestring == '1') {
// We must accept: '1 && getDolGlobalInt("doesnotexist1") && $conf->global->MAIN_FEATURES_LEVEL'
// We must accept: '$conf->barcode->enabled && preg_match(\'/^(AAA|BBB)/\',$leftmenu)'
if (preg_match('/[^a-z0-9\s'.preg_quote('^$_->&|=!?():"\',/', '/').']/i', $s)) {
if (preg_match('/[^a-z0-9\s'.preg_quote('^$_+-*>&|=!?():"\',/', '/').']/i', $s)) {
if ($returnvalue) {
return 'Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s;
} else {
@ -8356,7 +8360,7 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1'
}
} elseif ($onlysimplestring == '2') {
// We must accept: (($reloadedobj = new Task($db)) && ($reloadedobj->fetchNoCompute($object->id) > 0) && ($secondloadedobj = new Project($db)) && ($secondloadedobj->fetchNoCompute($reloadedobj->fk_project) > 0)) ? $secondloadedobj->ref : "Parent project not found"
if (preg_match('/[^a-z0-9\s'.preg_quote('^$_->&|=!?():"\',/;[]', '/').']/i', $s)) {
if (preg_match('/[^a-z0-9\s'.preg_quote('^$_+-*>&|=!?():"\',/;[]', '/').']/i', $s)) {
if ($returnvalue) {
return 'Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s;
} else {
@ -10118,19 +10122,19 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st
* @param int $userRight user action right
* // phpcs:disable
* @param array $params = [ // Various params for future : recommended rather than adding more function arguments
* 'attr' => [ // to add or override button attributes
* 'xxxxx' => '', // your xxxxx attribute you want
* 'class' => '', // to add more css class to the button class attribute
* 'classOverride' => '' // to replace class attribute of the button
* ],
* 'confirm' => [
* 'url' => 'http://', // Overide Url to go when user click on action btn, if empty default url is $url.?confirm=yes, for no js compatibility use $url for fallback confirm.
* 'title' => '', // Overide title of modal, if empty default title use "ConfirmBtnCommonTitle" lang key
* 'action-btn-label' => '', // Overide label of action button, if empty default label use "Confirm" lang key
* 'cancel-btn-label' => '', // Overide label of cancel button, if empty default label use "CloseDialog" lang key
* 'content' => '', // Overide text of content, if empty default content use "ConfirmBtnCommonContent" lang key
* 'modal' => true, // true|false to display dialog as a modal (with dark background)
* ],
* 'attr' => [ // to add or override button attributes
* 'xxxxx' => '', // your xxxxx attribute you want
* 'class' => '', // to add more css class to the button class attribute
* 'classOverride' => '' // to replace class attribute of the button
* ],
* 'confirm' => [
* 'url' => 'http://', // Overide Url to go when user click on action btn, if empty default url is $url.?confirm=yes, for no js compatibility use $url for fallback confirm.
* 'title' => '', // Overide title of modal, if empty default title use "ConfirmBtnCommonTitle" lang key
* 'action-btn-label' => '', // Overide label of action button, if empty default label use "Confirm" lang key
* 'cancel-btn-label' => '', // Overide label of cancel button, if empty default label use "CloseDialog" lang key
* 'content' => '', // Overide text of content, if empty default content use "ConfirmBtnCommonContent" lang key
* 'modal' => true, // true|false to display dialog as a modal (with dark background)
* ],
* ]
* // phpcs:enable
* @return string html button
@ -10142,7 +10146,7 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url =
$class = 'butAction';
if ($actionType == 'danger' || $actionType == 'delete') {
$class = 'butActionDelete';
if (strpos($url, 'token=') === false) $url .= '&token='.newToken();
if (!empty($url) && strpos($url, 'token=') === false) $url .= '&token='.newToken();
}
$attr = array(
@ -10153,6 +10157,7 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url =
if (empty($html)) {
$html = $label;
$attr['title'] = ''; // if html not set, leave label on title is redundant
} else {
$attr['aria-label'] = $label;
}
@ -10166,6 +10171,7 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url =
$attr['id'] = $id;
}
// Override attr
if (!empty($params['attr']) && is_array($params['attr'])) {
foreach ($params['attr'] as $key => $value) {
@ -10179,6 +10185,11 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url =
}
}
// automatic add tooltip when title is detected
if (!empty($attr['title']) && !empty($attr['class']) && strpos($attr['class'], 'classfortooltip') === false) {
$attr['class'].= ' classfortooltip';
}
// Js Confirm button
if ($userRight && !empty($params['confirm'])) {
if (!is_array($params['confirm'])) {
@ -10556,7 +10567,7 @@ function isAFileWithExecutableContent($filename)
*/
function newToken()
{
return $_SESSION['newtoken'];
return empty($_SESSION['newtoken']) ? '' : $_SESSION['newtoken'];
}
/**

View File

@ -1561,8 +1561,8 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
$disabledtask = 1;
}
// Form to add new time
print '<td class="nowrap leftborder center">';
// Select hour
print '<td class="nowraponall leftborder center minwidth150imp">';
$tableCell = $form->selectDate($preselectedday, $lines[$i]->id, 1, 1, 2, "addtime", 0, 0, $disabledtask);
print $tableCell;
print '</td>';

View File

@ -119,11 +119,9 @@ function getOnlineSignatureUrl($mode, $type, $ref = '', $localorexternal = 1)
}
// For multicompany
/*
if (!empty($out)) {
$out .= "&entity=".$conf->entity; // Check the entity because He may be the same reference in several entities
if (!empty($out) && !empty($conf->multicompany->enabled)) {
$out .= "&entity=".$conf->entity; // Check the entity because we may have the same reference in several entities
}
*/
return $out;
}

View File

@ -66,11 +66,29 @@ function tax_prepare_head(ChargeSociales $object)
$head[$h][2] = 'documents';
$h++;
$nbNote = 0;
if (!empty($object->note_private)) {
$nbNote++;
}
if (!empty($object->note_public)) {
$nbNote++;
}
$head[$h][0] = DOL_URL_ROOT.'/compta/sociales/note.php?id='.$object->id;
$head[$h][1] = $langs->trans('Notes');
if ($nbNote > 0) {
$head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '<span class="badge marginleftonlyshort">'.$nbNote.'</span>' : '');
}
$head[$h][2] = 'note';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/compta/sociales/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, 'tax', 'remove');
return $head;

View File

@ -8,28 +8,34 @@ delete from llx_menu where menu_handler=__HANDLER__ and entity=__ENTITY__;
--
-- table llx_menu
--
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', 1__+MAX_llx_menu__, __HANDLER__, 'top', 'home', '', 0, '/index.php?mainmenu=home&amp;leftmenu=', 'Home', -1, '', '', '', 2, 10, __ENTITY__);
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('societe|fournisseur|supplier_order|supplier_invoice', '($conf->societe->enabled && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) || !empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || $conf->supplier_order->enabled || $conf->supplier_invoice->enabled))', 2__+MAX_llx_menu__, __HANDLER__, 'top', 'companies', '', 0, '/societe/index.php?mainmenu=companies&amp;leftmenu=', 'ThirdParties', -1, 'companies', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 20, __ENTITY__);
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('product|service', '$conf->product->enabled || $conf->service->enabled', 3__+MAX_llx_menu__, __HANDLER__, 'top', 'products', '', 0, '/product/index.php?mainmenu=products&amp;leftmenu=', 'ProductsPipeServices', -1, 'products', '$user->rights->produit->lire||$user->rights->service->lire', '', 0, 30, __ENTITY__);
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('bom|mrp', '$conf->bom->enabled || $conf->mrp->enabled', 16__+MAX_llx_menu__, __HANDLER__, 'top', 'mrp', '', 0, '/mrp/index.php?mainmenu=mrp&amp;leftmenu=', 'MRP', -1, 'mrp', '$user->rights->bom->read||$user->rights->mrp->read', '', 0, 31, __ENTITY__);
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('projet', '$conf->projet->enabled', 7__+MAX_llx_menu__, __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&amp;leftmenu=', 'Projects', -1, 'projects', '$user->rights->projet->lire', '', 2, 32, __ENTITY__);
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('propal|commande|fournisseur|supplier_order|supplier_invoice|contrat|ficheinter', '$conf->propal->enabled || $conf->commande->enabled || $conf->supplier_order->enabled || $conf->contrat->enabled || $conf->ficheinter->enabled', 5__+MAX_llx_menu__, __HANDLER__, 'top', 'commercial', '', 0, '/comm/index.php?mainmenu=commercial&amp;leftmenu=', 'Commercial', -1, 'commercial', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 40, __ENTITY__);
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('facture|don|tax|salaries|loan|banque', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->don->enabled || $conf->tax->enabled || $conf->salaries->enabled || $conf->supplier_invoice->enabled || $conf->loan->enabled || $conf->banque->enabled', 6__+MAX_llx_menu__, __HANDLER__, 'top', 'billing', '', 0, '/compta/index.php?mainmenu=billing&amp;leftmenu=', 'MenuFinancial', -1, 'compta', '$user->rights->facture->lire|| $user->rights->don->lire || $user->rights->tax->charges->lire || $user->rights->salaries->read || $user->rights->loan->read || $user->rights->banque->lire', '', 2, 50, __ENTITY__);
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('banque|prelevement', '$conf->banque->enabled || $conf->prelevement->enabled', 14__+MAX_llx_menu__, __HANDLER__, 'top', 'bank', '', 0, '/compta/bank/list.php?mainmenu=bank&amp;leftmenu=bank', 'MenuBankCash', -1, 'banks', '$user->rights->banque->lire || $user->rights->prelevement->bons->lire', '', 0, 52, __ENTITY__);
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('comptabilite|accounting|asset', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->asset->enabled', 9__+MAX_llx_menu__, __HANDLER__, 'top', 'accountancy', '', 0, '/compta/index.php?mainmenu=accountancy&amp;leftmenu=accountancy', 'MenuAccountancy', -1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->mouvements->lire || $user->rights->asset->read', '', 2, 54, __ENTITY__);
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '', 8__+MAX_llx_menu__, __HANDLER__, 'top', 'tools', '', 0, '/core/tools.php?mainmenu=tools&amp;leftmenu=', 'Tools', -1, 'other', '', '', 2, 90, __ENTITY__);
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('adherent', '$conf->adherent->enabled', 13__+MAX_llx_menu__, __HANDLER__, 'top', 'members', '', 0, '/adherents/index.php?mainmenu=members&amp;leftmenu=', 'Members', -1, 'members', '$user->rights->adherent->lire', '', 2, 19, __ENTITY__);
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('hrm|holiday|deplacement|expensereport', '$conf->hrm->enabled || $conf->holiday->enabled || $conf->deplacement->enabled || $conf->expensereport->enabled', 15__+MAX_llx_menu__, __HANDLER__, 'top', 'hrm', '', 0, '/hrm/index.php?mainmenu=hrm&amp;leftmenu=', 'HRM', -1, 'holiday', '$user->rights->user->user->lire || $user->rights->holiday->read || $user->rights->deplacement->lire || $user->rights->expensereport->lire', '', 0, 80, __ENTITY__);
-- Top-Menu
-- old: (module, enabled, rowid, ...)
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 1__+MAX_llx_menu__, '', '1', __HANDLER__, 'top', 'home', '', 0, '/index.php?mainmenu=home&amp;leftmenu=', 'Home', -1, '', '', '', 2, 10, __ENTITY__);
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 2__+MAX_llx_menu__, 'societe|fournisseur|supplier_order|supplier_invoice', '($conf->societe->enabled && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) || !empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || $conf->supplier_order->enabled || $conf->supplier_invoice->enabled))', __HANDLER__, 'top', 'companies', '', 0, '/societe/index.php?mainmenu=companies&amp;leftmenu=', 'ThirdParties', -1, 'companies', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 20, __ENTITY__);
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 3__+MAX_llx_menu__, 'product|service', '$conf->product->enabled || $conf->service->enabled', __HANDLER__, 'top', 'products', '', 0, '/product/index.php?mainmenu=products&amp;leftmenu=', 'ProductsPipeServices', -1, 'products', '$user->rights->produit->lire||$user->rights->service->lire', '', 0, 30, __ENTITY__);
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 16__+MAX_llx_menu__, 'bom|mrp', '$conf->bom->enabled || $conf->mrp->enabled', __HANDLER__, 'top', 'mrp', '', 0, '/mrp/index.php?mainmenu=mrp&amp;leftmenu=', 'MRP', -1, 'mrp', '$user->rights->bom->read||$user->rights->mrp->read', '', 0, 31, __ENTITY__);
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 7__+MAX_llx_menu__, 'projet', '$conf->projet->enabled', __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&amp;leftmenu=', 'Projects', -1, 'projects', '$user->rights->projet->lire', '', 2, 32, __ENTITY__);
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 5__+MAX_llx_menu__, 'propal|commande|fournisseur|supplier_order|supplier_invoice|contrat|ficheinter', '$conf->propal->enabled || $conf->commande->enabled || $conf->supplier_order->enabled || $conf->contrat->enabled || $conf->ficheinter->enabled', __HANDLER__, 'top', 'commercial', '', 0, '/comm/index.php?mainmenu=commercial&amp;leftmenu=', 'Commercial', -1, 'commercial', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 40, __ENTITY__);
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 6__+MAX_llx_menu__, 'facture|don|tax|salaries|loan|banque', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->don->enabled || $conf->tax->enabled || $conf->salaries->enabled || $conf->supplier_invoice->enabled || $conf->loan->enabled || $conf->banque->enabled', __HANDLER__, 'top', 'billing', '', 0, '/compta/index.php?mainmenu=billing&amp;leftmenu=', 'MenuFinancial', -1, 'compta', '$user->rights->facture->lire|| $user->rights->don->lire || $user->rights->tax->charges->lire || $user->rights->salaries->read || $user->rights->loan->read || $user->rights->banque->lire', '', 2, 50, __ENTITY__);
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 14__+MAX_llx_menu__, 'banque|prelevement', '$conf->banque->enabled || $conf->prelevement->enabled', __HANDLER__, 'top', 'bank', '', 0, '/compta/bank/list.php?mainmenu=bank&amp;leftmenu=bank', 'MenuBankCash', -1, 'banks', '$user->rights->banque->lire || $user->rights->prelevement->bons->lire', '', 0, 52, __ENTITY__);
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 9__+MAX_llx_menu__, 'comptabilite|accounting|asset', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->asset->enabled', __HANDLER__, 'top', 'accountancy', '', 0, '/compta/index.php?mainmenu=accountancy&amp;leftmenu=accountancy', 'MenuAccountancy', -1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->mouvements->lire || $user->rights->asset->read', '', 2, 54, __ENTITY__);
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 8__+MAX_llx_menu__, '', '', __HANDLER__, 'top', 'tools', '', 0, '/core/tools.php?mainmenu=tools&amp;leftmenu=', 'Tools', -1, 'other', '', '', 2, 90, __ENTITY__);
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 13__+MAX_llx_menu__, 'adherent', '$conf->adherent->enabled', __HANDLER__, 'top', 'members', '', 0, '/adherents/index.php?mainmenu=members&amp;leftmenu=', 'Members', -1, 'members', '$user->rights->adherent->lire', '', 2, 19, __ENTITY__);
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 15__+MAX_llx_menu__, 'hrm|holiday|deplacement|expensereport', '$conf->hrm->enabled || $conf->holiday->enabled || $conf->deplacement->enabled || $conf->expensereport->enabled', __HANDLER__, 'top', 'hrm', '', 0, '/hrm/index.php?mainmenu=hrm&amp;leftmenu=', 'HRM', -1, 'holiday', '$user->rights->user->user->lire || $user->rights->holiday->read || $user->rights->deplacement->lire || $user->rights->expensereport->lire', '', 0, 80, __ENTITY__);
-- Sub-Menues
-- Home - Dashboard
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', __HANDLER__, 'left', 90__+MAX_llx_menu__, 'home', '', 1__+MAX_llx_menu__, '/index.php', 'MyDashboard', 0, '', '', '', 2, 0, __ENTITY__);
-- Home - Setup
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$user->admin', __HANDLER__, 'left', 100__+MAX_llx_menu__, 'home', 'setup', 1__+MAX_llx_menu__, '/admin/index.php?mainmenu=home&amp;leftmenu=setup', 'Setup', 0, 'admin', '', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 101__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/company.php?mainmenu=home&amp;leftmenu=setup', 'MenuCompanySetup', 1, 'admin', '', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 102__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/ihm.php?mainmenu=home&amp;leftmenu=setup', 'GUISetup', 1, 'admin', '', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 114__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/translation.php?mainmenu=home&amp;leftmenu=setup', 'Translation', 1, 'admin', '', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 115__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/defaultvalues.php?mainmenu=home&amp;leftmenu=setup', 'DefaultValues', 1, 'admin', '', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$user->admin' , __HANDLER__, 'left', 100__+MAX_llx_menu__, 'home', 'setup', 1__+MAX_llx_menu__, '/admin/index.php?mainmenu=home&amp;leftmenu=setup', 'Setup', 0, 'admin', '', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 101__+MAX_llx_menu__, 'home', '' , 100__+MAX_llx_menu__, '/admin/company.php?mainmenu=home&amp;leftmenu=setup', 'MenuCompanySetup', 1, 'admin', '', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 102__+MAX_llx_menu__, 'home', '' , 100__+MAX_llx_menu__, '/admin/ihm.php?mainmenu=home&amp;leftmenu=setup', 'GUISetup', 1, 'admin', '', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 114__+MAX_llx_menu__, 'home', '' , 100__+MAX_llx_menu__, '/admin/translation.php?mainmenu=home&amp;leftmenu=setup', 'Translation', 1, 'admin', '', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 115__+MAX_llx_menu__, 'home', '' , 100__+MAX_llx_menu__, '/admin/defaultvalues.php?mainmenu=home&amp;leftmenu=setup', 'DefaultValues', 1, 'admin', '', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 103__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/modules.php?mainmenu=home&amp;leftmenu=setup', 'Modules', 1, 'admin', '', '', 2, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 104__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/boxes.php?mainmenu=home&amp;leftmenu=setup', 'Boxes', 1, 'admin', '', '', 2, 6, __ENTITY__);
@ -42,6 +48,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 113__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/sms.php?mainmenu=home&amp;leftmenu=setup', 'SMS', 1, 'admin', '', '', 2, 12, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 111__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/dict.php?mainmenu=home&amp;leftmenu=setup', 'Dictionary', 1, 'admin', '', '', 2, 13, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 112__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/const.php?mainmenu=home&amp;leftmenu=setup', 'OtherSetup', 1, 'admin', '', '', 2, 14, __ENTITY__);
-- Home - Admin tools
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$user->admin', __HANDLER__, 'left', 300__+MAX_llx_menu__, 'home', 'admintools', 1__+MAX_llx_menu__, '/admin/tools/index.php?mainmenu=home&amp;leftmenu=admintools', 'AdminTools', 0, 'admin', '', '', 2, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 201__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/system/dolibarr.php?mainmenu=home&amp;leftmenu=admintools', 'InfoDolibarr', 1, 'admin', '', '', 2, 0, __ENTITY__);
@ -62,6 +69,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 311__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/system/about.php?mainmenu=home&amp;leftmenu=admintools', 'ExternalResources', 1, 'admin', '', '', 2, 14, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 320__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/product/admin/product_tools.php?mainmenu=home&amp;leftmenu=admintools', 'ProductVatMassChange', 1, 'products', '', '', 2, 15, __ENTITY__);
-- Home - Menu users and groups
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', __HANDLER__, 'left', 400__+MAX_llx_menu__, 'home', 'users', 1__+MAX_llx_menu__, '/user/home.php?mainmenu=home&amp;leftmenu=users', 'MenuUsersAndGroups', 0, 'users', '', '', 2, 4, __ENTITY__);
@ -84,6 +92,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 507__+MAX_llx_menu__, 'companies', '', 506__+MAX_llx_menu__, '/societe/card.php?mainmenu=companies&amp;leftmenu=prospects&amp;action=create&amp;type=p', 'MenuNewProspect', 2, 'companies', '$user->rights->societe->creer', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 509__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?mainmenu=companies&amp;type=c&leftmenu=customers', 'ListCustomersShort', 1, 'companies', '$user->rights->societe->lire', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 510__+MAX_llx_menu__, 'companies', '', 509__+MAX_llx_menu__, '/societe/card.php?mainmenu=companies&amp;leftmenu=customers&amp;action=create&amp;type=c', 'MenuNewCustomer', 2, 'companies', '$user->rights->societe->creer', '', 2, 0, __ENTITY__);
-- Third parties - Contacts
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 600__+MAX_llx_menu__, 'companies', 'contacts', 2__+MAX_llx_menu__, '/contact/list.php?mainmenu=companies&amp;leftmenu=contacts', 'ContactsAddresses', 0, 'companies', '$user->rights->societe->lire', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 601__+MAX_llx_menu__, 'companies', '', 600__+MAX_llx_menu__, '/contact/card.php?mainmenu=companies&amp;leftmenu=contacts&amp;action=create', 'NewContactAddress', 1, 'companies', '$user->rights->societe->creer', '', 2, 0, __ENTITY__);
@ -92,15 +101,19 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 605__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?mainmenu=companies&amp;leftmenu=contacts&amp;type=c', 'ThirdPartyCustomers', 2, 'companies', '$user->rights->societe->contact->lire', '', 2, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))', __HANDLER__, 'left', 606__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?mainmenu=companies&amp;leftmenu=contacts&amp;type=f', 'ThirdPartySuppliers', 2, 'companies', '$user->rights->societe->contact->lire', '', 2, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 607__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?mainmenu=companies&amp;leftmenu=contacts&amp;type=o', 'Others', 2, 'companies', '$user->rights->societe->contact->lire', '', 2, 4, __ENTITY__);
-- Third parties - Category customer
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled && $conf->categorie->enabled', __HANDLER__, 'left', 650__+MAX_llx_menu__, 'companies', 'cat', 2__+MAX_llx_menu__, '/categories/index.php?mainmenu=companies&amp;leftmenu=cat&amp;type=1', 'SuppliersCategoriesShort', 0, 'categories', '$user->rights->categorie->lire', '', 2, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled && $conf->categorie->enabled', __HANDLER__, 'left', 651__+MAX_llx_menu__, 'companies', '', 650__+MAX_llx_menu__, '/categories/card.php?mainmenu=companies&amp;action=create&amp;type=1', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__);
-- Third parties - Category supplier
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '(!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $conf->categorie->enabled', __HANDLER__, 'left', 660__+MAX_llx_menu__, 'companies', 'cat', 2__+MAX_llx_menu__, '/categories/index.php?mainmenu=companies&amp;leftmenu=cat&amp;type=2', 'CustomersProspectsCategoriesShort', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '(!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $conf->categorie->enabled', __HANDLER__, 'left', 661__+MAX_llx_menu__, 'companies', '', 660__+MAX_llx_menu__, '/categories/card.php?mainmenu=companies&amp;action=create&amp;type=2', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__);
-- Third parties - Category contact
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled && $conf->categorie->enabled', __HANDLER__, 'left', 670__+MAX_llx_menu__, 'companies', 'cat', 2__+MAX_llx_menu__, '/categories/index.php?mainmenu=companies&amp;leftmenu=cat&amp;type=4', 'ContactCategoriesShort', 0, 'categories', '$user->rights->categorie->lire', '', 2, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled && $conf->categorie->enabled', __HANDLER__, 'left', 671__+MAX_llx_menu__, 'companies', '', 670__+MAX_llx_menu__, '/categories/card.php?mainmenu=companies&amp;action=create&amp;type=4', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__);
-- Product - Product
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->product->enabled', __HANDLER__, 'left', 2800__+MAX_llx_menu__, 'products', 'product', 3__+MAX_llx_menu__, '/product/index.php?mainmenu=products&amp;leftmenu=product&amp;type=0', 'Products', 0, 'products', '$user->rights->produit->lire', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->product->enabled', __HANDLER__, 'left', 2801__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/card.php?mainmenu=products&amp;leftmenu=product&amp;action=create&amp;type=0', 'NewProduct', 1, 'products', '$user->rights->produit->creer', '', 2, 0, __ENTITY__);
@ -112,11 +125,13 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->variants->enabled', __HANDLER__, 'left', 2807__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/variants/list.php?mainmenu=products', 'VariantAttributes', 1, 'products', '$user->rights->produit->lire', '', 2, 7, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 2804__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/stats/card.php?mainmenu=products&amp;id=all&amp;leftmenu=stats&amp;type=0', 'Statistics', 1, 'main', '$user->rights->produit->lire', '', 2, 8, __ENTITY__);
-- Product - Services
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->service->enabled', __HANDLER__, 'left', 2900__+MAX_llx_menu__, 'products', 'service', 3__+MAX_llx_menu__, '/product/index.php?mainmenu=products&amp;leftmenu=service&amp;type=1', 'Services', 0, 'products', '$user->rights->service->lire', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->service->enabled', __HANDLER__, 'left', 2901__+MAX_llx_menu__, 'products', '', 2900__+MAX_llx_menu__, '/product/card.php?mainmenu=products&amp;leftmenu=service&amp;action=create&amp;type=1', 'NewService', 1, 'products', '$user->rights->service->creer', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->service->enabled', __HANDLER__, 'left', 2902__+MAX_llx_menu__, 'products', '', 2900__+MAX_llx_menu__, '/product/list.php?mainmenu=products&amp;leftmenu=service&amp;type=1', 'List', 1, 'products', '$user->rights->service->lire', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 2903__+MAX_llx_menu__, 'products', '', 2900__+MAX_llx_menu__, '/product/stats/card.php?mainmenu=products&amp;id=all&amp;leftmenu=stats&amp;type=1', 'Statistics', 1, 'main', '$user->rights->service->lire', '', 2, 5, __ENTITY__);
-- Product - Stocks
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled', __HANDLER__, 'left', 3100__+MAX_llx_menu__, 'products', 'stock', 3__+MAX_llx_menu__, '/product/stock/index.php?mainmenu=products&amp;leftmenu=stock', 'Stock', 0, 'stocks', '$user->rights->stock->lire', '', 2, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled', __HANDLER__, 'left', 3101__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/card.php?mainmenu=products&amp;action=create', 'MenuNewWarehouse', 1, 'stocks', '$user->rights->stock->creer', '', 2, 0, __ENTITY__);
@ -128,11 +143,13 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
-- Product - Categories
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3200__+MAX_llx_menu__, 'products', 'cat', 3__+MAX_llx_menu__, '/categories/index.php?mainmenu=products&amp;leftmenu=cat&amp;type=0', 'Categories', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3201__+MAX_llx_menu__, 'products', '', 3200__+MAX_llx_menu__, '/categories/card.php?mainmenu=products&amp;action=create&amp;type=0', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__);
-- Product - Shipment
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->expedition->enabled', __HANDLER__, 'left', 1300__+MAX_llx_menu__, 'commercial', 'sendings', 3__+MAX_llx_menu__, '/expedition/index.php?mainmenu=commercial&amp;leftmenu=sendings', 'Shipments', 0, 'sendings', '$user->rights->expedition->lire', '', 2, 6, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->expedition->enabled && $leftmenu=="sendings"', __HANDLER__, 'left', 1301__+MAX_llx_menu__, 'commercial', '', 1300__+MAX_llx_menu__, '/expedition/card.php?mainmenu=commercial&amp;action=create2&leftmenu=sendings', 'NewSending', 1, 'sendings', '$user->rights->expedition->creer', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->expedition->enabled && $leftmenu=="sendings"', __HANDLER__, 'left', 1302__+MAX_llx_menu__, 'commercial', '', 1300__+MAX_llx_menu__, '/expedition/list.php?mainmenu=commercial&amp;leftmenu=sendings', 'List', 1, 'sendings', '$user->rights->expedition->lire', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->expedition->enabled && $leftmenu=="sendings"', __HANDLER__, 'left', 1303__+MAX_llx_menu__, 'commercial', '', 1300__+MAX_llx_menu__, '/expedition/stats/index.php?mainmenu=commercial&amp;leftmenu=sendings', 'Statistics', 1, 'sendings', '$user->rights->expedition->lire', '', 2, 2, __ENTITY__);
-- Product - Reception
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->reception->enabled', __HANDLER__, 'left', 1350__+MAX_llx_menu__, 'commercial', 'receptions', 3__+MAX_llx_menu__, '/reception/index.php?mainmenu=commercial&amp;leftmenu=receptions', 'Receptions', 0, 'receptions', '$user->rights->reception->lire', '', 2, 6, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->reception->enabled && $leftmenu=="receptions"', __HANDLER__, 'left', 1351__+MAX_llx_menu__, 'commercial', '', 1350__+MAX_llx_menu__, '/reception/card.php?mainmenu=commercial&amp;action=create2&leftmenu=receptions', 'NewSending', 1, 'receptions', '$user->rights->reception->creer', '', 2, 0, __ENTITY__);
@ -149,6 +166,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1106__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&amp;leftmenu=propals&amp;search_status=3', 'PropalStatusNotSigned', 1, 'propal', '$user->rights->propale->lire', '', 2, 5, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1107__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&amp;leftmenu=propals&amp;search_status=4', 'PropalStatusBilled', 1, 'propal', '$user->rights->propale->lire', '', 2, 6, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1110__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/stats/index.php?mainmenu=commercial&amp;leftmenu=propals', 'Statistics', 1, 'propal', '$user->rights->propale->lire', '', 2, 4, __ENTITY__);
-- Commercial - Customer's orders
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1200__+MAX_llx_menu__, 'commercial', 'orders', 5__+MAX_llx_menu__, '/commande/index.php?mainmenu=commercial&amp;leftmenu=orders', 'CustomersOrders', 0, 'orders', '$user->rights->commande->lire', '', 2, 5, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1201__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/card.php?mainmenu=commercial&amp;action=create&amp;leftmenu=orders', 'NewOrder', 1, 'orders', '$user->rights->commande->creer', '', 2, 0, __ENTITY__);
@ -160,11 +178,13 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled && $leftmenu=="orders"', __HANDLER__, 'left', 1207__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&amp;leftmenu=orders&amp;search_status=4', 'StatusOrderProcessed', 1, 'orders', '$user->rights->commande->lire', '', 2, 6, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled && $leftmenu=="orders"', __HANDLER__, 'left', 1208__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&amp;leftmenu=orders&amp;search_status=-1', 'StatusOrderCanceledShort', 1, 'orders', '$user->rights->commande->lire', '', 2, 7, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1209__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/stats/index.php?mainmenu=commercial&amp;leftmenu=orders', 'Statistics', 1, 'orders', '$user->rights->commande->lire', '', 2, 4, __ENTITY__);
-- Commercial - Supplier's proposals
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_proposal->enabled', __HANDLER__, 'left', 1650__+MAX_llx_menu__, 'commercial', 'propals_supplier', 3__+MAX_llx_menu__, '/supplier_proposal/index.php?leftmenu=propals_supplier', 'SupplierProposalsShort', 0, 'supplier_proposal', '$user->rights->supplier_proposal->lire', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_proposal->enabled', __HANDLER__, 'left', 1651__+MAX_llx_menu__, 'commercial', '', 1650__+MAX_llx_menu__, '/supplier_proposal/card.php?action=create&amp;leftmenu=supplier_proposals', 'SupplierProposalNew', 1, 'supplier_proposal', '$user->rights->supplier_proposal->creer', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_proposal->enabled', __HANDLER__, 'left', 1652__+MAX_llx_menu__, 'commercial', '', 1650__+MAX_llx_menu__, '/supplier_proposal/list.php?leftmenu=supplier_proposals', 'List', 1, 'supplier_proposal', '$user->rights->supplier_proposal->lire', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_proposal->enabled', __HANDLER__, 'left', 1653__+MAX_llx_menu__, 'commercial', '', 1650__+MAX_llx_menu__, '/comm/propal/stats/index.php?leftmenu=supplier_proposals&amp;mode=supplier', 'Statistics', 1, 'supplier_proposal', '$user->rights->supplier_proposal->lire', '', 2, 2, __ENTITY__);
-- Commercial - Supplier's orders
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled', __HANDLER__, 'left', 5100__+MAX_llx_menu__, 'commercial', 'orders_suppliers', 5__+MAX_llx_menu__, '/fourn/commande/index.php?mainmenu=commercial&amp;leftmenu=orders_suppliers', 'SuppliersOrders', 0, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 6, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled', __HANDLER__, 'left', 5101__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/fourn/commande/card.php?mainmenu=commercial&amp;action=create&amp;leftmenu=orders_suppliers', 'NewSupplierOrderShort', 1, 'orders', '($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer)', '', 2, 0, __ENTITY__);
@ -178,6 +198,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5109__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&amp;leftmenu=orders_suppliers&amp;statut=6,7', 'StatusOrderCanceled', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 8, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5110__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&amp;leftmenu=orders_suppliers&amp;statut=9', 'StatusOrderRefused', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 9, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled', __HANDLER__, 'left', 5111__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/commande/stats/index.php?mainmenu=commercial&amp;leftmenu=orders_suppliers&amp;mode=supplier', 'Statistics', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 7, __ENTITY__);
-- Commercial - Contracts
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled', __HANDLER__, 'left', 1400__+MAX_llx_menu__, 'commercial', 'contracts', 5__+MAX_llx_menu__, '/contrat/index.php?mainmenu=commercial&amp;leftmenu=contracts', 'Contracts', 0, 'contracts', '$user->rights->contrat->lire', '', 2, 7, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled', __HANDLER__, 'left', 1401__+MAX_llx_menu__, 'commercial', '', 1400__+MAX_llx_menu__, '/contrat/card.php?mainmenu=commercial&amp;action=create&amp;leftmenu=contracts', 'NewContract', 1, 'contracts', '$user->rights->contrat->creer', '', 2, 0, __ENTITY__);
@ -187,11 +208,13 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled && $leftmenu=="contracts"', __HANDLER__, 'left', 1405__+MAX_llx_menu__, 'commercial', '', 1403__+MAX_llx_menu__, '/contrat/services_list.php?mainmenu=commercial&amp;leftmenu=contracts&amp;mode=4', 'MenuRunningServices', 2, 'contracts', '$user->rights->contrat->lire', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled && $leftmenu=="contracts"', __HANDLER__, 'left', 1406__+MAX_llx_menu__, 'commercial', '', 1403__+MAX_llx_menu__, '/contrat/services_list.php?mainmenu=commercial&amp;leftmenu=contracts&amp;mode=4&amp;filter=expired', 'MenuExpiredServices', 2, 'contracts', '$user->rights->contrat->lire', '', 2, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled && $leftmenu=="contracts"', __HANDLER__, 'left', 1407__+MAX_llx_menu__, 'commercial', '', 1403__+MAX_llx_menu__, '/contrat/services_list.php?mainmenu=commercial&amp;leftmenu=contracts&amp;mode=5', 'MenuClosedServices', 2, 'contracts', '$user->rights->contrat->lire', '', 2, 3, __ENTITY__);
-- Commercial - Interventions
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->ficheinter->enabled', __HANDLER__, 'left', 1500__+MAX_llx_menu__, 'commercial', 'ficheinter', 5__+MAX_llx_menu__, '/fichinter/list.php?mainmenu=commercial&amp;leftmenu=ficheinter', 'Interventions', 0, 'interventions', '$user->rights->ficheinter->lire', '', 2, 8, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->ficheinter->enabled', __HANDLER__, 'left', 1501__+MAX_llx_menu__, 'commercial', '', 1500__+MAX_llx_menu__, '/fichinter/card.php?mainmenu=commercial&amp;action=create&amp;leftmenu=ficheinter', 'NewIntervention', 1, 'interventions', '$user->rights->ficheinter->creer', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->ficheinter->enabled', __HANDLER__, 'left', 1502__+MAX_llx_menu__, 'commercial', '', 1500__+MAX_llx_menu__, '/fichinter/list.php?mainmenu=commercial&amp;leftmenu=ficheinter', 'List', 1, 'interventions', '$user->rights->ficheinter->lire', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->ficheinter->enabled', __HANDLER__, 'left', 1503__+MAX_llx_menu__, 'commercial', '', 1500__+MAX_llx_menu__, '/fichinter/stats/index.php?mainmenu=commercial&amp;leftmenu=ficheinter', 'Statistics', 1, 'interventions', '$user->rights->ficheinter->lire', '', 2, 2, __ENTITY__);
-- Billing - Supplier invoice
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1600__+MAX_llx_menu__, 'billing', 'supplier_bills', 6__+MAX_llx_menu__, '/fourn/facture/list.php?mainmenu=billing&amp;leftmenu=suppliers_bills', 'BillsSuppliers', 0, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1601__+MAX_llx_menu__, 'billing', '', 1600__+MAX_llx_menu__, '/fourn/facture/card.php?mainmenu=billing&amp;action=create&amp;leftmenu=suppliers_bills', 'NewBill', 1, 'bills', '$user->rights->fournisseur->facture->creer', '', 2, 0, __ENTITY__);
@ -200,6 +223,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1603__+MAX_llx_menu__, 'billing', 'suppliers_bills_payment', 1600__+MAX_llx_menu__, '/fourn/facture/paiement.php?mainmenu=billing&amp;leftmenu=suppliers_bills_payment', 'Payments', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1605__+MAX_llx_menu__, 'billing', 'suppliers_bills_reports', 1603__+MAX_llx_menu__, '/fourn/facture/rapport.php?mainmenu=billing&amp;leftmenu=suppliers_bills_reports', 'Reporting', 2, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1604__+MAX_llx_menu__, 'billing', 'customers_bills_stats', 1600__+MAX_llx_menu__, '/compta/facture/stats/index.php?mainmenu=billing&amp;leftmenu=customers_bills_stats&mode=supplier', 'Statistics', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 8, __ENTITY__);
-- Billing - Customer invoice
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1700__+MAX_llx_menu__, 'billing', 'customer_bills', 6__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&amp;leftmenu=customers_bills', 'BillsCustomers', 0, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1701__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/card.php?mainmenu=billing&amp;action=create&amp;leftmenu=customers_bills', 'NewBill', 1, 'bills', '$user->rights->facture->creer', '', 2, 3, __ENTITY__);
@ -215,42 +239,52 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1704__+MAX_llx_menu__, 'billing', 'customers_bills_payment', 1700__+MAX_llx_menu__, '/compta/paiement/list.php?mainmenu=billing&amp;leftmenu=customers_bills_payment', 'Payments', 1, 'bills', '$user->rights->facture->lire', '', 2, 6, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1710__+MAX_llx_menu__, 'billing', 'customers_bills_reports', 1704__+MAX_llx_menu__, '/compta/paiement/rapport.php?mainmenu=billing&amp;leftmenu=customers_bills_reports', 'Reportings', 2, 'bills', '$user->rights->facture->lire', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1714__+MAX_llx_menu__, 'billing', 'customers_bills_stats', 1700__+MAX_llx_menu__, '/compta/facture/stats/index.php?mainmenu=billing&amp;leftmenu=customers_bills_stats', 'Statistics', 1, 'bills', '$user->rights->facture->lire', '', 2, 8, __ENTITY__);
-- Billing - Orders to bill
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1900__+MAX_llx_menu__, 'billing', 'orders', 6__+MAX_llx_menu__, '/commande/list.php?mainmenu=billing&amp;leftmenu=orders&amp;search_status=3', 'MenuOrdersToBill', 0, 'orders', '$user->rights->commande->lire', '', 0, 3, __ENTITY__);
-- Donations
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled', __HANDLER__, 'left', 2000__+MAX_llx_menu__, 'billing', 'donations', 6__+MAX_llx_menu__, '/don/index.php?mainmenu=billing&amp;leftmenu=donations', 'Donations', 0, 'donations', '$user->rights->don->lire', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2001__+MAX_llx_menu__, 'billing', '', 2000__+MAX_llx_menu__, '/don/card.php?mainmenu=billing&amp;leftmenu=donations&amp;action=create', 'NewDonation', 1, 'donations', '$user->rights->don->creer', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2002__+MAX_llx_menu__, 'billing', '', 2000__+MAX_llx_menu__, '/don/list.php?mainmenu=billing&amp;leftmenu=donations', 'List', 1, 'donations', '$user->rights->don->lire', '', 2, 1, __ENTITY__);
-- insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2003__+MAX_llx_menu__, 'billing', '', 2000__+MAX_llx_menu__, '/don/stats/index.php?mainmenu=billing&amp;leftmenu=donations', 'Statistics', 1, 'donations', '$user->rights->don->lire', '', 2, 2, __ENTITY__);
-- Special expenses
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled || $conf->salaries->enabled || $conf->loan->enabled || $conf->banque->enabled', __HANDLER__, 'left', 2200__+MAX_llx_menu__, 'billing', 'tax', 6__+MAX_llx_menu__, '/compta/charges/index.php?mainmenu=billing&amp;leftmenu=tax', 'MenuTaxesAndSpecialExpenses', 0, 'compta', '(! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) || (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) || (! empty($conf->loan->enabled) && $user->rights->loan->read) || (! empty($conf->banque->enabled) && $user->rights->banque->lire)', '', 0, 6, __ENTITY__);
-- Social contributions
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled', __HANDLER__, 'left', 2250__+MAX_llx_menu__, 'billing', 'tax_social', 2200__+MAX_llx_menu__, '/compta/sociales/list.php?mainmenu=billing&amp;leftmenu=tax_social', 'SocialContributions', 1, '', '$user->rights->tax->charges->lire', '', 0, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && $leftmenu=="tax_social"', __HANDLER__, 'left', 2251__+MAX_llx_menu__, 'billing', '', 2250__+MAX_llx_menu__, '/compta/sociales/card.php?mainmenu=billing&amp;leftmenu=tax_social&amp;action=create', 'MenuNewSocialContribution', 2, '', '$user->rights->tax->charges->creer', '', 0, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && $leftmenu=="tax_social"', __HANDLER__, 'left', 2252__+MAX_llx_menu__, 'billing', '', 2250__+MAX_llx_menu__, '/compta/sociales/payments.php?mainmenu=billing&amp;leftmenu=tax_social', 'Payments', 2, '', '$user->rights->tax->charges->lire', '', 0, 3, __ENTITY__);
-- VAT
-- VAT/TVA/IVA
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS)', __HANDLER__, 'left', 2300__+MAX_llx_menu__, 'billing', 'tax_vat', 2200__+MAX_llx_menu__, '/compta/tva/list.php?mainmenu=billing&amp;leftmenu=tax_vat', 'VAT', 1, 'companies', '$user->rights->tax->charges->lire', '', 0, 7, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2301__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/card.php?mainmenu=billing&amp;leftmenu=tax_vat&amp;action=create', 'New', 2, 'companies', '$user->rights->tax->charges->creer', '', 0, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2302__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/list.php?mainmenu=billing&amp;leftmenu=tax_vat', 'List', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2303__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/index.php?mainmenu=billing&amp;leftmenu=tax_vat', 'ReportByMonth', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2304__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/clients.php?mainmenu=billing&amp;leftmenu=tax_vat', 'ReportByThirdparties', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2305__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/quadri_detail.php?mainmenu=billing&amp;leftmenu=tax_vat', 'ReportByQuarter', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 4, __ENTITY__);
-- Salary
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled', __HANDLER__, 'left', 2210__+MAX_llx_menu__, 'billing', 'tax_sal', 6__+MAX_llx_menu__, '/salaries/list.php?mainmenu=billing&amp;leftmenu=tax_salary', 'Salaries', 0, 'salaries', '$user->rights->salaries->read', '', 0, 10, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2211__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/salaries/card.php?mainmenu=billing&amp;leftmenu=tax_salary&amp;action=create', 'NewPayment', 1, 'companies', '$user->rights->salaries->write', '', 0, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2212__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/salaries/list.php?mainmenu=billing&amp;leftmenu=tax_salary', 'Payments', 1, 'companies', '$user->rights->salaries->read', '', 0, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2213__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/salaries/stats/index.php?mainmenu=billing&amp;leftmenu=tax_salary', 'Statistics', 1, 'companies', '$user->rights->salaries->read', '', 0, 4, __ENTITY__);
-- Loan
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled', __HANDLER__, 'left', 2220__+MAX_llx_menu__, 'billing', 'tax_loan', 6__+MAX_llx_menu__, '/loan/list.php?mainmenu=billing&amp;leftmenu=tax_loan', 'Loans', 0, 'loan', '$user->rights->loan->read', '', 0, 20, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2221__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/card.php?mainmenu=billing&amp;leftmenu=tax_loan&amp;action=create', 'NewLoan', 1, 'loan', '$user->rights->loan->write', '', 0, 2, __ENTITY__);
--insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2222__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/payment/list.php?mainmenu=billing&amp;leftmenu=tax_loan', 'Payments', 1, 'companies', '$user->rights->loan->read', '', 0, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan" && ! empty($conf->global->LOAN_SHOW_CALCULATOR)', __HANDLER__, 'left', 2223__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/calc.php?mainmenu=billing&amp;leftmenu=tax_loan', 'Calculator', 1, 'companies', '$user->rights->loan->calc', '', 0, 4, __ENTITY__);
-- Various payments
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled && empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)', __HANDLER__, 'left', 2350__+MAX_llx_menu__, 'billing', 'tax_various', 6__+MAX_llx_menu__, '/compta/bank/various_payment/list.php?mainmenu=billing&amp;leftmenu=tax_various', 'MenuVariousPayment', 0, 'banks', '$user->rights->banque->lire', '', 0, 30, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled && $leftmenu=="tax_various"', __HANDLER__, 'left', 2351__+MAX_llx_menu__, 'billing', '', 2350__+MAX_llx_menu__, '/compta/bank/various_payment/card.php?mainmenu=billing&amp;leftmenu=tax_various&amp;action=create', 'New', 1, 'various_payment', '$user->rights->banque->modifier', '', 0, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled && $leftmenu=="tax_various"', __HANDLER__, 'left', 2352__+MAX_llx_menu__, 'billing', '', 2350__+MAX_llx_menu__, '/compta/bank/various_payment/list.php?mainmenu=billing&amp;leftmenu=tax_various', 'List', 1, 'various_payment', '$user->rights->banque->lire', '', 0, 3, __ENTITY__);
-- Accounting (Double entries)
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2400__+MAX_llx_menu__, 'accountancy', 'accountancy', 9__+MAX_llx_menu__, '/accountancy/index.php?mainmenu=accountancy&amp;leftmenu=accountancy', 'MenuAccountancy', 0, 'main', '! empty($conf->accounting->enabled) || $user->rights->accounting->bind->write || $user->rights->accounting->bind->write || $user->rights->compta->resultat->lire', '', 0, 7, __ENTITY__);
-- Setup
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2451__+MAX_llx_menu__, 'accountancy', 'accountancy_admin', 2400__+MAX_llx_menu__, '/accountancy/index.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'Setup', 1, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 1, __ENTITY__);
@ -271,8 +305,10 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2465__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_export', 2451__+MAX_llx_menu__, '/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'ExportOptions', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 60, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin" && $conf->global->MAIN_FEATURES_LEVEL > 1', __HANDLER__, 'left', 2466__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_closure', 2451__+MAX_llx_menu__, '/accountancy/admin/closure.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuClosureAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 70, __ENTITY__);
-- Accounting period
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin" && $conf->global->MAIN_FEATURES_LEVEL > 0', __HANDLER__, 'left', 2450__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_period', 2451__+MAX_llx_menu__, '/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'FiscalPeriod', 1, 'admin', '', '', 2, 80, __ENTITY__);
-- Binding
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->facture->enabled && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)', __HANDLER__, 'left', 2401__+MAX_llx_menu__, 'accountancy', 'accountancy_dispatch_customer', 2400__+MAX_llx_menu__, '/accountancy/customer/index.php?mainmenu=accountancy&amp;leftmenu=accountancy_dispatch_customer', 'CustomersVentilation', 1, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->facture->enabled && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES) && $leftmenu=="accountancy_dispatch_customer"', __HANDLER__, 'left', 2402__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/list.php?mainmenu=accountancy', 'ToDispatch', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 3, __ENTITY__);
@ -283,22 +319,29 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->expensereport->enabled && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)', __HANDLER__, 'left', 2420__+MAX_llx_menu__, 'accountancy', 'accountancy_dispatch_expensereport', 2400__+MAX_llx_menu__, '/accountancy/expensereport/index.php?mainmenu=accountancy&amp;leftmenu=accountancy_dispatch_expensereport', 'ExpenseReportsVentilation', 1, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 5, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->expensereport->enabled && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS) && $leftmenu=="accountancy_dispatch_expensereport"', __HANDLER__, 'left', 2421__+MAX_llx_menu__, 'accountancy', '', 2420__+MAX_llx_menu__, '/accountancy/expensereport/list.php?mainmenu=accountancy', 'ToDispatch', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 6, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->expensereport->enabled && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS) && $leftmenu=="accountancy_dispatch_expensereport"', __HANDLER__, 'left', 2422__+MAX_llx_menu__, 'accountancy', '', 2420__+MAX_llx_menu__, '/accountancy/expensereport/lines.php?mainmenu=accountancy', 'Dispatched', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 7, __ENTITY__);
-- Export accounting documents
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2436__+MAX_llx_menu__, 'accountancy', 'accountancy_files', 2400__+MAX_llx_menu__, '/compta/accounting-files.php?mainmenu=accountancy&leftmenu=accountancy_files', 'AccountantFiles', 1, 'accountancy', '$user->rights->compta->resultat->lire || $user->rights->accounting->mouvements->lire', '', 0, 16, __ENTITY__);
-- Journals
--insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2705__+MAX_llx_menu__, 'accountancy', '', 2400__+MAX_llx_menu__, '', 'Journalization', 1, 'main', '$user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__);
--insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2707__+MAX_llx_menu__, 'accountancy', '', 2705__+MAX_llx_menu__, '/accountancy/journal/bankjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=3', 'BankJournal', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__);
--insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2708__+MAX_llx_menu__, 'accountancy', '', 2705__+MAX_llx_menu__, '/accountancy/journal/expensereportsjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=6', 'ExpenseReportJournal', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 2, __ENTITY__);
--insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2709__+MAX_llx_menu__, 'accountancy', '', 2705__+MAX_llx_menu__, '/accountancy/journal/purchasesjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=2', 'PurchasesJournal', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 3, __ENTITY__);
--insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2706__+MAX_llx_menu__, 'accountancy', '', 2705__+MAX_llx_menu__, '/accountancy/journal/sellsjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=1', 'SellsJournal', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 4, __ENTITY__);
-- Balance
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2430__+MAX_llx_menu__, 'accountancy', 'balance', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_balance', 'AccountBalance', 1, 'accountancy', '$user->rights->accounting->mouvements->lire', '', 0, 10, __ENTITY__);
-- General Ledger
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2432__+MAX_llx_menu__, 'accountancy', 'bookkeeping', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/listbyaccount.php?mainmenu=accountancy&leftmenu=accountancy_bookeeping', 'Bookkeeping', 1, 'accountancy', '$user->rights->accounting->mouvements->lire', '', 0, 12, __ENTITY__);
-- Journals
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2434__+MAX_llx_menu__, 'accountancy', 'bookkeeping', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/list.php?mainmenu=accountancy&leftmenu=accountancy_bookeeping', 'Journals', 1, 'accountancy', '$user->rights->accounting->mouvements->lire', '', 0, 15, __ENTITY__);
-- Closure
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2437__+MAX_llx_menu__, 'accountancy', 'accountancy_closure', 2400__+MAX_llx_menu__, '/accountancy/closure/index.php?mainmenu=accountancy&leftmenu=accountancy_closure', 'MenuAccountancyClosure', 1, 'accountancy', '$user->rights->accounting->fiscalyear->write', '', 0, 17, __ENTITY__);
-- Reports
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2440__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2400__+MAX_llx_menu__, '/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy_report', 'Reportings', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 17, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2441__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2440__+MAX_llx_menu__, '/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy_report', 'MenuReportInOut', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 18, __ENTITY__);
@ -308,6 +351,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2445__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2444__+MAX_llx_menu__, '/compta/stats/casoc.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByCompanies', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 22, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2446__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2444__+MAX_llx_menu__, '/compta/stats/cabyuser.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByUsers', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 23, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2447__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2444__+MAX_llx_menu__, '/compta/stats/cabyprodserv.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByProductsAndServices', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 24, __ENTITY__);
-- Accounting simple
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled', __HANDLER__, 'left', 2700__+MAX_llx_menu__, 'accountancy', 'ca', 9__+MAX_llx_menu__, '/compta/resultat/index.php?mainmenu=accountancy&amp;leftmenu=ca', 'Reportings', 0, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 11, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2711__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/resultat/index.php?mainmenu=accountancy&amp;leftmenu=ca', 'MenuReportInOut', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__);
@ -316,6 +360,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2714__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/casoc.php?mainmenu=accountancy&amp;leftmenu=ca', 'ByCompanies', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2715__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/cabyuser.php?mainmenu=accountancy&amp;leftmenu=ca', 'ByUsers', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2716__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/cabyprodserv.php?mainmenu=accountancy&amp;leftmenu=ca', 'ByProductsAndServices', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__);
-- Assets
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->asset->enabled', __HANDLER__, 'left', 3000__+MAX_llx_menu__, 'accountancy', 'asset', 9__+MAX_llx_menu__, '/asset/list.php?mainmenu=accountancy&amp;leftmenu=asset', 'MenuAssets', 1, 'assets', '$user->rights->asset->read', '', 0, 20, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->asset->enabled && $leftmenu=="asset"', __HANDLER__, 'left', 3001__+MAX_llx_menu__, 'asset', '', 3000__+MAX_llx_menu__, '/asset/card.php?mainmenu=accountancy&amp;leftmenu=asset&amp;action=create', 'MenuNewAsset', 2, 'assets', '$user->rights->asset->write', '', 0, 21, __ENTITY__);
@ -323,10 +368,12 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->asset->enabled && $leftmenu=="asset"', __HANDLER__, 'left', 3004__+MAX_llx_menu__, 'asset', 'asset_type', 3000__+MAX_llx_menu__, '/asset/type.php?mainmenu=accountancy&amp;leftmenu=asset', 'MenuTypeAssets', 2, 'assets', '$user->rights->asset->read', '', 0, 23, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->asset->enabled && $leftmenu=="asset"', __HANDLER__, 'left', 3005__+MAX_llx_menu__, 'asset', '', 3004__+MAX_llx_menu__, '/asset/type.php?mainmenu=accountancy&amp;action=create', 'MenuNewTypeAssets', 3, 'assets', '$user->rights->asset->setup_advance', '', 0, 24, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->asset->enabled && $leftmenu=="asset"', __HANDLER__, 'left', 3006__+MAX_llx_menu__, 'asset', '', 3004__+MAX_llx_menu__, '/asset/type.php?mainmenu=accountancy', 'MenuListTypeAssets', 3, 'assets', '$user->rights->asset->read', '', 0, 25, __ENTITY__);
-- Check deposit
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && ! empty($conf->banque->enabled) && (! empty($conf->facture->enabled) || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1711__+MAX_llx_menu__, 'accountancy', 'checks', 14__+MAX_llx_menu__, '/compta/paiement/cheque/index.php?mainmenu=bank&amp;leftmenu=checks', 'MenuChequeDeposits', 0, 'bills', '$user->rights->banque->lire', '', 2, 9, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && ! empty($conf->banque->enabled) && (! empty($conf->facture->enabled) || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1712__+MAX_llx_menu__, 'accountancy', '', 1711__+MAX_llx_menu__, '/compta/paiement/cheque/card.php?mainmenu=bank&amp;leftmenu=checks&amp;action=new', 'NewCheckDeposit', 1, 'compta', '$user->rights->banque->lire', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && ! empty($conf->banque->enabled) && (! empty($conf->facture->enabled) || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1713__+MAX_llx_menu__, 'accountancy', '', 1711__+MAX_llx_menu__, '/compta/paiement/cheque/list.php?mainmenu=bank&amp;leftmenu=checks', 'List', 1, 'bills', '$user->rights->banque->lire', '', 2, 1, __ENTITY__);
-- PaymentByDirectDebit
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->prelevement->enabled', __HANDLER__, 'left', 2500__+MAX_llx_menu__, 'accountancy', 'withdraw', 14__+MAX_llx_menu__, '/compta/prelevement/index.php?mainmenu=bank&amp;leftmenu=withdraw', 'PaymentByDirectDebit', 0, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 9, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->prelevement->enabled && $leftmenu=="withdraw"', __HANDLER__, 'left', 2502__+MAX_llx_menu__, 'accountancy', '', 2500__+MAX_llx_menu__, '/compta/prelevement/create.php?mainmenu=bank&amp;leftmenu=withdraw', 'NewStandingOrder', 1, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 0, __ENTITY__);
@ -334,6 +381,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->prelevement->enabled && $leftmenu=="withdraw"', __HANDLER__, 'left', 2504__+MAX_llx_menu__, 'accountancy', '', 2500__+MAX_llx_menu__, '/compta/prelevement/list.php?mainmenu=bank&amp;leftmenu=withdraw', 'WithdrawalsLines', 1, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->prelevement->enabled && $leftmenu=="withdraw"', __HANDLER__, 'left', 2506__+MAX_llx_menu__, 'accountancy', '', 2500__+MAX_llx_menu__, '/compta/prelevement/rejets.php?mainmenu=bank&amp;leftmenu=withdraw', 'Rejects', 1, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 5, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->prelevement->enabled && $leftmenu=="withdraw"', __HANDLER__, 'left', 2507__+MAX_llx_menu__, 'accountancy', '', 2500__+MAX_llx_menu__, '/compta/prelevement/stats.php?mainmenu=bank&amp;leftmenu=withdraw', 'Statistics', 1, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 6, __ENTITY__);
-- PaymentByCreditTransfer
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->prelevement->enabled', __HANDLER__, 'left', 2510__+MAX_llx_menu__, 'accountancy', 'banktransfer', 14__+MAX_llx_menu__, '/compta/prelevement/index.php?mainmenu=bank&amp;leftmenu=banktransfer&amp;type=bank-transfer', 'PaymentByBankTransfer', 0, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 9, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->prelevement->enabled && $leftmenu=="banktransfer"', __HANDLER__, 'left', 2512__+MAX_llx_menu__, 'accountancy', '', 2510__+MAX_llx_menu__, '/compta/prelevement/create.php?mainmenu=bank&amp;leftmenu=banktransfer&amp;type=bank-transfer', 'NewStandingOrder', 1, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 0, __ENTITY__);
@ -341,6 +389,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->prelevement->enabled && $leftmenu=="banktransfer"', __HANDLER__, 'left', 2514__+MAX_llx_menu__, 'accountancy', '', 2510__+MAX_llx_menu__, '/compta/prelevement/list.php?mainmenu=bank&amp;leftmenu=banktransfer&amp;type=bank-transfer', 'WithdrawalsLines', 1, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->prelevement->enabled && $leftmenu=="banktransfer"', __HANDLER__, 'left', 2516__+MAX_llx_menu__, 'accountancy', '', 2510__+MAX_llx_menu__, '/compta/prelevement/rejets.php?mainmenu=bank&amp;leftmenu=banktransfer&amp;type=bank-transfer', 'Rejects', 1, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 5, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->prelevement->enabled && $leftmenu=="banktransfer"', __HANDLER__, 'left', 2517__+MAX_llx_menu__, 'accountancy', '', 2510__+MAX_llx_menu__, '/compta/prelevement/stats.php?mainmenu=bank&amp;leftmenu=banktransfer&amp;type=bank-transfer', 'Statistics', 1, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 6, __ENTITY__);
-- Bank
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled', __HANDLER__, 'left', 2600__+MAX_llx_menu__, 'accountancy', 'bank', 14__+MAX_llx_menu__, '/compta/bank/list.php?mainmenu=bank&amp;leftmenu=bank', 'MenuBankCash', 0, 'banks', '$user->rights->banque->lire', '', 0, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2601__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/card.php?mainmenu=bank&amp;action=create&amp;leftmenu=bank', 'MenuNewFinancialAccount', 1, 'banks', '$user->rights->banque->configurer', '', 0, 0, __ENTITY__);
@ -348,9 +397,12 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2603__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/bankentries_list.php?mainmenu=bank&amp;leftmenu=bank', 'ListTransactions', 1, 'banks', '$user->rights->banque->lire', '', 0, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2604__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/budget.php?mainmenu=bank&amp;leftmenu=bank', 'ListTransactionsByCategory', 1, 'banks', '$user->rights->banque->lire', '', 0, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2606__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/transfer.php?mainmenu=bank&amp;leftmenu=bank', 'BankTransfers', 1, 'banks', '$user->rights->banque->transfer', '', 0, 5, __ENTITY__);
-- Bank - Categories
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 2650__+MAX_llx_menu__, 'accountancy', 'cat', 14__+MAX_llx_menu__, '/categories/index.php?mainmenu=bank&amp;leftmenu=bank&amp;type=5', 'Categories', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 2651__+MAX_llx_menu__, 'accountancy', '', 2650__+MAX_llx_menu__, '/categories/card.php?mainmenu=bank&amp;leftmenu=bank&amp;action=create&amp;type=5', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__);
-- Project
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3600__+MAX_llx_menu__, 'project', 'projects', 7__+MAX_llx_menu__, '/projet/index.php?mainmenu=project&amp;leftmenu=projects', 'LeadsOrProjects', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3601__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/card.php?mainmenu=project&amp;leftmenu=projects&amp;action=create', 'New', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__);
@ -366,19 +418,22 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3400__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/perweek.php?mainmenu=project&amp;leftmenu=projects', 'NewTimeSpent', 0, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__);
-- Project - Categories
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3804__+MAX_llx_menu__, 'project', 'cat', 7__+MAX_llx_menu__, '/categories/index.php?mainmenu=project&amp;leftmenu=cat&amp;type=6', 'Categories', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3805__+MAX_llx_menu__, 'project', '', 3804__+MAX_llx_menu__, '/categories/card.php?mainmenu=project&amp;action=create&amp;type=6', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__);
-- BOM
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->bom->enabled', __HANDLER__, 'left', 5400__+MAX_llx_menu__, 'mrp', 'bom', 16__+MAX_llx_menu__, '/bom/bom_list.php?mainmenu=mrp&amp;leftmenu=bom', 'MenuBOM', 1, 'mrp', '$user->rights->bom->read', '', 0, 20, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->bom->enabled', __HANDLER__, 'left', 5401__+MAX_llx_menu__, 'mrp', '', 5400__+MAX_llx_menu__, '/bom/bom_card.php?mainmenu=mrp&amp;leftmenu=bom&amp;action=create', 'NewBOM', 2, 'mrp', '$user->rights->bom->write', '', 0, 21, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->bom->enabled', __HANDLER__, 'left', 5403__+MAX_llx_menu__, 'mrp', '', 5400__+MAX_llx_menu__, '/bom/bom_list.php?mainmenu=mrp&amp;leftmenu=bom', 'List', 2, 'mrp', '$user->rights->bom->read', '', 0, 22, __ENTITY__);
-- MRP
-- MRP/MO
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->bom->enabled', __HANDLER__, 'left', 5450__+MAX_llx_menu__, 'mrp', 'mrp', 16__+MAX_llx_menu__, '/mrp/mo_list.php?mainmenu=mrp&amp;leftmenu=mrp', 'MenuMRP', 1, 'mrp', '$user->rights->mrp->read', '', 0, 20, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->bom->enabled', __HANDLER__, 'left', 5451__+MAX_llx_menu__, 'mrp', '', 5450__+MAX_llx_menu__, '/mrp/mo_card.php?mainmenu=mrp&amp;leftmenu=mrp&amp;action=create', 'NewMO', 2, 'mrp', '$user->rights->mrp->write', '', 0, 21, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->bom->enabled', __HANDLER__, 'left', 5453__+MAX_llx_menu__, 'mrp', '', 5450__+MAX_llx_menu__, '/mrp/mo_list.php?mainmenu=mrp&amp;leftmenu=mrp', 'List', 2, 'mrp', '$user->rights->mrp->read', '', 0, 22, __ENTITY__);
-- Project - Categories
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3804__+MAX_llx_menu__, 'project', 'cat', 7__+MAX_llx_menu__, '/categories/index.php?mainmenu=project&amp;leftmenu=cat&amp;type=6', 'Categories', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3805__+MAX_llx_menu__, 'project', '', 3804__+MAX_llx_menu__, '/categories/card.php?mainmenu=project&amp;action=create&amp;type=6', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__);
-- Tools
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($user->socid)', __HANDLER__, 'left', 3900__+MAX_llx_menu__, 'tools', 'email_templates', 8__+MAX_llx_menu__, '/admin/mails_templates.php?mainmenu=tools&amp;leftmenu=email_templates', 'EMailTemplates', 0, '', '', '', 0, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->mailing->enabled', __HANDLER__, 'left', 3910__+MAX_llx_menu__, 'tools', 'mailing', 8__+MAX_llx_menu__, '/comm/mailing/index.php?mainmenu=tools&amp;leftmenu=mailing', 'EMailings', 0, 'mails', '$user->rights->mailing->lire', '', 0, 0, __ENTITY__);
@ -388,6 +443,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->export->enabled', __HANDLER__, 'left', 4101__+MAX_llx_menu__, 'tools', '', 4100__+MAX_llx_menu__, '/exports/export.php?mainmenu=tools&amp;leftmenu=export', 'NewExport', 1, 'exports', '$user->rights->export->creer', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->import->enabled', __HANDLER__, 'left', 4130__+MAX_llx_menu__, 'tools', 'import', 8__+MAX_llx_menu__, '/imports/index.php?mainmenu=tools&amp;leftmenu=import', 'FormatedImport', 0, 'exports', '$user->rights->import->run', '', 2, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->import->enabled', __HANDLER__, 'left', 4131__+MAX_llx_menu__, 'tools', '', 4130__+MAX_llx_menu__, '/imports/import.php?mainmenu=tools&amp;leftmenu=import', 'NewImport', 1, 'exports', '$user->rights->import->run', '', 2, 0, __ENTITY__);
-- Members
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4200__+MAX_llx_menu__, 'members', 'members', 13__+MAX_llx_menu__, '/adherents/index.php?mainmenu=members&amp;leftmenu=members', 'Members', 0, 'members', '$user->rights->adherent->lire', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4201__+MAX_llx_menu__, 'members', '', 4200__+MAX_llx_menu__, '/adherents/card.php?mainmenu=members&amp;leftmenu=members&amp;action=create', 'NewMember', 1, 'members', '$user->rights->adherent->creer', '', 2, 0, __ENTITY__);
@ -401,6 +457,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4209__+MAX_llx_menu__, 'members', '', 4200__+MAX_llx_menu__, '/adherents/stats/geo.php?mainmenu=members&amp;leftmenu=members&amp;mode=memberbycountry', 'MenuMembersStats', 1, 'members', '$user->rights->adherent->lire', '', 2, 7, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '! empty($conf->global->MEMBER_LINK_TO_HTPASSWDFILE) && $conf->adherent->enabled', __HANDLER__, 'left', 4502__+MAX_llx_menu__, 'members', '', 4200__+MAX_llx_menu__, '/adherents/htpasswd.php?mainmenu=members&amp;leftmenu=export', 'Filehtpasswd', 1, 'members', '$user->rights->adherent->export', '', 2, 9, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4503__+MAX_llx_menu__, 'members', '', 4200__+MAX_llx_menu__, '/adherents/cartes/carte.php?mainmenu=members&amp;leftmenu=export', 'MembersCards', 1, 'members', '$user->rights->adherent->export', '', 2, 10, __ENTITY__);
-- Members - Subscriptions
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4300__+MAX_llx_menu__, 'members', '', 13__+MAX_llx_menu__, '/adherents/index.php?mainmenu=members&amp;leftmenu=members', 'Subscriptions', 0, 'compta', '$user->rights->adherent->cotisation->lire', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4301__+MAX_llx_menu__, 'members', '', 4300__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&amp;statut=-1&amp;leftmenu=accountancy', 'NewSubscription', 1, 'compta', '$user->rights->adherent->cotisation->creer', '', 2, 0, __ENTITY__);
@ -409,13 +466,17 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4700__+MAX_llx_menu__, 'members', 'setup', 13__+MAX_llx_menu__, '/adherents/type.php?mainmenu=members&amp;leftmenu=setup', 'MembersTypes', 0, 'members', '$user->rights->adherent->configurer', '', 2, 5, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4701__+MAX_llx_menu__, 'members', '', 4700__+MAX_llx_menu__, '/adherents/type.php?mainmenu=members&amp;leftmenu=setup&amp;action=create', 'New', 1, 'members', '$user->rights->adherent->configurer', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4702__+MAX_llx_menu__, 'members', '', 4700__+MAX_llx_menu__, '/adherents/type.php?mainmenu=members&amp;leftmenu=setup', 'List', 1, 'members', '$user->rights->adherent->configurer', '', 2, 1, __ENTITY__);
-- Members - Category member
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled && $conf->categorie->enabled', __HANDLER__, 'left', 5200__+MAX_llx_menu__, 'members', 'cat', 13__+MAX_llx_menu__, '/categories/index.php?mainmenu=members&amp;leftmenu=cat&amp;type=3', 'MembersCategoriesShort', 0, 'categories', '$user->rights->categorie->lire', '', 2, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled && $conf->categorie->enabled', __HANDLER__, 'left', 5201__+MAX_llx_menu__, 'members', '', 5200__+MAX_llx_menu__, '/categories/card.php?mainmenu=members&amp;action=create&amp;type=3', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__);
-- HRM - Employee
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->hrm->enabled', __HANDLER__, 'left', 4600__+MAX_llx_menu__, 'hrm', 'hrm', 15__+MAX_llx_menu__, '/user/list.php?mainmenu=hrm&amp;leftmenu=hrm&mode=employee', 'Employees', 0, 'hrm', '$user->rights->user->user->lire', '', 0, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->hrm->enabled', __HANDLER__, 'left', 4601__+MAX_llx_menu__, 'hrm', '', 4600__+MAX_llx_menu__, '/user/card.php?mainmenu=hrm&amp;action=create&employee=1', 'NewEmployee', 1, 'hrm', '$user->rights->user->user->creer', '', 0, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->hrm->enabled', __HANDLER__, 'left', 4602__+MAX_llx_menu__, 'hrm', '', 4600__+MAX_llx_menu__, '/user/list.php?mainmenu=hrm&amp;leftmenu=hrm&mode=employee&contextpage=employeelist', 'List', 1, 'hrm', '$user->rights->user->user->lire', '', 0, 2, __ENTITY__);
-- HRM - Holiday
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5000__+MAX_llx_menu__, 'hrm', 'hrm', 15__+MAX_llx_menu__, '/holiday/list.php?mainmenu=hrm&amp;leftmenu=hrm', 'CPTitreMenu', 0, 'holiday', '$user->rights->holiday->read', '', 0, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5001__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/card.php?mainmenu=hrm&amp;action=create', 'MenuAddCP', 1, 'holiday', '$user->rights->holiday->write', '', 0, 1, __ENTITY__);
@ -423,11 +484,13 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5003__+MAX_llx_menu__, 'hrm', '', 5002__+MAX_llx_menu__, '/holiday/list.php?mainmenu=hrm&amp;search_statut=2&leftmenu=hrm', 'ListToApprove', 2, 'trips', '$user->rights->holiday->read', '', 0, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5004__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/define_holiday.php?mainmenu=hrm&amp;action=request', 'MenuConfCP', 1, 'holiday', '$user->rights->holiday->define_holiday', '', 0, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5005__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/view_log.php?mainmenu=hrm&amp;action=request', 'MenuLogCP', 1, 'holiday', '$user->rights->holiday->define_holiday', '', 0, 3, __ENTITY__);
-- HRM - Trips and expenses (old module)
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->deplacement->enabled', __HANDLER__, 'left', 2100__+MAX_llx_menu__, 'accountancy', 'tripsandexpenses', 15__+MAX_llx_menu__, '/compta/deplacement/index.php?mainmenu=accountancy&amp;leftmenu=tripsandexpenses', 'TripsAndExpenses', 0, 'trips', '$user->rights->deplacement->lire', '', 0, 5, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->deplacement->enabled', __HANDLER__, 'left', 2101__+MAX_llx_menu__, 'accountancy', '', 2100__+MAX_llx_menu__, '/compta/deplacement/card.php?mainmenu=accountancy&amp;action=create&amp;leftmenu=tripsandexpenses', 'New', 1, 'trips', '$user->rights->deplacement->creer', '', 0, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->deplacement->enabled', __HANDLER__, 'left', 2102__+MAX_llx_menu__, 'accountancy', '', 2100__+MAX_llx_menu__, '/compta/deplacement/list.php?mainmenu=accountancy&amp;leftmenu=tripsandexpenses', 'List', 1, 'trips', '$user->rights->deplacement->lire', '', 0, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->deplacement->enabled', __HANDLER__, 'left', 2103__+MAX_llx_menu__, 'accountancy', '', 2100__+MAX_llx_menu__, '/compta/deplacement/stats/index.php?mainmenu=accountancy&amp;leftmenu=tripsandexpenses', 'Statistics', 1, 'trips', '$user->rights->deplacement->lire', '', 0, 2, __ENTITY__);
-- HRM - Expense reports
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->expensereport->enabled', __HANDLER__, 'left', 5300__+MAX_llx_menu__, 'hrm', 'expensereport', 15__+MAX_llx_menu__, '/expensereport/index.php?mainmenu=hrm&amp;leftmenu=expensereport', 'TripsAndExpenses', 0, 'trips', '$user->rights->expensereport->lire', '', 0, 5, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->expensereport->enabled', __HANDLER__, 'left', 5301__+MAX_llx_menu__, 'hrm', '', 5300__+MAX_llx_menu__, '/expensereport/card.php?mainmenu=hrm&amp;action=create&amp;leftmenu=expensereport', 'New', 1, 'trips', '$user->rights->expensereport->creer', '', 0, 1, __ENTITY__);

File diff suppressed because it is too large Load Diff

View File

@ -261,7 +261,7 @@ class CommActionRapport
if (!preg_match('/^'.preg_quote($obj->label, '/').'/', $obj->note)) {
$text = $obj->label."\n";
}
$text .= dolGetFirstLineOfText(dol_string_nohtmltag($obj->note), 2);
$text .= dolGetFirstLineOfText(dol_string_nohtmltag($obj->note), 1);
// Add status to text
$text .= "\n";
$status = $outputlangs->trans("Status").': '.dol_htmlentitiesbr_decode($eventstatic->getLibStatut(1, 1));

View File

@ -126,8 +126,7 @@ abstract class ModeleNumRefChequeReceipts
}
/**
* \class ModeleChequeReceipts
* \brief Classe mere des modeles de
* Class parent for templates of document generation
*/
abstract class ModeleChequeReceipts extends CommonDocGenerator
{

View File

@ -321,28 +321,28 @@ class pdf_strato extends ModelePDFContract
// Description of product line
if ($objectligne->date_ouverture_prevue) {
$datei = dol_print_date($objectligne->date_ouverture_prevue, 'day', false, $outputlangs, true);
if (!empty($objectligne->date_start)) {
$datei = dol_print_date((int) $objectligne->date_start, 'day', false, $outputlangs, true);
} else {
$datei = $langs->trans("Unknown");
}
if ($objectligne->date_fin_validite) {
$durationi = convertSecondToTime($objectligne->date_fin_validite - $objectligne->date_ouverture_prevue, 'allwithouthour');
$datee = dol_print_date($objectligne->date_fin_validite, 'day', false, $outputlangs, true);
if (!empty($objectligne->date_end)) {
$durationi = convertSecondToTime((int) $objectligne->date_end - (int) $objectligne->date_start, 'allwithouthour');
$datee = dol_print_date($objectligne->date_end, 'day', false, $outputlangs, true);
} else {
$durationi = $langs->trans("Unknown");
$datee = $langs->trans("Unknown");
}
if ($objectligne->date_ouverture) {
$daters = dol_print_date($objectligne->date_ouverture, 'day', false, $outputlangs, true);
if (!empty($objectligne->date_start_real)) {
$daters = dol_print_date((int) $objectligne->date_start_real, 'day', false, $outputlangs, true);
} else {
$daters = $langs->trans("Unknown");
}
if ($objectligne->date_cloture) {
$datere = dol_print_date($objectligne->date_cloture, 'day', false, $outputlangs, true);
if (!empty($objectligne->date_end_real)) {
$datere = dol_print_date((int) $objectligne->date_end_real, 'day', false, $outputlangs, true);
} else {
$datere = $langs->trans("Unknown");
}
@ -363,7 +363,7 @@ class pdf_strato extends ModelePDFContract
if (empty($conf->global->CONTRACT_HIDE_REAL_DATE_ON_PDF)) {
$txt .= '<br>';
$txt .= $outputlangs->transnoentities("DateStartRealShort")." : <strong>".$daters.'</strong>';
if ($objectligne->date_cloture) {
if (!empty($objectligne->date_end_real)) {
$txt .= " - ".$outputlangs->transnoentities("DateEndRealShort")." : '<strong>'".$datere.'</strong>';
}
}

View File

@ -299,11 +299,11 @@ class pdf_crabe extends ModelePDFFactures
// Definition of $dir and $file
if ($object->specimen) {
$dir = $conf->facture->dir_output;
$dir = empty($conf->facture->multidir_output[$conf->entity]) ? $conf->facture->dir_output : $conf->facture->multidir_output[$conf->entity];
$file = $dir."/SPECIMEN.pdf";
} else {
$objectref = dol_sanitizeFileName($object->ref);
$dir = $conf->facture->dir_output."/".$objectref;
$dir = (empty($conf->facture->multidir_output[$conf->entity]) ? $conf->facture->dir_output : $conf->facture->multidir_output[$conf->entity])."/".$objectref;
$file = $dir."/".$objectref.".pdf";
}
if (!file_exists($dir)) {

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2012 Nicolas Villa aka Boyquotes http://informetic.fr
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2022 Anthony Berton <anthony.berton@bb2a.fr>
*
* 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
@ -98,7 +99,8 @@ class modCron extends DolibarrModules
// Cronjobs
$this->cronjobs = array(
0=>array('entity'=>0, 'label'=>'PurgeDeleteTemporaryFilesShort', 'jobtype'=>'method', 'class'=>'core/class/utils.class.php', 'objectname'=>'Utils', 'method'=>'purgeFiles', 'parameters'=>'tempfilesold+logfiles', 'comment'=>'PurgeDeleteTemporaryFiles', 'frequency'=>2, 'unitfrequency'=>3600 * 24 * 7, 'priority'=>50, 'status'=>1, 'test'=>true),
1=>array('entity'=>0, 'label'=>'MakeLocalDatabaseDumpShort', 'jobtype'=>'method', 'class'=>'core/class/utils.class.php', 'objectname'=>'Utils', 'method'=>'dumpDatabase', 'parameters'=>'none,auto,1,auto,10', 'comment'=>'MakeLocalDatabaseDump', 'frequency'=>1, 'unitfrequency'=>3600 * 24 * 7, 'priority'=>90, 'status'=>0, 'test'=>in_array($this->db->type, array('mysql', 'mysqli'))),
1=>array('entity'=>0, 'label'=>'MakeLocalDatabaseDumpShort', 'jobtype'=>'method', 'class'=>'core/class/utils.class.php', 'objectname'=>'Utils', 'method'=>'dumpDatabase', 'parameters'=>'none,auto,1,auto,10', 'comment'=>'MakeLocalDatabaseDump', 'frequency'=>1, 'unitfrequency'=>3600 * 24 * 7, 'priority'=>90, 'status'=>0, 'test'=>'in_array($conf->db->type, array(\'mysql\', \'mysqli\'))'),
2=>array('entity'=>0, 'label'=>'MakeSendLocalDatabaseDumpShort', 'jobtype'=>'method', 'class'=>'core/class/utils.class.php', 'objectname'=>'Utils', 'method'=>'sendDumpDatabase', 'parameters'=>',,,,,sql', 'comment'=>'MakeSendLocalDatabaseDump', 'frequency'=>1, 'unitfrequency'=>604800, 'priority'=>91, 'status'=>0, 'test'=>'!empty($conf->global->MAIN_ALLOW_BACKUP_BY_EMAIL) && in_array($conf->db->type, array(\'mysql\', \'mysqli\'))'),
// 1=>array('entity'=>0, 'label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600*24)
);

View File

@ -857,7 +857,7 @@ class modProduct extends DolibarrModules
}
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
$this->import_examplevalues_array[$r] = array_merge($this->import_examplevalues_array[$r], array(
'sp.packagning'=>'1',
'sp.packaging'=>'10',
));
}

View File

@ -786,7 +786,7 @@ class modService extends DolibarrModules
}
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
$this->import_examplevalues_array[$r] = array_merge($this->import_examplevalues_array[$r], array(
'sp.packagning'=>'1',
'sp.packagning'=>'10',
));
}

View File

@ -5,6 +5,7 @@
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2012-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2022 Ferran Marcet <fmarcet@2byte.es>
*
* 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
@ -480,7 +481,6 @@ class modSociete extends DolibarrModules
's.fax' => "Fax",
's.url' => "Url",
's.email' => "Email",
's.skype' => "Skype",
's.fk_effectif' => "Staff",
's.fk_typent' => "ThirdPartyType",
"s.fk_forme_juridique" => "JuridicalStatus",
@ -621,7 +621,6 @@ class modSociete extends DolibarrModules
's.fax' => "eg. +34987654321",
's.url' => "e.g. https://www.mybigcompany.com",
's.email' => "e.g. test@mybigcompany.com",
's.skype' => "Skype name",
's.fk_effectif' => "1/2/3/5: represents one of the five ranges of employees",
's.fk_typent' => 'matches field "id" (1-9 etc.) OR "code" (TE_SMALL etc.) in table "'.MAIN_DB_PREFIX.'c_typent"',
's.fk_forme_juridique' => '1/2/3 etc...matches field "code" in table "'.MAIN_DB_PREFIX.'c_forme_juridique"',
@ -693,7 +692,6 @@ class modSociete extends DolibarrModules
's.phone_mobile' => "PhoneMobile",
's.fax' => "Fax",
's.email' => "Email",
's.skype' => "Skype",
's.note_private' => "NotePrivate",
's.note_public' => "NotePublic"
);
@ -759,7 +757,6 @@ class modSociete extends DolibarrModules
's.phone_mobile' => "5551144",
's.fax' => "5551155",
's.email' => "johnsmith@email.com",
's.skype' => "skype username",
's.note_private' => "My private note",
's.note_public' => "My public note"
);

View File

@ -109,7 +109,8 @@ class modTicket extends DolibarrModules
3 => array('TICKET_ADDON_PDF_ODT_PATH', 'chaine', 'DOL_DATA_ROOT/doctemplates/tickets', 'Ticket templates ODT/ODS directory for templates', 0),
4 => array('TICKET_AUTO_READ_WHEN_CREATED_FROM_BACKEND', 'chaine', 0, 'Automatically mark ticket as read when created from backend', 0),
5 => array('TICKET_DELAY_BEFORE_FIRST_RESPONSE', 'chaine', '0', 'Maximum wanted elapsed time before a first answer to a ticket (in hours). Display a warning in tickets list if not respected.', 0),
6 => array('TICKET_DELAY_SINCE_LAST_RESPONSE', 'chaine', '0', 'Maximum wanted elapsed time between two answers on the same ticket (in hours). Display a warning in tickets list if not respected.', 0)
6 => array('TICKET_DELAY_SINCE_LAST_RESPONSE', 'chaine', '0', 'Maximum wanted elapsed time between two answers on the same ticket (in hours). Display a warning in tickets list if not respected.', 0),
7 => array('TICKET_NOTIFY_AT_CLOSING', 'chaine', '0', 'Default notify contacts when closing a module', 0),
);

View File

@ -43,20 +43,18 @@ abstract class ModelePDFProduct extends CommonDocGenerator
/**
* Return list of active generation modules
*
* @param DoliDB $db Database handler
* @param DoliDB $dbs Database handler
* @param integer $maxfilenamelength Max length of value to show
* @return array List of templates
*/
public static function liste_modeles($db, $maxfilenamelength = 0)
public static function liste_modeles($dbs, $maxfilenamelength = 0)
{
// phpcs:enable
global $conf;
$type = 'product';
$list = array();
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$list = getListOfModels($db, $type, $maxfilenamelength);
$list = getListOfModels($dbs, $type, $maxfilenamelength);
return $list;
}
}
@ -156,22 +154,22 @@ abstract class ModeleProductCode
/**
* Renvoi la liste des modeles de numérotation
*
* @param DoliDB $db Database handler
* @param DoliDB $dbs Database handler
* @param integer $maxfilenamelength Max length of value to show
* @return array List of numbers
*/
public static function liste_modeles($db, $maxfilenamelength = 0)
public static function liste_modeles($dbs, $maxfilenamelength = 0)
{
// phpcs:enable
$list = array();
$sql = "";
$resql = $db->query($sql);
$resql = $dbs->query($sql);
if ($resql) {
$num = $db->num_rows($resql);
$num = $dbs->num_rows($resql);
$i = 0;
while ($i < $num) {
$row = $db->fetch_row($resql);
$row = $dbs->fetch_row($resql);
$list[$row[0]] = $row[1];
$i++;
}

View File

@ -432,10 +432,12 @@ class pdf_baleine extends ModelePDFProjects
$pdf->MultiCell($this->posxlabel - $this->posxref, 3, $outputlangs->convToOutputCharset($ref), 0, 'L');
// Workload
$pdf->SetXY($this->posxworkload, $curY);
$pdf->SetFont('', '', $default_font_size - 2); // We use a smaller font
$pdf->MultiCell($this->posxprogress - $this->posxworkload, 3, $planned_workload ? $planned_workload : '', 0, 'R');
// Progress
$pdf->SetXY($this->posxprogress, $curY);
$pdf->MultiCell($this->posxdatestart - $this->posxprogress, 3, $progress, 0, 'R');
$pdf->SetFont('', '', $default_font_size - 1); // We restore font
// Date start and end
$pdf->SetXY($this->posxdatestart, $curY);
@ -640,9 +642,11 @@ class pdf_baleine extends ModelePDFProjects
$pdf->SetTextColor(0, 0, 60);
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("DateStart")." : ".dol_print_date($object->date_start, 'day', false, $outputlangs, true), '', 'R');
$posy += 6;
$pdf->SetXY($posx, $posy);
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("DateEnd")." : ".dol_print_date($object->date_end, 'day', false, $outputlangs, true), '', 'R');
if ($object->date_end) {
$posy += 6;
$pdf->SetXY($posx, $posy);
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("DateEnd")." : ".dol_print_date($object->date_end, 'day', false, $outputlangs, true), '', 'R');
}
if (is_object($object->thirdparty)) {
$posy += 6;

View File

@ -41,20 +41,19 @@ abstract class ModeleThirdPartyDoc extends CommonDocGenerator
/**
* Return list of active generation modules
*
* @param DoliDB $db Database handler
* @param DoliDB $dbs Database handler
* @param integer $maxfilenamelength Max length of value to show
* @return array List of templates
*/
public static function liste_modeles($db, $maxfilenamelength = 0)
public static function liste_modeles($dbs, $maxfilenamelength = 0)
{
// phpcs:enable
global $conf;
$type = 'company';
$list = array();
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$list = getListOfModels($db, $type, $maxfilenamelength);
$list = getListOfModels($dbs, $type, $maxfilenamelength);
return $list;
}
@ -161,22 +160,22 @@ abstract class ModeleThirdPartyCode
/**
* Renvoie la liste des modeles de numérotation
*
* @param DoliDB $db Database handler
* @param DoliDB $dbs Database handler
* @param integer $maxfilenamelength Max length of value to show
* @return array|int List of numbers
*/
public static function liste_modeles($db, $maxfilenamelength = 0)
public static function liste_modeles($dbs, $maxfilenamelength = 0)
{
// phpcs:enable
$list = array();
$sql = "";
$resql = $db->query($sql);
$resql = $dbs->query($sql);
if ($resql) {
$num = $db->num_rows($resql);
$num = $dbs->num_rows($resql);
$i = 0;
while ($i < $num) {
$row = $db->fetch_row($resql);
$row = $dbs->fetch_row($resql);
$list[$row[0]] = $row[1];
$i++;
}
@ -401,26 +400,3 @@ abstract class ModeleAccountancyCode
return $langs->trans("NotAvailable");
}
}
/**
* Create a document onto disk according to template module.
*
* @param DoliDB $db Database handler
* @param Facture $object Object invoice
* @param string $message Message (not used, deprecated)
* @param string $modele Force template to use ('' to not force)
* @param Translate $outputlangs objet lang a utiliser pour traduction
* @param int $hidedetails Hide details of lines
* @param int $hidedesc Hide description
* @param int $hideref Hide ref
* @return int <0 if KO, >0 if OK
* @deprecated Use the new function generateDocument of Objects class
* @see Societe::generateDocument()
*/
function thirdparty_doc_create(DoliDB $db, Societe $object, $message, $modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
dol_syslog(__METHOD__." is deprecated", LOG_WARNING);
return $object->generateDocument($modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
}

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2022 Ferran Marcet <fmarcet@2byte.es>
*
* 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
@ -132,7 +133,7 @@ class pdf_standard extends ModelePDFSuppliersPayments
$this->db = $db;
$this->name = "standard";
$this->description = $langs->trans('DocumentModelStandardPDF');
$this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template
$this->update_main_doc_field = 0; // Save the name of generated file as the main doc when generating a doc with this template
// Page size for A4 format
$this->type = 'pdf';

View File

@ -66,7 +66,7 @@ if (in_array($modulepart, array('product', 'produit', 'societe', 'user', 'ticket
* Confirm form to delete a file
*/
if ($action == 'deletefile') {
if ($action == 'deletefile' || $action == 'deletelink') {
$langs->load("companies"); // Need for string DeleteFile+ConfirmDeleteFiles
print $form->formconfirm(
$_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode(GETPOST("urlfile")).'&linkid='.GETPOST('linkid', 'int').(empty($param) ? '' : $param),

View File

@ -122,7 +122,7 @@ if (empty($reshook) && isset($extrafields->attributes[$object->table_element]['l
print ' trextrafields_collapse_last';
}
print '"';
if (empty($extrafields->expand_display[$collapse_group])) {
if (isset($extrafields->expand_display) && empty($extrafields->expand_display[$collapse_group])) {
print ' style="display: none;"';
}
print '>';

View File

@ -212,14 +212,14 @@ if ($massaction == 'presend') {
}
if ($massaction == 'preenable') {
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassEnabling"), $langs->trans("ConfirmMassEnablingQuestion", count($toselect)), "enable", null, '', 0, 200, 500, 1);
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassEnabling"), $langs->trans("ConfirmMassEnablingQuestion", count($toselect)), "enable", null, 'yes', 0, 200, 500, 1);
}
if ($massaction == 'predisable') {
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassDisabling"), $langs->trans("ConfirmMassDisablingQuestion", count($toselect)), "disable", null, '', 0, 200, 500, 1);
}
if ($massaction == 'preapproveleave') {
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassLeaveApproval"), $langs->trans("ConfirmMassLeaveApprovalQuestion", count($toselect)), "approveleave", null, '', 0, 200, 500, 1);
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassLeaveApproval"), $langs->trans("ConfirmMassLeaveApprovalQuestion", count($toselect)), "approveleave", null, 'yes', 0, 200, 500, 1);
}
// Allow Pre-Mass-Action hook (eg for confirmation dialog)

View File

@ -133,77 +133,28 @@ class InterfaceTicketEmail extends DolibarrTriggers
$langs->load('ticket');
$subject_admin = 'TicketNewEmailSubjectAdmin';
$body_admin = 'TicketNewEmailBodyAdmin';
$subject_customer = 'TicketNewEmailSubjectCustomer';
$body_customer = 'TicketNewEmailBodyCustomer';
$see_ticket_customer = 'TicketNewEmailBodyInfosTrackUrlCustomer';
// Send email to notification email
if (!empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO) && empty($object->context['disableticketemail'])) {
$sendto = empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO) ? '' : $conf->global->TICKET_NOTIFICATION_EMAIL_TO;
if ($sendto) {
// Init to avoid errors
$filepath = array();
$filename = array();
$mimetype = array();
/* Send email to admin */
$subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNewEmailSubjectAdmin');
$message_admin = $langs->transnoentities('TicketNewEmailBodyAdmin', $object->track_id).'<br><br>';
$message_admin .= '<ul><li>'.$langs->trans('Title').' : '.$object->subject.'</li>';
$message_admin .= '<li>'.$langs->trans('Type').' : '.$langs->getLabelFromKey($this->db, 'TicketTypeShort'.$object->type_code, 'c_ticket_type', 'code', 'label', $object->type_code).'</li>';
$message_admin .= '<li>'.$langs->trans('Category').' : '.$langs->getLabelFromKey($this->db, 'TicketCategoryShort'.$object->category_code, 'c_ticket_category', 'code', 'label', $object->category_code).'</li>';
$message_admin .= '<li>'.$langs->trans('Severity').' : '.$langs->getLabelFromKey($this->db, 'TicketSeverityShort'.$object->severity_code, 'c_ticket_severity', 'code', 'label', $object->severity_code).'</li>';
$message_admin .= '<li>'.$langs->trans('From').' : '.($object->email_from ? $object->email_from : ($object->fk_user_create > 0 ? $langs->trans('Internal') : '')).'</li>';
// Extrafields
$extraFields = new ExtraFields($this->db);
$extraFields->fetch_name_optionals_label($object->table_element);
if (is_array($object->array_options) && count($object->array_options) > 0) {
foreach ($object->array_options as $key => $value) {
$key = substr($key, 8); // remove "options_"
$message_admin .= '<li>'.$langs->trans($extraFields->attributes[$object->element]['label'][$key]).' : '.$extraFields->showOutputField($key, $value, '', $object->table_element).'</li>';
}
}
$message_admin .= '</ul>';
if ($object->fk_soc > 0) {
$object->fetch_thirdparty();
$message_admin .= '<p>'.$langs->trans('Company').' : '.$object->thirdparty->name.'</p>';
}
$message = $object->message;
if (!dol_textishtml($message)) {
$message = dol_nl2br($message);
}
$message_admin .= '<p>'.$langs->trans('Message').' : <br>'.$message.'</p>';
$message_admin .= '<p><a href="'.dol_buildpath('/ticket/card.php', 2).'?track_id='.$object->track_id.'">'.$langs->trans('SeeThisTicketIntomanagementInterface').'</a></p>';
$from = $conf->global->MAIN_INFO_SOCIETE_NOM.'<'.$conf->global->TICKET_NOTIFICATION_EMAIL_FROM.'>';
$replyto = $from;
$trackid = 'tic'.$object->id;
if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) {
$old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO;
$conf->global->MAIN_MAIL_AUTOCOPY_TO = '';
}
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subject, $sendto, $from, $message_admin, $filepath, $mimetype, $filename, '', '', 0, -1, '', '', $trackid, '', 'ticket');
if ($mailfile->error) {
dol_syslog($mailfile->error, LOG_DEBUG);
} else {
$result = $mailfile->sendfile();
}
if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) {
$conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO;
}
$this->composeAndSendAdminMessage($sendto, $subject_admin, $body_admin, $object, $langs);
}
}
// Send email to customer
if (empty($conf->global->TICKET_DISABLE_CUSTOMER_MAILS) && empty($object->context['disableticketemail']) && $object->notify_tiers_at_create) {
$sendto = '';
//if contact selected send to email's contact else send to email's thirdparty
$contactid = GETPOST('contactid', 'alpha');
$res = 0;
if (!empty($contactid)) {
$contact = new Contact($this->db);
@ -218,77 +169,7 @@ class InterfaceTicketEmail extends DolibarrTriggers
}
if ($sendto) {
// Init to avoid errors
$filepath = array();
$filename = array();
$mimetype = array();
$subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNewEmailSubjectCustomer');
$message_customer = $langs->transnoentities('TicketNewEmailBodyCustomer', $object->track_id).'<br><br>';
$message_customer .= '<ul><li>'.$langs->trans('Title').' : '.$object->subject.'</li>';
$message_customer .= '<li>'.$langs->trans('Type').' : '.$langs->getLabelFromKey($this->db, 'TicketTypeShort'.$object->type_code, 'c_ticket_type', 'code', 'label', $object->type_code).'</li>';
$message_customer .= '<li>'.$langs->trans('Category').' : '.$langs->getLabelFromKey($this->db, 'TicketCategoryShort'.$object->category_code, 'c_ticket_category', 'code', 'label', $object->category_code).'</li>';
$message_customer .= '<li>'.$langs->trans('Severity').' : '.$langs->getLabelFromKey($this->db, 'TicketSeverityShort'.$object->severity_code, 'c_ticket_severity', 'code', 'label', $object->severity_code).'</li>';
// Extrafields
foreach ($this->attributes[$object->table_element]['label'] as $key => $value) {
$enabled = 1;
if ($enabled && isset($this->attributes[$object->table_element]['list'][$key])) {
$enabled = dol_eval($this->attributes[$object->table_element]['list'][$key], 1);
}
$perms = 1;
if ($perms && isset($this->attributes[$object->table_element]['perms'][$key])) {
$perms = dol_eval($this->attributes[$object->table_element]['perms'][$key], 1);
}
$qualified = true;
if (empty($enabled)) {
$qualified = false;
}
if (empty($perms)) {
$qualified = false;
}
if ($qualified) {
$message_customer .= '<li>'.$langs->trans($key).' : '.$value.'</li>';
}
}
$message_customer .= '</ul>';
$message = $object->message;
if (!dol_textishtml($message)) {
$message = dol_nl2br($message);
}
$message_customer .= '<p>'.$langs->trans('Message').' : <br>'.$message.'</p>';
$url_public_ticket = ($conf->global->TICKET_URL_PUBLIC_INTERFACE ? $conf->global->TICKET_URL_PUBLIC_INTERFACE.'/' : dol_buildpath('/public/ticket/view.php', 2)).'?track_id='.$object->track_id;
$message_customer .= '<p>'.$langs->trans('TicketNewEmailBodyInfosTrackUrlCustomer').' : <a href="'.$url_public_ticket.'">'.$url_public_ticket.'</a></p>';
$message_customer .= '<p>'.$langs->trans('TicketEmailPleaseDoNotReplyToThisEmail').'</p>';
$from = (empty($conf->global->MAIN_INFO_SOCIETE_NOM) ? '' : $conf->global->MAIN_INFO_SOCIETE_NOM.' ').'<'.$conf->global->TICKET_NOTIFICATION_EMAIL_FROM.'>';
$replyto = $from;
$trackid = 'tic'.$object->id;
if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) {
$old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO;
$conf->global->MAIN_MAIL_AUTOCOPY_TO = '';
}
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subject, $sendto, $from, $message_customer, $filepath, $mimetype, $filename, '', '', 0, -1, '', '', $trackid, '', 'ticket');
if ($mailfile->error) {
dol_syslog($mailfile->error, LOG_DEBUG);
} else {
$result = $mailfile->sendfile();
if ($result) {
// update last_msg_sent date
$object->date_last_msg_sent = dol_now();
$object->update($user);
}
}
if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) {
$conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO;
}
$this->composeAndSendCustomerMessage($sendto, $subject_customer, $body_customer, $see_ticket_customer, $object, $langs, $conf);
}
}
@ -305,10 +186,226 @@ class InterfaceTicketEmail extends DolibarrTriggers
case 'TICKET_CLOSE':
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
$langs->load('ticket');
$subject_admin = 'TicketCloseEmailSubjectAdmin';
$body_admin = 'TicketCloseEmailBodyAdmin';
$subject_customer = 'TicketCloseEmailSubjectCustomer';
$body_customer = 'TicketCloseEmailBodyCustomer';
$see_ticket_customer = 'TicketCloseEmailBodyInfosTrackUrlCustomer';
// Send email to notification email
if (!empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO) && empty($object->context['disableticketemail'])) {
$sendto = empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO) ? '' : $conf->global->TICKET_NOTIFICATION_EMAIL_TO;
if ($sendto) {
$this->composeAndSendAdminMessage($sendto, $subject_admin, $body_admin, $object, $langs);
}
}
// Send email to customer.
if (empty($conf->global->TICKET_DISABLE_CUSTOMER_MAILS) && empty($object->context['disableticketemail'])) {
$linked_contacts = $object->listeContact(-1, 'thirdparty');
$linked_contacts = array_merge($linked_contacts, $object->listeContact(-1, 'internal'));
if (empty($linked_contacts) && !empty($conf->global->TICKET_NOTIFY_AT_CLOSING) && !empty($object->fk_soc)) {
$object->fetch_thirdparty();
$linked_contacts[] = $object->thirdparty->email;
}
$contactid = GETPOST('contactid', 'int');
$res = 0;
if ($contactid > 0) {
$contact = new Contact($this->db);
$res = $contact->fetch($contactid);
if (! in_array($contact, $linked_contacts)) {
$error_msg = $langs->trans('Error'). ': ';
$error_msg .= $langs->transnoentities('TicketWrongContact');
setEventMessages($error_msg, [], 'errors');
$ok = 0;
break;
}
}
$sendto = '';
if ($res > 0 && !empty($contact->email) && !empty($contact->statut)) {
$sendto = $contact->email;
} elseif ( !empty($linked_contacts) && ($contactid == -2 || (GETPOST('massaction', 'alpha') == 'close' && GETPOST('confirm', 'alpha') == 'yes'))) {
// if sending to all contacts or sending to contacts while mass closing
$temp_emails = [];
foreach ($linked_contacts as $contact) {
$temp_emails[] = $contact['email'];
}
$sendto = implode(", ", $temp_emails);
unset($temp_emails);
unset($linked_contacts);
}
if ($sendto) {
$this->composeAndSendCustomerMessage($sendto, $subject_customer, $body_customer, $see_ticket_customer, $object, $langs, $conf);
}
}
$ok = 1;
break;
}
return $ok;
}
/**
* Composes and sends a message concerning a ticket, to be sent to admin address.
*
* @param string $sendto Addresses to send the mail, format "first@address.net, second@address.net," etc.
* @param string $base_subject email subject. Non-translated string.
* @param string $body email body (first line). Non-translated string.
* @param Ticket $object the ticket thet the email refers to
* @param Translate $langs the translation object
* @return void
*/
private function composeAndSendAdminMessage($sendto, $base_subject, $body, Ticket $object, Translate $langs)
{
global $conf;
// Init to avoid errors
$filepath = array();
$filename = array();
$mimetype = array();
/* Send email to admin */
$subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities($base_subject, $object->ref, $object->track_id);
$message_admin = $langs->transnoentities($body, $object->track_id).'<br>';
$message_admin .= '<ul><li>'.$langs->trans('Title').' : '.$object->subject.'</li>';
$message_admin .= '<li>'.$langs->trans('Type').' : '.$langs->getLabelFromKey($this->db, 'TicketTypeShort'.$object->type_code, 'c_ticket_type', 'code', 'label', $object->type_code).'</li>';
$message_admin .= '<li>'.$langs->trans('Category').' : '.$langs->getLabelFromKey($this->db, 'TicketCategoryShort'.$object->category_code, 'c_ticket_category', 'code', 'label', $object->category_code).'</li>';
$message_admin .= '<li>'.$langs->trans('Severity').' : '.$langs->getLabelFromKey($this->db, 'TicketSeverityShort'.$object->severity_code, 'c_ticket_severity', 'code', 'label', $object->severity_code).'</li>';
$message_admin .= '<li>'.$langs->trans('From').' : '.($object->email_from ? $object->email_from : ($object->fk_user_create > 0 ? $langs->trans('Internal') : '')).'</li>';
// Extrafields
$extraFields = new ExtraFields($this->db);
$extraFields->fetch_name_optionals_label($object->table_element);
if (is_array($object->array_options) && count($object->array_options) > 0) {
foreach ($object->array_options as $key => $value) {
$key = substr($key, 8); // remove "options_"
$message_admin .= '<li>'.$langs->trans($extraFields->attributes[$object->element]['label'][$key]).' : '.$extraFields->showOutputField($key, $value, '', $object->table_element).'</li>';
}
}
if ($object->fk_soc > 0) {
$object->fetch_thirdparty();
$message_admin .= '<li>'.$langs->trans('Company').' : '.$object->thirdparty->name.'</li>';
}
$message_admin .= '</ul>';
$message = $object->message;
if (!dol_textishtml($message)) {
$message = dol_nl2br($message);
}
$message_admin .= '<p>'.$langs->trans('Message').' : <br><br>'.$message.'</p><br>';
$message_admin .= '<p><a href="'.dol_buildpath('/ticket/card.php', 2).'?track_id='.$object->track_id.'">'.$langs->trans('SeeThisTicketIntomanagementInterface').'</a></p>';
$from = $conf->global->MAIN_INFO_SOCIETE_NOM.'<'.$conf->global->TICKET_NOTIFICATION_EMAIL_FROM.'>';
$trackid = 'tic'.$object->id;
if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) {
$old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO;
$conf->global->MAIN_MAIL_AUTOCOPY_TO = '';
}
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subject, $sendto, $from, $message_admin, $filepath, $mimetype, $filename, '', '', 0, -1, '', '', $trackid, '', 'ticket');
if ($mailfile->error) {
dol_syslog($mailfile->error, LOG_DEBUG);
} else {
$result = $mailfile->sendfile();
}
if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) {
$conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO;
}
}
/**
* Composes and sends a message concerning a ticket, to be sent to customer addresses.
*
* @param string $sendto Addresses to send the mail, format "first@address.net, second@address.net, " etc.
* @param string $base_subject email subject. Non-translated string.
* @param string $body email body (first line). Non-translated string.
* @param string $see_ticket string indicating the ticket public address
* @param Ticket $object the ticket thet the email refers to
* @param Translate $langs the translation object
* @return void
*/
private function composeAndSendCustomerMessage($sendto, $base_subject, $body, $see_ticket, Ticket $object, Translate $langs)
{
global $conf, $user;
// Init to avoid errors
$filepath = array();
$filename = array();
$mimetype = array();
$subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities($base_subject);
$message_customer = $langs->transnoentities($body, $object->track_id).'<br>';
$message_customer .= '<ul><li>'.$langs->trans('Title').' : '.$object->subject.'</li>';
$message_customer .= '<li>'.$langs->trans('Type').' : '.$langs->getLabelFromKey($this->db, 'TicketTypeShort'.$object->type_code, 'c_ticket_type', 'code', 'label', $object->type_code).'</li>';
$message_customer .= '<li>'.$langs->trans('Category').' : '.$langs->getLabelFromKey($this->db, 'TicketCategoryShort'.$object->category_code, 'c_ticket_category', 'code', 'label', $object->category_code).'</li>';
$message_customer .= '<li>'.$langs->trans('Severity').' : '.$langs->getLabelFromKey($this->db, 'TicketSeverityShort'.$object->severity_code, 'c_ticket_severity', 'code', 'label', $object->severity_code).'</li>';
// Extrafields
if (is_array($this->attributes[$object->table_element]['label'])) {
foreach ($this->attributes[$object->table_element]['label'] as $key => $value) {
$enabled = 1;
if ($enabled && isset($this->attributes[$object->table_element]['list'][$key])) {
$enabled = dol_eval($this->attributes[$object->table_element]['list'][$key], 1);
}
$perms = 1;
if ($perms && isset($this->attributes[$object->table_element]['perms'][$key])) {
$perms = dol_eval($this->attributes[$object->table_element]['perms'][$key], 1);
}
$qualified = true;
if (empty($enabled)) {
$qualified = false;
}
if (empty($perms)) {
$qualified = false;
}
if ($qualified) {
$message_customer .= '<li>' . $langs->trans($key) . ' : ' . $value . '</li>';
}
}
}
$message_customer .= '</ul>';
$message = $object->message;
if (!dol_textishtml($message)) {
$message = dol_nl2br($message);
}
$message_customer .= '<p>'.$langs->trans('Message').' : <br><br>'.$message.'</p><br>';
$url_public_ticket = ($conf->global->TICKET_URL_PUBLIC_INTERFACE ? $conf->global->TICKET_URL_PUBLIC_INTERFACE.'/' : dol_buildpath('/public/ticket/view.php', 2)).'?track_id='.$object->track_id;
$message_customer .= '<p>'.$langs->trans($see_ticket).' : <a href="'.$url_public_ticket.'">'.$url_public_ticket.'</a></p>';
$message_customer .= '<p>'.$langs->trans('TicketEmailPleaseDoNotReplyToThisEmail').'</p>';
$from = (empty($conf->global->MAIN_INFO_SOCIETE_NOM) ? '' : $conf->global->MAIN_INFO_SOCIETE_NOM.' ').'<'.$conf->global->TICKET_NOTIFICATION_EMAIL_FROM.'>';
$trackid = 'tic'.$object->id;
if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) {
$old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO;
$conf->global->MAIN_MAIL_AUTOCOPY_TO = '';
}
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subject, $sendto, $from, $message_customer, $filepath, $mimetype, $filename, '', '', 0, -1, '', '', $trackid, '', 'ticket');
if ($mailfile->error) {
dol_syslog($mailfile->error, LOG_DEBUG);
} else {
$result = $mailfile->sendfile();
if ($result) {
// update last_msg_sent date
$object->fetch($object->id);
$object->date_last_msg_sent = dol_now();
$object->update($user);
}
}
if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) {
$conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO;
}
}
}

View File

@ -18,17 +18,7 @@
/**
* \file core/triggers/interface_99_modZapier_ZapierTriggers.class.php
* \ingroup zapier
* \brief Example trigger.
*
*
* \remarks You can create other triggers by copying this one.
* - File name should be either:
* - interface_99_modZapier_MyTrigger.class.php
* - interface_99_all_MyTrigger.class.php
* - The file must stay in core/triggers
* - The class name must be InterfaceMytrigger
* - The constructor method must be named InterfaceMytrigger
* - The name property name must be MyTrigger
* \brief File for Zappier Triggers.
*/
require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php';

View File

@ -27,6 +27,11 @@
include_once DOL_DOCUMENT_ROOT.'/website/class/website.class.php';
include_once DOL_DOCUMENT_ROOT.'/website/class/websitepage.class.php';
$website = null;
$websitepage = null;
$weblangs = null;
$pagelangs = null;
// Detection browser (copy of code from main.inc.php)
if (isset($_SERVER["HTTP_USER_AGENT"]) && is_object($conf) && empty($conf->browser->name)) {
$tmp = getBrowserInfo($_SERVER["HTTP_USER_AGENT"]);
@ -68,7 +73,7 @@ if ($pageid > 0) {
$weblangs->setDefaultLang(GETPOSTISSET('lang') ? GETPOST('lang', 'aZ09') : (empty($_COOKIE['weblangs-shortcode']) ? 'auto' : preg_replace('/[^a-zA-Z0-9_\-]/', '', $_COOKIE['weblangs-shortcode'])));
$pagelangs->setDefaultLang($websitepage->lang ? $websitepage->lang : $weblangs->shortlang);
if (!defined('USEDOLIBARREDITOR') && (in_array($websitepage->type_container, array('menu', 'other')) || empty($websitepage->status))) {
if (!defined('USEDOLIBARREDITOR') && (in_array($websitepage->type_container, array('menu', 'other')) || empty($websitepage->status) && !defined('USEDOLIBARRSERVER'))) {
$weblangs->load("website");
http_response_code(404);
print '<center><br><br>'.$weblangs->trans("YouTryToAccessToAFileThatIsNotAWebsitePage", $websitepage->pageurl, $websitepage->type_container, $websitepage->status).'</center>';

View File

@ -478,8 +478,12 @@ if ($num > 0) {
if (empty($obj)) {
break;
}
if (isset($obj->test) && !verifCond($obj->test)) {
continue; // Discard line with test = false
if (isset($obj->test)) {
$veriftest = verifCond($obj->test);
if (!$veriftest) {
continue; // Discard line with test = false
}
}
$object->id = $obj->rowid;

View File

@ -19,7 +19,7 @@
*
*/
print "<!-- BEGIN PHP TEMPLATE don/tpl/linkedopjectblock.tpl.php -->\n";
print "<!-- BEGIN PHP TEMPLATE don/tpl/linkedobjectblock.tpl.php -->\n";
global $user;
global $noMoreLinkedObjectBlockAfter;

View File

@ -327,7 +327,11 @@ class EcmFiles extends CommonObject
$resql = $this->db->query($sql);
if (!$resql) {
$error++;
$this->errors[] = 'Error '.$this->db->lasterror();
if ($this->db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
$this->errors[] = 'Error DB_ERROR_RECORD_ALREADY_EXISTS : '.$this->db->lasterror();
} else {
$this->errors[] = 'Error '.$this->db->lasterror();
}
dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR);
}
@ -365,7 +369,7 @@ class EcmFiles extends CommonObject
* @param string $ref Hash of file name (filename+filepath). Not always defined on some version.
* @param string $relativepath Relative path of file from document directory. Example: 'path/path2/file' or 'path/path2/*'
* @param string $hashoffile Hash of file content. Take the first one found if same file is at different places. This hash will also change if file content is changed.
* @param string $hashforshare Hash of file sharing.
* @param string $hashforshare Hash of file sharing or 'shared'
* @param string $src_object_type src_object_type to search (value of object->table_element)
* @param string $src_object_id src_object_id to search
* @return int <0 if KO, 0 if not found, >0 if OK
@ -421,12 +425,16 @@ class EcmFiles extends CommonObject
$sql .= " AND t.label = '".$this->db->escape($hashoffile)."'";
$sql .= " AND t.entity = ".$conf->entity; // unique key include the entity so each company has its own index
} elseif (!empty($hashforshare)) {
$sql .= " AND t.share = '".$this->db->escape($hashforshare)."'";
if ($hashforshare != 'shared') {
$sql .= " AND t.share = '".$this->db->escape($hashforshare)."'";
} else {
$sql .= " AND t.share IS NOT NULL AND t.share <> ''";
}
//$sql .= " AND t.entity = ".$conf->entity; // hashforshare already unique
} elseif ($src_object_type && $src_object_id) {
// Warning: May return several record, and only first one is returned !
$sql .= " AND t.src_object_type = '".$this->db->escape($src_object_type)."' AND t.src_object_id = ".((int) $src_object_id);
$sql .= " AND t.entity = ".$conf->entity;
$sql .= " AND t.entity = ".((int) $conf->entity);
} else {
$sql .= ' AND t.rowid = '.((int) $id); // rowid already unique
}

View File

@ -23,7 +23,7 @@ if (empty($conf) || !is_object($conf)) {
exit;
}
echo "<!-- BEGIN PHP TEMPLATE eventorganization/tpl/linkedopjectblock.tpl.php -->\n";
echo "<!-- BEGIN PHP TEMPLATE eventorganization/tpl/linkedobjectblock.tpl.php -->\n";
global $user;

View File

@ -1208,6 +1208,7 @@ if ($action == 'create') {
print '<input name="qtyl'.$indiceAsked.'" id="qtyl'.$indiceAsked.'" class="qtyl center" type="text" size="4" value="'.$deliverableQty.'">';
} else {
if (! empty($conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS)) {
print '<input name="idl'.$indiceAsked.'" type="hidden" value="'.$line->id.'">';
print '<input name="qtyl'.$indiceAsked.'" id="qtyl'.$indiceAsked.'" type="hidden" value="0">';
}

View File

@ -367,13 +367,15 @@ class Expedition extends CommonObject
// Insert of lines
$num = count($this->lines);
for ($i = 0; $i < $num; $i++) {
if (!isset($this->lines[$i]->detail_batch)) { // no batch management
if ($this->create_line($this->lines[$i]->entrepot_id, $this->lines[$i]->origin_line_id, $this->lines[$i]->qty, $this->lines[$i]->rang, $this->lines[$i]->array_options) <= 0) {
$error++;
}
} else { // with batch management
if ($this->create_line_batch($this->lines[$i], $this->lines[$i]->array_options) <= 0) {
$error++;
if (empty($this->lines[$i]->product_type) || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
if (!isset($this->lines[$i]->detail_batch)) { // no batch management
if ($this->create_line($this->lines[$i]->entrepot_id, $this->lines[$i]->origin_line_id, $this->lines[$i]->qty, $this->lines[$i]->rang, $this->lines[$i]->array_options) <= 0) {
$error++;
}
} else { // with batch management
if ($this->create_line_batch($this->lines[$i], $this->lines[$i]->array_options) <= 0) {
$error++;
}
}
}
}
@ -913,6 +915,7 @@ class Expedition extends CommonObject
// Copy the rang of the order line to the expedition line
$line->rang = $orderline->rang;
$line->product_type = $orderline->product_type;
if (!empty($conf->stock->enabled) && !empty($orderline->fk_product)) {
$fk_product = $orderline->fk_product;
@ -965,6 +968,8 @@ class Expedition extends CommonObject
}
$this->lines[$num] = $line;
return 1;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@ -2611,6 +2616,12 @@ class ExpeditionLigne extends CommonObjectLine
*/
public $product_desc;
/**
* Type of the product. 0 for product, 1 for service
* @var int
*/
public $product_type = 0;
/**
* @var int rang of line
*/

View File

@ -23,7 +23,7 @@ if (empty($conf) || !is_object($conf)) {
}
print "<!-- BEGIN PHP TEMPLATE expedition/tpl/linkedopjectblock.tpl.php -->\n";
print "<!-- BEGIN PHP TEMPLATE expedition/tpl/linkedobjectblock.tpl.php -->\n";
global $user;

Some files were not shown because too many files have changed in this diff Show More