diff --git a/.travis.yml b/.travis.yml index 5d7eb7a1678..44d784ea091 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,7 +50,7 @@ jobs: env: DB=postgresql - stage: PHP 5.6-7.4 if: type = pull_request OR type = push - php: '7.4' + php: '7.4.22' env: DB=mysql - stage: PHP Dev if: type = push AND branch = develop @@ -106,7 +106,7 @@ install: php-parallel-lint/php-console-highlighter ^0 \ squizlabs/php_codesniffer ^3 fi - if [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = '7.4' ]; then + if [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = '7.4' ] || [ "$TRAVIS_PHP_VERSION" = '7.4.22' ]; then composer -n require phpunit/phpunit ^7 \ php-parallel-lint/php-parallel-lint ^1.2 \ php-parallel-lint/php-console-highlighter ^0 \ @@ -241,7 +241,7 @@ before_script: # enable php-fpm - sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf - | - if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = '7.2' ] || [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = '7.4' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then + if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = '7.2' ] || [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = '7.4' ] || [ "$TRAVIS_PHP_VERSION" = '7.4.22' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then # Copy the included pool sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf fi @@ -276,7 +276,7 @@ script: set -e #parallel-lint --exclude htdocs/includes --blame . # Exclusions are defined in the ruleset.xml file - if [ "$TRAVIS_PHP_VERSION" = "7.4" ]; then + if [ "$TRAVIS_PHP_VERSION" = "7.4.22" ]; then parallel-lint -e php --exclude dev/tools/test/namespacemig --exclude htdocs/includes/composer --exclude htdocs/includes/myclabs --exclude htdocs/includes/phpspec --exclude dev/initdata/dbf/includes \ --exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian \ --exclude htdocs/includes/squizlabs/php_codesniffer --exclude htdocs/includes/jakub-onderka --exclude htdocs/includes/php-parallel-lint --exclude htdocs/includes/symfony \ @@ -291,7 +291,7 @@ script: # Ensure we catch errors set -e # Exclusions are defined in the ruleset.xml file - if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_PHP_VERSION" = "7.4" ]; then + if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_PHP_VERSION" = "7.4.22" ]; then phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .; fi set +e diff --git a/ChangeLog b/ChangeLog index 4d2045839ef..3dd00815d51 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ English Dolibarr ChangeLog -------------------------------------------------------------- + ***** ChangeLog for 16.0.0 compared to 15.0.0 ***** For users: @@ -30,6 +31,34 @@ Following changes may create regressions for some external modules, but were nec +***** ChangeLog for 15.0.1 compared to 15.0.0 ***** +FIX: #19777 #20281 +FIX: bad position of extrafields for interventions +FIX: Blocking situation when a payment was deleted in bank. +FIX: creation of the shipment if order contains services +FIX: Drag and drop line of files on join files tab +FIX: Error management on mass action "Approve holiday" +FIX: error with php8 +FIX: in case of VAT refund, negative amount must be allowed +FIX: invoice pdf: lines originating from deposits were not detailed anymore +FIX: Invoice - When you create an invoice for a given thirdparty, fk_account is not retrieved from company card +FIX: list of visible type of event was not correctly filtered +FIX: Missing or bad permissions +FIX: Missing the field date start/end in export supplier invoice/order +FIX: On large proposal or invoice, fix n(n+1) sql into a n sql. +FIX: options should not exists on invoices +FIX: payment not completed when using Paypal. +FIX: permission to download files of expense report with readall. +FIX- Preview icon in documents list PDF in the admin page third-party +FIX: shipping list, e.shipping_method_id should be e.fk_shipping_method. +FIX: Show product photo on Supplier order Cornas model. +FIX: User name in ManufacturingOrder +FIX: viewimage.php blocks requests with multicompany from other enties +FIX: #yogosha9048 +FIX: #yogosha9054 +FIX: #yogosha9095 + + ***** ChangeLog for 15.0.0 compared to 14.0.0 ***** For users: diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 0d0d013a69f..3c30200c130 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -64,6 +64,10 @@ class AccountancyExport public static $EXPORT_TYPE_FEC = 1000; public static $EXPORT_TYPE_FEC2 = 1010; + /** + * @var DoliDB Database handler + */ + public $db; /** * @var string[] Error codes (or messages) diff --git a/htdocs/accountancy/class/accountancyimport.class.php b/htdocs/accountancy/class/accountancyimport.class.php index ea88534b6ed..8ca60e37796 100644 --- a/htdocs/accountancy/class/accountancyimport.class.php +++ b/htdocs/accountancy/class/accountancyimport.class.php @@ -39,6 +39,24 @@ */ class AccountancyImport { + /** + * @var DoliDB Database handler + */ + public $db; + + + /** + * Constructor + * + * @param DoliDb $db Database handler + */ + public function __construct(DoliDB $db) + { + global $conf; + + $this->db = $db; + } + /** * Compute amount * diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 931b5e6420c..96a7ae50dfd 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -497,7 +497,7 @@ if ($result) { print ''; print '
| '; - print $langs->trans("VCard").' | '; - print ''; - print img_picto($langs->trans("Download").' vcard', 'vcard.png', 'class="paddingrightonly"'); - print $langs->trans("Download"); - print img_picto($langs->trans("Download").' vcard', 'download', 'class="paddingleft"'); - print ''; - print ' | ||
| '.$langs->trans("DateOfBirth").' | '.dol_print_date($object->birth, 'day').' | ||||||||||||||||||
| '.$langs->trans("Public").' | '.yn($object->public).' | ||||||||||||||||||
| '.$langs->trans("Categories").' | '; print ''; @@ -582,6 +578,12 @@ if ($rowid > 0) { print ' | ||||||||||||||||||
| '.$langs->trans("DateOfBirth").' | '.dol_print_date($object->birth, 'day').' | ||||||||||||||||||
| '.$langs->trans("Public").' | '.yn($object->public).' | '; $units = array( - 'mm' => $langs->trans('SizeUnitmm'), - 'cm' => $langs->trans('SizeUnitcm'), - 'point' => $langs->trans('SizeUnitpoint'), - 'inch' => $langs->trans('SizeUnitinch') + 'mm' => $langs->trans('SizeUnitmm'), + 'cm' => $langs->trans('SizeUnitcm'), + 'point' => $langs->trans('SizeUnitpoint'), + 'inch' => $langs->trans('SizeUnitinch') ); print $form->selectarray('unit', $units, (!empty($obj->{$value}) ? $obj->{$value}:''), 0, 0, 0); print ' | '; diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index fc8e24b9322..e5cb43d9e1f 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -50,7 +50,7 @@ $substitutionarrayfortest = array( //'__EMAIL__' => 'RecipientEMail', // Done into actions_sendmails '__CHECK_READ__' => (!empty($object) && is_object($object) && is_object($object->thirdparty)) ? '|||||||||||||||||
| '.$langs->trans("MAIN_MAIL_EMAIL_DKIM_ENABLED").' | ';
if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('swiftmailer'))) {
if (function_exists('openssl_open')) {
- print yn($conf->global->MAIN_MAIL_EMAIL_DKIM_ENABLED);
+ print yn(getDolGlobalInt('MAIN_MAIL_EMAIL_DKIM_ENABLED'));
} else {
print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
}
@@ -887,7 +887,6 @@ if ($action == 'edit') {
}
setEventMessages($errormsg, null, 'errors');
- print $errormsg;
}
print ' '; } diff --git a/htdocs/admin/mails_emailing.php b/htdocs/admin/mails_emailing.php index 6b1aa3334b5..40af4c4ae2a 100644 --- a/htdocs/admin/mails_emailing.php +++ b/htdocs/admin/mails_emailing.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $langs->loadLangs(array('companies', 'products', 'admin', 'mails', 'other', 'errors')); $action = GETPOST('action', 'aZ09'); -$cancel = GETPOST('cancel', 'alpha'); +$cancel = GETPOST('cancel', 'aZ09'); if (!$user->admin) { accessforbidden(); @@ -40,17 +40,22 @@ if (!$user->admin) { $usersignature = $user->signature; // For action = test or send, we ensure that content is not html, even for signature, because this we want a test with NO html. if ($action == 'test' || $action == 'send') { - $usersignature = dol_string_nohtmltag($usersignature); + $usersignature = dol_string_nohtmltag($usersignature, 2); } $substitutionarrayfortest = array( -'__LOGIN__' => $user->login, -'__ID__' => 'TESTIdRecord', -'__EMAIL__' => 'TESTEMail', -'__LASTNAME__' => 'TESTLastname', -'__FIRSTNAME__' => 'TESTFirstname', -'__USER_SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? $usersignature : ''), -//'__PERSONALIZED__' => 'TESTPersonalized' // Hiden because not used yet + '__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT, + '__ID__' => 'RecipientIdRecord', + //'__EMAIL__' => 'RecipientEMail', // Done into actions_sendmails + '__CHECK_READ__' => (!empty($object) && is_object($object) && is_object($object->thirdparty)) ? ' | '; - print $langs->trans("SeeLocalSendMailSetup"); + print ''.$langs->trans("SeeLocalSendMailSetup").''; } else { $mainport = (!empty($conf->global->MAIN_MAIL_SMTP_PORT_EMAILING) ? $conf->global->MAIN_MAIL_SMTP_PORT_EMAILING : ''); $smtpport = ini_get('smtp_port') ?ini_get('smtp_port') : $langs->transnoentities("Undefined"); @@ -319,7 +329,7 @@ if ($action == 'edit') { if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) { print ''; print ''; - print ''.$langs->trans("SeeLocalSendMailSetup").''; + print ''.$langs->trans("SeeLocalSendMailSetup").''; } else { $text = (!empty($mainport) ? $mainport : $smtpport); $htmltext = $langs->trans("ContactSuperAdminForChange"); @@ -360,7 +370,6 @@ if ($action == 'edit') { } // TLS - print ' | '; // STARTTLS - print ''; // SMTP_ALLOW_SELF_SIGNED_EMAILING - print '\n"; } diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index e2b412e15db..f6932cc4bef 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -943,8 +943,8 @@ while ($i < min($num, $limit)) { // Description if (!empty($arrayfields['a.note']['checked'])) { print ''; - $text = dolGetFirstLineOfText(dol_string_nohtmltag($actionstatic->note_private, 0)); - print $form->textwithtooltip(dol_trunc($text, 40), $actionstatic->note_private); + $text = dolGetFirstLineOfText(dol_string_nohtmltag($actionstatic->note_private, 1)); + print $form->textwithtooltip(dol_trunc($text, 48), $actionstatic->note_private); print ' | '; } diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index eabcb1a55bf..9e5ef8be35c 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -10,6 +10,7 @@ * Copyright (C) 2015-2021 Frédéric France||||||||||||||||
| '; print $commande_static->getNomUrl(1); - print ' | '.dol_print_date($db->jdate($objp->dc), 'day')." | \n"; + // Preview + $filedir = $conf->commande->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref); + $file_list = null; + if (!empty($filedir)) { + $file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC); + } + if (is_array($file_list)) { + // Defined relative dir to DOL_DATA_ROOT + $relativedir = ''; + if ($filedir) { + $relativedir = preg_replace('/^'.preg_quote(DOL_DATA_ROOT, '/').'/', '', $filedir); + $relativedir = preg_replace('/^[\\/]/', '', $relativedir); + } + // Get list of files stored into database for same relative directory + if ($relativedir) { + completeFileArrayWithDatabaseInfo($file_list, $relativedir); + + //var_dump($sortfield.' - '.$sortorder); + if (!empty($sortfield) && !empty($sortorder)) { // If $sortfield is for example 'position_name', we will sort on the property 'position_name' (that is concat of position+name) + $file_list = dol_sort_array($file_list, $sortfield, $sortorder); + } + } + $relativepath = dol_sanitizeFileName($objp->ref).'/'.dol_sanitizeFileName($objp->ref).'.pdf'; + print $formfile->showPreview($file_list, $commande_static->element, $relativepath, 0, $param); + } + // $filename = dol_sanitizeFileName($objp->ref); + // $filedir = $conf->order->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref); + // $urlsource = '/commande/card.php?id='.$objp->cid; + // print $formfile->getDocumentsLink($commande_static->element, $filename, $filedir); + print ''; + + print ''.dol_print_date($db->jdate($objp->dc), 'day')." | \n"; print ''.price($objp->total_ht).' | '; print ''.$commande_static->LibStatut($objp->fk_statut, $objp->facture, 5).' | |||||||||||||||
| '; print $sendingstatic->getNomUrl(1); + // Preview + $filedir = $conf->expedition->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref); + $file_list = null; + if (!empty($filedir)) { + $file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC); + } + if (is_array($file_list)) { + // Defined relative dir to DOL_DATA_ROOT + $relativedir = ''; + if ($filedir) { + $relativedir = preg_replace('/^'.preg_quote(DOL_DATA_ROOT, '/').'/', '', $filedir); + $relativedir = preg_replace('/^[\\/]/', '', $relativedir); + } + // Get list of files stored into database for same relative directory + if ($relativedir) { + completeFileArrayWithDatabaseInfo($file_list, $relativedir); + + //var_dump($sortfield.' - '.$sortorder); + if (!empty($sortfield) && !empty($sortorder)) { // If $sortfield is for example 'position_name', we will sort on the property 'position_name' (that is concat of position+name) + $file_list = dol_sort_array($file_list, $sortfield, $sortorder); + } + } + $relativepath = dol_sanitizeFileName($objp->ref).'/'.dol_sanitizeFileName($objp->ref).'.pdf'; + print $formfile->showPreview($file_list, $sendingstatic->element, $relativepath, 0, $param); + } + // $filename = dol_sanitizeFileName($objp->ref); + // $filedir = $conf->expedition->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref); + // $urlsource = '/expedition/card.php?id='.$objp->cid; + // print $formfile->getDocumentsLink($sendingstatic->element, $filename, $filedir); print ' | '; if ($objp->date_creation > 0) { print ''.dol_print_date($db->jdate($objp->date_creation), 'day').' | '; @@ -1076,6 +1169,35 @@ if ($object->id > 0) { print '||||||||||||||||||
| '; print $contrat->getNomUrl(1, 12); + // Preview + $filedir = $conf->contrat->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref); + $file_list = null; + if (!empty($filedir)) { + $file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC); + } + if (is_array($file_list)) { + // Defined relative dir to DOL_DATA_ROOT + $relativedir = ''; + if ($filedir) { + $relativedir = preg_replace('/^'.preg_quote(DOL_DATA_ROOT, '/').'/', '', $filedir); + $relativedir = preg_replace('/^[\\/]/', '', $relativedir); + } + // Get list of files stored into database for same relative directory + if ($relativedir) { + completeFileArrayWithDatabaseInfo($file_list, $relativedir); + + //var_dump($sortfield.' - '.$sortorder); + if (!empty($sortfield) && !empty($sortorder)) { // If $sortfield is for example 'position_name', we will sort on the property 'position_name' (that is concat of position+name) + $file_list = dol_sort_array($file_list, $sortfield, $sortorder); + } + } + $relativepath = dol_sanitizeFileName($objp->ref).'/'.dol_sanitizeFileName($objp->ref).'.pdf'; + print $formfile->showPreview($file_list, $contrat->element, $relativepath, 0, $param); + } + // $filename = dol_sanitizeFileName($objp->ref); + // $filedir = $conf->contrat->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref); + // $urlsource = '/contrat/card.php?id='.$objp->cid; + // print $formfile->getDocumentsLink($contrat->element, $filename, $filedir); print $late; print " | \n"; print ''.dol_trunc($objp->refsup, 12)." | \n"; @@ -1137,6 +1259,35 @@ if ($object->id > 0) { print '||||||||||||||||||
| '; print $fichinter_static->getNomUrl(1); + // Preview + $filedir = $conf->fichinter->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref); + $file_list = null; + if (!empty($filedir)) { + $file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC); + } + if (is_array($file_list)) { + // Defined relative dir to DOL_DATA_ROOT + $relativedir = ''; + if ($filedir) { + $relativedir = preg_replace('/^'.preg_quote(DOL_DATA_ROOT, '/').'/', '', $filedir); + $relativedir = preg_replace('/^[\\/]/', '', $relativedir); + } + // Get list of files stored into database for same relative directory + if ($relativedir) { + completeFileArrayWithDatabaseInfo($file_list, $relativedir); + + //var_dump($sortfield.' - '.$sortorder); + if (!empty($sortfield) && !empty($sortorder)) { // If $sortfield is for example 'position_name', we will sort on the property 'position_name' (that is concat of position+name) + $file_list = dol_sort_array($file_list, $sortfield, $sortorder); + } + } + $relativepath = dol_sanitizeFileName($objp->ref).'/'.dol_sanitizeFileName($objp->ref).'.pdf'; + print $formfile->showPreview($file_list, $fichinter_static->element, $relativepath, 0, $param); + } + // $filename = dol_sanitizeFileName($objp->ref); + // $filedir = $conf->fichinter->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref); + // $urlsource = '/fichinter/card.php?id='.$objp->cid; + // print $formfile->getDocumentsLink($fichinter_static->element, $filename, $filedir); print ' | '."\n"; //print ''.dol_print_date($db->jdate($objp->startdate)).' | '."\n"; print ''.convertSecondToTime($objp->duration).' | '."\n"; @@ -1213,6 +1364,7 @@ if ($object->id > 0) { print ''; print $invoicetemplate->getNomUrl(1); print ' | '; + if ($objp->frequency && $objp->date_last_gen > 0) { print ''.dol_print_date($db->jdate($objp->date_last_gen), 'day').' | '; } else { @@ -1301,6 +1453,35 @@ if ($object->id > 0) { print '|||||||||||||||
| '; print $facturestatic->getNomUrl(1); + // Preview + $filedir = $conf->facture->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref); + $file_list = null; + if (!empty($filedir)) { + $file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC); + } + if (is_array($file_list)) { + // Defined relative dir to DOL_DATA_ROOT + $relativedir = ''; + if ($filedir) { + $relativedir = preg_replace('/^'.preg_quote(DOL_DATA_ROOT, '/').'/', '', $filedir); + $relativedir = preg_replace('/^[\\/]/', '', $relativedir); + } + // Get list of files stored into database for same relative directory + if ($relativedir) { + completeFileArrayWithDatabaseInfo($file_list, $relativedir); + + //var_dump($sortfield.' - '.$sortorder); + if (!empty($sortfield) && !empty($sortorder)) { // If $sortfield is for example 'position_name', we will sort on the property 'position_name' (that is concat of position+name) + $file_list = dol_sort_array($file_list, $sortfield, $sortorder); + } + } + $relativepath = dol_sanitizeFileName($objp->ref).'/'.dol_sanitizeFileName($objp->ref).'.pdf'; + print $formfile->showPreview($file_list, $facturestatic->element, $relativepath, 0, $param); + } + // $filename = dol_sanitizeFileName($objp->ref); + // $filedir = $conf->facture->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref); + // $urlsource = '/compta/facture/card.php?id='.$objp->cid; + //print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir); print ' | '; if ($objp->df > 0) { print ''.dol_print_date($db->jdate($objp->df), 'day').' | '; diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 0c43cc4ad2d..234f2fba627 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3723,7 +3723,7 @@ class Commande extends CommonOrder $label .= '||||||||||||||||||
| '.($object->type == Facture::TYPE_CREDIT_NOTE ? $langs->trans("PaymentsBack") : $langs->trans('Payments')).' | '; - print ''.$langs->trans('Date').' | '; - print ''.$langs->trans('Type').' | '; + print ''.$langs->trans('Date').' | '; + print ''.$langs->trans('Type').' | '; if (!empty($conf->banque->enabled)) { - print ''.$langs->trans('BankAccount').' | '; + print ''.$langs->trans('BankAccount').' | '; } print ''.$langs->trans('Amount').' | '; print ''; diff --git a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php index 03b410466f0..14bb45f0687 100644 --- a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php +++ b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php @@ -45,7 +45,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { $trclass .= ' liste_sub_total'; } print ' |
| '; + print ' | '; switch ($objectlink->type) { case Facture::TYPE_REPLACEMENT: echo $langs->trans("InvoiceReplacement"); diff --git a/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php b/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php index d2ef4657586..d7e68e274fa 100644 --- a/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php +++ b/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php @@ -46,7 +46,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { } ?> | |||||||
| trans("RepeatableInvoice"); ?> | +trans("RepeatableInvoice"); ?> | getNomUrl(1); ?> | date_when, 'day'); ?> | diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index caa04146264..6419e2b8970 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -139,7 +139,7 @@ class ChargeSociales extends CommonObject { $sql = "SELECT cs.rowid, cs.date_ech"; $sql .= ", cs.libelle as label, cs.fk_type, cs.amount, cs.fk_projet as fk_project, cs.paye, cs.periode, cs.import_key"; - $sql .= ", cs.fk_account, cs.fk_mode_reglement, cs.fk_user"; + $sql .= ", cs.fk_account, cs.fk_mode_reglement, cs.fk_user, note_public, note_private"; $sql .= ", c.libelle as type_label"; $sql .= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle'; $sql .= " FROM ".MAIN_DB_PREFIX."chargesociales as cs"; @@ -172,6 +172,8 @@ class ChargeSociales extends CommonObject $this->amount = $obj->amount; $this->fk_project = $obj->fk_project; $this->fk_user = $obj->fk_user; + $this->note_public = $obj->note_public; + $this->note_private = $obj->note_private; $this->paye = $obj->paye; $this->periode = $this->db->jdate($obj->periode); $this->import_key = $this->import_key; diff --git a/htdocs/compta/sociales/info.php b/htdocs/compta/sociales/info.php index 546a4c711d0..4c49a3008c6 100644 --- a/htdocs/compta/sociales/info.php +++ b/htdocs/compta/sociales/info.php @@ -81,7 +81,7 @@ $object->info($id); $head = tax_prepare_head($object); -print dol_get_fiche_head($head, 'info', $langs->trans("SocialContribution"), -1, 'bill'); +print dol_get_fiche_head($head, 'info', $langs->trans("SocialContribution"), -1, $object->picto); $morehtmlref = '
';
+print '
';
+ // Label of social contribution
+ $morehtmlref .= $form->editfieldkey("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1);
+ $morehtmlref .= $form->editfieldval("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1);
+ // Project
+ if (!empty($conf->projet->enabled)) {
+ $langs->load("projects");
+ $morehtmlref .= ' ';
+
+ // Object card
+ // ------------------------------------------------------------
+ $linkback = ''.$langs->trans("BackToList").'';
+
+ //$object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status
+
+ dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
+
+
+ print ''.$langs->trans('Project').' : '; + if (!empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref .= ' : '.$proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + } + } else { + $morehtmlref .= ''; + } + } + $morehtmlref .= ' ';
+ print '';
+
+
+ $cssclass = "titlefield";
+ include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
+
+ print ' ';
+
+ print dol_get_fiche_end();
+}
+
+// End of page
+llxFooter();
+$db->close();
diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php
index 87d6b98475b..7265a69d1af 100644
--- a/htdocs/contrat/card.php
+++ b/htdocs/contrat/card.php
@@ -2027,62 +2027,73 @@ if ($action == 'create') {
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) {
+ $params = array(
+ 'attr' => array(
+ 'title' => '',
+ 'class' => 'classfortooltip'
+ )
+ );
+
// Send
if (empty($user->socid)) {
if ($object->statut == 1) {
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->contrat->creer)) {
- print '';
+ print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&token='.newToken().'&mode=init#formmailbeforetitle', '', true, $params);
} else {
- print '';
+ print dolGetButtonAction($langs->trans('SendMail'), '', 'default', '#', '', false, $params);
}
}
}
if ($object->statut == 0 && $nbofservices) {
if ($user->rights->contrat->creer) {
- print '';
+ print dolGetButtonAction($langs->trans('Validate'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=valid&token='.newToken(), '', true, $params);
} else {
- print '';
+ $params['attr']['title'] = $langs->trans("NotEnoughPermissions");
+ print dolGetButtonAction($langs->trans('Validate'), '', 'default', '#', '', false, $params);
}
}
if ($object->statut == 1) {
if ($user->rights->contrat->creer) {
- print '';
+ print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen&token='.newToken(), '', true, $params);
} else {
- print '';
+ $params['attr']['title'] = $langs->trans("NotEnoughPermissions");
+ print dolGetButtonAction($langs->trans('Modify'), '', 'default', '#', '', false, $params);
}
}
if (!empty($conf->commande->enabled) && $object->statut > 0 && $object->nbofservicesclosed < $nbofservices) {
$langs->load("orders");
if ($user->rights->commande->creer) {
- print '';
+ print dolGetButtonAction($langs->trans('CreateOrder'), '', 'default', DOL_URL_ROOT.'/commande/card.php?action=create&token='.newToken().'&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->thirdparty->id, '', true, $params);
} else {
- print '';
+ $params['attr']['title'] = $langs->trans("NotEnoughPermissions");
+ print dolGetButtonAction($langs->trans('CreateOrder'), '', 'default', '#', '', false, $params);
}
}
if (!empty($conf->facture->enabled) && $object->statut > 0) {
$langs->load("bills");
if ($user->rights->facture->creer) {
- print '';
+ print dolGetButtonAction($langs->trans('CreateBill'), '', 'default', DOL_URL_ROOT.'/compta/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->thirdparty->id, '', true, $params);
} else {
- print '';
+ $params['attr']['title'] = $langs->trans("NotEnoughPermissions");
+ print dolGetButtonAction($langs->trans('CreateBill'), '', 'default', '#', '', false, $params);
}
}
if ($object->nbofservicesclosed > 0 || $object->nbofserviceswait > 0) {
if ($user->rights->contrat->activer) {
- print '';
+ print dolGetButtonAction($langs->trans('ActivateAllContracts'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=activate&token='.newToken(), '', true, $params);
} else {
- print '';
+ print dolGetButtonAction($langs->trans('ActivateAllContracts'), '', 'default', '#', '', false, $params);
}
}
if ($object->nbofservicesclosed < $nbofservices) {
if ($user->rights->contrat->desactiver) {
- print '';
+ print dolGetButtonAction($langs->trans('CloseAllContracts'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=close&token='.newToken(), '', true, $params);
} else {
- print '';
+ print dolGetButtonAction($langs->trans('CloseAllContracts'), '', 'default', '#', '', false, $params);
}
//if (! $numactive)
@@ -2104,16 +2115,17 @@ if ($action == 'create') {
// Clone
if ($user->rights->contrat->creer) {
- print '';
+ print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&token='.newToken(), '', true, $params);
}
// On peut supprimer entite si
// - Droit de creer + mode brouillon (erreur creation)
// - Droit de supprimer
if (($user->rights->contrat->creer && $object->statut == $object::STATUS_DRAFT) || $user->rights->contrat->supprimer) {
- print '';
+ print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), '', true, $params);
} else {
- print '';
+ $params['attr']['title'] = $langs->trans("NotAllowed");
+ print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), '', false, $params);
}
}
diff --git a/htdocs/core/ajax/row.php b/htdocs/core/ajax/row.php
index 9853faa8585..97a74e74916 100644
--- a/htdocs/core/ajax/row.php
+++ b/htdocs/core/ajax/row.php
@@ -81,8 +81,6 @@ if (GETPOST('roworder', 'alpha', 3) && GETPOST('table_element_line', 'aZ09', 3)
$perm = 1;
} elseif ($table_element_line == 'facturedet_rec' && $user->rights->facture->creer) {
$perm = 1;
- } elseif ($table_element_line == 'ecm_files' && $user->rights->ecm->creer) {
- $perm = 1;
} elseif ($table_element_line == 'emailcollector_emailcollectoraction' && $user->admin) {
$perm = 1;
} elseif ($table_element_line == 'bom_bomline' && $user->rights->bom->write) {
@@ -97,10 +95,18 @@ if (GETPOST('roworder', 'alpha', 3) && GETPOST('table_element_line', 'aZ09', 3)
$perm = 1;
} elseif ($table_element_line == 'facture_fourn_det_rec' && $user->rights->fournisseur->facture->creer) {
$perm = 1;
- } elseif ($table_element_line == 'ecm_files' && $fk_element == 'fk_product' && (!empty($user->rights->produit->creer) || !empty($user->rights->service->creer))) {
- $perm = 1;
- } elseif ($table_element_line == 'ecm_files' && $fk_element == 'fk_ticket' && !empty($user->rights->ticket->write)) {
- $perm = 1;
+ } elseif ($table_element_line == 'ecm_files') { // Used when of page "documents.php"
+ if (!empty($user->rights->ecm->creer)) {
+ $perm = 1;
+ } elseif ($fk_element == 'fk_product' && (!empty($user->rights->produit->creer) || !empty($user->rights->service->creer))) {
+ $perm = 1;
+ } elseif ($fk_element == 'fk_ticket' && !empty($user->rights->ticket->write)) {
+ $perm = 1;
+ } elseif ($fk_element == 'fk_holiday' && !empty($user->rights->holiday->write)) {
+ $perm = 1;
+ } elseif ($fk_element == 'fk_soc' && !empty($user->rights->societe->creer)) {
+ $perm = 1;
+ }
} elseif ($table_element_line == 'product_association' && $fk_element == 'fk_product' && (!empty($user->rights->produit->creer) || !empty($user->rights->service->creer))) {
$perm = 1;
} elseif ($table_element_line == 'projet_task' && $fk_element == 'fk_projet' && $user->rights->projet->creer) {
diff --git a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php
index 9a40c3f9aec..403c6c9fc6d 100644
--- a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php
+++ b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php
@@ -162,7 +162,7 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes
$this->info_box_contents[$line][] = array(
'td' => 'class="right"',
- 'text' => $delayIcon.' '.($delivery_date ? dol_print_date($delivery_date, 'day', 'tzuserrel') : '').'',
+ 'text' => $delayIcon.' '.($delivery_date ? dol_print_date($delivery_date, 'day', 'tzuserrel') : '').'',
'asis' => 1
);
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 5e67d293e3d..51bfc09d44d 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -7067,6 +7067,8 @@ abstract class CommonObject
$paramforthenewlink = '';
$paramforthenewlink .= (GETPOSTISSET('action') ? '&action='.GETPOST('action', 'aZ09') : '');
$paramforthenewlink .= (GETPOSTISSET('id') ? '&id='.GETPOST('id', 'int') : '');
+ $paramforthenewlink .= (GETPOSTISSET('origin') ? '&origin='.GETPOST('origin', 'aZ09') : '');
+ $paramforthenewlink .= (GETPOSTISSET('originid') ? '&originid='.GETPOST('originid', 'int') : '');
$paramforthenewlink .= '&fk_'.strtolower($class).'=--IDFORBACKTOPAGE--';
// TODO Add Javascript code to add input fields already filled into $paramforthenewlink so we won't loose them when going back to main page
$out .= '';
diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php
index f59441eb8d4..1494e9b991d 100644
--- a/htdocs/core/class/conf.class.php
+++ b/htdocs/core/class/conf.class.php
@@ -616,15 +616,15 @@ class Conf
if (!empty($this->productbatch->enabled)) {
$this->global->STOCK_CALCULATE_ON_BILL = 0;
$this->global->STOCK_CALCULATE_ON_VALIDATE_ORDER = 0;
- $this->global->STOCK_CALCULATE_ON_SHIPMENT = 1;
- $this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE = 0;
+ if (empty($this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) $this->global->STOCK_CALCULATE_ON_SHIPMENT = 1;
+ if (empty($this->global->STOCK_CALCULATE_ON_SHIPMENT)) $this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE = 1;
$this->global->STOCK_CALCULATE_ON_SUPPLIER_BILL = 0;
$this->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER = 0;
if (empty($this->reception->enabled)) {
$this->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER = 1;
} else {
- $this->global->STOCK_CALCULATE_ON_RECEPTION = 1;
- $this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE = 0;
+ if (empty($this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) $this->global->STOCK_CALCULATE_ON_RECEPTION = 1;
+ if (empty($this->global->STOCK_CALCULATE_ON_RECEPTION)) $this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE = 1;
}
}
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 638c7b06c4f..f8d87b5dd5b 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -16,7 +16,7 @@
* Copyright (C) 2012 Cedric Salvador |