Merge branch 'develop' of github.com:Dolibarr/dolibarr into new-inventory-category-field
This commit is contained in:
commit
7b7ecf44ad
3
.github/workflows/exakat.yml
vendored
3
.github/workflows/exakat.yml
vendored
@ -5,6 +5,9 @@ on:
|
||||
schedule:
|
||||
- cron: "0 20 * * *"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
exakat:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@ -13,6 +13,7 @@ NEW: PHP 8.1 compatibility
|
||||
NEW: Support for recurring purchase invoices.
|
||||
NEW: #20292 Include German public holidays
|
||||
NEW: Can show ZATCA QRCode on PDFs
|
||||
NEW: Can show Swiss QR Code on PDFs
|
||||
NEW: #17123 added ExtraFields for Stock Mouvement
|
||||
NEW: #20609 : new massaction to assign a sale representatives on a selection of thirdparties
|
||||
NEW: #20653 edit discount pourcentage for all lines in one shot
|
||||
@ -197,7 +198,7 @@ Following changes may create regressions for some external modules, but were nec
|
||||
* Method fetch_all_resources(), fetch_all_used(), fetch_all_available() of DolResource has been removed (they were not used by core code).
|
||||
* Method fetch_all of DolResource has been renamed into fetchAll() to match naming conventions.
|
||||
* The hook 'upgrade' and 'doUpgrade2" has been renamed 'doUpgradeBefore' and 'doUpgradeAfterDB'. A new trigger 'doUpgradeAfterFiles' has been introduced.
|
||||
|
||||
* The context hook 'suppliercard' when on the supplier tab of a thirdparty has been renamed into 'thirdpartysupplier'
|
||||
|
||||
|
||||
***** ChangeLog for 15.0.2 compared to 15.0.1 *****
|
||||
|
||||
@ -499,8 +499,9 @@ if ($nboftargetok) {
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/cache.manifest`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.mysql`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.nova*`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.old`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.postgres`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.pgsql`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf*sav*`;
|
||||
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/mssql/README`;
|
||||
|
||||
@ -20,3 +20,10 @@ https://www.pwc.com/m1/en/services/tax/me-tax-legal-news/2021/saudi-arabia-guide
|
||||
https://www.tecklenborgh.com/post/ksa-zatca-publishes-guide-on-how-to-develop-a-fatoora-compliant-qr-code
|
||||
|
||||
Method to encode/decode ZATCA string is available in test/phpunit/BarcodeTest.php
|
||||
|
||||
|
||||
* FOR QR-Bill in switzerland
|
||||
----------------------------
|
||||
Syntax of QR Code https://www.swiss-qr-invoice.org/fr/
|
||||
Syntax of complentary field named "structured information of invoice S1": https://www.swiss-qr-invoice.org/downloads/qr-bill-s1-syntax-fr.pdf
|
||||
To test/validate: https://www.swiss-qr-invoice.org/validator/
|
||||
@ -350,6 +350,8 @@ if ($resql) {
|
||||
</script>';
|
||||
}
|
||||
|
||||
$newcardbutton = '';
|
||||
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
if ($optioncss != '') {
|
||||
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
|
||||
@ -98,7 +98,6 @@ if (!empty($conf->loan->enabled)) {
|
||||
$list_account[] = 'ACCOUNTING_ACCOUNT_SUSPENSE';
|
||||
if (!empty($conf->societe->enabled)) {
|
||||
$list_account[] = '---Deposits---';
|
||||
$list_account[] = 'ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT';
|
||||
}
|
||||
|
||||
/*
|
||||
@ -106,7 +105,7 @@ if (!empty($conf->societe->enabled)) {
|
||||
*/
|
||||
if ($action == 'update') {
|
||||
$error = 0;
|
||||
|
||||
// Process $list_account_main
|
||||
foreach ($list_account_main as $constname) {
|
||||
$constvalue = GETPOST($constname, 'alpha');
|
||||
|
||||
@ -114,7 +113,7 @@ if ($action == 'update') {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
// Process $list_account
|
||||
foreach ($list_account as $constname) {
|
||||
$reg = array();
|
||||
if (preg_match('/---(.*)---/', $constname, $reg)) { // This is a separator
|
||||
@ -128,6 +127,13 @@ if ($action == 'update') {
|
||||
}
|
||||
}
|
||||
|
||||
$constname = 'ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT';
|
||||
$constvalue = GETPOST($constname, 'int');
|
||||
if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
@ -195,7 +201,8 @@ foreach ($list_account_main as $key) {
|
||||
print '</td>';
|
||||
// Value
|
||||
print '<td class="right">'; // Do not force class=right, or it align also the content of the select box
|
||||
print $formaccounting->select_account($conf->global->$key, $key, 1, '', 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', 'accountsmain');
|
||||
$key_value = getDolGlobalString($key);
|
||||
print $formaccounting->select_account($key_value, $key, 1, '', 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', 'accountsmain');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
@ -246,10 +253,24 @@ foreach ($list_account as $key) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Customer deposit account
|
||||
print '<tr class="oddeven value">';
|
||||
// Param
|
||||
print '<td>';
|
||||
print img_picto('', 'bill', 'class="pictofixedwidth"') . $langs->trans('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT');
|
||||
print '</td>';
|
||||
// Value
|
||||
print '<td class="right">'; // Do not force class=right, or it align also the content of the select box
|
||||
print $formaccounting->select_account(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT'), 'ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT', 1, '', 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', 'accounts');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
if (!empty($conf->societe->enabled)) {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>' . img_picto('', 'bill', 'class="pictofixedwidth"') . $langs->trans("UseAuxiliaryAccountOnCustomerDeposit") . '</td>';
|
||||
if (!empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT)) {
|
||||
if (getDolGlobalInt('ACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT')) {
|
||||
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setdisableauxiliaryaccountoncustomerdeposit&value=0">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on', '', false, 0, 0, '', 'warning');
|
||||
print '</a></td>';
|
||||
@ -264,7 +285,7 @@ if (!empty($conf->societe->enabled)) {
|
||||
print "</table>\n";
|
||||
print "</div>\n";
|
||||
|
||||
print '<div class="center"><input type="submit" class="button button-edit" name="button" value="'.$langs->trans('Modify').'"></div>';
|
||||
print '<div class="center"><input type="submit" class="button button-edit" name="button" value="'.$langs->trans('Save').'"></div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2017-2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2017-2018 Frédéric France <frederic.france@netlogic.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
|
||||
@ -211,7 +211,7 @@ if ($num) {
|
||||
|
||||
// Value
|
||||
print '<td>';
|
||||
print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.$conf->global->$key.'">';
|
||||
print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.getDolGlobalString($key).'">';
|
||||
print '</td></tr>';
|
||||
}
|
||||
}
|
||||
@ -239,7 +239,7 @@ if (!$conf->use_javascript_ajax) {
|
||||
} else {
|
||||
print '<td>';
|
||||
$listmodelcsv = $accountancyexport->getType();
|
||||
print $form->selectarray("ACCOUNTING_EXPORT_MODELCSV", $listmodelcsv, $conf->global->ACCOUNTING_EXPORT_MODELCSV, 0, 0, 0, '', 0, 0, 0, '', '', 1);
|
||||
print $form->selectarray("ACCOUNTING_EXPORT_MODELCSV", $listmodelcsv, getDolGlobalString('ACCOUNTING_EXPORT_MODELCSV'), 0, 0, 0, '', 0, 0, 0, '', '', 1);
|
||||
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
@ -358,7 +358,7 @@ foreach ($list as $key) {
|
||||
print '<td>'.$label.'</td>';
|
||||
// Value
|
||||
print '<td class="right">';
|
||||
print '<input type="text" class="maxwidth100" id="'.$key.'" name="'.$key.'" value="'.$conf->global->$key.'">';
|
||||
print '<input type="text" class="maxwidth100" id="'.$key.'" name="'.$key.'" value="'.getDolGlobalString($key).'">';
|
||||
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
@ -409,12 +409,12 @@ foreach ($list_binding as $key) {
|
||||
// Value
|
||||
print '<td class="right">';
|
||||
if ($key == 'ACCOUNTING_DATE_START_BINDING') {
|
||||
print $form->selectDate(($conf->global->$key ? $db->idate($conf->global->$key) : -1), $key, 0, 0, 1);
|
||||
print $form->selectDate((!empty($conf->global->$key) ? $db->idate($conf->global->$key) : -1), $key, 0, 0, 1);
|
||||
} elseif ($key == 'ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER') {
|
||||
$array = array(0=>$langs->trans("PreviousMonth"), 1=>$langs->trans("CurrentMonth"), 2=>$langs->trans("Fiscalyear"));
|
||||
print $form->selectarray($key, $array, (isset($conf->global->ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER) ? $conf->global->ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER : 0));
|
||||
} else {
|
||||
print '<input type="text" class="maxwidth100" id="'.$key.'" name="'.$key.'" value="'.$conf->global->$key.'">';
|
||||
print '<input type="text" class="maxwidth100" id="'.$key.'" name="'.$key.'" value="'.getDolGlobalString($key).'">';
|
||||
}
|
||||
|
||||
print '</td>';
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
/* Copyright (C) 2017-2022 Alexandre Spangaro <aspangaro@open-dsi.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
|
||||
@ -76,6 +76,8 @@ if (empty($sortorder)) {
|
||||
|
||||
$error = 0;
|
||||
|
||||
$search_country_id = GETPOST('search_country_id', 'int');
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('admin'));
|
||||
|
||||
|
||||
@ -132,6 +132,7 @@ $search_not_reconciled = GETPOST('search_not_reconciled', 'alpha');
|
||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
if (empty($page) || $page < 0) {
|
||||
$page = 0;
|
||||
@ -206,7 +207,7 @@ if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) {
|
||||
|
||||
$accountancyexport = new AccountancyExport($db);
|
||||
$listofformat = $accountancyexport->getType();
|
||||
$formatexportset = $conf->global->ACCOUNTING_EXPORT_MODELCSV;
|
||||
$formatexportset = getDolGlobalString('ACCOUNTING_EXPORT_MODELCSV');
|
||||
if (empty($listofformat[$formatexportset])) {
|
||||
$formatexportset = 1;
|
||||
}
|
||||
@ -913,6 +914,8 @@ if ($massactionbutton && $contextpage != 'poslist') {
|
||||
$selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
|
||||
}
|
||||
|
||||
$moreforfilter = '';
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook)) {
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2016 Neil Orley <neil.orley@oeris.fr>
|
||||
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2020 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -40,6 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
$langs->loadLangs(array("accountancy", "compta"));
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$socid = GETPOST('socid', 'int');
|
||||
$massaction = GETPOST('massaction', 'alpha');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
$toselect = GETPOST('toselect', 'array');
|
||||
@ -104,6 +105,7 @@ if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
if (empty($page) || $page < 0) {
|
||||
$page = 0;
|
||||
@ -571,6 +573,7 @@ $num = count($object->lines);
|
||||
//}
|
||||
|
||||
// Print form confirm
|
||||
$formconfirm = '';
|
||||
print $formconfirm;
|
||||
|
||||
// List of mass actions available
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
/* Copyright (C) 2013 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.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
|
||||
@ -174,7 +174,9 @@ if ($action == 'validatehistory') {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa2 ON " . $alias_product_perentity . ".accountancy_code_sell_intra = aa2.account_number AND aa2.active = 1 AND aa2.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa2.entity = ".$conf->entity;
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa3 ON " . $alias_product_perentity . ".accountancy_code_sell_export = aa3.account_number AND aa3.active = 1 AND aa3.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa3.entity = ".$conf->entity;
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON " . $alias_societe_perentity . ".accountancy_code_sell = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity;
|
||||
$sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0 AND l.product_type <= 2 AND f.entity = ".((int) $conf->entity);
|
||||
$sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
|
||||
$sql .= " AND l.product_type <= 2";
|
||||
$sql .= " AND f.entity IN (".getEntity('invoice', 0).")"; // We don't share object for accountancy
|
||||
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
|
||||
$sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
}
|
||||
|
||||
@ -158,8 +158,8 @@ if (empty($reshook)) {
|
||||
|
||||
// Mass actions
|
||||
$objectclass = 'AccountingAccount';
|
||||
$permissiontoread = $user->rights->accounting->read;
|
||||
$permissiontodelete = $user->rights->accounting->delete;
|
||||
$permissiontoread = $user->hasRight('accounting', 'read');
|
||||
$permissiontodelete = $user->hasRight('accounting', 'delete');
|
||||
$uploaddir = $conf->accounting->dir_output;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
}
|
||||
@ -469,7 +469,7 @@ if ($result) {
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("DescVentilTodoCustomer").'</span></br><br>';
|
||||
|
||||
if ($msg) {
|
||||
if (!empty($msg)) {
|
||||
print $msg.'<br>';
|
||||
}
|
||||
|
||||
|
||||
@ -150,8 +150,8 @@ if (empty($reshook)) {
|
||||
// Mass actions
|
||||
$objectclass = 'ExpenseReport';
|
||||
$objectlabel = 'ExpenseReport';
|
||||
$permissiontoread = $user->rights->expensereport->read;
|
||||
$permissiontodelete = $user->rights->expensereport->delete;
|
||||
$permissiontoread = $user->hasRight('accounting', 'read');
|
||||
$permissiontodelete = $user->hasRight('accounting', 'delete');
|
||||
$uploaddir = $conf->expensereport->dir_output;
|
||||
include DOL_DOCUMENT_ROOT . '/core/actions_massactions.inc.php';
|
||||
}
|
||||
@ -370,7 +370,7 @@ if ($result) {
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("DescVentilTodoExpenseReport").'</span></br><br>';
|
||||
|
||||
if ($msg) {
|
||||
if (!empty($msg)) {
|
||||
print $msg.'<br>';
|
||||
}
|
||||
|
||||
|
||||
@ -305,8 +305,16 @@ if ($result) {
|
||||
|
||||
// get_url may return -1 which is not traversable
|
||||
if (is_array($links) && count($links) > 0) {
|
||||
$is_sc = false;
|
||||
foreach ($links as $v) {
|
||||
if ($v['type'] == 'sc') {
|
||||
$is_sc = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Now loop on each link of record in bank (code similar to bankentries_list.php)
|
||||
foreach ($links as $key => $val) {
|
||||
if ($links[$key]['type'] == 'user' && !$is_sc) continue;
|
||||
if (in_array($links[$key]['type'], array('sc', 'payment_sc', 'payment', 'payment_supplier', 'payment_vat', 'payment_expensereport', 'banktransfert', 'payment_donation', 'member', 'payment_loan', 'payment_salary', 'payment_various'))) {
|
||||
// So we excluded 'company' and 'user' here. We want only payment lines
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2021 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -171,8 +171,10 @@ if ($action == 'validatehistory') {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON " . $alias_product_perentity . ".accountancy_code_buy = aa.account_number AND aa.active = 1 AND aa.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa.entity = ".$conf->entity;
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa2 ON " . $alias_product_perentity . ".accountancy_code_buy_intra = aa2.account_number AND aa2.active = 1 AND aa2.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa2.entity = ".$conf->entity;
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa3 ON " . $alias_product_perentity . ".accountancy_code_buy_export = aa3.account_number AND aa3.active = 1 AND aa3.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa3.entity = ".$conf->entity;
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON " . $alias_societe_perentity . ".accountancy_code_buy = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity;
|
||||
$sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0 AND l.product_type <= 2 AND f.entity = ".((int) $conf->entity);
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON " . $alias_product_perentity . ".accountancy_code_buy = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity;
|
||||
$sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
|
||||
$sql .= " AND l.product_type <= 2";
|
||||
$sql .= " AND f.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy
|
||||
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
|
||||
$sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
}
|
||||
@ -373,10 +375,14 @@ $sql .= " AND ff.fk_statut > 0";
|
||||
$sql .= " AND ffd.product_type <= 2";
|
||||
$sql .= " AND ff.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy
|
||||
$sql .= " AND aa.account_number IS NULL";
|
||||
if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
$sql .= " AND ff.type IN (".FactureFournisseur::TYPE_STANDARD.",".FactureFournisseur::TYPE_REPLACEMENT.",".FactureFournisseur::TYPE_CREDIT_NOTE.")";
|
||||
} else {
|
||||
$sql .= " AND ff.type IN (".FactureFournisseur::TYPE_STANDARD.",".FactureFournisseur::TYPE_REPLACEMENT.",".FactureFournisseur::TYPE_CREDIT_NOTE.",".FactureFournisseur::TYPE_DEPOSIT.")";
|
||||
}
|
||||
$sql .= " GROUP BY ffd.fk_code_ventilation,aa.account_number,aa.label";
|
||||
$sql .= ' ORDER BY aa.account_number';
|
||||
|
||||
dol_syslog('htdocs/accountancy/supplier/index.php');
|
||||
dol_syslog('htdocs/accountancy/supplier/index.php', LOG_DEBUG);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
@ -474,11 +480,17 @@ $sql .= " AND ff.datef <= '".$db->idate($search_date_end)."'";
|
||||
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
|
||||
$sql .= " AND ff.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
}
|
||||
$sql .= " AND ff.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy
|
||||
$sql .= " AND ff.fk_statut > 0";
|
||||
$sql .= " AND ffd.product_type <= 2";
|
||||
$sql .= " AND ff.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy
|
||||
if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
$sql .= " AND ff.type IN (".FactureFournisseur::TYPE_STANDARD.", ".FactureFournisseur::TYPE_REPLACEMENT.", ".FactureFournisseur::TYPE_CREDIT_NOTE.")";
|
||||
} else {
|
||||
$sql .= " AND ff.type IN (".FactureFournisseur::TYPE_STANDARD.", ".FactureFournisseur::TYPE_REPLACEMENT.", ".FactureFournisseur::TYPE_CREDIT_NOTE.", ".FactureFournisseur::TYPE_DEPOSIT.")";
|
||||
}
|
||||
$sql .= " AND aa.account_number IS NOT NULL";
|
||||
$sql .= " GROUP BY ffd.fk_code_ventilation,aa.account_number,aa.label";
|
||||
$sql .= ' ORDER BY aa.account_number';
|
||||
|
||||
dol_syslog('htdocs/accountancy/supplier/index.php');
|
||||
$resql = $db->query($sql);
|
||||
@ -494,13 +506,15 @@ if ($resql) {
|
||||
print length_accountg($row[0]);
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
|
||||
print '<td class="left">';
|
||||
if ($row[0] == 'tobind') {
|
||||
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/supplier/list.php?search_year='.((int) $y), $langs->transnoentitiesnoconv("ToBind"));
|
||||
} else {
|
||||
print $row[1];
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
for ($i = 2; $i <= 13; $i++) {
|
||||
print '<td class="right nowraponall amount">';
|
||||
print price($row[$i]);
|
||||
@ -523,7 +537,6 @@ print "</table>\n";
|
||||
print '</div>';
|
||||
|
||||
|
||||
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange. Why showing a report that should rely on result of this step ?
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
@ -560,9 +573,14 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
|
||||
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
|
||||
$sql .= " AND ff.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
}
|
||||
$sql .= " AND ff.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy
|
||||
$sql .= " AND ff.fk_statut > 0";
|
||||
$sql .= " AND ffd.product_type <= 2";
|
||||
$sql .= " AND ff.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy
|
||||
if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
$sql .= " AND ff.type IN (".FactureFournisseur::TYPE_STANDARD.", ".FactureFournisseur::TYPE_REPLACEMENT.", ".FactureFournisseur::TYPE_CREDIT_NOTE.")";
|
||||
} else {
|
||||
$sql .= " AND ff.type IN (".FactureFournisseur::TYPE_STANDARD.", ".FactureFournisseur::TYPE_REPLACEMENT.", ".FactureFournisseur::TYPE_CREDIT_NOTE.", ".FactureFournisseur::TYPE_DEPOSIT.")";
|
||||
}
|
||||
|
||||
dol_syslog('htdocs/accountancy/supplier/index.php');
|
||||
$resql = $db->query($sql);
|
||||
|
||||
@ -384,7 +384,7 @@ if ($result) {
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
|
||||
print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
|
||||
print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
|
||||
print '<span class="opacitymedium">'.$langs->trans("DescVentilDoneSupplier").'</span><br>';
|
||||
|
||||
print '<br><div class="inline-block divButAction paddingbottom">'.$langs->trans("ChangeAccount").' ';
|
||||
|
||||
@ -161,8 +161,8 @@ if (empty($reshook)) {
|
||||
|
||||
// Mass actions
|
||||
$objectclass = 'AccountingAccount';
|
||||
$permissiontoread = $user->rights->accounting->read;
|
||||
$permissiontodelete = $user->rights->accounting->delete;
|
||||
$permissiontoread = $user->hasRight('accounting', 'read');
|
||||
$permissiontodelete = $user->hasRight('accounting', 'delete');
|
||||
$uploaddir = $conf->accounting->dir_output;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
}
|
||||
@ -477,7 +477,7 @@ if ($result) {
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("DescVentilTodoCustomer").'</span></br><br>';
|
||||
|
||||
if ($msg) {
|
||||
if (!empty($msg)) {
|
||||
print $msg.'<br>';
|
||||
}
|
||||
|
||||
|
||||
@ -1280,7 +1280,14 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> '.$langs->trans("Delete").'<br><br></td></tr>';
|
||||
}
|
||||
print '<tr><td>'.$langs->trans("PhotoFile").'</td></tr>';
|
||||
print '<tr><td><input type="file" class="flat" name="photo" id="photoinput"></td></tr>';
|
||||
print '<tr><td>';
|
||||
$maxfilesizearray = getMaxFileSizeArray();
|
||||
$maxmin = $maxfilesizearray['maxmin'];
|
||||
if ($maxmin > 0) {
|
||||
print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
|
||||
}
|
||||
print '<input type="file" class="flat" name="photo" id="photoinput">';
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
@ -220,7 +220,7 @@ if ($action == 'edit') {
|
||||
print '<table class="border centpercent">';
|
||||
print '<tr><td class="tdtop titlefieldcreate fieldrequired">'.$langs->trans('Label').'</td><td><input name="libelle-'.$key.'" class="minwidth300" value="'.dol_escape_htmltag($object->multilangs[$key]["label"]).'"></td></tr>';
|
||||
print '<tr><td class="tdtop">'.$langs->trans('Description').'</td><td>';
|
||||
$doleditor = new DolEditor("desc-$key", $object->multilangs[$key]["description"], '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%');
|
||||
$doleditor = new DolEditor("desc-$key", $object->multilangs[$key]["description"], '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_3, '90%');
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
print '</td></tr>';
|
||||
@ -283,7 +283,7 @@ if ($action == 'create' && $user->rights->adherent->configurer) {
|
||||
print '</td></tr>';
|
||||
print '<tr><td class="tdtop fieldrequired">'.$langs->trans('Label').'</td><td><input name="libelle" class="minwidth300" value="'.dol_escape_htmltag(GETPOST("libelle", 'alphanohtml')).'"></td></tr>';
|
||||
print '<tr><td class="tdtop">'.$langs->trans('Description').'</td><td>';
|
||||
$doleditor = new DolEditor('desc', '', '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%');
|
||||
$doleditor = new DolEditor('desc', '', '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_3, '90%');
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
@ -453,10 +453,10 @@ print '<tr class="oddeven"><td colspan="2">';
|
||||
print $form->textwithpicto($langs->trans("FreeLegalTextOnBOMs"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
|
||||
$variablename = 'BOM_FREE_TEXT';
|
||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
|
||||
} else {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
|
||||
$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
}
|
||||
print '</td><td class="right">';
|
||||
|
||||
@ -261,10 +261,10 @@ print '<tr class="oddeven"><td colspan="2">';
|
||||
print $form->textwithpicto($langs->trans("FreeLegalTextOnChequeReceipts"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
|
||||
$variablename = 'BANK_CHEQUERECEIPT_FREE_TEXT';
|
||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
|
||||
} else {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
|
||||
$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
}
|
||||
print '</td><td class="right">';
|
||||
|
||||
@ -612,7 +612,7 @@ print '<tr class="oddeven"><td colspan="2">';
|
||||
print $form->textwithpicto($langs->trans("FreeLegalTextOnOrders"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
|
||||
$variablename = 'ORDER_FREE_TEXT';
|
||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
|
||||
} else {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
|
||||
@ -661,7 +661,7 @@ if ($conf->banque->enabled) {
|
||||
}
|
||||
|
||||
// Ask for warehouse during order
|
||||
if ($conf->stock->enabled) {
|
||||
if (isModEnabled('stock')) {
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").'</td><td> </td><td class="center">';
|
||||
if (! empty($conf->use_javascript_ajax)) {
|
||||
|
||||
@ -477,6 +477,11 @@ if (!empty($conf->barcode->enabled)) {
|
||||
// Logo
|
||||
print '<tr class="oddeven"><td><label for="logo">'.$form->textwithpicto($langs->trans("Logo"), 'png, jpg').'</label></td><td>';
|
||||
print '<div class="centpercent nobordernopadding valignmiddle "><div class="inline-block marginrightonly">';
|
||||
$maxfilesizearray = getMaxFileSizeArray();
|
||||
$maxmin = $maxfilesizearray['maxmin'];
|
||||
if ($maxmin > 0) {
|
||||
print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
|
||||
}
|
||||
print '<input type="file" class="flat minwidth100 maxwidthinputfileonsmartphone" name="logo" id="logo" accept="image/*">';
|
||||
print '</div>';
|
||||
if (!empty($mysoc->logo_small)) {
|
||||
@ -514,6 +519,11 @@ print '</td></tr>';
|
||||
// Logo (squarred)
|
||||
print '<tr class="oddeven"><td><label for="logo_squarred">'.$form->textwithpicto($langs->trans("LogoSquarred"), 'png, jpg').'</label></td><td>';
|
||||
print '<div class="centpercent nobordernopadding valignmiddle"><div class="inline-block marginrightonly">';
|
||||
$maxfilesizearray = getMaxFileSizeArray();
|
||||
$maxmin = $maxfilesizearray['maxmin'];
|
||||
if ($maxmin > 0) {
|
||||
print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
|
||||
}
|
||||
print '<input type="file" class="flat minwidth100 maxwidthinputfileonsmartphone" name="logo_squarred" id="logo_squarred" accept="image/*">';
|
||||
print '</div>';
|
||||
if (!empty($mysoc->logo_squarred_small)) {
|
||||
|
||||
@ -179,7 +179,7 @@ foreach ($list as $key) {
|
||||
|
||||
// Value
|
||||
print '<td>';
|
||||
print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.$conf->global->$key.'">';
|
||||
print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.getDolGlobalString($key).'">';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
@ -445,10 +445,10 @@ print $form->textwithpicto($langs->trans("FreeLegalTextOnContracts"), $langs->tr
|
||||
print '<br>';
|
||||
$variablename = 'CONTRACT_FREE_TEXT';
|
||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
|
||||
} else {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
|
||||
$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
}
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
@ -105,7 +105,7 @@ if ($action == 'edit') {
|
||||
} elseif ($key == 'DAV_ALLOW_PUBLIC_DIR' || $key == 'DAV_ALLOW_ECM_DIR') {
|
||||
print $form->selectyesno($key, $conf->global->$key, 1);
|
||||
} else {
|
||||
print '<input name="'.$key.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.$conf->global->$key.'">';
|
||||
print '<input name="'.$key.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.getDolGlobalString($key).'">';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@ -434,10 +434,10 @@ print '<tr class="oddeven"><td colspan="2">';
|
||||
print $form->textwithpicto($langs->trans("FreeLegalTextOnDeliveryReceipts"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
|
||||
$variablename = 'DELIVERY_FREE_TEXT';
|
||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
|
||||
} else {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
|
||||
$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
}
|
||||
print '</td><td class="right">';
|
||||
|
||||
@ -132,7 +132,7 @@ if ($action == 'updateMask') {
|
||||
} elseif ($action == 'del') {
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0) {
|
||||
if ($conf->global->EXPEDITION_ADDON_PDF == "$value") {
|
||||
if (getDolGlobalString('EXPEDITION_ADDON_PDF') == "$value") {
|
||||
dolibarr_del_const($db, 'EXPEDITION_ADDON_PDF', $conf->entity);
|
||||
}
|
||||
}
|
||||
@ -231,7 +231,7 @@ foreach ($dirmodels as $reldir) {
|
||||
if ($conf->global->EXPEDITION_ADDON_NUMBER == "$file") {
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
} else {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmodel&token='.newToken().'&value='.urlencode($file).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'">';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmodel&token='.newToken().'&value='.urlencode($file).'&label='.urlencode($module->name).'">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a>';
|
||||
}
|
||||
@ -367,7 +367,7 @@ foreach ($dirmodels as $reldir) {
|
||||
|
||||
// Defaut
|
||||
print '<td class="center">';
|
||||
if ($conf->global->EXPEDITION_ADDON_PDF == $name) {
|
||||
if (getDolGlobalString('EXPEDITION_ADDON_PDF') == $name) {
|
||||
print img_picto($langs->trans("Default"), 'on');
|
||||
} else {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
@ -441,17 +441,17 @@ print '<tr><td>';
|
||||
print $form->textwithpicto($langs->trans("FreeLegalTextOnShippings"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
|
||||
$variablename = 'SHIPPING_FREE_TEXT';
|
||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
|
||||
} else {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
|
||||
$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
}
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '<tr><td>';
|
||||
print $form->textwithpicto($langs->trans("WatermarkOnDraftContractCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
|
||||
print '<input class="flat minwidth200" type="text" name="SHIPPING_DRAFT_WATERMARK" value="'.$conf->global->SHIPPING_DRAFT_WATERMARK.'">';
|
||||
print '<input class="flat minwidth200" type="text" name="SHIPPING_DRAFT_WATERMARK" value="'.getDolGlobalString('SHIPPING_DRAFT_WATERMARK').'">';
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -456,10 +456,10 @@ print '<tr class="oddeven"><td colspan="2">';
|
||||
print $form->textwithpicto($langs->trans("FreeLegalTextOnExpenseReports"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
|
||||
$variablename = 'EXPENSEREPORT_FREE_TEXT';
|
||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
|
||||
} else {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
|
||||
$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
}
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
@ -743,10 +743,10 @@ print '<tr class="oddeven"><td colspan="2">';
|
||||
print $form->textwithpicto($langs->trans("FreeLegalTextOnInvoices"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
|
||||
$variablename = 'INVOICE_FREE_TEXT';
|
||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
|
||||
} else {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
|
||||
$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
}
|
||||
print '</td><td class="right">';
|
||||
|
||||
@ -507,10 +507,10 @@ print '<tr class="oddeven"><td colspan="2">';
|
||||
print $form->textwithpicto($langs->trans("FreeLegalTextOnInterventions"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
|
||||
$variablename = 'FICHINTER_FREE_TEXT';
|
||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
|
||||
} else {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
|
||||
$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
}
|
||||
print '</td><td class="right">';
|
||||
|
||||
@ -538,10 +538,10 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
||||
print '<br>';
|
||||
$variablename = 'HOLIDAY_FREE_TEXT';
|
||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
|
||||
} else {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
|
||||
$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
}
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
@ -636,6 +636,11 @@ if ($mode == 'login') {
|
||||
if (!empty($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND)) {
|
||||
$disabled = ' disabled="disabled"';
|
||||
}
|
||||
$maxfilesizearray = getMaxFileSizeArray();
|
||||
$maxmin = $maxfilesizearray['maxmin'];
|
||||
if ($maxmin > 0) {
|
||||
print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
|
||||
}
|
||||
print '<input type="file" class="flat maxwidthinputfileonsmartphone" name="imagebackground" id="imagebackground"' . $disabled . '>';
|
||||
if ($disabled) {
|
||||
print '(' . $langs->trans("DisabledByOptionADD_UNSPLASH_LOGIN_BACKGROUND") . ') ';
|
||||
|
||||
@ -107,7 +107,7 @@ foreach ($list as $key) {
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
print $formaccounting->select_account(getDolGlobalString($key), $key, 1, '', 1, 1);
|
||||
} else {
|
||||
print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.$conf->global->$key.'">';
|
||||
print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.getDolGlobalString($key).'">';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@ -1212,7 +1212,7 @@ if ($mode == 'deploy') {
|
||||
});
|
||||
</script>'."\n";
|
||||
// MAX_FILE_SIZE doit précéder le champ input de type file
|
||||
print '<input type="hidden" name="max_file_size" value="'.($maxmin * 1024).'">';
|
||||
print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">';
|
||||
}
|
||||
|
||||
print '<input class="flat minwidth400" type="file" name="fileinstall" id="fileinstall"> ';
|
||||
|
||||
@ -446,10 +446,10 @@ print '<tr class="oddeven"><td colspan="2">';
|
||||
print $form->textwithpicto($langs->trans("FreeLegalTextOnMOs"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
|
||||
$variablename = 'MRP_MO_FREE_TEXT';
|
||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
|
||||
} else {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
|
||||
$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
}
|
||||
print '</td><td class="right">';
|
||||
|
||||
@ -62,6 +62,11 @@ if ($action == 'update') {
|
||||
}
|
||||
if (GETPOSTISSET('INVOICE_ADD_ZATCA_QR_CODE')) {
|
||||
dolibarr_set_const($db, "INVOICE_ADD_ZATCA_QR_CODE", GETPOST("INVOICE_ADD_ZATCA_QR_CODE", 'int'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_del_const($db, "INVOICE_ADD_SWISS_QR_CODE", $conf->entity);
|
||||
}
|
||||
if (GETPOSTISSET('INVOICE_ADD_SWISS_QR_CODE')) {
|
||||
dolibarr_set_const($db, "INVOICE_ADD_SWISS_QR_CODE", GETPOST("INVOICE_ADD_SWISS_QR_CODE", 'int'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_del_const($db, "INVOICE_ADD_ZATCA_QR_CODE", $conf->entity);
|
||||
}
|
||||
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
@ -138,6 +143,17 @@ if (isModEnabled('facture')) {
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("INVOICE_ADD_SWISS_QR_CODE"), '');
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('INVOICE_ADD_SWISS_QR_CODE');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("INVOICE_ADD_SWISS_QR_CODE", $arrval, $conf->global->INVOICE_ADD_SWISS_QR_CODE);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
/*
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING").'</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
|
||||
@ -675,10 +675,10 @@ print '<tr class="oddeven"><td colspan="2">';
|
||||
print $form->textwithpicto($langs->trans("FreeLegalTextOnProposal"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
|
||||
$variablename = 'PROPOSAL_FREE_TEXT';
|
||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
|
||||
} else {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
|
||||
$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
}
|
||||
print '</td><td class="right">';
|
||||
|
||||
@ -455,12 +455,12 @@ print $form->textwithpicto($langs->trans("FreeLegalTextOnReceptions"), $langs->t
|
||||
$variablename='RECEPTION_FREE_TEXT';
|
||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
|
||||
{
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
|
||||
}
|
||||
else
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_notes');
|
||||
$doleditor=new DolEditor($variablename, getDolGlobalString($variablename),'',80,'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
}
|
||||
print "</td></tr>\n";
|
||||
|
||||
@ -194,7 +194,7 @@ print '<span class="opacitymedium">'.$langs->trans("StockTransferSetupPage").'</
|
||||
print '<tr class="oddeven"><td>';
|
||||
$tooltiphelp = (($langs->trans($key.'Tooltip') != $key.'Tooltip') ? $langs->trans($key.'Tooltip') : '');
|
||||
print $form->textwithpicto($langs->trans($key), $tooltiphelp);
|
||||
print '</td><td><input name="'.$key.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.$conf->global->$key.'"></td></tr>';
|
||||
print '</td><td><input name="'.$key.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.getDolGlobalString($key).'"></td></tr>';
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
@ -217,7 +217,7 @@ print '<span class="opacitymedium">'.$langs->trans("StockTransferSetupPage").'</
|
||||
print '<tr class="oddeven"><td>';
|
||||
$tooltiphelp = (($langs->trans($key.'Tooltip') != $key.'Tooltip') ? $langs->trans($key.'Tooltip') : '');
|
||||
print $form->textwithpicto($langs->trans($key), $tooltiphelp);
|
||||
print '</td><td>'.$conf->global->$key.'</td></tr>';
|
||||
print '</td><td>'.getDolGlobalString($key).'</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -457,10 +457,10 @@ print '<tr class="oddeven"><td colspan="2">';
|
||||
print $form->textwithpicto($langs->trans("FreeLegalTextOnInvoices"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
|
||||
$variablename = 'SUPPLIER_INVOICE_FREE_TEXT';
|
||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
|
||||
} else {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
|
||||
$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
}
|
||||
print '</td><td class="right">';
|
||||
|
||||
@ -505,10 +505,10 @@ print '<tr class="oddeven"><td colspan="2">';
|
||||
print $form->textwithpicto($langs->trans("FreeLegalTextOnOrders"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
|
||||
$variablename = 'SUPPLIER_ORDER_FREE_TEXT';
|
||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
|
||||
} else {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
|
||||
$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
}
|
||||
print '</td><td class="right">';
|
||||
|
||||
@ -474,10 +474,10 @@ print '<tr class="oddeven"><td colspan="2">';
|
||||
print $form->textwithpicto($langs->trans("FreeLegalTextOnSupplierProposal"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
|
||||
$variablename = 'SUPPLIER_PROPOSAL_FREE_TEXT';
|
||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
|
||||
} else {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
|
||||
$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
}
|
||||
print '</td><td class="right">';
|
||||
|
||||
@ -642,7 +642,7 @@ $mail_intro = $conf->global->TICKET_MESSAGE_MAIL_INTRO ? $conf->global->TICKET_M
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("TicketMessageMailIntroLabelAdmin");
|
||||
print '</td><td>';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor('TICKET_MESSAGE_MAIL_INTRO', $mail_intro, '100%', 120, 'dolibarr_mailings', '', false, true, $conf->global->FCKEDITOR_ENABLE_MAIL, ROWS_2, 70);
|
||||
$doleditor = new DolEditor('TICKET_MESSAGE_MAIL_INTRO', $mail_intro, '100%', 120, 'dolibarr_mailings', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_MAIL'), ROWS_2, 70);
|
||||
$doleditor->Create();
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
@ -654,7 +654,7 @@ $mail_signature = $conf->global->TICKET_MESSAGE_MAIL_SIGNATURE ? $conf->global->
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("TicketMessageMailSignatureLabelAdmin").'</label>';
|
||||
print '</td><td>';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor('TICKET_MESSAGE_MAIL_SIGNATURE', $mail_signature, '100%', 120, 'dolibarr_mailings', '', false, true, $conf->global->FCKEDITOR_ENABLE_MAIL, ROWS_2, 70);
|
||||
$doleditor = new DolEditor('TICKET_MESSAGE_MAIL_SIGNATURE', $mail_signature, '100%', 120, 'dolibarr_mailings', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_MAIL'), ROWS_2, 70);
|
||||
$doleditor->Create();
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
|
||||
@ -375,7 +375,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
|
||||
print '<tr><td>'.$langs->trans("TicketPublicInterfaceTextHomeLabelAdmin").'</label>';
|
||||
print '</td><td>';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor('TICKET_PUBLIC_TEXT_HOME', $public_text_home, '100%', 180, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_2, 70);
|
||||
$doleditor = new DolEditor('TICKET_PUBLIC_TEXT_HOME', $public_text_home, '100%', 180, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_2, 70);
|
||||
$doleditor->Create();
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
@ -387,7 +387,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
|
||||
print '<tr><td>'.$langs->trans("TicketPublicInterfaceTextHelpMessageLabelAdmin").'</label>';
|
||||
print '</td><td>';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor('TICKET_PUBLIC_TEXT_HELP_MESSAGE', $public_text_help_message, '100%', 180, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_2, 70);
|
||||
$doleditor = new DolEditor('TICKET_PUBLIC_TEXT_HELP_MESSAGE', $public_text_help_message, '100%', 180, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_2, 70);
|
||||
$doleditor->Create();
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
@ -434,7 +434,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
|
||||
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 = new DolEditor('TICKET_MESSAGE_MAIL_NEW', $mail_mesg_new, '100%', 120, 'dolibarr_mailings', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_MAIL'), ROWS_2, 70);
|
||||
$doleditor->Create();
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
733
htdocs/admin/webhook.php
Normal file
733
htdocs/admin/webhook.php
Normal file
@ -0,0 +1,733 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2022 SuperAdmin <test@dolibarr.com>
|
||||
*
|
||||
* 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 webhook/admin/webhook.php
|
||||
* \ingroup webhook
|
||||
* \brief Webhook setup page.
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
$res = 0;
|
||||
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
|
||||
if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
|
||||
$res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
|
||||
}
|
||||
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
|
||||
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
|
||||
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
|
||||
$i--; $j--;
|
||||
}
|
||||
if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
|
||||
$res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
|
||||
}
|
||||
if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
|
||||
$res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
|
||||
}
|
||||
// Try main.inc.php using relative path
|
||||
if (!$res && file_exists("../main.inc.php")) {
|
||||
$res = @include "../main.inc.php";
|
||||
}
|
||||
if (!$res && file_exists("../../main.inc.php")) {
|
||||
$res = @include "../../main.inc.php";
|
||||
}
|
||||
if (!$res && file_exists("../../../main.inc.php")) {
|
||||
$res = @include "../../../main.inc.php";
|
||||
}
|
||||
if (!$res) {
|
||||
die("Include of main fails");
|
||||
}
|
||||
|
||||
global $langs, $user;
|
||||
|
||||
// Libraries
|
||||
require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
|
||||
require_once DOL_DOCUMENT_ROOT.'/webhook/lib/webhook.lib.php';
|
||||
|
||||
// Translations
|
||||
$langs->loadLangs(array("admin", "webhook"));
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('webhooksetup', 'globalsetup'));
|
||||
|
||||
// Access control
|
||||
if (!$user->admin) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
// Parameters
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$backtopage = GETPOST('backtopage', 'alpha');
|
||||
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
|
||||
|
||||
$value = GETPOST('value', 'alpha');
|
||||
$label = GETPOST('label', 'alpha');
|
||||
$scandir = GETPOST('scan_dir', 'alpha');
|
||||
$type = 'myobject';
|
||||
|
||||
$arrayofparameters = array(
|
||||
'WEBHOOK_MYPARAM1'=>array('type'=>'string', 'css'=>'minwidth500' ,'enabled'=>0),
|
||||
//'WEBHOOK_MYPARAM2'=>array('type'=>'textarea','enabled'=>1),
|
||||
//'WEBHOOK_MYPARAM3'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1),
|
||||
//'WEBHOOK_MYPARAM4'=>array('type'=>'emailtemplate:thirdparty', 'enabled'=>1),
|
||||
//'WEBHOOK_MYPARAM5'=>array('type'=>'yesno', 'enabled'=>1),
|
||||
//'WEBHOOK_MYPARAM5'=>array('type'=>'thirdparty_type', 'enabled'=>1),
|
||||
//'WEBHOOK_MYPARAM6'=>array('type'=>'securekey', 'enabled'=>1),
|
||||
//'WEBHOOK_MYPARAM7'=>array('type'=>'product', 'enabled'=>1),
|
||||
);
|
||||
|
||||
$error = 0;
|
||||
$setupnotempty = 0;
|
||||
|
||||
// Set this to 1 to use the factory to manage constants. Warning, the generated module will be compatible with version v15+ only
|
||||
$useFormSetup = 0;
|
||||
// Convert arrayofparameter into a formSetup object
|
||||
if ($useFormSetup && (float) DOL_VERSION >= 15) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsetup.class.php';
|
||||
$formSetup = new FormSetup($db);
|
||||
|
||||
// you can use the param convertor
|
||||
$formSetup->addItemsFromParamsArray($arrayofparameters);
|
||||
|
||||
// or use the new system see exemple as follow (or use both because you can ;-) )
|
||||
|
||||
/*
|
||||
// Hôte
|
||||
$item = $formSetup->newItem('NO_PARAM_JUST_TEXT');
|
||||
$item->fieldOverride = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'];
|
||||
$item->cssClass = 'minwidth500';
|
||||
|
||||
// Setup conf WEBHOOK_MYPARAM1 as a simple string input
|
||||
$item = $formSetup->newItem('WEBHOOK_MYPARAM1');
|
||||
|
||||
// Setup conf WEBHOOK_MYPARAM1 as a simple textarea input but we replace the text of field title
|
||||
$item = $formSetup->newItem('WEBHOOK_MYPARAM2');
|
||||
$item->nameText = $item->getNameText().' more html text ';
|
||||
|
||||
// Setup conf WEBHOOK_MYPARAM3
|
||||
$item = $formSetup->newItem('WEBHOOK_MYPARAM3');
|
||||
$item->setAsThirdpartyType();
|
||||
|
||||
// Setup conf WEBHOOK_MYPARAM4 : exemple of quick define write style
|
||||
$formSetup->newItem('WEBHOOK_MYPARAM4')->setAsYesNo();
|
||||
|
||||
// Setup conf WEBHOOK_MYPARAM5
|
||||
$formSetup->newItem('WEBHOOK_MYPARAM5')->setAsEmailTemplate('thirdparty');
|
||||
|
||||
// Setup conf WEBHOOK_MYPARAM6
|
||||
$formSetup->newItem('WEBHOOK_MYPARAM6')->setAsSecureKey()->enabled = 0; // disabled
|
||||
|
||||
// Setup conf WEBHOOK_MYPARAM7
|
||||
$formSetup->newItem('WEBHOOK_MYPARAM7')->setAsProduct();
|
||||
*/
|
||||
|
||||
$setupnotempty = count($formSetup->items);
|
||||
}
|
||||
|
||||
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||
|
||||
if ($action == 'updateMask') {
|
||||
$maskconst = GETPOST('maskconst', 'alpha');
|
||||
$maskvalue = GETPOST('maskvalue', 'alpha');
|
||||
|
||||
if ($maskconst) {
|
||||
$res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
} elseif ($action == 'specimen') {
|
||||
$modele = GETPOST('module', 'alpha');
|
||||
$tmpobjectkey = GETPOST('object');
|
||||
|
||||
$tmpobject = new $tmpobjectkey($db);
|
||||
$tmpobject->initAsSpecimen();
|
||||
|
||||
// Search template files
|
||||
$file = ''; $classname = ''; $filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir."core/modules/webhook/doc/pdf_".$modele."_".strtolower($tmpobjectkey).".modules.php", 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = "pdf_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound) {
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db);
|
||||
|
||||
if ($module->write_file($tmpobject, $langs) > 0) {
|
||||
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=".strtolower($tmpobjectkey)."&file=SPECIMEN.pdf");
|
||||
return;
|
||||
} else {
|
||||
setEventMessages($module->error, null, 'errors');
|
||||
dol_syslog($module->error, LOG_ERR);
|
||||
}
|
||||
} else {
|
||||
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
|
||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||
}
|
||||
} elseif ($action == 'setmod') {
|
||||
// TODO Check if numbering module chosen can be activated by calling method canBeActivated
|
||||
$tmpobjectkey = GETPOST('object');
|
||||
if (!empty($tmpobjectkey)) {
|
||||
$constforval = 'WEBHOOK_'.strtoupper($tmpobjectkey)."_ADDON";
|
||||
dolibarr_set_const($db, $constforval, $value, 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
} elseif ($action == 'set') {
|
||||
// Activate a model
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
} elseif ($action == 'del') {
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0) {
|
||||
$tmpobjectkey = GETPOST('object');
|
||||
if (!empty($tmpobjectkey)) {
|
||||
$constforval = 'WEBHOOK_'.strtoupper($tmpobjectkey).'_ADDON_PDF';
|
||||
if ($conf->global->$constforval == "$value") {
|
||||
dolibarr_del_const($db, $constforval, $conf->entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'setdoc') {
|
||||
// Set or unset default model
|
||||
$tmpobjectkey = GETPOST('object');
|
||||
if (!empty($tmpobjectkey)) {
|
||||
$constforval = 'WEBHOOK_'.strtoupper($tmpobjectkey).'_ADDON_PDF';
|
||||
if (dolibarr_set_const($db, $constforval, $value, 'chaine', 0, '', $conf->entity)) {
|
||||
// The constant that was read before the new set
|
||||
// We therefore requires a variable to have a coherent view
|
||||
$conf->global->$constforval = $value;
|
||||
}
|
||||
|
||||
// We disable/enable the document template (into llx_document_model table)
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0) {
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'unsetdoc') {
|
||||
$tmpobjectkey = GETPOST('object');
|
||||
if (!empty($tmpobjectkey)) {
|
||||
$constforval = 'WEBHOOK_'.strtoupper($tmpobjectkey).'_ADDON_PDF';
|
||||
dolibarr_del_const($db, $constforval, $conf->entity);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$help_url = '';
|
||||
$page_name = "WebhookSetup";
|
||||
|
||||
llxHeader('', $langs->trans($page_name), $help_url);
|
||||
|
||||
// Subheader
|
||||
$linkback = '<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1').'">'.$langs->trans("BackToModuleList").'</a>';
|
||||
|
||||
print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup');
|
||||
|
||||
// Configuration header
|
||||
$head = webhookAdminPrepareHead();
|
||||
print dol_get_fiche_head($head, 'settings', $langs->trans($page_name), -1, "webhook@webhook");
|
||||
|
||||
// Setup page goes here
|
||||
echo '<span class="opacitymedium">'.$langs->trans("WebhookSetupPage").'</span><br><br>';
|
||||
|
||||
|
||||
if ($action == 'edit') {
|
||||
if ($useFormSetup && (float) DOL_VERSION >= 15) {
|
||||
print $formSetup->generateOutput(true);
|
||||
} else {
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
foreach ($arrayofparameters as $constname => $val) {
|
||||
if ($val['enabled']==1) {
|
||||
$setupnotempty++;
|
||||
print '<tr class="oddeven"><td>';
|
||||
$tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : '');
|
||||
print '<span id="helplink'.$constname.'" class="spanforparamtooltip">'.$form->textwithpicto($langs->trans($constname), $tooltiphelp, 1, 'info', '', 0, 3, 'tootips'.$constname).'</span>';
|
||||
print '</td><td>';
|
||||
|
||||
if ($val['type'] == 'textarea') {
|
||||
print '<textarea class="flat" name="'.$constname.'" id="'.$constname.'" cols="50" rows="5" wrap="soft">' . "\n";
|
||||
print $conf->global->{$constname};
|
||||
print "</textarea>\n";
|
||||
} elseif ($val['type']== 'html') {
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($constname, $conf->global->{$constname}, '', 160, 'dolibarr_notes', '', false, false, $conf->fckeditor->enabled, ROWS_5, '90%');
|
||||
$doleditor->Create();
|
||||
} elseif ($val['type'] == 'yesno') {
|
||||
print $form->selectyesno($constname, $conf->global->{$constname}, 1);
|
||||
} elseif (preg_match('/emailtemplate:/', $val['type'])) {
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
|
||||
$formmail = new FormMail($db);
|
||||
|
||||
$tmp = explode(':', $val['type']);
|
||||
$nboftemplates = $formmail->fetchAllEMailTemplate($tmp[1], $user, null, 1); // We set lang=null to get in priority record with no lang
|
||||
//$arraydefaultmessage = $formmail->getEMailTemplate($db, $tmp[1], $user, null, 0, 1, '');
|
||||
$arrayofmessagename = array();
|
||||
if (is_array($formmail->lines_model)) {
|
||||
foreach ($formmail->lines_model as $modelmail) {
|
||||
//var_dump($modelmail);
|
||||
$moreonlabel = '';
|
||||
if (!empty($arrayofmessagename[$modelmail->label])) {
|
||||
$moreonlabel = ' <span class="opacitymedium">(' . $langs->trans("SeveralLangugeVariatFound") . ')</span>';
|
||||
}
|
||||
// The 'label' is the key that is unique if we exclude the language
|
||||
$arrayofmessagename[$modelmail->id] = $langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)) . $moreonlabel;
|
||||
}
|
||||
}
|
||||
print $form->selectarray($constname, $arrayofmessagename, $conf->global->{$constname}, 'None', 0, 0, '', 0, 0, 0, '', '', 1);
|
||||
} elseif (preg_match('/category:/', $val['type'])) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
$formother = new FormOther($db);
|
||||
|
||||
$tmp = explode(':', $val['type']);
|
||||
print img_picto('', 'category', 'class="pictofixedwidth"');
|
||||
print $formother->select_categories($tmp[1], $conf->global->{$constname}, $constname, 0, $langs->trans('CustomersProspectsCategoriesShort'));
|
||||
} elseif (preg_match('/thirdparty_type/', $val['type'])) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
$formcompany = new FormCompany($db);
|
||||
print $formcompany->selectProspectCustomerType($conf->global->{$constname}, $constname);
|
||||
} elseif ($val['type'] == 'securekey') {
|
||||
print '<input required="required" type="text" class="flat" id="'.$constname.'" name="'.$constname.'" value="'.(GETPOST($constname, 'alpha') ?GETPOST($constname, 'alpha') : $conf->global->{$constname}).'" size="40">';
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token'.$constname.'" class="linkobject"');
|
||||
}
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
print "\n".'<script type="text/javascript">';
|
||||
print '$(document).ready(function () {
|
||||
$("#generate_token'.$constname.'").click(function() {
|
||||
$.get( "'.DOL_URL_ROOT.'/core/ajax/security.php", {
|
||||
action: \'getrandompassword\',
|
||||
generic: true
|
||||
},
|
||||
function(token) {
|
||||
$("#'.$constname.'").val(token);
|
||||
});
|
||||
});
|
||||
});';
|
||||
print '</script>';
|
||||
}
|
||||
} elseif ($val['type'] == 'product') {
|
||||
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
|
||||
$selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname);
|
||||
$form->select_produits($selected, $constname, '', 0);
|
||||
}
|
||||
} else {
|
||||
print '<input name="'.$constname.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.$conf->global->{$constname}.'">';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
print '<br><div class="center">';
|
||||
print '<input class="button button-save" type="submit" value="'.$langs->trans("Save").'">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
print '<br>';
|
||||
} else {
|
||||
if ($useFormSetup && (float) DOL_VERSION >= 15) {
|
||||
if (!empty($formSetup->items)) {
|
||||
print $formSetup->generateOutput();
|
||||
}
|
||||
} else {
|
||||
if (!empty($arrayofparameters)) {
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
foreach ($arrayofparameters as $constname => $val) {
|
||||
if ($val['enabled']==1) {
|
||||
$setupnotempty++;
|
||||
print '<tr class="oddeven"><td>';
|
||||
$tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : '');
|
||||
print $form->textwithpicto($langs->trans($constname), $tooltiphelp);
|
||||
print '</td><td>';
|
||||
|
||||
if ($val['type'] == 'textarea') {
|
||||
print dol_nl2br($conf->global->{$constname});
|
||||
} elseif ($val['type']== 'html') {
|
||||
print $conf->global->{$constname};
|
||||
} elseif ($val['type'] == 'yesno') {
|
||||
print ajax_constantonoff($constname);
|
||||
} elseif (preg_match('/emailtemplate:/', $val['type'])) {
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
|
||||
$formmail = new FormMail($db);
|
||||
|
||||
$tmp = explode(':', $val['type']);
|
||||
|
||||
$template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs, $conf->global->{$constname});
|
||||
if ($template<0) {
|
||||
setEventMessages(null, $formmail->errors, 'errors');
|
||||
}
|
||||
print $langs->trans($template->label);
|
||||
} elseif (preg_match('/category:/', $val['type'])) {
|
||||
$c = new Categorie($db);
|
||||
$result = $c->fetch($conf->global->{$constname});
|
||||
if ($result < 0) {
|
||||
setEventMessages(null, $c->errors, 'errors');
|
||||
} elseif ($result > 0 ) {
|
||||
$ways = $c->print_all_ways(' >> ', 'none', 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formated text
|
||||
$toprint = array();
|
||||
foreach ($ways as $way) {
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>';
|
||||
}
|
||||
print '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
|
||||
}
|
||||
} elseif (preg_match('/thirdparty_type/', $val['type'])) {
|
||||
if ($conf->global->{$constname}==2) {
|
||||
print $langs->trans("Prospect");
|
||||
} elseif ($conf->global->{$constname}==3) {
|
||||
print $langs->trans("ProspectCustomer");
|
||||
} elseif ($conf->global->{$constname}==1) {
|
||||
print $langs->trans("Customer");
|
||||
} elseif ($conf->global->{$constname}==0) {
|
||||
print $langs->trans("NorProspectNorCustomer");
|
||||
}
|
||||
} elseif ($val['type'] == 'product') {
|
||||
$product = new Product($db);
|
||||
$resprod = $product->fetch($conf->global->{$constname});
|
||||
if ($resprod > 0) {
|
||||
print $product->ref;
|
||||
} elseif ($resprod < 0) {
|
||||
setEventMessages(null, $object->errors, "errors");
|
||||
}
|
||||
} else {
|
||||
print $conf->global->{$constname};
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($setupnotempty) {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>';
|
||||
print '</div>';
|
||||
} else {
|
||||
//print '<br>'.$langs->trans("NothingToSetup");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$moduledir = 'webhook';
|
||||
$myTmpObjects['MyObject'] = array('includerefgeneration'=>0, 'includedocgeneration'=>0);
|
||||
|
||||
|
||||
foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
||||
if ($myTmpObjectKey == 'MyObject') {
|
||||
continue;
|
||||
}
|
||||
if ($myTmpObjectArray['includerefgeneration']) {
|
||||
/*
|
||||
* Orders Numbering model
|
||||
*/
|
||||
$setupnotempty++;
|
||||
|
||||
print load_fiche_titre($langs->trans("NumberingModules", $myTmpObjectKey), '', '');
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Name").'</td>';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td class="nowrap">'.$langs->trans("Example").'</td>';
|
||||
print '<td class="center" width="60">'.$langs->trans("Status").'</td>';
|
||||
print '<td class="center" width="16">'.$langs->trans("ShortInfo").'</td>';
|
||||
print '</tr>'."\n";
|
||||
|
||||
clearstatcache();
|
||||
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$dir = dol_buildpath($reldir."core/modules/".$moduledir);
|
||||
|
||||
if (is_dir($dir)) {
|
||||
$handle = opendir($dir);
|
||||
if (is_resource($handle)) {
|
||||
while (($file = readdir($handle)) !== false) {
|
||||
if (strpos($file, 'mod_'.strtolower($myTmpObjectKey).'_') === 0 && substr($file, dol_strlen($file) - 3, 3) == 'php') {
|
||||
$file = substr($file, 0, dol_strlen($file) - 4);
|
||||
|
||||
require_once $dir.'/'.$file.'.php';
|
||||
|
||||
$module = new $file($db);
|
||||
|
||||
// Show modules according to features level
|
||||
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
|
||||
continue;
|
||||
}
|
||||
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($module->isEnabled()) {
|
||||
dol_include_once('/'.$moduledir.'/class/'.strtolower($myTmpObjectKey).'.class.php');
|
||||
|
||||
print '<tr class="oddeven"><td>'.$module->name."</td><td>\n";
|
||||
print $module->info();
|
||||
print '</td>';
|
||||
|
||||
// Show example of numbering model
|
||||
print '<td class="nowrap">';
|
||||
$tmp = $module->getExample();
|
||||
if (preg_match('/^Error/', $tmp)) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') {
|
||||
print $langs->trans($tmp);
|
||||
} else {
|
||||
print $tmp;
|
||||
}
|
||||
print '</td>'."\n";
|
||||
|
||||
print '<td class="center">';
|
||||
$constforvar = 'WEBHOOK_'.strtoupper($myTmpObjectKey).'_ADDON';
|
||||
if ($conf->global->$constforvar == $file) {
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
} else {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&token='.newToken().'&object='.strtolower($myTmpObjectKey).'&value='.urlencode($file).'">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
$mytmpinstance = new $myTmpObjectKey($db);
|
||||
$mytmpinstance->initAsSpecimen();
|
||||
|
||||
// Info
|
||||
$htmltooltip = '';
|
||||
$htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
|
||||
|
||||
$nextval = $module->getNextValue($mytmpinstance);
|
||||
if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
|
||||
$htmltooltip .= ''.$langs->trans("NextValue").': ';
|
||||
if ($nextval) {
|
||||
if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
|
||||
$nextval = $langs->trans($nextval);
|
||||
}
|
||||
$htmltooltip .= $nextval.'<br>';
|
||||
} else {
|
||||
$htmltooltip .= $langs->trans($module->error).'<br>';
|
||||
}
|
||||
}
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
}
|
||||
}
|
||||
print "</table><br>\n";
|
||||
}
|
||||
|
||||
if ($myTmpObjectArray['includedocgeneration']) {
|
||||
/*
|
||||
* Document templates generators
|
||||
*/
|
||||
$setupnotempty++;
|
||||
$type = strtolower($myTmpObjectKey);
|
||||
|
||||
print load_fiche_titre($langs->trans("DocumentModules", $myTmpObjectKey), '', '');
|
||||
|
||||
// Load array def with activated templates
|
||||
$def = array();
|
||||
$sql = "SELECT nom";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."document_model";
|
||||
$sql .= " WHERE type = '".$db->escape($type)."'";
|
||||
$sql .= " AND entity = ".$conf->entity;
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$i = 0;
|
||||
$num_rows = $db->num_rows($resql);
|
||||
while ($i < $num_rows) {
|
||||
$array = $db->fetch_array($resql);
|
||||
array_push($def, $array[0]);
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
print "<table class=\"noborder\" width=\"100%\">\n";
|
||||
print "<tr class=\"liste_titre\">\n";
|
||||
print '<td>'.$langs->trans("Name").'</td>';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td class="center" width="60">'.$langs->trans("Status")."</td>\n";
|
||||
print '<td class="center" width="60">'.$langs->trans("Default")."</td>\n";
|
||||
print '<td class="center" width="38">'.$langs->trans("ShortInfo").'</td>';
|
||||
print '<td class="center" width="38">'.$langs->trans("Preview").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
clearstatcache();
|
||||
|
||||
foreach ($dirmodels as $reldir) {
|
||||
foreach (array('', '/doc') as $valdir) {
|
||||
$realpath = $reldir."core/modules/".$moduledir.$valdir;
|
||||
$dir = dol_buildpath($realpath);
|
||||
|
||||
if (is_dir($dir)) {
|
||||
$handle = opendir($dir);
|
||||
if (is_resource($handle)) {
|
||||
while (($file = readdir($handle)) !== false) {
|
||||
$filelist[] = $file;
|
||||
}
|
||||
closedir($handle);
|
||||
arsort($filelist);
|
||||
|
||||
foreach ($filelist as $file) {
|
||||
if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
|
||||
if (file_exists($dir.'/'.$file)) {
|
||||
$name = substr($file, 4, dol_strlen($file) - 16);
|
||||
$classname = substr($file, 0, dol_strlen($file) - 12);
|
||||
|
||||
require_once $dir.'/'.$file;
|
||||
$module = new $classname($db);
|
||||
|
||||
$modulequalified = 1;
|
||||
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
|
||||
$modulequalified = 0;
|
||||
}
|
||||
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
|
||||
$modulequalified = 0;
|
||||
}
|
||||
|
||||
if ($modulequalified) {
|
||||
print '<tr class="oddeven"><td width="100">';
|
||||
print (empty($module->name) ? $name : $module->name);
|
||||
print "</td><td>\n";
|
||||
if (method_exists($module, 'info')) {
|
||||
print $module->info($langs);
|
||||
} else {
|
||||
print $module->description;
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Active
|
||||
if (in_array($name, $def)) {
|
||||
print '<td class="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.urlencode($name).'">';
|
||||
print img_picto($langs->trans("Enabled"), 'switch_on');
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
} else {
|
||||
print '<td class="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
// Default
|
||||
print '<td class="center">';
|
||||
$constforvar = 'WEBHOOK_'.strtoupper($myTmpObjectKey).'_ADDON';
|
||||
if ($conf->global->$constforvar == $name) {
|
||||
//print img_picto($langs->trans("Default"), 'on');
|
||||
// Even if choice is the default value, we allow to disable it. Replace this with previous line if you need to disable unset
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=unsetdoc&token='.newToken().'&object='.urlencode(strtolower($myTmpObjectKey)).'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
|
||||
} else {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&object='.urlencode(strtolower($myTmpObjectKey)).'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Info
|
||||
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
||||
$htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
|
||||
if ($module->type == 'pdf') {
|
||||
$htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
||||
}
|
||||
$htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
|
||||
|
||||
$htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
||||
$htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
|
||||
$htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print '</td>';
|
||||
|
||||
// Preview
|
||||
print '<td class="center">';
|
||||
if ($module->type == 'pdf') {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'&object='.$myTmpObjectKey.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||
} else {
|
||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($setupnotempty)) {
|
||||
print '<br>'.$langs->trans("NothingToSetup");
|
||||
}
|
||||
|
||||
// Page end
|
||||
print dol_get_fiche_end();
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
@ -112,7 +112,7 @@ if ($action == 'edit') {
|
||||
foreach ($arrayofparameters as $key => $val) {
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans($key), $langs->trans($key.'Tooltip'));
|
||||
print '</td><td><input name="'.$key.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.$conf->global->$key.'"></td></tr>';
|
||||
print '</td><td><input name="'.$key.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.getDolGlobalString($key).'"></td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
@ -130,7 +130,7 @@ if ($action == 'edit') {
|
||||
foreach ($arrayofparameters as $key => $val) {
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans($key), $langs->trans($key.'Tooltip'));
|
||||
print '</td><td>'.$conf->global->$key.'</td></tr>';
|
||||
print '</td><td>'.getDolGlobalString($key).'</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -188,7 +188,7 @@ if ($action == 'edit') {
|
||||
print '<tr class="oddeven"><td>';
|
||||
$tooltiphelp = (($langs->trans($key.'Tooltip') != $key.'Tooltip') ? $langs->trans($key.'Tooltip') : '');
|
||||
print $form->textwithpicto($langs->trans($key), $tooltiphelp);
|
||||
print '</td><td><input name="'.$key.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.$conf->global->$key.'"></td></tr>';
|
||||
print '</td><td><input name="'.$key.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.getDolGlobalString($key).'"></td></tr>';
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
@ -209,7 +209,7 @@ if ($action == 'edit') {
|
||||
print '<tr class="oddeven"><td>';
|
||||
$tooltiphelp = (($langs->trans($key.'Tooltip') != $key.'Tooltip') ? $langs->trans($key.'Tooltip') : '');
|
||||
print $form->textwithpicto($langs->trans($key), $tooltiphelp);
|
||||
print '</td><td>'.$conf->global->$key.'</td></tr>';
|
||||
print '</td><td>'.getDolGlobalString($key).'</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -246,7 +246,7 @@ if ($user->rights->categorie->creer) {
|
||||
// Description
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor('description', $description, '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_5, '90%');
|
||||
$doleditor = new DolEditor('description', $description, '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_5, '90%');
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
@ -175,11 +175,10 @@ class Categorie extends CommonObject
|
||||
);
|
||||
|
||||
/**
|
||||
* @var array Object table mapping from type string (table llx_...) when value of key does not match table name.
|
||||
*
|
||||
* @note Move to const array when PHP 5.6 will be our minimum target
|
||||
* @var array Object table mapping from type string (table llx_...) when value of key does not match table name.
|
||||
* This array may be completed by external modules with hook "constructCategory"
|
||||
*/
|
||||
public static $MAP_OBJ_TABLE = array(
|
||||
public $MAP_OBJ_TABLE = array(
|
||||
'customer' => 'societe',
|
||||
'supplier' => 'societe',
|
||||
'member' => 'adherent',
|
||||
|
||||
@ -263,7 +263,7 @@ if ($action == 'edit') {
|
||||
// Desc
|
||||
$desc = (GETPOST('desc-'.$key) ? GETPOST('desc-'.$key) : $object->multilangs[$key]['description']);
|
||||
print '<tr><td class="tdtop">'.$langs->trans('Description').'</td><td>';
|
||||
$doleditor = new DolEditor("desc-$key", $desc, '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%');
|
||||
$doleditor = new DolEditor("desc-$key", $desc, '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_3, '90%');
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
|
||||
@ -323,7 +323,7 @@ if ($action == 'add' && ($user->rights->produit->creer || $user->rights->service
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('Label').'</td>';
|
||||
print '<td><input name="libelle" class="minwidth200 maxwidth300" value="'.GETPOST('libelle', 'alpha').'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans('Description').'</td><td>';
|
||||
$doleditor = new DolEditor('desc', GETPOST('desc', 'restricthtml'), '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%');
|
||||
$doleditor = new DolEditor('desc', GETPOST('desc', 'restricthtml'), '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_3, '90%');
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
@ -987,10 +987,10 @@ while ($i < $imaxinloop) {
|
||||
if (!empty($arrayfields['a.datep']['checked'])) {
|
||||
print '<td class="center nowraponall">';
|
||||
if (empty($obj->fulldayevent)) {
|
||||
print dol_print_date($db->jdate($obj->dp), $formatToUse, 'tzuser');
|
||||
print dol_print_date($db->jdate($obj->dp), $formatToUse, 'tzuserrel');
|
||||
} else {
|
||||
$tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT');
|
||||
print dol_print_date($db->jdate($obj->dp), $formatToUse, ($tzforfullday ? $tzforfullday : 'tzuser'));
|
||||
print dol_print_date($db->jdate($obj->dp), $formatToUse, ($tzforfullday ? $tzforfullday : 'tzuserrel'));
|
||||
}
|
||||
$late = 0;
|
||||
if ($actionstatic->hasDelay() && $actionstatic->percentage >= 0 && $actionstatic->percentage < 100 ) {
|
||||
@ -1006,10 +1006,10 @@ while ($i < $imaxinloop) {
|
||||
if (!empty($arrayfields['a.datep2']['checked'])) {
|
||||
print '<td class="center nowraponall">';
|
||||
if (empty($obj->fulldayevent)) {
|
||||
print dol_print_date($db->jdate($obj->dp2), $formatToUse, 'tzuser');
|
||||
print dol_print_date($db->jdate($obj->dp2), $formatToUse, 'tzuserrel');
|
||||
} else {
|
||||
$tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT');
|
||||
print dol_print_date($db->jdate($obj->dp2), $formatToUse, ($tzforfullday ? $tzforfullday : 'tzuser'));
|
||||
print dol_print_date($db->jdate($obj->dp2), $formatToUse, ($tzforfullday ? $tzforfullday : 'tzuserrel'));
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
@ -1091,11 +1091,11 @@ while ($i < $imaxinloop) {
|
||||
// Date creation
|
||||
if (!empty($arrayfields['a.datec']['checked'])) {
|
||||
// Status/Percent
|
||||
print '<td align="center" class="nowrap">'.dol_print_date($db->jdate($obj->datec), 'dayhour', 'tzuser').'</td>';
|
||||
print '<td align="center" class="nowrap">'.dol_print_date($db->jdate($obj->datec), 'dayhour', 'tzuserrel').'</td>';
|
||||
}
|
||||
// Date update
|
||||
if (!empty($arrayfields['a.tms']['checked'])) {
|
||||
print '<td align="center" class="nowrap">'.dol_print_date($db->jdate($obj->datem), 'dayhour', 'tzuser').'</td>';
|
||||
print '<td align="center" class="nowrap">'.dol_print_date($db->jdate($obj->datem), 'dayhour', 'tzuserrel').'</td>';
|
||||
}
|
||||
if (!empty($arrayfields['a.percent']['checked'])) {
|
||||
// Status/Percent
|
||||
|
||||
@ -1121,7 +1121,7 @@ if ($object->id > 0) {
|
||||
* Latest contracts
|
||||
*/
|
||||
if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) {
|
||||
$sql = "SELECT s.nom, s.rowid, c.rowid as id, c.ref as ref, c.statut as contract_status, c.datec as dc, c.date_contrat as dcon, c.ref_customer as refcus, c.ref_supplier as refsup";
|
||||
$sql = "SELECT s.nom, s.rowid, c.rowid as id, c.ref as ref, c.statut as contract_status, c.datec as dc, c.date_contrat as dcon, c.ref_customer as refcus, c.ref_supplier as refsup, c.entity";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c";
|
||||
$sql .= " WHERE c.fk_soc = s.rowid ";
|
||||
$sql .= " AND s.rowid = ".((int) $object->id);
|
||||
@ -1191,7 +1191,7 @@ if ($object->id > 0) {
|
||||
}
|
||||
}
|
||||
$relativepath = dol_sanitizeFileName($objp->ref).'/'.dol_sanitizeFileName($objp->ref).'.pdf';
|
||||
print $formfile->showPreview($file_list, $contrat->element, $relativepath, 0, $param);
|
||||
print $formfile->showPreview($file_list, $contrat->element, $relativepath, 0);
|
||||
}
|
||||
// $filename = dol_sanitizeFileName($objp->ref);
|
||||
// $filedir = $conf->contrat->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref);
|
||||
@ -1409,6 +1409,7 @@ if ($object->id > 0) {
|
||||
$sql .= ', f.total_ht';
|
||||
$sql .= ', f.total_tva';
|
||||
$sql .= ', f.total_ttc';
|
||||
$sql .= ', f.entity';
|
||||
$sql .= ', f.datef as df, f.datec as dc, f.paye as paye, f.fk_statut as status';
|
||||
$sql .= ', s.nom, s.rowid as socid';
|
||||
$sql .= ', SUM(pf.amount) as am';
|
||||
@ -1475,7 +1476,7 @@ if ($object->id > 0) {
|
||||
}
|
||||
}
|
||||
$relativepath = dol_sanitizeFileName($objp->ref).'/'.dol_sanitizeFileName($objp->ref).'.pdf';
|
||||
print $formfile->showPreview($file_list, $facturestatic->element, $relativepath, 0, $param);
|
||||
print $formfile->showPreview($file_list, $facturestatic->element, $relativepath, 0);
|
||||
}
|
||||
// $filename = dol_sanitizeFileName($objp->ref);
|
||||
// $filedir = $conf->facture->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref);
|
||||
|
||||
@ -39,6 +39,9 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
|
||||
if (!empty($conf->ficheinter->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
|
||||
}
|
||||
|
||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
|
||||
$hookmanager = new HookManager($db);
|
||||
@ -100,6 +103,10 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
|
||||
$supplierorderstatic = new CommandeFournisseur($db);
|
||||
}
|
||||
|
||||
if (!empty($conf->ficheinter->enabled)) {
|
||||
$fichinterstatic = new Fichinter($db);
|
||||
}
|
||||
|
||||
llxHeader("", $langs->trans("CommercialArea"));
|
||||
|
||||
print load_fiche_titre($langs->trans("CommercialArea"), '', 'commercial');
|
||||
@ -508,7 +515,12 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
|
||||
* Draft interventionals
|
||||
*/
|
||||
if (!empty($conf->ficheinter->enabled)) {
|
||||
$sql = "SELECT f.rowid, f.ref, s.nom as name, s.rowid as socid";
|
||||
$sql = "SELECT f.rowid, f.ref, s.nom as name, f.fk_statut";
|
||||
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
|
||||
$sql .= ", s.code_client, s.code_compta, s.client";
|
||||
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
|
||||
$sql .= ", s.logo, s.email, s.entity";
|
||||
$sql .= ", s.canvas";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."fichinter as f";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
@ -524,22 +536,46 @@ if (!empty($conf->ficheinter->enabled)) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
$nbofloop = min($num, $maxofloop);
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<th colspan="2">'.$langs->trans("DraftFichinter").'</th></tr>';
|
||||
$langs->load("fichinter");
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
if ($num) {
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
while ($i < $nbofloop) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
$fichinterstatic->id=$obj->rowid;
|
||||
$fichinterstatic->ref=$obj->ref;
|
||||
$fichinterstatic->statut=$obj->fk_statut;
|
||||
|
||||
$companystatic->id = $obj->socid;
|
||||
$companystatic->name = $obj->name;
|
||||
$companystatic->name_alias = $obj->name_alias;
|
||||
$companystatic->code_client = $obj->code_client;
|
||||
$companystatic->code_compta = $obj->code_compta;
|
||||
$companystatic->client = $obj->client;
|
||||
$companystatic->code_fournisseur = $obj->code_fournisseur;
|
||||
$companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
|
||||
$companystatic->fournisseur = $obj->fournisseur;
|
||||
$companystatic->logo = $obj->logo;
|
||||
$companystatic->email = $obj->email;
|
||||
$companystatic->entity = $obj->entity;
|
||||
$companystatic->canvas = $obj->canvas;
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nowrap">';
|
||||
print "<a href=\"card.php?id=".$obj->rowid."\">".img_object($langs->trans("ShowFichinter"), "intervention").' '.$obj->ref."</a></td>";
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"), "company").' '.dol_trunc($obj->name, 24).'</a></td></tr>';
|
||||
print '<td class="nowrap tdoverflowmax100">';
|
||||
print $fichinterstatic->getNomUrl(1);
|
||||
print "</td>";
|
||||
print '<td class="nowrap tdoverflowmax100">';
|
||||
print $companystatic->getNomUrl(1, 'customer');
|
||||
print '</td></tr>';
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -753,7 +753,7 @@ if ($action == 'create') {
|
||||
print '<div style="padding-top: 10px">';
|
||||
// wysiwyg editor
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor('bodyemail', GETPOST('bodyemail', 'restricthtmlallowunvalid'), '', 600, 'dolibarr_mailings', '', true, true, $conf->global->FCKEDITOR_ENABLE_MAILING, 20, '90%');
|
||||
$doleditor = new DolEditor('bodyemail', GETPOST('bodyemail', 'restricthtmlallowunvalid'), '', 600, 'dolibarr_mailings', '', true, true, getDolGlobalInt('FCKEDITOR_ENABLE_MAILING'), 20, '90%');
|
||||
$doleditor->Create();
|
||||
print '</div>';
|
||||
|
||||
@ -1249,6 +1249,11 @@ if ($action == 'create') {
|
||||
$out .= '<span class="opacitymedium">'.$langs->trans("NoAttachedFiles").'</span><br>';
|
||||
}
|
||||
// Add link to add file
|
||||
$maxfilesizearray = getMaxFileSizeArray();
|
||||
$maxmin = $maxfilesizearray['maxmin'];
|
||||
if ($maxmin > 0) {
|
||||
$out .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
|
||||
}
|
||||
$out .= '<input type="file" class="flat" id="addedfile" name="addedfile" value="'.$langs->trans("Upload").'" />';
|
||||
$out .= ' ';
|
||||
$out .= '<input type="submit" class="button" id="'.$addfileaction.'" name="'.$addfileaction.'" value="'.$langs->trans("MailingAddFile").'" />';
|
||||
@ -1268,7 +1273,7 @@ if ($action == 'create') {
|
||||
if ($action == 'edit') {
|
||||
// wysiwyg editor
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor('bodyemail', $object->body, '', 600, 'dolibarr_mailings', '', true, true, $conf->global->FCKEDITOR_ENABLE_MAILING, 20, '90%');
|
||||
$doleditor = new DolEditor('bodyemail', $object->body, '', 600, 'dolibarr_mailings', '', true, true, getDolGlobalInt('FCKEDITOR_ENABLE_MAILING'), 20, '90%');
|
||||
$doleditor->Create();
|
||||
}
|
||||
if ($action == 'edithtml') {
|
||||
|
||||
@ -384,6 +384,7 @@ if ($object->fetch($id) >= 0) {
|
||||
if ($allowaddtarget) {
|
||||
print '<form '.$bctag[$var].' name="'.$modulename.'" action="'.$_SERVER['PHP_SELF'].'?action=add&token='.newToken().'&id='.$object->id.'&module='.$modulename.'" method="POST" enctype="multipart/form-data">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="page_y" value="'.newToken().'">';
|
||||
} else {
|
||||
print '<div '.$bctag[$var].'>';
|
||||
}
|
||||
@ -428,7 +429,7 @@ if ($object->fetch($id) >= 0) {
|
||||
|
||||
print '<div class="tagtd right">';
|
||||
if ($allowaddtarget) {
|
||||
print '<input type="submit" class="button button-add small" name="button_'.$modulename.'" value="'.$langs->trans("Add").'">';
|
||||
print '<input type="submit" class="button button-add small reposition" name="button_'.$modulename.'" value="'.$langs->trans("Add").'">';
|
||||
} else {
|
||||
print '<input type="submit" class="button small disabled" disabled="disabled" name="button_'.$modulename.'" value="'.$langs->trans("Add").'">';
|
||||
//print $langs->trans("MailNoChangePossible");
|
||||
|
||||
@ -172,7 +172,7 @@ class PropaleStats extends Stats
|
||||
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
|
||||
* @return array Array with amount by month
|
||||
*/
|
||||
public function getAmountByMonth($year, $format)
|
||||
public function getAmountByMonth($year, $format = 0)
|
||||
{
|
||||
global $user;
|
||||
|
||||
|
||||
@ -2264,8 +2264,8 @@ class Commande extends CommonOrder
|
||||
}
|
||||
$sql .= ' ed.fk_origin_line = cd.rowid';
|
||||
$sql .= ' AND cd.fk_commande = '.((int) $this->id);
|
||||
if ($this->fk_product > 0) {
|
||||
$sql .= ' AND cd.fk_product = '.((int) $this->fk_product);
|
||||
if ($fk_product > 0) {
|
||||
$sql .= ' AND cd.fk_product = '.((int) $fk_product);
|
||||
}
|
||||
if ($filtre_statut >= 0) {
|
||||
$sql .= ' AND e.fk_statut >= '.((int) $filtre_statut);
|
||||
|
||||
@ -53,7 +53,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
|
||||
echo '</td>';
|
||||
echo '<td class="linkedcol-name nowraponall" >'.$objectlink->getNomUrl(1).'</td>';
|
||||
echo '<td class="linkedcol-ref">'.$objectlink->ref_client.'</td>';
|
||||
echo '<td class="linkedcol-date">'.dol_print_date($objectlink->date, 'day').'</td>';
|
||||
echo '<td class="linkedcol-date center">'.dol_print_date($objectlink->date, 'day').'</td>';
|
||||
echo '<td class="linkedcol-amount right">';
|
||||
if ($user->rights->commande->lire) {
|
||||
$total = $total + $objectlink->total_ht;
|
||||
|
||||
@ -986,7 +986,7 @@ if ($action == 'create') {
|
||||
print '<td>';
|
||||
// Editor wysiwyg
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor('account_comment', (GETPOST("account_comment") ?GETPOST("account_comment") : $object->comment), '', 90, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_4, '95%');
|
||||
$doleditor = new DolEditor('account_comment', (GETPOST("account_comment") ?GETPOST("account_comment") : $object->comment), '', 90, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_4, '95%');
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2017-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
/* Copyright (C) 2017-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
|
||||
@ -35,6 +35,8 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("compta", "banks", "bills", "accountancy"));
|
||||
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'directdebitcredittransferlist'; // To manage different context of search
|
||||
|
||||
// Security check
|
||||
$socid = GETPOST("socid", "int");
|
||||
if ($user->socid) {
|
||||
@ -75,6 +77,7 @@ if (empty($search_datev_start)) {
|
||||
if (empty($search_datev_end)) {
|
||||
$search_datev_end = GETPOST("search_datev_end", 'int');
|
||||
}
|
||||
$search_type_id = GETPOST('search_type_id', 'int');
|
||||
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
@ -94,19 +97,6 @@ if (!$sortorder) {
|
||||
|
||||
$filtre = GETPOST("filtre", 'alpha');
|
||||
|
||||
if (!GETPOST('typeid')) {
|
||||
$newfiltre = str_replace('filtre=', '', $filtre);
|
||||
$filterarray = explode('-', $newfiltre);
|
||||
foreach ($filterarray as $val) {
|
||||
$part = explode(':', $val);
|
||||
if ($part[0] == 'v.fk_typepayment') {
|
||||
$typeid = $part[1];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$typeid = GETPOST('typeid');
|
||||
}
|
||||
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All test are required to be compatible with all browsers
|
||||
$search_ref = '';
|
||||
$search_label = '';
|
||||
@ -120,7 +110,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
|
||||
$search_bank_entry = '';
|
||||
$search_accountancy_account = '';
|
||||
$search_accountancy_subledger = '';
|
||||
$typeid = '';
|
||||
$search_type_id = '';
|
||||
}
|
||||
|
||||
$search_all = GETPOSTISSET("search_all") ? trim(GETPOST("search_all", 'alpha')) : trim(GETPOST('sall'));
|
||||
@ -265,8 +255,8 @@ if ($search_accountancy_account > 0) {
|
||||
if ($search_accountancy_subledger > 0) {
|
||||
$sql .= " AND v.subledger_account = ".((int) $search_accountancy_subledger);
|
||||
}
|
||||
if ($typeid > 0) {
|
||||
$sql .= " AND v.fk_typepayment=".((int) $typeid);
|
||||
if ($search_type_id > 0) {
|
||||
$sql .= " AND v.fk_typepayment=".((int) $search_type_id);
|
||||
}
|
||||
if ($search_all) {
|
||||
$sql .= natural_search(array_keys($fieldstosearchall), $search_all);
|
||||
@ -324,8 +314,8 @@ if ($resql) {
|
||||
if ($search_datev_end) {
|
||||
$param .= '&search_datev_end='.urlencode($search_datev_end);
|
||||
}
|
||||
if ($typeid > 0) {
|
||||
$param .= '&typeid='.urlencode($typeid);
|
||||
if ($search_type_id > 0) {
|
||||
$param .= '&search_type_id='.urlencode($search_type_id);
|
||||
}
|
||||
if ($search_amount_deb) {
|
||||
$param .= '&search_amount_deb='.urlencode($search_amount_deb);
|
||||
@ -375,6 +365,7 @@ if ($resql) {
|
||||
|
||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
$moreforfilter= '';
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">';
|
||||
@ -427,7 +418,7 @@ if ($resql) {
|
||||
// Payment type
|
||||
if ($arrayfields['type']['checked']) {
|
||||
print '<td class="liste_titre center">';
|
||||
$form->select_types_paiements($typeid, 'typeid', '', 0, 1, 1, 16, 1, 'maxwidth100');
|
||||
$form->select_types_paiements($search_type_id, 'search_type_id', '', 0, 1, 1, 16, 1, 'maxwidth100');
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
@ -544,6 +535,8 @@ if ($resql) {
|
||||
|
||||
|
||||
$totalarray = array();
|
||||
$totalarray['nbfield'] = 0;
|
||||
$totalarray['val']['total_cred'] = 0;
|
||||
while ($i < min($num, $limit)) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
@ -656,7 +649,7 @@ if ($resql) {
|
||||
if ($arrayfields['account']['checked']) {
|
||||
$accountingaccount->fetch('', $obj->accountancy_code, 1);
|
||||
|
||||
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->accountancy_code.' '.$obj->accountancy_label).'">'.$accountingaccount->getNomUrl(0, 1, 1, '', 1).'</td>';
|
||||
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->accountancy_code.' '.$accountingaccount->label).'">'.$accountingaccount->getNomUrl(0, 1, 1, '', 1).'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2011-2016 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2011-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.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
|
||||
@ -58,6 +58,7 @@ $filtre = GETPOST("filtre", 'alpha');
|
||||
if (!$year) {
|
||||
$year = date("Y", time());
|
||||
}
|
||||
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
|
||||
|
||||
$search_account = GETPOST('search_account', 'int');
|
||||
|
||||
@ -184,7 +185,6 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
$total = 0;
|
||||
$totalnb = 0;
|
||||
$totalpaid = 0;
|
||||
|
||||
while ($i < min($num, $limit)) {
|
||||
@ -204,7 +204,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
|
||||
print $socialcontrib->getNomUrl(1, '20');
|
||||
print '</td>';
|
||||
// Type
|
||||
print '<td><a href="../sociales/list.php?filtre=cs.fk_type:'.$obj->type.'">'.$obj->label.'</a></td>';
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/compta/sociales/list.php?filtre=cs.fk_type:'.$obj->type.'">'.$obj->label.'</a></td>';
|
||||
// Expected to pay
|
||||
print '<td class="right"><span class="amount">'.price($obj->total).'</span></td>';
|
||||
// Ref payment
|
||||
@ -246,7 +246,6 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
|
||||
print '</tr>';
|
||||
|
||||
$total = $total + $obj->total;
|
||||
$totalnb = $totalnb + $obj->nb;
|
||||
$totalpaid = $totalpaid + $obj->totalpaid;
|
||||
$i++;
|
||||
}
|
||||
@ -274,7 +273,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
|
||||
|
||||
print load_fiche_titre($langs->trans("VATDeclarations").($year ? ' ('.$langs->trans("Year").' '.$year.')' : ''), '', '');
|
||||
|
||||
$sql = "SELECT ptva.rowid, pv.rowid as id_tva, pv.amount as amount_tva, ptva.amount, pv.label, pv.datev as dm, ptva.datep as date_payment, ptva.fk_bank,";
|
||||
$sql = "SELECT ptva.rowid, pv.rowid as id_tva, pv.amount as amount_tva, ptva.amount, pv.label, pv.datev as dm, ptva.datep as date_payment, ptva.fk_bank, ptva.num_paiement as num_payment,";
|
||||
$sql .= " pct.code as payment_code,";
|
||||
$sql .= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."tva as pv";
|
||||
|
||||
@ -1030,7 +1030,7 @@ if (empty($reshook)) {
|
||||
$object->date = $dateinvoice;
|
||||
$object->date_pointoftax = $date_pointoftax;
|
||||
$object->note_public = trim(GETPOST('note_public', 'restricthtml'));
|
||||
// We do not copy the private note
|
||||
$object->note_private = trim(GETPOST('note_private', 'restricthtml'));
|
||||
$object->ref_client = GETPOST('ref_client', 'alphanohtml');
|
||||
$object->model_pdf = GETPOST('model', 'alphanohtml');
|
||||
$object->fk_project = GETPOST('projectid', 'int');
|
||||
@ -1083,7 +1083,7 @@ if (empty($reshook)) {
|
||||
$object->date = $dateinvoice;
|
||||
$object->date_pointoftax = $date_pointoftax;
|
||||
$object->note_public = trim(GETPOST('note_public', 'restricthtml'));
|
||||
// We do not copy the private note
|
||||
$object->note_private = trim(GETPOST('note_private', 'restricthtml'));
|
||||
$object->ref_client = GETPOST('ref_client');
|
||||
$object->model_pdf = GETPOST('model');
|
||||
$object->fk_project = GETPOST('projectid', 'int');
|
||||
@ -4711,36 +4711,36 @@ if ($action == 'create') {
|
||||
if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency)) {
|
||||
// Multicurrency Amount HT
|
||||
print '<tr><td class="titlefieldmiddle">'.$form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0).'</td>';
|
||||
print '<td class="nowrap amountcard">'.price($sign * $object->multicurrency_total_ht, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'</td>';
|
||||
print '<td class="nowrap right amountcard">'.price($sign * $object->multicurrency_total_ht, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Multicurrency Amount VAT
|
||||
print '<tr><td>'.$form->editfieldkey('MulticurrencyAmountVAT', 'multicurrency_total_tva', '', $object, 0).'</td>';
|
||||
print '<td class="nowrap amountcard">'.price($sign * $object->multicurrency_total_tva, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'</td>';
|
||||
print '<td class="nowrap right amountcard">'.price($sign * $object->multicurrency_total_tva, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Multicurrency Amount TTC
|
||||
print '<tr><td>'.$form->editfieldkey('MulticurrencyAmountTTC', 'multicurrency_total_ttc', '', $object, 0).'</td>';
|
||||
print '<td class="nowrap amountcard">'.price($sign * $object->multicurrency_total_ttc, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'</td>';
|
||||
print '<td class="nowrap right amountcard">'.price($sign * $object->multicurrency_total_ttc, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Amount
|
||||
print '<tr><td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
|
||||
print '<td class="nowrap amountcard">'.price($sign * $object->total_ht, 1, '', 1, - 1, - 1, $conf->currency).'</td></tr>';
|
||||
print '<td class="nowrap right amountcard">'.price($sign * $object->total_ht, 1, '', 1, - 1, - 1, $conf->currency).'</td></tr>';
|
||||
|
||||
// Vat
|
||||
print '<tr><td>'.$langs->trans('AmountVAT').'</td><td colspan="3" class="nowrap amountcard">'.price($sign * $object->total_tva, 1, '', 1, - 1, - 1, $conf->currency).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('AmountVAT').'</td><td colspan="3" class="nowrap right amountcard">'.price($sign * $object->total_tva, 1, '', 1, - 1, - 1, $conf->currency).'</td></tr>';
|
||||
print '</tr>';
|
||||
|
||||
// Amount Local Taxes
|
||||
if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || $object->total_localtax1 != 0) { // Localtax1
|
||||
print '<tr><td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
|
||||
print '<td class="nowrap amountcard">'.price($sign * $object->total_localtax1, 1, '', 1, - 1, - 1, $conf->currency).'</td></tr>';
|
||||
print '<td class="nowrap right amountcard">'.price($sign * $object->total_localtax1, 1, '', 1, - 1, - 1, $conf->currency).'</td></tr>';
|
||||
}
|
||||
if (($mysoc->localtax2_assuj == "1" && $mysoc->useLocalTax(2)) || $object->total_localtax2 != 0) { // Localtax2
|
||||
print '<tr><td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>';
|
||||
print '<td class="nowrap amountcard">'.price($sign * $object->total_localtax2, 1, '', 1, - 1, - 1, $conf->currency).'</td></tr>';
|
||||
print '<td class="nowrap right amountcard">'.price($sign * $object->total_localtax2, 1, '', 1, - 1, - 1, $conf->currency).'</td></tr>';
|
||||
}
|
||||
|
||||
// Revenue stamp
|
||||
@ -4796,7 +4796,7 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
// Total with tax
|
||||
print '<tr><td>'.$langs->trans('AmountTTC').'</td><td class="nowrap amountcard">'.price($sign * $object->total_ttc, 1, '', 1, - 1, - 1, $conf->currency).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('AmountTTC').'</td><td class="nowrap right amountcard">'.price($sign * $object->total_ttc, 1, '', 1, - 1, - 1, $conf->currency).'</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
@ -256,7 +256,7 @@ $arrayfields = array(
|
||||
'f.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
|
||||
);
|
||||
|
||||
if (getDolGlobalString("INVOICE_USE_SITUATION") && $conf->global->INVOICE_USE_RETAINED_WARRANTY) {
|
||||
if (getDolGlobalString("INVOICE_USE_SITUATION") && !empty($conf->global->INVOICE_USE_RETAINED_WARRANTY)) {
|
||||
$arrayfields['f.retained_warranty'] = array('label'=>$langs->trans("RetainedWarranty"), 'checked'=>0, 'position'=>86);
|
||||
}
|
||||
// Overwrite $arrayfields from columns into ->fields (transition before removal of $arrayoffields)
|
||||
@ -1091,7 +1091,7 @@ if ($resql) {
|
||||
$param .= '&search_categ_cus='.urlencode($search_categ_cus);
|
||||
}
|
||||
if (!empty($search_fac_rec_source_title)) {
|
||||
$param .= '&$search_fac_rec_source_title='.urlencode($search_fac_rec_source_title);
|
||||
$param .= '&search_fac_rec_source_title='.urlencode($search_fac_rec_source_title);
|
||||
}
|
||||
|
||||
// Add $param from extra fields
|
||||
|
||||
@ -564,8 +564,12 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
// Bank transaction
|
||||
if (!empty($arrayfields['transaction']['checked'])) {
|
||||
$bankline->fetch($objp->fk_bank);
|
||||
print '<td>'.$bankline->getNomUrl(1, 0).'</td>';
|
||||
print '<td>';
|
||||
if ($objp->fk_bank > 0) {
|
||||
$bankline->fetch($objp->fk_bank);
|
||||
print $bankline->getNomUrl(1, 0);
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2016-2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.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
|
||||
@ -254,6 +255,7 @@ if ($action == 'create') {
|
||||
print "</tr>\n";
|
||||
|
||||
$total = 0;
|
||||
$total_ttc = 0;
|
||||
$totalrecu = 0;
|
||||
|
||||
while ($i < $num) {
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.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
|
||||
@ -134,7 +135,7 @@ print '<tr><td>'.$langs->trans('Mode').'</td><td colspan="3">'.$langs->trans("Pa
|
||||
print '<tr><td>'.$langs->trans('Numero').'</td><td colspan="3">'.$object->num_payment.'</td></tr>';
|
||||
|
||||
// Amount
|
||||
print '<tr><td>'.$langs->trans('Amount').'</td><td colspan="3">'.price($object->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('Amount').'</td><td colspan="3">'.price($object->amount, 0, $langs, 1, -1, -1, $conf->currency).'</td></tr>';
|
||||
|
||||
// Note
|
||||
print '<tr><td>'.$langs->trans('Note').'</td><td colspan="3">'.nl2br($object->note).'</td></tr>';
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2016-2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
/* Copyright (C) 2004-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2016-2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2017-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.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
|
||||
@ -53,6 +53,7 @@ $cancel = GETPOST('cancel', 'aZ09');
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'myobjectcard'; // To manage different context of search
|
||||
$backtopage = GETPOST('backtopage', 'alpha');
|
||||
$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
|
||||
$lineid = GETPOST('lineid', 'int');
|
||||
|
||||
$fk_project = (GETPOST('fk_project') ? GETPOST('fk_project', 'int') : 0);
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.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
|
||||
@ -544,7 +545,7 @@ class PaymentSocialContribution extends CommonObject
|
||||
*/
|
||||
public function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque)
|
||||
{
|
||||
global $conf;
|
||||
global $conf, $langs;
|
||||
|
||||
// Clean data
|
||||
$this->num_payment = trim($this->num_payment);
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2016 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2020 Pierre Ardoin <mapiolca@me.com>
|
||||
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
|
||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
* Copyright (C) 2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2016 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2020 Pierre Ardoin <mapiolca@me.com>
|
||||
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
|
||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
* Copyright (C) 2021-2022 Alexandre Spangaro <aspangaro@open-dsi.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
|
||||
@ -41,16 +41,17 @@ if (!empty($conf->project->enabled)) {
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('compta', 'banks', 'bills', 'hrm', 'projects'));
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$massaction = GETPOST('massaction', 'alpha');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$massaction = GETPOST('massaction', 'alpha');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'sclist';
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'sclist';
|
||||
|
||||
$search_ref = GETPOST('search_ref', 'int');
|
||||
$search_ref = GETPOST('search_ref', 'int');
|
||||
$search_label = GETPOST('search_label', 'alpha');
|
||||
$search_amount = GETPOST('search_amount', 'alpha');
|
||||
$search_status = GETPOST('search_status', 'int');
|
||||
$search_typeid = GETPOST('search_typeid', 'int');
|
||||
$search_amount = GETPOST('search_amount', 'alpha');
|
||||
$search_status = GETPOST('search_status', 'int');
|
||||
$search_date_startday = GETPOST('search_date_startday', 'int');
|
||||
$search_date_startmonth = GETPOST('search_date_startmonth', 'int');
|
||||
$search_date_startyear = GETPOST('search_date_startyear', 'int');
|
||||
@ -70,11 +71,11 @@ $search_date_limit_end = dol_mktime(23, 59, 59, $search_date_limit_endmonth, $se
|
||||
$search_project_ref = GETPOST('search_project_ref', 'alpha');
|
||||
$search_users = GETPOST('search_users');
|
||||
$search_type = GETPOST('search_type', 'int');
|
||||
$search_account = GETPOST('search_account', 'int');
|
||||
$search_account = GETPOST('search_account', 'int');
|
||||
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST("sortorder", 'aZ09comma');
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST("sortorder", 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
|
||||
if (empty($page) || $page == -1) {
|
||||
@ -93,19 +94,6 @@ if (!$sortorder) {
|
||||
|
||||
$filtre = GETPOST("filtre", 'int');
|
||||
|
||||
if (!GETPOSTISSET('search_typeid')) {
|
||||
$newfiltre = str_replace('filtre=', '', $filtre);
|
||||
$filterarray = explode('-', $newfiltre);
|
||||
foreach ($filterarray as $val) {
|
||||
$part = explode(':', $val);
|
||||
if ($part[0] == 'cs.fk_type') {
|
||||
$search_typeid = $part[1];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$search_typeid = GETPOST('search_typeid', 'int');
|
||||
}
|
||||
|
||||
$arrayfields = array(
|
||||
'cs.rowid' =>array('label'=>"Ref", 'checked'=>1, 'position'=>10),
|
||||
'cs.libelle' =>array('label'=>"Label", 'checked'=>1, 'position'=>20),
|
||||
@ -388,6 +376,9 @@ if (empty($mysoc->country_id) && empty($mysoc->country_code)) {
|
||||
$db->close();
|
||||
}
|
||||
|
||||
$moreforfilter = '';
|
||||
$massactionbutton = '';
|
||||
|
||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
if ($massactionbutton) {
|
||||
@ -551,7 +542,9 @@ print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], '', '', '', '', $
|
||||
print '</tr>';
|
||||
|
||||
$i = 0;
|
||||
$totalarray = $TLoadedUsers = array();
|
||||
$totalarray = $TLoadedUsers = array();
|
||||
$totalarray['nbfield'] = 0;
|
||||
$totalarray['val']['totalttcfield'] = 0;
|
||||
while ($i < min($num, $limit)) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2011-2016 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2011-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.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
|
||||
@ -37,6 +37,9 @@ require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsocialcontrib.class.php';
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
|
||||
}
|
||||
|
||||
$hookmanager = new HookManager($db);
|
||||
|
||||
@ -48,6 +51,7 @@ $langs->loadLangs(array('compta', 'bills', 'hrm'));
|
||||
|
||||
$year = GETPOST("year", 'int');
|
||||
$search_sc_type = GETPOST('search_sc_type', 'int');
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
|
||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
@ -123,6 +127,9 @@ if ($year) {
|
||||
if ($search_sc_type) {
|
||||
$param .= '&search_sc_type='.urlencode($search_sc_type);
|
||||
}
|
||||
if ($optioncss != '') {
|
||||
$param .= '&optioncss='.urlencode($optioncss);
|
||||
}
|
||||
$num = 0;
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
@ -139,14 +146,16 @@ $sql = "SELECT c.id, c.libelle as type_label,";
|
||||
$sql .= " cs.rowid, cs.libelle as label_sc, cs.fk_type as type, cs.periode, cs.date_ech, cs.amount as total, cs.paye,";
|
||||
$sql .= " pc.rowid as pid, pc.datep, pc.amount as totalpaid, pc.num_paiement as num_payment, pc.fk_bank,";
|
||||
$sql .= " pct.code as payment_code,";
|
||||
$sql .= " u.rowid uid, u.lastname, u.firstname, u.email, u.login, u.admin,";
|
||||
$sql .= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel, ba.iban_prefix as iban, ba.bic, ba.currency_code, ba.clos";
|
||||
$sql .= " u.rowid as uid, u.lastname, u.firstname, u.email, u.login, u.admin, u.statut,";
|
||||
$sql .= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel, ba.iban_prefix as iban, ba.bic, ba.currency_code, ba.clos,";
|
||||
$sql .= " aj.label as account_journal";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,";
|
||||
$sql .= " ".MAIN_DB_PREFIX."chargesociales as cs";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = cs.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON pc.fk_typepaiement = pct.id";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON pc.fk_bank = b.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_journal as aj ON ba.fk_accountancy_journal = aj.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = cs.fk_user";
|
||||
$sql .= " WHERE cs.fk_type = c.id";
|
||||
$sql .= " AND cs.entity IN (".getEntity("tax").")";
|
||||
@ -278,7 +287,7 @@ while ($i < min($num, $limit)) {
|
||||
print $socialcontrib->getNomUrl(1, '');
|
||||
print '</td>';
|
||||
// Type
|
||||
print '<td title="'.dol_escape_htmltag($obj->label).'" class="tdoverflowmax300">'.$obj->label.'</td>';
|
||||
print '<td title="'.dol_escape_htmltag($obj->label_sc).'" class="tdoverflowmax300">'.$obj->label_sc.'</td>';
|
||||
// Date
|
||||
$date = $obj->periode;
|
||||
if (empty($date)) {
|
||||
@ -297,8 +306,7 @@ while ($i < min($num, $limit)) {
|
||||
$userstatic->admin = $obj->admin;
|
||||
$userstatic->login = $obj->login;
|
||||
$userstatic->email = $obj->email;
|
||||
$userstatic->socid = $obj->fk_soc;
|
||||
$userstatic->statut = $obj->status;
|
||||
$userstatic->statut = $obj->statut;
|
||||
print $userstatic->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
}
|
||||
@ -327,13 +335,16 @@ while ($i < min($num, $limit)) {
|
||||
$accountstatic->id = $obj->bid;
|
||||
$accountstatic->ref = $obj->bref;
|
||||
$accountstatic->number = $obj->bnumber;
|
||||
$accountstatic->accountancy_number = $obj->account_number;
|
||||
$accountstatic->accountancy_journal = $obj->accountancy_journal;
|
||||
$accountstatic->label = $obj->blabel;
|
||||
$accountstatic->iban = $obj->iban;
|
||||
$accountstatic->bic = $obj->bic;
|
||||
$accountstatic->currency_code = $langs->trans("Currency".$obj->currency_code);
|
||||
$accountstatic->clos = $obj->clos;
|
||||
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
$accountstatic->account_number = $obj->account_number;
|
||||
$accountstatic->accountancy_journal = $obj->account_journal;
|
||||
}
|
||||
print $accountstatic->getNomUrl(1);
|
||||
} else {
|
||||
print ' ';
|
||||
@ -356,7 +367,6 @@ while ($i < min($num, $limit)) {
|
||||
print '</tr>';
|
||||
|
||||
$total = $total + $obj->total;
|
||||
$totalnb = $totalnb + $obj->nb;
|
||||
$totalpaid = $totalpaid + $obj->totalpaid;
|
||||
$i++;
|
||||
}
|
||||
|
||||
@ -1271,7 +1271,14 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> '.$langs->trans("Delete").'<br><br></td></tr>';
|
||||
}
|
||||
//print '<tr><td>'.$langs->trans("PhotoFile").'</td></tr>';
|
||||
print '<tr><td><input type="file" class="flat" name="photo" id="photoinput"></td></tr>';
|
||||
print '<tr><td>';
|
||||
$maxfilesizearray = getMaxFileSizeArray();
|
||||
$maxmin = $maxfilesizearray['maxmin'];
|
||||
if ($maxmin > 0) {
|
||||
print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
|
||||
}
|
||||
print '<input type="file" class="flat" name="photo" id="photoinput">';
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
print '</td>';
|
||||
|
||||
@ -159,7 +159,14 @@ if ($action == 'edit') {
|
||||
print '<tr><td class="center"><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> '.$langs->trans("Delete").'<br><br></td></tr>';
|
||||
}
|
||||
print '<tr><td>'.$langs->trans("PhotoFile").'</td></tr>';
|
||||
print '<tr><td><input type="file" class="flat" name="photo" id="photoinput"></td></tr>';
|
||||
print '<tr><td>';
|
||||
$maxfilesizearray = getMaxFileSizeArray();
|
||||
$maxmin = $maxfilesizearray['maxmin'];
|
||||
if ($maxmin > 0) {
|
||||
print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
|
||||
}
|
||||
print '<input type="file" class="flat" name="photo" id="photoinput">';
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
@ -1415,7 +1415,7 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
|
||||
$arrayothercontracts = $object->getListOfContracts('others');
|
||||
$arrayothercontracts = $object->getListOfContracts('others'); // array or -1 if technical error
|
||||
|
||||
/*
|
||||
* Lines of contracts
|
||||
@ -1544,9 +1544,9 @@ if ($action == 'create') {
|
||||
print '<td class="right nowraponall">'.price($objp->pa_ht).'</td>';
|
||||
}
|
||||
|
||||
// Icon move, update et delete (statut contrat 0=brouillon,1=valide,2=ferme)
|
||||
// Icon move, update et delete (status contract 0=draft,1=validated,2=closed)
|
||||
print '<td class="nowraponall right">';
|
||||
if ($user->rights->contrat->creer && count($arrayothercontracts) && ($object->statut >= 0)) {
|
||||
if ($user->rights->contrat->creer && is_array($arrayothercontracts) && count($arrayothercontracts) && ($object->statut >= 0)) {
|
||||
print '<!-- link to move service line into another contract -->';
|
||||
print '<a class="reposition marginrightonly" style="padding-left: 5px;" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=move&token='.newToken().'&rowid='.$objp->rowid.'">';
|
||||
print img_picto($langs->trans("MoveToAnotherContract"), 'uparrow');
|
||||
|
||||
@ -1058,7 +1058,7 @@ class Contrat extends CommonObject
|
||||
if (count($exp->linkedObjectsIds['commande']) > 0) {
|
||||
foreach ($exp->linkedObjectsIds['commande'] as $key => $value) {
|
||||
$originforcontact = 'commande';
|
||||
$originidforcontact = $value->id;
|
||||
$originidforcontact = $value;
|
||||
break; // We take first one
|
||||
}
|
||||
}
|
||||
@ -2126,7 +2126,7 @@ class Contrat extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Return list of other contracts for same company than current contract
|
||||
* Return list of other contracts for the same company than current contract
|
||||
*
|
||||
* @param string $option 'all' or 'others'
|
||||
* @param array $status sort contracts having these status
|
||||
@ -2138,7 +2138,7 @@ class Contrat extends CommonObject
|
||||
{
|
||||
$tab = array();
|
||||
|
||||
$sql = "SELECT c.rowid, c.ref";
|
||||
$sql = "SELECT c.rowid";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."contrat as c";
|
||||
if (!empty($product_categories)) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."contratdet as cd ON cd.fk_contrat = c.rowid";
|
||||
@ -2159,12 +2159,12 @@ class Contrat extends CommonObject
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$contrat = new Contrat($this->db);
|
||||
$contrat->fetch($obj->rowid);
|
||||
$tab[] = $contrat;
|
||||
$tab[$contrat->id] = $contrat;
|
||||
$i++;
|
||||
}
|
||||
return $tab;
|
||||
} else {
|
||||
$this->error = $this->db->error();
|
||||
$this->error = $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -278,7 +278,7 @@ if ($action == 'update' && !empty($permissiontoadd)) {
|
||||
$action = 'view';
|
||||
$urltogo = $backtopage ? str_replace('__ID__', $result, $backtopage) : $backurlforlist;
|
||||
$urltogo = preg_replace('/--IDFORBACKTOPAGE--/', $object->id, $urltogo); // New method to autoselect project after a New on another form object creation
|
||||
if ($urltogo) {
|
||||
if ($urltogo && !$noback) {
|
||||
header("Location: " . $urltogo);
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -1055,6 +1055,8 @@ if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == '
|
||||
|
||||
if (in_array($objecttmp->element, array('societe', 'member'))) {
|
||||
$result = $objecttmp->delete($objecttmp->id, $user, 1);
|
||||
} elseif (in_array($objecttmp->element, array('action'))) {
|
||||
$result = $objecttmp->delete();
|
||||
} else {
|
||||
$result = $objecttmp->delete($user);
|
||||
}
|
||||
|
||||
@ -63,7 +63,7 @@ class box_scheduled_jobs extends ModeleBoxes
|
||||
|
||||
$this->db = $db;
|
||||
|
||||
$this->hidden = !($user->rights->service->lire && $user->rights->contrat->lire);
|
||||
$this->hidden = !($user->hasRight('service', 'lire') && $user->hasRight('contrat', 'lire'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -168,17 +168,18 @@ abstract class CommonInvoice extends CommonObject
|
||||
|
||||
/**
|
||||
* Return amount (with tax) of all deposits invoices used by invoice.
|
||||
* Should always be empty, except if option FACTURE_DEPOSITS_ARE_JUST_PAYMENTS is on (not recommended).
|
||||
* Should always be empty, except if option FACTURE_DEPOSITS_ARE_JUST_PAYMENTS is on for sale invoices (not recommended),
|
||||
* of FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS is on for purchase invoices (not recommended).
|
||||
*
|
||||
* @param int $multicurrency Return multicurrency_amount instead of amount
|
||||
* @return float <0 and set ->error if KO, Sum of deposits amount otherwise
|
||||
*/
|
||||
public function getSumDepositsUsed($multicurrency = 0)
|
||||
{
|
||||
if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier') {
|
||||
/*if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier') {
|
||||
// FACTURE_DEPOSITS_ARE_JUST_PAYMENTS was never supported for purchase invoice, so we can return 0 with no need of SQL for this case.
|
||||
return 0.0;
|
||||
}
|
||||
}*/
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
|
||||
|
||||
@ -899,6 +900,101 @@ abstract class CommonInvoice extends CommonObject
|
||||
|
||||
return $s;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Build string for QR-Bill (Switzerland)
|
||||
*
|
||||
* @return string String for Switzerland QR Code if QR-Bill
|
||||
*/
|
||||
public function buildSwitzerlandQRString()
|
||||
{
|
||||
global $conf, $mysoc;
|
||||
|
||||
$tmplang = new Translate('', $conf);
|
||||
$tmplang->setDefaultLang('en_US');
|
||||
$tmplang->load("main");
|
||||
|
||||
$pricewithtaxstring = price2num($this->total_ttc, 2, 1);
|
||||
$pricetaxstring = price2num($this->total_tva, 2, 1);
|
||||
|
||||
$complementaryinfo = '';
|
||||
/*
|
||||
Example: //S1/10/10201409/11/190512/20/1400.000-53/30/106017086/31/180508/32/7.7/40/2:10;0:30
|
||||
/10/ Numéro de facture – 10201409
|
||||
/11/ Date de facture – 12.05.2019
|
||||
/20/ Référence client – 1400.000-53
|
||||
/30/ Numéro IDE pour la TVA – CHE-106.017.086 TVA
|
||||
/31/ Date de la prestation pour la comptabilisation de la TVA – 08.05.2018
|
||||
/32/ Taux de TVA sur le montant total de la facture – 7.7%
|
||||
/40/ Conditions – 2% d’escompte à 10 jours, paiement net à 30 jours
|
||||
*/
|
||||
$datestring = dol_print_date($this->date, '%y%m%d');
|
||||
//$pricewithtaxstring = price($this->total_ttc, 0, $tmplang, 0, -1, 2);
|
||||
//$pricetaxstring = price($this->total_tva, 0, $tmplang, 0, -1, 2);
|
||||
$complementaryinfo = '//S1/10/'.str_replace('/', '', $this->ref).'/11/'.$datestring;
|
||||
if ($this->ref_client) {
|
||||
$complementaryinfo .= '/20/'.$this->ref_client;
|
||||
}
|
||||
if ($this->thirdparty->vat_number) {
|
||||
$complementaryinfo .= '/30/'.$this->thirdparty->vat_number;
|
||||
}
|
||||
|
||||
// Header
|
||||
$s .= "SPC\n";
|
||||
$s .= "0200\n";
|
||||
$s .= "1\n";
|
||||
if ($this->fk_account > 0) {
|
||||
// Bank BAN if country is LI or CH
|
||||
// TODO Add
|
||||
$bankaccount = new Account($this->db);
|
||||
$bankaccount->fetch($this->fk_account);
|
||||
$s .= $bankaccount->iban."\n";
|
||||
} else {
|
||||
$s .= "\n";
|
||||
}
|
||||
// Seller
|
||||
$s .= "S\n";
|
||||
$s .= dol_trunc($mysoc->name, 70, 'right', 'UTF-8', 1)."\n";
|
||||
$addresslinearray = explode("\n", $mysoc->address);
|
||||
$s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1)."\n"; // address line 1
|
||||
$s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1)."\n"; // address line 2
|
||||
$s .= dol_trunc($mysoc->zip, 16, 'right', 'UTF-8', 1)."\n";
|
||||
$s .= dol_trunc($mysoc->town, 35, 'right', 'UTF-8', 1)."\n";
|
||||
$s .= dol_trunc($mysoc->country_code, 2, 'right', 'UTF-8', 1)."\n";
|
||||
// Final seller
|
||||
$s .= "\n";
|
||||
$s .= "\n";
|
||||
$s .= "\n";
|
||||
$s .= "\n";
|
||||
$s .= "\n";
|
||||
$s .= "\n";
|
||||
$s .= "\n";
|
||||
// Amount of payment (to do?)
|
||||
$s .= price($pricewithtaxstring, 0, 'none', 0, 0, 2)."\n";
|
||||
$s .= ($this->multicurrency_code ? $this->multicurrency_code : $conf->currency)."\n";
|
||||
// Buyer
|
||||
$s .= "S\n";
|
||||
$s .= dol_trunc($this->thirdparty->name, 70, 'right', 'UTF-8', 1)."\n";
|
||||
$addresslinearray = explode("\n", $this->thirdparty->address);
|
||||
$s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1)."\n"; // address line 1
|
||||
$s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1)."\n"; // address line 2
|
||||
$s .= dol_trunc($this->thirdparty->zip, 16, 'right', 'UTF-8', 1)."\n";
|
||||
$s .= dol_trunc($this->thirdparty->town, 35, 'right', 'UTF-8', 1)."\n";
|
||||
$s .= dol_trunc($this->thirdparty->country_code, 2, 'right', 'UTF-8', 1)."\n";
|
||||
// ID of payment
|
||||
$s .= "NON\n"; // NON or QRR
|
||||
$s .= "\n"; // QR Code if previous field is QRR
|
||||
if ($complementaryinfo) {
|
||||
$s .= $complementaryinfo."\n";
|
||||
} else {
|
||||
$s .= "\n";
|
||||
}
|
||||
$s .= "EPD\n";
|
||||
$s .= "\n";
|
||||
//var_dump($s);exit;
|
||||
return $s;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -186,6 +186,12 @@ abstract class CommonObject
|
||||
*/
|
||||
public $projet;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* @see fk_project
|
||||
*/
|
||||
public $fk_projet;
|
||||
|
||||
/**
|
||||
* @var Contact a related contact
|
||||
* @see fetch_contact()
|
||||
@ -272,7 +278,7 @@ abstract class CommonObject
|
||||
public $country_id;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
* @var string The ISO country code on 2 chars.
|
||||
* @see getFullAddress(), isInEEC(), country
|
||||
*/
|
||||
public $country_code;
|
||||
|
||||
@ -746,8 +746,8 @@ class Conf
|
||||
$this->global->PDF_ALLOW_HTML_FOR_FREE_TEXT = 1; // allow html content into free footer text
|
||||
}
|
||||
|
||||
// Default max file size for upload
|
||||
$this->maxfilesize = (empty($this->global->MAIN_UPLOAD_DOC) ? 0 : (int) $this->global->MAIN_UPLOAD_DOC * 1024);
|
||||
// Default max file size for upload (deprecated)
|
||||
//$this->maxfilesize = (empty($this->global->MAIN_UPLOAD_DOC) ? 0 : (int) $this->global->MAIN_UPLOAD_DOC * 1024);
|
||||
|
||||
// By default, we propagate contacts
|
||||
if (!isset($this->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN)) {
|
||||
|
||||
@ -144,6 +144,10 @@ class EvalMath
|
||||
*/
|
||||
public function evaluate($expr)
|
||||
{
|
||||
if (empty($expr)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->last_error = null;
|
||||
$this->last_error_code = null;
|
||||
$expr = trim($expr);
|
||||
@ -374,10 +378,6 @@ class EvalMath
|
||||
*/
|
||||
private function pfx($tokens, $vars = array())
|
||||
{
|
||||
if ($tokens == false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$stack = new EvalMathStack();
|
||||
|
||||
foreach ($tokens as $token) { // nice and easy
|
||||
|
||||
@ -60,6 +60,11 @@ class ExtraFields
|
||||
*/
|
||||
public $attribute_choice;
|
||||
|
||||
/**
|
||||
* @var array array to store extrafields definition
|
||||
* @deprecated
|
||||
*/
|
||||
public $attribute_list;
|
||||
|
||||
/**
|
||||
* @var array New array to store extrafields definition
|
||||
|
||||
@ -4749,7 +4749,7 @@ class Form
|
||||
print img_picto('', 'bank_account', 'class="pictofixedwidth"');
|
||||
$nbaccountfound = $this->select_comptes($selected, $htmlname, 0, '', $addempty);
|
||||
if ($nbaccountfound > 0) {
|
||||
print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
}
|
||||
print '</form>';
|
||||
} else {
|
||||
@ -4901,9 +4901,11 @@ class Form
|
||||
* @param int|string $height Force height of box (0 = auto)
|
||||
* @param int $width Force width of box ('999' or '90%'). Ignored and forced to 90% on smartphones.
|
||||
* @param int $disableformtag 1=Disable form tag. Can be used if we are already inside a <form> section.
|
||||
* @param string $labelbuttonyes Label for Yes
|
||||
* @param string $labelbuttonno Label for No
|
||||
* @return string HTML ajax code if a confirm ajax popup is required, Pure HTML code if it's an html form
|
||||
*/
|
||||
public function formconfirm($page, $title, $question, $action, $formquestion = '', $selectedchoice = '', $useajax = 0, $height = 0, $width = 500, $disableformtag = 0)
|
||||
public function formconfirm($page, $title, $question, $action, $formquestion = '', $selectedchoice = '', $useajax = 0, $height = 0, $width = 500, $disableformtag = 0, $labelbuttonyes = 'Yes', $labelbuttonno = 'No')
|
||||
{
|
||||
global $langs, $conf;
|
||||
|
||||
@ -5012,7 +5014,7 @@ class Form
|
||||
$more .= ' checked="checked"';
|
||||
}
|
||||
$more .= ' /> ';
|
||||
$more .= '<label for="'.dol_escape_htmltag($input['name'].$selkey).'">'.$selval.'</label>';
|
||||
$more .= '<label for="'.dol_escape_htmltag($input['name'].$selkey).'" class="valignmiddle">'.$selval.'</label>';
|
||||
$more .= '</div></div>'."\n";
|
||||
$i++;
|
||||
}
|
||||
@ -5118,6 +5120,7 @@ class Form
|
||||
$(this).parent().find("button.ui-button:eq(2)").focus();
|
||||
},';
|
||||
}
|
||||
|
||||
$formconfirm .= '
|
||||
resizable: false,
|
||||
height: "'.$height.'",
|
||||
@ -5125,7 +5128,7 @@ class Form
|
||||
modal: true,
|
||||
closeOnEscape: false,
|
||||
buttons: {
|
||||
"'.dol_escape_js($langs->transnoentities("Yes")).'": function() {
|
||||
"'.dol_escape_js($langs->transnoentities($labelbuttonyes)).'": function() {
|
||||
var options = "&token='.urlencode(newToken()).'";
|
||||
var inputok = '.json_encode($inputok).'; /* List of fields into form */
|
||||
var pageyes = "'.dol_escape_js(!empty($pageyes) ? $pageyes : '').'";
|
||||
@ -5148,7 +5151,7 @@ class Form
|
||||
if (pageyes.length > 0) { location.href = urljump; }
|
||||
$(this).dialog("close");
|
||||
},
|
||||
"'.dol_escape_js($langs->transnoentities("No")).'": function() {
|
||||
"'.dol_escape_js($langs->transnoentities($labelbuttonno)).'": function() {
|
||||
var options = "&token='.urlencode(newToken()).'";
|
||||
var inputko = '.json_encode($inputko).'; /* List of fields into form */
|
||||
var pageno="'.dol_escape_js(!empty($pageno) ? $pageno : '').'";
|
||||
@ -5213,7 +5216,7 @@ class Form
|
||||
$formconfirm .= '<tr class="valid">';
|
||||
$formconfirm .= '<td class="valid">'.$question.'</td>';
|
||||
$formconfirm .= '<td class="valid center">';
|
||||
$formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly');
|
||||
$formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly', $labelbuttonyes, $labelbuttonno);
|
||||
$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="'.$langs->trans("Validate").'">';
|
||||
$formconfirm .= '</td>';
|
||||
$formconfirm .= '</tr>'."\n";
|
||||
@ -8844,9 +8847,11 @@ class Form
|
||||
* @param int $useempty 1=Add empty line
|
||||
* @param int $addjscombo 1=Add js beautifier on combo box
|
||||
* @param string $morecss More CSS
|
||||
* @return string See option
|
||||
* @param string $labelyes Label for Yes
|
||||
* @param string $labelno Label for No
|
||||
* @return string See option
|
||||
*/
|
||||
public function selectyesno($htmlname, $value = '', $option = 0, $disabled = false, $useempty = 0, $addjscombo = 0, $morecss = '')
|
||||
public function selectyesno($htmlname, $value = '', $option = 0, $disabled = false, $useempty = 0, $addjscombo = 0, $morecss = '', $labelyes = 'Yes', $labelno = 'No')
|
||||
{
|
||||
global $langs;
|
||||
|
||||
@ -8857,6 +8862,7 @@ class Form
|
||||
$no = "0";
|
||||
}
|
||||
|
||||
|
||||
$disabled = ($disabled ? ' disabled' : '');
|
||||
|
||||
$resultyesno = '<select class="flat width75'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'"'.$disabled.'>'."\n";
|
||||
@ -8864,12 +8870,12 @@ class Form
|
||||
$resultyesno .= '<option value="-1"'.(($value < 0) ? ' selected' : '').'> </option>'."\n";
|
||||
}
|
||||
if (("$value" == 'yes') || ($value == 1)) {
|
||||
$resultyesno .= '<option value="'.$yes.'" selected>'.$langs->trans("Yes").'</option>'."\n";
|
||||
$resultyesno .= '<option value="'.$no.'">'.$langs->trans("No").'</option>'."\n";
|
||||
$resultyesno .= '<option value="'.$yes.'" selected>'.$langs->trans($labelyes).'</option>'."\n";
|
||||
$resultyesno .= '<option value="'.$no.'">'.$langs->trans($labelno).'</option>'."\n";
|
||||
} else {
|
||||
$selected = (($useempty && $value != '0' && $value != 'no') ? '' : ' selected');
|
||||
$resultyesno .= '<option value="'.$yes.'">'.$langs->trans("Yes").'</option>'."\n";
|
||||
$resultyesno .= '<option value="'.$no.'"'.$selected.'>'.$langs->trans("No").'</option>'."\n";
|
||||
$resultyesno .= '<option value="'.$yes.'">'.$langs->trans($labelyes).'</option>'."\n";
|
||||
$resultyesno .= '<option value="'.$no.'"'.$selected.'>'.$langs->trans($labelno).'</option>'."\n";
|
||||
}
|
||||
$resultyesno .= '</select>'."\n";
|
||||
|
||||
@ -9361,7 +9367,14 @@ class Form
|
||||
if ($object->photo) {
|
||||
$ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">'.$langs->trans("Delete").'</label><br><br></td></tr>';
|
||||
}
|
||||
$ret .= '<tr><td class="tdoverflow"><input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"'.($capture ? ' capture="'.$capture.'"' : '').'></td></tr>';
|
||||
$ret .= '<tr><td class="tdoverflow">';
|
||||
$maxfilesizearray = getMaxFileSizeArray();
|
||||
$maxmin = $maxfilesizearray['maxmin'];
|
||||
if ($maxmin > 0) {
|
||||
$ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
|
||||
}
|
||||
$ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"'.($capture ? ' capture="'.$capture.'"' : '').'>';
|
||||
$ret .= '</td></tr>';
|
||||
$ret .= '</table>';
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -283,7 +283,7 @@ class FormAccounting extends Form
|
||||
$out .= '</select>';
|
||||
//if ($user->admin && $help) $out .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
|
||||
} else {
|
||||
$out .= $langs->trans("ErrorNoAccountingCategoryForThisCountry", $mysoc->country_code);
|
||||
$out = $langs->trans("ErrorNoAccountingCategoryForThisCountry", $mysoc->country_code);
|
||||
}
|
||||
} else {
|
||||
dol_print_error($this->db);
|
||||
@ -505,6 +505,7 @@ class FormAccounting extends Form
|
||||
}
|
||||
|
||||
// Build select
|
||||
$out = '';
|
||||
$out .= Form::selectarray($htmlname, $aux_account, $selectid, ($showempty ? (is_numeric($showempty) ? 1 : $showempty): 0), 0, 0, '', 0, 0, 0, '', $morecss, 1);
|
||||
//automatic filling if we give the name of the subledger_label input
|
||||
if (!empty($conf->use_javascript_ajax) && !empty($labelhtmlname)) {
|
||||
|
||||
@ -188,7 +188,7 @@ class FormContract
|
||||
print '<input type="hidden" name="action" value="setcontract">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$this->select_contract($socid, $selected, $htmlname, $maxlength, $showempty, $showRef);
|
||||
print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
print '</form>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -148,64 +148,15 @@ class FormFile
|
||||
|
||||
$out .= '<td class="valignmiddle nowrap">';
|
||||
|
||||
$max = $conf->global->MAIN_UPLOAD_DOC; // In Kb
|
||||
$maxphp = @ini_get('upload_max_filesize'); // In unknown
|
||||
if (preg_match('/k$/i', $maxphp)) {
|
||||
$maxphp = preg_replace('/k$/i', '', $maxphp);
|
||||
$maxphp = $maxphp * 1;
|
||||
}
|
||||
if (preg_match('/m$/i', $maxphp)) {
|
||||
$maxphp = preg_replace('/m$/i', '', $maxphp);
|
||||
$maxphp = $maxphp * 1024;
|
||||
}
|
||||
if (preg_match('/g$/i', $maxphp)) {
|
||||
$maxphp = preg_replace('/g$/i', '', $maxphp);
|
||||
$maxphp = $maxphp * 1024 * 1024;
|
||||
}
|
||||
if (preg_match('/t$/i', $maxphp)) {
|
||||
$maxphp = preg_replace('/t$/i', '', $maxphp);
|
||||
$maxphp = $maxphp * 1024 * 1024 * 1024;
|
||||
}
|
||||
$maxphp2 = @ini_get('post_max_size'); // In unknown
|
||||
if (preg_match('/k$/i', $maxphp2)) {
|
||||
$maxphp2 = preg_replace('/k$/i', '', $maxphp2);
|
||||
$maxphp2 = $maxphp2 * 1;
|
||||
}
|
||||
if (preg_match('/m$/i', $maxphp2)) {
|
||||
$maxphp2 = preg_replace('/m$/i', '', $maxphp2);
|
||||
$maxphp2 = $maxphp2 * 1024;
|
||||
}
|
||||
if (preg_match('/g$/i', $maxphp2)) {
|
||||
$maxphp2 = preg_replace('/g$/i', '', $maxphp2);
|
||||
$maxphp2 = $maxphp2 * 1024 * 1024;
|
||||
}
|
||||
if (preg_match('/t$/i', $maxphp2)) {
|
||||
$maxphp2 = preg_replace('/t$/i', '', $maxphp2);
|
||||
$maxphp2 = $maxphp2 * 1024 * 1024 * 1024;
|
||||
}
|
||||
// Now $max and $maxphp and $maxphp2 are in Kb
|
||||
$maxmin = $max;
|
||||
$maxphptoshow = $maxphptoshowparam = '';
|
||||
if ($maxphp > 0) {
|
||||
$maxmin = min($max, $maxphp);
|
||||
$maxphptoshow = $maxphp;
|
||||
$maxphptoshowparam = 'upload_max_filesize';
|
||||
}
|
||||
if ($maxphp2 > 0) {
|
||||
$maxmin = min($max, $maxphp2);
|
||||
if ($maxphp2 < $maxphp) {
|
||||
$maxphptoshow = $maxphp2;
|
||||
$maxphptoshowparam = 'post_max_size';
|
||||
}
|
||||
}
|
||||
|
||||
$maxfilesizearray = getMaxFileSizeArray();
|
||||
$max = $maxfilesizearray['max'];
|
||||
$maxmin = $maxfilesizearray['maxmin'];
|
||||
$maxphptoshow = $maxfilesizearray['maxphptoshow'];
|
||||
$maxphptoshowparam = $maxfilesizearray['maxphptoshowparam'];
|
||||
if ($maxmin > 0) {
|
||||
// MAX_FILE_SIZE doit précéder le champ input de type file
|
||||
$out .= '<input type="hidden" name="max_file_size" value="'.($maxmin * 1024).'">';
|
||||
$out .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
|
||||
}
|
||||
|
||||
$out .= '<input class="flat minwidth400 maxwidth200onsmartphone" type="file"';
|
||||
//$out .= ((!empty($conf->global->MAIN_DISABLE_MULTIPLE_FILEUPLOAD) || $conf->browser->layout != 'classic') ? ' name="userfile"' : ' name="userfile[]" multiple');
|
||||
$out .= ((!empty($conf->global->MAIN_DISABLE_MULTIPLE_FILEUPLOAD) || $disablemulti) ? ' name="userfile"' : ' name="userfile[]" multiple');
|
||||
$out .= (empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm) ? ' disabled' : '');
|
||||
$out .= (!empty($accept) ? ' accept="'.$accept.'"' : ' accept=""');
|
||||
|
||||
@ -829,6 +829,11 @@ class FormMail extends Form
|
||||
$out .= '<span class="opacitymedium">'.$langs->trans("NoAttachedFiles").'</span><br>';
|
||||
}
|
||||
if ($this->withfile == 2) {
|
||||
$maxfilesizearray = getMaxFileSizeArray();
|
||||
$maxmin = $maxfilesizearray['maxmin'];
|
||||
if ($maxmin > 0) {
|
||||
$out .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
|
||||
}
|
||||
// Can add other files
|
||||
if (!empty($conf->global->FROM_MAIL_USE_INPUT_FILE_MULTIPLE)) {
|
||||
$out .= '<input type="file" class="flat" id="addedfile" name="addedfile[]" value="'.$langs->trans("Upload").'" multiple />';
|
||||
|
||||
@ -700,11 +700,14 @@ class FormOther
|
||||
print ' selected';
|
||||
}
|
||||
|
||||
$labeltoshow = $langs->trans("Project").' '.$lines[$i]->projectref;
|
||||
$labeltoshow = $lines[$i]->projectref;
|
||||
//$labeltoshow .= ' '.$lines[$i]->projectlabel;
|
||||
if (empty($lines[$i]->public)) {
|
||||
$labeltoshow .= ' <span class="opacitymedium">('.$langs->trans("Visibility").': '.$langs->trans("PrivateProject").')</span>';
|
||||
//$labeltoshow .= ' <span class="opacitymedium">('.$langs->trans("Visibility").': '.$langs->trans("PrivateProject").')</span>';
|
||||
$labeltoshow = img_picto($lines[$i]->projectlabel, 'project', 'class="pictofixedwidth"').$labeltoshow;
|
||||
} else {
|
||||
$labeltoshow .= ' <span class="opacitymedium">('.$langs->trans("Visibility").': '.$langs->trans("SharedProject").')</span>';
|
||||
//$labeltoshow .= ' <span class="opacitymedium">('.$langs->trans("Visibility").': '.$langs->trans("SharedProject").')</span>';
|
||||
$labeltoshow = img_picto($lines[$i]->projectlabel, 'projectpub', 'class="pictofixedwidth"').$labeltoshow;
|
||||
}
|
||||
|
||||
print ' data-html="'.dol_escape_htmltag($labeltoshow).'"';
|
||||
@ -738,12 +741,14 @@ class FormOther
|
||||
print ' disabled';
|
||||
}
|
||||
|
||||
$labeltoshow = $langs->trans("Project").' '.$lines[$i]->projectref;
|
||||
$labeltoshow .= ' '.$lines[$i]->projectlabel;
|
||||
$labeltoshow = $lines[$i]->projectref;
|
||||
//$labeltoshow .= ' '.$lines[$i]->projectlabel;
|
||||
if (empty($lines[$i]->public)) {
|
||||
$labeltoshow .= ' <span class="opacitymedium">('.$langs->trans("Visibility").': '.$langs->trans("PrivateProject").')</span>';
|
||||
//$labeltoshow .= ' <span class="opacitymedium">('.$langs->trans("Visibility").': '.$langs->trans("PrivateProject").')</span>';
|
||||
$labeltoshow = img_picto($lines[$i]->projectlabel, 'project', 'class="pictofixedwidth"').$labeltoshow;
|
||||
} else {
|
||||
$labeltoshow .= ' <span class="opacitymedium">('.$langs->trans("Visibility").': '.$langs->trans("SharedProject").')</span>';
|
||||
//$labeltoshow .= ' <span class="opacitymedium">('.$langs->trans("Visibility").': '.$langs->trans("SharedProject").')</span>';
|
||||
$labeltoshow = img_picto($lines[$i]->projectlabel, 'projectpub', 'class="pictofixedwidth"').$labeltoshow;
|
||||
}
|
||||
if ($lines[$i]->id) {
|
||||
$labeltoshow .= ' > ';
|
||||
|
||||
@ -418,7 +418,7 @@ class FormTicket
|
||||
}
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$uselocalbrowser = true;
|
||||
$doleditor = new DolEditor('message', $msg, '100%', 230, $toolbarname, 'In', true, $uselocalbrowser, $conf->global->FCKEDITOR_ENABLE_TICKET, ROWS_8, '90%');
|
||||
$doleditor = new DolEditor('message', $msg, '100%', 230, $toolbarname, 'In', true, $uselocalbrowser, getDolGlobalInt('FCKEDITOR_ENABLE_TICKET'), ROWS_8, '90%');
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
|
||||
@ -491,6 +491,11 @@ class FormTicket
|
||||
$out .= $langs->trans("NoAttachedFiles").'<br>';
|
||||
}
|
||||
if ($this->withfile == 2) { // Can add other files
|
||||
$maxfilesizearray = getMaxFileSizeArray();
|
||||
$maxmin = $maxfilesizearray['maxmin'];
|
||||
if ($maxmin > 0) {
|
||||
$out .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
|
||||
}
|
||||
$out .= '<input type="file" class="flat" id="addedfile" name="addedfile" value="'.$langs->trans("Upload").'" />';
|
||||
$out .= ' ';
|
||||
$out .= '<input type="submit" class="button smallpaddingimp reposition" id="addfile" name="addfile" value="'.$langs->trans("MailingAddFile").'" />';
|
||||
@ -1470,7 +1475,7 @@ class FormTicket
|
||||
print '</td><td>';
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
|
||||
$doleditor = new DolEditor('mail_intro', $mail_intro, '100%', 90, 'dolibarr_details', '', false, $uselocalbrowser, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_2, 70);
|
||||
$doleditor = new DolEditor('mail_intro', $mail_intro, '100%', 90, 'dolibarr_details', '', false, $uselocalbrowser, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_2, 70);
|
||||
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
@ -1507,7 +1512,7 @@ class FormTicket
|
||||
//$toolbarname = 'dolibarr_details';
|
||||
$toolbarname = 'dolibarr_notes';
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor('message', $defaultmessage, '100%', 200, $toolbarname, '', false, $uselocalbrowser, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_5, 70);
|
||||
$doleditor = new DolEditor('message', $defaultmessage, '100%', 200, $toolbarname, '', false, $uselocalbrowser, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_5, 70);
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
|
||||
@ -1519,7 +1524,7 @@ class FormTicket
|
||||
print $form->textwithpicto('', $langs->trans("TicketMessageMailSignatureHelp"), 1, 'help');
|
||||
print '</td><td>';
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor('mail_signature', $mail_signature, '100%', 150, 'dolibarr_details', '', false, $uselocalbrowser, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_2, 70);
|
||||
$doleditor = new DolEditor('mail_signature', $mail_signature, '100%', 150, 'dolibarr_details', '', false, $uselocalbrowser, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_2, 70);
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@ -33,6 +33,13 @@ abstract class Stats
|
||||
protected $lastfetchdate = array(); // Dates of cache file read by methods
|
||||
public $cachefilesuffix = ''; // Suffix to add to name of cache file (to avoid file name conflicts)
|
||||
|
||||
/**
|
||||
* @param int $year number
|
||||
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
|
||||
* @return int value
|
||||
*/
|
||||
protected abstract function getNbByMonth($year, $format = 0);
|
||||
|
||||
/**
|
||||
* Return nb of elements by month for several years
|
||||
*
|
||||
@ -123,6 +130,13 @@ abstract class Stats
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $year year number
|
||||
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
|
||||
* @return int value
|
||||
*/
|
||||
protected abstract function getAmountByMonth($year, $format = 0);
|
||||
|
||||
/**
|
||||
* Return amount of elements by month for several years.
|
||||
* Criterias used to build request are defined into the constructor of parent class into xxx/class/xxxstats.class.php
|
||||
@ -460,7 +474,6 @@ abstract class Stats
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Return the amount per month for a given year
|
||||
|
||||
@ -300,13 +300,13 @@ class Validate
|
||||
/**
|
||||
* Check for all values in db
|
||||
*
|
||||
* @param array $values Boolean to validate
|
||||
* @param integer $id of element
|
||||
* @param string $classname the class name
|
||||
* @param string $classpath the class path
|
||||
* @return boolean Validity is ok or not
|
||||
* @throws Exception
|
||||
*/
|
||||
public function isFetchable($values, $classname, $classpath)
|
||||
public function isFetchable($id, $classname, $classpath)
|
||||
{
|
||||
if (!empty($classpath)) {
|
||||
if (dol_include_once($classpath)) {
|
||||
@ -319,7 +319,7 @@ class Validate
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!empty($object->table_element) && $object->isExistingObject($object->table_element, $values)) {
|
||||
if (!empty($object->table_element) && $object->isExistingObject($object->table_element, $id)) {
|
||||
return true;
|
||||
} else { $this->error = $this->outputLang->trans('RequireValidExistingElement'); }
|
||||
} else { $this->error = $this->outputLang->trans('BadSetupOfFieldClassNotFoundForValidation'); }
|
||||
|
||||
@ -132,6 +132,9 @@ function getEntity($element, $shared = 1, $currentobject = null)
|
||||
case 'order_supplier':
|
||||
$element = 'supplier_order';
|
||||
break; // "/fourn/class/fournisseur.commande.class.php"
|
||||
case 'invoice_supplier':
|
||||
$element = 'supplier_invoice';
|
||||
break; // "/fourn/class/fournisseur.facture.class.php"
|
||||
}
|
||||
|
||||
if (is_object($mc)) {
|
||||
@ -742,7 +745,7 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null
|
||||
// - posted value not empty, or
|
||||
// - if posted value is empty and a default value exists that is not empty (it means we did a filter to an empty value when default was not).
|
||||
|
||||
if ($out != '') { // $out = '0' or 'abc', it is a search criteria to keep
|
||||
if ($out != '' && isset($user)) {// $out = '0' or 'abc', it is a search criteria to keep
|
||||
$user->lastsearch_values_tmp[$relativepathstring][$paramname] = $out;
|
||||
}
|
||||
}
|
||||
@ -2246,6 +2249,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
|
||||
}
|
||||
}
|
||||
|
||||
// Show address and email
|
||||
if (method_exists($object, 'getBannerAddress') && !in_array($object->element, array('product', 'bookmark', 'ecm_directories', 'ecm_files'))) {
|
||||
$moreaddress = $object->getBannerAddress('refaddress', $object);
|
||||
if ($moreaddress) {
|
||||
@ -2950,6 +2954,7 @@ function dol_print_email($email, $cid = 0, $socid = 0, $addlink = 0, $max = 64,
|
||||
//$rep .= '</div>';
|
||||
if ($hookmanager) {
|
||||
$parameters = array('cid' => $cid, 'socid' => $socid, 'addlink' => $addlink, 'picto' => $withpicto);
|
||||
|
||||
$reshook = $hookmanager->executeHooks('printEmail', $parameters, $email);
|
||||
if ($reshook > 0) {
|
||||
$rep = '';
|
||||
@ -3912,7 +3917,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
'recent', 'reception', 'recruitmentcandidature', 'recruitmentjobposition', 'resource', 'recurring',
|
||||
'shapes', 'square', 'stop-circle', 'supplier', 'supplier_proposal', 'supplier_order', 'supplier_invoice',
|
||||
'timespent', 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda',
|
||||
'uncheck', 'user-cog', 'user-injured', 'user-md', 'vat', 'website', 'workstation', 'world', 'private',
|
||||
'uncheck', 'user-cog', 'user-injured', 'user-md', 'vat', 'website', 'workstation', 'webhook', 'world', 'private',
|
||||
'conferenceorbooth', 'eventorganization'
|
||||
))) {
|
||||
$fakey = $pictowithouttext;
|
||||
@ -3963,7 +3968,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
'title_agenda'=>'calendar-alt',
|
||||
'uncheck'=>'times', 'uparrow'=>'share', 'vat'=>'money-check-alt', 'vcard'=>'address-card',
|
||||
'jabber'=>'comment-o',
|
||||
'website'=>'globe-americas', 'workstation'=>'pallet', 'world'=>'globe', 'private'=>'user-lock',
|
||||
'website'=>'globe-americas', 'workstation'=>'pallet', 'webhook'=>'bullseye', 'world'=>'globe', 'private'=>'user-lock',
|
||||
'conferenceorbooth'=>'chalkboard-teacher', 'eventorganization'=>'project-diagram'
|
||||
);
|
||||
if ($pictowithouttext == 'off') {
|
||||
@ -5464,7 +5469,7 @@ function vatrate($rate, $addpercent = false, $info_bits = 0, $usestarfornpr = 0)
|
||||
*
|
||||
* @param float $amount Amount to format
|
||||
* @param integer $form Type of format, HTML or not (not by default)
|
||||
* @param Translate|string $outlangs Object langs for output
|
||||
* @param Translate|string $outlangs Object langs for output. '' use default lang. 'none' use international separators.
|
||||
* @param int $trunc 1=Truncate if there is more decimals than MAIN_MAX_DECIMALS_SHOWN (default), 0=Does not truncate. Deprecated because amount are rounded (to unit or total amount accurancy) before beeing inserted into database or after a computation, so this parameter should be useless.
|
||||
* @param int $rounding Minimum number of decimal to show. If 0, no change, if -1, we use min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT)
|
||||
* @param int $forcerounding Force the number of decimal to forcerounding decimal (-1=do not force)
|
||||
@ -5487,25 +5492,31 @@ function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $
|
||||
}
|
||||
$nbdecimal = $rounding;
|
||||
|
||||
// Output separators by default (french)
|
||||
$dec = ',';
|
||||
$thousand = ' ';
|
||||
|
||||
// If $outlangs not forced, we use use language
|
||||
if (!is_object($outlangs)) {
|
||||
$outlangs = $langs;
|
||||
}
|
||||
|
||||
if ($outlangs->transnoentitiesnoconv("SeparatorDecimal") != "SeparatorDecimal") {
|
||||
$dec = $outlangs->transnoentitiesnoconv("SeparatorDecimal");
|
||||
}
|
||||
if ($outlangs->transnoentitiesnoconv("SeparatorThousand") != "SeparatorThousand") {
|
||||
$thousand = $outlangs->transnoentitiesnoconv("SeparatorThousand");
|
||||
}
|
||||
if ($thousand == 'None') {
|
||||
if ($outlangs === 'none') {
|
||||
// Use international separators
|
||||
$dec = '.';
|
||||
$thousand = '';
|
||||
} elseif ($thousand == 'Space') {
|
||||
} else {
|
||||
// Output separators by default (french)
|
||||
$dec = ',';
|
||||
$thousand = ' ';
|
||||
|
||||
// If $outlangs not forced, we use use language
|
||||
if (!is_object($outlangs)) {
|
||||
$outlangs = $langs;
|
||||
}
|
||||
|
||||
if ($outlangs->transnoentitiesnoconv("SeparatorDecimal") != "SeparatorDecimal") {
|
||||
$dec = $outlangs->transnoentitiesnoconv("SeparatorDecimal");
|
||||
}
|
||||
if ($outlangs->transnoentitiesnoconv("SeparatorThousand") != "SeparatorThousand") {
|
||||
$thousand = $outlangs->transnoentitiesnoconv("SeparatorThousand");
|
||||
}
|
||||
if ($thousand == 'None') {
|
||||
$thousand = '';
|
||||
} elseif ($thousand == 'Space') {
|
||||
$thousand = ' ';
|
||||
}
|
||||
}
|
||||
//print "outlangs=".$outlangs->defaultlang." amount=".$amount." html=".$form." trunc=".$trunc." nbdecimal=".$nbdecimal." dec='".$dec."' thousand='".$thousand."'<br>";
|
||||
|
||||
@ -5544,7 +5555,7 @@ function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $
|
||||
}
|
||||
// Add symbol of currency if requested
|
||||
$cursymbolbefore = $cursymbolafter = '';
|
||||
if ($currency_code) {
|
||||
if ($currency_code && is_object($outlangs)) {
|
||||
if ($currency_code == 'auto') {
|
||||
$currency_code = $conf->currency;
|
||||
}
|
||||
|
||||
@ -650,7 +650,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
|
||||
if ($showproject) {
|
||||
// Project ref
|
||||
print "<td>";
|
||||
print '<td class="nowraponall">';
|
||||
//if ($showlineingray) print '<i>';
|
||||
if ($lines[$i]->public || in_array($lines[$i]->fk_project, $projectsArrayId) || !empty($user->rights->projet->all->lire)) {
|
||||
print $projectstatic->getNomUrl(1);
|
||||
@ -701,21 +701,21 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
}
|
||||
|
||||
if (count($arrayfields) > 0 && !empty($arrayfields['t.description']['checked'])) {
|
||||
print "<td>";
|
||||
print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($lines[$i]->description).'">';
|
||||
print $lines[$i]->description;
|
||||
print "</td>\n";
|
||||
}
|
||||
|
||||
// Date start
|
||||
if (count($arrayfields) > 0 && !empty($arrayfields['t.dateo']['checked'])) {
|
||||
print '<td class="center">';
|
||||
print '<td class="center nowraponall">';
|
||||
print dol_print_date($lines[$i]->date_start, 'dayhour');
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Date end
|
||||
if (count($arrayfields) > 0 && !empty($arrayfields['t.datee']['checked'])) {
|
||||
print '<td class="center">';
|
||||
print '<td class="center nowraponall">';
|
||||
print dol_print_date($lines[$i]->date_end, 'dayhour');
|
||||
if ($taskstatic->hasDelay()) {
|
||||
print img_warning($langs->trans("Late"));
|
||||
@ -2549,8 +2549,8 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks
|
||||
$projectstatic->ref = $objp->ref;
|
||||
$projectstatic->status = $objp->status;
|
||||
$projectstatic->title = $objp->title;
|
||||
$projectstatic->datee = $db->jdate($objp->datee);
|
||||
$projectstatic->dateo = $db->jdate($objp->dateo);
|
||||
$projectstatic->date_end = $db->jdate($objp->datee);
|
||||
$projectstatic->date_start = $db->jdate($objp->dateo);
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
|
||||
@ -977,3 +977,70 @@ function accessforbidden($message = '', $printheader = 1, $printfooter = 1, $sho
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the max allowed for file upload.
|
||||
* Analyze among: upload_max_filesize, post_max_size, MAIN_UPLOAD_DOC
|
||||
*
|
||||
* @return array Array with all max size for file upload
|
||||
*/
|
||||
function getMaxFileSizeArray()
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$max = $conf->global->MAIN_UPLOAD_DOC; // In Kb
|
||||
$maxphp = @ini_get('upload_max_filesize'); // In unknown
|
||||
if (preg_match('/k$/i', $maxphp)) {
|
||||
$maxphp = preg_replace('/k$/i', '', $maxphp);
|
||||
$maxphp = $maxphp * 1;
|
||||
}
|
||||
if (preg_match('/m$/i', $maxphp)) {
|
||||
$maxphp = preg_replace('/m$/i', '', $maxphp);
|
||||
$maxphp = $maxphp * 1024;
|
||||
}
|
||||
if (preg_match('/g$/i', $maxphp)) {
|
||||
$maxphp = preg_replace('/g$/i', '', $maxphp);
|
||||
$maxphp = $maxphp * 1024 * 1024;
|
||||
}
|
||||
if (preg_match('/t$/i', $maxphp)) {
|
||||
$maxphp = preg_replace('/t$/i', '', $maxphp);
|
||||
$maxphp = $maxphp * 1024 * 1024 * 1024;
|
||||
}
|
||||
$maxphp2 = @ini_get('post_max_size'); // In unknown
|
||||
if (preg_match('/k$/i', $maxphp2)) {
|
||||
$maxphp2 = preg_replace('/k$/i', '', $maxphp2);
|
||||
$maxphp2 = $maxphp2 * 1;
|
||||
}
|
||||
if (preg_match('/m$/i', $maxphp2)) {
|
||||
$maxphp2 = preg_replace('/m$/i', '', $maxphp2);
|
||||
$maxphp2 = $maxphp2 * 1024;
|
||||
}
|
||||
if (preg_match('/g$/i', $maxphp2)) {
|
||||
$maxphp2 = preg_replace('/g$/i', '', $maxphp2);
|
||||
$maxphp2 = $maxphp2 * 1024 * 1024;
|
||||
}
|
||||
if (preg_match('/t$/i', $maxphp2)) {
|
||||
$maxphp2 = preg_replace('/t$/i', '', $maxphp2);
|
||||
$maxphp2 = $maxphp2 * 1024 * 1024 * 1024;
|
||||
}
|
||||
// Now $max and $maxphp and $maxphp2 are in Kb
|
||||
$maxmin = $max;
|
||||
$maxphptoshow = $maxphptoshowparam = '';
|
||||
if ($maxphp > 0) {
|
||||
$maxmin = min($maxmin, $maxphp);
|
||||
$maxphptoshow = $maxphp;
|
||||
$maxphptoshowparam = 'upload_max_filesize';
|
||||
}
|
||||
if ($maxphp2 > 0) {
|
||||
$maxmin = min($maxmin, $maxphp2);
|
||||
if ($maxphp2 < $maxphp) {
|
||||
$maxphptoshow = $maxphp2;
|
||||
$maxphptoshowparam = 'post_max_size';
|
||||
}
|
||||
}
|
||||
//var_dump($maxphp.'-'.$maxphp2);
|
||||
//var_dump($maxmin);
|
||||
|
||||
return array('max'=>$max, 'maxmin'=>$maxmin, 'maxphptoshow'=>$maxphptoshow, 'maxphptoshowparam'=>$maxphptoshowparam);
|
||||
}
|
||||
|
||||
@ -174,7 +174,13 @@ class doc_generic_bom_odt extends ModelePDFBom
|
||||
$texte .= '</div>';
|
||||
}
|
||||
// Add input to upload a new template file.
|
||||
$texte .= '<div>'.$langs->trans("UploadNewTemplate").' <input type="file" name="uploadfile">';
|
||||
$texte .= '<div>'.$langs->trans("UploadNewTemplate");
|
||||
$maxfilesizearray = getMaxFileSizeArray();
|
||||
$maxmin = $maxfilesizearray['maxmin'];
|
||||
if ($maxmin > 0) {
|
||||
$texte .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
|
||||
}
|
||||
$texte .= ' <input type="file" name="uploadfile">';
|
||||
$texte .= '<input type="hidden" value="BOM_ADDON_PDF_ODT_PATH" name="keyforuploaddir">';
|
||||
$texte .= '<input type="submit" class="button small reposition" value="'.dol_escape_htmltag($langs->trans("Upload")).'" name="upload">';
|
||||
$texte .= '</div>';
|
||||
|
||||
@ -181,7 +181,13 @@ class doc_generic_order_odt extends ModelePDFCommandes
|
||||
$texte .= '</div>';
|
||||
}
|
||||
// Add input to upload a new template file.
|
||||
$texte .= '<div>'.$langs->trans("UploadNewTemplate").' <input type="file" name="uploadfile">';
|
||||
$texte .= '<div>'.$langs->trans("UploadNewTemplate");
|
||||
$maxfilesizearray = getMaxFileSizeArray();
|
||||
$maxmin = $maxfilesizearray['maxmin'];
|
||||
if ($maxmin > 0) {
|
||||
$texte .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
|
||||
}
|
||||
$texte .= ' <input type="file" name="uploadfile">';
|
||||
$texte .= '<input type="hidden" value="COMMANDE_ADDON_PDF_ODT_PATH" name="keyforuploaddir">';
|
||||
$texte .= '<input type="submit" class="button small reposition" value="'.dol_escape_htmltag($langs->trans("Upload")).'" name="upload">';
|
||||
$texte .= '</div>';
|
||||
|
||||
@ -611,6 +611,9 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
|
||||
$this->_pagehead($pdf, $object, 0, $outputlangs);
|
||||
}
|
||||
if (!empty($tplidx)) {
|
||||
$pdf->useTemplate($tplidx);
|
||||
}
|
||||
}
|
||||
if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) {
|
||||
if ($pagenb == 1) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user