From f613688b28c5b104d7816bc5ab5756d48a420b08 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Thu, 8 Apr 2021 13:37:09 +0200 Subject: [PATCH 0001/1460] add_option --- htdocs/admin/notification.php | 17 +++++++++++++++++ htdocs/core/class/notify.class.php | 24 +++++++++++++++++++++--- htdocs/langs/en_US/admin.lang | 1 + htdocs/langs/en_US/other.lang | 3 +++ htdocs/langs/fr_FR/admin.lang | 1 + htdocs/langs/fr_FR/other.lang | 3 +++ 6 files changed, 46 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php index e1cf115626f..6609021cc2a 100644 --- a/htdocs/admin/notification.php +++ b/htdocs/admin/notification.php @@ -97,6 +97,10 @@ if ($action == 'setvalue' && $user->admin) { $error++; } + $result = dolibarr_set_const($db, "NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE", GETPOST("notif_disable", "alphawithlgt"), 'chaine', 0, '', $conf->entity); + if ($result < 0) { + $error++; + } if (!$error) { $db->commit(); @@ -198,6 +202,19 @@ if (!empty($conf->global->NOTIFICATION_EMAIL_FROM) && !isValidEmail($conf->globa } print ''; print ''; +$arrayofnotifto = array( +'', +$langs->trans('notiftouser'), +$langs->trans('notiftofixedemail'), +$langs->trans('notiftouserandtofixedemail') +); +var_dump($arrayofnotifto,$conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE); +print ''; +print $langs->trans("NotificationDisableConfirmMessage").''; +print ''; +print $form->selectarray("notif_disable", $arrayofnotifto, $conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE, 0, 0, 0, '', 1, 0, 0, '', 'maxwidth400', 1); +print ''; +print ''; print ''; print '
'; diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 345ec5b38e3..92555da891a 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -80,8 +80,8 @@ class Notify 'SHIPPING_VALIDATE', 'EXPENSE_REPORT_VALIDATE', 'EXPENSE_REPORT_APPROVE', - 'HOLIDAY_VALIDATE', - 'HOLIDAY_APPROVE', + 'HOLIDAY_VALIDATE', + 'HOLIDAY_APPROVE', 'ACTION_CREATE' ); @@ -108,10 +108,28 @@ class Notify */ public function confirmMessage($action, $socid, $object) { - global $langs; + global $conf, $langs; $langs->load("mails"); $listofnotiftodo = $this->getNotificationsArray($action, $socid, $object, 0); + if (!empty($conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE)){ + if ($conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE == 1 || $conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE == 3){ + foreach($listofnotiftodo as $val){ + if ($val['type'] == 'touser'){ + unset($listofnotiftodo[$val['email']]); + $listofnotiftodo = array_merge($listofnotiftodo); + } + } + } + if ($conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE == 2 || $conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE == 3){ + foreach($listofnotiftodo as $val){ + if ($val['type'] == 'tofixedemail'){ + unset($listofnotiftodo[$val['email']]); + $listofnotiftodo = array_merge($listofnotiftodo); + } + } + } + } $texte = ''; $nb = -1; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 5d78f312917..73d2a5ca558 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1673,6 +1673,7 @@ MailingDelay=Seconds to wait after sending next message NotificationSetup=Email Notification module setup NotificationEMailFrom=Sender email (From) for emails sent by the Notifications module FixedEmailTarget=Recipient +NotificationDisableConfirmMessage=Notification disable in confirm message ##### Sendings ##### SendingsSetup=Shipping module setup SendingsReceiptModel=Sending receipt model diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index 5ae6c7727b3..91f173850ff 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -35,6 +35,9 @@ OnlyOneFieldForXAxisIsPossible=Only 1 field is currently possible as X-Axis. Onl AtLeastOneMeasureIsRequired=At least 1 field for measure is required AtLeastOneXAxisIsRequired=At least 1 field for X-Axis is required LatestBlogPosts=Latest Blog Posts +notiftouser=To users +notiftofixedemail=To fixed mail +notiftouserandtofixedemail=To user and fixed mail Notify_ORDER_VALIDATE=Sales order validated Notify_ORDER_SENTBYMAIL=Sales order sent by mail Notify_ORDER_SUPPLIER_SENTBYMAIL=Purchase order sent by email diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index ef48fc0a82d..02e0b27af5d 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -1662,6 +1662,7 @@ MailingDelay=Temps d'attente, en seconde, avant d'envoyer le prochain message NotificationSetup=Configuration du module Notification par email NotificationEMailFrom=Adresse émettrice (From) des emails envoyés lors des notifications FixedEmailTarget=Email fixe cible destinataires +NotificationDisableConfirmMessage=Notifications desactivé dans les messages de confirmation ##### Sendings ##### SendingsSetup=Configuration du module Expédition/Livraison SendingsReceiptModel=Modèles de bordereau d'expédition diff --git a/htdocs/langs/fr_FR/other.lang b/htdocs/langs/fr_FR/other.lang index a8078129464..4e228ed50bd 100644 --- a/htdocs/langs/fr_FR/other.lang +++ b/htdocs/langs/fr_FR/other.lang @@ -35,6 +35,9 @@ OnlyOneFieldForXAxisIsPossible=1 seul champ est actuellement possible en tant qu AtLeastOneMeasureIsRequired=Au moins 1 champ de mesure est requis AtLeastOneXAxisIsRequired=Au moins 1 champ pour l'axe X est requis LatestBlogPosts=Derniers articles du Blog +notiftouser=Aux utilisateurs +notiftofixedemail=Vers les courriers fixe +notiftouserandtofixedemail=Aux utilisateurs et les courriers fixe Notify_ORDER_VALIDATE=Validation commande client Notify_ORDER_SENTBYMAIL=Envoi commande client par email Notify_ORDER_SUPPLIER_SENTBYMAIL=Envoi commande fournisseur par email From c2cd54325f43f01be686fd06cc8e9ff332c2f2d9 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 8 Apr 2021 11:44:24 +0000 Subject: [PATCH 0002/1460] Fixing style errors. --- htdocs/admin/notification.php | 2 +- htdocs/core/class/notify.class.php | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php index 6609021cc2a..d467b6bb62d 100644 --- a/htdocs/admin/notification.php +++ b/htdocs/admin/notification.php @@ -208,7 +208,7 @@ $langs->trans('notiftouser'), $langs->trans('notiftofixedemail'), $langs->trans('notiftouserandtofixedemail') ); -var_dump($arrayofnotifto,$conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE); +var_dump($arrayofnotifto, $conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE); print ''; print $langs->trans("NotificationDisableConfirmMessage").''; print ''; diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 92555da891a..695a17a75d8 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -112,18 +112,18 @@ class Notify $langs->load("mails"); $listofnotiftodo = $this->getNotificationsArray($action, $socid, $object, 0); - if (!empty($conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE)){ - if ($conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE == 1 || $conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE == 3){ - foreach($listofnotiftodo as $val){ - if ($val['type'] == 'touser'){ + if (!empty($conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE)) { + if ($conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE == 1 || $conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE == 3) { + foreach ($listofnotiftodo as $val) { + if ($val['type'] == 'touser') { unset($listofnotiftodo[$val['email']]); $listofnotiftodo = array_merge($listofnotiftodo); } } } - if ($conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE == 2 || $conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE == 3){ - foreach($listofnotiftodo as $val){ - if ($val['type'] == 'tofixedemail'){ + if ($conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE == 2 || $conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE == 3) { + foreach ($listofnotiftodo as $val) { + if ($val['type'] == 'tofixedemail') { unset($listofnotiftodo[$val['email']]); $listofnotiftodo = array_merge($listofnotiftodo); } From 822d9b227bdd2eb7e8b304f8fa501fe1d03adfb7 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Thu, 8 Apr 2021 13:50:55 +0200 Subject: [PATCH 0003/1460] Update notification.php --- htdocs/admin/notification.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php index 6609021cc2a..85e097dceb3 100644 --- a/htdocs/admin/notification.php +++ b/htdocs/admin/notification.php @@ -202,13 +202,14 @@ if (!empty($conf->global->NOTIFICATION_EMAIL_FROM) && !isValidEmail($conf->globa } print ''; print ''; + $arrayofnotifto = array( '', $langs->trans('notiftouser'), $langs->trans('notiftofixedemail'), $langs->trans('notiftouserandtofixedemail') ); -var_dump($arrayofnotifto,$conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE); + print ''; print $langs->trans("NotificationDisableConfirmMessage").''; print ''; From d3053c0c1b8ffaac71253bc12d6f3f0f249280f0 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Wed, 28 Apr 2021 23:35:47 +0200 Subject: [PATCH 0004/1460] delete_fr_lang --- htdocs/langs/fr_FR/admin.lang | 1 - htdocs/langs/fr_FR/other.lang | 3 --- 2 files changed, 4 deletions(-) diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 02e0b27af5d..ef48fc0a82d 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -1662,7 +1662,6 @@ MailingDelay=Temps d'attente, en seconde, avant d'envoyer le prochain message NotificationSetup=Configuration du module Notification par email NotificationEMailFrom=Adresse émettrice (From) des emails envoyés lors des notifications FixedEmailTarget=Email fixe cible destinataires -NotificationDisableConfirmMessage=Notifications desactivé dans les messages de confirmation ##### Sendings ##### SendingsSetup=Configuration du module Expédition/Livraison SendingsReceiptModel=Modèles de bordereau d'expédition diff --git a/htdocs/langs/fr_FR/other.lang b/htdocs/langs/fr_FR/other.lang index 4e228ed50bd..a8078129464 100644 --- a/htdocs/langs/fr_FR/other.lang +++ b/htdocs/langs/fr_FR/other.lang @@ -35,9 +35,6 @@ OnlyOneFieldForXAxisIsPossible=1 seul champ est actuellement possible en tant qu AtLeastOneMeasureIsRequired=Au moins 1 champ de mesure est requis AtLeastOneXAxisIsRequired=Au moins 1 champ pour l'axe X est requis LatestBlogPosts=Derniers articles du Blog -notiftouser=Aux utilisateurs -notiftofixedemail=Vers les courriers fixe -notiftouserandtofixedemail=Aux utilisateurs et les courriers fixe Notify_ORDER_VALIDATE=Validation commande client Notify_ORDER_SENTBYMAIL=Envoi commande client par email Notify_ORDER_SUPPLIER_SENTBYMAIL=Envoi commande fournisseur par email From c1e6109c4bfecda86c9ae06be638196729b2b616 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Thu, 29 Apr 2021 00:03:16 +0200 Subject: [PATCH 0005/1460] Update --- htdocs/admin/notification.php | 28 ++++++++++++++++++++++------ htdocs/core/class/notify.class.php | 24 +++++++++++------------- htdocs/langs/en_US/admin.lang | 3 ++- 3 files changed, 35 insertions(+), 20 deletions(-) diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php index 85e097dceb3..93263998cbe 100644 --- a/htdocs/admin/notification.php +++ b/htdocs/admin/notification.php @@ -204,16 +204,32 @@ print ''; print ''; $arrayofnotifto = array( -'', -$langs->trans('notiftouser'), -$langs->trans('notiftofixedemail'), -$langs->trans('notiftouserandtofixedemail') +-1 => '', +1 => $langs->trans('notiftouser'), +2 => $langs->trans('notiftofixedemail'), +3 => $langs->trans('notiftouserandtofixedemail') ); print ''; -print $langs->trans("NotificationDisableConfirmMessage").''; +print $langs->trans("NotificationDisableConfirmMessageUser").''; print ''; -print $form->selectarray("notif_disable", $arrayofnotifto, $conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE, 0, 0, 0, '', 1, 0, 0, '', 'maxwidth400', 1); +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_USER'); +} else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_USER", $arrval, $conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_USER); +} +print ''; +print ''; +print ''; +print $langs->trans("NotificationDisableConfirmMessageFix").''; +print ''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_FIX'); +} else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_FIX", $arrval, $conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_FIX); +} print ''; print ''; print ''; diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 695a17a75d8..11ca1c43d3e 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -112,21 +112,19 @@ class Notify $langs->load("mails"); $listofnotiftodo = $this->getNotificationsArray($action, $socid, $object, 0); - if (!empty($conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE)) { - if ($conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE == 1 || $conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE == 3) { - foreach ($listofnotiftodo as $val) { - if ($val['type'] == 'touser') { - unset($listofnotiftodo[$val['email']]); - $listofnotiftodo = array_merge($listofnotiftodo); - } + if (!empty($conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_USER)) { + foreach ($listofnotiftodo as $val) { + if ($val['type'] == 'touser') { + unset($listofnotiftodo[$val['email']]); + $listofnotiftodo = array_merge($listofnotiftodo); } } - if ($conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE == 2 || $conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE == 3) { - foreach ($listofnotiftodo as $val) { - if ($val['type'] == 'tofixedemail') { - unset($listofnotiftodo[$val['email']]); - $listofnotiftodo = array_merge($listofnotiftodo); - } + } + if (!empty($conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_FIX)) { + foreach ($listofnotiftodo as $val) { + if ($val['type'] == 'tofixedemail') { + unset($listofnotiftodo[$val['email']]); + $listofnotiftodo = array_merge($listofnotiftodo); } } } diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 73d2a5ca558..2154539939c 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1673,7 +1673,8 @@ MailingDelay=Seconds to wait after sending next message NotificationSetup=Email Notification module setup NotificationEMailFrom=Sender email (From) for emails sent by the Notifications module FixedEmailTarget=Recipient -NotificationDisableConfirmMessage=Notification disable in confirm message +NotificationDisableConfirmMessageFix=Disable notification info in confirm message for fix notification +NotificationDisableConfirmMessageUser=Disable notification info in confirm message for user notification ##### Sendings ##### SendingsSetup=Shipping module setup SendingsReceiptModel=Sending receipt model From b6ddea57f3e462dd2ffa312e5252b78f7571323d Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Thu, 29 Apr 2021 00:17:55 +0200 Subject: [PATCH 0006/1460] update --- htdocs/admin/notification.php | 7 ------- 1 file changed, 7 deletions(-) diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php index 6b17b9134f7..bf4928dc5a4 100644 --- a/htdocs/admin/notification.php +++ b/htdocs/admin/notification.php @@ -203,13 +203,6 @@ if (!empty($conf->global->NOTIFICATION_EMAIL_FROM) && !isValidEmail($conf->globa print ''; print ''; -$arrayofnotifto = array( --1 => '', -1 => $langs->trans('notiftouser'), -2 => $langs->trans('notiftofixedemail'), -3 => $langs->trans('notiftouserandtofixedemail') -); - print ''; print $langs->trans("NotificationDisableConfirmMessageUser").''; print ''; From 1d81322120391fc8337fee12e4ec4907c851c051 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Thu, 6 May 2021 22:54:32 +0200 Subject: [PATCH 0007/1460] Update pdf.php --- htdocs/admin/pdf.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 7d7b5e36a40..256038d356c 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2012-2107 Juanjo Menent * Copyright (C) 2019 Ferran Marcet + * Copyright (C) 2021 Anthony Berton * * 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 @@ -329,6 +330,11 @@ print ''.$langs->trans("MAIN_DOCUMENTS_LOGO_HEIGHT").'global->MAIN_DOCUMENTS_LOGO_HEIGHT) ? $conf->global->MAIN_DOCUMENTS_LOGO_HEIGHT : 20).'">'; print ''; +// Width of picture product lign +print ''.$langs->trans("MAIN_DOCUMENTS_WITH_PICTURE_WIDTH").''; +print ''; +print ''; + // Show project if (!empty($conf->projet->enabled)) { From 2e50fde9aa4f310519630a9edebad9ffc63fb3fa Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Fri, 7 May 2021 22:13:53 +0200 Subject: [PATCH 0008/1460] edit_in_propal --- htdocs/comm/propal/card.php | 24 +++++++++++------------ htdocs/comm/propal/class/propal.class.php | 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 229303849f0..f7d8f1731d6 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2064,12 +2064,12 @@ if ($action == 'create') { print ''; - if ($action != 'editdate' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) { + if ($action != 'editdate') { print ''; } print '
'; print $langs->trans('Date'); print 'id.'">'.img_edit($langs->trans('SetDate'), 1).'
'; print ''; - if ($object->statut == Propal::STATUS_DRAFT && $action == 'editdate' && $usercancreate) { + if ($action == 'editdate' && $usercancreate) { print '
'; print ''; print ''; @@ -2091,12 +2091,12 @@ if ($action == 'create') { print ''; - if ($action != 'editecheance' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) { + if ($action != 'editecheance' && $usercancreate) { print ''; } print '
'; print $langs->trans('DateEndPropal'); print 'id.'">'.img_edit($langs->trans('SetConditions'), 1).'
'; print ''; - if ($object->statut == Propal::STATUS_DRAFT && $action == 'editecheance' && $usercancreate) { + if ($action == 'editecheance' && $usercancreate) { print ''; print ''; print ''; @@ -2121,12 +2121,12 @@ if ($action == 'create') { print ''; - if ($action != 'editconditions' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) { + if ($action != 'editconditions' && $usercancreate) { print ''; } print '
'; print $langs->trans('PaymentConditionsShort'); print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetConditions'), 1).'
'; print ''; - if ($object->statut == Propal::STATUS_DRAFT && $action == 'editconditions' && $usercancreate) { + if ($action == 'editconditions' && $usercancreate) { $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id, 'cond_reglement_id'); } else { $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id, 'none'); @@ -2140,12 +2140,12 @@ if ($action == 'create') { print ''; - if ($action != 'editmode' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) { + if ($action != 'editmode' && $usercancreate) { print ''; } print '
'; print $langs->trans('PaymentMode'); print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetMode'), 1).'
'; print ''; - if ($object->statut == Propal::STATUS_DRAFT && $action == 'editmode' && $usercancreate) { + if ($action == 'editmode' && $usercancreate) { $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1); } else { $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'none'); @@ -2169,12 +2169,12 @@ if ($action == 'create') { print ' ('.$langs->trans('AfterOrder').')'; } print ''; - if ($action != 'editavailability' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) { + if ($action != 'editavailability' && $usercancreate) { print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetAvailability'), 1).''; } print ''; print ''; - if ($object->statut == Propal::STATUS_DRAFT && $action == 'editavailability' && $usercancreate) { + if ($action == 'editavailability' && $usercancreate) { $form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, $object->availability_id, 'availability_id', 1); } else { $form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, $object->availability_id, 'none', 1); @@ -2226,12 +2226,12 @@ if ($action == 'create') { print ''; - if ($action != 'editdemandreason' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) { + if ($action != 'editdemandreason' && $usercancreate) { print ''; } print '
'; print $langs->trans('Source'); print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetDemandReason'), 1).'
'; print ''; - if ($object->statut == Propal::STATUS_DRAFT && $action == 'editdemandreason' && $usercancreate) { + if ($action == 'editdemandreason' && $usercancreate) { $form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, $object->demand_reason_id, 'demand_reason_id', 1); } else { $form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, $object->demand_reason_id, 'none'); diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index c544f5f7fe9..500f7b14380 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1974,7 +1974,7 @@ class Propal extends CommonObject $this->db->begin(); $sql = "UPDATE ".MAIN_DB_PREFIX."propal SET datep = '".$this->db->idate($date)."'"; - $sql .= " WHERE rowid = ".$this->id." AND fk_statut = ".self::STATUS_DRAFT; + $sql .= " WHERE rowid = ".$this->id; dol_syslog(__METHOD__, LOG_DEBUG); $resql = $this->db->query($sql); @@ -2030,7 +2030,7 @@ class Propal extends CommonObject $this->db->begin(); $sql = "UPDATE ".MAIN_DB_PREFIX."propal SET fin_validite = ".($date_fin_validite != '' ? "'".$this->db->idate($date_fin_validite)."'" : 'null'); - $sql .= " WHERE rowid = ".$this->id." AND fk_statut = ".self::STATUS_DRAFT; + $sql .= " WHERE rowid = ".$this->id; dol_syslog(__METHOD__, LOG_DEBUG); $resql = $this->db->query($sql); From 2fdc6d9461bbc8b6943ac8e6ecad5e65ba86cda5 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 4 Jun 2021 11:35:12 +0200 Subject: [PATCH 0009/1460] NEW : rewrite bind accountancy code finding on customer invoice --- htdocs/accountancy/admin/account.php | 2 +- .../class/accountingaccount.class.php | 556 ++++++++++++------ htdocs/accountancy/customer/list.php | 189 ++---- 3 files changed, 420 insertions(+), 327 deletions(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 6f510ad3706..1f7f8892cad 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -195,7 +195,7 @@ if (empty($reshook)) { } elseif ($action == 'enable' && $permissiontoadd) { if ($accounting->fetch($id)) { $mode = GETPOST('mode', 'int'); - $result = $accounting->account_activate($id, $mode); + $result = $accounting->accountActivate($id, $mode); } $action = 'update'; if ($result < 0) { diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 28601380ac1..c4a11fb6565 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -26,6 +26,9 @@ * \brief File of class to manage accounting accounts */ +require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; +require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; /** * Class to manage accounting accounts */ @@ -140,6 +143,11 @@ class AccountingAccount extends CommonObject */ public $reconcilable; + /** + * @var array cache array + */ + private $accountingaccount_codetotid_cache = array(); + /** * Constructor * @@ -150,83 +158,14 @@ class AccountingAccount extends CommonObject global $conf; $this->db = $db; - $this->next_prev_filter = 'fk_pcg_version IN (SELECT pcg_version FROM '.MAIN_DB_PREFIX.'accounting_system WHERE rowid='.$conf->global->CHARTOFACCOUNTS.')'; // Used to add a filter in Form::showrefnav method - } - - /** - * Load record in memory - * - * @param int $rowid Id - * @param string $account_number Account number - * @param int|boolean $limittocurrentchart 1 or true=Load record only if it is into current active char of account - * @param string $limittoachartaccount 'ABC'=Load record only if it is into chart account with code 'ABC' (better and faster than previous parameter if you have chart of account code). - * @return int <0 if KO, 0 if not found, Id of record if OK and found - */ - public function fetch($rowid = null, $account_number = null, $limittocurrentchart = 0, $limittoachartaccount = '') - { - global $conf; - - if ($rowid || $account_number) { - $sql = "SELECT a.rowid as rowid, a.datec, a.tms, a.fk_pcg_version, a.pcg_type, a.account_number, a.account_parent, a.label, a.labelshort, a.fk_accounting_category, a.fk_user_author, a.fk_user_modif, a.active, a.reconcilable"; - $sql .= ", ca.label as category_label"; - $sql .= " FROM ".MAIN_DB_PREFIX."accounting_account as a"; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_accounting_category as ca ON a.fk_accounting_category = ca.rowid"; - $sql .= " WHERE"; - if ($rowid) { - $sql .= " a.rowid = ".(int) $rowid; - } elseif ($account_number) { - $sql .= " a.account_number = '".$this->db->escape($account_number)."'"; - $sql .= " AND a.entity = ".$conf->entity; - } - if (!empty($limittocurrentchart)) { - $sql .= ' AND a.fk_pcg_version IN (SELECT pcg_version FROM '.MAIN_DB_PREFIX.'accounting_system WHERE rowid='.$this->db->escape($conf->global->CHARTOFACCOUNTS).')'; - } - if (!empty($limittoachartaccount)) { - $sql .= " AND a.fk_pcg_version = '".$this->db->escape($limittoachartaccount)."'"; - } - - dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); - $result = $this->db->query($sql); - if ($result) { - $obj = $this->db->fetch_object($result); - - if ($obj) { - $this->id = $obj->rowid; - $this->rowid = $obj->rowid; - $this->ref = $obj->account_number; - $this->datec = $obj->datec; - $this->tms = $obj->tms; - $this->fk_pcg_version = $obj->fk_pcg_version; - $this->pcg_type = $obj->pcg_type; - $this->account_number = $obj->account_number; - $this->account_parent = $obj->account_parent; - $this->label = $obj->label; - $this->labelshort = $obj->labelshort; - $this->account_category = $obj->fk_accounting_category; - $this->account_category_label = $obj->category_label; - $this->fk_user_author = $obj->fk_user_author; - $this->fk_user_modif = $obj->fk_user_modif; - $this->active = $obj->active; - $this->status = $obj->active; - $this->reconcilable = $obj->reconcilable; - - return $this->id; - } else { - return 0; - } - } else { - $this->error = "Error ".$this->db->lasterror(); - $this->errors[] = "Error ".$this->db->lasterror(); - } - } - return -1; + $this->next_prev_filter = 'fk_pcg_version IN (SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $conf->global->CHARTOFACCOUNTS . ')'; // Used to add a filter in Form::showrefnav method } /** * Insert new accounting account in chart of accounts * - * @param User $user User making action - * @param int $notrigger Disable triggers + * @param User $user User making action + * @param int $notrigger Disable triggers * @return int <0 if KO, >0 if OK */ public function create($user, $notrigger = 0) @@ -259,7 +198,7 @@ class AccountingAccount extends CommonObject // Put here code to add control on parameters values // Insert request - $sql = "INSERT INTO ".MAIN_DB_PREFIX."accounting_account("; + $sql = "INSERT INTO " . MAIN_DB_PREFIX . "accounting_account("; $sql .= "datec"; $sql .= ", entity"; $sql .= ", fk_pcg_version"; @@ -273,31 +212,31 @@ class AccountingAccount extends CommonObject $sql .= ", active"; $sql .= ", reconcilable"; $sql .= ") VALUES ("; - $sql .= " '".$this->db->idate($now)."'"; - $sql .= ", ".$conf->entity; - $sql .= ", ".(empty($this->fk_pcg_version) ? 'NULL' : "'".$this->db->escape($this->fk_pcg_version)."'"); - $sql .= ", ".(empty($this->pcg_type) ? 'NULL' : "'".$this->db->escape($this->pcg_type)."'"); - $sql .= ", ".(empty($this->account_number) ? 'NULL' : "'".$this->db->escape($this->account_number)."'"); - $sql .= ", ".(empty($this->account_parent) ? 0 : (int) $this->account_parent); - $sql .= ", ".(empty($this->label) ? "''" : "'".$this->db->escape($this->label)."'"); - $sql .= ", ".(empty($this->labelshort) ? "''" : "'".$this->db->escape($this->labelshort)."'"); - $sql .= ", ".(empty($this->account_category) ? 0 : (int) $this->account_category); - $sql .= ", ".$user->id; - $sql .= ", ".(int) $this->active; - $sql .= ", ".(int) $this->reconcilable; + $sql .= " '" . $this->db->idate($now) . "'"; + $sql .= ", " . $conf->entity; + $sql .= ", " . (empty($this->fk_pcg_version) ? 'NULL' : "'" . $this->db->escape($this->fk_pcg_version) . "'"); + $sql .= ", " . (empty($this->pcg_type) ? 'NULL' : "'" . $this->db->escape($this->pcg_type) . "'"); + $sql .= ", " . (empty($this->account_number) ? 'NULL' : "'" . $this->db->escape($this->account_number) . "'"); + $sql .= ", " . (empty($this->account_parent) ? 0 : (int) $this->account_parent); + $sql .= ", " . (empty($this->label) ? "''" : "'" . $this->db->escape($this->label) . "'"); + $sql .= ", " . (empty($this->labelshort) ? "''" : "'" . $this->db->escape($this->labelshort) . "'"); + $sql .= ", " . (empty($this->account_category) ? 0 : (int) $this->account_category); + $sql .= ", " . $user->id; + $sql .= ", " . (int) $this->active; + $sql .= ", " . (int) $this->reconcilable; $sql .= ")"; $this->db->begin(); - dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this) . "::create sql=" . $sql, LOG_DEBUG); $resql = $this->db->query($sql); if (!$resql) { $error++; - $this->errors[] = "Error ".$this->db->lasterror(); + $this->errors[] = "Error " . $this->db->lasterror(); } if (!$error) { - $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."accounting_account"); + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "accounting_account"); // Uncomment this and change MYOBJECT to your own tag if you // want this action to call a trigger. @@ -313,8 +252,8 @@ class AccountingAccount extends CommonObject // Commit or rollback if ($error) { foreach ($this->errors as $errmsg) { - dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR); - $this->error .= ($this->error ? ', '.$errmsg : $errmsg); + dol_syslog(get_class($this) . "::create " . $errmsg, LOG_ERR); + $this->error .= ($this->error ? ', ' . $errmsg : $errmsg); } $this->db->rollback(); return -1 * $error; @@ -327,7 +266,7 @@ class AccountingAccount extends CommonObject /** * Update record * - * @param User $user Use making update + * @param User $user Use making update * @return int <0 if KO, >0 if OK */ public function update($user) @@ -339,20 +278,20 @@ class AccountingAccount extends CommonObject $this->db->begin(); - $sql = "UPDATE ".MAIN_DB_PREFIX."accounting_account "; - $sql .= " SET fk_pcg_version = ".($this->fk_pcg_version ? "'".$this->db->escape($this->fk_pcg_version)."'" : "null"); - $sql .= " , pcg_type = ".($this->pcg_type ? "'".$this->db->escape($this->pcg_type)."'" : "null"); - $sql .= " , account_number = '".$this->db->escape($this->account_number)."'"; - $sql .= " , account_parent = ".(int) $this->account_parent; - $sql .= " , label = ".($this->label ? "'".$this->db->escape($this->label)."'" : "''"); - $sql .= " , labelshort = ".($this->labelshort ? "'".$this->db->escape($this->labelshort)."'" : "''"); - $sql .= " , fk_accounting_category = ".(empty($this->account_category) ? 0 : (int) $this->account_category); - $sql .= " , fk_user_modif = ".((int) $user->id); - $sql .= " , active = ".(int) $this->active; - $sql .= " , reconcilable = ".(int) $this->reconcilable; - $sql .= " WHERE rowid = ".((int) $this->id); + $sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account "; + $sql .= " SET fk_pcg_version = " . ($this->fk_pcg_version ? "'" . $this->db->escape($this->fk_pcg_version) . "'" : "null"); + $sql .= " , pcg_type = " . ($this->pcg_type ? "'" . $this->db->escape($this->pcg_type) . "'" : "null"); + $sql .= " , account_number = '" . $this->db->escape($this->account_number) . "'"; + $sql .= " , account_parent = " . (int) $this->account_parent; + $sql .= " , label = " . ($this->label ? "'" . $this->db->escape($this->label) . "'" : "''"); + $sql .= " , labelshort = " . ($this->labelshort ? "'" . $this->db->escape($this->labelshort) . "'" : "''"); + $sql .= " , fk_accounting_category = " . (empty($this->account_category) ? 0 : (int) $this->account_category); + $sql .= " , fk_user_modif = " . ((int) $user->id); + $sql .= " , active = " . (int) $this->active; + $sql .= " , reconcilable = " . (int) $this->reconcilable; + $sql .= " WHERE rowid = " . ((int) $this->id); - dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this) . "::update sql=" . $sql, LOG_DEBUG); $result = $this->db->query($sql); if ($result) { $this->db->commit(); @@ -364,38 +303,6 @@ class AccountingAccount extends CommonObject } } - /** - * Check usage of accounting code - * - * @return int <0 if KO, >0 if OK - */ - public function checkUsage() - { - global $langs; - - $sql = "(SELECT fk_code_ventilation FROM ".MAIN_DB_PREFIX."facturedet"; - $sql .= " WHERE fk_code_ventilation=".$this->id.")"; - $sql .= "UNION"; - $sql .= " (SELECT fk_code_ventilation FROM ".MAIN_DB_PREFIX."facture_fourn_det"; - $sql .= " WHERE fk_code_ventilation=".$this->id.")"; - - dol_syslog(get_class($this)."::checkUsage sql=".$sql, LOG_DEBUG); - $resql = $this->db->query($sql); - - if ($resql) { - $num = $this->db->num_rows($resql); - if ($num > 0) { - $this->error = $langs->trans('ErrorAccountancyCodeIsAlreadyUse'); - return 0; - } else { - return 1; - } - } else { - $this->error = $this->db->lasterror(); - return -1; - } - } - /** * Delete object in database * @@ -413,22 +320,22 @@ class AccountingAccount extends CommonObject $this->db->begin(); if (!$error) { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."accounting_account"; - $sql .= " WHERE rowid=".((int) $this->id); + $sql = "DELETE FROM " . MAIN_DB_PREFIX . "accounting_account"; + $sql .= " WHERE rowid=" . ((int) $this->id); - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this) . "::delete sql=" . $sql); $resql = $this->db->query($sql); if (!$resql) { $error++; - $this->errors[] = "Error ".$this->db->lasterror(); + $this->errors[] = "Error " . $this->db->lasterror(); } } // Commit or rollback if ($error) { foreach ($this->errors as $errmsg) { - dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR); - $this->error .= ($this->error ? ', '.$errmsg : $errmsg); + dol_syslog(get_class($this) . "::delete " . $errmsg, LOG_ERR); + $this->error .= ($this->error ? ', ' . $errmsg : $errmsg); } $this->db->rollback(); return -1 * $error; @@ -441,23 +348,55 @@ class AccountingAccount extends CommonObject } } + /** + * Check usage of accounting code + * + * @return int <0 if KO, >0 if OK + */ + public function checkUsage() + { + global $langs; + + $sql = "(SELECT fk_code_ventilation FROM " . MAIN_DB_PREFIX . "facturedet"; + $sql .= " WHERE fk_code_ventilation=" . $this->id . ")"; + $sql .= "UNION"; + $sql .= " (SELECT fk_code_ventilation FROM " . MAIN_DB_PREFIX . "facture_fourn_det"; + $sql .= " WHERE fk_code_ventilation=" . $this->id . ")"; + + dol_syslog(get_class($this) . "::checkUsage sql=" . $sql, LOG_DEBUG); + $resql = $this->db->query($sql); + + if ($resql) { + $num = $this->db->num_rows($resql); + if ($num > 0) { + $this->error = $langs->trans('ErrorAccountancyCodeIsAlreadyUse'); + return 0; + } else { + return 1; + } + } else { + $this->error = $this->db->lasterror(); + return -1; + } + } + /** * Return clicable name (with picto eventually) * - * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto - * @param int $withlabel 0=No label, 1=Include label of account - * @param int $nourl 1=Disable url - * @param string $moretitle Add more text to title tooltip - * @param int $notooltip 1=Disable tooltip - * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking - * @param int $withcompletelabel 0=Short label (field short label), 1=Complete label (field label) - * @param string $option 'ledger', 'journals', 'accountcard' - * @return string String with URL + * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto + * @param int $withlabel 0=No label, 1=Include label of account + * @param int $nourl 1=Disable url + * @param string $moretitle Add more text to title tooltip + * @param int $notooltip 1=Disable tooltip + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @param int $withcompletelabel 0=Short label (field short label), 1=Complete label (field label) + * @param string $option 'ledger', 'journals', 'accountcard' + * @return string String with URL */ public function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle = '', $notooltip = 0, $save_lastsearch_value = -1, $withcompletelabel = 0, $option = '') { global $langs, $conf; - require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; + require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; if (!empty($conf->dol_no_mouse_hover)) { $notooltip = 1; // Force disable tooltips @@ -465,15 +404,16 @@ class AccountingAccount extends CommonObject $result = ''; - $url = ''; $labelurl = ''; + $url = ''; + $labelurl = ''; if (empty($option) || $option == 'ledger') { - $url = DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?search_accountancy_code_start='.urlencode($this->account_number).'&search_accountancy_code_end='.urlencode($this->account_number); + $url = DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?search_accountancy_code_start=' . urlencode($this->account_number) . '&search_accountancy_code_end=' . urlencode($this->account_number); $labelurl = $langs->trans("ShowAccountingAccountInLedger"); } elseif ($option == 'journals') { - $url = DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?search_accountancy_code_start='.urlencode($this->account_number).'&search_accountancy_code_end='.urlencode($this->account_number); + $url = DOL_URL_ROOT . '/accountancy/bookkeeping/list.php?search_accountancy_code_start=' . urlencode($this->account_number) . '&search_accountancy_code_end=' . urlencode($this->account_number); $labelurl = $langs->trans("ShowAccountingAccountInJournals"); } elseif ($option == 'accountcard') { - $url = DOL_URL_ROOT.'/accountancy/admin/card.php?id='.urlencode($this->id); + $url = DOL_URL_ROOT . '/accountancy/admin/card.php?id=' . urlencode($this->id); $labelurl = $langs->trans("ShowAccountingAccount"); } @@ -495,29 +435,29 @@ class AccountingAccount extends CommonObject $labeltoshow = $this->labelshort; } - $label = ''.$labelurl.''; + $label = '' . $labelurl . ''; if (!empty($this->account_number)) { - $label .= '
'.$langs->trans('AccountAccounting').': '.length_accountg($this->account_number); + $label .= '
' . $langs->trans('AccountAccounting') . ': ' . length_accountg($this->account_number); } if (!empty($labeltoshow)) { - $label .= '
'.$langs->trans('Label').': '.$labeltoshow; + $label .= '
' . $langs->trans('Label') . ': ' . $labeltoshow; } if ($moretitle) { - $label .= ' - '.$moretitle; + $label .= ' - ' . $moretitle; } $linkclose = ''; if (empty($notooltip)) { if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { $label = $labelurl; - $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; + $linkclose .= ' alt="' . dol_escape_htmltag($label, 1) . '"'; } - $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; + $linkclose .= ' title="' . dol_escape_htmltag($label, 1) . '"'; $linkclose .= ' class="classfortooltip"'; } - $linkstart = ''; + $linkstart = ''; $linkend = ''; if ($nourl) { @@ -528,17 +468,17 @@ class AccountingAccount extends CommonObject $label_link = length_accountg($this->account_number); if ($withlabel) { - $label_link .= ' - '.($nourl ? '' : '').$labeltoshow.($nourl ? '' : ''); + $label_link .= ' - ' . ($nourl ? '' : '') . $labeltoshow . ($nourl ? '' : ''); } if ($withpicto) { - $result .= ($linkstart.img_object(($notooltip ? '' : $label), $picto, ($notooltip ? '' : 'class="classfortooltip"'), 0, 0, $notooltip ? 0 : 1).$linkend); + $result .= ($linkstart . img_object(($notooltip ? '' : $label), $picto, ($notooltip ? '' : 'class="classfortooltip"'), 0, 0, $notooltip ? 0 : 1) . $linkend); } if ($withpicto && $withpicto != 2) { $result .= ' '; } if ($withpicto != 2) { - $result .= $linkstart.$label_link.$linkend; + $result .= $linkstart . $label_link . $linkend; } return $result; } @@ -552,10 +492,10 @@ class AccountingAccount extends CommonObject public function info($id) { $sql = 'SELECT a.rowid, a.datec, a.fk_user_author, a.fk_user_modif, a.tms'; - $sql .= ' FROM '.MAIN_DB_PREFIX.'accounting_account as a'; - $sql .= ' WHERE a.rowid = '.((int) $id); + $sql .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as a'; + $sql .= ' WHERE a.rowid = ' . ((int) $id); - dol_syslog(get_class($this).'::info sql='.$sql); + dol_syslog(get_class($this) . '::info sql=' . $sql); $result = $this->db->query($sql); if ($result) { @@ -584,8 +524,8 @@ class AccountingAccount extends CommonObject /** * Deactivate an account (for status active or status reconcilable) * - * @param int $id Id - * @param int $mode 0=field active, 1=field reconcilable + * @param int $id Id + * @param int $mode 0=field active, 1=field reconcilable * @return int <0 if KO, >0 if OK */ public function accountDeactivate($id, $mode = 0) @@ -600,11 +540,11 @@ class AccountingAccount extends CommonObject if ($result > 0) { $this->db->begin(); - $sql = "UPDATE ".MAIN_DB_PREFIX."accounting_account "; - $sql .= "SET ".$fieldtouse." = '0'"; - $sql .= " WHERE rowid = ".$this->db->escape($id); + $sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account "; + $sql .= "SET " . $fieldtouse . " = '0'"; + $sql .= " WHERE rowid = " . $this->db->escape($id); - dol_syslog(get_class($this)."::accountDeactivate ".$fieldtouse." sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this) . "::accountDeactivate " . $fieldtouse . " sql=" . $sql, LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -620,15 +560,15 @@ class AccountingAccount extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** * Account activated * - * @param int $id Id - * @param int $mode 0=field active, 1=field reconcilable + * @param int $id Id + * @param int $mode 0=field active, 1=field reconcilable * @return int <0 if KO, >0 if OK */ - public function account_activate($id, $mode = 0) + public function accountActivate($id, $mode = 0) { // phpcs:enable $this->db->begin(); @@ -638,11 +578,11 @@ class AccountingAccount extends CommonObject $fieldtouse = 'reconcilable'; } - $sql = "UPDATE ".MAIN_DB_PREFIX."accounting_account"; - $sql .= " SET ".$fieldtouse." = '1'"; - $sql .= " WHERE rowid = ".$this->db->escape($id); + $sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account"; + $sql .= " SET " . $fieldtouse . " = '1'"; + $sql .= " WHERE rowid = " . $this->db->escape($id); - dol_syslog(get_class($this)."::account_activate ".$fieldtouse." sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this) . "::accountActivate " . $fieldtouse . " sql=" . $sql, LOG_DEBUG); $result = $this->db->query($sql); if ($result) { $this->db->commit(); @@ -654,12 +594,11 @@ class AccountingAccount extends CommonObject } } - /** * Retourne le libelle du statut d'un user (actif, inactif) * - * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto - * @return string Label of status + * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto + * @return string Label of status */ public function getLibStatut($mode = 0) { @@ -670,9 +609,9 @@ class AccountingAccount extends CommonObject /** * Renvoi le libelle d'un statut donne * - * @param int $status Id status - * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto - * @return string Label of status + * @param int $status Id status + * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto + * @return string Label of status */ public function LibStatut($status, $mode = 0) { @@ -694,9 +633,9 @@ class AccountingAccount extends CommonObject } } elseif ($mode == 2) { if ($status == 1) { - return img_picto($langs->trans('Enabled'), 'statut4').' '.$langs->trans('Enabled'); + return img_picto($langs->trans('Enabled'), 'statut4') . ' ' . $langs->trans('Enabled'); } elseif ($status == 0) { - return img_picto($langs->trans('Disabled'), 'statut5').' '.$langs->trans('Disabled'); + return img_picto($langs->trans('Disabled'), 'statut5') . ' ' . $langs->trans('Disabled'); } } elseif ($mode == 3) { if ($status == 1) { @@ -706,16 +645,241 @@ class AccountingAccount extends CommonObject } } elseif ($mode == 4) { if ($status == 1) { - return img_picto($langs->trans('Enabled'), 'statut4').' '.$langs->trans('Enabled'); + return img_picto($langs->trans('Enabled'), 'statut4') . ' ' . $langs->trans('Enabled'); } elseif ($status == 0) { - return img_picto($langs->trans('Disabled'), 'statut5').' '.$langs->trans('Disabled'); + return img_picto($langs->trans('Disabled'), 'statut5') . ' ' . $langs->trans('Disabled'); } } elseif ($mode == 5) { if ($status == 1) { - return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'), 'statut4'); + return $langs->trans('Enabled') . ' ' . img_picto($langs->trans('Enabled'), 'statut4'); } elseif ($status == 0) { - return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'), 'statut5'); + return $langs->trans('Disabled') . ' ' . img_picto($langs->trans('Disabled'), 'statut5'); } } } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + + /** + * Return Suggest accounting accounts to bind + * + * @param Societe $thirdparty Societe Object seller or Buyers + * @param Product $product Product object sell or buy + * @param Facture $facture Facture + * @param FactureLigne $factureDet Facture Det + * @param array $accountingAccount array of Account account + * + * @return array Accounting accounts suggested + */ + public function getAccountingCodeToBind(Societe $thirdparty, Product $product, Facture $facture, FactureLigne $factureDet, $accountingAccount = array()) + { + global $mysoc, $conf; + global $hookmanager; + + // Instantiate hooks for external modules + $hookmanager->initHooks(array('accoutancyBindingCalculation')); + + // Execute hook accoutancyBindingCalculation + $parameters = array('thirdparty' => $thirdparty, 'product' => $product, 'facture' => $facture, 'factureDet' => $factureDet ,'accountingAccount'=>$accountingAccount); + $reshook = $hookmanager->executeHooks('accoutancyBindingCalculation', $parameters); // Note that $action and $object may have been modified by some hooks + + if (empty($reshook)) { + require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; + $isBuyerInEEC = isInEEC($thirdparty); + $isSellerInEEC = isInEEC($mysoc); + $code_sell_l = ''; + $code_sell_p = ''; + $code_sell_t = ''; + $suggestedid = ''; + + // Level 1: Search suggested default account for product/service + $suggestedaccountingaccountbydefaultfor = ''; + if ($factureDet->product_type == 1) { + if ($thirdparty->country_code == $mysoc->country_code || empty($thirdparty->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country) + $code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : ''); + $suggestedaccountingaccountbydefaultfor = ''; + } else { + if ($isSellerInEEC && $isBuyerInEEC && $factureDet->tva_tx != 0) { // European intravat sale, but with a VAT + $code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : ''); + $suggestedaccountingaccountbydefaultfor = 'eecwithvat'; + } elseif ($isSellerInEEC && $isBuyerInEEC && empty($thirdparty->tva_intra)) { // European intravat sale, without VAT intra community number + $code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : ''); + $suggestedaccountingaccountbydefaultfor = 'eecwithoutvatnumber'; + } elseif ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale + $code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT : ''); + $suggestedaccountingaccountbydefaultfor = 'eec'; + } else { // Foreign sale + $code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT : ''); + $suggestedaccountingaccountbydefaultfor = 'export'; + } + } + } elseif ($factureDet->product_type == 0) { + if ($thirdparty->country_code == $mysoc->country_code || empty($thirdparty->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country) + $code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : ''); + $suggestedaccountingaccountbydefaultfor = ''; + } else { + if ($isSellerInEEC && $isBuyerInEEC && $factureDet->tva_tx != 0) { // European intravat sale, but with a VAT + $code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : ''); + $suggestedaccountingaccountbydefaultfor = 'eecwithvat'; + } elseif ($isSellerInEEC && $isBuyerInEEC && empty($thirdparty->tva_intra)) { // European intravat sale, without VAT intra community number + $code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : ''); + $suggestedaccountingaccountbydefaultfor = 'eecwithoutvatnumber'; + } elseif ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale + $code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT : ''); + $suggestedaccountingaccountbydefaultfor = 'eec'; + } else { + $code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT : ''); + $suggestedaccountingaccountbydefaultfor = 'export'; + } + } + } + if ($code_sell_l == -1) { + $code_sell_l = ''; + } + + // Level 2: Search suggested account for product/service (similar code exists in page index.php to make automatic binding) + $suggestedaccountingaccountfor = ''; + if (($thirdparty->country_code == $mysoc->country_code) || empty($thirdparty->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country) + $code_sell_p = $product->accountancy_code_sell; + $suggestedid = $accountingAccount['dom']; + $suggestedaccountingaccountfor = ''; + } else { + if ($isSellerInEEC && $isBuyerInEEC && $factureDet->tva_tx != 0) { // European intravat sale, but with VAT + $code_sell_p = $product->accountancy_code_sell; + $suggestedid = $accountingAccount['dom']; + $suggestedaccountingaccountfor = 'eecwithvat'; + } elseif ($isSellerInEEC && $isBuyerInEEC && empty($thirdparty->tva_intra)) { // European intravat sale, without VAT intra community number + $code_sell_p = $product->accountancy_code_sell; + $suggestedid = $accountingAccount['dom']; // There is a doubt for this case. Is it an error on vat or we just forgot to fill vat number ? + $suggestedaccountingaccountfor = 'eecwithoutvatnumber'; + } elseif ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale + $code_sell_p = $product->accountancy_code_sell_intra; + $suggestedid = $accountingAccount['intra']; + $suggestedaccountingaccountfor = 'eec'; + } else { // Foreign sale + $code_sell_p = $product->accountancy_code_sell_export; + $suggestedid = $accountingAccount['export']; + $suggestedaccountingaccountfor = 'export'; + } + } + + // Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding) + if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) { + if (!empty($thirdparty->code_compta)) { + $code_sell_t = $thirdparty->code_compta; + $suggestedid = $accountingAccount['thirdparty']; + $suggestedaccountingaccountfor = ''; + } + } + + // Manage Deposit + if ($factureDet->desc == "(DEPOSIT)") { + $accountdeposittoventilated = new self($this->db); + $result = $accountdeposittoventilated->fetch('', $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT, 1); + if ($result < 0) { + return -1; + } + + $code_sell_l = $accountdeposittoventilated->ref; + $suggestedid = $accountdeposittoventilated->rowid; + } + + if (empty($suggestedid) && empty($code_sell_p) && !empty($code_sell_l) && empty($conf->global->ACCOUNTANCY_DO_NOT_AUTOFILL_ACCOUNT_WITH_GENERIC)) { + if (empty($this->accountingaccount_codetotid_cache[$code_sell_l])) { + $tmpaccount = new self($this->db); + $result = $tmpaccount->fetch(0, $code_sell_l, 1); + if ($result < 0) { + return -1; + } + if ($tmpaccount->id > 0) { + $suggestedid = $tmpaccount->id; + } + $this->accountingaccount_codetotid_cache[$code_sell_l] = $tmpaccount->id; + } else { + $suggestedid = $this->accountingaccount_codetotid_cache[$code_sell_l]; + } + } + } else { + if (is_array($hookmanager->resArray) && !empty($hookmanager->resArray)) { + return $hookmanager->resArray; + } + } + return array( + 'suggestedaccountingaccountbydefaultfor' => $suggestedaccountingaccountbydefaultfor, + 'suggestedaccountingaccountfor' => $suggestedaccountingaccountfor, + 'suggestedid' => $suggestedid, + 'code_sell_l' => $code_sell_l, + 'code_sell_p' => $code_sell_p, + 'code_sell_t' => $code_sell_t, + ); + } + + /** + * Load record in memory + * + * @param int $rowid Id + * @param string $account_number Account number + * @param int|boolean $limittocurrentchart 1 or true=Load record only if it is into current active char of account + * @param string $limittoachartaccount 'ABC'=Load record only if it is into chart account with code 'ABC' (better and faster than previous parameter if you have chart of account code). + * @return int <0 if KO, 0 if not found, Id of record if OK and found + */ + public function fetch($rowid = null, $account_number = null, $limittocurrentchart = 0, $limittoachartaccount = '') + { + global $conf; + + if ($rowid || $account_number) { + $sql = "SELECT a.rowid as rowid, a.datec, a.tms, a.fk_pcg_version, a.pcg_type, a.account_number, a.account_parent, a.label, a.labelshort, a.fk_accounting_category, a.fk_user_author, a.fk_user_modif, a.active, a.reconcilable"; + $sql .= ", ca.label as category_label"; + $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as a"; + $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_accounting_category as ca ON a.fk_accounting_category = ca.rowid"; + $sql .= " WHERE"; + if ($rowid) { + $sql .= " a.rowid = " . (int) $rowid; + } elseif ($account_number) { + $sql .= " a.account_number = '" . $this->db->escape($account_number) . "'"; + $sql .= " AND a.entity = " . $conf->entity; + } + if (!empty($limittocurrentchart)) { + $sql .= ' AND a.fk_pcg_version IN (SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $this->db->escape($conf->global->CHARTOFACCOUNTS) . ')'; + } + if (!empty($limittoachartaccount)) { + $sql .= " AND a.fk_pcg_version = '" . $this->db->escape($limittoachartaccount) . "'"; + } + + dol_syslog(get_class($this) . "::fetch sql=" . $sql, LOG_DEBUG); + $result = $this->db->query($sql); + if ($result) { + $obj = $this->db->fetch_object($result); + + if ($obj) { + $this->id = $obj->rowid; + $this->rowid = $obj->rowid; + $this->ref = $obj->account_number; + $this->datec = $obj->datec; + $this->tms = $obj->tms; + $this->fk_pcg_version = $obj->fk_pcg_version; + $this->pcg_type = $obj->pcg_type; + $this->account_number = $obj->account_number; + $this->account_parent = $obj->account_parent; + $this->label = $obj->label; + $this->labelshort = $obj->labelshort; + $this->account_category = $obj->fk_accounting_category; + $this->account_category_label = $obj->category_label; + $this->fk_user_author = $obj->fk_user_author; + $this->fk_user_modif = $obj->fk_user_modif; + $this->active = $obj->active; + $this->status = $obj->active; + $this->reconcilable = $obj->reconcilable; + + return $this->id; + } else { + return 0; + } + } else { + $this->error = "Error " . $this->db->lasterror(); + $this->errors[] = "Error " . $this->db->lasterror(); + } + } + return -1; + } } diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 4df8d6b9b15..e165cc3d8b1 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -45,6 +45,7 @@ $massaction = GETPOST('massaction', 'alpha'); $show_files = GETPOST('show_files', 'int'); $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); +$optioncss = GETPOST('optioncss', 'alpha'); // Select Box $mesCasesCochees = GETPOST('toselect', 'array'); @@ -96,6 +97,7 @@ if (!$sortorder) { $hookmanager->initHooks(array('accountancycustomerlist')); $formaccounting = new FormAccounting($db); +$accountingAccount = new AccountingAccount($db); $chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version'); @@ -510,17 +512,17 @@ if ($result) { $thirdpartystatic = new Societe($db); $facture_static = new Facture($db); + $facture_static_det = new FactureLigne($db); $product_static = new Product($db); - $isSellerInEEC = isInEEC($mysoc); $accountingaccount_codetotid_cache = array(); while ($i < min($num_lines, $limit)) { $objp = $db->fetch_object($result); - $objp->code_sell_l = ''; - $objp->code_sell_p = ''; + $code_sell_l = ''; + $code_sell_p = ''; $thirdpartystatic->id = $objp->socid; $thirdpartystatic->name = $objp->name; @@ -532,6 +534,8 @@ if ($result) { $thirdpartystatic->code_compta_fournisseur = $objp->code_compta_fournisseur; $thirdpartystatic->email = $objp->email; $thirdpartystatic->country_code = $objp->country_code; + $thirdpartystatic->tva_intra = $objp->tva_intra; + $thirdpartystatic->code_compta = $objp->company_code_sell; $product_static->ref = $objp->product_ref; $product_static->id = $objp->product_id; @@ -545,158 +549,96 @@ if ($result) { $product_static->accountancy_code_buy = $objp->code_buy; $product_static->accountancy_code_buy_intra = $objp->code_buy_intra; $product_static->accountancy_code_buy_export = $objp->code_buy_export; + $product_static->tva_tx = $objp->tva_tx_prod; + $product_static->tva_tx = $objp->tva_tx_prod; $facture_static->ref = $objp->ref; $facture_static->id = $objp->facid; $facture_static->type = $objp->ftype; + $facture_static->datef = $objp->datef; + + $facture_static_det->id = $objp->rowid; + $facture_static_det->total_ht = $objp->total_ht; + $facture_static_det->tva_tx = $objp->tva_tx_line; + $facture_static_det->vat_src_code = $objp->vat_src_code; + $facture_static_det->product_type = $objp->type_l; + $facture_static_det->desc = $objp->description; + + $accoutinAccountArray = array( + 'dom'=>$objp->aarowid, + 'intra'=>$objp->aarowid_intra, + 'export'=>$objp->aarowid_export, + 'thirdparty' =>$objp->aarowid_thirdparty); $code_sell_p_notset = ''; $code_sell_t_notset = ''; - $objp->aarowid_suggest = ''; // Will be set later - $isBuyerInEEC = isInEEC($objp); - - // Level 1: Search suggested default account for product/service - $suggestedaccountingaccountbydefaultfor = ''; - if ($objp->type_l == 1) { - if ($objp->country_code == $mysoc->country_code || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country) - $objp->code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : ''); - $suggestedaccountingaccountbydefaultfor = ''; - } else { - if ($isSellerInEEC && $isBuyerInEEC && $objp->tva_tx_line != 0) { // European intravat sale, but with a VAT - $objp->code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : ''); - $suggestedaccountingaccountbydefaultfor = 'eecwithvat'; - } elseif ($isSellerInEEC && $isBuyerInEEC && empty($objp->tva_intra)) { // European intravat sale, without VAT intra community number - $objp->code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : ''); - $suggestedaccountingaccountbydefaultfor = 'eecwithoutvatnumber'; - } elseif ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale - $objp->code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT : ''); - $suggestedaccountingaccountbydefaultfor = 'eec'; - } else { // Foreign sale - $objp->code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT : ''); - $suggestedaccountingaccountbydefaultfor = 'export'; - } - } - } elseif ($objp->type_l == 0) { - if ($objp->country_code == $mysoc->country_code || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country) - $objp->code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : ''); - $suggestedaccountingaccountbydefaultfor = ''; - } else { - if ($isSellerInEEC && $isBuyerInEEC && $objp->tva_tx_line != 0) { // European intravat sale, but with a VAT - $objp->code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : ''); - $suggestedaccountingaccountbydefaultfor = 'eecwithvat'; - } elseif ($isSellerInEEC && $isBuyerInEEC && empty($objp->tva_intra)) { // European intravat sale, without VAT intra community number - $objp->code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : ''); - $suggestedaccountingaccountbydefaultfor = 'eecwithoutvatnumber'; - } elseif ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale - $objp->code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT : ''); - $suggestedaccountingaccountbydefaultfor = 'eec'; - } else { - $objp->code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT : ''); - $suggestedaccountingaccountbydefaultfor = 'export'; - } - } - } - if ($objp->code_sell_l == -1) { - $objp->code_sell_l = ''; - } - - // Level 2: Search suggested account for product/service (similar code exists in page index.php to make automatic binding) - $suggestedaccountingaccountfor = ''; - if (($objp->country_code == $mysoc->country_code) || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country) - $objp->code_sell_p = $objp->code_sell; - $objp->aarowid_suggest = $objp->aarowid; - $suggestedaccountingaccountfor = ''; + $return=$accountingAccount->getAccountingCodeToBind($thirdpartystatic, $product_static, $facture_static, $facture_static_det, $accoutinAccountArray); + if (!is_array($return) && $return<0) { + setEventMessage($accountingAccount->error, 'errors'); } else { - if ($isSellerInEEC && $isBuyerInEEC && $objp->tva_tx_line != 0) { // European intravat sale, but with VAT - $objp->code_sell_p = $objp->code_sell; - $objp->aarowid_suggest = $objp->aarowid; - $suggestedaccountingaccountfor = 'eecwithvat'; - } elseif ($isSellerInEEC && $isBuyerInEEC && empty($objp->tva_intra)) { // European intravat sale, without VAT intra community number - $objp->code_sell_p = $objp->code_sell; - $objp->aarowid_suggest = $objp->aarowid; // There is a doubt for this case. Is it an error on vat or we just forgot to fill vat number ? - $suggestedaccountingaccountfor = 'eecwithoutvatnumber'; - } elseif ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale - $objp->code_sell_p = $objp->code_sell_intra; - $objp->aarowid_suggest = $objp->aarowid_intra; - $suggestedaccountingaccountfor = 'eec'; - } else { // Foreign sale - $objp->code_sell_p = $objp->code_sell_export; - $objp->aarowid_suggest = $objp->aarowid_export; - $suggestedaccountingaccountfor = 'export'; - } + $suggestedid=$return['suggestedid']; + $suggestedaccountingaccountfor=$return['suggestedaccountingaccountfor']; + $suggestedaccountingaccountbydefaultfor=$return['suggestedaccountingaccountbydefaultfor']; + $code_sell_l=$return['code_sell_l']; + $code_sell_p=$return['code_sell_p']; + $code_sell_t=$return['code_sell_t']; } - // Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding) - if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) { - if (!empty($objp->company_code_sell)) { - $objp->code_sell_t = $objp->company_code_sell; - $objp->aarowid_suggest = $objp->aarowid_thirdparty; - $suggestedaccountingaccountfor = ''; - } - } - - // Manage Deposit - if ($objp->description == "(DEPOSIT)") { - $accountdeposittoventilated = new AccountingAccount($db); - $accountdeposittoventilated->fetch('', $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT, 1); - $objp->code_sell_l = $accountdeposittoventilated->ref; - $objp->aarowid_suggest = $accountdeposittoventilated->rowid; - } - - if (!empty($objp->code_sell_p)) { + if (!empty($code_sell_p)) { // Value was defined previously } else { $code_sell_p_notset = 'color:orange'; } - if (empty($objp->code_sell_l) && empty($objp->code_sell_p)) { + if (empty($code_sell_l) && empty($code_sell_p)) { $code_sell_p_notset = 'color:red'; } if ($suggestedaccountingaccountfor == 'eecwithoutvatnumber' && empty($code_sell_p_notset)) { $code_sell_p_notset = 'color:orange'; } - // $objp->code_sell_l is now default code of product/service - // $objp->code_sell_p is now code of product/service - // $objp->code_sell_t is now code of thirdparty + // $code_sell_l is now default code of product/service + // $code_sell_p is now code of product/service + // $code_sell_t is now code of thirdparty print ''; // Line id - print ''.$objp->rowid.''; + print ''.$facture_static_det->id.''; // Ref Invoice print ''.$facture_static->getNomUrl(1).''; - print ''.dol_print_date($db->jdate($objp->datef), 'day').''; + print ''.dol_print_date($db->jdate($facture_static->datef), 'day').''; // Ref Product print ''; if ($product_static->id > 0) { print $product_static->getNomUrl(1); } - if ($objp->product_label) { - print '
'.$objp->product_label.''; + if ($product_static->label) { + print '
'.$product_static->label.''; } print ''; // Description print ''; - $text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->description)); + $text = dolGetFirstLineOfText(dol_string_nohtmltag($facture_static_det->desc)); $trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION; - print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description); + print $form->textwithtooltip(dol_trunc($text, $trunclength), $facture_static_det->desc); print ''; print ''; - print price($objp->total_ht); + print price($facture_static_det->total_ht); print ''; // Vat rate - if ($objp->vat_tx_l != $objp->vat_tx_p) { + $code_vat_differ=''; + if ($product_static->tva_tx !== $facture_static_det->tva_tx) { $code_vat_differ = 'font-weight:bold; text-decoration:blink; color:red'; } print ''; - print vatrate($objp->tva_tx_line.($objp->vat_src_code ? ' ('.$objp->vat_src_code.')' : '')); + print vatrate($facture_static_det->tva_tx.($facture_static_det->vat_src_code ? ' ('.$facture_static_det->vat_src_code.')' : '')); print ''; // Thirdparty @@ -704,27 +646,27 @@ if ($result) { // Country print ''; - $labelcountry = ($objp->country_code && ($langs->trans("Country".$objp->country_code) != "Country".$objp->country_code)) ? $langs->trans("Country".$objp->country_code) : $objp->country_label; + $labelcountry = ($thirdpartystatic->country_code && ($langs->trans("Country".$thirdpartystatic->country_code) != "Country".$thirdpartystatic->country_code)) ? $langs->trans("Country".$thirdpartystatic->country_code) : $objp->country_label; print $labelcountry; print ''; // VAT Num - print ''.$objp->tva_intra.''; + print ''.$thirdpartystatic->tva_intra.''; // Found accounts print ''; - $s = '1. '.(($objp->type_l == 1) ? $langs->trans("DefaultForService") : $langs->trans("DefaultForProduct")).': '; + $s = '1. '.(($facture_static_det->product_type == 1) ? $langs->trans("DefaultForService") : $langs->trans("DefaultForProduct")).': '; $shelp = ''; if ($suggestedaccountingaccountbydefaultfor == 'eec') { $shelp .= $langs->trans("SaleEEC"); } elseif ($suggestedaccountingaccountbydefaultfor == 'export') { $shelp .= $langs->trans("SaleExport"); } - $s .= ($objp->code_sell_l > 0 ? length_accountg($objp->code_sell_l) : ''.$langs->trans("NotDefined").''); + $s .= ($code_sell_l > 0 ? length_accountg($code_sell_l) : ''.$langs->trans("NotDefined").''); print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1); - if ($objp->product_id > 0) { + if ($product_static->id > 0) { print '
'; - $s = '2. '.(($objp->type_l == 1) ? $langs->trans("ThisService") : $langs->trans("ThisProduct")).': '; + $s = '2. '.(($facture_static_det->product_type == 1) ? $langs->trans("ThisService") : $langs->trans("ThisProduct")).': '; $shelp = ''; $ttype = 'help'; if ($suggestedaccountingaccountfor == 'eec') { $shelp = $langs->trans("SaleEEC"); @@ -736,12 +678,12 @@ if ($result) { } elseif ($suggestedaccountingaccountfor == 'export') { $shelp = $langs->trans("SaleExport"); } - $s .= (empty($objp->code_sell_p) ? ''.$langs->trans("NotDefined").'' : length_accountg($objp->code_sell_p)); + $s .= (empty($code_sell_p) ? ''.$langs->trans("NotDefined").'' : length_accountg($code_sell_p)); print $form->textwithpicto($s, $shelp, 1, $ttype, '', 0, 2, '', 1); } else { if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) { print '
'; - $s = '2. '.(($objp->type_l == 1) ? $langs->trans("ThisService") : $langs->trans("ThisProduct")).': '; + $s = '2. '.(($facture_static_det->product_type == 1) ? $langs->trans("ThisService") : $langs->trans("ThisProduct")).': '; $shelp = ''; $s .= $langs->trans("NotDefined"); print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1); @@ -749,29 +691,16 @@ if ($result) { } if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) { print '
'; - $s = '3. '.(($objp->type_l == 1) ? $langs->trans("ServiceForThisThirdparty") : $langs->trans("ProductForThisThirdparty")).': '; + $s = '3. '.(($facture_static_det->product_type == 1) ? $langs->trans("ServiceForThisThirdparty") : $langs->trans("ProductForThisThirdparty")).': '; $shelp = ''; - $s .= ($objp->code_sell_t > 0 ? length_accountg($objp->code_sell_t) : ''.$langs->trans("NotDefined").''); + $s .= ($code_sell_t > 0 ? length_accountg($code_sell_t) : ''.$langs->trans("NotDefined").''); print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1); } print ''; // Suggested accounting account print ''; - $suggestedid = $objp->aarowid_suggest; - if (empty($suggestedid) && empty($objp->code_sell_p) && !empty($objp->code_sell_l) && empty($conf->global->ACCOUNTANCY_DO_NOT_AUTOFILL_ACCOUNT_WITH_GENERIC)) { - if (empty($accountingaccount_codetotid_cache[$objp->code_sell_l])) { - $tmpaccount = new AccountingAccount($db); - $tmpaccount->fetch(0, $objp->code_sell_l, 1); - if ($tmpaccount->id > 0) { - $suggestedid = $tmpaccount->id; - } - $accountingaccount_codetotid_cache[$objp->code_sell_l] = $tmpaccount->id; - } else { - $suggestedid = $accountingaccount_codetotid_cache[$objp->code_sell_l]; - } - } - print $formaccounting->select_account($suggestedid, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone'); + print $formaccounting->select_account($suggestedid, 'codeventil'.$facture_static_det->id, 1, array(), 0, 0, 'codeventil maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone'); print ''; // Column with checkbox @@ -780,7 +709,7 @@ if ($result) { if ($suggestedaccountingaccountfor == 'eecwithoutvatnumber') { $ischecked = 0; } - print ''; + print ''; print ''; print ''; From 729ca70bf396d05b3cf75abe5a28b2fafcf92df7 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 4 Jun 2021 12:20:52 +0200 Subject: [PATCH 0010/1460] NEW : rewrite bind accountancy code finding on sales invoice --- .../class/accountingaccount.class.php | 15 +-- htdocs/accountancy/customer/index.php | 101 ++++++++++++------ htdocs/accountancy/customer/list.php | 6 +- htdocs/societe/card.php | 12 ++- 4 files changed, 90 insertions(+), 44 deletions(-) diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index c4a11fb6565..9f5c7799037 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -739,24 +739,24 @@ class AccountingAccount extends CommonObject // Level 2: Search suggested account for product/service (similar code exists in page index.php to make automatic binding) $suggestedaccountingaccountfor = ''; - if (($thirdparty->country_code == $mysoc->country_code) || empty($thirdparty->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country) + if ((($thirdparty->country_code == $mysoc->country_code) || empty($thirdparty->country_code)) && !empty($product->accountancy_code_sell)) { // If buyer in same country than seller (if not defined, we assume it is same country) $code_sell_p = $product->accountancy_code_sell; $suggestedid = $accountingAccount['dom']; - $suggestedaccountingaccountfor = ''; + $suggestedaccountingaccountfor = 'prodserv'; } else { - if ($isSellerInEEC && $isBuyerInEEC && $factureDet->tva_tx != 0) { // European intravat sale, but with VAT + if ($isSellerInEEC && $isBuyerInEEC && $factureDet->tva_tx != 0 && !empty($product->accountancy_code_sell)) { // European intravat sale, but with VAT $code_sell_p = $product->accountancy_code_sell; $suggestedid = $accountingAccount['dom']; $suggestedaccountingaccountfor = 'eecwithvat'; - } elseif ($isSellerInEEC && $isBuyerInEEC && empty($thirdparty->tva_intra)) { // European intravat sale, without VAT intra community number + } elseif ($isSellerInEEC && $isBuyerInEEC && empty($thirdparty->tva_intra) && !empty($product->accountancy_code_sell)) { // European intravat sale, without VAT intra community number $code_sell_p = $product->accountancy_code_sell; $suggestedid = $accountingAccount['dom']; // There is a doubt for this case. Is it an error on vat or we just forgot to fill vat number ? $suggestedaccountingaccountfor = 'eecwithoutvatnumber'; - } elseif ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale + } elseif ($isSellerInEEC && $isBuyerInEEC && !empty($product->accountancy_code_sell_intra)) { // European intravat sale $code_sell_p = $product->accountancy_code_sell_intra; $suggestedid = $accountingAccount['intra']; $suggestedaccountingaccountfor = 'eec'; - } else { // Foreign sale + } elseif (!empty($product->accountancy_code_sell_export)) { // Foreign sale $code_sell_p = $product->accountancy_code_sell_export; $suggestedid = $accountingAccount['export']; $suggestedaccountingaccountfor = 'export'; @@ -768,7 +768,7 @@ class AccountingAccount extends CommonObject if (!empty($thirdparty->code_compta)) { $code_sell_t = $thirdparty->code_compta; $suggestedid = $accountingAccount['thirdparty']; - $suggestedaccountingaccountfor = ''; + $suggestedaccountingaccountfor = 'thridparty'; } } @@ -782,6 +782,7 @@ class AccountingAccount extends CommonObject $code_sell_l = $accountdeposittoventilated->ref; $suggestedid = $accountdeposittoventilated->rowid; + $suggestedaccountingaccountfor = 'deposit'; } if (empty($suggestedid) && empty($code_sell_p) && !empty($code_sell_l) && empty($conf->global->ACCOUNTANCY_DO_NOT_AUTOFILL_ACCOUNT_WITH_GENERIC)) { diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index d33f5e12312..2bb2903eefa 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -31,6 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; // Load translation files required by the page $langs->loadLangs(array("compta", "bills", "other", "main", "accountancy")); @@ -46,6 +47,7 @@ if (!$user->rights->accounting->bind->write) { accessforbidden(); } +$accountingAccount = new AccountingAccount($db); $month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1); if (GETPOST("year", 'int')) { @@ -166,49 +168,82 @@ if ($action == 'validatehistory') { $isSellerInEEC = isInEEC($mysoc); + $thirdpartystatic = new Societe($db); + $facture_static = new Facture($db); + $facture_static_det = new FactureLigne($db); + $product_static = new Product($db); + $i = 0; while ($i < min($num_lines, 10000)) { // No more than 10000 at once $objp = $db->fetch_object($result); - $isBuyerInEEC = isInEEC($objp); // This make a database request but there is a cache into $conf->cache['country_code_in_EEC'] + $thirdpartystatic->id = $objp->socid; + $thirdpartystatic->name = $objp->name; + $thirdpartystatic->client = $objp->client; + $thirdpartystatic->fournisseur = $objp->fournisseur; + $thirdpartystatic->code_client = $objp->code_client; + $thirdpartystatic->code_compta_client = $objp->code_compta_client; + $thirdpartystatic->code_fournisseur = $objp->code_fournisseur; + $thirdpartystatic->code_compta_fournisseur = $objp->code_compta_fournisseur; + $thirdpartystatic->email = $objp->email; + $thirdpartystatic->country_code = $objp->country_code; + $thirdpartystatic->tva_intra = $objp->tva_intra; + $thirdpartystatic->code_compta = $objp->company_code_sell; - // Level 2: Search suggested account for product/service (similar code exists in page list.php to make manual binding) - $suggestedaccountingaccountfor = ''; - if (($objp->country_code == $mysoc->country_code) || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country) - $objp->code_sell_p = $objp->code_sell; - $objp->aarowid_suggest = $objp->aarowid; - $suggestedaccountingaccountfor = ''; + $product_static->ref = $objp->product_ref; + $product_static->id = $objp->product_id; + $product_static->type = $objp->type; + $product_static->label = $objp->product_label; + $product_static->status = $objp->status; + $product_static->status_buy = $objp->status_buy; + $product_static->accountancy_code_sell = $objp->code_sell; + $product_static->accountancy_code_sell_intra = $objp->code_sell_intra; + $product_static->accountancy_code_sell_export = $objp->code_sell_export; + $product_static->accountancy_code_buy = $objp->code_buy; + $product_static->accountancy_code_buy_intra = $objp->code_buy_intra; + $product_static->accountancy_code_buy_export = $objp->code_buy_export; + $product_static->tva_tx = $objp->tva_tx_prod; + $product_static->tva_tx = $objp->tva_tx_prod; + + $facture_static->ref = $objp->ref; + $facture_static->id = $objp->facid; + $facture_static->type = $objp->ftype; + $facture_static->datef = $objp->datef; + + $facture_static_det->id = $objp->rowid; + $facture_static_det->total_ht = $objp->total_ht; + $facture_static_det->tva_tx = $objp->tva_tx_line; + $facture_static_det->vat_src_code = $objp->vat_src_code; + $facture_static_det->product_type = $objp->type_l; + $facture_static_det->desc = $objp->description; + + $accoutinAccountArray = array( + 'dom'=>$objp->aarowid, + 'intra'=>$objp->aarowid_intra, + 'export'=>$objp->aarowid_export, + 'thirdparty' =>$objp->aarowid_thirdparty); + + $code_sell_p_notset = ''; + $code_sell_t_notset = ''; + + $return=$accountingAccount->getAccountingCodeToBind($thirdpartystatic, $product_static, $facture_static, $facture_static_det, $accoutinAccountArray); + if (!is_array($return) && $return<0) { + setEventMessage($accountingAccount->error, 'errors'); } else { - if ($isSellerInEEC && $isBuyerInEEC && $objp->tva_tx_line != 0) { // European intravat sale, but with VAT - $objp->code_sell_p = $objp->code_sell; - $objp->aarowid_suggest = $objp->aarowid; - $suggestedaccountingaccountfor = 'eecwithvat'; - } elseif ($isSellerInEEC && $isBuyerInEEC && empty($objp->tva_intra)) { // European intravat sale, without VAT intra community number - $objp->code_sell_p = $objp->code_sell; - $objp->aarowid_suggest = 0; // There is a doubt, no automatic binding - $suggestedaccountingaccountfor = 'eecwithoutvatnumber'; - } elseif ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale - $objp->code_sell_p = $objp->code_sell_intra; - $objp->aarowid_suggest = $objp->aarowid_intra; - $suggestedaccountingaccountfor = 'eec'; - } else { // Foreign sale - $objp->code_sell_p = $objp->code_sell_export; - $objp->aarowid_suggest = $objp->aarowid_export; - $suggestedaccountingaccountfor = 'export'; + $suggestedid=$return['suggestedid']; + $suggestedaccountingaccountfor=$return['suggestedaccountingaccountfor']; + + if (!empty($suggestedid) && $suggestedaccountingaccountfor<>'') { + $suggestedid=$return['suggestedid']; + } else { + $suggestedid=0; } } - // Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding) - if (!empty($objp->company_code_sell)) { - $objp->code_sell_t = $objp->company_code_sell; - $objp->aarowid_suggest = $objp->aarowid_thirdparty; - $suggestedaccountingaccountfor = ''; - } - - if ($objp->aarowid_suggest > 0) { + if ($suggestedid > 0) { $sqlupdate = "UPDATE ".MAIN_DB_PREFIX."facturedet"; - $sqlupdate .= " SET fk_code_ventilation = ".((int) $objp->aarowid_suggest); - $sqlupdate .= " WHERE fk_code_ventilation <= 0 AND product_type <= 2 AND rowid = ".((int) $objp->rowid); + $sqlupdate .= " SET fk_code_ventilation = ".((int) $suggestedid); + $sqlupdate .= " WHERE fk_code_ventilation <= 0 AND product_type <= 2 AND rowid = ".((int) $facture_static_det->id); $resqlupdate = $db->query($sqlupdate); if (!$resqlupdate) { diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index e165cc3d8b1..c58df26edc2 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -584,6 +584,7 @@ if ($result) { $code_sell_p=$return['code_sell_p']; $code_sell_t=$return['code_sell_t']; } + //var_dump($return); if (!empty($code_sell_p)) { // Value was defined previously @@ -705,8 +706,9 @@ if ($result) { // Column with checkbox print ''; - $ischecked = $objp->aarowid_suggest; - if ($suggestedaccountingaccountfor == 'eecwithoutvatnumber') { + if (!empty($suggestedid) && $suggestedaccountingaccountfor<>'') { + $ischecked=1; + } elseif ($suggestedaccountingaccountfor == 'eecwithoutvatnumber') { $ischecked = 0; } print ''; diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index aa8205bfa99..1c7871d4b1c 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -490,10 +490,18 @@ if (empty($reshook)) { $object->webservices_key = GETPOST('webservices_key', 'san_alpha'); if (GETPOSTISSET('accountancy_code_sell')) { - $object->accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); + if (GETPOST('accountancy_code_sell', 'int')==-1) { + $object->accountancy_code_sell = 0; + } else { + $object->accountancy_code_sell = GETPOST('accountancy_code_sell', 'int'); + } } if (GETPOSTISSET('accountancy_code_buy')) { - $object->accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); + if (GETPOST('accountancy_code_buy', 'int')==-1) { + $object->accountancy_code_buy = 0; + } else { + $object->accountancy_code_buy = GETPOST('accountancy_code_buy', 'int'); + } } // Incoterms From ac6e108be6e5643dfd993a7be283b64e2f97b872 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 4 Jun 2021 12:27:49 +0200 Subject: [PATCH 0011/1460] fix syntax --- .../class/accountingaccount.class.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 9f5c7799037..1827549020f 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -800,19 +800,19 @@ class AccountingAccount extends CommonObject $suggestedid = $this->accountingaccount_codetotid_cache[$code_sell_l]; } } + return array( + 'suggestedaccountingaccountbydefaultfor' => $suggestedaccountingaccountbydefaultfor, + 'suggestedaccountingaccountfor' => $suggestedaccountingaccountfor, + 'suggestedid' => $suggestedid, + 'code_sell_l' => $code_sell_l, + 'code_sell_p' => $code_sell_p, + 'code_sell_t' => $code_sell_t, + ); } else { if (is_array($hookmanager->resArray) && !empty($hookmanager->resArray)) { return $hookmanager->resArray; } } - return array( - 'suggestedaccountingaccountbydefaultfor' => $suggestedaccountingaccountbydefaultfor, - 'suggestedaccountingaccountfor' => $suggestedaccountingaccountfor, - 'suggestedid' => $suggestedid, - 'code_sell_l' => $code_sell_l, - 'code_sell_p' => $code_sell_p, - 'code_sell_t' => $code_sell_t, - ); } /** From d6c6170e9d9801eb5201f277ee6600685b3109b1 Mon Sep 17 00:00:00 2001 From: Quentin VIAL-GOUTEYRON Date: Mon, 7 Jun 2021 16:01:58 +0200 Subject: [PATCH 0012/1460] fix multiple order linked to invoice --- htdocs/core/lib/pdf.lib.php | 120 ++++++++++++++++++++++++------------ 1 file changed, 79 insertions(+), 41 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 1babc31b4c2..9800f09b1f8 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -2122,7 +2122,7 @@ function pdf_getTotalQty($object, $type, $outputlangs) * @param Translate $outputlangs Object lang for output * @return array Linked objects */ -function pdf_getLinkedObjects($object, $outputlangs) +function pdf_getLinkedObjects(&$object, $outputlangs) { global $db, $hookmanager; @@ -2151,13 +2151,22 @@ function pdf_getLinkedObjects($object, $outputlangs) elseif ($objecttype == 'commande' || $objecttype == 'supplier_order') { $outputlangs->load('orders'); - foreach ($objects as $elementobject) - { - $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefOrder"); + + if(count($objects) > 1) { + $object->note_public .= '
'.$outputlangs->transnoentities("RefOrder").' :
'; + foreach($objects as $elementobject) { + $object->note_public .= $outputlangs->transnoentities($elementobject->ref).($elementobject->ref_client ? ' ('.$elementobject->ref_client.')' : '').($elementobject->ref_supplier ? ' ('.$elementobject->ref_supplier.')' : '').' '; + $object->note_public .= $outputlangs->transnoentities("OrderDate").' : '; + $object->note_public .= dol_print_date($elementobject->date, 'day', '', $outputlangs); + $object->note_public .= '
'; + } + } else if(count($objects) == 1) { + $elementobject = array_shift($objects); + $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefOrder"); $linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($elementobject->ref).($elementobject->ref_client ? ' ('.$elementobject->ref_client.')' : '').($elementobject->ref_supplier ? ' ('.$elementobject->ref_supplier.')' : ''); $linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("OrderDate"); $linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->date, 'day', '', $outputlangs); - } + } } elseif ($objecttype == 'contrat') { @@ -2183,43 +2192,72 @@ function pdf_getLinkedObjects($object, $outputlangs) } elseif ($objecttype == 'shipping') { - $outputlangs->loadLangs(array("orders", "sendings")); + $outputlangs->loadLangs(array("orders", "sendings")); - foreach ($objects as $x => $elementobject) - { - $order = null; - // We concat this record info into fields xxx_value. title is overwrote. - if (empty($object->linkedObjects['commande']) && $object->element != 'commande') // There is not already a link to order and object is not the order, so we show also info with order - { - $elementobject->fetchObjectLinked(null, '', null, '', 'OR', 1, 'sourcetype', 0); - if (! empty($elementobject->linkedObjectsIds['commande'])){ - include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; - $order = new Commande($db); - $ret = $order->fetch(reset($elementobject->linkedObjectsIds['commande'])); - if ($ret < 1) { $order=null; } - } - } - if (!is_object($order)) - { - $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefSending"); - if (!empty($linkedobjects[$objecttype]['ref_value'])) $linkedobjects[$objecttype]['ref_value'] .= ' / '; - $linkedobjects[$objecttype]['ref_value'] .= $outputlangs->transnoentities($elementobject->ref); - //$linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("DateShipment"); - //if (! empty($linkedobjects[$objecttype]['date_value'])) $linkedobjects[$objecttype]['date_value'].=' / '; - //$linkedobjects[$objecttype]['date_value'].= dol_print_date($elementobject->date_delivery,'day','',$outputlangs); - } - else - { - $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefOrder").' / '.$outputlangs->transnoentities("RefSending"); - if (empty($linkedobjects[$objecttype]['ref_value'])) $linkedobjects[$objecttype]['ref_value'] = $outputlangs->convToOutputCharset($order->ref).($order->ref_client ? ' ('.$order->ref_client.')' : ''); - $linkedobjects[$objecttype]['ref_value'] .= ' / '.$outputlangs->transnoentities($elementobject->ref); - //$linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("OrderDate") . ($elementobject->date_delivery ? ' / ' . $outputlangs->transnoentities("DateShipment") : ''); - //if (empty($linkedobjects[$objecttype]['date_value'])) $linkedobjects[$objecttype]['date_value'] = dol_print_date($order->date,'day','',$outputlangs); - //$linkedobjects[$objecttype]['date_value'].= ($elementobject->date_delivery ? ' / ' . dol_print_date($elementobject->date_delivery,'day','',$outputlangs) : ''); - } - } - } - } + if(count($objects) > 1) { + + $order = null; + if(empty($object->linkedObjects['commande']) && $object->element != 'commande') $object->note_public .= '
'.$outputlangs->transnoentities("RefOrder").' / '.$outputlangs->transnoentities("RefSending").' :
'; + else $object->note_public .= '
'.$outputlangs->transnoentities("RefSending").' :
'; + // We concat this record info into fields xxx_value. title is overwrote. + foreach($objects as $elementobject) { + if(empty($object->linkedObjects['commande']) && $object->element != 'commande') // There is not already a link to order and object is not the order, so we show also info with order + { + $elementobject->fetchObjectLinked(null, '', null, '', 'OR', 1, 'sourcetype', 0); + if(! empty($elementobject->linkedObjectsIds['commande'])) { + include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; + $order = new Commande($db); + $ret = $order->fetch(reset($elementobject->linkedObjectsIds['commande'])); + if($ret < 1) { + $order = null; + } + } + } + + if(! is_object($order)) { + + $object->note_public .= $outputlangs->transnoentities($elementobject->ref); + $object->note_public .= '
'; + } + + else { + + $object->note_public .= $outputlangs->convToOutputCharset($order->ref).($order->ref_client ? ' ('.$order->ref_client.')' : ''); + $object->note_public .= ' / '.$outputlangs->transnoentities($elementobject->ref); + $object->note_public .= '
'; + } + } + } + else if(count($objects) == 1) { + $elementobject = array_shift($objects); + $order = null; + // We concat this record info into fields xxx_value. title is overwrote. + if(empty($object->linkedObjects['commande']) && $object->element != 'commande') // There is not already a link to order and object is not the order, so we show also info with order + { + $elementobject->fetchObjectLinked(null, '', null, '', 'OR', 1, 'sourcetype', 0); + if(! empty($elementobject->linkedObjectsIds['commande'])) { + include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; + $order = new Commande($db); + $ret = $order->fetch(reset($elementobject->linkedObjectsIds['commande'])); + if($ret < 1) { + $order = null; + } + } + } + + if(! is_object($order)) { + $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefSending"); + if(! empty($linkedobjects[$objecttype]['ref_value'])) $linkedobjects[$objecttype]['ref_value'] .= ' / '; + $linkedobjects[$objecttype]['ref_value'] .= $outputlangs->transnoentities($elementobject->ref); + } + else { + $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefOrder").' / '.$outputlangs->transnoentities("RefSending"); + if(empty($linkedobjects[$objecttype]['ref_value'])) $linkedobjects[$objecttype]['ref_value'] = $outputlangs->convToOutputCharset($order->ref).($order->ref_client ? ' ('.$order->ref_client.')' : ''); + $linkedobjects[$objecttype]['ref_value'] .= ' / '.$outputlangs->transnoentities($elementobject->ref); + } + } + } + } // For add external linked objects if (is_object($hookmanager)) From 453ff4aa66e9461f57906f3069618af7617c867c Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 7 Jun 2021 14:19:06 +0000 Subject: [PATCH 0013/1460] Fixing style errors. --- htdocs/core/lib/pdf.lib.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index d420c20796e..b6a831d0b58 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -2160,7 +2160,7 @@ function pdf_getLinkedObjects(&$object, $outputlangs) $object->note_public .= dol_print_date($elementobject->date, 'day', '', $outputlangs); $object->note_public .= '
'; } - } else if(count($objects) == 1) { + } elseif(count($objects) == 1) { $elementobject = array_shift($objects); $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefOrder"); $linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($elementobject->ref).($elementobject->ref_client ? ' ('.$elementobject->ref_client.')' : '').($elementobject->ref_supplier ? ' ('.$elementobject->ref_supplier.')' : ''); @@ -2195,7 +2195,6 @@ function pdf_getLinkedObjects(&$object, $outputlangs) $outputlangs->loadLangs(array("orders", "sendings")); if(count($objects) > 1) { - $order = null; if(empty($object->linkedObjects['commande']) && $object->element != 'commande') $object->note_public .= '
'.$outputlangs->transnoentities("RefOrder").' / '.$outputlangs->transnoentities("RefSending").' :
'; else $object->note_public .= '
'.$outputlangs->transnoentities("RefSending").' :
'; @@ -2215,20 +2214,18 @@ function pdf_getLinkedObjects(&$object, $outputlangs) } if(! is_object($order)) { - $object->note_public .= $outputlangs->transnoentities($elementobject->ref); $object->note_public .= '
'; } else { - $object->note_public .= $outputlangs->convToOutputCharset($order->ref).($order->ref_client ? ' ('.$order->ref_client.')' : ''); $object->note_public .= ' / '.$outputlangs->transnoentities($elementobject->ref); $object->note_public .= '
'; } } } - else if(count($objects) == 1) { + elseif(count($objects) == 1) { $elementobject = array_shift($objects); $order = null; // We concat this record info into fields xxx_value. title is overwrote. From 1d279dedaae54fd532d222dc36c9dcb8b242c433 Mon Sep 17 00:00:00 2001 From: Quentin VIAL-GOUTEYRON Date: Thu, 10 Jun 2021 14:24:01 +0200 Subject: [PATCH 0014/1460] missing & --- htdocs/core/lib/pdf.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 5aab08f2e58..24bc4cb493d 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -2262,7 +2262,7 @@ function pdf_getTotalQty($object, $type, $outputlangs) * @param Translate $outputlangs Object lang for output * @return array Linked objects */ -function pdf_getLinkedObjects($object, $outputlangs) +function pdf_getLinkedObjects(&$object, $outputlangs) { global $db, $hookmanager; From aae636bdc7816b14618c7bdc250c4d2c8d59899c Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 10 Jun 2021 12:28:26 +0000 Subject: [PATCH 0015/1460] Fixing style errors. --- htdocs/core/lib/pdf.lib.php | 140 +++++++++++++++++------------------- 1 file changed, 66 insertions(+), 74 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 24bc4cb493d..3beed062548 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -2285,24 +2285,22 @@ function pdf_getLinkedObjects(&$object, $outputlangs) } elseif ($objecttype == 'commande' || $objecttype == 'supplier_order') { $outputlangs->load('orders'); - if(count($objects) > 1) { - $object->note_public .= '
'.$outputlangs->transnoentities("RefOrder").' :
'; - foreach($objects as $elementobject) { - $object->note_public .= $outputlangs->transnoentities($elementobject->ref).($elementobject->ref_client ? ' ('.$elementobject->ref_client.')' : '').($elementobject->ref_supplier ? ' ('.$elementobject->ref_supplier.')' : '').' '; - $object->note_public .= $outputlangs->transnoentities("OrderDate").' : '; - $object->note_public .= dol_print_date($elementobject->date, 'day', '', $outputlangs); - $object->note_public .= '
'; - } - } elseif(count($objects) == 1) { - $elementobject = array_shift($objects); - $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefOrder"); + if (count($objects) > 1) { + $object->note_public .= '
'.$outputlangs->transnoentities("RefOrder").' :
'; + foreach ($objects as $elementobject) { + $object->note_public .= $outputlangs->transnoentities($elementobject->ref).($elementobject->ref_client ? ' ('.$elementobject->ref_client.')' : '').($elementobject->ref_supplier ? ' ('.$elementobject->ref_supplier.')' : '').' '; + $object->note_public .= $outputlangs->transnoentities("OrderDate").' : '; + $object->note_public .= dol_print_date($elementobject->date, 'day', '', $outputlangs); + $object->note_public .= '
'; + } + } elseif (count($objects) == 1) { + $elementobject = array_shift($objects); + $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefOrder"); $linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($elementobject->ref).($elementobject->ref_client ? ' ('.$elementobject->ref_client.')' : '').($elementobject->ref_supplier ? ' ('.$elementobject->ref_supplier.')' : ''); $linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("OrderDate"); $linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->date, 'day', '', $outputlangs); - } - } - elseif ($objecttype == 'contrat') - { + } + } elseif ($objecttype == 'contrat') { $outputlangs->load('contracts'); foreach ($objects as $elementobject) { $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefContract"); @@ -2321,67 +2319,61 @@ function pdf_getLinkedObjects(&$object, $outputlangs) } elseif ($objecttype == 'shipping') { $outputlangs->loadLangs(array("orders", "sendings")); - if(count($objects) > 1) { - $order = null; - if(empty($object->linkedObjects['commande']) && $object->element != 'commande') $object->note_public .= '
'.$outputlangs->transnoentities("RefOrder").' / '.$outputlangs->transnoentities("RefSending").' :
'; - else $object->note_public .= '
'.$outputlangs->transnoentities("RefSending").' :
'; - // We concat this record info into fields xxx_value. title is overwrote. - foreach($objects as $elementobject) { - if(empty($object->linkedObjects['commande']) && $object->element != 'commande') // There is not already a link to order and object is not the order, so we show also info with order - { - $elementobject->fetchObjectLinked(null, '', null, '', 'OR', 1, 'sourcetype', 0); - if(! empty($elementobject->linkedObjectsIds['commande'])) { - include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; - $order = new Commande($db); - $ret = $order->fetch(reset($elementobject->linkedObjectsIds['commande'])); - if($ret < 1) { - $order = null; - } - } - } + if (count($objects) > 1) { + $order = null; + if (empty($object->linkedObjects['commande']) && $object->element != 'commande') $object->note_public .= '
'.$outputlangs->transnoentities("RefOrder").' / '.$outputlangs->transnoentities("RefSending").' :
'; + else $object->note_public .= '
'.$outputlangs->transnoentities("RefSending").' :
'; + // We concat this record info into fields xxx_value. title is overwrote. + foreach ($objects as $elementobject) { + if (empty($object->linkedObjects['commande']) && $object->element != 'commande') { // There is not already a link to order and object is not the order, so we show also info with order + $elementobject->fetchObjectLinked(null, '', null, '', 'OR', 1, 'sourcetype', 0); + if (! empty($elementobject->linkedObjectsIds['commande'])) { + include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; + $order = new Commande($db); + $ret = $order->fetch(reset($elementobject->linkedObjectsIds['commande'])); + if ($ret < 1) { + $order = null; + } + } + } - if(! is_object($order)) { - $object->note_public .= $outputlangs->transnoentities($elementobject->ref); - $object->note_public .= '
'; - } + if (! is_object($order)) { + $object->note_public .= $outputlangs->transnoentities($elementobject->ref); + $object->note_public .= '
'; + } else { + $object->note_public .= $outputlangs->convToOutputCharset($order->ref).($order->ref_client ? ' ('.$order->ref_client.')' : ''); + $object->note_public .= ' / '.$outputlangs->transnoentities($elementobject->ref); + $object->note_public .= '
'; + } + } + } elseif (count($objects) == 1) { + $elementobject = array_shift($objects); + $order = null; + // We concat this record info into fields xxx_value. title is overwrote. + if (empty($object->linkedObjects['commande']) && $object->element != 'commande') { // There is not already a link to order and object is not the order, so we show also info with order + $elementobject->fetchObjectLinked(null, '', null, '', 'OR', 1, 'sourcetype', 0); + if (! empty($elementobject->linkedObjectsIds['commande'])) { + include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; + $order = new Commande($db); + $ret = $order->fetch(reset($elementobject->linkedObjectsIds['commande'])); + if ($ret < 1) { + $order = null; + } + } + } - else { - $object->note_public .= $outputlangs->convToOutputCharset($order->ref).($order->ref_client ? ' ('.$order->ref_client.')' : ''); - $object->note_public .= ' / '.$outputlangs->transnoentities($elementobject->ref); - $object->note_public .= '
'; - } - } - } - elseif(count($objects) == 1) { - $elementobject = array_shift($objects); - $order = null; - // We concat this record info into fields xxx_value. title is overwrote. - if(empty($object->linkedObjects['commande']) && $object->element != 'commande') // There is not already a link to order and object is not the order, so we show also info with order - { - $elementobject->fetchObjectLinked(null, '', null, '', 'OR', 1, 'sourcetype', 0); - if(! empty($elementobject->linkedObjectsIds['commande'])) { - include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; - $order = new Commande($db); - $ret = $order->fetch(reset($elementobject->linkedObjectsIds['commande'])); - if($ret < 1) { - $order = null; - } - } - } - - if(! is_object($order)) { - $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefSending"); - if(! empty($linkedobjects[$objecttype]['ref_value'])) $linkedobjects[$objecttype]['ref_value'] .= ' / '; - $linkedobjects[$objecttype]['ref_value'] .= $outputlangs->transnoentities($elementobject->ref); - } - else { - $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefOrder").' / '.$outputlangs->transnoentities("RefSending"); - if(empty($linkedobjects[$objecttype]['ref_value'])) $linkedobjects[$objecttype]['ref_value'] = $outputlangs->convToOutputCharset($order->ref).($order->ref_client ? ' ('.$order->ref_client.')' : ''); - $linkedobjects[$objecttype]['ref_value'] .= ' / '.$outputlangs->transnoentities($elementobject->ref); - } - } - } - } + if (! is_object($order)) { + $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefSending"); + if (! empty($linkedobjects[$objecttype]['ref_value'])) $linkedobjects[$objecttype]['ref_value'] .= ' / '; + $linkedobjects[$objecttype]['ref_value'] .= $outputlangs->transnoentities($elementobject->ref); + } else { + $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefOrder").' / '.$outputlangs->transnoentities("RefSending"); + if (empty($linkedobjects[$objecttype]['ref_value'])) $linkedobjects[$objecttype]['ref_value'] = $outputlangs->convToOutputCharset($order->ref).($order->ref_client ? ' ('.$order->ref_client.')' : ''); + $linkedobjects[$objecttype]['ref_value'] .= ' / '.$outputlangs->transnoentities($elementobject->ref); + } + } + } + } // For add external linked objects if (is_object($hookmanager)) { From 97287af9879675b3b4580c4ac3cc005e020ad06f Mon Sep 17 00:00:00 2001 From: jpb Date: Mon, 19 Jul 2021 14:03:03 +0200 Subject: [PATCH 0016/1460] add field to object product, add sql --- .../install/mysql/migration/14.0.0-15.0.0.sql | 1 + htdocs/install/mysql/tables/llx_product.sql | 4 +++- htdocs/langs/fr_FR/products.lang | 1 + htdocs/product/card.php | 23 ++++++++++++++++++- htdocs/product/class/product.class.php | 15 ++++++++++-- 5 files changed, 40 insertions(+), 4 deletions(-) diff --git a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql index 95de2ab7ba6..1a38da5237f 100644 --- a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql +++ b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql @@ -36,4 +36,5 @@ -- v15 +ALTER TABLE llx_product ADD COLUMN mandatory_period tinyint NULL DEFAULT 0 AFTER fk_project; diff --git a/htdocs/install/mysql/tables/llx_product.sql b/htdocs/install/mysql/tables/llx_product.sql index 4aad3393137..09b71c9c5c4 100644 --- a/htdocs/install/mysql/tables/llx_product.sql +++ b/htdocs/install/mysql/tables/llx_product.sql @@ -103,5 +103,7 @@ create table llx_product desiredstock float DEFAULT 0, fk_unit integer DEFAULT NULL, price_autogen tinyint DEFAULT 0, - fk_project integer DEFAULT NULL -- Used when product was generated by a project or is specifif to a project + fk_project integer DEFAULT NULL, -- Used when product was generated by a project or is specifif to a project + mandatory_period tinyint DEFAULT 0 -- is used to signal to the user that the start and end dates are mandatory for this type of product the fk_product_type == 1 (service) (non-blocking action) + )ENGINE=innodb; diff --git a/htdocs/langs/fr_FR/products.lang b/htdocs/langs/fr_FR/products.lang index dc308c95af2..af80e0c67a2 100644 --- a/htdocs/langs/fr_FR/products.lang +++ b/htdocs/langs/fr_FR/products.lang @@ -399,3 +399,4 @@ ProductSupplierExtraFields=Attributs supplémentaires (Prix fournisseur) DeleteLinkedProduct=Supprimer le produit enfant lié à la combinaison PMPValue=Prix moyen pondéré (PMP) PMPValueShort=PMP +mandatoryperiod=Période obligatoires diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 2472c764d7e..55589a967d4 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -551,7 +551,7 @@ if (empty($reshook)) { $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); $accountancy_code_buy_intra = GETPOST('accountancy_code_buy_intra', 'alpha'); $accountancy_code_buy_export = GETPOST('accountancy_code_buy_export', 'alpha'); - + $checkmandatory = GETPOST('mandatoryperiod', 'alpha'); if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') { $object->accountancy_code_sell = ''; } else { @@ -582,6 +582,11 @@ if (empty($reshook)) { } else { $object->accountancy_code_buy_export = $accountancy_code_buy_export; } + if ($object->isService()){ + $object->mandatory_period = (!empty($checkmandatory)) ? 1 : 0 ; + } + + // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost(null, $object); @@ -1981,6 +1986,16 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''.$langs->trans("ProductAccountancyBuyExportCode").''; print ''; print ''; + + if ($object->isService()) { + // Mandatory period + print ''.$langs->trans("mandatoryperiod").''; + print 'mandatory_period == 1 ? ' checked="checked"' : '').' /> '; + print ''; + } + + + } } print ''; @@ -2259,6 +2274,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print (!empty($object->duration_unit) && isset($dur[$object->duration_unit]) ? $langs->trans($dur[$object->duration_unit]) : '')." "; print ''; + + // Mandatory period + + print ''.$langs->trans("mandatoryperiod").''; + print 'mandatory_period == 1 ? ' checked="checked"' : '').' disabled/> '; + print ''; } else { if (empty($conf->global->PRODUCT_DISABLE_NATURE)) { // Nature diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 28bf0288c7b..5222bc1a01c 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -426,6 +426,13 @@ class Product extends CommonObject public $is_object_used; + /** + * + * + * + */ + public $mandatory_period; + /** * 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" @@ -476,6 +483,8 @@ class Product extends CommonObject 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>0, 'position'=>1000), //'tosell' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>0, 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')), //'tobuy' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>0, 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')), + 'mandatory_period' =>array('type'=>'integer', 'label'=>'mandatory_period', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>0, 'index'=>1, 'position'=>1000), + ); /** @@ -1141,7 +1150,7 @@ class Product extends CommonObject $sql .= ", price_autogen = ".(!$this->price_autogen ? 0 : 1); $sql .= ", fk_price_expression = ".($this->fk_price_expression != 0 ? (int) $this->fk_price_expression : 'NULL'); $sql .= ", fk_user_modif = ".($user->id > 0 ? $user->id : 'NULL'); - + $sql .= ", mandatory_period = ".($this->mandatory_period ); // stock field is not here because it is a denormalized value from product_stock. $sql .= " WHERE rowid = ".((int) $id); @@ -2244,7 +2253,7 @@ class Product extends CommonObject $sql .= " p.price_min, p.price_min_ttc, p.price_base_type, p.cost_price, p.default_vat_code, p.tva_tx, p.recuperableonly as tva_npr, p.localtax1_tx, p.localtax2_tx, p.localtax1_type, p.localtax2_type, p.tosell,"; $sql .= " p.tobuy, p.fk_product_type, p.duration, p.fk_default_warehouse, p.seuil_stock_alerte, p.canvas, p.net_measure, p.net_measure_units, p.weight, p.weight_units,"; $sql .= " p.length, p.length_units, p.width, p.width_units, p.height, p.height_units,"; - $sql .= " p.surface, p.surface_units, p.volume, p.volume_units, p.barcode, p.fk_barcode_type, p.finished,"; + $sql .= " p.surface, p.surface_units, p.volume, p.volume_units, p.barcode, p.fk_barcode_type, p.finished,p.mandatory_period,"; if (empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) { $sql .= " p.accountancy_code_buy, p.accountancy_code_buy_intra, p.accountancy_code_buy_export, p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export,"; } else { @@ -2416,6 +2425,8 @@ class Product extends CommonObject $this->price_autogen = $obj->price_autogen; $this->model_pdf = $obj->model_pdf; + $this->mandatory_period = $obj->mandatory_period; + $this->db->free($resql); // fetch optionals attributes and labels From e11afb7da05cb0ad90c9169e5c42996d61f4d2f9 Mon Sep 17 00:00:00 2001 From: jpb Date: Tue, 20 Jul 2021 11:23:35 +0200 Subject: [PATCH 0017/1460] add color on date dield and warning on line --- htdocs/core/tpl/objectline_create.tpl.php | 23 +++++++++++++++++++++-- htdocs/core/tpl/objectline_edit.tpl.php | 18 ++++++++++++++++++ htdocs/core/tpl/objectline_view.tpl.php | 15 +++++++++++++++ htdocs/langs/fr_FR/products.lang | 1 + htdocs/product/ajax/products.php | 3 ++- htdocs/product/class/product.class.php | 10 ++++++++++ 6 files changed, 67 insertions(+), 3 deletions(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index f978a436354..2a96880e04a 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -678,10 +678,10 @@ if (!empty($usemargins) && $user->rights->margins->creer) { /* When changing predefined product, we reload list of supplier prices required for margin combo */ $("#idprod, #idprodfournprice").change(function() { - console.log("Call method change() after change on #idprod or #idprodfournprice (senderissupplier=). this.val = "+$(this).val()); + console.log("Call method change() 1 after change on #idprod or #idprodfournprice (senderissupplier=). this.val = "+$(this).val()); setforpredef(); // TODO Keep vat combo visible and set it to first entry into list that match result of get_default_tva - + setColorToDateSelector($(this).val()); jQuery('#trlinefordates').show(); rights->margins->creer) { { 'id': $(this).val(), 'socid': socid; ?> }, function(data) { console.log("Load unit price end, we got value "+data.price_ht); + + + console.log(data); + console.log(jQuery("#date_start").val()); + console.log(jQuery("#date_end").val()); + // service and we setted mandatory_period to true + if (data.mandatory_period == 1 && data.type == 1 ) { + console.log("we are good to color date input"); + jQuery("#date_start").css("background-color","#f2cf87"); + jQuery("#date_end").css("background-color","#f2cf87"); + }else{ + jQuery("#date_start").css("background-color","#FFF"); + jQuery("#date_end").css("background-color","#FFF"); + } + jQuery("#price_ht").val(data.price_ht); global->PRODUIT_AUTOFILL_DESC) && $conf->global->PRODUIT_AUTOFILL_DESC == 1) { @@ -984,6 +999,10 @@ if (!empty($usemargins) && $user->rights->margins->creer) { jQuery("#np_marginRate, #np_markRate, .np_marginRate, .np_markRate, #units, #title_units").show(); jQuery("#fournprice_predef").hide(); } + function setColorToDateSelector(val){ + console.log("from function "+val); + } + function setforpredef() { console.log("Call setforpredef. We hide some fields and show dates"); jQuery("#select_type").val(-1); diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index 9094daaa2d1..ea6133f8684 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -333,9 +333,19 @@ $coldisplay++; if (isset($conf->global->MAIN_DEFAULT_DATE_START_HOUR)) { print 'jQuery("#date_starthour").val("'.$conf->global->MAIN_DEFAULT_DATE_START_HOUR.'");'; } + + if (isset($conf->global->MAIN_DEFAULT_DATE_START_MIN)) { print 'jQuery("#date_startmin").val("'.$conf->global->MAIN_DEFAULT_DATE_START_MIN.'");'; } + + $res = $line->fetch_product(); + // on doit fetch le product là !!! pour connaître le type + if ($res > 0 ){ + if ($line->product->isMandatoryPeriod() && $line->product->isService()) { + print 'jQuery("#date_start").css("background-color","#f2cf87");'; + } + } } if (!$line->date_end) { if (isset($conf->global->MAIN_DEFAULT_DATE_END_HOUR)) { @@ -344,6 +354,14 @@ $coldisplay++; if (isset($conf->global->MAIN_DEFAULT_DATE_END_MIN)) { print 'jQuery("#date_endmin").val("'.$conf->global->MAIN_DEFAULT_DATE_END_MIN.'");'; } + + $res = $line->fetch_product(); + // on doit fetch le product là !!! pour connaître le type + if ($res > 0 ){ + if ($line->product->isMandatoryperiod() && $line->product->isService()) { + print 'jQuery("#date_end").css("background-color","#f2cf87");'; + } + } } print '' ?> diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 3e8ef7ea411..50575c19dc2 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -180,7 +180,22 @@ if (($line->info_bits & 2) == 2) { } else { if ($line->date_start || $line->date_end) { print '
'.get_date_range($line->date_start, $line->date_end, $format).'
'; + } + if ((!$line->date_start && !$line->date_end) || (!$line->date_start || !$line->date_end) ){ // pas de date + // show warning under line + // we need to fetch product associated to line for some test + $res = $line->fetch_product(); + if ($res > 0 ){ + if ($line->product->isService() && $line->product->isMandatoryPeriod()){ + print '
'.$langs->trans("mandatoryPeriodNeedTobeSet").'
'; + } + } + } + + + + //print get_date_range($line->date_start, $line->date_end, $format); } diff --git a/htdocs/langs/fr_FR/products.lang b/htdocs/langs/fr_FR/products.lang index af80e0c67a2..7e70e5ca186 100644 --- a/htdocs/langs/fr_FR/products.lang +++ b/htdocs/langs/fr_FR/products.lang @@ -400,3 +400,4 @@ DeleteLinkedProduct=Supprimer le produit enfant lié à la combinaison PMPValue=Prix moyen pondéré (PMP) PMPValueShort=PMP mandatoryperiod=Période obligatoires +mandatoryPeriodNeedTobeSet=Attention périodes non saisies et obligatoires diff --git a/htdocs/product/ajax/products.php b/htdocs/product/ajax/products.php index 77acafbbd55..9ba8d9cec09 100644 --- a/htdocs/product/ajax/products.php +++ b/htdocs/product/ajax/products.php @@ -91,7 +91,7 @@ if (!empty($action) && $action == 'fetch' && !empty($id)) { $outtype = $object->type; $outqty = 1; $outdiscount = 0; - + $mandatory_period = $object->mandatory_period; $found = false; $price_level = 1; @@ -203,6 +203,7 @@ if (!empty($action) && $action == 'fetch' && !empty($id)) { 'tva_tx' => $outtva_tx, 'qty' => $outqty, 'discount' => $outdiscount, + 'mandatory_period' => $mandatory_period, 'array_options'=>$object->array_options); } diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 5222bc1a01c..1c27671ba00 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5642,6 +5642,16 @@ class Product extends CommonObject return ($this->type == Product::TYPE_SERVICE ? true : false); } + + /** + * Return if object have a constraint on mandatory_period + * + * @return boolean True if mandatory_period setted to 1 + */ + public function isMandatoryPeriod() + { + return ($this->mandatory_period == 1 ? true : false); + } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Get a barcode from the module to generate barcode values. From 367e83923909802529e670723e343e613cb8b942 Mon Sep 17 00:00:00 2001 From: jpb Date: Tue, 20 Jul 2021 13:56:30 +0200 Subject: [PATCH 0018/1460] change class css and behavior js --- htdocs/core/tpl/objectline_create.tpl.php | 27 +++++++++++-------- htdocs/core/tpl/objectline_edit.tpl.php | 14 +++++++--- htdocs/core/tpl/objectline_view.tpl.php | 4 +-- .../install/mysql/migration/14.0.0-15.0.0.sql | 2 +- htdocs/langs/fr_FR/products.lang | 2 +- htdocs/theme/eldy/global.inc.php | 2 +- 6 files changed, 32 insertions(+), 19 deletions(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 2a96880e04a..ecd8a47fc86 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -674,6 +674,15 @@ if (!empty($usemargins) && $user->rights->margins->creer) { + $("#date_start, #date_end").focusout(function() + { + + if ( $(this).val() == '' && !$(this).hasClass("error") ) { + $(this).addClass('error'); + }else{ + $(this).removeClass('error'); + } + }); /* When changing predefined product, we reload list of supplier prices required for margin combo */ $("#idprod, #idprodfournprice").change(function() @@ -681,7 +690,6 @@ if (!empty($usemargins) && $user->rights->margins->creer) { console.log("Call method change() 1 after change on #idprod or #idprodfournprice (senderissupplier=). this.val = "+$(this).val()); setforpredef(); // TODO Keep vat combo visible and set it to first entry into list that match result of get_default_tva - setColorToDateSelector($(this).val()); jQuery('#trlinefordates').show(); rights->margins->creer) { console.log("Load unit price end, we got value "+data.price_ht); - console.log(data); - console.log(jQuery("#date_start").val()); - console.log(jQuery("#date_end").val()); + // service and we setted mandatory_period to true if (data.mandatory_period == 1 && data.type == 1 ) { console.log("we are good to color date input"); - jQuery("#date_start").css("background-color","#f2cf87"); - jQuery("#date_end").css("background-color","#f2cf87"); + + jQuery("#date_start").addClass("error"); + jQuery("#date_end").addClass("error"); }else{ - jQuery("#date_start").css("background-color","#FFF"); - jQuery("#date_end").css("background-color","#FFF"); + jQuery("#date_start").removeClass("error"); + jQuery("#date_end").removeClass("error"); } jQuery("#price_ht").val(data.price_ht); @@ -733,6 +740,7 @@ if (!empty($usemargins) && $user->rights->margins->creer) { if (!empty($conf->global->FCKEDITOR_ENABLE_DETAILS)) { ?> if (typeof CKEDITOR == "object" && typeof CKEDITOR.instances != "undefined") { + var editor = CKEDITOR.instances['dp_desc']; var editor = CKEDITOR.instances['dp_desc']; if (editor) { editor.setData(proddesc); @@ -999,9 +1007,6 @@ if (!empty($usemargins) && $user->rights->margins->creer) { jQuery("#np_marginRate, #np_markRate, .np_marginRate, .np_markRate, #units, #title_units").show(); jQuery("#fournprice_predef").hide(); } - function setColorToDateSelector(val){ - console.log("from function "+val); - } function setforpredef() { console.log("Call setforpredef. We hide some fields and show dates"); diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index ea6133f8684..8ef08b60660 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -340,10 +340,9 @@ $coldisplay++; } $res = $line->fetch_product(); - // on doit fetch le product là !!! pour connaître le type if ($res > 0 ){ if ($line->product->isMandatoryPeriod() && $line->product->isService()) { - print 'jQuery("#date_start").css("background-color","#f2cf87");'; + print 'jQuery("#date_start").addClass("error");'; } } } @@ -359,7 +358,7 @@ $coldisplay++; // on doit fetch le product là !!! pour connaître le type if ($res > 0 ){ if ($line->product->isMandatoryperiod() && $line->product->isService()) { - print 'jQuery("#date_end").css("background-color","#f2cf87");'; + print 'jQuery("#date_end").addClass("error");'; } } } @@ -469,6 +468,15 @@ jQuery(document).ready(function() } }); + $("#date_start, #date_end").focusout(function() + { + + if ( $(this).val() == '' && !$(this).hasClass("error") ) { + $(this).addClass('error'); + }else{ + $(this).removeClass('error'); + } + }); margin->enabled)) { ?> diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 50575c19dc2..42453df6e31 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -182,13 +182,13 @@ if (($line->info_bits & 2) == 2) { print '
'.get_date_range($line->date_start, $line->date_end, $format).'
'; } - if ((!$line->date_start && !$line->date_end) || (!$line->date_start || !$line->date_end) ){ // pas de date + if (!$line->date_start || !$line->date_end){ // show warning under line // we need to fetch product associated to line for some test $res = $line->fetch_product(); if ($res > 0 ){ if ($line->product->isService() && $line->product->isMandatoryPeriod()){ - print '
'.$langs->trans("mandatoryPeriodNeedTobeSet").'
'; + print '
'.$langs->trans("mandatoryPeriodNeedTobeSet").'
'; } } } diff --git a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql index 1a38da5237f..b2f690c1d89 100644 --- a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql +++ b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql @@ -36,5 +36,5 @@ -- v15 -ALTER TABLE llx_product ADD COLUMN mandatory_period tinyint NULL DEFAULT 0 AFTER fk_project; +ALTER TABLE llx_product ADD COLUMN mandatory_period tinyint NULL DEFAULT 0; diff --git a/htdocs/langs/fr_FR/products.lang b/htdocs/langs/fr_FR/products.lang index 7e70e5ca186..168bdf07fcf 100644 --- a/htdocs/langs/fr_FR/products.lang +++ b/htdocs/langs/fr_FR/products.lang @@ -399,5 +399,5 @@ ProductSupplierExtraFields=Attributs supplémentaires (Prix fournisseur) DeleteLinkedProduct=Supprimer le produit enfant lié à la combinaison PMPValue=Prix moyen pondéré (PMP) PMPValueShort=PMP -mandatoryperiod=Période obligatoires +mandatoryperiod=Périodes obligatoires mandatoryPeriodNeedTobeSet=Attention périodes non saisies et obligatoires diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index ab9ab624801..2ab774f70eb 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -234,7 +234,7 @@ input.button.massactionconfirmed { margin: 4px; } -input:invalid, select:invalid { +input:invalid, select:invalid , input.error{ border-color: #ea1212; } From 1237c5ba5544e4f570d30fb001616a48c3d69324 Mon Sep 17 00:00:00 2001 From: jpb Date: Tue, 20 Jul 2021 14:46:56 +0200 Subject: [PATCH 0019/1460] add msg to formconfirm on propal invoice and commande --- htdocs/comm/propal/card.php | 16 ++++++++++++++++ htdocs/commande/card.php | 15 +++++++++++++++ htdocs/compta/facture/card.php | 15 +++++++++++++++ htdocs/langs/en_US/products.lang | 3 +++ htdocs/langs/fr_FR/products.lang | 1 + 5 files changed, 50 insertions(+) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 3c0d8dd9a28..1c83e7ed962 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1958,8 +1958,24 @@ if ($action == 'create') { $notify = new Notify($db); $text .= '
'; $text .= $notify->confirmMessage('PROPAL_VALIDATE', $object->socid, $object); + } + // mandatoryPeriod + $nbMandated = 0; + foreach ($object->lines as $line){ + $res = $line->fetch_product(); + if ($res > 0 ){ + if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end) )){ + $nbMandated++; + break; + } + } + } + if ($nbMandated > 0 ) $text .= '
'.$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'
'; + + + if (!$error) { $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateProp'), $text, 'confirm_validate', '', 0, 1); } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 8420a5e7f87..f6ecf217a0d 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1910,6 +1910,21 @@ if ($action == 'create' && $usercancreate) { ); } + // mandatoryPeriod + $nbMandated = 0; + foreach ($object->lines as $line){ + $res = $line->fetch_product(); + if ($res > 0 ){ + if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end) )){ + $nbMandated++; + break; + } + } + } + if ($nbMandated > 0 ) $text .= '
'.$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'
'; + + + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateOrder'), $text, 'confirm_validate', $formquestion, 0, 1, 220); } diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 699a10d3ef5..60f025efbae 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4001,6 +4001,21 @@ if ($action == 'create') { if ($object->type != Facture::TYPE_CREDIT_NOTE && $object->total_ttc < 0) { // Can happen only if $conf->global->FACTURE_ENABLE_NEGATIVE is on $text .= '
'.img_warning().' '.$langs->trans("ErrorInvoiceOfThisTypeMustBePositive"); } + + // mandatoryPeriod + $nbMandated = 0; + foreach ($object->lines as $line){ + $res = $line->fetch_product(); + if ($res > 0 ){ + if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end) )){ + $nbMandated++; + break; + } + } + } + if ($nbMandated > 0 ) $text .= '
'.$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'
'; + + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$object->id, $langs->trans('ValidateBill'), $text, 'confirm_valid', $formquestion, (($object->type != Facture::TYPE_CREDIT_NOTE && $object->total_ttc < 0) ? "no" : "yes"), 2); } diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index bf34efe3f79..5a24c2d56f8 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -399,3 +399,6 @@ ProductSupplierExtraFields=Additional Attributes (Supplier Prices) DeleteLinkedProduct=Delete the child product linked to the combination PMPValue=Weighted average price PMPValueShort=WAP +mandatoryperiod=Mandatory periods +mandatoryPeriodNeedTobeSet=Attention periods not entered and mandatory +mandatoryPeriodNeedTobeSetMsgValidate=A service requires a start and end period diff --git a/htdocs/langs/fr_FR/products.lang b/htdocs/langs/fr_FR/products.lang index 168bdf07fcf..aa8b5a5c462 100644 --- a/htdocs/langs/fr_FR/products.lang +++ b/htdocs/langs/fr_FR/products.lang @@ -401,3 +401,4 @@ PMPValue=Prix moyen pondéré (PMP) PMPValueShort=PMP mandatoryperiod=Périodes obligatoires mandatoryPeriodNeedTobeSet=Attention périodes non saisies et obligatoires +mandatoryPeriodNeedTobeSetMsgValidate=Un service nécessite une période de début et de fin From dc90a62d906dde5239f88f86eb13fff118a927d8 Mon Sep 17 00:00:00 2001 From: jpb Date: Tue, 20 Jul 2021 15:18:14 +0200 Subject: [PATCH 0020/1460] add tooltips helper on product card --- htdocs/langs/en_US/products.lang | 1 + htdocs/langs/fr_FR/products.lang | 1 + htdocs/product/card.php | 8 ++++++++ 3 files changed, 10 insertions(+) diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 5a24c2d56f8..2531dd919d9 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -402,3 +402,4 @@ PMPValueShort=WAP mandatoryperiod=Mandatory periods mandatoryPeriodNeedTobeSet=Attention periods not entered and mandatory mandatoryPeriodNeedTobeSetMsgValidate=A service requires a start and end period +mandatoryHelper=Message to the user on the need to enter a start date and an end date on a service when creating / validating an invoice, commercial proposal, sales order.
This action is not blocking in the process of confirmation diff --git a/htdocs/langs/fr_FR/products.lang b/htdocs/langs/fr_FR/products.lang index aa8b5a5c462..e2acf31eb4d 100644 --- a/htdocs/langs/fr_FR/products.lang +++ b/htdocs/langs/fr_FR/products.lang @@ -402,3 +402,4 @@ PMPValueShort=PMP mandatoryperiod=Périodes obligatoires mandatoryPeriodNeedTobeSet=Attention périodes non saisies et obligatoires mandatoryPeriodNeedTobeSetMsgValidate=Un service nécessite une période de début et de fin +mandatoryHelper=Message à l'utilisateur sur la necessité de saisir une date de début et une date de fin sur un service lors de la création/validation de facture, proposition commerciale , commande client.
Cette action n'est pas bloquante dans le processus de validation diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 55589a967d4..277fec6e78f 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -2279,7 +2279,15 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''.$langs->trans("mandatoryperiod").''; print 'mandatory_period == 1 ? ' checked="checked"' : '').' disabled/> '; + print ''; + + $htmltooltip = '
'.$langs->trans("mandatoryHelper"); + + + print ''; + print $form->textwithpicto('', $htmltooltip, 1, 0); print ''; + } else { if (empty($conf->global->PRODUCT_DISABLE_NATURE)) { // Nature From 2f0ba41a531cece5b8e42b4c49d0deb91d7b25a5 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 20 Jul 2021 13:35:10 +0000 Subject: [PATCH 0021/1460] Fixing style errors. --- htdocs/comm/propal/card.php | 7 +++---- htdocs/commande/card.php | 6 +++--- htdocs/compta/facture/card.php | 6 +++--- htdocs/core/tpl/objectline_edit.tpl.php | 4 ++-- htdocs/core/tpl/objectline_view.tpl.php | 7 +++---- htdocs/product/card.php | 6 +----- 6 files changed, 15 insertions(+), 21 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 1c83e7ed962..5cf3c640563 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1958,15 +1958,14 @@ if ($action == 'create') { $notify = new Notify($db); $text .= '
'; $text .= $notify->confirmMessage('PROPAL_VALIDATE', $object->socid, $object); - } // mandatoryPeriod $nbMandated = 0; - foreach ($object->lines as $line){ + foreach ($object->lines as $line) { $res = $line->fetch_product(); - if ($res > 0 ){ - if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end) )){ + if ($res > 0 ) { + if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end) )) { $nbMandated++; break; } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index f6ecf217a0d..4a8818113d5 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1912,10 +1912,10 @@ if ($action == 'create' && $usercancreate) { // mandatoryPeriod $nbMandated = 0; - foreach ($object->lines as $line){ + foreach ($object->lines as $line) { $res = $line->fetch_product(); - if ($res > 0 ){ - if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end) )){ + if ($res > 0 ) { + if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end) )) { $nbMandated++; break; } diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 60f025efbae..e4391b126b7 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4004,10 +4004,10 @@ if ($action == 'create') { // mandatoryPeriod $nbMandated = 0; - foreach ($object->lines as $line){ + foreach ($object->lines as $line) { $res = $line->fetch_product(); - if ($res > 0 ){ - if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end) )){ + if ($res > 0 ) { + if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end) )) { $nbMandated++; break; } diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index 8ef08b60660..642bb90403d 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -340,7 +340,7 @@ $coldisplay++; } $res = $line->fetch_product(); - if ($res > 0 ){ + if ($res > 0 ) { if ($line->product->isMandatoryPeriod() && $line->product->isService()) { print 'jQuery("#date_start").addClass("error");'; } @@ -356,7 +356,7 @@ $coldisplay++; $res = $line->fetch_product(); // on doit fetch le product là !!! pour connaître le type - if ($res > 0 ){ + if ($res > 0 ) { if ($line->product->isMandatoryperiod() && $line->product->isService()) { print 'jQuery("#date_end").addClass("error");'; } diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 42453df6e31..7d5e02f82ea 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -180,14 +180,13 @@ if (($line->info_bits & 2) == 2) { } else { if ($line->date_start || $line->date_end) { print '
'.get_date_range($line->date_start, $line->date_end, $format).'
'; - } - if (!$line->date_start || !$line->date_end){ + if (!$line->date_start || !$line->date_end) { // show warning under line // we need to fetch product associated to line for some test $res = $line->fetch_product(); - if ($res > 0 ){ - if ($line->product->isService() && $line->product->isMandatoryPeriod()){ + if ($res > 0 ) { + if ($line->product->isService() && $line->product->isMandatoryPeriod()) { print '
'.$langs->trans("mandatoryPeriodNeedTobeSet").'
'; } } diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 277fec6e78f..45b5e87121d 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -582,7 +582,7 @@ if (empty($reshook)) { } else { $object->accountancy_code_buy_export = $accountancy_code_buy_export; } - if ($object->isService()){ + if ($object->isService()) { $object->mandatory_period = (!empty($checkmandatory)) ? 1 : 0 ; } @@ -1993,9 +1993,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print 'mandatory_period == 1 ? ' checked="checked"' : '').' /> '; print ''; } - - - } } print ''; @@ -2287,7 +2284,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; print $form->textwithpicto('', $htmltooltip, 1, 0); print ''; - } else { if (empty($conf->global->PRODUCT_DISABLE_NATURE)) { // Nature From f16eba1811b8b762be109449dd1f96c17e5b1b2e Mon Sep 17 00:00:00 2001 From: jpb Date: Tue, 20 Jul 2021 16:04:12 +0200 Subject: [PATCH 0022/1460] quick fix create product --- htdocs/product/class/product.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 1c27671ba00..f9b046e341c 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -636,7 +636,7 @@ class Product extends CommonObject // Barcode value $this->barcode = trim($this->barcode); - + $this->mandatory_period = empty($this->mandatory_period) ? 0 : $this->mandatory_period; // Check parameters if (empty($this->label)) { $this->error = 'ErrorMandatoryParametersNotProvided'; @@ -718,6 +718,7 @@ class Product extends CommonObject $sql .= ", tobatch"; $sql .= ", batch_mask"; $sql .= ", fk_unit"; + $sql .= ", mandatory_period"; $sql .= ") VALUES ("; $sql .= "'".$this->db->idate($now)."'"; $sql .= ", ".$conf->entity; @@ -746,6 +747,7 @@ class Product extends CommonObject $sql .= ", ".((empty($this->status_batch) || $this->status_batch < 0) ? '0' : $this->status_batch); $sql .= ", '".$this->db->escape($this->batch_mask)."'"; $sql .= ", ".(!$this->fk_unit ? 'NULL' : $this->fk_unit); + $sql .= ", '".$this->mandatory_period."'"; $sql .= ")"; dol_syslog(get_class($this)."::Create", LOG_DEBUG); From 875167d5937368627c5b053a8369c9a92279c526 Mon Sep 17 00:00:00 2001 From: jpb Date: Tue, 20 Jul 2021 16:17:17 +0200 Subject: [PATCH 0023/1460] add escape to sql --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index f9b046e341c..18413b89c30 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -747,7 +747,7 @@ class Product extends CommonObject $sql .= ", ".((empty($this->status_batch) || $this->status_batch < 0) ? '0' : $this->status_batch); $sql .= ", '".$this->db->escape($this->batch_mask)."'"; $sql .= ", ".(!$this->fk_unit ? 'NULL' : $this->fk_unit); - $sql .= ", '".$this->mandatory_period."'"; + $sql .= ", '".$this->db->escape($this->mandatory_period)."'"; $sql .= ")"; dol_syslog(get_class($this)."::Create", LOG_DEBUG); From d61b831737b585b60d0125e68c58e0f57e21da49 Mon Sep 17 00:00:00 2001 From: jpb Date: Tue, 20 Jul 2021 22:39:30 +0200 Subject: [PATCH 0024/1460] add field in create product --- htdocs/core/tpl/objectline_create.tpl.php | 2 -- htdocs/core/tpl/objectline_edit.tpl.php | 2 +- htdocs/product/card.php | 12 +++++++++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index ecd8a47fc86..34b6fe9ec44 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -716,8 +716,6 @@ if (!empty($usemargins) && $user->rights->margins->creer) { // service and we setted mandatory_period to true if (data.mandatory_period == 1 && data.type == 1 ) { - console.log("we are good to color date input"); - jQuery("#date_start").addClass("error"); jQuery("#date_end").addClass("error"); }else{ diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index 642bb90403d..e15c489a5b6 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -341,7 +341,7 @@ $coldisplay++; $res = $line->fetch_product(); if ($res > 0 ) { - if ($line->product->isMandatoryPeriod() && $line->product->isService()) { + if ( $line->product->isMandatoryPeriod() && $line->product->isService()) { print 'jQuery("#date_start").addClass("error");'; } } diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 45b5e87121d..4b5e178733d 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -106,6 +106,7 @@ $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); $accountancy_code_buy_intra = GETPOST('accountancy_code_buy_intra', 'alpha'); $accountancy_code_buy_export = GETPOST('accountancy_code_buy_export', 'alpha'); +$checkmandatory = GETPOST('accountancy_code_buy_export', 'alpha'); // by default 'alphanohtml' (better security); hidden conf MAIN_SECURITY_ALLOW_UNSECURED_LABELS_WITH_HTML allows basic html $label_security_check = empty($conf->global->MAIN_SECURITY_ALLOW_UNSECURED_LABELS_WITH_HTML) ? 'alphanohtml' : 'restricthtml'; @@ -264,7 +265,7 @@ if (empty($reshook)) { $object->ref = $ref; $object->label = GETPOST('label', $label_security_check); $object->price_base_type = GETPOST('price_base_type', 'aZ09'); - + $object->mandatory_period = !empty(GETPOST("mandatoryperiod",'alpha')) ? 1 : 0; if ($object->price_base_type == 'TTC') { $object->price_ttc = GETPOST('price'); } else { @@ -1401,6 +1402,15 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print $form->load_tva("tva_tx", $defaultva, $mysoc, $mysoc, 0, 0, '', false, 1); print ''; + if (!empty($conf->service->enabled)){ + if ($object->isService()){ + // Mandatory period + print ''.$langs->trans("mandatoryperiod").''; + print ' '; + print ''; + + } + } print ''; print '
'; From 191163c7e7ec9509c1d388afe8aae654f7932e04 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 20 Jul 2021 20:41:49 +0000 Subject: [PATCH 0025/1460] Fixing style errors. --- htdocs/product/card.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 4b5e178733d..0f7b061fb54 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -265,7 +265,7 @@ if (empty($reshook)) { $object->ref = $ref; $object->label = GETPOST('label', $label_security_check); $object->price_base_type = GETPOST('price_base_type', 'aZ09'); - $object->mandatory_period = !empty(GETPOST("mandatoryperiod",'alpha')) ? 1 : 0; + $object->mandatory_period = !empty(GETPOST("mandatoryperiod", 'alpha')) ? 1 : 0; if ($object->price_base_type == 'TTC') { $object->price_ttc = GETPOST('price'); } else { @@ -1402,13 +1402,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print $form->load_tva("tva_tx", $defaultva, $mysoc, $mysoc, 0, 0, '', false, 1); print ''; - if (!empty($conf->service->enabled)){ - if ($object->isService()){ + if (!empty($conf->service->enabled)) { + if ($object->isService()) { // Mandatory period print ''.$langs->trans("mandatoryperiod").''; print ' '; print ''; - } } print ''; From 32f9b1a55640449211d11bfc284ffd55429f4f00 Mon Sep 17 00:00:00 2001 From: jpb Date: Wed, 21 Jul 2021 08:26:41 +0200 Subject: [PATCH 0026/1460] fix cmd fourn no msg --- htdocs/core/tpl/objectline_create.tpl.php | 8 ++++---- htdocs/core/tpl/objectline_view.tpl.php | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 34b6fe9ec44..ac4bbca05a0 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -68,6 +68,7 @@ if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf- if (in_array($object->element, array('propal', 'commande', 'order', 'facture', 'facturerec', 'invoice', 'supplier_proposal', 'order_supplier', 'invoice_supplier'))) { $colspan++; // With this, there is a column move button } + //print $object->element; // Lines for extrafield $objectline = null; @@ -674,16 +675,17 @@ if (!empty($usemargins) && $user->rights->margins->creer) { + +table_element_line != 'commande_fournisseurdet' || $this->table_element_line == 'facture_fourn_det') { ?> $("#date_start, #date_end").focusout(function() { - if ( $(this).val() == '' && !$(this).hasClass("error") ) { $(this).addClass('error'); }else{ $(this).removeClass('error'); } }); - + /* When changing predefined product, we reload list of supplier prices required for margin combo */ $("#idprod, #idprodfournprice").change(function() { @@ -712,8 +714,6 @@ if (!empty($usemargins) && $user->rights->margins->creer) { function(data) { console.log("Load unit price end, we got value "+data.price_ht); - - // service and we setted mandatory_period to true if (data.mandatory_period == 1 && data.type == 1 ) { jQuery("#date_start").addClass("error"); diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 7d5e02f82ea..d4a4f6a0573 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -184,12 +184,15 @@ if (($line->info_bits & 2) == 2) { if (!$line->date_start || !$line->date_end) { // show warning under line // we need to fetch product associated to line for some test + if ($object->element != 'order_supplier'){ $res = $line->fetch_product(); if ($res > 0 ) { if ($line->product->isService() && $line->product->isMandatoryPeriod()) { print '
'.$langs->trans("mandatoryPeriodNeedTobeSet").'
'; } } + } + } From c93e2cda0dea8c175c4fe1132405012b7c4ae2cc Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 21 Jul 2021 06:31:07 +0000 Subject: [PATCH 0027/1460] Fixing style errors. --- htdocs/core/tpl/objectline_view.tpl.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index d4a4f6a0573..5c955c56ff3 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -184,15 +184,14 @@ if (($line->info_bits & 2) == 2) { if (!$line->date_start || !$line->date_end) { // show warning under line // we need to fetch product associated to line for some test - if ($object->element != 'order_supplier'){ - $res = $line->fetch_product(); - if ($res > 0 ) { - if ($line->product->isService() && $line->product->isMandatoryPeriod()) { - print '
'.$langs->trans("mandatoryPeriodNeedTobeSet").'
'; + if ($object->element != 'order_supplier') { + $res = $line->fetch_product(); + if ($res > 0 ) { + if ($line->product->isService() && $line->product->isMandatoryPeriod()) { + print '
'.$langs->trans("mandatoryPeriodNeedTobeSet").'
'; + } } } - } - } From 62d007e232b44fb9beb968fad698bc5fb98763b4 Mon Sep 17 00:00:00 2001 From: jpb Date: Wed, 21 Jul 2021 08:56:40 +0200 Subject: [PATCH 0028/1460] add focusout constraint --- htdocs/core/tpl/objectline_create.tpl.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index ac4bbca05a0..9a87d89189a 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -679,10 +679,13 @@ if (!empty($usemargins) && $user->rights->margins->creer) { table_element_line != 'commande_fournisseurdet' || $this->table_element_line == 'facture_fourn_det') { ?> $("#date_start, #date_end").focusout(function() { - if ( $(this).val() == '' && !$(this).hasClass("error") ) { - $(this).addClass('error'); - }else{ - $(this).removeClass('error'); + type = $(this).attr('type'); + if (type == 1){ + if ( $(this).val() == '' && !$(this).hasClass("error") ) { + $(this).addClass('error'); + }else{ + $(this).removeClass('error'); + } } }); @@ -714,6 +717,11 @@ if (!empty($usemargins) && $user->rights->margins->creer) { function(data) { console.log("Load unit price end, we got value "+data.price_ht); + $( '#date_start').removeAttr( "type" ); + $( '#date_end' ).removeAttr( "type" ); + $('#date_start').attr('type', data.type); + $('#date_end').attr('type', data.type); + // service and we setted mandatory_period to true if (data.mandatory_period == 1 && data.type == 1 ) { jQuery("#date_start").addClass("error"); From 0396573b91f5d340779eb89b6aab0e805cce1ddf Mon Sep 17 00:00:00 2001 From: jpb Date: Wed, 21 Jul 2021 09:46:38 +0200 Subject: [PATCH 0029/1460] fix focusout on mandatoryPeriod only --- htdocs/core/tpl/objectline_create.tpl.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 9a87d89189a..5d3d9de4ea4 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -679,8 +679,9 @@ if (!empty($usemargins) && $user->rights->margins->creer) { table_element_line != 'commande_fournisseurdet' || $this->table_element_line == 'facture_fourn_det') { ?> $("#date_start, #date_end").focusout(function() { - type = $(this).attr('type'); - if (type == 1){ + let type = $(this).attr('type'); + let mandatoryP = $(this).attr('mandatoryperiod'); + if (type == 1 && mandatoryP == 1 ){ if ( $(this).val() == '' && !$(this).hasClass("error") ) { $(this).addClass('error'); }else{ @@ -722,6 +723,11 @@ if (!empty($usemargins) && $user->rights->margins->creer) { $('#date_start').attr('type', data.type); $('#date_end').attr('type', data.type); + $( '#date_start').removeAttr( "mandatoryperiod" ); + $( '#date_end' ).removeAttr( "mandatoryperiod" ); + $('#date_start').attr('mandatoryperiod', data.mandatory_period); + $('#date_end').attr('mandatoryperiod', data.mandatory_period); + // service and we setted mandatory_period to true if (data.mandatory_period == 1 && data.type == 1 ) { jQuery("#date_start").addClass("error"); From 252765303eadfdc39dde40fc010ca3edc423e2f2 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 21 Jul 2021 07:48:57 +0000 Subject: [PATCH 0030/1460] Fixing style errors. --- htdocs/core/tpl/objectline_create.tpl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 5d3d9de4ea4..d09a3257d87 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -679,8 +679,8 @@ if (!empty($usemargins) && $user->rights->margins->creer) { table_element_line != 'commande_fournisseurdet' || $this->table_element_line == 'facture_fourn_det') { ?> $("#date_start, #date_end").focusout(function() { - let type = $(this).attr('type'); - let mandatoryP = $(this).attr('mandatoryperiod'); + let type = $(this).attr('type'); + let mandatoryP = $(this).attr('mandatoryperiod'); if (type == 1 && mandatoryP == 1 ){ if ( $(this).val() == '' && !$(this).hasClass("error") ) { $(this).addClass('error'); From 8dc316797f5e1f6c8133f2928fe4a6db620afcb3 Mon Sep 17 00:00:00 2001 From: jpb Date: Mon, 26 Jul 2021 09:15:23 +0200 Subject: [PATCH 0031/1460] move info to the left --- htdocs/product/card.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 0f7b061fb54..c5507180548 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -2282,16 +2282,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; // Mandatory period - - print ''.$langs->trans("mandatoryperiod").''; - print 'mandatory_period == 1 ? ' checked="checked"' : '').' disabled/> '; - print ''; - $htmltooltip = '
'.$langs->trans("mandatoryHelper"); - - - print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); + print ''.$langs->trans("mandatoryperiod"); + print $form->textwithpicto('', $htmltooltip, 1, 0).''; + print 'mandatory_period == 1 ? ' checked="checked"' : '').' disabled/> '; print ''; } else { if (empty($conf->global->PRODUCT_DISABLE_NATURE)) { From 7836651f84380abf85204f876264593ce05b6054 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Tue, 27 Jul 2021 09:51:38 +0200 Subject: [PATCH 0032/1460] Fix debug bar for php 8.0 --- htdocs/includes/symfony/var-dumper/Cloner/VarCloner.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/includes/symfony/var-dumper/Cloner/VarCloner.php b/htdocs/includes/symfony/var-dumper/Cloner/VarCloner.php index 98d6e9e51c1..20cc8d08354 100644 --- a/htdocs/includes/symfony/var-dumper/Cloner/VarCloner.php +++ b/htdocs/includes/symfony/var-dumper/Cloner/VarCloner.php @@ -291,7 +291,7 @@ class VarCloner extends AbstractCloner if (!empty($frame['line'])) { ob_start(); debug_zval_dump($obj); - self::$hashMask = substr(ob_get_clean(), 17); + self::$hashMask = strlen(substr(ob_get_clean(), 17)); } } From b0133224d89cc8b001452c24489c79fe1b913d87 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Thu, 29 Jul 2021 10:20:01 +0200 Subject: [PATCH 0033/1460] Update of var_dumper package 3.0 -> 3.2 --- composer.json | 2 +- composer.lock | 4 +- .../symfony/var-dumper/Caster/AmqpCaster.php | 106 +++++--- .../symfony/var-dumper/Caster/ArgsStub.php | 80 ++++++ .../symfony/var-dumper/Caster/Caster.php | 44 ++- .../symfony/var-dumper/Caster/ClassStub.php | 87 ++++++ .../symfony/var-dumper/Caster/ConstStub.php | 5 + .../symfony/var-dumper/Caster/CutStub.php | 5 +- .../symfony/var-dumper/Caster/DOMCaster.php | 6 +- .../symfony/var-dumper/Caster/EnumStub.php | 5 +- .../var-dumper/Caster/ExceptionCaster.php | 186 ++++++++----- .../symfony/var-dumper/Caster/LinkStub.php | 51 ++++ .../symfony/var-dumper/Caster/PdoCaster.php | 6 + .../symfony/var-dumper/Caster/RedisCaster.php | 77 ++++++ .../var-dumper/Caster/ReflectionCaster.php | 92 ++++--- .../var-dumper/Caster/ResourceCaster.php | 9 +- .../symfony/var-dumper/Caster/SplCaster.php | 10 +- .../symfony/var-dumper/Caster/StubCaster.php | 16 +- .../var-dumper/Caster/XmlReaderCaster.php | 77 ++++++ .../var-dumper/Cloner/AbstractCloner.php | 53 ++-- .../var-dumper/Cloner/ClonerInterface.php | 4 +- .../symfony/var-dumper/Cloner/Cursor.php | 1 + .../symfony/var-dumper/Cloner/Data.php | 98 +++++-- .../var-dumper/Cloner/DumperInterface.php | 32 +-- .../symfony/var-dumper/Cloner/Stub.php | 1 + .../symfony/var-dumper/Cloner/VarCloner.php | 82 ++++-- .../var-dumper/Dumper/AbstractDumper.php | 79 ++++-- .../symfony/var-dumper/Dumper/CliDumper.php | 76 ++++-- .../var-dumper/Dumper/DataDumperInterface.php | 2 +- .../symfony/var-dumper/Dumper/HtmlDumper.php | 245 ++++++++++++----- htdocs/includes/symfony/var-dumper/LICENSE | 2 +- htdocs/includes/symfony/var-dumper/README.md | 23 +- .../var-dumper/Test/VarDumperTestTrait.php | 17 +- .../var-dumper/Tests/Caster/CasterTest.php | 3 +- .../Tests/Caster/ExceptionCasterTest.php | 225 ++++++++++++++++ .../var-dumper/Tests/Caster/PdoCasterTest.php | 41 +-- .../Tests/Caster/RedisCasterTest.php | 85 ++++++ .../Tests/Caster/ReflectionCasterTest.php | 101 +++---- .../var-dumper/Tests/Caster/SplCasterTest.php | 39 ++- .../Tests/Caster/StubCasterTest.php | 171 ++++++++++++ .../Tests/Caster/XmlReaderCasterTest.php | 248 +++++++++++++++++ .../var-dumper/Tests/CliDumperTest.php | 251 +++++++++++------- .../Tests/Fixtures/FooInterface.php | 11 + .../Tests/Fixtures/NotLoadableClass.php | 7 + .../var-dumper/Tests/Fixtures/Twig.php | 26 +- .../var-dumper/Tests/Fixtures/xml_reader.xml | 10 + .../var-dumper/Tests/HtmlDumperTest.php | 52 ++-- .../Tests/Test/VarDumperTestTraitTest.php | 3 +- .../var-dumper/Tests/VarClonerTest.php | 109 +++++++- .../includes/symfony/var-dumper/composer.json | 9 +- .../symfony/var-dumper/phpunit.xml.dist | 4 + 51 files changed, 2393 insertions(+), 585 deletions(-) create mode 100644 htdocs/includes/symfony/var-dumper/Caster/ArgsStub.php create mode 100644 htdocs/includes/symfony/var-dumper/Caster/ClassStub.php create mode 100644 htdocs/includes/symfony/var-dumper/Caster/LinkStub.php create mode 100644 htdocs/includes/symfony/var-dumper/Caster/RedisCaster.php create mode 100644 htdocs/includes/symfony/var-dumper/Caster/XmlReaderCaster.php create mode 100644 htdocs/includes/symfony/var-dumper/Tests/Caster/ExceptionCasterTest.php create mode 100644 htdocs/includes/symfony/var-dumper/Tests/Caster/RedisCasterTest.php create mode 100644 htdocs/includes/symfony/var-dumper/Tests/Caster/StubCasterTest.php create mode 100644 htdocs/includes/symfony/var-dumper/Tests/Caster/XmlReaderCasterTest.php create mode 100644 htdocs/includes/symfony/var-dumper/Tests/Fixtures/FooInterface.php create mode 100644 htdocs/includes/symfony/var-dumper/Tests/Fixtures/NotLoadableClass.php create mode 100644 htdocs/includes/symfony/var-dumper/Tests/Fixtures/xml_reader.xml diff --git a/composer.json b/composer.json index 130fda34945..8d82f530df8 100644 --- a/composer.json +++ b/composer.json @@ -35,7 +35,7 @@ "nnnick/chartjs" : "^2.9", "stripe/stripe-php" : "6.43.1", "maximebf/debugbar" : "1.15.1", - "symfony/var-dumper" : "3" + "symfony/var-dumper" : "3.2" }, "require-dev" : { "php-parallel-lint/php-parallel-lint" : "^0", diff --git a/composer.lock b/composer.lock index 3e867f8f186..5f761cb63fe 100644 --- a/composer.lock +++ b/composer.lock @@ -591,7 +591,7 @@ }, { "name": "symfony/var-dumper", - "version": "v3.0.0", + "version": "v3.2.0", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", @@ -616,7 +616,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.2-dev" } }, "autoload": { diff --git a/htdocs/includes/symfony/var-dumper/Caster/AmqpCaster.php b/htdocs/includes/symfony/var-dumper/Caster/AmqpCaster.php index 4e9b351c181..655262f4065 100644 --- a/htdocs/includes/symfony/var-dumper/Caster/AmqpCaster.php +++ b/htdocs/includes/symfony/var-dumper/Caster/AmqpCaster.php @@ -48,7 +48,16 @@ class AmqpCaster { $prefix = Caster::PREFIX_VIRTUAL; - // BC layer in the ampq lib + $a += array( + $prefix.'is_connected' => $c->isConnected(), + ); + + // Recent version of the extension already expose private properties + if (isset($a["\x00AMQPConnection\x00login"])) { + return $a; + } + + // BC layer in the amqp lib if (method_exists($c, 'getReadTimeout')) { $timeout = $c->getReadTimeout(); } else { @@ -56,13 +65,13 @@ class AmqpCaster } $a += array( - $prefix.'isConnected' => $c->isConnected(), + $prefix.'is_connected' => $c->isConnected(), $prefix.'login' => $c->getLogin(), $prefix.'password' => $c->getPassword(), $prefix.'host' => $c->getHost(), - $prefix.'port' => $c->getPort(), $prefix.'vhost' => $c->getVhost(), - $prefix.'readTimeout' => $timeout, + $prefix.'port' => $c->getPort(), + $prefix.'read_timeout' => $timeout, ); return $a; @@ -73,11 +82,19 @@ class AmqpCaster $prefix = Caster::PREFIX_VIRTUAL; $a += array( - $prefix.'isConnected' => $c->isConnected(), - $prefix.'channelId' => $c->getChannelId(), - $prefix.'prefetchSize' => $c->getPrefetchSize(), - $prefix.'prefetchCount' => $c->getPrefetchCount(), + $prefix.'is_connected' => $c->isConnected(), + $prefix.'channel_id' => $c->getChannelId(), + ); + + // Recent version of the extension already expose private properties + if (isset($a["\x00AMQPChannel\x00connection"])) { + return $a; + } + + $a += array( $prefix.'connection' => $c->getConnection(), + $prefix.'prefetch_size' => $c->getPrefetchSize(), + $prefix.'prefetch_count' => $c->getPrefetchCount(), ); return $a; @@ -88,11 +105,19 @@ class AmqpCaster $prefix = Caster::PREFIX_VIRTUAL; $a += array( - $prefix.'name' => $c->getName(), $prefix.'flags' => self::extractFlags($c->getFlags()), - $prefix.'arguments' => $c->getArguments(), + ); + + // Recent version of the extension already expose private properties + if (isset($a["\x00AMQPQueue\x00name"])) { + return $a; + } + + $a += array( $prefix.'connection' => $c->getConnection(), $prefix.'channel' => $c->getChannel(), + $prefix.'name' => $c->getName(), + $prefix.'arguments' => $c->getArguments(), ); return $a; @@ -103,12 +128,24 @@ class AmqpCaster $prefix = Caster::PREFIX_VIRTUAL; $a += array( - $prefix.'name' => $c->getName(), $prefix.'flags' => self::extractFlags($c->getFlags()), - $prefix.'type' => isset(self::$exchangeTypes[$c->getType()]) ? new ConstStub(self::$exchangeTypes[$c->getType()], $c->getType()) : $c->getType(), - $prefix.'arguments' => $c->getArguments(), - $prefix.'channel' => $c->getChannel(), + ); + + $type = isset(self::$exchangeTypes[$c->getType()]) ? new ConstStub(self::$exchangeTypes[$c->getType()], $c->getType()) : $c->getType(); + + // Recent version of the extension already expose private properties + if (isset($a["\x00AMQPExchange\x00name"])) { + $a["\x00AMQPExchange\x00type"] = $type; + + return $a; + } + + $a += array( $prefix.'connection' => $c->getConnection(), + $prefix.'channel' => $c->getChannel(), + $prefix.'name' => $c->getName(), + $prefix.'type' => $type, + $prefix.'arguments' => $c->getArguments(), ); return $a; @@ -118,28 +155,37 @@ class AmqpCaster { $prefix = Caster::PREFIX_VIRTUAL; + $deliveryMode = new ConstStub($c->getDeliveryMode().(2 === $c->getDeliveryMode() ? ' (persistent)' : ' (non-persistent)'), $c->getDeliveryMode()); + + // Recent version of the extension already expose private properties + if (isset($a["\x00AMQPEnvelope\x00body"])) { + $a["\0AMQPEnvelope\0delivery_mode"] = $deliveryMode; + + return $a; + } + if (!($filter & Caster::EXCLUDE_VERBOSE)) { $a += array($prefix.'body' => $c->getBody()); } $a += array( - $prefix.'routingKey' => $c->getRoutingKey(), - $prefix.'deliveryTag' => $c->getDeliveryTag(), - $prefix.'deliveryMode' => new ConstStub($c->getDeliveryMode().(2 === $c->getDeliveryMode() ? ' (persistent)' : ' (non-persistent)'), $c->getDeliveryMode()), - $prefix.'exchangeName' => $c->getExchangeName(), - $prefix.'isRedelivery' => $c->isRedelivery(), - $prefix.'contentType' => $c->getContentType(), - $prefix.'contentEncoding' => $c->getContentEncoding(), - $prefix.'type' => $c->getType(), - $prefix.'timestamp' => $c->getTimestamp(), - $prefix.'priority' => $c->getPriority(), - $prefix.'expiration' => $c->getExpiration(), - $prefix.'userId' => $c->getUserId(), - $prefix.'appId' => $c->getAppId(), - $prefix.'messageId' => $c->getMessageId(), - $prefix.'replyTo' => $c->getReplyTo(), - $prefix.'correlationId' => $c->getCorrelationId(), + $prefix.'delivery_tag' => $c->getDeliveryTag(), + $prefix.'is_redelivery' => $c->isRedelivery(), + $prefix.'exchange_name' => $c->getExchangeName(), + $prefix.'routing_key' => $c->getRoutingKey(), + $prefix.'content_type' => $c->getContentType(), + $prefix.'content_encoding' => $c->getContentEncoding(), $prefix.'headers' => $c->getHeaders(), + $prefix.'delivery_mode' => $deliveryMode, + $prefix.'priority' => $c->getPriority(), + $prefix.'correlation_id' => $c->getCorrelationId(), + $prefix.'reply_to' => $c->getReplyTo(), + $prefix.'expiration' => $c->getExpiration(), + $prefix.'message_id' => $c->getMessageId(), + $prefix.'timestamp' => $c->getTimeStamp(), + $prefix.'type' => $c->getType(), + $prefix.'user_id' => $c->getUserId(), + $prefix.'app_id' => $c->getAppId(), ); return $a; diff --git a/htdocs/includes/symfony/var-dumper/Caster/ArgsStub.php b/htdocs/includes/symfony/var-dumper/Caster/ArgsStub.php new file mode 100644 index 00000000000..6675caa0478 --- /dev/null +++ b/htdocs/includes/symfony/var-dumper/Caster/ArgsStub.php @@ -0,0 +1,80 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Caster; + +use Symfony\Component\VarDumper\Cloner\Stub; + +/** + * Represents a list of function arguments. + * + * @author Nicolas Grekas + */ +class ArgsStub extends EnumStub +{ + private static $parameters = array(); + + public function __construct(array $args, $function, $class) + { + list($variadic, $params) = self::getParameters($function, $class); + + $values = array(); + foreach ($args as $k => $v) { + $values[$k] = !is_scalar($v) && !$v instanceof Stub ? new CutStub($v) : $v; + } + if (null === $params) { + parent::__construct($values, false); + + return; + } + if (count($values) < count($params)) { + $params = array_slice($params, 0, count($values)); + } elseif (count($values) > count($params)) { + $values[] = new EnumStub(array_splice($values, count($params)), false); + $params[] = $variadic; + } + if (array('...') === $params) { + $this->dumpKeys = false; + $this->value = $values[0]->value; + } else { + $this->value = array_combine($params, $values); + } + } + + private static function getParameters($function, $class) + { + if (isset(self::$parameters[$k = $class.'::'.$function])) { + return self::$parameters[$k]; + } + + try { + $r = null !== $class ? new \ReflectionMethod($class, $function) : new \ReflectionFunction($function); + } catch (\ReflectionException $e) { + return array(null, null); + } + + $variadic = '...'; + $params = array(); + foreach ($r->getParameters() as $v) { + $k = '$'.$v->name; + if ($v->isPassedByReference()) { + $k = '&'.$k; + } + if (method_exists($v, 'isVariadic') && $v->isVariadic()) { + $variadic .= $k; + } else { + $params[] = $k; + } + } + + return self::$parameters[$k] = array($variadic, $params); + } +} diff --git a/htdocs/includes/symfony/var-dumper/Caster/Caster.php b/htdocs/includes/symfony/var-dumper/Caster/Caster.php index 23e72e87701..7c7fe00ece4 100644 --- a/htdocs/includes/symfony/var-dumper/Caster/Caster.php +++ b/htdocs/includes/symfony/var-dumper/Caster/Caster.php @@ -11,6 +11,8 @@ namespace Symfony\Component\VarDumper\Caster; +use Symfony\Component\VarDumper\Cloner\Stub; + /** * Helper for filtering out properties in casters. * @@ -36,29 +38,39 @@ class Caster /** * Casts objects to arrays and adds the dynamic property prefix. * - * @param object $obj The object to cast. - * @param \ReflectionClass $reflector The class reflector to use for inspecting the object definition. + * @param object $obj The object to cast + * @param \ReflectionClass $reflector The class reflector to use for inspecting the object definition * - * @return array The array-cast of the object, with prefixed dynamic properties. + * @return array The array-cast of the object, with prefixed dynamic properties */ public static function castObject($obj, \ReflectionClass $reflector) { if ($reflector->hasMethod('__debugInfo')) { $a = $obj->__debugInfo(); + } elseif ($obj instanceof \Closure) { + $a = array(); } else { $a = (array) $obj; } + if ($obj instanceof \__PHP_Incomplete_Class) { + return $a; + } if ($a) { + $combine = false; $p = array_keys($a); foreach ($p as $i => $k) { - if (!isset($k[0]) || ("\0" !== $k[0] && !$reflector->hasProperty($k))) { + if (isset($k[0]) ? "\0" !== $k[0] && !$reflector->hasProperty($k) : \PHP_VERSION_ID >= 70200) { + $combine = true; $p[$i] = self::PREFIX_DYNAMIC.$k; } elseif (isset($k[16]) && "\0" === $k[16] && 0 === strpos($k, "\0class@anonymous\0")) { + $combine = true; $p[$i] = "\0".$reflector->getParentClass().'@anonymous'.strrchr($k, "\0"); } } - $a = array_combine($p, $a); + if ($combine) { + $a = array_combine($p, $a); + } } return $a; @@ -70,14 +82,17 @@ class Caster * By default, a single match in the $filter bit field filters properties out, following an "or" logic. * When EXCLUDE_STRICT is set, an "and" logic is applied: all bits must match for a property to be removed. * - * @param array $a The array containing the properties to filter. - * @param int $filter A bit field of Caster::EXCLUDE_* constants specifying which properties to filter out. - * @param string[] $listedProperties List of properties to exclude when Caster::EXCLUDE_VERBOSE is set, and to preserve when Caster::EXCLUDE_NOT_IMPORTANT is set. + * @param array $a The array containing the properties to filter + * @param int $filter A bit field of Caster::EXCLUDE_* constants specifying which properties to filter out + * @param string[] $listedProperties List of properties to exclude when Caster::EXCLUDE_VERBOSE is set, and to preserve when Caster::EXCLUDE_NOT_IMPORTANT is set + * @param int &$count Set to the number of removed properties * * @return array The filtered array */ - public static function filter(array $a, $filter, array $listedProperties = array()) + public static function filter(array $a, $filter, array $listedProperties = array(), &$count = 0) { + $count = 0; + foreach ($a as $k => $v) { $type = self::EXCLUDE_STRICT & $filter; @@ -108,9 +123,20 @@ class Caster if ((self::EXCLUDE_STRICT & $filter) ? $type === $filter : $type) { unset($a[$k]); + ++$count; } } return $a; } + + public static function castPhpIncompleteClass(\__PHP_Incomplete_Class $c, array $a, Stub $stub, $isNested) + { + if (isset($a['__PHP_Incomplete_Class_Name'])) { + $stub->class .= '('.$a['__PHP_Incomplete_Class_Name'].')'; + unset($a['__PHP_Incomplete_Class_Name']); + } + + return $a; + } } diff --git a/htdocs/includes/symfony/var-dumper/Caster/ClassStub.php b/htdocs/includes/symfony/var-dumper/Caster/ClassStub.php new file mode 100644 index 00000000000..59efecda9eb --- /dev/null +++ b/htdocs/includes/symfony/var-dumper/Caster/ClassStub.php @@ -0,0 +1,87 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Caster; + +/** + * Represents a PHP class identifier. + * + * @author Nicolas Grekas + */ +class ClassStub extends ConstStub +{ + /** + * Constructor. + * + * @param string A PHP identifier, e.g. a class, method, interface, etc. name + * @param callable The callable targeted by the identifier when it is ambiguous or not a real PHP identifier + */ + public function __construct($identifier, $callable = null) + { + $this->value = $identifier; + + if (0 < $i = strrpos($identifier, '\\')) { + $this->attr['ellipsis'] = strlen($identifier) - $i; + } + + try { + if (null !== $callable) { + if ($callable instanceof \Closure) { + $r = new \ReflectionFunction($callable); + } elseif (is_object($callable)) { + $r = array($callable, '__invoke'); + } elseif (is_array($callable)) { + $r = $callable; + } elseif (false !== $i = strpos($callable, '::')) { + $r = array(substr($callable, 0, $i), substr($callable, 2 + $i)); + } else { + $r = new \ReflectionFunction($callable); + } + } elseif (false !== $i = strpos($identifier, '::')) { + $r = array(substr($identifier, 0, $i), substr($identifier, 2 + $i)); + } else { + $r = new \ReflectionClass($identifier); + } + + if (is_array($r)) { + try { + $r = new \ReflectionMethod($r[0], $r[1]); + } catch (\ReflectionException $e) { + $r = new \ReflectionClass($r[0]); + } + } + } catch (\ReflectionException $e) { + return; + } + + if ($f = $r->getFileName()) { + $this->attr['file'] = $f; + $this->attr['line'] = $r->getStartLine(); + } + } + + public static function wrapCallable($callable) + { + if (is_object($callable) || !is_callable($callable)) { + return $callable; + } + + if (!is_array($callable)) { + $callable = new static($callable); + } elseif (is_string($callable[0])) { + $callable[0] = new static($callable[0]); + } else { + $callable[1] = new static($callable[1], $callable); + } + + return $callable; + } +} diff --git a/htdocs/includes/symfony/var-dumper/Caster/ConstStub.php b/htdocs/includes/symfony/var-dumper/Caster/ConstStub.php index f20e03cdf0d..26c0010b66a 100644 --- a/htdocs/includes/symfony/var-dumper/Caster/ConstStub.php +++ b/htdocs/includes/symfony/var-dumper/Caster/ConstStub.php @@ -25,4 +25,9 @@ class ConstStub extends Stub $this->class = $name; $this->value = $value; } + + public function __toString() + { + return (string) $this->value; + } } diff --git a/htdocs/includes/symfony/var-dumper/Caster/CutStub.php b/htdocs/includes/symfony/var-dumper/Caster/CutStub.php index 8781f5cf3c6..61140eb361d 100644 --- a/htdocs/includes/symfony/var-dumper/Caster/CutStub.php +++ b/htdocs/includes/symfony/var-dumper/Caster/CutStub.php @@ -39,9 +39,12 @@ class CutStub extends Stub case 'resource': case 'unknown type': + case 'resource (closed)': $this->type = self::TYPE_RESOURCE; $this->handle = (int) $value; - $this->class = @get_resource_type($value); + if ('Unknown' === $this->class = @get_resource_type($value)) { + $this->class = 'Closed'; + } $this->cut = -1; break; diff --git a/htdocs/includes/symfony/var-dumper/Caster/DOMCaster.php b/htdocs/includes/symfony/var-dumper/Caster/DOMCaster.php index e04cf9534b3..3a99865370c 100644 --- a/htdocs/includes/symfony/var-dumper/Caster/DOMCaster.php +++ b/htdocs/includes/symfony/var-dumper/Caster/DOMCaster.php @@ -107,7 +107,7 @@ class DOMCaster 'namespaceURI' => $dom->namespaceURI, 'prefix' => $dom->prefix, 'localName' => $dom->localName, - 'baseURI' => $dom->baseURI, + 'baseURI' => $dom->baseURI ? new LinkStub($dom->baseURI) : $dom->baseURI, 'textContent' => new CutStub($dom->textContent), ); @@ -144,7 +144,7 @@ class DOMCaster 'version' => $dom->version, 'xmlVersion' => $dom->xmlVersion, 'strictErrorChecking' => $dom->strictErrorChecking, - 'documentURI' => $dom->documentURI, + 'documentURI' => $dom->documentURI ? new LinkStub($dom->documentURI) : $dom->documentURI, 'config' => $dom->config, 'formatOutput' => $dom->formatOutput, 'validateOnParse' => $dom->validateOnParse, @@ -237,7 +237,7 @@ class DOMCaster 'columnNumber' => $dom->columnNumber, 'offset' => $dom->offset, 'relatedNode' => $dom->relatedNode, - 'uri' => $dom->uri, + 'uri' => $dom->uri ? new LinkStub($dom->uri, $dom->lineNumber) : $dom->uri, ); return $a; diff --git a/htdocs/includes/symfony/var-dumper/Caster/EnumStub.php b/htdocs/includes/symfony/var-dumper/Caster/EnumStub.php index 67bb2e16390..3cee23eac20 100644 --- a/htdocs/includes/symfony/var-dumper/Caster/EnumStub.php +++ b/htdocs/includes/symfony/var-dumper/Caster/EnumStub.php @@ -20,8 +20,11 @@ use Symfony\Component\VarDumper\Cloner\Stub; */ class EnumStub extends Stub { - public function __construct(array $values) + public $dumpKeys = true; + + public function __construct(array $values, $dumpKeys = true) { $this->value = $values; + $this->dumpKeys = $dumpKeys; } } diff --git a/htdocs/includes/symfony/var-dumper/Caster/ExceptionCaster.php b/htdocs/includes/symfony/var-dumper/Caster/ExceptionCaster.php index a5a8773e859..8c84137e646 100644 --- a/htdocs/includes/symfony/var-dumper/Caster/ExceptionCaster.php +++ b/htdocs/includes/symfony/var-dumper/Caster/ExceptionCaster.php @@ -41,6 +41,8 @@ class ExceptionCaster E_STRICT => 'E_STRICT', ); + private static $framesCache = array(); + public static function castError(\Error $e, array $a, Stub $stub, $isNested, $filter = 0) { return self::filterExceptionArray($stub->class, $a, "\0Error\0", $filter); @@ -65,13 +67,9 @@ class ExceptionCaster $prefix = Caster::PREFIX_PROTECTED; $xPrefix = "\0Exception\0"; - if (isset($a[$xPrefix.'previous'], $a[$xPrefix.'trace'])) { + if (isset($a[$xPrefix.'previous'], $a[$xPrefix.'trace']) && $a[$xPrefix.'previous'] instanceof \Exception) { $b = (array) $a[$xPrefix.'previous']; - array_unshift($b[$xPrefix.'trace'], array( - 'function' => 'new '.get_class($a[$xPrefix.'previous']), - 'file' => $b[$prefix.'file'], - 'line' => $b[$prefix.'line'], - )); + self::traceUnshift($b[$xPrefix.'trace'], get_class($a[$xPrefix.'previous']), $b[$prefix.'file'], $b[$prefix.'line']); $a[$xPrefix.'trace'] = new TraceStub($b[$xPrefix.'trace'], false, 0, -1 - count($a[$xPrefix.'trace']->value)); } @@ -88,6 +86,7 @@ class ExceptionCaster $stub->class = ''; $stub->handle = 0; $frames = $trace->value; + $prefix = Caster::PREFIX_VIRTUAL; $a = array(); $j = count($frames); @@ -97,34 +96,38 @@ class ExceptionCaster if (!isset($trace->value[$i])) { return array(); } - $lastCall = isset($frames[$i]['function']) ? ' ==> '.(isset($frames[$i]['class']) ? $frames[0]['class'].$frames[$i]['type'] : '').$frames[$i]['function'].'()' : ''; + $lastCall = isset($frames[$i]['function']) ? (isset($frames[$i]['class']) ? $frames[0]['class'].$frames[$i]['type'] : '').$frames[$i]['function'].'()' : ''; + $frames[] = array('function' => ''); for ($j += $trace->numberingOffset - $i++; isset($frames[$i]); ++$i, --$j) { - $call = isset($frames[$i]['function']) ? (isset($frames[$i]['class']) ? $frames[$i]['class'].$frames[$i]['type'] : '').$frames[$i]['function'].'()' : '???'; + $f = $frames[$i]; + $call = isset($f['function']) ? (isset($f['class']) ? $f['class'].$f['type'] : '').$f['function'].'()' : '???'; - $a[Caster::PREFIX_VIRTUAL.$j.'. '.$call.$lastCall] = new FrameStub( + $label = substr_replace($prefix, "title=Stack level $j.", 2, 0).$lastCall; + $frame = new FrameStub( array( - 'object' => isset($frames[$i]['object']) ? $frames[$i]['object'] : null, - 'class' => isset($frames[$i]['class']) ? $frames[$i]['class'] : null, - 'type' => isset($frames[$i]['type']) ? $frames[$i]['type'] : null, - 'function' => isset($frames[$i]['function']) ? $frames[$i]['function'] : null, + 'object' => isset($f['object']) ? $f['object'] : null, + 'class' => isset($f['class']) ? $f['class'] : null, + 'type' => isset($f['type']) ? $f['type'] : null, + 'function' => isset($f['function']) ? $f['function'] : null, ) + $frames[$i - 1], - $trace->keepArgs, + false, true ); + $f = self::castFrameStub($frame, array(), $frame, true); + if (isset($f[$prefix.'src'])) { + foreach ($f[$prefix.'src']->value as $label => $frame) { + $label = substr_replace($label, "title=Stack level $j.&", 2, 0); + } + $f = $frames[$i - 1]; + if ($trace->keepArgs && !empty($f['args']) && $frame instanceof EnumStub) { + $frame->value['arguments'] = new ArgsStub($f['args'], isset($f['function']) ? $f['function'] : null, isset($f['class']) ? $f['class'] : null); + } + } + $a[$label] = $frame; - $lastCall = ' ==> '.$call; + $lastCall = $call; } - $a[Caster::PREFIX_VIRTUAL.$j.'. {main}'.$lastCall] = new FrameStub( - array( - 'object' => null, - 'class' => null, - 'type' => null, - 'function' => '{main}', - ) + $frames[$i - 1], - $trace->keepArgs, - true - ); if (null !== $trace->sliceLength) { $a = array_slice($a, 0, $trace->sliceLength, true); } @@ -141,30 +144,52 @@ class ExceptionCaster $prefix = Caster::PREFIX_VIRTUAL; if (isset($f['file'], $f['line'])) { - if (preg_match('/\((\d+)\)(?:\([\da-f]{32}\))? : (?:eval\(\)\'d code|runtime-created function)$/', $f['file'], $match)) { - $f['file'] = substr($f['file'], 0, -strlen($match[0])); - $f['line'] = (int) $match[1]; - } - if (file_exists($f['file']) && 0 <= self::$srcContext) { - $src[$f['file'].':'.$f['line']] = self::extractSource(explode("\n", file_get_contents($f['file'])), $f['line'], self::$srcContext); + $cacheKey = $f; + unset($cacheKey['object'], $cacheKey['args']); + $cacheKey[] = self::$srcContext; + $cacheKey = implode('-', $cacheKey); - if (!empty($f['class']) && is_subclass_of($f['class'], 'Twig_Template') && method_exists($f['class'], 'getDebugInfo')) { - $template = isset($f['object']) ? $f['object'] : new $f['class'](new \Twig_Environment(new \Twig_Loader_Filesystem())); + if (isset(self::$framesCache[$cacheKey])) { + $a[$prefix.'src'] = self::$framesCache[$cacheKey]; + } else { + if (preg_match('/\((\d+)\)(?:\([\da-f]{32}\))? : (?:eval\(\)\'d code|runtime-created function)$/', $f['file'], $match)) { + $f['file'] = substr($f['file'], 0, -strlen($match[0])); + $f['line'] = (int) $match[1]; + } + $caller = isset($f['function']) ? sprintf('in %s() on line %d', (isset($f['class']) ? $f['class'].$f['type'] : '').$f['function'], $f['line']) : null; + $src = $f['line']; + $srcKey = $f['file']; + $ellipsis = explode(DIRECTORY_SEPARATOR, $srcKey); + $ellipsis = 3 < count($ellipsis) ? 2 + strlen(implode(array_slice($ellipsis, -2))) : 0; - try { - $templateName = $template->getTemplateName(); - $templateSrc = explode("\n", method_exists($template, 'getSource') ? $template->getSource() : $template->getEnvironment()->getLoader()->getSource($templateName)); + if (file_exists($f['file']) && 0 <= self::$srcContext) { + if (!empty($f['class']) && (is_subclass_of($f['class'], 'Twig\Template') || is_subclass_of($f['class'], 'Twig_Template')) && method_exists($f['class'], 'getDebugInfo')) { + $template = isset($f['object']) ? $f['object'] : unserialize(sprintf('O:%d:"%s":0:{}', strlen($f['class']), $f['class'])); + + $ellipsis = 0; + $templateSrc = method_exists($template, 'getSourceContext') ? $template->getSourceContext()->getCode() : (method_exists($template, 'getSource') ? $template->getSource() : ''); $templateInfo = $template->getDebugInfo(); if (isset($templateInfo[$f['line']])) { - $src[$templateName.':'.$templateInfo[$f['line']]] = self::extractSource($templateSrc, $templateInfo[$f['line']], self::$srcContext); + if (!method_exists($template, 'getSourceContext') || !file_exists($templatePath = $template->getSourceContext()->getPath())) { + $templatePath = null; + } + if ($templateSrc) { + $src = self::extractSource($templateSrc, $templateInfo[$f['line']], self::$srcContext, $caller, 'twig', $templatePath); + $srcKey = ($templatePath ?: $template->getTemplateName()).':'.$templateInfo[$f['line']]; + } + } + } + if ($srcKey == $f['file']) { + $src = self::extractSource(file_get_contents($f['file']), $f['line'], self::$srcContext, $caller, 'php', $f['file']); + $srcKey .= ':'.$f['line']; + if ($ellipsis) { + $ellipsis += 1 + strlen($f['line']); } - } catch (\Twig_Error_Loader $e) { } } - } else { - $src[$f['file']] = $f['line']; + $srcAttr = $ellipsis ? 'ellipsis='.$ellipsis : ''; + self::$framesCache[$cacheKey] = $a[$prefix.'src'] = new EnumStub(array("\0~$srcAttr\0$srcKey" => $src)); } - $a[$prefix.'src'] = new EnumStub($src); } unset($a[$prefix.'args'], $a[$prefix.'line'], $a[$prefix.'file']); @@ -176,8 +201,8 @@ class ExceptionCaster unset($a[$k]); } } - if ($frame->keepArgs && isset($f['args'])) { - $a[$prefix.'args'] = $f['args']; + if ($frame->keepArgs && !empty($f['args'])) { + $a[$prefix.'arguments'] = new ArgsStub($f['args'], $f['function'], $f['class']); } return $a; @@ -193,46 +218,81 @@ class ExceptionCaster } if (!($filter & Caster::EXCLUDE_VERBOSE)) { - array_unshift($trace, array( - 'function' => $xClass ? 'new '.$xClass : null, - 'file' => $a[Caster::PREFIX_PROTECTED.'file'], - 'line' => $a[Caster::PREFIX_PROTECTED.'line'], - )); - $a[$xPrefix.'trace'] = new TraceStub($trace); + if (isset($a[Caster::PREFIX_PROTECTED.'file'], $a[Caster::PREFIX_PROTECTED.'line'])) { + self::traceUnshift($trace, $xClass, $a[Caster::PREFIX_PROTECTED.'file'], $a[Caster::PREFIX_PROTECTED.'line']); + } + $a[$xPrefix.'trace'] = new TraceStub($trace, self::$traceArgs); } if (empty($a[$xPrefix.'previous'])) { unset($a[$xPrefix.'previous']); } unset($a[$xPrefix.'string'], $a[Caster::PREFIX_DYNAMIC.'xdebug_message'], $a[Caster::PREFIX_DYNAMIC.'__destructorException']); + if (isset($a[Caster::PREFIX_PROTECTED.'file'], $a[Caster::PREFIX_PROTECTED.'line'])) { + $a[Caster::PREFIX_PROTECTED.'file'] = new LinkStub($a[Caster::PREFIX_PROTECTED.'file'], $a[Caster::PREFIX_PROTECTED.'line']); + } + return $a; } - private static function extractSource(array $srcArray, $line, $srcContext) + private static function traceUnshift(&$trace, $class, $file, $line) { + if (isset($trace[0]['file'], $trace[0]['line']) && $trace[0]['file'] === $file && $trace[0]['line'] === $line) { + return; + } + array_unshift($trace, array( + 'function' => $class ? 'new '.$class : null, + 'file' => $file, + 'line' => $line, + )); + } + + private static function extractSource($srcLines, $line, $srcContext, $title, $lang, $file = null) + { + $srcLines = explode("\n", $srcLines); $src = array(); for ($i = $line - 1 - $srcContext; $i <= $line - 1 + $srcContext; ++$i) { - $src[] = (isset($srcArray[$i]) ? $srcArray[$i] : '')."\n"; + $src[] = (isset($srcLines[$i]) ? $srcLines[$i] : '')."\n"; } + $srcLines = array(); $ltrim = 0; - while (' ' === $src[0][$ltrim] || "\t" === $src[0][$ltrim]) { - $i = $srcContext << 1; - while ($i > 0 && $src[0][$ltrim] === $src[$i][$ltrim]) { - --$i; - } - if ($i) { - break; + do { + $pad = null; + for ($i = $srcContext << 1; $i >= 0; --$i) { + if (isset($src[$i][$ltrim]) && "\r" !== ($c = $src[$i][$ltrim]) && "\n" !== $c) { + if (null === $pad) { + $pad = $c; + } + if ((' ' !== $c && "\t" !== $c) || $pad !== $c) { + break; + } + } } ++$ltrim; - } - if ($ltrim) { - foreach ($src as $i => $line) { - $src[$i] = substr($line, $ltrim); + } while (0 > $i && null !== $pad); + + --$ltrim; + + foreach ($src as $i => $c) { + if ($ltrim) { + $c = isset($c[$ltrim]) && "\r" !== $c[$ltrim] ? substr($c, $ltrim) : ltrim($c, " \t"); } + $c = substr($c, 0, -1); + if ($i !== $srcContext) { + $c = new ConstStub('default', $c); + } else { + $c = new ConstStub($c, $title); + if (null !== $file) { + $c->attr['file'] = $file; + $c->attr['line'] = $line; + } + } + $c->attr['lang'] = $lang; + $srcLines[sprintf("\0~%d\0", $i + $line - $srcContext)] = $c; } - return implode('', $src); + return new EnumStub($srcLines); } } diff --git a/htdocs/includes/symfony/var-dumper/Caster/LinkStub.php b/htdocs/includes/symfony/var-dumper/Caster/LinkStub.php new file mode 100644 index 00000000000..ea39c5b08ee --- /dev/null +++ b/htdocs/includes/symfony/var-dumper/Caster/LinkStub.php @@ -0,0 +1,51 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Caster; + +/** + * Represents a file or a URL. + * + * @author Nicolas Grekas + */ +class LinkStub extends ConstStub +{ + public function __construct($label, $line = 0, $href = null) + { + $this->value = $label; + + if (null === $href) { + $href = $label; + } + if (is_string($href)) { + if (0 === strpos($href, 'file://')) { + if ($href === $label) { + $label = substr($label, 7); + } + $href = substr($href, 7); + } elseif (false !== strpos($href, '://')) { + $this->attr['href'] = $href; + + return; + } + if (file_exists($href)) { + if ($line) { + $this->attr['line'] = $line; + } + $this->attr['file'] = realpath($href) ?: $href; + + if ($this->attr['file'] === $label && 3 < count($ellipsis = explode(DIRECTORY_SEPARATOR, $href))) { + $this->attr['ellipsis'] = 2 + strlen(implode(array_slice($ellipsis, -2))); + } + } + } + } +} diff --git a/htdocs/includes/symfony/var-dumper/Caster/PdoCaster.php b/htdocs/includes/symfony/var-dumper/Caster/PdoCaster.php index e60b9275fd8..b8667824773 100644 --- a/htdocs/includes/symfony/var-dumper/Caster/PdoCaster.php +++ b/htdocs/includes/symfony/var-dumper/Caster/PdoCaster.php @@ -77,6 +77,12 @@ class PdoCaster } catch (\Exception $e) { } } + if (isset($attr[$k = 'STATEMENT_CLASS'][1])) { + if ($attr[$k][1]) { + $attr[$k][1] = new ArgsStub($attr[$k][1], '__construct', $attr[$k][0]); + } + $attr[$k][0] = new ClassStub($attr[$k][0]); + } $prefix = Caster::PREFIX_VIRTUAL; $a += array( diff --git a/htdocs/includes/symfony/var-dumper/Caster/RedisCaster.php b/htdocs/includes/symfony/var-dumper/Caster/RedisCaster.php new file mode 100644 index 00000000000..07a3a1b0911 --- /dev/null +++ b/htdocs/includes/symfony/var-dumper/Caster/RedisCaster.php @@ -0,0 +1,77 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Caster; + +use Symfony\Component\VarDumper\Cloner\Stub; + +/** + * Casts Redis class from ext-redis to array representation. + * + * @author Nicolas Grekas + */ +class RedisCaster +{ + private static $serializer = array( + \Redis::SERIALIZER_NONE => 'NONE', + \Redis::SERIALIZER_PHP => 'PHP', + 2 => 'IGBINARY', // Optional Redis::SERIALIZER_IGBINARY + ); + + public static function castRedis(\Redis $c, array $a, Stub $stub, $isNested) + { + $prefix = Caster::PREFIX_VIRTUAL; + + if (defined('HHVM_VERSION_ID')) { + if (isset($a[Caster::PREFIX_PROTECTED.'serializer'])) { + $ser = $a[Caster::PREFIX_PROTECTED.'serializer']; + $a[Caster::PREFIX_PROTECTED.'serializer'] = isset(self::$serializer[$ser]) ? new ConstStub(self::$serializer[$ser], $ser) : $ser; + } + + return $a; + } + + if (!$connected = $c->isConnected()) { + return $a + array( + $prefix.'isConnected' => $connected, + ); + } + + $ser = $c->getOption(\Redis::OPT_SERIALIZER); + $retry = defined('Redis::OPT_SCAN') ? $c->getOption(\Redis::OPT_SCAN) : 0; + + return $a + array( + $prefix.'isConnected' => $connected, + $prefix.'host' => $c->getHost(), + $prefix.'port' => $c->getPort(), + $prefix.'auth' => $c->getAuth(), + $prefix.'dbNum' => $c->getDbNum(), + $prefix.'timeout' => $c->getTimeout(), + $prefix.'persistentId' => $c->getPersistentID(), + $prefix.'options' => new EnumStub(array( + 'READ_TIMEOUT' => $c->getOption(\Redis::OPT_READ_TIMEOUT), + 'SERIALIZER' => isset(self::$serializer[$ser]) ? new ConstStub(self::$serializer[$ser], $ser) : $ser, + 'PREFIX' => $c->getOption(\Redis::OPT_PREFIX), + 'SCAN' => new ConstStub($retry ? 'RETRY' : 'NORETRY', $retry), + )), + ); + } + + public static function castRedisArray(\RedisArray $c, array $a, Stub $stub, $isNested) + { + $prefix = Caster::PREFIX_VIRTUAL; + + return $a + array( + $prefix.'hosts' => $c->_hosts(), + $prefix.'function' => ClassStub::wrapCallable($c->_function()), + ); + } +} diff --git a/htdocs/includes/symfony/var-dumper/Caster/ReflectionCaster.php b/htdocs/includes/symfony/var-dumper/Caster/ReflectionCaster.php index 936e11982ee..dcb5a2f29ca 100644 --- a/htdocs/includes/symfony/var-dumper/Caster/ReflectionCaster.php +++ b/htdocs/includes/symfony/var-dumper/Caster/ReflectionCaster.php @@ -53,19 +53,32 @@ class ReflectionCaster } if ($f = $c->getFileName()) { - $a[$prefix.'file'] = $f; + $a[$prefix.'file'] = new LinkStub($f, $c->getStartLine()); $a[$prefix.'line'] = $c->getStartLine().' to '.$c->getEndLine(); } $prefix = Caster::PREFIX_DYNAMIC; - unset($a['name'], $a[$prefix.'0'], $a[$prefix.'this'], $a[$prefix.'parameter'], $a[Caster::PREFIX_VIRTUAL.'extra']); + unset($a['name'], $a[$prefix.'this'], $a[$prefix.'parameter'], $a[Caster::PREFIX_VIRTUAL.'extra']); return $a; } public static function castGenerator(\Generator $c, array $a, Stub $stub, $isNested) { - return class_exists('ReflectionGenerator', false) ? self::castReflectionGenerator(new \ReflectionGenerator($c), $a, $stub, $isNested) : $a; + if (!class_exists('ReflectionGenerator', false)) { + return $a; + } + + // Cannot create ReflectionGenerator based on a terminated Generator + try { + $reflectionGenerator = new \ReflectionGenerator($c); + } catch (\Exception $e) { + $a[Caster::PREFIX_VIRTUAL.'closed'] = true; + + return $a; + } + + return self::castReflectionGenerator($reflectionGenerator, $a, $stub, $isNested); } public static function castType(\ReflectionType $c, array $a, Stub $stub, $isNested) @@ -73,7 +86,7 @@ class ReflectionCaster $prefix = Caster::PREFIX_VIRTUAL; $a += array( - $prefix.'type' => $c->__toString(), + $prefix.'name' => $c instanceof \ReflectionNamedType ? $c->getName() : $c->__toString(), $prefix.'allowsNull' => $c->allowsNull(), $prefix.'isBuiltin' => $c->isBuiltin(), ); @@ -88,31 +101,33 @@ class ReflectionCaster if ($c->getThis()) { $a[$prefix.'this'] = new CutStub($c->getThis()); } - $x = $c->getFunction(); + $function = $c->getFunction(); $frame = array( - 'class' => isset($x->class) ? $x->class : null, - 'type' => isset($x->class) ? ($x->isStatic() ? '::' : '->') : null, - 'function' => $x->name, + 'class' => isset($function->class) ? $function->class : null, + 'type' => isset($function->class) ? ($function->isStatic() ? '::' : '->') : null, + 'function' => $function->name, 'file' => $c->getExecutingFile(), 'line' => $c->getExecutingLine(), ); if ($trace = $c->getTrace(DEBUG_BACKTRACE_IGNORE_ARGS)) { - $x = new \ReflectionGenerator($c->getExecutingGenerator()); + $function = new \ReflectionGenerator($c->getExecutingGenerator()); array_unshift($trace, array( 'function' => 'yield', - 'file' => $x->getExecutingFile(), - 'line' => $x->getExecutingLine() - 1, + 'file' => $function->getExecutingFile(), + 'line' => $function->getExecutingLine() - 1, )); $trace[] = $frame; $a[$prefix.'trace'] = new TraceStub($trace, false, 0, -1, -1); } else { - $x = new FrameStub($frame, false, true); - $x = ExceptionCaster::castFrameStub($x, array(), $x, true); + $function = new FrameStub($frame, false, true); + $function = ExceptionCaster::castFrameStub($function, array(), $function, true); $a[$prefix.'executing'] = new EnumStub(array( - $frame['class'].$frame['type'].$frame['function'].'()' => $x[$prefix.'src'], + $frame['class'].$frame['type'].$frame['function'].'()' => $function[$prefix.'src'], )); } + $a[Caster::PREFIX_VIRTUAL.'closed'] = false; + return $a; } @@ -157,7 +172,12 @@ class ReflectionCaster )); if (isset($a[$prefix.'returnType'])) { - $a[$prefix.'returnType'] = (string) $a[$prefix.'returnType']; + $v = $a[$prefix.'returnType']; + $v = $v instanceof \ReflectionNamedType ? $v->getName() : $v->__toString(); + $a[$prefix.'returnType'] = new ClassStub($a[$prefix.'returnType']->allowsNull() ? '?'.$v : $v, array(class_exists($v, false) || interface_exists($v, false) || trait_exists($v, false) ? $v : '', '')); + } + if (isset($a[$prefix.'class'])) { + $a[$prefix.'class'] = new ClassStub($a[$prefix.'class']); } if (isset($a[$prefix.'this'])) { $a[$prefix.'this'] = new CutStub($a[$prefix.'this']); @@ -165,12 +185,12 @@ class ReflectionCaster foreach ($c->getParameters() as $v) { $k = '$'.$v->name; - if ($v->isPassedByReference()) { - $k = '&'.$k; - } if (method_exists($v, 'isVariadic') && $v->isVariadic()) { $k = '...'.$k; } + if ($v->isPassedByReference()) { + $k = '&'.$k; + } $a[$prefix.'parameters'][$k] = $v; } if (isset($a[$prefix.'parameters'])) { @@ -213,24 +233,22 @@ class ReflectionCaster 'position' => 'getPosition', 'isVariadic' => 'isVariadic', 'byReference' => 'isPassedByReference', + 'allowsNull' => 'allowsNull', )); - try { - if (method_exists($c, 'hasType')) { - if ($c->hasType()) { - $a[$prefix.'typeHint'] = $c->getType()->__toString(); - } - } elseif ($c->isArray()) { - $a[$prefix.'typeHint'] = 'array'; - } elseif (method_exists($c, 'isCallable') && $c->isCallable()) { - $a[$prefix.'typeHint'] = 'callable'; - } elseif ($v = $c->getClass()) { - $a[$prefix.'typeHint'] = $v->name; - } - } catch (\ReflectionException $e) { - if (preg_match('/^Class ([^ ]++) does not exist$/', $e->getMessage(), $m)) { - $a[$prefix.'typeHint'] = $m[1]; + if (method_exists($c, 'getType')) { + if ($v = $c->getType()) { + $a[$prefix.'typeHint'] = $v instanceof \ReflectionNamedType ? $v->getName() : $v->__toString(); } + } elseif (preg_match('/^(?:[^ ]++ ){4}([a-zA-Z_\x7F-\xFF][^ ]++)/', $c, $v)) { + $a[$prefix.'typeHint'] = $v[1]; + } + + if (isset($a[$prefix.'typeHint'])) { + $v = $a[$prefix.'typeHint']; + $a[$prefix.'typeHint'] = new ClassStub($v, array(class_exists($v, false) || interface_exists($v, false) || trait_exists($v, false) ? $v : '', '')); + } else { + unset($a[$prefix.'allowsNull']); } try { @@ -238,9 +256,13 @@ class ReflectionCaster if (method_exists($c, 'isDefaultValueConstant') && $c->isDefaultValueConstant()) { $a[$prefix.'default'] = new ConstStub($c->getDefaultValueConstantName(), $v); } + if (null === $v) { + unset($a[$prefix.'allowsNull']); + } } catch (\ReflectionException $e) { - if (isset($a[$prefix.'typeHint']) && $c->allowsNull()) { + if (isset($a[$prefix.'typeHint']) && $c->allowsNull() && !class_exists('ReflectionNamedType', false)) { $a[$prefix.'default'] = null; + unset($a[$prefix.'allowsNull']); } } @@ -288,7 +310,7 @@ class ReflectionCaster $x = isset($a[Caster::PREFIX_VIRTUAL.'extra']) ? $a[Caster::PREFIX_VIRTUAL.'extra']->value : array(); if (method_exists($c, 'getFileName') && $m = $c->getFileName()) { - $x['file'] = $m; + $x['file'] = new LinkStub($m, $c->getStartLine()); $x['line'] = $c->getStartLine().' to '.$c->getEndLine(); } diff --git a/htdocs/includes/symfony/var-dumper/Caster/ResourceCaster.php b/htdocs/includes/symfony/var-dumper/Caster/ResourceCaster.php index 903641f69c6..3cdb27c3087 100644 --- a/htdocs/includes/symfony/var-dumper/Caster/ResourceCaster.php +++ b/htdocs/includes/symfony/var-dumper/Caster/ResourceCaster.php @@ -40,12 +40,17 @@ class ResourceCaster public static function castStream($stream, array $a, Stub $stub, $isNested) { - return stream_get_meta_data($stream) + static::castStreamContext($stream, $a, $stub, $isNested); + $a = stream_get_meta_data($stream) + static::castStreamContext($stream, $a, $stub, $isNested); + if (isset($a['uri'])) { + $a['uri'] = new LinkStub($a['uri']); + } + + return $a; } public static function castStreamContext($stream, array $a, Stub $stub, $isNested) { - return stream_context_get_params($stream); + return @stream_context_get_params($stream) ?: $a; } public static function castGd($gd, array $a, Stub $stub, $isNested) diff --git a/htdocs/includes/symfony/var-dumper/Caster/SplCaster.php b/htdocs/includes/symfony/var-dumper/Caster/SplCaster.php index 97f21463821..4f23efa52d2 100644 --- a/htdocs/includes/symfony/var-dumper/Caster/SplCaster.php +++ b/htdocs/includes/symfony/var-dumper/Caster/SplCaster.php @@ -36,7 +36,7 @@ class SplCaster $b = array( $prefix.'flag::STD_PROP_LIST' => (bool) ($flags & \ArrayObject::STD_PROP_LIST), $prefix.'flag::ARRAY_AS_PROPS' => (bool) ($flags & \ArrayObject::ARRAY_AS_PROPS), - $prefix.'iteratorClass' => $c->getIteratorClass(), + $prefix.'iteratorClass' => new ClassStub($c->getIteratorClass()), $prefix.'storage' => $c->getArrayCopy(), ); @@ -71,7 +71,7 @@ class SplCaster $c->setIteratorMode(\SplDoublyLinkedList::IT_MODE_KEEP | $mode & ~\SplDoublyLinkedList::IT_MODE_DELETE); $a += array( - $prefix.'mode' => new ConstStub((($mode & \SplDoublyLinkedList::IT_MODE_LIFO) ? 'IT_MODE_LIFO' : 'IT_MODE_FIFO').' | '.(($mode & \SplDoublyLinkedList::IT_MODE_KEEP) ? 'IT_MODE_KEEP' : 'IT_MODE_DELETE'), $mode), + $prefix.'mode' => new ConstStub((($mode & \SplDoublyLinkedList::IT_MODE_LIFO) ? 'IT_MODE_LIFO' : 'IT_MODE_FIFO').' | '.(($mode & \SplDoublyLinkedList::IT_MODE_DELETE) ? 'IT_MODE_DELETE' : 'IT_MODE_KEEP'), $mode), $prefix.'dllist' => iterator_to_array($c), ); $c->setIteratorMode($mode); @@ -115,6 +115,10 @@ class SplCaster } } + if (isset($a[$prefix.'realPath'])) { + $a[$prefix.'realPath'] = new LinkStub($a[$prefix.'realPath']); + } + if (isset($a[$prefix.'perms'])) { $a[$prefix.'perms'] = new ConstStub(sprintf('0%o', $a[$prefix.'perms']), $a[$prefix.'perms']); } @@ -180,7 +184,7 @@ class SplCaster $storage = array(); unset($a[Caster::PREFIX_DYNAMIC."\0gcdata"]); // Don't hit https://bugs.php.net/65967 - foreach ($c as $obj) { + foreach (clone $c as $obj) { $storage[spl_object_hash($obj)] = array( 'object' => $obj, 'info' => $c->getInfo(), diff --git a/htdocs/includes/symfony/var-dumper/Caster/StubCaster.php b/htdocs/includes/symfony/var-dumper/Caster/StubCaster.php index ebad5ba9844..2ec096c5a8c 100644 --- a/htdocs/includes/symfony/var-dumper/Caster/StubCaster.php +++ b/htdocs/includes/symfony/var-dumper/Caster/StubCaster.php @@ -28,9 +28,17 @@ class StubCaster $stub->value = $c->value; $stub->handle = $c->handle; $stub->cut = $c->cut; + $stub->attr = $c->attr; - return array(); + if (Stub::TYPE_REF === $c->type && !$c->class && is_string($c->value) && !preg_match('//u', $c->value)) { + $stub->type = Stub::TYPE_STRING; + $stub->class = Stub::STRING_BINARY; + } + + $a = array(); } + + return $a; } public static function castCutArray(CutArrayStub $c, array $a, Stub $stub, $isNested) @@ -52,15 +60,17 @@ class StubCaster public static function castEnum(EnumStub $c, array $a, Stub $stub, $isNested) { if ($isNested) { - $stub->class = ''; + $stub->class = $c->dumpKeys ? '' : null; $stub->handle = 0; $stub->value = null; + $stub->cut = $c->cut; + $stub->attr = $c->attr; $a = array(); if ($c->value) { foreach (array_keys($c->value) as $k) { - $keys[] = Caster::PREFIX_VIRTUAL.$k; + $keys[] = !isset($k[0]) || "\0" !== $k[0] ? Caster::PREFIX_VIRTUAL.$k : $k; } // Preserve references with array_combine() $a = array_combine($keys, $c->value); diff --git a/htdocs/includes/symfony/var-dumper/Caster/XmlReaderCaster.php b/htdocs/includes/symfony/var-dumper/Caster/XmlReaderCaster.php new file mode 100644 index 00000000000..c371009a17a --- /dev/null +++ b/htdocs/includes/symfony/var-dumper/Caster/XmlReaderCaster.php @@ -0,0 +1,77 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Caster; + +use Symfony\Component\VarDumper\Cloner\Stub; + +/** + * Casts XmlReader class to array representation. + * + * @author Baptiste Clavié + */ +class XmlReaderCaster +{ + private static $nodeTypes = array( + \XmlReader::NONE => 'NONE', + \XmlReader::ELEMENT => 'ELEMENT', + \XmlReader::ATTRIBUTE => 'ATTRIBUTE', + \XmlReader::TEXT => 'TEXT', + \XmlReader::CDATA => 'CDATA', + \XmlReader::ENTITY_REF => 'ENTITY_REF', + \XmlReader::ENTITY => 'ENTITY', + \XmlReader::PI => 'PI (Processing Instruction)', + \XmlReader::COMMENT => 'COMMENT', + \XmlReader::DOC => 'DOC', + \XmlReader::DOC_TYPE => 'DOC_TYPE', + \XmlReader::DOC_FRAGMENT => 'DOC_FRAGMENT', + \XmlReader::NOTATION => 'NOTATION', + \XmlReader::WHITESPACE => 'WHITESPACE', + \XmlReader::SIGNIFICANT_WHITESPACE => 'SIGNIFICANT_WHITESPACE', + \XmlReader::END_ELEMENT => 'END_ELEMENT', + \XmlReader::END_ENTITY => 'END_ENTITY', + \XmlReader::XML_DECLARATION => 'XML_DECLARATION', + ); + + public static function castXmlReader(\XmlReader $reader, array $a, Stub $stub, $isNested) + { + $props = Caster::PREFIX_VIRTUAL.'parserProperties'; + $info = array( + 'localName' => $reader->localName, + 'prefix' => $reader->prefix, + 'nodeType' => new ConstStub(self::$nodeTypes[$reader->nodeType], $reader->nodeType), + 'depth' => $reader->depth, + 'isDefault' => $reader->isDefault, + 'isEmptyElement' => \XmlReader::NONE === $reader->nodeType ? null : $reader->isEmptyElement, + 'xmlLang' => $reader->xmlLang, + 'attributeCount' => $reader->attributeCount, + 'value' => $reader->value, + 'namespaceURI' => $reader->namespaceURI, + 'baseURI' => $reader->baseURI ? new LinkStub($reader->baseURI) : $reader->baseURI, + $props => array( + 'LOADDTD' => $reader->getParserProperty(\XmlReader::LOADDTD), + 'DEFAULTATTRS' => $reader->getParserProperty(\XmlReader::DEFAULTATTRS), + 'VALIDATE' => $reader->getParserProperty(\XmlReader::VALIDATE), + 'SUBST_ENTITIES' => $reader->getParserProperty(\XmlReader::SUBST_ENTITIES), + ), + ); + + if ($info[$props] = Caster::filter($info[$props], Caster::EXCLUDE_EMPTY, array(), $count)) { + $info[$props] = new EnumStub($info[$props]); + $info[$props]->cut = $count; + } + + $info = Caster::filter($info, Caster::EXCLUDE_EMPTY, array(), $count); + // +2 because hasValue and hasAttributes are always filtered + $stub->cut += $count + 2; + + return $a + $info; + } +} diff --git a/htdocs/includes/symfony/var-dumper/Cloner/AbstractCloner.php b/htdocs/includes/symfony/var-dumper/Cloner/AbstractCloner.php index 2807ceb935b..437230e24ea 100644 --- a/htdocs/includes/symfony/var-dumper/Cloner/AbstractCloner.php +++ b/htdocs/includes/symfony/var-dumper/Cloner/AbstractCloner.php @@ -22,6 +22,8 @@ use Symfony\Component\VarDumper\Exception\ThrowingCasterException; abstract class AbstractCloner implements ClonerInterface { public static $defaultCasters = array( + '__PHP_Incomplete_Class' => 'Symfony\Component\VarDumper\Caster\Caster::castPhpIncompleteClass', + 'Symfony\Component\VarDumper\Caster\CutStub' => 'Symfony\Component\VarDumper\Caster\StubCaster::castStub', 'Symfony\Component\VarDumper\Caster\CutArrayStub' => 'Symfony\Component\VarDumper\Caster\StubCaster::castCutArray', 'Symfony\Component\VarDumper\Caster\ConstStub' => 'Symfony\Component\VarDumper\Caster\StubCaster::castStub', @@ -67,6 +69,8 @@ abstract class AbstractCloner implements ClonerInterface 'DOMProcessingInstruction' => 'Symfony\Component\VarDumper\Caster\DOMCaster::castProcessingInstruction', 'DOMXPath' => 'Symfony\Component\VarDumper\Caster\DOMCaster::castXPath', + 'XmlReader' => 'Symfony\Component\VarDumper\Caster\XmlReaderCaster::castXmlReader', + 'ErrorException' => 'Symfony\Component\VarDumper\Caster\ExceptionCaster::castErrorException', 'Exception' => 'Symfony\Component\VarDumper\Caster\ExceptionCaster::castException', 'Error' => 'Symfony\Component\VarDumper\Caster\ExceptionCaster::castError', @@ -100,6 +104,9 @@ abstract class AbstractCloner implements ClonerInterface 'MongoCursorInterface' => 'Symfony\Component\VarDumper\Caster\MongoCaster::castCursor', + 'Redis' => 'Symfony\Component\VarDumper\Caster\RedisCaster::castRedis', + 'RedisArray' => 'Symfony\Component\VarDumper\Caster\RedisCaster::castRedisArray', + ':curl' => 'Symfony\Component\VarDumper\Caster\ResourceCaster::castCurl', ':dba' => 'Symfony\Component\VarDumper\Caster\ResourceCaster::castDba', ':dba persistent' => 'Symfony\Component\VarDumper\Caster\ResourceCaster::castDba', @@ -111,6 +118,7 @@ abstract class AbstractCloner implements ClonerInterface ':pgsql result' => 'Symfony\Component\VarDumper\Caster\PgSqlCaster::castResult', ':process' => 'Symfony\Component\VarDumper\Caster\ResourceCaster::castProcess', ':stream' => 'Symfony\Component\VarDumper\Caster\ResourceCaster::castStream', + ':persistent stream' => 'Symfony\Component\VarDumper\Caster\ResourceCaster::castStream', ':stream-context' => 'Symfony\Component\VarDumper\Caster\ResourceCaster::castStreamContext', ':xml' => 'Symfony\Component\VarDumper\Caster\XmlResourceCaster::castXml', ); @@ -125,7 +133,7 @@ abstract class AbstractCloner implements ClonerInterface private $filter = 0; /** - * @param callable[]|null $casters A map of casters. + * @param callable[]|null $casters A map of casters * * @see addCasters */ @@ -146,7 +154,7 @@ abstract class AbstractCloner implements ClonerInterface * Resource types are to be prefixed with a `:`, * see e.g. static::$defaultCasters. * - * @param callable[] $casters A map of casters. + * @param callable[] $casters A map of casters */ public function addCasters(array $casters) { @@ -178,10 +186,10 @@ abstract class AbstractCloner implements ClonerInterface /** * Clones a PHP variable. * - * @param mixed $var Any PHP variable. - * @param int $filter A bit field of Caster::EXCLUDE_* constants. + * @param mixed $var Any PHP variable + * @param int $filter A bit field of Caster::EXCLUDE_* constants * - * @return Data The cloned variable represented by a Data object. + * @return Data The cloned variable represented by a Data object */ public function cloneVar($var, $filter = 0) { @@ -216,19 +224,19 @@ abstract class AbstractCloner implements ClonerInterface /** * Effectively clones the PHP variable. * - * @param mixed $var Any PHP variable. + * @param mixed $var Any PHP variable * - * @return array The cloned variable represented in an array. + * @return array The cloned variable represented in an array */ abstract protected function doClone($var); /** * Casts an object to an array representation. * - * @param Stub $stub The Stub for the casted object. - * @param bool $isNested True if the object is nested in the dumped structure. + * @param Stub $stub The Stub for the casted object + * @param bool $isNested True if the object is nested in the dumped structure * - * @return array The object casted as array. + * @return array The object casted as array */ protected function castObject(Stub $stub, $isNested) { @@ -245,14 +253,15 @@ abstract class AbstractCloner implements ClonerInterface new \ReflectionClass($class), array_reverse(array($class => $class) + class_parents($class) + class_implements($class) + array('*' => '*')), ); + $classInfo[1] = array_map('strtolower', $classInfo[1]); $this->classInfo[$class] = $classInfo; } - $a = $this->callCaster('Symfony\Component\VarDumper\Caster\Caster::castObject', $obj, $classInfo[0], null, $isNested); + $a = Caster::castObject($obj, $classInfo[0]); foreach ($classInfo[1] as $p) { - if (!empty($this->casters[$p = strtolower($p)])) { + if (!empty($this->casters[$p])) { foreach ($this->casters[$p] as $p) { $a = $this->callCaster($p, $obj, $a, $stub, $isNested); } @@ -265,10 +274,10 @@ abstract class AbstractCloner implements ClonerInterface /** * Casts a resource to an array representation. * - * @param Stub $stub The Stub for the casted resource. - * @param bool $isNested True if the object is nested in the dumped structure. + * @param Stub $stub The Stub for the casted resource + * @param bool $isNested True if the object is nested in the dumped structure * - * @return array The resource casted as array. + * @return array The resource casted as array */ protected function castResource(Stub $stub, $isNested) { @@ -288,13 +297,13 @@ abstract class AbstractCloner implements ClonerInterface /** * Calls a custom caster. * - * @param callable $callback The caster. - * @param object|resource $obj The object/resource being casted. - * @param array $a The result of the previous cast for chained casters. - * @param Stub $stub The Stub for the casted object/resource. - * @param bool $isNested True if $obj is nested in the dumped structure. + * @param callable $callback The caster + * @param object|resource $obj The object/resource being casted + * @param array $a The result of the previous cast for chained casters + * @param Stub $stub The Stub for the casted object/resource + * @param bool $isNested True if $obj is nested in the dumped structure * - * @return array The casted object/resource. + * @return array The casted object/resource */ private function callCaster($callback, $obj, $a, $stub, $isNested) { @@ -305,7 +314,7 @@ abstract class AbstractCloner implements ClonerInterface $a = $cast; } } catch (\Exception $e) { - $a[(Stub::TYPE_OBJECT === $stub->type ? Caster::PREFIX_VIRTUAL : '').'⚠'] = new ThrowingCasterException($e); + $a = array((Stub::TYPE_OBJECT === $stub->type ? Caster::PREFIX_VIRTUAL : '').'⚠' => new ThrowingCasterException($e)) + $a; } return $a; diff --git a/htdocs/includes/symfony/var-dumper/Cloner/ClonerInterface.php b/htdocs/includes/symfony/var-dumper/Cloner/ClonerInterface.php index c1df5933dbf..7ed287a2ddf 100644 --- a/htdocs/includes/symfony/var-dumper/Cloner/ClonerInterface.php +++ b/htdocs/includes/symfony/var-dumper/Cloner/ClonerInterface.php @@ -19,9 +19,9 @@ interface ClonerInterface /** * Clones a PHP variable. * - * @param mixed $var Any PHP variable. + * @param mixed $var Any PHP variable * - * @return Data The cloned variable represented by a Data object. + * @return Data The cloned variable represented by a Data object */ public function cloneVar($var); } diff --git a/htdocs/includes/symfony/var-dumper/Cloner/Cursor.php b/htdocs/includes/symfony/var-dumper/Cloner/Cursor.php index 162f3293cf2..9db55992e4a 100644 --- a/htdocs/includes/symfony/var-dumper/Cloner/Cursor.php +++ b/htdocs/includes/symfony/var-dumper/Cloner/Cursor.php @@ -38,4 +38,5 @@ class Cursor public $hashLength = 0; public $hashCut = 0; public $stop = false; + public $attr = array(); } diff --git a/htdocs/includes/symfony/var-dumper/Cloner/Data.php b/htdocs/includes/symfony/var-dumper/Cloner/Data.php index 43a7b67971e..22fd2fd1a4a 100644 --- a/htdocs/includes/symfony/var-dumper/Cloner/Data.php +++ b/htdocs/includes/symfony/var-dumper/Cloner/Data.php @@ -11,18 +11,22 @@ namespace Symfony\Component\VarDumper\Cloner; +use Symfony\Component\VarDumper\Caster\Caster; + /** * @author Nicolas Grekas */ class Data { private $data; + private $position = 0; + private $key = 0; private $maxDepth = 20; private $maxItemsPerDepth = -1; private $useRefHandles = -1; /** - * @param array $data A array as returned by ClonerInterface::cloneVar(). + * @param array $data A array as returned by ClonerInterface::cloneVar() */ public function __construct(array $data) { @@ -30,7 +34,7 @@ class Data } /** - * @return array The raw data structure. + * @return array The raw data structure */ public function getRawData() { @@ -40,9 +44,9 @@ class Data /** * Returns a depth limited clone of $this. * - * @param int $maxDepth The max dumped depth level. + * @param int $maxDepth The max dumped depth level * - * @return self A clone of $this. + * @return self A clone of $this */ public function withMaxDepth($maxDepth) { @@ -53,11 +57,11 @@ class Data } /** - * Limits the numbers of elements per depth level. + * Limits the number of elements per depth level. * - * @param int $maxItemsPerDepth The max number of items dumped per depth level. + * @param int $maxItemsPerDepth The max number of items dumped per depth level * - * @return self A clone of $this. + * @return self A clone of $this */ public function withMaxItemsPerDepth($maxItemsPerDepth) { @@ -70,9 +74,9 @@ class Data /** * Enables/disables objects' identifiers tracking. * - * @param bool $useRefHandles False to hide global ref. handles. + * @param bool $useRefHandles False to hide global ref. handles * - * @return self A clone of $this. + * @return self A clone of $this */ public function withRefHandles($useRefHandles) { @@ -82,22 +86,66 @@ class Data return $data; } + /** + * Seeks to a specific key in nested data structures. + * + * @param string|int $key The key to seek to + * + * @return self|null A clone of $this of null if the key is not set + */ + public function seek($key) + { + $item = $this->data[$this->position][$this->key]; + + if (!$item instanceof Stub || !$item->position) { + return; + } + $keys = array($key); + + switch ($item->type) { + case Stub::TYPE_OBJECT: + $keys[] = Caster::PREFIX_DYNAMIC.$key; + $keys[] = Caster::PREFIX_PROTECTED.$key; + $keys[] = Caster::PREFIX_VIRTUAL.$key; + $keys[] = "\0$item->class\0$key"; + case Stub::TYPE_ARRAY: + case Stub::TYPE_RESOURCE: + break; + default: + return; + } + + $data = null; + $children = $this->data[$item->position]; + + foreach ($keys as $key) { + if (isset($children[$key]) || array_key_exists($key, $children)) { + $data = clone $this; + $data->key = $key; + $data->position = $item->position; + break; + } + } + + return $data; + } + /** * Dumps data with a DumperInterface dumper. */ public function dump(DumperInterface $dumper) { $refs = array(0); - $this->dumpItem($dumper, new Cursor(), $refs, $this->data[0][0]); + $this->dumpItem($dumper, new Cursor(), $refs, $this->data[$this->position][$this->key]); } /** * Depth-first dumping of items. * - * @param DumperInterface $dumper The dumper being used for dumping. - * @param Cursor $cursor A cursor used for tracking dumper state position. - * @param array &$refs A map of all references discovered while dumping. - * @param mixed $item A Stub object or the original value being dumped. + * @param DumperInterface $dumper The dumper being used for dumping + * @param Cursor $cursor A cursor used for tracking dumper state position + * @param array &$refs A map of all references discovered while dumping + * @param mixed $item A Stub object or the original value being dumped */ private function dumpItem($dumper, $cursor, &$refs, $item) { @@ -107,6 +155,7 @@ class Data $firstSeen = true; if (!$item instanceof Stub) { + $cursor->attr = array(); $type = gettype($item); } elseif (Stub::TYPE_REF === $item->type) { if ($item->handle) { @@ -119,6 +168,7 @@ class Data $cursor->hardRefHandle = $this->useRefHandles & $item->handle; $cursor->hardRefCount = $item->refCount; } + $cursor->attr = $item->attr; $type = $item->class ?: gettype($item->value); $item = $item->value; } @@ -133,6 +183,7 @@ class Data } $cursor->softRefHandle = $this->useRefHandles & $item->handle; $cursor->softRefCount = $item->refCount; + $cursor->attr = $item->attr; $cut = $item->cut; if ($item->position && $firstSeen) { @@ -162,7 +213,7 @@ class Data $withChildren = $children && $cursor->depth !== $this->maxDepth && $this->maxItemsPerDepth; $dumper->enterHash($cursor, $item->type, $item->class, $withChildren); if ($withChildren) { - $cut = $this->dumpChildren($dumper, $cursor, $refs, $children, $cut, $item->type); + $cut = $this->dumpChildren($dumper, $cursor, $refs, $children, $cut, $item->type, null !== $item->class); } elseif ($children && 0 <= $cut) { $cut += count($children); } @@ -186,15 +237,16 @@ class Data * Dumps children of hash structures. * * @param DumperInterface $dumper - * @param Cursor $parentCursor The cursor of the parent hash. - * @param array &$refs A map of all references discovered while dumping. - * @param array $children The children to dump. - * @param int $hashCut The number of items removed from the original hash. - * @param string $hashType A Cursor::HASH_* const. + * @param Cursor $parentCursor The cursor of the parent hash + * @param array &$refs A map of all references discovered while dumping + * @param array $children The children to dump + * @param int $hashCut The number of items removed from the original hash + * @param string $hashType A Cursor::HASH_* const + * @param bool $dumpKeys Whether keys should be dumped or not * - * @return int The final number of removed items. + * @return int The final number of removed items */ - private function dumpChildren($dumper, $parentCursor, &$refs, $children, $hashCut, $hashType) + private function dumpChildren($dumper, $parentCursor, &$refs, $children, $hashCut, $hashType, $dumpKeys) { $cursor = clone $parentCursor; ++$cursor->depth; @@ -204,7 +256,7 @@ class Data $cursor->hashCut = $hashCut; foreach ($children as $key => $child) { $cursor->hashKeyIsBinary = isset($key[0]) && !preg_match('//u', $key); - $cursor->hashKey = $key; + $cursor->hashKey = $dumpKeys ? $key : null; $this->dumpItem($dumper, $cursor, $refs, $child); if (++$cursor->hashIndex === $this->maxItemsPerDepth || $cursor->stop) { $parentCursor->stop = true; diff --git a/htdocs/includes/symfony/var-dumper/Cloner/DumperInterface.php b/htdocs/includes/symfony/var-dumper/Cloner/DumperInterface.php index eba23d42297..cb7981694f9 100644 --- a/htdocs/includes/symfony/var-dumper/Cloner/DumperInterface.php +++ b/htdocs/includes/symfony/var-dumper/Cloner/DumperInterface.php @@ -21,40 +21,40 @@ interface DumperInterface /** * Dumps a scalar value. * - * @param Cursor $cursor The Cursor position in the dump. - * @param string $type The PHP type of the value being dumped. - * @param scalar $value The scalar value being dumped. + * @param Cursor $cursor The Cursor position in the dump + * @param string $type The PHP type of the value being dumped + * @param scalar $value The scalar value being dumped */ public function dumpScalar(Cursor $cursor, $type, $value); /** * Dumps a string. * - * @param Cursor $cursor The Cursor position in the dump. - * @param string $str The string being dumped. - * @param bool $bin Whether $str is UTF-8 or binary encoded. - * @param int $cut The number of characters $str has been cut by. + * @param Cursor $cursor The Cursor position in the dump + * @param string $str The string being dumped + * @param bool $bin Whether $str is UTF-8 or binary encoded + * @param int $cut The number of characters $str has been cut by */ public function dumpString(Cursor $cursor, $str, $bin, $cut); /** * Dumps while entering an hash. * - * @param Cursor $cursor The Cursor position in the dump. - * @param int $type A Cursor::HASH_* const for the type of hash. - * @param string $class The object class, resource type or array count. - * @param bool $hasChild When the dump of the hash has child item. + * @param Cursor $cursor The Cursor position in the dump + * @param int $type A Cursor::HASH_* const for the type of hash + * @param string $class The object class, resource type or array count + * @param bool $hasChild When the dump of the hash has child item */ public function enterHash(Cursor $cursor, $type, $class, $hasChild); /** * Dumps while leaving an hash. * - * @param Cursor $cursor The Cursor position in the dump. - * @param int $type A Cursor::HASH_* const for the type of hash. - * @param string $class The object class, resource type or array count. - * @param bool $hasChild When the dump of the hash has child item. - * @param int $cut The number of items the hash has been cut by. + * @param Cursor $cursor The Cursor position in the dump + * @param int $type A Cursor::HASH_* const for the type of hash + * @param string $class The object class, resource type or array count + * @param bool $hasChild When the dump of the hash has child item + * @param int $cut The number of items the hash has been cut by */ public function leaveHash(Cursor $cursor, $type, $class, $hasChild, $cut); } diff --git a/htdocs/includes/symfony/var-dumper/Cloner/Stub.php b/htdocs/includes/symfony/var-dumper/Cloner/Stub.php index f58a57a7276..313c591fc83 100644 --- a/htdocs/includes/symfony/var-dumper/Cloner/Stub.php +++ b/htdocs/includes/symfony/var-dumper/Cloner/Stub.php @@ -37,4 +37,5 @@ class Stub public $handle = 0; public $refCount = 0; public $position = 0; + public $attr = array(); } diff --git a/htdocs/includes/symfony/var-dumper/Cloner/VarCloner.php b/htdocs/includes/symfony/var-dumper/Cloner/VarCloner.php index 20cc8d08354..6a3b451bda7 100644 --- a/htdocs/includes/symfony/var-dumper/Cloner/VarCloner.php +++ b/htdocs/includes/symfony/var-dumper/Cloner/VarCloner.php @@ -25,10 +25,9 @@ class VarCloner extends AbstractCloner protected function doClone($var) { $useExt = $this->useExt; - $i = 0; // Current iteration position in $queue $len = 1; // Length of $queue $pos = 0; // Number of cloned items past the first level - $refs = 0; // Hard references counter + $refsCounter = 0; // Hard references counter $queue = array(array($var)); // This breadth-first queue is the return value $arrayRefs = array(); // Map of queue indexes to stub array objects $hardRefs = array(); // Map of original zval hashes to stub objects @@ -60,27 +59,32 @@ class VarCloner extends AbstractCloner for ($i = 0; $i < $len; ++$i) { $indexed = true; // Whether the currently iterated array is numerically indexed or not $j = -1; // Position in the currently iterated array - $step = $queue[$i]; // Copy of the currently iterated array used for hard references detection - foreach ($step as $k => $v) { + $fromObjCast = array_keys($queue[$i]); + $fromObjCast = array_keys(array_flip($fromObjCast)) !== $fromObjCast; + $refs = $vals = $fromObjCast ? array_values($queue[$i]) : $queue[$i]; + foreach ($queue[$i] as $k => $v) { // $k is the original key // $v is the original value or a stub object in case of hard references - if ($indexed && $k !== ++$j) { + if ($k !== ++$j) { $indexed = false; } + if ($fromObjCast) { + $k = $j; + } if ($useExt) { - $zval = symfony_zval_info($k, $step); + $zval = symfony_zval_info($k, $refs); } else { - $step[$k] = $cookie; - if ($zval['zval_isref'] = $queue[$i][$k] === $cookie) { + $refs[$k] = $cookie; + if ($zval['zval_isref'] = $vals[$k] === $cookie) { $zval['zval_hash'] = $v instanceof Stub ? spl_object_hash($v) : null; } $zval['type'] = gettype($v); } if ($zval['zval_isref']) { - $queue[$i][$k] = &$stub; // Break hard references to make $queue completely + $vals[$k] = &$stub; // Break hard references to make $queue completely unset($stub); // independent from the original structure if (isset($hardRefs[$zval['zval_hash']])) { - $queue[$i][$k] = $useExt ? ($v = $hardRefs[$zval['zval_hash']]) : ($step[$k] = $v); + $vals[$k] = $useExt ? ($v = $hardRefs[$zval['zval_hash']]) : ($refs[$k] = $v); if ($v->value instanceof Stub && (Stub::TYPE_OBJECT === $v->value->type || Stub::TYPE_RESOURCE === $v->value->type)) { ++$v->value->refCount; } @@ -102,12 +106,12 @@ class VarCloner extends AbstractCloner } else { $stub->value = $v; } - } elseif (0 <= $maxString && isset($v[1 + ($maxString >> 2)]) && 0 < $cut = iconv_strlen($v, 'UTF-8') - $maxString) { + } elseif (0 <= $maxString && isset($v[1 + ($maxString >> 2)]) && 0 < $cut = mb_strlen($v, 'UTF-8') - $maxString) { $stub = new Stub(); $stub->type = Stub::TYPE_STRING; $stub->class = Stub::STRING_UTF8; $stub->cut = $cut; - $stub->value = iconv_substr($v, 0, $maxString, 'UTF-8'); + $stub->value = mb_substr($v, 0, $maxString, 'UTF-8'); } break; @@ -178,10 +182,13 @@ class VarCloner extends AbstractCloner case 'resource': case 'unknown type': + case 'resource (closed)': if (empty($resRefs[$h = (int) $v])) { $stub = new Stub(); $stub->type = Stub::TYPE_RESOURCE; - $stub->class = $zval['resource_type'] ?: get_resource_type($v); + if ('Unknown' === $stub->class = $zval['resource_type'] ?: @get_resource_type($v)) { + $stub->class = 'Closed'; + } $stub->value = $v; $stub->handle = $h; $a = $this->castResource($stub, 0 < $i); @@ -204,18 +211,18 @@ class VarCloner extends AbstractCloner if (isset($stub)) { if ($zval['zval_isref']) { if ($useExt) { - $queue[$i][$k] = $hardRefs[$zval['zval_hash']] = $v = new Stub(); + $vals[$k] = $hardRefs[$zval['zval_hash']] = $v = new Stub(); $v->value = $stub; } else { - $step[$k] = new Stub(); - $step[$k]->value = $stub; - $h = spl_object_hash($step[$k]); - $queue[$i][$k] = $hardRefs[$h] = &$step[$k]; + $refs[$k] = new Stub(); + $refs[$k]->value = $stub; + $h = spl_object_hash($refs[$k]); + $vals[$k] = $hardRefs[$h] = &$refs[$k]; $values[$h] = $v; } - $queue[$i][$k]->handle = ++$refs; + $vals[$k]->handle = ++$refsCounter; } else { - $queue[$i][$k] = $stub; + $vals[$k] = $stub; } if ($a) { @@ -243,19 +250,38 @@ class VarCloner extends AbstractCloner $stub = $a = null; } elseif ($zval['zval_isref']) { if ($useExt) { - $queue[$i][$k] = $hardRefs[$zval['zval_hash']] = new Stub(); - $queue[$i][$k]->value = $v; + $vals[$k] = $hardRefs[$zval['zval_hash']] = new Stub(); + $vals[$k]->value = $v; } else { - $step[$k] = $queue[$i][$k] = new Stub(); - $step[$k]->value = $v; - $h = spl_object_hash($step[$k]); - $hardRefs[$h] = &$step[$k]; + $refs[$k] = $vals[$k] = new Stub(); + $refs[$k]->value = $v; + $h = spl_object_hash($refs[$k]); + $hardRefs[$h] = &$refs[$k]; $values[$h] = $v; } - $queue[$i][$k]->handle = ++$refs; + $vals[$k]->handle = ++$refsCounter; } } + if ($fromObjCast) { + $refs = $vals; + $vals = array(); + $j = -1; + foreach ($queue[$i] as $k => $v) { + foreach (array($k => $v) as $a => $v) { + } + if ($a !== $k) { + $vals = (object) $vals; + $vals->{$k} = $refs[++$j]; + $vals = (array) $vals; + } else { + $vals[$k] = $refs[++$j]; + } + } + } + + $queue[$i] = $vals; + if (isset($arrayRefs[$i])) { if ($indexed) { $arrayRefs[$i]->class = Stub::ARRAY_INDEXED; @@ -291,7 +317,7 @@ class VarCloner extends AbstractCloner if (!empty($frame['line'])) { ob_start(); debug_zval_dump($obj); - self::$hashMask = strlen(substr(ob_get_clean(), 17)); + self::$hashMask = (int) substr(ob_get_clean(), 17); } } diff --git a/htdocs/includes/symfony/var-dumper/Dumper/AbstractDumper.php b/htdocs/includes/symfony/var-dumper/Dumper/AbstractDumper.php index f8b9c107779..12f835b1ffa 100644 --- a/htdocs/includes/symfony/var-dumper/Dumper/AbstractDumper.php +++ b/htdocs/includes/symfony/var-dumper/Dumper/AbstractDumper.php @@ -21,6 +21,9 @@ use Symfony\Component\VarDumper\Cloner\DumperInterface; */ abstract class AbstractDumper implements DataDumperInterface, DumperInterface { + const DUMP_LIGHT_ARRAY = 1; + const DUMP_STRING_LENGTH = 2; + public static $defaultOutput = 'php://output'; protected $line = ''; @@ -28,18 +31,21 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface protected $outputStream; protected $decimalPoint; // This is locale dependent protected $indentPad = ' '; + protected $flags; private $charset; /** - * @param callable|resource|string|null $output A line dumper callable, an opened stream or an output path, defaults to static::$defaultOutput. - * @param string $charset The default character encoding to use for non-UTF8 strings. + * @param callable|resource|string|null $output A line dumper callable, an opened stream or an output path, defaults to static::$defaultOutput + * @param string $charset The default character encoding to use for non-UTF8 strings + * @param int $flags A bit field of static::DUMP_* constants to fine tune dumps representation */ - public function __construct($output = null, $charset = null) + public function __construct($output = null, $charset = null, $flags = 0) { + $this->flags = (int) $flags; $this->setCharset($charset ?: ini_get('php.output_encoding') ?: ini_get('default_charset') ?: 'UTF-8'); - $this->decimalPoint = (string) 0.5; - $this->decimalPoint = $this->decimalPoint[1]; + $this->decimalPoint = localeconv(); + $this->decimalPoint = $this->decimalPoint['decimal_point']; $this->setOutput($output ?: static::$defaultOutput); if (!$output && is_string(static::$defaultOutput)) { static::$defaultOutput = $this->outputStream; @@ -49,9 +55,9 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface /** * Sets the output destination of the dumps. * - * @param callable|resource|string $output A line dumper callable, an opened stream or an output path. + * @param callable|resource|string $output A line dumper callable, an opened stream or an output path * - * @return callable|resource|string The previous output destination. + * @return callable|resource|string The previous output destination */ public function setOutput($output) { @@ -74,9 +80,9 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface /** * Sets the default character encoding to use for non-UTF8 strings. * - * @param string $charset The default character encoding to use for non-UTF8 strings. + * @param string $charset The default character encoding to use for non-UTF8 strings * - * @return string The previous charset. + * @return string The previous charset */ public function setCharset($charset) { @@ -93,9 +99,9 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface /** * Sets the indentation pad string. * - * @param string $pad A string the will be prepended to dumped lines, repeated by nesting level. + * @param string $pad A string the will be prepended to dumped lines, repeated by nesting level * - * @return string The indent pad. + * @return string The indent pad */ public function setIndentPad($pad) { @@ -108,33 +114,43 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface /** * Dumps a Data object. * - * @param Data $data A Data object. - * @param callable|resource|string|null $output A line dumper callable, an opened stream or an output path. + * @param Data $data A Data object + * @param callable|resource|string|true|null $output A line dumper callable, an opened stream, an output path or true to return the dump + * + * @return string|null The dump as string when $output is true */ public function dump(Data $data, $output = null) { - $exception = null; + $this->decimalPoint = localeconv(); + $this->decimalPoint = $this->decimalPoint['decimal_point']; + + if ($returnDump = true === $output) { + $output = fopen('php://memory', 'r+b'); + } if ($output) { $prevOutput = $this->setOutput($output); } try { $data->dump($this); $this->dumpLine(-1); - } catch (\Exception $exception) { - // Re-thrown below - } - if ($output) { - $this->setOutput($prevOutput); - } - if (null !== $exception) { - throw $exception; + + if ($returnDump) { + $result = stream_get_contents($output, -1, 0); + fclose($output); + + return $result; + } + } finally { + if ($output) { + $this->setOutput($prevOutput); + } } } /** * Dumps the current line. * - * @param int $depth The recursive depth in the dumped structure for the line being dumped. + * @param int $depth The recursive depth in the dumped structure for the line being dumped */ protected function dumpLine($depth) { @@ -145,8 +161,9 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface /** * Generic line dumper callback. * - * @param string $line The line to write. - * @param int $depth The recursive depth in the dumped structure. + * @param string $line The line to write + * @param int $depth The recursive depth in the dumped structure + * @param string $indentPad The line indent pad */ protected function echoLine($line, $depth, $indentPad) { @@ -158,12 +175,20 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface /** * Converts a non-UTF-8 string to UTF-8. * - * @param string $s The non-UTF-8 string to convert. + * @param string $s The non-UTF-8 string to convert * - * @return string The string converted to UTF-8. + * @return string The string converted to UTF-8 */ protected function utf8Encode($s) { + if (preg_match('//u', $s)) { + return $s; + } + + if (!function_exists('iconv')) { + throw new \RuntimeException('Unable to convert a non-UTF-8 string to UTF-8: required function iconv() does not exist. You should install ext-iconv or symfony/polyfill-iconv.'); + } + if (false !== $c = @iconv($this->charset, 'UTF-8', $s)) { return $c; } diff --git a/htdocs/includes/symfony/var-dumper/Dumper/CliDumper.php b/htdocs/includes/symfony/var-dumper/Dumper/CliDumper.php index bca2abcb3d0..540f9245fdf 100644 --- a/htdocs/includes/symfony/var-dumper/Dumper/CliDumper.php +++ b/htdocs/includes/symfony/var-dumper/Dumper/CliDumper.php @@ -54,12 +54,12 @@ class CliDumper extends AbstractDumper /** * {@inheritdoc} */ - public function __construct($output = null, $charset = null) + public function __construct($output = null, $charset = null, $flags = 0) { - parent::__construct($output, $charset); + parent::__construct($output, $charset, $flags); - if ('\\' === DIRECTORY_SEPARATOR && false !== @getenv('ANSICON')) { - // Use only the base 16 xterm colors when using ANSICON + if ('\\' === DIRECTORY_SEPARATOR && 'ON' !== @getenv('ConEmuANSI') && 'xterm' !== @getenv('TERM')) { + // Use only the base 16 xterm colors when using ANSICON or standard Windows 10 CLI $this->setStyles(array( 'default' => '31', 'num' => '1;34', @@ -97,7 +97,7 @@ class CliDumper extends AbstractDumper /** * Configures styles. * - * @param array $styles A map of style names to style definitions. + * @param array $styles A map of style names to style definitions */ public function setStyles(array $styles) { @@ -112,9 +112,13 @@ class CliDumper extends AbstractDumper $this->dumpKey($cursor); $style = 'const'; - $attr = array(); + $attr = $cursor->attr; switch ($type) { + case 'default': + $style = 'default'; + break; + case 'integer': $style = 'num'; break; @@ -123,9 +127,9 @@ class CliDumper extends AbstractDumper $style = 'num'; switch (true) { - case INF === $value: $value = 'INF'; break; + case INF === $value: $value = 'INF'; break; case -INF === $value: $value = '-INF'; break; - case is_nan($value): $value = 'NAN'; break; + case is_nan($value): $value = 'NAN'; break; default: $value = (string) $value; if (false === strpos($value, $this->decimalPoint)) { @@ -144,8 +148,8 @@ class CliDumper extends AbstractDumper break; default: - $attr['value'] = isset($value[0]) && !preg_match('//u', $value) ? $this->utf8Encode($value) : $value; - $value = isset($type[0]) && !preg_match('//u', $type) ? $this->utf8Encode($type) : $type; + $attr += array('value' => $this->utf8Encode($value)); + $value = $this->utf8Encode($type); break; } @@ -160,6 +164,7 @@ class CliDumper extends AbstractDumper public function dumpString(Cursor $cursor, $str, $bin, $cut) { $this->dumpKey($cursor); + $attr = $cursor->attr; if ($bin) { $str = $this->utf8Encode($str); @@ -168,8 +173,8 @@ class CliDumper extends AbstractDumper $this->line .= '""'; $this->dumpLine($cursor->depth, true); } else { - $attr = array( - 'length' => 0 <= $cut ? iconv_strlen($str, 'UTF-8') + $cut : 0, + $attr += array( + 'length' => 0 <= $cut ? mb_strlen($str, 'UTF-8') + $cut : 0, 'binary' => $bin, ); $str = explode("\n", $str); @@ -180,6 +185,9 @@ class CliDumper extends AbstractDumper $m = count($str) - 1; $i = $lineCut = 0; + if (self::DUMP_STRING_LENGTH & $this->flags) { + $this->line .= '('.$attr['length'].') '; + } if ($bin) { $this->line .= 'b'; } @@ -195,8 +203,8 @@ class CliDumper extends AbstractDumper if ($i < $m) { $str .= "\n"; } - if (0 < $this->maxStringWidth && $this->maxStringWidth < $len = iconv_strlen($str, 'UTF-8')) { - $str = iconv_substr($str, 0, $this->maxStringWidth, 'UTF-8'); + if (0 < $this->maxStringWidth && $this->maxStringWidth < $len = mb_strlen($str, 'UTF-8')) { + $str = mb_substr($str, 0, $this->maxStringWidth, 'UTF-8'); $lineCut = $len - $this->maxStringWidth; } if ($m && 0 < $cursor->depth) { @@ -241,15 +249,13 @@ class CliDumper extends AbstractDumper { $this->dumpKey($cursor); - if (!preg_match('//u', $class)) { - $class = $this->utf8Encode($class); - } + $class = $this->utf8Encode($class); if (Cursor::HASH_OBJECT === $type) { $prefix = $class && 'stdClass' !== $class ? $this->style('note', $class).' {' : '{'; } elseif (Cursor::HASH_RESOURCE === $type) { $prefix = $this->style('note', $class.' resource').($hasChild ? ' {' : ' '); } else { - $prefix = $class ? $this->style('note', 'array:'.$class).' [' : '['; + $prefix = $class && !(self::DUMP_LIGHT_ARRAY & $this->flags) ? $this->style('note', 'array:'.$class).' [' : '['; } if ($cursor->softRefCount || 0 < $cursor->softRefHandle) { @@ -280,9 +286,9 @@ class CliDumper extends AbstractDumper /** * Dumps an ellipsis for cut children. * - * @param Cursor $cursor The Cursor position in the dump. - * @param bool $hasChild When the dump of the hash has child item. - * @param int $cut The number of items the hash has been cut by. + * @param Cursor $cursor The Cursor position in the dump + * @param bool $hasChild When the dump of the hash has child item + * @param int $cut The number of items the hash has been cut by */ protected function dumpEllipsis(Cursor $cursor, $hasChild, $cut) { @@ -300,7 +306,7 @@ class CliDumper extends AbstractDumper /** * Dumps a key in a hash structure. * - * @param Cursor $cursor The Cursor position in the dump. + * @param Cursor $cursor The Cursor position in the dump */ protected function dumpKey(Cursor $cursor) { @@ -314,6 +320,9 @@ class CliDumper extends AbstractDumper switch ($cursor->hashType) { default: case Cursor::HASH_INDEXED: + if (self::DUMP_LIGHT_ARRAY & $this->flags) { + break; + } $style = 'index'; case Cursor::HASH_ASSOC: if (is_int($key)) { @@ -332,13 +341,17 @@ class CliDumper extends AbstractDumper } elseif (0 < strpos($key, "\0", 1)) { $key = explode("\0", substr($key, 1), 2); - switch ($key[0]) { + switch ($key[0][0]) { case '+': // User inserted keys $attr['dynamic'] = true; $this->line .= '+'.$bin.'"'.$this->style('public', $key[1], $attr).'": '; break 2; case '~': $style = 'meta'; + if (isset($key[0][1])) { + parse_str(substr($key[0], 1), $attr); + $attr += array('binary' => $cursor->hashKeyIsBinary); + } break; case '*': $style = 'protected'; @@ -368,11 +381,11 @@ class CliDumper extends AbstractDumper /** * Decorates a value with some style. * - * @param string $style The type of style being applied. - * @param string $value The value being styled. - * @param array $attr Optional context information. + * @param string $style The type of style being applied + * @param string $value The value being styled + * @param array $attr Optional context information * - * @return string The value with style decoration. + * @return string The value with style decoration */ protected function style($style, $value, $attr = array()) { @@ -412,7 +425,7 @@ class CliDumper extends AbstractDumper } /** - * @return bool Tells if the current output stream supports ANSI colors or not. + * @return bool Tells if the current output stream supports ANSI colors or not */ protected function supportsColors() { @@ -446,7 +459,12 @@ class CliDumper extends AbstractDumper } if ('\\' === DIRECTORY_SEPARATOR) { - static::$defaultColors = @(false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI') || 'xterm' === getenv('TERM')); + static::$defaultColors = @( + '10.0.10586' === PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD + || false !== getenv('ANSICON') + || 'ON' === getenv('ConEmuANSI') + || 'xterm' === getenv('TERM') + ); } elseif (function_exists('posix_isatty')) { $h = stream_get_meta_data($this->outputStream) + array('wrapper_type' => null); $h = 'Output' === $h['stream_type'] && 'PHP' === $h['wrapper_type'] ? fopen('php://stdout', 'wb') : $this->outputStream; diff --git a/htdocs/includes/symfony/var-dumper/Dumper/DataDumperInterface.php b/htdocs/includes/symfony/var-dumper/Dumper/DataDumperInterface.php index ee6060cebf6..2c3d9db850d 100644 --- a/htdocs/includes/symfony/var-dumper/Dumper/DataDumperInterface.php +++ b/htdocs/includes/symfony/var-dumper/Dumper/DataDumperInterface.php @@ -23,7 +23,7 @@ interface DataDumperInterface /** * Dumps a Data object. * - * @param Data $data A Data object. + * @param Data $data A Data object */ public function dump(Data $data); } diff --git a/htdocs/includes/symfony/var-dumper/Dumper/HtmlDumper.php b/htdocs/includes/symfony/var-dumper/Dumper/HtmlDumper.php index 28af8e4cb22..cc0b1ce179c 100644 --- a/htdocs/includes/symfony/var-dumper/Dumper/HtmlDumper.php +++ b/htdocs/includes/symfony/var-dumper/Dumper/HtmlDumper.php @@ -25,13 +25,13 @@ class HtmlDumper extends CliDumper protected $dumpHeader; protected $dumpPrefix = '
';
-    protected $dumpSuffix = '
'; + protected $dumpSuffix = ''; protected $dumpId = 'sf-dump'; protected $colors = true; protected $headerIsDumped = false; protected $lastDepth = -1; protected $styles = array( - 'default' => 'background-color:#18171B; color:#FF8400; line-height:1.2em; font:12px Menlo, Monaco, Consolas, monospace; word-wrap: break-word; white-space: pre-wrap; position:relative; z-index:100000; word-break: normal', + 'default' => 'background-color:#18171B; color:#FF8400; line-height:1.2em; font:12px Menlo, Monaco, Consolas, monospace; word-wrap: break-word; white-space: pre-wrap; position:relative; z-index:99999; word-break: normal', 'num' => 'font-weight:bold; color:#1299DA', 'const' => 'font-weight:bold', 'str' => 'font-weight:bold; color:#56DB3A', @@ -43,27 +43,24 @@ class HtmlDumper extends CliDumper 'meta' => 'color:#B729D9', 'key' => 'color:#56DB3A', 'index' => 'color:#1299DA', + 'ellipsis' => 'color:#FF8400', ); + private $displayOptions = array( + 'maxDepth' => 1, + 'maxStringLength' => 160, + 'fileLinkFormat' => null, + ); + private $extraDisplayOptions = array(); + /** * {@inheritdoc} */ - public function __construct($output = null, $charset = null) + public function __construct($output = null, $charset = null, $flags = 0) { - AbstractDumper::__construct($output, $charset); + AbstractDumper::__construct($output, $charset, $flags); $this->dumpId = 'sf-dump-'.mt_rand(); - } - - /** - * {@inheritdoc} - */ - public function setOutput($output) - { - if ($output !== $prev = parent::setOutput($output)) { - $this->headerIsDumped = false; - } - - return $prev; + $this->displayOptions['fileLinkFormat'] = ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format'); } /** @@ -75,10 +72,21 @@ class HtmlDumper extends CliDumper $this->styles = $styles + $this->styles; } + /** + * Configures display options. + * + * @param array $displayOptions A map of display options to customize the behavior + */ + public function setDisplayOptions(array $displayOptions) + { + $this->headerIsDumped = false; + $this->displayOptions = $displayOptions + $this->displayOptions; + } + /** * Sets an HTML header that will be dumped once in the output stream. * - * @param string $header An HTML string. + * @param string $header An HTML string */ public function setDumpHeader($header) { @@ -88,8 +96,8 @@ class HtmlDumper extends CliDumper /** * Sets an HTML prefix and suffix that will encapse every single dump. * - * @param string $prefix The prepended HTML string. - * @param string $suffix The appended HTML string. + * @param string $prefix The prepended HTML string + * @param string $suffix The appended HTML string */ public function setDumpBoundaries($prefix, $suffix) { @@ -100,10 +108,13 @@ class HtmlDumper extends CliDumper /** * {@inheritdoc} */ - public function dump(Data $data, $output = null) + public function dump(Data $data, $output = null, array $extraDisplayOptions = array()) { - parent::dump($data, $output); + $this->extraDisplayOptions = $extraDisplayOptions; + $result = parent::dump($data, $output); $this->dumpId = 'sf-dump-'.mt_rand(); + + return $result; } /** @@ -111,13 +122,13 @@ class HtmlDumper extends CliDumper */ protected function getDumpHeader() { - $this->headerIsDumped = true; + $this->headerIsDumped = null !== $this->outputStream ? $this->outputStream : $this->lineDumper; if (null !== $this->dumpHeader) { return $this->dumpHeader; } - $line = <<<'EOHTML' + $line = str_replace('{$options}', json_encode($this->displayOptions, JSON_FORCE_OBJECT), <<<'EOHTML' -'.$this->dumpHeader; @@ -374,7 +448,7 @@ EOHTML; return ''; } - $v = htmlspecialchars($value, ENT_QUOTES, 'UTF-8'); + $v = esc($value); if ('ref' === $style) { if (empty($attr['count'])) { @@ -385,41 +459,47 @@ EOHTML; return sprintf('%s', $this->dumpId, $r, 1 + $attr['count'], $v); } - if ('const' === $style && array_key_exists('value', $attr)) { - $style .= sprintf(' title="%s"', htmlspecialchars(json_encode($attr['value']), ENT_QUOTES, 'UTF-8')); + if ('const' === $style && isset($attr['value'])) { + $style .= sprintf(' title="%s"', esc(is_scalar($attr['value']) ? $attr['value'] : json_encode($attr['value']))); } elseif ('public' === $style) { $style .= sprintf(' title="%s"', empty($attr['dynamic']) ? 'Public property' : 'Runtime added dynamic property'); } elseif ('str' === $style && 1 < $attr['length']) { - $style .= sprintf(' title="%s%s characters"', $attr['length'], $attr['binary'] ? ' binary or non-UTF-8' : ''); + $style .= sprintf(' title="%d%s characters"', $attr['length'], $attr['binary'] ? ' binary or non-UTF-8' : ''); } elseif ('note' === $style && false !== $c = strrpos($v, '\\')) { return sprintf('%s', $v, $style, substr($v, $c + 1)); } elseif ('protected' === $style) { $style .= ' title="Protected property"'; + } elseif ('meta' === $style && isset($attr['title'])) { + $style .= sprintf(' title="%s"', esc($this->utf8Encode($attr['title']))); } elseif ('private' === $style) { - $style .= sprintf(' title="Private property defined in class: `%s`"', $attr['class']); + $style .= sprintf(' title="Private property defined in class: `%s`"', esc($this->utf8Encode($attr['class']))); + } + $map = static::$controlCharsMap; + + if (isset($attr['ellipsis'])) { + $label = esc(substr($value, -$attr['ellipsis'])); + $style = str_replace(' title="', " title=\"$v\n", $style); + $v = sprintf('%s%s', substr($v, 0, -strlen($label)), $label); } - $map = static::$controlCharsMap; - $style = ""; - $v = preg_replace_callback(static::$controlCharsRx, function ($c) use ($map, $style) { - $s = ''; + $v = "".preg_replace_callback(static::$controlCharsRx, function ($c) use ($map) { + $s = ''; $c = $c[$i = 0]; do { $s .= isset($map[$c[$i]]) ? $map[$c[$i]] : sprintf('\x%02X', ord($c[$i])); } while (isset($c[++$i])); - return $s.$style; - }, $v, -1, $cchrCount); + return $s.''; + }, $v).''; - if ($cchrCount && '<' === $v[0]) { - $v = substr($v, 7); - } else { - $v = $style.$v; + if (isset($attr['file']) && $href = $this->getSourceLink($attr['file'], isset($attr['line']) ? $attr['line'] : 0)) { + $attr['href'] = $href; } - if ($cchrCount && '>' === substr($v, -1)) { - $v = substr($v, 0, -strlen($style)); - } else { - $v .= ''; + if (isset($attr['href'])) { + $v = sprintf('%s', esc($this->utf8Encode($attr['href'])), $v); + } + if (isset($attr['lang'])) { + $v = sprintf('%s', esc($attr['lang']), $v); } return $v; @@ -433,12 +513,17 @@ EOHTML; if (-1 === $this->lastDepth) { $this->line = sprintf($this->dumpPrefix, $this->dumpId, $this->indentPad).$this->line; } - if (!$this->headerIsDumped) { + if ($this->headerIsDumped !== (null !== $this->outputStream ? $this->outputStream : $this->lineDumper)) { $this->line = $this->getDumpHeader().$this->line; } if (-1 === $depth) { - $this->line .= sprintf($this->dumpSuffix, $this->dumpId); + $args = array('"'.$this->dumpId.'"'); + if ($this->extraDisplayOptions) { + $args[] = json_encode($this->extraDisplayOptions, JSON_FORCE_OBJECT); + } + // Replace is for BC + $this->line .= sprintf(str_replace('"%s"', '%s', $this->dumpSuffix), implode(', ', $args)); } $this->lastDepth = $depth; @@ -449,4 +534,20 @@ EOHTML; } AbstractDumper::dumpLine($depth); } + + private function getSourceLink($file, $line) + { + $options = $this->extraDisplayOptions + $this->displayOptions; + + if ($fmt = $options['fileLinkFormat']) { + return is_string($fmt) ? strtr($fmt, array('%f' => $file, '%l' => $line)) : $fmt->format($file, $line); + } + + return false; + } +} + +function esc($str) +{ + return htmlspecialchars($str, ENT_QUOTES, 'UTF-8'); } diff --git a/htdocs/includes/symfony/var-dumper/LICENSE b/htdocs/includes/symfony/var-dumper/LICENSE index ef1cde91a61..207646a052d 100644 --- a/htdocs/includes/symfony/var-dumper/LICENSE +++ b/htdocs/includes/symfony/var-dumper/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2014-2015 Fabien Potencier +Copyright (c) 2014-2017 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/htdocs/includes/symfony/var-dumper/README.md b/htdocs/includes/symfony/var-dumper/README.md index 71bff335a70..3b5d55f5f5b 100644 --- a/htdocs/includes/symfony/var-dumper/README.md +++ b/htdocs/includes/symfony/var-dumper/README.md @@ -1,14 +1,15 @@ -Symfony mechanism for exploring and dumping PHP variables -========================================================= +VarDumper Component +=================== -This component provides a mechanism that allows exploring then dumping -any PHP variable. +The VarDumper component provides mechanisms for walking through any arbitrary +PHP variable. Built on top, it provides a better `dump()` function that you +can use instead of `var_dump`. -It handles scalars, objects and resources properly, taking hard and soft -references into account. More than being immune to infinite recursion -problems, it allows dumping where references link to each other. -It explores recursive structures using a breadth-first algorithm. +Resources +--------- -The component exposes all the parts involved in the different steps of -cloning then dumping a PHP variable, while applying size limits and having -specialized output formats and methods. + * [Documentation](https://symfony.com/doc/current/components/var_dumper/introduction.html) + * [Contributing](https://symfony.com/doc/current/contributing/index.html) + * [Report issues](https://github.com/symfony/symfony/issues) and + [send Pull Requests](https://github.com/symfony/symfony/pulls) + in the [main Symfony repository](https://github.com/symfony/symfony) diff --git a/htdocs/includes/symfony/var-dumper/Test/VarDumperTestTrait.php b/htdocs/includes/symfony/var-dumper/Test/VarDumperTestTrait.php index e5f6bf5b98e..40ec83d1322 100644 --- a/htdocs/includes/symfony/var-dumper/Test/VarDumperTestTrait.php +++ b/htdocs/includes/symfony/var-dumper/Test/VarDumperTestTrait.php @@ -29,17 +29,20 @@ trait VarDumperTestTrait $this->assertStringMatchesFormat(rtrim($dump), $this->getDump($data), $message); } - protected function getDump($data) + protected function getDump($data, $key = null) { - $h = fopen('php://memory', 'r+b'); + $flags = getenv('DUMP_LIGHT_ARRAY') ? CliDumper::DUMP_LIGHT_ARRAY : 0; + $flags |= getenv('DUMP_STRING_LENGTH') ? CliDumper::DUMP_STRING_LENGTH : 0; + $cloner = new VarCloner(); $cloner->setMaxItems(-1); - $dumper = new CliDumper($h); + $dumper = new CliDumper(null, null, $flags); $dumper->setColors(false); - $dumper->dump($cloner->cloneVar($data)->withRefHandles(false)); - $data = stream_get_contents($h, -1, 0); - fclose($h); + $data = $cloner->cloneVar($data)->withRefHandles(false); + if (null !== $key && null === $data = $data->seek($key)) { + return; + } - return rtrim($data); + return rtrim($dumper->dump($data, true)); } } diff --git a/htdocs/includes/symfony/var-dumper/Tests/Caster/CasterTest.php b/htdocs/includes/symfony/var-dumper/Tests/Caster/CasterTest.php index 43d389ce1c0..105d5638ee1 100644 --- a/htdocs/includes/symfony/var-dumper/Tests/Caster/CasterTest.php +++ b/htdocs/includes/symfony/var-dumper/Tests/Caster/CasterTest.php @@ -11,13 +11,14 @@ namespace Symfony\Component\VarDumper\Tests\Caster; +use PHPUnit\Framework\TestCase; use Symfony\Component\VarDumper\Caster\Caster; use Symfony\Component\VarDumper\Test\VarDumperTestTrait; /** * @author Nicolas Grekas */ -class CasterTest extends \PHPUnit_Framework_TestCase +class CasterTest extends TestCase { use VarDumperTestTrait; diff --git a/htdocs/includes/symfony/var-dumper/Tests/Caster/ExceptionCasterTest.php b/htdocs/includes/symfony/var-dumper/Tests/Caster/ExceptionCasterTest.php new file mode 100644 index 00000000000..e0fb177b4bb --- /dev/null +++ b/htdocs/includes/symfony/var-dumper/Tests/Caster/ExceptionCasterTest.php @@ -0,0 +1,225 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Tests\Caster; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\VarDumper\Caster\ExceptionCaster; +use Symfony\Component\VarDumper\Caster\FrameStub; +use Symfony\Component\VarDumper\Cloner\VarCloner; +use Symfony\Component\VarDumper\Dumper\HtmlDumper; +use Symfony\Component\VarDumper\Test\VarDumperTestTrait; + +class ExceptionCasterTest extends TestCase +{ + use VarDumperTestTrait; + + private function getTestException($msg, &$ref = null) + { + return new \Exception(''.$msg); + } + + protected function tearDown() + { + ExceptionCaster::$srcContext = 1; + ExceptionCaster::$traceArgs = true; + } + + public function testDefaultSettings() + { + $ref = array('foo'); + $e = $this->getTestException('foo', $ref); + + $expectedDump = <<<'EODUMP' +Exception { + #message: "foo" + #code: 0 + #file: "%sExceptionCasterTest.php" + #line: 27 + -trace: { + %sExceptionCasterTest.php:27: { + : { + : return new \Exception(''.$msg); + : } + } + %sExceptionCasterTest.php:%d: { + : $ref = array('foo'); + : $e = $this->getTestException('foo', $ref); + : + arguments: { + $msg: "foo" + &$ref: array:1 [ …1] + } + } +%A +EODUMP; + + $this->assertDumpMatchesFormat($expectedDump, $e); + $this->assertSame(array('foo'), $ref); + } + + public function testSeek() + { + $e = $this->getTestException(2); + + $expectedDump = <<<'EODUMP' +{ + %sExceptionCasterTest.php:27: { + : { + : return new \Exception(''.$msg); + : } + } + %sExceptionCasterTest.php:%d: { + : { + : $e = $this->getTestException(2); + : + arguments: { + $msg: 2 + } + } +%A +EODUMP; + + $this->assertStringMatchesFormat($expectedDump, $this->getDump($e, 'trace')); + } + + public function testNoArgs() + { + $e = $this->getTestException(1); + ExceptionCaster::$traceArgs = false; + + $expectedDump = <<<'EODUMP' +Exception { + #message: "1" + #code: 0 + #file: "%sExceptionCasterTest.php" + #line: 27 + -trace: { + %sExceptionCasterTest.php:27: { + : { + : return new \Exception(''.$msg); + : } + } + %sExceptionCasterTest.php:%d: { + : { + : $e = $this->getTestException(1); + : ExceptionCaster::$traceArgs = false; + } +%A +EODUMP; + + $this->assertDumpMatchesFormat($expectedDump, $e); + } + + public function testNoSrcContext() + { + $e = $this->getTestException(1); + ExceptionCaster::$srcContext = -1; + + $expectedDump = <<<'EODUMP' +Exception { + #message: "1" + #code: 0 + #file: "%sExceptionCasterTest.php" + #line: 27 + -trace: { + %sExceptionCasterTest.php: 27 + %sExceptionCasterTest.php: %d +%A +EODUMP; + + $this->assertDumpMatchesFormat($expectedDump, $e); + } + + public function testHtmlDump() + { + $e = $this->getTestException(1); + ExceptionCaster::$srcContext = -1; + + $cloner = new VarCloner(); + $cloner->setMaxItems(1); + $dumper = new HtmlDumper(); + $dumper->setDumpHeader(''); + $dumper->setDumpBoundaries('', ''); + $dump = $dumper->dump($cloner->cloneVar($e)->withRefHandles(false), true); + + $expectedDump = <<<'EODUMP' +Exception { + #message: "1" + #code: 0 + #file: "%sTests%eCaster%eExceptionCasterTest.php" + #line: 27 + -trace: { + %sVarDumper%eTests%eCaster%eExceptionCasterTest.php: 27 + …%d + } +} + +EODUMP; + + $this->assertStringMatchesFormat($expectedDump, $dump); + } + + /** + * @requires function Twig\Template::getSourceContext + */ + public function testFrameWithTwig() + { + require_once dirname(__DIR__).'/Fixtures/Twig.php'; + + $f = array( + new FrameStub(array( + 'file' => dirname(__DIR__).'/Fixtures/Twig.php', + 'line' => 20, + 'class' => '__TwigTemplate_VarDumperFixture_u75a09', + )), + new FrameStub(array( + 'file' => dirname(__DIR__).'/Fixtures/Twig.php', + 'line' => 21, + 'class' => '__TwigTemplate_VarDumperFixture_u75a09', + 'object' => new \__TwigTemplate_VarDumperFixture_u75a09(null, __FILE__), + )), + ); + + $expectedDump = <<<'EODUMP' +array:2 [ + 0 => { + class: "__TwigTemplate_VarDumperFixture_u75a09" + src: { + %sTwig.php:1: { + : + : foo bar + : twig source + } + } + } + 1 => { + class: "__TwigTemplate_VarDumperFixture_u75a09" + object: __TwigTemplate_VarDumperFixture_u75a09 { + %A + } + src: { + %sExceptionCasterTest.php:2: { + : foo bar + : twig source + : + } + } + } +] + +EODUMP; + + $this->assertDumpMatchesFormat($expectedDump, $f); + } +} diff --git a/htdocs/includes/symfony/var-dumper/Tests/Caster/PdoCasterTest.php b/htdocs/includes/symfony/var-dumper/Tests/Caster/PdoCasterTest.php index faa65341170..000e5feeb12 100644 --- a/htdocs/includes/symfony/var-dumper/Tests/Caster/PdoCasterTest.php +++ b/htdocs/includes/symfony/var-dumper/Tests/Caster/PdoCasterTest.php @@ -11,14 +11,18 @@ namespace Symfony\Component\VarDumper\Tests\Caster; +use PHPUnit\Framework\TestCase; use Symfony\Component\VarDumper\Caster\PdoCaster; use Symfony\Component\VarDumper\Cloner\Stub; +use Symfony\Component\VarDumper\Test\VarDumperTestTrait; /** * @author Nicolas Grekas */ -class PdoCasterTest extends \PHPUnit_Framework_TestCase +class PdoCasterTest extends TestCase { + use VarDumperTestTrait; + /** * @requires extension pdo_sqlite */ @@ -36,22 +40,25 @@ class PdoCasterTest extends \PHPUnit_Framework_TestCase $this->assertSame('NATURAL', $attr['CASE']->class); $this->assertSame('BOTH', $attr['DEFAULT_FETCH_MODE']->class); - $xCast = array( - "\0~\0inTransaction" => $pdo->inTransaction(), - "\0~\0attributes" => array( - 'CASE' => $attr['CASE'], - 'ERRMODE' => $attr['ERRMODE'], - 'PERSISTENT' => false, - 'DRIVER_NAME' => 'sqlite', - 'ORACLE_NULLS' => $attr['ORACLE_NULLS'], - 'CLIENT_VERSION' => $pdo->getAttribute(\PDO::ATTR_CLIENT_VERSION), - 'SERVER_VERSION' => $pdo->getAttribute(\PDO::ATTR_SERVER_VERSION), - 'STATEMENT_CLASS' => array('PDOStatement'), - 'DEFAULT_FETCH_MODE' => $attr['DEFAULT_FETCH_MODE'], - ), - ); - unset($cast["\0~\0attributes"]['STATEMENT_CLASS'][1]); + $xDump = <<<'EODUMP' +array:2 [ + "\x00~\x00inTransaction" => false + "\x00~\x00attributes" => array:9 [ + "CASE" => NATURAL + "ERRMODE" => SILENT + "PERSISTENT" => false + "DRIVER_NAME" => "sqlite" + "ORACLE_NULLS" => NATURAL + "CLIENT_VERSION" => "%s" + "SERVER_VERSION" => "%s" + "STATEMENT_CLASS" => array:%d [ + 0 => "PDOStatement"%A + ] + "DEFAULT_FETCH_MODE" => BOTH + ] +] +EODUMP; - $this->assertSame($xCast, $cast); + $this->assertDumpMatchesFormat($xDump, $cast); } } diff --git a/htdocs/includes/symfony/var-dumper/Tests/Caster/RedisCasterTest.php b/htdocs/includes/symfony/var-dumper/Tests/Caster/RedisCasterTest.php new file mode 100644 index 00000000000..af038192f5c --- /dev/null +++ b/htdocs/includes/symfony/var-dumper/Tests/Caster/RedisCasterTest.php @@ -0,0 +1,85 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Tests\Caster; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\VarDumper\Test\VarDumperTestTrait; + +/** + * @author Nicolas Grekas + * @requires extension redis + */ +class RedisCasterTest extends TestCase +{ + use VarDumperTestTrait; + + public function testNotConnected() + { + $redis = new \Redis(); + + if (defined('HHVM_VERSION_ID')) { + $xCast = <<<'EODUMP' +Redis { + #host: "" +%A +} +EODUMP; + } else { + $xCast = <<<'EODUMP' +Redis { + isConnected: false +} +EODUMP; + } + + $this->assertDumpMatchesFormat($xCast, $redis); + } + + public function testConnected() + { + $redis = new \Redis(); + if (!@$redis->connect('127.0.0.1')) { + $e = error_get_last(); + self::markTestSkipped($e['message']); + } + + if (defined('HHVM_VERSION_ID')) { + $xCast = <<<'EODUMP' +Redis { + #host: "127.0.0.1" +%A +} +EODUMP; + } else { + $xCast = <<<'EODUMP' +Redis { + +"socket": Redis Socket Buffer resource + isConnected: true + host: "127.0.0.1" + port: 6379 + auth: null + dbNum: 0 + timeout: 0.0 + persistentId: null + options: { + READ_TIMEOUT: 0.0 + SERIALIZER: NONE + PREFIX: null + SCAN: NORETRY + } +} +EODUMP; + } + + $this->assertDumpMatchesFormat($xCast, $redis); + } +} diff --git a/htdocs/includes/symfony/var-dumper/Tests/Caster/ReflectionCasterTest.php b/htdocs/includes/symfony/var-dumper/Tests/Caster/ReflectionCasterTest.php index 0d7147fbcd2..5495a78e40f 100644 --- a/htdocs/includes/symfony/var-dumper/Tests/Caster/ReflectionCasterTest.php +++ b/htdocs/includes/symfony/var-dumper/Tests/Caster/ReflectionCasterTest.php @@ -11,13 +11,15 @@ namespace Symfony\Component\VarDumper\Tests\Caster; +use PHPUnit\Framework\TestCase; use Symfony\Component\VarDumper\Test\VarDumperTestTrait; use Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo; +use Symfony\Component\VarDumper\Tests\Fixtures\NotLoadableClass; /** * @author Nicolas Grekas */ -class ReflectionCasterTest extends \PHPUnit_Framework_TestCase +class ReflectionCasterTest extends TestCase { use VarDumperTestTrait; @@ -49,7 +51,7 @@ ReflectionClass { "export" => ReflectionMethod { +name: "export" +class: "ReflectionClass" - parameters: { +%A parameters: { $%s: ReflectionParameter { %A position: 0 %A @@ -75,7 +77,7 @@ Closure { \$b: & 123 } file: "%sReflectionCasterTest.php" - line: "65 to 65" + line: "67 to 67" } EOTXT , $var @@ -91,7 +93,7 @@ EOTXT ReflectionParameter { +name: "arg1" position: 0 - typeHint: "Symfony\Component\VarDumper\Tests\Caster\NotExistingClass" + typeHint: "Symfony\Component\VarDumper\Tests\Fixtures\NotLoadableClass" default: null } EOTXT @@ -146,83 +148,88 @@ EOTXT */ public function testGenerator() { - $g = new GeneratorDemo(); - $g = $g->baz(); - $r = new \ReflectionGenerator($g); + if (extension_loaded('xdebug')) { + $this->markTestSkipped('xdebug is active'); + } - $xDump = <<<'EODUMP' + $generator = new GeneratorDemo(); + $generator = $generator->baz(); + + $expectedDump = <<<'EODUMP' Generator { this: Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo { …} executing: { Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo->baz(): { - %sGeneratorDemo.php:14: """ - {\n - yield from bar();\n - }\n - """ + %sGeneratorDemo.php:14: { + : { + : yield from bar(); + : } + } } } + closed: false } EODUMP; - $this->assertDumpMatchesFormat($xDump, $g); + $this->assertDumpMatchesFormat($expectedDump, $generator); - foreach ($g as $v) { + foreach ($generator as $v) { break; } - $xDump = <<<'EODUMP' + $expectedDump = <<<'EODUMP' array:2 [ 0 => ReflectionGenerator { this: Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo { …} trace: { - 3. Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo::foo() ==> yield(): { - src: { - %sGeneratorDemo.php:9: """ - {\n - yield 1;\n - }\n - """ - } + %sGeneratorDemo.php:9: { + : { + : yield 1; + : } } - 2. Symfony\Component\VarDumper\Tests\Fixtures\bar() ==> Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo::foo(): { - src: { - %sGeneratorDemo.php:20: """ - {\n - yield from GeneratorDemo::foo();\n - }\n - """ - } + %sGeneratorDemo.php:20: { + : { + : yield from GeneratorDemo::foo(); + : } } - 1. Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo->baz() ==> Symfony\Component\VarDumper\Tests\Fixtures\bar(): { - src: { - %sGeneratorDemo.php:14: """ - {\n - yield from bar();\n - }\n - """ - } + %sGeneratorDemo.php:14: { + : { + : yield from bar(); + : } } } + closed: false } 1 => Generator { executing: { Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo::foo(): { - %sGeneratorDemo.php:10: """ - yield 1;\n - }\n - \n - """ + %sGeneratorDemo.php:10: { + : yield 1; + : } + : + } } } + closed: false } ] EODUMP; - $this->assertDumpMatchesFormat($xDump, array($r, $r->getExecutingGenerator())); + $r = new \ReflectionGenerator($generator); + $this->assertDumpMatchesFormat($expectedDump, array($r, $r->getExecutingGenerator())); + + foreach ($generator as $v) { + } + + $expectedDump = <<<'EODUMP' +Generator { + closed: true +} +EODUMP; + $this->assertDumpMatchesFormat($expectedDump, $generator); } } -function reflectionParameterFixture(NotExistingClass $arg1 = null, $arg2) +function reflectionParameterFixture(NotLoadableClass $arg1 = null, $arg2) { } diff --git a/htdocs/includes/symfony/var-dumper/Tests/Caster/SplCasterTest.php b/htdocs/includes/symfony/var-dumper/Tests/Caster/SplCasterTest.php index 5d71e8d379d..e2181d90b5b 100644 --- a/htdocs/includes/symfony/var-dumper/Tests/Caster/SplCasterTest.php +++ b/htdocs/includes/symfony/var-dumper/Tests/Caster/SplCasterTest.php @@ -11,12 +11,13 @@ namespace Symfony\Component\VarDumper\Tests\Caster; +use PHPUnit\Framework\TestCase; use Symfony\Component\VarDumper\Test\VarDumperTestTrait; /** * @author Grégoire Pineau */ -class SplCasterTest extends \PHPUnit_Framework_TestCase +class SplCasterTest extends TestCase { use VarDumperTestTrait; @@ -57,12 +58,6 @@ SplFileInfo { pathname: "https://google.com/about" extension: "" realPath: false - writable: false - readable: false - executable: false - file: false - dir: false - link: false %A} EOTXT ), @@ -102,10 +97,10 @@ SplFileObject { file: true dir: false link: false -%AcsvControl: array:2 [ +%AcsvControl: array:%d [ 0 => "," 1 => """ - ] +%A] flags: DROP_NEW_LINE|SKIP_EMPTY maxLineLen: 0 fstat: array:26 [ @@ -123,4 +118,30 @@ SplFileObject { EOTXT; $this->assertDumpMatchesFormat($dump, $var); } + + /** + * @dataProvider provideCastSplDoublyLinkedList + */ + public function testCastSplDoublyLinkedList($modeValue, $modeDump) + { + $var = new \SplDoublyLinkedList(); + $var->setIteratorMode($modeValue); + $dump = <<assertDumpMatchesFormat($dump, $var); + } + + public function provideCastSplDoublyLinkedList() + { + return array( + array(\SplDoublyLinkedList::IT_MODE_FIFO, 'IT_MODE_FIFO | IT_MODE_KEEP'), + array(\SplDoublyLinkedList::IT_MODE_LIFO, 'IT_MODE_LIFO | IT_MODE_KEEP'), + array(\SplDoublyLinkedList::IT_MODE_FIFO | \SplDoublyLinkedList::IT_MODE_DELETE, 'IT_MODE_FIFO | IT_MODE_DELETE'), + array(\SplDoublyLinkedList::IT_MODE_LIFO | \SplDoublyLinkedList::IT_MODE_DELETE, 'IT_MODE_LIFO | IT_MODE_DELETE'), + ); + } } diff --git a/htdocs/includes/symfony/var-dumper/Tests/Caster/StubCasterTest.php b/htdocs/includes/symfony/var-dumper/Tests/Caster/StubCasterTest.php new file mode 100644 index 00000000000..c626b595f83 --- /dev/null +++ b/htdocs/includes/symfony/var-dumper/Tests/Caster/StubCasterTest.php @@ -0,0 +1,171 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Tests\Caster; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\VarDumper\Caster\ArgsStub; +use Symfony\Component\VarDumper\Caster\ClassStub; +use Symfony\Component\VarDumper\Caster\LinkStub; +use Symfony\Component\VarDumper\Cloner\VarCloner; +use Symfony\Component\VarDumper\Dumper\HtmlDumper; +use Symfony\Component\VarDumper\Test\VarDumperTestTrait; +use Symfony\Component\VarDumper\Tests\Fixtures\FooInterface; + +class StubCasterTest extends TestCase +{ + use VarDumperTestTrait; + + public function testArgsStubWithDefaults($foo = 234, $bar = 456) + { + $args = array(new ArgsStub(array(123), __FUNCTION__, __CLASS__)); + + $expectedDump = <<<'EODUMP' +array:1 [ + 0 => { + $foo: 123 + } +] +EODUMP; + + $this->assertDumpMatchesFormat($expectedDump, $args); + } + + public function testArgsStubWithExtraArgs($foo = 234) + { + $args = array(new ArgsStub(array(123, 456), __FUNCTION__, __CLASS__)); + + $expectedDump = <<<'EODUMP' +array:1 [ + 0 => { + $foo: 123 + ...: { + 456 + } + } +] +EODUMP; + + $this->assertDumpMatchesFormat($expectedDump, $args); + } + + public function testArgsStubNoParamWithExtraArgs() + { + $args = array(new ArgsStub(array(123), __FUNCTION__, __CLASS__)); + + $expectedDump = <<<'EODUMP' +array:1 [ + 0 => { + 123 + } +] +EODUMP; + + $this->assertDumpMatchesFormat($expectedDump, $args); + } + + public function testArgsStubWithClosure() + { + $args = array(new ArgsStub(array(123), '{closure}', null)); + + $expectedDump = <<<'EODUMP' +array:1 [ + 0 => { + 123 + } +] +EODUMP; + + $this->assertDumpMatchesFormat($expectedDump, $args); + } + + public function testLinkStub() + { + $var = array(new LinkStub(__CLASS__, 0, __FILE__)); + + $cloner = new VarCloner(); + $dumper = new HtmlDumper(); + $dumper->setDumpHeader(''); + $dumper->setDumpBoundaries('', ''); + $dumper->setDisplayOptions(array('fileLinkFormat' => '%f:%l')); + $dump = $dumper->dump($cloner->cloneVar($var), true); + + $expectedDump = <<<'EODUMP' +array:1 [ + 0 => "Symfony\Component\VarDumper\Tests\Caster\StubCasterTest" +] + +EODUMP; + + $this->assertStringMatchesFormat($expectedDump, $dump); + } + + public function testClassStub() + { + $var = array(new ClassStub('hello', array(FooInterface::class, 'foo'))); + + $cloner = new VarCloner(); + $dumper = new HtmlDumper(); + $dumper->setDumpHeader(''); + $dumper->setDumpBoundaries('', ''); + $dump = $dumper->dump($cloner->cloneVar($var), true, array('fileLinkFormat' => '%f:%l')); + + $expectedDump = <<<'EODUMP' +array:1 [ + 0 => "hello" +] + +EODUMP; + + $this->assertStringMatchesFormat($expectedDump, $dump); + } + + public function testClassStubWithNotExistingClass() + { + $var = array(new ClassStub(NotExisting::class)); + + $cloner = new VarCloner(); + $dumper = new HtmlDumper(); + $dumper->setDumpHeader(''); + $dumper->setDumpBoundaries('', ''); + $dump = $dumper->dump($cloner->cloneVar($var), true); + + $expectedDump = <<<'EODUMP' +array:1 [ + 0 => "Symfony\Component\VarDumper\Tests\Caster\NotExisting" +] + +EODUMP; + + $this->assertStringMatchesFormat($expectedDump, $dump); + } + + public function testClassStubWithNotExistingMethod() + { + $var = array(new ClassStub('hello', array(FooInterface::class, 'missing'))); + + $cloner = new VarCloner(); + $dumper = new HtmlDumper(); + $dumper->setDumpHeader(''); + $dumper->setDumpBoundaries('', ''); + $dump = $dumper->dump($cloner->cloneVar($var), true, array('fileLinkFormat' => '%f:%l')); + + $expectedDump = <<<'EODUMP' +array:1 [ + 0 => "hello" +] + +EODUMP; + + $this->assertStringMatchesFormat($expectedDump, $dump); + } +} diff --git a/htdocs/includes/symfony/var-dumper/Tests/Caster/XmlReaderCasterTest.php b/htdocs/includes/symfony/var-dumper/Tests/Caster/XmlReaderCasterTest.php new file mode 100644 index 00000000000..374d298af16 --- /dev/null +++ b/htdocs/includes/symfony/var-dumper/Tests/Caster/XmlReaderCasterTest.php @@ -0,0 +1,248 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Tests\Caster; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\VarDumper\Test\VarDumperTestTrait; + +/** + * @author Baptiste Clavié + */ +class XmlReaderCasterTest extends TestCase +{ + use VarDumperTestTrait; + + /** @var \XmlReader */ + private $reader; + + protected function setUp() + { + $this->reader = new \XmlReader(); + $this->reader->open(__DIR__.'/../Fixtures/xml_reader.xml'); + } + + protected function tearDown() + { + $this->reader->close(); + } + + public function testParserProperty() + { + $this->reader->setParserProperty(\XMLReader::SUBST_ENTITIES, true); + + $expectedDump = <<<'EODUMP' +XMLReader { + +nodeType: NONE + parserProperties: { + SUBST_ENTITIES: true + …3 + } + …12 +} +EODUMP; + + $this->assertDumpMatchesFormat($expectedDump, $this->reader); + } + + /** + * @dataProvider provideNodes + */ + public function testNodes($seek, $expectedDump) + { + while ($seek--) { + $this->reader->read(); + } + $this->assertDumpMatchesFormat($expectedDump, $this->reader); + } + + public function provideNodes() + { + return array( + array(0, <<<'EODUMP' +XMLReader { + +nodeType: NONE + …13 +} +EODUMP + ), + array(1, <<<'EODUMP' +XMLReader { + +localName: "foo" + +nodeType: ELEMENT + +baseURI: "%sxml_reader.xml" + …11 +} +EODUMP + ), + array(2, <<<'EODUMP' +XMLReader { + +localName: "#text" + +nodeType: SIGNIFICANT_WHITESPACE + +depth: 1 + +value: """ + \n + + """ + +baseURI: "%sxml_reader.xml" + …9 +} +EODUMP + ), + array(3, <<<'EODUMP' +XMLReader { + +localName: "bar" + +nodeType: ELEMENT + +depth: 1 + +baseURI: "%sxml_reader.xml" + …10 +} +EODUMP + ), + array(4, <<<'EODUMP' +XMLReader { + +localName: "bar" + +nodeType: END_ELEMENT + +depth: 1 + +baseURI: "%sxml_reader.xml" + …10 +} +EODUMP + ), + array(6, <<<'EODUMP' +XMLReader { + +localName: "bar" + +nodeType: ELEMENT + +depth: 1 + +isEmptyElement: true + +baseURI: "%sxml_reader.xml" + …9 +} +EODUMP + ), + array(9, <<<'EODUMP' +XMLReader { + +localName: "#text" + +nodeType: TEXT + +depth: 2 + +value: "With text" + +baseURI: "%sxml_reader.xml" + …9 +} +EODUMP + ), + array(12, <<<'EODUMP' +XMLReader { + +localName: "bar" + +nodeType: ELEMENT + +depth: 1 + +attributeCount: 2 + +baseURI: "%sxml_reader.xml" + …9 +} +EODUMP + ), + array(13, <<<'EODUMP' +XMLReader { + +localName: "bar" + +nodeType: END_ELEMENT + +depth: 1 + +baseURI: "%sxml_reader.xml" + …10 +} +EODUMP + ), + array(15, <<<'EODUMP' +XMLReader { + +localName: "bar" + +nodeType: ELEMENT + +depth: 1 + +attributeCount: 1 + +baseURI: "%sxml_reader.xml" + …9 +} +EODUMP + ), + array(16, <<<'EODUMP' +XMLReader { + +localName: "#text" + +nodeType: SIGNIFICANT_WHITESPACE + +depth: 2 + +value: """ + \n + + """ + +baseURI: "%sxml_reader.xml" + …9 +} +EODUMP + ), + array(17, <<<'EODUMP' +XMLReader { + +localName: "baz" + +prefix: "baz" + +nodeType: ELEMENT + +depth: 2 + +namespaceURI: "http://symfony.com" + +baseURI: "%sxml_reader.xml" + …8 +} +EODUMP + ), + array(18, <<<'EODUMP' +XMLReader { + +localName: "baz" + +prefix: "baz" + +nodeType: END_ELEMENT + +depth: 2 + +namespaceURI: "http://symfony.com" + +baseURI: "%sxml_reader.xml" + …8 +} +EODUMP + ), + array(19, <<<'EODUMP' +XMLReader { + +localName: "#text" + +nodeType: SIGNIFICANT_WHITESPACE + +depth: 2 + +value: """ + \n + + """ + +baseURI: "%sxml_reader.xml" + …9 +} +EODUMP + ), + array(21, <<<'EODUMP' +XMLReader { + +localName: "#text" + +nodeType: SIGNIFICANT_WHITESPACE + +depth: 1 + +value: "\n" + +baseURI: "%sxml_reader.xml" + …9 +} +EODUMP + ), + array(22, <<<'EODUMP' +XMLReader { + +localName: "foo" + +nodeType: END_ELEMENT + +baseURI: "%sxml_reader.xml" + …11 +} +EODUMP + ), + ); + } +} diff --git a/htdocs/includes/symfony/var-dumper/Tests/CliDumperTest.php b/htdocs/includes/symfony/var-dumper/Tests/CliDumperTest.php index cd6d64d1c03..1e0809c1fbd 100644 --- a/htdocs/includes/symfony/var-dumper/Tests/CliDumperTest.php +++ b/htdocs/includes/symfony/var-dumper/Tests/CliDumperTest.php @@ -11,14 +11,17 @@ namespace Symfony\Component\VarDumper\Tests; +use PHPUnit\Framework\TestCase; use Symfony\Component\VarDumper\Cloner\VarCloner; use Symfony\Component\VarDumper\Dumper\CliDumper; use Symfony\Component\VarDumper\Test\VarDumperTestTrait; +use Twig\Environment; +use Twig\Loader\FilesystemLoader; /** * @author Nicolas Grekas */ -class CliDumperTest extends \PHPUnit_Framework_TestCase +class CliDumperTest extends TestCase { use VarDumperTestTrait; @@ -62,15 +65,12 @@ array:24 [ 7 => b"é\\x00" "[]" => [] "res" => stream resource {@{$res} - wrapper_type: "plainfile" +%A wrapper_type: "plainfile" stream_type: "STDIO" mode: "r" unread_bytes: 0 seekable: true - timed_out: false - blocked: true - eof: false - options: [] +%A options: [] } "obj" => Symfony\Component\VarDumper\Tests\Fixture\DumbFoo {#%d +foo: "foo" @@ -118,7 +118,7 @@ EOTXT $var = xml_parser_create(); $this->assertDumpMatchesFormat( - <<= 70200) { + $this->assertDumpMatchesFormat( + <<<'EOTXT' +array:4 [ + 0 => {} + 1 => &1 null + 2 => &1 null + "" => 2 +] +EOTXT + , + $var + ); + } else { + $this->assertDumpMatchesFormat( + <<<'EOTXT' +array:4 [ + "0" => {} + "1" => &1 null + 0 => &1 null + "" => 2 +] +EOTXT + , + $var + ); + } + } + + public function testObjectCast() + { + $var = (object) array(1 => 1); + $var->{1} = 2; + + if (\PHP_VERSION_ID >= 70200) { + $this->assertDumpMatchesFormat( + <<<'EOTXT' +{ + +"1": 2 +} +EOTXT + , + $var + ); + } else { + $this->assertDumpMatchesFormat( + <<<'EOTXT' +{ + +1: 1 + +"1": 2 +} +EOTXT + , + $var + ); + } + } + public function testClosedResource() { if (defined('HHVM_VERSION') && HHVM_VERSION_ID < 30600) { @@ -152,7 +218,7 @@ EOTXT $this->assertStringMatchesFormat( << 'bar'), + ); + + $this->assertDumpEquals( + << (3) "foo" + 2 => (3) "bar" + ] +] +EOTXT + , + $var + ); + + putenv('DUMP_LIGHT_ARRAY='); + putenv('DUMP_STRING_LENGTH='); + } + + /** + * @requires function Twig\Template::getSourceContext + */ public function testThrowingCaster() { $out = fopen('php://memory', 'r+b'); require_once __DIR__.'/Fixtures/Twig.php'; - $twig = new \__TwigTemplate_VarDumperFixture_u75a09(new \Twig_Environment(new \Twig_Loader_Filesystem())); + $twig = new \__TwigTemplate_VarDumperFixture_u75a09(new Environment(new FilesystemLoader())); $dumper = new CliDumper(); $dumper->setColors(false); @@ -181,96 +282,56 @@ EOTXT ':stream' => eval('return function () use ($twig) { try { $twig->render(array()); - } catch (\Twig_Error_Runtime $e) { + } catch (\Twig\Error\RuntimeError $e) { throw $e->getPrevious(); } };'), )); - $line = __LINE__ - 2; $ref = (int) $out; $data = $cloner->cloneVar($out); $dumper->dump($data, $out); - rewind($out); - $out = stream_get_contents($out); - - if (method_exists($twig, 'getSource')) { - $twig = <<assertStringMatchesFormat( <<doDisplay(\$context, \$blocks); + : } catch (Twig%sError \$e) { + } + %sTemplate.php:%d: { + : { + : \$this->displayWithErrorHandling(\$this->env->mergeGlobals(\$context), array_merge(\$this->blocks, \$blocks)); + : } + } + %sTemplate.php:%d: { + : try { + : \$this->display(\$context); + : } catch (%s \$e) { + } + %sCliDumperTest.php:%d: { +%A + } + } + } +%Awrapper_type: "PHP" stream_type: "MEMORY" mode: "%s+b" unread_bytes: 0 seekable: true uri: "php://memory" - timed_out: false - blocked: true - eof: false - options: [] - ⚠: Symfony\Component\VarDumper\Exception\ThrowingCasterException {{$r} - #message: "Unexpected Exception thrown from a caster: Foobar" - -trace: { - %d. __TwigTemplate_VarDumperFixture_u75a09->doDisplay() ==> new Exception(): { - src: { - %sTwig.php:19: """ - // line 2\\n - throw new \Exception('Foobar');\\n - }\\n - """ -{$twig} } - } - %d. Twig_Template->displayWithErrorHandling() ==> __TwigTemplate_VarDumperFixture_u75a09->doDisplay(): { - src: { - %sTemplate.php:%d: """ - try {\\n - \$this->doDisplay(\$context, \$blocks);\\n - } catch (Twig_Error \$e) {\\n - """ - } - } - %d. Twig_Template->display() ==> Twig_Template->displayWithErrorHandling(): { - src: { - %sTemplate.php:%d: """ - {\\n - \$this->displayWithErrorHandling(\$this->env->mergeGlobals(\$context), array_merge(\$this->blocks, \$blocks));\\n - }\\n - """ - } - } - %d. Twig_Template->render() ==> Twig_Template->display(): { - src: { - %sTemplate.php:%d: """ - try {\\n - \$this->display(\$context);\\n - } catch (Exception \$e) {\\n - """ - } - } - %d. %slosure%s() ==> Twig_Template->render(): { - src: { - %sCliDumperTest.php:{$line}: """ - }\\n - };'),\\n - ));\\n - """ - } - } - } - } +%Aoptions: [] } EOTXT @@ -288,11 +349,8 @@ EOTXT $dumper->setColors(false); $cloner = new VarCloner(); - $out = fopen('php://memory', 'r+b'); $data = $cloner->cloneVar($var); - $dumper->dump($data, $out); - rewind($out); - $out = stream_get_contents($out); + $out = $dumper->dump($data, true); $r = defined('HHVM_VERSION') ? '' : '#%d'; $this->assertStringMatchesFormat( @@ -318,7 +376,7 @@ EOTXT $var = $this->getSpecialVars(); $this->assertDumpEquals( - << array:1 [ 0 => &1 array:1 [ @@ -364,7 +422,7 @@ EOTXT $dumper->dump($data); $this->assertSame( - << array:1 [ "GLOBALS" => &1 array:1 [ @@ -386,7 +444,7 @@ EOTXT */ public function testBuggyRefs() { - if (PHP_VERSION_ID >= 50600) { + if (\PHP_VERSION_ID >= 50600) { $this->markTestSkipped('PHP 5.6 fixed refs counting'); } @@ -406,7 +464,7 @@ EOTXT }); $this->assertSame( - << array:1 [ 0 => array:1 [ @@ -421,6 +479,21 @@ EOTXT ); } + public function testIncompleteClass() + { + $unserializeCallbackHandler = ini_set('unserialize_callback_func', null); + $var = unserialize('O:8:"Foo\Buzz":0:{}'); + ini_set('unserialize_callback_func', $unserializeCallbackHandler); + + $this->assertDumpMatchesFormat( + <<parent = false; - - $this->blocks = array( - ); + $this->blocks = array(); + $this->path = $path; } protected function doDisplay(array $context, array $blocks = array()) @@ -26,9 +28,11 @@ class __TwigTemplate_VarDumperFixture_u75a09 extends Twig_Template public function getDebugInfo() { - return array (19 => 2); + return array(20 => 1, 21 => 2); + } + + public function getSourceContext() + { + return new Twig\Source(" foo bar\n twig source\n\n", 'foo.twig', $this->path ?: __FILE__); } } -/* foo bar*/ -/* twig source*/ -/* */ diff --git a/htdocs/includes/symfony/var-dumper/Tests/Fixtures/xml_reader.xml b/htdocs/includes/symfony/var-dumper/Tests/Fixtures/xml_reader.xml new file mode 100644 index 00000000000..740c399fc44 --- /dev/null +++ b/htdocs/includes/symfony/var-dumper/Tests/Fixtures/xml_reader.xml @@ -0,0 +1,10 @@ + + + + + With text + + + + + diff --git a/htdocs/includes/symfony/var-dumper/Tests/HtmlDumperTest.php b/htdocs/includes/symfony/var-dumper/Tests/HtmlDumperTest.php index 3090435c5d4..24b4bf6d283 100644 --- a/htdocs/includes/symfony/var-dumper/Tests/HtmlDumperTest.php +++ b/htdocs/includes/symfony/var-dumper/Tests/HtmlDumperTest.php @@ -11,13 +11,14 @@ namespace Symfony\Component\VarDumper\Tests; +use PHPUnit\Framework\TestCase; use Symfony\Component\VarDumper\Cloner\VarCloner; use Symfony\Component\VarDumper\Dumper\HtmlDumper; /** * @author Nicolas Grekas */ -class HtmlDumperTest extends \PHPUnit_Framework_TestCase +class HtmlDumperTest extends TestCase { public function testGet() { @@ -59,26 +60,24 @@ class HtmlDumperTest extends \PHPUnit_Framework_TestCase 4 => INF 5 => -INF 6 => {$intMax} - "str" => "d&%s;j&%s;\\n" - 7 => b"&%s;\\x00" + "str" => "d&%s;j&%s;\\n" + 7 => b"&%s;\\x00" "[]" => [] "res" => stream resource @{$res} - wrapper_type: "plainfile" +%A wrapper_type: "plainfile" stream_type: "STDIO" mode: "r" unread_bytes: 0 seekable: true - timed_out: false - blocked: true - eof: false - options: [] +%A options: [] } "obj" => DumbFoo {#%d +foo: "foo" +"bar": "bar" } "closure" => Closure {{$r} - class: "Symfony\Component\VarDumper\Tests\HtmlDumperTest" + class: "Symfony\Component\VarDumper\Tests\HtmlDumperTest" this: HtmlDumperTest {{$r} &%s;} parameters: { \$a: {} @@ -87,7 +86,8 @@ class HtmlDumperTest extends \PHPUnit_Framework_TestCase default: null } } - file: "{$var['file']}" + file: "%sTests%eFixtures%edumb-var.php" line: "{$var['line']} to {$var['line']}" } "line" => {$var['line']} @@ -123,19 +123,41 @@ EOTXT $cloner = new VarCloner(); $data = $cloner->cloneVar($var); - $out = fopen('php://memory', 'r+b'); - $dumper->dump($data, $out); - rewind($out); - $out = stream_get_contents($out); + $out = $dumper->dump($data, true); $this->assertStringMatchesFormat( - <<b"Словарь" EOTXT , + $out + ); + } + public function testAppend() + { + $out = fopen('php://memory', 'r+b'); + + $dumper = new HtmlDumper(); + $dumper->setDumpHeader(''); + $dumper->setDumpBoundaries('', ''); + $cloner = new VarCloner(); + + $dumper->dump($cloner->cloneVar(123), $out); + $dumper->dump($cloner->cloneVar(456), $out); + + $out = stream_get_contents($out, -1, 0); + + $this->assertSame(<<<'EOTXT' +123 + +456 + + +EOTXT + , $out ); } diff --git a/htdocs/includes/symfony/var-dumper/Tests/Test/VarDumperTestTraitTest.php b/htdocs/includes/symfony/var-dumper/Tests/Test/VarDumperTestTraitTest.php index 3295797179c..464d67f6cec 100644 --- a/htdocs/includes/symfony/var-dumper/Tests/Test/VarDumperTestTraitTest.php +++ b/htdocs/includes/symfony/var-dumper/Tests/Test/VarDumperTestTraitTest.php @@ -11,9 +11,10 @@ namespace Symfony\Component\VarDumper\Tests\Test; +use PHPUnit\Framework\TestCase; use Symfony\Component\VarDumper\Test\VarDumperTestTrait; -class VarDumperTestTraitTest extends \PHPUnit_Framework_TestCase +class VarDumperTestTraitTest extends TestCase { use VarDumperTestTrait; diff --git a/htdocs/includes/symfony/var-dumper/Tests/VarClonerTest.php b/htdocs/includes/symfony/var-dumper/Tests/VarClonerTest.php index 31e3a40ae04..2181905e4a3 100644 --- a/htdocs/includes/symfony/var-dumper/Tests/VarClonerTest.php +++ b/htdocs/includes/symfony/var-dumper/Tests/VarClonerTest.php @@ -11,12 +11,13 @@ namespace Symfony\Component\VarDumper\Tests; +use PHPUnit\Framework\TestCase; use Symfony\Component\VarDumper\Cloner\VarCloner; /** * @author Nicolas Grekas */ -class VarClonerTest extends \PHPUnit_Framework_TestCase +class VarClonerTest extends TestCase { public function testMaxIntBoundary() { @@ -41,6 +42,10 @@ Symfony\Component\VarDumper\Cloner\Data Object [handle] => 0 [refCount] => 0 [position] => 1 + [attr] => Array + ( + ) + ) ) @@ -52,6 +57,8 @@ Symfony\Component\VarDumper\Cloner\Data Object ) + [position:Symfony\Component\VarDumper\Cloner\Data:private] => 0 + [key:Symfony\Component\VarDumper\Cloner\Data:private] => 0 [maxDepth:Symfony\Component\VarDumper\Cloner\Data:private] => 20 [maxItemsPerDepth:Symfony\Component\VarDumper\Cloner\Data:private] => -1 [useRefHandles:Symfony\Component\VarDumper\Cloner\Data:private] => -1 @@ -84,6 +91,10 @@ Symfony\Component\VarDumper\Cloner\Data Object [handle] => %i [refCount] => 0 [position] => 1 + [attr] => Array + ( + ) + ) ) @@ -99,6 +110,10 @@ Symfony\Component\VarDumper\Cloner\Data Object [handle] => %i [refCount] => 0 [position] => 2 + [attr] => Array + ( + ) + ) [\000+\0002] => Symfony\Component\VarDumper\Cloner\Stub Object @@ -110,6 +125,10 @@ Symfony\Component\VarDumper\Cloner\Data Object [handle] => %i [refCount] => 0 [position] => 3 + [attr] => Array + ( + ) + ) ) @@ -126,6 +145,8 @@ Symfony\Component\VarDumper\Cloner\Data Object ) + [position:Symfony\Component\VarDumper\Cloner\Data:private] => 0 + [key:Symfony\Component\VarDumper\Cloner\Data:private] => 0 [maxDepth:Symfony\Component\VarDumper\Cloner\Data:private] => 20 [maxItemsPerDepth:Symfony\Component\VarDumper\Cloner\Data:private] => -1 [useRefHandles:Symfony\Component\VarDumper\Cloner\Data:private] => -1 @@ -135,6 +156,86 @@ EOTXT; $this->assertStringMatchesFormat($expected, print_r($clone, true)); } + public function testJsonCast() + { + if (ini_get('xdebug.overload_var_dump') == 2) { + $this->markTestSkipped('xdebug is active'); + } + + $data = (array) json_decode('{"1":{}}'); + + $cloner = new VarCloner(); + $clone = $cloner->cloneVar($data); + + $expected = <<<'EOTXT' +object(Symfony\Component\VarDumper\Cloner\Data)#%i (6) { + ["data":"Symfony\Component\VarDumper\Cloner\Data":private]=> + array(2) { + [0]=> + array(1) { + [0]=> + object(Symfony\Component\VarDumper\Cloner\Stub)#%i (8) { + ["type"]=> + string(5) "array" + ["class"]=> + string(5) "assoc" + ["value"]=> + int(1) + ["cut"]=> + int(0) + ["handle"]=> + int(0) + ["refCount"]=> + int(0) + ["position"]=> + int(1) + ["attr"]=> + array(0) { + } + } + } + [1]=> + array(1) { + ["1"]=> + object(Symfony\Component\VarDumper\Cloner\Stub)#%i (8) { + ["type"]=> + string(6) "object" + ["class"]=> + string(8) "stdClass" + ["value"]=> + NULL + ["cut"]=> + int(0) + ["handle"]=> + int(%i) + ["refCount"]=> + int(0) + ["position"]=> + int(0) + ["attr"]=> + array(0) { + } + } + } + } + ["position":"Symfony\Component\VarDumper\Cloner\Data":private]=> + int(0) + ["key":"Symfony\Component\VarDumper\Cloner\Data":private]=> + int(0) + ["maxDepth":"Symfony\Component\VarDumper\Cloner\Data":private]=> + int(20) + ["maxItemsPerDepth":"Symfony\Component\VarDumper\Cloner\Data":private]=> + int(-1) + ["useRefHandles":"Symfony\Component\VarDumper\Cloner\Data":private]=> + int(-1) +} + +EOTXT; + ob_start(); + var_dump($clone); + $this->assertStringMatchesFormat(\PHP_VERSION_ID >= 70200 ? str_replace('"1"', '1', $expected) : $expected, ob_get_clean()); + } + public function testCaster() { $cloner = new VarCloner(array( @@ -165,6 +266,10 @@ Symfony\Component\VarDumper\Cloner\Data Object [handle] => %i [refCount] => 0 [position] => 1 + [attr] => Array + ( + ) + ) ) @@ -176,6 +281,8 @@ Symfony\Component\VarDumper\Cloner\Data Object ) + [position:Symfony\Component\VarDumper\Cloner\Data:private] => 0 + [key:Symfony\Component\VarDumper\Cloner\Data:private] => 0 [maxDepth:Symfony\Component\VarDumper\Cloner\Data:private] => 20 [maxItemsPerDepth:Symfony\Component\VarDumper\Cloner\Data:private] => -1 [useRefHandles:Symfony\Component\VarDumper\Cloner\Data:private] => -1 diff --git a/htdocs/includes/symfony/var-dumper/composer.json b/htdocs/includes/symfony/var-dumper/composer.json index 05955f69430..44dbdebcce2 100644 --- a/htdocs/includes/symfony/var-dumper/composer.json +++ b/htdocs/includes/symfony/var-dumper/composer.json @@ -20,9 +20,14 @@ "symfony/polyfill-mbstring": "~1.0" }, "require-dev": { - "twig/twig": "~1.20|~2.0" + "ext-iconv": "*", + "twig/twig": "~1.34|~2.4" + }, + "conflict": { + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0" }, "suggest": { + "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", "ext-symfony_debug": "" }, "autoload": { @@ -35,7 +40,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.2-dev" } } } diff --git a/htdocs/includes/symfony/var-dumper/phpunit.xml.dist b/htdocs/includes/symfony/var-dumper/phpunit.xml.dist index bb16a3a4ec0..4a25f42db82 100644 --- a/htdocs/includes/symfony/var-dumper/phpunit.xml.dist +++ b/htdocs/includes/symfony/var-dumper/phpunit.xml.dist @@ -5,9 +5,13 @@ backupGlobals="false" colors="true" bootstrap="vendor/autoload.php" + failOnRisky="true" + failOnWarning="true" > + + From f22a02a7ef14856b885bf3bccafd53969d197236 Mon Sep 17 00:00:00 2001 From: Quentin VIAL-GOUTEYRON Date: Tue, 3 Aug 2021 11:21:47 +0200 Subject: [PATCH 0034/1460] fix br --- htdocs/core/lib/pdf.lib.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 3beed062548..8d56c50ae79 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -2286,12 +2286,12 @@ function pdf_getLinkedObjects(&$object, $outputlangs) $outputlangs->load('orders'); if (count($objects) > 1) { - $object->note_public .= '
'.$outputlangs->transnoentities("RefOrder").' :
'; + $object->note_public .= '
'.$outputlangs->transnoentities("RefOrder").' :
'; foreach ($objects as $elementobject) { $object->note_public .= $outputlangs->transnoentities($elementobject->ref).($elementobject->ref_client ? ' ('.$elementobject->ref_client.')' : '').($elementobject->ref_supplier ? ' ('.$elementobject->ref_supplier.')' : '').' '; $object->note_public .= $outputlangs->transnoentities("OrderDate").' : '; $object->note_public .= dol_print_date($elementobject->date, 'day', '', $outputlangs); - $object->note_public .= '
'; + $object->note_public .= '
'; } } elseif (count($objects) == 1) { $elementobject = array_shift($objects); @@ -2321,8 +2321,8 @@ function pdf_getLinkedObjects(&$object, $outputlangs) if (count($objects) > 1) { $order = null; - if (empty($object->linkedObjects['commande']) && $object->element != 'commande') $object->note_public .= '
'.$outputlangs->transnoentities("RefOrder").' / '.$outputlangs->transnoentities("RefSending").' :
'; - else $object->note_public .= '
'.$outputlangs->transnoentities("RefSending").' :
'; + if (empty($object->linkedObjects['commande']) && $object->element != 'commande') $object->note_public .= '
'.$outputlangs->transnoentities("RefOrder").' / '.$outputlangs->transnoentities("RefSending").' :
'; + else $object->note_public .= '
'.$outputlangs->transnoentities("RefSending").' :
'; // We concat this record info into fields xxx_value. title is overwrote. foreach ($objects as $elementobject) { if (empty($object->linkedObjects['commande']) && $object->element != 'commande') { // There is not already a link to order and object is not the order, so we show also info with order @@ -2339,11 +2339,11 @@ function pdf_getLinkedObjects(&$object, $outputlangs) if (! is_object($order)) { $object->note_public .= $outputlangs->transnoentities($elementobject->ref); - $object->note_public .= '
'; + $object->note_public .= '
'; } else { $object->note_public .= $outputlangs->convToOutputCharset($order->ref).($order->ref_client ? ' ('.$order->ref_client.')' : ''); $object->note_public .= ' / '.$outputlangs->transnoentities($elementobject->ref); - $object->note_public .= '
'; + $object->note_public .= '
'; } } } elseif (count($objects) == 1) { From 2fab637b9211a2e94fd7c90b112f8549b9b0a488 Mon Sep 17 00:00:00 2001 From: Quentin VIAL-GOUTEYRON Date: Tue, 3 Aug 2021 11:26:57 +0200 Subject: [PATCH 0035/1460] add dol_concatdesc --- htdocs/core/lib/pdf.lib.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 8d56c50ae79..1f6bd167671 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -2286,12 +2286,12 @@ function pdf_getLinkedObjects(&$object, $outputlangs) $outputlangs->load('orders'); if (count($objects) > 1) { - $object->note_public .= '
'.$outputlangs->transnoentities("RefOrder").' :
'; + $object->note_public .= dol_concatdesc($object->note_public,'
'.$outputlangs->transnoentities("RefOrder").' :
'); foreach ($objects as $elementobject) { - $object->note_public .= $outputlangs->transnoentities($elementobject->ref).($elementobject->ref_client ? ' ('.$elementobject->ref_client.')' : '').($elementobject->ref_supplier ? ' ('.$elementobject->ref_supplier.')' : '').' '; - $object->note_public .= $outputlangs->transnoentities("OrderDate").' : '; - $object->note_public .= dol_print_date($elementobject->date, 'day', '', $outputlangs); - $object->note_public .= '
'; + $object->note_public .= dol_concatdesc($object->note_public,$outputlangs->transnoentities($elementobject->ref).($elementobject->ref_client ? ' ('.$elementobject->ref_client.')' : '').($elementobject->ref_supplier ? ' ('.$elementobject->ref_supplier.')' : '').' '); + $object->note_public .= dol_concatdesc($object->note_public,$outputlangs->transnoentities("OrderDate").' : '); + $object->note_public .= dol_concatdesc($object->note_public,dol_print_date($elementobject->date, 'day', '', $outputlangs)); + $object->note_public .= dol_concatdesc($object->note_public,'
'); } } elseif (count($objects) == 1) { $elementobject = array_shift($objects); @@ -2321,8 +2321,8 @@ function pdf_getLinkedObjects(&$object, $outputlangs) if (count($objects) > 1) { $order = null; - if (empty($object->linkedObjects['commande']) && $object->element != 'commande') $object->note_public .= '
'.$outputlangs->transnoentities("RefOrder").' / '.$outputlangs->transnoentities("RefSending").' :
'; - else $object->note_public .= '
'.$outputlangs->transnoentities("RefSending").' :
'; + if (empty($object->linkedObjects['commande']) && $object->element != 'commande') $object->note_public .= dol_concatdesc($object->note_public,'
'.$outputlangs->transnoentities("RefOrder").' / '.$outputlangs->transnoentities("RefSending").' :
'); + else $object->note_public .= dol_concatdesc($object->note_public,'
'.$outputlangs->transnoentities("RefSending").' :
'); // We concat this record info into fields xxx_value. title is overwrote. foreach ($objects as $elementobject) { if (empty($object->linkedObjects['commande']) && $object->element != 'commande') { // There is not already a link to order and object is not the order, so we show also info with order @@ -2338,12 +2338,12 @@ function pdf_getLinkedObjects(&$object, $outputlangs) } if (! is_object($order)) { - $object->note_public .= $outputlangs->transnoentities($elementobject->ref); - $object->note_public .= '
'; + $object->note_public .= dol_concatdesc($object->note_public,$outputlangs->transnoentities($elementobject->ref)); + $object->note_public .= dol_concatdesc($object->note_public,'
'); } else { - $object->note_public .= $outputlangs->convToOutputCharset($order->ref).($order->ref_client ? ' ('.$order->ref_client.')' : ''); - $object->note_public .= ' / '.$outputlangs->transnoentities($elementobject->ref); - $object->note_public .= '
'; + $object->note_public .= dol_concatdesc($object->note_public,$outputlangs->convToOutputCharset($order->ref).($order->ref_client ? ' ('.$order->ref_client.')' : '')); + $object->note_public .= dol_concatdesc($object->note_public,' / '.$outputlangs->transnoentities($elementobject->ref)); + $object->note_public .= dol_concatdesc($object->note_public,'
'); } } } elseif (count($objects) == 1) { From 9d2552e77b3e8bf1c4c24a5dfd703256ba7a1179 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 3 Aug 2021 09:29:25 +0000 Subject: [PATCH 0036/1460] Fixing style errors. --- htdocs/core/lib/pdf.lib.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 1f6bd167671..ca17b6a0d39 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -2286,12 +2286,12 @@ function pdf_getLinkedObjects(&$object, $outputlangs) $outputlangs->load('orders'); if (count($objects) > 1) { - $object->note_public .= dol_concatdesc($object->note_public,'
'.$outputlangs->transnoentities("RefOrder").' :
'); + $object->note_public .= dol_concatdesc($object->note_public, '
'.$outputlangs->transnoentities("RefOrder").' :
'); foreach ($objects as $elementobject) { - $object->note_public .= dol_concatdesc($object->note_public,$outputlangs->transnoentities($elementobject->ref).($elementobject->ref_client ? ' ('.$elementobject->ref_client.')' : '').($elementobject->ref_supplier ? ' ('.$elementobject->ref_supplier.')' : '').' '); - $object->note_public .= dol_concatdesc($object->note_public,$outputlangs->transnoentities("OrderDate").' : '); - $object->note_public .= dol_concatdesc($object->note_public,dol_print_date($elementobject->date, 'day', '', $outputlangs)); - $object->note_public .= dol_concatdesc($object->note_public,'
'); + $object->note_public .= dol_concatdesc($object->note_public, $outputlangs->transnoentities($elementobject->ref).($elementobject->ref_client ? ' ('.$elementobject->ref_client.')' : '').($elementobject->ref_supplier ? ' ('.$elementobject->ref_supplier.')' : '').' '); + $object->note_public .= dol_concatdesc($object->note_public, $outputlangs->transnoentities("OrderDate").' : '); + $object->note_public .= dol_concatdesc($object->note_public, dol_print_date($elementobject->date, 'day', '', $outputlangs)); + $object->note_public .= dol_concatdesc($object->note_public, '
'); } } elseif (count($objects) == 1) { $elementobject = array_shift($objects); @@ -2321,8 +2321,8 @@ function pdf_getLinkedObjects(&$object, $outputlangs) if (count($objects) > 1) { $order = null; - if (empty($object->linkedObjects['commande']) && $object->element != 'commande') $object->note_public .= dol_concatdesc($object->note_public,'
'.$outputlangs->transnoentities("RefOrder").' / '.$outputlangs->transnoentities("RefSending").' :
'); - else $object->note_public .= dol_concatdesc($object->note_public,'
'.$outputlangs->transnoentities("RefSending").' :
'); + if (empty($object->linkedObjects['commande']) && $object->element != 'commande') $object->note_public .= dol_concatdesc($object->note_public, '
'.$outputlangs->transnoentities("RefOrder").' / '.$outputlangs->transnoentities("RefSending").' :
'); + else $object->note_public .= dol_concatdesc($object->note_public, '
'.$outputlangs->transnoentities("RefSending").' :
'); // We concat this record info into fields xxx_value. title is overwrote. foreach ($objects as $elementobject) { if (empty($object->linkedObjects['commande']) && $object->element != 'commande') { // There is not already a link to order and object is not the order, so we show also info with order @@ -2338,12 +2338,12 @@ function pdf_getLinkedObjects(&$object, $outputlangs) } if (! is_object($order)) { - $object->note_public .= dol_concatdesc($object->note_public,$outputlangs->transnoentities($elementobject->ref)); - $object->note_public .= dol_concatdesc($object->note_public,'
'); + $object->note_public .= dol_concatdesc($object->note_public, $outputlangs->transnoentities($elementobject->ref)); + $object->note_public .= dol_concatdesc($object->note_public, '
'); } else { - $object->note_public .= dol_concatdesc($object->note_public,$outputlangs->convToOutputCharset($order->ref).($order->ref_client ? ' ('.$order->ref_client.')' : '')); - $object->note_public .= dol_concatdesc($object->note_public,' / '.$outputlangs->transnoentities($elementobject->ref)); - $object->note_public .= dol_concatdesc($object->note_public,'
'); + $object->note_public .= dol_concatdesc($object->note_public, $outputlangs->convToOutputCharset($order->ref).($order->ref_client ? ' ('.$order->ref_client.')' : '')); + $object->note_public .= dol_concatdesc($object->note_public, ' / '.$outputlangs->transnoentities($elementobject->ref)); + $object->note_public .= dol_concatdesc($object->note_public, '
'); } } } elseif (count($objects) == 1) { From 04d406bd39963ea27307bf9316c7db8734f7b189 Mon Sep 17 00:00:00 2001 From: jpb Date: Thu, 5 Aug 2021 09:09:11 +0200 Subject: [PATCH 0037/1460] remove useless boolean statment --- htdocs/core/tpl/objectline_create.tpl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index d09a3257d87..1b5cfff66f2 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -676,11 +676,11 @@ if (!empty($usemargins) && $user->rights->margins->creer) { } ?> -table_element_line != 'commande_fournisseurdet' || $this->table_element_line == 'facture_fourn_det') { ?> +table_element_line != 'commande_fournisseurdet') { ?> $("#date_start, #date_end").focusout(function() { let type = $(this).attr('type'); - let mandatoryP = $(this).attr('mandatoryperiod'); + let mandatoryP = $(this).attr('mandatoryperiod'); if (type == 1 && mandatoryP == 1 ){ if ( $(this).val() == '' && !$(this).hasClass("error") ) { $(this).addClass('error'); From 52a255e0cb9a9ed95e8781849b2aff827d4986d8 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Thu, 12 Aug 2021 10:10:57 +0200 Subject: [PATCH 0038/1460] move at bottom of pdf_other.php page --- htdocs/admin/pdf.php | 5 ---- htdocs/admin/pdf_other.php | 59 +++++++++++++++++++++----------------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 256038d356c..540d8318dd1 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -330,11 +330,6 @@ print ''.$langs->trans("MAIN_DOCUMENTS_LOGO_HEIGHT").'global->MAIN_DOCUMENTS_LOGO_HEIGHT) ? $conf->global->MAIN_DOCUMENTS_LOGO_HEIGHT : 20).'">'; print ''; -// Width of picture product lign -print ''.$langs->trans("MAIN_DOCUMENTS_WITH_PICTURE_WIDTH").''; -print ''; -print ''; - // Show project if (!empty($conf->projet->enabled)) { diff --git a/htdocs/admin/pdf_other.php b/htdocs/admin/pdf_other.php index 8a757a7d34c..3d0ff2ad23a 100644 --- a/htdocs/admin/pdf_other.php +++ b/htdocs/admin/pdf_other.php @@ -80,38 +80,43 @@ print dol_get_fiche_head($head, 'other', $langs->trans("other"), -1, 'pdf'); print ''.$form->textwithpicto($langs->trans("PDFOtherDesc"), $s)."
\n"; print "
\n"; +if (!empty($conf->propal->enabled)) { + print load_fiche_titre($langs->trans("Proposal"), '', ''); -print load_fiche_titre($langs->trans("Proposal"), '', ''); + print ''; + print ''; + print ''; -print ''; -print ''; -print ''; + print '
'; + print ''; + print ''; -print '
'; -print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; -print ''; + print ''; -print ''; + + // Width of picture product lign + print ''; + + print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("MAIN_GENERATE_PROPOSALS_WITH_PICTURE").''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_GENERATE_PROPOSALS_WITH_PICTURE'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("MAIN_GENERATE_PROPOSALS_WITH_PICTURE", $arrval, $conf->global->MAIN_GENERATE_PROPOSALS_WITH_PICTURE); + } + print '
'.$langs->trans("MAIN_GENERATE_PROPOSALS_WITH_PICTURE").''; -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('MAIN_GENERATE_PROPOSALS_WITH_PICTURE'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("MAIN_GENERATE_PROPOSALS_WITH_PICTURE", $arrval, $conf->global->MAIN_GENERATE_PROPOSALS_WITH_PICTURE); + print '
'.$langs->trans("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING").''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING", $arrval, $conf->global->MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING); + } + print '
'.$langs->trans("MAIN_DOCUMENTS_WITH_PICTURE_WIDTH").''; + print ''; + print '
'; + print '
'; } -print ''; - -print ''.$langs->trans("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING").''; -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING", $arrval, $conf->global->MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING); -} -print ''; - -print ''; -print ''; - print '
'; print ''; From 14ad317acce9fc07fed0efd63f7a599c55882a54 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 12 Aug 2021 08:18:44 +0000 Subject: [PATCH 0039/1460] Fixing style errors. --- htdocs/admin/pdf_other.php | 102 ++++++++++++++++++------------------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/htdocs/admin/pdf_other.php b/htdocs/admin/pdf_other.php index ff4748b08f1..e2b307691e4 100644 --- a/htdocs/admin/pdf_other.php +++ b/htdocs/admin/pdf_other.php @@ -93,65 +93,65 @@ print ''.$form->textwithpicto($langs->trans("PDFOthe print "
\n"; if (!empty($conf->propal->enabled)) { - print load_fiche_titre($langs->trans("Proposal"), '', ''); + print load_fiche_titre($langs->trans("Proposal"), '', ''); - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; - print '
'; - print ''; - print ''; + print '
'; + print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - // Width of picture product lign - print ''; + // Width of picture product lign + print ''; - /* - print ''; - */ + /* + print ''; + */ - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("MAIN_GENERATE_PROPOSALS_WITH_PICTURE"); - print ' ('.$langs->trans("RandomlySelectedIfSeveral").')'; - print ''; - if ($conf->use_javascript_ajax) { - print ajax_constantonoff('MAIN_GENERATE_PROPOSALS_WITH_PICTURE'); - } else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("MAIN_GENERATE_PROPOSALS_WITH_PICTURE", $arrval, $conf->global->MAIN_GENERATE_PROPOSALS_WITH_PICTURE); - } - print '
'.$langs->trans("MAIN_GENERATE_PROPOSALS_WITH_PICTURE"); + print ' ('.$langs->trans("RandomlySelectedIfSeveral").')'; + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_GENERATE_PROPOSALS_WITH_PICTURE'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("MAIN_GENERATE_PROPOSALS_WITH_PICTURE", $arrval, $conf->global->MAIN_GENERATE_PROPOSALS_WITH_PICTURE); + } + print '
'.$langs->trans("PROPOSAL_PDF_HIDE_PAYMENTTERM"); - print ''; - if ($conf->use_javascript_ajax) { - print ajax_constantonoff('PROPOSAL_PDF_HIDE_PAYMENTTERM'); - } else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("PROPOSAL_PDF_HIDE_PAYMENTTERM", $arrval, $conf->global->PROPOSAL_PDF_HIDE_PAYMENTTERM); - } - print '
'.$langs->trans("PROPOSAL_PDF_HIDE_PAYMENTTERM"); + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('PROPOSAL_PDF_HIDE_PAYMENTTERM'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("PROPOSAL_PDF_HIDE_PAYMENTTERM", $arrval, $conf->global->PROPOSAL_PDF_HIDE_PAYMENTTERM); + } + print '
'.$langs->trans("PROPOSAL_PDF_HIDE_PAYMENTMODE"); - print ''; - if ($conf->use_javascript_ajax) { - print ajax_constantonoff('PROPOSAL_PDF_HIDE_PAYMENTMODE'); - } else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("PROPOSAL_PDF_HIDE_PAYMENTMODE", $arrval, $conf->global->PROPOSAL_PDF_HIDE_PAYMENTMODE); - } - print '
'.$langs->trans("PROPOSAL_PDF_HIDE_PAYMENTMODE"); + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('PROPOSAL_PDF_HIDE_PAYMENTMODE'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("PROPOSAL_PDF_HIDE_PAYMENTMODE", $arrval, $conf->global->PROPOSAL_PDF_HIDE_PAYMENTMODE); + } + print '
'.$langs->trans("MAIN_DOCUMENTS_WITH_PICTURE_WIDTH").''; - print ''; - print '
'.$langs->trans("MAIN_DOCUMENTS_WITH_PICTURE_WIDTH").''; + print ''; + print '
'.$langs->trans("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING").''; - if ($conf->use_javascript_ajax) { - print ajax_constantonoff('MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING'); - } else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING", $arrval, $conf->global->MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING); - } - print '
'.$langs->trans("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING").''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING", $arrval, $conf->global->MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING); + } + print '
'; - print '
'; + print ''; + print '
'; } /* From 67bc64d68753fa0ff8aaea01716aa945977931bc Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Thu, 12 Aug 2021 10:19:55 +0200 Subject: [PATCH 0040/1460] save no ajax --- htdocs/admin/pdf.php | 1 - htdocs/admin/pdf_other.php | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 540d8318dd1..949666c40dc 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -87,7 +87,6 @@ if ($action == 'update') { dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DESC", GETPOST("MAIN_GENERATE_DOCUMENTS_HIDE_DESC"), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_REF", GETPOST("MAIN_GENERATE_DOCUMENTS_HIDE_REF"), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_DOCUMENTS_LOGO_HEIGHT", GETPOST("MAIN_DOCUMENTS_LOGO_HEIGHT", 'int'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INVERT_SENDER_RECIPIENT", GETPOST("MAIN_INVERT_SENDER_RECIPIENT"), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_PDF_USE_ISO_LOCATION", GETPOST("MAIN_PDF_USE_ISO_LOCATION"), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS", GETPOST("MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS"), 'chaine', 0, '', $conf->entity); diff --git a/htdocs/admin/pdf_other.php b/htdocs/admin/pdf_other.php index 3d0ff2ad23a..c042b1af32a 100644 --- a/htdocs/admin/pdf_other.php +++ b/htdocs/admin/pdf_other.php @@ -53,6 +53,7 @@ if ($cancel) { } if ($action == 'update') { + dolibarr_set_const($db, "MAIN_DOCUMENTS_LOGO_HEIGHT", GETPOST("MAIN_DOCUMENTS_LOGO_HEIGHT", 'int'), 'chaine', 0, '', $conf->entity); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); From fdd85845ce1e741019d5b8cee5655d44cc17e214 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Thu, 12 Aug 2021 10:27:19 +0200 Subject: [PATCH 0041/1460] erreur save const --- htdocs/admin/pdf_other.php | 7 +------ htdocs/langs/en_US/admin.lang | 1 + 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/htdocs/admin/pdf_other.php b/htdocs/admin/pdf_other.php index c042b1af32a..a6ab77ec2c5 100644 --- a/htdocs/admin/pdf_other.php +++ b/htdocs/admin/pdf_other.php @@ -41,19 +41,14 @@ if (!$user->admin) { } $action = GETPOST('action', 'aZ09'); -$cancel = GETPOST('cancel', 'alpha'); /* * Actions */ -if ($cancel) { - $action = ''; -} - if ($action == 'update') { - dolibarr_set_const($db, "MAIN_DOCUMENTS_LOGO_HEIGHT", GETPOST("MAIN_DOCUMENTS_LOGO_HEIGHT", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_DOCUMENTS_WITH_PICTURE_WIDTH", GETPOST("MAIN_DOCUMENTS_WITH_PICTURE_WIDTH", 'int'), 'chaine', 0, '', $conf->entity); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 34852c2ca61..e776c5b16f8 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1984,6 +1984,7 @@ MAIN_PDF_MARGIN_RIGHT=Right margin on PDF MAIN_PDF_MARGIN_TOP=Top margin on PDF MAIN_PDF_MARGIN_BOTTOM=Bottom margin on PDF MAIN_DOCUMENTS_LOGO_HEIGHT=Height for logo on PDF +MAIN_DOCUMENTS_WITH_PICTURE_WIDTH=Width the picture in the line MAIN_GENERATE_PROPOSALS_WITH_PICTURE=Add picture on proposal ligne MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING=Add electronic sign in PDF NothingToSetup=There is no specific setup required for this module. From 73998ac927cc617debfacc41022d6d61caa8b5dd Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 12 Aug 2021 08:36:38 +0000 Subject: [PATCH 0042/1460] Fixing style errors. --- htdocs/admin/pdf_other.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/admin/pdf_other.php b/htdocs/admin/pdf_other.php index cafbdee144b..54b4642b9f4 100644 --- a/htdocs/admin/pdf_other.php +++ b/htdocs/admin/pdf_other.php @@ -48,7 +48,6 @@ $action = GETPOST('action', 'aZ09'); */ if ($action == 'update') { - if (GETPOSTISSET('PROPOSAL_PDF_HIDE_PAYMENTTERM')) { dolibarr_set_const($db, "PROPOSAL_PDF_HIDE_PAYMENTTERM", GETPOST("PROPOSAL_PDF_HIDE_PAYMENTTERM"), 'chaine', 0, '', $conf->entity); } From 399a44ea20a37f88cac5615ae336dde7c8e415d5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Aug 2021 21:40:49 +0200 Subject: [PATCH 0043/1460] Update objectline_create.tpl.php --- htdocs/core/tpl/objectline_create.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 1b5cfff66f2..2c6fb585440 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -693,7 +693,7 @@ if (!empty($usemargins) && $user->rights->margins->creer) { /* When changing predefined product, we reload list of supplier prices required for margin combo */ $("#idprod, #idprodfournprice").change(function() { - console.log("Call method change() 1 after change on #idprod or #idprodfournprice (senderissupplier=). this.val = "+$(this).val()); + console.log("Call method change() after change on #idprod or #idprodfournprice (senderissupplier=). this.val = "+$(this).val()); setforpredef(); // TODO Keep vat combo visible and set it to first entry into list that match result of get_default_tva jQuery('#trlinefordates').show(); From f4d4733b15fac96d2fe011464fa40ee600900702 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Thu, 19 Aug 2021 15:37:32 +0200 Subject: [PATCH 0044/1460] NEW : Select for BOM workable + JS to fill it according to the product selected --- htdocs/bom/bom_card.php | 25 ++++++++++++++++++++ htdocs/bom/script/interface.php | 29 ++++++++++++++++++++++++ htdocs/bom/tpl/objectline_create.tpl.php | 4 ++++ htdocs/bom/tpl/objectline_title.tpl.php | 3 +++ htdocs/bom/tpl/objectline_view.tpl.php | 2 ++ htdocs/langs/en_US/mrp.lang | 1 + htdocs/langs/fr_FR/mrp.lang | 1 + 7 files changed, 65 insertions(+) create mode 100644 htdocs/bom/script/interface.php diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index cd530994b9b..7bcbcc19e46 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -570,6 +570,31 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { print ''; } + ?> + + '; print "\n"; diff --git a/htdocs/bom/script/interface.php b/htdocs/bom/script/interface.php new file mode 100644 index 00000000000..d5811db0414 --- /dev/null +++ b/htdocs/bom/script/interface.php @@ -0,0 +1,29 @@ +query($sql); + if ($resql && $db->num_rows($resql) > 0) { + $options = array(); + $cpt=0; + while ($obj = $db->fetch_object($resql)){ + + $options[$obj->rowid] = $obj->ref.' - '.$obj->label; + $cpt++; + } + print json_encode($options); + } + + break; +} diff --git a/htdocs/bom/tpl/objectline_create.tpl.php b/htdocs/bom/tpl/objectline_create.tpl.php index 7cc2873b261..5835849e9ff 100644 --- a/htdocs/bom/tpl/objectline_create.tpl.php +++ b/htdocs/bom/tpl/objectline_create.tpl.php @@ -107,6 +107,10 @@ if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { echo ''; } +$coldisplay++; +print ''; +print ''; +print ''; $coldisplay++; print ''; diff --git a/htdocs/bom/tpl/objectline_title.tpl.php b/htdocs/bom/tpl/objectline_title.tpl.php index d1b29ee03b0..6b7f04b58f0 100644 --- a/htdocs/bom/tpl/objectline_title.tpl.php +++ b/htdocs/bom/tpl/objectline_title.tpl.php @@ -52,6 +52,9 @@ if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { // Description print ''.$langs->trans('Description').''; +// Linked BOM +print ''.$langs->trans('BOM').''; + // Qty print ''.$form->textwithpicto($langs->trans('Qty'), $langs->trans("QtyRequiredIfNoLoss")).''; diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index fff9d077a08..d3559857a2a 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -83,6 +83,8 @@ $tmpproduct->fetch($line->fk_product); print $tmpproduct->getNomUrl(1); print ' - '.$tmpproduct->label; print ''; + +print ''; print ''; $coldisplay++; echo price($line->qty, 0, '', 0, 0); // Yes, it is a quantity, not a price, but we just want the formating role of function price diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang index 2414a92cefb..8aaf345feed 100644 --- a/htdocs/langs/en_US/mrp.lang +++ b/htdocs/langs/en_US/mrp.lang @@ -101,3 +101,4 @@ HumanMachine=Human / Machine WorkstationArea=Workstation area Machines=Machines THMEstimatedHelp=This rate makes it possible to define a forecast cost of the item +BOM=Nomenclature diff --git a/htdocs/langs/fr_FR/mrp.lang b/htdocs/langs/fr_FR/mrp.lang index e0a2e73365e..2db57d53bfb 100644 --- a/htdocs/langs/fr_FR/mrp.lang +++ b/htdocs/langs/fr_FR/mrp.lang @@ -101,3 +101,4 @@ HumanMachine=Humain/machine WorkstationArea=Espace Poste de travail Machines=Machines THMEstimatedHelp=Ce taux permet de définir un coût prévisionnel de l'article +BOM=Nomenclature From 6de7d9b0af679fd56f68cebd8d604bbb31e598f3 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Fri, 20 Aug 2021 13:37:28 +0200 Subject: [PATCH 0045/1460] NEW : Add sub-BOM lines on BOM card --- htdocs/bom/bom_card.php | 11 ++++- htdocs/bom/class/bom.class.php | 6 +++ htdocs/bom/tpl/objectline_view.tpl.php | 56 +++++++++++++++++++++++++- 3 files changed, 71 insertions(+), 2 deletions(-) diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 7bcbcc19e46..1126e04785e 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -140,6 +140,7 @@ if (empty($reshook)) { // Set if we used free entry or predefined product $idprod = (int) GETPOST('idprod', 'int'); + $bom_child = (int) GETPOST('bom_select', 'int'); $qty = price2num(GETPOST('qty', 'alpha'), 'MS'); $qty_frozen = price2num(GETPOST('qty_frozen', 'alpha'), 'MS'); $disable_stock_change = GETPOST('disable_stock_change', 'int'); @@ -163,6 +164,7 @@ if (empty($reshook)) { $bomline = new BOMLine($db); $bomline->fk_bom = $id; $bomline->fk_product = $idprod; + $bomline->fk_bom_child = $bom_child; $bomline->qty = $qty; $bomline->qty_frozen = (int) $qty_frozen; $bomline->disable_stock_change = (int) $disable_stock_change; @@ -574,18 +576,25 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea + + '; */ $coldisplay++; +// For BOM +print ''; print ''; if (($line->info_bits & 2) != 2) { diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index 623fdab1474..c869a617b2a 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -81,9 +81,9 @@ $coldisplay++; $tmpproduct = new Product($object->db); $tmpproduct->fetch($line->fk_product); $tmpbom = new BOM($object->db); -$res = $tmpbom->fetch($line->fk_bom_child); +$tmpbom->fetch($line->fk_bom_child); if (!empty($tmpbom->id)){ - print '' . (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT) ? '(+)' : '(-)') . ' '; + print '' . (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT) ? '(+)' : '(-)') . ' '; } print $tmpproduct->getNomUrl(1); print ' - '.$tmpproduct->label; @@ -193,15 +193,15 @@ if ($resql){ $sub_bom_line = new BOMLine($object->db); $sub_bom_line->fetch($obj->rowid); - print ''; + print ''; - print ''.$sub_bom_product->getNomUrl(1).''; + print '     '.$sub_bom_product->getNomUrl(1).''; if ($sub_bom_line->fk_bom_child > 0) { print ''.$sub_bom->getNomUrl(1).''; } else { print ' '; } - print ''.price($sub_bom_line->qty, 0, '', 0, 0).''; + print ''.price($sub_bom_line->qty * $line->qty, 0, '', 0, 0).''; if ($sub_bom_line->qty_frozen > 0) { print ''.$sub_bom_line->qty_frozen.''; } else { @@ -215,7 +215,7 @@ if ($resql){ } print ''.$sub_bom_line->efficiency.''; - print ''.price($sub_bom_line->total_cost).''; + print ''.price($sub_bom_line->total_cost * $line->qty).''; print ''; print ''; print ''; From 2343ff2ed4a06690230c95204cf0ca7d307870f7 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Mon, 23 Aug 2021 11:58:15 +0200 Subject: [PATCH 0049/1460] NEW : ShowAll/HideAll Options --- htdocs/bom/bom_card.php | 9 ++++----- htdocs/bom/tpl/objectline_title.tpl.php | 2 ++ htdocs/bom/tpl/objectline_view.tpl.php | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 2df4278ecbe..71c64087419 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -615,7 +615,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $(".collapse_bom").click(function() { var id_bom_line = $(this).attr('id').replace('collapse-', ''); - console.log('tr [parentid="'+ id_bom_line +'"]') if($(this).text().indexOf('+') > 0) { $('[parentid="'+ id_bom_line +'"]').show(); $(this).html('(-) '); @@ -630,14 +629,14 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea //TODO : SHOW ALL / COLLAPSE ALL $("#show_all").click(function() { - $("[class^=batch_warehouse]").show(); - $("[class^=collapse_batch]").html('(-) '); + $("[class^=sub_bom_lines]").show(); + $("[class^=collapse_bom]").html('(-) '); return false; }); $("#hide_all").click(function() { - $("[class^=batch_warehouse]").hide(); - $("[class^=collapse_batch]").html('(+) '); + $("[class^=sub_bom_lines]").hide(); + $("[class^=collapse_bom]").html('(+) '); return false; }); diff --git a/htdocs/bom/tpl/objectline_title.tpl.php b/htdocs/bom/tpl/objectline_title.tpl.php index 6b7f04b58f0..0656f23aed9 100644 --- a/htdocs/bom/tpl/objectline_title.tpl.php +++ b/htdocs/bom/tpl/objectline_title.tpl.php @@ -43,6 +43,8 @@ print "\n"; print "\n"; print ''; +print ''.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").'  '; +print ''.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").' '; // Adds a line numbering column if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index c869a617b2a..87013582fac 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -193,7 +193,7 @@ if ($resql){ $sub_bom_line = new BOMLine($object->db); $sub_bom_line->fetch($obj->rowid); - print ''; + print ''; print '     '.$sub_bom_product->getNomUrl(1).''; if ($sub_bom_line->fk_bom_child > 0) { From 6cd92ca82971b3cbf5654a3b8eb35651b0fe9ad5 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Mon, 23 Aug 2021 12:15:09 +0200 Subject: [PATCH 0050/1460] NEW : Trad + Comments + Adding tooltips for conf --- htdocs/bom/bom_card.php | 4 ++-- htdocs/bom/tpl/objectline_title.tpl.php | 2 ++ htdocs/langs/en_US/mrp.lang | 4 +++- htdocs/langs/fr_FR/mrp.lang | 1 + 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 71c64087419..85ce0a0366d 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -627,13 +627,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea return false; }); - //TODO : SHOW ALL / COLLAPSE ALL + //To Show all the sub bom lines $("#show_all").click(function() { $("[class^=sub_bom_lines]").show(); $("[class^=collapse_bom]").html('(-) '); return false; }); - + //To Hide all the sub bom lines $("#hide_all").click(function() { $("[class^=sub_bom_lines]").hide(); $("[class^=collapse_bom]").html('(+) '); diff --git a/htdocs/bom/tpl/objectline_title.tpl.php b/htdocs/bom/tpl/objectline_title.tpl.php index 0656f23aed9..ce811096d33 100644 --- a/htdocs/bom/tpl/objectline_title.tpl.php +++ b/htdocs/bom/tpl/objectline_title.tpl.php @@ -45,6 +45,8 @@ print "\n"; print ''; print ''.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").'  '; print ''.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").' '; +$form = new Form($object->db); +print $form->textwithpicto('', $langs->trans('CollapseBOMHelp'), 1, 'help', ''); // Adds a line numbering column if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang index 8aaf345feed..c414a219894 100644 --- a/htdocs/langs/en_US/mrp.lang +++ b/htdocs/langs/en_US/mrp.lang @@ -101,4 +101,6 @@ HumanMachine=Human / Machine WorkstationArea=Workstation area Machines=Machines THMEstimatedHelp=This rate makes it possible to define a forecast cost of the item -BOM=Nomenclature +BOM=Bill Of Materials +CollapseBOMHelp=You can define the default display of the details of the nomenclature in the configuration of the BOM module + diff --git a/htdocs/langs/fr_FR/mrp.lang b/htdocs/langs/fr_FR/mrp.lang index 2db57d53bfb..12873fd5093 100644 --- a/htdocs/langs/fr_FR/mrp.lang +++ b/htdocs/langs/fr_FR/mrp.lang @@ -102,3 +102,4 @@ WorkstationArea=Espace Poste de travail Machines=Machines THMEstimatedHelp=Ce taux permet de définir un coût prévisionnel de l'article BOM=Nomenclature +CollapseBOMHelp=Vous pouvez définir l'affichage par défaut du détail des nomenclature dans la configuration du module "Nomenclature Produits" From e282feb3970ef6f99b89b9ed1ced4364e91bd331 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Mon, 23 Aug 2021 14:43:17 +0200 Subject: [PATCH 0051/1460] NEW : Delete conf --- htdocs/bom/tpl/objectline_title.tpl.php | 2 -- htdocs/bom/tpl/objectline_view.tpl.php | 8 ++++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/bom/tpl/objectline_title.tpl.php b/htdocs/bom/tpl/objectline_title.tpl.php index ce811096d33..0656f23aed9 100644 --- a/htdocs/bom/tpl/objectline_title.tpl.php +++ b/htdocs/bom/tpl/objectline_title.tpl.php @@ -45,8 +45,6 @@ print "\n"; print ''; print ''.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").'  '; print ''.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").' '; -$form = new Form($object->db); -print $form->textwithpicto('', $langs->trans('CollapseBOMHelp'), 1, 'help', ''); // Adds a line numbering column if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index 87013582fac..fbfb02576df 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -81,7 +81,7 @@ $coldisplay++; $tmpproduct = new Product($object->db); $tmpproduct->fetch($line->fk_product); $tmpbom = new BOM($object->db); -$tmpbom->fetch($line->fk_bom_child); +$res = $tmpbom->fetch($line->fk_bom_child); if (!empty($tmpbom->id)){ print '' . (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT) ? '(+)' : '(-)') . ' '; } @@ -193,7 +193,11 @@ if ($resql){ $sub_bom_line = new BOMLine($object->db); $sub_bom_line->fetch($obj->rowid); - print ''; + if (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT)){ + print ''; + } else { + print ''; + } print '     '.$sub_bom_product->getNomUrl(1).''; if ($sub_bom_line->fk_bom_child > 0) { From 7474d2eef57aaec32713309ece7f84f7b85d8d88 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Mon, 23 Aug 2021 15:08:32 +0200 Subject: [PATCH 0052/1460] FIX : Add BOM column for create view --- htdocs/bom/tpl/objectline_create.tpl.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/bom/tpl/objectline_create.tpl.php b/htdocs/bom/tpl/objectline_create.tpl.php index 5835849e9ff..1a60029c439 100644 --- a/htdocs/bom/tpl/objectline_create.tpl.php +++ b/htdocs/bom/tpl/objectline_create.tpl.php @@ -61,6 +61,8 @@ if ($nolinesbefore) { print ''; print '
'.$langs->trans('AddNewLine').''; print ''; + // Linked BOM + print ''.$langs->trans('BOM').''; print ''.$langs->trans('Qty').''; if (!empty($conf->global->PRODUCT_USE_UNITS)) { print ''; From 2ecc448bc032e626436544c5eb6c7d95598fd480 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Wed, 25 Aug 2021 11:21:54 +0200 Subject: [PATCH 0053/1460] FIX : Set total_cost for parent line by additionning total_cost of the children lines --- htdocs/bom/tpl/objectline_view.tpl.php | 33 +++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index fbfb02576df..0d83754dd60 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -123,7 +123,8 @@ $coldisplay++; echo $line->efficiency; print ''; -print ''; +$total_cost = 0; +print ''; $coldisplay++; echo price($line->total_cost); print ''; @@ -199,7 +200,7 @@ if ($resql){ print ''; } - print '     '.$sub_bom_product->getNomUrl(1).''; + print ''.$sub_bom_product->getNomUrl(1).''; if ($sub_bom_line->fk_bom_child > 0) { print ''.$sub_bom->getNomUrl(1).''; } else { @@ -219,13 +220,39 @@ if ($resql){ } print ''.$sub_bom_line->efficiency.''; - print ''.price($sub_bom_line->total_cost * $line->qty).''; + if ($sub_bom_product->cost_price > 0) { + print ''.price($sub_bom_product->cost_price * $line->qty).''; + $total_cost.= $sub_bom_product->cost_price * $line->qty; + } else if ($sub_bom_product->pmp > 0) { + print ''.price($sub_bom_product->pmp * $line->qty).''; + $total_cost.= $sub_bom_product->pmp * $line->qty; + } else { + $sql_supplier_price = 'SELECT MIN(price) AS min_price FROM '.MAIN_DB_PREFIX.'product_fournisseur_price'; + $sql_supplier_price.= ' WHERE fk_product = '.$sub_bom_product->id; + $resql_supplier_price = $object->db->query($sql_supplier_price); + if ($resql_supplier_price) { + $obj = $object->db->fetch_object($resql_supplier_price); + print ''.price($obj->min_price * $line->qty).''; + $total_cost+= $obj->min_price * $line->qty; + } + } + print ''; print ''; print ''; } } +if ($total_cost > 0) { + $line->total_cost = price($total_cost); + ?> + + showOptionals($extrafields, 'view', array('style'=>'class="drag drop oddeven"', 'colspan'=>$coldisplay), '', '', 1, 'line'); From 5bf8685f72182994c38bde5dd35cabe75d516763 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Wed, 25 Aug 2021 16:58:22 +0200 Subject: [PATCH 0054/1460] NEW : Add comments --- htdocs/bom/tpl/objectline_view.tpl.php | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index 0d83754dd60..26f4d070876 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -89,6 +89,7 @@ print $tmpproduct->getNomUrl(1); print ' - '.$tmpproduct->label; print ''; +// To show BOM links in the list if ($res > 0) { print ''.$tmpbom->getNomUrl(1).''; } else { @@ -179,11 +180,13 @@ if ($action == 'selectlines') { print ''; +// Select of all the sub-BOM lines $sql = 'SELECT rowid, fk_bom_child, fk_product FROM '.MAIN_DB_PREFIX.'bom_bomline AS bl'; $sql.= ' WHERE fk_bom = '.$tmpbom->id; $resql = $object->db->query($sql); if ($resql){ + // Loop on all the sub-BOM lines if they exist while ($obj = $object->db->fetch_object($resql)){ $sub_bom_product = new Product($object->db); $sub_bom_product->fetch($obj->fk_product); @@ -194,18 +197,24 @@ if ($resql){ $sub_bom_line = new BOMLine($object->db); $sub_bom_line->fetch($obj->rowid); + //If hidden conf is set, we show directly all the sub-BOM lines if (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT)){ print ''; } else { print ''; } + // Product print ''.$sub_bom_product->getNomUrl(1).''; + + // Sub-BOM if ($sub_bom_line->fk_bom_child > 0) { print ''.$sub_bom->getNomUrl(1).''; } else { print ' '; } + + // Qty print ''.price($sub_bom_line->qty * $line->qty, 0, '', 0, 0).''; if ($sub_bom_line->qty_frozen > 0) { print ''.$sub_bom_line->qty_frozen.''; @@ -213,20 +222,28 @@ if ($resql){ print ' '; } + // Disable stock change if ($sub_bom_line->disable_stock_change > 0) { print ''.$sub_bom_line->disable_stock_change.''; } else { print ' '; } + // Efficiency print ''.$sub_bom_line->efficiency.''; + + // Cost price if it's defined if ($sub_bom_product->cost_price > 0) { print ''.price($sub_bom_product->cost_price * $line->qty).''; $total_cost.= $sub_bom_product->cost_price * $line->qty; - } else if ($sub_bom_product->pmp > 0) { + } + // PMP if cost price isn't defined + else if ($sub_bom_product->pmp > 0) { print ''.price($sub_bom_product->pmp * $line->qty).''; $total_cost.= $sub_bom_product->pmp * $line->qty; - } else { + } + // Minimum purchase price if cost price and PMP aren't defined + else { $sql_supplier_price = 'SELECT MIN(price) AS min_price FROM '.MAIN_DB_PREFIX.'product_fournisseur_price'; $sql_supplier_price.= ' WHERE fk_product = '.$sub_bom_product->id; $resql_supplier_price = $object->db->query($sql_supplier_price); @@ -243,6 +260,7 @@ if ($resql){ } } +// Replace of the total_cost value by the sum of all sub-BOM lines total_cost if ($total_cost > 0) { $line->total_cost = price($total_cost); ?> From 3a7d062d7deee5461391351bdb1cbbe6b60c863b Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 25 Aug 2021 15:24:03 +0000 Subject: [PATCH 0055/1460] Fixing style errors. --- htdocs/bom/script/interface.php | 5 ++--- htdocs/bom/tpl/objectline_view.tpl.php | 10 +++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/htdocs/bom/script/interface.php b/htdocs/bom/script/interface.php index d5811db0414..c93b54fdc33 100644 --- a/htdocs/bom/script/interface.php +++ b/htdocs/bom/script/interface.php @@ -7,7 +7,7 @@ $current_bom_id = GETPOST('current_bom_id', 'alphanohtml'); global $db; -switch ($action){ +switch ($action) { case 'select_BOM': //Selection of nomenclatures corresponding to the selected product $sql = 'SELECT b.rowid, b.ref, b.label, b.fk_product, p.label AS product_label FROM '.MAIN_DB_PREFIX.'bom_bom AS b '; @@ -17,8 +17,7 @@ switch ($action){ if ($resql && $db->num_rows($resql) > 0) { $options = array(); $cpt=0; - while ($obj = $db->fetch_object($resql)){ - + while ($obj = $db->fetch_object($resql)) { $options[$obj->rowid] = $obj->ref.' - '.$obj->label; $cpt++; } diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index 26f4d070876..a25cdeb87ec 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -82,7 +82,7 @@ $tmpproduct = new Product($object->db); $tmpproduct->fetch($line->fk_product); $tmpbom = new BOM($object->db); $res = $tmpbom->fetch($line->fk_bom_child); -if (!empty($tmpbom->id)){ +if (!empty($tmpbom->id)) { print '' . (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT) ? '(+)' : '(-)') . ' '; } print $tmpproduct->getNomUrl(1); @@ -185,9 +185,9 @@ $sql = 'SELECT rowid, fk_bom_child, fk_product FROM '.MAIN_DB_PREFIX.'bom_bomlin $sql.= ' WHERE fk_bom = '.$tmpbom->id; $resql = $object->db->query($sql); -if ($resql){ +if ($resql) { // Loop on all the sub-BOM lines if they exist - while ($obj = $object->db->fetch_object($resql)){ + while ($obj = $object->db->fetch_object($resql)) { $sub_bom_product = new Product($object->db); $sub_bom_product->fetch($obj->fk_product); @@ -198,7 +198,7 @@ if ($resql){ $sub_bom_line->fetch($obj->rowid); //If hidden conf is set, we show directly all the sub-BOM lines - if (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT)){ + if (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT)) { print ''; } else { print ''; @@ -238,7 +238,7 @@ if ($resql){ $total_cost.= $sub_bom_product->cost_price * $line->qty; } // PMP if cost price isn't defined - else if ($sub_bom_product->pmp > 0) { + elseif ($sub_bom_product->pmp > 0) { print ''.price($sub_bom_product->pmp * $line->qty).''; $total_cost.= $sub_bom_product->pmp * $line->qty; } From a79abfd4e01e70850c8893c1c5b645bd5fdb962c Mon Sep 17 00:00:00 2001 From: henrynopo Date: Thu, 26 Aug 2021 10:37:03 +0800 Subject: [PATCH 0056/1460] Update card.php --- htdocs/compta/facture/card.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 31de2bbd4ff..4658c10873d 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4052,6 +4052,8 @@ if ($action == 'create') { $i++; $close[$i]['code'] = 'badcustomer'; $i++; + $close[$i]['code'] = 'bankcharge'; + $i++; $close[$i]['code'] = 'other'; $i++; // Help @@ -4060,6 +4062,8 @@ if ($action == 'create') { $i++; $close[$i]['label'] = $langs->trans("ConfirmClassifyPaidPartiallyReasonBadCustomerDesc"); $i++; + $close[$i]['label'] = $langs->trans("ConfirmClassifyPaidPartiallyReasonBankChargeDesc"); + $i++; $close[$i]['label'] = $langs->trans("Other"); $i++; // Texte @@ -4068,6 +4072,8 @@ if ($action == 'create') { $i++; $close[$i]['reason'] = $form->textwithpicto($langs->transnoentities("ConfirmClassifyPaidPartiallyReasonBadCustomer", $resteapayer, $langs->trans("Currency".$conf->currency)), $close[$i]['label'], 1); $i++; + $close[$i]['reason'] = $form->textwithpicto($langs->transnoentities("ConfirmClassifyPaidPartiallyReasonBankCharge", $resteapayer, $langs->trans("Currency".$conf->currency)), $close[$i]['label'], 1); + $i++; $close[$i]['reason'] = $form->textwithpicto($langs->transnoentities("Other"), $close[$i]['label'], 1); $i++; // arrayreasons[code]=reason From a25580f97cfeda3e314926264063d85e0d251a18 Mon Sep 17 00:00:00 2001 From: henrynopo Date: Thu, 26 Aug 2021 10:38:53 +0800 Subject: [PATCH 0057/1460] Update bills.lang --- htdocs/langs/en_US/bills.lang | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index a921aac9e48..6a88f2599dd 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -192,6 +192,7 @@ ConfirmClassifyPaidPartiallyReasonDiscount=Remaining unpaid (%s %s) is a ConfirmClassifyPaidPartiallyReasonDiscountNoVat=Remaining unpaid (%s %s) is a discount granted because payment was made before term. I accept to lose the VAT on this discount. ConfirmClassifyPaidPartiallyReasonDiscountVat=Remaining unpaid (%s %s) is a discount granted because payment was made before term. I recover the VAT on this discount without a credit note. ConfirmClassifyPaidPartiallyReasonBadCustomer=Bad customer +ConfirmClassifyPaidPartiallyReasonBankCharge=Deduction by bank (intermediary bank fees) ConfirmClassifyPaidPartiallyReasonProductReturned=Products partially returned ConfirmClassifyPaidPartiallyReasonOther=Amount abandoned for other reason ConfirmClassifyPaidPartiallyReasonDiscountNoVatDesc=This choice is possible if your invoice has been provided with suitable comments. (Example «Only the tax corresponding to the price that has been actually paid gives rights to deduction») @@ -199,6 +200,7 @@ ConfirmClassifyPaidPartiallyReasonDiscountVatDesc=In some countries, this choice ConfirmClassifyPaidPartiallyReasonAvoirDesc=Use this choice if all other does not suit ConfirmClassifyPaidPartiallyReasonBadCustomerDesc=A bad customer is a customer that refuses to pay his debt. ConfirmClassifyPaidPartiallyReasonProductReturnedDesc=This choice is used when payment is not complete because some of products were returned +ConfirmClassifyPaidPartiallyReasonBankChargeDesc=The unpaid amount is intermediary bank fees, deducted directly from the correct amount paid by the Customer. ConfirmClassifyPaidPartiallyReasonOtherDesc=Use this choice if all others are not suitable, for example in following situation:
- payment not complete because some products were shipped back
- amount claimed too important because a discount was forgotten
In all cases, amount over-claimed must be corrected in accountancy system by creating a credit note. ConfirmClassifyAbandonReasonOther=Other ConfirmClassifyAbandonReasonOtherDesc=This choice will be used in all other cases. For example because you plan to create a replacing invoice. From 006481cdff06c9b232923657235630282b15f45d Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Thu, 26 Aug 2021 06:01:51 +0200 Subject: [PATCH 0058/1460] Update dashboard tab --- htdocs/admin/ihm.php | 160 ++++++++++++++++++---------------- htdocs/langs/en_US/admin.lang | 4 +- 2 files changed, 88 insertions(+), 76 deletions(-) diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index b6489a206bc..8a8349bb26b 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -208,7 +208,7 @@ if ($action == 'update') { } if ($mode == 'dashboard') { - + dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr(GETPOST("main_motd", 'restricthtml')), 'chaine', 0, '', $conf->entity); } if ($mode == 'other') { @@ -226,8 +226,6 @@ if ($action == 'update') { dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", GETPOST("MAIN_BUGTRACK_ENABLELINK", 'alpha'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", GETPOST("MAIN_FIRSTNAME_NAME_POSITION", 'aZ09'), 'chaine', 0, '', $conf->entity); - - dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr(GETPOST("main_motd", 'restricthtml')), 'chaine', 0, '', $conf->entity); } if ($mode == 'login') { @@ -337,75 +335,105 @@ if ($mode == 'dashboard') { print '
'; print ''; - print ''; + // Message of the day on home page + $substitutionarray = getCommonSubstitutionArray($langs, 0, array('object', 'objectamount')); + complete_substitutions_array($substitutionarray, $langs); - // Block meteo - print '' . "\n"; + + print ''; print ''; - // Block agenda - print ''; print ''; - // Block agenda - print ''; - print ''; + if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { + print ''; - // Block customer - print ''; - print ''; + // Block meteo + print ''; + print ''; - // Block supplier - print ''; - print ''; + // Block agenda + print ''; + print ''; - // Block contract - print ''; - print ''; + // Block agenda + print ''; + print ''; - // Block ticket - print ''; - print ''; + // Block customer + print ''; + print ''; - // Block bank - print ''; - print ''; + // Block supplier + print ''; + print ''; - // Block adherent - print ''; - print ''; + // Block contract + print ''; + print ''; - // Block expense report - print ''; - print ''; + // Block ticket + print ''; + print ''; - // Block holiday - print ''; - print ''; + // Block bank + print ''; + print ''; + + // Block adherent + print ''; + print ''; + + // Block expense report + print ''; + print ''; + + // Block holiday + print ''; + print ''; + } print '
'; - print $langs->trans("DashboardEnableBlockToShow"); - print '
' . $langs->trans('MAIN_DISABLE_METEO') . ''; - print ajax_constantonoff("MAIN_DISABLE_METEO", array(), $conf->entity, 0, 0, 1, 0); + print '
'; + $texthelp = $langs->trans("FollowingConstantsWillBeSubstituted") . '
'; + foreach ($substitutionarray as $key => $val) { + $texthelp .= $key . '
'; + } + print $form->textwithpicto($langs->trans("MessageOfDay"), $texthelp, 1, 'help', '', 0, 2, 'tooltipmessageofday'); + + print '
'; + + $doleditor = new DolEditor('main_motd', (isset($conf->global->MAIN_MOTD) ? $conf->global->MAIN_MOTD : ''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%'); + $doleditor->Create(); + + print '
' . $langs->trans('DashboardDisableGlobal') . ''; + print ajax_constantonoff("MAIN_DISABLE_GLOBAL_WORKBOARD", array(), $conf->entity, 0, 0, 1, 0); print '
' . $langs->trans('DashboardDisableBlockAgenda') . ''; - print ajax_constantonoff("MAIN_DISABLE_BLOCK_AGENDA", array(), $conf->entity, 0, 0, 1, 0); + print '
' . $langs->trans('BoxstatsDisableGlobal') . ''; + print ajax_constantonoff("MAIN_DISABLE_GLOBAL_BOXSTATS", array(), $conf->entity, 0, 0, 1, 0); print '
' . $langs->trans('DashboardDisableBlockProject') . ''; - print ajax_constantonoff("MAIN_DISABLE_BLOCK_PROJECT", array(), $conf->entity, 0, 0, 1, 0); - print '
'; + print $langs->trans("DashboardDisableBlocks"); + print '
' . $langs->trans('DashboardDisableBlockCustomer') . ''; - print ajax_constantonoff("MAIN_DISABLE_BLOCK_CUSTOMER", array(), $conf->entity, 0, 0, 1, 0); - print '
' . $langs->trans('MAIN_DISABLE_METEO') . ''; + print ajax_constantonoff("MAIN_DISABLE_METEO", array(), $conf->entity, 0, 0, 1, 0); + print '
' . $langs->trans('DashboardDisableBlockSupplier') . ''; - print ajax_constantonoff("MAIN_DISABLE_BLOCK_SUPPLIER", array(), $conf->entity, 0, 0, 1, 0); - print '
' . $langs->trans('DashboardDisableBlockAgenda') . ''; + print ajax_constantonoff("MAIN_DISABLE_BLOCK_AGENDA", array(), $conf->entity, 0, 0, 1, 0); + print '
' . $langs->trans('DashboardDisableBlockContract') . ''; - print ajax_constantonoff("MAIN_DISABLE_BLOCK_CONTRACT", array(), $conf->entity, 0, 0, 1, 0); - print '
' . $langs->trans('DashboardDisableBlockProject') . ''; + print ajax_constantonoff("MAIN_DISABLE_BLOCK_PROJECT", array(), $conf->entity, 0, 0, 1, 0); + print '
' . $langs->trans('DashboardDisableBlockTicket') . ''; - print ajax_constantonoff("MAIN_DISABLE_BLOCK_TICKET", array(), $conf->entity, 0, 0, 1, 0); - print '
' . $langs->trans('DashboardDisableBlockCustomer') . ''; + print ajax_constantonoff("MAIN_DISABLE_BLOCK_CUSTOMER", array(), $conf->entity, 0, 0, 1, 0); + print '
' . $langs->trans('DashboardDisableBlockBank') . ''; - print ajax_constantonoff("MAIN_DISABLE_BLOCK_BANK", array(), $conf->entity, 0, 0, 1, 0); - print '
' . $langs->trans('DashboardDisableBlockSupplier') . ''; + print ajax_constantonoff("MAIN_DISABLE_BLOCK_SUPPLIER", array(), $conf->entity, 0, 0, 1, 0); + print '
' . $langs->trans('DashboardDisableBlockAdherent') . ''; - print ajax_constantonoff("MAIN_DISABLE_BLOCK_ADHERENT", array(), $conf->entity, 0, 0, 1, 0); - print '
' . $langs->trans('DashboardDisableBlockContract') . ''; + print ajax_constantonoff("MAIN_DISABLE_BLOCK_CONTRACT", array(), $conf->entity, 0, 0, 1, 0); + print '
' . $langs->trans('DashboardDisableBlockExpenseReport') . ''; - print ajax_constantonoff("MAIN_DISABLE_BLOCK_EXPENSEREPORT", array(), $conf->entity, 0, 0, 1, 0); - print '
' . $langs->trans('DashboardDisableBlockTicket') . ''; + print ajax_constantonoff("MAIN_DISABLE_BLOCK_TICKET", array(), $conf->entity, 0, 0, 1, 0); + print '
' . $langs->trans('DashboardDisableBlockHoliday') . ''; - print ajax_constantonoff("MAIN_DISABLE_BLOCK_HOLIDAY", array(), $conf->entity, 0, 0, 1, 0); - print '
' . $langs->trans('DashboardDisableBlockBank') . ''; + print ajax_constantonoff("MAIN_DISABLE_BLOCK_BANK", array(), $conf->entity, 0, 0, 1, 0); + print '
' . $langs->trans('DashboardDisableBlockAdherent') . ''; + print ajax_constantonoff("MAIN_DISABLE_BLOCK_ADHERENT", array(), $conf->entity, 0, 0, 1, 0); + print '
' . $langs->trans('DashboardDisableBlockExpenseReport') . ''; + print ajax_constantonoff("MAIN_DISABLE_BLOCK_EXPENSEREPORT", array(), $conf->entity, 0, 0, 1, 0); + print '
' . $langs->trans('DashboardDisableBlockHoliday') . ''; + print ajax_constantonoff("MAIN_DISABLE_BLOCK_HOLIDAY", array(), $conf->entity, 0, 0, 1, 0); + print '
' . "\n"; print '
'; @@ -515,24 +543,6 @@ if ($mode == 'other') { print ' '; print ''; - // Message of the day on home page - $substitutionarray = getCommonSubstitutionArray($langs, 0, array('object', 'objectamount')); - complete_substitutions_array($substitutionarray, $langs); - - print ''; - $texthelp = $langs->trans("FollowingConstantsWillBeSubstituted") . '
'; - foreach ($substitutionarray as $key => $val) { - $texthelp .= $key . '
'; - } - print $form->textwithpicto($langs->trans("MessageOfDay"), $texthelp, 1, 'help', '', 0, 2, 'tooltipmessageofday'); - - print ''; - - $doleditor = new DolEditor('main_motd', (isset($conf->global->MAIN_MOTD) ? $conf->global->MAIN_MOTD : ''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%'); - $doleditor->Create(); - - print '' . "\n"; - print '' . "\n"; print ''; } diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index ccc24de145c..31556d499ef 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2163,7 +2163,9 @@ APIsAreNotEnabled=APIs modules are not enabled YouShouldSetThisToOff=You should set this to 0 or off InstallAndUpgradeLockedBy=Install and upgrades are locked by the file %s OldImplementation=Old implementation -DashboardEnableBlockToShow=Dashboard - Block to show +DashboardDisableGlobal=Disable totally dashboard +BoxstatsDisableGlobal=Disable totally box statistics +DashboardDisableBlocks=Dashboard - Blocks to disable DashboardDisableBlockAgenda=Disable block agenda DashboardDisableBlockProject=Disable block project DashboardDisableBlockCustomer=Disable block customer From 0463846df1c65a23e128e51bb96a5f7a06bc333b Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Thu, 26 Aug 2021 09:27:03 +0200 Subject: [PATCH 0059/1460] FIX : Stickler --- htdocs/bom/tpl/objectline_view.tpl.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index 26f4d070876..3e1922db7fc 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -237,11 +237,13 @@ if ($resql){ print ''.price($sub_bom_product->cost_price * $line->qty).''; $total_cost.= $sub_bom_product->cost_price * $line->qty; } + // PMP if cost price isn't defined else if ($sub_bom_product->pmp > 0) { print ''.price($sub_bom_product->pmp * $line->qty).''; $total_cost.= $sub_bom_product->pmp * $line->qty; } + // Minimum purchase price if cost price and PMP aren't defined else { $sql_supplier_price = 'SELECT MIN(price) AS min_price FROM '.MAIN_DB_PREFIX.'product_fournisseur_price'; From 578de93dc4e98e3360223ca2053829605e73b676 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 26 Aug 2021 07:30:36 +0000 Subject: [PATCH 0060/1460] Fixing style errors. --- htdocs/bom/tpl/objectline_view.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index 1ee64890384..6aa00e79835 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -243,7 +243,7 @@ if ($resql) { print ''.price($sub_bom_product->pmp * $line->qty).''; $total_cost.= $sub_bom_product->pmp * $line->qty; } - + // Minimum purchase price if cost price and PMP aren't defined else { $sql_supplier_price = 'SELECT MIN(price) AS min_price FROM '.MAIN_DB_PREFIX.'product_fournisseur_price'; From 0222df7ecc65c0589a32fb911102d9c18facf991 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Thu, 26 Aug 2021 09:34:30 +0200 Subject: [PATCH 0061/1460] FIX : Expected 1 space after closing brace; newline found --- htdocs/bom/tpl/objectline_view.tpl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index 1ee64890384..b8d054d9ecc 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -236,14 +236,14 @@ if ($resql) { if ($sub_bom_product->cost_price > 0) { print ''.price($sub_bom_product->cost_price * $line->qty).''; $total_cost.= $sub_bom_product->cost_price * $line->qty; - } + } // PMP if cost price isn't defined elseif ($sub_bom_product->pmp > 0) { print ''.price($sub_bom_product->pmp * $line->qty).''; $total_cost.= $sub_bom_product->pmp * $line->qty; } - + // Minimum purchase price if cost price and PMP aren't defined else { $sql_supplier_price = 'SELECT MIN(price) AS min_price FROM '.MAIN_DB_PREFIX.'product_fournisseur_price'; From bdcddebb5fdc47084a5279b68ec65957cae47e54 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 26 Aug 2021 07:37:39 +0000 Subject: [PATCH 0062/1460] Fixing style errors. --- htdocs/bom/tpl/objectline_view.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index b8d054d9ecc..6aa00e79835 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -236,7 +236,7 @@ if ($resql) { if ($sub_bom_product->cost_price > 0) { print ''.price($sub_bom_product->cost_price * $line->qty).''; $total_cost.= $sub_bom_product->cost_price * $line->qty; - } + } // PMP if cost price isn't defined elseif ($sub_bom_product->pmp > 0) { From 05444078bdffd9fd880fd9b9a7cd537c3d34a58b Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Thu, 26 Aug 2021 09:43:50 +0200 Subject: [PATCH 0063/1460] FIX : stickler --- htdocs/bom/tpl/objectline_view.tpl.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index b8d054d9ecc..41ff84b4d13 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -236,16 +236,10 @@ if ($resql) { if ($sub_bom_product->cost_price > 0) { print ''.price($sub_bom_product->cost_price * $line->qty).''; $total_cost.= $sub_bom_product->cost_price * $line->qty; - } - - // PMP if cost price isn't defined - elseif ($sub_bom_product->pmp > 0) { + } elseif ($sub_bom_product->pmp > 0) { // PMP if cost price isn't defined print ''.price($sub_bom_product->pmp * $line->qty).''; $total_cost.= $sub_bom_product->pmp * $line->qty; - } - - // Minimum purchase price if cost price and PMP aren't defined - else { + } else { // Minimum purchase price if cost price and PMP aren't defined $sql_supplier_price = 'SELECT MIN(price) AS min_price FROM '.MAIN_DB_PREFIX.'product_fournisseur_price'; $sql_supplier_price.= ' WHERE fk_product = '.$sub_bom_product->id; $resql_supplier_price = $object->db->query($sql_supplier_price); From 2c7a78867847d532c5c5ad0c701f872389e5ad69 Mon Sep 17 00:00:00 2001 From: henrynopo Date: Fri, 27 Aug 2021 11:09:10 +0800 Subject: [PATCH 0064/1460] Update shipment.php --- htdocs/expedition/shipment.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 42b8630bd3c..f9714039016 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -617,15 +617,17 @@ if ($id > 0 || !empty($ref)) { $sql = "SELECT cd.rowid, cd.fk_product, cd.product_type as type, cd.label, cd.description,"; $sql .= " cd.price, cd.tva_tx, cd.subprice,"; - $sql .= " cd.qty,"; + $sql .= " cd.qty, cd.fk_unit,"; $sql .= ' cd.date_start,'; $sql .= ' cd.date_end,'; $sql .= ' cd.special_code,'; $sql .= ' p.rowid as prodid, p.label as product_label, p.entity, p.ref, p.fk_product_type as product_type, p.description as product_desc,'; $sql .= ' p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units,'; $sql .= ' p.surface, p.surface_units, p.volume, p.volume_units'; + $sql .= ', u.short_label as unit_order'; $sql .= " FROM ".MAIN_DB_PREFIX."commandedet as cd"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_units as u ON cd.fk_unit = u.rowid"; $sql .= " WHERE cd.fk_commande = ".((int) $object->id); $sql .= " ORDER BY cd.rang, cd.rowid"; @@ -761,7 +763,7 @@ if ($id > 0 || !empty($ref)) { } // Qty ordered - print ''.$objp->qty.''; + print ''.$objp->qty.' '.$objp->unit_order.''; // Qty already shipped $qtyProdCom = $objp->qty; @@ -769,7 +771,7 @@ if ($id > 0 || !empty($ref)) { // Nb of sending products for this line of order $qtyAlreadyShipped = (!empty($object->expeditions[$objp->rowid]) ? $object->expeditions[$objp->rowid] : 0); print $qtyAlreadyShipped; - print ''; + print ' '.$objp->unit_order.''; // Qty remains to ship print ''; @@ -780,7 +782,7 @@ if ($id > 0 || !empty($ref)) { } else { print '0 ('.$langs->trans("Service").')'; } - print ''; + print ' '.$objp->unit_order.''; if ($objp->fk_product > 0) { $product = new Product($db); From 9914ebe90bcf37731cb96e94eca07558d84c914c Mon Sep 17 00:00:00 2001 From: Christian Foellmann Date: Fri, 27 Aug 2021 10:21:02 +0200 Subject: [PATCH 0065/1460] add missing actions to admin page --- htdocs/admin/supplier_order.php | 5 ++++- htdocs/admin/supplier_payment.php | 2 ++ htdocs/fourn/commande/card.php | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index 7cf64e4800d..98fe1c391ce 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -132,6 +132,8 @@ if ($action == 'updateMask') { if ($ret > 0) { $ret = addDocumentModel($value, $type, $label, $scandir); } +} elseif ($action == 'unsetdoc') { + dolibarr_del_const($db, "COMMANDE_SUPPLIER_ADDON_PDF", $conf->entity); } elseif ($action == 'setmod') { // TODO Verifier si module numerotation choisi peut etre active // par appel methode canBeActivated @@ -397,7 +399,8 @@ foreach ($dirmodels as $reldir) { // Default print ''; if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF == "$name") { - print img_picto($langs->trans("Default"), 'on'); +// print img_picto($langs->trans("Default"), 'on'); + print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').''; } else { print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php index 3f79b52eff3..4482373a2bd 100644 --- a/htdocs/admin/supplier_payment.php +++ b/htdocs/admin/supplier_payment.php @@ -89,6 +89,8 @@ if ($action == 'updateMask') { if ($ret > 0) { $ret = addDocumentModel($value, $type, $label, $scandir); } +} elseif ($action == 'unsetdoc') { + dolibarr_del_const($db, "SUPPLIER_PAYMENT_ADDON_PDF", $conf->entity); } elseif ($action == 'specimen') { $modele = GETPOST('module', 'alpha'); diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 6ea356e189e..8afb77a3437 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2614,8 +2614,9 @@ if ($action == 'create') { $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; $genallowed = $usercanread; $delallowed = $usercancreate; + $modelpdf = (!empty($object->model_pdf) ? $object->model_pdf : (empty($conf->global->COMMANDE_SUPPLIER_ADDON_PDF) ? '' : $conf->global->COMMANDE_SUPPLIER_ADDON_PDF)); - print $formfile->showdocuments('commande_fournisseur', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 0, 0, '', '', '', $object->thirdparty->default_lang); + print $formfile->showdocuments('commande_fournisseur', $objref, $filedir, $urlsource, $genallowed, $delallowed, $modelpdf, 1, 0, 0, 0, 0, '', '', '', $object->thirdparty->default_lang); $somethingshown = $formfile->numoffiles; // Show links to link elements From b48566eed853ab7a573d929c89edcea0184ec4ff Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 27 Aug 2021 08:27:04 +0000 Subject: [PATCH 0066/1460] Fixing style errors. --- htdocs/admin/supplier_order.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index 98fe1c391ce..26f0212f412 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -399,7 +399,7 @@ foreach ($dirmodels as $reldir) { // Default print ''; if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF == "$name") { -// print img_picto($langs->trans("Default"), 'on'); + // print img_picto($langs->trans("Default"), 'on'); print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').''; } else { print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; From c219b8f576bd69db74be6020afa58c0a859adc20 Mon Sep 17 00:00:00 2001 From: henrynopo Date: Sat, 28 Aug 2021 15:19:45 +0800 Subject: [PATCH 0067/1460] Update card.php --- htdocs/expedition/card.php | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 676a5cae22c..6c3e3748892 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1133,11 +1133,17 @@ if ($action == 'create') { print_date_range($db->jdate($line->date_start), $db->jdate($line->date_end)); print "\n"; } + + // unit of order + $unit_order = '' + if ($conf->global->PRODUCT_USE_UNITS) { + $unit_order = measuringUnitString($line->fk_unit); + } // Qty print ''.$line->qty; print ''; - print ''; + print ''.$unit_order.''; $qtyProdCom = $line->qty; // Qty already shipped @@ -1145,7 +1151,7 @@ if ($action == 'create') { $quantityDelivered = $object->expeditions[$line->id]; print $quantityDelivered; print ''; - print ''; + print ''.$unit_order.''; // Qty to ship $quantityAsked = $line->qty; @@ -2030,7 +2036,7 @@ if ($action == 'create') { // Get list of products already sent for same source object into $alreadysent $alreadysent = array(); if ($origin && $origin_id > 0) { - $sql = "SELECT obj.rowid, obj.fk_product, obj.label, obj.description, obj.product_type as fk_product_type, obj.qty as qty_asked, obj.date_start, obj.date_end"; + $sql = "SELECT obj.rowid, obj.fk_product, obj.label, obj.description, obj.product_type as fk_product_type, obj.qty as qty_asked, obj.fk_unit, obj.date_start, obj.date_end"; $sql .= ", ed.rowid as shipmentline_id, ed.qty as qty_shipped, ed.fk_expedition as expedition_id, ed.fk_origin_line, ed.fk_entrepot"; $sql .= ", e.rowid as shipment_id, e.ref as shipment_ref, e.date_creation, e.date_valid, e.date_delivery, e.date_expedition"; //if ($conf->delivery_note->enabled) $sql .= ", l.rowid as livraison_id, l.ref as livraison_ref, l.date_delivery, ld.qty as qty_received"; @@ -2149,9 +2155,14 @@ if ($action == 'create') { print_date_range($lines[$i]->date_start, $lines[$i]->date_end); print "\n"; } + + $unit_order = '' + if ($conf->global->PRODUCT_USE_UNITS) { + $unit_order = measuringUnitString($lines[$i]->fk_unit); + } // Qty ordered - print ''.$lines[$i]->qty_asked.''; + print ''.$lines[$i]->qty_asked.' '.$unit_order.''; // Qty in other shipments (with shipment and warehouse used) if ($origin && $origin_id > 0) { @@ -2215,7 +2226,7 @@ if ($action == 'create') { print ''; print ''; // Qty to ship or shipped - print ''; + print ''.$unit_order.''; // Warehouse source print ''.$formproduct->selectWarehouses($lines[$i]->entrepot_id, 'entl'.$line_id, '', 1, 0, $lines[$i]->fk_product, '', 1).''; // Batch number managment @@ -2226,7 +2237,7 @@ if ($action == 'create') { foreach ($lines[$i]->details_entrepot as $detail_entrepot) { print ''; // Qty to ship or shipped - print ''; + print ''.$unit_order.''; // Warehouse source print ''.$formproduct->selectWarehouses($detail_entrepot->entrepot_id, 'entl'.$detail_entrepot->line_id, '', 1, 0, $lines[$i]->fk_product, '', 1).''; // Batch number managment @@ -2241,7 +2252,7 @@ if ($action == 'create') { print ''; print ''; // Qty to ship or shipped - print ''; + print ''.$unit_order.''; // Warehouse source print ''; // Batch number managment @@ -2253,7 +2264,7 @@ if ($action == 'create') { print ''; } else { // Qty to ship or shipped - print ''.$lines[$i]->qty_shipped.''; + print ''.$lines[$i]->qty_shipped.' '.$unit_order.''; // Warehouse source if (!empty($conf->stock->enabled)) { From 74ed754fcc3a08cba815470ba01f9d33655c0019 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sat, 28 Aug 2021 07:22:25 +0000 Subject: [PATCH 0068/1460] Fixing style errors. --- htdocs/expedition/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 6c3e3748892..7c30789ecb0 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1133,7 +1133,7 @@ if ($action == 'create') { print_date_range($db->jdate($line->date_start), $db->jdate($line->date_end)); print "\n"; } - + // unit of order $unit_order = '' if ($conf->global->PRODUCT_USE_UNITS) { @@ -2155,7 +2155,7 @@ if ($action == 'create') { print_date_range($lines[$i]->date_start, $lines[$i]->date_end); print "\n"; } - + $unit_order = '' if ($conf->global->PRODUCT_USE_UNITS) { $unit_order = measuringUnitString($lines[$i]->fk_unit); From 4ae29c53aa7678f031863828c35a8d4ba7ee69e5 Mon Sep 17 00:00:00 2001 From: henrynopo Date: Sat, 28 Aug 2021 15:30:05 +0800 Subject: [PATCH 0069/1460] Update pdf_espadon.modules.php --- .../expedition/doc/pdf_espadon.modules.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 28d797acffc..1d449dcccbd 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -650,6 +650,11 @@ class pdf_espadon extends ModelePdfExpedition $this->printStdColumnContent($pdf, $curY, 'qty_asked', $object->lines[$i]->qty_asked); $nexY = max($pdf->GetY(), $nexY); } + + if ($this->getColumnStatus('unit_order')) { + $this->printStdColumnContent($pdf, $curY, 'unit_order', measuringUnitString($object->lines[$i]->fk_unit)); + $nexY = max($pdf->GetY(), $nexY); + } if ($this->getColumnStatus('qty_shipped')) { $this->printStdColumnContent($pdf, $curY, 'qty_shipped', $object->lines[$i]->qty_shipped); @@ -1311,6 +1316,20 @@ class pdf_espadon extends ModelePdfExpedition 'align' => 'C', ), ); + + $rank = $rank + 10; + $this->cols['unit_order'] = array( + 'rank' => $rank, + 'width' => 15, // in mm + 'status' => empty($conf->global->PRODUCT_USE_UNITS) ? 0 : 1, + 'title' => array( + 'textkey' => 'Unit' + ), + 'border-left' => true, // add left line separator + 'content' => array( + 'align' => 'C', + ), + ); $rank = $rank + 10; $this->cols['qty_shipped'] = array( From 3598e0a2464666d78fcb5497d17dbc8e8681ef38 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sat, 28 Aug 2021 07:32:07 +0000 Subject: [PATCH 0070/1460] Fixing style errors. --- .../modules/expedition/doc/pdf_espadon.modules.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 1d449dcccbd..55180a33eb4 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -650,11 +650,11 @@ class pdf_espadon extends ModelePdfExpedition $this->printStdColumnContent($pdf, $curY, 'qty_asked', $object->lines[$i]->qty_asked); $nexY = max($pdf->GetY(), $nexY); } - + if ($this->getColumnStatus('unit_order')) { - $this->printStdColumnContent($pdf, $curY, 'unit_order', measuringUnitString($object->lines[$i]->fk_unit)); - $nexY = max($pdf->GetY(), $nexY); - } + $this->printStdColumnContent($pdf, $curY, 'unit_order', measuringUnitString($object->lines[$i]->fk_unit)); + $nexY = max($pdf->GetY(), $nexY); + } if ($this->getColumnStatus('qty_shipped')) { $this->printStdColumnContent($pdf, $curY, 'qty_shipped', $object->lines[$i]->qty_shipped); @@ -1316,7 +1316,7 @@ class pdf_espadon extends ModelePdfExpedition 'align' => 'C', ), ); - + $rank = $rank + 10; $this->cols['unit_order'] = array( 'rank' => $rank, From 709a2975637759716e745943645d408e7b3f93c7 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Mon, 30 Aug 2021 14:45:42 +0200 Subject: [PATCH 0071/1460] NEW : Allow drag and drop on kits --- htdocs/core/ajax/row.php | 2 + htdocs/core/class/commonobject.class.php | 11 +++-- htdocs/langs/en_US/products.lang | 3 +- htdocs/langs/fr_FR/products.lang | 1 + htdocs/product/class/product.class.php | 59 +++++++++++++++++------- htdocs/product/composition/card.php | 28 +++++++++-- 6 files changed, 79 insertions(+), 25 deletions(-) diff --git a/htdocs/core/ajax/row.php b/htdocs/core/ajax/row.php index 95518cbbf66..1afd5f8b206 100644 --- a/htdocs/core/ajax/row.php +++ b/htdocs/core/ajax/row.php @@ -99,6 +99,8 @@ if (GETPOST('roworder', 'alpha', 3) && GETPOST('table_element_line', 'aZ09', 3) $perm = 1; } elseif ($table_element_line == 'ecm_files' && $fk_element == 'fk_ticket' && !empty($user->rights->ticket->write)) { $perm = 1; + } elseif ($table_element_line == 'product_association' && $fk_element == 'fk_product' && !empty($user->rights->produit->creer)) { + $perm = 1; } else { $tmparray = explode('_', $table_element_line); $tmpmodule = $tmparray[0]; $tmpobject = preg_replace('/line$/', '', $tmparray[1]); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 5cdb83194f4..22aa26ceb62 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3021,7 +3021,7 @@ abstract class CommonObject * * @param int $rowid Id of line * @param int $rang Position - * @return void + * @return int */ public function updateRangOfLine($rowid, $rang) { @@ -3037,10 +3037,13 @@ abstract class CommonObject dol_syslog(get_class($this)."::updateRangOfLine", LOG_DEBUG); if (!$this->db->query($sql)) { dol_print_error($this->db); + return -1; + } else { + $parameters=array('rowid'=>$rowid, 'rang'=>$rang, 'fieldposition' => $fieldposition); + $action=''; + $reshook = $hookmanager->executeHooks('afterRankOfLineUpdate', $parameters, $this, $action); + return 1; } - $parameters=array('rowid'=>$rowid, 'rang'=>$rang, 'fieldposition' => $fieldposition); - $action=''; - $reshook = $hookmanager->executeHooks('afterRankOfLineUpdate', $parameters, $this, $action); } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index ae199f4136b..31aa253af93 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -400,4 +400,5 @@ DeleteLinkedProduct=Delete the child product linked to the combination PMPValue=Weighted average price PMPValueShort=WAP DefaultBOM=Default BOM -DefaultBOMDesc=The default BOM recommended to use to manufacture this product. This field can be set only if nature of product is '%s'. \ No newline at end of file +DefaultBOMDesc=The default BOM recommended to use to manufacture this product. This field can be set only if nature of product is '%s'. +Rank=Rank diff --git a/htdocs/langs/fr_FR/products.lang b/htdocs/langs/fr_FR/products.lang index 013d75d2ec0..f67cfd8423d 100644 --- a/htdocs/langs/fr_FR/products.lang +++ b/htdocs/langs/fr_FR/products.lang @@ -399,3 +399,4 @@ ProductSupplierExtraFields=Attributs supplémentaires (Prix fournisseur) DeleteLinkedProduct=Supprimer le produit enfant lié à la combinaison PMPValue=Prix moyen pondéré (PMP) PMPValueShort=PMP +Rank=Rang diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index e51c553809d..5681cf2571a 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4014,22 +4014,27 @@ class Product extends CommonObject dol_print_error($this->db); return -1; } else { - $result = $this->db->query($sql); - if ($result) { - $num = $this->db->num_rows($result); - if ($num > 0) { - $this->error = "isFatherOfThis"; + //Selection of the highest row + $sql = 'SELECT MAX(rang) as max_rank FROM '.MAIN_DB_PREFIX.'product_association'; + $sql .= ' WHERE fk_product_pere = '.$id_pere; + $resql = $this->db->query($sql); + if ($resql > 0) { + $obj = $this->db->fetch_object($resql); + $rank = $obj->max_rank + 1; + //Addition of a product with the highest rank +1 + $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'product_association(fk_product_pere,fk_product_fils,qty,incdec,rang)'; + $sql .= ' VALUES ('.$id_pere.', '.$id_fils.', '.$qty.', '.$incdec.', '.$rank.')'; + if (! $this->db->query($sql)) { + dol_print_error($this->db); return -1; - } else { - $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'product_association(fk_product_pere,fk_product_fils,qty,incdec)'; - $sql .= ' VALUES ('.((int) $id_pere).', '.((int) $id_fils).', '.((float) $qty).', '.((int) $incdec).')'; - if (!$this->db->query($sql)) { - dol_print_error($this->db); - return -1; - } else { - return 1; - } } + else + { + return 1; + } + } else { + dol_print_error($this->db); + return -1; } } } @@ -4102,6 +4107,24 @@ class Product extends CommonObject return -1; } + //Updated ranks so that none are missing + $sqlrank = 'SELECT rowid, rang FROM '.MAIN_DB_PREFIX.'product_association'; + $sqlrank.= ' WHERE fk_product_pere = '.$fk_parent; + $sqlrank.= ' ORDER BY rang'; + $resqlrank = $this->db->query($sqlrank); + if ($resqlrank) { + $cpt = 0; + while ($objrank = $this->db->fetch_object($resqlrank)){ + $cpt++; + $sql = 'UPDATE '.MAIN_DB_PREFIX.'product_association'; + $sql.= ' SET rang ='.$cpt; + $sql.= ' WHERE rowid ='.$objrank->rowid; + if (! $this->db->query($sql)) { + dol_print_error($this->db); + return -1; + } + } + } return 1; } @@ -4666,12 +4689,14 @@ class Product extends CommonObject } $sql = "SELECT p.rowid, p.ref, p.label as label, p.fk_product_type,"; - $sql .= " pa.qty as qty, pa.fk_product_fils as id, pa.incdec"; + $sql .= " pa.qty as qty, pa.fk_product_fils as id, pa.incdec,"; + $sql .= " pa.rowid as fk_association, pa.rang"; $sql .= " FROM ".MAIN_DB_PREFIX."product as p,"; $sql .= " ".MAIN_DB_PREFIX."product_association as pa"; $sql .= " WHERE p.rowid = pa.fk_product_fils"; $sql .= " AND pa.fk_product_pere = ".((int) $id); $sql .= " AND pa.fk_product_fils <> ".((int) $id); // This should not happens, it is to avoid infinite loop if it happens + $sql.= " ORDER BY pa.rang"; dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level, LOG_DEBUG); @@ -4698,7 +4723,9 @@ class Product extends CommonObject 2=>$rec['fk_product_type'], 3=>$this->db->escape($rec['label']), 4=>$rec['incdec'], - 5=>$rec['ref'] + 5=>$rec['ref'], + 6=>$rec['fk_association'], + 7=>$rec['rang'] ); //$prods[$this->db->escape($rec['label'])]= array(0=>$rec['id'],1=>$rec['qty'],2=>$rec['fk_product_type']); //$prods[$this->db->escape($rec['label'])]= array(0=>$rec['id'],1=>$rec['qty']); diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index 000e5da6cbc..d1e59482d44 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -132,6 +132,8 @@ if ($action == 'add_prod' && ($user->rights->produit->creer || $user->rights->se setEventMessages('RecordSaved', null); } $action = ''; + header("Location: ".$_SERVER["PHP_SELF"].'?id='.$object->id); + exit; } @@ -268,8 +270,18 @@ if ($id > 0 || !empty($ref)) { $prodsfather = $object->getFather(); // Parent Products $object->get_sousproduits_arbo(); // Load $object->sousprods + $parent_label = $object->label; $prods_arbo = $object->get_arbo_each_prod(); + $tmpid = $id; + if (! empty($conf->use_javascript_ajax)) { + $nboflines = $prods_arbo; + $table_element_line='product_association'; + + include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; + } + $id = $tmpid; + $nbofsubsubproducts = count($prods_arbo); // This include sub sub product into nb $prodschild = $object->getChildsArbo($id, 1); $nbofsubproducts = count($prodschild); // This include only first level of childs @@ -323,9 +335,10 @@ if ($id > 0 || !empty($ref)) { print ''; print ''; - print ''; + print '
'; - print ''; + print ''; + print ''; print ''; print ''; print ''; @@ -335,6 +348,7 @@ if ($id > 0 || !empty($ref)) { } print ''; print ''; + print ''; print ''."\n"; $totalsell = 0; @@ -343,7 +357,9 @@ if ($id > 0 || !empty($ref)) { $productstatic->fetch($value['id']); if ($value['level'] <= 1) { - print ''; + print ''; + + print ''; $notdefined = 0; $nb_of_subproduct = $value['nb']; @@ -407,6 +423,8 @@ if ($id > 0 || !empty($ref)) { print ''; } + print ''; print ''."\n"; } else { $hide = ''; @@ -414,10 +432,11 @@ if ($id > 0 || !empty($ref)) { $hide = ' hideobject'; // By default, we do not show this. It makes screen very difficult to understand } - print ''; + print ''; //$productstatic->ref=$value['label']; $productstatic->ref = $value['ref']; + print ''; print ''; print ''; + print ''; print ''."\n"; } From 73b4f0df51ee6ca9b030c8436e411e0efe41587f Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 30 Aug 2021 13:38:55 +0000 Subject: [PATCH 0072/1460] Fixing style errors. --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 5681cf2571a..27582a533bd 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4114,7 +4114,7 @@ class Product extends CommonObject $resqlrank = $this->db->query($sqlrank); if ($resqlrank) { $cpt = 0; - while ($objrank = $this->db->fetch_object($resqlrank)){ + while ($objrank = $this->db->fetch_object($resqlrank)) { $cpt++; $sql = 'UPDATE '.MAIN_DB_PREFIX.'product_association'; $sql.= ' SET rang ='.$cpt; From 317876eb0c3b6d0ed11f78c50be12dccecabf9ae Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Mon, 30 Aug 2021 15:48:22 +0200 Subject: [PATCH 0073/1460] NEW : Update SQL : install and migration --- htdocs/install/mysql/migration/14.0.0-15.0.0.sql | 1 + htdocs/install/mysql/tables/llx_product_association.sql | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql index 1d9dd28f9d7..349b7e3a617 100644 --- a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql +++ b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql @@ -57,6 +57,7 @@ ALTER TABLE llx_categorie_ticket ADD CONSTRAINT fk_categorie_ticket_categorie_ro ALTER TABLE llx_categorie_ticket ADD CONSTRAINT fk_categorie_ticket_ticket_rowid FOREIGN KEY (fk_ticket) REFERENCES llx_ticket (rowid); ALTER TABLE llx_product_fournisseur_price MODIFY COLUMN ref_fourn varchar(128); ALTER TABLE llx_product_customer_price MODIFY COLUMN ref_customer varchar(128); +ALTER TABLE llx_product_association ADD COLUMN rang int; -- -- add action trigger INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) VALUES ('ORDER_SUPPLIER_CANCEL','Supplier order request canceled','Executed when a supplier order is canceled','order_supplier',13); diff --git a/htdocs/install/mysql/tables/llx_product_association.sql b/htdocs/install/mysql/tables/llx_product_association.sql index 91cc14882f1..5447446695f 100644 --- a/htdocs/install/mysql/tables/llx_product_association.sql +++ b/htdocs/install/mysql/tables/llx_product_association.sql @@ -23,6 +23,7 @@ create table llx_product_association fk_product_pere integer NOT NULL DEFAULT 0, -- id du produit maitre fk_product_fils integer NOT NULL DEFAULT 0, -- id du sous-produit qty double NULL, - incdec integer DEFAULT 1 -- when set to 1 changing stock of product will change stock of linked product too + incdec integer DEFAULT 1, -- when set to 1 changing stock of product will change stock of linked product too + range integer, )ENGINE=innodb; From 7794a01a0b3fe65e46518276675b3d56e2b6df32 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Mon, 30 Aug 2021 15:51:59 +0200 Subject: [PATCH 0074/1460] FIX : Stickler-ci --- htdocs/product/class/product.class.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 27582a533bd..c41228bbd4a 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4027,9 +4027,7 @@ class Product extends CommonObject if (! $this->db->query($sql)) { dol_print_error($this->db); return -1; - } - else - { + } else { return 1; } } else { From 08364d249247682d2c270d0dd99184e3ff315a0e Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Mon, 30 Aug 2021 16:08:07 +0200 Subject: [PATCH 0075/1460] FIX : Travis --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index c41228bbd4a..82bf28cb7ca 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4023,7 +4023,7 @@ class Product extends CommonObject $rank = $obj->max_rank + 1; //Addition of a product with the highest rank +1 $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'product_association(fk_product_pere,fk_product_fils,qty,incdec,rang)'; - $sql .= ' VALUES ('.$id_pere.', '.$id_fils.', '.$qty.', '.$incdec.', '.$rank.')'; + $sql .= ' VALUES ('.$id_pere.', '.$id_fils.', '.$this->db->escape($qty).', '.$incdec.', '.$rank.')'; if (! $this->db->query($sql)) { dol_print_error($this->db); return -1; From fb183f4f5d45e928ac898fa5e758f834f6fe5b34 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Mon, 30 Aug 2021 16:13:51 +0200 Subject: [PATCH 0076/1460] FIX : Travis --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 82bf28cb7ca..4d8990a12f1 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4023,7 +4023,7 @@ class Product extends CommonObject $rank = $obj->max_rank + 1; //Addition of a product with the highest rank +1 $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'product_association(fk_product_pere,fk_product_fils,qty,incdec,rang)'; - $sql .= ' VALUES ('.$id_pere.', '.$id_fils.', '.$this->db->escape($qty).', '.$incdec.', '.$rank.')'; + $sql .= ' VALUES ('.$id_pere.', '.$id_fils.', '.$qty.', '.$incdec.', '.$this->db->escape($rank).')'; if (! $this->db->query($sql)) { dol_print_error($this->db); return -1; From f44ae62eb34b2fe794f901013eb20f95311f369d Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Mon, 30 Aug 2021 16:59:09 +0200 Subject: [PATCH 0077/1460] FIX : Travis --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 4d8990a12f1..bc348925244 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4107,7 +4107,7 @@ class Product extends CommonObject //Updated ranks so that none are missing $sqlrank = 'SELECT rowid, rang FROM '.MAIN_DB_PREFIX.'product_association'; - $sqlrank.= ' WHERE fk_product_pere = '.$fk_parent; + $sqlrank.= ' WHERE fk_product_pere = '.$this->db->escape($fk_parent); $sqlrank.= ' ORDER BY rang'; $resqlrank = $this->db->query($sqlrank); if ($resqlrank) { From 58845082b1a861e2d643350801ee8e14eb7cd5a0 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Mon, 30 Aug 2021 17:20:50 +0200 Subject: [PATCH 0078/1460] FIX : Travis --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index bc348925244..508059e9e34 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4116,7 +4116,7 @@ class Product extends CommonObject $cpt++; $sql = 'UPDATE '.MAIN_DB_PREFIX.'product_association'; $sql.= ' SET rang ='.$cpt; - $sql.= ' WHERE rowid ='.$objrank->rowid; + $sql.= ' WHERE rowid ='.$this->db->escape($objrank->rowid); if (! $this->db->query($sql)) { dol_print_error($this->db); return -1; From a733628e10b1259610f26312834d69022c7b71a9 Mon Sep 17 00:00:00 2001 From: Erik van Berkum Date: Tue, 31 Aug 2021 08:13:15 +0900 Subject: [PATCH 0079/1460] Fix: select products in BOM, when adding new item the $conf->product->limit_size blocks loading all --- htdocs/bom/tpl/objectline_create.tpl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/bom/tpl/objectline_create.tpl.php b/htdocs/bom/tpl/objectline_create.tpl.php index 210ab695ec8..52cea154c0f 100644 --- a/htdocs/bom/tpl/objectline_create.tpl.php +++ b/htdocs/bom/tpl/objectline_create.tpl.php @@ -100,9 +100,9 @@ if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { $statustoshow = -1; if (!empty($conf->global->ENTREPOT_EXTRA_STATUS)) { // hide products in closed warehouse, but show products for internal transfer - $form->select_produits(GETPOST('idprod', 'int'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array')); + $form->select_produits(GETPOST('idprod', 'int'), 'idprod', $filtertype, 0, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array')); } else { - $form->select_produits(GETPOST('idprod', 'int'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, '', GETPOST('combinations', 'array')); + $form->select_produits(GETPOST('idprod', 'int'), 'idprod', $filtertype, 0, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, '', GETPOST('combinations', 'array')); } echo ''; From ef2bb99476090a7600d19fc2ef71c10b4d46af35 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 1 Sep 2021 16:29:08 +0200 Subject: [PATCH 0080/1460] Update commonobject.class.php --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 22aa26ceb62..70effea53b3 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3021,7 +3021,7 @@ abstract class CommonObject * * @param int $rowid Id of line * @param int $rang Position - * @return int + * @return int <0 if KO, >0 if OK */ public function updateRangOfLine($rowid, $rang) { From 3b236f677d68031c6e2e3597d512bc9b3d45fa30 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 1 Sep 2021 16:31:16 +0200 Subject: [PATCH 0081/1460] Update llx_product_association.sql --- htdocs/install/mysql/tables/llx_product_association.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_product_association.sql b/htdocs/install/mysql/tables/llx_product_association.sql index 5447446695f..f97e2aa6a0b 100644 --- a/htdocs/install/mysql/tables/llx_product_association.sql +++ b/htdocs/install/mysql/tables/llx_product_association.sql @@ -24,6 +24,6 @@ create table llx_product_association fk_product_fils integer NOT NULL DEFAULT 0, -- id du sous-produit qty double NULL, incdec integer DEFAULT 1, -- when set to 1 changing stock of product will change stock of linked product too - range integer, + rang integer DEFAULT 0 )ENGINE=innodb; From 4b7b54e196f8d07246d4d73bb199129182a6dbcd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 1 Sep 2021 16:32:25 +0200 Subject: [PATCH 0082/1460] Update 14.0.0-15.0.0.sql --- htdocs/install/mysql/migration/14.0.0-15.0.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql index 349b7e3a617..cd6cbeae3e6 100644 --- a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql +++ b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql @@ -57,7 +57,7 @@ ALTER TABLE llx_categorie_ticket ADD CONSTRAINT fk_categorie_ticket_categorie_ro ALTER TABLE llx_categorie_ticket ADD CONSTRAINT fk_categorie_ticket_ticket_rowid FOREIGN KEY (fk_ticket) REFERENCES llx_ticket (rowid); ALTER TABLE llx_product_fournisseur_price MODIFY COLUMN ref_fourn varchar(128); ALTER TABLE llx_product_customer_price MODIFY COLUMN ref_customer varchar(128); -ALTER TABLE llx_product_association ADD COLUMN rang int; +ALTER TABLE llx_product_association ADD COLUMN rang integer DEFAULT 0; -- -- add action trigger INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) VALUES ('ORDER_SUPPLIER_CANCEL','Supplier order request canceled','Executed when a supplier order is canceled','order_supplier',13); From cda25b711542d13eeef178748b7ea1f40735f9b5 Mon Sep 17 00:00:00 2001 From: Erik van Berkum Date: Fri, 3 Sep 2021 10:41:33 +0900 Subject: [PATCH 0083/1460] Previous commit was not a bug --- htdocs/bom/tpl/objectline_create.tpl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/bom/tpl/objectline_create.tpl.php b/htdocs/bom/tpl/objectline_create.tpl.php index 52cea154c0f..210ab695ec8 100644 --- a/htdocs/bom/tpl/objectline_create.tpl.php +++ b/htdocs/bom/tpl/objectline_create.tpl.php @@ -100,9 +100,9 @@ if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { $statustoshow = -1; if (!empty($conf->global->ENTREPOT_EXTRA_STATUS)) { // hide products in closed warehouse, but show products for internal transfer - $form->select_produits(GETPOST('idprod', 'int'), 'idprod', $filtertype, 0, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array')); + $form->select_produits(GETPOST('idprod', 'int'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array')); } else { - $form->select_produits(GETPOST('idprod', 'int'), 'idprod', $filtertype, 0, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, '', GETPOST('combinations', 'array')); + $form->select_produits(GETPOST('idprod', 'int'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, '', GETPOST('combinations', 'array')); } echo ''; From b13fc30a0a7a96ac152b68813aade802cf032234 Mon Sep 17 00:00:00 2001 From: Henry Date: Sat, 4 Sep 2021 12:25:40 +0800 Subject: [PATCH 0084/1460] Update dolibarr.php --- htdocs/admin/system/dolibarr.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index 0271488b65a..a39d4dc2a8c 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -505,7 +505,7 @@ if ($resql) { $obj = $db->fetch_object($resql); print ''; - print ''."\n"; + print ''."\n"; print '"; + // Link to the submit vote/register page + print ''; + + // Link to the subscribe + print ''; + print '
'.$langs->trans('Rank').''.$langs->trans('ComposedProduct').''.$langs->trans('Label').''.$langs->trans('MinSupplierPrice').''.$langs->trans('Qty').''.$langs->trans('ComposedProductIncDecStock').'
'.$object->sousprods[$parent_label][$value['id']][7].''.($value['incdec'] == 1 ? 'x' : '').''; + print '
'; for ($i = 0; $i < $value['level']; $i++) { print '     '; // Add indentation @@ -437,6 +456,7 @@ if ($id > 0 || !empty($ref)) { } print ''.$value['nb'].'  
'.$obj->name.''.$obj->name.''; if (isASecretKey($obj->name)) { if (empty($dolibarr_main_prod)) { From 456f25d57e95ed5528e3f1eb08a034f5268547ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 4 Sep 2021 11:30:03 +0200 Subject: [PATCH 0085/1460] fix #17634 --- htdocs/main.inc.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index a56054b9594..cc2a21b9f84 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1766,6 +1766,7 @@ function top_menu_user($hideloginname = 0, $urllogout = '') global $dolibarr_main_authentication, $dolibarr_main_demo; global $menumanager; + $langs->load('companies'); $userImage = $userDropDownImage = ''; if (!empty($user->photo)) { From 940f77fb61a06f5789242be8b6c5ca35bd705c01 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 5 Sep 2021 12:15:11 +0200 Subject: [PATCH 0086/1460] fix entity knowledgerecord --- htdocs/knowledgemanagement/class/knowledgerecord.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php index 6b192c4a83e..632317958c5 100644 --- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php +++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php @@ -102,7 +102,8 @@ class KnowledgeRecord extends CommonObject public $fields=array( 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'visible'=>5, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object"), - 'question' => array('type'=>'text', 'label'=>'Question', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'csslist'=>'tdoverflow300', 'copytoclipboard'=>1), + 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>20, 'index'=>1), + 'question' => array('type'=>'text', 'label'=>'Question', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'csslist'=>'tdoverflow300', 'copytoclipboard'=>1), 'lang' => array('type'=>'varchar(6)', 'label'=>'Language', 'enabled'=>'1', 'position'=>40, 'notnull'=>0, 'visible'=>1), 'answer' => array('type'=>'html', 'label'=>'Solution', 'enabled'=>'1', 'position'=>50, 'notnull'=>0, 'visible'=>3, 'csslist'=>'tdoverflow300', 'copytoclipboard'=>1), 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2,), @@ -119,6 +120,7 @@ class KnowledgeRecord extends CommonObject ); public $rowid; public $ref; + public $entity; public $date_creation; public $tms; public $last_main_doc; From 3ea23d75fec8990e51b638544e36ec0f2c42e2fd Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sun, 5 Sep 2021 10:17:23 +0000 Subject: [PATCH 0087/1460] Fixing style errors. --- htdocs/knowledgemanagement/class/knowledgerecord.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php index 632317958c5..4c718589d7c 100644 --- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php +++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php @@ -103,7 +103,7 @@ class KnowledgeRecord extends CommonObject 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'visible'=>5, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object"), 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>20, 'index'=>1), - 'question' => array('type'=>'text', 'label'=>'Question', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'csslist'=>'tdoverflow300', 'copytoclipboard'=>1), + 'question' => array('type'=>'text', 'label'=>'Question', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'csslist'=>'tdoverflow300', 'copytoclipboard'=>1), 'lang' => array('type'=>'varchar(6)', 'label'=>'Language', 'enabled'=>'1', 'position'=>40, 'notnull'=>0, 'visible'=>1), 'answer' => array('type'=>'html', 'label'=>'Solution', 'enabled'=>'1', 'position'=>50, 'notnull'=>0, 'visible'=>3, 'csslist'=>'tdoverflow300', 'copytoclipboard'=>1), 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2,), @@ -120,7 +120,7 @@ class KnowledgeRecord extends CommonObject ); public $rowid; public $ref; - public $entity; + public $entity; public $date_creation; public $tms; public $last_main_doc; From 1c97393a6900c8e1af792408fe405842b90494c0 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 5 Sep 2021 15:35:06 +0200 Subject: [PATCH 0088/1460] FIX increase maxlength of password input --- htdocs/user/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index cb7aa69949c..8622e293906 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -3,7 +3,7 @@ * Copyright (C) 2002-2003 Jean-Louis Bergamo * Copyright (C) 2004-2020 Laurent Destailleur * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2005-2018 Regis Houssin + * Copyright (C) 2005-2021 Regis Houssin * Copyright (C) 2005 Lionel Cousteix * Copyright (C) 2011 Herve Prot * Copyright (C) 2012-2018 Juanjo Menent @@ -2290,7 +2290,7 @@ if ($action == 'create' || $action == 'adduserldap') { } if (preg_match('/dolibarr/', $dolibarr_main_authentication)) { if ($caneditpassword) { - $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').''; + $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').''; } else { $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').preg_replace('/./i', '*', $object->pass); } From b9150c2441c2706ef2bc2cb0908f92c359d0459f Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Mon, 6 Sep 2021 11:20:36 +0200 Subject: [PATCH 0089/1460] add produce line if no produce objects --- htdocs/mrp/mo_production.php | 67 +++++++++++++++++++++++++++++++++--- 1 file changed, 62 insertions(+), 5 deletions(-) diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 678865805d7..70eb96c5fe1 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -149,14 +149,19 @@ if (empty($reshook)) { $result = $object->setStatut($object::STATUS_INPROGRESS, 0, '', 'MRP_REOPEN'); } - if ($action == 'confirm_addconsumeline' && GETPOST('addconsumelinebutton') && $permissiontoadd) { + if (($action == 'confirm_addconsumeline' && GETPOST('addconsumelinebutton') && $permissiontoadd) + || $action == 'confirm_addproduceline' && GETPOST('addproducelinebutton') && $permissiontoadd) { $moline = new MoLine($db); // Line to produce $moline->fk_mo = $object->id; $moline->qty = GETPOST('qtytoadd', 'int'); ; $moline->fk_product = GETPOST('productidtoadd', 'int'); - $moline->role = 'toconsume'; + if (GETPOST('addconsumelinebutton')) { + $moline->role = 'toconsume'; + } else { + $moline->role = 'toproduce'; + } $moline->origin_type = 'free'; // free consume line $moline->position = 0; @@ -642,7 +647,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; } - if (in_array($action, array('consumeorproduce', 'consumeandproduceall', 'addconsumeline'))) { + if (in_array($action, array('consumeorproduce', 'consumeandproduceall', 'addconsumeline', 'addproduceline'))) { print '
'; print ''; print ''; @@ -962,8 +967,21 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print '
'; print '
'; - print load_fiche_titre($langs->trans('Production'), '', ''); + $nblinetoproduce = 0; + foreach ($object->lines as $line) { + if ($line->role == 'toproduce') { + $nblinetoproduce++; + } + } + if (empty($nblinetoproduce)) { + if ($object->status != $object::STATUS_PRODUCED && $object->status != $object::STATUS_CANCELED && $action != 'consumeorproduce' && $action != 'consumeandproduceall') { + $newlinetext = ''.$langs->trans("AddNewProduceLines").''; + } + print load_fiche_titre($langs->trans('Production'), '', '', 0, '', '', $newlinetext); + } else { + print load_fiche_titre($langs->trans('Production'), '', '', 0); + } print '
'; print ''; @@ -993,6 +1011,34 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } print ''; + if ($action == 'addproduceline') { + print ''."\n"; + print ''; + print ''; + // Qty + print ''; + // Cost price + print ''; + + // Qty already produced + print ''; + // Warehouse + print ''; + // Lot - serial + if ($conf->productbatch->enabled) { + print ''; + } + // Action + if ($permissiontodelete) { + print ''; + } + print ''; + } + if (!empty($object->lines)) { $nblinetoproduce = 0; foreach ($object->lines as $line) { @@ -1065,7 +1111,18 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; if ($conf->productbatch->enabled) { print ''; // Lot - print ''; + } + + if ($permissiontodelete && $line->origin_type == 'free') { + $href = $_SERVER["PHP_SELF"]; + $href .= '?id='.$object->id; + $href .= '&action=deleteline'; + $href .= '&lineid='.$line->id; + print ''; } print ''; From be1c08ddfe322c8f44a5e4a7474bd39f6f630bec Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Mon, 6 Sep 2021 12:30:39 +0200 Subject: [PATCH 0090/1460] FIX : salary extrafields don't work and table is not well named --- htdocs/core/tpl/extrafields_view.tpl.php | 3 +++ .../install/mysql/migration/13.0.0-14.0.0.sql | 2 ++ ...key.sql => llx_salary_extrafields.key.sql} | 2 +- ...afields.sql => llx_salary_extrafields.sql} | 4 ++-- .../salaries/admin/salaries_extrafields.php | 2 +- htdocs/salaries/card.php | 24 +++++++++++++++++++ 6 files changed, 33 insertions(+), 4 deletions(-) rename htdocs/install/mysql/tables/{llx_payment_salary_extrafields.key.sql => llx_salary_extrafields.key.sql} (89%) rename htdocs/install/mysql/tables/{llx_payment_salary_extrafields.sql => llx_salary_extrafields.sql} (91%) diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index 3f2ab773b06..0a2348f5858 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -194,6 +194,9 @@ if (empty($reshook) && isset($extrafields->attributes[$object->table_element]['l if ($object->element == 'contact') { $permok = $user->rights->societe->contact->creer; } + if($object->element == 'salary') { + $permok = $user->rights->salaries->read; + } $isdraft = ((isset($object->statut) && $object->statut == 0) || (isset($object->status) && $object->status == 0)); if (($isdraft || !empty($extrafields->attributes[$object->table_element]['alwayseditable'][$tmpkeyextra])) diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index d50b6991261..7c1815377be 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -349,6 +349,8 @@ UPDATE llx_payment_salary SET ref = rowid WHERE ref IS NULL; ALTER TABLE llx_salary ALTER COLUMN paye set default 0; +ALTER TABLE llx_payment_salary_extrafields RENAME TO llx_salary_extrafields; + DELETE FROM llx_boxes WHERE box_id IN (SELECT rowid FROM llx_boxes_def WHERE file IN ('box_graph_ticket_by_severity', 'box_ticket_by_severity.php', 'box_nb_ticket_last_x_days.php', 'box_nb_tickets_type.php', 'box_new_vs_close_ticket.php')); DELETE FROM llx_boxes_def WHERE file IN ('box_graph_ticket_by_severity', 'box_ticket_by_severity.php', 'box_nb_ticket_last_x_days.php', 'box_nb_tickets_type.php', 'box_new_vs_close_ticket.php'); diff --git a/htdocs/install/mysql/tables/llx_payment_salary_extrafields.key.sql b/htdocs/install/mysql/tables/llx_salary_extrafields.key.sql similarity index 89% rename from htdocs/install/mysql/tables/llx_payment_salary_extrafields.key.sql rename to htdocs/install/mysql/tables/llx_salary_extrafields.key.sql index 9231351a749..9c6e047d9ee 100644 --- a/htdocs/install/mysql/tables/llx_payment_salary_extrafields.key.sql +++ b/htdocs/install/mysql/tables/llx_salary_extrafields.key.sql @@ -17,4 +17,4 @@ -- =================================================================== -ALTER TABLE llx_payment_salary_extrafields ADD INDEX idx_payment_salary_extrafields (fk_object); +ALTER TABLE llx_salary_extrafields ADD INDEX idx_salary_extrafields (fk_object); diff --git a/htdocs/install/mysql/tables/llx_payment_salary_extrafields.sql b/htdocs/install/mysql/tables/llx_salary_extrafields.sql similarity index 91% rename from htdocs/install/mysql/tables/llx_payment_salary_extrafields.sql rename to htdocs/install/mysql/tables/llx_salary_extrafields.sql index 5f15918ef18..bedab6757b4 100644 --- a/htdocs/install/mysql/tables/llx_payment_salary_extrafields.sql +++ b/htdocs/install/mysql/tables/llx_salary_extrafields.sql @@ -16,10 +16,10 @@ -- -- =================================================================== -create table llx_payment_salary_extrafields +create table llx_salary_extrafields ( rowid integer AUTO_INCREMENT PRIMARY KEY, tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - fk_object integer NOT NULL, -- salary payment id + fk_object integer NOT NULL, -- salary id import_key varchar(14) -- import key )ENGINE=innodb; diff --git a/htdocs/salaries/admin/salaries_extrafields.php b/htdocs/salaries/admin/salaries_extrafields.php index 38303518ac4..2354da8048a 100644 --- a/htdocs/salaries/admin/salaries_extrafields.php +++ b/htdocs/salaries/admin/salaries_extrafields.php @@ -42,7 +42,7 @@ foreach ($tmptype2label as $key => $val) { $action = GETPOST('action', 'aZ09'); $attrname = GETPOST('attrname', 'alpha'); -$elementtype = 'payment_salary'; //Must be the $table_element of the class that manage extrafield +$elementtype = 'salary'; //Must be the $table_element of the class that manage extrafield if (!$user->admin) { accessforbidden(); diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index d3c7ba504cb..d3cbc5d3904 100755 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -354,6 +354,30 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && ($user->rights->salaries- } } +// Action to update one extrafield +if ($action == "update_extras" && !empty($user->rights->salaries->read)) { + $object->fetch(GETPOST('id', 'int')); + + $attributekey = GETPOST('attribute', 'alpha'); + $attributekeylong = 'options_'.$attributekey; + + if (GETPOSTISSET($attributekeylong.'day') && GETPOSTISSET($attributekeylong.'month') && GETPOSTISSET($attributekeylong.'year')) { + // This is properties of a date + $object->array_options['options_'.$attributekey] = dol_mktime(GETPOST($attributekeylong.'hour', 'int'), GETPOST($attributekeylong.'min', 'int'), GETPOST($attributekeylong.'sec', 'int'), GETPOST($attributekeylong.'month', 'int'), GETPOST($attributekeylong.'day', 'int'), GETPOST($attributekeylong.'year', 'int')); + //var_dump(dol_print_date($object->array_options['options_'.$attributekey]));exit; + } else { + $object->array_options['options_'.$attributekey] = GETPOST($attributekeylong, 'alpha'); + } + + $result = $object->insertExtraFields(empty($triggermodname) ? '' : $triggermodname, $user); + if ($result > 0) { + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); + $action = 'view'; + } else { + setEventMessages($object->error, $object->errors, 'errors'); + $action = 'edit_extras'; + } +} /* * View From 383c92f6c62c32d9d7fd846f9b1f50ed49da7b65 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Mon, 6 Sep 2021 14:52:11 +0200 Subject: [PATCH 0091/1460] FIX : migration script --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index 7c1815377be..a562f00c295 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -349,6 +349,7 @@ UPDATE llx_payment_salary SET ref = rowid WHERE ref IS NULL; ALTER TABLE llx_salary ALTER COLUMN paye set default 0; +UPDATE llx_extrafields SET elementtype = 'salary' WHERE elementtype = 'payment_salary'; ALTER TABLE llx_payment_salary_extrafields RENAME TO llx_salary_extrafields; DELETE FROM llx_boxes WHERE box_id IN (SELECT rowid FROM llx_boxes_def WHERE file IN ('box_graph_ticket_by_severity', 'box_ticket_by_severity.php', 'box_nb_ticket_last_x_days.php', 'box_nb_tickets_type.php', 'box_new_vs_close_ticket.php')); From 765f0c4d1919faa8f08f47159f756a04dc75c829 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Mon, 6 Sep 2021 14:56:30 +0200 Subject: [PATCH 0092/1460] Close #18584 : Code enhancement of MO --- htdocs/langs/en_US/mrp.lang | 1 + htdocs/langs/fr_FR/mrp.lang | 1 + htdocs/mrp/class/mo.class.php | 6 ++++++ htdocs/mrp/mo_production.php | 13 +++++-------- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang index 0b779d55fbd..47d1fbe889f 100644 --- a/htdocs/langs/en_US/mrp.lang +++ b/htdocs/langs/en_US/mrp.lang @@ -74,6 +74,7 @@ NoStockChangeOnServices=No stock change on services ProductQtyToConsumeByMO=Product quantity still to consume by open MO ProductQtyToProduceByMO=Product quantity still to produce by open MO AddNewConsumeLines=Add new line to consume +AddNewProduceLines=Add new line to produce ProductsToConsume=Products to consume ProductsToProduce=Products to produce UnitCost=Unit cost diff --git a/htdocs/langs/fr_FR/mrp.lang b/htdocs/langs/fr_FR/mrp.lang index cdff650c34b..a0ab429a70c 100644 --- a/htdocs/langs/fr_FR/mrp.lang +++ b/htdocs/langs/fr_FR/mrp.lang @@ -72,6 +72,7 @@ NoStockChangeOnServices=Aucune variation de stock sur les services ProductQtyToConsumeByMO=Quantité de produit restant à consommer par OF ouvert ProductQtyToProduceByMO=Quantités restant à produire avec les OF ouverts AddNewConsumeLines=Ajouter une nouvelle ligne à consommer +AddNewProduceLines=Ajouter une nouvelle ligne à produire ProductsToConsume=Produits à consommer ProductsToProduce=Produits à produire UnitCost=Coût unitaire diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index f4069bfc518..2fc2a01a802 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -659,6 +659,12 @@ class Mo extends CommonObject $role = 'toconsume'; $moline->role = 'toproduce'; } + } else { + if ($this->mrptype == 1) { + $moline->role = 'toconsume'; + } else { + $moline->role = 'toproduce'; + } } $resultline = $moline->create($user, false); // Never use triggers here diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 70eb96c5fe1..0558e7e74a4 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -973,15 +973,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $nblinetoproduce++; } } - - if (empty($nblinetoproduce)) { - if ($object->status != $object::STATUS_PRODUCED && $object->status != $object::STATUS_CANCELED && $action != 'consumeorproduce' && $action != 'consumeandproduceall') { - $newlinetext = ''.$langs->trans("AddNewProduceLines").''; - } - print load_fiche_titre($langs->trans('Production'), '', '', 0, '', '', $newlinetext); - } else { - print load_fiche_titre($langs->trans('Production'), '', '', 0); + $newlinetext = ''; + if ($object->status != $object::STATUS_PRODUCED && $object->status != $object::STATUS_CANCELED && $action != 'consumeorproduce' && $action != 'consumeandproduceall') { + $newlinetext = ''.$langs->trans("AddNewProduceLines").''; } + print load_fiche_titre($langs->trans('Production'), '', '', 0, '', '', $newlinetext); + print '
'; print '
'; + print $form->select_produits('', 'productidtoadd', '', 0, 0, -1, 2, '', 0, array(), 0, '1', 0, 'maxwidth300'); + print ''; + print ''; + print '
'; + print ''; + print img_picto('', "delete"); + print ''; + print '
'; From 1043bc964ddb714483791efbdb9bad6049c1cbbe Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 6 Sep 2021 12:58:06 +0000 Subject: [PATCH 0093/1460] Fixing style errors. --- htdocs/core/tpl/extrafields_view.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index 0a2348f5858..f50276821b1 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -194,7 +194,7 @@ if (empty($reshook) && isset($extrafields->attributes[$object->table_element]['l if ($object->element == 'contact') { $permok = $user->rights->societe->contact->creer; } - if($object->element == 'salary') { + if ($object->element == 'salary') { $permok = $user->rights->salaries->read; } From 5c9100986d0b88445613475a109a09a21216a3b5 Mon Sep 17 00:00:00 2001 From: fr69400 <82267780+fr69400@users.noreply.github.com> Date: Mon, 6 Sep 2021 15:19:35 +0200 Subject: [PATCH 0094/1460] Update row.php right write doesn't exist for supplier_proposal ->line order dont works --- htdocs/core/ajax/row.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/ajax/row.php b/htdocs/core/ajax/row.php index 95518cbbf66..ce6bd3d4d60 100644 --- a/htdocs/core/ajax/row.php +++ b/htdocs/core/ajax/row.php @@ -89,7 +89,7 @@ if (GETPOST('roworder', 'alpha', 3) && GETPOST('table_element_line', 'aZ09', 3) $perm = 1; } elseif ($table_element_line == 'mrp_production' && $user->rights->mrp->write) { $perm = 1; - } elseif ($table_element_line == 'supplier_proposaldet' && $user->rights->supplier_proposal->write) { + } elseif ($table_element_line == 'supplier_proposaldet' && $user->rights->supplier_proposal->creer) { $perm = 1; } elseif ($table_element_line == 'commande_fournisseurdet' && $user->rights->fournisseur->commande->creer) { $perm = 1; From 18da6e6d6f940c9ba3dbda75648af5186482c0ea Mon Sep 17 00:00:00 2001 From: jyhere Date: Mon, 6 Sep 2021 15:20:47 +0200 Subject: [PATCH 0095/1460] Update create.php Fix : unable to create a direct debit if ics and ics_transfer are empty even though ics_transfer is only used for bank transfer. --- htdocs/compta/prelevement/create.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 6f045f3ca74..9a3202540b4 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -95,7 +95,9 @@ if (empty($reshook)) { require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $bank = new Account($db); $bank->fetch($conf->global->{$default_account}); - if (empty($bank->ics) || empty($bank->ics_transfer)) { + if ((empty($bank->ics) && $type !== 'bank-transfer') + || (empty($bank->ics_transfer) && $type === 'bank-transfer') + ) { $errormessage = str_replace('{url}', $bank->getNomUrl(1, '', '', -1, 1), $langs->trans("ErrorICSmissing", '{url}')); setEventMessages($errormessage, null, 'errors'); header("Location: ".DOL_URL_ROOT.'/compta/prelevement/create.php'); From 3537f68c7e16a09aea83453022b262d580231e52 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 6 Sep 2021 13:24:22 +0000 Subject: [PATCH 0096/1460] Fixing style errors. --- htdocs/compta/prelevement/create.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 9a3202540b4..172cf020e34 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -96,8 +96,8 @@ if (empty($reshook)) { $bank = new Account($db); $bank->fetch($conf->global->{$default_account}); if ((empty($bank->ics) && $type !== 'bank-transfer') - || (empty($bank->ics_transfer) && $type === 'bank-transfer') - ) { + || (empty($bank->ics_transfer) && $type === 'bank-transfer') + ) { $errormessage = str_replace('{url}', $bank->getNomUrl(1, '', '', -1, 1), $langs->trans("ErrorICSmissing", '{url}')); setEventMessages($errormessage, null, 'errors'); header("Location: ".DOL_URL_ROOT.'/compta/prelevement/create.php'); From 8df911d72855774b00b22cbed6cc3080363f0e4b Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 3 Sep 2021 15:40:33 +0200 Subject: [PATCH 0097/1460] work on event --- .../class/conferenceorbooth.class.php | 2 +- .../class/conferenceorboothattendee.class.php | 5 +- .../conferenceorbooth_list.php | 13 +- .../conferenceorboothattendee_card.php | 1 + .../conferenceorboothattendee_list.php | 113 +++++++++++++----- ...ventorganization_conferenceorbooth.lib.php | 74 ++++++++++++ ...nization_conferenceorboothattendee.key.sql | 4 +- ...organization_conferenceorboothattendee.sql | 3 +- htdocs/langs/en_US/eventorganization.lang | 3 +- .../attendee_subscription.php | 63 +++++++--- 10 files changed, 228 insertions(+), 53 deletions(-) diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index 869a96e464e..100c5559ca1 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -246,7 +246,7 @@ class ConferenceOrBooth extends ActionComm $result = parent::fetch($id, $ref, $ref_ext, $email_msgid); - $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_subscription.php?id='.urlencode($id); + $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_subscription.php?id='.urlencode($id).'&type=conf'; $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); $link_subscription .= '&securekey='.urlencode($encodedsecurekey); diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index b6c80feadd4..985c61376b6 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -103,7 +103,8 @@ class ConferenceOrBoothAttendee extends CommonObject 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>2, 'index'=>1, 'comment'=>"Reference of object"), 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'Attendee', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty",), - 'fk_actioncomm' => array('type'=>'integer:ActionComm:comm/action/class/actioncomm.class.php:1', 'label'=>'ConferenceOrBooth', 'enabled'=>'1', 'position'=>53, 'notnull'=>1, 'visible'=>0, 'index'=>1,), + 'fk_actioncomm' => array('type'=>'integer:ActionComm:comm/action/class/actioncomm.class.php:1', 'label'=>'ConferenceOrBooth', 'enabled'=>'1', 'position'=>53, 'notnull'=>0, 'visible'=>0, 'index'=>1,), + 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'1', 'position'=>54, 'notnull'=>1, 'visible'=>0, 'index'=>1,), 'email' => array('type'=>'mail', 'label'=>'Email', 'enabled'=>'1', 'position'=>55, 'notnull'=>1, 'visible'=>1, 'index'=>1,), 'date_subscription' => array('type'=>'datetime', 'label'=>'DateSubscription', 'enabled'=>'1', 'position'=>56, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'1',), 'amount' => array('type'=>'price', 'label'=>'AmountOfSubscriptionPaid', 'enabled'=>'1', 'position'=>57, 'notnull'=>0, 'visible'=>1, 'default'=>'null', 'isameasure'=>'1', 'help'=>"AmountOfSubscriptionPaid",), @@ -403,7 +404,7 @@ class ConferenceOrBoothAttendee extends CommonObject $sql = 'SELECT '; $sql .= $this->getFieldList('t'); $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; - $sql .= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm as a on a.id=t.fk_actioncomm"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."actioncomm as a on a.id=t.fk_actioncomm"; if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) { $sql .= ' WHERE t.entity IN ('.getEntity($this->table_element).')'; } else { diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index 2306066f9a7..5376acb3289 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -29,6 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; +require_once DOL_DOCUMENT_ROOT.'/eventorganization/lib/eventorganization_conferenceorbooth.lib.php'; if ($conf->categorie->enabled) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -266,7 +267,7 @@ if ($projectid > 0) { //print "userAccess=".$userAccess." userWrite=".$userWrite." userDelete=".$userDelete; $head = project_prepare_head($project); - print dol_get_fiche_head($head, 'eventorganisation', $langs->trans("Project"), -1, ($project->public ? 'projectpub' : 'project')); + print dol_get_fiche_head($head, 'eventorganisation', $langs->trans("ConferenceOrBoothTab"), -1, ($project->public ? 'projectpub' : 'project')); // Project card $linkback = ''.$langs->trans("BackToList").''; @@ -440,10 +441,10 @@ if ($projectid > 0) { // Link to the subscribe print '
'; //print ''; - print $langs->trans("PublicAttendeeSubscriptionPage"); + print $langs->trans("PublicAttendeeSubscriptionGlobalPage"); //print ''; print ''; - $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_subscription.php?id='.$project->id; + $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_subscription.php?id='.$project->id.'&type=global'; $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$project->id, 2); $link_subscription .= '&securekey='.urlencode($encodedsecurekey); //print '
'; + print '
'; + print '
'; - print '
'; + print '
'; - print dol_get_fiche_end(); + print dol_get_fiche_end(); + } } $arrayofselected = is_array($toselect) ? $toselect : array(); @@ -612,7 +669,7 @@ print ''; print ''; print ''; -$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_card.php?action=create'.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').$withProjectUrl.'&backtopage='.urlencode($_SERVER['PHP_SELF'].(!empty($confOrBooth->id)?'?conforboothid='.$confOrBooth->id:'').$withProjectUrl), '', $permissiontoadd); +$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_card.php?action=create'.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').$withProjectUrl.'&backtopage='.urlencode($_SERVER['PHP_SELF'].(!empty($confOrBooth->id)?'?conforboothid='.$confOrBooth->id:'').$withProjectUrl), '', $permissiontoadd); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); diff --git a/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php b/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php index 7d6339a2ed0..fcdd3c296e1 100644 --- a/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php +++ b/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php @@ -106,6 +106,80 @@ function conferenceorboothPrepareHead($object, $with_project = 0) return $head; } +/** + * Prepare array of tabs for ConferenceOrBooth Project tab + * + * @param $object Project Project + * @return array + */ +function conferenceorboothProjectPrepareHead($object) +{ + + global $db, $langs, $conf; + + $langs->load("eventorganization"); + + $h = 0; + $head = array(); + + $head[$h][0] = dol_buildpath("/eventorganization/conferenceorbooth_list.php", 1).'?projectid='.$object->id; + $head[$h][1] = $langs->trans("ConferenceOrBooth"); + $head[$h][2] = 'conferenceorbooth'; + // Enable caching of conf or booth count attendees + $nbAttendees = 0; + require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; + $cachekey = 'count_conferenceorbooth_project_'.$object->id; + $dataretrieved = dol_getcache($cachekey); + if (!is_null($dataretrieved)) { + $nbAttendees = $dataretrieved; + } else { + require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; + $conforbooth=new ConferenceOrBooth($db); + $result = $conforbooth->fetchAll('', '', 0, 0, array('t.fk_project'=>$object->id)); + if (!is_array($result) && $result<0) { + setEventMessages($conforbooth->error, $conforbooth->errors, 'errors'); + } else { + $nbConferenceOrBooth = count($result); + } + dol_setcache($cachekey, $nbConferenceOrBooth, 120); // If setting cache fails, this is not a problem, so we do not test result. + } + if ($nbConferenceOrBooth > 0) { + $head[$h][1] .= ''.$nbConferenceOrBooth.''; + } + $h++; + + $head[$h][0] = dol_buildpath("/eventorganization/conferenceorboothattendee_list.php", 1).'?fk_project='.$object->id.'&withproject=1'; + $head[$h][1] = $langs->trans("Attendees"); + $head[$h][2] = 'attendees'; + // Enable caching of conf or booth count attendees + $nbAttendees = 0; + require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; + $cachekey = 'count_attendees_conferenceorbooth_project_'.$object->id; + $dataretrieved = dol_getcache($cachekey); + if (!is_null($dataretrieved)) { + $nbAttendees = $dataretrieved; + } else { + require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php'; + $attendees=new ConferenceOrBoothAttendee($db); + $result = $attendees->fetchAll('', '', 0, 0, array('t.fk_project'=>$object->id)); + if (!is_array($result) && $result<0) { + setEventMessages($attendees->error, $attendees->errors, 'errors'); + } else { + $nbAttendees = count($result); + } + dol_setcache($cachekey, $nbAttendees, 120); // If setting cache fails, this is not a problem, so we do not test result. + } + if ($nbAttendees > 0) { + $head[$h][1] .= ''.$nbAttendees.''; + } + + complete_head_from_modules($conf, $langs, $object, $head, $h, 'conferenceorboothproject@eventorganization'); + + complete_head_from_modules($conf, $langs, $object, $head, $h, 'conferenceorboothproject@eventorganization', 'remove'); + + return $head; +} + /** * Prepare array of tabs for ConferenceOrBoothAttendees diff --git a/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.key.sql b/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.key.sql index 3b9cc52e68f..0633e3cc2a2 100644 --- a/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.key.sql +++ b/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.key.sql @@ -21,10 +21,12 @@ ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_evento ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD CONSTRAINT fx_eventorganization_conferenceorboothattendee_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe(rowid); ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_fk_actioncomm (fk_actioncomm); ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD CONSTRAINT fx_eventorganization_conferenceorboothattendee_fk_actioncomm FOREIGN KEY (fk_actioncomm) REFERENCES llx_actioncomm(id); +ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_fk_project (fk_project); +ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD CONSTRAINT fx_eventorganization_conferenceorboothattendee_fk_project FOREIGN KEY (fk_project) REFERENCES llx_projet(rowid); ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_email (email); ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_status (status); -- END MODULEBUILDER INDEXES -ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD UNIQUE INDEX uk_eventorganization_conferenceorboothattendee(fk_soc, fk_actioncomm, email); +ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD UNIQUE INDEX uk_eventorganization_conferenceorboothattendee(fk_soc, fk_project, fk_actioncomm, email); diff --git a/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.sql b/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.sql index 026295627d0..6d01cf4bba1 100644 --- a/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.sql +++ b/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.sql @@ -19,7 +19,8 @@ CREATE TABLE llx_eventorganization_conferenceorboothattendee( rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, ref varchar(128) NOT NULL, fk_soc integer, - fk_actioncomm integer NOT NULL, + fk_actioncomm integer, + fk_project integer NOT NULL, email varchar(100), date_subscription datetime, amount double DEFAULT NULL, diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index d2840be73f2..7c07b853a6b 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -110,7 +110,8 @@ ListOfConferencesOrBooths=List of conferences or booths SuggestConference = Suggest a new conference SuggestBooth = Suggest a booth ViewAndVote = View and vote for suggested events -PublicAttendeeSubscriptionPage = Public link for registration to the event +PublicAttendeeSubscriptionGlobalPage = Public link for registration to the event +PublicAttendeeSubscriptionPage = Public link for registration to this event only MissingOrBadSecureKey = The security key is invalid or missing EvntOrgWelcomeMessage = This form allows you to register as a new participant to the conference : '%s' EvntOrgDuration = This conference starts on %s and ends on %s. diff --git a/htdocs/public/eventorganization/attendee_subscription.php b/htdocs/public/eventorganization/attendee_subscription.php index 0387843cf94..506b7215211 100644 --- a/htdocs/public/eventorganization/attendee_subscription.php +++ b/htdocs/public/eventorganization/attendee_subscription.php @@ -80,20 +80,35 @@ $societe = GETPOST("societe"); // Getting id from Post and decoding it $id = GETPOST('id', 'int'); +$type = GETPOST('type', 'alpha'); $conference = new ConferenceOrBooth($db); -$resultconf = $conference->fetch($id); -if ($resultconf < 0) { - print 'Bad value for parameter id'; - exit; +$project = new Project($db); + +if ($type=='conf') { + $resultconf = $conference->fetch($id); + if ($resultconf < 0) { + print 'Bad value for parameter id'; + exit; + } + $resultproject = $project->fetch($conference->fk_project); + if ($resultproject < 0) { + $error++; + $errmsg .= $project->error; + } +} +if ($type=='global') { + $project = new Project($db); + if (empty($id)) { + $id = GETPOST('fk_project', 'int'); + } + $resultproject = $project->fetch($id); + if ($resultproject < 0) { + $error++; + $errmsg .= $project->error; + } } -$project = new Project($db); -$resultproject = $project->fetch($conference->fk_project); -if ($resultproject < 0) { - $error++; - $errmsg .= $project->error; -} // Security check @@ -206,7 +221,7 @@ if ($reshook < 0) { } // Action called when page is submitted -if (empty($reshook) && $action == 'add' && $conference->status == 2) { +if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conference->status!=2 || !empty($project->id) && $project->status==Project::STATUS_VALIDATED)) { $error = 0; $urlback = ''; @@ -235,7 +250,15 @@ if (empty($reshook) && $action == 'add' && $conference->status == 2) { if (!$error) { // Check if attendee already exists (by email and for this event) $confattendee = new ConferenceOrBoothAttendee($db); - $resultfetchconfattendee = $confattendee->fetchAll('', '', 0, 0, array('t.fk_actioncomm'=>$id, 'customsql'=>'t.email="'.$email.'"')); + + if ($type=='global') { + $filter = array('t.fk_project'=>$id, 'customsql'=>'t.email="'.$email.'"'); + } + if ($action='conf') { + $filter = array('t.fk_actioncomm'=>$id, 'customsql'=>'t.email="'.$email.'"'); + } + + $resultfetchconfattendee = $confattendee->fetchAll('', '', 0, 0, $filter); if ($resultfetchconfattendee > 0 && count($resultfetchconfattendee)>0) { // Found confattendee $confattendee = array_shift($resultfetchconfattendee); @@ -243,6 +266,7 @@ if (empty($reshook) && $action == 'add' && $conference->status == 2) { // Need to create a confattendee $confattendee->date_subscription = dol_now(); $confattendee->email = $email; + $confattendee->fk_project = $project->id; $confattendee->fk_actioncomm = $id; $resultconfattendee = $confattendee->create($user); if ($resultconfattendee < 0) { @@ -470,16 +494,21 @@ print '
'; print '
'; // Welcome message -print $langs->trans("EvntOrgWelcomeMessage", $conference->label); + +print $langs->trans("EvntOrgWelcomeMessage", $project->title . ' '. $conference->label); print '
'; -print $langs->trans("EvntOrgDuration", dol_print_date($conference->datep), dol_print_date($conference->datef)); +if ($conference->id) { + print $langs->trans("EvntOrgDuration", dol_print_date($conference->datep), dol_print_date($conference->datef)); +} else { + print $langs->trans("EvntOrgDuration", dol_print_date($project->date_start), dol_print_date($project->date_end)); +} print '
'; print '
'; dol_htmloutput_errors($errmsg); -if ($conference->status!=2) { +if (!empty($conference->id) && $conference->status!=2 || !empty($project->id) && $project->status==Project::STATUS_VALIDATED) { print $langs->trans("ConferenceIsNotConfirmed"); } else { // Print form @@ -487,7 +516,9 @@ if ($conference->status!=2) { print ''; print ''; print ''; - print ''; + print ''; + print ''; + print ''; print ''; print '
'; From a57c4c7cc557cbc0793a4df47689e6697b4fee89 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 3 Sep 2021 16:39:10 +0200 Subject: [PATCH 0098/1460] ok for prod --- htdocs/admin/eventorganization.php | 4 +- .../class/conferenceorboothattendee.class.php | 4 + .../conferenceorboothattendee_card.php | 121 +++++++----------- .../conferenceorboothattendee_list.php | 11 +- .../attendee_subscription.php | 24 ++-- 5 files changed, 74 insertions(+), 90 deletions(-) diff --git a/htdocs/admin/eventorganization.php b/htdocs/admin/eventorganization.php index d01aece1ca0..439a3d9cafa 100644 --- a/htdocs/admin/eventorganization.php +++ b/htdocs/admin/eventorganization.php @@ -48,8 +48,8 @@ $arrayofparameters = array( 'EVENTORGANIZATION_TASK_LABEL'=>array('type'=>'textarea','enabled'=>1), 'EVENTORGANIZATION_CATEG_THIRDPARTY_CONF'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1), 'EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1), - //'EVENTORGANIZATION_FILTERATTENDEES_CAT'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1), - //'EVENTORGANIZATION_FILTERATTENDEES_TYPE'=>array('type'=>'thirdparty_type:', 'enabled'=>1), + 'EVENTORGANIZATION_FILTERATTENDEES_CAT'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1), + 'EVENTORGANIZATION_FILTERATTENDEES_TYPE'=>array('type'=>'thirdparty_type:', 'enabled'=>1), 'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1), 'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1), 'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1), diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index 985c61376b6..61d8e7c32b2 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -747,6 +747,10 @@ class ConferenceOrBoothAttendee extends CommonObject $url .= '&conforboothid='.$this->fk_actioncomm; } + if ($option == 'projectid') { + $url .= '&fk_project='.$this->fk_project.'&withproject=1'; + } + if ($option == 'conforboothidproject') { $url .= '&conforboothid='.$this->fk_actioncomm.'&withproject=1' ; } diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php index 80b4b00dc9f..ff46f7b4a7b 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_card.php +++ b/htdocs/eventorganization/conferenceorboothattendee_card.php @@ -47,6 +47,7 @@ $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); //$lineid = GETPOST('lineid', 'int'); $conf_or_booth_id = GETPOST('conforboothid', 'int'); +$fk_project = GETPOST('fk_project', 'int'); $withproject = GETPOST('withproject', 'int'); // Initialize technical objects @@ -174,7 +175,7 @@ $title = $langs->trans("ConferenceOrBoothAttendee"); $help_url = ''; llxHeader('', $title, $help_url); -$result = $projectstatic->fetch($confOrBooth->fk_project); +$result = $projectstatic->fetch(empty($confOrBooth->fk_project)?$fk_project:$confOrBooth->fk_project); if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) { $projectstatic->fetchComments(); } @@ -343,10 +344,44 @@ if (!empty($withproject)) { // Show message $message = 'global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...'); - $message .= "&project=".$projectstatic->id.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'">'.$langs->trans('DownloadICSLink').''; + $message .= "&project=".$projectstatic->id.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'">'.$langs->trans('DownloadICSLink').img_picto('', 'download', 'class="paddingleft"').''; print $message; print "
'; + //print ''; + print $form->textwithpicto($langs->trans("SuggestOrVoteForConfOrBooth"), $langs->trans("EvntOrgRegistrationHelpMessage")); + //print ''; + print ''; + $linksuggest = $dolibarr_main_url_root.'/public/project/index.php?id='.$projectstatic->id; + $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$projectstatic->id, 2); + $linksuggest .= '&securekey='.urlencode($encodedsecurekey); + //print ''; + //print ajax_autoselect("linkregister"); + print '
'; + //print ''; + print $langs->trans("PublicAttendeeSubscriptionGlobalPage"); + //print ''; + print ''; + $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_subscription.php?id='.$projectstatic->id.'&type=global'; + $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$projectstatic->id, 2); + $link_subscription .= '&securekey='.urlencode($encodedsecurekey); + //print ''; + //print ajax_autoselect("linkregister"); + print '
'; print ''; @@ -370,7 +405,10 @@ if ($action == 'create') { if ($confOrBooth->id > 0) { print ''; } - print ''; + if ($projectstatic->id > 0) { + print ''; + } + print ''; if ($backtopage) { @@ -382,9 +420,6 @@ if ($action == 'create') { print dol_get_fiche_head(array(), ''); - // Set some default values - //if (! GETPOSTISSET('fieldname')) $_POST['fieldname'] = 'myvalue'; - print ''."\n"; // Common attributes @@ -428,6 +463,9 @@ if (($id || $ref) && $action == 'edit') { if ($backtopageforcancel) { print ''; } + if ($projectstatic->id > 0) { + print ''; + } print dol_get_fiche_head(); @@ -477,16 +515,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Confirmation of action xxxx if ($action == 'xxx') { $formquestion = array(); - /* - $forcecombo=0; - if ($conf->browser->name == 'ie') $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy - $formquestion = array( - // 'text' => $langs->trans("ConfirmClone"), - // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), - // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), - // array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo)) - ); - */ $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220); } @@ -502,61 +530,22 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Print form confirm print $formconfirm; - // Object card // ------------------------------------------------------------ $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; - /* - // Ref customer - $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); - $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); - // Thirdparty - $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); - // Project - if (! empty($conf->projet->enabled)) { - $langs->load("projects"); - $morehtmlref .= '
'.$langs->trans('Project') . ' '; - if ($permissiontoadd) { - //if ($action != 'classify') $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' '; - $morehtmlref .= ' : '; - if ($action == 'classify') { - //$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $morehtmlref .= ''; - } else { - $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); - } - } else { - if (! empty($object->fk_project)) { - $proj = new Project($db); - $proj->fetch($object->fk_project); - $morehtmlref .= ': '.$proj->getNomUrl(); - } else { - $morehtmlref .= ''; - } - } - }*/ + $morehtmlref .= '
'; - dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); - print '
'; print '
'; print '
'; print '
'."\n"; // Common attributes - //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field - //unset($object->fields['fk_project']); // Hide field already shown in banner - //unset($object->fields['fk_soc']); // Hide field already shown in banner include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; // Other attributes. Fields from hook formObjectOptions and Extrafields. @@ -635,29 +624,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (empty($reshook)) { // Send if (empty($user->socid)) { - print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle'); + print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').'&action=presend&mode=init#formmailbeforetitle'); } - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&conforboothid='.$confOrBooth->id.'&action=edit', '', $permissiontoadd); + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').'&action=edit', '', $permissiontoadd); // Clone print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=scrumsprint', '', $permissiontoadd); - /* - if ($permissiontoadd) { - if ($object->status == $object::STATUS_ENABLED) { - print ''.$langs->trans("Disable").''."\n"; - } else { - print ''.$langs->trans("Enable").''."\n"; - } - } - if ($permissiontoadd) { - if ($object->status == $object::STATUS_VALIDATED) { - print ''.$langs->trans("Cancel").''."\n"; - } else { - print ''.$langs->trans("Re-Open").''."\n"; - } - } - */ // Delete (need delete permission, or if draft, just need create/modify permission) print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete', '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)); diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index d1dfccf2652..401f3367044 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -571,7 +571,7 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) { print dol_get_fiche_end(); - if (!empty($fk_project)) { + if (empty($confOrBooth->id)) { $head = conferenceorboothProjectPrepareHead($projectstatic); $tab = 'attendees'; print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, ($project->public ? 'projectpub' : 'project'), 0, '', ''); @@ -632,6 +632,9 @@ foreach ($search as $key => $val) { if ($confOrBooth->id > 0) { $param .= '&conforboothid='.urlencode($confOrBooth->id).$withProjectUrl; } +if ($projectstatic->id > 0) { + $param .= '&fk_project='.urlencode($projectstatic->id).$withProjectUrl; +} if ($optioncss != '') { $param .= '&optioncss='.urlencode($optioncss); @@ -841,7 +844,11 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if ($key == 'status') { print $object->getLibStatut(5); } elseif ($key == 'ref') { - print $object->getNomUrl(1, (!empty($withproject)?'conforboothidproject':'conforboothid')); + $optionLink = (!empty($withproject)?'conforboothidproject':'conforboothid'); + if (empty($confOrBooth->id)) { + $optionLink='projectid'; + } + print $object->getNomUrl(1, $optionLink); } else { print $object->showOutputField($val, $key, $object->$key, ''); } diff --git a/htdocs/public/eventorganization/attendee_subscription.php b/htdocs/public/eventorganization/attendee_subscription.php index 506b7215211..79688bffcf6 100644 --- a/htdocs/public/eventorganization/attendee_subscription.php +++ b/htdocs/public/eventorganization/attendee_subscription.php @@ -508,9 +508,7 @@ print '
'; dol_htmloutput_errors($errmsg); -if (!empty($conference->id) && $conference->status!=2 || !empty($project->id) && $project->status==Project::STATUS_VALIDATED) { - print $langs->trans("ConferenceIsNotConfirmed"); -} else { +if (!empty($conference->id) && $conference->status==ConferenceOrBooth::STATUS_CONFIRMED || (!empty($project->id) && $project->status==Project::STATUS_VALIDATED)) { // Print form print '' . "\n"; print ''; @@ -529,15 +527,15 @@ if (!empty($conference->id) && $conference->status!=2 || !empty($project->id) & print dol_get_fiche_head(''); print ''; + jQuery(document).ready(function () { + jQuery(document).ready(function () { + jQuery("#selectcountry_id").change(function() { + document.newmember.action.value="create"; + document.newmember.submit(); + }); + }); + }); + '; print '
' . "\n"; @@ -605,6 +603,8 @@ jQuery(document).ready(function () { print "\n"; print "
"; print ''; +} else { + print $langs->trans("ConferenceIsNotConfirmed"); } llxFooterVierge(); From fdce538380bdecd18a636029bc28899252bdd672 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 5 Sep 2021 14:31:33 +0200 Subject: [PATCH 0099/1460] Fix trans --- htdocs/langs/en_US/contracts.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/contracts.lang b/htdocs/langs/en_US/contracts.lang index 49a65fdb39d..937c5a7397b 100644 --- a/htdocs/langs/en_US/contracts.lang +++ b/htdocs/langs/en_US/contracts.lang @@ -36,7 +36,7 @@ CloseAContract=Close a contract ConfirmDeleteAContract=Are you sure you want to delete this contract and all its services? ConfirmValidateContract=Are you sure you want to validate this contract under name %s? ConfirmActivateAllOnContract=This will open all services (not yet active). Are you sure you want to open all services? -ConfirmCloseContract=This will close all services (active or not). Are you sure you want to close this contract? +ConfirmCloseContract=This will close all services (expired or not). Are you sure you want to close this contract? ConfirmCloseService=Are you sure you want to close this service with date %s? ValidateAContract=Validate a contract ActivateService=Activate service From 93fdf41521e3ee19bcf1de515e3ce7bdfa009c85 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Sep 2021 03:22:06 +0200 Subject: [PATCH 0100/1460] Fix css --- htdocs/salaries/paiement_salary.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/salaries/paiement_salary.php b/htdocs/salaries/paiement_salary.php index a266a2ed88b..749ce8f9575 100644 --- a/htdocs/salaries/paiement_salary.php +++ b/htdocs/salaries/paiement_salary.php @@ -315,8 +315,11 @@ if ($action == 'create') { print "
"; // Bouton Save payment - print '
'.$langs->trans("ClosePaidSalaryAutomatically"); - print '
'; + print '
'; + print '
'; + print '
'; + print '
'; + print ''; print '     '; print ''; print '
'; From 4bf2259fb681448d7e51238c99e73e4bcb844b24 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Sep 2021 03:26:43 +0200 Subject: [PATCH 0101/1460] Fix css --- htdocs/salaries/paiement_salary.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/salaries/paiement_salary.php b/htdocs/salaries/paiement_salary.php index 749ce8f9575..86a0e787e84 100644 --- a/htdocs/salaries/paiement_salary.php +++ b/htdocs/salaries/paiement_salary.php @@ -317,8 +317,7 @@ if ($action == 'create') { // Bouton Save payment print '
'; print '
'; - print '
'; - print '
'; + print '
'; print ''; print '     '; print ''; From ae7a309e8db94723efb22306fccafcc3aad13026 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Sep 2021 03:29:46 +0200 Subject: [PATCH 0102/1460] Fix css --- htdocs/compta/tva/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index daf5afb025e..2f3f4edf83c 100755 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -437,7 +437,7 @@ if ($action == 'create') { print '
'; // Auto create payment - print ''.$langs->trans('AutomaticCreationPayment').''; + print ''; print ''."\n"; print ''; From 09d1680ea072b4fef82bda3b9299b255f2ab2870 Mon Sep 17 00:00:00 2001 From: lainwir3d Date: Mon, 6 Sep 2021 12:07:48 +0400 Subject: [PATCH 0103/1460] FIX #18627 Allow users with self read / modify rights to get own info. --- htdocs/user/class/api_users.class.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index e0cbd849092..4059402a8fc 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -151,7 +151,8 @@ class Users extends DolibarrApi */ public function get($id, $includepermissions = 0) { - if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin)) { + if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin) && + !(!empty(DolibarrApiAccess::$user->rights->user->self->creer) && (DolibarrApiAccess::$user->id == $id))) { throw new RestException(401, 'Not allowed'); } @@ -189,7 +190,8 @@ class Users extends DolibarrApi */ public function getByLogin($login, $includepermissions = 0) { - if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin)) { + if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin) && + !(!empty(DolibarrApiAccess::$user->rights->user->self->creer) && (DolibarrApiAccess::$user->login == $login))) { throw new RestException(401, 'Not allowed'); } @@ -223,7 +225,8 @@ class Users extends DolibarrApi */ public function getByEmail($email, $includepermissions = 0) { - if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin)) { + if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin) && + !(!empty(DolibarrApiAccess::$user->rights->user->self->creer) && (DolibarrApiAccess::$user->email == $email))) { throw new RestException(401, 'Not allowed'); } @@ -256,7 +259,7 @@ class Users extends DolibarrApi */ public function getInfo($includepermissions = 0) { - if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin)) { + if(empty(DolibarrApiAccess::$user->rights->user->self->creer) && empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin)) { throw new RestException(401, 'Not allowed'); } From 9d89e48d154276396e0dcd1c217cfa59577ac7df Mon Sep 17 00:00:00 2001 From: Julien Gainza Date: Mon, 6 Sep 2021 15:55:33 +0200 Subject: [PATCH 0104/1460] Fix : Add extrafields on API "get events list" --- htdocs/comm/action/class/api_agendaevents.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/comm/action/class/api_agendaevents.class.php b/htdocs/comm/action/class/api_agendaevents.class.php index d9feb4472b6..bf35ed95be0 100644 --- a/htdocs/comm/action/class/api_agendaevents.class.php +++ b/htdocs/comm/action/class/api_agendaevents.class.php @@ -171,6 +171,7 @@ class AgendaEvents extends DolibarrApi $obj = $db->fetch_object($result); $actioncomm_static = new ActionComm($db); if ($actioncomm_static->fetch($obj->rowid)) { + $actioncomm_static->fetch_optionals(); $obj_ret[] = $this->_cleanObjectDatas($actioncomm_static); } $i++; From f535a44921fa703e888506b08620f2ff4e1fdc01 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 6 Sep 2021 13:58:23 +0000 Subject: [PATCH 0105/1460] Fixing style errors. --- htdocs/user/class/api_users.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index 4059402a8fc..f5e1159b6b6 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -259,7 +259,7 @@ class Users extends DolibarrApi */ public function getInfo($includepermissions = 0) { - if(empty(DolibarrApiAccess::$user->rights->user->self->creer) && empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin)) { + if (empty(DolibarrApiAccess::$user->rights->user->self->creer) && empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin)) { throw new RestException(401, 'Not allowed'); } From 7d8023fea74862012ab35d1e5e0486d1b3743f1e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 6 Sep 2021 16:21:30 +0200 Subject: [PATCH 0106/1460] FIX wrong table_element_line --- htdocs/core/ajax/row.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/ajax/row.php b/htdocs/core/ajax/row.php index 95518cbbf66..c55d80ee521 100644 --- a/htdocs/core/ajax/row.php +++ b/htdocs/core/ajax/row.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2010-2021 Regis Houssin * Copyright (C) 2017 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify @@ -79,7 +79,7 @@ if (GETPOST('roworder', 'alpha', 3) && GETPOST('table_element_line', 'aZ09', 3) $perm = 1; } elseif ($table_element_line == 'facturedet' && $user->rights->facture->creer) { $perm = 1; - } elseif ($table_element_line == 'facturerecdet' && $user->rights->facture->creer) { + } elseif ($table_element_line == 'facturedet_rec' && $user->rights->facture->creer) { $perm = 1; } elseif ($table_element_line == 'ecm_files' && $user->rights->ecm->creer) { $perm = 1; From 0d9280f94535352f146b7033a99c19f5a91a9a64 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Tue, 7 Sep 2021 10:39:41 +0200 Subject: [PATCH 0107/1460] Close #18607 : Implementation of salary button --- htdocs/langs/en_US/salaries.lang | 3 +- htdocs/langs/fr_FR/salaries.lang | 1 + htdocs/salaries/ajax/ajaxsalaries.php | 73 +++++++++++++++++++++++++++ htdocs/salaries/card.php | 42 ++++++++++++++- 4 files changed, 116 insertions(+), 3 deletions(-) create mode 100644 htdocs/salaries/ajax/ajaxsalaries.php diff --git a/htdocs/langs/en_US/salaries.lang b/htdocs/langs/en_US/salaries.lang index 504f0fbcc16..d4dc53f42ed 100644 --- a/htdocs/langs/en_US/salaries.lang +++ b/htdocs/langs/en_US/salaries.lang @@ -21,4 +21,5 @@ LastSalaries=Latest %s salaries AllSalaries=All salaries SalariesStatistics=Salary statistics SalariesAndPayments=Salaries and payments -ConfirmDeleteSalaryPayment=Do you want to delete this salary payment ? \ No newline at end of file +ConfirmDeleteSalaryPayment=Do you want to delete this salary payment ? +FillFieldFirst=Fill employee field first diff --git a/htdocs/langs/fr_FR/salaries.lang b/htdocs/langs/fr_FR/salaries.lang index cdabb1c9f35..0dcf1a6d869 100644 --- a/htdocs/langs/fr_FR/salaries.lang +++ b/htdocs/langs/fr_FR/salaries.lang @@ -22,3 +22,4 @@ AllSalaries=Tous les salaires SalariesStatistics=Statistiques SalariesAndPayments=Salaires et paiements ConfirmDeleteSalaryPayment=Voulez-vous supprimer ce paiement de salaire ? +FillFieldFirst=Remplisez d'abord le champ salarié diff --git a/htdocs/salaries/ajax/ajaxsalaries.php b/htdocs/salaries/ajax/ajaxsalaries.php new file mode 100644 index 00000000000..28605ea5d83 --- /dev/null +++ b/htdocs/salaries/ajax/ajaxsalaries.php @@ -0,0 +1,73 @@ + + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2007-2010 Laurent Destailleur + * Copyright (C) 2010 Cyrille de Lambert + * + * 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 . + */ + +/** + * \file htdocs/salaries/ajax/ajaxsalaries.php + * \brief File to return Ajax response on salary request + */ + +if (!defined('NOTOKENRENEWAL')) { + define('NOTOKENRENEWAL', 1); // Disables token renewal +} +if (!defined('NOREQUIREMENU')) { + define('NOREQUIREMENU', '1'); +} +if (!defined('NOREQUIREHTML')) { + define('NOREQUIREHTML', '1'); +} +if (!defined('NOREQUIREAJAX')) { + define('NOREQUIREAJAX', '1'); +} +if (!defined('NOREQUIRESOC')) { + define('NOREQUIRESOC', '1'); +} +if (!defined('NOCSRFCHECK')) { + define('NOCSRFCHECK', '1'); +} + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php'; + +restrictedArea($user, 'salaries'); + +$fk_user = GETPOST('fk_user', 'int'); +$return_arr = array(); +if (!empty(GETPOST('fk_user', 'int'))) { + $sql = "SELECT s.amount, s.rowid FROM ".MAIN_DB_PREFIX."salary as s"; + $sql .= " WHERE s.fk_user = ".$fk_user; + $sql .= " AND s.paye = 1"; + $sql .= $db->order("s.dateep", "DESC"); + + $resql = $db->query($sql); + if ($resql) { + $obj = $db->fetch_object($resql); + $label = "Salary amount"; + $row_array['label'] = $label; + $row_array['value'] = $obj->amount; + $row_array['key'] = "Amount"; + + array_push($return_arr, $row_array); + echo json_encode($return_arr); + } else { + echo json_encode(array('nom'=>'Error', 'label'=>'Error', 'key'=>'Error', 'value'=>'Error')); + } +} else { + echo json_encode(array('nom'=>'ErrorBadParameter', 'label'=>'ErrorBadParameter', 'key'=>'ErrorBadParameter', 'value'=>'ErrorBadParameter')); +} diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index ca111adf4d1..a404a7e9da1 100755 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -466,8 +466,10 @@ if ($action == 'create') { // Amount print ''; print $form->editfieldkey('Amount', 'amount', '', $object, 0, 'string', '', 1).''; - print ''; - print ''; + print ' '; + print ''; + print ''; } else { print ''; } @@ -345,23 +342,20 @@ print ''; + print ''; } else { $button = array_pop($action_buttons); print ''; @@ -375,23 +369,20 @@ print ''; + print ''; } else { $button = array_pop($action_buttons); print ''; From f3babd28194eb3563f43f685ad5caeeef7045cb2 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Tue, 7 Sep 2021 13:59:36 +0200 Subject: [PATCH 0112/1460] Fix #18633 : fix error message --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index d50b6991261..af3a1662ab6 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -598,3 +598,5 @@ create table llx_onlinesignature -- VMYSQL4.3 ALTER TABLE llx_partnership MODIFY COLUMN date_partnership_end date NULL; -- VPGSQL8.2 ALTER TABLE llx_partnership ALTER COLUMN date_partnership_end DROP NOT NULL; + +Alter TABLE llx_facture_fourn CHANGE fk_mode_transport fk_transport_mode integer From c8af143468460be7a252412a89b5ac282fd1d429 Mon Sep 17 00:00:00 2001 From: Laurent Dinclaux Date: Tue, 7 Sep 2021 23:27:31 +1100 Subject: [PATCH 0113/1460] Fix coding standards --- htdocs/takepos/index.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 61edb446963..415281af65d 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -978,36 +978,36 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) { query( $sql ); + $resql = $db->query($sql); $paiementsModes = array(); - if ( $resql ) { - while ( $obj = $db->fetch_object( $resql ) ) { + if ($resql) { + while ( $obj = $db->fetch_object($resql) ) { $paycode = $obj->code; - if ( $paycode == 'LIQ' ) { + if ($paycode == 'LIQ') { $paycode = 'CASH'; } - if ( $paycode == 'CHQ' ) { + if ($paycode == 'CHQ') { $paycode = 'CHEQUE'; } $constantforkey = "CASHDESK_ID_BANKACCOUNT_" . $paycode . $_SESSION["takeposterminal"]; //var_dump($constantforkey.' '.$conf->global->$constantforkey); - if ( ! empty( $conf->global->$constantforkey ) && $conf->global->$constantforkey > 0 ) { - array_push( $paiementsModes, $obj ); + if ( ! empty($conf->global->$constantforkey) && $conf->global->$constantforkey > 0) { + array_push($paiementsModes, $obj); } } } - if ( empty( $paiementsModes ) ) { - $langs->load( 'errors' ); - setEventMessages( $langs->trans( "ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv( "TakePOS" ) ), null, 'errors' ); - setEventMessages( $langs->trans( "ProblemIsInSetupOfTerminal", $_SESSION["takeposterminal"] ), null, 'errors' ); + if (empty($paiementsModes)) { + $langs->load('errors'); + setEventMessages($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("TakePOS")), null, 'errors'); + setEventMessages($langs->trans("ProblemIsInSetupOfTerminal", $_SESSION["takeposterminal"]), null, 'errors'); } } From 948d2bc4e99205191cc597c640e069a8b467117f Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Tue, 7 Sep 2021 14:43:37 +0200 Subject: [PATCH 0114/1460] FIX : Add token when remove the last widget on home page --- htdocs/core/class/html.formother.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 038f93d34c6..e81308faf79 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -1206,7 +1206,7 @@ class FormOther async: false }); // We force reload to be sure to get all boxes into list - window.location.search=\'mainmenu='.GETPOST("mainmenu", "aZ09").'&leftmenu='.GETPOST('leftmenu', "aZ09").'&action=delbox\'; + window.location.search=\'mainmenu='.GETPOST("mainmenu", "aZ09").'&leftmenu='.GETPOST('leftmenu', "aZ09").'&action=delbox&token='.newToken().'\'; } else { From e26e6288c208387639e739db618a2201b0476fd9 Mon Sep 17 00:00:00 2001 From: ksar <35605507+ksar-ksar@users.noreply.github.com> Date: Tue, 7 Sep 2021 15:22:02 +0200 Subject: [PATCH 0115/1460] FIX #18591 : Remove double quotes of SQL Queries FIX #18591 : Remove double quotes of SQL Queries for postgresql compatibility --- htdocs/core/class/dolreceiptprinter.class.php | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index 4dfca1186c0..ad2e7ed1181 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -386,9 +386,9 @@ class dolReceiptPrinter extends Printer { global $conf; $error = 0; - $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'printer_receipt'; - $sql .= ' (name, fk_type, fk_profile, parameter, entity)'; - $sql .= ' VALUES ("'.$this->db->escape($name).'", '.$type.', '.$profile.', "'.$this->db->escape($parameter).'", '.$conf->entity.')'; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."printer_receipt"; + $sql .= " (name, fk_type, fk_profile, parameter, entity)"; + $sql .= " VALUES ('".$this->db->escape($name)."', ".$type.", ".$profile.", '".$this->db->escape($parameter)."', ".$conf->entity.")"; $resql = $this->db->query($sql); if (!$resql) { $error++; @@ -411,12 +411,12 @@ class dolReceiptPrinter extends Printer { global $conf; $error = 0; - $sql = 'UPDATE '.MAIN_DB_PREFIX.'printer_receipt'; - $sql .= ' SET name="'.$this->db->escape($name).'"'; - $sql .= ', fk_type='.$type; - $sql .= ', fk_profile='.$profile; - $sql .= ', parameter="'.$this->db->escape($parameter).'"'; - $sql .= ' WHERE rowid='.$printerid; + $sql = "UPDATE ".MAIN_DB_PREFIX."printer_receipt"; + $sql .= " SET name='".$this->db->escape($name)."'"; + $sql .= ", fk_type=".$type; + $sql .= ", fk_profile=".$profile; + $sql .= ", parameter='".$this->db->escape($parameter)."'"; + $sql .= " WHERE rowid=".$printerid; $resql = $this->db->query($sql); if (!$resql) { $error++; @@ -456,9 +456,9 @@ class dolReceiptPrinter extends Printer { global $conf; $error = 0; - $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'printer_receipt_template'; - $sql .= ' (name, template, entity) VALUES ("'.$this->db->escape($name).'"'; - $sql .= ', "'.$this->db->escape($template).'", '.$conf->entity.')'; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."printer_receipt_template"; + $sql .= " (name, template, entity) VALUES ('".$this->db->escape($name)."'"; + $sql .= ", '".$this->db->escape($template)."', ".$conf->entity.")"; $resql = $this->db->query($sql); if (!$resql) { $error++; @@ -500,10 +500,10 @@ class dolReceiptPrinter extends Printer { global $conf; $error = 0; - $sql = 'UPDATE '.MAIN_DB_PREFIX.'printer_receipt_template'; - $sql .= ' SET name="'.$this->db->escape($name).'"'; - $sql .= ', template="'.$this->db->escape($template).'"'; - $sql .= ' WHERE rowid='.$templateid; + $sql = "UPDATE ".MAIN_DB_PREFIX."printer_receipt_template"; + $sql .= " SET name='".$this->db->escape($name)."'"; + $sql .= ", template='".$this->db->escape($template)."'"; + $sql .= " WHERE rowid=".$templateid; $resql = $this->db->query($sql); if (!$resql) { $error++; From 938092d67c80d01dbfd7d48d9624b438b29c1b79 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Tue, 7 Sep 2021 16:46:48 +0200 Subject: [PATCH 0116/1460] NEW : when we delete several objects with massaction, if somes object has child we must see which objects are concerned and nevertheless delete objects which can be deleted --- htdocs/core/actions_massactions.inc.php | 26 ++++++++++++++---------- htdocs/core/class/commonobject.class.php | 4 ++-- htdocs/langs/en_US/errors.lang | 2 +- htdocs/langs/fr_FR/errors.lang | 2 +- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 23851b5e789..eb3173e0cef 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1287,6 +1287,7 @@ if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == ' $objecttmp = new $objectclass($db); $nbok = 0; + $TMsg = array(); foreach ($toselect as $toselectid) { $result = $objecttmp->fetch($toselectid); if ($result > 0) { @@ -1315,9 +1316,9 @@ if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == ' } if ($result <= 0) { - setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); + + $TMsg = array_merge($objecttmp->errors, $TMsg); $error++; - break; } else { $nbok++; } @@ -1328,15 +1329,18 @@ if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == ' } } - if (!$error) { - if ($nbok > 1) { - setEventMessages($langs->trans("RecordsDeleted", $nbok), null, 'mesgs'); - } else { - setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); - } - $db->commit(); - } else { - $db->rollback(); + // Message for elements well deleted + if ($nbok > 1) { + setEventMessages($langs->trans("RecordsDeleted", $nbok), null, 'mesgs'); + } elseif(!empty($nbok)) { + setEventMessages($langs->trans("RecordsDeleted", '1'), null, 'mesgs'); + } + $db->commit(); + + // Message for elements which can't be deleted + if (!empty($error)) { + sort($TMsg); + setEventMessages('', array_unique($TMsg), 'errors'); } //var_dump($listofobjectthirdparties);exit; } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 5cdb83194f4..8d198578fe5 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4292,10 +4292,10 @@ abstract class CommonObject //print 'Found into table '.$table.', type '.$langs->transnoentitiesnoconv($elementname).', haschild='.$haschild; $haschild += $obj->nb; if (is_numeric($elementname)) { // old usage - $this->errors[] = $langs->trans("ErrorRecordHasAtLeastOneChildOfType", $table); + $this->errors[] = $langs->transnoentities("ErrorRecordHasAtLeastOneChildOfType", method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref, $table); } else // new usage: $elementname=Translation key { - $this->errors[] = $langs->trans("ErrorRecordHasAtLeastOneChildOfType", $langs->transnoentitiesnoconv($elementname)); + $this->errors[] = $langs->transnoentities("ErrorRecordHasAtLeastOneChildOfType", method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref, $langs->transnoentitiesnoconv($elementname)); } break; // We found at least one, we stop here } diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 89a3ec36af5..303df972340 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -83,7 +83,7 @@ ErrorCantSaveADoneUserWithZeroPercentage=Can't save an action with "status not s ErrorRefAlreadyExists=Ref used for creation already exists. ErrorPleaseTypeBankTransactionReportName=Please enter the bank statement name where the entry has to be reported (Format YYYYMM or YYYYMMDD) ErrorRecordHasChildren=Failed to delete record since it has some child records. -ErrorRecordHasAtLeastOneChildOfType=Object has at least one child of type %s +ErrorRecordHasAtLeastOneChildOfType=Object %s has at least one child of type %s ErrorRecordIsUsedCantDelete=Can't delete record. It is already used or included into another object. ErrorModuleRequireJavascript=Javascript must not be disabled to have this feature working. To enable/disable Javascript, go to menu Home->Setup->Display. ErrorPasswordsMustMatch=Both typed passwords must match each other diff --git a/htdocs/langs/fr_FR/errors.lang b/htdocs/langs/fr_FR/errors.lang index d7955df97e6..32090a13126 100644 --- a/htdocs/langs/fr_FR/errors.lang +++ b/htdocs/langs/fr_FR/errors.lang @@ -83,7 +83,7 @@ ErrorCantSaveADoneUserWithZeroPercentage=Impossible de sauver une action à l'é ErrorRefAlreadyExists=Le référence %s existe déjà. ErrorPleaseTypeBankTransactionReportName=Choisissez le nom du relevé bancaire sur lequel la ligne est rapportées (Format AAAAMM ou AAAAMMJJ) ErrorRecordHasChildren=Impossible de supprimer l'enregistrement car il possède des enregistrements fils. -ErrorRecordHasAtLeastOneChildOfType=L'objet a au moins un enfant de type %s +ErrorRecordHasAtLeastOneChildOfType=L'objet %s a au moins un enfant de type %s ErrorRecordIsUsedCantDelete=Ne peut effacer l'enregistrement. Ce dernier est déjà utilisé ou inclut dans un autre élément. ErrorModuleRequireJavascript=Le javascript ne doit pas être désactivé pour que cette fonctionnalité soit utilisable. Pour activer/désactiver l'utilisation de javascript, allez dans le menu Accueil->Configuration->Affichage. ErrorPasswordsMustMatch=Les 2 mots de passe saisis doivent correspondre From e94c560e829c60f3254e720675a160ce18bbcd5e Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 7 Sep 2021 14:55:49 +0000 Subject: [PATCH 0117/1460] Fixing style errors. --- htdocs/core/actions_massactions.inc.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index eb3173e0cef..87e3947c793 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1316,7 +1316,6 @@ if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == ' } if ($result <= 0) { - $TMsg = array_merge($objecttmp->errors, $TMsg); $error++; } else { @@ -1332,7 +1331,7 @@ if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == ' // Message for elements well deleted if ($nbok > 1) { setEventMessages($langs->trans("RecordsDeleted", $nbok), null, 'mesgs'); - } elseif(!empty($nbok)) { + } elseif (!empty($nbok)) { setEventMessages($langs->trans("RecordsDeleted", '1'), null, 'mesgs'); } $db->commit(); From 6c118b4dfbe2cc7a312486cdcbedd086adf28459 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 8 Sep 2021 04:31:38 +0200 Subject: [PATCH 0118/1460] css --- htdocs/accountancy/journal/expensereportsjournal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php index 9633157b5b7..96ab150dd24 100644 --- a/htdocs/accountancy/journal/expensereportsjournal.php +++ b/htdocs/accountancy/journal/expensereportsjournal.php @@ -610,7 +610,7 @@ if (empty($action) || $action == 'view') { $userstatic->id = $tabuser[$key]['id']; $userstatic->name = $tabuser[$key]['name']; print "".$userstatic->getNomUrl(0, 'user', 16).' - '.$accountingaccount->label.""; - print ''.($mt >= 0 ? price($mt) : '').""; + print ''.($mt >= 0 ? price($mt) : '').""; print ''.($mt < 0 ? price(-$mt) : '').""; print ""; } From 8c95ada9fddefd98c5713d5b61c93ddc7cd77823 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 8 Sep 2021 10:25:27 +0200 Subject: [PATCH 0119/1460] FIX wrong users count in multicompany transverse mode --- htdocs/user/class/user.class.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index df60c0f2fc9..05710ec2f88 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -3298,14 +3298,21 @@ class User extends CommonObject public function load_state_board() { // phpcs:enable + global $conf; $this->nb = array(); - $sql = "SELECT count(u.rowid) as nb"; + $sql = "SELECT DISTINCT count(u.rowid) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; - $sql .= " WHERE u.statut > 0"; + if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { + $sql .= ", ".MAIN_DB_PREFIX."usergroup_user as ug"; + $sql .= " WHERE ug.entity IN (".getEntity('usergroup').")"; + $sql .= " AND ug.fk_user = u.rowid "; + } else { + $sql .= " WHERE u.entity IN (".getEntity('user').")"; + } + $sql .= " AND u.statut > 0"; //$sql.= " AND employee != 0"; - $sql .= " AND u.entity IN (".getEntity('user').")"; $resql = $this->db->query($sql); if ($resql) { From a5e670291e8cedb47d0cb10e3c81841f41236b89 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Wed, 8 Sep 2021 15:36:51 +0200 Subject: [PATCH 0120/1460] Fix permission for salaries module --- htdocs/core/lib/security.lib.php | 2 +- htdocs/salaries/card.php | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index b297c81035e..4c36244a5bf 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -611,7 +611,7 @@ function checkUserAccessToObject($user, array $featuresarray, $objectid = 0, $ta $feature = 'projet_task'; } - $check = array('adherent', 'banque', 'bom', 'don', 'mrp', 'user', 'usergroup', 'payment', 'payment_supplier', 'product', 'produit', 'service', 'produit|service', 'categorie', 'resource', 'expensereport', 'holiday', 'salary', 'website'); // Test on entity only (Objects with no link to company) + $check = array('adherent', 'banque', 'bom', 'don', 'mrp', 'user', 'usergroup', 'payment', 'payment_supplier', 'product', 'produit', 'service', 'produit|service', 'categorie', 'resource', 'expensereport', 'holiday', 'salaries', 'website'); // Test on entity only (Objects with no link to company) $checksoc = array('societe'); // Test for societe object $checkother = array('contact', 'agenda'); // Test on entity + link to third party on field $dbt_keyfield. Allowed if link is empty (Ex: contacts...). $checkproject = array('projet', 'project'); // Test for project object diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index d3c7ba504cb..f83f879cf8e 100755 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -67,9 +67,27 @@ $fk_user = GETPOSTINT('userid'); $object = new Salary($db); $extrafields = new ExtraFields($db); +$childids = $user->getAllChildIds(1); + // fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); +if (($id > 0) || $ref) { + $object->fetch($id, $ref); + + // Check current user can read this leave request + $canread = 0; + if (!empty($user->rights->salaries->readall)) { + $canread = 1; + } + if (!empty($user->rights->salaries->read) && in_array($object->fk_user, $childids)) { + $canread = 1; + } + if (!$canread) { + accessforbidden(); + } +} + // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('salarycard', 'globalcard')); From e9505c1109934e62b34f52e404528056ce0cd9e7 Mon Sep 17 00:00:00 2001 From: MOREAU FRANCK Date: Wed, 8 Sep 2021 18:23:44 +0200 Subject: [PATCH 0121/1460] Update V14 --- htdocs/core/menus/standard/eldy.lib.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 75055329add..95af5973587 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -384,10 +384,16 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Tickets and knwoledge base $tmpentry = array( - 'enabled'=>(!empty($conf->ticket->enabled) || !empty($conf->knwoledgemanagement->enabled)), - 'perms'=>(!empty($user->rights->ticket->read) || !empty($user->rights->knwoledgemanagement->read)), - 'module'=>'ticket|knwoledgemanagement' + 'enabled'=>(!empty($conf->ticket->enabled) || !empty($conf->knowledgemanagement->enabled)), + 'perms'=>(!empty($user->rights->ticket->read) || !empty($user->rights->knowledgemanagement->knowledgerecord->read)), + 'module'=>'ticket|knowledgemanagement' ); + $link = ''; + if(!empty($conf->ticket->enabled)){ + $link = '/ticket/index.php?mainmenu=ticket&leftmenu='; + }else{ + $link = '/knowledgemanagement/knowledgerecord_list.php?mainmenu=ticket&leftmenu='; + } $menu_arr[] = array( 'name' => 'Ticket', 'link' => '/ticket/index.php?mainmenu=ticket&leftmenu=', From 04026dd0b06f330a903a76e45d86109b7d23bc99 Mon Sep 17 00:00:00 2001 From: MOREAU FRANCK Date: Wed, 8 Sep 2021 19:51:34 +0200 Subject: [PATCH 0122/1460] fix Stickler CI review --- htdocs/core/menus/standard/eldy.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 95af5973587..7c93cd94163 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -389,9 +389,9 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 'module'=>'ticket|knowledgemanagement' ); $link = ''; - if(!empty($conf->ticket->enabled)){ + if (!empty($conf->ticket->enabled)) { $link = '/ticket/index.php?mainmenu=ticket&leftmenu='; - }else{ + } else { $link = '/knowledgemanagement/knowledgerecord_list.php?mainmenu=ticket&leftmenu='; } $menu_arr[] = array( From ff74fbdf16cf0a3e37d904833f63ebbc8600c4c6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Sep 2021 02:37:47 +0200 Subject: [PATCH 0123/1460] Update card.php --- htdocs/comm/propal/card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 6fa4f60a01c..1ed4527fc1b 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1983,9 +1983,9 @@ if ($action == 'create') { } } } - if ($nbMandated > 0 ) $text .= '
'.$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'
'; - - + if ($nbMandated > 0) { + $text .= '
'.$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'
'; + } if (!$error) { $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateProp'), $text, 'confirm_validate', '', 0, 1); From b87ac639fd4ed060e73653f9123420cfa3354c8b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Sep 2021 03:02:18 +0200 Subject: [PATCH 0124/1460] Update card.php --- htdocs/salaries/card.php | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index f83f879cf8e..6d30ae73e3d 100755 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -72,28 +72,24 @@ $childids = $user->getAllChildIds(1); // fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); -if (($id > 0) || $ref) { - $object->fetch($id, $ref); - - // Check current user can read this leave request - $canread = 0; - if (!empty($user->rights->salaries->readall)) { - $canread = 1; - } - if (!empty($user->rights->salaries->read) && in_array($object->fk_user, $childids)) { - $canread = 1; - } - if (!$canread) { - accessforbidden(); - } -} - // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('salarycard', 'globalcard')); $object = new Salary($db); if ($id > 0 || !empty($ref)) { $object->fetch($id, $ref); + + // Check current user can read this salary + $canread = 0; + if (!empty($user->rights->salaries->readall)) { + $canread = 1; + } + if (!empty($user->rights->salaries->read) && $object->fk_user > 0 && in_array($object->fk_user, $childids)) { + $canread = 1; + } + if (!$canread) { + accessforbidden(); + } } // Security check From 61d5152209cea58b04ec724639616d7a3624d1bf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Sep 2021 03:23:04 +0200 Subject: [PATCH 0125/1460] Update eldy.lib.php --- htdocs/core/menus/standard/eldy.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 7c93cd94163..b1f625ac680 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -382,7 +382,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 'submenus' => array(), ); - // Tickets and knwoledge base + // Tickets and knowledge base $tmpentry = array( 'enabled'=>(!empty($conf->ticket->enabled) || !empty($conf->knowledgemanagement->enabled)), 'perms'=>(!empty($user->rights->ticket->read) || !empty($user->rights->knowledgemanagement->knowledgerecord->read)), From 77b8d91895a2019dc4783747cec7e75657b99363 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Sep 2021 04:56:25 +0200 Subject: [PATCH 0126/1460] Update 13.0.0-14.0.0.sql --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index af3a1662ab6..eff69ca5616 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -583,7 +583,7 @@ DROP TABLE llx_categorie_association; DROP TABLE llx_cond_reglement; DROP TABLE llx_zapier_hook_extrafields; -create table llx_onlinesignature +CREATE TABLE llx_onlinesignature ( rowid integer AUTO_INCREMENT PRIMARY KEY, entity integer DEFAULT 1 NOT NULL, @@ -599,4 +599,5 @@ create table llx_onlinesignature -- VMYSQL4.3 ALTER TABLE llx_partnership MODIFY COLUMN date_partnership_end date NULL; -- VPGSQL8.2 ALTER TABLE llx_partnership ALTER COLUMN date_partnership_end DROP NOT NULL; -Alter TABLE llx_facture_fourn CHANGE fk_mode_transport fk_transport_mode integer +ALTER TABLE llx_facture_fourn CHANGE COLUMN fk_mode_transport fk_transport_mode integer; + From ea9a07fb3daa000a536c80d68fc246294b7272c2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Sep 2021 05:11:31 +0200 Subject: [PATCH 0127/1460] Update dolibarr.php --- htdocs/admin/system/dolibarr.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index a39d4dc2a8c..ace35668e5f 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -505,7 +505,7 @@ if ($resql) { $obj = $db->fetch_object($resql); print ''; - print ''.$obj->name.''."\n"; + print ''.dol_escape_htmltag($obj->name).''."\n"; print ''; if (isASecretKey($obj->name)) { if (empty($dolibarr_main_prod)) { From de97b248f2ddff50ddce7da7b0af8deaa3ad5466 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Sep 2021 05:11:56 +0200 Subject: [PATCH 0128/1460] Update dolibarr.php --- htdocs/admin/system/dolibarr.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index ace35668e5f..90e35c8e970 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -505,7 +505,7 @@ if ($resql) { $obj = $db->fetch_object($resql); print ''; - print ''.dol_escape_htmltag($obj->name).''."\n"; + print ''.dol_escape_htmltag($obj->name).''."\n"; print ''; if (isASecretKey($obj->name)) { if (empty($dolibarr_main_prod)) { From 303b0e7f311370dc47e58d07c41a85380428c0ce Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 9 Sep 2021 09:21:30 +0200 Subject: [PATCH 0129/1460] FIX better sql request --- htdocs/user/class/user.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 05710ec2f88..81a408d6212 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -3302,7 +3302,7 @@ class User extends CommonObject $this->nb = array(); - $sql = "SELECT DISTINCT count(u.rowid) as nb"; + $sql = "SELECT COUNT(DISTINCT u.rowid) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { $sql .= ", ".MAIN_DB_PREFIX."usergroup_user as ug"; From 91e624fd5d6b62d868d9ec29b69cdc5c8108bad1 Mon Sep 17 00:00:00 2001 From: jpb Date: Thu, 9 Sep 2021 10:14:39 +0200 Subject: [PATCH 0130/1460] change test --- htdocs/core/tpl/objectline_view.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index e732d271a48..41c9b198c1a 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -185,7 +185,7 @@ if (($line->info_bits & 2) == 2) { if (!$line->date_start || !$line->date_end) { // show warning under line // we need to fetch product associated to line for some test - if ($object->element != 'order_supplier') { + if ($object->element == 'propal' || $object->element == 'order' || $object->element == 'propal_supplier' || $object->element == 'supplier_proposal' || $object->element == 'commande') { $res = $line->fetch_product(); if ($res > 0 ) { if ($line->product->isService() && $line->product->isMandatoryPeriod()) { From dd7f6b6a5cd6f08224ef93646632480c8890490b Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 9 Sep 2021 08:17:52 +0000 Subject: [PATCH 0131/1460] Fixing style errors. --- htdocs/core/tpl/objectline_view.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 41c9b198c1a..d9b36253d85 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -185,7 +185,7 @@ if (($line->info_bits & 2) == 2) { if (!$line->date_start || !$line->date_end) { // show warning under line // we need to fetch product associated to line for some test - if ($object->element == 'propal' || $object->element == 'order' || $object->element == 'propal_supplier' || $object->element == 'supplier_proposal' || $object->element == 'commande') { + if ($object->element == 'propal' || $object->element == 'order' || $object->element == 'propal_supplier' || $object->element == 'supplier_proposal' || $object->element == 'commande') { $res = $line->fetch_product(); if ($res > 0 ) { if ($line->product->isService() && $line->product->isMandatoryPeriod()) { From 24117851cc2b8692f71af19cd309a1e01e7ef2a1 Mon Sep 17 00:00:00 2001 From: atm-gregr Date: Thu, 2 Sep 2021 15:45:10 +0200 Subject: [PATCH 0132/1460] NEW : massaction validate on supplier orders --- htdocs/fourn/commande/list.php | 433 +++++++++++++++++++-------------- htdocs/langs/en_US/orders.lang | 2 + 2 files changed, 250 insertions(+), 185 deletions(-) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index bd5ed15fdad..40a71888f40 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -87,7 +87,6 @@ $search_btn = GETPOST('button_search', 'alpha'); $search_remove_btn = GETPOST('button_removefilter', 'alpha'); $status = GETPOST('statut', 'alpha'); -$search_status = GETPOST('search_status'); // Security check $orderid = GETPOST('orderid', 'int'); @@ -107,7 +106,7 @@ $pagenext = $page + 1; if (!$sortfield) $sortfield = 'cf.ref'; if (!$sortorder) $sortorder = 'DESC'; -if ($search_status == '') $search_status = -1; +if ($search_status == '') $search_status = -5; // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $object = new CommandeFournisseur($db); @@ -202,7 +201,7 @@ if (empty($reshook)) $search_total_vat = ''; $search_total_ttc = ''; $search_project_ref = ''; - $search_status = -1; + $search_status = ''; $search_orderyear = ''; $search_ordermonth = ''; $search_orderday = ''; @@ -225,224 +224,268 @@ if (empty($reshook)) $objectlabel = 'SupplierOrders'; $permissiontoread = $user->rights->fournisseur->commande->lire; $permissiontodelete = $user->rights->fournisseur->commande->supprimer; + $permissiontovalidate = $user->rights->fournisseur->commande->creer; $uploaddir = $conf->fournisseur->commande->dir_output; + include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; - - // TODO Move this into mass action include - if ($massaction == 'confirm_createbills') +} +if ($action == 'validate' && $permissiontovalidate) +{ + if (GETPOST('confirm') == 'yes') { - $orders = GETPOST('toselect', 'array'); - $createbills_onebythird = GETPOST('createbills_onebythird', 'int'); - $validate_invoices = GETPOST('validate_invoices', 'int'); - - $TFact = array(); - $TFactThird = array(); - - $nb_bills_created = 0; - + $objecttmp = new CommandeFournisseur($db); $db->begin(); + $error = 0; - foreach ($orders as $id_order) { - $cmd = new Commande($db); - if ($cmd->fetch($id_order) <= 0) continue; - - $object = new Facture($db); - if (!empty($createbills_onebythird) && !empty($TFactThird[$cmd->socid])) $object = $TFactThird[$cmd->socid]; // If option "one bill per third" is set, we use already created order. - else { - $object->socid = $cmd->socid; - $object->type = Facture::TYPE_STANDARD; - $object->cond_reglement_id = $cmd->cond_reglement_id; - $object->mode_reglement_id = $cmd->mode_reglement_id; - $object->fk_project = $cmd->fk_project; - - $datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); - if (empty($datefacture)) + foreach ($toselect as $checked) + { + if ($objecttmp->fetch($checked)) + { + if ($objecttmp->statut == 0) { - $datefacture = dol_mktime(date("h"), date("M"), 0, date("m"), date("d"), date("Y")); + $objecttmp->date_commande = dol_now(); + $result = $objecttmp->valid($user); + if ($result >= 0) + { + // If we have permission, and if we don't need to provide the idwarehouse, we go directly on approved step + if (empty($conf->global->SUPPLIER_ORDER_NO_DIRECT_APPROVE) && $user->rights->fournisseur->commande->approuver && !(!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $objecttmp->hasProductsOrServices(1))) + { + $result = $objecttmp->approve($user); + setEventMessages($langs->trans("SupplierOrderValidatedAndApproved"), array($objecttmp->ref)); + } else { + setEventMessages($langs->trans("SupplierOrderValidated"), array($objecttmp->ref)); + } + } + else + { + setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); + $error++; + } } + } + } - $object->date = $datefacture; - $object->origin = 'commande'; - $object->origin_id = $id_order; + if (!$error) $db->commit(); + else $db->rollback(); + } +} - $res = $object->create($user); - if ($res > 0) $nb_bills_created++; +// TODO Move this into mass action include +if ($massaction == 'confirm_createbills') +{ + $orders = GETPOST('toselect', 'array'); + $createbills_onebythird = GETPOST('createbills_onebythird', 'int'); + $validate_invoices = GETPOST('validate_invoices', 'int'); + + $TFact = array(); + $TFactThird = array(); + + $nb_bills_created = 0; + + $db->begin(); + + foreach ($orders as $id_order) { + $cmd = new Commande($db); + if ($cmd->fetch($id_order) <= 0) continue; + + $object = new Facture($db); + if (!empty($createbills_onebythird) && !empty($TFactThird[$cmd->socid])) $object = $TFactThird[$cmd->socid]; // If option "one bill per third" is set, we use already created order. + else { + $object->socid = $cmd->socid; + $object->type = Facture::TYPE_STANDARD; + $object->cond_reglement_id = $cmd->cond_reglement_id; + $object->mode_reglement_id = $cmd->mode_reglement_id; + $object->fk_project = $cmd->fk_project; + + $datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); + if (empty($datefacture)) + { + $datefacture = dol_mktime(date("h"), date("M"), 0, date("m"), date("d"), date("Y")); } - if ($object->id > 0) - { - $sql = "INSERT INTO ".MAIN_DB_PREFIX."element_element ("; - $sql .= "fk_source"; - $sql .= ", sourcetype"; - $sql .= ", fk_target"; - $sql .= ", targettype"; - $sql .= ") VALUES ("; - $sql .= $id_order; - $sql .= ", '".$object->origin."'"; - $sql .= ", ".$object->id; - $sql .= ", '".$object->element."'"; - $sql .= ")"; + $object->date = $datefacture; + $object->origin = 'commande'; + $object->origin_id = $id_order; - if (!$db->query($sql)) + $res = $object->create($user); + + if ($res > 0) $nb_bills_created++; + } + + if ($object->id > 0) + { + $sql = "INSERT INTO ".MAIN_DB_PREFIX."element_element ("; + $sql .= "fk_source"; + $sql .= ", sourcetype"; + $sql .= ", fk_target"; + $sql .= ", targettype"; + $sql .= ") VALUES ("; + $sql .= $id_order; + $sql .= ", '".$object->origin."'"; + $sql .= ", ".$object->id; + $sql .= ", '".$object->element."'"; + $sql .= ")"; + + if (!$db->query($sql)) + { + $erorr++; + } + + if (!$error) + { + $lines = $cmd->lines; + if (empty($lines) && method_exists($cmd, 'fetch_lines')) { - $erorr++; + $cmd->fetch_lines(); + $lines = $cmd->lines; } - if (!$error) + $fk_parent_line = 0; + $num = count($lines); + + for ($i = 0; $i < $num; $i++) { - $lines = $cmd->lines; - if (empty($lines) && method_exists($cmd, 'fetch_lines')) + $desc = ($lines[$i]->desc ? $lines[$i]->desc : $lines[$i]->libelle); + if ($lines[$i]->subprice < 0) { - $cmd->fetch_lines(); - $lines = $cmd->lines; - } - - $fk_parent_line = 0; - $num = count($lines); - - for ($i = 0; $i < $num; $i++) - { - $desc = ($lines[$i]->desc ? $lines[$i]->desc : $lines[$i]->libelle); - if ($lines[$i]->subprice < 0) + // Negative line, we create a discount line + $discount = new DiscountAbsolute($db); + $discount->fk_soc = $object->socid; + $discount->amount_ht = abs($lines[$i]->total_ht); + $discount->amount_tva = abs($lines[$i]->total_tva); + $discount->amount_ttc = abs($lines[$i]->total_ttc); + $discount->tva_tx = $lines[$i]->tva_tx; + $discount->fk_user = $user->id; + $discount->description = $desc; + $discountid = $discount->create($user); + if ($discountid > 0) { - // Negative line, we create a discount line - $discount = new DiscountAbsolute($db); - $discount->fk_soc = $object->socid; - $discount->amount_ht = abs($lines[$i]->total_ht); - $discount->amount_tva = abs($lines[$i]->total_tva); - $discount->amount_ttc = abs($lines[$i]->total_ttc); - $discount->tva_tx = $lines[$i]->tva_tx; - $discount->fk_user = $user->id; - $discount->description = $desc; - $discountid = $discount->create($user); - if ($discountid > 0) - { - $result = $object->insert_discount($discountid); - //$result=$discount->link_to_invoice($lineid,$id); - } - else - { - setEventMessages($discount->error, $discount->errors, 'errors'); - $error++; - break; - } + $result = $object->insert_discount($discountid); + //$result=$discount->link_to_invoice($lineid,$id); } else { - // Positive line - $product_type = ($lines[$i]->product_type ? $lines[$i]->product_type : 0); - // Date start - $date_start = false; - if ($lines[$i]->date_debut_prevue) $date_start = $lines[$i]->date_debut_prevue; - if ($lines[$i]->date_debut_reel) $date_start = $lines[$i]->date_debut_reel; - if ($lines[$i]->date_start) $date_start = $lines[$i]->date_start; - //Date end - $date_end = false; - if ($lines[$i]->date_fin_prevue) $date_end = $lines[$i]->date_fin_prevue; - if ($lines[$i]->date_fin_reel) $date_end = $lines[$i]->date_fin_reel; - if ($lines[$i]->date_end) $date_end = $lines[$i]->date_end; - // Reset fk_parent_line for no child products and special product - if (($lines[$i]->product_type != 9 && empty($lines[$i]->fk_parent_line)) || $lines[$i]->product_type == 9) - { - $fk_parent_line = 0; - } - $result = $object->addline( - $desc, - $lines[$i]->subprice, - $lines[$i]->qty, - $lines[$i]->tva_tx, - $lines[$i]->localtax1_tx, - $lines[$i]->localtax2_tx, - $lines[$i]->fk_product, - $lines[$i]->remise_percent, - $date_start, - $date_end, - 0, - $lines[$i]->info_bits, - $lines[$i]->fk_remise_except, - 'HT', - 0, - $product_type, - $ii, - $lines[$i]->special_code, - $object->origin, - $lines[$i]->rowid, - $fk_parent_line, - $lines[$i]->fk_fournprice, - $lines[$i]->pa_ht, - $lines[$i]->label - ); - if ($result > 0) - { - $lineid = $result; - } - else - { - $lineid = 0; - $error++; - break; - } - // Defined the new fk_parent_line - if ($result > 0 && $lines[$i]->product_type == 9) - { - $fk_parent_line = $result; - } + setEventMessages($discount->error, $discount->errors, 'errors'); + $error++; + break; + } + } + else + { + // Positive line + $product_type = ($lines[$i]->product_type ? $lines[$i]->product_type : 0); + // Date start + $date_start = false; + if ($lines[$i]->date_debut_prevue) $date_start = $lines[$i]->date_debut_prevue; + if ($lines[$i]->date_debut_reel) $date_start = $lines[$i]->date_debut_reel; + if ($lines[$i]->date_start) $date_start = $lines[$i]->date_start; + //Date end + $date_end = false; + if ($lines[$i]->date_fin_prevue) $date_end = $lines[$i]->date_fin_prevue; + if ($lines[$i]->date_fin_reel) $date_end = $lines[$i]->date_fin_reel; + if ($lines[$i]->date_end) $date_end = $lines[$i]->date_end; + // Reset fk_parent_line for no child products and special product + if (($lines[$i]->product_type != 9 && empty($lines[$i]->fk_parent_line)) || $lines[$i]->product_type == 9) + { + $fk_parent_line = 0; + } + $result = $object->addline( + $desc, + $lines[$i]->subprice, + $lines[$i]->qty, + $lines[$i]->tva_tx, + $lines[$i]->localtax1_tx, + $lines[$i]->localtax2_tx, + $lines[$i]->fk_product, + $lines[$i]->remise_percent, + $date_start, + $date_end, + 0, + $lines[$i]->info_bits, + $lines[$i]->fk_remise_except, + 'HT', + 0, + $product_type, + $ii, + $lines[$i]->special_code, + $object->origin, + $lines[$i]->rowid, + $fk_parent_line, + $lines[$i]->fk_fournprice, + $lines[$i]->pa_ht, + $lines[$i]->label + ); + if ($result > 0) + { + $lineid = $result; + } + else + { + $lineid = 0; + $error++; + break; + } + // Defined the new fk_parent_line + if ($result > 0 && $lines[$i]->product_type == 9) + { + $fk_parent_line = $result; } } } } - - $cmd->classifyBilled($user); // TODO Move this in workflow like done for customer orders - - if (!empty($createbills_onebythird) && empty($TFactThird[$cmd->socid])) $TFactThird[$cmd->socid] = $object; - else $TFact[$object->id] = $object; } - // Build doc with all invoices - $TAllFact = empty($createbills_onebythird) ? $TFact : $TFactThird; - $toselect = array(); + $cmd->classifyBilled($user); // TODO Move this in workflow like done for customer orders - if (!$error && $validate_invoices) { - $massaction = $action = 'builddoc'; + if (!empty($createbills_onebythird) && empty($TFactThird[$cmd->socid])) $TFactThird[$cmd->socid] = $object; + else $TFact[$object->id] = $object; + } - foreach ($TAllFact as &$object) + // Build doc with all invoices + $TAllFact = empty($createbills_onebythird) ? $TFact : $TFactThird; + $toselect = array(); + + if (!$error && $validate_invoices) { + $massaction = $action = 'builddoc'; + + foreach ($TAllFact as &$object) + { + $object->validate($user); + if ($result <= 0) { - $object->validate($user); - if ($result <= 0) - { - $error++; - setEventMessages($object->error, $object->errors, 'errors'); - break; - } - - $id = $object->id; // For builddoc action - - // Fac builddoc - $donotredirect = 1; - $upload_dir = $conf->facture->dir_output; - $permissiontoadd=$user->rights->facture->creer; - include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; + $error++; + setEventMessages($object->error, $object->errors, 'errors'); + break; } - $massaction = $action = 'confirm_createbills'; + $id = $object->id; // For builddoc action + + // Fac builddoc + $donotredirect = 1; + $upload_dir = $conf->facture->dir_output; + $permissiontoadd=$user->rights->facture->creer; + include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; } - if (! $error) - { - $db->commit(); - setEventMessages($langs->trans('BillCreated', $nb_bills_created), null, 'mesgs'); - } - else - { - $db->rollback(); - $action = 'create'; - $_GET["origin"] = $_POST["origin"]; - $_GET["originid"] = $_POST["originid"]; - setEventMessages($object->error, $object->errors, 'errors'); - $error++; - } + $massaction = $action = 'confirm_createbills'; } + + if (! $error) + { + $db->commit(); + setEventMessages($langs->trans('BillCreated', $nb_bills_created), null, 'mesgs'); + } + else + { + $db->rollback(); + $action = 'create'; + $_GET["origin"] = $_POST["origin"]; + $_GET["originid"] = $_POST["originid"]; + setEventMessages($object->error, $object->errors, 'errors'); + $error++; + } + } @@ -514,6 +557,9 @@ if ($search_user > 0) $sql .= ", ".MAIN_DB_PREFIX."element_contact as ec"; $sql .= ", ".MAIN_DB_PREFIX."c_type_contact as tc"; } +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; $sql .= ' WHERE cf.fk_soc = s.rowid'; $sql .= ' AND cf.entity IN ('.getEntity('supplier_order').')'; if ($socid > 0) $sql .= " AND s.rowid = ".$socid; @@ -524,6 +570,7 @@ if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall); if ($search_company) $sql .= natural_search('s.nom', $search_company); if ($search_request_author) $sql .= natural_search(array('u.lastname', 'u.firstname', 'u.login'), $search_request_author); if ($search_billed != '' && $search_billed >= 0) $sql .= " AND cf.billed = ".$db->escape($search_billed); + if ($search_product_category > 0) $sql .= " AND cp.fk_categorie = ".$search_product_category; //Required triple check because statut=0 means draft filter if (GETPOST('statut', 'intcomma') !== '') @@ -628,6 +675,17 @@ if ($resql) 'builddoc'=>$langs->trans("PDFMerge"), 'presend'=>$langs->trans("SendByMail"), ); + if ($permissiontovalidate) { + if ($user->rights->fournisseur->commande->approuver && empty($conf->global->SUPPLIER_ORDER_NO_DIRECT_APPROVE)) + { + $arrayofmassactions['prevalidate'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("ValidateAndApprove"); + } + else + { + $arrayofmassactions['prevalidate'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"); + } + } + //if($user->rights->fournisseur->facture->creer) $arrayofmassactions['createbills']=$langs->trans("CreateInvoiceForThisCustomer"); if ($user->rights->fournisseur->commande->supprimer) $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); if (in_array($massaction, array('presend', 'predelete', 'createbills'))) $arrayofmassactions = array(); @@ -658,6 +716,10 @@ if ($resql) $trackid = 'sord'.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; + if ($massaction == 'prevalidate') { + print $form->formconfirm($_SERVER["PHP_SELF"].$fieldstosearchall, $langs->trans("ConfirmMassValidation"), $langs->trans("ConfirmMassValidationQuestion"), "validate", null, '', 0, 200, 500, 1); + } + if ($massaction == 'createbills') { //var_dump($_REQUEST); @@ -870,6 +932,7 @@ if ($resql) $formorder->selectSupplierOrderStatus((strstr($search_status, ',') ?-1 : $search_status), 1, 'search_status'); print ''; } + // Status billed if (!empty($arrayfields['cf.billed']['checked'])) { diff --git a/htdocs/langs/en_US/orders.lang b/htdocs/langs/en_US/orders.lang index 558076ba11d..f3dde5c6f98 100644 --- a/htdocs/langs/en_US/orders.lang +++ b/htdocs/langs/en_US/orders.lang @@ -120,6 +120,8 @@ SupplierOrderReceivedInDolibarr=Purchase Order %s received %s SupplierOrderSubmitedInDolibarr=Purchase Order %s submitted SupplierOrderClassifiedBilled=Purchase Order %s set billed OtherOrders=Other orders +SupplierOrderValidatedAndApproved=Supplier order is validated and approved : %s +SupplierOrderValidated=Supplier order is validated : %s ##### Types de contacts ##### TypeContact_commande_internal_SALESREPFOLL=Representative following-up sales order TypeContact_commande_internal_SHIPPING=Representative following-up shipping From 3da71418ac260443831995a255b3163429410b12 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 9 Sep 2021 08:52:26 +0000 Subject: [PATCH 0133/1460] Fixing style errors. --- htdocs/fourn/commande/list.php | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 77c0533a34b..72fc3051553 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -281,35 +281,26 @@ if (empty($reshook)) { $uploaddir = $conf->fournisseur->commande->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; - if ($action == 'validate' && $permissiontovalidate) - { - if (GETPOST('confirm') == 'yes') - { + if ($action == 'validate' && $permissiontovalidate) { + if (GETPOST('confirm') == 'yes') { $objecttmp = new CommandeFournisseur($db); $db->begin(); $error = 0; - foreach ($toselect as $checked) - { - if ($objecttmp->fetch($checked)) - { - if ($objecttmp->statut == 0) - { + foreach ($toselect as $checked) { + if ($objecttmp->fetch($checked)) { + if ($objecttmp->statut == 0) { $objecttmp->date_commande = dol_now(); $result = $objecttmp->valid($user); - if ($result >= 0) - { + if ($result >= 0) { // If we have permission, and if we don't need to provide the idwarehouse, we go directly on approved step - if (empty($conf->global->SUPPLIER_ORDER_NO_DIRECT_APPROVE) && $user->rights->fournisseur->commande->approuver && !(!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $objecttmp->hasProductsOrServices(1))) - { + if (empty($conf->global->SUPPLIER_ORDER_NO_DIRECT_APPROVE) && $user->rights->fournisseur->commande->approuver && !(!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $objecttmp->hasProductsOrServices(1))) { $result = $objecttmp->approve($user); setEventMessages($langs->trans("SupplierOrderValidatedAndApproved"), array($objecttmp->ref)); } else { setEventMessages($langs->trans("SupplierOrderValidated"), array($objecttmp->ref)); } - } - else - { + } else { setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); $error++; } @@ -991,12 +982,9 @@ if ($resql) { ); if ($permissiontovalidate) { - if ($user->rights->fournisseur->commande->approuver && empty($conf->global->SUPPLIER_ORDER_NO_DIRECT_APPROVE)) - { + if ($user->rights->fournisseur->commande->approuver && empty($conf->global->SUPPLIER_ORDER_NO_DIRECT_APPROVE)) { $arrayofmassactions['prevalidate'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("ValidateAndApprove"); - } - else - { + } else { $arrayofmassactions['prevalidate'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"); } } From d451703bbf5b0769ff0ec92857a3c3fcd438fee0 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Thu, 9 Sep 2021 11:21:34 +0200 Subject: [PATCH 0134/1460] Fix : reception list sql error --- htdocs/reception/list.php | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index e4b519517ea..5b4bdf6bb6f 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -85,7 +85,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); -$search_array_options = (array) $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); +$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); // List of fields to search into when doing a "search in all" $fieldstosearchall = array( @@ -537,21 +537,7 @@ if ($sall) { } // Add where from extra fields -foreach ($search_array_options as $key => $val) { - $crit = $val; - $tmpkey = preg_replace('/search_options_/', '', $key); - $typ = $extrafields->attributes[$object->table_element]['type'][$tmpkey]; - $mode = 0; - if (in_array($typ, array('int', 'double', 'real'))) { - $mode = 1; // Search on a numeric - } - if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') { - $mode = 2; // Search on a foreign key int - } - if ($crit != '' && (!in_array($typ, array('select', 'sellist')) || $crit != '0')) { - $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); - } -} +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook From 4e78a24a133546ef052b8e1bebba0e4e22cdd8b0 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Thu, 9 Sep 2021 11:25:46 +0200 Subject: [PATCH 0135/1460] FIX : if delete return < 0, we break and rollback, if == 0, we set event message warning and we test other objects of list --- htdocs/core/actions_massactions.inc.php | 35 ++++++++++++++++--------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index eb3173e0cef..8ca41166759 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1315,10 +1315,12 @@ if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == ' $result = $objecttmp->delete($user); } - if ($result <= 0) { - + if(empty($result)) { // if delete returns 0, there is at least one object linked $TMsg = array_merge($objecttmp->errors, $TMsg); + } elseif ($result < 0) { // if delete returns is < 0, there is an error, we break and rollback later + setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); $error++; + break; } else { $nbok++; } @@ -1329,19 +1331,26 @@ if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == ' } } - // Message for elements well deleted - if ($nbok > 1) { - setEventMessages($langs->trans("RecordsDeleted", $nbok), null, 'mesgs'); - } elseif(!empty($nbok)) { - setEventMessages($langs->trans("RecordsDeleted", '1'), null, 'mesgs'); - } - $db->commit(); + if (empty($error)) { + // Message for elements well deleted + if ($nbok > 1) { + setEventMessages($langs->trans("RecordsDeleted", $nbok), null, 'mesgs'); + } elseif (!empty($nbok)) { + setEventMessages($langs->trans("RecordsDeleted", '1'), null, 'mesgs'); + } - // Message for elements which can't be deleted - if (!empty($error)) { - sort($TMsg); - setEventMessages('', array_unique($TMsg), 'errors'); + // Message for elements which can't be deleted + if (!empty($TMsg)) { + sort($TMsg); + setEventMessages('', array_unique($TMsg), 'warnings'); + } + + $db->commit(); + + } else { + $db->rollback(); } + //var_dump($listofobjectthirdparties);exit; } From 1e8870eb95fe295c9d53e21cba93c2e924ecdf9c Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 9 Sep 2021 09:30:29 +0000 Subject: [PATCH 0136/1460] Fixing style errors. --- htdocs/core/actions_massactions.inc.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 8ca41166759..be7528b2a4e 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1315,7 +1315,7 @@ if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == ' $result = $objecttmp->delete($user); } - if(empty($result)) { // if delete returns 0, there is at least one object linked + if (empty($result)) { // if delete returns 0, there is at least one object linked $TMsg = array_merge($objecttmp->errors, $TMsg); } elseif ($result < 0) { // if delete returns is < 0, there is an error, we break and rollback later setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); @@ -1346,7 +1346,6 @@ if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == ' } $db->commit(); - } else { $db->rollback(); } From 022f3e640d764e37b2f0533f1e099956d1df6652 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Thu, 9 Sep 2021 13:28:30 +0200 Subject: [PATCH 0137/1460] Fix #18660 : fix rights of supplier order with API --- htdocs/fourn/class/api_supplier_orders.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/class/api_supplier_orders.class.php b/htdocs/fourn/class/api_supplier_orders.class.php index d4eedcd0fd9..b02de6629e9 100644 --- a/htdocs/fourn/class/api_supplier_orders.class.php +++ b/htdocs/fourn/class/api_supplier_orders.class.php @@ -224,7 +224,7 @@ class SupplierOrders extends DolibarrApi */ public function post($request_data = null) { - if (!DolibarrApiAccess::$user->rights->fournisseur->commande->creer || !DolibarrApiAccess::$user->rights->supplier_order->creer) { + if (!DolibarrApiAccess::$user->rights->fournisseur->commande->creer) { throw new RestException(401, "Insuffisant rights"); } // Check mandatory fields @@ -260,7 +260,7 @@ class SupplierOrders extends DolibarrApi */ public function put($id, $request_data = null) { - if (!DolibarrApiAccess::$user->rights->fournisseur->commande->creer || !DolibarrApiAccess::$user->rights->supplier_order->creer) { + if (!DolibarrApiAccess::$user->rights->fournisseur->commande->creer) { throw new RestException(401); } @@ -340,7 +340,7 @@ class SupplierOrders extends DolibarrApi */ public function validate($id, $idwarehouse = 0, $notrigger = 0) { - if (!DolibarrApiAccess::$user->rights->fournisseur->commande->creer || !DolibarrApiAccess::$user->rights->supplier_order->creer) { + if (!DolibarrApiAccess::$user->rights->fournisseur->commande->creer) { throw new RestException(401); } $result = $this->order->fetch($id); From 6df4f250a5c90d1782222be02c2b6b7ab935d6e7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Sep 2021 14:21:20 +0200 Subject: [PATCH 0138/1460] Update list.php --- htdocs/fourn/commande/list.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 72fc3051553..26888851d45 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -134,10 +134,6 @@ if (!$sortorder) { $sortorder = 'DESC'; } -if ($search_status == '') { - $search_status = -5; -} - // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $object = new CommandeFournisseur($db); $hookmanager->initHooks(array('supplierorderlist')); From 97f3296c73f7714c472bee7ae2a5cdc2963d3871 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Sep 2021 14:29:42 +0200 Subject: [PATCH 0139/1460] Update card.php --- htdocs/salaries/card.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index a404a7e9da1..9b46008fe09 100755 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -564,34 +564,34 @@ if ($action == 'create') { print ''; print ''."\n"; + } + // MESSAGE $msg = GETPOSTISSET('message') ? GETPOST('message', 'restricthtml') : ''; print ''; diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang index 6243e98fdc9..cad00ad21f9 100644 --- a/htdocs/langs/en_US/ticket.lang +++ b/htdocs/langs/en_US/ticket.lang @@ -318,4 +318,5 @@ BoxNoTicketLastXDays=No new tickets the last %s days BoxNumberOfTicketByDay=Number of new tickets by day BoxNewTicketVSClose=Number of today's new tickets versus today's closed tickets TicketCreatedToday=Ticket created today -TicketClosedToday=Ticket closed today \ No newline at end of file +TicketClosedToday=Ticket closed today +KMFoundForTicketGroup=We found topics and FAQs that may answers your question, thanks to check them before submitting the ticket diff --git a/htdocs/langs/fr_FR/ticket.lang b/htdocs/langs/fr_FR/ticket.lang index b166e963caf..4b777ff33ca 100644 --- a/htdocs/langs/fr_FR/ticket.lang +++ b/htdocs/langs/fr_FR/ticket.lang @@ -319,3 +319,4 @@ BoxNumberOfTicketByDay=Nombre de nouveaux tickets par jour BoxNewTicketVSClose=Nombre de nouveaux tickets aujourd’hui par rapport aux tickets fermés aujourd’hui TicketCreatedToday=Ticket créé aujourd'hui TicketClosedToday=Ticket fermé aujourd'hui +KMFoundForTicketGroup=Nous avons trouvé des sujets et des FAQ susceptibles de répondre à votre question, merci de les vérifier avant de soumettre le ticket From 2c73c19bd5340f61a1b160f44964b094d7ad1a1c Mon Sep 17 00:00:00 2001 From: antonin_tdj <50403308+ibuiv@users.noreply.github.com> Date: Wed, 15 Sep 2021 18:26:32 +0200 Subject: [PATCH 0245/1460] fix ldap passw bug with activedirectory Fix to avoid LDAP Error: 53 (Unwilling to perform) on Samba4 AD --- htdocs/core/class/ldap.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 0e8fd3ee7b4..eb4f200f5fd 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -486,6 +486,7 @@ class Ldap // For better compatibility with Samba4 AD if ($this->serverType == "activedirectory") { unset($info['cn']); // To avoid error : Operation not allowed on RDN (Code 67) + $info['unicodePwd'] = mb_convert_encoding("\"".$info['unicodePwd']."\"", "UTF-16LE", "UTF-8"); // To avoid error : LDAP Error: 53 (Unwilling to perform) } $result = @ldap_modify($this->connection, $dn, $info); From 3f7a75b0a3a8165bcd2c609a323b581b72c8add6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 Sep 2021 19:02:17 +0200 Subject: [PATCH 0246/1460] FIX translation into email for member at membership validation. --- htdocs/adherents/card.php | 8 ++++---- htdocs/adherents/class/adherent.class.php | 4 ++-- htdocs/install/mysql/data/llx_c_email_templates.sql | 2 +- htdocs/societe/class/societe.class.php | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 7dd164c38b5..56643d80632 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -645,7 +645,7 @@ if (empty($reshook)) { $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); // Load traductions files required by page - $outputlangs->loadLangs(array("main", "members")); + $outputlangs->loadLangs(array("main", "members", "companies", "install", "other")); // Get email content from template $arraydefaultmessage = null; $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION; @@ -716,7 +716,7 @@ if (empty($reshook)) { $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); // Load traductions files required by page - $outputlangs->loadLangs(array("main", "members")); + $outputlangs->loadLangs(array("main", "members", "companies", "install", "other")); // Get email content from template $arraydefaultmessage = null; $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_CANCELATION; @@ -787,7 +787,7 @@ if (empty($reshook)) { $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); // Load traductions files required by page - $outputlangs->loadLangs(array("main", "members")); + $outputlangs->loadLangs(array("main", "members", "companies", "install", "other")); // Get email content from template $arraydefaultmessage = null; $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_EXCLUSION; @@ -1506,7 +1506,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); // Load traductions files required by page - $outputlangs->loadLangs(array("main", "members")); + $outputlangs->loadLangs(array("main", "members", "companies", "install", "other")); // Get email content from template $arraydefaultmessage = null; $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index df9e35651c2..b7f2810912b 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1900,8 +1900,8 @@ class Adherent extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET"; $sql .= " statut = ".self::STATUS_VALIDATED; $sql .= ", datevalid = '".$this->db->idate($now)."'"; - $sql .= ", fk_user_valid=".$user->id; - $sql .= " WHERE rowid = ".$this->id; + $sql .= ", fk_user_valid=".((int) $user->id); + $sql .= " WHERE rowid = ".((int) $this->id); dol_syslog(get_class($this)."::validate", LOG_DEBUG); $result = $this->db->query($sql); diff --git a/htdocs/install/mysql/data/llx_c_email_templates.sql b/htdocs/install/mysql/data/llx_c_email_templates.sql index 4005506e887..69a41a5b3ef 100644 --- a/htdocs/install/mysql/data/llx_c_email_templates.sql +++ b/htdocs/install/mysql/data/llx_c_email_templates.sql @@ -29,7 +29,7 @@ INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnNewSubscription)' ,30,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionWasRecorded)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourSubscriptionWasRecorded)__
\n\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingReminderForExpiredSubscription)',40,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(SubscriptionReminderEmail)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfSubscriptionReminderEmail)__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 0); INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnCancelation)' ,50,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasCanceled)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(YourMembershipWasCanceled)__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 0); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingAnEMailToMember)' ,60,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(CardContent)__', '__(Hello)__,

\n\n__(ThisIsContentOfYourCard)__
\n__(ID)__ : __ID__
\n__(Civiliyty)__ : __MEMBER_CIVILITY__
\n__(Firstname)__ : __MEMBER_FIRSTNAME__
\n__(Lastname)__ : __MEMBER_LASTNAME__
\n__(Fullname)__ : __MEMBER_FULLNAME__
\n__(Company)__ : __MEMBER_COMPANY__
\n__(Address)__ : __MEMBER_ADDRESS__
\n__(Zip)__ : __MEMBER_ZIP__
\n__(Town)__ : __MEMBER_TOWN__
\n__(Country)__ : __MEMBER_COUNTRY__
\n__(Email)__ : __MEMBER_EMAIL__
\n__(Birthday)__ : __MEMBER_BIRTH__
\n__(Photo)__ : __MEMBER_PHOTO__
\n__(Login)__ : __MEMBER_LOGIN__
\n__(Password)__ : __MEMBER_PASSWORD__
\n__(Phone)__ : __MEMBER_PHONE__
\n__(PhonePerso)__ : __MEMBER_PHONEPRO__
\n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__

\n__(Sincerely)__
__USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingAnEMailToMember)' ,60,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(CardContent)__', '__(Hello)__,

\n\n__(ThisIsContentOfYourCard)__
\n__(ID)__ : __ID__
\n__(Civility)__ : __MEMBER_CIVILITY__
\n__(Firstname)__ : __MEMBER_FIRSTNAME__
\n__(Lastname)__ : __MEMBER_LASTNAME__
\n__(Fullname)__ : __MEMBER_FULLNAME__
\n__(Company)__ : __MEMBER_COMPANY__
\n__(Address)__ : __MEMBER_ADDRESS__
\n__(Zip)__ : __MEMBER_ZIP__
\n__(Town)__ : __MEMBER_TOWN__
\n__(Country)__ : __MEMBER_COUNTRY__
\n__(Email)__ : __MEMBER_EMAIL__
\n__(Birthday)__ : __MEMBER_BIRTH__
\n__(Photo)__ : __MEMBER_PHOTO__
\n__(Login)__ : __MEMBER_LOGIN__
\n__(Phone)__ : __MEMBER_PHONE__
\n__(PhonePerso)__ : __MEMBER_PHONEPRO__
\n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__

\n__(Sincerely)__
__USER_SIGNATURE__',null, 0); -- Recruiting INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'recruitment','recruitmentcandidature_send','',0,null,null,'(AnswerCandidature)' ,100,'$conf->recruitment->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourCandidature)__', '__(Hello)__ __CANDIDATE_FULLNAME__,

\n\n__(YourCandidatureAnswerMessage)__
__ONLINE_INTERVIEW_SCHEDULER_TEXT_AND_URL__\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 0); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 69aecc885c7..ff6e9474d34 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1759,7 +1759,7 @@ class Societe extends CommonObject $this->country_id = $obj->country_id; $this->country_code = $obj->country_id ? $obj->country_code : ''; - $this->country = $obj->country_id ? ($langs->transnoentities('Country'.$obj->country_code) != 'Country'.$obj->country_code ? $langs->transnoentities('Country'.$obj->country_code) : $obj->country) : ''; + $this->country = $obj->country_id ? (($langs->transnoentities('Country'.$obj->country_code) != 'Country'.$obj->country_code) ? $langs->transnoentities('Country'.$obj->country_code) : $obj->country) : ''; $this->state_id = $obj->state_id; $this->state_code = $obj->state_code; From 4a2d3a55d41645e50d9f5e946895f7fb4f9f03e4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 Sep 2021 19:33:30 +0200 Subject: [PATCH 0247/1460] FIX Selection of type "people" for membership must hide the company --- htdocs/adherents/admin/website.php | 4 +-- htdocs/public/members/new.php | 46 +++++++++++++++++------------- 2 files changed, 28 insertions(+), 22 deletions(-) diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php index bb320e9f48a..e99e20452cc 100644 --- a/htdocs/adherents/admin/website.php +++ b/htdocs/adherents/admin/website.php @@ -56,7 +56,7 @@ if ($action == 'setMEMBER_ENABLE_PUBLIC') { if ($action == 'update') { $public = GETPOST('MEMBER_ENABLE_PUBLIC'); - $amount = GETPOST('MEMBER_NEWFORM_AMOUNT'); + $amount = price2num(GETPOST('MEMBER_NEWFORM_AMOUNT'), 'MT', 2); $editamount = GETPOST('MEMBER_NEWFORM_EDITAMOUNT'); $payonline = GETPOST('MEMBER_NEWFORM_PAYONLINE'); $forcetype = GETPOST('MEMBER_NEWFORM_FORCETYPE', 'int'); @@ -205,7 +205,7 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) { print ''; print $langs->trans("DefaultAmount"); print ''; - print ''; + print ''; print "\n"; // Can edit diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index f84fce1a2b6..1e2f7aaa63d 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -536,15 +536,16 @@ jQuery(document).ready(function () { jQuery(document).ready(function () { function initmorphy() { - if (jQuery("#morphy").val()==\'phy\') { - jQuery("#trcompany").hide(); - } - if (jQuery("#morphy").val()==\'mor\') { - jQuery("#trcompany").show(); - } + console.log("Call initmorphy"); + if (jQuery("#morphy").val() == \'phy\') { + jQuery("#trcompany").hide(); + } + if (jQuery("#morphy").val() == \'mor\') { + jQuery("#trcompany").show(); + } }; initmorphy(); - jQuery("#morphy").click(function() { + jQuery("#morphy").change(function() { initmorphy(); }); jQuery("#selectcountry_id").change(function() { @@ -592,21 +593,31 @@ if (empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY)) { print ''; } -// Civility +// Company +print ''.$langs->trans("Company").''; +print img_picto('', 'company', 'class="pictofixedwidth"'); +print ''."\n"; +// Title print ''.$langs->trans('UserTitle').''; print $formcompany->select_civility(GETPOST('civility_id'), 'civility_id').''."\n"; // Lastname print ''.$langs->trans("Lastname").' *'."\n"; // Firstname print ''.$langs->trans("Firstname").' *'."\n"; +// EMail +print ''.$langs->trans("Email").($conf->global->ADHERENT_MAIL_REQUIRED ? ' *' : '').''."\n"; +// Login +if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { + print ''.$langs->trans("Login").' *'."\n"; + print ''.$langs->trans("Password").' *'."\n"; + print ''.$langs->trans("PasswordAgain").' *'."\n"; +} // Gender print ''.$langs->trans("Gender").''; print ''; $arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman")); print $form->selectarray('gender', $arraygender, GETPOST('gender') ?GETPOST('gender') : $object->gender, 1); print ''; -// Company -print ''.$langs->trans("Company").''."\n"; // Address print ''.$langs->trans("Address").''."\n"; print ''."\n"; @@ -618,7 +629,8 @@ print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'se print ''; // Country print ''.$langs->trans('Country').''; -$country_id = GETPOST('country_id'); +print img_picto('', 'country', 'class="pictofixedwidth"'); +$country_id = GETPOST('country_id', 'int'); if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { $country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); } @@ -644,14 +656,6 @@ if (empty($conf->global->SOCIETE_DISABLE_STATE)) { } print ''; } -// EMail -print ''.$langs->trans("Email").($conf->global->ADHERENT_MAIL_REQUIRED ? ' *' : '').''."\n"; -// Login -if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { - print ''.$langs->trans("Login").' *'."\n"; - print ''.$langs->trans("Password").' *'."\n"; - print ''.$langs->trans("PasswordAgain").' *'."\n"; -} // Birthday print ''.$langs->trans("DateOfBirth").''; print $form->selectDate($birthday, 'birth', 0, 0, 1, "newmember", 1, 0); @@ -669,7 +673,8 @@ print ''.$langs->trans("Comments").''; print ''; print ''."\n"; - // Add specific fields used by Dolibarr foundation for example +// Add specific fields used by Dolibarr foundation for example +// TODO Move this into generic feature. if (!empty($conf->global->MEMBER_NEWFORM_DOLIBARRTURNOVER)) { $arraybudget = array('50'=>'<= 100 000', '100'=>'<= 200 000', '200'=>'<= 500 000', '300'=>'<= 1 500 000', '600'=>'<= 3 000 000', '1000'=>'<= 5 000 000', '2000'=>'5 000 000+'); print ''.$langs->trans("TurnoverOrBudget").' *'; @@ -712,6 +717,7 @@ if (!empty($conf->global->MEMBER_NEWFORM_DOLIBARRTURNOVER)) { '; print ''."\n"; } + if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT) || !empty($conf->global->MEMBER_NEWFORM_PAYONLINE)) { // $conf->global->MEMBER_NEWFORM_SHOWAMOUNT is an amount From 29d9771b800c95bda46cf245540598a33835cc9b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 Sep 2021 19:39:22 +0200 Subject: [PATCH 0248/1460] Code comment --- htdocs/public/members/new.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 1e2f7aaa63d..b6498ca4032 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -605,7 +605,9 @@ print ''.$langs->trans("Lastname").' * // Firstname print ''.$langs->trans("Firstname").' *'."\n"; // EMail -print ''.$langs->trans("Email").($conf->global->ADHERENT_MAIL_REQUIRED ? ' *' : '').''."\n"; +print ''.$langs->trans("Email").($conf->global->ADHERENT_MAIL_REQUIRED ? ' *' : '').''; +//print img_picto('', 'email', 'class="pictofixedwidth"'); +print ''."\n"; // Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { print ''.$langs->trans("Login").' *'."\n"; From eab4014f2086cf3e921388eaa6352d357b3f1103 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 Sep 2021 19:42:07 +0200 Subject: [PATCH 0249/1460] Rename url --- htdocs/eventorganization/class/conferenceorbooth.class.php | 2 +- htdocs/eventorganization/conferenceorbooth_list.php | 2 +- htdocs/eventorganization/conferenceorboothattendee_card.php | 2 +- htdocs/eventorganization/conferenceorboothattendee_list.php | 2 +- .../{attendee_registration.php => attendee_register.php} | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) rename htdocs/public/eventorganization/{attendee_registration.php => attendee_register.php} (99%) diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index a8b1dddda3a..ea2bf2eb87f 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -246,7 +246,7 @@ class ConferenceOrBooth extends ActionComm $result = parent::fetch($id, $ref, $ref_ext, $email_msgid); - $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_registration.php?id='.urlencode($id).'&type=conf'; + $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_register.php?id='.urlencode($id).'&type=conf'; $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); $link_subscription .= '&securekey='.urlencode($encodedsecurekey); diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index a09d7aff6de..c46798b05b5 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -447,7 +447,7 @@ if ($projectid > 0) { print $langs->trans("PublicAttendeeSubscriptionGlobalPage"); //print ''; print ''; - $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_registration.php?id='.$project->id.'&type=global'; + $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_register.php?id='.$project->id.'&type=global'; $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$project->id, 'md5'); $link_subscription .= '&securekey='.urlencode($encodedsecurekey); //print ''; // TODO Replace this with mass delete action if ($user->rights->accounting->mouvements->supprimer_tous) { print ''; } diff --git a/htdocs/adherents/admin/member.php b/htdocs/adherents/admin/member.php index 018498c2457..0ff0919652d 100644 --- a/htdocs/adherents/admin/member.php +++ b/htdocs/adherents/admin/member.php @@ -404,13 +404,13 @@ foreach ($dirmodels as $reldir) { // Active if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } @@ -419,7 +419,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->MEMBER_ADDON_PDF == $name) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 4b81e065d3f..ca1ad342d8a 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1979,10 +1979,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $isinspip = $mailmanspip->is_in_spip($object); if ($isinspip == 1) { - print ''.$langs->trans("DeleteIntoSpip").''."\n"; + print ''.$langs->trans("DeleteIntoSpip").''."\n"; } if ($isinspip == 0) { - print ''.$langs->trans("AddIntoSpip").''."\n"; + print ''.$langs->trans("AddIntoSpip").''."\n"; } } diff --git a/htdocs/adherents/tpl/linkedobjectblock.tpl.php b/htdocs/adherents/tpl/linkedobjectblock.tpl.php index 0414bf20a14..7aa2f39a3ff 100644 --- a/htdocs/adherents/tpl/linkedobjectblock.tpl.php +++ b/htdocs/adherents/tpl/linkedobjectblock.tpl.php @@ -45,7 +45,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { } echo ''; echo ''; - echo ''.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').''; + echo ''.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').''; echo ''; } diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index d689b2df8af..5567e741272 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -282,9 +282,9 @@ while ($i <= $MAXAGENDA) { print ajax_constantonoff('AGENDA_EXT_ACTIVEBYDEFAULT' . $key); } else { if (empty($conf->global->{$default})) { - print '' . img_picto($langs->trans("Enabled"), 'on') . ''; + print '' . img_picto($langs->trans("Enabled"), 'on') . ''; } else { - print '' . img_picto($langs->trans("Disabled"), 'off') . ''; + print '' . img_picto($langs->trans("Disabled"), 'off') . ''; } } print ''; diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index 463df5475f9..252008fb877 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -260,7 +260,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { if (in_array($name, $def)) { print ''."\n"; if ($conf->global->ACTION_EVENT_ADDON_PDF != "$name") { - print 'scandir.'&label='.urlencode($module->name).'&type=action">'; + print 'scandir.'&label='.urlencode($module->name).'&type=action">'; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; } else { @@ -269,7 +269,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { print ""; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'&type=action">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'&type=action">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } @@ -324,9 +324,9 @@ print ' '."\n"; print ''."\n"; //print ajax_constantonoff('AGENDA_USE_EVENT_TYPE'); Do not use ajax here, we need to reload page to change other combo list if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } else { - print ''.img_picto($langs->trans("Enabled"), 'switch_on').''; + print ''.img_picto($langs->trans("Enabled"), 'switch_on').''; } print ''."\n"; diff --git a/htdocs/admin/agenda_reminder.php b/htdocs/admin/agenda_reminder.php index 2b2da673202..ac968778ffc 100644 --- a/htdocs/admin/agenda_reminder.php +++ b/htdocs/admin/agenda_reminder.php @@ -181,7 +181,7 @@ if (empty($conf->global->AGENDA_REMINDER_BROWSER)) { $langs->load("errors"); print img_warning($langs->trans("WarningAvailableOnlyForHTTPSServers"), '', 'valignmiddle size15x').' '; } - print ''.img_picto($langs->trans('Enabled'), 'switch_on').''; + print ''.img_picto($langs->trans('Enabled'), 'switch_on').''; print ''."\n"; print ''."\n"; @@ -190,9 +190,9 @@ if (empty($conf->global->AGENDA_REMINDER_BROWSER)) { print ''."\n"; if (empty($conf->global->AGENDA_REMINDER_BROWSER_SOUND)) { - print ''.img_picto($langs->trans('Disabled'), 'switch_off').''; + print ''.img_picto($langs->trans('Disabled'), 'switch_off').''; } else { - print ''.img_picto($langs->trans('Enabled'), 'switch_on').''; + print ''.img_picto($langs->trans('Enabled'), 'switch_on').''; } print ''."\n"; @@ -229,7 +229,7 @@ if (empty($conf->cron->enabled)) { $langs->load("cron"); print ''.$langs->trans("JobXMustBeEnabled", $langs->transnoentitiesnoconv("sendEmailsReminder")).''; } else { - print ''.img_picto($langs->trans('Enabled'), 'switch_on').''; + print ''.img_picto($langs->trans('Enabled'), 'switch_on').''; } } } diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index a9463be9937..4e79d3ee276 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -354,13 +354,13 @@ foreach ($dirmodels as $reldir) { // Active if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } diff --git a/htdocs/admin/bom.php b/htdocs/admin/bom.php index 0aae15eef3e..35cf6b3e8a4 100644 --- a/htdocs/admin/bom.php +++ b/htdocs/admin/bom.php @@ -362,13 +362,13 @@ foreach ($dirmodels as $reldir) { // Active if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index c4e697bfe00..2e4226e89d5 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -423,8 +423,8 @@ foreach ($boxactivated as $key => $box) { $hasprevious = ($key != 0); print ''.($key + 1).''; print ''; - print ($hasnext ? ''.img_down().' ' : ''); - print ($hasprevious ? ''.img_up().'' : ''); + print ($hasnext ? ''.img_down().' ' : ''); + print ($hasprevious ? ''.img_up().'' : ''); print ''; print ''; print ''.img_delete().''; diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index d57292e3562..23d7020e370 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -424,13 +424,13 @@ foreach ($dirmodels as $reldir) { // Active if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } @@ -439,7 +439,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->COMMANDE_ADDON_PDF == $name) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index b5e0c3ae28b..7854924c090 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -353,13 +353,13 @@ foreach ($dirmodels as $reldir) { // Active if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } @@ -368,7 +368,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->CONTRACT_ADDON_PDF == $name) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/delivery.php b/htdocs/admin/delivery.php index 4fa7b2b79c7..68a18aa0f6a 100644 --- a/htdocs/admin/delivery.php +++ b/htdocs/admin/delivery.php @@ -357,13 +357,13 @@ foreach ($dirmodels as $reldir) { // Active if (in_array($name, $def)) { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'; + print 'scandir).'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ""; } else { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } diff --git a/htdocs/admin/ecm.php b/htdocs/admin/ecm.php index 52badf366ca..44df7f74189 100644 --- a/htdocs/admin/ecm.php +++ b/htdocs/admin/ecm.php @@ -93,9 +93,9 @@ if ($conf->use_javascript_ajax) { print ajax_constantonoff('ECM_AUTO_TREE_ENABLED'); } else { if (empty($conf->global->ECM_AUTO_TREE_ENABLED)) { - print ''.img_picto($langs->trans("Disabled"), 'off').''; + print ''.img_picto($langs->trans("Disabled"), 'off').''; } elseif (!empty($conf->global->USER_MAIL_REQUIRED)) { - print ''.img_picto($langs->trans("Enabled"), 'on').''; + print ''.img_picto($langs->trans("Enabled"), 'on').''; } } print ''; diff --git a/htdocs/admin/eventorganization.php b/htdocs/admin/eventorganization.php index 9c088aec61c..36ba50818c6 100644 --- a/htdocs/admin/eventorganization.php +++ b/htdocs/admin/eventorganization.php @@ -580,13 +580,13 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { // Active if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index 32f82f5dad5..777767a823e 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -353,13 +353,13 @@ foreach ($dirmodels as $reldir) { // Active if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } @@ -368,7 +368,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->EXPEDITION_ADDON_PDF == $name) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index 1553f6887f8..70bbc6f2b07 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -358,13 +358,13 @@ foreach ($dirmodels as $reldir) { // Active if (in_array($name, $def)) { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'; + print 'scandir).'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ""; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index bf4e2ea9eb6..a9f1e97ffab 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -501,13 +501,13 @@ foreach ($dirmodels as $reldir) { // Active if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("SetAsDefault"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("SetAsDefault"), 'switch_off').''; print ""; } diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 4d9304472d5..cdc3d139515 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -419,13 +419,13 @@ foreach ($dirmodels as $reldir) { // Active if (in_array($name, $def)) { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'; + print 'scandir).'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ""; } else { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php index 81db1cbe58d..00d82f68035 100644 --- a/htdocs/admin/holiday.php +++ b/htdocs/admin/holiday.php @@ -359,13 +359,13 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { // Active if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } diff --git a/htdocs/admin/knowledgemanagement.php b/htdocs/admin/knowledgemanagement.php index 477f38fa663..b886e6faf39 100644 --- a/htdocs/admin/knowledgemanagement.php +++ b/htdocs/admin/knowledgemanagement.php @@ -533,13 +533,13 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { // Active if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } diff --git a/htdocs/admin/mrp.php b/htdocs/admin/mrp.php index 7cd3c095955..333fcb2bd6b 100644 --- a/htdocs/admin/mrp.php +++ b/htdocs/admin/mrp.php @@ -359,13 +359,13 @@ foreach ($dirmodels as $reldir) { // Active if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } @@ -374,7 +374,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->MRP_MO_ADDON_PDF == $name) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/paymentbybanktransfer.php b/htdocs/admin/paymentbybanktransfer.php index 4d170aa5fbd..04e1488fedc 100644 --- a/htdocs/admin/paymentbybanktransfer.php +++ b/htdocs/admin/paymentbybanktransfer.php @@ -298,7 +298,7 @@ foreach ($dirmodels as $reldir) if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"),'switch_on'); print ''; print ''; @@ -306,7 +306,7 @@ foreach ($dirmodels as $reldir) else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; print ""; } diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index f9c183b5c7d..2e266f833ea 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -312,7 +312,7 @@ foreach ($dirmodels as $reldir) if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"),'switch_on'); print ''; print ''; @@ -320,7 +320,7 @@ foreach ($dirmodels as $reldir) else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; print ""; } diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index dcd91df0dbc..88df6b0da05 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -402,13 +402,13 @@ foreach ($dirmodels as $reldir) { // Active if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } diff --git a/htdocs/admin/reception_setup.php b/htdocs/admin/reception_setup.php index 6367b80c150..c364911ab51 100644 --- a/htdocs/admin/reception_setup.php +++ b/htdocs/admin/reception_setup.php @@ -363,13 +363,13 @@ foreach ($dirmodels as $reldir) { // Active if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index 5f8cc66eb1e..477691cf6ef 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -111,9 +111,9 @@ if (function_exists("imagecreatefrompng")) { print ajax_constantonoff('MAIN_SECURITY_ENABLECAPTCHA'); } else { if (empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA)) { - print ''.img_picto($langs->trans("Disabled"), 'off').''; + print ''.img_picto($langs->trans("Disabled"), 'off').''; } else { - print ''.img_picto($langs->trans("Enabled"), 'on').''; + print ''.img_picto($langs->trans("Enabled"), 'on').''; } } } else { @@ -130,9 +130,9 @@ if (!empty($conf->use_javascript_ajax)) { print ajax_constantonoff('MAIN_USE_ADVANCED_PERMS'); } else { if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { - print ''.img_picto($langs->trans("Disabled"), 'off').''; + print ''.img_picto($langs->trans("Disabled"), 'off').''; } else { - print ''.img_picto($langs->trans("Enabled"), 'on').''; + print ''.img_picto($langs->trans("Enabled"), 'on').''; } } print ""; diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index e45a01d9ed1..d8d6a883d88 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -565,13 +565,13 @@ foreach ($dirmodels as $reldir) { // Active if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index a888a248d11..ec5a3e087cf 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -375,7 +375,7 @@ foreach ($dirmodels as $reldir) { //if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF != "$name") //{ // Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all - print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier">'; + print 'scandir).'&label='.urlencode($module->name).'&type=invoice_supplier">'; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; /*} @@ -386,7 +386,7 @@ foreach ($dirmodels as $reldir) { print ""; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'&type=invoice_supplier">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index cfa6c878a74..0efa365a33f 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -381,7 +381,7 @@ foreach ($dirmodels as $reldir) { if (in_array($name, $def)) { print ''."\n"; if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF != "$name") { - print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier">'; + print 'scandir).'&label='.urlencode($module->name).'&type=order_supplier">'; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; } else { @@ -390,7 +390,7 @@ foreach ($dirmodels as $reldir) { print ""; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'&type=order_supplier">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php index 980ebe10fff..1585b66b1e1 100644 --- a/htdocs/admin/supplier_proposal.php +++ b/htdocs/admin/supplier_proposal.php @@ -380,18 +380,18 @@ foreach ($dirmodels as $reldir) { // Active if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { - print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''."\n"; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } // Defaut - print ""; + print ''; if ($conf->global->SUPPLIER_PROPOSAL_ADDON_PDF == "$name") { print img_picto($langs->trans("Default"), 'on'); } else { diff --git a/htdocs/admin/ticket.php b/htdocs/admin/ticket.php index c3778861ddf..03fd647dd29 100644 --- a/htdocs/admin/ticket.php +++ b/htdocs/admin/ticket.php @@ -400,13 +400,13 @@ foreach ($dirmodels as $reldir) { // Active if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php index da3a1913d64..391a456439c 100644 --- a/htdocs/admin/user.php +++ b/htdocs/admin/user.php @@ -147,9 +147,9 @@ if ($conf->use_javascript_ajax) { print ajax_constantonoff('USER_MAIL_REQUIRED'); } else { if (empty($conf->global->USER_MAIL_REQUIRED)) { - print ''.img_picto($langs->trans("Disabled"), 'off').''; + print ''.img_picto($langs->trans("Disabled"), 'off').''; } else { - print ''.img_picto($langs->trans("Enabled"), 'on').''; + print ''.img_picto($langs->trans("Enabled"), 'on').''; } } print ''; @@ -256,13 +256,13 @@ foreach ($dirmodels as $reldir) { // Active if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } diff --git a/htdocs/admin/usergroup.php b/htdocs/admin/usergroup.php index b73d3ce4f22..9846389f87a 100644 --- a/htdocs/admin/usergroup.php +++ b/htdocs/admin/usergroup.php @@ -188,13 +188,13 @@ foreach ($dirmodels as $reldir) { // Active if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index 1b6fa5bebe7..ada5a6e0b3b 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -250,11 +250,11 @@ foreach ($workflowcodes as $key => $params) { print ajax_constantonoff($key); } else { if (!empty($conf->global->$key)) { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } diff --git a/htdocs/admin/workstation.php b/htdocs/admin/workstation.php index f14393e2588..76556fb4d68 100755 --- a/htdocs/admin/workstation.php +++ b/htdocs/admin/workstation.php @@ -423,13 +423,13 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { // Active if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } diff --git a/htdocs/bom/tpl/linkedobjectblock.tpl.php b/htdocs/bom/tpl/linkedobjectblock.tpl.php index fcba37105d3..946563f7b81 100644 --- a/htdocs/bom/tpl/linkedobjectblock.tpl.php +++ b/htdocs/bom/tpl/linkedobjectblock.tpl.php @@ -73,7 +73,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { echo ''; // For now, shipments must stay linked to order, so link is not deletable if ($object->element != 'shipping') { - echo ''.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').''; + echo ''.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').''; } echo ''; echo "\n"; diff --git a/htdocs/categories/admin/categorie.php b/htdocs/categories/admin/categorie.php index bddeb9a771a..02e6892b571 100644 --- a/htdocs/categories/admin/categorie.php +++ b/htdocs/categories/admin/categorie.php @@ -101,9 +101,9 @@ if ($conf->use_javascript_ajax) { print ajax_constantonoff('CATEGORIE_RECURSIV_ADD'); } else { if (empty($conf->global->CATEGORIE_RECURSIV_ADD)) { - print ''.img_picto($langs->trans("Disabled"), 'off').''; + print ''.img_picto($langs->trans("Disabled"), 'off').''; } else { - print ''.img_picto($langs->trans("Enabled"), 'on').''; + print ''.img_picto($langs->trans("Enabled"), 'on').''; } } print ''; diff --git a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php index 23c1a459c74..829effed6a2 100644 --- a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php +++ b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php @@ -68,7 +68,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { } print ''; print ''.$objectlink->getLibStatut(3).''; - print ''.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').''; + print ''.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').''; print "\n"; } if (count($linkedObjectBlock) > 1) { diff --git a/htdocs/commande/tpl/linkedobjectblock.tpl.php b/htdocs/commande/tpl/linkedobjectblock.tpl.php index a0641c4c493..211702059cb 100644 --- a/htdocs/commande/tpl/linkedobjectblock.tpl.php +++ b/htdocs/commande/tpl/linkedobjectblock.tpl.php @@ -64,7 +64,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { echo ''; // For now, shipments must stay linked to order, so link is not deletable if ($object->element != 'shipping') { - echo ''.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').''; + echo ''.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').''; } echo ''; echo "\n"; diff --git a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php index 47523447205..bcfece64157 100644 --- a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php +++ b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php @@ -93,7 +93,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { print $objectlink->getLibStatut(3); } print ''; - print ''.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').''; + print ''.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').''; print "\n"; } if (count($linkedObjectBlock) > 1) { diff --git a/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php b/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php index 935f6b03948..7c9683c8b8c 100644 --- a/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php +++ b/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php @@ -57,7 +57,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { } ?> getLibStatut(3); ?> - ">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?> + ">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?> global->BILL_ADD_PAYMENT_VALIDATION)) if ($action == '') { if ($user->rights->tax->charges->supprimer) { if (!$disable_delete) { - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } else { print ''.$langs->trans('Delete').''; } diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index 9764f679959..363af314113 100755 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -767,7 +767,7 @@ if ($id) { } if (!empty($user->rights->tax->charges->supprimer) && empty($totalpaye)) { - print ''; + print ''; } else { print ''; } diff --git a/htdocs/contrat/tpl/linkedobjectblock.tpl.php b/htdocs/contrat/tpl/linkedobjectblock.tpl.php index 310e2bd00b9..8715a8ce4cc 100644 --- a/htdocs/contrat/tpl/linkedobjectblock.tpl.php +++ b/htdocs/contrat/tpl/linkedobjectblock.tpl.php @@ -62,7 +62,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { echo price($totalcontrat); } ?> getLibStatut(7); ?> - ">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?> + ">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?> $objectlink) { } print ''; echo ''.$objectlink->getLibStatut(3).''; - echo ''.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').''; + echo ''.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').''; echo ''; } diff --git a/htdocs/expensereport/tpl/linkedobjectblock.tpl.php b/htdocs/expensereport/tpl/linkedobjectblock.tpl.php index 31c5526903b..e3fc511a024 100644 --- a/htdocs/expensereport/tpl/linkedobjectblock.tpl.php +++ b/htdocs/expensereport/tpl/linkedobjectblock.tpl.php @@ -47,7 +47,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { echo price($objectlink->total_ht); } ?> getLibStatut(3); ?> - ">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?> + ">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?> $objectlink) { datev, 'day'); ?> getLibStatut(3); ?> - ">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?> + ">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?> $objectlink) { echo price($objectlink->total_ht); } ?> getLibStatut(3); ?> - ">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?> + ">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?> $objectlink) { echo $objectlink->getLibStatut(3); } ?> - ">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?> + ">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?> gl 'activate', 'add', 'addrights', 'addtimespent', 'doprev', 'donext', 'dvprev', 'dvnext', 'install', - 'reopen', - 'setpricelevel', 'set_paid', - 'update' + 'reopen' ); $sensitiveget = false; if (in_array(GETPOST('action', 'aZ09'), $arrayofactiontoforcetokencheck)) { $sensitiveget = true; } - if (preg_match('/^(classify|close|confirm_|delete|disable|enable|remove_|setremise)/', GETPOST('action', 'aZ09'))) { + if (preg_match('/^(classify|close|confirm|del|disable|enable|remove|set|update)/', GETPOST('action', 'aZ09'))) { $sensitiveget = true; } diff --git a/htdocs/margin/admin/margin.php b/htdocs/margin/admin/margin.php index 939b084fe41..588773ef50c 100644 --- a/htdocs/margin/admin/margin.php +++ b/htdocs/margin/admin/margin.php @@ -155,9 +155,9 @@ if (!empty($conf->use_javascript_ajax)) { print ajax_constantonoff('DISPLAY_MARGIN_RATES'); } else { if (empty($conf->global->DISPLAY_MARGIN_RATES)) { - print ''.img_picto($langs->trans("Disabled"), 'off').''; + print ''.img_picto($langs->trans("Disabled"), 'off').''; } else { - print ''.img_picto($langs->trans("Enabled"), 'on').''; + print ''.img_picto($langs->trans("Enabled"), 'on').''; } } print ''; @@ -172,9 +172,9 @@ if (!empty($conf->use_javascript_ajax)) { print ajax_constantonoff('DISPLAY_MARK_RATES'); } else { if (empty($conf->global->DISPLAY_MARK_RATES)) { - print ''.img_picto($langs->trans("Disabled"), 'off').''; + print ''.img_picto($langs->trans("Disabled"), 'off').''; } else { - print ''.img_picto($langs->trans("Enabled"), 'on').''; + print ''.img_picto($langs->trans("Enabled"), 'on').''; } } print ''; diff --git a/htdocs/modulebuilder/admin/setup.php b/htdocs/modulebuilder/admin/setup.php index 5aaae9f93eb..e5ccb0c3966 100644 --- a/htdocs/modulebuilder/admin/setup.php +++ b/htdocs/modulebuilder/admin/setup.php @@ -125,9 +125,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { print ajax_constantonoff('MODULEBUILDER_USE_ABOUT'); } else { if (empty($conf->global->MODULEBUILDER_USE_ABOUT)) { - print ''.img_picto($langs->trans("Disabled"), 'off').''; + print ''.img_picto($langs->trans("Disabled"), 'off').''; } else { - print ''.img_picto($langs->trans("Enabled"), 'on').''; + print ''.img_picto($langs->trans("Enabled"), 'on').''; } } print ''; diff --git a/htdocs/modulebuilder/template/admin/setup.php b/htdocs/modulebuilder/template/admin/setup.php index 9007eab60cc..6d7497b7780 100644 --- a/htdocs/modulebuilder/template/admin/setup.php +++ b/htdocs/modulebuilder/template/admin/setup.php @@ -598,13 +598,13 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { // Active if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } diff --git a/htdocs/modulebuilder/template/core/tpl/linkedobjectblock_myobject.tpl.php b/htdocs/modulebuilder/template/core/tpl/linkedobjectblock_myobject.tpl.php index 67aac8c0e98..3c6442bd454 100644 --- a/htdocs/modulebuilder/template/core/tpl/linkedobjectblock_myobject.tpl.php +++ b/htdocs/modulebuilder/template/core/tpl/linkedobjectblock_myobject.tpl.php @@ -50,7 +50,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { date, 'day'); ?> getLibStatut(7); ?> - ">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?> + ">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?> $objectlink) { echo ''; // For now, shipments must stay linked to order, so link is not deletable if ($object->element != 'shipping') { - echo ''.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').''; + echo ''.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').''; } echo ''; echo "\n"; diff --git a/htdocs/multicurrency/multicurrency_rate.php b/htdocs/multicurrency/multicurrency_rate.php index 35b7544ccbc..d0be7666a95 100644 --- a/htdocs/multicurrency/multicurrency_rate.php +++ b/htdocs/multicurrency/multicurrency_rate.php @@ -526,8 +526,8 @@ if ($resql) { if (in_array($obj->rowid, $arrayofselected)) { $selected = 1; } - print 'rowid.'">'.img_picto('edit', 'edit').''; - print 'rowid.'">'.img_picto('delete', 'delete').''; + print 'rowid.'">'.img_picto('edit', 'edit').''; + print 'rowid.'">'.img_picto('delete', 'delete').''; print ''; } print ''; diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index fa75a20277f..199f2a04f03 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -448,13 +448,13 @@ foreach ($dirmodels as $reldir) { // Active if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } diff --git a/htdocs/product/stock/massstockmove.php b/htdocs/product/stock/massstockmove.php index da8ef2e5b37..af6d6c08740 100644 --- a/htdocs/product/stock/massstockmove.php +++ b/htdocs/product/stock/massstockmove.php @@ -632,7 +632,7 @@ foreach ($listofdata as $key => $val) { print ''; } print ''.$val['qty'].''; - print ''.img_delete($langs->trans("Remove")).''; + print ''.img_delete($langs->trans("Remove")).''; print ''; } } diff --git a/htdocs/projet/admin/project.php b/htdocs/projet/admin/project.php index eaea44dd22b..0ce2a38a471 100644 --- a/htdocs/projet/admin/project.php +++ b/htdocs/projet/admin/project.php @@ -564,13 +564,13 @@ foreach ($dirmodels as $reldir) { // Active if (in_array($name, $def)) { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'; + print 'scandir).'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ""; } else { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } @@ -704,13 +704,13 @@ if (empty($conf->global->PROJECT_HIDE_TASKS)) { // Active if (in_array($name, $def)) { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'; + print 'scandir).'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ""; } else { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } diff --git a/htdocs/reception/tpl/linkedobjectblock.tpl.php b/htdocs/reception/tpl/linkedobjectblock.tpl.php index 39a5a24347d..41ebc02747f 100644 --- a/htdocs/reception/tpl/linkedobjectblock.tpl.php +++ b/htdocs/reception/tpl/linkedobjectblock.tpl.php @@ -69,7 +69,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { // For now, receptions must stay linked to order, so link is not deletable if ($object->element != 'order_supplier') { ?> - ">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?> + ">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?> diff --git a/htdocs/recruitment/admin/setup.php b/htdocs/recruitment/admin/setup.php index 6da39445f7f..6b6dd050820 100644 --- a/htdocs/recruitment/admin/setup.php +++ b/htdocs/recruitment/admin/setup.php @@ -459,13 +459,13 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { // Active if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } diff --git a/htdocs/recruitment/admin/setup_candidatures.php b/htdocs/recruitment/admin/setup_candidatures.php index 2bcddf58964..b2189954bf4 100644 --- a/htdocs/recruitment/admin/setup_candidatures.php +++ b/htdocs/recruitment/admin/setup_candidatures.php @@ -457,13 +457,13 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { // Active if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index b9b2046fd90..8b4975a5592 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -560,7 +560,7 @@ foreach ($dirsociete as $dirroot) { print "\n"; //if ($conf->global->COMPANY_ADDON_PDF != "$name") //{ - print 'scandir.'&label='.urlencode($module->name).'">'; + print 'scandir.'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; //} diff --git a/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php b/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php index c33c3b2ebac..d0fce33ed22 100644 --- a/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php +++ b/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php @@ -53,7 +53,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { echo price($objectlink->total_ht); } ?> getLibStatut(3); ?> - ">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?> + ">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?> $objectlink) { // For now, shipments must stay linked to order, so link is not deletable if ($object->element != 'shipping') { ?> - ">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?> + ">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?> diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index 36b9ce7566c..4fb9c51644f 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -384,7 +384,7 @@ if ($action == 'create') { } if ($candisableperms) { - print ''.$langs->trans("DeleteGroup").''; + print ''.$langs->trans("DeleteGroup").''; } print "
\n"; diff --git a/htdocs/user/group/perms.php b/htdocs/user/group/perms.php index e2c419b0543..46506163c1f 100644 --- a/htdocs/user/group/perms.php +++ b/htdocs/user/group/perms.php @@ -332,7 +332,7 @@ if ($object->id > 0) { if (in_array($obj->id, $permsgroupbyentity[$entity])) { // Own permission by group if ($caneditperms) { - print 'id.'&confirm=yes&token='.newToken().'">'; + print 'id.'&confirm=yes">'; //print img_edit_remove($langs->trans("Remove")); print img_picto($langs->trans("Remove"), 'switch_on'); print ''; @@ -343,7 +343,7 @@ if ($object->id > 0) { } else { // Do not own permission if ($caneditperms) { - print 'id.'&confirm=yes&token='.newToken().'">'; + print 'id.'&confirm=yes">'; //print img_edit_add($langs->trans("Add")); print img_picto($langs->trans("Add"), 'switch_off'); print ''; diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 391682b2d6d..7c7fe868b2f 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -279,9 +279,9 @@ print ''.$langs->trans("Module").''; if (($caneditperms && empty($objMod->rights_admin_allowed)) || empty($object->admin)) { if ($caneditperms) { print ''; - print ''.$langs->trans("All").""; + print ''.$langs->trans("All").""; print ' / '; - print ''.$langs->trans("None").""; + print ''.$langs->trans("None").""; print ''; } print ' '; @@ -359,9 +359,9 @@ if ($result) { if (($caneditperms && empty($objMod->rights_admin_allowed)) || empty($object->admin)) { if ($caneditperms) { print ''; - print 'module.'&confirm=yes&token='.newToken().'">'.$langs->trans("All").""; + print 'module.'&confirm=yes">'.$langs->trans("All").""; print ' / '; - print 'module.'&confirm=yes&token='.newToken().'">'.$langs->trans("None").""; + print 'module.'&confirm=yes">'.$langs->trans("None").""; print ''; } print ' '; @@ -399,7 +399,7 @@ if ($result) { print ''; } elseif (in_array($obj->id, $permsuser)) { // Permission granted by user if ($caneditperms) { - print 'id.'&confirm=yes&token='.newToken().'">'; + print 'id.'&confirm=yes">'; //print img_edit_remove($langs->trans("Remove")); print img_picto($langs->trans("Remove"), 'switch_on'); print ''; diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index c29fc519258..a3ad036ca9a 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -888,7 +888,7 @@ if (!empty($id) || !empty($ref)) { print ''.$prodstatic->getLibStatut(2, 0).''; print ''.$prodstatic->getLibStatut(2, 1).''; print ''; - print 'id.'">'.img_edit().''; + print 'id.'">'.img_edit().''; print 'id.'">'.img_delete().''; print ''; print ''; From 4d563651fab4c55ef82ef0ff3aef37999c15531d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 19 Sep 2021 14:49:11 +0200 Subject: [PATCH 0358/1460] Add a mode MAIN_SECURITY_CSRF_WITH_TOKEN = 2 --- htdocs/main.inc.php | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index a40135adc27..433c168b7f2 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -460,22 +460,25 @@ if (!defined('NOTOKENRENEWAL') && !defined('NOSESSION')) { //dol_syslog("aaaa - ".defined('NOCSRFCHECK')." - ".$dolibarr_nocsrfcheck." - ".$conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN." - ".$_SERVER['REQUEST_METHOD']." - ".GETPOST('token', 'alpha')); // Check validity of token, only if option MAIN_SECURITY_CSRF_WITH_TOKEN enabled or if constant CSRFCHECK_WITH_TOKEN is set into page -if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && !empty($conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN)) || defined('CSRFCHECK_WITH_TOKEN')) { +if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN')) || defined('CSRFCHECK_WITH_TOKEN')) { // Array of action code where CSRFCHECK with token will be forced (so token must be provided on url request) - $arrayofactiontoforcetokencheck = array( - 'activate', 'add', 'addrights', 'addtimespent', - 'doprev', 'donext', 'dvprev', 'dvnext', - 'install', - 'reopen' - ); $sensitiveget = false; - if (in_array(GETPOST('action', 'aZ09'), $arrayofactiontoforcetokencheck)) { + if (getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN') == 2) { $sensitiveget = true; + } else { + $arrayofactiontoforcetokencheck = array( + 'activate', 'add', 'addrights', 'addtimespent', + 'doprev', 'donext', 'dvprev', 'dvnext', + 'install', + 'reopen' + ); + if (in_array(GETPOST('action', 'aZ09'), $arrayofactiontoforcetokencheck)) { + $sensitiveget = true; + } + if (preg_match('/^(classify|close|confirm|del|disable|enable|remove|set|update)/', GETPOST('action', 'aZ09'))) { + $sensitiveget = true; + } } - if (preg_match('/^(classify|close|confirm|del|disable|enable|remove|set|update)/', GETPOST('action', 'aZ09'))) { - $sensitiveget = true; - } - // Check a token is provided for all cases that need a mandatory token // (all POST actions + all login, actions and mass actions on pages with CSRFCHECK_WITH_TOKEN set + all sensitive GET actions) if ( From 074e8b2031c4340ad42b871c773a82f56e5492ed Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 19 Sep 2021 14:53:09 +0200 Subject: [PATCH 0359/1460] Update doc to prepare MAIN_SECURITY_CSRF_WITH_TOKEN to 2 by default --- SECURITY.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SECURITY.md b/SECURITY.md index d27749eb203..61f4a392db8 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -54,7 +54,7 @@ ONLY vulnerabilities discovered, when the following setup on test platform is us * $dolibarr_main_prod must be set to 1 into conf.php * $dolibarr_nocsrfcheck must be kept to the value 0 into conf.php (this is the default value) * $dolibarr_main_force_https must be set to something else than 0. -* The constant MAIN_SECURITY_CSRF_WITH_TOKEN must be set to 1 into backoffice menu Home - Setup - Other (this protection should be set to 1 soon by default) +* The constant MAIN_SECURITY_CSRF_WITH_TOKEN must be set to 2 into backoffice menu Home - Setup - Other (this protection should be set to 2 soon by default) * The module DebugBar and ModuleBuilder must NOT be enabled (by default, these modules are not enabled. They are developer tools) * ONLY security reports on modules provided by default and with the "stable" status are valid (troubles into "experimental", "developement" or external modules are not valid vulnerabilities). * The root of web server must link to htdocs and the documents directory must be outside of the web server root (this is the default when using the default installer but may differs with external installer). From bf9f007c98f4526e4b2ba070bc914d72fb98facf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 19 Sep 2021 14:53:09 +0200 Subject: [PATCH 0360/1460] Fix MAIN_SECURITY_CSRF_WITH_TOKEN = 2 --- SECURITY.md | 2 +- htdocs/main.inc.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index d27749eb203..61f4a392db8 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -54,7 +54,7 @@ ONLY vulnerabilities discovered, when the following setup on test platform is us * $dolibarr_main_prod must be set to 1 into conf.php * $dolibarr_nocsrfcheck must be kept to the value 0 into conf.php (this is the default value) * $dolibarr_main_force_https must be set to something else than 0. -* The constant MAIN_SECURITY_CSRF_WITH_TOKEN must be set to 1 into backoffice menu Home - Setup - Other (this protection should be set to 1 soon by default) +* The constant MAIN_SECURITY_CSRF_WITH_TOKEN must be set to 2 into backoffice menu Home - Setup - Other (this protection should be set to 2 soon by default) * The module DebugBar and ModuleBuilder must NOT be enabled (by default, these modules are not enabled. They are developer tools) * ONLY security reports on modules provided by default and with the "stable" status are valid (troubles into "experimental", "developement" or external modules are not valid vulnerabilities). * The root of web server must link to htdocs and the documents directory must be outside of the web server root (this is the default when using the default installer but may differs with external installer). diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 433c168b7f2..8070a1b3526 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -463,7 +463,7 @@ if (!defined('NOTOKENRENEWAL') && !defined('NOSESSION')) { if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN')) || defined('CSRFCHECK_WITH_TOKEN')) { // Array of action code where CSRFCHECK with token will be forced (so token must be provided on url request) $sensitiveget = false; - if (getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN') == 2) { + if ((GETPOSTISSET('massaction') || GETPOST('action', 'aZ09')) && getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN') == 2) { $sensitiveget = true; } else { $arrayofactiontoforcetokencheck = array( From 5631e8cc152c4849e5a3a4717be6fb3372ef27fd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 19 Sep 2021 15:01:57 +0200 Subject: [PATCH 0361/1460] css --- htdocs/admin/translation.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index 8b5c05b7bda..2327abd549e 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -463,6 +463,8 @@ if ($mode == 'searchkey') { } print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, -1 * $nbtotalofrecords, '', 0, '', '', $limit, 0, 0, 1); + $massactionbutton = ''; + print ''; print ''; @@ -499,7 +501,7 @@ if ($mode == 'searchkey') { //} print ''; // Action column - print ''; + print ''; $searchpicto = $form->showFilterAndCheckAddButtons(!empty($massactionbutton) ? 1 : 0, 'checkforselect', 1); print $searchpicto; print ''; From 1d597e8a726289c07022e26457c34862ebb2d2cf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 19 Sep 2021 18:03:38 +0200 Subject: [PATCH 0362/1460] Fix add unset* action as sensible GET actions --- htdocs/admin/agenda_other.php | 2 +- htdocs/admin/agenda_reminder.php | 4 ++-- htdocs/admin/bank.php | 8 ++++---- htdocs/admin/barcode.php | 4 ++-- htdocs/admin/bom.php | 4 ++-- htdocs/admin/commande.php | 14 ++++++------- htdocs/admin/contract.php | 2 +- htdocs/admin/defaultvalues.php | 4 ++-- htdocs/admin/delivery.php | 4 ++-- htdocs/admin/expedition.php | 2 +- htdocs/admin/expensereport.php | 4 ++-- htdocs/admin/facture.php | 2 +- htdocs/admin/fichinter.php | 4 ++-- htdocs/admin/holiday.php | 20 +++++++++---------- htdocs/admin/ldap.php | 2 +- htdocs/admin/ldap_contacts.php | 2 +- htdocs/admin/ldap_groups.php | 2 +- htdocs/admin/ldap_members.php | 2 +- htdocs/admin/ldap_members_types.php | 2 +- htdocs/admin/ldap_users.php | 2 +- htdocs/admin/modules.php | 2 +- htdocs/admin/mrp.php | 4 ++-- htdocs/admin/paymentbybanktransfer.php | 4 ++-- htdocs/admin/prelevement.php | 2 +- htdocs/admin/propal.php | 8 ++++---- htdocs/admin/reception_setup.php | 4 ++-- htdocs/admin/security.php | 2 +- htdocs/admin/spip.php | 2 +- htdocs/admin/stock.php | 2 +- htdocs/admin/supplier_invoice.php | 6 +++--- htdocs/admin/supplier_order.php | 8 ++++---- htdocs/admin/supplier_payment.php | 6 +++--- htdocs/admin/supplier_proposal.php | 8 ++++---- htdocs/admin/user.php | 6 +++--- htdocs/admin/usergroup.php | 2 +- htdocs/bom/bom_card.php | 2 +- htdocs/comm/mailing/card.php | 10 +++++----- htdocs/contact/card.php | 2 +- htdocs/contact/list.php | 2 +- .../modules/printing/printgcp.modules.php | 2 +- .../modules/printing/printipp.modules.php | 2 +- .../product_batch/mod_lot_advanced.php | 4 ++-- .../modules/product_batch/mod_sn_advanced.php | 4 ++-- htdocs/don/admin/donation.php | 6 +++--- htdocs/install/step2.php | 2 +- htdocs/main.inc.php | 4 +++- htdocs/margin/admin/margin.php | 4 ++-- htdocs/modulebuilder/template/admin/setup.php | 4 ++-- htdocs/printing/admin/printing.php | 8 ++++---- htdocs/product/admin/product.php | 8 ++++---- htdocs/product/admin/product_lot.php | 4 ++-- htdocs/projet/admin/project.php | 8 ++++---- htdocs/recruitment/admin/setup.php | 4 ++-- .../recruitment/admin/setup_candidatures.php | 4 ++-- htdocs/societe/admin/societe.php | 6 +++--- htdocs/societe/list.php | 2 +- htdocs/takepos/admin/setup.php | 2 +- 57 files changed, 126 insertions(+), 124 deletions(-) diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index 252008fb877..8060398574c 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -278,7 +278,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { if ($conf->global->ACTION_EVENT_ADDON_PDF == "$name") { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'&type=action"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'&type=action"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/agenda_reminder.php b/htdocs/admin/agenda_reminder.php index ac968778ffc..1d8cd8f723c 100644 --- a/htdocs/admin/agenda_reminder.php +++ b/htdocs/admin/agenda_reminder.php @@ -174,7 +174,7 @@ if (empty($conf->global->AGENDA_REMINDER_BROWSER)) { $langs->load("errors"); print img_warning($langs->trans("WarningAvailableOnlyForHTTPSServers"), '', 'valignmiddle size15x').' '; } - print ''.img_picto($langs->trans('Disabled'), 'switch_off').''; + print ''.img_picto($langs->trans('Disabled'), 'switch_off').''; print ''."\n"; } else { if (!isHTTPS()) { @@ -221,7 +221,7 @@ if (empty($conf->cron->enabled)) { print ''.$langs->trans("WarningModuleNotActive", $langs->transnoentitiesnoconv("Module2300Name")).''; } else { if (empty($conf->global->AGENDA_REMINDER_EMAIL)) { - print ''.img_picto($langs->trans('Disabled'), 'switch_off').''; + print ''.img_picto($langs->trans('Disabled'), 'switch_off').''; } else { // Get the max frequency of reminder if ($job->id > 0) { diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index 4e79d3ee276..6580db4e8f3 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -258,7 +258,7 @@ while ($i < $nbofbank) { print img_picto($langs->trans("Activated"), 'on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'off'); print ''; } @@ -369,7 +369,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->BANKADDON_PDF == $name) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -428,13 +428,13 @@ print ""; // Active if ($conf->global->BANK_COLORIZE_MOVEMENT) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index b0eb36d81ac..de05203f5f6 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -374,11 +374,11 @@ if ($conf->product->enabled) { print ''.$modBarCode->getExample($langs)."\n"; if ($conf->global->BARCODE_PRODUCT_ADDON_NUM == "$file") { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } diff --git a/htdocs/admin/bom.php b/htdocs/admin/bom.php index 35cf6b3e8a4..a36c3698306 100644 --- a/htdocs/admin/bom.php +++ b/htdocs/admin/bom.php @@ -235,7 +235,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->BOM_ADDON == $file) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -377,7 +377,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->BOM_ADDON_PDF == $name) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 23d7020e370..1e977fb48df 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -299,7 +299,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->COMMANDE_ADDON == $file) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -655,10 +655,10 @@ print ''.$langs->trans("ShippableOrderIconInList").''; print ' '; print ''; if (!empty($conf->global->SHIPPABLE_ORDER_ICON_IN_LIST)) { - print ''; + print ''; print img_picto($langs->trans("Activated"),'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"),'switch_off'); } print ''; @@ -676,9 +676,9 @@ if ($conf->banque->enabled) { print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_ORDER'); } else { if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER)) { - print ''.img_picto($langs->trans("Disabled"),'switch_off').''; + print ''.img_picto($langs->trans("Disabled"),'switch_off').''; } else { - print ''.img_picto($langs->trans("Enabled"),'switch_on').''; + print ''.img_picto($langs->trans("Enabled"),'switch_on').''; } } print ''; @@ -696,9 +696,9 @@ if ($conf->stock->enabled) { print ajax_constantonoff('WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER'); } else { if (empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) { - print ''.img_picto($langs->trans("Disabled"),'switch_off').''; + print ''.img_picto($langs->trans("Disabled"),'switch_off').''; } else { - print ''.img_picto($langs->trans("Enabled"),'switch_on').''; + print ''.img_picto($langs->trans("Enabled"),'switch_on').''; } } print ''; diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index 7854924c090..1c6a0ec0458 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -230,7 +230,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->CONTRACT_ADDON == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } diff --git a/htdocs/admin/defaultvalues.php b/htdocs/admin/defaultvalues.php index e74a8df069c..026a4315c83 100644 --- a/htdocs/admin/defaultvalues.php +++ b/htdocs/admin/defaultvalues.php @@ -206,12 +206,12 @@ $param = '&mode='.$mode; $enabledisablehtml = $langs->trans("EnableDefaultValues").' '; if (empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES)) { // Button off, click to enable - $enabledisablehtml .= ''; + $enabledisablehtml .= ''; $enabledisablehtml .= img_picto($langs->trans("Disabled"), 'switch_off'); $enabledisablehtml .= ''; } else { // Button on, click to disable - $enabledisablehtml .= ''; + $enabledisablehtml .= ''; $enabledisablehtml .= img_picto($langs->trans("Activated"), 'switch_on'); $enabledisablehtml .= ''; } diff --git a/htdocs/admin/delivery.php b/htdocs/admin/delivery.php index 68a18aa0f6a..8e60b02a5bf 100644 --- a/htdocs/admin/delivery.php +++ b/htdocs/admin/delivery.php @@ -235,7 +235,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->DELIVERY_ADDON_NUMBER == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -372,7 +372,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->DELIVERY_ADDON_PDF == "$name") { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index 777767a823e..2d4736cc49d 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -229,7 +229,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->EXPEDITION_ADDON_NUMBER == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print 'scandir.'&label='.urlencode($module->name).'">'; + print 'scandir).'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index 70bbc6f2b07..f7c9a84c5d1 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -238,7 +238,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->EXPENSEREPORT_ADDON == $file) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -373,7 +373,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->EXPENSEREPORT_ADDON_PDF == "$name") { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index a9f1e97ffab..ae269492ddf 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -516,7 +516,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->FACTURE_ADDON_PDF == "$name") { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("SetAsDefault"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("SetAsDefault"), 'off').''; } print ''; diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index cdc3d139515..4369bb9a2a7 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -294,7 +294,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->FICHEINTER_ADDON == $classname) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -434,7 +434,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->FICHEINTER_ADDON_PDF == "$name") { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php index 00d82f68035..55d19a7ea6c 100644 --- a/htdocs/admin/holiday.php +++ b/htdocs/admin/holiday.php @@ -230,7 +230,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->HOLIDAY_ADDON == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -374,7 +374,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { if ($conf->global->HOLIDAY_ADDON_PDF == $name) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -466,9 +466,9 @@ if ($conf->use_javascript_ajax) { print ajax_constantonoff('MAIN_NON_WORKING_DAYS_INCLUDE_MONDAY', array(), null, 0); } else { if (!empty($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_MONDAY)) { - print ''.img_picto($langs->trans("Enabled"), 'on').''; + print ''.img_picto($langs->trans("Enabled"), 'on').''; } else { - print ''.img_picto($langs->trans("Disabled"), 'off').''; + print ''.img_picto($langs->trans("Disabled"), 'off').''; } } print ""; @@ -482,9 +482,9 @@ if ($conf->use_javascript_ajax) { print ajax_constantonoff('MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY', array(), null, 0); } else { if (!empty($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY)) { - print ''.img_picto($langs->trans("Enabled"), 'on').''; + print ''.img_picto($langs->trans("Enabled"), 'on').''; } else { - print ''.img_picto($langs->trans("Disabled"), 'off').''; + print ''.img_picto($langs->trans("Disabled"), 'off').''; } } print ""; @@ -498,9 +498,9 @@ if ($conf->use_javascript_ajax) { print ajax_constantonoff('MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY', array(), null, 0, 0, 0, 2, 0, 1); } else { if (!empty($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY)) { - print ''.img_picto($langs->trans("Enabled"), 'on').''; + print ''.img_picto($langs->trans("Enabled"), 'on').''; } else { - print ''.img_picto($langs->trans("Disabled"), 'off').''; + print ''.img_picto($langs->trans("Disabled"), 'off').''; } } print ""; @@ -514,9 +514,9 @@ if ($conf->use_javascript_ajax) { print ajax_constantonoff('MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY', array(), null, 0, 0, 0, 2, 0, 1); } else { if (!empty($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY)) { - print ''.img_picto($langs->trans("Enabled"), 'on').''; + print ''.img_picto($langs->trans("Enabled"), 'on').''; } else { - print ''.img_picto($langs->trans("Disabled"), 'off').''; + print ''.img_picto($langs->trans("Disabled"), 'off').''; } } print ""; diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php index 1a274f8cec1..737aa7e1940 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -131,7 +131,7 @@ if (!function_exists("ldap_connect")) { $form = new Form($db); -print '
'; +print ''; print ''; print dol_get_fiche_head($head, 'ldap', $langs->trans("LDAPSetup"), -1); diff --git a/htdocs/admin/ldap_contacts.php b/htdocs/admin/ldap_contacts.php index d68726c5125..b51843e1509 100644 --- a/htdocs/admin/ldap_contacts.php +++ b/htdocs/admin/ldap_contacts.php @@ -145,7 +145,7 @@ print dol_get_fiche_head($head, 'contacts', $langs->trans("LDAPSetup"), -1); print $langs->trans("LDAPDescContact").'
'; print '
'; -print ''; +print ''; print ''; print ''; diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php index 91fba4e3519..14718303f67 100644 --- a/htdocs/admin/ldap_groups.php +++ b/htdocs/admin/ldap_groups.php @@ -120,7 +120,7 @@ print $langs->trans("LDAPDescGroups").'
'; print '
'; -print ''; +print ''; print ''; print '
'; diff --git a/htdocs/admin/ldap_members.php b/htdocs/admin/ldap_members.php index 3fb65f730c6..44ed5f5dc25 100644 --- a/htdocs/admin/ldap_members.php +++ b/htdocs/admin/ldap_members.php @@ -184,7 +184,7 @@ if (!function_exists("ldap_connect")) { setEventMessages($langs->trans("LDAPFunctionsNotAvailableOnPHP"), null, 'errors'); } -print ''; +print ''; print ''; print dol_get_fiche_head($head, 'members', $langs->trans("LDAPSetup"), -1); diff --git a/htdocs/admin/ldap_members_types.php b/htdocs/admin/ldap_members_types.php index 777bc80c6e1..a812f98a5e7 100644 --- a/htdocs/admin/ldap_members_types.php +++ b/htdocs/admin/ldap_members_types.php @@ -112,7 +112,7 @@ print $langs->trans("LDAPDescMembersTypes").'
'; print '
'; -print ''; +print ''; print ''; $form = new Form($db); diff --git a/htdocs/admin/ldap_users.php b/htdocs/admin/ldap_users.php index ab6c0f52121..dbdd61b9913 100644 --- a/htdocs/admin/ldap_users.php +++ b/htdocs/admin/ldap_users.php @@ -173,7 +173,7 @@ if (!function_exists("ldap_connect")) { } -print ''; +print ''; print ''; diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index ccf12d5a104..253ee32e581 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -878,7 +878,7 @@ if ($mode == 'common' || $mode == 'commonkanban') { } } $codeenabledisable .= ''."\n"; - $codeenabledisable .= 'global->MRP_MO_ADDON == $file) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -374,7 +374,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->MRP_MO_ADDON_PDF == $name) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/paymentbybanktransfer.php b/htdocs/admin/paymentbybanktransfer.php index 04e1488fedc..ba7690bb6e3 100644 --- a/htdocs/admin/paymentbybanktransfer.php +++ b/htdocs/admin/paymentbybanktransfer.php @@ -144,7 +144,7 @@ $linkback = ''; -print ''; +print ''; print ''; print '
'; @@ -318,7 +318,7 @@ foreach ($dirmodels as $reldir) } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; } print ''; diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 2e266f833ea..90a75626e7c 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -332,7 +332,7 @@ foreach ($dirmodels as $reldir) } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; } print ''; diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index 88df6b0da05..22ce045a7ab 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -278,7 +278,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->PROPALE_ADDON == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -417,7 +417,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->PROPALE_ADDON_PDF == "$name") { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -658,11 +658,11 @@ if ($conf->banque->enabled) { if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL)) { - print ''.img_picto($langs->trans("Disabled"),'switch_off').''; + print ''.img_picto($langs->trans("Disabled"),'switch_off').''; } else { - print ''.img_picto($langs->trans("Enabled"),'switch_on').''; + print ''.img_picto($langs->trans("Enabled"),'switch_on').''; } } print ''; diff --git a/htdocs/admin/reception_setup.php b/htdocs/admin/reception_setup.php index c364911ab51..218cc1ef853 100644 --- a/htdocs/admin/reception_setup.php +++ b/htdocs/admin/reception_setup.php @@ -235,7 +235,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->RECEPTION_ADDON_NUMBER == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print 'scandir.'&label='.urlencode($module->name).'">'; + print 'scandir.'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -378,7 +378,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->RECEPTION_ADDON_PDF == $name) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index a86ca272b85..b3204d594e0 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -260,7 +260,7 @@ foreach ($arrayhandler as $key => $module) { //print img_picto('', 'tick'); print img_picto($langs->trans("Enabled"), 'switch_on'); } else { - print ''; + print ''; //print $langs->trans("Activate"); print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; diff --git a/htdocs/admin/spip.php b/htdocs/admin/spip.php index 8f267e9eb1c..92dba301854 100644 --- a/htdocs/admin/spip.php +++ b/htdocs/admin/spip.php @@ -149,7 +149,7 @@ if (!empty($conf->global->ADHERENT_USE_SPIP)) { } else { print dol_get_fiche_head($head, 'spip', $langs->trans("Setup"), 0, 'user'); - $link = ''; + $link = ''; //$link.=$langs->trans("Activate"); $link .= img_picto($langs->trans("Disabled"), 'switch_off'); $link .= ''; diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index d8d6a883d88..2f357b2d5fc 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -580,7 +580,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->STOCK_ADDON_PDF == $name) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index ec5a3e087cf..40fe58f68d6 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -256,7 +256,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->INVOICE_SUPPLIER_ADDON_NUMBER == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -395,9 +395,9 @@ foreach ($dirmodels as $reldir) { if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF == "$name") { //print img_picto($langs->trans("Default"),'on'); // Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all - print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').''; + print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').''; } else { - print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index 0efa365a33f..00b5fbfdb8e 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -269,7 +269,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->COMMANDE_SUPPLIER_ADDON_NUMBER == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -399,7 +399,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF == "$name") { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'&type=order_supplier" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -472,11 +472,11 @@ if ($conf->banque->enabled) { if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER)) { - print ''.img_picto($langs->trans("Disabled"),'switch_off').''; + print ''.img_picto($langs->trans("Disabled"),'switch_off').''; } else { - print ''.img_picto($langs->trans("Enabled"),'switch_on').''; + print ''.img_picto($langs->trans("Enabled"),'switch_on').''; } } print ''; diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php index 15210f89360..ce2c9f0f872 100644 --- a/htdocs/admin/supplier_payment.php +++ b/htdocs/admin/supplier_payment.php @@ -372,7 +372,7 @@ foreach ($dirmodels as $reldir) { print ""; } else { print '"; } @@ -381,9 +381,9 @@ foreach ($dirmodels as $reldir) { if ($conf->global->SUPPLIER_PAYMENT_ADDON_PDF == "$name") { //print img_picto($langs->trans("Default"),'on'); // Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all - print 'scandir.'&label='.urlencode($module->name).'&type=SUPPLIER_PAYMENT"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').''; + print 'scandir).'&label='.urlencode($module->name).'&type=SUPPLIER_PAYMENT"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').''; } else { - print 'scandir.'&label='.urlencode($module->name).'&type=SUPPLIER_PAYMENT"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'&type=SUPPLIER_PAYMENT"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php index 1585b66b1e1..6e3f190aeb6 100644 --- a/htdocs/admin/supplier_proposal.php +++ b/htdocs/admin/supplier_proposal.php @@ -257,7 +257,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->SUPPLIER_PROPOSAL_ADDON == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -395,7 +395,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->SUPPLIER_PROPOSAL_ADDON_PDF == "$name") { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -503,9 +503,9 @@ if ($conf->banque->enabled) { print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL'); } else { if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL)) { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } else { - print ''.img_picto($langs->trans("Enabled"), 'switch_on').''; + print ''.img_picto($langs->trans("Enabled"), 'switch_on').''; } } print ''; diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php index 391a456439c..85ab0f0e9a8 100644 --- a/htdocs/admin/user.php +++ b/htdocs/admin/user.php @@ -165,9 +165,9 @@ if ($conf->use_javascript_ajax) { print ajax_constantonoff('USER_HIDE_INACTIVE_IN_COMBOBOX'); } else { if (empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX)) { - print ''.img_picto($langs->trans("Disabled"), 'off').''; + print ''.img_picto($langs->trans("Disabled"), 'off').''; } else { - print ''.img_picto($langs->trans("Enabled"), 'on').''; + print ''.img_picto($langs->trans("Enabled"), 'on').''; } } print ''; @@ -271,7 +271,7 @@ foreach ($dirmodels as $reldir) { if (getDolGlobalString('USER_ADDON_PDF_ODT') == $name) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/usergroup.php b/htdocs/admin/usergroup.php index 9846389f87a..3319ab994a6 100644 --- a/htdocs/admin/usergroup.php +++ b/htdocs/admin/usergroup.php @@ -203,7 +203,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->USERGROUP_ADDON_PDF == $name) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index f24cf3f80d3..ec7ee47c6be 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -596,7 +596,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Modify if ($object->status == $object::STATUS_DRAFT) { if ($permissiontoadd) { - print ''.$langs->trans("Modify").''."\n"; + print ''.$langs->trans("Modify").''."\n"; } else { print ''.$langs->trans('Modify').''."\n"; } diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 0a28346a130..dbfbc84b69f 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -952,18 +952,18 @@ if ($action == 'create') { print "\n\n
\n"; if (($object->statut == 1) && ($user->rights->mailing->valider || $object->fk_user_valid == $user->id)) { - print ''.$langs->trans("SetToDraft").''; + print ''.$langs->trans("SetToDraft").''; } if (($object->statut == 0 || $object->statut == 1 || $object->statut == 2) && $user->rights->mailing->creer) { if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_MAILING)) { - print ''.$langs->trans("EditWithEditor").''; + print ''.$langs->trans("EditWithEditor").''; } else { - print ''.$langs->trans("EditWithTextEditor").''; + print ''.$langs->trans("EditWithTextEditor").''; } if (!empty($conf->use_javascript_ajax)) { - print ''.$langs->trans("EditHTMLSource").''; + print ''.$langs->trans("EditHTMLSource").''; } } @@ -972,7 +972,7 @@ if ($action == 'create') { if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !$user->rights->mailing->mailing_advance->send) { print ''.$langs->trans("TestMailing").''; } else { - print ''.$langs->trans("TestMailing").''; + print ''.$langs->trans("TestMailing").''; } if ($object->statut == 0) { diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 1941d7e31d6..835e7f0cafb 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -1371,7 +1371,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $titlealt = $val['label']; } if ($object->stcomm_id != $val['id']) { - print ''.img_action($titlealt, $val['code'], $val['picto']).''; + print ''.img_action($titlealt, $val['code'], $val['picto']).''; } } print '
'; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 26624b1bf10..bae32e8b3b1 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -1216,7 +1216,7 @@ while ($i < min($num, $limit)) { $titlealt = $val['label']; } if ($obj->stcomm_id != $val['id']) { - print ''.img_action($titlealt, $val['code'], $val['picto']).''; + print ''.img_action($titlealt, $val['code'], $val['picto']).''; } } print ''; diff --git a/htdocs/core/modules/printing/printgcp.modules.php b/htdocs/core/modules/printing/printgcp.modules.php index ec53b523336..226ed6c43cd 100644 --- a/htdocs/core/modules/printing/printgcp.modules.php +++ b/htdocs/core/modules/printing/printgcp.modules.php @@ -237,7 +237,7 @@ class printing_printgcp extends PrintingDriver if ($conf->global->PRINTING_GCP_DEFAULT == $printer_det['id']) { $html .= img_picto($langs->trans("Default"), 'on'); } else { - $html .= ''.img_picto($langs->trans("Disabled"), 'off').''; + $html .= ''.img_picto($langs->trans("Disabled"), 'off').''; } $html .= ''; $html .= ''."\n"; diff --git a/htdocs/core/modules/printing/printipp.modules.php b/htdocs/core/modules/printing/printipp.modules.php index 0d824d2c7c0..f290b2b4e90 100644 --- a/htdocs/core/modules/printing/printipp.modules.php +++ b/htdocs/core/modules/printing/printipp.modules.php @@ -233,7 +233,7 @@ class printing_printipp extends PrintingDriver if ($conf->global->PRINTIPP_URI_DEFAULT == $value) { $html .= img_picto($langs->trans("Default"), 'on'); } else { - $html .= ''.img_picto($langs->trans("Disabled"), 'off').''; + $html .= ''.img_picto($langs->trans("Disabled"), 'off').''; } $html .= ''; $html .= ''."\n"; diff --git a/htdocs/core/modules/product_batch/mod_lot_advanced.php b/htdocs/core/modules/product_batch/mod_lot_advanced.php index 0e920483508..d44a261a16b 100644 --- a/htdocs/core/modules/product_batch/mod_lot_advanced.php +++ b/htdocs/core/modules/product_batch/mod_lot_advanced.php @@ -87,9 +87,9 @@ class mod_lot_advanced extends ModeleNumRefBatch // Option to enable custom masks per product $texte .= ''; diff --git a/htdocs/core/modules/product_batch/mod_sn_advanced.php b/htdocs/core/modules/product_batch/mod_sn_advanced.php index ca24a67c781..5e8fde199c1 100644 --- a/htdocs/core/modules/product_batch/mod_sn_advanced.php +++ b/htdocs/core/modules/product_batch/mod_sn_advanced.php @@ -87,9 +87,9 @@ class mod_sn_advanced extends ModeleNumRefBatch // Option to enable custom masks per product $texte .= ''; diff --git a/htdocs/don/admin/donation.php b/htdocs/don/admin/donation.php index d8b06285be4..c56effea73a 100644 --- a/htdocs/don/admin/donation.php +++ b/htdocs/don/admin/donation.php @@ -251,12 +251,12 @@ if (is_resource($handle)) { print ''; } else { print "'; } } else { print ""; } @@ -267,7 +267,7 @@ if (is_resource($handle)) { print ''; } else { print "'; } diff --git a/htdocs/install/step2.php b/htdocs/install/step2.php index f95cb218561..1835c87f759 100644 --- a/htdocs/install/step2.php +++ b/htdocs/install/step2.php @@ -141,7 +141,7 @@ if ($action == "set") { $requestnb = 0; // To disable some code, so you can call step2 with url like - // http://localhost/dolibarrnew/install/step2.php?action=set&createtables=0&createkeys=0&createfunctions=0&createdata=llx_20_c_departements + // http://localhost/dolibarrnew/install/step2.php?action=set&token='.newToken().'&createtables=0&createkeys=0&createfunctions=0&createdata=llx_20_c_departements $createtables = isset($_GET['createtables']) ?GETPOST('createtables') : 1; $createkeys = isset($_GET['createkeys']) ?GETPOST('createkeys') : 1; $createfunctions = isset($_GET['createfunctions']) ?GETPOST('createfunction') : 1; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 8070a1b3526..bea9500bd0f 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -464,8 +464,10 @@ if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && getDolGlobalInt( // Array of action code where CSRFCHECK with token will be forced (so token must be provided on url request) $sensitiveget = false; if ((GETPOSTISSET('massaction') || GETPOST('action', 'aZ09')) && getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN') == 2) { + // All GET actions and mass actions are processed as sensitive. $sensitiveget = true; } else { + // Only GET actions coded with a &token into url are processed as sensitive. $arrayofactiontoforcetokencheck = array( 'activate', 'add', 'addrights', 'addtimespent', 'doprev', 'donext', 'dvprev', 'dvnext', @@ -475,7 +477,7 @@ if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && getDolGlobalInt( if (in_array(GETPOST('action', 'aZ09'), $arrayofactiontoforcetokencheck)) { $sensitiveget = true; } - if (preg_match('/^(classify|close|confirm|del|disable|enable|remove|set|update)/', GETPOST('action', 'aZ09'))) { + if (preg_match('/^(classify|close|confirm|del|disable|enable|remove|set|unset|update)/', GETPOST('action', 'aZ09'))) { $sensitiveget = true; } } diff --git a/htdocs/margin/admin/margin.php b/htdocs/margin/admin/margin.php index 588773ef50c..30c85197337 100644 --- a/htdocs/margin/admin/margin.php +++ b/htdocs/margin/admin/margin.php @@ -189,9 +189,9 @@ if (!empty($conf->use_javascript_ajax)) { print ajax_constantonoff('ForceBuyingPriceIfNull'); } else { if (empty($conf->global->ForceBuyingPriceIfNull)) { - print ''.img_picto($langs->trans("Disabled"), 'off').''; + print ''.img_picto($langs->trans("Disabled"), 'off').''; } else { - print ''.img_picto($langs->trans("Enabled"), 'on').''; + print ''.img_picto($langs->trans("Enabled"), 'on').''; } } print ''; diff --git a/htdocs/modulebuilder/template/admin/setup.php b/htdocs/modulebuilder/template/admin/setup.php index 6d7497b7780..d0d4a404dcf 100644 --- a/htdocs/modulebuilder/template/admin/setup.php +++ b/htdocs/modulebuilder/template/admin/setup.php @@ -614,9 +614,9 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { 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 'scandir.'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').''; + print 'scandir).'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').''; } else { - print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/printing/admin/printing.php b/htdocs/printing/admin/printing.php index 2b86efa507c..a0849f082e8 100644 --- a/htdocs/printing/admin/printing.php +++ b/htdocs/printing/admin/printing.php @@ -274,13 +274,13 @@ if ($mode == 'config' && $user->admin) { print ajax_constantonoff($printer->active); } else { if (empty($conf->global->{$printer->conf})) { - print ''.img_picto($langs->trans("Disabled"), 'off').''; + print ''.img_picto($langs->trans("Disabled"), 'off').''; } else { - print ''.img_picto($langs->trans("Enabled"), 'on').''; + print ''.img_picto($langs->trans("Enabled"), 'on').''; } } - print ''; - print ''; + print ''; + print ''; print ''."\n"; } diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index 199f2a04f03..4f6094e1787 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -346,7 +346,7 @@ foreach ($dirproduct as $dirroot) { } print ''; @@ -762,10 +762,10 @@ if (!empty($conf->global->PRODUCT_CANVAS_ABILITY)) { if ($conf->global->$const) { print img_picto($langs->trans("Active"), 'tick'); print ''; diff --git a/htdocs/product/admin/product_lot.php b/htdocs/product/admin/product_lot.php index 3f4fd636de4..24f515fa0bc 100644 --- a/htdocs/product/admin/product_lot.php +++ b/htdocs/product/admin/product_lot.php @@ -161,7 +161,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL < 2) { if ($conf->global->PRODUCTBATCH_LOT_ADDON == $file) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -253,7 +253,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL < 2) { if ($conf->global->PRODUCTBATCH_SN_ADDON == $file) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } diff --git a/htdocs/projet/admin/project.php b/htdocs/projet/admin/project.php index 0ce2a38a471..adef0826992 100644 --- a/htdocs/projet/admin/project.php +++ b/htdocs/projet/admin/project.php @@ -347,7 +347,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->PROJECT_ADDON == 'mod_'.$classname) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -443,7 +443,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS)) { if ($conf->global->PROJECT_TASK_ADDON == 'mod_'.$classname) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -579,7 +579,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->PROJECT_ADDON_PDF == "$name") { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -719,7 +719,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS)) { if ($conf->global->PROJECT_TASK_ADDON_PDF == "$name") { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/recruitment/admin/setup.php b/htdocs/recruitment/admin/setup.php index 6b6dd050820..3f71b0397a1 100644 --- a/htdocs/recruitment/admin/setup.php +++ b/htdocs/recruitment/admin/setup.php @@ -475,9 +475,9 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { 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 'scandir.'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').''; + print 'scandir).'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').''; } else { - print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/recruitment/admin/setup_candidatures.php b/htdocs/recruitment/admin/setup_candidatures.php index b2189954bf4..9c30f0d1ccf 100644 --- a/htdocs/recruitment/admin/setup_candidatures.php +++ b/htdocs/recruitment/admin/setup_candidatures.php @@ -473,9 +473,9 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { 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 'scandir.'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').''; + print 'scandir).'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').''; } else { - print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index 8b4975a5592..29f8d0b175d 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -391,7 +391,7 @@ foreach ($arrayofmodules as $file => $modCodeTiers) { $disabled = (!empty($conf->multicompany->enabled) && (is_object($mc) && !empty($mc->sharings['referent']) && $mc->sharings['referent'] != $conf->entity) ? true : false); print ''; } else { - print ''; } @@ -576,7 +576,7 @@ foreach ($dirsociete as $dirroot) { print ""; } else { print '"; } } diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index ca4793c2c60..bc786a540d6 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -1639,7 +1639,7 @@ while ($i < min($num, $limit)) { $titlealt = $val['label']; } if ($obj->stcomm_id != $val['id']) { - print ''.img_action($titlealt, $val['code'], $val['picto']).''; + print ''.img_action($titlealt, $val['code'], $val['picto']).''; } } print ''; diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php index e75321e263b..db3b28d0948 100644 --- a/htdocs/takepos/admin/setup.php +++ b/htdocs/takepos/admin/setup.php @@ -196,7 +196,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->TAKEPOS_REF_ADDON == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } From a747c71cf58482e51752280611a5f0d8677364af Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 19 Sep 2021 19:19:28 +0200 Subject: [PATCH 0363/1460] css --- htdocs/core/tpl/objectline_view.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index b50ca83c6f6..248059ba531 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -164,7 +164,7 @@ if (($line->info_bits & 2) == 2) { // Show date range if ($line->element == 'facturedetrec') { if ($line->date_start_fill || $line->date_end_fill) { - print '

'; + print '
'; } if ($line->date_start_fill) { print ''.$langs->trans('AutoFillDateFromShort').': '.yn($line->date_start_fill); From 14c8bdce1a8f03419a958a8508268941df710c10 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 19 Sep 2021 19:25:38 +0200 Subject: [PATCH 0364/1460] Better desciption of option --- htdocs/core/tpl/objectline_view.tpl.php | 4 ++-- htdocs/langs/en_US/admin.lang | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 248059ba531..ad27dae210c 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -164,7 +164,7 @@ if (($line->info_bits & 2) == 2) { // Show date range if ($line->element == 'facturedetrec') { if ($line->date_start_fill || $line->date_end_fill) { - print '
'; + print '
'; } if ($line->date_start_fill) { print ''.$langs->trans('AutoFillDateFromShort').': '.yn($line->date_start_fill); @@ -180,7 +180,7 @@ if (($line->info_bits & 2) == 2) { } } else { if ($line->date_start || $line->date_end) { - print '
'.get_date_range($line->date_start, $line->date_end, $format).'
'; + print '
'.get_date_range($line->date_start, $line->date_end, $format).'
'; } //print get_date_range($line->date_start, $line->date_end, $format); } diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 26edb7f0518..a73f06e1201 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1626,8 +1626,7 @@ ProductSetup=Products module setup ServiceSetup=Services module setup ProductServiceSetup=Products and Services modules setup NumberOfProductShowInSelect=Maximum number of products to show in combo select lists (0=no limit) -ViewProductDescInFormAbility=Display product descriptions in forms (otherwise shown in a tooltip popup) -DoNotAddProductDescAtAddLines=Do not add product description (from product card) on submit add lines on forms +ViewProductDescInFormAbility=Display product descriptions in lines of items (otherwise show description in a tooltip popup) OnProductSelectAddProductDesc=How to use the description of the products when adding a product as a line of a document AutoFillFormFieldBeforeSubmit=Auto fill the description input field with the description of product DoNotAutofillButAutoConcat=Do not autofill the input field with description of product. Description of the product will be concatenated to the entered description automatically. From ee362a42bd5098a00c155521ff8a96202c1011ba Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 19 Sep 2021 21:06:09 +0200 Subject: [PATCH 0365/1460] css --- htdocs/bom/class/bom.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 19938a049a9..b57aaf158fd 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -98,7 +98,7 @@ class BOM extends CommonObject 'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=> 1, 'default'=>1, 'index'=>1, 'position'=>5), 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'noteditable'=>1, 'visible'=>4, 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of BOM", 'showoncombobox'=>'1',), 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'notnull'=>1, 'searchall'=>1, 'showoncombobox'=>'2', 'autofocusoncreate'=>1, 'css'=>'maxwidth300', 'csslist'=>'tdoverflowmax200'), - 'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>1, 'position'=>33, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing', 1=>'Disassemble'), 'css'=>'minwidth150', 'csslist'=>'minwidth150 center'), + 'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>1, 'position'=>33, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing', 1=>'Disassemble'), 'css'=>'minwidth175', 'csslist'=>'minwidth175 center'), //'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>-1, 'position'=>32, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing')), 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:1:(finished IS NULL or finished <> 0)', 'label'=>'Product', 'picto'=>'product', 'enabled'=>1, 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'help'=>'ProductBOMHelp', 'css'=>'maxwidth500', 'csslist'=>'tdoverflowmax100'), 'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>60, 'notnull'=>-1,), From 3dc32140479a74253276ecdeae3bc6361d2a2e0c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 19 Sep 2021 21:13:27 +0200 Subject: [PATCH 0366/1460] CSS --- htdocs/expedition/list.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index 50a59e0d2e4..27340df146c 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -402,16 +402,16 @@ if ($limit > 0 && $limit != $conf->liste_limit) { $param .= '&limit='.urlencode($limit); } if ($sall) { - $param .= "&sall=".urlencode($sall); + $param .= "&sall=".urlencode($sall); } if ($search_ref_exp) { - $param .= "&search_ref_exp=".urlencode($search_ref_exp); + $param .= "&search_ref_exp=".urlencode($search_ref_exp); } if ($search_ref_liv) { - $param .= "&search_ref_liv=".urlencode($search_ref_liv); + $param .= "&search_ref_liv=".urlencode($search_ref_liv); } if ($search_ref_customer) { - $param .= "&search_ref_customer=".urlencode($search_ref_customer); + $param .= "&search_ref_customer=".urlencode($search_ref_customer); } if ($search_user > 0) { $param .= '&search_user='.urlencode($search_user); @@ -420,10 +420,10 @@ if ($search_sale > 0) { $param .= '&search_sale='.urlencode($search_sale); } if ($search_company) { - $param .= "&search_company=".urlencode($search_company); + $param .= "&search_company=".urlencode($search_company); } if ($search_tracking) { - $param .= "&search_tracking=".urlencode($search_tracking); + $param .= "&search_tracking=".urlencode($search_tracking); } if ($search_town) { $param .= '&search_town='.urlencode($search_town); @@ -768,7 +768,7 @@ while ($i < min($num, $limit)) { // Ref if (!empty($arrayfields['e.ref']['checked'])) { - print "
\n"; if (!$i) { @@ -788,7 +788,7 @@ while ($i < min($num, $limit)) { // Third party if (!empty($arrayfields['s.nom']['checked'])) { - print ''; if (!$i) { From 6af9f3b142247f5e1f07c7dae13aabc2039b10cf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 19 Sep 2021 21:18:30 +0200 Subject: [PATCH 0367/1460] Fix css --- htdocs/expedition/list.php | 4 ++-- htdocs/reception/list.php | 36 ++++++++++++++++++------------------ 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index 27340df146c..3660b8a5cbe 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -806,7 +806,7 @@ while ($i < min($num, $limit)) { } // Zip if (!empty($arrayfields['s.zip']['checked'])) { - print ''; if (!$i) { @@ -815,7 +815,7 @@ while ($i < min($num, $limit)) { } // State if (!empty($arrayfields['state.nom']['checked'])) { - print "\n"; + print '\n"; if (!$i) { $totalarray['nbfield']++; } diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index 5b4bdf6bb6f..d14d2159ea3 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -573,43 +573,43 @@ if ($limit > 0 && $limit != $conf->liste_limit) { $param .= '&limit='.urlencode($limit); } if ($sall) { - $param .= "&sall=".urlencode($sall); + $param .= "&sall=".urlencode($sall); } if ($search_ref_rcp) { - $param .= "&search_ref_rcp=".urlencode($search_ref_rcp); + $param .= "&search_ref_rcp=".urlencode($search_ref_rcp); } if ($search_ref_liv) { - $param .= "&search_ref_liv=".urlencode($search_ref_liv); + $param .= "&search_ref_liv=".urlencode($search_ref_liv); } if ($search_company) { - $param .= "&search_company=".urlencode($search_company); + $param .= "&search_company=".urlencode($search_company); } if ($optioncss != '') { - $param .= '&optioncss='.urlencode($optioncss); + $param .= '&optioncss='.urlencode($optioncss); } if ($search_billed != '' && $search_billed >= 0) { - $param .= "&search_billed=".urlencode($search_billed); + $param .= "&search_billed=".urlencode($search_billed); } if ($search_town) { - $param .= "&search_town=".urlencode($search_town); + $param .= "&search_town=".urlencode($search_town); } if ($search_zip) { - $param .= "&search_zip=".urlencode($search_zip); + $param .= "&search_zip=".urlencode($search_zip); } if ($search_state) { - $param .= "&search_state=".urlencode($search_state); + $param .= "&search_state=".urlencode($search_state); } if ($search_status != '') { - $param .= "&search_status=".urlencode($search_status); + $param .= "&search_status=".urlencode($search_status); } if ($search_country) { - $param .= "&search_country=".urlencode($search_country); + $param .= "&search_country=".urlencode($search_country); } if ($search_type_thirdparty) { - $param .= "&search_type_thirdparty=".urlencode($search_type_thirdparty); + $param .= "&search_type_thirdparty=".urlencode($search_type_thirdparty); } if ($search_ref_supplier) { - $param .= "&search_ref_supplier=".urlencode($search_ref_supplier); + $param .= "&search_ref_supplier=".urlencode($search_ref_supplier); } // Add $param from extra fields foreach ($search_array_options as $key => $val) { @@ -885,7 +885,7 @@ while ($i < min($num, $limit)) { // Ref if (!empty($arrayfields['e.ref']['checked'])) { - print "'; if (!$i) { @@ -928,7 +928,7 @@ while ($i < min($num, $limit)) { } // Zip if (!empty($arrayfields['s.zip']['checked'])) { - print ''; if (!$i) { From 25971e373ddaaff83988463da3d990c68cbbf635 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 19 Sep 2021 21:20:12 +0200 Subject: [PATCH 0368/1460] Fix css --- htdocs/reception/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index d14d2159ea3..207e04428bc 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -900,7 +900,7 @@ while ($i < min($num, $limit)) { // Ref customer if (!empty($arrayfields['e.ref_supplier']['checked'])) { - print '\n"; if (!$i) { From b5a27b4c15eec694ab5eecdef53b2de5ebbcec19 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 19 Sep 2021 21:27:01 +0200 Subject: [PATCH 0369/1460] css --- htdocs/reception/list.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index 207e04428bc..624748ded8f 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -898,9 +898,9 @@ while ($i < min($num, $limit)) { } } - // Ref customer + // Ref supplier if (!empty($arrayfields['e.ref_supplier']['checked'])) { - print '\n"; if (!$i) { @@ -919,8 +919,8 @@ while ($i < min($num, $limit)) { } // Town if (!empty($arrayfields['s.town']['checked'])) { - print ''; if (!$i) { $totalarray['nbfield']++; @@ -929,7 +929,7 @@ while ($i < min($num, $limit)) { // Zip if (!empty($arrayfields['s.zip']['checked'])) { print ''; if (!$i) { $totalarray['nbfield']++; @@ -937,7 +937,7 @@ while ($i < min($num, $limit)) { } // State if (!empty($arrayfields['state.nom']['checked'])) { - print "\n"; + print "\n"; if (!$i) { $totalarray['nbfield']++; } @@ -946,7 +946,7 @@ while ($i < min($num, $limit)) { if (!empty($arrayfields['country.code_iso']['checked'])) { print ''; if (!$i) { $totalarray['nbfield']++; From 77e493755f14931f1f9b5b30471414a9bf6aefd8 Mon Sep 17 00:00:00 2001 From: javieralapps4up Date: Sun, 19 Sep 2021 22:26:49 +0200 Subject: [PATCH 0370/1460] Fix: #18760 bad rights admin if advanced perms Insufficient rights to view a group's card for admin users if advanced permissions are used --- htdocs/main.inc.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 1d975f5ab5a..b7b1462ad36 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1039,6 +1039,16 @@ if (!defined('NOLOGIN')) { $user->rights->user->user->supprimer = 1; $user->rights->user->self->creer = 1; $user->rights->user->self->password = 1; + + //Required if advanced permissions are used with MAIN_USE_ADVANCED_PERMS + $user->rights->user->user_advance->readperms = 1; + $user->rights->user->user_advance->write = 1; + $user->rights->user->self_advance->readperms = 1; + $user->rights->user->self_advance->writeperms = 1; + $user->rights->user->group_advance->read = 1; + $user->rights->user->group_advance->readperms = 1; + $user->rights->user->group_advance->write = 1; + $user->rights->user->group_advance->delete = 1; } /* From 1ea2182bf7522238076b56c2567bba06a6d6b77b Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sun, 19 Sep 2021 20:32:07 +0000 Subject: [PATCH 0371/1460] Fixing style errors. --- htdocs/main.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index b7b1462ad36..1af8595b780 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1039,7 +1039,7 @@ if (!defined('NOLOGIN')) { $user->rights->user->user->supprimer = 1; $user->rights->user->self->creer = 1; $user->rights->user->self->password = 1; - + //Required if advanced permissions are used with MAIN_USE_ADVANCED_PERMS $user->rights->user->user_advance->readperms = 1; $user->rights->user->user_advance->write = 1; From ce56f52a30cab429caa4eadc63a4cfee47f9a63b Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 20 Sep 2021 03:28:30 +0200 Subject: [PATCH 0372/1460] FIX #18698 Supplier invoice list - "alert" checkbox not working --- htdocs/fourn/class/fournisseur.facture.class.php | 2 +- htdocs/fourn/facture/list.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index fd393445187..4bca77809cb 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -2440,7 +2440,7 @@ class FactureFournisseur extends CommonInvoice if ($facturestatic->hasDelay()) { $response->nbtodolate++; - $response->url_late = DOL_URL_ROOT.'/fourn/facture/list.php?option=late&mainmenu=billing&leftmenu=suppliers_bills'; + $response->url_late = DOL_URL_ROOT.'/fourn/facture/list.php?search_option=late&mainmenu=billing&leftmenu=suppliers_bills'; } } $this->db->free($resql); diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 0d34a3790df..ac64a9af82e 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -119,7 +119,7 @@ $search_btn = GETPOST('button_search', 'alpha'); $search_remove_btn = GETPOST('button_removefilter', 'alpha'); $search_categ_sup = trim(GETPOST("search_categ_sup", 'int')); -$option = GETPOST('option'); +$option = GETPOST('search_option'); if ($option == 'late') { $search_status = '1'; } @@ -803,7 +803,7 @@ if ($resql) { $param .= '&show_files='.urlencode($show_files); } if ($option) { - $param .= "&option=".urlencode($option); + $param .= "&search_option=".urlencode($option); } if ($optioncss != '') { $param .= '&optioncss='.urlencode($optioncss); @@ -1428,9 +1428,9 @@ if ($resql) { // Date limit if (!empty($arrayfields['f.date_lim_reglement']['checked'])) { - print ''; if (!$i) { From 360e3290b56f6412066739ad27fd6f3b284088fc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Sep 2021 04:20:20 +0200 Subject: [PATCH 0373/1460] typo --- htdocs/core/modules/modFacture.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 2fadb5d86ae..ef341c83e89 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -142,7 +142,7 @@ class modFacture extends DolibarrModules 'objectname'=>'Facture', 'method'=>'sendEmailsRemindersOnInvoiceDueDate', 'parameters'=>"10,all,EmailTemplateCode", - 'comment'=>'Send an emails when the unpaid invoices reach a due date + n days = today. First param is the offset n of days, second parameter is "all" or a payment mode code, last paramater is the code of email template to use (an email template with EmailTemplateCode must exists. the version in the language of the thirdparty will be used in priority).', + 'comment'=>'Send an emails when the unpaid invoices reach a due date + n days = today. First param is the offset n of days, second parameter is "all" or a payment mode code, last parameter is the code of email template to use (an email template with EmailTemplateCode must exists. the version in the language of the thirdparty will be used in priority).', 'frequency'=>1, 'unitfrequency'=>3600 * 24, 'priority'=>50, From 9b4e4b0ba57e3c332b2d1f4c1911c89e2e5a269a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Sep 2021 04:20:21 +0200 Subject: [PATCH 0374/1460] typo From df0a26550fd49ae47f7064a4da775a9f093f5f35 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Mon, 20 Sep 2021 09:12:07 +0200 Subject: [PATCH 0375/1460] Update to match eldy's advices --- htdocs/ecm/class/htmlecm.form.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/ecm/class/htmlecm.form.class.php b/htdocs/ecm/class/htmlecm.form.class.php index 7d695ce023d..623d626935d 100644 --- a/htdocs/ecm/class/htmlecm.form.class.php +++ b/htdocs/ecm/class/htmlecm.form.class.php @@ -55,10 +55,10 @@ class FormEcm * @param int $selected Id of preselected section * @param string $select_name Name of HTML select component * @param string $module Module ('ecm', 'medias', ...) - * @param array $ignore_id Arroy of id to ignore + * @param array $ids_to_ignore Array of id to ignore * @return string String with HTML select */ - public function selectAllSections($selected = 0, $select_name = '', $module = 'ecm', $ignore_id = array()) + public function selectAllSections($selected = 0, $select_name = '', $module = 'ecm', $ids_to_ignore = array()) { global $conf, $langs; $langs->load("ecm"); @@ -66,8 +66,8 @@ class FormEcm if ($select_name == '') { $select_name = "catParent"; } - if (!is_array($ignore_id)) { - $ignore_id = array($ignore_id); + if (!is_array($ids_to_ignore)) { + $ids_to_ignore = array($ids_to_ignore); } $cate_arbo = null; @@ -87,7 +87,7 @@ class FormEcm } else { $output .= ''; foreach ($cate_arbo as $key => $value) { - if (!in_array($cate_arbo[$key]['id'], $ignore_id)) { + if (!in_array($cate_arbo[$key]['id'], $ids_to_ignore)) { $valueforoption = empty($cate_arbo[$key]['id']) ? $cate_arbo[$key]['relativename'] : $cate_arbo[$key]['id']; if ($selected && $valueforoption == $selected) { $add = 'selected '; From 5397e2d9c3ee220a1e7e8fe81ad1f1a589c62595 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Sep 2021 11:30:33 +0200 Subject: [PATCH 0376/1460] Clean sql --- htdocs/ecm/class/ecmdirectory.class.php | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php index 3c7af135922..54b1e6b6bb8 100644 --- a/htdocs/ecm/class/ecmdirectory.class.php +++ b/htdocs/ecm/class/ecmdirectory.class.php @@ -144,7 +144,6 @@ class EcmDirectory extends CommonObject // Clean parameters $this->label = dol_sanitizeFileName(trim($this->label)); - $this->fk_parent = trim($this->fk_parent); $this->description = trim($this->description); $this->date_c = $now; $this->fk_user_c = $user->id; @@ -155,7 +154,7 @@ class EcmDirectory extends CommonObject // Check if same directory does not exists with this name $relativepath = $this->label; - if ($this->fk_parent) { + if ($this->fk_parent > 0) { $parent = new EcmDirectory($this->db); $parent->fetch($this->fk_parent); $relativepath = $parent->getRelativePath().$relativepath; @@ -194,11 +193,11 @@ class EcmDirectory extends CommonObject $sql .= ") VALUES ("; $sql .= " '".$this->db->escape($this->label)."',"; $sql .= " '".$this->db->escape($conf->entity)."',"; - $sql .= " '".$this->db->escape($this->fk_parent)."',"; + $sql .= " ".($this->fk_parent > 0 ? ((int) $this->fk_parent) : "null").","; $sql .= " '".$this->db->escape($this->description)."',"; $sql .= " ".((int) $this->cachenbofdoc).","; $sql .= " '".$this->db->idate($this->date_c)."',"; - $sql .= " '".$this->db->escape($this->fk_user_c)."'"; + $sql .= " ".($this->fk_user_c > 0 ? ((int) $this->fk_user_c) : "null").","; $sql .= ")"; dol_syslog(get_class($this)."::create", LOG_DEBUG); @@ -249,20 +248,19 @@ class EcmDirectory extends CommonObject // Clean parameters $this->label = trim($this->label); - $this->fk_parent = trim($this->fk_parent); $this->description = trim($this->description); - - // Check parameters - // Put here code to add control on parameters values + if ($this->fk_parent <= 0) { + $this->fk_parent = 0; + } $this->db->begin(); // Update request $sql = "UPDATE ".MAIN_DB_PREFIX."ecm_directories SET"; - $sql .= " label='".$this->db->escape($this->label)."',"; - $sql .= " fk_parent='".$this->db->escape($this->fk_parent)."',"; - $sql .= " description='".$this->db->escape($this->description)."'"; - $sql .= " WHERE rowid=".((int) $this->id); + $sql .= " label = '".$this->db->escape($this->label)."',"; + $sql .= " fk_parent = ".($this->fk_parent > 0 ? ((int) $this->fk_parent) : "null").","; + $sql .= " description = '".$this->db->escape($this->description)."'"; + $sql .= " WHERE rowid = ".((int) $this->id); dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); From 131677a5ea06feb4c9e58aebd90256c4eec6caae Mon Sep 17 00:00:00 2001 From: ksar <35605507+ksar-ksar@users.noreply.github.com> Date: Mon, 20 Sep 2021 11:50:10 +0200 Subject: [PATCH 0377/1460] FIX #18735 File preview is not working --- htdocs/expedition/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 8c959116582..902914c4327 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -2553,7 +2553,7 @@ if ($action == 'create') { // Presend form $modelmail = 'shipping_send'; $defaulttopic = 'SendShippingRef'; - $diroutput = $conf->expedition->dir_output.'/sending'; + $diroutput = $conf->expedition->dir_output; $trackid = 'shi'.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; From 0453a27bda7740fb65a1a7cf8e93c2386b2d8f68 Mon Sep 17 00:00:00 2001 From: javieralapps4up Date: Mon, 20 Sep 2021 12:24:44 +0200 Subject: [PATCH 0378/1460] Update main.inc.php --- htdocs/main.inc.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 1af8595b780..9bcf6238b36 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1041,14 +1041,16 @@ if (!defined('NOLOGIN')) { $user->rights->user->self->password = 1; //Required if advanced permissions are used with MAIN_USE_ADVANCED_PERMS - $user->rights->user->user_advance->readperms = 1; - $user->rights->user->user_advance->write = 1; - $user->rights->user->self_advance->readperms = 1; - $user->rights->user->self_advance->writeperms = 1; - $user->rights->user->group_advance->read = 1; - $user->rights->user->group_advance->readperms = 1; - $user->rights->user->group_advance->write = 1; - $user->rights->user->group_advance->delete = 1; + if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { + $user->rights->user->user_advance->readperms = 1; + $user->rights->user->user_advance->write = 1; + $user->rights->user->self_advance->readperms = 1; + $user->rights->user->self_advance->writeperms = 1; + $user->rights->user->group_advance->read = 1; + $user->rights->user->group_advance->readperms = 1; + $user->rights->user->group_advance->write = 1; + $user->rights->user->group_advance->delete = 1; + } } /* From be2a95ca51f124b674104a9be8af793381d8025a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Sep 2021 13:01:53 +0200 Subject: [PATCH 0379/1460] Add language as_IN --- htdocs/langs/en_US/languages.lang | 1 + htdocs/societe/class/societe.class.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/languages.lang b/htdocs/langs/en_US/languages.lang index e3b6bed94c8..ca962811831 100644 --- a/htdocs/langs/en_US/languages.lang +++ b/htdocs/langs/en_US/languages.lang @@ -6,6 +6,7 @@ Language_ar_MA=Arabic (Moroco) Language_ar_SA=Arabic Language_ar_TN=Arabic (Tunisia) Language_ar_IQ=Arabic (Iraq) +Language_as_IN=Assamese Language_az_AZ=Azerbaijani Language_bn_BD=Bengali Language_bn_IN=Bengali (India) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index ff6e9474d34..e7597b311c2 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2581,7 +2581,7 @@ class Societe extends CommonObject $label .= ' ('.dol_escape_htmltag($this->name_alias).')'; } } - $label .= '
'.$langs->trans('Email').': '.$this->email; + $label .= '
'.img_picto('', 'email', 'class="pictofixedwidth"').$this->email; if (!empty($this->phone) || !empty($this->fax)) { $phonelist = array(); if ($this->phone) { @@ -2590,7 +2590,7 @@ class Societe extends CommonObject if ($this->fax) { $phonelist[] = dol_print_phone($this->fax, $this->country_code, $this->id, 0, '', ' ', 'fax'); } - $label .= '
'.$langs->trans('Phone').': '.implode(' ', $phonelist); + $label .= '
'.implode(' ', $phonelist); } if (!empty($this->address)) { $label .= '
'.$langs->trans("Address").': '.dol_format_address($this, 1, ' ', $langs); // Address + country From 0eff2fa15b64882be38019bf6c492b8b08f70a03 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Sep 2021 13:20:54 +0200 Subject: [PATCH 0380/1460] FIX default language defined for IN country --- htdocs/core/class/html.formadmin.class.php | 12 ++++++++++++ htdocs/core/lib/functions.lib.php | 12 +++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/html.formadmin.class.php b/htdocs/core/class/html.formadmin.class.php index 8e03f158a02..13619fe5aa3 100644 --- a/htdocs/core/class/html.formadmin.class.php +++ b/htdocs/core/class/html.formadmin.class.php @@ -73,6 +73,18 @@ class FormAdmin $langs_available = $langs->get_available_languages(DOL_DOCUMENT_ROOT, 12, 0, $mainlangonly); + // If the language to select is not inside the list of available language and empty value is not available, we must find + // an alternative as the language code to pre-select (to avoid to have first element in list pre-selected). + if ($selected && !in_array($selected, $langs_available) && empty($showempty)) { + $tmparray = explode('_', $selected); + if (!empty($tmparray[1])) { + $selected = getLanguageCodeFromCountryCode($tmparray[1]); + } + if (empty($selected)) { + $selected = $langs->defaultlang; + } + } + $out = ''; $out .= ''; +print ''; +print ''; +print ''; print load_fiche_titre($langs->trans("CommentsOfVoters"), '', ''); @@ -391,7 +396,7 @@ $comments = $object->getComments(); if ($comments) { foreach ($comments as $comment) { if ($user->rights->opensurvey->write) { - print ' '.img_picto('', 'delete.png', '', false, 0, 0, '', '', 0).' '; + print ' '.img_picto('', 'delete.png', '', false, 0, 0, '', '', 0).' '; } print dol_htmlentities($comment->usercomment).': '.dol_nl2br(dol_htmlentities($comment->comment))."
"; @@ -407,10 +412,7 @@ if ($object->allow_comments) { print $langs->trans("AddACommentForPoll").'
'; print '
'."\n"; print $langs->trans("Name").': '."\n"; - print '
'."\n"; - if (isset($erreur_commentaire_vide) && $erreur_commentaire_vide == "yes") { - print "".$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Name")).""; - } + print '
'."\n"; } print ''; From 82f66f8b0a4cc1939d9710e3a5e38b7dbbe1f987 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Sep 2021 19:00:28 +0200 Subject: [PATCH 0386/1460] Better label of field --- htdocs/langs/en_US/products.lang | 1 + htdocs/mrp/mo_production.php | 39 ++++++++++++++++++++++++-------- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index ae199f4136b..b8f242652a1 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -397,6 +397,7 @@ ActionAvailableOnVariantProductOnly=Action only available on the variant of prod ProductsPricePerCustomer=Product prices per customers ProductSupplierExtraFields=Additional Attributes (Supplier Prices) DeleteLinkedProduct=Delete the child product linked to the combination +AmountUsedToUpdateWAP=Amount to use to update the Weighted Average Price PMPValue=Weighted average price PMPValueShort=WAP DefaultBOM=Default BOM diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 3dccebf9549..84dab109b91 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -38,7 +38,7 @@ dol_include_once('/bom/class/bom.class.php'); dol_include_once('/mrp/lib/mrp_mo.lib.php'); // Load translation files required by the page -$langs->loadLangs(array("mrp", "stocks", "other", "productbatch")); +$langs->loadLangs(array("mrp", "stocks", "other", "product", "productbatch")); // Get parameters $id = GETPOST('id', 'int'); @@ -691,6 +691,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $bom = new Bom($db); $res = $bom->fetch($object->fk_bom); if ($res > 0) { + $bom->calculateCosts(); $bomcost = $bom->unit_cost; } } @@ -818,6 +819,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } } + $bomcost = price2num($bomcost, 'MU'); + $arrayoflines = $object->fetchLinesLinked('consumed', $line->id); $alreadyconsumed = 0; foreach ($arrayoflines as $line2) { @@ -1006,9 +1009,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print '
'; if ($permissiontoupdatecost) { if (empty($bomcost)) { - print ''; + print ''; } else { - print ''; + print ''; } } print ''; @@ -1073,10 +1076,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $tmpproduct = new Product($db); $tmpproduct->fetch($line->fk_product); - if (empty($bomcost)) { - $bomcost = $tmpproduct->pmp; - } - $arrayoflines = $object->fetchLinesLinked('produced', $line->id); $alreadyproduced = 0; foreach ($arrayoflines as $line2) { @@ -1095,8 +1094,19 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; print ''; if ($permissiontoupdatecost) { + // Defined $manufacturingcost + $manufacturingcost = $bomcost; + if (empty($manufacturingcost)) { + $manufacturingcost = price2num($tmpproduct->cost_price, 'MU'); + } + if (empty($manufacturingcost)) { + $manufacturingcost = price2num($tmpproduct->pmp, 'MU'); + } + print ''; } print ''; if ($permissiontoupdatecost) { + // Defined $manufacturingcost + $manufacturingcost = $bomcost; + if (empty($manufacturingcost)) { + $manufacturingcost = price2num($tmpproduct->cost_price, 'MU'); + } + if (empty($manufacturingcost)) { + $manufacturingcost = price2num($tmpproduct->pmp, 'MU'); + } + if ($tmpproduct->type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { - $preselected = (GETPOSTISSET('pricetoproduce-'.$line->id.'-'.$i) ? GETPOST('pricetoproduce-'.$line->id.'-'.$i) : price($bomcost)); + $preselected = (GETPOSTISSET('pricetoproduce-'.$line->id.'-'.$i) ? GETPOST('pricetoproduce-'.$line->id.'-'.$i) : price($manufacturingcost)); print ''; } else { - print ''; + print ''; } } print ''; From d1bfaa5256106d089c6823eea168a2a9b29d82e3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Sep 2021 19:02:04 +0200 Subject: [PATCH 0387/1460] Trans --- htdocs/langs/en_US/products.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index b8f242652a1..294e2afbc03 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -75,6 +75,7 @@ SellingPriceTTC=Selling price (inc. tax) SellingMinPriceTTC=Minimum Selling price (inc. tax) CostPriceDescription=This price field (excl. tax) can be used to capture the average amount this product costs to your company. It may be any price you calculate yourself, for example, from the average buying price plus average production and distribution cost. CostPriceUsage=This value could be used for margin calculation. +ManufacturingPrice=Manufacturing price SoldAmount=Sold amount PurchasedAmount=Purchased amount NewPrice=New price From e3f3e01c2170bdd24f0a6a31a6dbd22074615f33 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Sep 2021 19:21:39 +0200 Subject: [PATCH 0388/1460] Fields on surveys on 2 columns --- htdocs/opensurvey/card.php | 35 +++++++++++++++++--------- htdocs/opensurvey/results.php | 46 ++++++++++++++++++++++++++++++----- 2 files changed, 63 insertions(+), 18 deletions(-) diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php index bc63b319efd..c32b49ff1a1 100644 --- a/htdocs/opensurvey/card.php +++ b/htdocs/opensurvey/card.php @@ -222,20 +222,21 @@ dol_banner_tab($object, 'id', $linkback, 1, 'id_sondage', 'id_sondage', $morehtm print '
'; -print '
'; +print '
'; +print '
'; print '
'."\n"; - print 'scandir.'&label='.urlencode($module->name).'&type=SUPPLIER_PAYMENT">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'&type=SUPPLIER_PAYMENT">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "
'; if ($conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS) { - $texte .= ''.img_picto($langs->trans("Enabled"), 'on').''; + $texte .= ''.img_picto($langs->trans("Enabled"), 'on').''; } else { - $texte .= ''.img_picto($langs->trans("Disabled"), 'off').''; + $texte .= ''.img_picto($langs->trans("Disabled"), 'off').''; } $texte .= ' '.$langs->trans('CustomMasks')."\n"; $texte .= ''; if ($conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS) { - $texte .= ''.img_picto($langs->trans("Enabled"), 'on').''; + $texte .= ''.img_picto($langs->trans("Enabled"), 'on').''; } else { - $texte .= ''.img_picto($langs->trans("Disabled"), 'off').''; + $texte .= ''.img_picto($langs->trans("Disabled"), 'off').''; } $texte .= ' '.$langs->trans('CustomMasks')."\n"; $texte .= '\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Enabled"), 'switch_on').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Enabled"), 'switch_on').''; print '\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; print ''.img_picto('', 'setup').''.img_picto('', 'setup').''.img_picto('', 'setup').''.img_picto('', 'setup').'
'; if (!$disabled) { - print ''; + print ''; } print img_picto($langs->trans("Disabled"), 'switch_off'); if (!$disabled) { @@ -463,7 +463,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->PRODUCT_ADDON_PDF == $name) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; - print ''.$langs->trans("Disable").''; + print ''.$langs->trans("Disable").''; } else { print ' '; - print ''.$langs->trans("Activate").''; + print ''.$langs->trans("Activate").''; } print '
'; if (!$disabled) { - print ''; + print ''; } print img_picto($langs->trans("Disabled"), 'switch_off'); if (!$disabled) { @@ -468,7 +468,7 @@ foreach ($arrayofmodules as $file => $modCodeCompta) { print img_picto($langs->trans("Activated"), 'switch_on'); print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; + print ''; print $shipment->getNomUrl(1); print "'; + print ''; print $companystatic->getNomUrl(1); print ''; + print ''; print $obj->zip; print '".$obj->state_name."'.$obj->state_name.""; + print ''; print $reception->getNomUrl(1); $filename = dol_sanitizeFileName($reception->ref); $filedir = $conf->reception->dir_output.'/'.dol_sanitizeFileName($reception->ref); @@ -900,8 +900,8 @@ while ($i < min($num, $limit)) { // Ref customer if (!empty($arrayfields['e.ref_supplier']['checked'])) { - print ""; - print $obj->ref_supplier; + print '\n"; if (!$i) { $totalarray['nbfield']++; @@ -910,7 +910,7 @@ while ($i < min($num, $limit)) { // Third party if (!empty($arrayfields['s.nom']['checked'])) { - print ''; + print ''; print $companystatic->getNomUrl(1); print ''; + print ''; print $obj->zip; print 'ref_supplier).'">'; print dol_escape_htmltag($obj->ref_supplier); print "'; + print ''; print dol_escape_htmltag($obj->ref_supplier); print "'; - print $obj->town; + print ''; + print dol_escape_htmltag($obj->town); print ''; - print $obj->zip; + print dol_escape_htmltag($obj->zip); print '".$obj->state_name."".dol_escape_htmltag($obj->state_name)."'; $tmparray = getCountry($obj->fk_pays, 'all'); - print $tmparray['label']; + print dol_escape_htmltag($tmparray['label']); print ''.dol_print_date($datelimit, 'day'); + print ''.dol_print_date($datelimit, 'day'); if ($facturestatic->hasDelay()) { - print img_warning($langs->trans('Late')); + print img_warning($langs->trans('Alert').' - '.$langs->trans('Late')); } print ''.$langs->trans("Qty").''.$langs->trans("PMPValue").''.$form->textwithpicto($langs->trans("UnitCost"), $langs->trans("AmountUsedToUpdateWAP")).''.$langs->trans("UnitCost").''.$form->textwithpicto($langs->trans("ManufacturingPrice"), $langs->trans("AmountUsedToUpdateWAP")).''.$langs->trans("QtyAlreadyProduced").''.$line->qty.''; - print price($bomcost); + if ($manufacturingcost) { + print price($manufacturingcost); + } print ''; @@ -1188,11 +1198,20 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } print '
'; // Type $type = ($object->format == "A") ? 'classic' : 'date'; -print ''; // Title print ''; // Description -print ''; // EMail //If linked user, then emails are going to be sent to users' email if (!$object->fk_user_creat) { - print ''; } // Receive an email with each vote -print ''; // Users can comment -print ''; // Users can see others vote -print ''; +print '
'.$langs->trans("Type").''; +print '
'.$langs->trans("Type").''; print img_picto('', dol_buildpath('/opensurvey/img/'.($type == 'classic' ? 'chart-32.png' : 'calendar-32.png'), 1), 'width="16"', 1); print ' '.$langs->trans($type == 'classic' ? "TypeClassic" : "TypeDate").'
'; $adresseadmin = $object->mail_admin; -print $langs->trans("Title").''; +print $langs->trans("Title").''; if ($action == 'edit') { print ''; } else { @@ -244,7 +245,7 @@ if ($action == 'edit') { print '
'.$langs->trans("Description").''; +print '
'.$langs->trans("Description").''; if ($action == 'edit') { $doleditor = new DolEditor('nouveauxcommentaires', $object->description, '', 120, 'dolibarr_notes', 'In', 1, 1, 1, ROWS_7, '90%'); $doleditor->Create(0, ''); @@ -256,17 +257,17 @@ print '
'.$langs->trans("EMail").''; + print '
'.$langs->trans("EMail").''; if ($action == 'edit') { print ''; } else { - print dol_print_email($object->mail_admin, 0, 0, 1); + print dol_print_email($object->mail_admin, 0, 0, 1, 0, 1, 1); } print '
'.$langs->trans('ToReceiveEMailForEachVote').''; +print '
'.$langs->trans('ToReceiveEMailForEachVote').''; if ($action == 'edit') { print 'mailsonde ? 'checked="checked"' : '').'">'; } else { @@ -282,7 +283,7 @@ if ($action == 'edit') { print '
'.$langs->trans('CanComment').''; +print '
'.$langs->trans('CanComment').''; if ($action == 'edit') { print 'allow_comments ? 'checked="checked"' : '').'">'; } else { @@ -291,7 +292,7 @@ if ($action == 'edit') { print '
'.$langs->trans('CanSeeOthersVote').''; +print '
'.$langs->trans('CanSeeOthersVote').''; if ($action == 'edit') { print 'allow_spy ? 'checked="checked"' : '').'">'; } else { @@ -299,8 +300,16 @@ if ($action == 'edit') { } print '
'; + +print '
'; +print '
'; +print '
'; + +print ''; + // Expire date -print ''; // Author print ''; // Link -print ''; print '
'.$langs->trans('ExpireDate').''; +print '
'.$langs->trans('ExpireDate').''; if ($action == 'edit') { print $form->selectDate($expiredate ? $expiredate : $object->date_fin, 'expire', 0, 0, 0, '', 1, 0); } else { @@ -313,7 +322,7 @@ print '
'; -print $langs->trans("Author").''; +print $langs->trans("Author").''; if ($object->fk_user_creat) { print $userstatic->getLoginUrl(1); } else { @@ -322,7 +331,7 @@ if ($object->fk_user_creat) { print '
'.img_picto('', 'globe').' '.$langs->trans("UrlForSurvey", '').''; +print '
'.img_picto('', 'globe').' '.$langs->trans("UrlForSurvey", '').''; // Define $urlwithroot $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); @@ -338,8 +347,10 @@ if ($action != 'edit') { print '
'; +print '
'; print '
'; +print '
'; print dol_get_fiche_end(); diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php index ff5198c006a..d03cbca69c5 100644 --- a/htdocs/opensurvey/results.php +++ b/htdocs/opensurvey/results.php @@ -455,20 +455,21 @@ dol_banner_tab($object, 'id', $linkback, 1, 'id_sondage', 'id_sondage', $morehtm print '
'; -print '
'; +print '
'; +print '
'; print ''; // Type $type = ($object->format == "A") ? 'classic' : 'date'; -print ''; // Title print ''; +// Description +print ''; + +// EMail +//If linked user, then emails are going to be sent to users' email +if (!$object->fk_user_creat) { + print ''; +} + +print '
'.$langs->trans("Type").''; +print '
'.$langs->trans("Type").''; print img_picto('', dol_buildpath('/opensurvey/img/'.($type == 'classic' ? 'chart-32.png' : 'calendar-32.png'), 1), 'width="16"', 1); print ' '.$langs->trans($type == 'classic' ? "TypeClassic" : "TypeDate").'
'; $adresseadmin = $object->mail_admin; -print $langs->trans("Title").''; +print $langs->trans("Title").''; if ($action == 'edit') { print ''; } else { @@ -476,8 +477,39 @@ if ($action == 'edit') { } print '
'.$langs->trans("Description").''; +if ($action == 'edit') { + $doleditor = new DolEditor('nouveauxcommentaires', $object->description, '', 120, 'dolibarr_notes', 'In', 1, 1, 1, ROWS_7, '90%'); + $doleditor->Create(0, ''); +} else { + print (dol_textishtml($object->description) ? $object->description : dol_nl2br($object->description, 1, true)); +} +print '
'.$langs->trans("EMail").''; + if ($action == 'edit') { + print ''; + } else { + print dol_print_email($object->mail_admin, 0, 0, 1, 0, 1, 1); + } + print '
'; + +print '
'; +print '
'; +print '
'; + +print ''; + + // Expire date -print ''; // Author print ''; // Link -print ''; print '
'.$langs->trans('ExpireDate').''; +print '
'.$langs->trans('ExpireDate').''; if ($action == 'edit') { print $form->selectDate($expiredate ? $expiredate : $object->date_fin, 'expire', 0, 0, 0, '', 1, 0); } else { @@ -490,7 +522,7 @@ print '
'; -print $langs->trans("Author").''; +print $langs->trans("Author").''; if ($object->fk_user_creat) { print $userstatic->getLoginUrl(1); } else { @@ -499,7 +531,7 @@ if ($object->fk_user_creat) { print '
'.img_picto('', 'globe').' '.$langs->trans("UrlForSurvey", '').''; +print '
'.img_picto('', 'globe').' '.$langs->trans("UrlForSurvey", '').''; // Define $urlwithroot $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); @@ -521,8 +553,10 @@ if ($action != 'edit') { print '
'; +print '
'; print '
'; +print '
'; print dol_get_fiche_end(); From c40b22facd3cf4f3e69020755b7abf5cdf8b21a9 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Mon, 20 Sep 2021 19:41:13 +0200 Subject: [PATCH 0389/1460] Add turnover homepage box --- .../facture/class/facturestats.class.php | 28 +++ .../core/boxes/box_graph_invoices_peryear.php | 223 ++++++++++++++++++ htdocs/core/class/stats.class.php | 30 +++ 3 files changed, 281 insertions(+) create mode 100644 htdocs/core/boxes/box_graph_invoices_peryear.php diff --git a/htdocs/compta/facture/class/facturestats.class.php b/htdocs/compta/facture/class/facturestats.class.php index 96c8e88b97e..39325c2cbbd 100644 --- a/htdocs/compta/facture/class/facturestats.class.php +++ b/htdocs/compta/facture/class/facturestats.class.php @@ -266,4 +266,32 @@ class FactureStats extends Stats return $this->_getAllByProduct($sql, $limit); } + /** + * Return the invoices amount by year for a number of past years + * + * @param int $numberYears Years to scan + * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is year, 2=Label of abscissa is last number of year + * @return array Array with amount by year + */ + public function getAmountByYear($numberYears, $format = 0) + { + global $user; + + $endYear = date('Y'); + $startYear = $endYear - $numberYears; + $sql = "SELECT date_format(datef,'%Y') as dm, SUM(f.".$this->field.")"; + $sql .= " FROM ".$this->from; + if (!$user->rights->societe->client->voir && !$this->socid) + { + $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + } + $sql .= $this->join; + $sql .= " WHERE f.datef BETWEEN '".$this->db->idate(dol_get_first_day($startYear))."' AND '".$this->db->idate(dol_get_last_day($endYear))."'"; + $sql .= " AND ".$this->where; + $sql .= " GROUP BY dm"; + $sql .= $this->db->order('dm', 'ASC'); + + $res = $this->_getAmountByYear($sql); + return $res; + } } diff --git a/htdocs/core/boxes/box_graph_invoices_peryear.php b/htdocs/core/boxes/box_graph_invoices_peryear.php new file mode 100644 index 00000000000..3b3192a98ba --- /dev/null +++ b/htdocs/core/boxes/box_graph_invoices_peryear.php @@ -0,0 +1,223 @@ + + * + * 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 . + */ + +/** + * \file htdocs/core/boxes/box_graph_invoices_peryear.php + * \ingroup factures + * \brief Box to show graph of invoices per year + */ +include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php'; + + +/** + * Class to manage the box to show last invoices + */ +class box_graph_invoices_peryear extends ModeleBoxes +{ + public $boxcode = "invoicesperyear"; + public $boximg = "object_bill"; + public $boxlabel = "BoxCustomersInvoicesPerYear"; + public $depends = array("facture"); + + /** + * @var DoliDB Database handler. + */ + public $db; + + public $info_box_head = array(); + public $info_box_contents = array(); + + + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param) + { + global $user; + + $this->db = $db; + + $this->hidden = !($user->rights->facture->lire); + } + + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + global $conf, $user, $langs; + + $this->max = $max; + + $refreshaction = 'refresh_'.$this->boxcode; + + //include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; + //$facturestatic=new Facture($this->db); + + $startmonth = $conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1; + if (empty($conf->global->GRAPH_USE_FISCAL_YEAR)) $startmonth = 1; + + $text = $langs->trans("Turnover", $max); + $this->info_box_head = array( + 'text' => $text, + 'limit'=> dol_strlen($text), + 'graph'=> 1, + 'sublink'=>'', + 'subtext'=>$langs->trans("Filter"), + 'subpicto'=>'filter.png', + 'subclass'=>'linkobject boxfilter', + 'target'=>'none' // Set '' to get target="_blank" + ); + + $dir = ''; // We don't need a path because image file will not be saved into disk + $prefix = ''; + $socid = 0; + if ($user->socid) $socid = $user->socid; + if (!$user->rights->societe->client->voir || $socid) $prefix .= 'private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user + + if ($user->rights->facture->lire) + { + $mesg = ''; + + $param_year = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_year'; + $param_showtot = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_showtot'; + + include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php'; + $autosetarray = preg_split("/[,;:]+/", GETPOST('DOL_AUTOSET_COOKIE')); + if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode, $autosetarray)) + { + $endyear = GETPOST($param_year, 'int'); + $showtot = GETPOST($param_showtot, 'alpha'); + } else { + $tmparray = json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode], true); + $endyear = $tmparray['year']; + $showtot = $tmparray['showtot']; + } + if (empty($showtot)) { $showtot = 1; } + $nowarray = dol_getdate(dol_now(), true); + if (empty($endyear)) $endyear = $nowarray['year']; + $numberyears = (empty($conf->global->MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH) ? 5 : $conf->global->MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH); + $startyear = $endyear - $numberyears; + $endyear = + + $mode = 'customer'; + $WIDTH = (($showtot) || !empty($conf->dol_optimize_smallscreen)) ? '256' : '320'; + $HEIGHT = '192'; + + $stats = new FactureStats($this->db, $socid, $mode, 0); + + // Build graphic amount of object. $data = array(array('Lib',val1,val2,val3),...) + $data2 = $stats->getAmountByYear($numberyears); + + $filenamenb = $dir."/".$prefix."invoicesamountyears-".$endyear.".png"; + // default value for customer mode + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesamountyears-'.$endyear.'.png'; + if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessupplieramountyears-'.$endyear.'.png'; + + $px2 = new DolGraph(); + $mesg = $px2->isGraphKo(); + if (!$mesg) + { + $langs->load("bills"); + + $px2->SetData($data2); + unset($data2); + $i = $startyear; + $legend = array(); + while ($i <= $endyear) + { + if ($startmonth != 1) + { + $legend[] = sprintf("%d/%d", $i - 2001, $i - 2000); + } else { + $legend[] = $i; + } + $i++; + } + $px2->SetLegend([$langs->trans("AmountOfBillsHT")]); + $px2->SetMaxValue($px2->GetCeilMaxValue()); + $px2->SetWidth($WIDTH); + $px2->SetHeight($HEIGHT); + $px2->SetYLabel($langs->trans("AmountOfBillsHT")); + $px2->SetShading(3); + $px2->SetHorizTickIncrement(1); + $px2->SetCssPrefix("cssboxes"); + $px2->mode = 'depth'; + $px2->SetTitle($langs->trans("Turnover")); + + $px2->draw($filenamenb, $fileurlnb); + } + + if (empty($conf->use_javascript_ajax)) + { + $langs->load("errors"); + $mesg = $langs->trans("WarningFeatureDisabledWithDisplayOptimizedForBlindNoJs"); + } + + if (!$mesg) + { + $stringtoshow = ''; + $stringtoshow .= ''; + $stringtoshow .= '
'; // hideobject is to start hidden + $stringtoshow .= '
'; + $stringtoshow .= ''; + $stringtoshow .= ''; + $stringtoshow .= ''; + $stringtoshow .= ''; + $stringtoshow .= $langs->trans("Year").' '; + $stringtoshow .= ''; + $stringtoshow .= '
'; + $stringtoshow .= '
'; + $stringtoshow .= $px2->show(); + $this->info_box_contents[0][0] = array('tr'=>'class="oddeven nohover"', 'td' => 'class="nohover center"', 'textnoformat'=>$stringtoshow); + } else { + $this->info_box_contents[0][0] = array('tr'=>'class="oddeven nohover"', 'td' => 'class="nohover left"', 'maxlength'=>500, 'text' => $mesg); + } + } else { + $this->info_box_contents[0][0] = array( + 'td' => 'class="nohover left"', + 'text' => ''.$langs->trans("ReadPermissionNotAllowed").'' + ); + } + } + + /** + * Method to show box + * + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @param int $nooutput No print, only return string + * @return string + */ + public function showBox($head = null, $contents = null, $nooutput = 0) + { + return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); + } +} diff --git a/htdocs/core/class/stats.class.php b/htdocs/core/class/stats.class.php index 4ac164b1d3a..6fd5db42253 100644 --- a/htdocs/core/class/stats.class.php +++ b/htdocs/core/class/stats.class.php @@ -617,4 +617,34 @@ abstract class Stats return $result; } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** + * Returns the summed amounts per year for a given number of past years ending now + * @param string $sql SQL + * @return array + */ + function _getAmountByYear($sql) + { + $result = array(); + $resql = $this->db->query($sql); + if ($resql) + { + $num = $this->db->num_rows($resql); + $i = 0; + while ($i < $num) + { + $row = $this->db->fetch_row($resql); + $j = (int) $row[0]; + $result[] = [ + 0 => (int) $row[0], + 1 => (int) $row[1], + ]; + $i++; + } + $this->db->free($resql); + } + return $result; + } + } From d919ef9c4cf74b8049864034e0a2882bec041b19 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 20 Sep 2021 17:57:10 +0000 Subject: [PATCH 0390/1460] Fixing style errors. --- .../facture/class/facturestats.class.php | 3 +-- .../core/boxes/box_graph_invoices_peryear.php | 23 +++++++------------ htdocs/core/class/stats.class.php | 9 +++----- 3 files changed, 12 insertions(+), 23 deletions(-) diff --git a/htdocs/compta/facture/class/facturestats.class.php b/htdocs/compta/facture/class/facturestats.class.php index 39325c2cbbd..1e6457104ea 100644 --- a/htdocs/compta/facture/class/facturestats.class.php +++ b/htdocs/compta/facture/class/facturestats.class.php @@ -281,8 +281,7 @@ class FactureStats extends Stats $startYear = $endYear - $numberYears; $sql = "SELECT date_format(datef,'%Y') as dm, SUM(f.".$this->field.")"; $sql .= " FROM ".$this->from; - if (!$user->rights->societe->client->voir && !$this->socid) - { + if (!$user->rights->societe->client->voir && !$this->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= $this->join; diff --git a/htdocs/core/boxes/box_graph_invoices_peryear.php b/htdocs/core/boxes/box_graph_invoices_peryear.php index 3b3192a98ba..447ab9dfdfb 100644 --- a/htdocs/core/boxes/box_graph_invoices_peryear.php +++ b/htdocs/core/boxes/box_graph_invoices_peryear.php @@ -95,8 +95,7 @@ class box_graph_invoices_peryear extends ModeleBoxes if ($user->socid) $socid = $user->socid; if (!$user->rights->societe->client->voir || $socid) $prefix .= 'private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user - if ($user->rights->facture->lire) - { + if ($user->rights->facture->lire) { $mesg = ''; $param_year = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_year'; @@ -105,8 +104,7 @@ class box_graph_invoices_peryear extends ModeleBoxes include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php'; $autosetarray = preg_split("/[,;:]+/", GETPOST('DOL_AUTOSET_COOKIE')); - if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode, $autosetarray)) - { + if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode, $autosetarray)) { $endyear = GETPOST($param_year, 'int'); $showtot = GETPOST($param_showtot, 'alpha'); } else { @@ -119,7 +117,7 @@ class box_graph_invoices_peryear extends ModeleBoxes if (empty($endyear)) $endyear = $nowarray['year']; $numberyears = (empty($conf->global->MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH) ? 5 : $conf->global->MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH); $startyear = $endyear - $numberyears; - $endyear = + $endyear = $mode = 'customer'; $WIDTH = (($showtot) || !empty($conf->dol_optimize_smallscreen)) ? '256' : '320'; @@ -137,18 +135,15 @@ class box_graph_invoices_peryear extends ModeleBoxes $px2 = new DolGraph(); $mesg = $px2->isGraphKo(); - if (!$mesg) - { + if (!$mesg) { $langs->load("bills"); $px2->SetData($data2); unset($data2); $i = $startyear; $legend = array(); - while ($i <= $endyear) - { - if ($startmonth != 1) - { + while ($i <= $endyear) { + if ($startmonth != 1) { $legend[] = sprintf("%d/%d", $i - 2001, $i - 2000); } else { $legend[] = $i; @@ -169,14 +164,12 @@ class box_graph_invoices_peryear extends ModeleBoxes $px2->draw($filenamenb, $fileurlnb); } - if (empty($conf->use_javascript_ajax)) - { + if (empty($conf->use_javascript_ajax)) { $langs->load("errors"); $mesg = $langs->trans("WarningFeatureDisabledWithDisplayOptimizedForBlindNoJs"); } - if (!$mesg) - { + if (!$mesg) { $stringtoshow = ''; $stringtoshow .= ''; - $response[] = array('title'=>$obj->question,'ref'=>$obj->url,'answer'=>$obj->answer,'url'=>$urltoprint); - } + $response[] = array('title'=>$obj->question,'ref'=>$obj->ref,'answer'=>dol_escape_htmltag(preg_replace('/\\r|\\r\\n|\\n/', "", $obj->answer)),'url'=>$obj->url); $i++; } } else { diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index dd43ae0ffae..d936ceb8c22 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -258,43 +258,41 @@ class FormTicket if (idgroupticket != "") { $.ajax({ url: \''.DOL_URL_ROOT.'/core/ajax/fetchKnowledgeRecord.php\', - data: { action: \'getKnowledgeRecord\', idticketgroup: idgroupticket, token: \''.newToken().'\', lang:\''.$langs->defaultlang.'\', popupurl:false}, + data: { action: \'getKnowledgeRecord\', idticketgroup: idgroupticket, token: \''.newToken().'\', lang:\''.$langs->defaultlang.'\'}, type: \'GET\', success: function(response) { var urllist = \'\'; console.log("We received response "+response); response = JSON.parse(response) for (key in response) { - console.log(response[key]) - urllist += "
  • " + response[key].title + ": " +response[key].url+"
  • "; + answer = response[key].answer; + urllist += \'
  • \' +response[key].title+\'
  • \'; } if (urllist != "") { - console.log(urllist) - $("#KWwithajax").html(\''.$langs->trans("KMFoundForTicketGroup").'
      \'+urllist+\'
    \'); + $("#KWwithajax").html(\''.$langs->trans("KMFoundForTicketGroup").'
      \'+urllist+\'
    \'); $("#KWwithajax").show(); + $(".button_KMpopup").on("click",function(){ + console.log("Open popup with jQuery(...).dialog() with KM article") + var $dialog = $("
    ").html($(this).attr("data-html")) + .dialog({ + autoOpen: false, + modal: true, + height: (window.innerHeight - 150), + width: "80%", + title: $(this).attr("title"), + }); + $dialog.dialog("open"); + console.log($dialog); + }) } }, error : function(output) { - console.log("error"); + console.error("Error on Fetch of KM articles"); }, }); } }; - $("#selectcategory_code").bind("change",function() { groupticketchange(); }); - MutationObserver = window.MutationObserver || window.WebKitMutationObserver; - var trackChange = function(element) { - var observer = new MutationObserver(function(mutations, observer) { - if (mutations[0].attributeName == "value") { - $(element).trigger("change"); - } - }); - observer.observe(element, { - attributes: true - }); - } - - trackChange($("#selectcategory_code")[0]); - + $("#selectcategory_code").on("change",function() { groupticketchange(); }); if ($("#selectcategory_code").val() != "") { groupticketchange(); } From f2b39b3eeb82e6e182d6f3ad9a39573f1076c253 Mon Sep 17 00:00:00 2001 From: ksar <35605507+ksar-ksar@users.noreply.github.com> Date: Tue, 21 Sep 2021 11:27:41 +0200 Subject: [PATCH 0401/1460] FIX #18767 : Adherent delete Adherent Delete was not working due to the fact that $features = 'adherent'; $feature2 = 'cotisation'; And $user->rights->$feature->$subfeature->supprimer does not exist Also I used the double declaration of salaries. --- htdocs/core/lib/security.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 4c36244a5bf..da5d9388bd8 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -513,8 +513,8 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f if (!$user->rights->salaries->delete) { $deleteok = 0; } - } elseif ($feature == 'salaries') { - if (!$user->rights->salaries->delete) { + } elseif ($feature == 'adherent') { + if (!$user->rights->adherent->supprimer) { $deleteok = 0; } } elseif (!empty($feature2)) { // This is for permissions on 2 levels From 06f97f4f805c0b5c7424aadf038b485486ec14f4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 21 Sep 2021 12:04:28 +0200 Subject: [PATCH 0402/1460] Look and feel v14 --- htdocs/adherents/card.php | 2 +- htdocs/adherents/subscription.php | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 56643d80632..4e760e055a6 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1836,7 +1836,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; } - // Login Dolibarr + // Login Dolibarr - Link to user print ''; $editenable = $user->rights->adherent->creer && $user->rights->user->user->creer; print $form->editfieldkey('LinkedToDolibarrUser', 'login', '', $object, $editenable); diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 4da534161d6..17ac089670b 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -623,7 +623,7 @@ if ($rowid > 0) { print ''; } - // Login Dolibarr + // Login Dolibarr - Link to user print ''; print ''; // PMP - print ''; + $usercaneditpmp = 0; + if (!empty($conf->global->PRODUCT_CAN_EDIT_WAP)) { + $usercaneditpmp = $usercancreate; + } + print ''; print ''; print ''; From 9ba7f019ea68b8150e6144b2a16595b01a8565b9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 21 Sep 2021 16:53:29 +0200 Subject: [PATCH 0412/1460] Fix css --- htdocs/contact/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index efb8f03736e..b16b1640555 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -1284,7 +1284,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if ($objsoc->id > 0) { $morehtmlref .= $objsoc->getNomUrl(1, 'contact'); } else { - $morehtmlref .= $langs->trans("ContactNotLinkedToCompany"); + $morehtmlref .= ''.$langs->trans("ContactNotLinkedToCompany").''; } } $morehtmlref .= ''; From 97d912d5535edccfaadcfb97164b24fa48d783f9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 21 Sep 2021 17:17:38 +0200 Subject: [PATCH 0413/1460] Add more information about private or public poll. --- htdocs/langs/en_US/opensurvey.lang | 2 ++ htdocs/public/opensurvey/studs.php | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/opensurvey.lang b/htdocs/langs/en_US/opensurvey.lang index 7d26151fa16..9fafacaf8bf 100644 --- a/htdocs/langs/en_US/opensurvey.lang +++ b/htdocs/langs/en_US/opensurvey.lang @@ -48,6 +48,8 @@ AddEndHour=Add end hour votes=vote(s) NoCommentYet=No comments have been posted for this poll yet CanComment=Voters can comment in the poll +YourVoteIsPrivate=This poll is private, nobody can see your vote. +YourVoteIsPublic=This poll is public, anybody with the link can see your vote. CanSeeOthersVote=Voters can see other people's vote SelectDayDesc=For each selected day, you can choose, or not, meeting hours in the following format:
    - empty,
    - "8h", "8H" or "8:00" to give a meeting's start hour,
    - "8-11", "8h-11h", "8H-11H" or "8:00-11:00" to give a meeting's start and end hour,
    - "8h15-11h15", "8H15-11H15" or "8:15-11:15" for the same thing but with minutes. BackToCurrentMonth=Back to current month diff --git a/htdocs/public/opensurvey/studs.php b/htdocs/public/opensurvey/studs.php index 2a39e6e4730..7be05684fd2 100644 --- a/htdocs/public/opensurvey/studs.php +++ b/htdocs/public/opensurvey/studs.php @@ -274,7 +274,13 @@ $toutsujet = str_replace("°", "'", $toutsujet); print '
    '.$langs->trans("YouAreInivitedToVote").'
    '; -print $langs->trans("OpenSurveyHowTo").'

    '; +print $langs->trans("OpenSurveyHowTo").'
    '; +if (empty($object->allow_spy)) { + print ''.$langs->trans("YourVoteIsPrivate").'
    '; +} else { + print $form->textwithpicto(''.$langs->trans("YourVoteIsPublic").'', $langs->trans("CanSeeOthersVote")).'
    '; +} +print '
    '; print '
    '."\n"; From c89468428e5417d7ba3f15c6ed3c9aadc99761f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Cendrier?= Date: Tue, 21 Sep 2021 11:22:59 +0200 Subject: [PATCH 0414/1460] add warehouse in projects elements count --- htdocs/core/lib/project.lib.php | 5 ++++- htdocs/projet/element.php | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 722f99d3b69..4e4adaf9d3e 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -126,7 +126,7 @@ function project_prepare_head(Project $project, $moreparam = '') if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) || !empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->facture->enabled) || !empty($conf->contrat->enabled) - || !empty($conf->ficheinter->enabled) || !empty($conf->agenda->enabled) || !empty($conf->deplacement->enabled)) { + || !empty($conf->ficheinter->enabled) || !empty($conf->agenda->enabled) || !empty($conf->deplacement->enabled) || !empty($conf->stock->enabled)) { $nbElements = 0; // Enable caching of thirdrparty count Contacts $cachekey = 'count_elements_project_'.$project->id; @@ -134,6 +134,9 @@ function project_prepare_head(Project $project, $moreparam = '') if (!is_null($dataretrieved)) { $nbElements = $dataretrieved; } else { + if (!empty ($conf->stock->enabled)) { + $nbElements += $project->getElementCount('stock', 'entrepot', 'fk_project'); + } if (!empty($conf->propal->enabled)) { $nbElements += $project->getElementCount('propal', 'propal'); } diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 7fcfe3bc92b..9e14a53e7ea 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -36,6 +36,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +if (!empty($conf->stock->enabled)) { + require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; +} if (!empty($conf->propal->enabled)) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } From dcd3f85e79f0d82d261161a066aac18159626552 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 21 Sep 2021 17:32:08 +0200 Subject: [PATCH 0415/1460] Fix sql error --- htdocs/accountancy/class/bookkeeping.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index d47078af06c..c80e1088e14 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -888,9 +888,11 @@ class BookKeeping extends CommonObject // Affichage par compte comptable if (!empty($option)) { $sql .= ' AND t.subledger_account IS NOT NULL'; - $sql .= ' ORDER BY t.subledger_account ASC'; + $sortfield = 't.subledger_account'.($sortfield ? ','.$sortfield : ''); + $sortorder = 'ASC'.($sortfield ? ','.$sortfield : ''); } else { - $sql .= ' ORDER BY t.numero_compte ASC'; + $sortfield = 't.numero_compte'.($sortfield ? ','.$sortfield : ''); + $sortorder = 'ASC'.($sortorder ? ','.$sortorder : ''); } $sql .= $this->db->order($sortfield, $sortorder); From e227bdb22b74eabcb8987e374c6261362c05b458 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 21 Sep 2021 17:58:00 +0200 Subject: [PATCH 0416/1460] FIX check if method exists instead --- htdocs/core/actions_addupdatedelete.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 71288da8335..17b75305ebc 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -236,7 +236,7 @@ if ($action == 'update' && !empty($permissiontoadd)) { if ($conf->categorie->enabled) { $categories = GETPOST('categories', 'array'); - if (!empty($categories)) { + if (method_exists($object, 'setCategories')) { $object->setCategories($categories); } } From d6632757f9f41bc925b6e9daf333e6e968f9f3d1 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 21 Sep 2021 16:06:03 +0000 Subject: [PATCH 0417/1460] Fixing style errors. --- htdocs/core/actions_addupdatedelete.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 17b75305ebc..2cc477520ea 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -237,7 +237,7 @@ if ($action == 'update' && !empty($permissiontoadd)) { if ($conf->categorie->enabled) { $categories = GETPOST('categories', 'array'); if (method_exists($object, 'setCategories')) { - $object->setCategories($categories); + $object->setCategories($categories); } } } From a5566473d95fb3f695a8554f967c8b7b85d0f068 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 21 Sep 2021 18:06:48 +0200 Subject: [PATCH 0418/1460] Clean code --- htdocs/product/class/product.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index e0a8ccb78a5..b799113af29 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5814,7 +5814,6 @@ class Product extends CommonObject */ public function setCategories($categories) { - require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; return parent::setCategoriesCommon($categories, Categorie::TYPE_PRODUCT); } From c4dd6be9f8685107242f10dfe11c5039980aec66 Mon Sep 17 00:00:00 2001 From: fr69400 <82267780+fr69400@users.noreply.github.com> Date: Tue, 21 Sep 2021 18:47:34 +0200 Subject: [PATCH 0419/1460] Add showdocument hook --- htdocs/core/class/html.formfile.class.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 591fb5ed2d1..a21ef8e3305 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -391,6 +391,20 @@ class FormFile global $langs, $conf, $user, $hookmanager; global $form; + $reshook = 0; + if (is_object($hookmanager)){ + $parameters = array(); ++ $reshook = $hookmanager->executeHooks('showdocuments', $parameters, $object); + // May report error + if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + } + } + // Remode default action if $reskook > 0 + if ($reshook > 0) { + return ''; + } + if (!is_object($form)) { $form = new Form($this->db); } From 12be914d049f6f59c2735796305178f4056765cb Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 21 Sep 2021 16:49:00 +0000 Subject: [PATCH 0420/1460] Fixing style errors. --- htdocs/core/class/html.formfile.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index a21ef8e3305..d0d3717a1f1 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -392,13 +392,13 @@ class FormFile global $form; $reshook = 0; - if (is_object($hookmanager)){ + if (is_object($hookmanager)) { $parameters = array(); -+ $reshook = $hookmanager->executeHooks('showdocuments', $parameters, $object); + + $reshook = $hookmanager->executeHooks('showdocuments', $parameters, $object); // May report error if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - } + } } // Remode default action if $reskook > 0 if ($reshook > 0) { From fd911ff36fc1c76468e152aab95d943881f67a59 Mon Sep 17 00:00:00 2001 From: fr69400 <82267780+fr69400@users.noreply.github.com> Date: Tue, 21 Sep 2021 19:15:54 +0200 Subject: [PATCH 0421/1460] Update html.formfile.class.php --- htdocs/core/class/html.formfile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index d0d3717a1f1..f6f977d3058 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -394,7 +394,7 @@ class FormFile $reshook = 0; if (is_object($hookmanager)) { $parameters = array(); - + $reshook = $hookmanager->executeHooks('showdocuments', $parameters, $object); + $reshook = $hookmanager->executeHooks('showdocuments', $parameters, $object); // May report error if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); From 9266b4e8fd7a7f639c3debf4f33fcd78d0a4e1d4 Mon Sep 17 00:00:00 2001 From: kamel Date: Tue, 21 Sep 2021 14:15:17 +0200 Subject: [PATCH 0422/1460] FIX Button text on proposal card for create a invoice --- htdocs/comm/propal/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 95a1418b644..c96f24760c0 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2583,7 +2583,7 @@ if ($action == 'create') { // Create an invoice and classify billed if ($object->statut == Propal::STATUS_SIGNED) { if (!empty($conf->facture->enabled) && $usercancreateinvoice) { - print ''.$langs->trans("AddBill").''; + print ''.$langs->trans("CreateBill").''; } $arrayofinvoiceforpropal = $object->getInvoiceArrayList(); From 73b0d8079cae433cd04db9a7c41bb088fbad77c2 Mon Sep 17 00:00:00 2001 From: fr69400 <82267780+fr69400@users.noreply.github.com> Date: Tue, 21 Sep 2021 22:23:14 +0200 Subject: [PATCH 0423/1460] Update html.formfile.class.php --- htdocs/core/class/html.formfile.class.php | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index d0d3717a1f1..8b954cc3d3a 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -393,8 +393,26 @@ class FormFile $reshook = 0; if (is_object($hookmanager)) { - $parameters = array(); - + $reshook = $hookmanager->executeHooks('showdocuments', $parameters, $object); + $parameters = array( + 'modulepart'=>&$modulepart, + 'modulesubdir'=>&$modulesubdir, + 'filedir'=>&$filedir, + 'urlsource'=>&$urlsource, + 'genallowed'=>&$genallowed, + 'delallowed'=>&$delallowed, + 'modelselected'=>&$modelselected, + 'allowgenifempty'=>&$allowgenifempty, + 'forcenomultilang'=>&$forcenomultilang, + 'noform'=>&$noform, + 'param'=>&$param, + 'title'=>&$title, + 'buttonlabel'=>&$buttonlabel, + 'codelang'=>&$codelang, + 'morepicto'=>&$morepicto, + 'hideifempty'=>&$hideifempty, + 'removeaction'=>&$removeaction + ); + $reshook = $hookmanager->executeHooks('showdocuments', $parameters, $object); // Note that parameters may have been updated by hook // May report error if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); From 49fd1b761cff315d592efd04ed7f2c3b8be29928 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 21 Sep 2021 20:27:33 +0000 Subject: [PATCH 0424/1460] Fixing style errors. --- htdocs/core/class/html.formfile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 8b954cc3d3a..2e58c845e6b 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -394,7 +394,7 @@ class FormFile $reshook = 0; if (is_object($hookmanager)) { $parameters = array( - 'modulepart'=>&$modulepart, + 'modulepart'=>&$modulepart, 'modulesubdir'=>&$modulesubdir, 'filedir'=>&$filedir, 'urlsource'=>&$urlsource, From 5d684b1c719716d0e8d4aa4d7d6dff01bf1d2e9a Mon Sep 17 00:00:00 2001 From: Erik van Berkum Date: Wed, 22 Sep 2021 10:03:25 +0900 Subject: [PATCH 0425/1460] Fix: translation error: ConfirmDeleteMO is not delete this Bill Of Materials but delete this Manufacturing Order. --- htdocs/langs/am_ET/mrp.lang | 2 +- htdocs/langs/ar_IQ/mrp.lang | 2 +- htdocs/langs/ar_SA/mrp.lang | 2 +- htdocs/langs/az_AZ/mrp.lang | 2 +- htdocs/langs/bg_BG/mrp.lang | 2 +- htdocs/langs/bn_BD/mrp.lang | 2 +- htdocs/langs/bn_IN/mrp.lang | 2 +- htdocs/langs/bs_BA/mrp.lang | 2 +- htdocs/langs/cs_CZ/mrp.lang | 2 +- htdocs/langs/de_DE/mrp.lang | 2 +- htdocs/langs/el_GR/mrp.lang | 2 +- htdocs/langs/en_US/mrp.lang | 4 ++-- htdocs/langs/et_EE/mrp.lang | 2 +- htdocs/langs/eu_ES/mrp.lang | 2 +- htdocs/langs/fa_IR/mrp.lang | 2 +- htdocs/langs/fi_FI/mrp.lang | 2 +- htdocs/langs/he_IL/mrp.lang | 2 +- htdocs/langs/hi_IN/mrp.lang | 2 +- htdocs/langs/hr_HR/mrp.lang | 2 +- htdocs/langs/hu_HU/mrp.lang | 2 +- htdocs/langs/id_ID/mrp.lang | 2 +- htdocs/langs/is_IS/mrp.lang | 2 +- htdocs/langs/it_IT/mrp.lang | 2 +- htdocs/langs/ka_GE/mrp.lang | 2 +- htdocs/langs/kk_KZ/mrp.lang | 2 +- htdocs/langs/km_KH/mrp.lang | 2 +- htdocs/langs/kn_IN/mrp.lang | 2 +- htdocs/langs/ko_KR/mrp.lang | 2 +- htdocs/langs/lo_LA/mrp.lang | 2 +- htdocs/langs/lt_LT/mrp.lang | 2 +- htdocs/langs/mk_MK/mrp.lang | 2 +- htdocs/langs/mn_MN/mrp.lang | 2 +- htdocs/langs/ne_NP/mrp.lang | 2 +- htdocs/langs/nl_NL/mrp.lang | 2 +- htdocs/langs/pt_PT/mrp.lang | 2 +- htdocs/langs/sk_SK/mrp.lang | 2 +- htdocs/langs/sl_SI/mrp.lang | 2 +- htdocs/langs/sq_AL/mrp.lang | 2 +- htdocs/langs/sr_RS/mrp.lang | 2 +- htdocs/langs/sw_SW/mrp.lang | 2 +- htdocs/langs/tg_TJ/mrp.lang | 2 +- htdocs/langs/th_TH/mrp.lang | 2 +- htdocs/langs/tr_TR/mrp.lang | 2 +- htdocs/langs/uk_UA/mrp.lang | 2 +- htdocs/langs/vi_VN/mrp.lang | 2 +- htdocs/langs/zh_CN/mrp.lang | 2 +- htdocs/langs/zh_HK/mrp.lang | 2 +- 47 files changed, 48 insertions(+), 48 deletions(-) diff --git a/htdocs/langs/am_ET/mrp.lang b/htdocs/langs/am_ET/mrp.lang index 2414a92cefb..5d226c0f77b 100644 --- a/htdocs/langs/am_ET/mrp.lang +++ b/htdocs/langs/am_ET/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Delete Bill Of Materials DeleteMo=Delete Manufacturing Order ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Manufacturing Orders NewMO=New Manufacturing Order QtyToProduce=Qty to produce diff --git a/htdocs/langs/ar_IQ/mrp.lang b/htdocs/langs/ar_IQ/mrp.lang index 2414a92cefb..5d226c0f77b 100644 --- a/htdocs/langs/ar_IQ/mrp.lang +++ b/htdocs/langs/ar_IQ/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Delete Bill Of Materials DeleteMo=Delete Manufacturing Order ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Manufacturing Orders NewMO=New Manufacturing Order QtyToProduce=Qty to produce diff --git a/htdocs/langs/ar_SA/mrp.lang b/htdocs/langs/ar_SA/mrp.lang index 97c6e6378bb..fe2c1a87769 100644 --- a/htdocs/langs/ar_SA/mrp.lang +++ b/htdocs/langs/ar_SA/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Delete Bill Of Materials DeleteMo=Delete Manufacturing Order ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=أوامر التصنيع NewMO=New Manufacturing Order QtyToProduce=Qty to produce diff --git a/htdocs/langs/az_AZ/mrp.lang b/htdocs/langs/az_AZ/mrp.lang index 2414a92cefb..5d226c0f77b 100644 --- a/htdocs/langs/az_AZ/mrp.lang +++ b/htdocs/langs/az_AZ/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Delete Bill Of Materials DeleteMo=Delete Manufacturing Order ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Manufacturing Orders NewMO=New Manufacturing Order QtyToProduce=Qty to produce diff --git a/htdocs/langs/bg_BG/mrp.lang b/htdocs/langs/bg_BG/mrp.lang index 0c39bca3291..933315a64d4 100644 --- a/htdocs/langs/bg_BG/mrp.lang +++ b/htdocs/langs/bg_BG/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Стойност 0,95 означава сре DeleteBillOfMaterials=Изтриване на списък с материали DeleteMo=Изтриване на поръчка за производство ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Поръчки за производство NewMO=Нова поръчка за производство QtyToProduce=Кол. за производство diff --git a/htdocs/langs/bn_BD/mrp.lang b/htdocs/langs/bn_BD/mrp.lang index 2414a92cefb..5d226c0f77b 100644 --- a/htdocs/langs/bn_BD/mrp.lang +++ b/htdocs/langs/bn_BD/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Delete Bill Of Materials DeleteMo=Delete Manufacturing Order ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Manufacturing Orders NewMO=New Manufacturing Order QtyToProduce=Qty to produce diff --git a/htdocs/langs/bn_IN/mrp.lang b/htdocs/langs/bn_IN/mrp.lang index 2414a92cefb..5d226c0f77b 100644 --- a/htdocs/langs/bn_IN/mrp.lang +++ b/htdocs/langs/bn_IN/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Delete Bill Of Materials DeleteMo=Delete Manufacturing Order ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Manufacturing Orders NewMO=New Manufacturing Order QtyToProduce=Qty to produce diff --git a/htdocs/langs/bs_BA/mrp.lang b/htdocs/langs/bs_BA/mrp.lang index 16ab0c8ac49..999a6ec67b8 100644 --- a/htdocs/langs/bs_BA/mrp.lang +++ b/htdocs/langs/bs_BA/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Delete Bill Of Materials DeleteMo=Delete Manufacturing Order ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Manufacturing Orders NewMO=New Manufacturing Order QtyToProduce=Qty to produce diff --git a/htdocs/langs/cs_CZ/mrp.lang b/htdocs/langs/cs_CZ/mrp.lang index 948205b3887..13d519a79b7 100644 --- a/htdocs/langs/cs_CZ/mrp.lang +++ b/htdocs/langs/cs_CZ/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Hodnota 0,95 znamená průměrně ztrátu vyr DeleteBillOfMaterials=Odstranit kusovník DeleteMo=Smazat výrobní zakázku ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Výrobní zakázky NewMO=Nová výrobní objednávka QtyToProduce=Množství k výrobě diff --git a/htdocs/langs/de_DE/mrp.lang b/htdocs/langs/de_DE/mrp.lang index 0c90379fd43..323bbe74d59 100644 --- a/htdocs/langs/de_DE/mrp.lang +++ b/htdocs/langs/de_DE/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Ein Wert von 0,95 bedeutet im Durchschnitt 5% DeleteBillOfMaterials=Stückliste löschen DeleteMo=Fertigungsauftrag löschen ConfirmDeleteBillOfMaterials=Möchten Sie diese Stückliste wirklich löschen? -ConfirmDeleteMo=Möchten Sie diese Stückliste wirklich löschen? +ConfirmDeleteMo=Möchten Sie diese Fertigungsauftrag wirklich löschen? MenuMRP=Fertigungsaufträge NewMO=Neuer Fertigungsauftrag QtyToProduce=Produktionsmenge diff --git a/htdocs/langs/el_GR/mrp.lang b/htdocs/langs/el_GR/mrp.lang index 3d622d1de8b..f70ffcd3117 100644 --- a/htdocs/langs/el_GR/mrp.lang +++ b/htdocs/langs/el_GR/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Η τιμή 0,95 σημαίνει κατά μ DeleteBillOfMaterials=Διαγραφή λογαριασμού υλικών DeleteMo=Διαγραφή Παραγγελίας Παραγωγής ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Παραγγελίες Παραγωγής NewMO=Νέα Παραγγελία Παραγωγής QtyToProduce=Ποσότητα για παραγωγή diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang index 47d1fbe889f..10e81316ee4 100644 --- a/htdocs/langs/en_US/mrp.lang +++ b/htdocs/langs/en_US/mrp.lang @@ -32,7 +32,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Delete Bill Of Materials DeleteMo=Delete Manufacturing Order ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Manufacturing Orders NewMO=New Manufacturing Order QtyToProduce=Qty to produce @@ -104,4 +104,4 @@ HumanMachine=Human / Machine WorkstationArea=Workstation area Machines=Machines THMEstimatedHelp=This rate makes it possible to define a forecast cost of the item -MOAndLines=Manufacturing Orders and lines \ No newline at end of file +MOAndLines=Manufacturing Orders and lines diff --git a/htdocs/langs/et_EE/mrp.lang b/htdocs/langs/et_EE/mrp.lang index c7146c45dfe..32e99e6e6b7 100644 --- a/htdocs/langs/et_EE/mrp.lang +++ b/htdocs/langs/et_EE/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Delete Bill Of Materials DeleteMo=Delete Manufacturing Order ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Manufacturing Orders NewMO=New Manufacturing Order QtyToProduce=Qty to produce diff --git a/htdocs/langs/eu_ES/mrp.lang b/htdocs/langs/eu_ES/mrp.lang index acf5a23db9b..a6e57a1168a 100644 --- a/htdocs/langs/eu_ES/mrp.lang +++ b/htdocs/langs/eu_ES/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Delete Bill Of Materials DeleteMo=Delete Manufacturing Order ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Manufacturing Orders NewMO=New Manufacturing Order QtyToProduce=Qty to produce diff --git a/htdocs/langs/fa_IR/mrp.lang b/htdocs/langs/fa_IR/mrp.lang index c00afb9dd3a..d536b6b661c 100644 --- a/htdocs/langs/fa_IR/mrp.lang +++ b/htdocs/langs/fa_IR/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Delete Bill Of Materials DeleteMo=Delete Manufacturing Order ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Manufacturing Orders NewMO=New Manufacturing Order QtyToProduce=Qty to produce diff --git a/htdocs/langs/fi_FI/mrp.lang b/htdocs/langs/fi_FI/mrp.lang index 2eafe6926bb..14f2af7e1fe 100644 --- a/htdocs/langs/fi_FI/mrp.lang +++ b/htdocs/langs/fi_FI/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Delete Bill Of Materials DeleteMo=Delete Manufacturing Order ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Valmistustilaukset NewMO=New Manufacturing Order QtyToProduce=Qty to produce diff --git a/htdocs/langs/he_IL/mrp.lang b/htdocs/langs/he_IL/mrp.lang index 2414a92cefb..5d226c0f77b 100644 --- a/htdocs/langs/he_IL/mrp.lang +++ b/htdocs/langs/he_IL/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Delete Bill Of Materials DeleteMo=Delete Manufacturing Order ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Manufacturing Orders NewMO=New Manufacturing Order QtyToProduce=Qty to produce diff --git a/htdocs/langs/hi_IN/mrp.lang b/htdocs/langs/hi_IN/mrp.lang index 2414a92cefb..5d226c0f77b 100644 --- a/htdocs/langs/hi_IN/mrp.lang +++ b/htdocs/langs/hi_IN/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Delete Bill Of Materials DeleteMo=Delete Manufacturing Order ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Manufacturing Orders NewMO=New Manufacturing Order QtyToProduce=Qty to produce diff --git a/htdocs/langs/hr_HR/mrp.lang b/htdocs/langs/hr_HR/mrp.lang index dd2c40eda6c..00710061f2a 100644 --- a/htdocs/langs/hr_HR/mrp.lang +++ b/htdocs/langs/hr_HR/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Delete Bill Of Materials DeleteMo=Delete Manufacturing Order ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Proizvodni nalozi NewMO=Novi proizvodni nalog QtyToProduce=Qty to produce diff --git a/htdocs/langs/hu_HU/mrp.lang b/htdocs/langs/hu_HU/mrp.lang index 350817adedb..0623b3a8447 100644 --- a/htdocs/langs/hu_HU/mrp.lang +++ b/htdocs/langs/hu_HU/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Delete Bill Of Materials DeleteMo=Delete Manufacturing Order ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Gyártási rendelések NewMO=New Manufacturing Order QtyToProduce=Qty to produce diff --git a/htdocs/langs/id_ID/mrp.lang b/htdocs/langs/id_ID/mrp.lang index 76290ed5ea9..6f0d5c87b0a 100644 --- a/htdocs/langs/id_ID/mrp.lang +++ b/htdocs/langs/id_ID/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Nilai 0,95 berarti rata-rata 5%% dari kehilan DeleteBillOfMaterials=Hapus Bill Of Material DeleteMo=Hapus Pesanan Pembuatan ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Pesanan Manufaktur NewMO=Pesanan Manufaktur Baru QtyToProduce=Jumlah yang akan diproduksi diff --git a/htdocs/langs/is_IS/mrp.lang b/htdocs/langs/is_IS/mrp.lang index 8fe3fd8f4c1..ca52ce21b60 100644 --- a/htdocs/langs/is_IS/mrp.lang +++ b/htdocs/langs/is_IS/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Delete Bill Of Materials DeleteMo=Delete Manufacturing Order ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Manufacturing Orders NewMO=New Manufacturing Order QtyToProduce=Qty to produce diff --git a/htdocs/langs/it_IT/mrp.lang b/htdocs/langs/it_IT/mrp.lang index 1e6247f3799..6d54470bf3f 100644 --- a/htdocs/langs/it_IT/mrp.lang +++ b/htdocs/langs/it_IT/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Il valore di 0,95 indica una media di 5%% di DeleteBillOfMaterials=Delete Bill Of Materials DeleteMo=Elimina Ordine di Produzione ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Ordini di produzione NewMO=Nuovo ordine di produzione QtyToProduce=Qtà da produrre diff --git a/htdocs/langs/ka_GE/mrp.lang b/htdocs/langs/ka_GE/mrp.lang index 2414a92cefb..5d226c0f77b 100644 --- a/htdocs/langs/ka_GE/mrp.lang +++ b/htdocs/langs/ka_GE/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Delete Bill Of Materials DeleteMo=Delete Manufacturing Order ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Manufacturing Orders NewMO=New Manufacturing Order QtyToProduce=Qty to produce diff --git a/htdocs/langs/kk_KZ/mrp.lang b/htdocs/langs/kk_KZ/mrp.lang index 2414a92cefb..5d226c0f77b 100644 --- a/htdocs/langs/kk_KZ/mrp.lang +++ b/htdocs/langs/kk_KZ/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Delete Bill Of Materials DeleteMo=Delete Manufacturing Order ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Manufacturing Orders NewMO=New Manufacturing Order QtyToProduce=Qty to produce diff --git a/htdocs/langs/km_KH/mrp.lang b/htdocs/langs/km_KH/mrp.lang index 2414a92cefb..5d226c0f77b 100644 --- a/htdocs/langs/km_KH/mrp.lang +++ b/htdocs/langs/km_KH/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Delete Bill Of Materials DeleteMo=Delete Manufacturing Order ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Manufacturing Orders NewMO=New Manufacturing Order QtyToProduce=Qty to produce diff --git a/htdocs/langs/kn_IN/mrp.lang b/htdocs/langs/kn_IN/mrp.lang index 2414a92cefb..5d226c0f77b 100644 --- a/htdocs/langs/kn_IN/mrp.lang +++ b/htdocs/langs/kn_IN/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Delete Bill Of Materials DeleteMo=Delete Manufacturing Order ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Manufacturing Orders NewMO=New Manufacturing Order QtyToProduce=Qty to produce diff --git a/htdocs/langs/ko_KR/mrp.lang b/htdocs/langs/ko_KR/mrp.lang index 131e1f376ac..9ea63ea0c0c 100644 --- a/htdocs/langs/ko_KR/mrp.lang +++ b/htdocs/langs/ko_KR/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Delete Bill Of Materials DeleteMo=Delete Manufacturing Order ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Manufacturing Orders NewMO=New Manufacturing Order QtyToProduce=Qty to produce diff --git a/htdocs/langs/lo_LA/mrp.lang b/htdocs/langs/lo_LA/mrp.lang index 00db7f202ec..daffab535ba 100644 --- a/htdocs/langs/lo_LA/mrp.lang +++ b/htdocs/langs/lo_LA/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Delete Bill Of Materials DeleteMo=Delete Manufacturing Order ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Manufacturing Orders NewMO=New Manufacturing Order QtyToProduce=Qty to produce diff --git a/htdocs/langs/lt_LT/mrp.lang b/htdocs/langs/lt_LT/mrp.lang index 9760b1babbe..a88ffc2687d 100644 --- a/htdocs/langs/lt_LT/mrp.lang +++ b/htdocs/langs/lt_LT/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Delete Bill Of Materials DeleteMo=Delete Manufacturing Order ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Manufacturing Orders NewMO=New Manufacturing Order QtyToProduce=Qty to produce diff --git a/htdocs/langs/mk_MK/mrp.lang b/htdocs/langs/mk_MK/mrp.lang index 2414a92cefb..5d226c0f77b 100644 --- a/htdocs/langs/mk_MK/mrp.lang +++ b/htdocs/langs/mk_MK/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Delete Bill Of Materials DeleteMo=Delete Manufacturing Order ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Manufacturing Orders NewMO=New Manufacturing Order QtyToProduce=Qty to produce diff --git a/htdocs/langs/mn_MN/mrp.lang b/htdocs/langs/mn_MN/mrp.lang index 2414a92cefb..5d226c0f77b 100644 --- a/htdocs/langs/mn_MN/mrp.lang +++ b/htdocs/langs/mn_MN/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Delete Bill Of Materials DeleteMo=Delete Manufacturing Order ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Manufacturing Orders NewMO=New Manufacturing Order QtyToProduce=Qty to produce diff --git a/htdocs/langs/ne_NP/mrp.lang b/htdocs/langs/ne_NP/mrp.lang index 2414a92cefb..5d226c0f77b 100644 --- a/htdocs/langs/ne_NP/mrp.lang +++ b/htdocs/langs/ne_NP/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Delete Bill Of Materials DeleteMo=Delete Manufacturing Order ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Manufacturing Orders NewMO=New Manufacturing Order QtyToProduce=Qty to produce diff --git a/htdocs/langs/nl_NL/mrp.lang b/htdocs/langs/nl_NL/mrp.lang index d94344175c0..143e3cb4d55 100644 --- a/htdocs/langs/nl_NL/mrp.lang +++ b/htdocs/langs/nl_NL/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Waarde van 0,95 betekent een gemiddelde van 5 DeleteBillOfMaterials=Stuklijst verwijderen DeleteMo=Productieorder verwijderen ConfirmDeleteBillOfMaterials=Weet u zeker dat u deze stuklijst wilt verwijderen? -ConfirmDeleteMo=Weet u zeker dat u deze stuklijst wilt verwijderen? +ConfirmDeleteMo=Weet u zeker dat u deze Productieorder wilt verwijderen? MenuMRP=Productieorders NewMO=Nieuwe productieorder QtyToProduce=Te produceren aantal diff --git a/htdocs/langs/pt_PT/mrp.lang b/htdocs/langs/pt_PT/mrp.lang index 025f164f94e..39982e5bd35 100644 --- a/htdocs/langs/pt_PT/mrp.lang +++ b/htdocs/langs/pt_PT/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Eliminar Faturas de Materiais DeleteMo=Eliminar Encomenda de Manufaturação ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Encomendas de Manufatura NewMO=Nova Encomenda de Manufatura QtyToProduce=Qt. a produzir diff --git a/htdocs/langs/sk_SK/mrp.lang b/htdocs/langs/sk_SK/mrp.lang index d620b7e31e3..9917552ba94 100644 --- a/htdocs/langs/sk_SK/mrp.lang +++ b/htdocs/langs/sk_SK/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Delete Bill Of Materials DeleteMo=Delete Manufacturing Order ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Manufacturing Orders NewMO=New Manufacturing Order QtyToProduce=Qty to produce diff --git a/htdocs/langs/sl_SI/mrp.lang b/htdocs/langs/sl_SI/mrp.lang index 30bf0ca0238..b700927dd12 100644 --- a/htdocs/langs/sl_SI/mrp.lang +++ b/htdocs/langs/sl_SI/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Delete Bill Of Materials DeleteMo=Delete Manufacturing Order ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Manufacturing Orders NewMO=New Manufacturing Order QtyToProduce=Qty to produce diff --git a/htdocs/langs/sq_AL/mrp.lang b/htdocs/langs/sq_AL/mrp.lang index 29554c164a3..20a6d7238de 100644 --- a/htdocs/langs/sq_AL/mrp.lang +++ b/htdocs/langs/sq_AL/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Delete Bill Of Materials DeleteMo=Delete Manufacturing Order ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Manufacturing Orders NewMO=New Manufacturing Order QtyToProduce=Qty to produce diff --git a/htdocs/langs/sr_RS/mrp.lang b/htdocs/langs/sr_RS/mrp.lang index 16ab0c8ac49..999a6ec67b8 100644 --- a/htdocs/langs/sr_RS/mrp.lang +++ b/htdocs/langs/sr_RS/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Delete Bill Of Materials DeleteMo=Delete Manufacturing Order ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Manufacturing Orders NewMO=New Manufacturing Order QtyToProduce=Qty to produce diff --git a/htdocs/langs/sw_SW/mrp.lang b/htdocs/langs/sw_SW/mrp.lang index 2414a92cefb..5d226c0f77b 100644 --- a/htdocs/langs/sw_SW/mrp.lang +++ b/htdocs/langs/sw_SW/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Delete Bill Of Materials DeleteMo=Delete Manufacturing Order ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Manufacturing Orders NewMO=New Manufacturing Order QtyToProduce=Qty to produce diff --git a/htdocs/langs/tg_TJ/mrp.lang b/htdocs/langs/tg_TJ/mrp.lang index 2414a92cefb..5d226c0f77b 100644 --- a/htdocs/langs/tg_TJ/mrp.lang +++ b/htdocs/langs/tg_TJ/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Delete Bill Of Materials DeleteMo=Delete Manufacturing Order ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Manufacturing Orders NewMO=New Manufacturing Order QtyToProduce=Qty to produce diff --git a/htdocs/langs/th_TH/mrp.lang b/htdocs/langs/th_TH/mrp.lang index d5d061b855b..229690f76fd 100644 --- a/htdocs/langs/th_TH/mrp.lang +++ b/htdocs/langs/th_TH/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Delete Bill Of Materials DeleteMo=Delete Manufacturing Order ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Manufacturing Orders NewMO=New Manufacturing Order QtyToProduce=Qty to produce diff --git a/htdocs/langs/tr_TR/mrp.lang b/htdocs/langs/tr_TR/mrp.lang index 574ddefd491..b9c69a56364 100644 --- a/htdocs/langs/tr_TR/mrp.lang +++ b/htdocs/langs/tr_TR/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Delete Bill Of Materials DeleteMo=Üretim Emri Sil ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Üretim Emirleri NewMO=Yeni Üretim Emiri QtyToProduce=Qty to produce diff --git a/htdocs/langs/uk_UA/mrp.lang b/htdocs/langs/uk_UA/mrp.lang index 2414a92cefb..5d226c0f77b 100644 --- a/htdocs/langs/uk_UA/mrp.lang +++ b/htdocs/langs/uk_UA/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Delete Bill Of Materials DeleteMo=Delete Manufacturing Order ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Manufacturing Orders NewMO=New Manufacturing Order QtyToProduce=Qty to produce diff --git a/htdocs/langs/vi_VN/mrp.lang b/htdocs/langs/vi_VN/mrp.lang index f708bed87af..d24ddfe3b48 100644 --- a/htdocs/langs/vi_VN/mrp.lang +++ b/htdocs/langs/vi_VN/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Xóa hóa đơn vật liệu DeleteMo=Xóa đơn hàng sản xuất ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Đơn đặt hàng sản xuất NewMO=Thêm Đơn hàng sản xuất QtyToProduce=Số lượng để sản xuất diff --git a/htdocs/langs/zh_CN/mrp.lang b/htdocs/langs/zh_CN/mrp.lang index 86170bd9d91..e9f0381124a 100644 --- a/htdocs/langs/zh_CN/mrp.lang +++ b/htdocs/langs/zh_CN/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Delete Bill Of Materials DeleteMo=Delete Manufacturing Order ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Manufacturing Orders NewMO=New Manufacturing Order QtyToProduce=Qty to produce diff --git a/htdocs/langs/zh_HK/mrp.lang b/htdocs/langs/zh_HK/mrp.lang index 2414a92cefb..5d226c0f77b 100644 --- a/htdocs/langs/zh_HK/mrp.lang +++ b/htdocs/langs/zh_HK/mrp.lang @@ -31,7 +31,7 @@ ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss DeleteBillOfMaterials=Delete Bill Of Materials DeleteMo=Delete Manufacturing Order ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Bill Of Materials? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Manufacturing Orders NewMO=New Manufacturing Order QtyToProduce=Qty to produce From 08b395e127c007a39a829a4258d36846a3833fbd Mon Sep 17 00:00:00 2001 From: Christian Foellmann Date: Wed, 22 Sep 2021 08:43:30 +0200 Subject: [PATCH 0426/1460] another set of cleanup for action buttons --- htdocs/admin/debugbar.php | 2 +- htdocs/admin/expensereport_rules.php | 2 +- htdocs/bookmarks/card.php | 5 +---- htdocs/comm/mailing/card.php | 2 +- htdocs/comm/mailing/cibles.php | 2 +- htdocs/compta/prelevement/line.php | 2 +- htdocs/core/class/html.formfile.class.php | 4 ++-- htdocs/core/class/html.formmail.class.php | 5 ++--- htdocs/fichinter/card.php | 2 +- 9 files changed, 11 insertions(+), 15 deletions(-) diff --git a/htdocs/admin/debugbar.php b/htdocs/admin/debugbar.php index 19a440520b1..3e878b9398b 100644 --- a/htdocs/admin/debugbar.php +++ b/htdocs/admin/debugbar.php @@ -90,7 +90,7 @@ print ''; print '
    '; print $langs->trans("LinkedToDolibarrUser"); @@ -641,7 +641,9 @@ if ($rowid > 0) { $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'userid', ''); } else { if ($object->user_id) { - $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'none'); + $linkeduser = new User($db); + $linkeduser->fetch($object->user_id); + print $linkeduser->getNomUrl(-1); } else { print ''.$langs->trans("NoDolibarrAccess").''; } From 7a6a515386e50c339b783b5fe07484e4b6a8ae22 Mon Sep 17 00:00:00 2001 From: ksar <35605507+ksar-ksar@users.noreply.github.com> Date: Tue, 21 Sep 2021 12:18:37 +0200 Subject: [PATCH 0403/1460] Missing translations for Inventories --- htdocs/langs/en_US/admin.lang | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index ef1c1deb3b5..367f68e6a9b 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -896,6 +896,11 @@ Permission1002=Create/modify warehouses Permission1003=Delete warehouses Permission1004=Read stock movements Permission1005=Create/modify stock movements +Permission1011=View inventories +Permission1012=Create new inventory +Permission1014=Validate inventory +Permission1015=Allow to change PMP value for a product +Permission1016=Delete inventory Permission1101=Read delivery receipts Permission1102=Create/modify delivery receipts Permission1104=Validate delivery receipts From 86a6e8af1fe5f732bc5e1c15d17fa99c4087d8cc Mon Sep 17 00:00:00 2001 From: kamel Date: Tue, 21 Sep 2021 14:15:17 +0200 Subject: [PATCH 0404/1460] FIX Button text on proposal card for create a invoice --- htdocs/comm/propal/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 95a1418b644..c96f24760c0 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2583,7 +2583,7 @@ if ($action == 'create') { // Create an invoice and classify billed if ($object->statut == Propal::STATUS_SIGNED) { if (!empty($conf->facture->enabled) && $usercancreateinvoice) { - print ''.$langs->trans("AddBill").''; + print ''.$langs->trans("CreateBill").''; } $arrayofinvoiceforpropal = $object->getInvoiceArrayList(); From b7105d572ac1e46b653a38485026b2e401055be8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 21 Sep 2021 14:20:01 +0200 Subject: [PATCH 0405/1460] Fix delete of invoice not complete (some fk_invoice still filled) --- htdocs/compta/facture/class/facture.class.php | 31 +++++++++++++++---- ...organization_conferenceorboothattendee.sql | 1 + 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 02889c4c4ef..08ca9b6bb53 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -2267,7 +2267,6 @@ class Facture extends CommonInvoice $sql .= ' SET fk_facture = NULL, fk_facture_line = NULL'; $sql .= ' WHERE fk_facture_line IN ('.$this->db->sanitize(join(',', $list_rowid_det)).')'; - dol_syslog(get_class($this)."::delete", LOG_DEBUG); if (!$this->db->query($sql)) { $this->error = $this->db->error()." sql=".$sql; $this->errors[] = $this->error; @@ -2276,6 +2275,30 @@ class Facture extends CommonInvoice } } + // Remove other links to the deleted invoice + + $sql = 'UPDATE '.MAIN_DB_PREFIX.'eventorganization_conferenceorboothattendee'; + $sql .= ' SET fk_facture = NULL'; + $sql .= ' WHERE fk_facture = '.((int) $rowid); + + if (!$this->db->query($sql)) { + $this->error = $this->db->error()." sql=".$sql; + $this->errors[] = $this->error; + $this->db->rollback(); + return -5; + } + + $sql = 'UPDATE '.MAIN_DB_PREFIX.'projet_task_time'; + $sql .= ' SET invoice_id = NULL, invoice_line_id = NULL'; + $sql .= ' WHERE invoice_id = '.((int) $rowid); + + if (!$this->db->query($sql)) { + $this->error = $this->db->error()." sql=".$sql; + $this->errors[] = $this->error; + $this->db->rollback(); + return -5; + } + // If we decrease stock on invoice validation, we increase back if a warehouse id was provided if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_BILL) && $idwarehouse != -1) { require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; @@ -2299,17 +2322,13 @@ class Facture extends CommonInvoice // Invoice line extrafileds $main = MAIN_DB_PREFIX.'facturedet'; $ef = $main."_extrafields"; - $sqlef = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM ".$main." WHERE fk_facture = ".((int) $rowid).")"; + $sqlef = "DELETE FROM ".$ef." WHERE fk_object IN (SELECT rowid FROM ".$main." WHERE fk_facture = ".((int) $rowid).")"; // Delete invoice line $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facturedet WHERE fk_facture = '.((int) $rowid); - dol_syslog(get_class($this)."::delete", LOG_DEBUG); - if ($this->db->query($sqlef) && $this->db->query($sql) && $this->delete_linked_contact()) { $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facture WHERE rowid = '.((int) $rowid); - dol_syslog(get_class($this)."::delete", LOG_DEBUG); - $resql = $this->db->query($sql); if ($resql) { // Delete record into ECM index (Note that delete is also done when deleting files with the dol_delete_dir_recursive diff --git a/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.sql b/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.sql index 6d01cf4bba1..b505f8f6a31 100644 --- a/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.sql +++ b/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.sql @@ -21,6 +21,7 @@ CREATE TABLE llx_eventorganization_conferenceorboothattendee( fk_soc integer, fk_actioncomm integer, fk_project integer NOT NULL, + fk_invoice integer NULL, email varchar(100), date_subscription datetime, amount double DEFAULT NULL, From e2c389a4a99fa9c7431b819186bc799e9000dfda Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 21 Sep 2021 14:23:21 +0200 Subject: [PATCH 0406/1460] Fix delete invoice --- htdocs/compta/facture/class/facture.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 08ca9b6bb53..a28838756d9 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -2278,8 +2278,8 @@ class Facture extends CommonInvoice // Remove other links to the deleted invoice $sql = 'UPDATE '.MAIN_DB_PREFIX.'eventorganization_conferenceorboothattendee'; - $sql .= ' SET fk_facture = NULL'; - $sql .= ' WHERE fk_facture = '.((int) $rowid); + $sql .= ' SET fk_invoice = NULL'; + $sql .= ' WHERE fk_invoice = '.((int) $rowid); if (!$this->db->query($sql)) { $this->error = $this->db->error()." sql=".$sql; From 09fff2150e88f0e1f7f3a7dedd36e2710ba95c11 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 21 Sep 2021 15:30:34 +0200 Subject: [PATCH 0407/1460] Fix: avoid to add line for event registration twice into invoice --- .../eventorganization/attendee_register.php | 114 +++++++++--------- 1 file changed, 59 insertions(+), 55 deletions(-) diff --git a/htdocs/public/eventorganization/attendee_register.php b/htdocs/public/eventorganization/attendee_register.php index db3acde4628..a454f214316 100644 --- a/htdocs/public/eventorganization/attendee_register.php +++ b/htdocs/public/eventorganization/attendee_register.php @@ -330,63 +330,63 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $thirdparty->error = $langs->trans("ErrorSeveralCompaniesWithNameContactUs", $mysoc->email); } } - if ($resultfetchthirdparty <= 0 && !empty($emailcompany)) { - // Try to find thirdparty from the email only - $resultfetchthirdparty = $thirdparty->fetch('', '', '', '', '', '', '', '', '', '', $emailcompany); - if ($resultfetchthirdparty > 0) { - // We found a unique result with that email only, so we set the fk_soc of attendee - $confattendee->fk_soc = $thirdparty->id; - $confattendee->update($user); - } elseif ($resultfetchthirdparty == -2) { - $thirdparty->error = $langs->trans("ErrorSeveralCompaniesWithEmailContactUs", $mysoc->email); - } + } + if ($resultfetchthirdparty <= 0 && !empty($emailcompany)) { + // Try to find thirdparty from the email only + $resultfetchthirdparty = $thirdparty->fetch('', '', '', '', '', '', '', '', '', '', $emailcompany); + if ($resultfetchthirdparty > 0) { + // We found a unique result with that email only, so we set the fk_soc of attendee + $confattendee->fk_soc = $thirdparty->id; + $confattendee->update($user); + } elseif ($resultfetchthirdparty == -2) { + $thirdparty->error = $langs->trans("ErrorSeveralCompaniesWithEmailContactUs", $mysoc->email); } - if ($resultfetchthirdparty <= 0 && !empty($email) && $email != $emailcompany) { - // Try to find thirdparty from the email only - $resultfetchthirdparty = $thirdparty->fetch('', '', '', '', '', '', '', '', '', '', $email); - if ($resultfetchthirdparty > 0) { - // We found a unique result with that email only, so we set the fk_soc of attendee - $confattendee->fk_soc = $thirdparty->id; - $confattendee->update($user); - } elseif ($resultfetchthirdparty == -2) { - $thirdparty->error = $langs->trans("ErrorSeveralCompaniesWithEmailContactUs", $mysoc->email); - } + } + if ($resultfetchthirdparty <= 0 && !empty($email) && $email != $emailcompany) { + // Try to find thirdparty from the email only + $resultfetchthirdparty = $thirdparty->fetch('', '', '', '', '', '', '', '', '', '', $email); + if ($resultfetchthirdparty > 0) { + // We found a unique result with that email only, so we set the fk_soc of attendee + $confattendee->fk_soc = $thirdparty->id; + $confattendee->update($user); + } elseif ($resultfetchthirdparty == -2) { + $thirdparty->error = $langs->trans("ErrorSeveralCompaniesWithEmailContactUs", $mysoc->email); } - if ($resultfetchthirdparty <= 0 && !empty($genericcompanyname)) { - // Try to find thirdparty from the generic mail only - $resultfetchthirdparty = $thirdparty->fetch('', $genericcompanyname, '', '', '', '', '', '', '', '', ''); - if ($resultfetchthirdparty > 0) { - // We found a unique result with that name + email, so we set the fk_soc of attendee - $confattendee->fk_soc = $thirdparty->id; - $confattendee->update($user); - } elseif ($resultfetchthirdparty == -2) { - $thirdparty->error = $langs->trans("ErrorSeveralCompaniesWithNameContactUs", $mysoc->email); - } + } + if ($resultfetchthirdparty <= 0 && !empty($genericcompanyname)) { + // Try to find thirdparty from the generic mail only + $resultfetchthirdparty = $thirdparty->fetch('', $genericcompanyname, '', '', '', '', '', '', '', '', ''); + if ($resultfetchthirdparty > 0) { + // We found a unique result with that name + email, so we set the fk_soc of attendee + $confattendee->fk_soc = $thirdparty->id; + $confattendee->update($user); + } elseif ($resultfetchthirdparty == -2) { + $thirdparty->error = $langs->trans("ErrorSeveralCompaniesWithNameContactUs", $mysoc->email); } + } - // TODO Add more tests on a VAT number, profid or a name ? + // TODO Add more tests on a VAT number, profid or a name ? - if ($resultfetchthirdparty <= 0 && !empty($email)) { - // Try to find the thirdparty from the contact - $resultfetchcontact = $contact->fetch('', null, '', $email); - if ($resultfetchcontact > 0 && $contact->fk_soc > 0) { - $thirdparty->fetch($contact->fk_soc); - $confattendee->fk_soc = $thirdparty->id; - $confattendee->update($user); - $resultfetchthirdparty = 1; - } + if ($resultfetchthirdparty <= 0 && !empty($email)) { + // Try to find the thirdparty from the contact + $resultfetchcontact = $contact->fetch('', null, '', $email); + if ($resultfetchcontact > 0 && $contact->fk_soc > 0) { + $thirdparty->fetch($contact->fk_soc); + $confattendee->fk_soc = $thirdparty->id; + $confattendee->update($user); + $resultfetchthirdparty = 1; } + } - if ($resultfetchthirdparty <= 0 && !empty($societe)) { - // Try to find thirdparty from the company name only - $resultfetchthirdparty = $thirdparty->fetch('', $societe, '', '', '', '', '', '', '', '', ''); - if ($resultfetchthirdparty > 0) { - // We found a unique result with that name only, so we set the fk_soc of attendee - $confattendee->fk_soc = $thirdparty->id; - $confattendee->update($user); - } elseif ($resultfetchthirdparty == -2) { - $thirdparty->error = "ErrorSeveralCompaniesWithNameContactUs"; - } + if ($resultfetchthirdparty <= 0 && !empty($societe)) { + // Try to find thirdparty from the company name only + $resultfetchthirdparty = $thirdparty->fetch('', $societe, '', '', '', '', '', '', '', '', ''); + if ($resultfetchthirdparty > 0) { + // We found a unique result with that name only, so we set the fk_soc of attendee + $confattendee->fk_soc = $thirdparty->id; + $confattendee->update($user); + } elseif ($resultfetchthirdparty == -2) { + $thirdparty->error = "ErrorSeveralCompaniesWithNameContactUs"; } } } @@ -450,6 +450,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen } if (!$error) { + // If the registration needs a payment if (!empty(floatval($project->price_registration))) { $outputlangs = $langs; @@ -515,11 +516,14 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $date_start = $project->date_start; $date_end = $project->date_end; - $result = $facture->addline($labelforproduct, floatval($project->price_registration), 1, $vattouse, 0, 0, $productforinvoicerow->id, 0, $date_start, $date_end, 0, 0, '', 'HT', 0, 1); - if ($result <= 0) { - $confattendee->error = $facture->error; - $confattendee->errors = $facture->errors; - $error++; + // If there is no lines yet, we add one + if (empty($facture->lines)) { + $result = $facture->addline($labelforproduct, floatval($project->price_registration), 1, $vattouse, 0, 0, $productforinvoicerow->id, 0, $date_start, $date_end, 0, 0, '', 'HT', 0, 1); + if ($result <= 0) { + $confattendee->error = $facture->error; + $confattendee->errors = $facture->errors; + $error++; + } } } From 841c4da0f8d5da8c0655ab484834dfee17b51f0f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 21 Sep 2021 15:39:05 +0200 Subject: [PATCH 0408/1460] Fix css --- htdocs/accountancy/customer/lines.php | 4 ++-- htdocs/accountancy/supplier/lines.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 55700fe8439..5f91f4f2571 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -369,9 +369,9 @@ if ($result) { print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit); print ''.$langs->trans("DescVentilDoneCustomer").'
    '; - print '
    '.$langs->trans("ChangeAccount").'
    '; + print '
    '.$langs->trans("ChangeAccount").' '; print $formaccounting->select_account($account_parent, 'account_parent', 2, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone valignmiddle'); - print '
    '; + print '
    '; $moreforfilter = ''; diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index da8bc0cd5e9..5b5887aa6c4 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -369,9 +369,9 @@ if ($result) { print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit); print ''.$langs->trans("DescVentilDoneSupplier").'
    '; - print '
    '.$langs->trans("ChangeAccount").'
    '; + print '
    '.$langs->trans("ChangeAccount").' '; print $formaccounting->select_account($account_parent, 'account_parent', 2, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone valignmiddle'); - print '
    '; + print '
    '; $moreforfilter = ''; From a7ccbb4d9aec015e6d1ea438ce28220ff9ef032d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 21 Sep 2021 15:40:42 +0200 Subject: [PATCH 0409/1460] css --- htdocs/accountancy/customer/lines.php | 2 +- htdocs/accountancy/supplier/lines.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 5f91f4f2571..1e7c38b2607 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -369,7 +369,7 @@ if ($result) { print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit); print ''.$langs->trans("DescVentilDoneCustomer").'
    '; - print '
    '.$langs->trans("ChangeAccount").' '; + print '
    '.$langs->trans("ChangeAccount").' '; print $formaccounting->select_account($account_parent, 'account_parent', 2, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone valignmiddle'); print '
    '; diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index 5b5887aa6c4..61e17ab669c 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -369,7 +369,7 @@ if ($result) { print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit); print ''.$langs->trans("DescVentilDoneSupplier").'
    '; - print '
    '.$langs->trans("ChangeAccount").' '; + print '
    '.$langs->trans("ChangeAccount").' '; print $formaccounting->select_account($account_parent, 'account_parent', 2, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone valignmiddle'); print '
    '; From 48ce3ea4d3eaf5ec8df0cea0a09fee8438ff6ab9 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 21 Sep 2021 16:31:07 +0200 Subject: [PATCH 0410/1460] FIX check if $categories is not empty --- htdocs/core/actions_addupdatedelete.inc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index de4b9d86da1..71288da8335 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -236,7 +236,9 @@ if ($action == 'update' && !empty($permissiontoadd)) { if ($conf->categorie->enabled) { $categories = GETPOST('categories', 'array'); - $object->setCategories($categories); + if (!empty($categories)) { + $object->setCategories($categories); + } } } From 76ee014b52f005433c37e4f6b388e0743e659df4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 21 Sep 2021 16:32:32 +0200 Subject: [PATCH 0411/1460] Fix add a hidden solution to fix a corrupted value for AWP. --- htdocs/product/class/product.class.php | 1 - htdocs/product/fournisseurs.php | 42 +++++++++++++++++++++++--- 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index bb80dcba862..d746bf4a812 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1008,7 +1008,6 @@ class Product extends CommonObject $this->accountancy_code_sell_export = trim($this->accountancy_code_sell_export); - $this->db->begin(); $result = 0; diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 96c7cf5f8c3..9aaa0aa2c8c 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2013 Laurent Destailleur + * Copyright (C) 2004-2021 Laurent Destailleur * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010-2012 Juanjo Menent @@ -54,7 +54,9 @@ $cancel = GETPOST('cancel', 'alpha'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'pricesuppliercard'; $socid = GETPOST('socid', 'int'); -$cost_price = GETPOST('cost_price', 'alpha'); +$cost_price = price2num(GETPOST('cost_price', 'alpha'), '', 2); +$pmp = price2num(GETPOST('pmp', 'alpha'), '', 2); + $backtopage = GETPOST('backtopage', 'alpha'); $error = 0; @@ -147,13 +149,29 @@ if (empty($reshook)) { } } } + if ($action == 'setpmp') { + if ($id) { + $result = $object->fetch($id); + $object->pmp = price2num($pmp); + $sql = "UPDATE ".MAIN_DB_PREFIX."product SET pmp = ".((float) $object->pmp)." WHERE rowid = ".((int) $id); + $resql = $db->query($sql); + //$result = $object->update($object->id, $user); + if ($resql) { + setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); + $action = ''; + } else { + $error++; + setEventMessages($object->error, $object->errors, 'errors'); + } + } + } if ($action == 'confirm_remove_pf') { if ($rowid) { // id of product supplier price to remove $action = ''; $result = $object->remove_product_fournisseur_price($rowid); if ($result > 0) { - $db->query("DELETE FROM ".MAIN_DB_PREFIX."product_fournisseur_price_extrafields WHERE fk_object = $rowid"); + $db->query("DELETE FROM ".MAIN_DB_PREFIX."product_fournisseur_price_extrafields WHERE fk_object = ".((int) $rowid)); setEventMessages($langs->trans("PriceRemoved"), null, 'mesgs'); } else { $error++; @@ -425,11 +443,25 @@ if ($id > 0 || $ref) { print '
    '.$form->textwithpicto($langs->trans("AverageUnitPricePMPShort"), $langs->trans("AverageUnitPricePMPDesc")).'
    '; + $textdesc = $langs->trans("AverageUnitPricePMPDesc"); + $text = $form->textwithpicto($langs->trans("AverageUnitPricePMPShort"), $textdesc, 1, 'help', ''); + print $form->editfieldkey($text, 'pmp', $object->pmp, $object, $usercaneditpmp, 'amount:6'); + print ''; + print $form->editfieldval($text, 'pmp', ($object->pmp > 0 ? $object->pmp : ''), $object, $usercaneditpmp, 'amount:6'); + if ($object->pmp > 0) { + print ' '.$langs->trans("HT"); + } + /* + .$form->textwithpicto($langs->trans("AverageUnitPricePMPShort"), $langs->trans("AverageUnitPricePMPDesc")).''; if ($object->pmp > 0) { print price($object->pmp).' '.$langs->trans("HT"); - } + }*/ print '
    '; print ''; print ''; -print ''; +print ''; print "\n"; print ''; diff --git a/htdocs/admin/expensereport_rules.php b/htdocs/admin/expensereport_rules.php index 0b12f8d3741..802cc939caa 100644 --- a/htdocs/admin/expensereport_rules.php +++ b/htdocs/admin/expensereport_rules.php @@ -319,7 +319,7 @@ foreach ($rules as $rule) { echo ''.img_edit().' '; echo ''.img_delete().''; } else { - echo ' '; + echo ' '; echo ''.$langs->trans("Cancel").''; } echo ''; diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index 839ce4c3f86..d725a659e08 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -186,10 +186,7 @@ if ($action == 'create') { print dol_get_fiche_end(); - print '
    '; - print '   '; - print ''; - print '
    '; + print $form->buttonsSaveCancel("CreateBookmark"); print ''; } diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index dbfbc84b69f..2ed56683c02 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -749,7 +749,7 @@ if ($action == 'create') { print dol_get_fiche_end(); - print '
    '; + print $form->buttonsSaveCancel("CreateMailing", ''); print ''; } else { diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 97c6735221f..3283957f8a2 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -424,7 +424,7 @@ if ($object->fetch($id) >= 0) { print '
    '; if ($allowaddtarget) { - print ''; + print ''; } else { print ''; //print $langs->trans("MailNoChangePossible"); diff --git a/htdocs/compta/prelevement/line.php b/htdocs/compta/prelevement/line.php index 5aa7344eea5..bea351ac46c 100644 --- a/htdocs/compta/prelevement/line.php +++ b/htdocs/compta/prelevement/line.php @@ -222,7 +222,7 @@ if ($id) { print '
    '.$langs->trans("Parameter").''.$langs->trans("Value").'
    '.$langs->trans("DEBUGBAR_LOGS_LINES_NUMBER").'

    '; //Confirm Button - print '
    '; + print '
    '; print ''; } diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 591fb5ed2d1..ca7e939fb6f 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -2033,8 +2033,8 @@ class FormFile print ''.dol_print_date(dol_now(), "dayhour", "tzuser").''; print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; } else { print ''; diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 04d4ad34e89..823e90fcac3 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -956,15 +956,14 @@ class FormMail extends Form $out .= ''."\n"; if ($this->withform == 1 || $this->withform == -1) { - $out .= '
    '; - $out .= 'trans("SendMail").'"'; // Add a javascript test to avoid to forget to submit file before sending email if ($this->withfile == 2 && $conf->use_javascript_ajax) { $out .= ' onClick="if (document.mailform.addedfile.value != \'\') { alert(\''.dol_escape_js($langs->trans("FileWasNotUploaded")).'\'); return false; } else { return true; }"'; } $out .= ' />'; if ($this->withcancel) { - $out .= '     '; $out .= ''; } $out .= '
    '."\n"; diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 9bf43a60378..31f42c9b0fa 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1146,7 +1146,7 @@ if ($action == 'create') { $morehtmlref .= ''; $morehtmlref .= ''; $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; + $morehtmlref .= ''; $morehtmlref .= ''; } else { $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); From 6c7c6c9efd6d0fa491fa814498e58a3e1e60595c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Sep 2021 12:47:06 +0200 Subject: [PATCH 0427/1460] FIX legal issue on expense report pdf (must also show price without tax) --- .../doc/pdf_standard.modules.php | 42 ++++++++++++------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index b1f48450d0d..f5862bfc5f2 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -175,10 +175,11 @@ class pdf_standard extends ModeleExpenseReport //$this->posxdate=88; //$this->posxtype=107; //$this->posxprojet=120; - $this->posxtva = 130; - $this->posxup = 145; - $this->posxqty = 168; - $this->postotalttc = 178; + $this->posxtva = 112; + $this->posxup = 127; + $this->posxqty = 150; + $this->postotalht = 160; + $this->postotalttc = 180; // if (empty($conf->projet->enabled)) { // $this->posxtva-=20; // $this->posxup-=20; @@ -642,11 +643,15 @@ class pdf_standard extends ModeleExpenseReport // Quantity $pdf->SetXY($this->posxqty, $curY); - $pdf->MultiCell($this->postotalttc - $this->posxqty - 0.8, 4, $object->lines[$linenumber]->qty, 0, 'R'); + $pdf->MultiCell($this->postotalht - $this->posxqty - 0.8, 4, $object->lines[$linenumber]->qty, 0, 'R'); + + // Total without taxes + $pdf->SetXY($this->postotalht, $curY); + $pdf->MultiCell($this->postotalttc - $this->postotalht - 0.8, 4, price($object->lines[$linenumber]->total_ht), 0, 'R'); // Total with all taxes $pdf->SetXY($this->postotalttc - 1, $curY); - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalttc, 4, price($object->lines[$linenumber]->total_ttc), 0, 'R'); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalttc + 1, 4, price($object->lines[$linenumber]->total_ttc), 0, 'R'); // Comments $pdf->SetXY($this->posxcomment, $curY); @@ -950,14 +955,14 @@ class pdf_standard extends ModeleExpenseReport // Accountancy piece if (empty($hidetop)) { $pdf->SetXY($this->posxpiece - 1, $tab_top + 1); - $pdf->MultiCell($this->posxcomment - $this->posxpiece - 1, 1, '', '', 'R'); + $pdf->MultiCell($this->posxcomment - $this->posxpiece - 0.8, 1, '', '', 'R'); } // Comments $pdf->line($this->posxcomment - 1, $tab_top, $this->posxcomment - 1, $tab_top + $tab_height); if (empty($hidetop)) { $pdf->SetXY($this->posxcomment - 1, $tab_top + 1); - $pdf->MultiCell($this->posxdate - $this->posxcomment - 1, 1, $outputlangs->transnoentities("Description"), '', 'L'); + $pdf->MultiCell($this->posxdate - $this->posxcomment - 0.8, 1, $outputlangs->transnoentities("Description"), '', 'L'); } // Date @@ -990,7 +995,7 @@ class pdf_standard extends ModeleExpenseReport if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) { $pdf->line($this->posxtva - 1, $tab_top, $this->posxtva - 1, $tab_top + $tab_height); if (empty($hidetop)) { - $pdf->SetXY($this->posxtva - 1, $tab_top + 1); + $pdf->SetXY($this->posxtva - 0.8, $tab_top + 1); $pdf->MultiCell($this->posxup - $this->posxtva - 1, 2, $outputlangs->transnoentities("VAT"), '', 'C'); } } @@ -998,22 +1003,29 @@ class pdf_standard extends ModeleExpenseReport // Unit price $pdf->line($this->posxup - 1, $tab_top, $this->posxup - 1, $tab_top + $tab_height); if (empty($hidetop)) { - $pdf->SetXY($this->posxup - 1, $tab_top + 1); - $pdf->MultiCell($this->posxqty - $this->posxup - 1, 2, $outputlangs->transnoentities("PriceU"), '', 'C'); + $pdf->SetXY($this->posxup - 0.8, $tab_top + 1); + $pdf->MultiCell($this->posxqty - $this->posxup - 1, 2, $outputlangs->transnoentities("PriceUTTC"), '', 'C'); } // Quantity $pdf->line($this->posxqty - 1, $tab_top, $this->posxqty - 1, $tab_top + $tab_height); if (empty($hidetop)) { - $pdf->SetXY($this->posxqty - 1, $tab_top + 1); - $pdf->MultiCell($this->postotalttc - $this->posxqty - 1, 2, $outputlangs->transnoentities("Qty"), '', 'C'); + $pdf->SetXY($this->posxqty - 0.8, $tab_top + 1); + $pdf->MultiCell($this->postotalht - $this->posxqty - 1, 2, $outputlangs->transnoentities("Qty"), '', 'C'); + } + + // Total without taxes + $pdf->line($this->postotalht - 1, $tab_top, $this->postotalht - 1, $tab_top + $tab_height); + if (empty($hidetop)) { + $pdf->SetXY($this->postotalht - 0.8, $tab_top + 1); + $pdf->MultiCell($this->postotalttc - $this->postotalht + 1, 2, $outputlangs->transnoentities("TotalHT"), '', 'C'); } // Total with all taxes $pdf->line($this->postotalttc, $tab_top, $this->postotalttc, $tab_top + $tab_height); if (empty($hidetop)) { - $pdf->SetXY($this->postotalttc - 1, $tab_top + 1); - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalttc, 2, $outputlangs->transnoentities("TotalTTC"), '', 'R'); + $pdf->SetXY($this->postotalttc - 0.8, $tab_top + 1); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalttc + 1, 2, $outputlangs->transnoentities("TotalTTC"), '', 'R'); } $pdf->SetTextColor(0, 0, 0); From d91d14d10c9fd3e87185647188aee6962009baa8 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 22 Sep 2021 12:48:05 +0200 Subject: [PATCH 0428/1460] FIX init hookmanager after loading $conf values --- htdocs/install/upgrade2.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 83be835b64a..ea71b1947e7 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -144,11 +144,6 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ $db = getDoliDBInstance($conf->db->type, $conf->db->host, $conf->db->user, $conf->db->pass, $conf->db->name, $conf->db->port); - // Create the global $hookmanager object - include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; - $hookmanager = new HookManager($db); - $hookmanager->initHooks(array('upgrade')); - if (!$db->connected) { print ''.$langs->trans("ErrorFailedToConnectToDatabase", $conf->db->name).''.$langs->trans('Error').''; dolibarr_install_syslog('upgrade2: failed to connect to database :'.$conf->db->name.' on '.$conf->db->host.' for user '.$conf->db->user, LOG_ERR); @@ -182,6 +177,11 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ $conf->global->MAIN_ENABLE_LOG_TO_HTML = 1; } + // Create the global $hookmanager object + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; + $hookmanager = new HookManager($db); + $hookmanager->initHooks(array('upgrade')); + /*************************************************************************************** * From 736194142044e64522df1fe35386f46dabfade00 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Wed, 22 Sep 2021 14:56:44 +0200 Subject: [PATCH 0429/1460] Close #18770 : Can enter buying price on line --- .../fournisseur.commande.dispatch.class.php | 7 +++++-- .../install/mysql/migration/14.0.0-15.0.0.sql | 2 ++ .../llx_commande_fournisseur_dispatch.sql | 3 ++- htdocs/langs/en_US/receptions.lang | 1 + htdocs/langs/fr_FR/receptions.lang | 1 + htdocs/reception/card.php | 18 +++++++++++++++-- htdocs/reception/class/reception.class.php | 20 +++++++++++++++---- 7 files changed, 43 insertions(+), 9 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php index a83795996e4..a73be8ac43b 100644 --- a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php +++ b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php @@ -103,6 +103,7 @@ class CommandeFournisseurDispatch extends CommonObjectLine public $batch; public $eatby = ''; public $sellby = ''; + public $cost_price = 0; @@ -189,7 +190,8 @@ class CommandeFournisseurDispatch extends CommonObjectLine $sql .= "batch,"; $sql .= "eatby,"; $sql .= "sellby,"; - $sql .= "fk_reception"; + $sql .= "fk_reception,"; + $sql .= "cost_price"; $sql .= ") VALUES ("; @@ -205,7 +207,8 @@ class CommandeFournisseurDispatch extends CommonObjectLine $sql .= " ".(!isset($this->batch) ? 'NULL' : "'".$this->db->escape($this->batch)."'").","; $sql .= " ".(!isset($this->eatby) || dol_strlen($this->eatby) == 0 ? 'NULL' : "'".$this->db->idate($this->eatby)."'").","; $sql .= " ".(!isset($this->sellby) || dol_strlen($this->sellby) == 0 ? 'NULL' : "'".$this->db->idate($this->sellby)."'").","; - $sql .= " ".(!isset($this->fk_reception) ? 'NULL' : "'".$this->db->escape($this->fk_reception)."'").""; + $sql .= " ".(!isset($this->fk_reception) ? 'NULL' : "'".$this->db->escape($this->fk_reception)."'").","; + $sql .= " ".(!isset($this->cost_price) ? '0' : "'".$this->db->escape($this->cost_price)."'").""; $sql .= ")"; $this->db->begin(); diff --git a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql index fb0969dc7ef..51610ee8557 100644 --- a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql +++ b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql @@ -111,3 +111,5 @@ ALTER TABLE llx_product_lot ADD COLUMN barcode varchar(180) DEFAULT NULL; ALTER TABLE llx_product_lot ADD COLUMN fk_barcode_type integer DEFAULT NULL; ALTER TABLE llx_projet ADD COLUMN max_attendees integer DEFAULT 0; + +ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN cost_price double(24,8) DEFAULT 0; diff --git a/htdocs/install/mysql/tables/llx_commande_fournisseur_dispatch.sql b/htdocs/install/mysql/tables/llx_commande_fournisseur_dispatch.sql index b5f85fea250..974e10c09ff 100644 --- a/htdocs/install/mysql/tables/llx_commande_fournisseur_dispatch.sql +++ b/htdocs/install/mysql/tables/llx_commande_fournisseur_dispatch.sql @@ -36,5 +36,6 @@ create table llx_commande_fournisseur_dispatch sellby date DEFAULT NULL, status integer, datec datetime, - tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + cost_price double(24,8) DEFAULT 0 )ENGINE=innodb; diff --git a/htdocs/langs/en_US/receptions.lang b/htdocs/langs/en_US/receptions.lang index 4ee0555c396..46b2d689609 100644 --- a/htdocs/langs/en_US/receptions.lang +++ b/htdocs/langs/en_US/receptions.lang @@ -45,3 +45,4 @@ ReceptionsNumberingModules=Numbering module for receptions ReceptionsReceiptModel=Document templates for receptions NoMorePredefinedProductToDispatch=No more predefined products to dispatch ReceptionExist=A reception exists +ByingPrice=Bying price diff --git a/htdocs/langs/fr_FR/receptions.lang b/htdocs/langs/fr_FR/receptions.lang index 2becadf52c4..5d01e6a75bd 100644 --- a/htdocs/langs/fr_FR/receptions.lang +++ b/htdocs/langs/fr_FR/receptions.lang @@ -45,3 +45,4 @@ ReceptionsNumberingModules=Module de numérotation pour les réceptions ReceptionsReceiptModel=Modèles de document pour les réceptions NoMorePredefinedProductToDispatch=Plus de produits prédéfinis à expédier ReceptionExist=Une réception existe +ByingPrice=Prix d'achat diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index fbb9d246431..520214f0d5c 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -340,6 +340,7 @@ if (empty($reshook)) { $eatby = "dlc".$i; $sellby = "dluo".$i; $batch = "batch".$i; + $cost_price = "cost_price".$i; if (GETPOST($qty, 'int') > 0 || (GETPOST($qty, 'int') == 0 && $conf->global->RECEPTION_GETS_ALL_ORDER_PRODUCTS)) { $ent = "entl".$i; @@ -364,8 +365,11 @@ if (empty($reshook)) { $sellby = GETPOST($sellby, 'alpha'); $eatbydate = str_replace('/', '-', $eatby); $sellbydate = str_replace('/', '-', $sellby); - - $ret = $object->addline($entrepot_id, GETPOST($idl, 'int'), GETPOST($qty, 'int'), $array_options[$i], GETPOST($comment, 'alpha'), strtotime($eatbydate), strtotime($sellbydate), GETPOST($batch, 'alpha')); + if (!empty($conf->global->STOCK_CALCULATE_ON_RECEPTION) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) { + $ret = $object->addline($entrepot_id, GETPOST($idl, 'int'), GETPOST($qty, 'int'), $array_options[$i], GETPOST($comment, 'alpha'), strtotime($eatbydate), strtotime($sellbydate), GETPOST($batch, 'alpha'), GETPOST($cost_price, 'double')); + } else { + $ret = $object->addline($entrepot_id, GETPOST($idl, 'int'), GETPOST($qty, 'int'), $array_options[$i], GETPOST($comment, 'alpha'), strtotime($eatbydate), strtotime($sellbydate), GETPOST($batch, 'alpha')); + } if ($ret < 0) { setEventMessages($object->error, $object->errors, 'errors'); $error++; @@ -989,6 +993,9 @@ if ($action == 'create') { print ''.$langs->trans("QtyOrdered").''; print ''.$langs->trans("QtyReceived").''; print ''.$langs->trans("QtyToReceive"); + if (!empty($conf->global->STOCK_CALCULATE_ON_RECEPTION || $conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) { + print ''.$langs->trans("ByingPrice").''; + } if (empty($conf->productbatch->enabled)) { print '
    ('.$langs->trans("Fill").''; print ' / '.$langs->trans("Reset").')'; @@ -1118,6 +1125,7 @@ if ($action == 'create') { $stock = + $product->stock_warehouse[$dispatchLines[$indiceAsked]['ent']]->real; // Convert to number $deliverableQty = $dispatchLines[$indiceAsked]['qty']; + $cost_price = $dispatchLines[$indiceAsked]['pu']; // Quantity to send print ''; @@ -1132,6 +1140,12 @@ if ($action == 'create') { } print ''; + if (!empty($conf->global->STOCK_CALCULATE_ON_RECEPTION) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) { + print ''; + print ''; + print ''; + } + // Stock if (!empty($conf->stock->enabled)) { print ''; diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index add1be5e831..0b53c6fd17d 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -562,6 +562,9 @@ class Reception extends CommonObject $sql = "SELECT cd.fk_product, cd.subprice,"; $sql .= " ed.rowid, ed.qty, ed.fk_entrepot,"; $sql .= " ed.eatby, ed.sellby, ed.batch"; + if (!empty($conf->global->STOCK_CALCULATE_ON_RECEPTION || $conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) { + $sql .= ", ed.cost_price"; + } $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as cd,"; $sql .= " ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as ed"; $sql .= " WHERE ed.fk_reception = ".((int) $this->id); @@ -589,7 +592,11 @@ class Reception extends CommonObject // line without batch detail // We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record. - $result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ReceptionValidatedInDolibarr", $numref)); + if (!empty($conf->global->STOCK_CALCULATE_ON_RECEPTION || $conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) { + $result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->cost_price, $langs->trans("ReceptionValidatedInDolibarr", $numref)); + } else { + $result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ReceptionValidatedInDolibarr", $numref)); + } if ($result < 0) { $error++; $this->errors[] = $mouvS->error; @@ -601,7 +608,11 @@ class Reception extends CommonObject // We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record. // Note: ->fk_origin_stock = id into table llx_product_batch (may be rename into llx_product_stock_batch in another version) - $result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ReceptionValidatedInDolibarr", $numref), $this->db->jdate($obj->eatby), $this->db->jdate($obj->sellby), $obj->batch); + if (!empty($conf->global->STOCK_CALCULATE_ON_RECEPTION || $conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) { + $result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->cost_price, $langs->trans("ReceptionValidatedInDolibarr", $numref), $this->db->jdate($obj->eatby), $this->db->jdate($obj->sellby), $obj->batch); + } else { + $result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ReceptionValidatedInDolibarr", $numref), $this->db->jdate($obj->eatby), $this->db->jdate($obj->sellby), $obj->batch); + } if ($result < 0) { $error++; $this->errors[] = $mouvS->error; @@ -704,9 +715,10 @@ class Reception extends CommonObject * @param integer $eatby eat-by date * @param integer $sellby sell-by date * @param string $batch Lot number + * @param double $cost_price Line cost * @return int <0 if KO, index of line if OK */ - public function addline($entrepot_id, $id, $qty, $array_options = 0, $comment = '', $eatby = '', $sellby = '', $batch = '') + public function addline($entrepot_id, $id, $qty, $array_options = 0, $comment = '', $eatby = '', $sellby = '', $batch = '', $cost_price = 0) { global $conf, $langs, $user; @@ -746,8 +758,8 @@ class Reception extends CommonObject $line->eatby = $eatby; $line->sellby = $sellby; $line->status = 1; + $line->cost_price = $cost_price; $line->fk_reception = $this->id; - $this->lines[$num] = $line; return $num; From 144147c5d131059b96aaccc6ce44ec32d9d70b67 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 22 Sep 2021 14:58:03 +0200 Subject: [PATCH 0430/1460] FIX check if greater 0 --- htdocs/product/reassort.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index f8db6915409..c327b24e8f0 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -189,7 +189,7 @@ if ($fourn_id > 0) { $sql .= " AND p.rowid = pf.fk_product AND pf.fk_soc = ".((int) $fourn_id); } // Insert categ filter -if ($search_categ) { +if ($search_categ > 0) { $sql .= " AND cp.fk_categorie = ".((int) $search_categ); } $sql .= " GROUP BY p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,"; From 2824c8b8abbb3ce7e8d339da251142d2f2508331 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Sep 2021 15:11:18 +0200 Subject: [PATCH 0431/1460] FIX support of localtax on expense report --- htdocs/commande/card.php | 18 +- htdocs/core/class/commonobject.class.php | 3 +- htdocs/expensereport/card.php | 30 ++- .../class/expensereport.class.php | 247 ++++++++++-------- 4 files changed, 170 insertions(+), 128 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 224c443754a..c40a64032c0 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -278,6 +278,7 @@ if (empty($reshook)) { if (!empty($origin) && !empty($originid)) { // Parse element/subelement (ex: project_task) $element = $subelement = $origin; + $regs = array(); if (preg_match('/^([^_]+)_([^_]+)/i', $origin, $regs)) { $element = $regs [1]; $subelement = $regs [2]; @@ -1394,6 +1395,7 @@ if (empty($reshook)) { /* * View */ + $title = $langs->trans('Order')." - ".$langs->trans('Card'); $help_url = 'EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes|DE:Modul_Kundenaufträge'; llxHeader('', $title, $help_url); @@ -2347,17 +2349,17 @@ if ($action == 'create' && $usercancreate) { if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency)) { // Multicurrency Amount HT print ''.$form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0).''; - print ''.price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; + print ''.price($object->multicurrency_total_ht, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; print ''; // Multicurrency Amount VAT print ''.$form->editfieldkey('MulticurrencyAmountVAT', 'multicurrency_total_tva', '', $object, 0).''; - print ''.price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; + print ''.price($object->multicurrency_total_tva, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; print ''; // Multicurrency Amount TTC print ''.$form->editfieldkey('MulticurrencyAmountTTC', 'multicurrency_total_ttc', '', $object, 0).''; - print ''.price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; + print ''.price($object->multicurrency_total_ttc, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; print ''; } @@ -2367,23 +2369,23 @@ if ($action == 'create' && $usercancreate) { $alert = ' '.img_warning($langs->trans('OrderMinAmount').': '.price($object->thirdparty->order_min_amount)); } print ''.$langs->trans('AmountHT').''; - print ''.price($object->total_ht, 1, '', 1, - 1, - 1, $conf->currency).$alert.''; + print ''.price($object->total_ht, 1, '', 1, -1, -1, $conf->currency).$alert.''; // Total VAT - print ''.$langs->trans('AmountVAT').''.price($object->total_tva, 1, '', 1, - 1, - 1, $conf->currency).''; + print ''.$langs->trans('AmountVAT').''.price($object->total_tva, 1, '', 1, -1, -1, $conf->currency).''; // Amount Local Taxes if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) { // Localtax1 print ''.$langs->transcountry("AmountLT1", $mysoc->country_code).''; - print ''.price($object->total_localtax1, 1, '', 1, - 1, - 1, $conf->currency).''; + print ''.price($object->total_localtax1, 1, '', 1, -1, -1, $conf->currency).''; } if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { // Localtax2 IRPF print ''.$langs->transcountry("AmountLT2", $mysoc->country_code).''; - print ''.price($object->total_localtax2, 1, '', 1, - 1, - 1, $conf->currency).''; + print ''.price($object->total_localtax2, 1, '', 1, -1, -1, $conf->currency).''; } // Total TTC - print ''.$langs->trans('AmountTTC').''.price($object->total_ttc, 1, '', 1, - 1, - 1, $conf->currency).''; + print ''.$langs->trans('AmountTTC').''.price($object->total_ttc, 1, '', 1, -1, -1, $conf->currency).''; // Statut //print '' . $langs->trans('Status') . '' . $object->getLibStatut(4) . ''; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 1f0edd23401..d53b8829686 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3526,7 +3526,7 @@ abstract class CommonObject $this->db->free($resql); - // Now update global field total_ht, total_ttc and tva + // Now update global field total_ht, total_ttc, total_tva, total_localtax1, total_localtax2, multicurrency_total_* $fieldht = 'total_ht'; $fieldtva = 'tva'; $fieldlocaltax1 = 'localtax1'; @@ -3569,6 +3569,7 @@ abstract class CommonObject dol_syslog(get_class($this)."::update_price", LOG_DEBUG); $resql = $this->db->query($sql); + if (!$resql) { $error++; $this->error = $this->db->lasterror(); diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index c01c720f481..138b98bd419 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -220,7 +220,7 @@ if (empty($reshook)) { $object->fk_user_author = $user->id; } - // Check that expense report is for a user inside the hierarchy or advanced permission for all is set + // Check that expense report is for a user inside the hierarchy, or that advanced permission for all is set if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->expensereport->creer)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->expensereport->creer) && empty($user->rights->expensereport->writeall_advance))) { $error++; @@ -1095,7 +1095,7 @@ if (empty($reshook)) { $action = ''; } - if ((int) $tmpvat < 0 || $tmpvat == '') { + if ((float) $tmpvat < 0 || $tmpvat === '') { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("VAT")), null, 'errors'); $action = ''; @@ -1190,7 +1190,6 @@ if (empty($reshook)) { } } - $object->update_totaux_del($object_ligne->total_ht, $object_ligne->total_tva); header("Location: ".$_SERVER["PHP_SELF"]."?id=".GETPOST('id', 'int')); exit; } else { @@ -1240,7 +1239,7 @@ if (empty($reshook)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors'); $action = ''; } - if ((int) $tmpvat < 0 || $tmpvat == '') { + if ((float) $tmpvat < 0 || $tmpvat == '') { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Vat")), null, 'errors'); $action = ''; @@ -1277,8 +1276,6 @@ if (empty($reshook)) { } } - $result = $object->recalculer($id); - //header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); //exit; } else { @@ -1441,8 +1438,6 @@ if ($action == 'create') { } elseif ($id > 0 || $ref) { $result = $object->fetch($id, $ref); - $res = $object->fetch_optionals(); - if ($result > 0) { if (!in_array($object->fk_user_author, $user->getAllChildIds(1))) { if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous) @@ -1843,12 +1838,22 @@ if ($action == 'create') { print ''; print ''.$langs->trans("AmountVAT").''; - print ''.price($object->total_tva, 1, '', 1, - 1, - 1, $conf->currency).''; + print ''.price($object->total_tva, 1, '', 1, -1, -1, $conf->currency).''; print ''; + // Amount Local Taxes + if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) { // Localtax1 + print ''.$langs->transcountry("AmountLT1", $mysoc->country_code).''; + print ''.price($object->total_localtax1, 1, '', 1, -1, -1, $conf->currency).''; + } + if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { // Localtax2 IRPF + print ''.$langs->transcountry("AmountLT2", $mysoc->country_code).''; + print ''.price($object->total_localtax2, 1, '', 1, -1, -1, $conf->currency).''; + } + print ''; print ''.$langs->trans("AmountTTC").''; - print ''.price($object->total_ttc, 1, '', 1, - 1, - 1, $conf->currency).''; + print ''.price($object->total_ttc, 1, '', 1, -1, -1, $conf->currency).''; print ''; // List of payments already done @@ -2053,7 +2058,7 @@ if ($action == 'create') { // Comment print ''.dol_nl2br($line->comments).''; // VAT rate - print ''.vatrate($line->vatrate, true).''; + print ''.vatrate($line->vatrate.($line->vat_src_code ? ' ('.$line->vat_src_code.')' : ''), true).''; // Unit price HT print ''; if (!empty($line->value_unit_ht)) { @@ -2260,8 +2265,9 @@ if ($action == 'create') { print ''; // VAT + $selectedvat = price2num($line->vatrate).($line->vat_src_code ? ' ('.$line->vat_src_code.')' : ''); print ''; - print $form->load_tva('vatrate', (GETPOSTISSET("vatrate") ? GETPOST("vatrate") : $line->vatrate), $mysoc, '', 0, 0, '', false, 1); + print $form->load_tva('vatrate', (GETPOSTISSET("vatrate") ? GETPOST("vatrate") : $selectedvat), $mysoc, '', 0, 0, '', false, 1); print ''; // Unit price diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index d9e97baa81c..86852640596 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -80,8 +80,6 @@ class ExpenseReport extends CommonObject */ public $fk_statut; - public $vat_src_code; - public $fk_c_paiement; public $paid; @@ -124,6 +122,9 @@ class ExpenseReport extends CommonObject // Paiement public $user_paid_infos; + public $localtax1; // for backward compatibility (real field should be total_localtax1 defined into CommonObject) + public $localtax2; // for backward compatibility (real field should be total_localtax2 defined into CommonObject) + /** * Draft status @@ -213,6 +214,10 @@ class ExpenseReport extends CommonObject $this->total_ht = 0; $this->total_ttc = 0; $this->total_tva = 0; + $this->total_localtax1 = 0; + $this->total_localtax2 = 0; + $this->localtax1 = 0; // For backward compatibility + $this->localtax2 = 0; // For backward compatibility $this->modepaymentid = 0; // List of language codes for status @@ -314,12 +319,18 @@ class ExpenseReport extends CommonObject $newndfline->fk_project = $line->fk_project; $newndfline->vatrate = $line->vatrate; $newndfline->vat_src_code = $line->vat_src_code; + $newndfline->localtax1_tx = $line->localtax1_tx; + $newndfline->localtax2_tx = $line->localtax2_tx; + $newndfline->localtax1_type = $line->localtax1_type; + $newndfline->localtax2_type = $line->localtax2_type; $newndfline->comments = $line->comments; $newndfline->qty = $line->qty; $newndfline->value_unit = $line->value_unit; $newndfline->total_ht = $line->total_ht; $newndfline->total_ttc = $line->total_ttc; $newndfline->total_tva = $line->total_tva; + $newndfline->total_localtax1 = $line->total_localtax1; + $newndfline->total_localtax2 = $line->total_localtax2; $newndfline->date = $line->date; $newndfline->rule_warning_message = $line->rule_warning_message; $newndfline->fk_c_exp_tax_cat = $line->fk_c_exp_tax_cat; @@ -539,7 +550,8 @@ class ExpenseReport extends CommonObject $sql = "SELECT d.rowid, d.entity, d.ref, d.note_public, d.note_private,"; // DEFAULT $sql .= " d.detail_refuse, d.detail_cancel, d.fk_user_refuse, d.fk_user_cancel,"; // ACTIONS $sql .= " d.date_refuse, d.date_cancel,"; // ACTIONS - $sql .= " d.total_ht, d.total_ttc, d.total_tva,"; // TOTAUX (int) + $sql .= " d.total_ht, d.total_ttc, d.total_tva,"; + $sql .= " d.localtax1 as total_localtax1, d.localtax2 as total_localtax2,"; $sql .= " d.date_debut, d.date_fin, d.date_create, d.tms as date_modif, d.date_valid, d.date_approve,"; // DATES (datetime) $sql .= " d.fk_user_creat, d.fk_user_author, d.fk_user_modif, d.fk_user_validator,"; $sql .= " d.fk_user_valid, d.fk_user_approve,"; @@ -565,6 +577,11 @@ class ExpenseReport extends CommonObject $this->total_ht = $obj->total_ht; $this->total_tva = $obj->total_tva; $this->total_ttc = $obj->total_ttc; + $this->localtax1 = $obj->total_localtax1; // For backward compatibility + $this->localtax2 = $obj->total_localtax2; // For backward compatibility + $this->total_localtax1 = $obj->total_localtax1; + $this->total_localtax2 = $obj->total_localtax2; + $this->note_public = $obj->note_public; $this->note_private = $obj->note_private; $this->detail_refuse = $obj->detail_refuse; @@ -962,54 +979,6 @@ class ExpenseReport extends CommonObject } } - /** - * recalculer - * TODO Replace this with call to update_price if not already done - * - * @param int $id Id of expense report - * @return int <0 if KO, >0 if OK - */ - public function recalculer($id) - { - $sql = 'SELECT tt.total_ht, tt.total_ttc, tt.total_tva'; - $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element_line.' as tt'; - $sql .= ' WHERE tt.'.$this->fk_element.' = '.((int) $id); - - $total_ht = 0; $total_tva = 0; $total_ttc = 0; - - $result = $this->db->query($sql); - if ($result) { - $num = $this->db->num_rows($result); - $i = 0; - while ($i < $num) { - $objp = $this->db->fetch_object($result); - $total_ht += $objp->total_ht; - $total_tva += $objp->total_tva; - $i++; - } - - $total_ttc = $total_ht + $total_tva; - $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET"; - $sql .= " total_ht = ".price2num($total_ht, 'MT'); - $sql .= " , total_ttc = ".price2num($total_ttc, 'MT'); - $sql .= " , total_tva = ".price2num($total_tva, 'MT'); - $sql .= " WHERE rowid = ".((int) $id); - $result = $this->db->query($sql); - if ($result) { - $this->db->free($result); - return 1; - } else { - $this->error = $this->db->lasterror(); - dol_syslog(get_class($this)."::recalculer: Error ".$this->error, LOG_ERR); - return -3; - } - } else { - $this->error = $this->db->lasterror(); - dol_syslog(get_class($this)."::recalculer: Error ".$this->error, LOG_ERR); - return -3; - } - } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * fetch_lines @@ -1024,14 +993,18 @@ class ExpenseReport extends CommonObject $this->lines = array(); $sql = ' SELECT de.rowid, de.comments, de.qty, de.value_unit, de.date, de.rang,'; - $sql .= ' de.'.$this->fk_element.', de.fk_c_type_fees, de.fk_c_exp_tax_cat, de.fk_projet as fk_project, de.tva_tx, de.fk_ecm_files,'; + $sql .= ' de.'.$this->fk_element.', de.fk_c_type_fees, de.fk_c_exp_tax_cat, de.fk_projet as fk_project,'; + $sql .= ' de.tva_tx, de.vat_src_code,'; + $sql .= ' de.localtax1_tx, de.localtax2_tx, de.localtax1_type, de.localtax2_type,'; + $sql .= ' de.fk_ecm_files,'; $sql .= ' de.total_ht, de.total_tva, de.total_ttc,'; + $sql .= ' de.total_localtax1, de.total_localtax2,'; $sql .= ' ctf.code as code_type_fees, ctf.label as libelle_type_fees,'; $sql .= ' p.ref as ref_projet, p.title as title_projet'; $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element_line.' as de'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_type_fees as ctf ON de.fk_c_type_fees = ctf.id'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'projet as p ON de.fk_projet = p.rowid'; - $sql .= ' WHERE de.'.$this->fk_element.' = '.$this->id; + $sql .= ' WHERE de.'.$this->fk_element.' = '.((int) $this->id); if (!empty($conf->global->EXPENSEREPORT_LINES_SORTED_BY_ROWID)) { $sql .= ' ORDER BY de.rang ASC, de.rowid ASC'; } else { @@ -1065,11 +1038,20 @@ class ExpenseReport extends CommonObject $deplig->total_ht = $objp->total_ht; $deplig->total_tva = $objp->total_tva; $deplig->total_ttc = $objp->total_ttc; + $deplig->total_localtax1 = $objp->total_localtax1; + $deplig->total_localtax2 = $objp->total_totaltax2; $deplig->type_fees_code = empty($objp->code_type_fees) ? 'TF_OTHER' : $objp->code_type_fees; $deplig->type_fees_libelle = $objp->libelle_type_fees; - $deplig->tva_tx = $objp->tva_tx; + + $deplig->tva_tx = $objp->tva_tx; $deplig->vatrate = $objp->tva_tx; + $deplig->vat_src_code = $objp->vat_src_code; + $deplig->localtax1_tx = $objp->localtax1_tx; + $deplig->localtax2_tx = $objp->localtax2_tx; + $deplig->localtax1_type = $objp->localtax1_type; + $deplig->localtax2_type = $objp->localtax2_type; + $deplig->projet_ref = $objp->ref_projet; $deplig->projet_title = $objp->title_projet; @@ -1757,41 +1739,12 @@ class ExpenseReport extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Update total of an expense report when you delete a line. - * - * @param string $ligne_total_ht Amount without taxes - * @param string $ligne_total_tva Amount of all taxes - * @return void - */ - public function update_totaux_del($ligne_total_ht, $ligne_total_tva) - { - // phpcs:enable - $this->total_ht = $this->total_ht - $ligne_total_ht; - $this->total_tva = $this->total_tva - $ligne_total_tva; - $this->total_ttc = $this->total_ht + $this->total_tva; - - $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET"; - $sql .= " total_ht = ".$this->total_ht; - $sql .= " , total_ttc = ".$this->total_ttc; - $sql .= " , total_tva = ".$this->total_tva; - $sql .= " WHERE rowid = ".$this->id; - - $result = $this->db->query($sql); - if ($result) { - return 1; - } else { - $this->error = $this->db->error(); - return -1; - } - } /** * addline * * @param float $qty Qty - * @param double $up Value init + * @param double $up Unit price (price with tax) * @param int $fk_c_type_fees Type payment * @param string $vatrate Vat rate (Can be '10' or '10 (ABC)') * @param string $date Date @@ -1838,7 +1791,14 @@ class ExpenseReport extends CommonObject $this->line = new ExpenseReportLine($this->db); - $localtaxes_type = getLocalTaxesFromRate($vatrate, 0, $mysoc, $this->thirdparty); + // We don't know seller and buyer for expense reports + $seller = $mysoc; // We use same than current company (expense report are often done in same country) + $seller->tva_assuj = 1; // Most seller uses vat + $seller->localtax1_assuj = $mysoc->localtax1_assuj; // We don't know, we reuse the state of company + $seller->localtax2_assuj = $mysoc->localtax1_assuj; // We don't know, we reuse the state of company + $buyer = new Societe($this->db); + + $localtaxes_type = getLocalTaxesFromRate($vatrate, 0, $buyer, $seller); $vat_src_code = ''; $reg = array(); @@ -1848,16 +1808,22 @@ class ExpenseReport extends CommonObject } $vatrate = preg_replace('/\*/', '', $vatrate); - $seller = ''; // seller is unknown - - $tmp = calcul_price_total($qty, $up, 0, $vatrate, 0, 0, 0, 'TTC', 0, $type, $seller, $localtaxes_type); + $tmp = calcul_price_total($qty, $up, 0, $vatrate, -1, -1, 0, 'TTC', 0, $type, $seller, $localtaxes_type); $this->line->value_unit = $up; + $this->line->vat_src_code = $vat_src_code; $this->line->vatrate = price2num($vatrate); + $this->line->localtax1_tx = $localtaxes_type[1]; + $this->line->localtax2_tx = $localtaxes_type[3]; + $this->line->localtax1_type = $localtaxes_type[0]; + $this->line->localtax2_type = $localtaxes_type[2]; + $this->line->total_ttc = $tmp[2]; $this->line->total_ht = $tmp[0]; $this->line->total_tva = $tmp[1]; + $this->line->total_localtax1 = $tmp[9]; + $this->line->total_localtax2 = $tmp[10]; $this->line->fk_expensereport = $this->id; $this->line->qty = $qty; @@ -1899,13 +1865,13 @@ class ExpenseReport extends CommonObject /** * Check constraint of rules and update price if needed * - * @param int $type type of line - * @param string $seller seller, but actually he is unknown - * @return true or false + * @param int $type Type of line + * @param string $seller Seller, but actually he is unknown + * @return true or false */ public function checkRules($type = 0, $seller = '') { - global $user, $conf, $db, $langs; + global $user, $conf, $db, $langs, $mysoc; $langs->load('trips'); @@ -1913,6 +1879,15 @@ class ExpenseReport extends CommonObject return true; // if don't use rules } + // We don't know seller and buyer for expense reports + if (!is_object($seller)) { + $seller = $mysoc; // We use same than current company (expense report are often done in same country) + $seller->tva_assuj = 1; // Most seller uses vat + $seller->localtax1_assuj = $mysoc->localtax1_assuj; // We don't know, we reuse the state of company + $seller->localtax2_assuj = $mysoc->localtax1_assuj; // We don't know, we reuse the state of company + } + //$buyer = new Societe($this->db); + $rulestocheck = ExpenseReportRule::getAllRule($this->line->fk_c_type_fees, $this->line->date, $this->fk_user_author); $violation = 0; @@ -1960,6 +1935,8 @@ class ExpenseReport extends CommonObject $this->line->total_ttc = $tmp[2]; $this->line->total_ht = $tmp[0]; $this->line->total_tva = $tmp[1]; + $this->line->total_localtax1 = $tmp[9]; + $this->line->total_localtax2 = $tmp[10]; return false; } else { @@ -1970,11 +1947,13 @@ class ExpenseReport extends CommonObject /** * Method to apply the offset if needed * - * @return boolean true=applied, false=not applied + * @param int $type Type of line + * @param string $seller Seller, but actually he is unknown + * @return boolean True=applied, False=not applied */ - public function applyOffset() + public function applyOffset($type = 0, $seller = '') { - global $conf; + global $conf, $mysoc; if (empty($conf->global->MAIN_USE_EXPENSE_IK)) { return false; @@ -1987,6 +1966,15 @@ class ExpenseReport extends CommonObject return false; } + // We don't know seller and buyer for expense reports + if (!is_object($seller)) { + $seller = $mysoc; // We use same than current company (expense report are often done in same country) + $seller->tva_assuj = 1; // Most seller uses vat + $seller->localtax1_assuj = $mysoc->localtax1_assuj; // We don't know, we reuse the state of company + $seller->localtax2_assuj = $mysoc->localtax1_assuj; // We don't know, we reuse the state of company + } + //$buyer = new Societe($this->db); + $range = ExpenseReportIk::getRangeByUser($userauthor, $this->line->fk_c_exp_tax_cat); if (empty($range)) { @@ -2010,6 +1998,8 @@ class ExpenseReport extends CommonObject $this->line->total_ttc = $tmp[2]; $this->line->total_ht = $tmp[0]; $this->line->total_tva = $tmp[1]; + $this->line->total_localtax1 = $tmp[9]; + $this->line->total_localtax2 = $tmp[10]; return true; } @@ -2033,7 +2023,7 @@ class ExpenseReport extends CommonObject $sql .= ' AND d.rowid <> '.$this->line->id; } - dol_syslog(get_class($this)."::offsetAlreadyGiven sql=".$sql); + dol_syslog(get_class($this)."::offsetAlreadyGiven"); $resql = $this->db->query($sql); if ($resql) { $num = $this->db->num_rows($resql); @@ -2056,7 +2046,7 @@ class ExpenseReport extends CommonObject * @param double $vatrate Vat rate. Can be '8.5' or '8.5* (8.5NPROM...)' * @param string $comments Description * @param float $qty Qty - * @param double $value_unit Value init + * @param double $value_unit Unit price (with taxes) * @param int $date Date * @param int $expensereport_id Expense report id * @param int $fk_c_exp_tax_cat Id of category of car @@ -2073,7 +2063,10 @@ class ExpenseReport extends CommonObject $type = 0; // TODO What if type is service ? // We don't know seller and buyer for expense reports - $seller = $mysoc; + $seller = $mysoc; // We use same than current company (expense report are often done in same country) + $seller->tva_assuj = 1; // Most seller uses vat + $seller->localtax1_assuj = $mysoc->localtax1_assuj; // We don't know, we reuse the state of company + $seller->localtax2_assuj = $mysoc->localtax1_assuj; // We don't know, we reuse the state of company $buyer = new Societe($this->db); $localtaxes_type = getLocalTaxesFromRate($vatrate, 0, $buyer, $seller); @@ -2087,8 +2080,8 @@ class ExpenseReport extends CommonObject } $vatrate = preg_replace('/\*/', '', $vatrate); - $tmp = calcul_price_total($qty, $value_unit, 0, $vatrate, 0, 0, 0, 'TTC', 0, $type, $seller, $localtaxes_type); - + $tmp = calcul_price_total($qty, $value_unit, 0, $vatrate, -1, -1, 0, 'TTC', 0, $type, $seller, $localtaxes_type); + //var_dump($vatrate);var_dump($localtaxes_type);var_dump($tmp);exit; // calcul total of line //$total_ttc = price2num($qty*$value_unit, 'MT'); @@ -2109,14 +2102,17 @@ class ExpenseReport extends CommonObject $this->line->vat_src_code = $vat_src_code; $this->line->vatrate = price2num($vatrate); - $this->line->total_ttc = $tmp[2]; - $this->line->total_ht = $tmp[0]; - $this->line->total_tva = $tmp[1]; $this->line->localtax1_tx = $localtaxes_type[1]; $this->line->localtax2_tx = $localtaxes_type[3]; $this->line->localtax1_type = $localtaxes_type[0]; $this->line->localtax2_type = $localtaxes_type[2]; + $this->line->total_ttc = $tmp[2]; + $this->line->total_ht = $tmp[0]; + $this->line->total_tva = $tmp[1]; + $this->line->total_localtax1 = $tmp[9]; + $this->line->total_localtax2 = $tmp[10]; + $this->line->fk_ecm_files = $fk_ecm_files; $this->line->id = ((int) $rowid); @@ -2184,6 +2180,8 @@ class ExpenseReport extends CommonObject return -1; } + $this->update_price(); + $this->db->commit(); return 1; @@ -2593,9 +2591,17 @@ class ExpenseReportLine public $projet_title; public $vatrate; + public $vat_src_code; + public $localtax1_tx; + public $localtax2_tx; + public $localtax1_type; + public $localtax2_type; + public $total_ht; public $total_tva; public $total_ttc; + public $total_localtax1; + public $total_localtax2; /** * @var int ID into llx_ecm_files table to link line to attached file @@ -2623,6 +2629,7 @@ class ExpenseReportLine { $sql = 'SELECT fde.rowid, fde.fk_expensereport, fde.fk_c_type_fees, fde.fk_c_exp_tax_cat, fde.fk_projet as fk_project, fde.date,'; $sql .= ' fde.tva_tx as vatrate, fde.vat_src_code, fde.comments, fde.qty, fde.value_unit, fde.total_ht, fde.total_tva, fde.total_ttc, fde.fk_ecm_files,'; + $sql .= ' fde.localtax1_tx, fde.localtax2_tx, fde.localtax1_type, fde.localtax2_type, fde.total_localtax1, fde.total_localtax2,'; $sql .= ' ctf.code as type_fees_code, ctf.label as type_fees_libelle,'; $sql .= ' pjt.rowid as projet_id, pjt.title as projet_title, pjt.ref as projet_ref'; $sql .= ' FROM '.MAIN_DB_PREFIX.'expensereport_det as fde'; @@ -2652,11 +2659,20 @@ class ExpenseReportLine $this->type_fees_libelle = $objp->type_fees_libelle; $this->projet_ref = $objp->projet_ref; $this->projet_title = $objp->projet_title; + $this->vatrate = $objp->vatrate; $this->vat_src_code = $objp->vat_src_code; + $this->localtax1_tx = $objp->localtax1_tx; + $this->localtax2_tx = $objp->localtax2_tx; + $this->localtax1_type = $objp->localtax1_type; + $this->localtax2_type = $objp->localtax2_type; + $this->total_ht = $objp->total_ht; $this->total_tva = $objp->total_tva; $this->total_ttc = $objp->total_ttc; + $this->total_localtax1 = $objp->total_localtax1; + $this->total_localtax2 = $objp->total_localtax2; + $this->fk_ecm_files = $objp->fk_ecm_files; $this->db->free($result); @@ -2695,18 +2711,29 @@ class ExpenseReportLine $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'expensereport_det'; $sql .= ' (fk_expensereport, fk_c_type_fees, fk_projet,'; - $sql .= ' tva_tx, vat_src_code, comments, qty, value_unit, total_ht, total_tva, total_ttc, date, rule_warning_message, fk_c_exp_tax_cat, fk_ecm_files)'; + $sql .= ' tva_tx, vat_src_code,'; + $sql .= ' localtax1_tx, localtax2_tx, localtax1_type, localtax2_type,'; + $sql .= ' comments, qty, value_unit,'; + $sql .= ' total_ht, total_tva, total_ttc,'; + $sql .= ' total_localtax1, total_localtax2,'; + $sql .= ' date, rule_warning_message, fk_c_exp_tax_cat, fk_ecm_files)'; $sql .= " VALUES (".$this->db->escape($this->fk_expensereport).","; $sql .= " ".((int) $this->fk_c_type_fees).","; $sql .= " ".((int) (!empty($this->fk_project) && $this->fk_project > 0) ? $this->fk_project : ((!empty($this->fk_projet) && $this->fk_projet > 0) ? $this->fk_projet : 'null')).","; $sql .= " ".((float) $this->vatrate).","; $sql .= " '".$this->db->escape(empty($this->vat_src_code) ? '' : $this->vat_src_code)."',"; + $sql .= " ".((float) price2num($this->localtax1_tx)).","; + $sql .= " ".((float) price2num($this->localtax2_tx)).","; + $sql .= " '".$this->db->escape($this->localtax1_type)."',"; + $sql .= " '".$this->db->escape($this->localtax2_type)."',"; $sql .= " '".$this->db->escape($this->comments)."',"; $sql .= " ".((float) $this->qty).","; $sql .= " ".((float) $this->value_unit).","; $sql .= " ".((float) price2num($this->total_ht)).","; $sql .= " ".((float) price2num($this->total_tva)).","; $sql .= " ".((float) price2num($this->total_ttc)).","; + $sql .= " ".((float) price2num($this->total_localtax1)).","; + $sql .= " ".((float) price2num($this->total_localtax2)).","; $sql .= " '".$this->db->idate($this->date)."',"; $sql .= " ".(empty($this->rule_warning_message) ? 'null' : "'".$this->db->escape($this->rule_warning_message)."'").","; $sql .= " ".((int) $this->fk_c_exp_tax_cat).","; @@ -2814,11 +2841,17 @@ class ExpenseReportLine $sql .= ", value_unit = ".((float) $this->value_unit); $sql .= ", qty=".((float) $this->qty); $sql .= ", date='".$this->db->idate($this->date)."'"; - $sql .= ", total_ht=".((float) price2num($this->total_ht, 'MT')).""; - $sql .= ", total_tva=".((float) price2num($this->total_tva, 'MT')).""; - $sql .= ", total_ttc=".((float) price2num($this->total_ttc, 'MT')).""; + $sql .= ", total_ht=".((float) price2num($this->total_ht, 'MT')); + $sql .= ", total_tva=".((float) price2num($this->total_tva, 'MT')); + $sql .= ", total_ttc=".((float) price2num($this->total_ttc, 'MT')); + $sql .= ", total_localtax1=".((float) price2num($this->total_localtax1, 'MT')); + $sql .= ", total_localtax2=".((float) price2num($this->total_localtax2, 'MT')); $sql .= ", tva_tx=".((float) $this->vatrate); $sql .= ", vat_src_code='".$this->db->escape($this->vat_src_code)."'"; + $sql .= ", localtax1_tx=".((float) $this->localtax1_tx); + $sql .= ", localtax2_tx=".((float) $this->localtax2_tx); + $sql .= ", localtax1_type='".$this->db->escape($this->localtax1_type)."'"; + $sql .= ", localtax2_type='".$this->db->escape($this->localtax2_type)."'"; $sql .= ", rule_warning_message='".$this->db->escape($this->rule_warning_message)."'"; $sql .= ", fk_c_exp_tax_cat=".$this->db->escape($this->fk_c_exp_tax_cat); $sql .= ", fk_ecm_files=".($this->fk_ecm_files > 0 ? ((int) $this->fk_ecm_files) : 'null'); From 066013c31f90d4d134057e2bc8ec68796962186b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Cendrier?= Date: Wed, 22 Sep 2021 15:15:39 +0200 Subject: [PATCH 0432/1460] typo stickler --- htdocs/core/lib/project.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 4e4adaf9d3e..2467baa034a 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -134,7 +134,7 @@ function project_prepare_head(Project $project, $moreparam = '') if (!is_null($dataretrieved)) { $nbElements = $dataretrieved; } else { - if (!empty ($conf->stock->enabled)) { + if (!empty($conf->stock->enabled)) { $nbElements += $project->getElementCount('stock', 'entrepot', 'fk_project'); } if (!empty($conf->propal->enabled)) { From 2bd0fdd364b35d60625d81aaac23c669b9ac9d67 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 22 Sep 2021 14:09:29 +0000 Subject: [PATCH 0433/1460] Fixing style errors. --- htdocs/expensereport/card.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 138b98bd419..81995792dbb 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -1842,14 +1842,14 @@ if ($action == 'create') { print ''; // Amount Local Taxes - if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) { // Localtax1 - print ''.$langs->transcountry("AmountLT1", $mysoc->country_code).''; - print ''.price($object->total_localtax1, 1, '', 1, -1, -1, $conf->currency).''; - } - if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { // Localtax2 IRPF - print ''.$langs->transcountry("AmountLT2", $mysoc->country_code).''; - print ''.price($object->total_localtax2, 1, '', 1, -1, -1, $conf->currency).''; - } + if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) { // Localtax1 + print ''.$langs->transcountry("AmountLT1", $mysoc->country_code).''; + print ''.price($object->total_localtax1, 1, '', 1, -1, -1, $conf->currency).''; + } + if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { // Localtax2 IRPF + print ''.$langs->transcountry("AmountLT2", $mysoc->country_code).''; + print ''.price($object->total_localtax2, 1, '', 1, -1, -1, $conf->currency).''; + } print ''; print ''.$langs->trans("AmountTTC").''; From e74043d48e8cec111fb052506bc9621f107b8f1d Mon Sep 17 00:00:00 2001 From: javieralapps4up Date: Wed, 22 Sep 2021 17:56:31 +0200 Subject: [PATCH 0434/1460] Close: #18801 Jan-30 + 1m IS NOT Mar-2 Close: #18801 related to avoid this behaviour https://bugs.php.net/bug.php?id=74013 --- htdocs/core/lib/date.lib.php | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index fe21071901a..21a8835a229 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -166,7 +166,33 @@ function dol_time_plus_duree($time, $duration_value, $duration_unit) } else { $date->add($interval); } - + //Change the behavior of PHP over data-interval when the result of this function is Feb 29 (non-leap years), 30 or Feb 31 (php returns March 1, 2 or 3 respectively) + if ($conf->global->MAIN_DATE_CHANGE_PHP_DATEINTERVAL_RESULT_FEBRUARY && $duration_unit == 'm') { + + $timeyear = dol_print_date($time, '%Y'); + $timemonth = dol_print_date($time, '%m'); + $timetotalmonths = (($timeyear * 12) + $timemonth); + + $monthsexpected = ($timetotalmonths + $duration_value); + + $newtime = $date->getTimestamp(); + + $newtimeyear = dol_print_date($newtime, '%Y'); + $newtimemonth = dol_print_date($newtime, '%m'); + $newtimetotalmonths = (($newtimeyear * 12) + $newtimemonth); + + if ($monthsexpected < $newtimetotalmonths) { + + $newtimehours = dol_print_date($newtime, '%m'); + $newtimemins = dol_print_date($newtime, '%m'); + $newtimesecs = dol_print_date($newtime, '%m'); + + $datelim = dol_mktime($newtimehours, $newtimemins, $newtimesecs, $newtimemonth, 1, $newtimeyear); + $datelim -= (3600 * 24); + + $date->setTimestamp($datelim); + } + } return $date->getTimestamp(); } From e5cff0ede117553c11b269a2a529fbac41eee8fb Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 22 Sep 2021 16:07:36 +0000 Subject: [PATCH 0435/1460] Fixing style errors. --- htdocs/core/lib/date.lib.php | 46 +++++++++++++++++------------------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 21a8835a229..cff6d22518f 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -168,30 +168,28 @@ function dol_time_plus_duree($time, $duration_value, $duration_unit) } //Change the behavior of PHP over data-interval when the result of this function is Feb 29 (non-leap years), 30 or Feb 31 (php returns March 1, 2 or 3 respectively) if ($conf->global->MAIN_DATE_CHANGE_PHP_DATEINTERVAL_RESULT_FEBRUARY && $duration_unit == 'm') { - - $timeyear = dol_print_date($time, '%Y'); - $timemonth = dol_print_date($time, '%m'); - $timetotalmonths = (($timeyear * 12) + $timemonth); - - $monthsexpected = ($timetotalmonths + $duration_value); - - $newtime = $date->getTimestamp(); - - $newtimeyear = dol_print_date($newtime, '%Y'); - $newtimemonth = dol_print_date($newtime, '%m'); - $newtimetotalmonths = (($newtimeyear * 12) + $newtimemonth); - - if ($monthsexpected < $newtimetotalmonths) { - - $newtimehours = dol_print_date($newtime, '%m'); - $newtimemins = dol_print_date($newtime, '%m'); - $newtimesecs = dol_print_date($newtime, '%m'); - - $datelim = dol_mktime($newtimehours, $newtimemins, $newtimesecs, $newtimemonth, 1, $newtimeyear); - $datelim -= (3600 * 24); - - $date->setTimestamp($datelim); - } + $timeyear = dol_print_date($time, '%Y'); + $timemonth = dol_print_date($time, '%m'); + $timetotalmonths = (($timeyear * 12) + $timemonth); + + $monthsexpected = ($timetotalmonths + $duration_value); + + $newtime = $date->getTimestamp(); + + $newtimeyear = dol_print_date($newtime, '%Y'); + $newtimemonth = dol_print_date($newtime, '%m'); + $newtimetotalmonths = (($newtimeyear * 12) + $newtimemonth); + + if ($monthsexpected < $newtimetotalmonths) { + $newtimehours = dol_print_date($newtime, '%m'); + $newtimemins = dol_print_date($newtime, '%m'); + $newtimesecs = dol_print_date($newtime, '%m'); + + $datelim = dol_mktime($newtimehours, $newtimemins, $newtimesecs, $newtimemonth, 1, $newtimeyear); + $datelim -= (3600 * 24); + + $date->setTimestamp($datelim); + } } return $date->getTimestamp(); } From 70e66627fed60b611adda6d1fab22f4647580914 Mon Sep 17 00:00:00 2001 From: Laurent De Coninck Date: Wed, 22 Sep 2021 20:14:47 +0200 Subject: [PATCH 0436/1460] restrict the html --- htdocs/takepos/admin/receipt.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/takepos/admin/receipt.php b/htdocs/takepos/admin/receipt.php index 61fd71bdf29..3350da50104 100644 --- a/htdocs/takepos/admin/receipt.php +++ b/htdocs/takepos/admin/receipt.php @@ -42,8 +42,8 @@ if (GETPOST('action', 'alpha') == 'set') { $db->begin(); - $res = dolibarr_set_const($db, "TAKEPOS_HEADER", GETPOST('TAKEPOS_HEADER', 'none'), 'chaine', 0, '', $conf->entity); - $res = dolibarr_set_const($db, "TAKEPOS_FOOTER", GETPOST('TAKEPOS_FOOTER', 'none'), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "TAKEPOS_HEADER", GETPOST('TAKEPOS_HEADER', 'restricthtml'), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "TAKEPOS_FOOTER", GETPOST('TAKEPOS_FOOTER', 'restricthtml'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_RECEIPT_NAME", GETPOST('TAKEPOS_RECEIPT_NAME', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_SHOW_CUSTOMER", GETPOST('TAKEPOS_SHOW_CUSTOMER', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_AUTO_PRINT_TICKETS", GETPOST('TAKEPOS_AUTO_PRINT_TICKETS', 'int'), 'int', 0, '', $conf->entity); From 1e0a7e43424f541538ef253f97e62671801ef833 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Sep 2021 02:10:39 +0200 Subject: [PATCH 0437/1460] FIX Test when date of invoie is in future (pb with TZ and offset) --- htdocs/compta/facture/card.php | 51 +++++++++++++++---------------- htdocs/core/lib/functions.lib.php | 2 +- htdocs/fourn/facture/card.php | 22 +++++++------ 3 files changed, 39 insertions(+), 36 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 105c94d6a73..d4cf0a68441 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -408,13 +408,21 @@ if (empty($reshook)) { } elseif ($action == 'setinvoicedate' && $usercancreate) { $object->fetch($id); $old_date_lim_reglement = $object->date_lim_reglement; - $date = dol_mktime(12, 0, 0, GETPOST('invoicedatemonth', 'int'), GETPOST('invoicedateday', 'int'), GETPOST('invoicedateyear', 'int')); - if (empty($date)) { + $newdate = dol_mktime(0, 0, 0, GETPOST('invoicedatemonth', 'int'), GETPOST('invoicedateday', 'int'), GETPOST('invoicedateyear', 'int'), 'tzserver'); + if (empty($newdate)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); - header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id.'&action=editinvoicedate'); + header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id.'&action=editinvoicedate&token='.newToken()); exit; } - $object->date = $date; + if ($newdate > (dol_now('tzuserrel') + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { + if (empty($conf->global->INVOICE_MAX_FUTURE_DELAY)) { + setEventMessages($langs->trans("WarningInvoiceDateInFuture"), null, 'warnings'); + } else { + setEventMessages($langs->trans("WarningInvoiceDateTooFarInFuture"), null, 'warnings'); + } + } + + $object->date = $newdate; $new_date_lim_reglement = $object->calculate_date_lim_reglement(); if ($new_date_lim_reglement > $old_date_lim_reglement) { $object->date_lim_reglement = $new_date_lim_reglement; @@ -428,7 +436,9 @@ if (empty($reshook)) { } } elseif ($action == 'setdate_pointoftax' && $usercancreate) { $object->fetch($id); - $date_pointoftax = dol_mktime(12, 0, 0, $_POST['date_pointoftaxmonth'], $_POST['date_pointoftaxday'], $_POST['date_pointoftaxyear']); + + $date_pointoftax = dol_mktime(0, 0, 0, GETPOST('date_pointoftaxmonth', 'int'), GETPOST('date_pointoftaxday', 'int'), GETPOST('date_pointoftaxyear', 'int'), 'tzserver'); + $object->date_pointoftax = $date_pointoftax; $result = $object->update($user); if ($result < 0) { @@ -1001,14 +1011,16 @@ if (empty($reshook)) { $error++; } + $dateinvoice = dol_mktime(0, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server + $date_pointoftax = dol_mktime(0, 0, 0, GETPOST('date_pointoftaxmonth', 'int'), GETPOST('date_pointoftaxday', 'int'), GETPOST('date_pointoftaxyear', 'int'), 'tzserver'); + // Replacement invoice if (GETPOST('type') == Facture::TYPE_REPLACEMENT) { - $dateinvoice = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); if (empty($dateinvoice)) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); $action = 'create'; - } elseif ($dateinvoice > (dol_get_last_hour(dol_now()) + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { + } elseif ($dateinvoice > (dol_get_last_hour(dol_now('tzuserrel')) + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { $error++; setEventMessages($langs->trans("ErrorDateIsInFuture"), null, 'errors'); $action = 'create'; @@ -1020,8 +1032,6 @@ if (empty($reshook)) { $action = 'create'; } - $date_pointoftax = dol_mktime(12, 0, 0, GETPOST('date_pointoftaxmonth', 'int'), GETPOST('date_pointoftaxday', 'int'), GETPOST('date_pointoftaxyear', 'int')); - if (!$error) { // This is a replacement invoice $result = $object->fetch(GETPOST('fac_replacement', 'int')); @@ -1064,19 +1074,16 @@ if (empty($reshook)) { $action = 'create'; } - $dateinvoice = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); if (empty($dateinvoice)) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); $action = 'create'; - } elseif ($dateinvoice > (dol_get_last_hour(dol_now()) + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { + } elseif ($dateinvoice > (dol_get_last_hour(dol_now('tzuserrel')) + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { $error++; setEventMessages($langs->trans("ErrorDateIsInFuture"), null, 'errors'); $action = 'create'; } - $date_pointoftax = dol_mktime(12, 0, 0, GETPOST('date_pointoftaxmonth', 'int'), GETPOST('date_pointoftaxday', 'int'), GETPOST('date_pointoftaxyear', 'int')); - if (!$error) { if (!empty($originentity)) { $object->entity = $originentity; @@ -1280,19 +1287,16 @@ if (empty($reshook)) { // Standard invoice or Deposit invoice, created from a Predefined template invoice if ((GETPOST('type') == Facture::TYPE_STANDARD || GETPOST('type') == Facture::TYPE_DEPOSIT) && GETPOST('fac_rec', 'int') > 0) { - $dateinvoice = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); if (empty($dateinvoice)) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); $action = 'create'; - } elseif ($dateinvoice > (dol_get_last_hour(dol_now()) + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { + } elseif ($dateinvoice > (dol_get_last_hour(dol_now('tzuserrel')) + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { $error++; setEventMessages($langs->trans("ErrorDateIsInFuture"), null, 'errors'); $action = 'create'; } - $date_pointoftax = dol_mktime(12, 0, 0, $_POST['date_pointoftaxmonth'], $_POST['date_pointoftaxday'], $_POST['date_pointoftaxyear']); - if (!$error) { $object->socid = GETPOST('socid', 'int'); $object->type = GETPOST('type'); @@ -1327,8 +1331,6 @@ if (empty($reshook)) { $typeamount = GETPOST('typedeposit', 'aZ09'); $valuestandardinvoice = price2num(str_replace('%', '', GETPOST('valuestandardinvoice', 'alpha')), 'MU'); $valuedeposit = price2num(str_replace('%', '', GETPOST('valuedeposit', 'alpha')), 'MU'); - $dateinvoice = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); - $date_pointoftax = dol_mktime(12, 0, 0, GETPOST('date_pointoftaxmonth', 'int'), GETPOST('date_pointoftaxday', 'int'), GETPOST('date_pointoftaxyear', 'int')); if (GETPOST('socid', 'int') < 1) { $error++; @@ -1340,7 +1342,7 @@ if (empty($reshook)) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); $action = 'create'; - } elseif ($dateinvoice > (dol_get_last_hour(dol_now()) + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { + } elseif ($dateinvoice > (dol_get_last_hour(dol_now('tzuserrel')) + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { $error++; setEventMessages($langs->trans("ErrorDateIsInFuture"), null, 'errors'); $action = 'create'; @@ -1822,19 +1824,16 @@ if (empty($reshook)) { // Situation invoices if (GETPOST('type') == Facture::TYPE_SITUATION && GETPOST('situations')) { - $dateinvoice = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); if (empty($dateinvoice)) { $error++; $mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")); setEventMessages($mesg, null, 'errors'); - } elseif ($dateinvoice > (dol_get_last_hour(dol_now()) + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { + } elseif ($dateinvoice > (dol_get_last_hour(dol_now('tzuserrel')) + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { $error++; setEventMessages($langs->trans("ErrorDateIsInFuture"), null, 'errors'); $action = 'create'; } - $date_pointoftax = dol_mktime(12, 0, 0, GETPOST('date_pointoftaxmonth', 'int'), GETPOST('date_pointoftaxday', 'int'), GETPOST('date_pointoftaxyear', 'int')); - if (!(GETPOST('situations', 'int') > 0)) { $error++; $mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("InvoiceSituation")); @@ -3529,7 +3528,8 @@ if ($action == 'create') { print ''; } - $newdateinvoice = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); + $newdateinvoice = dol_mktime(0, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'), 'tzserver'); + $date_pointoftax = dol_mktime(0, 0, 0, GETPOST('date_pointoftaxmonth', 'int'), GETPOST('date_pointoftaxday', 'int'), GETPOST('date_pointoftaxyear', 'int'), 'tzserver'); // Date invoice print ''.$langs->trans('DateInvoice').''; @@ -3539,7 +3539,6 @@ if ($action == 'create') { // Date point of tax if (!empty($conf->global->INVOICE_POINTOFTAX_DATE)) { print ''.$langs->trans('DatePointOfTax').''; - $date_pointoftax = dol_mktime(12, 0, 0, GETPOST('date_pointoftaxmonth', 'int'), GETPOST('date_pointoftaxday', 'int'), GETPOST('date_pointoftaxyear', 'int')); print $form->selectDate($date_pointoftax ? $date_pointoftax : -1, 'date_pointoftax', '', '', '', "add", 1, 1); print ''; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 357fcc9972f..698bf4410da 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2508,7 +2508,7 @@ function dol_getdate($timestamp, $fast = false, $forcetimezone = '') * False or 0 or 'tzserver' = local to server TZ * 'auto' * 'tzuser' = local to user TZ taking dst into account at the current date. Not yet implemented. - * 'tzuserrel' = local to user TZ taking dst into account at the given date. Use this one to convert date input from user. + * 'tzuserrel' = local to user TZ taking dst into account at the given date. Use this one to convert date input from user into a GMT date. * 'tz,TimeZone' = use specified timezone * @param int $check 0=No check on parameters (Can use day 32, etc...) * @return int|string Date as a timestamp, '' or false if error diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 88c37aaaf22..9b1da2aa530 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -423,9 +423,9 @@ if (empty($reshook)) { dol_print_error($db); } } elseif ($action == 'setdatef' && $usercancreate) { - $newdate = dol_mktime(0, 0, 0, $_POST['datefmonth'], $_POST['datefday'], $_POST['datefyear']); - if ($newdate > (dol_now() + (empty($conf->global->INVOICE_MAX_OFFSET_IN_FUTURE) ? 0 : $conf->global->INVOICE_MAX_OFFSET_IN_FUTURE))) { - if (empty($conf->global->INVOICE_MAX_OFFSET_IN_FUTURE)) { + $newdate = dol_mktime(0, 0, 0, GETPOST('datefmonth', 'int'), GETPOST('datefday', 'int'), GETPOST('datefyear', 'int'), 'tzserver'); + if ($newdate > (dol_now('tzuserrel') + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { + if (empty($conf->global->INVOICE_MAX_FUTURE_DELAY)) { setEventMessages($langs->trans("WarningInvoiceDateInFuture"), null, 'warnings'); } else { setEventMessages($langs->trans("WarningInvoiceDateTooFarInFuture"), null, 'warnings'); @@ -449,7 +449,7 @@ if (empty($reshook)) { } } elseif ($action == 'setdate_lim_reglement' && $usercancreate) { $object->fetch($id); - $object->date_echeance = dol_mktime(12, 0, 0, $_POST['date_lim_reglementmonth'], $_POST['date_lim_reglementday'], $_POST['date_lim_reglementyear']); + $object->date_echeance = dol_mktime(12, 0, 0, GETPOST('date_lim_reglementmonth', 'int'), GETPOST('date_lim_reglementday', 'int'), GETPOST('date_lim_reglementyear', 'int')); if (!empty($object->date_echeance) && $object->date_echeance < $object->date) { $object->date_echeance = $object->date; setEventMessages($langs->trans("DatePaymentTermCantBeLowerThanObjectDate"), null, 'warnings'); @@ -706,8 +706,12 @@ if (empty($reshook)) { $error++; } - $dateinvoice = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); - $datedue = dol_mktime(12, 0, 0, GETPOST('echmonth', 'int'), GETPOST('echday', 'int'), GETPOST('echyear', 'int')); + $dateinvoice = dol_mktime(0, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server + $datedue = dol_mktime(0, 0, 0, GETPOST('echmonth', 'int'), GETPOST('echday', 'int'), GETPOST('echyear', 'int'), 'tzserver'); + /*var_dump($dateinvoice.' '.dol_print_date($dateinvoice, 'dayhour')); + var_dump(dol_now('tzuserrel').' '.dol_get_last_hour(dol_now('tzuserrel')).' '.dol_print_date(dol_now('tzuserrel'),'dayhour').' '.dol_print_date(dol_get_last_hour(dol_now('tzuserrel')), 'dayhour')); + var_dump($db->idate($dateinvoice)); + exit;*/ // Replacement invoice if (GETPOST('type') == FactureFournisseur::TYPE_REPLACEMENT) { @@ -716,7 +720,7 @@ if (empty($reshook)) { $action = 'create'; $_GET['socid'] = $_POST['socid']; $error++; - } elseif ($dateinvoice > (dol_get_last_hour(dol_now()) + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { + } elseif ($dateinvoice > (dol_get_last_hour(dol_now('tzuserrel')) + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { $error++; setEventMessages($langs->trans("ErrorDateIsInFuture"), null, 'errors'); $action = 'create'; @@ -780,7 +784,7 @@ if (empty($reshook)) { $action = 'create'; $_GET['socid'] = $_POST['socid']; $error++; - } elseif ($dateinvoice > (dol_get_last_hour(dol_now()) + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { + } elseif ($dateinvoice > (dol_get_last_hour(dol_now('tzuserrel')) + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { $error++; setEventMessages($langs->trans("ErrorDateIsInFuture"), null, 'errors'); $action = 'create'; @@ -889,7 +893,7 @@ if (empty($reshook)) { $action = 'create'; $_GET['socid'] = $_POST['socid']; $error++; - } elseif ($dateinvoice > (dol_get_last_hour(dol_now()) + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { + } elseif ($dateinvoice > (dol_get_last_hour(dol_now('tzuserrel')) + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { $error++; setEventMessages($langs->trans("ErrorDateIsInFuture"), null, 'errors'); $action = 'create'; From 51b6318f880fb3e3bb2fcc705894abd081a45f6f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Sep 2021 02:10:39 +0200 Subject: [PATCH 0438/1460] FIX Test when date of invoie is in future (pb with TZ and offset) --- htdocs/compta/facture/card.php | 51 +++++++++++++++---------------- htdocs/core/lib/functions.lib.php | 2 +- htdocs/fourn/facture/card.php | 22 +++++++------ 3 files changed, 39 insertions(+), 36 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index d019b2dcf9a..6ea03d8bd23 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -393,13 +393,21 @@ if (empty($reshook)) { } elseif ($action == 'setinvoicedate' && $usercancreate) { $object->fetch($id); $old_date_lim_reglement = $object->date_lim_reglement; - $date = dol_mktime(12, 0, 0, GETPOST('invoicedatemonth', 'int'), GETPOST('invoicedateday', 'int'), GETPOST('invoicedateyear', 'int')); - if (empty($date)) { + $newdate = dol_mktime(0, 0, 0, GETPOST('invoicedatemonth', 'int'), GETPOST('invoicedateday', 'int'), GETPOST('invoicedateyear', 'int'), 'tzserver'); + if (empty($newdate)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); - header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id.'&action=editinvoicedate'); + header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id.'&action=editinvoicedate&token='.newToken()); exit; } - $object->date = $date; + if ($newdate > (dol_now('tzuserrel') + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { + if (empty($conf->global->INVOICE_MAX_FUTURE_DELAY)) { + setEventMessages($langs->trans("WarningInvoiceDateInFuture"), null, 'warnings'); + } else { + setEventMessages($langs->trans("WarningInvoiceDateTooFarInFuture"), null, 'warnings'); + } + } + + $object->date = $newdate; $new_date_lim_reglement = $object->calculate_date_lim_reglement(); if ($new_date_lim_reglement > $old_date_lim_reglement) { $object->date_lim_reglement = $new_date_lim_reglement; @@ -413,7 +421,9 @@ if (empty($reshook)) { } } elseif ($action == 'setdate_pointoftax' && $usercancreate) { $object->fetch($id); - $date_pointoftax = dol_mktime(12, 0, 0, $_POST['date_pointoftaxmonth'], $_POST['date_pointoftaxday'], $_POST['date_pointoftaxyear']); + + $date_pointoftax = dol_mktime(0, 0, 0, GETPOST('date_pointoftaxmonth', 'int'), GETPOST('date_pointoftaxday', 'int'), GETPOST('date_pointoftaxyear', 'int'), 'tzserver'); + $object->date_pointoftax = $date_pointoftax; $result = $object->update($user); if ($result < 0) { @@ -986,14 +996,16 @@ if (empty($reshook)) { $error++; } + $dateinvoice = dol_mktime(0, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server + $date_pointoftax = dol_mktime(0, 0, 0, GETPOST('date_pointoftaxmonth', 'int'), GETPOST('date_pointoftaxday', 'int'), GETPOST('date_pointoftaxyear', 'int'), 'tzserver'); + // Replacement invoice if (GETPOST('type') == Facture::TYPE_REPLACEMENT) { - $dateinvoice = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); if (empty($dateinvoice)) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); $action = 'create'; - } elseif ($dateinvoice > (dol_get_last_hour(dol_now()) + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { + } elseif ($dateinvoice > (dol_get_last_hour(dol_now('tzuserrel')) + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { $error++; setEventMessages($langs->trans("ErrorDateIsInFuture"), null, 'errors'); $action = 'create'; @@ -1005,8 +1017,6 @@ if (empty($reshook)) { $action = 'create'; } - $date_pointoftax = dol_mktime(12, 0, 0, GETPOST('date_pointoftaxmonth', 'int'), GETPOST('date_pointoftaxday', 'int'), GETPOST('date_pointoftaxyear', 'int')); - if (!$error) { // This is a replacement invoice $result = $object->fetch(GETPOST('fac_replacement', 'int')); @@ -1049,19 +1059,16 @@ if (empty($reshook)) { $action = 'create'; } - $dateinvoice = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); if (empty($dateinvoice)) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); $action = 'create'; - } elseif ($dateinvoice > (dol_get_last_hour(dol_now()) + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { + } elseif ($dateinvoice > (dol_get_last_hour(dol_now('tzuserrel')) + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { $error++; setEventMessages($langs->trans("ErrorDateIsInFuture"), null, 'errors'); $action = 'create'; } - $date_pointoftax = dol_mktime(12, 0, 0, GETPOST('date_pointoftaxmonth', 'int'), GETPOST('date_pointoftaxday', 'int'), GETPOST('date_pointoftaxyear', 'int')); - if (!$error) { if (!empty($originentity)) { $object->entity = $originentity; @@ -1265,19 +1272,16 @@ if (empty($reshook)) { // Standard invoice or Deposit invoice, created from a Predefined template invoice if ((GETPOST('type') == Facture::TYPE_STANDARD || GETPOST('type') == Facture::TYPE_DEPOSIT) && GETPOST('fac_rec', 'int') > 0) { - $dateinvoice = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); if (empty($dateinvoice)) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); $action = 'create'; - } elseif ($dateinvoice > (dol_get_last_hour(dol_now()) + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { + } elseif ($dateinvoice > (dol_get_last_hour(dol_now('tzuserrel')) + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { $error++; setEventMessages($langs->trans("ErrorDateIsInFuture"), null, 'errors'); $action = 'create'; } - $date_pointoftax = dol_mktime(12, 0, 0, $_POST['date_pointoftaxmonth'], $_POST['date_pointoftaxday'], $_POST['date_pointoftaxyear']); - if (!$error) { $object->socid = GETPOST('socid', 'int'); $object->type = GETPOST('type'); @@ -1312,8 +1316,6 @@ if (empty($reshook)) { $typeamount = GETPOST('typedeposit', 'aZ09'); $valuestandardinvoice = price2num(str_replace('%', '', GETPOST('valuestandardinvoice', 'alpha')), 'MU'); $valuedeposit = price2num(str_replace('%', '', GETPOST('valuedeposit', 'alpha')), 'MU'); - $dateinvoice = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); - $date_pointoftax = dol_mktime(12, 0, 0, GETPOST('date_pointoftaxmonth', 'int'), GETPOST('date_pointoftaxday', 'int'), GETPOST('date_pointoftaxyear', 'int')); if (GETPOST('socid', 'int') < 1) { $error++; @@ -1325,7 +1327,7 @@ if (empty($reshook)) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); $action = 'create'; - } elseif ($dateinvoice > (dol_get_last_hour(dol_now()) + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { + } elseif ($dateinvoice > (dol_get_last_hour(dol_now('tzuserrel')) + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { $error++; setEventMessages($langs->trans("ErrorDateIsInFuture"), null, 'errors'); $action = 'create'; @@ -1807,19 +1809,16 @@ if (empty($reshook)) { // Situation invoices if (GETPOST('type') == Facture::TYPE_SITUATION && GETPOST('situations')) { - $dateinvoice = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); if (empty($dateinvoice)) { $error++; $mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")); setEventMessages($mesg, null, 'errors'); - } elseif ($dateinvoice > (dol_get_last_hour(dol_now()) + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { + } elseif ($dateinvoice > (dol_get_last_hour(dol_now('tzuserrel')) + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { $error++; setEventMessages($langs->trans("ErrorDateIsInFuture"), null, 'errors'); $action = 'create'; } - $date_pointoftax = dol_mktime(12, 0, 0, GETPOST('date_pointoftaxmonth', 'int'), GETPOST('date_pointoftaxday', 'int'), GETPOST('date_pointoftaxyear', 'int')); - if (!(GETPOST('situations', 'int') > 0)) { $error++; $mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("InvoiceSituation")); @@ -3514,7 +3513,8 @@ if ($action == 'create') { print ''; } - $newdateinvoice = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); + $newdateinvoice = dol_mktime(0, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'), 'tzserver'); + $date_pointoftax = dol_mktime(0, 0, 0, GETPOST('date_pointoftaxmonth', 'int'), GETPOST('date_pointoftaxday', 'int'), GETPOST('date_pointoftaxyear', 'int'), 'tzserver'); // Date invoice print ''.$langs->trans('DateInvoice').''; @@ -3524,7 +3524,6 @@ if ($action == 'create') { // Date point of tax if (!empty($conf->global->INVOICE_POINTOFTAX_DATE)) { print ''.$langs->trans('DatePointOfTax').''; - $date_pointoftax = dol_mktime(12, 0, 0, GETPOST('date_pointoftaxmonth', 'int'), GETPOST('date_pointoftaxday', 'int'), GETPOST('date_pointoftaxyear', 'int')); print $form->selectDate($date_pointoftax ? $date_pointoftax : -1, 'date_pointoftax', '', '', '', "add", 1, 1); print ''; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 3ae97098a79..370b10da626 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2487,7 +2487,7 @@ function dol_getdate($timestamp, $fast = false, $forcetimezone = '') * False or 0 or 'tzserver' = local to server TZ * 'auto' * 'tzuser' = local to user TZ taking dst into account at the current date. Not yet implemented. - * 'tzuserrel' = local to user TZ taking dst into account at the given date. Use this one to convert date input from user. + * 'tzuserrel' = local to user TZ taking dst into account at the given date. Use this one to convert date input from user into a GMT date. * 'tz,TimeZone' = use specified timezone * @param int $check 0=No check on parameters (Can use day 32, etc...) * @return int|string Date as a timestamp, '' or false if error diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index db1497f5166..86ddda9769a 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -408,9 +408,9 @@ if (empty($reshook)) { dol_print_error($db); } } elseif ($action == 'setdatef' && $usercancreate) { - $newdate = dol_mktime(0, 0, 0, $_POST['datefmonth'], $_POST['datefday'], $_POST['datefyear']); - if ($newdate > (dol_now() + (empty($conf->global->INVOICE_MAX_OFFSET_IN_FUTURE) ? 0 : $conf->global->INVOICE_MAX_OFFSET_IN_FUTURE))) { - if (empty($conf->global->INVOICE_MAX_OFFSET_IN_FUTURE)) { + $newdate = dol_mktime(0, 0, 0, GETPOST('datefmonth', 'int'), GETPOST('datefday', 'int'), GETPOST('datefyear', 'int'), 'tzserver'); + if ($newdate > (dol_now('tzuserrel') + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { + if (empty($conf->global->INVOICE_MAX_FUTURE_DELAY)) { setEventMessages($langs->trans("WarningInvoiceDateInFuture"), null, 'warnings'); } else { setEventMessages($langs->trans("WarningInvoiceDateTooFarInFuture"), null, 'warnings'); @@ -434,7 +434,7 @@ if (empty($reshook)) { } } elseif ($action == 'setdate_lim_reglement' && $usercancreate) { $object->fetch($id); - $object->date_echeance = dol_mktime(12, 0, 0, $_POST['date_lim_reglementmonth'], $_POST['date_lim_reglementday'], $_POST['date_lim_reglementyear']); + $object->date_echeance = dol_mktime(12, 0, 0, GETPOST('date_lim_reglementmonth', 'int'), GETPOST('date_lim_reglementday', 'int'), GETPOST('date_lim_reglementyear', 'int')); if (!empty($object->date_echeance) && $object->date_echeance < $object->date) { $object->date_echeance = $object->date; setEventMessages($langs->trans("DatePaymentTermCantBeLowerThanObjectDate"), null, 'warnings'); @@ -692,8 +692,12 @@ if (empty($reshook)) { $error++; } - $dateinvoice = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); - $datedue = dol_mktime(12, 0, 0, GETPOST('echmonth', 'int'), GETPOST('echday', 'int'), GETPOST('echyear', 'int')); + $dateinvoice = dol_mktime(0, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server + $datedue = dol_mktime(0, 0, 0, GETPOST('echmonth', 'int'), GETPOST('echday', 'int'), GETPOST('echyear', 'int'), 'tzserver'); + /*var_dump($dateinvoice.' '.dol_print_date($dateinvoice, 'dayhour')); + var_dump(dol_now('tzuserrel').' '.dol_get_last_hour(dol_now('tzuserrel')).' '.dol_print_date(dol_now('tzuserrel'),'dayhour').' '.dol_print_date(dol_get_last_hour(dol_now('tzuserrel')), 'dayhour')); + var_dump($db->idate($dateinvoice)); + exit;*/ // Replacement invoice if (GETPOST('type') == FactureFournisseur::TYPE_REPLACEMENT) { @@ -702,7 +706,7 @@ if (empty($reshook)) { $action = 'create'; $_GET['socid'] = $_POST['socid']; $error++; - } elseif ($dateinvoice > (dol_get_last_hour(dol_now()) + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { + } elseif ($dateinvoice > (dol_get_last_hour(dol_now('tzuserrel')) + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { $error++; setEventMessages($langs->trans("ErrorDateIsInFuture"), null, 'errors'); $action = 'create'; @@ -766,7 +770,7 @@ if (empty($reshook)) { $action = 'create'; $_GET['socid'] = $_POST['socid']; $error++; - } elseif ($dateinvoice > (dol_get_last_hour(dol_now()) + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { + } elseif ($dateinvoice > (dol_get_last_hour(dol_now('tzuserrel')) + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { $error++; setEventMessages($langs->trans("ErrorDateIsInFuture"), null, 'errors'); $action = 'create'; @@ -875,7 +879,7 @@ if (empty($reshook)) { $action = 'create'; $_GET['socid'] = $_POST['socid']; $error++; - } elseif ($dateinvoice > (dol_get_last_hour(dol_now()) + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { + } elseif ($dateinvoice > (dol_get_last_hour(dol_now('tzuserrel')) + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { $error++; setEventMessages($langs->trans("ErrorDateIsInFuture"), null, 'errors'); $action = 'create'; From 128f6d9a5cb4a7ce34bbf296861809ae0c244231 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Sep 2021 02:38:53 +0200 Subject: [PATCH 0439/1460] Fix combo box for thirdparties in invoice stats used bad component --- htdocs/compta/facture/stats/index.php | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index ca4d3d6ccaf..5fe028e1268 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -42,7 +42,7 @@ $HEIGHT = DolGraph::getDefaultGraphSizeForStats('height'); // Load translation files required by the page $langs->loadLangs(array('bills', 'companies', 'other')); -$mode = GETPOST("mode") ?GETPOST("mode") : 'customer'; +$mode = GETPOST("mode") ? GETPOST("mode") : 'customer'; if ($mode == 'customer' && !$user->rights->facture->lire) { accessforbidden(); } @@ -244,7 +244,7 @@ if (!count($arrayyears)) { $h = 0; $head = array(); -$head[$h][0] = DOL_URL_ROOT.'/compta/facture/stats/index.php?mode='.$mode; +$head[$h][0] = DOL_URL_ROOT.'/compta/facture/stats/index.php?mode='.urlencode($mode); $head[$h][1] = $langs->trans("ByMonthYear"); $head[$h][2] = 'byyear'; $h++; @@ -261,12 +261,12 @@ complete_head_from_modules($conf, $langs, null, $head, $h, $type); print dol_get_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1); // We use select_thirdparty_list instead of select_company so we can use $filter and share same code for customer and supplier. -$tmp_companies = $form->select_thirdparty_list($socid, 'socid', $filter, 1, 0, 0, array(), '', 1); -//Array passed as an argument to Form::selectarray to build a proper select input -$companies = array(); - -foreach ($tmp_companies as $value) { - $companies[$value['key']] = $value['label']; +$filter = ''; +if ($mode == 'customer') { + $filter = 's.client in (1,2,3)'; +} +if ($mode == 'supplier') { + $filter = 's.fournisseur = 1'; } print '
    '; @@ -281,14 +281,8 @@ print ''; print ''; // Company print ''; // ThirdParty Type From 31d9eb192fa1ab455b138c14ce06b54c91b51498 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Sep 2021 02:51:36 +0200 Subject: [PATCH 0440/1460] Clean code --- .../eventorganization/conferenceorboothattendee_card.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php index 0517210333f..84f99182192 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_card.php +++ b/htdocs/eventorganization/conferenceorboothattendee_card.php @@ -205,13 +205,12 @@ if (!empty($projectstatic->socid)) { $projectstatic->fetch_thirdparty(); } -$withProjectUrl=''; + $object->project = clone $projectstatic; if (!empty($withproject)) { // Tabs for project $tab = 'eventorganisation'; - $withProjectUrl = "&withproject=1"; $head = project_prepare_head($projectstatic); print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, ($projectstatic->public ? 'projectpub' : 'project'), 0, '', ''); @@ -421,8 +420,10 @@ if (!empty($withproject)) { if ($action == 'create') { print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("ConferenceOrBoothAttendee")), '', 'object_'.$object->picto); - print '
    '; + + print ''; print ''; + print ''; if ($confOrBooth->id > 0) { print ''; @@ -432,8 +433,6 @@ if ($action == 'create') { print ''; } - - print ''; if ($backtopage) { print ''; } From 3467faab6bea5a336f97a1efa047e3d0a2900652 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Sep 2021 03:20:15 +0200 Subject: [PATCH 0441/1460] Fix property --- htdocs/expensereport/class/expensereport.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 86852640596..9eaa2f96cb5 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -1039,7 +1039,7 @@ class ExpenseReport extends CommonObject $deplig->total_tva = $objp->total_tva; $deplig->total_ttc = $objp->total_ttc; $deplig->total_localtax1 = $objp->total_localtax1; - $deplig->total_localtax2 = $objp->total_totaltax2; + $deplig->total_localtax2 = $objp->total_localtax2; $deplig->type_fees_code = empty($objp->code_type_fees) ? 'TF_OTHER' : $objp->code_type_fees; $deplig->type_fees_libelle = $objp->libelle_type_fees; From a48a8231a165953f558f4e5ca8f703ab5f33c87d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Sep 2021 11:33:58 +0200 Subject: [PATCH 0442/1460] Fix scrutinizer --- htdocs/core/class/html.formcompany.class.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index ac6bad50e41..d1fc8f65edb 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -761,20 +761,21 @@ class FormCompany extends Form /** * Return a select list with types of contacts * - * @param object $object Object to use to find type of contact - * @param string $selected Default selected value - * @param string $htmlname HTML select name - * @param string $source Source ('internal' or 'external') - * @param string $sortorder Sort criteria ('position', 'code', ...) - * @param int $showempty 1=Add en empty line - * @param string $morecss Add more css to select component - * @param int $output 0=return HTML, 1= direct print + * @param object $object Object to use to find type of contact + * @param string $selected Default selected value + * @param string $htmlname HTML select name + * @param string $source Source ('internal' or 'external') + * @param string $sortorder Sort criteria ('position', 'code', ...) + * @param int $showempty 1=Add en empty line + * @param string $morecss Add more css to select component + * @param int $output 0=return HTML, 1= direct print * @param int $forcehidetooltip Force hide tooltip for admin - * @return void + * @return string|void Depending on $output param, return the HTML select list (recommended method) or nothing */ public function selectTypeContact($object, $selected, $htmlname = 'type', $source = 'internal', $sortorder = 'position', $showempty = 0, $morecss = '', $output = 1, $forcehidetooltip = 0) { global $user, $langs; + $out = ''; if (is_object($object) && method_exists($object, 'liste_type_contact')) { $lesTypes = $object->liste_type_contact($source, $sortorder, 0, 1); From 977db0a2ba6b233475e3fe234aa8e3f54a805ff7 Mon Sep 17 00:00:00 2001 From: Ilias Patsiaouras Date: Thu, 23 Sep 2021 11:38:50 +0200 Subject: [PATCH 0443/1460] add MO to the list of possible object to link --- htdocs/core/class/html.form.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 9bcbf08f71a..bc025cfcef0 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7846,6 +7846,11 @@ class Form if (empty($conf->expedition->enabled)) { continue; // Do not show if module disabled } + } elseif ($objecttype == 'mo') { + $tplpath = 'mrp/mo'; + if (empty($conf->mrp->enabled)) { + continue; // Do not show if module disabled + } } elseif ($objecttype == 'invoice_supplier') { $tplpath = 'fourn/facture'; } elseif ($objecttype == 'order_supplier') { @@ -7949,6 +7954,7 @@ class Form 'supplier_proposal'=>array('enabled'=>$conf->supplier_proposal->enabled, 'perms'=>1, 'label'=>'LinkToSupplierProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('supplier_proposal').')'), 'order_supplier'=>array('enabled'=>$conf->supplier_order->enabled, 'perms'=>1, 'label'=>'LinkToSupplierOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('commande_fournisseur').')'), 'invoice_supplier'=>array('enabled'=>$conf->supplier_invoice->enabled, 'perms'=>1, 'label'=>'LinkToSupplierInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('facture_fourn').')'), + 'mo'=>array('enabled'=>$conf->mrp->enabled, 'perms'=>1, 'label'=>'LinkToMo', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."mrp_mo as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('mo').')'), 'ticket'=>array('enabled'=>$conf->ticket->enabled, 'perms'=>1, 'label'=>'LinkToTicket', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.track_id, '0' as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."ticket as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('ticket').')') ); } From 2538ebec03b335bec33e06593fc63500f615b4e5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Sep 2021 11:40:29 +0200 Subject: [PATCH 0444/1460] Better test --- htdocs/core/class/html.formticket.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index dd43ae0ffae..c455b01e932 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -21,7 +21,7 @@ /** * \file htdocs/core/class/html.formticket.class.php * \ingroup ticket - * \brief Fichier de la classe permettant la generation du formulaire html d'envoi de mail unitaire + * \brief File of class to generate the form for creating a new ticket. */ require_once DOL_DOCUMENT_ROOT."/core/class/html.form.class.php"; require_once DOL_DOCUMENT_ROOT."/core/class/html.formmail.class.php"; @@ -32,12 +32,12 @@ if (!class_exists('FormCompany')) { } /** - * Classe permettant la generation du formulaire d'un nouveau ticket. + * Class to generate the form for creating a new ticket. + * Usage: $formticket = new FormTicket($db) + * $formticket->proprietes=1 ou chaine ou tableau de valeurs + * $formticket->show_form() affiche le formulaire * * @package Ticket - * \remarks Utilisation: $formticket = new FormTicket($db) - * \remarks $formticket->proprietes=1 ou chaine ou tableau de valeurs - * \remarks $formticket->show_form() affiche le formulaire */ class FormTicket { @@ -666,7 +666,7 @@ class FormTicket dol_syslog(get_class($this)."::selectCategoryTickets ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG); - if (empty($outputlangs)) { + if (is_null($outputlangs) || !is_object($outputlangs)) { $outputlangs = $langs; } $outputlangs->load("ticket"); From 0a28bf4d30409b5d77fdcaa71b1961d4f7fd54e4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Sep 2021 11:44:16 +0200 Subject: [PATCH 0445/1460] Trans --- htdocs/langs/en_US/accountancy.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index fc4b86a2cdb..a2660c2c592 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -329,8 +329,8 @@ ACCOUNTING_DISABLE_BINDING_ON_PURCHASES=Disable binding & transfer in accountanc ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS=Disable binding & transfer in accountancy on expense reports (expense reports will not be taken into account in accounting) ## Export -NotifiedExportDate=Notified export date (modification of the entries will not be possible) -NotifiedValidationDate=Validation of the entries (modification or deletion of the entries will not be possible) +NotifiedExportDate=Flag exported lines as exported (modification of the lines will not be possible) +NotifiedValidationDate=Validate the exported entries (modification or deletion of the lines will not be possible) ConfirmExportFile=Confirmation of the generation of the accounting export file ? ExportDraftJournal=Export draft journal Modelcsv=Model of export From 4a43ed2852004cbca617e2cb00f0f99b8fe641a5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Sep 2021 12:05:55 +0200 Subject: [PATCH 0446/1460] Fix scrutinizer --- htdocs/core/class/html.formactions.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 4b12b4513e5..0048031d0e7 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -221,13 +221,14 @@ class FormActions if ($typeelement == 'project') { $projectid = $object->id; } + $taskid = 0; if ($typeelement == 'task') { $taskid = $object->id; } $newcardbutton = ''; if (!empty($conf->agenda->enabled) && !empty($user->rights->agenda->myactions->create)) { - $url = DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.urlencode(dol_print_date(dol_now(), 'dayhourlog', 'tzuser')).'&origin='.urlencode($typeelement).'&originid='.$object->id.((!empty($object->socid) && $object->socid > 0) ? '&socid='.$object->socid : ((!empty($socid) && $socid > 0) ? '&socid='.$socid : '')).($projectid > 0 ? '&projectid='.$projectid : '').($taskid > 0 ? '&taskid='.$taskid : '').'&backtopage='.urlencode($urlbacktopage); + $url = DOL_URL_ROOT.'/comm/action/card.php?action=create&token='.newToken().'&datep='.urlencode(dol_print_date(dol_now(), 'dayhourlog', 'tzuser')).'&origin='.urlencode($typeelement).'&originid='.((int) $object->id).((!empty($object->socid) && $object->socid > 0) ? '&socid='.((int) $object->socid) : ((!empty($socid) && $socid > 0) ? '&socid='.((int) $socid) : '')).($projectid > 0 ? '&projectid='.((int) $projectid) : '').($taskid > 0 ? '&taskid='.((int) $taskid) : '').'&backtopage='.urlencode($urlbacktopage); $newcardbutton .= dolGetButtonTitle($langs->trans("AddEvent"), '', 'fa fa-plus-circle', $url); } From d39ab4c2887669ef706464a2ef4f6f4595688af5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Sep 2021 12:14:32 +0200 Subject: [PATCH 0447/1460] Clean code --- htdocs/core/boxes/box_graph_invoices_permonth.php | 4 ++-- htdocs/core/boxes/box_graph_invoices_peryear.php | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index e4418020bfc..fe01eae730b 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -145,9 +145,9 @@ class box_graph_invoices_permonth extends ModeleBoxes $filenamenb = $dir."/".$prefix."invoicesnbinyear-".$endyear.".png"; // default value for customer mode - $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesnbinyear-'.$endyear.'.png'; + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesnbinyear-'.$endyear.'.png'; if ($mode == 'supplier') { - $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessuppliernbinyear-'.$endyear.'.png'; + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessuppliernbinyear-'.$endyear.'.png'; } $px1 = new DolGraph(); diff --git a/htdocs/core/boxes/box_graph_invoices_peryear.php b/htdocs/core/boxes/box_graph_invoices_peryear.php index 14a431bcb84..22d9ad956e7 100644 --- a/htdocs/core/boxes/box_graph_invoices_peryear.php +++ b/htdocs/core/boxes/box_graph_invoices_peryear.php @@ -129,8 +129,10 @@ class box_graph_invoices_peryear extends ModeleBoxes $filenamenb = $dir."/".$prefix."invoicesamountyears-".$endyear.".png"; // default value for customer mode - $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesamountyears-'.$endyear.'.png'; - if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessupplieramountyears-'.$endyear.'.png'; + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesamountyears-'.$endyear.'.png'; + if ($mode == 'supplier') { + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessupplieramountyears-'.$endyear.'.png'; + } $px2 = new DolGraph(); $mesg = $px2->isGraphKo(); From c39c823b668e8c66ce05da47acbdd113d1a97d21 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Sep 2021 13:01:04 +0200 Subject: [PATCH 0448/1460] Debug Date of line of services mandatory --- htdocs/core/tpl/objectline_create.tpl.php | 49 +++++++++---------- htdocs/core/tpl/objectline_edit.tpl.php | 17 ++++--- htdocs/product/card.php | 59 +++++++++++++---------- 3 files changed, 67 insertions(+), 58 deletions(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index d9ca8291066..aeac5d038f3 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -674,22 +674,21 @@ if (!empty($usemargins) && $user->rights->margins->creer) { $("#prod_entry_mode_predef").click(); -table_element_line != 'commande_fournisseurdet') { ?> - $("#date_start, #date_end").focusout(function() - { - let type = $(this).attr('type'); - let mandatoryP = $(this).attr('mandatoryperiod'); - if (type == 1 && mandatoryP == 1 ){ - if ( $(this).val() == '' && !$(this).hasClass("error") ) { - $(this).addClass('error'); + if (in_array($this->table_element_line, array('propaldet', 'commandedet', 'facturedet'))) { ?> + $("#date_start, #date_end").focusout(function() { + let type = $(this).attr('type'); + let mandatoryP = $(this).attr('mandatoryperiod'); + if (type == 1 && mandatoryP == 1) { + if ($(this).val() == '' && !$(this).hasClass('inputmandatory')) { + $(this).addClass('inputmandatory'); }else{ - $(this).removeClass('error'); + $(this).removeClass('inputmandatory'); } } }); - + /* When changing predefined product, we reload list of supplier prices required for margin combo */ $("#idprod, #idprodfournprice").change(function() { @@ -718,23 +717,23 @@ if (!empty($usemargins) && $user->rights->margins->creer) { function(data) { console.log("Load unit price end, we got value "+data.price_ht); - $( '#date_start').removeAttr( "type" ); - $( '#date_end' ).removeAttr( "type" ); - $('#date_start').attr('type', data.type); - $('#date_end').attr('type', data.type); + $('#date_start').removeAttr('type'); + $('#date_end').removeAttr('type'); + $('#date_start').attr('type', data.type); + $('#date_end').attr('type', data.type); - $( '#date_start').removeAttr( "mandatoryperiod" ); - $( '#date_end' ).removeAttr( "mandatoryperiod" ); - $('#date_start').attr('mandatoryperiod', data.mandatory_period); - $('#date_end').attr('mandatoryperiod', data.mandatory_period); + $('#date_start').removeAttr('mandatoryperiod'); + $('#date_end').removeAttr('mandatoryperiod'); + $('#date_start').attr('mandatoryperiod', data.mandatory_period); + $('#date_end').attr('mandatoryperiod', data.mandatory_period); - // service and we setted mandatory_period to true - if (data.mandatory_period == 1 && data.type == 1 ) { - jQuery("#date_start").addClass("error"); - jQuery("#date_end").addClass("error"); + // service and we setted mandatory_period to true + if (data.mandatory_period == 1 && data.type == 1) { + jQuery('#date_start').addClass('inputmandatory'); + jQuery('#date_end').addClass('inputmandatory'); }else{ - jQuery("#date_start").removeClass("error"); - jQuery("#date_end").removeClass("error"); + jQuery('#date_start').removeClass('inputmandatory'); + jQuery('#date_end').removeClass('inputmandatory'); } jQuery("#price_ht").val(data.price_ht); diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index e15c489a5b6..611d6a9cce5 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -468,16 +468,17 @@ jQuery(document).ready(function() } }); - $("#date_start, #date_end").focusout(function() - { - - if ( $(this).val() == '' && !$(this).hasClass("error") ) { - $(this).addClass('error'); - }else{ - $(this).removeClass('error'); + table_element_line, array('propaldet', 'commandedet', 'facturedet'))) { ?> + $("#date_start, #date_end").focusout(function() { + if ( $(this).val() == '' && !$(this).hasClass('inputmandatory') ) { + $(this).addClass('inputmandatory'); + } else { + $(this).removeClass('inputmandatory'); } }); - margin->enabled)) { ?> /* Add rule to clear margin when we change some data, so when we change sell or buy price, margin will be recalculated after submitting form */ diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 9e7a9b6d52d..fd9b129e30d 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -132,7 +132,9 @@ $extrafields->fetch_name_optionals_label($object->table_element); if ($id > 0 || !empty($ref)) { $result = $object->fetch($id, $ref); - + if ($result < 0) { + dol_print_error($db, $object->error, $object->errors); + } if (!empty($conf->product->enabled)) { $upload_dir = $conf->product->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 0, $object, 'product').dol_sanitizeFileName($object->ref); } elseif (!empty($conf->service->enabled)) { @@ -1290,6 +1292,15 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
    '; } @@ -1429,6 +1440,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $defaultva = get_default_tva($mysoc, $mysoc); print $form->load_tva("tva_tx", $defaultva, $mysoc, $mysoc, 0, 0, '', false, 1); print ''; + print '
    '.$langs->trans("Filter").'
    '.$langs->trans("ThirdParty").''; -if ($mode == 'customer') { - $filter = 's.client in (1,2,3)'; -} -if ($mode == 'supplier') { - $filter = 's.fournisseur = 1'; -} print img_picto('', 'company', 'class="pictofixedwidth"'); -print $form->selectarray('socid', $companies, $socid, 1, 0, 0, '', 0, 0, 0, '', 'widthcentpercentminusx maxwidth300', 1); +print $form->select_company($socid, 'socid', $filter, 1, 0, 0, array(), 0, 'widthcentpercentminusx maxwidth300'); print '
    '.$langs->trans("Duration").''; print ''; print $formproduct->selectMeasuringUnits("duration_unit", "time", (GETPOSTISSET('duration_value') ? GETPOSTISSET('duration_value', 'alpha') : 'h'), 0, 1); + + // Mandatory period + print '       '; + print 'mandatory_period == 1 ? ' checked="checked"' : '').'>'; + print ''; + print '
    '; print '
    '; @@ -1452,14 +1464,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print $form->load_tva("tva_tx", $defaultva, $mysoc, $mysoc, 0, 0, '', false, 1); print ''; - if (!empty($conf->service->enabled)) { - if ($object->isService()) { - // Mandatory period - print ''.$langs->trans("mandatoryperiod").''; - print ' '; - print ''; - } - } print ''; print '
    '; @@ -1834,6 +1838,15 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''.$langs->trans("Duration").''; print ' '; print $formproduct->selectMeasuringUnits("duration_unit", "time", $object->duration_unit, 0, 1); + + // Mandatory period + print '       '; + print 'mandatory_period == 1 ? ' checked="checked"' : '').'>'; + print ''; + print ''; } else { if (empty($conf->global->PRODUCT_DISABLE_NATURE)) { @@ -2050,13 +2063,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''.$langs->trans("ProductAccountancyBuyExportCode").''; print ''; print ''; - - if ($object->isService()) { - // Mandatory period - print ''.$langs->trans("mandatoryperiod").''; - print 'mandatory_period == 1 ? ' checked="checked"' : '').' /> '; - print ''; - } } } print ''; @@ -2322,21 +2328,23 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if ($object->isService()) { // Duration - print ''.$langs->trans("Duration").''.$object->duration_value.' '; + print ''.$langs->trans("Duration").''; + print $object->duration_value; if ($object->duration_value > 1) { $dur = array("i"=>$langs->trans("Minute"), "h"=>$langs->trans("Hours"), "d"=>$langs->trans("Days"), "w"=>$langs->trans("Weeks"), "m"=>$langs->trans("Months"), "y"=>$langs->trans("Years")); } elseif ($object->duration_value > 0) { $dur = array("i"=>$langs->trans("Minute"), "h"=>$langs->trans("Hour"), "d"=>$langs->trans("Day"), "w"=>$langs->trans("Week"), "m"=>$langs->trans("Month"), "y"=>$langs->trans("Year")); } - print (!empty($object->duration_unit) && isset($dur[$object->duration_unit]) ? $langs->trans($dur[$object->duration_unit]) : '')." "; - - print ''; + print (!empty($object->duration_unit) && isset($dur[$object->duration_unit]) ? " ".$langs->trans($dur[$object->duration_unit])." " : ''); // Mandatory period - $htmltooltip = '
    '.$langs->trans("mandatoryHelper"); - print ''.$langs->trans("mandatoryperiod"); - print $form->textwithpicto('', $htmltooltip, 1, 0).''; - print 'mandatory_period == 1 ? ' checked="checked"' : '').' disabled/> '; + if ($object->duration_value > 0) { + print '       '; + } + $htmltooltip = $langs->trans("mandatoryHelper"); + print 'mandatory_period == 1 ? ' checked="checked"' : '').' disabled>'; + print $form->textwithpicto($langs->trans("mandatoryperiod"), $htmltooltip, 1, 0); + print ''; } else { if (empty($conf->global->PRODUCT_DISABLE_NATURE)) { @@ -2566,8 +2574,9 @@ if ($action != 'create' && $action != 'edit') { print "\n
    \n"; } + /* - * All the "Add to" areas + * All the "Add to" areas if PRODUCT_ADD_FORM_ADD_TO is set */ if (!empty($conf->global->PRODUCT_ADD_FORM_ADD_TO) && $object->id && ($action == '' || $action == 'view') && $object->status) { From b08b7d2f6895e50c5378fb27d2cd989e2c1a1032 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Sep 2021 13:20:42 +0200 Subject: [PATCH 0449/1460] NEW Can show progression of task into combo list of tasks --- htdocs/core/class/html.formprojet.class.php | 17 +++++++++++++---- htdocs/projet/tasks/time.php | 2 +- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index 9696dca7183..18b42c597bf 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -39,6 +39,8 @@ class FormProjets */ public $error = ''; + public $nboftasks; + /** * Constructor @@ -307,11 +309,11 @@ class FormProjets * @param int $disabled Disabled * @param string $morecss More css added to the select component * @param string $projectsListId ''=Automatic filter on project allowed. List of id=Filter on project ids. - * @param string $showproject 'all' = Show project info, ''=Hide project info + * @param string $showmore 'all' = Show project info, 'progress' = Show task progression, ''=Show nothing more * @param User $usertofilter User object to use for filtering * @return int Nbr of tasks if OK, <0 if KO */ - public function selectTasks($socid = -1, $selected = '', $htmlname = 'taskid', $maxlength = 24, $option_only = 0, $show_empty = '1', $discard_closed = 0, $forcefocus = 0, $disabled = 0, $morecss = 'maxwidth500', $projectsListId = '', $showproject = 'all', $usertofilter = null) + public function selectTasks($socid = -1, $selected = '', $htmlname = 'taskid', $maxlength = 24, $option_only = 0, $show_empty = '1', $discard_closed = 0, $forcefocus = 0, $disabled = 0, $morecss = 'maxwidth500', $projectsListId = '', $showmore = 'all', $usertofilter = null) { global $user, $conf, $langs; @@ -336,7 +338,8 @@ class FormProjets } // Search all projects - $sql = 'SELECT t.rowid, t.ref as tref, t.label as tlabel, p.rowid as pid, p.ref, p.title, p.fk_soc, p.fk_statut, p.public,'; + $sql = 'SELECT t.rowid, t.ref as tref, t.label as tlabel, t.progress,'; + $sql .= ' p.rowid as pid, p.ref, p.title, p.fk_soc, p.fk_statut, p.public, p.usage_task,'; $sql .= ' s.nom as name'; $sql .= ' FROM '.MAIN_DB_PREFIX.'projet as p'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON s.rowid = p.fk_soc,'; @@ -407,7 +410,7 @@ class FormProjets $disabled = 1; } - if ($showproject == 'all') { + if (preg_match('/all/', $showmore)) { $labeltoshow .= dol_trunc($obj->ref, 18); // Project ref //if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')'; //else $labeltoshow.=' ('.$langs->trans("Private").')'; @@ -442,6 +445,10 @@ class FormProjets // Label for task $labeltoshow .= $obj->tref.' '.dol_trunc($obj->tlabel, $maxlength); $titletoshow .= $obj->tref.' '.dol_trunc($obj->tlabel, $maxlength); + if ($obj->usage_task && preg_match('/progress/', $showmore)) { + $labeltoshow .= ' ('.$obj->progress.'%)'; + $titletoshow .= ' ('.$obj->progress.'%)'; + } if (!empty($selected) && $selected == $obj->rowid) { $out .= '
    + +
    + + + + + + + + + + + + + + + + + +
    + trans('CompetenceAcquiredByOneOrMore'); ?>
    + trans('MaxlevelGreaterThan'); ?>
    + trans('MaxLevelEqualTo'); ?>
    + trans('MaxLevelLowerThan'); ?>
    + trans('SkillNotAcquired'); ?>
    + +
    + +
    + +
    + +

    +
    + +
    +

    + +
    + + 0 || $fk_usergroup2 > 0 || $fk_job > 0) { ?> + + + + + + + + + + + '; + + echo ''; + echo ''; + echo ''; + echo ''; + + echo ''; + + ?> + +
    trans('skill'); ?>trans('rank'); ?>trans('difference'); ?>trans('rank'); ?>
    '; + + $TUser1 = $TUser2 = array(); + + $userlist1 = displayUsersListWithPicto($TUser1, $fk_usergroup1, 'list1'); + + + $skill = new Skill($db); + $TSkill1 = getSkillForUsers($TUser1); + + if ($fk_job > 0) { + $TSkill2 = getSkillForJob($fk_job); + + $job = new Job($db); + $job->fetch($fk_job); + $userlist2 = '
      +
    • +

      ' . $job->label . '

      +

      ' . $job->description . '

      +
    • +
    '; + } else { + $userlist2 = displayUsersListWithPicto($TUser2, $fk_usergroup2, 'list2'); + $TSkill2 = getSkillForUsers($TUser2); + } + + $TMergedSkills = mergeSkills($TSkill1, $TSkill2); + + echo $userlist1; + + echo '
    ' . skillList($TMergedSkills) . '' . rate($TMergedSkills, 'rate1') . '' . diff($TMergedSkills) . '' . rate($TMergedSkills, 'rate2') . ''; + + echo $userlist2; + + echo '
    + + + +
    + + + + + +'; + + foreach ($TMergedSkills as $id => &$sk) { + $class = 'diffnote'; + + if (empty($sk->rate2)) $class .= ' toohappy'; + elseif (empty($sk->rate1)) $class .= ' toosad'; + elseif ($sk->rate1 == $sk->rate2) $class .= ' happy'; + elseif ($sk->rate2 < $sk->rate1) $class .= ' veryhappy'; + elseif ($sk->rate2 > $sk->rate1) $class .= ' sad'; + + $out .= '
  • +   +
  • '; + } + + $out .= ''; + + return $out; +} + +/** + * Return a html list with rank informations + * @param $TMergedSkills + * @param $field + * @return string + */ +function rate(&$TMergedSkills, $field) +{ + global $langs, $fk_job; + + $out = '
      '; + + foreach ($TMergedSkills as $id => &$sk) { + $class = "note"; + $how_many = 0; + if (empty($sk->{$field})) { + $note = 'x'; + $class .= ' none'; + } else { + $note = $sk->{$field}; + $how_many = ($field === 'rate1') ? $sk->how_many_max1 : $sk->how_many_max2; + } + + if ($field === 'rate2' && $fk_job > 0) $trad = $langs->trans('RequiredRank'); + else $trad = $langs->trans('HighestRank'); + + $out .= '
    • +

      ' . $note . '' . ($how_many > 0 ? '' . $how_many . '' : '') . '

      +
    • '; + } + + $out .= '
    '; + + return $out; +} + +/** + * return a html ul list of skills + * + * @param $TMergedSkills + * @return string (ul list in html ) + */ +function skillList(&$TMergedSkills) +{ + + $out = '
      '; + + foreach ($TMergedSkills as $id => &$sk) { + $out .= '
    • +

      ' . $sk->label . '

      +

      ' . $sk->description . '

      +
    • '; + } + + $out .= '
    '; + + return $out; +} + +/** + * create an array of lines [ skillLabel,dscription, maxrank on group1 , minrank needed for this skill ] + * + * @param $TSkill1 + * @param $TSkill2 + * @return array + */ +function mergeSkills($TSkill1, $TSkill2) +{ + + $Tab = array(); + + foreach ($TSkill1 as &$sk) { + if (empty($Tab[$sk->fk_skill])) $Tab[$sk->fk_skill] = new stdClass; + + $Tab[$sk->fk_skill]->rate1 = $sk->rank; + $Tab[$sk->fk_skill]->how_many_max1 = $sk->how_many_max; + $Tab[$sk->fk_skill]->label = $sk->label; + $Tab[$sk->fk_skill]->description = $sk->description; + } + + foreach ($TSkill2 as &$sk) { + if (empty($Tab[$sk->fk_skill])) $Tab[$sk->fk_skill] = new stdClass; + $Tab[$sk->fk_skill]->rate2 = $sk->rank; + $Tab[$sk->fk_skill]->label = $sk->label; + $Tab[$sk->fk_skill]->description = $sk->description; + $Tab[$sk->fk_skill]->how_many_max2 = $sk->how_many_max; + } + + return $Tab; +} + +/** + * Display a list of User with picto + * @param $TUser + * @param int $fk_usergroup + * @param string $namelist + * @return string + */ +function displayUsersListWithPicto(&$TUser, $fk_usergroup = 0, $namelist = 'list-user') +{ + global $db, $langs, $conf, $form; + + $out = ''; + if ($fk_usergroup > 0) { + $list = $namelist . '_excluded_id'; + + $excludedIdsList = GETPOST($list); + + + $sql = "SELECT DISTINCT u.rowid FROM " . MAIN_DB_PREFIX . "user u + LEFT JOIN " . MAIN_DB_PREFIX . "usergroup_user ugu ON (u.rowid = ugu.fk_user) + WHERE 1 + AND u.statut > 0 + AND ugu.fk_usergroup=" . $fk_usergroup; + + $res = $db->query($sql); + + $out .= '
      '; + + $TExcludedId = explode(',', $excludedIdsList); + + $form = new Form($db); + $out .= ' '; + + while ($obj = $db->fetch_object($res)) { + $class = ''; + + $user = new User($db); + $user->fetch($obj->rowid); + + $name = $user->getFullName($langs); + if (empty($name)) $name = $user->login; + + if (in_array($user->id, $TExcludedId)) { + $class .= ' disabled'; + } else { + if (!in_array($user->id, $TUser)) $TUser[] = $user->id; + } + + + $desc = ''; + + $job = Job::getLastJobForUser($user->id); + $desc .= $job; + + $evaluation = Evaluation::getLastEvaluationForUser($user->id); + + if (!empty($evaluation) && !empty($evaluation->date_eval)) { + $desc .= $langs->trans('DateLastEval') . ' : ' . dol_print_date($evaluation->date_eval); + } else { + $desc .= $langs->trans('NoEval'); + } + + if (!empty($user->array_options['options_DDA'])) $desc .= '
      ' . $langs->trans('Anciennete') . ' : ' . dol_print_date(strtotime($user->array_options['options_DDA'])); + + $out .= '
    • + ' . $form->showphoto('userphoto', $user, 0, 0, 0, 'photoref', 'small', 1, 0, 1) . ' +

      ' . $name . '

      +

      ' . $desc . '

      +
    • '; + } + + $out .= '
    '; + } + + return $out; +} + + +/** + * + * Allow to get skill(s) of a user + * + * @param $TUser + * @return array|int + */ +function getSkillForUsers($TUser) +{ + global $db; + + //I go back to the user with the highest score in a given group for all the skills assessed in that group + if (empty($TUser)) return array(); + + $sql = 'SELECT sk.rowid, sk.label, sk.description, sk.skill_type, sr.fk_object, sr.objecttype, sr.fk_skill, '; + $sql.= " MAX(sr.rank) as rank"; + $sql.=' FROM '.MAIN_DB_PREFIX.'hrm_skill sk'; + $sql.=' LEFT JOIN '.MAIN_DB_PREFIX.'hrm_skillrank sr ON (sk.rowid = sr.fk_skill)'; + $sql.=' WHERE sr.objecttype = "'.SkillRank::SKILLRANK_TYPE_USER.'"'; + $sql.=' AND sr.fk_object IN ('.implode(',', $TUser).')'; + $sql.=" GROUP BY sk.rowid "; // group par competence + + $resql = $db->query($sql); + $Tab = array(); + + if ($resql) { + //For each skill, we count the number of times that the max score has been reached within a given group + $num = 0; + while ($obj = $db->fetch_object($resql) ) { + $sql1 = "SELECT count(*) as how_many_max FROM ".MAIN_DB_PREFIX."hrm_skillrank sr"; + $sql1.=" WHERE sr.rank = ".(int) $obj->rank; + $sql1.=" AND sr.objecttype = '".Skillrank::SKILLRANK_TYPE_USER."'"; + $sql1.=" AND sr.fk_skill = ".$obj->fk_skill; + $sql1.=" AND sr.fk_object IN (".implode(',', $TUser).")"; + $resql1 = $db->query($sql1); + + $objMax = $db->fetch_object($resql1); + + $Tab[$num] = new stdClass(); + $Tab[$num]->fk_skill = $obj->fk_skill; + $Tab[$num]->label = $obj->label; + $Tab[$num]->description = $obj->description; + $Tab[$num]->skill_type = $obj->skill_type; + $Tab[$num]->fk_object = $obj->fk_object; + $Tab[$num]->objectType = SkillRank::SKILLRANK_TYPE_USER; + $Tab[$num]->rank = $obj->rank; + $Tab[$num]->how_many_max = $objMax->how_many_max; + + $num++; + } + } else { + dol_print_error($db); + } + + return $Tab; +} + +/** + * Allow to get skill(s) of a job + * + * @param $fk_job + * @return array|int + */ +function getSkillForJob($fk_job) +{ + global $db; + + if (empty($fk_job)) return array(); + + $sql = 'SELECT sk.rowid, sk.label, sk.description, sk.skill_type, sr.fk_object, sr.objecttype, sr.fk_skill, '; + $sql.= " MAX(sr.rank) as rank"; + $sql.=' FROM '.MAIN_DB_PREFIX.'hrm_skill sk'; + $sql.=' LEFT JOIN '.MAIN_DB_PREFIX.'hrm_skillrank sr ON (sk.rowid = sr.fk_skill)'; + $sql.=' WHERE sr.objecttype = "'.SkillRank::SKILLRANK_TYPE_JOB.'"'; + $sql.=' AND sr.fk_object IN ('.$fk_job.')'; + $sql.=' GROUP BY sk.rowid '; // group par competence*/ + + $resql = $db->query($sql); + $Tab = array(); + + + if ($resql) { + $num = 0; + while ($obj = $db->fetch_object($resql) ) { + $Tab[$num] = new stdClass(); + $Tab[$num]->fk_skill = $obj->fk_skill; + $Tab[$num]->label = $obj->label; + $Tab[$num]->description = $obj->description; + $Tab[$num]->skill_type = $obj->skill_type; + //$Tab[$num]->date_start = '';// du poste + //$Tab[$num]->date_end = ''; // du poste + $Tab[$num]->fk_object = $obj->fk_object; + $Tab[$num]->objectType = SkillRank::SKILLRANK_TYPE_JOB; + $Tab[$num]->rank = $obj->rank; + $Tab[$num]->how_many_max = $obj->how_many_max; + + $num++; + } + } else { + dol_print_error($db); + } + + + return $Tab; +} + +/** + * duplicated with modified data from $form Class + * + * @param string $selected + * @param string $htmlname + * @param int $show_empty + * @param int $disabled + * @param string $enableonly + * @param string $force_entity + * @param false $multiple + * @param string $morecss + * @return string + */ +function select_jobs($selected = '', $htmlname = 'groupid', $show_empty = 0, $disabled = 0, $enableonly = '', $force_entity = '0', $multiple = false, $morecss = '') +{ + // phpcs:enable + global $conf, $user, $langs,$db; + + if (!is_array($selected)) { + $selected = array($selected); + } + $out = ''; + + // On recherche les groupes + $sql = "SELECT j.rowid, j.label as name"; + $sql .= " FROM ".MAIN_DB_PREFIX."hrm_job as j "; + $sql .= " ORDER BY j.label ASC"; + + + $resql = $db->query($sql); + if ($resql) { + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; + $out .= ajax_combobox($htmlname); + $out .= ''; + } else { + dol_print_error($db); + } + + return $out; +} diff --git a/htdocs/hrm/core/tpl/objectline_title.tpl.php b/htdocs/hrm/core/tpl/objectline_title.tpl.php new file mode 100644 index 00000000000..f5d72303e42 --- /dev/null +++ b/htdocs/hrm/core/tpl/objectline_title.tpl.php @@ -0,0 +1,77 @@ + + * Copyright (C) 2010-2011 Laurent Destailleur + * Copyright (C) 2012-2013 Christophe Battarel + * Copyright (C) 2012 Cédric Salvador + * Copyright (C) 2012-2014 Raphaël Doursenaud + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2017 Juanjo Menent + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND + * + * 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 . + * + * Need to have following variables defined: + * $object (invoice, order, ...) + * $conf + * $langs + * $element (used to test $user->rights->$element->creer) + * $permtoedit (used to replace test $user->rights->$element->creer) + * $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax) + * $outputalsopricetotalwithtax + * $usemargins (0 to disable all margins columns, 1 to show according to margin setup) + * + * $type, $text, $description, $line + */ + +// Protection to avoid direct call of template +if (empty($object) || !is_object($object)) { + print "Error, template page can't be called as URL"; + exit; +} + +print "\n"; + +// Title line +print "\n"; + +print ''; + +// Adds a line numbering column +if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { + print ' '; +} + +// Description +print ''.$langs->trans('Label').''; + +// Description +print ''.$langs->trans('Description').''; + +// Note +print ''.$langs->trans('Rank').''; + + +//print ''; // No width to allow autodim + +//print ''; + +//print ''; + +print "\n"; +print "\n"; + +print "\n"; diff --git a/htdocs/hrm/core/tpl/objectline_view.tpl.php b/htdocs/hrm/core/tpl/objectline_view.tpl.php new file mode 100644 index 00000000000..e8416c35711 --- /dev/null +++ b/htdocs/hrm/core/tpl/objectline_view.tpl.php @@ -0,0 +1,164 @@ + + * Copyright (C) 2010-2011 Laurent Destailleur + * Copyright (C) 2012-2013 Christophe Battarel + * Copyright (C) 2012 Cédric Salvador + * Copyright (C) 2012-2014 Raphaël Doursenaud + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2017 Juanjo Menent + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND + * + * 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 . + * + * Need to have following variables defined: + * $object (invoice, order, ...) + * $conf + * $langs + * $dateSelector + * $forceall (0 by default, 1 for supplier invoices/orders) + * $element (used to test $user->rights->$element->creer) + * $permtoedit (used to replace test $user->rights->$element->creer) + * $senderissupplier (0 by default, 1 for supplier invoices/orders) + * $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax) + * $outputalsopricetotalwithtax + * $usemargins (0 to disable all margins columns, 1 to show according to margin setup) + * $object_rights->creer initialized from = $object->getRights() + * $disableedit, $disablemove, $disableremove + * + * $text, $description, $line + */ + +// Protection to avoid direct call of template +if (empty($object) || !is_object($object)) { + print "Error, template page can't be called as URL"; + exit; +} + +global $mysoc; +global $forceall, $senderissupplier, $inputalsopricewithtax, $outputalsopricetotalwithtax; + +// add html5 elements +$domData = ' data-element="'.$line->element.'"'; +$domData .= ' data-id="'.$line->id.'"'; +$domData .= ' data-qty="'.$line->qty.'"'; +$domData .= ' data-product_type="'.$line->product_type.'"'; + +$sign = 1; +if (!empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE_SCREEN) && in_array($object->element, array('facture', 'invoice_supplier')) && $object->type == $object::TYPE_CREDIT_NOTE) { + $sign = -1; +} + +$coldisplay = 0; +?> + + > +global->MAIN_VIEW_LINE_NUMBER)) { ?> + + +
    +fk_skill > 0) { + + $skill = new Skill($this->db); + $resSkill = $skill->fetch($line->fk_skill); + if ($resSkill > 0) print $skill->getNomUrl(1); + + } +?> + + + +fk_skill > 0 && $resSkill > 0) { + print $skill->description; +} + +print ''; + +?> + + +rank, $line->fk_skill, 'TNote', ($this->status == 0 && $permissiontoadd) ? 'edit' : 'view'); + +?> + + + +statut == 0 && !empty($object_rights->creer) && $action != 'selectlines') { + $situationinvoicelinewithparent = 0; + if ($line->fk_prev_id != null && in_array($object->element, array('facture', 'facturedet'))) { + if ($object->type == $object::TYPE_SITUATION) { // The constant TYPE_SITUATION exists only for object invoice + // Set constant to disallow editing during a situation cycle + $situationinvoicelinewithparent = 1; + } + } + + print ''; + $coldisplay++; + if (($line->info_bits & 2) == 2 || !empty($disableedit)) { + } else { ?> + id.'#line_'.$line->id; ?>"> + '; + } + print ''; + + /*print ''; + $coldisplay++; + if (!$situationinvoicelinewithparent && empty($disableremove)) { // For situation invoice, deletion is not possible if there is a parent company. + print 'id.'">'; + print img_delete(); + print ''; + } + print ''; + + if ($num > 1 && $conf->browser->layout != 'phone' && ($this->situation_counter == 1 || !$this->situation_cycle_ref) && empty($disablemove)) { + print ''; + $coldisplay++; + if ($i > 0) { ?> + id; ?>"> + + + + id; ?>"> + + + '; + } else { + print 'browser->layout != 'phone' && empty($disablemove)) ? ' class="linecolmove tdlineupdown center"' : ' class="linecolmove center"').'>'; + $coldisplay++; + }*/ +} else { + //print ''; + $coldisplay = $coldisplay + 3; +} + +if ($action == 'selectlines') { ?> + +\n"; + +print "\n"; diff --git a/htdocs/hrm/core/tpl/skilldet.fiche.tpl.php b/htdocs/hrm/core/tpl/skilldet.fiche.tpl.php new file mode 100644 index 00000000000..d7bfcf9e626 --- /dev/null +++ b/htdocs/hrm/core/tpl/skilldet.fiche.tpl.php @@ -0,0 +1,115 @@ +rights->module->create +// $cssclass must be defined by caller. For example $cssclass='fieldtitle' +$module = $object->element; +$note_public = 'note_public'; +$note_private = 'note_private'; + +$colwidth = (isset($colwidth) ? $colwidth : (empty($cssclass) ? '25' : '')); +// Set $permission from the $permissionnote var defined on calling page +$permission = (isset($permissionnote) ? $permissionnote : (isset($permission) ? $permission : (isset($user->rights->$module->create) ? $user->rights->$module->create : (isset($user->rights->$module->creer) ? $user->rights->$module->creer : 0)))); +$moreparam = (isset($moreparam) ? $moreparam : ''); +$value_public = $object->note_public; +$value_private = $object->note_private; +if (!empty($conf->global->MAIN_AUTO_TIMESTAMP_IN_PUBLIC_NOTES)) { +$stringtoadd = dol_print_date(dol_now(), 'dayhour').' '.$user->getFullName($langs).' --'; +if (GETPOST('action', 'aZ09') == 'edit'.$note_public) { +$value_public = dol_concatdesc($value_public, ($value_public ? "\n" : "")."-- ".$stringtoadd); +if (dol_textishtml($value_public)) { +$value_public .= "
    \n"; +} else { +$value_public .= "\n"; +} +} +} +if (!empty($conf->global->MAIN_AUTO_TIMESTAMP_IN_PRIVATE_NOTES)) { +$stringtoadd = dol_print_date(dol_now(), 'dayhour').' '.$user->getFullName($langs).' --'; +if (GETPOST('action', 'aZ09') == 'edit'.$note_private) { +$value_private = dol_concatdesc($value_private, ($value_private ? "\n" : "")."-- ".$stringtoadd); +if (dol_textishtml($value_private)) { +$value_private .= "
    \n"; +} else { +$value_private .= "\n"; +} +} +}*/ +/* +// Special cases +if ($module == 'propal') { +$permission = $user->rights->propale->creer; +} elseif ($module == 'supplier_proposal') { +$permission = $user->rights->supplier_proposal->creer; +} elseif ($module == 'fichinter') { +$permission = $user->rights->ficheinter->creer; +} elseif ($module == 'project') { +$permission = $user->rights->projet->creer; +} elseif ($module == 'project_task') { +$permission = $user->rights->projet->creer; +} elseif ($module == 'invoice_supplier') { +if (empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) { +$permission = $user->rights->fournisseur->facture->creer; +} else { +$permission = $user->rights->supplier_invoice->creer; +} +} elseif ($module == 'order_supplier') { +if (empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) { +$permission = $user->rights->fournisseur->commande->creer; +} else { +$permission = $user->rights->supplier_order->creer; +} +} elseif ($module == 'societe') { +$permission = $user->rights->societe->creer; +} elseif ($module == 'contact') { +$permission = $user->rights->societe->creer; +} elseif ($module == 'shipping') { +$permission = $user->rights->expedition->creer; +} elseif ($module == 'product') { +$permission = $user->rights->produit->creer; +} elseif ($module == 'ecmfiles') { +$permission = $user->rights->ecm->setup; +}*/ +//else dol_print_error('','Bad value '.$module.' for param module'); + +if (!empty($object->table_element_line)) { +// Show object lines +$result = $object->getLinesArray(); + + +} + + + +print ''."\n"; + +print '
    '."\n"; + print '
    '."\n"; + $editmode = (GETPOST('action', 'aZ09') == 'edit'.$note_public); + print '
    '."\n"; + print $form->editfieldkey("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, $moreparam, '', 0); + print '
    '."\n"; + print '
    '."\n"; + print $form->editfieldval("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, '', null, null, $moreparam, 1)."\n"; + print '
    '."\n"; + print '
    '."\n"; +if (empty($user->socid)) { +// Private notes (always hidden to external users) +print '
    '."\n"; + $editmode = (GETPOST('action', 'aZ09') == 'edit'.$note_private); + print '
    '."\n"; + print $form->editfieldkey("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, $moreparam, '', 0); + print '
    '."\n"; +print '
    '."\n"; + print $form->editfieldval("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, '', null, null, $moreparam, 1); + print '
    '."\n"; +print '
    '."\n"; +} +print '
    '."\n"; +?> + diff --git a/htdocs/hrm/css/radio_js_number.css b/htdocs/hrm/css/radio_js_number.css new file mode 100644 index 00000000000..320b0ddc1f2 --- /dev/null +++ b/htdocs/hrm/css/radio_js_number.css @@ -0,0 +1,18 @@ +.radio_js_bloc_number { + display:inline-block; + padding:5px 7px; + min-width:20px; + border-radius:3px; + border:1px solid #ccc; + background:#eee; + color:#555; + cursor:pointer; + margin:2px; + text-align:center; +} +.radio_js_bloc_number.selected { + transition:0.2s ease background; + background:#888; + color:#fff; + border-color:#555; +} \ No newline at end of file diff --git a/htdocs/hrm/css/style.css b/htdocs/hrm/css/style.css new file mode 100644 index 00000000000..0c8ba81d827 --- /dev/null +++ b/htdocs/hrm/css/style.css @@ -0,0 +1,130 @@ +#compare ul,#compare li,#compare h3 {margin: 0; padding: 0;} + +#compare div { + margin: 20px; +} + +#compare ul { + list-style-type: none; + width: 100%; +} + +#compare h3 { + font: bold 20px/1.5 Helvetica, Verdana, sans-serif; +} + +#compare li img { + float: left; + margin: 0 15px 0 0; + max-width:80px; +} + +#compare li p { + font: 200 12px/1.5 Georgia, Times New Roman, serif; +} + +#compare li { + padding: 10px; + overflow: auto; + border-bottom: 2px solid #98b880; +} +#compare ul.competence li,#compare ul.note li { + height:48px; + overflow: hidden; + border-bottom: 2px solid #6C286C; +} + +#compare li:hover { + background: #eee; + cursor: pointer; +} + +#compare li.disabled { + color:#999; + border-bottom: 2px solid #ff0000; +} + +#compare li.disabled img,#compare li.disabled p { + display:none; +} + +span.note { + font: bold Helvetica, Verdana, sans-serif; + background: #eee none repeat scroll 0 0; + border: 1px solid #ccc; + border-radius: 3px; + color: #555; + cursor: pointer; + display: inline-block; + margin: 2px; + min-width: 20px; + padding: 5px 7px; + text-align: center; + font-weight: bold; +} +span.note.none { + background: #BA7777 none repeat scroll 0 0; +} +#compare ul.diff li { + text-align: center; + border-bottom:0 none; + height:48px; + overflow: hidden; + border-bottom: 2px solid #77BABA; +} +span.diffnote { + display: inline-block; + background: #c3e6cb; + width:42px; + height: 42px; + overflow: hidden; + border:none; + box-sizing: border-box; +} +span.diffnote.little { + width:25px; + height: 25px; + border-width:3px; +} +span.toohappy { + background: #3097D1; + border:5px solid #3097D1; +} +span.veryhappy { + border:5px solid #3097D1; +} +span.toosad { + background: #ccc; + border:5px solid #ccc; +} +span.sad { + background:#bd4147; +} +/*span.diffnote { + display: inline-block; + background: url(img/smiley.png); + width:42px; + height: 42px; + overflow: hidden; +} +span.toohappy { + background-position: -105px 0px; +} +span.veryhappy { + background-position: -53px 0px; +} +span.toosad { + background-position: -105px -52px; +} +span.sad { + background-position: 0px -52px; +}*/ + +span.bubble { + background-color: #ccc; + border:1px; + display:inline-block; + width:20px; + height:20px; + border-radius:20px; +} \ No newline at end of file diff --git a/htdocs/hrm/evaluation_agenda.php b/htdocs/hrm/evaluation_agenda.php new file mode 100644 index 00000000000..8524f6df3d9 --- /dev/null +++ b/htdocs/hrm/evaluation_agenda.php @@ -0,0 +1,282 @@ + + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND + * + * 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 . + */ + +/** + * \file evaluation_agenda.php + * \ingroup hr + * \brief Tab of events on Evaluation + */ + +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs +//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters +//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters +//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). +//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) +//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data +//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php +//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library +//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. +//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value +//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler +//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message +//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies +//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET +//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification + +// 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"); +} + +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/hrm/class/evaluation.class.php'; +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_evaluation.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php'; + + +// Load translation files required by the page +$langs->loadLangs(array("hrm", "other")); + +// Get parameters +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); +$action = GETPOST('action', 'aZ09'); +$cancel = GETPOST('cancel', 'aZ09'); +$backtopage = GETPOST('backtopage', 'alpha'); + +if (GETPOST('actioncode', 'array')) { + $actioncode = GETPOST('actioncode', 'array', 3); + if (!count($actioncode)) { + $actioncode = '0'; + } +} else { + $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); +} +$search_agenda_label = GETPOST('search_agenda_label'); + +$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$sortfield = GETPOST("sortfield", 'alpha'); +$sortorder = GETPOST("sortorder", 'alpha'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +if (empty($page) || $page == -1) { + $page = 0; +} // If $page is not defined, or '' or -1 +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (!$sortfield) { + $sortfield = 'a.datep,a.id'; +} +if (!$sortorder) { + $sortorder = 'DESC,DESC'; +} + +// Initialize technical objects +$object = new Evaluation($db); +$extrafields = new ExtraFields($db); +$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('evaluationagenda', 'globalcard')); // Note that conf->hooks_modules contains array +// Fetch optionals attributes and labels +$extrafields->fetch_name_optionals_label($object->table_element); + +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +if ($id > 0 || !empty($ref)) { + $upload_dir = $conf->hrm->multidir_output[$object->entity]."/".$object->id; +} + +$permissiontoadd = $user->rights->hrm->evaluation->write; // Used by the include of actions_addupdatedelete.inc.php +$permissiontoread = $user->rights->hrm->evaluation->read; // Used by the include of actions_addupdatedelete.inc.php + +// Security check (enable the most restrictive one) +//if ($user->socid > 0) accessforbidden(); +//if ($user->socid > 0) $socid = $user->socid; +//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); +//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); +if (empty($conf->hrm->enabled)) accessforbidden(); +if (!$permissiontoread) accessforbidden(); + + +/* + * Actions + */ + +$parameters = array('id'=>$id); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + +if (empty($reshook)) { + // Cancel + if (GETPOST('cancel', 'alpha') && !empty($backtopage)) { + header("Location: ".$backtopage); + exit; + } + + // Purge search criteria + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers + $actioncode = ''; + $search_agenda_label = ''; + } +} + + + +/* + * View + */ + +$form = new Form($db); + +if ($object->id > 0) { + $title = $langs->trans("Agenda"); + //if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; + $help_url = 'EN:Module_Agenda_En'; + llxHeader('', $title, $help_url); + + if (!empty($conf->notification->enabled)) { + $langs->load("mails"); + } + $head = evaluationPrepareHead($object); + + + print dol_get_fiche_head($head, 'agenda', $langs->trans("Agenda"), -1, $object->picto); + + // Object card + // ------------------------------------------------------------ + $linkback = ''.$langs->trans("BackToList").''; + + $morehtmlref = '
    '; + $morehtmlref .= $langs->trans('Label').' : '.$object->label; + $u_position = new User(($db)); + $u_position->fetch($object->fk_user); + $morehtmlref .= '
    '.$langs->trans('Employee').' : '.$u_position->getNomUrl(1); + $job = new Job($db); + $job->fetch($object->fk_job); + $morehtmlref .= '
    '.$langs->trans('Job').' : '.$job->getNomUrl(1); + $morehtmlref .= '
    '; + + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + + print '
    '; + print '
    '; + + $object->info($object->id); + dol_print_object_info($object, 1); + + print '
    '; + + print dol_get_fiche_end(); + + + + // Actions buttons + + $objthirdparty = $object; + $objcon = new stdClass(); + + $out = '&origin='.urlencode($object->element.'@'.$object->module).'&originid='.urlencode($object->id); + $urlbacktopage = $_SERVER['PHP_SELF'].'?id='.$object->id; + $out .= '&backtopage='.urlencode($urlbacktopage); + $permok = $user->rights->agenda->myactions->create; + if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) { + //$out.='trans("AddAnAction"),'filenew'); + //$out.=""; + } + + + print '
    '; + + if (!empty($conf->agenda->enabled)) { + if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + print ''.$langs->trans("AddAction").''; + } else { + print ''.$langs->trans("AddAction").''; + } + } + + print '
    '; + + if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { + $param = '&id='.$object->id.'&socid='.$socid; + if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { + $param .= '&contextpage='.urlencode($contextpage); + } + if ($limit > 0 && $limit != $conf->liste_limit) { + $param .= '&limit='.urlencode($limit); + } + + + //print load_fiche_titre($langs->trans("ActionsOnEvaluation"), '', ''); + + // List of all actions + $filters = array(); + $filters['search_agenda_label'] = $search_agenda_label; + + // TODO Replace this with same code than into list.php + show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, $object->module); + } +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/hrm/evaluation_card.php b/htdocs/hrm/evaluation_card.php new file mode 100644 index 00000000000..48554770107 --- /dev/null +++ b/htdocs/hrm/evaluation_card.php @@ -0,0 +1,763 @@ + + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND + * + * 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 . + */ + +/** + * \file evaluation_card.php + * \ingroup hrm + * \brief Page to create/edit/view evaluation + */ + +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs +//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters +//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters +//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). +//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) +//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data +//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php +//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library +//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. +//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value +//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler +//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message +//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies +//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET +//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification + +// 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"); +} + +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; +require_once DOL_DOCUMENT_ROOT.'/hrm/class/evaluation.class.php'; +require_once DOL_DOCUMENT_ROOT.'/hrm/class/skill.class.php'; +require_once DOL_DOCUMENT_ROOT.'/hrm/class/skillrank.class.php'; +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_evaluation.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_skillrank.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; + +// Load translation files required by the page +$langs->loadLangs(array("hrm", "other")); + +// Get parameters +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); +$action = GETPOST('action', 'aZ09'); +$confirm = GETPOST('confirm', 'alpha'); +$cancel = GETPOST('cancel', 'aZ09'); +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'evaluationcard'; // To manage different context of search +$backtopage = GETPOST('backtopage', 'alpha'); +$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); +//$lineid = GETPOST('lineid', 'int'); + +// Initialize technical objects +$object = new Evaluation($db); +$extrafields = new ExtraFields($db); +$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('evaluationcard', 'globalcard')); // Note that conf->hooks_modules contains array + +// Fetch optionals attributes and labels +$extrafields->fetch_name_optionals_label($object->table_element); + +$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); + +// Initialize array of search criterias +$search_all = GETPOST("search_all", 'alpha'); +$search = array(); +foreach ($object->fields as $key => $val) { + if (GETPOST('search_'.$key, 'alpha')) { + $search[$key] = GETPOST('search_'.$key, 'alpha'); + } +} + +if (empty($action) && empty($id) && empty($ref)) { + $action = 'view'; +} + +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. + + +$permissiontoread = $user->rights->hrm->evaluation->read; +$permissiontoadd = $user->rights->hrm->evaluation->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php +$permissiontovalidate = $user->rights->hrm->evaluation->validate; +$permissiontoClose = $user->rights->hrm->evaluation->write; +$permissiontodelete = $user->rights->hrm->evaluation->delete/* || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT)*/; +$permissiondellink = $user->rights->hrm->evaluation->write; // Used by the include of actions_dellink.inc.php +$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1].'/evaluation'; + +// Security check (enable the most restrictive one) +//if ($user->socid > 0) accessforbidden(); +//if ($user->socid > 0) $socid = $user->socid; +//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); +//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); +if (empty($conf->hrm->enabled)) accessforbidden(); +if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) accessforbidden(); + + +/* + * Actions + */ + +$parameters = array(); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + +if (empty($reshook)) { + $error = 0; + + $backurlforlist = dol_buildpath('/hrm/evaluation_list.php', 1); + + if (empty($backtopage) || ($cancel && empty($id))) { + if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { + if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { + $backtopage = $backurlforlist; + } else { + $backtopage = dol_buildpath('/hrm/evaluation_card.php', 1).'?id='.($id > 0 ? $id : '__ID__'); + } + } + } + + $triggermodname = 'hrm_EVALUATION_MODIFY'; // Name of trigger action code to execute when we modify record + + // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen + include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; + + // Actions when linking object each other + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; + + // Actions when printing a doc from card + include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; + + // Action to move up and down lines of object + //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; + + // Action to build doc + include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; + + if ($action == 'set_thirdparty' && $permissiontoadd) { + $object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, $triggermodname); + } + if ($action == 'classin' && $permissiontoadd) { + $object->setProject(GETPOST('projectid', 'int')); + } + + // Actions to send emails + $triggersendname = 'hrm_EVALUATION_SENTBYMAIL'; + $autocopy = 'MAIN_MAIL_AUTOCOPY_EVALUATION_TO'; + $trackid = 'evaluation'.$object->id; + include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; + + if ($action == 'saveSkill') { + $TNote = GETPOST('TNote', 'array'); + if (!empty($TNote)) { + foreach ($object->lines as $line) { + $line->rank = $TNote[$line->fk_skill]; + $line->update($user); + } + } + } + + if ($action == 'close') { + // save evaldet lines to user; + $sk = new SkillRank($db); + $SkillrecordsForActiveUser = $sk->fetchAll('ASC', 'fk_skill', 0, 0, array("customsql"=>"fk_object = ".$object->fk_user ." AND objecttype ='".SkillRank::SKILLRANK_TYPE_USER."'"), 'AND'); + + $errors = 0; + // we go through the evaldets of the eval + foreach ($object->lines as $key => $line) { + // no reference .. we add the line to use it + if (count($SkillrecordsForActiveUser) == 0) { + if ($res > 0) { + $newSkill = new SkillRank($db); + $resCreate = $newSkill->cloneFromCurrentSkill($line, $user, $object->fk_user); + + if ($resCreate <= 0) { + $errors++; + setEventMessage($langs->trans('ErrorCreateUserSkill'), $line->fk_skill); + } + } else { + setEventMessage($langs->trans('NoSkilRankLoaded')); + } + } else { + //check if the skill is present to use it + $find = false; + $keyFind = 0; + foreach ($SkillrecordsForActiveUser as $k => $sr) { + if ($sr->fk_skill == $line->fk_skill) { + $keyFind = $k; + $find = true; + break; + } + } + //we update the skill user + if ($find) { + $updSkill = $SkillrecordsForActiveUser[$k]; + + $updSkill->rank = $line->rank; + $updSkill->update($user); + } else { // sinon on ajoute la skill + $newSkill = new SkillRank($db); + $resCreate = $newSkill->cloneFromCurrentSkill($line, $user, $object->fk_user); + } + } + } + $object->setStatut(Evaluation::STATUS_CLOSED); + } + + if ($action == 'reopen' ) { + // no update here we just change the evaluation status + $object->setStatut(Evaluation::STATUS_VALIDATED); + } +} + + + + +/* + * View + * + * Put here all code to build page + */ + +$form = new Form($db); +$formfile = new FormFile($db); +$formproject = new FormProjets($db); + +$title = $langs->trans("Evaluation"); +$help_url = ''; +llxHeader('', $title, $help_url); + +print ''; + +// Part to create +if ($action == 'create') { + print load_fiche_titre($langs->trans("NewEval"), '', 'object_' . $object->picto); + + print '
    '; + print ''; + print ''; + if ($backtopage) { + print ''; + } + if ($backtopageforcancel) { + print ''; + } + + print dol_get_fiche_head(array(), ''); + + // Set some default values + //if (! GETPOSTISSET('fieldname')) $_POST['fieldname'] = 'myvalue'; + + print ''."\n"; + + // Common attributes + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php'; + + // Other attributes + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; + + print '
    '."\n"; + + print dol_get_fiche_end(); + + print '
    '; + print ''; + print '  '; + print ''; // Cancel for create does not post form if we don't know the backtopage + print '
    '; + + print '
    '; +} + +// Part to edit record +if (($id || $ref) && $action == 'edit') { + print load_fiche_titre($langs->trans("Evaluation"), '', 'object_'.$object->picto); + + print '
    '; + print ''; + print ''; + print ''; + if ($backtopage) { + print ''; + } + if ($backtopageforcancel) { + print ''; + } + + print dol_get_fiche_head(); + + print ''."\n"; + + // Common attributes + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php'; + + // Other attributes + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php'; + + print '
    '; + + print dol_get_fiche_end(); + + print '
    '; + print '   '; + print '
    '; + + print '
    '; +} + +// Part to show record +if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) { + $res = $object->fetch_optionals(); + + $head = evaluationPrepareHead($object); + print dol_get_fiche_head($head, 'card', $langs->trans("Workstation"), -1, $object->picto); + + $formconfirm = ''; + + if ($action == 'validate' && $permissiontovalidate) { + // Confirm validate proposal + $error = 0; + + // We verify whether the object is provisionally numbering + $ref = substr($object->ref, 1, 4); + if ($ref == 'PROV') { + $numref = $object->getNextNumRef(); + if (empty($numref)) { + $error++; + setEventMessages($object->error, $object->errors, 'errors'); + } + } else { + $numref = $object->ref; + } + + $text = $langs->trans('ConfirmValidateEvaluation', $numref); + if (!empty($conf->notification->enabled)) { + require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; + $notify = new Notify($db); + $text .= '
    '; + $text .= $notify->confirmMessage('HRM_EVALUATION_VALIDATE', $object->socid, $object); + } + + if (!$error) { + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateEvaluation'), $text, 'confirm_validate', '', 0, 1); + } + } + + // Confirmation to delete + if ($action == 'delete') { + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteEvaluation'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1); + } + // Confirmation to delete line + if ($action == 'deleteline') { + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1); + } + // Clone confirmation + if ($action == 'clone') { + // Create an array for form + $formquestion = array(); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + } + + // Confirmation of action xxxx + if ($action == 'xxx') { + $formquestion = array(); + + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220); + } + + // Call Hook formConfirm + $parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid); + $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + if (empty($reshook)) { + $formconfirm .= $hookmanager->resPrint; + } elseif ($reshook > 0) { + $formconfirm = $hookmanager->resPrint; + } + + // Print form confirm + print $formconfirm; + + + // Object card + // ------------------------------------------------------------ + $linkback = ''.$langs->trans("BackToList").''; + + $morehtmlref = '
    '; + $morehtmlref .= $langs->trans('Label').' : '.$object->label; + $u_position = new User(($db)); + $u_position->fetch($object->fk_user); + $morehtmlref .= '
    '.$langs->trans('Employee').' : '.$u_position->getNomUrl(1); + $job = new Job($db); + $job->fetch($object->fk_job); + $morehtmlref .= '
    '.$langs->trans('Job').' : '.$job->getNomUrl(1); + $morehtmlref .= '
    '; + + + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + + + print '
    '; + print '
    '; + print '
    '; + print ''."\n"; + + $object->fields['label']['visible']=0; // Already in banner + $object->fields['fk_user']['visible']=0; // Already in banner + $object->fields['fk_job']['visible']=0; // Already in banner + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; + + // Other attributes. Fields from hook formObjectOptions and Extrafields. + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; + + print '
    '; + print '
    '; + print '
    '; + + print '
    '; + + print dol_get_fiche_end(); + + + /* + * Lines + */ + + if (!empty($object->table_element_line)) { + if ($object->status == Evaluation::STATUS_DRAFT) { + $result = $object->getLinesArray(); + + print '
    + + + + + + '; + + if (!empty($conf->use_javascript_ajax) && $object->status == 0) { + include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; + } + + print '
    '; + /*if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + }*/ + + + if (!empty($object->lines)) { + print '
    '.$langs->trans('Skill').''.$langs->trans('Description').''.$langs->trans('Rank').'
    '; + $object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1, ''); + print '
    '; + } + + + + if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { + print ''; + + if ($object->status == $object::STATUS_DRAFT && $permissiontoadd) { + print '
    '; + print ''; + print '
    '; + } + } + + + print '
    '; + + print "
    \n"; + print "
    "; + } + } + + + // Buttons for actions + + if ($action != 'presend' && $action != 'editline') { + print '
    '."\n"; + $parameters = array(); + $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + } + + if (empty($reshook)) { + // Send + if (empty($user->socid)) { + print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init&token='.newToken().'#formmailbeforetitle'); + } + + // Back to draft + if ($object->status == $object::STATUS_VALIDATED) { + print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken(), '', $permissiontoadd); + print dolGetButtonAction($langs->trans('Close'), '', 'close', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=close&token='.newToken(), '', $permissiontodelete || ($object->status == $object::STATUS_CLOSED && $permissiontoclose)); + } elseif ($object->status != $object::STATUS_CLOSED) { + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); + } + + if ($object->status == $object::STATUS_CLOSED) { + print dolGetButtonAction($langs->trans('reopen'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen&token='.newToken(), '', $permissiontoadd); + } + + + // Validate + if ($object->status == $object::STATUS_DRAFT) { + if (empty($object->table_element_line) || (is_array($object->lines) && count($object->lines) > 0)) { + print dolGetButtonAction($langs->trans('SaveRank').' '.$langs->trans('and').' '.$langs->trans('Valid'), '', 'default', '#', 'btn_valid', $permissiontovalidate); + } else { + $langs->load("errors"); + print dolGetButtonAction($langs->trans("ErrorAddAtLeastOneLineFirst"), $langs->trans("Validate"), 'default', '#', '', 0); + } + } + + + // Delete (need delete permission, or if draft, just need create/modify permission) + print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete); + } + + + print '
    '."\n"; + } + + // list of comparison + if ($object->status != Evaluation::STATUS_DRAFT) { + // Recovery of skills related to this evaluation + + $sql = 'select'; + $sql .= ' e.ref,'; + $sql .= ' e.date_creation,'; + $sql .= ' e.fk_job,'; + $sql .= ' j.label as refjob,'; + $sql .= ' ed.fk_skill,'; + + $sql .= ' sk.label as skilllabel,'; + $sql .= ' sk.skill_type,'; + $sql .= ' sk.description,'; + $sql .= ' ed.rank,'; + $sql .= ' ed.required_rank,'; + $sql .= ' ed.rank as userRankForSkill,'; + $sql .= ' skdet_user.description as userRankForSkillDesc,'; + $sql .= ' skdet_required.description as required_rank_desc'; + + $sql .= ' FROM ' . MAIN_DB_PREFIX . 'hrm_evaluation as e'; + $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'hrm_evaluationdet as ed ON e.rowid = ed.fk_evaluation'; + $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'hrm_job as j ON e.fk_job = j.rowid'; + $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'hrm_skill as sk ON ed.fk_skill = sk.rowid'; + $sql .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'hrm_skilldet as skdet_user ON (skdet_user.fk_skill = sk.rowid AND skdet_user.rank = ed.rank)'; + //$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "hrm_skillrank as skr ON (j.rowid = skr.fk_object AND skr.fk_skill = ed.fk_skill AND skr.objecttype = 'job')"; + $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'hrm_skilldet as skdet_required ON (skdet_required.fk_skill = sk.rowid AND skdet_required.rank = ed.required_rank)'; + $sql .= " WHERE e.rowid =" . $object->id; + + // echo $sql; + + $resql = $db->query($sql); + $Tab = array(); + + if ($resql) { + $num = 0; + while ($obj = $db->fetch_object($resql)) { + $Tab[$num] = new stdClass(); + $class = ''; + $Tab[$num]->skill_type = $obj->skill_type; + $Tab[$num]->skill_id = $obj->fk_skill; + $Tab[$num]->skilllabel = $obj->skilllabel; + $Tab[$num]->description = $obj->description; + $Tab[$num]->userRankForSkill = '' . $obj->userRankForSkill . ''; + $Tab[$num]->required_rank = '' . $obj->required_rank . ''; + + if ($obj->userRankForSkill > $obj->required_rank) { + $class .= 'veryhappy'; + } elseif ($obj->userRankForSkill == $obj->required_rank) { + $class .= 'happy'; + } elseif ($obj->userRankForSkill < $obj->required_rank) { + $class .= 'sad'; + } + + $Tab[$num]->result = ' '; + + $num++; + } + + print load_fiche_titre($langs->trans("SkillList"), '', 'title'); + print '
    '; + print ''; + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + $sk = new Skill($db); + foreach ($Tab as $t) { + $sk->fetch($t->skill_id); + print ''; + print ' '; + print ' '; + print ' '; + print ' '; + print ' '; + print ' '; + print ''; + } + + print '
    ' . $langs->trans("TypeSkill") . ' ' . $langs->trans("Label") . '' . $langs->trans("Description") . '' . $langs->trans("UserRank") . '' . $langs->trans("RequiredRank") . '' . $langs->trans("Result") . '
    ' . Skill::typeCodeToLabel($t->skill_type) . '' . $sk->getNomUrl(1) . '' . $t->description . '' . $t->userRankForSkill . '' . $t->required_rank . '' . $t->result . '
    '; + + ?> + + + +
    '; + print ''; // ancre + + $includedocgeneration = 0; + + // Documents + if ($includedocgeneration) { + $objref = dol_sanitizeFileName($object->ref); + $relativepath = $objref.'/'.$objref.'.pdf'; + $filedir = $conf->hrm->dir_output.'/'.$object->element.'/'.$objref; + $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; + $genallowed = $user->rights->hrm->evaluation->read; // If you can read, you can build the PDF to read content + $delallowed = $user->rights->hrm->evaluation->write; // If you can create/edit, you can remove a file on card + print $formfile->showdocuments('hrm:Evaluation', $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang); + } + + // Show links to link elements + $linktoelem = $form->showLinkToObjectBlock($object, null, array('evaluation')); + $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); + + + print '
    '; + + $MAXEVENT = 10; + + $morehtmlright = ''; + $morehtmlright .= $langs->trans("SeeAll"); + $morehtmlright .= ''; + + // List of actions on element + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; + $formactions = new FormActions($db); + $somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlright); + + print '
    '; + } + + //Select mail models is same action as presend + if (GETPOST('modelselected')) { + $action = 'presend'; + } + + // Presend form + $modelmail = 'evaluation'; + $defaulttopic = 'InformationMessage'; + $diroutput = $conf->hrm->dir_output; + $trackid = 'evaluation'.$object->id; + + include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/hrm/evaluation_contact.php b/htdocs/hrm/evaluation_contact.php new file mode 100644 index 00000000000..db6d93f7ef7 --- /dev/null +++ b/htdocs/hrm/evaluation_contact.php @@ -0,0 +1,220 @@ + + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND + * + * 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 . + */ + +/** + * \file evaluation_contact.php + * \ingroup hrm + * \brief Tab for contacts linked to Evaluation + */ + +// 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"); +} + +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +dol_include_once('/hrm/class/evaluation.class.php'); +dol_include_once('/hrm/lib/hrm_evaluation.lib.php'); + +// Load translation files required by the page +$langs->loadLangs(array("hrm", "companies", "other", "mails")); + +$id = (GETPOST('id') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility +$ref = GETPOST('ref', 'alpha'); +$lineid = GETPOST('lineid', 'int'); +$socid = GETPOST('socid', 'int'); +$action = GETPOST('action', 'aZ09'); + +// Initialize technical objects +$object = new Evaluation($db); +$extrafields = new ExtraFields($db); +$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('evaluationcontact', 'globalcard')); // Note that conf->hooks_modules contains array +// Fetch optionals attributes and labels +$extrafields->fetch_name_optionals_label($object->table_element); + +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals + +$permission = $user->rights->hrm->evaluation->write; + +// Security check (enable the most restrictive one) +//if ($user->socid > 0) accessforbidden(); +//if ($user->socid > 0) $socid = $user->socid; +//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); +//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); +//if (empty($conf->hrm->enabled)) accessforbidden(); +//if (!$permissiontoread) accessforbidden(); + + +/* + * Add a new contact + */ + +if ($action == 'addcontact' && $permission) { + $contactid = (GETPOST('userid') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int')); + $typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type')); + $result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09')); + + if ($result >= 0) { + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit; + } else { + if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { + $langs->load("errors"); + setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors'); + } else { + setEventMessages($object->error, $object->errors, 'errors'); + } + } +} elseif ($action == 'swapstatut' && $permission) { + // Toggle the status of a contact + $result = $object->swapContactStatus(GETPOST('ligne', 'int')); +} elseif ($action == 'deletecontact' && $permission) { + // Deletes a contact + $result = $object->delete_contact($lineid); + + if ($result >= 0) { + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit; + } else { + dol_print_error($db); + } +} + + +/* + * View + */ + +$title = $langs->trans('Evaluation')." - ".$langs->trans('ContactsAddresses'); +$help_url = ''; +//$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; +llxHeader('', $title, $help_url); + +$form = new Form($db); +$formcompany = new FormCompany($db); +$contactstatic = new Contact($db); +$userstatic = new User($db); + + +/* *************************************************************************** */ +/* */ +/* View and edit mode */ +/* */ +/* *************************************************************************** */ + +if ($object->id) { + /* + * Show tabs + */ + $head = evaluationPrepareHead($object); + + print dol_get_fiche_head($head, 'contact', '', -1, $object->picto); + + $linkback = ''.$langs->trans("BackToList").''; + + $morehtmlref = '
    '; + /* + // Ref customer + $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); + $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); + // Thirdparty + $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); + // Project + if (! empty($conf->projet->enabled)) + { + $langs->load("projects"); + $morehtmlref.='
    '.$langs->trans('Project') . ' '; + if ($permissiontoadd) + { + if ($action != 'classify') + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + $morehtmlref.=' : '; + if ($action == 'classify') { + //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); + $morehtmlref.='
    '; + $morehtmlref.=''; + $morehtmlref.=''; + $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.=''; + $morehtmlref.='
    '; + } else { + $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + } + } else { + if (! empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref .= ': '.$proj->getNomUrl(); + } else { + $morehtmlref .= ''; + } + } + }*/ + $morehtmlref .= '
    '; + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); + + print dol_get_fiche_end(); + + print '
    '; + + // Contacts lines (modules that overwrite templates must declare this into descriptor) + $dirtpls = array_merge($conf->modules_parts['tpl'], array('/core/tpl')); + foreach ($dirtpls as $reldir) { + $res = @include dol_buildpath($reldir.'/contacts.tpl.php'); + if ($res) { + break; + } + } +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/hrm/evaluation_document.php b/htdocs/hrm/evaluation_document.php new file mode 100644 index 00000000000..06cbd7a621a --- /dev/null +++ b/htdocs/hrm/evaluation_document.php @@ -0,0 +1,224 @@ + + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND + * + * 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 . + */ + +/** + * \file evaluation_document.php + * \ingroup hrm + * \brief Tab for documents linked to Evaluation + */ + +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs +//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters +//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters +//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). +//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) +//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data +//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php +//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library +//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. +//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value +//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler +//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message +//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies +//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET +//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification + +// 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"); +} + +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +require_once DOL_DOCUMENT_ROOT . '/hrm/class/evaluation.class.php'; +require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_evaluation.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; + +// Load translation files required by the page +$langs->loadLangs(array("hrm", "companies", "other", "mails")); + + +$action = GETPOST('action', 'aZ09'); +$confirm = GETPOST('confirm'); +$id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int')); +$ref = GETPOST('ref', 'alpha'); + +// Get parameters +$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$sortfield = GETPOST("sortfield", 'alpha'); +$sortorder = GETPOST("sortorder", 'alpha'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +if (empty($page) || $page == -1) { + $page = 0; +} // If $page is not defined, or '' or -1 +$offset = $liste_limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (!$sortorder) { + $sortorder = "ASC"; +} +if (!$sortfield) { + $sortfield = "name"; +} +//if (! $sortfield) $sortfield="position_name"; + +// Initialize technical objects +$object = new Evaluation($db); +$extrafields = new ExtraFields($db); +$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('evaluationdocument', 'globalcard')); // Note that conf->hooks_modules contains array +// Fetch optionals attributes and labels +$extrafields->fetch_name_optionals_label($object->table_element); + +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals + +if ($id > 0 || !empty($ref)) { + $upload_dir = $conf->hrm->multidir_output[$object->entity ? $object->entity : $conf->entity]."/evaluation/".get_exdir(0, 0, 0, 1, $object); +} + +$permissiontoadd = $user->rights->hrm->evaluation->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php +$permissiontoread = $user->rights->hrm->evaluation->read; + +// Security check (enable the most restrictive one) +//if ($user->socid > 0) accessforbidden(); +//if ($user->socid > 0) $socid = $user->socid; +//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); +//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); +if (empty($conf->hrm->enabled)) accessforbidden(); +if (!$permissiontoread) accessforbidden(); + + +/* + * Actions + */ + +include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; + + +/* + * View + */ + +$form = new Form($db); + +$title = $langs->trans("Evaluation").' - '.$langs->trans("Files"); +$help_url = ''; +//$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; +llxHeader('', $title, $help_url); + +if ($object->id) { + /* + * Show tabs + */ + $head = evaluationPrepareHead($object); + + print dol_get_fiche_head($head, 'document', $langs->trans("Documents"), -1, $object->picto); + + + // Build file list + $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1); + $totalsize = 0; + foreach ($filearray as $key => $file) { + $totalsize += $file['size']; + } + + // Object card + // ------------------------------------------------------------ + $linkback = ''.$langs->trans("BackToList").''; + + $morehtmlref = '
    '; + $morehtmlref .= $langs->trans('Label').' : '.$object->label; + $u_position = new User(($db)); + $u_position->fetch($object->fk_user); + $morehtmlref .= '
    '.$langs->trans('Employee').' : '.$u_position->getNomUrl(1); + $job = new Job($db); + $job->fetch($object->fk_job); + $morehtmlref .= '
    '.$langs->trans('Job').' : '.$job->getNomUrl(1); + $morehtmlref .= '
    '; + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + + print '
    '; + + print '
    '; + print ''; + + // Number of files + print ''; + + // Total size + print ''; + + print '
    '.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
    '.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
    '; + + print '
    '; + + print dol_get_fiche_end(); + + $modulepart = 'hrm'; + $permtoedit = $permissiontoadd; + $param = '&id='.$object->id; + + //$relativepathwithnofile='evaluation/' . dol_sanitizeFileName($object->id).'/'; + $relativepathwithnofile = 'evaluation/'.dol_sanitizeFileName($object->ref).'/'; + + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; +} else { + accessforbidden('', 0, 1); +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/hrm/evaluation_list.php b/htdocs/hrm/evaluation_list.php new file mode 100644 index 00000000000..6a74cb9bc6b --- /dev/null +++ b/htdocs/hrm/evaluation_list.php @@ -0,0 +1,731 @@ + + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND + * + * 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 . + */ + +/** + * \file evaluation_list.php + * \ingroup hrm + * \brief List page for evaluation + */ + +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs +//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters +//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters +//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). +//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) +//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data +//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php +//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library +//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. +//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value +//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler +//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message +//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies +//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET +//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification + +// 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"); +} + +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; + +// load hrm libraries +require_once __DIR__.'/class/evaluation.class.php'; + +// for other modules +//dol_include_once('/othermodule/class/otherobject.class.php'); + +// Load translation files required by the page +$langs->loadLangs(array("hrm", "other")); + +$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... +$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) +$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation +$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button +$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'evaluationlist'; // To manage different context of search +$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') + +$id = GETPOST('id', 'int'); + +// Load variable for pagination +$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$sortfield = GETPOST('sortfield', 'aZ09comma'); +$sortorder = GETPOST('sortorder', 'aZ09comma'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { + // If $page is not defined, or '' or -1 or if we click on clear filters + $page = 0; +} +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; + +// Initialize technical objects +$object = new Evaluation($db); +$extrafields = new ExtraFields($db); +$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('evaluationlist')); // Note that conf->hooks_modules contains array + +// Fetch optionals attributes and labels +$extrafields->fetch_name_optionals_label($object->table_element); +//$extrafields->fetch_name_optionals_label($object->table_element_line); + +$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); + +// Default sort order (if not yet defined by previous GETPOST) +if (!$sortfield) { + reset($object->fields); // Reset is required to avoid key() to return null. + $sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition. +} +if (!$sortorder) { + $sortorder = "ASC"; +} + +// Initialize array of search criterias +$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); +$search = array(); +foreach ($object->fields as $key => $val) { + if (GETPOST('search_'.$key, 'alpha') !== '') { + $search[$key] = GETPOST('search_'.$key, 'alpha'); + } + if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); + } +} + +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array(); +foreach ($object->fields as $key => $val) { + if (!empty($val['searchall'])) { + $fieldstosearchall['t.'.$key] = $val['label']; + } +} + +// Definition of array of fields for columns +$arrayfields = array(); +foreach ($object->fields as $key => $val) { + // If $val['visible']==0, then we never show the field + if (!empty($val['visible'])) { + $visible = (int) dol_eval($val['visible'], 1); + $arrayfields['t.'.$key] = array( + 'label'=>$val['label'], + 'checked'=>(($visible < 0) ? 0 : 1), + 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)), + 'position'=>$val['position'], + 'help'=> isset($val['help']) ? $val['help'] : '' + ); + } +} +// Extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; + +$object->fields = dol_sort_array($object->fields, 'position'); +$arrayfields = dol_sort_array($arrayfields, 'position'); + +$permissiontoread = $user->rights->hrm->evaluation->read; +$permissiontoadd = $user->rights->hrm->evaluation->write; +$permissiontodelete = $user->rights->hrm->evaluation->delete; + +// Security check +if (empty($conf->hrm->enabled)) { + accessforbidden('Module not enabled'); +} + +// Security check (enable the most restrictive one) +if ($user->socid > 0) accessforbidden(); +//if ($user->socid > 0) accessforbidden(); +//$socid = 0; if ($user->socid > 0) $socid = $user->socid; +//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); +//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); +//if (empty($conf->hrm->enabled)) accessforbidden(); +//if (!$permissiontoread) accessforbidden(); + + + +/* + * Actions + */ + +if (GETPOST('cancel', 'alpha')) { + $action = 'list'; + $massaction = ''; +} +if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { + $massaction = ''; +} + +$parameters = array(); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + +if (empty($reshook)) { + // Selection of new fields + include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; + + // Purge search criteria + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers + foreach ($object->fields as $key => $val) { + $search[$key] = ''; + if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + $search[$key.'_dtstart'] = ''; + $search[$key.'_dtend'] = ''; + } + } + $toselect = array(); + $search_array_options = array(); + } + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha') + || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) { + $massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation + } + + // Mass actions + $objectclass = 'Evaluation'; + $objectlabel = 'Evaluation'; + $uploaddir = $conf->hrm->dir_output; + include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; +} + + + +/* + * View + */ + +$form = new Form($db); + +$now = dol_now(); + +//$help_url="EN:Module_Evaluation|FR:Module_Evaluation_FR|ES:Módulo_Evaluation"; +$help_url = ''; +$title = $langs->trans("List").' '.$langs->trans('Evaluations'); +$morejs = array(); +$morecss = array(); + + +// Build and execute select +// -------------------------------------------------------------------- +$sql = 'SELECT '; +$sql .= $object->getFieldList('t'); +// Add fields from extrafields +if (!empty($extrafields->attributes[$object->table_element]['label'])) { + foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key.', ' : ''); + } +} +// Add fields from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= preg_replace('/^,/', '', $hookmanager->resPrint); +$sql = preg_replace('/,\s*$/', '', $sql); +$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; +if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; +} +// Add table from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; +if ($object->ismultientitymanaged == 1) { + $sql .= " WHERE t.entity IN (".getEntity($object->element).")"; +} else { + $sql .= " WHERE 1 = 1"; +} +foreach ($search as $key => $val) { + if (array_key_exists($key, $object->fields)) { + if ($key == 'status' && $search[$key] == -1) { + continue; + } + $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); + if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) { + if ($search[$key] == '-1' || $search[$key] === '0') { + $search[$key] = ''; + } + $mode_search = 2; + } + if ($search[$key] != '') { + $sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search)); + } + } else { + if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') { + $columnName=preg_replace('/(_dtstart|_dtend)$/', '', $key); + if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) { + if (preg_match('/_dtstart$/', $key)) { + $sql .= " AND t." . $columnName . " >= '" . $db->idate($search[$key]) . "'"; + } + if (preg_match('/_dtend$/', $key)) { + $sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'"; + } + } + } + } +} +if ($search_all) { + $sql .= natural_search(array_keys($fieldstosearchall), $search_all); +} +//$sql.= dolSqlDateFilter("t.field", $search_xxxday, $search_xxxmonth, $search_xxxyear); +// Add where from extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; +// Add where from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; + +/* If a group by is required +$sql .= " GROUP BY "; +foreach($object->fields as $key => $val) { + $sql .= 't.'.$key.', '; +} +// Add fields from extrafields +if (!empty($extrafields->attributes[$object->table_element]['label'])) { + foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : ''); + } +} +// Add where from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; +$sql = preg_replace('/,\s*$/', '', $sql); +*/ + +$sql .= $db->order($sortfield, $sortorder); + +// Count total nb of records +$nbtotalofrecords = ''; +if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + $resql = $db->query($sql); + $nbtotalofrecords = $db->num_rows($resql); + if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0 + $page = 0; + $offset = 0; + } +} +// if total of record found is smaller than limit, no need to do paging and to restart another select with limits set. +if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit))) { + $num = $nbtotalofrecords; +} else { + if ($limit) { + $sql .= $db->plimit($limit + 1, $offset); + } + + $resql = $db->query($sql); + if (!$resql) { + dol_print_error($db); + exit; + } + + $num = $db->num_rows($resql); +} + +// Direct jump if only one record found +if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) { + $obj = $db->fetch_object($resql); + $id = $obj->rowid; + header("Location: ".dol_buildpath('/hrm/evaluation_card.php', 1).'?id='.$id); + exit; +} + + +// Output page +// -------------------------------------------------------------------- + +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', ''); + +// Example : Adding jquery code +// print ''; + +$arrayofselected = is_array($toselect) ? $toselect : array(); + +$param = ''; +if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { + $param .= '&contextpage='.urlencode($contextpage); +} +if ($limit > 0 && $limit != $conf->liste_limit) { + $param .= '&limit='.urlencode($limit); +} +foreach ($search as $key => $val) { + if (is_array($search[$key]) && count($search[$key])) { + foreach ($search[$key] as $skey) { + $param .= '&search_'.$key.'[]='.urlencode($skey); + } + } else { + $param .= '&search_'.$key.'='.urlencode($search[$key]); + } +} +if ($optioncss != '') { + $param .= '&optioncss='.urlencode($optioncss); +} +// Add $param from extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; +// Add $param from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook +$param .= $hookmanager->resPrint; + +// List of mass actions available +$arrayofmassactions = array( + //'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"), + //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), + //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), + //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), +); +if ($permissiontodelete) { + $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); +} +if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { + $arrayofmassactions = array(); +} +$massactionbutton = $form->selectMassAction('', $arrayofmassactions); + +print '
    '."\n"; +if ($optioncss != '') { + print ''; +} +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; + +$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/hrm/evaluation_card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); + +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); + +// Add code for pre mass action (confirmation or email presend form) +$topicmail = "SendEvaluationRef"; +$modelmail = "evaluation"; +$objecttmp = new Evaluation($db); +$trackid = 'xxxx'.$object->id; +include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; + +if ($search_all) { + foreach ($fieldstosearchall as $key => $val) { + $fieldstosearchall[$key] = $langs->trans($val); + } + print '
    '.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'
    '; +} + +$moreforfilter = ''; +/*$moreforfilter.='
    '; +$moreforfilter.= $langs->trans('MyFilter') . ': '; +$moreforfilter.= '
    ';*/ + +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook +if (empty($reshook)) { + $moreforfilter .= $hookmanager->resPrint; +} else { + $moreforfilter = $hookmanager->resPrint; +} + +if (!empty($moreforfilter)) { + print '
    '; + print $moreforfilter; + print '
    '; +} + +$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields +$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); + +print '
    '; // You can use div-table-responsive-no-min if you dont need reserved height for your table +print ''."\n"; + + +// Fields title search +// -------------------------------------------------------------------- +print ''; +foreach ($object->fields as $key => $val) { + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); + if ($key == 'status') { + $cssforfield .= ($cssforfield ? ' ' : '').'center'; + } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '').'center'; + } elseif (in_array($val['type'], array('timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; + } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { + $cssforfield .= ($cssforfield ? ' ' : '').'right'; + } + if (!empty($arrayfields['t.'.$key]['checked'])) { + print ''; + } +} +// Extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; + +// Fields from hook +$parameters = array('arrayfields'=>$arrayfields); +$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; +// Action column +print ''; +print ''."\n"; + + +// Fields title label +// -------------------------------------------------------------------- +print ''; +foreach ($object->fields as $key => $val) { + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); + if ($key == 'status') { + $cssforfield .= ($cssforfield ? ' ' : '').'center'; + } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '').'center'; + } elseif (in_array($val['type'], array('timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; + } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { + $cssforfield .= ($cssforfield ? ' ' : '').'right'; + } + if (!empty($arrayfields['t.'.$key]['checked'])) { + print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n"; + } +} +// Extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; +// Hook fields +$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); +$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; +// Action column +print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; +print ''."\n"; + + +// Detect if we need a fetch on each output line +$needToFetchEachLine = 0; +if (isset($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { + foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) { + if (preg_match('/\$object/', $val)) { + $needToFetchEachLine++; // There is at least one compute field that use $object + } + } +} + + +// Loop on record +// -------------------------------------------------------------------- +$i = 0; +$totalarray = array(); +$totalarray['nbfield'] = 0; +while ($i < ($limit ? min($num, $limit) : $num)) { + $obj = $db->fetch_object($resql); + if (empty($obj)) { + break; // Should not happen + } + + // Store properties in $object + $object->setVarsFromFetchObj($obj); + + // Show here line of result + print ''; + foreach ($object->fields as $key => $val) { + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); + if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '').'center'; + } elseif ($key == 'status') { + $cssforfield .= ($cssforfield ? ' ' : '').'center'; + } + + if (in_array($val['type'], array('timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; + } elseif ($key == 'ref') { + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; + } + + if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) { + $cssforfield .= ($cssforfield ? ' ' : '').'right'; + } + //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; + + if (!empty($arrayfields['t.'.$key]['checked'])) { + print ''; + if ($key == 'status') { + print $object->getLibStatut(5); + } elseif ($key == 'rowid') { + print $object->showOutputField($val, $key, $object->id, ''); + } else { + print $object->showOutputField($val, $key, $object->$key, ''); + } + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + if (!empty($val['isameasure'])) { + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; + } + if (!isset($totalarray['val'])) { + $totalarray['val'] = array(); + } + if (!isset($totalarray['val']['t.'.$key])) { + $totalarray['val']['t.'.$key] = 0; + } + $totalarray['val']['t.'.$key] += $object->$key; + } + } + } + // Extra fields + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; + // Fields from hook + $parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + // Action column + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + + print ''."\n"; + + $i++; +} + +// Show total line +include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; + +// If no record found +if ($num == 0) { + $colspan = 1; + foreach ($arrayfields as $key => $val) { + if (!empty($val['checked'])) { + $colspan++; + } + } + print ''; +} + + +$db->free($resql); + +$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); +$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; + +print '
    '; + if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { + print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); + } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) { + print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', 'maxwidth125', 1); + } elseif (!preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + print ''; + } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + print '
    '; + print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); + print '
    '; + print '
    '; + print $form->selectDate($search[$key.'_dtend'] ? $search[$key.'_dtend'] : '', "search_".$key."_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); + print '
    '; + } + print '
    '; +$searchpicto = $form->showFilterButtons(); +print $searchpicto; +print '
    '; + if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + $selected = 0; + if (in_array($object->id, $arrayofselected)) { + $selected = 1; + } + print ''; + } + print '
    '.$langs->trans("NoRecordFound").'
    '."\n"; +print '
    '."\n"; + +print '
    '."\n"; + +if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { + $hidegeneratedfilelistifempty = 1; + if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { + $hidegeneratedfilelistifempty = 0; + } + + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; + $formfile = new FormFile($db); + + // Show list of available documents + $urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; + $urlsource .= str_replace('&', '&', $param); + + $filedir = $diroutputmassaction; + $genallowed = $permissiontoread; + $delallowed = $permissiontoadd; + + print $formfile->showdocuments('massfilesarea_hrm', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/hrm/evaluation_note.php b/htdocs/hrm/evaluation_note.php new file mode 100644 index 00000000000..aae7b56acaf --- /dev/null +++ b/htdocs/hrm/evaluation_note.php @@ -0,0 +1,182 @@ + + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND + * + * 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 . + */ + +/** + * \file evaluation_note.php + * \ingroup hrm + * \brief Tab for notes on Evaluation + */ + +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs +//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters +//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters +//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). +//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) +//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data +//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php +//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library +//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. +//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value +//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler +//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message +//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies +//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET +//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification + +// 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"); +} + +require_once DOL_DOCUMENT_ROOT . '/hrm/class/evaluation.class.php'; +require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_evaluation.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; + +// Load translation files required by the page +$langs->loadLangs(array("hrm", "companies")); + +// Get parameters +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); +$action = GETPOST('action', 'aZ09'); +$cancel = GETPOST('cancel', 'aZ09'); +$backtopage = GETPOST('backtopage', 'alpha'); + +// Initialize technical objects +$object = new Evaluation($db); +$extrafields = new ExtraFields($db); +$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('evaluationnote', 'globalcard')); // Note that conf->hooks_modules contains array +// Fetch optionals attributes and labels +$extrafields->fetch_name_optionals_label($object->table_element); + +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +if ($id > 0 || !empty($ref)) { + $upload_dir = $conf->hrm->multidir_output[$object->entity]."/".$object->id; +} + +$permissionnote = $user->rights->hrm->evaluation->write; // Used by the include of actions_setnotes.inc.php +$permissiontoread = $user->rights->hrm->evaluation->read; // Used by the include of actions_addupdatedelete.inc.php + +// Security check (enable the most restrictive one) +//if ($user->socid > 0) accessforbidden(); +//if ($user->socid > 0) $socid = $user->socid; +//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); +//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); +//if (empty($conf->hrm->enabled)) accessforbidden(); +//if (!$permissiontoread) accessforbidden(); + + +/* + * Actions + */ + +$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} +if (empty($reshook)) { + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once +} + + +/* + * View + */ + +$form = new Form($db); + +//$help_url='EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes'; +$help_url = ''; +llxHeader('', $langs->trans('Evaluation'), $help_url); + +if ($id > 0 || !empty($ref)) { + $object->fetch_thirdparty(); + + $head = evaluationPrepareHead($object); + + print dol_get_fiche_head($head, 'note', $langs->trans('Notes'), -1, $object->picto); + + // Object card + // ------------------------------------------------------------ + $linkback = ''.$langs->trans("BackToList").''; + + $morehtmlref = '
    '; + $morehtmlref .= $langs->trans('Label').' : '.$object->label; + $u_position = new User(($db)); + $u_position->fetch($object->fk_user); + $morehtmlref .= '
    '.$langs->trans('Employee').' : '.$u_position->getNomUrl(1); + $job = new Job($db); + $job->fetch($object->fk_job); + $morehtmlref .= '
    '.$langs->trans('Job').' : '.$job->getNomUrl(1); + $morehtmlref .= '
    '; + + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + + + print '
    '; + 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/hrm/job_agenda.php b/htdocs/hrm/job_agenda.php new file mode 100644 index 00000000000..b6fbd6aee82 --- /dev/null +++ b/htdocs/hrm/job_agenda.php @@ -0,0 +1,275 @@ + + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND + * + * 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 . + */ + +/** + * \file job_agenda.php + * \ingroup hrm + * \brief Tab of events on Job + */ + +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs +//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters +//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters +//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). +//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) +//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data +//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php +//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library +//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. +//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value +//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler +//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message +//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies +//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET +//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification + +// 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"); +} + +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +dol_include_once('/hrm/class/job.class.php'); +dol_include_once('/hrm/lib/hrm_job.lib.php'); + + +// Load translation files required by the page +$langs->loadLangs(array("hrm", "other")); + +// Get parameters +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); +$action = GETPOST('action', 'aZ09'); +$cancel = GETPOST('cancel', 'aZ09'); +$backtopage = GETPOST('backtopage', 'alpha'); + +if (GETPOST('actioncode', 'array')) { + $actioncode = GETPOST('actioncode', 'array', 3); + if (!count($actioncode)) { + $actioncode = '0'; + } +} else { + $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); +} +$search_agenda_label = GETPOST('search_agenda_label'); + +$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$sortfield = GETPOST("sortfield", 'alpha'); +$sortorder = GETPOST("sortorder", 'alpha'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +if (empty($page) || $page == -1) { + $page = 0; +} // If $page is not defined, or '' or -1 +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (!$sortfield) { + $sortfield = 'a.datep,a.id'; +} +if (!$sortorder) { + $sortorder = 'DESC,DESC'; +} + +// Initialize technical objects +$object = new Job($db); +$extrafields = new ExtraFields($db); +$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('jobagenda', 'globalcard')); // Note that conf->hooks_modules contains array +// Fetch optionals attributes and labels +$extrafields->fetch_name_optionals_label($object->table_element); + +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +if ($id > 0 || !empty($ref)) { + $upload_dir = $conf->hrm->multidir_output[$object->entity]."/".$object->id; +} + +$permissiontoread = $user->rights->hrm->all->read; +$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php + +// Security check (enable the most restrictive one) +//if ($user->socid > 0) accessforbidden(); +//if ($user->socid > 0) $socid = $user->socid; +//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); +//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); +if (empty($conf->hrm->enabled)) accessforbidden(); +if (!$permissiontoread) accessforbidden(); + + +/* + * Actions + */ + +$parameters = array('id'=>$id); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + +if (empty($reshook)) { + // Cancel + if (GETPOST('cancel', 'alpha') && !empty($backtopage)) { + header("Location: ".$backtopage); + exit; + } + + // Purge search criteria + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers + $actioncode = ''; + $search_agenda_label = ''; + } +} + + + +/* + * View + */ + +$form = new Form($db); + +if ($object->id > 0) { + $title = $langs->trans("Agenda"); + //if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; + $help_url = 'EN:Module_Agenda_En'; + llxHeader('', $title, $help_url); + + if (!empty($conf->notification->enabled)) { + $langs->load("mails"); + } + $head = jobPrepareHead($object); + + + print dol_get_fiche_head($head, 'agenda', $langs->trans("Agenda"), -1, $object->picto); + + // Object card + // ------------------------------------------------------------ + $linkback = ''.$langs->trans("BackToList").''; + + $morehtmlref = '
    '; + $morehtmlref.= $object->label; + $morehtmlref .= '
    '; + + + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref); + + print '
    '; + print '
    '; + + $object->info($object->id); + dol_print_object_info($object, 1); + + print '
    '; + + print dol_get_fiche_end(); + + + + // Actions buttons + + $objthirdparty = $object; + $objcon = new stdClass(); + + $out = '&origin='.urlencode($object->element.'@'.$object->module).'&originid='.urlencode($object->id); + $urlbacktopage = $_SERVER['PHP_SELF'].'?id='.$object->id; + $out .= '&backtopage='.urlencode($urlbacktopage); + $permok = $user->rights->agenda->myactions->create; + if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) { + //$out.='trans("AddAnAction"),'filenew'); + //$out.=""; + } + + + print '
    '; + + if (!empty($conf->agenda->enabled)) { + if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + print ''.$langs->trans("AddAction").''; + } else { + print ''.$langs->trans("AddAction").''; + } + } + + print '
    '; + + if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { + $param = '&id='.$object->id.'&socid='.$socid; + if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { + $param .= '&contextpage='.urlencode($contextpage); + } + if ($limit > 0 && $limit != $conf->liste_limit) { + $param .= '&limit='.urlencode($limit); + } + + + //print load_fiche_titre($langs->trans("ActionsOnJob"), '', ''); + + // List of all actions + $filters = array(); + $filters['search_agenda_label'] = $search_agenda_label; + + // TODO Replace this with same code than into list.php + show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, $object->module); + } +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/hrm/job_card.php b/htdocs/hrm/job_card.php new file mode 100644 index 00000000000..8cb8d0fceee --- /dev/null +++ b/htdocs/hrm/job_card.php @@ -0,0 +1,532 @@ + + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND + * + * 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 . + */ + +/** + * \file job_card.php + * \ingroup hrm + * \brief Page to create/edit/view job + */ + +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs +//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters +//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters +//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). +//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) +//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data +//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php +//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library +//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. +//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value +//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler +//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message +//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies +//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET +//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification + +// 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"); +} + +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; +dol_include_once('/hrm/class/job.class.php'); +dol_include_once('/hrm/lib/hrm_job.lib.php'); + +// Load translation files required by the page +$langs->loadLangs(array("hrm", "other")); + +// Get parameters +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); +$action = GETPOST('action', 'aZ09'); +$confirm = GETPOST('confirm', 'alpha'); +$cancel = GETPOST('cancel', 'aZ09'); +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'jobcard'; // To manage different context of search +$backtopage = GETPOST('backtopage', 'alpha'); +$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); +//$lineid = GETPOST('lineid', 'int'); + +// Initialize technical objects +$object = new Job($db); +$extrafields = new ExtraFields($db); +$diroutputmassaction = $conf->hrm->dir_output . '/temp/massgeneration/' . $user->id; +$hookmanager->initHooks(array('jobcard', 'globalcard')); // Note that conf->hooks_modules contains array + +// Fetch optionals attributes and labels +$extrafields->fetch_name_optionals_label($object->table_element); + +$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); + +// Initialize array of search criterias +$search_all = GETPOST("search_all", 'alpha'); +$search = array(); +foreach ($object->fields as $key => $val) { + if (GETPOST('search_' . $key, 'alpha')) { + $search[$key] = GETPOST('search_' . $key, 'alpha'); + } +} + +if (empty($action) && empty($id) && empty($ref)) { + $action = 'view'; +} + +// Load object +include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. + + +$permissiontoread = $user->rights->hrm->all->read; +$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php +$permissiontodelete = $user->rights->hrm->all->delete; +$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1] . '/job'; + +// Security check (enable the most restrictive one) +//if ($user->socid > 0) accessforbidden(); +//if ($user->socid > 0) $socid = $user->socid; +//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); +//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); +if (empty($conf->hrm->enabled)) accessforbidden(); +if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) accessforbidden(); + + +/* + * Actions + */ + +$parameters = array(); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + +if (empty($reshook)) { + $error = 0; + + $backurlforlist = dol_buildpath('/hrm/job_list.php', 1); + + if (empty($backtopage) || ($cancel && empty($id))) { + if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { + if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { + $backtopage = $backurlforlist; + } else { + $backtopage = dol_buildpath('/hrm/job_card.php', 1) . '?id=' . ($id > 0 ? $id : '__ID__'); + } + } + } + + $triggermodname = 'hrm_JOB_MODIFY'; // Name of trigger action code to execute when we modify record + + + // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen + include DOL_DOCUMENT_ROOT . '/core/actions_addupdatedelete.inc.php'; + + // Actions when linking object each other + include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; + + // Actions when printing a doc from card + include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php'; + + // Action to move up and down lines of object + //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; + + // Action to build doc + include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php'; + + if ($action == 'set_thirdparty' && $permissiontoadd) { + $object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, $triggermodname); + } + if ($action == 'classin' && $permissiontoadd) { + $object->setProject(GETPOST('projectid', 'int')); + } + + // Actions to send emails + $triggersendname = 'hrm_JOB_SENTBYMAIL'; + $autocopy = 'MAIN_MAIL_AUTOCOPY_JOB_TO'; + $trackid = 'job' . $object->id; + include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php'; +} + + +/* + * View + * + * Put here all code to build page + */ + +$form = new Form($db); +$formfile = new FormFile($db); +$formproject = new FormProjets($db); + +$title = $langs->trans("Job"); +$help_url = ''; +llxHeader('', $title, $help_url); + +// Example : Adding jquery code +// print ''; + + +// Part to create +if ($action == 'create') { + print load_fiche_titre($langs->trans("NewObject", $langs->transnoentities('Job')), '', 'object_' . $object->picto); + + print '
    '; + print ''; + print ''; + if ($backtopage) { + print ''; + } + if ($backtopageforcancel) { + print ''; + } + + print dol_get_fiche_head(array(), ''); + + // Set some default values + //if (! GETPOSTISSET('fieldname')) $_POST['fieldname'] = 'myvalue'; + + print '' . "\n"; + + // Common attributes + include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php'; + + // Other attributes + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php'; + + print '
    ' . "\n"; + + print dol_get_fiche_end(); + + print '
    '; + print ''; + print '  '; + print ''; // Cancel for create does not post form if we don't know the backtopage + print '
    '; + + print '
    '; + + //dol_set_focus('input[name="ref"]'); +} + +// Part to edit record +if (($id || $ref) && $action == 'edit') { + print load_fiche_titre($langs->trans("Job"), '', 'object_' . $object->picto); + + print '
    '; + print ''; + print ''; + print ''; + if ($backtopage) { + print ''; + } + if ($backtopageforcancel) { + print ''; + } + + print dol_get_fiche_head(); + + print '' . "\n"; + + // Common attributes + include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php'; + + // Other attributes + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php'; + + print '
    '; + + print dol_get_fiche_end(); + + print '
    '; + print '   '; + print '
    '; + + print '
    '; +} + +// Part to show record +if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) { + $res = $object->fetch_optionals(); + + $head = jobPrepareHead($object); + $picto = 'company.png'; + print dol_get_fiche_head($head, 'job_card', $langs->trans("Workstation"), -1, $object->picto); + + $formconfirm = ''; + + // Confirmation to delete + if ($action == 'delete') { + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteJob'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1); + } + // Confirmation to delete line + if ($action == 'deleteline') { + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1); + } + // Clone confirmation + if ($action == 'clone') { + // Create an array for form + $formquestion = array(); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + } + + // Confirmation of action xxxx + if ($action == 'xxx') { + $formquestion = array(); + /* + $forcecombo=0; + if ($conf->browser->name == 'ie') $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy + $formquestion = array( + // 'text' => $langs->trans("ConfirmClone"), + // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), + // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), + // array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo)) + ); + */ + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220); + } + + // Call Hook formConfirm + $parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid); + $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + if (empty($reshook)) { + $formconfirm .= $hookmanager->resPrint; + } elseif ($reshook > 0) { + $formconfirm = $hookmanager->resPrint; + } + + // Print form confirm + print $formconfirm; + + + // Object card + // ------------------------------------------------------------ + $linkback = '' . $langs->trans("BackToList") . ''; + + $morehtmlref = '
    '; + $morehtmlref.= $object->label; + $morehtmlref .= '
    '; + + + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref); + + + print '
    '; + print '
    '; + print '
    '; + print '' . "\n"; + + // Common attributes + //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field + //unset($object->fields['fk_project']); // Hide field already shown in banner + //unset($object->fields['fk_soc']); // Hide field already shown in banner + $object->fields['label']['visible']=0; // Already in banner + include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php'; + + // Other attributes. Fields from hook formObjectOptions and Extrafields. + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; + + print '
    '; + print '
    '; + print '
    '; + + print '
    '; + + print dol_get_fiche_end(); + + + /* + * Lines + */ + + if (!empty($object->table_element_line)) { + // Show object lines + $result = $object->getLinesArray(); + + print '
    + + + + + + '; + + if (!empty($conf->use_javascript_ajax) && $object->status == 0) { + include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; + } + + print '
    '; + if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { + print ''; + } + + if (!empty($object->lines)) { + $object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1); + } + + // Form to add new line + if ($object->status == 0 && $permissiontoadd && $action != 'selectlines') { + if ($action != 'editline') { + // Add products/services form + + $parameters = array(); + $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + if (empty($reshook)) + $object->formAddObjectLine(1, $mysoc, $soc); + } + } + + if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { + print '
    '; + } + print '
    '; + + print "
    \n"; + } + + + // Buttons for actions + + if ($action != 'presend' && $action != 'editline') { + print '
    ' . "\n"; + $parameters = array(); + $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + } + + if (empty($reshook)) { + // Back to draft + if ($object->status == $object::STATUS_VALIDATED) { + print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=confirm_setdraft&confirm=yes&token=' . newToken(), '', $permissiontoadd); + } + + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd); + + // Delete (need delete permission, or if draft, just need create/modify permission) + print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete); + } + print '
    ' . "\n"; + } + + + // Select mail models is same action as presend + if (GETPOST('modelselected')) { + $action = 'presend'; + } + + if ($action != 'presend') { + print '
    '; + print ''; // ancre + + $includedocgeneration = 0; + + // Documents + if ($includedocgeneration) { + $objref = dol_sanitizeFileName($object->ref); + $relativepath = $objref . '/' . $objref . '.pdf'; + $filedir = $conf->hrm->dir_output . '/' . $object->element . '/' . $objref; + $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id; + $genallowed = $user->rights->hrm->job->read; // If you can read, you can build the PDF to read content + $delallowed = $user->rights->hrm->job->write; // If you can create/edit, you can remove a file on card + print $formfile->showdocuments('hrm:Job', $object->element . '/' . $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang); + } + + // Show links to link elements + $linktoelem = $form->showLinkToObjectBlock($object, null, array('job')); + $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); + + + print '
    '; + + $MAXEVENT = 10; + + $morehtmlright = ''; + $morehtmlright .= $langs->trans("SeeAll"); + $morehtmlright .= ''; + + // List of actions on element + include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; + $formactions = new FormActions($db); + $somethingshown = $formactions->showactions($object, $object->element . '@' . $object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlright); + + print '
    '; + } + + // Presend form + $modelmail = 'job'; + $defaulttopic = 'InformationMessage'; + $diroutput = $conf->hrm->dir_output; + $trackid = 'job' . $object->id; + + include DOL_DOCUMENT_ROOT . '/core/tpl/card_presend.tpl.php'; +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/hrm/job_contact.php b/htdocs/hrm/job_contact.php new file mode 100644 index 00000000000..471f5c63886 --- /dev/null +++ b/htdocs/hrm/job_contact.php @@ -0,0 +1,220 @@ + + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND + * + * 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 . + */ + +/** + * \file job_contact.php + * \ingroup hrm + * \brief Tab for contacts linked to Job + */ + +// 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"); +} + +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +dol_include_once('/hrm/class/job.class.php'); +dol_include_once('/hrm/lib/hrm_job.lib.php'); + +// Load translation files required by the page +$langs->loadLangs(array("hrm", "companies", "other", "mails")); + +$id = (GETPOST('id') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility +$ref = GETPOST('ref', 'alpha'); +$lineid = GETPOST('lineid', 'int'); +$socid = GETPOST('socid', 'int'); +$action = GETPOST('action', 'aZ09'); + +// Initialize technical objects +$object = new Job($db); +$extrafields = new ExtraFields($db); +$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('jobcontact', 'globalcard')); // Note that conf->hooks_modules contains array +// Fetch optionals attributes and labels +$extrafields->fetch_name_optionals_label($object->table_element); + +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals + +$permission = $user->rights->hrm->job->write; + +// Security check (enable the most restrictive one) +//if ($user->socid > 0) accessforbidden(); +//if ($user->socid > 0) $socid = $user->socid; +//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); +//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); +//if (empty($conf->hrm->enabled)) accessforbidden(); +//if (!$permissiontoread) accessforbidden(); + + +/* + * Add a new contact + */ + +if ($action == 'addcontact' && $permission) { + $contactid = (GETPOST('userid') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int')); + $typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type')); + $result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09')); + + if ($result >= 0) { + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit; + } else { + if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { + $langs->load("errors"); + setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors'); + } else { + setEventMessages($object->error, $object->errors, 'errors'); + } + } +} elseif ($action == 'swapstatut' && $permission) { + // Toggle the status of a contact + $result = $object->swapContactStatus(GETPOST('ligne', 'int')); +} elseif ($action == 'deletecontact' && $permission) { + // Deletes a contact + $result = $object->delete_contact($lineid); + + if ($result >= 0) { + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit; + } else { + dol_print_error($db); + } +} + + +/* + * View + */ + +$title = $langs->trans('Job')." - ".$langs->trans('ContactsAddresses'); +$help_url = ''; +//$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; +llxHeader('', $title, $help_url); + +$form = new Form($db); +$formcompany = new FormCompany($db); +$contactstatic = new Contact($db); +$userstatic = new User($db); + + +/* *************************************************************************** */ +/* */ +/* View and edit mode */ +/* */ +/* *************************************************************************** */ + +if ($object->id) { + /* + * Show tabs + */ + $head = jobPrepareHead($object); + + print dol_get_fiche_head($head, 'contact', '', -1, $object->picto); + + $linkback = ''.$langs->trans("BackToList").''; + + $morehtmlref = '
    '; + /* + // Ref customer + $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); + $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); + // Thirdparty + $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); + // Project + if (! empty($conf->projet->enabled)) + { + $langs->load("projects"); + $morehtmlref.='
    '.$langs->trans('Project') . ' '; + if ($permissiontoadd) + { + if ($action != 'classify') + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + $morehtmlref.=' : '; + if ($action == 'classify') { + //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); + $morehtmlref.='
    '; + $morehtmlref.=''; + $morehtmlref.=''; + $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.=''; + $morehtmlref.='
    '; + } else { + $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + } + } else { + if (! empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref .= ': '.$proj->getNomUrl(); + } else { + $morehtmlref .= ''; + } + } + }*/ + $morehtmlref .= '
    '; + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); + + print dol_get_fiche_end(); + + print '
    '; + + // Contacts lines (modules that overwrite templates must declare this into descriptor) + $dirtpls = array_merge($conf->modules_parts['tpl'], array('/core/tpl')); + foreach ($dirtpls as $reldir) { + $res = @include dol_buildpath($reldir.'/contacts.tpl.php'); + if ($res) { + break; + } + } +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/hrm/job_document.php b/htdocs/hrm/job_document.php new file mode 100644 index 00000000000..c8cd764b9de --- /dev/null +++ b/htdocs/hrm/job_document.php @@ -0,0 +1,219 @@ + + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND + * + * 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 . + */ + +/** + * \file job_document.php + * \ingroup hrm + * \brief Tab for documents linked to Job + */ + +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs +//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters +//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters +//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). +//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) +//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data +//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php +//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library +//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. +//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value +//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler +//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message +//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies +//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET +//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification + +// 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"); +} + +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +dol_include_once('/hrm/class/job.class.php'); +dol_include_once('/hrm/lib/hrm_job.lib.php'); + +// Load translation files required by the page +$langs->loadLangs(array("hrm", "companies", "other", "mails")); + + +$action = GETPOST('action', 'aZ09'); +$confirm = GETPOST('confirm'); +$id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int')); +$ref = GETPOST('ref', 'alpha'); + +// Get parameters +$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$sortfield = GETPOST("sortfield", 'alpha'); +$sortorder = GETPOST("sortorder", 'alpha'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +if (empty($page) || $page == -1) { + $page = 0; +} // If $page is not defined, or '' or -1 +$offset = $liste_limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (!$sortorder) { + $sortorder = "ASC"; +} +if (!$sortfield) { + $sortfield = "name"; +} +//if (! $sortfield) $sortfield="position_name"; + +// Initialize technical objects +$object = new Job($db); +$extrafields = new ExtraFields($db); +$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('jobdocument', 'globalcard')); // Note that conf->hooks_modules contains array +// Fetch optionals attributes and labels +$extrafields->fetch_name_optionals_label($object->table_element); + +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals + +if ($id > 0 || !empty($ref)) { + $upload_dir = $conf->hrm->multidir_output[$object->entity ? $object->entity : $conf->entity]."/job/".get_exdir(0, 0, 0, 1, $object); +} + +$permissiontoread = $user->rights->hrm->all->read; +$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php + +// Security check (enable the most restrictive one) +//if ($user->socid > 0) accessforbidden(); +//if ($user->socid > 0) $socid = $user->socid; +//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); +//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); +if (empty($conf->hrm->enabled)) accessforbidden(); +if (!$permissiontoread) accessforbidden(); + + +/* + * Actions + */ + +include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; + + +/* + * View + */ + +$form = new Form($db); + +$title = $langs->trans("Job").' - '.$langs->trans("Files"); +$help_url = ''; +//$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; +llxHeader('', $title, $help_url); + +if ($object->id) { + /* + * Show tabs + */ + $head = jobPrepareHead($object); + + print dol_get_fiche_head($head, 'document', $langs->trans("Document"), -1, $object->picto); + + + // Build file list + $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1); + $totalsize = 0; + foreach ($filearray as $key => $file) { + $totalsize += $file['size']; + } + + // Object card + // ------------------------------------------------------------ + $linkback = ''.$langs->trans("BackToList").''; + + $morehtmlref = '
    '; + $morehtmlref.= $object->label; + $morehtmlref .= '
    '; + + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref); + + print '
    '; + + print '
    '; + print ''; + + // Number of files + print ''; + + // Total size + print ''; + + print '
    '.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
    '.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
    '; + + print '
    '; + + print dol_get_fiche_end(); + + $modulepart = 'hrm'; + //$permissiontoadd = $user->rights->hrm->job->write; + //$permtoedit = $user->rights->hrm->job->write; + $permtoedit = $permissiontoadd; + $param = '&id='.$object->id; + + //$relativepathwithnofile='job/' . dol_sanitizeFileName($object->id).'/'; + $relativepathwithnofile = 'job/'.dol_sanitizeFileName($object->ref).'/'; + + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; +} else { + accessforbidden('', 0, 1); +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/hrm/job_list.php b/htdocs/hrm/job_list.php new file mode 100644 index 00000000000..1a2ca54f1a7 --- /dev/null +++ b/htdocs/hrm/job_list.php @@ -0,0 +1,733 @@ + + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND + * + * 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 . + */ + +/** + * \file job_list.php + * \ingroup hrm + * \brief List page for job + */ + +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs +//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters +//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters +//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). +//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) +//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data +//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php +//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library +//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. +//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value +//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler +//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message +//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies +//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET +//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification + +// 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"); +} + +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; + +// load hrm libraries +require_once __DIR__.'/class/job.class.php'; + +// for other modules +//dol_include_once('/othermodule/class/otherobject.class.php'); + +// Load translation files required by the page +$langs->loadLangs(array("hrm", "other")); + +$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... +$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) +$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation +$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button +$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'joblist'; // To manage different context of search +$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') + +$id = GETPOST('id', 'int'); + +// Load variable for pagination +$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$sortfield = GETPOST('sortfield', 'aZ09comma'); +$sortorder = GETPOST('sortorder', 'aZ09comma'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { + // If $page is not defined, or '' or -1 or if we click on clear filters + $page = 0; +} +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; + +// Initialize technical objects +$object = new Job($db); +$extrafields = new ExtraFields($db); +$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('joblist')); // Note that conf->hooks_modules contains array + +// Fetch optionals attributes and labels +$extrafields->fetch_name_optionals_label($object->table_element); +//$extrafields->fetch_name_optionals_label($object->table_element_line); + +$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); + +// Default sort order (if not yet defined by previous GETPOST) +if (!$sortfield) { + reset($object->fields); // Reset is required to avoid key() to return null. + $sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition. +} +if (!$sortorder) { + $sortorder = "ASC"; +} + +// Initialize array of search criterias +$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); +$search = array(); +foreach ($object->fields as $key => $val) { + if (GETPOST('search_'.$key, 'alpha') !== '') { + $search[$key] = GETPOST('search_'.$key, 'alpha'); + } + if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); + } +} + +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array(); +foreach ($object->fields as $key => $val) { + if (!empty($val['searchall'])) { + $fieldstosearchall['t.'.$key] = $val['label']; + } +} + +// Definition of array of fields for columns +$arrayfields = array(); +foreach ($object->fields as $key => $val) { + // If $val['visible']==0, then we never show the field + if (!empty($val['visible'])) { + $visible = (int) dol_eval($val['visible'], 1); + $arrayfields['t.'.$key] = array( + 'label'=>$val['label'], + 'checked'=>(($visible < 0) ? 0 : 1), + 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)), + 'position'=>$val['position'], + 'help'=> isset($val['help']) ? $val['help'] : '' + ); + } +} +// Extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; + +$object->fields = dol_sort_array($object->fields, 'position'); +$arrayfields = dol_sort_array($arrayfields, 'position'); + +$permissiontoread = $user->rights->hrm->all->read; +$permissiontoadd = $user->rights->hrm->all->write; +$permissiontodelete = $user->rights->hrm->all->delete; + +// Security check +if (empty($conf->hrm->enabled)) { + accessforbidden('Module not enabled'); +} + +// Security check (enable the most restrictive one) +if ($user->socid > 0) accessforbidden(); +//if ($user->socid > 0) accessforbidden(); +//$socid = 0; if ($user->socid > 0) $socid = $user->socid; +//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); +//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); +if (empty($conf->hrm->enabled)) accessforbidden(); +if (!$permissiontoread) accessforbidden(); + + + +/* + * Actions + */ + +if (GETPOST('cancel', 'alpha')) { + $action = 'list'; + $massaction = ''; +} +if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { + $massaction = ''; +} + +$parameters = array(); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + +if (empty($reshook)) { + // Selection of new fields + include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; + + // Purge search criteria + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers + foreach ($object->fields as $key => $val) { + $search[$key] = ''; + if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + $search[$key.'_dtstart'] = ''; + $search[$key.'_dtend'] = ''; + } + } + $toselect = array(); + $search_array_options = array(); + } + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha') + || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) { + $massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation + } + + // Mass actions + $objectclass = 'Job'; + $objectlabel = 'Job'; + $uploaddir = $conf->hrm->dir_output; + include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; +} + + + +/* + * View + */ + +$form = new Form($db); + +$now = dol_now(); + +//$help_url="EN:Module_Job|FR:Module_Job_FR|ES:Módulo_Job"; +$help_url = ''; +$title = $langs->trans("ListOf", $langs->transnoentities('Jobs')); +$morejs = array(); +$morecss = array(); + + +// Build and execute select +// -------------------------------------------------------------------- +$sql = 'SELECT '; +$sql .= $object->getFieldList('t'); +// Add fields from extrafields +if (!empty($extrafields->attributes[$object->table_element]['label'])) { + foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key.', ' : ''); + } +} +// Add fields from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= preg_replace('/^,/', '', $hookmanager->resPrint); +$sql = preg_replace('/,\s*$/', '', $sql); +$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; +if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; +} +// Add table from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; +if ($object->ismultientitymanaged == 1) { + $sql .= " WHERE t.entity IN (".getEntity($object->element).")"; +} else { + $sql .= " WHERE 1 = 1"; +} +foreach ($search as $key => $val) { + if (array_key_exists($key, $object->fields)) { + if ($key == 'status' && $search[$key] == -1) { + continue; + } + $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); + if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) { + if ($search[$key] == '-1' || $search[$key] === '0') { + $search[$key] = ''; + } + $mode_search = 2; + } + if ($search[$key] != '') { + $sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search)); + } + } else { + if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') { + $columnName=preg_replace('/(_dtstart|_dtend)$/', '', $key); + if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) { + if (preg_match('/_dtstart$/', $key)) { + $sql .= " AND t." . $columnName . " >= '" . $db->idate($search[$key]) . "'"; + } + if (preg_match('/_dtend$/', $key)) { + $sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'"; + } + } + } + } +} +if ($search_all) { + $sql .= natural_search(array_keys($fieldstosearchall), $search_all); +} +//$sql.= dolSqlDateFilter("t.field", $search_xxxday, $search_xxxmonth, $search_xxxyear); +// Add where from extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; +// Add where from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; + +/* If a group by is required +$sql .= " GROUP BY "; +foreach($object->fields as $key => $val) { + $sql .= 't.'.$key.', '; +} +// Add fields from extrafields +if (!empty($extrafields->attributes[$object->table_element]['label'])) { + foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : ''); + } +} +// Add where from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; +$sql = preg_replace('/,\s*$/', '', $sql); +*/ + +$sql .= $db->order($sortfield, $sortorder); + +// Count total nb of records +$nbtotalofrecords = ''; +if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + $resql = $db->query($sql); + $nbtotalofrecords = $db->num_rows($resql); + if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0 + $page = 0; + $offset = 0; + } +} +// if total of record found is smaller than limit, no need to do paging and to restart another select with limits set. +if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit))) { + $num = $nbtotalofrecords; +} else { + if ($limit) { + $sql .= $db->plimit($limit + 1, $offset); + } + + $resql = $db->query($sql); + if (!$resql) { + dol_print_error($db); + exit; + } + + $num = $db->num_rows($resql); +} + +// Direct jump if only one record found +if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) { + $obj = $db->fetch_object($resql); + $id = $obj->rowid; + header("Location: ".dol_buildpath('/hrm/job_card.php', 1).'?id='.$id); + exit; +} + + +// Output page +// -------------------------------------------------------------------- + +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', ''); + +// Example : Adding jquery code +// print ''; + +$arrayofselected = is_array($toselect) ? $toselect : array(); + +$param = ''; +if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { + $param .= '&contextpage='.urlencode($contextpage); +} +if ($limit > 0 && $limit != $conf->liste_limit) { + $param .= '&limit='.urlencode($limit); +} +foreach ($search as $key => $val) { + if (is_array($search[$key]) && count($search[$key])) { + foreach ($search[$key] as $skey) { + $param .= '&search_'.$key.'[]='.urlencode($skey); + } + } else { + $param .= '&search_'.$key.'='.urlencode($search[$key]); + } +} +if ($optioncss != '') { + $param .= '&optioncss='.urlencode($optioncss); +} +// Add $param from extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; +// Add $param from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook +$param .= $hookmanager->resPrint; + +// List of mass actions available +$arrayofmassactions = array( + //'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"), + //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), + //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), + //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), +); +if ($permissiontodelete) { + $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); +} +if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { + $arrayofmassactions = array(); +} +$massactionbutton = $form->selectMassAction('', $arrayofmassactions); + +print '
    '."\n"; +if ($optioncss != '') { + print ''; +} +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; + +$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/hrm/job_card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); + +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); + +// Add code for pre mass action (confirmation or email presend form) +$topicmail = "SendJobRef"; +$modelmail = "job"; +$objecttmp = new Job($db); +$trackid = 'xxxx'.$object->id; +include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; + +if ($search_all) { + foreach ($fieldstosearchall as $key => $val) { + $fieldstosearchall[$key] = $langs->trans($val); + } + print '
    '.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'
    '; +} + +$moreforfilter = ''; +/*$moreforfilter.='
    '; +$moreforfilter.= $langs->trans('MyFilter') . ': '; +$moreforfilter.= '
    ';*/ + +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook +if (empty($reshook)) { + $moreforfilter .= $hookmanager->resPrint; +} else { + $moreforfilter = $hookmanager->resPrint; +} + +if (!empty($moreforfilter)) { + print '
    '; + print $moreforfilter; + print '
    '; +} + +$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields +$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); + +print '
    '; // You can use div-table-responsive-no-min if you dont need reserved height for your table +print ''."\n"; + + +// Fields title search +// -------------------------------------------------------------------- +print ''; +foreach ($object->fields as $key => $val) { + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); + if ($key == 'status') { + $cssforfield .= ($cssforfield ? ' ' : '').'center'; + } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '').'center'; + } elseif (in_array($val['type'], array('timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; + } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { + $cssforfield .= ($cssforfield ? ' ' : '').'right'; + } + if (!empty($arrayfields['t.'.$key]['checked'])) { + print ''; + } +} +// Extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; + +// Fields from hook +$parameters = array('arrayfields'=>$arrayfields); +$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; +// Action column +print ''; +print ''."\n"; + + +// Fields title label +// -------------------------------------------------------------------- +print ''; +foreach ($object->fields as $key => $val) { + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); + if ($key == 'status') { + $cssforfield .= ($cssforfield ? ' ' : '').'center'; + } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '').'center'; + } elseif (in_array($val['type'], array('timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; + } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { + $cssforfield .= ($cssforfield ? ' ' : '').'right'; + } + if (!empty($arrayfields['t.'.$key]['checked'])) { + print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n"; + } +} +// Extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; +// Hook fields +$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); +$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; +// Action column +print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; +print ''."\n"; + + +// Detect if we need a fetch on each output line +$needToFetchEachLine = 0; +if (isset($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { + foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) { + if (preg_match('/\$object/', $val)) { + $needToFetchEachLine++; // There is at least one compute field that use $object + } + } +} + + +// Loop on record +// -------------------------------------------------------------------- +$i = 0; +$totalarray = array(); +$totalarray['nbfield'] = 0; +while ($i < ($limit ? min($num, $limit) : $num)) { + $obj = $db->fetch_object($resql); + if (empty($obj)) { + break; // Should not happen + } + + // Store properties in $object + $object->setVarsFromFetchObj($obj); + + // Show here line of result + print ''; + foreach ($object->fields as $key => $val) { + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); + if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '').'center'; + } elseif ($key == 'status') { + $cssforfield .= ($cssforfield ? ' ' : '').'center'; + } + + if (in_array($val['type'], array('timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; + } elseif ($key == 'ref') { + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; + } + + if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) { + $cssforfield .= ($cssforfield ? ' ' : '').'right'; + } + //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; + + if (!empty($arrayfields['t.'.$key]['checked'])) { + print ''; + if ($key == 'status') { + print $object->getLibStatut(5); + } elseif ($key == 'rowid') { + print $object->showOutputField($val, $key, $object->id, ''); + } elseif ($key == 'label') { + print $object->getNomUrl(1); + } else { + print $object->showOutputField($val, $key, $object->$key, ''); + } + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + if (!empty($val['isameasure'])) { + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; + } + if (!isset($totalarray['val'])) { + $totalarray['val'] = array(); + } + if (!isset($totalarray['val']['t.'.$key])) { + $totalarray['val']['t.'.$key] = 0; + } + $totalarray['val']['t.'.$key] += $object->$key; + } + } + } + // Extra fields + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; + // Fields from hook + $parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + // Action column + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + + print ''."\n"; + + $i++; +} + +// Show total line +include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; + +// If no record found +if ($num == 0) { + $colspan = 1; + foreach ($arrayfields as $key => $val) { + if (!empty($val['checked'])) { + $colspan++; + } + } + print ''; +} + + +$db->free($resql); + +$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); +$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; + +print '
    '; + if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { + print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); + } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) { + print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', 'maxwidth125', 1); + } elseif (!preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + print ''; + } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + print '
    '; + print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); + print '
    '; + print '
    '; + print $form->selectDate($search[$key.'_dtend'] ? $search[$key.'_dtend'] : '', "search_".$key."_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); + print '
    '; + } + print '
    '; +$searchpicto = $form->showFilterButtons(); +print $searchpicto; +print '
    '; + if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + $selected = 0; + if (in_array($object->id, $arrayofselected)) { + $selected = 1; + } + print ''; + } + print '
    '.$langs->trans("NoRecordFound").'
    '."\n"; +print '
    '."\n"; + +print '
    '."\n"; + +if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { + $hidegeneratedfilelistifempty = 1; + if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { + $hidegeneratedfilelistifempty = 0; + } + + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; + $formfile = new FormFile($db); + + // Show list of available documents + $urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; + $urlsource .= str_replace('&', '&', $param); + + $filedir = $diroutputmassaction; + $genallowed = $permissiontoread; + $delallowed = $permissiontoadd; + + print $formfile->showdocuments('massfilesarea_hrm', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/hrm/job_note.php b/htdocs/hrm/job_note.php new file mode 100644 index 00000000000..3f63e50b9a6 --- /dev/null +++ b/htdocs/hrm/job_note.php @@ -0,0 +1,175 @@ + + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND + * + * 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 . + */ + +/** + * \file job_note.php + * \ingroup hrm + * \brief Tab for notes on Job + */ + +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs +//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters +//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters +//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). +//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) +//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data +//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php +//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library +//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. +//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value +//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler +//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message +//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies +//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET +//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification + +// 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"); +} + +dol_include_once('/hrm/class/job.class.php'); +dol_include_once('/hrm/lib/hrm_job.lib.php'); + +// Load translation files required by the page +$langs->loadLangs(array("hrm", "companies")); + +// Get parameters +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); +$action = GETPOST('action', 'aZ09'); +$cancel = GETPOST('cancel', 'aZ09'); +$backtopage = GETPOST('backtopage', 'alpha'); + +// Initialize technical objects +$object = new Job($db); +$extrafields = new ExtraFields($db); +$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('jobnote', 'globalcard')); // Note that conf->hooks_modules contains array +// Fetch optionals attributes and labels +$extrafields->fetch_name_optionals_label($object->table_element); + +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +if ($id > 0 || !empty($ref)) { + $upload_dir = $conf->hrm->multidir_output[$object->entity]."/".$object->id; +} + +$permissiontoread = $user->rights->hrm->all->read; +$permissionnote = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php + +// Security check (enable the most restrictive one) +//if ($user->socid > 0) accessforbidden(); +//if ($user->socid > 0) $socid = $user->socid; +//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); +//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); +if (empty($conf->hrm->enabled)) accessforbidden(); +if (!$permissiontoread) accessforbidden(); + + +/* + * Actions + */ + +$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} +if (empty($reshook)) { + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once +} + + +/* + * View + */ + +$form = new Form($db); + +//$help_url='EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes'; +$help_url = ''; +llxHeader('', $langs->trans('Job'), $help_url); + +if ($id > 0 || !empty($ref)) { + $object->fetch_thirdparty(); + + $head = jobPrepareHead($object); + + print dol_get_fiche_head($head, 'note', $langs->trans("Notes"), -1, $object->picto); + + // Object card + // ------------------------------------------------------------ + $linkback = ''.$langs->trans("BackToList").''; + + $morehtmlref = '
    '; + $morehtmlref.= $object->label; + $morehtmlref .= '
    '; + + + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref); + + + print '
    '; + 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/hrm/lib/hrm.lib.php b/htdocs/hrm/lib/hrm.lib.php new file mode 100644 index 00000000000..c886b32e7a4 --- /dev/null +++ b/htdocs/hrm/lib/hrm.lib.php @@ -0,0 +1,69 @@ + + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND + * + * 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 . + */ + +/** + * \file hrm/lib/hrm.lib.php + * \ingroup hr + * \brief Library files with common functions for Workstation + */ + +/** + * Prepare admin pages header + * + * @return array + */ +function hrmAdminPrepareHead() +{ + global $langs, $conf; + + $langs->load("hrm"); + + $h = 0; + $head = array(); + $head[$h][0] = DOL_URL_ROOT . "/admin/hrm.php"; + $head[$h][1] = $langs->trans("Settings"); + $head[$h][2] = 'settings'; + $h++; + + /* + $head[$h][0] = dol_buildpath("/workstation/admin/myobject_extrafields.php", 1); + $head[$h][1] = $langs->trans("ExtraFields"); + $head[$h][2] = 'myobject_extrafields'; + $h++; + */ + + /*$head[$h][0] = require_once "/admin/about.php"; + $head[$h][1] = $langs->trans("About"); + $head[$h][2] = 'about'; + $h++;*/ + + // Show more tabs from modules + // Entries must be declared in modules descriptor with line + //$this->tabs = array( + // 'entity:+tabname:Title:@workstation:/workstation/mypage.php?id=__ID__' + //); // to add new tab + //$this->tabs = array( + // 'entity:-tabname:Title:@workstation:/workstation/mypage.php?id=__ID__' + //); // to remove a tab + complete_head_from_modules($conf, $langs, null, $head, $h, 'hrm'); + + return $head; +} diff --git a/htdocs/hrm/lib/hrm_evaluation.lib.php b/htdocs/hrm/lib/hrm_evaluation.lib.php new file mode 100644 index 00000000000..87e6b80adaa --- /dev/null +++ b/htdocs/hrm/lib/hrm_evaluation.lib.php @@ -0,0 +1,95 @@ + + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND + * + * 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 . + */ + +/** + * \file lib/hrm_evaluation.lib.php + * \ingroup hrm + * \brief Library files with common functions for Evaluation + */ + +/** + * Prepare array of tabs for Evaluation + * + * @param Evaluation $object Evaluation + * @return array Array of tabs + */ +function evaluationPrepareHead($object) +{ + global $db, $langs, $conf; + + $langs->load("hrm"); + + $h = 0; + $head = array(); + + $head[$h][0] = dol_buildpath("/hrm/evaluation_card.php", 1).'?id='.$object->id; + $head[$h][1] = $langs->trans("EvaluationCard"); + $head[$h][2] = 'card'; + $h++; + + if (isset($object->fields['note_public']) || isset($object->fields['note_private'])) { + $nbNote = 0; + if (!empty($object->note_private)) { + $nbNote++; + } + if (!empty($object->note_public)) { + $nbNote++; + } + $head[$h][0] = dol_buildpath('/hrm/evaluation_note.php', 1).'?id='.$object->id; + $head[$h][1] = $langs->trans('Notes'); + if ($nbNote > 0) { + $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ''.$nbNote.'' : ''); + } + $head[$h][2] = 'note'; + $h++; + } + + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; + $upload_dir = $conf->hrm->dir_output."/evaluation/".dol_sanitizeFileName($object->ref); + $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); + $nbLinks = Link::count($db, $object->element, $object->id); + $head[$h][0] = dol_buildpath("/hrm/evaluation_document.php", 1).'?id='.$object->id; + $head[$h][1] = $langs->trans('Documents'); + if (($nbFiles + $nbLinks) > 0) { + $head[$h][1] .= ''.($nbFiles + $nbLinks).''; + } + $head[$h][2] = 'document'; + $h++; + + $head[$h][0] = dol_buildpath("/hrm/evaluation_agenda.php", 1).'?id='.$object->id; + $head[$h][1] = $langs->trans("Events"); + $head[$h][2] = 'agenda'; + $h++; + + // Show more tabs from modules + // Entries must be declared in modules descriptor with line + //$this->tabs = array( + // 'entity:+tabname:Title:@hrm:/hrm/mypage.php?id=__ID__' + //); // to add new tab + //$this->tabs = array( + // 'entity:-tabname:Title:@hrm:/hrm/mypage.php?id=__ID__' + //); // to remove a tab + complete_head_from_modules($conf, $langs, $object, $head, $h, 'evaluation@hrm'); + + complete_head_from_modules($conf, $langs, $object, $head, $h, 'evaluation@hrm', 'remove'); + + return $head; +} diff --git a/htdocs/hrm/lib/hrm_job.lib.php b/htdocs/hrm/lib/hrm_job.lib.php new file mode 100644 index 00000000000..f465d934b0f --- /dev/null +++ b/htdocs/hrm/lib/hrm_job.lib.php @@ -0,0 +1,106 @@ + + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND + * + * 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 . + */ + +/** + * \file lib/hrm_job.lib.php + * \ingroup hrm + * \brief Library files with common functions for Job + */ + +/** + * Prepare array of tabs for Job + * + * @param Job $object Job + * @return array Array of tabs + */ +function jobPrepareHead($object) +{ + global $db, $langs, $conf; + + $langs->load("hrm"); + + $h = 0; + $head = array(); + + $head[$h][0] = dol_buildpath("/hrm/job_card.php", 1).'?id='.$object->id; + $head[$h][1] = $langs->trans("JobCard"); + $head[$h][2] = 'job_card'; + $h++; + + $head[$h][0] = dol_buildpath("/hrm/skill_tab.php", 1).'?id='.$object->id.'&objecttype=job'; + $head[$h][1] = $langs->trans("RequiredSkills"); + $head[$h][2] = 'skill_tab'; + $h++; + + $head[$h][0] = dol_buildpath("/hrm/position.php", 1).'?fk_job='.$object->id; + $head[$h][1] = $langs->trans("EmployeesInThisPosition"); + $head[$h][2] = 'position'; + $h++; + + + if (isset($object->fields['note_public']) || isset($object->fields['note_private'])) { + $nbNote = 0; + if (!empty($object->note_private)) { + $nbNote++; + } + if (!empty($object->note_public)) { + $nbNote++; + } + $head[$h][0] = dol_buildpath('/hrm/job_note.php', 1).'?id='.$object->id; + $head[$h][1] = $langs->trans('Notes'); + if ($nbNote > 0) { + $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ''.$nbNote.'' : ''); + } + $head[$h][2] = 'note'; + $h++; + } + + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; + $upload_dir = $conf->hrm->dir_output."/job/".dol_sanitizeFileName($object->label); + $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); + $nbLinks = Link::count($db, $object->element, $object->id); + $head[$h][0] = dol_buildpath("/hrm/job_document.php", 1).'?id='.$object->id; + $head[$h][1] = $langs->trans('Documents'); + if (($nbFiles + $nbLinks) > 0) { + $head[$h][1] .= ''.($nbFiles + $nbLinks).''; + } + $head[$h][2] = 'document'; + $h++; + + $head[$h][0] = dol_buildpath("/hrm/job_agenda.php", 1).'?id='.$object->id; + $head[$h][1] = $langs->trans("Events"); + $head[$h][2] = 'agenda'; + $h++; + + // Show more tabs from modules + // Entries must be declared in modules descriptor with line + //$this->tabs = array( + // 'entity:+tabname:Title:@hrm:/hrm/mypage.php?id=__ID__' + //); // to add new tab + //$this->tabs = array( + // 'entity:-tabname:Title:@hrm:/hrm/mypage.php?id=__ID__' + //); // to remove a tab + complete_head_from_modules($conf, $langs, $object, $head, $h, 'job@hrm'); + + complete_head_from_modules($conf, $langs, $object, $head, $h, 'job@hrm', 'remove'); + + return $head; +} diff --git a/htdocs/hrm/lib/hrm_position.lib.php b/htdocs/hrm/lib/hrm_position.lib.php new file mode 100644 index 00000000000..da9a7b3123a --- /dev/null +++ b/htdocs/hrm/lib/hrm_position.lib.php @@ -0,0 +1,96 @@ + + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND + * + * 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 . + */ + +/** + * \file lib/hrm_position.lib.php + * \ingroup hrm + * \brief Library files with common functions for Position + */ + + +/** + * Prepare array of tabs for positions + * + * @param Position $object Position + * @return array Array of tabs + */ +function PositionCardPrepareHead($object) +{ + global $db, $langs, $conf; + + $langs->load("hrm"); + + $h = 0; + $head = array(); + + $head[$h][0] = dol_buildpath("/hrm/position_card.php", 1).'?id='.$object->id; + $head[$h][1] = $langs->trans("PositionCard"); + $head[$h][2] = 'position'; + $h++; + + if (isset($object->fields['note_public']) || isset($object->fields['note_private'])) { + $nbNote = 0; + if (!empty($object->note_private)) { + $nbNote++; + } + if (!empty($object->note_public)) { + $nbNote++; + } + $head[$h][0] = dol_buildpath('/hrm/position_note.php', 1).'?id='.$object->id; + $head[$h][1] = $langs->trans('Notes'); + if ($nbNote > 0) { + $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ''.$nbNote.'' : ''); + } + $head[$h][2] = 'note'; + $h++; + } + + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; + $upload_dir = $conf->hrm->dir_output."/position/".dol_sanitizeFileName($object->ref); + $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); + $nbLinks = Link::count($db, $object->element, $object->id); + $head[$h][0] = dol_buildpath("/hrm/position_document.php", 1).'?id='.$object->id; + $head[$h][1] = $langs->trans('Documents'); + if (($nbFiles + $nbLinks) > 0) { + $head[$h][1] .= ''.($nbFiles + $nbLinks).''; + } + $head[$h][2] = 'document'; + $h++; + + $head[$h][0] = dol_buildpath("/hrm/position_agenda.php", 1).'?id='.$object->id; + $head[$h][1] = $langs->trans("Events"); + $head[$h][2] = 'agenda'; + $h++; + + // Show more tabs from modules + // Entries must be declared in modules descriptor with line + //$this->tabs = array( + // 'entity:+tabname:Title:@hrm:/hrm/mypage.php?id=__ID__' + //); // to add new tab + //$this->tabs = array( + // 'entity:-tabname:Title:@hrm:/hrm/mypage.php?id=__ID__' + //); // to remove a tab + complete_head_from_modules($conf, $langs, $object, $head, $h, 'position@hrm'); + + complete_head_from_modules($conf, $langs, $object, $head, $h, 'position@hrm', 'remove'); + + return $head; +} diff --git a/htdocs/hrm/lib/hrm_skill.lib.php b/htdocs/hrm/lib/hrm_skill.lib.php new file mode 100644 index 00000000000..7ddaa166a04 --- /dev/null +++ b/htdocs/hrm/lib/hrm_skill.lib.php @@ -0,0 +1,528 @@ + + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND + * + * 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 . + */ + +/** + * \file lib/hrm_skill.lib.php + * \ingroup hrm + * \brief Library files with common functions for Skill + */ + +/** + * Prepare array of tabs for Skill + * + * @param Skill $object Skill + * @return array Array of tabs + */ +function skillPrepareHead($object) +{ + global $db, $langs, $conf; + + $langs->load("hrm"); + + $h = 0; + $head = array(); + + $head[$h][0] = dol_buildpath("/hrm/skill_card.php", 1).'?id='.$object->id; + $head[$h][1] = $langs->trans("SkillCard"); + $head[$h][2] = 'card'; + $h++; + + if (isset($object->fields['note_public']) || isset($object->fields['note_private'])) { + $nbNote = 0; + if (!empty($object->note_private)) { + $nbNote++; + } + if (!empty($object->note_public)) { + $nbNote++; + } + $head[$h][0] = dol_buildpath('/hrm/skill_note.php', 1).'?id='.$object->id; + $head[$h][1] = $langs->trans('Notes'); + if ($nbNote > 0) { + $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ''.$nbNote.'' : ''); + } + $head[$h][2] = 'note'; + $h++; + } + + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; + $upload_dir = $conf->hrm->dir_output."/skill/".dol_sanitizeFileName($object->ref); + $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); + $nbLinks = Link::count($db, $object->element, $object->id); + $head[$h][0] = dol_buildpath("/hrm/skill_document.php", 1).'?id='.$object->id; + $head[$h][1] = $langs->trans('Documents'); + if (($nbFiles + $nbLinks) > 0) { + $head[$h][1] .= ''.($nbFiles + $nbLinks).''; + } + $head[$h][2] = 'document'; + $h++; + + $head[$h][0] = dol_buildpath("/hrm/skill_agenda.php", 1).'?id='.$object->id; + $head[$h][1] = $langs->trans("Events"); + $head[$h][2] = 'agenda'; + $h++; + + // Show more tabs from modules + // Entries must be declared in modules descriptor with line + //$this->tabs = array( + // 'entity:+tabname:Title:@hrm:/hrm/mypage.php?id=__ID__' + //); // to add new tab + //$this->tabs = array( + // 'entity:-tabname:Title:@hrm:/hrm/mypage.php?id=__ID__' + //); // to remove a tab + complete_head_from_modules($conf, $langs, $object, $head, $h, 'skill@hrm'); + + complete_head_from_modules($conf, $langs, $object, $head, $h, 'skill@hrm', 'remove'); + + return $head; +} + + +//Affichage des 5 trades pour cet object +function showTraductionNote($object) +{ +} + + +/** + * Show html area for list of traduction + * + * @param Conf $conf Object conf + * @param Translate $langs Object langs + * @param DoliDB $db Database handler + * @param Societe $object Third party object + * @param string $backtopage Url to go once contact is created + * @return int + */ +function show_traduction($conf, $langs, $db, $object, $backtopage = '') +{ + global $user, $conf, $extrafields, $hookmanager; + global $contextpage; + + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; + $formcompany = new FormCompany($db); + $form = new Form($db); + + $optioncss = GETPOST('optioncss', 'alpha'); + $sortfield = GETPOST("sortfield", 'alpha'); + $sortorder = GETPOST("sortorder", 'alpha'); + $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); + + $search_status = GETPOST("search_status", 'int'); + if ($search_status == '') { + $search_status = 1; // always display active customer first + } + + $search_name = GETPOST("search_name", 'alpha'); + $search_address = GETPOST("search_address", 'alpha'); + $search_poste = GETPOST("search_poste", 'alpha'); + $search_roles = GETPOST("search_roles", 'array'); + + $socialnetworks = getArrayOfSocialNetworks(); + + $searchAddressPhoneDBFields = array( + //Address + 't.address', + 't.zip', + 't.town', + + //Phone + 't.phone', + 't.phone_perso', + 't.phone_mobile', + + //Fax + 't.fax', + + //E-mail + 't.email', + ); + //Social media + // foreach ($socialnetworks as $key => $value) { + // if ($value['active']) { + // $searchAddressPhoneDBFields['t.'.$key] = "t.socialnetworks->'$.".$key."'"; + // } + // } + + if (!$sortorder) { + $sortorder = "ASC"; + } + if (!$sortfield) { + $sortfield = "t.lastname"; + } + + if (!empty($conf->clicktodial->enabled)) { + $user->fetch_clicktodial(); // lecture des infos de clicktodial du user + } + + + $SkillLinestatic = new SkillLine($db); + + $extrafields->fetch_name_optionals_label($SkillLinestatic->table_element); + + $SkillLinestatic->fields=array( + 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), + 'fk_skill' => array('type'=>'integer:Skill:skill/class/skill.class.php', 'label'=>'foreign key skill', 'enabled'=>'1', 'position'=>510, 'notnull'=>1, 'visible'=>-2, 'foreignkey'=>'user.rowid',), + 'traduction_note' => array('type'=>'text', 'label'=>'traduction_note', 'enabled'=>'1', 'position'=>56, 'notnull'=>0, 'visible'=>1,), + 'rank' => array('type'=>'integer', 'label'=>'rank', 'enabled'=>'1', 'position'=>55, 'notnull'=>1, 'visible'=>1, 'index'=>1,), + ); + + // Definition of fields for list + $arrayfields = array( + 't.rowid'=>array('label'=>"TechnicalID", 'checked'=>(!empty($conf->global->MAIN_SHOW_TECHNICAL_ID) ? 1 : 0), 'enabled'=>(!empty($conf->global->MAIN_SHOW_TECHNICAL_ID) ? 1 : 0), 'position'=>1), + 't.name'=>array('label'=>"Name", 'checked'=>1, 'position'=>10), + 't.poste'=>array('label'=>"PostOrFunction", 'checked'=>1, 'position'=>20), + 't.address'=>array('label'=>(empty($conf->dol_optimize_smallscreen) ? $langs->trans("Address").' / '.$langs->trans("Phone").' / '.$langs->trans("Email") : $langs->trans("Address")), 'checked'=>1, 'position'=>30), + 'sc.role'=>array('label'=>"ContactByDefaultFor", 'checked'=>1, 'position'=>40), + 't.statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>50, 'class'=>'center'), + ); + // Extra fields + if (!empty($extrafields->attributes[$contactstatic->table_element]['label']) && is_array($extrafields->attributes[$contactstatic->table_element]['label']) && count($extrafields->attributes[$contactstatic->table_element]['label'])) { + foreach ($extrafields->attributes[$contactstatic->table_element]['label'] as $key => $val) { + if (!empty($extrafields->attributes[$contactstatic->table_element]['list'][$key])) { + $arrayfields["ef.".$key] = array( + 'label'=>$extrafields->attributes[$contactstatic->table_element]['label'][$key], + 'checked'=>(($extrafields->attributes[$contactstatic->table_element]['list'][$key] < 0) ? 0 : 1), + 'position'=>1000 + $extrafields->attributes[$contactstatic->table_element]['pos'][$key], + 'enabled'=>(abs($extrafields->attributes[$contactstatic->table_element]['list'][$key]) != 3 && $extrafields->attributes[$contactstatic->table_element]['perms'][$key])); + } + } + } + + // Initialize array of search criterias + $search = array(); + foreach ($arrayfields as $key => $val) { + $queryName = 'search_'.substr($key, 2); + if (GETPOST($queryName, 'alpha')) { + $search[substr($key, 2)] = GETPOST($queryName, 'alpha'); + } + } + $search_array_options = $extrafields->getOptionalsFromPost($contactstatic->table_element, '', 'search_'); + + // Purge search criteria + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers + $search_status = ''; + $search_name = ''; + $search_roles = array(); + $search_address = ''; + $search_poste = ''; + $search = array(); + $search_array_options = array(); + + foreach ($contactstatic->fields as $key => $val) { + $search[$key] = ''; + } + } + + $contactstatic->fields = dol_sort_array($contactstatic->fields, 'position'); + $arrayfields = dol_sort_array($arrayfields, 'position'); + + $newcardbutton = ''; + if ($user->rights->societe->contact->creer) { + $addTraduction = $langs->trans("AddTraduction"); + $newcardbutton .= dolGetButtonTitle($addTraduction, '', 'fa fa-plus-circle', DOL_URL_ROOT.'/skilldet/card.php?skillid='.$object->id.'&action=create&backtopage='.urlencode($backtopage)); + } + + print "\n"; + + $title = $langs->trans("TraductionRule"); + print load_fiche_titre($title, $newcardbutton, ''); + + print '
    '; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; + $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields + //if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1); + + print '
    '; // You can use div-table-responsive-no-min if you dont need reserved height for your table + print "\n".''."\n"; + + $param = "socid=".urlencode($object->id); + if ($search_status != '') { + $param .= '&search_status='.urlencode($search_status); + } + if (count($search_roles) > 0) { + $param .= implode('&search_roles[]=', $search_roles); + } + if ($search_name != '') { + $param .= '&search_name='.urlencode($search_name); + } + if ($search_poste != '') { + $param .= '&search_poste='.urlencode($search_poste); + } + if ($search_address != '') { + $param .= '&search_address='.urlencode($search_address); + } + if ($optioncss != '') { + $param .= '&optioncss='.urlencode($optioncss); + } + + // Add $param from extra fields + $extrafieldsobjectkey = $contactstatic->table_element; + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; + + $sql = "SELECT t.rowid, t.lastname, t.firstname, t.fk_pays as country_id, t.civility, t.poste, t.phone as phone_pro, t.phone_mobile, t.phone_perso, t.fax, t.email, t.socialnetworks, t.statut, t.photo,"; + $sql .= " t.civility as civility_id, t.address, t.zip, t.town"; + $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as t"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople_extrafields as ef on (t.rowid = ef.fk_object)"; + $sql .= " WHERE t.fk_soc = ".$object->id; + if ($search_status != '' && $search_status != '-1') { + $sql .= " AND t.statut = ".$db->escape($search_status); + } + if ($search_name) { + $sql .= natural_search(array('t.lastname', 't.firstname'), $search_name); + } + if ($search_poste) { + $sql .= natural_search('t.poste', $search_poste); + } + if ($search_address) { + $sql .= natural_search($searchAddressPhoneDBFields, $search_address); + } + if (count($search_roles) > 0) { + $sql .= " AND t.rowid IN (SELECT sc.fk_socpeople FROM ".MAIN_DB_PREFIX."societe_contacts as sc WHERE sc.fk_c_type_contact IN (".$db->sanitize(implode(',', $search_roles))."))"; + } + // Add where from extra fields + $extrafieldsobjectkey = $contactstatic->table_element; + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; + if ($sortfield == "t.name") { + $sql .= " ORDER BY t.lastname $sortorder, t.firstname $sortorder"; + } else { + $sql .= " ORDER BY $sortfield $sortorder"; + } + + dol_syslog('core/lib/company.lib.php :: show_contacts', LOG_DEBUG); + $result = $db->query($sql); + if (!$result) { + dol_print_error($db); + } + + $num = $db->num_rows($result); + + // Fields title search + // -------------------------------------------------------------------- + print ''; + foreach ($contactstatic->fields as $key => $val) { + $align = ''; + if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { + $align .= ($align ? ' ' : '').'center'; + } + if (in_array($val['type'], array('timestamp'))) { + $align .= ($align ? ' ' : '').'nowrap'; + } + if ($key == 'status' || $key == 'statut') { + $align .= ($align ? ' ' : '').'center'; + } + if (!empty($arrayfields['t.'.$key]['checked']) || !empty($arrayfields['sc.'.$key]['checked'])) { + print ''; + } + } + // Extra fields + $extrafieldsobjectkey = $contactstatic->table_element; + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; + + // Fields from hook + $parameters = array('arrayfields'=>$arrayfields); + $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $contactstatic); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + // Action column + print ''; + print ''."\n"; + + + // Fields title label + // -------------------------------------------------------------------- + print ''; + foreach ($contactstatic->fields as $key => $val) { + $align = ''; + if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { + $align .= ($align ? ' ' : '').'center'; + } + if (in_array($val['type'], array('timestamp'))) { + $align .= ($align ? ' ' : '').'nowrap'; + } + if ($key == 'status' || $key == 'statut') { + $align .= ($align ? ' ' : '').'center'; + } + if (!empty($arrayfields['t.'.$key]['checked'])) { + print getTitleFieldOfList($val['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($align ? 'class="'.$align.'"' : ''), $sortfield, $sortorder, $align.' ')."\n"; + } + if ($key == 'role') { + $align .= ($align ? ' ' : '').'left'; + } + if (!empty($arrayfields['sc.'.$key]['checked'])) { + print getTitleFieldOfList($arrayfields['sc.'.$key]['label'], 0, $_SERVER['PHP_SELF'], '', '', $param, ($align ? 'class="'.$align.'"' : ''), $sortfield, $sortorder, $align.' ')."\n"; + } + } + // Extra fields + $extrafieldsobjectkey = $contactstatic->table_element; + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; + // Hook fields + $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); + $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ')."\n"; + print ''."\n"; + + $i = -1; + + if ($num || (GETPOST('button_search') || GETPOST('button_search.x') || GETPOST('button_search_x'))) { + $i = 0; + + while ($i < $num) { + $obj = $db->fetch_object($result); + + $contactstatic->id = $obj->rowid; + $contactstatic->ref = $obj->rowid; + $contactstatic->statut = $obj->statut; + $contactstatic->lastname = $obj->lastname; + $contactstatic->firstname = $obj->firstname; + $contactstatic->civility_id = $obj->civility_id; + $contactstatic->civility_code = $obj->civility_id; + $contactstatic->poste = $obj->poste; + $contactstatic->address = $obj->address; + $contactstatic->zip = $obj->zip; + $contactstatic->town = $obj->town; + $contactstatic->phone_pro = $obj->phone_pro; + $contactstatic->phone_mobile = $obj->phone_mobile; + $contactstatic->phone_perso = $obj->phone_perso; + $contactstatic->email = $obj->email; + $contactstatic->socialnetworks = $obj->socialnetworks; + $contactstatic->photo = $obj->photo; + + $country_code = getCountry($obj->country_id, 2); + $contactstatic->country_code = $country_code; + + $contactstatic->setGenderFromCivility(); + $contactstatic->fetch_optionals(); + + $resultRole = $contactstatic->fetchRoles(); + if ($resultRole < 0) { + setEventMessages(null, $contactstatic->errors, 'errors'); + } + + if (is_array($contactstatic->array_options)) { + foreach ($contactstatic->array_options as $key => $val) { + $obj->$key = $val; + } + } + + print ''; + + // ID + if (!empty($arrayfields['t.rowid']['checked'])) { + print ''; + } + + // Photo - Name + if (!empty($arrayfields['t.name']['checked'])) { + print ''; + } + + // Job position + if (!empty($arrayfields['t.poste']['checked'])) { + print ''; + } + + // Address - Phone - Email + if (!empty($arrayfields['t.address']['checked'])) { + print ''; + } + + // Role + if (!empty($arrayfields['sc.role']['checked'])) { + print ''; + } + + // Status + if (!empty($arrayfields['t.statut']['checked'])) { + print ''; + } + + // Extra fields + $extrafieldsobjectkey = $contactstatic->table_element; + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; + + // Actions + print ''; + + print "\n"; + $i++; + } + } else { + $colspan = 1; + foreach ($arrayfields as $key => $val) { + if (!empty($val['checked'])) { + $colspan++; + } + } + print ''; + } + print "\n
    '; + if (in_array($key, array('statut'))) { + print $form->selectarray('search_status', array('-1'=>'', '0'=>$contactstatic->LibStatut(0, 1), '1'=>$contactstatic->LibStatut(1, 1)), $search_status); + } elseif (in_array($key, array('role'))) { + print $formcompany->showRoles("search_roles", $contactstatic, 'edit', $search_roles); + } else { + print ''; + } + print ''; + print $form->showFilterButtons(); + print '
    '; + print $contactstatic->id; + print ''; + print $form->showphoto('contact', $contactstatic, 0, 0, 0, 'photorefnoborder valignmiddle marginrightonly', 'small', 1, 0, 1); + print $contactstatic->getNomUrl(0, '', 0, '&backtopage='.urlencode($backtopage)); + print ''; + if ($obj->poste) { + print $obj->poste; + } + print ''; + print $contactstatic->getBannerAddress('contact', $object); + print ''; + print $formcompany->showRoles("roles", $contactstatic, 'view'); + print ''.$contactstatic->getLibStatut(5).''; + + // Add to agenda + if (!empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) { + print ''; + print img_object($langs->trans("Event"), "action"); + print '   '; + } + + // Edit + if ($user->rights->societe->contact->creer) { + print ''; + print img_edit(); + print ''; + } + + print '
    '.$langs->trans("None").'
    \n"; + print '
    '; + + print '
    '."\n"; + + return $i; +} diff --git a/htdocs/hrm/lib/hrm_skilldet.lib.php b/htdocs/hrm/lib/hrm_skilldet.lib.php new file mode 100644 index 00000000000..df7e1af45fc --- /dev/null +++ b/htdocs/hrm/lib/hrm_skilldet.lib.php @@ -0,0 +1,95 @@ + + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND + * + * 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 . + */ + +/** + * \file lib/hrm_skilldet.lib.php + * \ingroup hrm + * \brief Library files with common functions for Skilldet + */ + +/** + * Prepare array of tabs for Skilldet + * + * @param Skilldet $object Skilldet + * @return array Array of tabs + */ +function skilldetPrepareHead($object) +{ + global $db, $langs, $conf; + + $langs->load("hrm"); + + $h = 0; + $head = array(); + + $head[$h][0] = dol_buildpath("/hrm/skilldet_card.php", 1).'?id='.$object->id; + $head[$h][1] = $langs->trans("Card"); + $head[$h][2] = 'card'; + $h++; + + if (isset($object->fields['note_public']) || isset($object->fields['note_private'])) { + $nbNote = 0; + if (!empty($object->note_private)) { + $nbNote++; + } + if (!empty($object->note_public)) { + $nbNote++; + } + $head[$h][0] = dol_buildpath('/hrm/skilldet_note.php', 1).'?id='.$object->id; + $head[$h][1] = $langs->trans('Notes'); + if ($nbNote > 0) { + $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ''.$nbNote.'' : ''); + } + $head[$h][2] = 'note'; + $h++; + } + + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; + $upload_dir = $conf->hrm->dir_output."/skilldet/".dol_sanitizeFileName($object->ref); + $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); + $nbLinks = Link::count($db, $object->element, $object->id); + $head[$h][0] = dol_buildpath("/hrm/skilldet_document.php", 1).'?id='.$object->id; + $head[$h][1] = $langs->trans('Documents'); + if (($nbFiles + $nbLinks) > 0) { + $head[$h][1] .= ''.($nbFiles + $nbLinks).''; + } + $head[$h][2] = 'document'; + $h++; + + $head[$h][0] = dol_buildpath("/hrm/skilldet_agenda.php", 1).'?id='.$object->id; + $head[$h][1] = $langs->trans("Events"); + $head[$h][2] = 'agenda'; + $h++; + + // Show more tabs from modules + // Entries must be declared in modules descriptor with line + //$this->tabs = array( + // 'entity:+tabname:Title:@hrm:/hrm/mypage.php?id=__ID__' + //); // to add new tab + //$this->tabs = array( + // 'entity:-tabname:Title:@hrm:/hrm/mypage.php?id=__ID__' + //); // to remove a tab + complete_head_from_modules($conf, $langs, $object, $head, $h, 'skilldet@hrm'); + + complete_head_from_modules($conf, $langs, $object, $head, $h, 'skilldet@hrm', 'remove'); + + return $head; +} diff --git a/htdocs/hrm/lib/hrm_skillrank.lib.php b/htdocs/hrm/lib/hrm_skillrank.lib.php new file mode 100644 index 00000000000..e7937001bc2 --- /dev/null +++ b/htdocs/hrm/lib/hrm_skillrank.lib.php @@ -0,0 +1,149 @@ + + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND + * + * 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 . + */ + +/** + * \file lib/hrm_skillrank.lib.php + * \ingroup hrm + * \brief Library files with common functions for SkillRank + */ + +/** + * Prepare array of tabs for SkillRank + * + * @param SkillRank $object SkillRank + * @return array Array of tabs + */ +function skillrankPrepareHead($object) +{ + global $db, $langs, $conf; + + $langs->load("hrm"); + + $h = 0; + $head = array(); + + $head[$h][0] = dol_buildpath("/hrm/skillrank_card.php", 1).'?id='.$object->id; + $head[$h][1] = $langs->trans("Card"); + $head[$h][2] = 'card'; + $h++; + + if (isset($object->fields['note_public']) || isset($object->fields['note_private'])) { + $nbNote = 0; + if (!empty($object->note_private)) { + $nbNote++; + } + if (!empty($object->note_public)) { + $nbNote++; + } + $head[$h][0] = dol_buildpath('/hrm/skillrank_note.php', 1).'?id='.$object->id; + $head[$h][1] = $langs->trans('Notes'); + if ($nbNote > 0) { + $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ''.$nbNote.'' : ''); + } + $head[$h][2] = 'note'; + $h++; + } + + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; + $upload_dir = $conf->hrm->dir_output."/skillrank/".dol_sanitizeFileName($object->ref); + $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); + $nbLinks = Link::count($db, $object->element, $object->id); + $head[$h][0] = dol_buildpath("/hrm/skillrank_document.php", 1).'?id='.$object->id; + $head[$h][1] = $langs->trans('Documents'); + if (($nbFiles + $nbLinks) > 0) { + $head[$h][1] .= ''.($nbFiles + $nbLinks).''; + } + $head[$h][2] = 'document'; + $h++; + + $head[$h][0] = dol_buildpath("/hrm/skillrank_agenda.php", 1).'?id='.$object->id; + $head[$h][1] = $langs->trans("Events"); + $head[$h][2] = 'agenda'; + $h++; + + // Show more tabs from modules + // Entries must be declared in modules descriptor with line + //$this->tabs = array( + // 'entity:+tabname:Title:@hrm:/hrm/mypage.php?id=__ID__' + //); // to add new tab + //$this->tabs = array( + // 'entity:-tabname:Title:@hrm:/hrm/mypage.php?id=__ID__' + //); // to remove a tab + complete_head_from_modules($conf, $langs, $object, $head, $h, 'skillrank@hrm'); + + complete_head_from_modules($conf, $langs, $object, $head, $h, 'skillrank@hrm', 'remove'); + + return $head; +} + +function displayRankInfos($selected_rank, $fk_skill, $inputname = 'TNote', $mode = 'view') +{ + global $db, $conf, $langs; + + require_once DOL_DOCUMENT_ROOT . '/hrm/class/skill.class.php'; + require_once DOL_DOCUMENT_ROOT . '/hrm/class/skilldet.class.php'; + + // On charge les différentes notes possibles pour la compétence $fk_skill + $skilldet = new Skilldet($db); + $Lines = $skilldet->fetchAll('ASC', 'rank', 0, 0, array('customsql'=>'fk_skill = '.$fk_skill)); + + if (empty($Lines)) return $langs->trans('SkillHasNoLines'); + + $ret = '0'; + + foreach ($Lines as $line) { + $MaxNumberSkill = isset($conf->global->HRM_MAXRANK) ? $conf->global->HRM_MAXRANK : Skill::DEFAULT_MAX_RANK_PER_SKILL; + if ($line->rank > $MaxNumberSkill) { + continue; + } + + $ret.= ''.$line->rank.''; + } + + if ($mode == 'edit') { + $ret.= ' + + '; + } + + return $ret; +} diff --git a/htdocs/hrm/modulebuilder.txt b/htdocs/hrm/modulebuilder.txt new file mode 100644 index 00000000000..670a1774929 --- /dev/null +++ b/htdocs/hrm/modulebuilder.txt @@ -0,0 +1,3 @@ +# DO NOT DELETE THIS FILE MANUALLY +# File to flag module built using official module template. +# When this file is present into a module directory, you can edit it with the module builder tool. \ No newline at end of file diff --git a/htdocs/hrm/position.php b/htdocs/hrm/position.php new file mode 100644 index 00000000000..d0eb8159019 --- /dev/null +++ b/htdocs/hrm/position.php @@ -0,0 +1,950 @@ + + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND + * + * 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 . + */ + +/** + * \file position.php + * \ingroup hrm + * \brief Page to create/edit/view position + */ + +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs +//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters +//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters +//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). +//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) +//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data +//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php +//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library +//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. +//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value +//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler +//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message +//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies +//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET +//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification + +// 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"); +} + +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; +dol_include_once('/hrm/class/position.class.php'); +dol_include_once('/hrm/class/job.class.php'); +dol_include_once('/hrm/lib/hrm_position.lib.php'); +dol_include_once('/hrm/lib/hrm_job.lib.php'); + +$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... +$backtopage = GETPOST('backtopage', 'alpha'); +$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); +$fk_job = GETPOST('fk_job', 'int'); + +// Get parameters +$id = GETPOST('fk_job', 'int'); +$fk_job = GETPOST('fk_job', 'int'); +$fk_user = GETPOST('fk_user', 'int'); +//$start_date = date('Y-m-d', GETPOST('date_startyear', 'int').'-'.GETPOST('date_startmonth', 'int').'-'.GETPOST('date_startday', 'int')); +$start_date = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int')); + +$ref = GETPOST('ref', 'alpha'); +$confirm = GETPOST('confirm', 'alpha'); +$cancel = GETPOST('cancel', 'aZ09'); +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'positioncard'; // To manage different context of search + +// Initialize technical objects +$object = new Job($db); + +$extrafields = new ExtraFields($db); + +$diroutputmassaction = $conf->hrm->dir_output . '/temp/massgeneration/' . $user->id; +$hookmanager->initHooks(array('positiontab', 'globalcard')); // Note that conf->hooks_modules contains array + +// Fetch optionals attributes and labels +$extrafields->fetch_name_optionals_label($object->table_element); + +$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); + +// Initialize array of search criterias +$search_all = GETPOST("search_all", 'alpha'); +$search = array(); +foreach ($object->fields as $key => $val) { + if (GETPOST('search_' . $key, 'alpha')) { + $search[$key] = GETPOST('search_' . $key, 'alpha'); + } +} + +// Load object +include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. + +$permissiontoread = $user->rights->hrm->all->read; +$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php +$permissiontodelete = $user->rights->hrm->all->delete; +$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1] . '/position'; + +// Security check (enable the most restrictive one) +//if ($user->socid > 0) accessforbidden(); +//if ($user->socid > 0) $socid = $user->socid; +//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); +//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); +if (empty($conf->hrm->enabled)) accessforbidden(); +if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) accessforbidden(); + + +/* + * Actions + */ + +$parameters = array(); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + +if (empty($reshook)) { + $error = 0; + + $backurlforlist = dol_buildpath('/hrm/position_list.php', 1); + //$backtopage = dol_buildpath('/hrm/position.php', 1) . '?fk_job=' . ($fk_job > 0 ? $fk_job : '__ID__'); + + if (empty($backtopage) || ($cancel && empty($fk_job))) { + if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { + if (empty($fk_job) && (($action != 'add' && $action != 'create') || $cancel)) { + $backtopage = $backurlforlist; + } else { + $backtopage = dol_buildpath('/hrm/position.php', 1) . '?fk_job=' . ($fk_job > 0 ? $fk_job : '__ID__'); + } + } + } + + $triggermodname = 'hrm_POSITION_MODIFY'; // Name of trigger action code to execute when we modify record + + // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen + $job = $object; + $object = new Position($db); + include DOL_DOCUMENT_ROOT . '/core/actions_addupdatedelete.inc.php'; +} + +// Load translation files required by the page +$langs->loadLangs(array("hrm", "other")); + +$title = $langs->trans("Position"); +$help_url = ''; +llxHeader('', $title, $help_url); + +if ($job->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) { + DisplayJob($job); + DisplayPositionList($conf, $langs, $db); +} + + +/** + * Show the top of the page including informations of a job + * + * @param DoliDB $db Database handler + * @param Job $object Job object + * @param $permissiontoadd $permissiontoadd Rights/permissions + * @return array + */ +function DisplayJob($object) +{ + global $conf, $langs, $db, $extrafields, $hookmanager, $action, $backtopage, $backtopageforcancel, $permissiontoadd; + + /* + * View + * + * Put here all code to build page + */ + + $form = new Form($db); + $formfile = new FormFile($db); + $formproject = new FormProjets($db); + + if ($backtopage) { + print ''; + } + if ($backtopageforcancel) { + print ''; + } + + // Part to show record + + $res = $object->fetch_optionals(); + + $head = jobPrepareHead($object); + print dol_get_fiche_head($head, 'position', $langs->trans("Workstation"), -1, $object->picto); + + // Object card + // ------------------------------------------------------------ + $linkback = '' . $langs->trans("BackToList") . ''; + + $morehtmlref = '
    '; + $morehtmlref.= $object->label; + $morehtmlref .= '
    '; + + dol_banner_tab($object, 'fk_job', $linkback, 1, 'rowid', 'rowid', $morehtmlref); + + + print '
    '; + print '
    '; + print '
    '; + print '' . "\n"; + + // Common attributes + //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field + //unset($object->fields['fk_project']); // Hide field already shown in banner + //unset($object->fields['fk_soc']); // Hide field already shown in banner + $object->fields['label']['visible']=0; // Already in banner + include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php'; + + // Other attributes. Fields from hook formObjectOptions and Extrafields. + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; + + print '
    '; + print '
    '; + print '
    '; + + print '
    '; + + print dol_get_fiche_end(); +} + + +/** + * Show a list of positions for the current job + + * @param Conf $conf Object conf + * @param Translate $langs Object langs + * @param DoliDB $db Database handler + * @param Position $object Position object + * @return array|void + */ +function DisplayPositionList($conf, $langs, $db) +{ + global $user,$langs, $db, $conf, $extrafields, $hookmanager, $permissiontoadd, $permissiontodelete; + + require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; + require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; + require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; + + // load hrm libraries + require_once __DIR__ . '/class/position.class.php'; + + // for other modules + //dol_include_once('/othermodule/class/otherobject.class.php'); + + $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... + $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) + $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? + $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation + $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button + $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list + $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'positionlist'; // To manage different context of search + $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') + $id = GETPOST('id', 'int'); + $fk_job = GETPOST('fk_job', 'int'); + + // Load variable for pagination + $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; + $sortfield = GETPOST('sortfield', 'aZ09comma'); + $sortorder = GETPOST('sortorder', 'aZ09comma'); + $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); + if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { + // If $page is not defined, or '' or -1 or if we click on clear filters + $page = 0; + } + $offset = $limit * $page; + $pageprev = $page - 1; + $pagenext = $page + 1; + + // Initialize technical objects + $object = new Position($db); + + $extrafields = new ExtraFields($db); + $diroutputmassaction = $conf->hrm->dir_output . '/temp/massgeneration/' . $user->id; + $hookmanager->initHooks(array('positiontablist')); // Note that conf->hooks_modules contains array + + // Fetch optionals attributes and labels + $extrafields->fetch_name_optionals_label($object->table_element); + //$extrafields->fetch_name_optionals_label($object->table_element_line); + + $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); + + // Default sort order (if not yet defined by previous GETPOST) + if (!$sortfield) { + reset($object->fields); // Reset is required to avoid key() to return null. + $sortfield = "t." . key($object->fields); // Set here default search field. By default 1st field in definition. + } + if (!$sortorder) { + $sortorder = "ASC"; + } + + // Initialize array of search criterias + $search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); + $search = array(); + foreach ($object->fields as $key => $val) { + if (GETPOST('search_' . $key, 'alpha') !== '') { + $search[$key] = GETPOST('search_' . $key, 'alpha'); + } + if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + $search[$key . '_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_' . $key . '_dtstartmonth', 'int'), GETPOST('search_' . $key . '_dtstartday', 'int'), GETPOST('search_' . $key . '_dtstartyear', 'int')); + $search[$key . '_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_' . $key . '_dtendmonth', 'int'), GETPOST('search_' . $key . '_dtendday', 'int'), GETPOST('search_' . $key . '_dtendyear', 'int')); + } + } + + // List of fields to search into when doing a "search in all" + $fieldstosearchall = array(); + foreach ($object->fields as $key => $val) { + if (!empty($val['searchall'])) { + $fieldstosearchall['t.' . $key] = $val['label']; + } + } + + // Definition of array of fields for columns + $arrayfields = array(); + foreach ($object->fields as $key => $val) { + // If $val['visible']==0, then we never show the field + if (!empty($val['visible'])) { + $visible = (int) dol_eval($val['visible'], 1); + $arrayfields['t.' . $key] = array( + 'label' => $val['label'], + 'checked' => (($visible < 0) ? 0 : 1), + 'enabled' => ($visible != 3 && dol_eval($val['enabled'], 1)), + 'position' => $val['position'], + 'help' => isset($val['help']) ? $val['help'] : '' + ); + } + } + // Extra fields + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php'; + + $object->fields = dol_sort_array($object->fields, 'position'); + $arrayfields = dol_sort_array($arrayfields, 'position'); + + // Security check + if (empty($conf->hrm->enabled)) { + accessforbidden('Module not enabled'); + } + + // Security check (enable the most restrictive one) + if ($user->socid > 0) accessforbidden(); + //if ($user->socid > 0) accessforbidden(); + //$socid = 0; if ($user->socid > 0) $socid = $user->socid; + //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); + //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); + //if (empty($conf->hrm->enabled)) accessforbidden(); + //if (!$permissiontoread) accessforbidden(); + + + /* + * Actions + */ + + if (GETPOST('cancel', 'alpha')) { + $action = 'list'; + $massaction = ''; + } + if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { + $massaction = ''; + } + + $parameters = array(); + $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + } + + if (empty($reshook)) { + // Selection of new fields + include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php'; + + // Purge search criteria + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers + foreach ($object->fields as $key => $val) { + $search[$key] = ''; + if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + $search[$key . '_dtstart'] = ''; + $search[$key . '_dtend'] = ''; + } + } + $toselect = array(); + $search_array_options = array(); + } + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha') + || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) { + $massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation + } + + // Mass actions + $objectclass = 'Position'; + $objectlabel = 'Position'; + $uploaddir = $conf->hrm->dir_output; + include DOL_DOCUMENT_ROOT . '/core/actions_massactions.inc.php'; + } + + + /* + * View + */ + + $form = new Form($db); + + $now = dol_now(); + + //$help_url="EN:Module_Position|FR:Module_Position_FR|ES:Módulo_Position"; + $help_url = ''; + $title = $langs->trans('ListOf', $langs->transnoentitiesnoconv("Positions")); + $morejs = array(); + $morecss = array(); + + + // Build and execute select + // -------------------------------------------------------------------- + $sql = 'SELECT '; + $sql .= $object->getFieldList('t'); + // Add fields from extrafields + if (!empty($extrafields->attributes[$object->table_element]['label'])) { + foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef." . $key . ' as options_' . $key . ', ' : ''); + } + } + // Add fields from hooks + $parameters = array(); + $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook + $sql .= preg_replace('/^,/', '', $hookmanager->resPrint); + $sql = preg_replace('/,\s*$/', '', $sql); + $sql .= " FROM " . MAIN_DB_PREFIX . $object->table_element . " as t"; + if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { + $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . $object->table_element . "_extrafields as ef on (t.rowid = ef.fk_object)"; + } + // Add table from hooks + $parameters = array(); + $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook + $sql .= $hookmanager->resPrint; + if ($object->ismultientitymanaged == 1) { + $sql .= " WHERE t.entity IN (" . getEntity($object->element) . ")"; + } else { + $sql .= " WHERE 1 = 1"; + } + $sql .= " AND t.fk_job = " . $fk_job . " "; + + foreach ($search as $key => $val) { + if (array_key_exists($key, $object->fields)) { + if ($key == 'status' && $search[$key] == -1) { + continue; + } + $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); + if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) { + if ($search[$key] == '-1' || $search[$key] === '0') { + $search[$key] = ''; + } + $mode_search = 2; + } + if ($search[$key] != '') { + $sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search)); + } + } else { + if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') { + $columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key); + if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) { + if (preg_match('/_dtstart$/', $key)) { + $sql .= " AND t." . $columnName . " >= '" . $db->idate($search[$key]) . "'"; + } + if (preg_match('/_dtend$/', $key)) { + $sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'"; + } + } + } + } + } + if ($search_all) { + $sql .= natural_search(array_keys($fieldstosearchall), $search_all); + } + //$sql.= dolSqlDateFilter("t.field", $search_xxxday, $search_xxxmonth, $search_xxxyear); + // Add where from extra fields + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_sql.tpl.php'; + // Add where from hooks + $parameters = array(); + $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook + $sql .= $hookmanager->resPrint; + + /* If a group by is required + $sql .= " GROUP BY "; + foreach($object->fields as $key => $val) { + $sql .= 't.'.$key.', '; + } + // Add fields from extrafields + if (!empty($extrafields->attributes[$object->table_element]['label'])) { + foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : ''); + } + } + // Add where from hooks + $parameters = array(); + $reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook + $sql .= $hookmanager->resPrint; + $sql = preg_replace('/,\s*$/', '', $sql); + */ + + $sql .= $db->order($sortfield, $sortorder); + + // Count total nb of records + $nbtotalofrecords = ''; + if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + $resql = $db->query($sql); + $nbtotalofrecords = $db->num_rows($resql); + if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0 + $page = 0; + $offset = 0; + } + } + // if total of record found is smaller than limit, no need to do paging and to restart another select with limits set. + if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit))) { + $num = $nbtotalofrecords; + } else { + if ($limit) { + $sql .= $db->plimit($limit + 1, $offset); + } + + $resql = $db->query($sql); + if (!$resql) { + dol_print_error($db); + exit; + } + + $num = $db->num_rows($resql); + } + + // Direct jump if only one record found + if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) { + $obj = $db->fetch_object($resql); + $id = $obj->rowid; + header("Location: " . dol_buildpath('/hrm/position.php', 1) . '?id=' . $id); + exit; + } + + $arrayofselected = is_array($toselect) ? $toselect : array(); + + $param = 'fk_job=' . $fk_job; + if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { + $param .= '&contextpage=' . urlencode($contextpage); + } + if ($limit > 0 && $limit != $conf->liste_limit) { + $param .= '&limit=' . urlencode($limit); + } + foreach ($search as $key => $val) { + if (is_array($search[$key]) && count($search[$key])) { + foreach ($search[$key] as $skey) { + $param .= '&search_' . $key . '[]=' . urlencode($skey); + } + } else { + $param .= '&search_' . $key . '=' . urlencode($search[$key]); + } + } + if ($optioncss != '') { + $param .= '&optioncss=' . urlencode($optioncss); + } + // Add $param from extra fields + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_param.tpl.php'; + // Add $param from hooks + $parameters = array(); + $reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook + $param .= $hookmanager->resPrint; + + // List of mass actions available + $arrayofmassactions = array( + //'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"), + //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), + //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), + //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), + ); + if ($permissiontodelete) { + $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"') . $langs->trans("Delete"); + } + if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { + $arrayofmassactions = array(); + } + $massactionbutton = $form->selectMassAction('', $arrayofmassactions); + + print '
    ' . "\n"; + if ($optioncss != '') { + print ''; + } + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + $newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/hrm/position.php', 1) . '?action=create&backtopage=' . urlencode($_SERVER['PHP_SELF'].'?fk_job=' . $fk_job).'&fk_job=' . $fk_job, '', $permissiontoadd); + + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_' . $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); + + // Add code for pre mass action (confirmation or email presend form) + $topicmail = "SendPositionRef"; + $modelmail = "position"; + $objecttmp = new Position($db); + $trackid = 'xxxx' . $object->id; + include DOL_DOCUMENT_ROOT . '/core/tpl/massactions_pre.tpl.php'; + + if ($search_all) { + foreach ($fieldstosearchall as $key => $val) { + $fieldstosearchall[$key] = $langs->trans($val); + } + print '
    ' . $langs->trans("FilterOnInto", $search_all) . join(', ', $fieldstosearchall) . '
    '; + } + + $moreforfilter = ''; + /*$moreforfilter.='
    '; + $moreforfilter.= $langs->trans('MyFilter') . ': '; + $moreforfilter.= '
    ';*/ + + $parameters = array(); + $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook + if (empty($reshook)) { + $moreforfilter .= $hookmanager->resPrint; + } else { + $moreforfilter = $hookmanager->resPrint; + } + + if (!empty($moreforfilter)) { + print '
    '; + print $moreforfilter; + print '
    '; + } + + $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; + $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields + $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); + + print '
    '; // You can use div-table-responsive-no-min if you dont need reserved height for your table + print '' . "\n"; + + + // Fields title search + // -------------------------------------------------------------------- + print ''; + foreach ($object->fields as $key => $val) { + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); + if ($key == 'status') { + $cssforfield .= ($cssforfield ? ' ' : '') . 'center'; + } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '') . 'center'; + } elseif (in_array($val['type'], array('timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '') . 'nowrap'; + } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { + $cssforfield .= ($cssforfield ? ' ' : '') . 'right'; + } + if (!empty($arrayfields['t.' . $key]['checked'])) { + print ''; + } + } + // Extra fields + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_input.tpl.php'; + + // Fields from hook + $parameters = array('arrayfields' => $arrayfields); + $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + // Action column + print ''; + print '' . "\n"; + + + // Fields title label + // -------------------------------------------------------------------- + print ''; + foreach ($object->fields as $key => $val) { + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); + if ($key == 'status') { + $cssforfield .= ($cssforfield ? ' ' : '') . 'center'; + } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '') . 'center'; + } elseif (in_array($val['type'], array('timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '') . 'nowrap'; + } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { + $cssforfield .= ($cssforfield ? ' ' : '') . 'right'; + } + if (!empty($arrayfields['t.' . $key]['checked'])) { + print getTitleFieldOfList($arrayfields['t.' . $key]['label'], 0, $_SERVER['PHP_SELF'], 't.' . $key, '', $param, ($cssforfield ? 'class="' . $cssforfield . '"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield . ' ' : '')) . "\n"; + } + } + // Extra fields + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_title.tpl.php'; + // Hook fields + $parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder); + $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + // Action column + print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ') . "\n"; + print '' . "\n"; + + // Detect if we need a fetch on each output line + $needToFetchEachLine = 0; + if (isset($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { + foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) { + if (preg_match('/\$object/', $val)) { + $needToFetchEachLine++; // There is at least one compute field that use $object + } + } + } + + + // Loop on record + // -------------------------------------------------------------------- + $i = 0; + $totalarray = array(); + $totalarray['nbfield'] = 0; + while ($i < ($limit ? min($num, $limit) : $num)) { + $obj = $db->fetch_object($resql); + if (empty($obj)) { + break; // Should not happen + } + + // Store properties in $object + $object->setVarsFromFetchObj($obj); + + // Show here line of result + print ''; + foreach ($object->fields as $key => $val) { + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); + if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '') . 'center'; + } elseif ($key == 'status') { + $cssforfield .= ($cssforfield ? ' ' : '') . 'center'; + } + + if (in_array($val['type'], array('timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '') . 'nowrap'; + } elseif ($key == 'ref') { + $cssforfield .= ($cssforfield ? ' ' : '') . 'nowrap'; + } + + if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) { + $cssforfield .= ($cssforfield ? ' ' : '') . 'right'; + } + //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; + + if (!empty($arrayfields['t.' . $key]['checked'])) { + print ''; + if ($key == 'status') { + print $object->getLibStatut(5); + } elseif ($key == 'rowid') { + print $object->getNomUrl(1); + } else { + print $object->showOutputField($val, $key, $object->$key, ''); + } + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + if (!empty($val['isameasure'])) { + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 't.' . $key; + } + if (!isset($totalarray['val'])) { + $totalarray['val'] = array(); + } + if (!isset($totalarray['val']['t.' . $key])) { + $totalarray['val']['t.' . $key] = 0; + } + $totalarray['val']['t.' . $key] += $object->$key; + } + } + } + // Extra fields + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_print_fields.tpl.php'; + // Fields from hook + $parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray); + $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + // Action column + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + + print '' . "\n"; + + $i++; + } + + // Show total line + include DOL_DOCUMENT_ROOT . '/core/tpl/list_print_total.tpl.php'; + + // If no record found + if ($num == 0) { + $colspan = 1; + foreach ($arrayfields as $key => $val) { + if (!empty($val['checked'])) { + $colspan++; + } + } + print ''; + } + + + $db->free($resql); + + $parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); + $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + + print '
    '; + if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { + print $form->selectarray('search_' . $key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); + } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) { + print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', 'maxwidth125', 1); + } elseif (!preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + print ''; + } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + print '
    '; + print $form->selectDate($search[$key . '_dtstart'] ? $search[$key . '_dtstart'] : '', "search_" . $key . "_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); + print '
    '; + print '
    '; + print $form->selectDate($search[$key . '_dtend'] ? $search[$key . '_dtend'] : '', "search_" . $key . "_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); + print '
    '; + } + print '
    '; + $searchpicto = $form->showFilterButtons(); + print $searchpicto; + print '
    '; + if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + $selected = 0; + if (in_array($object->id, $arrayofselected)) { + $selected = 1; + } + print ''; + } + print '
    ' . $langs->trans("NoRecordFound") . '
    ' . "\n"; + print '
    ' . "\n"; + + print '
    ' . "\n"; + + if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { + $hidegeneratedfilelistifempty = 1; + if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { + $hidegeneratedfilelistifempty = 0; + } + + require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; + $formfile = new FormFile($db); + + // Show list of available documents + $urlsource = $_SERVER['PHP_SELF'] . '?sortfield=' . $sortfield . '&sortorder=' . $sortorder; + $urlsource .= str_replace('&', '&', $param); + + $filedir = $diroutputmassaction; + $genallowed = $permissiontoread; + $delallowed = $permissiontoadd; + + print $formfile->showdocuments('massfilesarea_hrm', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); + } + return array($arrayfields, $object, $action, $obj, $totalarray); +} + +// Part to create +if ($action == 'create') { + $object = new Position($db); + print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("Position")), '', 'object_' . $object->picto); + + print '
    '; + print ''; + print ''; + if ($backtopage) { + print ''; + } + + if ($backtopageforcancel) { + print ''; + } + + print dol_get_fiche_head(array(), ''); + + // Set some default values + //if (! GETPOSTISSET('fieldname')) $_POST['fieldname'] = 'myvalue'; + + print '' . "\n"; + + // Common attributes + include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php'; + + // Other attributes + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php'; + + print '
    ' . "\n"; + + print dol_get_fiche_end(); + + print '
    '; + + print ''; + print '  '; + print ''; // Cancel for create does not post form if we don't know the backtopage + print '
    '; + + print '
    '; + + //dol_set_focus('input[name="ref"]'); +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/hrm/position_agenda.php b/htdocs/hrm/position_agenda.php new file mode 100644 index 00000000000..670ec51304b --- /dev/null +++ b/htdocs/hrm/position_agenda.php @@ -0,0 +1,282 @@ + + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND + * + * 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 . + */ + +/** + * \file position_agenda.php + * \ingroup hrm + * \brief Tab of events on Position + */ + +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs +//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters +//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters +//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). +//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) +//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data +//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php +//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library +//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. +//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value +//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler +//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message +//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies +//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET +//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification + +// 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"); +} + +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/hrm/class/position.class.php'; +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_position.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; + + +// Load translation files required by the page +$langs->loadLangs(array("hrm", "other")); + +// Get parameters +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); +$action = GETPOST('action', 'aZ09'); +$cancel = GETPOST('cancel', 'aZ09'); +$backtopage = GETPOST('backtopage', 'alpha'); + +if (GETPOST('actioncode', 'array')) { + $actioncode = GETPOST('actioncode', 'array', 3); + if (!count($actioncode)) { + $actioncode = '0'; + } +} else { + $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); +} +$search_agenda_label = GETPOST('search_agenda_label'); + +$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$sortfield = GETPOST("sortfield", 'alpha'); +$sortorder = GETPOST("sortorder", 'alpha'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +if (empty($page) || $page == -1) { + $page = 0; +} // If $page is not defined, or '' or -1 +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (!$sortfield) { + $sortfield = 'a.datep,a.id'; +} +if (!$sortorder) { + $sortorder = 'DESC,DESC'; +} + +// Initialize technical objects +$object = new Position($db); +$extrafields = new ExtraFields($db); +$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('positionagenda', 'globalcard')); // Note that conf->hooks_modules contains array +// Fetch optionals attributes and labels +$extrafields->fetch_name_optionals_label($object->table_element); + +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +if ($id > 0 || !empty($ref)) { + $upload_dir = $conf->hrm->multidir_output[$object->entity]."/".$object->id; +} + +$permissiontoread = $user->rights->hrm->all->read; +$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php + +// Security check (enable the most restrictive one) +//if ($user->socid > 0) accessforbidden(); +//if ($user->socid > 0) $socid = $user->socid; +//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); +//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); +if (empty($conf->hrm->enabled)) accessforbidden(); +if (!$permissiontoread) accessforbidden(); + + +/* + * Actions + */ + +$parameters = array('id'=>$id); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + +if (empty($reshook)) { + // Cancel + if (GETPOST('cancel', 'alpha') && !empty($backtopage)) { + header("Location: ".$backtopage); + exit; + } + + // Purge search criteria + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers + $actioncode = ''; + $search_agenda_label = ''; + } +} + + + +/* + * View + */ + +$form = new Form($db); + +if ($object->id > 0) { + $title = $langs->trans("Agenda"); + //if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; + $help_url = 'EN:Module_Agenda_En'; + llxHeader('', $title, $help_url); + + if (!empty($conf->notification->enabled)) { + $langs->load("mails"); + } + $head = PositionCardPrepareHead($object); + + + print dol_get_fiche_head($head, 'agenda', $langs->trans("Agenda"), -1, $object->picto); + + // Object card + // ------------------------------------------------------------ + $linkback = ''.$langs->trans("BackToList").''; + + $morehtmlref = '
    '; + $u_position = new User(($db)); + $u_position->fetch($object->fk_user); + $morehtmlref .= $langs->trans('Employee').' : '.$u_position->getNomUrl(1); + $job = new Job($db); + $job->fetch($object->fk_job); + $morehtmlref .= '
    '.$langs->trans('Job').' : '.$job->getNomUrl(1); + $morehtmlref .= '
    '; + + + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref); + + print '
    '; + print '
    '; + + $object->info($object->id); + dol_print_object_info($object, 1); + + print '
    '; + + print dol_get_fiche_end(); + + + + // Actions buttons + + $objthirdparty = $object; + $objcon = new stdClass(); + + $out = '&origin='.urlencode($object->element.'@'.$object->module).'&originid='.urlencode($object->id); + $urlbacktopage = $_SERVER['PHP_SELF'].'?id='.$object->id; + $out .= '&backtopage='.urlencode($urlbacktopage); + $permok = $user->rights->agenda->myactions->create; + if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) { + //$out.='trans("AddAnAction"),'filenew'); + //$out.=""; + } + + + print '
    '; + + if (!empty($conf->agenda->enabled)) { + if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + print ''.$langs->trans("AddAction").''; + } else { + print ''.$langs->trans("AddAction").''; + } + } + + print '
    '; + + if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { + $param = '&id='.$object->id.'&socid='.$socid; + if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { + $param .= '&contextpage='.urlencode($contextpage); + } + if ($limit > 0 && $limit != $conf->liste_limit) { + $param .= '&limit='.urlencode($limit); + } + + + //print load_fiche_titre($langs->trans("ActionsOnPosition"), '', ''); + + // List of all actions + $filters = array(); + $filters['search_agenda_label'] = $search_agenda_label; + $object->fields['label']=array(); // Usefull to get only get agenda events linked to position (this object doesn't need label of ref field, but show_actions_done() needs it to work correctly) + + // TODO Replace this with same code than into list.php + show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, $object->module); + } +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/hrm/position_card.php b/htdocs/hrm/position_card.php new file mode 100644 index 00000000000..4538fbc98b2 --- /dev/null +++ b/htdocs/hrm/position_card.php @@ -0,0 +1,444 @@ + + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND + * + * 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 . + */ + +/** + * \file position_card.php + * \ingroup hrm + * \brief Page to create/edit/view position + */ + +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs +//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters +//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters +//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). +//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) +//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data +//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php +//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library +//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. +//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value +//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler +//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message +//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies +//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET +//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification + +// 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"); +} + +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; +require_once DOL_DOCUMENT_ROOT . '/hrm/class/position.class.php'; +require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; +require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_position.lib.php'; +//dol_include_once('/hrm/position.php'); + +$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... +$backtopage = GETPOST('backtopage', 'alpha'); +$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); +$id = GETPOST('id', 'int'); + +// Initialize technical objects +$form = new Form($db); +$object = new Position($db); +$res = $object->fetch($id); +if ($res < 0) { + dol_print_error($db, $object->error); +} + +$permissiontoread = $user->rights->hrm->all->read; +$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php +$permissiontodelete = $user->rights->hrm->all->delete; +$permissiondellink = $user->rights->hrm->all->write; // Used by the include of actions_dellink.inc.php +$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1] . '/position'; + +// Security check (enable the most restrictive one) +//if ($user->socid > 0) accessforbidden(); +//if ($user->socid > 0) $socid = $user->socid; +//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); +//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); +if (empty($conf->hrm->enabled)) accessforbidden(); +if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) accessforbidden(); + +$langs->loadLangs(array("hrm", "other")); + + + +// Get parameters +$id = GETPOST('id', 'int'); +$fk_job = GETPOST('fk_job', 'int'); + +$ref = GETPOST('ref', 'alpha'); +$action = GETPOST('action', 'aZ09'); +$confirm = GETPOST('confirm', 'alpha'); +$cancel = GETPOST('cancel', 'aZ09'); +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'positioncard'; // To manage different context of search +$backtopage = GETPOST('backtopage', 'alpha'); +$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); +// $lineid = GETPOST('lineid', 'int'); + +// Initialize technical objects +//$object = new Position($db); +//$res = $object->fetch($id); +/*if ($res < 0) { + dol_print_error($db, &$object->error); +}*/ + +$extrafields = new ExtraFields($db); + +$diroutputmassaction = $conf->hrm->dir_output . '/temp/massgeneration/' . $user->id; +$hookmanager->initHooks(array('positioncard', 'globalcard')); // Note that conf->hooks_modules contains array + +// Fetch optionals attributes and labels +$extrafields->fetch_name_optionals_label($object->table_element); + +$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); + +// Initialize array of search criterias +$search_all = GETPOST("search_all", 'alpha'); +$search = array(); +foreach ($object->fields as $key => $val) { + if (GETPOST('search_' . $key, 'alpha')) { + $search[$key] = GETPOST('search_' . $key, 'alpha'); + } +} + +if (empty($action) && empty($id) && empty($ref)) { + $action = 'view'; +} + +// Load object +include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. + + +/* + * Actions + */ + +$parameters = array(); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + +if (empty($reshook)) { + $error = 0; + + $backurlforlist = dol_buildpath('/hrm/position_list.php', 1); + + if (empty($backtopage) || ($cancel && empty($fk_job))) { + if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { + if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { + $backtopage = $backurlforlist; + } else { + $backtopage = dol_buildpath('/hrm/position_card.php', 1) . '?id=' . ($id > 0 ? $id : '__ID__'); + } + } + } + + $triggermodname = 'hrm_POSITION_MODIFY'; // Name of trigger action code to execute when we modify record + + // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen + include DOL_DOCUMENT_ROOT . '/core/actions_addupdatedelete.inc.php'; + + // Actions when linking object each other + include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; + + // Actions when printing a doc from card + include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php'; + + // Action to move up and down lines of object + //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; + + // Action to build doc + include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php'; + + if ($action == 'set_thirdparty' && $permissiontoadd) { + $object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, $triggermodname); + } + if ($action == 'classin' && $permissiontoadd) { + $object->setProject(GETPOST('projectid', 'int')); + } + + // Actions to send emails + $triggersendname = 'hrm_POSITION_SENTBYMAIL'; + $autocopy = 'MAIN_MAIL_AUTOCOPY_POSITION_TO'; + $trackid = 'position' . $object->id; + include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php'; +} + +DisplayPositionCard($object); + +/** + * Show the card of a position + * + * @param Position $object Position object + */ +function DisplayPositionCard(&$object) +{ + + global $user, $langs, $db, $conf, $extrafields, $hookmanager, $action, $permissiontoadd, $permissiontodelete; + + $id = $object->id; + + /* + * View + * + * Put here all code to build page + */ + + $form = new Form($db); + $formfile = new FormFile($db); + $formproject = new FormProjets($db); + + $title = $langs->trans("Position"); + $help_url = ''; + llxHeader('', $title, $help_url); + + + // Part to edit record + if (($id || $ref) && $action == 'edit') { + print load_fiche_titre($langs->trans("Position"), '', 'object_' . $object->picto); + + print '
    '; + print ''; + print ''; + print ''; + + if ($backtopage) { + print ''; + } + if ($backtopageforcancel) { + print ''; + } + + print dol_get_fiche_head(); + + print '' . "\n"; + + // Common attributes + include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php'; + + // Other attributes + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php'; + + print '
    '; + + print dol_get_fiche_end(); + + print '
    '; + print '   '; + print '
    '; + + print '
    '; + } + + + // Part to show record + if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) { + $res = $object->fetch_optionals(); + + + $head = PositionCardPrepareHead($object); + print dol_get_fiche_head($head, 'position', $langs->trans("Workstation"), -1, $object->picto); + + $formconfirm = ''; + + // Confirmation to delete + if ($action == 'delete') { + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeletePosition'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1); + } + + // Call Hook formConfirm + $parameters = array('formConfirm' => $formconfirm/*, 'lineid' => $lineid*/); + $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + if (empty($reshook)) { + $formconfirm .= $hookmanager->resPrint; + } elseif ($reshook > 0) { + $formconfirm = $hookmanager->resPrint; + } + + // Print form confirm + print $formconfirm; + + + // Object card + // ------------------------------------------------------------ + // $linkback = '' . $langs->trans("BackToList") . ''; + $linkback = '' . $langs->trans("BackToList") . ''; + + $morehtmlref = '
    '; + $u_position = new User(($db)); + $u_position->fetch($object->fk_user); + $morehtmlref .= $langs->trans('Employee').' : '.$u_position->getNomUrl(1); + $job = new Job($db); + $job->fetch($object->fk_job); + $morehtmlref .= '
    '.$langs->trans('Job').' : '.$job->getNomUrl(1); + $morehtmlref .= '
    '; + + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref); + + + print '
    '; + print '
    '; + print '
    '; + print '' . "\n"; + + // Common attributes + //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field + //unset($object->fields['fk_project']); // Hide field already shown in banner + //unset($object->fields['fk_soc']); // Hide field already shown in banner + $object->fields['fk_user']['visible']=0; // Already in banner + $object->fields['fk_job']['visible']=0; // Already in banner + include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php'; + + // Other attributes. Fields from hook formObjectOptions and Extrafields. + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; + + print '
    '; + print '
    '; + print '
    '; + + print '
    '; + + print dol_get_fiche_end(); + + /* + * Action bar + */ + print '
    '; + + $parameters = array(); + $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + + + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd); + + // Delete (need delete permission, or if draft, just need create/modify permission) + print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete); + } +} + +//if ($action != 'presend') { +// $formfile = new FormFile($db); +// print '
    '; +// +// if (empty($conf->global->SOCIETE_DISABLE_BUILDDOC)) { +// print ''; // ancre +// +// /* +// * Generated documents +// */ +// $filedir = $conf->societe->multidir_output[$object->entity].'/'.$object->id; +// $urlsource = $_SERVER["PHP_SELF"]."?socid=".$object->id; +// $genallowed = $user->rights->societe->lire; +// $delallowed = $user->rights->societe->creer; +// +// print $formfile->showdocuments('company', $object->id, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 0, 0, 0, 28, 0, 'entity='.$object->entity, 0, '', $object->default_lang); +// } +// +// +// print '
    '; +// +// $MAXEVENT = 10; +// +// $morehtmlright = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id); +// +// // List of actions on element +// include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; +// $formactions = new FormActions($db); +// $somethingshown = $formactions->showactions($object, '', $object->id, 1, '', $MAXEVENT, '', $morehtmlright); // Show all action for thirdparty +// +// print '
    '; +//} + + +print '' . "\n"; +print '
    ' . "\n"; + +print '' . "\n"; + + +if ($action !== 'edit' && $action !== 'create') { + print '
    '; + + // Show links to link elements + $linktoelem = $form->showLinkToObjectBlock($object, null, array('position')); + $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); + + + print '
    '; + + $MAXEVENT = 10; + + $morehtmlright = ''; + $morehtmlright .= $langs->trans("SeeAll"); + $morehtmlright .= ''; + // List of actions on element + include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; + $formactions = new FormActions($db); + $somethingshown = $formactions->showactions($object, $object->element . '@' . $object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlright); + + print '
    '; +} + + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/hrm/position_contact.php b/htdocs/hrm/position_contact.php new file mode 100644 index 00000000000..76ec4f0b349 --- /dev/null +++ b/htdocs/hrm/position_contact.php @@ -0,0 +1,220 @@ + + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND + * + * 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 . + */ + +/** + * \file position_contact.php + * \ingroup hrm + * \brief Tab for contacts linked to Position + */ + +// 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"); +} + +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +dol_include_once('/hrm/class/position.class.php'); +dol_include_once('/hrm/lib/hrm_position.lib.php'); + +// Load translation files required by the page +$langs->loadLangs(array("hrm", "companies", "other", "mails")); + +$id = (GETPOST('id') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility +$ref = GETPOST('ref', 'alpha'); +$lineid = GETPOST('lineid', 'int'); +$socid = GETPOST('socid', 'int'); +$action = GETPOST('action', 'aZ09'); + +// Initialize technical objects +$object = new Position($db); +$extrafields = new ExtraFields($db); +$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('positioncontact', 'globalcard')); // Note that conf->hooks_modules contains array +// Fetch optionals attributes and labels +$extrafields->fetch_name_optionals_label($object->table_element); + +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals + +$permission = $user->rights->hrm->position->write; + +// Security check (enable the most restrictive one) +//if ($user->socid > 0) accessforbidden(); +//if ($user->socid > 0) $socid = $user->socid; +//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); +//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); +//if (empty($conf->hrm->enabled)) accessforbidden(); +//if (!$permissiontoread) accessforbidden(); + + +/* + * Add a new contact + */ + +if ($action == 'addcontact' && $permission) { + $contactid = (GETPOST('userid') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int')); + $typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type')); + $result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09')); + + if ($result >= 0) { + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit; + } else { + if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { + $langs->load("errors"); + setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors'); + } else { + setEventMessages($object->error, $object->errors, 'errors'); + } + } +} elseif ($action == 'swapstatut' && $permission) { + // Toggle the status of a contact + $result = $object->swapContactStatus(GETPOST('ligne', 'int')); +} elseif ($action == 'deletecontact' && $permission) { + // Deletes a contact + $result = $object->delete_contact($lineid); + + if ($result >= 0) { + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit; + } else { + dol_print_error($db); + } +} + + +/* + * View + */ + +$title = $langs->trans('Position')." - ".$langs->trans('ContactsAddresses'); +$help_url = ''; +//$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; +llxHeader('', $title, $help_url); + +$form = new Form($db); +$formcompany = new FormCompany($db); +$contactstatic = new Contact($db); +$userstatic = new User($db); + + +/* *************************************************************************** */ +/* */ +/* View and edit mode */ +/* */ +/* *************************************************************************** */ + +if ($object->id) { + /* + * Show tabs + */ + $head = PositionCardPrepareHead($object); + + print dol_get_fiche_head($head, 'contact', '', -1, $object->picto); + + $linkback = ''.$langs->trans("BackToList").''; + + $morehtmlref = '
    '; + /* + // Ref customer + $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); + $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); + // Thirdparty + $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); + // Project + if (! empty($conf->projet->enabled)) + { + $langs->load("projects"); + $morehtmlref.='
    '.$langs->trans('Project') . ' '; + if ($permissiontoadd) + { + if ($action != 'classify') + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + $morehtmlref.=' : '; + if ($action == 'classify') { + //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); + $morehtmlref.='
    '; + $morehtmlref.=''; + $morehtmlref.=''; + $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.=''; + $morehtmlref.='
    '; + } else { + $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + } + } else { + if (! empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref .= ': '.$proj->getNomUrl(); + } else { + $morehtmlref .= ''; + } + } + }*/ + $morehtmlref .= '
    '; + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); + + print dol_get_fiche_end(); + + print '
    '; + + // Contacts lines (modules that overwrite templates must declare this into descriptor) + $dirtpls = array_merge($conf->modules_parts['tpl'], array('/core/tpl')); + foreach ($dirtpls as $reldir) { + $res = @include dol_buildpath($reldir.'/contacts.tpl.php'); + if ($res) { + break; + } + } +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/hrm/position_document.php b/htdocs/hrm/position_document.php new file mode 100644 index 00000000000..1ae41c193ab --- /dev/null +++ b/htdocs/hrm/position_document.php @@ -0,0 +1,223 @@ + + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND + * + * 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 . + */ + +/** + * \file position_document.php + * \ingroup hrm + * \brief Tab for documents linked to Position + */ + +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs +//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters +//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters +//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). +//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) +//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data +//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php +//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library +//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. +//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value +//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler +//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message +//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies +//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET +//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification + +// 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"); +} + +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +require_once DOL_DOCUMENT_ROOT . '/hrm/class/position.class.php'; +require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_position.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; + +// Load translation files required by the page +$langs->loadLangs(array("hrm", "companies", "other", "mails")); + + +$action = GETPOST('action', 'aZ09'); +$confirm = GETPOST('confirm'); +$id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int')); +$ref = GETPOST('ref', 'alpha'); + +// Get parameters +$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$sortfield = GETPOST("sortfield", 'alpha'); +$sortorder = GETPOST("sortorder", 'alpha'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +if (empty($page) || $page == -1) { + $page = 0; +} // If $page is not defined, or '' or -1 +$offset = $liste_limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (!$sortorder) { + $sortorder = "ASC"; +} +if (!$sortfield) { + $sortfield = "name"; +} +//if (! $sortfield) $sortfield="position_name"; + +// Initialize technical objects +$object = new Position($db); +$extrafields = new ExtraFields($db); +$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('positiondocument', 'globalcard')); // Note that conf->hooks_modules contains array +// Fetch optionals attributes and labels +$extrafields->fetch_name_optionals_label($object->table_element); + +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals + +if ($id > 0 || !empty($ref)) { + $upload_dir = $conf->hrm->multidir_output[$object->entity ? $object->entity : $conf->entity]."/position/".get_exdir(0, 0, 0, 1, $object); +} + +$permissiontoread = $user->rights->hrm->all->read; +$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php + +// Security check (enable the most restrictive one) +//if ($user->socid > 0) accessforbidden(); +//if ($user->socid > 0) $socid = $user->socid; +//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); +//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); +if (empty($conf->hrm->enabled)) accessforbidden(); +if (!$permissiontoread) accessforbidden(); + + +/* + * Actions + */ + +include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; + + +/* + * View + */ + +$form = new Form($db); + +$title = $langs->trans("Position").' - '.$langs->trans("Files"); +$help_url = ''; +//$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; +llxHeader('', $title, $help_url); + +if ($object->id) { + /* + * Show tabs + */ + $head = PositionCardPrepareHead($object); + + print dol_get_fiche_head($head, 'document', $langs->trans("Document"), -1, $object->picto); + + + // Build file list + $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1); + $totalsize = 0; + foreach ($filearray as $key => $file) { + $totalsize += $file['size']; + } + + // Object card + // ------------------------------------------------------------ + $linkback = ''.$langs->trans("BackToList").''; + + $morehtmlref = '
    '; + $u_position = new User(($db)); + $u_position->fetch($object->fk_user); + $morehtmlref .= $langs->trans('Employee').' : '.$u_position->getNomUrl(1); + $job = new Job($db); + $job->fetch($object->fk_job); + $morehtmlref .= '
    '.$langs->trans('Job').' : '.$job->getNomUrl(1); + $morehtmlref .= '
    '; + + + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref); + print '
    '; + + print '
    '; + print ''; + + // Number of files + print ''; + + // Total size + print ''; + + print '
    '.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
    '.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
    '; + + print '
    '; + + print dol_get_fiche_end(); + + $modulepart = 'hrm'; + $permtoedit = $permissiontoadd; + $param = '&id='.$object->id; + + //$relativepathwithnofile='position/' . dol_sanitizeFileName($object->id).'/'; + $relativepathwithnofile = 'position/'.dol_sanitizeFileName($object->ref).'/'; + + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; +} else { + accessforbidden('', 0, 1); +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/hrm/position_list.php b/htdocs/hrm/position_list.php new file mode 100644 index 00000000000..fc40e58441c --- /dev/null +++ b/htdocs/hrm/position_list.php @@ -0,0 +1,732 @@ + + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND + * + * 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 . + */ + +/** + * \file position_list.php + * \ingroup hrm + * \brief List page for position + */ + +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs +//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters +//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters +//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). +//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) +//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data +//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php +//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library +//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. +//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value +//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler +//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message +//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies +//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET +//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification + +// 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"); +} + +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; + +// load hrm libraries +require_once __DIR__.'/class/position.class.php'; + +// for other modules +//dol_include_once('/othermodule/class/otherobject.class.php'); + +// Load translation files required by the page +$langs->loadLangs(array("hrm", "other")); + +$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... +$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) +$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation +$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button +$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'positionlist'; // To manage different context of search +$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') + +$id = GETPOST('id', 'int'); + +// Load variable for pagination +$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$sortfield = GETPOST('sortfield', 'aZ09comma'); +$sortorder = GETPOST('sortorder', 'aZ09comma'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { + // If $page is not defined, or '' or -1 or if we click on clear filters + $page = 0; +} +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; + +// Initialize technical objects +$object = new Position($db); +$extrafields = new ExtraFields($db); +$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('positionlist')); // Note that conf->hooks_modules contains array + +// Fetch optionals attributes and labels +$extrafields->fetch_name_optionals_label($object->table_element); +//$extrafields->fetch_name_optionals_label($object->table_element_line); + +$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); + +// Default sort order (if not yet defined by previous GETPOST) +if (!$sortfield) { + reset($object->fields); // Reset is required to avoid key() to return null. + $sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition. +} +if (!$sortorder) { + $sortorder = "ASC"; +} + +// Initialize array of search criterias +$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); +$search = array(); +foreach ($object->fields as $key => $val) { + if (GETPOST('search_'.$key, 'alpha') !== '') { + $search[$key] = GETPOST('search_'.$key, 'alpha'); + } + if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); + } +} + +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array(); +foreach ($object->fields as $key => $val) { + if (!empty($val['searchall'])) { + $fieldstosearchall['t.'.$key] = $val['label']; + } +} + +// Definition of array of fields for columns +$arrayfields = array(); +foreach ($object->fields as $key => $val) { + // If $val['visible']==0, then we never show the field + if (!empty($val['visible'])) { + $visible = (int) dol_eval($val['visible'], 1); + $arrayfields['t.'.$key] = array( + 'label'=>$val['label'], + 'checked'=>(($visible < 0) ? 0 : 1), + 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)), + 'position'=>$val['position'], + 'help'=> isset($val['help']) ? $val['help'] : '' + ); + } +} +// Extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; + +$object->fields = dol_sort_array($object->fields, 'position'); +$arrayfields = dol_sort_array($arrayfields, 'position'); + +$permissiontoread = $user->rights->hrm->all->read; +$permissiontoadd = $user->rights->hrm->all->write; +$permissiontodelete = $user->rights->hrm->all->delete; + +// Security check +if (empty($conf->hrm->enabled)) { + accessforbidden('Module not enabled'); +} + +// Security check (enable the most restrictive one) +if ($user->socid > 0) accessforbidden(); +//if ($user->socid > 0) accessforbidden(); +//$socid = 0; if ($user->socid > 0) $socid = $user->socid; +//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); +//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); +if (empty($conf->hrm->enabled)) accessforbidden(); +if (!$permissiontoread) accessforbidden(); + + + +/* + * Actions + */ + +if (GETPOST('cancel', 'alpha')) { + $action = 'list'; + $massaction = ''; +} +if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { + $massaction = ''; +} + +$parameters = array(); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + +if (empty($reshook)) { + // Selection of new fields + include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; + + // Purge search criteria + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers + foreach ($object->fields as $key => $val) { + $search[$key] = ''; + if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + $search[$key.'_dtstart'] = ''; + $search[$key.'_dtend'] = ''; + } + } + $toselect = array(); + $search_array_options = array(); + } + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha') + || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) { + $massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation + } + + // Mass actions + $objectclass = 'Position'; + $objectlabel = 'Position'; + $uploaddir = $conf->hrm->dir_output; + include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; +} + + + +/* + * View + */ + +$form = new Form($db); + +$now = dol_now(); + +//$help_url="EN:Module_Position|FR:Module_Position_FR|ES:Módulo_Position"; +$help_url = ''; +$title = $langs->trans("ListOf", $langs->trans('Positions')); +$morejs = array(); +$morecss = array(); + + +// Build and execute select +// -------------------------------------------------------------------- +$sql = 'SELECT '; +$sql .= $object->getFieldList('t'); +// Add fields from extrafields +if (!empty($extrafields->attributes[$object->table_element]['label'])) { + foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key.', ' : ''); + } +} +// Add fields from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= preg_replace('/^,/', '', $hookmanager->resPrint); +$sql = preg_replace('/,\s*$/', '', $sql); +$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; +if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; +} +// Add table from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; +if ($object->ismultientitymanaged == 1) { + $sql .= " WHERE t.entity IN (".getEntity($object->element).")"; +} else { + $sql .= " WHERE 1 = 1"; +} +foreach ($search as $key => $val) { + if (array_key_exists($key, $object->fields)) { + if ($key == 'status' && $search[$key] == -1) { + continue; + } + $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); + if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) { + if ($search[$key] == '-1' || $search[$key] === '0') { + $search[$key] = ''; + } + $mode_search = 2; + } + if ($search[$key] != '') { + $sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search)); + } + } else { + if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') { + $columnName=preg_replace('/(_dtstart|_dtend)$/', '', $key); + if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) { + if (preg_match('/_dtstart$/', $key)) { + $sql .= " AND t." . $columnName . " >= '" . $db->idate($search[$key]) . "'"; + } + if (preg_match('/_dtend$/', $key)) { + $sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'"; + } + } + } + } +} +if ($search_all) { + $sql .= natural_search(array_keys($fieldstosearchall), $search_all); +} +//$sql.= dolSqlDateFilter("t.field", $search_xxxday, $search_xxxmonth, $search_xxxyear); +// Add where from extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; +// Add where from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; + +/* If a group by is required +$sql .= " GROUP BY "; +foreach($object->fields as $key => $val) { + $sql .= 't.'.$key.', '; +} +// Add fields from extrafields +if (!empty($extrafields->attributes[$object->table_element]['label'])) { + foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : ''); + } +} +// Add where from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; +$sql = preg_replace('/,\s*$/', '', $sql); +*/ + +$sql .= $db->order($sortfield, $sortorder); + +// Count total nb of records +$nbtotalofrecords = ''; +if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + $resql = $db->query($sql); + $nbtotalofrecords = $db->num_rows($resql); + if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0 + $page = 0; + $offset = 0; + } +} +// if total of record found is smaller than limit, no need to do paging and to restart another select with limits set. +if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit))) { + $num = $nbtotalofrecords; +} else { + if ($limit) { + $sql .= $db->plimit($limit + 1, $offset); + } + + $resql = $db->query($sql); + if (!$resql) { + dol_print_error($db); + exit; + } + + $num = $db->num_rows($resql); +} + +// Direct jump if only one record found +if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) { + $obj = $db->fetch_object($resql); + $id = $obj->rowid; + header("Location: ".dol_buildpath('/hrm/position.php', 1).'?id='.$id); + exit; +} + + +// Output page +// -------------------------------------------------------------------- + +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', ''); + +// Example : Adding jquery code +// print ''; + +$arrayofselected = is_array($toselect) ? $toselect : array(); + +$param = ''; +if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { + $param .= '&contextpage='.urlencode($contextpage); +} +if ($limit > 0 && $limit != $conf->liste_limit) { + $param .= '&limit='.urlencode($limit); +} + +foreach ($search as $key => $val) { + if (is_array($search[$key]) && count($search[$key])) { + foreach ($search[$key] as $skey) { + $param .= '&search_'.$key.'[]='.urlencode($skey); + } + } else { + $param .= '&search_'.$key.'='.urlencode($search[$key]); + } +} +if ($optioncss != '') { + $param .= '&optioncss='.urlencode($optioncss); +} +// Add $param from extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; +// Add $param from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook +$param .= $hookmanager->resPrint; + +// List of mass actions available +$arrayofmassactions = array( + //'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"), + //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), + //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), + //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), +); +if ($permissiontodelete) { + $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); +} +if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { + $arrayofmassactions = array(); +} +$massactionbutton = $form->selectMassAction('', $arrayofmassactions); + +print '
    '."\n"; +if ($optioncss != '') { + print ''; +} +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; + +$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/hrm/position.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); + +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); + +// Add code for pre mass action (confirmation or email presend form) +$topicmail = "SendPositionRef"; +$modelmail = "position"; +$objecttmp = new Position($db); +$trackid = 'xxxx'.$object->id; +include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; + +if ($search_all) { + foreach ($fieldstosearchall as $key => $val) { + $fieldstosearchall[$key] = $langs->trans($val); + } + print '
    '.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'
    '; +} + +$moreforfilter = ''; +/*$moreforfilter.='
    '; +$moreforfilter.= $langs->trans('MyFilter') . ': '; +$moreforfilter.= '
    ';*/ + +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook +if (empty($reshook)) { + $moreforfilter .= $hookmanager->resPrint; +} else { + $moreforfilter = $hookmanager->resPrint; +} + +if (!empty($moreforfilter)) { + print '
    '; + print $moreforfilter; + print '
    '; +} + +$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields +$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); + +print '
    '; // You can use div-table-responsive-no-min if you dont need reserved height for your table +print ''."\n"; + + +// Fields title search +// -------------------------------------------------------------------- +print ''; +foreach ($object->fields as $key => $val) { + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); + if ($key == 'status') { + $cssforfield .= ($cssforfield ? ' ' : '').'center'; + } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '').'center'; + } elseif (in_array($val['type'], array('timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; + } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { + $cssforfield .= ($cssforfield ? ' ' : '').'right'; + } + if (!empty($arrayfields['t.'.$key]['checked'])) { + print ''; + } +} +// Extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; + +// Fields from hook +$parameters = array('arrayfields'=>$arrayfields); +$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; +// Action column +print ''; +print ''."\n"; + + +// Fields title label +// -------------------------------------------------------------------- +print ''; +foreach ($object->fields as $key => $val) { + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); + if ($key == 'status') { + $cssforfield .= ($cssforfield ? ' ' : '').'center'; + } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '').'center'; + } elseif (in_array($val['type'], array('timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; + } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { + $cssforfield .= ($cssforfield ? ' ' : '').'right'; + } + if (!empty($arrayfields['t.'.$key]['checked'])) { + print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n"; + } +} +// Extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; +// Hook fields +$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); +$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; +// Action column +print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; +print ''."\n"; + + +// Detect if we need a fetch on each output line +$needToFetchEachLine = 0; +if (isset($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { + foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) { + if (preg_match('/\$object/', $val)) { + $needToFetchEachLine++; // There is at least one compute field that use $object + } + } +} + + +// Loop on record +// -------------------------------------------------------------------- +$i = 0; +$totalarray = array(); +$totalarray['nbfield'] = 0; +while ($i < ($limit ? min($num, $limit) : $num)) { + $obj = $db->fetch_object($resql); + if (empty($obj)) { + break; // Should not happen + } + + // Store properties in $object + $object->setVarsFromFetchObj($obj); + + // Show here line of result + print ''; + foreach ($object->fields as $key => $val) { + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); + if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '').'center'; + } elseif ($key == 'status') { + $cssforfield .= ($cssforfield ? ' ' : '').'center'; + } + + if (in_array($val['type'], array('timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; + } elseif ($key == 'ref') { + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; + } + + if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) { + $cssforfield .= ($cssforfield ? ' ' : '').'right'; + } + //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; + + if (!empty($arrayfields['t.'.$key]['checked'])) { + print ''; + if ($key == 'status') { + print $object->getLibStatut(5); + } elseif ($key == 'rowid') { + print $object->getNomUrl(1); + } else { + print $object->showOutputField($val, $key, $object->$key, ''); + } + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + if (!empty($val['isameasure'])) { + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; + } + if (!isset($totalarray['val'])) { + $totalarray['val'] = array(); + } + if (!isset($totalarray['val']['t.'.$key])) { + $totalarray['val']['t.'.$key] = 0; + } + $totalarray['val']['t.'.$key] += $object->$key; + } + } + } + // Extra fields + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; + // Fields from hook + $parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + // Action column + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + + print ''."\n"; + + $i++; +} + +// Show total line +include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; + +// If no record found +if ($num == 0) { + $colspan = 1; + foreach ($arrayfields as $key => $val) { + if (!empty($val['checked'])) { + $colspan++; + } + } + print ''; +} + + +$db->free($resql); + +$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); +$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; + +print '
    '; + if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { + print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); + } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) { + print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', 'maxwidth125', 1); + } elseif (!preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + print ''; + } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + print '
    '; + print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); + print '
    '; + print '
    '; + print $form->selectDate($search[$key.'_dtend'] ? $search[$key.'_dtend'] : '', "search_".$key."_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); + print '
    '; + } + print '
    '; +$searchpicto = $form->showFilterButtons(); +print $searchpicto; +print '
    '; + if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + $selected = 0; + if (in_array($object->id, $arrayofselected)) { + $selected = 1; + } + print ''; + } + print '
    '.$langs->trans("NoRecordFound").'
    '."\n"; +print '
    '."\n"; + +print '
    '."\n"; + +if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { + $hidegeneratedfilelistifempty = 1; + if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { + $hidegeneratedfilelistifempty = 0; + } + + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; + $formfile = new FormFile($db); + + // Show list of available documents + $urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; + $urlsource .= str_replace('&', '&', $param); + + $filedir = $diroutputmassaction; + $genallowed = $permissiontoread; + $delallowed = $permissiontoadd; + + print $formfile->showdocuments('massfilesarea_hrm', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/hrm/position_note.php b/htdocs/hrm/position_note.php new file mode 100644 index 00000000000..81548761326 --- /dev/null +++ b/htdocs/hrm/position_note.php @@ -0,0 +1,183 @@ + + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND + * + * 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 . + */ + +/** + * \file position_note.php + * \ingroup hrm + * \ingroup hrm + * \brief Tab for notes on Position + */ + +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs +//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters +//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters +//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). +//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) +//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data +//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php +//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library +//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. +//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value +//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler +//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message +//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies +//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET +//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification + +// 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"); +} + +require_once DOL_DOCUMENT_ROOT . '/hrm/class/position.class.php'; +require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_position.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';; + +// Load translation files required by the page +$langs->loadLangs(array("hrm", "companies")); + +// Get parameters +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); +$action = GETPOST('action', 'aZ09'); +$cancel = GETPOST('cancel', 'aZ09'); +$backtopage = GETPOST('backtopage', 'alpha'); + +// Initialize technical objects +$object = new Position($db); +$extrafields = new ExtraFields($db); +$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('positionnote', 'globalcard')); // Note that conf->hooks_modules contains array +// Fetch optionals attributes and labels +$extrafields->fetch_name_optionals_label($object->table_element); + +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +if ($id > 0 || !empty($ref)) { + $upload_dir = $conf->hrm->multidir_output[$object->entity]."/".$object->id; +} + +$permissionnote = $user->rights->hrm->all->write; +$permissiontoread = $user->rights->hrm->all->read; // Used by the include of actions_addupdatedelete.inc.php + +// Security check (enable the most restrictive one) +//if ($user->socid > 0) accessforbidden(); +//if ($user->socid > 0) $socid = $user->socid; +//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); +//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); +if (empty($conf->hrm->enabled)) accessforbidden(); +if (!$permissiontoread) accessforbidden(); + + +/* + * Actions + */ + +$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} +if (empty($reshook)) { + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once +} + + +/* + * View + */ + +$form = new Form($db); + +//$help_url='EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes'; +$help_url = ''; +llxHeader('', $langs->trans('Position'), $help_url); + +if ($id > 0 || !empty($ref)) { + $object->fetch_thirdparty(); + + $head = PositionCardPrepareHead($object); + + print dol_get_fiche_head($head, 'note', $langs->trans("Notes"), -1, $object->picto); + + // Object card + // ------------------------------------------------------------ + $linkback = ''.$langs->trans("BackToList").''; + + $morehtmlref = '
    '; + $u_position = new User(($db)); + $u_position->fetch($object->fk_user); + $morehtmlref .= $langs->trans('Employee').' : '.$u_position->getNomUrl(1); + $job = new Job($db); + $job->fetch($object->fk_job); + $morehtmlref .= '
    '.$langs->trans('Job').' : '.$job->getNomUrl(1); + $morehtmlref .= '
    '; + + + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref); + + + print '
    '; + 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/hrm/skill_agenda.php b/htdocs/hrm/skill_agenda.php new file mode 100644 index 00000000000..7fbcfe78369 --- /dev/null +++ b/htdocs/hrm/skill_agenda.php @@ -0,0 +1,275 @@ + + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND + * + * 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 . + */ + +/** + * \file skill_agenda.php + * \ingroup hrm + * \brief Tab of events on skill + */ + +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs +//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters +//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters +//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). +//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) +//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data +//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php +//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library +//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. +//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value +//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler +//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message +//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies +//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET +//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification + +// 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"); +} + +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +dol_include_once('/hrm/class/skill.class.php'); +dol_include_once('/hrm/lib/hrm_skill.lib.php'); + + +// Load translation files required by the page +$langs->loadLangs(array("hrm", "other")); + +// Get parameters +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); +$action = GETPOST('action', 'aZ09'); +$cancel = GETPOST('cancel', 'aZ09'); +$backtopage = GETPOST('backtopage', 'alpha'); + +if (GETPOST('actioncode', 'array')) { + $actioncode = GETPOST('actioncode', 'array', 3); + if (!count($actioncode)) { + $actioncode = '0'; + } +} else { + $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); +} +$search_agenda_label = GETPOST('search_agenda_label'); + +$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$sortfield = GETPOST("sortfield", 'alpha'); +$sortorder = GETPOST("sortorder", 'alpha'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +if (empty($page) || $page == -1) { + $page = 0; +} // If $page is not defined, or '' or -1 +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (!$sortfield) { + $sortfield = 'a.datep,a.id'; +} +if (!$sortorder) { + $sortorder = 'DESC,DESC'; +} + +// Initialize technical objects +$object = new Skill($db); +$extrafields = new ExtraFields($db); +$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('skillagenda', 'globalcard')); // Note that conf->hooks_modules contains array +// Fetch optionals attributes and labels +$extrafields->fetch_name_optionals_label($object->table_element); + +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +if ($id > 0 || !empty($ref)) { + $upload_dir = $conf->hrm->multidir_output[$object->entity]."/".$object->id; +} + +$permissiontoread = $user->rights->hrm->all->read; +$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php + +// Security check (enable the most restrictive one) +//if ($user->socid > 0) accessforbidden(); +//if ($user->socid > 0) $socid = $user->socid; +//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); +//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); +if (empty($conf->hrm->enabled)) accessforbidden(); +if (!$permissiontoread) accessforbidden(); + + +/* + * Actions + */ + +$parameters = array('id'=>$id); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + +if (empty($reshook)) { + // Cancel + if (GETPOST('cancel', 'alpha') && !empty($backtopage)) { + header("Location: ".$backtopage); + exit; + } + + // Purge search criteria + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers + $actioncode = ''; + $search_agenda_label = ''; + } +} + + + +/* + * View + */ + +$form = new Form($db); + +if ($object->id > 0) { + $title = $langs->trans("Agenda"); + //if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; + $help_url = 'EN:Module_Agenda_En'; + llxHeader('', $title, $help_url); + + if (!empty($conf->notification->enabled)) { + $langs->load("mails"); + } + $head = skillPrepareHead($object); + + + print dol_get_fiche_head($head, 'agenda', $langs->trans("Agenda"), -1, $object->picto); + + // Object card + // ------------------------------------------------------------ + $linkback = ''.$langs->trans("BackToList").''; + + $morehtmlref = '
    '; + $morehtmlref.= $object->label; + $morehtmlref .= '
    '; + + + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref); + + print '
    '; + print '
    '; + + $object->info($object->id); + dol_print_object_info($object, 1); + + print '
    '; + + print dol_get_fiche_end(); + + + + // Actions buttons + + $objthirdparty = $object; + $objcon = new stdClass(); + + $out = '&origin='.urlencode($object->element.'@'.$object->module).'&originid='.urlencode($object->id); + $urlbacktopage = $_SERVER['PHP_SELF'].'?id='.$object->id; + $out .= '&backtopage='.urlencode($urlbacktopage); + $permok = $user->rights->agenda->myactions->create; + if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) { + //$out.='trans("AddAnAction"),'filenew'); + //$out.=""; + } + + + print '
    '; + + if (!empty($conf->agenda->enabled)) { + if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + print ''.$langs->trans("AddAction").''; + } else { + print ''.$langs->trans("AddAction").''; + } + } + + print '
    '; + + if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { + $param = '&id='.$object->id.'&socid='.$socid; + if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { + $param .= '&contextpage='.urlencode($contextpage); + } + if ($limit > 0 && $limit != $conf->liste_limit) { + $param .= '&limit='.urlencode($limit); + } + + + //print load_fiche_titre($langs->trans("ActionsOnskill"), '', ''); + + // List of all actions + $filters = array(); + $filters['search_agenda_label'] = $search_agenda_label; + + // TODO Replace this with same code than into list.php + show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, $object->module); + } +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/hrm/skill_card.php b/htdocs/hrm/skill_card.php new file mode 100644 index 00000000000..d577605c6fb --- /dev/null +++ b/htdocs/hrm/skill_card.php @@ -0,0 +1,909 @@ + + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND + * + * 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 . + */ + +/** + * \file skill_card.php + * \ingroup hrm + * \brief Page to create/edit/view skill + */ + +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs +//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters +//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters +//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). +//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) +//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data +//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php +//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library +//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. +//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value +//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler +//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message +//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies +//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET +//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification + +// 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"); +} + +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; +dol_include_once('/hrm/class/skill.class.php'); +dol_include_once('/hrm/lib/hrm_skill.lib.php'); + + +// Load translation files required by the page +$langs->loadLangs(array("hrm", "other")); + +// Get parameters +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); +$action = GETPOST('action', 'aZ09'); +$confirm = GETPOST('confirm', 'alpha'); +$cancel = GETPOST('cancel', 'aZ09'); +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'skillcard'; // To manage different context of search +$backtopage = GETPOST('backtopage', 'alpha'); +$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); +//$lineid = GETPOST('lineid', 'int'); + +// Initialize technical objects +$object = new Skill($db); +//$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('skillcard', 'globalcard')); // Note that conf->hooks_modules contains array + +// Initialize array of search criterias +$search_all = GETPOST("search_all", 'alpha'); +$search = array(); +foreach ($object->fields as $key => $val) { + if (GETPOST('search_' . $key, 'alpha')) { + $search[$key] = GETPOST('search_' . $key, 'alpha'); + } +} + +if (empty($action) && empty($id) && empty($ref)) { + $action = 'view'; +} + +// Load object +include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. + + +$permissiontoread = $user->rights->hrm->all->read; +$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php +$permissiontodelete = $user->rights->hrm->all->delete; +$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1] . '/skill'; + +// Security check (enable the most restrictive one) +//if ($user->socid > 0) accessforbidden(); +//if ($user->socid > 0) $socid = $user->socid; +//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); +//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); +if (empty($conf->hrm->enabled)) accessforbidden(); +if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) accessforbidden(); + + +/* + * Actions + */ + +$parameters = array(); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + +if (empty($reshook)) { + $error = 0; + + $backurlforlist = dol_buildpath('/hrm/skill_list.php', 1); + + if (empty($backtopage) || ($cancel && empty($id))) { + if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { + if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { + $backtopage = $backurlforlist; + } else { + $backtopage = dol_buildpath('/hrm/skill_card.php', 1) . '?id=' . ($id > 0 ? $id : '__ID__'); + } + } + } + + $triggermodname = 'hrm_SKILL_MODIFY'; // Name of trigger action code to execute when we modify record + + + // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen + include DOL_DOCUMENT_ROOT . '/core/actions_addupdatedelete.inc.php'; + + // action update on Skilldet + + $skilldetArray = GETPOST("descriptionline", "array"); + + if (!$error) { + if (is_array($skilldetArray) && count($skilldetArray) > 0) { + foreach ($skilldetArray as $key => $SkValueToUpdate) { + $skilldetObj = new Skilldet($object->db); + $res = $skilldetObj->fetch($key); + if ($res > 0) { + $skilldetObj->description = $SkValueToUpdate; + $resupd = $skilldetObj->update($user); + if ($resupd <= 0) { + setEventMessage($langs->trans('errorUpdateSkilldet')); + } + } + } + } + } + + + // Actions when linking object each other + include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; + + // Actions when printing a doc from card + include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php'; + + // Action to move up and down lines of object + //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; + + // Action to build doc + include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php'; + + if ($action == 'set_thirdparty' && $permissiontoadd) { + $object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, $triggermodname); + } + if ($action == 'classin' && $permissiontoadd) { + $object->setProject(GETPOST('projectid', 'int')); + } + + // Actions to send emails + $triggersendname = 'hrm_SKILL_SENTBYMAIL'; + $autocopy = 'MAIN_MAIL_AUTOCOPY_SKILL_TO'; + $trackid = 'skill' . $object->id; + include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php'; +} + + +/* + * View + * + * Put here all code to build page + */ + +$form = new Form($db); +$formfile = new FormFile($db); +$formproject = new FormProjets($db); + +$title = $langs->trans("skill"); +$help_url = ''; +llxHeader('', $title, $help_url); + + +// Part to create +if ($action == 'create') { + print load_fiche_titre($langs->trans("NewSkill"), '', 'object_' . $object->picto); + + print '
    '; + print ''; + print ''; + $backtopage .= "&objecttype=job"; + if ($backtopage) { + print ''; + } + if ($backtopageforcancel) { + print ''; + } + + print dol_get_fiche_head(array(), ''); + + // Set some default values + //if (! GETPOSTISSET('fieldname')) $_POST['fieldname'] = 'myvalue'; + + print '' . "\n"; + + // Common attributes + include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php'; + + + // SKILLDET ADD + //@todo je stop ici ... à continuer (affichage des 5 skilled input pour create action + //print $object->showInputField($val, $key, $value, '', '['']', '', 0); + + print '
    ' . "\n"; + + print dol_get_fiche_end(); + + print '
    '; + print ''; + print '  '; + + print ''; // Cancel for create does not post form if we don't know the backtopage + print '
    '; + + print '
    '; + + //dol_set_focus('input[name="ref"]'); +} + +// Part to edit record +// and skilldet edition +if (($id || $ref) && $action == 'edit') { + print load_fiche_titre($langs->trans("Skill"), '', 'object_' . $object->picto); + + print '
    '; + print ''; + print ''; + print ''; + if ($backtopage) { + print ''; + } + if ($backtopageforcancel) { + print ''; + } + + print dol_get_fiche_head(); + + print '' . "\n"; + + // Common attributes + include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php'; + + print '
    '; + + + // SKILLDET + + print dol_get_fiche_head(array(), ''); + $SkilldetRecords = $object->fetchLines(); + if (is_array($SkilldetRecords) && count($SkilldetRecords) > 0) { + print ''; + foreach ($SkilldetRecords as $sk) { + $MaxNumberSkill = isset($conf->global->HRM_MAXRANK) ? $conf->global->HRM_MAXRANK : Skill::DEFAULT_MAX_RANK_PER_SKILL; + if ($sk->rank > $MaxNumberSkill) { + continue; + } + + print '
    ' . "\n"; + $sk->fields = dol_sort_array($sk->fields, 'position'); + foreach ($sk->fields as $key => $val) { + if (abs($val['visible']) != 1 && abs($val['visible']) != 3 && abs($val['visible']) != 4) { + continue; + } + + if (array_key_exists('enabled', $val) && isset($val['enabled']) && !verifCond($val['enabled'])) { + continue; // We don't want this field + } + + print ''; + // if (!empty($val['help'])) { + // print $form->textwithpicto($langs->trans($val['label']), $langs->trans($val['help'])); + // } else { + print $langs->trans($val['label']).' '.$langs->trans('Rank').' '.$sk->rank; + // } + print ''; + print ''; + print ''; + } + } + print '
    '; + // if (!empty($val['picto'])) { + // print img_picto('', $val['picto'], '', false, 0, 0, '', 'pictofixedwidth'); + // } + // if (in_array($val['type'], array('int', 'integer'))) { + // $value = GETPOSTISSET($key) ? GETPOST($key, 'int') : $sk->$key; + // } elseif ($val['type'] == 'double') { + // $value = GETPOSTISSET($key) ? price2num(GETPOST($key, 'alphanohtml')) : $sk->$key; + // } elseif (preg_match('/^(text|html)/', $val['type'])) { + // $tmparray = explode(':', $val['type']); + if (!empty($tmparray[1])) { + $check = $tmparray[1]; + } else { + $check = 'restricthtml'; + } + + $skilldetArray = GETPOST("descriptionline", "array"); + if (empty($skilldetArray)) { + $value = GETPOSTISSET($key) ? GETPOST($key, $check) : $sk->$key; + } else { + $value=$skilldetArray[$sk->id]; + } + // + // } elseif ($val['type'] == 'price') { + // $value = GETPOSTISSET($key) ? price2num(GETPOST($key)) : price2num($sk->$key); + // } else { + // $value = GETPOSTISSET($key) ? GETPOST($key, 'alpha') : $sk->$key; + // } + //var_dump($val.' '.$key.' '.$value); + if ($val['noteditable']) { + print $sk->showOutputField($val, $key, $value, '', '', '', 0); + } else { + /** @var Skilldet $sk */ + print $sk->showInputField($val, $key, $value, "", "line[" . $sk->id . "]", "", ""); + } + print '
    '; + } + + + print dol_get_fiche_end(); + + print '
    '; + print '   '; + print '
    '; + + print '
    '; +} + + +// Part to show record +if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) { + $res = $object->fetch_optionals(); + + $head = skillPrepareHead($object); + print dol_get_fiche_head($head, 'card', $langs->trans("Workstation"), -1, $object->picto); + + $formconfirm = ''; + + // Confirmation to delete + if ($action == 'delete') { + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteSkill'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1); + } + // Confirmation to delete line + if ($action == 'deleteline') { + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1); + } + // Clone confirmation + if ($action == 'clone') { + // Create an array for form + $formquestion = array(); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + } + + // Confirmation of action xxxx + if ($action == 'xxx') { + $formquestion = array(); + /* + $forcecombo=0; + if ($conf->browser->name == 'ie') $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy + $formquestion = array( + // 'text' => $langs->trans("ConfirmClone"), + // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), + // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), + // array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo)) + ); + */ + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220); + } + + // Call Hook formConfirm + $parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid); + $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + if (empty($reshook)) { + $formconfirm .= $hookmanager->resPrint; + } elseif ($reshook > 0) { + $formconfirm = $hookmanager->resPrint; + } + + // Print form confirm + print $formconfirm; + + + // Object card + // ------------------------------------------------------------ + $linkback = '' . $langs->trans("BackToList") . ''; + + + $morehtmlref = '
    '; + $morehtmlref.= $object->label; + $morehtmlref .= '
    '; + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref); + + + print '
    '; + print '
    '; + print '
    '; + print '' . "\n"; + + $object->fields['label']['visible']=0; // Already in banner + include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php'; + + + print '
    '; + print '
    '; + print '
    '; + + print '
    '; + + print dol_get_fiche_end(); + + + //dol_include_once('/hrm/tpl/hrm_skillde.fiche.tpl.php'); + + // Buttons for actions + + if ($action != 'presend' && $action != 'editline') { + print '
    ' . "\n"; + $parameters = array(); + $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + } + + if (empty($reshook)) { + // Back to draft + if ($object->status == $object::STATUS_VALIDATED) { + print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=confirm_setdraft&confirm=yes&token=' . newToken(), '', $permissiontoadd); + } + + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd); + + // Delete (need delete permission, or if draft, just need create/modify permission) + print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete); + } + print '
    ' . "\n"; + } +} + +//*---------------------------------------------------------------------------- +//*---------------------------------------------------------------------------- + + +//*--------------------------------------------------------------------------- + +if ($action != "create" && $action != "edit") { + require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; + require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; + require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; + + // load hrm libraries + require_once __DIR__ . '/class/skilldet.class.php'; + + // for other modules + //dol_include_once('/othermodule/class/otherobject.class.php'); + + $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... + $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) + $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? + $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation + $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button + $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list + $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'skilldetlist'; // To manage different context of search + $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page + $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') + + $id = GETPOST('id', 'int'); + + // Load variable for pagination + $limit = 0; + $sortfield = GETPOST('sortfield', 'aZ09comma'); + $sortorder = GETPOST('sortorder', 'aZ09comma'); + $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); + if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { + // If $page is not defined, or '' or -1 or if we click on clear filters + $page = 0; + } + $offset = $limit * $page; + $pageprev = $page - 1; + $pagenext = $page + 1; + + // Initialize technical objects + $objectline = new Skilldet($db); + // $diroutputmassaction = $conf->hrm->dir_output . '/temp/massgeneration/' . $user->id; + // $hookmanager->initHooks(array('skilldetlist')); // Note that conf->hooks_modules contains array + + // Default sort order (if not yet defined by previous GETPOST) + if (!$sortfield) { + reset($objectline->fields); // Reset is required to avoid key() to return null. + $sortfield = "t." . key($objectline->fields); // Set here default search field. By default 1st field in definition. + } + if (!$sortorder) { + $sortorder = "ASC"; + } + + // Initialize array of search criterias + $search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); + $search = array(); + foreach ($objectline->fields as $key => $val) { + if (GETPOST('search_' . $key, 'alpha') !== '') { + $search[$key] = GETPOST('search_' . $key, 'alpha'); + } + if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + $search[$key . '_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_' . $key . '_dtstartmonth', 'int'), GETPOST('search_' . $key . '_dtstartday', 'int'), GETPOST('search_' . $key . '_dtstartyear', 'int')); + $search[$key . '_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_' . $key . '_dtendmonth', 'int'), GETPOST('search_' . $key . '_dtendday', 'int'), GETPOST('search_' . $key . '_dtendyear', 'int')); + } + } + + // List of fields to search into when doing a "search in all" + $fieldstosearchall = array(); + foreach ($objectline->fields as $key => $val) { + if (!empty($val['searchall'])) { + $fieldstosearchall['t.' . $key] = $val['label']; + } + } + + // Definition of array of fields for columns + $arrayfields = array(); + foreach ($objectline->fields as $key => $val) { + // If $val['visible']==0, then we never show the field + if (!empty($val['visible'])) { + $visible = (int) dol_eval($val['visible'], 1); + $arrayfields['t.' . $key] = array( + 'label' => $val['label'], + 'checked' => (($visible < 0) ? 0 : 1), + 'enabled' => ($visible != 3 && dol_eval($val['enabled'], 1)), + 'position' => $val['position'], + 'help' => isset($val['help']) ? $val['help'] : '' + ); + } + } + + $objectline->fields = dol_sort_array($objectline->fields, 'position'); + $arrayfields = dol_sort_array($arrayfields, 'position'); + + + /* + * View + */ + + $form = new Form($db); + + $now = dol_now(); + + $help_url = ''; + $title = $langs->transnoentitiesnoconv("Skilldets"); + $morejs = array(); + $morecss = array(); + + + // Build and execute select + // -------------------------------------------------------------------- + $sql = 'SELECT '; + $sql .= $objectline->getFieldList('t'); + $sql .= " FROM " . MAIN_DB_PREFIX . $objectline->table_element . " as t"; + if ($objectline->ismultientitymanaged == 1) { + $sql .= " WHERE t.entity IN (" . getEntity($objectline->element) . ")"; + } else { + $sql .= " WHERE 1 = 1 "; + } + + if (!empty($id)) { + $sql .= " AND fk_skill = " . $id . " "; + } + + // if total of record found is smaller than limit, no need to do paging and to restart another select with limits set. + if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit))) { + $num = $nbtotalofrecords; + } else { + if ($limit) { + $sql .= $db->plimit($limit + 1, $offset); + } + + $resql = $db->query($sql); + if (!$resql) { + dol_print_error($db); + exit; + } + + $num = $db->num_rows($resql); + } + + print '
    ' . "\n"; + if ($optioncss != '') { + print ''; + } + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + if (!empty($id)) { + print ''; + } + + $param_fk = "&fk_skill=" . $id . "&fk_user_creat=" . $user->rowid; + $backtopage = dol_buildpath('/hrm/skill_card.php', 1) . '?id=' . $id; + //$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/hrm/skilldet_card.php', 1) . '?action=create&backtopage=' . urlencode($_SERVER['PHP_SELF']) . $param_fk . '&backtopage=' . $backtopage, '', $permissiontoadd); + + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_' . $object->picto, 0, "", '', '', 0, 0, 1); + + // Add code for pre mass action (confirmation or email presend form) + $topicmail = "SendSkilldetRef"; + $modelmail = "skilldet"; + $objecttmp = new Skilldet($db); + $trackid = 'xxxx' . $object->id; + //include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; + + if ($search_all) { + foreach ($fieldstosearchall as $key => $val) { + $fieldstosearchall[$key] = $langs->trans($val); + } + print '
    ' . $langs->trans("FilterOnInto", $search_all) . join(', ', $fieldstosearchall) . '
    '; + } + + $moreforfilter = ''; + /*$moreforfilter.='
    '; + $moreforfilter.= $langs->trans('MyFilter') . ': '; + $moreforfilter.= '
    ';*/ + + $parameters = array(); + $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $objectline); // Note that $action and $objectline may have been modified by hook + if (empty($reshook)) { + $moreforfilter .= $hookmanager->resPrint; + } else { + $moreforfilter = $hookmanager->resPrint; + } + + if (!empty($moreforfilter)) { + print '
    '; + print $moreforfilter; + print '
    '; + } + + $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; + // $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields + // $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); + + print '
    '; // You can use div-table-responsive-no-min if you dont need reserved height for your table + print '' . "\n"; + + + // Fields title label + // -------------------------------------------------------------------- + print ''; + foreach ($objectline->fields as $key => $val) { + // $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); + // if ($key == 'status') { + // $cssforfield .= ($cssforfield ? ' ' : '') . 'center'; + // } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { + // $cssforfield .= ($cssforfield ? ' ' : '') . 'center'; + // } elseif (in_array($val['type'], array('timestamp'))) { + // $cssforfield .= ($cssforfield ? ' ' : '') . 'nowrap'; + // } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { + // $cssforfield .= ($cssforfield ? ' ' : '') . 'right'; + // } + if (!empty($arrayfields['t.' . $key]['checked'])) { + print getTitleFieldOfList($arrayfields['t.' . $key]['label'], 0, $_SERVER['PHP_SELF'], 't.' . $key, '', $param, ($cssforfield ? 'class="' . $cssforfield . '"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield . ' ' : '')) . "\n"; + } + } + print ''; + print ''; + print '' . "\n"; + + + // Display all ranks of skill + // -------------------------------------------------------------------- + + $i = 0; + $totalarray = array(); + $totalarray['nbfield'] = 0; + while ($i < ($limit ? min($num, $limit) : $num)) { + $obj = $db->fetch_object($resql); + if (empty($obj)) { + break; // Should not happen + } + + $MaxNumberSkill = isset($conf->global->HRM_MAXRANK) ? $conf->global->HRM_MAXRANK : Skill::DEFAULT_MAX_RANK_PER_SKILL; + if ($obj->rank > $MaxNumberSkill) { + continue; + } + + // Store properties in $objectline + $objectline->setVarsFromFetchObj($obj); + + // Show here line of result + print ''; + foreach ($objectline->fields as $key => $val) { + // $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); + // if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { + // $cssforfield .= ($cssforfield ? ' ' : '') . 'center'; + // } elseif ($key == 'status') { + // $cssforfield .= ($cssforfield ? ' ' : '') . 'center'; + // } + // + // if (in_array($val['type'], array('timestamp'))) { + // $cssforfield .= ($cssforfield ? ' ' : '') . 'nowrap'; + // } elseif ($key == 'ref') { + // $cssforfield .= ($cssforfield ? ' ' : '') . 'nowrap'; + // } + // + // if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) { + // $cssforfield .= ($cssforfield ? ' ' : '') . 'right'; + // } + //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; + + if (!empty($arrayfields['t.' . $key]['checked'])) { + print ''; + if ($key == 'status') { + print $objectline->getLibStatut(5); + } elseif ($key == 'rowid') { + print $objectline->showOutputField($val, $key, $objectline->id, ''); + // ajout pencil + print ''; + } else { + print $objectline->showOutputField($val, $key, $objectline->$key, ''); + } + print ''; + + + if (!$i) { + $totalarray['nbfield']++; + } + if (!empty($val['isameasure'])) { + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 't.' . $key; + } + if (!isset($totalarray['val'])) { + $totalarray['val'] = array(); + } + if (!isset($totalarray['val']['t.' . $key])) { + $totalarray['val']['t.' . $key] = 0; + } + $totalarray['val']['t.' . $key] += $objectline->$key; + } + } + } + + + // LINE EDITION | SUPPRESSION + + print ''; + print ''; + + + // Fields from hook + $parameters = array('arrayfields' => $arrayfields, 'object' => $objectline, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray); + $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $objectline); // Note that $action and $objectline may have been modified by hook + print $hookmanager->resPrint; + /*// Action column + print '';*/ + if (!$i) { + $totalarray['nbfield']++; + } + + print '' . "\n"; + + $i++; + } + + + // If no record found + + if ($num == 0) { + $colspan = 1; + foreach ($arrayfields as $key => $val) { + if (!empty($val['checked'])) { + $colspan++; + } + } + print ''; + } + + + $db->free($resql); + + $parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); + $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $objectline); // Note that $action and $objectline may have been modified by hook + print $hookmanager->resPrint; + + print '
    '; + + print ''; + // add pencil + //@todo change to proper call dol_ + //print 'id, 1) . '">'; + // add trash + //@todo change to proper call dol_ + //print 'id,1) .'">'; + //print ''; + + print '
    ' . $langs->trans("NoRecordFound") . '
    ' . "\n"; + print '
    ' . "\n"; + + print '
    ' . "\n"; + + // if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { + // $hidegeneratedfilelistifempty = 1; + // if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { + // $hidegeneratedfilelistifempty = 0; + // } + // + // require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; + // $formfile = new FormFile($db); + // + // // Show list of available documents + // $urlsource = $_SERVER['PHP_SELF'] . '?sortfield=' . $sortfield . '&sortorder=' . $sortorder; + // $urlsource .= str_replace('&', '&', $param); + // + // $filedir = $diroutputmassaction; + // $genallowed = $permissiontoread; + // $delallowed = $permissiontoadd; + // + // print $formfile->showdocuments('massfilesarea_hrm', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); + // } + + print '
    '; + + // Show links to link elements + $linktoelem = $form->showLinkToObjectBlock($object, null, array('skill')); + $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); + + print '
    '; + + $MAXEVENT = 10; + + $morehtmlright = ''; + $morehtmlright .= $langs->trans("SeeAll"); + $morehtmlright .= ''; + // List of actions on element + include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; + $formactions = new FormActions($db); + $somethingshown = $formactions->showactions($object, $object->element . '@' . $object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlright); + + print '
    '; +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/hrm/skill_contact.php b/htdocs/hrm/skill_contact.php new file mode 100644 index 00000000000..11ff55e8588 --- /dev/null +++ b/htdocs/hrm/skill_contact.php @@ -0,0 +1,220 @@ + + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND + * + * 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 . + */ + +/** + * \file skill_contact.php + * \ingroup hrm + * \brief Tab for contacts linked to Skill + */ + +// 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"); +} + +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +dol_include_once('/hrm/class/skill.class.php'); +dol_include_once('/hrm/lib/hrm_skill.lib.php'); + +// Load translation files required by the page +$langs->loadLangs(array("hrm", "companies", "other", "mails")); + +$id = (GETPOST('id') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility +$ref = GETPOST('ref', 'alpha'); +$lineid = GETPOST('lineid', 'int'); +$socid = GETPOST('socid', 'int'); +$action = GETPOST('action', 'aZ09'); + +// Initialize technical objects +$object = new Skill($db); +$extrafields = new ExtraFields($db); +$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('skillcontact', 'globalcard')); // Note that conf->hooks_modules contains array +// Fetch optionals attributes and labels +$extrafields->fetch_name_optionals_label($object->table_element); + +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals + +$permission = $user->rights->hrm->skill->write; + +// Security check (enable the most restrictive one) +//if ($user->socid > 0) accessforbidden(); +//if ($user->socid > 0) $socid = $user->socid; +//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); +//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); +//if (empty($conf->hrm->enabled)) accessforbidden(); +//if (!$permissiontoread) accessforbidden(); + + +/* + * Add a new contact + */ + +if ($action == 'addcontact' && $permission) { + $contactid = (GETPOST('userid') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int')); + $typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type')); + $result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09')); + + if ($result >= 0) { + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit; + } else { + if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { + $langs->load("errors"); + setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors'); + } else { + setEventMessages($object->error, $object->errors, 'errors'); + } + } +} elseif ($action == 'swapstatut' && $permission) { + // Toggle the status of a contact + $result = $object->swapContactStatus(GETPOST('ligne', 'int')); +} elseif ($action == 'deletecontact' && $permission) { + // Deletes a contact + $result = $object->delete_contact($lineid); + + if ($result >= 0) { + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit; + } else { + dol_print_error($db); + } +} + + +/* + * View + */ + +$title = $langs->trans('Skill')." - ".$langs->trans('ContactsAddresses'); +$help_url = ''; +//$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; +llxHeader('', $title, $help_url); + +$form = new Form($db); +$formcompany = new FormCompany($db); +$contactstatic = new Contact($db); +$userstatic = new User($db); + + +/* *************************************************************************** */ +/* */ +/* View and edit mode */ +/* */ +/* *************************************************************************** */ + +if ($object->id) { + /* + * Show tabs + */ + $head = skillPrepareHead($object); + + print dol_get_fiche_head($head, 'contact', '', -1, $object->picto); + + $linkback = ''.$langs->trans("BackToList").''; + + $morehtmlref = '
    '; + /* + // Ref customer + $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); + $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); + // Thirdparty + $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); + // Project + if (! empty($conf->projet->enabled)) + { + $langs->load("projects"); + $morehtmlref.='
    '.$langs->trans('Project') . ' '; + if ($permissiontoadd) + { + if ($action != 'classify') + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + $morehtmlref.=' : '; + if ($action == 'classify') { + //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); + $morehtmlref.='
    '; + $morehtmlref.=''; + $morehtmlref.=''; + $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.=''; + $morehtmlref.='
    '; + } else { + $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + } + } else { + if (! empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref .= ': '.$proj->getNomUrl(); + } else { + $morehtmlref .= ''; + } + } + }*/ + $morehtmlref .= '
    '; + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); + + print dol_get_fiche_end(); + + print '
    '; + + // Contacts lines (modules that overwrite templates must declare this into descriptor) + $dirtpls = array_merge($conf->modules_parts['tpl'], array('/core/tpl')); + foreach ($dirtpls as $reldir) { + $res = @include dol_buildpath($reldir.'/contacts.tpl.php'); + if ($res) { + break; + } + } +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/hrm/skill_document.php b/htdocs/hrm/skill_document.php new file mode 100644 index 00000000000..4e15c2acb9f --- /dev/null +++ b/htdocs/hrm/skill_document.php @@ -0,0 +1,217 @@ + + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND + * + * 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 . + */ + +/** + * \file skill_document.php + * \ingroup hrm + * \brief Tab for documents linked to skill + */ + +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs +//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters +//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters +//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). +//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) +//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data +//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php +//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library +//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. +//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value +//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler +//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message +//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies +//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET +//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification + +// 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"); +} + +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +dol_include_once('/hrm/class/skill.class.php'); +dol_include_once('/hrm/lib/hrm_skill.lib.php'); + +// Load translation files required by the page +$langs->loadLangs(array("hrm", "companies", "other", "mails")); + + +$action = GETPOST('action', 'aZ09'); +$confirm = GETPOST('confirm'); +$id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int')); +$ref = GETPOST('ref', 'alpha'); + +// Get parameters +$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$sortfield = GETPOST("sortfield", 'alpha'); +$sortorder = GETPOST("sortorder", 'alpha'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +if (empty($page) || $page == -1) { + $page = 0; +} // If $page is not defined, or '' or -1 +$offset = $liste_limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (!$sortorder) { + $sortorder = "ASC"; +} +if (!$sortfield) { + $sortfield = "name"; +} +//if (! $sortfield) $sortfield="position_name"; + +// Initialize technical objects +$object = new Skill($db); +$extrafields = new ExtraFields($db); +$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('skilldocument', 'globalcard')); // Note that conf->hooks_modules contains array +// Fetch optionals attributes and labels +$extrafields->fetch_name_optionals_label($object->table_element); + +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals + +if ($id > 0 || !empty($ref)) { + $upload_dir = $conf->hrm->multidir_output[$object->entity ? $object->entity : $conf->entity]."/skill/".get_exdir(0, 0, 0, 1, $object); +} + +$permissiontoread = $user->rights->hrm->all->read; +$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php + +// Security check (enable the most restrictive one) +//if ($user->socid > 0) accessforbidden(); +//if ($user->socid > 0) $socid = $user->socid; +//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); +//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); +if (empty($conf->hrm->enabled)) accessforbidden(); +if (!$permissiontoread) accessforbidden(); + + +/* + * Actions + */ + +include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; + + +/* + * View + */ + +$form = new Form($db); + +$title = $langs->trans("Skilldet").' - '.$langs->trans("Files"); +$help_url = ''; +//$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; +llxHeader('', $title, $help_url); + +if ($object->id) { + /* + * Show tabs + */ + $head = skillPrepareHead($object); + + print dol_get_fiche_head($head, 'document', $langs->trans("Documents"), -1, $object->picto); + + + // Build file list + $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1); + $totalsize = 0; + foreach ($filearray as $key => $file) { + $totalsize += $file['size']; + } + + // Object card + // ------------------------------------------------------------ + $linkback = ''.$langs->trans("BackToList").''; + + $morehtmlref = '
    '; + $morehtmlref.= $object->label; + $morehtmlref .= '
    '; + + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref); + + print '
    '; + + print '
    '; + print ''; + + // Number of files + print ''; + + // Total size + print ''; + + print '
    '.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
    '.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
    '; + + print '
    '; + + print dol_get_fiche_end(); + + $modulepart = 'hrm'; + $permtoedit = $permissiontoadd; + $param = '&id='.$object->id; + + //$relativepathwithnofile='skill/' . dol_sanitizeFileName($object->id).'/'; + $relativepathwithnofile = 'skill/'.dol_sanitizeFileName($object->ref).'/'; + + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; +} else { + accessforbidden('', 0, 1); +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/hrm/skill_list.php b/htdocs/hrm/skill_list.php new file mode 100644 index 00000000000..009a5491342 --- /dev/null +++ b/htdocs/hrm/skill_list.php @@ -0,0 +1,733 @@ + + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND + * + * 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 . + */ + +/** + * \file skill_list.php + * \ingroup hrm + * \brief List page for skill + */ + +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs +//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters +//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters +//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). +//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) +//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data +//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php +//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library +//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. +//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value +//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler +//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message +//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies +//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET +//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification + +// 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"); +} + +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; + +// load hrm libraries +require_once __DIR__.'/class/skill.class.php'; + +// for other modules +//dol_include_once('/othermodule/class/otherobject.class.php'); + +// Load translation files required by the page +$langs->loadLangs(array("hrm", "other")); + +$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... +$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) +$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation +$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button +$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'skilllist'; // To manage different context of search +$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') + +$id = GETPOST('id', 'int'); + +// Load variable for pagination +$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$sortfield = GETPOST('sortfield', 'aZ09comma'); +$sortorder = GETPOST('sortorder', 'aZ09comma'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { + // If $page is not defined, or '' or -1 or if we click on clear filters + $page = 0; +} +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; + +// Initialize technical objects +$object = new Skill($db); +$extrafields = new ExtraFields($db); +$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('skilllist')); // Note that conf->hooks_modules contains array + +// Fetch optionals attributes and labels +$extrafields->fetch_name_optionals_label($object->table_element); +//$extrafields->fetch_name_optionals_label($object->table_element_line); + +$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); + +// Default sort order (if not yet defined by previous GETPOST) +if (!$sortfield) { + reset($object->fields); // Reset is required to avoid key() to return null. + $sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition. +} +if (!$sortorder) { + $sortorder = "ASC"; +} + +// Initialize array of search criterias +$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); +$search = array(); +foreach ($object->fields as $key => $val) { + if (GETPOST('search_'.$key, 'alpha') !== '') { + $search[$key] = GETPOST('search_'.$key, 'alpha'); + } + if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); + } +} + +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array(); +foreach ($object->fields as $key => $val) { + if (!empty($val['searchall'])) { + $fieldstosearchall['t.'.$key] = $val['label']; + } +} + +// Definition of array of fields for columns +$arrayfields = array(); +foreach ($object->fields as $key => $val) { + // If $val['visible']==0, then we never show the field + if (!empty($val['visible'])) { + $visible = (int) dol_eval($val['visible'], 1); + $arrayfields['t.'.$key] = array( + 'label'=>$val['label'], + 'checked'=>(($visible < 0) ? 0 : 1), + 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)), + 'position'=>$val['position'], + 'help'=> isset($val['help']) ? $val['help'] : '' + ); + } +} +// Extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; + +$object->fields = dol_sort_array($object->fields, 'position'); +$arrayfields = dol_sort_array($arrayfields, 'position'); + +$permissiontoread = $user->rights->hrm->all->read; +$permissiontoadd = $user->rights->hrm->all->write; +$permissiontodelete = $user->rights->hrm->all->delete; + +// Security check +if (empty($conf->hrm->enabled)) { + accessforbidden('Module not enabled'); +} + +// Security check (enable the most restrictive one) +if ($user->socid > 0) accessforbidden(); +//if ($user->socid > 0) accessforbidden(); +//$socid = 0; if ($user->socid > 0) $socid = $user->socid; +//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); +//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); +if (empty($conf->hrm->enabled)) accessforbidden(); +if (!$permissiontoread) accessforbidden(); + + + +/* + * Actions + */ + +if (GETPOST('cancel', 'alpha')) { + $action = 'list'; + $massaction = ''; +} +if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { + $massaction = ''; +} + +$parameters = array(); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + +if (empty($reshook)) { + // Selection of new fields + include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; + + // Purge search criteria + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers + foreach ($object->fields as $key => $val) { + $search[$key] = ''; + if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + $search[$key.'_dtstart'] = ''; + $search[$key.'_dtend'] = ''; + } + } + $toselect = array(); + $search_array_options = array(); + } + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha') + || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) { + $massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation + } + + // Mass actions + $objectclass = 'Skill'; + $objectlabel = 'Skill'; + $uploaddir = $conf->hrm->dir_output; + include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; +} + + + +/* + * View + */ + +$form = new Form($db); + +$now = dol_now(); + +//$help_url="EN:Module_Skill|FR:Module_Skill_FR|ES:Módulo_Skill"; +$help_url = ''; +$title = $langs->trans('ListOf', $langs->transnoentitiesnoconv("Skills")); +$morejs = array(); +$morecss = array(); + + +// Build and execute select +// -------------------------------------------------------------------- +$sql = 'SELECT '; +$sql .= $object->getFieldList('t'); +// Add fields from extrafields +if (!empty($extrafields->attributes[$object->table_element]['label'])) { + foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key.', ' : ''); + } +} +// Add fields from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= preg_replace('/^,/', '', $hookmanager->resPrint); +$sql = preg_replace('/,\s*$/', '', $sql); +$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; +if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; +} +// Add table from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; +if ($object->ismultientitymanaged == 1) { + $sql .= " WHERE t.entity IN (".getEntity($object->element).")"; +} else { + $sql .= " WHERE 1 = 1"; +} +foreach ($search as $key => $val) { + if (array_key_exists($key, $object->fields)) { + if ($key == 'status' && $search[$key] == -1) { + continue; + } + $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); + if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) { + if ($search[$key] == '-1' || $search[$key] === '0') { + $search[$key] = ''; + } + $mode_search = 2; + } + if ($search[$key] != '') { + $sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search)); + } + } else { + if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') { + $columnName=preg_replace('/(_dtstart|_dtend)$/', '', $key); + if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) { + if (preg_match('/_dtstart$/', $key)) { + $sql .= " AND t." . $columnName . " >= '" . $db->idate($search[$key]) . "'"; + } + if (preg_match('/_dtend$/', $key)) { + $sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'"; + } + } + } + } +} +if ($search_all) { + $sql .= natural_search(array_keys($fieldstosearchall), $search_all); +} +//$sql.= dolSqlDateFilter("t.field", $search_xxxday, $search_xxxmonth, $search_xxxyear); +// Add where from extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; +// Add where from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; + +/* If a group by is required +$sql .= " GROUP BY "; +foreach($object->fields as $key => $val) { + $sql .= 't.'.$key.', '; +} +// Add fields from extrafields +if (!empty($extrafields->attributes[$object->table_element]['label'])) { + foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : ''); + } +} +// Add where from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; +$sql = preg_replace('/,\s*$/', '', $sql); +*/ + +$sql .= $db->order($sortfield, $sortorder); + +// Count total nb of records +$nbtotalofrecords = ''; +if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + $resql = $db->query($sql); + $nbtotalofrecords = $db->num_rows($resql); + if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0 + $page = 0; + $offset = 0; + } +} +// if total of record found is smaller than limit, no need to do paging and to restart another select with limits set. +if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit))) { + $num = $nbtotalofrecords; +} else { + if ($limit) { + $sql .= $db->plimit($limit + 1, $offset); + } + + $resql = $db->query($sql); + if (!$resql) { + dol_print_error($db); + exit; + } + + $num = $db->num_rows($resql); +} + +// Direct jump if only one record found +if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) { + $obj = $db->fetch_object($resql); + $id = $obj->rowid; + header("Location: ".dol_buildpath('/hrm/skill_card.php', 1).'?id='.$id); + exit; +} + + +// Output page +// -------------------------------------------------------------------- + +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', ''); + +// Example : Adding jquery code +// print ''; + +$arrayofselected = is_array($toselect) ? $toselect : array(); + +$param = ''; +if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { + $param .= '&contextpage='.urlencode($contextpage); +} +if ($limit > 0 && $limit != $conf->liste_limit) { + $param .= '&limit='.urlencode($limit); +} +foreach ($search as $key => $val) { + if (is_array($search[$key]) && count($search[$key])) { + foreach ($search[$key] as $skey) { + $param .= '&search_'.$key.'[]='.urlencode($skey); + } + } else { + $param .= '&search_'.$key.'='.urlencode($search[$key]); + } +} +if ($optioncss != '') { + $param .= '&optioncss='.urlencode($optioncss); +} +// Add $param from extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; +// Add $param from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook +$param .= $hookmanager->resPrint; + +// List of mass actions available +$arrayofmassactions = array( + //'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"), + //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), + //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), + //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), +); +if ($permissiontodelete) { + $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); +} +if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { + $arrayofmassactions = array(); +} +$massactionbutton = $form->selectMassAction('', $arrayofmassactions); + +print '
    '."\n"; +if ($optioncss != '') { + print ''; +} +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; + +$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/hrm/skill_card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); + +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); + +// Add code for pre mass action (confirmation or email presend form) +$topicmail = "SendSkillRef"; +$modelmail = "skill"; +$objecttmp = new Skill($db); +$trackid = 'xxxx'.$object->id; +include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; + +if ($search_all) { + foreach ($fieldstosearchall as $key => $val) { + $fieldstosearchall[$key] = $langs->trans($val); + } + print '
    '.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'
    '; +} + +$moreforfilter = ''; +/*$moreforfilter.='
    '; +$moreforfilter.= $langs->trans('MyFilter') . ': '; +$moreforfilter.= '
    ';*/ + +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook +if (empty($reshook)) { + $moreforfilter .= $hookmanager->resPrint; +} else { + $moreforfilter = $hookmanager->resPrint; +} + +if (!empty($moreforfilter)) { + print '
    '; + print $moreforfilter; + print '
    '; +} + +$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields +$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); + +print '
    '; // You can use div-table-responsive-no-min if you dont need reserved height for your table +print ''."\n"; + + +// Fields title search +// -------------------------------------------------------------------- +print ''; +foreach ($object->fields as $key => $val) { + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); + if ($key == 'status') { + $cssforfield .= ($cssforfield ? ' ' : '').'center'; + } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '').'center'; + } elseif (in_array($val['type'], array('timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; + } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { + $cssforfield .= ($cssforfield ? ' ' : '').'right'; + } + if (!empty($arrayfields['t.'.$key]['checked'])) { + print ''; + } +} +// Extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; + +// Fields from hook +$parameters = array('arrayfields'=>$arrayfields); +$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; +// Action column +print ''; +print ''."\n"; + + +// Fields title label +// -------------------------------------------------------------------- +print ''; +foreach ($object->fields as $key => $val) { + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); + if ($key == 'status') { + $cssforfield .= ($cssforfield ? ' ' : '').'center'; + } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '').'center'; + } elseif (in_array($val['type'], array('timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; + } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { + $cssforfield .= ($cssforfield ? ' ' : '').'right'; + } + if (!empty($arrayfields['t.'.$key]['checked'])) { + print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n"; + } +} +// Extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; +// Hook fields +$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); +$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; +// Action column +print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; +print ''."\n"; + + +// Detect if we need a fetch on each output line +$needToFetchEachLine = 0; +if (isset($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { + foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) { + if (preg_match('/\$object/', $val)) { + $needToFetchEachLine++; // There is at least one compute field that use $object + } + } +} + + +// Loop on record +// -------------------------------------------------------------------- +$i = 0; +$totalarray = array(); +$totalarray['nbfield'] = 0; +while ($i < ($limit ? min($num, $limit) : $num)) { + $obj = $db->fetch_object($resql); + if (empty($obj)) { + break; // Should not happen + } + + // Store properties in $object + $object->setVarsFromFetchObj($obj); + + // Show here line of result + print ''; + foreach ($object->fields as $key => $val) { + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); + if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '').'center'; + } elseif ($key == 'status') { + $cssforfield .= ($cssforfield ? ' ' : '').'center'; + } + + if (in_array($val['type'], array('timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; + } elseif ($key == 'ref') { + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; + } + + if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) { + $cssforfield .= ($cssforfield ? ' ' : '').'right'; + } + //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; + + if (!empty($arrayfields['t.'.$key]['checked'])) { + print ''; + if ($key == 'status') { + print $object->getLibStatut(5); + } elseif ($key == 'rowid') { + print $object->showOutputField($val, $key, $object->id, ''); + }elseif ($key == 'label'){ + print $object->getNomUrl(1); + } else { + print $object->showOutputField($val, $key, $object->$key, ''); + } + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + if (!empty($val['isameasure'])) { + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; + } + if (!isset($totalarray['val'])) { + $totalarray['val'] = array(); + } + if (!isset($totalarray['val']['t.'.$key])) { + $totalarray['val']['t.'.$key] = 0; + } + $totalarray['val']['t.'.$key] += $object->$key; + } + } + } + // Extra fields + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; + // Fields from hook + $parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + // Action column + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + + print ''."\n"; + + $i++; +} + +// Show total line +include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; + +// If no record found +if ($num == 0) { + $colspan = 1; + foreach ($arrayfields as $key => $val) { + if (!empty($val['checked'])) { + $colspan++; + } + } + print ''; +} + + +$db->free($resql); + +$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); +$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; + +print '
    '; + if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { + print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); + } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) { + print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', 'maxwidth125', 1); + } elseif (!preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + print ''; + } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + print '
    '; + print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); + print '
    '; + print '
    '; + print $form->selectDate($search[$key.'_dtend'] ? $search[$key.'_dtend'] : '', "search_".$key."_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); + print '
    '; + } + print '
    '; +$searchpicto = $form->showFilterButtons(); +print $searchpicto; +print '
    '; + if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + $selected = 0; + if (in_array($object->id, $arrayofselected)) { + $selected = 1; + } + print ''; + } + print '
    '.$langs->trans("NoRecordFound").'
    '."\n"; +print '
    '."\n"; + +print '
    '."\n"; + +if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { + $hidegeneratedfilelistifempty = 1; + if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { + $hidegeneratedfilelistifempty = 0; + } + + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; + $formfile = new FormFile($db); + + // Show list of available documents + $urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; + $urlsource .= str_replace('&', '&', $param); + + $filedir = $diroutputmassaction; + $genallowed = $permissiontoread; + $delallowed = $permissiontoadd; + + print $formfile->showdocuments('massfilesarea_hrm', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/hrm/skill_note.php b/htdocs/hrm/skill_note.php new file mode 100644 index 00000000000..564561e7c75 --- /dev/null +++ b/htdocs/hrm/skill_note.php @@ -0,0 +1,175 @@ + + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND + * + * 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 . + */ + +/** + * \file skill_note.php + * \ingroup hrm + * \brief Tab for notes on skill + */ + +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs +//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters +//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters +//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). +//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) +//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data +//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php +//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library +//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. +//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value +//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler +//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message +//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies +//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET +//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification + +// 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"); +} + +dol_include_once('/hrm/class/skill.class.php'); +dol_include_once('/hrm/lib/hrm_skill.lib.php'); + +// Load translation files required by the page +$langs->loadLangs(array("hrm", "companies")); + +// Get parameters +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); +$action = GETPOST('action', 'aZ09'); +$cancel = GETPOST('cancel', 'aZ09'); +$backtopage = GETPOST('backtopage', 'alpha'); + +// Initialize technical objects +$object = new Skill($db); +$extrafields = new ExtraFields($db); +$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('skillnote', 'globalcard')); // Note that conf->hooks_modules contains array +// Fetch optionals attributes and labels +$extrafields->fetch_name_optionals_label($object->table_element); + +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +if ($id > 0 || !empty($ref)) { + $upload_dir = $conf->hrm->multidir_output[$object->entity]."/".$object->id; +} + +$permissionnote = $user->rights->hrm->all->write; +$permissiontoread = $user->rights->hrm->all->read; // Used by the include of actions_addupdatedelete.inc.php + +// Security check (enable the most restrictive one) +//if ($user->socid > 0) accessforbidden(); +//if ($user->socid > 0) $socid = $user->socid; +//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); +//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); +if (empty($conf->hrm->enabled)) accessforbidden(); +if (!$permissiontoread) accessforbidden(); + + +/* + * Actions + */ + +$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} +if (empty($reshook)) { + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once +} + + +/* + * View + */ + +$form = new Form($db); + +//$help_url='EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes'; +$help_url = ''; +llxHeader('', $langs->trans('Skill'), $help_url); + +if ($id > 0 || !empty($ref)) { + $object->fetch_thirdparty(); + + $head = skillPrepareHead($object); + + print dol_get_fiche_head($head, 'note', $langs->trans("Notes"), -1, $object->picto); + + // Object card + // ------------------------------------------------------------ + $linkback = ''.$langs->trans("BackToList").''; + + $morehtmlref = '
    '; + $morehtmlref.= $object->label; + $morehtmlref .= '
    '; + + + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref); + + + print '
    '; + 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/hrm/skill_tab.php b/htdocs/hrm/skill_tab.php new file mode 100644 index 00000000000..b522f5d4def --- /dev/null +++ b/htdocs/hrm/skill_tab.php @@ -0,0 +1,374 @@ + + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021 Greg Rastklan + * Copyright (C) 2021 Jean-Pascal BOUDET + * Copyright (C) 2021 Grégory BLEMAND + * + * 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 . + */ + +/** + * \file skill_tab.php + * \ingroup hrm + * \brief Page to add/delete/view skill to jobs/users + */ + +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs +//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters +//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters +//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). +//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) +//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data +//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php +//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library +//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. +//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value +//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler +//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message +//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies +//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET +//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification + +// 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"); +} + +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; +require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php'; +dol_include_once('/hrm/class/skill.class.php'); +dol_include_once('/hrm/class/skillrank.class.php'); +dol_include_once('/hrm/lib/hrm_skill.lib.php'); + +// Load translation files required by the page +$langs->loadLangs(array("hrm", "other")); + +$id = GETPOST('id', 'int'); +$fk_skill = GETPOST('fk_skill', 'int'); +$objecttype = GETPOST('objecttype', 'alpha'); +$TNote = GETPOST('TNote', 'array'); +$lineid = GETPOST('lineid', 'int'); +$action = GETPOST('action', 'aZ09'); +$confirm = GETPOST('confirm', 'alpha'); +$cancel = GETPOST('cancel', 'aZ09'); +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'skillcard'; // To manage different context of search +$backtopage = GETPOST('backtopage', 'alpha'); +$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); + +$TAuthorizedObjects = array('job', 'user'); +$skill = new SkillRank($db); + +// Initialize technical objects +if (in_array($objecttype, $TAuthorizedObjects)) { + if ($objecttype == 'job') { + dol_include_once('/hrm/class/job.class.php'); + $object = new Job($db); + } else if ($objecttype == "user") { + $object = new User($db); + } +} else accessforbidden($langs->trans('ErrorBadObjectType')); + +$hookmanager->initHooks(array('skilltab', 'globalcard')); // Note that conf->hooks_modules contains array + +// Load object +include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. + +$permissiontoread = $user->rights->hrm->all->read; +$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php + +// Security check (enable the most restrictive one) +if ($user->socid > 0) accessforbidden(); +if (empty($conf->hrm->enabled)) accessforbidden(); +if (!$permissiontoread) accessforbidden(); + + +/* + * Actions + */ + +$parameters = array(); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + +if (empty($reshook)) { + $error = 0; + + $backurlforlist = dol_buildpath('/hrm/skill_list.php', 1); + + if (empty($backtopage) || ($cancel && empty($id))) { + if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { + if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { + $backtopage = $backurlforlist; + } else { + $backtopage = dol_buildpath('/hrm/skill_list.php', 1) . '?id=' . ($id > 0 ? $id : '__ID__'); + } + } + } + + if ($action == 'addSkill') { + $error = 0; + + if ($fk_skill <= 0) { + setEventMessage('ErrNoSkillSelected', 'errors'); + $error++; + } + + if (!$error) { + $skillAdded = new SkillRank($db); + $skillAdded->fk_skill = $fk_skill; + $skillAdded->fk_object = $id; + $skillAdded->objecttype = $objecttype; + $ret = $skillAdded->create($user); + if ($ret < 0) setEventMessage($skillAdded->error, 'errors'); + else unset($fk_skill); + } + } else if ($action == 'saveSkill') { + if (!empty($TNote)) { + foreach ($TNote as $skillId => $rank) { + $TSkills = $skill->fetchAll('ASC', 't.rowid', 0, 0, array('customsql' => 'fk_object=' . $id . ' AND objecttype="' . $objecttype . '" AND fk_skill = ' . $skillId)); + if (is_array($TSkills) && !empty($TSkills)) { + foreach ($TSkills as $tmpObj) { + $tmpObj->rank = $rank; + $tmpObj->update($user); + } + } + } + } + + } else if ($action == 'confirm_deleteskill' && $confirm == 'yes') { + $skillToDelete = new SkillRank($db); + $ret = $skillToDelete->fetch($lineid); + if ($ret > 0) { + $skillToDelete->delete($user); + } + } +} + +/* + * View + * + * Put here all code to build page + */ + +$form = new Form($db); +$formfile = new FormFile($db); +$formproject = new FormProjets($db); + +$title = $langs->trans("RequiredSkills"); +$help_url = ''; +llxHeader('', $title, $help_url); + +// Part to show record +if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) { + $res = $object->fetch_optionals(); + + // view configuration + if ($objecttype == 'job') { + dol_include_once('/hrm/lib/hrm_job.lib.php'); + $head = jobPrepareHead($object); + $listLink = dol_buildpath('/hrm/job_list.php', 1); + } else if ($objecttype == "user") { + require_once DOL_DOCUMENT_ROOT . "/core/lib/usergroups.lib.php"; + $object->getRights(); + $head = user_prepare_head($object); + $listLink = dol_buildpath('/user/list.php', 1); + } + + print dol_get_fiche_head($head, 'skill_tab', $langs->trans("Workstation"), -1, $object->picto); + + $formconfirm = ''; + + // Confirmation to delete + /*if ($action == 'delete') { + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteSkill'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1); + }*/ + // Confirmation to delete line + if ($action == 'ask_deleteskill') { + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&objecttype=' . $objecttype . '&lineid=' . $lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteskill', '', 0, 1); + } + // Clone confirmation + /*if ($action == 'clone') { + // Create an array for form + $formquestion = array(); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + }*/ + + // Call Hook formConfirm + $parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid); + $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + if (empty($reshook)) { + $formconfirm .= $hookmanager->resPrint; + } elseif ($reshook > 0) { + $formconfirm = $hookmanager->resPrint; + } + + // Print form confirm + print $formconfirm; + + + // Object card + // ------------------------------------------------------------ + $linkback = '' . $langs->trans("BackToList") . ''; + + $morehtmlref = '
    '; + $morehtmlref.= $object->label; + $morehtmlref .= '
    '; + + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref, '&objecttype='.$objecttype); + + + // table of skillRank linked to current object + $TSkills = $skill->fetchAll('ASC', 't.rowid', 0, 0, array('customsql' => 'fk_object=' . $id . ' AND objecttype="' . $objecttype . '"')); + +// $TAlreadyUsedSkill = array(); +// if (is_array($TSkills) && !empty($TSkills)) { +// foreach ($TSkills as $skillElement) { +// $TAlreadyUsedSkill[] = $skillElement->fk_skill; +// } +// } + + print '
    '; + print '
    '; + print '
    '; + print '' . "\n"; + $object->fields['label']['visible']=0; // Already in banner + include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php'; + print '
    '; + print '
    '; + + print '

    '; + + if ($objecttype != 'user' && $permissiontoadd) + { + // form pour ajouter des compétences + print '
    '; + print ''; + print ''; + print ''; + print '
    '; + print ''; + print ''; + print ''; + foreach ($skill->fields as $key => $infos) { + if ($key == 'fk_skill') { + print ''; + } + } + print ''; + print ''; + print '
    ' . $langs->trans('AddSkill') . '
    ' . $skill->showInputField($infos, $key, $$key) . '
    '; + print '
    '; + print '
    '; + + } + print '
    '; + + print '
    '; + + if ($objecttype != 'user' && $permissiontoadd) + { + print '
    '; + print ''; + print ''; + print ''; + } + print '
    '; + print ''; + print ''; + foreach ($skill->fields as $key => $infos) { + if($infos['label'] === 'Rank') $infos['label'] = 'RequiredRank'; + if ($infos['visible'] > 0) print ''; + } + print ''; + print ''; + print ''; + if (!is_array($TSkills) || empty($TSkills)) { + print ''; + } else { + $sk = new Skill($db); + foreach ($TSkills as $skillElement) { + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + } + } + + print '
    ' . $langs->trans($infos['label']) . '
    ' . $langs->trans("NoRecordFound") . '
    '; + $sk->fetch($skillElement->fk_skill); + print $sk->getNomUrl(1); + print ''; + print displayRankInfos($skillElement->rank, $skillElement->fk_skill, 'TNote', $objecttype == 'job' && $permissiontoadd ? 'edit' : 'view'); + print ''; + if ($objecttype != 'user' && $permissiontoadd) + { + print 'id . '">'; + print img_delete(); + print ''; + } + print '
    '; + if ($objecttype != 'user' && $permissiontoadd) print ''; + print '
    '; + if ($objecttype != 'user' && $permissiontoadd) print '
    '; + + + // liste des compétences liées + + print dol_get_fiche_end(); + + llxFooter(); + +} diff --git a/htdocs/langs/en_US/hrm.lang b/htdocs/langs/en_US/hrm.lang index da098e10bdb..b5a005a07ee 100644 --- a/htdocs/langs/en_US/hrm.lang +++ b/htdocs/langs/en_US/hrm.lang @@ -1,4 +1,6 @@ # Dolibarr language file - en_US - hrm + + # Admin HRM_EMAIL_EXTERNAL_SERVICE=Email to prevent HRM external service Establishments=Establishments @@ -17,3 +19,69 @@ Employees=Employees Employee=Employee NewEmployee=New employee ListOfEmployees=List of employees +HrmSetup = Hrm setup +HrmSetupPage = Hrm setup page +HRM_MAXRANK=Maximum rank for a skill +HRM_DEFAULT_SKILL_DESCRIPTION=Default description of ranks when skill is created +HrmAbout = About Hrm +traduction_note=Translate +deplacement=Shift +DateEval=Evaluation date +JobCard=Job card +Job=Job +Jobs=Jobs +NewSkill=New Skill +SkillType=Skill type +Skilldets=List of ranks for this skill +Skilldet=Skill level +rank=Rank +ErrNoSkillSelected=No skill selected +ErrSkillAlreadyAdded=This skill is already in the list +SkillHasNoLines=This skill has no lines +skill=Skill +Skills=Skills +SkillCard=Skill card +Eval=Evaluation +Evals=Evaluations +NewEval=New evaluation +ValidateEvaluation=Validate evaluation +ConfirmValidateEvaluation=Are you sure you want to validate this evaluation with reference %s? +EvaluationCard=Evaluation card +RequiredRank=Required rank for this job +Position=Position +Positions=Positions +PositionCard=Position card +EmployeesInThisPosition=Employees in this position +group1ToCompare=Usergroup to analyze +group2ToCompare=Second usergroup for comparison +OrJobToCompare=Compare to job skills requirements +difference=Difference +CompetenceAcquiredByOneOrMore=Competence acquired by one or more users but not requested by the second comparator +MaxlevelGreaterThan=Max level greater than the one requested +MaxLevelEqualTo=Max level equal to that demand +MaxLevelLowerThan= Max level lower than that demand +SkillNotAcquired=Skill not acquired by all users and requested by the second comparator +legend=Legend +TypeSkill=Skill type +AddSkill=Add skill to job +RequiredSkills=Required skills for this job +UserRank=User Rank +SkillList=Skill list +SaveRank=Save rank +knowHow=Know how +HowToBe=How to be +knowledge=Knowledge +AbandonmentComment=Abandonment comment +DateLastEval=Date last evaluation +NoEval=No evaluation done for this employee +HowManyUserWithThisMaxNote=Number of users with this rank +HighestRank=Highest rank +SkillComparison=Skill comparison +ReadSkillJobPosition=Read skills / jobs / positions +CreateUpdateSkillJobPosition=Create / update skills / jobs / positions +DeleteSkillJobPosition=Delete skills / jobs / positions +ReadEval=Read evaluations +CreateUpdateEval=Create / update evaluations +ValidateEval=Validate evaluations +DeleteEval=Delete evaluations +SeeComparisonMenu=Access skills comparison menu diff --git a/htdocs/langs/fr_FR/hrm.lang b/htdocs/langs/fr_FR/hrm.lang index 81fee383b56..9a2663d6714 100644 --- a/htdocs/langs/fr_FR/hrm.lang +++ b/htdocs/langs/fr_FR/hrm.lang @@ -1,4 +1,17 @@ -# Dolibarr language file - en_US - hrm +# Dolibarr language file - fr_FR - hrm + + +# +# Generic +# + +# Module label 'ModuleHrmName' +ModuleHrmName = GRH +# Module description 'ModuleHrmDesc' +ModuleHrmDesc = GRH description + + + # Admin HRM_EMAIL_EXTERNAL_SERVICE=Adresse email du service GRH externe à prévenir Establishments=Etablissements @@ -17,3 +30,69 @@ Employees=Salariés Employee=Salarié NewEmployee=Nouveau salarié ListOfEmployees=List des salariés +HrmSetup = Configuration GPEC +HrmSetupPage = Page de configuration du module GPEC +HRM_MAXRANK=Note maximale pour une compétence +HRM_DEFAULT_SKILL_DESCRIPTION=Description par défaut d'une note lors de la création d'une nouvelle compétence +HrmAbout = A propos du module GPEC +traduction_note=Translate +deplacement=Déplacement +DateEval=Date évaluation +JobCard=Fiche métier +Job=Métier +Jobs=Métiers +NewSkill=Nouvelle compétence +SkillType=Type de compétence +Skilldets=Liste des notes pour cette compétence +Skilldet=Skill level +rank=Note +ErrNoSkillSelected=Aucune compétence sélectionnée +ErrSkillAlreadyAdded=Cette compétence est déjà dans la liste +SkillHasNoLines=Cette compétence n'a pas de notes +skill=Compétence +Skills=Compétences +SkillCard=Fiche compétence +Eval=Evaluation +Evals=Evaluations +NewEval=Nouvelle evaluation +ValidateEvaluation=Valider évaluation +ConfirmValidateEvaluation=Etes vous sûr(e) de vouloir valider cette évaluation sous la référence %s? +EvaluationCard=Fiche évaluation +RequiredRank=Note requise pour ce métier +PositionCard=Fiche poste +EmployeesInThisPosition=Salariés occupant ce poste +Position=Poste +Positions=Postes +group1ToCompare=Groupe utilisateurs à analyser +group2ToCompare=Second groupe utilisateurs pour comparaison +OrJobToCompare=Comparer avec les compétences exigées pour un métier +difference=Différence +CompetenceAcquiredByOneOrMore=Compétence acquise par au moins un salarié mais non requise par le second élément de comparaison +MaxlevelGreaterThan=Niveau maximal supérieur au niveau requis +MaxLevelEqualTo=Niveau maximal égal au niveau requis +MaxLevelLowerThan= Niveau maximal inférieur au niveau requis +SkillNotAcquired=Compétence non acquise par tous les utilisateur et requise par le second élément de comparaison +legend=Légende +TypeSkill=Type de compétence +AddSkill=Ajouter une compétence à ce métier +RequiredSkills=Compétences requises pour ce métier +UserRank=Note utilisateur +SkillList=Liste des compétences +SaveRank=Enregistrer notes +knowHow=Savoir faire +HowToBe=Savoir être +knowledge=Savoir +AbandonmentComment=Commentaire abandon +DateLastEval=Date dernière évaluation +NoEval=Aucune évaluation effectuée pour ce salarié +HowManyUserWithThisMaxNote=Nombre d'utilisateurs ayant cette note +HighestRank=Note la plus haute +SkillComparison=Comparaison des compétences +ReadSkillJobPosition=Lire les compétences / métiers / postes +CreateUpdateSkillJobPosition=Créer / mettre à jour les compétences / métiers / postes +DeleteSkillJobPosition=Supprimer les compétences / métiers / postes +ReadEval=Lire les évaluations +CreateUpdateEval=Créer / mettre à jour les évaluations +ValidateEval=Valider les évaluations +DeleteEval=Supprimer les évaluations +SeeComparisonMenu=Accéder au menu de comparaison des compétences From 96c8743ee90589d25bcc1762a4bb3fa03821edd3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 27 Sep 2021 11:27:02 +0200 Subject: [PATCH 0508/1460] Look and feel --- htdocs/knowledgemanagement/knowledgerecord_list.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index e9fa70e53d2..75aa11cf771 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -371,13 +371,13 @@ $param .= $hookmanager->resPrint; // List of mass actions available $arrayofmassactions = array( - 'validate'=>$langs->trans("Validate"), - //'generate_doc'=>$langs->trans("ReGeneratePDF"), - //'builddoc'=>$langs->trans("PDFMerge"), - //'presend'=>$langs->trans("SendByMail"), + 'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"), + //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), + //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), + //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), ); if ($permissiontodelete) { - $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); + $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); From 6d92591358fb9974559397a00095b7cbb36d39d8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 26 Sep 2021 20:23:15 +0200 Subject: [PATCH 0509/1460] Fix look and feel v15 --- htdocs/admin/translation.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index 8d77e009cb3..7d78297b30d 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -37,6 +37,7 @@ if (!$user->admin) { $id = GETPOST('rowid', 'int'); $action = GETPOST('action', 'aZ09'); $optioncss = GETPOST('optionscss', 'aZ09'); +$contextpage = GETPOST('contextpage', 'aZ09'); $langcode = GETPOST('langcode', 'alphanohtml'); $transkey = GETPOST('transkey', 'alphanohtml'); @@ -458,18 +459,8 @@ if ($mode == 'searchkey') { print '
    '; print ''; - print ''; - print_liste_field_titre("Language_en_US_es_MX_etc", $_SERVER["PHP_SELF"], 'lang,transkey', '', $param, '', $sortfield, $sortorder); - print_liste_field_titre("Key", $_SERVER["PHP_SELF"], 'transkey', '', $param, '', $sortfield, $sortorder); - print_liste_field_titre("CurrentTranslationString", $_SERVER["PHP_SELF"], 'transvalue', '', $param, '', $sortfield, $sortorder); - //if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre("Entity", $_SERVER["PHP_SELF"], 'entity,transkey', '', $param, '', $sortfield, $sortorder); - print ''; - print "\n"; - // Line to search new record - print "\n"; - - print ''."\n"; @@ -495,6 +486,15 @@ if ($mode == 'searchkey') { print ''; print ''; + print ''; + print_liste_field_titre("Language_en_US_es_MX_etc", $_SERVER["PHP_SELF"], 'lang,transkey', '', $param, '', $sortfield, $sortorder); + print_liste_field_titre("Key", $_SERVER["PHP_SELF"], 'transkey', '', $param, '', $sortfield, $sortorder); + print_liste_field_titre("CurrentTranslationString", $_SERVER["PHP_SELF"], 'transvalue', '', $param, '', $sortfield, $sortorder); + //if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre("Entity", $_SERVER["PHP_SELF"], 'entity,transkey', '', $param, '', $sortfield, $sortorder); + print ''; + print "\n"; + + if ($sortfield == 'transkey' && strtolower($sortorder) == 'asc') { ksort($recordtoshow); } From c9ae46db50f4aee2775ca0839f86b9ad08b00a44 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 26 Sep 2021 20:56:17 +0200 Subject: [PATCH 0510/1460] FIX Filter on categories --- htdocs/comm/propal/list.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index dcba8a63ed8..a0877a50028 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -475,7 +475,7 @@ $sql .= ' u.login, u.lastname, u.firstname, u.email as user_email, u.statut as u if (!$user->rights->societe->client->voir && !$socid) { $sql .= ", sc.fk_soc, sc.fk_user"; } -if ($search_categ_cus) { +if (!empty($search_categ_cus) && $search_categ_cus != '-1') { $sql .= ", cc.fk_categorie, cc.fk_soc"; } // Add fields from extrafields @@ -493,7 +493,7 @@ $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s'; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)"; -if (!empty($search_categ_cus)) { +if (!empty($search_categ_cus) && $search_categ_cus != '-1') { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cc ON s.rowid = cc.fk_soc"; // We'll need this table joined to the select in order to filter by categ } $sql .= ', '.MAIN_DB_PREFIX.'propal as p'; @@ -592,6 +592,7 @@ if ($search_multicurrency_montant_ttc != '') { if ($sall) { $sql .= natural_search(array_keys($fieldstosearchall), $sall); } + if ($search_categ_cus > 0) { $sql .= " AND cc.fk_categorie = ".((int) $search_categ_cus); } From 9b825df158852f81e9c03486d8b377c3f2b65644 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 27 Sep 2021 11:36:40 +0200 Subject: [PATCH 0511/1460] Clean code --- htdocs/compta/facture/list.php | 2 +- htdocs/societe/list.php | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 0cdd2140b5d..5023d818f78 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -520,7 +520,7 @@ $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s'; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)"; -if (!empty($search_categ_cus) && $search_categ_cus!=-1) { +if (!empty($search_categ_cus) && $search_categ_cus != '-1') { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cc ON s.rowid = cc.fk_soc"; // We'll need this table joined to the select in order to filter by categ } diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 15c5e47cc99..988b2aad33e 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -89,9 +89,9 @@ $search_idprof4 = trim(GETPOST('search_idprof4', 'alpha')); $search_idprof5 = trim(GETPOST('search_idprof5', 'alpha')); $search_idprof6 = trim(GETPOST('search_idprof6', 'alpha')); $search_vat = trim(GETPOST('search_vat', 'alpha')); -$search_sale = trim(GETPOST("search_sale", 'int')); -$search_categ_cus = trim(GETPOST("search_categ_cus", 'int')); -$search_categ_sup = trim(GETPOST("search_categ_sup", 'int')); +$search_sale = GETPOST("search_sale", 'int'); +$search_categ_cus = GETPOST("search_categ_cus", 'int'); +$search_categ_sup = GETPOST("search_categ_sup", 'int'); $search_country = GETPOST("search_country", 'intcomma'); $search_type_thirdparty = GETPOST("search_type_thirdparty", 'int'); $search_price_level = GETPOST('search_price_level', 'int'); @@ -100,8 +100,8 @@ $search_status = GETPOST("search_status", 'int'); $search_type = GETPOST('search_type', 'alpha'); $search_level = GETPOST("search_level", "array"); $search_stcomm = GETPOST('search_stcomm', 'int'); -$search_import_key = GETPOST("search_import_key", "alpha"); -$search_parent_name = GETPOST('search_parent_name', 'alpha'); +$search_import_key = trim(GETPOST("search_import_key", "alpha")); +$search_parent_name = trim(GETPOST('search_parent_name', 'alpha')); $type = GETPOST('type', 'alpha'); $optioncss = GETPOST('optioncss', 'alpha'); @@ -494,7 +494,7 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_effectif as staff on (staff.id = s.fk_ef $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_regions as region on (region. code_region = state.fk_region)"; // We'll need this table joined to the select in order to filter by categ -if (!empty($search_categ_cus) && $search_categ_cus!=-1) { +if (!empty($search_categ_cus) && $search_categ_cus != '-1') { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cc ON s.rowid = cc.fk_soc"; // We'll need this table joined to the select in order to filter by categ } if (!empty($search_categ_sup) && $search_categ_sup!=-1) { From b77cadf39ac87aef4124327b6e792f9cde661c4e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 27 Sep 2021 11:38:34 +0200 Subject: [PATCH 0512/1460] Fix filter --- htdocs/contact/list.php | 6 +++--- htdocs/fourn/facture/list.php | 2 +- htdocs/societe/list.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index a63a1bf7e49..27c6208ad0d 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -570,13 +570,13 @@ if ($limit > 0 && $limit != $conf->liste_limit) { } $param .= '&begin='.urlencode($begin).'&userid='.urlencode($userid).'&contactname='.urlencode($sall); $param .= '&type='.urlencode($type).'&view='.urlencode($view); -if (!empty($search_categ)) { +if (!empty($search_categ) && $search_categ != '-1') { $param .= '&search_categ='.urlencode($search_categ); } -if (!empty($search_categ_thirdparty)) { +if (!empty($search_categ_thirdparty) && $search_categ_thirdparty != '-1') { $param .= '&search_categ_thirdparty='.urlencode($search_categ_thirdparty); } -if (!empty($search_categ_supplier)) { +if (!empty($search_categ_supplier) && $search_categ_supplier != '-1') { $param .= '&search_categ_supplier='.urlencode($search_categ_supplier); } if ($sall != '') { diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index ac64a9af82e..6c81904b794 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -441,7 +441,7 @@ $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s'; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)"; -if (!empty($search_categ_sup)) { +if (!empty($search_categ_sup) && $search_categ_supplier != '-1') { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_fournisseur as cs ON s.rowid = cs.fk_soc"; } diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 988b2aad33e..8b2236cd484 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -497,7 +497,7 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_regions as region on (region. code_regio if (!empty($search_categ_cus) && $search_categ_cus != '-1') { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cc ON s.rowid = cc.fk_soc"; // We'll need this table joined to the select in order to filter by categ } -if (!empty($search_categ_sup) && $search_categ_sup!=-1) { +if (!empty($search_categ_sup) && $search_categ_sup != '-1') { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_fournisseur as cs ON s.rowid = cs.fk_soc"; // We'll need this table joined to the select in order to filter by categ } $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."c_stcomm as st ON s.fk_stcomm = st.id"; From 37603b451a3cbd4701d5b5407de49d40d41e2c92 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 27 Sep 2021 12:24:01 +0200 Subject: [PATCH 0513/1460] Fix token in url --- htdocs/accountancy/admin/categories_list.php | 2 +- htdocs/accountancy/admin/subaccount.php | 6 +- htdocs/accountancy/bookkeeping/card.php | 6 +- htdocs/adherents/card.php | 2 +- htdocs/adherents/subscription.php | 4 +- htdocs/adherents/type.php | 8 +- htdocs/adherents/type_translation.php | 4 +- htdocs/admin/dav.php | 2 +- htdocs/admin/delais.php | 2 +- htdocs/admin/emailcollector_card.php | 8 +- htdocs/admin/eventorganization.php | 2 +- htdocs/admin/index.php | 2 +- htdocs/admin/knowledgemanagement.php | 2 +- htdocs/admin/limits.php | 2 +- htdocs/admin/mails.php | 2 +- htdocs/admin/mails_emailing.php | 2 +- htdocs/admin/mails_senderprofile_list.php | 2 +- htdocs/admin/mails_ticket.php | 2 +- htdocs/admin/translation.php | 10 +- htdocs/admin/website_options.php | 2 +- htdocs/admin/workstation.php | 2 +- htdocs/asset/admin/setup.php | 2 +- htdocs/asset/type.php | 4 +- htdocs/bom/tpl/objectline_view.tpl.php | 2 +- htdocs/categories/traduction.php | 4 +- htdocs/comm/action/card.php | 4 +- htdocs/comm/card.php | 12 +- htdocs/comm/propal/card.php | 22 ++-- htdocs/compta/bank/releve.php | 2 +- htdocs/compta/deplacement/card.php | 2 +- htdocs/compta/facture/card-rec.php | 14 +-- htdocs/compta/facture/card.php | 26 ++-- htdocs/compta/facture/prelevement.php | 12 +- htdocs/compta/paiement/cheque/card.php | 4 +- htdocs/compta/sociales/card.php | 4 +- htdocs/compta/tva/card.php | 4 +- .../default/tpl/contactcard_view.tpl.php | 4 +- htdocs/contact/card.php | 6 +- htdocs/contact/perso.php | 2 +- htdocs/contrat/card.php | 4 +- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/class/html.formfile.class.php | 2 +- htdocs/core/lib/company.lib.php | 4 +- htdocs/core/lib/ticket.lib.php | 2 +- htdocs/core/lib/treeview.lib.php | 2 +- htdocs/core/lib/usergroups.lib.php | 2 +- htdocs/core/tpl/extrafields_view.tpl.php | 2 +- htdocs/core/tpl/objectline_view.tpl.php | 8 +- htdocs/cron/card.php | 4 +- htdocs/datapolicy/admin/setup.php | 2 +- htdocs/delivery/card.php | 4 +- htdocs/don/card.php | 4 +- htdocs/ecm/dir_card.php | 4 +- .../conferenceorboothattendee_card.php | 4 +- htdocs/expedition/card.php | 6 +- htdocs/expedition/shipment.php | 16 +-- htdocs/expensereport/card.php | 8 +- htdocs/fichinter/card-rec.php | 2 +- htdocs/fichinter/card.php | 8 +- htdocs/fourn/card.php | 4 +- htdocs/fourn/commande/card.php | 16 +-- htdocs/fourn/commande/dispatch.php | 4 +- htdocs/fourn/facture/card.php | 16 +-- htdocs/holiday/card.php | 14 +-- htdocs/hrm/establishment/card.php | 2 +- htdocs/hrm/index.php | 2 +- .../knowledgerecord_card.php | 6 +- htdocs/loan/card.php | 4 +- htdocs/modulebuilder/index.php | 114 +++++++++--------- htdocs/modulebuilder/template/admin/setup.php | 2 +- htdocs/mrp/mo_card.php | 2 +- htdocs/partnership/partnership_card.php | 2 +- htdocs/product/card.php | 6 +- htdocs/product/dynamic_price/editor.php | 2 +- htdocs/product/price.php | 22 ++-- htdocs/product/stock/product.php | 4 +- htdocs/projet/card.php | 4 +- htdocs/projet/tasks/time.php | 4 +- htdocs/reception/card.php | 6 +- htdocs/recruitment/admin/setup.php | 2 +- .../recruitment/admin/setup_candidatures.php | 2 +- .../recruitmentcandidature_card.php | 2 +- .../recruitmentjobposition_card.php | 2 +- htdocs/resource/card.php | 2 +- htdocs/salaries/card.php | 4 +- .../canvas/company/tpl/card_view.tpl.php | 4 +- .../canvas/individual/tpl/card_view.tpl.php | 4 +- htdocs/societe/card.php | 16 +-- htdocs/societe/price.php | 4 +- .../tpl/linesalesrepresentative.tpl.php | 2 +- htdocs/supplier_proposal/card.php | 12 +- htdocs/takepos/invoice.php | 2 +- htdocs/ticket/agenda.php | 2 +- htdocs/ticket/card.php | 2 +- htdocs/ticket/class/actions_ticket.class.php | 2 +- htdocs/ticket/contact.php | 2 +- htdocs/ticket/document.php | 2 +- htdocs/ticket/messaging.php | 2 +- htdocs/user/bank.php | 2 +- htdocs/user/card.php | 6 +- htdocs/user/clicktodial.php | 2 +- htdocs/user/note.php | 2 +- htdocs/user/param_ihm.php | 6 +- htdocs/variants/list.php | 2 +- htdocs/website/index.php | 12 +- htdocs/website/websiteaccount_card.php | 2 +- htdocs/workstation/workstation_card.php | 2 +- htdocs/zapier/admin/setup.php | 2 +- 108 files changed, 319 insertions(+), 319 deletions(-) diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index cb931f550d8..2e369e19de1 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -811,7 +811,7 @@ if ($resql) { // Modify link if ($canbemodified) { - print ''; + print ''; } else { print ''; } diff --git a/htdocs/accountancy/admin/subaccount.php b/htdocs/accountancy/admin/subaccount.php index ad1804048c3..c3308393c27 100644 --- a/htdocs/accountancy/admin/subaccount.php +++ b/htdocs/accountancy/admin/subaccount.php @@ -439,13 +439,13 @@ if ($resql) { $e = ''; // Customer if ($obj->type == 1) { - $e .= ''.img_edit().''; + $e .= ''.img_edit().''; } elseif ($obj->type == 2) { // Supplier - $e .= ''.img_edit().''; + $e .= ''.img_edit().''; } elseif ($obj->type == 3) { // User - $e .= ''.img_edit().''; + $e .= ''.img_edit().''; } print $e; print ''."\n"; diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 1fab2cbf894..c71958691bd 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -433,7 +433,7 @@ if ($action == 'create') { print $langs->trans('Docdate'); print ''; if ($action != 'editdate') { - print ''; + print ''; } print '
    '; + print '
    '; //print $formadmin->select_language($langcode,'langcode',0,null,$langs->trans("All"),0,0,'',1); print $formadmin->select_language($langcode, 'langcode', 0, null, 0, 0, 0, 'maxwidth250', 1); print '
    '.img_edit().''.img_edit().' piece_num.'&mode='.$mode.'">'.img_edit($langs->transnoentitiesnoconv('SetDate'), 1).'piece_num).'&mode='.urlencode($mode).'">'.img_edit($langs->transnoentitiesnoconv('SetDate'), 1).'
    '; print ''; @@ -460,7 +460,7 @@ if ($action == 'create') { print $langs->trans('Codejournal'); print ''; if ($action != 'editjournal') { - print 'piece_num.'&mode='.$mode.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).''; + print 'piece_num).'&mode='.urlencode($mode).'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).''; } print ''; print ''; @@ -487,7 +487,7 @@ if ($action == 'create') { print $langs->trans('Piece'); print ''; if ($action != 'editdocref') { - print 'piece_num.'&mode='.$mode.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).''; + print 'piece_num).'&mode='.urlencode($mode).'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).''; } print ''; print ''; diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index dfc035bf1aa..dd96ff7dbbd 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1907,7 +1907,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Modify if (!empty($user->rights->adherent->creer)) { - print ''.$langs->trans("Modify").''."\n"; + print ''.$langs->trans("Modify").''."\n"; } else { print ''.$langs->trans("Modify").''."\n"; } diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index fcf65a5b668..26a45271801 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -587,7 +587,7 @@ if ($rowid > 0) { print $langs->trans("LinkedToDolibarrThirdParty"); print ''; if ($action != 'editthirdparty' && $user->rights->adherent->creer) { - print 'id.'">'.img_edit($langs->trans('SetLinkToThirdParty'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetLinkToThirdParty'), 1).''; } print ''; print ''; @@ -631,7 +631,7 @@ if ($rowid > 0) { if ($action != 'editlogin' && $user->rights->adherent->creer) { print ''; if ($user->rights->user->user->creer) { - print 'id.'">'.img_edit($langs->trans('SetLinkToUser'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetLinkToUser'), 1).''; } print ''; } diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 839e0c8ba47..6a294b0256a 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -481,12 +481,12 @@ if ($rowid > 0) { // Edit if ($user->rights->adherent->configurer) { - print ''; + print ''; } // Add if ($user->rights->adherent->configurer && !empty($object->status)) { - print ''; + print ''; } else { print ''; } @@ -728,10 +728,10 @@ if ($rowid > 0) { // Actions print ''; if ($user->rights->adherent->creer) { - print ''.img_edit().''; + print ''.img_edit().''; } if ($user->rights->adherent->supprimer) { - print ''.img_picto($langs->trans("Resiliate"), 'disable.png').''; + print ''.img_picto($langs->trans("Resiliate"), 'disable.png').''; } print ""; diff --git a/htdocs/adherents/type_translation.php b/htdocs/adherents/type_translation.php index 63ff01584b0..88f45c9c20e 100644 --- a/htdocs/adherents/type_translation.php +++ b/htdocs/adherents/type_translation.php @@ -185,9 +185,9 @@ print "\n
    \n"; if ($action == '') { if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''.$langs->trans("Add").''; + print ''.$langs->trans("Add").''; if ($cnt_trans > 0) { - print ''.$langs->trans("Update").''; + print ''.$langs->trans("Update").''; } } } diff --git a/htdocs/admin/dav.php b/htdocs/admin/dav.php index df14ef4c1b0..fab1787f5b9 100644 --- a/htdocs/admin/dav.php +++ b/htdocs/admin/dav.php @@ -145,7 +145,7 @@ if ($action == 'edit') { print ''; print ''; } diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index 2c6f9dc17c9..229fb3e2291 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -452,7 +452,7 @@ if ($action == 'edit') { print ''; } else { print '
    '; + print ''.$langs->trans("Modify").'
    '; } // End of page diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index 9b45716d152..be3ab2d63c1 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -656,7 +656,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; // Delete print ''; - print ''.img_edit().''; + print ''.img_edit().''; print ' '.img_delete().''; print ''; print ''; @@ -693,14 +693,14 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (empty($reshook)) { // Edit - print ''; + print ''; // Clone - print ''; + print ''; // Collect now if (count($object->actions) > 0) { - print ''; + print ''; } else { print ''; } diff --git a/htdocs/admin/eventorganization.php b/htdocs/admin/eventorganization.php index 36ba50818c6..06309a2706e 100644 --- a/htdocs/admin/eventorganization.php +++ b/htdocs/admin/eventorganization.php @@ -376,7 +376,7 @@ if ($action == 'edit') { print ''; print ''; } else { print '
    '.$langs->trans("NothingToSetup"); diff --git a/htdocs/admin/index.php b/htdocs/admin/index.php index c02ee501d94..7dcc5a356b5 100644 --- a/htdocs/admin/index.php +++ b/htdocs/admin/index.php @@ -82,7 +82,7 @@ print '

    '; if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) { $setupcompanynotcomplete = 1; } -print img_picto('', 'company', 'class="paddingright valignmiddle double"').' '.$langs->trans("SetupDescriptionLink", DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete) ? '' : '&action=edit'), $langs->transnoentities("Setup"), $langs->transnoentities("MenuCompanySetup")); +print img_picto('', 'company', 'class="paddingright valignmiddle double"').' '.$langs->trans("SetupDescriptionLink", DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete) ? '' : '&action=edit&token='.newToken()), $langs->transnoentities("Setup"), $langs->transnoentities("MenuCompanySetup")); print '

    '.$langs->trans("SetupDescription3b"); if (!empty($setupcompanynotcomplete)) { $langs->load("errors"); diff --git a/htdocs/admin/knowledgemanagement.php b/htdocs/admin/knowledgemanagement.php index b886e6faf39..10f308b2b2c 100644 --- a/htdocs/admin/knowledgemanagement.php +++ b/htdocs/admin/knowledgemanagement.php @@ -324,7 +324,7 @@ if ($action == 'edit') { print ''; print ''; } else { //print '
    '.$langs->trans("NothingToSetup"); diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php index ef0c996569f..6246f9c09c3 100644 --- a/htdocs/admin/limits.php +++ b/htdocs/admin/limits.php @@ -190,7 +190,7 @@ if ($action == 'edit') { print '
    '; print ''; } diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index de160a1c946..1c38ec8e6d7 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -784,7 +784,7 @@ if ($action == 'edit') { // Actions button print '
    '; - print ''.$langs->trans("Modify").''; + print ''.$langs->trans("Modify").''; if (empty($conf->global->MAIN_DISABLE_ALL_MAILS)) { if ($conf->global->MAIN_MAIL_SENDMODE != 'mail' || !$linuxlike) { diff --git a/htdocs/admin/mails_emailing.php b/htdocs/admin/mails_emailing.php index 436ffa3d003..360ea07defd 100644 --- a/htdocs/admin/mails_emailing.php +++ b/htdocs/admin/mails_emailing.php @@ -515,7 +515,7 @@ if ($action == 'edit') { print '
    '; - print ''.$langs->trans("Modify").''; + print ''.$langs->trans("Modify").''; if (!empty($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'default') { if ($conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'mail' || !$linuxlike) { diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index baa8c3688d8..9cabe4a8e98 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -632,7 +632,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if ($sortorder) { $url .= '&page='.urlencode($sortorder); } - print ''.img_edit().''; + print ''.img_edit().''; //print '   '; print ''.img_delete().'   '; if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined diff --git a/htdocs/admin/mails_ticket.php b/htdocs/admin/mails_ticket.php index 667f58807dc..ce4bc76c20d 100644 --- a/htdocs/admin/mails_ticket.php +++ b/htdocs/admin/mails_ticket.php @@ -479,7 +479,7 @@ if ($action == 'edit') { print '
    '; - print ''.$langs->trans("Modify").''; + print ''.$langs->trans("Modify").''; if (!empty($conf->global->MAIN_MAIL_SENDMODE_TICKET) && $conf->global->MAIN_MAIL_SENDMODE_TICKET != 'default') { if ($conf->global->MAIN_MAIL_SENDMODE_TICKET != 'mail' || !$linuxlike) { diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index d15c128d549..4dd5ceab503 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -358,7 +358,7 @@ if ($mode == 'overwrite') { print '   '; print ''; } else { - print ''.img_edit().''; + print ''.img_edit().''; print '   '; print ''.img_delete().''; } @@ -545,9 +545,9 @@ if ($mode == 'searchkey') { if ($result) { $obj = $db->fetch_object($result); } - print ''.img_edit().''; + print ''.img_edit().''; print ' '; - print ''.img_delete().''; + print ''.img_delete().''; print '  '; $htmltext = $langs->trans("OriginalValueWas", ''.$newlangfileonly->tab_translate[$key].''); print $form->textwithpicto('', $htmltext, 1, 'info'); @@ -574,9 +574,9 @@ if ($mode == 'searchkey') { if ($result) { $obj = $db->fetch_object($result); } - print ''.img_edit().''; + print ''.img_edit().''; print ' '; - print ''.img_delete().''; + print ''.img_delete().''; print '  '; $htmltext = $langs->trans("TransKeyWithoutOriginalValue", $key); diff --git a/htdocs/admin/website_options.php b/htdocs/admin/website_options.php index f72235eb8b0..f6c92888384 100644 --- a/htdocs/admin/website_options.php +++ b/htdocs/admin/website_options.php @@ -136,7 +136,7 @@ if ($action == 'edit') { print ''; print ''; } diff --git a/htdocs/admin/workstation.php b/htdocs/admin/workstation.php index 76556fb4d68..83241f2a9e2 100755 --- a/htdocs/admin/workstation.php +++ b/htdocs/admin/workstation.php @@ -214,7 +214,7 @@ if ($action == 'edit') { print ''; print ''; }/* else { print '
    '.$langs->trans("NothingToSetup"); diff --git a/htdocs/asset/admin/setup.php b/htdocs/asset/admin/setup.php index 07da0541619..a90c2b479c4 100644 --- a/htdocs/asset/admin/setup.php +++ b/htdocs/asset/admin/setup.php @@ -98,7 +98,7 @@ if ($action == 'edit') { print ''; print ''; } diff --git a/htdocs/asset/type.php b/htdocs/asset/type.php index 65175a86c5e..46f455f86d4 100644 --- a/htdocs/asset/type.php +++ b/htdocs/asset/type.php @@ -298,7 +298,7 @@ if (!$rowid && $action != 'create' && $action != 'edit') { print ''; if ($user->rights->asset->write) { - print 'rowid.'">'.img_edit().''; + print 'rowid.'">'.img_edit().''; } else { print ' '; } @@ -503,7 +503,7 @@ if ($rowid > 0) { // Edit if ($user->rights->asset->write) { - print ''; + print ''; } // Delete diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index 2c3896a6282..9ef77fb0d98 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -121,7 +121,7 @@ if ($this->status == 0 && ($object_rights->write) && $action != 'selectlines') { $coldisplay++; if (($line->info_bits & 2) == 2 || !empty($disableedit)) { } else { - print 'id.'">'.img_edit().''; + print 'id.'">'.img_edit().''; } print ''; diff --git a/htdocs/categories/traduction.php b/htdocs/categories/traduction.php index 80f64210bf5..2bbb4b5f0a8 100644 --- a/htdocs/categories/traduction.php +++ b/htdocs/categories/traduction.php @@ -231,9 +231,9 @@ print "\n
    \n"; if ($action == '') { if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''.$langs->trans('Add').''; + print ''.$langs->trans('Add').''; if ($cnt_trans > 0) { - print ''.$langs->trans('Update').''; + print ''.$langs->trans('Update').''; } } } diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 8a10b39826f..e56a2e89fcf 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1688,7 +1688,7 @@ if ($id > 0) { print img_picto('', 'project', 'class="paddingrightonly"'); $numprojet = $formproject->select_projects(($object->socid > 0 ? $object->socid : -1), $object->fk_project, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 'maxwidth500'); if ($numprojet == 0) { - print '   '; + print '   '; } print ''; } @@ -2168,7 +2168,7 @@ if ($id > 0) { if ($action != 'edit') { if ($user->rights->agenda->allactions->create || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create)) { - print ''; + print ''; } else { print ''; } diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index f891bf722cc..c9f422d78c8 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -406,7 +406,7 @@ if ($object->id > 0) { print $langs->trans('PaymentConditions'); print ''; if (($action != 'editconditions') && $user->rights->societe->creer) { - print 'id.'">'.img_edit($langs->trans('SetConditions'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetConditions'), 1).''; } print ''; print ''; @@ -424,7 +424,7 @@ if ($object->id > 0) { print $langs->trans('PaymentMode'); print ''; if (($action != 'editmode') && $user->rights->societe->creer) { - print 'id.'">'.img_edit($langs->trans('SetMode'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetMode'), 1).''; } print ''; print ''; @@ -443,7 +443,7 @@ if ($object->id > 0) { print $langs->trans('PaymentBankAccount'); print ''; if (($action != 'editbankaccount') && $user->rights->societe->creer) { - print 'id.'">'.img_edit($langs->trans('SetBankAccount'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetBankAccount'), 1).''; } print ''; print ''; @@ -569,7 +569,7 @@ if ($object->id > 0) { print $langs->trans('SendingMethod'); print ''; if (($action != 'editshipping') && $user->rights->societe->creer) { - print 'id.'">'.img_edit($langs->trans('SetMode'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetMode'), 1).''; } print ''; print ''; @@ -589,7 +589,7 @@ if ($object->id > 0) { print $langs->trans('IntracommReportTransportMode'); print ''; if (($action != 'edittransportmode') && $user->rights->societe->creer) { - print 'id.'">'.img_edit($langs->trans('SetMode'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetMode'), 1).''; } print ''; print ''; @@ -652,7 +652,7 @@ if ($object->id > 0) { print $langs->trans('ProspectLevel'); print ''; if ($action != 'editlevel' && $user->rights->societe->creer) { - print 'id.'">'.img_edit($langs->trans('Modify'), 1).''; + print 'id.'">'.img_edit($langs->trans('Modify'), 1).''; } print ''; print ''; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index b5f05e72795..cff5c5d0e35 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2093,7 +2093,7 @@ if ($action == 'create') { print $langs->trans('DatePropal'); print ''; if ($action != 'editdate' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) { - print 'id.'">'.img_edit($langs->trans('SetDate'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetDate'), 1).''; } print ''; print ''; @@ -2120,7 +2120,7 @@ if ($action == 'create') { print $langs->trans('DateEndPropal'); print ''; if ($action != 'editecheance' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) { - print 'id.'">'.img_edit($langs->trans('SetConditions'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetConditions'), 1).''; } print ''; print ''; @@ -2150,7 +2150,7 @@ if ($action == 'create') { print $langs->trans('PaymentConditionsShort'); print ''; if ($action != 'editconditions' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) { - print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetConditions'), 1).''; + print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetConditions'), 1).''; } print ''; print ''; @@ -2169,7 +2169,7 @@ if ($action == 'create') { print $langs->trans('PaymentMode'); print ''; if ($action != 'editmode' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) { - print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetMode'), 1).''; + print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetMode'), 1).''; } print ''; print ''; @@ -2198,7 +2198,7 @@ if ($action == 'create') { } print ''; if ($action != 'editavailability' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) { - print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetAvailability'), 1).''; + print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetAvailability'), 1).''; } print ''; print ''; @@ -2218,7 +2218,7 @@ if ($action == 'create') { print $langs->trans('SendingMethod'); print ''; if ($action != 'editshippingmethod' && $usercancreate) { - print 'id.'">'.img_edit($langs->trans('SetShippingMode'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetShippingMode'), 1).''; } print ''; print ''; @@ -2255,7 +2255,7 @@ if ($action == 'create') { print $langs->trans('Source'); print ''; if ($action != 'editdemandreason' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) { - print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetDemandReason'), 1).''; + print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetDemandReason'), 1).''; } print ''; print ''; @@ -2276,7 +2276,7 @@ if ($action == 'create') { print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0); print ''; if ($action != 'editmulticurrencycode' && $object->statut == $object::STATUS_DRAFT && $usercancreate) { - print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).''; + print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).''; } print ''; print ''; @@ -2296,7 +2296,7 @@ if ($action == 'create') { print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0); print ''; if ($action != 'editmulticurrencyrate' && $object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency && $usercancreate) { - print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).''; + print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).''; } print ''; print ''; @@ -2337,7 +2337,7 @@ if ($action == 'create') { print $langs->trans('BankAccount'); print ''; if ($action != 'editbankaccount' && $usercancreate) { - print 'id.'">'.img_edit($langs->trans('SetBankAccount'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetBankAccount'), 1).''; } print ''; print ''; @@ -2373,7 +2373,7 @@ if ($action == 'create') { print $langs->trans('IncotermLabel'); print ''; if ($usercancreate) { - print ''.img_edit().''; + print ''.img_edit().''; } else { print ' '; } diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index 97184c1b8eb..af0b388cb7a 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -364,7 +364,7 @@ if (empty($numref)) { print ''; if ($user->rights->banque->consolidate && $action != 'editbankreceipt') { - print 'numr.'">'.img_edit().''; + print 'numr).'">'.img_edit().''; } print ''; diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php index 77db777c077..33b453cd0b4 100644 --- a/htdocs/compta/deplacement/card.php +++ b/htdocs/compta/deplacement/card.php @@ -469,7 +469,7 @@ if ($action == 'create') { if ($object->statut < Deplacement::STATUS_REFUNDED) { // if not refunded if ($user->rights->deplacement->creer) { - print ''.$langs->trans('Modify').''; + print ''.$langs->trans('Modify').''; } else { print ''.$langs->trans('Modify').''; } diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index 153bd58114d..28143d0340a 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -1269,7 +1269,7 @@ if ($action == 'create') { print $langs->trans('PaymentConditionsShort'); print ''; if ($action != 'editconditions' && $user->rights->facture->creer) { - print 'id.'">'.img_edit($langs->trans('SetConditions'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetConditions'), 1).''; } print ''; print ''; @@ -1290,7 +1290,7 @@ if ($action == 'create') { print $langs->trans('PaymentMode'); print ''; if ($action != 'editmode' && $user->rights->facture->creer) { - print 'id.'">'.img_edit($langs->trans('SetMode'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetMode'), 1).''; } print ''; print ''; @@ -1310,7 +1310,7 @@ if ($action == 'create') { print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0); print ''; if ($usercancreate && $action != 'editmulticurrencycode' && !empty($object->brouillon)) { - print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).''; + print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).''; } print ''; print ''; @@ -1326,7 +1326,7 @@ if ($action == 'create') { print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0); print ''; if ($usercancreate && $action != 'editmulticurrencyrate' && !empty($object->brouillon) && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) { - print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).''; + print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).''; } print ''; print ''; @@ -1398,7 +1398,7 @@ if ($action == 'create') { print $langs->trans('BankAccount'); print ''; if (($action != 'editbankaccount') && $user->rights->facture->creer && $object->statut == FactureRec::STATUS_DRAFT) { - print 'id.'">'.img_edit($langs->trans('SetBankAccount'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetBankAccount'), 1).''; } print ''; print ''; @@ -1416,7 +1416,7 @@ if ($action == 'create') { print $langs->trans('Model'); print ''; if (($action != 'editmodelpdf') && $user->rights->facture->creer && $object->statut == FactureRec::STATUS_DRAFT) { - print 'id.'">'.img_edit($langs->trans('SetModel'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetModel'), 1).''; } print ''; print ''; @@ -1463,7 +1463,7 @@ if ($action == 'create') { print $langs->trans('Frequency'); print ''; if ($action != 'editfrequency' && $user->rights->facture->creer) { - print 'id.'">'.img_edit($langs->trans('Edit'), 1).''; + print 'id.'">'.img_edit($langs->trans('Edit'), 1).''; } print ''; print ''; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 7ddb90cd4da..764af7a232a 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4336,7 +4336,7 @@ if ($action == 'create') { print $langs->trans('DateInvoice'); print ''; if ($action != 'editinvoicedate' && !empty($object->brouillon) && $usercancreate && empty($conf->global->FAC_FORCE_DATE_VALIDATION)) { - print 'id.'">'.img_edit($langs->trans('SetDate'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetDate'), 1).''; } print ''; print ''; @@ -4356,7 +4356,7 @@ if ($action == 'create') { print ''; - print ''; + print ''; print '
    '; print $langs->trans('DatePointOfTax'); print 'id.'">'.img_edit($langs->trans('SetDate'), 1).'id.'">'.img_edit($langs->trans('SetDate'), 1).'
    '; print ''; if ($action == 'editdate_pointoftax') { @@ -4373,7 +4373,7 @@ if ($action == 'create') { print $langs->trans('PaymentConditionsShort'); print ''; if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editconditions' && $usercancreate) { - print 'id.'">'.img_edit($langs->trans('SetConditions'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetConditions'), 1).''; } print ''; print ''; @@ -4394,7 +4394,7 @@ if ($action == 'create') { print $langs->trans('DateMaxPayment'); print ''; if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editpaymentterm' && $usercancreate) { - print 'id.'">'.img_edit($langs->trans('SetDate'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetDate'), 1).''; } print ''; print ''; @@ -4418,7 +4418,7 @@ if ($action == 'create') { print $langs->trans('PaymentMode'); print ''; if ($action != 'editmode' && $usercancreate) { - print 'id.'">'.img_edit($langs->trans('SetMode'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetMode'), 1).''; } print ''; print ''; @@ -4438,7 +4438,7 @@ if ($action == 'create') { print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0); print ''; if ($usercancreate && $action != 'editmulticurrencycode' && !empty($object->brouillon)) { - print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).''; + print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).''; } print ''; print ''; @@ -4454,7 +4454,7 @@ if ($action == 'create') { print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0); print ''; if ($usercancreate && $action != 'editmulticurrencyrate' && !empty($object->brouillon) && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) { - print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).''; + print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).''; } print ''; print ''; @@ -4482,7 +4482,7 @@ if ($action == 'create') { print $langs->trans('BankAccount'); print ''; if (($action != 'editbankaccount') && $usercancreate) { - print 'id.'">'.img_edit($langs->trans('SetBankAccount'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetBankAccount'), 1).''; } print ''; print ''; @@ -4502,7 +4502,7 @@ if ($action == 'create') { print $langs->trans('IncotermLabel'); print ''; if ($usercancreate) { - print ''.img_edit().''; + print ''.img_edit().''; } else { print ' '; } @@ -4532,7 +4532,7 @@ if ($action == 'create') { print $langs->trans('RetainedWarranty'); print ''; if ($action != 'editretainedwarranty' && $user->rights->facture->creer) { - print 'id.'">'.img_edit($langs->trans('setretainedwarranty'), 1).''; + print 'id.'">'.img_edit($langs->trans('setretainedwarranty'), 1).''; } print ''; @@ -4555,7 +4555,7 @@ if ($action == 'create') { print $langs->trans('PaymentConditionsShortRetainedWarranty'); print ''; if ($action != 'editretainedwarrantypaymentterms' && $user->rights->facture->creer) { - print 'id.'">'.img_edit($langs->trans('setPaymentConditionsShortRetainedWarranty'), 1).''; + print 'id.'">'.img_edit($langs->trans('setPaymentConditionsShortRetainedWarranty'), 1).''; } print ''; @@ -4590,7 +4590,7 @@ if ($action == 'create') { print $langs->trans('RetainedWarrantyDateLimit'); print ''; if ($action != 'editretainedwarrantydatelimit' && $user->rights->facture->creer) { - print 'id.'">'.img_edit($langs->trans('setretainedwarrantyDateLimit'), 1).''; + print 'id.'">'.img_edit($langs->trans('setretainedwarrantyDateLimit'), 1).''; } print ''; @@ -4676,7 +4676,7 @@ if ($action == 'create') { print $langs->trans('RevenueStamp'); print ''; if ($action != 'editrevenuestamp' && !empty($object->brouillon) && $usercancreate) { - print 'id.'">'.img_edit($langs->trans('SetRevenuStamp'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetRevenuStamp'), 1).''; } print ''; print ''; diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index e94fd6f5e1b..7e5a7047060 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -363,7 +363,7 @@ if ($object->id > 0) { print $langs->trans('DateInvoice'); print ''; if ($object->type != $object::TYPE_CREDIT_NOTE && $action != 'editinvoicedate' && !empty($object->brouillon) && $user->rights->facture->creer) { - print 'id.'">'.img_edit($langs->trans('SetDate'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetDate'), 1).''; } print ''; print ''; @@ -386,7 +386,7 @@ if ($object->id > 0) { print $langs->trans('PaymentConditionsShort'); print ''; if ($object->type != $object::TYPE_CREDIT_NOTE && $action != 'editconditions' && !empty($object->brouillon) && $user->rights->facture->creer) { - print 'id.'">'.img_edit($langs->trans('SetConditions'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetConditions'), 1).''; } print ''; print ''; @@ -407,7 +407,7 @@ if ($object->id > 0) { print $langs->trans('DateMaxPayment'); print ''; if ($object->type != $object::TYPE_CREDIT_NOTE && $action != 'editpaymentterm' && !empty($object->brouillon) && $user->rights->facture->creer) { - print 'id.'">'.img_edit($langs->trans('SetDate'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetDate'), 1).''; } print ''; print ''; @@ -436,7 +436,7 @@ if ($object->id > 0) { print $langs->trans('PaymentMode'); print ''; if ($action != 'editmode' && !empty($object->brouillon) && $user->rights->facture->creer) { - print 'id.'">'.img_edit($langs->trans('SetMode'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetMode'), 1).''; } print ''; print ''; @@ -453,7 +453,7 @@ if ($object->id > 0) { print $langs->trans('BankAccount'); print ''; if (($action != 'editbankaccount') && $user->rights->commande->creer && !empty($object->brouillon)) { - print 'id.'">'.img_edit($langs->trans('SetBankAccount'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetBankAccount'), 1).''; } print ''; print ''; @@ -537,7 +537,7 @@ if ($object->id > 0) { print $langs->trans('RevenueStamp'); print ''; if ($action != 'editrevenuestamp' && !empty($object->brouillon) && $user->rights->facture->creer) { - print 'id.'">'.img_edit($langs->trans('SetRevenuStamp'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetRevenuStamp'), 1).''; } print ''; print ''; diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index 61d295a29b0..9b235926421 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -529,7 +529,7 @@ if ($action == 'new') { print $langs->trans('Date'); print ''; if ($action != 'editdate') { - print 'id.'">'.img_edit($langs->trans('SetDate'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetDate'), 1).''; } print ''; print ''; @@ -554,7 +554,7 @@ if ($action == 'new') { print ''; - if ($action != 'editrefext') print ''; + if ($action != 'editrefext') print ''; print '
    '; print $langs->trans('RefExt'); print 'id.'">'.img_edit($langs->trans('SetRefExt'),1).'id.'">'.img_edit($langs->trans('SetRefExt'),1).'
    '; print ''; if ($action == 'editrefext') diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index f436c47b10e..1223ad3ec36 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -577,7 +577,7 @@ if ($id > 0) { print $langs->trans('DefaultPaymentMode'); print ''; if ($action != 'editmode') { - print 'id.'">'.img_edit($langs->trans('SetMode'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetMode'), 1).''; } print ''; print ''; @@ -595,7 +595,7 @@ if ($id > 0) { print $langs->trans('DefaultBankAccount'); print ''; if ($action != 'editbankaccount' && $user->rights->tax->charges->creer) { - print 'id.'">'.img_edit($langs->trans('SetBankAccount'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetBankAccount'), 1).''; } print ''; print ''; diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index 363af314113..83740385f2b 100755 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -573,7 +573,7 @@ if ($id) { print $langs->trans('PaymentMode'); print ''; if ($action != 'editmode') { - print 'id.'">'.img_edit($langs->trans('SetMode'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetMode'), 1).''; } print ''; print ''; @@ -591,7 +591,7 @@ if ($id) { print $langs->trans('BankAccount'); print ''; if ($action != 'editbankaccount' && $user->rights->tax->charges->creer) { - print 'id.'">'.img_edit($langs->trans('SetBankAccount'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetBankAccount'), 1).''; } print ''; print ''; diff --git a/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php b/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php index e458cdf3016..adf5bb722d3 100644 --- a/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php +++ b/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php @@ -139,11 +139,11 @@ if (!empty($this->control->tpl['action_delete'])) { if (empty($user->socid)) { print '
    '; if ($user->rights->societe->contact->creer) { - print ''.$langs->trans('Modify').''; + print ''.$langs->trans('Modify').''; } if (!$this->control->tpl['user_id'] && $user->rights->user->user->creer) { - print ''.$langs->trans("CreateDolibarrLogin").''; + print ''.$langs->trans("CreateDolibarrLogin").''; } if ($user->rights->societe->contact->supprimer) { diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 44ace66f05b..8ae2deae1cf 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -1348,7 +1348,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print $langs->trans('ProspectLevel'); print ''; if ($action != 'editlevel' && $user->rights->societe->contact->creer) { - print 'id.'">'.img_edit($langs->trans('Modify'), 1).''; + print 'id.'">'.img_edit($langs->trans('Modify'), 1).''; } print ''; print ''; @@ -1486,11 +1486,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } if ($user->rights->societe->contact->creer) { - print ''.$langs->trans('Modify').''; + print ''.$langs->trans('Modify').''; } if (!$object->user_id && $user->rights->user->user->creer) { - print ''.$langs->trans("CreateDolibarrLogin").''; + print ''.$langs->trans("CreateDolibarrLogin").''; } // Activer diff --git a/htdocs/contact/perso.php b/htdocs/contact/perso.php index a5b64e37998..285f71cae48 100644 --- a/htdocs/contact/perso.php +++ b/htdocs/contact/perso.php @@ -311,7 +311,7 @@ if ($action != 'edit') { print '
    '; if ($user->rights->societe->contact->creer) { - print ''.$langs->trans('Modify').''; + print ''.$langs->trans('Modify').''; } print "
    "; diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index bf9208ccb2b..9d8cdb78912 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1541,12 +1541,12 @@ if ($action == 'create') { print ''; if ($user->rights->contrat->creer && count($arrayothercontracts) && ($object->statut >= 0)) { print ''; - print ''; + print ''; print img_picto($langs->trans("MoveToAnotherContract"), 'uparrow'); print ''; } if ($user->rights->contrat->creer && ($object->statut >= 0)) { - print ''; + print ''; print img_edit(); print ''; } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 01bd1a13141..8deda2ecd09 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -165,7 +165,7 @@ class Form $ret .= ''; } if ($htmlname && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) { - $ret .= 'id.$moreparam.'">'.img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)).''; + $ret .= 'id.$moreparam.'">'.img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)).''; } if (!empty($notabletag) && $notabletag == 1) { $ret .= ' : '; diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index ca7e939fb6f..975738b3809 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1454,7 +1454,7 @@ class FormFile if ($permtoeditline) { $paramsectiondir = (in_array($modulepart, array('medias', 'ecm')) ? '§ion_dir='.urlencode($relativepath) : ''); - print ''.img_edit('default', 0, 'class="paddingrightonly"').''; + print ''.img_edit('default', 0, 'class="paddingrightonly"').''; } } if ($permonobject) { diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 1d8024cf40e..0adcb967991 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1295,7 +1295,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '') // Edit if ($user->rights->societe->contact->creer) { - print ''; + print ''; print img_edit(); print ''; } @@ -2003,7 +2003,7 @@ function show_subsidiaries($conf, $langs, $db, $object) print ''.$obj->code_client.''; print ''; - print ''; + print ''; print img_edit(); print ''; diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index ba18e415539..e2067240c45 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -699,7 +699,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no if ($user->rights->agenda->allactions->create || (($actionstatic->authorid == $user->id || $actionstatic->userownerid == $user->id) && $user->rights->agenda->myactions->create)) { - $out .= ''; + $out .= ''; } $out .= ''; diff --git a/htdocs/core/lib/treeview.lib.php b/htdocs/core/lib/treeview.lib.php index fda21e28a21..05e6d51a78d 100644 --- a/htdocs/core/lib/treeview.lib.php +++ b/htdocs/core/lib/treeview.lib.php @@ -190,7 +190,7 @@ function tree_recur($tab, $pere, $rang, $iddivjstree = 'iddivjstree', $donoreset print "\n".'
  • '; if ($showfk) { print ''; + print ''; } print '
    '; - print '   '; + print '   '; print $tab[$x]['title']; print ''; print '  (mainmenu='.$tab[$x]['mainmenu'].' leftmenu='.$tab[$x]['leftmenu'].' - fk_mainmenu='.$tab[$x]['fk_mainmenu'].' fk_leftmenu='.$tab[$x]['fk_leftmenu'].')'; diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 29f208e5254..7a9bb12172b 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -400,7 +400,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) if (!file_exists($file)) { $url = DOL_URL_ROOT.'/public/theme/common/nophoto.png'; } - print ''; + print ''; if ($subdir == $conf->global->MAIN_THEME) { $title = $langs->trans("ThemeCurrentlyActive"); } else { diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index f50276821b1..cd58ae554f2 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -208,7 +208,7 @@ if (empty($reshook) && isset($extrafields->attributes[$object->table_element]['l $fieldid = 'socid'; } - print ''.img_edit().''.img_edit().'
    '; print ''; diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 8ebb767a4d8..6a7d48add5e 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -384,7 +384,7 @@ if ($this->statut == 0 && !empty($object_rights->creer) && $action != 'selectlin $coldisplay++; if (($line->info_bits & 2) == 2 || !empty($disableedit)) { } else { ?> - id.'#line_'.$line->id; ?>"> + id.'#line_'.$line->id; ?>"> '; } print ''; @@ -392,7 +392,7 @@ if ($this->statut == 0 && !empty($object_rights->creer) && $action != 'selectlin print ''; $coldisplay++; if (!$situationinvoicelinewithparent && empty($disableremove)) { // For situation invoice, deletion is not possible if there is a parent company. - print 'id.'">'; + print 'id.'">'; print img_delete(); print ''; } @@ -402,12 +402,12 @@ if ($this->statut == 0 && !empty($object_rights->creer) && $action != 'selectlin print ''; $coldisplay++; if ($i > 0) { ?> - id; ?>"> + id; ?>"> - id; ?>"> + id; ?>"> rights->cron->create) { print ''.$langs->trans("Edit").''; } else { - print ''.$langs->trans("Edit").''; + print ''.$langs->trans("Edit").''; } if ((empty($user->rights->cron->execute))) { @@ -753,7 +753,7 @@ if (($action == "create") || ($action == "edit")) { } elseif (empty($object->status)) { print ''.$langs->trans("CronExecute").''; } else { - print ''.$langs->trans("CronExecute").''; + print ''.$langs->trans("CronExecute").''; } if (!$user->rights->cron->create) { diff --git a/htdocs/datapolicy/admin/setup.php b/htdocs/datapolicy/admin/setup.php index dde8644571e..8f25461eb64 100644 --- a/htdocs/datapolicy/admin/setup.php +++ b/htdocs/datapolicy/admin/setup.php @@ -175,7 +175,7 @@ if ($action == 'edit') { print ''; print ''; } diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php index c72718ffce2..cca399f43af 100644 --- a/htdocs/delivery/card.php +++ b/htdocs/delivery/card.php @@ -427,7 +427,7 @@ if ($action == 'create') { // Create. Seems to no be used print ''; if ($action != 'editdate_delivery') { - print 'id.'">'.img_edit($langs->trans('SetDeliveryDate'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetDeliveryDate'), 1).''; } print ''; print ''; @@ -451,7 +451,7 @@ if ($action == 'create') { // Create. Seems to no be used print $langs->trans('IncotermLabel'); print ''; if ($user->rights->expedition->delivery->creer) { - print ''.img_edit().''; + print ''.img_edit().''; } else { print ' '; } diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 528a640b391..8ff0fa62e6c 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -855,7 +855,7 @@ if (!empty($id) && $action != 'edit') { print ''.$langs->trans("ReOpen").''; } - print ''; + print ''; if ($object->statut == $object::STATUS_DRAFT) { print ''; @@ -870,7 +870,7 @@ if (!empty($id) && $action != 'edit') { if ($remaintopay == 0) { print '
    '.$langs->trans('DoPayment').'
    '; } else { - print ''; + print ''; } } diff --git a/htdocs/ecm/dir_card.php b/htdocs/ecm/dir_card.php index b6aa59720ae..0b42fc17a02 100644 --- a/htdocs/ecm/dir_card.php +++ b/htdocs/ecm/dir_card.php @@ -454,11 +454,11 @@ if ($action != 'edit' && $action != 'delete') { print '
    '; if ($permtoadd) { - print ''.$langs->trans('Edit').''; + print ''.$langs->trans('Edit').''; } if ($permtoadd) { - print ''.$langs->trans('ECMAddSection').''; + print ''.$langs->trans('ECMAddSection').''; } else { print ''.$langs->trans('ECMAddSection').''; } diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php index 1ec8d21447e..03e309aa41d 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_card.php +++ b/htdocs/eventorganization/conferenceorboothattendee_card.php @@ -651,9 +651,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (empty($reshook)) { // Send if (empty($user->socid)) { - print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').'&action=presend&mode=init#formmailbeforetitle'); + print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').'&action=presend&token='.newToken().'&mode=init#formmailbeforetitle'); } - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').'&action=edit', '', $permissiontoadd); + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').'&action=edit&token='.newToken().'', '', $permissiontoadd); // Clone print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&token='.newToken().'&object=scrumsprint', '', $permissiontoadd); diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index c36442915e6..7b609391ee2 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1760,7 +1760,7 @@ if ($action == 'create') { print ''; if ($action != 'editdate_livraison') { - print 'id.'">'.img_edit($langs->trans('SetDeliveryDate'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetDeliveryDate'), 1).''; } print ''; print ''; @@ -1892,7 +1892,7 @@ if ($action == 'create') { print ''; if ($action != 'editshipping_method_id') { - print 'id.'">'.img_edit($langs->trans('SetSendingMethod'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetSendingMethod'), 1).''; } print ''; print ''; @@ -1929,7 +1929,7 @@ if ($action == 'create') { print $langs->trans('IncotermLabel'); print ''; if ($user->rights->expedition->creer) { - print ''.img_edit().''; + print ''.img_edit().''; } else { print ' '; } diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index f543b8baee4..a6ab016ef7b 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -370,7 +370,7 @@ if ($id > 0 || !empty($ref)) { print ''; if ($action != 'editdate_livraison') { - print 'id.'">'.img_edit($langs->trans('SetDeliveryDate'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetDeliveryDate'), 1).''; } print ''; print ''; @@ -400,7 +400,7 @@ if ($id > 0 || !empty($ref)) { print $langs->trans('SendingMethod'); print ''; if ($action != 'editshippingmethod' && $user->rights->expedition->creer) { - print 'id.'">'.img_edit($langs->trans('SetShippingMode'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetShippingMode'), 1).''; } print ''; print ''; @@ -421,7 +421,7 @@ if ($id > 0 || !empty($ref)) { print $langs->trans('Warehouse'); print ''; if ($action != 'editwarehouse' && $user->rights->commande->creer) { - print 'id.'">'.img_edit($langs->trans('SetWarehouse'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetWarehouse'), 1).''; } print ''; print ''; @@ -441,7 +441,7 @@ if ($id > 0 || !empty($ref)) { print $langs->trans('PaymentConditionsShort'); print ''; - if ($action != 'editconditions' && $object->statut == Expedition::STATUS_VALIDATED) print 'id.'">'.img_edit($langs->trans('SetConditions'),1).''; + if ($action != 'editconditions' && $object->statut == Expedition::STATUS_VALIDATED) print 'id.'">'.img_edit($langs->trans('SetConditions'),1).''; print ''; print ''; if ($action == 'editconditions') @@ -459,7 +459,7 @@ if ($id > 0 || !empty($ref)) { print ''; - if ($action != 'editmode' && $object->statut == Expedition::STATUS_VALIDATED) print ''; + if ($action != 'editmode' && $object->statut == Expedition::STATUS_VALIDATED) print ''; print '
    '; print $langs->trans('PaymentMode'); print 'id.'">'.img_edit($langs->trans('SetMode'),1).'id.'">'.img_edit($langs->trans('SetMode'),1).'
    '; print ''; if ($action == 'editmode') @@ -478,7 +478,7 @@ if ($id > 0 || !empty($ref)) { print $langs->trans('AvailabilityPeriod'); print ''; if ($action != 'editavailability') { - print 'id.'">'.img_edit($langs->trans('SetAvailability'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetAvailability'), 1).''; } print ''; print ''; @@ -495,7 +495,7 @@ if ($id > 0 || !empty($ref)) { print $langs->trans('Source'); print ''; if ($action != 'editdemandreason') { - print 'id.'">'.img_edit($langs->trans('SetDemandReason'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetDemandReason'), 1).''; } print ''; print ''; @@ -528,7 +528,7 @@ if ($id > 0 || !empty($ref)) { print $langs->trans('IncotermLabel'); print ''; if ($user->rights->commande->creer) { - print ''.img_edit().''; + print ''.img_edit().''; } else { print ' '; } diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 7aa08d30c39..f982b046793 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -2554,11 +2554,11 @@ if ($action != 'create' && $action != 'edit') { if ($user->rights->expensereport->creer && $object->status == ExpenseReport::STATUS_DRAFT) { if (in_array($object->fk_user_author, $user->getAllChildIds(1)) || !empty($user->rights->expensereport->writeall_advance)) { // Modify - print ''; + print ''; // Validate if (count($object->lines) > 0) { - print ''; + print ''; } } } @@ -2571,12 +2571,12 @@ if ($action != 'create' && $action != 'edit') { if ($user->rights->expensereport->creer && $object->status == ExpenseReport::STATUS_REFUSED) { if ($user->id == $object->fk_user_author || $user->id == $object->fk_user_valid) { // Modify - print ''; + print ''; // setdraft (le statut refusée est identique à brouillon) //print ''.$langs->trans('ReOpen').''; // Enregistrer depuis le statut "Refusée" - print ''; + print ''; } } diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index 44eb3734378..d74e0a5c5e8 100644 --- a/htdocs/fichinter/card-rec.php +++ b/htdocs/fichinter/card-rec.php @@ -587,7 +587,7 @@ if ($action == 'create') { print $langs->trans('Frequency'); print ''; if ($action != 'editfrequency' && $user->rights->ficheinter->creer) { - print ''; + print ''; print img_edit($langs->trans('Edit'), 1).''; } print ''; diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 31f42c9b0fa..6613ea0ed9d 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1350,21 +1350,21 @@ if ($action == 'create') { // Icon to edit and delete if ($object->statut == 0 && $user->rights->ficheinter->creer) { print ''; - print 'rowid.'#'.$objp->rowid.'">'; + print 'rowid.'#'.$objp->rowid.'">'; print img_edit(); print ''; - print 'rowid.'">'; + print 'rowid.'">'; print img_delete(); print ''; print ''; if ($num > 1) { if ($i > 0) { - print 'rowid.'">'; + print 'rowid.'">'; print img_up(); print ''; } if ($i < $num - 1) { - print 'rowid.'">'; + print 'rowid.'">'; print img_down(); print ''; } diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 12b7b09cf53..9cfb2fe475f 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -261,7 +261,7 @@ if ($object->id > 0) { print $langs->trans('PaymentConditions'); print ''; if (($action != 'editconditions') && $user->rights->societe->creer) { - print 'id.'">'.img_edit($langs->trans('SetConditions'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetConditions'), 1).''; } print ''; print ''; @@ -279,7 +279,7 @@ if ($object->id > 0) { print $langs->trans('PaymentMode'); print ''; if (($action != 'editmode') && $user->rights->societe->creer) { - print 'id.'">'.img_edit($langs->trans('SetMode'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetMode'), 1).''; } print ''; print ''; diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index e579c07ac14..ae6c271fec8 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1975,7 +1975,7 @@ if ($action == 'create') { } if (empty($conf->global->MAIN_CAN_EDIT_SUPPLIER_ON_SUPPLIER_ORDER) || $action != 'edit_thirdparty') { if (!empty($conf->global->MAIN_CAN_EDIT_SUPPLIER_ON_SUPPLIER_ORDER) && $object->statut == CommandeFournisseur::STATUS_DRAFT) { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetThirdParty')).''; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetThirdParty')).''; } $morehtmlref .= ' : '.$object->thirdparty->getNomUrl(1, 'supplier'); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { @@ -2075,7 +2075,7 @@ if ($action == 'create') { print $langs->trans('PaymentConditions'); print ''; if ($action != 'editconditions') { - print 'id.'">'.img_edit($langs->trans('SetConditions'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetConditions'), 1).''; } print ''; print ''; @@ -2094,7 +2094,7 @@ if ($action == 'create') { print $langs->trans('PaymentMode'); print ''; if ($action != 'editmode') { - print 'id.'">'.img_edit($langs->trans('SetMode'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetMode'), 1).''; } print ''; print ''; @@ -2114,7 +2114,7 @@ if ($action == 'create') { print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0); print ''; if ($action != 'editmulticurrencycode' && $object->statut == $object::STATUS_DRAFT) { - print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).''; + print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).''; } print ''; print ''; @@ -2134,7 +2134,7 @@ if ($action == 'create') { print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0); print ''; if ($action != 'editmulticurrencyrate' && $object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) { - print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).''; + print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).''; } print ''; print ''; @@ -2162,7 +2162,7 @@ if ($action == 'create') { print $langs->trans('BankAccount'); print ''; if ($action != 'editbankaccount' && $usercancreate) { - print 'id.'">'.img_edit($langs->trans('SetBankAccount'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetBankAccount'), 1).''; } print ''; print ''; @@ -2187,7 +2187,7 @@ if ($action == 'create') { print $langs->trans('DateDeliveryPlanned'); print ''; if ($action != 'editdate_livraison') { - print 'id.'">'.img_edit($langs->trans('SetDeliveryDate'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetDeliveryDate'), 1).''; } print ''; print ''; @@ -2221,7 +2221,7 @@ if ($action == 'create') { print $langs->trans('IncotermLabel'); print ''; if ($usercancreate) { - print ''.img_edit().''; + print ''.img_edit().''; } else { print ' '; } diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index afd99951aa4..16d4b1f25f3 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -1294,13 +1294,13 @@ if ($id > 0 || !empty($ref)) { if ($action != 'editline' || $lineid != $objp->dispatchlineid) { if (empty($reception->id) || ($reception->statut == Reception::STATUS_DRAFT)) { // only allow edit on draft reception print ''; - print 'dispatchlineid.'#line_'.$objp->dispatchlineid.'">'; + print 'dispatchlineid.'#line_'.$objp->dispatchlineid.'">'; print img_edit(); print ''; print ''; print ''; - print 'dispatchlineid.'#dispatch_received_products">'; + print 'dispatchlineid.'#dispatch_received_products">'; print img_delete(); print ''; print ''; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 762436a3a0e..21d6e73eb39 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2779,7 +2779,7 @@ if ($action == 'create') { print $langs->trans('PaymentConditions'); print ''; if ($action != 'editconditions' && $form_permission) { - print 'id.'">'.img_edit($langs->trans('SetConditions'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetConditions'), 1).''; } print ''; print ''; @@ -2808,7 +2808,7 @@ if ($action == 'create') { print $langs->trans('PaymentMode'); print ''; if ($action != 'editmode' && $form_permission2) { - print 'id.'">'.img_edit($langs->trans('SetMode'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetMode'), 1).''; } print ''; print ''; @@ -2828,7 +2828,7 @@ if ($action == 'create') { print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0); print ''; if ($action != 'editmulticurrencycode' && $object->statut == $object::STATUS_DRAFT) { - print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).''; + print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).''; } print ''; print ''; @@ -2847,7 +2847,7 @@ if ($action == 'create') { print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0); print ''; if ($action != 'editmulticurrencyrate' && $object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) { - print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).''; + print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).''; } print ''; print ''; @@ -2875,7 +2875,7 @@ if ($action == 'create') { print $langs->trans('BankAccount'); print ''; if ($action != 'editbankaccount' && $usercancreate) { - print 'id.'">'.img_edit($langs->trans('SetBankAccount'), 1).''; + print 'id.'">'.img_edit($langs->trans('SetBankAccount'), 1).''; } print ''; print ''; @@ -2895,7 +2895,7 @@ if ($action == 'create') { print $langs->trans('IncotermLabel'); print ''; if ($usercancreate) { - print ''.img_edit().''; + print ''.img_edit().''; } else { print ' '; } @@ -2918,7 +2918,7 @@ if ($action == 'create') { print $langs->trans('IntracommReportTransportMode'); print ''; if ($action != 'editmode' && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)) { - print 'id.'">'.img_edit().''; + print 'id.'">'.img_edit().''; } print ''; print ''; @@ -3406,7 +3406,7 @@ if ($action == 'create') { $ventilExportCompta = $object->getVentilExportCompta(); // Should be 0 since the sum of payments are zero. But we keep the protection. if ($ventilExportCompta == 0) { - print ''.$langs->trans('Modify').''; + print ''.$langs->trans('Modify').''; } else { print ''.$langs->trans('Modify').''; } diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 65c3521bf20..9948b64e460 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -338,25 +338,25 @@ if (empty($reshook)) { // If no start date if (empty($_POST['date_debut_'])) { - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&error=nodatedebut'); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken().'&error=nodatedebut'); exit; } // If no end date if (empty($_POST['date_fin_'])) { - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&error=nodatefin'); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken().'&error=nodatefin'); exit; } // If start date after end date if ($date_debut > $date_fin) { - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&error=datefin'); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken().'&error=datefin'); exit; } // If no validator designated if ($approverid < 1) { - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&error=Valideur'); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken().'&error=Valideur'); exit; } @@ -1339,7 +1339,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') { } $include_users = $object->fetch_users_approver_holiday(); if (is_array($include_users) && in_array($user->id, $include_users) && $object->statut == Holiday::STATUS_VALIDATED) { - print ''.img_edit($langs->trans("Edit")).''; + print ''.img_edit($langs->trans("Edit")).''; } print ''; print ''; @@ -1451,11 +1451,11 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') { print '
    '; if ($cancreate && $object->statut == Holiday::STATUS_DRAFT) { - print ''.$langs->trans("EditCP").''; + print ''.$langs->trans("EditCP").''; } if ($cancreate && $object->statut == Holiday::STATUS_DRAFT) { // If draft - print ''.$langs->trans("Validate").''; + print ''.$langs->trans("Validate").''; } if ($object->statut == Holiday::STATUS_VALIDATED) { // If validated diff --git a/htdocs/hrm/establishment/card.php b/htdocs/hrm/establishment/card.php index 9daf1d768b8..0ce7d793003 100644 --- a/htdocs/hrm/establishment/card.php +++ b/htdocs/hrm/establishment/card.php @@ -419,7 +419,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea * Action bar */ print ''; } diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index 68bcd78636b..ec7ba9b74e3 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -96,7 +96,7 @@ print load_fiche_titre($langs->trans("HRMArea"), '', 'hrm'); if (!empty($setupcompanynotcomplete)) { $langs->load("errors"); $warnpicto = img_warning($langs->trans("WarningMandatorySetupNotComplete")); - print '
    '; + print '
    '; llxFooter(); exit; diff --git a/htdocs/knowledgemanagement/knowledgerecord_card.php b/htdocs/knowledgemanagement/knowledgerecord_card.php index 99aaabe7744..8af0431f361 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_card.php +++ b/htdocs/knowledgemanagement/knowledgerecord_card.php @@ -404,12 +404,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes', '', $permissiontoadd); } if (($object->status == $object::STATUS_DRAFT || $object->status == $object::STATUS_VALIDATED) && $permissiontovalidate) { - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit', '', $permissiontoadd); + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); } // Validate if ($object->status == $object::STATUS_DRAFT) { if ((empty($object->table_element_line) || (is_array($object->lines) && count($object->lines) > 0)) && $permissiontovalidate) { - print dolGetButtonAction($langs->trans('Validate'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes', '', $permissiontoadd); + print dolGetButtonAction($langs->trans('Validate'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&token='.newToken().'&confirm=yes', '', $permissiontoadd); } else { $langs->load("errors"); //print dolGetButtonAction($langs->trans('Validate'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes', '', 0); @@ -418,7 +418,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } // Clone - print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=scrumsprint', '', $permissiontoadd); + print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&token='.newToken().'&object=scrumsprint', '', $permissiontoadd); /* if ($permissiontoadd) { diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index df24e022d90..a15f6c926a6 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -717,12 +717,12 @@ if ($id > 0) { // Edit if (($object->paid == 0 || $object->paid == 2) && $user->rights->loan->write) { - print ''; + print ''; } // Emit payment if (($object->paid == 0 || $object->paid == 2) && ((price2num($object->capital) > 0 && round($staytopay) < 0) || (price2num($object->capital) > 0 && round($staytopay) > 0)) && $user->rights->loan->write) { - print ''; + print ''; } // Classify 'paid' diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index db8bc85816e..4a3f9fd6e25 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1999,15 +1999,15 @@ if ($module == 'initmodule') { print ''; print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; print ''; print ' '.$langs->trans("ReadmeFile").' : '.$pathtofilereadme.''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; print ''; print ' '.$langs->trans("ChangeLog").' : '.$pathtochangelog.''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; print ''; print ''; @@ -2177,8 +2177,8 @@ if ($module == 'initmodule') { $pathtofile = 'langs/'.$langfile['relativename']; } print ' '.$langs->trans("LanguageFile").' '.basename(dirname($pathtofile)).' : '.$pathtofile.''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; print ''; } print ''; @@ -2226,7 +2226,7 @@ if ($module == 'initmodule') { print '
    '; print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
    '; if (is_array($dicts) && !empty($dicts)) { print ' '.$langs->trans("LanguageFile").' : '; @@ -2502,13 +2502,13 @@ if ($module == 'initmodule') { print '
    '; print ' '.$langs->trans("ClassFile").' : '.($realpathtoclass ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtoclass).($realpathtoclass ? '' : '').''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
    '; print ' '.$langs->trans("ApiClassFile").' : '.($realpathtoapi ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtoapi).($realpathtoapi ? '' : '').''; if (dol_is_file($realpathtoapi)) { - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print ' '; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; print '   '; if (empty($conf->global->$const_name)) { // If module is not activated print ''.$langs->trans("GoToApiExplorer").''; @@ -2517,99 +2517,99 @@ if ($module == 'initmodule') { } } else { //print ''.$langs->trans("FileNotYetGenerated").' '; - print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; + print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; } // PHPUnit print '
    '; print ' '.$langs->trans("TestClassFile").' : '.($realpathtophpunit ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtophpunit).($realpathtophpunit ? '' : '').''; if (dol_is_file($realpathtophpunit)) { - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print ' '; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; } else { //print ''.$langs->trans("FileNotYetGenerated").' '; - print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; + print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; } print '
    '; print '
    '; print ' '.$langs->trans("PageForLib").' : '.($realpathtolib ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtolib).($realpathtolib ? '' : '').''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
    '; print ' '.$langs->trans("PageForObjLib").' : '.($realpathtoobjlib ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtoobjlib).($realpathtoobjlib ? '' : '').''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
    '; print ' '.$langs->trans("Image").' : '.($realpathtopicto ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtopicto).($realpathtopicto ? '' : '').''; - //print ' '.img_picto($langs->trans("Edit"), 'edit').''; + //print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
    '; print '
    '; print ' '.$langs->trans("SqlFile").' : '.($realpathtosql ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtosql).($realpathtosql ? '' : '').''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; - print '   '.$langs->trans("DropTableIfEmpty").''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print '   '.$langs->trans("DropTableIfEmpty").''; //print '   '.$langs->trans("RunSql").''; print '
    '; print ' '.$langs->trans("SqlFileKey").' : '.($realpathtosqlkey ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtosqlkey).($realpathtosqlkey ? '' : '').''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; //print '   '.$langs->trans("RunSql").''; print '
    '; print ' '.$langs->trans("SqlFileExtraFields").' : '.($realpathtosqlextra ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtosqlextra).($realpathtosqlextra ? '' : '').''; if (dol_is_file($realpathtosqlextra) && dol_is_file($realpathtosqlextrakey)) { - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print ' '; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; print '   '; - print ''.$langs->trans("DropTableIfEmpty").''; + print ''.$langs->trans("DropTableIfEmpty").''; } else { - print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; + print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; } //print '   '.$langs->trans("RunSql").''; print '
    '; print ' '.$langs->trans("SqlFileKeyExtraFields").' : '.($realpathtosqlextrakey ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtosqlextrakey).($realpathtosqlextrakey ? '' : '').''; if (dol_is_file($realpathtosqlextra) && dol_is_file($realpathtosqlextrakey)) { - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print ' '; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; } else { - print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; + print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; } print '
    '; print '
    '; print '
    '; print ' '.$langs->trans("PageForList").' : '.($realpathtolist ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtolist).($realpathtolist ? '' : '').''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
    '; print ' '.$langs->trans("PageForCreateEditView").' : '.($realpathtocard ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtocard).($realpathtocard ? '' : '').'?action=create'; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
    '; print ' '.$langs->trans("PageForContactTab").' : '.($realpathtocontact ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtocontact).($realpathtocontact ? '' : '').''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; if (dol_is_file($realpathtocontact)) { print ' '; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; } print '
    '; print ' '.$langs->trans("PageForDocumentTab").' : '.($realpathtodocument ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtodocument).($realpathtodocument ? '' : '').''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; if (dol_is_file($realpathtodocument)) { print ' '; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; } print '
    '; print ' '.$langs->trans("PageForNoteTab").' : '.($realpathtonote ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtonote).($realpathtonote ? '' : '').''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; if (dol_is_file($realpathtonote)) { print ' '; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; } print '
    '; print ' '.$langs->trans("PageForAgendaTab").' : '.($realpathtoagenda ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtoagenda).($realpathtoagenda ? '' : '').''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; if (dol_is_file($realpathtoagenda)) { print ' '; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; } print '
    '; print '
    '; @@ -2928,7 +2928,7 @@ if ($module == 'initmodule') { $format = 'markdown'; } print ' '.$langs->trans("SpecificationFile").' : '.$pathtofile.''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
    '; } } else { @@ -3020,7 +3020,7 @@ if ($module == 'initmodule') { print '
    '; print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
    '; print '
    '; @@ -3153,7 +3153,7 @@ if ($module == 'initmodule') { print '
    '; print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
    '; print '
    '; @@ -3243,7 +3243,7 @@ if ($module == 'initmodule') { print ''; print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; print ''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; print ''; print ''; @@ -3252,7 +3252,7 @@ if ($module == 'initmodule') { if (dol_is_file($dirins.'/'.$pathtohook)) { print ''.$pathtohook.''; print ''; - print ''.img_picto($langs->trans("Edit"), 'edit').' '; + print ''.img_picto($langs->trans("Edit"), 'edit').' '; print ''.img_picto($langs->trans("Delete"), 'delete').''; } else { print ''.$langs->trans("FileNotYetGenerated").''; @@ -3302,7 +3302,7 @@ if ($module == 'initmodule') { print ''; print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; print ''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; print ''; if (!empty($triggers)) { @@ -3311,7 +3311,7 @@ if ($module == 'initmodule') { print ''; print ' '.$langs->trans("TriggersFile").' : '.$pathtofile.''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; print ''.img_picto($langs->trans("Delete"), 'delete').''; print ''; } @@ -3407,11 +3407,11 @@ if ($module == 'initmodule') { print ' '.$langs->trans("JSFile").' : '; if (dol_is_file($dirins.'/'.$pathtohook)) { print ''.$pathtohook.''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; } else { print ''.$langs->trans("FileNotYetGenerated").''; - print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; + print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; } print ''; } else { @@ -3455,13 +3455,13 @@ if ($module == 'initmodule') { $pathtofile = $widget['relpath']; print ' '.$langs->trans("WidgetFile").' : '.$pathtofile.''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; print ''; } } else { print ' '.$langs->trans("WidgetFile").' : '.$langs->trans("NoWidget").''; - print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; + print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; print ''; } print ''; @@ -3502,7 +3502,7 @@ if ($module == 'initmodule') { print '
    '; print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
    '; } else { $fullpathoffile = dol_buildpath($file, 0); @@ -3572,13 +3572,13 @@ if ($module == 'initmodule') { $pathtofile = $clifile['relpath']; print ' '.$langs->trans("CLIFile").' : '.$pathtofile.''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; print ''; } } else { print ' '.$langs->trans("CLIFile").' : '.$langs->trans("FileNotYetGenerated");''; - print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; + print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; print ''; } print ''; @@ -3618,7 +3618,7 @@ if ($module == 'initmodule') { print '
    '; print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
    '; print '
    '; @@ -3746,14 +3746,14 @@ if ($module == 'initmodule') { } print ''; print ' '.$langs->trans("SpecificationFile").' : '.$pathtofile.''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; print ''; } } else { print ''; print ' '.$langs->trans("SpecificationFile").' : '.$langs->trans("FileNotYetGenerated").''; - print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; + print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; print ''; } print ''; diff --git a/htdocs/modulebuilder/template/admin/setup.php b/htdocs/modulebuilder/template/admin/setup.php index d0d4a404dcf..7c6c6b2c04e 100644 --- a/htdocs/modulebuilder/template/admin/setup.php +++ b/htdocs/modulebuilder/template/admin/setup.php @@ -389,7 +389,7 @@ if ($action == 'edit') { print ''; print ''; } else { print '
    '.$langs->trans("NothingToSetup"); diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index 51f35bbc33d..136952662cc 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -609,7 +609,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Modify if ($object->status == $object::STATUS_DRAFT) { if ($permissiontoadd) { - print ''.$langs->trans("Modify").''."\n"; + print ''.$langs->trans("Modify").''."\n"; } else { print ''.$langs->trans('Modify').''."\n"; } diff --git a/htdocs/partnership/partnership_card.php b/htdocs/partnership/partnership_card.php index db637136cad..2a281931046 100644 --- a/htdocs/partnership/partnership_card.php +++ b/htdocs/partnership/partnership_card.php @@ -556,7 +556,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (empty($reshook)) { // Send if (empty($user->socid)) { - print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init&token='.newToken().'#formmailbeforetitle'); + print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&token='.newToken().'&mode=init#formmailbeforetitle'); } if ($object->status == $object::STATUS_DRAFT) { diff --git a/htdocs/product/card.php b/htdocs/product/card.php index fd9b129e30d..80378bd1b2a 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1262,7 +1262,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''.$langs->trans("DefaultWarehouse").''; print img_picto($langs->trans("DefaultWarehouse"), 'stock', 'class="pictofixedwidth"'); print $formproduct->selectWarehouses(GETPOST('fk_default_warehouse', 'int'), 'fk_default_warehouse', 'warehouseopen', 1, 0, 0, '', 0, 0, array(), 'minwidth300 widthcentpercentminusxx maxwidth500'); - print ' '; + print ' '; print ''; print ''; print ''; @@ -2543,14 +2543,14 @@ if ($action != 'create' && $action != 'edit') { if (empty($reshook)) { if ($usercancreate) { if (!isset($object->no_button_edit) || $object->no_button_edit <> 1) { - print 'id.'">'.$langs->trans("Modify").''; + print 'id.'">'.$langs->trans("Modify").''; } if (!isset($object->no_button_copy) || $object->no_button_copy <> 1) { if (!empty($conf->use_javascript_ajax) && empty($conf->dol_use_jmobile)) { print ''.$langs->trans('ToClone').''."\n"; } else { - print 'id.'">'.$langs->trans("ToClone").''; + print 'id.'">'.$langs->trans("ToClone").''; } } } diff --git a/htdocs/product/dynamic_price/editor.php b/htdocs/product/dynamic_price/editor.php index 784be41dfe9..893cc654f89 100644 --- a/htdocs/product/dynamic_price/editor.php +++ b/htdocs/product/dynamic_price/editor.php @@ -204,7 +204,7 @@ print ''; diff --git a/htdocs/hrm/position.php b/htdocs/hrm/position.php index 54e6993ef02..1ee06a9209c 100644 --- a/htdocs/hrm/position.php +++ b/htdocs/hrm/position.php @@ -166,7 +166,11 @@ if (empty($reshook)) { if (empty($fk_job) && (($action != 'add' && $action != 'create') || $cancel)) { $backtopage = $backurlforlist; } else { - $backtopage = dol_buildpath('/hrm/position.php', 1) . '?fk_job=' . ($fk_job > 0 ? $fk_job : '__ID__'); + if($fk_job > 0) { + $backtopage = dol_buildpath('/hrm/position.php', 1) . '?fk_job=' . ($fk_job > 0 ? $fk_job : '__ID__'); + } else { + $backtopage = dol_buildpath('/hrm/position_card.php', 1) . '?id=__ID__'; + } } } } From 35e7a473f4984c2c56f9ec0a91aef7f72ae90434 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 4 Oct 2021 12:10:54 +0000 Subject: [PATCH 0662/1460] Fixing style errors. --- htdocs/hrm/position.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/hrm/position.php b/htdocs/hrm/position.php index 1ee06a9209c..9a3b1e364ff 100644 --- a/htdocs/hrm/position.php +++ b/htdocs/hrm/position.php @@ -166,7 +166,7 @@ if (empty($reshook)) { if (empty($fk_job) && (($action != 'add' && $action != 'create') || $cancel)) { $backtopage = $backurlforlist; } else { - if($fk_job > 0) { + if ($fk_job > 0) { $backtopage = dol_buildpath('/hrm/position.php', 1) . '?fk_job=' . ($fk_job > 0 ? $fk_job : '__ID__'); } else { $backtopage = dol_buildpath('/hrm/position_card.php', 1) . '?id=__ID__'; From bad5d87f57e3b1006f49838ccff021354ee334e7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 4 Oct 2021 14:56:30 +0200 Subject: [PATCH 0663/1460] NEW theme option THEME_ELDY_USEBORDERONTABLE --- htdocs/theme/eldy/style.css.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index f16300ba98e..de089ecba54 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -118,7 +118,8 @@ $dol_no_mouse_hover = $conf->dol_no_mouse_hover; //$user->conf->THEME_ELDY_ENABLE_PERSONALIZED=0; //var_dump($user->conf->THEME_ELDY_RGB); -$useboldtitle = (isset($conf->global->THEME_ELDY_USEBOLDTITLE) ? $conf->global->THEME_ELDY_USEBOLDTITLE : 0); +$useboldtitle = getDolGlobalInt('THEME_ELDY_USEBOLDTITLE'); +$userborderontable = getDolGlobalInt('THEME_ELDY_USEBORDERONTABLE'); $borderwidth = 1; // Case of option always editable From ee4276e0aa3b9d093e2b985b39d26584e4cd25ad Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 4 Oct 2021 19:03:14 +0200 Subject: [PATCH 0664/1460] Error message --- test/phpunit/CodingPhpTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/phpunit/CodingPhpTest.php b/test/phpunit/CodingPhpTest.php index 2d3c71e7370..c68f1162790 100644 --- a/test/phpunit/CodingPhpTest.php +++ b/test/phpunit/CodingPhpTest.php @@ -225,7 +225,7 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase break; } //print __METHOD__." Result for checking we don't have non escaped string in sql requests for file ".$file."\n"; - $this->assertTrue($ok, 'Found string $db-> into a .class.php file in '.$file['relativename']); + $this->assertTrue($ok, 'Found string $db-> into a .class.php file in '.$file['relativename'].'. Inside a .class file, you should use $this->db-> instead.'); //exit; } } else { From e14676be49276af40981b095b5f9e02e8ef43935 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 4 Oct 2021 19:09:38 +0200 Subject: [PATCH 0665/1460] Fix phpunit --- htdocs/theme/eldy/global.inc.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 9ddaab40e65..de984d83076 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1735,15 +1735,15 @@ td.showDragHandle { /* .classforhorizontalscrolloftabs .fiche .div-table-responsive { - transform:rotateX(180deg); - -ms-transform:rotateX(180deg); - -webkit-transform:rotateX(180deg); + transform:rotateX(180deg); + -ms-transform:rotateX(180deg); + -webkit-transform:rotateX(180deg); } .classforhorizontalscrolloftabs .fiche .div-table-responsive-inside { - transform:rotateX(180deg); - -ms-transform:rotateX(180deg); - -webkit-transform:rotateX(180deg); + transform:rotateX(180deg); + -ms-transform:rotateX(180deg); + -webkit-transform:rotateX(180deg); } */ From 35aa9b0d356382bb9cbf030bedf5562e47e675c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BCdiger=20Hahn?= Date: Mon, 4 Oct 2021 19:19:12 +0200 Subject: [PATCH 0666/1460] Allow removal of tabs For being able to remove or replace tabs, it is also necessary to call this function with 'remove' mode. --- htdocs/mrp/lib/mrp_mo.lib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/mrp/lib/mrp_mo.lib.php b/htdocs/mrp/lib/mrp_mo.lib.php index 8fe07df89c1..fd268c8f6f8 100644 --- a/htdocs/mrp/lib/mrp_mo.lib.php +++ b/htdocs/mrp/lib/mrp_mo.lib.php @@ -103,6 +103,8 @@ function moPrepareHead($object) // 'entity:-tabname:Title:@mrp:/mrp/mypage.php?id=__ID__' //); // to remove a tab complete_head_from_modules($conf, $langs, $object, $head, $h, 'mo@mrp'); + + complete_head_from_modules($conf, $langs, $object, $head, $h, 'mo@mrp', 'remove'); return $head; } From 2f6a4fa04a908b1045eb6b3d8cc4523249b213ae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 4 Oct 2021 19:20:37 +0200 Subject: [PATCH 0667/1460] Update html.formfile.class.php --- htdocs/core/class/html.formfile.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 2e58c845e6b..e7a8beee681 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -412,7 +412,7 @@ class FormFile 'hideifempty'=>&$hideifempty, 'removeaction'=>&$removeaction ); - $reshook = $hookmanager->executeHooks('showdocuments', $parameters, $object); // Note that parameters may have been updated by hook + $reshook = $hookmanager->executeHooks('showDocuments', $parameters, $object); // Note that parameters may have been updated by hook // May report error if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -420,7 +420,7 @@ class FormFile } // Remode default action if $reskook > 0 if ($reshook > 0) { - return ''; + return $hookmanager->resPrint; } if (!is_object($form)) { From ced7c24c4068a16afda149450db2e35b0f8710b8 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 4 Oct 2021 17:25:13 +0000 Subject: [PATCH 0668/1460] Fixing style errors. --- htdocs/mrp/lib/mrp_mo.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/mrp/lib/mrp_mo.lib.php b/htdocs/mrp/lib/mrp_mo.lib.php index fd268c8f6f8..08bc07f298a 100644 --- a/htdocs/mrp/lib/mrp_mo.lib.php +++ b/htdocs/mrp/lib/mrp_mo.lib.php @@ -103,7 +103,7 @@ function moPrepareHead($object) // 'entity:-tabname:Title:@mrp:/mrp/mypage.php?id=__ID__' //); // to remove a tab complete_head_from_modules($conf, $langs, $object, $head, $h, 'mo@mrp'); - + complete_head_from_modules($conf, $langs, $object, $head, $h, 'mo@mrp', 'remove'); return $head; From d3cbda08dcf77eda6db79004ed56ec52466f5377 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Mon, 4 Oct 2021 22:12:50 +0200 Subject: [PATCH 0669/1460] Fix fatal error --- htdocs/core/modules/expedition/doc/pdf_espadon.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index f6f4b0b1a2a..6891bcaedd1 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/expedition/modules_expedition.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; - +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; /** * Class to build sending documents with model espadon From cbd825e52618017d836f3b3794e2b2e2396fd724 Mon Sep 17 00:00:00 2001 From: xgerhard Date: Tue, 5 Oct 2021 00:03:00 +0200 Subject: [PATCH 0670/1460] FIX|Fix #18890 Fix disabled button if sum real qty is 0 Instead of counting the sum of the 'real qty' input, only disable the button if no input has been given, or if all input is the same as the expected qty. '$object->status' check seems unnecessary here since the button is only there when the status is 'STATUS_VALIDATED'. --- htdocs/product/inventory/inventory.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index 2ebde580db7..f9fd832b138 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -716,7 +716,7 @@ if ($object->id > 0) { $num = $db->num_rows($resql); $i = 0; - $totalfound = 0; + $hasinput = false; $totalarray = array(); while ($i < $num) { $obj = $db->fetch_object($resql); @@ -766,7 +766,10 @@ if ($object->id > 0) { print ''; if ($object->status == $object::STATUS_VALIDATED) { $qty_view = GETPOST("id_".$obj->rowid) && price2num(GETPOST("id_".$obj->rowid), 'MS') >= 0 ? GETPOST("id_".$obj->rowid) : $obj->qty_view; - $totalfound += price2num($qty_view, 'MS'); + if (!$hasinput && $qty_view !== null && $obj->qty_stock != $qty_view) { + $hasinput = true; + } + print ''; print ''; print ''; @@ -777,7 +780,6 @@ if ($object->id > 0) { print ''; } else { print $obj->qty_view; - $totalfound += $obj->qty_view; print ''; } print ''; @@ -799,7 +801,7 @@ if ($object->id > 0) { print '
    '; // Call method to disable the button if no qty entered yet for inventory - if ($object->status != $object::STATUS_VALIDATED || $totalfound == 0) { + if (!$hasinput) { print ''; @@ -77,10 +94,6 @@ if ($object->element == 'product') { $ident = $conf->global->MAIN_DEFAULT_WAREHOUSE; } print img_picto('', 'stock').$formproduct->selectWarehouses($ident, 'id_entrepot', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, null, 'minwidth100'); - print '   '; print ''; } if ($object->element == 'stock') { @@ -88,14 +101,19 @@ if ($object->element == 'stock') { print ''; print img_picto('', 'product'); $form->select_produits(GETPOST('product_id', 'int'), 'product_id', (empty($conf->global->STOCK_SUPPORTS_SERVICES) ? '0' : ''), 0, 0, -1, 2, '', 0, null, 0, 1, 0, 'maxwidth500'); - print '   '; print ''; } print ''.$langs->trans("NumberOfUnit").''; -print ''; +print ''; +if ($object->element == 'product' || $object->element == 'stock') { + print ''; + print ajax_combobox("mouvement"); +} +print ''; +print ''; print ''; // If product is a Kit, we ask if we must disable stock change of subproducts diff --git a/htdocs/product/stock/tpl/stocktransfer.tpl.php b/htdocs/product/stock/tpl/stocktransfer.tpl.php index 27c9b2acb21..3e2adf8a169 100644 --- a/htdocs/product/stock/tpl/stocktransfer.tpl.php +++ b/htdocs/product/stock/tpl/stocktransfer.tpl.php @@ -89,7 +89,7 @@ if ($object->element == 'stock') { print ''.$langs->trans("WarehouseTarget").''; print img_picto('', 'stock').$formproduct->selectWarehouses(GETPOST('id_entrepot_destination'), 'id_entrepot_destination', 'warehouseopen,warehouseinternal', 1); print ''; -print ''.$langs->trans("NumberOfUnit").''; +print ''.$langs->trans("NumberOfUnit").''; print ''; // Serial / Eat-by date From 9d1915f9c289d9734347ab6dca50744666315ba7 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Wed, 6 Oct 2021 09:56:10 +0200 Subject: [PATCH 0708/1460] fix php warning --- htdocs/product/class/api_products.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 2e0d21b0456..7b19739d10e 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -462,7 +462,7 @@ class Products extends DolibarrApi $childsArbo = $this->product->getChildsArbo($id, 1); - $keys = ['rowid', 'qty', 'fk_product_type', 'label', 'incdec']; + $keys = ['rowid','qty', 'fk_product_type', 'label', 'incdec','ref']; $childs = []; foreach ($childsArbo as $values) { $childs[] = array_combine($keys, $values); From 6a20fcc5c075e300246bd97e7df77cf942484275 Mon Sep 17 00:00:00 2001 From: ksar <35605507+ksar-ksar@users.noreply.github.com> Date: Wed, 6 Oct 2021 11:24:42 +0200 Subject: [PATCH 0709/1460] FIX #18910 --- htdocs/mrp/mo_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index cfff1fb6181..75398b7749b 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -207,7 +207,7 @@ $sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key.', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key.' ' : ''); } } // Add fields from hooks From 93b4853f8e8c25ec093e91efe6392c3ff92e092f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Oct 2021 11:52:12 +0200 Subject: [PATCH 0710/1460] Fix var_dump --- htdocs/core/actions_addupdatedelete.inc.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 44a0f159143..f871ed73de8 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -117,7 +117,6 @@ if ($action == 'add' && !empty($permissiontoadd)) { if (!$error) { $result = $object->create($user); - var_dump($object);exit; if ($result > 0) { // Creation OK $urltogo = $backtopage ? str_replace('__ID__', $result, $backtopage) : $backurlforlist; From 3709c6ff4775ac13c8d226cdb03c485fb434b6e4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Oct 2021 11:53:27 +0200 Subject: [PATCH 0711/1460] Fix phpcs --- htdocs/fourn/facture/list.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 292faedf7ec..a752c0d1545 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -1601,7 +1601,6 @@ if ($resql) { // Author if (!empty($arrayfields['u.login']['checked'])) { - print ''; if ($userstatic->id) { print $userstatic->getLoginUrl(-1); From fb775e2c6eb5f0e92e59b70536fd758fb63d2074 Mon Sep 17 00:00:00 2001 From: Indelog Date: Wed, 6 Oct 2021 12:14:46 +0200 Subject: [PATCH 0712/1460] Fix Add module part in llx_element_element on CommonObject::add_object_linked() Add module part to target type if object has $module property and is'nt in core modules. --- htdocs/core/class/commonobject.class.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index c4564ddcd6d..9cb83668df9 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3623,6 +3623,12 @@ abstract class CommonObject $this->db->begin(); $error = 0; + // Elements of the core modules which have `$module` property but may to which we don't want to prefix module part to the element name for finding the linked object in llx_element_element. + // It's because an entry for this element may be exist in llx_element_element before this modification (version <=14.2) and ave named only with their element name in fk_source or fk_target. + $coremodule = array('knowledgemanagement', 'partnership', 'workstation', 'ticket', 'recruitment', 'eventorganization'); + // Add module part to target type if object has $module property and isn't in core modules. + $targettype = ((!empty($this->module) && ! in_array($this->module, $coremodule)) ? $this->module.'_' : '').$this->element; + $sql = "INSERT INTO " . MAIN_DB_PREFIX . "element_element ("; $sql .= "fk_source"; $sql .= ", sourcetype"; @@ -3632,7 +3638,7 @@ abstract class CommonObject $sql .= ((int) $origin_id); $sql .= ", '" . $this->db->escape($origin) . "'"; $sql .= ", " . ((int) $this->id); - $sql .= ", '" . $this->db->escape($this->element) . "'"; + $sql .= ", '" . $this->db->escape($targettype) . "'"; $sql .= ")"; dol_syslog(get_class($this) . "::add_object_linked", LOG_DEBUG); @@ -3714,7 +3720,6 @@ abstract class CommonObject $sourceid = (!empty($sourceid) ? $sourceid : $this->id); $targetid = (!empty($targetid) ? $targetid : $this->id); - // For module whit if (empty($sourcetype)) { // If empty $sourcetype and no core module, add module part for searching element in llx_element_element (needed for external module). if (!empty($this->module) && ! in_array($this->module, $coremodule)) $sourcetype = $this->module.'_'.$this->element; From 45e6ea45dc6b6b749e73d267e8bd703dc9437ec1 Mon Sep 17 00:00:00 2001 From: Indelog Date: Wed, 6 Oct 2021 12:19:10 +0200 Subject: [PATCH 0713/1460] Fix stickler --- htdocs/core/class/commonobject.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 9cb83668df9..d41fd96edf1 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3626,8 +3626,8 @@ abstract class CommonObject // Elements of the core modules which have `$module` property but may to which we don't want to prefix module part to the element name for finding the linked object in llx_element_element. // It's because an entry for this element may be exist in llx_element_element before this modification (version <=14.2) and ave named only with their element name in fk_source or fk_target. $coremodule = array('knowledgemanagement', 'partnership', 'workstation', 'ticket', 'recruitment', 'eventorganization'); - // Add module part to target type if object has $module property and isn't in core modules. - $targettype = ((!empty($this->module) && ! in_array($this->module, $coremodule)) ? $this->module.'_' : '').$this->element; + // Add module part to target type if object has $module property and isn't in core modules. + $targettype = ((!empty($this->module) && ! in_array($this->module, $coremodule)) ? $this->module.'_' : '').$this->element; $sql = "INSERT INTO " . MAIN_DB_PREFIX . "element_element ("; $sql .= "fk_source"; From ff29ac93ad3b90a2016d1946d5c4279327ce1127 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Oct 2021 12:43:40 +0200 Subject: [PATCH 0714/1460] Debug eventorganization modules --- .../class/conferenceorbooth.class.php | 1 - .../class/conferenceorboothattendee.class.php | 6 +++--- .../conferenceorboothattendee_card.php | 16 ++++++++++------ .../conferenceorboothattendee_list.php | 3 ++- htdocs/langs/en_US/eventorganization.lang | 3 ++- 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index 8d12fcd4da5..6d21fb911b2 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -271,7 +271,6 @@ class ConferenceOrBooth extends ActionComm */ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND') { - //TODO set percent according status global $conf; diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index 4d44bc13287..0ee05489347 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -105,9 +105,9 @@ class ConferenceOrBoothAttendee extends CommonObject 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>2, 'index'=>1, 'comment'=>"Reference of object"), 'fk_actioncomm' => array('type'=>'integer:ActionComm:comm/action/class/actioncomm.class.php:1', 'label'=>'ConferenceOrBooth', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>0, 'index'=>1, 'picto'=>'agenda'), 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'1', 'position'=>20, 'notnull'=>1, 'visible'=>0, 'index'=>1, 'picto'=>'project', 'css'=>'tdoverflowmax150 maxwidth500'), - 'email' => array('type'=>'mail', 'label'=>'EmailAttendee', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'index'=>1,), - 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status = 1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>40, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty", 'picto'=>'company', 'css'=>'tdoverflowmax150 maxwidth500'), - 'date_subscription' => array('type'=>'datetime', 'label'=>'DateOfRegistration', 'enabled'=>'1', 'position'=>56, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'1',), + 'email' => array('type'=>'mail', 'label'=>'EmailAttendee', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'autofocusoncreate'=>1), + 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status = 1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>40, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"OrganizationEventLinkToThirdParty", 'picto'=>'company', 'css'=>'tdoverflowmax150 maxwidth500'), + 'date_subscription' => array('type'=>'datetime', 'label'=>'DateOfRegistration', 'enabled'=>'1', 'position'=>56, 'notnull'=>1, 'visible'=>1, 'showoncombobox'=>'1',), 'fk_invoice' => array('type'=>'integer:Facture:compta/facture/class/facture.class.php', 'label'=>'Invoice', 'enabled'=>'1', 'position'=>57, 'notnull'=>0, 'visible'=>-1, 'index'=>0, 'picto'=>'bill', 'css'=>'tdoverflowmax150 maxwidth500'), 'amount' => array('type'=>'price', 'label'=>'AmountPaid', 'enabled'=>'1', 'position'=>57, 'notnull'=>0, 'visible'=>1, 'default'=>'null', 'isameasure'=>'1', 'help'=>"AmountOfSubscriptionPaid",), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>61, 'notnull'=>0, 'visible'=>3,), diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php index e6c03b0a74a..994729ce101 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_card.php +++ b/htdocs/eventorganization/conferenceorboothattendee_card.php @@ -57,9 +57,10 @@ $projectstatic = new Project($db); $diroutputmassaction = $conf->eventorganization->dir_output.'/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('conferenceorboothattendeecard', 'globalcard')); // Note that conf->hooks_modules contains array + if ($conf_or_booth_id > 0) { $confOrBooth = new ConferenceOrBooth($db); - $result = $confOrBooth->fetch($conf_or_booth_id); + $result = $confOrBooth->fetch($id > 0 ? $id : $conf_or_booth_id); if ($result < 0) { setEventMessages(null, $confOrBooth->errors, 'errors'); } else { @@ -102,6 +103,10 @@ if (empty($action) && empty($id) && empty($ref)) { // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +// Now we have loaded the attendee, we can force the project (in case value provided as parameter is wrong or value not provided) +if ($object->fk_project > 0) { + $fk_project = $object->fk_project; +} $permissiontoread = $user->rights->eventorganization->read; $permissiontoadd = $user->rights->eventorganization->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php @@ -657,16 +662,15 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (empty($reshook)) { // Send if (empty($user->socid)) { - print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').'&action=presend&mode=init#formmailbeforetitle'); + print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').'&action=presend&token='.newToken().'&mode=init#formmailbeforetitle'); } - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').'&action=edit', '', $permissiontoadd); + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').'&action=edit&token='.newToken(), '', $permissiontoadd); // Clone - print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=scrumsprint', '', $permissiontoadd); - + print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&token='.newToken().(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:''), '', $permissiontoadd); // Delete (need delete permission, or if draft, just need create/modify permission) - print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete', '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)); + print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken().(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:''), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)); } print '
    '."\n"; } diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index 849513710f7..4b107021a09 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -699,7 +699,8 @@ print ''; print ''; print ''; -$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_card.php?action=create'.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').$withProjectUrl.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.(empty($confOrBooth->id) ? '' : '&conforboothid='.$confOrBooth->id).$withProjectUrl), '', $permissiontoadd); +$params = array('morecss'=>'reposition'); +$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_card.php?action=create'.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').$withProjectUrl.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.(empty($confOrBooth->id) ? '' : '&conforboothid='.$confOrBooth->id).$withProjectUrl), '', $permissiontoadd, $params); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 52b00c7e592..e6f3432589c 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -136,6 +136,7 @@ OrganizationEventPaymentOfBoothWasReceived=Your payment for your booth has been OrganizationEventPaymentOfRegistrationWasReceived=Your payment for your event registration has been recorded OrganizationEventBulkMailToAttendees=This is a remind about your participation in the event as an attendee OrganizationEventBulkMailToSpeakers=This is a reminder on your participation in the event as a speaker +OrganizationEventLinkToThirdParty=Link to third party (customer, supplier or partner) # # Vote page @@ -153,7 +154,7 @@ ConfAttendeeSubscriptionConfirmation = Confirmation of your subscription to an e Attendee = Attendee PaymentConferenceAttendee = Conference attendee payment PaymentBoothLocation = Booth location payment - +DeleteConferenceOrBoothAttendee=Remove attendee RegistrationAndPaymentWereAlreadyRecorder=A registration and a payment were already recorded for the email %s EmailAttendee=Attendee email EmailCompanyForInvoice=Company email (for invoice, if different of attendee email) From ea3e3b133dfaf16b665167f9abaefbcba82e1fbd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Oct 2021 12:55:07 +0200 Subject: [PATCH 0715/1460] Debug eventorganization modules --- htdocs/core/actions_addupdatedelete.inc.php | 1 + htdocs/eventorganization/conferenceorboothattendee_card.php | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index f871ed73de8..86c5fe4175a 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -261,6 +261,7 @@ if ($action == 'confirm_delete' && !empty($permissiontodelete)) { } $result = $object->delete($user); + if ($result > 0) { // Delete OK setEventMessages("RecordDeleted", null, 'mesgs'); diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php index 994729ce101..6c27aa71705 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_card.php +++ b/htdocs/eventorganization/conferenceorboothattendee_card.php @@ -130,7 +130,7 @@ if (empty($reshook)) { $error = 0; if (!empty($withproject)) { - $backurlforlist = DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_list.php?withproject=1'; + $backurlforlist = DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_list.php?withproject=1&fk_project='.((int) $fk_project); } else { $backurlforlist = DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_list.php'; } @@ -156,7 +156,6 @@ if (empty($reshook)) { $action = ''; } - $triggermodname = 'EVENTORGANIZATION_CONFERENCEORBOOTHATTENDEE_MODIFY'; // Name of trigger action code to execute when we modify record // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen From 8f9a7f4e35bb328ccf4bbcffc73c9e6f2c76a427 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Oct 2021 13:26:42 +0200 Subject: [PATCH 0716/1460] Update 13.0.0-14.0.0.sql --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index a879d647c19..db0e40790dc 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -626,5 +626,3 @@ CREATE TABLE llx_onlinesignature ALTER TABLE llx_facture_fourn CHANGE COLUMN fk_mode_transport fk_transport_mode integer; -ALTER TABLE llx_c_holiday_types CHANGE COLUMN newByMonth newbymonth double(8,5) DEFAULT 0 NOT NULL; - From 89b2ecf50488443a1e54185b9aa32049a606b1c0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Oct 2021 13:28:05 +0200 Subject: [PATCH 0717/1460] Add missing migration sql --- htdocs/install/mysql/migration/14.0.0-15.0.0.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql index 7bf238da6b9..82a6bdec3dc 100644 --- a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql +++ b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql @@ -78,6 +78,9 @@ INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, -- v15 + +ALTER TABLE llx_c_holiday_types CHANGE COLUMN newByMonth newbymonth double(8,5) DEFAULT 0 NOT NULL; + ALTER TABLE llx_product ADD COLUMN mandatory_period tinyint NULL DEFAULT 0; ALTER TABLE llx_holiday ADD COLUMN date_approve DATETIME DEFAULT NULL; From b630b1599166106242b8f54621325fbe823d410e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Oct 2021 13:33:13 +0200 Subject: [PATCH 0718/1460] Add missing line to remove a tab in modulebuilder --- htdocs/modulebuilder/template/lib/mymodule.lib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/template/lib/mymodule.lib.php b/htdocs/modulebuilder/template/lib/mymodule.lib.php index 2cfc428b7ce..32ae980e946 100644 --- a/htdocs/modulebuilder/template/lib/mymodule.lib.php +++ b/htdocs/modulebuilder/template/lib/mymodule.lib.php @@ -60,7 +60,9 @@ function mymoduleAdminPrepareHead() //$this->tabs = array( // 'entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__' //); // to remove a tab - complete_head_from_modules($conf, $langs, null, $head, $h, 'mymodule'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'mymodule@mymodule'); + + complete_head_from_modules($conf, $langs, $object, $head, $h, 'mymodule@mymodule', 'remove'); return $head; } From d963aa8832c0a79c80f1e132c53119fa6b40082e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BCdiger=20Hahn?= Date: Mon, 4 Oct 2021 19:19:12 +0200 Subject: [PATCH 0719/1460] Allow removal of tabs For being able to remove or replace tabs, it is also necessary to call this function with 'remove' mode. --- htdocs/bom/lib/bom.lib.php | 4 +++- htdocs/mrp/lib/mrp_mo.lib.php | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/bom/lib/bom.lib.php b/htdocs/bom/lib/bom.lib.php index 8f3cadeedc2..edd9bd69ef4 100644 --- a/htdocs/bom/lib/bom.lib.php +++ b/htdocs/bom/lib/bom.lib.php @@ -54,7 +54,9 @@ function bomAdminPrepareHead() //$this->tabs = array( // 'entity:-tabname:Title:@bom:/bom/mypage.php?id=__ID__' //); // to remove a tab - complete_head_from_modules($conf, $langs, null, $head, $h, 'bom'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'bom@mrp'); + + complete_head_from_modules($conf, $langs, $object, $head, $h, 'bom@mrp', 'remove'); return $head; } diff --git a/htdocs/mrp/lib/mrp_mo.lib.php b/htdocs/mrp/lib/mrp_mo.lib.php index 8fe07df89c1..fd268c8f6f8 100644 --- a/htdocs/mrp/lib/mrp_mo.lib.php +++ b/htdocs/mrp/lib/mrp_mo.lib.php @@ -103,6 +103,8 @@ function moPrepareHead($object) // 'entity:-tabname:Title:@mrp:/mrp/mypage.php?id=__ID__' //); // to remove a tab complete_head_from_modules($conf, $langs, $object, $head, $h, 'mo@mrp'); + + complete_head_from_modules($conf, $langs, $object, $head, $h, 'mo@mrp', 'remove'); return $head; } From dceb2b5341fd8b5cf91769ec39115b2d64f7beb8 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Mon, 4 Oct 2021 22:12:50 +0200 Subject: [PATCH 0720/1460] Fix fatal error --- htdocs/core/modules/expedition/doc/pdf_espadon.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 97e24f44e94..430398d28d1 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/expedition/modules_expedition.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; - +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; /** * Class to build sending documents with model espadon From 5d9c87a9ea87e522d1010f63fc4a9f6ed4c4694c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Oct 2021 13:42:13 +0200 Subject: [PATCH 0721/1460] Update api_products.class.php --- htdocs/product/class/api_products.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 7b19739d10e..a964b63799b 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -462,8 +462,8 @@ class Products extends DolibarrApi $childsArbo = $this->product->getChildsArbo($id, 1); - $keys = ['rowid','qty', 'fk_product_type', 'label', 'incdec','ref']; - $childs = []; + $keys = array('rowid','qty', 'fk_product_type', 'label', 'incdec','ref'); + $childs = array(); foreach ($childsArbo as $values) { $childs[] = array_combine($keys, $values); } From 7b1b7c0ad65731a1b1c4fa94e3d4f896d26924f2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Oct 2021 13:42:49 +0200 Subject: [PATCH 0722/1460] Update api_products.class.php --- htdocs/product/class/api_products.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index a964b63799b..8f8f280b64b 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -462,7 +462,7 @@ class Products extends DolibarrApi $childsArbo = $this->product->getChildsArbo($id, 1); - $keys = array('rowid','qty', 'fk_product_type', 'label', 'incdec','ref'); + $keys = array('rowid', 'qty', 'fk_product_type', 'label', 'incdec', 'ref'); $childs = array(); foreach ($childsArbo as $values) { $childs[] = array_combine($keys, $values); From ba1590758267c010f0dcc10275af39f7a3e5b698 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Oct 2021 13:48:42 +0200 Subject: [PATCH 0723/1460] Update inventory.php --- htdocs/product/inventory/inventory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index f9fd832b138..c0b607cde45 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -801,7 +801,7 @@ if ($object->id > 0) { print '
    '; // Call method to disable the button if no qty entered yet for inventory - if (!$hasinput) { + if ($object->status != $object::STATUS_VALIDATED || !$hasinput) { print ' + + +
    +
    +trans('Label') . '">'; + print ''; + } +?> + +
    + + + diff --git a/htdocs/takepos/receipt.php b/htdocs/takepos/receipt.php index 627a6c99565..df0b55bc64e 100644 --- a/htdocs/takepos/receipt.php +++ b/htdocs/takepos/receipt.php @@ -54,6 +54,7 @@ $place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is $facid = GETPOST('facid', 'int'); +$action = GETPOST('action', 'aZ09'); $gift = GETPOST('gift', 'int'); if (empty($user->rights->takepos->run)) { @@ -169,33 +170,46 @@ if ($conf->global->TAKEPOS_SHOW_CUSTOMER) { lines as $line) { - ?> - - - product_label)) { - echo $line->product_label; - } else { - echo $line->description; - } ?> - - qty; ?> - total_ttc / $line->qty, 'MT'), 1); - } ?> - global->TAKEPOS_SHOW_HT_RECEIPT)) { ?> - total_ht, 1); - } ?> + if ($action == 'without_details') { + $qty = GETPOST('qty', 'int') > 0 ? GETPOST('qty', 'int') : 1; + print ''; + print '' . GETPOST('label', 'alphanohtml') . ''; + print '' . $qty . ''; + print '' . price(price2num($object->total_ttc / $qty, 'MU'), 1) . ''; + if (!empty($conf->global->TAKEPOS_SHOW_HT_RECEIPT)) { + print '' . price($object->total_ht, 1) . ''; + } + print '' . price($object->total_ttc, 1) . ''; + print ''; + } else { + foreach ($object->lines as $line) { + ?> + + + product_label)) { + echo $line->product_label; + } else { + echo $line->description; + } ?> + + qty; ?> + total_ttc / $line->qty, 'MT'), 1); + } ?> + global->TAKEPOS_SHOW_HT_RECEIPT)) { ?> + total_ht, 1); + } ?> + + total_ttc, 1); + } ?> + - total_ttc, 1); - } ?> - - From da52ee55a4e9adaaa2e51806ceaecc168d3c57b2 Mon Sep 17 00:00:00 2001 From: lvessiller Date: Thu, 7 Oct 2021 10:13:30 +0200 Subject: [PATCH 0761/1460] FIX sickler-ci errors --- htdocs/takepos/printbox.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/takepos/printbox.php b/htdocs/takepos/printbox.php index cc5f5b305d1..5d612fd19f2 100644 --- a/htdocs/takepos/printbox.php +++ b/htdocs/takepos/printbox.php @@ -87,13 +87,13 @@ top_htmlhead($head, '', 0, 0, $arrayofjs, $arrayofcss);
    trans('Label') . '">'; - print ''; - } + print ''; + print ''; +} ?>
    From 162d5d8a399d49a0cb562d5a6c21b60ada39289b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Oct 2021 10:38:10 +0200 Subject: [PATCH 0762/1460] Fix protection of double party accounting when using situation invoices --- htdocs/accountancy/index.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index 1842c23f418..cff986c4729 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -81,7 +81,12 @@ $help_url = ''; llxHeader('', $langs->trans("AccountancyArea"), $help_url); -if ($conf->accounting->enabled) { +if (!empty($conf->global->INVOICE_USE_SITUATION) && $conf->global->INVOICE_USE_SITUATION == 1) { + print load_fiche_titre($langs->trans("AccountancyArea"), '', 'accountancy'); + + print ''.$langs->trans("SorryThisModuleIsNotCompatibleWithTheExperimentalFeatureOfSituationInvoices")."\n"; + print "
    "; +} elseif ($conf->accounting->enabled) { $step = 0; $resultboxes = FormOther::getBoxesArea($user, "27"); // Load $resultboxes (selectboxlist + boxactivated + boxlista + boxlistb) @@ -258,7 +263,8 @@ if ($conf->accounting->enabled) { } else { print load_fiche_titre($langs->trans("AccountancyArea"), '', 'accountancy'); - print ''.$langs->trans("Module10Desc")."
    \n"; + print ''.$langs->trans("Module10Desc")."\n"; + print "
    "; } // End of page From 5910d100217c88ab6ac854c0ff17094bfbed67bd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Oct 2021 10:43:50 +0200 Subject: [PATCH 0763/1460] Add hidden option to allow to fix corrupted situations --- htdocs/compta/paiement/card.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index bc62064dc82..a90a52c4e20 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -443,11 +443,13 @@ if ($resql) print ''.$invoice->getLibStatut(5, $alreadypayed).''; print "\n"; - if ($objp->paye == 1) // If at least one invoice is paid, disable delete - { + + // If at least one invoice is paid, disable delete. INVOICE_CAN_DELETE_PAYMENT_EVEN_IF_INVOICE_CLOSED Can be use for maintenance purpose. Never use this in production + if ($objp->paye == 1 && empty($conf->global->INVOICE_CAN_DELETE_PAYMENT_EVEN_IF_INVOICE_CLOSED)) { $disable_delete = 1; $title_button = dol_escape_htmltag($langs->transnoentitiesnoconv("CantRemovePaymentWithOneInvoicePaid")); } + $total = $total + $objp->amount; $i++; } From 68ac62d09c8a01dc09f2d0e947094757dff871d0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Oct 2021 11:05:06 +0200 Subject: [PATCH 0764/1460] Fix phpcs --- htdocs/fourn/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index e4aeae07581..985c9a4cc62 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -984,7 +984,7 @@ if (empty($reshook)) if (!in_array($lines[$i]->id, $selectedLines)) { continue; // Skip unselected lines } - + $desc = ($lines[$i]->desc ? $lines[$i]->desc : $lines[$i]->libelle); $product_type = ($lines[$i]->product_type ? $lines[$i]->product_type : 0); From d245abe9087b6f2c53e76eeef66ec8dec94e3202 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Oct 2021 11:34:21 +0200 Subject: [PATCH 0765/1460] Fix rounding --- htdocs/accountancy/bookkeeping/balance.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index b84fe255760..1d210e74d8a 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -429,7 +429,7 @@ if ($action != 'export_csv') { print ''; print ''.$accounting_account.''; if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) { - print ''.price($opening_balance).''; + print ''.price(price2num($opening_balance, 'MT')).''; } $urlzoom = ''; @@ -443,9 +443,9 @@ if ($action != 'export_csv') { } } // Debit - print ''.price($line->debit).''; + print ''.price(price2num($line->debit, 'MT')).''; // Credit - print ''.price($line->credit).''; + print ''.price(price2num($line->credit, 'MT')).''; if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) { print ''.price(price2num($opening_balance + $line->debit - $line->credit, 'MT')).''; @@ -466,10 +466,10 @@ if ($action != 'export_csv') { if (!empty($show_subgroup)) { print ''.$langs->trans("SubTotal").':'; if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) { - print ''.price($sous_total_opening_balance).''; + print ''.price(price2num($sous_total_opening_balance, 'MT')).''; } - print ''.price($sous_total_debit).''; - print ''.price($sous_total_credit).''; + print ''.price(price2num($sous_total_debit, 'MT')).''; + print ''.price(price2num($sous_total_credit, 'MT')).''; if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) { print '' . price(price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit, 'MT')) . ''; } else { @@ -481,10 +481,10 @@ if ($action != 'export_csv') { print ''.$langs->trans("AccountBalance").':'; if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) { - print ''.price($total_opening_balance).''; + print ''.price(price2num($total_opening_balance, 'MT')).''; } - print ''.price($total_debit).''; - print ''.price($total_credit).''; + print ''.price(price2num($total_debit, 'MT')).''; + print ''.price(price2num($total_credit, 'MT')).''; if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) { print '' . price(price2num($total_opening_balance + $total_debit - $total_credit, 'MT')) . ''; } else { From 92319464d8f418cc847eaa291145f2c66dac5d6f Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Thu, 7 Oct 2021 12:27:52 +0200 Subject: [PATCH 0766/1460] FIX : travis --- htdocs/hrm/class/skillrank.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/hrm/class/skillrank.class.php b/htdocs/hrm/class/skillrank.class.php index 02bab9f1b9d..ed41e253cbc 100644 --- a/htdocs/hrm/class/skillrank.class.php +++ b/htdocs/hrm/class/skillrank.class.php @@ -217,7 +217,7 @@ class SkillRank extends CommonObject { global $langs; - $sqlfilter = 'fk_object='.$this->fk_object." AND objecttype='".$this->db->escape($this->objecttype)."' AND fk_skill = ".((int) $this->fk_skill); + $sqlfilter = 'fk_object='.((int)$this->fk_object)." AND objecttype='".$this->db->escape($this->objecttype)."' AND fk_skill = ".((int) $this->fk_skill); $alreadyLinked = $this->fetchAll('ASC', 'rowid', 0, 0, array('customsql' => $sqlfilter)); if (!empty($alreadyLinked)) { $this->error = $langs->trans('ErrSkillAlreadyAdded'); From 5e02548abbe5e009ff63dd040e764355a65647b4 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 7 Oct 2021 10:30:32 +0000 Subject: [PATCH 0767/1460] Fixing style errors. --- htdocs/hrm/class/skillrank.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/hrm/class/skillrank.class.php b/htdocs/hrm/class/skillrank.class.php index ed41e253cbc..97fcd7edab4 100644 --- a/htdocs/hrm/class/skillrank.class.php +++ b/htdocs/hrm/class/skillrank.class.php @@ -217,7 +217,7 @@ class SkillRank extends CommonObject { global $langs; - $sqlfilter = 'fk_object='.((int)$this->fk_object)." AND objecttype='".$this->db->escape($this->objecttype)."' AND fk_skill = ".((int) $this->fk_skill); + $sqlfilter = 'fk_object='.((int) $this->fk_object)." AND objecttype='".$this->db->escape($this->objecttype)."' AND fk_skill = ".((int) $this->fk_skill); $alreadyLinked = $this->fetchAll('ASC', 'rowid', 0, 0, array('customsql' => $sqlfilter)); if (!empty($alreadyLinked)) { $this->error = $langs->trans('ErrSkillAlreadyAdded'); From 12488f4a29febeed4c20067c63c0c4880aa013d5 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Thu, 7 Oct 2021 13:19:21 +0200 Subject: [PATCH 0768/1460] FIX : travis --- htdocs/hrm/compare.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/hrm/compare.php b/htdocs/hrm/compare.php index 283a8a0fce2..2f8dbc56188 100644 --- a/htdocs/hrm/compare.php +++ b/htdocs/hrm/compare.php @@ -489,9 +489,9 @@ function getSkillForUsers($TUser) $num = 0; while ($obj = $db->fetch_object($resql) ) { $sql1 = "SELECT count(*) as how_many_max FROM ".MAIN_DB_PREFIX."hrm_skillrank sr"; - $sql1.=" WHERE sr.rank = ".(int) $obj->rank; + $sql1.=" WHERE sr.rank = ".((int) $obj->rank); $sql1.=" AND sr.objecttype = '".Skillrank::SKILLRANK_TYPE_USER."'"; - $sql1.=" AND sr.fk_skill = ".$obj->fk_skill; + $sql1.=" AND sr.fk_skill = ".((int) $obj->fk_skill); $sql1.=" AND sr.fk_object IN (".implode(',', $TUser).")"; $resql1 = $db->query($sql1); @@ -533,7 +533,7 @@ function getSkillForJob($fk_job) $sql.=' FROM '.MAIN_DB_PREFIX.'hrm_skill sk'; $sql.=' LEFT JOIN '.MAIN_DB_PREFIX.'hrm_skillrank sr ON (sk.rowid = sr.fk_skill)'; $sql.=" WHERE sr.objecttype = '".SkillRank::SKILLRANK_TYPE_JOB."'"; - $sql.=' AND sr.fk_object IN ('.$fk_job.')'; + $sql.=' AND sr.fk_object = '.((int) $fk_job); $sql.=' GROUP BY sk.rowid, sk.label, sk.description, sk.skill_type, sr.fk_object, sr.objecttype, sr.fk_skill '; // group par competence*/ $resql = $db->query($sql); From 0a73b2874219c9ee5592493b6de1e2571e49afeb Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Thu, 7 Oct 2021 14:18:03 +0200 Subject: [PATCH 0769/1460] FIX : travis --- htdocs/hrm/compare.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/hrm/compare.php b/htdocs/hrm/compare.php index 2f8dbc56188..a13fa1245e9 100644 --- a/htdocs/hrm/compare.php +++ b/htdocs/hrm/compare.php @@ -478,7 +478,7 @@ function getSkillForUsers($TUser) $sql.= ' FROM '.MAIN_DB_PREFIX.'hrm_skill sk'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'hrm_skillrank sr ON (sk.rowid = sr.fk_skill)'; $sql.= " WHERE sr.objecttype = '".SkillRank::SKILLRANK_TYPE_USER."'"; - $sql.= ' AND sr.fk_object IN ('.implode(',', $TUser).')'; + $sql.= ' AND sr.fk_object IN ('.$db->sanitize(implode(',', $TUser)).')'; $sql.= " GROUP BY sk.rowid, sk.label, sk.description, sk.skill_type, sr.fk_object, sr.objecttype, sr.fk_skill "; // group par competence $resql = $db->query($sql); @@ -492,7 +492,7 @@ function getSkillForUsers($TUser) $sql1.=" WHERE sr.rank = ".((int) $obj->rank); $sql1.=" AND sr.objecttype = '".Skillrank::SKILLRANK_TYPE_USER."'"; $sql1.=" AND sr.fk_skill = ".((int) $obj->fk_skill); - $sql1.=" AND sr.fk_object IN (".implode(',', $TUser).")"; + $sql1.=" AND sr.fk_object IN (".$db->sanitize(implode(',', $TUser)).")"; $resql1 = $db->query($sql1); $objMax = $db->fetch_object($resql1); From da52b00aefea69c38a636237db3d4ea780793d52 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Thu, 7 Oct 2021 14:32:16 +0200 Subject: [PATCH 0770/1460] fix br --- htdocs/hrm/compare.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/hrm/compare.php b/htdocs/hrm/compare.php index a13fa1245e9..13b83af9737 100644 --- a/htdocs/hrm/compare.php +++ b/htdocs/hrm/compare.php @@ -443,7 +443,7 @@ function displayUsersListWithPicto(&$TUser, $fk_usergroup = 0, $namelist = 'list $desc .= $langs->trans('NoEval'); } - if (!empty($user->array_options['options_DDA'])) $desc .= '
    ' . $langs->trans('Anciennete') . ' : ' . dol_print_date(strtotime($user->array_options['options_DDA'])); + if (!empty($user->array_options['options_DDA'])) $desc .= '
    ' . $langs->trans('Anciennete') . ' : ' . dol_print_date(strtotime($user->array_options['options_DDA'])); $out .= '
  • ' . $form->showphoto('userphoto', $user, 0, 0, 0, 'photoref', 'small', 1, 0, 1) . ' From 4094d94bd6b9d87617e3d4717476af1ec602504b Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Thu, 7 Oct 2021 14:41:15 +0200 Subject: [PATCH 0771/1460] FIX : travis --- htdocs/hrm/evaluation_card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/hrm/evaluation_card.php b/htdocs/hrm/evaluation_card.php index 75c66ca3069..72ed1761947 100644 --- a/htdocs/hrm/evaluation_card.php +++ b/htdocs/hrm/evaluation_card.php @@ -581,7 +581,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $sql .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'hrm_skilldet as skdet_user ON (skdet_user.fk_skill = sk.rowid AND skdet_user.rank = ed.rank)'; //$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "hrm_skillrank as skr ON (j.rowid = skr.fk_object AND skr.fk_skill = ed.fk_skill AND skr.objecttype = 'job')"; $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'hrm_skilldet as skdet_required ON (skdet_required.fk_skill = sk.rowid AND skdet_required.rank = ed.required_rank)'; - $sql .= " WHERE e.rowid =" . $object->id; + $sql .= " WHERE e.rowid =" . ((int) $object->id); // echo $sql; From b905b1b4bc5d0bde06edc9ca96ff42e8c4c4caa9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Oct 2021 16:09:32 +0200 Subject: [PATCH 0772/1460] FIX missing filter status=1 on rss feeds --- htdocs/website/class/websitepage.class.php | 6 +++--- htdocs/website/samples/wrapper.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index 16053069d30..1d0e0afdf12 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -416,9 +416,9 @@ class WebsitePage extends CommonObject $sqlwhere = array(); if (count($filter) > 0) { foreach ($filter as $key => $value) { - if ($key == 't.rowid' || $key == 't.fk_website' || $key == 'status') { + if ($key == 't.rowid' || $key == 'rowid' || $key == 't.fk_website' || $key == 'fk_website' || $key == 'status' || $key == 't.status') { $sqlwhere[] = $key.' = '.((int) $value); - } elseif ($key == 'type_container') { + } elseif ($key == 'type_container' || $key == 't.type_container') { $sqlwhere[] = $key." = '".$this->db->escape($value)."'"; } elseif ($key == 'lang' || $key == 't.lang') { $listoflang = array(); @@ -436,7 +436,7 @@ class WebsitePage extends CommonObject } $sqlwhere[] = $stringtouse; } else { - $sqlwhere[] = $key.' LIKE \'%'.$this->db->escape($value).'%\''; + $sqlwhere[] = $key." LIKE '%".$this->db->escape($value)."%'"; } } } diff --git a/htdocs/website/samples/wrapper.php b/htdocs/website/samples/wrapper.php index 34f6db8d044..26adb3ef220 100644 --- a/htdocs/website/samples/wrapper.php +++ b/htdocs/website/samples/wrapper.php @@ -104,7 +104,7 @@ if ($rss) { $website->fetch('', $websitekey); - $filters = array('type_container'=>'blogpost'); + $filters = array('type_container'=>'blogpost', 'status'=>1); if ($l) { $filters['lang'] = $l; } From 6fdd1c49f3c9e073dc217cebb196607825d8016c Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Thu, 7 Oct 2021 17:29:20 +0200 Subject: [PATCH 0773/1460] FIX : travis --- htdocs/hrm/evaluation_list.php | 2 +- htdocs/hrm/job_list.php | 2 +- htdocs/hrm/position_list.php | 2 +- htdocs/hrm/skill_list.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/hrm/evaluation_list.php b/htdocs/hrm/evaluation_list.php index 6a74cb9bc6b..589dbb0dcfd 100644 --- a/htdocs/hrm/evaluation_list.php +++ b/htdocs/hrm/evaluation_list.php @@ -268,7 +268,7 @@ $sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key.', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$db->escape($key).' as options_'.$db->escape($key).', ' : ''); } } // Add fields from hooks diff --git a/htdocs/hrm/job_list.php b/htdocs/hrm/job_list.php index 1a2ca54f1a7..c1752c9dea7 100644 --- a/htdocs/hrm/job_list.php +++ b/htdocs/hrm/job_list.php @@ -268,7 +268,7 @@ $sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key.', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$db->escape($key).' as options_'.$db->escape($key).', ' : ''); } } // Add fields from hooks diff --git a/htdocs/hrm/position_list.php b/htdocs/hrm/position_list.php index fc40e58441c..54323a967e0 100644 --- a/htdocs/hrm/position_list.php +++ b/htdocs/hrm/position_list.php @@ -268,7 +268,7 @@ $sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key.', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$db->escape($key).' as options_'.$db->escape($key).', ' : ''); } } // Add fields from hooks diff --git a/htdocs/hrm/skill_list.php b/htdocs/hrm/skill_list.php index 009a5491342..a228e7c9c6e 100644 --- a/htdocs/hrm/skill_list.php +++ b/htdocs/hrm/skill_list.php @@ -268,7 +268,7 @@ $sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key.', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$db->escape($key).' as options_'.$db->escape($key).', ' : ''); } } // Add fields from hooks From 677002e8347aeb58e83e2d222aedc7bf5b39e4d5 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 7 Oct 2021 20:20:29 +0200 Subject: [PATCH 0774/1460] fix travis --- htdocs/expedition/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 1ba022efdb1..b9061b463ef 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1162,7 +1162,7 @@ if ($action == 'create') { // unit of order $unit_order = ''; - if ($conf->global->PRODUCT_USE_UNITS) { + if (!empty($conf->global->PRODUCT_USE_UNITS)) { $unit_order = measuringUnitString($line->fk_unit); } From e68d9dc73c8309de6d15621d0338ec577d74b6ef Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Thu, 7 Oct 2021 22:02:56 +0200 Subject: [PATCH 0775/1460] NEW Societe - Add perentity functionality on customer/supplier accountancy auxiliary account --- htdocs/accountancy/customer/lines.php | 14 ++++++++++-- htdocs/accountancy/customer/list.php | 6 ++++- htdocs/accountancy/journal/bankjournal.php | 14 ++++++++++-- .../accountancy/journal/purchasesjournal.php | 12 +++++++++- htdocs/accountancy/journal/sellsjournal.php | 12 +++++++++- htdocs/accountancy/supplier/lines.php | 12 +++++++++- htdocs/core/boxes/box_contacts.php | 12 +++++++++- htdocs/fourn/index.php | 10 ++++++++- .../accountancy/export-thirdpartyaccount.php | 22 ++++++++++++++++--- 9 files changed, 101 insertions(+), 13 deletions(-) diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 1e7c38b2607..b833ca887e9 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -191,7 +191,14 @@ print ''; -$sql = "(SELECT s.rowid, s.nom as name , s.address, s.zip , s.town, s.code_compta as compta , "; -$sql .= " s.fk_forme_juridique , s.fk_pays , s.phone , s.fax , f.datec , f.fk_soc , cp.label as country "; +$sql = "(SELECT s.rowid, s.nom as name , s.address, s.zip , s.town"; +if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { + $sql .= ", spe.accountancy_code_customer as compta"; +} else { + $sql .= ", s.code_compta"; +} +$sql .= ", s.fk_forme_juridique , s.fk_pays , s.phone , s.fax , f.datec , f.fk_soc , cp.label as country "; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; +if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { + $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity); +} $sql .= ", ".MAIN_DB_PREFIX."facture as f"; $sql .= ", ".MAIN_DB_PREFIX."c_country as cp"; $sql .= " WHERE f.fk_soc = s.rowid"; @@ -146,9 +154,17 @@ if ($socid > 0) { } $sql .= " GROUP BY name"; $sql .= ")"; -$sql .= "UNION (SELECT s.rowid, s.nom as name , s.address, s.zip , s.town, s.code_compta_fournisseur as compta , "; +$sql .= "UNION (SELECT s.rowid, s.nom as name , s.address, s.zip , s.town, , "; +if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { + $sql .= ", spe.accountancy_code_supplier as compta"; +} else { + $sql .= ", s.code_compta_fournisseur as compta"; +} $sql .= " s.fk_forme_juridique , s.fk_pays , s.phone , s.fax , ff.datec , ff.fk_soc , cp.label as country "; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; +if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { + $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity); +} $sql .= ", ".MAIN_DB_PREFIX."facture_fourn as ff"; $sql .= ", ".MAIN_DB_PREFIX."c_country as cp"; $sql .= " WHERE ff.fk_soc = s.rowid"; From c7fd9328cd0ab47cd138530f719dc0830da05380 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 8 Oct 2021 06:29:22 +0200 Subject: [PATCH 0776/1460] NEW Societe - Add perentity functionality on customer/supplier accountancy auxiliary account --- htdocs/accountancy/customer/lines.php | 8 +++---- htdocs/accountancy/supplier/list.php | 6 +++-- htdocs/core/boxes/box_factures_imp.php | 4 ++-- .../societe/mod_codecompta_digitaria.php | 23 +++++++++++++++---- .../install/mysql/migration/14.0.0-15.0.0.sql | 2 +- htdocs/societe/card.php | 3 +++ htdocs/societe/class/societe.class.php | 21 ++++++++--------- 7 files changed, 43 insertions(+), 24 deletions(-) diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index b833ca887e9..7f09e111a23 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -193,11 +193,11 @@ $sql = "SELECT f.rowid as facid, f.ref as ref, f.type, f.datef, f.ref_client,"; $sql .= " fd.rowid, fd.description, fd.product_type as line_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.vat_src_code, fd.total_ttc,"; $sql .= " s.rowid as socid, s.nom as name, s.code_client,"; if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { - $sql .= ", spe.accountancy_code_customer as code_compta_client"; - $sql .= ", spe.accountancy_code_supplier as code_compta_fournisseur"; + $sql .= " spe.accountancy_code_customer as code_compta_client,"; + $sql .= " spe.accountancy_code_supplier as code_compta_fournisseur,"; } else { - $sql .= ", s.code_compta as code_compta_client"; - $sql .= ", s.code_compta_fournisseur"; + $sql .= " s.code_compta as code_compta_client,"; + $sql .= " s.code_compta_fournisseur,"; } $sql .= " p.rowid as product_id, p.fk_product_type as product_type, p.ref as product_ref, p.label as product_label,"; if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) { diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index 13553358cf9..b3cafa7e5fc 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -245,10 +245,12 @@ $sql .= " aa.rowid as aarowid, aa2.rowid as aarowid_intra, aa3.rowid as aarowid_ $sql .= " co.code as country_code, co.label as country_label,"; $sql .= " s.rowid as socid, s.nom as name, s.tva_intra, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur,"; if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { - $sql .= " spe.accountancy_code_customer as code_compta_client, spe.accountancy_code_supplier as code_compta_fournisseur,"; + $sql .= " spe.accountancy_code_customer as code_compta_client,"; + $sql .= " spe.accountancy_code_supplier as code_compta_fournisseur,"; $sql .= " spe.accountancy_code_buy as company_code_buy"; } else { - $sql .= " s.code_compta as code_compta_client, s.code_compta_fournisseur,"; + $sql .= " s.code_compta as code_compta_client,"; + $sql .= " s.code_compta_fournisseur,"; $sql .= " s.accountancy_code_buy as company_code_buy"; } $parameters = array(); diff --git a/htdocs/core/boxes/box_factures_imp.php b/htdocs/core/boxes/box_factures_imp.php index 434ebec2602..c78e5b7dec9 100644 --- a/htdocs/core/boxes/box_factures_imp.php +++ b/htdocs/core/boxes/box_factures_imp.php @@ -125,9 +125,9 @@ class box_factures_imp extends ModeleBoxes } $sql .= " GROUP BY s.rowid, s.nom, s.name_alias, s.code_client, s.client, s.logo, s.email, s.entity, s.tva_intra, s.siren, s.siret, s.ape, s.idprof4, s.idprof5, s.idprof6,"; if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { - $sql .= " spe.accountancy_code_customer as code_compta"; + $sql .= " spe.accountancy_code_customer as code_compta,"; } else { - $sql .= " s.code_compta"; + $sql .= " s.code_compta,"; } $sql .= " f.ref, f.date_lim_reglement,"; $sql .= " f.type, f.datef, f.total_ht, f.total_tva, f.total_ttc, f.paye, f.fk_statut, f.rowid"; diff --git a/htdocs/core/modules/societe/mod_codecompta_digitaria.php b/htdocs/core/modules/societe/mod_codecompta_digitaria.php index c4887f01383..91f4bff07c4 100644 --- a/htdocs/core/modules/societe/mod_codecompta_digitaria.php +++ b/htdocs/core/modules/societe/mod_codecompta_digitaria.php @@ -252,17 +252,32 @@ class mod_codecompta_digitaria extends ModeleAccountancyCode */ public function checkIfAccountancyCodeIsAlreadyUsed($db, $code, $type = '') { + global $conf; + if ($type == 'supplier') { - $typethirdparty = 'code_compta_fournisseur'; + if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { + $typethirdparty = 'accountancy_code_supplier'; + } else { + $typethirdparty = 'code_compta_fournisseur'; + } } elseif ($type == 'customer') { - $typethirdparty = 'code_compta'; + if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { + $typethirdparty = 'accountancy_code_customer'; + } else { + $typethirdparty = 'code_compta'; + } } else { $this->error = 'Bad value for parameter type'; return -1; } - $sql = "SELECT ".$typethirdparty." FROM ".MAIN_DB_PREFIX."societe"; - $sql .= " WHERE ".$typethirdparty." = '".$db->escape($code)."'"; + if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { + $sql = "SELECT " . $typethirdparty . " FROM " . MAIN_DB_PREFIX . "societe_perentity"; + $sql .= " WHERE " . $typethirdparty . " = '" . $db->escape($code) . "'"; + } else { + $sql = "SELECT " . $typethirdparty . " FROM " . MAIN_DB_PREFIX . "societe"; + $sql .= " WHERE " . $typethirdparty . " = '" . $db->escape($code) . "'"; + } $resql = $db->query($sql); if ($resql) { diff --git a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql index 9a530147d9e..56ac0290292 100644 --- a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql +++ b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql @@ -373,4 +373,4 @@ ALTER TABLE llx_hrm_skillrank ADD CONSTRAINT llx_hrm_skillrank_fk_user_creat FOR -- Manage accountancy auxiliary account for thirdparties per entity ALTER TABLE llx_societe_perentity ADD COLUMN accountancy_code_customer varchar(24) AFTER entity; -- equivalent to code_compta in llx_societe -ALTER TABLE llx_societe_perentity ADD COLUMN accountancy_code_supplier varchar(24) AFTER accountancy_code_supplier; -- equivalent to code_compta_supplier in llx_societe +ALTER TABLE llx_societe_perentity ADD COLUMN accountancy_code_supplier varchar(24) AFTER accountancy_code_customer; -- equivalent to code_compta_supplier in llx_societe diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 334793985f0..6399add1af3 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -75,6 +75,9 @@ if (!empty($conf->incoterm->enabled)) { if (!empty($conf->notification->enabled)) { $langs->load("mails"); } +if (!empty($conf->accounting->enabled)) { + $langs->load("products"); +} $error = 0; $errors = array(); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index d83dd1f3d34..a7db5c1b4bb 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -8,7 +8,7 @@ * Copyright (C) 2008 Patrick Raguin * Copyright (C) 2010-2018 Juanjo Menent * Copyright (C) 2013 Florian Henry - * Copyright (C) 2013 Alexandre Spangaro + * Copyright (C) 2013-2021 Alexandre Spangaro * Copyright (C) 2013 Peter Fontaine * Copyright (C) 2014-2015 Marcos García * Copyright (C) 2015 Raphaël Doursenaud @@ -838,6 +838,8 @@ class Societe extends CommonObject } $this->import_key = trim($this->import_key); + $this->accountancy_code_customer = trim($this->accountancy_code_customer); + $this->accountancy_code_supplier = trim($this->accountancy_code_supplier); $this->accountancy_code_buy = trim($this->accountancy_code_buy); $this->accountancy_code_sell= trim($this->accountancy_code_sell); @@ -922,11 +924,15 @@ class Societe extends CommonObject $sql = "INSERT INTO " . MAIN_DB_PREFIX . "societe_perentity ("; $sql .= " fk_soc"; $sql .= ", entity"; + $sql .= ", accountancy_code_customer"; + $sql .= ", accountancy_code_supplier"; $sql .= ", accountancy_code_buy"; $sql .= ", accountancy_code_sell"; $sql .= ") VALUES ("; $sql .= $this->id; $sql .= ", " . $conf->entity; + $sql .= ", '" . $this->db->escape($this->accountancy_code_customer) . "'"; + $sql .= ", '" . $this->db->escape($this->accountancy_code_supplier) . "'"; $sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'"; $sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'"; $sql .= ")"; @@ -1553,16 +1559,9 @@ class Societe extends CommonObject $sql .= ") VALUES ("; $sql .= $this->id; $sql .= ", " . $conf->entity; + $sql .= ", '" . $this->db->escape($this->code_compta_client)."'"; + $sql .= ", '" . $this->db->escape($this->code_compta_fournisseur)."'"; $sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'"; - - if ($customer) { - $sql .= ", accountancy_code_customer = ".(!empty($this->code_compta_client) ? "'".$this->db->escape($this->code_compta_client)."'" : "null"); - } - - if ($supplier) { - $sql .= ", accountancy_code_supplier = ".(($this->code_compta_fournisseur != "") ? "'".$this->db->escape($this->code_compta_fournisseur)."'" : "null"); - } - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'"; $sql .= ")"; $result = $this->db->query($sql); @@ -3353,7 +3352,7 @@ class Societe extends CommonObject } /** - * Define parent commany of current company + * Define parent company of current company * * @param int $id Id of thirdparty to set or '' to remove * @return int <0 if KO, >0 if OK From 00eafcb6e709c139ef9c2185595baa427ab6df27 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 8 Oct 2021 06:50:22 +0200 Subject: [PATCH 0777/1460] NEW Societe - Add perentity functionality on customer/supplier accountancy auxiliary account --- htdocs/societe/card.php | 40 +++++++++++++------------- htdocs/societe/class/societe.class.php | 27 +++++++++++++++-- 2 files changed, 44 insertions(+), 23 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 6399add1af3..11cc7b55a4d 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -6,7 +6,7 @@ * Copyright (C) 2005-2017 Regis Houssin * Copyright (C) 2008 Patrick Raguin * Copyright (C) 2010-2020 Juanjo Menent - * Copyright (C) 2011-2013 Alexandre Spangaro + * Copyright (C) 2011-2021 Alexandre Spangaro * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Marcos García * Copyright (C) 2015 Raphaël Doursenaud @@ -446,19 +446,19 @@ if (empty($reshook)) { $object->name = dolGetFirstLastname(GETPOST('firstname', 'alphanohtml'), GETPOST('name', 'alphanohtml')); $object->civility_id = GETPOST('civility_id', 'alphanohtml'); // Note: civility id is a code, not an int // Add non official properties - $object->name_bis = GETPOST('name', 'alphanohtml'); - $object->firstname = GETPOST('firstname', 'alphanohtml'); + $object->name_bis = GETPOST('name', 'alphanohtml'); + $object->firstname = GETPOST('firstname', 'alphanohtml'); } else { - $object->name = GETPOST('name', 'alphanohtml'); + $object->name = GETPOST('name', 'alphanohtml'); } $object->entity = (GETPOSTISSET('entity') ? GETPOST('entity', 'int') : $conf->entity); - $object->name_alias = GETPOST('name_alias', 'alphanohtml'); + $object->name_alias = GETPOST('name_alias', 'alphanohtml'); $object->address = GETPOST('address', 'alphanohtml'); - $object->zip = GETPOST('zipcode', 'alphanohtml'); - $object->town = GETPOST('town', 'alphanohtml'); - $object->country_id = GETPOST('country_id', 'int'); - $object->state_id = GETPOST('state_id', 'int'); - //$object->skype = GETPOST('skype', 'alpha'); + $object->zip = GETPOST('zipcode', 'alphanohtml'); + $object->town = GETPOST('town', 'alphanohtml'); + $object->country_id = GETPOST('country_id', 'int'); + $object->state_id = GETPOST('state_id', 'int'); + //$object->skype = GETPOST('skype', 'alpha'); //$object->twitter = GETPOST('twitter', 'alpha'); //$object->facebook = GETPOST('facebook', 'alpha'); //$object->linkedin = GETPOST('linkedin', 'alpha'); @@ -470,9 +470,9 @@ if (empty($reshook)) { } } } - $object->phone = GETPOST('phone', 'alpha'); + $object->phone = GETPOST('phone', 'alpha'); $object->fax = GETPOST('fax', 'alpha'); - $object->email = trim(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL)); + $object->email = trim(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL)); $object->url = trim(GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL)); $object->idprof1 = trim(GETPOST('idprof1', 'alphanohtml')); $object->idprof2 = trim(GETPOST('idprof2', 'alphanohtml')); @@ -482,7 +482,7 @@ if (empty($reshook)) { $object->idprof6 = trim(GETPOST('idprof6', 'alphanohtml')); $object->prefix_comm = GETPOST('prefix_comm', 'alphanohtml'); $object->code_client = GETPOSTISSET('customer_code') ?GETPOST('customer_code', 'alpha') : GETPOST('code_client', 'alpha'); - $object->code_fournisseur = GETPOSTISSET('supplier_code') ?GETPOST('supplier_code', 'alpha') : GETPOST('code_fournisseur', 'alpha'); + $object->code_fournisseur = GETPOSTISSET('supplier_code') ?GETPOST('supplier_code', 'alpha') : GETPOST('code_fournisseur', 'alpha'); $object->capital = GETPOST('capital', 'alphanohtml'); $object->barcode = GETPOST('barcode', 'alphanohtml'); @@ -497,24 +497,24 @@ if (empty($reshook)) { $object->localtax1_value = GETPOST('lt1', 'alpha'); $object->localtax2_value = GETPOST('lt2', 'alpha'); - $object->forme_juridique_code = GETPOST('forme_juridique_code', 'int'); + $object->forme_juridique_code = GETPOST('forme_juridique_code', 'int'); $object->effectif_id = GETPOST('effectif_id', 'int'); - $object->typent_id = GETPOST('typent_id', 'int'); + $object->typent_id = GETPOST('typent_id', 'int'); $object->typent_code = dol_getIdFromCode($db, $object->typent_id, 'c_typent', 'id', 'code'); // Force typent_code too so check in verify() will be done on new type - $object->client = GETPOST('client', 'int'); + $object->client = GETPOST('client', 'int'); $object->fournisseur = GETPOST('fournisseur', 'int'); - $object->commercial_id = GETPOST('commercial_id', 'int'); - $object->default_lang = GETPOST('default_lang'); + $object->commercial_id = GETPOST('commercial_id', 'int'); + $object->default_lang = GETPOST('default_lang'); // Webservices url/key $object->webservices_url = GETPOST('webservices_url', 'custom', 0, FILTER_SANITIZE_URL); $object->webservices_key = GETPOST('webservices_key', 'san_alpha'); if (GETPOSTISSET('accountancy_code_sell')) { - $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); + $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') { $object->accountancy_code_sell = ''; @@ -523,7 +523,7 @@ if (empty($reshook)) { } } if (GETPOSTISSET('accountancy_code_buy')) { - $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); + $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') { $object->accountancy_code_buy = ''; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index a7db5c1b4bb..a1c1dae1ffb 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -563,11 +563,23 @@ class Societe extends CommonObject public $code_compta_client; /** - * Accounting code for suppliers + * Accounting code for customer + * @var string + */ + public $accountancy_code_customer; + + /** + * Accounting code for supplier * @var string */ public $code_compta_fournisseur; + /** + * Accounting code for supplier + * @var string + */ + public $accountancy_code_supplier; + /** * @var string * @deprecated Note is split in public and private notes @@ -838,8 +850,8 @@ class Societe extends CommonObject } $this->import_key = trim($this->import_key); - $this->accountancy_code_customer = trim($this->accountancy_code_customer); - $this->accountancy_code_supplier = trim($this->accountancy_code_supplier); + $this->accountancy_code_customer = trim($this->code_compta); + $this->accountancy_code_supplier = trim($this->code_compta_fournisseur); $this->accountancy_code_buy = trim($this->accountancy_code_buy); $this->accountancy_code_sell= trim($this->accountancy_code_sell); @@ -2027,6 +2039,15 @@ class Societe extends CommonObject // Remove third party if (!$error) { + if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { + $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_perentity"; + $sql .= " WHERE fk_soc = ".((int) $id); + if (!$this->db->query($sql)) { + $error++; + $this->errors[] = $this->db->lasterror(); + } + } + $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe"; $sql .= " WHERE rowid = ".((int) $id); if (!$this->db->query($sql)) { From 36aff803879fc3ab4b455277fcb20777825c3b3d Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Fri, 8 Oct 2021 09:12:48 +0200 Subject: [PATCH 0778/1460] FIX : travis --- htdocs/hrm/evaluation_list.php | 2 +- htdocs/hrm/job_list.php | 2 +- htdocs/hrm/position_list.php | 2 +- htdocs/hrm/skill_list.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/hrm/evaluation_list.php b/htdocs/hrm/evaluation_list.php index 589dbb0dcfd..c99275bf784 100644 --- a/htdocs/hrm/evaluation_list.php +++ b/htdocs/hrm/evaluation_list.php @@ -268,7 +268,7 @@ $sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$db->escape($key).' as options_'.$db->escape($key).', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key.', ' : ''); } } // Add fields from hooks diff --git a/htdocs/hrm/job_list.php b/htdocs/hrm/job_list.php index c1752c9dea7..2fe052c3cb5 100644 --- a/htdocs/hrm/job_list.php +++ b/htdocs/hrm/job_list.php @@ -268,7 +268,7 @@ $sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$db->escape($key).' as options_'.$db->escape($key).', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key.', ' : ''); } } // Add fields from hooks diff --git a/htdocs/hrm/position_list.php b/htdocs/hrm/position_list.php index 54323a967e0..85fd5365598 100644 --- a/htdocs/hrm/position_list.php +++ b/htdocs/hrm/position_list.php @@ -268,7 +268,7 @@ $sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$db->escape($key).' as options_'.$db->escape($key).', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key.', ' : ''); } } // Add fields from hooks diff --git a/htdocs/hrm/skill_list.php b/htdocs/hrm/skill_list.php index a228e7c9c6e..bef3c07c770 100644 --- a/htdocs/hrm/skill_list.php +++ b/htdocs/hrm/skill_list.php @@ -268,7 +268,7 @@ $sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$db->escape($key).' as options_'.$db->escape($key).', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key.', ' : ''); } } // Add fields from hooks From eb5c7d1f6f11c63357882b6670cf5493a19238c9 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Fri, 8 Oct 2021 09:22:35 +0200 Subject: [PATCH 0779/1460] FIX : travis --- htdocs/hrm/evaluation_list.php | 2 +- htdocs/hrm/job_list.php | 2 +- htdocs/hrm/position_list.php | 2 +- htdocs/hrm/skill_list.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/hrm/evaluation_list.php b/htdocs/hrm/evaluation_list.php index c99275bf784..9ec102c45ea 100644 --- a/htdocs/hrm/evaluation_list.php +++ b/htdocs/hrm/evaluation_list.php @@ -332,7 +332,7 @@ $sql .= $hookmanager->resPrint; /* If a group by is required $sql .= " GROUP BY "; foreach($object->fields as $key => $val) { - $sql .= 't.'.$key.', '; + $sql .= "t.".$key.", "; } // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { diff --git a/htdocs/hrm/job_list.php b/htdocs/hrm/job_list.php index 2fe052c3cb5..fdf2de51d45 100644 --- a/htdocs/hrm/job_list.php +++ b/htdocs/hrm/job_list.php @@ -332,7 +332,7 @@ $sql .= $hookmanager->resPrint; /* If a group by is required $sql .= " GROUP BY "; foreach($object->fields as $key => $val) { - $sql .= 't.'.$key.', '; + $sql .= "t.".$key.", "; } // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { diff --git a/htdocs/hrm/position_list.php b/htdocs/hrm/position_list.php index 85fd5365598..725948c4b3f 100644 --- a/htdocs/hrm/position_list.php +++ b/htdocs/hrm/position_list.php @@ -332,7 +332,7 @@ $sql .= $hookmanager->resPrint; /* If a group by is required $sql .= " GROUP BY "; foreach($object->fields as $key => $val) { - $sql .= 't.'.$key.', '; + $sql .= "t.".$key.", "; } // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { diff --git a/htdocs/hrm/skill_list.php b/htdocs/hrm/skill_list.php index bef3c07c770..19460326a67 100644 --- a/htdocs/hrm/skill_list.php +++ b/htdocs/hrm/skill_list.php @@ -332,7 +332,7 @@ $sql .= $hookmanager->resPrint; /* If a group by is required $sql .= " GROUP BY "; foreach($object->fields as $key => $val) { - $sql .= 't.'.$key.', '; + $sql .= "t.".$key.", "; } // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { From 47e1d4f86739fdb2fbae9b36333ef3554ade94be Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Fri, 8 Oct 2021 09:39:04 +0200 Subject: [PATCH 0780/1460] FIX : useless function --- htdocs/hrm/lib/hrm_skill.lib.php | 427 ------------------------------- 1 file changed, 427 deletions(-) diff --git a/htdocs/hrm/lib/hrm_skill.lib.php b/htdocs/hrm/lib/hrm_skill.lib.php index a2393229cb5..c9c83fa6411 100644 --- a/htdocs/hrm/lib/hrm_skill.lib.php +++ b/htdocs/hrm/lib/hrm_skill.lib.php @@ -93,430 +93,3 @@ function skillPrepareHead($object) return $head; } - - -/** - * Show html area for list of traduction - * - * @param Conf $conf Object conf - * @param Translate $langs Object langs - * @param DoliDB $db Database handler - * @param Societe $object Third party object - * @param string $backtopage Url to go once contact is created - * @return int - */ -function show_traduction($conf, $langs, $db, $object, $backtopage = '') -{ - global $user, $conf, $extrafields, $hookmanager; - global $contextpage; - - require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; - $formcompany = new FormCompany($db); - $form = new Form($db); - - $optioncss = GETPOST('optioncss', 'alpha'); - $sortfield = GETPOST("sortfield", 'alpha'); - $sortorder = GETPOST("sortorder", 'alpha'); - $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); - - $search_status = GETPOST("search_status", 'int'); - if ($search_status == '') { - $search_status = 1; // always display active customer first - } - - $search_name = GETPOST("search_name", 'alpha'); - $search_address = GETPOST("search_address", 'alpha'); - $search_poste = GETPOST("search_poste", 'alpha'); - $search_roles = GETPOST("search_roles", 'array'); - - $socialnetworks = getArrayOfSocialNetworks(); - - $searchAddressPhoneDBFields = array( - //Address - 't.address', - 't.zip', - 't.town', - - //Phone - 't.phone', - 't.phone_perso', - 't.phone_mobile', - - //Fax - 't.fax', - - //E-mail - 't.email', - ); - //Social media - // foreach ($socialnetworks as $key => $value) { - // if ($value['active']) { - // $searchAddressPhoneDBFields['t.'.$key] = "t.socialnetworks->'$.".$key."'"; - // } - // } - - if (!$sortorder) { - $sortorder = "ASC"; - } - if (!$sortfield) { - $sortfield = "t.lastname"; - } - - if (!empty($conf->clicktodial->enabled)) { - $user->fetch_clicktodial(); // lecture des infos de clicktodial du user - } - - - $SkillLinestatic = new SkillLine($db); - - $extrafields->fetch_name_optionals_label($SkillLinestatic->table_element); - - $SkillLinestatic->fields=array( - 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), - 'fk_skill' => array('type'=>'integer:Skill:skill/class/skill.class.php', 'label'=>'foreign key skill', 'enabled'=>'1', 'position'=>510, 'notnull'=>1, 'visible'=>-2, 'foreignkey'=>'user.rowid',), - 'traduction_note' => array('type'=>'text', 'label'=>'traduction_note', 'enabled'=>'1', 'position'=>56, 'notnull'=>0, 'visible'=>1,), - 'rank' => array('type'=>'integer', 'label'=>'rank', 'enabled'=>'1', 'position'=>55, 'notnull'=>1, 'visible'=>1, 'index'=>1,), - ); - - // Definition of fields for list - $arrayfields = array( - 't.rowid'=>array('label'=>"TechnicalID", 'checked'=>(!empty($conf->global->MAIN_SHOW_TECHNICAL_ID) ? 1 : 0), 'enabled'=>(!empty($conf->global->MAIN_SHOW_TECHNICAL_ID) ? 1 : 0), 'position'=>1), - 't.name'=>array('label'=>"Name", 'checked'=>1, 'position'=>10), - 't.poste'=>array('label'=>"PostOrFunction", 'checked'=>1, 'position'=>20), - 't.address'=>array('label'=>(empty($conf->dol_optimize_smallscreen) ? $langs->trans("Address").' / '.$langs->trans("Phone").' / '.$langs->trans("Email") : $langs->trans("Address")), 'checked'=>1, 'position'=>30), - 'sc.role'=>array('label'=>"ContactByDefaultFor", 'checked'=>1, 'position'=>40), - 't.statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>50, 'class'=>'center'), - ); - // Extra fields - if (!empty($extrafields->attributes[$contactstatic->table_element]['label']) && is_array($extrafields->attributes[$contactstatic->table_element]['label']) && count($extrafields->attributes[$contactstatic->table_element]['label'])) { - foreach ($extrafields->attributes[$contactstatic->table_element]['label'] as $key => $val) { - if (!empty($extrafields->attributes[$contactstatic->table_element]['list'][$key])) { - $arrayfields["ef.".$key] = array( - 'label'=>$extrafields->attributes[$contactstatic->table_element]['label'][$key], - 'checked'=>(($extrafields->attributes[$contactstatic->table_element]['list'][$key] < 0) ? 0 : 1), - 'position'=>1000 + $extrafields->attributes[$contactstatic->table_element]['pos'][$key], - 'enabled'=>(abs($extrafields->attributes[$contactstatic->table_element]['list'][$key]) != 3 && $extrafields->attributes[$contactstatic->table_element]['perms'][$key])); - } - } - } - - // Initialize array of search criterias - $search = array(); - foreach ($arrayfields as $key => $val) { - $queryName = 'search_'.substr($key, 2); - if (GETPOST($queryName, 'alpha')) { - $search[substr($key, 2)] = GETPOST($queryName, 'alpha'); - } - } - $search_array_options = $extrafields->getOptionalsFromPost($contactstatic->table_element, '', 'search_'); - - // Purge search criteria - if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers - $search_status = ''; - $search_name = ''; - $search_roles = array(); - $search_address = ''; - $search_poste = ''; - $search = array(); - $search_array_options = array(); - - foreach ($contactstatic->fields as $key => $val) { - $search[$key] = ''; - } - } - - $contactstatic->fields = dol_sort_array($contactstatic->fields, 'position'); - $arrayfields = dol_sort_array($arrayfields, 'position'); - - $newcardbutton = ''; - if ($user->rights->societe->contact->creer) { - $addTraduction = $langs->trans("AddTraduction"); - $newcardbutton .= dolGetButtonTitle($addTraduction, '', 'fa fa-plus-circle', DOL_URL_ROOT.'/skilldet/card.php?skillid='.$object->id.'&action=create&backtopage='.urlencode($backtopage)); - } - - print "\n"; - - $title = $langs->trans("TraductionRule"); - print load_fiche_titre($title, $newcardbutton, ''); - - print '
    '; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - - $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; - $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields - //if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1); - - print '
    '; // You can use div-table-responsive-no-min if you dont need reserved height for your table - print "\n".''."\n"; - - $param = "socid=".urlencode($object->id); - if ($search_status != '') { - $param .= '&search_status='.urlencode($search_status); - } - if (count($search_roles) > 0) { - $param .= implode('&search_roles[]=', $search_roles); - } - if ($search_name != '') { - $param .= '&search_name='.urlencode($search_name); - } - if ($search_poste != '') { - $param .= '&search_poste='.urlencode($search_poste); - } - if ($search_address != '') { - $param .= '&search_address='.urlencode($search_address); - } - if ($optioncss != '') { - $param .= '&optioncss='.urlencode($optioncss); - } - - // Add $param from extra fields - $extrafieldsobjectkey = $contactstatic->table_element; - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; - - $sql = "SELECT t.rowid, t.lastname, t.firstname, t.fk_pays as country_id, t.civility, t.poste, t.phone as phone_pro, t.phone_mobile, t.phone_perso, t.fax, t.email, t.socialnetworks, t.statut, t.photo,"; - $sql .= " t.civility as civility_id, t.address, t.zip, t.town"; - $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as t"; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople_extrafields as ef on (t.rowid = ef.fk_object)"; - $sql .= " WHERE t.fk_soc = ".$object->id; - if ($search_status != '' && $search_status != '-1') { - $sql .= " AND t.statut = ".$db->escape($search_status); - } - if ($search_name) { - $sql .= natural_search(array('t.lastname', 't.firstname'), $search_name); - } - if ($search_poste) { - $sql .= natural_search('t.poste', $search_poste); - } - if ($search_address) { - $sql .= natural_search($searchAddressPhoneDBFields, $search_address); - } - if (count($search_roles) > 0) { - $sql .= " AND t.rowid IN (SELECT sc.fk_socpeople FROM ".MAIN_DB_PREFIX."societe_contacts as sc WHERE sc.fk_c_type_contact IN (".$db->sanitize(implode(',', $search_roles))."))"; - } - // Add where from extra fields - $extrafieldsobjectkey = $contactstatic->table_element; - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; - if ($sortfield == "t.name") { - $sql .= " ORDER BY t.lastname $sortorder, t.firstname $sortorder"; - } else { - $sql .= " ORDER BY $sortfield $sortorder"; - } - - dol_syslog('core/lib/company.lib.php :: show_contacts', LOG_DEBUG); - $result = $db->query($sql); - if (!$result) { - dol_print_error($db); - } - - $num = $db->num_rows($result); - - // Fields title search - // -------------------------------------------------------------------- - print ''; - foreach ($contactstatic->fields as $key => $val) { - $align = ''; - if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { - $align .= ($align ? ' ' : '').'center'; - } - if (in_array($val['type'], array('timestamp'))) { - $align .= ($align ? ' ' : '').'nowrap'; - } - if ($key == 'status' || $key == 'statut') { - $align .= ($align ? ' ' : '').'center'; - } - if (!empty($arrayfields['t.'.$key]['checked']) || !empty($arrayfields['sc.'.$key]['checked'])) { - print ''; - } - } - // Extra fields - $extrafieldsobjectkey = $contactstatic->table_element; - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; - - // Fields from hook - $parameters = array('arrayfields'=>$arrayfields); - $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $contactstatic); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - // Action column - print ''; - print ''."\n"; - - - // Fields title label - // -------------------------------------------------------------------- - print ''; - foreach ($contactstatic->fields as $key => $val) { - $align = ''; - if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { - $align .= ($align ? ' ' : '').'center'; - } - if (in_array($val['type'], array('timestamp'))) { - $align .= ($align ? ' ' : '').'nowrap'; - } - if ($key == 'status' || $key == 'statut') { - $align .= ($align ? ' ' : '').'center'; - } - if (!empty($arrayfields['t.'.$key]['checked'])) { - print getTitleFieldOfList($val['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($align ? 'class="'.$align.'"' : ''), $sortfield, $sortorder, $align.' ')."\n"; - } - if ($key == 'role') { - $align .= ($align ? ' ' : '').'left'; - } - if (!empty($arrayfields['sc.'.$key]['checked'])) { - print getTitleFieldOfList($arrayfields['sc.'.$key]['label'], 0, $_SERVER['PHP_SELF'], '', '', $param, ($align ? 'class="'.$align.'"' : ''), $sortfield, $sortorder, $align.' ')."\n"; - } - } - // Extra fields - $extrafieldsobjectkey = $contactstatic->table_element; - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; - // Hook fields - $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); - $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ')."\n"; - print ''."\n"; - - $i = -1; - - if ($num || (GETPOST('button_search') || GETPOST('button_search.x') || GETPOST('button_search_x'))) { - $i = 0; - - while ($i < $num) { - $obj = $db->fetch_object($result); - - $contactstatic->id = $obj->rowid; - $contactstatic->ref = $obj->rowid; - $contactstatic->statut = $obj->statut; - $contactstatic->lastname = $obj->lastname; - $contactstatic->firstname = $obj->firstname; - $contactstatic->civility_id = $obj->civility_id; - $contactstatic->civility_code = $obj->civility_id; - $contactstatic->poste = $obj->poste; - $contactstatic->address = $obj->address; - $contactstatic->zip = $obj->zip; - $contactstatic->town = $obj->town; - $contactstatic->phone_pro = $obj->phone_pro; - $contactstatic->phone_mobile = $obj->phone_mobile; - $contactstatic->phone_perso = $obj->phone_perso; - $contactstatic->email = $obj->email; - $contactstatic->socialnetworks = $obj->socialnetworks; - $contactstatic->photo = $obj->photo; - - $country_code = getCountry($obj->country_id, 2); - $contactstatic->country_code = $country_code; - - $contactstatic->setGenderFromCivility(); - $contactstatic->fetch_optionals(); - - $resultRole = $contactstatic->fetchRoles(); - if ($resultRole < 0) { - setEventMessages(null, $contactstatic->errors, 'errors'); - } - - if (is_array($contactstatic->array_options)) { - foreach ($contactstatic->array_options as $key => $val) { - $obj->$key = $val; - } - } - - print ''; - - // ID - if (!empty($arrayfields['t.rowid']['checked'])) { - print ''; - } - - // Photo - Name - if (!empty($arrayfields['t.name']['checked'])) { - print ''; - } - - // Job position - if (!empty($arrayfields['t.poste']['checked'])) { - print ''; - } - - // Address - Phone - Email - if (!empty($arrayfields['t.address']['checked'])) { - print ''; - } - - // Role - if (!empty($arrayfields['sc.role']['checked'])) { - print ''; - } - - // Status - if (!empty($arrayfields['t.statut']['checked'])) { - print ''; - } - - // Extra fields - $extrafieldsobjectkey = $contactstatic->table_element; - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; - - // Actions - print ''; - - print "\n"; - $i++; - } - } else { - $colspan = 1; - foreach ($arrayfields as $key => $val) { - if (!empty($val['checked'])) { - $colspan++; - } - } - print ''; - } - print "\n
    '; - if (in_array($key, array('statut'))) { - print $form->selectarray('search_status', array('-1'=>'', '0'=>$contactstatic->LibStatut(0, 1), '1'=>$contactstatic->LibStatut(1, 1)), $search_status); - } elseif (in_array($key, array('role'))) { - print $formcompany->showRoles("search_roles", $contactstatic, 'edit', $search_roles); - } else { - print ''; - } - print ''; - print $form->showFilterButtons(); - print '
    '; - print $contactstatic->id; - print ''; - print $form->showphoto('contact', $contactstatic, 0, 0, 0, 'photorefnoborder valignmiddle marginrightonly', 'small', 1, 0, 1); - print $contactstatic->getNomUrl(0, '', 0, '&backtopage='.urlencode($backtopage)); - print ''; - if ($obj->poste) { - print $obj->poste; - } - print ''; - print $contactstatic->getBannerAddress('contact', $object); - print ''; - print $formcompany->showRoles("roles", $contactstatic, 'view'); - print ''.$contactstatic->getLibStatut(5).''; - - // Add to agenda - if (!empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) { - print ''; - print img_object($langs->trans("Event"), "action"); - print '   '; - } - - // Edit - if ($user->rights->societe->contact->creer) { - print ''; - print img_edit(); - print ''; - } - - print '
    '.$langs->trans("None").'
    \n"; - print '
    '; - - print '
    '."\n"; - - return $i; -} From e00dcb4f736723cab3ba66ea060b167f5948a9d2 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Fri, 8 Oct 2021 09:48:17 +0200 Subject: [PATCH 0781/1460] FIX : travis --- htdocs/hrm/position.php | 2 +- htdocs/hrm/skill_card.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/hrm/position.php b/htdocs/hrm/position.php index 0fcc817c8c9..f17676dc5d9 100644 --- a/htdocs/hrm/position.php +++ b/htdocs/hrm/position.php @@ -479,7 +479,7 @@ function DisplayPositionList() } else { $sql .= " WHERE 1 = 1"; } - $sql .= " AND t.fk_job = " . $fk_job . " "; + $sql .= " AND t.fk_job = " . ((int) $fk_job) . " "; foreach ($search as $key => $val) { if (array_key_exists($key, $object->fields)) { diff --git a/htdocs/hrm/skill_card.php b/htdocs/hrm/skill_card.php index 7d45ab152a0..c0d3d67ccab 100644 --- a/htdocs/hrm/skill_card.php +++ b/htdocs/hrm/skill_card.php @@ -627,7 +627,7 @@ if ($action != "create" && $action != "edit") { } if (!empty($id)) { - $sql .= " AND fk_skill = " . $id . " "; + $sql .= " AND fk_skill = " . ((int) $id) . " "; } // if total of record found is smaller than limit, no need to do paging and to restart another select with limits set. From 0f6d29549b60b329ed0628212993ec43224b4b84 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Fri, 8 Oct 2021 09:57:33 +0200 Subject: [PATCH 0782/1460] FIX : travis --- htdocs/hrm/position.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/hrm/position.php b/htdocs/hrm/position.php index f17676dc5d9..14ed85466c0 100644 --- a/htdocs/hrm/position.php +++ b/htdocs/hrm/position.php @@ -458,7 +458,7 @@ function DisplayPositionList() // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef." . $key . ' as options_' . $key . ', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef." . $key . " as options_" . $key . ', ' : ''); } } // Add fields from hooks From 03d7a8e946ff500108b6b6040858bbf9da4c6436 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Fri, 8 Oct 2021 10:04:35 +0200 Subject: [PATCH 0783/1460] FIX : travis --- htdocs/hrm/position.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/hrm/position.php b/htdocs/hrm/position.php index 14ed85466c0..8eec7d0e660 100644 --- a/htdocs/hrm/position.php +++ b/htdocs/hrm/position.php @@ -524,7 +524,7 @@ function DisplayPositionList() /* If a group by is required $sql .= " GROUP BY "; foreach($object->fields as $key => $val) { - $sql .= 't.'.$key.', '; + $sql .= "t.".$key.", "; } // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { From 1329df69c615dff09490f7aa6b6a273eae350ce3 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Fri, 8 Oct 2021 10:13:19 +0200 Subject: [PATCH 0784/1460] FIX : travis --- htdocs/hrm/skill_tab.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/hrm/skill_tab.php b/htdocs/hrm/skill_tab.php index 5e4b33345b7..355374b6d7c 100644 --- a/htdocs/hrm/skill_tab.php +++ b/htdocs/hrm/skill_tab.php @@ -178,7 +178,7 @@ if (empty($reshook)) { } else if ($action == 'saveSkill') { if (!empty($TNote)) { foreach ($TNote as $skillId => $rank) { - $TSkills = $skill->fetchAll('ASC', 't.rowid', 0, 0, array('customsql' => 'fk_object=' . $id . " AND objecttype='" . $objecttype . "' AND fk_skill = " . $skillId)); + $TSkills = $skill->fetchAll('ASC', 't.rowid', 0, 0, array('customsql' => 'fk_object=' . $id . " AND objecttype='" . $objecttype . "' AND fk_skill = " . ((int) $skillId))); if (is_array($TSkills) && !empty($TSkills)) { foreach ($TSkills as $tmpObj) { $tmpObj->rank = $rank; From f4ffeacba8ffa429459a78ef05ba6da9b468715c Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Fri, 8 Oct 2021 10:20:27 +0200 Subject: [PATCH 0785/1460] FIX : travis --- htdocs/hrm/skill_tab.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/hrm/skill_tab.php b/htdocs/hrm/skill_tab.php index 355374b6d7c..d0b3af9ca1f 100644 --- a/htdocs/hrm/skill_tab.php +++ b/htdocs/hrm/skill_tab.php @@ -178,7 +178,7 @@ if (empty($reshook)) { } else if ($action == 'saveSkill') { if (!empty($TNote)) { foreach ($TNote as $skillId => $rank) { - $TSkills = $skill->fetchAll('ASC', 't.rowid', 0, 0, array('customsql' => 'fk_object=' . $id . " AND objecttype='" . $objecttype . "' AND fk_skill = " . ((int) $skillId))); + $TSkills = $skill->fetchAll('ASC', 't.rowid', 0, 0, array('customsql' => 'fk_object=' . ((int) $id) . " AND objecttype='" . $objecttype . "' AND fk_skill = " . ((int) $skillId))); if (is_array($TSkills) && !empty($TSkills)) { foreach ($TSkills as $tmpObj) { $tmpObj->rank = $rank; @@ -283,7 +283,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } // table of skillRank linked to current object - $TSkillsJob = $skill->fetchAll('ASC', 't.rowid', 0, 0, array('customsql' => 'fk_object=' . $id . " AND objecttype='" . $objecttype . "'")); + $TSkillsJob = $skill->fetchAll('ASC', 't.rowid', 0, 0, array('customsql' => 'fk_object=' . ((int) $id) . " AND objecttype='" . $objecttype . "'")); $TAlreadyUsedSkill = array(); if (is_array($TSkillsJob) && !empty($TSkillsJob)) { From 82a299538b3242f989c7b473b67db64d6f87817a Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Fri, 8 Oct 2021 10:56:51 +0200 Subject: [PATCH 0786/1460] FIX : travis --- htdocs/hrm/skill_tab.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/hrm/skill_tab.php b/htdocs/hrm/skill_tab.php index d0b3af9ca1f..8cdf79f4bdf 100644 --- a/htdocs/hrm/skill_tab.php +++ b/htdocs/hrm/skill_tab.php @@ -178,7 +178,7 @@ if (empty($reshook)) { } else if ($action == 'saveSkill') { if (!empty($TNote)) { foreach ($TNote as $skillId => $rank) { - $TSkills = $skill->fetchAll('ASC', 't.rowid', 0, 0, array('customsql' => 'fk_object=' . ((int) $id) . " AND objecttype='" . $objecttype . "' AND fk_skill = " . ((int) $skillId))); + $TSkills = $skill->fetchAll('ASC', 't.rowid', 0, 0, array('customsql' => 'fk_object=' . ((int) $id) . " AND objecttype='" . $db->escape($objecttype) . "' AND fk_skill = " . ((int) $skillId))); if (is_array($TSkills) && !empty($TSkills)) { foreach ($TSkills as $tmpObj) { $tmpObj->rank = $rank; @@ -283,7 +283,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } // table of skillRank linked to current object - $TSkillsJob = $skill->fetchAll('ASC', 't.rowid', 0, 0, array('customsql' => 'fk_object=' . ((int) $id) . " AND objecttype='" . $objecttype . "'")); + $TSkillsJob = $skill->fetchAll('ASC', 't.rowid', 0, 0, array('customsql' => 'fk_object=' . ((int) $id) . " AND objecttype='" . $db->escape($objecttype) . "'")); $TAlreadyUsedSkill = array(); if (is_array($TSkillsJob) && !empty($TSkillsJob)) { From 816e4cdde6e27fcc8adf9bc7d379ddcc6ed6a72c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Oct 2021 10:59:11 +0200 Subject: [PATCH 0787/1460] Comment --- htdocs/core/lib/website.lib.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index 20380e02aab..5dd45589936 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -528,8 +528,10 @@ function includeContainer($containerref) } /** - * Return HTML content to add structured data for an article, news or Blog Post. - * Use the json-ld format. + * Return HTML content to add structured data for an article, news or Blog Post. Use the json-ld format. + * Example: + * + * 'Name', 'os'=>'Windows', 'price'=>10)); ?> * * @param string $type 'blogpost', 'product', 'software', 'organization', 'qa', ... * @param array $data Array of data parameters for structured data From cb490c0eaca27b320339db0074acdd8c990cc3e0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Oct 2021 11:06:28 +0200 Subject: [PATCH 0788/1460] Allow twitter cards per page. --- htdocs/core/lib/website.lib.php | 58 +++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index 20380e02aab..dbb4f494e51 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -734,6 +734,64 @@ function getStructuredData($type, $data = array()) return $ret; } +/** + * Return HTML content to add as header card for an article, news or Blog Post or home page. + * + * @param array $params Array of parameters + * @return string HTML content + */ +function getSocialNetworkHeaderCards($params = null) +{ + global $conf, $db, $hookmanager, $langs, $mysoc, $user, $website, $websitepage, $weblangs; // Very important. Required to have var available when running inluded containers. + + $out = ''; + + if ($website->virtualhost) { + $pageurl = $websitepage->pageurl; + $title = $websitepage->title; + $image = $websitepage->image; + $companyname = $mysoc->name; + $description = $websitepage->description; + + $pageurl = str_replace('__WEBSITE_KEY__', $website->ref, $pageurl); + $title = str_replace('__WEBSITE_KEY__', $website->ref, $title); + $image = '/medias'.(preg_match('/^\//', $image) ? '' : '/').str_replace('__WEBSITE_KEY__', $website->ref, $image); + $companyname = str_replace('__WEBSITE_KEY__', $website->ref, $companyname); + $description = str_replace('__WEBSITE_KEY__', $website->ref, $description); + + $fullurl = $website->virtualhost.'/'.$websitepage->pageurl.'.php'; + $hashtags = trim(join(' #', array_map('trim', explode(',', $websitepage->keywords)))); + + // Twitter + $out .= ''."\n"; + if (!empty($params) && !empty($params['twitter_account'])) { + $out .= ''."\n"; + $out .= ''."\n"; + } + $out .= ''."\n"; + if ($websitepage->description) { + $out .= ''."\n"; + } + if ($websitepage->image) { + $out .= ''."\n"; + } + //$out .= ''; + /* + $out .= ''; + $out .= ''; + $out .= ''; + $out .= ''; + $out .= ''; + $out .= ''; + $out .= ''; + $out .= ''; + $out .= ''; + */ + } + + return $out; +} + /** * Return HTML content to add structured data for an article, news or Blog Post. * From da0a9e13f56b9735a77db8a7ae4179ff2a07a825 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Oct 2021 11:41:45 +0200 Subject: [PATCH 0789/1460] Fix twitter tag --- htdocs/core/lib/website.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index dbb4f494e51..3726e6c915e 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -773,7 +773,7 @@ function getSocialNetworkHeaderCards($params = null) $out .= ''."\n"; } if ($websitepage->image) { - $out .= ''."\n"; + $out .= ''."\n"; } //$out .= ''; /* From 6c548d064fabc44a97fd7e0743f5578246313480 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Fri, 8 Oct 2021 11:47:35 +0200 Subject: [PATCH 0790/1460] FIX : IHM --- htdocs/hrm/evaluation_card.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/hrm/evaluation_card.php b/htdocs/hrm/evaluation_card.php index 72ed1761947..64b54b4c80b 100644 --- a/htdocs/hrm/evaluation_card.php +++ b/htdocs/hrm/evaluation_card.php @@ -623,8 +623,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print '' . $langs->trans("TypeSkill") . ' '; print '' . $langs->trans("Label") . ''; print '' . $langs->trans("Description") . ''; - print '' . $langs->trans("UserRank") . ''; - print '' . $langs->trans("RequiredRank") . ''; + print '' . $langs->trans("EmployeeRank") . ''; + print '' . $langs->trans("RequiredRank") . ''; print '' . $langs->trans("Result") . ''; print ''; @@ -635,8 +635,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ' ' . Skill::typeCodeToLabel($t->skill_type) . ''; print ' ' . $sk->getNomUrl(1) . ''; print ' ' . $t->description . ''; - print ' ' . $t->userRankForSkill . ''; - print ' ' . $t->required_rank . ''; + print ' ' . $t->userRankForSkill . ''; + print ' ' . $t->required_rank . ''; print ' ' . $t->result . ''; print ''; } From a057c7c2a7f81c911dc68cb5aacadce79ca4b7c2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Oct 2021 11:49:28 +0200 Subject: [PATCH 0791/1460] Add og graph --- htdocs/core/lib/website.lib.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index 3726e6c915e..3e7ddb019a1 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -762,6 +762,14 @@ function getSocialNetworkHeaderCards($params = null) $fullurl = $website->virtualhost.'/'.$websitepage->pageurl.'.php'; $hashtags = trim(join(' #', array_map('trim', explode(',', $websitepage->keywords)))); + // Open Graph + $out .= ''."\n"; // TODO If blogpost, use type article + $out .= ''."\n"; + if ($websitepage->image) { + $out .= ''."\n"; + } + $out .= ''."\n"; + // Twitter $out .= ''."\n"; if (!empty($params) && !empty($params['twitter_account'])) { From 1efc2eda694479940fd143cc8a5e6207c82a60be Mon Sep 17 00:00:00 2001 From: lvessiller Date: Fri, 8 Oct 2021 11:54:38 +0200 Subject: [PATCH 0792/1460] FIX reload user lang --- scripts/cron/cron_run_jobs.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php index 80f586a6788..7e6fb991478 100755 --- a/scripts/cron/cron_run_jobs.php +++ b/scripts/cron/cron_run_jobs.php @@ -125,7 +125,7 @@ if ($userlogin == 'firstadmin') { // Check user login $user = new User($db); -$result = $user->fetch('', $userlogin); +$result = $user->fetch('', $userlogin, '', 1); if ($result < 0) { echo "User Error: ".$user->error; dol_syslog("cron_run_jobs.php:: User Error:".$user->error, LOG_ERR); @@ -137,6 +137,16 @@ if ($result < 0) { exit(-1); } } + +// Reload langs +$langcode = (empty($conf->global->MAIN_LANG_DEFAULT) ? 'auto' : $conf->global->MAIN_LANG_DEFAULT); +if (!empty($user->conf->MAIN_LANG_DEFAULT)) { + $langcode = $user->conf->MAIN_LANG_DEFAULT; +} +if ($langs->getDefaultLang() != $langcode) { + $langs->setDefaultLang($langcode); +} + $user->getrights(); if (isset($argv[3]) && $argv[3]) { @@ -195,8 +205,8 @@ if (is_array($qualifiedjobs) && (count($qualifiedjobs) > 0)) { $mysoc->setMysoc($conf); // Force recheck that user is ok for the entity to process and reload permission for entity - if ($conf->entity != $user->entity && $user->entity != 0) { - $result = $user->fetch('', $userlogin, '', 0, $conf->entity); + if ($conf->entity != $user->entity) { + $result = $user->fetch('', $userlogin, '', 1); if ($result < 0) { echo "\nUser Error: ".$user->error."\n"; dol_syslog("cron_run_jobs.php:: User Error:".$user->error, LOG_ERR); From 3c5bf190a19bac5368ac3e8a65db54dd045125c7 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Fri, 8 Oct 2021 11:56:35 +0200 Subject: [PATCH 0793/1460] FIX : langs --- htdocs/hrm/core/tpl/objectline_title.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/hrm/core/tpl/objectline_title.tpl.php b/htdocs/hrm/core/tpl/objectline_title.tpl.php index d33f0923335..3801288543a 100644 --- a/htdocs/hrm/core/tpl/objectline_title.tpl.php +++ b/htdocs/hrm/core/tpl/objectline_title.tpl.php @@ -65,7 +65,7 @@ print ''.$langs->trans('Label').''; print ''.$langs->trans('Description').''; // Note -print ''.$langs->trans('rank').''; +print ''.$langs->trans('EmployeeRank').''; //print ''; // No width to allow autodim From 806d8325497fb674f610fafe5b4194f251ca2cff Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Oct 2021 12:00:13 +0200 Subject: [PATCH 0794/1460] Fix canonical url for open graph --- htdocs/core/lib/website.lib.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index 3e7ddb019a1..6ffebce4688 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -759,7 +759,16 @@ function getSocialNetworkHeaderCards($params = null) $companyname = str_replace('__WEBSITE_KEY__', $website->ref, $companyname); $description = str_replace('__WEBSITE_KEY__', $website->ref, $description); + $shortlangcode = ''; + if ($websitepage->lang) { + $shortlangcode = substr($websitepage->lang, 0, 2); // en_US or en-US -> en + } + if (empty($shortlangcode)) { + $shortlangcode = substr($website->lang, 0, 2); // en_US or en-US -> en + } + $fullurl = $website->virtualhost.'/'.$websitepage->pageurl.'.php'; + $canonicalurl = $website->virtualhost.(($websitepage->id == $website->fk_default_home) ? '/' : (($shortlangcode != substr($website->lang, 0, 2) ? '/'.$shortlangcode : '').'/'.$websitepage->pageurl.'.php')); $hashtags = trim(join(' #', array_map('trim', explode(',', $websitepage->keywords)))); // Open Graph @@ -768,7 +777,7 @@ function getSocialNetworkHeaderCards($params = null) if ($websitepage->image) { $out .= ''."\n"; } - $out .= ''."\n"; + $out .= ''."\n"; // Twitter $out .= ''."\n"; From ccb2fa4540d04428ca64da7f324bb2d8ccf5868c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Oct 2021 12:00:14 +0200 Subject: [PATCH 0795/1460] Fix canonical url for open graph From 2f61c4e93bf94d2b55d086b8185ab10c5dce3948 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Oct 2021 12:14:42 +0200 Subject: [PATCH 0796/1460] Add onbeforecopy and onbeforecut into the WAF --- htdocs/main.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 9bcf6238b36..07ab0949a10 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -146,7 +146,7 @@ function testSqlAndScriptInject($val, $type) $inj += preg_match('/=data:/si', $val); // List of dom events is on https://www.w3schools.com/jsref/dom_obj_event.asp and https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers $inj += preg_match('/on(mouse|drag|key|load|touch|pointer|select|transition)([a-z]*)\s*=/i', $val); // onmousexxx can be set on img or any html tag like - $inj += preg_match('/on(abort|afterprint|animation|auxclick|beforeprint|beforeunload|blur|cancel|canplay|canplaythrough|change|click|close|contextmenu|cuechange|copy|cut)\s*=/i', $val); + $inj += preg_match('/on(abort|afterprint|animation|auxclick|beforecopy|beforecut|beforeprint|beforeunload|blur|cancel|canplay|canplaythrough|change|click|close|contextmenu|cuechange|copy|cut)\s*=/i', $val); $inj += preg_match('/on(dblclick|drop|durationchange|emptied|ended|error|focus|focusin|focusout|formdata|gotpointercapture|hashchange|input|invalid)\s*=/i', $val); $inj += preg_match('/on(lostpointercapture|offline|online|pagehide|pageshow)\s*=/i', $val); $inj += preg_match('/on(paste|pause|play|playing|progress|ratechange|reset|resize|scroll|search|seeked|seeking|show|stalled|start|submit|suspend)\s*=/i', $val); From 592fff1cfa5cfac2b50ae300351fe3cb206e002d Mon Sep 17 00:00:00 2001 From: Vincent Dieltiens Date: Fri, 8 Oct 2021 13:07:38 +0200 Subject: [PATCH 0797/1460] Allow exporting supplier order validation date + validation user --- htdocs/core/modules/modFournisseur.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index 6efebe9a82b..8e0fd6ea126 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -34,7 +34,6 @@ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; */ class modFournisseur extends DolibarrModules { - /** * Constructor. Define names, constants, directories, boxes, permissions * @@ -430,8 +429,8 @@ class modFournisseur extends DolibarrModules 's.rowid'=>"IdCompany", 's.nom'=>'CompanyName', 'ps.nom'=>'ParentCompany', 's.address'=>'Address', 's.zip'=>'Zip', 's.town'=>'Town', 'c.code'=>'CountryCode', 's.phone'=>'Phone', 's.siren'=>'ProfId1', 's.siret'=>'ProfId2', 's.ape'=>'ProfId3', 's.idprof4'=>'ProfId4', 's.idprof5'=>'ProfId5', 's.idprof6'=>'ProfId6', 's.tva_intra'=>'VATIntra', 'f.rowid'=>"OrderId", 'f.ref'=>"Ref", 'f.ref_supplier'=>"RefSupplier", 'f.date_creation'=>"DateCreation", 'f.date_commande'=>"OrderDate", 'f.date_livraison'=>"DateDeliveryPlanned", - 'f.total_ht'=>"TotalHT", 'f.total_ttc'=>"TotalTTC", 'f.total_tva'=>"TotalVAT", 'f.fk_statut'=>'Status', 'f.date_approve'=>'DateApprove', 'f.date_approve2'=>'DateApprove2', - 'f.note_public'=>"NotePublic", 'f.note_private'=>"NotePrivate", 'ua1.login'=>'ApprovedBy', 'ua2.login'=>'ApprovedBy2', 'fd.rowid'=>'LineId', 'fd.description'=>"LineDescription", + 'f.total_ht'=>"TotalHT", 'f.total_ttc'=>"TotalTTC", 'f.total_tva'=>"TotalVAT", 'f.fk_statut'=>'Status', 'f.date_valid'=>'DateValidation', 'f.date_approve'=>'DateApprove', 'f.date_approve2'=>'DateApprove2', + 'f.note_public'=>"NotePublic", 'f.note_private'=>"NotePrivate", 'uv.login'=>'UserValidation', 'ua1.login'=>'ApprovedBy', 'ua2.login'=>'ApprovedBy2', 'fd.rowid'=>'LineId', 'fd.description'=>"LineDescription", 'fd.tva_tx'=>"LineVATRate", 'fd.qty'=>"LineQty", 'fd.remise_percent'=>"Discount", 'fd.total_ht'=>"LineTotalHT", 'fd.total_ttc'=>"LineTotalTTC", 'fd.total_tva'=>"LineTotalVAT", 'fd.product_type'=>'TypeOfLineServiceOrProduct', 'fd.ref'=>'RefSupplier', 'fd.fk_product'=>'ProductId', 'p.ref'=>'ProductRef', 'p.label'=>'ProductLabel', 'project.rowid'=>'ProjectId', 'project.ref'=>'ProjectRef', 'project.title'=>'ProjectLabel' @@ -451,13 +450,13 @@ class modFournisseur extends DolibarrModules 's.rowid'=>"company", 's.nom'=>'Text', 'ps.nom'=>'Text', 's.address'=>'Text', 's.cp'=>'Text', 's.ville'=>'Text', 'c.code'=>'Text', 's.tel'=>'Text', 's.siren'=>'Text', 's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 's.idprof5'=>'Text', 's.idprof6'=>'Text', 's.tva_intra'=>'Text', 'f.ref'=>"Text", 'f.ref_supplier'=>"Text", 'f.date_creation'=>"Date", 'f.date_commande'=>"Date", 'f.date_livraison'=>"Date", 'f.total_ht'=>"Numeric", 'f.total_ttc'=>"Numeric", 'f.total_tva'=>"Numeric", - 'f.fk_statut'=>'Status', 'f.date_approve'=>'Date', 'f.date_approve2'=>'Date', 'f.note_public'=>"Text", 'f.note_private'=>"Text", 'fd.description'=>"Text", + 'f.fk_statut'=>'Status', 'f.date_valid'=>'Date', 'f.date_approve'=>'Date', 'f.date_approve2'=>'Date', 'f.note_public'=>"Text", 'f.note_private'=>"Text", 'fd.description'=>"Text", 'fd.tva_tx'=>"Numeric", 'fd.qty'=>"Numeric", 'fd.remise_percent'=>"Numeric", 'fd.total_ht'=>"Numeric", 'fd.total_ttc'=>"Numeric", 'fd.total_tva'=>"Numeric", 'fd.product_type'=>'Numeric', 'fd.ref'=>'Text', 'fd.fk_product'=>'List:product:label', 'p.ref'=>'Text', 'p.label'=>'Text', 'project.ref'=>'Text', 'project.title'=>'Text' ); $this->export_entities_array[$r] = array( 's.rowid'=>"company", 's.nom'=>'company', 'ps.nom'=>'company', 's.address'=>'company', 's.zip'=>'company', 's.town'=>'company', 'c.code'=>'company', 's.phone'=>'company', 's.siren'=>'company', - 's.siret'=>'company', 's.ape'=>'company', 's.idprof4'=>'company', 's.idprof5'=>'company', 's.idprof6'=>'company', 's.tva_intra'=>'company', 'ua1.login'=>'user', + 's.siret'=>'company', 's.ape'=>'company', 's.idprof4'=>'company', 's.idprof5'=>'company', 's.idprof6'=>'company', 's.tva_intra'=>'company', 'uv.login'=>'user', 'ua1.login'=>'user', 'ua2.login'=>'user', 'fd.rowid'=>'order_line', 'fd.description'=>"order_line", 'fd.tva_tx'=>"order_line", 'fd.qty'=>"order_line", 'fd.remise_percent'=>"order_line", 'fd.total_ht'=>"order_line", 'fd.total_ttc'=>"order_line", 'fd.total_tva'=>"order_line", 'fd.product_type'=>'order_line', 'fd.ref'=>'order_line', 'fd.fk_product'=>'product', 'p.ref'=>'product', 'p.label'=>'product', 'project.rowid'=>'project', 'project.ref'=>'project', 'project.title'=>'project' @@ -484,6 +483,7 @@ class modFournisseur extends DolibarrModules $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid,'; $this->export_sql_end[$r] .= ' '.MAIN_DB_PREFIX.'commande_fournisseur as f'; $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'projet as project on (f.fk_projet = project.rowid)'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as uv ON uv.rowid = f.fk_user_valid'; $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as ua1 ON ua1.rowid = f.fk_user_approve'; $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as ua2 ON ua2.rowid = f.fk_user_approve2'; $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'commande_fournisseur_extrafields as extra ON f.rowid = extra.fk_object,'; From 7ffa8a14abd87b8e56a0e661818c9ed9e91dcd8b Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 8 Oct 2021 13:10:44 +0200 Subject: [PATCH 0798/1460] fix: option COMPANY_SHOW_ADDRESS_SELECTLIST and SOCIETE_ADD_REF_IN_LIST work in ajaxcompanies --- htdocs/societe/ajax/ajaxcompanies.php | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/ajax/ajaxcompanies.php b/htdocs/societe/ajax/ajaxcompanies.php index 9295c363206..60448dbd875 100644 --- a/htdocs/societe/ajax/ajaxcompanies.php +++ b/htdocs/societe/ajax/ajaxcompanies.php @@ -88,7 +88,17 @@ if (GETPOST('newcompany') || GETPOST('socid', 'int') || GETPOST('id_fourn', 'int } $sql = "SELECT rowid, nom"; + if (!empty($conf->global->SOCIETE_ADD_REF_IN_LIST)) { + $sql .= "s.client, s.fournisseur, s.code_client, s.code_fournisseur"; + } + if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) { + $sql .= ", s.address, s.zip, s.town"; + $sql .= ", dictp.code as country_code"; + } $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; + if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) { + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as dictp ON dictp.rowid = s.fk_pays"; + } $sql .= " WHERE s.entity IN (".getEntity('societe').")"; if ($socid) { $sql .= " AND ("; @@ -114,7 +124,22 @@ if (GETPOST('newcompany') || GETPOST('socid', 'int') || GETPOST('id_fourn', 'int $resql = $db->query($sql); if ($resql) { while ($row = $db->fetch_array($resql)) { - $label = $row['nom']; + $label = ''; + if ($conf->global->SOCIETE_ADD_REF_IN_LIST) { + if (($row['client']) && (!empty($row['code_client']))) { + $label = $row['code_client'].' - '; + } + if (($row['fournisseur']) && (!empty($row['code_fournisseur']))) { + $label .= $row['code_fournisseur'].' - '; + } + $label .= ' '.$row['name']; + } + if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) { + $label .= ($row['address'] ? ' - '.$row['address'] : '').($row['zip'] ? ' - '.$row['zip'] : '').($row['town'] ? ' '.$row['town'] : ''); + if (!empty($row['country_code'])) { + $label .= ', '.$langs->trans('Country'.$row['country_code']); + } + } if ($socid) { $label = preg_replace('/('.preg_quote($socid, '/').')/i', '$1', $label, 1); } From 0d47797be7015d1254aff23df1a2d402759f5a1a Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 8 Oct 2021 13:14:08 +0200 Subject: [PATCH 0799/1460] fix sql --- htdocs/societe/ajax/ajaxcompanies.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/ajax/ajaxcompanies.php b/htdocs/societe/ajax/ajaxcompanies.php index 60448dbd875..89aa4f524b6 100644 --- a/htdocs/societe/ajax/ajaxcompanies.php +++ b/htdocs/societe/ajax/ajaxcompanies.php @@ -87,9 +87,9 @@ if (GETPOST('newcompany') || GETPOST('socid', 'int') || GETPOST('id_fourn', 'int $socid = GETPOST('id_fourn', 'int'); } - $sql = "SELECT rowid, nom"; + $sql = "SELECT s.rowid, s.nom"; if (!empty($conf->global->SOCIETE_ADD_REF_IN_LIST)) { - $sql .= "s.client, s.fournisseur, s.code_client, s.code_fournisseur"; + $sql .= ", s.client, s.fournisseur, s.code_client, s.code_fournisseur"; } if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) { $sql .= ", s.address, s.zip, s.town"; From 5d393f201c80720d0e01e58ff3439c91115d4d05 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 8 Oct 2021 13:17:09 +0200 Subject: [PATCH 0800/1460] fix sql --- htdocs/core/class/html.formcompany.class.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index d1fc8f65edb..1c188792a09 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -700,8 +700,18 @@ class FormCompany extends Form return $socid; } else { // Search to list thirdparties - $sql = "SELECT s.rowid, s.nom as name FROM"; - $sql .= " ".MAIN_DB_PREFIX."societe as s"; + $sql = "SELECT s.rowid, s.nom as name "; + if (!empty($conf->global->SOCIETE_ADD_REF_IN_LIST)) { + $sql .= ", s.code_client, s.code_fournisseur"; + } + if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) { + $sql .= ", s.address, s.zip, s.town"; + $sql .= ", dictp.code as country_code"; + } + $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; + if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) { + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as dictp ON dictp.rowid = s.fk_pays"; + } $sql .= " WHERE s.entity IN (".getEntity('societe').")"; // For ajax search we limit here. For combo list, we limit later if (is_array($limitto) && count($limitto)) { From 6553defc14898e2151395947bf67634c4ac01880 Mon Sep 17 00:00:00 2001 From: Vincent Dieltiens Date: Fri, 8 Oct 2021 13:06:24 +0200 Subject: [PATCH 0801/1460] Reload page if RELOAD_PAGE_ON_SUPPLIER_CHANGE is not empty --- htdocs/supplier_proposal/card.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index cf1ac2cfdd9..f8b5f5d64ca 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1148,6 +1148,18 @@ if ($action == 'create') { } else { print ''; print img_picto('', 'company').$form->select_company('', 'socid', 's.fournisseur=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); + // reload page to retrieve customer informations + if (!empty($conf->global->RELOAD_PAGE_ON_SUPPLIER_CHANGE)) { + print ''; + } print ' '; print ''; } From be4a00213c6765d239bac5a861ed7f0d8ed8b141 Mon Sep 17 00:00:00 2001 From: lvessiller Date: Fri, 8 Oct 2021 15:58:08 +0200 Subject: [PATCH 0802/1460] FIX optional visibility on create card --- htdocs/asset/type.php | 2 +- htdocs/categories/card.php | 2 +- htdocs/comm/action/card.php | 2 +- htdocs/comm/mailing/card.php | 2 +- htdocs/commande/card.php | 2 +- htdocs/compta/bank/card.php | 2 +- htdocs/compta/facture/card.php | 2 +- htdocs/don/card.php | 2 +- htdocs/expensereport/card.php | 2 +- htdocs/fichinter/card.php | 2 +- htdocs/fourn/commande/card.php | 2 +- htdocs/fourn/facture/card.php | 2 +- htdocs/product/card.php | 2 +- htdocs/reception/card.php | 2 +- htdocs/salaries/card.php | 2 +- htdocs/supplier_proposal/card.php | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/htdocs/asset/type.php b/htdocs/asset/type.php index 6103b963e21..b09b56ffbcf 100644 --- a/htdocs/asset/type.php +++ b/htdocs/asset/type.php @@ -389,7 +389,7 @@ if ($action == 'create') { $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit', $parameters); + print $object->showOptionals($extrafields, 'create', $parameters); } print ''; print "\n"; diff --git a/htdocs/categories/card.php b/htdocs/categories/card.php index 141e061ac20..a11d9f843a5 100644 --- a/htdocs/categories/card.php +++ b/htdocs/categories/card.php @@ -266,7 +266,7 @@ if ($user->rights->categorie->creer) { $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit', $parameters); + print $object->showOptionals($extrafields, 'create', $parameters); } print ''; diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index bc9b77cc881..53b6e329c90 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1262,7 +1262,7 @@ if ($action == 'create') { $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit', $parameters); + print $object->showOptionals($extrafields, 'create', $parameters); } print ''; diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index e03d13c29e8..b91bc866d9a 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -726,7 +726,7 @@ if ($action == 'create') { $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit'); + print $object->showOptionals($extrafields, 'create'); } print ''; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index c40a64032c0..1c0ae369be6 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1721,7 +1721,7 @@ if ($action == 'create' && $usercancreate) { } }; - print $object->showOptionals($extrafields, 'edit', $parameters); + print $object->showOptionals($extrafields, 'create', $parameters); } // Template to use by default diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index d1cc0413bfd..c6b852be444 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -444,7 +444,7 @@ if ($action == 'create') { $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit', $parameters); + print $object->showOptionals($extrafields, 'create', $parameters); } print ''; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 6ea03d8bd23..83c8ec8d718 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3636,7 +3636,7 @@ if ($action == 'create') { } }; - print $object->showOptionals($extrafields, 'edit', $parameters); + print $object->showOptionals($extrafields, 'create', $parameters); } // Template to use by default diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 1b3c72906b4..9579497411f 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -492,7 +492,7 @@ if ($action == 'create') { $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit', $parameters); + print $object->showOptionals($extrafields, 'create', $parameters); } print ''; diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 81995792dbb..eec14c85a99 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -1421,7 +1421,7 @@ if ($action == 'create') { $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit', $parameters); + print $object->showOptionals($extrafields, 'create', $parameters); } print ''; diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index e138c8ed6fe..225f9ebacb8 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -930,7 +930,7 @@ if ($action == 'create') { $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit'); + print $object->showOptionals($extrafields, 'create'); } // Show link to origin object diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index f02ffb99d77..cdeeeff9d17 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1760,7 +1760,7 @@ if ($action == 'create') { print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit'); + print $object->showOptionals($extrafields, 'create'); } // Bouton "Create Draft" diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 6241a0cee15..80f868f3484 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2270,7 +2270,7 @@ if ($action == 'create') { } if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit'); + print $object->showOptionals($extrafields, 'create'); } // Public note diff --git a/htdocs/product/card.php b/htdocs/product/card.php index b7aba2ec398..9aa2c1a1a09 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1334,7 +1334,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit', $parameters); + print $object->showOptionals($extrafields, 'create', $parameters); } // Note (private, no output on invoices, propales...) diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 40b605bbe17..111d65e8c7f 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -869,7 +869,7 @@ if ($action == 'create') { if ($objectsrc->fetch_optionals() > 0) { $recept->array_options = array_merge($recept->array_options, $objectsrc->array_options); } - print $object->showOptionals($extrafields, 'edit', $parameters); + print $object->showOptionals($extrafields, 'create', $parameters); } // Incoterms diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index b6f8dd91f14..486b4fd70ea 100755 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -576,7 +576,7 @@ if ($action == 'create') { $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit'); + print $object->showOptionals($extrafields, 'create'); } print ''; diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 6f1d0824b0b..1500f00ba91 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1233,7 +1233,7 @@ if ($action == 'create') { $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit', $parameters); + print $object->showOptionals($extrafields, 'create', $parameters); } From 90be175c500d57f60118764b7a2110e118a7c07b Mon Sep 17 00:00:00 2001 From: lvessiller Date: Fri, 8 Oct 2021 16:20:51 +0200 Subject: [PATCH 0803/1460] FIX load tranlate array after setting lang --- scripts/cron/cron_run_jobs.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php index 7e6fb991478..8aa996f9c17 100755 --- a/scripts/cron/cron_run_jobs.php +++ b/scripts/cron/cron_run_jobs.php @@ -76,9 +76,6 @@ $userlogin = $argv[2]; $version = DOL_VERSION; $error = 0; -// Language Management -$langs->loadLangs(array('main', 'admin', 'cron', 'dict')); - /* * Main @@ -145,7 +142,10 @@ if (!empty($user->conf->MAIN_LANG_DEFAULT)) { } if ($langs->getDefaultLang() != $langcode) { $langs->setDefaultLang($langcode); + $langs->tab_translate = array(); } +// Language Management +$langs->loadLangs(array('main', 'admin', 'cron', 'dict')); $user->getrights(); @@ -228,6 +228,8 @@ if (is_array($qualifiedjobs) && (count($qualifiedjobs) > 0)) { } if ($langs->getDefaultLang() != $langcode) { $langs->setDefaultLang($langcode); + $langs->tab_translate = array(); + $langs->loadLangs(array('main', 'admin', 'cron', 'dict')); } } From 2da16ade6c722e1464a6c8f571beaba150f194d9 Mon Sep 17 00:00:00 2001 From: atm-florian Date: Fri, 8 Oct 2021 17:24:52 +0200 Subject: [PATCH 0804/1460] FIX: consistent UX when calling a tab from the invoice card with empty ref / id --- htdocs/compta/facture/card.php | 11 +++++++++++ htdocs/compta/facture/contact.php | 11 +++++++++++ htdocs/compta/facture/document.php | 11 +++++++++++ htdocs/compta/facture/info.php | 11 +++++++++++ htdocs/compta/facture/note.php | 11 +++++++++++ 5 files changed, 55 insertions(+) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index e15b2722800..ab568332dd8 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2756,6 +2756,17 @@ if (empty($reshook)) * View */ +if (empty($object->id)) { + llxHeader(); + $head = facture_prepare_head($object); + $langs->load('errors'); + echo dol_get_fiche_head($head, 'compta', $langs->trans("InvoiceCustomer"), -1, 'bill'), + '
    ' . $langs->trans("ErrorRecordNotFound") . '
    '; + llxFooter(); + dol_shutdown(); + exit; +} + $form = new Form($db); $formother = new FormOther($db); $formfile = new FormFile($db); diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php index c340d68242e..c0e0a40c2c5 100644 --- a/htdocs/compta/facture/contact.php +++ b/htdocs/compta/facture/contact.php @@ -118,6 +118,17 @@ elseif ($action == 'deletecontact' && $user->rights->facture->creer) * View */ +if (empty($object->id)) { + llxHeader(); + $head = facture_prepare_head($object); + $langs->load('errors'); + echo dol_get_fiche_head($head, 'contact', $langs->trans("InvoiceCustomer"), -1, 'bill'), + '
    ' . $langs->trans("ErrorRecordNotFound") . '
    '; + llxFooter(); + dol_shutdown(); + exit; +} + $title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('ContactsAddresses'); $helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; llxHeader('', $title, $helpurl); diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index e880d77db74..64ebed251d3 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -85,6 +85,17 @@ require_once DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; * View */ +if (empty($object->id)) { + llxHeader(); + $head = facture_prepare_head($object); + $langs->load('errors'); + echo dol_get_fiche_head($head, 'documents', $langs->trans("InvoiceCustomer"), -1, 'bill'), + '
    ' . $langs->trans("ErrorRecordNotFound") . '
    '; + llxFooter(); + dol_shutdown(); + exit; +} + $title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Documents'); $helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; llxHeader('', $title, $helpurl); diff --git a/htdocs/compta/facture/info.php b/htdocs/compta/facture/info.php index bad63cf1f61..9e40fd8b5a8 100644 --- a/htdocs/compta/facture/info.php +++ b/htdocs/compta/facture/info.php @@ -43,6 +43,17 @@ $ref = GETPOST("ref", 'alpha'); * View */ +if (empty($object->id)) { + llxHeader(); + $head = facture_prepare_head($object); + $langs->load('errors'); + echo dol_get_fiche_head($head, 'info', $langs->trans("InvoiceCustomer"), -1, 'bill'), + '
    ' . $langs->trans("ErrorRecordNotFound") . '
    '; + llxFooter(); + dol_shutdown(); + exit; +} + $form = new Form($db); $title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Info'); diff --git a/htdocs/compta/facture/note.php b/htdocs/compta/facture/note.php index 07084a0cf2c..428383b4907 100644 --- a/htdocs/compta/facture/note.php +++ b/htdocs/compta/facture/note.php @@ -64,6 +64,17 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, * View */ +if (empty($object->id)) { + llxHeader(); + $head = facture_prepare_head($object); + $langs->load('errors'); + echo dol_get_fiche_head($head, 'note', $langs->trans("InvoiceCustomer"), -1, 'bill'), + '
    ' . $langs->trans("ErrorRecordNotFound") . '
    '; + llxFooter(); + dol_shutdown(); + exit; +} + $title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Notes'); $helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; llxHeader('', $title, $helpurl); From cdf1d37a1d50f57bec4a6a5140cafde5ef82a818 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Oct 2021 18:52:01 +0200 Subject: [PATCH 0805/1460] Fix changelog --- ChangeLog | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/ChangeLog b/ChangeLog index 4625e7bc077..f202acb2403 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,48 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 14.0.3 compared to 14.0.2 ***** + +FIX: #18698 Supplier invoice list - "alert" checkbox not working +FIX: #18735 +FIX: #18767 : Member delete +FIX: #18854 +FIX: #18910 : MRP List SQL query syntax error with more than one extrafileds. +FIX: Accountancy - Format Quadra export - Missing line type C to create automaticly a subledger account with label +FIX: Accountancy - Missing specific filename for export on format FEC2, Ciel & repare it +FIX: Accountancy - Option of export popup are inverted +FIX: Accountancy - Some correction on export name +FIX: Accountancy - Trunc code_journal to 2 in format XIMPORT (Ciel, Sage50) +FIX: add warehouse in projects' overview count +FIX: autocalculation of the supplier price in main currency. +FIX: avoid warning if $categories is an id +FIX: Bad use of a forced contact of another company on PDF/ODT documents +FIX: Button text on proposal card to create a invoice +FIX: calculateCosts of BOM must not be included into fetch +FIX: check if greater 0 +FIX: default language defined for IN country +FIX: fetch of product with modulebuilder load too much data +FIX: Filter on categories +FIX: indentation +FIX: init hookmanager after loading $conf values +FIX: legal issue on expense report pdf (must also show price without tax) +FIX: missing filter status=1 on rss feeds +FIX: move fetch_optionnal into $ac_static->fetch() +FIX: payment using wrong type in takepos when too many payment mode +FIX: Product accountancy affectation with product_perentity activated (PR #18620) +FIX: products/services card: hidden extrafields were overridden +FIX: Propal list - Problem of pagination on date +FIX: selected lines on supplier invoice create +FIX: Selection of type "people" for membership must hide the company +FIX: select list of orders not complete when field type of company is on +FIX: support of localtax on expense report +FIX: task time: can't filter by user with pgsql + show error message +FIX: task time: keep on using natural_search +FIX: Test when date of invoie is in future (pb with TZ and offset) +FIX: translation into email for member at membership validation. +FIX: unprivileged user can see task associated with a not allowed project +FIX: user without permission can set ticket subject + ***** ChangeLog for 14.0.2 compared to 14.0.1 ***** FIX: #18353 Invoice list translation issue From de17b367c8e873d12c86ed004f7521097f5e5927 Mon Sep 17 00:00:00 2001 From: Benjamin Chantalat <74144396+PyroShape@users.noreply.github.com> Date: Sat, 9 Oct 2021 20:14:16 +0200 Subject: [PATCH 0806/1460] FIX #18875 in v14 --- htdocs/reception/list.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index 624748ded8f..2d6600dcc45 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -612,11 +612,13 @@ if ($search_ref_supplier) { $param .= "&search_ref_supplier=".urlencode($search_ref_supplier); } // Add $param from extra fields -foreach ($search_array_options as $key => $val) { - $crit = $val; - $tmpkey = preg_replace('/search_options_/', '', $key); - if ($val != '') { - $param .= '&search_options_'.$tmpkey.'='.urlencode($val); +if ($search_array_options) { + foreach ($search_array_options as $key => $val) { + $crit = $val; + $tmpkey = preg_replace('/search_options_/', '', $key); + if ($val != '') { + $param .= '&search_options_'.$tmpkey.'='.urlencode($val); + } } } From 6e60e1f45308c4bcf5b08636ad6bda6cc601b1fe Mon Sep 17 00:00:00 2001 From: Benjamin Chantalat <74144396+PyroShape@users.noreply.github.com> Date: Sat, 9 Oct 2021 20:38:46 +0200 Subject: [PATCH 0807/1460] Fix date format into supplier order info tab --- htdocs/fourn/class/fournisseur.commande.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 3facc342f08..2e9727de83c 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2927,11 +2927,11 @@ class CommandeFournisseur extends CommonOrder $this->user_approve_id2 = $obj->fk_user_approve2; } - $this->date_creation = $this->db->idate($obj->datec); - $this->date_modification = $this->db->idate($obj->datem); - $this->date_approve = $this->db->idate($obj->datea); - $this->date_approve2 = $this->db->idate($obj->datea2); - $this->date_validation = $this->db->idate($obj->date_validation); + $this->date_creation = $obj->datec; + $this->date_modification = $obj->datem; + $this->date_approve = $obj->datea; + $this->date_approve2 = $obj->datea2; + $this->date_validation = $obj->date_validation; } $this->db->free($result); } else { From 92756e186434696ac95661106c84dbb8d85e5da9 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sat, 9 Oct 2021 23:48:35 +0200 Subject: [PATCH 0808/1460] Improve public note --- htdocs/takepos/invoice.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 8b2e5ca78b7..5093a955856 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -579,9 +579,12 @@ if ($action == "freezone") { } if ($action == "addnote") { - foreach ($invoice->lines as $line) { + $desc = GETPOST('addnote', 'alpha'); + if ($idline==0){ + $invoice->update_note_public($desc); + } + else foreach ($invoice->lines as $line) { if ($line->id == $idline) { - $desc = GETPOST('addnote', 'alpha'); $result = $invoice->updateline($line->id, $desc, $line->subprice, $line->qty, $line->remise_percent, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit); } } @@ -1061,8 +1064,7 @@ function CreditNote() { } function SetNote() { - $("#poslines").load("invoice.php?action=addnote&token=&invoiceid="+placeid+"&idline="+selectedline+"&addnote="+$("#textinput").val(), function() { - }); + $("#poslines").load("invoice.php?action=addnote&token=&invoiceid="+placeid+"&idline="+selectedline, { "addnote": $("#textinput").val() }); } From be60293554f5d01ebe07881dd2e79a2df15d86a5 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sun, 10 Oct 2021 08:58:17 +0200 Subject: [PATCH 0809/1460] Travis fix --- htdocs/takepos/invoice.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 5093a955856..d7be7d4e6eb 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -580,10 +580,9 @@ if ($action == "freezone") { if ($action == "addnote") { $desc = GETPOST('addnote', 'alpha'); - if ($idline==0){ + if ($idline==0) { $invoice->update_note_public($desc); - } - else foreach ($invoice->lines as $line) { + } else foreach ($invoice->lines as $line) { if ($line->id == $idline) { $result = $invoice->updateline($line->id, $desc, $line->subprice, $line->qty, $line->remise_percent, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit); } From ff5f3714280979bc3899ac74c760f2e09f35f448 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Oct 2021 20:46:06 +0200 Subject: [PATCH 0810/1460] Fix add protection to avoid deletion of page when deleting a file --- htdocs/website/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 6aab64736e3..f40c21778f5 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -1231,7 +1231,7 @@ if ($action == 'confirm_deletesite' && $confirm == 'yes' && $permissiontodelete) } // Delete page (from website page menu) -if (GETPOSTISSET('pageid') && $action == 'delete' && $permissiontodelete) { +if (GETPOSTISSET('pageid') && $action == 'delete' && $permissiontodelete && !GETPOST('file_manager')) { $error = 0; $db->begin(); From 874731af841f6d2c2656136a22f90c573c1df652 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Oct 2021 21:11:48 +0200 Subject: [PATCH 0811/1460] The 'action=delete&file=...' has been replaced with 'action=deletefile&file=...' to avoid confusion with deletion of object lines. --- ChangeLog | 2 +- htdocs/admin/security_file.php | 2 +- htdocs/admin/tools/dolibarr_export.php | 2 +- htdocs/comm/action/rapport/index.php | 2 +- htdocs/core/ajax/ajaxdirpreview.php | 4 ++-- htdocs/core/class/html.formfile.class.php | 12 ++++++------ .../core/tpl/document_actions_post_headers.tpl.php | 4 ++-- htdocs/ecm/ajax/ecmdatabase.php | 12 +++++++----- htdocs/ecm/dir_card.php | 8 ++++---- htdocs/ecm/file_card.php | 6 +++--- htdocs/ecm/index_auto.php | 4 ++-- htdocs/ecm/search.php | 2 +- htdocs/ecm/tpl/enablefiletreeajax.tpl.php | 9 +++++---- htdocs/website/index.php | 2 +- 14 files changed, 37 insertions(+), 34 deletions(-) diff --git a/ChangeLog b/ChangeLog index de1482ea183..ddda40a0e31 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14,7 +14,7 @@ Following changes may create regressions for some external modules, but were nec * Update hook 'printOriginObjectLine', removed check on product type and special code. Need now reshook. * Old deprecated module "SimplePOS" has been completely removed. Use module "TakePOS" is you need a Point Of Sale. * The method static ActionComm::getActions($db, ...) is no more static. Use $actioncomm->getActions(...) instead (without $db param). - +* The 'action=delete&file=...' has been replaced with 'action=deletefile&file=...' to avoid confusion with deletion of object lines. ***** ChangeLog for 14.0.2 compared to 14.0.1 ***** diff --git a/htdocs/admin/security_file.php b/htdocs/admin/security_file.php index 1368fe48488..0a0e0b5973a 100644 --- a/htdocs/admin/security_file.php +++ b/htdocs/admin/security_file.php @@ -63,7 +63,7 @@ if ($action == 'updateform') { if ($res3 && $res4 && $res5 && $res6) { setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs'); } -} elseif ($action == 'delete') { +} elseif ($action == 'deletefile') { // Delete file $langs->load("other"); $file = $conf->admin->dir_temp.'/'.GETPOST('urlfile', 'alpha'); diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index ec363ad112d..77200404a03 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -55,7 +55,7 @@ if (!$user->admin) { * Actions */ -if ($action == 'delete') { +if ($action == 'deletefile') { if (preg_match('/^backup\//', GETPOST('urlfile', 'alpha'))) { $file = $conf->admin->dir_output.'/backup/'.basename(GETPOST('urlfile', 'alpha')); $ret = dol_delete_file($file, 1); diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php index 9b6238ca0de..b75c93df799 100644 --- a/htdocs/comm/action/rapport/index.php +++ b/htdocs/comm/action/rapport/index.php @@ -163,7 +163,7 @@ if ($resql) { // Button to build doc print ''; - print 'month.'&year='.$obj->year.'">'.img_picto($langs->trans('BuildDoc'), 'filenew').''; + print ''.img_picto($langs->trans('BuildDoc'), 'filenew').''; print ''; $name = "actions-".$obj->month."-".$obj->year.".pdf"; diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index a3da2812067..2a42d4a3d00 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -396,9 +396,9 @@ if (!empty($conf->global->MAIN_ECM_DISABLE_JS)) { //$param.=($param?'?':'').(preg_replace('/^&/','',$param)); -if ($useajax || $action == 'delete') { +if ($useajax || $action == 'deletefile') { $urlfile = ''; - if ($action == 'delete') { + if ($action == 'deletefile') { $urlfile = GETPOST('urlfile', 'alpha'); } diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 03faffb941b..6e3c72dd827 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1338,11 +1338,11 @@ class FormFile print ''; // File name - print ''; + print ''; // Show file name with link to download //print "XX".$file['name']; //$file['name'] must be utf8 - print ''; - print img_mime($file['name'], $file['name'].' ('.dol_print_size($file['size'], 0, 0).')', 'inline-block valignbottom paddingright'); + print img_mime($file['name'], $file['name'].' ('.dol_print_size($file['size'], 0, 0).')', 'inline-block valignmiddle paddingright'); if ($showrelpart == 1) { print $relativepath; } @@ -1503,7 +1503,7 @@ class FormFile if (!empty($conf->global->MAIN_ECM_DISABLE_JS)) { $useajax = 0; } - print ''.img_delete().''; + print ''.img_delete().''; } print ""; @@ -1511,10 +1511,10 @@ class FormFile if ($nboffiles > 1 && $conf->browser->layout != 'phone') { print ''; if ($i > 0) { - print 'id.'">'.img_up('default', 0, 'imgupforline').''; + print 'id.'">'.img_up('default', 0, 'imgupforline').''; } if ($i < $nboffiles - 1) { - print 'id.'">'.img_down('default', 0, 'imgdownforline').''; + print 'id.'">'.img_down('default', 0, 'imgdownforline').''; } print ''; } else { diff --git a/htdocs/core/tpl/document_actions_post_headers.tpl.php b/htdocs/core/tpl/document_actions_post_headers.tpl.php index 4ec69efbac8..42276c24234 100644 --- a/htdocs/core/tpl/document_actions_post_headers.tpl.php +++ b/htdocs/core/tpl/document_actions_post_headers.tpl.php @@ -63,10 +63,10 @@ if (in_array($modulepart, array('product', 'produit', 'societe', 'user', 'ticket /* - * Confirm form to delete + * Confirm form to delete a file */ -if ($action == 'delete') { +if ($action == 'deletefile') { $langs->load("companies"); // Need for string DeleteFile+ConfirmDeleteFiles print $form->formconfirm( $_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode(GETPOST("urlfile")).'&linkid='.GETPOST('linkid', 'int').(empty($param) ? '' : $param), diff --git a/htdocs/ecm/ajax/ecmdatabase.php b/htdocs/ecm/ajax/ecmdatabase.php index 4d782a3caeb..2ce35973483 100644 --- a/htdocs/ecm/ajax/ecmdatabase.php +++ b/htdocs/ecm/ajax/ecmdatabase.php @@ -17,7 +17,7 @@ /** * \file htdocs/ecm/ajax/ecmdatabase.php - * \brief File to build ecm database + * \brief File to build/refresh the ecm database for directories */ if (!defined('NOTOKENRENEWAL')) { @@ -39,6 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $action = GETPOST('action', 'aZ09'); $element = GETPOST('element', 'alpha'); + /* * View */ @@ -86,7 +87,7 @@ if (isset($action) && !empty($action)) { } if (!$dirisindatabase) { - $txt = "Directory found on disk ".$dirdesc['fullname'].", not found into database so we add it"; + $txt = "Directory found on disk ".$dirdesc['fullname'].", not found into table ecm_directories, so we add it"; dol_syslog($txt); // We must first find the fk_parent of directory to create $dirdesc['fullname'] @@ -155,15 +156,16 @@ if (isset($action) && !empty($action)) { foreach ($sqltree as $dirdesc) { // Loop on each sqltree to check dir is on disk $dirtotest = $conf->$element->dir_output.'/'.$dirdesc['fullrelativename']; if (!dol_is_dir($dirtotest)) { - $mesg .= $dirtotest." not found onto disk. We delete from database dir with id=".$dirdesc['id']."
    \n"; + dol_syslog($dirtotest." not found onto disk. We delete from database dir with id=".$dirdesc['id']); $ecmdirtmp->id = $dirdesc['id']; $ecmdirtmp->delete($user, 'databaseonly'); //exit; } } - $sql = "UPDATE ".MAIN_DB_PREFIX."ecm_directories set cachenbofdoc = -1 WHERE cachenbofdoc < 0"; // If pb into cahce counting, we set to value -1 = "unknown" - dol_syslog("sql = ".$sql); + dol_syslog("Nb of directories added into database = ".$adirwascreated); + + $sql = "UPDATE ".MAIN_DB_PREFIX."ecm_directories set cachenbofdoc = -1 WHERE cachenbofdoc < 0"; // If pb into cache counting, we set to value -1 = "unknown" $db->query($sql); } } diff --git a/htdocs/ecm/dir_card.php b/htdocs/ecm/dir_card.php index 0b42fc17a02..793e199f180 100644 --- a/htdocs/ecm/dir_card.php +++ b/htdocs/ecm/dir_card.php @@ -450,7 +450,7 @@ print dol_get_fiche_end(); // Actions buttons -if ($action != 'edit' && $action != 'delete') { +if ($action != 'edit' && $action != 'delete' && $action != 'deletefile') { print '
    '; if ($permtoadd) { @@ -482,8 +482,8 @@ if ($action != 'edit' && $action != 'delete') { } // Confirm remove file -if ($action == 'delete') { - print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.GETPOST("section", 'alpha').'&urlfile='.urlencode($_GET["urlfile"]).($backtopage ? '&backtopage='.urlencode($backtopage) : ''), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile'); +if ($action == 'deletefile') { + print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.urlencode(GETPOST("section", 'alpha')).'&urlfile='.urlencode(GETPOST("urlfile")).($backtopage ? '&backtopage='.urlencode($backtopage) : ''), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile'); } // Confirm remove file @@ -498,7 +498,7 @@ if ($action == 'delete_dir') { ); } - print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.GETPOST('section', 'alpha').($module ? '&module='.$module : '').($backtopage ? '&backtopage='.urlencode($backtopage) : ''), $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection', $relativepathwithoutslash), 'confirm_deletedir', $formquestion, 1, 1); + print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.urlencode(GETPOST('section', 'alpha')).($module ? '&module='.$module : '').($backtopage ? '&backtopage='.urlencode($backtopage) : ''), $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection', $relativepathwithoutslash), 'confirm_deletedir', $formquestion, 1, 1); } diff --git a/htdocs/ecm/file_card.php b/htdocs/ecm/file_card.php index 44bc91e387e..e38c3caf3f3 100644 --- a/htdocs/ecm/file_card.php +++ b/htdocs/ecm/file_card.php @@ -411,8 +411,8 @@ if ($action == 'edit') { } -// Confirmation de la suppression d'une ligne categorie -if ($action == 'delete_file') { +// Confirm deletion of a file +if ($action == 'deletefile') { print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.urlencode($section), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile', $urlfile), 'confirm_deletefile', '', 1, 1); } @@ -426,7 +426,7 @@ if ($action != 'edit') { /* if ($user->rights->ecm->setup) { - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } else { diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index d54dcf14d1e..f4df5a954a8 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -376,7 +376,7 @@ print dol_get_fiche_head($head, 'index_auto', '', -1, ''); // Confirm remove file (for non javascript users) -if ($action == 'delete' && empty($conf->use_javascript_ajax)) { +if ($action == 'deletefile' && empty($conf->use_javascript_ajax)) { print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', '', 1); } @@ -413,7 +413,7 @@ if ($action == 'delete_section') { // End confirm -if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i', $action) || $action == 'delete') { +if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i', $action) || $action == 'deletefile') { print ''."\n"; print ''."\n"; diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php index aa792e0c9d7..9a6c20392a9 100644 --- a/htdocs/ecm/search.php +++ b/htdocs/ecm/search.php @@ -239,7 +239,7 @@ $upload_dir = $conf->ecm->dir_output.'/'.$relativepath; $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1); $formfile = new FormFile($db); -$param = '&section='.$section; +$param = '§ion='.urlencode($section); $textifempty = ($section ? $langs->trans("NoFileFound") : $langs->trans("ECMSelectASection")); $formfile->list_of_documents($filearray, '', 'ecm', $param, 1, $relativepath, $user->rights->ecm->upload, 1, $textifempty); diff --git a/htdocs/ecm/tpl/enablefiletreeajax.tpl.php b/htdocs/ecm/tpl/enablefiletreeajax.tpl.php index 197d995a808..6397a333fb0 100644 --- a/htdocs/ecm/tpl/enablefiletreeajax.tpl.php +++ b/htdocs/ecm/tpl/enablefiletreeajax.tpl.php @@ -78,13 +78,14 @@ $(document).ready(function() { $('#refreshbutton').click( function() { console.log("Click on refreshbutton"); $.pleaseBePatient("trans('PleaseBePatient'); ?>"); - $.get( "", { - action: "build", - element: "ecm" + $.get("", { + action: 'build', + token: '', + element: 'ecm' }, function(response) { $.unblockUI(); - location.href=""; + location.href=''; }); }); }); diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 4e21887ff04..9139141c283 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -1231,7 +1231,7 @@ if ($action == 'confirm_deletesite' && $confirm == 'yes' && $permissiontodelete) } // Delete page (from website page menu) -if (GETPOSTISSET('pageid') && $action == 'delete' && $permissiontodelete) { +if (GETPOSTISSET('pageid') && $action == 'delete' && $permissiontodelete && !GETPOST('file_manager')) { $error = 0; $db->begin(); From 7180f5eeffb5cd90ebf96d397883f6c88721634f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Oct 2021 21:25:46 +0200 Subject: [PATCH 0812/1460] css --- htdocs/core/class/html.formfile.class.php | 10 +++++----- htdocs/core/lib/company.lib.php | 2 +- htdocs/core/tpl/filemanager.tpl.php | 2 +- htdocs/ecm/index_auto.php | 2 +- htdocs/ticket/list.php | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 6e3c72dd827..1bd622d173f 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1542,11 +1542,11 @@ class FormFile if (empty($disablemove)) { $colspan++; // 6 columns or 7 } - print ''; } @@ -2096,8 +2096,8 @@ class FormFile print "\n"; } if ($nboflinks == 0) { - print ''; } print "
    '; + print '
    '; if (empty($textifempty)) { - print $langs->trans("NoFileFound"); + print ''.$langs->trans("NoFileFound").''; } else { - print $textifempty; + print ''.$textifempty.''; } print '
    '; - print $langs->trans("NoLinkFound"); + print '
    '; + print ''.$langs->trans("NoLinkFound").''; print '
    "; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index efea4c54b09..112a4ebe5fe 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -879,7 +879,7 @@ function show_projects($conf, $langs, $db, $object, $backtopage = '', $nocreatel $i++; } } else { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } $db->free($result); } else { diff --git a/htdocs/core/tpl/filemanager.tpl.php b/htdocs/core/tpl/filemanager.tpl.php index 57a95c48ece..e776388ac53 100644 --- a/htdocs/core/tpl/filemanager.tpl.php +++ b/htdocs/core/tpl/filemanager.tpl.php @@ -233,7 +233,7 @@ if ($action == 'convertimgwebp' && $permtoadd) { if (empty($action) || $action == 'editfile' || $action == 'file_manager' || preg_match('/refresh/i', $action) || $action == 'delete') { $langs->load("ecm"); - print ''."\n"; + print '
    '."\n"; print ''."\n"; print ''."\n"; diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index f4df5a954a8..e737d1b62a2 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -414,7 +414,7 @@ if ($action == 'delete_section') { if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i', $action) || $action == 'deletefile') { - print '
    '."\n"; + print '
    '."\n"; print ''."\n"; print ''."\n"; diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 118d6208237..04e411b54a6 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -1078,7 +1078,7 @@ if ($num == 0) { $colspan++; } } - print ''; + print ''; } From 92a4000e736d407980328ba957de2be825498da8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Oct 2021 21:40:01 +0200 Subject: [PATCH 0813/1460] css --- htdocs/theme/eldy/global.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 308114e89a7..a310dc19548 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -5472,7 +5472,7 @@ ul.filedirelem li { } ul.ecmjqft { - line-height: 16px; + line-height: 32px; padding: 0px; margin: 0px; font-weight: normal; @@ -5525,8 +5525,8 @@ div#ecm-layout-center { float: right; } -.ecmjqft LI.directory { font-weight:normal; background: url() left top no-repeat; } -.ecmjqft LI.expanded { font-weight:normal; background: url() left top no-repeat; } +.ecmjqft LI.directory { font-weight:normal; background: url() left top no-repeat; background-position-y: 8px; } +.ecmjqft LI.expanded { font-weight:normal; background: url() left top no-repeat; background-position-y: 8px; } .ecmjqft LI.wait { font-weight:normal; background: url() left top no-repeat; } From 7c1d955f6ccd6d6b70d54a984c8adc9f28f91b0b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Oct 2021 01:23:00 +0200 Subject: [PATCH 0814/1460] Fix: avoid to show warning in some cases --- htdocs/compta/facture/prelevement.php | 60 ++++++++++++++------------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 7e5a7047060..45664172728 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -206,6 +206,34 @@ if ($object->id > 0) { $head = facture_prepare_head($object); } + $numopen = 0; + $pending = 0; + $numclosed = 0; + + // How many Direct debit or Credit transfer open requests ? + + $sql = "SELECT pfd.rowid, pfd.traite, pfd.date_demande as date_demande"; + $sql .= " , pfd.date_traite as date_traite"; + $sql .= " , pfd.amount"; + $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; + if ($type == 'bank-transfer') { + $sql .= " WHERE fk_facture_fourn = ".((int) $object->id); + } else { + $sql .= " WHERE fk_facture = ".((int) $object->id); + } + $sql .= " AND pfd.traite = 0"; + $sql .= " AND pfd.ext_payment_id IS NULL"; + $sql .= " ORDER BY pfd.date_demande DESC"; + + $result_sql = $db->query($sql); + if ($result_sql) { + $num = $db->num_rows($result_sql); + $numopen = $num; + } else { + dol_print_error($db); + } + + print dol_get_fiche_head($head, 'standingorders', $title, -1, ($type == 'bank-transfer' ? 'supplier_invoice' : 'bill')); // Invoice content @@ -481,7 +509,9 @@ if ($object->id > 0) { print img_warning('Error on default bank number for IBAN : '.$bac->error_message); } } else { - print img_warning($langs->trans("NoDefaultIBANFound")); + if ($numopen || ($type == 'bank-transfer' && $object->mode_reglement_code == 'PRE') || ($type != 'bank-transfer' && $object->mode_reglement_code == 'VIR')) { + print img_warning($langs->trans("NoDefaultIBANFound")); + } } print ''; @@ -565,34 +595,6 @@ if ($object->id > 0) { print dol_get_fiche_end(); - $numopen = 0; - $pending = 0; - $numclosed = 0; - - - // How many Direct debit opened requests ? - - $sql = "SELECT pfd.rowid, pfd.traite, pfd.date_demande as date_demande"; - $sql .= " , pfd.date_traite as date_traite"; - $sql .= " , pfd.amount"; - $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; - if ($type == 'bank-transfer') { - $sql .= " WHERE fk_facture_fourn = ".((int) $object->id); - } else { - $sql .= " WHERE fk_facture = ".((int) $object->id); - } - $sql .= " AND pfd.traite = 0"; - $sql .= " AND pfd.ext_payment_id IS NULL"; - $sql .= " ORDER BY pfd.date_demande DESC"; - - $result_sql = $db->query($sql); - if ($result_sql) { - $num = $db->num_rows($result_sql); - $numopen = $num; - } else { - dol_print_error($db); - } - // For which amount ? $sql = "SELECT SUM(pfd.amount) as amount"; From 977a596500bec442dee9cbca2f6e168bf7a70843 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Oct 2021 01:27:21 +0200 Subject: [PATCH 0815/1460] Fix edit link --- htdocs/compta/facture/prelevement.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 45664172728..24be588386c 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -391,7 +391,7 @@ if ($object->id > 0) { print $langs->trans('DateInvoice'); print ''; if ($object->type != $object::TYPE_CREDIT_NOTE && $action != 'editinvoicedate' && !empty($object->brouillon) && $user->rights->facture->creer) { - print ''; + print ''; } print '
    '.$langs->trans("NoRecordFound").'
    '.$langs->trans("NoRecordFound").'
    id.'">'.img_edit($langs->trans('SetDate'), 1).'id.'&type='.urlencode($type).'">'.img_edit($langs->trans('SetDate'), 1).'
    '; print ''; @@ -414,7 +414,7 @@ if ($object->id > 0) { print $langs->trans('PaymentConditionsShort'); print ''; if ($object->type != $object::TYPE_CREDIT_NOTE && $action != 'editconditions' && !empty($object->brouillon) && $user->rights->facture->creer) { - print 'id.'">'.img_edit($langs->trans('SetConditions'), 1).''; + print 'id.'&type='.urlencode($type).'">'.img_edit($langs->trans('SetConditions'), 1).''; } print ''; print ''; @@ -435,7 +435,7 @@ if ($object->id > 0) { print $langs->trans('DateMaxPayment'); print ''; if ($object->type != $object::TYPE_CREDIT_NOTE && $action != 'editpaymentterm' && !empty($object->brouillon) && $user->rights->facture->creer) { - print 'id.'">'.img_edit($langs->trans('SetDate'), 1).''; + print 'id.'&type='.urlencode($type).'">'.img_edit($langs->trans('SetDate'), 1).''; } print ''; print ''; @@ -464,7 +464,7 @@ if ($object->id > 0) { print $langs->trans('PaymentMode'); print ''; if ($action != 'editmode' && !empty($object->brouillon) && $user->rights->facture->creer) { - print 'id.'">'.img_edit($langs->trans('SetMode'), 1).''; + print 'id.'&type='.urlencode($type).'">'.img_edit($langs->trans('SetMode'), 1).''; } print ''; print ''; @@ -481,7 +481,7 @@ if ($object->id > 0) { print $langs->trans('BankAccount'); print ''; if (($action != 'editbankaccount') && $user->rights->commande->creer && !empty($object->brouillon)) { - print 'id.'">'.img_edit($langs->trans('SetBankAccount'), 1).''; + print 'id.'&type='.urlencode($type).'">'.img_edit($langs->trans('SetBankAccount'), 1).''; } print ''; print ''; From a57925b0b7fd4c0c44a58d6d38356d6b1b243be7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Oct 2021 01:43:36 +0200 Subject: [PATCH 0816/1460] FIX edition of fields on credit transfer tab --- htdocs/compta/facture/prelevement.php | 12 ++++++---- htdocs/core/class/html.form.class.php | 34 ++++++++++++++++++--------- 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 24be588386c..55e4dcf61ca 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -398,7 +398,7 @@ if ($object->id > 0) { if ($object->type != $object::TYPE_CREDIT_NOTE) { if ($action == 'editinvoicedate') { - $form->form_date($_SERVER['PHP_SELF'].'?id='.$object->id, $object->date, 'invoicedate'); + print $form->form_date($_SERVER['PHP_SELF'].'?id='.$object->id, $object->date, 'invoicedate', 0, 0, 1, $type); } else { print dol_print_date($object->date, 'day'); } @@ -420,7 +420,7 @@ if ($object->id > 0) { print ''; if ($object->type != $object::TYPE_CREDIT_NOTE) { if ($action == 'editconditions') { - $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id, 'cond_reglement_id'); + $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id, 'cond_reglement_id', 0, $type); } else { $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id, 'none'); } @@ -446,7 +446,7 @@ if ($object->id > 0) { } if ($action == 'editpaymentterm') { - $form->form_date($_SERVER['PHP_SELF'].'?id='.$object->id, $duedate, 'paymentterm'); + print $form->form_date($_SERVER['PHP_SELF'].'?id='.$object->id, $duedate, 'paymentterm', 0, 0, 1, $type); } else { print dol_print_date($duedate, 'day'); if ($object->hasDelay()) { @@ -468,8 +468,12 @@ if ($object->id > 0) { } print ''; print ''; + $filtertype = 'CRDT'; + if ($type == 'bank-transfer') { + $filtertype = 'DBIT'; + } if ($action == 'editmode') { - $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'mode_reglement_id'); + $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'mode_reglement_id', $filtertype, 1, 0, $type); } else { $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'none'); } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 37155a4566e..c69b794a011 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3884,8 +3884,8 @@ class Form * @param string $htmlname Nom de la zone select * @param int $filtertype Not used * @param int $addempty Add an empty entry - * @param int $noinfoadmin 0=Add admin info, 1=Disable admin info - * @param string $morecss Add more CSS on select tag + * @param int $noinfoadmin 0=Add admin info, 1=Disable admin info + * @param string $morecss Add more CSS on select tag * @return void */ public function select_conditions_paiements($selected = 0, $htmlname = 'condid', $filtertype = -1, $addempty = 0, $noinfoadmin = 0, $morecss = '') @@ -5108,17 +5108,21 @@ class Form * @param string $selected Id condition pre-selectionne * @param string $htmlname Name of select html field * @param int $addempty Add empty entry + * @param string $type Type ('direct-debit' or 'bank-transfer') * @return void */ - public function form_conditions_reglement($page, $selected = '', $htmlname = 'cond_reglement_id', $addempty = 0) + public function form_conditions_reglement($page, $selected = '', $htmlname = 'cond_reglement_id', $addempty = 0, $type = '') { // phpcs:enable global $langs; if ($htmlname != "none") { - print '
    '; + print ''; print ''; print ''; - $this->select_conditions_paiements($selected, $htmlname, -1, $addempty); + if ($type) { + print ''; + } + $this->select_conditions_paiements($selected, $htmlname, -1, $addempty, 0, ''); print ''; print '
    '; } else { @@ -5212,10 +5216,11 @@ class Form * @param int $displayhour Display hour selector * @param int $displaymin Display minutes selector * @param int $nooutput 1=No print output, return string + * @param string $type 'direct-debit' or 'bank-transfer' * @return string * @see selectDate() */ - public function form_date($page, $selected, $htmlname, $displayhour = 0, $displaymin = 0, $nooutput = 0) + public function form_date($page, $selected, $htmlname, $displayhour = 0, $displaymin = 0, $nooutput = 0, $type = '') { // phpcs:enable global $langs; @@ -5223,9 +5228,12 @@ class Form $ret = ''; if ($htmlname != "none") { - $ret .= '
    '; + $ret .= ''; $ret .= ''; $ret .= ''; + if ($type) { + $ret .= ''; + } $ret .= ''; $ret .= ''; // Line id - print ''; + print ''; // Ref Invoice print ''; @@ -654,23 +622,23 @@ if ($result) { print ''; */ - print ''; + print ''; // Ref Product print ''; // Description print ''; print ''; // Vat rate - if ($objp->vat_tx_l != $objp->vat_tx_p) { + if ($product_static->vat_tx_l != $product_static->vat_tx_p) { $code_vat_differ = 'font-weight:bold; text-decoration:blink; color:red'; } print ''; // Thirdparty @@ -699,26 +667,26 @@ if ($result) { // Found accounts print ''; // Suggested accounting account print ''; // Column with checkbox print ''; print ''; From af8e8077b163eda70c4d0ca72a14d782a6590040 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 11 Oct 2021 12:50:16 +0200 Subject: [PATCH 0824/1460] Uniformize --- htdocs/accountancy/customer/index.php | 19 +++++++++++++++---- htdocs/accountancy/customer/list.php | 9 ++++----- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index 7c3cc2cf0e2..795da583486 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -73,12 +73,23 @@ $action = GETPOST('action', 'aZ09'); $chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version'); +// Security check +if (empty($conf->accounting->enabled)) { + accessforbidden(); +} +if ($user->socid > 0) { + accessforbidden(); +} +if (empty($user->rights->accounting->mouvements->lire)) { + accessforbidden(); +} + /* * Actions */ -if ($action == 'clean' || $action == 'validatehistory') { +if (($action == 'clean' || $action == 'validatehistory') && $user->rights->accounting->bind->write) { // Clean database $db->begin(); $sql1 = "UPDATE ".MAIN_DB_PREFIX."facturedet as fd"; @@ -165,6 +176,7 @@ if ($action == 'validatehistory') { } dol_syslog('htdocs/accountancy/customer/index.php'); + $result = $db->query($sql); if (!$result) { $error++; @@ -209,7 +221,6 @@ if ($action == 'validatehistory') { $product_static->accountancy_code_buy_intra = $objp->code_buy_intra; $product_static->accountancy_code_buy_export = $objp->code_buy_export; $product_static->tva_tx = $objp->tva_tx_prod; - $product_static->tva_tx = $objp->tva_tx_prod; $facture_static->ref = $objp->ref; $facture_static->id = $objp->facid; @@ -223,7 +234,7 @@ if ($action == 'validatehistory') { $facture_static_det->product_type = $objp->type_l; $facture_static_det->desc = $objp->description; - $accoutinAccountArray = array( + $accoutingAccountArray = array( 'dom'=>$objp->aarowid, 'intra'=>$objp->aarowid_intra, 'export'=>$objp->aarowid_export, @@ -232,7 +243,7 @@ if ($action == 'validatehistory') { $code_sell_p_notset = ''; $code_sell_t_notset = ''; - $return=$accountingAccount->getAccountingCodeToBind($thirdpartystatic, $mysoc, $product_static, $facture_static, $facture_static_det, $accoutinAccountArray); + $return=$accountingAccount->getAccountingCodeToBind($thirdpartystatic, $mysoc, $product_static, $facture_static, $facture_static_det, $accoutingAccountArray); if (!is_array($return) && $return<0) { setEventMessage($accountingAccount->error, 'errors'); } else { diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index a730a8a9af6..88e6c52be3d 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -2,7 +2,7 @@ /* Copyright (C) 2013-2014 Olivier Geffroy * Copyright (C) 2013-2021 Alexandre Spangaro * Copyright (C) 2014-2015 Ari Elbaz (elarifr) - * Copyright (C) 2013-2014 Florian Henry + * Copyright (C) 2013-2021 Florian Henry * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2016 Laurent Destailleur * @@ -192,10 +192,10 @@ if ($massaction == 'ventil' && $user->rights->accounting->bind->write) { dol_syslog("accountancy/customer/list.php", LOG_DEBUG); if ($db->query($sql)) { - $msg .= '
    '.$langs->trans("Lineofinvoice", $monId).' - '.$langs->trans("VentilatedinAccount").' : '.length_accountg($accountventilated->account_number).'
    '; + $msg .= '
    '.$langs->trans("Lineofinvoice").' '.$monId.' - '.$langs->trans("VentilatedinAccount").' : '.length_accountg($accountventilated->account_number).'
    '; $ok++; } else { - $msg .= '
    '.$langs->trans("ErrorDB").' : '.$langs->trans("Lineofinvoice", $monId).' - '.$langs->trans("NotVentilatedinAccount").' : '.length_accountg($accountventilated->account_number).'
    '.$sql.'
    '; + $msg .= '
    '.$langs->trans("ErrorDB").' : '.$langs->trans("Lineofinvoice").' '.$monId.' - '.$langs->trans("NotVentilatedinAccount").' : '.length_accountg($accountventilated->account_number).'
    '.$sql.'
    '; $ko++; } } @@ -550,7 +550,6 @@ if ($result) { $product_static->accountancy_code_buy_intra = $objp->code_buy_intra; $product_static->accountancy_code_buy_export = $objp->code_buy_export; $product_static->tva_tx = $objp->tva_tx_prod; - $product_static->tva_tx = $objp->tva_tx_prod; $facture_static->ref = $objp->ref; $facture_static->id = $objp->facid; @@ -564,7 +563,7 @@ if ($result) { $facture_static_det->product_type = $objp->type_l; $facture_static_det->desc = $objp->description; - $accoutinAccountArray = array( + $accoutingAccountArray = array( 'dom'=>$objp->aarowid, 'intra'=>$objp->aarowid_intra, 'export'=>$objp->aarowid_export, From 94875cdc77fa541ffe4cabc9a497b7ec95249887 Mon Sep 17 00:00:00 2001 From: Indelog Date: Mon, 11 Oct 2021 13:37:37 +0200 Subject: [PATCH 0825/1460] Fix : Re-add bloc to set `$withtargettype` and `$withsourcetype` --- htdocs/core/class/commonobject.class.php | 25 +++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 1de8d8cd752..864e2cdf337 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3712,19 +3712,34 @@ abstract class CommonObject $withtargettype = false; $withsourcetype = false; - $sourceid = (!empty($sourceid) ? $sourceid : $this->id); - $targetid = (!empty($targetid) ? $targetid : $this->id); - $sourcetype = (!empty($sourcetype) ? $sourcetype : $this->element); - $targettype = (!empty($targettype) ? $targettype : $this->element); - $parameters = array('sourcetype'=>$sourcetype, 'sourceid'=>$sourceid, 'targettype'=>$targettype, 'targetid'=>$targetid); // Hook for explicitly set the targettype if it must be differtent than $this->element $reshook = $hookmanager->executeHooks('setLinkedObjectSourceTargetType', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { if (!empty($hookmanager->resArray['sourcetype'])) $sourcetype = $hookmanager->resArray['sourcetype']; + if (!empty($hookmanager->resArray['sourceid'])) $sourceid = $hookmanager->resArray['sourceid']; if (!empty($hookmanager->resArray['targettype'])) $targettype = $hookmanager->resArray['targettype']; + if (!empty($hookmanager->resArray['targetid'])) $targetid = $hookmanager->resArray['targetid']; } + if (!empty($sourceid) && !empty($sourcetype) && empty($targetid)) { + $justsource = true; // the source (id and type) is a search criteria + if (!empty($targettype)) { + $withtargettype = true; + } + } + if (!empty($targetid) && !empty($targettype) && empty($sourceid)) { + $justtarget = true; // the target (id and type) is a search criteria + if (!empty($sourcetype)) { + $withsourcetype = true; + } + } + + $sourceid = (!empty($sourceid) ? $sourceid : $this->id); + $targetid = (!empty($targetid) ? $targetid : $this->id); + $sourcetype = (!empty($sourcetype) ? $sourcetype : $this->element); + $targettype = (!empty($targettype) ? $targettype : $this->element); + /*if (empty($sourceid) && empty($targetid)) { dol_syslog('Bad usage of function. No source nor target id defined (nor as parameter nor as object id)', LOG_ERR); From bbf5cb5db1cd591e8f7587cf44ed87d82619961d Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller Date: Mon, 11 Oct 2021 15:02:53 +0200 Subject: [PATCH 0826/1460] FIX: creation of project backtopage --- htdocs/projet/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 078082961a5..8aab287bbb6 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -224,7 +224,7 @@ if (empty($reshook)) { $db->commit(); if (!empty($backtopage)) { - $backtopage = preg_replace('/--IDFORBACKTOPAGE--/', $object->id, $backtopage); // New method to autoselect project after a New on another form object creation + $backtopage = preg_replace('/--IDFORBACKTOPAGE--|__ID__/', $object->id, $backtopage); // New method to autoselect project after a New on another form object creation $backtopage = $backtopage.'&projectid='.$object->id; // Old method header("Location: ".$backtopage); exit; From 91164951deb1f246e50183cb72ecc96bf6afe84d Mon Sep 17 00:00:00 2001 From: Benjamin Chantalat <74144396+PyroShape@users.noreply.github.com> Date: Mon, 11 Oct 2021 15:24:56 +0200 Subject: [PATCH 0827/1460] Remove not complete order from virtual stock --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index d746bf4a812..acb66eb1ebb 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5271,7 +5271,7 @@ class Product extends CommonObject $stock_sending_client = $this->stats_expedition['qty']; } if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) { - $filterStatus = empty($conf->global->SUPPLIER_ORDER_STATUS_FOR_VIRTUAL_STOCK) ? '2,3,4' : $conf->global->SUPPLIER_ORDER_STATUS_FOR_VIRTUAL_STOCK; + $filterStatus = empty($conf->global->SUPPLIER_ORDER_STATUS_FOR_VIRTUAL_STOCK) ? '3,4' : $conf->global->SUPPLIER_ORDER_STATUS_FOR_VIRTUAL_STOCK; if (isset($includedraftpoforvirtual)) { $filterStatus = '0,1,2,'.$filterStatus; // 1,2 may have already been inside $filterStatus but it is better to have twice than missing $filterStatus does not include them } From b29bd325fe3563537ace041e1f82b4921aa8e22c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Oct 2021 15:25:25 +0200 Subject: [PATCH 0828/1460] Update card.php --- htdocs/compta/facture/card.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 0eb2a503e42..5b68f9f4a29 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3730,8 +3730,7 @@ if ($action == 'create') { print ''."\n"; print ''."\n"; print ''."\n"; - // The lines below override the parameters set by GET or POST for origin value and also be present in $origin and $originid variables (it make creation of invoice originating from an external module object impossible because for get an external module class we also need to know the name of the module in addition of the name of the element). - // This input fields already printed above at the
    begin. + // The commented lines below are fields already added as hidden parameters before //print ''; //print ''; From 7c8bde885bf85abf454d57444a27a80bd9da2be9 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Mon, 11 Oct 2021 16:03:56 +0200 Subject: [PATCH 0829/1460] hook createDictioaryFieldList : tr html tag to right place --- htdocs/admin/dict.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 897fcdf7555..ab7eaf73653 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1238,6 +1238,10 @@ if ($id) print $tdsoffields; + // Line to enter new values + print ''; + print '
    '; + $obj = new stdClass(); // If data was already input, we define them in obj to populate input fields. if (GETPOST('actionadd')) @@ -1256,9 +1260,6 @@ if ($id) if ($id == 3) unset($fieldlist[2]); // Remove field ??? if dictionary Regions - // Line to enter new values - print ''; - print ''; if (empty($reshook)) { From 5fc0802eb1a6462d923c04f0e3e503254012cda7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Oct 2021 16:13:55 +0200 Subject: [PATCH 0830/1460] Fix for backward compatibility --- htdocs/core/lib/functions.lib.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 54ef73f19d6..ac019f33bc2 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -41,6 +41,30 @@ include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php'; +/** + * Return dolibarr global constant string value + * @param string $key key to return value, return '' if not set + * @return string + */ +function getDolGlobalString($key) +{ + global $conf; + // return $conf->global->$key ?? ''; + return (string) (empty($conf->global->$key) ? '' : $conf->global->$key); +} + +/** + * Return dolibarr global constant int value + * @param string $key key to return value, return 0 if not set + * @return int + */ +function getDolGlobalInt($key) +{ + global $conf; + // return $conf->global->$key ?? 0; + return (int) (empty($conf->global->$key) ? 0 : $conf->global->$key); +} + /** * Return a DoliDB instance (database handler). * From 3a32787f150d7071210a00a6ead2aeae752a2c25 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Oct 2021 16:14:34 +0200 Subject: [PATCH 0831/1460] Fix for backward compatibility --- htdocs/core/lib/functions.lib.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 51b7442defe..01e8acf4896 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -40,6 +40,30 @@ include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php'; +/** + * Return dolibarr global constant string value + * @param string $key key to return value, return '' if not set + * @return string + */ +function getDolGlobalString($key) +{ + global $conf; + // return $conf->global->$key ?? ''; + return (string) (empty($conf->global->$key) ? '' : $conf->global->$key); +} + +/** + * Return dolibarr global constant int value + * @param string $key key to return value, return 0 if not set + * @return int + */ +function getDolGlobalInt($key) +{ + global $conf; + // return $conf->global->$key ?? 0; + return (int) (empty($conf->global->$key) ? 0 : $conf->global->$key); +} + /** * Return a DoliDB instance (database handler). * From 96bdd6168480bb0e1a71ca98c4953ea5905fd721 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Mon, 11 Oct 2021 17:36:31 +0200 Subject: [PATCH 0832/1460] NEW : add constant TICKETS_MESSAGE_FORCE_MAIL --- htdocs/core/class/html.formticket.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index a4b18470be4..5ce2dd0fca7 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -1232,7 +1232,7 @@ class FormTicket // External users can't send message email if ($user->rights->ticket->write && !$user->socid) { print ''; From 4e9c7c9efb4166f79cc159615e6a19f4a661ca2c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Oct 2021 20:04:45 +0200 Subject: [PATCH 0833/1460] FIX Attachment of pdf into shipment when sending email --- htdocs/core/class/html.formmail.class.php | 2 ++ htdocs/core/lib/files.lib.php | 5 +++-- htdocs/core/tpl/massactions_pre.tpl.php | 5 +---- htdocs/expedition/card.php | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 3dc2743adf1..40496ee7fa9 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -792,6 +792,7 @@ class FormMail extends Form if (count($listofpaths)) { foreach ($listofpaths as $key => $val) { $relativepathtofile = substr($val, (strlen(DOL_DATA_ROOT) - strlen($val))); + if ($conf->entity > 1) { $relativepathtofile = str_replace($conf->entity.'/', '', $relativepathtofile); } @@ -802,6 +803,7 @@ class FormMail extends Form $out .= '
    '; // Preview of attachment $out .= img_mime($listofnames[$key]).' '.$listofnames[$key]; + $out .= $formfile->showPreview(array(), $formfile_params[2], $formfile_params[4]); if (!$this->withfilereadonly) { $out .= ' '; diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 43ad95157dc..613f7f2d8a8 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2707,13 +2707,14 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, if ($fuser->rights->expedition->{$lire} || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } - $original_file = $conf->expedition->dir_output."/sending/".$original_file; + $original_file = $conf->expedition->dir_output."/".(strpos('sending/', $original_file) == 0 ? '' : 'sending/').$original_file; + //$original_file = $conf->expedition->dir_output."/".$original_file; } elseif (($modulepart == 'livraison' || $modulepart == 'delivery') && !empty($conf->expedition->dir_output)) { // Delivery Note Wrapping if ($fuser->rights->expedition->delivery->{$lire} || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } - $original_file = $conf->expedition->dir_output."/receipt/".$original_file; + $original_file = $conf->expedition->dir_output."/".(strpos('receipt/', $original_file) == 0 ? '' : 'receipt/').$original_file; } elseif ($modulepart == 'actions' && !empty($conf->agenda->dir_output)) { // Wrapping pour les actions if ($fuser->rights->agenda->myactions->{$read} || preg_match('/^specimen/i', $original_file)) { diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index f9c74dd7085..91fc11ac217 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -99,12 +99,9 @@ if ($massaction == 'presend') { print ''; - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; - $formmail = new FormMail($db); - print dol_get_fiche_head(null, '', ''); - // Cree l'objet formulaire mail + // Create mail form include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; $formmail = new FormMail($db); $formmail->withform = -1; diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 902914c4327..3d2b995233a 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -2552,8 +2552,8 @@ if ($action == 'create') { // Presend form $modelmail = 'shipping_send'; - $defaulttopic = 'SendShippingRef'; - $diroutput = $conf->expedition->dir_output; + $defaulttopic = $langs->trans('SendShippingRef'); + $diroutput = $conf->expedition->dir_output.'/sending'; $trackid = 'shi'.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; From 2e32254574c03e712024f5a4c6ddb92e747598da Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Oct 2021 20:36:10 +0200 Subject: [PATCH 0834/1460] Fix rul to shipment files --- htdocs/core/lib/files.lib.php | 4 ++-- htdocs/core/lib/functions.lib.php | 24 ------------------------ 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 613f7f2d8a8..36feaf79a6e 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2707,14 +2707,14 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, if ($fuser->rights->expedition->{$lire} || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } - $original_file = $conf->expedition->dir_output."/".(strpos('sending/', $original_file) == 0 ? '' : 'sending/').$original_file; + $original_file = $conf->expedition->dir_output."/".(strpos('sending/', $original_file) === 0 ? '' : 'sending/').$original_file; //$original_file = $conf->expedition->dir_output."/".$original_file; } elseif (($modulepart == 'livraison' || $modulepart == 'delivery') && !empty($conf->expedition->dir_output)) { // Delivery Note Wrapping if ($fuser->rights->expedition->delivery->{$lire} || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } - $original_file = $conf->expedition->dir_output."/".(strpos('receipt/', $original_file) == 0 ? '' : 'receipt/').$original_file; + $original_file = $conf->expedition->dir_output."/".(strpos('receipt/', $original_file) === 0 ? '' : 'receipt/').$original_file; } elseif ($modulepart == 'actions' && !empty($conf->agenda->dir_output)) { // Wrapping pour les actions if ($fuser->rights->agenda->myactions->{$read} || preg_match('/^specimen/i', $original_file)) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 443a757b512..e0dcc51917b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -65,30 +65,6 @@ function getDolGlobalInt($key) return (int) (empty($conf->global->$key) ? 0 : $conf->global->$key); } -/** - * Return dolibarr global constant string value - * @param string $key key to return value, return '' if not set - * @return string - */ -function getDolGlobalString($key) -{ - global $conf; - // return $conf->global->$key ?? ''; - return (string) (empty($conf->global->$key) ? '' : $conf->global->$key); -} - -/** - * Return dolibarr global constant int value - * @param string $key key to return value, return 0 if not set - * @return int - */ -function getDolGlobalInt($key) -{ - global $conf; - // return $conf->global->$key ?? 0; - return (int) (empty($conf->global->$key) ? 0 : $conf->global->$key); -} - /** * Return a DoliDB instance (database handler). * From de98900cb79e7ed50618b9dcad8671edb64e2178 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 11 Oct 2021 22:00:59 +0200 Subject: [PATCH 0835/1460] NEW Accountancy - Format FEC/FEC2 - Add column NumFacture --- .../class/accountancyexport.class.php | 45 ++++++++++++++++++- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 81060f0e413..2c4dbfd51cd 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -914,7 +914,8 @@ class AccountancyExport print "ValidDate".$separator; print "Montantdevise".$separator; print "Idevise".$separator; - print "DateLimitReglmt"; + print "DateLimitReglmt".$separator; + print "NumFacture".$separator; print $end_line; foreach ($objectLines as $line) { @@ -927,6 +928,22 @@ class AccountancyExport $date_validation = dol_print_date($line->date_validation, '%Y%m%d'); $date_limit_payment = dol_print_date($line->date_lim_reglement, '%Y%m%d'); + if ($line->doc_type == 'customer_invoice') { + // Customer invoice + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; + $invoice = new Facture($db); + $invoice->fetch($line->fk_doc); + + $refInvoice = $invoice->ref; + } elseif ($line->doc_type == 'supplier_invoice') { + // Supplier invoice + require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; + $invoice = new FactureFournisseur($db); + $invoice->fetch($line->fk_doc); + + $refInvoice = $invoice->ref_supplier; + } + // FEC:JournalCode print $line->code_journal . $separator; @@ -984,6 +1001,9 @@ class AccountancyExport // FEC_suppl:DateLimitReglmt print $date_limit_payment; + // FEC_suppl:NumFacture + print dol_trunc(self::toAnsi($refInvoice), 17, 'right', 'UTF-8', 1) . $separator; + print $end_line; } } @@ -1020,7 +1040,8 @@ class AccountancyExport print "ValidDate".$separator; print "Montantdevise".$separator; print "Idevise".$separator; - print "DateLimitReglmt"; + print "DateLimitReglmt".$separator; + print "NumFacture".$separator; print $end_line; foreach ($objectLines as $line) { @@ -1033,6 +1054,22 @@ class AccountancyExport $date_validation = dol_print_date($line->date_validation, '%Y%m%d'); $date_limit_payment = dol_print_date($line->date_lim_reglement, '%Y%m%d'); + if ($line->doc_type == 'customer_invoice') { + // Customer invoice + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; + $invoice = new Facture($db); + $invoice->fetch($line->fk_doc); + + $refInvoice = $invoice->ref; + } elseif ($line->doc_type == 'supplier_invoice') { + // Supplier invoice + require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; + $invoice = new FactureFournisseur($db); + $invoice->fetch($line->fk_doc); + + $refInvoice = $invoice->ref_supplier; + } + // FEC:JournalCode print $line->code_journal . $separator; @@ -1090,6 +1127,10 @@ class AccountancyExport // FEC_suppl:DateLimitReglmt print $date_limit_payment; + // FEC_suppl:NumFacture + print dol_trunc(self::toAnsi($refInvoice), 17, 'right', 'UTF-8', 1) . $separator; + + print $end_line; } } From ed3b267d8fd91e9d4e1c45197fab9ef78628e200 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Oct 2021 01:40:30 +0200 Subject: [PATCH 0836/1460] Fix css --- htdocs/accountancy/customer/list.php | 2 +- htdocs/accountancy/supplier/list.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index a730a8a9af6..c258ed81352 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -635,7 +635,7 @@ if ($result) { // Vat rate $code_vat_differ=''; - if ($product_static->tva_tx !== $facture_static_det->tva_tx) { + if ($product_static->tva_tx !== $facture_static_det->tva_tx && ! empty($facture_static_det->tva_tx)) { // Note: having a vat rate of 0 is often the normal case when sells is intra b2b or to export $code_vat_differ = 'font-weight:bold; text-decoration:blink; color:red'; } print '
    '; // Vat rate - if ($objp->vat_tx_l != $objp->vat_tx_p) { + if ($objp->vat_tx_l != $objp->vat_tx_p && ! empty($objp->vat_tx_l)) { // Note: having a vat rate of 0 is often the normal case when sells is intra b2b or to export $code_vat_differ = 'font-weight:bold; text-decoration:blink; color:red'; } print '\n"; print "\n"; +// Option +print ''; +print ''; +print ''; +print ''; +print ''; + print '
    '; $ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form'.$htmlname, 1, 0); @@ -5290,12 +5298,13 @@ class Form * @param string $page Page * @param int $selected Id mode pre-selectionne * @param string $htmlname Name of select html field - * @param string $filtertype To filter on field type in llx_c_paiement (array('code'=>xx,'label'=>zz)) + * @param string $filtertype To filter on field type in llx_c_paiement ('CRDT' or 'DBIT' or array('code'=>xx,'label'=>zz)) * @param int $active Active or not, -1 = all - * @param int $addempty 1=Add empty entry + * @param int $addempty 1=Add empty entry + * @param string $type Type ('direct-debit' or 'bank-transfer') * @return void */ - public function form_modes_reglement($page, $selected = '', $htmlname = 'mode_reglement_id', $filtertype = '', $active = 1, $addempty = 0) + public function form_modes_reglement($page, $selected = '', $htmlname = 'mode_reglement_id', $filtertype = '', $active = 1, $addempty = 0, $type = '') { // phpcs:enable global $langs; @@ -5303,7 +5312,10 @@ class Form print ''; print ''; print ''; - $this->select_types_paiements($selected, $htmlname, $filtertype, 0, $addempty, 0, 0, $active); + if ($type) { + print ''; + } + print $this->select_types_paiements($selected, $htmlname, $filtertype, 0, $addempty, 0, 0, $active, '', 1); print ''; print ''; } else { From dbf2c0be7e17ca45ec34d4aca61aa8c61d07d90c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Oct 2021 01:49:50 +0200 Subject: [PATCH 0817/1460] Fix warning --- htdocs/compta/facture/prelevement.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 55e4dcf61ca..229b7679548 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -513,7 +513,7 @@ if ($object->id > 0) { print img_warning('Error on default bank number for IBAN : '.$bac->error_message); } } else { - if ($numopen || ($type == 'bank-transfer' && $object->mode_reglement_code == 'PRE') || ($type != 'bank-transfer' && $object->mode_reglement_code == 'VIR')) { + if ($numopen || ($type != 'bank-transfer' && $object->mode_reglement_code == 'PRE') || ($type == 'bank-transfer' && $object->mode_reglement_code == 'VIR')) { print img_warning($langs->trans("NoDefaultIBANFound")); } } From da815476fd9b27ec34f3e3f316ff6f83df483fab Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Oct 2021 02:00:12 +0200 Subject: [PATCH 0818/1460] Fix edit field from tab bank transfer of invoice --- htdocs/compta/facture/prelevement.php | 87 ++++++++++++++++++++++++++- 1 file changed, 85 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 229b7679548..084d24ebfdb 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -81,6 +81,12 @@ if ($type == 'bank-transfer') { } } +if ($type == 'bank-transfer') { + $usercancreate = ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer); +} else { + $usercancreate = $user->rights->facture->creer; +} + /* * Actions @@ -93,7 +99,7 @@ if ($reshook < 0) { } if (empty($reshook)) { - if ($action == "new") { + if ($action == "new" && $usercancreate) { if ($object->id > 0) { $db->begin(); @@ -117,7 +123,7 @@ if (empty($reshook)) { $action = ''; } - if ($action == "delete") { + if ($action == "delete" && $usercancreate) { if ($object->id > 0) { $result = $object->demande_prelevement_delete($user, GETPOST('did', 'int')); if ($result == 0) { @@ -126,6 +132,83 @@ if (empty($reshook)) { } } } + + // payments conditions + if ($action == 'setconditions' && $usercancreate) { + $object->fetch($id); + $object->cond_reglement_code = 0; // To clean property + $object->cond_reglement_id = 0; // To clean property + + $error = 0; + + $db->begin(); + + if (!$error) { + $result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int')); + if ($result < 0) { + $error++; + setEventMessages($object->error, $object->errors, 'errors'); + } + } + + if (!$error) { + $old_date_echeance = $object->date_echeance; + $new_date_echeance = $object->calculate_date_lim_reglement(); + if ($new_date_echeance > $old_date_echeance) { + $object->date_echeance = $new_date_echeance; + } + if ($object->date_echeance < $object->date) { + $object->date_echeance = $object->date; + } + $result = $object->update($user); + if ($result < 0) { + $error++; + setEventMessages($object->error, $object->errors, 'errors'); + } + } + + if ($error) { + $db->rollback(); + } else { + $db->commit(); + } + } elseif ($action == 'setmode' && $usercancreate) { + // payment mode + $result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int')); + } elseif ($action == 'setdatef' && $usercancreate) { + $newdate = dol_mktime(0, 0, 0, GETPOST('datefmonth', 'int'), GETPOST('datefday', 'int'), GETPOST('datefyear', 'int'), 'tzserver'); + if ($newdate > (dol_now('tzuserrel') + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { + if (empty($conf->global->INVOICE_MAX_FUTURE_DELAY)) { + setEventMessages($langs->trans("WarningInvoiceDateInFuture"), null, 'warnings'); + } else { + setEventMessages($langs->trans("WarningInvoiceDateTooFarInFuture"), null, 'warnings'); + } + } + + $object->date = $newdate; + $date_echence_calc = $object->calculate_date_lim_reglement(); + if (!empty($object->date_echeance) && $object->date_echeance < $date_echence_calc) { + $object->date_echeance = $date_echence_calc; + } + if ($object->date_echeance && $object->date_echeance < $object->date) { + $object->date_echeance = $object->date; + } + + $result = $object->update($user); + if ($result < 0) { + dol_print_error($db, $object->error); + } + } elseif ($action == 'setdate_lim_reglement' && $usercancreate) { + $object->date_echeance = dol_mktime(12, 0, 0, GETPOST('date_lim_reglementmonth', 'int'), GETPOST('date_lim_reglementday', 'int'), GETPOST('date_lim_reglementyear', 'int')); + if (!empty($object->date_echeance) && $object->date_echeance < $object->date) { + $object->date_echeance = $object->date; + setEventMessages($langs->trans("DatePaymentTermCantBeLowerThanObjectDate"), null, 'warnings'); + } + $result = $object->update($user); + if ($result < 0) { + dol_print_error($db, $object->error); + } + } } From 754b13a83fbada80e28ff7be2146740ea299b87b Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 11 Oct 2021 08:58:00 +0200 Subject: [PATCH 0819/1460] NEW Add sortorder on units list --- htdocs/admin/dict.php | 12 ++++++------ htdocs/core/class/cunits.class.php | 8 +++++++- htdocs/core/class/html.form.class.php | 1 + htdocs/install/mysql/migration/14.0.0-15.0.0.sql | 2 ++ htdocs/install/mysql/tables/llx_c_units.sql | 15 ++++++++------- 5 files changed, 24 insertions(+), 14 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index d0a699ef979..ea7f0c92b37 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -8,7 +8,7 @@ * Copyright (C) 2011 Remy Younes * Copyright (C) 2012-2015 Marcos García * Copyright (C) 2012 Christophe Battarel - * Copyright (C) 2011-2020 Alexandre Spangaro + * Copyright (C) 2011-2021 Alexandre Spangaro * Copyright (C) 2015 Ferran Marcet * Copyright (C) 2016 Raphaël Doursenaud * Copyright (C) 2019-2020 Frédéric France @@ -232,7 +232,7 @@ $tabsql[33] = "SELECT rowid, pos, code, label, active FROM ".MAIN_DB_PREFIX."c_h $tabsql[34] = "SELECT rowid, pos, code, label, c_level, active FROM ".MAIN_DB_PREFIX."c_hrm_function"; $tabsql[35] = "SELECT c.rowid, c.label, c.active, c.entity FROM ".MAIN_DB_PREFIX."c_exp_tax_cat c"; $tabsql[36] = "SELECT r.rowid, r.fk_c_exp_tax_cat, r.range_ik, r.active, r.entity FROM ".MAIN_DB_PREFIX."c_exp_tax_range r"; -$tabsql[37] = "SELECT r.rowid, r.code, r.label, r.short_label, r.unit_type, r.scale, r.active FROM ".MAIN_DB_PREFIX."c_units r"; +$tabsql[37] = "SELECT r.rowid, r.code, r.sortorder, r.label, r.short_label, r.unit_type, r.scale, r.active FROM ".MAIN_DB_PREFIX."c_units r"; $tabsql[38] = "SELECT rowid, entity, code, label, url, icon, active FROM ".MAIN_DB_PREFIX."c_socialnetworks"; $tabsql[39] = "SELECT code, label as libelle, sortorder, active FROM ".MAIN_DB_PREFIX."c_prospectcontactlevel"; $tabsql[40] = "SELECT id as rowid, code, libelle, picto, active FROM ".MAIN_DB_PREFIX."c_stcommcontact"; @@ -278,7 +278,7 @@ $tabsqlsort[33] = "code ASC"; $tabsqlsort[34] = "code ASC"; $tabsqlsort[35] = "c.label ASC"; $tabsqlsort[36] = "r.fk_c_exp_tax_cat ASC, r.range_ik ASC"; -$tabsqlsort[37] = "r.unit_type ASC, r.scale ASC, r.code ASC"; +$tabsqlsort[37] = "sortorder ASC"; $tabsqlsort[38] = "rowid, code ASC"; $tabsqlsort[39] = "sortorder ASC"; $tabsqlsort[40] = "code ASC"; @@ -324,7 +324,7 @@ $tabfield[33] = "code,label"; $tabfield[34] = "code,label"; $tabfield[35] = "label"; $tabfield[36] = "range_ik,fk_c_exp_tax_cat"; -$tabfield[37] = "code,label,short_label,unit_type,scale"; +$tabfield[37] = "code,label,short_label,unit_type,scale,sortorder"; $tabfield[38] = "code,label,url,icon,entity"; $tabfield[39] = "code,libelle,sortorder"; $tabfield[40] = "code,libelle,picto"; @@ -370,7 +370,7 @@ $tabfieldvalue[33] = "code,label"; $tabfieldvalue[34] = "code,label"; $tabfieldvalue[35] = "label"; $tabfieldvalue[36] = "range_ik,fk_c_exp_tax_cat"; -$tabfieldvalue[37] = "code,label,short_label,unit_type,scale"; +$tabfieldvalue[37] = "code,label,short_label,unit_type,scale,sortorder"; $tabfieldvalue[38] = "code,label,url,icon"; $tabfieldvalue[39] = "code,libelle,sortorder"; $tabfieldvalue[40] = "code,libelle,picto"; @@ -417,7 +417,7 @@ $tabfieldinsert[33] = "code,label"; $tabfieldinsert[34] = "code,label"; $tabfieldinsert[35] = "label"; $tabfieldinsert[36] = "range_ik,fk_c_exp_tax_cat"; -$tabfieldinsert[37] = "code,label,short_label,unit_type,scale"; +$tabfieldinsert[37] = "code,label,short_label,unit_type,scale,sortorder"; $tabfieldinsert[38] = "code,label,url,icon,entity"; $tabfieldinsert[39] = "code,label,sortorder"; $tabfieldinsert[40] = "code,libelle,picto"; diff --git a/htdocs/core/class/cunits.class.php b/htdocs/core/class/cunits.class.php index f2a672ec1a7..7219f901c9f 100644 --- a/htdocs/core/class/cunits.class.php +++ b/htdocs/core/class/cunits.class.php @@ -240,6 +240,7 @@ class CUnits // extends CommonObject $sql = 'SELECT'; $sql .= " t.rowid,"; $sql .= " t.code,"; + $sql .= " t.sortorder,"; $sql .= " t.label,"; $sql .= " t.short_label,"; $sql .= " t.unit_type,"; @@ -280,8 +281,9 @@ class CUnits // extends CommonObject while ($obj = $this->db->fetch_object($resql)) { $record = new self($this->db); - $record->id = $obj->rowid; + $record->id = $obj->rowid; $record->code = $obj->code; + $record->sortorder = $obj->sortorder; $record->label = $obj->label; $record->short_label = $obj->short_label; $record->unit_type = $obj->unit_type; @@ -318,6 +320,9 @@ class CUnits // extends CommonObject if (isset($this->code)) { $this->code = trim($this->code); } + if (isset($this->sortorder)) { + $this->sortorder = trim($this->sortorder); + } if (isset($this->label)) { $this->libelle = trim($this->label); } @@ -340,6 +345,7 @@ class CUnits // extends CommonObject // Update request $sql = "UPDATE ".MAIN_DB_PREFIX."c_units SET"; $sql .= " code=".(isset($this->code) ? "'".$this->db->escape($this->code)."'" : "null").","; + $sql .= " sortorder=".(isset($this->sortorder) ? "'".$this->db->escape($this->sortorder)."'" : "null").","; $sql .= " label=".(isset($this->label) ? "'".$this->db->escape($this->label)."'" : "null").","; $sql .= " short_label=".(isset($this->short_label) ? "'".$this->db->escape($this->short_label)."'" : "null").","; $sql .= " unit_type=".(isset($this->unit_type) ? "'".$this->db->escape($this->unit_type)."'" : "null").","; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index c69b794a011..da6b60218e2 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4353,6 +4353,7 @@ class Form if (!empty($unit_type)) { $sql .= " AND unit_type = '".$this->db->escape($unit_type)."'"; } + $sql .= " ORDER BY sortorder"; $resql = $this->db->query($sql); if ($resql && $this->db->num_rows($resql) > 0) { diff --git a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql index 82a6bdec3dc..e99bbae7a10 100644 --- a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql +++ b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql @@ -370,3 +370,5 @@ ALTER TABLE llx_hrm_skillrank ADD INDEX idx_hrm_skillrank_fk_skill (fk_skill); ALTER TABLE llx_hrm_skillrank ADD CONSTRAINT llx_hrm_skillrank_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid); --END GRH/HRM MODULE + +ALTER TABLE llx_c_units ADD COLUMN sortorder smallint AFTER code; diff --git a/htdocs/install/mysql/tables/llx_c_units.sql b/htdocs/install/mysql/tables/llx_c_units.sql index d4ff78b79f1..ef77703ae6e 100644 --- a/htdocs/install/mysql/tables/llx_c_units.sql +++ b/htdocs/install/mysql/tables/llx_c_units.sql @@ -19,11 +19,12 @@ -- ======================================================================== create table llx_c_units( - rowid integer AUTO_INCREMENT PRIMARY KEY, - code varchar(3), - scale integer, - label varchar(50), - short_label varchar(5), - unit_type varchar(10), - active tinyint DEFAULT 1 NOT NULL + rowid integer AUTO_INCREMENT PRIMARY KEY, + code varchar(3), + sortorder smallint, + scale integer, + label varchar(50), + short_label varchar(5), + unit_type varchar(10), + active tinyint DEFAULT 1 NOT NULL ) ENGINE=innodb; From b43dcb24f0b0c2819b30fed0bde5d76f8a6523d7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Oct 2021 11:04:21 +0200 Subject: [PATCH 0820/1460] Update fournisseur.commande.class.php --- htdocs/fourn/class/fournisseur.commande.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 2e9727de83c..02ffc77918a 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2927,11 +2927,11 @@ class CommandeFournisseur extends CommonOrder $this->user_approve_id2 = $obj->fk_user_approve2; } - $this->date_creation = $obj->datec; - $this->date_modification = $obj->datem; - $this->date_approve = $obj->datea; - $this->date_approve2 = $obj->datea2; - $this->date_validation = $obj->date_validation; + $this->date_creation = $this->db->jdate($obj->datec); + $this->date_modification = $this->db->jdate($obj->datem); + $this->date_approve = $this->db->jdate($obj->datea); + $this->date_approve2 = $this->db->jdate($obj->datea2); + $this->date_validation = $this->db->jdate($obj->date_validation); } $this->db->free($result); } else { From 57052e2fbabffa16b25a25fe02a1966e117d09db Mon Sep 17 00:00:00 2001 From: atm-florian Date: Mon, 11 Oct 2021 11:10:14 +0200 Subject: [PATCH 0821/1460] FIX PR#18931 Remove useless explicit call to dol_shutdown --- htdocs/compta/facture/card.php | 1 - htdocs/compta/facture/contact.php | 1 - htdocs/compta/facture/document.php | 1 - htdocs/compta/facture/info.php | 1 - htdocs/compta/facture/note.php | 1 - 5 files changed, 5 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index ab568332dd8..c772fd0ad7b 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2763,7 +2763,6 @@ if (empty($object->id)) { echo dol_get_fiche_head($head, 'compta', $langs->trans("InvoiceCustomer"), -1, 'bill'), '
    ' . $langs->trans("ErrorRecordNotFound") . '
    '; llxFooter(); - dol_shutdown(); exit; } diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php index c0e0a40c2c5..7177463c30e 100644 --- a/htdocs/compta/facture/contact.php +++ b/htdocs/compta/facture/contact.php @@ -125,7 +125,6 @@ if (empty($object->id)) { echo dol_get_fiche_head($head, 'contact', $langs->trans("InvoiceCustomer"), -1, 'bill'), '
    ' . $langs->trans("ErrorRecordNotFound") . '
    '; llxFooter(); - dol_shutdown(); exit; } diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index 64ebed251d3..0818b944705 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -92,7 +92,6 @@ if (empty($object->id)) { echo dol_get_fiche_head($head, 'documents', $langs->trans("InvoiceCustomer"), -1, 'bill'), '
    ' . $langs->trans("ErrorRecordNotFound") . '
    '; llxFooter(); - dol_shutdown(); exit; } diff --git a/htdocs/compta/facture/info.php b/htdocs/compta/facture/info.php index 9e40fd8b5a8..955c41693c0 100644 --- a/htdocs/compta/facture/info.php +++ b/htdocs/compta/facture/info.php @@ -50,7 +50,6 @@ if (empty($object->id)) { echo dol_get_fiche_head($head, 'info', $langs->trans("InvoiceCustomer"), -1, 'bill'), '
    ' . $langs->trans("ErrorRecordNotFound") . '
    '; llxFooter(); - dol_shutdown(); exit; } diff --git a/htdocs/compta/facture/note.php b/htdocs/compta/facture/note.php index 428383b4907..dadb61b551d 100644 --- a/htdocs/compta/facture/note.php +++ b/htdocs/compta/facture/note.php @@ -71,7 +71,6 @@ if (empty($object->id)) { echo dol_get_fiche_head($head, 'note', $langs->trans("InvoiceCustomer"), -1, 'bill'), '
    ' . $langs->trans("ErrorRecordNotFound") . '
    '; llxFooter(); - dol_shutdown(); exit; } From a9160f5af00823c29be23445565c687555cafc91 Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller Date: Mon, 11 Oct 2021 11:42:40 +0200 Subject: [PATCH 0822/1460] Fix : error takepos on constforcompanyid --- htdocs/takepos/invoice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index d7be7d4e6eb..e4e5d61bf1d 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -158,7 +158,7 @@ if ($ret > 0) { $placeid = $invoice->id; } -$constforcompanyid = 'CASHDESK_ID_THIRDPARTY'. isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '' ; +$constforcompanyid = 'CASHDESK_ID_THIRDPARTY'. (isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '') ; $soc = new Societe($db); if ($invoice->socid > 0) { From e899d94ed5c396edb5956ea7ed4011a0acd7cb42 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 11 Oct 2021 12:50:07 +0200 Subject: [PATCH 0823/1460] NEW Accountancy - rewrite bind accountancy code finding on purchase invoice --- htdocs/accountancy/supplier/index.php | 90 ++++++++++---- htdocs/accountancy/supplier/list.php | 161 ++++++++++---------------- 2 files changed, 130 insertions(+), 121 deletions(-) diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index 5e409f303ea..476ead53860 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -1,7 +1,7 @@ - * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2020 Alexandre Spangaro + * Copyright (C) 2013-2021 Florian Henry + * Copyright (C) 2013-2021 Alexandre Spangaro * Copyright (C) 2014 Juanjo Menent * * This program is free software; you can redistribute it and/or modify @@ -29,6 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; // Load translation files required by the page $langs->loadLangs(array("compta", "bills", "other", "accountancy")); @@ -44,6 +45,7 @@ if (!$user->rights->accounting->bind->write) { accessforbidden(); } +$accountingAccount = new AccountingAccount($db); $month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1); if (GETPOST("year", 'int')) { @@ -97,6 +99,7 @@ if (($action == 'clean' || $action == 'validatehistory') && $user->rights->accou $sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid='.$conf->global->CHARTOFACCOUNTS.' AND accnt.entity = '.$conf->entity.')'; $sql1 .= ' AND fd.fk_facture_fourn IN (SELECT rowid FROM '.MAIN_DB_PREFIX.'facture_fourn WHERE entity = '.$conf->entity.')'; $sql1 .= ' AND fk_code_ventilation <> 0'; + dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG); $resql1 = $db->query($sql1); if (!$resql1) { @@ -163,7 +166,7 @@ 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_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 .= " 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"; $sql .= " AND l.product_type <= 2"; if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) { @@ -181,27 +184,74 @@ if ($action == 'validatehistory') { $isBuyerInEEC = isInEEC($mysoc); + $thirdpartystatic = new Societe($db); + $facture_static = new FactureFournisseur($db); + $facture_static_det = new SupplierInvoiceLine($db); + $product_static = new Product($db); + $i = 0; while ($i < min($num_lines, 10000)) { // No more than 10000 at once $objp = $db->fetch_object($result); - $isSellerInEEC = isInEEC($objp); + $thirdpartystatic->id = $objp->socid; + $thirdpartystatic->name = $objp->name; + $thirdpartystatic->client = $objp->client; + $thirdpartystatic->fournisseur = $objp->fournisseur; + $thirdpartystatic->code_client = $objp->code_client; + $thirdpartystatic->code_compta_client = $objp->code_compta_client; + $thirdpartystatic->code_fournisseur = $objp->code_fournisseur; + $thirdpartystatic->code_compta_fournisseur = $objp->code_compta_fournisseur; + $thirdpartystatic->email = $objp->email; + $thirdpartystatic->country_code = $objp->country_code; + $thirdpartystatic->tva_intra = $objp->tva_intra; + $thirdpartystatic->code_compta = $objp->company_code_sell; - // Level 2: Search suggested account for product/service (similar code exists in page list.php to make manual binding) - $suggestedaccountingaccountfor = ''; - if (($objp->country_code == $mysoc->country_code) || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country) - $objp->code_buy_p = $objp->code_buy; - $objp->aarowid_suggest = $objp->aarowid; - $suggestedaccountingaccountfor = ''; + $product_static->ref = $objp->product_ref; + $product_static->id = $objp->product_id; + $product_static->type = $objp->type; + $product_static->label = $objp->product_label; + $product_static->status = $objp->status; + $product_static->status_buy = $objp->status_buy; + $product_static->accountancy_code_sell = $objp->code_sell; + $product_static->accountancy_code_sell_intra = $objp->code_sell_intra; + $product_static->accountancy_code_sell_export = $objp->code_sell_export; + $product_static->accountancy_code_buy = $objp->code_buy; + $product_static->accountancy_code_buy_intra = $objp->code_buy_intra; + $product_static->accountancy_code_buy_export = $objp->code_buy_export; + $product_static->tva_tx = $objp->tva_tx_prod; + + $facture_static->ref = $objp->ref; + $facture_static->id = $objp->facid; + $facture_static->type = $objp->ftype; + $facture_static->datef = $objp->datef; + + $facture_static_det->id = $objp->rowid; + $facture_static_det->total_ht = $objp->total_ht; + $facture_static_det->tva_tx = $objp->tva_tx_line; + $facture_static_det->vat_src_code = $objp->vat_src_code; + $facture_static_det->product_type = $objp->type_l; + $facture_static_det->desc = $objp->description; + + $accoutingAccountArray = array( + 'dom'=>$objp->aarowid, + 'intra'=>$objp->aarowid_intra, + 'export'=>$objp->aarowid_export, + 'thirdparty' =>$objp->aarowid_thirdparty); + + $code_buy_p_notset = ''; + $code_buy_t_notset = ''; + + $return = $accountingAccount->getAccountingCodeToBind($mysoc, $thirdpartystatic, $product_static, $facture_static, $facture_static_det, $accoutingAccountArray); + if (!is_array($return) && $return<0) { + setEventMessage($accountingAccount->error, 'errors'); } else { - if ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale - $objp->code_buy_p = $objp->code_buy_intra; - $objp->aarowid_suggest = $objp->aarowid_intra; - $suggestedaccountingaccountfor = 'eec'; - } else { // Foreign sale - $objp->code_buy_p = $objp->code_buy_export; - $objp->aarowid_suggest = $objp->aarowid_export; - $suggestedaccountingaccountfor = 'export'; + $suggestedid=$return['suggestedid']; + $suggestedaccountingaccountfor=$return['suggestedaccountingaccountfor']; + + if (!empty($suggestedid) && $suggestedaccountingaccountfor<>'') { + $suggestedid=$return['suggestedid']; + } else { + $suggestedid=0; } } @@ -216,8 +266,8 @@ if ($action == 'validatehistory') { if ($objp->aarowid_suggest > 0) { $sqlupdate = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det"; - $sqlupdate .= " SET fk_code_ventilation = ".((int) $objp->aarowid_suggest); - $sqlupdate .= " WHERE fk_code_ventilation <= 0 AND product_type <= 2 AND rowid = ".((int) $objp->rowid); + $sqlupdate .= " SET fk_code_ventilation = ".((int) $suggestedid); + $sqlupdate .= " WHERE fk_code_ventilation <= 0 AND product_type <= 2 AND rowid = ".((int) $facture_static_det->id); $resqlupdate = $db->query($sqlupdate); if (!$resqlupdate) { diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index ffdd5b6de57..d3bb7985376 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -2,7 +2,7 @@ /* Copyright (C) 2013-2014 Olivier Geffroy * Copyright (C) 2013-2021 Alexandre Spangaro * Copyright (C) 2014-2015 Ari Elbaz (elarifr) - * Copyright (C) 2013-2014 Florian Henry + * Copyright (C) 2013-2021 Florian Henry * Copyright (C) 2014 Juanjo Menent s * Copyright (C) 2016 Laurent Destailleur * @@ -46,6 +46,7 @@ $massaction = GETPOST('massaction', 'alpha'); $show_files = GETPOST('show_files', 'int'); $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); +$optioncss = GETPOST('optioncss', 'alpha'); // Select Box $mesCasesCochees = GETPOST('toselect', 'array'); @@ -97,10 +98,7 @@ if (!$sortorder) { $hookmanager->initHooks(array('accountancysupplierlist')); $formaccounting = new FormAccounting($db); -$accounting = new AccountingAccount($db); -// TODO: we should need to check if result is a really exist accountaccount rowid..... -$aarowid_s = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT, 1); -$aarowid_p = $accounting->fetch('', $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT, 1); +$accountingAccount = new AccountingAccount($db); $chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version'); @@ -518,9 +516,9 @@ if ($result) { $thirdpartystatic = new Societe($db); $facturefourn_static = new FactureFournisseur($db); + $facturefourn_static_det = new SupplierInvoiceLine($db); $product_static = new Product($db); - $isBuyerInEEC = isInEEC($mysoc); $accountingaccount_codetotid_cache = array(); @@ -543,6 +541,8 @@ if ($result) { $thirdpartystatic->code_compta_fournisseur = $objp->code_compta_fournisseur; $thirdpartystatic->email = $objp->email; $thirdpartystatic->country_code = $objp->country_code; + $thirdpartystatic->tva_intra = $objp->tva_intra; + $thirdpartystatic->code_compta_fournisseur = $objp->company_code_buy; $product_static->ref = $objp->product_ref; $product_static->id = $objp->product_id; @@ -556,95 +556,63 @@ if ($result) { $product_static->accountancy_code_buy = $objp->code_buy; $product_static->accountancy_code_buy_intra = $objp->code_buy_intra; $product_static->accountancy_code_buy_export = $objp->code_buy_export; + $product_static->tva_tx = $objp->tva_tx_prod; $facturefourn_static->ref = $objp->ref; $facturefourn_static->id = $objp->facid; $facturefourn_static->type = $objp->ftype; $facturefourn_static->label = $objp->invoice_label; + $facturefourn_static_det->id = $objp->rowid; + $facturefourn_static_det->total_ht = $objp->total_ht; + $facturefourn_static_det->tva_tx_line = $objp->tva_tx_line; + $facturefourn_static_det->vat_src_code = $objp->vat_src_code; + $facturefourn_static_det->product_type = $objp->type_l; + $facturefourn_static_det->desc = $objp->description; + $code_buy_p_notset = ''; $code_buy_t_notset = ''; $objp->aarowid_suggest = ''; // Will be set later - $isSellerInEEC = isInEEC($objp); + $accoutingAccountArray = array( + 'dom'=>$objp->aarowid, + 'intra'=>$objp->aarowid_intra, + 'export'=>$objp->aarowid_export, + 'thirdparty' =>$objp->aarowid_thirdparty); - // Level 1: Search suggested default account for product/service - $suggestedaccountingaccountbydefaultfor = ''; - if ($objp->type_l == 1) { - if ($objp->country_code == $mysoc->country_code || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country) - $objp->code_buy_l = (!empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT : ''); - $suggestedaccountingaccountbydefaultfor = ''; - } else { - if ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale - $objp->code_buy_l = (!empty($conf->global->ACCOUNTING_SERVICE_BUY_INTRA_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_INTRA_ACCOUNT : ''); - $suggestedaccountingaccountbydefaultfor = 'eec'; - } else { // Foreign sale - $objp->code_buy_l = (!empty($conf->global->ACCOUNTING_SERVICE_BUY_EXPORT_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_EXPORT_ACCOUNT : ''); - $suggestedaccountingaccountbydefaultfor = 'export'; - } - } - } elseif ($objp->type_l == 0) { - if ($objp->country_code == $mysoc->country_code || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country) - $objp->code_buy_l = (!empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : ''); - $suggestedaccountingaccountbydefaultfor = ''; - } else { - if ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale - $objp->code_buy_l = (!empty($conf->global->ACCOUNTING_PRODUCT_BUY_INTRA_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_INTRA_ACCOUNT : ''); - $suggestedaccountingaccountbydefaultfor = 'eec'; - } else { - $objp->code_buy_l = (!empty($conf->global->ACCOUNTING_PRODUCT_BUY_EXPORT_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_EXPORT_ACCOUNT : ''); - $suggestedaccountingaccountbydefaultfor = 'export'; - } - } - } - if ($objp->code_sell_l == -1) { - $objp->code_sell_l = ''; - } + $code_buy_p_notset = ''; + $code_buy_t_notset = ''; - // Level 2: Search suggested account for product/service (similar code exists in page index.php to make automatic binding) - $suggestedaccountingaccountfor = ''; - if (($objp->country_code == $mysoc->country_code) || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country) - $objp->code_buy_p = $objp->code_buy; - $objp->aarowid_suggest = $objp->aarowid; - $suggestedaccountingaccountfor = ''; + $return=$accountingAccount->getAccountingCodeToBind($mysoc, $thirdpartystatic, $product_static, $facture_static, $facture_static_det, $accoutinAccountArray); + if (!is_array($return) && $return<0) { + setEventMessage($accountingAccount->error, 'errors'); } else { - if ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale - $objp->code_buy_p = $objp->code_buy_intra; - $objp->aarowid_suggest = $objp->aarowid_intra; - $suggestedaccountingaccountfor = 'eec'; - } else { // Foreign sale - $objp->code_buy_p = $objp->code_buy_export; - $objp->aarowid_suggest = $objp->aarowid_export; - $suggestedaccountingaccountfor = 'export'; - } + $suggestedid=$return['suggestedid']; + $suggestedaccountingaccountfor=$return['suggestedaccountingaccountfor']; + $suggestedaccountingaccountbydefaultfor=$return['suggestedaccountingaccountbydefaultfor']; + $code_buy_l=$return['code_buy_l']; + $code_buy_p=$return['code_buy_p']; + $code_buy_t=$return['code_buy_t']; } + //var_dump($return); - // Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding) - if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) { - if (!empty($objp->company_code_buy)) { - $objp->code_buy_t = $objp->company_code_buy; - $objp->aarowid_suggest = $objp->aarowid_thirdparty; - $suggestedaccountingaccountfor = ''; - } - } - - if (!empty($objp->code_buy_p)) { + if (!empty($code_buy_p)) { // Value was defined previously } else { $code_buy_p_notset = 'color:orange'; } - if (empty($objp->code_buy_l) && empty($objp->code_buy_p)) { + if (empty($code_buy_l) && empty($code_buy_p)) { $code_buy_p_notset = 'color:red'; } - // $objp->code_buy_l is now default code of product/service - // $objp->code_buy_p is now code of product/service - // $objp->code_buy_t is now code of thirdparty + // $code_buy_l is now default code of product/service + // $code_buy_p is now code of product/service + // $code_buy_t is now code of thirdparty print '
    '.$objp->rowid.''.$facturefourn_static_det->id.''.$facturefourn_static->getNomUrl(1).''.dol_print_date($db->jdate($objp->datef), 'day').''.dol_print_date($db->jdate($facturefourn_static_det->datef), 'day').''; if ($product_static->id > 0) { print $product_static->getNomUrl(1); } - if ($objp->product_label) { - print '
    '.$objp->product_label.''; + if ($product_static->product_label) { + print '
    '.$product_static->product_label.''; } print '
    '; - $text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->description)); + $text = dolGetFirstLineOfText(dol_string_nohtmltag($facturefourn_static_det->desc)); $trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION; - print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description); + print $form->textwithtooltip(dol_trunc($text, $trunclength), $facturefourn_static_det->desc); print ''; @@ -678,11 +646,11 @@ if ($result) { print ''; - print vatrate($objp->tva_tx_line.($objp->vat_src_code ? ' ('.$objp->vat_src_code.')' : '')); + print vatrate($facturefourn_static_det->tva_tx_line.($facturefourn_static_det->vat_src_code ? ' ('.$facturefourn_static_det->vat_src_code.')' : '')); print ''; - $s = '1. '.(($objp->type_l == 1) ? $langs->trans("DefaultForService") : $langs->trans("DefaultForProduct")).': '; + $s = '1. '.(($facturefourn_static_det->type_l == 1) ? $langs->trans("DefaultForService") : $langs->trans("DefaultForProduct")).': '; $shelp = ''; if ($suggestedaccountingaccountbydefaultfor == 'eec') { $shelp .= $langs->trans("SaleEEC"); } elseif ($suggestedaccountingaccountbydefaultfor == 'export') { $shelp .= $langs->trans("SaleExport"); } - $s .= ($objp->code_buy_l > 0 ? length_accountg($objp->code_buy_l) : ''.$langs->trans("NotDefined").''); + $s .= ($code_buy_l > 0 ? length_accountg($code_buy_l) : ''.$langs->trans("NotDefined").''); print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1); - if ($objp->product_id > 0) { + if ($product_static->id > 0) { print '
    '; - $s = '2. '.(($objp->type_l == 1) ? $langs->trans("ThisService") : $langs->trans("ThisProduct")).': '; - $shelp = ''; + $s = '2. '.(($facturefourn_static_det->product_type == 1) ? $langs->trans("ThisService") : $langs->trans("ThisProduct")).': '; + $shelp = ''; $ttype = 'help'; if ($suggestedaccountingaccountfor == 'eec') { $shelp = $langs->trans("SaleEEC"); } elseif ($suggestedaccountingaccountfor == 'export') { $shelp = $langs->trans("SaleExport"); } - $s .= (empty($objp->code_buy_p) ? ''.$langs->trans("NotDefined").'' : length_accountg($objp->code_buy_p)); - print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1); + $s .= (empty($code_buy_p) ? ''.$langs->trans("NotDefined").'' : length_accountg($code_buy_p)); + print $form->textwithpicto($s, $shelp, 1, $ttype, '', 0, 2, '', 1); } else { print '
    '; $s = '2. '.(($objp->type_l == 1) ? $langs->trans("ThisService") : $langs->trans("ThisProduct")).': '; @@ -728,35 +696,26 @@ if ($result) { } if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) { print '
    '; - $s = '3. '.(($objp->type_l == 1) ? $langs->trans("ServiceForThisThirdparty") : $langs->trans("ProductForThisThirdparty")).': '; + $s = '3. '.(($facturefourn_static_det->product_type == 1) ? $langs->trans("ServiceForThisThirdparty") : $langs->trans("ProductForThisThirdparty")).': '; $shelp = ''; - $s .= ($objp->code_buy_t > 0 ? length_accountg($objp->code_buy_t) : ''.$langs->trans("NotDefined").''); + $s .= ($code_buy_t > 0 ? length_accountg($code_buy_t) : ''.$langs->trans("NotDefined").''); print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1); } print '
    '; - $suggestedid = $objp->aarowid_suggest; - if (empty($suggestedid) && empty($objp->code_buy_p) && !empty($objp->code_buy_l) && empty($conf->global->ACCOUNTANCY_DO_NOT_AUTOFILL_ACCOUNT_WITH_GENERIC)) { - if (empty($accountingaccount_codetotid_cache[$objp->code_buy_l])) { - $tmpaccount = new AccountingAccount($db); - $tmpaccount->fetch(0, $objp->code_buy_l, 1); - if ($tmpaccount->id > 0) { - $suggestedid = $tmpaccount->id; - } - $accountingaccount_codetotid_cache[$objp->code_buy_l] = $tmpaccount->id; - } else { - $suggestedid = $accountingaccount_codetotid_cache[$objp->code_buy_l]; - } - } - print $formaccounting->select_account($suggestedid, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone'); + print $formaccounting->select_account($suggestedid, 'codeventil'.$facturefourn_static_det->id, 1, array(), 0, 0, 'codeventil maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone'); print ''; - $ischecked = $objp->aarowid_suggest; - print ''; + if (!empty($suggestedid)) { + $ischecked = 1; + } else { + $ischecked = 0; + } + print ''; print '
    '; - $checkbox_selected = (GETPOST('send_email') == "1" ? ' checked' : ''); + $checkbox_selected = (GETPOST('send_email') == "1" ? ' checked' : ($conf->global->TICKETS_MESSAGE_FORCE_MAIL?'checked':'')); print ' '; print ''; print '
    '; diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index ffdd5b6de57..cc8398bc759 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -678,7 +678,7 @@ if ($result) { print ''; From 10d1f81dcba172a1dd7aafc5c2df277f540899d4 Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller Date: Tue, 12 Oct 2021 10:53:10 +0200 Subject: [PATCH 0837/1460] first fix sendmail event --- htdocs/eventorganization/conferenceorbooth_list.php | 2 +- .../eventorganization/conferenceorboothattendee_list.php | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index 9b997c8b0e9..4d5e6eb2794 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -628,7 +628,7 @@ $arrayofmassactions = array( if ($permissiontodelete) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'presend_attendees', 'predelete'))) { +if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index a9422f8ddd7..de09a9dade8 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -181,7 +181,9 @@ if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; } -if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { +if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend' +&& $massaction != 'presend_attendees' +&& $massaction != 'confirm_presend_attendees') { $massaction = ''; } @@ -216,6 +218,7 @@ if (empty($reshook)) { $objectclass = 'ConferenceOrBoothAttendee'; $objectlabel = 'ConferenceOrBoothAttendee'; $uploaddir = $conf->eventorganization->dir_output; + include DOL_DOCUMENT_ROOT.'/eventorganization/core/actions_massactions_mail.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } @@ -676,6 +679,7 @@ $arrayofmassactions = array( //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), + 'presend_attendees'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail").' - '.$langs->trans("Attendees"), ); if ($permissiontodelete) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); @@ -709,6 +713,7 @@ $topicmail = "SendConferenceOrBoothAttendeeRef"; $modelmail = "conferenceorboothattendee"; $objecttmp = new ConferenceOrBoothAttendee($db); $trackid = 'xxxx'.$object->id; +include DOL_DOCUMENT_ROOT.'/eventorganization/tpl/massactions_mail_pre.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; if ($search_all) { From bac0c3d7c850f22b7fdd33b958b07c00692f4a49 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Tue, 12 Oct 2021 11:30:35 +0200 Subject: [PATCH 0838/1460] Fix fatal error on php 8.0 --- htdocs/eventorganization/class/conferenceorbooth.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index 6d0c77dc768..90462fdb762 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -238,9 +238,10 @@ class ConferenceOrBooth extends ActionComm * @param string $ref Ref * @param string $ref_ext Ref ext to get * @param string $email_msgid Email msgid + * @param int $loadresources 1=Load also resources * @return int <0 if KO, 0 if not found, >0 if OK */ - public function fetch($id, $ref = null, $ref_ext = '', $email_msgid = '') + public function fetch($id, $ref = null, $ref_ext = '', $email_msgid = '', $loadresources = 1) { global $dolibarr_main_url_root, $conf, $langs; From 791a7206ee258ea6053e56063ac8f3a691dd2657 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Oct 2021 11:48:51 +0200 Subject: [PATCH 0839/1460] Fix var not defined --- htdocs/core/class/commonobject.class.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index cf64e298784..37083cdf5f8 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3637,22 +3637,19 @@ abstract class CommonObject $origin = 'order_supplier'; } - $targettype = $this->element; - - $parameters = array('sourcetype'=>$sourcetype, 'sourceid'=>$sourceid, 'targettype'=>$targettype, 'targetid'=>$targetid); - // Hook for explicitly set the targettype if it must be differtent than $this->element - $reshook = $hookmanager->executeHooks('setLinkedObjectSourceTargetType', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks - if ($reshook > 0) { - if (!empty($hookmanager->resArray['targettype'])) $targettype = $hookmanager->resArray['targettype']; - if (!empty($hookmanager->resArray['sourcetype'])) $sourcetype = $hookmanager->resArray['sourcetype']; - } - // Elements of the core modules which have `$module` property but may to which we don't want to prefix module part to the element name for finding the linked object in llx_element_element. // It's because an entry for this element may be exist in llx_element_element before this modification (version <=14.2) and ave named only with their element name in fk_source or fk_target. $coremodule = array('knowledgemanagement', 'partnership', 'workstation', 'ticket', 'recruitment', 'eventorganization'); // Add module part to target type if object has $module property and isn't in core modules. $targettype = ((!empty($this->module) && ! in_array($this->module, $coremodule)) ? $this->module.'_' : '').$this->element; + $parameters = array('targettype'=>$targettype); + // Hook for explicitly set the targettype if it must be differtent than $this->element + $reshook = $hookmanager->executeHooks('setLinkedObjectSourceTargetType', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) { + if (!empty($hookmanager->resArray['targettype'])) $targettype = $hookmanager->resArray['targettype']; + } + $this->db->begin(); $error = 0; From eb73da5abc46401d940438553627a0db4346f771 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Oct 2021 12:04:43 +0200 Subject: [PATCH 0840/1460] Fix set origin. --- htdocs/mrp/class/api_mos.class.php | 4 +++- htdocs/mrp/mo_production.php | 3 ++- htdocs/product/inventory/inventory.php | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/mrp/class/api_mos.class.php b/htdocs/mrp/class/api_mos.class.php index 59b4cbfa16b..e6068eb3c81 100644 --- a/htdocs/mrp/class/api_mos.class.php +++ b/htdocs/mrp/class/api_mos.class.php @@ -382,7 +382,9 @@ class Mos extends DolibarrApi if (!$error && $value["fk_warehouse"] > 0) { // Record stock movement $id_product_batch = 0; - $stockmove->origin = $this->mo; + + $stockmove->setOrigin($this->mo->element, $this->mo->id); + if ($qtytoprocess >= 0) { $moline = new MoLine($this->db); $moline->fk_mo = $this->mo->id; diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 510e7a433f4..533e81f80a2 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -211,7 +211,8 @@ if (empty($reshook)) { if (!$error && GETPOST('idwarehouse-'.$line->id.'-'.$i) > 0) { // Record stock movement $id_product_batch = 0; - $stockmove->origin = $object; + $stockmove->setOrigin($object->element, $object->id); + if ($qtytoprocess >= 0) { $idstockmove = $stockmove->livraison($user, $line->fk_product, GETPOST('idwarehouse-'.$line->id.'-'.$i), $qtytoprocess, 0, $labelmovement, dol_now(), '', '', GETPOST('batch-'.$line->id.'-'.$i), $id_product_batch, $codemovement); } else { diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index c0b607cde45..9a4d61209ba 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -109,7 +109,7 @@ if ($action == 'cancel_record' && $permissiontoadd) { if ($action == 'update' && !empty($user->rights->stock->mouvement->creer)) { $stockmovment = new MouvementStock($db); - $stockmovment->origin = $object; + $stockmovment->setOrigin($object->element, $object->id); $db->begin(); @@ -117,6 +117,7 @@ if ($action == 'update' && !empty($user->rights->stock->mouvement->creer)) { $sql .= ' id.fk_product, id.batch, id.qty_stock, id.qty_view, id.qty_regulated'; $sql .= ' FROM '.MAIN_DB_PREFIX.'inventorydet as id'; $sql .= ' WHERE id.fk_inventory = '.((int) $object->id); + $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); From 65e069a049af817bace0e0f07c7ddad4d0905e24 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Oct 2021 12:14:03 +0200 Subject: [PATCH 0841/1460] Fix var not initialized --- htdocs/mrp/class/api_mos.class.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/htdocs/mrp/class/api_mos.class.php b/htdocs/mrp/class/api_mos.class.php index e6068eb3c81..92351184ebe 100644 --- a/htdocs/mrp/class/api_mos.class.php +++ b/htdocs/mrp/class/api_mos.class.php @@ -353,6 +353,9 @@ class Mos extends DolibarrApi $stockmove = new MouvementStock($this->db); + $consumptioncomplete = true; + $productioncomplete = true; + if (!empty($arraytoconsume) && !empty($arraytoproduce)) { $pos = 0; $arrayofarrayname = array("arraytoconsume","arraytoproduce"); @@ -459,9 +462,6 @@ class Mos extends DolibarrApi } } if (!$error) { - $consumptioncomplete = true; - $productioncomplete = true; - if ($autoclose <= 0) { $consumptioncomplete = false; $productioncomplete = false; @@ -588,9 +588,6 @@ class Mos extends DolibarrApi } if (!$error) { - $consumptioncomplete = true; - $productioncomplete = true; - if ($autoclose > 0) { foreach ($this->mo->lines as $line) { if ($line->role == 'toconsume') { @@ -622,6 +619,7 @@ class Mos extends DolibarrApi } } } + // Update status of MO dol_syslog("consumptioncomplete = ".$consumptioncomplete." productioncomplete = ".$productioncomplete); //var_dump("consumptioncomplete = ".$consumptioncomplete." productioncomplete = ".$productioncomplete); From 415489c9fc0834f30257c8cfb4fa379a0eb351e9 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Tue, 12 Oct 2021 13:58:38 +0200 Subject: [PATCH 0842/1460] NEW : Move of mailing attendies --- .../eventorganization/core/actions_massactions_mail.inc.php | 4 ++-- htdocs/eventorganization/tpl/massactions_mail_pre.tpl.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/eventorganization/core/actions_massactions_mail.inc.php b/htdocs/eventorganization/core/actions_massactions_mail.inc.php index 2f8e2959f2b..5fcada893f9 100644 --- a/htdocs/eventorganization/core/actions_massactions_mail.inc.php +++ b/htdocs/eventorganization/core/actions_massactions_mail.inc.php @@ -90,7 +90,7 @@ if (!$error && $massaction == 'confirm_presend_attendees') { foreach ($toselect as $toselectid) { $result = $objecttmp->fetch($toselectid); if ($result > 0) { - $attendees = $attendee->fetchAll('', '', 0, 0, array('t.fk_actioncomm' => $objecttmp->id)); + $attendees = $attendee->fetchAll(); if (is_array($attendees) && count($attendees) > 0) { foreach ($attendees as $attmail) { if (!empty($attmail->email)) { @@ -119,7 +119,7 @@ if (!$error && $massaction == 'confirm_presend_attendees') { $receiver = array($receiver); } } - if (!trim($_POST['sendto']) && count($receiver) == 0 && count($listofselectedid) == 1) { // if only one recipient, receiver is mandatory + if (!trim($_POST['sendto']) && count($receiver) == 0 && count($listofselectedid) == 0) { // if only one recipient, receiver is mandatory $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Recipient")), null, 'warnings'); $massaction = 'presend_attendees'; diff --git a/htdocs/eventorganization/tpl/massactions_mail_pre.tpl.php b/htdocs/eventorganization/tpl/massactions_mail_pre.tpl.php index e4990da6424..8d0836b080e 100644 --- a/htdocs/eventorganization/tpl/massactions_mail_pre.tpl.php +++ b/htdocs/eventorganization/tpl/massactions_mail_pre.tpl.php @@ -37,7 +37,7 @@ if ($massaction == 'presend_attendees') { foreach ($arrayofselected as $toselectid) { $result = $objecttmp->fetch($toselectid); if ($result > 0) { - $attendees = $attendee->fetchAll('', '', 0, 0, array('t.fk_actioncomm'=>$objecttmp->id)); + $attendees = $attendee->fetchAll(); if (is_array($attendees) && count($attendees)>0) { foreach ($attendees as $attmail) { if (!empty($attmail->email)) { From 17885089636859773c1bce76c66dec3a59af0479 Mon Sep 17 00:00:00 2001 From: lvessiller Date: Tue, 12 Oct 2021 14:11:19 +0200 Subject: [PATCH 0843/1460] FIX payment style and html5 tags --- htdocs/takepos/css/pos.css.php | 7 ++-- htdocs/takepos/pay.php | 66 +++++++++++++++++----------------- 2 files changed, 35 insertions(+), 38 deletions(-) diff --git a/htdocs/takepos/css/pos.css.php b/htdocs/takepos/css/pos.css.php index e180dc33b3e..395c786b232 100644 --- a/htdocs/takepos/css/pos.css.php +++ b/htdocs/takepos/css/pos.css.php @@ -320,12 +320,11 @@ table.postablelines tr td { div.paymentbordline { - width:calc(50% - 16px); - background-color:#888; + background-color: #888; border-radius: 8px; - margin-bottom: 4px; - display: inline-block; + margin: 4px auto; padding: 5px; + width: calc(50% - 10px); } @media only screen and (max-aspect-ratio: 6/4) { diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index 60a4840471e..66d710c2a52 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -37,9 +37,9 @@ if (!defined('NOREQUIREMENU')) { if (!defined('NOREQUIREHTML')) { define('NOREQUIREHTML', '1'); } -if (!defined('NOREQUIREAJAX')) { - define('NOREQUIREAJAX', '1'); -} +//if (!defined('NOREQUIREAJAX')) { +// define('NOREQUIREAJAX', '1'); +//} require '../main.inc.php'; // Load $user and permissions require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; @@ -257,38 +257,36 @@ if ($conf->global->TAKEPOS_NUMPAD == 0) { } -
    - -
    -
    trans('TotalTTC'); ?>: total_ttc, 1, '', 1, -1, -1, $invoice->multicurrency_code); ?>
    +
    +
    +
    + trans('TotalTTC'); ?>: total_ttc, 1, '', 1, -1, -1, $invoice->multicurrency_code); ?> +
    + total_ttc) { ?> +
    + trans('RemainToPay'); ?>: multicurrency_code); ?> +
    + +
    + trans("Received"); ?>: multicurrency_code); ?> +
    +
    + trans("Change"); ?>: multicurrency_code); ?> +
    + global->TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT)) { + require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; + print '
    '; + $filter = ''; + $form = new Form($db); + print ''.$langs->trans("BankAccount").': '; + $form->select_comptes(0, 'accountid', 0, $filter, 1, ''); + print ajax_combobox('selectaccountid'); + print '
    '; + } + ?> +
    -total_ttc) { ?> -
    -
    trans('RemainToPay'); ?>: multicurrency_code); ?>
    -
    - -
    -
    trans("Received"); ?>: multicurrency_code); ?>
    -
    -
    -
    trans("Change"); ?>: multicurrency_code); ?>
    -
    -global->TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT)) { - print '
    -
    '; - $filter = ''; - $form = new Form($db); - print ''.$langs->trans("BankAccount").': '; - $form->select_comptes(0, 'accountid', 0, $filter, 1, ''); - print ajax_combobox('selectaccountid'); - print '
    -
    '; -} -?> - -
    -
    Date: Tue, 12 Oct 2021 15:15:09 +0200 Subject: [PATCH 0844/1460] Add an option to forbird changing the project of a supplier order if validated or if in draft but already has a reference (not ) --- htdocs/admin/supplier_order.php | 10 ++++++++++ htdocs/fourn/commande/card.php | 9 +++++++-- htdocs/langs/en_US/admin.lang | 1 + htdocs/langs/fr_FR/admin.lang | 1 + 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index 808528cdc0a..5eb48b627d4 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -149,6 +149,7 @@ if ($action == 'updateMask') { $res1 = dolibarr_set_const($db, "SUPPLIER_ORDER_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity); $res2 = dolibarr_set_const($db, "SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED", $doubleapproval, 'chaine', 0, '', $conf->entity); + $res3 = dolibarr_set_const($db, "FORBID_EDIT_PROJECT_ON_SUPPLIER_ORDER", GETPOST('FORBID_EDIT_PROJECT_ON_SUPPLIER_ORDER', 'int'), 'chaine', 0, '', $conf->entity); // TODO We add/delete permission here until permission can have a condition on a global var include_once DOL_DOCUMENT_ROOT.'/core/modules/modFournisseur.class.php'; @@ -532,6 +533,15 @@ if ($conf->reception->enabled) { print "
    '.$langs->trans("SupplierOrderForbidProjectChange").''.$form->selectyesno('FORBID_EDIT_PROJECT_ON_SUPPLIER_ORDER', $conf->global->FORBID_EDIT_PROJECT_ON_SUPPLIER_ORDER, 1).''; +print ''; +print '

    '; print ''; diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 4c8bed6bfe6..cea11eda9bc 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -144,6 +144,11 @@ $permissiondellink = $usercancreate; // Used by the include of actions_dellink.i $permissiontoedit = $usercancreate; // Used by the include of actions_lineupdown.inc.php $permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php +// Project permission +if (!empty($conf->projet->enabled)) { + $caneditproject = empty($conf->global->FORBID_EDIT_PROJECT_ON_SUPPLIER_ORDER) || ($object->statut == CommandeFournisseur::STATUS_DRAFT && preg_match('/^[\(]?PROV/i', $object->ref)); +} + /* * Actions @@ -239,7 +244,7 @@ if (empty($reshook)) { } // Set project - if ($action == 'classin' && $usercancreate) { + if ($action == 'classin' && $usercancreate && $caneditproject) { $result = $object->setProject($projectid); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -1988,7 +1993,7 @@ if ($action == 'create') { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($usercancreate) { - if ($action != 'classify') { + if ($action != 'classify' && $caneditproject) { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; } if ($action == 'classify') { diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index def603e653e..6620b3c73ff 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1436,6 +1436,7 @@ OrdersNumberingModules=Orders numbering models OrdersModelModule=Order documents models FreeLegalTextOnOrders=Free text on orders WatermarkOnDraftOrders=Watermark on draft orders (none if empty) +SupplierOrderForbidProjectChange=Forbid changing the project of a supplier order or a draft which already has a reference ShippableOrderIconInList=Add an icon in Orders list which indicate if order is shippable BANK_ASK_PAYMENT_BANK_DURING_ORDER=Ask for bank account destination of order ##### Interventions ##### diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 9579e51920d..16279587795 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -1428,6 +1428,7 @@ OrdersNumberingModules=Modèles de numérotation des commandes OrdersModelModule=Modèles de document des commandes FreeLegalTextOnOrders=Mention complémentaire sur les commandes WatermarkOnDraftOrders=Filigrane sur les brouillons de commandes (aucun si vide) +SupplierOrderForbidProjectChange=Interdire de modifier le projet d'une commande validée (ou en brouillon mais ayant déjà une référence) ShippableOrderIconInList=Ajouter une icône dans la liste des commandes qui indique si la commande est expédiable. BANK_ASK_PAYMENT_BANK_DURING_ORDER=Demander le compte bancaire cible durant la commande ##### Interventions ##### From 6bd1bc767bfe8a5bfb5620152b94a5ae560e64cc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Oct 2021 15:17:34 +0200 Subject: [PATCH 0845/1460] doc --- htdocs/product/class/html.formproduct.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index f17b583c5b8..1b6b9bbf0a5 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -615,7 +615,7 @@ class FormProduct /** * Return list of lot numbers (stock from product_batch) with stock location and stock qty * - * @param string $htmlname Name of html select html + * @param string $htmlname Name of key that is inside attribute "list" of an input text field. * @param int $empty 1=Can be empty, 0 if not * @param int $fk_product show lot numbers of product with id fk_product. All from objectLines if 0. * @param int $fk_entrepot filter lot numbers for warehouse with id fk_entrepot. All if 0. From 605aea62ca679c80d4a42da6499c96ffd6b095b5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Oct 2021 15:25:44 +0200 Subject: [PATCH 0846/1460] FIX TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT #18957 --- htdocs/takepos/pay.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index f79263bfce3..59ee28ade94 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -37,9 +37,6 @@ if (!defined('NOREQUIREMENU')) { if (!defined('NOREQUIREHTML')) { define('NOREQUIREHTML', '1'); } -if (!defined('NOREQUIREAJAX')) { - define('NOREQUIREAJAX', '1'); -} require '../main.inc.php'; // Load $user and permissions require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; @@ -289,6 +286,7 @@ if (!empty($conf->global->TAKEPOS_CUSTOMER_DISPLAY)) {
    global->TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT)) { + require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; print '
    '; $filter = ''; From 1d9b6fc5005eb7a6cc31eea02624412c9f0e06fd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Oct 2021 15:46:39 +0200 Subject: [PATCH 0847/1460] Complete PR template --- .github/PULL_REQUEST_TEMPLATE.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 84deea18f00..13a3e6fa77b 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,18 +1,18 @@ # Instructions *This is a template to help you make good pull requests. You may use [Github Markdown](https://help.github.com/articles/getting-started-with-writing-and-formatting-on-github/) syntax to format your issue report.* *Please:* -- *only keep the "Fix", "Close" or "New" section* +- *only keep the "FIX", "CLOSE" or "NEW" section* (use uppercase to have the PR appears into the ChangeLog, lowercase will not appears) - *follow the project [contributing guidelines](/.github/CONTRIBUTING.md)* - *replace the bracket enclosed texts with meaningful information* -# Fix #[*issue_number Short description*] +# FIX|Fix #[*issue_number Short description*] [*Long description*] -# Close #[*issue_number Short description*] +# CLOSE|Close #[*issue_number Short description*] [*Long description*] -# New [*Short description*] +# NEW|New [*Short description*] [*Long description*] From 1e7acf45713caf10f9a75a3dcfad028e5726dd55 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Oct 2021 15:50:46 +0200 Subject: [PATCH 0848/1460] Update contributing file to ask first the data structure change. --- .github/CONTRIBUTING.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index d17347a0ad7..68fe9de68d6 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -116,13 +116,13 @@ a process to follow to optimize the chance to have PRs merged efficiently... Also, some code changes need a prior approbation: -* if you want to include a new external library (into htdocs/includes directory), please ask before to the core project manager (mention @dolibarr-yoda in your issue) to see if such a library can be accepted. +* if you want to include a new external library (into htdocs/includes directory), please ask before to the core project manager (mention @dolibarr-jedi in your issue) to see if such a library can be accepted. -* if you add a new table, you must first create a page on https://wiki.dolibarr.org/index.php/Category:Table_SQL (copy an existing page changing its name to see it into this index page). Then ask the project manager (@dolibarr-yoda) if the new data model you plan to add is compatible with curent and future works in progress and can be accepted as you suggest. +* if you add a new tables or fields, you MUST first submit a standalone PR with the data structure changes you plan to add/modify (and only data structure changes). Start development only once this data structure has been accepted. Once a PR has been submitted, you may need to wait for its integration. It is common that the project leader let the PR open for a long delay to allow every developer discuss about the PR (A label is added in such a case). -If the label of PR start with "Draft" or "WIP" (Work In Progress), it will not be analyzed for merging until you change the label of PR (but it can be analyzed for discussion). +If the label of PR start with "Draft" or "WIP" (Work In Progress), it will not be analyzed for merging until you change the label of the PR (but it can be analyzed for discussion). If your PR has errors reported by the Continuous Integration Platform, it means your PR is not valid and nothing will be done with it. It will be kept open to allow developers to fix this, or it may be closed several month later. Don't expect anything on your PR if you have such errors, you MUST first fix the Continuous Integration error to have it taken into consideration. From ab4da186c5865e17fd2708cdeb77b4182924632c Mon Sep 17 00:00:00 2001 From: lvessiller Date: Tue, 12 Oct 2021 15:52:59 +0200 Subject: [PATCH 0849/1460] FIX 2 columns for total labels --- htdocs/takepos/css/pos.css.php | 7 +++-- htdocs/takepos/pay.php | 54 ++++++++++++++++------------------ 2 files changed, 30 insertions(+), 31 deletions(-) diff --git a/htdocs/takepos/css/pos.css.php b/htdocs/takepos/css/pos.css.php index 395c786b232..e180dc33b3e 100644 --- a/htdocs/takepos/css/pos.css.php +++ b/htdocs/takepos/css/pos.css.php @@ -320,11 +320,12 @@ table.postablelines tr td { div.paymentbordline { - background-color: #888; + width:calc(50% - 16px); + background-color:#888; border-radius: 8px; - margin: 4px auto; + margin-bottom: 4px; + display: inline-block; padding: 5px; - width: calc(50% - 10px); } @media only screen and (max-aspect-ratio: 6/4) { diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index 66d710c2a52..4bd20f33f4b 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -257,35 +257,33 @@ if ($conf->global->TAKEPOS_NUMPAD == 0) { } -
    -
    -
    - trans('TotalTTC'); ?>: total_ttc, 1, '', 1, -1, -1, $invoice->multicurrency_code); ?> -
    - total_ttc) { ?> -
    - trans('RemainToPay'); ?>: multicurrency_code); ?> -
    - -
    - trans("Received"); ?>: multicurrency_code); ?> -
    -
    - trans("Change"); ?>: multicurrency_code); ?> -
    - global->TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT)) { - require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; - print '
    '; - $filter = ''; - $form = new Form($db); - print ''.$langs->trans("BankAccount").': '; - $form->select_comptes(0, 'accountid', 0, $filter, 1, ''); - print ajax_combobox('selectaccountid'); - print '
    '; - } - ?> +
    +
    + trans('TotalTTC'); ?>: total_ttc, 1, '', 1, -1, -1, $invoice->multicurrency_code); ?>
    + total_ttc) { ?> +
    + trans('RemainToPay'); ?>: multicurrency_code); ?> +
    + +
    + trans("Received"); ?>: multicurrency_code); ?> +
    +
    + trans("Change"); ?>: multicurrency_code); ?> +
    + global->TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT)) { + require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; + print '
    '; + $filter = ''; + $form = new Form($db); + print ''.$langs->trans("BankAccount").': '; + $form->select_comptes(0, 'accountid', 0, $filter, 1, ''); + print ajax_combobox('selectaccountid'); + print '
    '; + } + ?>
    From d58f3343489e9dfb9bc70dc027b2d41cc0e0fde1 Mon Sep 17 00:00:00 2001 From: Vincent Dieltiens Date: Tue, 12 Oct 2021 21:28:20 +0200 Subject: [PATCH 0850/1460] Add date_valid and date_approve columns in the list of supplier orders --- htdocs/fourn/commande/list.php | 170 ++++++++++++++++++++++++++++++++- 1 file changed, 168 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 26888851d45..bef5289c791 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -70,6 +70,23 @@ $search_date_delivery_endyear = GETPOST('search_date_delivery_endyear', 'int'); $search_date_delivery_start = dol_mktime(0, 0, 0, $search_date_delivery_startmonth, $search_date_delivery_startday, $search_date_delivery_startyear); // Use tzserver $search_date_delivery_end = dol_mktime(23, 59, 59, $search_date_delivery_endmonth, $search_date_delivery_endday, $search_date_delivery_endyear); +$search_date_valid_startday = GETPOST('search_date_valid_startday', 'int'); +$search_date_valid_startmonth = GETPOST('search_date_valid_startmonth', 'int'); +$search_date_valid_startyear = GETPOST('search_date_valid_startyear', 'int'); +$search_date_valid_endday = GETPOST('search_date_valid_endday', 'int'); +$search_date_valid_endmonth = GETPOST('search_date_valid_endmonth', 'int'); +$search_date_valid_endyear = GETPOST('search_date_valid_endyear', 'int'); +$search_date_valid_start = dol_mktime(0, 0, 0, $search_date_valid_startmonth, $search_date_valid_startday, $search_date_valid_startyear); // Use tzserver +$search_date_valid_end = dol_mktime(23, 59, 59, $search_date_valid_endmonth, $search_date_valid_endday, $search_date_valid_endyear); +$search_date_approve_startday = GETPOST('search_date_approve_startday', 'int'); +$search_date_approve_startmonth = GETPOST('search_date_approve_startmonth', 'int'); +$search_date_approve_startyear = GETPOST('search_date_approve_startyear', 'int'); +$search_date_approve_endday = GETPOST('search_date_approve_endday', 'int'); +$search_date_approve_endmonth = GETPOST('search_date_approve_endmonth', 'int'); +$search_date_approve_endyear = GETPOST('search_date_approve_endyear', 'int'); +$search_date_approve_start = dol_mktime(0, 0, 0, $search_date_approve_startmonth, $search_date_approve_startday, $search_date_approve_startyear); // Use tzserver +$search_date_approve_end = dol_mktime(23, 59, 59, $search_date_approve_endmonth, $search_date_approve_endday, $search_date_approve_endyear); + $sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); $search_product_category = GETPOST('search_product_category', 'int'); @@ -184,7 +201,9 @@ $arrayfields = array( 'cf.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), 'cf.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500), 'cf.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000), - 'cf.billed'=>array('label'=>"Billed", 'checked'=>1, 'position'=>1000, 'enabled'=>1) + 'cf.billed'=>array('label'=>"Billed", 'checked'=>1, 'position'=>1000, 'enabled'=>1), + 'cf.date_valid' =>array('label' => 'DateValidation', 'checked' => 0), + 'cf.date_approve' =>array('label' => 'DateApprove', 'checked' => 0) ); // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; @@ -258,6 +277,22 @@ if (empty($reshook)) { $search_date_delivery_endyear = ''; $search_date_delivery_start = ''; $search_date_delivery_end = ''; + $search_date_valid_startday = ''; + $search_date_valid_startmonth = ''; + $search_date_valid_startyear = ''; + $search_date_valid_endday = ''; + $search_date_valid_endmonth = ''; + $search_date_valid_endyear = ''; + $search_date_valid_start = ''; + $search_date_valid_end = ''; + $search_date_approve_startday = ''; + $search_date_approve_startmonth = ''; + $search_date_approve_startyear = ''; + $search_date_approve_endday = ''; + $search_date_approve_endmonth = ''; + $search_date_approve_endyear = ''; + $search_date_approve_start = ''; + $search_date_approve_end = ''; $billed = ''; $search_billed = ''; $toselect = ''; @@ -580,6 +615,42 @@ if (empty($reshook)) { if ($search_date_delivery_endyear) { $param .= '&search_date_delivery_endyear='.urlencode($search_date_delivery_endyear); } + if ($search_date_valid_startday) { + $param .= '&search_date_valid_startday='.urlencode($search_date_valid_startday); + } + if ($search_date_valid_startmonth) { + $param .= '&search_date_valid_startmonth='.urlencode($search_date_valid_startmonth); + } + if ($search_date_valid_startyear) { + $param .= '&search_date_valid_startyear='.urlencode($search_date_valid_startyear); + } + if ($search_date_valid_endday) { + $param .= '&search_date_valid_endday='.urlencode($search_date_valid_endday); + } + if ($search_date_valid_endmonth) { + $param .= '&search_date_valid_endmonth='.urlencode($search_date_valid_endmonth); + } + if ($search_date_valid_endyear) { + $param .= '&search_date_valid_endyear='.urlencode($search_date_valid_endyear); + } + if ($search_date_approve_startday) { + $param .= '&search_date_approve_startday='.urlencode($search_date_approve_startday); + } + if ($search_date_approve_startmonth) { + $param .= '&search_date_approve_startmonth='.urlencode($search_date_approve_startmonth); + } + if ($search_date_approve_startyear) { + $param .= '&search_date_approve_startyear='.urlencode($search_date_approve_startyear); + } + if ($search_date_approve_endday) { + $param .= '&search_date_approve_endday='.urlencode($search_date_approve_endday); + } + if ($search_date_approve_endmonth) { + $param .= '&search_date_approve_endmonth='.urlencode($search_date_approve_endmonth); + } + if ($search_date_approve_endyear) { + $param .= '&search_date_approve_endyear='.urlencode($search_date_approve_endyear); + } if ($search_ref) { $param .= '&search_ref='.urlencode($search_ref); } @@ -673,7 +744,7 @@ if ($sall || $search_product_category > 0 || $search_user > 0) { $sql .= ' s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, s.email,'; $sql .= " typent.code as typent_code,"; $sql .= " state.code_departement as state_code, state.nom as state_name,"; -$sql .= " cf.rowid, cf.ref, cf.ref_supplier, cf.fk_statut, cf.billed, cf.total_ht, cf.total_tva, cf.total_ttc, cf.fk_user_author, cf.date_commande as date_commande, cf.date_livraison as date_livraison,"; +$sql .= " cf.rowid, cf.ref, cf.ref_supplier, cf.fk_statut, cf.billed, cf.total_ht, cf.total_tva, cf.total_ttc, cf.fk_user_author, cf.date_commande as date_commande, cf.date_livraison as date_livraison,cf.date_valid, cf.date_approve,"; $sql .= ' cf.fk_multicurrency, cf.multicurrency_code, cf.multicurrency_tx, cf.multicurrency_total_ht, cf.multicurrency_total_tva, cf.multicurrency_total_ttc,'; $sql .= ' cf.date_creation as date_creation, cf.tms as date_update,'; $sql .= ' cf.note_public, cf.note_private,'; @@ -764,6 +835,18 @@ if ($search_date_delivery_start) { if ($search_date_delivery_end) { $sql .= " AND cf.date_livraison <= '".$db->idate($search_date_delivery_end)."'"; } +if ($search_date_valid_start) { + $sql .= " AND cf.date_commande >= '".$db->idate($search_date_valid_start)."'"; +} +if ($search_date_valid_end) { + $sql .= " AND cf.date_commande <= '".$db->idate($search_date_valid_end)."'"; +} +if ($search_date_approve_start) { + $sql .= " AND cf.date_livraison >= '".$db->idate($search_date_approve_start)."'"; +} +if ($search_date_approve_end) { + $sql .= " AND cf.date_livraison <= '".$db->idate($search_date_approve_end)."'"; +} if ($search_town) { $sql .= natural_search('s.town', $search_town); } @@ -905,6 +988,42 @@ if ($resql) { if ($search_date_delivery_endyear) { $param .= '&search_date_delivery_endyear='.urlencode($search_date_delivery_endyear); } + if ($search_date_valid_startday) { + $param .= '&search_date_valid_startday='.urlencode($search_date_valid_startday); + } + if ($search_date_valid_startmonth) { + $param .= '&search_date_valid_startmonth='.urlencode($search_date_valid_startmonth); + } + if ($search_date_valid_startyear) { + $param .= '&search_date_valid_startyear='.urlencode($search_date_valid_startyear); + } + if ($search_date_valid_endday) { + $param .= '&search_date_valid_endday='.urlencode($search_date_valid_endday); + } + if ($search_date_valid_endmonth) { + $param .= '&search_date_valid_endmonth='.urlencode($search_date_valid_endmonth); + } + if ($search_date_valid_endyear) { + $param .= '&search_date_valid_endyear='.urlencode($search_date_valid_endyear); + } + if ($search_date_approve_startday) { + $param .= '&search_date_approve_startday='.urlencode($search_date_approve_startday); + } + if ($search_date_approve_startmonth) { + $param .= '&search_date_approve_startmonth='.urlencode($search_date_approve_startmonth); + } + if ($search_date_approve_startyear) { + $param .= '&search_date_approve_startyear='.urlencode($search_date_approve_startyear); + } + if ($search_date_approve_endday) { + $param .= '&search_date_approve_endday='.urlencode($search_date_approve_endday); + } + if ($search_date_approve_endmonth) { + $param .= '&search_date_approve_endmonth='.urlencode($search_date_approve_endmonth); + } + if ($search_date_approve_endyear) { + $param .= '&search_date_approve_endyear='.urlencode($search_date_approve_endyear); + } if ($search_ref) { $param .= '&search_ref='.urlencode($search_ref); } @@ -1279,6 +1398,28 @@ if ($resql) { print $form->selectyesno('search_billed', $search_billed, 1, 0, 1, 1); print ''; } + // Date valid + if (!empty($arrayfields['cf.date_valid']['checked'])) { + print ''; + print '
    '; + print $form->selectDate($search_date_valid_start ? $search_date_valid_start : -1, 'search_date_valid_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); + print '
    '; + print '
    '; + print $form->selectDate($search_date_valid_end ? $search_date_valid_end : -1, 'search_date_valid_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); + print '
    '; + print ''; + } + // Date approve + if (!empty($arrayfields['cf.date_approve']['checked'])) { + print ''; + print '
    '; + print $form->selectDate($search_date_approve_start ? $search_date_approve_start : -1, 'search_date_approve_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); + print '
    '; + print '
    '; + print $form->selectDate($search_date_approve_end ? $search_date_approve_end : -1, 'search_date_approve_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); + print '
    '; + print ''; + } // Action column print ''; $searchpicto = $form->showFilterButtons(); @@ -1370,6 +1511,12 @@ if ($resql) { if (!empty($arrayfields['cf.billed']['checked'])) { print_liste_field_titre($arrayfields['cf.billed']['label'], $_SERVER["PHP_SELF"], 'cf.billed', '', $param, '', $sortfield, $sortorder, 'center '); } + if (!empty($arrayfields['cf.date_valid']['checked'])) { + print_liste_field_titre($arrayfields['cf.date_valid']['label'], $_SERVER["PHP_SELF"], "cf.date_valid", "", $param, '', $sortfield, $sortorder, 'center '); + } + if (!empty($arrayfields['cf.date_approve']['checked'])) { + print_liste_field_titre($arrayfields['cf.date_approve']['label'], $_SERVER["PHP_SELF"], 'cf.date_approve', '', $param, '', $sortfield, $sortorder, 'center '); + } print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); print "\n"; @@ -1668,6 +1815,25 @@ if ($resql) { } } + // valid date + if (!empty($arrayfields['cf.date_valid']['checked'])) { + print ''; + print dol_print_date($db->jdate($obj->date_valid), 'day'); + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // approve date + if (!empty($arrayfields['cf.date_approve']['checked'])) { + print ''; + print dol_print_date($db->jdate($obj->date_approve), 'day'); + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Action column print ''; if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined From d50c1a7603d7bc18bc62a0ded07172be8bdfa025 Mon Sep 17 00:00:00 2001 From: Vincent Dieltiens Date: Tue, 12 Oct 2021 23:23:57 +0200 Subject: [PATCH 0851/1460] preview of expense report file using pdf file instead of generated image --- htdocs/expensereport/card.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 6e40b6b3a77..f700feb400b 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -2174,7 +2174,10 @@ if ($action == 'create') { // If the preview file is found if (file_exists($fileimage)) { $thumbshown = 1; + $urlforhref = getAdvancedPreviewUrl($modulepart, $relativepath.'/'.$fileinfo['filename'].'.'.strtolower($fileinfo['extension']), 1, '&entity='.(!empty($object->entity) ? $object->entity : $conf->entity)); + print ''; print ''; + print ''; } } } From 7f07d82d3f66786ff7f08d1b5079ba41175d03fa Mon Sep 17 00:00:00 2001 From: Vincent Dieltiens Date: Tue, 12 Oct 2021 23:33:07 +0200 Subject: [PATCH 0852/1460] Rename FORBID_EDIT_PROJECT_ON_SUPPLIER_ORDER into SUPPLIER_ORDER_FORBID_EDIT_PROJECT --- htdocs/admin/supplier_order.php | 4 ++-- htdocs/fourn/commande/card.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index 5eb48b627d4..a918c14db83 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -149,7 +149,7 @@ if ($action == 'updateMask') { $res1 = dolibarr_set_const($db, "SUPPLIER_ORDER_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity); $res2 = dolibarr_set_const($db, "SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED", $doubleapproval, 'chaine', 0, '', $conf->entity); - $res3 = dolibarr_set_const($db, "FORBID_EDIT_PROJECT_ON_SUPPLIER_ORDER", GETPOST('FORBID_EDIT_PROJECT_ON_SUPPLIER_ORDER', 'int'), 'chaine', 0, '', $conf->entity); + $res3 = dolibarr_set_const($db, "SUPPLIER_ORDER_FORBID_EDIT_PROJECT", GETPOST('SUPPLIER_ORDER_FORBID_EDIT_PROJECT', 'int'), 'chaine', 0, '', $conf->entity); // TODO We add/delete permission here until permission can have a condition on a global var include_once DOL_DOCUMENT_ROOT.'/core/modules/modFournisseur.class.php'; @@ -536,7 +536,7 @@ print "\n"; // Option print ''; print ''.$langs->trans("SupplierOrderForbidProjectChange").''; -print ''.$form->selectyesno('FORBID_EDIT_PROJECT_ON_SUPPLIER_ORDER', $conf->global->FORBID_EDIT_PROJECT_ON_SUPPLIER_ORDER, 1).''; +print ''.$form->selectyesno('SUPPLIER_ORDER_FORBID_EDIT_PROJECT', $conf->global->SUPPLIER_ORDER_FORBID_EDIT_PROJECT, 1).''; print ''; print ''; print ''; diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index cea11eda9bc..6a5430d1f33 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -146,7 +146,7 @@ $permissiontoadd = $usercancreate; // Used by the include of actions_addupdatede // Project permission if (!empty($conf->projet->enabled)) { - $caneditproject = empty($conf->global->FORBID_EDIT_PROJECT_ON_SUPPLIER_ORDER) || ($object->statut == CommandeFournisseur::STATUS_DRAFT && preg_match('/^[\(]?PROV/i', $object->ref)); + $caneditproject = empty($conf->global->SUPPLIER_ORDER_FORBID_EDIT_PROJECT) || ($object->statut == CommandeFournisseur::STATUS_DRAFT && preg_match('/^[\(]?PROV/i', $object->ref)); } From e6c451cdae9237d19ede6d1e1d136197472f97f1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Oct 2021 23:50:23 +0200 Subject: [PATCH 0853/1460] Fix responsive --- htdocs/core/lib/functions.lib.php | 2 +- htdocs/eventorganization/conferenceorbooth_list.php | 3 ++- htdocs/eventorganization/conferenceorboothattendee_list.php | 2 +- htdocs/projet/card.php | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 897b248824f..fd04488f3f2 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1613,7 +1613,7 @@ function dol_fiche_head($links = array(), $active = '0', $title = '', $notab = 0 * @param string $picto Add a picto on tab title * @param int $pictoisfullpath If 1, image path is a full path. If you set this to 1, you can use url returned by dol_buildpath('/mymodyle/img/myimg.png',1) for $picto. * @param string $morehtmlright Add more html content on right of tabs title - * @param string $morecss More Css + * @param string $morecss More CSS on the link * @param int $limittoshow Limit number of tabs to show. Use 0 to use automatic default value. * @param string $moretabssuffix A suffix to use when you have several dol_get_fiche_head() in same page * @return string diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index 4d5e6eb2794..5e382590fca 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -475,7 +475,8 @@ if ($projectid > 0) { if (!empty($project->id)) { $head = conferenceorboothProjectPrepareHead($project); $tab = 'conferenceorbooth'; - print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, ($project->public ? 'projectpub' : 'project'), 0, '', ''); + + print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, ($project->public ? 'projectpub' : 'project'), 0, '', 'reposition'); } // Build and execute select diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index de09a9dade8..8b263b32699 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -601,7 +601,7 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) { if (empty($confOrBooth->id)) { $head = conferenceorboothProjectPrepareHead($projectstatic); $tab = 'attendees'; - print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, ($project->public ? 'projectpub' : 'project'), 0, '', ''); + print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, ($project->public ? 'projectpub' : 'project'), 0, '', 'reposition'); } } diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 8aab287bbb6..763c57dc51e 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -536,12 +536,12 @@ if ($action == 'create' && $user->rights->projet->creer) { // Ref $suggestedref = (GETPOST("ref") ? GETPOST("ref") : $defaultref); - print ''.$langs->trans("Ref").''; + print ''.$langs->trans("Ref").''; print ' '.$form->textwithpicto('', $langs->trans("YouCanCompleteRef", $suggestedref)); print ''; // Label - print ''.$langs->trans("ProjectLabel").''; + print ''.$langs->trans("ProjectLabel").''; // Usage (opp, task, bill time, ...) if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) { From 93eff144e5bf5073f55516210d8fd412b6e2c24c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Oct 2021 01:52:38 +0200 Subject: [PATCH 0854/1460] Update admin.lang --- htdocs/langs/fr_FR/admin.lang | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 16279587795..9579e51920d 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -1428,7 +1428,6 @@ OrdersNumberingModules=Modèles de numérotation des commandes OrdersModelModule=Modèles de document des commandes FreeLegalTextOnOrders=Mention complémentaire sur les commandes WatermarkOnDraftOrders=Filigrane sur les brouillons de commandes (aucun si vide) -SupplierOrderForbidProjectChange=Interdire de modifier le projet d'une commande validée (ou en brouillon mais ayant déjà une référence) ShippableOrderIconInList=Ajouter une icône dans la liste des commandes qui indique si la commande est expédiable. BANK_ASK_PAYMENT_BANK_DURING_ORDER=Demander le compte bancaire cible durant la commande ##### Interventions ##### From 0ecf9ebc41fa12c5bd37123db1ba40e282c808df Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Oct 2021 01:52:53 +0200 Subject: [PATCH 0855/1460] Update admin.lang --- htdocs/langs/en_US/admin.lang | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 6620b3c73ff..def603e653e 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1436,7 +1436,6 @@ OrdersNumberingModules=Orders numbering models OrdersModelModule=Order documents models FreeLegalTextOnOrders=Free text on orders WatermarkOnDraftOrders=Watermark on draft orders (none if empty) -SupplierOrderForbidProjectChange=Forbid changing the project of a supplier order or a draft which already has a reference ShippableOrderIconInList=Add an icon in Orders list which indicate if order is shippable BANK_ASK_PAYMENT_BANK_DURING_ORDER=Ask for bank account destination of order ##### Interventions ##### From 4d48be415caaeae47fb84962d6c47e1a3ef876d7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Oct 2021 01:53:44 +0200 Subject: [PATCH 0856/1460] Fight against inflation of minor options --- htdocs/admin/supplier_order.php | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index a918c14db83..fabcbbc75c9 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -149,8 +149,7 @@ if ($action == 'updateMask') { $res1 = dolibarr_set_const($db, "SUPPLIER_ORDER_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity); $res2 = dolibarr_set_const($db, "SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED", $doubleapproval, 'chaine', 0, '', $conf->entity); - $res3 = dolibarr_set_const($db, "SUPPLIER_ORDER_FORBID_EDIT_PROJECT", GETPOST('SUPPLIER_ORDER_FORBID_EDIT_PROJECT', 'int'), 'chaine', 0, '', $conf->entity); - + // TODO We add/delete permission here until permission can have a condition on a global var include_once DOL_DOCUMENT_ROOT.'/core/modules/modFournisseur.class.php'; $newmodule = new modFournisseur($db); @@ -533,15 +532,6 @@ if ($conf->reception->enabled) { print "\n"; print "\n"; -// Option -print ''; -print ''.$langs->trans("SupplierOrderForbidProjectChange").''; -print ''.$form->selectyesno('SUPPLIER_ORDER_FORBID_EDIT_PROJECT', $conf->global->SUPPLIER_ORDER_FORBID_EDIT_PROJECT, 1).''; -print ''; -print ''; -print ''; -print ''; - print '
    '; print ''; From 365d5d4588f941718ea7d36652bf0b2b8674962d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Oct 2021 01:55:24 +0200 Subject: [PATCH 0857/1460] Update card.php --- htdocs/fourn/commande/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 6a5430d1f33..32150131314 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -145,6 +145,7 @@ $permissiontoedit = $usercancreate; // Used by the include of actions_lineupdown $permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php // Project permission +$caneditproject = false; if (!empty($conf->projet->enabled)) { $caneditproject = empty($conf->global->SUPPLIER_ORDER_FORBID_EDIT_PROJECT) || ($object->statut == CommandeFournisseur::STATUS_DRAFT && preg_match('/^[\(]?PROV/i', $object->ref)); } From 4fc93ca7fa10d550e5778c871f39e2af0af83386 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Oct 2021 02:35:53 +0200 Subject: [PATCH 0858/1460] Fix css --- htdocs/core/class/dolgraph.class.php | 2 +- htdocs/product/stats/card.php | 10 ++++------ htdocs/theme/eldy/global.inc.php | 7 +++++++ 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index e4a91d903df..ac2965668a2 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -1519,7 +1519,7 @@ class DolGraph if (empty($conf->dol_optimize_smallscreen)) { return ($defaultsize ? $defaultsize : '500'); } else { - return (empty($_SESSION['dol_screen_width']) ? '280' : ($_SESSION['dol_screen_width'] - 40)); + return (empty($_SESSION['dol_screenwidth']) ? '280' : ($_SESSION['dol_screenwidth'] - 40)); } } if ($direction == 'height') { diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php index 7437312c1c8..932a57d0885 100644 --- a/htdocs/product/stats/card.php +++ b/htdocs/product/stats/card.php @@ -223,9 +223,9 @@ if ($result || empty($id)) { } if ($mode == 'bynumber') { - print '
    id).($type != '' ? '&type='.$type : '').'&mode=byunit&search_year='.$search_year.'">'; + print 'id).($type != '' ? '&type='.$type : '').'&mode=byunit&search_year='.$search_year.'">'; } else { - print ''; + print ''; } print $langs->trans("StatsByNumberOfUnits"); if ($mode == 'bynumber') { @@ -236,14 +236,12 @@ if ($result || empty($id)) { if (!empty($conf->dol_use_jmobile)) { print '
    '."\n".'
    '."\n"; - } else { - print '   '; } if ($mode == 'byunit') { - print 'id).($type != '' ? '&type='.$type : '').'&mode=bynumber&search_year='.$search_year.'">'; + print 'id).($type != '' ? '&type='.$type : '').'&mode=bynumber&search_year='.$search_year.'">'; } else { - print ''; + print ''; } print $langs->trans("StatsByNumberOfEntities"); if ($mode == 'byunit') { diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index a310dc19548..80e509fc447 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -7102,6 +7102,13 @@ div.clipboardCPValue.hidewithsize { boerder-right: unset; padding-left: 5px; } + + .a-mesure, .a-mesure-disabled { + display: block; + margin-bottom: 6px; + padding-left: 12px; + padding-right: 12px; + } } @media only screen and (max-width: 320px) From 04091169dab12429e88430b9f2eb3cf0f8fd9e90 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 13 Oct 2021 02:48:42 +0200 Subject: [PATCH 0859/1460] Accountancy - Show message for admin if accountancy hidden options are activated to help to resolve some problems --- htdocs/accountancy/admin/index.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index f8c0c95d3c1..4f4bff526c8 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2019 Alexandre Spangaro + * Copyright (C) 2013-2021 Alexandre Spangaro * Copyright (C) 2014-2015 Ari Elbaz (elarifr) * Copyright (C) 2014 Marcos García * Copyright (C) 2014 Juanjo Menent @@ -260,6 +260,22 @@ $linkback = ''; //$linkback = '' . $langs->trans("BackToModuleList") . ''; print load_fiche_titre($title, $linkback, 'accountancy'); +// Show message if accountancy hidden options are activated to help to resolve some problems +if (!$user->admin) { + if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + print '
    ' . $langs->trans("ConstantIsOn", "FACTURE_DEPOSITS_ARE_JUST_PAYMENTS") . '
    '; + } + if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) { + print '
    ' . $langs->trans("ConstantIsOn", "ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY") . '
    '; + } + if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { + print '
    ' . $langs->trans("ConstantIsOn", "MAIN_COMPANY_PERENTITY_SHARED") . '
    '; + } + if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) { + print '
    ' . $langs->trans("ConstantIsOn", "MAIN_PRODUCT_PERENTITY_SHARED") . '
    '; + } +} + print '
    '; print ''; print ''; From 3a04a0115b4c1dc93223873f1349cb6b742a2b50 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 13 Oct 2021 03:26:39 +0200 Subject: [PATCH 0860/1460] Add data sortorder --- htdocs/install/mysql/data/llx_c_units.sql | 80 ++++++++++++----------- 1 file changed, 41 insertions(+), 39 deletions(-) diff --git a/htdocs/install/mysql/data/llx_c_units.sql b/htdocs/install/mysql/data/llx_c_units.sql index 3a11453c9f8..59692793fe2 100644 --- a/htdocs/install/mysql/data/llx_c_units.sql +++ b/htdocs/install/mysql/data/llx_c_units.sql @@ -1,7 +1,9 @@ -- ======================================================================== --- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville --- Copyright (C) 2004 Laurent Destailleur --- Copyright (C) 2019 Florian Henry +-- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville +-- Copyright (C) 2004 Laurent Destailleur +-- Copyright (C) 2019 Florian Henry +-- Copyright (C) 2021 Alexandre Spangaro +-- -- 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 2 of the License, or @@ -17,45 +19,45 @@ -- -- ======================================================================== -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('T', '3','WeightUnitton','T', 'weight', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('KG', '0','WeightUnitkg','kg', 'weight', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('G', '-3','WeightUnitg','g', 'weight', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('MG','-6','WeightUnitmg','mg', 'weight', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('OZ','98','WeightUnitounce','Oz', 'weight', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('LB','99','WeightUnitpound','lb', 'weight', 1); +INSERT INTO llx_c_units (code, sortorder, scale, label, short_label, unit_type, active) VALUES ('T', '100', '3','WeightUnitton','T', 'weight', 1); +INSERT INTO llx_c_units (code, sortorder, scale, label, short_label, unit_type, active) VALUES ('KG','110', '0','WeightUnitkg','kg', 'weight', 1); +INSERT INTO llx_c_units (code, sortorder, scale, label, short_label, unit_type, active) VALUES ('G', '120','-3','WeightUnitg','g', 'weight', 1); +INSERT INTO llx_c_units (code, sortorder, scale, label, short_label, unit_type, active) VALUES ('MG','130','-6','WeightUnitmg','mg', 'weight', 1); +INSERT INTO llx_c_units (code, sortorder, scale, label, short_label, unit_type, active) VALUES ('OZ','140','98','WeightUnitounce','Oz', 'weight', 1); +INSERT INTO llx_c_units (code, sortorder, scale, label, short_label, unit_type, active) VALUES ('LB','150','99','WeightUnitpound','lb', 'weight', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('M', '0','SizeUnitm','m', 'size', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('DM','-1','SizeUnitdm','dm', 'size', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('CM','-2','SizeUnitcm','cm', 'size', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('MM','-3','SizeUnitmm','mm', 'size', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('FT','98','SizeUnitfoot','ft', 'size', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('IN','99','SizeUnitinch','in', 'size', 1); +INSERT INTO llx_c_units (code, sortorder, scale, label, short_label, unit_type, active) VALUES ('M', '200', '0','SizeUnitm','m', 'size', 1); +INSERT INTO llx_c_units (code, sortorder, scale, label, short_label, unit_type, active) VALUES ('DM','210','-1','SizeUnitdm','dm', 'size', 1); +INSERT INTO llx_c_units (code, sortorder, scale, label, short_label, unit_type, active) VALUES ('CM','220','-2','SizeUnitcm','cm', 'size', 1); +INSERT INTO llx_c_units (code, sortorder, scale, label, short_label, unit_type, active) VALUES ('MM','230','-3','SizeUnitmm','mm', 'size', 1); +INSERT INTO llx_c_units (code, sortorder, scale, label, short_label, unit_type, active) VALUES ('FT','240','98','SizeUnitfoot','ft', 'size', 1); +INSERT INTO llx_c_units (code, sortorder, scale, label, short_label, unit_type, active) VALUES ('IN','250','99','SizeUnitinch','in', 'size', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('M2', '0','SurfaceUnitm2','m2', 'surface', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('DM2','-2','SurfaceUnitdm2','dm2', 'surface', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('CM2','-4','SurfaceUnitcm2','cm2', 'surface', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('MM2','-6','SurfaceUnitmm2','mm2', 'surface', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('FT2','98','SurfaceUnitfoot2','ft2', 'surface', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('IN2','99','SurfaceUnitinch2','in2', 'surface', 1); +INSERT INTO llx_c_units (code, sortorder, scale, label, short_label, unit_type, active) VALUES ('M2', '300', '0','SurfaceUnitm2','m2', 'surface', 1); +INSERT INTO llx_c_units (code, sortorder, scale, label, short_label, unit_type, active) VALUES ('DM2','310','-2','SurfaceUnitdm2','dm2', 'surface', 1); +INSERT INTO llx_c_units (code, sortorder, scale, label, short_label, unit_type, active) VALUES ('CM2','320','-4','SurfaceUnitcm2','cm2', 'surface', 1); +INSERT INTO llx_c_units (code, sortorder, scale, label, short_label, unit_type, active) VALUES ('MM2','330','-6','SurfaceUnitmm2','mm2', 'surface', 1); +INSERT INTO llx_c_units (code, sortorder, scale, label, short_label, unit_type, active) VALUES ('FT2','340','98','SurfaceUnitfoot2','ft2', 'surface', 1); +INSERT INTO llx_c_units (code, sortorder, scale, label, short_label, unit_type, active) VALUES ('IN2','350','99','SurfaceUnitinch2','in2', 'surface', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('M3', '0','VolumeUnitm3','m3', 'volume', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('DM3','-3','VolumeUnitdm3','dm3', 'volume', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('CM3','-6','VolumeUnitcm3','cm3', 'volume', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('MM3','-9','VolumeUnitmm3','mm3', 'volume', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('FT3','88','VolumeUnitfoot3','ft3', 'volume', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('IN3','89','VolumeUnitinch3','in3', 'volume', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('OZ3','97','VolumeUnitounce','Oz', 'volume', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('L', '98','VolumeUnitlitre','L', 'volume', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('GAL','99','VolumeUnitgallon','gal', 'volume', 1); +INSERT INTO llx_c_units (code, sortorder, scale, label, short_label, unit_type, active) VALUES ('M3', '400', '0','VolumeUnitm3','m3', 'volume', 1); +INSERT INTO llx_c_units (code, sortorder, scale, label, short_label, unit_type, active) VALUES ('DM3','410','-3','VolumeUnitdm3','dm3', 'volume', 1); +INSERT INTO llx_c_units (code, sortorder, scale, label, short_label, unit_type, active) VALUES ('CM3','420','-6','VolumeUnitcm3','cm3', 'volume', 1); +INSERT INTO llx_c_units (code, sortorder, scale, label, short_label, unit_type, active) VALUES ('MM3','430','-9','VolumeUnitmm3','mm3', 'volume', 1); +INSERT INTO llx_c_units (code, sortorder, scale, label, short_label, unit_type, active) VALUES ('FT3','440','88','VolumeUnitfoot3','ft3', 'volume', 1); +INSERT INTO llx_c_units (code, sortorder, scale, label, short_label, unit_type, active) VALUES ('IN3','450','89','VolumeUnitinch3','in3', 'volume', 1); +INSERT INTO llx_c_units (code, sortorder, scale, label, short_label, unit_type, active) VALUES ('OZ3','460','97','VolumeUnitounce','Oz', 'volume', 1); +INSERT INTO llx_c_units (code, sortorder, scale, label, short_label, unit_type, active) VALUES ('L', '470','98','VolumeUnitlitre','L', 'volume', 1); +INSERT INTO llx_c_units (code, sortorder, scale, label, short_label, unit_type, active) VALUES ('GAL','480','99','VolumeUnitgallon','gal', 'volume', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('P', '0','Piece','p', 'qty', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('SET', '0','Set','set', 'qty', 1); +INSERT INTO llx_c_units (code, sortorder, scale, label, short_label, unit_type, active) VALUES ('P', '500', '0','Piece','p', 'qty', 1); +INSERT INTO llx_c_units (code, sortorder, scale, label, short_label, unit_type, active) VALUES ('SET','510', '0','Set','set', 'qty', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('S', '0','second','s', 'time', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('MI', '60','minute','i', 'time', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('H', '3600','hour','h', 'time', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('D', '86400','day','d', 'time', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('W', '604800','week','w', 'time', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('MO','2629800','month','m', 'time', 1); -INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('Y','31557600','year','y', 'time', 1); +INSERT INTO llx_c_units (code, sortorder, scale, label, short_label, unit_type, active) VALUES ('S', '600', '0','second','s', 'time', 1); +INSERT INTO llx_c_units (code, sortorder, scale, label, short_label, unit_type, active) VALUES ('MI','610', '60','minute','i', 'time', 1); +INSERT INTO llx_c_units (code, sortorder, scale, label, short_label, unit_type, active) VALUES ('H', '620', '3600','hour','h', 'time', 1); +INSERT INTO llx_c_units (code, sortorder, scale, label, short_label, unit_type, active) VALUES ('D', '630', '86400','day','d', 'time', 1); +INSERT INTO llx_c_units (code, sortorder, scale, label, short_label, unit_type, active) VALUES ('W', '640', '604800','week','w', 'time', 1); +INSERT INTO llx_c_units (code, sortorder, scale, label, short_label, unit_type, active) VALUES ('MO','650', '2629800','month','m', 'time', 1); +INSERT INTO llx_c_units (code, sortorder, scale, label, short_label, unit_type, active) VALUES ('Y', '660','31557600','year','y', 'time', 1); From ce37323f697be20d84d03173238b1e8dbdc680e1 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 13 Oct 2021 14:14:30 +0200 Subject: [PATCH 0861/1460] FIX avoid non-numeric warning --- htdocs/core/lib/invoice.lib.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index 193c4c3acb7..7c0dbbd084c 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -518,8 +518,10 @@ function getNumberInvoicesPieChart($mode) $dataseries[$i]=array($langs->trans('NbOfOpenInvoices'), $obj->nblate30, $obj->nblate15 - $obj->nblate30, $obj->nblatenow - $obj->nblate15, $obj->nbnotlatenow - $obj->nbnotlate15, $obj->nbnotlate15 - $obj->nbnotlate30, $obj->nbnotlate30); $i++; } - foreach ($dataseries[0] as $key=>$value) { - $total += $value; + if (!empty($dataseries[0])) { + foreach ($dataseries[0] as $key=>$value) { + $total += $value; + } } $legend = array( $langs->trans('InvoiceLate30Days'), From f14de50bd787a932c9a15eced029467322395292 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 13 Oct 2021 14:26:43 +0200 Subject: [PATCH 0862/1460] FIX check if numeric value --- htdocs/core/lib/invoice.lib.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index 7c0dbbd084c..573f27c1eee 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -519,8 +519,10 @@ function getNumberInvoicesPieChart($mode) $i++; } if (!empty($dataseries[0])) { - foreach ($dataseries[0] as $key=>$value) { - $total += $value; + foreach ($dataseries[0] as $key => $value) { + if (is_numeric($value)) { + $total += $value; + } } } $legend = array( From 230af380109061ca4d2e1a5e5900f72a556f1562 Mon Sep 17 00:00:00 2001 From: javieralapps4up Date: Wed, 13 Oct 2021 14:34:50 +0200 Subject: [PATCH 0863/1460] Update factures.php When the list is greater than $ conf-> liste_limit, no more pages are output --- htdocs/compta/prelevement/factures.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index c00c29e1c39..17755b535ff 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -220,6 +220,9 @@ if ($resql) { $num = $db->num_rows($resql); $i = 0; + if ($limit > 0 && $limit != $conf->liste_limit) { + $param.='&limit='.urlencode($limit); + } $param = "&id=".urlencode($id); // Lines of title fields From d264bbca3c43b10507c486c1e046768236a1afbb Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 13 Oct 2021 12:36:58 +0000 Subject: [PATCH 0864/1460] Fixing style errors. --- htdocs/compta/prelevement/factures.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index 17755b535ff..e5483a6c2fe 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -221,8 +221,8 @@ if ($resql) { $i = 0; if ($limit > 0 && $limit != $conf->liste_limit) { - $param.='&limit='.urlencode($limit); - } + $param.='&limit='.urlencode($limit); + } $param = "&id=".urlencode($id); // Lines of title fields From b612815aed93e514bed30678e07aa82bc5d7451b Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 13 Oct 2021 14:43:42 +0200 Subject: [PATCH 0865/1460] FIX wrong accented characters with DolGraph --- htdocs/contrat/class/contrat.class.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index a7a42ca7350..a23a620359e 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -2770,20 +2770,20 @@ class ContratLigne extends CommonObjectLine $langs->load("contracts"); if ($status == self::STATUS_INITIAL) { - $labelStatus = $langs->trans("ServiceStatusInitial"); - $labelStatusShort = $langs->trans("ServiceStatusInitial"); + $labelStatus = $langs->transnoentities("ServiceStatusInitial"); + $labelStatusShort = $langs->transnoentities("ServiceStatusInitial"); } elseif ($status == self::STATUS_OPEN && $expired == -1) { - $labelStatus = $langs->trans("ServiceStatusRunning"); - $labelStatusShort = $langs->trans("ServiceStatusRunning"); + $labelStatus = $langs->transnoentities("ServiceStatusRunning"); + $labelStatusShort = $langs->transnoentities("ServiceStatusRunning"); } elseif ($status == self::STATUS_OPEN && $expired == 0) { - $labelStatus = $langs->trans("ServiceStatusNotLate"); - $labelStatusShort = $langs->trans("ServiceStatusNotLateShort"); + $labelStatus = $langs->transnoentities("ServiceStatusNotLate"); + $labelStatusShort = $langs->transnoentities("ServiceStatusNotLateShort"); } elseif ($status == self::STATUS_OPEN && $expired == 1) { - $labelStatus = $langs->trans("ServiceStatusLate"); - $labelStatusShort = $langs->trans("ServiceStatusLateShort"); + $labelStatus = $langs->transnoentities("ServiceStatusLate"); + $labelStatusShort = $langs->transnoentities("ServiceStatusLateShort"); } elseif ($status == self::STATUS_CLOSED) { - $labelStatus = $langs->trans("ServiceStatusClosed"); - $labelStatusShort = $langs->trans("ServiceStatusClosed"); + $labelStatus = $langs->transnoentities("ServiceStatusClosed"); + $labelStatusShort = $langs->transnoentities("ServiceStatusClosed"); } $statusType = 'status'.$status; From 3c33770f00955c4460ab7a7739bfa614d5974628 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Wed, 13 Oct 2021 15:30:49 +0200 Subject: [PATCH 0866/1460] Fix member creation from thirdparty extrafields --- htdocs/adherents/card.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 7199423669a..e54ac0bc31a 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -790,10 +790,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } if (!empty($socid)) { - $object = new Societe($db); - if ($socid > 0) $object->fetch($socid); + $soc = new Societe($db); + if ($socid > 0) $soc->fetch($socid); - if (!($object->id > 0)) { + if (!($soc->id > 0)) { $langs->load("errors"); print($langs->trans('ErrorRecordNotFound')); exit; @@ -877,7 +877,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print "\n"; // Company - print ''.$langs->trans("Company").''; + print ''.$langs->trans("Company").''; // Civility print ''.$langs->trans("UserTitle").''; @@ -901,32 +901,32 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // EMail print ''.($conf->global->ADHERENT_MAIL_REQUIRED ? '' : '').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED ? '' : '').''; - print ''.img_picto('', 'object_email').' '; + print ''.img_picto('', 'object_email').' '; // Address print ''.$langs->trans("Address").''; - print ''; + print ''; print ''; // Zip / Town print ''.$langs->trans("Zip").' / '.$langs->trans("Town").''; - print $formcompany->select_ziptown((GETPOSTISSET('zipcode') ? GETPOST('zipcode', 'alphanohtml') : $object->zip), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6); + print $formcompany->select_ziptown((GETPOSTISSET('zipcode') ? GETPOST('zipcode', 'alphanohtml') : $soc->zip), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6); print ' '; - print $formcompany->select_ziptown((GETPOSTISSET('town') ? GETPOST('town', 'alphanohtml') : $object->town), 'town', array('zipcode', 'selectcountry_id', 'state_id')); + print $formcompany->select_ziptown((GETPOSTISSET('town') ? GETPOST('town', 'alphanohtml') : $soc->town), 'town', array('zipcode', 'selectcountry_id', 'state_id')); print ''; // Country $object->country_id = $object->country_id ? $object->country_id : $mysoc->country_id; print ''.$langs->trans('Country').''; - print $form->select_country(GETPOSTISSET('country_id') ? GETPOST('country_id', 'alpha') : $object->country_id, 'country_id'); + print $form->select_country(GETPOSTISSET('country_id') ? GETPOST('country_id', 'alpha') : $soc->country_id, 'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print ''; // State if (empty($conf->global->MEMBER_DISABLE_STATE)) { print ''.$langs->trans('State').''; - if ($object->country_id) { - print $formcompany->select_state(GETPOSTISSET('state_id') ? GETPOST('state_id', 'int') : $object->state_id, $object->country_code); + if ($soc->country_id) { + print $formcompany->select_state(GETPOSTISSET('state_id') ? GETPOST('state_id', 'int') : $soc->state_id, $soc->country_code); } else { print $countrynotdefined; } @@ -935,7 +935,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Pro phone print ''.$langs->trans("PhonePro").''; - print ''.img_picto('', 'object_phoning').' '; + print ''.img_picto('', 'object_phoning').' '; // Personal phone print ''.$langs->trans("PhonePerso").''; From 5d7587259d88e17df0c49f63d3bf791f239b62e7 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 13 Oct 2021 21:21:16 +0200 Subject: [PATCH 0867/1460] FIX Accountancy - If deposit invoice is used, force binding in deposit accounting account to solve transaction --- htdocs/accountancy/customer/list.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 5ce9f5e13e8..2be7cd5f4ca 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -637,11 +637,15 @@ if ($result) { } // Manage Deposit - if ($objp->description == "(DEPOSIT)") { - $accountdeposittoventilated = new AccountingAccount($db); - $accountdeposittoventilated->fetch('', $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT, 1); - $objp->code_sell_l = $accountdeposittoventilated->ref; - $objp->aarowid_suggest = $accountdeposittoventilated->rowid; + if (!empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT)) { + if ($objp->description == "(DEPOSIT)" || $objp->ftype == $facture_static::TYPE_DEPOSIT) { + $accountdeposittoventilated = new AccountingAccount($db); + $accountdeposittoventilated->fetch('', $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT, 1); + $objp->code_sell_l = $accountdeposittoventilated->ref; + $objp->code_sell_p = ''; + $objp->code_sell_t = ''; + $objp->aarowid_suggest = $accountdeposittoventilated->rowid; + } } if (!empty($objp->code_sell_p)) { From 9e3a00521d8a1f7e4daa221cce5d2f393bee29ef Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 13 Oct 2021 21:36:04 +0200 Subject: [PATCH 0868/1460] FIX also on customer index for automatic binding --- htdocs/accountancy/customer/index.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index 0ee9c865603..7dc88a6939a 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -170,6 +170,8 @@ if ($action == 'validatehistory') { } else { $num_lines = $db->num_rows($result); + $facture_static = new Facture($db); + $isSellerInEEC = isInEEC($mysoc); $i = 0; @@ -213,6 +215,18 @@ if ($action == 'validatehistory') { } } + // Manage Deposit + if (!empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT)) { + if ($objp->description == "(DEPOSIT)" || $objp->ftype == $facture_static::TYPE_DEPOSIT) { + $accountdeposittoventilated = new AccountingAccount($db); + $accountdeposittoventilated->fetch('', $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT, 1); + $objp->code_sell_l = $accountdeposittoventilated->ref; + $objp->code_sell_p = ''; + $objp->code_sell_t = ''; + $objp->aarowid_suggest = $accountdeposittoventilated->rowid; + } + } + if ($objp->aarowid_suggest > 0) { $sqlupdate = "UPDATE ".MAIN_DB_PREFIX."facturedet"; $sqlupdate .= " SET fk_code_ventilation = ".((int) $objp->aarowid_suggest); From 3438a4a9f695b9526604f3a0da5857858fe33f31 Mon Sep 17 00:00:00 2001 From: Benjamin Chantalat <74144396+PyroShape@users.noreply.github.com> Date: Thu, 14 Oct 2021 09:33:26 +0200 Subject: [PATCH 0869/1460] Add the module reception to the calcul of virtual stock --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index acb66eb1ebb..c7a48479f60 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5281,7 +5281,7 @@ class Product extends CommonObject } $stock_commande_fournisseur = $this->stats_commande_fournisseur['qty']; } - if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && empty($conf->reception->enabled)) { + if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) || !empty($conf->reception->enabled)) { $filterStatus = '4'; if (isset($includedraftpoforvirtual)) { $filterStatus = '0,'.$filterStatus; From 371c75e76a1be84fc4ce497f2d7ccb70256d41f6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Oct 2021 11:58:21 +0200 Subject: [PATCH 0870/1460] FIX list of categories in stats of supplier invoices --- htdocs/compta/facture/stats/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 49f9be88ac6..7482faebad8 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -283,7 +283,7 @@ if (! empty($conf->category->enabled)) { $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Supplier")); } print ''.$cat_label.''; - $cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, null, 'parent', null, null, 1); + $cate_arbo = $form->select_all_categories($cat_type, null, 'parent', null, null, 1); print $form->multiselectarray('custcats', $cate_arbo, GETPOST('custcats', 'array'), null, null, null, null, "90%"); //print $formother->select_categories($cat_type, $categ_id, 'categ_id', true); print ''; From 27e8b17aafa008271691910ca40622e070ce577d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Oct 2021 14:49:01 +0200 Subject: [PATCH 0871/1460] NEW Add STOCK_MOVEMENT_LIST_HIDE_UNIT_PRICE to hide unit price on movement list. --- htdocs/product/stock/movement_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index bdd22c313ee..f3b9ea40559 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -132,7 +132,7 @@ $arrayfields = array( 'origin'=>array('label'=>"Origin", 'checked'=>1, 'position'=>155), 'm.fk_projet'=>array('label'=>'Project', 'checked'=>0, 'position'=>180), 'm.value'=>array('label'=>"Qty", 'checked'=>1, 'position'=>200), - 'm.price'=>array('label'=>"UnitPurchaseValue", 'checked'=>0, 'position'=>210) + 'm.price'=>array('label'=>"UnitPurchaseValue", 'checked'=>0, 'position'=>210, 'enabled'=>empty($conf->global->STOCK_MOVEMENT_LIST_HIDE_UNIT_PRICE)) //'m.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), //'m.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500) ); From db3d16f080a1151ab581920553b6d4dd227aed42 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Oct 2021 15:43:35 +0200 Subject: [PATCH 0872/1460] Fix filter tag for supplier invoice statistics --- htdocs/compta/facture/stats/index.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 7482faebad8..fb47a3eb788 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -92,18 +92,15 @@ print load_fiche_titre($title, '', $picto); dol_mkdir($dir); $stats = new FactureStats($db, $socid, $mode, ($userid > 0 ? $userid : 0), ($typent_id > 0 ? $typent_id : 0), ($categ_id > 0 ? $categ_id : 0)); -if ($mode == 'customer') -{ - if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND f.fk_statut IN ('.$db->escape($object_status).')'; +if ($mode == 'customer' || $mode == 'supplier') { + if ($object_status != '' && $object_status >= 0) { + $stats->where .= ' AND f.fk_statut IN ('.$db->escape($object_status).')'; + } if (is_array($custcats) && !empty($custcats)) { $stats->from .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_societe as cat ON (f.fk_soc = cat.fk_soc)'; $stats->where .= ' AND cat.fk_categorie IN ('.implode(',', $custcats).')'; } } -if ($mode == 'supplier') -{ - if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND f.fk_statut IN ('.$db->escape($object_status).')'; -} // Build graphic number of object // $data = array(array('Lib',val1,val2,val3),...) From 3875d26a2feb7f6fb39cc158101521f7b563b617 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Oct 2021 15:55:12 +0200 Subject: [PATCH 0873/1460] Fix filter for supplierinvoice stats --- htdocs/compta/facture/stats/index.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index fb47a3eb788..03fcf5b37d0 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -92,7 +92,7 @@ print load_fiche_titre($title, '', $picto); dol_mkdir($dir); $stats = new FactureStats($db, $socid, $mode, ($userid > 0 ? $userid : 0), ($typent_id > 0 ? $typent_id : 0), ($categ_id > 0 ? $categ_id : 0)); -if ($mode == 'customer' || $mode == 'supplier') { +if ($mode == 'customer') { if ($object_status != '' && $object_status >= 0) { $stats->where .= ' AND f.fk_statut IN ('.$db->escape($object_status).')'; } @@ -101,6 +101,16 @@ if ($mode == 'customer' || $mode == 'supplier') { $stats->where .= ' AND cat.fk_categorie IN ('.implode(',', $custcats).')'; } } +if ($mode == 'supplier') { + if ($object_status != '' && $object_status >= 0) { + $stats->where .= ' AND f.fk_statut IN ('.$db->escape($object_status).')'; + } + if (is_array($custcats) && !empty($custcats)) { + $stats->from .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_fournisseur as cat ON (f.fk_soc = cat.fk_soc)'; + $stats->where .= ' AND cat.fk_categorie IN ('.implode(',', $custcats).')'; + } + +} // Build graphic number of object // $data = array(array('Lib',val1,val2,val3),...) From a6c3c6b7ec8f1b3d30a364234ac7376fedda677e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Oct 2021 15:56:01 +0200 Subject: [PATCH 0874/1460] url --- htdocs/compta/facture/stats/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 5fe028e1268..088899956e4 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -119,10 +119,10 @@ $data = $stats->getNbByMonthWithPrevYear($endyear, $startyear); $filenamenb = $dir."/invoicesnbinyear-".$year.".png"; if ($mode == 'customer') { - $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesnbinyear-'.$year.'.png'; + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesnbinyear-'.$year.'.png'; } if ($mode == 'supplier') { - $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicesnbinyear-'.$year.'.png'; + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicesnbinyear-'.$year.'.png'; } $px1 = new DolGraph(); From 5d22eeeff2b946573481983953b446326f89539a Mon Sep 17 00:00:00 2001 From: lvessiller Date: Thu, 14 Oct 2021 16:06:22 +0200 Subject: [PATCH 0875/1460] FIX user date timezone offset --- htdocs/core/lib/functions.lib.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index e0dcc51917b..3ef328924f5 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2284,8 +2284,17 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs = } elseif ($tzoutput == 'tzuser' || $tzoutput == 'tzuserrel') { $to_gmt = true; $offsettzstring = (empty($_SESSION['dol_tz_string']) ? 'UTC' : $_SESSION['dol_tz_string']); // Example 'Europe/Berlin' or 'Indian/Reunion' - $offsettz = (empty($_SESSION['dol_tz']) ? 0 : $_SESSION['dol_tz']) * 60 * 60; // Will not be used anymore - $offsetdst = (empty($_SESSION['dol_dst']) ? 0 : $_SESSION['dol_dst']) * 60 * 60; // Will not be used anymore + + if (class_exists('DateTimeZone')) { + $user_date_tz = new DateTimeZone($offsettzstring); + $user_dt = new DateTime(); + $user_dt->setTimezone($user_date_tz); + $user_dt->setTimestamp($time); + $offsettz = $user_dt->getOffset(); + } else { + $offsettz = (empty($_SESSION['dol_tz']) ? 0 : $_SESSION['dol_tz']) * 60 * 60; // Will not be used anymore + $offsetdst = (empty($_SESSION['dol_dst']) ? 0 : $_SESSION['dol_dst']) * 60 * 60; // Will not be used anymore + } } } } From ff7727466ad129070c0b56965eb0457f0ddf1795 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Thu, 14 Oct 2021 17:13:44 +0200 Subject: [PATCH 0876/1460] Function updateExtrafield : replace empty value to null --- htdocs/core/class/commonobject.class.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 5a5e1a58928..50c6f1893ea 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5492,7 +5492,6 @@ abstract class CommonObject } $sql .= ")"; - $resql = $this->db->query($sql); if (!$resql) { @@ -5792,7 +5791,7 @@ abstract class CommonObject } if ($linealreadyfound) { - if ($this->array_options["options_".$key] === null) { + if ($this->array_options["options_".$key] === '') { $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element."_extrafields SET ".$key." = null"; } else { $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element."_extrafields SET ".$key." = '".$this->db->escape($this->array_options["options_".$key])."'"; From 3d62ee22d323f821b81e725e60c32bfdc1585ef1 Mon Sep 17 00:00:00 2001 From: Henry Date: Fri, 15 Oct 2021 11:13:40 +0800 Subject: [PATCH 0877/1460] Supplier Invoice Payment List fix the missing multicurrency payments and remainders --- htdocs/fourn/facture/paiement.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index f0967453701..1dd6f0a0f12 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -642,13 +642,19 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) { - print price($objp->multicurrency_am); + print price($sign * $multicurrency_payment); + if ($multicurrency_creditnotes) { + print '+'.price($multicurrency_creditnotes); + } + if ($multicurrency_deposits) { + print '+'.price($multicurrency_deposits); + } } print ''; print ''; if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) { - print price($objp->multicurrency_total_ttc - $objp->multicurrency_am); + print price($sign * $multicurrency_remaintopay); } print ''; } From 316bc16634ffc8abb76bae5cb3b8c8e7af59a86d Mon Sep 17 00:00:00 2001 From: Henry Date: Fri, 15 Oct 2021 15:05:13 +0800 Subject: [PATCH 0878/1460] Update card.php --- htdocs/fourn/facture/card.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 80f868f3484..8a148bbb666 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2406,6 +2406,15 @@ if ($action == 'create') { // $resteapayer=bcadd($resteapayer,$totalavoir,$conf->global->MAIN_MAX_DECIMALS_TOT); $resteapayer = price2num($object->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits, 'MT'); + // Multicurrency + if (!empty($conf->multicurrency->enabled)) { + $multicurrency_totalpaye = $object->getSommePaiement(1); + $multicurrency_totalcreditnotes = $object->getSumCreditNotesUsed(1); + $multicurrency_totaldeposits = $object->getSumDepositsUsed(1); + $multicurrency_resteapayer = price2num($object->multicurrency_total_ttc - $multicurrency_totalpaye - $multicurrency_totalcreditnotes - $multicurrency_totaldeposits, 'MT'); + $resteapayer = price2num($multicurrency_resteapayer / $object->multicurrency_tx, 'MT'); + } + if ($object->paye) { $resteapayer = 0; } From 0cb19726740a7e78c7e3e8a34e81f37bf3acde86 Mon Sep 17 00:00:00 2001 From: Henry Date: Fri, 15 Oct 2021 15:07:48 +0800 Subject: [PATCH 0879/1460] Update card.php --- htdocs/compta/facture/card.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 83c8ec8d718..5541725a480 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3844,6 +3844,15 @@ if ($action == 'create') { // $resteapayer=bcadd($object->total_ttc,$totalpaye,$conf->global->MAIN_MAX_DECIMALS_TOT); // $resteapayer=bcadd($resteapayer,$totalavoir,$conf->global->MAIN_MAX_DECIMALS_TOT); $resteapayer = price2num($object->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits, 'MT'); + + // Multicurrency + if (!empty($conf->multicurrency->enabled)) { + $multicurrency_totalpaye = $object->getSommePaiement(1); + $multicurrency_totalcreditnotes = $object->getSumCreditNotesUsed(1); + $multicurrency_totaldeposits = $object->getSumDepositsUsed(1); + $multicurrency_resteapayer = price2num($object->multicurrency_total_ttc - $multicurrency_totalpaye - $multicurrency_totalcreditnotes - $multicurrency_totaldeposits, 'MT'); + $resteapayer = price2num($multicurrency_resteapayer / $object->multicurrency_tx, 'MT'); + } if ($object->paye) { $resteapayer = 0; From fb79aaeb0c2a4d187cc6aaa3c40430c975c125a2 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 15 Oct 2021 07:19:49 +0000 Subject: [PATCH 0880/1460] Fixing style errors. --- htdocs/compta/facture/card.php | 2 +- htdocs/fourn/facture/card.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 5541725a480..56e66b9f759 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3844,7 +3844,7 @@ if ($action == 'create') { // $resteapayer=bcadd($object->total_ttc,$totalpaye,$conf->global->MAIN_MAX_DECIMALS_TOT); // $resteapayer=bcadd($resteapayer,$totalavoir,$conf->global->MAIN_MAX_DECIMALS_TOT); $resteapayer = price2num($object->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits, 'MT'); - + // Multicurrency if (!empty($conf->multicurrency->enabled)) { $multicurrency_totalpaye = $object->getSommePaiement(1); diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 8a148bbb666..79a93cf3b0c 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2414,7 +2414,7 @@ if ($action == 'create') { $multicurrency_resteapayer = price2num($object->multicurrency_total_ttc - $multicurrency_totalpaye - $multicurrency_totalcreditnotes - $multicurrency_totaldeposits, 'MT'); $resteapayer = price2num($multicurrency_resteapayer / $object->multicurrency_tx, 'MT'); } - + if ($object->paye) { $resteapayer = 0; } From 412746ec8fea883dc437e6f3135d33773bc02be9 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Fri, 15 Oct 2021 10:18:32 +0200 Subject: [PATCH 0881/1460] NEW : we need to be able to put more filters on deleteByParentField() function --- htdocs/core/class/commonobject.class.php | 24 ++++++++++++++++++++++-- htdocs/hrm/class/job.class.php | 2 +- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 37083cdf5f8..2bf6d758435 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -9056,10 +9056,13 @@ abstract class CommonObject $className = str_replace('@', '', $deleteFromObject[0]); $filePath = $deleteFromObject[1]; $columnName = $deleteFromObject[2]; + $TMoreSQL = array(); + $more_sql = $deleteFromObject[3]; + if(!empty($more_sql)) $TMoreSQL['customsql'] = $more_sql; if (dol_include_once($filePath)) { $childObject = new $className($this->db); if (method_exists($childObject, 'deleteByParentField')) { - $result = $childObject->deleteByParentField($this->id, $columnName); + $result = $childObject->deleteByParentField($this->id, $columnName, $TMoreSQL); if ($result < 0) { $error++; $this->errors[] = $childObject->error; @@ -9144,7 +9147,7 @@ abstract class CommonObject * @return int <0 if KO, >0 if OK * @throws Exception */ - public function deleteByParentField($parentId = 0, $parentField = '') + public function deleteByParentField($parentId = 0, $parentField = '', $filter=array(), $filtermode="AND") { global $user; @@ -9157,6 +9160,23 @@ abstract class CommonObject $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX.$this->table_element; $sql .= " WHERE ".$parentField." = ".(int) $parentId; + // Manage filter + $sqlwhere = array(); + if (count($filter) > 0) { + foreach ($filter as $key => $value) { + if ($key == 'customsql') { + $sqlwhere[] = $value; + } elseif (strpos($value, '%') === false) { + $sqlwhere[] = $key.' IN ('.$this->db->sanitize($this->db->escape($value)).')'; + } else { + $sqlwhere[] = $key.' LIKE \'%'.$this->db->escape($value).'%\''; + } + } + } + if (count($sqlwhere) > 0) { + $sql .= " AND (".implode(" ".$filtermode." ", $sqlwhere).")"; + } + $resql = $this->db->query($sql); if (!$resql) { $this->errors[] = $this->db->lasterror(); diff --git a/htdocs/hrm/class/job.class.php b/htdocs/hrm/class/job.class.php index 4ff5ccbe303..01cc9260c61 100644 --- a/htdocs/hrm/class/job.class.php +++ b/htdocs/hrm/class/job.class.php @@ -154,7 +154,7 @@ class Job extends CommonObject // * If name matches '@ClassNAme:FilePathClass;ParentFkFieldName' it will // * call method deleteByParentField(parentId, ParentFkFieldName) to fetch and delete child object // */ - // protected $childtablesoncascade = array('hrm_jobdet'); + protected $childtablesoncascade = array("@SkillRank:hrm/class/skillrank.class.php:fk_object:objecttype='job'"); // /** // * @var JobLine[] Array of subtable lines From 5f4410468d66efaae1da08606f20a29429c1d591 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 15 Oct 2021 10:24:56 +0200 Subject: [PATCH 0882/1460] add filed budget in task --- htdocs/core/lib/project.lib.php | 17 +++++++- .../install/mysql/migration/14.0.0-15.0.0.sql | 2 + .../install/mysql/tables/llx_projet_task.sql | 1 + htdocs/projet/class/task.class.php | 23 ++++++++++- htdocs/projet/tasks.php | 29 +++++++++++++- htdocs/projet/tasks/list.php | 39 ++++++++++++++++++- htdocs/projet/tasks/task.php | 12 ++++++ 7 files changed, 119 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 9d6b9c48192..b7c2279188d 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -572,7 +572,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t $numlines = count($lines); // We declare counter as global because we want to edit them into recursive call - global $total_projectlinesa_spent, $total_projectlinesa_planned, $total_projectlinesa_spent_if_planned, $total_projectlinesa_declared_if_planned, $total_projectlinesa_tobill, $total_projectlinesa_billed; + global $total_projectlinesa_spent, $total_projectlinesa_planned, $total_projectlinesa_spent_if_planned, $total_projectlinesa_declared_if_planned, $total_projectlinesa_tobill, $total_projectlinesa_billed, $total_budget_amount; if ($level == 0) { $total_projectlinesa_spent = 0; @@ -581,6 +581,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t $total_projectlinesa_declared_if_planned = 0; $total_projectlinesa_tobill = 0; $total_projectlinesa_billed = 0; + $total_budget_amount = 0; } for ($i = 0; $i < $numlines; $i++) { @@ -651,6 +652,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t $taskstatic->datee = $lines[$i]->date_end; // deprecated $taskstatic->planned_workload = $lines[$i]->planned_workload; $taskstatic->duration_effective = $lines[$i]->duration; + $taskstatic->budget_amount = $lines[$i]->budget_amount; if ($showproject) { @@ -850,6 +852,12 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t } print ''; }*/ + if (count($arrayfields) > 0 && !empty($arrayfields['c.assigned']['checked'])) { + print ''; + print price($lines[$i]->budget_amount, 0, $langs, 1, 0, 0, $conf->currency); + $total_budget_amount += $lines[$i]->budget_amount; + print ''; + } // Contacts of task if (count($arrayfields) > 0 && !empty($arrayfields['c.assigned']['checked'])) { @@ -1021,6 +1029,13 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t print ''; } } + + if (count($arrayfields) > 0 && !empty($arrayfields['t.budget_amount']['checked'])) { + print ''; + price($total_budget_amount, 0, $langs, 1, 0, 0, $conf->currency); + print ''; + } + // Contacts of task for backward compatibility, if (!empty($conf->global->PROJECT_SHOW_CONTACTS_IN_LIST)) { print ''; diff --git a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql index 56ac0290292..44f7d08bab1 100644 --- a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql +++ b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql @@ -374,3 +374,5 @@ ALTER TABLE llx_hrm_skillrank ADD CONSTRAINT llx_hrm_skillrank_fk_user_creat FOR -- Manage accountancy auxiliary account for thirdparties per entity ALTER TABLE llx_societe_perentity ADD COLUMN accountancy_code_customer varchar(24) AFTER entity; -- equivalent to code_compta in llx_societe ALTER TABLE llx_societe_perentity ADD COLUMN accountancy_code_supplier varchar(24) AFTER accountancy_code_customer; -- equivalent to code_compta_supplier in llx_societe + +ALTER TABLE llx_projet_task ADD COLUMN budget_amount double(24,8) AFTER priority; diff --git a/htdocs/install/mysql/tables/llx_projet_task.sql b/htdocs/install/mysql/tables/llx_projet_task.sql index 01edb857738..721dbf8355f 100644 --- a/htdocs/install/mysql/tables/llx_projet_task.sql +++ b/htdocs/install/mysql/tables/llx_projet_task.sql @@ -35,6 +35,7 @@ create table llx_projet_task planned_workload real DEFAULT 0, progress integer DEFAULT 0, -- percentage increase priority integer DEFAULT 0, -- priority + budget_amount double(24,8), fk_user_creat integer, -- user who created the task fk_user_modif integer, -- user who modify the task fk_user_valid integer, -- user who validated the task diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 085d092c2ac..240552ecc48 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -121,6 +121,16 @@ class Task extends CommonObject public $comments = array(); + /** + * @var float budget_amount + */ + public $budget_amount; + + /** + * @var float project_budget_amount + */ + public $project_budget_amount; + public $oldcopy; @@ -172,6 +182,7 @@ class Task extends CommonObject $sql .= ", datee"; $sql .= ", planned_workload"; $sql .= ", progress"; + $sql .= ", budget_amount"; $sql .= ") VALUES ("; $sql .= ((int) $conf->entity); $sql .= ", ".((int) $this->fk_project); @@ -185,6 +196,7 @@ class Task extends CommonObject $sql .= ", ".($this->date_end ? "'".$this->db->idate($this->date_end)."'" : 'null'); $sql .= ", ".(($this->planned_workload != '' && $this->planned_workload >= 0) ? ((int) $this->planned_workload) : 'null'); $sql .= ", ".(($this->progress != '' && $this->progress >= 0) ? ((int) $this->progress) : 'null'); + $sql .= ", ".(($this->budget_amount != '' && $this->budget_amount >= 0) ? ((int) $this->budget_amount) : 'null'); $sql .= ")"; $this->db->begin(); @@ -261,6 +273,7 @@ class Task extends CommonObject $sql .= " t.fk_user_valid,"; $sql .= " t.fk_statut,"; $sql .= " t.progress,"; + $sql .= " t.budget_amount,"; $sql .= " t.priority,"; $sql .= " t.note_private,"; $sql .= " t.note_public,"; @@ -304,6 +317,7 @@ class Task extends CommonObject $this->fk_user_valid = $obj->fk_user_valid; $this->fk_statut = $obj->fk_statut; $this->progress = $obj->progress; + $this->budget_amount = $obj->budget_amount; $this->priority = $obj->priority; $this->note_private = $obj->note_private; $this->note_public = $obj->note_public; @@ -366,6 +380,9 @@ class Task extends CommonObject if (isset($this->planned_workload)) { $this->planned_workload = trim($this->planned_workload); } + if (isset($this->budget_amount)) { + $this->budget_amount = trim($this->budget_amount); + } // Check parameters // Put here code to add control on parameters values @@ -382,6 +399,7 @@ class Task extends CommonObject $sql .= " dateo=".($this->date_start != '' ? "'".$this->db->idate($this->date_start)."'" : 'null').","; $sql .= " datee=".($this->date_end != '' ? "'".$this->db->idate($this->date_end)."'" : 'null').","; $sql .= " progress=".(($this->progress != '' && $this->progress >= 0) ? $this->progress : 'null').","; + $sql .= " budget_amount=".(($this->budget_amount != '' && $this->budget_amount >= 0) ? $this->budget_amount : 'null').","; $sql .= " rang=".((!empty($this->rang)) ? $this->rang : "0"); $sql .= " WHERE rowid=".((int) $this->id); @@ -791,8 +809,9 @@ class Task extends CommonObject $sql .= " t.rowid as taskid, t.ref as taskref, t.label, t.description, t.fk_task_parent, t.duration_effective, t.progress, t.fk_statut as status,"; $sql .= " t.dateo as date_start, t.datee as date_end, t.planned_workload, t.rang,"; $sql .= " t.description, "; + $sql .= " t.budget_amount, "; $sql .= " s.rowid as thirdparty_id, s.nom as thirdparty_name, s.email as thirdparty_email,"; - $sql .= " p.fk_opp_status, p.opp_amount, p.opp_percent, p.budget_amount"; + $sql .= " p.fk_opp_status, p.opp_amount, p.opp_percent, p.budget_amount as project_budget_amount"; if (!empty($extrafields->attributes['projet']['label'])) { foreach ($extrafields->attributes['projet']['label'] as $key => $val) { $sql .= ($extrafields->attributes['projet']['type'][$key] != 'separate' ? ",efp.".$key." as options_".$key : ''); @@ -897,6 +916,7 @@ class Task extends CommonObject $sql .= " t.rowid, t.ref, t.label, t.description, t.fk_task_parent, t.duration_effective, t.progress, t.fk_statut,"; $sql .= " t.dateo, t.datee, t.planned_workload, t.rang,"; $sql .= " t.description, "; + $sql .= " t.budget_amount, "; $sql .= " s.rowid, s.nom, s.email,"; $sql .= " p.fk_opp_status, p.opp_amount, p.opp_percent, p.budget_amount"; if (!empty($extrafields->attributes['projet']['label'])) { @@ -950,6 +970,7 @@ class Task extends CommonObject $tasks[$i]->opp_amount = $obj->opp_amount; $tasks[$i]->opp_percent = $obj->opp_percent; $tasks[$i]->budget_amount = $obj->budget_amount; + $tasks[$i]->project_budget_amount = $obj->project_budget_amount; $tasks[$i]->usage_bill_time = $obj->usage_bill_time; $tasks[$i]->label = $obj->label; diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 2a814cd9cc5..ebd17ca9dd5 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -82,6 +82,7 @@ $search_planedworkload = GETPOST('search_planedworkload'); $search_timespend = GETPOST('search_timespend'); $search_progresscalc = GETPOST('search_progresscalc'); $search_progressdeclare = GETPOST('search_progressdeclare'); +$search_task_budget_amount = GETPOST('search_task_budget_amount'); $search_date_start_startmonth = GETPOST('search_date_start_startmonth', 'int'); $search_date_start_startyear = GETPOST('search_date_start_startyear', 'int'); @@ -142,6 +143,7 @@ $diroutputmassaction = $conf->projet->dir_output.'/tasks/temp/massgeneration/'.$ $hookmanager->initHooks(array('projecttaskscard', 'globalcard')); $progress = GETPOST('progress', 'int'); +$budget_amount = GETPOST('budget_amount', 'int'); $label = GETPOST('label', 'alpha'); $description = GETPOST('description', 'restricthtml'); $planned_workloadhour = (GETPOST('planned_workloadhour', 'int') ?GETPOST('planned_workloadhour', 'int') : 0); @@ -160,7 +162,8 @@ $arrayfields = array( 't.progress_calculated'=>array('label'=>$langs->trans("ProgressCalculated"), 'checked'=>1, 'position'=>8), 't.progress'=>array('label'=>$langs->trans("ProgressDeclared"), 'checked'=>1, 'position'=>9), 't.progress_summary'=>array('label'=>$langs->trans("TaskProgressSummary"), 'checked'=>1, 'position'=>10), - 'c.assigned'=>array('label'=>$langs->trans("TaskRessourceLinks"), 'checked'=>1, 'position'=>11), + 't.budget_amount'=>array('label'=>"Budget", 'checked'=>1, 'position'=>11), + 'c.assigned'=>array('label'=>$langs->trans("TaskRessourceLinks"), 'checked'=>1, 'position'=>12), ); if ($object->usage_bill_time) { $arrayfields['t.tobill'] = array('label'=>$langs->trans("TimeToBill"), 'checked'=>0, 'position'=>11); @@ -204,6 +207,7 @@ if (empty($reshook)) { $search_timespend = ''; $search_progresscalc = ''; $search_progressdeclare = ''; + $search_task_budget_amount = ''; $toselect = ''; $search_array_options = array(); $search_date_start_startmonth = ""; @@ -285,6 +289,10 @@ if (!empty($search_progressdeclare)) { $morewherefilterarray[] = natural_search('t.progress', $search_progressdeclare, 1, 1); } +if ($search_task_budget_amount) { + $morewherefilterarray[]= natural_search('t.budget_amount', $search_task_budget_amount, 1); +} + $morewherefilter = ''; if (count($morewherefilterarray) > 0) { $morewherefilter = ' AND '.implode(' AND ', $morewherefilterarray); @@ -338,6 +346,7 @@ if ($action == 'createtask' && $user->rights->projet->creer) { $task->date_start = $date_start; $task->date_end = $date_end; $task->progress = $progress; + $task->budget_amount = $budget_amount; // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost(null, $task); @@ -524,6 +533,9 @@ if ($id > 0 || !empty($ref)) { if ($search_progressdeclare) { $param .= '&search_progressdeclare='.urlencode($search_progressdeclare); } + if ($search_task_budget_amount) { + $param .= '&search_task_budget_amount='.urlencode($search_task_budget_amount); + } if ($optioncss != '') { $param .= '&optioncss='.urlencode($optioncss); } @@ -757,6 +769,10 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third print ''; print ''; + print ''.$langs->trans("Budget").''; + print ''; + print ''; + // Other options $parameters = array(); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $taskstatic, $action); // Note that $action and $object may have been modified by hook @@ -944,6 +960,12 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third } */ + if (!empty($arrayfields['t.budget_amount']['checked'])) { + print ''; + print ''; + print ''; + } + if (!empty($arrayfields['c.assigned']['checked'])) { print ''; print ''; @@ -1005,6 +1027,11 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third print_liste_field_titre("TaskRessourceLinks", $_SERVER["PHP_SELF"], '', '', $param, $sortfield, $sortorder); } */ + + if (!empty($arrayfields['t.budget_amount']['checked'])) { + print_liste_field_titre($arrayfields['t.budget_amount']['label'], $_SERVER["PHP_SELF"], "t.budget_amount", "", $param, '', $sortfield, $sortorder, 'center '); + } + if (!empty($arrayfields['c.assigned']['checked'])) { print_liste_field_titre($arrayfields['c.assigned']['label'], $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'center ', ''); } diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index e6d8e5c6dfa..fc316fb2705 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -65,6 +65,7 @@ $search_task_ref_parent = GETPOST('search_task_ref_parent'); $search_project_user = GETPOST('search_project_user', 'int'); $search_task_user = GETPOST('search_task_user', 'int'); $search_task_progress = GETPOST('search_task_progress'); +$search_task_budget_amount = GETPOST('search_task_budget_amount'); $search_societe = GETPOST('search_societe'); $mine = $_REQUEST['mode'] == 'mine' ? 1 : 0; @@ -154,6 +155,7 @@ $arrayfields = array( 't.progress_calculated'=>array('label'=>"ProgressCalculated", 'checked'=>1, 'position'=>104), 't.progress'=>array('label'=>"ProgressDeclared", 'checked'=>1, 'position'=>105), 't.progress_summary'=>array('label'=>"TaskProgressSummary", 'checked'=>1, 'position'=>106), + 't.budget_amount'=>array('label'=>"Budget", 'checked'=>1, 'position'=>107), 't.tobill'=>array('label'=>"TimeToBill", 'checked'=>0, 'position'=>110), 't.billed'=>array('label'=>"TimeBilled", 'checked'=>0, 'position'=>111), 't.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), @@ -200,6 +202,7 @@ if (empty($reshook)) { $search_task_description = ""; $search_task_ref_parent = ""; $search_task_progress = ""; + $search_task_budget_amount = ""; $search_task_user = -1; $search_project_user = -1; $search_date_startday = ''; @@ -314,6 +317,7 @@ $sql .= " s.nom as name, s.rowid as socid,"; $sql .= " t.datec as date_creation, t.dateo as date_start, t.datee as date_end, t.tms as date_update,"; $sql .= " t.rowid as id, t.ref, t.label, t.planned_workload, t.duration_effective, t.progress, t.fk_statut, "; $sql .= " t.description, t.fk_task_parent"; +$sql .= " ,t.budget_amount"; // We'll need these fields in order to filter by categ if ($search_categ) { $sql .= ", cs.fk_categorie, cs.fk_project"; @@ -390,6 +394,9 @@ if ($search_task_ref_parent) { if ($search_task_progress) { $sql .= natural_search('t.progress', $search_task_progress, 1); } +if ($search_task_budget_amount) { + $sql .= natural_search('t.budget_amount', $search_task_budget_amount, 1); +} if ($search_societe) { $sql .= natural_search('s.nom', $search_societe); } @@ -431,7 +438,7 @@ if (!empty($arrayfields['t.tobill']['checked']) || !empty($arrayfields['t.billed $sql .= " GROUP BY p.rowid, p.ref, p.title, p.fk_statut, p.datee, p.fk_opp_status, p.public, p.fk_user_creat,"; $sql .= " s.nom, s.rowid,"; $sql .= " t.datec, t.dateo, t.datee, t.tms,"; - $sql .= " t.rowid, t.ref, t.label, t.planned_workload, t.duration_effective, t.progress, t.fk_statut"; + $sql .= " t.rowid, t.ref, t.label, t.planned_workload, t.duration_effective, t.progress,t.budget_amount, t.fk_statut"; if ($search_categ) { $sql .= ", cs.fk_categorie, cs.fk_project"; } @@ -521,6 +528,9 @@ if ($search_datelimit_endmonth) { if ($search_datelimit_endyear) { $param .= '&search_datelimit_endyear='.urlencode($search_datelimit_endyear); } +if ($search_task_budget_amount) { + $param .= '&search_task_budget_amount='.urlencode($search_task_budget_amount); +} if ($socid) { $param .= '&socid='.urlencode($socid); } @@ -756,6 +766,11 @@ if (!empty($arrayfields['t.progress']['checked'])) { print ''; print ''; } +if (!empty($arrayfields['t.budget_amount']['checked'])) { + print ''; + print ''; + print ''; +} if (!empty($arrayfields['t.progress_summary']['checked'])) { print ''; @@ -835,6 +850,9 @@ if (!empty($arrayfields['t.progress']['checked'])) { if (!empty($arrayfields['t.progress_summary']['checked'])) { print_liste_field_titre($arrayfields['t.progress_summary']['label'], $_SERVER["PHP_SELF"], "t.progress", "", $param, '', $sortfield, $sortorder, 'center '); } +if (!empty($arrayfields['t.budget_amount']['checked'])) { + print_liste_field_titre($arrayfields['t.budget_amount']['label'], $_SERVER["PHP_SELF"], "t.budget_amount", "", $param, '', $sortfield, $sortorder, 'center '); +} if (!empty($arrayfields['t.tobill']['checked'])) { print_liste_field_titre($arrayfields['t.tobill']['label'], $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'center '); } @@ -877,6 +895,7 @@ while ($i < min($num, $limit)) { $object->description = $obj->description; $object->fk_statut = $obj->fk_statut; $object->progress = $obj->progress; + $object->budget_amount = $obj->budget_amount; $object->date_start = $db->jdate($obj->date_start); $object->date_end = $db->jdate($obj->date_end); $object->planned_workload = $obj->planned_workload; @@ -1116,6 +1135,22 @@ while ($i < min($num, $limit)) { $totalarray['totalprogress_summary'] = $totalarray['nbfield']; } } + if (!empty($arrayfields['t.budget_amount']['checked'])) { + print ''; + print price($object->budget_amount, 0, $langs, 1, 0, 0, $conf->currency); + if (!$i) { + $totalarray['nbfield']++; + } + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 't.budget_amount'; + } + $totalarray['val']['t.budget_amount'] += $obj->budget_amount; + if (!$i) { + $totalarray['totalbudgetamount'] = $totalarray['nbfield']; + } + $totalarray['totalbudgetamount'] += $obj->budget_amount; + print ''; + } // Time not billed if (!empty($arrayfields['t.tobill']['checked'])) { print ''; @@ -1232,6 +1267,8 @@ if (isset($totalarray['totaldurationeffectivefield']) || isset($totalarray['tota print ''.convertSecondToTime($totalarray['totaltobill'], $plannedworkloadoutputformat).''; } elseif ($totalarray['totalbilledfield'] == $i) { print ''.convertSecondToTime($totalarray['totalbilled'], $plannedworkloadoutputformat).''; + } elseif ($totalarray['totalbudgetamount'] == $i) { + print ''.price($totalarray['totalbudgetamount'], 0, $langs, 1, 0, 0, $conf->currency).''; } else { print ''; } diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 2ae9bb7cc80..42280f57c67 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -105,6 +105,7 @@ if ($action == 'update' && !GETPOST("cancel") && $user->rights->projet->creer) { $object->date_start = dol_mktime(GETPOST('dateohour', 'int'), GETPOST('dateomin', 'int'), 0, GETPOST('dateomonth', 'int'), GETPOST('dateoday', 'int'), GETPOST('dateoyear', 'int')); $object->date_end = dol_mktime(GETPOST('dateehour', 'int'), GETPOST('dateemin', 'int'), 0, GETPOST('dateemonth', 'int'), GETPOST('dateeday', 'int'), GETPOST('dateeyear', 'int')); $object->progress = price2num(GETPOST('progress', 'alphanohtml')); + $object->budget_amount = price2num(GETPOST('budget_amount', 'alphanohtml')); // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost(null, $object); @@ -442,6 +443,10 @@ if ($id > 0 || !empty($ref)) { print ''; print ''; + print ''.$langs->trans("Budget").''; + print ''; + print ''; + // Other options $parameters = array(); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook @@ -564,6 +569,13 @@ if ($id > 0 || !empty($ref)) { } print ''; + // Budget + print ''.$langs->trans("Budget").''; + if (strcmp($object->budget_amount, '')) { + print price($object->budget_amount, 0, $langs, 1, 0, 0, $conf->currency); + } + print ''; + // Other attributes $cols = 3; $parameters = array('socid'=>$socid); From 5ef681ef912f8e07a51fa14467037d78809c3628 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Fri, 15 Oct 2021 10:36:47 +0200 Subject: [PATCH 0883/1460] FIX : stickler --- htdocs/core/class/commonobject.class.php | 36 +++++++++++++----------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 2bf6d758435..8689f7c26d1 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -9058,7 +9058,7 @@ abstract class CommonObject $columnName = $deleteFromObject[2]; $TMoreSQL = array(); $more_sql = $deleteFromObject[3]; - if(!empty($more_sql)) $TMoreSQL['customsql'] = $more_sql; + if (!empty($more_sql)) $TMoreSQL['customsql'] = $more_sql; if (dol_include_once($filePath)) { $childObject = new $className($this->db); if (method_exists($childObject, 'deleteByParentField')) { @@ -9144,10 +9144,12 @@ abstract class CommonObject * * @param int $parentId Parent Id * @param string $parentField Name of Foreign key parent column + * @param array $filter an array filter + * @param string $filtermode AND or OR * @return int <0 if KO, >0 if OK * @throws Exception */ - public function deleteByParentField($parentId = 0, $parentField = '', $filter=array(), $filtermode="AND") + public function deleteByParentField($parentId = 0, $parentField = '', $filter = array(), $filtermode = "AND") { global $user; @@ -9160,22 +9162,22 @@ abstract class CommonObject $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX.$this->table_element; $sql .= " WHERE ".$parentField." = ".(int) $parentId; - // Manage filter - $sqlwhere = array(); - if (count($filter) > 0) { - foreach ($filter as $key => $value) { + // Manage filters + $sqlwhere = array(); + if (count($filter) > 0) { + foreach ($filter as $key => $value) { if ($key == 'customsql') { - $sqlwhere[] = $value; - } elseif (strpos($value, '%') === false) { - $sqlwhere[] = $key.' IN ('.$this->db->sanitize($this->db->escape($value)).')'; - } else { - $sqlwhere[] = $key.' LIKE \'%'.$this->db->escape($value).'%\''; - } - } - } - if (count($sqlwhere) > 0) { - $sql .= " AND (".implode(" ".$filtermode." ", $sqlwhere).")"; - } + $sqlwhere[] = $value; + } elseif (strpos($value, '%') === false) { + $sqlwhere[] = $key.' IN ('.$this->db->sanitize($this->db->escape($value)).')'; + } else { + $sqlwhere[] = $key.' LIKE \'%'.$this->db->escape($value).'%\''; + } + } + } + if (count($sqlwhere) > 0) { + $sql .= " AND (".implode(" ".$filtermode." ", $sqlwhere).")"; + } $resql = $this->db->query($sql); if (!$resql) { From 0865916fe2c65db05c02926d38e3fec635fa662d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 Oct 2021 10:01:07 +0200 Subject: [PATCH 0884/1460] Init page for public subscription --- htdocs/partnership/admin/website.php | 258 ++++++++ .../partnership/class/partnership.class.php | 4 +- htdocs/partnership/lib/partnership.lib.php | 5 + htdocs/public/partnership/index.php | 26 + htdocs/public/partnership/new.php | 620 ++++++++++++++++++ htdocs/theme/eldy/btn.inc.php | 2 +- 6 files changed, 912 insertions(+), 3 deletions(-) create mode 100644 htdocs/partnership/admin/website.php create mode 100644 htdocs/public/partnership/index.php create mode 100644 htdocs/public/partnership/new.php diff --git a/htdocs/partnership/admin/website.php b/htdocs/partnership/admin/website.php new file mode 100644 index 00000000000..96ebb4ba6e9 --- /dev/null +++ b/htdocs/partnership/admin/website.php @@ -0,0 +1,258 @@ + + * Copyright (C) 2006-2015 Laurent Destailleur + * Copyright (C) 2006-2012 Regis Houssin + * Copyright (C) 2011 Juanjo Menent + * + * 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 . + */ + +/** + * \file htdocs/partnership/admin/website.php + * \ingroup partnership + * \brief File of main public page for partnership module + */ + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/partnership/lib/partnership.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership.class.php'; + +// Load translation files required by the page +$langs->loadLangs(array("admin", "partnership")); + +$action = GETPOST('action', 'aZ09'); + +if (!$user->admin) { + accessforbidden(); +} + +$error = 0; + + +/* + * Actions + */ + +if ($action == 'setPARTNERSHIP_ENABLE_PUBLIC') { + if (GETPOST('value')) { + dolibarr_set_const($db, 'PARTNERSHIP_ENABLE_PUBLIC', 1, 'chaine', 0, '', $conf->entity); + } else { + dolibarr_set_const($db, 'PARTNERSHIP_ENABLE_PUBLIC', 0, 'chaine', 0, '', $conf->entity); + } +} + +if ($action == 'update') { + $public = GETPOST('PARTNERSHIP_ENABLE_PUBLIC'); + + $res = dolibarr_set_const($db, "PARTNERSHIP_ENABLE_PUBLIC", $public, 'chaine', 0, '', $conf->entity); + + if (!($res > 0)) { + $error++; + } + + if (!$error) { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } else { + setEventMessages($langs->trans("Error"), null, 'errors'); + } +} + + +/* + * View + */ + +$form = new Form($db); + +//$help_url = 'EN:Module_Partnership|FR:Module_Adhérents|ES:Módulo_Miembros'; +llxHeader('', $langs->trans("PartnershipsSetup"), $help_url); + + +$linkback = ''.$langs->trans("BackToModuleList").''; +print load_fiche_titre($langs->trans("PartnershipsSetup"), $linkback, 'title_setup'); + +$head = partnershipAdminPrepareHead(); + + + +print ''; +print ''; +print ''; + +print dol_get_fiche_head($head, 'website', $langs->trans("Partnerships"), -1, 'user'); + +if ($conf->use_javascript_ajax) { + print "\n".''."\n"; +} + + +print ''.$langs->trans("BlankSubscriptionFormDesc").'

    '; + +$param = ''; + +$enabledisablehtml = $langs->trans("EnablePublicSubscriptionForm").' '; +if (empty($conf->global->PARTNERSHIP_ENABLE_PUBLIC)) { + // Button off, click to enable + $enabledisablehtml .= ''; + $enabledisablehtml .= img_picto($langs->trans("Disabled"), 'switch_off'); + $enabledisablehtml .= ''; +} else { + // Button on, click to disable + $enabledisablehtml .= ''; + $enabledisablehtml .= img_picto($langs->trans("Activated"), 'switch_on'); + $enabledisablehtml .= ''; +} +print $enabledisablehtml; +print ''; + + +print '
    '; + +if (!empty($conf->global->PARTNERSHIP_ENABLE_PUBLIC)) { + print '
    '; + + print '
    '; + print ''; + + print ''; + print ''; + print ''; + print "\n"; + + // Force Type + $adht = new AdherentType($db); + print '\n"; + + // Force nature of member (mor/phy) + $morphys["phy"] = $langs->trans("Physical"); + $morphys["mor"] = $langs->trans("Moral"); + print '\n"; + + // Amount + print '\n"; + + // Can edit + print '\n"; + + // Jump to an online payment page + print '\n"; + + print '
    '.$langs->trans("Parameter").''.$langs->trans("Value").'
    '; + print $langs->trans("ForceMemberType"); + print ''; + $listofval = array(); + $listofval += $adht->liste_array(1); + $forcetype = empty($conf->global->PARTNERSHIP_NEWFORM_FORCETYPE) ? -1 : $conf->global->PARTNERSHIP_NEWFORM_FORCETYPE; + print $form->selectarray("PARTNERSHIP_NEWFORM_FORCETYPE", $listofval, $forcetype, count($listofval) > 1 ? 1 : 0); + print "
    '; + print $langs->trans("ForceMemberNature"); + print ''; + $forcenature = empty($conf->global->PARTNERSHIP_NEWFORM_FORCEMORPHY) ? 0 : $conf->global->PARTNERSHIP_NEWFORM_FORCEMORPHY; + print $form->selectarray("PARTNERSHIP_NEWFORM_FORCEMORPHY", $morphys, $forcenature, 1); + print "
    '; + print $langs->trans("DefaultAmount"); + print ''; + print ''; + print "
    '; + print $langs->trans("CanEditAmount"); + print ''; + print $form->selectyesno("PARTNERSHIP_NEWFORM_EDITAMOUNT", (!empty($conf->global->PARTNERSHIP_NEWFORM_EDITAMOUNT) ? $conf->global->PARTNERSHIP_NEWFORM_EDITAMOUNT : 0), 1); + print "
    '; + print $langs->trans("PARTNERSHIP_NEWFORM_PAYONLINE"); + print ''; + $listofval = array(); + $listofval['-1'] = $langs->trans('No'); + $listofval['all'] = $langs->trans('Yes').' ('.$langs->trans("VisitorCanChooseItsPaymentMode").')'; + if (!empty($conf->paybox->enabled)) { + $listofval['paybox'] = 'Paybox'; + } + if (!empty($conf->paypal->enabled)) { + $listofval['paypal'] = 'PayPal'; + } + if (!empty($conf->stripe->enabled)) { + $listofval['stripe'] = 'Stripe'; + } + print $form->selectarray("PARTNERSHIP_NEWFORM_PAYONLINE", $listofval, (!empty($conf->global->PARTNERSHIP_NEWFORM_PAYONLINE) ? $conf->global->PARTNERSHIP_NEWFORM_PAYONLINE : ''), 0); + print "
    '; + print '
    '; + + print '
    '; + print ''; + print '
    '; +} + + +print dol_get_fiche_end(); + +print ''; + + +if (!empty($conf->global->PARTNERSHIP_ENABLE_PUBLIC)) { + print '
    '; + //print $langs->trans('FollowingLinksArePublic').'
    '; + print img_picto('', 'globe').' '.$langs->trans('BlankSubscriptionForm').'
    '; + if (!empty($conf->multicompany->enabled)) { + $entity_qr = '?entity='.$conf->entity; + } else { + $entity_qr = ''; + } + + // Define $urlwithroot + $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); + $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file + //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current + + print ''; + print ajax_autoselect('publicurlmember'); +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index f40b771b34d..1e3d3cebab1 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -131,14 +131,14 @@ class Partnership extends CommonObject */ public $rowid; - public $fk_soc; + public $fk_soc; // Link to thirdparty + public $fk_member; // Link to member public $tms; public $fk_user_creat; public $fk_user_modif; public $status; - public $fk_member; public $date_partnership_start; public $date_partnership_end; public $count_last_url_check_error; diff --git a/htdocs/partnership/lib/partnership.lib.php b/htdocs/partnership/lib/partnership.lib.php index 5305f86132e..23b5a2901fb 100644 --- a/htdocs/partnership/lib/partnership.lib.php +++ b/htdocs/partnership/lib/partnership.lib.php @@ -46,6 +46,11 @@ function partnershipAdminPrepareHead() $head[$h][2] = 'partnership_extrafields'; $h++; + $head[$h][0] = dol_buildpath("/partnership/admin/website.php", 1); + $head[$h][1] = $langs->trans("BlankSubscriptionForm"); + $head[$h][2] = 'website'; + $h++; + /* $head[$h][0] = dol_buildpath("/partnership/admin/about.php", 1); $head[$h][1] = $langs->trans("About"); diff --git a/htdocs/public/partnership/index.php b/htdocs/public/partnership/index.php new file mode 100644 index 00000000000..6a9a6f8a557 --- /dev/null +++ b/htdocs/public/partnership/index.php @@ -0,0 +1,26 @@ + + * + * 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 . + */ + +/** + * \file htdocs/public/partnership/index.php + * \ingroup core + * \brief A redirect page to an error + */ + +require '../../master.inc.php'; + +header("Location: ".DOL_URL_ROOT.'/public/error-404.php'); diff --git a/htdocs/public/partnership/new.php b/htdocs/public/partnership/new.php new file mode 100644 index 00000000000..a46488ab5f9 --- /dev/null +++ b/htdocs/public/partnership/new.php @@ -0,0 +1,620 @@ + + * Copyright (C) 2001-2002 Jean-Louis Bergamo + * Copyright (C) 2006-2013 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2012 J. Fernando Lagrange + * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2018 Alexandre Spangaro + * Copyright (C) 2021 Waël Almoman + * + * 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 . + */ + +/** + * \file htdocs/public/partnership/new.php + * \ingroup member + * \brief Example of form to add a new member + */ + +if (!defined('NOLOGIN')) { + define("NOLOGIN", 1); // This means this output page does not require to be logged. +} +if (!defined('NOCSRFCHECK')) { + define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. +} +if (!defined('NOIPCHECK')) { + define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +} +if (!defined('NOBROWSERNOTIF')) { + define('NOBROWSERNOTIF', '1'); +} +if (!defined('NOIPCHECK')) { + define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +} + +// For MultiCompany module. +// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php +// TODO This should be useless. Because entity must be retrieve from object ref and not from url. +$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); +if (is_numeric($entity)) { + define("DOLENTITY", $entity); +} + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; + +// Init vars +$errmsg = ''; +$num = 0; +$error = 0; +$backtopage = GETPOST('backtopage', 'alpha'); +$action = GETPOST('action', 'aZ09'); + +// Load translation files +$langs->loadLangs(array("main", "members", "companies", "install", "other")); + +// Security check +if (empty($conf->partnership->enabled)) { + accessforbidden('', 0, 0, 1); +} + +if (empty($conf->global->PARTNERSHIP_ENABLE_PUBLIC)) { + print $langs->trans("Auto subscription form for public visitors has not been enabled"); + exit; +} + +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('publicnewpartnershipcard', 'globalcard')); + +$extrafields = new ExtraFields($db); + +$object = new Partnership($db); + +$user->loadDefaultValues(); + + +/** + * Show header for new partnership + * + * @param string $title Title + * @param string $head Head array + * @param int $disablejs More content into html header + * @param int $disablehead More content into html header + * @param array $arrayofjs Array of complementary js files + * @param array $arrayofcss Array of complementary css files + * @return void + */ +function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '') +{ + global $user, $conf, $langs, $mysoc; + + top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers + + print ''; + + // Define urllogo + $urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png'; + + if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); + } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); + } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { + $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; + } + + print '
    '; + + // Output html code for logo + if ($urllogo) { + print '
    '; + print '
    '; + print ''; + print '
    '; + if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { + print ''; + } + print '
    '; + } + + if (!empty($conf->global->PARTNERSHIP_IMAGE_PUBLIC_REGISTRATION)) { + print '
    '; + print ''; + print '
    '; + } + + print '
    '; + + print '
    '; +} + +/** + * Show footer for new member + * + * @return void + */ +function llxFooterVierge() +{ + print '
    '; + + printCommonFooter('public'); + + print "\n"; + print "\n"; +} + + + +/* + * Actions + */ +$parameters = array(); +// Note that $action and $object may have been modified by some hooks +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + +// Action called when page is submitted +if (empty($reshook) && $action == 'add') { + $error = 0; + $urlback = ''; + + $db->begin(); + + /*if (GETPOST('typeid') <= 0) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type"))."
    \n"; + }*/ + if (!GETPOST('lastname')) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Lastname"))."
    \n"; + } + if (!GETPOST('firstname')) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Firstname"))."
    \n"; + } + if (empty(GETPOST('email'))) { + $error++; + $errmsg .= $langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Email'))."
    \n"; + } elseif (GETPOST("email") && !isValidEmail(GETPOST("email"))) { + $langs->load('errors'); + $error++; + $errmsg .= $langs->trans("ErrorBadEMail", GETPOST("email"))."
    \n"; + } + + $public = GETPOSTISSET('public') ? 1 : 0; + + if (!$error) { + $partnership = new Partnership($db); + + // We try to find the thirdparty or the member + if (empty($conf->global->PARTNERSHIP_IS_MANAGED_FOR) || $conf->global->PARTNERSHIP_IS_MANAGED_FOR == 'thirdparty') { + + + $partnership->fk_member = 0; + } elseif ($conf->global->PARTNERSHIP_IS_MANAGED_FOR == 'member') { + + + $partnership->fk_soc = 0; + } + + $partnership->statut = -1; + $partnership->firstname = GETPOST('firstname'); + $partnership->lastname = GETPOST('lastname'); + $partnership->address = GETPOST('address'); + $partnership->zip = GETPOST('zipcode'); + $partnership->town = GETPOST('town'); + $partnership->email = GETPOST('email'); + $partnership->country_id = GETPOST('country_id', 'int'); + $partnership->state_id = GETPOST('state_id', 'int'); + //$partnership->typeid = $conf->global->PARTNERSHIP_NEWFORM_FORCETYPE ? $conf->global->PARTNERSHIP_NEWFORM_FORCETYPE : GETPOST('typeid', 'int'); + $partnership->note_private = GETPOST('note_private'); + + // Fill array 'array_options' with data from add form + $extrafields->fetch_name_optionals_label($partnership->table_element); + $ret = $extrafields->setOptionalsFromPost(null, $partnership); + if ($ret < 0) { + $error++; + } + + $result = $partnership->create($user); + if ($result > 0) { + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + $object = $partnership; + + /* + $partnershipt = new PartnershipType($db); + $partnershipt->fetch($object->typeid); + + if ($object->email) { + $subject = ''; + $msg = ''; + + // Send subscription email + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); + // Load traductions files required by page + $outputlangs->loadLangs(array("main", "members")); + // Get email content from template + $arraydefaultmessage = null; + $labeltouse = $conf->global->PARTNERSHIP_EMAIL_TEMPLATE_AUTOREGISTER; + + if (!empty($labeltouse)) { + $arraydefaultmessage = $formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse); + } + + if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions(dol_concatdesc($msg, $partnershipt->getMailOnValid()), $substitutionarray, $outputlangs); + + if ($subjecttosend && $texttosend) { + $moreinheader = 'X-Dolibarr-Info: send_an_email by public/members/new.php'."\r\n"; + + $result = $object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader); + } + } + */ + + // Send email to the foundation to say a new member subscribed with autosubscribe form + if (!empty($conf->global->MAIN_INFO_SOCIETE_MAIL) && !empty($conf->global->PARTNERSHIP_AUTOREGISTER_NOTIF_MAIL_SUBJECT) && + !empty($conf->global->PARTNERSHIP_AUTOREGISTER_NOTIF_MAIL)) { + // Define link to login card + $appli = constant('DOL_APPLICATION_TITLE'); + if (!empty($conf->global->MAIN_APPLICATION_TITLE)) { + $appli = $conf->global->MAIN_APPLICATION_TITLE; + if (preg_match('/\d\.\d/', $appli)) { + if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) { + $appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core + } + } else { + $appli .= " ".DOL_VERSION; + } + } else { + $appli .= " ".DOL_VERSION; + } + + $to = $partnership->makeSubstitution($conf->global->MAIN_INFO_SOCIETE_MAIL); + $from = $conf->global->PARTNERSHIP_MAIL_FROM; + $mailfile = new CMailFile( + '['.$appli.'] '.$conf->global->PARTNERSHIP_AUTOREGISTER_NOTIF_MAIL_SUBJECT, + $to, + $from, + $partnership->makeSubstitution($conf->global->PARTNERSHIP_AUTOREGISTER_NOTIF_MAIL), + array(), + array(), + array(), + "", + "", + 0, + -1 + ); + + if (!$mailfile->sendfile()) { + dol_syslog($langs->trans("ErrorFailedToSendMail", $from, $to), LOG_ERR); + } + } + + if (!empty($backtopage)) { + $urlback = $backtopage; + } elseif (!empty($conf->global->PARTNERSHIP_URL_REDIRECT_SUBSCRIPTION)) { + $urlback = $conf->global->PARTNERSHIP_URL_REDIRECT_SUBSCRIPTION; + // TODO Make replacement of __AMOUNT__, etc... + } else { + $urlback = $_SERVER["PHP_SELF"]."?action=added&token=".newToken(); + } + + if (!empty($conf->global->PARTNERSHIP_NEWFORM_PAYONLINE) && $conf->global->PARTNERSHIP_NEWFORM_PAYONLINE != '-1') { + if ($conf->global->PARTNERSHIP_NEWFORM_PAYONLINE == 'all') { + $urlback = DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?from=partnershipnewform&source=membersubscription&ref='.urlencode($partnership->ref); + if (price2num(GETPOST('amount', 'alpha'))) { + $urlback .= '&amount='.price2num(GETPOST('amount', 'alpha')); + } + if (GETPOST('email')) { + $urlback .= '&email='.urlencode(GETPOST('email')); + } + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { + $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$partnership->ref, 2)); + } else { + $urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); + } + } + } elseif ($conf->global->PARTNERSHIP_NEWFORM_PAYONLINE == 'paybox') { + $urlback = DOL_MAIN_URL_ROOT.'/public/paybox/newpayment.php?from=partnershipnewform&source=membersubscription&ref='.urlencode($partnership->ref); + if (price2num(GETPOST('amount', 'alpha'))) { + $urlback .= '&amount='.price2num(GETPOST('amount', 'alpha')); + } + if (GETPOST('email')) { + $urlback .= '&email='.urlencode(GETPOST('email')); + } + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { + $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$partnership->ref, 2)); + } else { + $urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); + } + } + } elseif ($conf->global->PARTNERSHIP_NEWFORM_PAYONLINE == 'paypal') { + $urlback = DOL_MAIN_URL_ROOT.'/public/paypal/newpayment.php?from=partnershipnewform&source=membersubscription&ref='.urlencode($partnership->ref); + if (price2num(GETPOST('amount', 'alpha'))) { + $urlback .= '&amount='.price2num(GETPOST('amount', 'alpha')); + } + if (GETPOST('email')) { + $urlback .= '&email='.urlencode(GETPOST('email')); + } + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { + $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$partnership->ref, 2)); + } else { + $urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); + } + } + } elseif ($conf->global->PARTNERSHIP_NEWFORM_PAYONLINE == 'stripe') { + $urlback = DOL_MAIN_URL_ROOT.'/public/stripe/newpayment.php?from=partnershipnewform&source=membersubscription&ref='.$partnership->ref; + if (price2num(GETPOST('amount', 'alpha'))) { + $urlback .= '&amount='.price2num(GETPOST('amount', 'alpha')); + } + if (GETPOST('email')) { + $urlback .= '&email='.urlencode(GETPOST('email')); + } + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { + $urlback .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.'membersubscription'.$partnership->ref, 2)); + } else { + $urlback .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); + } + } + } else { + dol_print_error('', "Autosubscribe form is setup to ask an online payment for a not managed online payment"); + exit; + } + } + + if (!empty($entity)) { + $urlback .= '&entity='.$entity; + } + dol_syslog("partnership ".$partnership->ref." was created, we redirect to ".$urlback); + } else { + $error++; + $errmsg .= join('
    ', $partnership->errors); + } + } + + if (!$error) { + $db->commit(); + + Header("Location: ".$urlback); + exit; + } else { + $db->rollback(); + } +} + +// Action called after a submitted was send and member created successfully +// If PARTNERSHIP_URL_REDIRECT_SUBSCRIPTION is set to url we never go here because a redirect was done to this url. +// backtopage parameter with an url was set on member submit page, we never go here because a redirect was done to this url. +if (empty($reshook) && $action == 'added') { + llxHeaderVierge($langs->trans("NewPartnershipForm")); + + // Si on a pas ete redirige + print '
    '; + print '
    '; + print $langs->trans("NewPartnershipbyWeb"); + print '
    '; + + llxFooterVierge(); + exit; +} + + + +/* + * View + */ + +$form = new Form($db); +$formcompany = new FormCompany($db); +$partnershipt = new AdherentType($db); +$extrafields->fetch_name_optionals_label('partnership'); // fetch optionals attributes and labels + + +llxHeaderVierge($langs->trans("NewSubscription")); + + +print load_fiche_titre($langs->trans("NewSubscription"), '', '', 0, 0, 'center'); + + +print '
    '; +print '
    '; + +print '
    '; +if (!empty($conf->global->PARTNERSHIP_NEWFORM_TEXT)) { + print $langs->trans($conf->global->PARTNERSHIP_NEWFORM_TEXT)."
    \n"; +} else { + print $langs->trans("NewSubscriptionDesc", $conf->global->MAIN_INFO_SOCIETE_MAIL)."
    \n"; +} +print '
    '; + +dol_htmloutput_errors($errmsg); + +// Print form +print '
    '."\n"; +print ''; +print ''; +print ''; + +print '
    '; + +print '
    '.$langs->trans("FieldsWithAreMandatory", '*').'
    '; +//print $langs->trans("FieldsWithIsForPublic",'**').'
    '; + +print dol_get_fiche_head(''); + +print ''; + + +print ''."\n"; + +// Type +/* +if (empty($conf->global->PARTNERSHIP_NEWFORM_FORCETYPE)) { + $listoftype = $partnershipt->liste_array(); + $tmp = array_keys($listoftype); + $defaulttype = ''; + $isempty = 1; + if (count($listoftype) == 1) { + $defaulttype = $tmp[0]; + $isempty = 0; + } + print ''."\n"; +} else { + $partnershipt->fetch($conf->global->PARTNERSHIP_NEWFORM_FORCETYPE); + print ''; +} +*/ + +// Moral/Physic attribute +$morphys["phy"] = $langs->trans("Physical"); +$morphys["mor"] = $langs->trans("Moral"); +if (empty($conf->global->PARTNERSHIP_NEWFORM_FORCEMORPHY)) { + print ''."\n"; +} else { + print $morphys[$conf->global->PARTNERSHIP_NEWFORM_FORCEMORPHY]; + print ''; +} + +// Company +print ''."\n"; +// Title +print ''."\n"; +// Lastname +print ''."\n"; +// Firstname +print ''."\n"; +// EMail +print ''."\n"; +// Login +if (empty($conf->global->PARTNERSHIP_LOGIN_NOT_REQUIRED)) { + print ''."\n"; + print ''."\n"; + print ''."\n"; +} +// Gender +print ''; +print ''; +// Address +print ''."\n"; +// Zip / Town +print ''; +// Country +print ''; +// State +if (empty($conf->global->SOCIETE_DISABLE_STATE)) { + print ''; +} +// Logo +//print ''."\n"; +// Other attributes +$tpl_context = 'public'; // define template context to public +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; +// Comments +print ''; +print ''; +print ''; +print ''."\n"; + +print "
    '.$langs->trans("Type").' *'; + print $form->selectarray("typeid", $partnershipt->liste_array(1), GETPOST('typeid') ? GETPOST('typeid') : $defaulttype, $isempty); + print '
    '.$langs->trans('MemberNature').' *'."\n"; + print $form->selectarray("morphy", $morphys, GETPOST('morphy'), 1); + print '
    '.$langs->trans("Company").''; +print img_picto('', 'company', 'class="pictofixedwidth"'); +print '
    '.$langs->trans('UserTitle').''; +print $formcompany->select_civility(GETPOST('civility_id'), 'civility_id').'
    '.$langs->trans("Lastname").' *
    '.$langs->trans("Firstname").' *
    '.$langs->trans("Email").($conf->global->PARTNERSHIP_MAIL_REQUIRED ? ' *' : '').''; +//print img_picto('', 'email', 'class="pictofixedwidth"'); +print '
    '.$langs->trans("Login").' *
    '.$langs->trans("Password").' *
    '.$langs->trans("PasswordAgain").' *
    '.$langs->trans("Gender").''; +$arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman")); +print $form->selectarray('gender', $arraygender, GETPOST('gender') ?GETPOST('gender') : $object->gender, 1); +print '
    '.$langs->trans("Address").''."\n"; +print '
    '.$langs->trans('Zip').' / '.$langs->trans('Town').''; +print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6, 1); +print ' / '; +print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); +print '
    '.$langs->trans('Country').''; +print img_picto('', 'country', 'class="pictofixedwidth"'); +$country_id = GETPOST('country_id', 'int'); +if (!$country_id && !empty($conf->global->PARTNERSHIP_NEWFORM_FORCECOUNTRYCODE)) { + $country_id = getCountry($conf->global->PARTNERSHIP_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); +} +if (!$country_id && !empty($conf->geoipmaxmind->enabled)) { + $country_code = dol_user_country(); + //print $country_code; + if ($country_code) { + $new_country_id = getCountry($country_code, 3, $db, $langs); + //print 'xxx'.$country_code.' - '.$new_country_id; + if ($new_country_id) { + $country_id = $new_country_id; + } + } +} +$country_code = getCountry($country_id, 2, $db, $langs); +print $form->select_country($country_id, 'country_id'); +print '
    '.$langs->trans('State').''; + if ($country_code) { + print $formcompany->select_state(GETPOST("state_id"), $country_code); + } + print '
    '.$langs->trans("URLPhoto").'
    '.$langs->trans("Comments").'
    \n"; + +print dol_get_fiche_end(); + +// Save +print '
    '; +print ''; +if (!empty($backtopage)) { + print '     '; +} +print '
    '; + + +print "
    \n"; +print "
    "; +print '
    '; + + +llxFooterVierge(); + +$db->close(); diff --git a/htdocs/theme/eldy/btn.inc.php b/htdocs/theme/eldy/btn.inc.php index 7122c252cbe..a844fc52071 100644 --- a/htdocs/theme/eldy/btn.inc.php +++ b/htdocs/theme/eldy/btn.inc.php @@ -277,7 +277,7 @@ a.btnTitle.btnTitleSelected { } .btnTitle>.fa { - font-size: 20px; + font-size: 2em; display: block; } From ab9ba4e0a2cb6da05e4b0f63e45b03b2e0dcb2b3 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 15 Oct 2021 10:53:17 +0200 Subject: [PATCH 0885/1460] NEW: feature #18986 --- htdocs/core/lib/project.lib.php | 6 +++--- htdocs/projet/tasks/list.php | 12 +++++++----- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index b7c2279188d..bbc6da6a7e4 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -929,7 +929,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t } } - if (($total_projectlinesa_planned > 0 || $total_projectlinesa_spent > 0 || $total_projectlinesa_tobill > 0 || $total_projectlinesa_billed > 0) + if (($total_projectlinesa_planned > 0 || $total_projectlinesa_spent > 0 || $total_projectlinesa_tobill > 0 || $total_projectlinesa_billed > 0 || $total_budget_amount > 0) && $level <= 0) { print ''; print ''.$langs->trans("Total").''; @@ -1031,8 +1031,8 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t } if (count($arrayfields) > 0 && !empty($arrayfields['t.budget_amount']['checked'])) { - print ''; - price($total_budget_amount, 0, $langs, 1, 0, 0, $conf->currency); + print ''; + print price($total_budget_amount, 0, $langs, 1, 0, 0, $conf->currency); print ''; } diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index fc316fb2705..e1ed162f9c2 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -766,15 +766,17 @@ if (!empty($arrayfields['t.progress']['checked'])) { print ''; print ''; } + +if (!empty($arrayfields['t.progress_summary']['checked'])) { + print ''; +} + if (!empty($arrayfields['t.budget_amount']['checked'])) { print ''; print ''; print ''; } -if (!empty($arrayfields['t.progress_summary']['checked'])) { - print ''; -} if (!empty($arrayfields['t.tobill']['checked'])) { print ''; } @@ -1146,7 +1148,7 @@ while ($i < min($num, $limit)) { } $totalarray['val']['t.budget_amount'] += $obj->budget_amount; if (!$i) { - $totalarray['totalbudgetamount'] = $totalarray['nbfield']; + $totalarray['totalbudget_amount'] = $totalarray['nbfield']; } $totalarray['totalbudgetamount'] += $obj->budget_amount; print ''; @@ -1267,7 +1269,7 @@ if (isset($totalarray['totaldurationeffectivefield']) || isset($totalarray['tota print ''.convertSecondToTime($totalarray['totaltobill'], $plannedworkloadoutputformat).''; } elseif ($totalarray['totalbilledfield'] == $i) { print ''.convertSecondToTime($totalarray['totalbilled'], $plannedworkloadoutputformat).''; - } elseif ($totalarray['totalbudgetamount'] == $i) { + } elseif ($totalarray['totalbudget_amount'] == $i) { print ''.price($totalarray['totalbudgetamount'], 0, $langs, 1, 0, 0, $conf->currency).''; } else { print ''; From aeffad4c0fad6d579b1a2ed407e6bebe6d110670 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 15 Oct 2021 11:02:05 +0200 Subject: [PATCH 0886/1460] fix order --- htdocs/projet/tasks.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index ebd17ca9dd5..cfd2b89b0c2 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -290,7 +290,7 @@ if (!empty($search_progressdeclare)) { } if ($search_task_budget_amount) { - $morewherefilterarray[]= natural_search('t.budget_amount', $search_task_budget_amount, 1); + $morewherefilterarray[]= natural_search('t.budget_amount', $search_task_budget_amount, 1, 1); } $morewherefilter = ''; @@ -1029,7 +1029,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third */ if (!empty($arrayfields['t.budget_amount']['checked'])) { - print_liste_field_titre($arrayfields['t.budget_amount']['label'], $_SERVER["PHP_SELF"], "t.budget_amount", "", $param, '', $sortfield, $sortorder, 'center '); + print_liste_field_titre($arrayfields['t.budget_amount']['label'], $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'center '); } if (!empty($arrayfields['c.assigned']['checked'])) { From 26c50b9e2ca2c43ab20ce786e39310fd5d481875 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 15 Oct 2021 11:59:12 +0200 Subject: [PATCH 0887/1460] add setting to create PDF in PDF/A - 1b format #18990 --- htdocs/admin/pdf.php | 12 ++++++++++++ htdocs/langs/en_US/admin.lang | 1 + 2 files changed, 13 insertions(+) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index be45a2101f5..a245c9338c9 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -165,6 +165,10 @@ if ($action == 'update') { dolibarr_set_const($db, "PDF_SHOW_LINK_TO_ONLINE_PAYMENT", GETPOST('PDF_SHOW_LINK_TO_ONLINE_PAYMENT', 'alpha'), 'chaine', 0, '', $conf->entity); } + if (GETPOSTISSET('PDF_USE_1A')) { + dolibarr_set_const($db, "PDF_USE_1A", GETPOST('PDF_USE_1A', 'alpha'), 'chaine', 0, '', $conf->entity); + } + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); @@ -534,6 +538,14 @@ if ($conf->use_javascript_ajax) { } print ''; +print ''.$langs->trans("PDF_USE_1A").''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('PDF_USE_1A'); +} else { + print $form->selectyesno('PDF_USE_1A', (!empty($conf->global->PDF_USE_1A)) ? $conf->global->PDF_USE_1A : 0, 1); +} +print ''; + print ''; print '
    '; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index def603e653e..81034e4aacd 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2194,3 +2194,4 @@ LanguageAndPresentation=Language and presentation SkinAndColors=Skin and colors IfYouUseASecondTaxYouMustSetYouUseTheMainTax=If you want to use a second tax, you must enable also the first sales tax IfYouUseAThirdTaxYouMustSetYouUseTheMainTax=If you want to use a third tax, you must enable also the first sales tax +PDF_USE_1A=Generate PDF with PDF/A- 1b format From bd7e3e57cabfe767948758bfc08928cb34e7c107 Mon Sep 17 00:00:00 2001 From: atm-florian Date: Fri, 15 Oct 2021 16:56:38 +0200 Subject: [PATCH 0888/1460] FIX 13.0: end date required to edit a ticket message --- htdocs/comm/action/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 2a0371d4615..0bbcf20a796 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -503,7 +503,7 @@ if (empty($reshook) && $action == 'update') $object->note_private = trim(GETPOST("note", "restricthtml")); $object->fk_element = GETPOST("fk_element", "int"); $object->elementtype = GETPOST("elementtype", "alphanohtml"); - if (!$datef && $percentage == 100) + if (!$datef && $percentage == 100 && !preg_match('/^TICKET_MSG/', $object->code)) { $error++; $donotclearsession = 1; setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEnd")), $object->errors, 'errors'); From 9eb8dadfd95b2b627e417a1c56c36e2b14f83ed2 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Fri, 15 Oct 2021 16:58:59 +0200 Subject: [PATCH 0889/1460] WIP : signature of propal --- htdocs/core/ajax/onlineSign.php | 131 +++++++++++++++++++++ htdocs/public/onlinesign/newonlinesign.php | 75 +++++++++++- 2 files changed, 203 insertions(+), 3 deletions(-) create mode 100644 htdocs/core/ajax/onlineSign.php diff --git a/htdocs/core/ajax/onlineSign.php b/htdocs/core/ajax/onlineSign.php new file mode 100644 index 00000000000..13bd28961d5 --- /dev/null +++ b/htdocs/core/ajax/onlineSign.php @@ -0,0 +1,131 @@ +. + */ + +/** + * \file /htdocs/core/ajax/onlineSign.php + * \brief File to make Ajax action on Knowledge Management + */ + +if (!defined('NOTOKENRENEWAL')) { + define('NOTOKENRENEWAL', '1'); // Disables token renewal +} +if (!defined('NOREQUIREHTML')) { + define('NOREQUIREHTML', '1'); +} +if (!defined('NOREQUIREAJAX')) { + define('NOREQUIREAJAX', '1'); +} +if (!defined('NOREQUIRESOC')) { + define('NOREQUIRESOC', '1'); +} +if (!defined('NOCSRFCHECK')) { + define('NOCSRFCHECK', '1'); +} +// Do not check anti CSRF attack test +if (!defined('NOREQUIREMENU')) { + define('NOREQUIREMENU', '1'); +} +// If there is no need to load and show top and left menu +if (!defined("NOLOGIN")) { + define("NOLOGIN", '1'); +} +if (!defined('NOIPCHECK')) { + define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +} +if (!defined('NOBROWSERNOTIF')) { + define('NOBROWSERNOTIF', '1'); +} +include '../../main.inc.php'; + +$action = GETPOST('action', 'aZ09'); +$signature = GETPOST('signaturebase64'); +$ref = GETPOST('ref', 'aZ09'); +$mode = GETPOST('mode', 'aZ09'); +$error = 0; +$response = ""; +/* + * Actions + */ + +// None + + +/* + * View + */ + +if ($action == "importSignature") { + if (!empty($signature) && $signature[0] == "image/png;base64") { + $signature = $signature[1]; + $data = base64_decode($signature); + $upload_dir = DOL_DATA_ROOT."/".$mode."/".$ref."/"; + $date = dol_print_date(dol_now(), "%Y%m%d%H%M%S"); + $filename = "signatures/".$date."_signature.png"; + if (!is_dir($upload_dir."signatures/")) { + if (!mkdir($upload_dir."signatures/")) { + $response ="error mkdir"; + $error++; + } + } + if (!$error) { + $return = file_put_contents($upload_dir.$filename, $data); + if ($return == false) { + $response = 'error file_put_content'; + } else { + if ($mode == "propale") { + require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; + require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; + $object = new Propal($db); + $object->fetch(0, $ref); + + $pdf = pdf_getInstance(); + $pdf->Open(); + $pdf->AddPage(); + $pagecount = $pdf->setSourceFile($upload_dir.$ref.".pdf"); + + $tppl = $pdf->importPage(1); + $pdf->useTemplate($tppl); + $pdf->Image($upload_dir.$filename, 129, 239.6, 60, 15); + $pdf->Close(); + $pdf->Output($upload_dir.$ref."_signed-".$date.".pdf", "F"); + + $sql = "UPDATE ".MAIN_DB_PREFIX."propal"; + $sql .= " SET fk_statut = ".((int) $object::STATUS_SIGNED).", note_private = '".$object->note_private."', date_signature='".$db->idate(dol_now())."'"; + $sql .= " WHERE rowid = ".((int) $object->id); + + dol_syslog(__METHOD__, LOG_DEBUG); + $resql = $db->query($sql); + if (!$resql) { + $error++; + } else { + $num = $db->affected_rows($resql); + } + + if (!$error) { + $db->commit(); + $response = "success"; + } else { + $db->rollback(); + $response = "error sql"; + } + } + } + } + } else { + $response = 'error signature_not_found'; + } +} +echo $response; diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index d034db38be3..6d37684ce8f 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -49,6 +49,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; +require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; // Load translation files $langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", "paybox")); @@ -58,6 +59,8 @@ $langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", // Get parameters $action = GETPOST('action', 'aZ09'); +$cancel = GETPOST('cancel', 'alpha'); +$refusepropal = GETPOST('refusepropal', 'alpha'); // Input are: // type ('invoice','order','contractline'), @@ -80,7 +83,9 @@ if (!$action) { exit; } } - +if (!empty($refusepropal)) { + $action = "refusepropal"; +} // Define $urlwithroot //$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); @@ -112,14 +117,16 @@ $urlko = preg_replace('/&$/', '', $urlko); // Remove last & $creditor = $mysoc->name; +$object = new Propal($db); +$object->fetch(0, $ref); /* * Actions */ -if ($action == 'dosign') { - // TODO +if ($action == 'refusepropal') { + //TODO: creer suite de cette action } @@ -290,7 +297,69 @@ if ($action != 'dosign') { } print ''."\n"; +print ''; +if ($action == "dosign" && empty($cancel)) { + print '
    '; + print ''; + print '
    '; + print '
    '; + print ''; + print ''; + print ' + '; +} else { + if ($object->status == $object::STATUS_SIGNED) { + print $langs->trans("PropalSigned"); + } elseif ($object->status == $object::STATUS_NOTSIGNED) { + print $langs->trans("PropalNotSigned"); + } else { + print ''; + print ''; + } +} +print ''."\n"; print ''."\n"; print ''."\n"; print '
    '."\n"; From 07052196e27229d69f7ba580f32a17aed35b4a2e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Oct 2021 12:33:19 +0200 Subject: [PATCH 0890/1460] Fix popup message on sepa creation --- htdocs/compta/prelevement/create.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index e93b2a7472d..311f030f013 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -100,9 +100,11 @@ if (empty($reshook)) } } else { if ($type != 'bank-transfer') { - setEventMessages($langs->trans("DirectDebitOrderCreated", $bprev->getNomUrl(1)), null); + $s = $langs->trans("DirectDebitOrderCreated", '{s}'); + setEventMessages(str_replace('{s}', $bprev->getNomUrl(1), $s), null); } else { - setEventMessages($langs->trans("CreditTransferOrderCreated", $bprev->getNomUrl(1)), null); + $s = $langs->trans("CreditTransferOrderCreated", '{s}'); + setEventMessages(str_replace('{s}', $bprev->getNomUrl(1), $s), null); } header("Location: ".DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$bprev->id); From a0c81d6230211579790c37cc87679b34b5f8a5f8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Oct 2021 13:23:59 +0200 Subject: [PATCH 0891/1460] Prepare 13.0.5 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index a24a404262e..d32f29a9d3d 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -31,7 +31,7 @@ */ if (!defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE', 'Dolibarr'); -if (!defined('DOL_VERSION')) define('DOL_VERSION', '13.0.4'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c +if (!defined('DOL_VERSION')) define('DOL_VERSION', '13.0.5'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (!defined('EURO')) define('EURO', chr(128)); From 946bca3b625576af9ef82f157a6a99dfeccdc21a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Oct 2021 13:26:39 +0200 Subject: [PATCH 0892/1460] Prepare 13.0.5 --- ChangeLog | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 281c8733ce6..58f5e78155b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,7 +2,38 @@ English Dolibarr ChangeLog -------------------------------------------------------------- -***** ChangeLog for 13.0.4 compared to 13.0.2 ***** + +***** ChangeLog for 13.0.5 compared to 13.0.4 ***** + +FIX: 13.0: class CommandeFournisseurDispatch provides trigger for UPDATE but not for CREATE / DELETE +FIX: #18389 Accountancy - Bug on LDcompta10 export for supplier invoice +FIX: #18591 : Remove double quotes of SQL Queries for postgresql compatibility +FIX: Accountancy - Debug Export Sage50 / CIEL Compta / CIEL Compta Evo (Format XIMPORT) +FIX: Accountancy - Some problems of length with general & subledger account +FIX: add DISTINCT +FIX: an approved holiday can be canceled by an admin. +FIX: autocalculation of the supplier price in main currency. +FIX: better sql request +FIX: cannot add time spend when column ref is not displayed +FIX: compatibility postgre sql +FIX: holiday card: hooks uninitialized +FIX: Invoice - Missing button to reopen an abandoned situation invoice +FIX: invoice validation: when checking if any VAT rate has a negative amount, prevent false positives with -1.0E-14 amounts +FIX: list of categories in stats of supplier invoices +FIX: Manage credit note on situation invoice for calculate margin +FIX: method_exists needs object at first param +FIX: move fetch_optionnal into $ac_static->fetch() +FIX: multicompany transverse mode compatibility +FIX: on supplier order, JOIN with product fourn price table must be done with fk_soc too to avoid display several times a same line (because of same supplier product ref) +FIX: postgre filter select search extrafield +FIX: products/services card: hidden extrafields were overridden +FIX: shipping validation workflow: 'ORDER_NEW' trigger called from wrong object +FIX: task time: can't filter by user with pgsql + show error message +FIX: task time: keep on using natural_search +FIX: wrong users count in multicompany transverse mode + + +***** ChangeLog for 13.0.4 compared to 13.0.3 ***** FIX: Allow disabling of a module (not a dangerous action) even if there is problem with token (due to bugged modules). FIX: 13.0 - fatal - missing inclusion of ajax.lib.php for calling `ajax_autocompleter()` From 7bb840fb049cae2cfbe6a5151750ec271d74bab0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Oct 2021 16:58:55 +0200 Subject: [PATCH 0893/1460] Add a line to know instance uses not stable level of features --- htdocs/main.inc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 09f3f85b7e4..76a4fbc1af8 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1437,7 +1437,9 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr print ''."\n"; // Do not index print ''."\n"; // Scale for mobile device print ''."\n"; - + if (!empty($conf->global->MAIN_FEATURES_LEVEL)) { + print ''."\n"; + } // Favicon $favicon = DOL_URL_ROOT.'/theme/dolibarr_256x256_color.png'; if (!empty($mysoc->logo_squarred_mini)) { From bd52613331d59d0d3cf8f08872319ce6c1312ea2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Oct 2021 17:06:10 +0200 Subject: [PATCH 0894/1460] Fix phpcs --- htdocs/compta/facture/stats/index.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 03fcf5b37d0..c8961762a81 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -109,7 +109,6 @@ if ($mode == 'supplier') { $stats->from .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_fournisseur as cat ON (f.fk_soc = cat.fk_soc)'; $stats->where .= ' AND cat.fk_categorie IN ('.implode(',', $custcats).')'; } - } // Build graphic number of object From bbbc58ec024150a8727cb646191471b81968ddf5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Oct 2021 18:55:34 +0200 Subject: [PATCH 0895/1460] Update admin.lang --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 81034e4aacd..0cf17545b5f 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2194,4 +2194,4 @@ LanguageAndPresentation=Language and presentation SkinAndColors=Skin and colors IfYouUseASecondTaxYouMustSetYouUseTheMainTax=If you want to use a second tax, you must enable also the first sales tax IfYouUseAThirdTaxYouMustSetYouUseTheMainTax=If you want to use a third tax, you must enable also the first sales tax -PDF_USE_1A=Generate PDF with PDF/A- 1b format +PDF_USE_1A=Generate PDF with PDF/A-1b format From a28d01ca838a167e1e3689e8853b887ceaf07789 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Oct 2021 18:59:01 +0200 Subject: [PATCH 0896/1460] Use PDF/A format instead of PDF --- htdocs/core/lib/pdf.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index e9b2e558595..8293d3d1c65 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -177,8 +177,8 @@ function pdf_getInstance($format = '', $metric = 'mm', $pagetype = 'P') //$metric=$arrayformat['unit']; $pdfa = false; // PDF-1.3 - if (!empty($conf->global->PDF_USE_1A)) { - $pdfa = true; // PDF1/A + if (!empty($conf->global->PDF_USE_A)) { + $pdfa = $conf->global->PDF_USE_A; // PDF/A-1 ou PDF/A-3 } if (class_exists('TCPDI')) { From 5dfbd3642fc299d781cb1a8bca7b9fe2a70bf4a2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Oct 2021 19:03:20 +0200 Subject: [PATCH 0897/1460] Update pdf.php --- htdocs/admin/pdf.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index a245c9338c9..fdb0dae6ff0 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -165,8 +165,8 @@ if ($action == 'update') { dolibarr_set_const($db, "PDF_SHOW_LINK_TO_ONLINE_PAYMENT", GETPOST('PDF_SHOW_LINK_TO_ONLINE_PAYMENT', 'alpha'), 'chaine', 0, '', $conf->entity); } - if (GETPOSTISSET('PDF_USE_1A')) { - dolibarr_set_const($db, "PDF_USE_1A", GETPOST('PDF_USE_1A', 'alpha'), 'chaine', 0, '', $conf->entity); + if (GETPOSTISSET('PDF_USE_A')) { + dolibarr_set_const($db, "PDF_USE_A", GETPOST('PDF_USE_A', 'alpha'), 'chaine', 0, '', $conf->entity); } setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); @@ -538,11 +538,11 @@ if ($conf->use_javascript_ajax) { } print ''; -print ''.$langs->trans("PDF_USE_1A").''; +print ''.$langs->trans("PDF_USE_A").''; if ($conf->use_javascript_ajax) { - print ajax_constantonoff('PDF_USE_1A'); + print ajax_constantonoff('PDF_USE_A'); } else { - print $form->selectyesno('PDF_USE_1A', (!empty($conf->global->PDF_USE_1A)) ? $conf->global->PDF_USE_1A : 0, 1); + print $form->selectyesno('PDF_USE_A', (empty($conf->global->PDF_USE_1A) ? 0 : $conf->global->PDF_USE_A, 1); } print ''; From bbe867a7a97fb9c86191471a19577a21cbdd3281 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Oct 2021 19:06:50 +0200 Subject: [PATCH 0898/1460] Update commonobject.class.php --- htdocs/core/class/commonobject.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 8689f7c26d1..ad99ef4fff3 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -9169,9 +9169,9 @@ abstract class CommonObject if ($key == 'customsql') { $sqlwhere[] = $value; } elseif (strpos($value, '%') === false) { - $sqlwhere[] = $key.' IN ('.$this->db->sanitize($this->db->escape($value)).')'; + $sqlwhere[] = $key." IN (".$this->db->sanitize($this->db->escape($value)).")"; } else { - $sqlwhere[] = $key.' LIKE \'%'.$this->db->escape($value).'%\''; + $sqlwhere[] = $key." LIKE '%".$this->db->escape($value)."%'"; } } } From 9469c0dc2b922e66a82b36a294e3739b6a4f6f36 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Oct 2021 19:10:50 +0200 Subject: [PATCH 0899/1460] Update commonobject.class.php --- htdocs/core/class/commonobject.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index ad99ef4fff3..c9740951fc9 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -9058,7 +9058,9 @@ abstract class CommonObject $columnName = $deleteFromObject[2]; $TMoreSQL = array(); $more_sql = $deleteFromObject[3]; - if (!empty($more_sql)) $TMoreSQL['customsql'] = $more_sql; + if (!empty($more_sql)) { + $TMoreSQL['customsql'] = $more_sql; + } if (dol_include_once($filePath)) { $childObject = new $className($this->db); if (method_exists($childObject, 'deleteByParentField')) { From dd0809b528334fcc0f38cb836849d8bb97986dfe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Oct 2021 19:37:57 +0200 Subject: [PATCH 0900/1460] Fix trans labels status --- htdocs/adherents/class/adherent.class.php | 8 +-- .../adherents/class/adherent_type.class.php | 8 +-- htdocs/asset/class/asset.class.php | 8 +-- htdocs/comm/action/class/actioncomm.class.php | 12 ++-- .../action/class/actioncommreminder.class.php | 12 ++-- htdocs/comm/mailing/class/mailing.class.php | 24 ++++---- htdocs/compta/bank/class/account.class.php | 8 +-- .../cashcontrol/class/cashcontrol.class.php | 8 +-- .../facture/class/facture-rec.class.php | 55 +++++++++---------- .../cheque/class/remisecheque.class.php | 8 +-- .../class/bonprelevement.class.php | 16 +++--- .../class/ligneprelevement.class.php | 12 ++-- .../sociales/class/chargesociales.class.php | 12 ++-- htdocs/compta/tva/class/tva.class.php | 12 ++-- htdocs/contact/class/contact.class.php | 4 +- .../core/class/emailsenderprofile.class.php | 4 +- htdocs/cron/class/cronjob.class.php | 8 +-- htdocs/delivery/class/delivery.class.php | 12 ++-- .../class/emailcollector.class.php | 8 +-- .../class/conferenceorbooth.class.php | 24 ++++---- htdocs/expedition/class/expedition.class.php | 4 +- htdocs/holiday/class/holiday.class.php | 20 +++---- htdocs/hrm/class/establishment.class.php | 8 +-- htdocs/hrm/class/evaluation.class.php | 12 ++-- htdocs/hrm/class/evaluationdet.class.php | 12 ++-- htdocs/hrm/class/job.class.php | 12 ++-- htdocs/hrm/class/position.class.php | 12 ++-- htdocs/hrm/class/skill.class.php | 12 ++-- htdocs/hrm/class/skilldet.class.php | 12 ++-- htdocs/hrm/class/skillrank.class.php | 12 ++-- .../class/knowledgerecord.class.php | 12 ++-- htdocs/loan/class/loan.class.php | 16 +++--- .../template/class/myobject.class.php | 12 ++-- .../class/opensurveysondage.class.php | 12 ++-- .../partnership/class/partnership.class.php | 20 +++---- htdocs/product/class/product.class.php | 38 ++++++------- .../class/productfournisseurprice.class.php | 12 ++-- .../inventory/class/inventory.class.php | 16 +++--- htdocs/product/stock/class/entrepot.class.php | 4 +- htdocs/projet/class/project.class.php | 2 +- htdocs/reception/class/reception.class.php | 4 +- .../class/recruitmentcandidature.class.php | 28 +++++----- .../class/recruitmentjobposition.class.php | 16 +++--- htdocs/salaries/class/salary.class.php | 12 ++-- .../class/companypaymentmode.class.php | 8 +-- htdocs/societe/class/societe.class.php | 8 +-- htdocs/ticket/class/cticketcategory.class.php | 8 +-- htdocs/ticket/class/ticket.class.php | 6 +- htdocs/user/class/user.class.php | 8 +-- htdocs/website/class/website.class.php | 8 +-- htdocs/website/class/websitepage.class.php | 8 +-- .../workstation/class/workstation.class.php | 4 +- htdocs/zapier/class/hook.class.php | 8 +-- 53 files changed, 323 insertions(+), 326 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 0d1d1bae48b..537e28f19a6 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -2338,12 +2338,12 @@ class Adherent extends CommonObject } } elseif ($status == self::STATUS_RESILIATED) { $statusType = 'status6'; - $labelStatus = $langs->trans("MemberStatusResiliated"); - $labelStatusShort = $langs->trans("MemberStatusResiliatedShort"); + $labelStatus = $langs->transnoentitiesnoconv("MemberStatusResiliated"); + $labelStatusShort = $langs->transnoentitiesnoconv("MemberStatusResiliatedShort"); } elseif ($status == self::STATUS_EXCLUDED) { $statusType = 'status10'; - $labelStatus = $langs->trans("MemberStatusExcluded"); - $labelStatusShort = $langs->trans("MemberStatusExcludedShort"); + $labelStatus = $langs->transnoentitiesnoconv("MemberStatusExcluded"); + $labelStatusShort = $langs->transnoentitiesnoconv("MemberStatusExcludedShort"); } return dolGetStatus($labelStatus, $labelStatusShort, '', $statusType, $mode); diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 88dbf6e2b39..90b34e604be 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -737,10 +737,10 @@ class AdherentType extends CommonObject } if (empty($this->labelStatus) || empty($this->labelStatusShort)) { - $this->labelStatus[0] = $langs->trans("ActivityCeased"); - $this->labelStatus[1] = $langs->trans("InActivity"); - $this->labelStatusShort[0] = $langs->trans("ActivityCeased"); - $this->labelStatusShort[1] = $langs->trans("InActivity"); + $this->labelStatus[0] = $langs->transnoentitiesnoconv("ActivityCeased"); + $this->labelStatus[1] = $langs->transnoentitiesnoconv("InActivity"); + $this->labelStatusShort[0] = $langs->transnoentitiesnoconv("ActivityCeased"); + $this->labelStatusShort[1] = $langs->transnoentitiesnoconv("InActivity"); } return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 34e0a732f57..e5ec21bfa6d 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -390,11 +390,11 @@ class Asset extends CommonObject $langs->load("contracts"); $labelStatus = array(); - $labelStatus[self::STATUS_DRAFT] = $langs->trans('Disabled'); - $labelStatus[self::STATUS_VALIDATED] = $langs->trans('Enabled'); + $labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Disabled'); + $labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); $labelStatusShort = array(); - $labelStatusShort[self::STATUS_DRAFT] = $langs->trans('Disabled'); - $labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('Enabled'); + $labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Disabled'); + $labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); $statusType = 'status0'; if ($status == self::STATUS_VALIDATED) { diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 4a7128fa865..6d1b53cbca0 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1465,18 +1465,18 @@ class ActionComm extends CommonObject // phpcs:enable global $langs; - $labelStatus = $langs->trans('StatusNotApplicable'); + $labelStatus = $langs->transnoentitiesnoconv('StatusNotApplicable'); if ($percent == -1 && !$hidenastatus) { - $labelStatus = $langs->trans('StatusNotApplicable'); + $labelStatus = $langs->transnoentitiesnoconv('StatusNotApplicable'); } elseif ($percent == 0) { - $labelStatus = $langs->trans('StatusActionToDo').' (0%)'; + $labelStatus = $langs->transnoentitiesnoconv('StatusActionToDo').' (0%)'; } elseif ($percent > 0 && $percent < 100) { - $labelStatus = $langs->trans('StatusActionInProcess').' ('.$percent.'%)'; + $labelStatus = $langs->transnoentitiesnoconv('StatusActionInProcess').' ('.$percent.'%)'; } elseif ($percent >= 100) { - $labelStatus = $langs->trans('StatusActionDone').' (100%)'; + $labelStatus = $langs->transnoentitiesnoconv('StatusActionDone').' (100%)'; } - $labelStatusShort = $langs->trans('StatusNotApplicable'); + $labelStatusShort = $langs->transnoentitiesnoconv('StatusNotApplicable'); if ($percent == -1 && !$hidenastatus) { $labelStatusShort = $langs->trans('NA'); } elseif ($percent == 0) { diff --git a/htdocs/comm/action/class/actioncommreminder.class.php b/htdocs/comm/action/class/actioncommreminder.class.php index e675c93d472..aa693d2e41f 100644 --- a/htdocs/comm/action/class/actioncommreminder.class.php +++ b/htdocs/comm/action/class/actioncommreminder.class.php @@ -228,18 +228,18 @@ class ActionCommReminder extends CommonObject // phpcs:enable global $langs; - $labelStatus = $langs->trans('ToDo'); + $labelStatus = $langs->transnoentitiesnoconv('ToDo'); if ($status == 1) { - $labelStatus = $langs->trans('Done'); + $labelStatus = $langs->transnoentitiesnoconv('Done'); } elseif ($status == -1) { - $labelStatus = $langs->trans('Error'); + $labelStatus = $langs->transnoentitiesnoconv('Error'); } - $labelStatusShort = $langs->trans('ToDo'); + $labelStatusShort = $langs->transnoentitiesnoconv('ToDo'); if ($status == 1) { - $labelStatus = $langs->trans('Done'); + $labelStatus = $langs->transnoentitiesnoconv('Done'); } elseif ($status == -1) { - $labelStatus = $langs->trans('Error'); + $labelStatus = $langs->transnoentitiesnoconv('Error'); } $statusType = 'status5'; diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index 2f9ef25af31..cb900f7ac7b 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -776,8 +776,8 @@ class Mailing extends CommonObject global $langs; $langs->load("mailing"); - $labelStatus = $langs->trans($this->statuts[$status]); - $labelStatusShort = $langs->trans($this->statuts[$status]); + $labelStatus = $langs->transnoentitiesnoconv($this->statuts[$status]); + $labelStatusShort = $langs->transnoentitiesnoconv($this->statuts[$status]); $statusType = 'status'.$status; if ($status == 2) { @@ -808,16 +808,16 @@ class Mailing extends CommonObject $labelStatus = array(); $labelStatusShort = array(); - $labelStatus[-1] = $langs->trans('MailingStatusError'); - $labelStatus[0] = $langs->trans('MailingStatusNotSent'); - $labelStatus[1] = $langs->trans('MailingStatusSent'); - $labelStatus[2] = $langs->trans('MailingStatusRead'); - $labelStatus[3] = $langs->trans('MailingStatusNotContact'); - $labelStatusShort[-1] = $langs->trans('MailingStatusError'); - $labelStatusShort[0] = $langs->trans('MailingStatusNotSent'); - $labelStatusShort[1] = $langs->trans('MailingStatusSent'); - $labelStatusShort[2] = $langs->trans('MailingStatusRead'); - $labelStatusShort[3] = $langs->trans('MailingStatusNotContact'); + $labelStatus[-1] = $langs->transnoentitiesnoconv('MailingStatusError'); + $labelStatus[0] = $langs->transnoentitiesnoconv('MailingStatusNotSent'); + $labelStatus[1] = $langs->transnoentitiesnoconv('MailingStatusSent'); + $labelStatus[2] = $langs->transnoentitiesnoconv('MailingStatusRead'); + $labelStatus[3] = $langs->transnoentitiesnoconv('MailingStatusNotContact'); + $labelStatusShort[-1] = $langs->transnoentitiesnoconv('MailingStatusError'); + $labelStatusShort[0] = $langs->transnoentitiesnoconv('MailingStatusNotSent'); + $labelStatusShort[1] = $langs->transnoentitiesnoconv('MailingStatusSent'); + $labelStatusShort[2] = $langs->transnoentitiesnoconv('MailingStatusRead'); + $labelStatusShort[3] = $langs->transnoentitiesnoconv('MailingStatusNotContact'); $statusType = 'status'.$status; if ($status == -1) { diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 8396979e247..685c78f5f1b 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1125,12 +1125,12 @@ class Account extends CommonObject $langs->load('banks'); if ($status == self::STATUS_OPEN) { - $label = $langs->trans("StatusAccountOpened"); - $labelshort = $langs->trans("StatusAccountOpened"); + $label = $langs->transnoentitiesnoconv("StatusAccountOpened"); + $labelshort = $langs->transnoentitiesnoconv("StatusAccountOpened"); $statusType = 'status4'; } else { - $label = $langs->trans("StatusAccountClosed"); - $labelshort = $langs->trans("StatusAccountClosed"); + $label = $langs->transnoentitiesnoconv("StatusAccountClosed"); + $labelshort = $langs->transnoentitiesnoconv("StatusAccountClosed"); $statusType = 'status5'; } diff --git a/htdocs/compta/cashcontrol/class/cashcontrol.class.php b/htdocs/compta/cashcontrol/class/cashcontrol.class.php index 27f3b974a79..5308c8df1d6 100644 --- a/htdocs/compta/cashcontrol/class/cashcontrol.class.php +++ b/htdocs/compta/cashcontrol/class/cashcontrol.class.php @@ -378,10 +378,10 @@ class CashControl extends CommonObject if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("mymodule"); - $this->labelStatus[0] = $langs->trans('Draft'); - $this->labelStatus[1] = $langs->trans('Closed'); - $this->labelStatusShort[0] = $langs->trans('Draft'); - $this->labelStatusShort[1] = $langs->trans('Closed'); + $this->labelStatus[0] = $langs->transnoentitiesnoconv('Draft'); + $this->labelStatus[1] = $langs->transnoentitiesnoconv('Closed'); + $this->labelStatusShort[0] = $langs->transnoentitiesnoconv('Draft'); + $this->labelStatusShort[1] = $langs->transnoentitiesnoconv('Closed'); } $statusType = 'status0'; diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 92615658a58..852cd2865bb 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -1461,56 +1461,55 @@ class FactureRec extends CommonInvoice global $langs; $langs->load('bills'); - $labelStatus = $langs->trans('Active'); + $labelStatus = $langs->transnoentitiesnoconv('Active'); $statusType = 'status0'; //print "$recur,$status,$mode,$alreadypaid,$type"; if ($mode == 0) { - $prefix = ''; if ($recur) { if ($status == self::STATUS_SUSPENDED) { - $labelStatus = $langs->trans('Disabled'); + $labelStatus = $langs->transnoentitiesnoconv('Disabled'); } else { - $labelStatus = $langs->trans('Active'); + $labelStatus = $langs->transnoentitiesnoconv('Active'); } } else { if ($status == self::STATUS_SUSPENDED) { - $labelStatus = $langs->trans('Disabled'); + $labelStatus = $langs->transnoentitiesnoconv('Disabled'); } else { - $labelStatus = $langs->trans("Draft"); + $labelStatus = $langs->transnoentitiesnoconv("Draft"); } } } elseif ($mode == 1) { $prefix = 'Short'; if ($recur) { if ($status == self::STATUS_SUSPENDED) { - $labelStatus = $langs->trans('Disabled'); + $labelStatus = $langs->transnoentitiesnoconv('Disabled'); } else { - $labelStatus = $langs->trans('Active'); + $labelStatus = $langs->transnoentitiesnoconv('Active'); } } else { if ($status == self::STATUS_SUSPENDED) { - $labelStatus = $langs->trans('Disabled'); + $labelStatus = $langs->transnoentitiesnoconv('Disabled'); } else { - $labelStatus = $langs->trans("Draft"); + $labelStatus = $langs->transnoentitiesnoconv("Draft"); } } } elseif ($mode == 2) { if ($recur) { if ($status == self::STATUS_SUSPENDED) { $statusType = 'status6'; - $labelStatus = $langs->trans('Disabled'); + $labelStatus = $langs->transnoentitiesnoconv('Disabled'); } else { $statusType = 'status4'; - $labelStatus = $langs->trans('Active'); + $labelStatus = $langs->transnoentitiesnoconv('Active'); } } else { if ($status == self::STATUS_SUSPENDED) { $statusType = 'status6'; - $labelStatus = $langs->trans('Disabled'); + $labelStatus = $langs->transnoentitiesnoconv('Disabled'); } else { $statusType = 'status0'; - $labelStatus = $langs->trans('Draft'); + $labelStatus = $langs->transnoentitiesnoconv('Draft'); } } } elseif ($mode == 3) { @@ -1518,18 +1517,18 @@ class FactureRec extends CommonInvoice $prefix = 'Short'; if ($status == self::STATUS_SUSPENDED) { $statusType = 'status6'; - $labelStatus = $langs->trans('Disabled'); + $labelStatus = $langs->transnoentitiesnoconv('Disabled'); } else { $statusType = 'status4'; - $labelStatus = $langs->trans('Active'); + $labelStatus = $langs->transnoentitiesnoconv('Active'); } } else { if ($status == self::STATUS_SUSPENDED) { $statusType = 'status6'; - $labelStatus = $langs->trans('Disabled'); + $labelStatus = $langs->transnoentitiesnoconv('Disabled'); } else { $statusType = 'status0'; - $labelStatus = $langs->trans('Draft'); + $labelStatus = $langs->transnoentitiesnoconv('Draft'); } } } elseif ($mode == 4) { @@ -1537,18 +1536,18 @@ class FactureRec extends CommonInvoice if ($recur) { if ($status == self::STATUS_SUSPENDED) { $statusType = 'status6'; - $labelStatus = $langs->trans('Disabled'); + $labelStatus = $langs->transnoentitiesnoconv('Disabled'); } else { $statusType = 'status4'; - $labelStatus = $langs->trans('Active'); + $labelStatus = $langs->transnoentitiesnoconv('Active'); } } else { if ($status == self::STATUS_SUSPENDED) { $statusType = 'status6'; - $labelStatus = $langs->trans('Disabled'); + $labelStatus = $langs->transnoentitiesnoconv('Disabled'); } else { $statusType = 'status0'; - $labelStatus = $langs->trans('Draft'); + $labelStatus = $langs->transnoentitiesnoconv('Draft'); } } } elseif ($mode == 5 || $mode == 6) { @@ -1559,25 +1558,23 @@ class FactureRec extends CommonInvoice if ($recur) { if ($status == self::STATUS_SUSPENDED) { $statusType = 'status6'; - $labelStatus = $langs->trans('Disabled'); + $labelStatus = $langs->transnoentitiesnoconv('Disabled'); } else { $statusType = 'status4'; - $labelStatus = $langs->trans('Active'); + $labelStatus = $langs->transnoentitiesnoconv('Active'); } } else { if ($status == self::STATUS_SUSPENDED) { $statusType = 'status6'; - $labelStatus = $langs->trans('Disabled'); + $labelStatus = $langs->transnoentitiesnoconv('Disabled'); } else { $statusType = 'status0'; - $labelStatus = $langs->trans('Draft'); + $labelStatus = $langs->transnoentitiesnoconv('Draft'); } } } - if (empty($labelStatusShort)) { - $labelStatusShort = $labelStatus; - } + $labelStatusShort = $labelStatus; return dolGetStatus($labelStatus, $labelStatusShort, '', $statusType, $mode); } diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index 1d8fd5b3392..c66edfc8fe1 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -1005,10 +1005,10 @@ class RemiseCheque extends CommonObject if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; $langs->load('compta'); - $this->labelStatus[self::STATUS_DRAFT] = $langs->trans('ToValidate'); - $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Validated'); - $this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('ToValidate'); - $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('Validated'); + $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('ToValidate'); + $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Validated'); + $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('ToValidate'); + $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Validated'); } $statusType = 'status'.$status; diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index f4b4b725ed3..a8836d215b2 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -2346,16 +2346,16 @@ class BonPrelevement extends CommonObject if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("mymodule"); - $this->labelStatus[self::STATUS_DRAFT] = $langs->trans('StatusWaiting'); - $this->labelStatus[self::STATUS_TRANSFERED] = $langs->trans('StatusTrans'); - $this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('StatusWaiting'); - $this->labelStatusShort[self::STATUS_TRANSFERED] = $langs->trans('StatusTrans'); + $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('StatusWaiting'); + $this->labelStatus[self::STATUS_TRANSFERED] = $langs->transnoentitiesnoconv('StatusTrans'); + $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('StatusWaiting'); + $this->labelStatusShort[self::STATUS_TRANSFERED] = $langs->transnoentitiesnoconv('StatusTrans'); if ($this->type == 'bank-transfer') { - $this->labelStatus[self::STATUS_DEBITED] = $langs->trans('StatusDebited'); - $this->labelStatusShort[self::STATUS_DEBITED] = $langs->trans('StatusDebited'); + $this->labelStatus[self::STATUS_DEBITED] = $langs->transnoentitiesnoconv('StatusDebited'); + $this->labelStatusShort[self::STATUS_DEBITED] = $langs->transnoentitiesnoconv('StatusDebited'); } else { - $this->labelStatus[self::STATUS_CREDITED] = $langs->trans('StatusCredited'); - $this->labelStatusShort[self::STATUS_CREDITED] = $langs->trans('StatusCredited'); + $this->labelStatus[self::STATUS_CREDITED] = $langs->transnoentitiesnoconv('StatusCredited'); + $this->labelStatusShort[self::STATUS_CREDITED] = $langs->transnoentitiesnoconv('StatusCredited'); } } diff --git a/htdocs/compta/prelevement/class/ligneprelevement.class.php b/htdocs/compta/prelevement/class/ligneprelevement.class.php index dfd8a920f93..0093db77c32 100644 --- a/htdocs/compta/prelevement/class/ligneprelevement.class.php +++ b/htdocs/compta/prelevement/class/ligneprelevement.class.php @@ -137,11 +137,11 @@ class LignePrelevement return $langs->trans($this->statuts[$status]); } elseif ($mode == 1) { if ($status == 0) { - return img_picto($langs->trans($this->statuts[$status]), 'statut1', 'class="valignmiddle"').' '.$langs->trans($this->statuts[$status]); // Waiting + return img_picto($langs->trans($this->statuts[$status]), 'statut1', 'class="valignmiddle"').' '.$langs->transnoentitiesnoconv($this->statuts[$status]); // Waiting } elseif ($status == 2) { - return img_picto($langs->trans($this->statuts[$status]), 'statut6', 'class="valignmiddle"').' '.$langs->trans($this->statuts[$status]); // Credited + return img_picto($langs->trans($this->statuts[$status]), 'statut6', 'class="valignmiddle"').' '.$langs->transnoentitiesnoconv($this->statuts[$status]); // Credited } elseif ($status == 3) { - return img_picto($langs->trans($this->statuts[$status]), 'statut8', 'class="valignmiddle"').' '.$langs->trans($this->statuts[$status]); // Refused + return img_picto($langs->trans($this->statuts[$status]), 'statut8', 'class="valignmiddle"').' '.$langs->transnoentitiesnoconv($this->statuts[$status]); // Refused } } elseif ($mode == 2) { if ($status == 0) { @@ -153,11 +153,11 @@ class LignePrelevement } } elseif ($mode == 3) { if ($status == 0) { - return $langs->trans($this->statuts[$status]).' '.img_picto($langs->trans($this->statuts[$status]), 'statut1', 'class="valignmiddle"'); + return $langs->trans($this->statuts[$status]).' '.img_picto($langs->transnoentitiesnoconv($this->statuts[$status]), 'statut1', 'class="valignmiddle"'); } elseif ($status == 2) { - return $langs->trans($this->statuts[$status]).' '.img_picto($langs->trans($this->statuts[$status]), 'statut6', 'class="valignmiddle"'); + return $langs->trans($this->statuts[$status]).' '.img_picto($langs->transnoentitiesnoconv($this->statuts[$status]), 'statut6', 'class="valignmiddle"'); } elseif ($status == 3) { - return $langs->trans($this->statuts[$status]).' '.img_picto($langs->trans($this->statuts[$status]), 'statut8', 'class="valignmiddle"'); + return $langs->trans($this->statuts[$status]).' '.img_picto($langs->transnoentitiesnoconv($this->statuts[$status]), 'statut8', 'class="valignmiddle"'); } } diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index 0cb7220cfd7..42f850cff5e 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -525,15 +525,15 @@ class ChargeSociales extends CommonObject if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("mymodule"); - $this->labelStatus[self::STATUS_UNPAID] = $langs->trans('Unpaid'); - $this->labelStatus[self::STATUS_PAID] = $langs->trans('Paid'); + $this->labelStatus[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv('Unpaid'); + $this->labelStatus[self::STATUS_PAID] = $langs->transnoentitiesnoconv('Paid'); if ($status == self::STATUS_UNPAID && $alreadypaid > 0) { - $this->labelStatus[self::STATUS_UNPAID] = $langs->trans("BillStatusStarted"); + $this->labelStatus[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv("BillStatusStarted"); } - $this->labelStatusShort[self::STATUS_UNPAID] = $langs->trans('Unpaid'); - $this->labelStatusShort[self::STATUS_PAID] = $langs->trans('Paid'); + $this->labelStatusShort[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv('Unpaid'); + $this->labelStatusShort[self::STATUS_PAID] = $langs->transnoentitiesnoconv('Paid'); if ($status == self::STATUS_UNPAID && $alreadypaid > 0) { - $this->labelStatusShort[self::STATUS_UNPAID] = $langs->trans("BillStatusStarted"); + $this->labelStatusShort[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv("BillStatusStarted"); } } diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index 4ca16ceeecf..8628d7d7836 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -866,15 +866,15 @@ class Tva extends CommonObject if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("mymodule"); - $this->labelStatus[self::STATUS_UNPAID] = $langs->trans('BillStatusNotPaid'); - $this->labelStatus[self::STATUS_PAID] = $langs->trans('BillStatusPaid'); + $this->labelStatus[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv('BillStatusNotPaid'); + $this->labelStatus[self::STATUS_PAID] = $langs->transnoentitiesnoconv('BillStatusPaid'); if ($status == self::STATUS_UNPAID && $alreadypaid <> 0) { - $this->labelStatus[self::STATUS_UNPAID] = $langs->trans("BillStatusStarted"); + $this->labelStatus[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv("BillStatusStarted"); } - $this->labelStatusShort[self::STATUS_UNPAID] = $langs->trans('BillStatusNotPaid'); - $this->labelStatusShort[self::STATUS_PAID] = $langs->trans('BillStatusPaid'); + $this->labelStatusShort[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv('BillStatusNotPaid'); + $this->labelStatusShort[self::STATUS_PAID] = $langs->transnoentitiesnoconv('BillStatusPaid'); if ($status == self::STATUS_UNPAID && $alreadypaid <> 0) { - $this->labelStatusShort[self::STATUS_UNPAID] = $langs->trans("BillStatusStarted"); + $this->labelStatusShort[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv("BillStatusStarted"); } } diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 1aecac97f19..5dec2ade61e 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -1558,8 +1558,8 @@ class Contact extends CommonObject $statusType = 'status5'; } - $label = $langs->trans($labelStatus[$status]); - $labelshort = $langs->trans($labelStatusShort[$status]); + $label = $langs->transnoentitiesnoconv($labelStatus[$status]); + $labelshort = $langs->transnoentitiesnoconv($labelStatusShort[$status]); return dolGetStatus($label, $labelshort, '', $statusType, $mode); } diff --git a/htdocs/core/class/emailsenderprofile.class.php b/htdocs/core/class/emailsenderprofile.class.php index bea56d0701b..bb47e71aea8 100644 --- a/htdocs/core/class/emailsenderprofile.class.php +++ b/htdocs/core/class/emailsenderprofile.class.php @@ -326,9 +326,9 @@ class EmailSenderProfile extends CommonObject global $langs; if ($status == 1) { - $label = $labelshort = $langs->trans('Enabled'); + $label = $labelshort = $langs->transnoentitiesnoconv('Enabled'); } else { - $label = $labelshort = $langs->trans('Disabled'); + $label = $labelshort = $langs->transnoentitiesnoconv('Disabled'); } $statusType = 'status'.$status; diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index e069ea7a326..4a6d61b6daf 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -1432,10 +1432,10 @@ class Cronjob extends CommonObject $moretext .= ' ('.$langs->trans("Error").')'; } - $this->labelStatus[self::STATUS_DISABLED] = $langs->trans('Disabled').$moretext; - $this->labelStatus[self::STATUS_ENABLED] = $langs->trans('Scheduled').$moretext; - $this->labelStatusShort[self::STATUS_DISABLED] = $langs->trans('Disabled'); - $this->labelStatusShort[self::STATUS_ENABLED] = $langs->trans('Scheduled'); + $this->labelStatus[self::STATUS_DISABLED] = $langs->transnoentitiesnoconv('Disabled').$moretext; + $this->labelStatus[self::STATUS_ENABLED] = $langs->transnoentitiesnoconv('Scheduled').$moretext; + $this->labelStatusShort[self::STATUS_DISABLED] = $langs->transnoentitiesnoconv('Disabled'); + $this->labelStatusShort[self::STATUS_ENABLED] = $langs->transnoentitiesnoconv('Scheduled'); } $statusType = 'status4'; diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php index 60c134661ce..c16da2bd608 100644 --- a/htdocs/delivery/class/delivery.class.php +++ b/htdocs/delivery/class/delivery.class.php @@ -846,12 +846,12 @@ class Delivery extends CommonObject if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("mymodule"); - $this->labelStatus[-1] = $langs->trans('StatusDeliveryCanceled'); - $this->labelStatus[0] = $langs->trans('StatusDeliveryDraft'); - $this->labelStatus[1] = $langs->trans('StatusDeliveryValidated'); - $this->labelStatusShort[-1] = $langs->trans('StatusDeliveryCanceled'); - $this->labelStatusShort[0] = $langs->trans('StatusDeliveryDraft'); - $this->labelStatusShort[1] = $langs->trans('StatusDeliveryValidated'); + $this->labelStatus[-1] = $langs->transnoentitiesnoconv('StatusDeliveryCanceled'); + $this->labelStatus[0] = $langs->transnoentitiesnoconv('StatusDeliveryDraft'); + $this->labelStatus[1] = $langs->transnoentitiesnoconv('StatusDeliveryValidated'); + $this->labelStatusShort[-1] = $langs->transnoentitiesnoconv('StatusDeliveryCanceled'); + $this->labelStatusShort[0] = $langs->transnoentitiesnoconv('StatusDeliveryDraft'); + $this->labelStatusShort[1] = $langs->transnoentitiesnoconv('StatusDeliveryValidated'); } $statusType = 'status0'; diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 1e92e1aba4b..0a52969f9f6 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -599,10 +599,10 @@ class EmailCollector extends CommonObject if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("mymodule"); - $this->labelStatus[self::STATUS_ENABLED] = $langs->trans('Enabled'); - $this->labelStatus[self::STATUS_DISABLED] = $langs->trans('Disabled'); - $this->labelStatusShort[self::STATUS_ENABLED] = $langs->trans('Enabled'); - $this->labelStatusShort[self::STATUS_DISABLED] = $langs->trans('Disabled'); + $this->labelStatus[self::STATUS_ENABLED] = $langs->transnoentitiesnoconv('Enabled'); + $this->labelStatus[self::STATUS_DISABLED] = $langs->transnoentitiesnoconv('Disabled'); + $this->labelStatusShort[self::STATUS_ENABLED] = $langs->transnoentitiesnoconv('Enabled'); + $this->labelStatusShort[self::STATUS_DISABLED] = $langs->transnoentitiesnoconv('Disabled'); } $statusType = 'status5'; diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index 90462fdb762..a45a457a34d 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -672,18 +672,18 @@ class ConferenceOrBooth extends ActionComm if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("eventorganization@eventorganization"); - $this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Draft'); - $this->labelStatus[self::STATUS_SUGGESTED] = $langs->trans('Suggested'); - $this->labelStatus[self::STATUS_CONFIRMED] = $langs->trans('Confirmed'); - $this->labelStatus[self::STATUS_NOT_QUALIFIED] = $langs->trans('NotSelected'); - $this->labelStatus[self::STATUS_DONE] = $langs->trans('Done'); - $this->labelStatus[self::STATUS_CANCELED] = $langs->trans('Canceled'); - $this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('Draft'); - $this->labelStatusShort[self::STATUS_SUGGESTED] = $langs->trans('Suggested'); - $this->labelStatusShort[self::STATUS_CONFIRMED] = $langs->trans('Confirmed'); - $this->labelStatusShort[self::STATUS_NOT_QUALIFIED] = $langs->trans('NotSelected'); - $this->labelStatusShort[self::STATUS_DONE] = $langs->trans('Done'); - $this->labelStatusShort[self::STATUS_CANCELED] = $langs->trans('Canceled'); + $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); + $this->labelStatus[self::STATUS_SUGGESTED] = $langs->transnoentitiesnoconv('Suggested'); + $this->labelStatus[self::STATUS_CONFIRMED] = $langs->transnoentitiesnoconv('Confirmed'); + $this->labelStatus[self::STATUS_NOT_QUALIFIED] = $langs->transnoentitiesnoconv('NotSelected'); + $this->labelStatus[self::STATUS_DONE] = $langs->transnoentitiesnoconv('Done'); + $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Canceled'); + $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); + $this->labelStatusShort[self::STATUS_SUGGESTED] = $langs->transnoentitiesnoconv('Suggested'); + $this->labelStatusShort[self::STATUS_CONFIRMED] = $langs->transnoentitiesnoconv('Confirmed'); + $this->labelStatusShort[self::STATUS_NOT_QUALIFIED] = $langs->transnoentitiesnoconv('NotSelected'); + $this->labelStatusShort[self::STATUS_DONE] = $langs->transnoentitiesnoconv('Done'); + $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Canceled'); } $statusType = 'status'.$status; diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 623d3635ba5..14b09651756 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -1853,8 +1853,8 @@ class Expedition extends CommonObject // phpcs:enable global $langs; - $labelStatus = $langs->trans($this->statuts[$status]); - $labelStatusShort = $langs->trans($this->statutshorts[$status]); + $labelStatus = $langs->transnoentitiesnoconv($this->statuts[$status]); + $labelStatusShort = $langs->transnoentitiesnoconv($this->statutshorts[$status]); $statusType = 'status'.$status; if ($status == self::STATUS_VALIDATED) { diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 55d92b7835b..86e3e889639 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -1266,16 +1266,16 @@ class Holiday extends CommonObject if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("mymodule"); - $this->labelStatus[self::STATUS_DRAFT] = $langs->trans('DraftCP'); - $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('ToReviewCP'); - $this->labelStatus[self::STATUS_APPROVED] = $langs->trans('ApprovedCP'); - $this->labelStatus[self::STATUS_CANCELED] = $langs->trans('CancelCP'); - $this->labelStatus[self::STATUS_REFUSED] = $langs->trans('RefuseCP'); - $this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('DraftCP'); - $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('ToReviewCP'); - $this->labelStatusShort[self::STATUS_APPROVED] = $langs->trans('ApprovedCP'); - $this->labelStatusShort[self::STATUS_CANCELED] = $langs->trans('CancelCP'); - $this->labelStatusShort[self::STATUS_REFUSED] = $langs->trans('RefuseCP'); + $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('DraftCP'); + $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('ToReviewCP'); + $this->labelStatus[self::STATUS_APPROVED] = $langs->transnoentitiesnoconv('ApprovedCP'); + $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('CancelCP'); + $this->labelStatus[self::STATUS_REFUSED] = $langs->transnoentitiesnoconv('RefuseCP'); + $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('DraftCP'); + $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('ToReviewCP'); + $this->labelStatusShort[self::STATUS_APPROVED] = $langs->transnoentitiesnoconv('ApprovedCP'); + $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('CancelCP'); + $this->labelStatusShort[self::STATUS_REFUSED] = $langs->transnoentitiesnoconv('RefuseCP'); } $params = array(); diff --git a/htdocs/hrm/class/establishment.class.php b/htdocs/hrm/class/establishment.class.php index a9082a02b5e..88e93f1398f 100644 --- a/htdocs/hrm/class/establishment.class.php +++ b/htdocs/hrm/class/establishment.class.php @@ -369,10 +369,10 @@ class Establishment extends CommonObject if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("mymodule"); - $this->labelStatus[self::STATUS_OPEN] = $langs->trans('Open'); - $this->labelStatus[self::STATUS_CLOSED] = $langs->trans('Closed'); - $this->labelStatusShort[self::STATUS_OPEN] = $langs->trans('Open'); - $this->labelStatusShort[self::STATUS_CLOSED] = $langs->trans('Closed'); + $this->labelStatus[self::STATUS_OPEN] = $langs->transnoentitiesnoconv('Open'); + $this->labelStatus[self::STATUS_CLOSED] = $langs->transnoentitiesnoconv('Closed'); + $this->labelStatusShort[self::STATUS_OPEN] = $langs->transnoentitiesnoconv('Open'); + $this->labelStatusShort[self::STATUS_CLOSED] = $langs->transnoentitiesnoconv('Closed'); } $statusType = 'status'.$status; diff --git a/htdocs/hrm/class/evaluation.class.php b/htdocs/hrm/class/evaluation.class.php index 30e95e2d44e..f1a446c43b7 100644 --- a/htdocs/hrm/class/evaluation.class.php +++ b/htdocs/hrm/class/evaluation.class.php @@ -844,12 +844,12 @@ class Evaluation extends CommonObject if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("hrm"); - $this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Draft'); - $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Validated'); - $this->labelStatus[self::STATUS_CLOSED] = $langs->trans('Closed'); - $this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('Draft'); - $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('Validated'); - $this->labelStatus[self::STATUS_CLOSED] = $langs->trans('Closed'); + $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); + $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Validated'); + $this->labelStatus[self::STATUS_CLOSED] = $langs->transnoentitiesnoconv('Closed'); + $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); + $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Validated'); + $this->labelStatus[self::STATUS_CLOSED] = $langs->transnoentitiesnoconv('Closed'); } $statusType = 'status'.$status; diff --git a/htdocs/hrm/class/evaluationdet.class.php b/htdocs/hrm/class/evaluationdet.class.php index 83a4c5a387b..a268f1b30be 100644 --- a/htdocs/hrm/class/evaluationdet.class.php +++ b/htdocs/hrm/class/evaluationdet.class.php @@ -816,12 +816,12 @@ class Evaluationline extends CommonObject if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("hrm"); - $this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Draft'); - $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Enabled'); - $this->labelStatus[self::STATUS_CANCELED] = $langs->trans('Disabled'); - $this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('Draft'); - $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('Enabled'); - $this->labelStatusShort[self::STATUS_CANCELED] = $langs->trans('Disabled'); + $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); + $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); + $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled'); + $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); + $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); + $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled'); } $statusType = 'status'.$status; diff --git a/htdocs/hrm/class/job.class.php b/htdocs/hrm/class/job.class.php index 4ff5ccbe303..969b5246419 100644 --- a/htdocs/hrm/class/job.class.php +++ b/htdocs/hrm/class/job.class.php @@ -850,12 +850,12 @@ class Job extends CommonObject if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("hrm"); - $this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Draft'); - $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Enabled'); - $this->labelStatus[self::STATUS_CANCELED] = $langs->trans('Disabled'); - $this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('Draft'); - $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('Enabled'); - $this->labelStatusShort[self::STATUS_CANCELED] = $langs->trans('Disabled'); + $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); + $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); + $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled'); + $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); + $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); + $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled'); } $statusType = 'status'.$status; diff --git a/htdocs/hrm/class/position.class.php b/htdocs/hrm/class/position.class.php index f349514b69a..2a0d04fe393 100644 --- a/htdocs/hrm/class/position.class.php +++ b/htdocs/hrm/class/position.class.php @@ -825,12 +825,12 @@ class Position extends CommonObject if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("hrm"); - $this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Draft'); - $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Enabled'); - $this->labelStatus[self::STATUS_CANCELED] = $langs->trans('Disabled'); - $this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('Draft'); - $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('Enabled'); - $this->labelStatusShort[self::STATUS_CANCELED] = $langs->trans('Disabled'); + $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); + $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); + $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled'); + $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); + $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); + $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled'); } $statusType = 'status' . $status; diff --git a/htdocs/hrm/class/skill.class.php b/htdocs/hrm/class/skill.class.php index ba7d0f43d3c..45e9eb6701c 100644 --- a/htdocs/hrm/class/skill.class.php +++ b/htdocs/hrm/class/skill.class.php @@ -867,12 +867,12 @@ class Skill extends CommonObject if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("hrm"); - $this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Draft'); - $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Enabled'); - $this->labelStatus[self::STATUS_CANCELED] = $langs->trans('Disabled'); - $this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('Draft'); - $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('Enabled'); - $this->labelStatusShort[self::STATUS_CANCELED] = $langs->trans('Disabled'); + $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); + $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); + $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled'); + $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); + $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); + $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled'); } $statusType = 'status'.$status; diff --git a/htdocs/hrm/class/skilldet.class.php b/htdocs/hrm/class/skilldet.class.php index e4ac293c297..e3f2d011b85 100644 --- a/htdocs/hrm/class/skilldet.class.php +++ b/htdocs/hrm/class/skilldet.class.php @@ -804,12 +804,12 @@ class Skilldet extends CommonObject if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("hrm"); - $this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Draft'); - $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Enabled'); - $this->labelStatus[self::STATUS_CANCELED] = $langs->trans('Disabled'); - $this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('Draft'); - $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('Enabled'); - $this->labelStatusShort[self::STATUS_CANCELED] = $langs->trans('Disabled'); + $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); + $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); + $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled'); + $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); + $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); + $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled'); } $statusType = 'status'.$status; diff --git a/htdocs/hrm/class/skillrank.class.php b/htdocs/hrm/class/skillrank.class.php index 97fcd7edab4..a07015ef763 100644 --- a/htdocs/hrm/class/skillrank.class.php +++ b/htdocs/hrm/class/skillrank.class.php @@ -843,12 +843,12 @@ class SkillRank extends CommonObject if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("hrm"); - $this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Draft'); - $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Enabled'); - $this->labelStatus[self::STATUS_CANCELED] = $langs->trans('Disabled'); - $this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('Draft'); - $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('Enabled'); - $this->labelStatusShort[self::STATUS_CANCELED] = $langs->trans('Disabled'); + $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); + $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); + $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled'); + $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); + $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); + $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled'); } $statusType = 'status'.$status; diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php index 11048db0502..a152a693343 100644 --- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php +++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php @@ -827,12 +827,12 @@ class KnowledgeRecord extends CommonObject if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("knowledgemanagement"); - $this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Draft'); - $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Validated'); - $this->labelStatus[self::STATUS_CANCELED] = $langs->trans('Disabled'); - $this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('Draft'); - $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('Validated'); - $this->labelStatusShort[self::STATUS_CANCELED] = $langs->trans('Disabled'); + $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); + $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Validated'); + $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled'); + $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); + $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Validated'); + $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled'); } $statusType = 'status'.$status; diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php index 0ec7786fc20..ec9ce00b7e9 100644 --- a/htdocs/loan/class/loan.class.php +++ b/htdocs/loan/class/loan.class.php @@ -517,17 +517,17 @@ class Loan extends CommonObject unset($this->labelStatus); // Force to reset the array of status label, because label can change depending on parameters if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; - $this->labelStatus[self::STATUS_UNPAID] = $langs->trans('Unpaid'); - $this->labelStatus[self::STATUS_PAID] = $langs->trans('Paid'); - $this->labelStatus[self::STATUS_STARTED] = $langs->trans("BillStatusStarted"); + $this->labelStatus[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv('Unpaid'); + $this->labelStatus[self::STATUS_PAID] = $langs->transnoentitiesnoconv('Paid'); + $this->labelStatus[self::STATUS_STARTED] = $langs->transnoentitiesnoconv("BillStatusStarted"); if ($status == 0 && $alreadypaid > 0) { - $this->labelStatus[self::STATUS_UNPAID] = $langs->trans("BillStatusStarted"); + $this->labelStatus[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv("BillStatusStarted"); } - $this->labelStatusShort[self::STATUS_UNPAID] = $langs->trans('Unpaid'); - $this->labelStatusShort[self::STATUS_PAID] = $langs->trans('Enabled'); - $this->labelStatusShort[self::STATUS_STARTED] = $langs->trans("BillStatusStarted"); + $this->labelStatusShort[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv('Unpaid'); + $this->labelStatusShort[self::STATUS_PAID] = $langs->transnoentitiesnoconv('Enabled'); + $this->labelStatusShort[self::STATUS_STARTED] = $langs->transnoentitiesnoconv("BillStatusStarted"); if ($status == 0 && $alreadypaid > 0) { - $this->labelStatusShort[self::STATUS_UNPAID] = $langs->trans("BillStatusStarted"); + $this->labelStatusShort[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv("BillStatusStarted"); } } diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index ad1774b149e..1c0d17ae373 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -883,12 +883,12 @@ class MyObject extends CommonObject if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("mymodule@mymodule"); - $this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Draft'); - $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Enabled'); - $this->labelStatus[self::STATUS_CANCELED] = $langs->trans('Disabled'); - $this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('Draft'); - $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('Enabled'); - $this->labelStatusShort[self::STATUS_CANCELED] = $langs->trans('Disabled'); + $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); + $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); + $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled'); + $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); + $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); + $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled'); } $statusType = 'status'.$status; diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index e35abff84bb..5888ddf3ec8 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -652,12 +652,12 @@ class Opensurveysondage extends CommonObject if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("mymodule"); - $this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Draft'); - $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Opened'); - $this->labelStatus[self::STATUS_CLOSED] = $langs->trans('Closed'); - $this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('Draft'); - $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('Opened'); - $this->labelStatusShort[self::STATUS_CLOSED] = $langs->trans('Closed'); + $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); + $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Opened'); + $this->labelStatus[self::STATUS_CLOSED] = $langs->transnoentitiesnoconv('Closed'); + $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); + $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Opened'); + $this->labelStatusShort[self::STATUS_CLOSED] = $langs->transnoentitiesnoconv('Closed'); } $statusType = 'status'.$status; diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index f40b771b34d..2df00b2724f 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -1065,16 +1065,16 @@ class Partnership extends CommonObject if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("partnership"); - $this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Draft'); - $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Validated'); - $this->labelStatus[self::STATUS_ACCEPTED] = $langs->trans('Accepted'); - $this->labelStatus[self::STATUS_REFUSED] = $langs->trans('Refused'); - $this->labelStatus[self::STATUS_CANCELED] = $langs->trans('Canceled'); - $this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('Draft'); - $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('Validated'); - $this->labelStatusShort[self::STATUS_ACCEPTED] = $langs->trans('Accepted'); - $this->labelStatusShort[self::STATUS_REFUSED] = $langs->trans('Refused'); - $this->labelStatusShort[self::STATUS_CANCELED] = $langs->trans('Canceled'); + $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); + $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Validated'); + $this->labelStatus[self::STATUS_ACCEPTED] = $langs->transnoentitiesnoconv('Accepted'); + $this->labelStatus[self::STATUS_REFUSED] = $langs->transnoentitiesnoconv('Refused'); + $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Canceled'); + $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); + $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Validated'); + $this->labelStatusShort[self::STATUS_ACCEPTED] = $langs->transnoentitiesnoconv('Accepted'); + $this->labelStatusShort[self::STATUS_REFUSED] = $langs->transnoentitiesnoconv('Refused'); + $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Canceled'); } $statusType = 'status'.$status; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index f95869d5d83..1d4a5926b6e 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5019,21 +5019,21 @@ class Product extends CommonObject if ($type == 2) { switch ($mode) { case 0: - $label = ($status == 0 ? $langs->trans('ProductStatusNotOnBatch') : ($status == 1 ? $langs->trans('ProductStatusOnBatch') : $langs->trans('ProductStatusOnSerial'))); + $label = ($status == 0 ? $langs->transnoentitiesnoconv('ProductStatusNotOnBatch') : ($status == 1 ? $langs->transnoentitiesnoconv('ProductStatusOnBatch') : $langs->transnoentitiesnoconv('ProductStatusOnSerial'))); return dolGetStatus($label); case 1: - $label = ($status == 0 ? $langs->trans('ProductStatusNotOnBatchShort') : ($status == 1 ? $langs->trans('ProductStatusOnBatchShort') : $langs->trans('ProductStatusOnSerialShort'))); + $label = ($status == 0 ? $langs->transnoentitiesnoconv('ProductStatusNotOnBatchShort') : ($status == 1 ? $langs->transnoentitiesnoconv('ProductStatusOnBatchShort') : $langs->transnoentitiesnoconv('ProductStatusOnSerialShort'))); return dolGetStatus($label); case 2: return $this->LibStatut($status, 3, 2).' '.$this->LibStatut($status, 1, 2); case 3: - return dolGetStatus($langs->trans('ProductStatusNotOnBatch'), '', '', empty($status) ? 'status5' : 'status4', 3, 'dot'); + return dolGetStatus($langs->transnoentitiesnoconv('ProductStatusNotOnBatch'), '', '', empty($status) ? 'status5' : 'status4', 3, 'dot'); case 4: return $this->LibStatut($status, 3, 2).' '.$this->LibStatut($status, 0, 2); case 5: return $this->LibStatut($status, 1, 2).' '.$this->LibStatut($status, 3, 2); default: - return dolGetStatus($langs->trans('Unknown')); + return dolGetStatus($langs->transnoentitiesnoconv('Unknown')); } } @@ -5042,34 +5042,34 @@ class Product extends CommonObject if ($status == 0) { // $type 0=Status "to sell", 1=Status "to buy", 2=Status "to Batch" if ($type == 0) { - $labelStatus = $langs->trans('ProductStatusNotOnSellShort'); - $labelStatusShort = $langs->trans('ProductStatusNotOnSell'); + $labelStatus = $langs->transnoentitiesnoconv('ProductStatusNotOnSellShort'); + $labelStatusShort = $langs->transnoentitiesnoconv('ProductStatusNotOnSell'); } elseif ($type == 1) { - $labelStatus = $langs->trans('ProductStatusNotOnBuyShort'); - $labelStatusShort = $langs->trans('ProductStatusNotOnBuy'); + $labelStatus = $langs->transnoentitiesnoconv('ProductStatusNotOnBuyShort'); + $labelStatusShort = $langs->transnoentitiesnoconv('ProductStatusNotOnBuy'); } elseif ($type == 2) { - $labelStatus = $langs->trans('ProductStatusNotOnBatch'); - $labelStatusShort = $langs->trans('ProductStatusNotOnBatchShort'); + $labelStatus = $langs->transnoentitiesnoconv('ProductStatusNotOnBatch'); + $labelStatusShort = $langs->transnoentitiesnoconv('ProductStatusNotOnBatchShort'); } } elseif ($status == 1) { // $type 0=Status "to sell", 1=Status "to buy", 2=Status "to Batch" if ($type == 0) { - $labelStatus = $langs->trans('ProductStatusOnSellShort'); - $labelStatusShort = $langs->trans('ProductStatusOnSell'); + $labelStatus = $langs->transnoentitiesnoconv('ProductStatusOnSellShort'); + $labelStatusShort = $langs->transnoentitiesnoconv('ProductStatusOnSell'); } elseif ($type == 1) { - $labelStatus = $langs->trans('ProductStatusOnBuyShort'); - $labelStatusShort = $langs->trans('ProductStatusOnBuy'); + $labelStatus = $langs->transnoentitiesnoconv('ProductStatusOnBuyShort'); + $labelStatusShort = $langs->transnoentitiesnoconv('ProductStatusOnBuy'); } elseif ($type == 2) { - $labelStatus = ($status == 1 ? $langs->trans('ProductStatusOnBatch') : $langs->trans('ProductStatusOnSerial')); - $labelStatusShort = ($status == 1 ? $langs->trans('ProductStatusOnBatchShort') : $langs->trans('ProductStatusOnSerialShort')); + $labelStatus = ($status == 1 ? $langs->transnoentitiesnoconv('ProductStatusOnBatch') : $langs->transnoentitiesnoconv('ProductStatusOnSerial')); + $labelStatusShort = ($status == 1 ? $langs->transnoentitiesnoconv('ProductStatusOnBatchShort') : $langs->transnoentitiesnoconv('ProductStatusOnSerialShort')); } } elseif ( $type == 2 && $status == 2 ) { - $labelStatus = $langs->trans('ProductStatusOnSerial'); - $labelStatusShort = $langs->trans('ProductStatusOnSerialShort'); + $labelStatus = $langs->transnoentitiesnoconv('ProductStatusOnSerial'); + $labelStatusShort = $langs->transnoentitiesnoconv('ProductStatusOnSerialShort'); } if ($mode > 6) { - return dolGetStatus($langs->trans('Unknown'), '', '', 'status0', 0); + return dolGetStatus($langs->transnoentitiesnoconv('Unknown'), '', '', 'status0', 0); } else { return dolGetStatus($labelStatus, $labelStatusShort, '', $statuttrans, $mode); } diff --git a/htdocs/product/class/productfournisseurprice.class.php b/htdocs/product/class/productfournisseurprice.class.php index 550b0e5db36..d82d1784938 100644 --- a/htdocs/product/class/productfournisseurprice.class.php +++ b/htdocs/product/class/productfournisseurprice.class.php @@ -675,12 +675,12 @@ class ProductFournisseurPrice extends CommonObject if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("buypricehistory@buypricehistory"); - $this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Draft'); - $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Enabled'); - $this->labelStatus[self::STATUS_CANCELED] = $langs->trans('Disabled'); - $this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('Draft'); - $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('Enabled'); - $this->labelStatusShort[self::STATUS_CANCELED] = $langs->trans('Disabled'); + $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); + $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); + $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled'); + $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); + $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); + $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled'); } $statusType = 'status'.$status; diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index a6d1504a42c..57abc333a58 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -615,14 +615,14 @@ class Inventory extends CommonObject global $langs; $labelStatus = array(); - $labelStatus[self::STATUS_DRAFT] = $langs->trans('Draft'); - $labelStatus[self::STATUS_VALIDATED] = $langs->trans('Validated').' ('.$langs->trans('Started').')'; - $labelStatus[self::STATUS_CANCELED] = $langs->trans('Canceled'); - $labelStatus[self::STATUS_RECORDED] = $langs->trans('Closed'); - $labelStatusShort[self::STATUS_DRAFT] = $langs->trans('Draft'); - $labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('Started'); - $labelStatusShort[self::STATUS_CANCELED] = $langs->trans('Canceled'); - $labelStatusShort[self::STATUS_RECORDED] = $langs->trans('Closed'); + $labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); + $labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Validated').' ('.$langs->transnoentitiesnoconv('Started').')'; + $labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Canceled'); + $labelStatus[self::STATUS_RECORDED] = $langs->transnoentitiesnoconv('Closed'); + $labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); + $labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Started'); + $labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Canceled'); + $labelStatusShort[self::STATUS_RECORDED] = $langs->transnoentitiesnoconv('Closed'); $statusType = 'status'.$status; if ($status == self::STATUS_RECORDED) { diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 991ec70b6aa..fe36b6364fc 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -680,8 +680,8 @@ class Entrepot extends CommonObject } $langs->load('stocks'); - $label = $langs->trans($this->statuts[$status]); - $labelshort = $langs->trans($this->statuts[$status]); + $label = $langs->transnoentitiesnoconv($this->statuts[$status]); + $labelshort = $langs->transnoentitiesnoconv($this->statuts[$status]); return dolGetStatus($label, $labelshort, '', $statusType, $mode); } diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 368fb3c2982..f91714aa3c1 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1152,7 +1152,7 @@ class Project extends CommonObject $statusClass = $statustrans[$status]; } - return dolGetStatus($langs->trans($this->statuts_long[$status]), $langs->trans($this->statuts_short[$status]), '', $statusClass, $mode); + return dolGetStatus($langs->transnoentitiesnoconv($this->statuts_long[$status]), $langs->transnoentitiesnoconv($this->statuts_short[$status]), '', $statusClass, $mode); } /** diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index b88f5519c3f..7f3451ad1ba 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -1167,8 +1167,8 @@ class Reception extends CommonObject // phpcs:enable global $langs; - $labelStatus = $langs->trans($this->statuts[$status]); - $labelStatusShort = $langs->trans($this->statutshorts[$status]); + $labelStatus = $langs->transnoentitiesnoconv($this->statuts[$status]); + $labelStatusShort = $langs->transnoentitiesnoconv($this->statutshorts[$status]); $statusType = 'status'.$status; if ($status == self::STATUS_VALIDATED) { diff --git a/htdocs/recruitment/class/recruitmentcandidature.class.php b/htdocs/recruitment/class/recruitmentcandidature.class.php index fa7df34af14..f05f1389e75 100644 --- a/htdocs/recruitment/class/recruitmentcandidature.class.php +++ b/htdocs/recruitment/class/recruitmentcandidature.class.php @@ -798,20 +798,20 @@ class RecruitmentCandidature extends CommonObject if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("recruitment@recruitment"); - $this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Draft'); - $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Received').' ('.$langs->trans("InterviewToDo").')'; - $this->labelStatus[self::STATUS_CONTRACT_PROPOSED] = $langs->trans('ContractProposed'); - $this->labelStatus[self::STATUS_CONTRACT_SIGNED] = $langs->trans('ContractSigned'); - $this->labelStatus[self::STATUS_CONTRACT_REFUSED] = $langs->trans('ContractRefused'); - $this->labelStatus[self::STATUS_REFUSED] = $langs->trans('Refused'); - $this->labelStatus[self::STATUS_CANCELED] = $langs->trans('Canceled'); - $this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('Draft'); - $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('Received'); - $this->labelStatusShort[self::STATUS_CONTRACT_PROPOSED] = $langs->trans('ContractProposed'); - $this->labelStatusShort[self::STATUS_CONTRACT_SIGNED] = $langs->trans('ContractSigned'); - $this->labelStatusShort[self::STATUS_CONTRACT_REFUSED] = $langs->trans('ContractRefused'); - $this->labelStatusShort[self::STATUS_REFUSED] = $langs->trans('Refused'); - $this->labelStatusShort[self::STATUS_CANCELED] = $langs->trans('Canceled'); + $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); + $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Received').' ('.$langs->transnoentitiesnoconv("InterviewToDo").')'; + $this->labelStatus[self::STATUS_CONTRACT_PROPOSED] = $langs->transnoentitiesnoconv('ContractProposed'); + $this->labelStatus[self::STATUS_CONTRACT_SIGNED] = $langs->transnoentitiesnoconv('ContractSigned'); + $this->labelStatus[self::STATUS_CONTRACT_REFUSED] = $langs->transnoentitiesnoconv('ContractRefused'); + $this->labelStatus[self::STATUS_REFUSED] = $langs->transnoentitiesnoconv('Refused'); + $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Canceled'); + $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); + $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Received'); + $this->labelStatusShort[self::STATUS_CONTRACT_PROPOSED] = $langs->transnoentitiesnoconv('ContractProposed'); + $this->labelStatusShort[self::STATUS_CONTRACT_SIGNED] = $langs->transnoentitiesnoconv('ContractSigned'); + $this->labelStatusShort[self::STATUS_CONTRACT_REFUSED] = $langs->transnoentitiesnoconv('ContractRefused'); + $this->labelStatusShort[self::STATUS_REFUSED] = $langs->transnoentitiesnoconv('Refused'); + $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Canceled'); } $statusType = 'status'.$status; diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php index cbfd11fd431..ccb822a3b17 100644 --- a/htdocs/recruitment/class/recruitmentjobposition.class.php +++ b/htdocs/recruitment/class/recruitmentjobposition.class.php @@ -893,14 +893,14 @@ class RecruitmentJobPosition extends CommonObject if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("recruitment"); - $this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Draft'); - $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Validated'); - $this->labelStatus[self::STATUS_RECRUITED] = $langs->trans('Recruited'); - $this->labelStatus[self::STATUS_CANCELED] = $langs->trans('Canceled'); - $this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('Draft'); - $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('Validated'); - $this->labelStatusShort[self::STATUS_RECRUITED] = $langs->trans('Recruited'); - $this->labelStatusShort[self::STATUS_CANCELED] = $langs->trans('Canceled'); + $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); + $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Validated'); + $this->labelStatus[self::STATUS_RECRUITED] = $langs->transnoentitiesnoconv('Recruited'); + $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Canceled'); + $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); + $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Validated'); + $this->labelStatusShort[self::STATUS_RECRUITED] = $langs->transnoentitiesnoconv('Recruited'); + $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Canceled'); } $statusType = 'status'.$status; diff --git a/htdocs/salaries/class/salary.class.php b/htdocs/salaries/class/salary.class.php index 5c87b3c53b9..454a94bcf1f 100644 --- a/htdocs/salaries/class/salary.class.php +++ b/htdocs/salaries/class/salary.class.php @@ -700,12 +700,12 @@ class Salary extends CommonObject if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("mymodule"); - $this->labelStatus[self::STATUS_UNPAID] = $langs->trans('BillStatusNotPaid'); - $this->labelStatus[self::STATUS_PAID] = $langs->trans('BillStatusPaid'); - if ($status == self::STATUS_UNPAID && $alreadypaid <> 0) $this->labelStatus[self::STATUS_UNPAID] = $langs->trans("BillStatusStarted"); - $this->labelStatusShort[self::STATUS_UNPAID] = $langs->trans('BillStatusNotPaid'); - $this->labelStatusShort[self::STATUS_PAID] = $langs->trans('BillStatusPaid'); - if ($status == self::STATUS_UNPAID && $alreadypaid <> 0) $this->labelStatusShort[self::STATUS_UNPAID] = $langs->trans("BillStatusStarted"); + $this->labelStatus[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv('BillStatusNotPaid'); + $this->labelStatus[self::STATUS_PAID] = $langs->transnoentitiesnoconv('BillStatusPaid'); + if ($status == self::STATUS_UNPAID && $alreadypaid <> 0) $this->labelStatus[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv("BillStatusStarted"); + $this->labelStatusShort[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv('BillStatusNotPaid'); + $this->labelStatusShort[self::STATUS_PAID] = $langs->transnoentitiesnoconv('BillStatusPaid'); + if ($status == self::STATUS_UNPAID && $alreadypaid <> 0) $this->labelStatusShort[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv("BillStatusStarted"); } $statusType = 'status1'; diff --git a/htdocs/societe/class/companypaymentmode.class.php b/htdocs/societe/class/companypaymentmode.class.php index 9574544a11a..8026c467c16 100644 --- a/htdocs/societe/class/companypaymentmode.class.php +++ b/htdocs/societe/class/companypaymentmode.class.php @@ -519,10 +519,10 @@ class CompanyPaymentMode extends CommonObject if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("mymodule"); - $this->labelStatus[self::STATUS_ENABLED] = $langs->trans('Enabled'); - $this->labelStatus[self::STATUS_CANCELED] = $langs->trans('Disabled'); - $this->labelStatusShort[self::STATUS_ENABLED] = $langs->trans('Enabled'); - $this->labelStatusShort[self::STATUS_CANCELED] = $langs->trans('Disabled'); + $this->labelStatus[self::STATUS_ENABLED] = $langs->transnoentitiesnoconv('Enabled'); + $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled'); + $this->labelStatusShort[self::STATUS_ENABLED] = $langs->transnoentitiesnoconv('Enabled'); + $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled'); } $statusType = 'status5'; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index a1c1dae1ffb..460ee6d798a 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2801,10 +2801,10 @@ class Societe extends CommonObject } if (empty($this->labelStatus) || empty($this->labelStatusShort)) { - $this->labelStatus[0] = $langs->trans("ActivityCeased"); - $this->labelStatus[1] = $langs->trans("InActivity"); - $this->labelStatusShort[0] = $langs->trans("ActivityCeased"); - $this->labelStatusShort[1] = $langs->trans("InActivity"); + $this->labelStatus[0] = $langs->transnoentitiesnoconv("ActivityCeased"); + $this->labelStatus[1] = $langs->transnoentitiesnoconv("InActivity"); + $this->labelStatusShort[0] = $langs->transnoentitiesnoconv("ActivityCeased"); + $this->labelStatusShort[1] = $langs->transnoentitiesnoconv("InActivity"); } return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); diff --git a/htdocs/ticket/class/cticketcategory.class.php b/htdocs/ticket/class/cticketcategory.class.php index efd9b84330b..37142a0d278 100644 --- a/htdocs/ticket/class/cticketcategory.class.php +++ b/htdocs/ticket/class/cticketcategory.class.php @@ -745,10 +745,10 @@ class CTicketCategory extends CommonObject if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("mymodule@mymodule"); - $this->labelStatus[self::STATUS_ENABLED] = $langs->trans('Enabled'); - $this->labelStatus[self::STATUS_DISABLED] = $langs->trans('Disabled'); - $this->labelStatusShort[self::STATUS_ENABLED] = $langs->trans('Enabled'); - $this->labelStatusShort[self::STATUS_DISABLED] = $langs->trans('Disabled'); + $this->labelStatus[self::STATUS_ENABLED] = $langs->transnoentitiesnoconv('Enabled'); + $this->labelStatus[self::STATUS_DISABLED] = $langs->transnoentitiesnoconv('Disabled'); + $this->labelStatusShort[self::STATUS_ENABLED] = $langs->transnoentitiesnoconv('Enabled'); + $this->labelStatusShort[self::STATUS_DISABLED] = $langs->transnoentitiesnoconv('Disabled'); } $statusType = 'status'.$status; diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 874036a5c38..9042dccfebd 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1300,8 +1300,8 @@ class Ticket extends CommonObject } elseif ($status == self::STATUS_CLOSED) { $statusType = 'status6'; } else { - $labelStatus = $langs->trans('Unknown'); - $labelStatusShort = $langs->trans('Unknown'); + $labelStatus = 'Unknown'; + $labelStatusShort = 'Unknown'; $statusType = 'status0'; $mode = 0; } @@ -1311,7 +1311,7 @@ class Ticket extends CommonObject $params = array('tooltip' => 'no'); } - return dolGetStatus($langs->trans($labelStatus), $langs->trans($labelStatusShort), '', $statusType, $mode, '', $params); + return dolGetStatus($langs->transnoentitiesnoconv($labelStatus), $langs->transnoentitiesnoconv($labelStatusShort), '', $statusType, $mode, '', $params); } diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 9c68aff2f48..d2c9cc124b6 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -2806,10 +2806,10 @@ class User extends CommonObject if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("mymodule"); - $this->labelStatus[self::STATUS_ENABLED] = $langs->trans('Enabled'); - $this->labelStatus[self::STATUS_DISABLED] = $langs->trans('Disabled'); - $this->labelStatusShort[self::STATUS_ENABLED] = $langs->trans('Enabled'); - $this->labelStatusShort[self::STATUS_DISABLED] = $langs->trans('Disabled'); + $this->labelStatus[self::STATUS_ENABLED] = $langs->transnoentitiesnoconv('Enabled'); + $this->labelStatus[self::STATUS_DISABLED] = $langs->transnoentitiesnoconv('Disabled'); + $this->labelStatusShort[self::STATUS_ENABLED] = $langs->transnoentitiesnoconv('Enabled'); + $this->labelStatusShort[self::STATUS_DISABLED] = $langs->transnoentitiesnoconv('Disabled'); } $statusType = 'status5'; diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index f1a923642e2..396646ac40a 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -867,10 +867,10 @@ class Website extends CommonObject if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("mymodule"); - $this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Disabled'); - $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Enabled'); - $this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('Disabled'); - $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('Enabled'); + $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Disabled'); + $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); + $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Disabled'); + $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); } $statusType = 'status5'; diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index 2199d92f50d..0126f8a4dc4 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -835,10 +835,10 @@ class WebsitePage extends CommonObject if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("mymodule"); - $this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Disabled'); - $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Enabled'); - $this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('Disabled'); - $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('Enabled'); + $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Disabled'); + $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); + $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Disabled'); + $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); } $statusType = 'status5'; diff --git a/htdocs/workstation/class/workstation.class.php b/htdocs/workstation/class/workstation.class.php index 44299c1d363..ab23a55e525 100755 --- a/htdocs/workstation/class/workstation.class.php +++ b/htdocs/workstation/class/workstation.class.php @@ -850,8 +850,8 @@ class Workstation extends CommonObject if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("workstation"); - $this->labelStatus[self::STATUS_DISABLED] = $langs->trans('Disabled'); - $this->labelStatus[self::STATUS_ENABLED] = $langs->trans('Enabled'); + $this->labelStatus[self::STATUS_DISABLED] = $langs->transnoentitiesnoconv('Disabled'); + $this->labelStatus[self::STATUS_ENABLED] = $langs->transnoentitiesnoconv('Enabled'); } $statusType = 'status'.$status; diff --git a/htdocs/zapier/class/hook.class.php b/htdocs/zapier/class/hook.class.php index 5d0155885c2..c3b9147a46d 100644 --- a/htdocs/zapier/class/hook.class.php +++ b/htdocs/zapier/class/hook.class.php @@ -611,10 +611,10 @@ class Hook extends CommonObject if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("mymodule"); - $this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Disabled'); - $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Enabled'); - $this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('Disabled'); - $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('Enabled'); + $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Disabled'); + $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); + $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Disabled'); + $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); } $statusType = 'status5'; From f2757a63a11bdc8b0d645c08c2d252aac42368dc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Oct 2021 20:06:58 +0200 Subject: [PATCH 0901/1460] Clean code --- htdocs/comm/action/card.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 53b6e329c90..00e6b025b44 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -75,8 +75,13 @@ if ($complete == 'na' || $complete == -2) { $complete = -1; } -$datep = dol_mktime($fulldayevent ? '00' : $aphour, $fulldayevent ? '00' : $apmin, 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int')); -$datef = dol_mktime($fulldayevent ? '23' : $p2hour, $fulldayevent ? '59' : $p2min, $fulldayevent ? '59' : '0', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int')); +if ($fulldayevent) { + $datep = dol_mktime('00', '00', 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int')); + $datef = dol_mktime('23', '59', '59', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int')); +} else { + $datep = dol_mktime($aphour, $apmin, 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int')); + $datef = dol_mktime($p2hour, $p2min, '59', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int')); +} // Security check $socid = GETPOST('socid', 'int'); From 830e067eff21993cbfb0fa844a77ca787546d509 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Oct 2021 21:03:47 +0200 Subject: [PATCH 0902/1460] Fix for tzuser --- htdocs/core/lib/functions.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 3ef328924f5..f70b91283ff 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2289,9 +2289,9 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs = $user_date_tz = new DateTimeZone($offsettzstring); $user_dt = new DateTime(); $user_dt->setTimezone($user_date_tz); - $user_dt->setTimestamp($time); + $user_dt->setTimestamp($tzoutput == 'tzuser' ? dol_now() : $time); $offsettz = $user_dt->getOffset(); - } else { + } else { // old method (The 'tzuser' was processed like the 'tzuserrel') $offsettz = (empty($_SESSION['dol_tz']) ? 0 : $_SESSION['dol_tz']) * 60 * 60; // Will not be used anymore $offsetdst = (empty($_SESSION['dol_dst']) ? 0 : $_SESSION['dol_dst']) * 60 * 60; // Will not be used anymore } From 1c07385aba3ad0c7d186ae9ea0475aaab858fae8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Oct 2021 21:22:53 +0200 Subject: [PATCH 0903/1460] Update product.class.php --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index c7a48479f60..55c48be5088 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5281,7 +5281,7 @@ class Product extends CommonObject } $stock_commande_fournisseur = $this->stats_commande_fournisseur['qty']; } - if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) || !empty($conf->reception->enabled)) { + if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && !empty($conf->reception->enabled)) { $filterStatus = '4'; if (isset($includedraftpoforvirtual)) { $filterStatus = '0,'.$filterStatus; From ee6780c46ead89afae3bf11203eb3020f3b8ed99 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Oct 2021 21:37:12 +0200 Subject: [PATCH 0904/1460] FIX #18968 --- htdocs/filefunc.inc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 23852ae4918..1ac8978bbb8 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -176,6 +176,8 @@ if (empty($dolibarr_strict_mode)) { $dolibarr_strict_mode = 0; // For debug in php strict mode } +define('DOL_DOCUMENT_ROOT', $dolibarr_main_document_root); // Filesystem core php (htdocs) + // Security: CSRF protection // This test check if referrer ($_SERVER['HTTP_REFERER']) is same web site than Dolibarr ($_SERVER['HTTP_HOST']) // when we post forms (we allow GET and HEAD to accept direct link from a particular page). @@ -196,6 +198,7 @@ if (!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck)) { if ($csrfattack) { //print 'NOCSRFCHECK='.defined('NOCSRFCHECK').' REQUEST_METHOD='.$_SERVER['REQUEST_METHOD'].' HTTP_HOST='.$_SERVER['HTTP_HOST'].' HTTP_REFERER='.$_SERVER['HTTP_REFERER']; // Note: We can't use dol_escape_htmltag here to escape output because lib functions.lib.ph is not yet loaded. + include_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; dol_syslog("--- Access to ".(empty($_SERVER["REQUEST_METHOD"])?'':$_SERVER["REQUEST_METHOD"].' ').$_SERVER["PHP_SELF"]." refused by CSRF protection (Bad referer).", LOG_WARNING); print "Access refused by CSRF protection in main.inc.php. Referer of form (".htmlentities($_SERVER['HTTP_REFERER'], ENT_COMPAT, 'UTF-8').") is outside the server that serve this page (with method = ".htmlentities($_SERVER['REQUEST_METHOD'], ENT_COMPAT, 'UTF-8').").\n"; print "If you access your server behind a proxy using url rewriting, you might check that all HTTP headers are propagated (or add the line \$dolibarr_nocsrfcheck=1 into your conf.php file to remove this security check).\n"; @@ -228,7 +231,6 @@ if (empty($dolibarr_main_data_root)) { // Define some constants define('DOL_CLASS_PATH', 'class/'); // Filesystem path to class dir (defined only for some code that want to be compatible with old versions without this parameter) define('DOL_DATA_ROOT', $dolibarr_main_data_root); // Filesystem data (documents) -define('DOL_DOCUMENT_ROOT', $dolibarr_main_document_root); // Filesystem core php (htdocs) // Try to autodetect DOL_MAIN_URL_ROOT and DOL_URL_ROOT. // Note: autodetect works only in case 1, 2, 3 and 4 of phpunit test CoreTest.php. For case 5, 6, only setting value into conf.php will works. $tmp = ''; From 8bdece71019f1e2153ea92c7a1f8b6726d9f9fd9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Oct 2021 21:43:48 +0200 Subject: [PATCH 0905/1460] CSS --- htdocs/comm/action/index.php | 2 +- htdocs/comm/action/list.php | 2 +- htdocs/comm/action/pertype.php | 2 +- htdocs/comm/action/peruser.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 9b9525925c5..722423c0cd9 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -484,7 +484,7 @@ print ''; $viewmode = ''; $viewmode .= ''; //$viewmode .= ''; -$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="pictoactionview block"'); +$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="imgforviewmode pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewList").''; diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 8dd8c1b9f58..e7a862434de 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -608,7 +608,7 @@ if ($resql) { $viewmode = ''; $viewmode .= ''; //$viewmode .= ''; - $viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="pictoactionview block"'); + $viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="imgforviewmode pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewList").''; diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index b1fecbf6475..08cef7dd80a 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -416,7 +416,7 @@ $massactionbutton = ''; $viewmode = ''; $viewmode .= ''; //$viewmode .= ''; -$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="pictoactionview block"'); +$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="imgforviewmode pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewList").''; diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 14d052d0257..0d1567ee274 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -426,7 +426,7 @@ $massactionbutton = ''; $viewmode = ''; $viewmode .= ''; //$viewmode .= ''; -$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="pictoactionview block"'); +$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="imgforviewmode pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewList").''; From 102c8a5772fa6c944e685c926768efffb7ff8b8f Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 17 Oct 2021 08:02:28 +0200 Subject: [PATCH 0906/1460] FIX User salary card - translation problem --- htdocs/user/bank.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 0eaf3d533a9..efd1d477a24 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -324,7 +324,8 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac $ret .= ''; print $ret; } else { - print dol_getIdFromCode($db, $object->default_c_exp_tax_cat, 'c_exp_tax_cat', 'rowid', 'label'); + $label_exp_tax_cat = dol_getIdFromCode($db, $object->default_c_exp_tax_cat, 'c_exp_tax_cat', 'rowid', 'label'); + print $langs->trans($label_exp_tax_cat); //print $form->editfieldval("DefaultCategoryCar", 'default_c_exp_tax_cat', $object->default_c_exp_tax_cat, $object, $user->rights->user->user->creer, 'string', ($object->default_c_exp_tax_cat != '' ? $object->default_c_exp_tax_cat : '')); } print ''; From e9ecb2e1eebe19f57a2f41c99fe206c50b1d9b88 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 17 Oct 2021 08:11:34 +0200 Subject: [PATCH 0907/1460] Translation --- htdocs/user/bank.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index efd1d477a24..c77d9bd1232 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -1,12 +1,12 @@ - * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2015 Laurent Destailleur - * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2013 Peter Fontaine - * Copyright (C) 2015-2016 Marcos García - * Copyright (C) 2015 Alexandre Spangaro - * Copyright (C) 2021 Gauthier VERDOL +/* Copyright (C) 2002-2004 Rodolphe Quiedeville + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2013 Peter Fontaine + * Copyright (C) 2015-2016 Marcos García + * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2021 Gauthier VERDOL * * 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 @@ -357,7 +357,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac print '
    '; - // Nbre max d'elements des petites listes + // Max number of elements in small lists $MAXLIST = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT; // Latest payments of salaries From fb301362023d3f7581302ef7c5193eb844b3d7e9 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 17 Oct 2021 08:12:28 +0200 Subject: [PATCH 0908/1460] Translation --- htdocs/langs/en_US/banks.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/banks.lang b/htdocs/langs/en_US/banks.lang index a0b7942d446..6c770163f29 100644 --- a/htdocs/langs/en_US/banks.lang +++ b/htdocs/langs/en_US/banks.lang @@ -182,3 +182,4 @@ BankColorizeMovementName2=Background color for credit movement IfYouDontReconcileDisableProperty=If you don't make the bank reconciliations on some bank accounts, disable the property "%s" on them to remove this warning. NoBankAccountDefined=No bank account defined NoRecordFoundIBankcAccount=No record found in bank account. Commonly, this occurs when a record has been deleted manually from the list of transaction in the bank account (for example during a reconciliation of the bank account). Another reason is that the payment was recorded when the module "%s" was disabled. +AlreadyOneBankAccount=Already one bank account defined From 84e4bd8820ed110dcbf8c771e9d445f88c8b50bf Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 17 Oct 2021 11:59:25 +0200 Subject: [PATCH 0909/1460] NEW add zstd compression --- htdocs/admin/tools/dolibarr_export.php | 7 ++++- htdocs/admin/tools/export.php | 27 +++++++++--------- htdocs/admin/tools/export_files.php | 36 +++++++++++++----------- htdocs/core/class/utils.class.php | 38 ++++++++++++++++++-------- htdocs/core/lib/files.lib.php | 5 +++- 5 files changed, 71 insertions(+), 42 deletions(-) diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index 77200404a03..6215de6396a 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -1,6 +1,6 @@ - * Copyright (C) 2006-2018 Regis Houssin + * Copyright (C) 2006-2021 Regis Houssin * * 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 @@ -441,6 +441,11 @@ if (in_array($type, array('mysql', 'mysqli'))) { 'id' => 'radio_compression_bzip', 'label' => $langs->trans("Bzip2") ); + $compression['zstd'] = array( + 'function' => 'zstd_compress', + 'id' => 'radio_compression_zstd', + 'label' => $langs->trans("Zstd") + ); $compression['none'] = array( 'function' => '', 'id' => 'radio_compression_none', diff --git a/htdocs/admin/tools/export.php b/htdocs/admin/tools/export.php index 0fe8be7d50c..4dd2fbad58e 100644 --- a/htdocs/admin/tools/export.php +++ b/htdocs/admin/tools/export.php @@ -2,20 +2,21 @@ /* Copyright (C) 2006-2014 Laurent Destailleur * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2015 Raphaël Doursenaud + * Copyright (C) 2021 Regis Houssin * -* 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 . -*/ + * 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 . + */ /** * \file htdocs/admin/tools/export.php diff --git a/htdocs/admin/tools/export_files.php b/htdocs/admin/tools/export_files.php index 384b08e19cf..9fabaa3b0b2 100644 --- a/htdocs/admin/tools/export_files.php +++ b/htdocs/admin/tools/export_files.php @@ -2,20 +2,21 @@ /* Copyright (C) 2006-2014 Laurent Destailleur * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2015 Raphaël Doursenaud + * Copyright (C) 2021 Regis Houssin * -* 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 . -*/ + * 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 . + */ /** * \file htdocs/admin/tools/export_files.php @@ -41,7 +42,7 @@ $file = trim(GETPOST('zipfilename_template', 'alpha')); $compression = GETPOST('compression', 'aZ09'); $file = dol_sanitizeFileName($file); -$file = preg_replace('/(\.zip|\.tar|\.tgz|\.gz|\.tar\.gz|\.bz2)$/i', '', $file); +$file = preg_replace('/(\.zip|\.tar|\.tgz|\.gz|\.tar\.gz|\.bz2|\.zst)$/i', '', $file); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); @@ -137,7 +138,7 @@ if ($compression == 'zip') { $errormsg = $langs->trans("ErrorFailedToWriteInDir", $outputdir); } } -} elseif (in_array($compression, array('gz', 'bz'))) { +} elseif (in_array($compression, array('gz', 'bz', 'zstd'))) { $userlogin = ($user->login ? $user->login : 'unknown'); $outputfile = $conf->admin->dir_temp.'/export_files.'.$userlogin.'.out'; // File used with popen method @@ -157,9 +158,12 @@ if ($compression == 'zip') { if ($compression == 'gz') { $cmd = "gzip -f ".$outputdir."/".$file; } - if ($compression == 'bz') { + elseif ($compression == 'bz') { $cmd = "bzip2 -f ".$outputdir."/".$file; } + elseif ($compression == 'zstd') { + $cmd = "zstd -z -9 -q --rm ".$outputdir."/".$file; + } $result = $utils->executeCLI($cmd, $outputfile); diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index fd89a00a810..aff18cd4506 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2016 Laurent Destailleur + * Copyright (C) 2021 Regis Houssin * * 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 @@ -202,7 +203,7 @@ class Utils require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; // Check compression parameter - if (!in_array($compression, array('none', 'gz', 'bz', 'zip'))) { + if (!in_array($compression, array('none', 'gz', 'bz', 'zip', 'zstd'))) { $langs->load("errors"); $this->error = $langs->transnoentitiesnoconv("ErrorBadValueForParameter", $compression, "Compression"); return -1; @@ -249,9 +250,12 @@ class Utils if ($compression == 'gz') { $outputfile .= '.gz'; } - if ($compression == 'bz') { + elseif ($compression == 'bz') { $outputfile .= '.bz2'; } + elseif ($compression == 'zstd') { + $outputfile .= '.zst'; + } $outputerror = $outputfile.'.err'; dol_mkdir($conf->admin->dir_output.'/backup'); @@ -338,12 +342,15 @@ class Utils if ($compression == 'none') { $handle = fopen($outputfile, 'w'); } - if ($compression == 'gz') { + elseif ($compression == 'gz') { $handle = gzopen($outputfile, 'w'); } - if ($compression == 'bz') { + elseif ($compression == 'bz') { $handle = bzopen($outputfile, 'w'); } + elseif ($compression == 'zstd') { + $handle = fopen($outputfile, 'w'); + } $ok = 0; if ($handle) { @@ -409,12 +416,15 @@ class Utils if ($compression == 'none') { fclose($handle); } - if ($compression == 'gz') { + elseif ($compression == 'gz') { gzclose($handle); } - if ($compression == 'bz') { + elseif ($compression == 'bz') { bzclose($handle); } + elseif ($compression == 'zstd') { + fclose($handle); + } if (!empty($conf->global->MAIN_UMASK)) { @chmod($outputfile, octdec($conf->global->MAIN_UMASK)); @@ -429,12 +439,15 @@ class Utils if ($compression == 'none') { $handle = fopen($outputfile, 'r'); } - if ($compression == 'gz') { + elseif ($compression == 'gz') { $handle = gzopen($outputfile, 'r'); } - if ($compression == 'bz') { + elseif ($compression == 'bz') { $handle = bzopen($outputfile, 'r'); } + elseif ($compression == 'zstd') { + $handle = fopen($outputfile, 'r'); + } if ($handle) { // Get 2048 first chars of error message. $errormsg = fgets($handle, 2048); @@ -444,12 +457,15 @@ class Utils if ($compression == 'none') { fclose($handle); } - if ($compression == 'gz') { + elseif ($compression == 'gz') { gzclose($handle); } - if ($compression == 'bz') { + elseif ($compression == 'bz') { bzclose($handle); } + elseif ($compression == 'zstd') { + fclose($handle); + } if ($ok && preg_match('/^-- (MySql|MariaDB)/i', $errormsg)) { // No error $errormsg = ''; } else { diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index d34a8e5ee30..2175de373ef 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1,6 +1,6 @@ - * Copyright (C) 2012-2015 Regis Houssin + * Copyright (C) 2012-2021 Regis Houssin * Copyright (C) 2012-2016 Juanjo Menent * Copyright (C) 2015 Marcos García * Copyright (C) 2016 Raphaël Doursenaud @@ -1971,6 +1971,9 @@ function dol_compress_file($inputfile, $outputfile, $mode = "gz", &$errorstring } elseif ($mode == 'bz') { $foundhandler = 1; $compressdata = bzcompress($data, 9); + } elseif ($mode == 'zstd') { + $foundhandler = 1; + $compressdata = zstd_compress($data, 9); } elseif ($mode == 'zip') { if (class_exists('ZipArchive') && !empty($conf->global->MAIN_USE_ZIPARCHIVE_FOR_ZIP_COMPRESS)) { $foundhandler = 1; From 9fa6a8daa7dfbed476f949abaa0a8f41ded8969e Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sun, 17 Oct 2021 10:05:58 +0000 Subject: [PATCH 0910/1460] Fixing style errors. --- htdocs/core/class/utils.class.php | 36 +++++++++++-------------------- 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index aff18cd4506..6bfbbdb98ad 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -341,14 +341,11 @@ class Utils $fullcommandclear = $command." ".$paramclear." 2>&1"; if ($compression == 'none') { $handle = fopen($outputfile, 'w'); - } - elseif ($compression == 'gz') { + } elseif ($compression == 'gz') { $handle = gzopen($outputfile, 'w'); - } - elseif ($compression == 'bz') { + } elseif ($compression == 'bz') { $handle = bzopen($outputfile, 'w'); - } - elseif ($compression == 'zstd') { + } elseif ($compression == 'zstd') { $handle = fopen($outputfile, 'w'); } @@ -415,14 +412,11 @@ class Utils if ($compression == 'none') { fclose($handle); - } - elseif ($compression == 'gz') { + } elseif ($compression == 'gz') { gzclose($handle); - } - elseif ($compression == 'bz') { + } elseif ($compression == 'bz') { bzclose($handle); - } - elseif ($compression == 'zstd') { + } elseif ($compression == 'zstd') { fclose($handle); } @@ -438,14 +432,11 @@ class Utils // Get errorstring if ($compression == 'none') { $handle = fopen($outputfile, 'r'); - } - elseif ($compression == 'gz') { + } elseif ($compression == 'gz') { $handle = gzopen($outputfile, 'r'); - } - elseif ($compression == 'bz') { + } elseif ($compression == 'bz') { $handle = bzopen($outputfile, 'r'); - } - elseif ($compression == 'zstd') { + } elseif ($compression == 'zstd') { $handle = fopen($outputfile, 'r'); } if ($handle) { @@ -456,14 +447,11 @@ class Utils // Close file if ($compression == 'none') { fclose($handle); - } - elseif ($compression == 'gz') { + } elseif ($compression == 'gz') { gzclose($handle); - } - elseif ($compression == 'bz') { + } elseif ($compression == 'bz') { bzclose($handle); - } - elseif ($compression == 'zstd') { + } elseif ($compression == 'zstd') { fclose($handle); } if ($ok && preg_match('/^-- (MySql|MariaDB)/i', $errormsg)) { // No error From b30d7371a4e407a0ff069fd28aecfedb063968a9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Oct 2021 12:21:22 +0200 Subject: [PATCH 0911/1460] Fix allow ' - ' into file name --- htdocs/core/lib/functions.lib.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index f70b91283ff..14685783564 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1055,7 +1055,7 @@ function dol_size($size, $type = '') /** * Clean a string to use it as a file name. - * Replace also '--' and ' -' strings, they are used for parameters separation. + * Replace also '--' and ' -' strings, they are used for parameters separation (Note: ' - ' is allowed). * * @param string $str String to clean * @param string $newstr String to replace bad chars with. @@ -1073,13 +1073,13 @@ function dol_sanitizeFileName($str, $newstr = '_', $unaccent = 1) $filesystem_forbidden_chars = array('<', '>', '/', '\\', '?', '*', '|', '"', ':', '°', '$', ';'); $tmp = dol_string_nospecial($unaccent ? dol_string_unaccent($str) : $str, $newstr, $filesystem_forbidden_chars); $tmp = preg_replace('/\-\-+/', '_', $tmp); - $tmp = preg_replace('/\s+\-/', ' _', $tmp); + $tmp = preg_replace('/\s+\-([^\s])/', ' _$1', $tmp); return $tmp; } /** * Clean a string to use it as a path name. - * Replace also '--' and ' -' strings, they are used for parameters separation. + * Replace also '--' and ' -' strings, they are used for parameters separation (Note: ' - ' is allowed). * * @param string $str String to clean * @param string $newstr String to replace bad chars with @@ -1093,7 +1093,7 @@ function dol_sanitizePathName($str, $newstr = '_', $unaccent = 1) $filesystem_forbidden_chars = array('<', '>', '?', '*', '|', '"', '°'); $tmp = dol_string_nospecial($unaccent ? dol_string_unaccent($str) : $str, $newstr, $filesystem_forbidden_chars); $tmp = preg_replace('/\-\-+/', '_', $tmp); - $tmp = preg_replace('/\s+\-/', ' _', $tmp); + $tmp = preg_replace('/\s+\-([^\s])/', ' _$1', $tmp); return $tmp; } From ccf78a1af49896c972ffd448f403f78163aee960 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Oct 2021 12:30:08 +0200 Subject: [PATCH 0912/1460] FIX Use of accent into filename of GED --- htdocs/ecm/file_card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/ecm/file_card.php b/htdocs/ecm/file_card.php index 5ca1667ac9f..209b3dceff2 100644 --- a/htdocs/ecm/file_card.php +++ b/htdocs/ecm/file_card.php @@ -67,7 +67,7 @@ if (!$section) { dol_print_error('', 'Error, section parameter missing'); exit; } -$urlfile = (string) dol_sanitizePathName(GETPOST("urlfile")); +$urlfile = (string) dol_sanitizePathName(GETPOST("urlfile"), '_', 0); if (!$urlfile) { dol_print_error('', "ErrorParamNotDefined"); exit; @@ -131,7 +131,7 @@ if ($action == 'update' && $permtoadd) { $error = 0; $oldlabel = GETPOST('urlfile', 'alpha'); - $newlabel = dol_sanitizeFileName(GETPOST('label', 'alpha')); + $newlabel = dol_sanitizeFileName(GETPOST('label', 'alpha'), '_', 0); $shareenabled = GETPOST('shareenabled', 'alpha'); //$db->begin(); From 5ec6d02bfc51a9e00430b41d0bf7294047e30fd1 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 17 Oct 2021 12:49:45 +0200 Subject: [PATCH 0913/1460] Fix php 8 error from develop v15 --- htdocs/main.inc.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 07ab0949a10..6dc3e7bd532 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1042,6 +1042,16 @@ if (!defined('NOLOGIN')) { //Required if advanced permissions are used with MAIN_USE_ADVANCED_PERMS if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { + if (empty($user->rights->user->user_advance)) { + $user->rights->user->user_advance = new stdClass(); // To avoid warnings + } + if (empty($user->rights->user->self_advance)) { + $user->rights->user->self_advance = new stdClass(); // To avoid warnings + } + if (empty($user->rights->user->group_advance)) { + $user->rights->user->group_advance = new stdClass(); // To avoid warnings + } + $user->rights->user->user_advance->readperms = 1; $user->rights->user->user_advance->write = 1; $user->rights->user->self_advance->readperms = 1; From 10bd8db9b1b085ed97402ec2348f7eaa4c918a7a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Oct 2021 13:27:14 +0200 Subject: [PATCH 0914/1460] css --- htdocs/theme/eldy/global.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 80e509fc447..c14392540ee 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -3397,7 +3397,7 @@ table.liste, table.noborder, table.formdoc, div.noborder { border-top-width: px; border-top-color: var(--colortopbordertitle1); border-top-style: solid; - margin: 0px 0px 5px 0px; + margin: 0px 0px 20px 0px; From 766ad9601e88a2509a75c4a89e7ea123d52b5188 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Oct 2021 13:45:28 +0200 Subject: [PATCH 0915/1460] css --- htdocs/adherents/stats/geo.php | 42 +++++++++++++++++----------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php index e751a7b5c65..3490f61d006 100644 --- a/htdocs/adherents/stats/geo.php +++ b/htdocs/adherents/stats/geo.php @@ -161,40 +161,40 @@ if ($mode) { while ($i < $num) { $obj = $db->fetch_object($resql); if ($mode == 'memberbycountry') { - $data[] = array('label'=>(($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? $langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : $langs->trans("Unknown"))), - 'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label : $langs->trans("Unknown"))), - 'code'=>$obj->code, - 'nb'=>$obj->nb, - 'lastdate'=>$db->jdate($obj->lastdate), - 'lastsubscriptiondate'=>$db->jdate($obj->lastsubscriptiondate) + $data[] = array('label'=>(($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? img_picto('', DOL_URL_ROOT.'/theme/common/flags/'.strtolower($obj->code).'.png', '', 1).' '.$langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : ''.$langs->trans("Unknown").'')), + 'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label : ''.$langs->trans("Unknown").'')), + 'code'=>$obj->code, + 'nb'=>$obj->nb, + 'lastdate'=>$db->jdate($obj->lastdate), + 'lastsubscriptiondate'=>$db->jdate($obj->lastsubscriptiondate) ); } if ($mode == 'memberbyregion') { //+ $data[] = array( - 'label'=>(($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? $langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : $langs->trans("Unknown"))), - 'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label : $langs->trans("Unknown"))), - 'label2'=>($obj->label2 ? $obj->label2 : $langs->trans("Unknown")), + 'label'=>(($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? img_picto('', DOL_URL_ROOT.'/theme/common/flags/'.strtolower($obj->code).'.png', '', 1).' '.$langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : ''.$langs->trans("Unknown").'')), + 'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label :''.$langs->trans("Unknown").'')), + 'label2'=>($obj->label2 ? $obj->label2 : ''.$langs->trans("Unknown").''), 'nb'=>$obj->nb, 'lastdate'=>$db->jdate($obj->lastdate), 'lastsubscriptiondate'=>$db->jdate($obj->lastsubscriptiondate) ); } if ($mode == 'memberbystate') { - $data[] = array('label'=>(($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? $langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : $langs->trans("Unknown"))), - 'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label : $langs->trans("Unknown"))), - 'label2'=>($obj->label2 ? $obj->label2 : $langs->trans("Unknown")), - 'nb'=>$obj->nb, - 'lastdate'=>$db->jdate($obj->lastdate), - 'lastsubscriptiondate'=>$db->jdate($obj->lastsubscriptiondate) + $data[] = array('label'=>(($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? img_picto('', DOL_URL_ROOT.'/theme/common/flags/'.strtolower($obj->code).'.png', '', 1).' '.$langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : ''.$langs->trans("Unknown").'')), + 'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label : ''.$langs->trans("Unknown").'')), + 'label2'=>($obj->label2 ? $obj->label2 : ''.$langs->trans("Unknown").''), + 'nb'=>$obj->nb, + 'lastdate'=>$db->jdate($obj->lastdate), + 'lastsubscriptiondate'=>$db->jdate($obj->lastsubscriptiondate) ); } if ($mode == 'memberbytown') { - $data[] = array('label'=>(($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? $langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : $langs->trans("Unknown"))), - 'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label : $langs->trans("Unknown"))), - 'label2'=>($obj->label2 ? $obj->label2 : $langs->trans("Unknown")), - 'nb'=>$obj->nb, - 'lastdate'=>$db->jdate($obj->lastdate), - 'lastsubscriptiondate'=>$db->jdate($obj->lastsubscriptiondate) + $data[] = array('label'=>(($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? img_picto('', DOL_URL_ROOT.'/theme/common/flags/'.strtolower($obj->code).'.png', '', 1).' '.$langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : ''.$langs->trans("Unknown").'')), + 'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label : ''.$langs->trans("Unknown").'')), + 'label2'=>($obj->label2 ? $obj->label2 : ''.$langs->trans("Unknown").''), + 'nb'=>$obj->nb, + 'lastdate'=>$db->jdate($obj->lastdate), + 'lastsubscriptiondate'=>$db->jdate($obj->lastsubscriptiondate) ); } From 30ba753b344a2243d0de946c1a9b9742791b87f1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Oct 2021 14:02:37 +0200 Subject: [PATCH 0916/1460] css --- htdocs/admin/accountant.php | 2 +- htdocs/admin/company_socialnetworks.php | 2 +- htdocs/admin/openinghours.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/accountant.php b/htdocs/admin/accountant.php index 24df7e0cb68..9bed1bb19f3 100644 --- a/htdocs/admin/accountant.php +++ b/htdocs/admin/accountant.php @@ -115,7 +115,7 @@ print ''; print ''; print ''; -print ''."\n"; +print ''."\n"; // Name print '
    '.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
    '.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
    '; diff --git a/htdocs/admin/company_socialnetworks.php b/htdocs/admin/company_socialnetworks.php index 2d4b2e6d128..63b23c06c42 100644 --- a/htdocs/admin/company_socialnetworks.php +++ b/htdocs/admin/company_socialnetworks.php @@ -110,7 +110,7 @@ print '
    '; print '
    '; print ''; print ''; -print ''; +print ''; print "\n"; diff --git a/htdocs/admin/openinghours.php b/htdocs/admin/openinghours.php index 2e262a1bb7e..0696de2a5c6 100644 --- a/htdocs/admin/openinghours.php +++ b/htdocs/admin/openinghours.php @@ -92,7 +92,7 @@ if (empty($action) || $action == 'edit' || $action == 'updateedit') { print ''; print '
    '.$langs->trans("SocialNetworksInformation").''.$langs->trans("Url").''.$langs->trans("SocialNetworkId").''.$langs->trans("SocialNetworksInformation").''.$langs->trans("Url").''.$langs->trans("SocialNetworkId").'
    '; - print ''."\n"; + print ''."\n"; print '
    '.$langs->trans("Day").''.$langs->trans("Value").'
    '.$langs->trans("Day").''.$langs->trans("Value").'
    '; print $form->textwithpicto($langs->trans("Monday"), $langs->trans("OpeningHoursFormatDesc")); From 78523e852d6b99c3680cf6586beaa0dc5a94b295 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Oct 2021 14:04:49 +0200 Subject: [PATCH 0917/1460] css --- htdocs/admin/company_socialnetworks.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/admin/company_socialnetworks.php b/htdocs/admin/company_socialnetworks.php index 63b23c06c42..eafda362486 100644 --- a/htdocs/admin/company_socialnetworks.php +++ b/htdocs/admin/company_socialnetworks.php @@ -104,8 +104,6 @@ print '
    '; print ''; print ''; -// Social networks -print '
    '; print '
    '; print ''; From 79177b0a11ad37e9963e1c4daa13ff564f1fc676 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Oct 2021 14:38:12 +0200 Subject: [PATCH 0918/1460] Rename method into selectLotDataList --- htdocs/admin/tools/export_files.php | 6 ++---- htdocs/core/class/utils.class.php | 6 ++---- htdocs/mrp/mo_production.php | 2 +- htdocs/product/class/html.formproduct.class.php | 9 ++++----- 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/htdocs/admin/tools/export_files.php b/htdocs/admin/tools/export_files.php index 9fabaa3b0b2..e0fdb740782 100644 --- a/htdocs/admin/tools/export_files.php +++ b/htdocs/admin/tools/export_files.php @@ -157,11 +157,9 @@ if ($compression == 'zip') { } else { if ($compression == 'gz') { $cmd = "gzip -f ".$outputdir."/".$file; - } - elseif ($compression == 'bz') { + } elseif ($compression == 'bz') { $cmd = "bzip2 -f ".$outputdir."/".$file; - } - elseif ($compression == 'zstd') { + } elseif ($compression == 'zstd') { $cmd = "zstd -z -9 -q --rm ".$outputdir."/".$file; } diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 6bfbbdb98ad..d56fcddafa7 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -249,11 +249,9 @@ class Utils $compression = $compression ? $compression : 'none'; if ($compression == 'gz') { $outputfile .= '.gz'; - } - elseif ($compression == 'bz') { + } elseif ($compression == 'bz') { $outputfile .= '.bz2'; - } - elseif ($compression == 'zstd') { + } elseif ($compression == 'zstd') { $outputfile .= '.zst'; } $outputerror = $outputfile.'.err'; diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 533e81f80a2..0e2edb81203 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -975,7 +975,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($tmpproduct->status_batch) { $preselected = (GETPOSTISSET('batch-'.$line->id.'-'.$i) ? GETPOST('batch-'.$line->id.'-'.$i) : ''); print ''; - print $formproduct->selectLot('batch-'.$line->id.'-'.$i, 0, $line->fk_product, '', ''); + print $formproduct->selectLotDataList('batch-'.$line->id.'-'.$i, 0, $line->fk_product, '', ''); } print ''; } diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index 1b6b9bbf0a5..da10faa4f34 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -543,7 +543,7 @@ class FormProduct { global $conf, $langs; - dol_syslog(get_class($this)."::selectLot $selected, $htmlname, $filterstatus, $empty, $disabled, $fk_product, $fk_entrepot, $empty_label, $forcecombo, $morecss", LOG_DEBUG); + dol_syslog(get_class($this)."::selectLotStock $selected, $htmlname, $filterstatus, $empty, $disabled, $fk_product, $fk_entrepot, $empty_label, $forcecombo, $morecss", LOG_DEBUG); $out = ''; $productIdArray = array(); @@ -613,21 +613,20 @@ class FormProduct /** - * Return list of lot numbers (stock from product_batch) with stock location and stock qty + * Return list of lot numbers (stock from product_batch) for product and warehouse. * * @param string $htmlname Name of key that is inside attribute "list" of an input text field. * @param int $empty 1=Can be empty, 0 if not * @param int $fk_product show lot numbers of product with id fk_product. All from objectLines if 0. * @param int $fk_entrepot filter lot numbers for warehouse with id fk_entrepot. All if 0. * @param array $objectLines Only cache lot numbers for products in lines of object. If no lines only for fk_product. If no fk_product, all. - * * @return string HTML datalist */ - public function selectLot($htmlname = 'batch_id', $empty = 0, $fk_product = 0, $fk_entrepot = 0, $objectLines = array()) + public function selectLotDataList($htmlname = 'batch_id', $empty = 0, $fk_product = 0, $fk_entrepot = 0, $objectLines = array()) { global $conf, $langs; - dol_syslog(get_class($this)."::selectLot $htmlname, $empty, $fk_product, $fk_entrepot,$objectLines", LOG_DEBUG); + dol_syslog(get_class($this)."::selectLotDataList $htmlname, $empty, $fk_product, $fk_entrepot,$objectLines", LOG_DEBUG); $out = ''; $productIdArray = array(); From 0aa90e82ea25505addb8ed876eccc8ed2d9a31ba Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Oct 2021 15:47:29 +0200 Subject: [PATCH 0919/1460] Clean code --- htdocs/core/class/html.form.class.php | 11 +- htdocs/expensereport/card.php | 317 +++++++++--------- .../tpl/expensereport_addfile.tpl.php | 9 +- .../tpl/expensereport_linktofile.tpl.php | 13 +- htdocs/langs/fr_FR/projects.lang | 2 + htdocs/langs/fr_FR/propal.lang | 2 +- htdocs/theme/eldy/global.inc.php | 7 + 7 files changed, 193 insertions(+), 168 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index c69b794a011..c479b59cbde 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -9307,11 +9307,12 @@ class Form * * @param string $save_label Alternative label for save button * @param string $cancel_label Alternative label for cancel button - * @param array $morefields Add additional buttons between save and cancel + * @param array $morebuttons Add additional buttons between save and cancel * @param bool $withoutdiv Option to remove enclosing centered div + * @param string $morecss More CSS * @return string Html code with the buttons */ - public function buttonsSaveCancel($save_label = 'Save', $cancel_label = 'Cancel', $morefields = array(), $withoutdiv = 0) + public function buttonsSaveCancel($save_label = 'Save', $cancel_label = 'Cancel', $morebuttons = array(), $withoutdiv = 0, $morecss = '') { global $langs; @@ -9335,8 +9336,8 @@ class Form !empty($save_label) ? $buttons[] = $save : ''; - if (!empty($morefields)) { - $buttons[] = $morefields; + if (!empty($morebuttons)) { + $buttons[] = $morebuttons; } !empty($cancel_label) ? $buttons[] = $cancel : ''; @@ -9345,7 +9346,7 @@ class Form foreach ($buttons as $button) { $addclass = empty($button['addclass']) ? '' : $button['addclass']; - $retstring .= ''; + $retstring .= ''; } $retstring .= $withoutdiv ? '': ''; diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 983a355b867..911b9cb08c3 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -1696,20 +1696,20 @@ if ($action == 'create') { } } }*/ - $morehtmlref .= ''; + $morehtmlref .= ''; - dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); - print '
    '; - print '
    '; - print '
    '; + print '
    '; + print '
    '; + print '
    '; - print '
    '; + print '
    '; - // Author - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; - // Period - print ''; - print ''; - print ''; - print ''; + // Period + print ''; + print ''; + print ''; + print ''; if (!empty($conf->global->EXPENSEREPORT_ASK_PAYMENTMODE_ON_CREATION)) { print ''; print ''; @@ -1735,20 +1735,20 @@ if ($action == 'create') { print ''; } - // Validation date - print ''; - print ''; - print ''; + print ''; + print ''; - print ''; + print ''; + print ''; - // User to inform for approval + // User to inform for approval if ($object->status <= ExpenseReport::STATUS_VALIDATED) { // informed print ''; print ''; // approver @@ -1842,24 +1842,24 @@ if ($action == 'create') { */ } - // Other attributes - $cols = 2; - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; + // Other attributes + $cols = 2; + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; - print '
    '.$langs->trans("User").''; + // Author + print '
    '.$langs->trans("User").''; if ($object->fk_user_author > 0) { $userauthor = new User($db); $result = $userauthor->fetch($object->fk_user_author); @@ -1719,15 +1719,15 @@ if ($action == 'create') { print $userauthor->getNomUrl(-1); } } - print '
    '.$langs->trans("Period").''; - print get_date_range($object->date_debut, $object->date_fin, 'day', $langs, 0); - print '
    '.$langs->trans("Period").''; + print get_date_range($object->date_debut, $object->date_fin, 'day', $langs, 0); + print '
    '.$langs->trans("ModePaiement").'
    '.$langs->trans("DATE_SAVE").''.dol_print_date($object->date_valid, 'dayhour', 'tzuser'); + // Validation date + print '
    '.$langs->trans("DATE_SAVE").''.dol_print_date($object->date_valid, 'dayhour', 'tzuser'); if ($object->status == 2 && $object->hasDelay('toapprove')) { print ' '.img_warning($langs->trans("Late").' - '.$langs->trans("ToApprove")); } if ($object->status == 5 && $object->hasDelay('topay')) { print ' '.img_warning($langs->trans("Late").' - '.$langs->trans("ToPay")); } - print '
    '.$langs->trans("VALIDATOR").'
    '; + print '
    '; - print '
    '; - print '
    '; - print '
    '; - print '
    '; + print '
    '; + print '
    '; + print '
    '; + print '
    '; - print ''; + print '
    '; - // Amount - print ''; - print ''; - print ''; - $rowspan = 5; + // Amount + print ''; + print ''; + print ''; + $rowspan = 5; if ($object->status <= ExpenseReport::STATUS_VALIDATED) { $rowspan++; } elseif ($object->status == ExpenseReport::STATUS_CANCELED) { @@ -1873,15 +1873,15 @@ if ($action == 'create') { if ($object->status == ExpenseReport::STATUS_CLOSED) { $rowspan += 2; } - print ""; - print ''; + print ""; + print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; - // Amount Local Taxes + // Amount Local Taxes if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) { // Localtax1 print ''; print ''; @@ -1891,45 +1891,45 @@ if ($action == 'create') { print ''; } - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; - // List of payments already done - $nbcols = 3; + // List of payments already done + $nbcols = 3; if (!empty($conf->banque->enabled)) { $nbrows++; $nbcols++; } - print '
    '.$langs->trans("AmountHT").''.price($object->total_ht, 1, '', 1, - 1, - 1, $conf->currency).'
    '.$langs->trans("AmountHT").''.price($object->total_ht, 1, '', 1, - 1, - 1, $conf->currency).'
    '.$langs->trans("AmountVAT").''.price($object->total_tva, 1, '', 1, -1, -1, $conf->currency).'
    '.$langs->trans("AmountVAT").''.price($object->total_tva, 1, '', 1, -1, -1, $conf->currency).'
    '.$langs->transcountry("AmountLT1", $mysoc->country_code).''.price($object->total_localtax1, 1, '', 1, -1, -1, $conf->currency).'
    '.price($object->total_localtax2, 1, '', 1, -1, -1, $conf->currency).'
    '.$langs->trans("AmountTTC").''.price($object->total_ttc, 1, '', 1, -1, -1, $conf->currency).'
    '.$langs->trans("AmountTTC").''.price($object->total_ttc, 1, '', 1, -1, -1, $conf->currency).'
    '; + print '
    '; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; if (!empty($conf->banque->enabled)) { print ''; } - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; - // Payments already done (from payment on this expensereport) - $sql = "SELECT p.rowid, p.num_payment, p.datep as dp, p.amount, p.fk_bank,"; - $sql .= "c.code as p_code, c.libelle as payment_type,"; - $sql .= "ba.rowid as baid, ba.ref as baref, ba.label, ba.number as banumber, ba.account_number, ba.fk_accountancy_journal"; - $sql .= " FROM ".MAIN_DB_PREFIX."expensereport as e, ".MAIN_DB_PREFIX."payment_expensereport as p"; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as c ON p.fk_typepayment = c.id"; - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid'; - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank_account as ba ON b.fk_account = ba.rowid'; - $sql .= " WHERE e.rowid = '".$id."'"; - $sql .= " AND p.fk_expensereport = e.rowid"; - $sql .= ' AND e.entity IN ('.getEntity('expensereport').')'; - $sql .= " ORDER BY dp"; + // Payments already done (from payment on this expensereport) + $sql = "SELECT p.rowid, p.num_payment, p.datep as dp, p.amount, p.fk_bank,"; + $sql .= "c.code as p_code, c.libelle as payment_type,"; + $sql .= "ba.rowid as baid, ba.ref as baref, ba.label, ba.number as banumber, ba.account_number, ba.fk_accountancy_journal"; + $sql .= " FROM ".MAIN_DB_PREFIX."expensereport as e, ".MAIN_DB_PREFIX."payment_expensereport as p"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as c ON p.fk_typepayment = c.id"; + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid'; + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank_account as ba ON b.fk_account = ba.rowid'; + $sql .= " WHERE e.rowid = '".$id."'"; + $sql .= " AND p.fk_expensereport = e.rowid"; + $sql .= ' AND e.entity IN ('.getEntity('expensereport').')'; + $sql .= " ORDER BY dp"; - $resql = $db->query($sql); + $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); $i = 0; $totalpaid = 0; @@ -2000,29 +2000,29 @@ if ($action == 'create') { } else { dol_print_error($db); } - print "
    '.$langs->trans('Payments').''.$langs->trans('Date').''.$langs->trans('Type').'
    '.$langs->trans('Payments').''.$langs->trans('Date').''.$langs->trans('Type').''.$langs->trans('BankAccount').''.$langs->trans('Amount').' 
    '.$langs->trans('Amount').' 
    "; + print "
    "; - print '
    '; - print '
    '; - print '
    '; + print '
  • '; + print '
    '; + print '
    '; - print '

    '; + print '

    '; - print '
    '; + print '
    '; - $actiontouse = 'updateline'; + $actiontouse = 'updateline'; if (($object->status == 0 || $object->status == 99) && $action != 'editline') { $actiontouse = 'addline'; } - print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; - print '
    '; - print ''; + print '
    '; + print '
    '; if (!empty($object->lines)) { $i = 0; $total = 0; @@ -2214,6 +2214,7 @@ if ($action == 'create') { $colspan++; } + print ''."\n"; print ''; print ''; + print ''; print ''; } @@ -2344,10 +2347,8 @@ if ($action == 'create') { } // Add a new line - if (($object->status == ExpenseReport::STATUS_DRAFT || $object->status == ExpenseReport::STATUS_REFUSED) - && $action != 'editline' - && $user->rights->expensereport->creer) { - $colspan = 11; + if (($object->status == ExpenseReport::STATUS_DRAFT || $object->status == ExpenseReport::STATUS_REFUSED) && $action != 'editline' && $user->rights->expensereport->creer) { + $colspan = 11; if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { $colspan++; } @@ -2358,8 +2359,8 @@ if ($action == 'create') { $colspan++; } - $nbFiles = $nbLinks = 0; - $arrayoffiles = array(); + $nbFiles = $nbLinks = 0; + $arrayoffiles = array(); if (empty($conf->global->EXPENSEREPORT_DISABLE_ATTACHMENT_ON_LINES)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; @@ -2370,21 +2371,21 @@ if ($action == 'create') { $nbLinks = Link::count($db, $object->element, $object->id); } - // Add line with link to add new file or attach to an existing file - print ''; - print ''; + print ''; + print ''."\n"; + print ''; - include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_linktofile.tpl.php'; - include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_addfile.tpl.php'; + include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_linktofile.tpl.php'; + include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_addfile.tpl.php'; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; if (!empty($conf->projet->enabled)) { print ''; } - print ''; + print ''; if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { print ''; } - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; - print ''; + print ''; - // Line number - print ''; + // Line number + print ''; - // Select date - print ''; + // Select date + print ''; - // Select project + // Select project if (!empty($conf->projet->enabled)) { print ''; } - // Add comments - print ''; + // Add comments + print ''; - // Select VAT - print ''; + print $form->load_tva('vatrate', ($vatrate != '' ? $vatrate : $defaultvat), $mysoc, '', 0, 0, '', false, 1); + print ''; - // Unit price net - print ''; + // Unit price net + print ''; - // Unit price with tax - print ''; + // Unit price with tax + print ''; - // Quantity - print ''; + // Quantity + print ''; - // Picture - print ''; + // Picture + print ''; if ($action != 'editline') { print ''; print ''; } - print ''; + print ''; - print ''; + print ''; } // Fin si c'est payé/validé print '
    '; @@ -2333,8 +2334,10 @@ if ($action == 'create') { //print $line->fk_ecm_files; print ''; print ''; - print $form->buttonsSaveCancel(); + print $form->buttonsSaveCancel('Save', 'Cancel', array(), 0, 'small'); + print '
    '; - print ''.$langs->trans("UploadANewFileNow"); - print img_picto($langs->trans("UploadANewFileNow"), 'chevron-down', '', false, 0, 0, '', 'marginleftonly'); - print ''; + // Add line with link to add new file or attach to an existing file + print '
    '; + print ''.$langs->trans("UploadANewFileNow"); + print img_picto($langs->trans("UploadANewFileNow"), 'chevron-down', '', false, 0, 0, '', 'marginleftonly'); + print ''; if (empty($conf->global->EXPENSEREPORT_DISABLE_ATTACHMENT_ON_LINES)) { print '   -   '.$langs->trans("AttachTheNewLineToTheDocument"); print img_picto($langs->trans("AttachTheNewLineToTheDocument"), 'chevron-down', '', false, 0, 0, '', 'marginleftonly'); print ''; } - print ''."\n"; - print ''."\n"; - print '
    '.$langs->trans('Date').'
    '.$langs->trans('Date').''.$form->textwithpicto($langs->trans('Project'), $langs->trans("ClosedProjectsAreHidden")).''.$langs->trans('Type').''.$langs->trans('Type').''.$langs->trans('CarCategory').''.$langs->trans('Description').''.$langs->trans('VAT').''.$langs->trans('PriceUHT').''.$langs->trans('PriceUTTC').''.$langs->trans('Qty').'
    '.$langs->trans('Description').''.$langs->trans('VAT').''.$langs->trans('PriceUHT').''.$langs->trans('PriceUTTC').''.$langs->trans('Qty').'
    '; - print $form->selectDate($date ? $date : -1, 'date', 0, 0, 0, '', 1, 1); - print ''; + print $form->selectDate($date ? $date : -1, 'date', 0, 0, 0, '', 1, 1); + print ''; $formproject->select_projects(-1, $fk_project, 'fk_project', 0, 0, $projectRequired ? 0 : 1, -1, 0, 0, 0, '', 0, 0, 'maxwidth300'); @@ -2475,48 +2476,48 @@ if ($action == 'create') { print ''; - print ''; - print ''; + print ''; + print ''; - $defaultvat = -1; + // Select VAT + print ''; + $defaultvat = -1; if (!empty($conf->global->EXPENSEREPORT_NO_DEFAULT_VAT)) { $conf->global->MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS = 'none'; } - print $form->load_tva('vatrate', ($vatrate != '' ? $vatrate : $defaultvat), $mysoc, '', 0, 0, '', false, 1); - print ''; - print ''; - print ''; + print ''; + print ''; - print ''; - print ''; + print ''; + print ''; - print ''; // We must be able to enter decimal qty - print ''; + print ''; // We must be able to enter decimal qty + print ''; - print $form->buttonsSaveCancel("Add", '', '', 1); - print ''; + print $form->buttonsSaveCancel("Add", '', '', 1); + print '
    '; diff --git a/htdocs/expensereport/tpl/expensereport_addfile.tpl.php b/htdocs/expensereport/tpl/expensereport_addfile.tpl.php index c27136ebd38..d74b68e6738 100644 --- a/htdocs/expensereport/tpl/expensereport_addfile.tpl.php +++ b/htdocs/expensereport/tpl/expensereport_addfile.tpl.php @@ -2,7 +2,14 @@ // Add line to upload new file print ''."\n"; print 'global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ' style="display: none"' : '').'>'; -print ''; + +// Num line +if ($action == 'editline') { + print ''; +} + +// Upload section +print ''; $modulepart = 'expensereport'; $permission = $user->rights->expensereport->creer; diff --git a/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php b/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php index 9264400a71f..33cfc0976fe 100644 --- a/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php +++ b/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php @@ -13,7 +13,14 @@ if (empty($conf->global->EXPENSEREPORT_DISABLE_ATTACHMENT_ON_LINES)) { if ($nbFiles > 0) { print 'global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ' style="display: none"' : '').'>'; - print ''; + + // Num line + if ($action == 'editline') { + print ''; + } + + // Select image section + print ''; //print ''.$langs->trans("AttachTheNewLineToTheDocument").'
    '; $modulepart = 'expensereport'; $maxheightmini = 48; $relativepath = (!empty($object->ref) ?dol_sanitizeFileName($object->ref) : '').'/'; @@ -112,8 +119,8 @@ if (empty($conf->global->EXPENSEREPORT_DISABLE_ATTACHMENT_ON_LINES)) { if (!empty($filenamelinked) && $filenamelinked == $file['relativename']) { $checked = ' checked'; } - print '
    '; - print ''; + print '
    '; + print ''; print '
    '; print '
    '; diff --git a/htdocs/langs/fr_FR/projects.lang b/htdocs/langs/fr_FR/projects.lang index 9a7f3c189bc..53e1e80a0e8 100644 --- a/htdocs/langs/fr_FR/projects.lang +++ b/htdocs/langs/fr_FR/projects.lang @@ -274,6 +274,7 @@ NewInter=Nouvelle intervention OneLinePerTask=Une ligne par tâche OneLinePerPeriod=Une ligne par période OneLinePerTimeSpentLine=Une ligne pour chaque déclaration de temps passé +AddDetailDateAndDuration=Avec date et durée dans la description de la ligne RefTaskParent=Réf. Tâche parent ProfitIsCalculatedWith=Le bénéfice est calculé sur la base de AddPersonToTask=Ajouter également aux tâches @@ -281,3 +282,4 @@ UsageOrganizeEvent=Utilisation: Organisation d'événements PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE=Classer le projet comme étant clos lorsque toutes ses tâches sont terminées (progression 100%%) PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE_help=Remarque : les projets existants avec toutes les tâches terminées à 100 %% ne seront pas affectés : vous devrez les fermer manuellement. Cette option n’affecte que les projets ouverts. SelectLinesOfTimeSpentToInvoice=Sélectionnez les lignes de temps consacré non facturées, puis l'action groupée "Générer la facture" pour les facturer +ProjectTasksWithoutTimeSpent=Project tasks without time spent diff --git a/htdocs/langs/fr_FR/propal.lang b/htdocs/langs/fr_FR/propal.lang index b019b275e6e..f822d4f1d02 100644 --- a/htdocs/langs/fr_FR/propal.lang +++ b/htdocs/langs/fr_FR/propal.lang @@ -33,7 +33,7 @@ PropalStatusSigned=Signée (à facturer) PropalStatusNotSigned=Non signée (fermée) PropalStatusBilled=Facturée PropalStatusDraftShort=Brouillon -PropalStatusValidatedShort=Validé (ouvert) +PropalStatusValidatedShort=Ouvert PropalStatusClosedShort=Fermée PropalStatusSignedShort=Signée PropalStatusNotSignedShort=Non signée diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index c14392540ee..0eb55107a0c 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -886,6 +886,13 @@ span.fa.fa-plus-circle.paddingleft { font-size: 1.5em; vertical-align: text-bottom; } +.divoverflow { + overflow: hidden; + white-space: nowrap; + vertical-align: middle; + text-overflow: ellipsis; +} + /* Themes for badges */ From 514bcc87eadeb51e46dbec2781aa85617bf324eb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Oct 2021 15:53:01 +0200 Subject: [PATCH 0920/1460] Sync transifex --- htdocs/langs/ar_IQ/accountancy.lang | 433 +--- htdocs/langs/ar_IQ/admin.lang | 2151 ------------------- htdocs/langs/ar_IQ/agenda.lang | 172 -- htdocs/langs/ar_IQ/assets.lang | 67 - htdocs/langs/ar_IQ/banks.lang | 184 -- htdocs/langs/ar_IQ/bills.lang | 591 ----- htdocs/langs/ar_IQ/blockedlog.lang | 54 - htdocs/langs/ar_IQ/bookmarks.lang | 21 - htdocs/langs/ar_IQ/boxes.lang | 120 -- htdocs/langs/ar_IQ/cashdesk.lang | 131 -- htdocs/langs/ar_IQ/categories.lang | 99 - htdocs/langs/ar_IQ/commercial.lang | 81 - htdocs/langs/ar_IQ/companies.lang | 475 ---- htdocs/langs/ar_IQ/compta.lang | 289 --- htdocs/langs/ar_IQ/contracts.lang | 104 - htdocs/langs/ar_IQ/cron.lang | 91 - htdocs/langs/ar_IQ/deliveries.lang | 33 - htdocs/langs/ar_IQ/dict.lang | 359 ---- htdocs/langs/ar_IQ/donations.lang | 35 - htdocs/langs/ar_IQ/ecm.lang | 47 - htdocs/langs/ar_IQ/errors.lang | 305 --- htdocs/langs/ar_IQ/eventorganization.lang | 149 -- htdocs/langs/ar_IQ/exports.lang | 135 -- htdocs/langs/ar_IQ/externalsite.lang | 5 - htdocs/langs/ar_IQ/ftp.lang | 14 - htdocs/langs/ar_IQ/help.lang | 23 - htdocs/langs/ar_IQ/holiday.lang | 136 -- htdocs/langs/ar_IQ/hrm.lang | 19 - htdocs/langs/ar_IQ/install.lang | 218 -- htdocs/langs/ar_IQ/interventions.lang | 68 - htdocs/langs/ar_IQ/intracommreport.lang | 40 - htdocs/langs/ar_IQ/knowledgemanagement.lang | 49 - htdocs/langs/ar_IQ/languages.lang | 110 - htdocs/langs/ar_IQ/ldap.lang | 27 - htdocs/langs/ar_IQ/link.lang | 11 - htdocs/langs/ar_IQ/loan.lang | 34 - htdocs/langs/ar_IQ/mailmanspip.lang | 27 - htdocs/langs/ar_IQ/mails.lang | 179 -- htdocs/langs/ar_IQ/main.lang | 1130 ---------- htdocs/langs/ar_IQ/margins.lang | 45 +- htdocs/langs/ar_IQ/members.lang | 194 +- htdocs/langs/ar_IQ/modulebuilder.lang | 146 -- htdocs/langs/ar_IQ/mrp.lang | 103 - htdocs/langs/ar_IQ/multicurrency.lang | 38 - htdocs/langs/ar_IQ/oauth.lang | 32 - htdocs/langs/ar_IQ/opensurvey.lang | 61 - htdocs/langs/ar_IQ/orders.lang | 191 -- htdocs/langs/ar_IQ/other.lang | 297 --- htdocs/langs/ar_IQ/partnership.lang | 91 - htdocs/langs/ar_IQ/paybox.lang | 30 - htdocs/langs/ar_IQ/paypal.lang | 36 - htdocs/langs/ar_IQ/printing.lang | 47 - htdocs/langs/ar_IQ/productbatch.lang | 43 - htdocs/langs/ar_IQ/products.lang | 401 ---- htdocs/langs/ar_IQ/projects.lang | 283 --- htdocs/langs/ar_IQ/propal.lang | 92 - htdocs/langs/ar_IQ/receiptprinter.lang | 82 - htdocs/langs/ar_IQ/receptions.lang | 47 - htdocs/langs/ar_IQ/recruitment.lang | 76 - htdocs/langs/ar_IQ/resource.lang | 39 - htdocs/langs/ar_IQ/salaries.lang | 24 - htdocs/langs/ar_IQ/sendings.lang | 74 - htdocs/langs/ar_IQ/sms.lang | 51 - htdocs/langs/ar_IQ/stocks.lang | 259 --- htdocs/langs/ar_IQ/stripe.lang | 71 - htdocs/langs/ar_IQ/supplier_proposal.lang | 58 - htdocs/langs/ar_IQ/suppliers.lang | 49 - htdocs/langs/ar_IQ/ticket.lang | 321 --- htdocs/langs/ar_IQ/trips.lang | 150 -- htdocs/langs/ar_IQ/users.lang | 123 -- htdocs/langs/ar_IQ/website.lang | 147 -- htdocs/langs/ar_IQ/withdrawals.lang | 152 -- htdocs/langs/ar_IQ/workflow.lang | 26 - htdocs/langs/ar_IQ/zapier.lang | 21 - htdocs/langs/de_AT/admin.lang | 1 - htdocs/langs/es_AR/admin.lang | 1 - htdocs/langs/es_CL/admin.lang | 1 - htdocs/langs/es_CO/admin.lang | 1 - htdocs/langs/es_EC/admin.lang | 1 - htdocs/langs/es_MX/admin.lang | 1 - htdocs/langs/es_MX/eventorganization.lang | 1 - htdocs/langs/fr_FR/accountancy.lang | 23 +- htdocs/langs/fr_FR/admin.lang | 115 +- htdocs/langs/fr_FR/agenda.lang | 3 +- htdocs/langs/fr_FR/bills.lang | 12 +- htdocs/langs/fr_FR/cashdesk.lang | 11 +- htdocs/langs/fr_FR/categories.lang | 3 +- htdocs/langs/fr_FR/compta.lang | 27 +- htdocs/langs/fr_FR/ecm.lang | 4 +- htdocs/langs/fr_FR/errors.lang | 34 +- htdocs/langs/fr_FR/eventorganization.lang | 88 +- htdocs/langs/fr_FR/hrm.lang | 145 +- htdocs/langs/fr_FR/languages.lang | 5 +- htdocs/langs/fr_FR/main.lang | 27 +- htdocs/langs/fr_FR/margins.lang | 2 +- htdocs/langs/fr_FR/members.lang | 35 +- htdocs/langs/fr_FR/mrp.lang | 7 +- htdocs/langs/fr_FR/opensurvey.lang | 2 + htdocs/langs/fr_FR/printing.lang | 14 +- htdocs/langs/fr_FR/productbatch.lang | 9 +- htdocs/langs/fr_FR/products.lang | 14 +- htdocs/langs/fr_FR/receptions.lang | 4 +- htdocs/langs/fr_FR/stocks.lang | 22 +- htdocs/langs/fr_FR/ticket.lang | 14 +- htdocs/langs/nl_BE/admin.lang | 1 - htdocs/langs/pt_BR/admin.lang | 2 - htdocs/langs/pt_BR/eventorganization.lang | 1 - 107 files changed, 363 insertions(+), 12384 deletions(-) delete mode 100644 htdocs/langs/ar_IQ/agenda.lang delete mode 100644 htdocs/langs/ar_IQ/assets.lang delete mode 100644 htdocs/langs/ar_IQ/banks.lang delete mode 100644 htdocs/langs/ar_IQ/blockedlog.lang delete mode 100644 htdocs/langs/ar_IQ/bookmarks.lang delete mode 100644 htdocs/langs/ar_IQ/boxes.lang delete mode 100644 htdocs/langs/ar_IQ/cashdesk.lang delete mode 100644 htdocs/langs/ar_IQ/categories.lang delete mode 100644 htdocs/langs/ar_IQ/commercial.lang delete mode 100644 htdocs/langs/ar_IQ/contracts.lang delete mode 100644 htdocs/langs/ar_IQ/cron.lang delete mode 100644 htdocs/langs/ar_IQ/deliveries.lang delete mode 100644 htdocs/langs/ar_IQ/dict.lang delete mode 100644 htdocs/langs/ar_IQ/donations.lang delete mode 100644 htdocs/langs/ar_IQ/ecm.lang delete mode 100644 htdocs/langs/ar_IQ/errors.lang delete mode 100644 htdocs/langs/ar_IQ/eventorganization.lang delete mode 100644 htdocs/langs/ar_IQ/externalsite.lang delete mode 100644 htdocs/langs/ar_IQ/ftp.lang delete mode 100644 htdocs/langs/ar_IQ/help.lang delete mode 100644 htdocs/langs/ar_IQ/holiday.lang delete mode 100644 htdocs/langs/ar_IQ/hrm.lang delete mode 100644 htdocs/langs/ar_IQ/install.lang delete mode 100644 htdocs/langs/ar_IQ/interventions.lang delete mode 100644 htdocs/langs/ar_IQ/intracommreport.lang delete mode 100644 htdocs/langs/ar_IQ/knowledgemanagement.lang delete mode 100644 htdocs/langs/ar_IQ/languages.lang delete mode 100644 htdocs/langs/ar_IQ/ldap.lang delete mode 100644 htdocs/langs/ar_IQ/link.lang delete mode 100644 htdocs/langs/ar_IQ/loan.lang delete mode 100644 htdocs/langs/ar_IQ/mailmanspip.lang delete mode 100644 htdocs/langs/ar_IQ/mails.lang delete mode 100644 htdocs/langs/ar_IQ/modulebuilder.lang delete mode 100644 htdocs/langs/ar_IQ/mrp.lang delete mode 100644 htdocs/langs/ar_IQ/multicurrency.lang delete mode 100644 htdocs/langs/ar_IQ/oauth.lang delete mode 100644 htdocs/langs/ar_IQ/opensurvey.lang delete mode 100644 htdocs/langs/ar_IQ/other.lang delete mode 100644 htdocs/langs/ar_IQ/partnership.lang delete mode 100644 htdocs/langs/ar_IQ/paybox.lang delete mode 100644 htdocs/langs/ar_IQ/paypal.lang delete mode 100644 htdocs/langs/ar_IQ/productbatch.lang delete mode 100644 htdocs/langs/ar_IQ/products.lang delete mode 100644 htdocs/langs/ar_IQ/projects.lang delete mode 100644 htdocs/langs/ar_IQ/propal.lang delete mode 100644 htdocs/langs/ar_IQ/receiptprinter.lang delete mode 100644 htdocs/langs/ar_IQ/receptions.lang delete mode 100644 htdocs/langs/ar_IQ/recruitment.lang delete mode 100644 htdocs/langs/ar_IQ/resource.lang delete mode 100644 htdocs/langs/ar_IQ/salaries.lang delete mode 100644 htdocs/langs/ar_IQ/sms.lang delete mode 100644 htdocs/langs/ar_IQ/stripe.lang delete mode 100644 htdocs/langs/ar_IQ/supplier_proposal.lang delete mode 100644 htdocs/langs/ar_IQ/suppliers.lang delete mode 100644 htdocs/langs/ar_IQ/ticket.lang delete mode 100644 htdocs/langs/ar_IQ/trips.lang delete mode 100644 htdocs/langs/ar_IQ/website.lang delete mode 100644 htdocs/langs/ar_IQ/withdrawals.lang delete mode 100644 htdocs/langs/ar_IQ/workflow.lang delete mode 100644 htdocs/langs/ar_IQ/zapier.lang diff --git a/htdocs/langs/ar_IQ/accountancy.lang b/htdocs/langs/ar_IQ/accountancy.lang index 771f0a83e7b..3bb3fbfab17 100644 --- a/htdocs/langs/ar_IQ/accountancy.lang +++ b/htdocs/langs/ar_IQ/accountancy.lang @@ -1,434 +1,3 @@ -# Dolibarr language file - en_US - Accountancy (Double entries) -Accountancy=Accountancy -Accounting=Accounting -ACCOUNTING_EXPORT_SEPARATORCSV=Column separator for export file -ACCOUNTING_EXPORT_DATE=Date format for export file -ACCOUNTING_EXPORT_PIECE=Export the number of piece -ACCOUNTING_EXPORT_GLOBAL_ACCOUNT=Export with global account -ACCOUNTING_EXPORT_LABEL=Export label -ACCOUNTING_EXPORT_AMOUNT=Export amount -ACCOUNTING_EXPORT_DEVISE=Export currency -Selectformat=Select the format for the file -ACCOUNTING_EXPORT_FORMAT=Select the format for the file -ACCOUNTING_EXPORT_ENDLINE=Select the carriage return type -ACCOUNTING_EXPORT_PREFIX_SPEC=Specify the prefix for the file name -ThisService=This service -ThisProduct=This product -DefaultForService=Default for service -DefaultForProduct=Default for product -ProductForThisThirdparty=Product for this thirdparty -ServiceForThisThirdparty=Service for this thirdparty -CantSuggest=Can't suggest -AccountancySetupDoneFromAccountancyMenu=Most setup of the accountancy is done from the menu %s -ConfigAccountingExpert=Configuration of the module accounting (double entry) -Journalization=Journalization -Journals=Journals -JournalFinancial=Financial journals -BackToChartofaccounts=Return chart of accounts -Chartofaccounts=Chart of accounts -ChartOfSubaccounts=Chart of individual accounts -ChartOfIndividualAccountsOfSubsidiaryLedger=Chart of individual accounts of the subsidiary ledger -CurrentDedicatedAccountingAccount=Current dedicated account -AssignDedicatedAccountingAccount=New account to assign -InvoiceLabel=Invoice label -OverviewOfAmountOfLinesNotBound=Overview of amount of lines not bound to an accounting account -OverviewOfAmountOfLinesBound=Overview of amount of lines already bound to an accounting account -OtherInfo=Other information -DeleteCptCategory=Remove accounting account from group -ConfirmDeleteCptCategory=Are you sure you want to remove this accounting account from the accounting account group? -JournalizationInLedgerStatus=Status of journalization +# Dolibarr language file - Source file is en_US - accountancy AlreadyInGeneralLedger=Already transferred in accounting journals and ledger NotYetInGeneralLedger=Not yet transferred in accouting journals and ledger -GroupIsEmptyCheckSetup=Group is empty, check setup of the personalized accounting group -DetailByAccount=Show detail by account -AccountWithNonZeroValues=Accounts with non-zero values -ListOfAccounts=List of accounts -CountriesInEEC=Countries in EEC -CountriesNotInEEC=Countries not in EEC -CountriesInEECExceptMe=Countries in EEC except %s -CountriesExceptMe=All countries except %s -AccountantFiles=Export source documents -ExportAccountingSourceDocHelp=With this tool, you can export the source events (list in CSV and PDFs) that were used to generate your accountancy. -ExportAccountingSourceDocHelp2=To export your journals, use the menu entry %s - %s. -VueByAccountAccounting=View by accounting account -VueBySubAccountAccounting=View by accounting subaccount - -MainAccountForCustomersNotDefined=Main accounting account for customers not defined in setup -MainAccountForSuppliersNotDefined=Main accounting account for vendors not defined in setup -MainAccountForUsersNotDefined=Main accounting account for users not defined in setup -MainAccountForVatPaymentNotDefined=Main accounting account for VAT payment not defined in setup -MainAccountForSubscriptionPaymentNotDefined=Main accounting account for subscription payment not defined in setup - -AccountancyArea=Accounting area -AccountancyAreaDescIntro=Usage of the accountancy module is done in several step: -AccountancyAreaDescActionOnce=The following actions are usually executed one time only, or once per year... -AccountancyAreaDescActionOnceBis=Next steps should be done to save you time in future by suggesting you the correct default accounting account when making the journalization (writing record in Journals and General ledger) -AccountancyAreaDescActionFreq=The following actions are usually executed every month, week or day for very large companies... - -AccountancyAreaDescJournalSetup=STEP %s: Create or check content of your journal list from menu %s -AccountancyAreaDescChartModel=STEP %s: Check that a model of chart of account exists or create one from menu %s -AccountancyAreaDescChart=STEP %s: Select and|or complete your chart of account from menu %s - -AccountancyAreaDescVat=STEP %s: Define accounting accounts for each VAT Rates. For this, use the menu entry %s. -AccountancyAreaDescDefault=STEP %s: Define default accounting accounts. For this, use the menu entry %s. -AccountancyAreaDescExpenseReport=STEP %s: Define default accounting accounts for each type of expense report. For this, use the menu entry %s. -AccountancyAreaDescSal=STEP %s: Define default accounting accounts for payment of salaries. For this, use the menu entry %s. -AccountancyAreaDescContrib=STEP %s: Define default accounting accounts for special expenses (miscellaneous taxes). For this, use the menu entry %s. -AccountancyAreaDescDonation=STEP %s: Define default accounting accounts for donation. For this, use the menu entry %s. -AccountancyAreaDescSubscription=STEP %s: Define default accounting accounts for member subscription. For this, use the menu entry %s. -AccountancyAreaDescMisc=STEP %s: Define mandatory default account and default accounting accounts for miscellaneous transactions. For this, use the menu entry %s. -AccountancyAreaDescLoan=STEP %s: Define default accounting accounts for loans. For this, use the menu entry %s. -AccountancyAreaDescBank=STEP %s: Define accounting accounts and journal code for each bank and financial accounts. For this, use the menu entry %s. -AccountancyAreaDescProd=STEP %s: Define accounting accounts on your products/services. For this, use the menu entry %s. - -AccountancyAreaDescBind=STEP %s: Check the binding between existing %s lines and accounting account is done, so application will be able to journalize transactions in Ledger in one click. Complete missing bindings. For this, use the menu entry %s. -AccountancyAreaDescWriteRecords=STEP %s: Write transactions into the Ledger. For this, go into menu %s, and click into button %s. -AccountancyAreaDescAnalyze=STEP %s: Add or edit existing transactions and generate reports and exports. - -AccountancyAreaDescClosePeriod=STEP %s: Close period so we can't make modification in a future. - -TheJournalCodeIsNotDefinedOnSomeBankAccount=A mandatory step in setup has not been completed (accounting code journal not defined for all bank accounts) -Selectchartofaccounts=Select active chart of accounts -ChangeAndLoad=Change and load -Addanaccount=Add an accounting account -AccountAccounting=Accounting account -AccountAccountingShort=Account -SubledgerAccount=Subledger account -SubledgerAccountLabel=Subledger account label -ShowAccountingAccount=Show accounting account -ShowAccountingJournal=Show accounting journal -ShowAccountingAccountInLedger=Show accounting account in ledger -ShowAccountingAccountInJournals=Show accounting account in journals -AccountAccountingSuggest=Accounting account suggested -MenuDefaultAccounts=Default accounts -MenuBankAccounts=Bank accounts -MenuVatAccounts=Vat accounts -MenuTaxAccounts=Tax accounts -MenuExpenseReportAccounts=Expense report accounts -MenuLoanAccounts=Loan accounts -MenuProductsAccounts=Product accounts -MenuClosureAccounts=Closure accounts -MenuAccountancyClosure=Closure -MenuAccountancyValidationMovements=Validate movements -ProductsBinding=Products accounts -TransferInAccounting=Transfer in accounting -RegistrationInAccounting=Registration in accounting -Binding=Binding to accounts -CustomersVentilation=Customer invoice binding -SuppliersVentilation=Vendor invoice binding -ExpenseReportsVentilation=Expense report binding -CreateMvts=Create new transaction -UpdateMvts=Modification of a transaction -ValidTransaction=Validate transaction -WriteBookKeeping=Register transactions in accounting -Bookkeeping=Ledger -BookkeepingSubAccount=Subledger -AccountBalance=Account balance -ObjectsRef=Source object ref -CAHTF=Total purchase vendor before tax -TotalExpenseReport=Total expense report -InvoiceLines=Lines of invoices to bind -InvoiceLinesDone=Bound lines of invoices -ExpenseReportLines=Lines of expense reports to bind -ExpenseReportLinesDone=Bound lines of expense reports -IntoAccount=Bind line with the accounting account -TotalForAccount=Total accounting account - - -Ventilate=Bind -LineId=Id line -Processing=Processing -EndProcessing=Process terminated. -SelectedLines=Selected lines -Lineofinvoice=Line of invoice -LineOfExpenseReport=Line of expense report -NoAccountSelected=No accounting account selected -VentilatedinAccount=Binded successfully to the accounting account -NotVentilatedinAccount=Not bound to the accounting account -XLineSuccessfullyBinded=%s products/services successfully bound to an accounting account -XLineFailedToBeBinded=%s products/services were not bound to any accounting account - -ACCOUNTING_LIMIT_LIST_VENTILATION=Maximum number of lines on list and bind page (recommended: 50) -ACCOUNTING_LIST_SORT_VENTILATION_TODO=Begin the sorting of the page "Binding to do" by the most recent elements -ACCOUNTING_LIST_SORT_VENTILATION_DONE=Begin the sorting of the page "Binding done" by the most recent elements - -ACCOUNTING_LENGTH_DESCRIPTION=Truncate product & services description in listings after x chars (Best = 50) -ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT=Truncate product & services account description form in listings after x chars (Best = 50) -ACCOUNTING_LENGTH_GACCOUNT=Length of the general accounting accounts (If you set value to 6 here, the account '706' will appear like '706000' on screen) -ACCOUNTING_LENGTH_AACCOUNT=Length of the third-party accounting accounts (If you set value to 6 here, the account '401' will appear like '401000' on screen) -ACCOUNTING_MANAGE_ZERO=Allow to manage different number of zeros at the end of an accounting account. Needed by some countries (like Switzerland). If set to off (default), you can set the following two parameters to ask the application to add virtual zeros. -BANK_DISABLE_DIRECT_INPUT=Disable direct recording of transaction in bank account -ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL=Enable draft export on journal -ACCOUNTANCY_COMBO_FOR_AUX=Enable combo list for subsidiary account (may be slow if you have a lot of third parties, break ability to search on a part of value) -ACCOUNTING_DATE_START_BINDING=Define a date to start binding & transfer in accountancy. Below this date, the transactions will not be transferred to accounting. -ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER=On accountancy transfer, select period show by default - -ACCOUNTING_SELL_JOURNAL=Sell journal -ACCOUNTING_PURCHASE_JOURNAL=Purchase journal -ACCOUNTING_MISCELLANEOUS_JOURNAL=Miscellaneous journal -ACCOUNTING_EXPENSEREPORT_JOURNAL=Expense report journal -ACCOUNTING_SOCIAL_JOURNAL=Social journal -ACCOUNTING_HAS_NEW_JOURNAL=Has new Journal - -ACCOUNTING_RESULT_PROFIT=Result accounting account (Profit) -ACCOUNTING_RESULT_LOSS=Result accounting account (Loss) -ACCOUNTING_CLOSURE_DEFAULT_JOURNAL=Journal of closure - -ACCOUNTING_ACCOUNT_TRANSFER_CASH=Accounting account of transitional bank transfer -TransitionalAccount=Transitional bank transfer account - -ACCOUNTING_ACCOUNT_SUSPENSE=Accounting account of wait -DONATION_ACCOUNTINGACCOUNT=Accounting account to register donations -ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT=Accounting account to register subscriptions - -ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT=Accounting account by default to register customer deposit - -ACCOUNTING_PRODUCT_BUY_ACCOUNT=Accounting account by default for the bought products (used if not defined in the product sheet) -ACCOUNTING_PRODUCT_BUY_INTRA_ACCOUNT=Accounting account by default for the bought products in EEC (used if not defined in the product sheet) -ACCOUNTING_PRODUCT_BUY_EXPORT_ACCOUNT=Accounting account by default for the bought products and imported out of EEC (used if not defined in the product sheet) -ACCOUNTING_PRODUCT_SOLD_ACCOUNT=Accounting account by default for the sold products (used if not defined in the product sheet) -ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT=Accounting account by default for the products sold in EEC (used if not defined in the product sheet) -ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT=Accounting account by default for the products sold and exported out of EEC (used if not defined in the product sheet) - -ACCOUNTING_SERVICE_BUY_ACCOUNT=Accounting account by default for the bought services (used if not defined in the service sheet) -ACCOUNTING_SERVICE_BUY_INTRA_ACCOUNT=Accounting account by default for the bought services in EEC (used if not defined in the service sheet) -ACCOUNTING_SERVICE_BUY_EXPORT_ACCOUNT=Accounting account by default for the bought services and imported out of EEC (used if not defined in the service sheet) -ACCOUNTING_SERVICE_SOLD_ACCOUNT=Accounting account by default for the sold services (used if not defined in the service sheet) -ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT=Accounting account by default for the services sold in EEC (used if not defined in the service sheet) -ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT=Accounting account by default for the services sold and exported out of EEC (used if not defined in the service sheet) - -Doctype=Type of document -Docdate=Date -Docref=Reference -LabelAccount=Label account -LabelOperation=Label operation -Sens=Direction -AccountingDirectionHelp=For an accounting account of a customer, use Credit to record a payment you have received
    For an accounting account of a supplier, use Debit to record a payment you made -LetteringCode=Lettering code -Lettering=Lettering -Codejournal=Journal -JournalLabel=Journal label -NumPiece=Piece number -TransactionNumShort=Num. transaction -AccountingCategory=Custom group -GroupByAccountAccounting=Group by general ledger account -GroupBySubAccountAccounting=Group by subledger account -AccountingAccountGroupsDesc=You can define here some groups of accounting account. They will be used for personalized accounting reports. -ByAccounts=By accounts -ByPredefinedAccountGroups=By predefined groups -ByPersonalizedAccountGroups=By personalized groups -ByYear=By year -NotMatch=Not Set -DeleteMvt=Delete some operation lines from accounting -DelMonth=Month to delete -DelYear=Year to delete -DelJournal=Journal to delete -ConfirmDeleteMvt=This will delete all operation lines of the accounting for the year/month and/or for a specific journal (At least one criterion is required). You will have to reuse the feature '%s' to have the deleted record back in the ledger. -ConfirmDeleteMvtPartial=This will delete the transaction from the accounting (all operation lines related to the same transaction will be deleted) -FinanceJournal=Finance journal -ExpenseReportsJournal=Expense reports journal -DescFinanceJournal=Finance journal including all the types of payments by bank account -DescJournalOnlyBindedVisible=This is a view of record that are bound to an accounting account and can be recorded into the Journals and Ledger. -VATAccountNotDefined=Account for VAT not defined -ThirdpartyAccountNotDefined=Account for third party not defined -ProductAccountNotDefined=Account for product not defined -FeeAccountNotDefined=Account for fee not defined -BankAccountNotDefined=Account for bank not defined -CustomerInvoicePayment=Payment of invoice customer -ThirdPartyAccount=Third-party account -NewAccountingMvt=New transaction -NumMvts=Numero of transaction -ListeMvts=List of movements -ErrorDebitCredit=Debit and Credit cannot have a value at the same time -AddCompteFromBK=Add accounting accounts to the group -ReportThirdParty=List third-party account -DescThirdPartyReport=Consult here the list of third-party customers and vendors and their accounting accounts -ListAccounts=List of the accounting accounts -UnknownAccountForThirdparty=Unknown third-party account. We will use %s -UnknownAccountForThirdpartyBlocking=Unknown third-party account. Blocking error -ThirdpartyAccountNotDefinedOrThirdPartyUnknown=Subledger account not defined or third party or user unknown. We will use %s -ThirdpartyAccountNotDefinedOrThirdPartyUnknownSubledgerIgnored=Third-party unknown and subledger not defined on the payment. We will keep the subledger account value empty. -ThirdpartyAccountNotDefinedOrThirdPartyUnknownBlocking=Subledger account not defined or third party or user unknown. Blocking error. -UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking=Unknown third-party account and waiting account not defined. Blocking error -PaymentsNotLinkedToProduct=Payment not linked to any product / service -OpeningBalance=Opening balance -ShowOpeningBalance=Show opening balance -HideOpeningBalance=Hide opening balance -ShowSubtotalByGroup=Show subtotal by level - -Pcgtype=Group of account -PcgtypeDesc=Group of account are used as predefined 'filter' and 'grouping' criteria for some accounting reports. For example, 'INCOME' or 'EXPENSE' are used as groups for accounting accounts of products to build the expense/income report. - -Reconcilable=Reconcilable - -TotalVente=Total turnover before tax -TotalMarge=Total sales margin - -DescVentilCustomer=Consult here the list of customer invoice lines bound (or not) to a product accounting account -DescVentilMore=In most cases, if you use predefined products or services and you set the account number on the product/service card, the application will be able to make all the binding between your invoice lines and the accounting account of your chart of accounts, just in one click with the button "%s". If account was not set on product/service cards or if you still have some lines not bound to an account, you will have to make a manual binding from the menu "%s". -DescVentilDoneCustomer=Consult here the list of the lines of invoices customers and their product accounting account -DescVentilTodoCustomer=Bind invoice lines not already bound with a product accounting account -ChangeAccount=Change the product/service accounting account for selected lines with the following accounting account: -Vide=- -DescVentilSupplier=Consult here the list of vendor invoice lines bound or not yet bound to a product accounting account (only record not already transfered in accountancy are visible) -DescVentilDoneSupplier=Consult here the list of the lines of vendor invoices and their accounting account -DescVentilTodoExpenseReport=Bind expense report lines not already bound with a fee accounting account -DescVentilExpenseReport=Consult here the list of expense report lines bound (or not) to a fee accounting account -DescVentilExpenseReportMore=If you setup accounting account on type of expense report lines, the application will be able to make all the binding between your expense report lines and the accounting account of your chart of accounts, just in one click with the button "%s". If account was not set on fees dictionary or if you still have some lines not bound to any account, you will have to make a manual binding from the menu "%s". -DescVentilDoneExpenseReport=Consult here the list of the lines of expenses reports and their fees accounting account - -Closure=Annual closure -DescClosure=Consult here the number of movements by month who are not validated & fiscal years already open -OverviewOfMovementsNotValidated=Step 1/ Overview of movements not validated. (Necessary to close a fiscal year) -AllMovementsWereRecordedAsValidated=All movements were recorded as validated -NotAllMovementsCouldBeRecordedAsValidated=Not all movements could be recorded as validated -ValidateMovements=Validate movements -DescValidateMovements=Any modification or deletion of writing, lettering and deletes will be prohibited. All entries for an exercise must be validated otherwise closing will not be possible - -ValidateHistory=Bind Automatically -AutomaticBindingDone=Automatic binding done - -ErrorAccountancyCodeIsAlreadyUse=Error, you cannot delete this accounting account because it is used -MvtNotCorrectlyBalanced=Movement not correctly balanced. Debit = %s | Credit = %s -Balancing=Balancing -FicheVentilation=Binding card -GeneralLedgerIsWritten=Transactions are written in the Ledger -GeneralLedgerSomeRecordWasNotRecorded=Some of the transactions could not be journalized. If there is no other error message, this is probably because they were already journalized. -NoNewRecordSaved=No more record to journalize -ListOfProductsWithoutAccountingAccount=List of products not bound to any accounting account -ChangeBinding=Change the binding -Accounted=Accounted in ledger -NotYetAccounted=Not yet accounted in the ledger -ShowTutorial=Show Tutorial -NotReconciled=Not reconciled -WarningRecordWithoutSubledgerAreExcluded=Warning, all operations without subledger account defined are filtered and excluded from this view - -## Admin -BindingOptions=Binding options -ApplyMassCategories=Apply mass categories -AddAccountFromBookKeepingWithNoCategories=Available account not yet in the personalized group -CategoryDeleted=Category for the accounting account has been removed -AccountingJournals=Accounting journals -AccountingJournal=Accounting journal -NewAccountingJournal=New accounting journal -ShowAccountingJournal=Show accounting journal -NatureOfJournal=Nature of Journal -AccountingJournalType1=Miscellaneous operations -AccountingJournalType2=Sales -AccountingJournalType3=Purchases -AccountingJournalType4=Bank -AccountingJournalType5=Expenses report -AccountingJournalType8=Inventory -AccountingJournalType9=Has-new -ErrorAccountingJournalIsAlreadyUse=This journal is already use -AccountingAccountForSalesTaxAreDefinedInto=Note: Accounting account for Sales tax are defined into menu %s - %s -NumberOfAccountancyEntries=Number of entries -NumberOfAccountancyMovements=Number of movements -ACCOUNTING_DISABLE_BINDING_ON_SALES=Disable binding & transfer in accountancy on sales (customer invoices will not be taken into account in accounting) -ACCOUNTING_DISABLE_BINDING_ON_PURCHASES=Disable binding & transfer in accountancy on purchases (vendor invoices will not be taken into account in accounting) -ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS=Disable binding & transfer in accountancy on expense reports (expense reports will not be taken into account in accounting) - -## Export -NotifiedExportDate=Notified export date (modification of the entries will not be possible) -NotifiedValidationDate=Validation of the entries (modification or deletion of the entries will not be possible) -ConfirmExportFile=Confirmation of the generation of the accounting export file ? -ExportDraftJournal=Export draft journal -Modelcsv=Model of export -Selectmodelcsv=Select a model of export -Modelcsv_normal=Classic export -Modelcsv_CEGID=Export for CEGID Expert Comptabilité -Modelcsv_COALA=Export for Sage Coala -Modelcsv_bob50=Export for Sage BOB 50 -Modelcsv_ciel=Export for Sage50, Ciel Compta or Compta Evo. (Format XIMPORT) -Modelcsv_quadratus=Export for Quadratus QuadraCompta -Modelcsv_ebp=Export for EBP -Modelcsv_cogilog=Export for Cogilog -Modelcsv_agiris=Export for Agiris -Modelcsv_LDCompta=Export for LD Compta (v9) (Test) -Modelcsv_LDCompta10=Export for LD Compta (v10 & higher) -Modelcsv_openconcerto=Export for OpenConcerto (Test) -Modelcsv_configurable=Export CSV Configurable -Modelcsv_FEC=Export FEC -Modelcsv_FEC2=Export FEC (With dates generation writing / document reversed) -Modelcsv_Sage50_Swiss=Export for Sage 50 Switzerland -Modelcsv_winfic=Export Winfic - eWinfic - WinSis Compta -Modelcsv_Gestinumv3=Export for Gestinum (v3) -Modelcsv_Gestinumv5Export for Gestinum (v5) -ChartofaccountsId=Chart of accounts Id - -## Tools - Init accounting account on product / service -InitAccountancy=Init accountancy -InitAccountancyDesc=This page can be used to initialize an accounting account on products and services that does not have accounting account defined for sales and purchases. -DefaultBindingDesc=This page can be used to set a default account to use to link transactions record about payment salaries, donation, taxes and vat when no specific accounting account were already set. -DefaultClosureDesc=This page can be used to set parameters used for accounting closures. -Options=Options -OptionModeProductSell=Mode sales -OptionModeProductSellIntra=Mode sales exported in EEC -OptionModeProductSellExport=Mode sales exported in other countries -OptionModeProductBuy=Mode purchases -OptionModeProductBuyIntra=Mode purchases imported in EEC -OptionModeProductBuyExport=Mode purchased imported from other countries -OptionModeProductSellDesc=Show all products with accounting account for sales. -OptionModeProductSellIntraDesc=Show all products with accounting account for sales in EEC. -OptionModeProductSellExportDesc=Show all products with accounting account for other foreign sales. -OptionModeProductBuyDesc=Show all products with accounting account for purchases. -OptionModeProductBuyIntraDesc=Show all products with accounting account for purchases in EEC. -OptionModeProductBuyExportDesc=Show all products with accounting account for other foreign purchases. -CleanFixHistory=Remove accounting code from lines that not exists into charts of account -CleanHistory=Reset all bindings for selected year -PredefinedGroups=Predefined groups -WithoutValidAccount=Without valid dedicated account -WithValidAccount=With valid dedicated account -ValueNotIntoChartOfAccount=This value of accounting account does not exist into chart of account -AccountRemovedFromGroup=Account removed from group -SaleLocal=Local sale -SaleExport=Export sale -SaleEEC=Sale in EEC -SaleEECWithVAT=Sale in EEC with a VAT not null, so we suppose this is NOT an intracommunautary sale and the suggested account is the standard product account. -SaleEECWithoutVATNumber=Sale in EEC with no VAT but the VAT ID of thirdparty is not defined. We fallback on the product account for standard sales. You can fix the VAT ID of thirdparty or the product account if needed. - -## Dictionary -Range=Range of accounting account -Calculated=Calculated -Formula=Formula - -## Error -SomeMandatoryStepsOfSetupWereNotDone=Some mandatory steps of setup was not done, please complete them -ErrorNoAccountingCategoryForThisCountry=No accounting account group available for country %s (See Home - Setup - Dictionaries) -ErrorInvoiceContainsLinesNotYetBounded=You try to journalize some lines of the invoice %s, but some other lines are not yet bounded to accounting account. Journalization of all invoice lines for this invoice are refused. -ErrorInvoiceContainsLinesNotYetBoundedShort=Some lines on invoice are not bound to accounting account. -ExportNotSupported=The export format setuped is not supported into this page -BookeppingLineAlreayExists=Lines already existing into bookkeeping -NoJournalDefined=No journal defined -Binded=Lines bound -ToBind=Lines to bind -UseMenuToSetBindindManualy=Lines not yet bound, use menu %s to make the binding manually - -## Import -ImportAccountingEntries=Accounting entries -ImportAccountingEntriesFECFormat=Accounting entries - FEC format -FECFormatJournalCode=Code journal (JournalCode) -FECFormatJournalLabel=Label journal (JournalLib) -FECFormatEntryNum=Piece number (EcritureNum) -FECFormatEntryDate=Piece date (EcritureDate) -FECFormatGeneralAccountNumber=General account number (CompteNum) -FECFormatGeneralAccountLabel=General account label (CompteLib) -FECFormatSubledgerAccountNumber=Subledger account number (CompAuxNum) -FECFormatSubledgerAccountLabel=Subledger account number (CompAuxLib) -FECFormatPieceRef=Piece ref (PieceRef) -FECFormatPieceDate=Piece date creation (PieceDate) -FECFormatLabelOperation=Label operation (EcritureLib) -FECFormatDebit=Debit (Debit) -FECFormatCredit=Credit (Credit) -FECFormatReconcilableCode=Reconcilable code (EcritureLet) -FECFormatReconcilableDate=Reconcilable date (DateLet) -FECFormatValidateDate=Piece date validated (ValidDate) -FECFormatMulticurrencyAmount=Multicurrency amount (Montantdevise) -FECFormatMulticurrencyCode=Multicurrency code (Idevise) - -DateExport=Date export -WarningReportNotReliable=Warning, this report is not based on the Ledger, so does not contains transaction modified manually in the Ledger. If your journalization is up to date, the bookkeeping view is more accurate. -ExpenseReportJournal=Expense Report Journal -InventoryJournal=Inventory Journal - -NAccounts=%s accounts diff --git a/htdocs/langs/ar_IQ/admin.lang b/htdocs/langs/ar_IQ/admin.lang index f52c28a9da3..052a23ce875 100644 --- a/htdocs/langs/ar_IQ/admin.lang +++ b/htdocs/langs/ar_IQ/admin.lang @@ -1,2161 +1,10 @@ # Dolibarr language file - Source file is en_US - admin -Foundation=Foundation -Version=Version -Publisher=Publisher -VersionProgram=Version program -VersionLastInstall=Initial install version -VersionLastUpgrade=Latest version upgrade -VersionExperimental=Experimental -VersionDevelopment=Development -VersionUnknown=Unknown -VersionRecommanded=Recommended -FileCheck=Fileset Integrity Checks -FileCheckDesc=This tool allows you to check the integrity of files and the setup of your application, comparing each file with the official one. The value of some setup constants may also be checked. You can use this tool to determine if any files have been modified (e.g by a hacker). -FileIntegrityIsStrictlyConformedWithReference=Files integrity is strictly conformed with the reference. -FileIntegrityIsOkButFilesWereAdded=Files integrity check has passed, however some new files have been added. -FileIntegritySomeFilesWereRemovedOrModified=Files integrity check has failed. Some files were modified, removed or added. -GlobalChecksum=Global checksum -MakeIntegrityAnalysisFrom=Make integrity analysis of application files from -LocalSignature=Embedded local signature (less reliable) -RemoteSignature=Remote distant signature (more reliable) -FilesMissing=Missing Files -FilesUpdated=Updated Files -FilesModified=Modified Files -FilesAdded=Added Files -FileCheckDolibarr=Check integrity of application files -AvailableOnlyOnPackagedVersions=The local file for integrity checking is only available when the application is installed from an official package -XmlNotFound=Xml Integrity File of application not found -SessionId=Session ID -SessionSaveHandler=Handler to save sessions -SessionSavePath=Session save location -PurgeSessions=Purge of sessions -ConfirmPurgeSessions=Do you really want to purge all sessions? This will disconnect every user (except yourself). -NoSessionListWithThisHandler=Save session handler configured in your PHP does not allow listing all running sessions. -LockNewSessions=Lock new connections -ConfirmLockNewSessions=Are you sure you want to restrict any new Dolibarr connection to yourself? Only user %s will be able to connect after that. -UnlockNewSessions=Remove connection lock -YourSession=Your session -Sessions=Users Sessions -WebUserGroup=Web server user/group -PermissionsOnFiles=Permissions on files -PermissionsOnFilesInWebRoot=Permissions on files in web root directory -PermissionsOnFile=Permissions on file %s -NoSessionFound=Your PHP configuration seems to not allow listing of active sessions. The directory used to save sessions (%s) may be protected (for example by OS permissions or by PHP directive open_basedir). -DBStoringCharset=Database charset to store data -DBSortingCharset=Database charset to sort data -HostCharset=Host charset -ClientCharset=Client charset -ClientSortingCharset=Client collation -WarningModuleNotActive=Module %s must be enabled -WarningOnlyPermissionOfActivatedModules=Only permissions related to activated modules are shown here. You can activate other modules in the Home->Setup->Modules page. -DolibarrSetup=Dolibarr install or upgrade -InternalUser=Internal user -ExternalUser=External user -InternalUsers=Internal users -ExternalUsers=External users -UserInterface=User interface -GUISetup=Display -SetupArea=Setup -UploadNewTemplate=Upload new template(s) -FormToTestFileUploadForm=Form to test file upload (according to setup) -ModuleMustBeEnabled=The module/application %s must be enabled -ModuleIsEnabled=The module/application %s has been enabled -IfModuleEnabled=Note: yes is effective only if module %s is enabled -RemoveLock=Remove/rename file %s if it exists, to allow usage of the Update/Install tool. -RestoreLock=Restore file %s, with read permission only, to disable any further use of the Update/Install tool. -SecuritySetup=Security setup -PHPSetup=PHP setup -OSSetup=OS setup -SecurityFilesDesc=Define here options related to security about uploading files. -ErrorModuleRequirePHPVersion=Error, this module requires PHP version %s or higher -ErrorModuleRequireDolibarrVersion=Error, this module requires Dolibarr version %s or higher -ErrorDecimalLargerThanAreForbidden=Error, a precision higher than %s is not supported. -DictionarySetup=Dictionary setup -Dictionary=Dictionaries -ErrorReservedTypeSystemSystemAuto=Value 'system' and 'systemauto' for type is reserved. You can use 'user' as value to add your own record -ErrorCodeCantContainZero=Code can't contain value 0 -DisableJavascript=Disable JavaScript and Ajax functions DisableJavascriptNote=Note: For test or debug purpose. For optimization for blind person or text browsers, you may prefer to use the setup on the profile of user -UseSearchToSelectCompanyTooltip=Also if you have a large number of third parties (> 100 000), you can increase speed by setting constant COMPANY_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string. -UseSearchToSelectContactTooltip=Also if you have a large number of third parties (> 100 000), you can increase speed by setting constant CONTACT_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string. -DelaiedFullListToSelectCompany=Wait until a key is pressed before loading content of Third Parties combo list.
    This may increase performance if you have a large number of third parties, but it is less convenient. -DelaiedFullListToSelectContact=Wait until a key is pressed before loading content of Contact combo list.
    This may increase performance if you have a large number of contacts, but it is less convenient. -NumberOfKeyToSearch=Number of characters to trigger search: %s -NumberOfBytes=Number of Bytes -SearchString=Search string -NotAvailableWhenAjaxDisabled=Not available when Ajax disabled -AllowToSelectProjectFromOtherCompany=On document of a third party, can choose a project linked to another third party -TimesheetPreventAfterFollowingMonths=Prevent recording time spent after the following number of months -JavascriptDisabled=JavaScript disabled -UsePreviewTabs=Use preview tabs -ShowPreview=Show preview -ShowHideDetails=Show-Hide details -PreviewNotAvailable=Preview not available -ThemeCurrentlyActive=Theme currently active -MySQLTimeZone=TimeZone MySql (database) -TZHasNoEffect=Dates are stored and returned by database server as if they were kept as submitted string. The timezone has effect only when using the UNIX_TIMESTAMP function (that should not be used by Dolibarr, so database TZ should have no effect, even if changed after data was entered). -Space=Space -Table=Table -Fields=Fields -Index=Index -Mask=Mask -NextValue=Next value -NextValueForInvoices=Next value (invoices) -NextValueForCreditNotes=Next value (credit notes) -NextValueForDeposit=Next value (down payment) -NextValueForReplacements=Next value (replacements) -MustBeLowerThanPHPLimit=Note: your PHP configuration currently limits the maximum filesize for upload to %s %s, irrespective of the value of this parameter -NoMaxSizeByPHPLimit=Note: No limit is set in your PHP configuration -MaxSizeForUploadedFiles=Maximum size for uploaded files (0 to disallow any upload) -UseCaptchaCode=Use graphical code (CAPTCHA) on login page -AntiVirusCommand=Full path to antivirus command -AntiVirusCommandExample=Example for ClamAv Daemon (require clamav-daemon): /usr/bin/clamdscan
    Example for ClamWin (very very slow): c:\\Progra~1\\ClamWin\\bin\\clamscan.exe -AntiVirusParam= More parameters on command line -AntiVirusParamExample=Example for ClamAv Daemon: --fdpass
    Example for ClamWin: --database="C:\\Program Files (x86)\\ClamWin\\lib" -ComptaSetup=Accounting module setup -UserSetup=User management setup -MultiCurrencySetup=Multi-currency setup -MenuLimits=Limits and accuracy -MenuIdParent=Parent menu ID -DetailMenuIdParent=ID of parent menu (empty for a top menu) -ParentID=Parent ID -DetailPosition=Sort number to define menu position -AllMenus=All -NotConfigured=Module/Application not configured -Active=Active -SetupShort=Setup -OtherOptions=Other options -OtherSetup=Other Setup -CurrentValueSeparatorDecimal=Decimal separator -CurrentValueSeparatorThousand=Thousand separator -Destination=Destination -IdModule=Module ID -IdPermissions=Permissions ID -LanguageBrowserParameter=Parameter %s -LocalisationDolibarrParameters=Localization parameters -ClientTZ=Client Time Zone (user) -ClientHour=Client time (user) -OSTZ=Server OS Time Zone -PHPTZ=PHP server Time Zone -DaylingSavingTime=Daylight saving time -CurrentHour=PHP Time (server) -CurrentSessionTimeOut=Current session timeout -YouCanEditPHPTZ=To set a different PHP timezone (not required), you can try to add a .htaccess file with a line like this "SetEnv TZ Europe/Paris" -HoursOnThisPageAreOnServerTZ=Warning, in contrary of other screens, hours on this page are not in your local timezone, but of the timezone of the server. -Box=Widget -Boxes=Widgets -MaxNbOfLinesForBoxes=Max. number of lines for widgets -AllWidgetsWereEnabled=All available widgets are enabled -PositionByDefault=Default order -Position=Position -MenusDesc=Menu managers set content of the two menu bars (horizontal and vertical). -MenusEditorDesc=The menu editor allows you to define custom menu entries. Use it carefully to avoid instability and permanently unreachable menu entries.
    Some modules add menu entries (in menu All mostly). If you remove some of these entries by mistake, you can restore them disabling and reenabling the module. -MenuForUsers=Menu for users -LangFile=.lang file -Language_en_US_es_MX_etc=Language (en_US, es_MX, ...) -System=System -SystemInfo=System information -SystemToolsArea=System tools area -SystemToolsAreaDesc=This area provides administration functions. Use the menu to choose the required feature. -Purge=Purge -PurgeAreaDesc=This page allows you to delete all files generated or stored by Dolibarr (temporary files or all files in %s directory). Using this feature is not normally necessary. It is provided as a workaround for users whose Dolibarr is hosted by a provider that does not offer permissions to delete files generated by the web server. -PurgeDeleteLogFile=Delete log files, including %s defined for Syslog module (no risk of losing data) -PurgeDeleteTemporaryFiles=Delete all log and temporary files (no risk of losing data). Parameter can be 'tempfilesold', 'logfiles' or both 'tempfilesold+logfiles'. Note: Deletion of temporary files is done only if the temp directory was created more than 24 hours ago. -PurgeDeleteTemporaryFilesShort=Delete log and temporary files -PurgeDeleteAllFilesInDocumentsDir=Delete all files in directory: %s.
    This will delete all generated documents related to elements (third parties, invoices etc...), files uploaded into the ECM module, database backup dumps and temporary files. -PurgeRunNow=Purge now -PurgeNothingToDelete=No directory or files to delete. -PurgeNDirectoriesDeleted=%s files or directories deleted. -PurgeNDirectoriesFailed=Failed to delete %s files or directories. -PurgeAuditEvents=Purge all security events -ConfirmPurgeAuditEvents=Are you sure you want to purge all security events? All security logs will be deleted, no other data will be removed. -GenerateBackup=Generate backup -Backup=Backup -Restore=Restore -RunCommandSummary=Backup has been launched with the following command -BackupResult=Backup result -BackupFileSuccessfullyCreated=Backup file successfully generated -YouCanDownloadBackupFile=The generated file can now be downloaded -NoBackupFileAvailable=No backup files available. -ExportMethod=Export method -ImportMethod=Import method -ToBuildBackupFileClickHere=To build a backup file, click here. -ImportMySqlDesc=To import a MySQL backup file, you may use phpMyAdmin via your hosting or use the mysql command from the Command line.
    For example: -ImportPostgreSqlDesc=To import a backup file, you must use pg_restore command from command line: -ImportMySqlCommand=%s %s < mybackupfile.sql -ImportPostgreSqlCommand=%s %s mybackupfile.sql -FileNameToGenerate=Filename for backup: -Compression=Compression -CommandsToDisableForeignKeysForImport=Command to disable foreign keys on import -CommandsToDisableForeignKeysForImportWarning=Mandatory if you want to be able to restore your sql dump later -ExportCompatibility=Compatibility of generated export file -ExportUseMySQLQuickParameter=Use the --quick parameter -ExportUseMySQLQuickParameterHelp=The '--quick' parameter helps limit RAM consumption for large tables. -MySqlExportParameters=MySQL export parameters -PostgreSqlExportParameters= PostgreSQL export parameters -UseTransactionnalMode=Use transactional mode -FullPathToMysqldumpCommand=Full path to mysqldump command -FullPathToPostgreSQLdumpCommand=Full path to pg_dump command -AddDropDatabase=Add DROP DATABASE command -AddDropTable=Add DROP TABLE command -ExportStructure=Structure -NameColumn=Name columns -ExtendedInsert=Extended INSERT -NoLockBeforeInsert=No lock commands around INSERT -DelayedInsert=Delayed insert -EncodeBinariesInHexa=Encode binary data in hexadecimal -IgnoreDuplicateRecords=Ignore errors of duplicate record (INSERT IGNORE) -AutoDetectLang=Autodetect (browser language) -FeatureDisabledInDemo=Feature disabled in demo -FeatureAvailableOnlyOnStable=Feature only available on official stable versions -BoxesDesc=Widgets are components showing some information that you can add to personalize some pages. You can choose between showing the widget or not by selecting target page and clicking 'Activate', or by clicking the trashcan to disable it. -OnlyActiveElementsAreShown=Only elements from enabled modules are shown. -ModulesDesc=The modules/applications determine which features are available in the software. Some modules require permissions to be granted to users after activating the module. Click the on/off button %s of each module to enable or disable a module/application. -ModulesDesc2=Click the wheel button %s to configure the module/application. -ModulesMarketPlaceDesc=You can find more modules to download on external websites on the Internet... -ModulesDeployDesc=If permissions on your file system allow it, you can use this tool to deploy an external module. The module will then be visible on the tab %s. -ModulesMarketPlaces=Find external app/modules -ModulesDevelopYourModule=Develop your own app/modules -ModulesDevelopDesc=You may also develop your own module or find a partner to develop one for you. -DOLISTOREdescriptionLong=Instead of switching on www.dolistore.com web site to find an external module, you can use this embedded tool that will perform the search on the external market place for you (may be slow, need an internet access)... -NewModule=New module -FreeModule=Free -CompatibleUpTo=Compatible with version %s -NotCompatible=This module does not seem compatible with your Dolibarr %s (Min %s - Max %s). -CompatibleAfterUpdate=This module requires an update to your Dolibarr %s (Min %s - Max %s). -SeeInMarkerPlace=See in Market place -SeeSetupOfModule=See setup of module %s -SetOptionTo=Set option %s to %s -Updated=Updated -AchatTelechargement=Buy / Download -GoModuleSetupArea=To deploy/install a new module, go to the Module setup area: %s. -DoliStoreDesc=DoliStore, the official market place for Dolibarr ERP/CRM external modules -DoliPartnersDesc=List of companies providing custom-developed modules or features.
    Note: since Dolibarr is an open source application, anyone experienced in PHP programming should be able to develop a module. -WebSiteDesc=External websites for more add-on (non-core) modules... -DevelopYourModuleDesc=Some solutions to develop your own module... -URL=URL -RelativeURL=Relative URL -BoxesAvailable=Widgets available -BoxesActivated=Widgets activated -ActivateOn=Activate on -ActiveOn=Activated on -ActivatableOn=Activatable on -SourceFile=Source file -AvailableOnlyIfJavascriptAndAjaxNotDisabled=Available only if JavaScript is not disabled -Required=Required -UsedOnlyWithTypeOption=Used by some agenda option only -Security=Security -Passwords=Passwords -DoNotStoreClearPassword=Encrypt passwords stored in database (NOT as plain-text). It is strongly recommended to activate this option. -MainDbPasswordFileConfEncrypted=Encrypt database password stored in conf.php. It is strongly recommended to activate this option. -InstrucToEncodePass=To have password encoded into the conf.php file, replace the line
    $dolibarr_main_db_pass="...";
    by
    $dolibarr_main_db_pass="crypted:%s"; -InstrucToClearPass=To have password decoded (clear) into the conf.php file, replace the line
    $dolibarr_main_db_pass="crypted:...";
    by
    $dolibarr_main_db_pass="%s"; -ProtectAndEncryptPdfFiles=Protect generated PDF files. This is NOT recommended as it breaks bulk PDF generation. -ProtectAndEncryptPdfFilesDesc=Protection of a PDF document keeps it available to read and print with any PDF browser. However, editing and copying is not possible anymore. Note that using this feature makes building of a global merged PDFs not working. -Feature=Feature -DolibarrLicense=License -Developpers=Developers/contributors -OfficialWebSite=Dolibarr official web site -OfficialWebSiteLocal=Local web site (%s) -OfficialWiki=Dolibarr documentation / Wiki -OfficialDemo=Dolibarr online demo -OfficialMarketPlace=Official market place for external modules/addons -OfficialWebHostingService=Referenced web hosting services (Cloud hosting) -ReferencedPreferredPartners=Preferred Partners -OtherResources=Other resources -ExternalResources=External Resources -SocialNetworks=Social Networks -SocialNetworkId=Social Network ID -ForDocumentationSeeWiki=For user or developer documentation (Doc, FAQs...),
    take a look at the Dolibarr Wiki:
    %s -ForAnswersSeeForum=For any other questions/help, you can use the Dolibarr forum:
    %s -HelpCenterDesc1=Here are some resources for getting help and support with Dolibarr. -HelpCenterDesc2=Some of these resources are only available in english. -CurrentMenuHandler=Current menu handler -MeasuringUnit=Measuring unit -LeftMargin=Left margin -TopMargin=Top margin -PaperSize=Paper type -Orientation=Orientation -SpaceX=Space X -SpaceY=Space Y -FontSize=Font size -Content=Content -NoticePeriod=Notice period -NewByMonth=New by month -Emails=Emails -EMailsSetup=Emails setup -EMailsDesc=This page allows you to set parameters or options for email sending. -EmailSenderProfiles=Emails sender profiles -EMailsSenderProfileDesc=You can keep this section empty. If you enter some emails here, they will be added to the list of possible senders into the combobox when your write a new email. -MAIN_MAIL_SMTP_PORT=SMTP/SMTPS Port (default value in php.ini: %s) -MAIN_MAIL_SMTP_SERVER=SMTP/SMTPS Host (default value in php.ini: %s) -MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike=SMTP/SMTPS Port (Not defined into PHP on Unix-like systems) -MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=SMTP/SMTPS Host (Not defined into PHP on Unix-like systems) -MAIN_MAIL_EMAIL_FROM=Sender email for automatic emails (default value in php.ini: %s) -MAIN_MAIL_ERRORS_TO=Email used for error returns emails (fields 'Errors-To' in emails sent) -MAIN_MAIL_AUTOCOPY_TO= Copy (Bcc) all sent emails to -MAIN_DISABLE_ALL_MAILS=Disable all email sending (for test purposes or demos) -MAIN_MAIL_FORCE_SENDTO=Send all emails to (instead of real recipients, for test purposes) -MAIN_MAIL_ENABLED_USER_DEST_SELECT=Suggest emails of employees (if defined) into the list of predefined recipient when writing a new email -MAIN_MAIL_SENDMODE=Email sending method -MAIN_MAIL_SMTPS_ID=SMTP ID (if sending server requires authentication) -MAIN_MAIL_SMTPS_PW=SMTP Password (if sending server requires authentication) -MAIN_MAIL_EMAIL_TLS=Use TLS (SSL) encryption -MAIN_MAIL_EMAIL_STARTTLS=Use TLS (STARTTLS) encryption -MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED=Authorise les certificats auto-signés -MAIN_MAIL_EMAIL_DKIM_ENABLED=Use DKIM to generate email signature -MAIN_MAIL_EMAIL_DKIM_DOMAIN=Email Domain for use with dkim -MAIN_MAIL_EMAIL_DKIM_SELECTOR=Name of dkim selector -MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY=Private key for dkim signing -MAIN_DISABLE_ALL_SMS=Disable all SMS sending (for test purposes or demos) -MAIN_SMS_SENDMODE=Method to use to send SMS -MAIN_MAIL_SMS_FROM=Default sender phone number for SMS sending -MAIN_MAIL_DEFAULT_FROMTYPE=Default sender email for manual sending (User email or Company email) -UserEmail=User email -CompanyEmail=Company Email -FeatureNotAvailableOnLinux=Feature not available on Unix like systems. Test your sendmail program locally. -FixOnTransifex=Fix the translation on the online translation platform of project -SubmitTranslation=If the translation for this language is not complete or you find errors, you can correct this by editing files in directory langs/%s and submit your change to www.transifex.com/dolibarr-association/dolibarr/ -SubmitTranslationENUS=If translation for this language is not complete or you find errors, you can correct this by editing files into directory langs/%s and submit modified files on dolibarr.org/forum or, if you are a developer, with a PR on github.com/Dolibarr/dolibarr -ModuleSetup=Module setup -ModulesSetup=Modules/Application setup -ModuleFamilyBase=System -ModuleFamilyCrm=Customer Relationship Management (CRM) -ModuleFamilySrm=Vendor Relationship Management (VRM) -ModuleFamilyProducts=Product Management (PM) -ModuleFamilyHr=Human Resource Management (HR) -ModuleFamilyProjects=Projects/Collaborative work -ModuleFamilyOther=Other -ModuleFamilyTechnic=Multi-modules tools -ModuleFamilyExperimental=Experimental modules -ModuleFamilyFinancial=Financial Modules (Accounting/Treasury) -ModuleFamilyECM=Electronic Content Management (ECM) -ModuleFamilyPortal=Websites and other frontal application -ModuleFamilyInterface=Interfaces with external systems -MenuHandlers=Menu handlers -MenuAdmin=Menu editor -DoNotUseInProduction=Do not use in production -ThisIsProcessToFollow=Upgrade procedure: -ThisIsAlternativeProcessToFollow=This is an alternative setup to process manually: -StepNb=Step %s -FindPackageFromWebSite=Find a package that provides the features you need (for example on the official web site %s). -DownloadPackageFromWebSite=Download package (for example from the official web site %s). -UnpackPackageInDolibarrRoot=Unpack/unzip the packaged files into your Dolibarr server directory: %s -UnpackPackageInModulesRoot=To deploy/install an external module, unpack/unzip the packaged files into the server directory dedicated to external modules:
    %s -SetupIsReadyForUse=Module deployment is finished. You must however enable and setup the module in your application by going to the page setup modules: %s. -NotExistsDirect=The alternative root directory is not defined to an existing directory.
    -InfDirAlt=Since version 3, it is possible to define an alternative root directory. This allows you to store, into a dedicated directory, plug-ins and custom templates.
    Just create a directory at the root of Dolibarr (eg: custom).
    -InfDirExample=
    Then declare it in the file conf.php
    $dolibarr_main_url_root_alt='/custom'
    $dolibarr_main_document_root_alt='/path/of/dolibarr/htdocs/custom'
    If these lines are commented with "#", to enable them, just uncomment by removing the "#" character. -YouCanSubmitFile=You can upload the .zip file of module package from here: -CurrentVersion=Dolibarr current version -CallUpdatePage=Browse to the page that updates the database structure and data: %s. -LastStableVersion=Latest stable version -LastActivationDate=Latest activation date -LastActivationAuthor=Latest activation author -LastActivationIP=Latest activation IP -UpdateServerOffline=Update server offline -WithCounter=Manage a counter -GenericMaskCodes=You may enter any numbering mask. In this mask, the following tags can be used:
    {000000} corresponds to a number which will be incremented on each %s. Enter as many zeros as the desired length of the counter. The counter will be completed by zeros from the left in order to have as many zeros as the mask.
    {000000+000} same as the previous one but an offset corresponding to the number to the right of the + sign is applied starting on the first %s.
    {000000@x} same as the previous one but the counter is reset to zero when month x is reached (x between 1 and 12, or 0 to use the early months of fiscal year defined in your configuration, or 99 to reset to zero every month). If this option is used and x is 2 or higher, then the sequence {yy}{mm} or {yyyy}{mm} is also required.
    {dd} day (01 to 31).
    {mm} month (01 to 12).
    {yy}, {yyyy} or {y} year over 2, 4 or 1 numbers.
    -GenericMaskCodes2={cccc} the client code on n characters
    {cccc000} the client code on n characters is followed by a counter dedicated to the customer. This counter dedicated to customer is reset at same time as the global counter.
    {tttt} The code of third party type on n characters (see menu Home - Setup - Dictionary - Types of third parties). If you add this tag, the counter will be different for each type of third party.
    -GenericMaskCodes3=All other characters in the mask will remain intact.
    Spaces are not allowed.
    -GenericMaskCodes3EAN=All other characters in the mask will remain intact (except * or ? in 13th position in EAN13).
    Spaces are not allowed.
    In EAN13, the last character after the last } in 13th position should be * or ? . It will be replaced by the calculated key.
    -GenericMaskCodes4a=Example on the 99th %s of the third party TheCompany, with date 2007-01-31:
    -GenericMaskCodes4b=Example on third party created on 2007-03-01:
    -GenericMaskCodes4c=Example on product created on 2007-03-01:
    -GenericMaskCodes5=ABC{yy}{mm}-{000000} will give ABC0701-000099
    {0000+100@1}-ZZZ/{dd}/XXX will give 0199-ZZZ/31/XXX
    IN{yy}{mm}-{0000}-{t} will give IN0701-0099-A if the type of company is 'Responsable Inscripto' with code for type that is 'A_RI' -GenericNumRefModelDesc=Returns a customizable number according to a defined mask. -ServerAvailableOnIPOrPort=Server is available at address %s on port %s -ServerNotAvailableOnIPOrPort=Server is not available at address %s on port %s -DoTestServerAvailability=Test server connectivity -DoTestSend=Test sending -DoTestSendHTML=Test sending HTML -ErrorCantUseRazIfNoYearInMask=Error, can't use option @ to reset counter each year if sequence {yy} or {yyyy} is not in mask. -ErrorCantUseRazInStartedYearIfNoYearMonthInMask=Error, can't use option @ if sequence {yy}{mm} or {yyyy}{mm} is not in mask. -UMask=UMask parameter for new files on Unix/Linux/BSD/Mac file system. -UMaskExplanation=This parameter allow you to define permissions set by default on files created by Dolibarr on server (during upload for example).
    It must be the octal value (for example, 0666 means read and write for everyone).
    This parameter is useless on a Windows server. -SeeWikiForAllTeam=Take a look at the Wiki page for a list of contributors and their organization -UseACacheDelay= Delay for caching export response in seconds (0 or empty for no cache) DisableLinkToHelpCenter=Hide link "Need help or support" on login page DisableLinkToHelp=Hide link to online help "%s" -AddCRIfTooLong=There is no automatic text wrapping, text that is too long will not display on documents. Please add carriage returns in the text area if needed. -ConfirmPurge=Are you sure you want to execute this purge?
    This will permanently delete all your data files with no way to restore them (ECM files, attached files...). -MinLength=Minimum length -LanguageFilesCachedIntoShmopSharedMemory=Files .lang loaded in shared memory -LanguageFile=Language file -ExamplesWithCurrentSetup=Examples with current configuration -ListOfDirectories=List of OpenDocument templates directories -ListOfDirectoriesForModelGenODT=List of directories containing templates files with OpenDocument format.

    Put here full path of directories.
    Add a carriage return between eah directory.
    To add a directory of the GED module, add here DOL_DATA_ROOT/ecm/yourdirectoryname.

    Files in those directories must end with .odt or .ods. -NumberOfModelFilesFound=Number of ODT/ODS template files found in these directories -ExampleOfDirectoriesForModelGen=Examples of syntax:
    c:\\myapp\\mydocumentdir\\mysubdir
    /home/myapp/mydocumentdir/mysubdir
    DOL_DATA_ROOT/ecm/ecmdir -FollowingSubstitutionKeysCanBeUsed=
    To know how to create your odt document templates, before storing them in those directories, read wiki documentation: -FullListOnOnlineDocumentation=http://wiki.dolibarr.org/index.php/Create_an_ODT_document_template -FirstnameNamePosition=Position of Name/Lastname -DescWeather=The following images will be shown on the dashboard when the number of late actions reach the following values: -KeyForWebServicesAccess=Key to use Web Services (parameter "dolibarrkey" in webservices) -TestSubmitForm=Input test form -ThisForceAlsoTheme=Using this menu manager will also use its own theme whatever the user choice. Also this menu manager specialized for smartphones does not work on all smartphone. Use another menu manager if you experience problems with yours. -ThemeDir=Skins directory -ConnectionTimeout=Connection timeout -ResponseTimeout=Response timeout -SmsTestMessage=Test message from __PHONEFROM__ to __PHONETO__ -ModuleMustBeEnabledFirst=Module %s must be enabled first if you need this feature. -SecurityToken=Key to secure URLs -NoSmsEngine=No SMS sender manager available. A SMS sender manager is not installed with the default distribution because they depend on an external vendor, but you can find some on %s -PDF=PDF -PDFDesc=Global options for PDF generation -PDFOtherDesc=PDF Option specific to some modules -PDFAddressForging=Rules for address section -HideAnyVATInformationOnPDF=Hide all information related to Sales Tax / VAT -PDFRulesForSalesTax=Rules for Sales Tax / VAT -PDFLocaltax=Rules for %s -HideLocalTaxOnPDF=Hide %s rate in column Sale Tax / VAT -HideDescOnPDF=Hide products description -HideRefOnPDF=Hide products ref. -HideDetailsOnPDF=Hide product lines details -PlaceCustomerAddressToIsoLocation=Use french standard position (La Poste) for customer address position -Library=Library -UrlGenerationParameters=Parameters to secure URLs -SecurityTokenIsUnique=Use a unique securekey parameter for each URL -EnterRefToBuildUrl=Enter reference for object %s -GetSecuredUrl=Get calculated URL -ButtonHideUnauthorized=Hide unauthorized action buttons also for internal users (just greyed otherwise) -OldVATRates=Old VAT rate -NewVATRates=New VAT rate -PriceBaseTypeToChange=Modify on prices with base reference value defined on -MassConvert=Launch bulk conversion -PriceFormatInCurrentLanguage=Price Format In Current Language -String=String -String1Line=String (1 line) -TextLong=Long text -TextLongNLines=Long text (n lines) -HtmlText=Html text -Int=Integer -Float=Float -DateAndTime=Date and hour -Unique=Unique -Boolean=Boolean (one checkbox) -ExtrafieldPhone = Phone -ExtrafieldPrice = Price -ExtrafieldMail = Email -ExtrafieldUrl = Url -ExtrafieldSelect = Select list -ExtrafieldSelectList = Select from table -ExtrafieldSeparator=Separator (not a field) -ExtrafieldPassword=Password -ExtrafieldRadio=Radio buttons (one choice only) -ExtrafieldCheckBox=Checkboxes -ExtrafieldCheckBoxFromList=Checkboxes from table -ExtrafieldLink=Link to an object -ComputedFormula=Computed field -ComputedFormulaDesc=You can enter here a formula using other properties of object or any PHP coding to get a dynamic computed value. You can use any PHP compatible formulas including the "?" condition operator, and following global object: $db, $conf, $langs, $mysoc, $user, $object.
    WARNING: Only some properties of $object may be available. If you need a properties not loaded, just fetch yourself the object into your formula like in the second example.
    Using a computed field means you can't enter yourself any value from interface. Also, if there is a syntax error, the formula may return nothing.

    Example of formula:
    $object->id < 10 ? round($object->id / 2, 2): ($object->id + 2 * $user->id) * (int) substr($mysoc->zip, 1, 2)

    Example to reload object
    (($reloadedobj = new Societe($db)) && ($reloadedobj->fetchNoCompute($obj->id ? $obj->id: ($obj->rowid ? $obj->rowid: $object->id)) > 0)) ? $reloadedobj->array_options['options_extrafieldkey'] * $reloadedobj->capital / 5: '-1'

    Other example of formula to force load of object and its parent object:
    (($reloadedobj = new Task($db)) && ($reloadedobj->fetchNoCompute($object->id) > 0) && ($secondloadedobj = new Project($db)) && ($secondloadedobj->fetchNoCompute($reloadedobj->fk_project) > 0)) ? $secondloadedobj->ref: 'Parent project not found' -Computedpersistent=Store computed field -ComputedpersistentDesc=Computed extra fields will be stored in the database, however, the value will only be recalculated when the object of this field is changed. If the computed field depends on other objects or global data this value might be wrong!! -ExtrafieldParamHelpPassword=Leaving this field blank means this value will be stored without encryption (field must be only hidden with star on screen).
    Set 'auto' to use the default encryption rule to save password into database (then value read will be the hash only, no way to retrieve original value) -ExtrafieldParamHelpselect=List of values must be lines with format key,value (where key can't be '0')

    for example:
    1,value1
    2,value2
    code3,value3
    ...

    In order to have the list depending on another complementary attribute list:
    1,value1|options_parent_list_code:parent_key
    2,value2|options_parent_list_code:parent_key

    In order to have the list depending on another list:
    1,value1|parent_list_code:parent_key
    2,value2|parent_list_code:parent_key -ExtrafieldParamHelpcheckbox=List of values must be lines with format key,value (where key can't be '0')

    for example:
    1,value1
    2,value2
    3,value3
    ... -ExtrafieldParamHelpradio=List of values must be lines with format key,value (where key can't be '0')

    for example:
    1,value1
    2,value2
    3,value3
    ... -ExtrafieldParamHelpsellist=List of values comes from a table
    Syntax: table_name:label_field:id_field::filtersql
    Example: c_typent:libelle:id::filtersql

    - id_field is necessarly a primary int key
    - filtersql is a SQL condition. It can be a simple test (eg active=1) to display only active value
    You can also use $ID$ in filter which is the current id of current object
    To use a SELECT into the filter use the keyword $SEL$ to bypass anti-injection protection.
    if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)

    In order to have the list depending on another complementary attribute list:
    c_typent:libelle:id:options_parent_list_code|parent_column:filter

    In order to have the list depending on another list:
    c_typent:libelle:id:parent_list_code|parent_column:filter -ExtrafieldParamHelpchkbxlst=List of values comes from a table
    Syntax: table_name:label_field:id_field::filtersql
    Example: c_typent:libelle:id::filtersql

    filter can be a simple test (eg active=1) to display only active value
    You can also use $ID$ in filter witch is the current id of current object
    To do a SELECT in filter use $SEL$
    if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)

    In order to have the list depending on another complementary attribute list:
    c_typent:libelle:id:options_parent_list_code|parent_column:filter

    In order to have the list depending on another list:
    c_typent:libelle:id:parent_list_code|parent_column:filter -ExtrafieldParamHelplink=Parameters must be ObjectName:Classpath
    Syntax: ObjectName:Classpath -ExtrafieldParamHelpSeparator=Keep empty for a simple separator
    Set this to 1 for a collapsing separator (open by default for new session, then status is kept for each user session)
    Set this to 2 for a collapsing separator (collapsed by default for new session, then status is kept fore each user session) -LibraryToBuildPDF=Library used for PDF generation -LocalTaxDesc=Some countries may apply two or three taxes on each invoice line. If this is the case, choose the type for the second and third tax and its rate. Possible type are:
    1: local tax apply on products and services without vat (localtax is calculated on amount without tax)
    2: local tax apply on products and services including vat (localtax is calculated on amount + main tax)
    3: local tax apply on products without vat (localtax is calculated on amount without tax)
    4: local tax apply on products including vat (localtax is calculated on amount + main vat)
    5: local tax apply on services without vat (localtax is calculated on amount without tax)
    6: local tax apply on services including vat (localtax is calculated on amount + tax) -SMS=SMS -LinkToTestClickToDial=Enter a phone number to call to show a link to test the ClickToDial url for user %s -RefreshPhoneLink=Refresh link -LinkToTest=Clickable link generated for user %s (click phone number to test) -KeepEmptyToUseDefault=Keep empty to use default value -KeepThisEmptyInMostCases=In most cases, you can keep this field empy. -DefaultLink=Default link -SetAsDefault=Set as default -ValueOverwrittenByUserSetup=Warning, this value may be overwritten by user specific setup (each user can set his own clicktodial url) -ExternalModule=External module -InstalledInto=Installed into directory %s -BarcodeInitForThirdparties=Mass barcode init for third-parties -BarcodeInitForProductsOrServices=Mass barcode init or reset for products or services -CurrentlyNWithoutBarCode=Currently, you have %s record on %s %s without barcode defined. -InitEmptyBarCode=Init value for next %s empty records -EraseAllCurrentBarCode=Erase all current barcode values -ConfirmEraseAllCurrentBarCode=Are you sure you want to erase all current barcode values? -AllBarcodeReset=All barcode values have been removed -NoBarcodeNumberingTemplateDefined=No numbering barcode template enabled in the Barcode module setup. -EnableFileCache=Enable file cache -ShowDetailsInPDFPageFoot=Add more details into footer, such as company address or manager names (in addition to professional ids, company capital and VAT number). -NoDetails=No additional details in footer -DisplayCompanyInfo=Display company address -DisplayCompanyManagers=Display manager names -DisplayCompanyInfoAndManagers=Display company address and manager names -EnableAndSetupModuleCron=If you want to have this recurring invoice generated automatically, module *%s* must be enabled and correctly setup. Otherwise, generation of invoices must be done manually from this template using the *Create* button. Note that even if you enabled automatic generation, you can still safely launch manual generation. Generation of duplicates for the same period is not possible. -ModuleCompanyCodeCustomerAquarium=%s followed by customer code for a customer accounting code -ModuleCompanyCodeSupplierAquarium=%s followed by vendor code for a vendor accounting code -ModuleCompanyCodePanicum=Return an empty accounting code. -ModuleCompanyCodeDigitaria=Returns a compound accounting code according to the name of the third party. The code consists of a prefix that can be defined in the first position followed by the number of characters defined in the third party code. -ModuleCompanyCodeCustomerDigitaria=%s followed by the truncated customer name by the number of characters: %s for the customer accounting code. -ModuleCompanyCodeSupplierDigitaria=%s followed by the truncated supplier name by the number of characters: %s for the supplier accounting code. -Use3StepsApproval=By default, Purchase Orders need to be created and approved by 2 different users (one step/user to create and one step/user to approve. Note that if user has both permission to create and approve, one step/user will be enough). You can ask with this option to introduce a third step/user approval, if amount is higher than a dedicated value (so 3 steps will be necessary: 1=validation, 2=first approval and 3=second approval if amount is enough).
    Set this to empty if one approval (2 steps) is enough, set it to a very low value (0.1) if a second approval (3 steps) is always required. -UseDoubleApproval=Use a 3 steps approval when amount (without tax) is higher than... -WarningPHPMail=WARNING: The setup to send emails from the application is using the default generic setup. It is often better to setup outgoing emails to use the email server of your Email Service Provider instead of the default setup for several reasons: -WarningPHPMailA=- Using the server of the Email Service Provider increases the trustability of your email, so it increases the deliverablity without being flagged as SPAM -WarningPHPMailB=- Some Email Service Providers (like Yahoo) do not allow you to send an email from another server than their own server. Your current setup uses the server of the application to send email and not the server of your email provider, so some recipients (the one compatible with the restrictive DMARC protocol), will ask your email provider if they can accept your email and some email providers (like Yahoo) may respond "no" because the server is not theirs, so few of your sent Emails may not be accepted for delivery (be careful also of your email provider's sending quota). -WarningPHPMailC=- Using the SMTP server of your own Email Service Provider to send emails is also interesting so all emails sent from application will also be saved into your "Sent" directory of your mailbox. -WarningPHPMailD=If the method 'PHP Mail' is really the method you would like to use, you can remove this warning by adding the constant MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP to 1 in Home - Setup - Other. -WarningPHPMail2=If your email SMTP provider need to restrict email client to some IP addresses (very rare), this is the IP address of the mail user agent (MUA) for your ERP CRM application: %s. -WarningPHPMailSPF=If the domain name in your sender email address is protected by a SPF record (ask you domain name registar), you must add the following IPs in the SPF record of the DNS of your domain: %s. -ClickToShowDescription=Click to show description -DependsOn=This module needs the module(s) -RequiredBy=This module is required by module(s) -TheKeyIsTheNameOfHtmlField=This is the name of the HTML field. Technical knowledge is required to read the content of the HTML page to get the key name of a field. -PageUrlForDefaultValues=You must enter the relative path of the page URL. If you include parameters in URL, the default values will be effective if all parameters are set to same value. -PageUrlForDefaultValuesCreate=
    Example:
    For the form to create a new third party, it is %s.
    For URL of external modules installed into custom directory, do not include the "custom/", so use path like mymodule/mypage.php and not custom/mymodule/mypage.php.
    If you want default value only if url has some parameter, you can use %s -PageUrlForDefaultValuesList=
    Example:
    For the page that lists third parties, it is %s.
    For URL of external modules installed into custom directory, do not include the "custom/" so use a path like mymodule/mypagelist.php and not custom/mymodule/mypagelist.php.
    If you want default value only if url has some parameter, you can use %s -AlsoDefaultValuesAreEffectiveForActionCreate=Also note that overwritting default values for form creation works only for pages that were correctly designed (so with parameter action=create or presend...) -EnableDefaultValues=Enable customization of default values -EnableOverwriteTranslation=Enable usage of overwritten translation -GoIntoTranslationMenuToChangeThis=A translation has been found for the key with this code. To change this value, you must edit it from Home-Setup-translation. -WarningSettingSortOrder=Warning, setting a default sort order may result in a technical error when going on the list page if field is an unknown field. If you experience such an error, come back to this page to remove the default sort order and restore default behavior. -Field=Field -ProductDocumentTemplates=Document templates to generate product document -FreeLegalTextOnExpenseReports=Free legal text on expense reports -WatermarkOnDraftExpenseReports=Watermark on draft expense reports -AttachMainDocByDefault=Set this to 1 if you want to attach main document to email by default (if applicable) -FilesAttachedToEmail=Attach file -SendEmailsReminders=Send agenda reminders by emails -davDescription=Setup a WebDAV server -DAVSetup=Setup of module DAV -DAV_ALLOW_PRIVATE_DIR=Enable the generic private directory (WebDAV dedicated directory named "private" - login required) -DAV_ALLOW_PRIVATE_DIRTooltip=The generic private directory is a WebDAV directory anybody can access with its application login/pass. -DAV_ALLOW_PUBLIC_DIR=Enable the generic public directory (WebDAV dedicated directory named "public" - no login required) -DAV_ALLOW_PUBLIC_DIRTooltip=The generic public directory is a WebDAV directory anybody can access (in read and write mode), with no authorization required (login/password account). -DAV_ALLOW_ECM_DIR=Enable the DMS/ECM private directory (root directory of the DMS/ECM module - login required) -DAV_ALLOW_ECM_DIRTooltip=The root directory where all files are manually uploaded when using the DMS/ECM module. Similarly as access from the web interface, you will need a valid login/password with adecuate permissions to access it. -# Modules -Module0Name=Users & Groups -Module0Desc=Users / Employees and Groups management -Module1Name=Third Parties -Module1Desc=Companies and contacts management (customers, prospects...) -Module2Name=Commercial -Module2Desc=Commercial management -Module10Name=Accounting (simplified) -Module10Desc=Simple accounting reports (journals, turnover) based on database content. Does not use any ledger table. -Module20Name=Proposals -Module20Desc=Commercial proposal management -Module22Name=Mass Emailings -Module22Desc=Manage bulk emailing -Module23Name=Energy -Module23Desc=Monitoring the consumption of energies -Module25Name=Sales Orders -Module25Desc=Sales order management -Module30Name=Invoices -Module30Desc=Management of invoices and credit notes for customers. Management of invoices and credit notes for suppliers -Module40Name=Vendors -Module40Desc=Vendors and purchase management (purchase orders and billing of supplier invoices) -Module42Name=Debug Logs -Module42Desc=Logging facilities (file, syslog, ...). Such logs are for technical/debug purposes. -Module43Name=Debug Bar -Module43Desc=A tool for developper adding a debug bar in your browser. -Module49Name=Editors -Module49Desc=Editor management -Module50Name=Products -Module50Desc=Management of Products -Module51Name=Mass mailings -Module51Desc=Mass paper mailing management -Module52Name=Stocks -Module52Desc=Stock management -Module53Name=Services -Module53Desc=Management of Services -Module54Name=Contracts/Subscriptions -Module54Desc=Management of contracts (services or recurring subscriptions) -Module55Name=Barcodes -Module55Desc=Barcode or QR code management -Module56Name=Payment by credit transfer -Module56Desc=Management of payment of suppliers by Credit Transfer orders. It includes generation of SEPA file for European countries. -Module57Name=Payments by Direct Debit -Module57Desc=Management of Direct Debit orders. It includes generation of SEPA file for European countries. -Module58Name=ClickToDial -Module58Desc=Integration of a ClickToDial system (Asterisk, ...) -Module60Name=Stickers -Module60Desc=Management of stickers -Module70Name=Interventions -Module70Desc=Intervention management -Module75Name=Expense and trip notes -Module75Desc=Expense and trip notes management -Module80Name=Shipments -Module80Desc=Shipments and delivery note management -Module85Name=Banks & Cash -Module85Desc=Management of bank or cash accounts -Module100Name=External Site -Module100Desc=Add a link to an external website as a main menu icon. Website is shown in a frame under the top menu. -Module105Name=Mailman and SPIP -Module105Desc=Mailman or SPIP interface for member module -Module200Name=LDAP -Module200Desc=LDAP directory synchronization -Module210Name=PostNuke -Module210Desc=PostNuke integration -Module240Name=Data exports -Module240Desc=Tool to export Dolibarr data (with assistance) -Module250Name=Data imports -Module250Desc=Tool to import data into Dolibarr (with assistance) -Module310Name=Members -Module310Desc=Foundation members management -Module320Name=RSS Feed -Module320Desc=Add a RSS feed to Dolibarr pages -Module330Name=Bookmarks & Shortcuts -Module330Desc=Create shortcuts, always accessible, to the internal or external pages to which you frequently access -Module400Name=Projects or Leads -Module400Desc=Management of projects, leads/opportunities and/or tasks. You can also assign any element (invoice, order, proposal, intervention, ...) to a project and get a transversal view from the project view. -Module410Name=Webcalendar -Module410Desc=Webcalendar integration -Module500Name=Taxes & Special Expenses -Module500Desc=Management of other expenses (sale taxes, social or fiscal taxes, dividends, ...) -Module510Name=Salaries -Module510Desc=Record and track employee payments -Module520Name=Loans -Module520Desc=Management of loans -Module600Name=Notifications on business event -Module600Desc=Send email notifications triggered by a business event: per user (setup defined on each user), per third-party contacts (setup defined on each third party) or by specific emails -Module600Long=Note that this module sends emails in real-time when a specific business event occurs. If you are looking for a feature to send email reminders for agenda events, go into the setup of module Agenda. -Module610Name=Product Variants -Module610Desc=Creation of product variants (color, size etc.) -Module700Name=Donations -Module700Desc=Donation management -Module770Name=Expense Reports -Module770Desc=Manage expense reports claims (transportation, meal, ...) -Module1120Name=Vendor Commercial Proposals -Module1120Desc=Request vendor commercial proposal and prices -Module1200Name=Mantis -Module1200Desc=Mantis integration -Module1520Name=Document Generation -Module1520Desc=Mass email document generation -Module1780Name=Tags/Categories -Module1780Desc=Create tags/category (products, customers, suppliers, contacts or members) -Module2000Name=WYSIWYG editor -Module2000Desc=Allow text fields to be edited/formatted using CKEditor (html) -Module2200Name=Dynamic Prices -Module2200Desc=Use maths expressions for auto-generation of prices -Module2300Name=Scheduled jobs -Module2300Desc=Scheduled jobs management (alias cron or chrono table) -Module2400Name=Events/Agenda -Module2400Desc=Track events. Log automatic events for tracking purposes or record manual events or meetings. This is the principal module for good Customer or Vendor Relationship Management. -Module2500Name=DMS / ECM -Module2500Desc=Document Management System / Electronic Content Management. Automatic organization of your generated or stored documents. Share them when you need. -Module2600Name=API/Web services (SOAP server) -Module2600Desc=Enable the Dolibarr SOAP server providing API services -Module2610Name=API/Web services (REST server) -Module2610Desc=Enable the Dolibarr REST server providing API services -Module2660Name=Call WebServices (SOAP client) -Module2660Desc=Enable the Dolibarr web services client (Can be used to push data/requests to external servers. Only Purchase orders are currently supported.) -Module2700Name=Gravatar -Module2700Desc=Use online Gravatar service (www.gravatar.com) to show photo of users/members (found with their emails). Needs Internet access -Module2800Desc=FTP Client -Module2900Name=GeoIPMaxmind -Module2900Desc=GeoIP Maxmind conversions capabilities -Module3200Name=Unalterable Archives -Module3200Desc=Enable an unalterable log of business events. Events are archived in real-time. The log is a read-only table of chained events that can be exported. This module may be mandatory for some countries. -Module3400Name=Social Networks -Module3400Desc=Enable Social Networks fields into third parties and addresses (skype, twitter, facebook, ...). -Module4000Name=HRM -Module4000Desc=Human resources management (management of department, employee contracts and feelings) -Module5000Name=Multi-company -Module5000Desc=Allows you to manage multiple companies -Module6000Name=Inter-modules Workflow -Module6000Desc=Workflow management between different modules (automatic creation of object and/or automatic status change) -Module10000Name=Websites -Module10000Desc=Create websites (public) with a WYSIWYG editor. This is a webmaster or developer oriented CMS (it is better to know HTML and CSS language). Just setup your web server (Apache, Nginx, ...) to point to the dedicated Dolibarr directory to have it online on the internet with your own domain name. -Module20000Name=Leave Request Management -Module20000Desc=Define and track employee leave requests -Module39000Name=Product Lots -Module39000Desc=Lots, serial numbers, eat-by/sell-by date management for products -Module40000Name=Multicurrency -Module40000Desc=Use alternative currencies in prices and documents -Module50000Name=PayBox -Module50000Desc=Offer customers a PayBox online payment page (credit/debit cards). This can be used to allow your customers to make ad-hoc payments or payments related to a specific Dolibarr object (invoice, order etc...) -Module50100Name=POS SimplePOS -Module50100Desc=Point of Sale module SimplePOS (simple POS). -Module50150Name=POS TakePOS -Module50150Desc=Point of Sale module TakePOS (touchscreen POS, for shops, bars or restaurants). -Module50200Name=Paypal -Module50200Desc=Offer customers a PayPal online payment page (PayPal account or credit/debit cards). This can be used to allow your customers to make ad-hoc payments or payments related to a specific Dolibarr object (invoice, order etc...) -Module50300Name=Stripe -Module50300Desc=Offer customers a Stripe online payment page (credit/debit cards). This can be used to allow your customers to make ad-hoc payments or payments related to a specific Dolibarr object (invoice, order etc...) -Module50400Name=Accounting (double entry) -Module50400Desc=Accounting management (double entries, support General and Subsidiary Ledgers). Export the ledger in several other accounting software formats. -Module54000Name=PrintIPP -Module54000Desc=Direct print (without opening the documents) using Cups IPP interface (Printer must be visible from server, and CUPS must be installed on server). -Module55000Name=Poll, Survey or Vote -Module55000Desc=Create online polls, surveys or votes (like Doodle, Studs, RDVz etc...) -Module59000Name=Margins -Module59000Desc=Module to follow margins -Module60000Name=Commissions -Module60000Desc=Module to manage commissions -Module62000Name=Incoterms -Module62000Desc=Add features to manage Incoterms -Module63000Name=Resources -Module63000Desc=Manage resources (printers, cars, rooms, ...) for allocating to events -Permission11=Read customer invoices -Permission12=Create/modify customer invoices -Permission13=Invalidate customer invoices -Permission14=Validate customer invoices -Permission15=Send customer invoices by email -Permission16=Create payments for customer invoices -Permission19=Delete customer invoices -Permission21=Read commercial proposals -Permission22=Create/modify commercial proposals -Permission24=Validate commercial proposals -Permission25=Send commercial proposals -Permission26=Close commercial proposals -Permission27=Delete commercial proposals -Permission28=Export commercial proposals -Permission31=Read products -Permission32=Create/modify products -Permission34=Delete products -Permission36=See/manage hidden products -Permission38=Export products -Permission39=Ignore minimum price -Permission41=Read projects and tasks (shared project and projects I'm contact for). Can also enter time consumed, for me or my hierarchy, on assigned tasks (Timesheet) -Permission42=Create/modify projects (shared project and projects I'm contact for). Can also create tasks and assign users to project and tasks -Permission44=Delete projects (shared project and projects I'm contact for) -Permission45=Export projects -Permission61=Read interventions -Permission62=Create/modify interventions -Permission64=Delete interventions -Permission67=Export interventions -Permission68=Send interventions by email -Permission69=Validate interventions -Permission70=Invalidate interventions -Permission71=Read members -Permission72=Create/modify members -Permission74=Delete members -Permission75=Setup types of membership -Permission76=Export data -Permission78=Read subscriptions -Permission79=Create/modify subscriptions -Permission81=Read customers orders -Permission82=Create/modify customers orders -Permission84=Validate customers orders -Permission86=Send customers orders -Permission87=Close customers orders -Permission88=Cancel customers orders -Permission89=Delete customers orders -Permission91=Read social or fiscal taxes and vat -Permission92=Create/modify social or fiscal taxes and vat -Permission93=Delete social or fiscal taxes and vat -Permission94=Export social or fiscal taxes -Permission95=Read reports -Permission101=Read sendings -Permission102=Create/modify sendings -Permission104=Validate sendings -Permission105=Send sendings by email -Permission106=Export sendings -Permission109=Delete sendings -Permission111=Read financial accounts -Permission112=Create/modify/delete and compare transactions -Permission113=Setup financial accounts (create, manage categories) -Permission114=Reconcile transactions -Permission115=Export transactions and account statements -Permission116=Transfers between accounts -Permission117=Manage checks dispatching -Permission121=Read third parties linked to user -Permission122=Create/modify third parties linked to user -Permission125=Delete third parties linked to user -Permission126=Export third parties -Permission141=Read all projects and tasks (also private projects for which I am not a contact) -Permission142=Create/modify all projects and tasks (also private projects for which I am not a contact) -Permission144=Delete all projects and tasks (also private projects i am not contact for) -Permission146=Read providers -Permission147=Read stats -Permission151=Read direct debit payment orders -Permission152=Create/modify a direct debit payment orders -Permission153=Send/Transmit direct debit payment orders -Permission154=Record Credits/Rejections of direct debit payment orders -Permission161=Read contracts/subscriptions -Permission162=Create/modify contracts/subscriptions -Permission163=Activate a service/subscription of a contract -Permission164=Disable a service/subscription of a contract -Permission165=Delete contracts/subscriptions -Permission167=Export contracts -Permission171=Read trips and expenses (yours and your subordinates) -Permission172=Create/modify trips and expenses -Permission173=Delete trips and expenses -Permission174=Read all trips and expenses -Permission178=Export trips and expenses -Permission180=Read suppliers -Permission181=Read purchase orders -Permission182=Create/modify purchase orders -Permission183=Validate purchase orders -Permission184=Approve purchase orders -Permission185=Order or cancel purchase orders -Permission186=Receive purchase orders -Permission187=Close purchase orders -Permission188=Cancel purchase orders -Permission192=Create lines -Permission193=Cancel lines -Permission194=Read the bandwidth lines -Permission202=Create ADSL connections -Permission203=Order connections orders -Permission204=Order connections -Permission205=Manage connections -Permission206=Read connections -Permission211=Read Telephony -Permission212=Order lines -Permission213=Activate line -Permission214=Setup Telephony -Permission215=Setup providers -Permission221=Read emailings -Permission222=Create/modify emailings (topic, recipients...) -Permission223=Validate emailings (allows sending) -Permission229=Delete emailings -Permission237=View recipients and info -Permission238=Manually send mailings -Permission239=Delete mailings after validation or sent -Permission241=Read categories -Permission242=Create/modify categories -Permission243=Delete categories -Permission244=See the contents of the hidden categories -Permission251=Read other users and groups -PermissionAdvanced251=Read other users -Permission252=Read permissions of other users -Permission253=Create/modify other users, groups and permissions -PermissionAdvanced253=Create/modify internal/external users and permissions -Permission254=Create/modify external users only -Permission255=Modify other users password -Permission256=Delete or disable other users -Permission262=Extend access to all third parties AND their objects (not only third parties for which the user is a sale representative).
    Not effective for external users (always limited to themselves for proposals, orders, invoices, contracts, etc.).
    Not effective for projects (only rules on project permissions, visibility and assignment matters). -Permission263=Extend access to all third parties WITHOUT their objects (not only third parties for which the user is a sale representative).
    Not effective for external users (always limited to themselves for proposals, orders, invoices, contracts, etc.).
    Not effective for projects (only rules on project permissions, visibility and assignment matters). -Permission271=Read CA -Permission272=Read invoices -Permission273=Issue invoices -Permission281=Read contacts -Permission282=Create/modify contacts -Permission283=Delete contacts -Permission286=Export contacts -Permission291=Read tariffs -Permission292=Set permissions on the tariffs -Permission293=Modify customer's tariffs -Permission300=Read barcodes -Permission301=Create/modify barcodes -Permission302=Delete barcodes -Permission311=Read services -Permission312=Assign service/subscription to contract -Permission331=Read bookmarks -Permission332=Create/modify bookmarks -Permission333=Delete bookmarks -Permission341=Read its own permissions -Permission342=Create/modify his own user information -Permission343=Modify his own password -Permission344=Modify its own permissions -Permission351=Read groups -Permission352=Read groups permissions -Permission353=Create/modify groups -Permission354=Delete or disable groups -Permission358=Export users -Permission401=Read discounts -Permission402=Create/modify discounts -Permission403=Validate discounts -Permission404=Delete discounts -Permission430=Use Debug Bar -Permission511=Read salaries and payments (yours and subordinates) -Permission512=Create/modify salaries and payments -Permission514=Delete salaries and payments -Permission517=Read salaries and payments everybody -Permission519=Export salaries -Permission520=Read Loans -Permission522=Create/modify loans -Permission524=Delete loans -Permission525=Access loan calculator -Permission527=Export loans -Permission531=Read services -Permission532=Create/modify services -Permission534=Delete services -Permission536=See/manage hidden services -Permission538=Export services -Permission561=Read payment orders by credit transfer -Permission562=Create/modify payment order by credit transfer -Permission563=Send/Transmit payment order by credit transfer -Permission564=Record Debits/Rejections of credit transfer -Permission601=Read stickers -Permission602=Create/modify stickers -Permission609=Delete stickers -Permission650=Read Bills of Materials -Permission651=Create/Update Bills of Materials -Permission652=Delete Bills of Materials -Permission660=Read Manufacturing Order (MO) -Permission661=Create/Update Manufacturing Order (MO) -Permission662=Delete Manufacturing Order (MO) -Permission701=Read donations -Permission702=Create/modify donations -Permission703=Delete donations -Permission771=Read expense reports (yours and your subordinates) -Permission772=Create/modify expense reports -Permission773=Delete expense reports -Permission774=Read all expense reports (even for user not subordinates) -Permission775=Approve expense reports -Permission776=Pay expense reports -Permission777=Read expense reports of everybody -Permission778=Create/modify expense reports of everybody -Permission779=Export expense reports -Permission1001=Read stocks -Permission1002=Create/modify warehouses -Permission1003=Delete warehouses -Permission1004=Read stock movements -Permission1005=Create/modify stock movements -Permission1101=Read delivery receipts -Permission1102=Create/modify delivery receipts -Permission1104=Validate delivery receipts -Permission1109=Delete delivery receipts -Permission1121=Read supplier proposals -Permission1122=Create/modify supplier proposals -Permission1123=Validate supplier proposals -Permission1124=Send supplier proposals -Permission1125=Delete supplier proposals -Permission1126=Close supplier price requests -Permission1181=Read suppliers -Permission1182=Read purchase orders -Permission1183=Create/modify purchase orders -Permission1184=Validate purchase orders -Permission1185=Approve purchase orders -Permission1186=Order purchase orders -Permission1187=Acknowledge receipt of purchase orders -Permission1188=Delete purchase orders -Permission1189=Check/Uncheck a purchase order reception -Permission1190=Approve (second approval) purchase orders -Permission1191=Export supplier orders and their attributes -Permission1201=Get result of an export -Permission1202=Create/Modify an export -Permission1231=Read vendor invoices -Permission1232=Create/modify vendor invoices -Permission1233=Validate vendor invoices -Permission1234=Delete vendor invoices -Permission1235=Send vendor invoices by email -Permission1236=Export vendor invoices, attributes and payments -Permission1237=Export purchase orders and their details -Permission1251=Run mass imports of external data into database (data load) -Permission1321=Export customer invoices, attributes and payments -Permission1322=Reopen a paid bill -Permission1421=Export sales orders and attributes -Permission1521=Read documents -Permission1522=Delete documents -Permission2401=Read actions (events or tasks) linked to his user account (if owner of event or just assigned to) -Permission2402=Create/modify actions (events or tasks) linked to his user account (if owner of event) -Permission2403=Delete actions (events or tasks) linked to his user account (if owner of event) -Permission2411=Read actions (events or tasks) of others -Permission2412=Create/modify actions (events or tasks) of others -Permission2413=Delete actions (events or tasks) of others -Permission2414=Export actions/tasks of others -Permission2501=Read/Download documents -Permission2502=Download documents -Permission2503=Submit or delete documents -Permission2515=Setup documents directories -Permission2801=Use FTP client in read mode (browse and download only) -Permission2802=Use FTP client in write mode (delete or upload files) -Permission3200=Read archived events and fingerprints -Permission3301=Generate new modules -Permission4001=See employees -Permission4002=Create employees -Permission4003=Delete employees -Permission4004=Export employees -Permission10001=Read website content -Permission10002=Create/modify website content (html and javascript content) -Permission10003=Create/modify website content (dynamic php code). Dangerous, must be reserved to restricted developers. -Permission10005=Delete website content -Permission20001=Read leave requests (your leave and those of your subordinates) -Permission20002=Create/modify your leave requests (your leave and those of your subordinates) -Permission20003=Delete leave requests -Permission20004=Read all leave requests (even of user not subordinates) -Permission20005=Create/modify leave requests for everybody (even of user not subordinates) -Permission20006=Admin leave requests (setup and update balance) -Permission20007=Approve leave requests -Permission23001=Read Scheduled job -Permission23002=Create/update Scheduled job -Permission23003=Delete Scheduled job -Permission23004=Execute Scheduled job -Permission50101=Use Point of Sale (SimplePOS) -Permission50151=Use Point of Sale (TakePOS) -Permission50152=Edit sales lines -Permission50153=Edit ordered sales lines -Permission50201=Read transactions -Permission50202=Import transactions -Permission50330=Read objects of Zapier -Permission50331=Create/Update objects of Zapier -Permission50332=Delete objects of Zapier -Permission50401=Bind products and invoices with accounting accounts -Permission50411=Read operations in ledger -Permission50412=Write/Edit operations in ledger -Permission50414=Delete operations in ledger -Permission50415=Delete all operations by year and journal in ledger -Permission50418=Export operations of the ledger -Permission50420=Report and export reports (turnover, balance, journals, ledger) -Permission50430=Define fiscal periods. Validate transactions and close fiscal periods. -Permission50440=Manage chart of accounts, setup of accountancy -Permission51001=Read assets -Permission51002=Create/Update assets -Permission51003=Delete assets -Permission51005=Setup types of asset -Permission54001=Print -Permission55001=Read polls -Permission55002=Create/modify polls -Permission59001=Read commercial margins -Permission59002=Define commercial margins -Permission59003=Read every user margin -Permission63001=Read resources -Permission63002=Create/modify resources -Permission63003=Delete resources -Permission63004=Link resources to agenda events -Permission64001=Allow direct printing -Permission67000=Allow printing of receipts -Permission68001=Read intracomm report -Permission68002=Create/modify intracomm report -Permission68004=Delete intracomm report -Permission941601=Read receipts -Permission941602=Create and modify receipts -Permission941603=Validate receipts -Permission941604=Send receipts by email -Permission941605=Export receipts -Permission941606=Delete receipts -DictionaryCompanyType=Third-party types -DictionaryCompanyJuridicalType=Third-party legal entities -DictionaryProspectLevel=Prospect potential level for companies -DictionaryProspectContactLevel=Prospect potential level for contacts -DictionaryCanton=States/Provinces -DictionaryRegion=Regions -DictionaryCountry=Countries -DictionaryCurrency=Currencies -DictionaryCivility=Honorific titles -DictionaryActions=Types of agenda events -DictionarySocialContributions=Types of social or fiscal taxes -DictionaryVAT=VAT Rates or Sales Tax Rates -DictionaryRevenueStamp=Amount of tax stamps -DictionaryPaymentConditions=Payment Terms -DictionaryPaymentModes=Payment Modes -DictionaryTypeContact=Contact/Address types -DictionaryTypeOfContainer=Website - Type of website pages/containers -DictionaryEcotaxe=Ecotax (WEEE) -DictionaryPaperFormat=Paper formats -DictionaryFormatCards=Card formats -DictionaryFees=Expense report - Types of expense report lines -DictionarySendingMethods=Shipping methods -DictionaryStaff=Number of Employees -DictionaryAvailability=Delivery delay DictionaryOrderMethods=Ordering methods -DictionarySource=Origin of proposals/orders -DictionaryAccountancyCategory=Personalized groups for reports -DictionaryAccountancysystem=Models for chart of accounts -DictionaryAccountancyJournal=Accounting journals -DictionaryEMailTemplates=Email Templates -DictionaryUnits=Units -DictionaryMeasuringUnits=Measuring Units -DictionarySocialNetworks=Social Networks -DictionaryProspectStatus=Prospect status for companies -DictionaryProspectContactStatus=Prospect status for contacts -DictionaryHolidayTypes=Leave - Types of leave -DictionaryOpportunityStatus=Lead status for project/lead -DictionaryExpenseTaxCat=Expense report - Transportation categories -DictionaryExpenseTaxRange=Expense report - Range by transportation category -DictionaryTransportMode=Intracomm report - Transport mode -DictionaryBatchStatus=Product lot/serial Quality Control status -TypeOfUnit=Type of unit -SetupSaved=Setup saved -SetupNotSaved=Setup not saved -BackToModuleList=Back to Module list -BackToDictionaryList=Back to Dictionaries list -TypeOfRevenueStamp=Type of tax stamp -VATManagement=Sales Tax Management -VATIsUsedDesc=By default when creating prospects, invoices, orders etc. the Sales Tax rate follows the active standard rule:
    If the seller is not subject to Sales tax, then Sales tax defaults to 0. End of rule.
    If the (seller's country = buyer's country), then the Sales tax by default equals the Sales tax of the product in the seller's country. End of rule.
    If the seller and buyer are both in the European Community and goods are transport-related products (haulage, shipping, airline), the default VAT is 0. This rule is dependant on the seller's country - please consult with your accountant. The VAT should be paid by the buyer to the customs office in their country and not to the seller. End of rule.
    If the seller and buyer are both in the European Community and the buyer is not a company (with a registered intra-Community VAT number) then the VAT defaults to the VAT rate of the seller's country. End of rule.
    If the seller and buyer are both in the European Community and the buyer is a company (with a registered intra-Community VAT number), then the VAT is 0 by default. End of rule.
    In any other case the proposed default is Sales tax=0. End of rule. -VATIsNotUsedDesc=By default the proposed Sales tax is 0 which can be used for cases like associations, individuals or small companies. -VATIsUsedExampleFR=In France, it means companies or organizations having a real fiscal system (Simplified real or normal real). A system in which VAT is declared. -VATIsNotUsedExampleFR=In France, it means associations that are non Sales tax declared or companies, organizations or liberal professions that have chosen the micro enterprise fiscal system (Sales tax in franchise) and paid a franchise Sales tax without any Sales tax declaration. This choice will display the reference "Non applicable Sales tax - art-293B of CGI" on invoices. -##### Local Taxes ##### -TypeOfSaleTaxes=Type of sales tax -LTRate=Rate -LocalTax1IsNotUsed=Do not use second tax -LocalTax1IsUsedDesc=Use a second type of tax (other than first one) -LocalTax1IsNotUsedDesc=Do not use other type of tax (other than first one) -LocalTax1Management=Second type of tax -LocalTax1IsUsedExample= -LocalTax1IsNotUsedExample= -LocalTax2IsNotUsed=Do not use third tax -LocalTax2IsUsedDesc=Use a third type of tax (other than first one) -LocalTax2IsNotUsedDesc=Do not use other type of tax (other than first one) -LocalTax2Management=Third type of tax -LocalTax2IsUsedExample= -LocalTax2IsNotUsedExample= -LocalTax1ManagementES=RE Management -LocalTax1IsUsedDescES=The RE rate by default when creating prospects, invoices, orders etc. follow the active standard rule:
    If the buyer is not subjected to RE, RE by default=0. End of rule.
    If the buyer is subjected to RE then the RE by default. End of rule.
    -LocalTax1IsNotUsedDescES=By default the proposed RE is 0. End of rule. -LocalTax1IsUsedExampleES=In Spain they are professionals subject to some specific sections of the Spanish IAE. -LocalTax1IsNotUsedExampleES=In Spain they are professional and societies and subject to certain sections of the Spanish IAE. -LocalTax2ManagementES=IRPF Management -LocalTax2IsUsedDescES=The IRPF rate by default when creating prospects, invoices, orders etc. follow the active standard rule:
    If the seller is not subjected to IRPF, then IRPF by default=0. End of rule.
    If the seller is subjected to IRPF then the IRPF by default. End of rule.
    -LocalTax2IsNotUsedDescES=By default the proposed IRPF is 0. End of rule. -LocalTax2IsUsedExampleES=In Spain, freelancers and independent professionals who provide services and companies who have chosen the tax system of modules. -LocalTax2IsNotUsedExampleES=In Spain they are businesses not subject to tax system of modules. -RevenueStampDesc=The "tax stamp" or "revenue stamp" is a fixed tax you per invoice (It does not depend on amount of invoice). It can also be a percent tax but using the second or third type of tax is better for percent taxes as tax stamps does not provide any reporting. Only few countries uses this type of tax. -UseRevenueStamp=Use a tax stamp -UseRevenueStampExample=The value of tax stamp is defined by default into the setup of dictionaries (%s - %s - %s) -CalcLocaltax=Reports on local taxes -CalcLocaltax1=Sales - Purchases -CalcLocaltax1Desc=Local Taxes reports are calculated with the difference between localtaxes sales and localtaxes purchases -CalcLocaltax2=Purchases -CalcLocaltax2Desc=Local Taxes reports are the total of localtaxes purchases -CalcLocaltax3=Sales -CalcLocaltax3Desc=Local Taxes reports are the total of localtaxes sales -NoLocalTaxXForThisCountry=According to the setup of taxes (See %s - %s - %s), your country does not need to use such type of tax -LabelUsedByDefault=Label used by default if no translation can be found for code -LabelOnDocuments=Label on documents -LabelOrTranslationKey=Label or translation key -ValueOfConstantKey=Value of a configuration constant -ConstantIsOn=Option %s is on -NbOfDays=No. of days -AtEndOfMonth=At end of month -CurrentNext=Current/Next -Offset=Offset -AlwaysActive=Always active -Upgrade=Upgrade -MenuUpgrade=Upgrade / Extend -AddExtensionThemeModuleOrOther=Deploy/install external app/module -WebServer=Web server -DocumentRootServer=Web server's root directory -DataRootServer=Data files directory -IP=IP -Port=Port -VirtualServerName=Virtual server name -OS=OS -PhpWebLink=Web-Php link -Server=Server -Database=Database -DatabaseServer=Database host -DatabaseName=Database name -DatabasePort=Database port -DatabaseUser=Database user -DatabasePassword=Database password -Tables=Tables -TableName=Table name -NbOfRecord=No. of records -Host=Server -DriverType=Driver type -SummarySystem=System information summary -SummaryConst=List of all Dolibarr setup parameters -MenuCompanySetup=Company/Organization -DefaultMenuManager= Standard menu manager -DefaultMenuSmartphoneManager=Smartphone menu manager -Skin=Skin theme -DefaultSkin=Default skin theme -MaxSizeList=Max length for list -DefaultMaxSizeList=Default max length for lists -DefaultMaxSizeShortList=Default max length for short lists (i.e. in customer card) -MessageOfDay=Message of the day -MessageLogin=Login page message -LoginPage=Login page -BackgroundImageLogin=Background image -PermanentLeftSearchForm=Permanent search form on left menu -DefaultLanguage=Default language -EnableMultilangInterface=Enable multilanguage support for customer or vendor relationships -EnableShowLogo=Show the company logo in the menu -CompanyInfo=Company/Organization -CompanyIds=Company/Organization identities -CompanyName=Name -CompanyAddress=Address -CompanyZip=Zip -CompanyTown=Town -CompanyCountry=Country -CompanyCurrency=Main currency -CompanyObject=Object of the company -IDCountry=ID country -Logo=Logo -LogoDesc=Main logo of company. Will be used into generated documents (PDF, ...) -LogoSquarred=Logo (squarred) -LogoSquarredDesc=Must be a squarred icon (width = height). This logo will be used as the favorite icon or other need like for the top menu bar (if not disabled into display setup). -DoNotSuggestPaymentMode=Do not suggest -NoActiveBankAccountDefined=No active bank account defined -OwnerOfBankAccount=Owner of bank account %s -BankModuleNotActive=Bank accounts module not enabled -ShowBugTrackLink=Define the link "%s" (empty to not display this link, 'github' for the link to the Dolibarr project or define directly an url 'https://...') -Alerts=Alerts -DelaysOfToleranceBeforeWarning=Delay before displaying a warning alert for: -DelaysOfToleranceDesc=Set the delay before an alert icon %s is shown onscreen for the late element. -Delays_MAIN_DELAY_ACTIONS_TODO=Planned events (agenda events) not completed -Delays_MAIN_DELAY_PROJECT_TO_CLOSE=Project not closed in time -Delays_MAIN_DELAY_TASKS_TODO=Planned task (project tasks) not completed -Delays_MAIN_DELAY_ORDERS_TO_PROCESS=Order not processed -Delays_MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS=Purchase order not processed -Delays_MAIN_DELAY_PROPALS_TO_CLOSE=Proposal not closed -Delays_MAIN_DELAY_PROPALS_TO_BILL=Proposal not billed -Delays_MAIN_DELAY_NOT_ACTIVATED_SERVICES=Service to activate -Delays_MAIN_DELAY_RUNNING_SERVICES=Expired service -Delays_MAIN_DELAY_SUPPLIER_BILLS_TO_PAY=Unpaid vendor invoice -Delays_MAIN_DELAY_CUSTOMER_BILLS_UNPAYED=Unpaid customer invoice -Delays_MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE=Pending bank reconciliation -Delays_MAIN_DELAY_MEMBERS=Delayed membership fee -Delays_MAIN_DELAY_CHEQUES_TO_DEPOSIT=Check deposit not done -Delays_MAIN_DELAY_EXPENSEREPORTS=Expense report to approve -Delays_MAIN_DELAY_HOLIDAYS=Leave requests to approve -SetupDescription1=Before starting to use Dolibarr some initial parameters must be defined and modules enabled/configured. -SetupDescription2=The following two sections are mandatory (the two first entries in the Setup menu): -SetupDescription3=%s -> %s

    Basic parameters used to customize the default behavior of your application (e.g for country-related features). -SetupDescription4=%s -> %s

    This software is a suite of many modules/applications. The modules related to your needs must be enabled and configured. Menu entries will appears with the activation of these modules. -SetupDescription5=Other Setup menu entries manage optional parameters. -SetupDescriptionLink=%s - %s -SetupDescription3b=Basic parameters used to customize the default behavior of your application (e.g for country-related features). -SetupDescription4b=This software is a suite of many modules/applications. The modules related to your needs must be enabled and configured. Menu entries will appears with the activation of these modules. -AuditedSecurityEvents=Security events that are audited -NoSecurityEventsAreAduited=No security events are audited. You can enable them from menu %s -Audit=Security events -InfoDolibarr=About Dolibarr -InfoBrowser=About Browser -InfoOS=About OS -InfoWebServer=About Web Server -InfoDatabase=About Database -InfoPHP=About PHP -InfoPerf=About Performances -InfoSecurity=About Security -BrowserName=Browser name -BrowserOS=Browser OS -ListOfSecurityEvents=List of Dolibarr security events -SecurityEventsPurged=Security events purged -LogEventDesc=Enable logging for specific security events. Administrators the log via menu %s - %s. Warning, this feature can generate a large amount of data in the database. -AreaForAdminOnly=Setup parameters can be set by administrator users only. -SystemInfoDesc=System information is miscellaneous technical information you get in read only mode and visible for administrators only. -SystemAreaForAdminOnly=This area is available to administrator users only. Dolibarr user permissions cannot change this restriction. -CompanyFundationDesc=Edit the information of your company/organization. Click on "%s" button at the bottom of the page when done. -AccountantDesc=If you have an external accountant/bookkeeper, you can edit here its information. -AccountantFileNumber=Accountant code -DisplayDesc=Parameters affecting the look and behaviour of Dolibarr can be modified here. -AvailableModules=Available app/modules -ToActivateModule=To activate modules, go on setup Area (Home->Setup->Modules). -SessionTimeOut=Time out for session -SessionExplanation=This number guarantees that the session will never expire before this delay, if the session cleaner is done by Internal PHP session cleaner (and nothing else). Internal PHP session cleaner does not guarantee that the session will expire after this delay. It will expire, after this delay, and when the session cleaner is run, so every %s/%s access, but only during access made by other sessions (if value is 0, it means clearing of session is done only by an external process).
    Note: on some servers with an external session cleaning mechanism (cron under debian, ubuntu ...), the sessions can be destroyed after a period defined by an external setup, no matter what the value entered here is. -SessionsPurgedByExternalSystem=Sessions on this server seems to be cleaned by an external mechanism (cron under debian, ubuntu ...), probably every %s seconds (= value of parameter session.gc_maxlifetime), so changing the value here has no effect. You must ask the server administrator to change session delay. -TriggersAvailable=Available triggers -TriggersDesc=Triggers are files that will modify the behavior of Dolibarr workflow once copied into the directory htdocs/core/triggers. They realize new actions, activated on Dolibarr events (new company creation, invoice validation, ...). -TriggerDisabledByName=Triggers in this file are disabled by the -NORUN suffix in their name. -TriggerDisabledAsModuleDisabled=Triggers in this file are disabled as module %s is disabled. -TriggerAlwaysActive=Triggers in this file are always active, whatever are the activated Dolibarr modules. -TriggerActiveAsModuleActive=Triggers in this file are active as module %s is enabled. -GeneratedPasswordDesc=Choose the method to be used for auto-generated passwords. -DictionaryDesc=Insert all reference data. You can add your values to the default. -ConstDesc=This page allows you to edit (override) parameters not available in other pages. These are mostly reserved parameters for developers/advanced troubleshooting only. -MiscellaneousDesc=All other security related parameters are defined here. -LimitsSetup=Limits/Precision setup -LimitsDesc=You can define limits, precisions and optimizations used by Dolibarr here -MAIN_MAX_DECIMALS_UNIT=Max. decimals for unit prices -MAIN_MAX_DECIMALS_TOT=Max. decimals for total prices -MAIN_MAX_DECIMALS_SHOWN=Max. decimals for prices shown on screen. Add an ellipsis ... after this parameter (e.g. "2...") if you want to see "..." suffixed to the truncated price. -MAIN_ROUNDING_RULE_TOT=Step of rounding range (for countries where rounding is done on something other than base 10. For example, put 0.05 if rounding is done by 0.05 steps) -UnitPriceOfProduct=Net unit price of a product -TotalPriceAfterRounding=Total price (excl/vat/incl tax) after rounding -ParameterActiveForNextInputOnly=Parameter effective for next input only -NoEventOrNoAuditSetup=No security event has been logged. This is normal if Audit has not been enabled in the "Setup - Security - Events" page. -NoEventFoundWithCriteria=No security event has been found for this search criteria. -SeeLocalSendMailSetup=See your local sendmail setup -BackupDesc=A complete backup of a Dolibarr installation requires two steps. -BackupDesc2=Backup the contents of the "documents" directory (%s) containing all uploaded and generated files. This will also include all the dump files generated in Step 1. This operation may last several minutes. -BackupDesc3=Backup the structure and contents of your database (%s) into a dump file. For this, you can use the following assistant. -BackupDescX=The archived directory should be stored in a secure place. -BackupDescY=The generated dump file should be stored in a secure place. -BackupPHPWarning=Backup cannot be guaranteed with this method. Previous one recommended. -RestoreDesc=To restore a Dolibarr backup, two steps are required. -RestoreDesc2=Restore the backup file (zip file for example) of the "documents" directory to a new Dolibarr installation or into this current documents directory (%s). -RestoreDesc3=Restore the database structure and data from a backup dump file into the database of the new Dolibarr installation or into the database of this current installation (%s). Warning, once the restore is complete, you must use a login/password, that existed from the backup time/installation to connect again.
    To restore a backup database into this current installation, you can follow this assistant. -RestoreMySQL=MySQL import -ForcedToByAModule=This rule is forced to %s by an activated module -ValueIsForcedBySystem=This value is forced by the system. You can't change it. -PreviousDumpFiles=Existing backup files -PreviousArchiveFiles=Existing archive files -WeekStartOnDay=First day of the week -RunningUpdateProcessMayBeRequired=Running the upgrade process seems to be required (Program version %s differs from Database version %s) -YouMustRunCommandFromCommandLineAfterLoginToUser=You must run this command from command line after login to a shell with user %s or you must add -W option at end of command line to provide %s password. -YourPHPDoesNotHaveSSLSupport=SSL functions not available in your PHP -DownloadMoreSkins=More skins to download -SimpleNumRefModelDesc=Returns the reference number in the format %syymm-nnnn where yy is the year, mm is the month and nnnn is a sequential auto-incrementing number with no reset -SimpleNumRefNoDateModelDesc=Returns the reference number in the format %s-nnnn where nnnn is a sequential auto-incrementing number with no reset -ShowProfIdInAddress=Show professional ID with addresses -ShowVATIntaInAddress=Hide intra-Community VAT number -TranslationUncomplete=Partial translation -MAIN_DISABLE_METEO=Disable meteorological view -MeteoStdMod=Standard mode -MeteoStdModEnabled=Standard mode enabled -MeteoPercentageMod=Percentage mode -MeteoPercentageModEnabled=Percentage mode enabled -MeteoUseMod=Click to use %s -TestLoginToAPI=Test login to API -ProxyDesc=Some features of Dolibarr require internet access. Define here the internet connection parameters such as access through a proxy server if necessary. -ExternalAccess=External/Internet Access -MAIN_PROXY_USE=Use a proxy server (otherwise access is direct to the internet) -MAIN_PROXY_HOST=Proxy server: Name/Address -MAIN_PROXY_PORT=Proxy server: Port -MAIN_PROXY_USER=Proxy server: Login/User -MAIN_PROXY_PASS=Proxy server: Password -DefineHereComplementaryAttributes=Define any additional / custom attributes that must be added to: %s -ExtraFields=Complementary attributes -ExtraFieldsLines=Complementary attributes (lines) -ExtraFieldsLinesRec=Complementary attributes (templates invoices lines) -ExtraFieldsSupplierOrdersLines=Complementary attributes (order lines) -ExtraFieldsSupplierInvoicesLines=Complementary attributes (invoice lines) -ExtraFieldsThirdParties=Complementary attributes (third party) -ExtraFieldsContacts=Complementary attributes (contacts/address) -ExtraFieldsMember=Complementary attributes (member) -ExtraFieldsMemberType=Complementary attributes (member type) -ExtraFieldsCustomerInvoices=Complementary attributes (invoices) -ExtraFieldsCustomerInvoicesRec=Complementary attributes (templates invoices) -ExtraFieldsSupplierOrders=Complementary attributes (orders) -ExtraFieldsSupplierInvoices=Complementary attributes (invoices) -ExtraFieldsProject=Complementary attributes (projects) -ExtraFieldsProjectTask=Complementary attributes (tasks) -ExtraFieldsSalaries=Complementary attributes (salaries) -ExtraFieldHasWrongValue=Attribute %s has a wrong value. -AlphaNumOnlyLowerCharsAndNoSpace=only alphanumericals and lower case characters without space -SendmailOptionNotComplete=Warning, on some Linux systems, to send email from your email, sendmail execution setup must contains option -ba (parameter mail.force_extra_parameters into your php.ini file). If some recipients never receive emails, try to edit this PHP parameter with mail.force_extra_parameters = -ba). -PathToDocuments=Path to documents -PathDirectory=Directory -SendmailOptionMayHurtBuggedMTA=Feature to send mails using method "PHP mail direct" will generate a mail message that might not be parsed correctly by some receiving mail servers. The result is that some mails can't be read by people hosted by those bugged platforms. This is the case for some Internet providers (Ex: Orange in France). This is not a problem with Dolibarr or PHP but with the receiving mail server. You can however add an option MAIN_FIX_FOR_BUGGED_MTA to 1 in Setup - Other to modify Dolibarr to avoid this. However, you may experience problems with other servers that strictly use the SMTP standard. The other solution (recommended) is to use the method "SMTP socket library" which has no disadvantages. -TranslationSetup=Setup of translation -TranslationKeySearch=Search a translation key or string -TranslationOverwriteKey=Overwrite a translation string -TranslationDesc=How to set the display language:
    * Default/Systemwide: menu Home -> Setup -> Display
    * Per user: Click on the username at the top of the screen and modify the User Display Setup tab on the user card. -TranslationOverwriteDesc=You can also override strings filling the following table. Choose your language from "%s" dropdown, insert the translation key string into "%s" and your new translation into "%s" -TranslationOverwriteDesc2=You can use the other tab to help you know which translation key to use -TranslationString=Translation string -CurrentTranslationString=Current translation string -WarningAtLeastKeyOrTranslationRequired=A search criteria is required at least for key or translation string -NewTranslationStringToShow=New translation string to show -OriginalValueWas=The original translation is overwritten. Original value was:

    %s -TransKeyWithoutOriginalValue=You forced a new translation for the translation key '%s' that does not exist in any language files -TitleNumberOfActivatedModules=Activated modules -TotalNumberOfActivatedModules=Activated modules: %s / %s -YouMustEnableOneModule=You must at least enable 1 module -ClassNotFoundIntoPathWarning=Class %s not found in PHP path -YesInSummer=Yes in summer -OnlyFollowingModulesAreOpenedToExternalUsers=Note, only the following modules are available to external users (irrespective of the permissions of such users) and only if permissions are granted:
    -SuhosinSessionEncrypt=Session storage encrypted by Suhosin -ConditionIsCurrently=Condition is currently %s -YouUseBestDriver=You use driver %s which is the best driver currently available. -YouDoNotUseBestDriver=You use driver %s but driver %s is recommended. -NbOfObjectIsLowerThanNoPb=You have only %s %s in the database. This does not require any particular optimization. -ComboListOptim=Combo list loading optimization -SearchOptim=Search optimization -YouHaveXObjectUseComboOptim=You have %s %s in the database. You can go into setup of module to enable loading of combo list on key pressed event. -YouHaveXObjectUseSearchOptim=You have %s %s in the database. You can add the constant %s to 1 in Home-Setup-Other. -YouHaveXObjectUseSearchOptimDesc=This limits the search to the beginning of strings which makes it possible for the database to use indexes and you should get an immediate response. -YouHaveXObjectAndSearchOptimOn=You have %s %s in the database and constant %s is set to %s in Home-Setup-Other. -BrowserIsOK=You are using the %s web browser. This browser is ok for security and performance. -BrowserIsKO=You are using the %s web browser. This browser is known to be a bad choice for security, performance and reliability. We recommend using Firefox, Chrome, Opera or Safari. -PHPModuleLoaded=PHP component %s is loaded -PreloadOPCode=Preloaded OPCode is used -AddRefInList=Display Customer/Vendor ref. info list (select list or combobox) and most of hyperlink.
    Third Parties will appear with a name format of "CC12345 - SC45678 - The Big Company corp." instead of "The Big Company corp". -AddAdressInList=Display Customer/Vendor adress info list (select list or combobox)
    Third Parties will appear with a name format of "The Big Company corp. - 21 jump street 123456 Big town - USA" instead of "The Big Company corp". -AddEmailPhoneTownInContactList=Display Contact email (or phones if not defined) and town info list (select list or combobox)
    Contacts will appear with a name format of "Dupond Durand - dupond.durand@email.com - Paris" or "Dupond Durand - 06 07 59 65 66 - Paris" instead of "Dupond Durand". -AskForPreferredShippingMethod=Ask for preferred shipping method for Third Parties. -FieldEdition=Edition of field %s -FillThisOnlyIfRequired=Example: +2 (fill only if timezone offset problems are experienced) -GetBarCode=Get barcode -NumberingModules=Numbering models -DocumentModules=Document models -##### Module password generation -PasswordGenerationStandard=Return a password generated according to internal Dolibarr algorithm: %s characters containing shared numbers and characters in lowercase. -PasswordGenerationNone=Do not suggest a generated password. Password must be typed in manually. -PasswordGenerationPerso=Return a password according to your personally defined configuration. -SetupPerso=According to your configuration -PasswordPatternDesc=Password pattern description -##### Users setup ##### -RuleForGeneratedPasswords=Rules to generate and validate passwords -DisableForgetPasswordLinkOnLogonPage=Do not show the "Password Forgotten" link on the Login page -UsersSetup=Users module setup -UserMailRequired=Email required to create a new user -UserHideInactive=Hide inactive users from all combo lists of users (Not recommended: this may means you won't be able to filter or search on old users on some pages) -UsersDocModules=Document templates for documents generated from user record -GroupsDocModules=Document templates for documents generated from a group record -##### HRM setup ##### -HRMSetup=HRM module setup -##### Company setup ##### -CompanySetup=Companies module setup -CompanyCodeChecker=Options for automatic generation of customer/vendor codes -AccountCodeManager=Options for automatic generation of customer/vendor accounting codes -NotificationsDesc=Email notifications can be sent automatically for some Dolibarr events.
    Recipients of notifications can be defined: -NotificationsDescUser=* per user, one user at a time. -NotificationsDescContact=* per third-party contacts (customers or vendors), one contact at a time. -NotificationsDescGlobal=* or by setting global email addresses in this setup page. -ModelModules=Document Templates -DocumentModelOdt=Generate documents from OpenDocument templates (.ODT / .ODS files from LibreOffice, OpenOffice, KOffice, TextEdit,...) -WatermarkOnDraft=Watermark on draft document -JSOnPaimentBill=Activate feature to autofill payment lines on payment form -CompanyIdProfChecker=Rules for Professional IDs -MustBeUnique=Must be unique? -MustBeMandatory=Mandatory to create third parties (if VAT number or type of company defined) ? -MustBeInvoiceMandatory=Mandatory to validate invoices? -TechnicalServicesProvided=Technical services provided -#####DAV ##### -WebDAVSetupDesc=This is the link to access the WebDAV directory. It contains a "public" dir open to any user knowing the URL (if public directory access allowed) and a "private" directory that needs an existing login account/password for access. -WebDavServer=Root URL of %s server: %s -##### Webcal setup ##### -WebCalUrlForVCalExport=An export link to %s format is available at following link: %s -##### Invoices ##### -BillsSetup=Invoices module setup -BillsNumberingModule=Invoices and credit notes numbering model -BillsPDFModules=Invoice documents models -BillsPDFModulesAccordindToInvoiceType=Invoice documents models according to invoice type -PaymentsPDFModules=Payment documents models -ForceInvoiceDate=Force invoice date to validation date -SuggestedPaymentModesIfNotDefinedInInvoice=Suggested payments mode on invoice by default if not defined on the invoice -SuggestPaymentByRIBOnAccount=Suggest payment by withdrawal on account -SuggestPaymentByChequeToAddress=Suggest payment by check to -FreeLegalTextOnInvoices=Free text on invoices -WatermarkOnDraftInvoices=Watermark on draft invoices (none if empty) -PaymentsNumberingModule=Payments numbering model -SuppliersPayment=Vendor payments -SupplierPaymentSetup=Vendor payments setup -##### Proposals ##### -PropalSetup=Commercial proposals module setup -ProposalsNumberingModules=Commercial proposal numbering models -ProposalsPDFModules=Commercial proposal documents models -SuggestedPaymentModesIfNotDefinedInProposal=Suggested payments mode on proposal by default if not defined on the proposal -FreeLegalTextOnProposal=Free text on commercial proposals -WatermarkOnDraftProposal=Watermark on draft commercial proposals (none if empty) -BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL=Ask for bank account destination of proposal -##### SupplierProposal ##### -SupplierProposalSetup=Price requests suppliers module setup -SupplierProposalNumberingModules=Price requests suppliers numbering models -SupplierProposalPDFModules=Price requests suppliers documents models -FreeLegalTextOnSupplierProposal=Free text on price requests suppliers -WatermarkOnDraftSupplierProposal=Watermark on draft price requests suppliers (none if empty) -BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL=Ask for bank account destination of price request -WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER=Ask for Warehouse Source for order -##### Suppliers Orders ##### -BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER=Ask for bank account destination of purchase order -##### Orders ##### -SuggestedPaymentModesIfNotDefinedInOrder=Suggested payments mode on sale order by default if not defined on the order -OrdersSetup=Sales Orders management setup -OrdersNumberingModules=Orders numbering models -OrdersModelModule=Order documents models -FreeLegalTextOnOrders=Free text on orders -WatermarkOnDraftOrders=Watermark on draft orders (none if empty) -ShippableOrderIconInList=Add an icon in Orders list which indicate if order is shippable -BANK_ASK_PAYMENT_BANK_DURING_ORDER=Ask for bank account destination of order -##### Interventions ##### -InterventionsSetup=Interventions module setup -FreeLegalTextOnInterventions=Free text on intervention documents -FicheinterNumberingModules=Intervention numbering models -TemplatePDFInterventions=Intervention card documents models -WatermarkOnDraftInterventionCards=Watermark on intervention card documents (none if empty) -##### Contracts ##### -ContractsSetup=Contracts/Subscriptions module setup -ContractsNumberingModules=Contracts numbering modules -TemplatePDFContracts=Contracts documents models -FreeLegalTextOnContracts=Free text on contracts -WatermarkOnDraftContractCards=Watermark on draft contracts (none if empty) -##### Members ##### -MembersSetup=Members module setup -MemberMainOptions=Main options -AdherentLoginRequired= Manage a Login for each member -AdherentMailRequired=Email required to create a new member -MemberSendInformationByMailByDefault=Checkbox to send mail confirmation to members (validation or new subscription) is on by default -MemberCreateAnExternalUserForSubscriptionValidated=Create an external user login for each new member subscription validated -VisitorCanChooseItsPaymentMode=Visitor can choose from available payment modes -MEMBER_REMINDER_EMAIL=Enable automatic reminder by email of expired subscriptions. Note: Module %s must be enabled and correctly setup to send reminders. -MembersDocModules=Document templates for documents generated from member record -##### LDAP setup ##### -LDAPSetup=LDAP Setup -LDAPGlobalParameters=Global parameters -LDAPUsersSynchro=Users -LDAPGroupsSynchro=Groups -LDAPContactsSynchro=Contacts -LDAPMembersSynchro=Members -LDAPMembersTypesSynchro=Members types -LDAPSynchronization=LDAP synchronisation -LDAPFunctionsNotAvailableOnPHP=LDAP functions are not available on your PHP -LDAPToDolibarr=LDAP -> Dolibarr -DolibarrToLDAP=Dolibarr -> LDAP -LDAPNamingAttribute=Key in LDAP -LDAPSynchronizeUsers=Organization of users in LDAP -LDAPSynchronizeGroups=Organization of groups in LDAP -LDAPSynchronizeContacts=Organization of contacts in LDAP -LDAPSynchronizeMembers=Organization of foundation's members in LDAP -LDAPSynchronizeMembersTypes=Organization of foundation's members types in LDAP -LDAPPrimaryServer=Primary server -LDAPSecondaryServer=Secondary server -LDAPServerPort=Server port -LDAPServerPortExample=Default port: 389 -LDAPServerProtocolVersion=Protocol version -LDAPServerUseTLS=Use TLS LDAPServerUseTLSExample=Your LDAP server use TLS -LDAPServerDn=Server DN -LDAPAdminDn=Administrator DN -LDAPAdminDnExample=Complete DN (ex: cn=admin,dc=example,dc=com or cn=Administrator,cn=Users,dc=example,dc=com for active directory) -LDAPPassword=Administrator password -LDAPUserDn=Users' DN -LDAPUserDnExample=Complete DN (ex: ou=users,dc=example,dc=com) -LDAPGroupDn=Groups' DN -LDAPGroupDnExample=Complete DN (ex: ou=groups,dc=example,dc=com) -LDAPServerExample=Server address (ex: localhost, 192.168.0.2, ldaps://ldap.example.com/) -LDAPServerDnExample=Complete DN (ex: dc=example,dc=com) -LDAPDnSynchroActive=Users and groups synchronization -LDAPDnSynchroActiveExample=LDAP to Dolibarr or Dolibarr to LDAP synchronization -LDAPDnContactActive=Contacts' synchronization -LDAPDnContactActiveExample=Activated/Unactivated synchronization -LDAPDnMemberActive=Members' synchronization -LDAPDnMemberActiveExample=Activated/Unactivated synchronization -LDAPDnMemberTypeActive=Members types' synchronization -LDAPDnMemberTypeActiveExample=Activated/Unactivated synchronization -LDAPContactDn=Dolibarr contacts' DN -LDAPContactDnExample=Complete DN (ex: ou=contacts,dc=example,dc=com) -LDAPMemberDn=Dolibarr members DN -LDAPMemberDnExample=Complete DN (ex: ou=members,dc=example,dc=com) -LDAPMemberObjectClassList=List of objectClass -LDAPMemberObjectClassListExample=List of objectClass defining record attributes (ex: top,inetOrgPerson or top,user for active directory) -LDAPMemberTypeDn=Dolibarr members types DN -LDAPMemberTypepDnExample=Complete DN (ex: ou=memberstypes,dc=example,dc=com) -LDAPMemberTypeObjectClassList=List of objectClass -LDAPMemberTypeObjectClassListExample=List of objectClass defining record attributes (ex: top,groupOfUniqueNames) -LDAPUserObjectClassList=List of objectClass -LDAPUserObjectClassListExample=List of objectClass defining record attributes (ex: top,inetOrgPerson or top,user for active directory) -LDAPGroupObjectClassList=List of objectClass -LDAPGroupObjectClassListExample=List of objectClass defining record attributes (ex: top,groupOfUniqueNames) -LDAPContactObjectClassList=List of objectClass -LDAPContactObjectClassListExample=List of objectClass defining record attributes (ex: top,inetOrgPerson or top,user for active directory) -LDAPTestConnect=Test LDAP connection -LDAPTestSynchroContact=Test contacts synchronization -LDAPTestSynchroUser=Test user synchronization -LDAPTestSynchroGroup=Test group synchronization -LDAPTestSynchroMember=Test member synchronization -LDAPTestSynchroMemberType=Test member type synchronization -LDAPTestSearch= Test a LDAP search -LDAPSynchroOK=Synchronization test successful -LDAPSynchroKO=Failed synchronization test -LDAPSynchroKOMayBePermissions=Failed synchronization test. Check that the connection to the server is correctly configured and allows LDAP updates -LDAPTCPConnectOK=TCP connect to LDAP server successful (Server=%s, Port=%s) -LDAPTCPConnectKO=TCP connect to LDAP server failed (Server=%s, Port=%s) -LDAPBindOK=Connect/Authenticate to LDAP server successful (Server=%s, Port=%s, Admin=%s, Password=%s) -LDAPBindKO=Connect/Authenticate to LDAP server failed (Server=%s, Port=%s, Admin=%s, Password=%s) -LDAPSetupForVersion3=LDAP server configured for version 3 -LDAPSetupForVersion2=LDAP server configured for version 2 -LDAPDolibarrMapping=Dolibarr Mapping -LDAPLdapMapping=LDAP Mapping -LDAPFieldLoginUnix=Login (unix) -LDAPFieldLoginExample=Example: uid -LDAPFilterConnection=Search filter -LDAPFilterConnectionExample=Example: &(objectClass=inetOrgPerson) -LDAPGroupFilterExample=Example: &(objectClass=groupOfUsers) -LDAPFieldLoginSamba=Login (samba, activedirectory) -LDAPFieldLoginSambaExample=Example: samaccountname -LDAPFieldFullname=Full name -LDAPFieldFullnameExample=Example: cn -LDAPFieldPasswordNotCrypted=Password not encrypted -LDAPFieldPasswordCrypted=Password encrypted -LDAPFieldPasswordExample=Example: userPassword -LDAPFieldCommonNameExample=Example: cn -LDAPFieldName=Name -LDAPFieldNameExample=Example: sn -LDAPFieldFirstName=First name -LDAPFieldFirstNameExample=Example: givenName -LDAPFieldMail=Email address -LDAPFieldMailExample=Example: mail -LDAPFieldPhone=Professional phone number -LDAPFieldPhoneExample=Example: telephonenumber -LDAPFieldHomePhone=Personal phone number -LDAPFieldHomePhoneExample=Example: homephone -LDAPFieldMobile=Cellular phone -LDAPFieldMobileExample=Example: mobile -LDAPFieldFax=Fax number -LDAPFieldFaxExample=Example: facsimiletelephonenumber -LDAPFieldAddress=Street -LDAPFieldAddressExample=Example: street -LDAPFieldZip=Zip -LDAPFieldZipExample=Example: postalcode -LDAPFieldTown=Town -LDAPFieldTownExample=Example: l -LDAPFieldCountry=Country -LDAPFieldDescription=Description -LDAPFieldDescriptionExample=Example: description -LDAPFieldNotePublic=Public Note -LDAPFieldNotePublicExample=Example: publicnote -LDAPFieldGroupMembers= Group members -LDAPFieldGroupMembersExample= Example: uniqueMember -LDAPFieldBirthdate=Birthdate -LDAPFieldCompany=Company -LDAPFieldCompanyExample=Example: o -LDAPFieldSid=SID -LDAPFieldSidExample=Example: objectsid -LDAPFieldEndLastSubscription=Date of subscription end -LDAPFieldTitle=Job position -LDAPFieldTitleExample=Example: title -LDAPFieldGroupid=Group id -LDAPFieldGroupidExample=Exemple : gidnumber -LDAPFieldUserid=User id -LDAPFieldUseridExample=Exemple : uidnumber -LDAPFieldHomedirectory=Home directory -LDAPFieldHomedirectoryExample=Exemple : homedirectory -LDAPFieldHomedirectoryprefix=Home directory prefix -LDAPSetupNotComplete=LDAP setup not complete (go on others tabs) -LDAPNoUserOrPasswordProvidedAccessIsReadOnly=No administrator or password provided. LDAP access will be anonymous and in read only mode. -LDAPDescContact=This page allows you to define LDAP attributes name in LDAP tree for each data found on Dolibarr contacts. -LDAPDescUsers=This page allows you to define LDAP attributes name in LDAP tree for each data found on Dolibarr users. -LDAPDescGroups=This page allows you to define LDAP attributes name in LDAP tree for each data found on Dolibarr groups. -LDAPDescMembers=This page allows you to define LDAP attributes name in LDAP tree for each data found on Dolibarr members module. -LDAPDescMembersTypes=This page allows you to define LDAP attributes name in LDAP tree for each data found on Dolibarr members types. -LDAPDescValues=Example values are designed for OpenLDAP with following loaded schemas: core.schema, cosine.schema, inetorgperson.schema). If you use thoose values and OpenLDAP, modify your LDAP config file slapd.conf to have all thoose schemas loaded. -ForANonAnonymousAccess=For an authenticated access (for a write access for example) -PerfDolibarr=Performance setup/optimizing report -YouMayFindPerfAdviceHere=This page provides some checks or advice related to performance. -NotInstalled=Not installed. -NotSlowedDownByThis=Not slowed down by this. -NotRiskOfLeakWithThis=Not risk of leak with this. -ApplicativeCache=Applicative cache -MemcachedNotAvailable=No applicative cache found. You can enhance performance by installing a cache server Memcached and a module able to use this cache server.
    More information here http://wiki.dolibarr.org/index.php/Module_MemCached_EN.
    Note that a lot of web hosting provider does not provide such cache server. -MemcachedModuleAvailableButNotSetup=Module memcached for applicative cache found but setup of module is not complete. -MemcachedAvailableAndSetup=Module memcached dedicated to use memcached server is enabled. -OPCodeCache=OPCode cache -NoOPCodeCacheFound=No OPCode cache found. Maybe you are using an OPCode cache other than XCache or eAccelerator (good), or maybe you don't have OPCode cache (very bad). -HTTPCacheStaticResources=HTTP cache for static resources (css, img, javascript) -FilesOfTypeCached=Files of type %s are cached by HTTP server -FilesOfTypeNotCached=Files of type %s are not cached by HTTP server -FilesOfTypeCompressed=Files of type %s are compressed by HTTP server -FilesOfTypeNotCompressed=Files of type %s are not compressed by HTTP server -CacheByServer=Cache by server -CacheByServerDesc=For example using the Apache directive "ExpiresByType image/gif A2592000" -CacheByClient=Cache by browser -CompressionOfResources=Compression of HTTP responses -CompressionOfResourcesDesc=For example using the Apache directive "AddOutputFilterByType DEFLATE" -TestNotPossibleWithCurrentBrowsers=Such an automatic detection is not possible with current browsers -DefaultValuesDesc=Here you may define the default value you wish to use when creating a new record, and/or default filters or the sort order when you list records. -DefaultCreateForm=Default values (to use on forms) -DefaultSearchFilters=Default search filters -DefaultSortOrder=Default sort orders -DefaultFocus=Default focus fields -DefaultMandatory=Mandatory form fields -##### Products ##### -ProductSetup=Products module setup -ServiceSetup=Services module setup -ProductServiceSetup=Products and Services modules setup -NumberOfProductShowInSelect=Maximum number of products to show in combo select lists (0=no limit) -ViewProductDescInFormAbility=Display product descriptions in forms (otherwise shown in a tooltip popup) -DoNotAddProductDescAtAddLines=Do not add product description (from product card) on submit add lines on forms -OnProductSelectAddProductDesc=How to use the description of the products when adding a product as a line of a document -AutoFillFormFieldBeforeSubmit=Auto fill the description input field with the description of product -DoNotAutofillButAutoConcat=Do not autofill the input field with description of product. Description of the product will be concatenated to the entered description automatically. -DoNotUseDescriptionOfProdut=Description of the product will never be included into the description of lines of documents -MergePropalProductCard=Activate in product/service Attached Files tab an option to merge product PDF document to proposal PDF azur if product/service is in the proposal -ViewProductDescInThirdpartyLanguageAbility=Display products descriptions in forms in the language of the third party (otherwise in the language of the user) -UseSearchToSelectProductTooltip=Also if you have a large number of products (> 100 000), you can increase speed by setting constant PRODUCT_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string. -UseSearchToSelectProduct=Wait until you press a key before loading content of product combo list (This may increase performance if you have a large number of products, but it is less convenient) -SetDefaultBarcodeTypeProducts=Default barcode type to use for products -SetDefaultBarcodeTypeThirdParties=Default barcode type to use for third parties -UseUnits=Define a unit of measure for Quantity during order, proposal or invoice lines edition -ProductCodeChecker= Module for product code generation and checking (product or service) -ProductOtherConf= Product / Service configuration -IsNotADir=is not a directory! -##### Syslog ##### -SyslogSetup=Logs module setup -SyslogOutput=Logs outputs -SyslogFacility=Facility -SyslogLevel=Level -SyslogFilename=File name and path -YouCanUseDOL_DATA_ROOT=You can use DOL_DATA_ROOT/dolibarr.log for a log file in Dolibarr "documents" directory. You can set a different path to store this file. -ErrorUnknownSyslogConstant=Constant %s is not a known Syslog constant -OnlyWindowsLOG_USER=On Windows, only the LOG_USER facility will be supported -CompressSyslogs=Compression and backup of debug log files (generated by module Log for debug) -SyslogFileNumberOfSaves=Number of backup logs to keep -ConfigureCleaningCronjobToSetFrequencyOfSaves=Configure cleaning scheduled job to set log backup frequency -##### Donations ##### -DonationsSetup=Donation module setup -DonationsReceiptModel=Template of donation receipt -##### Barcode ##### -BarcodeSetup=Barcode setup -PaperFormatModule=Print format module -BarcodeEncodeModule=Barcode encoding type -CodeBarGenerator=Barcode generator -ChooseABarCode=No generator defined -FormatNotSupportedByGenerator=Format not supported by this generator -BarcodeDescEAN8=Barcode of type EAN8 -BarcodeDescEAN13=Barcode of type EAN13 -BarcodeDescUPC=Barcode of type UPC -BarcodeDescISBN=Barcode of type ISBN -BarcodeDescC39=Barcode of type C39 -BarcodeDescC128=Barcode of type C128 -BarcodeDescDATAMATRIX=Barcode of type Datamatrix -BarcodeDescQRCODE=Barcode of type QR code -GenbarcodeLocation=Bar code generation command line tool (used by internal engine for some bar code types). Must be compatible with "genbarcode".
    For example: /usr/local/bin/genbarcode -BarcodeInternalEngine=Internal engine -BarCodeNumberManager=Manager to auto define barcode numbers -##### Prelevements ##### -WithdrawalsSetup=Setup of module Direct Debit payments -##### ExternalRSS ##### -ExternalRSSSetup=External RSS imports setup -NewRSS=New RSS Feed -RSSUrl=RSS URL -RSSUrlExample=An interesting RSS feed -##### Mailing ##### -MailingSetup=EMailing module setup -MailingEMailFrom=Sender email (From) for emails sent by emailing module -MailingEMailError=Return Email (Errors-to) for emails with errors -MailingDelay=Seconds to wait after sending next message -##### Notification ##### -NotificationSetup=Email Notification module setup -NotificationEMailFrom=Sender email (From) for emails sent by the Notifications module -FixedEmailTarget=Recipient -##### Sendings ##### -SendingsSetup=Shipping module setup -SendingsReceiptModel=Sending receipt model -SendingsNumberingModules=Sendings numbering modules -SendingsAbility=Support shipping sheets for customer deliveries -NoNeedForDeliveryReceipts=In most cases, shipping sheets are used both as sheets for customer deliveries (list of products to send) and sheets that are received and signed by customer. Hence the product deliveries receipt is a duplicated feature and is rarely activated. -FreeLegalTextOnShippings=Free text on shipments -##### Deliveries ##### -DeliveryOrderNumberingModules=Products deliveries receipt numbering module -DeliveryOrderModel=Products deliveries receipt model -DeliveriesOrderAbility=Support products deliveries receipts -FreeLegalTextOnDeliveryReceipts=Free text on delivery receipts -##### FCKeditor ##### -AdvancedEditor=Advanced editor -ActivateFCKeditor=Activate advanced editor for: FCKeditorForCompany=WYSIWIG creation/edition of elements description and note (except products/services) FCKeditorForProduct=WYSIWIG creation/edition of products/services description and note -FCKeditorForProductDetails=WYSIWIG creation/edition of products details lines for all entities (proposals, orders, invoices, etc...). Warning: Using this option for this case is seriously not recommended as it can create problems with special characters and page formatting when building PDF files. -FCKeditorForMailing= WYSIWIG creation/edition for mass eMailings (Tools->eMailing) -FCKeditorForUserSignature=WYSIWIG creation/edition of user signature -FCKeditorForMail=WYSIWIG creation/edition for all mail (except Tools->eMailing) -FCKeditorForTicket=WYSIWIG creation/edition for tickets -##### Stock ##### -StockSetup=Stock module setup -IfYouUsePointOfSaleCheckModule=If you use the Point of Sale module (POS) provided by default or an external module, this setup may be ignored by your POS module. Most POS modules are designed by default to create an invoice immediately and decrease stock irrespective of the options here. So if you need or not to have a stock decrease when registering a sale from your POS, check also your POS module setup. -##### Menu ##### -MenuDeleted=Menu deleted -Menu=Menu -Menus=Menus -TreeMenuPersonalized=Personalized menus -NotTopTreeMenuPersonalized=Personalized menus not linked to a top menu entry -NewMenu=New menu -MenuHandler=Menu handler -MenuModule=Source module -HideUnauthorizedMenu=Hide unauthorized menus also for internal users (just greyed otherwise) -DetailId=Id menu -DetailMenuHandler=Menu handler where to show new menu -DetailMenuModule=Module name if menu entry come from a module -DetailType=Type of menu (top or left) -DetailTitre=Menu label or label code for translation -DetailUrl=URL where menu send you (Absolute URL link or external link with http://) -DetailEnabled=Condition to show or not entry -DetailRight=Condition to display unauthorized grey menus -DetailLangs=Lang file name for label code translation -DetailUser=Intern / Extern / All -Target=Target -DetailTarget=Target for links (_blank top opens a new window) -DetailLevel=Level (-1:top menu, 0:header menu, >0 menu and sub menu) -ModifMenu=Menu change -DeleteMenu=Delete menu entry -ConfirmDeleteMenu=Are you sure you want to delete menu entry %s? -FailedToInitializeMenu=Failed to initialize menu -##### Tax ##### -TaxSetup=Taxes, social or fiscal taxes and dividends module setup -OptionVatMode=VAT due -OptionVATDefault=Standard basis -OptionVATDebitOption=Accrual basis -OptionVatDefaultDesc=VAT is due:
    - on delivery of goods (based on invoice date)
    - on payments for services -OptionVatDebitOptionDesc=VAT is due:
    - on delivery of goods (based on invoice date)
    - on invoice (debit) for services -OptionPaymentForProductAndServices=Cash basis for products and services -OptionPaymentForProductAndServicesDesc=VAT is due:
    - on payment for goods
    - on payments for services -SummaryOfVatExigibilityUsedByDefault=Time of VAT eligibility by default according to chosen option: -OnDelivery=On delivery -OnPayment=On payment -OnInvoice=On invoice -SupposedToBePaymentDate=Payment date used -SupposedToBeInvoiceDate=Invoice date used -Buy=Buy -Sell=Sell -InvoiceDateUsed=Invoice date used -YourCompanyDoesNotUseVAT=Your company has been defined to not use VAT (Home - Setup - Company/Organization), so there is no VAT options to setup. -AccountancyCode=Accounting Code -AccountancyCodeSell=Sale account. code -AccountancyCodeBuy=Purchase account. code -CREATE_NEW_VAT_WITHOUT_AUTO_PAYMENT=Keep the checkbox “Automatically create the payment” empty by default when creating a new tax -##### Agenda ##### -AgendaSetup=Events and agenda module setup -PasswordTogetVCalExport=Key to authorize export link -SecurityKey = Security Key -PastDelayVCalExport=Do not export event older than -AGENDA_USE_EVENT_TYPE=Use events types (managed in menu Setup -> Dictionaries -> Type of agenda events) -AGENDA_USE_EVENT_TYPE_DEFAULT=Automatically set this default value for type of event in event create form -AGENDA_DEFAULT_FILTER_TYPE=Automatically set this type of event in search filter of agenda view -AGENDA_DEFAULT_FILTER_STATUS=Automatically set this status for events in search filter of agenda view -AGENDA_DEFAULT_VIEW=Which view do you want to open by default when selecting menu Agenda -AGENDA_REMINDER_BROWSER=Enable event reminder on user's browser (When remind date is reached, a popup is shown by the browser. Each user can disable such notifications from its browser notification setup). -AGENDA_REMINDER_BROWSER_SOUND=Enable sound notification -AGENDA_REMINDER_EMAIL=Enable event reminder by emails (remind option/delay can be defined on each event). -AGENDA_REMINDER_EMAIL_NOTE=Note: The frequency of the scheduled job %s must be enough to be sure that the remind are sent at the correct moment. -AGENDA_SHOW_LINKED_OBJECT=Show linked object into agenda view -##### Clicktodial ##### -ClickToDialSetup=Click To Dial module setup -ClickToDialUrlDesc=Url called when a click on phone picto is done. In URL, you can use tags
    __PHONETO__ that will be replaced with the phone number of person to call
    __PHONEFROM__ that will be replaced with phone number of calling person (yours)
    __LOGIN__ that will be replaced with clicktodial login (defined on user card)
    __PASS__ that will be replaced with clicktodial password (defined on user card). -ClickToDialDesc=This module change phone numbers, when using a desktop computer, into clickable links. A click will call the number. This can be used to start the phone call when using a soft phone on your desktop or when using a CTI system based on SIP protocol for example. Note: When using a smartphone, phone numbers are always clickable. -ClickToDialUseTelLink=Use just a link "tel:" on phone numbers -ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or a software interface, installed on the same computer as the browser, and called when you click on a link starting with "tel:" in your browser. If you need a link that start with "sip:" or a full server solution (no need of local software installation), you must set this to "No" and fill the next field. -##### Point Of Sale (CashDesk) ##### -CashDesk=Point of Sale -CashDeskSetup=Point of Sales module setup -CashDeskThirdPartyForSell=Default generic third party to use for sales -CashDeskBankAccountForSell=Default account to use to receive cash payments -CashDeskBankAccountForCheque=Default account to use to receive payments by check -CashDeskBankAccountForCB=Default account to use to receive payments by credit cards -CashDeskBankAccountForSumup=Default bank account to use to receive payments by SumUp -CashDeskDoNotDecreaseStock=Disable stock decrease when a sale is done from Point of Sale (if "no", stock decrease is done for each sale done from POS, irrespective of the option set in module Stock). -CashDeskIdWareHouse=Force and restrict warehouse to use for stock decrease -StockDecreaseForPointOfSaleDisabled=Stock decrease from Point of Sale disabled -StockDecreaseForPointOfSaleDisabledbyBatch=Stock decrease in POS is not compatible with module Serial/Lot management (currently active) so stock decrease is disabled. -CashDeskYouDidNotDisableStockDecease=You did not disable stock decrease when making a sale from Point of Sale. Hence a warehouse is required. -CashDeskForceDecreaseStockLabel=Stock decrease for batch products was forced. -CashDeskForceDecreaseStockDesc=Decrease first by the oldest eatby and sellby dates. -CashDeskReaderKeyCodeForEnter=Key code for "Enter" defined in barcode reader (Example: 13) -##### Bookmark ##### -BookmarkSetup=Bookmark module setup -BookmarkDesc=This module allows you to manage bookmarks. You can also add shortcuts to any Dolibarr pages or external web sites on your left menu. -NbOfBoomarkToShow=Maximum number of bookmarks to show in left menu -##### WebServices ##### -WebServicesSetup=Webservices module setup -WebServicesDesc=By enabling this module, Dolibarr become a web service server to provide miscellaneous web services. -WSDLCanBeDownloadedHere=WSDL descriptor files of provided services can be download here -EndPointIs=SOAP clients must send their requests to the Dolibarr endpoint available at URL -##### API #### -ApiSetup=API module setup -ApiDesc=By enabling this module, Dolibarr become a REST server to provide miscellaneous web services. -ApiProductionMode=Enable production mode (this will activate use of a cache for services management) -ApiExporerIs=You can explore and test the APIs at URL -OnlyActiveElementsAreExposed=Only elements from enabled modules are exposed -ApiKey=Key for API -WarningAPIExplorerDisabled=The API explorer has been disabled. API explorer is not required to provide API services. It is a tool for developer to find/test REST APIs. If you need this tool, go into setup of module API REST to activate it. -##### Bank ##### -BankSetupModule=Bank module setup -FreeLegalTextOnChequeReceipts=Free text on check receipts -BankOrderShow=Display order of bank accounts for countries using "detailed bank number" -BankOrderGlobal=General -BankOrderGlobalDesc=General display order -BankOrderES=Spanish -BankOrderESDesc=Spanish display order -ChequeReceiptsNumberingModule=Check Receipts Numbering Module -##### Multicompany ##### -MultiCompanySetup=Multi-company module setup -##### Suppliers ##### -SuppliersSetup=Vendor module setup -SuppliersCommandModel=Complete template of Purchase Order -SuppliersCommandModelMuscadet=Complete template of Purchase Order (old implementation of cornas template) -SuppliersInvoiceModel=Complete template of Vendor Invoice -SuppliersInvoiceNumberingModel=Vendor invoices numbering models -IfSetToYesDontForgetPermission=If set to a non null value, don't forget to provide permissions to groups or users allowed for the second approval -##### GeoIPMaxmind ##### -GeoIPMaxmindSetup=GeoIP Maxmind module setup -PathToGeoIPMaxmindCountryDataFile=Path to file containing Maxmind ip to country translation.
    Examples:
    /usr/local/share/GeoIP/GeoIP.dat
    /usr/share/GeoIP/GeoIP.dat
    /usr/share/GeoIP/GeoLite2-Country.mmdb -NoteOnPathLocation=Note that your ip to country data file must be inside a directory your PHP can read (Check your PHP open_basedir setup and filesystem permissions). -YouCanDownloadFreeDatFileTo=You can download a free demo version of the Maxmind GeoIP country file at %s. -YouCanDownloadAdvancedDatFileTo=You can also download a more complete version, with updates, of the Maxmind GeoIP country file at %s. -TestGeoIPResult=Test of a conversion IP -> country -##### Projects ##### -ProjectsNumberingModules=Projects numbering module -ProjectsSetup=Project module setup -ProjectsModelModule=Project reports document model -TasksNumberingModules=Tasks numbering module -TaskModelModule=Tasks reports document model -UseSearchToSelectProject=Wait until a key is pressed before loading content of Project combo list.
    This may improve performance if you have a large number of projects, but it is less convenient. -##### ECM (GED) ##### -##### Fiscal Year ##### -AccountingPeriods=Accounting periods -AccountingPeriodCard=Accounting period -NewFiscalYear=New accounting period -OpenFiscalYear=Open accounting period -CloseFiscalYear=Close accounting period -DeleteFiscalYear=Delete accounting period -ConfirmDeleteFiscalYear=Are you sure to delete this accounting period? -ShowFiscalYear=Show accounting period -AlwaysEditable=Can always be edited -MAIN_APPLICATION_TITLE=Force visible name of application (warning: setting your own name here may break autofill login feature when using DoliDroid mobile application) -NbMajMin=Minimum number of uppercase characters -NbNumMin=Minimum number of numeric characters -NbSpeMin=Minimum number of special characters -NbIteConsecutive=Maximum number of repeating same characters -NoAmbiCaracAutoGeneration=Do not use ambiguous characters ("1","l","i","|","0","O") for automatic generation -SalariesSetup=Setup of module salaries -SortOrder=Sort order -Format=Format -TypePaymentDesc=0:Customer payment type, 1:Vendor payment type, 2:Both customers and suppliers payment type -IncludePath=Include path (defined into variable %s) -ExpenseReportsSetup=Setup of module Expense Reports -TemplatePDFExpenseReports=Document templates to generate expense report document -ExpenseReportsRulesSetup=Setup of module Expense Reports - Rules -ExpenseReportNumberingModules=Expense reports numbering module -NoModueToManageStockIncrease=No module able to manage automatic stock increase has been activated. Stock increase will be done on manual input only. -YouMayFindNotificationsFeaturesIntoModuleNotification=You may find options for email notifications by enabling and configuring the module "Notification". -ListOfNotificationsPerUser=List of automatic notifications per user* -ListOfNotificationsPerUserOrContact=List of possible automatic notifications (on business event) available per user* or per contact** -ListOfFixedNotifications=List of automatic fixed notifications -GoOntoUserCardToAddMore=Go to the tab "Notifications" of a user to add or remove notifications for users -GoOntoContactCardToAddMore=Go to the tab "Notifications" of a third party to add or remove notifications for contacts/addresses -Threshold=Threshold -BackupDumpWizard=Wizard to build the database dump file -BackupZipWizard=Wizard to build the archive of documents directory -SomethingMakeInstallFromWebNotPossible=Installation of external module is not possible from the web interface for the following reason: -SomethingMakeInstallFromWebNotPossible2=For this reason, process to upgrade described here is a manual process only a privileged user may perform. -InstallModuleFromWebHasBeenDisabledByFile=Install of external module from application has been disabled by your administrator. You must ask him to remove the file %s to allow this feature. -ConfFileMustContainCustom=Installing or building an external module from application need to save the module files into directory %s. To have this directory processed by Dolibarr, you must setup your conf/conf.php to add the 2 directive lines:
    $dolibarr_main_url_root_alt='/custom';
    $dolibarr_main_document_root_alt='%s/custom'; -HighlightLinesOnMouseHover=Highlight table lines when mouse move passes over -HighlightLinesColor=Highlight color of the line when the mouse passes over (use 'ffffff' for no highlight) -HighlightLinesChecked=Highlight color of the line when it is checked (use 'ffffff' for no highlight) -TextTitleColor=Text color of Page title -LinkColor=Color of links -PressF5AfterChangingThis=Press CTRL+F5 on keyboard or clear your browser cache after changing this value to have it effective -NotSupportedByAllThemes=Will works with core themes, may not be supported by external themes -BackgroundColor=Background color -TopMenuBackgroundColor=Background color for Top menu -TopMenuDisableImages=Hide images in Top menu -LeftMenuBackgroundColor=Background color for Left menu -BackgroundTableTitleColor=Background color for Table title line -BackgroundTableTitleTextColor=Text color for Table title line -BackgroundTableTitleTextlinkColor=Text color for Table title link line -BackgroundTableLineOddColor=Background color for odd table lines -BackgroundTableLineEvenColor=Background color for even table lines -MinimumNoticePeriod=Minimum notice period (Your leave request must be done before this delay) -NbAddedAutomatically=Number of days added to counters of users (automatically) each month -EnterAnyCode=This field contains a reference to identify the line. Enter any value of your choice, but without special characters. -Enter0or1=Enter 0 or 1 -UnicodeCurrency=Enter here between braces, list of byte number that represent the currency symbol. For example: for $, enter [36] - for brazil real R$ [82,36] - for €, enter [8364] -ColorFormat=The RGB color is in HEX format, eg: FF0000 -PictoHelp=Icon name in dolibarr format ('image.png' if into the current theme directory, 'image.png@nom_du_module' if into the directory /img/ of a module) -PositionIntoComboList=Position of line into combo lists SellTaxRate=Sale tax rate -RecuperableOnly=Yes for VAT "Not Perceived but Recoverable" dedicated for some state in France. Keep value to "No" in all other cases. -UrlTrackingDesc=If the provider or transport service offers a page or web site to check the status of your shipments, you may enter it here. You can use the key {TRACKID} in the URL parameters so the system will replace it with the tracking number the user entered into the shipment card. -OpportunityPercent=When you create a lead, you will define an estimated amount of project/lead. According to status of the lead, this amount may be multiplied by this rate to evaluate a total amount all your leads may generate. Value is a percentage (between 0 and 100). TemplateForElement=This template record is dedicated to which element -TypeOfTemplate=Type of template -TemplateIsVisibleByOwnerOnly=Template is visible to owner only -VisibleEverywhere=Visible everywhere -VisibleNowhere=Visible nowhere -FixTZ=TimeZone fix -FillFixTZOnlyIfRequired=Example: +2 (fill only if problem experienced) -ExpectedChecksum=Expected Checksum -CurrentChecksum=Current Checksum -ExpectedSize=Expected size -CurrentSize=Current size -ForcedConstants=Required constant values -MailToSendProposal=Customer proposals -MailToSendOrder=Sales orders -MailToSendInvoice=Customer invoices -MailToSendShipment=Shipments -MailToSendIntervention=Interventions -MailToSendSupplierRequestForQuotation=Quotation request -MailToSendSupplierOrder=Purchase orders -MailToSendSupplierInvoice=Vendor invoices -MailToSendContract=Contracts -MailToSendReception=Receptions -MailToThirdparty=Third parties -MailToMember=Members -MailToUser=Users -MailToProject=Projects -MailToTicket=Tickets -ByDefaultInList=Show by default on list view -YouUseLastStableVersion=You use the latest stable version -TitleExampleForMajorRelease=Example of message you can use to announce this major release (feel free to use it on your web sites) -TitleExampleForMaintenanceRelease=Example of message you can use to announce this maintenance release (feel free to use it on your web sites) -ExampleOfNewsMessageForMajorRelease=Dolibarr ERP & CRM %s is available. Version %s is a major release with a lot of new features for both users and developers. You can download it from the download area of https://www.dolibarr.org portal (subdirectory Stable versions). You can read ChangeLog for complete list of changes. -ExampleOfNewsMessageForMaintenanceRelease=Dolibarr ERP & CRM %s is available. Version %s is a maintenance version, so contains only bug fixes. We recommend all users to upgrade to this version. A maintenance release does not introduce new features or changes to the database. You may download it from the download area of https://www.dolibarr.org portal (subdirectory Stable versions). You can read the ChangeLog for complete list of changes. -MultiPriceRuleDesc=When option "Several levels of prices per product/service" is enabled, you can define different prices (one per price level) for each product. To save you time, here you may enter a rule to autocalculate a price for each level based on the price of the first level, so you will have to only enter a price for the first level for each product. This page is designed to save you time but is useful only if your prices for each level are relative to first level. You can ignore this page in most cases. -ModelModulesProduct=Templates for product documents -WarehouseModelModules=Templates for documents of warehouses -ToGenerateCodeDefineAutomaticRuleFirst=To be able to generate codes automatically, you must first define a manager to auto-define the barcode number. -SeeSubstitutionVars=See * note for list of possible substitution variables -SeeChangeLog=See ChangeLog file (english only) -AllPublishers=All publishers -UnknownPublishers=Unknown publishers -AddRemoveTabs=Add or remove tabs -AddDataTables=Add object tables -AddDictionaries=Add dictionaries tables -AddData=Add objects or dictionaries data -AddBoxes=Add widgets -AddSheduledJobs=Add scheduled jobs -AddHooks=Add hooks -AddTriggers=Add triggers -AddMenus=Add menus -AddPermissions=Add permissions -AddExportProfiles=Add export profiles -AddImportProfiles=Add import profiles -AddOtherPagesOrServices=Add other pages or services -AddModels=Add document or numbering templates -AddSubstitutions=Add keys substitutions -DetectionNotPossible=Detection not possible -UrlToGetKeyToUseAPIs=Url to get token to use API (once token has been received it is saved in database user table and must be provided on each API call) -ListOfAvailableAPIs=List of available APIs -activateModuleDependNotSatisfied=Module "%s" depends on module "%s", that is missing, so module "%1$s" may not work correctly. Please install module "%2$s" or disable module "%1$s" if you want to be safe from any surprise -CommandIsNotInsideAllowedCommands=The command you are trying to run is not in the list of allowed commands defined in parameter $dolibarr_main_restrict_os_commands in the conf.php file. -LandingPage=Landing page -SamePriceAlsoForSharedCompanies=If you use a multicompany module, with the choice "Single price", the price will also be the same for all companies if products are shared between environments -ModuleEnabledAdminMustCheckRights=Module has been activated. Permissions for activated module(s) were given to admin users only. You may need to grant permissions to other users or groups manually if necessary. -UserHasNoPermissions=This user has no permissions defined -TypeCdr=Use "None" if the date of payment term is date of invoice plus a delta in days (delta is field "%s")
    Use "At end of month", if, after delta, the date must be increased to reach the end of month (+ an optional "%s" in days)
    Use "Current/Next" to have payment term date being the first Nth of the month after delta (delta is field "%s", N is stored into field "%s") -BaseCurrency=Reference currency of the company (go into setup of company to change this) -WarningNoteModuleInvoiceForFrenchLaw=This module %s is compliant with French laws (Loi Finance 2016). -WarningNoteModulePOSForFrenchLaw=This module %s is compliant with French laws (Loi Finance 2016) because module Non Reversible Logs is automatically activated. -WarningInstallationMayBecomeNotCompliantWithLaw=You are trying to install module %s that is an external module. Activating an external module means you trust the publisher of that module and that you are sure that this module does not adversely impact the behavior of your application, and is compliant with laws of your country (%s). If the module introduces an illegal feature, you become responsible for the use of illegal software. -MAIN_PDF_MARGIN_LEFT=Left margin on PDF -MAIN_PDF_MARGIN_RIGHT=Right margin on PDF -MAIN_PDF_MARGIN_TOP=Top margin on PDF -MAIN_PDF_MARGIN_BOTTOM=Bottom margin on PDF -MAIN_DOCUMENTS_LOGO_HEIGHT=Height for logo on PDF -MAIN_GENERATE_PROPOSALS_WITH_PICTURE=Add picture on proposal line -PROPOSAL_PDF_HIDE_PAYMENTTERM=Hide payments conditions -PROPOSAL_PDF_HIDE_PAYMENTMODE=Hide payment mode -MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING=Add electronic sign in PDF -NothingToSetup=There is no specific setup required for this module. -SetToYesIfGroupIsComputationOfOtherGroups=Set this to yes if this group is a computation of other groups -EnterCalculationRuleIfPreviousFieldIsYes=Enter calculation rule if previous field was set to Yes.
    For example:
    CODEGRP1+CODEGRP2 -SeveralLangugeVariatFound=Several language variants found -RemoveSpecialChars=Remove special characters -COMPANY_AQUARIUM_CLEAN_REGEX=Regex filter to clean value (COMPANY_AQUARIUM_CLEAN_REGEX) -COMPANY_DIGITARIA_CLEAN_REGEX=Regex filter to clean value (COMPANY_DIGITARIA_CLEAN_REGEX) -COMPANY_DIGITARIA_UNIQUE_CODE=Duplicate not allowed -GDPRContact=Data Protection Officer (DPO, Data Privacy or GDPR contact) -GDPRContactDesc=If you store data about European companies/citizens, you can name the contact who is responsible for the General Data Protection Regulation here -HelpOnTooltip=Help text to show on tooltip -HelpOnTooltipDesc=Put text or a translation key here for the text to show in a tooltip when this field appears in a form -YouCanDeleteFileOnServerWith=You can delete this file on the server with Command Line:
    %s -ChartLoaded=Chart of account loaded -SocialNetworkSetup=Setup of module Social Networks -EnableFeatureFor=Enable features for %s -VATIsUsedIsOff=Note: The option to use Sales Tax or VAT has been set to Off in the menu %s - %s, so Sales tax or Vat used will always be 0 for sales. -SwapSenderAndRecipientOnPDF=Swap sender and recipient address position on PDF documents -FeatureSupportedOnTextFieldsOnly=Warning, feature supported on text fields and combo lists only. Also an URL parameter action=create or action=edit must be set OR page name must end with 'new.php' to trigger this feature. -EmailCollector=Email collector -EmailCollectorDescription=Add a scheduled job and a setup page to scan regularly email boxes (using IMAP protocol) and record emails received into your application, at the right place and/or create some records automatically (like leads). -NewEmailCollector=New Email Collector -EMailHost=Host of email IMAP server -MailboxSourceDirectory=Mailbox source directory -MailboxTargetDirectory=Mailbox target directory -EmailcollectorOperations=Operations to do by collector -EmailcollectorOperationsDesc=Operations are executed from top to bottom order -MaxEmailCollectPerCollect=Max number of emails collected per collect -CollectNow=Collect now -ConfirmCloneEmailCollector=Are you sure you want to clone the Email collector %s ? -DateLastCollectResult=Date of latest collect try -DateLastcollectResultOk=Date of latest collect success -LastResult=Latest result -EmailCollectorConfirmCollectTitle=Email collect confirmation -EmailCollectorConfirmCollect=Do you want to run the collection for this collector now ? -NoNewEmailToProcess=No new email (matching filters) to process -NothingProcessed=Nothing done -XEmailsDoneYActionsDone=%s emails qualified, %s emails successfully processed (for %s record/actions done) -RecordEvent=Record email event -CreateLeadAndThirdParty=Create lead (and third party if necessary) -CreateTicketAndThirdParty=Create ticket (and link to third party if it was loaded by a previous operation) -CodeLastResult=Latest result code -NbOfEmailsInInbox=Number of emails in source directory -LoadThirdPartyFromName=Load third party searching on %s (load only) -LoadThirdPartyFromNameOrCreate=Load third party searching on %s (create if not found) -WithDolTrackingID=Message from a conversation initiated by a first email sent from Dolibarr -WithoutDolTrackingID=Message from a conversation initiated by a first email NOT sent from Dolibarr -WithDolTrackingIDInMsgId=Message sent from Dolibarr -WithoutDolTrackingIDInMsgId=Message NOT sent from Dolibarr -CreateCandidature=Create job application -FormatZip=Zip -MainMenuCode=Menu entry code (mainmenu) -ECMAutoTree=Show automatic ECM tree -OperationParamDesc=Define the values to use for the object of the action, or how to extract values. For example:
    objproperty1=SET:the value to set
    objproperty2=SET:a value with replacement of __objproperty1__
    objproperty3=SETIFEMPTY:value used if objproperty3 is not already defined
    objproperty4=EXTRACT:HEADER:X-Myheaderkey:\\s*([^\\s]*)
    options_myextrafield1=EXTRACT:SUBJECT:([^\n]*)
    object.objproperty5=EXTRACT:BODY:My company name is\\s([^\\s]*)

    Use a ; char as separator to extract or set several properties. -OpeningHours=Opening hours -OpeningHoursDesc=Enter here the regular opening hours of your company. -ResourceSetup=Configuration of Resource module -UseSearchToSelectResource=Use a search form to choose a resource (rather than a drop-down list). -DisabledResourceLinkUser=Disable feature to link a resource to users -DisabledResourceLinkContact=Disable feature to link a resource to contacts -EnableResourceUsedInEventCheck=Enable feature to check if a resource is in use in an event -ConfirmUnactivation=Confirm module reset -OnMobileOnly=On small screen (smartphone) only -DisableProspectCustomerType=Disable the "Prospect + Customer" third party type (so third party must be "Prospect" or "Customer", but can't be both) -MAIN_OPTIMIZEFORTEXTBROWSER=Simplify interface for blind person -MAIN_OPTIMIZEFORTEXTBROWSERDesc=Enable this option if you are a blind person, or if you use the application from a text browser like Lynx or Links. -MAIN_OPTIMIZEFORCOLORBLIND=Change interface's color for color blind person -MAIN_OPTIMIZEFORCOLORBLINDDesc=Enable this option if you are a color blind person, in some case interface will change color setup to increase contrast. -Protanopia=Protanopia -Deuteranopes=Deuteranopes -Tritanopes=Tritanopes -ThisValueCanOverwrittenOnUserLevel=This value can be overwritten by each user from its user page - tab '%s' -DefaultCustomerType=Default thirdparty type for "New customer" creation form -ABankAccountMustBeDefinedOnPaymentModeSetup=Note: The bank account must be defined on the module of each payment mode (Paypal, Stripe, ...) to have this feature working. -RootCategoryForProductsToSell=Root category of products to sell -RootCategoryForProductsToSellDesc=If defined, only products inside this category or childs of this category will be available in the Point Of Sale -DebugBar=Debug Bar -DebugBarDesc=Toolbar that comes with a plenty of tools to simplify debugging -DebugBarSetup=DebugBar Setup -GeneralOptions=General Options -LogsLinesNumber=Number of lines to show on logs tab -UseDebugBar=Use the debug bar -DEBUGBAR_LOGS_LINES_NUMBER=Number of last log lines to keep in console -WarningValueHigherSlowsDramaticalyOutput=Warning, higher values slows dramaticaly output -ModuleActivated=Module %s is activated and slows the interface -ModuleActivatedWithTooHighLogLevel=Module %s is activated with a too high logging level (try to use a lower level for better performances and security) -ModuleSyslogActivatedButLevelNotTooVerbose=Module %s is activated and log level (%s) is correct (not too verbose) -IfYouAreOnAProductionSetThis=If you are on a production environment, you should set this property to %s. -AntivirusEnabledOnUpload=Antivirus enabled on uploaded files -SomeFilesOrDirInRootAreWritable=Some files or directories are not in a read-only mode -EXPORTS_SHARE_MODELS=Export models are share with everybody -ExportSetup=Setup of module Export -ImportSetup=Setup of module Import -InstanceUniqueID=Unique ID of the instance -SmallerThan=Smaller than -LargerThan=Larger than -IfTrackingIDFoundEventWillBeLinked=Note that If a tracking ID of an object is found into email, or if the email is an answer of an email aready collected and linked to an object, the created event will be automatically linked to the known related object. -WithGMailYouCanCreateADedicatedPassword=With a GMail account, if you enabled the 2 steps validation, it is recommanded to create a dedicated second password for the application instead of using your own account passsword from https://myaccount.google.com/. -EmailCollectorTargetDir=It may be a desired behaviour to move the email into another tag/directory when it was processed successfully. Just set name of directory here to use this feature (Do NOT use special characters in name). Note that you must also use a read/write login account. -EmailCollectorLoadThirdPartyHelp=You can use this action to use the email content to find and load an existing thirdparty in your database. The found (or created) thirdparty will be used for following actions that need it.
    For example, if you want to create a thirdparty with a name extracted a string 'Name: name to find' found into the body, use sender email as email, you can set the parameter field like this:
    'email=HEADER:^From:(.*);name=EXTRACT:BODY:Name:\\s([^\\s]*);client=SET:2;'
    -EndPointFor=End point for %s : %s -DeleteEmailCollector=Delete email collector -ConfirmDeleteEmailCollector=Are you sure you want to delete this email collector? -RecipientEmailsWillBeReplacedWithThisValue=Recipient emails will be always replaced with this value -AtLeastOneDefaultBankAccountMandatory=At least 1 default bank account must be defined -RESTRICT_ON_IP=Allow access to some host IP only (wildcard not allowed, use space between values). Empty means every hosts can access. -IPListExample=127.0.0.1 192.168.0.2 [::1] -BaseOnSabeDavVersion=Based on the library SabreDAV version -NotAPublicIp=Not a public IP -MakeAnonymousPing=Make an anonymous Ping '+1' to the Dolibarr foundation server (done 1 time only after installation) to allow the foundation to count the number of Dolibarr installation. -FeatureNotAvailableWithReceptionModule=Feature not available when module Reception is enabled -EmailTemplate=Template for email -EMailsWillHaveMessageID=Emails will have a tag 'References' matching this syntax -PDF_SHOW_PROJECT=Show project on document -ShowProjectLabel=Project Label -PDF_USE_ALSO_LANGUAGE_CODE=If you want to have some texts in your PDF duplicated in 2 different languages in the same generated PDF, you must set here this second language so generated PDF will contains 2 different languages in same page, the one chosen when generating PDF and this one (only few PDF templates support this). Keep empty for 1 language per PDF. -FafaIconSocialNetworksDesc=Enter here the code of a FontAwesome icon. If you don't know what is FontAwesome, you can use the generic value fa-address-book. -RssNote=Note: Each RSS feed definition provides a widget that you must enable to have it available in dashboard -JumpToBoxes=Jump to Setup -> Widgets -MeasuringUnitTypeDesc=Use here a value like "size", "surface", "volume", "weight", "time" -MeasuringScaleDesc=The scale is the number of places you have to move the decimal part to match the default reference unit. For "time" unit type, it is the number of seconds. Values between 80 and 99 are reserved values. -TemplateAdded=Template added -TemplateUpdated=Template updated -TemplateDeleted=Template deleted -MailToSendEventPush=Event reminder email -SwitchThisForABetterSecurity=Switching this value to %s is recommended for more security -DictionaryProductNature= Nature of product -CountryIfSpecificToOneCountry=Country (if specific to a given country) -YouMayFindSecurityAdviceHere=You may find security advisory here -ModuleActivatedMayExposeInformation=This PHP extension may expose sensitive data. If you don't need it, disable it. -ModuleActivatedDoNotUseInProduction=A module designed for the development has been enabled. Do not enable it on a production environment. -CombinationsSeparator=Separator character for product combinations -SeeLinkToOnlineDocumentation=See link to online documention on top menu for examples -SHOW_SUBPRODUCT_REF_IN_PDF=If the feature "%s" of module %s is used, show details of subproducts of a kit on PDF. -AskThisIDToYourBank=Contact your bank to get this ID -AdvancedModeOnly=Permision available in Advanced permission mode only -ConfFileIsReadableOrWritableByAnyUsers=The conf file is readable or writable by any users. Give permission to web server user and group only. -MailToSendEventOrganization=Event Organization -MailToPartnership=Partnership -AGENDA_EVENT_DEFAULT_STATUS=Default event status when creating a event from the form -YouShouldDisablePHPFunctions=You should disable PHP functions -IfCLINotRequiredYouShouldDisablePHPFunctions=Except if you need to run system commands in custom code, you shoud disable PHP functions -PHPFunctionsRequiredForCLI=For shell purpose (like scheduled job backup or running an anitivurs program), you must keep PHP functions -NoWritableFilesFoundIntoRootDir=No writable files or directories of the common programs were found into your root directory (Good) -RecommendedValueIs=Recommended: %s -Recommended=Recommended -NotRecommended=Not recommended -ARestrictedPath=A restricted path -CheckForModuleUpdate=Check for external modules updates -CheckForModuleUpdateHelp=This action will connect to editors of external modules to check if a new version is available. -ModuleUpdateAvailable=An update is available -NoExternalModuleWithUpdate=No updates found for external modules -SwaggerDescriptionFile=Swagger API description file (for use with redoc for example) -YouEnableDeprecatedWSAPIsUseRESTAPIsInstead=You enabled deprecated WS API. You should use REST API instead. -RandomlySelectedIfSeveral=Randomly selected if several pictures are available -DatabasePasswordObfuscated=Database password is obfuscated in conf file -DatabasePasswordNotObfuscated=Database password is NOT obfuscated in conf file -APIsAreNotEnabled=APIs modules are not enabled -YouShouldSetThisToOff=You should set this to 0 or off -InstallAndUpgradeLockedBy=Install and upgrades are locked by the file %s -OldImplementation=Old implementation diff --git a/htdocs/langs/ar_IQ/agenda.lang b/htdocs/langs/ar_IQ/agenda.lang deleted file mode 100644 index a1183841b00..00000000000 --- a/htdocs/langs/ar_IQ/agenda.lang +++ /dev/null @@ -1,172 +0,0 @@ -# Dolibarr language file - Source file is en_US - agenda -IdAgenda=ID event -Actions=Events -Agenda=Agenda -TMenuAgenda=Agenda -Agendas=Agendas -LocalAgenda=Default calendar -ActionsOwnedBy=Event owned by -ActionsOwnedByShort=Owner -AffectedTo=Assigned to -Event=Event -Events=Events -EventsNb=Number of events -ListOfActions=List of events -EventReports=Event reports -Location=Location -ToUserOfGroup=Event assigned to any user in the group -EventOnFullDay=Event on all day(s) -MenuToDoActions=All incomplete events -MenuDoneActions=All terminated events -MenuToDoMyActions=My incomplete events -MenuDoneMyActions=My terminated events -ListOfEvents=List of events (default calendar) -ActionsAskedBy=Events reported by -ActionsToDoBy=Events assigned to -ActionsDoneBy=Events done by -ActionAssignedTo=Event assigned to -ViewCal=Month view -ViewDay=Day view -ViewWeek=Week view -ViewPerUser=Per user view -ViewPerType=Per type view -AutoActions= Automatic filling -AgendaAutoActionDesc= Here you may define events which you want Dolibarr to create automatically in Agenda. If nothing is checked, only manual actions will be included in logs and displayed in Agenda. Automatic tracking of business actions done on objects (validation, status change) will not be saved. -AgendaSetupOtherDesc= This page provides options to allow the export of your Dolibarr events into an external calendar (Thunderbird, Google Calendar etc...) -AgendaExtSitesDesc=This page allows to declare external sources of calendars to see their events into Dolibarr agenda. -ActionsEvents=Events for which Dolibarr will create an action in agenda automatically -EventRemindersByEmailNotEnabled=Event reminders by email was not enabled into %s module setup. -##### Agenda event labels ##### -NewCompanyToDolibarr=Third party %s created -COMPANY_MODIFYInDolibarr=Third party %s modified -COMPANY_DELETEInDolibarr=Third party %s deleted -ContractValidatedInDolibarr=Contract %s validated -CONTRACT_DELETEInDolibarr=Contract %s deleted -PropalClosedSignedInDolibarr=Proposal %s signed -PropalClosedRefusedInDolibarr=Proposal %s refused -PropalValidatedInDolibarr=Proposal %s validated -PropalClassifiedBilledInDolibarr=Proposal %s classified billed -InvoiceValidatedInDolibarr=Invoice %s validated -InvoiceValidatedInDolibarrFromPos=Invoice %s validated from POS -InvoiceBackToDraftInDolibarr=Invoice %s go back to draft status -InvoiceDeleteDolibarr=Invoice %s deleted -InvoicePaidInDolibarr=Invoice %s changed to paid -InvoiceCanceledInDolibarr=Invoice %s canceled -MemberValidatedInDolibarr=Member %s validated -MemberModifiedInDolibarr=Member %s modified -MemberResiliatedInDolibarr=Member %s terminated -MemberDeletedInDolibarr=Member %s deleted -MemberSubscriptionAddedInDolibarr=Subscription %s for member %s added -MemberSubscriptionModifiedInDolibarr=Subscription %s for member %s modified -MemberSubscriptionDeletedInDolibarr=Subscription %s for member %s deleted -ShipmentValidatedInDolibarr=Shipment %s validated -ShipmentClassifyClosedInDolibarr=Shipment %s classified billed -ShipmentUnClassifyCloseddInDolibarr=Shipment %s classified re-open -ShipmentBackToDraftInDolibarr=Shipment %s go back to draft status -ShipmentDeletedInDolibarr=Shipment %s deleted -ReceptionValidatedInDolibarr=Reception %s validated -OrderCreatedInDolibarr=Order %s created -OrderValidatedInDolibarr=Order %s validated -OrderDeliveredInDolibarr=Order %s classified delivered -OrderCanceledInDolibarr=Order %s canceled -OrderBilledInDolibarr=Order %s classified billed -OrderApprovedInDolibarr=Order %s approved -OrderRefusedInDolibarr=Order %s refused -OrderBackToDraftInDolibarr=Order %s go back to draft status -ProposalSentByEMail=Commercial proposal %s sent by email -ContractSentByEMail=Contract %s sent by email -OrderSentByEMail=Sales order %s sent by email -InvoiceSentByEMail=Customer invoice %s sent by email -SupplierOrderSentByEMail=Purchase order %s sent by email -ORDER_SUPPLIER_DELETEInDolibarr=Purchase order %s deleted -SupplierInvoiceSentByEMail=Vendor invoice %s sent by email -ShippingSentByEMail=Shipment %s sent by email -ShippingValidated= Shipment %s validated -InterventionSentByEMail=Intervention %s sent by email -ProposalDeleted=Proposal deleted -OrderDeleted=Order deleted -InvoiceDeleted=Invoice deleted -DraftInvoiceDeleted=Draft invoice deleted -CONTACT_CREATEInDolibarr=Contact %s created -CONTACT_MODIFYInDolibarr=Contact %s modified -CONTACT_DELETEInDolibarr=Contact %s deleted -PRODUCT_CREATEInDolibarr=Product %s created -PRODUCT_MODIFYInDolibarr=Product %s modified -PRODUCT_DELETEInDolibarr=Product %s deleted -HOLIDAY_CREATEInDolibarr=Request for leave %s created -HOLIDAY_MODIFYInDolibarr=Request for leave %s modified -HOLIDAY_APPROVEInDolibarr=Request for leave %s approved -HOLIDAY_VALIDATEInDolibarr=Request for leave %s validated -HOLIDAY_DELETEInDolibarr=Request for leave %s deleted -EXPENSE_REPORT_CREATEInDolibarr=Expense report %s created -EXPENSE_REPORT_VALIDATEInDolibarr=Expense report %s validated -EXPENSE_REPORT_APPROVEInDolibarr=Expense report %s approved -EXPENSE_REPORT_DELETEInDolibarr=Expense report %s deleted -EXPENSE_REPORT_REFUSEDInDolibarr=Expense report %s refused -PROJECT_CREATEInDolibarr=Project %s created -PROJECT_MODIFYInDolibarr=Project %s modified -PROJECT_DELETEInDolibarr=Project %s deleted -TICKET_CREATEInDolibarr=Ticket %s created -TICKET_MODIFYInDolibarr=Ticket %s modified -TICKET_ASSIGNEDInDolibarr=Ticket %s assigned -TICKET_CLOSEInDolibarr=Ticket %s closed -TICKET_DELETEInDolibarr=Ticket %s deleted -BOM_VALIDATEInDolibarr=BOM validated -BOM_UNVALIDATEInDolibarr=BOM unvalidated -BOM_CLOSEInDolibarr=BOM disabled -BOM_REOPENInDolibarr=BOM reopen -BOM_DELETEInDolibarr=BOM deleted -MRP_MO_VALIDATEInDolibarr=MO validated -MRP_MO_UNVALIDATEInDolibarr=MO set to draft status -MRP_MO_PRODUCEDInDolibarr=MO produced -MRP_MO_DELETEInDolibarr=MO deleted -MRP_MO_CANCELInDolibarr=MO canceled -PAIDInDolibarr=%s paid -##### End agenda events ##### -AgendaModelModule=Document templates for event -DateActionStart=Start date -DateActionEnd=End date -AgendaUrlOptions1=You can also add following parameters to filter output: -AgendaUrlOptions3=logina=%s to restrict output to actions owned by a user %s. -AgendaUrlOptionsNotAdmin=logina=!%s to restrict output to actions not owned by user %s. -AgendaUrlOptions4=logint=%s to restrict output to actions assigned to user %s (owner and others). -AgendaUrlOptionsProject=project=__PROJECT_ID__ to restrict output to actions linked to project __PROJECT_ID__. -AgendaUrlOptionsNotAutoEvent=notactiontype=systemauto to exclude automatic events. -AgendaUrlOptionsIncludeHolidays=includeholidays=1 to include events of holidays. -AgendaShowBirthdayEvents=Birthdays of contacts -AgendaHideBirthdayEvents=Hide birthdays of contacts -Busy=Busy -ExportDataset_event1=List of agenda events -DefaultWorkingDays=Default working days range in week (Example: 1-5, 1-6) -DefaultWorkingHours=Default working hours in day (Example: 9-18) -# External Sites ical -ExportCal=Export calendar -ExtSites=Import external calendars -ExtSitesEnableThisTool=Show external calendars (defined in global setup) in Agenda. Does not affect external calendars defined by users. -ExtSitesNbOfAgenda=Number of calendars -AgendaExtNb=Calendar no. %s -ExtSiteUrlAgenda=URL to access .ical file -ExtSiteNoLabel=No Description -VisibleTimeRange=Visible time range -VisibleDaysRange=Visible days range -AddEvent=Create event -MyAvailability=My availability -ActionType=Event type -DateActionBegin=Start event date -ConfirmCloneEvent=Are you sure you want to clone the event %s? -RepeatEvent=Repeat event -OnceOnly=Once only -EveryWeek=Every week -EveryMonth=Every month -DayOfMonth=Day of month -DayOfWeek=Day of week -DateStartPlusOne=Date start + 1 hour -SetAllEventsToTodo=Set all events to todo -SetAllEventsToInProgress=Set all events to in progress -SetAllEventsToFinished=Set all events to finished -ReminderTime=Reminder period before the event -TimeType=Duration type -ReminderType=Callback type -AddReminder=Create an automatic reminder notification for this event -ErrorReminderActionCommCreation=Error creating the reminder notification for this event -BrowserPush=Browser Popup Notification diff --git a/htdocs/langs/ar_IQ/assets.lang b/htdocs/langs/ar_IQ/assets.lang deleted file mode 100644 index afafc98503f..00000000000 --- a/htdocs/langs/ar_IQ/assets.lang +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright (C) 2018 Alexandre Spangaro -# -# 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 . - -# -# Generic -# -Assets = Assets -NewAsset = New asset -AccountancyCodeAsset = Accounting code (asset) -AccountancyCodeDepreciationAsset = Accounting code (depreciation asset account) -AccountancyCodeDepreciationExpense = Accounting code (depreciation expense account) -NewAssetType=New asset type -AssetsTypeSetup=Asset type setup -AssetTypeModified=Asset type modified -AssetType=Asset type -AssetsLines=Assets -DeleteType=Delete -DeleteAnAssetType=Delete an asset type -ConfirmDeleteAssetType=Are you sure you want to delete this asset type? -ShowTypeCard=Show type '%s' - -# Module label 'ModuleAssetsName' -ModuleAssetsName = Assets -# Module description 'ModuleAssetsDesc' -ModuleAssetsDesc = Assets description - -# -# Admin page -# -AssetsSetup = Assets setup -Settings = Settings -AssetsSetupPage = Assets setup page -ExtraFieldsAssetsType = Complementary attributes (Asset type) -AssetsType=Asset type -AssetsTypeId=Asset type id -AssetsTypeLabel=Asset type label -AssetsTypes=Assets types - -# -# Menu -# -MenuAssets = Assets -MenuNewAsset = New asset -MenuTypeAssets = Type assets -MenuListAssets = List -MenuNewTypeAssets = New -MenuListTypeAssets = List - -# -# Module -# -Asset=Asset -NewAssetType=New asset type -NewAsset=New asset -ConfirmDeleteAsset=Are you sure you want to delete this asset ? diff --git a/htdocs/langs/ar_IQ/banks.lang b/htdocs/langs/ar_IQ/banks.lang deleted file mode 100644 index a0b7942d446..00000000000 --- a/htdocs/langs/ar_IQ/banks.lang +++ /dev/null @@ -1,184 +0,0 @@ -# Dolibarr language file - Source file is en_US - banks -Bank=Bank -MenuBankCash=Banks | Cash -MenuVariousPayment=Miscellaneous payments -MenuNewVariousPayment=New Miscellaneous payment -BankName=Bank name -FinancialAccount=Account -BankAccount=Bank account -BankAccounts=Bank accounts -BankAccountsAndGateways=Bank accounts | Gateways -ShowAccount=Show Account -AccountRef=Financial account ref -AccountLabel=Financial account label -CashAccount=Cash account -CashAccounts=Cash accounts -CurrentAccounts=Current accounts -SavingAccounts=Savings accounts -ErrorBankLabelAlreadyExists=Financial account label already exists -BankBalance=Balance -BankBalanceBefore=Balance before -BankBalanceAfter=Balance after -BalanceMinimalAllowed=Minimum allowed balance -BalanceMinimalDesired=Minimum desired balance -InitialBankBalance=Initial balance -EndBankBalance=End balance -CurrentBalance=Current balance -FutureBalance=Future balance -ShowAllTimeBalance=Show balance from start -AllTime=From start -Reconciliation=Reconciliation -RIB=Bank Account Number -IBAN=IBAN number -BIC=BIC/SWIFT code -SwiftValid=BIC/SWIFT valid -SwiftVNotalid=BIC/SWIFT not valid -IbanValid=BAN valid -IbanNotValid=BAN not valid -StandingOrders=Direct debit orders -StandingOrder=Direct debit order -PaymentByDirectDebit=Payment by direct debit -PaymentByBankTransfers=Payments by credit transfer -PaymentByBankTransfer=Payment by credit transfer -AccountStatement=Account statement -AccountStatementShort=Statement -AccountStatements=Account statements -LastAccountStatements=Last account statements -IOMonthlyReporting=Monthly reporting -BankAccountDomiciliation=Bank address -BankAccountCountry=Account country -BankAccountOwner=Account owner name -BankAccountOwnerAddress=Account owner address -RIBControlError=Integrity check of values failed. This means the information for this account number is not complete or is incorrect (check country, numbers and IBAN). -CreateAccount=Create account -NewBankAccount=New account -NewFinancialAccount=New financial account -MenuNewFinancialAccount=New financial account -EditFinancialAccount=Edit account -LabelBankCashAccount=Bank or cash label -AccountType=Account type -BankType0=Savings account -BankType1=Current or credit card account -BankType2=Cash account -AccountsArea=Accounts area -AccountCard=Account card -DeleteAccount=Delete account -ConfirmDeleteAccount=Are you sure you want to delete this account? -Account=Account -BankTransactionByCategories=Bank entries by categories -BankTransactionForCategory=Bank entries for category %s -RemoveFromRubrique=Remove link with category -RemoveFromRubriqueConfirm=Are you sure you want to remove link between the entry and the category? -ListBankTransactions=List of bank entries -IdTransaction=Transaction ID -BankTransactions=Bank entries -BankTransaction=Bank entry -ListTransactions=List entries -ListTransactionsByCategory=List entries/category -TransactionsToConciliate=Entries to reconcile -TransactionsToConciliateShort=To reconcile -Conciliable=Can be reconciled -Conciliate=Reconcile -Conciliation=Reconciliation -SaveStatementOnly=Save statement only -ReconciliationLate=Reconciliation late -IncludeClosedAccount=Include closed accounts -OnlyOpenedAccount=Only open accounts -AccountToCredit=Account to credit -AccountToDebit=Account to debit -DisableConciliation=Disable reconciliation feature for this account -ConciliationDisabled=Reconciliation feature disabled -LinkedToAConciliatedTransaction=Linked to a conciliated entry -StatusAccountOpened=Open -StatusAccountClosed=Closed -AccountIdShort=Number -LineRecord=Transaction -AddBankRecord=Add entry -AddBankRecordLong=Add entry manually -Conciliated=Reconciled -ConciliatedBy=Reconciled by -DateConciliating=Reconcile date -BankLineConciliated=Entry reconciled with bank receipt -Reconciled=Reconciled -NotReconciled=Not reconciled -CustomerInvoicePayment=Customer payment -SupplierInvoicePayment=Vendor payment -SubscriptionPayment=Subscription payment -WithdrawalPayment=Debit payment order -SocialContributionPayment=Social/fiscal tax payment -BankTransfer=Credit transfer -BankTransfers=Credit transfers -MenuBankInternalTransfer=Internal transfer -TransferDesc=Use internal transfer to transfer from one account to another, the application will write two records: a debit in the source account and a credit in the target account. The same amount, label and date will be used for this transaction. -TransferFrom=From -TransferTo=To -TransferFromToDone=A transfer from %s to %s of %s %s has been recorded. -CheckTransmitter=Sender -ValidateCheckReceipt=Validate this check receipt? -ConfirmValidateCheckReceipt=Are you sure that you want to submit this check receipt for validation? No changes will be possible once validated. -DeleteCheckReceipt=Delete this check receipt? -ConfirmDeleteCheckReceipt=Are you sure you want to delete this check receipt? -BankChecks=Bank checks -BankChecksToReceipt=Checks awaiting deposit -BankChecksToReceiptShort=Checks awaiting deposit -ShowCheckReceipt=Show check deposit receipt -NumberOfCheques=No. of check -DeleteTransaction=Delete entry -ConfirmDeleteTransaction=Are you sure you want to delete this entry? -ThisWillAlsoDeleteBankRecord=This will also delete generated bank entry -BankMovements=Movements -PlannedTransactions=Planned entries -Graph=Graphs -ExportDataset_banque_1=Bank entries and account statement -ExportDataset_banque_2=Deposit slip -TransactionOnTheOtherAccount=Transaction on the other account -PaymentNumberUpdateSucceeded=Payment number updated successfully -PaymentNumberUpdateFailed=Payment number could not be updated -PaymentDateUpdateSucceeded=Payment date updated successfully -PaymentDateUpdateFailed=Payment date could not be updated -Transactions=Transactions -BankTransactionLine=Bank entry -AllAccounts=All bank and cash accounts -BackToAccount=Back to account -ShowAllAccounts=Show for all accounts -FutureTransaction=Future transaction. Unable to reconcile. -SelectChequeTransactionAndGenerate=Select/filter the checks which are to be included in the check deposit receipt. Then, click on "Create". -InputReceiptNumber=Choose the bank statement related with the conciliation. Use a sortable numeric value: YYYYMM or YYYYMMDD -EventualyAddCategory=Eventually, specify a category in which to classify the records -ToConciliate=To reconcile? -ThenCheckLinesAndConciliate=Then, check the lines present in the bank statement and click -DefaultRIB=Default BAN -AllRIB=All BAN -LabelRIB=BAN Label -NoBANRecord=No BAN record -DeleteARib=Delete BAN record -ConfirmDeleteRib=Are you sure you want to delete this BAN record? -RejectCheck=Check returned -ConfirmRejectCheck=Are you sure you want to mark this check as rejected? -RejectCheckDate=Date the check was returned -CheckRejected=Check returned -CheckRejectedAndInvoicesReopened=Check returned and invoices re-open -BankAccountModelModule=Document templates for bank accounts -DocumentModelSepaMandate=Template of SEPA mandate. Useful for European countries in EEC only. -DocumentModelBan=Template to print a page with BAN information. -NewVariousPayment=New miscellaneous payment -VariousPayment=Miscellaneous payment -VariousPayments=Miscellaneous payments -ShowVariousPayment=Show miscellaneous payment -AddVariousPayment=Add miscellaneous payment -VariousPaymentId=Miscellaneous payment ID -VariousPaymentLabel=Miscellaneous payment label -ConfirmCloneVariousPayment=Confirm the clone of a miscellaneous payment -SEPAMandate=SEPA mandate -YourSEPAMandate=Your SEPA mandate -FindYourSEPAMandate=This is your SEPA mandate to authorize our company to make direct debit order to your bank. Return it signed (scan of the signed document) or send it by mail to -AutoReportLastAccountStatement=Automatically fill the field 'number of bank statement' with last statement number when making reconciliation -CashControl=POS cash desk control -NewCashFence=New cash desk opening or closing -BankColorizeMovement=Colorize movements -BankColorizeMovementDesc=If this function is enable, you can choose specific background color for debit or credit movements -BankColorizeMovementName1=Background color for debit movement -BankColorizeMovementName2=Background color for credit movement -IfYouDontReconcileDisableProperty=If you don't make the bank reconciliations on some bank accounts, disable the property "%s" on them to remove this warning. -NoBankAccountDefined=No bank account defined -NoRecordFoundIBankcAccount=No record found in bank account. Commonly, this occurs when a record has been deleted manually from the list of transaction in the bank account (for example during a reconciliation of the bank account). Another reason is that the payment was recorded when the module "%s" was disabled. diff --git a/htdocs/langs/ar_IQ/bills.lang b/htdocs/langs/ar_IQ/bills.lang index 7b8c997d2e6..a1d32f56bd5 100644 --- a/htdocs/langs/ar_IQ/bills.lang +++ b/htdocs/langs/ar_IQ/bills.lang @@ -1,593 +1,2 @@ # Dolibarr language file - Source file is en_US - bills -Bill=Invoice -Bills=Invoices -BillsCustomers=Customer invoices -BillsCustomer=Customer invoice -BillsSuppliers=Vendor invoices -BillsCustomersUnpaid=Unpaid customer invoices -BillsCustomersUnpaidForCompany=Unpaid customer invoices for %s -BillsSuppliersUnpaid=Unpaid vendor invoices -BillsSuppliersUnpaidForCompany=Unpaid vendors invoices for %s -BillsLate=Late payments -BillsStatistics=Customers invoices statistics -BillsStatisticsSuppliers=Vendors invoices statistics -DisabledBecauseDispatchedInBookkeeping=Disabled because invoice was dispatched into bookkeeping -DisabledBecauseNotLastInvoice=Disabled because invoice is not erasable. Some invoices were recorded after this one and it will create holes in the counter. -DisabledBecauseNotErasable=Disabled because cannot be erased -InvoiceStandard=Standard invoice -InvoiceStandardAsk=Standard invoice -InvoiceStandardDesc=This kind of invoice is the common invoice. -InvoiceDeposit=Down payment invoice -InvoiceDepositAsk=Down payment invoice -InvoiceDepositDesc=This kind of invoice is done when a down payment has been received. -InvoiceProForma=Proforma invoice -InvoiceProFormaAsk=Proforma invoice -InvoiceProFormaDesc=Proforma invoice is an image of a true invoice but has no accountancy value. -InvoiceReplacement=Replacement invoice -InvoiceReplacementAsk=Replacement invoice for invoice -InvoiceReplacementDesc=Replacement invoice is used to completely replace an invoice with no payment already received.

    Note: Only invoices with no payment on it can be replaced. If the invoice you replace is not yet closed, it will be automatically closed to 'abandoned'. -InvoiceAvoir=Credit note -InvoiceAvoirAsk=Credit note to correct invoice -InvoiceAvoirDesc=The credit note is a negative invoice used to correct the fact that an invoice shows an amount that differs from the amount actually paid (eg the customer paid too much by mistake, or will not pay the complete amount since some products were returned). -invoiceAvoirWithLines=Create Credit Note with lines from the origin invoice -invoiceAvoirWithPaymentRestAmount=Create Credit Note with remaining unpaid of origin invoice -invoiceAvoirLineWithPaymentRestAmount=Credit Note for remaining unpaid amount -ReplaceInvoice=Replace invoice %s -ReplacementInvoice=Replacement invoice -ReplacedByInvoice=Replaced by invoice %s -ReplacementByInvoice=Replaced by invoice -CorrectInvoice=Correct invoice %s -CorrectionInvoice=Correction invoice -UsedByInvoice=Used to pay invoice %s -ConsumedBy=Consumed by -NotConsumed=Not consumed -NoReplacableInvoice=No replaceable invoices -NoInvoiceToCorrect=No invoice to correct -InvoiceHasAvoir=Was source of one or several credit notes -CardBill=Invoice card -PredefinedInvoices=Predefined Invoices -Invoice=Invoice -PdfInvoiceTitle=Invoice -Invoices=Invoices -InvoiceLine=Invoice line -InvoiceCustomer=Customer invoice -CustomerInvoice=Customer invoice -CustomersInvoices=Customer invoices -SupplierInvoice=Vendor invoice -SuppliersInvoices=Vendor invoices -SupplierInvoiceLines=Vendor invoice lines -SupplierBill=Vendor invoice -SupplierBills=Vendor invoices -Payment=Payment -PaymentBack=Refund -CustomerInvoicePaymentBack=Refund -Payments=Payments -PaymentsBack=Refunds -paymentInInvoiceCurrency=in invoices currency -PaidBack=Paid back -DeletePayment=Delete payment -ConfirmDeletePayment=Are you sure you want to delete this payment? -ConfirmConvertToReduc=Do you want to convert this %s into an available credit? -ConfirmConvertToReduc2=The amount will be saved among all discounts and could be used as a discount for a current or a future invoice for this customer. -ConfirmConvertToReducSupplier=Do you want to convert this %s into an available credit? -ConfirmConvertToReducSupplier2=The amount will be saved among all discounts and could be used as a discount for a current or a future invoice for this vendor. -SupplierPayments=Vendor payments -ReceivedPayments=Received payments -ReceivedCustomersPayments=Payments received from customers -PayedSuppliersPayments=Payments paid to vendors -ReceivedCustomersPaymentsToValid=Received customers payments to validate -PaymentsReportsForYear=Payments reports for %s -PaymentsReports=Payments reports -PaymentsAlreadyDone=Payments already done -PaymentsBackAlreadyDone=Refunds already done -PaymentRule=Payment rule -PaymentMode=Payment Type -DefaultPaymentMode=Default Payment Type -DefaultBankAccount=Default Bank Account -PaymentTypeDC=Debit/Credit Card -PaymentTypePP=PayPal -IdPaymentMode=Payment Type (id) -CodePaymentMode=Payment Type (code) -LabelPaymentMode=Payment Type (label) -PaymentModeShort=Payment Type -PaymentTerm=Payment Term -PaymentConditions=Payment Terms -PaymentConditionsShort=Payment Terms -PaymentAmount=Payment amount -PaymentHigherThanReminderToPay=Payment higher than reminder to pay -HelpPaymentHigherThanReminderToPay=Attention, the payment amount of one or more bills is higher than the outstanding amount to pay.
    Edit your entry, otherwise confirm and consider creating a credit note for the excess received for each overpaid invoice. -HelpPaymentHigherThanReminderToPaySupplier=Attention, the payment amount of one or more bills is higher than the outstanding amount to pay.
    Edit your entry, otherwise confirm and consider creating a credit note for the excess paid for each overpaid invoice. -ClassifyPaid=Classify 'Paid' -ClassifyUnPaid=Classify 'Unpaid' -ClassifyPaidPartially=Classify 'Paid partially' -ClassifyCanceled=Classify 'Abandoned' -ClassifyClosed=Classify 'Closed' -ClassifyUnBilled=Classify 'Unbilled' -CreateBill=Create Invoice -CreateCreditNote=Create credit note -AddBill=Create invoice or credit note -AddToDraftInvoices=Add to draft invoice -DeleteBill=Delete invoice -SearchACustomerInvoice=Search for a customer invoice -SearchASupplierInvoice=Search for a vendor invoice -CancelBill=Cancel an invoice -SendRemindByMail=Send reminder by email -DoPayment=Enter payment -DoPaymentBack=Enter refund -ConvertToReduc=Mark as credit available -ConvertExcessReceivedToReduc=Convert excess received into available credit -ConvertExcessPaidToReduc=Convert excess paid into available discount -EnterPaymentReceivedFromCustomer=Enter payment received from customer -EnterPaymentDueToCustomer=Make payment due to customer -DisabledBecauseRemainderToPayIsZero=Disabled because remaining unpaid is zero -PriceBase=Base price -BillStatus=Invoice status -StatusOfGeneratedInvoices=Status of generated invoices -BillStatusDraft=Draft (needs to be validated) -BillStatusPaid=Paid -BillStatusPaidBackOrConverted=Credit note refund or marked as credit available -BillStatusConverted=Paid (ready for consumption in final invoice) -BillStatusCanceled=Abandoned -BillStatusValidated=Validated (needs to be paid) -BillStatusStarted=Started -BillStatusNotPaid=Not paid -BillStatusNotRefunded=Not refunded -BillStatusClosedUnpaid=Closed (unpaid) -BillStatusClosedPaidPartially=Paid (partially) -BillShortStatusDraft=Draft -BillShortStatusPaid=Paid -BillShortStatusPaidBackOrConverted=Refunded or converted -Refunded=Refunded -BillShortStatusConverted=Paid -BillShortStatusCanceled=Abandoned -BillShortStatusValidated=Validated -BillShortStatusStarted=Started -BillShortStatusNotPaid=Not paid -BillShortStatusNotRefunded=Not refunded -BillShortStatusClosedUnpaid=Closed -BillShortStatusClosedPaidPartially=Paid (partially) -PaymentStatusToValidShort=To validate -ErrorVATIntraNotConfigured=Intra-Community VAT number not yet defined -ErrorNoPaiementModeConfigured=No default payment type defined. Go to Invoice module setup to fix this. -ErrorCreateBankAccount=Create a bank account, then go to Setup panel of Invoice module to define payment types -ErrorBillNotFound=Invoice %s does not exist -ErrorInvoiceAlreadyReplaced=Error, you tried to validate an invoice to replace invoice %s. But this one has already been replaced by invoice %s. -ErrorDiscountAlreadyUsed=Error, discount already used -ErrorInvoiceAvoirMustBeNegative=Error, correct invoice must have a negative amount -ErrorInvoiceOfThisTypeMustBePositive=Error, this type of invoice must have an amount excluding tax positive (or null) -ErrorCantCancelIfReplacementInvoiceNotValidated=Error, can't cancel an invoice that has been replaced by another invoice that is still in draft status -ErrorThisPartOrAnotherIsAlreadyUsedSoDiscountSerieCantBeRemoved=This part or another is already used so discount series cannot be removed. -BillFrom=From -BillTo=To -ActionsOnBill=Actions on invoice -RecurringInvoiceTemplate=Template / Recurring invoice -NoQualifiedRecurringInvoiceTemplateFound=No recurring template invoice qualified for generation. -FoundXQualifiedRecurringInvoiceTemplate=Found %s recurring template invoice(s) qualified for generation. -NotARecurringInvoiceTemplate=Not a recurring template invoice -NewBill=New invoice -LastBills=Latest %s invoices -LatestTemplateInvoices=Latest %s template invoices -LatestCustomerTemplateInvoices=Latest %s customer template invoices -LatestSupplierTemplateInvoices=Latest %s vendor template invoices -LastCustomersBills=Latest %s customer invoices -LastSuppliersBills=Latest %s vendor invoices -AllBills=All invoices -AllCustomerTemplateInvoices=All template invoices -OtherBills=Other invoices -DraftBills=Draft invoices -CustomersDraftInvoices=Customer draft invoices -SuppliersDraftInvoices=Vendor draft invoices -Unpaid=Unpaid -ErrorNoPaymentDefined=Error No payment defined -ConfirmDeleteBill=Are you sure you want to delete this invoice? -ConfirmValidateBill=Are you sure you want to validate this invoice with reference %s? -ConfirmUnvalidateBill=Are you sure you want to change invoice %s to draft status? -ConfirmClassifyPaidBill=Are you sure you want to change invoice %s to status paid? -ConfirmCancelBill=Are you sure you want to cancel invoice %s? -ConfirmCancelBillQuestion=Why do you want to classify this invoice 'abandoned'? -ConfirmClassifyPaidPartially=Are you sure you want to change invoice %s to status paid? -ConfirmClassifyPaidPartiallyQuestion=This invoice has not been paid completely. What is the reason for closing this invoice? -ConfirmClassifyPaidPartiallyReasonAvoir=Remaining unpaid (%s %s) is a discount granted because payment was made before term. I regularize the VAT with a credit note. -ConfirmClassifyPaidPartiallyReasonDiscount=Remaining unpaid (%s %s) is a discount granted because payment was made before term. -ConfirmClassifyPaidPartiallyReasonDiscountNoVat=Remaining unpaid (%s %s) is a discount granted because payment was made before term. I accept to lose the VAT on this discount. -ConfirmClassifyPaidPartiallyReasonDiscountVat=Remaining unpaid (%s %s) is a discount granted because payment was made before term. I recover the VAT on this discount without a credit note. -ConfirmClassifyPaidPartiallyReasonBadCustomer=Bad customer -ConfirmClassifyPaidPartiallyReasonProductReturned=Products partially returned -ConfirmClassifyPaidPartiallyReasonOther=Amount abandoned for other reason -ConfirmClassifyPaidPartiallyReasonDiscountNoVatDesc=This choice is possible if your invoice has been provided with suitable comments. (Example «Only the tax corresponding to the price that has been actually paid gives rights to deduction») -ConfirmClassifyPaidPartiallyReasonDiscountVatDesc=In some countries, this choice might be possible only if your invoice contains correct notes. -ConfirmClassifyPaidPartiallyReasonAvoirDesc=Use this choice if all other does not suit -ConfirmClassifyPaidPartiallyReasonBadCustomerDesc=A bad customer is a customer that refuses to pay his debt. -ConfirmClassifyPaidPartiallyReasonProductReturnedDesc=This choice is used when payment is not complete because some of products were returned -ConfirmClassifyPaidPartiallyReasonOtherDesc=Use this choice if all others are not suitable, for example in following situation:
    - payment not complete because some products were shipped back
    - amount claimed too important because a discount was forgotten
    In all cases, amount over-claimed must be corrected in accountancy system by creating a credit note. -ConfirmClassifyAbandonReasonOther=Other -ConfirmClassifyAbandonReasonOtherDesc=This choice will be used in all other cases. For example because you plan to create a replacing invoice. -ConfirmCustomerPayment=Do you confirm this payment input for %s %s? -ConfirmSupplierPayment=Do you confirm this payment input for %s %s? -ConfirmValidatePayment=Are you sure you want to validate this payment? No change can be made once payment is validated. -ValidateBill=Validate invoice -UnvalidateBill=Unvalidate invoice -NumberOfBills=No. of invoices -NumberOfBillsByMonth=No. of invoices per month -AmountOfBills=Amount of invoices -AmountOfBillsHT=Amount of invoices (net of tax) -AmountOfBillsByMonthHT=Amount of invoices by month (net of tax) -UseSituationInvoices=Allow situation invoice -UseSituationInvoicesCreditNote=Allow situation invoice credit note -Retainedwarranty=Retained warranty -AllowedInvoiceForRetainedWarranty=Retained warranty usable on the following types of invoices -RetainedwarrantyDefaultPercent=Retained warranty default percent -RetainedwarrantyOnlyForSituation=Make "retained warranty" available only for situation invoices -RetainedwarrantyOnlyForSituationFinal=On situation invoices the global "retained warranty" deduction is applied only on the final situation -ToPayOn=To pay on %s -toPayOn=to pay on %s -RetainedWarranty=Retained Warranty -PaymentConditionsShortRetainedWarranty=Retained warranty payment terms -DefaultPaymentConditionsRetainedWarranty=Default retained warranty payment terms -setPaymentConditionsShortRetainedWarranty=Set retained warranty payment terms -setretainedwarranty=Set retained warranty -setretainedwarrantyDateLimit=Set retained warranty date limit -RetainedWarrantyDateLimit=Retained warranty date limit -RetainedWarrantyNeed100Percent=The situation invoice need to be at 100%% progress to be displayed on PDF -AlreadyPaid=Already paid -AlreadyPaidBack=Already paid back -AlreadyPaidNoCreditNotesNoDeposits=Already paid (without credit notes and down payments) -Abandoned=Abandoned -RemainderToPay=Remaining unpaid -RemainderToTake=Remaining amount to take -RemainderToPayBack=Remaining amount to refund -Rest=Pending -AmountExpected=Amount claimed -ExcessReceived=Excess received -ExcessPaid=Excess paid -EscompteOffered=Discount offered (payment before term) -EscompteOfferedShort=Discount -SendBillRef=Submission of invoice %s -SendReminderBillRef=Submission of invoice %s (reminder) -NoDraftBills=No draft invoices -NoOtherDraftBills=No other draft invoices -NoDraftInvoices=No draft invoices -RefBill=Invoice ref -ToBill=To bill -RemainderToBill=Remainder to bill -SendBillByMail=Send invoice by email -SendReminderBillByMail=Send reminder by email -RelatedCommercialProposals=Related commercial proposals -RelatedRecurringCustomerInvoices=Related recurring customer invoices -MenuToValid=To valid -DateMaxPayment=Payment due on -DateInvoice=Invoice date -DatePointOfTax=Point of tax -NoInvoice=No invoice -NoOpenInvoice=No open invoice -ClassifyBill=Classify invoice -SupplierBillsToPay=Unpaid vendor invoices -CustomerBillsUnpaid=Unpaid customer invoices -NonPercuRecuperable=Non-recoverable -SetConditions=Set Payment Terms -SetMode=Set Payment Type -SetRevenuStamp=Set revenue stamp -Billed=Billed -RecurringInvoices=Recurring invoices -RepeatableInvoice=Template invoice -RepeatableInvoices=Template invoices -Repeatable=Template -Repeatables=Templates -ChangeIntoRepeatableInvoice=Convert into template invoice -CreateRepeatableInvoice=Create template invoice -CreateFromRepeatableInvoice=Create from template invoice -CustomersInvoicesAndInvoiceLines=Customer invoices and invoice details -CustomersInvoicesAndPayments=Customer invoices and payments -ExportDataset_invoice_1=Customer invoices and invoice details -ExportDataset_invoice_2=Customer invoices and payments -ProformaBill=Proforma Bill: -Reduction=Reduction -ReductionShort=Disc. -Reductions=Reductions -ReductionsShort=Disc. -Discounts=Discounts -AddDiscount=Create discount -AddRelativeDiscount=Create relative discount -EditRelativeDiscount=Edit relative discount -AddGlobalDiscount=Create absolute discount -EditGlobalDiscounts=Edit absolute discounts -AddCreditNote=Create credit note -ShowDiscount=Show discount -ShowReduc=Show the discount -ShowSourceInvoice=Show the source invoice -RelativeDiscount=Relative discount -GlobalDiscount=Global discount -CreditNote=Credit note -CreditNotes=Credit notes -CreditNotesOrExcessReceived=Credit notes or excess received -Deposit=Down payment -Deposits=Down payments -DiscountFromCreditNote=Discount from credit note %s -DiscountFromDeposit=Down payments from invoice %s -DiscountFromExcessReceived=Payments in excess of invoice %s -DiscountFromExcessPaid=Payments in excess of invoice %s -AbsoluteDiscountUse=This kind of credit can be used on invoice before its validation -CreditNoteDepositUse=Invoice must be validated to use this kind of credits -NewGlobalDiscount=New absolute discount -NewRelativeDiscount=New relative discount -DiscountType=Discount type -NoteReason=Note/Reason -ReasonDiscount=Reason -DiscountOfferedBy=Granted by -DiscountStillRemaining=Discounts or credits available -DiscountAlreadyCounted=Discounts or credits already consumed -CustomerDiscounts=Customer discounts -SupplierDiscounts=Vendors discounts -BillAddress=Bill address -HelpEscompte=This discount is a discount granted to customer because payment was made before term. -HelpAbandonBadCustomer=This amount has been abandoned (customer said to be a bad customer) and is considered as an exceptional loss. -HelpAbandonOther=This amount has been abandoned since it was an error (wrong customer or invoice replaced by another for example) -IdSocialContribution=Social/fiscal tax payment id -PaymentId=Payment id -PaymentRef=Payment ref. -InvoiceId=Invoice id -InvoiceRef=Invoice ref. -InvoiceDateCreation=Invoice creation date -InvoiceStatus=Invoice status -InvoiceNote=Invoice note -InvoicePaid=Invoice paid -InvoicePaidCompletely=Paid completely -InvoicePaidCompletelyHelp=Invoice that are paid completely. This excludes invoices that are paid partially. To get list of all 'Closed' or non 'Closed' invoices, prefer to use a filter on the invoice status. -OrderBilled=Order billed -DonationPaid=Donation paid -PaymentNumber=Payment number -RemoveDiscount=Remove discount -WatermarkOnDraftBill=Watermark on draft invoices (nothing if empty) -InvoiceNotChecked=No invoice selected -ConfirmCloneInvoice=Are you sure you want to clone this invoice %s? -DisabledBecauseReplacedInvoice=Action disabled because invoice has been replaced -DescTaxAndDividendsArea=This area presents a summary of all payments made for special expenses. Only records with payments during the fixed year are included here. -NbOfPayments=No. of payments -SplitDiscount=Split discount in two -ConfirmSplitDiscount=Are you sure you want to split this discount of %s %s into two smaller discounts? -TypeAmountOfEachNewDiscount=Input amount for each of two parts: -TotalOfTwoDiscountMustEqualsOriginal=The total of the two new discounts must be equal to the original discount amount. -ConfirmRemoveDiscount=Are you sure you want to remove this discount? -RelatedBill=Related invoice -RelatedBills=Related invoices -RelatedCustomerInvoices=Related customer invoices -RelatedSupplierInvoices=Related vendor invoices -LatestRelatedBill=Latest related invoice -WarningBillExist=Warning, one or more invoices already exist -MergingPDFTool=Merging PDF tool -AmountPaymentDistributedOnInvoice=Payment amount distributed on invoice -PaymentOnDifferentThirdBills=Allow payments on different third parties bills but same parent company -PaymentNote=Payment note -ListOfPreviousSituationInvoices=List of previous situation invoices -ListOfNextSituationInvoices=List of next situation invoices -ListOfSituationInvoices=List of situation invoices -CurrentSituationTotal=Total current situation -DisabledBecauseNotEnouthCreditNote=To remove a situation invoice from cycle, this invoice's credit note total must cover this invoice total -RemoveSituationFromCycle=Remove this invoice from cycle -ConfirmRemoveSituationFromCycle=Remove this invoice %s from cycle ? -ConfirmOuting=Confirm outing -FrequencyPer_d=Every %s days -FrequencyPer_m=Every %s months -FrequencyPer_y=Every %s years -FrequencyUnit=Frequency unit -toolTipFrequency=Examples:
    Set 7, Day: give a new invoice every 7 days
    Set 3, Month: give a new invoice every 3 month -NextDateToExecution=Date for next invoice generation -NextDateToExecutionShort=Date next gen. -DateLastGeneration=Date of latest generation -DateLastGenerationShort=Date latest gen. -MaxPeriodNumber=Max. number of invoice generation -NbOfGenerationDone=Number of invoice generation already done -NbOfGenerationOfRecordDone=Number of record generation already done -NbOfGenerationDoneShort=Number of generation done -MaxGenerationReached=Maximum number of generations reached -InvoiceAutoValidate=Validate invoices automatically -GeneratedFromRecurringInvoice=Generated from template recurring invoice %s -DateIsNotEnough=Date not reached yet -InvoiceGeneratedFromTemplate=Invoice %s generated from recurring template invoice %s -GeneratedFromTemplate=Generated from template invoice %s -WarningInvoiceDateInFuture=Warning, the invoice date is higher than current date -WarningInvoiceDateTooFarInFuture=Warning, the invoice date is too far from current date -ViewAvailableGlobalDiscounts=View available discounts -GroupPaymentsByModOnReports=Group payments by mode on reports -# PaymentConditions -Statut=Status -PaymentConditionShortRECEP=Due Upon Receipt -PaymentConditionRECEP=Due Upon Receipt -PaymentConditionShort30D=30 days -PaymentCondition30D=30 days -PaymentConditionShort30DENDMONTH=30 days of month-end -PaymentCondition30DENDMONTH=Within 30 days following the end of the month -PaymentConditionShort60D=60 days -PaymentCondition60D=60 days -PaymentConditionShort60DENDMONTH=60 days of month-end -PaymentCondition60DENDMONTH=Within 60 days following the end of the month -PaymentConditionShortPT_DELIVERY=Delivery -PaymentConditionPT_DELIVERY=On delivery -PaymentConditionShortPT_ORDER=Order -PaymentConditionPT_ORDER=On order -PaymentConditionShortPT_5050=50-50 -PaymentConditionPT_5050=50%% in advance, 50%% on delivery -PaymentConditionShort10D=10 days -PaymentCondition10D=10 days -PaymentConditionShort10DENDMONTH=10 days of month-end -PaymentCondition10DENDMONTH=Within 10 days following the end of the month -PaymentConditionShort14D=14 days -PaymentCondition14D=14 days -PaymentConditionShort14DENDMONTH=14 days of month-end -PaymentCondition14DENDMONTH=Within 14 days following the end of the month -FixAmount=Fixed amount - 1 line with label '%s' -VarAmount=Variable amount (%% tot.) -VarAmountOneLine=Variable amount (%% tot.) - 1 line with label '%s' -VarAmountAllLines=Variable amount (%% tot.) - all lines from origin -# PaymentType -PaymentTypeVIR=Bank transfer -PaymentTypeShortVIR=Bank transfer -PaymentTypePRE=Direct debit payment order -PaymentTypeShortPRE=Debit payment order -PaymentTypeLIQ=Cash -PaymentTypeShortLIQ=Cash -PaymentTypeCB=Credit card -PaymentTypeShortCB=Credit card -PaymentTypeCHQ=Check -PaymentTypeShortCHQ=Check -PaymentTypeTIP=TIP (Documents against Payment) -PaymentTypeShortTIP=TIP Payment -PaymentTypeVAD=Online payment -PaymentTypeShortVAD=Online payment -PaymentTypeTRA=Bank draft -PaymentTypeShortTRA=Draft -PaymentTypeFAC=Factor -PaymentTypeShortFAC=Factor -BankDetails=Bank details -BankCode=Bank code -DeskCode=Branch code -BankAccountNumber=Account number -BankAccountNumberKey=Checksum -Residence=Address -IBANNumber=IBAN account number -IBAN=IBAN -CustomerIBAN=IBAN of customer -SupplierIBAN=IBAN of vendor -BIC=BIC/SWIFT -BICNumber=BIC/SWIFT code -ExtraInfos=Extra infos -RegulatedOn=Regulated on -ChequeNumber=Check N° -ChequeOrTransferNumber=Check/Transfer N° -ChequeBordereau=Check schedule -ChequeMaker=Check/Transfer sender -ChequeBank=Bank of Check -CheckBank=Check -NetToBePaid=Net to be paid -PhoneNumber=Tel -FullPhoneNumber=Telephone -TeleFax=Fax -PrettyLittleSentence=Accept the amount of payments due by checks issued in my name as a Member of an accounting association approved by the Fiscal Administration. -IntracommunityVATNumber=Intra-Community VAT ID -PaymentByChequeOrderedTo=Check payments (including tax) are payable to %s, send to -PaymentByChequeOrderedToShort=Check payments (incl. tax) are payable to -SendTo=sent to -PaymentByTransferOnThisBankAccount=Payment by transfer to the following bank account -VATIsNotUsedForInvoice=* Non applicable VAT art-293B of CGI -LawApplicationPart1=By application of the law 80.335 of 12/05/80 -LawApplicationPart2=the goods remain the property of -LawApplicationPart3=the seller until full payment of -LawApplicationPart4=their price. -LimitedLiabilityCompanyCapital=SARL with Capital of -UseLine=Apply -UseDiscount=Use discount -UseCredit=Use credit -UseCreditNoteInInvoicePayment=Reduce amount to pay with this credit -MenuChequeDeposits=Check Deposits -MenuCheques=Checks -MenuChequesReceipts=Check receipts -NewChequeDeposit=New deposit -ChequesReceipts=Check receipts -ChequesArea=Check deposits area -ChequeDeposits=Check deposits -Cheques=Checks -DepositId=Id deposit -NbCheque=Number of checks -CreditNoteConvertedIntoDiscount=This %s has been converted into %s -UsBillingContactAsIncoiveRecipientIfExist=Use contact/address with type 'billing contact' instead of third-party address as recipient for invoices -ShowUnpaidAll=Show all unpaid invoices -ShowUnpaidLateOnly=Show late unpaid invoices only -PaymentInvoiceRef=Payment invoice %s -ValidateInvoice=Validate invoice -ValidateInvoices=Validate invoices -Cash=Cash -Reported=Delayed -DisabledBecausePayments=Not possible since there are some payments -CantRemovePaymentWithOneInvoicePaid=Can't remove payment since there is at least one invoice classified paid -CantRemovePaymentVATPaid=Can't remove payment since VAT declaration is classified paid -CantRemovePaymentSalaryPaid=Can't remove payment since salary is classified paid -ExpectedToPay=Expected payment -CantRemoveConciliatedPayment=Can't remove reconciled payment -PayedByThisPayment=Paid by this payment -ClosePaidInvoicesAutomatically=Classify automatically all standard, down payment or replacement invoices as "Paid" when payment is done entirely. -ClosePaidCreditNotesAutomatically=Classify automatically all credit notes as "Paid" when refund is done entirely. -ClosePaidContributionsAutomatically=Classify automatically all social or fiscal contributions as "Paid" when payment is done entirely. -ClosePaidVATAutomatically=Classify automatically VAT declaration as "Paid" when payment is done entirely. -ClosePaidSalaryAutomatically=Classify automatically salary as "Paid" when payment is done entirely. -AllCompletelyPayedInvoiceWillBeClosed=All invoices with no remainder to pay will be automatically closed with status "Paid". -ToMakePayment=Pay -ToMakePaymentBack=Pay back -ListOfYourUnpaidInvoices=List of unpaid invoices -NoteListOfYourUnpaidInvoices=Note: This list contains only invoices for third parties you are linked to as a sale representative. -RevenueStamp=Tax stamp -YouMustCreateInvoiceFromThird=This option is only available when creating an invoice from tab "Customer" of third party -YouMustCreateInvoiceFromSupplierThird=This option is only available when creating an invoice from tab "Vendor" of third party -YouMustCreateStandardInvoiceFirstDesc=You have to create a standard invoice first and convert it to "template" to create a new template invoice -PDFCrabeDescription=Invoice PDF template Crabe. A complete invoice template (old implementation of Sponge template) -PDFSpongeDescription=Invoice PDF template Sponge. A complete invoice template -PDFCrevetteDescription=Invoice PDF template Crevette. A complete invoice template for situation invoices -TerreNumRefModelDesc1=Return number in the format %syymm-nnnn for standard invoices and %syymm-nnnn for credit notes where yy is year, mm is month and nnnn is a sequencial auto-incrementing number with no break and no return to 0 -MarsNumRefModelDesc1=Return number in the format %syymm-nnnn for standard invoices, %syymm-nnnn for replacement invoices, %syymm-nnnn for down payment invoices and %syymm-nnnn for credit notes where yy is year, mm is month and nnnn is a sequencial auto-incrementing number with no break and no return to 0 -TerreNumRefModelError=A bill starting with $syymm already exists and is not compatible with this model of sequence. Remove it or rename it to activate this module. -CactusNumRefModelDesc1=Return number in the format %syymm-nnnn for standard invoices, %syymm-nnnn for credit notes and %syymm-nnnn for down payment invoices where yy is year, mm is month and nnnn is a sequencial auto-incrementing number with no break and no return to 0 -EarlyClosingReason=Early closing reason -EarlyClosingComment=Early closing note -##### Types de contacts ##### -TypeContact_facture_internal_SALESREPFOLL=Representative following-up customer invoice -TypeContact_facture_external_BILLING=Customer invoice contact -TypeContact_facture_external_SHIPPING=Customer shipping contact -TypeContact_facture_external_SERVICE=Customer service contact -TypeContact_invoice_supplier_internal_SALESREPFOLL=Representative following-up vendor invoice -TypeContact_invoice_supplier_external_BILLING=Vendor invoice contact -TypeContact_invoice_supplier_external_SHIPPING=Vendor shipping contact -TypeContact_invoice_supplier_external_SERVICE=Vendor service contact -# Situation invoices -InvoiceFirstSituationAsk=First situation invoice -InvoiceFirstSituationDesc=The situation invoices are tied to situations related to a progression, for example the progression of a construction. Each situation is tied to an invoice. -InvoiceSituation=Situation invoice -PDFInvoiceSituation=Situation invoice -InvoiceSituationAsk=Invoice following the situation -InvoiceSituationDesc=Create a new situation following an already existing one -SituationAmount=Situation invoice amount(net) -SituationDeduction=Situation subtraction -ModifyAllLines=Modify all lines -CreateNextSituationInvoice=Create next situation -ErrorFindNextSituationInvoice=Error unable to find next situation cycle ref -ErrorOutingSituationInvoiceOnUpdate=Unable to outing this situation invoice. -ErrorOutingSituationInvoiceCreditNote=Unable to outing linked credit note. -NotLastInCycle=This invoice is not the latest in cycle and must not be modified. -DisabledBecauseNotLastInCycle=The next situation already exists. -DisabledBecauseFinal=This situation is final. -situationInvoiceShortcode_AS=AS -situationInvoiceShortcode_S=S -CantBeLessThanMinPercent=The progress can't be smaller than its value in the previous situation. -NoSituations=No open situations -InvoiceSituationLast=Final and general invoice -PDFCrevetteSituationNumber=Situation N°%s -PDFCrevetteSituationInvoiceLineDecompte=Situation invoice - COUNT -PDFCrevetteSituationInvoiceTitle=Situation invoice -PDFCrevetteSituationInvoiceLine=Situation N°%s: Inv. N°%s on %s -TotalSituationInvoice=Total situation -invoiceLineProgressError=Invoice line progress can't be greater than or equal to the next invoice line -updatePriceNextInvoiceErrorUpdateline=Error: update price on invoice line: %s -ToCreateARecurringInvoice=To create a recurring invoice for this contract, first create this draft invoice, then convert it into an invoice template and define the frequency for generation of future invoices. -ToCreateARecurringInvoiceGene=To generate future invoices regularly and manually, just go on menu %s - %s - %s. -ToCreateARecurringInvoiceGeneAuto=If you need to have such invoices generated automatically, ask your administrator to enable and setup module %s. Note that both methods (manual and automatic) can be used together with no risk of duplication. -DeleteRepeatableInvoice=Delete template invoice -ConfirmDeleteRepeatableInvoice=Are your sure you want to delete the template invoice? CreateOneBillByThird=Create one invoice per third party (otherwise, one invoice per order) -BillCreated=%s invoice(s) generated -BillXCreated=Invoice %s generated -StatusOfGeneratedDocuments=Status of document generation -DoNotGenerateDoc=Do not generate document file -AutogenerateDoc=Auto generate document file -AutoFillDateFrom=Set start date for service line with invoice date -AutoFillDateFromShort=Set start date -AutoFillDateTo=Set end date for service line with next invoice date -AutoFillDateToShort=Set end date -MaxNumberOfGenerationReached=Max number of gen. reached -BILL_DELETEInDolibarr=Invoice deleted -BILL_SUPPLIER_DELETEInDolibarr=Supplier invoice deleted -UnitPriceXQtyLessDiscount=Unit price x Qty - Discount -CustomersInvoicesArea=Customer billing area -SupplierInvoicesArea=Supplier billing area -FacParentLine=Invoice Line Parent -SituationTotalRayToRest=Remainder to pay without taxe -PDFSituationTitle=Situation n° %d -SituationTotalProgress=Total progress %d %% -SearchUnpaidInvoicesWithDueDate=Search unpaid invoices with a due date = %s diff --git a/htdocs/langs/ar_IQ/blockedlog.lang b/htdocs/langs/ar_IQ/blockedlog.lang deleted file mode 100644 index 44cb183050a..00000000000 --- a/htdocs/langs/ar_IQ/blockedlog.lang +++ /dev/null @@ -1,54 +0,0 @@ -BlockedLog=Unalterable Logs -Field=Field -BlockedLogDesc=This module tracks some events into an unalterable log (that you can't modify once recorded) into a block chain, in real time. This module provides compatibility with requirements of laws of some countries (like France with the law Finance 2016 - Norme NF525). -Fingerprints=Archived events and fingerprints -FingerprintsDesc=This is the tool to browse or extract the unalterable logs. Unalterable logs are generated and archived locally into a dedicated table, in real time when you record a business event. You can use this tool to export this archive and save it into an external support (some countries, like France, ask that you do it every year). Note that, there is no feature to purge this log and every change tried to be done directly into this log (by a hacker for example) will be reported with a non-valid fingerprint. If you really need to purge this table because you used your application for a demo/test purpose and want to clean your data to start your production, you can ask your reseller or integrator to reset your database (all your data will be removed). -CompanyInitialKey=Company initial key (hash of genesis block) -BrowseBlockedLog=Unalterable logs -ShowAllFingerPrintsMightBeTooLong=Show all archived logs (might be long) -ShowAllFingerPrintsErrorsMightBeTooLong=Show all non-valid archive logs (might be long) -DownloadBlockChain=Download fingerprints -KoCheckFingerprintValidity=Archived log entry is not valid. It means someone (a hacker?) has modified some data of this record after it was recorded, or has erased the previous archived record (check that line with previous # exists) or has modified checksum of the previous record. -OkCheckFingerprintValidity=Archived log record is valid. The data on this line was not modified and the entry follows the previous one. -OkCheckFingerprintValidityButChainIsKo=Archived log seems valid compared to previous one but the chain was corrupted previously. -AddedByAuthority=Stored into remote authority -NotAddedByAuthorityYet=Not yet stored into remote authority -ShowDetails=Show stored details -logPAYMENT_VARIOUS_CREATE=Payment (not assigned to an invoice) created -logPAYMENT_VARIOUS_MODIFY=Payment (not assigned to an invoice) modified -logPAYMENT_VARIOUS_DELETE=Payment (not assigned to an invoice) logical deletion -logPAYMENT_ADD_TO_BANK=Payment added to bank -logPAYMENT_CUSTOMER_CREATE=Customer payment created -logPAYMENT_CUSTOMER_DELETE=Customer payment logical deletion -logDONATION_PAYMENT_CREATE=Donation payment created -logDONATION_PAYMENT_DELETE=Donation payment logical deletion -logBILL_PAYED=Customer invoice paid -logBILL_UNPAYED=Customer invoice set unpaid -logBILL_VALIDATE=Customer invoice validated -logBILL_SENTBYMAIL=Customer invoice send by mail -logBILL_DELETE=Customer invoice logically deleted -logMODULE_RESET=Module BlockedLog was disabled -logMODULE_SET=Module BlockedLog was enabled -logDON_VALIDATE=Donation validated -logDON_MODIFY=Donation modified -logDON_DELETE=Donation logical deletion -logMEMBER_SUBSCRIPTION_CREATE=Member subscription created -logMEMBER_SUBSCRIPTION_MODIFY=Member subscription modified -logMEMBER_SUBSCRIPTION_DELETE=Member subscription logical deletion -logCASHCONTROL_VALIDATE=Cash desk closing recording -BlockedLogBillDownload=Customer invoice download -BlockedLogBillPreview=Customer invoice preview -BlockedlogInfoDialog=Log Details -ListOfTrackedEvents=List of tracked events -Fingerprint=Fingerprint -DownloadLogCSV=Export archived logs (CSV) -logDOC_PREVIEW=Preview of a validated document in order to print or download -logDOC_DOWNLOAD=Download of a validated document in order to print or send -DataOfArchivedEvent=Full datas of archived event -ImpossibleToReloadObject=Original object (type %s, id %s) not linked (see 'Full datas' column to get unalterable saved data) -BlockedLogAreRequiredByYourCountryLegislation=Unalterable Logs module may be required by the legislation of your country. Disabling this module may render any future transactions invalid with respect to the law and the use of legal software as they can not be validated by a tax audit. -BlockedLogActivatedBecauseRequiredByYourCountryLegislation=Unalterable Logs module was activated because of the legislation of your country. Disabling this module may render any future transactions invalid with respect to the law and the use of legal software as they cannot be validated by a tax audit. -BlockedLogDisableNotAllowedForCountry=List of countries where usage of this module is mandatory (just to prevent to disable the module by error, if your country is in this list, disable of module is not possible without editing this list first. Note also that enabling/disabling this module will keep a track into the unalterable log). -OnlyNonValid=Non-valid -TooManyRecordToScanRestrictFilters=Too many records to scan/analyze. Please restrict list with more restrictive filters. -RestrictYearToExport=Restrict month / year to export diff --git a/htdocs/langs/ar_IQ/bookmarks.lang b/htdocs/langs/ar_IQ/bookmarks.lang deleted file mode 100644 index 87466cadcfa..00000000000 --- a/htdocs/langs/ar_IQ/bookmarks.lang +++ /dev/null @@ -1,21 +0,0 @@ -# Dolibarr language file - Source file is en_US - marque pages -AddThisPageToBookmarks=Add current page to bookmarks -Bookmark=Bookmark -Bookmarks=Bookmarks -ListOfBookmarks=List of bookmarks -EditBookmarks=List/edit bookmarks -NewBookmark=New bookmark -ShowBookmark=Show bookmark -OpenANewWindow=Open a new tab -ReplaceWindow=Replace current tab -BookmarkTargetNewWindowShort=New tab -BookmarkTargetReplaceWindowShort=Current tab -BookmarkTitle=Bookmark name -UrlOrLink=URL -BehaviourOnClick=Behaviour when a bookmark URL is selected -CreateBookmark=Create bookmark -SetHereATitleForLink=Set a name for the bookmark -UseAnExternalHttpLinkOrRelativeDolibarrLink=Use an external/absolute link (https://URL) or an internal/relative link (/DOLIBARR_ROOT/htdocs/...) -ChooseIfANewWindowMustBeOpenedOnClickOnBookmark=Choose if the linked page should open in the current tab or a new tab -BookmarksManagement=Bookmarks management -BookmarksMenuShortCut=Ctrl + shift + m diff --git a/htdocs/langs/ar_IQ/boxes.lang b/htdocs/langs/ar_IQ/boxes.lang deleted file mode 100644 index 710d49bfab6..00000000000 --- a/htdocs/langs/ar_IQ/boxes.lang +++ /dev/null @@ -1,120 +0,0 @@ -# Dolibarr language file - Source file is en_US - boxes -BoxDolibarrStateBoard=Statistics on main business objects in database -BoxLoginInformation=Login Information -BoxLastRssInfos=RSS Information -BoxLastProducts=Latest %s Products/Services -BoxProductsAlertStock=Stock alerts for products -BoxLastProductsInContract=Latest %s contracted products/services -BoxLastSupplierBills=Latest Vendor invoices -BoxLastCustomerBills=Latest Customer invoices -BoxOldestUnpaidCustomerBills=Oldest unpaid customer invoices -BoxOldestUnpaidSupplierBills=Oldest unpaid vendor invoices -BoxLastProposals=Latest commercial proposals -BoxLastProspects=Latest modified prospects -BoxLastCustomers=Latest modified customers -BoxLastSuppliers=Latest modified suppliers -BoxLastCustomerOrders=Latest sales orders -BoxLastActions=Latest actions -BoxLastContracts=Latest contracts -BoxLastContacts=Latest contacts/addresses -BoxLastMembers=Latest members -BoxLastModifiedMembers=Latest modified members -BoxLastMembersSubscriptions=Latest member subscriptions -BoxFicheInter=Latest interventions -BoxCurrentAccounts=Open accounts balance -BoxTitleMemberNextBirthdays=Birthdays of this month (members) -BoxTitleMembersByType=Members by type -BoxTitleMembersSubscriptionsByYear=Members Subscriptions by year -BoxTitleLastRssInfos=Latest %s news from %s -BoxTitleLastProducts=Products/Services: last %s modified -BoxTitleProductsAlertStock=Products: stock alert -BoxTitleLastSuppliers=Latest %s recorded suppliers -BoxTitleLastModifiedSuppliers=Vendors: last %s modified -BoxTitleLastModifiedCustomers=Customers: last %s modified -BoxTitleLastCustomersOrProspects=Latest %s customers or prospects -BoxTitleLastCustomerBills=Latest %s modified Customer invoices -BoxTitleLastSupplierBills=Latest %s modified Vendor invoices -BoxTitleLastModifiedProspects=Prospects: last %s modified -BoxTitleLastModifiedMembers=Latest %s members -BoxTitleLastFicheInter=Latest %s modified interventions -BoxTitleOldestUnpaidCustomerBills=Customer Invoices: oldest %s unpaid -BoxTitleOldestUnpaidSupplierBills=Vendor Invoices: oldest %s unpaid -BoxTitleCurrentAccounts=Open Accounts: balances -BoxTitleSupplierOrdersAwaitingReception=Supplier orders awaiting reception -BoxTitleLastModifiedContacts=Contacts/Addresses: last %s modified -BoxMyLastBookmarks=Bookmarks: latest %s -BoxOldestExpiredServices=Oldest active expired services -BoxLastExpiredServices=Latest %s oldest contacts with active expired services -BoxTitleLastActionsToDo=Latest %s actions to do -BoxTitleLastContracts=Latest %s contracts which were modified -BoxTitleLastModifiedDonations=Latest %s donations which were modified -BoxTitleLastModifiedExpenses=Latest %s expense reports which were modified -BoxTitleLatestModifiedBoms=Latest %s BOMs which were modified -BoxTitleLatestModifiedMos=Latest %s Manufacturing Orders which were modified -BoxTitleLastOutstandingBillReached=Customers with maximum outstanding exceeded -BoxGlobalActivity=Global activity (invoices, proposals, orders) -BoxGoodCustomers=Good customers -BoxTitleGoodCustomers=%s Good customers -BoxScheduledJobs=Scheduled jobs -BoxTitleFunnelOfProspection=Lead funnel -FailedToRefreshDataInfoNotUpToDate=Failed to refresh RSS flux. Latest successful refresh date: %s -LastRefreshDate=Latest refresh date -NoRecordedBookmarks=No bookmarks defined. -ClickToAdd=Click here to add. -NoRecordedCustomers=No recorded customers -NoRecordedContacts=No recorded contacts -NoActionsToDo=No actions to do -NoRecordedOrders=No recorded sales orders -NoRecordedProposals=No recorded proposals -NoRecordedInvoices=No recorded customer invoices -NoUnpaidCustomerBills=No unpaid customer invoices -NoUnpaidSupplierBills=No unpaid vendor invoices -NoModifiedSupplierBills=No recorded vendor invoices -NoRecordedProducts=No recorded products/services -NoRecordedProspects=No recorded prospects -NoContractedProducts=No products/services contracted -NoRecordedContracts=No recorded contracts -NoRecordedInterventions=No recorded interventions -BoxLatestSupplierOrders=Latest purchase orders -BoxLatestSupplierOrdersAwaitingReception=Latest Purchase Orders (with a pending reception) -NoSupplierOrder=No recorded purchase order -BoxCustomersInvoicesPerMonth=Customer Invoices per month -BoxSuppliersInvoicesPerMonth=Vendor Invoices per month -BoxCustomersOrdersPerMonth=Sales Orders per month -BoxSuppliersOrdersPerMonth=Vendor Orders per month -BoxProposalsPerMonth=Proposals per month -NoTooLowStockProducts=No products are under the low stock limit -BoxProductDistribution=Products/Services Distribution -ForObject=On %s -BoxTitleLastModifiedSupplierBills=Vendor Invoices: last %s modified -BoxTitleLatestModifiedSupplierOrders=Vendor Orders: last %s modified -BoxTitleLastModifiedCustomerBills=Customer Invoices: last %s modified -BoxTitleLastModifiedCustomerOrders=Sales Orders: last %s modified -BoxTitleLastModifiedPropals=Latest %s modified proposals -BoxTitleLatestModifiedJobPositions=Latest %s modified job positions -BoxTitleLatestModifiedCandidatures=Latest %s modified job applications -ForCustomersInvoices=Customers invoices -ForCustomersOrders=Customers orders -ForProposals=Proposals -LastXMonthRolling=The latest %s month rolling -ChooseBoxToAdd=Add widget to your dashboard -BoxAdded=Widget was added in your dashboard -BoxTitleUserBirthdaysOfMonth=Birthdays of this month (users) -BoxLastManualEntries=Latest record in accountancy entered manually or without source document -BoxTitleLastManualEntries=%s latest record entered manually or without source document -NoRecordedManualEntries=No manual entries record in accountancy -BoxSuspenseAccount=Count accountancy operation with suspense account -BoxTitleSuspenseAccount=Number of unallocated lines -NumberOfLinesInSuspenseAccount=Number of line in suspense account -SuspenseAccountNotDefined=Suspense account isn't defined -BoxLastCustomerShipments=Last customer shipments -BoxTitleLastCustomerShipments=Latest %s customer shipments -NoRecordedShipments=No recorded customer shipment -BoxCustomersOutstandingBillReached=Customers with oustanding limit reached -# Pages -UsersHome=Home users and groups -MembersHome=Home Membership -ThirdpartiesHome=Home Thirdparties -TicketsHome=Home Tickets -AccountancyHome=Home Accountancy -ValidatedProjects=Validated projects diff --git a/htdocs/langs/ar_IQ/cashdesk.lang b/htdocs/langs/ar_IQ/cashdesk.lang deleted file mode 100644 index 3bc383ed2a1..00000000000 --- a/htdocs/langs/ar_IQ/cashdesk.lang +++ /dev/null @@ -1,131 +0,0 @@ -# Language file - Source file is en_US - cashdesk -CashDeskMenu=Point of sale -CashDesk=Point of sale -CashDeskBankCash=Bank account (cash) -CashDeskBankCB=Bank account (card) -CashDeskBankCheque=Bank account (cheque) -CashDeskWarehouse=Warehouse -CashdeskShowServices=Selling services -CashDeskProducts=Products -CashDeskStock=Stock -CashDeskOn=on -CashDeskThirdParty=Third party -ShoppingCart=Shopping cart -NewSell=New sell -AddThisArticle=Add this article -RestartSelling=Go back on sell -SellFinished=Sale complete -PrintTicket=Print ticket -SendTicket=Send ticket -NoProductFound=No article found -ProductFound=product found -NoArticle=No article -Identification=Identification -Article=Article -Difference=Difference -TotalTicket=Total ticket -NoVAT=No VAT for this sale -Change=Excess received -BankToPay=Account for payment -ShowCompany=Show company -ShowStock=Show warehouse -DeleteArticle=Click to remove this article -FilterRefOrLabelOrBC=Search (Ref/Label) -UserNeedPermissionToEditStockToUsePos=You ask to decrease stock on invoice creation, so user that uses POS needs to have permission to edit stock. -DolibarrReceiptPrinter=Dolibarr Receipt Printer -PointOfSale=Point of Sale -PointOfSaleShort=POS -CloseBill=Close Bill -Floors=Floors -Floor=Floor -AddTable=Add table -Place=Place -TakeposConnectorNecesary='TakePOS Connector' required -OrderPrinters=Add a button to send the order to some given printers, without payment (for example to send an order to a kitchen) -NotAvailableWithBrowserPrinter=Not available when printer for receipt is set to browser: -SearchProduct=Search product -Receipt=Receipt -Header=Header -Footer=Footer -AmountAtEndOfPeriod=Amount at end of period (day, month or year) -TheoricalAmount=Theorical amount -RealAmount=Real amount -CashFence=Cash desk closing -CashFenceDone=Cash desk closing done for the period -NbOfInvoices=Nb of invoices -Paymentnumpad=Type of Pad to enter payment -Numberspad=Numbers Pad -BillsCoinsPad=Coins and banknotes Pad -DolistorePosCategory=TakePOS modules and other POS solutions for Dolibarr -TakeposNeedsCategories=TakePOS needs at least one product categorie to work -TakeposNeedsAtLeastOnSubCategoryIntoParentCategory=TakePOS needs at least 1 product category under the category %s to work -OrderNotes=Can add some notes to each ordered items -CashDeskBankAccountFor=Default account to use for payments in -NoPaimementModesDefined=No paiment mode defined in TakePOS configuration -TicketVatGrouped=Group VAT by rate in tickets|receipts -AutoPrintTickets=Automatically print tickets|receipts -PrintCustomerOnReceipts=Print customer on tickets|receipts -EnableBarOrRestaurantFeatures=Enable features for Bar or Restaurant -ConfirmDeletionOfThisPOSSale=Do your confirm the deletion of this current sale ? -ConfirmDiscardOfThisPOSSale=Do you want to discard this current sale ? -History=History -ValidateAndClose=Validate and close -Terminal=Terminal -NumberOfTerminals=Number of Terminals -TerminalSelect=Select terminal you want to use: -POSTicket=POS Ticket -POSTerminal=POS Terminal -POSModule=POS Module -BasicPhoneLayout=Use basic layout for phones -SetupOfTerminalNotComplete=Setup of terminal %s is not complete -DirectPayment=Direct payment -DirectPaymentButton=Add a "Direct cash payment" button -InvoiceIsAlreadyValidated=Invoice is already validated -NoLinesToBill=No lines to bill -CustomReceipt=Custom Receipt -ReceiptName=Receipt Name -ProductSupplements=Manage supplements of products -SupplementCategory=Supplement category -ColorTheme=Color theme -Colorful=Colorful -HeadBar=Head Bar -SortProductField=Field for sorting products -Browser=Browser -BrowserMethodDescription=Simple and easy receipt printing. Only a few parameters to configure the receipt. Print via browser. -TakeposConnectorMethodDescription=External module with extra features. Posibility to print from the cloud. -PrintMethod=Print method -ReceiptPrinterMethodDescription=Powerful method with a lot of parameters. Full customizable with templates. The server hosting the application can't be in the Cloud (must be able to reach the printers in your network). -ByTerminal=By terminal -TakeposNumpadUsePaymentIcon=Use icon instead of text on payment buttons of numpad -CashDeskRefNumberingModules=Numbering module for POS sales -CashDeskGenericMaskCodes6 =
    {TN} tag is used to add the terminal number -TakeposGroupSameProduct=Group same products lines -StartAParallelSale=Start a new parallel sale -SaleStartedAt=Sale started at %s -ControlCashOpening=Open the "Control cash" popup when opening the POS -CloseCashFence=Close cash desk control -CashReport=Cash report -MainPrinterToUse=Main printer to use -OrderPrinterToUse=Order printer to use -MainTemplateToUse=Main template to use -OrderTemplateToUse=Order template to use -BarRestaurant=Bar Restaurant -AutoOrder=Order by the customer himself -RestaurantMenu=Menu -CustomerMenu=Customer menu -ScanToMenu=Scan QR code to see the menu -ScanToOrder=Scan QR code to order -Appearance=Appearance -HideCategoryImages=Hide Category Images -HideProductImages=Hide Product Images -NumberOfLinesToShow=Number of lines of images to show -DefineTablePlan=Define tables plan -GiftReceiptButton=Add a "Gift receipt" button -GiftReceipt=Gift receipt -ModuleReceiptPrinterMustBeEnabled=Module Receipt printer must have been enabled first -AllowDelayedPayment=Allow delayed payment -PrintPaymentMethodOnReceipts=Print payment method on tickets|receipts -WeighingScale=Weighing scale -ShowPriceHT = Display the column with the price excluding tax (on screen) -ShowPriceHTOnReceipt = Display the column with the price excluding tax (on the receipt) -CustomerDisplay=Customer display diff --git a/htdocs/langs/ar_IQ/categories.lang b/htdocs/langs/ar_IQ/categories.lang deleted file mode 100644 index 29e08f66541..00000000000 --- a/htdocs/langs/ar_IQ/categories.lang +++ /dev/null @@ -1,99 +0,0 @@ -# Dolibarr language file - Source file is en_US - categories -Rubrique=Tag/Category -Rubriques=Tags/Categories -RubriquesTransactions=Tags/Categories of transactions -categories=tags/categories -NoCategoryYet=No tag/category of this type has been created -In=In -AddIn=Add in -modify=modify -Classify=Classify -CategoriesArea=Tags/Categories area -ProductsCategoriesArea=Product/Service tags/categories area -SuppliersCategoriesArea=Vendor tags/categories area -CustomersCategoriesArea=Customer tags/categories area -MembersCategoriesArea=Member tags/categories area -ContactsCategoriesArea=Contact tags/categories area -AccountsCategoriesArea=Bank account tags/categories area -ProjectsCategoriesArea=Project tags/categories area -UsersCategoriesArea=User tags/categories area -SubCats=Sub-categories -CatList=List of tags/categories -CatListAll=List of tags/categories (all types) -NewCategory=New tag/category -ModifCat=Modify tag/category -CatCreated=Tag/category created -CreateCat=Create tag/category -CreateThisCat=Create this tag/category -NoSubCat=No subcategory. -SubCatOf=Subcategory -FoundCats=Found tags/categories -ImpossibleAddCat=Impossible to add the tag/category %s -WasAddedSuccessfully=%s was added successfully. -ObjectAlreadyLinkedToCategory=Element is already linked to this tag/category. -ProductIsInCategories=Product/service is linked to following tags/categories -CompanyIsInCustomersCategories=This third party is linked to following customers/prospects tags/categories -CompanyIsInSuppliersCategories=This third party is linked to following vendors tags/categories -MemberIsInCategories=This member is linked to following members tags/categories -ContactIsInCategories=This contact is linked to following contacts tags/categories -ProductHasNoCategory=This product/service is not in any tags/categories -CompanyHasNoCategory=This third party is not in any tags/categories -MemberHasNoCategory=This member is not in any tags/categories -ContactHasNoCategory=This contact is not in any tags/categories -ProjectHasNoCategory=This project is not in any tags/categories -ClassifyInCategory=Add to tag/category -NotCategorized=Without tag/category -CategoryExistsAtSameLevel=This category already exists with this ref -ContentsVisibleByAllShort=Contents visible by all -ContentsNotVisibleByAllShort=Contents not visible by all -DeleteCategory=Delete tag/category -ConfirmDeleteCategory=Are you sure you want to delete this tag/category? -NoCategoriesDefined=No tag/category defined -SuppliersCategoryShort=Vendors tag/category -CustomersCategoryShort=Customers tag/category -ProductsCategoryShort=Products tag/category -MembersCategoryShort=Members tag/category -SuppliersCategoriesShort=Vendors tags/categories -CustomersCategoriesShort=Customers tags/categories -ProspectsCategoriesShort=Prospects tags/categories -CustomersProspectsCategoriesShort=Cust./Prosp. tags/categories -ProductsCategoriesShort=Products tags/categories -MembersCategoriesShort=Members tags/categories -ContactCategoriesShort=Contacts tags/categories -AccountsCategoriesShort=Accounts tags/categories -ProjectsCategoriesShort=Projects tags/categories -UsersCategoriesShort=Users tags/categories -StockCategoriesShort=Warehouse tags/categories -ThisCategoryHasNoItems=This category does not contain any items. -CategId=Tag/category id -ParentCategory=Parent tag/category -ParentCategoryLabel=Label of parent tag/category -CatSupList=List of vendors tags/categories -CatCusList=List of customers/prospects tags/categories -CatProdList=List of products tags/categories -CatMemberList=List of members tags/categories -CatContactList=List of contacts tags/categories -CatProjectsList=List of projects tags/categories -CatUsersList=List of users tags/categories -CatSupLinks=Links between vendors and tags/categories -CatCusLinks=Links between customers/prospects and tags/categories -CatContactsLinks=Links between contacts/addresses and tags/categories -CatProdLinks=Links between products/services and tags/categories -CatMembersLinks=Links between members and tags/categories -CatProjectsLinks=Links between projects and tags/categories -CatUsersLinks=Links between users and tags/categories -DeleteFromCat=Remove from tags/category -ExtraFieldsCategories=Complementary attributes -CategoriesSetup=Tags/categories setup -CategorieRecursiv=Link with parent tag/category automatically -CategorieRecursivHelp=If option is on, when you add a product into a subcategory, product will also be added into the parent category. -AddProductServiceIntoCategory=Add the following product/service -AddCustomerIntoCategory=Assign category to customer -AddSupplierIntoCategory=Assign category to supplier -ShowCategory=Show tag/category -ByDefaultInList=By default in list -ChooseCategory=Choose category -StocksCategoriesArea=Warehouse Categories -ActionCommCategoriesArea=Event Categories -WebsitePagesCategoriesArea=Page-Container Categories -UseOrOperatorForCategories=Use 'OR' operator for categories diff --git a/htdocs/langs/ar_IQ/commercial.lang b/htdocs/langs/ar_IQ/commercial.lang deleted file mode 100644 index 21d282cd794..00000000000 --- a/htdocs/langs/ar_IQ/commercial.lang +++ /dev/null @@ -1,81 +0,0 @@ -# Dolibarr language file - Source file is en_US - commercial -Commercial=Commerce -CommercialArea=Commerce area -Customer=Customer -Customers=Customers -Prospect=Prospect -Prospects=Prospects -DeleteAction=Delete an event -NewAction=New event -AddAction=Create event -AddAnAction=Create an event -AddActionRendezVous=Create a Rendez-vous event -ConfirmDeleteAction=Are you sure you want to delete this event? -CardAction=Event card -ActionOnCompany=Related company -ActionOnContact=Related contact -TaskRDVWith=Meeting with %s -ShowTask=Show task -ShowAction=Show event -ActionsReport=Events report -ThirdPartiesOfSaleRepresentative=Third parties with sales representative -SaleRepresentativesOfThirdParty=Sales representatives of third party -SalesRepresentative=Sales representative -SalesRepresentatives=Sales representatives -SalesRepresentativeFollowUp=Sales representative (follow-up) -SalesRepresentativeSignature=Sales representative (signature) -NoSalesRepresentativeAffected=No particular sales representative assigned -ShowCustomer=Show customer -ShowProspect=Show prospect -ListOfProspects=List of prospects -ListOfCustomers=List of customers -LastDoneTasks=Latest %s completed actions -LastActionsToDo=Oldest %s not completed actions -DoneAndToDoActions=Completed and To do events -DoneActions=Completed events -ToDoActions=Incomplete events -SendPropalRef=Submission of commercial proposal %s -SendOrderRef=Submission of order %s -StatusNotApplicable=Not applicable -StatusActionToDo=To do -StatusActionDone=Complete -StatusActionInProcess=In process -TasksHistoryForThisContact=Events for this contact -LastProspectDoNotContact=Do not contact -LastProspectNeverContacted=Never contacted -LastProspectToContact=To contact -LastProspectContactInProcess=Contact in process -LastProspectContactDone=Contact done -ActionAffectedTo=Event assigned to -ActionDoneBy=Event done by -ActionAC_TEL=Phone call -ActionAC_FAX=Send fax -ActionAC_PROP=Send proposal by mail -ActionAC_EMAIL=Send Email -ActionAC_EMAIL_IN=Reception of Email -ActionAC_RDV=Meetings -ActionAC_INT=Intervention on site -ActionAC_FAC=Send customer invoice by mail -ActionAC_REL=Send customer invoice by mail (reminder) -ActionAC_CLO=Close -ActionAC_EMAILING=Send mass email -ActionAC_COM=Send sales order by mail -ActionAC_SHIP=Send shipping by mail -ActionAC_SUP_ORD=Send purchase order by mail -ActionAC_SUP_INV=Send vendor invoice by mail -ActionAC_OTH=Other -ActionAC_OTH_AUTO=Other auto -ActionAC_MANUAL=Manually inserted events -ActionAC_AUTO=Automatically inserted events -ActionAC_OTH_AUTOShort=Other -ActionAC_EVENTORGANIZATION=Event organization events -Stats=Sales statistics -StatusProsp=Prospect status -DraftPropals=Draft commercial proposals -NoLimit=No limit -ToOfferALinkForOnlineSignature=Link for online signature -WelcomeOnOnlineSignaturePage=Welcome to the page to accept commercial proposals from %s -ThisScreenAllowsYouToSignDocFrom=This screen allow you to accept and sign, or refuse, a quote/commercial proposal -ThisIsInformationOnDocumentToSign=This is information on document to accept or refuse -SignatureProposalRef=Signature of quote/commercial proposal %s -FeatureOnlineSignDisabled=Feature for online signing disabled or document generated before the feature was enabled diff --git a/htdocs/langs/ar_IQ/companies.lang b/htdocs/langs/ar_IQ/companies.lang index fbe75f09ab0..d781b34a0f8 100644 --- a/htdocs/langs/ar_IQ/companies.lang +++ b/htdocs/langs/ar_IQ/companies.lang @@ -1,477 +1,2 @@ # Dolibarr language file - Source file is en_US - companies -ErrorCompanyNameAlreadyExists=Company name %s already exists. Choose another one. -ErrorSetACountryFirst=Set the country first -SelectThirdParty=Select a third party -ConfirmDeleteCompany=Are you sure you want to delete this company and all related information? -DeleteContact=Delete a contact/address -ConfirmDeleteContact=Are you sure you want to delete this contact and all related information? -MenuNewThirdParty=New Third Party -MenuNewCustomer=New Customer -MenuNewProspect=New Prospect -MenuNewSupplier=New Vendor -MenuNewPrivateIndividual=New private individual -NewCompany=New company (prospect, customer, vendor) -NewThirdParty=New Third Party (prospect, customer, vendor) -CreateDolibarrThirdPartySupplier=Create a third party (vendor) -CreateThirdPartyOnly=Create third party -CreateThirdPartyAndContact=Create a third party + a child contact -ProspectionArea=Prospection area -IdThirdParty=Id third party -IdCompany=Company Id -IdContact=Contact Id -ThirdPartyContacts=Third-party contacts -ThirdPartyContact=Third-party contact/address -Company=Company -CompanyName=Company name -AliasNames=Alias name (commercial, trademark, ...) -AliasNameShort=Alias Name -Companies=Companies -CountryIsInEEC=Country is inside the European Economic Community -PriceFormatInCurrentLanguage=Price display format in the current language and currency -ThirdPartyName=Third-party name -ThirdPartyEmail=Third-party email -ThirdParty=Third-party -ThirdParties=Third-parties -ThirdPartyProspects=Prospects -ThirdPartyProspectsStats=Prospects -ThirdPartyCustomers=Customers -ThirdPartyCustomersStats=Customers -ThirdPartyCustomersWithIdProf12=Customers with %s or %s -ThirdPartySuppliers=Vendors -ThirdPartyType=Third-party type -Individual=Private individual -ToCreateContactWithSameName=Will automatically create a contact/address with same information as the third party under the third party. In most cases, even if your third party is a physical person, creating a third party alone is enough. -ParentCompany=Parent company -Subsidiaries=Subsidiaries -ReportByMonth=Report per month -ReportByCustomers=Report per customer -ReportByThirdparties=Report per thirdparty -ReportByQuarter=Report per rate -CivilityCode=Civility code -RegisteredOffice=Registered office -Lastname=Last name -Firstname=First name -PostOrFunction=Job position -UserTitle=Title -NatureOfThirdParty=Nature of Third party -NatureOfContact=Nature of Contact -Address=Address -State=State/Province -StateCode=State/Province code -StateShort=State -Region=Region -Region-State=Region - State -Country=Country -CountryCode=Country code -CountryId=Country id -Phone=Phone -PhoneShort=Phone -Skype=Skype -Call=Call -Chat=Chat -PhonePro=Bus. phone -PhonePerso=Pers. phone -PhoneMobile=Mobile -No_Email=Refuse bulk emailings -Fax=Fax -Zip=Zip Code -Town=City -Web=Web -Poste= Position -DefaultLang=Default language -VATIsUsed=Sales tax used VATIsUsedWhenSelling=This defines if this third party includes a sale tax or not when it makes an invoice to its own customers -VATIsNotUsed=Sales tax is not used -CopyAddressFromSoc=Copy address from third-party details -ThirdpartyNotCustomerNotSupplierSoNoRef=Third party neither customer nor vendor, no available referring objects -ThirdpartyIsNeitherCustomerNorClientSoCannotHaveDiscounts=Third party neither customer nor vendor, discounts are not available -PaymentBankAccount=Payment bank account -OverAllProposals=Proposals -OverAllOrders=Orders -OverAllInvoices=Invoices -OverAllSupplierProposals=Price requests -##### Local Taxes ##### -LocalTax1IsUsed=Use second tax -LocalTax1IsUsedES= RE is used -LocalTax1IsNotUsedES= RE is not used -LocalTax2IsUsed=Use third tax -LocalTax2IsUsedES= IRPF is used -LocalTax2IsNotUsedES= IRPF is not used -WrongCustomerCode=Customer code invalid -WrongSupplierCode=Vendor code invalid -CustomerCodeModel=Customer code model -SupplierCodeModel=Vendor code model -Gencod=Barcode -##### Professional ID ##### -ProfId1Short=Prof. id 1 -ProfId2Short=Prof. id 2 -ProfId3Short=Prof. id 3 -ProfId4Short=Prof. id 4 -ProfId5Short=Prof. id 5 -ProfId6Short=Prof. id 6 -ProfId1=Professional ID 1 -ProfId2=Professional ID 2 -ProfId3=Professional ID 3 -ProfId4=Professional ID 4 -ProfId5=Professional ID 5 -ProfId6=Professional ID 6 -ProfId1AR=Prof Id 1 (CUIT/CUIL) -ProfId2AR=Prof Id 2 (Revenu brutes) -ProfId3AR=- -ProfId4AR=- -ProfId5AR=- -ProfId6AR=- -ProfId1AT=Prof Id 1 (USt.-IdNr) -ProfId2AT=Prof Id 2 (USt.-Nr) -ProfId3AT=Prof Id 3 (Handelsregister-Nr.) -ProfId4AT=- -ProfId5AT=EORI number -ProfId6AT=- -ProfId1AU=Prof Id 1 (ABN) -ProfId2AU=- -ProfId3AU=- -ProfId4AU=- -ProfId5AU=- -ProfId6AU=- -ProfId1BE=Prof Id 1 (Professional number) -ProfId2BE=- -ProfId3BE=- -ProfId4BE=- -ProfId5BE=EORI number -ProfId6BE=- -ProfId1BR=- -ProfId2BR=IE (Inscricao Estadual) -ProfId3BR=IM (Inscricao Municipal) -ProfId4BR=CPF -#ProfId5BR=CNAE -#ProfId6BR=INSS -ProfId1CH=UID-Nummer -ProfId2CH=- -ProfId3CH=Prof Id 1 (Federal number) -ProfId4CH=Prof Id 2 (Commercial Record number) -ProfId5CH=EORI number -ProfId6CH=- -ProfId1CL=Prof Id 1 (R.U.T.) -ProfId2CL=- -ProfId3CL=- -ProfId4CL=- -ProfId5CL=- -ProfId6CL=- -ProfId1CO=Prof Id 1 (R.U.T.) -ProfId2CO=- -ProfId3CO=- -ProfId4CO=- -ProfId5CO=- -ProfId6CO=- -ProfId1DE=Prof Id 1 (USt.-IdNr) -ProfId2DE=Prof Id 2 (USt.-Nr) -ProfId3DE=Prof Id 3 (Handelsregister-Nr.) -ProfId4DE=- -ProfId5DE=EORI number -ProfId6DE=- -ProfId1ES=Prof Id 1 (CIF/NIF) -ProfId2ES=Prof Id 2 (Social security number) -ProfId3ES=Prof Id 3 (CNAE) -ProfId4ES=Prof Id 4 (Collegiate number) -ProfId5ES=Prof Id 5 (EORI number) -ProfId6ES=- -ProfId1FR=Prof Id 1 (SIREN) -ProfId2FR=Prof Id 2 (SIRET) -ProfId3FR=Prof Id 3 (NAF, old APE) -ProfId4FR=Prof Id 4 (RCS/RM) -ProfId5FR=Prof Id 5 (numéro EORI) -ProfId6FR=- -ProfId1ShortFR=SIREN -ProfId2ShortFR=SIRET -ProfId3ShortFR=NAF -ProfId4ShortFR=RCS -ProfId5ShortFR=EORI -ProfId6ShortFR=- -ProfId1GB=Registration Number -ProfId2GB=- -ProfId3GB=SIC -ProfId4GB=- -ProfId5GB=- -ProfId6GB=- -ProfId1HN=Id prof. 1 (RTN) -ProfId2HN=- -ProfId3HN=- -ProfId4HN=- -ProfId5HN=- -ProfId6HN=- -ProfId1IN=Prof Id 1 (TIN) -ProfId2IN=Prof Id 2 (PAN) -ProfId3IN=Prof Id 3 (SRVC TAX) -ProfId4IN=Prof Id 4 -ProfId5IN=Prof Id 5 -ProfId6IN=- -ProfId1IT=- -ProfId2IT=- -ProfId3IT=- -ProfId4IT=- -ProfId5IT=EORI number -ProfId6IT=- -ProfId1LU=Id. prof. 1 (R.C.S. Luxembourg) -ProfId2LU=Id. prof. 2 (Business permit) -ProfId3LU=- -ProfId4LU=- -ProfId5LU=EORI number -ProfId6LU=- -ProfId1MA=Id prof. 1 (R.C.) -ProfId2MA=Id prof. 2 (Patente) -ProfId3MA=Id prof. 3 (I.F.) -ProfId4MA=Id prof. 4 (C.N.S.S.) -ProfId5MA=Id prof. 5 (I.C.E.) -ProfId6MA=- -ProfId1MX=Prof Id 1 (R.F.C). -ProfId2MX=Prof Id 2 (R..P. IMSS) -ProfId3MX=Prof Id 3 (Profesional Charter) -ProfId4MX=- -ProfId5MX=- -ProfId6MX=- -ProfId1NL=KVK nummer -ProfId2NL=- -ProfId3NL=- -ProfId4NL=Burgerservicenummer (BSN) -ProfId5NL=EORI number -ProfId6NL=- -ProfId1PT=Prof Id 1 (NIPC) -ProfId2PT=Prof Id 2 (Social security number) -ProfId3PT=Prof Id 3 (Commercial Record number) -ProfId4PT=Prof Id 4 (Conservatory) -ProfId5PT=Prof Id 5 (EORI number) -ProfId6PT=- -ProfId1SN=RC -ProfId2SN=NINEA -ProfId3SN=- -ProfId4SN=- -ProfId5SN=- -ProfId6SN=- -ProfId1TN=Prof Id 1 (RC) -ProfId2TN=Prof Id 2 (Fiscal matricule) -ProfId3TN=Prof Id 3 (Douane code) -ProfId4TN=Prof Id 4 (BAN) -ProfId5TN=- -ProfId6TN=- -ProfId1US=Prof Id (FEIN) -ProfId2US=- -ProfId3US=- -ProfId4US=- -ProfId5US=- -ProfId6US=- -ProfId1RO=Prof Id 1 (CUI) -ProfId2RO=Prof Id 2 (Nr. Înmatriculare) -ProfId3RO=Prof Id 3 (CAEN) -ProfId4RO=Prof Id 5 (EUID) -ProfId5RO=Prof Id 5 (EORI number) -ProfId6RO=- -ProfId1RU=Prof Id 1 (OGRN) -ProfId2RU=Prof Id 2 (INN) -ProfId3RU=Prof Id 3 (KPP) -ProfId4RU=Prof Id 4 (OKPO) -ProfId5RU=- -ProfId6RU=- -ProfId1DZ=RC -ProfId2DZ=Art. -ProfId3DZ=NIF -ProfId4DZ=NIS -VATIntra=VAT ID -VATIntraShort=VAT ID -VATIntraSyntaxIsValid=Syntax is valid -VATReturn=VAT return -ProspectCustomer=Prospect / Customer -Prospect=Prospect -CustomerCard=Customer Card -Customer=Customer -CustomerRelativeDiscount=Relative customer discount -SupplierRelativeDiscount=Relative vendor discount -CustomerRelativeDiscountShort=Relative discount -CustomerAbsoluteDiscountShort=Absolute discount -CompanyHasRelativeDiscount=This customer has a default discount of %s%% -CompanyHasNoRelativeDiscount=This customer has no relative discount by default -HasRelativeDiscountFromSupplier=You have a default discount of %s%% from this vendor -HasNoRelativeDiscountFromSupplier=You have no default relative discount from this vendor -CompanyHasAbsoluteDiscount=This customer has discounts available (credits notes or down payments) for %s %s -CompanyHasDownPaymentOrCommercialDiscount=This customer has discounts available (commercial, down payments) for %s %s -CompanyHasCreditNote=This customer still has credit notes for %s %s -HasNoAbsoluteDiscountFromSupplier=You have no discount credit available from this vendor -HasAbsoluteDiscountFromSupplier=You have discounts available (credits notes or down payments) for %s %s from this vendor -HasDownPaymentOrCommercialDiscountFromSupplier=You have discounts available (commercial, down payments) for %s %s from this vendor -HasCreditNoteFromSupplier=You have credit notes for %s %s from this vendor -CompanyHasNoAbsoluteDiscount=This customer has no discount credit available -CustomerAbsoluteDiscountAllUsers=Absolute customer discounts (granted by all users) -CustomerAbsoluteDiscountMy=Absolute customer discounts (granted by yourself) -SupplierAbsoluteDiscountAllUsers=Absolute vendor discounts (entered by all users) -SupplierAbsoluteDiscountMy=Absolute vendor discounts (entered by yourself) -DiscountNone=None -Vendor=Vendor -Supplier=Vendor -AddContact=Create contact -AddContactAddress=Create contact/address -EditContact=Edit contact -EditContactAddress=Edit contact/address -Contact=Contact/Address -Contacts=Contacts/Addresses -ContactId=Contact id -ContactsAddresses=Contacts/Addresses -FromContactName=Name: -NoContactDefinedForThirdParty=No contact defined for this third party -NoContactDefined=No contact defined -DefaultContact=Default contact/address -ContactByDefaultFor=Default contact/address for -AddThirdParty=Create third party -DeleteACompany=Delete a company -PersonalInformations=Personal data -AccountancyCode=Accounting account -CustomerCode=Customer Code -SupplierCode=Vendor Code -CustomerCodeShort=Customer Code -SupplierCodeShort=Vendor Code -CustomerCodeDesc=Customer Code, unique for all customers -SupplierCodeDesc=Vendor Code, unique for all vendors -RequiredIfCustomer=Required if third party is a customer or prospect -RequiredIfSupplier=Required if third party is a vendor -ValidityControledByModule=Validity controlled by the module -ThisIsModuleRules=Rules for this module -ProspectToContact=Prospect to contact -CompanyDeleted=Company "%s" deleted from database. -ListOfContacts=List of contacts/addresses -ListOfContactsAddresses=List of contacts/addresses -ListOfThirdParties=List of Third Parties -ShowCompany=Third Party -ShowContact=Contact-Address -ContactsAllShort=All (No filter) -ContactType=Contact type -ContactForOrders=Order's contact -ContactForOrdersOrShipments=Order's or shipment's contact -ContactForProposals=Proposal's contact -ContactForContracts=Contract's contact -ContactForInvoices=Invoice's contact -NoContactForAnyOrder=This contact is not a contact for any order -NoContactForAnyOrderOrShipments=This contact is not a contact for any order or shipment -NoContactForAnyProposal=This contact is not a contact for any commercial proposal -NoContactForAnyContract=This contact is not a contact for any contract -NoContactForAnyInvoice=This contact is not a contact for any invoice -NewContact=New contact -NewContactAddress=New Contact/Address -MyContacts=My contacts -Capital=Capital -CapitalOf=Capital of %s -EditCompany=Edit company -ThisUserIsNot=This user is not a prospect, customer or vendor -VATIntraCheck=Check -VATIntraCheckDesc=The VAT ID must include the country prefix. The link %s uses the European VAT checker service (VIES) which requires internet access from the Dolibarr server. -VATIntraCheckURL=http://ec.europa.eu/taxation_customs/vies/vieshome.do -VATIntraCheckableOnEUSite=Check the intra-Community VAT ID on the European Commission website -VATIntraManualCheck=You can also check manually on the European Commission website %s -ErrorVATCheckMS_UNAVAILABLE=Check not possible. Check service is not provided by the member state (%s). -NorProspectNorCustomer=Not prospect, nor customer -JuridicalStatus=Business entity type -Workforce=Workforce -Staff=Employees -ProspectLevelShort=Potential -ProspectLevel=Prospect potential -ContactPrivate=Private -ContactPublic=Shared -ContactVisibility=Visibility -ContactOthers=Other -OthersNotLinkedToThirdParty=Others, not linked to a third party -ProspectStatus=Prospect status -PL_NONE=None -PL_UNKNOWN=Unknown -PL_LOW=Low -PL_MEDIUM=Medium -PL_HIGH=High -TE_UNKNOWN=- -TE_STARTUP=Startup -TE_GROUP=Large company -TE_MEDIUM=Medium company -TE_ADMIN=Governmental -TE_SMALL=Small company -TE_RETAIL=Retailer -TE_WHOLE=Wholesaler -TE_PRIVATE=Private individual -TE_OTHER=Other -StatusProspect-1=Do not contact -StatusProspect0=Never contacted -StatusProspect1=To be contacted -StatusProspect2=Contact in process -StatusProspect3=Contact done -ChangeDoNotContact=Change status to 'Do not contact' -ChangeNeverContacted=Change status to 'Never contacted' -ChangeToContact=Change status to 'To be contacted' -ChangeContactInProcess=Change status to 'Contact in process' -ChangeContactDone=Change status to 'Contact done' -ProspectsByStatus=Prospects by status -NoParentCompany=None -ExportCardToFormat=Export card to format -ContactNotLinkedToCompany=Contact not linked to any third party -DolibarrLogin=Dolibarr login -NoDolibarrAccess=No Dolibarr access -ExportDataset_company_1=Third-parties (companies/foundations/physical people) and their properties -ExportDataset_company_2=Contacts and their properties -ImportDataset_company_1=Third-parties and their properties -ImportDataset_company_2=Third-parties additional contacts/addresses and attributes -ImportDataset_company_3=Third-parties Bank accounts -ImportDataset_company_4=Third-parties Sales representatives (assign sales representatives/users to companies) -PriceLevel=Price Level -PriceLevelLabels=Price Level Labels -DeliveryAddress=Delivery address -AddAddress=Add address -SupplierCategory=Vendor category -JuridicalStatus200=Independent -DeleteFile=Delete file -ConfirmDeleteFile=Are you sure you want to delete this file? -AllocateCommercial=Assigned to sales representative -Organization=Organization -FiscalYearInformation=Fiscal Year -FiscalMonthStart=Starting month of the fiscal year -SocialNetworksInformation=Social networks -SocialNetworksFacebookURL=Facebook URL -SocialNetworksTwitterURL=Twitter URL -SocialNetworksLinkedinURL=Linkedin URL -SocialNetworksInstagramURL=Instagram URL -SocialNetworksYoutubeURL=Youtube URL -SocialNetworksGithubURL=Github URL -YouMustAssignUserMailFirst=You must create an email for this user prior to being able to add an email notification. -YouMustCreateContactFirst=To be able to add email notifications, you must first define contacts with valid emails for the third party -ListSuppliersShort=List of Vendors -ListProspectsShort=List of Prospects -ListCustomersShort=List of Customers -ThirdPartiesArea=Third Parties/Contacts -LastModifiedThirdParties=Latest %s Third Parties which were modified -UniqueThirdParties=Total number of Third Parties -InActivity=Open -ActivityCeased=Closed -ThirdPartyIsClosed=Third party is closed -ProductsIntoElements=List of products/services mapped to %s -CurrentOutstandingBill=Current outstanding bill -OutstandingBill=Max. for outstanding bill -OutstandingBillReached=Max. for outstanding bill reached -OrderMinAmount=Minimum amount for order -MonkeyNumRefModelDesc=Return a number in the format %syymm-nnnn for the customer code and %syymm-nnnn for the vendor code where yy is year, mm is month and nnnn is a sequencial auto-incrementing number with no break and no return to 0. -LeopardNumRefModelDesc=The code is free. This code can be modified at any time. -ManagingDirectors=Manager(s) name (CEO, director, president...) -MergeOriginThirdparty=Duplicate third party (third party you want to delete) -MergeThirdparties=Merge third parties -ConfirmMergeThirdparties=Are you sure you want to merge the chosen third party with the current one? All linked objects (invoices, orders, ...) will be moved to the current third party, after which the chosen third party will be deleted. -ThirdpartiesMergeSuccess=Third parties have been merged -SaleRepresentativeLogin=Login of sales representative -SaleRepresentativeFirstname=First name of sales representative -SaleRepresentativeLastname=Last name of sales representative -ErrorThirdpartiesMerge=There was an error when deleting the third parties. Please check the log. Changes have been reverted. -NewCustomerSupplierCodeProposed=Customer or Vendor code already used, a new code is suggested -KeepEmptyIfGenericAddress=Keep this field empty if this address is a generic address -#Imports -PaymentTypeCustomer=Payment Type - Customer -PaymentTermsCustomer=Payment Terms - Customer -PaymentTypeSupplier=Payment Type - Vendor -PaymentTermsSupplier=Payment Term - Vendor -PaymentTypeBoth=Payment Type - Customer and Vendor -MulticurrencyUsed=Use Multicurrency -MulticurrencyCurrency=Currency -InEEC=Europe (EEC) -RestOfEurope=Rest of Europe (EEC) -OutOfEurope=Out of Europe (EEC) -CurrentOutstandingBillLate=Current outstanding bill late -BecarefullChangeThirdpartyBeforeAddProductToInvoice=Be carefull, depending on your product price settings, you should change thirdparty before adding product to POS. diff --git a/htdocs/langs/ar_IQ/compta.lang b/htdocs/langs/ar_IQ/compta.lang index 8329346c163..0b2ce4fa537 100644 --- a/htdocs/langs/ar_IQ/compta.lang +++ b/htdocs/langs/ar_IQ/compta.lang @@ -1,294 +1,5 @@ # Dolibarr language file - Source file is en_US - compta -MenuFinancial=Billing | Payment -TaxModuleSetupToModifyRules=Go to Taxes module setup to modify rules for calculation -TaxModuleSetupToModifyRulesLT=Go to Company setup to modify rules for calculation -OptionMode=Option for accountancy -OptionModeTrue=Option Incomes-Expenses -OptionModeVirtual=Option Claims-Debts -OptionModeTrueDesc=In this context, the turnover is calculated over payments (date of payments). The validity of the figures is assured only if the book-keeping is scrutinized through the input/output on the accounts via invoices. -OptionModeVirtualDesc=In this context, the turnover is calculated over invoices (date of validation). When these invoices are due, whether they have been paid or not, they are listed in the turnover output. -FeatureIsSupportedInInOutModeOnly=Feature only available in CREDITS-DEBTS accountancy mode (See Accountancy module configuration) -VATReportBuildWithOptionDefinedInModule=Amounts shown here are calculated using rules defined by Tax module setup. -LTReportBuildWithOptionDefinedInModule=Amounts shown here are calculated using rules defined by Company setup. -Param=Setup -RemainingAmountPayment=Amount payment remaining: -Account=Account -Accountparent=Parent account -Accountsparent=Parent accounts -Income=Income -Outcome=Expense -MenuReportInOut=Income / Expense -ReportInOut=Balance of income and expenses -ReportTurnover=Turnover invoiced -ReportTurnoverCollected=Turnover collected -PaymentsNotLinkedToInvoice=Payments not linked to any invoice, so not linked to any third party -PaymentsNotLinkedToUser=Payments not linked to any user -Profit=Profit -AccountingResult=Accounting result -BalanceBefore=Balance (before) -Balance=Balance -Debit=Debit -Credit=Credit -Piece=Accounting Doc. -AmountHTVATRealReceived=Net collected -AmountHTVATRealPaid=Net paid -VATToPay=Tax sales -VATReceived=Tax received -VATToCollect=Tax purchases -VATSummary=Tax monthly -VATBalance=Tax Balance -VATPaid=Tax paid -LT1Summary=Tax 2 summary -LT2Summary=Tax 3 summary -LT1SummaryES=RE Balance -LT2SummaryES=IRPF Balance -LT1SummaryIN=CGST Balance -LT2SummaryIN=SGST Balance -LT1Paid=Tax 2 paid -LT2Paid=Tax 3 paid -LT1PaidES=RE Paid -LT2PaidES=IRPF Paid -LT1PaidIN=CGST Paid -LT2PaidIN=SGST Paid -LT1Customer=Tax 2 sales -LT1Supplier=Tax 2 purchases -LT1CustomerES=RE sales -LT1SupplierES=RE purchases -LT1CustomerIN=CGST sales -LT1SupplierIN=CGST purchases -LT2Customer=Tax 3 sales -LT2Supplier=Tax 3 purchases -LT2CustomerES=IRPF sales -LT2SupplierES=IRPF purchases -LT2CustomerIN=SGST sales -LT2SupplierIN=SGST purchases -VATCollected=VAT collected -StatusToPay=To pay -SpecialExpensesArea=Area for all special payments -VATExpensesArea=Area for all TVA payments -SocialContribution=Social or fiscal tax -SocialContributions=Social or fiscal taxes -SocialContributionsDeductibles=Deductible social or fiscal taxes -SocialContributionsNondeductibles=Nondeductible social or fiscal taxes -DateOfSocialContribution=Date of social or fiscal tax -LabelContrib=Label contribution -TypeContrib=Type contribution -MenuSpecialExpenses=Special expenses -MenuTaxAndDividends=Taxes and dividends -MenuSocialContributions=Social/fiscal taxes -MenuNewSocialContribution=New social/fiscal tax -NewSocialContribution=New social/fiscal tax -AddSocialContribution=Add social/fiscal tax -ContributionsToPay=Social/fiscal taxes to pay -AccountancyTreasuryArea=Billing and payment area -NewPayment=New payment -PaymentCustomerInvoice=Customer invoice payment -PaymentSupplierInvoice=vendor invoice payment -PaymentSocialContribution=Social/fiscal tax payment -PaymentVat=VAT payment -AutomaticCreationPayment=Automatically record the payment -ListPayment=List of payments -ListOfCustomerPayments=List of customer payments -ListOfSupplierPayments=List of vendor payments -DateStartPeriod=Date start period -DateEndPeriod=Date end period -newLT1Payment=New tax 2 payment -newLT2Payment=New tax 3 payment -LT1Payment=Tax 2 payment -LT1Payments=Tax 2 payments -LT2Payment=Tax 3 payment -LT2Payments=Tax 3 payments -newLT1PaymentES=New RE payment -newLT2PaymentES=New IRPF payment -LT1PaymentES=RE Payment -LT1PaymentsES=RE Payments -LT2PaymentES=IRPF Payment -LT2PaymentsES=IRPF Payments -VATPayment=Sales tax payment -VATPayments=Sales tax payments -VATDeclarations=VAT declarations -VATDeclaration=VAT declaration -VATRefund=Sales tax refund -NewVATPayment=New sales tax payment -NewLocalTaxPayment=New tax %s payment -Refund=Refund -SocialContributionsPayments=Social/fiscal taxes payments -ShowVatPayment=Show VAT payment -TotalToPay=Total to pay -BalanceVisibilityDependsOnSortAndFilters=Balance is visible in this list only if table is sorted on %s and filtered on 1 bank account (with no other filters) -CustomerAccountancyCode=Customer accounting code -SupplierAccountancyCode=Vendor accounting code -CustomerAccountancyCodeShort=Cust. account. code -SupplierAccountancyCodeShort=Sup. account. code -AccountNumber=Account number -NewAccountingAccount=New account -Turnover=Turnover invoiced -TurnoverCollected=Turnover collected -SalesTurnoverMinimum=Minimum turnover -ByExpenseIncome=By expenses & incomes -ByThirdParties=By third parties -ByUserAuthorOfInvoice=By invoice author -CheckReceipt=Check deposit -CheckReceiptShort=Check deposit -LastCheckReceiptShort=Latest %s check receipts -NewCheckReceipt=New discount -NewCheckDeposit=New check deposit -NewCheckDepositOn=Create receipt for deposit on account: %s -NoWaitingChecks=No checks awaiting deposit. -DateChequeReceived=Check receiving date -NbOfCheques=No. of checks -PaySocialContribution=Pay a social/fiscal tax -PayVAT=Pay a VAT declaration -PaySalary=Pay a salary card -ConfirmPaySocialContribution=Are you sure you want to classify this social or fiscal tax as paid ? -ConfirmPayVAT=Are you sure you want to classify this VAT declaration as paid ? -ConfirmPaySalary=Are you sure you want to classify this salary card as paid? -DeleteSocialContribution=Delete a social or fiscal tax payment -DeleteVAT=Delete a VAT declaration -DeleteSalary=Delete a salary card -ConfirmDeleteSocialContribution=Are you sure you want to delete this social/fiscal tax payment ? -ConfirmDeleteVAT=Are you sure you want to delete this VAT declaration ? -ConfirmDeleteSalary=Are you sure you want to delete this salary? -ExportDataset_tax_1=Social and fiscal taxes and payments -CalcModeVATDebt=Mode %sVAT on commitment accounting%s. -CalcModeVATEngagement=Mode %sVAT on incomes-expenses%s. -CalcModeDebt=Analysis of known recorded documents even if they are not yet accounted in ledger. -CalcModeEngagement=Analysis of known recorded payments, even if they are not yet accounted in Ledger. -CalcModeBookkeeping=Analysis of data journalized in Bookkeeping Ledger table. -CalcModeLT1= Mode %sRE on customer invoices - suppliers invoices%s -CalcModeLT1Debt=Mode %sRE on customer invoices%s -CalcModeLT1Rec= Mode %sRE on suppliers invoices%s -CalcModeLT2= Mode %sIRPF on customer invoices - suppliers invoices%s -CalcModeLT2Debt=Mode %sIRPF on customer invoices%s -CalcModeLT2Rec= Mode %sIRPF on suppliers invoices%s -AnnualSummaryDueDebtMode=Balance of income and expenses, annual summary -AnnualSummaryInputOutputMode=Balance of income and expenses, annual summary -AnnualByCompanies=Balance of income and expenses, by predefined groups of account -AnnualByCompaniesDueDebtMode=Balance of income and expenses, detail by predefined groups, mode %sClaims-Debts%s said Commitment accounting. -AnnualByCompaniesInputOutputMode=Balance of income and expenses, detail by predefined groups, mode %sIncomes-Expenses%s said cash accounting. -SeeReportInInputOutputMode=See %sanalysis of payments%s for a calculation based on recorded payments made even if they are not yet accounted in Ledger -SeeReportInDueDebtMode=See %sanalysis of recorded documents%s for a calculation based on known recorded documents even if they are not yet accounted in Ledger -SeeReportInBookkeepingMode=See %sanalysis of bookeeping ledger table%s for a report based on Bookkeeping Ledger table -RulesAmountWithTaxIncluded=- Amounts shown are with all taxes included -RulesResultDue=- It includes outstanding invoices, expenses, VAT, donations whether they are paid or not. Is also includes paid salaries.
    - It is based on the billing date of invoices and on the due date for expenses or tax payments. For salaries defined with Salary module, the value date of payment is used. -RulesResultInOut=- It includes the real payments made on invoices, expenses, VAT and salaries.
    - It is based on the payment dates of the invoices, expenses, VAT and salaries. The donation date for donation. -RulesCADue=- It includes the customer's due invoices whether they are paid or not.
    - It is based on the billing date of these invoices.
    -RulesCAIn=- It includes all the effective payments of invoices received from customers.
    - It is based on the payment date of these invoices
    -RulesCATotalSaleJournal=It includes all credit lines from the Sale journal. -RulesSalesTurnoverOfIncomeAccounts=It includes (credit - debit) of lines for product accounts in group INCOME -RulesAmountOnInOutBookkeepingRecord=It includes record in your Ledger with accounting accounts that has the group "EXPENSE" or "INCOME" -RulesResultBookkeepingPredefined=It includes record in your Ledger with accounting accounts that has the group "EXPENSE" or "INCOME" -RulesResultBookkeepingPersonalized=It show record in your Ledger with accounting accounts grouped by personalized groups -SeePageForSetup=See menu %s for setup -DepositsAreNotIncluded=- Down payment invoices are not included -DepositsAreIncluded=- Down payment invoices are included -LT1ReportByMonth=Tax 2 report by month -LT2ReportByMonth=Tax 3 report by month -LT1ReportByCustomers=Report tax 2 by third party -LT2ReportByCustomers=Report tax 3 by third party -LT1ReportByCustomersES=Report by third party RE -LT2ReportByCustomersES=Report by third party IRPF -VATReport=Sale tax report -VATReportByPeriods=Sale tax report by period -VATReportByMonth=Sale tax report by month -VATReportByRates=Sale tax report by rates -VATReportByThirdParties=Sale tax report by third parties -VATReportByCustomers=Sale tax report by customer -VATReportByCustomersInInputOutputMode=Report by the customer VAT collected and paid -VATReportByQuartersInInputOutputMode=Report by Sale tax rate of the tax collected and paid -VATReportShowByRateDetails=Show details of this rate -LT1ReportByQuarters=Report tax 2 by rate -LT2ReportByQuarters=Report tax 3 by rate -LT1ReportByQuartersES=Report by RE rate -LT2ReportByQuartersES=Report by IRPF rate SeeVATReportInInputOutputMode=See report %sVAT encasement%s for a standard calculation SeeVATReportInDueDebtMode=See report %sVAT on flow%s for a calculation with an option on the flow RulesVATInServices=- For services, the report includes the VAT regulations actually received or issued on the basis of the date of payment. -RulesVATInProducts=- For material assets, the report includes the VAT received or issued on the basis of the date of payment. RulesVATDueServices=- For services, the report includes VAT invoices due, paid or not, based on the invoice date. -RulesVATDueProducts=- For material assets, the report includes the VAT invoices, based on the invoice date. -OptionVatInfoModuleComptabilite=Note: For material assets, it should use the date of delivery to be more fair. -ThisIsAnEstimatedValue=This is a preview, based on business events and not from the final ledger table, so final results may differ from this preview values -PercentOfInvoice=%%/invoice -NotUsedForGoods=Not used on goods -ProposalStats=Statistics on proposals -OrderStats=Statistics on orders -InvoiceStats=Statistics on bills -Dispatch=Dispatching -Dispatched=Dispatched -ToDispatch=To dispatch -ThirdPartyMustBeEditAsCustomer=Third party must be defined as a customer -SellsJournal=Sales Journal -PurchasesJournal=Purchases Journal -DescSellsJournal=Sales Journal -DescPurchasesJournal=Purchases Journal -CodeNotDef=Not defined -WarningDepositsNotIncluded=Down payment invoices are not included in this version with this accountancy module. -DatePaymentTermCantBeLowerThanObjectDate=Payment term date can't be lower than object date. -Pcg_version=Chart of accounts models -Pcg_type=Pcg type -Pcg_subtype=Pcg subtype -InvoiceLinesToDispatch=Invoice lines to dispatch -ByProductsAndServices=By product and service -RefExt=External ref -ToCreateAPredefinedInvoice=To create a template invoice, create a standard invoice, then, without validating it, click on button "%s". -LinkedOrder=Link to order -Mode1=Method 1 -Mode2=Method 2 -CalculationRuleDesc=To calculate total VAT, there is two methods:
    Method 1 is rounding vat on each line, then summing them.
    Method 2 is summing all vat on each line, then rounding result.
    Final result may differs from few cents. Default mode is mode %s. -CalculationRuleDescSupplier=According to vendor, choose appropriate method to apply same calculation rule and get same result expected by your vendor. -TurnoverPerProductInCommitmentAccountingNotRelevant=The report of Turnover collected per product is not available. This report is only available for turnover invoiced. -TurnoverPerSaleTaxRateInCommitmentAccountingNotRelevant=The report of Turnover collected per sale tax rate is not available. This report is only available for turnover invoiced. -CalculationMode=Calculation mode -AccountancyJournal=Accounting code journal -ACCOUNTING_VAT_SOLD_ACCOUNT=Accounting account by default for VAT on sales (used if not defined on VAT dictionary setup) -ACCOUNTING_VAT_BUY_ACCOUNT=Accounting account by default for VAT on purchases (used if not defined on VAT dictionary setup) -ACCOUNTING_VAT_PAY_ACCOUNT=Accounting account by default for paying VAT -ACCOUNTING_ACCOUNT_CUSTOMER=Accounting account used for customer third parties -ACCOUNTING_ACCOUNT_CUSTOMER_Desc=The dedicated accounting account defined on third party card will be used for Subledger accounting only. This one will be used for General Ledger and as default value of Subledger accounting if dedicated customer accounting account on third party is not defined. -ACCOUNTING_ACCOUNT_SUPPLIER=Accounting account used for vendor third parties -ACCOUNTING_ACCOUNT_SUPPLIER_Desc=The dedicated accounting account defined on third party card will be used for Subledger accounting only. This one will be used for General Ledger and as default value of Subledger accounting if dedicated vendor accounting account on third party is not defined. -ConfirmCloneTax=Confirm the clone of a social/fiscal tax -ConfirmCloneVAT=Confirm the clone of a VAT declaration -ConfirmCloneSalary=Confirm the clone of a salary -CloneTaxForNextMonth=Clone it for next month -SimpleReport=Simple report -AddExtraReport=Extra reports (add foreign and national customer report) -OtherCountriesCustomersReport=Foreign customers report -BasedOnTwoFirstLettersOfVATNumberBeingDifferentFromYourCompanyCountry=Based on the two first letters of the VAT number being different from your own company's country code -SameCountryCustomersWithVAT=National customers report -BasedOnTwoFirstLettersOfVATNumberBeingTheSameAsYourCompanyCountry=Based on the two first letters of the VAT number being the same as your own company's country code -LinkedFichinter=Link to an intervention -ImportDataset_tax_contrib=Social/fiscal taxes -ImportDataset_tax_vat=Vat payments -ErrorBankAccountNotFound=Error: Bank account not found -FiscalPeriod=Accounting period -ListSocialContributionAssociatedProject=List of social contributions associated with the project -DeleteFromCat=Remove from accounting group -AccountingAffectation=Accounting assignment -LastDayTaxIsRelatedTo=Last day of period the tax is related to -VATDue=Sale tax claimed -ClaimedForThisPeriod=Claimed for the period -PaidDuringThisPeriod=Paid for this period -PaidDuringThisPeriodDesc=This is the sum of all payments linked to VAT declarations which have an end-of-period date in the selected date range -ByVatRate=By sale tax rate -TurnoverbyVatrate=Turnover invoiced by sale tax rate -TurnoverCollectedbyVatrate=Turnover collected by sale tax rate -PurchasebyVatrate=Purchase by sale tax rate -LabelToShow=Short label -PurchaseTurnover=Purchase turnover -PurchaseTurnoverCollected=Purchase turnover collected -RulesPurchaseTurnoverDue=- It includes the supplier's due invoices whether they are paid or not.
    - It is based on the invoice date of these invoices.
    -RulesPurchaseTurnoverIn=- It includes all the effective payments of invoices done to suppliers.
    - It is based on the payment date of these invoices
    -RulesPurchaseTurnoverTotalPurchaseJournal=It includes all debit lines from the purchase journal. -RulesPurchaseTurnoverOfExpenseAccounts=It includes (debit - credit) of lines for product accounts in group EXPENSE -ReportPurchaseTurnover=Purchase turnover invoiced -ReportPurchaseTurnoverCollected=Purchase turnover collected -IncludeVarpaysInResults = Include various payments in reports -IncludeLoansInResults = Include loans in reports -InvoiceLate30Days = Invoices late > 30 days -InvoiceLate15Days = Invoices late > 15 days -InvoiceLateMinus15Days = Invoices late -InvoiceNotLate = To be collected < 15 days -InvoiceNotLate15Days = To be collected in 15 days -InvoiceNotLate30Days = To be collected in 30 days diff --git a/htdocs/langs/ar_IQ/contracts.lang b/htdocs/langs/ar_IQ/contracts.lang deleted file mode 100644 index a9ac308142a..00000000000 --- a/htdocs/langs/ar_IQ/contracts.lang +++ /dev/null @@ -1,104 +0,0 @@ -# Dolibarr language file - Source file is en_US - contracts -ContractsArea=Contracts area -ListOfContracts=List of contracts -AllContracts=All contracts -ContractCard=Contract card -ContractStatusNotRunning=Not running -ContractStatusDraft=Draft -ContractStatusValidated=Validated -ContractStatusClosed=Closed -ServiceStatusInitial=Not running -ServiceStatusRunning=Running -ServiceStatusNotLate=Running, not expired -ServiceStatusNotLateShort=Not expired -ServiceStatusLate=Running, expired -ServiceStatusLateShort=Expired -ServiceStatusClosed=Closed -ShowContractOfService=Show contract of service -Contracts=Contracts -ContractsSubscriptions=Contracts/Subscriptions -ContractsAndLine=Contracts and line of contracts -Contract=Contract -ContractLine=Contract line -Closing=Closing -NoContracts=No contracts -MenuServices=Services -MenuInactiveServices=Services not active -MenuRunningServices=Running services -MenuExpiredServices=Expired services -MenuClosedServices=Closed services -NewContract=New contract -NewContractSubscription=New contract or subscription -AddContract=Create contract -DeleteAContract=Delete a contract -ActivateAllOnContract=Activate all services -CloseAContract=Close a contract -ConfirmDeleteAContract=Are you sure you want to delete this contract and all its services? -ConfirmValidateContract=Are you sure you want to validate this contract under name %s? -ConfirmActivateAllOnContract=This will open all services (not yet active). Are you sure you want to open all services? -ConfirmCloseContract=This will close all services (active or not). Are you sure you want to close this contract? -ConfirmCloseService=Are you sure you want to close this service with date %s? -ValidateAContract=Validate a contract -ActivateService=Activate service -ConfirmActivateService=Are you sure you want to activate this service with date %s? -RefContract=Contract reference -DateContract=Contract date -DateServiceActivate=Service activation date -ListOfServices=List of services -ListOfInactiveServices=List of not active services -ListOfExpiredServices=List of expired active services -ListOfClosedServices=List of closed services -ListOfRunningServices=List of running services -NotActivatedServices=Inactive services (among validated contracts) -BoardNotActivatedServices=Services to activate among validated contracts -BoardNotActivatedServicesShort=Services to activate -LastContracts=Latest %s contracts -LastModifiedServices=Latest %s modified services -ContractStartDate=Start date -ContractEndDate=End date -DateStartPlanned=Planned start date -DateStartPlannedShort=Planned start date -DateEndPlanned=Planned end date -DateEndPlannedShort=Planned end date -DateStartReal=Real start date -DateStartRealShort=Real start date -DateEndReal=Real end date -DateEndRealShort=Real end date -CloseService=Close service -BoardRunningServices=Services running -BoardRunningServicesShort=Services running -BoardExpiredServices=Services expired -BoardExpiredServicesShort=Services expired -ServiceStatus=Status of service -DraftContracts=Drafts contracts -CloseRefusedBecauseOneServiceActive=Contract can't be closed as there is at least one open service on it -ActivateAllContracts=Activate all contract lines -CloseAllContracts=Close all contract lines -DeleteContractLine=Delete a contract line -ConfirmDeleteContractLine=Are you sure you want to delete this contract line? -MoveToAnotherContract=Move service into another contract. -ConfirmMoveToAnotherContract=I choosed new target contract and confirm I want to move this service into this contract. -ConfirmMoveToAnotherContractQuestion=Choose in which existing contract (of same third party), you want to move this service to? -PaymentRenewContractId=Renew contract line (number %s) -ExpiredSince=Expiration date -NoExpiredServices=No expired active services -ListOfServicesToExpireWithDuration=List of Services to expire in %s days -ListOfServicesToExpireWithDurationNeg=List of Services expired from more than %s days -ListOfServicesToExpire=List of Services to expire -NoteListOfYourExpiredServices=This list contains only services of contracts for third parties you are linked to as a sale representative. -StandardContractsTemplate=Standard contracts template -ContactNameAndSignature=For %s, name and signature: -OnlyLinesWithTypeServiceAreUsed=Only lines with type "Service" will be cloned. -ConfirmCloneContract=Are you sure you want to clone the contract %s? -LowerDateEndPlannedShort=Lower planned end date of active services -SendContractRef=Contract information __REF__ -OtherContracts=Other contracts -##### Types de contacts ##### -TypeContact_contrat_internal_SALESREPSIGN=Sales representative signing contract -TypeContact_contrat_internal_SALESREPFOLL=Sales representative following-up contract -TypeContact_contrat_external_BILLING=Billing customer contact -TypeContact_contrat_external_CUSTOMER=Follow-up customer contact -TypeContact_contrat_external_SALESREPSIGN=Signing contract customer contact -HideClosedServiceByDefault=Hide closed services by default -ShowClosedServices=Show Closed Services -HideClosedServices=Hide Closed Services diff --git a/htdocs/langs/ar_IQ/cron.lang b/htdocs/langs/ar_IQ/cron.lang deleted file mode 100644 index 4fd2220dea6..00000000000 --- a/htdocs/langs/ar_IQ/cron.lang +++ /dev/null @@ -1,91 +0,0 @@ -# Dolibarr language file - Source file is en_US - cron -# About page -# Right -Permission23101 = Read Scheduled job -Permission23102 = Create/update Scheduled job -Permission23103 = Delete Scheduled job -Permission23104 = Execute Scheduled job -# Admin -CronSetup=Scheduled job management setup -URLToLaunchCronJobs=URL to check and launch qualified cron jobs from a browser -OrToLaunchASpecificJob=Or to check and launch a specific job from a browser -KeyForCronAccess=Security key for URL to launch cron jobs -FileToLaunchCronJobs=Command line to check and launch qualified cron jobs -CronExplainHowToRunUnix=On Unix environment you should use the following crontab entry to run the command line each 5 minutes -CronExplainHowToRunWin=On Microsoft(tm) Windows environment you can use Scheduled Task tools to run the command line each 5 minutes -CronMethodDoesNotExists=Class %s does not contains any method %s -CronMethodNotAllowed=Method %s of class %s is in blacklist of forbidden methods -CronJobDefDesc=Cron job profiles are defined into the module descriptor file. When module is activated, they are loaded and available so you can administer the jobs from the admin tools menu %s. -CronJobProfiles=List of predefined cron job profiles -# Menu -EnabledAndDisabled=Enabled and disabled -# Page list -CronLastOutput=Latest run output -CronLastResult=Latest result code -CronCommand=Command -CronList=Scheduled jobs -CronDelete=Delete scheduled jobs -CronConfirmDelete=Are you sure you want to delete these scheduled jobs? -CronExecute=Launch scheduled job -CronConfirmExecute=Are you sure you want to execute these scheduled jobs now? -CronInfo=Scheduled job module allows to schedule jobs to execute them automatically. Jobs can also be started manually. -CronTask=Job -CronNone=None -CronDtStart=Not before -CronDtEnd=Not after -CronDtNextLaunch=Next execution -CronDtLastLaunch=Start date of latest execution -CronDtLastResult=End date of latest execution -CronFrequency=Frequency -CronClass=Class -CronMethod=Method -CronModule=Module -CronNoJobs=No jobs registered -CronPriority=Priority -CronLabel=Label -CronNbRun=Number of launches -CronMaxRun=Maximum number of launches -CronEach=Every -JobFinished=Job launched and finished -Scheduled=Scheduled -#Page card -CronAdd= Add jobs -CronEvery=Execute job each -CronObject=Instance/Object to create -CronArgs=Parameters -CronSaveSucess=Save successfully -CronNote=Comment -CronFieldMandatory=Fields %s is mandatory -CronErrEndDateStartDt=End date cannot be before start date -StatusAtInstall=Status at module installation -CronStatusActiveBtn=Schedule -CronStatusInactiveBtn=Disable -CronTaskInactive=This job is disabled (not scheduled) -CronId=Id -CronClassFile=Filename with class -CronModuleHelp=Name of Dolibarr module directory (also work with external Dolibarr module).
    For example to call the fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value for module is
    product -CronClassFileHelp=The relative path and file name to load (path is relative to web server root directory).
    For example to call the fetch method of Dolibarr Product object htdocs/product/class/product.class.php, the value for class file name is
    product/class/product.class.php -CronObjectHelp=The object name to load.
    For example to call the fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value for class file name is
    Product -CronMethodHelp=The object method to launch.
    For example to call the fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value for method is
    fetch -CronArgsHelp=The method arguments.
    For example to call the fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value for paramters can be
    0, ProductRef -CronCommandHelp=The system command line to execute. -CronCreateJob=Create new Scheduled Job -CronFrom=From -# Info -# Common -CronType=Job type -CronType_method=Call method of a PHP Class -CronType_command=Shell command -CronCannotLoadClass=Cannot load class file %s (to use class %s) -CronCannotLoadObject=Class file %s was loaded, but object %s was not found into it -UseMenuModuleToolsToAddCronJobs=Go into menu "Home - Admin tools - Scheduled jobs" to see and edit scheduled jobs. -JobDisabled=Job disabled -MakeLocalDatabaseDumpShort=Local database backup -MakeLocalDatabaseDump=Create a local database dump. Parameters are: compression ('gz' or 'bz' or 'none'), backup type ('mysql', 'pgsql', 'auto'), 1, 'auto' or filename to build, number of backup files to keep -WarningCronDelayed=Attention, for performance purpose, whatever is next date of execution of enabled jobs, your jobs may be delayed to a maximum of %s hours, before being run. -DATAPOLICYJob=Data cleaner and anonymizer -JobXMustBeEnabled=Job %s must be enabled -# Cron Boxes -LastExecutedScheduledJob=Last executed scheduled job -NextScheduledJobExecute=Next scheduled job to execute -NumberScheduledJobError=Number of scheduled jobs in error diff --git a/htdocs/langs/ar_IQ/deliveries.lang b/htdocs/langs/ar_IQ/deliveries.lang deleted file mode 100644 index cd8a36e6c70..00000000000 --- a/htdocs/langs/ar_IQ/deliveries.lang +++ /dev/null @@ -1,33 +0,0 @@ -# Dolibarr language file - Source file is en_US - deliveries -Delivery=Delivery -DeliveryRef=Ref Delivery -DeliveryCard=Receipt card -DeliveryOrder=Delivery receipt -DeliveryDate=Delivery date -CreateDeliveryOrder=Generate delivery receipt -DeliveryStateSaved=Delivery state saved -SetDeliveryDate=Set shipping date -ValidateDeliveryReceipt=Validate delivery receipt -ValidateDeliveryReceiptConfirm=Are you sure you want to validate this delivery receipt? -DeleteDeliveryReceipt=Delete delivery receipt -DeleteDeliveryReceiptConfirm=Are you sure you want to delete delivery receipt %s? -DeliveryMethod=Delivery method -TrackingNumber=Tracking number -DeliveryNotValidated=Delivery not validated -StatusDeliveryCanceled=Canceled -StatusDeliveryDraft=Draft -StatusDeliveryValidated=Received -# merou PDF model -NameAndSignature=Name and Signature: -ToAndDate=To___________________________________ on ____/_____/__________ -GoodStatusDeclaration=Have received the goods above in good condition, -Deliverer=Deliverer: -Sender=Sender -Recipient=Recipient -ErrorStockIsNotEnough=There's not enough stock -Shippable=Shippable -NonShippable=Not Shippable -ShowShippableStatus=Show shippable status -ShowReceiving=Show delivery receipt -NonExistentOrder=Nonexistent order -StockQuantitiesAlreadyAllocatedOnPreviousLines = Stock quantities already allocated on previous lines diff --git a/htdocs/langs/ar_IQ/dict.lang b/htdocs/langs/ar_IQ/dict.lang deleted file mode 100644 index 0524cf1ca18..00000000000 --- a/htdocs/langs/ar_IQ/dict.lang +++ /dev/null @@ -1,359 +0,0 @@ -# Dolibarr language file - Source file is en_US - dict -CountryFR=France -CountryBE=Belgium -CountryIT=Italy -CountryES=Spain -CountryDE=Germany -CountryCH=Switzerland -# Warning, country code GB is for United Kingdom. UK Does not exists as country code in ISO standard. -CountryGB=United Kingdom -CountryUK=United Kingdom -CountryIE=Ireland -CountryCN=China -CountryTN=Tunisia -CountryUS=United States -CountryMA=Morocco -CountryDZ=Algeria -CountryCA=Canada -CountryTG=Togo -CountryGA=Gabon -CountryNL=Netherlands -CountryHU=Hungary -CountryRU=Russia -CountrySE=Sweden -CountryCI=Ivory Coast -CountrySN=Senegal -CountryAR=Argentina -CountryCM=Cameroon -CountryPT=Portugal -CountrySA=Saudi Arabia -CountryMC=Monaco -CountryAU=Australia -CountrySG=Singapore -CountryAF=Afghanistan -CountryAX=Åland Islands -CountryAL=Albania -CountryAS=American Samoa -CountryAD=Andorra -CountryAO=Angola -CountryAI=Anguilla -CountryAQ=Antarctica -CountryAG=Antigua and Barbuda -CountryAM=Armenia -CountryAW=Aruba -CountryAT=Austria -CountryAZ=Azerbaijan -CountryBS=Bahamas -CountryBH=Bahrain -CountryBD=Bangladesh -CountryBB=Barbados -CountryBY=Belarus -CountryBZ=Belize -CountryBJ=Benin -CountryBM=Bermuda -CountryBT=Bhutan -CountryBO=Bolivia -CountryBA=Bosnia and Herzegovina -CountryBW=Botswana -CountryBV=Bouvet Island -CountryBR=Brazil -CountryIO=British Indian Ocean Territory -CountryBN=Brunei Darussalam -CountryBG=Bulgaria -CountryBF=Burkina Faso -CountryBI=Burundi -CountryKH=Cambodia -CountryCV=Cape Verde -CountryKY=Cayman Islands -CountryCF=Central African Republic -CountryTD=Chad -CountryCL=Chile -CountryCX=Christmas Island -CountryCC=Cocos (Keeling) Islands -CountryCO=Colombia -CountryKM=Comoros -CountryCG=Congo -CountryCD=Congo, The Democratic Republic of the -CountryCK=Cook Islands -CountryCR=Costa Rica -CountryHR=Croatia -CountryCU=Cuba -CountryCY=Cyprus -CountryCZ=Czech Republic -CountryDK=Denmark -CountryDJ=Djibouti -CountryDM=Dominica -CountryDO=Dominican Republic -CountryEC=Ecuador -CountryEG=Egypt -CountrySV=El Salvador -CountryGQ=Equatorial Guinea -CountryER=Eritrea -CountryEE=Estonia -CountryET=Ethiopia -CountryFK=Falkland Islands -CountryFO=Faroe Islands -CountryFJ=Fiji Islands -CountryFI=Finland -CountryGF=French Guiana -CountryPF=French Polynesia -CountryTF=French Southern Territories -CountryGM=Gambia -CountryGE=Georgia -CountryGH=Ghana -CountryGI=Gibraltar -CountryGR=Greece -CountryGL=Greenland -CountryGD=Grenada -CountryGP=Guadeloupe -CountryGU=Guam -CountryGT=Guatemala -CountryGN=Guinea -CountryGW=Guinea-Bissau -CountryGY=Guyana -CountryHT=Haïti -CountryHM=Heard Island and McDonald -CountryVA=Holy See (Vatican City State) -CountryHN=Honduras -CountryHK=Hong Kong -CountryIS=Iceland -CountryIN=India -CountryID=Indonesia -CountryIR=Iran -CountryIQ=Iraq -CountryIL=Israel -CountryJM=Jamaica -CountryJP=Japan -CountryJO=Jordan -CountryKZ=Kazakhstan -CountryKE=Kenya -CountryKI=Kiribati -CountryKP=North Korea -CountryKR=South Korea -CountryKW=Kuwait -CountryKG=Kyrgyzstan -CountryLA=Lao -CountryLV=Latvia -CountryLB=Lebanon -CountryLS=Lesotho -CountryLR=Liberia -CountryLY=Libyan -CountryLI=Liechtenstein -CountryLT=Lithuania -CountryLU=Luxembourg -CountryMO=Macao -CountryMK=Macedonia, the former Yugoslav of -CountryMG=Madagascar -CountryMW=Malawi -CountryMY=Malaysia -CountryMV=Maldives -CountryML=Mali -CountryMT=Malta -CountryMH=Marshall Islands -CountryMQ=Martinique -CountryMR=Mauritania -CountryMU=Mauritius -CountryYT=Mayotte -CountryMX=Mexico -CountryFM=Micronesia -CountryMD=Moldova -CountryMN=Mongolia -CountryMS=Monserrat -CountryMZ=Mozambique -CountryMM=Myanmar (Burma) -CountryNA=Namibia -CountryNR=Nauru -CountryNP=Nepal -CountryAN=Netherlands Antilles -CountryNC=New Caledonia -CountryNZ=New Zealand -CountryNI=Nicaragua -CountryNE=Niger -CountryNG=Nigeria -CountryNU=Niue -CountryNF=Norfolk Island -CountryMP=Northern Mariana Islands -CountryNO=Norway -CountryOM=Oman -CountryPK=Pakistan -CountryPW=Palau -CountryPS=Palestinian Territory, Occupied -CountryPA=Panama -CountryPG=Papua New Guinea -CountryPY=Paraguay -CountryPE=Peru -CountryPH=Philippines -CountryPN=Pitcairn Islands -CountryPL=Poland -CountryPR=Puerto Rico -CountryQA=Qatar -CountryRE=Reunion -CountryRO=Romania -CountryRW=Rwanda -CountrySH=Saint Helena -CountryKN=Saint Kitts and Nevis -CountryLC=Saint Lucia -CountryPM=Saint Pierre and Miquelon -CountryVC=Saint Vincent and Grenadines -CountryWS=Samoa -CountrySM=San Marino -CountryST=Sao Tome and Principe -CountryRS=Serbia -CountrySC=Seychelles -CountrySL=Sierra Leone -CountrySK=Slovakia -CountrySI=Slovenia -CountrySB=Solomon Islands -CountrySO=Somalia -CountryZA=South Africa -CountryGS=South Georgia and the South Sandwich Islands -CountryLK=Sri Lanka -CountrySD=Sudan -CountrySR=Suriname -CountrySJ=Svalbard and Jan Mayen -CountrySZ=Swaziland -CountrySY=Syrian -CountryTW=Taiwan -CountryTJ=Tajikistan -CountryTZ=Tanzania -CountryTH=Thailand -CountryTL=Timor-Leste -CountryTK=Tokelau -CountryTO=Tonga -CountryTT=Trinidad and Tobago -CountryTR=Turkey -CountryTM=Turkmenistan -CountryTC=Turks and Caicos Islands -CountryTV=Tuvalu -CountryUG=Uganda -CountryUA=Ukraine -CountryAE=United Arab Emirates -CountryUM=United States Minor Outlying Islands -CountryUY=Uruguay -CountryUZ=Uzbekistan -CountryVU=Vanuatu -CountryVE=Venezuela -CountryVN=Viet Nam -CountryVG=Virgin Islands, British -CountryVI=Virgin Islands, U.S. -CountryWF=Wallis and Futuna -CountryEH=Western Sahara -CountryYE=Yemen -CountryZM=Zambia -CountryZW=Zimbabwe -CountryGG=Guernsey -CountryIM=Isle of Man -CountryJE=Jersey -CountryME=Montenegro -CountryBL=Saint Barthelemy -CountryMF=Saint Martin - -##### Civilities ##### -CivilityMME=Mrs. -CivilityMR=Mr. -CivilityMLE=Ms. -CivilityMTRE=Master -CivilityDR=Doctor -##### Currencies ##### -Currencyeuros=Euros -CurrencyAUD=AU Dollars -CurrencySingAUD=AU Dollar -CurrencyCAD=CAN Dollars -CurrencySingCAD=CAN Dollar -CurrencyCHF=Swiss Francs -CurrencySingCHF=Swiss Franc -CurrencyEUR=Euros -CurrencySingEUR=Euro -CurrencyFRF=French Francs -CurrencySingFRF=French Franc -CurrencyGBP=GB Pounds -CurrencySingGBP=GB Pound -CurrencyINR=Indian rupees -CurrencySingINR=Indian rupee -CurrencyMAD=Dirham -CurrencySingMAD=Dirham -CurrencyMGA=Ariary -CurrencySingMGA=Ariary -CurrencyMUR=Mauritius rupees -CurrencySingMUR=Mauritius rupee -CurrencyNOK=Norwegian krones -CurrencySingNOK=Norwegian kronas -CurrencyTND=Tunisian dinars -CurrencySingTND=Tunisian dinar -CurrencyUSD=US Dollars -CurrencySingUSD=US Dollar -CurrencyUAH=Hryvnia -CurrencySingUAH=Hryvnia -CurrencyXAF=CFA Francs BEAC -CurrencySingXAF=CFA Franc BEAC -CurrencyXOF=CFA Francs BCEAO -CurrencySingXOF=CFA Franc BCEAO -CurrencyXPF=CFP Francs -CurrencySingXPF=CFP Franc -CurrencyCentEUR=cents -CurrencyCentSingEUR=cent -CurrencyCentINR=paisa -CurrencyCentSingINR=paise -CurrencyThousandthSingTND=thousandth -#### Input reasons ##### -DemandReasonTypeSRC_INTE=Internet -DemandReasonTypeSRC_CAMP_MAIL=Mailing campaign -DemandReasonTypeSRC_CAMP_EMAIL=EMailing campaign -DemandReasonTypeSRC_CAMP_PHO=Phone campaign -DemandReasonTypeSRC_CAMP_FAX=Fax campaign -DemandReasonTypeSRC_COMM=Commercial contact -DemandReasonTypeSRC_SHOP=Shop contact -DemandReasonTypeSRC_WOM=Word of mouth -DemandReasonTypeSRC_PARTNER=Partner -DemandReasonTypeSRC_EMPLOYEE=Employee -DemandReasonTypeSRC_SPONSORING=Sponsorship -DemandReasonTypeSRC_SRC_CUSTOMER=Incoming contact of a customer -#### Paper formats #### -PaperFormatEU4A0=Format 4A0 -PaperFormatEU2A0=Format 2A0 -PaperFormatEUA0=Format A0 -PaperFormatEUA1=Format A1 -PaperFormatEUA2=Format A2 -PaperFormatEUA3=Format A3 -PaperFormatEUA4=Format A4 -PaperFormatEUA5=Format A5 -PaperFormatEUA6=Format A6 -PaperFormatUSLETTER=Format Letter US -PaperFormatUSLEGAL=Format Legal US -PaperFormatUSEXECUTIVE=Format Executive US -PaperFormatUSLEDGER=Format Ledger/Tabloid -PaperFormatCAP1=Format P1 Canada -PaperFormatCAP2=Format P2 Canada -PaperFormatCAP3=Format P3 Canada -PaperFormatCAP4=Format P4 Canada -PaperFormatCAP5=Format P5 Canada -PaperFormatCAP6=Format P6 Canada -#### Expense report categories #### -ExpAutoCat=Car -ExpCycloCat=Moped -ExpMotoCat=Motorbike -ExpAuto3CV=3 CV -ExpAuto4CV=4 CV -ExpAuto5CV=5 CV -ExpAuto6CV=6 CV -ExpAuto7CV=7 CV -ExpAuto8CV=8 CV -ExpAuto9CV=9 CV -ExpAuto10CV=10 CV -ExpAuto11CV=11 CV -ExpAuto12CV=12 CV -ExpAuto3PCV=3 CV and more -ExpAuto4PCV=4 CV and more -ExpAuto5PCV=5 CV and more -ExpAuto6PCV=6 CV and more -ExpAuto7PCV=7 CV and more -ExpAuto8PCV=8 CV and more -ExpAuto9PCV=9 CV and more -ExpAuto10PCV=10 CV and more -ExpAuto11PCV=11 CV and more -ExpAuto12PCV=12 CV and more -ExpAuto13PCV=13 CV and more -ExpCyclo=Capacity lower to 50cm3 -ExpMoto12CV=Motorbike 1 or 2 CV -ExpMoto345CV=Motorbike 3, 4 or 5 CV -ExpMoto5PCV=Motorbike 5 CV and more diff --git a/htdocs/langs/ar_IQ/donations.lang b/htdocs/langs/ar_IQ/donations.lang deleted file mode 100644 index d512abb2eea..00000000000 --- a/htdocs/langs/ar_IQ/donations.lang +++ /dev/null @@ -1,35 +0,0 @@ -# Dolibarr language file - Source file is en_US - donations -Donation=Donation -Donations=Donations -DonationRef=Donation ref. -Donor=Donor -AddDonation=Create a donation -NewDonation=New donation -DeleteADonation=Delete a donation -ConfirmDeleteADonation=Are you sure you want to delete this donation? -PublicDonation=Public donation -DonationsArea=Donations area -DonationStatusPromiseNotValidated=Draft promise -DonationStatusPromiseValidated=Validated promise -DonationStatusPaid=Donation received -DonationStatusPromiseNotValidatedShort=Draft -DonationStatusPromiseValidatedShort=Validated -DonationStatusPaidShort=Received -DonationTitle=Donation receipt -DonationDate=Donation date -DonationDatePayment=Payment date -ValidPromess=Validate promise -DonationReceipt=Donation receipt -DonationsModels=Documents models for donation receipts -LastModifiedDonations=Latest %s modified donations -DonationRecipient=Donation recipient -IConfirmDonationReception=The recipient declare reception, as a donation, of the following amount -MinimumAmount=Minimum amount is %s -FreeTextOnDonations=Free text to show in footer -FrenchOptions=Options for France -DONATION_ART200=Show article 200 from CGI if you are concerned -DONATION_ART238=Show article 238 from CGI if you are concerned -DONATION_ART885=Show article 885 from CGI if you are concerned -DonationPayment=Donation payment -DonationValidated=Donation %s validated -DonationUseThirdparties=Use an existing thirdparty as coordinates of donators diff --git a/htdocs/langs/ar_IQ/ecm.lang b/htdocs/langs/ar_IQ/ecm.lang deleted file mode 100644 index bc18bed4a29..00000000000 --- a/htdocs/langs/ar_IQ/ecm.lang +++ /dev/null @@ -1,47 +0,0 @@ -# Dolibarr language file - Source file is en_US - ecm -ECMNbOfDocs=No. of documents in directory -ECMSection=Directory -ECMSectionManual=Manual directory -ECMSectionAuto=Automatic directory -ECMSectionsManual=Manual tree -ECMSectionsAuto=Automatic tree -ECMSections=Directories -ECMRoot=ECM Root -ECMNewSection=New directory -ECMAddSection=Add directory -ECMCreationDate=Creation date -ECMNbOfFilesInDir=Number of files in directory -ECMNbOfSubDir=Number of sub-directories -ECMNbOfFilesInSubDir=Number of files in sub-directories -ECMCreationUser=Creator -ECMArea=DMS/ECM area -ECMAreaDesc=The DMS/ECM (Document Management System / Electronic Content Management) area allows you to save, share and search quickly all kind of documents in Dolibarr. -ECMAreaDesc2=* Automatic directories are filled automatically when adding documents from card of an element.
    * Manual directories can be used to save documents not linked to a particular element. -ECMSectionWasRemoved=Directory %s has been deleted. -ECMSectionWasCreated=Directory %s has been created. -ECMSearchByKeywords=Search by keywords -ECMSearchByEntity=Search by object -ECMSectionOfDocuments=Directories of documents -ECMTypeAuto=Automatic -ECMDocsBy=Documents linked to %s -ECMNoDirectoryYet=No directory created -ShowECMSection=Show directory -DeleteSection=Remove directory -ConfirmDeleteSection=Can you confirm you want to delete the directory %s? -ECMDirectoryForFiles=Relative directory for files -CannotRemoveDirectoryContainsFilesOrDirs=Removal not possible because it contains some files or sub-directories -CannotRemoveDirectoryContainsFiles=Removal not possible because it contains some files -ECMFileManager=File manager -ECMSelectASection=Select a directory in the tree... -DirNotSynchronizedSyncFirst=This directory seems to be created or modified outside ECM module. You must click on "Resync" button first to synchronize disk and database to get content of this directory. -ReSyncListOfDir=Resync list of directories -HashOfFileContent=Hash of file content -NoDirectoriesFound=No directories found -FileNotYetIndexedInDatabase=File not yet indexed into database (try to re-upload it) -ExtraFieldsEcmFiles=Extrafields Ecm Files -ExtraFieldsEcmDirectories=Extrafields Ecm Directories -ECMSetup=ECM Setup -GenerateImgWebp=Duplicate all images with another version with .webp format -ConfirmGenerateImgWebp=If you confirm, you will generate an image in .webp format for all images currently into this folder (subfolders are not included)... -ConfirmImgWebpCreation=Confirm all images duplication -SucessConvertImgWebp=Images successfully duplicated diff --git a/htdocs/langs/ar_IQ/errors.lang b/htdocs/langs/ar_IQ/errors.lang deleted file mode 100644 index 45b2c258c41..00000000000 --- a/htdocs/langs/ar_IQ/errors.lang +++ /dev/null @@ -1,305 +0,0 @@ -# Dolibarr language file - Source file is en_US - errors - -# No errors -NoErrorCommitIsDone=No error, we commit -# Errors -ErrorButCommitIsDone=Errors found but we validate despite this -ErrorBadEMail=Email %s is incorrect -ErrorBadMXDomain=Email %s seems incorrect (domain has no valid MX record) -ErrorBadUrl=Url %s is incorrect -ErrorBadValueForParamNotAString=Bad value for your parameter. It appends generally when translation is missing. -ErrorRefAlreadyExists=Reference %s already exists. -ErrorLoginAlreadyExists=Login %s already exists. -ErrorGroupAlreadyExists=Group %s already exists. -ErrorEmailAlreadyExists=Email %s already exists. -ErrorRecordNotFound=Record not found. -ErrorFailToCopyFile=Failed to copy file '%s' into '%s'. -ErrorFailToCopyDir=Failed to copy directory '%s' into '%s'. -ErrorFailToRenameFile=Failed to rename file '%s' into '%s'. -ErrorFailToDeleteFile=Failed to remove file '%s'. -ErrorFailToCreateFile=Failed to create file '%s'. -ErrorFailToRenameDir=Failed to rename directory '%s' into '%s'. -ErrorFailToCreateDir=Failed to create directory '%s'. -ErrorFailToDeleteDir=Failed to delete directory '%s'. -ErrorFailToMakeReplacementInto=Failed to make replacement into file '%s'. -ErrorFailToGenerateFile=Failed to generate file '%s'. -ErrorThisContactIsAlreadyDefinedAsThisType=This contact is already defined as contact for this type. -ErrorCashAccountAcceptsOnlyCashMoney=This bank account is a cash account, so it accepts payments of type cash only. -ErrorFromToAccountsMustDiffers=Source and targets bank accounts must be different. -ErrorBadThirdPartyName=Bad value for third-party name -ErrorProdIdIsMandatory=The %s is mandatory -ErrorBadCustomerCodeSyntax=Bad syntax for customer code -ErrorBadBarCodeSyntax=Bad syntax for barcode. May be you set a bad barcode type or you defined a barcode mask for numbering that does not match value scanned. -ErrorCustomerCodeRequired=Customer code required -ErrorBarCodeRequired=Barcode required -ErrorCustomerCodeAlreadyUsed=Customer code already used -ErrorBarCodeAlreadyUsed=Barcode already used -ErrorPrefixRequired=Prefix required -ErrorBadSupplierCodeSyntax=Bad syntax for vendor code -ErrorSupplierCodeRequired=Vendor code required -ErrorSupplierCodeAlreadyUsed=Vendor code already used -ErrorBadParameters=Bad parameters -ErrorWrongParameters=Wrong or missing parameters -ErrorBadValueForParameter=Wrong value '%s' for parameter '%s' -ErrorBadImageFormat=Image file has not a supported format (Your PHP does not support functions to convert images of this format) -ErrorBadDateFormat=Value '%s' has wrong date format -ErrorWrongDate=Date is not correct! -ErrorFailedToWriteInDir=Failed to write in directory %s -ErrorFoundBadEmailInFile=Found incorrect email syntax for %s lines in file (example line %s with email=%s) -ErrorUserCannotBeDelete=User cannot be deleted. Maybe it is associated to Dolibarr entities. -ErrorFieldsRequired=Some required fields have been left blank. -ErrorSubjectIsRequired=The email subject is required -ErrorFailedToCreateDir=Failed to create a directory. Check that Web server user has permissions to write into Dolibarr documents directory. If parameter safe_mode is enabled on this PHP, check that Dolibarr php files owns to web server user (or group). -ErrorNoMailDefinedForThisUser=No mail defined for this user -ErrorSetupOfEmailsNotComplete=Setup of emails is not complete -ErrorFeatureNeedJavascript=This feature need javascript to be activated to work. Change this in setup - display. -ErrorTopMenuMustHaveAParentWithId0=A menu of type 'Top' can't have a parent menu. Put 0 in parent menu or choose a menu of type 'Left'. -ErrorLeftMenuMustHaveAParentId=A menu of type 'Left' must have a parent id. -ErrorFileNotFound=File %s not found (Bad path, wrong permissions or access denied by PHP openbasedir or safe_mode parameter) -ErrorDirNotFound=Directory %s not found (Bad path, wrong permissions or access denied by PHP openbasedir or safe_mode parameter) -ErrorFunctionNotAvailableInPHP=Function %s is required for this feature but is not available in this version/setup of PHP. -ErrorDirAlreadyExists=A directory with this name already exists. -ErrorFileAlreadyExists=A file with this name already exists. -ErrorDestinationAlreadyExists=Another file with the name %s already exists. -ErrorPartialFile=File not received completely by server. -ErrorNoTmpDir=Temporary directy %s does not exists. -ErrorUploadBlockedByAddon=Upload blocked by a PHP/Apache plugin. -ErrorFileSizeTooLarge=File size is too large. -ErrorFieldTooLong=Field %s is too long. -ErrorSizeTooLongForIntType=Size too long for int type (%s digits maximum) -ErrorSizeTooLongForVarcharType=Size too long for string type (%s chars maximum) -ErrorNoValueForSelectType=Please fill value for select list -ErrorNoValueForCheckBoxType=Please fill value for checkbox list -ErrorNoValueForRadioType=Please fill value for radio list -ErrorBadFormatValueList=The list value cannot have more than one comma: %s, but need at least one: key,value -ErrorFieldCanNotContainSpecialCharacters=The field %s must not contains special characters. -ErrorFieldCanNotContainSpecialNorUpperCharacters=The field %s must not contain special characters, nor upper case characters and cannot contain only numbers. -ErrorFieldMustHaveXChar=The field %s must have at least %s characters. -ErrorNoAccountancyModuleLoaded=No accountancy module activated -ErrorExportDuplicateProfil=This profile name already exists for this export set. -ErrorLDAPSetupNotComplete=Dolibarr-LDAP matching is not complete. -ErrorLDAPMakeManualTest=A .ldif file has been generated in directory %s. Try to load it manually from command line to have more information on errors. -ErrorCantSaveADoneUserWithZeroPercentage=Can't save an action with "status not started" if field "done by" is also filled. -ErrorRefAlreadyExists=Reference %s already exists. -ErrorPleaseTypeBankTransactionReportName=Please enter the bank statement name where the entry has to be reported (Format YYYYMM or YYYYMMDD) -ErrorRecordHasChildren=Failed to delete record since it has some child records. -ErrorRecordHasAtLeastOneChildOfType=Object has at least one child of type %s -ErrorRecordIsUsedCantDelete=Can't delete record. It is already used or included into another object. -ErrorModuleRequireJavascript=Javascript must not be disabled to have this feature working. To enable/disable Javascript, go to menu Home->Setup->Display. -ErrorPasswordsMustMatch=Both typed passwords must match each other -ErrorContactEMail=A technical error occured. Please, contact administrator to following email %s and provide the error code %s in your message, or add a screen copy of this page. -ErrorWrongValueForField=Field %s: '%s' does not match regex rule %s -ErrorFieldValueNotIn=Field %s: '%s' is not a value found in field %s of %s -ErrorFieldRefNotIn=Field %s: '%s' is not a %s existing ref -ErrorsOnXLines=%s errors found -ErrorFileIsInfectedWithAVirus=The antivirus program was not able to validate the file (file might be infected by a virus) -ErrorSpecialCharNotAllowedForField=Special characters are not allowed for field "%s" -ErrorNumRefModel=A reference exists into database (%s) and is not compatible with this numbering rule. Remove record or renamed reference to activate this module. -ErrorQtyTooLowForThisSupplier=Quantity too low for this vendor or no price defined on this product for this vendor -ErrorOrdersNotCreatedQtyTooLow=Some orders haven't been created because of too-low quantities -ErrorModuleSetupNotComplete=Setup of module %s looks to be uncomplete. Go on Home - Setup - Modules to complete. -ErrorBadMask=Error on mask -ErrorBadMaskFailedToLocatePosOfSequence=Error, mask without sequence number -ErrorBadMaskBadRazMonth=Error, bad reset value -ErrorMaxNumberReachForThisMask=Maximum number reached for this mask -ErrorCounterMustHaveMoreThan3Digits=Counter must have more than 3 digits -ErrorSelectAtLeastOne=Error, select at least one entry. -ErrorDeleteNotPossibleLineIsConsolidated=Delete not possible because record is linked to a bank transaction that is conciliated -ErrorProdIdAlreadyExist=%s is assigned to another third -ErrorFailedToSendPassword=Failed to send password -ErrorFailedToLoadRSSFile=Fails to get RSS feed. Try to add constant MAIN_SIMPLEXMLLOAD_DEBUG if error messages does not provide enough information. -ErrorForbidden=Access denied.
    You try to access to a page, area or feature of a disabled module or without being in an authenticated session or that is not allowed to your user. -ErrorForbidden2=Permission for this login can be defined by your Dolibarr administrator from menu %s->%s. -ErrorForbidden3=It seems that Dolibarr is not used through an authenticated session. Take a look at Dolibarr setup documentation to know how to manage authentications (htaccess, mod_auth or other...). -ErrorNoImagickReadimage=Class Imagick is not found in this PHP. No preview can be available. Administrators can disable this tab from menu Setup - Display. -ErrorRecordAlreadyExists=Record already exists -ErrorLabelAlreadyExists=This label already exists -ErrorCantReadFile=Failed to read file '%s' -ErrorCantReadDir=Failed to read directory '%s' -ErrorBadLoginPassword=Bad value for login or password -ErrorLoginDisabled=Your account has been disabled -ErrorFailedToRunExternalCommand=Failed to run external command. Check it is available and runnable by your PHP server user. Check also the command is not protected on shell level by a security layer like apparmor. -ErrorFailedToChangePassword=Failed to change password -ErrorLoginDoesNotExists=User with login %s could not be found. -ErrorLoginHasNoEmail=This user has no email address. Process aborted. -ErrorBadValueForCode=Bad value for security code. Try again with new value... -ErrorBothFieldCantBeNegative=Fields %s and %s can't be both negative -ErrorFieldCantBeNegativeOnInvoice=Field %s cannot be negative on this type of invoice. If you need to add a discount line, just create the discount first (from field '%s' in thirdparty card) and apply it to the invoice. -ErrorLinesCantBeNegativeForOneVATRate=Total of lines (net of tax) can't be negative for a given not null VAT rate (Found a negative total for VAT rate %s%%). -ErrorLinesCantBeNegativeOnDeposits=Lines can't be negative in a deposit. You will face problems when you will need to consume the deposit in final invoice if you do so. -ErrorQtyForCustomerInvoiceCantBeNegative=Quantity for line into customer invoices can't be negative -ErrorWebServerUserHasNotPermission=User account %s used to execute web server has no permission for that -ErrorNoActivatedBarcode=No barcode type activated -ErrUnzipFails=Failed to unzip %s with ZipArchive -ErrNoZipEngine=No engine to zip/unzip %s file in this PHP -ErrorFileMustBeADolibarrPackage=The file %s must be a Dolibarr zip package -ErrorModuleFileRequired=You must select a Dolibarr module package file -ErrorPhpCurlNotInstalled=The PHP CURL is not installed, this is essential to talk with Paypal -ErrorFailedToAddToMailmanList=Failed to add record %s to Mailman list %s or SPIP base -ErrorFailedToRemoveToMailmanList=Failed to remove record %s to Mailman list %s or SPIP base -ErrorNewValueCantMatchOldValue=New value can't be equal to old one -ErrorFailedToValidatePasswordReset=Failed to reinit password. May be the reinit was already done (this link can be used only one time). If not, try to restart the reinit process. -ErrorToConnectToMysqlCheckInstance=Connect to database fails. Check database server is running (for example, with mysql/mariadb, you can launch it from command line with 'sudo service mysql start'). -ErrorFailedToAddContact=Failed to add contact -ErrorDateMustBeBeforeToday=The date must be lower than today -ErrorDateMustBeInFuture=The date must be greater than today -ErrorPaymentModeDefinedToWithoutSetup=A payment mode was set to type %s but setup of module Invoice was not completed to define information to show for this payment mode. -ErrorPHPNeedModule=Error, your PHP must have module %s installed to use this feature. -ErrorOpenIDSetupNotComplete=You setup Dolibarr config file to allow OpenID authentication, but URL of OpenID service is not defined into constant %s -ErrorWarehouseMustDiffers=Source and target warehouses must differs -ErrorBadFormat=Bad format! -ErrorMemberNotLinkedToAThirpartyLinkOrCreateFirst=Error, this member is not yet linked to any third party. Link member to an existing third party or create a new third party before creating subscription with invoice. -ErrorThereIsSomeDeliveries=Error, there is some deliveries linked to this shipment. Deletion refused. -ErrorCantDeletePaymentReconciliated=Can't delete a payment that had generated a bank entry that was reconciled -ErrorCantDeletePaymentSharedWithPayedInvoice=Can't delete a payment shared by at least one invoice with status Paid -ErrorPriceExpression1=Cannot assign to constant '%s' -ErrorPriceExpression2=Cannot redefine built-in function '%s' -ErrorPriceExpression3=Undefined variable '%s' in function definition -ErrorPriceExpression4=Illegal character '%s' -ErrorPriceExpression5=Unexpected '%s' -ErrorPriceExpression6=Wrong number of arguments (%s given, %s expected) -ErrorPriceExpression8=Unexpected operator '%s' -ErrorPriceExpression9=An unexpected error occured -ErrorPriceExpression10=Operator '%s' lacks operand -ErrorPriceExpression11=Expecting '%s' -ErrorPriceExpression14=Division by zero -ErrorPriceExpression17=Undefined variable '%s' -ErrorPriceExpression19=Expression not found -ErrorPriceExpression20=Empty expression -ErrorPriceExpression21=Empty result '%s' -ErrorPriceExpression22=Negative result '%s' -ErrorPriceExpression23=Unknown or non set variable '%s' in %s -ErrorPriceExpression24=Variable '%s' exists but has no value -ErrorPriceExpressionInternal=Internal error '%s' -ErrorPriceExpressionUnknown=Unknown error '%s' -ErrorSrcAndTargetWarehouseMustDiffers=Source and target warehouses must differs -ErrorTryToMakeMoveOnProductRequiringBatchData=Error, trying to make a stock movement without lot/serial information, on product '%s' requiring lot/serial information -ErrorCantSetReceptionToTotalDoneWithReceptionToApprove=All recorded receptions must first be verified (approved or denied) before being allowed to do this action -ErrorCantSetReceptionToTotalDoneWithReceptionDenied=All recorded receptions must first be verified (approved) before being allowed to do this action -ErrorGlobalVariableUpdater0=HTTP request failed with error '%s' -ErrorGlobalVariableUpdater1=Invalid JSON format '%s' -ErrorGlobalVariableUpdater2=Missing parameter '%s' -ErrorGlobalVariableUpdater3=The requested data was not found in result -ErrorGlobalVariableUpdater4=SOAP client failed with error '%s' -ErrorGlobalVariableUpdater5=No global variable selected -ErrorFieldMustBeANumeric=Field %s must be a numeric value -ErrorMandatoryParametersNotProvided=Mandatory parameter(s) not provided -ErrorOppStatusRequiredIfAmount=You set an estimated amount for this lead. So you must also enter it's status. -ErrorFailedToLoadModuleDescriptorForXXX=Failed to load module descriptor class for %s -ErrorBadDefinitionOfMenuArrayInModuleDescriptor=Bad Definition Of Menu Array In Module Descriptor (bad value for key fk_menu) -ErrorSavingChanges=An error has occurred when saving the changes -ErrorWarehouseRequiredIntoShipmentLine=Warehouse is required on the line to ship -ErrorFileMustHaveFormat=File must have format %s -ErrorFilenameCantStartWithDot=Filename can't start with a '.' -ErrorSupplierCountryIsNotDefined=Country for this vendor is not defined. Correct this first. -ErrorsThirdpartyMerge=Failed to merge the two records. Request canceled. -ErrorStockIsNotEnoughToAddProductOnOrder=Stock is not enough for product %s to add it into a new order. -ErrorStockIsNotEnoughToAddProductOnInvoice=Stock is not enough for product %s to add it into a new invoice. -ErrorStockIsNotEnoughToAddProductOnShipment=Stock is not enough for product %s to add it into a new shipment. -ErrorStockIsNotEnoughToAddProductOnProposal=Stock is not enough for product %s to add it into a new proposal. -ErrorFailedToLoadLoginFileForMode=Failed to get the login key for mode '%s'. -ErrorModuleNotFound=File of module was not found. -ErrorFieldAccountNotDefinedForBankLine=Value for Accounting account not defined for source line id %s (%s) -ErrorFieldAccountNotDefinedForInvoiceLine=Value for Accounting account not defined for invoice id %s (%s) -ErrorFieldAccountNotDefinedForLine=Value for Accounting account not defined for the line (%s) -ErrorBankStatementNameMustFollowRegex=Error, bank statement name must follow the following syntax rule %s -ErrorPhpMailDelivery=Check that you don't use a too high number of recipients and that your email content is not similar to a Spam. Ask also your administrator to check firewall and server logs files for a more complete information. -ErrorUserNotAssignedToTask=User must be assigned to task to be able to enter time consumed. -ErrorTaskAlreadyAssigned=Task already assigned to user -ErrorModuleFileSeemsToHaveAWrongFormat=The module package seems to have a wrong format. -ErrorModuleFileSeemsToHaveAWrongFormat2=At least one mandatory directory must exists into zip of module: %s or %s -ErrorFilenameDosNotMatchDolibarrPackageRules=The name of the module package (%s) does not match expected name syntax: %s -ErrorDuplicateTrigger=Error, duplicate trigger name %s. Already loaded from %s. -ErrorNoWarehouseDefined=Error, no warehouses defined. -ErrorBadLinkSourceSetButBadValueForRef=The link you use is not valid. A 'source' for payment is defined, but value for 'ref' is not valid. -ErrorTooManyErrorsProcessStopped=Too many errors. Process was stopped. -ErrorMassValidationNotAllowedWhenStockIncreaseOnAction=Mass validation is not possible when option to increase/decrease stock is set on this action (you must validate one by one so you can define the warehouse to increase/decrease) -ErrorObjectMustHaveStatusDraftToBeValidated=Object %s must have status 'Draft' to be validated. -ErrorObjectMustHaveLinesToBeValidated=Object %s must have lines to be validated. -ErrorOnlyInvoiceValidatedCanBeSentInMassAction=Only validated invoices can be sent using the "Send by email" mass action. -ErrorChooseBetweenFreeEntryOrPredefinedProduct=You must choose if article is a predefined product or not -ErrorDiscountLargerThanRemainToPaySplitItBefore=The discount you try to apply is larger than remain to pay. Split the discount in 2 smaller discounts before. -ErrorFileNotFoundWithSharedLink=File was not found. May be the share key was modified or file was removed recently. -ErrorProductBarCodeAlreadyExists=The product barcode %s already exists on another product reference. -ErrorNoteAlsoThatSubProductCantBeFollowedByLot=Note also that using kits to have auto increase/decrease of subproducts is not possible when at least one subproduct (or subproduct of subproducts) needs a serial/lot number. -ErrorDescRequiredForFreeProductLines=Description is mandatory for lines with free product -ErrorAPageWithThisNameOrAliasAlreadyExists=The page/container %s has the same name or alternative alias that the one your try to use -ErrorDuringChartLoad=Error when loading chart of accounts. If few accounts were not loaded, you can still enter them manually. -ErrorBadSyntaxForParamKeyForContent=Bad syntax for param keyforcontent. Must have a value starting with %s or %s -ErrorVariableKeyForContentMustBeSet=Error, the constant with name %s (with text content to show) or %s (with external url to show) must be set. -ErrorURLMustEndWith=URL %s must end %s -ErrorURLMustStartWithHttp=URL %s must start with http:// or https:// -ErrorHostMustNotStartWithHttp=Host name %s must NOT start with http:// or https:// -ErrorNewRefIsAlreadyUsed=Error, the new reference is already used -ErrorDeletePaymentLinkedToAClosedInvoiceNotPossible=Error, delete payment linked to a closed invoice is not possible. -ErrorSearchCriteriaTooSmall=Search criteria too small. -ErrorObjectMustHaveStatusActiveToBeDisabled=Objects must have status 'Active' to be disabled -ErrorObjectMustHaveStatusDraftOrDisabledToBeActivated=Objects must have status 'Draft' or 'Disabled' to be enabled -ErrorNoFieldWithAttributeShowoncombobox=No fields has property 'showoncombobox' into definition of object '%s'. No way to show the combolist. -ErrorFieldRequiredForProduct=Field '%s' is required for product %s -ProblemIsInSetupOfTerminal=Problem is in setup of terminal %s. -ErrorAddAtLeastOneLineFirst=Add at least one line first -ErrorRecordAlreadyInAccountingDeletionNotPossible=Error, record is already transferred in accounting, deletion is not possible. -ErrorLanguageMandatoryIfPageSetAsTranslationOfAnother=Error, language is mandatory if you set the page as a translation of another one. -ErrorLanguageOfTranslatedPageIsSameThanThisPage=Error, language of translated page is same than this one. -ErrorBatchNoFoundForProductInWarehouse=No lot/serial found for product "%s" in warehouse "%s". -ErrorBatchNoFoundEnoughQuantityForProductInWarehouse=No enough quantity for this lot/serial for product "%s" in warehouse "%s". -ErrorOnlyOneFieldForGroupByIsPossible=Only 1 field for the 'Group by' is possible (others are discarded) -ErrorTooManyDifferentValueForSelectedGroupBy=Found too many different value (more than %s) for the field '%s', so we can't use it as a 'Group by' for graphics. The field 'Group By' has been removed. May be you wanted to use it as an X-Axis ? -ErrorReplaceStringEmpty=Error, the string to replace into is empty -ErrorProductNeedBatchNumber=Error, product '%s' need a lot/serial number -ErrorProductDoesNotNeedBatchNumber=Error, product '%s' does not accept a lot/serial number -ErrorFailedToReadObject=Error, failed to read object of type %s -ErrorParameterMustBeEnabledToAllwoThisFeature=Error, parameter %s must be enabled into conf/conf.php to allow use of Command Line Interface by the internal job scheduler -ErrorLoginDateValidity=Error, this login is outside the validity date range -ErrorValueLength=Length of field '%s' must be higher than '%s' -ErrorReservedKeyword=The word '%s' is a reserved keyword -ErrorNotAvailableWithThisDistribution=Not available with this distribution -ErrorPublicInterfaceNotEnabled=Public interface was not enabled -ErrorLanguageRequiredIfPageIsTranslationOfAnother=The language of new page must be defined if it is set as a translation of another page -ErrorLanguageMustNotBeSourceLanguageIfPageIsTranslationOfAnother=The language of new page must not be the source language if it is set as a translation of another page -ErrorAParameterIsRequiredForThisOperation=A parameter is mandatory for this operation -ErrorDateIsInFuture=Error, the date can't be in the future -ErrorAnAmountWithoutTaxIsRequired=Error, amount is mandatory -ErrorAPercentIsRequired=Error, please fill in the percentage correctly -ErrorYouMustFirstSetupYourChartOfAccount=You must first setup your chart of account -ErrorFailedToFindEmailTemplate=Failed to find template with code name %s -ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Duration not defined on service. No way to calculate the hourly price. - -# Warnings -WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup. -WarningPasswordSetWithNoAccount=A password was set for this member. However, no user account was created. So this password is stored but can't be used to login to Dolibarr. It may be used by an external module/interface but if you don't need to define any login nor password for a member, you can disable option "Manage a login for each member" from Member module setup. If you need to manage a login but don't need any password, you can keep this field empty to avoid this warning. Note: Email can also be used as a login if the member is linked to a user. -WarningMandatorySetupNotComplete=Click here to setup mandatory parameters -WarningEnableYourModulesApplications=Click here to enable your modules and applications -WarningSafeModeOnCheckExecDir=Warning, PHP option safe_mode is on so command must be stored inside a directory declared by php parameter safe_mode_exec_dir. -WarningBookmarkAlreadyExists=A bookmark with this title or this target (URL) already exists. -WarningPassIsEmpty=Warning, database password is empty. This is a security hole. You should add a password to your database and change your conf.php file to reflect this. -WarningConfFileMustBeReadOnly=Warning, your config file (htdocs/conf/conf.php) can be overwritten by the web server. This is a serious security hole. Modify permissions on file to be in read only mode for operating system user used by Web server. If you use Windows and FAT format for your disk, you must know that this file system does not allow to add permissions on file, so can't be completely safe. -WarningsOnXLines=Warnings on %s source record(s) -WarningNoDocumentModelActivated=No model, for document generation, has been activated. A model will be chosen by default until you check your module setup. -WarningLockFileDoesNotExists=Warning, once setup is finished, you must disable the installation/migration tools by adding a file install.lock into directory %s. Omitting the creation of this file is a grave security risk. -WarningUntilDirRemoved=All security warnings (visible by admin users only) will remain active as long as the vulnerability is present (or that constant MAIN_REMOVE_INSTALL_WARNING is added in Setup->Other Setup). -WarningCloseAlways=Warning, closing is done even if amount differs between source and target elements. Enable this feature with caution. -WarningUsingThisBoxSlowDown=Warning, using this box slow down seriously all pages showing the box. -WarningClickToDialUserSetupNotComplete=Setup of ClickToDial information for your user are not complete (see tab ClickToDial onto your user card). -WarningFeatureDisabledWithDisplayOptimizedForBlindNoJs=Feature disabled when display setup is optimized for blind person or text browsers. -WarningPaymentDateLowerThanInvoiceDate=Payment date (%s) is earlier than invoice date (%s) for invoice %s. -WarningTooManyDataPleaseUseMoreFilters=Too many data (more than %s lines). Please use more filters or set the constant %s to a higher limit. -WarningSomeLinesWithNullHourlyRate=Some times were recorded by some users while their hourly rate was not defined. A value of 0 %s per hour was used but this may result in wrong valuation of time spent. -WarningYourLoginWasModifiedPleaseLogin=Your login was modified. For security purpose you will have to login with your new login before next action. -WarningAnEntryAlreadyExistForTransKey=An entry already exists for the translation key for this language -WarningNumberOfRecipientIsRestrictedInMassAction=Warning, number of different recipient is limited to %s when using the mass actions on lists -WarningDateOfLineMustBeInExpenseReportRange=Warning, the date of line is not in the range of the expense report -WarningProjectDraft=Project is still in draft mode. Don't forget to validate it if you plan to use tasks. -WarningProjectClosed=Project is closed. You must re-open it first. -WarningSomeBankTransactionByChequeWereRemovedAfter=Some bank transaction were removed after that the receipt including them were generated. So nb of cheques and total of receipt may differ from number and total in list. -WarningFailedToAddFileIntoDatabaseIndex=Warning, failed to add file entry into ECM database index table -WarningTheHiddenOptionIsOn=Warning, the hidden option %s is on. -WarningCreateSubAccounts=Warning, you can't create directly a sub account, you must create a third party or an user and assign them an accounting code to find them in this list -WarningAvailableOnlyForHTTPSServers=Available only if using HTTPS secured connection. -WarningModuleXDisabledSoYouMayMissEventHere=Module %s has not been enabled. So you may miss a lot of event here. -ErrorActionCommPropertyUserowneridNotDefined=User's owner is required -ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary -CheckVersionFail=Version check fail -ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it -ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify. diff --git a/htdocs/langs/ar_IQ/eventorganization.lang b/htdocs/langs/ar_IQ/eventorganization.lang deleted file mode 100644 index 67a242e640a..00000000000 --- a/htdocs/langs/ar_IQ/eventorganization.lang +++ /dev/null @@ -1,149 +0,0 @@ -# Copyright (C) 2021 Florian Henry -# Copyright (C) 2021 Dorian Vabre -# -# 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 . - -# -# Generic -# -ModuleEventOrganizationName = Event Organization -EventOrganizationDescription = Event Organization through Module Project -EventOrganizationDescriptionLong= Manage Event organization for conference, attendees, speaker, and attendees, with public subcription page -# -# Menu -# -EventOrganizationMenuLeft = Organized events -EventOrganizationConferenceOrBoothMenuLeft = Conference Or Booth - -# -# Admin page -# -EventOrganizationSetup = Event Organization setup -Settings = Settings -EventOrganizationSetupPage = Event Organization setup page -EVENTORGANIZATION_TASK_LABEL = Label of tasks to create automatically when project is validated -EVENTORGANIZATION_TASK_LABELTooltip = When you validate an organized event, some tasks can be automatically created in the project

    For example:
    Send Call for Conference
    Send Call for Booth
    Receive call for conferences
    Receive call for Booth
    Open subscriptions to events for attendees
    Send remind of event to speakers
    Send remind of event to Booth hoster
    Send remind of event to attendees -EVENTORGANIZATION_CATEG_THIRDPARTY_CONF = Category to add to third-parties automatically created when someone suggests a conference -EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH = Category to add to third-parties automatically created when they suggests a booth -EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF = Template of email to send after receiving a suggestion of a conference. -EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH = Template of email to send after receiving a suggestion of a booth. -EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH = Template of email to send after a subscription to a booth has been paid. -EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT = Template of email to send after a subscription to an event has been paid. -EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_SPEAKER = Template of email of massaction to attendes -EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES = Template of email of massaction to speakers -EVENTORGANIZATION_FILTERATTENDEES_CAT = Filter thirdpartie's select list in attendees creation card/form with category -EVENTORGANIZATION_FILTERATTENDEES_TYPE = Filter thirdpartie's select list in attendees creation card/form with customer type - -# -# Object -# -EventOrganizationConfOrBooth= Conference Or Booth -ManageOrganizeEvent = Manage event organisation -ConferenceOrBooth = Conference Or Booth -ConferenceOrBoothTab = Conference Or Booth -AmountOfSubscriptionPaid = Amount of subscription paid -DateSubscription = Date of subscription -ConferenceOrBoothAttendee = Conference Or Booth Attendee - -# -# Template Mail -# -YourOrganizationEventConfRequestWasReceived = Your request for conference was received -YourOrganizationEventBoothRequestWasReceived = Your request for booth was received -EventOrganizationEmailAskConf = Request for conference -EventOrganizationEmailAskBooth = Request for booth -EventOrganizationEmailSubsBooth = Subscription for booth -EventOrganizationEmailSubsEvent = Subscription for an event -EventOrganizationMassEmailAttendees = Communication to attendees -EventOrganizationMassEmailSpeakers = Communication to speakers - -# -# Event -# -AllowUnknownPeopleSuggestConf=Allow unknown people to suggest conferences -AllowUnknownPeopleSuggestConfHelp=Allow unknown people to suggest conferences -AllowUnknownPeopleSuggestBooth=Allow unknown people to suggest booth -AllowUnknownPeopleSuggestBoothHelp=Allow unknown people to suggest booth -PriceOfRegistration=Price of registration -PriceOfRegistrationHelp=Price of registration -PriceOfBooth=Subscription price to stand a booth -PriceOfBoothHelp=Subscription price to stand a booth -EventOrganizationICSLink=Link ICS for events -ConferenceOrBoothInformation=Conference Or Booth informations -Attendees = Attendees -DownloadICSLink = Download ICS link -EVENTORGANIZATION_SECUREKEY = Secure Key of the public registration link to a conference -SERVICE_BOOTH_LOCATION = Service used for the invoice row about a booth location -SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION = Service used for the invoice row about an attendee subscription to a conference -NbVotes=Number of votes -# -# Status -# -EvntOrgDraft = Draft -EvntOrgSuggested = Suggested -EvntOrgConfirmed = Confirmed -EvntOrgNotQualified = Not Qualified -EvntOrgDone = Done -EvntOrgCancelled = Cancelled -# -# Public page -# -SuggestForm = Suggestion page -RegisterPage = Page for conferences or booth -EvntOrgRegistrationHelpMessage = Here, you can vote for an event, or suggest a new conference or booth for the project -EvntOrgRegistrationConfHelpMessage = Here, you can suggest a new conference for the project -EvntOrgRegistrationBoothHelpMessage = Here, you can suggest a new booth for the project -ListOfSuggestedConferences = List of suggested conferences -ListOfSuggestedBooths = List of suggested booths -SuggestConference = Suggest a new conference -SuggestBooth = Suggest a booth -ViewAndVote = View and vote for suggested events -PublicAttendeeSubscriptionPage = Public link of registration to a conference -MissingOrBadSecureKey = The security key is invalid or missing -EvntOrgWelcomeMessage = This form allows you to register as a new participant to the conference : '%s' -EvntOrgDuration = This conference starts on %s and ends on %s. -ConferenceAttendeeFee = Conference attendee fee for the event : '%s' occurring from %s to %s. -BoothLocationFee = Booth location for the event : '%s' occurring from %s to %s -EventType = Event type -LabelOfBooth=Booth label -LabelOfconference=Conference label -ConferenceIsNotConfirmed=Subcription not available, conference is not confirmed yet -DateMustBeBeforeThan=%s must be before %s -DateMustBeAfterThan=%s must be after %s - -# -# Vote page -# -EvntOrgRegistrationWelcomeMessage = Welcome on the conference or booth suggestion page. -EvntOrgRegistrationConfWelcomeMessage = Welcome on the conference suggestion page. -EvntOrgRegistrationBoothWelcomeMessage = Welcome on the booth suggestion page. -EvntOrgVoteHelpMessage = Here, you can view and vote for the suggested events for the project -VoteOk = Your vote has been accepted. -AlreadyVoted = You have already voted for this event. -VoteError = An error has occurred during the vote, please try again. - -# -# SubscriptionOk page -# -SubscriptionOk = Your subscription to this conference has been validated -# -# Subscription validation mail -# -ConfAttendeeSubscriptionConfirmation = Confirmation of your subscription to a conference -# -# Payment page -# -Attendee = Attendee -PaymentConferenceAttendee = Conference attendee payment -PaymentBoothLocation = Booth location payment diff --git a/htdocs/langs/ar_IQ/exports.lang b/htdocs/langs/ar_IQ/exports.lang index cb652229825..4b7a62067ac 100644 --- a/htdocs/langs/ar_IQ/exports.lang +++ b/htdocs/langs/ar_IQ/exports.lang @@ -1,137 +1,2 @@ # Dolibarr language file - Source file is en_US - exports -ExportsArea=Exports -ImportArea=Import -NewExport=New Export -NewImport=New Import -ExportableDatas=Exportable dataset -ImportableDatas=Importable dataset -SelectExportDataSet=Choose dataset you want to export... -SelectImportDataSet=Choose dataset you want to import... -SelectExportFields=Choose the fields you want to export, or select a predefined export profile -SelectImportFields=Choose the source file fields you want to import and their target field in database by moving them up and down with anchor %s, or select a predefined import profile: -NotImportedFields=Fields of source file not imported -SaveExportModel=Save your selections as an export profile/template (for reuse). -SaveImportModel=Save this import profile (for reuse) ... -ExportModelName=Export profile name -ExportModelSaved=Export profile saved as %s. -ExportableFields=Exportable fields -ExportedFields=Exported fields -ImportModelName=Import profile name -ImportModelSaved=Import profile saved as %s. -DatasetToExport=Dataset to export -DatasetToImport=Import file into dataset -ChooseFieldsOrdersAndTitle=Choose fields order... -FieldsTitle=Fields title -FieldTitle=Field title -NowClickToGenerateToBuildExportFile=Now, select the file format in the combo box and click on "Generate" to build the export file... -AvailableFormats=Available Formats -LibraryShort=Library -ExportCsvSeparator=Csv caracter separator -ImportCsvSeparator=Csv caracter separator -Step=Step -FormatedImport=Import Assistant -FormatedImportDesc1=This module allows you to update existing data or add new objects into the database from a file without technical knowledge, using an assistant. -FormatedImportDesc2=First step is to choose the kind of data you want to import, then the format of the source file, then the fields you want to import. -FormatedExport=Export Assistant -FormatedExportDesc1=These tools allow the export of personalized data using an assistant, to help you in the process without requiring technical knowledge. -FormatedExportDesc2=First step is to choose a predefined dataset, then which fields you want to export, and in which order. -FormatedExportDesc3=When data to export are selected, you can choose the format of the output file. -Sheet=Sheet -NoImportableData=No importable data (no module with definitions to allow data imports) -FileSuccessfullyBuilt=File generated -SQLUsedForExport=SQL Request used to extract data -LineId=Id of line -LineLabel=Label of line -LineDescription=Description of line -LineUnitPrice=Unit price of line -LineVATRate=VAT Rate of line -LineQty=Quantity for line -LineTotalHT=Amount excl. tax for line -LineTotalTTC=Amount with tax for line -LineTotalVAT=Amount of VAT for line -TypeOfLineServiceOrProduct=Type of line (0=product, 1=service) -FileWithDataToImport=File with data to import -FileToImport=Source file to import -FileMustHaveOneOfFollowingFormat=File to import must have one of following formats -DownloadEmptyExample=Download template file with field content information -StarAreMandatory=* are mandatory fields -ChooseFormatOfFileToImport=Choose the file format to use as import file format by clicking on the %s icon to select it... -ChooseFileToImport=Upload file then click on the %s icon to select file as source import file... -SourceFileFormat=Source file format -FieldsInSourceFile=Fields in source file -FieldsInTargetDatabase=Target fields in Dolibarr database (bold=mandatory) -Field=Field -NoFields=No fields -MoveField=Move field column number %s -ExampleOfImportFile=Example_of_import_file -SaveImportProfile=Save this import profile -ErrorImportDuplicateProfil=Failed to save this import profile with this name. An existing profile already exists with this name. -TablesTarget=Targeted tables -FieldsTarget=Targeted fields -FieldTarget=Targeted field -FieldSource=Source field -NbOfSourceLines=Number of lines in source file -NowClickToTestTheImport=Check that the file format (field and string delimiters) of your file matches the options shown and that you have omitted the header line, or these will be flagged as errors in the following simulation.
    Click on the "%s" button to run a check of the file structure/contents and simulate the import process.
    No data will be changed in your database. -RunSimulateImportFile=Run Import Simulation -FieldNeedSource=This field requires data from the source file -SomeMandatoryFieldHaveNoSource=Some mandatory fields have no source from data file -InformationOnSourceFile=Information on source file -InformationOnTargetTables=Information on target fields -SelectAtLeastOneField=Switch at least one source field in the column of fields to export -SelectFormat=Choose this import file format -RunImportFile=Import Data -NowClickToRunTheImport=Check the results of the import simulation. Correct any errors and re-test.
    When the simulation reports no errors you may proceed to import the data into the database. -DataLoadedWithId=The imported data will have an additional field in each database table with this import id: %s, to allow it to be searchable in the case of investigating a problem related to this import. -ErrorMissingMandatoryValue=Mandatory data is empty in the source file for field %s. -TooMuchErrors=There are still %s other source lines with errors but output has been limited. -TooMuchWarnings=There are still %s other source lines with warnings but output has been limited. -EmptyLine=Empty line (will be discarded) -CorrectErrorBeforeRunningImport=You must correct all errors before running the definitive import. -FileWasImported=File was imported with number %s. -YouCanUseImportIdToFindRecord=You can find all the imported records in your database by filtering on field import_key='%s'. -NbOfLinesOK=Number of lines with no errors and no warnings: %s. -NbOfLinesImported=Number of lines successfully imported: %s. -DataComeFromNoWhere=Value to insert comes from nowhere in source file. -DataComeFromFileFieldNb=Value to insert comes from field number %s in source file. -DataComeFromIdFoundFromRef=Value that comes from field number %s of source file will be used to find the id of the parent object to use (so the object %s that has the ref. from source file must exist in the database). -DataComeFromIdFoundFromCodeId=Code that comes from field number %s of source file will be used to find the id of the parent object to use (so the code from source file must exist in the dictionary %s). Note that if you know the id, you can also use it in the source file instead of the code. Import should work in both cases. -DataIsInsertedInto=Data coming from source file will be inserted into the following field: -DataIDSourceIsInsertedInto=The id of parent object was found using the data in the source file, will be inserted into the following field: DataCodeIDSourceIsInsertedInto=The id of parent line found from code, will be inserted into following field: -SourceRequired=Data value is mandatory -SourceExample=Example of possible data value -ExampleAnyRefFoundIntoElement=Any ref found for element %s -ExampleAnyCodeOrIdFoundIntoDictionary=Any code (or id) found into dictionary %s -CSVFormatDesc=Comma Separated Value file format (.csv).
    This is a text file format where fields are separated by a separator [ %s ]. If separator is found inside a field content, field is rounded by round character [ %s ]. Escape character to escape round character is [ %s ]. -Excel95FormatDesc=Excel file format (.xls)
    This is the native Excel 95 format (BIFF5). -Excel2007FormatDesc=Excel file format (.xlsx)
    This is the native Excel 2007 format (SpreadsheetML). -TsvFormatDesc=Tab Separated Value file format (.tsv)
    This is a text file format where fields are separated by a tabulator [tab]. -ExportFieldAutomaticallyAdded=Field %s was automatically added. It will avoid you to have similar lines to be treated as duplicate record (with this field added, all lines will own their own id and will differ). -CsvOptions=CSV format options -Separator=Field Separator -Enclosure=String Delimiter -SpecialCode=Special code -ExportStringFilter=%% allows replacing one or more characters in the text -ExportDateFilter=YYYY, YYYYMM, YYYYMMDD: filters by one year/month/day
    YYYY+YYYY, YYYYMM+YYYYMM, YYYYMMDD+YYYYMMDD: filters over a range of years/months/days
    > YYYY, > YYYYMM, > YYYYMMDD: filters on all following years/months/days
    < YYYY, < YYYYMM, < YYYYMMDD: filters on all previous years/months/days -ExportNumericFilter=NNNNN filters by one value
    NNNNN+NNNNN filters over a range of values
    < NNNNN filters by lower values
    > NNNNN filters by higher values -ImportFromLine=Import starting from line number -EndAtLineNb=End at line number -ImportFromToLine=Limit range (From - To). Eg. to omit header line(s). -SetThisValueTo2ToExcludeFirstLine=For example, set this value to 3 to exclude the 2 first lines.
    If the header lines are NOT omitted, this will result in multiple errors in the Import Simulation. -KeepEmptyToGoToEndOfFile=Keep this field empty to process all lines to the end of the file. -SelectPrimaryColumnsForUpdateAttempt=Select column(s) to use as primary key for an UPDATE import -UpdateNotYetSupportedForThisImport=Update is not supported for this type of import (only insert) -NoUpdateAttempt=No update attempt was performed, only insert -ImportDataset_user_1=Users (employees or not) and properties -ComputedField=Computed field -## filters -SelectFilterFields=If you want to filter on some values, just input values here. -FilteredFields=Filtered fields -FilteredFieldsValues=Value for filter -FormatControlRule=Format control rule -## imports updates -KeysToUseForUpdates=Key (column) to use for updating existing data -NbInsert=Number of inserted lines: %s -NbUpdate=Number of updated lines: %s -MultipleRecordFoundWithTheseFilters=Multiple records have been found with these filters: %s -StocksWithBatch=Stocks and location (warehouse) of products with batch/serial number diff --git a/htdocs/langs/ar_IQ/externalsite.lang b/htdocs/langs/ar_IQ/externalsite.lang deleted file mode 100644 index 452100c65b3..00000000000 --- a/htdocs/langs/ar_IQ/externalsite.lang +++ /dev/null @@ -1,5 +0,0 @@ -# Dolibarr language file - Source file is en_US - externalsite -ExternalSiteSetup=Setup link to external website -ExternalSiteURL=External Site URL of HTML iframe content -ExternalSiteModuleNotComplete=Module ExternalSite was not configured properly. -ExampleMyMenuEntry=My menu entry diff --git a/htdocs/langs/ar_IQ/ftp.lang b/htdocs/langs/ar_IQ/ftp.lang deleted file mode 100644 index 254a2a698ce..00000000000 --- a/htdocs/langs/ar_IQ/ftp.lang +++ /dev/null @@ -1,14 +0,0 @@ -# Dolibarr language file - Source file is en_US - ftp -FTPClientSetup=FTP or SFTP Client module setup -NewFTPClient=New FTP/FTPS connection setup -FTPArea=FTP/FTPS Area -FTPAreaDesc=This screen shows a view of an FTP et SFTP server. -SetupOfFTPClientModuleNotComplete=The setup of the FTP or SFTP client module seems to be incomplete -FTPFeatureNotSupportedByYourPHP=Your PHP does not support FTP or SFTP functions -FailedToConnectToFTPServer=Failed to connect to server (server %s, port %s) -FailedToConnectToFTPServerWithCredentials=Failed to login to server with defined login/password -FTPFailedToRemoveFile=Failed to remove file %s. -FTPFailedToRemoveDir=Failed to remove directory %s: check permissions and that the directory is empty. -FTPPassiveMode=Passive mode -ChooseAFTPEntryIntoMenu=Choose a FTP/SFTP site from the menu... -FailedToGetFile=Failed to get files %s diff --git a/htdocs/langs/ar_IQ/help.lang b/htdocs/langs/ar_IQ/help.lang deleted file mode 100644 index 048de16d3c0..00000000000 --- a/htdocs/langs/ar_IQ/help.lang +++ /dev/null @@ -1,23 +0,0 @@ -# Dolibarr language file - Source file is en_US - help -CommunitySupport=Forum/Wiki support -EMailSupport=Emails support -RemoteControlSupport=Online real-time / remote support -OtherSupport=Other support -ToSeeListOfAvailableRessources=To contact/see available resources: -HelpCenter=Help Center -DolibarrHelpCenter=Dolibarr Help and Support Center -ToGoBackToDolibarr=Otherwise, click here to continue to use Dolibarr. -TypeOfSupport=Type of support -TypeSupportCommunauty=Community (free) -TypeSupportCommercial=Commercial -TypeOfHelp=Type -NeedHelpCenter=Need help or support? -Efficiency=Efficiency -TypeHelpOnly=Help only -TypeHelpDev=Help+Development -TypeHelpDevForm=Help+Development+Training -BackToHelpCenter=Otherwise, go back to Help center home page. -LinkToGoldMember=You can call one of the trainers preselected by Dolibarr for your language (%s) by clicking their Widget (status and maximum price are automatically updated): -PossibleLanguages=Supported languages -SubscribeToFoundation=Help the Dolibarr project, subscribe to the foundation -SeeOfficalSupport=For official Dolibarr support in your language:
    %s diff --git a/htdocs/langs/ar_IQ/holiday.lang b/htdocs/langs/ar_IQ/holiday.lang deleted file mode 100644 index 0527f4c0788..00000000000 --- a/htdocs/langs/ar_IQ/holiday.lang +++ /dev/null @@ -1,136 +0,0 @@ -# Dolibarr language file - Source file is en_US - holiday -HRM=HRM -Holidays=Leave -CPTitreMenu=Leave -MenuReportMonth=Monthly statement -MenuAddCP=New leave request -NotActiveModCP=You must enable the module Leave to view this page. -AddCP=Make a leave request -DateDebCP=Start date -DateFinCP=End date -DraftCP=Draft -ToReviewCP=Awaiting approval -ApprovedCP=Approved -CancelCP=Canceled -RefuseCP=Refused -ValidatorCP=Approver -ListeCP=List of leave -Leave=Leave request -LeaveId=Leave ID -ReviewedByCP=Will be approved by -UserID=User ID -UserForApprovalID=User for approval ID -UserForApprovalFirstname=First name of approval user -UserForApprovalLastname=Last name of approval user -UserForApprovalLogin=Login of approval user -DescCP=Description -SendRequestCP=Create leave request -DelayToRequestCP=Leave requests must be made at least %s day(s) before them. -MenuConfCP=Balance of leave -SoldeCPUser=Leave balance is %s days. -ErrorEndDateCP=You must select an end date greater than the start date. -ErrorSQLCreateCP=An SQL error occurred during the creation: -ErrorIDFicheCP=An error has occurred, the leave request does not exist. -ReturnCP=Return to previous page -ErrorUserViewCP=You are not authorized to read this leave request. -InfosWorkflowCP=Information Workflow -RequestByCP=Requested by -TitreRequestCP=Leave request -TypeOfLeaveId=Type of leave ID -TypeOfLeaveCode=Type of leave code -TypeOfLeaveLabel=Type of leave label -NbUseDaysCP=Number of days of leave used -NbUseDaysCPHelp=The calculation takes into account the non-working days and the holidays defined in the dictionary. -NbUseDaysCPShort=Days of leave -NbUseDaysCPShortInMonth=Days of leave in month -DayIsANonWorkingDay=%s is a non-working day -DateStartInMonth=Start date in month -DateEndInMonth=End date in month -EditCP=Edit -DeleteCP=Delete -ActionRefuseCP=Refuse -ActionCancelCP=Cancel -StatutCP=Status -TitleDeleteCP=Delete the leave request -ConfirmDeleteCP=Confirm the deletion of this leave request? -ErrorCantDeleteCP=Error you don't have the right to delete this leave request. -CantCreateCP=You don't have the right to make leave requests. -InvalidValidatorCP=You must choose the approver for your leave request. -NoDateDebut=You must select a start date. -NoDateFin=You must select an end date. -ErrorDureeCP=Your leave request does not contain working day. -TitleValidCP=Approve the leave request -ConfirmValidCP=Are you sure you want to approve the leave request? -DateValidCP=Date approved -TitleToValidCP=Send leave request -ConfirmToValidCP=Are you sure you want to send the leave request? -TitleRefuseCP=Refuse the leave request -ConfirmRefuseCP=Are you sure you want to refuse the leave request? -NoMotifRefuseCP=You must choose a reason for refusing the request. -TitleCancelCP=Cancel the leave request -ConfirmCancelCP=Are you sure you want to cancel the leave request? -DetailRefusCP=Reason for refusal -DateRefusCP=Date of refusal -DateCancelCP=Date of cancellation -DefineEventUserCP=Assign an exceptional leave for a user -addEventToUserCP=Assign leave -NotTheAssignedApprover=You are not the assigned approver -MotifCP=Reason -UserCP=User -ErrorAddEventToUserCP=An error occurred while adding the exceptional leave. -AddEventToUserOkCP=The addition of the exceptional leave has been completed. -MenuLogCP=View change logs -LogCP=Log of all updates made to "Balance of Leave" -ActionByCP=Updated by -UserUpdateCP=Updated for -PrevSoldeCP=Previous Balance -NewSoldeCP=New Balance -alreadyCPexist=A leave request has already been done on this period. -FirstDayOfHoliday=Beginning day of leave request -LastDayOfHoliday=Ending day of leave request -BoxTitleLastLeaveRequests=Latest %s modified leave requests -HolidaysMonthlyUpdate=Monthly update -ManualUpdate=Manual update -HolidaysCancelation=Leave request cancelation -EmployeeLastname=Employee last name -EmployeeFirstname=Employee first name -TypeWasDisabledOrRemoved=Leave type (id %s) was disabled or removed -LastHolidays=Latest %s leave requests -AllHolidays=All leave requests -HalfDay=Half day -NotTheAssignedApprover=You are not the assigned approver -LEAVE_PAID=Paid vacation -LEAVE_SICK=Sick leave -LEAVE_OTHER=Other leave -LEAVE_PAID_FR=Paid vacation -## Configuration du Module ## -LastUpdateCP=Last automatic update of leave allocation -MonthOfLastMonthlyUpdate=Month of last automatic update of leave allocation -UpdateConfCPOK=Updated successfully. -Module27130Name= Management of leave requests -Module27130Desc= Management of leave requests -ErrorMailNotSend=An error occurred while sending email: -NoticePeriod=Notice period -#Messages -HolidaysToValidate=Validate leave requests -HolidaysToValidateBody=Below is a leave request to validate -HolidaysToValidateDelay=This leave request will take place within a period of less than %s days. -HolidaysToValidateAlertSolde=The user who made this leave request does not have enough available days. -HolidaysValidated=Validated leave requests -HolidaysValidatedBody=Your leave request for %s to %s has been validated. -HolidaysRefused=Request denied -HolidaysRefusedBody=Your leave request for %s to %s has been denied for the following reason: -HolidaysCanceled=Canceled leaved request -HolidaysCanceledBody=Your leave request for %s to %s has been canceled. -FollowedByACounter=1: This type of leave need to be followed by a counter. Counter is incremented manually or automatically and when a leave request is validated, counter is decremented.
    0: Not followed by a counter. -NoLeaveWithCounterDefined=There is no leave types defined that need to be followed by a counter -GoIntoDictionaryHolidayTypes=Go into Home - Setup - Dictionaries - Type of leave to setup the different types of leaves. -HolidaySetup=Setup of module Leave -HolidaysNumberingModules=Numbering models for leave requests -TemplatePDFHolidays=Template for leave requests PDF -FreeLegalTextOnHolidays=Free text on PDF -WatermarkOnDraftHolidayCards=Watermarks on draft leave requests -HolidaysToApprove=Holidays to approve -NobodyHasPermissionToValidateHolidays=Nobody has permission to validate holidays -HolidayBalanceMonthlyUpdate=Monthly update of holiday balance -XIsAUsualNonWorkingDay=%s is usualy a NON working day diff --git a/htdocs/langs/ar_IQ/hrm.lang b/htdocs/langs/ar_IQ/hrm.lang deleted file mode 100644 index da098e10bdb..00000000000 --- a/htdocs/langs/ar_IQ/hrm.lang +++ /dev/null @@ -1,19 +0,0 @@ -# Dolibarr language file - en_US - hrm -# Admin -HRM_EMAIL_EXTERNAL_SERVICE=Email to prevent HRM external service -Establishments=Establishments -Establishment=Establishment -NewEstablishment=New establishment -DeleteEstablishment=Delete establishment -ConfirmDeleteEstablishment=Are you sure you wish to delete this establishment? -OpenEtablishment=Open establishment -CloseEtablishment=Close establishment -# Dictionary -DictionaryPublicHolidays=Leave - Public holidays -DictionaryDepartment=HRM - Department list -DictionaryFunction=HRM - Job positions -# Module -Employees=Employees -Employee=Employee -NewEmployee=New employee -ListOfEmployees=List of employees diff --git a/htdocs/langs/ar_IQ/install.lang b/htdocs/langs/ar_IQ/install.lang deleted file mode 100644 index c1ffee936d7..00000000000 --- a/htdocs/langs/ar_IQ/install.lang +++ /dev/null @@ -1,218 +0,0 @@ -# Dolibarr language file - Source file is en_US - install -InstallEasy=Just follow the instructions step by step. -MiscellaneousChecks=Prerequisites check -ConfFileExists=Configuration file %s exists. -ConfFileDoesNotExistsAndCouldNotBeCreated=Configuration file %s does not exist and could not be created! -ConfFileCouldBeCreated=Configuration file %s could be created. -ConfFileIsNotWritable=Configuration file %s is not writable. Check permissions. For first install, your web server must be able to write into this file during configuration process ("chmod 666" for example on a Unix like OS). -ConfFileIsWritable=Configuration file %s is writable. -ConfFileMustBeAFileNotADir=Configuration file %s must be a file, not a directory. -ConfFileReload=Reloading parameters from configuration file. -PHPSupportPOSTGETOk=This PHP supports variables POST and GET. -PHPSupportPOSTGETKo=It's possible your PHP setup does not support variables POST and/or GET. Check the parameter variables_order in php.ini. -PHPSupportSessions=This PHP supports sessions. -PHPSupport=This PHP supports %s functions. -PHPMemoryOK=Your PHP max session memory is set to %s. This should be enough. -PHPMemoryTooLow=Your PHP max session memory is set to %s bytes. This is too low. Change your php.ini to set memory_limit parameter to at least %s bytes. -Recheck=Click here for a more detailed test -ErrorPHPDoesNotSupportSessions=Your PHP installation does not support sessions. This feature is required to allow Dolibarr to work. Check your PHP setup and permissions of the sessions directory. -ErrorPHPDoesNotSupportGD=Your PHP installation does not support GD graphical functions. No graphs will be available. -ErrorPHPDoesNotSupportCurl=Your PHP installation does not support Curl. -ErrorPHPDoesNotSupportCalendar=Your PHP installation does not support php calendar extensions. -ErrorPHPDoesNotSupportUTF8=Your PHP installation does not support UTF8 functions. Dolibarr cannot work correctly. Resolve this before installing Dolibarr. -ErrorPHPDoesNotSupportIntl=Your PHP installation does not support Intl functions. -ErrorPHPDoesNotSupportxDebug=Your PHP installation does not support extend debug functions. -ErrorPHPDoesNotSupport=Your PHP installation does not support %s functions. -ErrorDirDoesNotExists=Directory %s does not exist. -ErrorGoBackAndCorrectParameters=Go back and check/correct the parameters. -ErrorWrongValueForParameter=You may have typed a wrong value for parameter '%s'. -ErrorFailedToCreateDatabase=Failed to create database '%s'. -ErrorFailedToConnectToDatabase=Failed to connect to database '%s'. -ErrorDatabaseVersionTooLow=Database version (%s) too old. Version %s or higher is required. -ErrorPHPVersionTooLow=PHP version too old. Version %s is required. -ErrorConnectedButDatabaseNotFound=Connection to server successful but database '%s' not found. -ErrorDatabaseAlreadyExists=Database '%s' already exists. -IfDatabaseNotExistsGoBackAndUncheckCreate=If the database does not exist, go back and check option "Create database". -IfDatabaseExistsGoBackAndCheckCreate=If database already exists, go back and uncheck "Create database" option. -WarningBrowserTooOld=Version of browser is too old. Upgrading your browser to a recent version of Firefox, Chrome or Opera is highly recommended. -PHPVersion=PHP Version -License=Using license -ConfigurationFile=Configuration file -WebPagesDirectory=Directory where web pages are stored -DocumentsDirectory=Directory to store uploaded and generated documents -URLRoot=URL Root -ForceHttps=Force secure connections (https) -CheckToForceHttps=Check this option to force secure connections (https).
    This requires that the web server is configured with an SSL certificate. -DolibarrDatabase=Dolibarr Database -DatabaseType=Database type -DriverType=Driver type -Server=Server -ServerAddressDescription=Name or ip address for the database server. Usually 'localhost' when the database server is hosted on the same server as the web server. -ServerPortDescription=Database server port. Keep empty if unknown. -DatabaseServer=Database server -DatabaseName=Database name -DatabasePrefix=Database table prefix -DatabasePrefixDescription=Database table prefix. If empty, defaults to llx_. -AdminLogin=User account for the Dolibarr database owner. -PasswordAgain=Retype password confirmation -AdminPassword=Password for Dolibarr database owner. -CreateDatabase=Create database -CreateUser=Create user account or grant user account permission on the Dolibarr database -DatabaseSuperUserAccess=Database server - Superuser access -CheckToCreateDatabase=Check the box if the database does not exist yet and so must be created.
    In this case, you must also fill in the user name and password for the superuser account at the bottom of this page. -CheckToCreateUser=Check the box if:
    the database user account does not yet exist and so must be created, or
    if the user account exists but the database does not exist and permissions must be granted.
    In this case, you must enter the user account and password and also the superuser account name and password at the bottom of this page. If this box is unchecked, database owner and password must already exist. -DatabaseRootLoginDescription=Superuser account name (to create new databases or new users), mandatory if the database or its owner does not already exist. -KeepEmptyIfNoPassword=Leave empty if superuser has no password (NOT recommended) -SaveConfigurationFile=Saving parameters to -ServerConnection=Server connection -DatabaseCreation=Database creation -CreateDatabaseObjects=Database objects creation -ReferenceDataLoading=Reference data loading -TablesAndPrimaryKeysCreation=Tables and Primary keys creation -CreateTableAndPrimaryKey=Create table %s -CreateOtherKeysForTable=Create foreign keys and indexes for table %s -OtherKeysCreation=Foreign keys and indexes creation -FunctionsCreation=Functions creation -AdminAccountCreation=Administrator login creation -PleaseTypePassword=Please type a password, empty passwords are not allowed! -PleaseTypeALogin=Please type a login! -PasswordsMismatch=Passwords differs, please try again! -SetupEnd=End of setup -SystemIsInstalled=This installation is complete. -SystemIsUpgraded=Dolibarr has been upgraded successfully. -YouNeedToPersonalizeSetup=You need to configure Dolibarr to suit your needs (appearance, features, ...). To do this, please follow the link below: -AdminLoginCreatedSuccessfuly=Dolibarr administrator login '%s' created successfully. -GoToDolibarr=Go to Dolibarr -GoToSetupArea=Go to Dolibarr (setup area) -MigrationNotFinished=The database version is not completely up to date: run the upgrade process again. -GoToUpgradePage=Go to upgrade page again -WithNoSlashAtTheEnd=Without the slash "/" at the end -DirectoryRecommendation=IMPORTANT: You must use a directory that is outside of the web pages (so do not use a subdirectory of previous parameter). -LoginAlreadyExists=Already exists -DolibarrAdminLogin=Dolibarr admin login -AdminLoginAlreadyExists=Dolibarr administrator account '%s' already exists. Go back if you want to create another one. -FailedToCreateAdminLogin=Failed to create Dolibarr administrator account. -WarningRemoveInstallDir=Warning, for security reasons, once the install or upgrade is complete, you should add a file called install.lock into the Dolibarr document directory in order to prevent the accidental/malicious use of the install tools again. -FunctionNotAvailableInThisPHP=Not available in this PHP -ChoosedMigrateScript=Choose migration script -DataMigration=Database migration (data) -DatabaseMigration=Database migration (structure + some data) -ProcessMigrateScript=Script processing -ChooseYourSetupMode=Choose your setup mode and click "Start"... -FreshInstall=Fresh install -FreshInstallDesc=Use this mode if this is your first install. If not, this mode can repair a incomplete previous install. If you want to upgrade your version, choose "Upgrade" mode. -Upgrade=Upgrade -UpgradeDesc=Use this mode if you have replaced old Dolibarr files with files from a newer version. This will upgrade your database and data. -Start=Start -InstallNotAllowed=Setup not allowed by conf.php permissions -YouMustCreateWithPermission=You must create file %s and set write permissions on it for the web server during install process. -CorrectProblemAndReloadPage=Please fix the problem and press F5 to reload the page. -AlreadyDone=Already migrated -DatabaseVersion=Database version -ServerVersion=Database server version -YouMustCreateItAndAllowServerToWrite=You must create this directory and allow for the web server to write into it. -DBSortingCollation=Character sorting order -YouAskDatabaseCreationSoDolibarrNeedToConnect=You selected create database %s, but for this, Dolibarr needs to connect to server %s with super user %s permissions. -YouAskLoginCreationSoDolibarrNeedToConnect=You selected create database user %s, but for this, Dolibarr needs to connect to server %s with super user %s permissions. -BecauseConnectionFailedParametersMayBeWrong=The database connection failed: the host or super user parameters must be wrong. -OrphelinsPaymentsDetectedByMethod=Orphans payment detected by method %s -RemoveItManuallyAndPressF5ToContinue=Remove it manually and press F5 to continue. -FieldRenamed=Field renamed -IfLoginDoesNotExistsCheckCreateUser=If the user does not exist yet, you must check option "Create user" -ErrorConnection=Server "%s", database name "%s", login "%s", or database password may be wrong or the PHP client version may be too old compared to the database version. -InstallChoiceRecommanded=Recommended choice to install version %s from your current version %s -InstallChoiceSuggested=Install choice suggested by installer. -MigrateIsDoneStepByStep=The targeted version (%s) has a gap of several versions. The install wizard will come back to suggest a further migration once this one is complete. -CheckThatDatabasenameIsCorrect=Check that the database name "%s" is correct. -IfAlreadyExistsCheckOption=If this name is correct and that database does not exist yet, you must check option "Create database". -OpenBaseDir=PHP openbasedir parameter -YouAskToCreateDatabaseSoRootRequired=You checked the box "Create database". For this, you need to provide the login/password of superuser (bottom of form). -YouAskToCreateDatabaseUserSoRootRequired=You checked the box "Create database owner". For this, you need to provide the login/password of superuser (bottom of form). -NextStepMightLastALongTime=The current step may take several minutes. Please wait until the next screen is shown completely before continuing. -MigrationCustomerOrderShipping=Migrate shipping for sales orders storage -MigrationShippingDelivery=Upgrade storage of shipping -MigrationShippingDelivery2=Upgrade storage of shipping 2 -MigrationFinished=Migration finished -LastStepDesc=Last step: Define here the login and password you wish to use to connect to Dolibarr. Do not lose this as it is the master account to administer all other/additional user accounts. -ActivateModule=Activate module %s -ShowEditTechnicalParameters=Click here to show/edit advanced parameters (expert mode) -WarningUpgrade=Warning:\nDid you run a database backup first?\nThis is highly recommended. Loss of data (due to for example bugs in mysql version 5.5.40/41/42/43) may be possible during this process, so it is essential to take a complete dump of your database before starting any migration.\n\nClick OK to start migration process... -ErrorDatabaseVersionForbiddenForMigration=Your database version is %s. It has a critical bug, making data loss possible if you make structural changes in your database, such as is required by the migration process. For his reason, migration will not be allowed until you upgrade your database to a layer (patched) version (list of known buggy versions: %s) -KeepDefaultValuesWamp=You used the Dolibarr setup wizard from DoliWamp, so values proposed here are already optimized. Change them only if you know what you are doing. -KeepDefaultValuesDeb=You used the Dolibarr setup wizard from a Linux package (Ubuntu, Debian, Fedora...), so the values proposed here are already optimized. Only the password of the database owner to create must be entered. Change other parameters only if you know what you are doing. -KeepDefaultValuesMamp=You used the Dolibarr setup wizard from DoliMamp, so the values proposed here are already optimized. Change them only if you know what you are doing. -KeepDefaultValuesProxmox=You used the Dolibarr setup wizard from a Proxmox virtual appliance, so the values proposed here are already optimized. Change them only if you know what you are doing. -UpgradeExternalModule=Run dedicated upgrade process of external module -SetAtLeastOneOptionAsUrlParameter=Set at least one option as a parameter in URL. For example: '...repair.php?standard=confirmed' -NothingToDelete=Nothing to clean/delete -NothingToDo=Nothing to do -######### -# upgrade -MigrationFixData=Fix for denormalized data -MigrationOrder=Data migration for customer's orders -MigrationSupplierOrder=Data migration for vendor's orders -MigrationProposal=Data migration for commercial proposals -MigrationInvoice=Data migration for customer's invoices -MigrationContract=Data migration for contracts -MigrationSuccessfullUpdate=Upgrade successful -MigrationUpdateFailed=Failed upgrade process -MigrationRelationshipTables=Data migration for relationship tables (%s) -MigrationPaymentsUpdate=Payment data correction -MigrationPaymentsNumberToUpdate=%s payment(s) to update -MigrationProcessPaymentUpdate=Update payment(s) %s -MigrationPaymentsNothingToUpdate=No more things to do -MigrationPaymentsNothingUpdatable=No more payments that can be corrected -MigrationContractsUpdate=Contract data correction -MigrationContractsNumberToUpdate=%s contract(s) to update -MigrationContractsLineCreation=Create contract line for contract ref %s -MigrationContractsNothingToUpdate=No more things to do -MigrationContractsFieldDontExist=Field fk_facture does not exist anymore. Nothing to do. -MigrationContractsEmptyDatesUpdate=Contract empty date correction -MigrationContractsEmptyDatesUpdateSuccess=Contract empty date correction done successfully -MigrationContractsEmptyDatesNothingToUpdate=No contract empty date to correct -MigrationContractsEmptyCreationDatesNothingToUpdate=No contract creation date to correct -MigrationContractsInvalidDatesUpdate=Bad value date contract correction -MigrationContractsInvalidDateFix=Correct contract %s (Contract date=%s, Starting service date min=%s) -MigrationContractsInvalidDatesNumber=%s contracts modified -MigrationContractsInvalidDatesNothingToUpdate=No date with bad value to correct -MigrationContractsIncoherentCreationDateUpdate=Bad value contract creation date correction -MigrationContractsIncoherentCreationDateUpdateSuccess=Bad value contract creation date correction done successfully -MigrationContractsIncoherentCreationDateNothingToUpdate=No bad value for contract creation date to correct -MigrationReopeningContracts=Open contract closed by error -MigrationReopenThisContract=Reopen contract %s -MigrationReopenedContractsNumber=%s contracts modified -MigrationReopeningContractsNothingToUpdate=No closed contract to open -MigrationBankTransfertsUpdate=Update links between bank entry and a bank transfer -MigrationBankTransfertsNothingToUpdate=All links are up to date -MigrationShipmentOrderMatching=Sendings receipt update -MigrationDeliveryOrderMatching=Delivery receipt update -MigrationDeliveryDetail=Delivery update -MigrationStockDetail=Update stock value of products -MigrationMenusDetail=Update dynamic menus tables -MigrationDeliveryAddress=Update delivery address in shipments -MigrationProjectTaskActors=Data migration for table llx_projet_task_actors -MigrationProjectUserResp=Data migration field fk_user_resp of llx_projet to llx_element_contact -MigrationProjectTaskTime=Update time spent in seconds -MigrationActioncommElement=Update data on actions -MigrationPaymentMode=Data migration for payment type -MigrationCategorieAssociation=Migration of categories -MigrationEvents=Migration of events to add event owner into assignment table -MigrationEventsContact=Migration of events to add event contact into assignment table -MigrationRemiseEntity=Update entity field value of llx_societe_remise -MigrationRemiseExceptEntity=Update entity field value of llx_societe_remise_except -MigrationUserRightsEntity=Update entity field value of llx_user_rights -MigrationUserGroupRightsEntity=Update entity field value of llx_usergroup_rights -MigrationUserPhotoPath=Migration of photo paths for users -MigrationFieldsSocialNetworks=Migration of users fields social networks (%s) -MigrationReloadModule=Reload module %s -MigrationResetBlockedLog=Reset module BlockedLog for v7 algorithm -MigrationImportOrExportProfiles=Migration of import or export profiles (%s) -ShowNotAvailableOptions=Show unavailable options -HideNotAvailableOptions=Hide unavailable options -ErrorFoundDuringMigration=Error(s) were reported during the migration process so next step is not available. To ignore errors, you can click here, but the application or some features may not work correctly until the errors are resolved. -YouTryInstallDisabledByDirLock=The application tried to self-upgrade, but the install/upgrade pages have been disabled for security (directory renamed with .lock suffix).
    -YouTryInstallDisabledByFileLock=The application tried to self-upgrade, but the install/upgrade pages have been disabled for security (by the existence of a lock file install.lock in the dolibarr documents directory).
    -ClickHereToGoToApp=Click here to go to your application -ClickOnLinkOrRemoveManualy=If an upgrade is in progress, please wait. If not, click on the following link. If you always see this same page, you must remove/rename the file install.lock in the documents directory. -Loaded=Loaded -FunctionTest=Function test diff --git a/htdocs/langs/ar_IQ/interventions.lang b/htdocs/langs/ar_IQ/interventions.lang deleted file mode 100644 index ef5df43e546..00000000000 --- a/htdocs/langs/ar_IQ/interventions.lang +++ /dev/null @@ -1,68 +0,0 @@ -# Dolibarr language file - Source file is en_US - interventions -Intervention=Intervention -Interventions=Interventions -InterventionCard=Intervention card -NewIntervention=New intervention -AddIntervention=Create intervention -ChangeIntoRepeatableIntervention=Change to repeatable intervention -ListOfInterventions=List of interventions -ActionsOnFicheInter=Actions on intervention -LastInterventions=Latest %s interventions -AllInterventions=All interventions -CreateDraftIntervention=Create draft -InterventionContact=Intervention contact -DeleteIntervention=Delete intervention -ValidateIntervention=Validate intervention -ModifyIntervention=Modify intervention -DeleteInterventionLine=Delete intervention line -ConfirmDeleteIntervention=Are you sure you want to delete this intervention? -ConfirmValidateIntervention=Are you sure you want to validate this intervention under name %s? -ConfirmModifyIntervention=Are you sure you want to modify this intervention? -ConfirmDeleteInterventionLine=Are you sure you want to delete this intervention line? -ConfirmCloneIntervention=Are you sure you want to clone this intervention? -NameAndSignatureOfInternalContact=Name and signature of intervening: -NameAndSignatureOfExternalContact=Name and signature of customer: -DocumentModelStandard=Standard document model for interventions -InterventionCardsAndInterventionLines=Interventions and lines of interventions -InterventionClassifyBilled=Classify "Billed" -InterventionClassifyUnBilled=Classify "Unbilled" -InterventionClassifyDone=Classify "Done" -StatusInterInvoiced=Billed -SendInterventionRef=Submission of intervention %s -SendInterventionByMail=Send intervention by email -InterventionCreatedInDolibarr=Intervention %s created -InterventionValidatedInDolibarr=Intervention %s validated -InterventionModifiedInDolibarr=Intervention %s modified -InterventionClassifiedBilledInDolibarr=Intervention %s set as billed -InterventionClassifiedUnbilledInDolibarr=Intervention %s set as unbilled -InterventionSentByEMail=Intervention %s sent by email -InterventionDeletedInDolibarr=Intervention %s deleted -InterventionsArea=Interventions area -DraftFichinter=Draft interventions -LastModifiedInterventions=Latest %s modified interventions -FichinterToProcess=Interventions to process -TypeContact_fichinter_external_CUSTOMER=Following-up customer contact -PrintProductsOnFichinter=Print also lines of type "product" (not only services) on intervention card -PrintProductsOnFichinterDetails=interventions generated from orders -UseServicesDurationOnFichinter=Use services duration for interventions generated from orders -UseDurationOnFichinter=Hides the duration field for intervention records -UseDateWithoutHourOnFichinter=Hides hours and minutes off the date field for intervention records -InterventionStatistics=Statistics of interventions -NbOfinterventions=No. of intervention cards -NumberOfInterventionsByMonth=No. of intervention cards by month (date of validation) -AmountOfInteventionNotIncludedByDefault=Amount of intervention is not included by default into profit (in most cases, timesheets are used to count time spent). Add option PROJECT_INCLUDE_INTERVENTION_AMOUNT_IN_PROFIT to 1 into home-setup-other to include them. -InterId=Intervention id -InterRef=Intervention ref. -InterDateCreation=Date creation intervention -InterDuration=Duration intervention -InterStatus=Status intervention -InterNote=Note intervention -InterLine=Line of intervention -InterLineId=Line id intervention -InterLineDate=Line date intervention -InterLineDuration=Line duration intervention -InterLineDesc=Line description intervention -RepeatableIntervention=Template of intervention -ToCreateAPredefinedIntervention=To create a predefined or recurring intervention, create a common intervention and convert it into intervention template -ConfirmReopenIntervention=Are you sure you want to open back the intervention %s? -GenerateInter=Generate intervention diff --git a/htdocs/langs/ar_IQ/intracommreport.lang b/htdocs/langs/ar_IQ/intracommreport.lang deleted file mode 100644 index 93c46f112bb..00000000000 --- a/htdocs/langs/ar_IQ/intracommreport.lang +++ /dev/null @@ -1,40 +0,0 @@ -Module68000Name = Intracomm report -Module68000Desc = Intracomm report management (Support for French DEB/DES format) -IntracommReportSetup = Intracommreport module setup -IntracommReportAbout = About intracommreport - -# Setup -INTRACOMMREPORT_NUM_AGREMENT=Numéro d'agrément (délivré par le CISD de rattachement) -INTRACOMMREPORT_TYPE_ACTEUR=Type d'acteur -INTRACOMMREPORT_ROLE_ACTEUR=Rôle joué par l'acteur -INTRACOMMREPORT_NIV_OBLIGATION_INTRODUCTION=Niveau d'obligation sur les introductions -INTRACOMMREPORT_NIV_OBLIGATION_EXPEDITION=Niveau d'obligation sur les expéditions -INTRACOMMREPORT_CATEG_FRAISDEPORT=Catégorie de services de type "Frais de port" - -INTRACOMMREPORT_NUM_DECLARATION=Numéro de déclarant - -# Menu -MenuIntracommReport=Intracomm report -MenuIntracommReportNew=New declaration -MenuIntracommReportList=List - -# View -NewDeclaration=New declaration -Declaration=Declaration -AnalysisPeriod=Analysis period -TypeOfDeclaration=Type of declaration -DEB=Goods exchange declaration (DEB) -DES=Services exchange declaration (DES) - -# Export page -IntracommReportTitle=Preparation of an XML file in ProDouane format - -# List -IntracommReportList=List of generated declarations -IntracommReportNumber=Numero of declaration -IntracommReportPeriod=Period of analysis -IntracommReportTypeDeclaration=Type of declaration -IntracommReportDownload=download XML file - -# Invoice -IntracommReportTransportMode=Transport mode diff --git a/htdocs/langs/ar_IQ/knowledgemanagement.lang b/htdocs/langs/ar_IQ/knowledgemanagement.lang deleted file mode 100644 index 99425830e53..00000000000 --- a/htdocs/langs/ar_IQ/knowledgemanagement.lang +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (C) 2021 SuperAdmin -# -# 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 . - -# -# Generic -# - -# Module label 'ModuleKnowledgeManagementName' -ModuleKnowledgeManagementName = Knowledge Management System -# Module description 'ModuleKnowledgeManagementDesc' -ModuleKnowledgeManagementDesc=Manage a Knowledge Management (KM) or Help-Desk base - -# -# Admin page -# -KnowledgeManagementSetup = Knowledge Management System setup -Settings = Settings -KnowledgeManagementSetupPage = Knowledge Management System setup page - - -# -# About page -# -About = About -KnowledgeManagementAbout = About Knowledge Management -KnowledgeManagementAboutPage = Knowledge Management about page - -KnowledgeManagementArea = Knowledge Management -MenuKnowledgeRecord = Knowledge base -ListKnowledgeRecord = List of articles -NewKnowledgeRecord = New article -ValidateReply = Validate solution -KnowledgeRecords = Articles -KnowledgeRecord = Article -KnowledgeRecordExtraFields = Extrafields for Article -GroupOfTicket=Group of tickets -YouCanLinkArticleToATicketCategory=You can link an article to a ticket group (so the article will be suggested during qualification of new tickets) diff --git a/htdocs/langs/ar_IQ/languages.lang b/htdocs/langs/ar_IQ/languages.lang deleted file mode 100644 index 023edb64c52..00000000000 --- a/htdocs/langs/ar_IQ/languages.lang +++ /dev/null @@ -1,110 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -Language_am_ET=Ethiopian -Language_ar_AR=Arabic -Language_ar_EG=Arabic (Egypt) -Language_ar_MA=Arabic (Moroco) -Language_ar_SA=Arabic -Language_ar_TN=Arabic (Tunisia) -Language_ar_IQ=Arabic (Iraq) -Language_az_AZ=Azerbaijani -Language_bn_BD=Bengali -Language_bn_IN=Bengali (India) -Language_bg_BG=Bulgarian -Language_bs_BA=Bosnian -Language_ca_ES=Catalan -Language_cs_CZ=Czech -Language_da_DA=Danish -Language_da_DK=Danish -Language_de_DE=German -Language_de_AT=German (Austria) -Language_de_CH=German (Switzerland) -Language_el_GR=Greek -Language_el_CY=Greek (Cyprus) -Language_en_AU=English (Australia) -Language_en_CA=English (Canada) -Language_en_GB=English (United Kingdom) -Language_en_IN=English (India) -Language_en_NZ=English (New Zealand) -Language_en_SA=English (Saudi Arabia) -Language_en_SG=English (Singapore) -Language_en_US=English (United States) -Language_en_ZA=English (South Africa) -Language_es_ES=Spanish -Language_es_AR=Spanish (Argentina) -Language_es_BO=Spanish (Bolivia) -Language_es_CL=Spanish (Chile) -Language_es_CO=Spanish (Colombia) -Language_es_DO=Spanish (Dominican Republic) -Language_es_EC=Spanish (Ecuador) -Language_es_GT=Spanish (Guatemala) -Language_es_HN=Spanish (Honduras) -Language_es_MX=Spanish (Mexico) -Language_es_PA=Spanish (Panama) -Language_es_PY=Spanish (Paraguay) -Language_es_PE=Spanish (Peru) -Language_es_PR=Spanish (Puerto Rico) -Language_es_US=Spanish (USA) -Language_es_UY=Spanish (Uruguay) -Language_es_GT=Spanish (Guatemala) -Language_es_VE=Spanish (Venezuela) -Language_et_EE=Estonian -Language_eu_ES=Basque -Language_fa_IR=Persian -Language_fi_FI=Finnish -Language_fr_BE=French (Belgium) -Language_fr_CA=French (Canada) -Language_fr_CH=French (Switzerland) -Language_fr_CI=French (Cost Ivory) -Language_fr_CM=French (Cameroun) -Language_fr_FR=French -Language_fr_GA=French (Gabon) -Language_fr_NC=French (New Caledonia) -Language_fr_SN=French (Senegal) -Language_fy_NL=Frisian -Language_gl_ES=Galician -Language_he_IL=Hebrew -Language_hi_IN=Hindi (India) -Language_hr_HR=Croatian -Language_hu_HU=Hungarian -Language_id_ID=Indonesian -Language_is_IS=Icelandic -Language_it_IT=Italian -Language_it_CH=Italian (Switzerland) -Language_ja_JP=Japanese -Language_ka_GE=Georgian -Language_km_KH=Khmer -Language_kn_IN=Kannada -Language_ko_KR=Korean -Language_lo_LA=Lao -Language_lt_LT=Lithuanian -Language_lv_LV=Latvian -Language_mk_MK=Macedonian -Language_mn_MN=Mongolian -Language_nb_NO=Norwegian (Bokmål) -Language_ne_NP=Nepali -Language_nl_BE=Dutch (Belgium) -Language_nl_NL=Dutch -Language_pl_PL=Polish -Language_pt_AO=Portuguese (Angola) -Language_pt_BR=Portuguese (Brazil) -Language_pt_PT=Portuguese -Language_ro_MD=Romanian (Moldavia) -Language_ro_RO=Romanian -Language_ru_RU=Russian -Language_ru_UA=Russian (Ukraine) -Language_tr_TR=Turkish -Language_sl_SI=Slovenian -Language_sv_SV=Swedish -Language_sv_SE=Swedish -Language_sq_AL=Albanian -Language_sk_SK=Slovakian -Language_sr_RS=Serbian -Language_sw_SW=Kiswahili -Language_th_TH=Thai -Language_uk_UA=Ukrainian -Language_uz_UZ=Uzbek -Language_vi_VN=Vietnamese -Language_zh_CN=Chinese -Language_zh_TW=Chinese (Traditional) -Language_zh_HK=Chinese (Hong Kong) -Language_bh_MY=Malay diff --git a/htdocs/langs/ar_IQ/ldap.lang b/htdocs/langs/ar_IQ/ldap.lang deleted file mode 100644 index 8b6f0864215..00000000000 --- a/htdocs/langs/ar_IQ/ldap.lang +++ /dev/null @@ -1,27 +0,0 @@ -# Dolibarr language file - Source file is en_US - ldap -YouMustChangePassNextLogon=Password for user %s on the domain %s must be changed. -UserMustChangePassNextLogon=User must change password on the domain %s -LDAPInformationsForThisContact=Information in LDAP database for this contact -LDAPInformationsForThisUser=Information in LDAP database for this user -LDAPInformationsForThisGroup=Information in LDAP database for this group -LDAPInformationsForThisMember=Information in LDAP database for this member -LDAPInformationsForThisMemberType=Information in LDAP database for this member type -LDAPAttributes=LDAP attributes -LDAPCard=LDAP card -LDAPRecordNotFound=Record not found in LDAP database -LDAPUsers=Users in LDAP database -LDAPFieldStatus=Status -LDAPFieldFirstSubscriptionDate=First subscription date -LDAPFieldFirstSubscriptionAmount=First subscription amount -LDAPFieldLastSubscriptionDate=Latest subscription date -LDAPFieldLastSubscriptionAmount=Latest subscription amount -LDAPFieldSkype=Skype id -LDAPFieldSkypeExample=Example: skypeName -UserSynchronized=User synchronized -GroupSynchronized=Group synchronized -MemberSynchronized=Member synchronized -MemberTypeSynchronized=Member type synchronized -ContactSynchronized=Contact synchronized -ForceSynchronize=Force synchronizing Dolibarr -> LDAP -ErrorFailedToReadLDAP=Failed to read LDAP database. Check LDAP module setup and database accessibility. -PasswordOfUserInLDAP=Password of user in LDAP diff --git a/htdocs/langs/ar_IQ/link.lang b/htdocs/langs/ar_IQ/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/ar_IQ/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/ar_IQ/loan.lang b/htdocs/langs/ar_IQ/loan.lang deleted file mode 100644 index d271ed0c140..00000000000 --- a/htdocs/langs/ar_IQ/loan.lang +++ /dev/null @@ -1,34 +0,0 @@ -# Dolibarr language file - Source file is en_US - loan -Loan=Loan -Loans=Loans -NewLoan=New Loan -ShowLoan=Show Loan -PaymentLoan=Loan payment -LoanPayment=Loan payment -ShowLoanPayment=Show Loan Payment -LoanCapital=Capital -Insurance=Insurance -Interest=Interest -Nbterms=Number of terms -Term=Term -LoanAccountancyCapitalCode=Accounting account capital -LoanAccountancyInsuranceCode=Accounting account insurance -LoanAccountancyInterestCode=Accounting account interest -ConfirmDeleteLoan=Confirm deleting this loan -LoanDeleted=Loan Deleted Successfully -ConfirmPayLoan=Confirm classify paid this loan -LoanPaid=Loan Paid -ListLoanAssociatedProject=List of loan associated with the project -AddLoan=Create loan -FinancialCommitment=Financial commitment -InterestAmount=Interest -CapitalRemain=Capital remain -TermPaidAllreadyPaid = This term is allready paid -CantUseScheduleWithLoanStartedToPaid = Can't use scheduler for a loan with payment started -CantModifyInterestIfScheduleIsUsed = You can't modify interest if you use schedule -# Admin -ConfigLoan=Configuration of the module loan -LOAN_ACCOUNTING_ACCOUNT_CAPITAL=Accounting account capital by default -LOAN_ACCOUNTING_ACCOUNT_INTEREST=Accounting account interest by default -LOAN_ACCOUNTING_ACCOUNT_INSURANCE=Accounting account insurance by default -CreateCalcSchedule=Edit financial commitment diff --git a/htdocs/langs/ar_IQ/mailmanspip.lang b/htdocs/langs/ar_IQ/mailmanspip.lang deleted file mode 100644 index bab4b3576b4..00000000000 --- a/htdocs/langs/ar_IQ/mailmanspip.lang +++ /dev/null @@ -1,27 +0,0 @@ -# Dolibarr language file - Source file is en_US - mailmanspip -MailmanSpipSetup=Mailman and SPIP module Setup -MailmanTitle=Mailman mailing list system -TestSubscribe=To test subscription to Mailman lists -TestUnSubscribe=To test unsubscribe from Mailman lists -MailmanCreationSuccess=Subscription test was executed successfully -MailmanDeletionSuccess=Unsubscription test was executed successfully -SynchroMailManEnabled=A Mailman update will be performed -SynchroSpipEnabled=A Spip update will be performed -DescADHERENT_MAILMAN_ADMINPW=Mailman administrator password -DescADHERENT_MAILMAN_URL=URL for Mailman subscriptions -DescADHERENT_MAILMAN_UNSUB_URL=URL for Mailman unsubscriptions -DescADHERENT_MAILMAN_LISTS=List(s) for automatic inscription of new members (separated by a comma) -SPIPTitle=SPIP Content Management System -DescADHERENT_SPIP_SERVEUR=SPIP Server -DescADHERENT_SPIP_DB=SPIP database name -DescADHERENT_SPIP_USER=SPIP database login -DescADHERENT_SPIP_PASS=SPIP database password -AddIntoSpip=Add into SPIP -AddIntoSpipConfirmation=Are you sure you want to add this member into SPIP? -AddIntoSpipError=Failed to add the user in SPIP -DeleteIntoSpip=Remove from SPIP -DeleteIntoSpipConfirmation=Are you sure you want to remove this member from SPIP? -DeleteIntoSpipError=Failed to suppress the user from SPIP -SPIPConnectionFailed=Failed to connect to SPIP -SuccessToAddToMailmanList=%s successfully added to mailman list %s or SPIP database -SuccessToRemoveToMailmanList=%s successfully removed from mailman list %s or SPIP database diff --git a/htdocs/langs/ar_IQ/mails.lang b/htdocs/langs/ar_IQ/mails.lang deleted file mode 100644 index 1c0dd638eeb..00000000000 --- a/htdocs/langs/ar_IQ/mails.lang +++ /dev/null @@ -1,179 +0,0 @@ -# Dolibarr language file - Source file is en_US - mails -Mailing=EMailing -EMailing=EMailing -EMailings=EMailings -AllEMailings=All eMailings -MailCard=EMailing card -MailRecipients=Recipients -MailRecipient=Recipient -MailTitle=Description -MailFrom=Sender -MailErrorsTo=Errors to -MailReply=Reply to -MailTo=Receiver(s) -MailToUsers=To user(s) -MailCC=Copy to -MailToCCUsers=Copy to users(s) -MailCCC=Cached copy to -MailTopic=Email subject -MailText=Message -MailFile=Attached files -MailMessage=Email body -SubjectNotIn=Not in Subject -BodyNotIn=Not in Body -ShowEMailing=Show emailing -ListOfEMailings=List of emailings -NewMailing=New emailing -EditMailing=Edit emailing -ResetMailing=Resend emailing -DeleteMailing=Delete emailing -DeleteAMailing=Delete an emailing -PreviewMailing=Preview emailing -CreateMailing=Create emailing -TestMailing=Test email -ValidMailing=Valid emailing -MailingStatusDraft=Draft -MailingStatusValidated=Validated -MailingStatusSent=Sent -MailingStatusSentPartialy=Sent partially -MailingStatusSentCompletely=Sent completely -MailingStatusError=Error -MailingStatusNotSent=Not sent -MailSuccessfulySent=Email (from %s to %s) successfully accepted for delivery -MailingSuccessfullyValidated=EMailing successfully validated -MailUnsubcribe=Unsubscribe -MailingStatusNotContact=Don't contact anymore -MailingStatusReadAndUnsubscribe=Read and unsubscribe -ErrorMailRecipientIsEmpty=Email recipient is empty -WarningNoEMailsAdded=No new Email to add to recipient's list. -ConfirmValidMailing=Are you sure you want to validate this emailing? -ConfirmResetMailing=Warning, by re-initializing emailing %s, you will allow the re-sending this email in a bulk mailing. Are you sure you want to do this? -ConfirmDeleteMailing=Are you sure you want to delete this emailing? -NbOfUniqueEMails=No. of unique emails -NbOfEMails=No. of EMails -TotalNbOfDistinctRecipients=Number of distinct recipients -NoTargetYet=No recipients defined yet (Go on tab 'Recipients') -NoRecipientEmail=No recipient email for %s -RemoveRecipient=Remove recipient -YouCanAddYourOwnPredefindedListHere=To create your email selector module, see htdocs/core/modules/mailings/README. -EMailTestSubstitutionReplacedByGenericValues=When using test mode, substitutions variables are replaced by generic values -MailingAddFile=Attach this file -NoAttachedFiles=No attached files -BadEMail=Bad value for Email -ConfirmCloneEMailing=Are you sure you want to clone this emailing? -CloneContent=Clone message -CloneReceivers=Cloner recipients -DateLastSend=Date of latest sending -DateSending=Date sending -SentTo=Sent to %s -MailingStatusRead=Read -YourMailUnsubcribeOK=The email %s is correctly unsubscribe from mailing list -ActivateCheckReadKey=Key used to encrypt URL used for "Read Receipt" and "Unsubscribe" feature -EMailSentToNRecipients=Email sent to %s recipients. -EMailSentForNElements=Email sent for %s elements. -XTargetsAdded=%s recipients added into target list -OnlyPDFattachmentSupported=If the PDF documents were already generated for the objects to send, they will be attached to email. If not, no email will be sent (also, note that only pdf documents are supported as attachments in mass sending in this version). -AllRecipientSelected=The recipients of the %s record selected (if their email is known). -GroupEmails=Group emails -OneEmailPerRecipient=One email per recipient (by default, one email per record selected) -WarningIfYouCheckOneRecipientPerEmail=Warning, if you check this box, it means only one email will be sent for several different record selected, so, if your message contains substitution variables that refers to data of a record, it becomes not possible to replace them. -ResultOfMailSending=Result of mass Email sending -NbSelected=Number selected -NbIgnored=Number ignored -NbSent=Number sent -SentXXXmessages=%s message(s) sent. -ConfirmUnvalidateEmailing=Are you sure you want to change email %s to draft status? -MailingModuleDescContactsWithThirdpartyFilter=Contact with customer filters -MailingModuleDescContactsByCompanyCategory=Contacts by third-party category -MailingModuleDescContactsByCategory=Contacts by categories -MailingModuleDescContactsByFunction=Contacts by position -MailingModuleDescEmailsFromFile=Emails from file -MailingModuleDescEmailsFromUser=Emails input by user -MailingModuleDescDolibarrUsers=Users with Emails -MailingModuleDescThirdPartiesByCategories=Third parties (by categories) -SendingFromWebInterfaceIsNotAllowed=Sending from web interface is not allowed. -EmailCollectorFilterDesc=All filters must match to have an email being collected - -# Libelle des modules de liste de destinataires mailing -LineInFile=Line %s in file -RecipientSelectionModules=Defined requests for recipient's selection -MailSelectedRecipients=Selected recipients -MailingArea=EMailings area -LastMailings=Latest %s emailings -TargetsStatistics=Targets statistics -NbOfCompaniesContacts=Unique contacts/addresses -MailNoChangePossible=Recipients for validated emailing can't be changed -SearchAMailing=Search mailing -SendMailing=Send emailing -SentBy=Sent by -MailingNeedCommand=Sending an emailing can be performed from command line. Ask your server administrator to launch the following command to send the emailing to all recipients: -MailingNeedCommand2=You can however send them online by adding parameter MAILING_LIMIT_SENDBYWEB with value of max number of emails you want to send by session. For this, go on Home - Setup - Other. -ConfirmSendingEmailing=If you want to send emailing directly from this screen, please confirm you are sure you want to send emailing now from your browser ? -LimitSendingEmailing=Note: Sending of emailings from web interface is done in several times for security and timeout reasons, %s recipients at a time for each sending session. -TargetsReset=Clear list -ToClearAllRecipientsClickHere=Click here to clear the recipient list for this emailing -ToAddRecipientsChooseHere=Add recipients by choosing from the lists -NbOfEMailingsReceived=Mass emailings received -NbOfEMailingsSend=Mass emailings sent -IdRecord=ID record -DeliveryReceipt=Delivery Ack. -YouCanUseCommaSeparatorForSeveralRecipients=You can use the comma separator to specify several recipients. -TagCheckMail=Track mail opening -TagUnsubscribe=Unsubscribe link -TagSignature=Signature of sending user -EMailRecipient=Recipient Email -TagMailtoEmail=Recipient Email (including html "mailto:" link) -NoEmailSentBadSenderOrRecipientEmail=No email sent. Bad sender or recipient email. Verify user profile. -# Module Notifications -Notifications=Notifications -NotificationsAuto=Notifications Auto. -NoNotificationsWillBeSent=No automatic email notifications are planned for this event type and company -ANotificationsWillBeSent=1 automatic notification will be sent by email -SomeNotificationsWillBeSent=%s automatic notifications will be sent by email -AddNewNotification=Subscribe to a new automatic email notification (target/event) -ListOfActiveNotifications=List of all active subscriptions (targets/events) for automatic email notification -ListOfNotificationsDone=List of all automatic email notifications sent -MailSendSetupIs=Configuration of email sending has been setup to '%s'. This mode can't be used to send mass emailing. -MailSendSetupIs2=You must first go, with an admin account, into menu %sHome - Setup - EMails%s to change parameter '%s' to use mode '%s'. With this mode, you can enter setup of the SMTP server provided by your Internet Service Provider and use Mass emailing feature. -MailSendSetupIs3=If you have any questions on how to setup your SMTP server, you can ask to %s. -YouCanAlsoUseSupervisorKeyword=You can also add the keyword __SUPERVISOREMAIL__ to have email being sent to the supervisor of user (works only if an email is defined for this supervisor) -NbOfTargetedContacts=Current number of targeted contact emails -UseFormatFileEmailToTarget=Imported file must have format email;name;firstname;other -UseFormatInputEmailToTarget=Enter a string with format email;name;firstname;other -MailAdvTargetRecipients=Recipients (advanced selection) -AdvTgtTitle=Fill input fields to preselect the third parties or contacts/addresses to target -AdvTgtSearchTextHelp=Use %% as wildcards. For example to find all item like jean, joe, jim, you can input j%%, you can also use ; as separator for value, and use ! for except this value. For example jean;joe;jim%%;!jimo;!jima%% will target all jean, joe, start with jim but not jimo and not everything that starts with jima -AdvTgtSearchIntHelp=Use interval to select int or float value -AdvTgtMinVal=Minimum value -AdvTgtMaxVal=Maximum value -AdvTgtSearchDtHelp=Use interval to select date value -AdvTgtStartDt=Start dt. -AdvTgtEndDt=End dt. -AdvTgtTypeOfIncudeHelp=Target Email of third party and email of contact of the third party, or just third-party email or just contact email -AdvTgtTypeOfIncude=Type of targeted email -AdvTgtContactHelp=Use only if you target contact into "Type of targeted email" -AddAll=Add all -RemoveAll=Remove all -ItemsCount=Item(s) -AdvTgtNameTemplate=Filter name -AdvTgtAddContact=Add emails according to criteria -AdvTgtLoadFilter=Load filter -AdvTgtDeleteFilter=Delete filter -AdvTgtSaveFilter=Save filter -AdvTgtCreateFilter=Create filter -AdvTgtOrCreateNewFilter=Name of new filter -NoContactWithCategoryFound=No category found linked to some contacts/addresses -NoContactLinkedToThirdpartieWithCategoryFound=No category found linked to some thirdparties -OutGoingEmailSetup=Outgoing emails -InGoingEmailSetup=Incoming emails -OutGoingEmailSetupForEmailing=Outgoing emails (for module %s) -DefaultOutgoingEmailSetup=Same configuration than the global Outgoing email setup -Information=Information -ContactsWithThirdpartyFilter=Contacts with third-party filter -Unanswered=Unanswered -Answered=Answered -IsNotAnAnswer=Is not answer (initial email) -IsAnAnswer=Is an answer of an initial email -RecordCreatedByEmailCollector=Record created by the Email Collector %s from email %s -DefaultBlacklistMailingStatus=Default contact status for refuse bulk emailing -DefaultStatusEmptyMandatory=Empty but mandatory diff --git a/htdocs/langs/ar_IQ/main.lang b/htdocs/langs/ar_IQ/main.lang index 6c1ef6aa659..2e691473326 100644 --- a/htdocs/langs/ar_IQ/main.lang +++ b/htdocs/langs/ar_IQ/main.lang @@ -1,9 +1,5 @@ # Dolibarr language file - Source file is en_US - main DIRECTION=ltr -# Note for Chinese: -# msungstdlight or cid0ct are for traditional Chinese (traditional does not render with Ubuntu pdf reader) -# stsongstdlight or cid0cs are for simplified Chinese -# To read Chinese pdf with Linux: sudo apt-get install poppler-data FONTFORPDF=helvetica FONTSIZEFORPDF=10 SeparatorDecimal=. @@ -23,1129 +19,3 @@ FormatDateHourShort=%m/%d/%Y %I:%M %p FormatDateHourSecShort=%m/%d/%Y %I:%M:%S %p FormatDateHourTextShort=%b %d, %Y, %I:%M %p FormatDateHourText=%B %d, %Y, %I:%M %p -DatabaseConnection=Database connection -NoTemplateDefined=No template available for this email type -AvailableVariables=Available substitution variables -NoTranslation=No translation -Translation=Translation -CurrentTimeZone=TimeZone PHP (server) -EmptySearchString=Enter non empty search criterias -EnterADateCriteria=Enter a date criteria -NoRecordFound=No record found -NoRecordDeleted=No record deleted -NotEnoughDataYet=Not enough data -NoError=No error -Error=Error -Errors=Errors -ErrorFieldRequired=Field '%s' is required -ErrorFieldFormat=Field '%s' has a bad value -ErrorFileDoesNotExists=File %s does not exist -ErrorFailedToOpenFile=Failed to open file %s -ErrorCanNotCreateDir=Cannot create dir %s -ErrorCanNotReadDir=Cannot read dir %s -ErrorConstantNotDefined=Parameter %s not defined -ErrorUnknown=Unknown error -ErrorSQL=SQL Error -ErrorLogoFileNotFound=Logo file '%s' was not found -ErrorGoToGlobalSetup=Go to 'Company/Organization' setup to fix this -ErrorGoToModuleSetup=Go to Module setup to fix this -ErrorFailedToSendMail=Failed to send mail (sender=%s, receiver=%s) -ErrorFileNotUploaded=File was not uploaded. Check that size does not exceed maximum allowed, that free space is available on disk and that there is not already a file with same name in this directory. -ErrorInternalErrorDetected=Error detected -ErrorWrongHostParameter=Wrong host parameter -ErrorYourCountryIsNotDefined=Your country is not defined. Go to Home-Setup-Edit and post the form again. -ErrorRecordIsUsedByChild=Failed to delete this record. This record is used by at least one child record. -ErrorWrongValue=Wrong value -ErrorWrongValueForParameterX=Wrong value for parameter %s -ErrorNoRequestInError=No request in error -ErrorServiceUnavailableTryLater=Service not available at the moment. Try again later. -ErrorDuplicateField=Duplicate value in a unique field -ErrorSomeErrorWereFoundRollbackIsDone=Some errors were found. Changes have been rolled back. -ErrorConfigParameterNotDefined=Parameter %s is not defined in the Dolibarr config file conf.php. -ErrorCantLoadUserFromDolibarrDatabase=Failed to find user %s in Dolibarr database. -ErrorNoVATRateDefinedForSellerCountry=Error, no vat rates defined for country '%s'. -ErrorNoSocialContributionForSellerCountry=Error, no social/fiscal taxes type defined for country '%s'. -ErrorFailedToSaveFile=Error, failed to save file. -ErrorCannotAddThisParentWarehouse=You are trying to add a parent warehouse which is already a child of a existing warehouse -MaxNbOfRecordPerPage=Max. number of records per page -NotAuthorized=You are not authorized to do that. -SetDate=Set date -SelectDate=Select a date -SeeAlso=See also %s -SeeHere=See here -ClickHere=Click here -Here=Here -Apply=Apply -BackgroundColorByDefault=Default background color -FileRenamed=The file was successfully renamed -FileGenerated=The file was successfully generated -FileSaved=The file was successfully saved -FileUploaded=The file was successfully uploaded -FileTransferComplete=File(s) uploaded successfully -FilesDeleted=File(s) successfully deleted -FileWasNotUploaded=A file is selected for attachment but was not yet uploaded. Click on "Attach file" for this. -NbOfEntries=No. of entries -GoToWikiHelpPage=Read online help (Internet access needed) -GoToHelpPage=Read help -DedicatedPageAvailable=There is a dedicated help page related to your current screen -HomePage=Home Page -RecordSaved=Record saved -RecordDeleted=Record deleted -RecordGenerated=Record generated -LevelOfFeature=Level of features -NotDefined=Not defined -DolibarrInHttpAuthenticationSoPasswordUseless=Dolibarr authentication mode is set to %s in configuration file conf.php.
    This means that the password database is external to Dolibarr, so changing this field may have no effect. -Administrator=Administrator -Undefined=Undefined -PasswordForgotten=Password forgotten? -NoAccount=No account? -SeeAbove=See above -HomeArea=Home -LastConnexion=Last login -PreviousConnexion=Previous login -PreviousValue=Previous value -ConnectedOnMultiCompany=Connected on environment -ConnectedSince=Connected since -AuthenticationMode=Authentication mode -RequestedUrl=Requested URL -DatabaseTypeManager=Database type manager -RequestLastAccessInError=Latest database access request error -ReturnCodeLastAccessInError=Return code for latest database access request error -InformationLastAccessInError=Information for latest database access request error -DolibarrHasDetectedError=Dolibarr has detected a technical error -YouCanSetOptionDolibarrMainProdToZero=You can read log file or set option $dolibarr_main_prod to '0' in your config file to get more information. -InformationToHelpDiagnose=This information can be useful for diagnostic purposes (you can set option $dolibarr_main_prod to '1' to remove such notices) -MoreInformation=More information -TechnicalInformation=Technical information -TechnicalID=Technical ID -LineID=Line ID -NotePublic=Note (public) -NotePrivate=Note (private) -PrecisionUnitIsLimitedToXDecimals=Dolibarr was setup to limit precision of unit prices to %s decimals. -DoTest=Test -ToFilter=Filter -NoFilter=No filter -WarningYouHaveAtLeastOneTaskLate=Warning, you have at least one element that has exceeded the tolerance time. -yes=yes -Yes=Yes -no=no -No=No -All=All -Home=Home -Help=Help -OnlineHelp=Online help -PageWiki=Wiki page -MediaBrowser=Media browser -Always=Always -Never=Never -Under=under -Period=Period -PeriodEndDate=End date for period -SelectedPeriod=Selected period -PreviousPeriod=Previous period -Activate=Activate -Activated=Activated -Closed=Closed -Closed2=Closed -NotClosed=Not closed -Enabled=Enabled -Enable=Enable -Deprecated=Deprecated -Disable=Disable -Disabled=Disabled -Add=Add -AddLink=Add link -RemoveLink=Remove link -AddToDraft=Add to draft -Update=Update -Close=Close -CloseAs=Set status to -CloseBox=Remove widget from your dashboard -Confirm=Confirm -ConfirmSendCardByMail=Do you really want to send the content of this card by mail to %s? -Delete=Delete -Remove=Remove -Resiliate=Terminate -Cancel=Cancel -Modify=Modify -Edit=Edit -Validate=Validate -ValidateAndApprove=Validate and Approve -ToValidate=To validate -NotValidated=Not validated -Save=Save -SaveAs=Save As -SaveAndStay=Save and stay -SaveAndNew=Save and new -TestConnection=Test connection -ToClone=Clone -ConfirmCloneAsk=Are you sure you want to clone the object %s? -ConfirmClone=Choose the data you want to clone: -NoCloneOptionsSpecified=No data to clone defined. -Of=of -Go=Go -Run=Run -CopyOf=Copy of -Show=Show -Hide=Hide -ShowCardHere=Show card -Search=Search -SearchOf=Search -SearchMenuShortCut=Ctrl + shift + f -QuickAdd=Quick add -QuickAddMenuShortCut=Ctrl + shift + l -Valid=Valid -Approve=Approve -Disapprove=Disapprove -ReOpen=Re-Open -Upload=Upload -ToLink=Link -Select=Select -SelectAll=Select all -Choose=Choose -Resize=Resize -ResizeOrCrop=Resize or Crop -Recenter=Recenter -Author=Author -User=User -Users=Users -Group=Group -Groups=Groups -NoUserGroupDefined=No user group defined -Password=Password -PasswordRetype=Retype your password -NoteSomeFeaturesAreDisabled=Note that a lot of features/modules are disabled in this demonstration. -Name=Name -NameSlashCompany=Name / Company -Person=Person -Parameter=Parameter -Parameters=Parameters -Value=Value -PersonalValue=Personal value -NewObject=New %s -NewValue=New value -OldValue=Old value %s -CurrentValue=Current value -Code=Code -Type=Type -Language=Language -MultiLanguage=Multi-language -Note=Note -Title=Title -Label=Label -RefOrLabel=Ref. or label -Info=Log -Family=Family -Description=Description -Designation=Description -DescriptionOfLine=Description of line -DateOfLine=Date of line -DurationOfLine=Duration of line -Model=Doc template -DefaultModel=Default doc template -Action=Event -About=About -Number=Number -NumberByMonth=Total reports by month -AmountByMonth=Amount by month -Numero=Number -Limit=Limit -Limits=Limits -Logout=Logout -NoLogoutProcessWithAuthMode=No applicative disconnect feature with authentication mode %s -Connection=Login -Setup=Setup -Alert=Alert -MenuWarnings=Alerts -Previous=Previous -Next=Next -Cards=Cards -Card=Card -Now=Now -HourStart=Start hour -Deadline=Deadline -Date=Date -DateAndHour=Date and hour -DateToday=Today's date -DateReference=Reference date -DateStart=Start date -DateEnd=End date -DateCreation=Creation date -DateCreationShort=Creat. date -IPCreation=Creation IP -DateModification=Modification date -DateModificationShort=Modif. date -IPModification=Modification IP -DateLastModification=Latest modification date -DateValidation=Validation date -DateSigning=Signing date -DateClosing=Closing date -DateDue=Due date -DateValue=Value date -DateValueShort=Value date -DateOperation=Operation date -DateOperationShort=Oper. Date -DateLimit=Limit date -DateRequest=Request date -DateProcess=Process date -DateBuild=Report build date -DatePayment=Date of payment -DateApprove=Approving date -DateApprove2=Approving date (second approval) -RegistrationDate=Registration date -UserCreation=Creation user -UserModification=Modification user -UserValidation=Validation user -UserCreationShort=Creat. user -UserModificationShort=Modif. user -UserValidationShort=Valid. user -DurationYear=year -DurationMonth=month -DurationWeek=week -DurationDay=day -DurationYears=years -DurationMonths=months -DurationWeeks=weeks -DurationDays=days -Year=Year -Month=Month -Week=Week -WeekShort=Week -Day=Day -Hour=Hour -Minute=Minute -Second=Second -Years=Years -Months=Months -Days=Days -days=days -Hours=Hours -Minutes=Minutes -Seconds=Seconds -Weeks=Weeks -Today=Today -Yesterday=Yesterday -Tomorrow=Tomorrow -Morning=Morning -Afternoon=Afternoon -Quadri=Quadri -MonthOfDay=Month of the day -DaysOfWeek=Days of week -HourShort=H -MinuteShort=mn -Rate=Rate -CurrencyRate=Currency conversion rate -UseLocalTax=Include tax -Bytes=Bytes -KiloBytes=Kilobytes -MegaBytes=Megabytes -GigaBytes=Gigabytes -TeraBytes=Terabytes -UserAuthor=Ceated by -UserModif=Updated by -b=b. -Kb=Kb -Mb=Mb -Gb=Gb -Tb=Tb -Cut=Cut -Copy=Copy -Paste=Paste -Default=Default -DefaultValue=Default value -DefaultValues=Default values/filters/sorting -Price=Price -PriceCurrency=Price (currency) -UnitPrice=Unit price -UnitPriceHT=Unit price (excl.) -UnitPriceHTCurrency=Unit price (excl.) (currency) -UnitPriceTTC=Unit price -PriceU=U.P. -PriceUHT=U.P. (net) -PriceUHTCurrency=U.P (net) (currency) -PriceUTTC=U.P. (inc. tax) -Amount=Amount -AmountInvoice=Invoice amount -AmountInvoiced=Amount invoiced -AmountInvoicedHT=Amount invoiced (excl. tax) -AmountInvoicedTTC=Amount invoiced (inc. tax) -AmountPayment=Payment amount -AmountHTShort=Amount (excl.) -AmountTTCShort=Amount (inc. tax) -AmountHT=Amount (excl. tax) -AmountTTC=Amount (inc. tax) -AmountVAT=Amount tax -MulticurrencyAlreadyPaid=Already paid, original currency -MulticurrencyRemainderToPay=Remain to pay, original currency -MulticurrencyPaymentAmount=Payment amount, original currency -MulticurrencyAmountHT=Amount (excl. tax), original currency -MulticurrencyAmountTTC=Amount (inc. of tax), original currency -MulticurrencyAmountVAT=Amount tax, original currency -MulticurrencySubPrice=Amount sub price multi currency -AmountLT1=Amount tax 2 -AmountLT2=Amount tax 3 -AmountLT1ES=Amount RE -AmountLT2ES=Amount IRPF -AmountTotal=Total amount -AmountAverage=Average amount -PriceQtyMinHT=Price quantity min. (excl. tax) -PriceQtyMinHTCurrency=Price quantity min. (excl. tax) (currency) -PercentOfOriginalObject=Percent of original object -AmountOrPercent=Amount or percent -Percentage=Percentage -Total=Total -SubTotal=Subtotal -TotalHTShort=Total (excl.) -TotalHT100Short=Total 100%% (excl.) -TotalHTShortCurrency=Total (excl. in currency) -TotalTTCShort=Total (inc. tax) -TotalHT=Total (excl. tax) -TotalHTforthispage=Total (excl. tax) for this page -Totalforthispage=Total for this page -TotalTTC=Total (inc. tax) -TotalTTCToYourCredit=Total (inc. tax) to your credit -TotalVAT=Total tax -TotalVATIN=Total IGST -TotalLT1=Total tax 2 -TotalLT2=Total tax 3 -TotalLT1ES=Total RE -TotalLT2ES=Total IRPF -TotalLT1IN=Total CGST -TotalLT2IN=Total SGST -HT=Excl. tax -TTC=Inc. tax -INCVATONLY=Inc. VAT -INCT=Inc. all taxes -VAT=Sales tax -VATIN=IGST -VATs=Sales taxes -VATINs=IGST taxes -LT1=Sales tax 2 -LT1Type=Sales tax 2 type -LT2=Sales tax 3 -LT2Type=Sales tax 3 type -LT1ES=RE -LT2ES=IRPF -LT1IN=CGST -LT2IN=SGST -LT1GC=Additionnal cents -VATRate=Tax Rate -RateOfTaxN=Rate of tax %s -VATCode=Tax Rate code -VATNPR=Tax Rate NPR -DefaultTaxRate=Default tax rate -Average=Average -Sum=Sum -Delta=Delta -StatusToPay=To pay -RemainToPay=Remain to pay -Module=Module/Application -Modules=Modules/Applications -Option=Option -Filters=Filters -List=List -FullList=Full list -FullConversation=Full conversation -Statistics=Statistics -OtherStatistics=Other statistics -Status=Status -Favorite=Favorite -ShortInfo=Info. -Ref=Ref. -ExternalRef=Ref. extern -RefSupplier=Ref. vendor -RefPayment=Ref. payment -CommercialProposalsShort=Commercial proposals -Comment=Comment -Comments=Comments -ActionsToDo=Events to do -ActionsToDoShort=To do -ActionsDoneShort=Done -ActionNotApplicable=Not applicable -ActionRunningNotStarted=To start -ActionRunningShort=In progress -ActionDoneShort=Finished -ActionUncomplete=Incomplete -LatestLinkedEvents=Latest %s linked events -CompanyFoundation=Company/Organization -Accountant=Accountant -ContactsForCompany=Contacts for this third party -ContactsAddressesForCompany=Contacts/addresses for this third party -AddressesForCompany=Addresses for this third party -ActionsOnCompany=Events for this third party -ActionsOnContact=Events for this contact/address -ActionsOnContract=Events for this contract -ActionsOnMember=Events about this member -ActionsOnProduct=Events about this product -NActionsLate=%s late -ToDo=To do -Completed=Completed -Running=In progress -RequestAlreadyDone=Request already recorded -Filter=Filter -FilterOnInto=Search criteria '%s' into fields %s -RemoveFilter=Remove filter -ChartGenerated=Chart generated -ChartNotGenerated=Chart not generated -GeneratedOn=Build on %s -Generate=Generate -Duration=Duration -TotalDuration=Total duration -Summary=Summary -DolibarrStateBoard=Database Statistics -DolibarrWorkBoard=Open Items -NoOpenedElementToProcess=No open element to process -Available=Available -NotYetAvailable=Not yet available -NotAvailable=Not available -Categories=Tags/categories -Category=Tag/category -By=By -From=From -FromDate=From -FromLocation=From -to=to -To=to -ToDate=to -ToLocation=to -at=at -and=and -or=or -Other=Other -Others=Others -OtherInformations=Other information -Quantity=Quantity -Qty=Qty -ChangedBy=Changed by -ApprovedBy=Approved by -ApprovedBy2=Approved by (second approval) -Approved=Approved -Refused=Refused -ReCalculate=Recalculate -ResultKo=Failure -Reporting=Reporting -Reportings=Reporting -Draft=Draft -Drafts=Drafts -StatusInterInvoiced=Invoiced -Validated=Validated -ValidatedToProduce=Validated (To produce) -Opened=Open -OpenAll=Open (All) -ClosedAll=Closed (All) -New=New -Discount=Discount -Unknown=Unknown -General=General -Size=Size -OriginalSize=Original size -Received=Received -Paid=Paid -Topic=Subject -ByCompanies=By third parties -ByUsers=By user -Links=Links -Link=Link -Rejects=Rejects -Preview=Preview -NextStep=Next step -Datas=Data -None=None -NoneF=None -NoneOrSeveral=None or several -Late=Late -LateDesc=An item is defined as Delayed as per the system configuration in menu Home - Setup - Alerts. -NoItemLate=No late item -Photo=Picture -Photos=Pictures -AddPhoto=Add picture -DeletePicture=Picture delete -ConfirmDeletePicture=Confirm picture deletion? -Login=Login -LoginEmail=Login (email) -LoginOrEmail=Login or Email -CurrentLogin=Current login -EnterLoginDetail=Enter login details -January=January -February=February -March=March -April=April -May=May -June=June -July=July -August=August -September=September -October=October -November=November -December=December -Month01=January -Month02=February -Month03=March -Month04=April -Month05=May -Month06=June -Month07=July -Month08=August -Month09=September -Month10=October -Month11=November -Month12=December -MonthShort01=Jan -MonthShort02=Feb -MonthShort03=Mar -MonthShort04=Apr -MonthShort05=May -MonthShort06=Jun -MonthShort07=Jul -MonthShort08=Aug -MonthShort09=Sep -MonthShort10=Oct -MonthShort11=Nov -MonthShort12=Dec -MonthVeryShort01=J -MonthVeryShort02=F -MonthVeryShort03=M -MonthVeryShort04=A -MonthVeryShort05=M -MonthVeryShort06=J -MonthVeryShort07=J -MonthVeryShort08=A -MonthVeryShort09=S -MonthVeryShort10=O -MonthVeryShort11=N -MonthVeryShort12=D -AttachedFiles=Attached files and documents -JoinMainDoc=Join main document -DateFormatYYYYMM=YYYY-MM -DateFormatYYYYMMDD=YYYY-MM-DD -DateFormatYYYYMMDDHHMM=YYYY-MM-DD HH:SS -ReportName=Report name -ReportPeriod=Report period -ReportDescription=Description -Report=Report -Keyword=Keyword -Origin=Origin -Legend=Legend -Fill=Fill -Reset=Reset -File=File -Files=Files -NotAllowed=Not allowed -ReadPermissionNotAllowed=Read permission not allowed -AmountInCurrency=Amount in %s currency -Example=Example -Examples=Examples -NoExample=No example -FindBug=Report a bug -NbOfThirdParties=Number of third parties -NbOfLines=Number of lines -NbOfObjects=Number of objects -NbOfObjectReferers=Number of related items -Referers=Related items -TotalQuantity=Total quantity -DateFromTo=From %s to %s -DateFrom=From %s -DateUntil=Until %s -Check=Check -Uncheck=Uncheck -Internal=Internal -External=External -Internals=Internal -Externals=External -Warning=Warning -Warnings=Warnings -BuildDoc=Build Doc -Entity=Environment -Entities=Entities -CustomerPreview=Customer preview -SupplierPreview=Vendor preview -ShowCustomerPreview=Show customer preview -ShowSupplierPreview=Show vendor preview -RefCustomer=Ref. customer -InternalRef=Internal ref. -Currency=Currency -InfoAdmin=Information for administrators -Undo=Undo -Redo=Redo -ExpandAll=Expand all -UndoExpandAll=Undo expand -SeeAll=See all -Reason=Reason -FeatureNotYetSupported=Feature not yet supported -CloseWindow=Close window -Response=Response -Priority=Priority -SendByMail=Send by email -MailSentBy=Email sent by -NotSent=Not sent -TextUsedInTheMessageBody=Email body -SendAcknowledgementByMail=Send confirmation email -SendMail=Send email -Email=Email -NoEMail=No email -AlreadyRead=Already read -NotRead=Unread -NoMobilePhone=No mobile phone -Owner=Owner -FollowingConstantsWillBeSubstituted=The following constants will be replaced with the corresponding value. -Refresh=Refresh -BackToList=Back to list -BackToTree=Back to tree -GoBack=Go back -CanBeModifiedIfOk=Can be modified if valid -CanBeModifiedIfKo=Can be modified if not valid -ValueIsValid=Value is valid -ValueIsNotValid=Value is not valid -RecordCreatedSuccessfully=Record created successfully -RecordModifiedSuccessfully=Record modified successfully -RecordsModified=%s record(s) modified -RecordsDeleted=%s record(s) deleted -RecordsGenerated=%s record(s) generated -AutomaticCode=Automatic code -FeatureDisabled=Feature disabled -MoveBox=Move widget -Offered=Offered -NotEnoughPermissions=You don't have permission for this action -SessionName=Session name -Method=Method -Receive=Receive -CompleteOrNoMoreReceptionExpected=Complete or nothing more expected -ExpectedValue=Expected Value -ExpectedQty=Expected Qty -PartialWoman=Partial -TotalWoman=Total -NeverReceived=Never received -Canceled=Canceled -YouCanChangeValuesForThisListFromDictionarySetup=You can change values for this list from menu Setup - Dictionaries -YouCanChangeValuesForThisListFrom=You can change values for this list from menu %s -YouCanSetDefaultValueInModuleSetup=You can set the default value used when creating a new record in module setup -Color=Color -Documents=Linked files -Documents2=Documents -UploadDisabled=Upload disabled -MenuAccountancy=Accounting -MenuECM=Documents -MenuAWStats=AWStats -MenuMembers=Members -MenuAgendaGoogle=Google agenda -MenuTaxesAndSpecialExpenses=Taxes | Special expenses -ThisLimitIsDefinedInSetup=Dolibarr limit (Menu home-setup-security): %s Kb, PHP limit: %s Kb -ThisLimitIsDefinedInSetupAt=Dolibarr limit (Menu %s): %s Kb, PHP limit (Param %s): %s Kb -NoFileFound=No documents uploaded -CurrentUserLanguage=Current language -CurrentTheme=Current theme -CurrentMenuManager=Current menu manager -Browser=Browser -Layout=Layout -Screen=Screen -DisabledModules=Disabled modules -For=For -ForCustomer=For customer -Signature=Signature -DateOfSignature=Date of signature -HidePassword=Show command with password hidden -UnHidePassword=Show real command with clear password -Root=Root -RootOfMedias=Root of public medias (/medias) -Informations=Information -Page=Page -Notes=Notes -AddNewLine=Add new line -AddFile=Add file -FreeZone=Free-text product -FreeLineOfType=Free-text item, type: -CloneMainAttributes=Clone object with its main attributes -ReGeneratePDF=Re-generate PDF -PDFMerge=PDF Merge -Merge=Merge -DocumentModelStandardPDF=Standard PDF template -PrintContentArea=Show page to print main content area -MenuManager=Menu manager -WarningYouAreInMaintenanceMode=Warning, you are in maintenance mode: only login %s is allowed to use the application in this mode. -CoreErrorTitle=System error -CoreErrorMessage=Sorry, an error occurred. Contact your system administrator to check the logs or disable $dolibarr_main_prod=1 to get more information. -CreditCard=Credit card -ValidatePayment=Validate payment -CreditOrDebitCard=Credit or debit card -FieldsWithAreMandatory=Fields with %s are mandatory -FieldsWithIsForPublic=Fields with %s are shown in public list of members. If you don't want this, uncheck the "public" box. -AccordingToGeoIPDatabase=(according to GeoIP conversion) -Line=Line -NotSupported=Not supported -RequiredField=Required field -Result=Result -ToTest=Test -ValidateBefore=Item must be validated before using this feature -Visibility=Visibility -Totalizable=Totalizable -TotalizableDesc=This field is totalizable in list -Private=Private -Hidden=Hidden -Resources=Resources -Source=Source -Prefix=Prefix -Before=Before -After=After -IPAddress=IP address -Frequency=Frequency -IM=Instant messaging -NewAttribute=New attribute -AttributeCode=Attribute code -URLPhoto=URL of photo/logo -SetLinkToAnotherThirdParty=Link to another third party -LinkTo=Link to -LinkToProposal=Link to proposal -LinkToOrder=Link to order -LinkToInvoice=Link to invoice -LinkToTemplateInvoice=Link to template invoice -LinkToSupplierOrder=Link to purchase order -LinkToSupplierProposal=Link to vendor proposal -LinkToSupplierInvoice=Link to vendor invoice -LinkToContract=Link to contract -LinkToIntervention=Link to intervention -LinkToTicket=Link to ticket -CreateDraft=Create draft -SetToDraft=Back to draft -ClickToEdit=Click to edit -ClickToRefresh=Click to refresh -EditWithEditor=Edit with CKEditor -EditWithTextEditor=Edit with Text editor -EditHTMLSource=Edit HTML Source -ObjectDeleted=Object %s deleted -ByCountry=By country -ByTown=By town -ByDate=By date -ByMonthYear=By month/year -ByYear=By year -ByMonth=By month -ByDay=By day -BySalesRepresentative=By sales representative -LinkedToSpecificUsers=Linked to a particular user contact -NoResults=No results -AdminTools=Admin Tools -SystemTools=System tools -ModulesSystemTools=Modules tools -Test=Test -Element=Element -NoPhotoYet=No pictures available yet -Dashboard=Dashboard -MyDashboard=My Dashboard -Deductible=Deductible -from=from -toward=toward -Access=Access -SelectAction=Select action -SelectTargetUser=Select target user/employee -HelpCopyToClipboard=Use Ctrl+C to copy to clipboard -SaveUploadedFileWithMask=Save file on server with name "%s" (otherwise "%s") -OriginFileName=Original filename -SetDemandReason=Set source -SetBankAccount=Define Bank Account -AccountCurrency=Account currency -ViewPrivateNote=View notes -XMoreLines=%s line(s) hidden -ShowMoreLines=Show more/less lines -PublicUrl=Public URL -AddBox=Add box -SelectElementAndClick=Select an element and click on %s -PrintFile=Print File %s -ShowTransaction=Show entry on bank account -ShowIntervention=Show intervention -ShowContract=Show contract -GoIntoSetupToChangeLogo=Go to Home - Setup - Company to change logo or go to Home - Setup - Display to hide. -Deny=Deny -Denied=Denied -ListOf=List of %s -ListOfTemplates=List of templates -Gender=Gender -Genderman=Male -Genderwoman=Female -Genderother=Other -ViewList=List view -ViewGantt=Gantt view -ViewKanban=Kanban view -Mandatory=Mandatory -Hello=Hello -GoodBye=GoodBye -Sincerely=Sincerely -ConfirmDeleteObject=Are you sure you want to delete this object? -DeleteLine=Delete line -ConfirmDeleteLine=Are you sure you want to delete this line? -ErrorPDFTkOutputFileNotFound=Error: the file was not generated. Please check that the 'pdftk' command is installed in a directory included in the $PATH environment variable (linux/unix only) or contact your system administrator. -NoPDFAvailableForDocGenAmongChecked=No PDF were available for the document generation among checked record -TooManyRecordForMassAction=Too many records selected for mass action. The action is restricted to a list of %s records. -NoRecordSelected=No record selected -MassFilesArea=Area for files built by mass actions -ShowTempMassFilesArea=Show area of files built by mass actions -ConfirmMassDeletion=Bulk Delete confirmation -ConfirmMassDeletionQuestion=Are you sure you want to delete the %s selected record(s)? -RelatedObjects=Related Objects -ClassifyBilled=Classify billed -ClassifyUnbilled=Classify unbilled -Progress=Progress -ProgressShort=Progr. -FrontOffice=Front office -BackOffice=Back office -Submit=Submit -View=View -Export=Export -Exports=Exports -ExportFilteredList=Export filtered list -ExportList=Export list -ExportOptions=Export Options -IncludeDocsAlreadyExported=Include docs already exported -ExportOfPiecesAlreadyExportedIsEnable=Export of pieces already exported is enable -ExportOfPiecesAlreadyExportedIsDisable=Export of pieces already exported is disable -AllExportedMovementsWereRecordedAsExported=All exported movements were recorded as exported -NotAllExportedMovementsCouldBeRecordedAsExported=Not all exported movements could be recorded as exported -Miscellaneous=Miscellaneous -Calendar=Calendar -GroupBy=Group by... -ViewFlatList=View flat list -ViewAccountList=View ledger -ViewSubAccountList=View subaccount ledger -RemoveString=Remove string '%s' -SomeTranslationAreUncomplete=Some of the languages offered may be only partially translated or may contain errors. Please help to correct your language by registering at https://transifex.com/projects/p/dolibarr/ to add your improvements. -DirectDownloadLink=Public download link -PublicDownloadLinkDesc=Only the link is required to download the file -DirectDownloadInternalLink=Private download link -PrivateDownloadLinkDesc=You need to be logged and you need permissions to view or download the file -Download=Download -DownloadDocument=Download document -ActualizeCurrency=Update currency rate -Fiscalyear=Fiscal year -ModuleBuilder=Module and Application Builder -SetMultiCurrencyCode=Set currency -BulkActions=Bulk actions -ClickToShowHelp=Click to show tooltip help -WebSite=Website -WebSites=Websites -WebSiteAccounts=Website accounts -ExpenseReport=Expense report -ExpenseReports=Expense reports -HR=HR -HRAndBank=HR and Bank -AutomaticallyCalculated=Automatically calculated -TitleSetToDraft=Go back to draft -ConfirmSetToDraft=Are you sure you want to go back to Draft status? -ImportId=Import id -Events=Events -EMailTemplates=Email templates -FileNotShared=File not shared to external public -Project=Project -Projects=Projects -LeadOrProject=Lead | Project -LeadsOrProjects=Leads | Projects -Lead=Lead -Leads=Leads -ListOpenLeads=List open leads -ListOpenProjects=List open projects -NewLeadOrProject=New lead or project -Rights=Permissions -LineNb=Line no. -IncotermLabel=Incoterms -TabLetteringCustomer=Customer lettering -TabLetteringSupplier=Vendor lettering -Monday=Monday -Tuesday=Tuesday -Wednesday=Wednesday -Thursday=Thursday -Friday=Friday -Saturday=Saturday -Sunday=Sunday -MondayMin=Mo -TuesdayMin=Tu -WednesdayMin=We -ThursdayMin=Th -FridayMin=Fr -SaturdayMin=Sa -SundayMin=Su -Day1=Monday -Day2=Tuesday -Day3=Wednesday -Day4=Thursday -Day5=Friday -Day6=Saturday -Day0=Sunday -ShortMonday=M -ShortTuesday=T -ShortWednesday=W -ShortThursday=T -ShortFriday=F -ShortSaturday=S -ShortSunday=S -one=one -two=two -three=three -four=four -five=five -six=six -seven=seven -eight=eight -nine=nine -ten=ten -eleven=eleven -twelve=twelve -thirteen=thirdteen -fourteen=fourteen -fifteen=fifteen -sixteen=sixteen -seventeen=seventeen -eighteen=eighteen -nineteen=nineteen -twenty=twenty -thirty=thirty -forty=forty -fifty=fifty -sixty=sixty -seventy=seventy -eighty=eighty -ninety=ninety -hundred=hundred -thousand=thousand -million=million -billion=billion -trillion=trillion -quadrillion=quadrillion -SelectMailModel=Select an email template -SetRef=Set ref -Select2ResultFoundUseArrows=Some results found. Use arrows to select. -Select2NotFound=No result found -Select2Enter=Enter -Select2MoreCharacter=or more character -Select2MoreCharacters=or more characters -Select2MoreCharactersMore=Search syntax:
    | OR (a|b)
    * Any character (a*b)
    ^ Start with (^ab)
    $ End with (ab$)
    -Select2LoadingMoreResults=Loading more results... -Select2SearchInProgress=Search in progress... -SearchIntoThirdparties=Third parties -SearchIntoContacts=Contacts -SearchIntoMembers=Members -SearchIntoUsers=Users -SearchIntoProductsOrServices=Products or services -SearchIntoBatch=Lots / Serials -SearchIntoProjects=Projects -SearchIntoMO=Manufacturing Orders -SearchIntoTasks=Tasks -SearchIntoCustomerInvoices=Customer invoices -SearchIntoSupplierInvoices=Vendor invoices -SearchIntoCustomerOrders=Sales orders -SearchIntoSupplierOrders=Purchase orders -SearchIntoCustomerProposals=Commercial proposals -SearchIntoSupplierProposals=Vendor proposals -SearchIntoInterventions=Interventions -SearchIntoContracts=Contracts -SearchIntoCustomerShipments=Customer shipments -SearchIntoExpenseReports=Expense reports -SearchIntoLeaves=Leave -SearchIntoTickets=Tickets -SearchIntoCustomerPayments=Customer payments -SearchIntoVendorPayments=Vendor payments -SearchIntoMiscPayments=Miscellaneous payments -CommentLink=Comments -NbComments=Number of comments -CommentPage=Comments space -CommentAdded=Comment added -CommentDeleted=Comment deleted -Everybody=Everybody -PayedBy=Paid by -PayedTo=Paid to -Monthly=Monthly -Quarterly=Quarterly -Annual=Annual -Local=Local -Remote=Remote -LocalAndRemote=Local and Remote -KeyboardShortcut=Keyboard shortcut -AssignedTo=Assigned to -Deletedraft=Delete draft -ConfirmMassDraftDeletion=Draft mass delete confirmation -FileSharedViaALink=File shared with a public link -SelectAThirdPartyFirst=Select a third party first... -YouAreCurrentlyInSandboxMode=You are currently in the %s "sandbox" mode -Inventory=Inventory -AnalyticCode=Analytic code -TMenuMRP=MRP -ShowCompanyInfos=Show company infos -ShowMoreInfos=Show More Infos -NoFilesUploadedYet=Please upload a document first -SeePrivateNote=See private note -PaymentInformation=Payment information -ValidFrom=Valid from -ValidUntil=Valid until -NoRecordedUsers=No users -ToClose=To close -ToRefuse=To refuse -ToProcess=To process -ToApprove=To approve -GlobalOpenedElemView=Global view -NoArticlesFoundForTheKeyword=No article found for the keyword '%s' -NoArticlesFoundForTheCategory=No article found for the category -ToAcceptRefuse=To accept | refuse -ContactDefault_agenda=Event -ContactDefault_commande=Order -ContactDefault_contrat=Contract -ContactDefault_facture=Invoice -ContactDefault_fichinter=Intervention -ContactDefault_invoice_supplier=Supplier Invoice -ContactDefault_order_supplier=Purchase Order -ContactDefault_project=Project -ContactDefault_project_task=Task -ContactDefault_propal=Proposal -ContactDefault_supplier_proposal=Supplier Proposal -ContactDefault_ticket=Ticket -ContactAddedAutomatically=Contact added from contact thirdparty roles -More=More -ShowDetails=Show details -CustomReports=Custom reports -StatisticsOn=Statistics on -SelectYourGraphOptionsFirst=Select your graph options to build a graph -Measures=Measures -XAxis=X-Axis -YAxis=Y-Axis -StatusOfRefMustBe=Status of %s must be %s -DeleteFileHeader=Confirm file delete -DeleteFileText=Do you really want delete this file? -ShowOtherLanguages=Show other languages -SwitchInEditModeToAddTranslation=Switch in edit mode to add translations for this language -NotUsedForThisCustomer=Not used for this customer -AmountMustBePositive=Amount must be positive -ByStatus=By status -InformationMessage=Information -Used=Used -ASAP=As Soon As Possible -CREATEInDolibarr=Record %s created -MODIFYInDolibarr=Record %s modified -DELETEInDolibarr=Record %s deleted -VALIDATEInDolibarr=Record %s validated -APPROVEDInDolibarr=Record %s approved -DefaultMailModel=Default Mail Model -PublicVendorName=Public name of vendor -DateOfBirth=Date of birth -SecurityTokenHasExpiredSoActionHasBeenCanceledPleaseRetry=Security token has expired, so action has been canceled. Please try again. -UpToDate=Up-to-date -OutOfDate=Out-of-date -EventReminder=Event Reminder -UpdateForAllLines=Update for all lines -OnHold=On hold -Civility=Civility -AffectTag=Affect Tag -CreateExternalUser=Create external user -ConfirmAffectTag=Bulk Tag Affect -ConfirmAffectTagQuestion=Are you sure you want to affect tags to the %s selected record(s)? -CategTypeNotFound=No tag type found for type of records -CopiedToClipboard=Copied to clipboard -InformationOnLinkToContract=This amount is only the total of all the lines of the contract. No notion of time is taken into consideration. -ConfirmCancel=Are you sure you want to cancel -EmailMsgID=Email MsgID -SetToEnabled=Set to enabled -SetToDisabled=Set to disabled -ConfirmMassEnabling=mass enabling confirmation -ConfirmMassEnablingQuestion=Are you sure you want to enable the %s selected record(s)? -ConfirmMassDisabling=mass disabling confirmation -ConfirmMassDisablingQuestion=Are you sure you want to disable the %s selected record(s)? -RecordsEnabled=%s record(s) enabled -RecordsDisabled=%s record(s) disabled -RecordEnabled=Record enabled -RecordDisabled=Record disabled -Forthcoming=Forthcoming -Currently=Currently diff --git a/htdocs/langs/ar_IQ/margins.lang b/htdocs/langs/ar_IQ/margins.lang index ad5406409b4..ec02ad138e3 100644 --- a/htdocs/langs/ar_IQ/margins.lang +++ b/htdocs/langs/ar_IQ/margins.lang @@ -1,45 +1,2 @@ -# Dolibarr language file - Source file is en_US - marges - -Margin=Margin -Margins=Margins -TotalMargin=Total Margin -MarginOnProducts=Margin / Products -MarginOnServices=Margin / Services -MarginRate=Margin rate -MarkRate=Mark rate -DisplayMarginRates=Display margin rates -DisplayMarkRates=Display mark rates -InputPrice=Input price -margin=Profit margins management -margesSetup=Profit margins management setup -MarginDetails=Margin details -ProductMargins=Product margins -CustomerMargins=Customer margins -SalesRepresentativeMargins=Sales representative margins -ContactOfInvoice=Contact of invoice -UserMargins=User margins -ProductService=Product or Service -AllProducts=All products and services -ChooseProduct/Service=Choose product or service -ForceBuyingPriceIfNull=Force buying/cost price to selling price if not defined +# Dolibarr language file - Source file is en_US - margins ForceBuyingPriceIfNullDetails=If buying/cost price not provided when we add a new line, and this option is "ON", the margin will be 0 on the new line (buying/cost price = selling price). If this option is "OFF" (recommended), margin will be equal to the value suggested by default (and may be 100% if no default value can be found). -MARGIN_METHODE_FOR_DISCOUNT=Margin method for global discounts -UseDiscountAsProduct=As a product -UseDiscountAsService=As a service -UseDiscountOnTotal=On subtotal -MARGIN_METHODE_FOR_DISCOUNT_DETAILS=Defines if a global discount is treated as a product, a service, or only on subtotal for margin calculation. -MARGIN_TYPE=Buying/Cost price suggested by default for margin calculation -MargeType1=Margin on Best vendor price -MargeType2=Margin on Weighted Average Price (WAP) -MargeType3=Margin on Cost Price -MarginTypeDesc=* Margin on best buying price = Selling price - Best vendor price defined on product card
    * Margin on Weighted Average Price (WAP) = Selling price - Product Weighted Average Price (WAP) or best vendor price if WAP not yet defined
    * Margin on Cost price = Selling price - Cost price defined on product card or WAP if cost price not defined, or best vendor price if WAP not yet defined -CostPrice=Cost price -UnitCharges=Unit charges -Charges=Charges -AgentContactType=Commercial agent contact type -AgentContactTypeDetails=Define what contact type (linked on invoices) will be used for margin report per contact/address. Note that reading statistics on a contact is not reliable since in most cases the contact may not be defined explicitely on the invoices. -rateMustBeNumeric=Rate must be a numeric value -markRateShouldBeLesserThan100=Mark rate should be lower than 100 -ShowMarginInfos=Show margin infos -CheckMargins=Margins detail -MarginPerSaleRepresentativeWarning=The report of margin per user use the link between third parties and sale representatives to calculate the margin of each sale representative. Because some thirdparties may not have any dedicated sale representative and some third parties may be linked to several, some amounts may not be included into this report (if there is no sale representative) and some may appear on different lines (for each sale representative). diff --git a/htdocs/langs/ar_IQ/members.lang b/htdocs/langs/ar_IQ/members.lang index d8b9c2f59f3..45f5a38babe 100644 --- a/htdocs/langs/ar_IQ/members.lang +++ b/htdocs/langs/ar_IQ/members.lang @@ -1,217 +1,25 @@ # Dolibarr language file - Source file is en_US - members -MembersArea=Members area -MemberCard=Member card -SubscriptionCard=Subscription card -Member=Member -Members=Members -ShowMember=Show member card -UserNotLinkedToMember=User not linked to a member -ThirdpartyNotLinkedToMember=Third party not linked to a member MembersTickets=Members Tickets -FundationMembers=Foundation members -ListOfValidatedPublicMembers=List of validated public members -ErrorThisMemberIsNotPublic=This member is not public -ErrorMemberIsAlreadyLinkedToThisThirdParty=Another member (name: %s, login: %s) is already linked to a third party %s. Remove this link first because a third party can't be linked to only a member (and vice versa). -ErrorUserPermissionAllowsToLinksToItselfOnly=For security reasons, you must be granted permissions to edit all users to be able to link a member to a user that is not yours. -SetLinkToUser=Link to a Dolibarr user -SetLinkToThirdParty=Link to a Dolibarr third party -MembersCards=Business cards for members -MembersList=List of members -MembersListToValid=List of draft members (to be validated) -MembersListValid=List of valid members -MembersListUpToDate=List of valid members with up-to-date subscription -MembersListNotUpToDate=List of valid members with out-of-date subscription -MembersListExcluded=List of excluded members -MembersListResiliated=List of terminated members -MembersListQualified=List of qualified members -MenuMembersToValidate=Draft members -MenuMembersValidated=Validated members -MenuMembersExcluded=Excluded members -MenuMembersResiliated=Terminated members MembersWithSubscriptionToReceive=Members with subscription to receive -MembersWithSubscriptionToReceiveShort=Subscription to receive DateSubscription=Subscription date DateEndSubscription=Subscription end date -EndSubscription=Subscription Ends SubscriptionId=Subscription id -WithoutSubscription=Without subscription -MemberId=Member id -NewMember=New member -MemberType=Member type -MemberTypeId=Member type id -MemberTypeLabel=Member type label -MembersTypes=Members types -MemberStatusDraft=Draft (needs to be validated) -MemberStatusDraftShort=Draft MemberStatusActive=Validated (waiting subscription) -MemberStatusActiveShort=Validated -MemberStatusActiveLate=Subscription expired -MemberStatusActiveLateShort=Expired -MemberStatusPaid=Subscription up to date -MemberStatusPaidShort=Up to date -MemberStatusExcluded=Excluded member -MemberStatusExcludedShort=Excluded -MemberStatusResiliated=Terminated member -MemberStatusResiliatedShort=Terminated -MembersStatusToValid=Draft members -MembersStatusExcluded=Excluded members -MembersStatusResiliated=Terminated members -MemberStatusNoSubscription=Validated (no subscription needed) -MemberStatusNoSubscriptionShort=Validated -SubscriptionNotNeeded=No subscription needed -NewCotisation=New contribution -PaymentSubscription=New contribution payment -SubscriptionEndDate=Subscription's end date -MembersTypeSetup=Members type setup -MemberTypeModified=Member type modified -DeleteAMemberType=Delete a member type -ConfirmDeleteMemberType=Are you sure you want to delete this member type? -MemberTypeDeleted=Member type deleted -MemberTypeCanNotBeDeleted=Member type can not be deleted NewSubscription=New subscription -NewSubscriptionDesc=This form allows you to record your subscription as a new member of the foundation. If you want to renew your subscription (if already a member), please contact foundation board instead by email %s. Subscription=Subscription Subscriptions=Subscriptions -SubscriptionLate=Late SubscriptionNotReceived=Subscription never received ListOfSubscriptions=List of subscriptions -SendCardByMail=Send card by email -AddMember=Create member -NoTypeDefinedGoToSetup=No member types defined. Go to menu "Members types" -NewMemberType=New member type -WelcomeEMail=Welcome email SubscriptionRequired=Subscription required -DeleteType=Delete -VoteAllowed=Vote allowed -Physical=Individual -Moral=Corporation -MorAndPhy=Corporation and Individual -Reenable=Re-Enable -ExcludeMember=Exclude a member -ConfirmExcludeMember=Are you sure you want to exclude this member ? -ResiliateMember=Terminate a member -ConfirmResiliateMember=Are you sure you want to terminate this member? -DeleteMember=Delete a member -ConfirmDeleteMember=Are you sure you want to delete this member (Deleting a member will delete all his subscriptions)? -DeleteSubscription=Delete a subscription -ConfirmDeleteSubscription=Are you sure you want to delete this subscription? -Filehtpasswd=htpasswd file -ValidateMember=Validate a member -ConfirmValidateMember=Are you sure you want to validate this member? -FollowingLinksArePublic=The following links are open pages not protected by any Dolibarr permission. They are not formatted pages, provided as example to show how to list members database. -PublicMemberList=Public member list -BlankSubscriptionForm=Public self-subscription form -BlankSubscriptionFormDesc=Dolibarr can provide you a public URL/website to allow external visitors to ask to subscribe to the foundation. If an online payment module is enabled, a payment form may also be automatically provided. -EnablePublicSubscriptionForm=Enable the public website with self-subscription form -ForceMemberType=Force the member type ExportDataset_member_1=Members and subscriptions -ImportDataset_member_1=Members -LastMembersModified=Latest %s modified members -LastSubscriptionsModified=Latest %s modified subscriptions -String=String -Text=Text -Int=Int -DateAndTime=Date and time -PublicMemberCard=Member public card -SubscriptionNotRecorded=Subscription not recorded AddSubscription=Create subscription ShowSubscription=Show subscription -# Label of email templates -SendingAnEMailToMember=Sending information email to member -SendingEmailOnAutoSubscription=Sending email on auto registration -SendingEmailOnMemberValidation=Sending email on new member validation -SendingEmailOnNewSubscription=Sending email on new subscription -SendingReminderForExpiredSubscription=Sending reminder for expired subscriptions -SendingEmailOnCancelation=Sending email on cancelation -SendingReminderActionComm=Sending reminder for agenda event -# Topic of email templates -YourMembershipRequestWasReceived=Your membership was received. -YourMembershipWasValidated=Your membership was validated -YourSubscriptionWasRecorded=Your new subscription was recorded -SubscriptionReminderEmail=Subscription reminder -YourMembershipWasCanceled=Your membership was canceled -CardContent=Content of your member card -# Text of email templates -ThisIsContentOfYourMembershipRequestWasReceived=We want to let you know that your membership request was received.

    -ThisIsContentOfYourMembershipWasValidated=We want to let you know that your membership was validated with the following information:

    -ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded.

    -ThisIsContentOfSubscriptionReminderEmail=We want to let you know that your subscription is about to expire or has already expired (__MEMBER_LAST_SUBSCRIPTION_DATE_END__). We hope you will renew it.

    -ThisIsContentOfYourCard=This is a summary of the information we have about you. Please contact us if anything is incorrect.

    -DescADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT=Subject of the notification email received in case of auto-inscription of a guest -DescADHERENT_AUTOREGISTER_NOTIF_MAIL=Content of the notification email received in case of auto-inscription of a guest -DescADHERENT_EMAIL_TEMPLATE_AUTOREGISTER=Email template to use to send email to a member on member autosubscription -DescADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION=Email template to use to send email to a member on member validation -DescADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION=Email template to use to send email to a member on new subscription recording -DescADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION=Email template to use to send email reminder when subscription is about to expire -DescADHERENT_EMAIL_TEMPLATE_CANCELATION=Email template to use to send email to a member on member cancelation -DescADHERENT_EMAIL_TEMPLATE_EXCLUSION=Email template to use to send email to a member on member exclusion -DescADHERENT_MAIL_FROM=Sender Email for automatic emails -DescADHERENT_ETIQUETTE_TYPE=Format of labels page -DescADHERENT_ETIQUETTE_TEXT=Text printed on member address sheets -DescADHERENT_CARD_TYPE=Format of cards page -DescADHERENT_CARD_HEADER_TEXT=Text printed on top of member cards -DescADHERENT_CARD_TEXT=Text printed on member cards (align on left) -DescADHERENT_CARD_TEXT_RIGHT=Text printed on member cards (align on right) -DescADHERENT_CARD_FOOTER_TEXT=Text printed on bottom of member cards -ShowTypeCard=Show type '%s' -HTPasswordExport=htpassword file generation NoThirdPartyAssociatedToMember=No third party associated to this member -MembersAndSubscriptions= Members and Subscriptions -MoreActions=Complementary action on recording +MembersAndSubscriptions=Members and Subscriptions MoreActionsOnSubscription=Complementary action, suggested by default when recording a subscription -MoreActionBankDirect=Create a direct entry on bank account -MoreActionBankViaInvoice=Create an invoice, and a payment on bank account -MoreActionInvoiceOnly=Create an invoice with no payment -LinkToGeneratedPages=Generate visit cards -LinkToGeneratedPagesDesc=This screen allows you to generate PDF files with business cards for all your members or a particular member. -DocForAllMembersCards=Generate business cards for all members -DocForOneMemberCards=Generate business cards for a particular member -DocForLabels=Generate address sheets SubscriptionPayment=Subscription payment -LastSubscriptionDate=Date of latest subscription payment -LastSubscriptionAmount=Amount of latest subscription -LastMemberType=Last Member type -MembersStatisticsByCountries=Members statistics by country -MembersStatisticsByState=Members statistics by state/province -MembersStatisticsByTown=Members statistics by town -MembersStatisticsByRegion=Members statistics by region -NbOfMembers=Total number of members -NbOfActiveMembers=Total number of current active members -NoValidatedMemberYet=No validated members found -MembersByCountryDesc=This screen shows you the statistics of members by countries. Graphs and charts depend on the availability of the Google online graph service as well as on the availability of a working internet connection. -MembersByStateDesc=This screen show you statistics of members by state/provinces/canton. -MembersByTownDesc=This screen show you statistics of members by town. -MembersByNature=This screen show you statistics of members by nature. -MembersByRegion=This screen show you statistics of members by region. -MembersStatisticsDesc=Choose statistics you want to read... -MenuMembersStats=Statistics -LastMemberDate=Latest membership date -LatestSubscriptionDate=Latest subscription date -MemberNature=Nature of the member -MembersNature=Nature of the members -Public=Information is public -NewMemberbyWeb=New member added. Awaiting approval -NewMemberForm=New member form -SubscriptionsStatistics=Subscriptions statistics NbOfSubscriptions=Number of subscriptions -AmountOfSubscriptions=Amount collected from subscriptions -TurnoverOrBudget=Turnover (for a company) or Budget (for a foundation) DefaultAmount=Default amount of subscription CanEditAmount=Visitor can choose/edit amount of its subscription -MEMBER_NEWFORM_PAYONLINE=Jump on integrated online payment page -ByProperties=By nature -MembersStatisticsByProperties=Members statistics by nature VATToUseForSubscriptions=VAT rate to use for subscriptions -NoVatOnSubscription=No VAT for subscriptions ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS=Product used for subscription line into invoice: %s -NameOrCompany=Name or company -SubscriptionRecorded=Subscription recorded -NoEmailSentToMember=No email sent to member -EmailSentToMember=Email sent to member at %s -SendReminderForExpiredSubscriptionTitle=Send reminder by email for expired subscription -SendReminderForExpiredSubscription=Send reminder by email to members when subscription is about to expire (parameter is number of days before end of subscription to send the remind. It can be a list of days separated by a semicolon, for example '10;5;0;-5') -MembershipPaid=Membership paid for current period (until %s) -YouMayFindYourInvoiceInThisEmail=You may find your invoice attached to this email -XMembersClosed=%s member(s) closed -XExternalUserCreated=%s external user(s) created -ForceMemberNature=Force member nature (Individual or Corporation) diff --git a/htdocs/langs/ar_IQ/modulebuilder.lang b/htdocs/langs/ar_IQ/modulebuilder.lang deleted file mode 100644 index 23a098be2e5..00000000000 --- a/htdocs/langs/ar_IQ/modulebuilder.lang +++ /dev/null @@ -1,146 +0,0 @@ -# Dolibarr language file - Source file is en_US - loan -ModuleBuilderDesc=This tool must be used only by experienced users or developers. It provides utilities to build or edit your own module. Documentation for alternative manual development is here. -EnterNameOfModuleDesc=Enter name of the module/application to create with no spaces. Use uppercase to separate words (For example: MyModule, EcommerceForShop, SyncWithMySystem...) -EnterNameOfObjectDesc=Enter name of the object to create with no spaces. Use uppercase to separate words (For example: MyObject, Student, Teacher...). The CRUD class file, but also API file, pages to list/add/edit/delete object and SQL files will be generated. -ModuleBuilderDesc2=Path where modules are generated/edited (first directory for external modules defined into %s): %s -ModuleBuilderDesc3=Generated/editable modules found: %s -ModuleBuilderDesc4=A module is detected as 'editable' when the file %s exists in root of module directory -NewModule=New module -NewObjectInModulebuilder=New object -ModuleKey=Module key -ObjectKey=Object key -ModuleInitialized=Module initialized -FilesForObjectInitialized=Files for new object '%s' initialized -FilesForObjectUpdated=Files for object '%s' updated (.sql files and .class.php file) -ModuleBuilderDescdescription=Enter here all general information that describe your module. -ModuleBuilderDescspecifications=You can enter here a detailed description of the specifications of your module that is not already structured into other tabs. So you have within easy reach all the rules to develop. Also this text content will be included into the generated documentation (see last tab). You can use Markdown format, but it is recommended to use Asciidoc format (comparison between .md and .asciidoc: http://asciidoctor.org/docs/user-manual/#compared-to-markdown). -ModuleBuilderDescobjects=Define here the objects you want to manage with your module. A CRUD DAO class, SQL files, page to list record of objects, to create/edit/view a record and an API will be generated. -ModuleBuilderDescmenus=This tab is dedicated to define menu entries provided by your module. -ModuleBuilderDescpermissions=This tab is dedicated to define the new permissions you want to provide with your module. -ModuleBuilderDesctriggers=This is the view of triggers provided by your module. To include code executed when a triggered business event is launched, just edit this file. -ModuleBuilderDeschooks=This tab is dedicated to hooks. -ModuleBuilderDescwidgets=This tab is dedicated to manage/build widgets. -ModuleBuilderDescbuildpackage=You can generate here a "ready to distribute" package file (a normalized .zip file) of your module and a "ready to distribute" documentation file. Just click on button to build the package or documentation file. -EnterNameOfModuleToDeleteDesc=You can delete your module. WARNING: All coding files of module (generated or created manually) AND structured data and documentation will be deleted! -EnterNameOfObjectToDeleteDesc=You can delete an object. WARNING: All coding files (generated or created manually) related to object will be deleted! -DangerZone=Danger zone -BuildPackage=Build package -BuildPackageDesc=You can generate a zip package of your application so your are ready to distribute it on any Dolibarr. You can also distribute it or sell it on marketplace like DoliStore.com. -BuildDocumentation=Build documentation -ModuleIsNotActive=This module is not activated yet. Go to %s to make it live or click here -ModuleIsLive=This module has been activated. Any change may break a current live feature. -DescriptionLong=Long description -EditorName=Name of editor -EditorUrl=URL of editor -DescriptorFile=Descriptor file of module -ClassFile=File for PHP DAO CRUD class -ApiClassFile=File for PHP API class -PageForList=PHP page for list of record -PageForCreateEditView=PHP page to create/edit/view a record -PageForAgendaTab=PHP page for event tab -PageForDocumentTab=PHP page for document tab -PageForNoteTab=PHP page for note tab -PageForContactTab=PHP page for contact tab -PathToModulePackage=Path to zip of module/application package -PathToModuleDocumentation=Path to file of module/application documentation (%s) -SpaceOrSpecialCharAreNotAllowed=Spaces or special characters are not allowed. -FileNotYetGenerated=File not yet generated -RegenerateClassAndSql=Force update of .class and .sql files -RegenerateMissingFiles=Generate missing files -SpecificationFile=File of documentation -LanguageFile=File for language -ObjectProperties=Object Properties -ConfirmDeleteProperty=Are you sure you want to delete the property %s? This will change code in PHP class but also remove column from table definition of object. -NotNull=Not NULL -NotNullDesc=1=Set database to NOT NULL. -1=Allow null values and force value to NULL if empty ('' or 0). -SearchAll=Used for 'search all' -DatabaseIndex=Database index -FileAlreadyExists=File %s already exists -TriggersFile=File for triggers code -HooksFile=File for hooks code -ArrayOfKeyValues=Array of key-val -ArrayOfKeyValuesDesc=Array of keys and values if field is a combo list with fixed values -WidgetFile=Widget file -CSSFile=CSS file -JSFile=Javascript file -ReadmeFile=Readme file -ChangeLog=ChangeLog file -TestClassFile=File for PHP Unit Test class -SqlFile=Sql file -PageForLib=File for the common PHP library -PageForObjLib=File for the PHP library dedicated to object -SqlFileExtraFields=Sql file for complementary attributes -SqlFileKey=Sql file for keys -SqlFileKeyExtraFields=Sql file for keys of complementary attributes -AnObjectAlreadyExistWithThisNameAndDiffCase=An object already exists with this name and a different case -UseAsciiDocFormat=You can use Markdown format, but it is recommended to use Asciidoc format (omparison between .md and .asciidoc: http://asciidoctor.org/docs/user-manual/#compared-to-markdown) -IsAMeasure=Is a measure -DirScanned=Directory scanned -NoTrigger=No trigger -NoWidget=No widget -GoToApiExplorer=API explorer -ListOfMenusEntries=List of menu entries -ListOfDictionariesEntries=List of dictionaries entries -ListOfPermissionsDefined=List of defined permissions -SeeExamples=See examples here -EnabledDesc=Condition to have this field active (Examples: 1 or $conf->global->MYMODULE_MYOPTION) -VisibleDesc=Is the field visible ? (Examples: 0=Never visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create), 5=Visible on list end view form only (not create, not update).

    Using a negative value means field is not shown by default on list but can be selected for viewing).

    It can be an expression, for example:
    preg_match('/public/', $_SERVER['PHP_SELF'])?0:1
    ($user->rights->holiday->define_holiday ? 1 : 0) -DisplayOnPdfDesc=Display this field on compatible PDF documents, you can manage position with "Position" field.
    Currently, known compatibles PDF models are : eratosthene (order), espadon (ship), sponge (invoices), cyan (propal/quotation), cornas (supplier order)

    For document :
    0 = not displayed
    1 = display
    2 = display only if not empty

    For document lines :
    0 = not displayed
    1 = displayed in a column
    3 = display in line description column after the description
    4 = display in description column after the description only if not empty -DisplayOnPdf=Display on PDF -IsAMeasureDesc=Can the value of field be cumulated to get a total into list? (Examples: 1 or 0) -SearchAllDesc=Is the field used to make a search from the quick search tool? (Examples: 1 or 0) -SpecDefDesc=Enter here all documentation you want to provide with your module that is not already defined by other tabs. You can use .md or better, the rich .asciidoc syntax. -LanguageDefDesc=Enter in this files, all the key and the translation for each language file. -MenusDefDesc=Define here the menus provided by your module -DictionariesDefDesc=Define here the dictionaries provided by your module -PermissionsDefDesc=Define here the new permissions provided by your module -MenusDefDescTooltip=The menus provided by your module/application are defined into the array $this->menus into the module descriptor file. You can edit manually this file or use the embedded editor.

    Note: Once defined (and module re-activated), menus are also visible into the menu editor available to administrator users on %s. -DictionariesDefDescTooltip=The dictionaries provided by your module/application are defined into the array $this->dictionaries into the module descriptor file. You can edit manually this file or use the embedded editor.

    Note: Once defined (and module re-activated), dictionaries are also visible into the setup area to administrator users on %s. -PermissionsDefDescTooltip=The permissions provided by your module/application are defined into the array $this->rights into the module descriptor file. You can edit manually this file or use the embedded editor.

    Note: Once defined (and module re-activated), permissions are visible into the default permissions setup %s. -HooksDefDesc=Define in the module_parts['hooks'] property, in the module descriptor, the context of hooks you want to manage (list of contexts can be found by a search on 'initHooks(' in core code).
    Edit the hook file to add code of your hooked functions (hookable functions can be found by a search on 'executeHooks' in core code). -TriggerDefDesc=Define in the trigger file the code you want to execute for each business event executed. -SeeIDsInUse=See IDs in use in your installation -SeeReservedIDsRangeHere=See range of reserved IDs -ToolkitForDevelopers=Toolkit for Dolibarr developers -TryToUseTheModuleBuilder=If you have knowledge of SQL and PHP, you may use the native module builder wizard.
    Enable the module %s and use the wizard by clicking the on the top right menu.
    Warning: This is an advanced developer feature, do not experiment on your production site! -SeeTopRightMenu=See on the top right menu -AddLanguageFile=Add language file -YouCanUseTranslationKey=You can use here a key that is the translation key found into language file (see tab "Languages") -DropTableIfEmpty=(Destroy table if empty) -TableDoesNotExists=The table %s does not exists -TableDropped=Table %s deleted -InitStructureFromExistingTable=Build the structure array string of an existing table -UseAboutPage=Disable the about page -UseDocFolder=Disable the documentation folder -UseSpecificReadme=Use a specific ReadMe -ContentOfREADMECustomized=Note: The content of the README.md file has been replaced with the specific value defined into setup of ModuleBuilder. -RealPathOfModule=Real path of module -ContentCantBeEmpty=Content of file can't be empty -WidgetDesc=You can generate and edit here the widgets that will be embedded with your module. -CSSDesc=You can generate and edit here a file with personalized CSS embedded with your module. -JSDesc=You can generate and edit here a file with personalized Javascript embedded with your module. -CLIDesc=You can generate here some command line scripts you want to provide with your module. -CLIFile=CLI File -NoCLIFile=No CLI files -UseSpecificEditorName = Use a specific editor name -UseSpecificEditorURL = Use a specific editor URL -UseSpecificFamily = Use a specific family -UseSpecificAuthor = Use a specific author -UseSpecificVersion = Use a specific initial version -IncludeRefGeneration=The reference of object must be generated automatically -IncludeRefGenerationHelp=Check this if you want to include code to manage the generation automatically of the reference -IncludeDocGeneration=I want to generate some documents from the object -IncludeDocGenerationHelp=If you check this, some code will be generated to add a "Generate document" box on the record. -ShowOnCombobox=Show value into combobox -KeyForTooltip=Key for tooltip -CSSClass=CSS for edit/create form -CSSViewClass=CSS for read form -CSSListClass=CSS for list -NotEditable=Not editable -ForeignKey=Foreign key -TypeOfFieldsHelp=Type of fields:
    varchar(99), double(24,8), real, text, html, datetime, timestamp, integer, integer:ClassName:relativepath/to/classfile.class.php[:1[:filter]] ('1' means we add a + button after the combo to create the record, 'filter' can be 'status=1 AND fk_user = __USER_ID AND entity IN (__SHARED_ENTITIES__)' for example) -AsciiToHtmlConverter=Ascii to HTML converter -AsciiToPdfConverter=Ascii to PDF converter -TableNotEmptyDropCanceled=Table not empty. Drop has been canceled. -ModuleBuilderNotAllowed=The module builder is available but not allowed to your user. -ImportExportProfiles=Import and export profiles diff --git a/htdocs/langs/ar_IQ/mrp.lang b/htdocs/langs/ar_IQ/mrp.lang deleted file mode 100644 index 5d226c0f77b..00000000000 --- a/htdocs/langs/ar_IQ/mrp.lang +++ /dev/null @@ -1,103 +0,0 @@ -Mrp=Manufacturing Orders -MOs=Manufacturing orders -ManufacturingOrder=Manufacturing Order -MRPDescription=Module to manage production and Manufacturing Orders (MO). -MRPArea=MRP Area -MrpSetupPage=Setup of module MRP -MenuBOM=Bills of material -LatestBOMModified=Latest %s Bills of materials modified -LatestMOModified=Latest %s Manufacturing Orders modified -Bom=Bills of Material -BillOfMaterials=Bill of Materials -BOMsSetup=Setup of module BOM -ListOfBOMs=List of bills of material - BOM -ListOfManufacturingOrders=List of Manufacturing Orders -NewBOM=New bill of materials -ProductBOMHelp=Product to create (or disassemble) with this BOM.
    Note: Products with the property 'Nature of product' = 'Raw material' are not visible into this list. -BOMsNumberingModules=BOM numbering templates -BOMsModelModule=BOM document templates -MOsNumberingModules=MO numbering templates -MOsModelModule=MO document templates -FreeLegalTextOnBOMs=Free text on document of BOM -WatermarkOnDraftBOMs=Watermark on draft BOM -FreeLegalTextOnMOs=Free text on document of MO -WatermarkOnDraftMOs=Watermark on draft MO -ConfirmCloneBillOfMaterials=Are you sure you want to clone the bill of materials %s ? -ConfirmCloneMo=Are you sure you want to clone the Manufacturing Order %s ? -ManufacturingEfficiency=Manufacturing efficiency -ConsumptionEfficiency=Consumption efficiency -ValueOfMeansLoss=Value of 0.95 means an average of 5%% of loss during the production -ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss of produced product -DeleteBillOfMaterials=Delete Bill Of Materials -DeleteMo=Delete Manufacturing Order -ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Materials? -ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? -MenuMRP=Manufacturing Orders -NewMO=New Manufacturing Order -QtyToProduce=Qty to produce -DateStartPlannedMo=Date start planned -DateEndPlannedMo=Date end planned -KeepEmptyForAsap=Empty means 'As Soon As Possible' -EstimatedDuration=Estimated duration -EstimatedDurationDesc=Estimated duration to manufacture (or disassemble) this product using this BOM -ConfirmValidateBom=Are you sure you want to validate the BOM with the reference %s (you will be able to use it to build new Manufacturing Orders) -ConfirmCloseBom=Are you sure you want to cancel this BOM (you won't be able to use it to build new Manufacturing Orders anymore) ? -ConfirmReopenBom=Are you sure you want to re-open this BOM (you will be able to use it to build new Manufacturing Orders) -StatusMOProduced=Produced -QtyFrozen=Frozen Qty -QuantityFrozen=Frozen Quantity -QuantityConsumedInvariable=When this flag is set, the quantity consumed is always the value defined and is not relative to the quantity produced. -DisableStockChange=Stock change disabled -DisableStockChangeHelp=When this flag is set, there is no stock change on this product, whatever is the quantity consumed -BomAndBomLines=Bills Of Material and lines -BOMLine=Line of BOM -WarehouseForProduction=Warehouse for production -CreateMO=Create MO -ToConsume=To consume -ToProduce=To produce -QtyAlreadyConsumed=Qty already consumed -QtyAlreadyProduced=Qty already produced -QtyRequiredIfNoLoss=Qty required if there is no loss (Manufacturing efficiency is 100%%) -ConsumeOrProduce=Consume or Produce -ConsumeAndProduceAll=Consume and Produce All -Manufactured=Manufactured -TheProductXIsAlreadyTheProductToProduce=The product to add is already the product to produce. -ForAQuantityOf=For a quantity to produce of %s -ForAQuantityToConsumeOf=For a quantity to disassemble of %s -ConfirmValidateMo=Are you sure you want to validate this Manufacturing Order? -ConfirmProductionDesc=By clicking on '%s', you will validate the consumption and/or production for the quantities set. This will also update the stock and record stock movements. -ProductionForRef=Production of %s -AutoCloseMO=Close automatically the Manufacturing Order if quantities to consume and to produce are reached -NoStockChangeOnServices=No stock change on services -ProductQtyToConsumeByMO=Product quantity still to consume by open MO -ProductQtyToProduceByMO=Product quantity still to produce by open MO -AddNewConsumeLines=Add new line to consume -ProductsToConsume=Products to consume -ProductsToProduce=Products to produce -UnitCost=Unit cost -TotalCost=Total cost -BOMTotalCost=The cost to produce this BOM based on cost of each quantity and product to consume (use Cost price if defined, else Average Weighted Price if defined, else the Best purchase price) -GoOnTabProductionToProduceFirst=You must first have started the production to close a Manufacturing Order (See tab '%s'). But you can Cancel it. -ErrorAVirtualProductCantBeUsedIntoABomOrMo=A kit can't be used into a BOM or a MO -Workstation=Workstation -Workstations=Workstations -WorkstationsDescription=Workstations management -WorkstationSetup = Workstations setup -WorkstationSetupPage = Workstations setup page -WorkstationList=Workstation list -WorkstationCreate=Add new workstation -ConfirmEnableWorkstation=Are you sure you want to enable workstation %s ? -EnableAWorkstation=Enable a workstation -ConfirmDisableWorkstation=Are you sure you want to disable workstation %s ? -DisableAWorkstation=Disable a workstation -DeleteWorkstation=Delete -NbOperatorsRequired=Number of operators required -THMOperatorEstimated=Estimated operator THM -THMMachineEstimated=Estimated machine THM -WorkstationType=Workstation type -Human=Human -Machine=Machine -HumanMachine=Human / Machine -WorkstationArea=Workstation area -Machines=Machines -THMEstimatedHelp=This rate makes it possible to define a forecast cost of the item diff --git a/htdocs/langs/ar_IQ/multicurrency.lang b/htdocs/langs/ar_IQ/multicurrency.lang deleted file mode 100644 index 26313c6bfb9..00000000000 --- a/htdocs/langs/ar_IQ/multicurrency.lang +++ /dev/null @@ -1,38 +0,0 @@ -# Dolibarr language file - Source file is en_US - multicurrency -MultiCurrency=Multi currency -ErrorAddRateFail=Error in added rate -ErrorAddCurrencyFail=Error in added currency -ErrorDeleteCurrencyFail=Error delete fail -multicurrency_syncronize_error=Synchronization error: %s -MULTICURRENCY_USE_RATE_ON_DOCUMENT_DATE=Use the date of the document to find the currency rate, instead of using the latest known rate -multicurrency_useOriginTx=When an object is created from another, keep the original rate from the source object (otherwise use the latest known rate) -CurrencyLayerAccount=CurrencyLayer API -CurrencyLayerAccount_help_to_synchronize=You must create an account on website %s to use this functionality.
    Get your API key.
    If you use a free account, you can't change the source currency (USD by default).
    If your main currency is not USD, the application will automatically recalculate it.

    You are limited to 1000 synchronizations per month. -multicurrency_appId=API key -multicurrency_appCurrencySource=Source currency -multicurrency_alternateCurrencySource=Alternate source currency -CurrenciesUsed=Currencies used -CurrenciesUsed_help_to_add=Add the different currencies and rates you need to use on your proposals, orders etc. -rate=rate -MulticurrencyReceived=Received, original currency -MulticurrencyRemainderToTake=Remaining amount, original currency -MulticurrencyPaymentAmount=Payment amount, original currency -AmountToOthercurrency=Amount To (in currency of receiving account) -CurrencyRateSyncSucceed=Currency rate synchronization done successfuly -MULTICURRENCY_USE_CURRENCY_ON_DOCUMENT=Use the currency of the document for online payments -TabTitleMulticurrencyRate=Rate list -ListCurrencyRate=List of exchange rates for the currency -CreateRate=Create a rate -FormCreateRate=Rate creation -FormUpdateRate=Rate modification -successRateCreate=Rate for currency %s has been added to the database -ConfirmDeleteLineRate=Are you sure you want to remove the %s rate for currency %s on %s date? -DeleteLineRate=Clear rate -successRateDelete=Rate deleted -errorRateDelete=Error when deleting the rate -successUpdateRate=Modification made -ErrorUpdateRate=Error when changing the rate -Codemulticurrency=currency code -UpdateRate=change the rate -CancelUpdate=cancel -NoEmptyRate=The rate field must not be empty diff --git a/htdocs/langs/ar_IQ/oauth.lang b/htdocs/langs/ar_IQ/oauth.lang deleted file mode 100644 index 075ff49a895..00000000000 --- a/htdocs/langs/ar_IQ/oauth.lang +++ /dev/null @@ -1,32 +0,0 @@ -# Dolibarr language file - Source file is en_US - oauth -ConfigOAuth=OAuth Configuration -OAuthServices=OAuth Services -ManualTokenGeneration=Manual token generation -TokenManager=Token Manager -IsTokenGenerated=Is token generated ? -NoAccessToken=No access token saved into local database -HasAccessToken=A token was generated and saved into local database -NewTokenStored=Token received and saved -ToCheckDeleteTokenOnProvider=Click here to check/delete authorization saved by %s OAuth provider -TokenDeleted=Token deleted -RequestAccess=Click here to request/renew access and receive a new token to save -DeleteAccess=Click here to delete token -UseTheFollowingUrlAsRedirectURI=Use the following URL as the Redirect URI when creating your credentials with your OAuth provider: -ListOfSupportedOauthProviders=Enter the credentials provided by your OAuth2 provider. Only supported OAuth2 providers are listedd here. These services may be used by other modules that need OAuth2 authentication. -OAuthSetupForLogin=Page to generate an OAuth token -SeePreviousTab=See previous tab -OAuthIDSecret=OAuth ID and Secret -TOKEN_REFRESH=Token Refresh Present -TOKEN_EXPIRED=Token expired -TOKEN_EXPIRE_AT=Token expire at -TOKEN_DELETE=Delete saved token -OAUTH_GOOGLE_NAME=OAuth Google service -OAUTH_GOOGLE_ID=OAuth Google Id -OAUTH_GOOGLE_SECRET=OAuth Google Secret -OAUTH_GOOGLE_DESC=Go to this page then "Credentials" to create OAuth credentials -OAUTH_GITHUB_NAME=OAuth GitHub service -OAUTH_GITHUB_ID=OAuth GitHub Id -OAUTH_GITHUB_SECRET=OAuth GitHub Secret -OAUTH_GITHUB_DESC=Go to this page then "Register a new application" to create OAuth credentials -OAUTH_STRIPE_TEST_NAME=OAuth Stripe Test -OAUTH_STRIPE_LIVE_NAME=OAuth Stripe Live diff --git a/htdocs/langs/ar_IQ/opensurvey.lang b/htdocs/langs/ar_IQ/opensurvey.lang deleted file mode 100644 index 7d26151fa16..00000000000 --- a/htdocs/langs/ar_IQ/opensurvey.lang +++ /dev/null @@ -1,61 +0,0 @@ -# Dolibarr language file - Source file is en_US - opensurvey -Survey=Poll -Surveys=Polls -OrganizeYourMeetingEasily=Organize your meetings and polls easily. First select the type of poll... -NewSurvey=New poll -OpenSurveyArea=Polls area -AddACommentForPoll=You can add a comment into poll... -AddComment=Add comment -CreatePoll=Create poll -PollTitle=Poll title -ToReceiveEMailForEachVote=Receive an email for each vote -TypeDate=Type date -TypeClassic=Type standard -OpenSurveyStep2=Select your dates among the free days (grey). The selected days are green. You can unselect a day previously selected by clicking again on it -RemoveAllDays=Remove all days -CopyHoursOfFirstDay=Copy hours of first day -RemoveAllHours=Remove all hours -SelectedDays=Selected days -TheBestChoice=The best choice currently is -TheBestChoices=The best choices currently are -with=with -OpenSurveyHowTo=If you agree to vote in this poll, you have to give your name, choose the values that fit best for you and validate with the plus button at the end of the line. -CommentsOfVoters=Comments of voters -ConfirmRemovalOfPoll=Are you sure you want to remove this poll (and all votes) -RemovePoll=Remove poll -UrlForSurvey=URL to communicate to get a direct access to poll -PollOnChoice=You are creating a poll to make a multi-choice for a poll. First enter all possible choices for your poll: -CreateSurveyDate=Create a date poll -CreateSurveyStandard=Create a standard poll -CheckBox=Simple checkbox -YesNoList=List (empty/yes/no) -PourContreList=List (empty/for/against) -AddNewColumn=Add new column -TitleChoice=Choice label -ExportSpreadsheet=Export result spreadsheet -ExpireDate=Limit date -NbOfSurveys=Number of polls -NbOfVoters=No. of voters -SurveyResults=Results -PollAdminDesc=You are allowed to change all vote lines of this poll with button "Edit". You can, as well, remove a column or a line with %s. You can also add a new column with %s. -5MoreChoices=5 more choices -Against=Against -YouAreInivitedToVote=You are invited to vote for this poll -VoteNameAlreadyExists=This name was already used for this poll -AddADate=Add a date -AddStartHour=Add start hour -AddEndHour=Add end hour -votes=vote(s) -NoCommentYet=No comments have been posted for this poll yet -CanComment=Voters can comment in the poll -CanSeeOthersVote=Voters can see other people's vote -SelectDayDesc=For each selected day, you can choose, or not, meeting hours in the following format:
    - empty,
    - "8h", "8H" or "8:00" to give a meeting's start hour,
    - "8-11", "8h-11h", "8H-11H" or "8:00-11:00" to give a meeting's start and end hour,
    - "8h15-11h15", "8H15-11H15" or "8:15-11:15" for the same thing but with minutes. -BackToCurrentMonth=Back to current month -ErrorOpenSurveyFillFirstSection=You haven't filled the first section of the poll creation -ErrorOpenSurveyOneChoice=Enter at least one choice -ErrorInsertingComment=There was an error while inserting your comment -MoreChoices=Enter more choices for the voters -SurveyExpiredInfo=The poll has been closed or voting delay has expired. -EmailSomeoneVoted=%s has filled a line.\nYou can find your poll at the link: \n%s -ShowSurvey=Show survey -UserMustBeSameThanUserUsedToVote=You must have voted and use the same user name that the one used to vote, to post a comment diff --git a/htdocs/langs/ar_IQ/orders.lang b/htdocs/langs/ar_IQ/orders.lang index 5dab5b99bf1..90fedaf49f7 100644 --- a/htdocs/langs/ar_IQ/orders.lang +++ b/htdocs/langs/ar_IQ/orders.lang @@ -1,193 +1,2 @@ # Dolibarr language file - Source file is en_US - orders -OrdersArea=Customers orders area -SuppliersOrdersArea=Purchase orders area -OrderCard=Order card -OrderId=Order Id -Order=Order -PdfOrderTitle=Order -Orders=Orders -OrderLine=Order line -OrderDate=Order date -OrderDateShort=Order date -OrderToProcess=Order to process -NewOrder=New order -NewSupplierOrderShort=New order -NewOrderSupplier=New Purchase Order -ToOrder=Make order -MakeOrder=Make order -SupplierOrder=Purchase order -SuppliersOrders=Purchase orders SaleOrderLines=Sale order lines -PurchaseOrderLines=Puchase order lines -SuppliersOrdersRunning=Current purchase orders -CustomerOrder=Sales Order -CustomersOrders=Sales Orders -CustomersOrdersRunning=Current sales orders -CustomersOrdersAndOrdersLines=Sales orders and order details -OrdersDeliveredToBill=Sales orders delivered to bill -OrdersToBill=Sales orders delivered -OrdersInProcess=Sales orders in process -OrdersToProcess=Sales orders to process -SuppliersOrdersToProcess=Purchase orders to process -SuppliersOrdersAwaitingReception=Purchase orders awaiting reception -AwaitingReception=Awaiting reception -StatusOrderCanceledShort=Canceled -StatusOrderDraftShort=Draft -StatusOrderValidatedShort=Validated -StatusOrderSentShort=In process -StatusOrderSent=Shipment in process -StatusOrderOnProcessShort=Ordered -StatusOrderProcessedShort=Processed -StatusOrderDelivered=Delivered -StatusOrderDeliveredShort=Delivered -StatusOrderToBillShort=Delivered -StatusOrderApprovedShort=Approved -StatusOrderRefusedShort=Refused -StatusOrderToProcessShort=To process -StatusOrderReceivedPartiallyShort=Partially received -StatusOrderReceivedAllShort=Products received -StatusOrderCanceled=Canceled -StatusOrderDraft=Draft (needs to be validated) -StatusOrderValidated=Validated -StatusOrderOnProcess=Ordered - Standby reception -StatusOrderOnProcessWithValidation=Ordered - Standby reception or validation -StatusOrderProcessed=Processed -StatusOrderToBill=Delivered -StatusOrderApproved=Approved -StatusOrderRefused=Refused -StatusOrderReceivedPartially=Partially received -StatusOrderReceivedAll=All products received -ShippingExist=A shipment exists -QtyOrdered=Qty ordered -ProductQtyInDraft=Product quantity into draft orders -ProductQtyInDraftOrWaitingApproved=Product quantity into draft or approved orders, not yet ordered -MenuOrdersToBill=Orders delivered -MenuOrdersToBill2=Billable orders -ShipProduct=Ship product -CreateOrder=Create Order -RefuseOrder=Refuse order -ApproveOrder=Approve order -Approve2Order=Approve order (second level) -ValidateOrder=Validate order -UnvalidateOrder=Unvalidate order -DeleteOrder=Delete order -CancelOrder=Cancel order -OrderReopened= Order %s re-open -AddOrder=Create order -AddSupplierOrderShort=Create order -AddPurchaseOrder=Create purchase order -AddToDraftOrders=Add to draft order -ShowOrder=Show order -OrdersOpened=Orders to process -NoDraftOrders=No draft orders -NoOrder=No order -NoSupplierOrder=No purchase order -LastOrders=Latest %s sales orders -LastCustomerOrders=Latest %s sales orders -LastSupplierOrders=Latest %s purchase orders -LastModifiedOrders=Latest %s modified orders -AllOrders=All orders -NbOfOrders=Number of orders -OrdersStatistics=Order's statistics -OrdersStatisticsSuppliers=Purchase order statistics -NumberOfOrdersByMonth=Number of orders by month -AmountOfOrdersByMonthHT=Amount of orders by month (excl. tax) -ListOfOrders=List of orders -CloseOrder=Close order -ConfirmCloseOrder=Are you sure you want to set this order to delivered? Once an order is delivered, it can be set to billed. -ConfirmDeleteOrder=Are you sure you want to delete this order? -ConfirmValidateOrder=Are you sure you want to validate this order under name %s? -ConfirmUnvalidateOrder=Are you sure you want to restore order %s to draft status? -ConfirmCancelOrder=Are you sure you want to cancel this order? -ConfirmMakeOrder=Are you sure you want to confirm you made this order on %s? -GenerateBill=Generate invoice -ClassifyShipped=Classify delivered -DraftOrders=Draft orders -DraftSuppliersOrders=Draft purchase orders -OnProcessOrders=In process orders -RefOrder=Ref. order -RefCustomerOrder=Ref. order for customer -RefOrderSupplier=Ref. order for vendor -RefOrderSupplierShort=Ref. order vendor -SendOrderByMail=Send order by mail -ActionsOnOrder=Events on order -NoArticleOfTypeProduct=No article of type 'product' so no shippable article for this order -OrderMode=Order method -AuthorRequest=Request author -UserWithApproveOrderGrant=Users granted with "approve orders" permission. -PaymentOrderRef=Payment of order %s -ConfirmCloneOrder=Are you sure you want to clone this order %s? -DispatchSupplierOrder=Receiving purchase order %s -FirstApprovalAlreadyDone=First approval already done -SecondApprovalAlreadyDone=Second approval already done -SupplierOrderReceivedInDolibarr=Purchase Order %s received %s -SupplierOrderSubmitedInDolibarr=Purchase Order %s submitted -SupplierOrderClassifiedBilled=Purchase Order %s set billed -OtherOrders=Other orders -##### Types de contacts ##### -TypeContact_commande_internal_SALESREPFOLL=Representative following-up sales order -TypeContact_commande_internal_SHIPPING=Representative following-up shipping -TypeContact_commande_external_BILLING=Customer invoice contact -TypeContact_commande_external_SHIPPING=Customer shipping contact -TypeContact_commande_external_CUSTOMER=Customer contact following-up order -TypeContact_order_supplier_internal_SALESREPFOLL=Representative following-up purchase order -TypeContact_order_supplier_internal_SHIPPING=Representative following-up shipping -TypeContact_order_supplier_external_BILLING=Vendor invoice contact -TypeContact_order_supplier_external_SHIPPING=Vendor shipping contact -TypeContact_order_supplier_external_CUSTOMER=Vendor contact following-up order -Error_COMMANDE_SUPPLIER_ADDON_NotDefined=Constant COMMANDE_SUPPLIER_ADDON not defined -Error_COMMANDE_ADDON_NotDefined=Constant COMMANDE_ADDON not defined -Error_OrderNotChecked=No orders to invoice selected -# Order modes (how we receive order). Not the "why" are keys stored into dict.lang -OrderByMail=Mail -OrderByFax=Fax -OrderByEMail=Email -OrderByWWW=Online -OrderByPhone=Phone -# Documents models -PDFEinsteinDescription=A complete order model (old implementation of Eratosthene template) -PDFEratostheneDescription=A complete order model -PDFEdisonDescription=A simple order model -PDFProformaDescription=A complete Proforma invoice template -CreateInvoiceForThisCustomer=Bill orders -CreateInvoiceForThisSupplier=Bill orders -NoOrdersToInvoice=No orders billable -CloseProcessedOrdersAutomatically=Classify "Processed" all selected orders. -OrderCreation=Order creation -Ordered=Ordered -OrderCreated=Your orders have been created -OrderFail=An error happened during your orders creation -CreateOrders=Create orders -ToBillSeveralOrderSelectCustomer=To create an invoice for several orders, click first onto customer, then choose "%s". -OptionToSetOrderBilledNotEnabled=Option from module Workflow, to set order to 'Billed' automatically when invoice is validated, is not enabled, so you will have to set the status of orders to 'Billed' manually after the invoice has been generated. -IfValidateInvoiceIsNoOrderStayUnbilled=If invoice validation is 'No', the order will remain to status 'Unbilled' until the invoice is validated. -CloseReceivedSupplierOrdersAutomatically=Close order to status "%s" automatically if all products are received. -SetShippingMode=Set shipping mode -WithReceptionFinished=With reception finished -#### supplier orders status -StatusSupplierOrderCanceledShort=Canceled -StatusSupplierOrderDraftShort=Draft -StatusSupplierOrderValidatedShort=Validated -StatusSupplierOrderSentShort=In process -StatusSupplierOrderSent=Shipment in process -StatusSupplierOrderOnProcessShort=Ordered -StatusSupplierOrderProcessedShort=Processed -StatusSupplierOrderDelivered=Delivered -StatusSupplierOrderDeliveredShort=Delivered -StatusSupplierOrderToBillShort=Delivered -StatusSupplierOrderApprovedShort=Approved -StatusSupplierOrderRefusedShort=Refused -StatusSupplierOrderToProcessShort=To process -StatusSupplierOrderReceivedPartiallyShort=Partially received -StatusSupplierOrderReceivedAllShort=Products received -StatusSupplierOrderCanceled=Canceled -StatusSupplierOrderDraft=Draft (needs to be validated) -StatusSupplierOrderValidated=Validated -StatusSupplierOrderOnProcess=Ordered - Standby reception -StatusSupplierOrderOnProcessWithValidation=Ordered - Standby reception or validation -StatusSupplierOrderProcessed=Processed -StatusSupplierOrderToBill=Delivered -StatusSupplierOrderApproved=Approved -StatusSupplierOrderRefused=Refused -StatusSupplierOrderReceivedPartially=Partially received -StatusSupplierOrderReceivedAll=All products received diff --git a/htdocs/langs/ar_IQ/other.lang b/htdocs/langs/ar_IQ/other.lang deleted file mode 100644 index ea280968ef4..00000000000 --- a/htdocs/langs/ar_IQ/other.lang +++ /dev/null @@ -1,297 +0,0 @@ -# Dolibarr language file - Source file is en_US - other -SecurityCode=Security code -NumberingShort=N° -Tools=Tools -TMenuTools=Tools -ToolsDesc=All tools not included in other menu entries are grouped here.
    All the tools can be accessed via the left menu. -Birthday=Birthday -BirthdayAlertOn=birthday alert active -BirthdayAlertOff=birthday alert inactive -TransKey=Translation of the key TransKey -MonthOfInvoice=Month (number 1-12) of invoice date -TextMonthOfInvoice=Month (text) of invoice date -PreviousMonthOfInvoice=Previous month (number 1-12) of invoice date -TextPreviousMonthOfInvoice=Previous month (text) of invoice date -NextMonthOfInvoice=Following month (number 1-12) of invoice date -TextNextMonthOfInvoice=Following month (text) of invoice date -PreviousMonth=Previous month -CurrentMonth=Current month -ZipFileGeneratedInto=Zip file generated into %s. -DocFileGeneratedInto=Doc file generated into %s. -JumpToLogin=Disconnected. Go to login page... -MessageForm=Message on online payment form -MessageOK=Message on the return page for a validated payment -MessageKO=Message on the return page for a canceled payment -ContentOfDirectoryIsNotEmpty=Content of this directory is not empty. -DeleteAlsoContentRecursively=Check to delete all content recursively -PoweredBy=Powered by -YearOfInvoice=Year of invoice date -PreviousYearOfInvoice=Previous year of invoice date -NextYearOfInvoice=Following year of invoice date -DateNextInvoiceBeforeGen=Date of next invoice (before generation) -DateNextInvoiceAfterGen=Date of next invoice (after generation) -GraphInBarsAreLimitedToNMeasures=Grapics are limited to %s measures in 'Bars' mode. The mode 'Lines' was automatically selected instead. -OnlyOneFieldForXAxisIsPossible=Only 1 field is currently possible as X-Axis. Only the first selected field has been selected. -AtLeastOneMeasureIsRequired=At least 1 field for measure is required -AtLeastOneXAxisIsRequired=At least 1 field for X-Axis is required -LatestBlogPosts=Latest Blog Posts -Notify_ORDER_VALIDATE=Sales order validated -Notify_ORDER_SENTBYMAIL=Sales order sent by mail -Notify_ORDER_SUPPLIER_SENTBYMAIL=Purchase order sent by email -Notify_ORDER_SUPPLIER_VALIDATE=Purchase order recorded -Notify_ORDER_SUPPLIER_APPROVE=Purchase order approved -Notify_ORDER_SUPPLIER_REFUSE=Purchase order refused -Notify_PROPAL_VALIDATE=Customer proposal validated -Notify_PROPAL_CLOSE_SIGNED=Customer proposal closed signed -Notify_PROPAL_CLOSE_REFUSED=Customer proposal closed refused -Notify_PROPAL_SENTBYMAIL=Commercial proposal sent by mail -Notify_WITHDRAW_TRANSMIT=Transmission withdrawal -Notify_WITHDRAW_CREDIT=Credit withdrawal -Notify_WITHDRAW_EMIT=Perform withdrawal -Notify_COMPANY_CREATE=Third party created -Notify_COMPANY_SENTBYMAIL=Mails sent from third party card -Notify_BILL_VALIDATE=Customer invoice validated -Notify_BILL_UNVALIDATE=Customer invoice unvalidated -Notify_BILL_PAYED=Customer invoice paid -Notify_BILL_CANCEL=Customer invoice canceled -Notify_BILL_SENTBYMAIL=Customer invoice sent by mail -Notify_BILL_SUPPLIER_VALIDATE=Vendor invoice validated -Notify_BILL_SUPPLIER_PAYED=Vendor invoice paid -Notify_BILL_SUPPLIER_SENTBYMAIL=Vendor invoice sent by mail -Notify_BILL_SUPPLIER_CANCELED=Vendor invoice cancelled -Notify_CONTRACT_VALIDATE=Contract validated -Notify_FICHINTER_VALIDATE=Intervention validated -Notify_FICHINTER_ADD_CONTACT=Added contact to Intervention -Notify_FICHINTER_SENTBYMAIL=Intervention sent by mail -Notify_SHIPPING_VALIDATE=Shipping validated -Notify_SHIPPING_SENTBYMAIL=Shipping sent by mail -Notify_MEMBER_VALIDATE=Member validated -Notify_MEMBER_MODIFY=Member modified -Notify_MEMBER_SUBSCRIPTION=Member subscribed -Notify_MEMBER_RESILIATE=Member terminated -Notify_MEMBER_DELETE=Member deleted -Notify_PROJECT_CREATE=Project creation -Notify_TASK_CREATE=Task created -Notify_TASK_MODIFY=Task modified -Notify_TASK_DELETE=Task deleted -Notify_EXPENSE_REPORT_VALIDATE=Expense report validated (approval required) -Notify_EXPENSE_REPORT_APPROVE=Expense report approved -Notify_HOLIDAY_VALIDATE=Leave request validated (approval required) -Notify_HOLIDAY_APPROVE=Leave request approved -Notify_ACTION_CREATE=Added action to Agenda -SeeModuleSetup=See setup of module %s -NbOfAttachedFiles=Number of attached files/documents -TotalSizeOfAttachedFiles=Total size of attached files/documents -MaxSize=Maximum size -AttachANewFile=Attach a new file/document -LinkedObject=Linked object -NbOfActiveNotifications=Number of notifications (no. of recipient emails) -PredefinedMailTest=__(Hello)__\nThis is a test mail sent to __EMAIL__.\nThe lines are separated by a carriage return.\n\n__USER_SIGNATURE__ -PredefinedMailTestHtml=__(Hello)__
    This is a test mail sent to __EMAIL__ (the word test must be in bold).
    The lines are separated by a carriage return.

    __USER_SIGNATURE__ -PredefinedMailContentContract=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ -PredefinedMailContentSendInvoice=__(Hello)__\n\nPlease find invoice __REF__ attached \n\n__ONLINE_PAYMENT_TEXT_AND_URL__\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ -PredefinedMailContentSendInvoiceReminder=__(Hello)__\n\nWe would like to remind you that the invoice __REF__ seems to have not been paid. A copy of the invoice is attached as a reminder.\n\n__ONLINE_PAYMENT_TEXT_AND_URL__\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ -PredefinedMailContentSendProposal=__(Hello)__\n\nPlease find commercial proposal __REF__ attached \n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ -PredefinedMailContentSendSupplierProposal=__(Hello)__\n\nPlease find price request __REF__ attached\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ -PredefinedMailContentSendOrder=__(Hello)__\n\nPlease find order __REF__ attached\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ -PredefinedMailContentSendSupplierOrder=__(Hello)__\n\nPlease find our order __REF__ attached\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ -PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nPlease find invoice __REF__ attached\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ -PredefinedMailContentSendShipping=__(Hello)__\n\nPlease find shipping __REF__ attached\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ -PredefinedMailContentSendFichInter=__(Hello)__\n\nPlease find intervention __REF__ attached\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ -PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.\n\n%s\n\n -PredefinedMailContentGeneric=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ -PredefinedMailContentSendActionComm=Event reminder "__EVENT_LABEL__" on __EVENT_DATE__ at __EVENT_TIME__

    This is an automatic message, please do not reply. -DemoDesc=Dolibarr is a compact ERP/CRM supporting several business modules. A demo showcasing all modules makes no sense as this scenario never occurs (several hundred available). So, several demo profiles are available. -ChooseYourDemoProfil=Choose the demo profile that best suits your needs... -ChooseYourDemoProfilMore=...or build your own profile
    (manual module selection) -DemoFundation=Manage members of a foundation -DemoFundation2=Manage members and bank account of a foundation -DemoCompanyServiceOnly=Company or freelance selling service only -DemoCompanyShopWithCashDesk=Manage a shop with a cash desk -DemoCompanyProductAndStocks=Shop selling products with Point Of Sales -DemoCompanyManufacturing=Company manufacturing products -DemoCompanyAll=Company with multiple activities (all main modules) -CreatedBy=Created by %s -ModifiedBy=Modified by %s -ValidatedBy=Validated by %s -SignedBy=Signed by %s -ClosedBy=Closed by %s -CreatedById=User id who created -ModifiedById=User id who made latest change -ValidatedById=User id who validated -CanceledById=User id who canceled -ClosedById=User id who closed -CreatedByLogin=User login who created -ModifiedByLogin=User login who made latest change -ValidatedByLogin=User login who validated -CanceledByLogin=User login who canceled -ClosedByLogin=User login who closed -FileWasRemoved=File %s was removed -DirWasRemoved=Directory %s was removed -FeatureNotYetAvailable=Feature not yet available in the current version -FeatureNotAvailableOnDevicesWithoutMouse=Feature not available on devices without mouse -FeaturesSupported=Supported features -Width=Width -Height=Height -Depth=Depth -Top=Top -Bottom=Bottom -Left=Left -Right=Right -CalculatedWeight=Calculated weight -CalculatedVolume=Calculated volume -Weight=Weight -WeightUnitton=ton -WeightUnitkg=kg -WeightUnitg=g -WeightUnitmg=mg -WeightUnitpound=pound -WeightUnitounce=ounce -Length=Length -LengthUnitm=m -LengthUnitdm=dm -LengthUnitcm=cm -LengthUnitmm=mm -Surface=Area -SurfaceUnitm2=m² -SurfaceUnitdm2=dm² -SurfaceUnitcm2=cm² -SurfaceUnitmm2=mm² -SurfaceUnitfoot2=ft² -SurfaceUnitinch2=in² -Volume=Volume -VolumeUnitm3=m³ -VolumeUnitdm3=dm³ (L) -VolumeUnitcm3=cm³ (ml) -VolumeUnitmm3=mm³ (µl) -VolumeUnitfoot3=ft³ -VolumeUnitinch3=in³ -VolumeUnitounce=ounce -VolumeUnitlitre=litre -VolumeUnitgallon=gallon -SizeUnitm=m -SizeUnitdm=dm -SizeUnitcm=cm -SizeUnitmm=mm -SizeUnitinch=inch -SizeUnitfoot=foot -SizeUnitpoint=point -BugTracker=Bug tracker -SendNewPasswordDesc=This form allows you to request a new password. It will be sent to your email address.
    Change will become effective once you click on the confirmation link in the email.
    Check your inbox. -BackToLoginPage=Back to login page -AuthenticationDoesNotAllowSendNewPassword=Authentication mode is %s.
    In this mode, Dolibarr can't know nor change your password.
    Contact your system administrator if you want to change your password. -EnableGDLibraryDesc=Install or enable GD library on your PHP installation to use this option. -ProfIdShortDesc=Prof Id %s is an information depending on third party country.
    For example, for country %s, it's code %s. -DolibarrDemo=Dolibarr ERP/CRM demo -StatsByNumberOfUnits=Statistics for sum of qty of products/services -StatsByNumberOfEntities=Statistics for number of referring entities (no. of invoices, or orders...) -NumberOfProposals=Number of proposals -NumberOfCustomerOrders=Number of sales orders -NumberOfCustomerInvoices=Number of customer invoices -NumberOfSupplierProposals=Number of vendor proposals -NumberOfSupplierOrders=Number of purchase orders -NumberOfSupplierInvoices=Number of vendor invoices -NumberOfContracts=Number of contracts -NumberOfMos=Number of manufacturing orders -NumberOfUnitsProposals=Number of units on proposals -NumberOfUnitsCustomerOrders=Number of units on sales orders -NumberOfUnitsCustomerInvoices=Number of units on customer invoices -NumberOfUnitsSupplierProposals=Number of units on vendor proposals -NumberOfUnitsSupplierOrders=Number of units on purchase orders -NumberOfUnitsSupplierInvoices=Number of units on vendor invoices -NumberOfUnitsContracts=Number of units on contracts -NumberOfUnitsMos=Number of units to produce in manufacturing orders -EMailTextInterventionAddedContact=A new intervention %s has been assigned to you. -EMailTextInterventionValidated=The intervention %s has been validated. -EMailTextInvoiceValidated=Invoice %s has been validated. -EMailTextInvoicePayed=Invoice %s has been paid. -EMailTextProposalValidated=Proposal %s has been validated. -EMailTextProposalClosedSigned=Proposal %s has been closed signed. -EMailTextOrderValidated=Order %s has been validated. -EMailTextOrderApproved=Order %s has been approved. -EMailTextOrderValidatedBy=Order %s has been recorded by %s. -EMailTextOrderApprovedBy=Order %s has been approved by %s. -EMailTextOrderRefused=Order %s has been refused. -EMailTextOrderRefusedBy=Order %s has been refused by %s. -EMailTextExpeditionValidated=Shipping %s has been validated. -EMailTextExpenseReportValidated=Expense report %s has been validated. -EMailTextExpenseReportApproved=Expense report %s has been approved. -EMailTextHolidayValidated=Leave request %s has been validated. -EMailTextHolidayApproved=Leave request %s has been approved. -EMailTextActionAdded=The action %s has been added to the Agenda. -ImportedWithSet=Importation data set -DolibarrNotification=Automatic notification -ResizeDesc=Enter new width OR new height. Ratio will be kept during resizing... -NewLength=New width -NewHeight=New height -NewSizeAfterCropping=New size after cropping -DefineNewAreaToPick=Define new area on image to pick (left click on image then drag until you reach the opposite corner) -CurrentInformationOnImage=This tool was designed to help you to resize or crop an image. This is the information on the current edited image -ImageEditor=Image editor -YouReceiveMailBecauseOfNotification=You receive this message because your email has been added to list of targets to be informed of particular events into %s software of %s. -YouReceiveMailBecauseOfNotification2=This event is the following: -ThisIsListOfModules=This is a list of modules preselected by this demo profile (only most common modules are visible in this demo). Edit this to have a more personalized demo and click on "Start". -UseAdvancedPerms=Use the advanced permissions of some modules -FileFormat=File format -SelectAColor=Choose a color -AddFiles=Add Files -StartUpload=Start upload -CancelUpload=Cancel upload -FileIsTooBig=Files is too big -PleaseBePatient=Please be patient... -NewPassword=New password -ResetPassword=Reset password -RequestToResetPasswordReceived=A request to change your password has been received. -NewKeyIs=This is your new keys to login -NewKeyWillBe=Your new key to login to software will be -ClickHereToGoTo=Click here to go to %s -YouMustClickToChange=You must however first click on the following link to validate this password change -ConfirmPasswordChange=Confirm password change -ForgetIfNothing=If you didn't request this change, just forget this email. Your credentials are kept safe. -IfAmountHigherThan=If amount higher than %s -SourcesRepository=Repository for sources -Chart=Chart -PassEncoding=Password encoding -PermissionsAdd=Permissions added -PermissionsDelete=Permissions removed -YourPasswordMustHaveAtLeastXChars=Your password must have at least %s chars -YourPasswordHasBeenReset=Your password has been reset successfully -ApplicantIpAddress=IP address of applicant -SMSSentTo=SMS sent to %s -MissingIds=Missing ids -ThirdPartyCreatedByEmailCollector=Third party created by email collector from email MSGID %s -ContactCreatedByEmailCollector=Contact/address created by email collector from email MSGID %s -ProjectCreatedByEmailCollector=Project created by email collector from email MSGID %s -TicketCreatedByEmailCollector=Ticket created by email collector from email MSGID %s -OpeningHoursFormatDesc=Use a - to separate opening and closing hours.
    Use a space to enter different ranges.
    Example: 8-12 14-18 -SuffixSessionName=Suffix for session name - -##### Export ##### -ExportsArea=Exports area -AvailableFormats=Available formats -LibraryUsed=Library used -LibraryVersion=Library version -ExportableDatas=Exportable data -NoExportableData=No exportable data (no modules with exportable data loaded, or missing permissions) -##### External sites ##### -WebsiteSetup=Setup of module website -WEBSITE_PAGEURL=URL of page -WEBSITE_TITLE=Title -WEBSITE_DESCRIPTION=Description -WEBSITE_IMAGE=Image -WEBSITE_IMAGEDesc=Relative path of the image media. You can keep this empty as this is rarely used (it can be used by dynamic content to show a thumbnail in a list of blog posts). Use __WEBSITE_KEY__ in the path if path depends on website name (for example: image/__WEBSITE_KEY__/stories/myimage.png). -WEBSITE_KEYWORDS=Keywords -LinesToImport=Lines to import - -MemoryUsage=Memory usage -RequestDuration=Duration of request -ProductsPerPopularity=Products/Services by popularity -PopuProp=Products/Services by popularity in Proposals -PopuCom=Products/Services by popularity in Orders -ProductStatistics=Products/Services Statistics -NbOfQtyInOrders=Qty in orders -SelectTheTypeOfObjectToAnalyze=Select an object to view its statistics... - -ConfirmBtnCommonContent = Are you sure you want to "%s" ? -ConfirmBtnCommonTitle = Confirm your action -CloseDialog = Close diff --git a/htdocs/langs/ar_IQ/partnership.lang b/htdocs/langs/ar_IQ/partnership.lang deleted file mode 100644 index 606c3a0df3b..00000000000 --- a/htdocs/langs/ar_IQ/partnership.lang +++ /dev/null @@ -1,91 +0,0 @@ -# Copyright (C) 2021 NextGestion -# -# 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 . - -# -# Generic -# -ModulePartnershipName=Partnership management -PartnershipDescription=Module Partnership management -PartnershipDescriptionLong= Module Partnership management - -AddPartnership=Add partnership -CancelPartnershipForExpiredMembers=Partnership: Cancel partnership of members with expired subscriptions -PartnershipCheckBacklink=Partnership: Check referring backlink - -# -# Menu -# -NewPartnership=New Partnership -ListOfPartnerships=List of partnership - -# -# Admin page -# -PartnershipSetup=Partnership setup -PartnershipAbout=About Partnership -PartnershipAboutPage=Partnership about page -partnershipforthirdpartyormember=Partner status must be set on a 'thirdparty' or a 'member' -PARTNERSHIP_IS_MANAGED_FOR=Partnership managed for -PARTNERSHIP_BACKLINKS_TO_CHECK=Backlinks to check -PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL=Nb of days before cancelling status of a partnership when a subscription has expired -ReferingWebsiteCheck=Check of website referring -ReferingWebsiteCheckDesc=You can enable a feature to check that your partners has added a backlink to your website domains on their own website. - -# -# Object -# -DeletePartnership=Delete a partnership -PartnershipDedicatedToThisThirdParty=Partnership dedicated to this third party -PartnershipDedicatedToThisMember=Partnership dedicated to this member -DatePartnershipStart=Start date -DatePartnershipEnd=End date -ReasonDecline=Decline reason -ReasonDeclineOrCancel=Decline reason -PartnershipAlreadyExist=Partnership already exist -ManagePartnership=Manage partnership -BacklinkNotFoundOnPartnerWebsite=Backlink not found on partner website -ConfirmClosePartnershipAsk=Are you sure you want to cancel this partnership? -PartnershipType=Partnership type - -# -# Template Mail -# -SendingEmailOnPartnershipWillSoonBeCanceled=Partnership will soon be canceled -SendingEmailOnPartnershipRefused=Partnership refused -SendingEmailOnPartnershipAccepted=Partnership accepted -SendingEmailOnPartnershipCanceled=Partnership canceled - -YourPartnershipWillSoonBeCanceledTopic=Partnership will soon be canceled -YourPartnershipRefusedTopic=Partnership refused -YourPartnershipAcceptedTopic=Partnership accepted -YourPartnershipCanceledTopic=Partnership canceled - -YourPartnershipWillSoonBeCanceledContent=We inform you that your partnership will soon be canceled (Backlink not found) -YourPartnershipRefusedContent=We inform you that your partnership request has been refused. -YourPartnershipAcceptedContent=We inform you that your partnership request has been accepted. -YourPartnershipCanceledContent=We inform you that your partnership has been canceled. - -CountLastUrlCheckError=Number of errors for last URL check -LastCheckBacklink=Date of last URL check -ReasonDeclineOrCancel=Decline reason - -# -# Status -# -PartnershipDraft=Draft -PartnershipAccepted=Accepted -PartnershipRefused=Refused -PartnershipCanceled=Canceled -PartnershipManagedFor=Partners are diff --git a/htdocs/langs/ar_IQ/paybox.lang b/htdocs/langs/ar_IQ/paybox.lang deleted file mode 100644 index 6f320c03181..00000000000 --- a/htdocs/langs/ar_IQ/paybox.lang +++ /dev/null @@ -1,30 +0,0 @@ -# Dolibarr language file - Source file is en_US - paybox -PayBoxSetup=PayBox module setup -PayBoxDesc=This module offer pages to allow payment on Paybox by customers. This can be used for a free payment or for a payment on a particular Dolibarr object (invoice, order, ...) -FollowingUrlAreAvailableToMakePayments=Following URLs are available to offer a page to a customer to make a payment on Dolibarr objects -PaymentForm=Payment form -WelcomeOnPaymentPage=Welcome to our online payment service -ThisScreenAllowsYouToPay=This screen allow you to make an online payment to %s. -ThisIsInformationOnPayment=This is information on payment to do -ToComplete=To complete -YourEMail=Email to receive payment confirmation -Creditor=Creditor -PaymentCode=Payment code -PayBoxDoPayment=Pay with Paybox -YouWillBeRedirectedOnPayBox=You will be redirected on secured Paybox page to input you credit card information -Continue=Next -SetupPayBoxToHavePaymentCreatedAutomatically=Setup your Paybox with url %s to have payment created automatically when validated by Paybox. -YourPaymentHasBeenRecorded=This page confirms that your payment has been recorded. Thank you. -YourPaymentHasNotBeenRecorded=Your payment has NOT been recorded and the transaction has been canceled. Thank you. -AccountParameter=Account parameters -UsageParameter=Usage parameters -InformationToFindParameters=Help to find your %s account information -PAYBOX_CGI_URL_V2=Url of Paybox CGI module for payment -CSSUrlForPaymentForm=CSS style sheet url for payment form -NewPayboxPaymentReceived=New Paybox payment received -NewPayboxPaymentFailed=New Paybox payment tried but failed -PAYBOX_PAYONLINE_SENDEMAIL=Email notification after payment attempt (success or fail) -PAYBOX_PBX_SITE=Value for PBX SITE -PAYBOX_PBX_RANG=Value for PBX Rang -PAYBOX_PBX_IDENTIFIANT=Value for PBX ID -PAYBOX_HMAC_KEY=HMAC key diff --git a/htdocs/langs/ar_IQ/paypal.lang b/htdocs/langs/ar_IQ/paypal.lang deleted file mode 100644 index 5eb5f389445..00000000000 --- a/htdocs/langs/ar_IQ/paypal.lang +++ /dev/null @@ -1,36 +0,0 @@ -# Dolibarr language file - Source file is en_US - paypal -PaypalSetup=PayPal module setup -PaypalDesc=This module allows payment by customers via PayPal. This can be used for a ad-hoc payment or for a payment related to a Dolibarr object (invoice, order, ...) -PaypalOrCBDoPayment=Pay with PayPal (Card or PayPal) -PaypalDoPayment=Pay with PayPal -PAYPAL_API_SANDBOX=Mode test/sandbox -PAYPAL_API_USER=API username -PAYPAL_API_PASSWORD=API password -PAYPAL_API_SIGNATURE=API signature -PAYPAL_SSLVERSION=Curl SSL Version -PAYPAL_API_INTEGRAL_OR_PAYPALONLY=Offer "integral" payment (Credit card+PayPal) or "PayPal" only -PaypalModeIntegral=Integral -PaypalModeOnlyPaypal=PayPal only -ONLINE_PAYMENT_CSS_URL=Optional URL of CSS stylesheet on online payment page -ThisIsTransactionId=This is id of transaction: %s -PAYPAL_ADD_PAYMENT_URL=Include the PayPal payment url when you send a document by email -NewOnlinePaymentReceived=New online payment received -NewOnlinePaymentFailed=New online payment tried but failed -ONLINE_PAYMENT_SENDEMAIL=Email address for notifications after each payment attempt (for success and fail) -ReturnURLAfterPayment=Return URL after payment -ValidationOfOnlinePaymentFailed=Validation of online payment failed -PaymentSystemConfirmPaymentPageWasCalledButFailed=Payment confirmation page was called by payment system returned an error -SetExpressCheckoutAPICallFailed=SetExpressCheckout API call failed. -DoExpressCheckoutPaymentAPICallFailed=DoExpressCheckoutPayment API call failed. -DetailedErrorMessage=Detailed Error Message -ShortErrorMessage=Short Error Message -ErrorCode=Error Code -ErrorSeverityCode=Error Severity Code -OnlinePaymentSystem=Online payment system -PaypalLiveEnabled=PayPal "live" mode enabled (otherwise test/sandbox mode) -PaypalImportPayment=Import PayPal payments -PostActionAfterPayment=Post actions after payments -ARollbackWasPerformedOnPostActions=A rollback was performed on all Post actions. You must complete post actions manually if they are necessary. -ValidationOfPaymentFailed=Validation of payment has failed -CardOwner=Card holder -PayPalBalance=Paypal credit diff --git a/htdocs/langs/ar_IQ/printing.lang b/htdocs/langs/ar_IQ/printing.lang index 16494583550..55eee521013 100644 --- a/htdocs/langs/ar_IQ/printing.lang +++ b/htdocs/langs/ar_IQ/printing.lang @@ -5,50 +5,3 @@ PrintingSetup=Setup of Direct Printing System PrintingDesc=This module adds a Print button to various modules to allow documents to be printed directly to a printer without needing to open the document in another application. MenuDirectPrinting=Direct Printing jobs DirectPrint=Direct print -PrintingDriverDesc=Configuration variables for printing driver. -ListDrivers=List of drivers -PrintTestDesc=List of Printers. -FileWasSentToPrinter=File %s was sent to printer -ViaModule=via the module -NoActivePrintingModuleFound=No active driver to print document. Check setup of module %s. -PleaseSelectaDriverfromList=Please select a driver from list. -PleaseConfigureDriverfromList=Please configure the selected driver from list. -SetupDriver=Driver setup -TargetedPrinter=Targeted printer -UserConf=Setup per user -PRINTGCP_INFO=Google OAuth API setup -PRINTGCP_AUTHLINK=Authentication -PRINTGCP_TOKEN_ACCESS=Google Cloud Print OAuth Token -PrintGCPDesc=This driver allows sending documents directly to a printer using Google Cloud Print. -GCP_Name=Name -GCP_displayName=Display Name -GCP_Id=Printer Id -GCP_OwnerName=Owner Name -GCP_State=Printer State -GCP_connectionStatus=Online State -GCP_Type=Printer Type -PrintIPPDesc=This driver allows sending of documents directly to a printer. It requires a Linux system with CUPS installed. -PRINTIPP_HOST=Print server -PRINTIPP_PORT=Port -PRINTIPP_USER=Login -PRINTIPP_PASSWORD=Password -NoDefaultPrinterDefined=No default printer defined -DefaultPrinter=Default printer -Printer=Printer -IPP_Uri=Printer Uri -IPP_Name=Printer Name -IPP_State=Printer State -IPP_State_reason=State reason -IPP_State_reason1=State reason1 -IPP_BW=BW -IPP_Color=Color -IPP_Device=Device -IPP_Media=Printer media -IPP_Supported=Type of media -DirectPrintingJobsDesc=This page lists printing jobs found for available printers. -GoogleAuthNotConfigured=Google OAuth has not been setup. Enable module OAuth and set a Google ID/Secret. -GoogleAuthConfigured=Google OAuth credentials were found into setup of module OAuth. -PrintingDriverDescprintgcp=Configuration variables for printing driver Google Cloud Print. -PrintingDriverDescprintipp=Configuration variables for printing driver Cups. -PrintTestDescprintgcp=List of Printers for Google Cloud Print. -PrintTestDescprintipp=List of Printers for Cups. diff --git a/htdocs/langs/ar_IQ/productbatch.lang b/htdocs/langs/ar_IQ/productbatch.lang deleted file mode 100644 index 763af20c6b4..00000000000 --- a/htdocs/langs/ar_IQ/productbatch.lang +++ /dev/null @@ -1,43 +0,0 @@ -# ProductBATCH language file - Source file is en_US - ProductBATCH -ManageLotSerial=Use lot/serial number -ProductStatusOnBatch=Yes (lot required) -ProductStatusOnSerial=Yes (unique serial number required) -ProductStatusNotOnBatch=No (lot/serial not used) -ProductStatusOnBatchShort=Lot -ProductStatusOnSerialShort=Serial -ProductStatusNotOnBatchShort=No -Batch=Lot/Serial -atleast1batchfield=Eat-by date or Sell-by date or Lot/Serial number -batch_number=Lot/Serial number -BatchNumberShort=Lot/Serial -EatByDate=Eat-by date -SellByDate=Sell-by date -DetailBatchNumber=Lot/Serial details -printBatch=Lot/Serial: %s -printEatby=Eat-by: %s -printSellby=Sell-by: %s -printQty=Qty: %d -AddDispatchBatchLine=Add a line for Shelf Life dispatching -WhenProductBatchModuleOnOptionAreForced=When module Lot/Serial is on, automatic stock decrease is forced to 'Decrease real stocks on shipping validation' and automatic increase mode is forced to 'Increase real stocks on manual dispatching into warehouses' and can't be edited. Other options can be defined as you want. -ProductDoesNotUseBatchSerial=This product does not use lot/serial number -ProductLotSetup=Setup of module lot/serial -ShowCurrentStockOfLot=Show current stock for couple product/lot -ShowLogOfMovementIfLot=Show log of movements for couple product/lot -StockDetailPerBatch=Stock detail per lot -SerialNumberAlreadyInUse=Serial number %s is already used for product %s -TooManyQtyForSerialNumber=You can only have one product %s for serial number %s -ManageLotMask=Custom mask -CustomMasks=Option to define a different numbering mask for each product -BatchLotNumberingModules=Numbering rule for automatic generation of lot number -BatchSerialNumberingModules=Numbering rule for automatic generation of serial number (for products with property 1 unique lot/serial for each product) -QtyToAddAfterBarcodeScan=Qty to add for each barcode/lot/serial scanned -LifeTime=Life span (in days) -EndOfLife=End of life -ManufacturingDate=Manufacturing date -DestructionDate=Destruction date -FirstUseDate=First use date -QCFrequency=Quality control frequency (in days) - -#Traceability - qc status -OutOfOrder=Out of order -InWorkingOrder=In working order diff --git a/htdocs/langs/ar_IQ/products.lang b/htdocs/langs/ar_IQ/products.lang deleted file mode 100644 index bf34efe3f79..00000000000 --- a/htdocs/langs/ar_IQ/products.lang +++ /dev/null @@ -1,401 +0,0 @@ -# Dolibarr language file - Source file is en_US - products -ProductRef=Product ref. -ProductLabel=Product label -ProductLabelTranslated=Translated product label -ProductDescription=Product description -ProductDescriptionTranslated=Translated product description -ProductNoteTranslated=Translated product note -ProductServiceCard=Products/Services card -TMenuProducts=Products -TMenuServices=Services -Products=Products -Services=Services -Product=Product -Service=Service -ProductId=Product/service id -Create=Create -Reference=Reference -NewProduct=New product -NewService=New service -ProductVatMassChange=Global VAT Update -ProductVatMassChangeDesc=This tool updates the VAT rate defined on ALL products and services! -MassBarcodeInit=Mass barcode init -MassBarcodeInitDesc=This page can be used to initialize a barcode on objects that does not have barcode defined. Check before that setup of module barcode is complete. -ProductAccountancyBuyCode=Accounting code (purchase) -ProductAccountancyBuyIntraCode=Accounting code (purchase intra-community) -ProductAccountancyBuyExportCode=Accounting code (purchase import) -ProductAccountancySellCode=Accounting code (sale) -ProductAccountancySellIntraCode=Accounting code (sale intra-Community) -ProductAccountancySellExportCode=Accounting code (sale export) -ProductOrService=Product or Service -ProductsAndServices=Products and Services -ProductsOrServices=Products or Services -ProductsPipeServices=Products | Services -ProductsOnSale=Products for sale -ProductsOnPurchase=Products for purchase -ProductsOnSaleOnly=Products for sale only -ProductsOnPurchaseOnly=Products for purchase only -ProductsNotOnSell=Products not for sale and not for purchase -ProductsOnSellAndOnBuy=Products for sale and for purchase -ServicesOnSale=Services for sale -ServicesOnPurchase=Services for purchase -ServicesOnSaleOnly=Services for sale only -ServicesOnPurchaseOnly=Services for purchase only -ServicesNotOnSell=Services not for sale and not for purchase -ServicesOnSellAndOnBuy=Services for sale and for purchase -LastModifiedProductsAndServices=Latest %s products/services which were modified -LastRecordedProducts=Latest %s recorded products -LastRecordedServices=Latest %s recorded services -CardProduct0=Product -CardProduct1=Service -Stock=Stock -MenuStocks=Stocks -Stocks=Stocks and location (warehouse) of products -Movements=Movements -Sell=Sell -Buy=Purchase -OnSell=For sale -OnBuy=For purchase -NotOnSell=Not for sale -ProductStatusOnSell=For sale -ProductStatusNotOnSell=Not for sale -ProductStatusOnSellShort=For sale -ProductStatusNotOnSellShort=Not for sale -ProductStatusOnBuy=For purchase -ProductStatusNotOnBuy=Not for purchase -ProductStatusOnBuyShort=For purchase -ProductStatusNotOnBuyShort=Not for purchase -UpdateVAT=Update vat -UpdateDefaultPrice=Update default price -UpdateLevelPrices=Update prices for each level -AppliedPricesFrom=Applied from -SellingPrice=Selling price -SellingPriceHT=Selling price (excl. tax) -SellingPriceTTC=Selling price (inc. tax) -SellingMinPriceTTC=Minimum Selling price (inc. tax) -CostPriceDescription=This price field (excl. tax) can be used to capture the average amount this product costs to your company. It may be any price you calculate yourself, for example, from the average buying price plus average production and distribution cost. -CostPriceUsage=This value could be used for margin calculation. -SoldAmount=Sold amount -PurchasedAmount=Purchased amount -NewPrice=New price -MinPrice=Min. selling price -EditSellingPriceLabel=Edit selling price label -CantBeLessThanMinPrice=The selling price can't be lower than minimum allowed for this product (%s without tax). This message can also appears if you type a too important discount. -ContractStatusClosed=Closed -ErrorProductAlreadyExists=A product with reference %s already exists. -ErrorProductBadRefOrLabel=Wrong value for reference or label. -ErrorProductClone=There was a problem while trying to clone the product or service. -ErrorPriceCantBeLowerThanMinPrice=Error, price can't be lower than minimum price. -Suppliers=Vendors -SupplierRef=Vendor SKU -ShowProduct=Show product -ShowService=Show service -ProductsAndServicesArea=Product and Services area -ProductsArea=Product area -ServicesArea=Services area -ListOfStockMovements=List of stock movements -BuyingPrice=Buying price -PriceForEachProduct=Products with specific prices -SupplierCard=Vendor card -PriceRemoved=Price removed -BarCode=Barcode -BarcodeType=Barcode type -SetDefaultBarcodeType=Set barcode type -BarcodeValue=Barcode value -NoteNotVisibleOnBill=Note (not visible on invoices, proposals...) -ServiceLimitedDuration=If product is a service with limited duration: -FillWithLastServiceDates=Fill with last service line dates -MultiPricesAbility=Multiple price segments per product/service (each customer is in one price segment) -MultiPricesNumPrices=Number of prices -DefaultPriceType=Base of prices per default (with versus without tax) when adding new sale prices -AssociatedProductsAbility=Enable Kits (set of several products) -VariantsAbility=Enable Variants (variations of products, for example color, size) -AssociatedProducts=Kits -AssociatedProductsNumber=Number of products composing this kit -ParentProductsNumber=Number of parent packaging product -ParentProducts=Parent products -IfZeroItIsNotAVirtualProduct=If 0, this product is not a kit -IfZeroItIsNotUsedByVirtualProduct=If 0, this product is not used by any kit -KeywordFilter=Keyword filter -CategoryFilter=Category filter -ProductToAddSearch=Search product to add -NoMatchFound=No match found -ListOfProductsServices=List of products/services -ProductAssociationList=List of products/services that are component(s) of this kit -ProductParentList=List of kits with this product as a component -ErrorAssociationIsFatherOfThis=One of selected product is parent with current product -DeleteProduct=Delete a product/service -ConfirmDeleteProduct=Are you sure you want to delete this product/service? -ProductDeleted=Product/Service "%s" deleted from database. -ExportDataset_produit_1=Products -ExportDataset_service_1=Services -ImportDataset_produit_1=Products -ImportDataset_service_1=Services -DeleteProductLine=Delete product line -ConfirmDeleteProductLine=Are you sure you want to delete this product line? -ProductSpecial=Special -QtyMin=Min. purchase quantity -PriceQtyMin=Price quantity min. -PriceQtyMinCurrency=Price (currency) for this qty. (no discount) -VATRateForSupplierProduct=VAT Rate (for this vendor/product) -DiscountQtyMin=Discount for this qty. -NoPriceDefinedForThisSupplier=No price/qty defined for this vendor/product -NoSupplierPriceDefinedForThisProduct=No vendor price/qty defined for this product -PredefinedItem=Predefined item -PredefinedProductsToSell=Predefined Product -PredefinedServicesToSell=Predefined Service -PredefinedProductsAndServicesToSell=Predefined products/services to sell -PredefinedProductsToPurchase=Predefined product to purchase -PredefinedServicesToPurchase=Predefined services to purchase -PredefinedProductsAndServicesToPurchase=Predefined products/services to purchase -NotPredefinedProducts=Not predefined products/services -GenerateThumb=Generate thumb -ServiceNb=Service #%s -ListProductServiceByPopularity=List of products/services by popularity -ListProductByPopularity=List of products by popularity -ListServiceByPopularity=List of services by popularity -Finished=Manufactured product -RowMaterial=Raw Material -ConfirmCloneProduct=Are you sure you want to clone product or service %s? -CloneContentProduct=Clone all main information of the product/service -ClonePricesProduct=Clone prices -CloneCategoriesProduct=Clone linked tags/categories -CloneCompositionProduct=Clone virtual products/services -CloneCombinationsProduct=Clone the product variants -ProductIsUsed=This product is used -NewRefForClone=Ref. of new product/service -SellingPrices=Selling prices -BuyingPrices=Buying prices -CustomerPrices=Customer prices -SuppliersPrices=Vendor prices -SuppliersPricesOfProductsOrServices=Vendor prices (of products or services) -CustomCode=Customs|Commodity|HS code -CountryOrigin=Country of origin -RegionStateOrigin=Region of origin -StateOrigin=State|Province of origin -Nature=Nature of product (raw/manufactured) -NatureOfProductShort=Nature of product -NatureOfProductDesc=Raw material or manufactured product -ShortLabel=Short label -Unit=Unit -p=u. -set=set -se=set -second=second -s=s -hour=hour -h=h -day=day -d=d -kilogram=kilogram -kg=Kg -gram=gram -g=g -meter=meter -m=m -lm=lm -m2=m² -m3=m³ -liter=liter -l=L -unitP=Piece -unitSET=Set -unitS=Second -unitH=Hour -unitD=Day -unitG=Gram -unitM=Meter -unitLM=Linear meter -unitM2=Square meter -unitM3=Cubic meter -unitL=Liter -unitT=ton -unitKG=kg -unitG=Gram -unitMG=mg -unitLB=pound -unitOZ=ounce -unitM=Meter -unitDM=dm -unitCM=cm -unitMM=mm -unitFT=ft -unitIN=in -unitM2=Square meter -unitDM2=dm² -unitCM2=cm² -unitMM2=mm² -unitFT2=ft² -unitIN2=in² -unitM3=Cubic meter -unitDM3=dm³ -unitCM3=cm³ -unitMM3=mm³ -unitFT3=ft³ -unitIN3=in³ -unitOZ3=ounce -unitgallon=gallon -ProductCodeModel=Product ref template -ServiceCodeModel=Service ref template -CurrentProductPrice=Current price -AlwaysUseNewPrice=Always use current price of product/service -AlwaysUseFixedPrice=Use the fixed price -PriceByQuantity=Different prices by quantity -DisablePriceByQty=Disable prices by quantity -PriceByQuantityRange=Quantity range -MultipriceRules=Automatic prices for segment -UseMultipriceRules=Use price segment rules (defined into product module setup) to auto calculate prices of all other segments according to first segment -PercentVariationOver=%% variation over %s -PercentDiscountOver=%% discount over %s -KeepEmptyForAutoCalculation=Keep empty to have this calculated automatically from weight or volume of products -VariantRefExample=Examples: COL, SIZE -VariantLabelExample=Examples: Color, Size -### composition fabrication -Build=Produce -ProductsMultiPrice=Products and prices for each price segment -ProductsOrServiceMultiPrice=Customer prices (of products or services, multi-prices) -ProductSellByQuarterHT=Products turnover quarterly before tax -ServiceSellByQuarterHT=Services turnover quarterly before tax -Quarter1=1st. Quarter -Quarter2=2nd. Quarter -Quarter3=3rd. Quarter -Quarter4=4th. Quarter -BarCodePrintsheet=Print barcode -PageToGenerateBarCodeSheets=With this tool, you can print sheets of barcode stickers. Choose format of your sticker page, type of barcode and value of barcode, then click on button %s. -NumberOfStickers=Number of stickers to print on page -PrintsheetForOneBarCode=Print several stickers for one barcode -BuildPageToPrint=Generate page to print -FillBarCodeTypeAndValueManually=Fill barcode type and value manually. -FillBarCodeTypeAndValueFromProduct=Fill barcode type and value from barcode of a product. -FillBarCodeTypeAndValueFromThirdParty=Fill barcode type and value from barcode of a third party. -DefinitionOfBarCodeForProductNotComplete=Definition of type or value of barcode not complete for product %s. -DefinitionOfBarCodeForThirdpartyNotComplete=Definition of type or value of barcode non complete for third party %s. -BarCodeDataForProduct=Barcode information of product %s: -BarCodeDataForThirdparty=Barcode information of third party %s: -ResetBarcodeForAllRecords=Define barcode value for all record (this will also reset barcode value already defined with new values) -PriceByCustomer=Different prices for each customer -PriceCatalogue=A single sell price per product/service -PricingRule=Rules for selling prices -AddCustomerPrice=Add price by customer -ForceUpdateChildPriceSoc=Set same price on customer's subsidiaries -PriceByCustomerLog=Log of previous customer prices -MinimumPriceLimit=Minimum price can't be lower then %s -MinimumRecommendedPrice=Minimum recommended price is: %s -PriceExpressionEditor=Price expression editor -PriceExpressionSelected=Selected price expression -PriceExpressionEditorHelp1="price = 2 + 2" or "2 + 2" for setting the price. Use ; to separate expressions -PriceExpressionEditorHelp2=You can access ExtraFields with variables like #extrafield_myextrafieldkey# and global variables with #global_mycode# -PriceExpressionEditorHelp3=In both product/service and vendor prices there are these variables available:
    #tva_tx# #localtax1_tx# #localtax2_tx# #weight# #length# #surface# #price_min# -PriceExpressionEditorHelp4=In product/service price only: #supplier_min_price#
    In vendor prices only: #supplier_quantity# and #supplier_tva_tx# -PriceExpressionEditorHelp5=Available global values: -PriceMode=Price mode -PriceNumeric=Number -DefaultPrice=Default price -DefaultPriceLog=Log of previous default prices -ComposedProductIncDecStock=Increase/Decrease stock on parent change -ComposedProduct=Child products -MinSupplierPrice=Minimum buying price -MinCustomerPrice=Minimum selling price -NoDynamicPrice=No dynamic price -DynamicPriceConfiguration=Dynamic price configuration -DynamicPriceDesc=You may define mathematical formulae to calculate Customer or Vendor prices. Such formulas can use all mathematical operators, some constants and variables. You can define here the variables you wish to use. If the variable needs an automatic update, you may define the external URL to allow Dolibarr to update the value automatically. -AddVariable=Add Variable -AddUpdater=Add Updater -GlobalVariables=Global variables -VariableToUpdate=Variable to update -GlobalVariableUpdaters=External updaters for variables -GlobalVariableUpdaterType0=JSON data -GlobalVariableUpdaterHelp0=Parses JSON data from specified URL, VALUE specifies the location of relevant value, -GlobalVariableUpdaterHelpFormat0=Format for request {"URL": "http://example.com/urlofjson", "VALUE": "array1,array2,targetvalue"} -GlobalVariableUpdaterType1=WebService data -GlobalVariableUpdaterHelp1=Parses WebService data from specified URL, NS specifies the namespace, VALUE specifies the location of relevant value, DATA should contain the data to send and METHOD is the calling WS method -GlobalVariableUpdaterHelpFormat1=Format for request is {"URL": "http://example.com/urlofws", "VALUE": "array,targetvalue", "NS": "http://example.com/urlofns", "METHOD": "myWSMethod", "DATA": {"your": "data", "to": "send"}} -UpdateInterval=Update interval (minutes) -LastUpdated=Latest update -CorrectlyUpdated=Correctly updated -PropalMergePdfProductActualFile=Files use to add into PDF Azur are/is -PropalMergePdfProductChooseFile=Select PDF files -IncludingProductWithTag=Include products/services with tag -DefaultPriceRealPriceMayDependOnCustomer=Default price, real price may depend on customer -WarningSelectOneDocument=Please select at least one document -DefaultUnitToShow=Unit -NbOfQtyInProposals=Qty in proposals -ClinkOnALinkOfColumn=Click on a link of column %s to get a detailed view... -ProductsOrServicesTranslations=Products/Services translations -TranslatedLabel=Translated label -TranslatedDescription=Translated description -TranslatedNote=Translated notes -ProductWeight=Weight for 1 product -ProductVolume=Volume for 1 product -WeightUnits=Weight unit -VolumeUnits=Volume unit -WidthUnits=Width unit -LengthUnits=Length unit -HeightUnits=Height unit -SurfaceUnits=Surface unit -SizeUnits=Size unit -DeleteProductBuyPrice=Delete buying price -ConfirmDeleteProductBuyPrice=Are you sure you want to delete this buying price? -SubProduct=Sub product -ProductSheet=Product sheet -ServiceSheet=Service sheet -PossibleValues=Possible values -GoOnMenuToCreateVairants=Go on menu %s - %s to prepare attribute variants (like colors, size, ...) -UseProductFournDesc=Add a feature to define the product description defined by the vendors (for each vendor reference) in addition to the description for customers -ProductSupplierDescription=Vendor description for the product -UseProductSupplierPackaging=Use packaging on supplier prices (recalculate quantities according to packaging set on supplier price when adding/updating line in supplier documents) -PackagingForThisProduct=Packaging -PackagingForThisProductDesc=On supplier order, you will automaticly order this quantity (or a multiple of this quantity). Cannot be less than minimum buying quantity -QtyRecalculatedWithPackaging=The quantity of the line were recalculated according to supplier packaging - -#Attributes -VariantAttributes=Variant attributes -ProductAttributes=Variant attributes for products -ProductAttributeName=Variant attribute %s -ProductAttribute=Variant attribute -ProductAttributeDeleteDialog=Are you sure you want to delete this attribute? All values will be deleted -ProductAttributeValueDeleteDialog=Are you sure you want to delete the value "%s" with reference "%s" of this attribute? -ProductCombinationDeleteDialog=Are you sure want to delete the variant of the product "%s"? -ProductCombinationAlreadyUsed=There was an error while deleting the variant. Please check it is not being used in any object -ProductCombinations=Variants -PropagateVariant=Propagate variants -HideProductCombinations=Hide products variant in the products selector -ProductCombination=Variant -NewProductCombination=New variant -EditProductCombination=Editing variant -NewProductCombinations=New variants -EditProductCombinations=Editing variants -SelectCombination=Select combination -ProductCombinationGenerator=Variants generator -Features=Features -PriceImpact=Price impact -ImpactOnPriceLevel=Impact on price level %s -ApplyToAllPriceImpactLevel= Apply to all levels -ApplyToAllPriceImpactLevelHelp=By clicking here you set the same price impact on all levels -WeightImpact=Weight impact -NewProductAttribute=New attribute -NewProductAttributeValue=New attribute value -ErrorCreatingProductAttributeValue=There was an error while creating the attribute value. It could be because there is already an existing value with that reference -ProductCombinationGeneratorWarning=If you continue, before generating new variants, all previous ones will be DELETED. Already existing ones will be updated with the new values -TooMuchCombinationsWarning=Generating lots of variants may result in high CPU, memory usage and Dolibarr not able to create them. Enabling the option "%s" may help reduce memory usage. -DoNotRemovePreviousCombinations=Do not remove previous variants -UsePercentageVariations=Use percentage variations -PercentageVariation=Percentage variation -ErrorDeletingGeneratedProducts=There was an error while trying to delete existing product variants -NbOfDifferentValues=No. of different values -NbProducts=Number of products -ParentProduct=Parent product -HideChildProducts=Hide variant products -ShowChildProducts=Show variant products -NoEditVariants=Go to Parent product card and edit variants price impact in the variants tab -ConfirmCloneProductCombinations=Would you like to copy all the product variants to the other parent product with the given reference? -CloneDestinationReference=Destination product reference -ErrorCopyProductCombinations=There was an error while copying the product variants -ErrorDestinationProductNotFound=Destination product not found -ErrorProductCombinationNotFound=Product variant not found -ActionAvailableOnVariantProductOnly=Action only available on the variant of product -ProductsPricePerCustomer=Product prices per customers -ProductSupplierExtraFields=Additional Attributes (Supplier Prices) -DeleteLinkedProduct=Delete the child product linked to the combination -PMPValue=Weighted average price -PMPValueShort=WAP diff --git a/htdocs/langs/ar_IQ/projects.lang b/htdocs/langs/ar_IQ/projects.lang deleted file mode 100644 index 77fc9970303..00000000000 --- a/htdocs/langs/ar_IQ/projects.lang +++ /dev/null @@ -1,283 +0,0 @@ -# Dolibarr language file - Source file is en_US - projects -RefProject=Ref. project -ProjectRef=Project ref. -ProjectId=Project Id -ProjectLabel=Project label -ProjectsArea=Projects Area -ProjectStatus=Project status -SharedProject=Everybody -PrivateProject=Project contacts -ProjectsImContactFor=Projects for which I am explicitly a contact -AllAllowedProjects=All project I can read (mine + public) -AllProjects=All projects -MyProjectsDesc=This view is limited to the projects that you are a contact for -ProjectsPublicDesc=This view presents all projects you are allowed to read. -TasksOnProjectsPublicDesc=This view presents all tasks on projects you are allowed to read. -ProjectsPublicTaskDesc=This view presents all projects and tasks you are allowed to read. -ProjectsDesc=This view presents all projects (your user permissions grant you permission to view everything). -TasksOnProjectsDesc=This view presents all tasks on all projects (your user permissions grant you permission to view everything). -MyTasksDesc=This view is limited to the projects or tasks that you are a contact for -OnlyOpenedProject=Only open projects are visible (projects in draft or closed status are not visible). -ClosedProjectsAreHidden=Closed projects are not visible. -TasksPublicDesc=This view presents all projects and tasks you are allowed to read. -TasksDesc=This view presents all projects and tasks (your user permissions grant you permission to view everything). -AllTaskVisibleButEditIfYouAreAssigned=All tasks for qualified projects are visible, but you can enter time only for task assigned to selected user. Assign task if you need to enter time on it. -OnlyYourTaskAreVisible=Only tasks assigned to you are visible. If you need to enter time on a task and if the task is not visible here, then you need to assign the task to yourself. -ImportDatasetTasks=Tasks of projects -ProjectCategories=Project tags/categories -NewProject=New project -AddProject=Create project -DeleteAProject=Delete a project -DeleteATask=Delete a task -ConfirmDeleteAProject=Are you sure you want to delete this project? -ConfirmDeleteATask=Are you sure you want to delete this task? -OpenedProjects=Open projects -OpenedTasks=Open tasks -OpportunitiesStatusForOpenedProjects=Leads amount of open projects by status -OpportunitiesStatusForProjects=Leads amount of projects by status -ShowProject=Show project -ShowTask=Show task -SetProject=Set project -NoProject=No project defined or owned -NbOfProjects=Number of projects -NbOfTasks=Number of tasks -TimeSpent=Time spent -TimeSpentByYou=Time spent by you -TimeSpentByUser=Time spent by user -TimesSpent=Time spent -TaskId=Task ID -RefTask=Task ref. -LabelTask=Task label -TaskTimeSpent=Time spent on tasks -TaskTimeUser=User -TaskTimeNote=Note -TaskTimeDate=Date -TasksOnOpenedProject=Tasks on open projects -WorkloadNotDefined=Workload not defined -NewTimeSpent=Time spent -MyTimeSpent=My time spent -BillTime=Bill the time spent -BillTimeShort=Bill time -TimeToBill=Time not billed -TimeBilled=Time billed -Tasks=Tasks -Task=Task -TaskDateStart=Task start date -TaskDateEnd=Task end date -TaskDescription=Task description -NewTask=New task -AddTask=Create task -AddTimeSpent=Create time spent -AddHereTimeSpentForDay=Add here time spent for this day/task -AddHereTimeSpentForWeek=Add here time spent for this week/task -Activity=Activity -Activities=Tasks/activities -MyActivities=My tasks/activities -MyProjects=My projects -MyProjectsArea=My projects Area -DurationEffective=Effective duration -ProgressDeclared=Declared real progress -TaskProgressSummary=Task progress -CurentlyOpenedTasks=Curently open tasks -TheReportedProgressIsLessThanTheCalculatedProgressionByX=The declared real progress is less %s than the progress on consumption -TheReportedProgressIsMoreThanTheCalculatedProgressionByX=The declared real progress is more %s than the progress on consumption -ProgressCalculated=Progress on consumption -WhichIamLinkedTo=which I'm linked to -WhichIamLinkedToProject=which I'm linked to project -Time=Time -TimeConsumed=Consumed -ListOfTasks=List of tasks -GoToListOfTimeConsumed=Go to list of time consumed -GanttView=Gantt View -ListWarehouseAssociatedProject=List of warehouses associated to the project -ListProposalsAssociatedProject=List of the commercial proposals related to the project -ListOrdersAssociatedProject=List of sales orders related to the project -ListInvoicesAssociatedProject=List of customer invoices related to the project -ListPredefinedInvoicesAssociatedProject=List of customer template invoices related to the project -ListSupplierOrdersAssociatedProject=List of purchase orders related to the project -ListSupplierInvoicesAssociatedProject=List of vendor invoices related to the project -ListContractAssociatedProject=List of contracts related to the project -ListShippingAssociatedProject=List of shippings related to the project -ListFichinterAssociatedProject=List of interventions related to the project -ListExpenseReportsAssociatedProject=List of expense reports related to the project -ListDonationsAssociatedProject=List of donations related to the project -ListVariousPaymentsAssociatedProject=List of miscellaneous payments related to the project -ListSalariesAssociatedProject=List of payments of salaries related to the project -ListActionsAssociatedProject=List of events related to the project -ListMOAssociatedProject=List of manufacturing orders related to the project -ListTaskTimeUserProject=List of time consumed on tasks of project -ListTaskTimeForTask=List of time consumed on task -ActivityOnProjectToday=Activity on project today -ActivityOnProjectYesterday=Activity on project yesterday -ActivityOnProjectThisWeek=Activity on project this week -ActivityOnProjectThisMonth=Activity on project this month -ActivityOnProjectThisYear=Activity on project this year -ChildOfProjectTask=Child of project/task -ChildOfTask=Child of task -TaskHasChild=Task has child -NotOwnerOfProject=Not owner of this private project -AffectedTo=Allocated to -CantRemoveProject=This project can't be removed as it is referenced by some other objects (invoice, orders or other). See tab '%s'. -ValidateProject=Validate projet -ConfirmValidateProject=Are you sure you want to validate this project? -CloseAProject=Close project -ConfirmCloseAProject=Are you sure you want to close this project? -AlsoCloseAProject=Also close project (keep it open if you still need to follow production tasks on it) -ReOpenAProject=Open project -ConfirmReOpenAProject=Are you sure you want to re-open this project? -ProjectContact=Contacts of project -TaskContact=Task contacts -ActionsOnProject=Events on project -YouAreNotContactOfProject=You are not a contact of this private project -UserIsNotContactOfProject=User is not a contact of this private project -DeleteATimeSpent=Delete time spent -ConfirmDeleteATimeSpent=Are you sure you want to delete this time spent? -DoNotShowMyTasksOnly=See also tasks not assigned to me -ShowMyTasksOnly=View only tasks assigned to me -TaskRessourceLinks=Contacts of task -ProjectsDedicatedToThisThirdParty=Projects dedicated to this third party -NoTasks=No tasks for this project -LinkedToAnotherCompany=Linked to other third party -TaskIsNotAssignedToUser=Task not assigned to user. Use button '%s' to assign task now. -ErrorTimeSpentIsEmpty=Time spent is empty -TimeRecordingRestrictedToNMonthsBack=Time recording is restricted to %s months back -ThisWillAlsoRemoveTasks=This action will also delete all tasks of project (%s tasks at the moment) and all inputs of time spent. -IfNeedToUseOtherObjectKeepEmpty=If some objects (invoice, order, ...), belonging to another third party, must be linked to the project to create, keep this empty to have the project being multi third parties. -CloneTasks=Clone tasks -CloneContacts=Clone contacts -CloneNotes=Clone notes -CloneProjectFiles=Clone project joined files -CloneTaskFiles=Clone task(s) joined files (if task(s) cloned) -CloneMoveDate=Update project/tasks dates from now? -ConfirmCloneProject=Are you sure to clone this project? -ProjectReportDate=Change task dates according to new project start date -ErrorShiftTaskDate=Impossible to shift task date according to new project start date -ProjectsAndTasksLines=Projects and tasks -ProjectCreatedInDolibarr=Project %s created -ProjectValidatedInDolibarr=Project %s validated -ProjectModifiedInDolibarr=Project %s modified -TaskCreatedInDolibarr=Task %s created -TaskModifiedInDolibarr=Task %s modified -TaskDeletedInDolibarr=Task %s deleted -OpportunityStatus=Lead status -OpportunityStatusShort=Lead status -OpportunityProbability=Lead probability -OpportunityProbabilityShort=Lead probab. -OpportunityAmount=Lead amount -OpportunityAmountShort=Lead amount -OpportunityWeightedAmount=Opportunity weighted amount -OpportunityWeightedAmountShort=Opp. weighted amount -OpportunityAmountAverageShort=Average lead amount -OpportunityAmountWeigthedShort=Weighted lead amount -WonLostExcluded=Won/Lost excluded -##### Types de contacts ##### -TypeContact_project_internal_PROJECTLEADER=Project leader -TypeContact_project_external_PROJECTLEADER=Project leader -TypeContact_project_internal_PROJECTCONTRIBUTOR=Contributor -TypeContact_project_external_PROJECTCONTRIBUTOR=Contributor -TypeContact_project_task_internal_TASKEXECUTIVE=Task executive -TypeContact_project_task_external_TASKEXECUTIVE=Task executive -TypeContact_project_task_internal_TASKCONTRIBUTOR=Contributor -TypeContact_project_task_external_TASKCONTRIBUTOR=Contributor -SelectElement=Select element -AddElement=Link to element -LinkToElementShort=Link to -# Documents models -DocumentModelBeluga=Project document template for linked objects overview -DocumentModelBaleine=Project document template for tasks -DocumentModelTimeSpent=Project report template for time spent -PlannedWorkload=Planned workload -PlannedWorkloadShort=Workload -ProjectReferers=Related items -ProjectMustBeValidatedFirst=Project must be validated first -FirstAddRessourceToAllocateTime=Assign a user resource as contact of project to allocate time -InputPerDay=Input per day -InputPerWeek=Input per week -InputPerMonth=Input per month -InputDetail=Input detail -TimeAlreadyRecorded=This is time spent already recorded for this task/day and user %s -ProjectsWithThisUserAsContact=Projects with this user as contact -TasksWithThisUserAsContact=Tasks assigned to this user -ResourceNotAssignedToProject=Not assigned to project -ResourceNotAssignedToTheTask=Not assigned to the task -NoUserAssignedToTheProject=No users assigned to this project -TimeSpentBy=Time spent by -TasksAssignedTo=Tasks assigned to -AssignTaskToMe=Assign task to myself -AssignTaskToUser=Assign task to %s -SelectTaskToAssign=Select task to assign... -AssignTask=Assign -ProjectOverview=Overview -ManageTasks=Use projects to follow tasks and/or report time spent (timesheets) -ManageOpportunitiesStatus=Use projects to follow leads/opportinuties -ProjectNbProjectByMonth=No. of created projects by month -ProjectNbTaskByMonth=No. of created tasks by month -ProjectOppAmountOfProjectsByMonth=Amount of leads by month -ProjectWeightedOppAmountOfProjectsByMonth=Weighted amount of leads by month -ProjectOpenedProjectByOppStatus=Open project|lead by lead status -ProjectsStatistics=Statistics on projects or leads -TasksStatistics=Statistics on tasks of projects or leads -TaskAssignedToEnterTime=Task assigned. Entering time on this task should be possible. -IdTaskTime=Id task time -YouCanCompleteRef=If you want to complete the ref with some suffix, it is recommanded to add a - character to separate it, so the automatic numbering will still work correctly for next projects. For example %s-MYSUFFIX -OpenedProjectsByThirdparties=Open projects by third parties -OnlyOpportunitiesShort=Only leads -OpenedOpportunitiesShort=Open leads -NotOpenedOpportunitiesShort=Not an open lead -NotAnOpportunityShort=Not a lead -OpportunityTotalAmount=Total amount of leads -OpportunityPonderatedAmount=Weighted amount of leads -OpportunityPonderatedAmountDesc=Leads amount weighted with probability -OppStatusPROSP=Prospection -OppStatusQUAL=Qualification -OppStatusPROPO=Proposal -OppStatusNEGO=Negociation -OppStatusPENDING=Pending -OppStatusWON=Won -OppStatusLOST=Lost -Budget=Budget -AllowToLinkFromOtherCompany=Allow to link project from other company

    Supported values:
    - Keep empty: Can link any project of the company (default)
    - "all": Can link any projects, even projects of other companies
    - A list of third-party ids separated by commas: can link all projects of these third partys (Example: 123,4795,53)
    -LatestProjects=Latest %s projects -LatestModifiedProjects=Latest %s modified projects -OtherFilteredTasks=Other filtered tasks -NoAssignedTasks=No assigned tasks found (assign project/tasks to the current user from the top select box to enter time on it) -ThirdPartyRequiredToGenerateInvoice=A third party must be defined on project to be able to invoice it. -ThirdPartyRequiredToGenerateInvoice=A third party must be defined on project to be able to invoice it. -ChooseANotYetAssignedTask=Choose a task not yet assigned to you -# Comments trans -AllowCommentOnTask=Allow user comments on tasks -AllowCommentOnProject=Allow user comments on projects -DontHavePermissionForCloseProject=You do not have permissions to close the project %s -DontHaveTheValidateStatus=The project %s must be open to be closed -RecordsClosed=%s project(s) closed -SendProjectRef=Information project %s -ModuleSalaryToDefineHourlyRateMustBeEnabled=Module 'Salaries' must be enabled to define employee hourly rate to have time spent valorized -NewTaskRefSuggested=Task ref already used, a new task ref is required -TimeSpentInvoiced=Time spent billed -TimeSpentForIntervention=Time spent -TimeSpentForInvoice=Time spent -OneLinePerUser=One line per user -ServiceToUseOnLines=Service to use on lines -InvoiceGeneratedFromTimeSpent=Invoice %s has been generated from time spent on project -InterventionGeneratedFromTimeSpent=Intervention %s has been generated from time spent on project -ProjectBillTimeDescription=Check if you enter timesheet on tasks of project AND you plan to generate invoice(s) from the timesheet to bill the customer of the project (do not check if you plan to create invoice that is not based on entered timesheets). Note: To generate invoice, go on tab 'Time spent' of the project and select lines to include. -ProjectFollowOpportunity=Follow opportunity -ProjectFollowTasks=Follow tasks or time spent -Usage=Usage -UsageOpportunity=Usage: Opportunity -UsageTasks=Usage: Tasks -UsageBillTimeShort=Usage: Bill time -InvoiceToUse=Draft invoice to use -InterToUse=Draft intervention to use -NewInvoice=New invoice -NewInter=New intervention -OneLinePerTask=One line per task -OneLinePerPeriod=One line per period -OneLinePerTimeSpentLine=One line for each time spent declaration -RefTaskParent=Ref. Parent Task -ProfitIsCalculatedWith=Profit is calculated using -AddPersonToTask=Add also to tasks -UsageOrganizeEvent=Usage: Event Organization -PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE=Classify project as closed when all its tasks are completed (100%% progress) -PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE_help=Note: existing projects with all tasks at 100 %% progress won't be affected: you will have to close them manually. This option only affects open projects. -SelectLinesOfTimeSpentToInvoice=Select lines of time spent that are unbilled, then bulk action "Generate Invoice" to bill them diff --git a/htdocs/langs/ar_IQ/propal.lang b/htdocs/langs/ar_IQ/propal.lang deleted file mode 100644 index edbc08236d3..00000000000 --- a/htdocs/langs/ar_IQ/propal.lang +++ /dev/null @@ -1,92 +0,0 @@ -# Dolibarr language file - Source file is en_US - propal -Proposals=Commercial proposals -Proposal=Commercial proposal -ProposalShort=Proposal -ProposalsDraft=Draft commercial proposals -ProposalsOpened=Open commercial proposals -CommercialProposal=Commercial proposal -PdfCommercialProposalTitle=Commercial proposal -ProposalCard=Proposal card -NewProp=New commercial proposal -NewPropal=New proposal -Prospect=Prospect -DeleteProp=Delete commercial proposal -ValidateProp=Validate commercial proposal -AddProp=Create proposal -ConfirmDeleteProp=Are you sure you want to delete this commercial proposal? -ConfirmValidateProp=Are you sure you want to validate this commercial proposal under name %s? -LastPropals=Latest %s proposals -LastModifiedProposals=Latest %s modified proposals -AllPropals=All proposals -SearchAProposal=Search a proposal -NoProposal=No proposal -ProposalsStatistics=Commercial proposal's statistics -NumberOfProposalsByMonth=Number by month -AmountOfProposalsByMonthHT=Amount by month (excl. tax) -NbOfProposals=Number of commercial proposals -ShowPropal=Show proposal -PropalsDraft=Drafts -PropalsOpened=Open -PropalStatusDraft=Draft (needs to be validated) -PropalStatusValidated=Validated (proposal is open) -PropalStatusSigned=Signed (needs billing) -PropalStatusNotSigned=Not signed (closed) -PropalStatusBilled=Billed -PropalStatusDraftShort=Draft -PropalStatusValidatedShort=Validated (open) -PropalStatusClosedShort=Closed -PropalStatusSignedShort=Signed -PropalStatusNotSignedShort=Not signed -PropalStatusBilledShort=Billed -PropalsToClose=Commercial proposals to close -PropalsToBill=Signed commercial proposals to bill -ListOfProposals=List of commercial proposals -ActionsOnPropal=Events on proposal -RefProposal=Commercial proposal ref -SendPropalByMail=Send commercial proposal by mail -DatePropal=Date of proposal -DateEndPropal=Validity ending date -ValidityDuration=Validity duration -SetAcceptedRefused=Set accepted/refused -ErrorPropalNotFound=Propal %s not found -AddToDraftProposals=Add to draft proposal -NoDraftProposals=No draft proposals -CopyPropalFrom=Create commercial proposal by copying existing proposal -CreateEmptyPropal=Create empty commercial proposal or from list of products/services -DefaultProposalDurationValidity=Default commercial proposal validity duration (in days) -UseCustomerContactAsPropalRecipientIfExist=Use contact/address with type 'Contact following-up proposal' if defined instead of third party address as proposal recipient address -ConfirmClonePropal=Are you sure you want to clone the commercial proposal %s? -ConfirmReOpenProp=Are you sure you want to open back the commercial proposal %s? -ProposalsAndProposalsLines=Commercial proposal and lines -ProposalLine=Proposal line -ProposalLines=Proposal lines -AvailabilityPeriod=Availability delay -SetAvailability=Set availability delay -AfterOrder=after order -OtherProposals=Other proposals -##### Availability ##### -AvailabilityTypeAV_NOW=Immediate -AvailabilityTypeAV_1W=1 week -AvailabilityTypeAV_2W=2 weeks -AvailabilityTypeAV_3W=3 weeks -AvailabilityTypeAV_1M=1 month -##### Types de contacts ##### -TypeContact_propal_internal_SALESREPFOLL=Representative following-up proposal -TypeContact_propal_external_BILLING=Customer invoice contact -TypeContact_propal_external_CUSTOMER=Customer contact following-up proposal -TypeContact_propal_external_SHIPPING=Customer contact for delivery -# Document models -DocModelAzurDescription=A complete proposal model (old implementation of Cyan template) -DocModelCyanDescription=A complete proposal model -DefaultModelPropalCreate=Default model creation -DefaultModelPropalToBill=Default template when closing a business proposal (to be invoiced) -DefaultModelPropalClosed=Default template when closing a business proposal (unbilled) -ProposalCustomerSignature=Written acceptance, company stamp, date and signature -ProposalsStatisticsSuppliers=Vendor proposals statistics -CaseFollowedBy=Case followed by -SignedOnly=Signed only -IdProposal=Proposal ID -IdProduct=Product ID -PrParentLine=Proposal Parent Line -LineBuyPriceHT=Buy Price Amount net of tax for line - diff --git a/htdocs/langs/ar_IQ/receiptprinter.lang b/htdocs/langs/ar_IQ/receiptprinter.lang deleted file mode 100644 index 746d175e0c6..00000000000 --- a/htdocs/langs/ar_IQ/receiptprinter.lang +++ /dev/null @@ -1,82 +0,0 @@ -# Dolibarr language file - Source file is en_US - receiptprinter -ReceiptPrinterSetup=Setup of module ReceiptPrinter -PrinterAdded=Printer %s added -PrinterUpdated=Printer %s updated -PrinterDeleted=Printer %s deleted -TestSentToPrinter=Test Sent To Printer %s -ReceiptPrinter=Receipt printers -ReceiptPrinterDesc=Setup of receipt printers -ReceiptPrinterTemplateDesc=Setup of Templates -ReceiptPrinterTypeDesc=Description of Receipt Printer's type -ReceiptPrinterProfileDesc=Description of Receipt Printer's Profile -ListPrinters=List of Printers -SetupReceiptTemplate=Template Setup -CONNECTOR_DUMMY=Dummy Printer -CONNECTOR_NETWORK_PRINT=Network Printer -CONNECTOR_FILE_PRINT=Local Printer -CONNECTOR_WINDOWS_PRINT=Local Windows Printer -CONNECTOR_CUPS_PRINT=Cups Printer -CONNECTOR_DUMMY_HELP=Fake Printer for test, does nothing -CONNECTOR_NETWORK_PRINT_HELP=10.x.x.x:9100 -CONNECTOR_FILE_PRINT_HELP=/dev/usb/lp0, /dev/usb/lp1 -CONNECTOR_WINDOWS_PRINT_HELP=LPT1, COM1, smb://FooUser:secret@computername/workgroup/Receipt Printer -CONNECTOR_CUPS_PRINT_HELP=CUPS printer name, example: HPRT_TP805L -PROFILE_DEFAULT=Default Profile -PROFILE_SIMPLE=Simple Profile -PROFILE_EPOSTEP=Epos Tep Profile -PROFILE_P822D=P822D Profile -PROFILE_STAR=Star Profile -PROFILE_DEFAULT_HELP=Default Profile suitable for Epson printers -PROFILE_SIMPLE_HELP=Simple Profile No Graphics -PROFILE_EPOSTEP_HELP=Epos Tep Profile -PROFILE_P822D_HELP=P822D Profile No Graphics -PROFILE_STAR_HELP=Star Profile -DOL_LINE_FEED=Skip line -DOL_ALIGN_LEFT=Left align text -DOL_ALIGN_CENTER=Center text -DOL_ALIGN_RIGHT=Right align text -DOL_USE_FONT_A=Use font A of printer -DOL_USE_FONT_B=Use font B of printer -DOL_USE_FONT_C=Use font C of printer -DOL_PRINT_BARCODE=Print barcode -DOL_PRINT_BARCODE_CUSTOMER_ID=Print barcode customer id -DOL_CUT_PAPER_FULL=Cut ticket completely -DOL_CUT_PAPER_PARTIAL=Cut ticket partially -DOL_OPEN_DRAWER=Open cash drawer -DOL_ACTIVATE_BUZZER=Activate buzzer -DOL_PRINT_QRCODE=Print QR Code -DOL_PRINT_LOGO=Print logo of my company -DOL_PRINT_LOGO_OLD=Print logo of my company (old printers) -DOL_BOLD=Bold -DOL_BOLD_DISABLED=Disable bold -DOL_DOUBLE_HEIGHT=Double height size -DOL_DOUBLE_WIDTH=Double width size -DOL_DEFAULT_HEIGHT_WIDTH=Default height and width size -DOL_UNDERLINE=Enable underline -DOL_UNDERLINE_DISABLED=Disable underline -DOL_BEEP=Beep sound -DOL_PRINT_TEXT=Print text -DateInvoiceWithTime=Invoice date and time -YearInvoice=Invoice year -DOL_VALUE_MONTH_LETTERS=Invoice month in letters -DOL_VALUE_MONTH=Invoice month -DOL_VALUE_DAY=Invoice day -DOL_VALUE_DAY_LETTERS=Inovice day in letters -DOL_LINE_FEED_REVERSE=Line feed reverse -InvoiceID=Invoice ID -InvoiceRef=Invoice ref -DOL_PRINT_OBJECT_LINES=Invoice lines -DOL_VALUE_CUSTOMER_FIRSTNAME=Customer first name -DOL_VALUE_CUSTOMER_LASTNAME=Customer last name -DOL_VALUE_CUSTOMER_MAIL=Customer mail -DOL_VALUE_CUSTOMER_PHONE=Customer phone -DOL_VALUE_CUSTOMER_MOBILE=Customer mobile -DOL_VALUE_CUSTOMER_SKYPE=Customer Skype -DOL_VALUE_CUSTOMER_TAX_NUMBER=Customer tax number -DOL_VALUE_CUSTOMER_ACCOUNT_BALANCE=Customer account balance -DOL_VALUE_MYSOC_NAME=Your company name -VendorLastname=Vendor last name -VendorFirstname=Vendor first name -VendorEmail=Vendor email -DOL_VALUE_CUSTOMER_POINTS=Customer points -DOL_VALUE_OBJECT_POINTS=Object points diff --git a/htdocs/langs/ar_IQ/receptions.lang b/htdocs/langs/ar_IQ/receptions.lang deleted file mode 100644 index 338602e722e..00000000000 --- a/htdocs/langs/ar_IQ/receptions.lang +++ /dev/null @@ -1,47 +0,0 @@ -# Dolibarr language file - Source file is en_US - receptions -ReceptionsSetup=Product Reception setup -RefReception=Ref. reception -Reception=Reception -Receptions=Receptions -AllReceptions=All Receptions -Reception=Reception -Receptions=Receptions -ShowReception=Show Receptions -ReceptionsArea=Receptions area -ListOfReceptions=List of receptions -ReceptionMethod=Reception method -LastReceptions=Latest %s receptions -StatisticsOfReceptions=Statistics for receptions -NbOfReceptions=Number of receptions -NumberOfReceptionsByMonth=Number of receptions by month -ReceptionCard=Reception card -NewReception=New reception -CreateReception=Create reception -QtyInOtherReceptions=Qty in other receptions -OtherReceptionsForSameOrder=Other receptions for this order -ReceptionsAndReceivingForSameOrder=Receptions and receipts for this order -ReceptionsToValidate=Receptions to validate -StatusReceptionCanceled=Canceled -StatusReceptionDraft=Draft -StatusReceptionValidated=Validated (products to ship or already shipped) -StatusReceptionProcessed=Processed -StatusReceptionDraftShort=Draft -StatusReceptionValidatedShort=Validated -StatusReceptionProcessedShort=Processed -ReceptionSheet=Reception sheet -ConfirmDeleteReception=Are you sure you want to delete this reception? -ConfirmValidateReception=Are you sure you want to validate this reception with reference %s? -ConfirmCancelReception=Are you sure you want to cancel this reception? -StatsOnReceptionsOnlyValidated=Statistics conducted on receptions only validated. Date used is date of validation of reception (planed delivery date is not always known). -SendReceptionByEMail=Send reception by email -SendReceptionRef=Submission of reception %s -ActionsOnReception=Events on reception -ReceptionCreationIsDoneFromOrder=For the moment, creation of a new reception is done from the order card. -ReceptionLine=Reception line -ProductQtyInReceptionAlreadySent=Product quantity from open sales order already sent -ProductQtyInSuppliersReceptionAlreadyRecevied=Product quantity from open supplier order already received -ValidateOrderFirstBeforeReception=You must first validate the order before being able to make receptions. -ReceptionsNumberingModules=Numbering module for receptions -ReceptionsReceiptModel=Document templates for receptions -NoMorePredefinedProductToDispatch=No more predefined products to dispatch -ReceptionExist=A reception exists diff --git a/htdocs/langs/ar_IQ/recruitment.lang b/htdocs/langs/ar_IQ/recruitment.lang deleted file mode 100644 index 6b0e8117254..00000000000 --- a/htdocs/langs/ar_IQ/recruitment.lang +++ /dev/null @@ -1,76 +0,0 @@ -# Copyright (C) 2020 Laurent Destailleur -# -# 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 . - -# -# Generic -# - -# Module label 'ModuleRecruitmentName' -ModuleRecruitmentName = Recruitment -# Module description 'ModuleRecruitmentDesc' -ModuleRecruitmentDesc = Manage and follow recruitment campaigns for new job positions - -# -# Admin page -# -RecruitmentSetup = Recruitment setup -Settings = Settings -RecruitmentSetupPage = Enter here the setup of main options for the recruitment module -RecruitmentArea=Recruitement area -PublicInterfaceRecruitmentDesc=Public pages of jobs are public URLs to show and answer to open jobs. There is one different link for each open job, found on each job record. -EnablePublicRecruitmentPages=Enable public pages of open jobs - -# -# About page -# -About = About -RecruitmentAbout = About Recruitment -RecruitmentAboutPage = Recruitment about page -NbOfEmployeesExpected=Expected nb of employees -JobLabel=Label of job position -WorkPlace=Work place -DateExpected=Expected date -FutureManager=Future manager -ResponsibleOfRecruitement=Responsible of recruitment -IfJobIsLocatedAtAPartner=If job is located at a partner place -PositionToBeFilled=Job position -PositionsToBeFilled=Job positions -ListOfPositionsToBeFilled=List of job positions -NewPositionToBeFilled=New job positions - -JobOfferToBeFilled=Job position to be filled -ThisIsInformationOnJobPosition=Information of the job position to be filled -ContactForRecruitment=Contact for recruitment -EmailRecruiter=Email recruiter -ToUseAGenericEmail=To use a generic email. If not defined, the email of the responsible of recruitment will be used -NewCandidature=New application -ListOfCandidatures=List of applications -RequestedRemuneration=Requested remuneration -ProposedRemuneration=Proposed remuneration -ContractProposed=Contract proposed -ContractSigned=Contract signed -ContractRefused=Contract refused -RecruitmentCandidature=Application -JobPositions=Job positions -RecruitmentCandidatures=Applications -InterviewToDo=Interview to do -AnswerCandidature=Application answer -YourCandidature=Your application -YourCandidatureAnswerMessage=Thanks you for your application.
    ... -JobClosedTextCandidateFound=The job position is closed. The position has been filled. -JobClosedTextCanceled=The job position is closed. -ExtrafieldsJobPosition=Complementary attributes (job positions) -ExtrafieldsApplication=Complementary attributes (job applications) -MakeOffer=Make an offer diff --git a/htdocs/langs/ar_IQ/resource.lang b/htdocs/langs/ar_IQ/resource.lang deleted file mode 100644 index e8574dc680f..00000000000 --- a/htdocs/langs/ar_IQ/resource.lang +++ /dev/null @@ -1,39 +0,0 @@ -# Dolibarr language file - Source file is en_US - resource -MenuResourceIndex=Resources -MenuResourceAdd=New resource -DeleteResource=Delete resource -ConfirmDeleteResourceElement=Confirm delete the resource for this element -NoResourceInDatabase=No resource in database. -NoResourceLinked=No resource linked -ActionsOnResource=Events about this resource -ResourcePageIndex=Resources list -ResourceSingular=Resource -ResourceCard=Resource card -AddResource=Create a resource -ResourceFormLabel_ref=Resource name -ResourceType=Resource type -ResourceFormLabel_description=Resource description - -ResourcesLinkedToElement=Resources linked to element - -ShowResource=Show resource - -ResourceElementPage=Element resources -ResourceCreatedWithSuccess=Resource successfully created -RessourceLineSuccessfullyDeleted=Resource line successfully deleted -RessourceLineSuccessfullyUpdated=Resource line successfully updated -ResourceLinkedWithSuccess=Resource linked with success - -ConfirmDeleteResource=Confirm to delete this resource -RessourceSuccessfullyDeleted=Resource successfully deleted -DictionaryResourceType=Type of resources - -SelectResource=Select resource - -IdResource=Id resource -AssetNumber=Serial number -ResourceTypeCode=Resource type code -ImportDataset_resource_1=Resources - -ErrorResourcesAlreadyInUse=Some resources are in use -ErrorResourceUseInEvent=%s used in %s event diff --git a/htdocs/langs/ar_IQ/salaries.lang b/htdocs/langs/ar_IQ/salaries.lang deleted file mode 100644 index 12905040b1a..00000000000 --- a/htdocs/langs/ar_IQ/salaries.lang +++ /dev/null @@ -1,24 +0,0 @@ -# Dolibarr language file - Source file is en_US - salaries -SALARIES_ACCOUNTING_ACCOUNT_PAYMENT=Accounting account used for user third parties -SALARIES_ACCOUNTING_ACCOUNT_PAYMENT_Desc=The dedicated accounting account defined on user card will be used for Subledger accounting only. This one will be used for General Ledger and as default value of Subledger accounting if dedicated user accounting account on user is not defined. -SALARIES_ACCOUNTING_ACCOUNT_CHARGE=Accounting account by default for wage payments -CREATE_NEW_SALARY_WITHOUT_AUTO_PAYMENT=By default, leave empty the option "Automatically create a total payment" when creating a Salary -Salary=Salary -Salaries=Salaries -NewSalary=New salary -NewSalaryPayment=New salary card -AddSalaryPayment=Add salary payment -SalaryPayment=Salary payment -SalariesPayments=Salaries payments -SalariesPaymentsOf=Salaries payments of %s -ShowSalaryPayment=Show salary payment -THM=Average hourly rate -TJM=Average daily rate -CurrentSalary=Current salary -THMDescription=This value may be used to calculate the cost of time consumed on a project entered by users if module project is used -TJMDescription=This value is currently for information only and is not used for any calculation -LastSalaries=Latest %s salaries -AllSalaries=All salaries -SalariesStatistics=Salary statistics -SalariesAndPayments=Salaries and payments -ConfirmDeleteSalaryPayment=Do you want to delete this salary payment ? diff --git a/htdocs/langs/ar_IQ/sendings.lang b/htdocs/langs/ar_IQ/sendings.lang index b94891d79c5..47082ac4ba4 100644 --- a/htdocs/langs/ar_IQ/sendings.lang +++ b/htdocs/langs/ar_IQ/sendings.lang @@ -1,76 +1,2 @@ # Dolibarr language file - Source file is en_US - sendings -RefSending=Ref. shipment -Sending=Shipment -Sendings=Shipments -AllSendings=All Shipments -Shipment=Shipment -Shipments=Shipments -ShowSending=Show Shipments -Receivings=Delivery Receipts -SendingsArea=Shipments area -ListOfSendings=List of shipments -SendingMethod=Shipping method -LastSendings=Latest %s shipments -StatisticsOfSendings=Statistics for shipments -NbOfSendings=Number of shipments -NumberOfShipmentsByMonth=Number of shipments by month -SendingCard=Shipment card -NewSending=New shipment -CreateShipment=Create shipment -QtyShipped=Qty shipped -QtyShippedShort=Qty ship. -QtyPreparedOrShipped=Qty prepared or shipped -QtyToShip=Qty to ship -QtyToReceive=Qty to receive -QtyReceived=Qty received -QtyInOtherShipments=Qty in other shipments -KeepToShip=Remain to ship -KeepToShipShort=Remain -OtherSendingsForSameOrder=Other shipments for this order -SendingsAndReceivingForSameOrder=Shipments and receipts for this order -SendingsToValidate=Shipments to validate -StatusSendingCanceled=Canceled -StatusSendingCanceledShort=Canceled -StatusSendingDraft=Draft -StatusSendingValidated=Validated (products to ship or already shipped) -StatusSendingProcessed=Processed -StatusSendingDraftShort=Draft -StatusSendingValidatedShort=Validated -StatusSendingProcessedShort=Processed -SendingSheet=Shipment sheet -ConfirmDeleteSending=Are you sure you want to delete this shipment? -ConfirmValidateSending=Are you sure you want to validate this shipment with reference %s? -ConfirmCancelSending=Are you sure you want to cancel this shipment? -DocumentModelMerou=Merou A5 model -WarningNoQtyLeftToSend=Warning, no products waiting to be shipped. -StatsOnShipmentsOnlyValidated=Statistics are only for validated shipments. Date used is the date of validation of shipment (planned delivery date is not always known) -DateDeliveryPlanned=Planned date of delivery -RefDeliveryReceipt=Ref delivery receipt -StatusReceipt=Status delivery receipt -DateReceived=Date delivery received -ClassifyReception=Classify reception -SendShippingByEMail=Send shipment by email -SendShippingRef=Submission of shipment %s -ActionsOnShipping=Events on shipment -LinkToTrackYourPackage=Link to track your package ShipmentCreationIsDoneFromOrder=For the moment, creation of a new shipment is done from the order card. -ShipmentLine=Shipment line -ProductQtyInCustomersOrdersRunning=Product quantity from open sales orders -ProductQtyInSuppliersOrdersRunning=Product quantity from open purchase orders -ProductQtyInShipmentAlreadySent=Product quantity from open sales order already sent -ProductQtyInSuppliersShipmentAlreadyRecevied=Product quantity from open purchase orders already received -NoProductToShipFoundIntoStock=No product to ship found in warehouse %s. Correct stock or go back to choose another warehouse. -WeightVolShort=Weight/Vol. -ValidateOrderFirstBeforeShipment=You must first validate the order before being able to make shipments. - -# Sending methods -# ModelDocument -DocumentModelTyphon=More complete document model for delivery receipts (logo...) -DocumentModelStorm=More complete document model for delivery receipts and extrafields compatibility (logo...) -Error_EXPEDITION_ADDON_NUMBER_NotDefined=Constant EXPEDITION_ADDON_NUMBER not defined -SumOfProductVolumes=Sum of product volumes -SumOfProductWeights=Sum of product weights - -# warehouse details -DetailWarehouseNumber= Warehouse details -DetailWarehouseFormat= W:%s (Qty: %d) diff --git a/htdocs/langs/ar_IQ/sms.lang b/htdocs/langs/ar_IQ/sms.lang deleted file mode 100644 index 055085eb16a..00000000000 --- a/htdocs/langs/ar_IQ/sms.lang +++ /dev/null @@ -1,51 +0,0 @@ -# Dolibarr language file - Source file is en_US - sms -Sms=Sms -SmsSetup=SMS setup -SmsDesc=This page allows you to define global options on SMS features -SmsCard=SMS Card -AllSms=All SMS campaigns -SmsTargets=Targets -SmsRecipients=Targets -SmsRecipient=Target -SmsTitle=Description -SmsFrom=Sender -SmsTo=Target -SmsTopic=Topic of SMS -SmsText=Message -SmsMessage=SMS Message -ShowSms=Show SMS -ListOfSms=List SMS campaigns -NewSms=New SMS campaign -EditSms=Edit SMS -ResetSms=New sending -DeleteSms=Delete SMS campaign -DeleteASms=Remove a SMS campaign -PreviewSms=Previuw SMS -PrepareSms=Prepare SMS -CreateSms=Create SMS -SmsResult=Result of SMS sending -TestSms=Test SMS -ValidSms=Validate SMS -ApproveSms=Approve SMS -SmsStatusDraft=Draft -SmsStatusValidated=Validated -SmsStatusApproved=Approved -SmsStatusSent=Sent -SmsStatusSentPartialy=Sent partially -SmsStatusSentCompletely=Sent completely -SmsStatusError=Error -SmsStatusNotSent=Not sent -SmsSuccessfulySent=SMS correctly sent (from %s to %s) -ErrorSmsRecipientIsEmpty=Number of target is empty -WarningNoSmsAdded=No new phone number to add to target list -ConfirmValidSms=Do you confirm validation of this campaign? -NbOfUniqueSms=No. of unique phone numbers -NbOfSms=No. of phone numbers -ThisIsATestMessage=This is a test message -SendSms=Send SMS -SmsInfoCharRemain=No. of remaining characters -SmsInfoNumero= (international format i.e.: +33899701761) -DelayBeforeSending=Delay before sending (minutes) -SmsNoPossibleSenderFound=No sender available. Check setup of your SMS provider. -SmsNoPossibleRecipientFound=No target available. Check setup of your SMS provider. -DisableStopIfSupported=Disable STOP message (if supported) diff --git a/htdocs/langs/ar_IQ/stocks.lang b/htdocs/langs/ar_IQ/stocks.lang index c1f0abc43a8..a95d0f1b7cd 100644 --- a/htdocs/langs/ar_IQ/stocks.lang +++ b/htdocs/langs/ar_IQ/stocks.lang @@ -1,263 +1,4 @@ # Dolibarr language file - Source file is en_US - stocks -WarehouseCard=Warehouse card -Warehouse=Warehouse -Warehouses=Warehouses -ParentWarehouse=Parent warehouse -NewWarehouse=New warehouse / Stock Location -WarehouseEdit=Modify warehouse -MenuNewWarehouse=New warehouse -WarehouseSource=Source warehouse -WarehouseSourceNotDefined=No warehouse defined, -AddWarehouse=Create warehouse -AddOne=Add one -DefaultWarehouse=Default warehouse -WarehouseTarget=Target warehouse ValidateSending=Delete sending CancelSending=Cancel sending DeleteSending=Delete sending -Stock=Stock -Stocks=Stocks -MissingStocks=Missing stocks -StockAtDate=Stocks at date -StockAtDateInPast=Date in the past -StockAtDateInFuture=Date in the future -StocksByLotSerial=Stocks by lot/serial -LotSerial=Lots/Serials -LotSerialList=List of lot/serials -Movements=Movements -ErrorWarehouseRefRequired=Warehouse reference name is required -ListOfWarehouses=List of warehouses -ListOfStockMovements=List of stock movements -ListOfInventories=List of inventories -MovementId=Movement ID -StockMovementForId=Movement ID %d -ListMouvementStockProject=List of stock movements associated to project -StocksArea=Warehouses area -AllWarehouses=All warehouses -IncludeEmptyDesiredStock=Include also negative stock with undefined desired stock -IncludeAlsoDraftOrders=Include also draft orders -Location=Location -LocationSummary=Short name of location -NumberOfDifferentProducts=Number of unique products -NumberOfProducts=Total number of products -LastMovement=Latest movement -LastMovements=Latest movements -Units=Units -Unit=Unit -StockCorrection=Stock correction -CorrectStock=Correct stock -StockTransfer=Stock transfer -TransferStock=Transfer stock -MassStockTransferShort=Mass stock transfer -StockMovement=Stock movement -StockMovements=Stock movements -NumberOfUnit=Number of units -UnitPurchaseValue=Unit purchase price -StockTooLow=Stock too low -StockLowerThanLimit=Stock lower than alert limit (%s) -EnhancedValue=Value -EnhancedValueOfWarehouses=Warehouses value -UserWarehouseAutoCreate=Create a user warehouse automatically when creating a user -AllowAddLimitStockByWarehouse=Manage also value for minimum and desired stock per pairing (product-warehouse) in addition to the value for minimum and desired stock per product -RuleForWarehouse=Rule for warehouses -WarehouseAskWarehouseOnThirparty=Set a warehouse on Third-parties -WarehouseAskWarehouseDuringPropal=Set a warehouse on Commercial proposals -WarehouseAskWarehouseDuringOrder=Set a warehouse on Sale orders -UserDefaultWarehouse=Set a warehouse on Users -MainDefaultWarehouse=Default warehouse -MainDefaultWarehouseUser=Use a default warehouse for each user -MainDefaultWarehouseUserDesc=By activating this option, during creation of a product, the warehouse assigned to the product will be defined on this one. If no warehouse is defined on the user, the default warehouse is defined. -IndependantSubProductStock=Product stock and subproduct stock are independent -QtyDispatched=Quantity dispatched -QtyDispatchedShort=Qty dispatched -QtyToDispatchShort=Qty to dispatch -OrderDispatch=Item receipts -RuleForStockManagementDecrease=Choose Rule for automatic stock decrease (manual decrease is always possible, even if an automatic decrease rule is activated) -RuleForStockManagementIncrease=Choose Rule for automatic stock increase (manual increase is always possible, even if an automatic increase rule is activated) -DeStockOnBill=Decrease real stocks on validation of customer invoice/credit note -DeStockOnValidateOrder=Decrease real stocks on validation of sales order -DeStockOnShipment=Decrease real stocks on shipping validation -DeStockOnShipmentOnClosing=Decrease real stocks when shipping is set to closed -ReStockOnBill=Increase real stocks on validation of vendor invoice/credit note -ReStockOnValidateOrder=Increase real stocks on purchase order approval -ReStockOnDispatchOrder=Increase real stocks on manual dispatching into warehouse, after purchase order receipt of goods -StockOnReception=Increase real stocks on validation of reception -StockOnReceptionOnClosing=Increase real stocks when reception is set to closed -OrderStatusNotReadyToDispatch=Order has not yet or no more a status that allows dispatching of products in stock warehouses. -StockDiffPhysicTeoric=Explanation for difference between physical and virtual stock -NoPredefinedProductToDispatch=No predefined products for this object. So no dispatching in stock is required. -DispatchVerb=Dispatch -StockLimitShort=Limit for alert -StockLimit=Stock limit for alert -StockLimitDesc=(empty) means no warning.
    0 can be used to trigger a warning as soon as the stock is empty. -PhysicalStock=Physical Stock -RealStock=Real Stock -RealStockDesc=Physical/real stock is the stock currently in the warehouses. -RealStockWillAutomaticallyWhen=The real stock will be modified according to this rule (as defined in the Stock module): -VirtualStock=Virtual stock -VirtualStockAtDate=Virtual stock at date -VirtualStockAtDateDesc=Virtual stock once all the pending orders that are planned to be processed before the chosen date will be finished -VirtualStockDesc=Virtual stock is the calculated stock available once all open/pending actions (that affect stocks) are closed (purchase orders received, sales orders shipped, manufacturing orders produced, etc) -AtDate=At date -IdWarehouse=Id warehouse -DescWareHouse=Description warehouse -LieuWareHouse=Localisation warehouse -WarehousesAndProducts=Warehouses and products -WarehousesAndProductsBatchDetail=Warehouses and products (with detail per lot/serial) -AverageUnitPricePMPShort=Weighted average price -AverageUnitPricePMPDesc=The input average unit price we had to expense to get 1 unit of product into our stock. -SellPriceMin=Selling Unit Price -EstimatedStockValueSellShort=Value for sell -EstimatedStockValueSell=Value for sell -EstimatedStockValueShort=Input stock value -EstimatedStockValue=Input stock value -DeleteAWarehouse=Delete a warehouse -ConfirmDeleteWarehouse=Are you sure you want to delete the warehouse %s? -PersonalStock=Personal stock %s -ThisWarehouseIsPersonalStock=This warehouse represents personal stock of %s %s -SelectWarehouseForStockDecrease=Choose warehouse to use for stock decrease -SelectWarehouseForStockIncrease=Choose warehouse to use for stock increase -NoStockAction=No stock action -DesiredStock=Desired Stock -DesiredStockDesc=This stock amount will be the value used to fill the stock by replenishment feature. -StockToBuy=To order -Replenishment=Replenishment -ReplenishmentOrders=Replenishment orders -VirtualDiffersFromPhysical=According to increase/decrease stock options, physical stock and virtual stock (physical stock + open orders) may differ -UseRealStockByDefault=Use real stock, instead of virtual stock, for replenishment feature -ReplenishmentCalculation=Amount to order will be (desired quantity - real stock) instead of (desired quantity - virtual stock) -UseVirtualStock=Use virtual stock -UsePhysicalStock=Use physical stock -CurentSelectionMode=Current selection mode -CurentlyUsingVirtualStock=Virtual stock -CurentlyUsingPhysicalStock=Physical stock -RuleForStockReplenishment=Rule for stocks replenishment -SelectProductWithNotNullQty=Select at least one product with a qty not null and a vendor -AlertOnly= Alerts only -IncludeProductWithUndefinedAlerts = Include also negative stock for products with no desired quantity defined, to restore them to 0 -WarehouseForStockDecrease=The warehouse %s will be used for stock decrease -WarehouseForStockIncrease=The warehouse %s will be used for stock increase -ForThisWarehouse=For this warehouse -ReplenishmentStatusDesc=This is a list of all products with a stock lower than desired stock (or lower than alert value if checkbox "alert only" is checked). Using the checkbox, you can create purchase orders to fill the difference. -ReplenishmentStatusDescPerWarehouse=If you want a replenishment based on desired quantity defined per warehouse, you must add a filter on the warehouse. -ReplenishmentOrdersDesc=This is a list of all open purchase orders including predefined products. Only open orders with predefined products, so orders that may affect stocks, are visible here. -Replenishments=Replenishments -NbOfProductBeforePeriod=Quantity of product %s in stock before selected period (< %s) -NbOfProductAfterPeriod=Quantity of product %s in stock after selected period (> %s) -MassMovement=Mass movement -SelectProductInAndOutWareHouse=Select a source warehouse and a target warehouse, a product and a quantity then click "%s". Once this is done for all required movements, click on "%s". -RecordMovement=Record transfer -ReceivingForSameOrder=Receipts for this order -StockMovementRecorded=Stock movements recorded -RuleForStockAvailability=Rules on stock requirements -StockMustBeEnoughForInvoice=Stock level must be enough to add product/service to invoice (check is done on current real stock when adding a line into invoice whatever the rule for automatic stock change) -StockMustBeEnoughForOrder=Stock level must be enough to add product/service to order (check is done on current real stock when adding a line into order whatever the rule for automatic stock change) -StockMustBeEnoughForShipment= Stock level must be enough to add product/service to shipment (check is done on current real stock when adding a line into shipment whatever the rule for automatic stock change) -MovementLabel=Label of movement -TypeMovement=Direction of movement -DateMovement=Date of movement -InventoryCode=Movement or inventory code -IsInPackage=Contained into package -WarehouseAllowNegativeTransfer=Stock can be negative -qtyToTranferIsNotEnough=You don't have enough stock from your source warehouse and your setup does not allow negative stocks. -qtyToTranferLotIsNotEnough=You don't have enough stock, for this lot number, from your source warehouse and your setup does not allow negative stocks (Qty for product '%s' with lot '%s' is %s in warehouse '%s'). -ShowWarehouse=Show warehouse -MovementCorrectStock=Stock correction for product %s -MovementTransferStock=Stock transfer of product %s into another warehouse -InventoryCodeShort=Inv./Mov. code -NoPendingReceptionOnSupplierOrder=No pending reception due to open purchase order -ThisSerialAlreadyExistWithDifferentDate=This lot/serial number (%s) already exists but with different eatby or sellby date (found %s but you enter %s). -OpenAnyMovement=Open (all movement) -OpenInternal=Open (only internal movement) -UseDispatchStatus=Use a dispatch status (approve/refuse) for product lines on purchase order reception -OptionMULTIPRICESIsOn=Option "several prices per segment" is on. It means a product has several selling price so value for sell can't be calculated -ProductStockWarehouseCreated=Stock limit for alert and desired optimal stock correctly created -ProductStockWarehouseUpdated=Stock limit for alert and desired optimal stock correctly updated -ProductStockWarehouseDeleted=Stock limit for alert and desired optimal stock correctly deleted -AddNewProductStockWarehouse=Set new limit for alert and desired optimal stock -AddStockLocationLine=Decrease quantity then click to add another warehouse for this product -InventoryDate=Inventory date -NewInventory=New inventory -inventorySetup = Inventory Setup -inventoryCreatePermission=Create new inventory -inventoryReadPermission=View inventories -inventoryWritePermission=Update inventories -inventoryValidatePermission=Validate inventory -inventoryDeletePermission=Delete inventory -inventoryTitle=Inventory -inventoryListTitle=Inventories -inventoryListEmpty=No inventory in progress -inventoryCreateDelete=Create/Delete inventory -inventoryCreate=Create new -inventoryEdit=Edit -inventoryValidate=Validated -inventoryDraft=Running -inventorySelectWarehouse=Warehouse choice -inventoryConfirmCreate=Create -inventoryOfWarehouse=Inventory for warehouse: %s -inventoryErrorQtyAdd=Error: one quantity is less than zero -inventoryMvtStock=By inventory -inventoryWarningProductAlreadyExists=This product is already into list -SelectCategory=Category filter -SelectFournisseur=Vendor filter -inventoryOnDate=Inventory -INVENTORY_USE_INVENTORY_DATE_FOR_DATE_OF_MVT=Stock movements will have the date of inventory (instead of the date of inventory validation) -inventoryChangePMPPermission=Allow to change PMP value for a product -ColumnNewPMP=New unit PMP -OnlyProdsInStock=Do not add product without stock -TheoricalQty=Theorique qty -TheoricalValue=Theorique qty -LastPA=Last BP -CurrentPA=Curent BP -RecordedQty=Recorded Qty -RealQty=Real Qty -RealValue=Real Value -RegulatedQty=Regulated Qty -AddInventoryProduct=Add product to inventory -AddProduct=Add -ApplyPMP=Apply PMP -FlushInventory=Flush inventory -ConfirmFlushInventory=Do you confirm this action? -InventoryFlushed=Inventory flushed -ExitEditMode=Exit edition -inventoryDeleteLine=Delete line -RegulateStock=Regulate Stock -ListInventory=List -StockSupportServices=Stock management supports Services -StockSupportServicesDesc=By default, you can stock only products of type "product". You may also stock a product of type "service" if both module Services and this option are enabled. -ReceiveProducts=Receive items -StockIncreaseAfterCorrectTransfer=Increase by correction/transfer -StockDecreaseAfterCorrectTransfer=Decrease by correction/transfer -StockIncrease=Stock increase -StockDecrease=Stock decrease -InventoryForASpecificWarehouse=Inventory for a specific warehouse -InventoryForASpecificProduct=Inventory for a specific product -StockIsRequiredToChooseWhichLotToUse=Stock is required to choose which lot to use -ForceTo=Force to -AlwaysShowFullArbo=Display full tree of warehouse on popup of warehouse links (Warning: This may decrease dramatically performances) -StockAtDatePastDesc=You can view here the stock (real stock) at a given date in the past -StockAtDateFutureDesc=You can view here the stock (virtual stock) at a given date in the future -CurrentStock=Current stock -InventoryRealQtyHelp=Set value to 0 to reset qty
    Keep field empty, or remove line, to keep unchanged -UpdateByScaning=Fill real qty by scaning -UpdateByScaningProductBarcode=Update by scan (product barcode) -UpdateByScaningLot=Update by scan (lot|serial barcode) -DisableStockChangeOfSubProduct=Deactivate the stock change for all the subproducts of this Kit during this movement. -ImportFromCSV=Import CSV list of movement -ChooseFileToImport=Upload file then click on the %s icon to select file as source import file... -SelectAStockMovementFileToImport=select a stock movement file to import -InfoTemplateImport=Uploaded file needs to have this format (* are mandatory fields):
    Source Warehouse* | Target Warehouse* | Product* | Quantity* | Lot/serial number
    CSV character separator must be "%s" -LabelOfInventoryMovemement=Inventory %s -ReOpen=Reopen -ConfirmFinish=Do you confirm the closing of the inventory ? This will generate all stock movements to update your stock to the real qty you entered into the inventory. -ObjectNotFound=%s not found -MakeMovementsAndClose=Generate movements and close -AutofillWithExpected=Fill real quantity with expected quantity -ShowAllBatchByDefault=By default, show batch details on product "stock" tab -CollapseBatchDetailHelp=You can set batch detail default display in stocks module configuration -FieldCannotBeNegative=Field "%s" cannot be negative -ErrorWrongBarcodemode=Unknown Barcode mode -ProductDoesNotExist=Product does not exist -ErrorSameBatchNumber=Same batch number found in inventory list -ProductBatchDoesNotExist=Product with batch/serial does not exist -ProductBarcodeDoesNotExist=Product with barcode does not exist diff --git a/htdocs/langs/ar_IQ/stripe.lang b/htdocs/langs/ar_IQ/stripe.lang deleted file mode 100644 index a536ffd81e7..00000000000 --- a/htdocs/langs/ar_IQ/stripe.lang +++ /dev/null @@ -1,71 +0,0 @@ -# Dolibarr language file - Source file is en_US - stripe -StripeSetup=Stripe module setup -StripeDesc=Offer customers a Stripe online payment page for payments with credit/cebit cards via Stripe. This can be used to allow your customers to make ad-hoc payments or for payments related to a particular Dolibarr object (invoice, order, ...) -StripeOrCBDoPayment=Pay with credit card or Stripe -FollowingUrlAreAvailableToMakePayments=Following URLs are available to offer a page to a customer to make a payment on Dolibarr objects -PaymentForm=Payment form -WelcomeOnPaymentPage=Welcome to our online payment service -ThisScreenAllowsYouToPay=This screen allow you to make an online payment to %s. -ThisIsInformationOnPayment=This is information on payment to do -ToComplete=To complete -YourEMail=Email to receive payment confirmation -STRIPE_PAYONLINE_SENDEMAIL=Email notification after a payment attempt (success or fail) -Creditor=Creditor -PaymentCode=Payment code -StripeDoPayment=Pay with Stripe -YouWillBeRedirectedOnStripe=You will be redirected on secured Stripe page to input you credit card information -Continue=Next -ToOfferALinkForOnlinePayment=URL for %s payment -ToOfferALinkForOnlinePaymentOnOrder=URL to offer a %s online payment page for a sales order -ToOfferALinkForOnlinePaymentOnInvoice=URL to offer a %s online payment page for a customer invoice -ToOfferALinkForOnlinePaymentOnContractLine=URL to offer a %s online payment page for a contract line -ToOfferALinkForOnlinePaymentOnFreeAmount=URL to offer a %s online payment page of any amount with no existing object -ToOfferALinkForOnlinePaymentOnMemberSubscription=URL to offer a %s online payment page for a member subscription -ToOfferALinkForOnlinePaymentOnDonation=URL to offer a %s online payment page for payment of a donation -YouCanAddTagOnUrl=You can also add url parameter &tag=value to any of those URL (mandatory only for payment not linked to an object) to add your own payment comment tag.
    For the URL of payments with no existing object, you may also add the parameter &noidempotency=1 so the same link with same tag can be used several times (some payment mode may limit the payment to 1 for each different link without this parameter) -SetupStripeToHavePaymentCreatedAutomatically=Setup your Stripe with url %s to have payment created automatically when validated by Stripe. -AccountParameter=Account parameters -UsageParameter=Usage parameters -InformationToFindParameters=Help to find your %s account information -STRIPE_CGI_URL_V2=Url of Stripe CGI module for payment -CSSUrlForPaymentForm=CSS style sheet url for payment form -NewStripePaymentReceived=New Stripe payment received -NewStripePaymentFailed=New Stripe payment tried but failed -FailedToChargeCard=Failed to charge card -STRIPE_TEST_SECRET_KEY=Secret test key -STRIPE_TEST_PUBLISHABLE_KEY=Publishable test key -STRIPE_TEST_WEBHOOK_KEY=Webhook test key -STRIPE_LIVE_SECRET_KEY=Secret live key -STRIPE_LIVE_PUBLISHABLE_KEY=Publishable live key -STRIPE_LIVE_WEBHOOK_KEY=Webhook live key -ONLINE_PAYMENT_WAREHOUSE=Stock to use for stock decrease when online payment is done
    (TODO When option to decrease stock is done on an action on invoice and the online payment generate itself the invoice ?) -StripeLiveEnabled=Stripe live enabled (otherwise test/sandbox mode) -StripeImportPayment=Import Stripe payments -ExampleOfTestCreditCard=Example of credit card for test: %s => valid, %s => error CVC, %s => expired, %s => charge fails -StripeGateways=Stripe gateways -OAUTH_STRIPE_TEST_ID=Stripe Connect Client ID (ca_...) -OAUTH_STRIPE_LIVE_ID=Stripe Connect Client ID (ca_...) -BankAccountForBankTransfer=Bank account for fund payouts -StripeAccount=Stripe account -StripeChargeList=List of Stripe charges -StripeTransactionList=List of Stripe transactions -StripeCustomerId=Stripe customer id -StripePaymentModes=Stripe payment modes -LocalID=Local ID -StripeID=Stripe ID -NameOnCard=Name on card -CardNumber=Card Number -ExpiryDate=Expiry Date -CVN=CVN -DeleteACard=Delete Card -ConfirmDeleteCard=Are you sure you want to delete this Credit or Debit card? -CreateCustomerOnStripe=Create customer on Stripe -CreateCardOnStripe=Create card on Stripe -ShowInStripe=Show in Stripe -StripeUserAccountForActions=User account to use for email notification of some Stripe events (Stripe payouts) -StripePayoutList=List of Stripe payouts -ToOfferALinkForTestWebhook=Link to setup Stripe WebHook to call the IPN (test mode) -ToOfferALinkForLiveWebhook=Link to setup Stripe WebHook to call the IPN (live mode) -PaymentWillBeRecordedForNextPeriod=Payment will be recorded for the next period. -ClickHereToTryAgain=Click here to try again... -CreationOfPaymentModeMustBeDoneFromStripeInterface=Due to Strong Customer Authentication rules, creation of a card must be done from Stripe backoffice. You can click here to switch on Stripe customer record: %s diff --git a/htdocs/langs/ar_IQ/supplier_proposal.lang b/htdocs/langs/ar_IQ/supplier_proposal.lang deleted file mode 100644 index a68319fb2df..00000000000 --- a/htdocs/langs/ar_IQ/supplier_proposal.lang +++ /dev/null @@ -1,58 +0,0 @@ -# Dolibarr language file - Source file is en_US - supplier_proposal -SupplierProposal=Vendor commercial proposals -supplier_proposalDESC=Manage price requests to suppliers -SupplierProposalNew=New price request -CommRequest=Price request -CommRequests=Price requests -SearchRequest=Find a request -DraftRequests=Draft requests -SupplierProposalsDraft=Draft vendor proposals -LastModifiedRequests=Latest %s modified price requests -RequestsOpened=Open price requests -SupplierProposalArea=Vendor proposals area -SupplierProposalShort=Vendor proposal -SupplierProposals=Vendor proposals -SupplierProposalsShort=Vendor proposals -AskPrice=Price request -NewAskPrice=New price request -ShowSupplierProposal=Show price request -AddSupplierProposal=Create a price request -SupplierProposalRefFourn=Vendor ref -SupplierProposalDate=Delivery date -SupplierProposalRefFournNotice=Before closing to "Accepted", think to grasp suppliers references. -ConfirmValidateAsk=Are you sure you want to validate this price request under name %s? -DeleteAsk=Delete request -ValidateAsk=Validate request -SupplierProposalStatusDraft=Draft (needs to be validated) -SupplierProposalStatusValidated=Validated (request is open) -SupplierProposalStatusClosed=Closed -SupplierProposalStatusSigned=Accepted -SupplierProposalStatusNotSigned=Refused -SupplierProposalStatusDraftShort=Draft -SupplierProposalStatusValidatedShort=Validated -SupplierProposalStatusClosedShort=Closed -SupplierProposalStatusSignedShort=Accepted -SupplierProposalStatusNotSignedShort=Refused -CopyAskFrom=Create a price request by copying an existing request -CreateEmptyAsk=Create blank request -ConfirmCloneAsk=Are you sure you want to clone the price request %s? -ConfirmReOpenAsk=Are you sure you want to open back the price request %s? -SendAskByMail=Send price request by mail -SendAskRef=Sending the price request %s -SupplierProposalCard=Request card -ConfirmDeleteAsk=Are you sure you want to delete this price request %s? -ActionsOnSupplierProposal=Events on price request -DocModelAuroreDescription=A complete request model (logo...) -CommercialAsk=Price request -DefaultModelSupplierProposalCreate=Default model creation -DefaultModelSupplierProposalToBill=Default template when closing a price request (accepted) -DefaultModelSupplierProposalClosed=Default template when closing a price request (refused) -ListOfSupplierProposals=List of vendor proposal requests -ListSupplierProposalsAssociatedProject=List of vendor proposals associated with project -SupplierProposalsToClose=Vendor proposals to close -SupplierProposalsToProcess=Vendor proposals to process -LastSupplierProposals=Latest %s price requests -AllPriceRequests=All requests -TypeContact_supplier_proposal_external_SHIPPING=Vendor contact for delivery -TypeContact_supplier_proposal_external_BILLING=Vendor contact for billing -TypeContact_supplier_proposal_external_SERVICE=Representative following-up proposal diff --git a/htdocs/langs/ar_IQ/suppliers.lang b/htdocs/langs/ar_IQ/suppliers.lang deleted file mode 100644 index ca9ee174d29..00000000000 --- a/htdocs/langs/ar_IQ/suppliers.lang +++ /dev/null @@ -1,49 +0,0 @@ -# Dolibarr language file - Source file is en_US - vendors -Suppliers=Vendors -SuppliersInvoice=Vendor invoice -SupplierInvoices=Vendor invoices -ShowSupplierInvoice=Show Vendor Invoice -NewSupplier=New vendor -History=History -ListOfSuppliers=List of vendors -ShowSupplier=Show vendor -OrderDate=Order date -BuyingPriceMin=Best buying price -BuyingPriceMinShort=Best buying price -TotalBuyingPriceMinShort=Total of subproducts buying prices -TotalSellingPriceMinShort=Total of subproducts selling prices -SomeSubProductHaveNoPrices=Some sub-products have no price defined -AddSupplierPrice=Add buying price -ChangeSupplierPrice=Change buying price -SupplierPrices=Vendor prices -ReferenceSupplierIsAlreadyAssociatedWithAProduct=This vendor reference is already associated with a product: %s -NoRecordedSuppliers=No vendor recorded -SupplierPayment=Vendor payment -SuppliersArea=Vendor area -RefSupplierShort=Ref. vendor -Availability=Availability -ExportDataset_fournisseur_1=Vendor invoices and invoice details -ExportDataset_fournisseur_2=Vendor invoices and payments -ExportDataset_fournisseur_3=Purchase orders and order details -ApproveThisOrder=Approve this order -ConfirmApproveThisOrder=Are you sure you want to approve order %s? -DenyingThisOrder=Deny this order -ConfirmDenyingThisOrder=Are you sure you want to deny this order %s? -ConfirmCancelThisOrder=Are you sure you want to cancel this order %s? -AddSupplierOrder=Create Purchase Order -AddSupplierInvoice=Create vendor invoice -ListOfSupplierProductForSupplier=List of products and prices for vendor %s -SentToSuppliers=Sent to vendors -ListOfSupplierOrders=List of purchase orders -MenuOrdersSupplierToBill=Purchase orders to invoice -NbDaysToDelivery=Delivery delay (days) -DescNbDaysToDelivery=The longest delivery delay of the products from this order -SupplierReputation=Vendor reputation -ReferenceReputation=Reference reputation -DoNotOrderThisProductToThisSupplier=Do not order -NotTheGoodQualitySupplier=Low quality -ReputationForThisProduct=Reputation -BuyerName=Buyer name -AllProductServicePrices=All product / service prices -AllProductReferencesOfSupplier=All references of vendor -BuyingPriceNumShort=Vendor prices diff --git a/htdocs/langs/ar_IQ/ticket.lang b/htdocs/langs/ar_IQ/ticket.lang deleted file mode 100644 index 5615415ef28..00000000000 --- a/htdocs/langs/ar_IQ/ticket.lang +++ /dev/null @@ -1,321 +0,0 @@ -# en_US lang file for module ticket -# Copyright (C) 2013 Jean-François FERRY -# -# 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 . - -# -# Generic -# - -Module56000Name=Tickets -Module56000Desc=Ticket system for issue or request management - -Permission56001=See tickets -Permission56002=Modify tickets -Permission56003=Delete tickets -Permission56004=Manage tickets -Permission56005=See tickets of all third parties (not effective for external users, always be limited to the third party they depend on) - -TicketDictType=Ticket - Types -TicketDictCategory=Ticket - Groupes -TicketDictSeverity=Ticket - Severities -TicketDictResolution=Ticket - Resolution - -TicketTypeShortCOM=Commercial question -TicketTypeShortHELP=Request for functionnal help -TicketTypeShortISSUE=Issue or bug -TicketTypeShortPROBLEM=Problem -TicketTypeShortREQUEST=Change or enhancement request -TicketTypeShortPROJET=Project -TicketTypeShortOTHER=Other - -TicketSeverityShortLOW=Low -TicketSeverityShortNORMAL=Normal -TicketSeverityShortHIGH=High -TicketSeverityShortBLOCKING=Critical, Blocking - -ErrorBadEmailAddress=Field '%s' incorrect -MenuTicketMyAssign=My tickets -MenuTicketMyAssignNonClosed=My open tickets -MenuListNonClosed=Open tickets - -TypeContact_ticket_internal_CONTRIBUTOR=Contributor -TypeContact_ticket_internal_SUPPORTTEC=Assigned user -TypeContact_ticket_external_SUPPORTCLI=Customer contact / incident tracking -TypeContact_ticket_external_CONTRIBUTOR=External contributor - -OriginEmail=Reporter Email -Notify_TICKET_SENTBYMAIL=Send ticket message by email - -# Status -Read=Read -Assigned=Assigned -InProgress=In progress -NeedMoreInformation=Waiting for reporter feedback -NeedMoreInformationShort=Waiting for feedback -Answered=Answered -Waiting=Waiting -SolvedClosed=Solved -Deleted=Deleted - -# Dict -Type=Type -Severity=Severity -TicketGroupIsPublic=Group is public -TicketGroupIsPublicDesc=If a ticket group is public, it will be visible in the form when creating a ticket from the public interface - -# Email templates -MailToSendTicketMessage=To send email from ticket message - -# -# Admin page -# -TicketSetup=Ticket module setup -TicketSettings=Settings -TicketSetupPage= -TicketPublicAccess=A public interface requiring no identification is available at the following url -TicketSetupDictionaries=The type of ticket, severity and analytic codes are configurable from dictionaries -TicketParamModule=Module variable setup -TicketParamMail=Email setup -TicketEmailNotificationFrom=Notification email from -TicketEmailNotificationFromHelp=Used into ticket message answer by example -TicketEmailNotificationTo=Notifications email to -TicketEmailNotificationToHelp=Send email notifications to this address. -TicketNewEmailBodyLabel=Text message sent after creating a ticket -TicketNewEmailBodyHelp=The text specified here will be inserted into the email confirming the creation of a new ticket from the public interface. Information on the consultation of the ticket are automatically added. -TicketParamPublicInterface=Public interface setup -TicketsEmailMustExist=Require an existing email address to create a ticket -TicketsEmailMustExistHelp=In the public interface, the email address should already be filled in the database to create a new ticket. -PublicInterface=Public interface -TicketUrlPublicInterfaceLabelAdmin=Alternative URL for public interface -TicketUrlPublicInterfaceHelpAdmin=It is possible to define an alias to the web server and thus make available the public interface with another URL (the server must act as a proxy on this new URL) -TicketPublicInterfaceTextHomeLabelAdmin=Welcome text of the public interface -TicketPublicInterfaceTextHome=You can create a support ticket or view existing from its identifier tracking ticket. -TicketPublicInterfaceTextHomeHelpAdmin=The text defined here will appear on the home page of the public interface. -TicketPublicInterfaceTopicLabelAdmin=Interface title -TicketPublicInterfaceTopicHelp=This text will appear as the title of the public interface. -TicketPublicInterfaceTextHelpMessageLabelAdmin=Help text to the message entry -TicketPublicInterfaceTextHelpMessageHelpAdmin=This text will appear above the message input area of the user. -ExtraFieldsTicket=Extra attributes -TicketCkEditorEmailNotActivated=HTML editor is not activated. Please put FCKEDITOR_ENABLE_MAIL content to 1 to get it. -TicketsDisableEmail=Do not send emails for ticket creation or message recording -TicketsDisableEmailHelp=By default, emails are sent when new tickets or messages created. Enable this option to disable *all* email notifications -TicketsLogEnableEmail=Enable log by email -TicketsLogEnableEmailHelp=At each change, an email will be sent **to each contact** associated with the ticket. -TicketParams=Params -TicketsShowModuleLogo=Display the logo of the module in the public interface -TicketsShowModuleLogoHelp=Enable this option to hide the logo module in the pages of the public interface -TicketsShowCompanyLogo=Display the logo of the company in the public interface -TicketsShowCompanyLogoHelp=Enable this option to hide the logo of the main company in the pages of the public interface -TicketsEmailAlsoSendToMainAddress=Also send a notification to the main email address -TicketsEmailAlsoSendToMainAddressHelp=Enable this option to also send an email to the address defined into setup "%s" (see tab "%s") -TicketsLimitViewAssignedOnly=Restrict the display to tickets assigned to the current user (not effective for external users, always be limited to the third party they depend on) -TicketsLimitViewAssignedOnlyHelp=Only tickets assigned to the current user will be visible. Does not apply to a user with tickets management rights. -TicketsActivatePublicInterface=Activate public interface -TicketsActivatePublicInterfaceHelp=Public interface allow any visitors to create tickets. -TicketsAutoAssignTicket=Automatically assign the user who created the ticket -TicketsAutoAssignTicketHelp=When creating a ticket, the user can be automatically assigned to the ticket. -TicketNumberingModules=Tickets numbering module -TicketsModelModule=Document templates for tickets -TicketNotifyTiersAtCreation=Notify third party at creation -TicketsDisableCustomerEmail=Always disable emails when a ticket is created from public interface -TicketsPublicNotificationNewMessage=Send email(s) when a new message/comment is added to a ticket -TicketsPublicNotificationNewMessageHelp=Send email(s) when a new message is added from public interface (to assigned user or the notifications email to (update) and/or the notifications email to) -TicketPublicNotificationNewMessageDefaultEmail=Notifications email to (update) -TicketPublicNotificationNewMessageDefaultEmailHelp=Send an email to this address for each new message notifications if the ticket doesn't have a user assigned to it or if the user doesn't have any known email. -# -# Index & list page -# -TicketsIndex=Tickets area -TicketList=List of tickets -TicketAssignedToMeInfos=This page display ticket list created by or assigned to current user -NoTicketsFound=No ticket found -NoUnreadTicketsFound=No unread ticket found -TicketViewAllTickets=View all tickets -TicketViewNonClosedOnly=View only open tickets -TicketStatByStatus=Tickets by status -OrderByDateAsc=Sort by ascending date -OrderByDateDesc=Sort by descending date -ShowAsConversation=Show as conversation list -MessageListViewType=Show as table list - -# -# Ticket card -# -Ticket=Ticket -TicketCard=Ticket card -CreateTicket=Create ticket -EditTicket=Edit ticket -TicketsManagement=Tickets Management -CreatedBy=Created by -NewTicket=New Ticket -SubjectAnswerToTicket=Ticket answer -TicketTypeRequest=Request type -TicketCategory=Ticket categorization -SeeTicket=See ticket -TicketMarkedAsRead=Ticket has been marked as read -TicketReadOn=Read on -TicketCloseOn=Closing date -MarkAsRead=Mark ticket as read -TicketHistory=Ticket history -AssignUser=Assign to user -TicketAssigned=Ticket is now assigned -TicketChangeType=Change type -TicketChangeCategory=Change analytic code -TicketChangeSeverity=Change severity -TicketAddMessage=Add a message -AddMessage=Add a message -MessageSuccessfullyAdded=Ticket added -TicketMessageSuccessfullyAdded=Message successfully added -TicketMessagesList=Message list -NoMsgForThisTicket=No message for this ticket -Properties=Classification -LatestNewTickets=Latest %s newest tickets (not read) -TicketSeverity=Severity -ShowTicket=See ticket -RelatedTickets=Related tickets -TicketAddIntervention=Create intervention -CloseTicket=Close|Solve ticket -AbandonTicket=Abandon ticket -CloseATicket=Close|Solve a ticket -ConfirmCloseAticket=Confirm ticket closing -ConfirmAbandonTicket=Do you confirm the closing of the ticket to status 'Abandonned' -ConfirmDeleteTicket=Please confirm ticket deleting -TicketDeletedSuccess=Ticket deleted with success -TicketMarkedAsClosed=Ticket marked as closed -TicketDurationAuto=Calculated duration -TicketDurationAutoInfos=Duration calculated automatically from intervention related -TicketUpdated=Ticket updated -SendMessageByEmail=Send message by email -TicketNewMessage=New message -ErrorMailRecipientIsEmptyForSendTicketMessage=Recipient is empty. No email send -TicketGoIntoContactTab=Please go into "Contacts" tab to select them -TicketMessageMailIntro=Introduction -TicketMessageMailIntroHelp=This text is added only at the beginning of the email and will not be saved. -TicketMessageMailIntroLabelAdmin=Introduction to the message when sending email -TicketMessageMailIntroText=Hello,
    A new response was sent on a ticket that you contact. Here is the message:
    -TicketMessageMailIntroHelpAdmin=This text will be inserted before the text of the response to a ticket. -TicketMessageMailSignature=Signature -TicketMessageMailSignatureHelp=This text is added only at the end of the email and will not be saved. -TicketMessageMailSignatureText=

    Sincerely,

    --

    -TicketMessageMailSignatureLabelAdmin=Signature of response email -TicketMessageMailSignatureHelpAdmin=This text will be inserted after the response message. -TicketMessageHelp=Only this text will be saved in the message list on ticket card. -TicketMessageSubstitutionReplacedByGenericValues=Substitutions variables are replaced by generic values. -TimeElapsedSince=Time elapsed since -TicketTimeToRead=Time elapsed before read -TicketTimeElapsedBeforeSince=Time elapsed before / since -TicketContacts=Contacts ticket -TicketDocumentsLinked=Documents linked to ticket -ConfirmReOpenTicket=Confirm reopen this ticket ? -TicketMessageMailIntroAutoNewPublicMessage=A new message was posted on the ticket with the subject %s: -TicketAssignedToYou=Ticket assigned -TicketAssignedEmailBody=You have been assigned the ticket #%s by %s -MarkMessageAsPrivate=Mark message as private -TicketMessagePrivateHelp=This message will not display to external users -TicketEmailOriginIssuer=Issuer at origin of the tickets -InitialMessage=Initial Message -LinkToAContract=Link to a contract -TicketPleaseSelectAContract=Select a contract -UnableToCreateInterIfNoSocid=Can not create an intervention when no third party is defined -TicketMailExchanges=Mail exchanges -TicketInitialMessageModified=Initial message modified -TicketMessageSuccesfullyUpdated=Message successfully updated -TicketChangeStatus=Change status -TicketConfirmChangeStatus=Confirm the status change: %s ? -TicketLogStatusChanged=Status changed: %s to %s -TicketNotNotifyTiersAtCreate=Not notify company at create -Unread=Unread -TicketNotCreatedFromPublicInterface=Not available. Ticket was not created from public interface. -ErrorTicketRefRequired=Ticket reference name is required - -# -# Logs -# -TicketLogMesgReadBy=Ticket %s read by %s -NoLogForThisTicket=No log for this ticket yet -TicketLogAssignedTo=Ticket %s assigned to %s -TicketLogPropertyChanged=Ticket %s modified: classification from %s to %s -TicketLogClosedBy=Ticket %s closed by %s -TicketLogReopen=Ticket %s re-open - -# -# Public pages -# -TicketSystem=Ticket system -ShowListTicketWithTrackId=Display ticket list from track ID -ShowTicketWithTrackId=Display ticket from track ID -TicketPublicDesc=You can create a support ticket or check from an existing ID. -YourTicketSuccessfullySaved=Ticket has been successfully saved! -MesgInfosPublicTicketCreatedWithTrackId=A new ticket has been created with ID %s and Ref %s. -PleaseRememberThisId=Please keep the tracking number that we might ask you later. -TicketNewEmailSubject=Ticket creation confirmation - Ref %s (public ticket ID %s) -TicketNewEmailSubjectCustomer=New support ticket -TicketNewEmailBody=This is an automatic email to confirm you have registered a new ticket. -TicketNewEmailBodyCustomer=This is an automatic email to confirm a new ticket has just been created into your account. -TicketNewEmailBodyInfosTicket=Information for monitoring the ticket -TicketNewEmailBodyInfosTrackId=Ticket tracking number: %s -TicketNewEmailBodyInfosTrackUrl=You can view the progress of the ticket by clicking the link above. -TicketNewEmailBodyInfosTrackUrlCustomer=You can view the progress of the ticket in the specific interface by clicking the following link -TicketEmailPleaseDoNotReplyToThisEmail=Please do not reply directly to this email! Use the link to reply into the interface. -TicketPublicInfoCreateTicket=This form allows you to record a support ticket in our management system. -TicketPublicPleaseBeAccuratelyDescribe=Please accurately describe the problem. Provide the most information possible to allow us to correctly identify your request. -TicketPublicMsgViewLogIn=Please enter ticket tracking ID -TicketTrackId=Public Tracking ID -OneOfTicketTrackId=One of your tracking ID -ErrorTicketNotFound=Ticket with tracking ID %s not found! -Subject=Subject -ViewTicket=View ticket -ViewMyTicketList=View my ticket list -ErrorEmailMustExistToCreateTicket=Error: email address not found in our database -TicketNewEmailSubjectAdmin=New ticket created - Ref %s (public ticket ID %s) -TicketNewEmailBodyAdmin=

    Ticket has just been created with ID #%s, see information:

    -SeeThisTicketIntomanagementInterface=See ticket in management interface -TicketPublicInterfaceForbidden=The public interface for the tickets was not enabled -ErrorEmailOrTrackingInvalid=Bad value for tracking ID or email -OldUser=Old user -NewUser=New user -NumberOfTicketsByMonth=Number of tickets per month -NbOfTickets=Number of tickets -# notifications -TicketNotificationEmailSubject=Ticket %s updated -TicketNotificationEmailBody=This is an automatic message to notify you that ticket %s has just been updated -TicketNotificationRecipient=Notification recipient -TicketNotificationLogMessage=Log message -TicketNotificationEmailBodyInfosTrackUrlinternal=View ticket into interface -TicketNotificationNumberEmailSent=Notification email sent: %s - -ActionsOnTicket=Events on ticket - -# -# Boxes -# -BoxLastTicket=Latest created tickets -BoxLastTicketDescription=Latest %s created tickets -BoxLastTicketContent= -BoxLastTicketNoRecordedTickets=No recent unread tickets -BoxLastModifiedTicket=Latest modified tickets -BoxLastModifiedTicketDescription=Latest %s modified tickets -BoxLastModifiedTicketContent= -BoxLastModifiedTicketNoRecordedTickets=No recent modified tickets -BoxTicketType=Distribution of open tickets by type -BoxTicketSeverity=Number of open tickets by severity -BoxNoTicketSeverity=No tickets opened -BoxTicketLastXDays=Number of new tickets by days the last %s days -BoxTicketLastXDayswidget = Number of new tickets by days the last X days -BoxNoTicketLastXDays=No new tickets the last %s days -BoxNumberOfTicketByDay=Number of new tickets by day -BoxNewTicketVSClose=Number of today's new tickets versus today's closed tickets -TicketCreatedToday=Ticket created today -TicketClosedToday=Ticket closed today diff --git a/htdocs/langs/ar_IQ/trips.lang b/htdocs/langs/ar_IQ/trips.lang deleted file mode 100644 index c9a6c792077..00000000000 --- a/htdocs/langs/ar_IQ/trips.lang +++ /dev/null @@ -1,150 +0,0 @@ -# Dolibarr language file - Source file is en_US - trips -ShowExpenseReport=Show expense report -Trips=Expense reports -TripsAndExpenses=Expenses reports -TripsAndExpensesStatistics=Expense reports statistics -TripCard=Expense report card -AddTrip=Create expense report -ListOfTrips=List of expense reports -ListOfFees=List of fees -TypeFees=Types of fees -ShowTrip=Show expense report -NewTrip=New expense report -LastExpenseReports=Latest %s expense reports -AllExpenseReports=All expense reports -CompanyVisited=Company/organization visited -FeesKilometersOrAmout=Amount or kilometers -DeleteTrip=Delete expense report -ConfirmDeleteTrip=Are you sure you want to delete this expense report? -ListTripsAndExpenses=List of expense reports -ListToApprove=Waiting for approval -ExpensesArea=Expense reports area -ClassifyRefunded=Classify 'Refunded' -ExpenseReportWaitingForApproval=A new expense report has been submitted for approval -ExpenseReportWaitingForApprovalMessage=A new expense report has been submitted and is waiting for approval.
    - User: %s
    - Period: %s
    Click here to validate: %s -ExpenseReportWaitingForReApproval=An expense report has been submitted for re-approval -ExpenseReportWaitingForReApprovalMessage=An expense report has been submitted and is waiting for re-approval.
    The %s, you refused to approve the expense report for this reason: %s.
    A new version has been proposed and waiting for your approval.
    - User: %s
    - Period: %s
    Click here to validate: %s -ExpenseReportApproved=An expense report was approved -ExpenseReportApprovedMessage=The expense report %s was approved.
    - User: %s
    - Approved by: %s
    Click here to show the expense report: %s -ExpenseReportRefused=An expense report was refused -ExpenseReportRefusedMessage=The expense report %s was refused.
    - User: %s
    - Refused by: %s
    - Motive for refusal: %s
    Click here to show the expense report: %s -ExpenseReportCanceled=An expense report was canceled -ExpenseReportCanceledMessage=The expense report %s was canceled.
    - User: %s
    - Canceled by: %s
    - Motive for cancellation: %s
    Click here to show the expense report: %s -ExpenseReportPaid=An expense report was paid -ExpenseReportPaidMessage=The expense report %s was paid.
    - User: %s
    - Paid by: %s
    Click here to show the expense report: %s -TripId=Id expense report -AnyOtherInThisListCanValidate=Person to be informed for validating the request. -TripSociete=Information company -TripNDF=Informations expense report -PDFStandardExpenseReports=Standard template to generate a PDF document for expense report -ExpenseReportLine=Expense report line -TF_OTHER=Other -TF_TRIP=Transportation -TF_LUNCH=Lunch -TF_METRO=Metro -TF_TRAIN=Train -TF_BUS=Bus -TF_CAR=Car -TF_PEAGE=Toll -TF_ESSENCE=Fuel -TF_HOTEL=Hotel -TF_TAXI=Taxi -EX_KME=Mileage costs -EX_FUE=Fuel CV -EX_HOT=Hotel -EX_PAR=Parking CV -EX_TOL=Toll CV -EX_TAX=Various Taxes -EX_IND=Indemnity transportation subscription -EX_SUM=Maintenance supply -EX_SUO=Office supplies -EX_CAR=Car rental -EX_DOC=Documentation -EX_CUR=Customers receiving -EX_OTR=Other receiving -EX_POS=Postage -EX_CAM=CV maintenance and repair -EX_EMM=Employees meal -EX_GUM=Guests meal -EX_BRE=Breakfast -EX_FUE_VP=Fuel PV -EX_TOL_VP=Toll PV -EX_PAR_VP=Parking PV -EX_CAM_VP=PV maintenance and repair -DefaultCategoryCar=Default transportation mode -DefaultRangeNumber=Default range number -UploadANewFileNow=Upload a new document now -Error_EXPENSEREPORT_ADDON_NotDefined=Error, the rule for expense report numbering ref was not defined into setup of module 'Expense Report' -ErrorDoubleDeclaration=You have declared another expense report into a similar date range. -AucuneLigne=There is no expense report declared yet -ModePaiement=Payment mode -VALIDATOR=User responsible for approval -VALIDOR=Approved by -AUTHOR=Recorded by -AUTHORPAIEMENT=Paid by -REFUSEUR=Denied by -CANCEL_USER=Deleted by -MOTIF_REFUS=Reason -MOTIF_CANCEL=Reason -DATE_REFUS=Deny date -DATE_SAVE=Validation date -DATE_CANCEL=Cancelation date -DATE_PAIEMENT=Payment date -ExpenseReportRef=Ref. expense report -ValidateAndSubmit=Validate and submit for approval -ValidatedWaitingApproval=Validated (waiting for approval) -NOT_AUTHOR=You are not the author of this expense report. Operation cancelled. -ConfirmRefuseTrip=Are you sure you want to deny this expense report? -ValideTrip=Approve expense report -ConfirmValideTrip=Are you sure you want to approve this expense report? -PaidTrip=Pay an expense report -ConfirmPaidTrip=Are you sure you want to change status of this expense report to "Paid"? -ConfirmCancelTrip=Are you sure you want to cancel this expense report? -BrouillonnerTrip=Move back expense report to status "Draft" -ConfirmBrouillonnerTrip=Are you sure you want to move this expense report to status "Draft"? -SaveTrip=Validate expense report -ConfirmSaveTrip=Are you sure you want to validate this expense report? -NoTripsToExportCSV=No expense report to export for this period. -ExpenseReportPayment=Expense report payment -ExpenseReportsToApprove=Expense reports to approve -ExpenseReportsToPay=Expense reports to pay -ConfirmCloneExpenseReport=Are you sure you want to clone this expense report ? -ExpenseReportsIk=Configuration of mileage charges -ExpenseReportsRules=Expense report rules -ExpenseReportIkDesc=You can modify the calculation of kilometers expense by category and range who they are previously defined. d is the distance in kilometers -ExpenseReportRulesDesc=You can create or update any rules of calculation. This part will be used when user will create a new expense report -expenseReportOffset=Offset -expenseReportCoef=Coefficient -expenseReportTotalForFive=Example with d = 5 -expenseReportRangeFromTo=from %d to %d -expenseReportRangeMoreThan=more than %d -expenseReportCoefUndefined=(value not defined) -expenseReportCatDisabled=Category disabled - see the c_exp_tax_cat dictionary -expenseReportRangeDisabled=Range disabled - see the c_exp_tax_range dictionay -expenseReportPrintExample=offset + (d x coef) = %s -ExpenseReportApplyTo=Apply to -ExpenseReportDomain=Domain to apply -ExpenseReportLimitOn=Limit on -ExpenseReportDateStart=Date start -ExpenseReportDateEnd=Date end -ExpenseReportLimitAmount=Limite amount -ExpenseReportRestrictive=Restrictive -AllExpenseReport=All type of expense report -OnExpense=Expense line -ExpenseReportRuleSave=Expense report rule saved -ExpenseReportRuleErrorOnSave=Error: %s -RangeNum=Range %d -ExpenseReportConstraintViolationError=Constraint violation id [%s]: %s is superior to %s %s -byEX_DAY=by day (limitation to %s) -byEX_MON=by month (limitation to %s) -byEX_YEA=by year (limitation to %s) -byEX_EXP=by line (limitation to %s) -ExpenseReportConstraintViolationWarning=Constraint violation id [%s]: %s is superior to %s %s -nolimitbyEX_DAY=by day (no limitation) -nolimitbyEX_MON=by month (no limitation) -nolimitbyEX_YEA=by year (no limitation) -nolimitbyEX_EXP=by line (no limitation) -CarCategory=Vehicle category -ExpenseRangeOffset=Offset amount: %s -RangeIk=Mileage range -AttachTheNewLineToTheDocument=Attach the line to an uploaded document diff --git a/htdocs/langs/ar_IQ/users.lang b/htdocs/langs/ar_IQ/users.lang index 6aeaf128838..fd9215f98df 100644 --- a/htdocs/langs/ar_IQ/users.lang +++ b/htdocs/langs/ar_IQ/users.lang @@ -1,126 +1,3 @@ # Dolibarr language file - Source file is en_US - users -HRMArea=HRM area -UserCard=User card -GroupCard=Group card -Permission=Permission -Permissions=Permissions -EditPassword=Edit password -SendNewPassword=Regenerate and send password -SendNewPasswordLink=Send link to reset password -ReinitPassword=Regenerate password -PasswordChangedTo=Password changed to: %s -SubjectNewPassword=Your new password for %s -GroupRights=Group permissions -UserRights=User permissions -Credentials=Credentials -UserGUISetup=User Display Setup -DisableUser=Disable -DisableAUser=Disable a user -DeleteUser=Delete -DeleteAUser=Delete a user -EnableAUser=Enable a user -DeleteGroup=Delete -DeleteAGroup=Delete a group -ConfirmDisableUser=Are you sure you want to disable user %s? -ConfirmDeleteUser=Are you sure you want to delete user %s? -ConfirmDeleteGroup=Are you sure you want to delete group %s? -ConfirmEnableUser=Are you sure you want to enable user %s? -ConfirmReinitPassword=Are you sure you want to generate a new password for user %s? -ConfirmSendNewPassword=Are you sure you want to generate and send new password for user %s? -NewUser=New user -CreateUser=Create user -LoginNotDefined=Login is not defined. -NameNotDefined=Name is not defined. -ListOfUsers=List of users -SuperAdministrator=Super Administrator -SuperAdministratorDesc=Global administrator -AdministratorDesc=Administrator -DefaultRights=Default Permissions -DefaultRightsDesc=Define here the default permissions that are automatically granted to a new user (to modify permissions for existing users, go to the user card). -DolibarrUsers=Dolibarr users -LastName=Last name -FirstName=First name -ListOfGroups=List of groups -NewGroup=New group -CreateGroup=Create group -RemoveFromGroup=Remove from group -PasswordChangedAndSentTo=Password changed and sent to %s. -PasswordChangeRequest=Request to change password for %s -PasswordChangeRequestSent=Request to change password for %s sent to %s. -IfLoginExistPasswordRequestSent=If this login is a valid account, an email to reset password has been sent. -IfEmailExistPasswordRequestSent=If this email is a valid account, an email to reset password has been sent. -ConfirmPasswordReset=Confirm password reset -MenuUsersAndGroups=Users & Groups -LastGroupsCreated=Latest %s groups created -LastUsersCreated=Latest %s users created -ShowGroup=Show group -ShowUser=Show user -NonAffectedUsers=Non assigned users -UserModified=User modified successfully -PhotoFile=Photo file -ListOfUsersInGroup=List of users in this group -ListOfGroupsForUser=List of groups for this user -LinkToCompanyContact=Link to third party / contact -LinkedToDolibarrMember=Link to member LinkedToDolibarrUser=Link to Dolibarr user LinkedToDolibarrThirdParty=Link to Dolibarr third party -CreateDolibarrLogin=Create a user -CreateDolibarrThirdParty=Create a third party -LoginAccountDisableInDolibarr=Account disabled in Dolibarr. -UsePersonalValue=Use personal value -InternalUser=Internal user -ExportDataset_user_1=Users and their properties -DomainUser=Domain user %s -Reactivate=Reactivate -CreateInternalUserDesc=This form allows you to create an internal user in your company/organization. To create an external user (customer, vendor etc. ..), use the button 'Create Dolibarr User' from that third-party's contact card. -InternalExternalDesc=An internal user is a user that is part of your company/organization, or is a partner user outside of your organization that may need to see more data than data related to his company (the permission system will define what he can or can't see or do).
    An external user is a customer, vendor or other that must view ONLY data related to himself (Creating an external user for a third-party can be done from the contact record of the third-party).

    In both cases, you must grant permissions on the features that the user need. -PermissionInheritedFromAGroup=Permission granted because inherited from one of a user's group. -Inherited=Inherited -UserWillBe=Created user will be -UserWillBeInternalUser=Created user will be an internal user (because not linked to a particular third party) -UserWillBeExternalUser=Created user will be an external user (because linked to a particular third party) -IdPhoneCaller=Id phone caller -NewUserCreated=User %s created -NewUserPassword=Password change for %s -NewPasswordValidated=Your new password have been validated and must be used now to login. -EventUserModified=User %s modified -UserDisabled=User %s disabled -UserEnabled=User %s activated -UserDeleted=User %s removed -NewGroupCreated=Group %s created -GroupModified=Group %s modified -GroupDeleted=Group %s removed -ConfirmCreateContact=Are you sure you want to create a Dolibarr account for this contact? -ConfirmCreateLogin=Are you sure you want to create a Dolibarr account for this member? -ConfirmCreateThirdParty=Are you sure you want to create a third party for this member? -LoginToCreate=Login to create -NameToCreate=Name of third party to create -YourRole=Your roles -YourQuotaOfUsersIsReached=Your quota of active users is reached ! -NbOfUsers=Number of users -NbOfPermissions=Number of permissions -DontDowngradeSuperAdmin=Only a superadmin can downgrade a superadmin -HierarchicalResponsible=Supervisor -HierarchicView=Hierarchical view -UseTypeFieldToChange=Use field Type to change -OpenIDURL=OpenID URL -LoginUsingOpenID=Use OpenID to login -WeeklyHours=Hours worked (per week) -ExpectedWorkedHours=Expected hours worked per week -ColorUser=Color of the user -DisabledInMonoUserMode=Disabled in maintenance mode -UserAccountancyCode=User accounting code -UserLogoff=User logout -UserLogged=User logged -DateOfEmployment=Employment date -DateEmployment=Employment -DateEmploymentstart=Employment Start Date -DateEmploymentEnd=Employment End Date -RangeOfLoginValidity=Access validity date range -CantDisableYourself=You can't disable your own user record -ForceUserExpenseValidator=Force expense report validator -ForceUserHolidayValidator=Force leave request validator -ValidatorIsSupervisorByDefault=By default, the validator is the supervisor of the user. Keep empty to keep this behaviour. -UserPersonalEmail=Personal email -UserPersonalMobile=Personal mobile phone -WarningNotLangOfInterface=Warning, this is the main language the user speak, not the language of the interface he choosed to see. To change the interface language visible by this user, go on tab %s diff --git a/htdocs/langs/ar_IQ/website.lang b/htdocs/langs/ar_IQ/website.lang deleted file mode 100644 index dc2ec2c0b3d..00000000000 --- a/htdocs/langs/ar_IQ/website.lang +++ /dev/null @@ -1,147 +0,0 @@ -# Dolibarr language file - Source file is en_US - website -Shortname=Code -WebsiteSetupDesc=Create here the websites you wish to use. Then go into menu Websites to edit them. -DeleteWebsite=Delete website -ConfirmDeleteWebsite=Are you sure you want to delete this web site? All its pages and content will also be removed. The files uploaded (like into the medias directory, the ECM module, ...) will remain. -WEBSITE_TYPE_CONTAINER=Type of page/container -WEBSITE_PAGE_EXAMPLE=Web page to use as example -WEBSITE_PAGENAME=Page name/alias -WEBSITE_ALIASALT=Alternative page names/aliases -WEBSITE_ALIASALTDesc=Use here list of other name/aliases so the page can also be accessed using this other names/aliases (for example the old name after renaming the alias to keep backlink on old link/name working). Syntax is:
    alternativename1, alternativename2, ... -WEBSITE_CSS_URL=URL of external CSS file -WEBSITE_CSS_INLINE=CSS file content (common to all pages) -WEBSITE_JS_INLINE=Javascript file content (common to all pages) -WEBSITE_HTML_HEADER=Addition at bottom of HTML Header (common to all pages) -WEBSITE_ROBOT=Robot file (robots.txt) -WEBSITE_HTACCESS=Website .htaccess file -WEBSITE_MANIFEST_JSON=Website manifest.json file -WEBSITE_README=README.md file -WEBSITE_KEYWORDSDesc=Use a comma to separate values -EnterHereLicenseInformation=Enter here meta data or license information to fille a README.md file. if you distribute your website as a template, the file will be included into the temptate package. -HtmlHeaderPage=HTML header (specific to this page only) -PageNameAliasHelp=Name or alias of the page.
    This alias is also used to forge a SEO URL when website is ran from a Virtual host of a Web server (like Apacke, Nginx, ...). Use the button "%s" to edit this alias. -EditTheWebSiteForACommonHeader=Note: If you want to define a personalized header for all pages, edit the header on the site level instead of on the page/container. -MediaFiles=Media library -EditCss=Edit website properties -EditMenu=Edit menu -EditMedias=Edit medias -EditPageMeta=Edit page/container properties -EditInLine=Edit inline -AddWebsite=Add website -Webpage=Web page/container -AddPage=Add page/container -PageContainer=Page -PreviewOfSiteNotYetAvailable=The preview of your website %s is not yet available. You must first 'Import a full website template' or just 'Add a page/container'. -RequestedPageHasNoContentYet=Requested page with id %s has no content yet, or cache file .tpl.php was removed. Edit content of the page to solve this. -SiteDeleted=Web site '%s' deleted -PageContent=Page/Contenair -PageDeleted=Page/Contenair '%s' of website %s deleted -PageAdded=Page/Contenair '%s' added -ViewSiteInNewTab=View site in new tab -ViewPageInNewTab=View page in new tab -SetAsHomePage=Set as Home page -RealURL=Real URL -ViewWebsiteInProduction=View web site using home URLs -SetHereVirtualHost=Use with Apache/NGinx/...
    Create on your web server (Apache, Nginx, ...) a dedicated Virtual Host with PHP enabled and a Root directory on
    %s -ExampleToUseInApacheVirtualHostConfig=Example to use in Apache virtual host setup: -YouCanAlsoTestWithPHPS=Use with PHP embedded server
    On develop environment, you may prefer to test the site with the PHP embedded web server (PHP 5.5 required) by running
    php -S 0.0.0.0:8080 -t %s -YouCanAlsoDeployToAnotherWHP=Run your web site with another Dolibarr Hosting provider
    If you don't have a web server like Apache or NGinx available on internet, you can export and import your web site onto another Dolibarr instance provided by another Dolibarr hosting provider that provide full integration with the Website module. You can find a list of some Dolibarr hosting providers on https://saas.dolibarr.org -CheckVirtualHostPerms=Check also that the virtual host user (for example www-data) has %s permissions on files into
    %s -ReadPerm=Read -WritePerm=Write -TestDeployOnWeb=Test/deploy on web -PreviewSiteServedByWebServer=Preview %s in a new tab.

    The %s will be served by an external web server (like Apache, Nginx, IIS). You must install and setup this server before to point to directory:
    %s
    URL served by external server:
    %s -PreviewSiteServedByDolibarr=Preview %s in a new tab.

    The %s will be served by Dolibarr server so it does not need any extra web server (like Apache, Nginx, IIS) to be installed.
    The inconvenient is that the URLs of pages are not user friendly and start with the path of your Dolibarr.
    URL served by Dolibarr:
    %s

    To use your own external web server to serve this web site, create a virtual host on your web server that points on directory
    %s
    then enter the name of this virtual server in the properties of this website and click on the link "Test/Deploy on the web". -VirtualHostUrlNotDefined=URL of the virtual host served by external web server not defined -NoPageYet=No pages yet -YouCanCreatePageOrImportTemplate=You can create a new page or import a full website template -SyntaxHelp=Help on specific syntax tips -YouCanEditHtmlSourceckeditor=You can edit HTML source code using the "Source" button in editor. -YouCanEditHtmlSource=
    You can include PHP code into this source using tags <?php ?>. The following global variables are available: $conf, $db, $mysoc, $user, $website, $websitepage, $weblangs, $pagelangs.

    You can also include content of another Page/Container with the following syntax:
    <?php includeContainer('alias_of_container_to_include'); ?>

    You can make a redirect to another Page/Container with the following syntax (Note: do not output any content before a redirect):
    <?php redirectToContainer('alias_of_container_to_redirect_to'); ?>

    To add a link to another page, use the syntax:
    <a href="alias_of_page_to_link_to.php">mylink<a>

    To include a link to download a file stored into the documents directory, use the document.php wrapper:
    Example, for a file into documents/ecm (need to be logged), syntax is:
    <a href="/document.php?modulepart=ecm&file=[relative_dir/]filename.ext">
    For a file into documents/medias (open directory for public access), syntax is:
    <a href="/document.php?modulepart=medias&file=[relative_dir/]filename.ext">
    For a file shared with a share link (open access using the sharing hash key of file), syntax is:
    <a href="/document.php?hashp=publicsharekeyoffile">

    To include an image stored into the documents directory, use the viewimage.php wrapper:
    Example, for an image into documents/medias (open directory for public access), syntax is:
    <img src="/viewimage.php?modulepart=medias&file=[relative_dir/]filename.ext">
    -#YouCanEditHtmlSource2=
    To include a image shared publicaly, use the viewimage.php wrapper:
    Example with a shared key 123456789, syntax is:
    <img src="/viewimage.php?hashp=12345679012...">
    -YouCanEditHtmlSource2=For an image shared with a share link (open access using the sharing hash key of file), syntax is:
    <img src="/viewimage.php?hashp=12345679012...">
    -YouCanEditHtmlSourceMore=
    More examples of HTML or dynamic code available on the wiki documentation
    . -ClonePage=Clone page/container -CloneSite=Clone site -SiteAdded=Website added -ConfirmClonePage=Please enter code/alias of new page and if it is a translation of the cloned page. -PageIsANewTranslation=The new page is a translation of the current page ? -LanguageMustNotBeSameThanClonedPage=You clone a page as a translation. The language of the new page must be different than language of source page. -ParentPageId=Parent page ID -WebsiteId=Website ID -CreateByFetchingExternalPage=Create page/container by fetching page from external URL... -OrEnterPageInfoManually=Or create page from scratch or from a page template... -FetchAndCreate=Fetch and Create -ExportSite=Export website -ImportSite=Import website template -IDOfPage=Id of page -Banner=Banner -BlogPost=Blog post -WebsiteAccount=Website account -WebsiteAccounts=Website accounts -AddWebsiteAccount=Create web site account -BackToListForThirdParty=Back to list for the third-party -DisableSiteFirst=Disable website first -MyContainerTitle=My web site title -AnotherContainer=This is how to include content of another page/container (you may have an error here if you enable dynamic code because the embedded subcontainer may not exists) -SorryWebsiteIsCurrentlyOffLine=Sorry, this website is currently off line. Please comme back later... -WEBSITE_USE_WEBSITE_ACCOUNTS=Enable the web site account table -WEBSITE_USE_WEBSITE_ACCOUNTSTooltip=Enable the table to store web site accounts (login/pass) for each website / third party -YouMustDefineTheHomePage=You must first define the default Home page -OnlyEditionOfSourceForGrabbedContentFuture=Warning: Creating a web page by importing an external web page is reserved for experienced users. Depending on the complexity of source page, the result of importation may differ from the original. Also if the source page uses common CSS styles or conflicting javascript, it may break the look or features of the Website editor when working on this page. This method is a quicker way to create a page but it is recommended to create your new page from scratch or from a suggested page template.
    Note also that the inline editor may not works correclty when used on a grabbed external page. -OnlyEditionOfSourceForGrabbedContent=Only edition of HTML source is possible when content was grabbed from an external site -GrabImagesInto=Grab also images found into css and page. -ImagesShouldBeSavedInto=Images should be saved into directory -WebsiteRootOfImages=Root directory for website images -SubdirOfPage=Sub-directory dedicated to page -AliasPageAlreadyExists=Alias page %s already exists -CorporateHomePage=Corporate Home page -EmptyPage=Empty page -ExternalURLMustStartWithHttp=External URL must start with http:// or https:// -ZipOfWebsitePackageToImport=Upload the Zip file of the website template package -ZipOfWebsitePackageToLoad=or Choose an available embedded website template package -ShowSubcontainers=Show dynamic content -InternalURLOfPage=Internal URL of page -ThisPageIsTranslationOf=This page/container is a translation of -ThisPageHasTranslationPages=This page/container has translation -NoWebSiteCreateOneFirst=No website has been created yet. Create one first. -GoTo=Go to -DynamicPHPCodeContainsAForbiddenInstruction=You add dynamic PHP code that contains the PHP instruction '%s' that is forbidden by default as dynamic content (see hidden options WEBSITE_PHP_ALLOW_xxx to increase list of allowed commands). -NotAllowedToAddDynamicContent=You don't have permission to add or edit PHP dynamic content in websites. Ask permission or just keep code into php tags unmodified. -ReplaceWebsiteContent=Search or Replace website content -DeleteAlsoJs=Delete also all javascript files specific to this website? -DeleteAlsoMedias=Delete also all medias files specific to this website? -MyWebsitePages=My website pages -SearchReplaceInto=Search | Replace into -ReplaceString=New string -CSSContentTooltipHelp=Enter here CSS content. To avoid any conflict with the CSS of the application, be sure to prepend all declaration with the .bodywebsite class. For example:

    #mycssselector, input.myclass:hover { ... }
    must be
    .bodywebsite #mycssselector, .bodywebsite input.myclass:hover { ... }

    Note: If you have a large file without this prefix, you can use 'lessc' to convert it to append the .bodywebsite prefix everywhere. -LinkAndScriptsHereAreNotLoadedInEditor=Warning: This content is output only when site is accessed from a server. It is not used in Edit mode so if you need to load javascript files also in edit mode, just add your tag 'script src=...' into the page. -Dynamiccontent=Sample of a page with dynamic content -ImportSite=Import website template -EditInLineOnOff=Mode 'Edit inline' is %s -ShowSubContainersOnOff=Mode to execute 'dynamic content' is %s -GlobalCSSorJS=Global CSS/JS/Header file of web site -BackToHomePage=Back to home page... -TranslationLinks=Translation links -YouTryToAccessToAFileThatIsNotAWebsitePage=You try to access to a page that is not available.
    (ref=%s, type=%s, status=%s) -UseTextBetween5And70Chars=For good SEO practices, use a text between 5 and 70 characters -MainLanguage=Main language -OtherLanguages=Other languages -UseManifest=Provide a manifest.json file -PublicAuthorAlias=Public author alias -AvailableLanguagesAreDefinedIntoWebsiteProperties=Available languages are defined into website properties -ReplacementDoneInXPages=Replacement done in %s pages or containers -RSSFeed=RSS Feed -RSSFeedDesc=You can get a RSS feed of latest articles with type 'blogpost' using this URL -PagesRegenerated=%s page(s)/container(s) regenerated -RegenerateWebsiteContent=Regenerate web site cache files -AllowedInFrames=Allowed in Frames -DefineListOfAltLanguagesInWebsiteProperties=Define list of all available languages into web site properties. -GenerateSitemaps=Generate website sitemap file -ConfirmGenerateSitemaps=If you confirm, you will erase the existing sitemap file... -ConfirmSitemapsCreation=Confirm sitemap generation -SitemapGenerated=Sitemap file %s generated -ImportFavicon=Favicon -ErrorFaviconType=Favicon must be png -ErrorFaviconSize=Favicon must be sized 16x16, 32x32 or 64x64 -FaviconTooltip=Upload an image which needs to be a png (16x16, 32x32 or 64x64) diff --git a/htdocs/langs/ar_IQ/withdrawals.lang b/htdocs/langs/ar_IQ/withdrawals.lang deleted file mode 100644 index a3773a427a1..00000000000 --- a/htdocs/langs/ar_IQ/withdrawals.lang +++ /dev/null @@ -1,152 +0,0 @@ -# Dolibarr language file - Source file is en_US - withdrawals -CustomersStandingOrdersArea=Payments by Direct debit orders -SuppliersStandingOrdersArea=Payments by Credit transfer -StandingOrdersPayment=Direct debit payment orders -StandingOrderPayment=Direct debit payment order -NewStandingOrder=New direct debit order -NewPaymentByBankTransfer=New payment by credit transfer -StandingOrderToProcess=To process -PaymentByBankTransferReceipts=Credit transfer orders -PaymentByBankTransferLines=Credit transfer order lines -WithdrawalsReceipts=Direct debit orders -WithdrawalReceipt=Direct debit order -BankTransferReceipts=Credit transfer orders -BankTransferReceipt=Credit transfer order -LatestBankTransferReceipts=Latest %s credit transfer orders -LastWithdrawalReceipts=Latest %s direct debit files -WithdrawalsLine=Direct debit order line -CreditTransferLine=Credit transfer line -WithdrawalsLines=Direct debit order lines -CreditTransferLines=Credit transfer lines -RequestStandingOrderToTreat=Requests for direct debit payment order to process -RequestStandingOrderTreated=Requests for direct debit payment order processed -RequestPaymentsByBankTransferToTreat=Requests for credit transfer to process -RequestPaymentsByBankTransferTreated=Requests for credit transfer processed -NotPossibleForThisStatusOfWithdrawReceiptORLine=Not yet possible. Withdraw status must be set to 'credited' before declaring reject on specific lines. -NbOfInvoiceToWithdraw=No. of qualified customer invoices with waiting direct debit order -NbOfInvoiceToWithdrawWithInfo=No. of customer invoice with direct debit payment orders having defined bank account information -NbOfInvoiceToPayByBankTransfer=No. of qualified supplier invoices waiting for a payment by credit transfer -SupplierInvoiceWaitingWithdraw=Vendor invoice waiting for payment by credit transfer -InvoiceWaitingWithdraw=Invoice waiting for direct debit -InvoiceWaitingPaymentByBankTransfer=Invoice waiting for credit transfer -AmountToWithdraw=Amount to withdraw -NoInvoiceToWithdraw=No invoice open for '%s' is waiting. Go on tab '%s' on invoice card to make a request. -NoSupplierInvoiceToWithdraw=No supplier invoice with open 'Direct credit requests' is waiting. Go on tab '%s' on invoice card to make a request. -ResponsibleUser=User Responsible -WithdrawalsSetup=Direct debit payment setup -CreditTransferSetup=Credit transfer setup -WithdrawStatistics=Direct debit payment statistics -CreditTransferStatistics=Credit transfer statistics -Rejects=Rejects -LastWithdrawalReceipt=Latest %s direct debit receipts -MakeWithdrawRequest=Make a direct debit payment request -MakeBankTransferOrder=Make a credit transfer request -WithdrawRequestsDone=%s direct debit payment requests recorded -BankTransferRequestsDone=%s credit transfer requests recorded -ThirdPartyBankCode=Third-party bank code -NoInvoiceCouldBeWithdrawed=No invoice debited successfully. Check that invoices are on companies with a valid IBAN and that IBAN has a UMR (Unique Mandate Reference) with mode %s. -WithdrawalCantBeCreditedTwice=This withdrawal receipt is already marked as credited; this can't be done twice, as this would potentially create duplicate payments and bank entries. -ClassCredited=Classify credited -ClassCreditedConfirm=Are you sure you want to classify this withdrawal receipt as credited on your bank account? -TransData=Transmission date -TransMetod=Transmission method -Send=Send -Lines=Lines -StandingOrderReject=Issue a rejection -WithdrawsRefused=Direct debit refused -WithdrawalRefused=Withdrawal refused -CreditTransfersRefused=Credit transfers refused -WithdrawalRefusedConfirm=Are you sure you want to enter a withdrawal rejection for society -RefusedData=Date of rejection -RefusedReason=Reason for rejection -RefusedInvoicing=Billing the rejection -NoInvoiceRefused=Do not charge the rejection -InvoiceRefused=Invoice refused (Charge the rejection to customer) -StatusDebitCredit=Status debit/credit -StatusWaiting=Waiting -StatusTrans=Sent -StatusDebited=Debited -StatusCredited=Credited -StatusPaid=Paid -StatusRefused=Refused -StatusMotif0=Unspecified -StatusMotif1=Insufficient funds -StatusMotif2=Request contested -StatusMotif3=No direct debit payment order -StatusMotif4=Sales Order -StatusMotif5=RIB unusable -StatusMotif6=Account without balance -StatusMotif7=Judicial Decision -StatusMotif8=Other reason -CreateForSepaFRST=Create direct debit file (SEPA FRST) -CreateForSepaRCUR=Create direct debit file (SEPA RCUR) -CreateAll=Create direct debit file (all) -CreateFileForPaymentByBankTransfer=Create file for credit transfer -CreateSepaFileForPaymentByBankTransfer=Create credit transfer file (SEPA) -CreateGuichet=Only office -CreateBanque=Only bank -OrderWaiting=Waiting for treatment -NotifyTransmision=Record file transmission of order -NotifyCredit=Record credit of order -NumeroNationalEmetter=National Transmitter Number -WithBankUsingRIB=For bank accounts using RIB -WithBankUsingBANBIC=For bank accounts using IBAN/BIC/SWIFT -BankToReceiveWithdraw=Receiving Bank Account -BankToPayCreditTransfer=Bank Account used as source of payments -CreditDate=Credit on -WithdrawalFileNotCapable=Unable to generate withdrawal receipt file for your country %s (Your country is not supported) -ShowWithdraw=Show Direct Debit Order -IfInvoiceNeedOnWithdrawPaymentWontBeClosed=However, if invoice has at least one direct debit payment order not yet processed, it won't be set as paid to allow prior withdrawal management. -DoStandingOrdersBeforePayments=This tab allows you to request a direct debit payment order. Once done, go into menu Bank->Payment by direct debit to generate and manage the direct debit order. When direct debit order is closed, payment on invoices will be automatically recorded, and invoices closed if remainder to pay is null. -DoCreditTransferBeforePayments=This tab allows you to request a credit transfer order. Once done, go into menu Bank->Payment by credit transfer to generate and manage the credit transfer order. When credit transfer order is closed, payment on invoices will be automatically recorded, and invoices closed if remainder to pay is null. -WithdrawalFile=Debit order file -CreditTransferFile=Credit transfer file -SetToStatusSent=Set to status "File Sent" -ThisWillAlsoAddPaymentOnInvoice=This will also record payments on invoices and will classify them as "Paid" if remain to pay is null -StatisticsByLineStatus=Statistics by status of lines -RUM=UMR -DateRUM=Mandate signature date -RUMLong=Unique Mandate Reference -RUMWillBeGenerated=If empty, a UMR (Unique Mandate Reference) will be generated once the bank account information is saved. -WithdrawMode=Direct debit mode (FRST or RECUR) -WithdrawRequestAmount=Amount of Direct debit request: -BankTransferAmount=Amount of Credit Transfer request: -WithdrawRequestErrorNilAmount=Unable to create direct debit request for empty amount. -SepaMandate=SEPA Direct Debit Mandate -SepaMandateShort=SEPA Mandate -PleaseReturnMandate=Please return this mandate form by email to %s or by mail to -SEPALegalText=By signing this mandate form, you authorize (A) %s to send instructions to your bank to debit your account and (B) your bank to debit your account in accordance with the instructions from %s. As part of your rights, you are entitled to a refund from your bank under the terms and conditions of your agreement with your bank. A refund must be claimed within 8 weeks starting from the date on which your account was debited. Your rights regarding the above mandate are explained in a statement that you can obtain from your bank. -CreditorIdentifier=Creditor Identifier -CreditorName=Creditor Name -SEPAFillForm=(B) Please complete all the fields marked * -SEPAFormYourName=Your name -SEPAFormYourBAN=Your Bank Account Name (IBAN) -SEPAFormYourBIC=Your Bank Identifier Code (BIC) -SEPAFrstOrRecur=Type of payment -ModeRECUR=Recurring payment -ModeFRST=One-off payment -PleaseCheckOne=Please check one only -CreditTransferOrderCreated=Credit transfer order %s created -DirectDebitOrderCreated=Direct debit order %s created -AmountRequested=Amount requested -SEPARCUR=SEPA CUR -SEPAFRST=SEPA FRST -ExecutionDate=Execution date -CreateForSepa=Create direct debit file -ICS=Creditor Identifier - ICS -END_TO_END="EndToEndId" SEPA XML tag - Unique id assigned per transaction -USTRD="Unstructured" SEPA XML tag -ADDDAYS=Add days to Execution Date -NoDefaultIBANFound=No default IBAN found for this third party -### Notifications -InfoCreditSubject=Payment of direct debit payment order %s by the bank -InfoCreditMessage=The direct debit payment order %s has been paid by the bank
    Data of payment: %s -InfoTransSubject=Transmission of direct debit payment order %s to bank -InfoTransMessage=The direct debit payment order %s has been sent to bank by %s %s.

    -InfoTransData=Amount: %s
    Method: %s
    Date: %s -InfoRejectSubject=Direct debit payment order refused -InfoRejectMessage=Hello,

    the direct debit payment order of invoice %s related to the company %s, with an amount of %s has been refused by the bank.

    --
    %s -ModeWarning=Option for real mode was not set, we stop after this simulation -ErrorCompanyHasDuplicateDefaultBAN=Company with id %s has more than one default bank account. No way to know wich one to use. -ErrorICSmissing=Missing ICS in Bank account %s -TotalAmountOfdirectDebitOrderDiffersFromSumOfLines=Total amount of direct debit order differs from sum of lines diff --git a/htdocs/langs/ar_IQ/workflow.lang b/htdocs/langs/ar_IQ/workflow.lang deleted file mode 100644 index adfe7f69609..00000000000 --- a/htdocs/langs/ar_IQ/workflow.lang +++ /dev/null @@ -1,26 +0,0 @@ -# Dolibarr language file - Source file is en_US - workflow -WorkflowSetup=Workflow module setup -WorkflowDesc=This module provides some automatic actions. By default, the workflow is open (you can do things in the order you want) but here you can activate some automatic actions. -ThereIsNoWorkflowToModify=There is no workflow modifications available with the activated modules. -# Autocreate -descWORKFLOW_PROPAL_AUTOCREATE_ORDER=Automatically create a sales order after a commercial proposal is signed (the new order will have same amount as the proposal) -descWORKFLOW_PROPAL_AUTOCREATE_INVOICE=Automatically create a customer invoice after a commercial proposal is signed (the new invoice will have same amount as the proposal) -descWORKFLOW_CONTRACT_AUTOCREATE_INVOICE=Automatically create a customer invoice after a contract is validated -descWORKFLOW_ORDER_AUTOCREATE_INVOICE=Automatically create a customer invoice after a sales order is closed (the new invoice will have same amount as the order) -# Autoclassify customer proposal or order -descWORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL=Classify linked source proposal as billed when sales order is set to billed (and if the amount of the order is the same as the total amount of the signed linked proposal) -descWORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL=Classify linked source proposal as billed when customer invoice is validated (and if the amount of the invoice is the same as the total amount of the signed linked proposal) -descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER=Classify linked source sales order as billed when customer invoice is validated (and if the amount of the invoice is the same as the total amount of the linked order) -descWORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER=Classify linked source sales order as billed when customer invoice is set to paid (and if the amount of the invoice is the same as the total amount of the linked order) -descWORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING=Classify linked source sales order as shipped when a shipment is validated (and if the quantity shipped by all shipments is the same as in the order to update) -descWORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED=Classify linked source sales order as shipped when a shipment is closed (and if the quantity shipped by all shipments is the same as in the order to update) -# Autoclassify purchase order -descWORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL=Classify linked source vendor proposal as billed when vendor invoice is validated (and if the amount of the invoice is the same as the total amount of the linked proposal) -descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER=Classify linked source purchase order as billed when vendor invoice is validated (and if the amount of the invoice is the same as the total amount of the linked order) -descWORKFLOW_BILL_ON_RECEPTION=Classify receptions to "billed" when a linked supplier order is validated -# Autoclose intervention -descWORKFLOW_TICKET_CLOSE_INTERVENTION=Close all interventions linked to the ticket when a ticket is closed -AutomaticCreation=Automatic creation -AutomaticClassification=Automatic classification -# Autoclassify shipment -descWORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE=Classify linked source shipment as closed when customer invoice is validated diff --git a/htdocs/langs/ar_IQ/zapier.lang b/htdocs/langs/ar_IQ/zapier.lang deleted file mode 100644 index b4cc4ccba4a..00000000000 --- a/htdocs/langs/ar_IQ/zapier.lang +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright (C) 2019 Frédéric FRANCE -# -# 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 . - -ModuleZapierForDolibarrName = Zapier for Dolibarr -ModuleZapierForDolibarrDesc = Zapier for Dolibarr module -ZapierForDolibarrSetup=Setup of Zapier for Dolibarr -ZapierDescription=Interface with Zapier -ZapierAbout=About the module Zapier -ZapierSetupPage=There is no need for a setup on Dolibarr side to use Zapier. However, you must generate and publish a package on zapier to be able to use Zapier with Dolibarr. See documentation on this wiki page. diff --git a/htdocs/langs/de_AT/admin.lang b/htdocs/langs/de_AT/admin.lang index 4d4d8fa6c0e..47bcbdba9a3 100644 --- a/htdocs/langs/de_AT/admin.lang +++ b/htdocs/langs/de_AT/admin.lang @@ -44,7 +44,6 @@ DetailPosition=Nummer sortieren, um die Menüposition zu definieren NotConfigured=Modul / Anwendung nicht konfiguriert OtherOptions=Andere Optionen OtherSetup=Andere Einstellungen -ClientTZ=Client-Zeitzone (Benutzer) ClientHour=Client-Zeit (Benutzer) DaylingSavingTime=Sommerzeit Language_en_US_es_MX_etc=Sprache (de_AT, en_UK, ...) diff --git a/htdocs/langs/es_AR/admin.lang b/htdocs/langs/es_AR/admin.lang index b210f358131..f9e77952b89 100644 --- a/htdocs/langs/es_AR/admin.lang +++ b/htdocs/langs/es_AR/admin.lang @@ -91,7 +91,6 @@ Destination=Destino IdModule=ID de módulo IdPermissions=ID de permisos LanguageBrowserParameter=Parámetro %s -ClientTZ=Zona horaria del cliente (usuario) ClientHour=Tiempo del cliente (usuario) OSTZ=Zona horaria del SO del servidor PHPTZ=Zona horaria del servidor PHP diff --git a/htdocs/langs/es_CL/admin.lang b/htdocs/langs/es_CL/admin.lang index be394b057d4..138d8a4b455 100644 --- a/htdocs/langs/es_CL/admin.lang +++ b/htdocs/langs/es_CL/admin.lang @@ -95,7 +95,6 @@ Destination=Destino IdModule=ID del módulo IdPermissions=ID de permisos LanguageBrowserParameter=Parámetro %s -ClientTZ=Zona horaria del cliente (usuario) ClientHour=Hora del cliente (usuario) OSTZ=Zona horaria del servidor OS PHPTZ=Servidor PHP Zona horaria diff --git a/htdocs/langs/es_CO/admin.lang b/htdocs/langs/es_CO/admin.lang index e6e2e7de2cd..84170023e1e 100644 --- a/htdocs/langs/es_CO/admin.lang +++ b/htdocs/langs/es_CO/admin.lang @@ -100,7 +100,6 @@ Destination=Destino IdModule=ID de módulo IdPermissions=ID de permisos LanguageBrowserParameter=Parámetro %s -ClientTZ=Zona Horaria del Cliente (usuario) ClientHour=Hora del Cliente (usuario) OSTZ=Zona Horaria del SO del Servidor PHPTZ=Zona Hora del servidor PHP diff --git a/htdocs/langs/es_EC/admin.lang b/htdocs/langs/es_EC/admin.lang index 1f7f805b2ab..1a42f9095b6 100644 --- a/htdocs/langs/es_EC/admin.lang +++ b/htdocs/langs/es_EC/admin.lang @@ -90,7 +90,6 @@ Destination=Destino IdModule=Módulo de Identificación IdPermissions=ID de permisos LanguageBrowserParameter=Parámetros %s -ClientTZ=Zona horaria del cliente ClientHour=Hora del cliente OSTZ=Zona horaria del servidor PHPTZ=Zona horaria del servidor PHP diff --git a/htdocs/langs/es_MX/admin.lang b/htdocs/langs/es_MX/admin.lang index 46c04d6b049..61a78207c66 100644 --- a/htdocs/langs/es_MX/admin.lang +++ b/htdocs/langs/es_MX/admin.lang @@ -86,7 +86,6 @@ IdModule=ID del módulo IdPermissions=ID de permisos LanguageBrowserParameter=Parámetro %s LocalisationDolibarrParameters=Parametros de localización -ClientTZ=Zona Horaria cliente (usuario) OSTZ=Servidor OS Zona Horaria PHPTZ=Servidor PHP Zona Horaria DaylingSavingTime=Hora de verano diff --git a/htdocs/langs/es_MX/eventorganization.lang b/htdocs/langs/es_MX/eventorganization.lang index bcb01e7daa4..49279d946ab 100644 --- a/htdocs/langs/es_MX/eventorganization.lang +++ b/htdocs/langs/es_MX/eventorganization.lang @@ -3,7 +3,6 @@ ModuleEventOrganizationName =Organización de Eventos EventOrganizationDescription =Organización de Eventos a través el Módulo de Proyectos EventOrganizationDescriptionLong=Administrar organización de evento para conferencias, participantes, presentador, y participantes, con página de suscripción pública EventOrganizationConferenceOrBoothMenuLeft =Conferencia o Puesto -EventOrganizationSetup =Configuración de Organización de Evento EventOrganizationSetupPage =Página de organización de evento EVENTORGANIZATION_TASK_LABEL =Etiqueta de tareas para crear automáticamente cuando el proyecto sea validado EVENTORGANIZATION_TASK_LABELTooltip =Cuando validas un evento organizado, algunas tareas pueden ser creadas automáticamente en el proyecto

    Por ejemplo:
    diff --git a/htdocs/langs/fr_FR/accountancy.lang b/htdocs/langs/fr_FR/accountancy.lang index 069e7bba7a9..a92660eb872 100644 --- a/htdocs/langs/fr_FR/accountancy.lang +++ b/htdocs/langs/fr_FR/accountancy.lang @@ -37,8 +37,8 @@ OtherInfo=Autre information DeleteCptCategory=Supprimer le code comptable du groupe ConfirmDeleteCptCategory=Êtes-vous sur de vouloir supprimer ce compte comptable du groupe comptable ? JournalizationInLedgerStatus=Statut de journalisation -AlreadyInGeneralLedger=Déjà transféré en comptabilité -NotYetInGeneralLedger=Pas encore transféré en comptabilité +AlreadyInGeneralLedger=Already transferred to accounting journals and ledger +NotYetInGeneralLedger=Not yet transferred to accouting journals and ledger GroupIsEmptyCheckSetup=Le groupe est vide. Vérifier la configuration du groupe personnalisé DetailByAccount=Afficher le détail par compte AccountWithNonZeroValues=Comptes avec des valeurs non nulles @@ -246,9 +246,9 @@ DescThirdPartyReport=Consultez ici la liste des tiers clients et fournisseurs et ListAccounts=Liste des comptes comptables UnknownAccountForThirdparty=Compte de tiers inconnu. %s sera utilisé UnknownAccountForThirdpartyBlocking=Compte de tiers inconnu. Erreur bloquante. -ThirdpartyAccountNotDefinedOrThirdPartyUnknown=Subledger account not defined or third party or user unknown. We will use %s +ThirdpartyAccountNotDefinedOrThirdPartyUnknown=Compte auxiliaire non défini ou tiers ou utilisateur inconnu. Nous utiliserons %s ThirdpartyAccountNotDefinedOrThirdPartyUnknownSubledgerIgnored=Tiers inconnu et code comptable auxiliaire non défini sur le paiement. Nous conserverons la valeur du compte auxiliaire vide. -ThirdpartyAccountNotDefinedOrThirdPartyUnknownBlocking=Subledger account not defined or third party or user unknown. Blocking error. +ThirdpartyAccountNotDefinedOrThirdPartyUnknownBlocking=Compte auxiliaire non défini ou tiers ou utilisateur inconnu. Erreur blocante. UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking=Compte tiers inconnu et compte d'attente non défini. Erreur blocante. PaymentsNotLinkedToProduct=Paiement non lié à un produit / service OpeningBalance=Solde d'ouverture @@ -298,7 +298,7 @@ NoNewRecordSaved=Plus d'enregistrements à journaliser ListOfProductsWithoutAccountingAccount=Liste des produits non liés à un compte comptable ChangeBinding=Changer les liens Accounted=En comptabilité -NotYetAccounted=Pas encore comptabilisé en comptabilité +NotYetAccounted=Not yet transferred to accounting ShowTutorial=Afficher le tutoriel NotReconciled=Non rapproché WarningRecordWithoutSubledgerAreExcluded=Attention : toutes les opérations sans compte auxiliaire défini sont filtrées et exclues de cet écran @@ -329,8 +329,8 @@ ACCOUNTING_DISABLE_BINDING_ON_PURCHASES=Désactiver la liaison et le transfert e ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS=Désactiver la liaison et le transfert en comptabilité des notes de frais (les notes de frais ne seront pas prises en compte en comptabilité). ## Export -NotifiedExportDate=Date d'exportation notifiée (la modification des enregistrements ne sera pas possible) -NotifiedValidationDate=Validation des enregistrements (la modification ou la suppression des enregistrements ne sera pas possible) +NotifiedExportDate=Flag exported lines as exported (modification of the lines will not be possible) +NotifiedValidationDate=Validate the exported entries (modification or deletion of the lines will not be possible) ConfirmExportFile=Confirmation de la génération du fichier d'export comptable ? ExportDraftJournal=Exporter le journal brouillon Modelcsv=Modèle d'export @@ -339,11 +339,11 @@ Modelcsv_normal=Export standard Modelcsv_CEGID=Export vers CEGID Expert comptabilité Modelcsv_COALA=Export vers Sage Coala Modelcsv_bob50=Export vers Sage BOB 50 -Modelcsv_ciel=Export for Sage50, Ciel Compta or Compta Evo. (Format XIMPORT) +Modelcsv_ciel=Export vers Sage50, Ciel Compta ou Compta Evo. (Format XIMPORT) Modelcsv_quadratus=Export vers Quadratus QuadraCompta Modelcsv_ebp=Export vers EBP Modelcsv_cogilog=Export vers Cogilog -Modelcsv_agiris=Export vers Agiris +Modelcsv_agiris=Export for Agiris Isacompta Modelcsv_LDCompta=Export pour LD Compta (v9) (Test) Modelcsv_LDCompta10=Export pour LD Compta (v10 et supérieure) Modelcsv_openconcerto=Export pour OpenConcerto (Test) @@ -351,9 +351,10 @@ Modelcsv_configurable=Export configurable Modelcsv_FEC=Export FEC Modelcsv_FEC2=Export FEC (avec dates enregistrement et document inversées) Modelcsv_Sage50_Swiss=Export pour Sage 50 Suisse -Modelcsv_winfic=Export pour Winfic - eWinfic - WinSis Compta +Modelcsv_winfic=Export for Winfic - eWinfic - WinSis Compta Modelcsv_Gestinumv3=Export vers Gestinum (v3) -Modelcsv_Gestinumv5Export Pour Gestinum (V5) +Modelcsv_Gestinumv5=Export for Gestinum (v5) +Modelcsv_charlemagne=Export for Aplim Charlemagne ChartofaccountsId=Id plan comptable ## Tools - Init accounting account on product / service diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 9579e51920d..01498f3fce1 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -75,7 +75,7 @@ Dictionary=Dictionnaires ErrorReservedTypeSystemSystemAuto=Erreur, les valeurs 'system' et 'systemauto' sont réservées. Vous pouvez utiliser la valeur 'user' pour ajouter vos propres enregistrements ErrorCodeCantContainZero=Erreur, le code ne peut contenir la valeur 0 DisableJavascript=Désactiver les fonctions Javascript et Ajax -DisableJavascriptNote=Remarque: à des fins de test ou de débogage. Pour une optimisation pour les personnes malvoyantes ou les navigateurs texte, il vaut mieux utiliser la configuration sur le profil utilisateur +DisableJavascriptNote=Note: For test or debug purpose only. For optimization for blind person or text browsers, you may prefer to use the setup on the profile of user UseSearchToSelectCompanyTooltip=Si vous avez un nombre important de tiers (>100 000), vous pourrez améliorer les performances en positionnant la constante COMPANY_DONOTSEARCH_ANYWHERE à 1 dans Configuration->Divers. La recherche sera alors limité au début des chaines. UseSearchToSelectContactTooltip=Si vous avez un nombre important de contacts (>100 000), vous pourrez améliorer les performances en positionnant la constante CONTACT_DONOTSEARCH_ANYWHERE à 1 dans Configuration->Divers. La recherche sera alors limité au début des chaines. DelaiedFullListToSelectCompany=Attendre que vous ayez appuyé sur une touche avant de charger le contenu de la liste déroulante des tiers.
    Cela peut augmenter les performances si vous avez un grand nombre de tiers, mais cela est moins convivial. @@ -133,7 +133,6 @@ IdModule=ID Module IdPermissions=ID Permissions LanguageBrowserParameter=Variable %s LocalisationDolibarrParameters=Paramètres de localisation -ClientTZ=Fuseau horaire client (utilisateur) ClientHour=Heure client (utilisateur) OSTZ=Fuseau horaire OS PHPTZ=Fuseau horaire serveur PHP @@ -161,7 +160,7 @@ Purge=Purger PurgeAreaDesc=Cette page vous permet d'effacer tous les fichiers construits ou stockés par Dolibarr (fichiers temporaires ou tous les fichiers du répertoire %s). L'utilisation de cette fonction n'est pas nécessaire. Elle est fournie pour les utilisateurs qui hébergent Dolibarr chez un hébergeur qui n'offre pas les permissions de supprimer les fichiers sauvegardés par le serveur Web. PurgeDeleteLogFile=Effacer les fichiers de traces de debug, incluant %s défini dans le module 'Journaux et traces' (pas de risque de perte de données) PurgeDeleteTemporaryFiles=Supprimer tous les fichiers journaux et temporaires (aucun risque de perte de données). Le paramètre peut être "tempfilesold", "logfiles" ou les deux "tempfilesold + logfiles". Remarque : la suppression des fichiers temporaires est effectuée uniquement si le répertoire temporaire qui le contient a été créé il y a plus de 24 heures. -PurgeDeleteTemporaryFilesShort=Effacer les fichiers de log et fichiers temporaires +PurgeDeleteTemporaryFilesShort=Delete log and temporary files (no risk of losing data) PurgeDeleteAllFilesInDocumentsDir=Effacer tous les fichiers du répertoire %s.
    Les fichiers temporaires mais aussi les fichiers «dumps» de sauvegarde de base de données, les fichiers joints aux éléments (tiers, factures, ...) ou fichiers stockés dans le module GED seront irrémédiablement effacés. PurgeRunNow=Lancer la purge maintenant PurgeNothingToDelete=Aucun dossier ou fichier à supprimer. @@ -189,7 +188,7 @@ Compression=Compression CommandsToDisableForeignKeysForImport=Commande pour désactiver les clés étrangères à l'importation CommandsToDisableForeignKeysForImportWarning=Requis si vous voulez être en mesure de restaurer votre « dump » SQL plus tard ExportCompatibility=Compatibilité du fichier d'exportation généré -ExportUseMySQLQuickParameter=Utiliser le paramètre --quick +ExportUseMySQLQuickParameter=Utiliser le paramètre --quick ExportUseMySQLQuickParameterHelp=Le paramètre '--quick' aide à réduire la consommation de RAM pour les longues listes MySqlExportParameters=Paramètres de l'exportation MySQL PostgreSqlExportParameters= Paramètres de l'exportation PostgreSQL @@ -210,8 +209,8 @@ FeatureDisabledInDemo=Fonction désactivée dans la démo FeatureAvailableOnlyOnStable=Fonction disponible uniquement sur les versions officielles stables BoxesDesc=Les widgets sont des composants montrant des informations que vous pouvez ajouter à vos pages pour les personnaliser. Vous pouvez choisir de les afficher ou non en sélectionnant la page cible et en cliquant sur "Activer" ou "Désactiver". OnlyActiveElementsAreShown=Seuls les éléments en rapport avec un module actif sont présentés. -ModulesDesc=Les modules Dolibarr définissent quelles fonctionnalités sont disponibles dans le logiciel. Certains modules / applications nécessitent, après activation, d'accorder des autorisations aux utilisateurs. Cliquez sur le bouton activé/désactivé %s pour activer un module/application. -ModulesDesc2=Cliquez sur l'icône roue dentelée %s pour configurer le module/l'application. +ModulesDesc=Les modules/applications définissent quelles fonctionnalités sont disponibles dans le logiciel. Certains modules nécessitent d'accorder des permissions aux utilisateurs après leur activation. Cliquez sur le bouton Activer/Désactiver %s de chaque module pour activer ou désactiver un module/application. +ModulesDesc2=Cliquez sur l'icône de roue dentelée %s pour configurer le module/l'application. ModulesMarketPlaceDesc=D'autres modules/extensions sont disponibles en téléchargement sur des sites externes sur Internet... ModulesDeployDesc=Si les permissions de votre système de fichier le permettent , vous pouvez utiliser cet outil pour déployer un module externe. Le module sera alors visible dans l'onglet %s. ModulesMarketPlaces=Rechercher un module/application externe @@ -336,7 +335,7 @@ MenuHandlers=Gestionnaires de menu MenuAdmin=Édition menu DoNotUseInProduction=Ne pas utiliser en production ThisIsProcessToFollow=Procédure de mise à jour: -ThisIsAlternativeProcessToFollow=Voici une procédure de configuration alternative +ThisIsAlternativeProcessToFollow=Voici une procédure de configuration alternative StepNb=Étape %s FindPackageFromWebSite=Rechercher le paquet qui répond à votre besoin (par exemple sur le site web %s). DownloadPackageFromWebSite=Télécharger le package (par exemple depuis le site web officiel %s) @@ -375,8 +374,8 @@ UMask=Masque des nouveaux fichiers sous Unix/Linux/BSD/Mac. UMaskExplanation=Ce paramètre permet de définir les droits des fichiers créés sur le serveur par Dolibarr (lors d'envois par exemple).
    Ce doit être la valeur octale (par exemple 0666 signifie lecture/écriture pour tous).
    Ce paramètre n'a aucun effet sur un serveur Windows. SeeWikiForAllTeam=Voir le wiki pour le détail de tous les contributeurs et leur organisation UseACacheDelay= Délai de mise en cache de l'export en secondes (0 ou vide pour aucun cache) -DisableLinkToHelpCenter=Cacher le lien «Besoin d'aide ou d'assistance» sur la page de connexion -DisableLinkToHelp=Cacher le lien vers l'aide en ligne %s +DisableLinkToHelpCenter=Cacher le lien «Besoin d'aide ou assistance» sur la page de connexion +DisableLinkToHelp=Cacher le lien vers l'aide en ligne "%s" AddCRIfTooLong=Il n'y a pas de coupure de ligne automatique, aussi si votre texte est trop long sur les documents, il faudra ajouter vous même des retours chariot dans la zone de saisie du texte ConfirmPurge=Êtes-vous sûr de vouloir réaliser cette purge ?
    Ceci effacera définitivement tous vos fichiers (espace GED, pièces jointes, etc...). MinLength=Longueur minimale @@ -498,7 +497,7 @@ WarningPHPMail=AVERTISSEMENT: la configuration pour envoyer des e-mails à parti WarningPHPMailA= - L'utilisation des serveurs de prestataires de messagerie augmente le niveau confiance des e-mails, cela augmente donc les chances de délivrabilité en n'étant pas considéré comme spam. WarningPHPMailB=- Certains fournisseurs de services de messagerie (comme Yahoo) ne vous permettent pas d'envoyer un e-mail à partir d'un autre serveur que leur propre serveur. Votre configuration actuelle utilise le serveur de l'application pour envoyer des e-mails et non le serveur de votre fournisseur de messagerie, donc certains destinataires (ceux compatibles avec le protocole DMARC restrictif), demanderont à votre fournisseur de messagerie si ils peuvent accepter votre message et ce fournisseur de messagerie (comme Yahoo) peut répondre «non» parce que le serveur d'envoi n'est pas le leur, aussi une partie de vos e-mails envoyés peuvent ne pas être acceptés pour la livraison (faites également attention au quota d'envoi de votre fournisseur de messagerie). WarningPHPMailC=- Utiliser le serveur SMTP de votre propre fournisseur de services de messagerie pour envoyer des e-mails est également intéressant afin que tous les e-mails envoyés depuis l'application soient également enregistrés dans votre répertoire "Envoyés" de votre boîte aux lettres. -WarningPHPMailD=Aussi, il est donc recommandé de modifier la méthode d'envoi des e-mails sur la valeur "SMTP". Si vous voulez vraiment conserver la méthode par défaut "PHP", alors vous pouvez ignorer cette alerte ou la supprimer en activant à 1 la constante MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP dans Accueil - Configuration - Divers +WarningPHPMailD=Also, it is therefore recommended to change the sending method of e-mails to the value "SMTP". If you really want to keep the default "PHP" method to send emails, just ignore this warning, or remove it by setting the MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP constant to 1 in Home - Setup - Other. WarningPHPMail2=Si votre fournisseur de messagerie SMTP a besoin de restreindre le client de messagerie à certaines adresses IP (très rare), voici l'adresse IP du mail user agent (MUA) de votre application CRM ERP : %s . WarningPHPMailSPF=Si le nom de domaine de votre adresse e-mail d'expéditeur est protégé par un enregistrement SPF (demandez à votre fournisseur de nom de domaine), vous devez inclure les adresses IP suivantes dans l'enregistrement SPF du DNS de votre domaine: %s . ClickToShowDescription=Cliquer pour afficher la description @@ -517,6 +516,9 @@ Field=Champ ProductDocumentTemplates=Modèle de document pour la fiche produit FreeLegalTextOnExpenseReports=Mention complémentaire sur les notes de frais WatermarkOnDraftExpenseReports=Filigrane sur les notes de frais +ProjectIsRequiredOnExpenseReports=The project is mandatory for entering an expense report +PrefillExpenseReportDatesWithCurrentMonth=Pre-fill start and end dates of new expense report with start and end dates of the current month +ForceExpenseReportsLineAmountsIncludingTaxesOnly=Force the entry of expense report amounts always in amount with taxes AttachMainDocByDefault=Définissez cette valeur sur 1 si vous souhaitez joindre le document principal au courrier électronique par défaut (si applicable) FilesAttachedToEmail=Joindre le fichier SendEmailsReminders=Envoyer des rappels agenda par e-mails @@ -566,7 +568,7 @@ Module53Desc=Gestion des services Module54Name=Contrats/Abonnements Module54Desc=Gestion des contrats (services ou abonnements récurrents) Module55Name=Codes-barres -Module55Desc=Code-barre ou QR Code +Module55Desc=Gestion de Code-barre ou QR Code Module56Name=Paiement par virement bancaire Module56Desc=Gestion des paiements de fournisseurs par virement bancaire. Est incluse la génération des fichiers SEPA pour les pays européens. Module57Name=Règlement par Prélèvement @@ -898,6 +900,11 @@ Permission1002=Créer/modifier entrepôts Permission1003=Supprimer entrepôts Permission1004=Consulter les mouvements de stocks Permission1005=Créer/modifier les mouvements de stocks +Permission1011=Voir les inventaires +Permission1012=Créer un nouvel inventaire +Permission1014=Valider l'inventaire +Permission1015=Autoriser à changer la valeur PMP d'un produit +Permission1016=Supprimer l'inventaire Permission1101=Lire les bons de réception Permission1102=Créer/modifier les bons de réception Permission1104=Valider les bons de réception @@ -1035,7 +1042,7 @@ DictionaryFees=Note de frais - Types de lignes de notes de frais DictionarySendingMethods=Méthodes d'expédition DictionaryStaff=Effectifs DictionaryAvailability=Délai de livraison -DictionaryOrderMethods=Méthodes de commandes +DictionaryOrderMethods=Order methods DictionarySource=Origines des propales/commandes DictionaryAccountancyCategory=Groupes personalisés pour les rapports DictionaryAccountancysystem=Modèles de plan comptable @@ -1168,7 +1175,8 @@ DoNotSuggestPaymentMode=Ne pas suggérer NoActiveBankAccountDefined=Aucun compte bancaire actif défini OwnerOfBankAccount=Propriétaire du compte %s BankModuleNotActive=Module comptes bancaires non activé -ShowBugTrackLink=Définir le lien "%s" (vide pour ne pas afficher ce lien, 'github' pour le lien vers le projet Dolibarr ou définir directement une url 'https:/...') +ShowBugTrackLink=Afficher le lien "%s" +ShowBugTrackLinkDesc=Keep empty to not display this link, use value 'github' for the link to the Dolibarr project or define directly an url 'https://...' Alerts=Alertes DelaysOfToleranceBeforeWarning=Délais avant affichage de l'avertissement alerte retard DelaysOfToleranceDesc=Cet écran permet de définir les délais de tolérance après lesquels une alerte sera signalée à l'écran par le pictogramme %s sur chaque élément en retard. @@ -1193,9 +1201,9 @@ SetupDescription2=Les deux étapes obligatoires sont les deux premières entrée SetupDescription3=%s -> %s

    Paramètres basiques pour personnaliser le comportement par défaut du logiciel (comportement lié au pays par exemple). SetupDescription4= %s -> %s

    Ce logiciel est un ensemble de plusieurs modules/applications. Les fonctionnalités en rapport avec vos besoins doivent être activées et configurées. Les entrées menus seront ajoutées avec l'activation de ces modules. SetupDescription5=Les autres entrées de configuration gèrent des paramètres facultatifs. -SetupDescriptionLink=%s - %s -SetupDescription3b=Basic parameters used to customize the default behavior of your application (e.g for country-related features). -SetupDescription4b=This software is a suite of many modules/applications. The modules related to your needs must be enabled and configured. Menu entries will appears with the activation of these modules. +SetupDescriptionLink= %s - %s +SetupDescription3b=Paramètres de base utilisés pour personnaliser le comportement par défaut de votre application (par exemple pour les fonctionnalités liées au pays). +SetupDescription4b=Ce logiciel est une suite de nombreux modules/applications. Les modules liés à vos besoins doivent être activés et configurés. Les entrées de menu apparaîtront avec l'activation de ces modules. AuditedSecurityEvents=Événements de sécurité audités NoSecurityEventsAreAduited=Aucun événement de sécurité n'est audité. Vous pouvez les activer à partir du menu %s Audit=Événements de sécurité @@ -1218,7 +1226,7 @@ SystemAreaForAdminOnly=Cet espace n'est accessible qu'aux utilisateurs de type a CompanyFundationDesc=Modifiez les informations de votre société/organisation. Cliquez sur le bouton "%s" en bas de page pour sauvegarder. AccountantDesc=Si vous avez un comptable externe, vous pouvez saisir ici ses informations. AccountantFileNumber=Code comptable -DisplayDesc=Vous pouvez choisir ici tous les paramètres liés à l'apparence de Dolibarr +DisplayDesc=Les paramètres affectant l'apparence et la présentation de l'application peuvent être modifiés ici. AvailableModules=Modules/applications disponibles ToActivateModule=Pour activer des modules, aller dans l'espace Configuration (Accueil->Configuration->Modules). SessionTimeOut=Délai expiration des sessions @@ -1270,7 +1278,7 @@ SimpleNumRefNoDateModelDesc=Renvoie le numéro de référence au format %s-nnnn ShowProfIdInAddress=Afficher l'identifiant professionnel dans les adresses ShowVATIntaInAddress=Masquer le numéro de TVA intracommunautaire TranslationUncomplete=Traduction partielle -MAIN_DISABLE_METEO=Désactiver la vue météo +MAIN_DISABLE_METEO=Désactiver la vignette météo MeteoStdMod=Mode standard MeteoStdModEnabled=Mode standard activé MeteoPercentageMod=Mode pourcentage @@ -1341,7 +1349,7 @@ BrowserIsKO=Vous utilisez le navigateur %s. Ce navigateur est déconseillé pour PHPModuleLoaded=Le composant PHP %s est chargé PreloadOPCode=Le code OP préchargé est utilisé AddRefInList=Afficher les références client/fournisseur dans les listes (listes déroulantes ou à autocomplétion) et les libellés des liens clicables.
    Les tiers apparaîtront alors sous la forme "CC12345 - SC45678 - La big company coorp", au lieu de "La big company coorp". -AddVatInList=Afficher le numéro de TVA client/fournisseur dans les listes (listes déroulantes ou à autocomplétion). +AddVatInList=Display Customer/Vendor VAT number. info list (select list or combobox). AddAdressInList=Affiche les informations sur l’adresse du client/fournisseur (liste de sélection ou liste déroulante)
    Les tiers apparaîtront avec le format de nom suivant: "The Big Company corp. - 21, rue du saut 123456 Big town - USA" au lieu de "The Big Company corp". AddEmailPhoneTownInContactList=Afficher l'adresse e-mail du contact (ou les téléphones si non définis) et la ville
    Les contacts apparaîtront avec un nom au format "Dupond Durand - dupond.durand@email.com - Paris" ou "Dupond Durand - 06 07 59 65 66 - Paris" au lieu de "Dupond Durand". AskForPreferredShippingMethod=Demander la méthode d'expédition préférée pour les Tiers @@ -1352,7 +1360,7 @@ NumberingModules=Modèles de numérotation DocumentModules=Modèles de documents ##### Module password generation PasswordGenerationStandard=Renvoie un mot de passe généré selon l'algorythme interne de Dolibarr :%s caractères contenant chiffres et minuscules -PasswordGenerationNone=Ne pas suggérer un mot de passe généré. Le mot de passe doit être entré manuellement. +PasswordGenerationNone=Ne pas suggérer un mot de passe généré. Le mot de passe doit être entré manuellement. PasswordGenerationPerso=Renvoie un mot de passe en fonction d'une configuration personnalisée. SetupPerso=Selon votre configuration PasswordPatternDesc=Description du masque du mot de passe @@ -1373,7 +1381,7 @@ AccountCodeManager=Options pour la génération automatique de codes comptable c NotificationsDesc=Les notifications activent l'envoi d'e-mails automatiques pour certains événements de Dolibarr. L'envoi de ces e-mails automatiques peut-être défini : NotificationsDescUser=* par utilisateur, pour chaque utilisateur NotificationsDescContact=* par contacts de tiers (clients ou fournisseur), pour chaque contact -NotificationsDescGlobal=* ou en définissant des emails cibles fixes sur la page de configuration du module. +NotificationsDescGlobal=* ou en définissant des adresses e-mail globales dans la page de configuration du module. ModelModules=Modèle de documents DocumentModelOdt=Génération depuis des modèles OpenDocument (Fichier .ODT ou .ODS LibreOffice, KOffice, TextEdit…) WatermarkOnDraft=Filigrane sur les documents brouillons @@ -1428,7 +1436,7 @@ OrdersNumberingModules=Modèles de numérotation des commandes OrdersModelModule=Modèles de document des commandes FreeLegalTextOnOrders=Mention complémentaire sur les commandes WatermarkOnDraftOrders=Filigrane sur les brouillons de commandes (aucun si vide) -ShippableOrderIconInList=Ajouter une icône dans la liste des commandes qui indique si la commande est expédiable. +ShippableOrderIconInList=Ajouter une icône dans la liste des commandes qui indique si la commande est expédiable. BANK_ASK_PAYMENT_BANK_DURING_ORDER=Demander le compte bancaire cible durant la commande ##### Interventions ##### InterventionsSetup=Configuration du module Interventions @@ -1473,10 +1481,10 @@ LDAPSynchronizeMembersTypes=Types d'adhérents de l'annuaire LDAP de l'associati LDAPPrimaryServer=Serveur primaire LDAPSecondaryServer=Serveur secondaire LDAPServerPort=Port du serveur -LDAPServerPortExample=Port par défaut : 389 +LDAPServerPortExample=Standard or StartTLS: 389, LDAPs: 636 LDAPServerProtocolVersion=Version du protocole LDAPServerUseTLS=Utiliser TLS -LDAPServerUseTLSExample=Votre serveur utilise le TLS +LDAPServerUseTLSExample=Your LDAP server use StartTLS LDAPServerDn=DN du serveur LDAPAdminDn=DN de l'administrateur LDAPAdminDnExample=Direction complète (exemple : cn = admin, dc = exemple, dc = com ou cn = Adminitrateur, cn = utilisateurs, dc = exemple, dc = com pour active directory) @@ -1618,7 +1626,7 @@ TestNotPossibleWithCurrentBrowsers=Une détection automatique n'est pas possible DefaultValuesDesc=Vous pouvez définir/forcer ici la valeur par défaut que vous voulez obtenir lorsque vous créez un nouvel enregistrement, et/ou les filtres par défaut ou ordre de tri des listes. DefaultCreateForm=Valeurs par défaut (sur les formulaires de création) DefaultSearchFilters=Filtres de recherche par défaut -DefaultSortOrder=Ordre de tri par défaut +DefaultSortOrder=Ordre de tri par défaut DefaultFocus=Champs par défaut ayant le focus DefaultMandatory=Champs de formulaire obligatoires ##### Products ##### @@ -1626,8 +1634,7 @@ ProductSetup=Configuration du module Produits ServiceSetup=Configuration du module Services ProductServiceSetup=Configuration des modules Produits et Services NumberOfProductShowInSelect=Nombre maximum de produits dans les listes déroulantes (0=aucune limite) -ViewProductDescInFormAbility=Afficher les descriptions de produits dans les formulaires (sinon, comme info-bulle contextuelle) -DoNotAddProductDescAtAddLines=Ne pas ajouter la description du produit (saisie sur sa fiche) à l'ajout d'un produit +ViewProductDescInFormAbility=Display product descriptions in lines of items (otherwise show description in a tooltip popup) OnProductSelectAddProductDesc=Comment utiliser la description des produits lors de l'ajout d'un produit en tant que ligne d'un document AutoFillFormFieldBeforeSubmit=Remplir automatiquement le champ description avec la description du produit DoNotAutofillButAutoConcat=Ne pas remplir automatiquement le champ de saisie avec la description du produit. La description du produit sera concaténée automatiquement avec la description saisie. @@ -1706,8 +1713,10 @@ FreeLegalTextOnDeliveryReceipts=Mention complémentaire sur les bons de récepti ##### FCKeditor ##### AdvancedEditor=Editeur avancé ActivateFCKeditor=Activer l'éditeur avancé pour : -FCKeditorForCompany=Création/édition WYSIWIG de la description et note des éléments (autre que produits/services) -FCKeditorForProduct=Création/édition WYSIWIG de la description et note des produits/services +FCKeditorForNotePublic=WYSIWIG creation/edition of the field public notes of elements +FCKeditorForNotePrivate=WYSIWIG creation/edition of the field private notes of elements +FCKeditorForCompany=WYSIWIG creation/edition of the field description of elements (except products/services) +FCKeditorForProduct=WYSIWIG creation/edition of the field description of products/services FCKeditorForProductDetails=Création/édition WYSIWYG des lignes de détails produits sur tous les éléments (commandes, propales, factures, etc...). Attention: L'utilisation pour ce cas est fortement déconseillée car peut créer des problèmes dans la gestion de caractères et mise en page des fichiers PDF générés. FCKeditorForMailing= Création/édition WYSIWIG des emailings (Outils->Emailings) FCKeditorForUserSignature=Création/édition WYSIWIG de la signature des utilisateurs @@ -1786,7 +1795,7 @@ ClickToDialSetup=Configuration du module Click To Dial ClickToDialUrlDesc=URL appelée quand un clic sur l'icône téléphone est fait. Dans l'URL, vous pouvez utiliser les tags
    __PHONETO__ qui sera remplacée par le numéro de téléphone de la personne à appeler
    __PHONEFROM__ qui sera remplacée par le numéro de l'appelant (vous)
    __LOGIN__ qui sera remplacée par l'identifiant d'accès de l'utilisateur à l'application d'appel (à définir sur la fiche utilisateur) et
    __PASS__ qui sera remplacée par le mot de passe d'accès de l'utilisateur à l'application d'appel (également à définir sur la fiche utilisateur). ClickToDialDesc=Ce module permet de rendre les numéros de téléphone cliquables lorsque vous utilisez l'application sur un ordinateur de bureau. Un clic sur cette icône composera le numéro de téléphone. Cela peut être utilisé pour commencer une conversation avec un soft phone sur votre bureau ou lorsque vous utilisez un système basé sur le protocole SIP par exemple. Note: Sur un smartphone, les numéros de téléphones sont toujours clicables. ClickToDialUseTelLink=Utiliser un lien "tel:" sur les numéros de téléphone -ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or a software interface, installed on the same computer as the browser, and called when you click on a link starting with "tel:" in your browser. If you need a link that start with "sip:" or a full server solution (no need of local software installation), you must set this to "No" and fill the next field. +ClickToDialUseTelLinkDesc=Utilisez cette méthode si vos utilisateurs disposent d'un softphone ou d'une interface logicielle, installés sur le même ordinateur que le navigateur, et appelés lorsque vous cliquez sur un lien commençant par "tel:" dans votre navigateur. Si vous avez besoin d'un lien commençant par "sip:" ou d'une solution via un serveur (pas besoin d'installation de logiciel local), vous devez définir ce champ sur "Non" et remplir le champ suivant. ##### Point Of Sale (CashDesk) ##### CashDesk=Point de Vente CashDeskSetup=Configuration du module Point de vente/caisse enregistreuse @@ -1833,7 +1842,7 @@ ChequeReceiptsNumberingModule=Module de numérotation des bordereaux de remises MultiCompanySetup=Configuration du module Multi-société ##### Suppliers ##### SuppliersSetup=Configuration du module Fournisseurs -SuppliersCommandModel=Modèle de commande fournisseur complet +SuppliersCommandModel=Modèle de commande fournisseur complet SuppliersCommandModelMuscadet=Modèle de commande fournisseur complet (ancienne implémentation du modèle Cornas) SuppliersInvoiceModel=Modèle de facture fournisseur complet SuppliersInvoiceNumberingModel=Modèles de numérotation des factures fournisseur @@ -1868,7 +1877,7 @@ NbMajMin=Nombre minimal de caractères majuscules NbNumMin=Nombre minimal de caractères numériques NbSpeMin=Nombre minimal de caractères spéciaux NbIteConsecutive=Nombre maximal de répétition des mêmes caractères -NoAmbiCaracAutoGeneration=Ne pas utiliser des caractères ambigus ("1","l","i","|","0","O") pour la génération automatique +NoAmbiCaracAutoGeneration=Ne pas utiliser des caractères ambigus ("1","l","i","|","0","O") pour la génération automatique SalariesSetup=Configuration du module salaires SortOrder=Ordre de tri Format=Format @@ -1888,7 +1897,7 @@ GoOntoContactCardToAddMore=Rendez-vous sur l'onglet "Notifications" d'un tiers p Threshold=Seuil BackupDumpWizard=Assistant pour créer le fichier dump de la base de données BackupZipWizard=Assistant pour générer l'archive du répertoire documents -SomethingMakeInstallFromWebNotPossible=L'installation de module externe est impossible depuis l'interface web pour la raison suivante : +SomethingMakeInstallFromWebNotPossible=L'installation de module externe est impossible depuis l'interface web pour la raison suivante : SomethingMakeInstallFromWebNotPossible2=Pour cette raison, le processus de mise à jour décrit ici est une processus manuel que seul un utilisateur ayant des droits privilégiés peut réaliser. InstallModuleFromWebHasBeenDisabledByFile=L'installation de module externe depuis l'application a été désactivé par l'administrator. Vous devez lui demander de supprimer le fichier %s pour permettre cette fonctionnalité. ConfFileMustContainCustom=Installer ou créer un module externe à partir de l'application nécessite de sauvegarder les fichiers du module dans le répertoire %s. Pour que ce répertoire soit reconnu par Dolibarr, vous devez paramétrer le fichier de configuration conf/conf.php en ajoutant les 2 lignes suivantes :
    $dolibarr_main_url_root_alt='/custom'
    $dolibarr_main_document_root_alt='%s/custom'; @@ -1920,7 +1929,7 @@ SellTaxRate=Taux de TVA RecuperableOnly=Oui pour une TVA "Non Perçue mais Récupérable" dédiée à certains pays comme la France. Gardez la valeur à "Non" dans tous les autres cas. UrlTrackingDesc=Si le fournisseur ou le service de transport offrent une page ou un site Web pour vérifier l'état de l'expédition, vous pouvez l'entrer ici. Vous pouvez utiliser la clé {TRACKID} dans les paramètres d'URL afin que le système la remplace par la valeur du numéro de suivi entré sur la fiche d'expédition. OpportunityPercent=Lorsque vous créez une opportunité, vous pouvez ďéfinir un montant estimatif de projet/affaire. Selon le statut de l'opportunité, ce montant peut être multiplié par ce taux pour évaluer le montant probable que vos opportunités sont susceptibles de générer. La valeur est un pourcentage (entre 0 et 100). -TemplateForElement=Cet enregistrement modèle est dédié à quel élément +TemplateForElement=This mail template is related to what type of object? An email template is available only when using the "Send Email" button from the related object. TypeOfTemplate=Type de modèle TemplateIsVisibleByOwnerOnly=Le modèle est visible par le propriétaire seulement VisibleEverywhere=Visible partout @@ -1996,8 +2005,12 @@ MAIN_PDF_MARGIN_TOP=Marge haute sur les PDF MAIN_PDF_MARGIN_BOTTOM=Marge bas sur les PDF MAIN_DOCUMENTS_LOGO_HEIGHT=Hauteur du logo sur les PDFs MAIN_GENERATE_PROPOSALS_WITH_PICTURE=Ajouter une image à la ligne de proposition -PROPOSAL_PDF_HIDE_PAYMENTTERM=Hide payments conditions -PROPOSAL_PDF_HIDE_PAYMENTMODE=Hide payment mode +MAIN_PDF_NO_SENDER_FRAME=Masquer les bordures dans le cadre de l'adresse de l'expéditeur +MAIN_PDF_NO_RECIPENT_FRAME=Masquer les bordures dans le cadre de l'adresse du destinataire +MAIN_PDF_HIDE_CUSTOMER_CODE=Masquer le code client +MAIN_PDF_HIDE_SENDER_NAME=Masquer l'expéditeur/le nom de l'entreprise dans le bloc d'adresse +PROPOSAL_PDF_HIDE_PAYMENTTERM=Masquer les conditions de paiement +PROPOSAL_PDF_HIDE_PAYMENTMODE=Masquer le mode de paiement MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING=Ajouter une signature électronique au PDF NothingToSetup=Aucune configuration particulière n'est requise pour ce module. SetToYesIfGroupIsComputationOfOtherGroups=Réglez ceci sur Oui si ce groupe est un calcul d'autres groupes @@ -2137,7 +2150,7 @@ AskThisIDToYourBank=Contacter votre établissement bancaire pour obtenir ce code AdvancedModeOnly=Autorisation disponible en mode Autorisations avancées uniquement ConfFileIsReadableOrWritableByAnyUsers=Le fichier conf est lisible ou inscriptible par tous les utilisateurs. Donnez l'autorisation à l'utilisateur et au groupe du serveur Web uniquement. MailToSendEventOrganization=Organisation d'événements -MailToPartnership=Partnership +MailToPartnership=Partenariat AGENDA_EVENT_DEFAULT_STATUS=État de l’événement par défaut lors de la création d’un événement à partir du formulaire YouShouldDisablePHPFunctions=Vous devriez désactiver les fonctions PHP IfCLINotRequiredYouShouldDisablePHPFunctions=Sauf si vous avez besoin de lancer des commandes système, vous devriez désactiver les fonctions PHP @@ -2146,7 +2159,7 @@ NoWritableFilesFoundIntoRootDir=Aucun fichier ou répertoire des programmes cour RecommendedValueIs=Recommandé : %s Recommended=Recommandé NotRecommended=Non recommandé -ARestrictedPath=Un chemin restreint +ARestrictedPath=Some restricted path CheckForModuleUpdate=Vérifier les mises à jour des modules externes CheckForModuleUpdateHelp=Cette action se connecte aux éditeurs des modules externes pour vérifier si une nouvelle version est disponible. ModuleUpdateAvailable=Une mise à jour est disponible @@ -2158,5 +2171,27 @@ DatabasePasswordObfuscated=Le mot de passe de la base de données est masqué da DatabasePasswordNotObfuscated=Le mot de passe de la base de données n'est PAS masqué dans le fichier de configuration APIsAreNotEnabled=Les modules API ne sont pas activés YouShouldSetThisToOff=Vous devriez mettre ceci à 0 ou off -InstallAndUpgradeLockedBy=Install and upgrades are locked by the file %s -OldImplementation=Old implementation +InstallAndUpgradeLockedBy=L'installation et les mises à jour sont verrouillées par le fichier %s +OldImplementation=Ancienne implémentation +PDF_SHOW_LINK_TO_ONLINE_PAYMENT=Si certains modules de paiement en ligne sont activés (Paypal, Stripe, ...), ajouter un lien sur le PDF pour effectuer le paiement en ligne +DashboardDisableGlobal=Disable globally all the thumbs of open objects +BoxstatsDisableGlobal=Disable totally box statistics +DashboardDisableBlocks=Thumbs of open objects (to process or late) on main dashboard +DashboardDisableBlockAgenda=Disable the thumb for agenda +DashboardDisableBlockProject=Disable the thumb for projects +DashboardDisableBlockCustomer=Disable the thumb for customers +DashboardDisableBlockSupplier=Disable the thumb for suppliers +DashboardDisableBlockContract=Disable the thumb for contracts +DashboardDisableBlockTicket=Disable the thumb for tickets +DashboardDisableBlockBank=Disable the thumb for banks +DashboardDisableBlockAdherent=Disable the thumb for memberships +DashboardDisableBlockExpenseReport=Disable the thumb for expense reports +DashboardDisableBlockHoliday=Disable the thumb for leaves +EnabledCondition=Condition to have field enabled (if not enabled, visibility will always be off) +IfYouUseASecondTaxYouMustSetYouUseTheMainTax=If you want to use a second tax, you must enable also the first sale tax +IfYouUseAThirdTaxYouMustSetYouUseTheMainTax=If you want to use a third tax, you must enable also the first sale tax +LanguageAndPresentation=Language and presentation +SkinAndColors=Skin and colors +IfYouUseASecondTaxYouMustSetYouUseTheMainTax=If you want to use a second tax, you must enable also the first sale tax +IfYouUseAThirdTaxYouMustSetYouUseTheMainTax=If you want to use a third tax, you must enable also the first sale tax +PDF_USE_1A=Generate PDF with PDF/A-1b format diff --git a/htdocs/langs/fr_FR/agenda.lang b/htdocs/langs/fr_FR/agenda.lang index 33faad30cdf..496059137fe 100644 --- a/htdocs/langs/fr_FR/agenda.lang +++ b/htdocs/langs/fr_FR/agenda.lang @@ -64,6 +64,7 @@ ShipmentClassifyClosedInDolibarr=Expédition %s classée payée ShipmentUnClassifyCloseddInDolibarr=Expédition %s réouverte ShipmentBackToDraftInDolibarr=Expédition %s remise au statut brouillon ShipmentDeletedInDolibarr=Expédition %s supprimée +ShipmentCanceledInDolibarr=Shipment %s canceled ReceptionValidatedInDolibarr=Réception %s validée OrderCreatedInDolibarr=Commande %s créée OrderValidatedInDolibarr=Commande %s validée @@ -170,4 +171,4 @@ ReminderType=Type de rappel AddReminder=Créer une notification de rappel automatique pour cet événement ErrorReminderActionCommCreation=Erreur lors de la création de la notification de rappel pour cet événement BrowserPush=Notification par Popup navigateur -ActiveByDefault=Activation par défaut +ActiveByDefault=Activé par défaut diff --git a/htdocs/langs/fr_FR/bills.lang b/htdocs/langs/fr_FR/bills.lang index 1a825e09792..f8735a8e417 100644 --- a/htdocs/langs/fr_FR/bills.lang +++ b/htdocs/langs/fr_FR/bills.lang @@ -60,7 +60,7 @@ SupplierBill=Facture fournisseur SupplierBills=Factures fournisseur Payment=Règlement PaymentBack=Remboursement -CustomerInvoicePaymentBack=Rembourser +CustomerInvoicePaymentBack=Remboursement Payments=Règlements PaymentsBack=Remboursements paymentInInvoiceCurrency=Dans la devise des factures @@ -234,12 +234,17 @@ AlreadyPaidBack=Déjà remboursé AlreadyPaidNoCreditNotesNoDeposits=Déjà réglé (hors avoirs et acomptes) Abandoned=Abandonné RemainderToPay=Reste à payer +RemainderToPayMulticurrency=Reste impayé, devise d'origine RemainderToTake=Montant restant à percevoir +RemainderToTakeMulticurrency=Montant restant à encaisser, devise d'origine RemainderToPayBack=Montant restant à rembourser +RemainderToPayBackMulticurrency=Montant restant à rembourser, devise d'origine Rest=Créance AmountExpected=Montant réclamé ExcessReceived=Trop perçu +ExcessReceivedMulticurrency=Excédent reçu, devise d'origine ExcessPaid=Excédent payé +ExcessPaidMulticurrency=Excédent payé, devise d'origine EscompteOffered=Escompte (règl. avt échéance) EscompteOfferedShort=Escompte SendBillRef=Envoi de la facture %s @@ -260,6 +265,7 @@ DateInvoice=Date facturation DatePointOfTax=Date elligibilitée taxe NoInvoice=Aucune facture NoOpenInvoice=Pas de facture ouverte +NbOfOpenInvoices=Number of open invoices ClassifyBill=Classer la facture SupplierBillsToPay=Factures fournisseurs impayées CustomerBillsUnpaid=Factures clients impayées @@ -570,7 +576,7 @@ ToCreateARecurringInvoiceGene=Pour générer de futures factures régulièrement ToCreateARecurringInvoiceGeneAuto=Si vous avez besoin que de telles factures soient générées automatiquement, demandez à votre administrateur d'activer et configurer le module %s. Notez que les deux méthodes de générations de factures (manuelles et automatiques) peuvent être utilisées en cohabitation sans risque de création de doublon. DeleteRepeatableInvoice=Supprimer facture modèle ConfirmDeleteRepeatableInvoice=Est-ce votre sûr de vouloir supprimer la facture modèle ? -CreateOneBillByThird=Créer une facture par tiers (sinon, une facture par commande) +CreateOneBillByThird=Créer une facture par tiers (sinon, une facture par objet sélectionné) BillCreated=%s facture(s) générée(s) BillXCreated=Facture %s générée StatusOfGeneratedDocuments=Statut de génération du document @@ -591,3 +597,5 @@ SituationTotalRayToRest=Reste à payer HT PDFSituationTitle=Situation n°%d SituationTotalProgress=Avancement total %d %% SearchUnpaidInvoicesWithDueDate=Rechercher les factures impayées avec date d'échéance = %s +NoPaymentAvailable=Aucun paiement disponible pour %s +PaymentRegisteredAndInvoiceSetToPaid=Paiement enregistré et facture %s passée à payée diff --git a/htdocs/langs/fr_FR/cashdesk.lang b/htdocs/langs/fr_FR/cashdesk.lang index 45679973a66..254d9c766cf 100644 --- a/htdocs/langs/fr_FR/cashdesk.lang +++ b/htdocs/langs/fr_FR/cashdesk.lang @@ -42,7 +42,7 @@ AddTable=Ajouter une table Place=Emplacement TakeposConnectorNecesary='Connecteur TakePOS' requis OrderPrinters=Ajoute un bouton qui permet d'envoyer une commande sans paiement sur certaines imprimantes spécifiques (par exemple pour envoyer une commande en cuisine) -NotAvailableWithBrowserPrinter=Non disponible lorsque l'imprimante pour reçu est définie sur navigateur: +NotAvailableWithBrowserPrinter=Non disponible lorsque l'imprimante pour reçu est définie sur navigateur SearchProduct=Rechercher un produit Receipt=Reçu Header=Entête @@ -128,7 +128,8 @@ PrintPaymentMethodOnReceipts=Imprimer le mode de paiement sur les tickets | reç WeighingScale=échelle de poids ShowPriceHT = Afficher la colonne du prix HT (à l'écran) ShowPriceHTOnReceipt = Afficher la colonne avec le prix hors taxes (sur le ticket de caisse) -CustomerDisplay=Customer display -PrintWithoutDetailsButton=Ajouter un bouton "Imprimer sans détail" -PrintWithoutDetailsLabelDefault=Libellé de la ligne par défaut sur l'impression sans détail -PrintWithoutDetails=Imprimer sans détail +CustomerDisplay=Affichage client +SplitSale=Fractionner la vente +PrintWithoutDetailsButton=Add "Print without details" button +PrintWithoutDetailsLabelDefault=Line label by default on printing without details +PrintWithoutDetails=Print without details diff --git a/htdocs/langs/fr_FR/categories.lang b/htdocs/langs/fr_FR/categories.lang index 20bfb122c75..cf549eb8670 100644 --- a/htdocs/langs/fr_FR/categories.lang +++ b/htdocs/langs/fr_FR/categories.lang @@ -17,7 +17,6 @@ ContactsCategoriesArea=Espace tags/catégories de contacts AccountsCategoriesArea=Espace des tags/categories de comptes bancaires ProjectsCategoriesArea=Espace des tags/catégories des projets UsersCategoriesArea=Espace des tags/catégories des utilisateurs -TicketsCategoriesArea=Espace tags/catégories des tickets SubCats=Sous-catégories CatList=Liste des tags/catégories CatListAll=Liste de toutes les catégories (de tous types) @@ -91,11 +90,11 @@ CategorieRecursivHelp=Si l'option est activé, quand un produit est ajouté dans AddProductServiceIntoCategory=Ajouter le produit/service suivant AddCustomerIntoCategory=Assigner cette catégorie au client AddSupplierIntoCategory=Assigner cette catégorie au fournisseur -AddTicketIntoCategory=Assigner cette catégorie au ticket ShowCategory=Afficher tag/catégorie ByDefaultInList=Par défaut dans la liste ChooseCategory=Choisissez une catégorie StocksCategoriesArea=Catégories d’entrepôt ActionCommCategoriesArea=Catégories d’événements WebsitePagesCategoriesArea=Catégories des pages-conteneurs +KnowledgemanagementsCategoriesArea=KM article Categories UseOrOperatorForCategories=Utiliser l'opérateur 'ou' pour les catégories diff --git a/htdocs/langs/fr_FR/compta.lang b/htdocs/langs/fr_FR/compta.lang index 4628673fd9e..280069f5cf9 100644 --- a/htdocs/langs/fr_FR/compta.lang +++ b/htdocs/langs/fr_FR/compta.lang @@ -142,7 +142,7 @@ PayVAT=Payer une déclaration de TVA PaySalary=Payer un salaire ConfirmPaySocialContribution=Voulez-vous vraiment classer cette taxe sociale ou fiscale comme payée? ConfirmPayVAT=Voulez-vous vraiment classer cette déclaration de TVA comme payée ? -ConfirmPaySalary=Voulez-vous vraiment classer ce salaire comme payée ? +ConfirmPaySalary=Voulez-vous vraiment classer ce salaire comme payé ? DeleteSocialContribution=Effacer une charge fiscale ou sociale DeleteVAT=Supprimer une déclaration de TVA DeleteSalary=Supprimer un salaire @@ -191,9 +191,9 @@ LT2ReportByCustomersES=Rapport par client des IRPF VATReport=Rapport TVA VATReportByPeriods=Rapport de TVA par période VATReportByMonth=Rapport de TVA par mois -VATReportByRates=Rapport TVA par taux -VATReportByThirdParties=Rapport TVA par Tiers -VATReportByCustomers=Rapport par client +VATReportByRates=Rapport de TVA par taux +VATReportByThirdParties=Rapport de TVA par tiers +VATReportByCustomers=Rapport de TVA par client VATReportByCustomersInInputOutputMode=Rapport par client des TVA collectées et payées VATReportByQuartersInInputOutputMode=Rapport par taux des TVA collectées et payées VATReportShowByRateDetails=Afficher les détails de ce taux @@ -204,9 +204,9 @@ LT2ReportByQuartersES=Rapport par taux de IRPF SeeVATReportInInputOutputMode=Cliquer sur %sTVA encaissement%s pour mode de calcul standard SeeVATReportInDueDebtMode=Cliquer sur %sTVA sur débit%s pour mode de calcul avec option sur les débits RulesVATInServices=- Pour les services, le rapport inclut les TVA des règlements effectivement reçus ou émis en se basant sur la date du règlement. -RulesVATInProducts=- Pour les biens matériels, il inclut les TVA des factures en se basant sur la date de facture. +RulesVATInProducts=- Pour les biens matériels, il inclut les TVA des règlements effectivement reçus ou émis en se basant sur la date du règlement. RulesVATDueServices=- Pour les services, le rapport inclut les TVA des factures dues, payées ou non en se basant sur la date de facture. -RulesVATDueProducts=- Pour les biens matériels, il inclut les TVA des factures en se basant sur la date de facture. +RulesVATDueProducts=- Pour les biens matériels, il inclut les TVA des factures dues, payées ou non en se basant sur la date de facture. OptionVatInfoModuleComptabilite=Remarque : Pour les biens matériels, il faudrait utiliser la date de livraison pour être plus juste. ThisIsAnEstimatedValue=Il s'agit d'un aperçu, basé sur les événements métiers et non sur la table du grand livre final, de sorte que les résultats finaux peuvent différer de ces valeurs d'aperçu. PercentOfInvoice=%%/facture @@ -286,9 +286,12 @@ ReportPurchaseTurnover=Chiffre d'affaires d'achat facturé ReportPurchaseTurnoverCollected=Chiffre d'affaires d'achat encaissé IncludeVarpaysInResults = Inclure les paiements divers dans les rapports IncludeLoansInResults = Inclure les prêts dans les rapports -InvoiceLate30Days = Factures en retard > 30 jours -InvoiceLate15Days = Factures en retard > 15 jours -InvoiceLateMinus15Days = Factures en retard -InvoiceNotLate = A recevoir < 15 jours -InvoiceNotLate15Days = A recevoir dans 15 jours -InvoiceNotLate30Days = A recevoir dans 30 jours +InvoiceLate30Days = Factures en retard (plus de 30 jours) +InvoiceLate15Days = Factures en retard (entre 15 et 30 jours) +InvoiceLateMinus15Days = Factures en retard (de moins de 15 jours) +InvoiceNotLate = A recevoir (d'ici 15 jours) +InvoiceNotLate15Days = A recevoir (dans 15 à 30 jours) +InvoiceNotLate30Days = A recevoir (dans plus de 30 jours) +InvoiceToPay=A payer (dans moins de 15 jours) +InvoiceToPay15Days=A payer (d'ici 15 à 30 jours) +InvoiceToPay30Days=A payer (dans plus de 30 jours) diff --git a/htdocs/langs/fr_FR/ecm.lang b/htdocs/langs/fr_FR/ecm.lang index c5867cbc7ed..e54f1852bf4 100644 --- a/htdocs/langs/fr_FR/ecm.lang +++ b/htdocs/langs/fr_FR/ecm.lang @@ -45,5 +45,5 @@ GenerateImgWebp=Dupliquer toutes les images avec une autre version au format .we ConfirmGenerateImgWebp=Si vous confirmez, vous générerez une image au format .webp pour toutes les images actuellement dans ce dossier (les sous-dossiers ne sont pas inclus)... ConfirmImgWebpCreation=Confirmer la duplication de toutes les images SucessConvertImgWebp=Images dupliquées avec succès -ECMDirName=Nom du dossier -ECMParentDirectory=Dossier parent +ECMDirName=Dir name +ECMParentDirectory=Parent directory diff --git a/htdocs/langs/fr_FR/errors.lang b/htdocs/langs/fr_FR/errors.lang index 32090a13126..ec95b85ed9d 100644 --- a/htdocs/langs/fr_FR/errors.lang +++ b/htdocs/langs/fr_FR/errors.lang @@ -83,7 +83,7 @@ ErrorCantSaveADoneUserWithZeroPercentage=Impossible de sauver une action à l'é ErrorRefAlreadyExists=Le référence %s existe déjà. ErrorPleaseTypeBankTransactionReportName=Choisissez le nom du relevé bancaire sur lequel la ligne est rapportées (Format AAAAMM ou AAAAMMJJ) ErrorRecordHasChildren=Impossible de supprimer l'enregistrement car il possède des enregistrements fils. -ErrorRecordHasAtLeastOneChildOfType=L'objet %s a au moins un enfant de type %s +ErrorRecordHasAtLeastOneChildOfType=Object %s has at least one child of type %s ErrorRecordIsUsedCantDelete=Ne peut effacer l'enregistrement. Ce dernier est déjà utilisé ou inclut dans un autre élément. ErrorModuleRequireJavascript=Le javascript ne doit pas être désactivé pour que cette fonctionnalité soit utilisable. Pour activer/désactiver l'utilisation de javascript, allez dans le menu Accueil->Configuration->Affichage. ErrorPasswordsMustMatch=Les 2 mots de passe saisis doivent correspondre @@ -265,6 +265,12 @@ ErrorAPercentIsRequired=Erreur, le pourcentage doit être indiqué correctement. ErrorYouMustFirstSetupYourChartOfAccount=Vous devez d’abord configurer votre plan comptable. ErrorFailedToFindEmailTemplate=Aucun gabarit trouvé avec le code %s ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice=Durée non définie sur le service. Pas moyen de calculer le prix horaire. +ErrorActionCommPropertyUserowneridNotDefined=Le propriétaire de l'utilisateur est requis +ErrorActionCommBadType=Le type d'événement sélectionné (id: %n, code: %s) n'existe pas dans le dictionnaire des types d'événement +CheckVersionFail=Échec de la vérification de version +ErrorWrongFileName=Le nom du fichier ne peut pas contenir __SOMETHING__ +ErrorNotInDictionaryPaymentConditions=Pas dans le dictionnaire des conditions de paiement, veuillez modifier. +ErrorIsNotADraft=%s is not a draft # Warnings WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Votre paramètre PHP upload_max_filesize (%s) est supérieur au paramètre PHP post_max_size (%s). Ceci n'est pas une configuration cohérente. @@ -298,8 +304,24 @@ WarningTheHiddenOptionIsOn=Attention, l'option cachée %s est activée WarningCreateSubAccounts=Attention, vous ne pouvez pas créer directement un compte auxiliaire, vous devez créer un tiers ou un utilisateur et leur attribuer un code comptable pour les retrouver dans cette liste WarningAvailableOnlyForHTTPSServers=Disponible uniquement si une connexion sécurisée HTTPS est utilisée WarningModuleXDisabledSoYouMayMissEventHere=Le module %s n’a pas été activé. Par conséquent, il se peut que vous manquiez beaucoup d’événements ici. -ErrorActionCommPropertyUserowneridNotDefined=Le propriétaire de l'utilisateur est requis -ErrorActionCommBadType=Le type d'événement sélectionné (id: %n, code: %s) n'existe pas dans le dictionnaire des types d'événement -CheckVersionFail=Échec de la vérification de version -ErrorWrongFileName=Le nom du fichier ne peut pas contenir __SOMETHING__ -ErrorNotInDictionaryPaymentConditions=Pas dans le dictionnaire des conditions de paiement, veuillez modifier. +WarningPaypalPaymentNotCompatibleWithStrict=La valeur 'Strict' fait que les fonctionnalités de paiement en ligne ne fonctionnent pas correctement. Utilisez plutôt 'Lax'. + +# Validate +RequireValidValue = Valeur non valide +RequireAtLeastXString = Requires at least %s character(s) +RequireXStringMax = Requires %s character(s) max +RequireAtLeastXDigits = Requires at least %s digit(s) +RequireXDigitsMax = Requires %s digit(s) max +RequireValidEmail = L'adresse email n'est pas valide +RequireMaxLength = La longueur doit être inférieure à %s caractères +RequireMinLength = La longueur doit être supérieure à %s caractère(s) +RequireValidUrl = Une URL valide est requise +RequireValidDate = Date valide requise +RequireANotEmptyValue = Est requis +RequireValidDuration = Une durée valide est requise +RequireValidExistingElement = Une valeur existante est requise +RequireValidBool = Un booléen valide est requis +BadSetupOfField = Erreur mauvaise configuration du champ +BadSetupOfFieldClassNotFoundForValidation = Erreur mauvaise configuration du champ : Classe introuvable pour validation +BadSetupOfFieldFileNotFound = Erreur mauvaise configuration du champ : Fichier introuvable pour l'inclusion +BadSetupOfFieldFetchNotCallable = Erreur mauvaise configuration du champ : Fetch non appelable sur la classe diff --git a/htdocs/langs/fr_FR/eventorganization.lang b/htdocs/langs/fr_FR/eventorganization.lang index fa7a9b694df..0efbbf3229e 100644 --- a/htdocs/langs/fr_FR/eventorganization.lang +++ b/htdocs/langs/fr_FR/eventorganization.lang @@ -19,18 +19,22 @@ # ModuleEventOrganizationName = Organisation d'événements EventOrganizationDescription = Organisation de l’événement par le biais du module projet -EventOrganizationDescriptionLong= Gérer l’organisation d'événements pour les conférences, les participants et les conférenciers, avec une page d'inscription publique +EventOrganizationDescriptionLong= Manage the organization of an event (show, conferences, attendees or speakers, with public pages for suggestion, vote or registration) # # Menu # EventOrganizationMenuLeft = Événements organisés EventOrganizationConferenceOrBoothMenuLeft = Conférence ou stand +PaymentEvent=Payment of event + # # Admin page # -EventOrganizationSetup = Configuration de l’organisation de l’événement -Settings = Paramètres +NewRegistration=Registration +EventOrganizationSetup=Configuration de l’organisation de l’événement +EventOrganization=Event organization +Settings=Paramètres EventOrganizationSetupPage = Page de configuration de l’organisation de l’événement EVENTORGANIZATION_TASK_LABEL = Libellé des tâches à créer automatiquement lors de la validation du projet EVENTORGANIZATION_TASK_LABELTooltip = Lorsque vous validez un événement organisé, certaines tâches peuvent être automatiquement créées dans le projet

    Par exemple :
    Envoyer un appel de conférence
    Envoyer un appel pour le stand
    Recevoir un appel de conférences
    Recevoir un appel de stand
    Ouvrir les inscriptions aux événements pour les participants
    Envoyer un rappel de l’événement aux conférenciers
    Envoyer un rappel de l’événement à l’animateur du stand
    Envoyer un rappel de l’événement aux participants @@ -38,8 +42,8 @@ EVENTORGANIZATION_CATEG_THIRDPARTY_CONF = Catégorie à ajouter à des tiers aut EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH = Catégorie à ajouter à des tiers automatiquement créée lorsque quelqu’un suggère un stand EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF = Modèle de courriel à envoyer après avoir reçu une suggestion de conférence. EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH = Modèle de courriel à envoyer après avoir reçu une suggestion d'un stand. -EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH = Modèle de courriel à envoyer après paiement d'une inscription à un stand. -EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT = Modèle de courriel à envoyer après paiement d'une inscription à un événement. +EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH = Template of email to send after a registration to a booth has been paid. +EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT = Template of email to send after a registration to an event has been paid. EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_SPEAKER = Modèle de courriel pour action de masse aux participants EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES = Modèle de courriel pour action de masse aux intervenants EVENTORGANIZATION_FILTERATTENDEES_CAT = Filtrer la liste de sélection des tiers dans la fiche/le formulaire de création des participants avec/selon la catégorie @@ -49,11 +53,11 @@ EVENTORGANIZATION_FILTERATTENDEES_TYPE = Filtrer la liste de sélection des tier # Object # EventOrganizationConfOrBooth= Conférence ou stand -ManageOrganizeEvent = Gestion d'organisation d'événements +ManageOrganizeEvent = Manage the organization of an event ConferenceOrBooth = Conférence ou stand ConferenceOrBoothTab = Conférence ou stand -AmountOfSubscriptionPaid = Montant de l'inscription payée -DateSubscription = Date de l'inscription +AmountPaid = Amount paid +DateOfRegistration = Date of registration ConferenceOrBoothAttendee = Participant à la conférence ou au stand # @@ -63,25 +67,26 @@ YourOrganizationEventConfRequestWasReceived = Votre demande de conférence a ét YourOrganizationEventBoothRequestWasReceived = Votre demande de stand a été transmise EventOrganizationEmailAskConf = Demande de conférence EventOrganizationEmailAskBooth = Demande de stand -EventOrganizationEmailSubsBooth = Inscription au stand -EventOrganizationEmailSubsEvent = Inscription à un événement +EventOrganizationEmailBoothPayment = Payment of your booth +EventOrganizationEmailRegistrationPayment = Registration for an event EventOrganizationMassEmailAttendees = Communication aux participants EventOrganizationMassEmailSpeakers = Communication aux conférenciers # # Event # -AllowUnknownPeopleSuggestConf=Autoriser des personnes inconnues à suggérer des conférences -AllowUnknownPeopleSuggestConfHelp=Autoriser des personnes inconnues à suggérer des conférences -AllowUnknownPeopleSuggestBooth=Autoriser des personnes inconnues à suggérer un stand -AllowUnknownPeopleSuggestBoothHelp=Autoriser des personnes inconnues à suggérer un stand +AllowUnknownPeopleSuggestConf=Allow people to suggest conferences +AllowUnknownPeopleSuggestConfHelp=Allow unknown people to suggest a conference they want to do +AllowUnknownPeopleSuggestBooth=Allow people to apply for a booth +AllowUnknownPeopleSuggestBoothHelp=Allow unknown people to apply for a booth PriceOfRegistration=Prix de l'inscription -PriceOfRegistrationHelp=Prix de l'inscription +PriceOfRegistrationHelp=Price to pay to register or participate in the event PriceOfBooth=Prix d’inscription pour un stand PriceOfBoothHelp=Prix d’inscription pour un stand EventOrganizationICSLink=Lien ICS des événements ConferenceOrBoothInformation=Renseignements sur la conférence ou le stand -Attendees = Participants +Attendees=Participants +ListOfAttendeesOfEvent=List of attendees of the event project DownloadICSLink = Télécharger le lien ICS EVENTORGANIZATION_SECUREKEY = Clé sécurisée pour le lien d’inscription public à une conférence SERVICE_BOOTH_LOCATION = Service utilisé pour la ligne de facture concernant l'emplacement d'un stand @@ -100,27 +105,41 @@ EvntOrgCancelled = Annulé # Public page # SuggestForm = Page de suggestions -RegisterPage = Page pour conférences ou stands -EvntOrgRegistrationHelpMessage = Ici, vous pouvez voter pour un événement, ou suggérer une nouvelle conférence ou un nouveau stand pour le projet -EvntOrgRegistrationConfHelpMessage = Ici, vous pouvez suggérer une nouvelle conférence pour le projet -EvntOrgRegistrationBoothHelpMessage = Ici, vous pouvez suggérer un nouveau stand pour le projet +SuggestOrVoteForConfOrBooth = Page de suggestion ou de vote +EvntOrgRegistrationHelpMessage = Here, you can vote for a conference or suggest a new one for the event. You can also apply to have a booth during the event. +EvntOrgRegistrationConfHelpMessage = Here, you can suggest a new conference to animate during the event. +EvntOrgRegistrationBoothHelpMessage = Here, you can apply to have a booth during the event. ListOfSuggestedConferences = Liste des conférences suggérées ListOfSuggestedBooths = Liste des stands suggérés +ListOfConferencesOrBooths=List of conferences or booths of event project SuggestConference = Proposer une nouvelle conférence SuggestBooth = Proposer un stand ViewAndVote = Voir et voter pour les événements suggérés -PublicAttendeeSubscriptionPage = Lien d’inscription public à une conférence +PublicAttendeeSubscriptionGlobalPage = Lien public pour l'inscription à l'événement +PublicAttendeeSubscriptionPage = Lien d’inscription public à un événement MissingOrBadSecureKey = La clé de sécurité est invalide ou manquante -EvntOrgWelcomeMessage = Ce formulaire vous permet de vous inscrire en tant que nouveau participant à la conférence : '%s' +EvntOrgWelcomeMessage = This form allows you to register as a new participant to the event : %s EvntOrgDuration = Cette conférence commence le %s et se termine le %s. ConferenceAttendeeFee = Frais de participation à la conférence pour l'événement : '%s' se produisant du %s au %s. BoothLocationFee = Frais de participation à l'événement : '%s' se produisant du %s au %s. EventType = Type événement LabelOfBooth=Libellé du stand LabelOfconference=Libellé de la conférence -ConferenceIsNotConfirmed=Inscription non disponible, la conférence n'est pas encore confirmée -DateMustBeBeforeThan=%s must be before %s -DateMustBeAfterThan=%s must be after %s +ConferenceIsNotConfirmed=Registration not available, conference is not confirmed yet +DateMustBeBeforeThan=%s doit être avant %s +DateMustBeAfterThan=%s doit être après %s + +NewSubscription=Registration +OrganizationEventConfRequestWasReceived=Your suggestion for a conference has been received +OrganizationEventBoothRequestWasReceived=Your request for a booth has been received +OrganizationEventPaymentOfBoothWasReceived=Your payment for your booth has been recorded +OrganizationEventPaymentOfRegistrationWasReceived=Your payment for your event registration has been recorded +OrganizationEventBulkMailToAttendees=This is a remind about your participation in the event as an attendee +OrganizationEventBulkMailToSpeakers=This is a reminder on your participation in the event as a speaker +OrganizationEventLinkToThirdParty=Link to third party (customer, supplier or partner) + +NewSuggestionOfBooth=Application for a booth +NewSuggestionOfConference=Application for a conference # # Vote page @@ -133,17 +152,14 @@ VoteOk = Votre vote a été accepté. AlreadyVoted = Vous avez déjà voté pour cet événement. VoteError = Une erreur s'est produite lors du vote, veuillez réessayer. -# -# SubscriptionOk page -# -SubscriptionOk = Votre inscription à cette conférence a été validée -# -# Subscription validation mail -# -ConfAttendeeSubscriptionConfirmation = Confirmation de votre inscription à une conférence -# -# Payment page -# +SubscriptionOk = Your registration has been validated +ConfAttendeeSubscriptionConfirmation = Confirmation of your subscription to an event Attendee = Participant PaymentConferenceAttendee = Paiement de participation à la conférence PaymentBoothLocation = Paiement de l'emplacement du stand +DeleteConferenceOrBoothAttendee=Remove attendee +RegistrationAndPaymentWereAlreadyRecorder=A registration and a payment were already recorded for the email %s +EmailAttendee=Attendee email +EmailCompanyForInvoice=Company email (for invoice, if different of attendee email) +ErrorSeveralCompaniesWithEmailContactUs=Several companies with this email has been found so we can't validate automaticaly your registration. Please contact us at %s for a manual validation +ErrorSeveralCompaniesWithNameContactUs=Several companies with this name has been found so we can't validate automaticaly your registration. Please contact us at %s for a manual validation diff --git a/htdocs/langs/fr_FR/hrm.lang b/htdocs/langs/fr_FR/hrm.lang index 6da0d3f633e..647ff720bf9 100644 --- a/htdocs/langs/fr_FR/hrm.lang +++ b/htdocs/langs/fr_FR/hrm.lang @@ -1,15 +1,4 @@ -# Dolibarr language file - fr_FR - hrm - - -# -# Generic -# - -# Module label 'ModuleHrmName' -ModuleHrmName = GRH -# Module description 'ModuleHrmDesc' -ModuleHrmDesc = GRH description - +# Dolibarr language file - en_US - hrm # Admin @@ -30,74 +19,74 @@ Employees=Salariés Employee=Salarié NewEmployee=Nouveau salarié ListOfEmployees=List des salariés -HrmSetup = Configuration GPEC -HrmSetupPage = Page de configuration du module GPEC -HRM_MAXRANK=Note maximale pour une compétence -HRM_DEFAULT_SKILL_DESCRIPTION=Description par défaut d'une note lors de la création d'une nouvelle compétence -HrmAbout = A propos du module GPEC +HrmSetup = Hrm setup +HrmSetupPage = Hrm setup page +HRM_MAXRANK=Maximum rank for a skill +HRM_DEFAULT_SKILL_DESCRIPTION=Default description of ranks when skill is created +HrmAbout = About Hrm traduction_note=Translate -deplacement=Déplacement -DateEval=Date évaluation -JobCard=Fiche métier -Job=Métier -Jobs=Métiers -NewSkill=Nouvelle compétence -SkillType=Type de compétence -Skilldets=Liste des notes pour cette compétence +deplacement=Shift +DateEval=Evaluation date +JobCard=Job card +Job=Travail planifié +Jobs=Jobs +NewSkill=New Skill +SkillType=Skill type +Skilldets=List of ranks for this skill Skilldet=Skill level -rank=Note -ErrNoSkillSelected=Aucune compétence sélectionnée -ErrSkillAlreadyAdded=Cette compétence est déjà dans la liste -SkillHasNoLines=Cette compétence n'a pas de notes -skill=Compétence -Skills=Compétences -SkillCard=Fiche compétence -EmployeeSkillsUpdated=Les compétences du salarié ont été mises à jour (voir l'onglet "compétences" de la fiche du salarié) +rank=Rank +ErrNoSkillSelected=No skill selected +ErrSkillAlreadyAdded=This skill is already in the list +SkillHasNoLines=This skill has no lines +skill=Skill +Skills=Skills +SkillCard=Skill card +EmployeeSkillsUpdated=Employee skills have been updated (see "Skills" tab of employee card) Eval=Evaluation Evals=Evaluations -NewEval=Nouvelle evaluation -ValidateEvaluation=Valider évaluation -ConfirmValidateEvaluation=Etes vous sûr(e) de vouloir valider cette évaluation sous la référence %s? -EvaluationCard=Fiche évaluation -RequiredRank=Note requise pour ce métier -EmployeeRank=Note employé pour cette compétence -PositionCard=Fiche poste -EmployeesInThisPosition=Salariés occupant ce poste -Position=Poste -Positions=Postes -group1ToCompare=Groupe utilisateurs à analyser -group2ToCompare=Second groupe utilisateurs pour comparaison -OrJobToCompare=Comparer avec les compétences exigées pour un métier -difference=Différence -CompetenceAcquiredByOneOrMore=Compétence acquise par au moins un salarié mais non requise par le second élément de comparaison -MaxlevelGreaterThan=Niveau maximal supérieur au niveau requis -MaxLevelEqualTo=Niveau maximal égal au niveau requis -MaxLevelLowerThan=Niveau maximal inférieur au niveau requis -MaxlevelGreaterThanShort=Niveau salarié supérieur au niveau requis -MaxLevelEqualToShort=Niveau salarié égal au niveau requis -MaxLevelLowerThanShort= Niveau salarié inférieur au niveau requis -SkillNotAcquired=Compétence non acquise par tous les utilisateur et requise par le second élément de comparaison +NewEval=New evaluation +ValidateEvaluation=Validate evaluation +ConfirmValidateEvaluation=Are you sure you want to validate this evaluation with reference %s? +EvaluationCard=Evaluation card +RequiredRank=Required rank for this job +EmployeeRank=Employee rank for this skill +Position=Position +Positions=Positions +PositionCard=Position card +EmployeesInThisPosition=Employees in this position +group1ToCompare=Usergroup to analyze +group2ToCompare=Second usergroup for comparison +OrJobToCompare=Compare to job skills requirements +difference=Difference +CompetenceAcquiredByOneOrMore=Competence acquired by one or more users but not requested by the second comparator +MaxlevelGreaterThan=Max level greater than the one requested +MaxLevelEqualTo=Max level equal to that demand +MaxLevelLowerThan=Max level lower than that demand +MaxlevelGreaterThanShort=Employee level greater than the one requested +MaxLevelEqualToShort=Employee level equals to that demand +MaxLevelLowerThanShort=Employee level lower than that demand +SkillNotAcquired=Skill not acquired by all users and requested by the second comparator legend=Légende -TypeSkill=Type de compétence -AddSkill=Ajouter des compétences à ce métier -RequiredSkills=Compétences requises pour ce métier -UserRank=Note utilisateur -SkillList=Liste des compétences -SaveRank=Enregistrer notes -knowHow=Savoir faire -HowToBe=Savoir être -knowledge=Savoir -AbandonmentComment=Commentaire abandon -DateLastEval=Date dernière évaluation -NoEval=Aucune évaluation effectuée pour ce salarié -HowManyUserWithThisMaxNote=Nombre d'utilisateurs ayant cette note -HighestRank=Note la plus haute -SkillComparison=Comparaison des compétences -ReadSkillJobPosition=Lire les compétences / métiers / postes -CreateUpdateSkillJobPosition=Créer / mettre à jour les compétences / métiers / postes -DeleteSkillJobPosition=Supprimer les compétences / métiers / postes -ReadEval=Lire les évaluations -CreateUpdateEval=Créer / mettre à jour les évaluations -ValidateEval=Valider les évaluations -DeleteEval=Supprimer les évaluations -SeeComparisonMenu=Accéder au menu de comparaison des compétences +TypeSkill=Skill type +AddSkill=Add skills to job +RequiredSkills=Required skills for this job +UserRank=User Rank +SkillList=Skill list +SaveRank=Save rank +knowHow=Know how +HowToBe=How to be +knowledge=Knowledge +AbandonmentComment=Abandonment comment +DateLastEval=Date last evaluation +NoEval=No evaluation done for this employee +HowManyUserWithThisMaxNote=Number of users with this rank +HighestRank=Highest rank +SkillComparison=Skill comparison +ReadSkillJobPosition=Read skills / jobs / positions +CreateUpdateSkillJobPosition=Create / update skills / jobs / positions +DeleteSkillJobPosition=Delete skills / jobs / positions +ReadEval=Read evaluations +CreateUpdateEval=Create / update evaluations +ValidateEval=Validate evaluations +DeleteEval=Delete evaluations +SeeComparisonMenu=Access skills comparison menu diff --git a/htdocs/langs/fr_FR/languages.lang b/htdocs/langs/fr_FR/languages.lang index bee596ccf44..46214457660 100644 --- a/htdocs/langs/fr_FR/languages.lang +++ b/htdocs/langs/fr_FR/languages.lang @@ -2,10 +2,11 @@ Language_am_ET=Ethiopien Language_ar_AR=Arabe Language_ar_EG=Arabe (Egypte) -Language_ar_MA=Arabic (Moroco) +Language_ar_MA=Arabe (Maroc) Language_ar_SA=Arabe Language_ar_TN=Arabe (Tunisie) Language_ar_IQ=Arabe (Irak) +Language_as_IN=Assamese Language_az_AZ=Azerbaïdjanais Language_bn_BD=Bengalais Language_bn_IN=Bengali (Inde) @@ -72,6 +73,7 @@ Language_it_IT=Italien Language_it_CH=Italien (Suisse) Language_ja_JP=Japonais Language_ka_GE=Géorgien +Language_kk_KZ=Kazakh Language_km_KH=Khmer Language_kn_IN=Kannada Language_ko_KR=Corée @@ -92,6 +94,7 @@ Language_ro_MD=Roumain (Moldavie) Language_ro_RO=Roumain Language_ru_RU=Russe Language_ru_UA=Russe (Ukraine) +Language_tg_TJ=Tajik Language_tr_TR=Turque Language_sl_SI=Slovène Language_sv_SV=Suédois diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index 9aecafe3f34..da62020916d 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -246,7 +246,7 @@ DefaultModel=Modèle de document par défaut Action=Action About=À propos Number=Nombre -NumberByMonth=Nombre total des signalements par mois +NumberByMonth=Nombre total par mois AmountByMonth=Montant par mois Numero=Numéro Limit=Limite @@ -804,6 +804,7 @@ LinkToSupplierInvoice=Lier à une facture fournisseur LinkToContract=Lier à un contrat LinkToIntervention=Lier à une intervention LinkToTicket=Lien vers le ticket +LinkToMo=Link to Mo CreateDraft=Créer brouillon SetToDraft=Retour en brouillon ClickToEdit=Cliquer ici pour éditer @@ -924,7 +925,7 @@ WebSiteAccounts=Comptes de site web ExpenseReport=Note de frais ExpenseReports=Notes de frais HR=HR -HRAndBank=Salarié +HRAndBank=RH et banque AutomaticallyCalculated=Calculé automatiquement TitleSetToDraft=Retour à l'état de brouillon ConfirmSetToDraft=Etes vous sûr de vouloir revenir à l'état Brouillon ? @@ -1137,17 +1138,23 @@ CopiedToClipboard=Copié dans le presse-papier InformationOnLinkToContract=Ce montant n’est que le total de toutes les lignes du contrat. Aucune notion de temps n’est prise en considération. ConfirmCancel=Êtes-vous sûr de vous annuler EmailMsgID=E-mail MsgID -SetToEnabled=Activer -SetToDisabled=Désactiver -ConfirmMassEnabling=Confirmation d'activation en masse -ConfirmMassEnablingQuestion=Êtes-vous sur de vouloir activer les %s enregistrement(s) sélectionné(s) ? -ConfirmMassDisabling=Confirmation de desactivation en masse -ConfirmMassDisablingQuestion=Êtes-vous sur de vouloir desactiver les %s enregistrement(s) sélectionné(s) ? +SetToEnabled=Définir sur activé +SetToDisabled=Définir sur désactivé +ConfirmMassEnabling=confirmation d'activation en masse +ConfirmMassEnablingQuestion=Êtes-vous sûr de vouloir activer les %s enregistrement(s) sélectionné(s) ? +ConfirmMassDisabling=confirmation de désactivation en masse +ConfirmMassDisablingQuestion=Êtes-vous sûr de vouloir désactiver les %s enregistrement(s) sélectionné(s) ? RecordsEnabled=%s enregistrement(s) activé(s) RecordsDisabled=%s enregistrement(s) désactivé(s) RecordEnabled=Enregistrement activé RecordDisabled=Enregistrement désactivé -ConfirmMassLeaveApprovalQuestion=Êtes-vous sur de vouloir approuver les %s enregistrement(s) sélectionné(s) ? -ConfirmMassLeaveApproval=Confirmation d'approbation de congé en masse +Forthcoming=À venir +Currently=Actuellement +ConfirmMassLeaveApprovalQuestion=Êtes-vous sûr de vouloir approuver le(s) %s enregistrement(s) sélectionné(s) ? +ConfirmMassLeaveApproval=Confirmation de l'approbation en masse des congés RecordAproved=Enregistrement approuvé RecordsApproved=%s enregistrement(s) approuvé(s) +Properties=Properties +hasBeenValidated=%s has been validated +ClientTZ=Fuseau horaire client (utilisateur) +NotClosedYet=Not yet closed diff --git a/htdocs/langs/fr_FR/margins.lang b/htdocs/langs/fr_FR/margins.lang index fabd7851aad..dd1247311ff 100644 --- a/htdocs/langs/fr_FR/margins.lang +++ b/htdocs/langs/fr_FR/margins.lang @@ -22,7 +22,7 @@ ProductService=Produit ou Service AllProducts=Tous les produits et services ChooseProduct/Service=Choisissez le produit ou le service ForceBuyingPriceIfNull=Forcer le prix d'achat au prix de vente si non renseigné -ForceBuyingPriceIfNullDetails=Si le prix d'achat/revient n'est pas défini quand on ajouter une nouvelle ligne, et que cette option est "ON", la marge sera de 0 sur la nouvelle ligne (le prix d'achat/revient = prix de vente). Si l'option est à "OFF" (recommandé), la marge sera égale à la valeur suggérée par défaut (et peut être 100% si aucune valeur par défaut n'est trouvé). +ForceBuyingPriceIfNullDetails=If buying/cost price not provided when we add a new line, and this option is "ON", the margin will be 0%% on the new line (buying/cost price = selling price). If this option is "OFF" (recommended), margin will be equal to the value suggested by default (and may be 100%% if no default value can be found). MARGIN_METHODE_FOR_DISCOUNT=Méthode de gestion des remises globales UseDiscountAsProduct=Comme un produit UseDiscountAsService=Comme un service diff --git a/htdocs/langs/fr_FR/members.lang b/htdocs/langs/fr_FR/members.lang index 2e1498e4507..b848c156383 100644 --- a/htdocs/langs/fr_FR/members.lang +++ b/htdocs/langs/fr_FR/members.lang @@ -7,7 +7,7 @@ Members=Adhérents ShowMember=Afficher fiche adhérent UserNotLinkedToMember=Utilisateur non lié à un adhérent ThirdpartyNotLinkedToMember=Tiers non lié à un adhérent -MembersTickets=Étiquettes d'adhérents +MembersTickets=Étiquettes d'adresses adhérents FundationMembers=Membres de l'association ListOfValidatedPublicMembers=Liste des adhérents publics validés ErrorThisMemberIsNotPublic=Cet adhérent n'est pas public @@ -19,8 +19,8 @@ MembersCards=Carte de visite pour les adhérents MembersList=Liste des adhérents MembersListToValid=Liste des adhérents brouillons (à valider) MembersListValid=Liste des adhérents valides -MembersListUpToDate=Liste des adhérents validés avec une adhésion à jour -MembersListNotUpToDate=Liste des adhérents validés avec une adhésion expirée +MembersListUpToDate=Liste des adhérents validés avec une cotisation à jour +MembersListNotUpToDate=Liste des adhérents validés avec une cotisation expirée MembersListExcluded=Liste des adhérents exclus MembersListResiliated=Liste des adhérents résiliés MembersListQualified=Liste des adhérents qualifiés @@ -32,7 +32,7 @@ MembersWithSubscriptionToReceive=Adhérents avec cotisation à recevoir MembersWithSubscriptionToReceiveShort=Cotisations à recevoir DateSubscription=Date adhésion DateEndSubscription=Date fin adhésion -EndSubscription=La cotisation arrive à échéance +EndSubscription=Fin adhésion SubscriptionId=Id adhésion WithoutSubscription=Sans adhésion MemberId=Id adhérent @@ -45,7 +45,7 @@ MemberStatusDraft=Brouillon (à valider) MemberStatusDraftShort=Brouillon MemberStatusActive=Validé (attente cotisation) MemberStatusActiveShort=Validé -MemberStatusActiveLate=Adhésion/cotisation expirée +MemberStatusActiveLate=Adhésion / cotisation expirée MemberStatusActiveLateShort=Expiré MemberStatusPaid=Adhésions à jour MemberStatusPaidShort=A jour @@ -68,7 +68,7 @@ DeleteAMemberType=Supprimer un type d'adhérent ConfirmDeleteMemberType=Êtes-vous sur de vouloir supprimer ce type d' adhérent ? MemberTypeDeleted=Type d'adhérent supprimé MemberTypeCanNotBeDeleted=Ce type d'adhérent ne peut pas être supprimé -NewSubscription=Nouvelle adhésion +NewSubscription=Nouvelle cotisation NewSubscriptionDesc=Ce formulaire permet de vous inscrire comme nouvel adhérent de l'association. Pour un renouvellement (si vous êtes déjà adhérent), contactez plutôt l'association par email %s. Subscription=Adhésion / cotisation Subscriptions=Adhésions / cotisations @@ -88,11 +88,12 @@ Moral=Personne morale MorAndPhy=Personnes morales et physiques Reenable=Réactiver ExcludeMember=Exclure un adhérent +Exclude=Exclure ConfirmExcludeMember=Êtes-vous sûr de vouloir exclure cet adhérent ? ResiliateMember=Résilier un adhérent ConfirmResiliateMember=Êtes-vous sûr de vouloir résilier cet adhérent ? DeleteMember=Effacer un membre -ConfirmDeleteMember=Êtes-vous sûr de vouloir effacer ce membre (Effacer un membre efface aussi toutes ses cotisations) ? +ConfirmDeleteMember=Êtes-vous sûr de vouloir supprimer ce membre (Supprimer un membre supprime aussi toutes ses cotisations) ? DeleteSubscription=Effacer une adhésion ConfirmDeleteSubscription=Êtes-vous sûr de vouloir effacer cette adhésion ? Filehtpasswd=Fichier htpasswd @@ -104,7 +105,7 @@ BlankSubscriptionForm=Formulaire d'auto-inscription publique BlankSubscriptionFormDesc=Dolibarr peut vous fournir un URL/site web public afin de permettre aux visiteurs externes de faire une demande d'inscription à la fondation. Si un module de paiement est actif, un formulaire de paiement sera également fourni automatiquement. EnablePublicSubscriptionForm=Activer le formulaire public d'auto-inscription ForceMemberType=Forcer le type d'adhérent -ExportDataset_member_1=Adhérents et adhésions +ExportDataset_member_1=Adhérents et cotisations ImportDataset_member_1=Adhérents LastMembersModified=Les %s derniers adhérents modifiés LastSubscriptionsModified=Les %s dernières adhésions modifiées @@ -139,7 +140,7 @@ ThisIsContentOfSubscriptionReminderEmail=Nous voulons vous informer que votre ad ThisIsContentOfYourCard=Ceci est un rappel des informations que nous avons vous concernant. N'hésitez pas à nous contacter en cas d'erreur.

    DescADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT=Sujet de l'email reçu en cas d'auto-inscription d'un invité DescADHERENT_AUTOREGISTER_NOTIF_MAIL=Email reçu en cas d'auto-inscription d'un invité -DescADHERENT_EMAIL_TEMPLATE_AUTOREGISTER=Modèle Email à utiliser pour envoyer un email à un adhérent sur auto-adhésion de l'adhérent +DescADHERENT_EMAIL_TEMPLATE_AUTOREGISTER=Modèle Email à utiliser pour envoyer un email à un adhérent sur auto-inscription de l'adhérent DescADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION=Modèle d'email à utiliser pour envoyer un email à un membre sur la validation d'un membre DescADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION=Modèle d'email électronique à utiliser pour envoyer un courrier électronique à un membre lors de l'enregistrement d'une nouvelle cotisation DescADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION=Modèle d'email électronique à utiliser pour envoyer un rappel par courrier électronique lorsque l'adhésion est sur le point d'expirer @@ -156,7 +157,7 @@ DescADHERENT_CARD_FOOTER_TEXT=Texte imprimé sur le bas des cartes d'adhérent ShowTypeCard=Voir type '%s' HTPasswordExport=Génération fichier htpassword NoThirdPartyAssociatedToMember=Pas de tiers associé à cet adhérent -MembersAndSubscriptions= Adhérents et Adhésions +MembersAndSubscriptions=Adhérents et Cotisations MoreActions=Action complémentaire à l'enregistrement MoreActionsOnSubscription=Action complémentaire proposée par défaut à l'enregistrement de l'adhésion MoreActionBankDirect=Création une écriture directe sur le compte bancaire ou caisse @@ -168,7 +169,7 @@ DocForAllMembersCards=Génération de cartes pour tous les adhérents DocForOneMemberCards=Génération de cartes pour un adhérent particulier DocForLabels=Génération d'étiquettes d'adresses SubscriptionPayment=Paiement cotisation -LastSubscriptionDate=Date de dernière adhésion +LastSubscriptionDate=Date de la dernière cotisation LastSubscriptionAmount=Montant dernière adhésion LastMemberType=Dernier type d'adhérent MembersStatisticsByCountries=Statistiques des membres par pays @@ -186,7 +187,7 @@ MembersByRegion=Cet écran vous montre les statistiques sur les adhérents par r MembersStatisticsDesc=Choisissez les statistiques que vous désirez consulter... MenuMembersStats=Statistiques LastMemberDate=Date dernière adhésion -LatestSubscriptionDate=Date de dernière adhésion +LatestSubscriptionDate=Date de dernière cotisation MemberNature=Nature de l'adhérent MembersNature=Nature des adhérents Public=Informations publiques @@ -194,15 +195,15 @@ NewMemberbyWeb=Nouvel adhérent ajouté. En attente de validation NewMemberForm=Nouvel Adhérent form SubscriptionsStatistics=Statistiques sur les cotisations NbOfSubscriptions=Nombre de cotisations -AmountOfSubscriptions=Montant de cotisations +AmountOfSubscriptions=Montant des cotisations TurnoverOrBudget=Chiffre affaire (pour société) ou Budget (asso ou collectivité) DefaultAmount=Montant par défaut de la cotisation -CanEditAmount=Le visiteur peut modifier/choisir le montant de sa cotisation +CanEditAmount=Le visiteur peut modifier / choisir le montant de sa cotisation MEMBER_NEWFORM_PAYONLINE=Rediriger sur la page intégrée de paiement en ligne ByProperties=Par nature MembersStatisticsByProperties=Statistiques des adhérents par nature -VATToUseForSubscriptions=Taux de TVA pour les adhésions -NoVatOnSubscription=Pas de TVA sur les adhésions +VATToUseForSubscriptions=Taux de TVA pour les cotisations +NoVatOnSubscription=Pas de TVA pour les cotisations ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS=Produit/Service utilisé pour la ligne de cotisation dans la facture: %s NameOrCompany=Nom ou société SubscriptionRecorded=Adhésion enregistré @@ -215,3 +216,5 @@ YouMayFindYourInvoiceInThisEmail=Vous pouvez trouver votre facture jointe à cet XMembersClosed=%s adhérent(s) résilié(s) XExternalUserCreated=%s utilisateur(s) externe(s) créé(s) ForceMemberNature=Forcer la nature de l'adhérent (personne physique ou morale) +CreateDolibarrLoginDesc=La création d'un login utilisateur pour les membres leur permet de se connecter à l'application. En fonction des autorisations accordées, ils pourront par exemple consulter ou modifier eux-mêmes leur dossier. +CreateDolibarrThirdPartyDesc=Un tiers est l'entité juridique qui sera utilisée sur la facture si vous décidez de générer une facture pour chaque cotisation. Vous pourrez le créer plus tard au cours du processus d'enregistrement de la cotisation. diff --git a/htdocs/langs/fr_FR/mrp.lang b/htdocs/langs/fr_FR/mrp.lang index a0ab429a70c..4aaeb4f9366 100644 --- a/htdocs/langs/fr_FR/mrp.lang +++ b/htdocs/langs/fr_FR/mrp.lang @@ -9,6 +9,7 @@ LatestBOMModified=Le %s dernières BOMs modifiées LatestMOModified=Les %s derniers Ordres de Fabrication modifiés Bom=Nomenclatures produits (BOM) BillOfMaterials=Nomenclature BOM +BillOfMaterialsLines=Lignes de nomenclature BOMsSetup=Configuration du module BOM ListOfBOMs=Liste des BOMs ListOfManufacturingOrders=Liste des Ordres de Fabrication @@ -31,7 +32,7 @@ ValueOfMeansLossForProductProduced=Une valeur de 0,95 signifie une moyenne de 5% DeleteBillOfMaterials=Supprimer la nomenclature DeleteMo=Supprimer l'ordre de fabrication ConfirmDeleteBillOfMaterials=Êtes-vous sûr de vouloir supprimer cette nomenclature? -ConfirmDeleteMo=Êtes-vous sûr de vouloir supprimer cette nomenclature? +ConfirmDeleteMo=Are you sure you want to delete this Manufacturing Order? MenuMRP=Ordres de fabrication NewMO=Nouvel Ordre de fabrication QtyToProduce=Quantité à produire @@ -55,6 +56,7 @@ WarehouseForProduction=Entrepôt pour la fabrication CreateMO=Créer OF ToConsume=A consommer ToProduce=Produire +ToObtain=A obtenir QtyAlreadyConsumed=Qté déjà consommée QtyAlreadyProduced=Qté déjà produite QtyRequiredIfNoLoss=Quantité requise s'il n'y a pas de perte (l'efficacité de fabrication est de 100%%) @@ -72,7 +74,7 @@ NoStockChangeOnServices=Aucune variation de stock sur les services ProductQtyToConsumeByMO=Quantité de produit restant à consommer par OF ouvert ProductQtyToProduceByMO=Quantités restant à produire avec les OF ouverts AddNewConsumeLines=Ajouter une nouvelle ligne à consommer -AddNewProduceLines=Ajouter une nouvelle ligne à produire +AddNewProduceLines=Add new line to produce ProductsToConsume=Produits à consommer ProductsToProduce=Produits à produire UnitCost=Coût unitaire @@ -102,3 +104,4 @@ HumanMachine=Humain/machine WorkstationArea=Espace Poste de travail Machines=Machines THMEstimatedHelp=Ce taux permet de définir un coût prévisionnel de l'article +MOAndLines=Ordres de fabrication et lignes diff --git a/htdocs/langs/fr_FR/opensurvey.lang b/htdocs/langs/fr_FR/opensurvey.lang index 35a9031583f..d9538d4c3e5 100644 --- a/htdocs/langs/fr_FR/opensurvey.lang +++ b/htdocs/langs/fr_FR/opensurvey.lang @@ -48,6 +48,8 @@ AddEndHour=Ajouter heure de fin votes=vote(s) NoCommentYet=Pas de commentaires laissés pour le moment sur ce sondage CanComment=Les votants peuvent poster des commentaires +YourVoteIsPrivate=This poll is private, nobody can see your vote. +YourVoteIsPublic=This poll is public, anybody with the link can see your vote. CanSeeOthersVote=Les votants peuvent voir les votes des autres SelectDayDesc=Pour chaque jour, vous pouvez choisir, ou pas, les heures au format suivant :
    - laisser vide,
    - "8h", "8H" ou "8:00" pour définir uniquement une heure de début,
    - "8-11", "8h-11h", "8H-11H" ou "8:00-11:00" pour définir une heure de début et de fin,
    - "8h15-11h15", "8H15-11H15" ou "8:15-11:15" pour définir une heure de début et fin avec précision sur les minutes. BackToCurrentMonth=Retour au mois en cours diff --git a/htdocs/langs/fr_FR/printing.lang b/htdocs/langs/fr_FR/printing.lang index 62cad4af2c5..49ac6d2292d 100644 --- a/htdocs/langs/fr_FR/printing.lang +++ b/htdocs/langs/fr_FR/printing.lang @@ -1,10 +1,10 @@ # Dolibarr language file - Source file is en_US - printing -Module64000Name=Impressions Directe -Module64000Desc=Activer le système d'impression Directe -PrintingSetup=Réglages du module Impression Directe -PrintingDesc=Ce module ajoute un bouton Imprimer afin d'envoyer directement les documents à une imprimante (sans ouvrir le document dans une application). -MenuDirectPrinting=Travaux d'impressions directe -DirectPrint=Impressions Directe +Module64000Name=One click Printing +Module64000Desc=Enable One click Printing System +PrintingSetup=Setup of One click Printing System +PrintingDesc=This module adds a Print button to various modules to allow documents to be printed directly to a printer with no need to open the document into another application. +MenuDirectPrinting=One click Printing jobs +DirectPrint=One click Print PrintingDriverDesc=Paramètres de configuration pour le driver d'impression ListDrivers=Liste des drivers PrintTestDesc=Liste des imprimantes @@ -50,5 +50,5 @@ GoogleAuthNotConfigured=Configuration Google OAuth non terminé. Activer le modu GoogleAuthConfigured=Identifiants Google OAuth trouvé dans la configuration du module OAuth. PrintingDriverDescprintgcp=Paramètres de configuration des drivers Google Cloud Print pour les impressions. PrintingDriverDescprintipp=Variables de configuration pour le pilotes d'impression Cups. -PrintTestDescprintgcp=List des imprimantes Google Cloud Print. +PrintTestDescprintgcp=Liste des imprimantes Google Cloud Print. PrintTestDescprintipp=Liste des imprimantes pour Cups. diff --git a/htdocs/langs/fr_FR/productbatch.lang b/htdocs/langs/fr_FR/productbatch.lang index 193ecb503e1..ccd5e43d3d7 100644 --- a/htdocs/langs/fr_FR/productbatch.lang +++ b/htdocs/langs/fr_FR/productbatch.lang @@ -27,9 +27,9 @@ StockDetailPerBatch=Stock détaillé par lot SerialNumberAlreadyInUse=Le numéro de série %s est déjà utilisé pour le produit %s TooManyQtyForSerialNumber=Vous ne pouvez avoir qu'un seul produit %s pour le numéro de série %s ManageLotMask=Masque personnalisé -CustomMasks=Option to define a different numbering mask for each product -BatchLotNumberingModules=Numbering rule for automatic generation of lot number -BatchSerialNumberingModules=Numbering rule for automatic generation of serial number (for products with property 1 unique lot/serial for each product) +CustomMasks=Option pour définir un masque de numérotation différent pour chaque produit +BatchLotNumberingModules=Règle de numérotation pour la génération automatique de numéro de lot +BatchSerialNumberingModules=Règle de numérotation pour la génération automatique de numéro de série (pour les produits avec propriété 1 lot/série unique pour chaque produit) QtyToAddAfterBarcodeScan=Quantité à ajouter pour chaque code à barres/lot/série scanné LifeTime=Durée de vie (en jours) EndOfLife=Fin d'utilisation @@ -37,7 +37,8 @@ ManufacturingDate=Date de fabrication DestructionDate=Date de destruction FirstUseDate=Date de première mise en service QCFrequency=Fréquence du contrôle qualité (en jours) - +ShowAllLots=Show all lots +HideLots=Hide lots #Traceability - qc status OutOfOrder=Hors d'usage InWorkingOrder=En état de marche diff --git a/htdocs/langs/fr_FR/products.lang b/htdocs/langs/fr_FR/products.lang index 24e5c062cc7..be7b4a2726e 100644 --- a/htdocs/langs/fr_FR/products.lang +++ b/htdocs/langs/fr_FR/products.lang @@ -75,6 +75,7 @@ SellingPriceTTC=Prix de vente TTC SellingMinPriceTTC=Prix de vente min. (TTC) CostPriceDescription=Ce champ de prix (hors taxes) peut être utilisé pour saisir le montant moyen que ce produit coûte à votre société. Il peut s'agir de n'importe quel prix que vous calculez vous-même, par exemple à partir du prix d'achat moyen plus le coût moyen de production et de distribution. CostPriceUsage=Cette valeur peut être utilisée dans le calcul des marges. +ManufacturingPrice=Manufacturing price SoldAmount=Solde PurchasedAmount=Montant des achats NewPrice=Nouveau prix @@ -397,10 +398,13 @@ ActionAvailableOnVariantProductOnly=Action disponible uniquement sur la variante ProductsPricePerCustomer=Prix produit par clients ProductSupplierExtraFields=Attributs supplémentaires (Prix fournisseur) DeleteLinkedProduct=Supprimer le produit enfant lié à la combinaison +AmountUsedToUpdateWAP=Amount to use to update the Weighted Average Price PMPValue=Prix moyen pondéré (PMP) PMPValueShort=PMP -Rank=Rang -mandatoryperiod=Périodes obligatoires -mandatoryPeriodNeedTobeSet=Attention périodes non saisies et obligatoires -mandatoryPeriodNeedTobeSetMsgValidate=Un service nécessite une période de début et de fin -mandatoryHelper=Message à l'utilisateur sur la necessité de saisir une date de début et une date de fin sur un service lors de la création/validation de facture, proposition commerciale , commande client.
    Cette action n'est pas bloquante dans le processus de validation +mandatoryperiod=Mandatory periods +mandatoryPeriodNeedTobeSet=Attention periods not entered and mandatory +mandatoryPeriodNeedTobeSetMsgValidate=A service requires a start and end period +mandatoryHelper=Message to the user on the need to enter a start date and an end date on a service when creating / validating an invoice, commercial proposal, sales order.
    This action is not blocking in the process of confirmation +DefaultBOM=Nomenclature par défaut +DefaultBOMDesc=La nomenclature par défaut qu'il est recommandé d'utiliser pour fabriquer ce produit. Ce champ ne peut être défini que si la nature du produit est '%s'. +Rank=Rank diff --git a/htdocs/langs/fr_FR/receptions.lang b/htdocs/langs/fr_FR/receptions.lang index 5d01e6a75bd..afdb38558ae 100644 --- a/htdocs/langs/fr_FR/receptions.lang +++ b/htdocs/langs/fr_FR/receptions.lang @@ -36,7 +36,7 @@ StatsOnReceptionsOnlyValidated=Statistiques effectuées sur les réceptionss val SendReceptionByEMail=Envoyer la réception par email SendReceptionRef=Envoi du bordereau de réception %s ActionsOnReception=Événements sur la réception -ReceptionCreationIsDoneFromOrder=Pour le moment, la création d'une nouvelle réception se fait depuis la fiche commande. +ReceptionCreationIsDoneFromOrder=Pour le moment, la création d'une nouvelle réception se fait depuis la fiche commande fournisseur. ReceptionLine=Ligne de réception ProductQtyInReceptionAlreadySent=Quantité de produit en commande ouverte déjà expédiée ProductQtyInSuppliersReceptionAlreadyRecevied=Quantité de produit déjà reçu en commandes fournisseur ouvertes @@ -45,4 +45,4 @@ ReceptionsNumberingModules=Module de numérotation pour les réceptions ReceptionsReceiptModel=Modèles de document pour les réceptions NoMorePredefinedProductToDispatch=Plus de produits prédéfinis à expédier ReceptionExist=Une réception existe -ByingPrice=Prix d'achat +ByingPrice=Bying price diff --git a/htdocs/langs/fr_FR/stocks.lang b/htdocs/langs/fr_FR/stocks.lang index 1fc01004248..9244b3db53d 100644 --- a/htdocs/langs/fr_FR/stocks.lang +++ b/htdocs/langs/fr_FR/stocks.lang @@ -14,7 +14,7 @@ DefaultWarehouse=Entrepôt par défaut WarehouseTarget=Entrepôt destination ValidateSending=Valider expédition CancelSending=Annuler expédition -DeleteSending=Supprimer expédition +DeleteSending=Supprimer l'expédition Stock=Stock Stocks=Stocks MissingStocks=Stocks manquants @@ -37,7 +37,7 @@ AllWarehouses=Tous les entrepôts IncludeEmptyDesiredStock=Inclure aussi les stocks négatifs quand le stock désiré optimal n'est pas défini IncludeAlsoDraftOrders=Inclure également les commandes brouillons Location=Lieu -LocationSummary=Nom court du lieu +LocationSummary=Nom court de l'emplacement NumberOfDifferentProducts=Nombre de produits uniques NumberOfProducts=Nombre total de produits LastMovement=Dernier mouvement @@ -62,7 +62,7 @@ AllowAddLimitStockByWarehouse=Gérez également les valeurs des stocks minimums RuleForWarehouse=Règle pour les entrepôts WarehouseAskWarehouseOnThirparty=Définir un entrepôt sur les tiers WarehouseAskWarehouseDuringPropal=Définir un entrepôt sur les propositions commerciales -WarehouseAskWarehouseDuringOrder=Définir un entrepôt sur les commandes +WarehouseAskWarehouseDuringOrder=Définir un entrepôt sur les commandes clients UserDefaultWarehouse=Définir un entrepôt sur les utilisateurs MainDefaultWarehouse=Entrepôt par défaut MainDefaultWarehouseUser=Utiliser un entrepôt par défaut pour chaque utilisateur @@ -75,9 +75,9 @@ OrderDispatch=Réceptions RuleForStockManagementDecrease=Règle de gestion des décrémentations automatiques de stock (la décrémentation manuelle est toujours possible, même si une décrémentation automatique est activée) RuleForStockManagementIncrease=Règle de gestion des incrémentations de stock (l'incrémentation manuelle est toujours possible, même si une incrémentation automatique est activée) DeStockOnBill=Décrémenter les stocks physiques sur validation des factures/avoirs clients -DeStockOnValidateOrder=Décrémenterr les stocks physiques sur validation des commandes clients +DeStockOnValidateOrder=Décrémenter les stocks physiques sur validation des commandes clients DeStockOnShipment=Décrémenter les stocks physiques sur validation des expéditions -DeStockOnShipmentOnClosing=Décrémente les stocks physiques au classement "clôturée" de l'expédition +DeStockOnShipmentOnClosing=Décrémenter les stocks physiques au classement "clôturée" de l'expédition ReStockOnBill=Incrémenter les stocks physiques sur validation des factures/avoirs fournisseurs ReStockOnValidateOrder=Incrémenter les stocks physiques sur approbation des commandes fournisseurs ReStockOnDispatchOrder=Incrémenter les stocks physiques sur ventilation manuelle dans les entrepôts, après réception de la marchandise @@ -256,8 +256,10 @@ AutofillWithExpected=Remplir la quantité réelle avec la quantité prévue ShowAllBatchByDefault=Par défaut, afficher les détails des lots sur l'onglet "stock" du produit CollapseBatchDetailHelp=Vous pouvez définir l'affichage par défaut des détails du lot dans la configuration du module de stocks FieldCannotBeNegative=Le champ "%s" ne peut pas être négatif -ErrorWrongBarcodemode=Unknown Barcode mode -ProductDoesNotExist=Product does not exist -ErrorSameBatchNumber=Same batch number found in inventory list -ProductBatchDoesNotExist=Product with batch/serial does not exist -ProductBarcodeDoesNotExist=Product with barcode does not exist +ErrorWrongBarcodemode=Mode code-barres inconnu +ProductDoesNotExist=Le produit n'existe pas +ErrorSameBatchNumber=Même numéro de lot trouvé dans la liste d'inventaire +ProductBatchDoesNotExist=Le produit avec ce lot/série n'existe pas +ProductBarcodeDoesNotExist=Le produit avec ce code-barres n'existe pas +WarehouseId=ID entrepôt +WarehouseRef=Réf entrepôt diff --git a/htdocs/langs/fr_FR/ticket.lang b/htdocs/langs/fr_FR/ticket.lang index 5bc4ef364bd..04dbafe507f 100644 --- a/htdocs/langs/fr_FR/ticket.lang +++ b/htdocs/langs/fr_FR/ticket.lang @@ -68,7 +68,7 @@ NeedMoreInformation=Attente retour demandeur NeedMoreInformationShort=En attente de retour Answered=Répondu Waiting=En attente -SolvedClosed=Solved +SolvedClosed=Résolu Deleted=Supprimé # Dict @@ -182,17 +182,17 @@ MessageSuccessfullyAdded=Ticket créé TicketMessageSuccessfullyAdded=Message ajouté avec succès TicketMessagesList=Liste des messages NoMsgForThisTicket=Pas de message pour ce ticket -Properties=Classification +TicketProperties=Classification LatestNewTickets=Les %s derniers tickets (non lus) TicketSeverity=Sévérité ShowTicket=Voir le ticket RelatedTickets=Tickets liés TicketAddIntervention=Créer intervention -CloseTicket=Close|Solve ticket -AbandonTicket=Abandon ticket -CloseATicket=Close|Solve a ticket +CloseTicket=Fermer|Résoudre ticket +AbandonTicket=Abandonner le ticket +CloseATicket=Fermer|Résoudre un ticket ConfirmCloseAticket=Confirmer la fermeture du ticket -ConfirmAbandonTicket=Do you confirm the closing of the ticket to status 'Abandonned' +ConfirmAbandonTicket=Confirmez-vous la fermeture du ticket au statut 'Abandonné' ConfirmDeleteTicket=Confirmez la suppression du ticket TicketDeletedSuccess=Ticket supprimé avec succès TicketMarkedAsClosed=Ticket indiqué fermé @@ -321,4 +321,4 @@ BoxNumberOfTicketByDay=Nombre de nouveaux tickets par jour BoxNewTicketVSClose=Nombre de nouveaux tickets aujourd’hui par rapport aux tickets fermés aujourd’hui TicketCreatedToday=Ticket créé aujourd'hui TicketClosedToday=Ticket fermé aujourd'hui -KMFoundForTicketGroup=Nous avons trouvé des sujets et des FAQ susceptibles de répondre à votre question, merci de les vérifier avant de soumettre le ticket +KMFoundForTicketGroup=We found topics and FAQs that may answers your question, thanks to check them before submitting the ticket diff --git a/htdocs/langs/nl_BE/admin.lang b/htdocs/langs/nl_BE/admin.lang index f083382f5cb..8484cbcff71 100644 --- a/htdocs/langs/nl_BE/admin.lang +++ b/htdocs/langs/nl_BE/admin.lang @@ -48,7 +48,6 @@ NotConfigured=Module/Applicatie is niet geconfigureerd OtherSetup=Overige instellingen CurrentValueSeparatorThousand=Duizend scheidingsteken LocalisationDolibarrParameters=Lokalisatieparameters -ClientTZ=Tijdzone van de klant (gebruiker) ClientHour=Tijd bij de klant (gebruiker) PHPTZ=Tijdzone binnen de PHP server DaylingSavingTime=Zomertijd (gebruiker) diff --git a/htdocs/langs/pt_BR/admin.lang b/htdocs/langs/pt_BR/admin.lang index 8efa423b8f0..5278c86bced 100644 --- a/htdocs/langs/pt_BR/admin.lang +++ b/htdocs/langs/pt_BR/admin.lang @@ -107,7 +107,6 @@ CurrentValueSeparatorThousand=Separador de milhar IdModule=Módulo ID IdPermissions=Permissão ID LanguageBrowserParameter=Parâmetro de Linguagem %s -ClientTZ=Fuso Horário do cliente (usuário) ClientHour=Horário do Cliente (usuário) OSTZ=Fuso Horário do OS do Servidor PHPTZ=Fuso Horário do servidor PHP @@ -1196,7 +1195,6 @@ ServiceSetup=Configurações do módulo de serviços ProductServiceSetup=Configurações dos módulos de produtos e serviços NumberOfProductShowInSelect=Número máximo de produtos para mostrar em listas de seleção de combinação (0 = sem limite) ViewProductDescInFormAbility=Exibir descrições de produtos em formulários (mostrados de outra forma em um pop-up de dicas de ferramentas) -DoNotAddProductDescAtAddLines=Não adicionar descrição do produto (do cartão do produto) no envio, adicione linhas nos formulários OnProductSelectAddProductDesc=Como usar a descrição dos produtos ao adicionar um produto como uma linha de um documento AutoFillFormFieldBeforeSubmit=Preencher automaticamente o campo de entrada da descrição com a descrição do produto DoNotAutofillButAutoConcat=Não preencha automaticamente o campo de entrada com a descrição do produto. A descrição do produto será concatenada com a descrição inserida automaticamente. diff --git a/htdocs/langs/pt_BR/eventorganization.lang b/htdocs/langs/pt_BR/eventorganization.lang index 1046596e57e..ad883105022 100644 --- a/htdocs/langs/pt_BR/eventorganization.lang +++ b/htdocs/langs/pt_BR/eventorganization.lang @@ -2,6 +2,5 @@ ModuleEventOrganizationName =Organização do Evento EventOrganizationDescription =Organização do Evento atraves do modulo Projetos EventOrganizationMenuLeft =Eventos organizados -EventOrganizationSetup =Configuracao de Organização do Evento EventOrganizationSetupPage =Organização do Eventos pagina de configuracao EvntOrgDraft =Minuta From 336b6cb7fc7475e283fb3516825f3b31b4a264fb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Oct 2021 17:17:08 +0200 Subject: [PATCH 0921/1460] Fix editline --- htdocs/expensereport/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 911b9cb08c3..8a534a60e02 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -2564,7 +2564,7 @@ if ($action == 'create') { print '
    '; -if ($action != 'create' && $action != 'edit') { +if ($action != 'create' && $action != 'edit' && $action != 'editline') { $object = new ExpenseReport($db); $object->fetch($id, $ref); From 099b2da2dcb6f458e7716930b5b51620d4ff8242 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Oct 2021 18:58:34 +0200 Subject: [PATCH 0922/1460] FIX #18974 --- htdocs/core/class/extrafields.class.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 4ec87d75974..0145ad95a7d 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -2079,9 +2079,15 @@ class ExtraFields } $enabled = 1; - if (isset($this->attributes[$object->table_element]['list'][$key])) { - $enabled = dol_eval($this->attributes[$object->table_element]['list'][$key], 1); + if (isset($this->attributes[$object->table_element]['enabled'][$key])) { // 'enabled' is often a condition on module enabled or not + $enabled = dol_eval($this->attributes[$object->table_element]['enabled'][$key], 1); } + + $visibility = 1; + if (isset($this->attributes[$object->table_element]['list'][$key])) { // 'list' is option for visibility + $visibility = dol_eval($this->attributes[$object->table_element]['list'][$key], 1); + } + $perms = 1; if (isset($this->attributes[$object->table_element]['perms'][$key])) { $perms = dol_eval($this->attributes[$object->table_element]['perms'][$key], 1); @@ -2089,6 +2095,9 @@ class ExtraFields if (empty($enabled)) { continue; } + if (empty($visibility)) { + continue; + } if (empty($perms)) { continue; } From b318ccb2af73188afb9927202a93efde028dee55 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Oct 2021 19:39:56 +0200 Subject: [PATCH 0923/1460] Fix margin rates and mark rates are 2 different columns --- htdocs/core/tpl/objectline_edit.tpl.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index 611d6a9cce5..d1b19495429 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -296,7 +296,8 @@ $coldisplay++; echo '%'; } $coldisplay++; - } elseif (!empty($conf->global->DISPLAY_MARK_RATES)) { + } + if (!empty($conf->global->DISPLAY_MARK_RATES)) { $mark_rate = (GETPOSTISSET("np_markRate") ? GETPOST("np_markRate", 'alpha', 2) : price($line->marque_tx)); // if credit note, dont allow to modify margin if ($line->subprice < 0) { From 7bcc76c1aa2fadfd4c3a701eea5a4777ebf0e51a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Oct 2021 19:39:56 +0200 Subject: [PATCH 0924/1460] Fix margin rates and mark rates are 2 different columns --- htdocs/core/tpl/objectline_edit.tpl.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index 9094daaa2d1..3ce3fffd28d 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -296,7 +296,8 @@ $coldisplay++; echo '%'; } $coldisplay++; - } elseif (!empty($conf->global->DISPLAY_MARK_RATES)) { + } + if (!empty($conf->global->DISPLAY_MARK_RATES)) { $mark_rate = (GETPOSTISSET("np_markRate") ? GETPOST("np_markRate", 'alpha', 2) : price($line->marque_tx)); // if credit note, dont allow to modify margin if ($line->subprice < 0) { From 5221c9e38f947006838c31394fd041ccdb77b7b6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Oct 2021 17:17:08 +0200 Subject: [PATCH 0925/1460] Fix editline --- htdocs/expensereport/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index eec14c85a99..5f924cbbaa2 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -2524,7 +2524,7 @@ if ($action == 'create') { print '
    '; -if ($action != 'create' && $action != 'edit') { +if ($action != 'create' && $action != 'edit' && $action != 'editline') { $object = new ExpenseReport($db); $object->fetch($id, $ref); From 074b5589bd6eaacbe07917377f09fa737bdb3cdc Mon Sep 17 00:00:00 2001 From: Polkiko Date: Mon, 18 Oct 2021 00:48:33 +0200 Subject: [PATCH 0926/1460] NEW Added documents page and send mail possibility in payments - Documents page has been added to the payments page so that documents can be linked and see the generated pdf documents. - The possibility of sending payments by email has been added, attaching the payment receipts in pdf. - In pdf standard model of payment, the possibility of seeing the active iban of a third party has been added if it exists. --- htdocs/core/lib/payments.lib.php | 15 +- .../doc/pdf_standard.modules.php | 19 ++ htdocs/fourn/paiement/card.php | 31 +++ htdocs/fourn/paiement/document.php | 178 ++++++++++++++++++ htdocs/langs/en_US/bills.lang | 3 +- htdocs/langs/es_ES/bills.lang | 1 + 6 files changed, 245 insertions(+), 2 deletions(-) create mode 100644 htdocs/fourn/paiement/document.php diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php index 4621e22d122..9bc36993ff2 100644 --- a/htdocs/core/lib/payments.lib.php +++ b/htdocs/core/lib/payments.lib.php @@ -99,7 +99,7 @@ function bankline_prepare_head($id) */ function payment_supplier_prepare_head(Paiement $object) { - global $langs, $conf; + global $db, $langs, $conf; $h = 0; $head = array(); @@ -120,6 +120,19 @@ function payment_supplier_prepare_head(Paiement $object) $head[$h][2] = 'info'; $h++; + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; + $upload_dir = $conf->fournisseur->payment->dir_output.'/'.$object->ref; + $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); + $nbLinks = Link::count($db, $object->element, $object->id); + $head[$h][0] = DOL_URL_ROOT.'/fourn/paiement/document.php?id='.$object->id; + $head[$h][1] = $langs->trans('Documents'); + if (($nbFiles + $nbLinks) > 0) { + $head[$h][1] .= ''.($nbFiles + $nbLinks).''; + } + $head[$h][2] = 'documents'; + $h++; + complete_head_from_modules($conf, $langs, $object, $head, $h, 'payment_supplier', 'remove'); return $head; diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php index b6da2d4c294..37e2cbf98f6 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -812,6 +812,25 @@ class pdf_standard extends ModelePDFSuppliersPayments $pdf->SetFont('', '', $default_font_size - 1); $pdf->SetXY($posx + 2, $posy); $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L'); + + // Show default IBAN account + $sql = "SELECT iban_prefix"; + $sql .= " FROM ".MAIN_DB_PREFIX."societe_rib as rib"; + $sql .= " WHERE fk_soc = ".($object->thirdparty->id); + $sql .= " AND rib.default_rib = 1"; + $sql .= " AND rib.type = 'ban'"; + $sql .= " LIMIT 1"; + $resql = $this->db->query($sql); + if ($resql) { + $obj = $this->db->fetch_object($resql); + $iban = $obj->iban_prefix; + } + + if(!empty($iban)) { + $pdf->SetFont('', '', $default_font_size - 1); + $pdf->SetXY($posx + 2, $posy + 15); + $pdf->MultiCell($widthrecbox, 4, $langs->trans("IBAN").': '.$iban, 0, 'L'); + } } } diff --git a/htdocs/fourn/paiement/card.php b/htdocs/fourn/paiement/card.php index ccc29105e4f..61a57868eca 100644 --- a/htdocs/fourn/paiement/card.php +++ b/htdocs/fourn/paiement/card.php @@ -135,6 +135,13 @@ $upload_dir = $conf->fournisseur->payment->dir_output; $permissiontoadd = true; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; +// Actions to send emails +$triggersendname = 'PAYMENTRECEIPT_SENTBYMAIL'; +$paramname = 'id'; +$autocopy = 'MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO'; +$trackid = 'pre'.$object->id; +include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; + /* * View @@ -334,6 +341,18 @@ if ($result > 0) { */ print '
    '; + + // Send by mail + if ($user->socid == 0 && $action == '') { + $usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS)); + if ($usercansend) { + print ''.$langs->trans('SendMail').''; + } else { + print ''.$langs->trans('SendMail').''; + } + } + + // Payment validation if (!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) { if ($user->socid == 0 && $object->statut == 0 && $action == '') { if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && (!empty($user->rights->fournisseur->facture->creer) || !empty($user->rights->supplier_invoice->creer))) @@ -342,6 +361,8 @@ if ($result > 0) { } } } + + // Delete payment if ($user->socid == 0 && $action == '') { if ($user->rights->fournisseur->facture->supprimer) { if ($allow_delete) { @@ -381,6 +402,16 @@ if ($result > 0) { */ print '
    '; + + // Presend form + $modelmail = ''; //TODO: Add new 'payment receipt' model in email models + $defaulttopic = 'SendPaymentReceipt'; + $diroutput = $conf->fournisseur->payment->dir_output; + $autocopy = 'MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO'; + $trackid = 'pre'.$object->id; + + include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; + } else { $langs->load("errors"); print $langs->trans("ErrorRecordNotFound"); diff --git a/htdocs/fourn/paiement/document.php b/htdocs/fourn/paiement/document.php new file mode 100644 index 00000000000..189fafa9c73 --- /dev/null +++ b/htdocs/fourn/paiement/document.php @@ -0,0 +1,178 @@ + + * Copyright (C) 2004-2016 Laurent Destailleur + * Copyright (C) 2005 Marc Barilley / Ocebo + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2012 Marcos García + * Copyright (C) 2013 Cédric Salvador + * Copyright (C) 2017 Ferran Marcet + * Copyright (C) 2021 Jesus Jerez + * + * 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 . + */ + +/** + * \file htdocs/fourn/paiement/document.php + * \ingroup facture, fournisseur + * \brief Management page of attached documents to a payment + */ + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; +if (!empty($conf->projet->enabled)) { + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +} + +// Load translation files required by the page +$langs->loadLangs(array('bills', 'banks', 'companies', 'suppliers', 'other')); + +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); +$action = GETPOST('action', 'aZ09'); +$confirm = GETPOST('confirm', 'alpha'); + +// Security check +if ($user->socid) { + $socid = $user->socid; +} +$result = restrictedArea($user, $object->element, $object->id, 'paiementfourn', ''); + +// Get parameters +$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$sortfield = GETPOST("sortfield", 'alpha'); +$sortorder = GETPOST("sortorder", 'alpha'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +if (empty($page) || $page == -1) { + $page = 0; +} // If $page is not defined, or '' or -1 +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (!$sortorder) { + $sortorder = "ASC"; +} +if (!$sortfield) { + $sortfield = "name"; +} + +// Load object +$object = new PaiementFourn($db); +if ($object->fetch($id, $ref)) { + $object->fetch_thirdparty(); + $ref = dol_sanitizeFileName($object->ref); + $upload_dir = $conf->fournisseur->payment->dir_output.'/'.dol_sanitizeFileName($object->ref); +} + +/* + * Actions + */ + +include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; + + +/* + * View + */ + +$form = new Form($db); + +$title = $langs->trans('Payment')." - ".$langs->trans('Documents'); +llxHeader('', $title); + +if ($object->id > 0) { + $head = payment_supplier_prepare_head($object); + print dol_get_fiche_head($head, 'documents', $langs->trans("SupplierPayment"), -1, 'payment'); + + // Supplier order card + $linkback = ''.$langs->trans("BackToList").''; + + $morehtmlref = '
    '; + + // Date of payment + $morehtmlref .= $form->editfieldkey("Date", 'datep', $object->date, $object, $object->statut == 0 && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer), 'datehourpicker', '', null, 3).': '; + $morehtmlref .= $form->editfieldval("Date", 'datep', $object->date, $object, $object->statut == 0 && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer), 'datehourpicker', '', null, $langs->trans('PaymentDateUpdateSucceeded')); + + // Payment mode + $labeltype = + $morehtmlref .= '
    '.$langs->trans('PaymentMode').' : '; + $morehtmlref .= $langs->trans("PaymentType".$object->type_code) != ("PaymentType".$object->type_code) ? $langs->trans("PaymentType".$object->type_code) : $object->type_label; + $morehtmlref .= $object->num_payment ? ' - '.$object->num_payment : ''; + + // Thirdparty + $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + + // Amount + $morehtmlref .= '
    '.$langs->trans('Amount').' : '. price($object->amount, '', $langs, 0, 0, -1, $conf->currency); + + $allow_delete = 1; + // Bank account + if (!empty($conf->banque->enabled)) { + if ($object->fk_account) { + $bankline = new AccountLine($db); + $bankline->fetch($object->bank_line); + if ($bankline->rappro) { + $allow_delete = 0; + $title_button = dol_escape_htmltag($langs->transnoentitiesnoconv("CantRemoveConciliatedPayment")); + } + + $morehtmlref .= '
    '.$langs->trans('BankAccount').' : '; + $accountstatic = new Account($db); + $accountstatic->fetch($bankline->fk_account); + $morehtmlref .= $accountstatic->getNomUrl(1); + + $morehtmlref .= '
    '.$langs->trans('BankTransactionLine').' : '; + $morehtmlref .= $bankline->getNomUrl(1, 0, 'showconciliated'); + } + } + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + + // Build file list + $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1); + $totalsize = 0; + foreach ($filearray as $key => $file) { + $totalsize += $file['size']; + } + + print '
    '; + print '
    '; + + print ''; + print ''; + print ''; + print "
    '.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
    '.$langs->trans("TotalSizeOfAttachedFiles").''.dol_print_size($totalsize, 1, 1).'
    \n"; + + print "
    \n"; + + print dol_get_fiche_end(); + + $modulepart = 'supplier_payment'; + // TODO: get the appropriate permission + $permissiontoadd = true; + $permtoedit = true; + $param = '&id='.$object->id; + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; +} else { + header('Location: index.php'); + exit; +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index a835ec8475d..c5725fc7487 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -244,6 +244,7 @@ EscompteOffered=Discount offered (payment before term) EscompteOfferedShort=Discount SendBillRef=Submission of invoice %s SendReminderBillRef=Submission of invoice %s (reminder) +SendPaymentReceipt=Submission of payment receipt %s NoDraftBills=No draft invoices NoOtherDraftBills=No other draft invoices NoDraftInvoices=No draft invoices @@ -590,4 +591,4 @@ FacParentLine=Invoice Line Parent SituationTotalRayToRest=Remainder to pay without taxe PDFSituationTitle=Situation n° %d SituationTotalProgress=Total progress %d %% -SearchUnpaidInvoicesWithDueDate=Search unpaid invoices with a due date = %s \ No newline at end of file +SearchUnpaidInvoicesWithDueDate=Search unpaid invoices with a due date = %s diff --git a/htdocs/langs/es_ES/bills.lang b/htdocs/langs/es_ES/bills.lang index a2b687a3b3a..dc312787fb3 100644 --- a/htdocs/langs/es_ES/bills.lang +++ b/htdocs/langs/es_ES/bills.lang @@ -244,6 +244,7 @@ EscompteOffered=Descuento (Pronto pago) EscompteOfferedShort=Descuento SendBillRef=Envío de la factura %s SendReminderBillRef=Envío de la factura %s (recordatorio) +SendPaymentReceipt=Envío del recibo de pago %s NoDraftBills=Ninguna factura borrador NoOtherDraftBills=Ninguna otra factura borrador NoDraftInvoices=Sin facturas borrador From 4c5e9599113416a2bfe8bf76fa6c19d91f1c0c4a Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sun, 17 Oct 2021 23:52:24 +0000 Subject: [PATCH 0927/1460] Fixing style errors. --- .../core/modules/supplier_payment/doc/pdf_standard.modules.php | 2 +- htdocs/fourn/paiement/card.php | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php index 37e2cbf98f6..0a4cd815d45 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -826,7 +826,7 @@ class pdf_standard extends ModelePDFSuppliersPayments $iban = $obj->iban_prefix; } - if(!empty($iban)) { + if (!empty($iban)) { $pdf->SetFont('', '', $default_font_size - 1); $pdf->SetXY($posx + 2, $posy + 15); $pdf->MultiCell($widthrecbox, 4, $langs->trans("IBAN").': '.$iban, 0, 'L'); diff --git a/htdocs/fourn/paiement/card.php b/htdocs/fourn/paiement/card.php index 61a57868eca..c4abcce44a9 100644 --- a/htdocs/fourn/paiement/card.php +++ b/htdocs/fourn/paiement/card.php @@ -411,7 +411,6 @@ if ($result > 0) { $trackid = 'pre'.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; - } else { $langs->load("errors"); print $langs->trans("ErrorRecordNotFound"); From c9ee0e5f9393248236c1bd37abb3cd6cbaa5b7ed Mon Sep 17 00:00:00 2001 From: Polkiko Date: Mon, 18 Oct 2021 01:55:04 +0200 Subject: [PATCH 0928/1460] Fixed error --- htdocs/fourn/paiement/document.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/fourn/paiement/document.php b/htdocs/fourn/paiement/document.php index 189fafa9c73..05a13d901da 100644 --- a/htdocs/fourn/paiement/document.php +++ b/htdocs/fourn/paiement/document.php @@ -109,7 +109,6 @@ if ($object->id > 0) { $morehtmlref .= $form->editfieldval("Date", 'datep', $object->date, $object, $object->statut == 0 && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer), 'datehourpicker', '', null, $langs->trans('PaymentDateUpdateSucceeded')); // Payment mode - $labeltype = $morehtmlref .= '
    '.$langs->trans('PaymentMode').' : '; $morehtmlref .= $langs->trans("PaymentType".$object->type_code) != ("PaymentType".$object->type_code) ? $langs->trans("PaymentType".$object->type_code) : $object->type_label; $morehtmlref .= $object->num_payment ? ' - '.$object->num_payment : ''; From dce1e56a78a83273089f3a7082b508ac233ccc5a Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 18 Oct 2021 05:44:22 +0200 Subject: [PATCH 0929/1460] FIX #18912 Accountancy - SQL error when custom group is added without country defined --- htdocs/accountancy/admin/categories_list.php | 29 +++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index 9a8a84893fe..4891aae2e3f 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -1,6 +1,6 @@ - * Copyright (C) 2011-2017 Alexandre Spangaro + * Copyright (C) 2011-2021 Alexandre Spangaro * * 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 @@ -91,19 +91,19 @@ $tabsql[32] = "SELECT a.rowid as rowid, a.code as code, a.label, a.range_account $tabsqlsort = array(); $tabsqlsort[32] = "position ASC"; -// Nom des champs en resultat de select pour affichage du dictionnaire +// Name of the fields in the result of select to display the dictionary $tabfield = array(); $tabfield[32] = "code,label,range_account,category_type,formula,position,country"; -// Nom des champs d'edition pour modification d'un enregistrement +// Name of editing fields for record modification $tabfieldvalue = array(); $tabfieldvalue[32] = "code,label,range_account,category_type,formula,position,country_id"; -// Nom des champs dans la table pour insertion d'un enregistrement +// Name of the fields in the table for inserting a record $tabfieldinsert = array(); $tabfieldinsert[32] = "code,label,range_account,category_type,formula,position,fk_country"; -// Nom du rowid si le champ n'est pas de type autoincrement +// Name of the rowid if the field is not of type autoincrement // Example: "" if id field is "rowid" and has autoincrement on // "nameoffield" if id field is not "rowid" or has not autoincrement on $tabrowid = array(); @@ -151,7 +151,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) { if ($value == 'range_account' && empty($_POST['range_account'])) { continue; } - if ($value == 'country' || $value == 'country_id') { + if (($value == 'country' || $value == 'country_id') && (!empty($_POST['country_id']))) { continue; } if (!GETPOSTISSET($value) || GETPOST($value) == '') { @@ -176,6 +176,9 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) { if ($fieldnamekey == 'category_type') { $fieldnamekey = 'Calculated'; } + if ($fieldnamekey == 'country') { + $fieldnamekey = 'Country'; + } setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors'); } @@ -263,7 +266,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) { } } - // Si verif ok et action modify, on modifie la ligne + // If check ok and action modify, we modify the line if ($ok && GETPOST('actionmodify', 'alpha')) { if ($tabrowid[$id]) { $rowidcol = $tabrowid[$id]; @@ -430,12 +433,12 @@ print load_fiche_titre($titre, $linkback, $titlepicto); print ''.$langs->trans("AccountingAccountGroupsDesc", $langs->transnoentitiesnoconv("ByPersonalizedAccountGroups")).'

    '; -// Confirmation de la suppression de la ligne +// Confirmation of the deletion of the line if ($action == 'delete') { print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$code.'&id='.$id.($search_country_id > 0 ? '&search_country_id='.$search_country_id : ''), $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1); } -// Complete requete recherche valeurs avec critere de tri +// Complete search query with sorting criteria $sql = $tabsql[$id]; if ($search_country_id > 0) { @@ -634,14 +637,14 @@ if ($resql) { // Title of lines print ''; foreach ($fieldlist as $field => $value) { - // Determine le nom du champ par rapport aux noms possibles - // dans les dictionnaires de donnees - $showfield = 1; // By defaut + // Determines the name of the field in relation to the possible names + // in data dictionaries + $showfield = 1; // By default $class = "left"; $sortable = 1; $valuetoshow = ''; - $valuetoshow = ucfirst($fieldlist[$field]); // By defaut + $valuetoshow = ucfirst($fieldlist[$field]); // By default $valuetoshow = $langs->trans($valuetoshow); // try to translate if ($fieldlist[$field] == 'source') { $valuetoshow = $langs->trans("Contact"); From cf63412fee785def07fa0a97e74c25319a4e204c Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Mon, 18 Oct 2021 09:39:10 +0200 Subject: [PATCH 0930/1460] FIX : keyval filters on lists don't work --- htdocs/hrm/class/evaluation.class.php | 2 +- htdocs/hrm/evaluation_list.php | 2 +- htdocs/hrm/job_list.php | 2 +- htdocs/hrm/skill_list.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/hrm/class/evaluation.class.php b/htdocs/hrm/class/evaluation.class.php index f1a446c43b7..75dc03cc6f2 100644 --- a/htdocs/hrm/class/evaluation.class.php +++ b/htdocs/hrm/class/evaluation.class.php @@ -116,7 +116,7 @@ class Evaluation extends CommonObject 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>'1', 'position'=>510, 'notnull'=>1, 'visible'=>-2, 'foreignkey'=>'user.rowid',), 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>'1', 'position'=>511, 'notnull'=>-1, 'visible'=>-2,), 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,), - 'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'notnull'=>1, 'default'=>0, 'visible'=>5, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Brouillon', '1'=>'Validé'),), + 'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'notnull'=>1, 'default'=>0, 'visible'=>5, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Validated', '6' => 'Closed'),), 'date_eval' => array('type'=>'date', 'label'=>'DateEval', 'enabled'=>'1', 'position'=>502, 'notnull'=>1, 'visible'=>1,), 'fk_user' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'User', 'enabled'=>'1', 'position'=>504, 'notnull'=>1, 'visible'=>1,), 'fk_job' => array('type'=>'integer:Job:/hrm/class/job.class.php', 'label'=>'Job', 'enabled'=>'1', 'position'=>505, 'notnull'=>1, 'visible'=>1,), diff --git a/htdocs/hrm/evaluation_list.php b/htdocs/hrm/evaluation_list.php index 9ec102c45ea..5fa565e397d 100644 --- a/htdocs/hrm/evaluation_list.php +++ b/htdocs/hrm/evaluation_list.php @@ -296,7 +296,7 @@ foreach ($search as $key => $val) { } $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) { - if ($search[$key] == '-1' || $search[$key] === '0') { + if ($search[$key] == '-1'/* || $search[$key] === '0'*/) { $search[$key] = ''; } $mode_search = 2; diff --git a/htdocs/hrm/job_list.php b/htdocs/hrm/job_list.php index fdf2de51d45..b851057311e 100644 --- a/htdocs/hrm/job_list.php +++ b/htdocs/hrm/job_list.php @@ -296,7 +296,7 @@ foreach ($search as $key => $val) { } $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) { - if ($search[$key] == '-1' || $search[$key] === '0') { + if ($search[$key] == '-1'/* || $search[$key] === '0'*/) { $search[$key] = ''; } $mode_search = 2; diff --git a/htdocs/hrm/skill_list.php b/htdocs/hrm/skill_list.php index 5e8ae1e6e24..58f71fefdce 100644 --- a/htdocs/hrm/skill_list.php +++ b/htdocs/hrm/skill_list.php @@ -296,7 +296,7 @@ foreach ($search as $key => $val) { } $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) { - if ($search[$key] == '-1' || $search[$key] === '0') { + if ($search[$key] == '-1'/* || $search[$key] === '0'*/) { $search[$key] = ''; } $mode_search = 2; From 2ff75dfab4cccdb334b4b6952009fe632024899c Mon Sep 17 00:00:00 2001 From: atm-florian Date: Mon, 18 Oct 2021 09:43:05 +0200 Subject: [PATCH 0931/1460] FIX 13.0 feedback of PR #18993: make ticket messages punctual events with attr percentage = -1 --- htdocs/comm/action/card.php | 2 +- htdocs/ticket/class/ticket.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 0bbcf20a796..2a0371d4615 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -503,7 +503,7 @@ if (empty($reshook) && $action == 'update') $object->note_private = trim(GETPOST("note", "restricthtml")); $object->fk_element = GETPOST("fk_element", "int"); $object->elementtype = GETPOST("elementtype", "alphanohtml"); - if (!$datef && $percentage == 100 && !preg_match('/^TICKET_MSG/', $object->code)) + if (!$datef && $percentage == 100) { $error++; $donotclearsession = 1; setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEnd")), $object->errors, 'errors'); diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 20d63cea600..1c53217d4b3 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1657,7 +1657,7 @@ class Ticket extends CommonObject $actioncomm->userassigned = array($user->id); $actioncomm->userownerid = $user->id; $actioncomm->datep = $now; - $actioncomm->percentage = 100; + $actioncomm->percentage = -1; $actioncomm->elementtype = 'ticket'; $actioncomm->fk_element = $this->id; From aff8d9c24a966bc2750a03653247b7cde82db214 Mon Sep 17 00:00:00 2001 From: atm-florian Date: Mon, 18 Oct 2021 09:46:20 +0200 Subject: [PATCH 0932/1460] FIX 13.0 PR #18993: add comment on modified part --- htdocs/ticket/class/ticket.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 1c53217d4b3..91d50e903a3 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1657,7 +1657,7 @@ class Ticket extends CommonObject $actioncomm->userassigned = array($user->id); $actioncomm->userownerid = $user->id; $actioncomm->datep = $now; - $actioncomm->percentage = -1; + $actioncomm->percentage = -1; // percentage is not relevant for punctual events $actioncomm->elementtype = 'ticket'; $actioncomm->fk_element = $this->id; From 9685695577df5933a95b398ed6520e893ab19bd2 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 18 Oct 2021 10:19:46 +0200 Subject: [PATCH 0933/1460] FIX Accountancy - PHP8 --- htdocs/accountancy/class/bookkeeping.class.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 2c715aa9fd6..43dcce8c646 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -937,7 +937,6 @@ class BookKeeping extends CommonObject $line->piece_num = $obj->piece_num; $line->date_creation = $this->db->jdate($obj->date_creation); $line->date_export = $this->db->jdate($obj->date_export); - $line->date_validation = $this->db->jdate($obj->date_validated); $line->date_validation = $this->db->jdate($obj->date_validation); $this->lines[] = $line; @@ -1090,7 +1089,6 @@ class BookKeeping extends CommonObject $line->date_lim_reglement = $this->db->jdate($obj->date_lim_reglement); $line->date_modification = $this->db->jdate($obj->date_modification); $line->date_export = $this->db->jdate($obj->date_export); - $line->date_validation = $this->db->jdate($obj->date_validated); $line->date_validation = $this->db->jdate($obj->date_validation); $this->lines[] = $line; @@ -1751,7 +1749,6 @@ class BookKeeping extends CommonObject $line->date_creation = $obj->date_creation; $line->date_modification = $obj->date_modification; $line->date_export = $obj->date_export; - $line->date_validation = $obj->date_validated; $line->date_validation = $obj->date_validation; $this->linesmvt[] = $line; @@ -1816,7 +1813,6 @@ class BookKeeping extends CommonObject $line->sens = $obj->sens; $line->code_journal = $obj->code_journal; $line->piece_num = $obj->piece_num; - $line->date_validation = $obj->date_validated; $line->date_validation = $obj->date_validation; $this->linesexport[] = $line; From 053740792f19592b10a48fb88a7af23b8a1c308b Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 18 Oct 2021 10:19:50 +0200 Subject: [PATCH 0934/1460] Update accounting.lib.php --- htdocs/core/lib/accounting.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/accounting.lib.php b/htdocs/core/lib/accounting.lib.php index 68af901a757..30f1b497885 100644 --- a/htdocs/core/lib/accounting.lib.php +++ b/htdocs/core/lib/accounting.lib.php @@ -103,7 +103,7 @@ function length_accountg($account) return $account; } - $g = $conf->global->ACCOUNTING_LENGTH_GACCOUNT; + $g = !empty($conf->global->ACCOUNTING_LENGTH_GACCOUNT); if (!is_empty($g)) { // Clean parameters $i = strlen($account); @@ -142,7 +142,7 @@ function length_accounta($accounta) return $accounta; } - $a = $conf->global->ACCOUNTING_LENGTH_AACCOUNT; + $a = !empty($conf->global->ACCOUNTING_LENGTH_AACCOUNT); if (!is_empty($a)) { // Clean parameters $i = strlen($accounta); From 11230ebf7fe34b352281e1b8fd1fd5e1f758db37 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Oct 2021 12:05:40 +0200 Subject: [PATCH 0935/1460] Clean code --- htdocs/public/project/suggestbooth.php | 2 +- htdocs/public/project/suggestconference.php | 2 +- htdocs/public/project/viewandvote.php | 29 +++++++++++---------- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index 7e1607adbe2..0b5e26702e8 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -526,7 +526,7 @@ print '
    '; print '
    '; // Welcome message -$text = ''.$langs->trans("EvntOrgRegistrationBoothWelcomeMessage").'
    '; +$text = ''.$langs->trans("EvntOrgRegistrationBoothWelcomeMessage").'
    '; $text .= ''.$langs->trans("EvntOrgRegistrationBoothHelpMessage").' '.$project->label.'.

    '."\n"; $text .= ''.$project->note_public.''."\n"; print $text; diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index ff159e30943..62b54758cc7 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -459,7 +459,7 @@ print '
    '; print '
    '; // Welcome message -$text = ''.$langs->trans("EvntOrgRegistrationConfWelcomeMessage").'
    '; +$text = ''.$langs->trans("EvntOrgRegistrationConfWelcomeMessage").'
    '; $text .= ''.$langs->trans("EvntOrgRegistrationConfHelpMessage").' '.$project->label.'.

    '."\n"; $text .= ''.$project->note_public.''."\n"; print $text; diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php index f119f08239d..e680df15a1c 100644 --- a/htdocs/public/project/viewandvote.php +++ b/htdocs/public/project/viewandvote.php @@ -101,20 +101,18 @@ if (empty($conf->eventorganization->enabled)) { $tmpthirdparty = new Societe($db); -$listOfConferences = $listOfBooths = ''.$langs->trans('Label').' - '.$langs->trans('Type').' - '.$langs->trans('DateStart').' - '.$langs->trans('DateEnd').' - '.$langs->trans('Thirdparty').' - '.$langs->trans('Note').''; +$listOfConferences = ''.$langs->trans('Label').''; +$listOfConferences .= ''.$langs->trans('Type').''; +$listOfConferences .= ''.$langs->trans('ThirdParty').''; +$listOfConferences .= ''.$langs->trans('Note').''; -$sql = "SELECT a.id, a.fk_action, a.datep, a.datep2, a.label, a.fk_soc, a.note, ca.libelle +$sql = "SELECT a.id, a.fk_action, a.datep, a.datep2, a.label, a.fk_soc, a.note, ca.libelle as label FROM ".MAIN_DB_PREFIX."actioncomm as a INNER JOIN ".MAIN_DB_PREFIX."c_actioncomm as ca ON (a.fk_action=ca.id) WHERE a.status<2"; $sqlforconf = $sql." AND ca.module='conference@eventorganization'"; -$sqlforbooth = $sql." AND ca.module='booth@eventorganization'"; +//$sqlforbooth = $sql." AND ca.module='booth@eventorganization'"; // For conferences $result = $db->query($sqlforconf); @@ -132,12 +130,13 @@ while ($i < $db->num_rows($result)) { $thirdpartyname = ''; } - $listOfConferences .= ''.$obj->label.''.$obj->libelle.''.$obj->datep.''.$obj->datep2.''.$thirdpartyname.''.$obj->note.''; + $listOfConferences .= ''.$obj->label.''.$obj->label.''.$thirdpartyname.''.$obj->note.''; $listOfConferences .= ''; $i++; } // For booths +/* $result = $db->query($sqlforbooth); $i = 0; while ($i < $db->num_rows($result)) { @@ -157,6 +156,7 @@ while ($i < $db->num_rows($result)) { $listOfBooths .= ''; $i++; } +*/ // Get vote result $idvote = GETPOST("vote"); @@ -275,19 +275,20 @@ $text .= ''.$project->note_public.'' print $text; print ''."\n"; -print dol_get_fiche_head(''); -print ''."\n"; +print '
    '."\n"; print ''; -print $listOfConferences.'
    '; +print $listOfConferences.'
    '; print '
    '.$langs->trans("ListOfSuggestedConferences").'
    '."\n"; -print '
    '; +/* +print '
    '; print ''."\n"; print ''; -print $listOfBooths.'
    '; +print $listOfBooths.'
    '; print '
    '.$langs->trans("ListOfSuggestedBooths").'
    '."\n"; +*/ $object = null; From d0d5955fb1620eca46319485d304e6159c857529 Mon Sep 17 00:00:00 2001 From: atm-florian Date: Mon, 18 Oct 2021 12:09:33 +0200 Subject: [PATCH 0936/1460] FIX 13.0: sometimes firstname was mistyped as fistname --- htdocs/datapolicy/class/actions_datapolicy.class.php | 6 +++--- htdocs/install/repair.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/datapolicy/class/actions_datapolicy.class.php b/htdocs/datapolicy/class/actions_datapolicy.class.php index d6c16a6be4e..dea9ec0ef84 100644 --- a/htdocs/datapolicy/class/actions_datapolicy.class.php +++ b/htdocs/datapolicy/class/actions_datapolicy.class.php @@ -133,7 +133,7 @@ class ActionsDatapolicy header('Content-Disposition: attachment; filename=datapolicy_portabilite.csv'); header('Pragma: no-cache'); $object->fetch(GETPOST('socid')); - echo 'Name;Fistname;Civility;Thirdparty;Function;Address;ZipCode;City;Department;Country;Email;Pro Phone;Perso Phone;Mobile Phone;Instant Mail;Birthday;'.PHP_EOL; + echo 'Name;Firstname;Civility;Thirdparty;Function;Address;ZipCode;City;Department;Country;Email;Pro Phone;Perso Phone;Mobile Phone;Instant Mail;Birthday;'.PHP_EOL; echo $object->name.';'; echo ';'; echo ';'; @@ -157,7 +157,7 @@ class ActionsDatapolicy header('Pragma: no-cache'); $soc = $object->fetch_thirdparty(); - echo 'Name;Fistname;Civility;Thirdparty;Function;Address;ZipCode;City;Department;Country;Email;Pro Phone;Perso Phone;Mobile Phone;Instant Mail;Birthday;'.PHP_EOL; + echo 'Name;Firstname;Civility;Thirdparty;Function;Address;ZipCode;City;Department;Country;Email;Pro Phone;Perso Phone;Mobile Phone;Instant Mail;Birthday;'.PHP_EOL; echo $object->lastname.';'; echo $object->firstname.';'; echo $object->getCivilityLabel().';'; @@ -181,7 +181,7 @@ class ActionsDatapolicy header('Content-Disposition: attachment; filename=datapolicy_portabilite.csv'); header('Pragma: no-cache'); $soc = $object->fetch_thirdparty(); - echo 'Name;Fistname;Civility;Thirdparty;Function;Address;ZipCode;City;Department;Country;Email;Pro Phone;Perso Phone;Mobile Phone;Instant Mail;Birthday;'.PHP_EOL; + echo 'Name;Firstname;Civility;Thirdparty;Function;Address;ZipCode;City;Department;Country;Email;Pro Phone;Perso Phone;Mobile Phone;Instant Mail;Birthday;'.PHP_EOL; echo $object->lastname.';'; echo $object->firstname.';'; echo $object->getCivilityLabel().';'; diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php index baac0eb2cbd..21f00a47d12 100644 --- a/htdocs/install/repair.php +++ b/htdocs/install/repair.php @@ -590,7 +590,7 @@ if ($ok && GETPOST('restore_user_pictures', 'alpha')) $filetotestsmall = $dolibarr_main_data_root.'/users/'.substr(sprintf('%08d', $obj->rowid), -1, 1).'/'.substr(sprintf('%08d', $obj->rowid), -2, 1).'/thumbs/'.$name.'_small'.$ext; $filetotestmini = $dolibarr_main_data_root.'/users/'.substr(sprintf('%08d', $obj->rowid), -1, 1).'/'.substr(sprintf('%08d', $obj->rowid), -2, 1).'/thumbs/'.$name.'_mini'.$ext; $exists = dol_is_file($filetotest); - print 'Check user '.$obj->rowid.' lastname='.$obj->lastname.' fistname='.$obj->firstname.' photo='.$obj->photo.' file '.$filetotest." exists=".$exists."
    \n"; + print 'Check user '.$obj->rowid.' lastname='.$obj->lastname.' firstname='.$obj->firstname.' photo='.$obj->photo.' file '.$filetotest." exists=".$exists."
    \n"; if ($exists) { $filetarget = $dolibarr_main_data_root.'/users/'.$obj->rowid.'/'.$name.$ext; From a52ceaf1d28fc8dab449bcb1db1ca969a88017e8 Mon Sep 17 00:00:00 2001 From: lvessiller Date: Mon, 18 Oct 2021 12:12:00 +0200 Subject: [PATCH 0937/1460] FIX generate documents with PDF options --- htdocs/comm/propal/class/propal.class.php | 14 ++++++++++++-- .../class/recruitmentjobposition.class.php | 8 +++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 6e3f60a7cf5..0142d0c1b7a 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -2563,8 +2563,13 @@ class Propal extends CommonObject $outputlangs->setDefaultLang($newlang); } + // PDF + $hidedetails = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0); + $hidedesc = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0); + $hideref = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0); + //$ret=$object->fetch($id); // Reload to get new records - $this->generateDocument($modelpdf, $outputlangs); + $this->generateDocument($modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); } if (!$error) { @@ -2651,8 +2656,13 @@ class Propal extends CommonObject $outputlangs->setDefaultLang($newlang); } + // PDF + $hidedetails = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0); + $hidedesc = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0); + $hideref = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0); + //$ret=$object->fetch($id); // Reload to get new records - $this->generateDocument($modelpdf, $outputlangs); + $this->generateDocument($modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); } $this->oldcopy = clone $this; diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php index 892ba4121e9..a767900ec7e 100644 --- a/htdocs/recruitment/class/recruitmentjobposition.class.php +++ b/htdocs/recruitment/class/recruitmentjobposition.class.php @@ -698,8 +698,14 @@ class RecruitmentJobPosition extends CommonObject $newlang = (GETPOST('lang_id', 'aZ09') ? GETPOST('lang_id', 'aZ09') : $this->thirdparty->default_lang); $outputlangs->setDefaultLang($newlang); } + + // PDF + $hidedetails = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0); + $hidedesc = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0); + $hideref = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0); + //$ret=$object->fetch($id); // Reload to get new records - $this->generateDocument($modelpdf, $outputlangs); + $this->generateDocument($modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); } if (!$error) { From c016a20aacc7ccddeadad7e81967a60c194521f2 Mon Sep 17 00:00:00 2001 From: atm-florian Date: Mon, 18 Oct 2021 12:12:38 +0200 Subject: [PATCH 0938/1460] FIX 13.0 - due to a typo in the 'mode' parameter, the "first name" column of the list of members displays the full name --- htdocs/adherents/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index ad78c2cb389..a93e507bac1 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -961,7 +961,7 @@ while ($i < min($num, $limit)) { // Firstname if (!empty($arrayfields['d.firstname']['checked'])) { print ''; - print $memberstatic->getNomUrl(0, 0, 'card', 'fistname'); + print $memberstatic->getNomUrl(0, 0, 'card', 'firstname'); //print $obj->firstname; print "\n"; if (!$i) { From 51f342c81a3ba8e36395ac83315ffa0bcc661776 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Oct 2021 12:20:51 +0200 Subject: [PATCH 0939/1460] Clean code --- htdocs/public/project/index.php | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index 3990e31ba2f..3926d443f93 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -205,19 +205,27 @@ print "\n"; // Show all action buttons print '
    '; + // Output introduction text +$foundaction = 0; if ($project->accept_booth_suggestions) { - print ''; + $foundaction++; + print ''; print '

    '; } -if ($project->accept_conference_suggestions) { - print ''; +if ($project->accept_conference_suggestions == 1 || $project->accept_conference_suggestions == 2) { // Can suggest conferences + $foundaction++; + print ''; print '

    '; } -print ''; - - +if ($project->accept_conference_suggestions == 2 || $project->accept_conference_suggestions == 3) { // Can vote for conferences + $foundaction++; + print ''; +} +if (! $foundaction) { + print ''.$langs->trans("NoPublicActionsAllowedForThisEvent").''; +} print ''."\n"; From e442fcb07e4665e658d48c0ebca6cfa58718995f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Oct 2021 12:22:27 +0200 Subject: [PATCH 0940/1460] Trans --- htdocs/langs/en_US/eventorganization.lang | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 8c91d842485..88415022bde 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -162,4 +162,5 @@ RegistrationAndPaymentWereAlreadyRecorder=A registration and a payment were alre EmailAttendee=Attendee email EmailCompanyForInvoice=Company email (for invoice, if different of attendee email) ErrorSeveralCompaniesWithEmailContactUs=Several companies with this email has been found so we can't validate automaticaly your registration. Please contact us at %s for a manual validation -ErrorSeveralCompaniesWithNameContactUs=Several companies with this name has been found so we can't validate automaticaly your registration. Please contact us at %s for a manual validation \ No newline at end of file +ErrorSeveralCompaniesWithNameContactUs=Several companies with this name has been found so we can't validate automaticaly your registration. Please contact us at %s for a manual validation +NoPublicActionsAllowedForThisEvent=No public actions are open to public for this event \ No newline at end of file From 0c2cf9980d7391ad39508921aab4f42aa789e6f0 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Mon, 18 Oct 2021 14:28:30 +0200 Subject: [PATCH 0941/1460] NEW: online propal signature --- htdocs/core/ajax/onlineSign.php | 1 + htdocs/langs/en_US/propal.lang | 9 ++++++- htdocs/langs/fr_FR/propal.lang | 9 ++++++- htdocs/public/onlinesign/newonlinesign.php | 30 +++++++++++++++++----- 4 files changed, 41 insertions(+), 8 deletions(-) diff --git a/htdocs/core/ajax/onlineSign.php b/htdocs/core/ajax/onlineSign.php index 13bd28961d5..488b5051ea5 100644 --- a/htdocs/core/ajax/onlineSign.php +++ b/htdocs/core/ajax/onlineSign.php @@ -117,6 +117,7 @@ if ($action == "importSignature") { if (!$error) { $db->commit(); $response = "success"; + setEventMessage("PropalSigned"); } else { $db->rollback(); $response = "error sql"; diff --git a/htdocs/langs/en_US/propal.lang b/htdocs/langs/en_US/propal.lang index edbc08236d3..7141c1d38ae 100644 --- a/htdocs/langs/en_US/propal.lang +++ b/htdocs/langs/en_US/propal.lang @@ -89,4 +89,11 @@ IdProposal=Proposal ID IdProduct=Product ID PrParentLine=Proposal Parent Line LineBuyPriceHT=Buy Price Amount net of tax for line - +SignPropal=Sign proposal +RefusePropal=Refuse proposal +Sign=Sign +PropalAlreadyRefused=Proposal already refused +PropalAlreadySigned=Proposal already signed +PropalSigned=Proposal signed +PropalRefused=Proposal refused +ConfirmRefusePropal=Are you sure you want to refuse this commercial proposal? diff --git a/htdocs/langs/fr_FR/propal.lang b/htdocs/langs/fr_FR/propal.lang index f822d4f1d02..3728eba94d3 100644 --- a/htdocs/langs/fr_FR/propal.lang +++ b/htdocs/langs/fr_FR/propal.lang @@ -89,4 +89,11 @@ IdProposal=ID de la proposition commerciale IdProduct=ID produit PrParentLine=Ligne parent de proposition LineBuyPriceHT=Prix d'achat HT de la ligne - +SignPropal=Signer la proposition commerciale +RefusePropal=Refuser la proposition commerciale +Sign=Signer +PropalAlreadyRefused=Proposition commerciale déjà refusée +PropalAlreadySigned=Proposition commerciale déjà signée +PropalSigned=Proposition commerciale signée +PropalRefused=Proposition commerciale refusée +ConfirmRefusePropal=Êtes-vous sûr de vouloir refuser cette proposition commerciale ? diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index 6d37684ce8f..3177cbcc7a3 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -52,7 +52,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; // Load translation files -$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", "paybox")); +$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", "paybox","propal")); // Security check // No check on module enabled. Done later according to $validpaymentmethod @@ -124,9 +124,22 @@ $object->fetch(0, $ref); * Actions */ - -if ($action == 'refusepropal') { - //TODO: creer suite de cette action +if ($action == 'confirm_refusepropal') { + $sql = "UPDATE ".MAIN_DB_PREFIX."propal"; + $sql .= " SET fk_statut = ".((int) $object::STATUS_NOTSIGNED).", note_private = '".$object->note_private."', date_signature='".$db->idate(dol_now())."'"; + $sql .= " WHERE rowid = ".((int) $object->id); + dol_syslog(__METHOD__, LOG_DEBUG); + $resql = $db->query($sql); + if (!$resql) { + $error++; + } + if (!$error) { + $db->commit(); + setEventMessage("PropalRefused"); + } else { + $db->rollback(); + } + $object->fetch(0, $ref); } @@ -134,6 +147,7 @@ if ($action == 'refusepropal') { * View */ +$form = new Form($db); $head = ''; if (!empty($conf->global->MAIN_SIGN_CSS_URL)) { $head = ''."\n"; @@ -145,6 +159,10 @@ $conf->dol_hide_leftmenu = 1; $replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
    ' : '').'
    '; llxHeader($head, $langs->trans("OnlineSignature"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea, 1); +if ($action == 'refusepropal') { + print $form->formconfirm($_SERVER["PHP_SELF"].'?ref='.$ref, $langs->trans('RefusePropal'), $langs->trans('ConfirmRefusePropal', $object->ref), 'confirm_refusepropal', '', '', 1); +} + // Check link validity for param 'source' if (!empty($source) && in_array($ref, array('member_ref', 'contractline_ref', 'invoice_ref', 'order_ref', ''))) { $langs->load("errors"); @@ -351,9 +369,9 @@ if ($action == "dosign" && empty($cancel)) { '; } else { if ($object->status == $object::STATUS_SIGNED) { - print $langs->trans("PropalSigned"); + print $langs->trans("PropalAlreadySigned"); } elseif ($object->status == $object::STATUS_NOTSIGNED) { - print $langs->trans("PropalNotSigned"); + print $langs->trans("PropalAlreadyRefused"); } else { print ''; print ''; From 98a613edece9dd3fbb98a73c6f4baf3a5f1fcd2e Mon Sep 17 00:00:00 2001 From: lvessiller Date: Mon, 18 Oct 2021 14:31:37 +0200 Subject: [PATCH 0942/1460] FIX show end hours in events linked to objects --- htdocs/core/class/html.formactions.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 09c94485d11..06c0aea628c 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -309,7 +309,7 @@ class FormActions $tmpa = dol_getdate($actioncomm->datep); $tmpb = dol_getdate($actioncomm->datef); if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) { - if ($tmpa['hours'] != $tmpb['hours'] || $tmpa['minutes'] != $tmpb['minutes'] && $tmpa['seconds'] != $tmpb['seconds']) { + if ($tmpa['hours'] != $tmpb['hours'] || $tmpa['minutes'] != $tmpb['minutes']) { print '-'.dol_print_date($actioncomm->datef, 'hour', 'tzuserrel'); } } else { From 9fc6be78e0daff593804598473842744146b9db6 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Mon, 18 Oct 2021 15:26:18 +0200 Subject: [PATCH 0943/1460] fix tcpdi.php each to foreach --- dev/dolibarr_changes.txt | 5 ++++- htdocs/includes/tcpdi/tcpdi.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt index 4f80f06d444..cce6351950c 100644 --- a/dev/dolibarr_changes.txt +++ b/dev/dolibarr_changes.txt @@ -188,7 +188,10 @@ with: with } elseif (($key == '/Index') AND ($v[0] == PDF_TYPE_ARRAY AND count($v[1]) >= 2)) { - +* Fix php fatal error on php 8.0 on tcpdi.php + while (list($k, $v) = each($value[1])) { +with + foreach ($value[1] as $k => $v) { JSGANTT: -------- diff --git a/htdocs/includes/tcpdi/tcpdi.php b/htdocs/includes/tcpdi/tcpdi.php index f4c0bd00391..aaa1d70c095 100644 --- a/htdocs/includes/tcpdi/tcpdi.php +++ b/htdocs/includes/tcpdi/tcpdi.php @@ -483,7 +483,7 @@ class TCPDI extends FPDF_TPL { reset ($value[1]); - while (list($k, $v) = each($value[1])) { + foreach ($value[1] as $k => $v) { $this->_straightOut($k . ' '); $this->pdf_write_value($v); } From a324f74d88456a33cdd2f2d064c3f36bf3cc5b6f Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Mon, 18 Oct 2021 15:35:15 +0200 Subject: [PATCH 0944/1460] update newonlinesign.php with border --- htdocs/public/onlinesign/newonlinesign.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index 3177cbcc7a3..4040bcf1425 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -319,7 +319,7 @@ print ''; if ($action == "dosign" && empty($cancel)) { print '
    '; print ''; - print '
    '; + print '
    '; print '
    '; print ''; print ''; From f1d646bdedb73355f2e201a7f0e1a9730d314e4a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Oct 2021 15:25:56 +0200 Subject: [PATCH 0945/1460] Look and feel v15 --- htdocs/adherents/card.php | 6 ++--- htdocs/admin/accountant.php | 2 +- htdocs/admin/company.php | 4 ++-- htdocs/admin/company_socialnetworks.php | 1 - htdocs/admin/ihm.php | 7 +++--- htdocs/admin/openinghours.php | 2 +- htdocs/projet/card.php | 6 ++--- htdocs/public/project/index.php | 26 +++++++++++++++++---- htdocs/public/project/suggestbooth.php | 23 ++++++++++++------ htdocs/public/project/suggestconference.php | 22 ++++++++++++----- htdocs/societe/card.php | 4 ++-- htdocs/societe/partnership.php | 2 +- htdocs/theme/eldy/global.inc.php | 1 + htdocs/theme/md/style.css.php | 2 +- 14 files changed, 69 insertions(+), 39 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 0cdecb3645f..10187492037 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -2046,14 +2046,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $MAX = 10; - $morehtmlright = ''; - $morehtmlright .= $langs->trans("SeeAll"); - $morehtmlright .= ''; + $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/adherents/agenda.php?id='.$object->id); // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions = new FormActions($db); - $somethingshown = $formactions->showactions($object, $object->element, $socid, 1, 'listactions', $MAX, '', $morehtmlright); + $somethingshown = $formactions->showactions($object, $object->element, $socid, 1, 'listactions', $MAX, '', $morehtmlcenter); print '
    '; } diff --git a/htdocs/admin/accountant.php b/htdocs/admin/accountant.php index 5be2b3d6eea..4df27127608 100644 --- a/htdocs/admin/accountant.php +++ b/htdocs/admin/accountant.php @@ -94,7 +94,7 @@ $formcompany = new FormCompany($db); $countrynotdefined = ''.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; print ''.$langs->trans("AccountantDesc")."
    \n"; -print "
    \n"; +print "

    \n"; /** * Edit parameters diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 5cffc0257e1..bdafaed48fa 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -378,7 +378,7 @@ $head = company_admin_prepare_head(); print dol_get_fiche_head($head, 'company', $langs->trans("Company"), -1, 'company'); print ''.$langs->trans("CompanyFundationDesc", $langs->transnoentities("Save"))."
    \n"; -print "
    \n"; +print "

    \n"; /** @@ -457,7 +457,7 @@ print ''."\n"; // Email print ''; print img_picto('', 'object_email', '', false, 0, 0, '', 'pictofixedwidth'); -print ''; +print ''; print ''."\n"; // Web diff --git a/htdocs/admin/company_socialnetworks.php b/htdocs/admin/company_socialnetworks.php index 57c75b352f8..1ea09182344 100644 --- a/htdocs/admin/company_socialnetworks.php +++ b/htdocs/admin/company_socialnetworks.php @@ -133,7 +133,6 @@ foreach ($listofnetworks as $key => $value) { print ""; print '
    '; -print '
    '; print $form->buttonsSaveCancel("Save", ''); diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 3dcfb66031d..82eed8bee6d 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -451,11 +451,11 @@ if ($mode == 'other') { print '' . "\n"; print '
    '; - print '
    '; print '
    '; print ''; print '
    '; + print '
    '; print '
    '; // Other @@ -577,9 +577,9 @@ if ($mode == 'login') { print '
    '; print ''; - print ''; @@ -630,7 +630,6 @@ if ($mode == 'login') { print ''; } -print '
    '; print '
    '; print ''; print '
    '; diff --git a/htdocs/admin/openinghours.php b/htdocs/admin/openinghours.php index e6bc6ee8f1d..03f396c9198 100644 --- a/htdocs/admin/openinghours.php +++ b/htdocs/admin/openinghours.php @@ -81,7 +81,7 @@ $head = company_admin_prepare_head(); print dol_get_fiche_head($head, 'openinghours', $langs->trans("Company"), -1, 'company'); print ''.$langs->trans("OpeningHoursDesc")."
    \n"; -print "
    \n"; +print "

    \n"; if (empty($action) || $action == 'edit' || $action == 'updateedit') { /** diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 763c57dc51e..5922de82d2c 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -1376,14 +1376,12 @@ if ($action == 'create' && $user->rights->projet->creer) { $MAXEVENT = 10; - $morehtmlright = ''; - $morehtmlright .= $langs->trans("SeeAll"); - $morehtmlright .= ''; + $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/projet/info.php?id='.$object->id); // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions = new FormActions($db); - $somethingshown = $formactions->showactions($object, 'project', 0, 1, '', $MAXEVENT, '', $morehtmlright); + $somethingshown = $formactions->showactions($object, 'project', 0, 1, '', $MAXEVENT, '', $morehtmlcenter); print ''; } diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index 3926d443f93..5f450a6c557 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -64,7 +64,7 @@ $langs->loadLangs(array("other", "dict", "bills", "companies", "errors", "paybox // No check on module enabled. Done later according to $validpaymentmethod $action = GETPOST('action', 'aZ09'); -$id = GETPOST('id'); +$id = GETPOST('id', 'int'); $securekeyreceived = GETPOST("securekey", 'alpha'); $securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 'md5'); @@ -183,11 +183,27 @@ if (!empty($conf->global->PROJECT_IMAGE_PUBLIC_ORGANIZEDEVENT)) { print ''; } -print '
    '; + print '
    '; print $langs->trans("Parameter"); - print ''; + print ''; print $langs->trans("Value"); print '
    '."\n"; +print '
    '; -$text = ''."\n"; -$text .= ''."\n"; -$text .= ''."\n"; + +// Event summary +print '
    '; +print ''.$project->title.'
    '; +print img_picto('', 'calendar', 'class="pictofixedwidth"').$langs->trans("Date").': '; +print dol_print_date($project->date_start, 'daytext'); +if ($project->date_end && $project->date_start != $project->date_end) { + print ' - '.dol_print_date($project->date_end, 'daytext'); +} +print '

    '."\n"; +print $langs->trans("EvntOrgRegistrationWelcomeMessage")."\n"; +print $project->note_public."\n"; +//print img_picto('', 'map-marker-alt').$langs->trans("Location").': xxxx'; +print '
    '; + + +print '
    '; + +print '

    '.$langs->trans("EvntOrgRegistrationWelcomeMessage").'
    '.$langs->trans("EvntOrgRegistrationHelpMessage").' '.$project->title.'.

    '.$project->note_public.'

    '."\n"; print $text; diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index 0b5e26702e8..c0bcdc751c6 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -517,6 +517,22 @@ $formcompany = new FormCompany($db); llxHeaderVierge($langs->trans("NewSuggestionOfBooth")); +print '
    '; + +// Event summary +print '
    '; +print ''.$project->title.'
    '; +print img_picto('', 'calendar', 'class="pictofixedwidth"').$langs->trans("Date").': '; +print dol_print_date($project->date_start, 'daytext'); +if ($project->date_end && $project->date_start != $project->date_end) { + print ' - '.dol_print_date($project->date_end, 'daytext'); +} +print '

    '."\n"; +//print $langs->trans("EvntOrgRegistrationWelcomeMessage")."\n"; +//print $project->note_public."\n"; +//print img_picto('', 'map-marker-alt').$langs->trans("Location").': xxxx'; +print '
    '; + print load_fiche_titre($langs->trans("NewSuggestionOfBooth"), '', '', 0, 0, 'center'); @@ -525,13 +541,6 @@ print '
    '; print '
    '; print '
    '; -// Welcome message -$text = '

    '; -$text .= ''."\n"; -$text .= ''."\n"; -print $text; -print ''; - dol_htmloutput_errors($errmsg); // Print form diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index 62b54758cc7..f2a919c0aa2 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -450,6 +450,22 @@ $formcompany = new FormCompany($db); llxHeaderVierge($langs->trans("NewSuggestionOfConference")); +print '
    '; + +// Event summary +print '
    '; +print ''.$project->title.'
    '; +print img_picto('', 'calendar', 'class="pictofixedwidth"').$langs->trans("Date").': '; +print dol_print_date($project->date_start, 'daytext'); +if ($project->date_end && $project->date_start != $project->date_end) { + print ' - '.dol_print_date($project->date_end, 'daytext'); +} +print '

    '."\n"; +//print $langs->trans("EvntOrgRegistrationWelcomeMessage")."\n"; +//print $project->note_public."\n"; +//print img_picto('', 'map-marker-alt').$langs->trans("Location").': xxxx'; +print '
    '; + print load_fiche_titre($langs->trans("NewSuggestionOfConference"), '', '', 0, 0, 'center'); @@ -458,12 +474,6 @@ print '
    '; print '
    '; print '
    '; -// Welcome message -$text = '

    '; -$text .= ''."\n"; -$text .= ''."\n"; -print $text; -print ''; dol_htmloutput_errors($errmsg); diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 11cc7b55a4d..10bcd6d9411 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2984,12 +2984,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $MAXEVENT = 10; - $morehtmlright = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id); + $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id); // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions = new FormActions($db); - $somethingshown = $formactions->showactions($object, '', $socid, 1, '', $MAXEVENT, '', $morehtmlright); // Show all action for thirdparty + $somethingshown = $formactions->showactions($object, '', $socid, 1, '', $MAXEVENT, '', $morehtmlcenter); // Show all action for thirdparty print ''; diff --git a/htdocs/societe/partnership.php b/htdocs/societe/partnership.php index 443126290ab..2ce4884932e 100644 --- a/htdocs/societe/partnership.php +++ b/htdocs/societe/partnership.php @@ -65,7 +65,7 @@ if ($id > 0) { $object = new Partnership($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->partnership->dir_output.'/temp/massgeneration/'.$user->id; -$hookmanager->initHooks(array('partnershipthirdparty', 'globalcard')); // Note that conf->hooks_modules contains array +$hookmanager->initHooks(array('thirdpartypartnership', 'globalcard')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 0eb55107a0c..b54087c55a6 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1421,6 +1421,7 @@ table[summary="list_of_modules"] .fa-cog { .titlefieldcreate { width: 20%; } .titlefield { /* width: 25%; */ width: 250px; } .titlefieldmiddle { width: 50%; } +.titlefieldmax45 { max-width: 45%; } .imgmaxwidth180 { max-width: 180px; } .imgmaxheight50 { max-height: 50px; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 691ffa8f658..dbbdb1d2679 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -3431,7 +3431,7 @@ table.liste, table.noborder, table.formdoc, div.noborder { border-right: 1px solid #ccc; border-left: 1px solid #ccc; - margin: 0px 0px 8px 0px; + margin: 0px 0px 20px 0px; -webkit-border-radius: 0.1em; border-radius: 0.1em; From c98f28ffc8c4f99a84a263f9bf801dd512ac39da Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Oct 2021 15:57:33 +0200 Subject: [PATCH 0946/1460] Clean code --- htdocs/public/recruitment/index.php | 487 ++++++---------------------- htdocs/public/recruitment/view.php | 5 +- 2 files changed, 104 insertions(+), 388 deletions(-) diff --git a/htdocs/public/recruitment/index.php b/htdocs/public/recruitment/index.php index 840fd1f4d8f..1736deef246 100644 --- a/htdocs/public/recruitment/index.php +++ b/htdocs/public/recruitment/index.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2020 Laurent Destailleur * * 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 @@ -16,21 +16,16 @@ */ /** - * \file htdocs/public/recruitment/index.php + * \file htdocs/public/recruitment/view.php * \ingroup recruitment - * \brief Public file to list jobs + * \brief Public file to show on job */ +if (!defined('NOLOGIN')) { + define("NOLOGIN", 1); // This means this output page does not require to be logged. +} if (!defined('NOCSRFCHECK')) { - define('NOCSRFCHECK', '1'); -} -// Do not check anti CSRF attack test -if (!defined('NOREQUIREMENU')) { - define('NOREQUIREMENU', '1'); -} -// If there is no need to load and show top and left menu -if (!defined("NOLOGIN")) { - define("NOLOGIN", '1'); + define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. } if (!defined('NOIPCHECK')) { define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip @@ -38,23 +33,48 @@ if (!defined('NOIPCHECK')) { if (!defined('NOBROWSERNOTIF')) { define('NOBROWSERNOTIF', '1'); } -// If this page is public (can be called outside logged session) require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentjobposition.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; // Load translation files required by the page $langs->loadLangs(array("companies", "other", "recruitment")); // Get parameters -$action = GETPOST('action', 'aZ09'); -$email = GETPOST('email', 'alpha'); +$action = GETPOST('action', 'aZ09'); +$cancel = GETPOST('cancel', 'alpha'); +$email = GETPOST('email', 'alpha'); +$backtopage = ''; + +$ref = GETPOST('ref', 'alpha'); + +if (GETPOST('btn_view')) { + unset($_SESSION['email_customer']); +} +if (isset($_SESSION['email_customer'])) { + $email = $_SESSION['email_customer']; +} $object = new RecruitmentJobPosition($db); +if (!$action) { + if (!$ref) { + print $langs->trans('ErrorBadParameters')." - ref missing"; + exit; + } else { + $object->fetch('', $ref); + } +} + +// Define $urlwithroot +//$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); +//$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file +$urlwithroot = DOL_MAIN_URL_ROOT; // This is to use same domain name than current. For Paypal payment, we can use internal URL like localhost. + // Security check if (empty($conf->recruitment->enabled)) { accessforbidden('', 0, 0, 1); @@ -68,14 +88,17 @@ if (empty($conf->recruitment->enabled)) { // None - /* * View */ -$form = new Form($db); -$user_assign = new User($db); -$user_create = new User($db); +$head = ''; +if (!empty($conf->global->MAIN_RECRUITMENT_CSS_URL)) { + $head = ''."\n"; +} + +$conf->dol_hide_topmenu = 1; +$conf->dol_hide_leftmenu = 1; if (!$conf->global->RECRUITMENT_ENABLE_PUBLIC_INTERFACE) { $langs->load("errors"); @@ -87,382 +110,74 @@ if (!$conf->global->RECRUITMENT_ENABLE_PUBLIC_INTERFACE) { $arrayofjs = array(); $arrayofcss = array(); -llxHeaderTicket($langs->trans("Jobs"), "", 0, 0, $arrayofjs, $arrayofcss); +$replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
    ' : '').'
    '; +llxHeader($head, $langs->trans("PositionToBeFilled"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea, 1); -print '
    '; +print ''."\n"; +print '
    '."\n"; +print ''."\n"; +print ''."\n"; +print ''."\n"; +print ''."\n"; +print ''."\n"; +print ''."\n"; +print ''; +print "\n"; +print ''."\n"; -$display_ticket_list = 1; - -print '
    '; -if ($display_ticket_list) { - // Filters - $search_fk_status = GETPOST("search_fk_status", 'alpha'); - $search_subject = GETPOST("search_subject", 'alpha'); - $search_type = GETPOST("search_type", 'alpha'); - $search_category = GETPOST("search_category", 'alpha'); - $search_severity = GETPOST("search_severity", 'alpha'); - $search_fk_user_create = GETPOST("search_fk_user_create", 'int'); - $search_fk_user_assign = GETPOST("search_fk_user_assign", 'int'); - - // Store current page url - $url_page_current = dol_buildpath('/public/ticket/list.php', 1); - - // Do we click on purge search criteria ? - if (GETPOST("button_removefilter_x")) { - $search_fk_status = ''; - $search_subject = ''; - $search_type = ''; - $search_category = ''; - $search_severity = ''; - $search_fk_user_create = ''; - $search_fk_user_assign = ''; +// Show logo (search order: logo defined by ONLINE_SIGN_LOGO_suffix, then ONLINE_SIGN_LOGO_, then small company logo, large company logo, theme logo, common logo) +// Define logo and logosmall +$logosmall = $mysoc->logo_small; +$logo = $mysoc->logo; +$paramlogo = 'ONLINE_RECRUITMENT_LOGO_'.$suffix; +if (!empty($conf->global->$paramlogo)) { + $logosmall = $conf->global->$paramlogo; +} elseif (!empty($conf->global->ONLINE_RECRUITMENT_LOGO)) { + $logosmall = $conf->global->ONLINE_RECRUITMENT_LOGO_; +} +//print ''."\n"; +// Define urllogo +$urllogo = ''; +$urllogofull = ''; +if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); + $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); +} elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); + $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); +} +// Output html code for logo +if ($urllogo) { + print '
    '; + print '
    '; + print ''; + print '
    '; + if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { + print ''; } + print '
    '; +} - // fetch optionals attributes and labels - $extrafields = new ExtraFields($db); - $extrafields->fetch_name_optionals_label($object->table_element); - - $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); - - $filter = array(); - $param = 'action=viewlist'; - - // Definition of fields for list - $arrayfields = array( - 't.datec' => array('label' => $langs->trans("Date"), 'checked' => 1), - 't.date_read' => array('label' => $langs->trans("TicketReadOn"), 'checked' => 0), - 't.date_close' => array('label' => $langs->trans("TicketCloseOn"), 'checked' => 0), - 't.ref' => array('label' => $langs->trans("Ref"), 'checked' => 1), - //'t.track_id' => array('label' => $langs->trans("IDTracking"), 'checked' => 0), - 't.fk_statut' => array('label' => $langs->trans("Status"), 'checked' => 1), - 't.subject' => array('label' => $langs->trans("Subject"), 'checked' => 1), - 'type.code' => array('label' => $langs->trans("Type"), 'checked' => 1), - 'category.code' => array('label' => $langs->trans("Category"), 'checked' => 1), - 'severity.code' => array('label' => $langs->trans("Severity"), 'checked' => 1), - 't.progress' => array('label' => $langs->trans("Progression"), 'checked' => 0), - //'t.fk_contract' => array('label' => $langs->trans("Contract"), 'checked' => 0), - 't.fk_user_create' => array('label' => $langs->trans("Author"), 'checked' => 1), - 't.fk_user_assign' => array('label' => $langs->trans("AssignedTo"), 'checked' => 0), - - //'t.entity'=>array('label'=>$langs->trans("Entity"), 'checked'=>1, 'enabled'=>(! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode))), - //'t.datec' => array('label' => $langs->trans("DateCreation"), 'checked' => 0, 'position' => 500), - //'t.tms' => array('label' => $langs->trans("DateModificationShort"), 'checked' => 0, 'position' => 2) - //'t.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), - ); - - // Extra fields - if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { - foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - if ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate') { - $arrayfields["ef.".$key] = array('label' => $extrafields->attributes[$object->table_element]['label'][$key], 'checked' => ($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1, 'position' => $extrafields->attributes[$object->table_element]['pos'][$key], 'enabled' =>(abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3) && $extrafields->attributes[$object->table_element]['perms'][$key]); - } - } - } - if (!empty($search_subject)) { - $filter['t.subject'] = $search_subject; - $param .= '&search_subject='.urlencode($search_subject); - } - if (!empty($search_type)) { - $filter['t.type_code'] = $search_type; - $param .= '&search_type='.urlencode($search_type); - } - if (!empty($search_category)) { - $filter['t.category_code'] = $search_category; - $param .= '&search_category='.urlencode($search_category); - } - if (!empty($search_severity)) { - $filter['t.severity_code'] = $search_severity; - $param .= '&search_severity='.urlencode($search_severity); - } - if (!empty($search_fk_user_assign)) { - // -1 value = all so no filter - if ($search_fk_user_assign > 0) { - $filter['t.fk_user_assign'] = $search_fk_user_assign; - $param .= '&search_fk_user_assign='.urlencode($search_fk_user_assign); - } - } - if (!empty($search_fk_user_create)) { - // -1 value = all so no filter - if ($search_fk_user_create > 0) { - $filter['t.fk_user_create'] = $search_fk_user_create; - $param .= '&search_fk_user_create='.urlencode($search_fk_user_create); - } - } - if ((isset($search_fk_status) && $search_fk_status != '') && $search_fk_status != '-1' && $search_fk_status != 'non_closed') { - $filter['t.fk_statut'] = $search_fk_status; - $param .= '&search_fk_status='.urlencode($search_fk_status); - } - if (isset($search_fk_status) && $search_fk_status == 'non_closed') { - $filter['t.fk_statut'] = array(0, 1, 3, 4, 5, 6); - $param .= '&search_fk_status=non_closed'; - } - - require DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; - - $sortfield = GETPOST("sortfield", 'alpha'); - $sortorder = GETPOST("sortorder", 'alpha'); - - if (!$sortfield) { - $sortfield = 't.datec'; - } - if (!$sortorder) { - $sortorder = 'DESC'; - } - - $limit = $conf->liste_limit; - - $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); - if (empty($page) || $page == -1) { - $page = 0; - } // If $page is not defined, or '' or -1 - $offset = $limit * $page; - $pageprev = $page - 1; - $pagenext = $page + 1; - - // Request SQL - $sql = "SELECT DISTINCT"; - $sql .= " t.rowid,"; - $sql .= " t.ref,"; - $sql .= " t.track_id,"; - $sql .= " t.fk_soc,"; - $sql .= " t.fk_project,"; - $sql .= " t.origin_email,"; - $sql .= " t.fk_user_create, uc.lastname as user_create_lastname, uc.firstname as user_create_firstname,"; - $sql .= " t.fk_user_assign, ua.lastname as user_assign_lastname, ua.firstname as user_assign_firstname,"; - $sql .= " t.subject,"; - $sql .= " t.message,"; - $sql .= " t.fk_statut,"; - $sql .= " t.resolution,"; - $sql .= " t.progress,"; - $sql .= " t.timing,"; - $sql .= " t.type_code,"; - $sql .= " t.category_code,"; - $sql .= " t.severity_code,"; - $sql .= " t.datec,"; - $sql .= " t.date_read,"; - $sql .= " t.date_close,"; - $sql .= " t.tms,"; - $sql .= " type.label as type_label, category.label as category_label, severity.label as severity_label"; - // Add fields for extrafields - if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { - foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : ''); - } - } - $sql .= " FROM ".MAIN_DB_PREFIX."recruitment_recruitmentjobposition as t"; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid=t.fk_soc"; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as uc ON uc.rowid=t.fk_user_create"; - if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."recruitment_recruitmentjobposition_extrafields as ef on (t.rowid = ef.fk_object)"; - } - $sql .= " WHERE t.entity IN (".getEntity('recruitmentjobposition').")"; - // Manage filter - if (!empty($filter)) { - foreach ($filter as $key => $value) { - if (strpos($key, 'date')) { // To allow $filter['YEAR(s.dated)']=>$year - $sql .= " AND ".$key." = '".$db->escape($value)."'"; - } elseif ($key == 't.fk_statut') { - if (is_array($value) && count($value) > 0) { - $sql .= " AND ".$key.' IN ('.$db->sanitize(implode(',', $value)).')'; - } else { - $sql .= " AND ".$key." = ".((int) $value); - } - } else { - $sql .= " AND ".$key." LIKE '%".$db->escape($value)."%'"; - } - } - } - $sql .= $db->order($sortfield, $sortorder); - - $resql = $db->query($sql); - if ($resql) { - $num_total = $db->num_rows($resql); - if (!empty($limit)) { - $sql .= $db->plimit($limit + 1, $offset); - } - - $resql = $db->query($sql); - if ($resql) { - $num = $db->num_rows($resql); - print_barre_liste($langs->trans('JobList'), $page, 'public/recruitment/list.php', $param, $sortfield, $sortorder, '', $num, $num_total, 'ticket'); - - // Search bar - print ''."\n"; - print ''; - print ''; - print ''; - print ''; - - $varpage = empty($contextpage) ? $url_page_current : $contextpage; - $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields - - print '
    '.$langs->trans("EvntOrgRegistrationBoothWelcomeMessage").'
    '.$langs->trans("EvntOrgRegistrationBoothHelpMessage").' '.$project->label.'.

    '.$project->note_public.'
    '.$langs->trans("EvntOrgRegistrationConfWelcomeMessage").'
    '.$langs->trans("EvntOrgRegistrationConfHelpMessage").' '.$project->label.'.

    '.$project->note_public.'
    '; - - // Filter bar - print ''; - - if (!empty($arrayfields['t.datec']['checked'])) { - print ''; - } - - if (!empty($arrayfields['t.ref']['checked'])) { - print ''; - } - - if (!empty($arrayfields['t.fk_user_create']['checked'])) { - print ''; - } - - if (!empty($arrayfields['t.tms']['checked'])) { - print ''; - } - - // Extra fields - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; - - // Fields from hook - $parameters = array('arrayfields'=>$arrayfields); - $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - - // Status - if (!empty($arrayfields['t.fk_statut']['checked'])) { - print ''; - } - - // Action column - print ''; - print ''; - - // Field title - print ''; - if (!empty($arrayfields['t.datec']['checked'])) { - print_liste_field_titre($arrayfields['t.datec']['label'], $url_page_current, 't.datec', '', $param, '', $sortfield, $sortorder); - } - if (!empty($arrayfields['t.ref']['checked'])) { - print_liste_field_titre($arrayfields['t.ref']['label'], $url_page_current, 't.ref', '', $param, '', $sortfield, $sortorder); - } - if (!empty($arrayfields['t.fk_user_create']['checked'])) { - print_liste_field_titre($arrayfields['t.fk_user_create']['label'], $url_page_current, 't.fk_user_create', '', $param, '', $sortfield, $sortorder); - } - if (!empty($arrayfields['t.tms']['checked'])) { - print_liste_field_titre($arrayfields['t.tms']['label'], $url_page_current, 't.tms', '', $param, '', $sortfield, $sortorder); - } - - // Extra fields - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; - - // Hook fields - $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); - $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - - if (!empty($arrayfields['t.fk_statut']['checked'])) { - print_liste_field_titre($arrayfields['t.fk_statut']['label'], $url_page_current, 't.fk_statut', '', $param, '', $sortfield, $sortorder); - } - print_liste_field_titre($selectedfields, $url_page_current, "", '', '', 'align="right"', $sortfield, $sortorder, 'center maxwidthsearch '); - print ''; - - while ($obj = $db->fetch_object($resql)) { - print ''; - - // Date ticket - if (!empty($arrayfields['t.datec']['checked'])) { - print ''; - } - - // Ref - if (!empty($arrayfields['t.ref']['checked'])) { - print ''; - } - - // Message author - if (!empty($arrayfields['t.fk_user_create']['checked'])) { - print ''; - } - - if (!empty($arrayfields['t.tms']['checked'])) { - print ''; - } - - // Extra fields - if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { - foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - if (!empty($arrayfields["ef.".$key]['checked'])) { - print 'getAlignFlag($key); - if ($align) { - print ' align="'.$align.'"'; - } - print '>'; - $tmpkey = 'options_'.$key; - print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1); - print ''; - } - } - } - - // Statut - if (!empty($arrayfields['t.fk_statut']['checked'])) { - print ''; - } - - print ''; - - $i++; - print ''; - } - - print '
    '; - $selected = ($search_fk_status != "non_closed" ? $search_fk_status : ''); - //$object->printSelectStatus($selected); - print ''; - $searchpicto = $form->showFilterButtons(); - print $searchpicto; - print '
    '; - print dol_print_date($db->jdate($obj->datec), 'dayhour'); - print ''; - print $obj->ref; - print ''; - if ($obj->fk_user_create > 0) { - $user_create->firstname = (!empty($obj->user_create_firstname) ? $obj->user_create_firstname : ''); - $user_create->name = (!empty($obj->user_create_lastname) ? $obj->user_create_lastname : ''); - $user_create->id = (!empty($obj->fk_user_create) ? $obj->fk_user_create : ''); - print $user_create->getFullName($langs); - } else { - print $langs->trans('Email'); - } - print ''.dol_print_date($db->jdate($obj->tms), 'dayhour').''; - $object->fk_statut = $obj->fk_statut; - print $object->getLibStatut(2); - print '
    '; - print ''; - - print '"; - print ''; - } - } -} else { - print ''; +if (!empty($conf->global->RECRUITMENT_IMAGE_PUBLIC_INTERFACE)) { + print '
    '; + print ''; + print '
    '; } -print "
    "; +// TODO List of jobs +print '
    '; +print $langs->trans("FeatureNotYetAvailable"); -// End of page -htmlPrintOnlinePaymentFooter($mysoc, $langs, 0, $suffix, $object); + +print ''."\n"; +print '
    '."\n"; +print '
    '; + + +htmlPrintOnlinePaymentFooter($mysoc, $langs); llxFooter('', 'public'); diff --git a/htdocs/public/recruitment/view.php b/htdocs/public/recruitment/view.php index cd275d250c4..d105632abe8 100644 --- a/htdocs/public/recruitment/view.php +++ b/htdocs/public/recruitment/view.php @@ -192,8 +192,6 @@ print ''; print "\n"; print ''."\n"; -print ''."\n"; - // Show logo (search order: logo defined by ONLINE_SIGN_LOGO_suffix, then ONLINE_SIGN_LOGO_, then small company logo, large company logo, theme logo, common logo) // Define logo and logosmall $logosmall = $mysoc->logo_small; @@ -234,6 +232,9 @@ if (!empty($conf->global->RECRUITMENT_IMAGE_PUBLIC_INTERFACE)) { print ''; } + +print '
    '."\n"; + // Output introduction text $text = ''; if (!empty($conf->global->RECRUITMENT_NEWFORM_TEXT)) { From 2262646391d6cd495e59bafe05da08f2a1e3d7b9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Oct 2021 16:04:49 +0200 Subject: [PATCH 0947/1460] Standardize name of page --- htdocs/eventorganization/class/conferenceorbooth.class.php | 2 +- htdocs/eventorganization/conferenceorbooth_list.php | 2 +- htdocs/eventorganization/conferenceorboothattendee_card.php | 2 +- htdocs/eventorganization/conferenceorboothattendee_list.php | 2 +- htdocs/langs/en_US/projects.lang | 1 + .../{attendee_register.php => attendee_new.php} | 2 +- htdocs/public/project/new.php | 6 +++--- 7 files changed, 9 insertions(+), 8 deletions(-) rename htdocs/public/eventorganization/{attendee_register.php => attendee_new.php} (99%) diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index a45a457a34d..b2e01ef9d24 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -247,7 +247,7 @@ class ConferenceOrBooth extends ActionComm $result = parent::fetch($id, $ref, $ref_ext, $email_msgid); - $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_register.php?id='.urlencode($id).'&type=conf'; + $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_new.php?id='.urlencode($id).'&type=conf'; $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); $link_subscription .= '&securekey='.urlencode($encodedsecurekey); diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index 5e382590fca..a0ee450c3ef 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -450,7 +450,7 @@ if ($projectid > 0) { print $langs->trans("PublicAttendeeSubscriptionGlobalPage"); //print ''; print ''."\n"; + print ''."\n"; // Value print ''; } print ''; From a81d6ef405357623daf9fac5a657c804cc679df4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Oct 2021 19:13:36 +0200 Subject: [PATCH 0949/1460] Debug v15 --- htdocs/adherents/card.php | 1 - htdocs/adherents/cartes/carte.php | 27 ++++++++++++++----- .../doc/doc_generic_member_odt.class.php | 3 ++- .../modules/member/doc/pdf_standard.class.php | 10 ++++--- htdocs/core/modules/member/modules_cards.php | 7 ++--- 5 files changed, 33 insertions(+), 15 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 10187492037..01efbc180d3 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -2012,7 +2012,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Generated documents $filename = dol_sanitizeFileName($object->ref); - //$filename = 'tmp_cards.php'; $filedir = $conf->adherent->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, 'member'); $urlsource = $_SERVER['PHP_SELF'].'?id='.$object->id; $genallowed = $user->rights->adherent->lire; diff --git a/htdocs/adherents/cartes/carte.php b/htdocs/adherents/cartes/carte.php index 4c26e34dd8d..271cb09fa81 100644 --- a/htdocs/adherents/cartes/carte.php +++ b/htdocs/adherents/cartes/carte.php @@ -39,6 +39,7 @@ $day = dol_print_date($now, '%d'); $foruserid = GETPOST('foruserid', 'alphanohtml'); $foruserlogin = GETPOST('foruserlogin', 'alphanohtml'); $mode = GETPOST('mode', 'aZ09'); +$modelcard = GETPOST("modelcard", 'aZ09'); // Doc template to use for business cards $model = GETPOST("model", 'aZ09'); // Doc template to use for business cards $modellabel = GETPOST("modellabel", 'aZ09'); // Doc template to use for address sheet $mesg = ''; @@ -84,10 +85,10 @@ if ((!empty($foruserid) || !empty($foruserlogin) || !empty($mode)) && !$mesg) { $sql .= " WHERE d.fk_adherent_type = t.rowid AND d.statut = 1"; $sql .= " AND d.entity IN (".getEntity('adherent').")"; if (is_numeric($foruserid)) { - $sql .= " AND d.rowid=".(int) $foruserid; + $sql .= " AND d.rowid = ".(int) $foruserid; } if ($foruserlogin) { - $sql .= " AND d.login='".$db->escape($foruserlogin)."'"; + $sql .= " AND d.login = '".$db->escape($foruserlogin)."'"; } $sql .= " ORDER BY d.rowid ASC"; @@ -143,7 +144,7 @@ if ((!empty($foruserid) || !empty($foruserlogin) || !empty($mode)) && !$mesg) { '__MONTH__'=>$month, '__DAY__'=>$day, '__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT, - '__SERVER__'=>"http://".$_SERVER["SERVER_NAME"]."/" + '__SERVER__'=>"https://".$_SERVER["SERVER_NAME"]."/" ); complete_substitutions_array($substitutionarray, $langs, $adherentstatic); @@ -155,7 +156,7 @@ if ((!empty($foruserid) || !empty($foruserlogin) || !empty($mode)) && !$mesg) { $textright = make_substitutions($conf->global->ADHERENT_CARD_TEXT_RIGHT, $substitutionarray); if (is_numeric($foruserid) || $foruserlogin) { - $nb = $_Avery_Labels[$model]['NX'] * $_Avery_Labels[$model]['NY']; + $nb = $_Avery_Labels[$model]['NX'] * $_Avery_Labels[$model]['NY']; // $_Avery_Labels is defined into an include if ($nb <= 0) { $nb = 1; // Protection to avoid empty page } @@ -209,7 +210,19 @@ if ((!empty($foruserid) || !empty($foruserlogin) || !empty($mode)) && !$mesg) { } // Build and output PDF - if (empty($mode) || $mode == 'card' || $mode == 'cardlogin') { + $outputlangs = $langs; + + if (empty($mode) || $mode == 'card') { + if (!count($arrayofmembers)) { + $mesg = $langs->trans("ErrorRecordNotFound"); + } + if (empty($modelcard) || $modelcard == '-1') { + $mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DescADHERENT_CARD_TYPE")); + } + if (!$mesg) { + $result = members_card_pdf_create($db, $arrayofmembers, $modelcard, $outputlangs, '', 'standard', 'tmp_cards'); + } + } elseif ($mode == 'cardlogin') { if (!count($arrayofmembers)) { $mesg = $langs->trans("ErrorRecordNotFound"); } @@ -217,7 +230,7 @@ if ((!empty($foruserid) || !empty($foruserlogin) || !empty($mode)) && !$mesg) { $mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DescADHERENT_CARD_TYPE")); } if (!$mesg) { - $result = members_card_pdf_create($db, $arrayofmembers, $model, $outputlangs); + $result = members_card_pdf_create($db, $arrayofmembers, $model, $outputlangs, '', 'standard', 'tmp_cards_login'); } } elseif ($mode == 'label') { if (!count($arrayofmembers)) { @@ -275,7 +288,7 @@ foreach (array_keys($_Avery_Labels) as $codecards) { $arrayoflabels[$codecards] = $_Avery_Labels[$codecards]['name']; } asort($arrayoflabels); -print $form->selectarray('model', $arrayoflabels, (GETPOST('model') ? GETPOST('model') : (empty($conf->global->ADHERENT_CARD_TYPE) ? '' : $conf->global->ADHERENT_CARD_TYPE)), 1, 0, 0, '', 0, 0, 0, '', '', 1); +print $form->selectarray('modelcard', $arrayoflabels, (GETPOST('modelcard') ? GETPOST('modelcard') : (empty($conf->global->ADHERENT_CARD_TYPE) ? '' : $conf->global->ADHERENT_CARD_TYPE)), 1, 0, 0, '', 0, 0, 0, '', '', 1); print '
    '; print ''; diff --git a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php index 6ba84727b3f..593986d4b7d 100644 --- a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php +++ b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php @@ -195,9 +195,10 @@ class doc_generic_member_odt extends ModelePDFMember * @param string $srctemplatepath Full path of source filename for generator using a template file * @param string $mode Tell if doc module is called for 'member', ... * @param int $nooutput 1=Generate only file on disk and do not return it on response + * @param string $filename Name of output file (without extension) * @return int 1 if OK, <=0 if KO */ - public function write_file($object, $outputlangs, $srctemplatepath, $mode = 'member', $nooutput = 0) + public function write_file($object, $outputlangs, $srctemplatepath, $mode = 'member', $nooutput = 0, $filename = 'tmp_cards') { // phpcs:enable global $user, $langs, $conf, $mysoc, $hookmanager; diff --git a/htdocs/core/modules/member/doc/pdf_standard.class.php b/htdocs/core/modules/member/doc/pdf_standard.class.php index 1d1a892cc56..15f3260c4d2 100644 --- a/htdocs/core/modules/member/doc/pdf_standard.class.php +++ b/htdocs/core/modules/member/doc/pdf_standard.class.php @@ -243,9 +243,10 @@ class pdf_standard extends CommonStickerGenerator * @param string $srctemplatepath Full path of source filename for generator using a template file. Example: '5161', 'AVERYC32010', 'CARD', ... * @param string $mode Tell if doc module is called for 'member', ... * @param int $nooutput 1=Generate only file on disk and do not return it on response + * @param string $filename Name of output file (without extension) * @return int 1=OK, 0=KO */ - public function write_file($object, $outputlangs, $srctemplatepath, $mode = 'member', $nooutput = 0) + public function write_file($object, $outputlangs, $srctemplatepath, $mode = 'member', $nooutput = 0, $filename = 'tmp_cards') { // phpcs:enable global $user, $conf, $langs, $mysoc, $_Avery_Labels; @@ -282,7 +283,7 @@ class pdf_standard extends CommonStickerGenerator '__MONTH__'=>$month, '__DAY__'=>$day, '__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT, - '__SERVER__'=>"http://".$_SERVER["SERVER_NAME"]."/" + '__SERVER__'=>"https://".$_SERVER["SERVER_NAME"]."/" ); complete_substitutions_array($substitutionarray, $langs); @@ -320,7 +321,10 @@ class pdf_standard extends CommonStickerGenerator dol_print_error('', 'ErrorBadTypeForCard'.$this->code); exit; } + $this->type = 'pdf'; + $filename .= '.pdf'; + // standard format or custom if ($this->Tformat['paper-size'] != 'custom') { $this->format = $this->Tformat['paper-size']; @@ -349,7 +353,7 @@ class pdf_standard extends CommonStickerGenerator return -1; } - $filename = 'tmp_cards.pdf'; + if (is_object($object)) { $outputdir = $conf->adherent->dir_output; $dir = $outputdir."/".get_exdir(0, 0, 0, 0, $object, 'member'); diff --git a/htdocs/core/modules/member/modules_cards.php b/htdocs/core/modules/member/modules_cards.php index 937e8a06870..b37b9144d3e 100644 --- a/htdocs/core/modules/member/modules_cards.php +++ b/htdocs/core/modules/member/modules_cards.php @@ -74,9 +74,10 @@ class ModelePDFCards * @param Translate $outputlangs Object langs to use for translation * @param string $outputdir Output directory * @param string $template pdf generenate document class to use default 'standard' + * @param string $filename Name of output file (without extension) * @return int <0 if KO, >0 if OK */ -function members_card_pdf_create($db, $arrayofmembers, $modele, $outputlangs, $outputdir = '', $template = 'standard') +function members_card_pdf_create($db, $arrayofmembers, $modele, $outputlangs, $outputdir = '', $template = 'standard', $filename = 'tmp_cards') { // phpcs:enable global $conf, $langs; @@ -125,7 +126,7 @@ function members_card_pdf_create($db, $arrayofmembers, $modele, $outputlangs, $o foreach (array('doc', 'pdf') as $prefix) { $file = $prefix."_".$template.".class.php"; - // On verifie l'emplacement du modele + // We check that file of doc generaotr exists $file = dol_buildpath($reldir."core/modules/member/doc/".$file, 0); if (file_exists($file)) { $filefound = 1; @@ -148,7 +149,7 @@ function members_card_pdf_create($db, $arrayofmembers, $modele, $outputlangs, $o // We save charset_output to restore it because write_file can change it if needed for // output format that does not support UTF8. $sav_charset_output = $outputlangs->charset_output; - if ($obj->write_file($arrayofmembers, $outputlangs, $srctemplatepath) > 0) { + if ($obj->write_file($arrayofmembers, $outputlangs, $srctemplatepath, 'member', 0, $filename) > 0) { $outputlangs->charset_output = $sav_charset_output; return 1; } else { From 252c910962678459cdc6b9cc3f96f02077323554 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Oct 2021 20:46:28 +0200 Subject: [PATCH 0950/1460] Debug feature for proposal signature --- htdocs/core/lib/payments.lib.php | 3 +- htdocs/core/lib/signature.lib.php | 1 + htdocs/langs/en_US/main.lang | 3 +- htdocs/public/onlinesign/newonlinesign.php | 58 +++++++++++++++------- htdocs/public/payment/newpayment.php | 20 ++++++-- htdocs/theme/eldy/global.inc.php | 8 ++- htdocs/theme/md/style.css.php | 3 ++ 7 files changed, 70 insertions(+), 26 deletions(-) diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php index 390961f5db2..2b56d76a6ec 100644 --- a/htdocs/core/lib/payments.lib.php +++ b/htdocs/core/lib/payments.lib.php @@ -174,7 +174,8 @@ function showOnlinePaymentUrl($type, $ref) $out = img_picto('', 'globe').' '.$langs->trans("ToOfferALinkForOnlinePayment", $servicename).'
    '; $url = getOnlinePaymentUrl(0, $type, $ref); $out .= ''; + $out .= ''.img_picto('', 'globe', 'class="paddingleft"').''; + $out .= ''; $out .= ajax_autoselect("onlinepaymenturl", 0); return $out; } diff --git a/htdocs/core/lib/signature.lib.php b/htdocs/core/lib/signature.lib.php index bcb430dac41..f14d6a66c40 100644 --- a/htdocs/core/lib/signature.lib.php +++ b/htdocs/core/lib/signature.lib.php @@ -41,6 +41,7 @@ function showOnlineSignatureUrl($type, $ref) } else { $out .= ''; } + $out .= ''.img_picto('', 'globe', 'class="paddingleft"').''; $out .= ''; $out .= ajax_autoselect("onlinesignatureurl", 0); return $out; diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 6004482cb29..492a20bae77 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1157,4 +1157,5 @@ RecordsApproved=%s Record(s) approved Properties=Properties hasBeenValidated=%s has been validated ClientTZ=Client Time Zone (user) -NotClosedYet=Not yet closed \ No newline at end of file +NotClosedYet=Not yet closed +ClearSignature=Signature reset \ No newline at end of file diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index 4040bcf1425..fe6abdb7979 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -240,7 +240,7 @@ if (!empty($conf->global->ONLINE_SIGN_NEWFORM_TEXT)) { } if (empty($text)) { $text .= '
    '."\n"; - $text .= ''."\n"; + $text .= ''."\n"; } print $text; @@ -251,9 +251,8 @@ print ''."\n"; // Debitor - print ''."\n"; // Object $text = ''.$langs->trans("SignatureProposalRef", $proposal->ref).''; - print ''."\n"; + + // TODO Add link to download PDF (similar code than for invoice) } @@ -316,9 +335,10 @@ if ($action != 'dosign') { print ''."\n"; print ''."\n"; diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 059042399a2..a5e24312ded 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -953,7 +953,9 @@ if (!$source) { // Creditor print ''."\n"; @@ -1025,13 +1027,17 @@ if ($source == 'order') { // Creditor print ''."\n"; // Debitor print ''."\n"; // Object @@ -1149,13 +1155,17 @@ if ($source == 'invoice') { // Creditor print ''."\n"; // Debitor print ''."\n"; // Object diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index b54087c55a6..e1117b6d659 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -701,6 +701,9 @@ textarea.centpercent { .nowraponsmartphone { white-space: ; } +.wraponsmartphone { + white-space: ; +} .liste_titre .nowrap { white-space: nowrap; } @@ -1726,7 +1729,7 @@ td.showDragHandle { } #id-right { /* This must stay id-right and not be replaced with echo $right */ - padding-top: 10px; + padding-top: 14px; width: 100%; background: var(--colorbackbody); padding-bottom: 20px; @@ -6998,6 +7001,9 @@ div.clipboardCPValue.hidewithsize { z-index: 201; background: var(--colorbackvmenu1); } + #id-right { /* This must stay id-right and not be replaced with echo $right */ + padding-top: 8px; + } .login_vertical_align { padding-left: 20px; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index dbbdb1d2679..1a49a61573d 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -850,6 +850,9 @@ textarea.centpercent { .nowraponsmartphone { white-space: ; } +.wraponsmartphone { + white-space: ; +} .liste_titre .nowrap { white-space: nowrap; } From c40a73162ee7113cf02c056cacb927bd4769ee68 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Oct 2021 21:20:58 +0200 Subject: [PATCH 0951/1460] Look and feel v15 --- htdocs/adherents/tpl/linkedobjectblock.tpl.php | 4 ++-- htdocs/bom/tpl/linkedobjectblock.tpl.php | 2 +- htdocs/comm/propal/tpl/linkedobjectblock.tpl.php | 2 +- htdocs/commande/tpl/linkedobjectblock.tpl.php | 2 +- htdocs/compta/facture/tpl/linkedobjectblock.tpl.php | 2 +- htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php | 2 +- htdocs/contrat/tpl/linkedobjectblock.tpl.php | 2 +- htdocs/core/lib/payments.lib.php | 4 ++-- htdocs/core/lib/signature.lib.php | 4 ++-- htdocs/don/tpl/linkedobjectblock.tpl.php | 2 +- htdocs/eventorganization/tpl/linkedobjectblock.tpl.php | 2 +- htdocs/expedition/tpl/linkedobjectblock.tpl.php | 2 +- htdocs/expensereport/tpl/linkedobjectblock.tpl.php | 2 +- htdocs/fichinter/tpl/linkedobjectblock.tpl.php | 2 +- htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php | 2 +- htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php | 2 +- .../template/core/tpl/linkedobjectblock_myobject.tpl.php | 2 +- htdocs/mrp/tpl/linkedobjectblock.tpl.php | 2 +- htdocs/product/canvas/product/tpl/card_create.tpl.php | 2 +- htdocs/product/canvas/product/tpl/card_edit.tpl.php | 2 +- htdocs/product/canvas/product/tpl/card_view.tpl.php | 2 +- htdocs/public/onlinesign/newonlinesign.php | 8 ++++---- htdocs/reception/tpl/linkedobjectblock.tpl.php | 2 +- htdocs/theme/eldy/btn.inc.php | 2 +- htdocs/theme/md/btn.inc.php | 4 ++-- htdocs/ticket/tpl/linkedobjectblock.tpl.php | 2 +- 26 files changed, 33 insertions(+), 33 deletions(-) diff --git a/htdocs/adherents/tpl/linkedobjectblock.tpl.php b/htdocs/adherents/tpl/linkedobjectblock.tpl.php index 7aa2f39a3ff..3acb14a4cdb 100644 --- a/htdocs/adherents/tpl/linkedobjectblock.tpl.php +++ b/htdocs/adherents/tpl/linkedobjectblock.tpl.php @@ -23,7 +23,7 @@ if (empty($conf) || !is_object($conf)) { exit; } -echo "\n"; +echo "\n"; global $user; @@ -35,7 +35,7 @@ $total = 0; foreach ($linkedObjectBlock as $key => $objectlink) { echo ''; echo ''; - echo ''; + echo ''; echo ''; echo ''; echo ''."\n"; + print ''."\n"; } print '
    '; - $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_register.php?id='.((int) $project->id).'&type=global'; + $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_new.php?id='.((int) $project->id).'&type=global'; $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.((int) $project->id), 'md5'); $link_subscription .= '&securekey='.urlencode($encodedsecurekey); //print ''; - $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_register.php?id='.$projectstatic->id.'&type=global'; + $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_new.php?id='.$projectstatic->id.'&type=global'; $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$projectstatic->id, 'md5'); $link_subscription .= '&securekey='.urlencode($encodedsecurekey); //print ''; - $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_register.php?id='.$projectstatic->id.'&type=global'; + $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_new.php?id='.$projectstatic->id.'&type=global'; $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$projectstatic->id, 'md5'); $link_subscription .= '&securekey='.urlencode($encodedsecurekey); //print '
    '.$obj->name.'
    '.$obj->name.''; diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 1c38ec8e6d7..9c5418ac19d 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -292,7 +292,7 @@ if ($action == 'edit') { print dol_get_fiche_head($head, 'common', '', -1); print ''.$langs->trans("EMailsDesc")."
    \n"; - print "
    \n"; + print "

    \n"; clearstatcache(); @@ -543,7 +543,7 @@ if ($action == 'edit') { print dol_get_fiche_head($head, 'common', '', -1); print ''.$langs->trans("EMailsDesc")."
    \n"; - print "
    \n"; + print "

    \n"; print '
    '; // You can use div-table-responsive-no-min if you dont need reserved height for your table print ''; diff --git a/htdocs/admin/mails_emailing.php b/htdocs/admin/mails_emailing.php index 360ea07defd..015b943ac04 100644 --- a/htdocs/admin/mails_emailing.php +++ b/htdocs/admin/mails_emailing.php @@ -243,7 +243,7 @@ if ($action == 'edit') { print dol_get_fiche_head($head, 'common_emailing', '', -1); print ''.$langs->trans("EMailsDesc")."
    \n"; - print "
    \n"; + print "

    \n"; clearstatcache(); @@ -412,7 +412,7 @@ if ($action == 'edit') { print dol_get_fiche_head($head, 'common_emailing', '', -1); print ''.$langs->trans("EMailsDesc")."
    \n"; - print "
    \n"; + print "

    \n"; print '
    '; print ''; diff --git a/htdocs/admin/mails_ticket.php b/htdocs/admin/mails_ticket.php index ce4bc76c20d..a94bb9c4276 100644 --- a/htdocs/admin/mails_ticket.php +++ b/htdocs/admin/mails_ticket.php @@ -232,7 +232,7 @@ if ($action == 'edit') { print dol_get_fiche_head($head, 'common_ticket', '', -1); print ''.$langs->trans("EMailsDesc")."
    \n"; - print "
    \n"; + print "

    \n"; clearstatcache(); @@ -387,7 +387,7 @@ if ($action == 'edit') { print dol_get_fiche_head($head, 'common_ticket', '', -1); print ''.$langs->trans("EMailsDesc")."
    \n"; - print "
    \n"; + print "

    \n"; print '
    '.$langs->trans("Parameter").''.$langs->trans("Value").'
    '; print ''; diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index 4dd5ceab503..f07623ed5d0 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -458,7 +458,7 @@ if ($mode == 'searchkey') { } //print 'param='.$param.' $_SERVER["PHP_SELF"]='.$_SERVER["PHP_SELF"].' num='.$num.' page='.$page.' nbtotalofrecords='.$nbtotalofrecords." sortfield=".$sortfield." sortorder=".$sortorder; - $title = $langs->trans("TranslationKeySearch"); + $title = $langs->trans("Translation"); if ($nbtotalofrecords > 0) { $title .= ' ('.$nbtotalofrecords.' / '.$nbtotalofrecordswithoutfilters.' - '.$nbtotaloffiles.' '.$langs->trans("Files").')'; } diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index d725a659e08..74d2284c4b5 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -154,9 +154,9 @@ if ($action == 'create') { print ''; print ''; - print load_fiche_titre($langs->trans("NewBookmark")); + print load_fiche_titre($langs->trans("NewBookmark"), '', 'bookmark'); - print dol_get_fiche_head($head, $hselected, $langs->trans("Bookmark"), -1, 'bookmark'); + print dol_get_fiche_head(null, 'bookmark', '', 0, ''); print '
    '.$langs->trans("Parameter").''.$langs->trans("Value").'
    '; @@ -164,23 +164,23 @@ if ($action == 'create') { dol_set_focus('#titlebookmark'); // Url - print ''; + print ''; // Target print ''; // Owner print ''; + print img_picto('', 'user').' '.$form->select_dolusers(GETPOSTISSET('userid') ? GETPOST('userid', 'int') : $user->id, 'userid', 0, '', 0, ($user->admin ? '' : array($user->id)), '', 0, 0, 0, '', ($user->admin) ? 1 : 0, '', 'maxwidth300 widthcentpercentminusx'); + print ''; // Position print ''; + print 'position).'">'; + print ''; print '
    '.$langs->trans("UrlOrLink").''.$langs->trans("UseAnExternalHttpLinkOrRelativeDolibarrLink").'
    '.$langs->trans("UrlOrLink").''.$langs->trans("UseAnExternalHttpLinkOrRelativeDolibarrLink").'
    '.$langs->trans("BehaviourOnClick").''; $liste = array(0=>$langs->trans("ReplaceWindow"), 1=>$langs->trans("OpenANewWindow")); - print $form->selectarray('target', $liste, GETPOSTISSET('target') ? GETPOST('target', 'int') : 1); + print $form->selectarray('target', $liste, GETPOSTISSET('target') ? GETPOST('target', 'int') : 1, 0, 0, 0, '', 0, 0, 0, '', 'maxwidth300'); print ''.$langs->trans("ChooseIfANewWindowMustBeOpenedOnClickOnBookmark").'
    '.$langs->trans("Visibility").''; - print img_picto('', 'user').' '.$form->select_dolusers(GETPOSTISSET('userid') ? GETPOST('userid', 'int') : $user->id, 'userid', 0, '', 0, ($user->admin ? '' : array($user->id)), '', 0, 0, 0, '', ($user->admin) ? 1 : 0, '', 'maxwidth300'); - print ' 
    '.$langs->trans("Position").''; - print 'position).'">'; - print ' 
    '; diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index c97d80dda4d..0505f451fc5 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -834,7 +834,7 @@ function translation_prepare_head() $h++; $head[$h][0] = DOL_URL_ROOT."/admin/translation.php?mode=overwrite"; - $head[$h][1] = $langs->trans("TranslationOverwriteKey").''; + $head[$h][1] = ''.$langs->trans("TranslationOverwriteKey").''; $head[$h][2] = 'overwrite'; $h++; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 0cf17545b5f..6d5d232c144 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2128,6 +2128,7 @@ EMailsWillHaveMessageID=Emails will have a tag 'References' matching this syntax PDF_SHOW_PROJECT=Show project on document ShowProjectLabel=Project Label PDF_USE_ALSO_LANGUAGE_CODE=If you want to have some texts in your PDF duplicated in 2 different languages in the same generated PDF, you must set here this second language so generated PDF will contains 2 different languages in same page, the one chosen when generating PDF and this one (only few PDF templates support this). Keep empty for 1 language per PDF. +PDF_USE_A=Gererate PDF documents with format PDF/A instead of defaut format PDF FafaIconSocialNetworksDesc=Enter here the code of a FontAwesome icon. If you don't know what is FontAwesome, you can use the generic value fa-address-book. RssNote=Note: Each RSS feed definition provides a widget that you must enable to have it available in dashboard JumpToBoxes=Jump to Setup -> Widgets diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 10bcd6d9411..77318146e25 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1406,7 +1406,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
    '.$form->editfieldkey('Town', 'town', '', $object, 0).''; - print $formcompany->select_ziptown($object->town, 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 0, '', 'maxwidth100 quatrevingtpercent'); + print $formcompany->select_ziptown($object->town, 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 0, '', 'maxwidth150 quatrevingtpercent'); print $form->widgetForTranslation("town", $object, $permissiontoadd, 'string', 'alphanohtml', 'maxwidth100 quatrevingtpercent'); print '

    '.$langs->trans("WelcomeOnOnlineSignaturePage", $mysoc->name).'
    '.$langs->trans("ThisScreenAllowsYouToSignDocFrom", $creditor).'

    '.$langs->trans("ThisScreenAllowsYouToSignDocFrom", $creditor).'

    '.$langs->trans("T $found = false; $error = 0; -$var = false; -// Payment on customer order +// Signature on commercial proposal if ($source == 'proposal') { $found = true; $langs->load("proposal"); @@ -271,24 +270,44 @@ if ($source == 'proposal') { // Creditor - print '
    '.$langs->trans("Creditor"); - print ''.$creditor.''; + print '
    '.$langs->trans("Creditor"); + print ''; + print img_picto('', 'company', 'class="pictofixedwidth"'); + print ''.$creditor.''; print ''; print '
    '.$langs->trans("ThirdParty"); - print ''.$proposal->thirdparty->name.''; + print '
    '.$langs->trans("ThirdParty"); + print ''; + print img_picto('', 'company', 'class="pictofixedwidth"'); + print ''.$proposal->thirdparty->name.''; + print '
    '.$langs->trans("Designation"); - print ''.$text; + print '
    '.$langs->trans("Designation"); + print ''.$text; + if ($proposal->status == $proposal::STATUS_VALIDATED) { + $directdownloadlink = $proposal->getLastMainDocLink('proposal'); + if ($directdownloadlink) { + print '
    '; + print img_mime($proposal->last_main_doc, ''); + print $langs->trans("DownloadDocument").''; + } + } else { + /* TODO If proposal signed newer than proposal ref, get link of proposal signed + + */ + } + print ''; print ''; print '
    '; + if ($action == "dosign" && empty($cancel)) { print '
    '; - print ''; + print ''; print '
    '; print '
    '; print ''; @@ -334,8 +354,8 @@ if ($action == "dosign" && empty($cancel)) { if(!$._data($("#signpropal")[0], "events")){ $("#signpropal").on("click",function(){ var signature = $("#signature").jSignature("getData", "image"); - $.ajax({ - type: "POST", + $.ajax({ + type: "POST", url: "'.DOL_URL_ROOT.'/core/ajax/onlineSign.php", dataType: "text", data: { @@ -360,21 +380,23 @@ if ($action == "dosign" && empty($cancel)) { $("#clearsignature").on("click",function(){ $("#signature").jSignature("clear"); $("#signpropal").attr("disabled",true); - $("#clearsignature").css("display","none"); + /* $("#clearsignature").css("display","none"); */ }); - $("#clearsignature").css("display","none"); + /* $("#clearsignature").css("display","none"); */ $("#signpropal").attr("disabled",true); }); '; } else { if ($object->status == $object::STATUS_SIGNED) { - print $langs->trans("PropalAlreadySigned"); + print '
    '; + print ''.$langs->trans("PropalAlreadySigned").''; } elseif ($object->status == $object::STATUS_NOTSIGNED) { - print $langs->trans("PropalAlreadyRefused"); + print '
    '; + print ''.$langs->trans("PropalAlreadyRefused").''; } else { - print ''; - print ''; + print ''; + print ''; } } print '
    '.$langs->trans("Creditor"); - print ''.$creditor.''; + print ''; + print img_picto('', 'company', 'class="pictofixedwidth"'); + print ''.$creditor.''; print ''; print '
    '.$langs->trans("Creditor"); - print ''.$creditor.''; + print ''; + print img_picto('', 'company', 'class="pictofixedwidth"'); + print ''.$creditor.''; print ''; print '
    '.$langs->trans("ThirdParty"); - print ''.$order->thirdparty->name.''; + print ''; + print img_picto('', 'company', 'class="pictofixedwidth"'); + print ''.$order->thirdparty->name.''; print '
    '.$langs->trans("Creditor"); - print ''.$creditor.''; + print ''; + print img_picto('', 'company', 'class="pictofixedwidth"'); + print ''.$creditor.''; print ''; print '
    '.$langs->trans("ThirdParty"); - print ''.$invoice->thirdparty->name.''; + print ''; + print img_picto('', 'company', 'class="pictofixedwidth"'); + print ''.$invoice->thirdparty->name.''; print '
    '.$langs->trans("Subscription").''.$objectlink->getNomUrl(1).''.$objectlink->getNomUrl(1).''.dol_print_date($objectlink->dateh, 'day').''; diff --git a/htdocs/bom/tpl/linkedobjectblock.tpl.php b/htdocs/bom/tpl/linkedobjectblock.tpl.php index 946563f7b81..c42da9bdb19 100644 --- a/htdocs/bom/tpl/linkedobjectblock.tpl.php +++ b/htdocs/bom/tpl/linkedobjectblock.tpl.php @@ -24,7 +24,7 @@ if (empty($conf) || !is_object($conf)) { exit; } -print "\n"; +print "\n"; global $user, $db; global $noMoreLinkedObjectBlockAfter; diff --git a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php index 829effed6a2..adc9de9339e 100644 --- a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php +++ b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php @@ -30,7 +30,7 @@ if (empty($conf) || !is_object($conf)) { } -print "\n"; +print "\n"; global $user; diff --git a/htdocs/commande/tpl/linkedobjectblock.tpl.php b/htdocs/commande/tpl/linkedobjectblock.tpl.php index 211702059cb..aba881a63c6 100644 --- a/htdocs/commande/tpl/linkedobjectblock.tpl.php +++ b/htdocs/commande/tpl/linkedobjectblock.tpl.php @@ -23,7 +23,7 @@ if (empty($conf) || !is_object($conf)) { exit; } -print "\n"; +print "\n"; global $user; global $noMoreLinkedObjectBlockAfter; diff --git a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php index bcfece64157..0b22e31be4b 100644 --- a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php +++ b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php @@ -23,7 +23,7 @@ if (empty($conf) || !is_object($conf)) { exit; } -print "\n"; +print "\n"; global $user; global $noMoreLinkedObjectBlockAfter; diff --git a/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php b/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php index 7c9683c8b8c..d222dfd21dc 100644 --- a/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php +++ b/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php @@ -24,7 +24,7 @@ if (empty($conf) || !is_object($conf)) { } -print "\n"; +print "\n"; global $user; diff --git a/htdocs/contrat/tpl/linkedobjectblock.tpl.php b/htdocs/contrat/tpl/linkedobjectblock.tpl.php index 8715a8ce4cc..fad5b67cf27 100644 --- a/htdocs/contrat/tpl/linkedobjectblock.tpl.php +++ b/htdocs/contrat/tpl/linkedobjectblock.tpl.php @@ -23,7 +23,7 @@ if (empty($conf) || !is_object($conf)) { } -print "\n"; +print "\n"; global $user; diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php index 2b56d76a6ec..effa7311661 100644 --- a/htdocs/core/lib/payments.lib.php +++ b/htdocs/core/lib/payments.lib.php @@ -173,8 +173,8 @@ function showOnlinePaymentUrl($type, $ref) $out = img_picto('', 'globe').' '.$langs->trans("ToOfferALinkForOnlinePayment", $servicename).'
    '; $url = getOnlinePaymentUrl(0, $type, $ref); - $out .= ''; $out .= ajax_autoselect("onlinesignatureurl", 0); return $out; diff --git a/htdocs/don/tpl/linkedobjectblock.tpl.php b/htdocs/don/tpl/linkedobjectblock.tpl.php index 3d6ec68ba2e..4097e73d560 100644 --- a/htdocs/don/tpl/linkedobjectblock.tpl.php +++ b/htdocs/don/tpl/linkedobjectblock.tpl.php @@ -19,7 +19,7 @@ * */ -print "\n"; +print "\n"; global $user; global $noMoreLinkedObjectBlockAfter; diff --git a/htdocs/eventorganization/tpl/linkedobjectblock.tpl.php b/htdocs/eventorganization/tpl/linkedobjectblock.tpl.php index 732d3254203..9f761c24bc6 100644 --- a/htdocs/eventorganization/tpl/linkedobjectblock.tpl.php +++ b/htdocs/eventorganization/tpl/linkedobjectblock.tpl.php @@ -23,7 +23,7 @@ if (empty($conf) || !is_object($conf)) { exit; } -echo "\n"; +echo "\n"; global $user; diff --git a/htdocs/expedition/tpl/linkedobjectblock.tpl.php b/htdocs/expedition/tpl/linkedobjectblock.tpl.php index b00d63eaba1..26e4ebbb47d 100644 --- a/htdocs/expedition/tpl/linkedobjectblock.tpl.php +++ b/htdocs/expedition/tpl/linkedobjectblock.tpl.php @@ -23,7 +23,7 @@ if (empty($conf) || !is_object($conf)) { } -print "\n"; +print "\n"; global $user; diff --git a/htdocs/expensereport/tpl/linkedobjectblock.tpl.php b/htdocs/expensereport/tpl/linkedobjectblock.tpl.php index e3fc511a024..6a36b62f924 100644 --- a/htdocs/expensereport/tpl/linkedobjectblock.tpl.php +++ b/htdocs/expensereport/tpl/linkedobjectblock.tpl.php @@ -24,7 +24,7 @@ if (empty($conf) || !is_object($conf)) { } -print "\n"; +print "\n"; global $user; diff --git a/htdocs/fichinter/tpl/linkedobjectblock.tpl.php b/htdocs/fichinter/tpl/linkedobjectblock.tpl.php index b7e3eaa382b..e5903ee5863 100644 --- a/htdocs/fichinter/tpl/linkedobjectblock.tpl.php +++ b/htdocs/fichinter/tpl/linkedobjectblock.tpl.php @@ -22,7 +22,7 @@ if (empty($conf) || !is_object($conf)) { } -print "\n"; +print "\n"; global $user; diff --git a/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php b/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php index eeb2860bcd6..1efd78df372 100644 --- a/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php +++ b/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php @@ -23,7 +23,7 @@ if (empty($conf) || !is_object($conf)) { } -print "\n"; +print "\n"; global $user; diff --git a/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php b/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php index 4188fef716e..3f728d99567 100644 --- a/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php +++ b/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php @@ -25,7 +25,7 @@ if (empty($conf) || !is_object($conf)) { } -print "\n"; +print "\n"; global $user; diff --git a/htdocs/modulebuilder/template/core/tpl/linkedobjectblock_myobject.tpl.php b/htdocs/modulebuilder/template/core/tpl/linkedobjectblock_myobject.tpl.php index 3c6442bd454..2f0ecd06774 100644 --- a/htdocs/modulebuilder/template/core/tpl/linkedobjectblock_myobject.tpl.php +++ b/htdocs/modulebuilder/template/core/tpl/linkedobjectblock_myobject.tpl.php @@ -22,7 +22,7 @@ if (empty($conf) || !is_object($conf)) { } -print "\n"; +print "\n"; global $user; diff --git a/htdocs/mrp/tpl/linkedobjectblock.tpl.php b/htdocs/mrp/tpl/linkedobjectblock.tpl.php index ac3a6bafc07..5dbe583fd21 100644 --- a/htdocs/mrp/tpl/linkedobjectblock.tpl.php +++ b/htdocs/mrp/tpl/linkedobjectblock.tpl.php @@ -24,7 +24,7 @@ if (empty($conf) || !is_object($conf)) { exit; } -print "\n"; +print "\n"; global $user, $db; global $noMoreLinkedObjectBlockAfter; diff --git a/htdocs/product/canvas/product/tpl/card_create.tpl.php b/htdocs/product/canvas/product/tpl/card_create.tpl.php index 5d39b55ff76..8813e4a8d7e 100644 --- a/htdocs/product/canvas/product/tpl/card_create.tpl.php +++ b/htdocs/product/canvas/product/tpl/card_create.tpl.php @@ -27,7 +27,7 @@ $object = $GLOBALS['object']; $statutarray = array('1' => $langs->trans("OnSell"), '0' => $langs->trans("NotOnSell")); ?> - + trans("NewProduct"), '', 'product'); diff --git a/htdocs/product/canvas/product/tpl/card_edit.tpl.php b/htdocs/product/canvas/product/tpl/card_edit.tpl.php index 2e04f660084..b21355c1c21 100644 --- a/htdocs/product/canvas/product/tpl/card_edit.tpl.php +++ b/htdocs/product/canvas/product/tpl/card_edit.tpl.php @@ -27,7 +27,7 @@ $object = $GLOBALS['object']; $statutarray = array('1' => $langs->trans("OnSell"), '0' => $langs->trans("NotOnSell")); ?> - + - + trans("CardProduct".$object->type); diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index fe6abdb7979..65b12a91342 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -317,7 +317,7 @@ if (!$found && !$mesg) { } if ($mesg) { - print '

    '.dol_escape_htmltag($mesg).'

    '.dol_escape_htmltag($mesg).'
    '."\n"; @@ -334,7 +334,7 @@ if ($action != 'dosign') { } print ''."\n"; -print ''; +print ''; if ($action == "dosign" && empty($cancel)) { print '
    '; @@ -395,8 +395,8 @@ if ($action == "dosign" && empty($cancel)) { print '
    '; print ''.$langs->trans("PropalAlreadyRefused").''; } else { - print ''; - print ''; + print ''; + print ''; } } print ''."\n"; diff --git a/htdocs/reception/tpl/linkedobjectblock.tpl.php b/htdocs/reception/tpl/linkedobjectblock.tpl.php index 41ebc02747f..bb6777c0639 100644 --- a/htdocs/reception/tpl/linkedobjectblock.tpl.php +++ b/htdocs/reception/tpl/linkedobjectblock.tpl.php @@ -25,7 +25,7 @@ if (empty($conf) || !is_object($conf)) { ?> - + .butActionRefused:last-child, :not(.center) > .butAction:last-child, :not(.center) > .butActionDelete:last-child { margin-: 0px !important; } .butActionRefused, .butAction, .butAction:link, .butAction:visited, .butAction:hover, .butAction:active, .butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active { diff --git a/htdocs/theme/md/btn.inc.php b/htdocs/theme/md/btn.inc.php index 2517415a96f..1bf0333e574 100644 --- a/htdocs/theme/md/btn.inc.php +++ b/htdocs/theme/md/btn.inc.php @@ -67,8 +67,8 @@ span.butAction, span.butActionDelete { .butActionRefused, .butAction, .butActionDelete { border-radius: 3px; } -.butActionRefused:last-child, .butAction:last-child, .butActionDelete:last-child { - margin-right: 0px !important; +:not(.center) > .butActionRefused:last-child, :not(.center) > .butAction:last-child, :not(.center) > .butActionDelete:last-child { + margin-: 0px !important; } .butActionRefused, .butAction, .butAction:link, .butAction:visited, .butAction:hover, .butAction:active, .butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active { text-decoration: none; diff --git a/htdocs/ticket/tpl/linkedobjectblock.tpl.php b/htdocs/ticket/tpl/linkedobjectblock.tpl.php index 51c2cbfb7fd..f84b2381b27 100644 --- a/htdocs/ticket/tpl/linkedobjectblock.tpl.php +++ b/htdocs/ticket/tpl/linkedobjectblock.tpl.php @@ -21,7 +21,7 @@ if (empty($conf) || !is_object($conf)) { exit; } -print "\n"; +print "\n"; global $user; From 0276cef4ad98f1c6e876c652dc5f10a3a576feeb Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Tue, 19 Oct 2021 09:09:01 +0200 Subject: [PATCH 0952/1460] FIX : new modulebuilder template method --- htdocs/hrm/evaluation_list.php | 2 +- htdocs/hrm/job_list.php | 2 +- htdocs/hrm/skill_list.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/hrm/evaluation_list.php b/htdocs/hrm/evaluation_list.php index 5fa565e397d..1b39a7ff1b9 100644 --- a/htdocs/hrm/evaluation_list.php +++ b/htdocs/hrm/evaluation_list.php @@ -296,7 +296,7 @@ foreach ($search as $key => $val) { } $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) { - if ($search[$key] == '-1'/* || $search[$key] === '0'*/) { + if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($object->fields[$key]['arrayofkeyval']) || !array_key_exists('0', $object->fields[$key]['arrayofkeyval'])))) { $search[$key] = ''; } $mode_search = 2; diff --git a/htdocs/hrm/job_list.php b/htdocs/hrm/job_list.php index b851057311e..7a1cc59d39c 100644 --- a/htdocs/hrm/job_list.php +++ b/htdocs/hrm/job_list.php @@ -296,7 +296,7 @@ foreach ($search as $key => $val) { } $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) { - if ($search[$key] == '-1'/* || $search[$key] === '0'*/) { + if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($object->fields[$key]['arrayofkeyval']) || !array_key_exists('0', $object->fields[$key]['arrayofkeyval'])))) { $search[$key] = ''; } $mode_search = 2; diff --git a/htdocs/hrm/skill_list.php b/htdocs/hrm/skill_list.php index 58f71fefdce..c79614ffde2 100644 --- a/htdocs/hrm/skill_list.php +++ b/htdocs/hrm/skill_list.php @@ -296,7 +296,7 @@ foreach ($search as $key => $val) { } $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) { - if ($search[$key] == '-1'/* || $search[$key] === '0'*/) { + if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($object->fields[$key]['arrayofkeyval']) || !array_key_exists('0', $object->fields[$key]['arrayofkeyval'])))) { $search[$key] = ''; } $mode_search = 2; From dd6457b259785c5d61bf651134f0ddb505c989ce Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Tue, 19 Oct 2021 10:24:59 +0200 Subject: [PATCH 0953/1460] FIX: boxes php 8.0 errors and warnings --- htdocs/core/boxes/box_actions.php | 2 +- htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php | 2 +- htdocs/core/boxes/box_supplier_orders_awaiting_reception.php | 2 +- htdocs/core/class/dolgraph.class.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php index 64a2314560c..814dfacc5f3 100644 --- a/htdocs/core/boxes/box_actions.php +++ b/htdocs/core/boxes/box_actions.php @@ -162,7 +162,7 @@ class box_actions extends ModeleBoxes $this->info_box_contents[$line][2] = array( 'td' => 'class="center nowraponall"', - 'text' => dol_print_date($datelimite, "dayhour", 'tzuserrel'), + 'text' => $datelimite ? dol_print_date($datelimite, "dayhour", 'tzuserrel') : '', 'asis' => 1 ); diff --git a/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php b/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php index baa822dcf29..98aed557557 100644 --- a/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php +++ b/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php @@ -85,7 +85,7 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes $param_day = 'DOLUSERCOOKIE_ticket_last_days'; - if ($_POST[$param_day]) { + if (!empty($_POST[$param_day])) { if ($_POST[$param_day] >= 15) { $days = 14; } else { diff --git a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php index 8125a848fd0..580ccdb373c 100644 --- a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php +++ b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php @@ -161,7 +161,7 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes $this->info_box_contents[$line][] = array( 'td' => 'class="right"', - 'text' => $delayIcon.' '.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/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index ac2965668a2..a892c557b34 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -1384,7 +1384,7 @@ class DolGraph $textoflegend = $arrayofgroupslegend[$i]['legendwithgroup']; } else { - $textoflegend = $this->Legend[$i]; + $textoflegend = !empty($this->Legend[$i]) ? $this->Legend[$i] : ''; } if ($usecolorvariantforgroupby) { From 5e26e2a71a89145cee6cad5ca9783194513334e8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 Oct 2021 10:54:09 +0200 Subject: [PATCH 0954/1460] Trans --- htdocs/langs/en_US/products.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 19349fb35a8..205a28980a8 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -316,7 +316,7 @@ LastUpdated=Latest update CorrectlyUpdated=Correctly updated PropalMergePdfProductActualFile=Files use to add into PDF Azur are/is PropalMergePdfProductChooseFile=Select PDF files -IncludingProductWithTag=Include products/services with tag +IncludingProductWithTag=Including products/services with the tag DefaultPriceRealPriceMayDependOnCustomer=Default price, real price may depend on customer WarningSelectOneDocument=Please select at least one document DefaultUnitToShow=Unit From acbae5cafb51876c75f8556a79546ac0677b337d Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 19 Oct 2021 12:14:42 +0200 Subject: [PATCH 0955/1460] FIX add possibility to bypass MAIN_ANTIVIRUS_* constants --- htdocs/core/class/conf.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index ee91d67b9ce..04fd0266150 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -836,6 +836,12 @@ class Conf // Note: Set MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL=1 to have a renewal of token at each page call instead of each session (not recommended) } + // To bypass MAIN_ANTIVIRUS_* constants + if (defined('MAIN_ANTIVIRUS_BYPASS_COMMAND_AND_PARAM')) { + define("MAIN_ANTIVIRUS_COMMAND", false); + define("MAIN_ANTIVIRUS_PARAM", false); + } + if (defined('MAIN_ANTIVIRUS_COMMAND')) { $this->global->MAIN_ANTIVIRUS_COMMAND = constant('MAIN_ANTIVIRUS_COMMAND'); } From db01fed44722883140c9c92bd37ccb4e68fa158b Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 19 Oct 2021 12:36:33 +0200 Subject: [PATCH 0956/1460] FIX error when defining an already existing constant --- htdocs/admin/security_file.php | 4 ++-- htdocs/admin/system/security.php | 2 +- htdocs/core/class/conf.class.php | 18 +++++++----------- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/htdocs/admin/security_file.php b/htdocs/admin/security_file.php index 0a0e0b5973a..fbae10a9512 100644 --- a/htdocs/admin/security_file.php +++ b/htdocs/admin/security_file.php @@ -153,8 +153,8 @@ if (ini_get('safe_mode') && !empty($conf->global->MAIN_ANTIVIRUS_COMMAND)) { dol_syslog("safe_mode is on, basedir is ".$basedir.", safe_mode_exec_dir is ".ini_get('safe_mode_exec_dir'), LOG_WARNING); } } -print ''; -if (defined('MAIN_ANTIVIRUS_COMMAND')) { +print ''; +if (defined('MAIN_ANTIVIRUS_COMMAND') && !defined('MAIN_ANTIVIRUS_BYPASS_COMMAND_AND_PARAM')) { print '
    '.$langs->trans("ValueIsForcedBySystem").''; } print ""; diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index b0614c7501d..f03246a6bdf 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -306,7 +306,7 @@ print empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ? '' : img_picto('', 'tick'). print yn(empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ? 0 : 1); if (!empty($conf->global->MAIN_ANTIVIRUS_COMMAND)) { print '   - '.$conf->global->MAIN_ANTIVIRUS_COMMAND; - if (defined('MAIN_ANTIVIRUS_COMMAND')) { + if (defined('MAIN_ANTIVIRUS_COMMAND') && !defined('MAIN_ANTIVIRUS_BYPASS_COMMAND_AND_PARAM')) { print ' - '.$langs->trans("ValueIsForcedBySystem").''; } } diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 04fd0266150..044dc192426 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -836,17 +836,13 @@ class Conf // Note: Set MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL=1 to have a renewal of token at each page call instead of each session (not recommended) } - // To bypass MAIN_ANTIVIRUS_* constants - if (defined('MAIN_ANTIVIRUS_BYPASS_COMMAND_AND_PARAM')) { - define("MAIN_ANTIVIRUS_COMMAND", false); - define("MAIN_ANTIVIRUS_PARAM", false); - } - - if (defined('MAIN_ANTIVIRUS_COMMAND')) { - $this->global->MAIN_ANTIVIRUS_COMMAND = constant('MAIN_ANTIVIRUS_COMMAND'); - } - if (defined('MAIN_ANTIVIRUS_PARAM')) { - $this->global->MAIN_ANTIVIRUS_PARAM = constant('MAIN_ANTIVIRUS_PARAM'); + if (!defined('MAIN_ANTIVIRUS_BYPASS_COMMAND_AND_PARAM')) { + if (defined('MAIN_ANTIVIRUS_COMMAND')) { + $this->global->MAIN_ANTIVIRUS_COMMAND = constant('MAIN_ANTIVIRUS_COMMAND'); + } + if (defined('MAIN_ANTIVIRUS_PARAM')) { + $this->global->MAIN_ANTIVIRUS_PARAM = constant('MAIN_ANTIVIRUS_PARAM'); + } } if (!empty($this->global->MAIN_TZUSERINPUTKEY)) { From d8cd6b6f557cbb099f91e0e8c04e2b9184cf7ea7 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Tue, 19 Oct 2021 15:54:25 +0200 Subject: [PATCH 0957/1460] Fix autoselect multilevel --- htdocs/core/class/html.formticket.class.php | 76 +++++++++++++-------- 1 file changed, 46 insertions(+), 30 deletions(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 5ce2dd0fca7..0061609ef01 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -755,7 +755,23 @@ class FormTicket } elseif ($htmlname!='') { $groupticket=GETPOST($htmlname, 'aZ09'); $child_id=GETPOST($htmlname.'_child_id', 'aZ09')?GETPOST($htmlname.'_child_id', 'aZ09'):0; - + if (!empty($groupticket)) { + $tmpgroupticket = $groupticket; + $sql = "SELECT ctc.rowid, ctc.fk_parent, ctc.code FROM ".MAIN_DB_PREFIX."c_ticket_category as ctc WHERE ctc.code = '".$tmpgroupticket."'"; + $resql = $this->db->query($sql); + if ($resql) { + $obj = $this->db->fetch_object($resql); + $selectedgroups[] = $obj->code; + while ($obj->fk_parent > 0) { + $sql = "SELECT ctc.rowid, ctc.fk_parent, ctc.code FROM ".MAIN_DB_PREFIX."c_ticket_category as ctc WHERE ctc.rowid ='".$obj->fk_parent."'"; + $resql = $this->db->query($sql); + if ($resql) { + $obj = $this->db->fetch_object($resql); + $selectedgroups[] = $obj->code; + } + } + } + } $arrayidused = array(); $arrayidusedconcat = array(); $arraycodenotparent = array(); @@ -794,7 +810,11 @@ class FormTicket $grouplabel = $label; $isparent = $obj->isparent; - $iselected = $groupticket == $obj->code ?'selected':''; + if (is_array($selectedgroups)) { + $iselected = in_array($obj->code, $selectedgroups) ?'selected':''; + } else { + $iselected = $groupticket == $obj->code ?'selected':''; + } $stringtoprint .= ''; if ($isparent == 'NOTPARENT') { $arraycodenotparent[] = $groupvalue; @@ -868,10 +888,14 @@ class FormTicket if ($isparent == 'NOTPARENT') { $arraycodenotparent[] = $groupvalue; } - $iselected = $groupticket == $obj->code ?'selected':''; + if (is_array($selectedgroups)) { + $iselected = in_array($obj->code, $selectedgroups) ?'selected':''; + } else { + $iselected = $groupticket == $obj->code ?'selected':''; + } $stringtoprint .= ''; if (empty($tabscript[$groupcodefather])) { - $tabscript[$groupcodefather] = 'if ($("#'.$htmlname.($levelid > 1 ?'_child_'.$levelid-1:'').'")[0].value == "'.dol_escape_js($groupcodefather).'"){ + $tabscript[$groupcodefather] = 'if ($("#'.$htmlname.($levelid > 1 ?'_child_'.$levelid-1:'').'").val() == "'.dol_escape_js($groupcodefather).'"){ $(".'.$htmlname.'_'.dol_escape_htmltag($fatherid).'_child_'.$levelid.'").show() console.log("We show childs tickets of '.$groupcodefather.' group ticket") }else{ @@ -889,23 +913,15 @@ class FormTicket $stringtoprint .=''; $stringtoprint .= ajax_combobox($htmlname); From f5942300e0f01b0317519734d4001a78788ac300 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Tue, 19 Oct 2021 16:09:06 +0200 Subject: [PATCH 0958/1460] fix CI bot error --- htdocs/core/class/html.formticket.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 0061609ef01..89260c35d03 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -757,13 +757,13 @@ class FormTicket $child_id=GETPOST($htmlname.'_child_id', 'aZ09')?GETPOST($htmlname.'_child_id', 'aZ09'):0; if (!empty($groupticket)) { $tmpgroupticket = $groupticket; - $sql = "SELECT ctc.rowid, ctc.fk_parent, ctc.code FROM ".MAIN_DB_PREFIX."c_ticket_category as ctc WHERE ctc.code = '".$tmpgroupticket."'"; + $sql = "SELECT ctc.rowid, ctc.fk_parent, ctc.code FROM ".MAIN_DB_PREFIX."c_ticket_category as ctc WHERE ctc.code = '".$this->db->escape($tmpgroupticket)."'"; $resql = $this->db->query($sql); if ($resql) { $obj = $this->db->fetch_object($resql); $selectedgroups[] = $obj->code; while ($obj->fk_parent > 0) { - $sql = "SELECT ctc.rowid, ctc.fk_parent, ctc.code FROM ".MAIN_DB_PREFIX."c_ticket_category as ctc WHERE ctc.rowid ='".$obj->fk_parent."'"; + $sql = "SELECT ctc.rowid, ctc.fk_parent, ctc.code FROM ".MAIN_DB_PREFIX."c_ticket_category as ctc WHERE ctc.rowid ='".$this->db->escape($obj->fk_parent)."'"; $resql = $this->db->query($sql); if ($resql) { $obj = $this->db->fetch_object($resql); From 8daa1a810a6b51606863e9ba7fad1de504ed16a6 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Tue, 19 Oct 2021 16:44:59 +0200 Subject: [PATCH 0959/1460] FIX : Move interface.php to ajax/ --- htdocs/bom/{script => ajax}/interface.php | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename htdocs/bom/{script => ajax}/interface.php (100%) diff --git a/htdocs/bom/script/interface.php b/htdocs/bom/ajax/interface.php similarity index 100% rename from htdocs/bom/script/interface.php rename to htdocs/bom/ajax/interface.php From 0cae464bfa364ffa6fa36b3c93b461eba713cd61 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 Oct 2021 16:26:43 +0200 Subject: [PATCH 0960/1460] Debug v15 --- htdocs/admin/emailcollector_list.php | 2 +- htdocs/admin/events.php | 2 ++ htdocs/admin/ihm.php | 2 ++ htdocs/admin/mails_senderprofile_list.php | 2 +- htdocs/admin/proxy.php | 1 + htdocs/admin/security.php | 3 ++- htdocs/admin/security_file.php | 2 +- htdocs/admin/security_other.php | 1 + htdocs/admin/stock.php | 2 +- htdocs/asset/list.php | 2 +- htdocs/bom/bom_list.php | 2 +- htdocs/compta/cashcontrol/cashcontrol_list.php | 2 +- htdocs/core/lib/functions.lib.php | 13 +++++++++---- .../tpl/extrafields_list_print_fields.tpl.php | 2 +- .../eventorganization/conferenceorbooth_list.php | 2 +- .../conferenceorboothattendee_list.php | 2 +- htdocs/hrm/evaluation_list.php | 2 +- htdocs/hrm/job_list.php | 2 +- htdocs/hrm/position.php | 2 +- htdocs/hrm/position_list.php | 2 +- htdocs/hrm/skill_card.php | 2 +- htdocs/hrm/skill_list.php | 2 +- .../knowledgemanagement/knowledgerecord_list.php | 2 +- .../template/class/myobject.class.php | 2 +- htdocs/modulebuilder/template/myobject_list.php | 2 +- htdocs/mrp/mo_list.php | 2 +- htdocs/opensurvey/card.php | 8 ++++---- htdocs/opensurvey/css/style.css | 7 +++++++ htdocs/opensurvey/results.php | 15 +++++---------- htdocs/partnership/partnership_list.php | 2 +- htdocs/product/inventory/list.php | 2 +- htdocs/product/stock/list.php | 2 +- htdocs/product/stock/productlot_list.php | 2 +- htdocs/public/opensurvey/studs.php | 2 +- .../recruitment/recruitmentcandidature_list.php | 2 +- .../recruitment/recruitmentjobposition_list.php | 2 +- htdocs/societe/website.php | 8 ++++---- htdocs/theme/eldy/global.inc.php | 2 +- htdocs/ticket/class/ticket.class.php | 6 +++--- htdocs/ticket/list.php | 4 ++-- htdocs/workstation/workstation_list.php | 2 +- 41 files changed, 71 insertions(+), 57 deletions(-) diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index ddfa847d813..af137a1ecdb 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -530,7 +530,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if (!$i) { $totalarray['nbfield']++; } - if (!empty($val['isameasure'])) { + if (!empty($val['isameasure']) && $val['isameasure'] == 1) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; } diff --git a/htdocs/admin/events.php b/htdocs/admin/events.php index 6216820166e..b98f3775aad 100644 --- a/htdocs/admin/events.php +++ b/htdocs/admin/events.php @@ -107,6 +107,8 @@ $head = security_prepare_head(); print dol_get_fiche_head($head, 'audit', '', -1); +print '
    '; + print ''; print ""; print getTitleFieldOfList("LogEvents", 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, '')."\n"; diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 82eed8bee6d..697f8fa2130 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -299,6 +299,8 @@ $head = ihm_prepare_head(); print dol_get_fiche_head($head, $mode, '', -1, ''); +print '
    '; + clearstatcache(); if ($mode == 'template') { diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index 9cabe4a8e98..d3441cf2e21 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -597,7 +597,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if (!$i) { $totalarray['nbfield']++; } - if (!empty($val['isameasure'])) { + if (!empty($val['isameasure']) && $val['isameasure'] == 1) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; } diff --git a/htdocs/admin/proxy.php b/htdocs/admin/proxy.php index 635fb2e1e7b..451771f7a98 100644 --- a/htdocs/admin/proxy.php +++ b/htdocs/admin/proxy.php @@ -95,6 +95,7 @@ $head = security_prepare_head(); print dol_get_fiche_head($head, 'proxy', '', -1); +print '
    '; if ($conf->use_javascript_ajax) { print "\n".''; if ($addlink) { - $out .= ' '.$langs->trans("Link").''; + if ($textonlink === 'image') { + $out .= ' '.img_picto('', 'globe').''; + } else { + $out .= ' '.$langs->trans("Link").''; + } } return $out; } diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index 7d547d52dea..adf90e204bb 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -62,7 +62,7 @@ if (!empty($extrafieldsobjectkey) && !empty($extrafields->attributes[$extrafield $totalarray['totalizable'][$key]['total'] += $obj->$tmpkey; } } - if (!empty($val['isameasure'])) { + if (!empty($val['isameasure']) && $val['isameasure'] == 1) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = $extrafieldsobjectprefix.$tmpkey; } diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index a0ee450c3ef..d6266ec241e 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -830,7 +830,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if (!$i) { $totalarray['nbfield']++; } - if (!empty($val['isameasure'])) { + if (!empty($val['isameasure']) && $val['isameasure'] == 1) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; } diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index 6cebd3f7805..3fe20e3c814 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -889,7 +889,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if (!$i) { $totalarray['nbfield']++; } - if (!empty($val['isameasure'])) { + if (!empty($val['isameasure']) && $val['isameasure'] == 1) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; } diff --git a/htdocs/hrm/evaluation_list.php b/htdocs/hrm/evaluation_list.php index 9ec102c45ea..45c625c7211 100644 --- a/htdocs/hrm/evaluation_list.php +++ b/htdocs/hrm/evaluation_list.php @@ -641,7 +641,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if (!$i) { $totalarray['nbfield']++; } - if (!empty($val['isameasure'])) { + if (!empty($val['isameasure']) && $val['isameasure'] == 1) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; } diff --git a/htdocs/hrm/job_list.php b/htdocs/hrm/job_list.php index fdf2de51d45..93dde42ae4f 100644 --- a/htdocs/hrm/job_list.php +++ b/htdocs/hrm/job_list.php @@ -643,7 +643,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if (!$i) { $totalarray['nbfield']++; } - if (!empty($val['isameasure'])) { + if (!empty($val['isameasure']) && $val['isameasure'] == 1) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; } diff --git a/htdocs/hrm/position.php b/htdocs/hrm/position.php index 8eec7d0e660..208a397f135 100644 --- a/htdocs/hrm/position.php +++ b/htdocs/hrm/position.php @@ -812,7 +812,7 @@ function DisplayPositionList() if (!$i) { $totalarray['nbfield']++; } - if (!empty($val['isameasure'])) { + if (!empty($val['isameasure']) && $val['isameasure'] == 1) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 't.' . $key; } diff --git a/htdocs/hrm/position_list.php b/htdocs/hrm/position_list.php index 725948c4b3f..60e69bfac3f 100644 --- a/htdocs/hrm/position_list.php +++ b/htdocs/hrm/position_list.php @@ -642,7 +642,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if (!$i) { $totalarray['nbfield']++; } - if (!empty($val['isameasure'])) { + if (!empty($val['isameasure']) && $val['isameasure'] == 1) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; } diff --git a/htdocs/hrm/skill_card.php b/htdocs/hrm/skill_card.php index c0d3d67ccab..2a5b58cd788 100644 --- a/htdocs/hrm/skill_card.php +++ b/htdocs/hrm/skill_card.php @@ -790,7 +790,7 @@ if ($action != "create" && $action != "edit") { if (!$i) { $totalarray['nbfield']++; } - if (!empty($val['isameasure'])) { + if (!empty($val['isameasure']) && $val['isameasure'] == 1) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 't.' . $key; } diff --git a/htdocs/hrm/skill_list.php b/htdocs/hrm/skill_list.php index 5e8ae1e6e24..e27de1eadc5 100644 --- a/htdocs/hrm/skill_list.php +++ b/htdocs/hrm/skill_list.php @@ -643,7 +643,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if (!$i) { $totalarray['nbfield']++; } - if (!empty($val['isameasure'])) { + if (!empty($val['isameasure']) && $val['isameasure'] == 1) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; } diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index 75aa11cf771..d4a702f26b8 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -612,7 +612,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if (!$i) { $totalarray['nbfield']++; } - if (!empty($val['isameasure'])) { + if (!empty($val['isameasure']) && $val['isameasure'] == 1) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; } diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 1c0d17ae373..8e316d014d5 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -83,7 +83,7 @@ class MyObject extends CommonObject * 'index' if we want an index in database. * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...). * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. - * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). + * 'isameasure' must be set to 1 or 2 if field can be used for measure. Field type must be summable like integer or double(24,8). Use 1 in most cases, or 2 if you don't want to see the column total into list (for example for percentage) * 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'cssview'=>'wordbreak', 'csslist'=>'tdoverflowmax200' * 'help' is a 'TranslationString' to use to show a tooltip on field. You can also use 'TranslationString:keyfortooltiponlick' for a tooltip on click. * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 59a3a1e72b0..ac4f6be13b8 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -662,7 +662,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if (!$i) { $totalarray['nbfield']++; } - if (!empty($val['isameasure'])) { + if (!empty($val['isameasure']) && $val['isameasure'] == 1) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; } diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index 7c5c91c0511..e5648cad5f7 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -567,7 +567,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if (!$i) { $totalarray['nbfield']++; } - if (!empty($val['isameasure'])) { + if (!empty($val['isameasure']) && $val['isameasure'] == 1) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; } diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php index 19aff377c65..773571b7b1c 100644 --- a/htdocs/opensurvey/card.php +++ b/htdocs/opensurvey/card.php @@ -229,7 +229,7 @@ print '
    '; // Type $type = ($object->format == "A") ? 'classic' : 'date'; -print ''; @@ -323,7 +323,7 @@ if ($object->fk_user_creat > 0) { print ''; // Link -print ''; diff --git a/htdocs/opensurvey/css/style.css b/htdocs/opensurvey/css/style.css index 409b64dddf5..e7f0d279a14 100644 --- a/htdocs/opensurvey/css/style.css +++ b/htdocs/opensurvey/css/style.css @@ -342,6 +342,13 @@ div.cadre table.resultats { td.nom { min-width: 160px; } +@media only screen and (max-width: 767px) +{ + td.nom { + min-width: 100px; + } +} + td.vide { min-width: 60px; } diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php index d03cbca69c5..e37f9bf3de5 100644 --- a/htdocs/opensurvey/results.php +++ b/htdocs/opensurvey/results.php @@ -531,7 +531,7 @@ if ($object->fk_user_creat) { print ''; // Link -print ''; @@ -669,7 +664,7 @@ $nbcolonnes = substr_count($object->sujet, ',') + 1; print ''."\n"; print ''; -print '
    '."\n"; +print '
    '."\n"; // Start to show survey result print '
    '.$langs->trans("Type").''; +print '
    '.$langs->trans("Type").''; print img_picto('', dol_buildpath('/opensurvey/img/'.($type == 'classic' ? 'chart-32.png' : 'calendar-32.png'), 1), 'width="16"', 1); print ' '.$langs->trans($type == 'classic' ? "TypeClassic" : "TypeDate").'
    '.img_picto('', 'globe').' '.$langs->trans("UrlForSurvey", '').''; +print '
    '.$langs->trans("UrlForSurvey", '').''; // Define $urlwithroot $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); @@ -331,9 +331,9 @@ $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domai //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current $url = $urlwithroot.'/public/opensurvey/studs.php?sondage='.$object->id_sondage; -print ''; +print ''; if ($action != 'edit') { - print ajax_autoselect("opensurveyurl", $url); + print ajax_autoselect("opensurveyurl", $url, 'image'); } print '
    '.img_picto('', 'globe').' '.$langs->trans("UrlForSurvey", '').''; +print '
    '.$langs->trans("UrlForSurvey", '').''; // Define $urlwithroot $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); @@ -539,15 +539,10 @@ $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domai //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current $url = $urlwithouturlroot.dol_buildpath('/public/opensurvey/studs.php', 1).'?sondage='.$object->id_sondage; -$urllink = ''; +$urllink = ''; print $urllink; if ($action != 'edit') { - print ''; - print ' '.$langs->trans("Link").''; + print ajax_autoselect("opensurveyurl", $url, 'image'); } print '
    '."\n"; @@ -1041,7 +1036,7 @@ if (empty($testligneamodifier)) { print ''."\n"; print ''."\n"; print ''."\n"; for ($i = 0; $i < $nbcolonnes; $i++) { diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index e9c577213d6..a5c52609d74 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -652,7 +652,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if (!$i) { $totalarray['nbfield']++; } - if (!empty($val['isameasure'])) { + if (!empty($val['isameasure']) && $val['isameasure'] == 1) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; } diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index 36910c75fb2..44726bb489c 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -561,7 +561,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if (!$i) { $totalarray['nbfield']++; } - if (!empty($val['isameasure'])) { + if (!empty($val['isameasure']) && $val['isameasure'] == 1) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; } diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index a6fef44bb05..e223714e82d 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -624,7 +624,7 @@ while ($i < min($num, $limit)) { if (!$i) { $totalarray['nbfield']++; } - if (!empty($val['isameasure'])) { + if (!empty($val['isameasure']) && $val['isameasure'] == 1) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; } diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index 25c9921ce18..3c987cd1cfa 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -537,7 +537,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if (!$i) { $totalarray['nbfield']++; } - if (!empty($val['isameasure'])) { + if (!empty($val['isameasure']) && $val['isameasure'] == 1) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; } diff --git a/htdocs/public/opensurvey/studs.php b/htdocs/public/opensurvey/studs.php index 7be05684fd2..42cde055ac2 100644 --- a/htdocs/public/opensurvey/studs.php +++ b/htdocs/public/opensurvey/studs.php @@ -298,7 +298,7 @@ print ''."\n"; //The survey has expired, users can't vote or do any action if (!$canbemodified) { - print '

    '.$langs->trans('SurveyExpiredInfo').'

    '; + print '
    '.$langs->trans('SurveyExpiredInfo').'
    '; llxFooterSurvey(); $db->close(); diff --git a/htdocs/recruitment/recruitmentcandidature_list.php b/htdocs/recruitment/recruitmentcandidature_list.php index d2315b1f756..56b00c94949 100644 --- a/htdocs/recruitment/recruitmentcandidature_list.php +++ b/htdocs/recruitment/recruitmentcandidature_list.php @@ -571,7 +571,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if (!$i) { $totalarray['nbfield']++; } - if (!empty($val['isameasure'])) { + if (!empty($val['isameasure']) && $val['isameasure'] == 1) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; } diff --git a/htdocs/recruitment/recruitmentjobposition_list.php b/htdocs/recruitment/recruitmentjobposition_list.php index 0544cdb160f..26a3a81e998 100644 --- a/htdocs/recruitment/recruitmentjobposition_list.php +++ b/htdocs/recruitment/recruitmentjobposition_list.php @@ -611,7 +611,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if (!$i) { $totalarray['nbfield']++; } - if (!empty($val['isameasure'])) { + if (!empty($val['isameasure']) && $val['isameasure'] == 1) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; } diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php index 0bc51450e44..d093af10dbb 100644 --- a/htdocs/societe/website.php +++ b/htdocs/societe/website.php @@ -493,8 +493,8 @@ while ($i < min($num, $limit)) { $objectwebsiteaccount->login = $obj->login; $objectwebsiteaccount->ref = $obj->login; foreach ($objectwebsiteaccount->fields as $key => $val) { - if (property_exists($obj, $key)) { - $object->$key = $obj->$key; + if (property_exists($objectwebsiteaccount, $key)) { + $objectwebsiteaccount->$key = $obj->$key; } } @@ -526,7 +526,7 @@ while ($i < min($num, $limit)) { if (!$i) { $totalarray['nbfield']++; } - if (!empty($val['isameasure'])) { + if (!empty($val['isameasure']) && $val['isameasure'] == 1) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; } @@ -536,7 +536,7 @@ while ($i < min($num, $limit)) { if (!isset($totalarray['val']['t.'.$key])) { $totalarray['val']['t.'.$key] = 0; } - $totalarray['val']['t.'.$key] += $obj->$key; + $totalarray['val']['t.'.$key] += $objectwebsiteaccount->$key; } } } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index e1117b6d659..97a2c1f738a 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -3290,7 +3290,7 @@ tr.nocellnopadd td.nobordernopadding, tr.nocellnopadd td.nocellnopadd padding-right: 7px !important; } input.button[name="upload"] { - padding: 4px !important; + padding: 5px !important; font-size: 0.9em; } input.button.smallpaddingimp { diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 9042dccfebd..7bee6692c5f 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -263,7 +263,7 @@ class Ticket extends CommonObject 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'visible'=>1, 'enabled'=>'$conf->societe->enabled', 'position'=>50, 'notnull'=>-1, 'index'=>1, 'searchall'=>1, 'help'=>"LinkToThirparty", 'css'=>'tdoverflowmax150 maxwidth150onsmartphone'), 'notify_tiers_at_create' => array('type'=>'integer', 'label'=>'NotifyThirdparty', 'visible'=>-1, 'enabled'=>0, 'position'=>51, 'notnull'=>1, 'index'=>1), 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php', 'label'=>'Project', 'visible'=>-1, 'enabled'=>1, 'position'=>52, 'notnull'=>-1, 'index'=>1, 'help'=>"LinkToProject"), - 'timing' => array('type'=>'varchar(20)', 'label'=>'Timing', 'visible'=>-1, 'enabled'=>1, 'position'=>42, 'notnull'=>-1, 'help'=>""), + //'timing' => array('type'=>'varchar(20)', 'label'=>'Timing', 'visible'=>-1, 'enabled'=>1, 'position'=>42, 'notnull'=>-1, 'help'=>""), // what is this ? 'datec' => array('type'=>'datetime', 'label'=>'DateCreation', 'visible'=>1, 'enabled'=>1, 'position'=>500, 'notnull'=>1), 'date_read' => array('type'=>'datetime', 'label'=>'TicketReadOn', 'visible'=>-1, 'enabled'=>1, 'position'=>501, 'notnull'=>1), 'fk_user_assign' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'AssignedTo', 'visible'=>1, 'enabled'=>1, 'position'=>505, 'notnull'=>1, 'css'=>'tdoverflowmax125'), @@ -271,7 +271,7 @@ class Ticket extends CommonObject 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'visible'=>-1, 'enabled'=>1, 'position'=>520, 'notnull'=>1), 'message' => array('type'=>'text', 'label'=>'Message', 'visible'=>-2, 'enabled'=>1, 'position'=>540, 'notnull'=>-1,), 'email_msgid' => array('type'=>'varchar(255)', 'label'=>'EmailMsgID', 'visible'=>-2, 'enabled'=>1, 'position'=>540, 'notnull'=>-1, 'help'=>'EmailMsgIDDesc'), - 'progress' => array('type'=>'varchar(100)', 'label'=>'Progression', 'visible'=>-1, 'enabled'=>1, 'position'=>540, 'notnull'=>-1, 'css'=>'right', 'help'=>"", 'isameasure'=>1), + 'progress' => array('type'=>'varchar(100)', 'label'=>'Progression', 'visible'=>-1, 'enabled'=>1, 'position'=>540, 'notnull'=>-1, 'css'=>'right', 'help'=>"", 'isameasure'=>2), 'resolution' => array('type'=>'integer', 'label'=>'Resolution', 'visible'=>-1, 'enabled'=>'$conf->global->TICKET_ENABLE_RESOLUTION', 'position'=>550, 'notnull'=>1), 'fk_statut' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>600, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array(0 => 'Unread', 1 => 'Read', 3 => 'Answered', 4 => 'Assigned', 5 => 'InProgress', 6 => 'Waiting', 8 => 'SolvedClosed', 9 => 'Deleted')), 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>900), @@ -1102,7 +1102,7 @@ class Ticket extends CommonObject $this->status = 0; $this->resolution = '1'; $this->progress = '10'; - $this->timing = '30'; + //$this->timing = '30'; $this->type_code = 'TYPECODE'; $this->category_code = 'CATEGORYCODE'; $this->severity_code = 'SEVERITYCODE'; diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 04e411b54a6..1f2816520bf 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -1027,7 +1027,7 @@ while ($i < min($num, $limit)) { if (!$i) { $totalarray['nbfield']++; } - if (!empty($val['isameasure'])) { + if (!empty($val['isameasure']) && $val['isameasure'] == 1) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; } @@ -1037,7 +1037,7 @@ while ($i < min($num, $limit)) { if (!isset($totalarray['val']['t.'.$key])) { $totalarray['val']['t.'.$key] = 0; } - $totalarray['val']['t.'.$key] += $obj->$key; + $totalarray['val']['t.'.$key] += $object->$key; } } } diff --git a/htdocs/workstation/workstation_list.php b/htdocs/workstation/workstation_list.php index b5a27aeb1e2..2269eb1d704 100755 --- a/htdocs/workstation/workstation_list.php +++ b/htdocs/workstation/workstation_list.php @@ -616,7 +616,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if (!$i) { $totalarray['nbfield']++; } - if (!empty($val['isameasure'])) { + if (!empty($val['isameasure']) && $val['isameasure'] == 1) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; } From 48b131b3f08772bf231b9de789bd610007e3b2e3 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Tue, 19 Oct 2021 16:50:15 +0200 Subject: [PATCH 0961/1460] FIX : Retours --- htdocs/bom/ajax/interface.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/bom/ajax/interface.php b/htdocs/bom/ajax/interface.php index c93b54fdc33..1416f44f922 100644 --- a/htdocs/bom/ajax/interface.php +++ b/htdocs/bom/ajax/interface.php @@ -2,8 +2,8 @@ require '../../main.inc.php'; $action = GETPOST('action', 'alphanohtml'); -$select_product_val = GETPOST('select_product_val', 'alphanohtml'); -$current_bom_id = GETPOST('current_bom_id', 'alphanohtml'); +$select_product_val = GETPOST('select_product_val', 'int'); +$current_bom_id = GETPOST('current_bom_id', 'int'); global $db; @@ -12,7 +12,7 @@ switch ($action) { //Selection of nomenclatures corresponding to the selected product $sql = 'SELECT b.rowid, b.ref, b.label, b.fk_product, p.label AS product_label FROM '.MAIN_DB_PREFIX.'bom_bom AS b '; $sql.= ' INNER JOIN '.MAIN_DB_PREFIX.'product AS p ON b.fk_product=p.rowid'; - $sql.= ' WHERE fk_product='.$select_product_val.' AND b.rowid!='.$current_bom_id; + $sql.= ' WHERE fk_product='.(int)$select_product_val.' AND b.rowid<>'. (int)$current_bom_id; $resql = $db->query($sql); if ($resql && $db->num_rows($resql) > 0) { $options = array(); From d3035975cf038e24b4c1cfa853e97012a8446323 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 19 Oct 2021 14:52:56 +0000 Subject: [PATCH 0962/1460] Fixing style errors. --- htdocs/bom/ajax/interface.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/bom/ajax/interface.php b/htdocs/bom/ajax/interface.php index 1416f44f922..23b208e25ba 100644 --- a/htdocs/bom/ajax/interface.php +++ b/htdocs/bom/ajax/interface.php @@ -12,7 +12,7 @@ switch ($action) { //Selection of nomenclatures corresponding to the selected product $sql = 'SELECT b.rowid, b.ref, b.label, b.fk_product, p.label AS product_label FROM '.MAIN_DB_PREFIX.'bom_bom AS b '; $sql.= ' INNER JOIN '.MAIN_DB_PREFIX.'product AS p ON b.fk_product=p.rowid'; - $sql.= ' WHERE fk_product='.(int)$select_product_val.' AND b.rowid<>'. (int)$current_bom_id; + $sql.= ' WHERE fk_product='.(int) $select_product_val.' AND b.rowid<>'. (int) $current_bom_id; $resql = $db->query($sql); if ($resql && $db->num_rows($resql) > 0) { $options = array(); From a3e8d43cf582063da9acf7efc61879dd90e624bf Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Tue, 19 Oct 2021 17:25:51 +0200 Subject: [PATCH 0963/1460] FIX : Travis --- htdocs/bom/tpl/objectline_view.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index 96653773d65..2fa8b3c70dc 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -182,7 +182,7 @@ print ''; // Select of all the sub-BOM lines $sql = 'SELECT rowid, fk_bom_child, fk_product FROM '.MAIN_DB_PREFIX.'bom_bomline AS bl'; -$sql.= ' WHERE fk_bom = '.$tmpbom->id; +$sql.= ' WHERE fk_bom ='. (int) $tmpbom->id; $resql = $object->db->query($sql); if ($resql) { From 58941e9a9558416e9c83f56894e9222fccb6c087 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 Oct 2021 19:31:06 +0200 Subject: [PATCH 0964/1460] Update pdf_other.php --- htdocs/admin/pdf_other.php | 55 +++++++++++--------------------------- 1 file changed, 15 insertions(+), 40 deletions(-) diff --git a/htdocs/admin/pdf_other.php b/htdocs/admin/pdf_other.php index 54b4642b9f4..f42c49a4bfe 100644 --- a/htdocs/admin/pdf_other.php +++ b/htdocs/admin/pdf_other.php @@ -91,53 +91,28 @@ print ''.$form->textwithpicto($langs->trans("PDFOthe print "
    \n"; if (!empty($conf->propal->enabled)) { - print load_fiche_titre($langs->trans("Proposal"), '', ''); + print load_fiche_titre($langs->trans("Proposal"), '', ''); - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; - print '
    '; - print '
    '."\n"; - print ''."\n"; + print ''."\n"; print '
    '; - print ''; + print '
    '; + print '
    '.$langs->trans("Parameter").''.$langs->trans("Value").'
    '; + print ''; - print ''; + print ''; - print ''; - - print ''; - - // Width of picture product lign - print ''; - - /* + /* print ''; - */ + */ - print '
    '.$langs->trans("Parameter").''.$langs->trans("Value").'
    '.$langs->trans("MAIN_GENERATE_PROPOSALS_WITH_PICTURE"); - print ' ('.$langs->trans("RandomlySelectedIfSeveral").')'; - print ''; + print '
    '.$langs->trans("MAIN_GENERATE_PROPOSALS_WITH_PICTURE"); + print ' ('.$langs->trans("RandomlySelectedIfSeveral").')'; + print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('MAIN_GENERATE_PROPOSALS_WITH_PICTURE'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); print $form->selectarray("MAIN_GENERATE_PROPOSALS_WITH_PICTURE", $arrval, $conf->global->MAIN_GENERATE_PROPOSALS_WITH_PICTURE); } - print '
    '.$langs->trans("PROPOSAL_PDF_HIDE_PAYMENTTERM"); - print ''; - if ($conf->use_javascript_ajax) { - print ajax_constantonoff('PROPOSAL_PDF_HIDE_PAYMENTTERM'); - } else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("PROPOSAL_PDF_HIDE_PAYMENTTERM", $arrval, $conf->global->PROPOSAL_PDF_HIDE_PAYMENTTERM); - } - print '
    '.$langs->trans("PROPOSAL_PDF_HIDE_PAYMENTMODE"); - print ''; - if ($conf->use_javascript_ajax) { - print ajax_constantonoff('PROPOSAL_PDF_HIDE_PAYMENTMODE'); - } else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("PROPOSAL_PDF_HIDE_PAYMENTMODE", $arrval, $conf->global->PROPOSAL_PDF_HIDE_PAYMENTMODE); - } - print '
    '.$langs->trans("MAIN_DOCUMENTS_WITH_PICTURE_WIDTH").''; - print ''; - print '
    '.$langs->trans("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING").''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING'); @@ -146,10 +121,10 @@ if (!empty($conf->propal->enabled)) { print $form->selectarray("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING", $arrval, $conf->global->MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING); } print '
    '; - print '
    '; + print ''; + print '
    '; } print '
    '; From 3a14cd7a1615488e160fb9dd672f55ff92740679 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 Oct 2021 19:32:28 +0200 Subject: [PATCH 0965/1460] Update admin.lang --- htdocs/langs/en_US/admin.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 6652d4de983..554cd00d31c 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1994,8 +1994,8 @@ MAIN_PDF_MARGIN_RIGHT=Right margin on PDF MAIN_PDF_MARGIN_TOP=Top margin on PDF MAIN_PDF_MARGIN_BOTTOM=Bottom margin on PDF MAIN_DOCUMENTS_LOGO_HEIGHT=Height for logo on PDF -MAIN_GENERATE_PROPOSALS_WITH_PICTURE=Add picture on proposal line -MAIN_DOCUMENTS_WITH_PICTURE_WIDTH=Width the picture in the line +MAIN_GENERATE_PROPOSALS_WITH_PICTURE=Add column for picture on proposal lines +MAIN_DOCUMENTS_WITH_PICTURE_WIDTH=Width of the column if a picture is added on lines MAIN_PDF_NO_SENDER_FRAME=Hide borders on sender address frame MAIN_PDF_NO_RECIPENT_FRAME=Hide borders on recipent address frame MAIN_PDF_HIDE_CUSTOMER_CODE=Hide customer code From 9f9c1d2f7b4d25c373b2e19808b2fd427baebac1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 Oct 2021 19:52:18 +0200 Subject: [PATCH 0966/1460] css --- htdocs/admin/index.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/index.php b/htdocs/admin/index.php index affedf1f43c..daf20ce5aa2 100644 --- a/htdocs/admin/index.php +++ b/htdocs/admin/index.php @@ -83,7 +83,8 @@ if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INF $setupcompanynotcomplete = 1; } print img_picto('', 'company', 'class="paddingright valignmiddle double"').' '.$langs->trans("SetupDescriptionLink", DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete) ? '' : '&action=edit&token='.newToken()), $langs->transnoentities("Setup"), $langs->transnoentities("MenuCompanySetup")); -print '

    '.$langs->trans("SetupDescription3b"); +print '

    '; +print $langs->trans("SetupDescription3b"); if (!empty($setupcompanynotcomplete)) { $langs->load("errors"); $warnpicto = img_warning($langs->trans("WarningMandatorySetupNotComplete"), 'style="padding-right: 6px;"'); @@ -92,6 +93,7 @@ if (!empty($setupcompanynotcomplete)) { print '
    '; print '
    '; print '
    '; +print '
    '; // Show info setup module print img_picto('', 'cog', 'class="paddingright valignmiddle double"').' '.$langs->trans("SetupDescriptionLink", DOL_URL_ROOT.'/admin/modules.php?mainmenu=home', $langs->transnoentities("Setup"), $langs->transnoentities("Modules")); From 265f3d0ab03a43781c24250947d727bbc4fb5d07 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 Oct 2021 20:03:59 +0200 Subject: [PATCH 0967/1460] Fix css --- htdocs/public/members/new.php | 7 ++++--- htdocs/theme/eldy/global.inc.php | 2 +- htdocs/theme/md/style.css.php | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index b6498ca4032..d29d80cf5d4 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -523,6 +523,7 @@ print ''. print ''; print ''; print ''; +print ''; print '
    '; @@ -563,7 +564,7 @@ jQuery(document).ready(function () { print ''."\n"; - // Type +// Type if (empty($conf->global->MEMBER_NEWFORM_FORCETYPE)) { $listoftype = $adht->liste_array(); $tmp = array_keys($listoftype); @@ -596,7 +597,7 @@ if (empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY)) { // Company print ''."\n"; +print ''."\n"; // Title print ''."\n"; @@ -625,7 +626,7 @@ print ''."\n"; // Zip / Town print ''; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index de984d83076..4da2d71dfd7 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1549,7 +1549,7 @@ select.widthcentpercentminusxx, span.widthcentpercentminusxx:not(.select2-select height: 64px !important; } - .divmainbodylarge { margin-left: 20px !important; margin-right: 20px !important; } + .divmainbodylarge { margin-left: 10px !important; margin-right: 10px !important; } .tdoverflowonsmartphone { max-width: 0; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 0d8851208f6..261547992c0 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1576,7 +1576,7 @@ table[summary="list_of_modules"] .fa-cog { min-width: 150px !important; } - .divmainbodylarge { margin-left: 20px; margin-right: 20px; } + .divmainbodylarge { margin-left: 10px; margin-right: 10px; } .tdoverflowonsmartphone { max-width: 0; From 3c9d8d0d30817426a0561f2d494a21c3b3849d1d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 Oct 2021 20:44:03 +0200 Subject: [PATCH 0968/1460] Show status of MO on referring page of product. --- htdocs/product/stats/bom.php | 6 +++--- htdocs/product/stats/mo.php | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/product/stats/bom.php b/htdocs/product/stats/bom.php index 52eec409185..ef4923e89be 100644 --- a/htdocs/product/stats/bom.php +++ b/htdocs/product/stats/bom.php @@ -261,14 +261,14 @@ if ($id > 0 || !empty($ref)) { } print '
    '; - print '
    '.$langs->trans("Company").''; print img_picto('', 'company', 'class="pictofixedwidth"'); -print '
    '.$langs->trans('UserTitle').''; print $formcompany->select_civility(GETPOST('civility_id'), 'civility_id').'
    '.$langs->trans("Address").''."\n"; print '
    '.$langs->trans('Zip').' / '.$langs->trans('Town').''; -print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6, 1); +print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 0, 1, '', 'width75'); print ' / '; print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); print '
    '; + print '
    '; print ''; print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "b.rowid", "", "&id=".$product->id, '', $sortfield, $sortorder); print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "b.date_valid", "", "&id=".$product->id, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("RowMaterial", $_SERVER["PHP_SELF"], "", "", "&id=".$product->id, '', $sortfield, $sortorder, 'center '); print_liste_field_titre("Finished", $_SERVER["PHP_SELF"], "", "", "&id=".$product->id, '', $sortfield, $sortorder, 'center '); - print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "b.status", "", "&id=".$product->id, '', $sortfield, $sortorder, 'center '); + print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "b.status", "", "&id=".$product->id, '', $sortfield, $sortorder, 'right '); print "\n"; if (!empty($bom_data_result)) { @@ -281,7 +281,7 @@ if ($id > 0 || !empty($ref)) { print $data['date_valid'].""; print ''; print ''; - print ''; + print ''; print "\n"; } print '
    '.$data['qty_toconsume'].''.$data['qty_toproduce'].''.$data['status'].''.$data['status'].'
    '; diff --git a/htdocs/product/stats/mo.php b/htdocs/product/stats/mo.php index 9ad400fe0de..c63034e95a6 100644 --- a/htdocs/product/stats/mo.php +++ b/htdocs/product/stats/mo.php @@ -183,7 +183,7 @@ if ($id > 0 || !empty($ref)) { print ''; } - print_barre_liste($langs->trans("Mos"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1); + print_barre_liste($langs->trans("MOs"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1); if (!empty($page)) { $option .= '&page='.urlencode($page); @@ -202,6 +202,7 @@ if ($id > 0 || !empty($ref)) { print_liste_field_titre("QtyAlreadyConsumed", $_SERVER["PHP_SELF"], "", "", "&id=".$product->id, '', $sortfield, $sortorder, 'center '); print_liste_field_titre("QtyToProduce", $_SERVER["PHP_SELF"], "", "", "&id=".$product->id, '', $sortfield, $sortorder, 'center '); print_liste_field_titre("QtyAlreadyProduced", $_SERVER["PHP_SELF"], "", "", "&id=".$product->id, '', $sortfield, $sortorder, 'center '); + print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "b.status", "", "&id=".$product->id, '', $sortfield, $sortorder, 'right '); print "\n"; $motmp = new Mo($db); @@ -212,6 +213,7 @@ if ($id > 0 || !empty($ref)) { $motmp->id = $objp->rowid; $motmp->ref = $objp->ref; + $motmp->status = $objp->status; print ''; print ''; @@ -226,6 +228,7 @@ if ($id > 0 || !empty($ref)) { print ''.($objp->nb_toproduce > 0 ? $objp->nb_toproduce : '').''; print ''.($objp->nb_produced > 0 ? $objp->nb_produced : '').''; //$mostatic->LibStatut($objp->statut,5).''; + print ''.$motmp->getLibStatut(2).''; print "\n"; $i++; } From 12d211815bc019a1a95a070106e74c8f2b1d5d9a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 Oct 2021 21:38:36 +0200 Subject: [PATCH 0969/1460] Debug v15 --- htdocs/comm/propal/card.php | 9 ++-- htdocs/commande/card.php | 64 ++++++++++++------------- htdocs/core/class/html.form.class.php | 3 +- htdocs/core/lib/functions.lib.php | 18 +++---- htdocs/core/lib/product.lib.php | 10 ++-- htdocs/expedition/shipment.php | 68 +++++++++++++-------------- 6 files changed, 88 insertions(+), 84 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index cff5c5d0e35..4e3f0e6ffde 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2192,9 +2192,10 @@ if ($action == 'create') { // Delivery delay print ''; print ''; if ($action != 'editavailability' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) { @@ -2356,13 +2357,13 @@ if ($action == 'create') { if ($totalWeight) { print ''; print ''; } if ($totalVolume) { print ''; print ''; } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 2195f88f13c..8aef94d2a7c 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1646,13 +1646,19 @@ if ($action == 'create' && $usercancreate) { print "\n"; print ''; + // Delivery delay + print ''; + // Terms of the settlement print ''; - // Mode de reglement + // Payment mode print ''; } - // Delivery delay - print ''; - // Shipping Method if (!empty($conf->expedition->enabled)) { print ''; print ''; + // Delivery delay + print ''; + // Shipping Method if (!empty($conf->expedition->enabled)) { print ''; } + // Source reason (why we have an order) + print ''; + // Terms of payment print ''; - - // Source reason (why we have an ordrer) - print ''; - // TODO Order mode (how we receive order). Not yet implemented /* print ''; print ''; @@ -394,6 +394,23 @@ if ($id > 0 || !empty($ref)) { //print ''; print ''; + // Delivery delay + print ''; + // Shipping Method print ''; print ''; } From f4743c7f1f1d69b6da3d5502122cb392d8e6d47f Mon Sep 17 00:00:00 2001 From: daraelmin Date: Tue, 19 Oct 2021 23:00:36 +0200 Subject: [PATCH 0972/1460] Fix wrong const in select MEMBER_ALLOW_CHANGE_OF_TYPE --- htdocs/adherents/admin/member.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/admin/member.php b/htdocs/adherents/admin/member.php index 018498c2457..f9e5388d735 100644 --- a/htdocs/adherents/admin/member.php +++ b/htdocs/adherents/admin/member.php @@ -228,7 +228,7 @@ print "\n"; // Allow members to change type on renewal forms /* To test during next beta print '\n"; */ From dc465d6bac949520ffbcb6fc48f38b25f925ae76 Mon Sep 17 00:00:00 2001 From: daraelmin Date: Wed, 20 Oct 2021 00:29:46 +0200 Subject: [PATCH 0973/1460] Fix adhtype amount as default on new subscription --- htdocs/adherents/subscription.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 17ac089670b..8d9fe0a5946 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -963,7 +963,7 @@ if ($rowid > 0) { if ($adht->subscription) { // Amount - print ''; + print ''; // Label print ''; From 2ca0a1facf2e82fc76983d6613238badbb4f0b57 Mon Sep 17 00:00:00 2001 From: javieralapps4up Date: Wed, 20 Oct 2021 00:36:24 +0200 Subject: [PATCH 0974/1460] Update date.lib.php --- htdocs/core/lib/date.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 613533a443a..ac91ea3065e 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -117,7 +117,7 @@ function getServerTimeZoneInt($refgmtdate = 'now') * @param int $duration_unit Unit of added delay (d, m, y, w, h, i) * @return int New timestamp */ -function dol_time_plus_duree($time, $duration_value, $duration_unit) +function dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth = 0) { global $conf; @@ -167,7 +167,7 @@ function dol_time_plus_duree($time, $duration_value, $duration_unit) $date->add($interval); } //Change the behavior of PHP over data-interval when the result of this function is Feb 29 (non-leap years), 30 or Feb 31 (php returns March 1, 2 or 3 respectively) - if ($conf->global->MAIN_DATE_CHANGE_PHP_DATEINTERVAL_RESULT_FEBRUARY && $duration_unit == 'm') { + if ($ruleforendofmonth == 1 && $duration_unit == 'm') { $timeyear = dol_print_date($time, '%Y'); $timemonth = dol_print_date($time, '%m'); $timetotalmonths = (($timeyear * 12) + $timemonth); From 63fafdf1206d1967b28a1612037bc6db4007a866 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 20 Oct 2021 07:54:09 +0200 Subject: [PATCH 0975/1460] FIX Expense report - In edit mode, field qty doesn't accept decimal unlike the create mode --- htdocs/expensereport/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 5f924cbbaa2..1be72b5b49b 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -2,7 +2,7 @@ /* Copyright (C) 2003 Rodolphe Quiedeville * Copyright (C) 2004-2020 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2015-2017 Alexandre Spangaro + * Copyright (C) 2015-2021 Alexandre Spangaro * Copyright (C) 2017 Ferran Marcet * Copyright (C) 2018 Frédéric France * @@ -2282,7 +2282,7 @@ if ($action == 'create') { // Quantity print ''; //print ''; From 2ae38ff1a99f47710c47f7f2fa5029073f1cacaa Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Wed, 20 Oct 2021 10:15:31 +0200 Subject: [PATCH 0976/1460] FIX : Travis --- htdocs/bom/tpl/objectline_view.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index 2fa8b3c70dc..8256019bd98 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -241,7 +241,7 @@ if ($resql) { $total_cost.= $sub_bom_product->pmp * $line->qty; } else { // Minimum purchase price if cost price and PMP aren't defined $sql_supplier_price = 'SELECT MIN(price) AS min_price FROM '.MAIN_DB_PREFIX.'product_fournisseur_price'; - $sql_supplier_price.= ' WHERE fk_product = '.$sub_bom_product->id; + $sql_supplier_price.= ' WHERE fk_product = '. (int) $sub_bom_product->id; $resql_supplier_price = $object->db->query($sql_supplier_price); if ($resql_supplier_price) { $obj = $object->db->fetch_object($resql_supplier_price); From 289f90fb1e5afaf6c0f1ef8d1d2e3bbcb48f4746 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 20 Oct 2021 11:05:40 +0200 Subject: [PATCH 0977/1460] Fix qty must not use html type "number" but "text" (need decimal values) --- htdocs/fourn/commande/dispatch.php | 2 +- htdocs/multicurrency/multicurrency_rate.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 09588389cb1..0df79fce096 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -1219,7 +1219,7 @@ if ($id > 0 || !empty($ref)) { // Qty print ''; print ''; - print ' '; + print ' '; print ''; + print ''; // Label print ''; From a3d81f0ddda4c237740645433d326026ad2565ee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 20 Oct 2021 16:05:13 +0200 Subject: [PATCH 0987/1460] Move module as stable --- htdocs/core/modules/modKnowledgeManagement.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modKnowledgeManagement.class.php b/htdocs/core/modules/modKnowledgeManagement.class.php index afd20a94a04..d4f0187432a 100644 --- a/htdocs/core/modules/modKnowledgeManagement.class.php +++ b/htdocs/core/modules/modKnowledgeManagement.class.php @@ -68,7 +68,7 @@ class modKnowledgeManagement extends DolibarrModules $this->descriptionlong = "Manage a Knowledge Management (KM) or Help-Desk base"; // Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z' - $this->version = 'experimental'; + $this->version = 'dolibarr'; // Url to the file with your last numberversion of this module //$this->url_last_version = 'http://www.example.com/versionmodule.txt'; From eed689e1c188524deb4a048cda83f020cd66954b Mon Sep 17 00:00:00 2001 From: daraelmin Date: Wed, 20 Oct 2021 16:33:38 +0200 Subject: [PATCH 0988/1460] quote instead double quote --- htdocs/adherents/subscription.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 8f6fa4af34e..1316a337610 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -963,7 +963,7 @@ if ($rowid > 0) { if ($adht->subscription) { // Amount - print ''; + print ''; // Label print ''; From e8e63e85f13a5615318d8cd439d1f8047042100b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 20 Oct 2021 17:08:33 +0200 Subject: [PATCH 0989/1460] NEW: Editing a page in website module keep old page with name .back --- ChangeLog | 124 ++++++++++++++++++++++++++++++++++++++- htdocs/website/index.php | 8 +-- 2 files changed, 127 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index c447ac36cbf..2d957f1dbb2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,11 +5,133 @@ English Dolibarr ChangeLog ***** ChangeLog for 15.0.0 compared to 14.0.0 ***** +For users: +--------------- + +NEW: Online proposal signature +NEW: Allow the use of __NEWREF__ to get for example the new reference a draft order will get after validation. +NEW: #18326 Workflow: Close order on shipment closing. +NEW: #18401 Add __NEWREF__ subtitute to get new object reference. +NEW: #18403 Add __URL_SHIPMENT__ substitute to get the URL of a shipment +NEW: #18689 REST API module: add api key generate / modify right. +NEW: #18663 Make "L'Annuaire des Entreprises" the default provider for SIREN verification for French thirdparties. +NEW: #18046 Add tags on ticket/categories +NEW: #18326 Workflow: Close order on shipment closing. +NEW: #18770 Can enter the buying price (for Weighted Average Price update) on lines during the reception step +NEW: #18814 Add legal form for Sweden +NEW: #18820 Accountancy - Add product account in import/export of thirdparty (level 3) +NEW: Accountancy - Format FEC/FEC2 - Add column NumFacture +NEW: Add $dolibarr_main_db_readonly in conf.php for readonly access. +NEW: add auto creation of agenda event on supplier_order cancellation +NEW: Add a PDF document template for Manufacturing Orders +NEW: Add budget field into task #18986 +NEW: add cancel button to `classify reception` form on supplier_orders +NEW: Added address field into contacts list +NEW: Added documents page and send mail possibility in payments +NEW: Add edit option in propal +NEW: Added linked files page and send mail possibility in payments +NEW: Add field date from/to in customer and supplier payment list +NEW: Add filter from date to date into action/evt list +NEW: Add import / export of MO and BOMLines - Close #18499 +NEW: Adding accounting export model for iSuite Expert +NEW: add link to an element by ref +NEW: add missing printFieldListFrom hook call on several lists +NEW: add MRP into Object Linked Box +NEW: Add option to hide customer code on PDF documents +NEW: Add param $nolog to avoid logging into dol_delete_recursive_dir() +NEW: Add sale representative in order and invoice list +NEW: add a setting to create PDF in PDF/A - 1b format #18990 +NEW: Add `SOCIETE_SHOW_VAT_IN_LIST` to display VAT number in combo list of thirdparties +NEW: Add sortorder on units list +NEW: Adds PDF_HIDE_PRODUCT_LABEL_IN_SUPPLIER_LINES to hide product label in supplier order lines +NEW: Add STOCK_MOVEMENT_LIST_HIDE_UNIT_PRICE to hide unit price on some pages +NEW: add support for zstd compression +NEW: Allow drag and drop on kits +NEW: Allow exporting supplier order validation date + validation user +NEW: Allows product ref generation after the form is validated with PRODUCT_GENERATE_REF_AFTER_FORM +NEW: autocomplete account group when editing an account card +NEW: Auto create invoice for payment done on an order with online payment link of order +NEW: Can edit fields of proposal when proposal is not yet signed +NEW: Can edit the translation key of an overwrote translation key. +NEW: can enable/disable external calendar by default +NEW: Can hide sender name on PDF documents +NEW: Can select lot from a combo list of existing batch numbers (in MRP consumtion) +NEW: Can set the default BOM on a product +NEW: Can set/unset the usual working day of the week (friday, saturday, sunday) +NEW: Can show progression of task into combo list of tasks +NEW: can upload the odt file for the product doc template +NEW: Contract - Add From/to input on search date +NEW: Customer Display with TakePOS +NEW: Split Sale in TakePOS +NEW: Customer invoice template list - Add input date from/to +NEW: date filter on project list and task list From->To +NEW: display shipping method and tracking url on shipment list +NEW: expense reports: conf to force amounts to be entered only including taxes +NEW: expense reports: conf to pre-fill start/end dates with bounds of current month +NEW: expense reports: show link to already existing overlapping expense report +NEW: expense reports: can make project field mandatory on lines +NEW: Expose bank account holder, label and number +NEW: feature #18986 +NEW: field and behavior in product object +NEW: generate intervention from time spent +NEW: holiday: handle monthly balance updates with cronjob +NEW: HRM integration, source code +NEW: HRM admin - Add tabs +NEW: HRM - Include more options to manage/custom dashboard +NEW: Increase size of params of actions for emailcollector +NEW: Invoice list - Use complete country select field with EEC or not +NEW: mass action delete, no more break if at least one object has child +NEW: mass action paid on customer invoice list +NEW: massaction validate on supplier orders list +NEW: Mass action send email to all attendees of an event. +NEW: expense reports: conf to pre-fill start/end dates with bounds of current month +NEW: Option "Add a link on the PDF to make the online payment" +NEW: More options to generate PDF (show Frame option, width of picture option) +NEW: Preview of pdf files of expense report lines +NEW: print without details +NEW: project time spent: conf to prevent recording time after X months +NEW: rewrite bind accountancy code finding on customer and sales invoice +NEW: Societe - Add perentity functionality on customer/supplier accountancy auxiliary account +NEW: Survey - Add a clickable link in email send +NEW: Social Contributions - Add from/to filter on list +NEW: Supplier order and proposal - Add From/to input on search date +NEW: Task - Add From/to input on search date +NEW: Add theme option THEME_ELDY_USEBORDERONTABLE +NEW: The Anti-CSRF protection MAIN_SECURITY_CSRF_WITH_TOKEN is on to value 1 by default +NEW: Update SQL : install and migration +NEW: Use an ajax call for the clicktodial feature instead of href link. +NEW: when multiple order linked to facture, show list into note. +NEW: when we delete several objects with massaction, if somes object has child we must see which objects are concerned and nevertheless delete objects which can be deleted +NEW: Editing a page in website module keep old page with name .back + + For developers: --------------- -WARNING: +NEW: Introduce method hasRight +NEW: Can use textarea field into a confirm popup. +NEW: Can use the result_mode of mysqli driver. Save memory for list count +NEW: #18319 REST API - Shipment: Add 'close' action / endpoint / POST method. +NEW: add action trigger for member excluded +NEW: add option MAIN_IBAN_IS_NEVER_MANDATORY, MAIN_IBAN_NOT_MANDATORY, PROPAL_NOT_BILLABLE, PROPAL_REOPEN_UNSIGNED_ONLY, PROPOSAL_ARE_NOT_BILLABLE, TICKETS_MESSAGE_FORCE_MAIL +NEW: Add code codebar column on serial/lot structure +NEW: Add date_valid and date_approve columns in the list of supplier orders +NEW: add hook `beforeBodyClose` +NEW: Add hook hookGetEntity. +NEW: add hookmanager on note pages +NEW: add hook 'menuLeftMenuItems' to filter the leftmenu items +NEW: Add the property "copytoclipboard" in modulebuilder +NEW: api for knowledgemanagement +NEW: API get list of legal form of business +NEW: API list of staff units +NEW: hook after rank update +NEW: printFieldListFrom hook call on several lists +NEW: Use lang selector when using a field key 'lang' in modulebuilder +NEW: we need to be able to put more filters on deleteByParentField() function +NEW: make it easier to set the `keyword`, `keywords` and `description` attributes of an ecm file object + + Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: * Update hook 'printOriginObjectLine', removed check on product type and special code. Need now reshook. * Old deprecated module "SimplePOS" has been completely removed. Use module "TakePOS" is you need a Point Of Sale. diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 9139141c283..78f3e3de232 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -515,7 +515,7 @@ if ($massaction == 'replace' && GETPOST('confirmmassaction', 'alpha') && $userca } // Save page of content - $result = dolSavePageContent($filetpl, $object, $objectpage); + $result = dolSavePageContent($filetpl, $object, $objectpage, 1); if ($result) { $nbreplacement++; //var_dump($objectpage->content);exit; @@ -1107,7 +1107,7 @@ if ($action == 'addcontainer' && $usercanedit) { } // Save page of content - $result = dolSavePageContent($filetpl, $object, $objectpage); + $result = dolSavePageContent($filetpl, $object, $objectpage, 1); if ($result) { setEventMessages($langs->trans("Saved"), null, 'mesgs'); } else { @@ -1850,7 +1850,7 @@ if ($action == 'updatemeta' && $usercanedit) { // Save page of content - $result = dolSavePageContent($filetpl, $object, $objectpage); + $result = dolSavePageContent($filetpl, $object, $objectpage, 1); if ($result) { setEventMessages($langs->trans("Saved"), null, 'mesgs'); @@ -1945,7 +1945,7 @@ if ($usercanedit && (($action == 'updatesource' || $action == 'updatecontent' || //var_dump($filetpl); //exit; - dolSavePageContent($filetpl, $tmpwebsite, $resultpage); + dolSavePageContent($filetpl, $tmpwebsite, $resultpage, 1); // Switch on the new page if web site of new page/container is same if (empty($newwebsiteid) || $newwebsiteid == $object->id) { From 3029804db7837bb584ececb247a0afb5e5461c67 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 20 Oct 2021 19:21:18 +0200 Subject: [PATCH 0990/1460] FIX compatibility with Multicompany --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 2 ++ htdocs/install/mysql/tables/llx_c_socialnetworks.key.sql | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index d6e21f17aeb..03110b4425e 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -627,3 +627,5 @@ CREATE TABLE llx_onlinesignature ALTER TABLE llx_facture_fourn CHANGE COLUMN fk_mode_transport fk_transport_mode integer; +ALTER TABLE llx_c_socialnetworks DROP INDEX idx_c_socialnetworks_code; +ALTER TABLE llx_c_socialnetworks ADD UNIQUE INDEX idx_c_socialnetworks_code_entity (code, entity); diff --git a/htdocs/install/mysql/tables/llx_c_socialnetworks.key.sql b/htdocs/install/mysql/tables/llx_c_socialnetworks.key.sql index 2b7dcdc9d4e..ee48185e187 100644 --- a/htdocs/install/mysql/tables/llx_c_socialnetworks.key.sql +++ b/htdocs/install/mysql/tables/llx_c_socialnetworks.key.sql @@ -16,4 +16,4 @@ -- ======================================================================== -ALTER TABLE llx_c_socialnetworks ADD UNIQUE INDEX idx_c_socialnetworks_code (code); +ALTER TABLE llx_c_socialnetworks ADD UNIQUE INDEX idx_c_socialnetworks_code_entity (code, entity); From 0756a0100251cab1947742d7f47037afd7155ab4 Mon Sep 17 00:00:00 2001 From: JC Prieto Date: Wed, 20 Oct 2021 19:33:28 +0200 Subject: [PATCH 0991/1460] Fix card.php Error adding localtax --- htdocs/compta/localtax/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/localtax/card.php b/htdocs/compta/localtax/card.php index 451007932d7..4cffc5c85db 100644 --- a/htdocs/compta/localtax/card.php +++ b/htdocs/compta/localtax/card.php @@ -64,7 +64,7 @@ if ($cancel && !$id) { exit; } -if ($action == 'add' && $cancel) { +if ($action == 'add' && !$cancel) { $db->begin(); $datev = dol_mktime(12, 0, 0, GETPOST("datevmonth"), GETPOST("datevday"), GETPOST("datevyear")); From 4b2b2328c35b7250128e754089086275d1c48683 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 20 Oct 2021 21:33:18 +0200 Subject: [PATCH 0992/1460] FIX missing sql filter by entity --- htdocs/admin/dict.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 9933c94876d..77b51d9a197 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -220,7 +220,7 @@ $tabsql[21] = "SELECT c.rowid as rowid, c.code, c.label, c.active, c.position FR $tabsql[22] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_input_reason"; $tabsql[23] = "SELECT t.rowid as rowid, t.taux, t.revenuestamp_type, c.label as country, c.code as country_code, t.fk_pays as country_id, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_revenuestamp as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_pays=c.rowid"; $tabsql[24] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_type_resource"; -$tabsql[25] = "SELECT rowid as rowid, code, label, active, module FROM ".MAIN_DB_PREFIX."c_type_container as t WHERE t.entity IN (".getEntity('c_type_container').")"; +$tabsql[25] = "SELECT rowid as rowid, code, label, active, module FROM ".MAIN_DB_PREFIX."c_type_container as t WHERE t.entity IN (".getEntity($tabname[25]).")"; //$tabsql[26]= "SELECT rowid as rowid, code, label, short_label, active FROM ".MAIN_DB_PREFIX."c_units"; $tabsql[27] = "SELECT id as rowid, code, libelle, picto, active FROM ".MAIN_DB_PREFIX."c_stcomm"; $tabsql[28] = "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.newByMonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid"; @@ -233,7 +233,7 @@ $tabsql[34] = "SELECT rowid, pos, code, label, c_level, active FROM ".MAIN_DB_PR $tabsql[35] = "SELECT c.rowid, c.label, c.active, c.entity FROM ".MAIN_DB_PREFIX."c_exp_tax_cat c"; $tabsql[36] = "SELECT r.rowid, r.fk_c_exp_tax_cat, r.range_ik, r.active, r.entity FROM ".MAIN_DB_PREFIX."c_exp_tax_range r"; $tabsql[37] = "SELECT r.rowid, r.code, r.label, r.short_label, r.unit_type, r.scale, r.active FROM ".MAIN_DB_PREFIX."c_units r"; -$tabsql[38] = "SELECT rowid, entity, code, label, url, icon, active FROM ".MAIN_DB_PREFIX."c_socialnetworks"; +$tabsql[38] = "SELECT s.rowid, s.entity, s.code, s.label, s.url, s.icon, s.active FROM ".MAIN_DB_PREFIX."c_socialnetworks as s WHERE s.entity IN (".getEntity($tabname[38]).")"; $tabsql[39] = "SELECT code, label as libelle, sortorder, active FROM ".MAIN_DB_PREFIX."c_prospectcontactlevel"; $tabsql[40] = "SELECT id as rowid, code, libelle, picto, active FROM ".MAIN_DB_PREFIX."c_stcommcontact"; $tabsql[41] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_transport_mode"; From 02bb39d4384933a052e38e551f73c6c7b109d985 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Thu, 21 Oct 2021 05:06:50 +0200 Subject: [PATCH 0993/1460] FIX Accountancy simplified - Salaries are not present in report --- htdocs/compta/resultat/clientfourn.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index f2f192271ac..0b38a8f66c9 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -862,7 +862,8 @@ if ($modecompta == 'BOOKKEEPING') { $sql = "SELECT u.rowid, u.firstname, u.lastname, p.fk_user, p.label as label, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount"; $sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as p"; - $sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."salary as s ON s.rowid=p.fk_salary"; + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=s.fk_user"; $sql .= " WHERE p.entity IN (".getEntity('payment_salary').")"; if (!empty($date_start) && !empty($date_end)) { $sql .= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'"; From be7c1c8a235a58ca8300cd7b0c765fc7010e85b2 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Thu, 21 Oct 2021 05:18:56 +0200 Subject: [PATCH 0994/1460] Typo & translation --- htdocs/compta/resultat/clientfourn.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 0b38a8f66c9..2de55d1801f 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -9,6 +9,7 @@ * Copyright (C) 2014 Florian Henry * Copyright (C) 2018 Frédéric France * Copyright (C) 2020 Maxime DEMAREST + * Copyright (C) 2021 Alexandre Spangaro * * 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 @@ -366,7 +367,7 @@ if ($modecompta == 'BOOKKEEPING') { } } else { /* - * Factures clients + * Customer invoices */ print ''; @@ -386,8 +387,8 @@ if ($modecompta == 'BOOKKEEPING') { } } elseif ($modecompta == 'RECETTES-DEPENSES') { /* - * Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les - * vieilles versions, ils n'etaient pas lies via paiement_facture. On les ajoute plus loin) + * List of payments (old payments are not seen by this query because, on older versions, they were not linked via payment_invoice. + * old versions, they were not linked via payment_invoice. They are added later) */ $sql = "SELECT s.nom as name, s.rowid as socid, sum(pf.amount) as amount_ttc"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; @@ -434,7 +435,7 @@ if ($modecompta == 'BOOKKEEPING') { dol_print_error($db); } - // On ajoute les paiements clients anciennes version, non lie par paiement_facture + // We add the old customer payments, not linked by payment_invoice if ($modecompta == 'RECETTES-DEPENSES') { $sql = "SELECT 'Autres' as name, '0' as idp, sum(p.amount) as amount_ttc"; $sql .= " FROM ".MAIN_DB_PREFIX."bank as b"; @@ -673,7 +674,7 @@ if ($modecompta == 'BOOKKEEPING') { /* - * Charges sociales non deductibles + * Social / Fiscal contributions who are not deductible */ print ''; @@ -760,7 +761,7 @@ if ($modecompta == 'BOOKKEEPING') { /* - * Charges sociales deductibles + * Social / Fiscal contributions who are deductible */ print ''; @@ -932,7 +933,7 @@ if ($modecompta == 'BOOKKEEPING') { /* - * Expense + * Expense report */ if (!empty($conf->expensereport->enabled)) { @@ -1088,7 +1089,7 @@ if ($modecompta == 'BOOKKEEPING') { } /* - * Payement Loan + * Payment Loan */ if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_LOAN) && !empty($conf->loan->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { @@ -1209,7 +1210,7 @@ if ($modecompta == 'BOOKKEEPING') { print '\n"; print "\n"; - // VAT to retreive + // VAT to retrieve $amount = 0; $sql = "SELECT date_format(f.datef,'%Y-%m') as dm, sum(f.total_tva) as amount"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; From a1c0e1ad1f4fae5d30c929e6b042450b655a2bcb Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Thu, 21 Oct 2021 05:45:37 +0200 Subject: [PATCH 0995/1460] Better fix with backward compatibility with old salary module --- htdocs/compta/resultat/clientfourn.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 2de55d1801f..e5984e527ae 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -869,8 +869,19 @@ if ($modecompta == 'BOOKKEEPING') { if (!empty($date_start) && !empty($date_end)) { $sql .= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'"; } + $sql .= " GROUP BY u.rowid, u.firstname, u.lastname, s.fk_user, p.label, dm"; + // For backward compatibility with old module salary + $sql .= " UNION "; + $sql .= " SELECT u.rowid, u.firstname, u.lastname, p.fk_user, p.label as label, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount"; + $sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as p"; + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user"; + $sql .= " WHERE p.entity IN (".getEntity('payment_salary').")"; + if (!empty($date_start) && !empty($date_end)) { + $sql .= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'"; + } $sql .= " GROUP BY u.rowid, u.firstname, u.lastname, p.fk_user, p.label, dm"; + $newsortfield = $sortfield; if ($newsortfield == 's.nom, s.rowid') { $newsortfield = 'u.firstname, u.lastname'; From d2b96fe0f64a7bf3563ece5fe3c8051ad8a1398c Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Thu, 21 Oct 2021 06:08:48 +0200 Subject: [PATCH 0996/1460] Correct link to salary list with user search --- htdocs/compta/resultat/clientfourn.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index e5984e527ae..1d2edd5c918 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -34,6 +34,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; +require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; @@ -861,7 +862,7 @@ if ($modecompta == 'BOOKKEEPING') { $column = 'p.datep'; } - $sql = "SELECT u.rowid, u.firstname, u.lastname, p.fk_user, p.label as label, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount"; + $sql = "SELECT u.rowid, u.firstname, u.lastname, s.fk_user as fk_user, p.label as label, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount"; $sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as p"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."salary as s ON s.rowid=p.fk_salary"; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=s.fk_user"; @@ -873,7 +874,7 @@ if ($modecompta == 'BOOKKEEPING') { // For backward compatibility with old module salary $sql .= " UNION "; - $sql .= " SELECT u.rowid, u.firstname, u.lastname, p.fk_user, p.label as label, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount"; + $sql .= " SELECT u.rowid, u.firstname, u.lastname, p.fk_user as fk_user, p.label as label, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount"; $sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as p"; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user"; $sql .= " WHERE p.entity IN (".getEntity('payment_salary').")"; @@ -913,7 +914,10 @@ if ($modecompta == 'BOOKKEEPING') { print ''; - print "\n"; + $userstatic = new User($db); + $userstatic->fetch($obj->fk_user); + + print "\n"; if ($modecompta == 'CREANCES-DETTES') { print ''; From 71b9ac384f6c7503f876175e533afbcacc529823 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 21 Oct 2021 08:43:20 +0200 Subject: [PATCH 0997/1460] FIX only ones value is return for dictionaries --- htdocs/admin/dict.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 77b51d9a197..eab0942ee4e 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -220,7 +220,7 @@ $tabsql[21] = "SELECT c.rowid as rowid, c.code, c.label, c.active, c.position FR $tabsql[22] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_input_reason"; $tabsql[23] = "SELECT t.rowid as rowid, t.taux, t.revenuestamp_type, c.label as country, c.code as country_code, t.fk_pays as country_id, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_revenuestamp as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_pays=c.rowid"; $tabsql[24] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_type_resource"; -$tabsql[25] = "SELECT rowid as rowid, code, label, active, module FROM ".MAIN_DB_PREFIX."c_type_container as t WHERE t.entity IN (".getEntity($tabname[25]).")"; +$tabsql[25] = "SELECT rowid as rowid, code, label, active, module FROM ".MAIN_DB_PREFIX."c_type_container as t WHERE t.entity = ".getEntity($tabname[25]); //$tabsql[26]= "SELECT rowid as rowid, code, label, short_label, active FROM ".MAIN_DB_PREFIX."c_units"; $tabsql[27] = "SELECT id as rowid, code, libelle, picto, active FROM ".MAIN_DB_PREFIX."c_stcomm"; $tabsql[28] = "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.newByMonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid"; @@ -233,7 +233,7 @@ $tabsql[34] = "SELECT rowid, pos, code, label, c_level, active FROM ".MAIN_DB_PR $tabsql[35] = "SELECT c.rowid, c.label, c.active, c.entity FROM ".MAIN_DB_PREFIX."c_exp_tax_cat c"; $tabsql[36] = "SELECT r.rowid, r.fk_c_exp_tax_cat, r.range_ik, r.active, r.entity FROM ".MAIN_DB_PREFIX."c_exp_tax_range r"; $tabsql[37] = "SELECT r.rowid, r.code, r.label, r.short_label, r.unit_type, r.scale, r.active FROM ".MAIN_DB_PREFIX."c_units r"; -$tabsql[38] = "SELECT s.rowid, s.entity, s.code, s.label, s.url, s.icon, s.active FROM ".MAIN_DB_PREFIX."c_socialnetworks as s WHERE s.entity IN (".getEntity($tabname[38]).")"; +$tabsql[38] = "SELECT s.rowid, s.entity, s.code, s.label, s.url, s.icon, s.active FROM ".MAIN_DB_PREFIX."c_socialnetworks as s WHERE s.entity = ".getEntity($tabname[38]); $tabsql[39] = "SELECT code, label as libelle, sortorder, active FROM ".MAIN_DB_PREFIX."c_prospectcontactlevel"; $tabsql[40] = "SELECT id as rowid, code, libelle, picto, active FROM ".MAIN_DB_PREFIX."c_stcommcontact"; $tabsql[41] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_transport_mode"; From 806c53d4c4c343299ffe4e6690f2889a9d50c2d8 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Thu, 21 Oct 2021 09:49:14 +0200 Subject: [PATCH 0998/1460] FIX Ret PR --- htdocs/core/class/commonobject.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 50c6f1893ea..a4fc828ef4b 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5745,6 +5745,11 @@ abstract class CommonObject $this->array_options["options_".$key] = $this->db->idate($this->array_options["options_".$key]); } break; + case 'boolean': + if (empty($this->array_options["options_".$key])) { + $this->array_options["options_".$key] = null; + } + break; /* case 'link': $param_list = array_keys($attributeParam['options']); @@ -5791,7 +5796,7 @@ abstract class CommonObject } if ($linealreadyfound) { - if ($this->array_options["options_".$key] === '') { + if ($this->array_options["options_".$key] === null) { $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element."_extrafields SET ".$key." = null"; } else { $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element."_extrafields SET ".$key." = '".$this->db->escape($this->array_options["options_".$key])."'"; From 054388be0101b73225c75040c679cf0d593bf501 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 11:45:36 +0200 Subject: [PATCH 0999/1460] doxygen --- htdocs/admin/hrm.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/hrm.php b/htdocs/admin/hrm.php index 2bcd4977716..8eb2f93c13c 100644 --- a/htdocs/admin/hrm.php +++ b/htdocs/admin/hrm.php @@ -20,7 +20,7 @@ */ /** - * \file hrm/admin/setup.php + * \file htdocs/admin/hrm.php * \ingroup hrm * \brief HrmTest setup page. */ From 197818684bfc7bb5fd5ba0ff1f3d502e59580484 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 11:47:32 +0200 Subject: [PATCH 1000/1460] doxygen --- htdocs/core/boxes/box_graph_new_vs_close_ticket.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/boxes/box_graph_new_vs_close_ticket.php b/htdocs/core/boxes/box_graph_new_vs_close_ticket.php index a4bf2d6990f..4b4f205bce8 100644 --- a/htdocs/core/boxes/box_graph_new_vs_close_ticket.php +++ b/htdocs/core/boxes/box_graph_new_vs_close_ticket.php @@ -2,7 +2,7 @@ /* Module descriptor for ticket system * Copyright (C) 2013-2016 Jean-François FERRY * 2016 Christophe Battarel - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2021 Frédéric France * * 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 @@ -19,7 +19,7 @@ */ /** - * \file core/boxes/box_nb_ticket_last_x_days.php + * \file hydocs/core/boxes/box_graph_new_vs_close_ticket.php * \ingroup ticket * \brief This box shows the number of new daily tickets the last X days */ From d41c1393ba98e27336c2b3cd1d8533887fea04d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 11:48:20 +0200 Subject: [PATCH 1001/1460] Update box_graph_new_vs_close_ticket.php --- htdocs/core/boxes/box_graph_new_vs_close_ticket.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_graph_new_vs_close_ticket.php b/htdocs/core/boxes/box_graph_new_vs_close_ticket.php index 4b4f205bce8..ce8d7ab0078 100644 --- a/htdocs/core/boxes/box_graph_new_vs_close_ticket.php +++ b/htdocs/core/boxes/box_graph_new_vs_close_ticket.php @@ -19,7 +19,7 @@ */ /** - * \file hydocs/core/boxes/box_graph_new_vs_close_ticket.php + * \file htdocs/core/boxes/box_graph_new_vs_close_ticket.php * \ingroup ticket * \brief This box shows the number of new daily tickets the last X days */ From bca3bcf8c936205f2a13221a3b4ae31e00eaa2ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 11:49:24 +0200 Subject: [PATCH 1002/1460] doxygen --- htdocs/core/boxes/box_graph_ticket_by_severity.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/boxes/box_graph_ticket_by_severity.php b/htdocs/core/boxes/box_graph_ticket_by_severity.php index 13cd0c40c86..5e69a49e88e 100644 --- a/htdocs/core/boxes/box_graph_ticket_by_severity.php +++ b/htdocs/core/boxes/box_graph_ticket_by_severity.php @@ -2,7 +2,7 @@ /* Module descriptor for ticket system * Copyright (C) 2013-2016 Jean-François FERRY * 2016 Christophe Battarel - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2021 Frédéric France * * 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 @@ -19,7 +19,7 @@ */ /** - * \file core/boxes/box_ticket_by_severity.php + * \file htdocs/core/boxes/box_graph_ticket_by_severity.php * \ingroup ticket * \brief This box shows open tickets by severity */ From 82b9dc6c87857fe4d1de90e6c2fa7623bd6fed9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 11:50:48 +0200 Subject: [PATCH 1003/1460] doxygen --- htdocs/core/modules/modEventOrganization.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modEventOrganization.class.php b/htdocs/core/modules/modEventOrganization.class.php index 8a3fb3d80cf..6ab1c8acb89 100644 --- a/htdocs/core/modules/modEventOrganization.class.php +++ b/htdocs/core/modules/modEventOrganization.class.php @@ -19,7 +19,7 @@ * \defgroup eventorganization Module EventOrganization * \brief EventOrganization module descriptor. * - * \file htdocs/eventorganization/core/modules/modEventOrganization.class.php + * \file htdocs/core/modules/modEventOrganization.class.php * \ingroup eventorganization * \brief Description and activation file for the EventOrganization */ From a528f8e98b9a6edcfce0bcb689cb091c67e3a1ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 11:52:18 +0200 Subject: [PATCH 1004/1460] doxygen --- htdocs/core/modules/modKnowledgeManagement.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modKnowledgeManagement.class.php b/htdocs/core/modules/modKnowledgeManagement.class.php index d4f0187432a..b3fb24aa7b3 100644 --- a/htdocs/core/modules/modKnowledgeManagement.class.php +++ b/htdocs/core/modules/modKnowledgeManagement.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2018-2019 Nicolas ZABOURI - * Copyright (C) 2019-2020 Frédéric France + * Copyright (C) 2019-2021 Frédéric France * Copyright (C) 2021 SuperAdmin * * This program is free software; you can redistribute it and/or modify @@ -22,7 +22,7 @@ * \defgroup knowledgemanagement Module KnowledgeManagement * \brief KnowledgeManagement module descriptor. * - * \file htdocs/knowledgemanagement/core/modules/modKnowledgeManagement.class.php + * \file htdocs/core/modules/modKnowledgeManagement.class.php * \ingroup knowledgemanagement * \brief Description and activation file for module KnowledgeManagement */ From a4555d6304d7e9382886282c3951ab2e52f78d1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 11:53:17 +0200 Subject: [PATCH 1005/1460] doxygen --- htdocs/core/modules/modPartnership.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modPartnership.class.php b/htdocs/core/modules/modPartnership.class.php index a036613fcec..87ce98abb4a 100644 --- a/htdocs/core/modules/modPartnership.class.php +++ b/htdocs/core/modules/modPartnership.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2018-2019 Nicolas ZABOURI - * Copyright (C) 2019-2020 Frédéric France + * Copyright (C) 2019-2021 Frédéric France * Copyright (C) 2021 Dorian Laurent * Copyright (C) 2021 NextGestion * @@ -23,7 +23,7 @@ * \defgroup partnership Module Partnership * \brief Partnership module descriptor. * - * \file htdocs/partnership/core/modules/modPartnership.class.php + * \file htdocs/core/modules/modPartnership.class.php * \ingroup partnership * \brief Description and activation file for module Partnership */ From a082dc65040480c7d397420db743cd4a67e24be1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 11:54:15 +0200 Subject: [PATCH 1006/1460] doxygen --- htdocs/core/modules/modRecruitment.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modRecruitment.class.php b/htdocs/core/modules/modRecruitment.class.php index 02e7cdfbf4c..239c48135d7 100644 --- a/htdocs/core/modules/modRecruitment.class.php +++ b/htdocs/core/modules/modRecruitment.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2018-2019 Nicolas ZABOURI - * Copyright (C) 2019-2020 Frédéric France + * Copyright (C) 2019-2021 Frédéric France * * 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 @@ -21,7 +21,7 @@ * \defgroup recruitment Module Recruitment * \brief Recruitment module descriptor. * - * \file htdocs/recruitment/core/modules/modRecruitment.class.php + * \file htdocs/core/modules/modRecruitment.class.php * \ingroup recruitment * \brief Description and activation file for the module Recruitment */ From d83485cc7b5db9c2afec77a826c33ef906a2616f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 11:55:24 +0200 Subject: [PATCH 1007/1460] doxygen --- htdocs/core/modules/modWorkstation.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modWorkstation.class.php b/htdocs/core/modules/modWorkstation.class.php index 3069be8ced5..38c5222401c 100755 --- a/htdocs/core/modules/modWorkstation.class.php +++ b/htdocs/core/modules/modWorkstation.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2018-2019 Nicolas ZABOURI - * Copyright (C) 2019-2020 Frédéric France + * Copyright (C) 2019-2021 Frédéric France * Copyright (C) 2020 Gauthier VERDOL * * This program is free software; you can redistribute it and/or modify @@ -22,7 +22,7 @@ * \defgroup workstation Module Workstation * \brief Workstation module descriptor. * - * \file htdocs/workstation/core/modules/modWorkstation.class.php + * \file htdocs/core/modules/modWorkstation.class.php * \ingroup workstation * \brief Description and activation file for the module Workstation */ From 89f4066eadbe54b12551b6ed54d0c524234d0028 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 11:57:02 +0200 Subject: [PATCH 1008/1460] doxygen --- htdocs/core/modules/mrp/doc/pdf_vinci.modules.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php index 5f6a03f2caa..d116976eb88 100644 --- a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php +++ b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php @@ -5,8 +5,8 @@ * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2015 Marcos García * Copyright (C) 2017 Ferran Marcet - * Copyright (C) 2018 Frédéric France - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2021 Frédéric France + * * 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 @@ -23,7 +23,7 @@ */ /** - * \file htdocs/core/modules/mrp/doc/pdf_vinci.php + * \file htdocs/core/modules/mrp/doc/pdf_vinci.modules.php * \ingroup mrp * \brief File of class to generate MO document from vinci model */ From c161eb198ef77cf9ff2fdd2c8ff7c645d47114b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 11:58:21 +0200 Subject: [PATCH 1009/1460] doxygen --- htdocs/intracommreport/admin/intracommreport.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/intracommreport/admin/intracommreport.php b/htdocs/intracommreport/admin/intracommreport.php index c696dddcabd..13231c43af2 100644 --- a/htdocs/intracommreport/admin/intracommreport.php +++ b/htdocs/intracommreport/admin/intracommreport.php @@ -17,7 +17,7 @@ */ /** - * \file htdocs/admin/intracommreport.php + * \file htdocs/intracommreport/admin/intracommreport.php * \ingroup intracommreport * \brief Page to setup the module intracomm report */ From c3e8f6d8b16351a5e71de5b106d6a681c5d8398b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 12:00:18 +0200 Subject: [PATCH 1010/1460] doxygen --- .../knowledgemanagement/mod_knowledgerecord_advanced.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_advanced.php b/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_advanced.php index 70cda7254c8..8cdbee53395 100644 --- a/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_advanced.php +++ b/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_advanced.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2021 Frédéric France * * 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 @@ -21,7 +21,7 @@ */ /** - * \file htdocs/core/modules/knowledgemanagement/mod_knowledgerecord_advanced.php + * \file htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_advanced.php * \ingroup knowledgemanagement * \brief File containing class for advanced numbering model of KnowledgeRecord */ From e42287ec2c67e7ea847d3098c1bf601d6a3d1a91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 12:01:36 +0200 Subject: [PATCH 1011/1460] doxygen --- .../knowledgemanagement/mod_knowledgerecord_standard.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php b/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php index 9833fa9bfb7..ba5a3c3b391 100644 --- a/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php +++ b/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php @@ -18,7 +18,7 @@ */ /** - * \file htdocs/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php + * \file htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php * \ingroup knowledgemanagement * \brief File of class to manage KnowledgeRecord numbering rules standard */ From 14a355ebbabc190ad63268ba975ba12f300b8130 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 12:03:26 +0200 Subject: [PATCH 1012/1460] doxygen --- .../modules/knowledgemanagement/modules_knowledgerecord.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/knowledgemanagement/core/modules/knowledgemanagement/modules_knowledgerecord.php b/htdocs/knowledgemanagement/core/modules/knowledgemanagement/modules_knowledgerecord.php index 58def153c4b..edfe6beff62 100644 --- a/htdocs/knowledgemanagement/core/modules/knowledgemanagement/modules_knowledgerecord.php +++ b/htdocs/knowledgemanagement/core/modules/knowledgemanagement/modules_knowledgerecord.php @@ -23,7 +23,7 @@ */ /** - * \file htdocs/core/modules/knowledgemanagement/modules_knowledgerecord.php + * \file htdocs/knowledgemanagement/core/modules/knowledgemanagement/modules_knowledgerecord.php * \ingroup knowledgemanagement * \brief File that contains parent class for knowledgerecords document models and parent class for knowledgerecords numbering models */ From e61b2070749f55371dd2370f950de6089b2c95e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 12:07:06 +0200 Subject: [PATCH 1013/1460] doxygen --- .../lib/knowledgemanagement_knowledgerecord.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/knowledgemanagement/lib/knowledgemanagement_knowledgerecord.lib.php b/htdocs/knowledgemanagement/lib/knowledgemanagement_knowledgerecord.lib.php index e70b4654d19..e77439970ba 100644 --- a/htdocs/knowledgemanagement/lib/knowledgemanagement_knowledgerecord.lib.php +++ b/htdocs/knowledgemanagement/lib/knowledgemanagement_knowledgerecord.lib.php @@ -1,5 +1,5 @@ * * 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 @@ -16,7 +16,7 @@ */ /** - * \file htdocs/knowledgemanagementlib/knowledgemanagement_knowledgerecord.lib.php + * \file htdocs/knowledgemanagement/lib/knowledgemanagement_knowledgerecord.lib.php * \ingroup knowledgemanagement * \brief Library files with common functions for KnowledgeRecord */ From 3579d2f4b120f7cec5e2d4d102ccd05e9c6c8b44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 12:25:46 +0200 Subject: [PATCH 1014/1460] doxygen --- scripts/website/regenerate-pages.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/website/regenerate-pages.php b/scripts/website/regenerate-pages.php index b37e17bf78a..8e4b1279532 100755 --- a/scripts/website/regenerate-pages.php +++ b/scripts/website/regenerate-pages.php @@ -17,7 +17,7 @@ */ /** - * \file scripts/website/regenerate_pages.php + * \file scripts/website/regenerate-pages.php * \ingroup scripts * \brief Regenerate all pages of a web site */ From 8778296784649a480cb776d9debc9e5eae08db01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 12:29:27 +0200 Subject: [PATCH 1015/1460] fix doxygen nested comment --- htdocs/core/lib/import.lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/import.lib.php b/htdocs/core/lib/import.lib.php index a9663795988..54e6d232871 100644 --- a/htdocs/core/lib/import.lib.php +++ b/htdocs/core/lib/import.lib.php @@ -3,7 +3,7 @@ * Copyright (C) 2007 Rodolphe Quiedeville * Copyright (C) 2010 Regis Houssin * Copyright (C) 2010 Juanjo Menent - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2021 Frédéric France * * 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 @@ -24,6 +24,7 @@ * \file htdocs/core/lib/import.lib.php * \brief Ensemble de fonctions de base pour le module import * \ingroup import + */ /** * Function to return list of tabs for import pages From 2eb524cc31baf02070070db545125aff3c7c06a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 12:31:08 +0200 Subject: [PATCH 1016/1460] fix doxygen nested comment --- htdocs/core/tpl/originproductline.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/originproductline.tpl.php b/htdocs/core/tpl/originproductline.tpl.php index d4943ac454d..7e56611a282 100644 --- a/htdocs/core/tpl/originproductline.tpl.php +++ b/htdocs/core/tpl/originproductline.tpl.php @@ -1,6 +1,6 @@ -/* Copyright (C) 2017 Charlie Benke + * Copyright (C) 2017 Charlie Benke * * 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 From 1157d7edfb8a3dee822c7ebf6e6273ef6b1dc070 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 12:32:28 +0200 Subject: [PATCH 1017/1460] fix doxygen nested comment --- htdocs/product/dynamic_price/class/price_expression.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/dynamic_price/class/price_expression.class.php b/htdocs/product/dynamic_price/class/price_expression.class.php index 2a7f35a436b..564c2448e58 100644 --- a/htdocs/product/dynamic_price/class/price_expression.class.php +++ b/htdocs/product/dynamic_price/class/price_expression.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2014 Juanjo Menent -/* Copyright (C) 2015 Ion Agorria + * Copyright (C) 2015 Ion Agorria * * 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 From 3d5d2f0558fccd8ca3760b44f5c4b67bc64aca2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 12:33:17 +0200 Subject: [PATCH 1018/1460] fix doxygen nested comment --- .../product/dynamic_price/class/price_global_variable.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/dynamic_price/class/price_global_variable.class.php b/htdocs/product/dynamic_price/class/price_global_variable.class.php index 217ab25463a..a7b22f2ef13 100644 --- a/htdocs/product/dynamic_price/class/price_global_variable.class.php +++ b/htdocs/product/dynamic_price/class/price_global_variable.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2014 Juanjo Menent -/* Copyright (C) 2015 Ion Agorria + * Copyright (C) 2015 Ion Agorria * * 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 From 49d8f85ae74534bce37a43ea5763b690065a8d85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Oct 2021 12:33:48 +0200 Subject: [PATCH 1019/1460] fix doxygen nested comment --- .../dynamic_price/class/price_global_variable_updater.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php index e24ff2c6769..8a9c1197a7f 100644 --- a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php +++ b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2014 Juanjo Menent -/* Copyright (C) 2015 Ion Agorria + * Copyright (C) 2015 Ion Agorria * * 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 From d71d33939b097a98161db888339070079ce1e6f3 Mon Sep 17 00:00:00 2001 From: lvessiller Date: Thu, 21 Oct 2021 14:17:23 +0200 Subject: [PATCH 1020/1460] NEW max terminals number on cash desk setup --- htdocs/takepos/admin/setup.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php index db3b28d0948..870fe1844ad 100644 --- a/htdocs/takepos/admin/setup.php +++ b/htdocs/takepos/admin/setup.php @@ -256,8 +256,7 @@ print "\n"; print '\n"; // Services From f68c3c17aaaddd90703a3341ad9aed6f110438c1 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 21 Oct 2021 15:50:04 +0200 Subject: [PATCH 1021/1460] fix php warning --- htdocs/core/extrafieldsinexport.inc.php | 2 +- htdocs/core/modules/modSociete.class.php | 21 +++++++++++++++++++ .../societe/mod_codeclient_elephant.php | 4 ++-- htdocs/societe/admin/societe.php | 6 +++--- 4 files changed, 27 insertions(+), 6 deletions(-) diff --git a/htdocs/core/extrafieldsinexport.inc.php b/htdocs/core/extrafieldsinexport.inc.php index 70dd0077e57..fc2210eabd8 100644 --- a/htdocs/core/extrafieldsinexport.inc.php +++ b/htdocs/core/extrafieldsinexport.inc.php @@ -48,7 +48,7 @@ if ($resql) { // This can fail when class is used on old database (during mig case 'sellist': $tmp = ''; $tmpparam = jsonOrUnserialize($obj->param); // $tmp may be array 'options' => array 'c_currencies:code_iso:code_iso' => null - if ($tmpparam['options'] && is_array($tmpparam['options'])) { + if (is_array($tmpparam) && array_key_exists('options', $tmpparam) && $tmpparam['options'] && is_array($tmpparam['options'])) { $tmpkeys = array_keys($tmpparam['options']); $tmp = array_shift($tmpkeys); } diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index c3eba65673b..2cba93e29b7 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -121,6 +121,27 @@ class modSociete extends DolibarrModules $this->const[$r][4] = 0; $r++; + $this->const[$r][0] = "SOCIETE_SHOW_VAT_IN_LIST"; + $this->const[$r][1] = "yesno"; + $this->const[$r][2] = "0"; + $this->const[$r][3] = "Display customer ref into select list"; + $this->const[$r][4] = 0; + $r++; + + $this->const[$r][0] = "COMPANY_USE_SEARCH_TO_SELECT"; + $this->const[$r][1] = "yesno"; + $this->const[$r][2] = "0"; + $this->const[$r][3] = "Use easy find customer"; + $this->const[$r][4] = 0; + $r++; + + $this->const[$r][0] = "CONTACT_USE_SEARCH_TO_SELECT"; + $this->const[$r][1] = "yesno"; + $this->const[$r][2] = "0"; + $this->const[$r][3] = "use easy find contact"; + $this->const[$r][4] = 0; + $r++; + // Boxes $this->boxes = array( 0=>array('file'=>'box_clients.php', 'enabledbydefaulton'=>'Home'), diff --git a/htdocs/core/modules/societe/mod_codeclient_elephant.php b/htdocs/core/modules/societe/mod_codeclient_elephant.php index c18b768a724..8bb3a7bb2a1 100644 --- a/htdocs/core/modules/societe/mod_codeclient_elephant.php +++ b/htdocs/core/modules/societe/mod_codeclient_elephant.php @@ -132,7 +132,7 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode // Parametrage du prefix customers $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; @@ -140,7 +140,7 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode // Parametrage du prefix suppliers $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; $texte .= '
    '; - print $langs->trans('AvailabilityPeriod'); if (!empty($conf->commande->enabled)) { - print ' ('.$langs->trans('AfterOrder').')'; + print $form->textwithpicto($langs->trans('AvailabilityPeriod'), $langs->trans('AvailabilityPeriod').' ('.$langs->trans('AfterOrder').')'); + } else { + print $langs->trans('AvailabilityPeriod'); } print '
    '.$langs->trans("CalculatedWeight").''; - print showDimensionInBestUnit($totalWeight, 0, "weight", $langs, isset($conf->global->MAIN_WEIGHT_DEFAULT_ROUND) ? $conf->global->MAIN_WEIGHT_DEFAULT_ROUND : -1, isset($conf->global->MAIN_WEIGHT_DEFAULT_UNIT) ? $conf->global->MAIN_WEIGHT_DEFAULT_UNIT : 'no'); + print showDimensionInBestUnit($totalWeight, 0, "weight", $langs, isset($conf->global->MAIN_WEIGHT_DEFAULT_ROUND) ? $conf->global->MAIN_WEIGHT_DEFAULT_ROUND : -1, isset($conf->global->MAIN_WEIGHT_DEFAULT_UNIT) ? $conf->global->MAIN_WEIGHT_DEFAULT_UNIT : 'no', 0); print '
    '.$langs->trans("CalculatedVolume").''; - print showDimensionInBestUnit($totalVolume, 0, "volume", $langs, isset($conf->global->MAIN_VOLUME_DEFAULT_ROUND) ? $conf->global->MAIN_VOLUME_DEFAULT_ROUND : -1, isset($conf->global->MAIN_VOLUME_DEFAULT_UNIT) ? $conf->global->MAIN_VOLUME_DEFAULT_UNIT : 'no'); + print showDimensionInBestUnit($totalVolume, 0, "volume", $langs, isset($conf->global->MAIN_VOLUME_DEFAULT_ROUND) ? $conf->global->MAIN_VOLUME_DEFAULT_ROUND : -1, isset($conf->global->MAIN_VOLUME_DEFAULT_UNIT) ? $conf->global->MAIN_VOLUME_DEFAULT_UNIT : 'no', 0); print '
    '.$langs->trans('AvailabilityPeriod').''; + print img_picto('', 'clock', 'class="pictofixedwidth"'); + $form->selectAvailabilityDelay($availability_id, 'availability_id', '', 1, 'maxwidth200 widthcentpercentminusx'); + print '
    '.$langs->trans('PaymentConditionsShort').''; print img_picto('', 'paiment'); $form->select_conditions_paiements($cond_reglement_id, 'cond_reglement_id', - 1, 1); print '
    '.$langs->trans('PaymentMode').''; print img_picto('', 'bank', 'class="pictofixedwidth"'); $form->select_types_paiements($mode_reglement_id, 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx'); @@ -1665,12 +1671,6 @@ if ($action == 'create' && $usercancreate) { print '
    '.$langs->trans('AvailabilityPeriod').''; - print img_picto('', 'clock', 'class="pictofixedwidth"'); - $form->selectAvailabilityDelay($availability_id, 'availability_id', '', 1, 'maxwidth200 widthcentpercentminusx'); - print '
    '.$langs->trans('SendingMethod').''; @@ -2148,7 +2148,7 @@ if ($action == 'create' && $usercancreate) { print ''; } else { print $object->date ? dol_print_date($object->date, 'day') : ' '; - if ($object->hasDelay()) { + if ($object->hasDelay() && empty($object->delivery_date)) { // If there is a delivery date planned, warning should be on this date print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning"); } } @@ -2176,6 +2176,18 @@ if ($action == 'create' && $usercancreate) { print '
    '; + $editenable = $usercancreate; + print $form->editfieldkey("AvailabilityPeriod", 'availability', '', $object, $editenable); + print ''; + if ($action == 'editavailability') { + $form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, $object->availability_id, 'availability_id', 1); + } else { + $form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, $object->availability_id, 'none', 1); + } + print '
    '; @@ -2209,6 +2221,18 @@ if ($action == 'create' && $usercancreate) { print '
    '; + $editenable = $usercancreate; + print $form->editfieldkey("Source", 'demandreason', '', $object, $editenable); + print ''; + if ($action == 'editdemandreason') { + $form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, $object->demand_reason_id, 'demand_reason_id', 1); + } else { + $form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, $object->demand_reason_id, 'none'); + } + print '
    '; $editenable = $usercancreate; @@ -2274,30 +2298,6 @@ if ($action == 'create' && $usercancreate) { } } - // Delivery delay - print '
    '; - $editenable = $usercancreate; - print $form->editfieldkey("AvailabilityPeriod", 'availability', '', $object, $editenable); - print ''; - if ($action == 'editavailability') { - $form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, $object->availability_id, 'availability_id', 1); - } else { - $form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, $object->availability_id, 'none', 1); - } - print '
    '; - $editenable = $usercancreate; - print $form->editfieldkey("Channel", 'demandreason', '', $object, $editenable); - print ''; - if ($action == 'editdemandreason') { - $form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, $object->demand_reason_id, 'demand_reason_id', 1); - } else { - $form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, $object->demand_reason_id, 'none'); - } - print '
    '; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index c479b59cbde..aa940e1f03a 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5159,7 +5159,8 @@ class Form print ''; print ''; $this->selectAvailabilityDelay($selected, $htmlname, -1, $addempty); - print ''; + print ''; + print ''; print ''; } else { if ($selected) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 14021292428..235b76aa885 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5418,15 +5418,16 @@ function price2num($amount, $rounding = '', $option = 0) /** * Output a dimension with best unit * - * @param float $dimension Dimension - * @param int $unit Unit scale of dimension (Example: 0=kg, -3=g, -6=mg, 98=ounce, 99=pound, ...) - * @param string $type 'weight', 'volume', ... - * @param Translate $outputlangs Translate language object - * @param int $round -1 = non rounding, x = number of decimal + * @param float $dimension Dimension + * @param int $unit Unit scale of dimension (Example: 0=kg, -3=g, -6=mg, 98=ounce, 99=pound, ...) + * @param string $type 'weight', 'volume', ... + * @param Translate $outputlangs Translate language object + * @param int $round -1 = non rounding, x = number of decimal * @param string $forceunitoutput 'no' or numeric (-3, -6, ...) compared to $unit (In most case, this value is value defined into $conf->global->MAIN_WEIGHT_DEFAULT_UNIT) - * @return string String to show dimensions + * @param int $use_short_label 1=Use short label ('g' instead of 'gram'). Short labels are not translated. + * @return string String to show dimensions */ -function showDimensionInBestUnit($dimension, $unit, $type, $outputlangs, $round = -1, $forceunitoutput = 'no') +function showDimensionInBestUnit($dimension, $unit, $type, $outputlangs, $round = -1, $forceunitoutput = 'no', $use_short_label = 0) { require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; @@ -5456,7 +5457,8 @@ function showDimensionInBestUnit($dimension, $unit, $type, $outputlangs, $round $unit = $forceunitoutput; }*/ - $ret = price($dimension, 0, $outputlangs, 0, 0, $round).' '.measuringUnitString(0, $type, $unit); + $ret = price($dimension, 0, $outputlangs, 0, 0, $round); + $ret .= ' '.measuringUnitString(0, $type, $unit, $use_short_label, $outputlangs); return $ret; } diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 64cc72a8879..10c838b4c43 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -589,12 +589,12 @@ function measuring_units_string($scale = '', $measuring_style = '', $unit = 0, $ /** * Return translation label of a unit key * - * @param int $unit ID of unit (rowid in llx_c_units table) - * @param string $measuring_style Style of unit: 'weight', 'volume', ..., '' = 'net_measure' for option PRODUCT_ADD_NET_MEASURE - * @param string $scale Scale of unit: '0', '-3', '6', ... - * @param int $use_short_label 1=Use short label ('g' instead of 'gram'). Short labels are not translated. + * @param int $unit ID of unit (rowid in llx_c_units table) + * @param string $measuring_style Style of unit: 'weight', 'volume', ..., '' = 'net_measure' for option PRODUCT_ADD_NET_MEASURE + * @param string $scale Scale of unit: '0', '-3', '6', ... + * @param int $use_short_label 1=Use short label ('g' instead of 'gram'). Short labels are not translated. * @param Translate $outputlangs Language object - * @return string Unit string + * @return string Unit string * @see formproduct->selectMeasuringUnits() */ function measuringUnitString($unit, $measuring_style = '', $scale = '', $use_short_label = 0, $outputlangs = null) diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index b8814450030..66546523f11 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -357,7 +357,7 @@ if ($id > 0 || !empty($ref)) { print '
    '.$langs->trans('Date').''; print dol_print_date($object->date, 'day'); - if ($object->hasDelay() && empty($object->delivery_date)) { + if ($object->hasDelay() && empty($object->delivery_date)) { // If there is a delivery date planned, warning should be on this date print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning"); } print '
    '; + print ''; + if ($action != 'editavailability') { + print ''; + } + print '
    '; + print $langs->trans('AvailabilityPeriod'); + print 'id.'">'.img_edit($langs->trans('SetAvailability'), 1).'
    '; + print '
    '; + if ($action == 'editavailability') { + $form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, $object->availability_id, 'availability_id', 1); + } else { + $form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, $object->availability_id, 'none', 1); + } + print '
    '; print ''; } + // Source reason (why we have an order) + print '';*/ - // Availability - print ''; - - // Source - print ''; print ''; @@ -2198,12 +2200,12 @@ if ($action == 'create') { print $langs->trans('AvailabilityPeriod'); } print ''; - if ($action != 'editavailability' && $usercancreate) { + if ($action != 'editavailability' && $usercancreate && $caneditfield) { print ''; } print '
    '; @@ -434,6 +451,22 @@ if ($id > 0 || !empty($ref)) { print '
    '; + print ''; + if ($action != 'editdemandreason') { + print ''; + } + print '
    '; + print $langs->trans('Source'); + print 'id.'">'.img_edit($langs->trans('SetDemandReason'), 1).'
    '; + print '
    '; + if ($action == 'editdemandreason') { + $form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, $object->demand_reason_id, 'demand_reason_id', 1); + } else { + $form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, $object->demand_reason_id, 'none'); + } + // Terms of payment /* print '
    '; @@ -472,39 +505,6 @@ if ($id > 0 || !empty($ref)) { } print '
    '; - print ''; - if ($action != 'editavailability') { - print ''; - } - print '
    '; - print $langs->trans('AvailabilityPeriod'); - print 'id.'">'.img_edit($langs->trans('SetAvailability'), 1).'
    '; - print '
    '; - if ($action == 'editavailability') { - $form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, $object->availability_id, 'availability_id', 1); - } else { - $form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, $object->availability_id, 'none', 1); - } - print '
    '; - print ''; - if ($action != 'editdemandreason') { - print ''; - } - print '
    '; - print $langs->trans('Source'); - print 'id.'">'.img_edit($langs->trans('SetDemandReason'), 1).'
    '; - print '
    '; - if ($action == 'editdemandreason') { - $form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, $object->demand_reason_id, 'demand_reason_id', 1); - } else { - $form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, $object->demand_reason_id, 'none'); - } - $tmparray = $object->getTotalWeightVolume(); $totalWeight = $tmparray['weight']; $totalVolume = $tmparray['volume']; From 421b69294255b6c400878d7e4a2794b37bbf52d5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 Oct 2021 21:48:25 +0200 Subject: [PATCH 0970/1460] Clean last br for wysiwyg --- htdocs/core/lib/functions.lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 235b76aa885..b08d8e55686 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6638,7 +6638,8 @@ function dol_htmlentitiesbr_decode($stringtodecode, $pagecodeto = 'UTF-8') */ function dol_htmlcleanlastbr($stringtodecode) { - $ret = preg_replace('/(
    ||'."\n".'|'."\r".')+$/i', "", $stringtodecode); + $ret = preg_replace('/ $/i', "", $stringtodecode); // Because wysiwyg editor may add a   at end of last line + $ret = preg_replace('/(
    ||'."\n".'|'."\r".')+$/i', "", $ret); return $ret; } From c6ef6a162be13700e31e30e24ecd734e2c28d8c8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 Oct 2021 22:19:30 +0200 Subject: [PATCH 0971/1460] NEW Can edit fields of proposal when proposal is not yet signed --- htdocs/comm/propal/card.php | 38 +++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index b870b401c48..8f92184d4ca 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2079,6 +2079,8 @@ if ($action == 'create') { $absolute_discount = price2num($absolute_discount, 'MT'); $absolute_creditnote = price2num($absolute_creditnote, 'MT'); + $caneditfield = ($object->statut != Propal::STATUS_SIGNED && $object->statut != Propal::STATUS_BILLED); + $thirdparty = $soc; $discount_type = 0; $backtopage = urlencode($_SERVER["PHP_SELF"].'?id='.$object->id); @@ -2092,12 +2094,12 @@ if ($action == 'create') { print ''; - if ($action != 'editdate' && $usercancreate) { + if ($action != 'editdate' && $usercancreate && $caneditfield) { print ''; } print '
    '; print $langs->trans('DatePropal'); print 'id.'">'.img_edit($langs->trans('SetDate'), 1).'
    '; print '
    '; - if ($action == 'editdate' && $usercancreate) { + if ($action == 'editdate' && $usercancreate && $caneditfield) { print '
    '; print ''; print ''; @@ -2119,12 +2121,12 @@ if ($action == 'create') { print ''; - if ($action != 'editecheance' && $usercancreate) { + if ($action != 'editecheance' && $usercancreate && $caneditfield) { print ''; } print '
    '; print $langs->trans('DateEndPropal'); print 'id.'">'.img_edit($langs->trans('SetConditions'), 1).'
    '; print '
    '; - if ($action == 'editecheance' && $usercancreate) { + if ($action == 'editecheance' && $usercancreate && $caneditfield) { print ''; print ''; print ''; @@ -2149,12 +2151,12 @@ if ($action == 'create') { print ''; - if ($action != 'editconditions' && $usercancreate) { + if ($action != 'editconditions' && $usercancreate && $caneditfield) { print ''; } print '
    '; print $langs->trans('PaymentConditionsShort'); print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetConditions'), 1).'
    '; print '
    '; - if ($action == 'editconditions' && $usercancreate) { + if ($action == 'editconditions' && $usercancreate && $caneditfield) { $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id, 'cond_reglement_id'); } else { $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id, 'none'); @@ -2168,12 +2170,12 @@ if ($action == 'create') { print ''; - if ($action != 'editmode' && $usercancreate) { + if ($action != 'editmode' && $usercancreate && $caneditfield) { print ''; } print '
    '; print $langs->trans('PaymentMode'); print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetMode'), 1).'
    '; print '
    '; - if ($action == 'editmode' && $usercancreate) { + if ($action == 'editmode' && $usercancreate && $caneditfield) { $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1); } else { $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'none'); @@ -2183,9 +2185,9 @@ if ($action == 'create') { // Delivery date $langs->load('deliveries'); print '
    '; - print $form->editfieldkey($langs->trans('DeliveryDate'), 'date_livraison', $object->delivery_date, $object, $usercancreate, 'datepicker'); + print $form->editfieldkey($langs->trans('DeliveryDate'), 'date_livraison', $object->delivery_date, $object, $usercancreate && $caneditfield, 'datepicker'); print ''; - print $form->editfieldval($langs->trans('DeliveryDate'), 'date_livraison', $object->delivery_date, $object, $usercancreate, 'datepicker'); + print $form->editfieldval($langs->trans('DeliveryDate'), 'date_livraison', $object->delivery_date, $object, $usercancreate && $caneditfield, 'datepicker'); print '
    id.'">'.img_edit($langs->transnoentitiesnoconv('SetAvailability'), 1).'
    '; print '
    '; - if ($action == 'editavailability' && $usercancreate) { + if ($action == 'editavailability' && $usercancreate && $caneditfield) { $form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, $object->availability_id, 'availability_id', 1); } else { $form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, $object->availability_id, 'none', 1); @@ -2218,12 +2220,12 @@ if ($action == 'create') { print ''; - if ($action != 'editshippingmethod' && $usercancreate) { + if ($action != 'editshippingmethod' && $usercancreate && $caneditfield) { print ''; } print '
    '; print $langs->trans('SendingMethod'); print 'id.'">'.img_edit($langs->trans('SetShippingMode'), 1).'
    '; print '
    '; - if ($action == 'editshippingmethod' && $usercancreate) { + if ($action == 'editshippingmethod' && $usercancreate && $caneditfield) { $form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, $object->shipping_method_id, 'shipping_method_id', 1); } else { $form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, $object->shipping_method_id, 'none'); @@ -2373,7 +2375,7 @@ if ($action == 'create') { print '
    '; print $langs->trans('IncotermLabel'); print ''; - if ($usercancreate) { + if ($action != 'editincoterm' && $usercancreate && $caneditfield) { print ''.img_edit().''; } else { print ' '; @@ -2381,10 +2383,10 @@ if ($action == 'create') { print '
    '; print '
    '; - if ($action != 'editincoterm') { - print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1); - } else { + if ($action == 'editincoterm' && $usercancreate && $caneditfield) { print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'].'?id='.$object->id); + } else { + print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1); } print '
    '.$langs->trans("MemberAllowchangeOfType").''; -print $form->selectyesno('ADHERENT_LOGIN_NOT_REQUIRED', (!empty($conf->global->MEMBER_ALLOW_CHANGE_OF_TYPE) ? 0 : 1), 1); +print $form->selectyesno('MEMBER_ALLOW_CHANGE_OF_TYPE', (!empty($conf->global->MEMBER_ALLOW_CHANGE_OF_TYPE) ? 0 : 1), 1); print "
    '.$langs->trans("Amount").' '.$langs->trans("Currency".$conf->currency).'
    '.$langs->trans("Amount").'0 ? GETPOST("subscription") : $adht->amount).'"> '.$langs->trans("Currency".$conf->currency) .'
    '.$langs->trans("Label").''; - print ''; + print ''; // We must be able to enter decimal qty print ''.$langs->trans('AmountHT').''; if ($action == 'editline' && $lineid == $objp->dispatchlineid) { - print ''; + print ''; } else { print $objp->qty; } diff --git a/htdocs/multicurrency/multicurrency_rate.php b/htdocs/multicurrency/multicurrency_rate.php index 35b7544ccbc..161513338ff 100644 --- a/htdocs/multicurrency/multicurrency_rate.php +++ b/htdocs/multicurrency/multicurrency_rate.php @@ -479,7 +479,7 @@ if ($resql) { // var_dump($obj); print ' ' . $form->selectMultiCurrency($obj->code, 'multicurrency_code', 1, " code != '".$conf->currency."'", true) . ''; print ''; From 417daa4289c2545bf7a254ff5bbd4f186a9e002b Mon Sep 17 00:00:00 2001 From: atm-florian Date: Wed, 20 Oct 2021 11:15:02 +0200 Subject: [PATCH 0978/1460] FIX 14.0 - civility field width inadequate due to select2 calculating the width while the field has no width (display: none) --- htdocs/societe/card.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index bfee51e5f8d..e283333070b 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1151,6 +1151,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $("#typent_id").change(); $("#effectif_id").val(id_ef15); $("#effectif_id").change(); + if ($("#civility_id").data("select2")) { + $("#civility_id").select2({width: "resolve"}); + } $("#TypeName").html(document.formsoc.LastName.value); document.formsoc.private.value=1; }); From f59f605bcc9dad53ba821a71c1165b4773eadfee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 20 Oct 2021 11:29:34 +0200 Subject: [PATCH 0979/1460] Update card.php --- htdocs/societe/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index e283333070b..c228fd29866 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1151,6 +1151,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $("#typent_id").change(); $("#effectif_id").val(id_ef15); $("#effectif_id").change(); + /* Force recompute width of a select2 field when it was hidden and then shown */ if ($("#civility_id").data("select2")) { $("#civility_id").select2({width: "resolve"}); } From ae1da432250d521728e575da33153670fb0afec7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 20 Oct 2021 11:30:38 +0200 Subject: [PATCH 0980/1460] Update card.php --- htdocs/societe/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index c228fd29866..5c9c0f63e94 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1151,7 +1151,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $("#typent_id").change(); $("#effectif_id").val(id_ef15); $("#effectif_id").change(); - /* Force recompute width of a select2 field when it was hidden and then shown */ + /* Force to recompute the width of a select2 field when it was hidden and then shown programatically */ if ($("#civility_id").data("select2")) { $("#civility_id").select2({width: "resolve"}); } From 632751cebc5de5a00057674d86c6df9823516010 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 20 Oct 2021 12:37:49 +0200 Subject: [PATCH 0981/1460] Use getDolGlobalInt() --- htdocs/core/lib/accounting.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/accounting.lib.php b/htdocs/core/lib/accounting.lib.php index 30f1b497885..21afb5f3490 100644 --- a/htdocs/core/lib/accounting.lib.php +++ b/htdocs/core/lib/accounting.lib.php @@ -103,7 +103,7 @@ function length_accountg($account) return $account; } - $g = !empty($conf->global->ACCOUNTING_LENGTH_GACCOUNT); + $g = getDolGlobalInt('ACCOUNTING_LENGTH_GACCOUNT'); if (!is_empty($g)) { // Clean parameters $i = strlen($account); @@ -142,7 +142,7 @@ function length_accounta($accounta) return $accounta; } - $a = !empty($conf->global->ACCOUNTING_LENGTH_AACCOUNT); + $a = getDolGlobalInt('ACCOUNTING_LENGTH_AACCOUNT'); if (!is_empty($a)) { // Clean parameters $i = strlen($accounta); From 53244c5f45dc1bb9b831cd0cf665f2fcfdd2162f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 20 Oct 2021 12:38:19 +0200 Subject: [PATCH 0982/1460] FIX missing permission check reported by me@lainwir3d.net on product api --- htdocs/product/class/api_products.class.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 2e0d21b0456..b6230ce119e 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -1617,7 +1617,7 @@ class Products extends DolibarrApi $combinations[$key]->attributes = $prodc2vp->fetchByFkCombination((int) $combination->id); $combinations[$key] = $this->_cleanObjectDatas($combinations[$key]); - if ($includestock==1) { + if ($includestock==1 && DolibarrApiAccess::$user->rights->stock->lire) { $productModel = new Product($this->db); $productModel->fetch((int) $combination->fk_product_child); $productModel->load_stock(); @@ -1859,7 +1859,7 @@ class Products extends DolibarrApi public function getStock($id, $selected_warehouse_id = null) { - if (!DolibarrApiAccess::$user->rights->produit->lire) { + if (!DolibarrApiAccess::$user->rights->produit->lire || !DolibarrApiAccess::$user->rights->stock->lire) { throw new RestException(401); } @@ -1945,6 +1945,10 @@ class Products extends DolibarrApi unset($object->supplierprices); // Mut use another API to get them + if(!DolibarrApiAccess::$user->rights->stock->lire){ + unset($object->stock_reel); + unset($object->stock_theorique); + } return $object; } @@ -2008,7 +2012,7 @@ class Products extends DolibarrApi throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - if ($includestockdata) { + if ($includestockdata && DolibarrApiAccess::$user->rights->stock->lire) { $this->product->load_stock(); if (is_array($this->product->stock_warehouse)) { From f38fca8174a046c31f57f1155d5b354c820a00c6 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 20 Oct 2021 13:35:30 +0200 Subject: [PATCH 0983/1460] FIX wrong array key value --- htdocs/install/upgrade2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index ea71b1947e7..5294bdf8f11 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -530,7 +530,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ // Can call a dedicated external upgrade process if (!$error) { - $parameters = array('versionfrom'=>$versionfrom, 'versionto='.$versionto); + $parameters = array('versionfrom' => $versionfrom, 'versionto' => $versionto); $object = new stdClass(); $action = "upgrade"; $reshook = $hookmanager->executeHooks('doUpgrade2', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks From 4a5293fc9c39375042fdec270f7c4e936522a937 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 20 Oct 2021 14:41:40 +0200 Subject: [PATCH 0984/1460] Rewrite getDictionaryValue (Use a cache file and consistent return code) --- ChangeLog | 2 ++ htdocs/admin/dict.php | 2 +- htdocs/admin/expensereport_rules.php | 7 +++-- htdocs/core/lib/functions.lib.php | 41 +++++++++++++++------------- 4 files changed, 29 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2b29cf60bdc..f6530b59c1f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,8 @@ Following changes may create regressions for some external modules, but were nec * Old deprecated module "SimplePOS" has been completely removed. Use module "TakePOS" is you need a Point Of Sale. * The method static ActionComm::getActions($db, ...) is no more static. Use $actioncomm->getActions(...) instead (without $db param). * The 'action=delete&file=...' has been replaced with 'action=deletefile&file=...' to avoid confusion with deletion of object lines. +* Method getDictvalue has been renamed into getDictionaryValue to match camel case rule. + ***** ChangeLog for 14.0.3 compared to 14.0.2 ***** diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 229193d6da8..775e2cd2093 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1974,7 +1974,7 @@ if ($id) { } } } elseif ($value == 'fk_c_exp_tax_cat') { - $valuetoshow = getDictvalue(MAIN_DB_PREFIX.'c_exp_tax_cat', 'label', $valuetoshow); + $valuetoshow = getDictionaryValue(MAIN_DB_PREFIX.'c_exp_tax_cat', 'label', $valuetoshow); $valuetoshow = $langs->trans($valuetoshow); } elseif ($tabname[$id] == MAIN_DB_PREFIX.'c_exp_tax_cat') { $valuetoshow = $langs->trans($valuetoshow); diff --git a/htdocs/admin/expensereport_rules.php b/htdocs/admin/expensereport_rules.php index 67627a94af8..bddaf58475a 100644 --- a/htdocs/admin/expensereport_rules.php +++ b/htdocs/admin/expensereport_rules.php @@ -257,11 +257,12 @@ foreach ($rules as $rule) { if ($rule->fk_c_type_fees == -1) { echo $langs->trans('AllExpenseReport'); } else { - $key = getDictvalue(MAIN_DB_PREFIX.'c_type_fees', 'code', $rule->fk_c_type_fees, false, 'id'); - if ($key != $langs->trans($key)) { + $key = getDictionaryValue(MAIN_DB_PREFIX.'c_type_fees', 'code', $rule->fk_c_type_fees, false, 'id'); + if ($key && $key != $langs->trans($key)) { echo $langs->trans($key); } else { - echo $langs->trans(getDictvalue(MAIN_DB_PREFIX.'c_type_fees', 'label', $rule->fk_c_type_fees, false, 'id')); // TODO check to return trans of 'code' + $value = getDictionaryValue(MAIN_DB_PREFIX.'c_type_fees', 'label', $rule->fk_c_type_fees, false, 'id'); + echo $langs->trans($value ? $value : 'Undefined'); // TODO check to return trans of 'code' } } } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index b08d8e55686..98a879410b0 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -9563,21 +9563,24 @@ function dol_mimetype($file, $default = 'application/octet-stream', $mode = 0) } /** - * Return value from dictionary + * Return the value of a filed into a dictionary for the record $id. + * This also set all the values into a cache for a next search. * - * @param string $tablename name of dictionary - * @param string $field the value to return - * @param int $id id of line - * @param bool $checkentity add filter on entity - * @param string $rowidfield name of the column rowid - * @return string + * @param string $tablename Name of dictionary + * @param string $field The name of field where to find the value to return + * @param int $id Id of line record + * @param bool $checkentity Add filter on entity + * @param string $rowidfield Name of the column rowid (to use for the filter on $id) + * @return string The value of field $field. This also set $dictvalues cache. */ -function getDictvalue($tablename, $field, $id, $checkentity = false, $rowidfield = 'rowid') +function getDictionaryValue($tablename, $field, $id, $checkentity = false, $rowidfield = 'rowid') { - global $dictvalues, $db, $langs; + global $conf, $db; - if (!isset($dictvalues[$tablename])) { - $dictvalues[$tablename] = array(); + $dictvalues = (isset($conf->cache['dictvalues_'.$tablename]) ? $conf->cache['dictvalues_'.$tablename] : null); + + if (is_null($dictvalues)) { + $dictvalues = array(); $sql = "SELECT * FROM ".$tablename." WHERE 1 = 1"; // Here select * is allowed as it is generic code and we don't have list of fields if ($checkentity) { @@ -9587,20 +9590,20 @@ function getDictvalue($tablename, $field, $id, $checkentity = false, $rowidfield $resql = $db->query($sql); if ($resql) { while ($obj = $db->fetch_object($resql)) { - $dictvalues[$tablename][$obj->{$rowidfield}] = $obj; + $dictvalues[$obj->{$rowidfield}] = $obj; } } else { dol_print_error($db); } + + $conf->cache['dictvalues_'.$tablename] = $dictvalues; } - if (!empty($dictvalues[$tablename][$id])) { - return $dictvalues[$tablename][$id]->{$field}; // Found - } else // Not found - { - if ($id > 0) { - return $id; - } + if (!empty($dictvalues[$id])) { + // Found + return $dictvalues[$id]->{$field}; + } else { + // Not found return ''; } } From 85fe1d6d1ed9168331740cec390624c94bcc99e7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 20 Oct 2021 15:00:49 +0200 Subject: [PATCH 0985/1460] fix sql injection reported by Mehdi Oudad --- htdocs/exports/class/export.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/exports/class/export.class.php b/htdocs/exports/class/export.class.php index 483935c7fdf..7eb88e4fbb3 100644 --- a/htdocs/exports/class/export.class.php +++ b/htdocs/exports/class/export.class.php @@ -379,13 +379,13 @@ class Export */ public function conditionDate($Field, $Value, $Sens) { - // TODO date_format is forbidden, not performant and not portable. Use instead BETWEEN + // TODO date_format is forbidden, not performant and not portable. Use instead $Value to forge the range date. if (strlen($Value) == 4) { - $Condition = " date_format(".$Field.",'%Y') ".$Sens." '".$Value."'"; + $Condition = " date_format(".$Field.",'%Y') ".$Sens." '".$this->db->escape($Value)."'"; } elseif (strlen($Value) == 6) { - $Condition = " date_format(".$Field.",'%Y%m') ".$Sens." '".$Value."'"; + $Condition = " date_format(".$Field.",'%Y%m') ".$Sens." '".$this->db->escape($Value)."'"; } else { - $Condition = " date_format(".$Field.",'%Y%m%d') ".$Sens." ".$Value; + $Condition = " date_format(".$Field.",'%Y%m%d') ".$Sens." '".$this->db->escape($Value)."'"; } return $Condition; } @@ -416,7 +416,7 @@ class Export case 'Duree': case 'Numeric': case 'Number': - // Must be a string text to allow to use comparison strings like "<= 999" + // Must be a string text to allow to use comparison strings like "<= 99.9" $szFilterField = ''; break; case 'Status': From a2adc6fc58912a9f0c70083e52d57dac68e9ad68 Mon Sep 17 00:00:00 2001 From: daraelmin Date: Wed, 20 Oct 2021 15:59:42 +0200 Subject: [PATCH 0986/1460] Getpostisset --- htdocs/adherents/subscription.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 8d9fe0a5946..8f6fa4af34e 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -963,7 +963,7 @@ if ($rowid > 0) { if ($adht->subscription) { // Amount - print '
    '.$langs->trans("Amount").'0 ? GETPOST("subscription") : $adht->amount).'"> '.$langs->trans("Currency".$conf->currency) .'
    '.$langs->trans("Amount").'amount).'"> '.$langs->trans("Currency".$conf->currency) .'
    '.$langs->trans("Label").'
    '.$langs->trans("Amount").'amount).'"> '.$langs->trans("Currency".$conf->currency) .'
    '.$langs->trans("Amount").' '.$langs->trans("Currency".$conf->currency) .'
    '.$langs->trans("Label").'
    '.$langs->trans("CustomersInvoices").'
    '.$langs->trans("SocialContributionsNondeductibles").'
    '.$langs->trans("SocialContributionsDeductibles").'
    '.price($amount)."
     ".$langs->trans("Salary")." fk_user."\">".$obj->firstname." ".$obj->lastname."".$langs->trans("Salary")." getFullName($langs)."\">".$obj->firstname." ".$obj->lastname."'.price(-$obj->amount).'
    '; print $langs->trans("NumberOfTerminals"); print ''; -$array = array(1=>"1", 2=>"2", 3=>"3", 4=>"4", 5=>"5", 6=>"6", 7=>"7", 8=>"8", 9=>"9"); -print $form->selectarray('TAKEPOS_NUM_TERMINALS', $array, (empty($conf->global->TAKEPOS_NUM_TERMINALS) ? '0' : $conf->global->TAKEPOS_NUM_TERMINALS), 0); +print ''; print "
    '.$langs->trans("Mask").' ('.$langs->trans("CustomerCodeModel").'):'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 1).' 
    '.$langs->trans("Mask").' ('.$langs->trans("SupplierCodeModel").'):'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 1).'
    '; diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index 18bc3a3785b..536eb0546cc 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -746,7 +746,7 @@ if (!$conf->use_javascript_ajax) { '2'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 2).')', '3'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 3).')', ); - print $form->selectarray("activate_COMPANY_USE_SEARCH_TO_SELECT", $arrval, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, 0, 0, '', 0, 0, 0, '', 'minwidth75imp'); + print $form->selectarray("activate_COMPANY_USE_SEARCH_TO_SELECT", $arrval, (property_exists($conf->global, 'COMPANY_USE_SEARCH_TO_SELECT')?$conf->global->COMPANY_USE_SEARCH_TO_SELECT:''), 0, 0, 0, '', 0, 0, 0, '', 'minwidth75imp'); print ''; print ''; print ""; @@ -767,7 +767,7 @@ if (!$conf->use_javascript_ajax) { '2'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 2).')', '3'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 3).')', ); - print $form->selectarray("activate_CONTACT_USE_SEARCH_TO_SELECT", $arrval, $conf->global->CONTACT_USE_SEARCH_TO_SELECT, 0, 0, 0, '', 0, 0, 0, '', 'minwidth75imp'); + print $form->selectarray("activate_CONTACT_USE_SEARCH_TO_SELECT", $arrval, (property_exists($conf->global, 'CONTACT_USE_SEARCH_TO_SELECT')?$conf->global->CONTACT_USE_SEARCH_TO_SELECT:''), 0, 0, 0, '', 0, 0, 0, '', 'minwidth75imp'); print ''; print ''; print ""; @@ -870,7 +870,7 @@ if (empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS)) { print ''; print ''.$langs->trans("DefaultCustomerType").''; print ''; - print $formcompany->selectProspectCustomerType($conf->global->THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT, 'defaultcustomertype', 'defaultcustomertype', 'admin'); + print $formcompany->selectProspectCustomerType((property_exists($conf->global, 'THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')?$conf->global->THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT:''), 'defaultcustomertype', 'defaultcustomertype', 'admin'); print ''; print ''; print ''; From f783dd56a4c3f73e85d1db40c9ef9e0c40225308 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 21 Oct 2021 15:54:23 +0200 Subject: [PATCH 1022/1460] fix: scrutinizer --- htdocs/accountancy/customer/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index 7c3cc2cf0e2..aa1abde5fa5 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -214,7 +214,7 @@ if ($action == 'validatehistory') { $facture_static->ref = $objp->ref; $facture_static->id = $objp->facid; $facture_static->type = $objp->ftype; - $facture_static->datef = $objp->datef; + $facture_static->date = $objp->datef; $facture_static_det->id = $objp->rowid; $facture_static_det->total_ht = $objp->total_ht; From 0589c9c3caefc581227028950bdfd15fbb391d00 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 21 Oct 2021 15:55:11 +0200 Subject: [PATCH 1023/1460] fix: scrutinizer --- htdocs/accountancy/customer/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 9a942bc3eaa..97a885f97b9 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -559,7 +559,7 @@ if ($result) { $facture_static->ref = $objp->ref; $facture_static->id = $objp->facid; $facture_static->type = $objp->ftype; - $facture_static->datef = $objp->datef; + $facture_static->date = $objp->datef; $facture_static_det->id = $objp->rowid; $facture_static_det->total_ht = $objp->total_ht; From 2e260d75d92a40f0c0baea4913ee2a66e371d3a7 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 21 Oct 2021 15:57:54 +0200 Subject: [PATCH 1024/1460] fix: scrutinizer --- htdocs/categories/viewcat.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 8ebb9f43b1e..7ccd80eb4bd 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -770,7 +770,7 @@ if ($type == Categorie::TYPE_CONTACT) { print ''."\n"; print ''."\n"; - if (count($contacts) > 0) { + if (is_array($contacts) && count($contacts) > 0) { $i = 0; foreach ($contacts as $key => $contact) { $i++; From 258d0c3a6906ab59670a7edf7aaed0222d838b2e Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 21 Oct 2021 16:05:37 +0200 Subject: [PATCH 1025/1460] fix: scrutinizer --- htdocs/commande/card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index decabedc2e8..6cb9441b31b 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1494,13 +1494,13 @@ if ($action == 'create' && $usercancreate) { $cond_reglement_id = (!empty($objectsrc->cond_reglement_id) ? $objectsrc->cond_reglement_id : (!empty($soc->cond_reglement_id) ? $soc->cond_reglement_id : 0)); // TODO maybe add default value option $mode_reglement_id = (!empty($objectsrc->mode_reglement_id) ? $objectsrc->mode_reglement_id : (!empty($soc->mode_reglement_id) ? $soc->mode_reglement_id : 0)); $fk_account = (!empty($objectsrc->fk_account) ? $objectsrc->fk_account : (!empty($soc->fk_account) ? $soc->fk_account : 0)); - $availability_id = (!empty($objectsrc->availability_id) ? $objectsrc->availability_id : (!empty($soc->availability_id) ? $soc->availability_id : 0)); + $availability_id = (!empty($objectsrc->availability_id) ? $objectsrc->availability_id : 0); $shipping_method_id = (!empty($objectsrc->shipping_method_id) ? $objectsrc->shipping_method_id : (!empty($soc->shipping_method_id) ? $soc->shipping_method_id : 0)); $warehouse_id = (!empty($objectsrc->warehouse_id) ? $objectsrc->warehouse_id : (!empty($soc->warehouse_id) ? $soc->warehouse_id : 0)); $demand_reason_id = (!empty($objectsrc->demand_reason_id) ? $objectsrc->demand_reason_id : (!empty($soc->demand_reason_id) ? $soc->demand_reason_id : 0)); $remise_percent = (!empty($objectsrc->remise_percent) ? $objectsrc->remise_percent : (!empty($soc->remise_percent) ? $soc->remise_percent : 0)); $remise_absolue = (!empty($objectsrc->remise_absolue) ? $objectsrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0)); - $dateorder = empty($conf->global->MAIN_AUTOFILL_DATE_ORDER) ?-1 : ''; + $dateorder = empty($conf->global->MAIN_AUTOFILL_DATE_ORDER) ? -1 : ''; $date_delivery = (!empty($objectsrc->delivery_date) ? $objectsrc->delivery_date : ''); if (empty($date_delivery)) { @@ -1526,7 +1526,7 @@ if ($action == 'create' && $usercancreate) { $cond_reglement_id = $soc->cond_reglement_id; $mode_reglement_id = $soc->mode_reglement_id; $fk_account = $soc->fk_account; - $availability_id = $soc->availability_id; + $availability_id = 0; $shipping_method_id = $soc->shipping_method_id; $warehouse_id = $soc->warehouse_id; $demand_reason_id = $soc->demand_reason_id; From 3a48fe2d6627e14d381443c32a25e76b6a1b33b7 Mon Sep 17 00:00:00 2001 From: Vincent Dieltiens Date: Thu, 21 Oct 2021 16:02:47 +0200 Subject: [PATCH 1026/1460] Allow hook 'checkSecureAccess' to change original_file --- htdocs/core/lib/files.lib.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 2175de373ef..2ff2f0ef5ba 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2867,6 +2867,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, if ($fuser->admin) { $accessallowed = 1; // If user is admin } + $tmpmodulepart = explode('-', $modulepart); if (!empty($tmpmodulepart[1])) { $modulepart = $tmpmodulepart[0]; @@ -2946,6 +2947,9 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, ); $reshook = $hookmanager->executeHooks('checkSecureAccess', $parameters, $object); if ($reshook > 0) { + if (!empty($hookmanager->resArray['original_file'])) { + $original_file = $hookmanager->resArray['original_file']; + } if (!empty($hookmanager->resArray['accessallowed'])) { $accessallowed = $hookmanager->resArray['accessallowed']; } From 10a518749d42380b1e6eb2b193b3728fc45bb6ba Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 21 Oct 2021 16:46:04 +0200 Subject: [PATCH 1027/1460] fix: scrutinizer --- htdocs/compta/facture/class/facture-rec.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 92615658a58..4888656b9c7 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -303,8 +303,8 @@ class FactureRec extends CommonInvoice $sql .= ", ".((int) $facsrc->socid); $sql .= ", ".((int) $conf->entity); $sql .= ", '".$this->db->idate($now)."'"; - $sql .= ", ".(!empty($facsrc->amount) ? ((float) $facsrc->amount) : '0'); - $sql .= ", ".(!empty($facsrc->remise) ? ((float) $this->remise) : '0'); + $sql .= ", ".(!empty($facsrc->total_ttc) ? ((float) $facsrc->total_ttc) : '0'); + $sql .= ", ".(!empty($facsrc->remise_absolue) ? ((float) $this->remise_absolue) : '0'); $sql .= ", ".(!empty($this->note_private) ? ("'".$this->db->escape($this->note_private)."'") : "NULL"); $sql .= ", ".(!empty($this->note_public) ? ("'".$this->db->escape($this->note_public)."'") : "NULL"); $sql .= ", ".(!empty($this->model_pdf) ? ("'".$this->db->escape($this->model_pdf)."'") : "NULL"); From e9fe668725229fe25e075562509cf8eedba87f66 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 21 Oct 2021 16:48:04 +0200 Subject: [PATCH 1028/1460] fix: scrutinizer --- htdocs/core/class/commonobjectline.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/core/class/commonobjectline.class.php b/htdocs/core/class/commonobjectline.class.php index 40bcf3aa529..2856b535a3e 100644 --- a/htdocs/core/class/commonobjectline.class.php +++ b/htdocs/core/class/commonobjectline.class.php @@ -51,6 +51,11 @@ abstract class CommonObjectLine extends CommonObject */ public $fk_unit; + public $date_debut_prevue; + public $date_debut_reel; + public $date_fin_prevue; + public $date_fin_reel; + /** * Constructor From 4795190a75739a79c28c0fb75d4c3cdd8fdab10d Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 21 Oct 2021 17:09:48 +0200 Subject: [PATCH 1029/1460] fix: scrutinizer --- htdocs/core/class/commonobject.class.php | 6 +++--- htdocs/core/class/extrafields.class.php | 10 ++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 37083cdf5f8..abb9f05baa8 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6488,7 +6488,7 @@ abstract class CommonObject $out = ''; $type = ''; - $isDependList=0; + $isDependList = 0; $param = array(); $param['options'] = array(); $reg = array(); @@ -6796,7 +6796,7 @@ abstract class CommonObject if (!empty($InfoFieldList[3]) && $parentField) { $parent = $parentName.':'.$obj->{$parentField}; - $isDependList=1; + $isDependList = 1; } $out .= '
    '.$langs->trans("Ref").'
    '; - } - - if (!empty($object->lines)) { - $object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1); - } - - // Form to add new line - if ($object->status == 0 && $permissiontoadd && $action != 'selectlines') { - if ($action != 'editline') { - // Add products/services form - - $parameters = array(); - $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - if (empty($reshook)) - $object->formAddObjectLine(1, $mysoc, $soc); - } - } - - if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { - print '
    '; - } - print '
    '; - - print "\n"; - } - - // Buttons for actions if ($action != 'presend' && $action != 'editline') { From b1be1ceff1660b686f73edc15e8783d95ca4b0aa Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 21 Oct 2021 18:07:02 +0200 Subject: [PATCH 1035/1460] fix scrutinizer --- .../lib/eventorganization_conferenceorbooth.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php b/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php index 3951cc25df7..c26a0f8611c 100644 --- a/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php +++ b/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php @@ -127,6 +127,7 @@ function conferenceorboothProjectPrepareHead($object) $head[$h][2] = 'conferenceorbooth'; // Enable caching of conf or booth count attendees $nbAttendees = 0; + $nbConferenceOrBooth= 0; require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; $cachekey = 'count_conferenceorbooth_project_'.$object->id; $dataretrieved = dol_getcache($cachekey); From 85ec2c408c55f95b88eea408fb9bca5286642355 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 21 Oct 2021 18:15:15 +0200 Subject: [PATCH 1036/1460] fix scrutinizer --- htdocs/core/class/html.formmail.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 823e90fcac3..a375a7223a3 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -157,6 +157,8 @@ class FormMail extends Form public $lines_model; + public $withoptiononeemailperrecipient; + /** * Constructor From 5d854dcce1702532c6b3b17dbc97f5db5a036bea Mon Sep 17 00:00:00 2001 From: javieralapps4up Date: Thu, 21 Oct 2021 18:17:43 +0200 Subject: [PATCH 1037/1460] FIX #19064 Access forbidden when the password of other users is changed Steps to reproduce the behavior User with lire and password (user) perms, but no creer. When this user saves or cancels the edition of the password of another user, he is sent to the prohibited page --- htdocs/core/lib/security.lib.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 4c36244a5bf..89211113d58 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -417,6 +417,9 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f if ($subfeature == 'user' && $user->id == $objectid && $user->rights->user->self->password) { continue; // User can edit its own password } + if ($subfeature == 'user' && $user->id != $objectid && $user->rights->user->user->password) { + continue; // User can edit its own password + } if (empty($user->rights->$feature->$subfeature->creer) && empty($user->rights->$feature->$subfeature->write) From f50dfe85717f1ac9b875ec1a0be66542f82b4ae8 Mon Sep 17 00:00:00 2001 From: javieralapps4up Date: Thu, 21 Oct 2021 18:20:06 +0200 Subject: [PATCH 1038/1460] Update security.lib.php --- htdocs/core/lib/security.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 89211113d58..978fd604021 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -418,7 +418,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f continue; // User can edit its own password } if ($subfeature == 'user' && $user->id != $objectid && $user->rights->user->user->password) { - continue; // User can edit its own password + continue; // User can edit another user's password } if (empty($user->rights->$feature->$subfeature->creer) From d4690ddbdd3d45c0620de163faac990a7f1c8c91 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 21 Oct 2021 18:20:07 +0200 Subject: [PATCH 1039/1460] fix scrutinizer --- htdocs/product/class/productcustomerprice.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index 61cba58c374..d3c23b17c4a 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -871,7 +871,7 @@ class Productcustomerprice extends CommonObject $resultupd = $prodsocpricenew->create($user, 0, $forceupdateaffiliate); if ($result < 0) { $error++; - $this->error = $prodsocpriceupd->error; + $this->error = $prodsocpricenew->error; } } } From 2468c0e120611270573bbcd288fd87f0da601827 Mon Sep 17 00:00:00 2001 From: atm-florian Date: Thu, 21 Oct 2021 18:24:03 +0200 Subject: [PATCH 1040/1460] FIX #19014 - the properties of some fields are not updated when you submit the form + reformatting (one line per array item) --- htdocs/modulebuilder/index.php | 38 ++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index ed090618855..06907b49742 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1296,19 +1296,31 @@ if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) && setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Type")), null, 'errors'); } - if (!$error) { - $addfieldentry = array( - 'name'=>GETPOST('propname', 'aZ09'), 'label'=>GETPOST('proplabel', 'alpha'), 'type'=>GETPOST('proptype', 'alpha'), - 'arrayofkeyval'=>GETPOST('proparrayofkeyval', 'restricthtml'), // Example json string '{"0":"Draft","1":"Active","-1":"Cancel"}' - 'visible'=>GETPOST('propvisible', 'int'), 'enabled'=>GETPOST('propenabled', 'int'), - 'position'=>GETPOST('propposition', 'int'), 'notnull'=>GETPOST('propnotnull', 'int'), 'index'=>GETPOST('propindex', 'int'), 'searchall'=>GETPOST('propsearchall', 'int'), - 'isameasure'=>GETPOST('propisameasure', 'int'), 'comment'=>GETPOST('propcomment', 'alpha'), 'help'=>GETPOST('prophelp', 'alpha'), - 'css'=>GETPOST('propcss', 'aZ09'), 'cssview'=>GETPOST('propcssview', 'aZ09'), 'csslist'=>GETPOST('propcsslist', 'aZ09') - ); + } + if (!$error) { + $addfieldentry = array( + 'name'=>GETPOST('propname', 'aZ09'), + 'label'=>GETPOST('proplabel', 'alpha'), + 'type'=>GETPOST('proptype', 'alpha'), + 'arrayofkeyval'=>GETPOST('proparrayofkeyval', 'restricthtml'), // Example json string '{"0":"Draft","1":"Active","-1":"Cancel"}' + 'visible'=>GETPOST('propvisible', 'int'), + 'enabled'=>GETPOST('propenabled', 'int'), + 'position'=>GETPOST('propposition', 'int'), + 'notnull'=>GETPOST('propnotnull', 'int'), + 'index'=>GETPOST('propindex', 'int'), + 'searchall'=>GETPOST('propsearchall', 'int'), + 'isameasure'=>GETPOST('propisameasure', 'int'), + 'comment'=>GETPOST('propcomment', 'alpha'), + 'help'=>GETPOST('prophelp', 'alpha'), + 'css'=>GETPOST('propcss', 'aZ09'), + 'cssview'=>GETPOST('propcssview', 'aZ09'), + 'csslist'=>GETPOST('propcsslist', 'aZ09'), + 'default'=>GETPOST('propdefault', 'restricthtml'), + 'noteditable'=>intval(GETPOST('propnoteditable', 'int')), + ); - if (!empty($addfieldentry['arrayofkeyval']) && !is_array($addfieldentry['arrayofkeyval'])) { - $addfieldentry['arrayofkeyval'] = json_decode($addfieldentry['arrayofkeyval'], true); - } + if (!empty($addfieldentry['arrayofkeyval']) && !is_array($addfieldentry['arrayofkeyval'])) { + $addfieldentry['arrayofkeyval'] = json_decode($addfieldentry['arrayofkeyval'], true); } } @@ -2800,7 +2812,7 @@ if ($module == 'initmodule') { print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; From 03765528e155afc6f4756a71c6acd811b854b743 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Thu, 21 Oct 2021 18:42:06 +0200 Subject: [PATCH 1041/1460] Contract line : update boolean --- htdocs/core/class/commonobject.class.php | 6 ++++++ htdocs/core/class/extrafields.class.php | 13 ++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 1013da7c430..d4f17cc81f7 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5971,6 +5971,12 @@ abstract class CommonObject dol_syslog('Error bad setup of extrafield', LOG_WARNING); } break; + + case 'boolean': + if (empty($this->array_options["options_".$key])) { + $this->array_options["options_".$key] = null; + } + break; } } diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index abc2cd2bd49..56fb54cefbe 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -2216,15 +2216,22 @@ class ExtraFields $value_arr = (array) $value_arr; $value_key = implode(',', $value_arr); } elseif (in_array($key_type, array('price', 'double', 'int'))) { - if (!GETPOSTISSET($keysuffix."options_".$key.$keyprefix)) { + if (!GETPOSTISSET($keysuffix . "options_" . $key . $keyprefix)) { continue; // Value was not provided, we should not set it. } - $value_arr = GETPOST($keysuffix."options_".$key.$keyprefix); - if ($keysuffix != 'search_') { // If value is for a search, we must keep complex string like '>100 <=150' + $value_arr = GETPOST($keysuffix . "options_" . $key . $keyprefix); + if ($keysuffix != 'search_') { // If value is for a search, we must keep complex string like '>100 <=150' $value_key = price2num($value_arr); } else { $value_key = $value_arr; } + } elseif (in_array($key_type, array('boolean'))) { + if (!GETPOSTISSET($keysuffix."options_".$key.$keyprefix)) { + $value_key = ''; + } else { + $value_arr = GETPOST($keysuffix."options_".$key.$keyprefix); + $value_key = $value_arr; + } } else { if (!GETPOSTISSET($keysuffix."options_".$key.$keyprefix)) { continue; // Value was not provided, we should not set it. From bdc8854baa885769a32b7522675693f5cbab11f5 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Thu, 21 Oct 2021 18:54:07 +0200 Subject: [PATCH 1042/1460] Clean --- htdocs/core/class/commonobject.class.php | 6 ------ htdocs/core/class/extrafields.class.php | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index d4f17cc81f7..1013da7c430 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5971,12 +5971,6 @@ abstract class CommonObject dol_syslog('Error bad setup of extrafield', LOG_WARNING); } break; - - case 'boolean': - if (empty($this->array_options["options_".$key])) { - $this->array_options["options_".$key] = null; - } - break; } } diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 56fb54cefbe..fc28abe6aa6 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -2216,10 +2216,10 @@ class ExtraFields $value_arr = (array) $value_arr; $value_key = implode(',', $value_arr); } elseif (in_array($key_type, array('price', 'double', 'int'))) { - if (!GETPOSTISSET($keysuffix . "options_" . $key . $keyprefix)) { + if (!GETPOSTISSET($keysuffix."options_".$key.$keyprefix)) { continue; // Value was not provided, we should not set it. } - $value_arr = GETPOST($keysuffix . "options_" . $key . $keyprefix); + $value_arr = GETPOST($keysuffix."options_".$key.$keyprefix); if ($keysuffix != 'search_') { // If value is for a search, we must keep complex string like '>100 <=150' $value_key = price2num($value_arr); } else { From 24cc74cd3abff12d84de22e810fbe4370e7cdc06 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 21 Oct 2021 19:00:48 +0200 Subject: [PATCH 1043/1460] fix scrutinizer --- htdocs/projet/class/project.class.php | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 368fb3c2982..5d56f6a295d 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1601,17 +1601,18 @@ class Project extends CommonObject foreach (array('internal', 'external') as $source) { $tab = $origin_project->liste_contact(-1, $source); - - foreach ($tab as $contacttoadd) { - $clone_project->add_contact($contacttoadd['id'], $contacttoadd['code'], $contacttoadd['source'], $notrigger); - if ($clone_project->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { - $langs->load("errors"); - $this->error .= $langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"); - $error++; - } else { - if ($clone_project->error != '') { - $this->error .= $clone_project->error; + if (is_array($tab) && count($tab)>0) { + foreach ($tab as $contacttoadd) { + $clone_project->add_contact($contacttoadd['id'], $contacttoadd['code'], $contacttoadd['source'], $notrigger); + if ($clone_project->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { + $langs->load("errors"); + $this->error .= $langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"); $error++; + } else { + if ($clone_project->error != '') { + $this->error .= $clone_project->error; + $error++; + } } } } @@ -1660,7 +1661,7 @@ class Project extends CommonObject foreach ($tasksarray as $tasktoclone) { $result_clone = $taskstatic->createFromClone($user, $tasktoclone->id, $clone_project_id, $tasktoclone->fk_parent, $move_date, true, false, $clone_task_file, true, false); if ($result_clone <= 0) { - $this->error .= $result_clone->error; + $this->error .= $taskstatic->error; $error++; } else { $new_task_id = $result_clone; @@ -1714,6 +1715,7 @@ class Project extends CommonObject global $user, $langs, $conf; $error = 0; + $result = 0; $taskstatic = new Task($this->db); From 2780f30d58e491d8fc657a1c4047d7f230cd4222 Mon Sep 17 00:00:00 2001 From: Theo Date: Thu, 21 Oct 2021 19:05:13 +0200 Subject: [PATCH 1044/1460] fix: ticket tags/categories edit --- htdocs/langs/fr_FR/categories.lang | 1 + htdocs/ticket/card.php | 52 +++++++++++++++++++++++++++--- 2 files changed, 49 insertions(+), 4 deletions(-) diff --git a/htdocs/langs/fr_FR/categories.lang b/htdocs/langs/fr_FR/categories.lang index cf549eb8670..62bb2267283 100644 --- a/htdocs/langs/fr_FR/categories.lang +++ b/htdocs/langs/fr_FR/categories.lang @@ -89,6 +89,7 @@ CategorieRecursiv=Lier automatiquement avec le(a) tag/catégorie parent(e) CategorieRecursivHelp=Si l'option est activé, quand un produit est ajouté dans une sous-catégorie, le produit sera ajouté aussi dans la catégorie parente. AddProductServiceIntoCategory=Ajouter le produit/service suivant AddCustomerIntoCategory=Assigner cette catégorie au client +AddTicketIntoCategory=Assigner cette catégorie au ticket AddSupplierIntoCategory=Assigner cette catégorie au fournisseur ShowCategory=Afficher tag/catégorie ByDefaultInList=Par défaut dans la liste diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 4f0ddb962ca..67c4aaf2ed6 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -532,6 +532,16 @@ if (empty($reshook)) { } } + if ($action == 'set_categories' && $user->rights->ticket->write) { + if ($object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) { + $result = $object->setCategories(GETPOST('categories', 'array')); + + $url = 'card.php?action=view&track_id='.$object->track_id; + header("Location: ".$url); + exit(); + } + } + if ($action == 'setsubject' && $user->rights->ticket->write) { if ($object->fetch(GETPOST('id', 'int'))) { if ($action == 'setsubject') { @@ -787,7 +797,7 @@ if ($action == 'create' || $action == 'presend') { print $form->buttonsSaveCancel(); print ''; */ -} elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'dellink' || $action == 'presend' || $action == 'presend_addmessage' || $action == 'close' || $action == 'abandon' || $action == 'delete' || $action == 'editcustomer' || $action == 'progression' || $action == 'reopen' +} elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'dellink' || $action == 'presend' || $action == 'presend_addmessage' || $action == 'close' || $action == 'abandon' || $action == 'delete' || $action == 'editcustomer' || $action == 'progression' || $action == 'categories' || $action == 'reopen' || $action == 'editsubject' || $action == 'edit_extras' || $action == 'update_extras' || $action == 'edit_extrafields' || $action == 'set_extrafields' || $action == 'classify' || $action == 'sel_contract' || $action == 'edit_message_init' || $action == 'set_status' || $action == 'dellink') { if ($res > 0) { // or for unauthorized internals users @@ -1101,9 +1111,43 @@ if ($action == 'create' || $action == 'presend') { // Categories if ($conf->categorie->enabled) { - print ''.$langs->trans("Categories").''; - print $form->showCategories($object->id, Categorie::TYPE_TICKET, 1); - print ""; + print ''; + print ''; + print ''; + } + print '
    '; + print $langs->trans("Categories"); + if ($action != 'categories' && !$user->socid) { + print ''.img_edit($langs->trans('Modify')).'
    '; + print ''; + + if ($user->rights->ticket->write && $action == 'categories') { + $cate_arbo = $form->select_all_categories(Categorie::TYPE_TICKET, '', 'parent', 64, 0, 1); + if (count($cate_arbo)) { + // Categories + print ''; + print '
    '; + print ''; + print ''; + print ''; + + $category = new Categorie($db); + $cats = $category->containing($object->id, 'ticket'); + $arrayselected = array(); + foreach ($cats as $cat) { + $arrayselected[] = $cat->id; + } + + print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0); + print ''; + print '
    '; + print ""; + } + } else { + print ''; + print $form->showCategories($object->id, Categorie::TYPE_TICKET, 1); + print ""; + } } // Other attributes From ac27532d62448c55b9a149ced2bad37cdc9499e5 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 21 Oct 2021 19:06:40 +0200 Subject: [PATCH 1045/1460] fix scrutinzer --- htdocs/projet/contact.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php index 1af3488bf5c..ce9674dfd0a 100644 --- a/htdocs/projet/contact.php +++ b/htdocs/projet/contact.php @@ -94,7 +94,7 @@ if ($action == 'addcontact') { foreach ($task_array as $task) { $task_already_affected=false; $personsLinked = $task->liste_contact(-1, $source); - if (!is_array($personsLinked) && coun($personsLinked) < 0) { + if (!is_array($personsLinked) && count($personsLinked) < 0) { setEventMessage($object->error, 'errors'); } else { foreach ($personsLinked as $person) { From 3bdec20364ceeaf41bb295787ee65dce38c5e184 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 21 Oct 2021 19:09:13 +0200 Subject: [PATCH 1046/1460] fix scrutinzer --- htdocs/projet/tasks/task.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 2ae9bb7cc80..54e238ab0c7 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -403,8 +403,8 @@ if ($id > 0 || !empty($ref)) { // Third party print ''.$langs->trans("ThirdParty").''; - if ($projectstatic->societe->id) { - print $projectstatic->societe->getNomUrl(1); + if ($projectstatic->thirdparty->id) { + print $projectstatic->thirdparty->getNomUrl(1); } else { print ' '; } From 96722d55efa2395bff07d808f9b2eea05dca2083 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 21 Oct 2021 19:13:05 +0200 Subject: [PATCH 1047/1460] fix scrutinzer --- htdocs/categories/class/categorie.class.php | 6 ++++-- htdocs/core/class/commonobject.class.php | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index d5c135279bf..e7c361322bc 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -728,8 +728,6 @@ class Categorie extends CommonObject } } - - // Call trigger $this->context = array('linkto'=>$obj); // Save object we want to link category to into category instance to provide information to trigger $result = $this->call_trigger('CATEGORY_LINK', $user); @@ -755,6 +753,8 @@ class Categorie extends CommonObject } return -1; } + + return 0; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -810,6 +810,8 @@ class Categorie extends CommonObject $this->error = $this->db->lasterror(); return -1; } + + return 0; } /** diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index abb9f05baa8..9383759fb8e 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -9461,7 +9461,7 @@ abstract class CommonObject } $error = 0; - $ok=0; + $ok = 0; // Process foreach ($to_del as $del) { @@ -9473,7 +9473,7 @@ abstract class CommonObject $this->errors = $c->errors; break; } else { - $ok+=$result; + $ok += $result; } } } @@ -9486,7 +9486,7 @@ abstract class CommonObject $this->errors = $c->errors; break; } else { - $ok+=$result; + $ok += $result; } } } From df25880d5560dc8b27f437e4e9df18066d6640f2 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 21 Oct 2021 19:18:01 +0200 Subject: [PATCH 1048/1460] fix scrutinzer --- htdocs/societe/price.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index bf19fc0385b..a24b6a4776c 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -326,22 +326,14 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { $text = $langs->trans('SellingPrice'); print $form->textwithpicto($text, $langs->trans("PrecisionUnitIsLimitedToXDecimals", $conf->global->MAIN_MAX_DECIMALS_UNIT), 1, 1); print ''; - if ($object->price_base_type == 'TTC') { - print ''; - } else { - print ''; - } + print ''; print ''; // Price minimum print ''; $text = $langs->trans('MinPrice'); print $form->textwithpicto($text, $langs->trans("PrecisionUnitIsLimitedToXDecimals", $conf->global->MAIN_MAX_DECIMALS_UNIT), 1, 1); - if ($object->price_base_type == 'TTC') { - print ''; - } else { - print ''; - } + print ''; print ''; // Update all child soc From 7970f4ba5c0f1bbe94f8ce27fa155d4bcab67a2e Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 21 Oct 2021 22:24:35 +0200 Subject: [PATCH 1049/1460] fix scrutinzer --- htdocs/projet/class/project.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 5d56f6a295d..622098240c8 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1615,6 +1615,9 @@ class Project extends CommonObject } } } + } elseif ($tab < 0) { + $this->error .= $origin_project->error; + $error++; } } } From db6c7930447cecd8065a6f3259334e6891b725eb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 21 Oct 2021 22:31:51 +0200 Subject: [PATCH 1050/1460] Text in english --- htdocs/core/modules/modUser.class.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/core/modules/modUser.class.php b/htdocs/core/modules/modUser.class.php index e54ac7bd440..292fc227db5 100644 --- a/htdocs/core/modules/modUser.class.php +++ b/htdocs/core/modules/modUser.class.php @@ -90,7 +90,7 @@ class modUser extends DolibarrModules $r++; $this->rights[$r][0] = 251; - $this->rights[$r][1] = 'Consulter les autres utilisateurs'; + $this->rights[$r][1] = 'Read information of other users'; $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'user'; @@ -98,7 +98,7 @@ class modUser extends DolibarrModules $r++; $this->rights[$r][0] = 252; - $this->rights[$r][1] = 'Consulter les permissions des autres utilisateurs'; + $this->rights[$r][1] = 'Read permissions of other users'; $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'user_advance'; @@ -106,7 +106,7 @@ class modUser extends DolibarrModules $r++; $this->rights[$r][0] = 253; - $this->rights[$r][1] = 'Creer/modifier utilisateurs internes et externes'; + $this->rights[$r][1] = 'Create/modify internal and external users'; $this->rights[$r][2] = 'w'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'user'; @@ -114,7 +114,7 @@ class modUser extends DolibarrModules $r++; $this->rights[$r][0] = 254; - $this->rights[$r][1] = 'Creer/modifier utilisateurs externes seulement'; + $this->rights[$r][1] = 'Create/modify external users only'; $this->rights[$r][2] = 'w'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'user_advance'; @@ -122,7 +122,7 @@ class modUser extends DolibarrModules $r++; $this->rights[$r][0] = 255; - $this->rights[$r][1] = 'Modifier le mot de passe des autres utilisateurs'; + $this->rights[$r][1] = 'Modify the password of other users'; $this->rights[$r][2] = 'w'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'user'; @@ -130,7 +130,7 @@ class modUser extends DolibarrModules $r++; $this->rights[$r][0] = 256; - $this->rights[$r][1] = 'Supprimer ou desactiver les autres utilisateurs'; + $this->rights[$r][1] = 'Delete or disable other users'; $this->rights[$r][2] = 'd'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'user'; @@ -138,7 +138,7 @@ class modUser extends DolibarrModules $r++; $this->rights[$r][0] = 341; - $this->rights[$r][1] = 'Consulter ses propres permissions'; + $this->rights[$r][1] = 'Read its own permissions'; $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'self_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on @@ -146,7 +146,7 @@ class modUser extends DolibarrModules $r++; $this->rights[$r][0] = 342; - $this->rights[$r][1] = 'Creer/modifier ses propres infos utilisateur'; + $this->rights[$r][1] = 'Create/modify of its own user'; $this->rights[$r][2] = 'w'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'self'; @@ -154,7 +154,7 @@ class modUser extends DolibarrModules $r++; $this->rights[$r][0] = 343; - $this->rights[$r][1] = 'Modifier son propre mot de passe'; + $this->rights[$r][1] = 'Modify its own password'; $this->rights[$r][2] = 'w'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'self'; @@ -162,7 +162,7 @@ class modUser extends DolibarrModules $r++; $this->rights[$r][0] = 344; - $this->rights[$r][1] = 'Modifier ses propres permissions'; + $this->rights[$r][1] = 'Modify its own permissions'; $this->rights[$r][2] = 'w'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'self_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on @@ -202,7 +202,7 @@ class modUser extends DolibarrModules $r++; $this->rights[$r][0] = 358; - $this->rights[$r][1] = 'Exporter les utilisateurs'; + $this->rights[$r][1] = 'Export all users'; $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'user'; From 09c8b9669639628203a3b29c30ae9fbcab0b93e4 Mon Sep 17 00:00:00 2001 From: Nicolas SILOBRE <45969285+ns-info90@users.noreply.github.com> Date: Thu, 21 Oct 2021 22:44:57 +0200 Subject: [PATCH 1051/1460] Fix can't generate pdf last_main_doc --- htdocs/install/mysql/tables/llx_mrp_mo.sql | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/tables/llx_mrp_mo.sql b/htdocs/install/mysql/tables/llx_mrp_mo.sql index 185ea1583c9..88dc5d42789 100644 --- a/htdocs/install/mysql/tables/llx_mrp_mo.sql +++ b/htdocs/install/mysql/tables/llx_mrp_mo.sql @@ -39,6 +39,7 @@ CREATE TABLE llx_mrp_mo( date_start_planned datetime, date_end_planned datetime, fk_bom integer, - fk_project integer + fk_project integer, + last_main_doc varchar(255) -- END MODULEBUILDER FIELDS -) ENGINE=innodb; \ No newline at end of file +) ENGINE=innodb; From 9630b07b42fe9f136d22e2a1c6f4b5bb0349e082 Mon Sep 17 00:00:00 2001 From: Nicolas SILOBRE <45969285+ns-info90@users.noreply.github.com> Date: Thu, 21 Oct 2021 22:49:02 +0200 Subject: [PATCH 1052/1460] Update 14.0.0-15.0.0.sql --- htdocs/install/mysql/migration/14.0.0-15.0.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql index 34e8859596a..46f0963c371 100644 --- a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql +++ b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql @@ -59,7 +59,7 @@ ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD UNIQUE INDEX uk_ -- VMYSQL4.3 ALTER TABLE llx_eventorganization_conferenceorboothattendee MODIFY COLUMN fk_actioncomm integer NULL; -- VPGSQL8.2 ALTER TABLE llx_eventorganization_conferenceorboothattendee ALTER COLUMN fk_actioncomm DROP NOT NULL; - +ALTER TABLE llx_mrp_mo ADD COLUMN last_main_doc varchar(255); UPDATE llx_extrafields SET elementtype = 'salary' WHERE elementtype = 'payment_salary'; ALTER TABLE llx_payment_salary_extrafields RENAME TO llx_salary_extrafields; From ae6cae0313a1dc196aea26e73053ce08711dcb2d Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Thu, 21 Oct 2021 22:57:50 +0200 Subject: [PATCH 1053/1460] Fix MAIN_USE_EXPENSE_RULE is now stable --- htdocs/core/lib/expensereport.lib.php | 10 ++++------ htdocs/expensereport/card.php | 17 +++++++++++++++-- .../expensereport/class/expensereport.class.php | 16 +++++++++------- .../class/expensereport_ik.class.php | 2 +- 4 files changed, 29 insertions(+), 16 deletions(-) diff --git a/htdocs/core/lib/expensereport.lib.php b/htdocs/core/lib/expensereport.lib.php index 8e27ef12466..3287227a05d 100644 --- a/htdocs/core/lib/expensereport.lib.php +++ b/htdocs/core/lib/expensereport.lib.php @@ -140,12 +140,10 @@ function expensereport_admin_prepare_head() $head[$h][2] = 'expensereport'; $h++; - if (!empty($conf->global->MAIN_USE_EXPENSE_RULE)) { - $head[$h][0] = DOL_URL_ROOT."/admin/expensereport_rules.php"; - $head[$h][1] = $langs->trans("ExpenseReportsRules"); - $head[$h][2] = 'expenserules'; - $h++; - } + $head[$h][0] = DOL_URL_ROOT."/admin/expensereport_rules.php"; + $head[$h][1] = $langs->trans("ExpenseReportsRules"); + $head[$h][2] = 'expenserules'; + $h++; if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { $head[$h][0] = DOL_URL_ROOT."/admin/expensereport_ik.php"; diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 5a4f7c57b61..736acf5683d 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -2050,6 +2050,11 @@ if ($action == 'create') { // Picture print ''; print ''; + + // Information if theres a rule restriction + print ''; + print ''; + // Ajout des boutons de modification/suppression if (($object->status < 2 || $object->status == 99) && $user->rights->expensereport->creer) { print ''; @@ -2190,6 +2195,10 @@ if ($action == 'create') { } print ''; + print ''; + print !empty($line->rule_warning_message) ? img_info(html_entity_decode($line->rule_warning_message)) : ' '; + print ''; + // Ajout des boutons de modification/suppression if (($object->status < ExpenseReport::STATUS_VALIDATED || $object->status == ExpenseReport::STATUS_REFUSED) && $user->rights->expensereport->creer) { print ''; @@ -2209,7 +2218,7 @@ if ($action == 'create') { if ($action == 'editline' && $line->rowid == GETPOST('rowid', 'int')) { // Add line with link to add new file or attach line to an existing file - $colspan = 10; + $colspan = 11; if (!empty($conf->projet->enabled)) { $colspan++; } @@ -2336,6 +2345,9 @@ if ($action == 'create') { print ''; //print $line->fk_ecm_files; print ''; + // Information if theres a rule restriction + print ''; + print ''; print ''; print ''; @@ -2351,7 +2363,7 @@ if ($action == 'create') { // Add a new line if (($object->status == ExpenseReport::STATUS_DRAFT || $object->status == ExpenseReport::STATUS_REFUSED) && $action != 'editline' && $user->rights->expensereport->creer) { - $colspan = 11; + $colspan = 12; if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { $colspan++; } @@ -2448,6 +2460,7 @@ if ($action == 'create') { print ''; print ''; print ''; + print ''; print ''; print ''; diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 64034c10a3f..b58a478f3c0 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -998,7 +998,7 @@ class ExpenseReport extends CommonObject $sql .= ' de.localtax1_tx, de.localtax2_tx, de.localtax1_type, de.localtax2_type,'; $sql .= ' de.fk_ecm_files,'; $sql .= ' de.total_ht, de.total_tva, de.total_ttc,'; - $sql .= ' de.total_localtax1, de.total_localtax2,'; + $sql .= ' de.total_localtax1, de.total_localtax2, de.rule_warning_message,'; $sql .= ' ctf.code as code_type_fees, ctf.label as libelle_type_fees,'; $sql .= ' p.ref as ref_projet, p.title as title_projet'; $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element_line.' as de'; @@ -1055,6 +1055,8 @@ class ExpenseReport extends CommonObject $deplig->projet_ref = $objp->ref_projet; $deplig->projet_title = $objp->title_projet; + $deplig->rule_warning_message = $objp->rule_warning_message; + $deplig->rang = $objp->rang; $this->lines[$i] = $deplig; @@ -1874,10 +1876,6 @@ class ExpenseReport extends CommonObject $langs->load('trips'); - if (empty($conf->global->MAIN_USE_EXPENSE_RULE)) { - return true; // if don't use rules - } - // We don't know seller and buyer for expense reports if (!is_object($seller)) { $seller = $mysoc; // We use same than current company (expense report are often done in same country) @@ -1975,7 +1973,7 @@ class ExpenseReport extends CommonObject } //$buyer = new Societe($this->db); - $expenseik = new ExpenseReportIk($db); + $expenseik = new ExpenseReportIk($this->db); $range = $expenseik->getRangeByUser($userauthor, $this->line->fk_c_exp_tax_cat); if (empty($range)) { @@ -2603,6 +2601,8 @@ class ExpenseReportLine */ public $fk_ecm_files; + public $rule_warning_message; + /** * Constructor @@ -2624,7 +2624,7 @@ class ExpenseReportLine { $sql = 'SELECT fde.rowid, fde.fk_expensereport, fde.fk_c_type_fees, fde.fk_c_exp_tax_cat, fde.fk_projet as fk_project, fde.date,'; $sql .= ' fde.tva_tx as vatrate, fde.vat_src_code, fde.comments, fde.qty, fde.value_unit, fde.total_ht, fde.total_tva, fde.total_ttc, fde.fk_ecm_files,'; - $sql .= ' fde.localtax1_tx, fde.localtax2_tx, fde.localtax1_type, fde.localtax2_type, fde.total_localtax1, fde.total_localtax2,'; + $sql .= ' fde.localtax1_tx, fde.localtax2_tx, fde.localtax1_type, fde.localtax2_type, fde.total_localtax1, fde.total_localtax2, fde.rule_warning_message,'; $sql .= ' ctf.code as type_fees_code, ctf.label as type_fees_libelle,'; $sql .= ' pjt.rowid as projet_id, pjt.title as projet_title, pjt.ref as projet_ref'; $sql .= ' FROM '.MAIN_DB_PREFIX.'expensereport_det as fde'; @@ -2670,6 +2670,8 @@ class ExpenseReportLine $this->fk_ecm_files = $objp->fk_ecm_files; + $this->rule_warning_message = $objp->rule_warning_message; + $this->db->free($result); } else { dol_print_error($this->db); diff --git a/htdocs/expensereport/class/expensereport_ik.class.php b/htdocs/expensereport/class/expensereport_ik.class.php index da2312bdcb1..53cf3695b12 100644 --- a/htdocs/expensereport/class/expensereport_ik.class.php +++ b/htdocs/expensereport/class/expensereport_ik.class.php @@ -165,7 +165,7 @@ class ExpenseReportIk extends CoreObject $sql .= ' INNER JOIN '.MAIN_DB_PREFIX.'c_exp_tax_cat c ON (r.fk_c_exp_tax_cat = c.rowid)'; } $sql .= ' WHERE r.fk_c_exp_tax_cat = '.((int) $fk_c_exp_tax_cat); - $sql .= " AND entity IN(0, ".getEntity($this->element).")"; + $sql .= " AND r.entity IN(0, ".getEntity($this->element).")"; if ($active) { $sql .= ' AND r.active = 1 AND c.active = 1'; } From 15dd0f7ab3e2ecbd85c63a32c62f2a65dbd686d7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 21 Oct 2021 23:34:25 +0200 Subject: [PATCH 1054/1460] New feature --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 2d957f1dbb2..3f5fad835f7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,7 @@ For users: --------------- NEW: Online proposal signature +NEW: Can define some max limit on expense report (per period, per type or expense, ...) NEW: Allow the use of __NEWREF__ to get for example the new reference a draft order will get after validation. NEW: #18326 Workflow: Close order on shipment closing. NEW: #18401 Add __NEWREF__ subtitute to get new object reference. From 860fb21d2db049835e8e12c58b564703c275ba15 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Thu, 21 Oct 2021 23:50:20 +0200 Subject: [PATCH 1055/1460] Fix expense report warning display + translations --- htdocs/expensereport/card.php | 2 +- htdocs/expensereport/class/expensereport.class.php | 4 ++-- htdocs/langs/en_US/trips.lang | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 736acf5683d..2942358545b 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -2196,7 +2196,7 @@ if ($action == 'create') { print ''; print ''; - print !empty($line->rule_warning_message) ? img_info(html_entity_decode($line->rule_warning_message)) : ' '; + print !empty($line->rule_warning_message) ? img_warning(html_entity_decode($line->rule_warning_message)) : ' '; print ''; // Ajout des boutons de modification/suppression diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index b58a478f3c0..877a7c79ade 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -1912,12 +1912,12 @@ class ExpenseReport extends CommonObject $this->errors[] = $this->error; $new_current_total_ttc -= $amount_to_test - $rule->amount; // ex, entered 16€, limit 12€, subtracts 4€; - $rule_warning_message_tab[] = $langs->trans('ExpenseReportConstraintViolationError', $rule->id, price($amount_to_test, 0, $langs, 1, -1, -1, $conf->currency), price($rule->amount, 0, $langs, 1, -1, -1, $conf->currency), $langs->trans('by'.$rule->code_expense_rules_type, price($new_current_total_ttc, 0, $langs, 1, -1, -1, $conf->currency))); + $rule_warning_message_tab[] = $langs->trans('ExpenseReportConstraintViolationError', $rule->id, price($amount_to_test, 0, $langs, 1, -1, -1, $conf->currency), price($rule->amount, 0, $langs, 1, -1, -1, $conf->currency)); } else { $this->error = 'ExpenseReportConstraintViolationWarning'; $this->errors[] = $this->error; - $rule_warning_message_tab[] = $langs->trans('ExpenseReportConstraintViolationWarning', $rule->id, price($amount_to_test, 0, $langs, 1, -1, -1, $conf->currency), price($rule->amount, 0, $langs, 1, -1, -1, $conf->currency), $langs->trans('nolimitby'.$rule->code_expense_rules_type)); + $rule_warning_message_tab[] = $langs->trans('ExpenseReportConstraintViolationWarning', $rule->id, price($amount_to_test, 0, $langs, 1, -1, -1, $conf->currency), price($rule->amount, 0, $langs, 1, -1, -1, $conf->currency)); } // No break, we sould test if another rule is violated diff --git a/htdocs/langs/en_US/trips.lang b/htdocs/langs/en_US/trips.lang index c9a6c792077..9210ede360c 100644 --- a/htdocs/langs/en_US/trips.lang +++ b/htdocs/langs/en_US/trips.lang @@ -112,7 +112,7 @@ ConfirmCloneExpenseReport=Are you sure you want to clone this expense report ? ExpenseReportsIk=Configuration of mileage charges ExpenseReportsRules=Expense report rules ExpenseReportIkDesc=You can modify the calculation of kilometers expense by category and range who they are previously defined. d is the distance in kilometers -ExpenseReportRulesDesc=You can create or update any rules of calculation. This part will be used when user will create a new expense report +ExpenseReportRulesDesc=You can define max amount rules for expense reports. These rules will be applied when a new expense is added to an expense report expenseReportOffset=Offset expenseReportCoef=Coefficient expenseReportTotalForFive=Example with d = 5 @@ -127,19 +127,19 @@ ExpenseReportDomain=Domain to apply ExpenseReportLimitOn=Limit on ExpenseReportDateStart=Date start ExpenseReportDateEnd=Date end -ExpenseReportLimitAmount=Limite amount -ExpenseReportRestrictive=Restrictive +ExpenseReportLimitAmount=Max amount +ExpenseReportRestrictive=Exceeding forbidden AllExpenseReport=All type of expense report OnExpense=Expense line ExpenseReportRuleSave=Expense report rule saved ExpenseReportRuleErrorOnSave=Error: %s RangeNum=Range %d -ExpenseReportConstraintViolationError=Constraint violation id [%s]: %s is superior to %s %s +ExpenseReportConstraintViolationError=Max amount exceeded (rule %s): %s is higher than %s (Exceeding forbidden) byEX_DAY=by day (limitation to %s) byEX_MON=by month (limitation to %s) byEX_YEA=by year (limitation to %s) byEX_EXP=by line (limitation to %s) -ExpenseReportConstraintViolationWarning=Constraint violation id [%s]: %s is superior to %s %s +ExpenseReportConstraintViolationWarning=Max amount exceeded (rule %s): %s is higher than %s (Exceeding authorized) nolimitbyEX_DAY=by day (no limitation) nolimitbyEX_MON=by month (no limitation) nolimitbyEX_YEA=by year (no limitation) From 0c47a88098bf8f132e9e1e22405eee6b9f7e7d8b Mon Sep 17 00:00:00 2001 From: Polkiko Date: Thu, 21 Oct 2021 23:53:37 +0200 Subject: [PATCH 1056/1460] FIX Content line substitution in email --- htdocs/admin/mails_templates.php | 39 ++++++----------------- htdocs/core/class/html.formmail.class.php | 2 +- htdocs/core/tpl/card_presend.tpl.php | 1 + htdocs/langs/en_US/admin.lang | 1 + htdocs/langs/es_ES/admin.lang | 1 + 5 files changed, 13 insertions(+), 31 deletions(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 3545892d486..dbb670039d2 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -893,7 +893,7 @@ if ($resql) { $valuetoshow = $langs->trans("Content"); $showfield = 0; } if ($fieldlist[$field] == 'content_lines') { - $valuetoshow = $langs->trans("ContentLines"); $showfield = 0; + $valuetoshow = $langs->trans("ContentForLines"); $showfield = 0; } // Show fields @@ -972,6 +972,14 @@ if ($resql) { $doleditor = new DolEditor($tmpfieldlist.'-'.$rowid, (!empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : ''), '', 500, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_6, '90%'); print $doleditor->Create(1); } + if ($tmpfieldlist == 'content_lines') { + print $form->textwithpicto($langs->trans("ContentForLines"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist).'
    '; + $okforextended = true; + if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) + $okforextended = false; + $doleditor = new DolEditor($tmpfieldlist.'-'.$rowid, (! empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : ''), '', 140, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_6, '90%'); + print $doleditor->Create(1); + } print ''; print ''; print ''; @@ -1113,35 +1121,6 @@ if ($resql) { //else print ''.img_delete().''; // Some dictionary can be edited by other profile than admin } print ''; - - /* - $fieldsforcontent = array('content'); - if (! empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) - { - $fieldsforcontent = array('content', 'content_lines'); - } - foreach ($fieldsforcontent as $tmpfieldlist) - { - $showfield = 1; - $align = "left"; - $valuetoshow = $obj->{$tmpfieldlist}; - - $class = 'tddict'; - // Show value for field - if ($showfield) { - - print ''; // To create an artificial CR for the current tr we are on - $okforextended = true; - if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) - $okforextended = false; - $doleditor = new DolEditor($tmpfieldlist.'-'.$i, (! empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : ''), '', 140, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_6, '90%', 1); - print $doleditor->Create(1); - print ''; - print ''; - - } - }*/ - print "\n"; } diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 3dc2743adf1..e636cede798 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1523,7 +1523,7 @@ class FormMail extends Form $product = new Product($this->db); $product->fetch($line->fk_product, '', '', 1); $product->fetch_optionals(); - if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0) { + if (is_array($extrafields->attributes[$product->table_element]['label']) && count($extrafields->attributes[$product->table_element]['label']) > 0) { foreach ($extrafields->attributes[$product->table_element]['label'] as $key => $label) { $substit_line['__PRODUCT_EXTRAFIELD_'.strtoupper($key).'__'] = $product->array_options['options_'.$key]; } diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index cbc7a8a688b..8295a29df4a 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -207,6 +207,7 @@ if ($action == 'presend') { } // Make substitution in email content + $formmail->setSubstitFromObject($object, $langs); $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, $arrayoffamiliestoexclude, $object); $substitutionarray['__CHECK_READ__'] = (is_object($object) && is_object($object->thirdparty)) ? '' : ''; $substitutionarray['__PERSONALIZED__'] = ''; // deprecated diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 367f68e6a9b..7c24ddab9a3 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -278,6 +278,7 @@ SpaceX=Space X SpaceY=Space Y FontSize=Font size Content=Content +ContentForLines=Content to display for each product or service (from variable __LINES__ of Content) NoticePeriod=Notice period NewByMonth=New by month Emails=Emails diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index dc8459672b8..3222bdb7f5f 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -277,6 +277,7 @@ SpaceX=Área X SpaceY=Área Y FontSize=Tamaño de fuente Content=Contenido +ContentForLines=Contenido a mostrar por cada línea de producto o servicio (de la variable __LINES__ definida en Contenido) NoticePeriod=Plazo de aviso NewByMonth=Nuevo por mes Emails=E-Mails From 3f5d8d9a202ed1cfbdde85a5ec06ea988df6243a Mon Sep 17 00:00:00 2001 From: Laurent Magnin Date: Fri, 22 Oct 2021 00:00:47 +0200 Subject: [PATCH 1057/1460] Fix : Listing responsive for ticket PR for responsive table --- htdocs/ticket/list.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 1f2816520bf..2566ee81073 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -478,8 +478,7 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ // Output page // -------------------------------------------------------------------- -llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'classforhorizontalscrolloftabs'); - +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', ''); if ($socid && !$projectid && !$project_ref && $user->rights->societe->lire) { $socstat = new Societe($db); From 7c449892bb2c44f890f3af88f3ca67cefad9678f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 22 Oct 2021 00:19:10 +0200 Subject: [PATCH 1058/1460] fix display --- htdocs/projet/tasks/time.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 83f27c11796..6271f0695fd 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -773,7 +773,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { print '
    '; } if (!empty($conf->eventorganization->enabled)) { - print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; + print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; $htmltext = $langs->trans("EventOrganizationDescriptionLong"); print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); } From 75f579c3ad88a9eea3529bbd5808545ec908321b Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 22 Oct 2021 00:59:09 +0200 Subject: [PATCH 1059/1460] New table element_tag --- .../mysql/tables/llx_element_tag.key.sql | 23 ++++++++++++++++++ .../install/mysql/tables/llx_element_tag.sql | 24 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 htdocs/install/mysql/tables/llx_element_tag.key.sql create mode 100644 htdocs/install/mysql/tables/llx_element_tag.sql diff --git a/htdocs/install/mysql/tables/llx_element_tag.key.sql b/htdocs/install/mysql/tables/llx_element_tag.key.sql new file mode 100644 index 00000000000..fc1e3e7861d --- /dev/null +++ b/htdocs/install/mysql/tables/llx_element_tag.key.sql @@ -0,0 +1,23 @@ +-- ============================================================================ +-- Copyright (C) 2021 Maxime Kohlhaas +-- +-- 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 . +-- +-- ============================================================================ + +ALTER TABLE llx_element_tag ADD PRIMARY KEY pk_element_tag (fk_categorie, fk_socpeople); +ALTER TABLE llx_element_tag ADD INDEX idx_element_tag_fk_categorie (fk_categorie); +ALTER TABLE llx_element_tag ADD INDEX idx_element_tag_fk_socpeople (fk_socpeople); + +ALTER TABLE llx_element_tag ADD CONSTRAINT fk_element_tag_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid); diff --git a/htdocs/install/mysql/tables/llx_element_tag.sql b/htdocs/install/mysql/tables/llx_element_tag.sql new file mode 100644 index 00000000000..937137727e7 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_element_tag.sql @@ -0,0 +1,24 @@ +-- ============================================================================ +-- Copyright (C) 2021 Maxime Kohlhaas +-- +-- 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 . +-- +-- ============================================================================ + +create table llx_element_tag +( + fk_categorie integer NOT NULL, + fk_element integer NOT NULL, + import_key varchar(14) +)ENGINE=innodb; From 0020a5c61c8ed1e6265baee6dc115643d143b2f6 Mon Sep 17 00:00:00 2001 From: javieralapps4up Date: Fri, 22 Oct 2021 02:53:37 +0200 Subject: [PATCH 1060/1460] Update card.php When you edit a user (with read others and change password others), the form allows the civility_code to be changed but the changes are not saved. I will propose a change in the user card to avoid this --- htdocs/user/card.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 8d03d1d1cfb..429de7fd1a6 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -2036,7 +2036,11 @@ if ($action == 'create' || $action == 'adduserldap') { // Civility print ''; - print $formcompany->select_civility(GETPOSTISSET("civility_code") ? GETPOST("civility_code", 'aZ09') : $object->civility_code, 'civility_code'); + if ($caneditfield && !$object->ldap_sid) { + print $formcompany->select_civility(GETPOSTISSET("civility_code") ? GETPOST("civility_code", 'aZ09') : $object->civility_code, 'civility_code'); + } elseif ($object->civility_code) { + print $langs->trans("Civility".$object->civility_code); + } print ''; // Lastname From 0c8291b60fd4ecf936e221220b3a79d46c55a161 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 22 Oct 2021 04:35:23 +0200 Subject: [PATCH 1061/1460] Fix INNER JOIN & Add urlencode() --- htdocs/compta/resultat/clientfourn.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 1d2edd5c918..b5aca49aaae 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -864,7 +864,7 @@ if ($modecompta == 'BOOKKEEPING') { $sql = "SELECT u.rowid, u.firstname, u.lastname, s.fk_user as fk_user, p.label as label, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount"; $sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as p"; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."salary as s ON s.rowid=p.fk_salary"; + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."salary as s ON s.rowid=p.fk_salary"; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=s.fk_user"; $sql .= " WHERE p.entity IN (".getEntity('payment_salary').")"; if (!empty($date_start) && !empty($date_end)) { @@ -917,7 +917,7 @@ if ($modecompta == 'BOOKKEEPING') { $userstatic = new User($db); $userstatic->fetch($obj->fk_user); - print "".$langs->trans("Salary")." getFullName($langs)."\">".$obj->firstname." ".$obj->lastname."\n"; + print "".$langs->trans("Salary")." getFullName($langs))."\">".$obj->firstname." ".$obj->lastname."\n"; if ($modecompta == 'CREANCES-DETTES') { print ''.price(-$obj->amount).''; From d1c9877c411640022079aa3b4d34bcd3b08cfba6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 22 Oct 2021 07:02:44 +0200 Subject: [PATCH 1062/1460] fix missing code comment --- htdocs/core/lib/date.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 8514ab56554..e7ab98ca3b6 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -115,6 +115,7 @@ function getServerTimeZoneInt($refgmtdate = 'now') * @param int $time Date timestamp (or string with format YYYY-MM-DD) * @param int $duration_value Value of delay to add * @param int $duration_unit Unit of added delay (d, m, y, w, h, i) + * @param int $ruleforendofmonth Change the behavior of PHP over data-interval, 0 or 1 * @return int New timestamp */ function dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth = 0) From 0adb910e56586115e2329b6395a910304562c916 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 22 Oct 2021 07:27:10 +0200 Subject: [PATCH 1063/1460] fix sql error --- htdocs/eventorganization/conferenceorbooth_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index d6266ec241e..c02306ba6be 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -487,7 +487,7 @@ $sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key.', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : ''); } } // Add fields from hooks From e2e3e8ef7b1a561a3700d7edf8b3844a08f354e8 Mon Sep 17 00:00:00 2001 From: Dennis Priskorn <68460690+dpriskorn@users.noreply.github.com> Date: Fri, 22 Oct 2021 10:18:23 +0200 Subject: [PATCH 1064/1460] Update api_supplier_invoices.class.php Add 2 examples --- htdocs/fourn/class/api_supplier_invoices.class.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htdocs/fourn/class/api_supplier_invoices.class.php b/htdocs/fourn/class/api_supplier_invoices.class.php index df1bf36b723..4c2b66caa96 100644 --- a/htdocs/fourn/class/api_supplier_invoices.class.php +++ b/htdocs/fourn/class/api_supplier_invoices.class.php @@ -201,6 +201,10 @@ class SupplierInvoices extends DolibarrApi /** * Create supplier invoice object * + * Note: soc_id = dolibarr_order_id + * + * Example: {'ref': 'auto', 'ref_supplier': '7985630', 'socid': 1, 'note': 'Inserted with Python', 'order_supplier': 1, 'date': '2021-07-28'} + * * @param array $request_data Request datas * * @return int ID of supplier invoice @@ -525,6 +529,10 @@ class SupplierInvoices extends DolibarrApi /** * Add a line to given supplier invoice * + * Note: socid = dolibarr_order_id, pu_ht = net price, remise = discount + * + * Example: {'socid': 1, 'qty': 1, 'pu_ht': 21.0, 'tva_tx': 25.0, 'fk_product': '1189', 'product_type': 0, 'remise_percent': 1.0, 'vat_src_code': None} + * * @param int $id Id of supplier invoice to update * @param array $request_data supplier invoice line data * From 4d63586e2a5de90a10c3ec932f70f645407db4e7 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 22 Oct 2021 08:22:23 +0000 Subject: [PATCH 1065/1460] Fixing style errors. --- htdocs/fourn/class/api_supplier_invoices.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/api_supplier_invoices.class.php b/htdocs/fourn/class/api_supplier_invoices.class.php index 4c2b66caa96..51cd2673b0b 100644 --- a/htdocs/fourn/class/api_supplier_invoices.class.php +++ b/htdocs/fourn/class/api_supplier_invoices.class.php @@ -204,7 +204,7 @@ class SupplierInvoices extends DolibarrApi * Note: soc_id = dolibarr_order_id * * Example: {'ref': 'auto', 'ref_supplier': '7985630', 'socid': 1, 'note': 'Inserted with Python', 'order_supplier': 1, 'date': '2021-07-28'} - * + * * @param array $request_data Request datas * * @return int ID of supplier invoice From 962aa9f977ae7869f0d16ee3fde856ecb525ff24 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 22 Oct 2021 10:49:01 +0200 Subject: [PATCH 1066/1460] Fix #yogosha7494 --- htdocs/document.php | 2 ++ htdocs/viewimage.php | 1 + 2 files changed, 3 insertions(+) diff --git a/htdocs/document.php b/htdocs/document.php index 3c06801c9a0..e2cf8fb3c92 100644 --- a/htdocs/document.php +++ b/htdocs/document.php @@ -195,9 +195,11 @@ if (!in_array($type, array('text/x-javascript')) && !dolIsAllowedForPreview($ori } // Security: Delete string ../ or ..\ into $original_file +$original_file = preg_replace('/\.\.+/','..', $original_file); // Replace '... or more' with '..' $original_file = str_replace('../', '/', $original_file); $original_file = str_replace('..\\', '/', $original_file); + // Find the subdirectory name as the reference $refname = basename(dirname($original_file)."/"); diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index f514c7c0302..0e91bd5bc9f 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -222,6 +222,7 @@ if (preg_match('/\.noexe$/i', $original_file)) { } // Security: Delete string ../ or ..\ into $original_file +$original_file = preg_replace('/\.\.+/', '..', $original_file); // Replace '... or more' with '..' $original_file = str_replace('../', '/', $original_file); $original_file = str_replace('..\\', '/', $original_file); From 64bb2e6ece88cd6e92821e6dcf920e508d3a91e2 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 22 Oct 2021 10:49:47 +0200 Subject: [PATCH 1067/1460] fix various warning --- htdocs/core/boxes/box_supplier_orders_awaiting_reception.php | 1 + htdocs/user/class/user.class.php | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php index 8125a848fd0..78d38455d83 100644 --- a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php +++ b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php @@ -97,6 +97,7 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes } $sql .= " WHERE c.fk_soc = s.rowid"; $sql .= " AND c.entity IN (".getEntity('supplier_order').")"; + $sql .= " AND c.date_livraison IS NOT NULL"; $sql .= " AND c.fk_statut IN (".CommandeFournisseur::STATUS_ORDERSENT.", ".CommandeFournisseur::STATUS_RECEIVED_PARTIALLY.")"; if (!$user->rights->societe->client->voir && !$user->socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 0554c2c7983..844c1ae626b 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -289,6 +289,7 @@ class User extends CommonObject */ public $rights; + /** * @var int All permissions are loaded */ @@ -365,6 +366,7 @@ class User extends CommonObject */ public function __construct($db) { + global $conf; $this->db = $db; // User preference @@ -384,6 +386,9 @@ class User extends CommonObject $this->rights->user = new stdClass(); $this->rights->user->user = new stdClass(); $this->rights->user->self = new stdClass(); + $this->rights->user->user_advance = new stdClass(); + $this->rights->user->self_advance = new stdClass(); + $this->rights->user->group_advance = new stdClass(); } /** From ba8ef15916ac2a12ec47a499c207dd45d47fea50 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 22 Oct 2021 08:50:15 +0000 Subject: [PATCH 1068/1460] Fixing style errors. --- htdocs/document.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/document.php b/htdocs/document.php index e2cf8fb3c92..d6f6584bb6f 100644 --- a/htdocs/document.php +++ b/htdocs/document.php @@ -195,7 +195,7 @@ if (!in_array($type, array('text/x-javascript')) && !dolIsAllowedForPreview($ori } // Security: Delete string ../ or ..\ into $original_file -$original_file = preg_replace('/\.\.+/','..', $original_file); // Replace '... or more' with '..' +$original_file = preg_replace('/\.\.+/', '..', $original_file); // Replace '... or more' with '..' $original_file = str_replace('../', '/', $original_file); $original_file = str_replace('..\\', '/', $original_file); From 444f7703a6f2acad1b00128c06e09eb9c3244fc0 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 22 Oct 2021 10:50:24 +0200 Subject: [PATCH 1069/1460] fix various warning --- htdocs/user/class/user.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 844c1ae626b..24200460d05 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -366,7 +366,6 @@ class User extends CommonObject */ public function __construct($db) { - global $conf; $this->db = $db; // User preference From 9a9ed8989e85c89e1113025a91c7366c61234003 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 22 Oct 2021 10:50:54 +0200 Subject: [PATCH 1070/1460] fix various warning --- htdocs/user/class/user.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 24200460d05..9540f082a4c 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -289,7 +289,6 @@ class User extends CommonObject */ public $rights; - /** * @var int All permissions are loaded */ From 0c770b8810eaa5bf9a91a9705c2f10b380b8f24f Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 22 Oct 2021 10:54:33 +0200 Subject: [PATCH 1071/1460] fix various warning --- htdocs/core/lib/admin.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 3cd4b058a81..1122d434498 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1101,7 +1101,7 @@ function activateModule($value, $withdeps = 1) if (!count($ret['errors'])) { $ret['nbmodules']++; - $ret['nbperms'] += count($objMod->rights); + $ret['nbperms'] += (is_array($objMod->rights)?count($objMod->rights):0); } return $ret; From 6c71cc1e1454feb1cb0520f873ac2954496926fb Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 22 Oct 2021 11:03:35 +0200 Subject: [PATCH 1072/1460] better correction from modulebuilder source of #19081 --- htdocs/compta/cashcontrol/cashcontrol_list.php | 2 +- htdocs/modulebuilder/template/myobject_list.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php index 407e8b3cf73..49919e33e58 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_list.php +++ b/htdocs/compta/cashcontrol/cashcontrol_list.php @@ -223,7 +223,7 @@ $sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key.', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : ''); } } // Add fields from hooks diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index fe067eb7fc5..a3462b99418 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -265,7 +265,7 @@ $sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key.', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : ''); } } // Add fields from hooks From c789b12715052f3aa875edc2746fc0be2bea72a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 22 Oct 2021 11:07:38 +0200 Subject: [PATCH 1073/1460] fix more than one extrafield cause bug sql --- htdocs/compta/cashcontrol/cashcontrol_list.php | 2 +- htdocs/eventorganization/conferenceorboothattendee_list.php | 2 +- htdocs/hrm/evaluation_list.php | 2 +- htdocs/hrm/job_list.php | 2 +- htdocs/hrm/position_list.php | 2 +- htdocs/hrm/skill_list.php | 2 +- htdocs/product/inventory/list.php | 2 +- htdocs/recruitment/recruitmentjobposition_list.php | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php index 21a6c56689e..b46ff9433e3 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_list.php +++ b/htdocs/compta/cashcontrol/cashcontrol_list.php @@ -223,7 +223,7 @@ $sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key.', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : ''); } } // Add fields from hooks diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index 3fe20e3c814..12d62e0ab76 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -266,7 +266,7 @@ $sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key.', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : ''); } } // Add fields from hooks diff --git a/htdocs/hrm/evaluation_list.php b/htdocs/hrm/evaluation_list.php index 54c4d547ffe..a713b37ca48 100644 --- a/htdocs/hrm/evaluation_list.php +++ b/htdocs/hrm/evaluation_list.php @@ -268,7 +268,7 @@ $sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key.', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : ''); } } // Add fields from hooks diff --git a/htdocs/hrm/job_list.php b/htdocs/hrm/job_list.php index 0c169616f5a..ebd4535e6e7 100644 --- a/htdocs/hrm/job_list.php +++ b/htdocs/hrm/job_list.php @@ -268,7 +268,7 @@ $sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key.', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : ''); } } // Add fields from hooks diff --git a/htdocs/hrm/position_list.php b/htdocs/hrm/position_list.php index 60e69bfac3f..3877a6ea14d 100644 --- a/htdocs/hrm/position_list.php +++ b/htdocs/hrm/position_list.php @@ -268,7 +268,7 @@ $sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key.', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : ''); } } // Add fields from hooks diff --git a/htdocs/hrm/skill_list.php b/htdocs/hrm/skill_list.php index c0af4e28edc..fc2998d046a 100644 --- a/htdocs/hrm/skill_list.php +++ b/htdocs/hrm/skill_list.php @@ -268,7 +268,7 @@ $sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key.', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : ''); } } // Add fields from hooks diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index 44726bb489c..41e43fdf433 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -205,7 +205,7 @@ $sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key.', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : ''); } } // Add fields from hooks diff --git a/htdocs/recruitment/recruitmentjobposition_list.php b/htdocs/recruitment/recruitmentjobposition_list.php index 26a3a81e998..29fde993e25 100644 --- a/htdocs/recruitment/recruitmentjobposition_list.php +++ b/htdocs/recruitment/recruitmentjobposition_list.php @@ -246,7 +246,7 @@ $sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key.', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : ''); } } // Add fields from hooks From 0d868aa0d9eb3cc670c3f536aace6176a3662958 Mon Sep 17 00:00:00 2001 From: Theo Date: Fri, 22 Oct 2021 11:14:04 +0200 Subject: [PATCH 1074/1460] Fix: can't delete categories when linked to some objects --- htdocs/categories/class/categorie.class.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index d5c135279bf..7547d04e2e4 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -626,12 +626,18 @@ class Categorie extends CommonObject } $arraydelete = array( - 'categorie_societe' => 'fk_categorie', - 'categorie_fournisseur' => 'fk_categorie', 'categorie_product' => 'fk_categorie', + 'categorie_fournisseur' => 'fk_categorie', + 'categorie_societe' => 'fk_categorie', 'categorie_member' => 'fk_categorie', 'categorie_contact' => 'fk_categorie', + 'categorie_user' => 'fk_categorie', + 'categorie_project' => 'fk_categorie', 'categorie_account' => 'fk_categorie', + 'categorie_website_page' => 'fk_categorie', + 'categorie_warehouse' => 'fk_categorie', + 'categorie_actioncomm' => 'fk_categorie', + 'categorie_ticket' => 'fk_categorie', 'bank_class' => 'fk_categ', 'categorie_lang' => 'fk_category', 'categorie' => 'rowid', From 98eb07d6f250ce36d06eeff2658e38719d03b420 Mon Sep 17 00:00:00 2001 From: Richard Franks Date: Fri, 22 Oct 2021 10:39:14 +0100 Subject: [PATCH 1075/1460] FIX #18695 Added ref_ext to supplier invoice Added ref_ext to the fields for create, fetch and update functions on fournisseur.facture class. This enables the REST API to use this field for additional information. --- htdocs/fourn/class/fournisseur.facture.class.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 4bca77809cb..2601c610e15 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -415,6 +415,7 @@ class FactureFournisseur extends CommonInvoice $sql = "INSERT INTO ".MAIN_DB_PREFIX."facture_fourn ("; $sql .= "ref"; $sql .= ", ref_supplier"; + $sql .= ", ref_ext"; $sql .= ", entity"; $sql .= ", type"; $sql .= ", libelle"; @@ -438,6 +439,7 @@ class FactureFournisseur extends CommonInvoice $sql .= " VALUES ("; $sql .= "'(PROV)'"; $sql .= ", '".$this->db->escape($this->ref_supplier)."'"; + $sql .= ", '".$this->db->escape($this->ref_ext)."'"; $sql .= ", ".$conf->entity; $sql .= ", '".$this->db->escape($this->type)."'"; $sql .= ", '".$this->db->escape(isset($this->label) ? $this->label : (isset($this->libelle) ? $this->libelle : ''))."'"; @@ -647,6 +649,7 @@ class FactureFournisseur extends CommonInvoice $sql .= " t.rowid,"; $sql .= " t.ref,"; $sql .= " t.ref_supplier,"; + $sql .= " t.ref_ext,"; $sql .= " t.entity,"; $sql .= " t.type,"; $sql .= " t.fk_soc,"; @@ -708,6 +711,7 @@ class FactureFournisseur extends CommonInvoice $this->ref = $obj->ref ? $obj->ref : $obj->rowid; // We take rowid if ref is empty for backward compatibility $this->ref_supplier = $obj->ref_supplier; + $this->ref_ext = $obj->ref_ext; $this->entity = $obj->entity; $this->type = empty($obj->type) ? self::TYPE_STANDARD : $obj->type; $this->fk_soc = $obj->fk_soc; @@ -924,6 +928,9 @@ class FactureFournisseur extends CommonInvoice if (isset($this->ref_supplier)) { $this->ref_supplier = trim($this->ref_supplier); } + if (isset($this->ref_ext)) { + $this->ref_ext = trim($this->ref_ext); + } if (isset($this->entity)) { $this->entity = trim($this->entity); } @@ -1013,6 +1020,7 @@ class FactureFournisseur extends CommonInvoice $sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn SET"; $sql .= " ref=".(isset($this->ref) ? "'".$this->db->escape($this->ref)."'" : "null").","; $sql .= " ref_supplier=".(isset($this->ref_supplier) ? "'".$this->db->escape($this->ref_supplier)."'" : "null").","; + $sql .= " ref_ext=".(isset($this->ref_ext) ? "'".$this->db->escape($this->ref_ext)."'" : "null").","; $sql .= " entity=".(isset($this->entity) ? $this->entity : "null").","; $sql .= " type=".(isset($this->type) ? $this->type : "null").","; $sql .= " fk_soc=".(isset($this->fk_soc) ? $this->fk_soc : "null").","; From b3f15167dca7d85bb633b8335619192c18b12fcf Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller Date: Fri, 22 Oct 2021 11:55:21 +0200 Subject: [PATCH 1076/1460] Fix : Error on fetchAll on line --- htdocs/core/class/commonobjectline.class.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/htdocs/core/class/commonobjectline.class.php b/htdocs/core/class/commonobjectline.class.php index 2856b535a3e..d93d0b67ff9 100644 --- a/htdocs/core/class/commonobjectline.class.php +++ b/htdocs/core/class/commonobjectline.class.php @@ -111,4 +111,20 @@ abstract class CommonObjectLine extends CommonObject return -1; } } + + /** + * Empty function to prevent errors on call of this function must be overload if usefull + * + * @param string $sortorder Sort Order + * @param string $sortfield Sort field + * @param int $limit offset limit + * @param int $offset offset limit + * @param array $filter filter array + * @param string $filtermode filter mode (AND or OR) + * @return int <0 if KO, >0 if OK + */ + public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND') + { + return 0; + } } From f354427b3cfc8478383126f70d2f0595c8697aa4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 22 Oct 2021 11:58:00 +0200 Subject: [PATCH 1077/1460] Fix warning --- htdocs/core/class/extrafields.class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 4f9b9c470d9..cb2cb892adf 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1653,10 +1653,14 @@ class ExtraFields $showsize = 0; if ($type == 'date') { $showsize = 10; - $value = dol_print_date($value, 'day'); // For date without hour, date is always GMT for storage and output + if ($value !== '') { + $value = dol_print_date($value, 'day'); // For date without hour, date is always GMT for storage and output + } } elseif ($type == 'datetime') { $showsize = 19; - $value = dol_print_date($value, 'dayhour', 'tzuserrel'); + if ($value !== '') { + $value = dol_print_date($value, 'dayhour', 'tzuserrel'); + } } elseif ($type == 'int') { $showsize = 10; } elseif ($type == 'double') { From 33e4d750d71a15f399d0d908139bf3321f67a3d8 Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller Date: Fri, 22 Oct 2021 12:01:46 +0200 Subject: [PATCH 1078/1460] Fix: scrutinizer errors + boxes activation --- htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php | 2 ++ htdocs/core/class/dolgraph.class.php | 1 + htdocs/core/class/html.formticket.class.php | 2 ++ htdocs/install/mysql/migration/14.0.0-15.0.0.sql | 5 +++++ htdocs/mrp/class/api_mos.class.php | 4 ++-- htdocs/mrp/class/mo.class.php | 1 + 6 files changed, 13 insertions(+), 2 deletions(-) diff --git a/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php b/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php index 98aed557557..f37bda11104 100644 --- a/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php +++ b/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php @@ -65,6 +65,8 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes public function loadBox($max = 5) { global $conf, $user, $langs; + $dataseries = ""; + $graphtoshow = ""; $badgeStatus0 = '#cbd3d3'; // draft $badgeStatus1 = '#bc9526'; // validated diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index a892c557b34..26701cde6ff 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -1054,6 +1054,7 @@ class DolGraph } $showlegend = $this->showlegend; + $bordercolor = ""; $legends = array(); $nblot = 0; diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 89260c35d03..b9f320b7db8 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -753,6 +753,8 @@ class FormTicket print ajax_combobox('select'.$htmlname); } elseif ($htmlname!='') { + $selectedgroups = array(); + $groupvalue = ""; $groupticket=GETPOST($htmlname, 'aZ09'); $child_id=GETPOST($htmlname.'_child_id', 'aZ09')?GETPOST($htmlname.'_child_id', 'aZ09'):0; if (!empty($groupticket)) { diff --git a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql index 34e8859596a..12fa6d2cb01 100644 --- a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql +++ b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql @@ -378,3 +378,8 @@ ALTER TABLE llx_societe_perentity ADD COLUMN accountancy_code_customer varchar(2 ALTER TABLE llx_societe_perentity ADD COLUMN accountancy_code_supplier varchar(24) AFTER accountancy_code_customer; -- equivalent to code_compta_supplier in llx_societe ALTER TABLE llx_projet_task ADD COLUMN budget_amount double(24,8) AFTER priority; + +-- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_graph_ticket_by_severity.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_graph_ticket_by_severity.php' AND entity = 1); +-- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_graph_nb_ticket_last_x_days.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_graph_nb_ticket_last_x_days.php' AND entity = 1); +-- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_graph_nb_tickets_type.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_graph_nb_tickets_type.php' AND entity = 1); +-- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_graph_new_vs_close_ticket.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_graph_new_vs_close_ticket.php' AND entity = 1); diff --git a/htdocs/mrp/class/api_mos.class.php b/htdocs/mrp/class/api_mos.class.php index 92351184ebe..105fb58082e 100644 --- a/htdocs/mrp/class/api_mos.class.php +++ b/htdocs/mrp/class/api_mos.class.php @@ -491,7 +491,7 @@ class Mos extends DolibarrApi if (!$error && $line->fk_warehouse > 0) { // Record stock movement $id_product_batch = 0; - $stockmove->origin = $this->mo; + $stockmove->origin = 'mo'; if ($qtytoprocess >= 0) { $idstockmove = $stockmove->livraison(DolibarrApiAccess::$user, $line->fk_product, $line->fk_warehouse, $qtytoprocess, 0, $labelmovement, dol_now(), '', '', $tmpproduct->status_batch, $id_product_batch, $codemovement); } else { @@ -550,7 +550,7 @@ class Mos extends DolibarrApi if (!$error && $line->fk_warehouse > 0) { // Record stock movement $id_product_batch = 0; - $stockmove->origin = $this->mo; + $stockmove->origin = 'mo'; if ($qtytoprocess >= 0) { $idstockmove = $stockmove->livraison(DolibarrApiAccess::$user, $line->fk_product, $line->fk_warehouse, $qtytoprocess, 0, $labelmovement, dol_now(), '', '', $tmpproduct->status_batch, $id_product_batch, $codemovement); } else { diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index a7ed52687df..cdad4e71968 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -625,6 +625,7 @@ class Mo extends CommonObject public function updateProduction(User $user, $notrigger = true) { $error = 0; + $role = ""; if ($this->status != self::STATUS_DRAFT) { $this->error = 'BadStatus'; From 3f211417c2218b927b31a1c3335d7797f3265182 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 22 Oct 2021 12:19:16 +0200 Subject: [PATCH 1079/1460] review --- htdocs/core/modules/modSociete.class.php | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index 2cba93e29b7..c3eba65673b 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -121,27 +121,6 @@ class modSociete extends DolibarrModules $this->const[$r][4] = 0; $r++; - $this->const[$r][0] = "SOCIETE_SHOW_VAT_IN_LIST"; - $this->const[$r][1] = "yesno"; - $this->const[$r][2] = "0"; - $this->const[$r][3] = "Display customer ref into select list"; - $this->const[$r][4] = 0; - $r++; - - $this->const[$r][0] = "COMPANY_USE_SEARCH_TO_SELECT"; - $this->const[$r][1] = "yesno"; - $this->const[$r][2] = "0"; - $this->const[$r][3] = "Use easy find customer"; - $this->const[$r][4] = 0; - $r++; - - $this->const[$r][0] = "CONTACT_USE_SEARCH_TO_SELECT"; - $this->const[$r][1] = "yesno"; - $this->const[$r][2] = "0"; - $this->const[$r][3] = "use easy find contact"; - $this->const[$r][4] = 0; - $r++; - // Boxes $this->boxes = array( 0=>array('file'=>'box_clients.php', 'enabledbydefaulton'=>'Home'), From 1ecd0a2be7aab670bb5f6eed0a9cf49f57899b30 Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller Date: Fri, 22 Oct 2021 14:17:47 +0200 Subject: [PATCH 1080/1460] Fix : french labels of box_graph_new_vs_close --- htdocs/core/boxes/box_graph_new_vs_close_ticket.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/boxes/box_graph_new_vs_close_ticket.php b/htdocs/core/boxes/box_graph_new_vs_close_ticket.php index ce8d7ab0078..435cc76451e 100644 --- a/htdocs/core/boxes/box_graph_new_vs_close_ticket.php +++ b/htdocs/core/boxes/box_graph_new_vs_close_ticket.php @@ -98,10 +98,10 @@ class box_graph_new_vs_close_ticket extends ModeleBoxes $num = $this->db->num_rows($resql); if ($num > 0) { $objp = $this->db->fetch_object($resql); - $data[] = array($langs->trans('TicketCreatedToday'), $objp->nb); + $data[] = array($langs->transnoentitiesnoconv('TicketCreatedToday'), $objp->nb); $totalnb += $objp->nb; } else { - $data[] = array($langs->trans('TicketCreatedToday'), 0); + $data[] = array($langs->transnoentitiesnoconv('TicketCreatedToday'), 0); } } else { dol_print_error($this->db); @@ -116,10 +116,10 @@ class box_graph_new_vs_close_ticket extends ModeleBoxes $num = $this->db->num_rows($resql); if ($num > 0) { $objp = $this->db->fetch_object($resql); - $data[] = array($langs->trans('TicketClosedToday'), $objp->nb); + $data[] = array($langs->transnoentitiesnoconv('TicketClosedToday'), $objp->nb); $totalnb += $objp->nb; } else { - $data[] = array($langs->trans('TicketClosedToday'), 0); + $data[] = array($langs->transnoentitiesnoconv('TicketClosedToday'), 0); } } else { dol_print_error($this->db); From f7923003e1405e9b6a64a81158c95fa794d0de40 Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller Date: Fri, 22 Oct 2021 14:27:42 +0200 Subject: [PATCH 1081/1460] better fix for api_mos.class.php --- htdocs/mrp/class/api_mos.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/mrp/class/api_mos.class.php b/htdocs/mrp/class/api_mos.class.php index 105fb58082e..86d4758b45f 100644 --- a/htdocs/mrp/class/api_mos.class.php +++ b/htdocs/mrp/class/api_mos.class.php @@ -491,7 +491,8 @@ class Mos extends DolibarrApi if (!$error && $line->fk_warehouse > 0) { // Record stock movement $id_product_batch = 0; - $stockmove->origin = 'mo'; + $stockmove->origin_type = 'mo'; + $stockmove->origin_id = $this->mo->id; if ($qtytoprocess >= 0) { $idstockmove = $stockmove->livraison(DolibarrApiAccess::$user, $line->fk_product, $line->fk_warehouse, $qtytoprocess, 0, $labelmovement, dol_now(), '', '', $tmpproduct->status_batch, $id_product_batch, $codemovement); } else { @@ -550,7 +551,8 @@ class Mos extends DolibarrApi if (!$error && $line->fk_warehouse > 0) { // Record stock movement $id_product_batch = 0; - $stockmove->origin = 'mo'; + $stockmove->origin_type = 'mo'; + $stockmove->origin_id = $this->mo->id; if ($qtytoprocess >= 0) { $idstockmove = $stockmove->livraison(DolibarrApiAccess::$user, $line->fk_product, $line->fk_warehouse, $qtytoprocess, 0, $labelmovement, dol_now(), '', '', $tmpproduct->status_batch, $id_product_batch, $codemovement); } else { From db779c217566a43325391090bec34a128daa67e8 Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller Date: Fri, 22 Oct 2021 14:34:40 +0200 Subject: [PATCH 1082/1460] Fix : knowledgerecord_card clone part --- htdocs/knowledgemanagement/knowledgerecord_card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/knowledgemanagement/knowledgerecord_card.php b/htdocs/knowledgemanagement/knowledgerecord_card.php index 8af0431f361..f94dee0003c 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_card.php +++ b/htdocs/knowledgemanagement/knowledgerecord_card.php @@ -418,7 +418,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } // Clone - print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&token='.newToken().'&object=scrumsprint', '', $permissiontoadd); + print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=clone&token='.newToken().'&object=scrumsprint', '', $permissiontoadd); /* if ($permissiontoadd) { From b94d74f194e0b96aa9f382b94a0cdb00242e2650 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 22 Oct 2021 14:58:09 +0200 Subject: [PATCH 1083/1460] fix php8 warning --- .../tpl/extrafields_list_print_fields.tpl.php | 3 +++ htdocs/societe/consumption.php | 24 ++++++++++--------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index 7d547d52dea..280be4de434 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -50,6 +50,9 @@ if (!empty($extrafieldsobjectkey) && !empty($extrafields->attributes[$extrafield print $extrafields->showOutputField($key, $value, '', $extrafieldsobjectkey); print ''; if (!$i) { + if (empty($totalarray)) { + $totalarray['nbfield'] = 0; + } $totalarray['nbfield']++; } diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index c4bd26e1fc2..bbaf9e1c5de 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -50,6 +50,8 @@ $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$optioncss = GETPOST('optioncss', 'alpha'); + if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -160,16 +162,16 @@ if ($object->client) { $obj = $db->fetch_object($resql); $nbFactsClient = $obj->nb; $thirdTypeArray['customer'] = $langs->trans("customer"); - if ($conf->propal->enabled && $user->rights->propal->lire) { + if (!empty($conf->propal->enabled) && $user->rights->propal->lire) { $elementTypeArray['propal'] = $langs->transnoentitiesnoconv('Proposals'); } - if ($conf->commande->enabled && $user->rights->commande->lire) { + if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { $elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders'); } - if ($conf->facture->enabled && $user->rights->facture->lire) { + if (!empty($conf->facture->enabled) && $user->rights->facture->lire) { $elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices'); } - if ($conf->contrat->enabled && $user->rights->contrat->lire) { + if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) { $elementTypeArray['contract'] = $langs->transnoentitiesnoconv('Contracts'); } } @@ -232,7 +234,7 @@ $sql_select = ''; if ($type_element == 'fichinter') { // Customer : show products from invoices require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; $documentstatic = new Fichinter($db); - $sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, \'1\' as doc_type, f.datec as dateprint, f.fk_statut as status, '; + $sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, \'1\' as doc_type, f.datec as dateprint, f.fk_statut as status, NULL as paid,'; $tables_from = MAIN_DB_PREFIX."fichinter as f LEFT JOIN ".MAIN_DB_PREFIX."fichinterdet as d ON d.fk_fichinter = f.rowid"; // Must use left join to work also with option that disable usage of lines. $where = " WHERE f.fk_soc = s.rowid AND s.rowid = ".((int) $socid); $where .= " AND f.entity = ".$conf->entity; @@ -254,7 +256,7 @@ if ($type_element == 'invoice') { // Customer : show products from invoices if ($type_element == 'propal') { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; $documentstatic = new Propal($db); - $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.datep as dateprint, c.fk_statut as status, '; + $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.datep as dateprint, c.fk_statut as status, NULL as paid,'; $tables_from = MAIN_DB_PREFIX."propal as c,".MAIN_DB_PREFIX."propaldet as d"; $where = " WHERE c.fk_soc = s.rowid AND s.rowid = ".((int) $socid); $where .= " AND d.fk_propal = c.rowid"; @@ -266,7 +268,7 @@ if ($type_element == 'propal') { if ($type_element == 'order') { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; $documentstatic = new Commande($db); - $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_commande as dateprint, c.fk_statut as status, '; + $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_commande as dateprint, c.fk_statut as status, NULL as paid, '; $tables_from = MAIN_DB_PREFIX."commande as c,".MAIN_DB_PREFIX."commandedet as d"; $where = " WHERE c.fk_soc = s.rowid AND s.rowid = ".((int) $socid); $where .= " AND d.fk_commande = c.rowid"; @@ -290,7 +292,7 @@ if ($type_element == 'supplier_invoice') { // Supplier : Show products from inv if ($type_element == 'supplier_proposal') { require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; $documentstatic = new SupplierProposal($db); - $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_valid as dateprint, c.fk_statut as status, '; + $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_valid as dateprint, c.fk_statut as status, NULL as paid, '; $tables_from = MAIN_DB_PREFIX."supplier_proposal as c,".MAIN_DB_PREFIX."supplier_proposaldet as d"; $where = " WHERE c.fk_soc = s.rowid AND s.rowid = ".((int) $socid); $where .= " AND d.fk_supplier_proposal = c.rowid"; @@ -302,7 +304,7 @@ if ($type_element == 'supplier_proposal') { if ($type_element == 'supplier_order') { // Supplier : Show products from orders. require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; $documentstatic = new CommandeFournisseur($db); - $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_valid as dateprint, c.fk_statut as status, '; + $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_valid as dateprint, c.fk_statut as status, NULL as paid, '; $tables_from = MAIN_DB_PREFIX."commande_fournisseur as c,".MAIN_DB_PREFIX."commande_fournisseurdet as d"; $where = " WHERE c.fk_soc = s.rowid AND s.rowid = ".((int) $socid); $where .= " AND d.fk_commande = c.rowid"; @@ -315,7 +317,7 @@ if ($type_element == 'contract') { // Order require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; $documentstatic = new Contrat($db); $documentstaticline = new ContratLigne($db); - $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_contrat as dateprint, d.statut as status, '; + $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_contrat as dateprint, d.statut as status, NULL as paid,'; $tables_from = MAIN_DB_PREFIX."contrat as c,".MAIN_DB_PREFIX."contratdet as d"; $where = " WHERE c.fk_soc = s.rowid AND s.rowid = ".((int) $socid); $where .= " AND d.fk_contrat = c.rowid"; @@ -423,7 +425,7 @@ if ($sql_select) { if ($year) { $param .= "&year=".urlencode($year); } - if ($optioncss != '') { + if ($optioncss) { $param .= '&optioncss='.urlencode($optioncss); } From 5d0f5439a063ff89d65ed822d553d47a4c251d9a Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 22 Oct 2021 14:59:48 +0200 Subject: [PATCH 1084/1460] fix php8 warning --- htdocs/societe/consumption.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index bbaf9e1c5de..9f6a444dc63 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -221,6 +221,7 @@ print '
    '; print ''; $sql_select = ''; +$documentstaticline = ''; /*if ($type_element == 'action') { // Customer : show products from invoices require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; @@ -343,7 +344,7 @@ if (!empty($sql_select)) { $sql .= ' d.label, d.fk_product as product_id, d.fk_product as fk_product, d.info_bits, d.date_ouverture as date_start, d.date_cloture as date_end, d.qty, d.qty as prod_qty, d.total_ht as total_ht, '; } if ($type_element != 'fichinter') { - $sql .= ' p.ref as ref, p.rowid as prod_id, p.rowid as fk_product, p.fk_product_type as prod_type, p.fk_product_type as fk_product_type, p.entity as pentity,'; + $sql .= ' p.ref as ref, p.rowid as prod_id, p.rowid as fk_product, p.fk_product_type as prod_type, p.fk_product_type as fk_product_type, p.entity as pentity, NULL as total_ht'; } $sql .= " s.rowid as socid "; if ($type_element != 'fichinter') { @@ -654,7 +655,7 @@ if ($sql_select) { $total_qty += $objp->prod_qty; print ''.price($objp->total_ht).''; - $total_ht += $objp->total_ht; + $total_ht += (float) $objp->total_ht; print ''.price($objp->total_ht / (empty($objp->prod_qty) ? 1 : $objp->prod_qty)).''; From 5faf5e08b36c0b14db5b176b5b1efb5fb50e5d37 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 22 Oct 2021 15:09:34 +0200 Subject: [PATCH 1085/1460] fix php8 warning --- htdocs/societe/consumption.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 9f6a444dc63..d9abbd61c22 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -235,7 +235,8 @@ $documentstaticline = ''; if ($type_element == 'fichinter') { // Customer : show products from invoices require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; $documentstatic = new Fichinter($db); - $sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, \'1\' as doc_type, f.datec as dateprint, f.fk_statut as status, NULL as paid,'; + $sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, \'1\' as doc_type, f.datec as dateprint, f.fk_statut as status, NULL as paid, '; + $sql_select .= 'NULL as fk_product, NULL as info_bits, NULL as date_start, NULL as date_end, NULL as prod_qty, NULL as total_ht, '; $tables_from = MAIN_DB_PREFIX."fichinter as f LEFT JOIN ".MAIN_DB_PREFIX."fichinterdet as d ON d.fk_fichinter = f.rowid"; // Must use left join to work also with option that disable usage of lines. $where = " WHERE f.fk_soc = s.rowid AND s.rowid = ".((int) $socid); $where .= " AND f.entity = ".$conf->entity; @@ -245,7 +246,7 @@ if ($type_element == 'fichinter') { // Customer : show products from invoices if ($type_element == 'invoice') { // Customer : show products from invoices require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $documentstatic = new Facture($db); - $sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, f.type as doc_type, f.datef as dateprint, f.fk_statut as status, f.paye as paid, '; + $sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, f.type as doc_type, f.datef as dateprint, f.fk_statut as status, f.paye as paid, d.fk_remise_except, '; $tables_from = MAIN_DB_PREFIX."facture as f,".MAIN_DB_PREFIX."facturedet as d"; $where = " WHERE f.fk_soc = s.rowid AND s.rowid = ".((int) $socid); $where .= " AND d.fk_facture = f.rowid"; @@ -344,7 +345,7 @@ if (!empty($sql_select)) { $sql .= ' d.label, d.fk_product as product_id, d.fk_product as fk_product, d.info_bits, d.date_ouverture as date_start, d.date_cloture as date_end, d.qty, d.qty as prod_qty, d.total_ht as total_ht, '; } if ($type_element != 'fichinter') { - $sql .= ' p.ref as ref, p.rowid as prod_id, p.rowid as fk_product, p.fk_product_type as prod_type, p.fk_product_type as fk_product_type, p.entity as pentity, NULL as total_ht'; + $sql .= ' p.ref as ref, p.rowid as prod_id, p.rowid as fk_product, p.fk_product_type as prod_type, p.fk_product_type as fk_product_type, p.entity as pentity, '; } $sql .= " s.rowid as socid "; if ($type_element != 'fichinter') { @@ -570,6 +571,7 @@ if ($sql_select) { description) { + require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; if ($objp->description == '(CREDIT_NOTE)' && $objp->fk_remise_except > 0) { $discount = new DiscountAbsolute($db); $discount->fetch($objp->fk_remise_except); @@ -655,6 +657,9 @@ if ($sql_select) { $total_qty += $objp->prod_qty; print ''.price($objp->total_ht).''; + if (empty($total_ht)) { + $total_ht = 0; + } $total_ht += (float) $objp->total_ht; print ''.price($objp->total_ht / (empty($objp->prod_qty) ? 1 : $objp->prod_qty)).''; From 0a278416f4fa7f6b7f28cd47ae62a1df85f6538c Mon Sep 17 00:00:00 2001 From: kevin Date: Fri, 22 Oct 2021 15:12:56 +0200 Subject: [PATCH 1086/1460] Add missing ticket class property --- htdocs/ticket/class/ticket.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 2fad1afd8ab..57d3e00bcfd 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -589,6 +589,7 @@ class Ticket extends CommonObject $obj = $this->db->fetch_object($resql); $this->id = $obj->rowid; + $this->entity = $obj->entity; $this->ref = $obj->ref; $this->track_id = $obj->track_id; $this->fk_soc = $obj->fk_soc; From fd64f8966b9bccb13deb47236a85d046559a471e Mon Sep 17 00:00:00 2001 From: polkiko Date: Fri, 22 Oct 2021 15:19:11 +0200 Subject: [PATCH 1087/1460] Fixed in-line substitution if there is no object --- htdocs/core/tpl/card_presend.tpl.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index 8295a29df4a..9defdf87260 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -207,7 +207,9 @@ if ($action == 'presend') { } // Make substitution in email content - $formmail->setSubstitFromObject($object, $langs); + if ($object) { + $formmail->setSubstitFromObject($object, $langs); + } $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, $arrayoffamiliestoexclude, $object); $substitutionarray['__CHECK_READ__'] = (is_object($object) && is_object($object->thirdparty)) ? '' : ''; $substitutionarray['__PERSONALIZED__'] = ''; // deprecated From 101ec9b3fed3fb51de61debbbd25fa850d0aa6a5 Mon Sep 17 00:00:00 2001 From: MOREAU FRANCK Date: Fri, 22 Oct 2021 15:25:19 +0200 Subject: [PATCH 1088/1460] Fix scrutinizer FHENRY --- htdocs/webservices/server_thirdparty.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/webservices/server_thirdparty.php b/htdocs/webservices/server_thirdparty.php index dbf2f3dd125..554f7e7e996 100644 --- a/htdocs/webservices/server_thirdparty.php +++ b/htdocs/webservices/server_thirdparty.php @@ -103,7 +103,7 @@ $thirdparty_fields = array( 'address' => array('name'=>'address', 'type'=>'xsd:string'), 'zip' => array('name'=>'zip', 'type'=>'xsd:string'), 'town' => array('name'=>'town', 'type'=>'xsd:string'), - 'province_id' => array('name'=>'province_id', 'type'=>'xsd:string'), + 'region_code' => array('name'=>'region_code', 'type'=>'xsd:string'), 'country_id' => array('name'=>'country_id', 'type'=>'xsd:string'), 'country_code' => array('name'=>'country_code', 'type'=>'xsd:string'), 'country' => array('name'=>'country', 'type'=>'xsd:string'), @@ -343,7 +343,7 @@ function getThirdParty($authentication, $id = '', $ref = '', $ref_ext = '', $bar 'address' => $thirdparty->address, 'zip' => $thirdparty->zip, 'town' => $thirdparty->town, - 'province_id' => $thirdparty->state_id, + 'region_code' => $thirdparty->region_code, 'country_id' => $thirdparty->country_id, 'country_code' => $thirdparty->country_code, 'country' => $thirdparty->country, @@ -462,7 +462,7 @@ function createThirdParty($authentication, $thirdparty) if ($thirdparty['country_code']) { $newobject->country_id = getCountry($thirdparty['country_code'], 3); } - $newobject->province_id = $thirdparty['province_id']; + $newobject->region_code = $thirdparty['region_code']; //if ($thirdparty['province_code']) $newobject->province_code=getCountry($thirdparty['province_code'],3); $newobject->phone = $thirdparty['phone']; @@ -597,7 +597,7 @@ function updateThirdParty($authentication, $thirdparty) if ($thirdparty['country_code']) { $object->country_id = getCountry($thirdparty['country_code'], 3); } - $object->province_id = $thirdparty['province_id']; + $object->region_code = $thirdparty['region_code']; //if ($thirdparty['province_code']) $newobject->province_code=getCountry($thirdparty['province_code'],3); $object->phone = $thirdparty['phone']; From cd52c3da7583bfa9f4070c3d39716cc51341c7d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 22 Oct 2021 15:27:09 +0200 Subject: [PATCH 1089/1460] fix warning --- htdocs/eventorganization/conferenceorbooth_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index c02306ba6be..d72941d2885 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -288,7 +288,7 @@ if ($projectid > 0) { $morehtmlref .= '
    '; // Define a complementary filter for search of next/prev ref. - if (!$user->rights->project->all->lire) { + if (empty($user->rights->project->all->lire)) { $objectsListId = $project->getProjectsAuthorizedForUser($user, 0, 0); $project->next_prev_filter = " rowid IN (".$db->sanitize(count($objectsListId) ? join(',', array_keys($objectsListId)) : '0').")"; } From fa21b27cedc3c67a5097932bae90114156820fa8 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Fri, 22 Oct 2021 15:27:16 +0200 Subject: [PATCH 1090/1460] Validate Holiday : keep files --- htdocs/holiday/card.php | 1 + htdocs/holiday/class/holiday.class.php | 39 ++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 150a9c0754b..93e748a51d2 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -266,6 +266,7 @@ if (empty($reshook)) { // If update and we are an approver, we can update with another approver if ($action == 'update' && GETPOSTISSET('savevalidator') && !empty($user->rights->holiday->approve)) { + $object->fetch($id); $object->oldcopy = dol_clone($object); diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 5ecc4d7325a..665e43c6ffd 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -701,6 +701,7 @@ class Holiday extends CommonObject public function validate($user = null, $notrigger = 0) { global $conf, $langs; + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $error = 0; // Define new ref @@ -740,6 +741,44 @@ class Holiday extends CommonObject } } + if (!$error) { + $this->oldref = $this->ref; + + // Rename directory if dir was a temporary ref + if (preg_match('/^[\(]?PROV/i', $this->ref)) { + // Now we rename also files into index + $sql = 'UPDATE ' . MAIN_DB_PREFIX . "ecm_files set filename = CONCAT('" . $this->db->escape($this->newref) . "', SUBSTR(filename, " . (strlen($this->ref) + 1) . ")), filepath = 'holiday/" . $this->db->escape($this->newref) . "'"; + $sql .= " WHERE filename LIKE '" . $this->db->escape($this->ref) . "%' AND filepath = 'holiday/" . $this->db->escape($this->ref) . "' and entity = " . ((int)$conf->entity); + $resql = $this->db->query($sql); + if (!$resql) { + $error++; + $this->error = $this->db->lasterror(); + } + + // We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments + $oldref = dol_sanitizeFileName($this->ref); + $newref = dol_sanitizeFileName($num); + $dirsource = $conf->holiday->multidir_output[$this->entity] . '/' . $oldref; + $dirdest = $conf->holiday->multidir_output[$this->entity] . '/' . $newref; + if (!$error && file_exists($dirsource)) { + dol_syslog(get_class($this) . "::validate rename dir " . $dirsource . " into " . $dirdest); + if (@rename($dirsource, $dirdest)) { + dol_syslog("Rename ok"); + // Rename docs starting with $oldref with $newref + $listoffiles = dol_dir_list($dirdest, 'files', 1, '^' . preg_quote($oldref, '/')); + foreach ($listoffiles as $fileentry) { + $dirsource = $fileentry['name']; + $dirdest = preg_replace('/^' . preg_quote($oldref, '/') . '/', $newref, $dirsource); + $dirsource = $fileentry['path'] . '/' . $dirsource; + $dirdest = $fileentry['path'] . '/' . $dirdest; + @rename($dirsource, $dirdest); + } + } + } + } + } + + // Commit or rollback if ($error) { foreach ($this->errors as $errmsg) { From 87ac58efb66d526fac07017c42de4627c9cf1d3f Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 22 Oct 2021 15:27:36 +0200 Subject: [PATCH 1091/1460] fix php 8 --- htdocs/core/lib/pdf.lib.php | 20 +++++++++---------- .../bank/doc/pdf_sepamandate.modules.php | 2 +- htdocs/document.php | 1 + htdocs/societe/paymentmodes.php | 18 +++++++++-------- 4 files changed, 22 insertions(+), 19 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index e9b2e558595..420921bcc9e 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1045,7 +1045,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ $line2 .= ($line2 ? " - " : "").$fromcompany->email; } } - if ($showdetails == 2 || $showdetails == 3 || ($fromcompany->country_code == 'DE')) { + if ($showdetails == 2 || $showdetails == 3 || (!empty($fromcompany->country_code) && $fromcompany->country_code == 'DE')) { // Managers if ($fromcompany->managers) { $line2 .= ($line2 ? " - " : "").$fromcompany->managers; @@ -1054,11 +1054,11 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ // Line 3 of company infos // Juridical status - if ($fromcompany->forme_juridique_code) { + if (!empty($fromcompany->forme_juridique_code) && $fromcompany->forme_juridique_code) { $line3 .= ($line3 ? " - " : "").$outputlangs->convToOutputCharset(getFormeJuridiqueLabel($fromcompany->forme_juridique_code)); } // Capital - if ($fromcompany->capital) { + if (!empty($fromcompany->capital) && $fromcompany->capital) { $tmpamounttoshow = price2num($fromcompany->capital); // This field is a free string if (is_numeric($tmpamounttoshow) && $tmpamounttoshow > 0) { $line3 .= ($line3 ? " - " : "").$outputlangs->transnoentities("CapitalOf", price($tmpamounttoshow, 0, $outputlangs, 0, 0, 0, $conf->currency)); @@ -1067,7 +1067,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ } } // Prof Id 1 - if ($fromcompany->idprof1 && ($fromcompany->country_code != 'FR' || !$fromcompany->idprof2)) { + if (!empty($fromcompany->idprof1) && $fromcompany->idprof1 && ($fromcompany->country_code != 'FR' || !$fromcompany->idprof2)) { $field = $outputlangs->transcountrynoentities("ProfId1", $fromcompany->country_code); if (preg_match('/\((.*)\)/i', $field, $reg)) { $field = $reg[1]; @@ -1075,7 +1075,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ $line3 .= ($line3 ? " - " : "").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof1); } // Prof Id 2 - if ($fromcompany->idprof2) { + if (!empty($fromcompany->idprof2) && $fromcompany->idprof2) { $field = $outputlangs->transcountrynoentities("ProfId2", $fromcompany->country_code); if (preg_match('/\((.*)\)/i', $field, $reg)) { $field = $reg[1]; @@ -1085,7 +1085,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ // Line 4 of company infos // Prof Id 3 - if ($fromcompany->idprof3) { + if (!empty($fromcompany->idprof3) && $fromcompany->idprof3) { $field = $outputlangs->transcountrynoentities("ProfId3", $fromcompany->country_code); if (preg_match('/\((.*)\)/i', $field, $reg)) { $field = $reg[1]; @@ -1093,7 +1093,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ $line4 .= ($line4 ? " - " : "").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof3); } // Prof Id 4 - if ($fromcompany->idprof4) { + if (!empty($fromcompany->idprof4) && $fromcompany->idprof4) { $field = $outputlangs->transcountrynoentities("ProfId4", $fromcompany->country_code); if (preg_match('/\((.*)\)/i', $field, $reg)) { $field = $reg[1]; @@ -1101,7 +1101,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ $line4 .= ($line4 ? " - " : "").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof4); } // Prof Id 5 - if ($fromcompany->idprof5) { + if (!empty($fromcompany->idprof5) && $fromcompany->idprof5) { $field = $outputlangs->transcountrynoentities("ProfId5", $fromcompany->country_code); if (preg_match('/\((.*)\)/i', $field, $reg)) { $field = $reg[1]; @@ -1109,7 +1109,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ $line4 .= ($line4 ? " - " : "").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof5); } // Prof Id 6 - if ($fromcompany->idprof6) { + if (!empty($fromcompany->idprof6) && $fromcompany->idprof6) { $field = $outputlangs->transcountrynoentities("ProfId6", $fromcompany->country_code); if (preg_match('/\((.*)\)/i', $field, $reg)) { $field = $reg[1]; @@ -1117,7 +1117,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ $line4 .= ($line4 ? " - " : "").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof6); } // IntraCommunautary VAT - if ($fromcompany->tva_intra != '') { + if (!empty($fromcompany->tva_intra) && $fromcompany->tva_intra != '') { $line4 .= ($line4 ? " - " : "").$outputlangs->transnoentities("VATIntraShort").": ".$outputlangs->convToOutputCharset($fromcompany->tva_intra); } diff --git a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php index 49e311f1c89..2259897f044 100644 --- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php @@ -282,7 +282,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc $sepaname = '______________________________________________'; if ($thirdparty->id > 0) { - $sepaname = $thirdparty->name.($object->account_owner ? ' ('.$object->account_owner.')' : ''); + $sepaname = $thirdparty->name.($object->proprio ? ' ('.$object->proprio.')' : ''); } $posY = $pdf->GetY(); $posY += 3; diff --git a/htdocs/document.php b/htdocs/document.php index 3c06801c9a0..611517b0258 100644 --- a/htdocs/document.php +++ b/htdocs/document.php @@ -138,6 +138,7 @@ if (in_array($modulepart, array('facture_paiement', 'unpaid'))) { */ // If we have a hash public (hashp), we guess the original_file. +$ecmfile=''; if (!empty($hashp)) { include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php'; $ecmfile = new EcmFiles($db); diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 6a0b9fac742..d1bf19b069d 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -773,16 +773,16 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' $obj = $db->fetch_object($resql); $nbFactsClient = $obj->nb; $thirdTypeArray['customer'] = $langs->trans("customer"); - if ($conf->propal->enabled && $user->rights->propal->lire) { + if (!empty($conf->propal->enabled) && $user->rights->propal->lire) { $elementTypeArray['propal'] = $langs->transnoentitiesnoconv('Proposals'); } - if ($conf->commande->enabled && $user->rights->commande->lire) { + if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { $elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders'); } - if ($conf->facture->enabled && $user->rights->facture->lire) { + if (!empty($conf->facture->enabled) && $user->rights->facture->lire) { $elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices'); } - if ($conf->contrat->enabled && $user->rights->contrat->lire) { + if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) { $elementTypeArray['contract'] = $langs->transnoentitiesnoconv('Contracts'); } @@ -1304,7 +1304,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' } print_liste_field_titre("DefaultRIB", '', '', '', '', '', '', '', 'center '); print_liste_field_titre('', '', '', '', '', '', '', '', 'center '); - print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch '); + print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', '', '', 'maxwidthsearch '); print "\n"; foreach ($rib_list as $rib) { @@ -1393,7 +1393,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' $out = ''; if (is_array($modellist) && count($modellist)) { - $out .= ''; + $out .= 'global->MAIN_JUMP_TAG) ? '' : '#builddoc').'" name="'.$forname.'" id="'.$forname.'_form" method="post">'; $out .= ''; $out .= ''; $out .= ''; @@ -1407,14 +1407,16 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' $modelselected = $conf->global->BANKADDON_PDF; } - $out .= $form->selectarray('modelrib'.$rib->id, $modellist, $modelselected, $showempty, 0, 0, '', 0, 0, 0, '', 'minwidth100'); + $out .= $form->selectarray('modelrib'.$rib->id, $modellist, $modelselected, 1, 0, 0, '', 0, 0, 0, '', 'minwidth100'); $out .= ajax_combobox('modelrib'.$rib->id); + $allowgenifempty = 0; + // Language code (if multilang) if ($conf->global->MAIN_MULTILANGS) { include_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; $formadmin = new FormAdmin($db); - $defaultlang = $codelang ? $codelang : $langs->getDefaultLang(); + $defaultlang = $langs->getDefaultLang(); $morecss = 'maxwidth150'; if ($conf->browser->layout == 'phone') { $morecss = 'maxwidth100'; From 34b9890110b6741426fffae62f1114d589fd9467 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 22 Oct 2021 15:29:38 +0200 Subject: [PATCH 1092/1460] fix warning --- htdocs/eventorganization/conferenceorbooth_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index c02306ba6be..a423b532106 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -282,7 +282,7 @@ if ($projectid > 0) { // Title $morehtmlref .= $project->title; // Thirdparty - if ($project->thirdparty->id > 0) { + if (isset($project->thirdparty->id) && $project->thirdparty->id > 0) { $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$project->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= '
    '; From 6855d8e91a1a0dbfec76e57c8254ff7982bbe6c5 Mon Sep 17 00:00:00 2001 From: MOREAU FRANCK Date: Fri, 22 Oct 2021 15:32:24 +0200 Subject: [PATCH 1093/1460] Fix scrutinizer FHENRY --- htdocs/contrat/class/contrat.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index a23a620359e..d63b0e7acb0 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -2545,7 +2545,7 @@ class Contrat extends CommonObject if (!$error) { foreach ($this->lines as $line) { - $result = $clonedObj->addline($line->desc, $line->subprice, $line->qty, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, $line->fk_product, $line->remise_percent, $line->date_ouverture, $line->date_cloture, 'HT', 0, $line->info_bits, $line->fk_fournprice, $line->pa_ht, $line->array_options, $line->fk_unit); + $result = $clonedObj->addline($line->description, $line->subprice, $line->qty, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, $line->fk_product, $line->remise_percent, $line->date_ouverture, $line->date_cloture, 'HT', 0, $line->info_bits, $line->fk_fournprice, $line->pa_ht, $line->array_options, $line->fk_unit); if ($result < 0) { $error++; $this->error = $clonedObj->error; From 311522bf042cf998dc58373847dfb71e1873b62d Mon Sep 17 00:00:00 2001 From: Theo Date: Fri, 22 Oct 2021 15:33:57 +0200 Subject: [PATCH 1094/1460] fix: error return when adding a category to an object --- htdocs/categories/viewcat.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 8ebb9f43b1e..a3b9f9cedb0 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -199,7 +199,7 @@ if ($elemid && $action == 'addintocategory' && if ($result >= 0) { setEventMessages($langs->trans("WasAddedSuccessfully", $newobject->ref), null, 'mesgs'); } else { - if ($cat->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { + if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { setEventMessages($langs->trans("ObjectAlreadyLinkedToCategory"), null, 'warnings'); } else { setEventMessages($object->error, $object->errors, 'errors'); From 87b4805bc041237a87ab3da8788020a1306e40cf Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 22 Oct 2021 13:35:30 +0000 Subject: [PATCH 1095/1460] Fixing style errors. --- htdocs/holiday/card.php | 1 - htdocs/holiday/class/holiday.class.php | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 93e748a51d2..150a9c0754b 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -266,7 +266,6 @@ if (empty($reshook)) { // If update and we are an approver, we can update with another approver if ($action == 'update' && GETPOSTISSET('savevalidator') && !empty($user->rights->holiday->approve)) { - $object->fetch($id); $object->oldcopy = dol_clone($object); diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 665e43c6ffd..6271f1d43e8 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -748,7 +748,7 @@ class Holiday extends CommonObject if (preg_match('/^[\(]?PROV/i', $this->ref)) { // Now we rename also files into index $sql = 'UPDATE ' . MAIN_DB_PREFIX . "ecm_files set filename = CONCAT('" . $this->db->escape($this->newref) . "', SUBSTR(filename, " . (strlen($this->ref) + 1) . ")), filepath = 'holiday/" . $this->db->escape($this->newref) . "'"; - $sql .= " WHERE filename LIKE '" . $this->db->escape($this->ref) . "%' AND filepath = 'holiday/" . $this->db->escape($this->ref) . "' and entity = " . ((int)$conf->entity); + $sql .= " WHERE filename LIKE '" . $this->db->escape($this->ref) . "%' AND filepath = 'holiday/" . $this->db->escape($this->ref) . "' and entity = " . ((int) $conf->entity); $resql = $this->db->query($sql); if (!$resql) { $error++; From b5929fb7c41301178bb983206f1a089942bfd21e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 22 Oct 2021 15:42:18 +0200 Subject: [PATCH 1096/1460] Fix phpcs --- htdocs/modulebuilder/index.php | 2 +- htdocs/product/class/api_products.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 06907b49742..82567e05fac 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1295,8 +1295,8 @@ if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) && $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Type")), null, 'errors'); } - } + if (!$error) { $addfieldentry = array( 'name'=>GETPOST('propname', 'aZ09'), diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index b6230ce119e..c3b22adedb2 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -1945,7 +1945,7 @@ class Products extends DolibarrApi unset($object->supplierprices); // Mut use another API to get them - if(!DolibarrApiAccess::$user->rights->stock->lire){ + if (empty(DolibarrApiAccess::$user->rights->stock->lire)) { unset($object->stock_reel); unset($object->stock_theorique); } From 29f847c13a9c54f43da959588318024e053fddaa Mon Sep 17 00:00:00 2001 From: Theo Date: Fri, 22 Oct 2021 15:48:39 +0200 Subject: [PATCH 1097/1460] add: quick link categories to project --- htdocs/categories/viewcat.php | 27 +++- htdocs/core/class/html.form.class.php | 206 ++++++++++++++++++++++++++ htdocs/langs/fr_FR/categories.lang | 1 + 3 files changed, 233 insertions(+), 1 deletion(-) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 7ccd80eb4bd..0f3d6d075a5 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -173,7 +173,8 @@ if ($elemid && $action == 'addintocategory' && (($type == Categorie::TYPE_PRODUCT && ($user->rights->produit->creer || $user->rights->service->creer)) || ($type == Categorie::TYPE_CUSTOMER && $user->rights->societe->creer) || ($type == Categorie::TYPE_SUPPLIER && $user->rights->societe->creer) || - ($type == Categorie::TYPE_TICKET && $user->rights->ticket->write) + ($type == Categorie::TYPE_TICKET && $user->rights->ticket->write) || + ($type == Categorie::TYPE_PROJECT && $user->rights->projet->creer) )) { if ($type == Categorie::TYPE_PRODUCT) { require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; @@ -191,6 +192,10 @@ if ($elemid && $action == 'addintocategory' && require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; $newobject = new Ticket($db); $elementtype = 'ticket'; + } elseif ($type == Categorie::TYPE_PROJECT) { + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + $newobject = new Project($db); + $elementtype = 'project'; } $result = $newobject->fetch($elemid); @@ -874,6 +879,26 @@ if ($type == Categorie::TYPE_PROJECT) { if ($objects < 0) { dol_print_error($db, $object->error, $object->errors); } else { + // Form to add record into a category + $showclassifyform = 1; + if ($showclassifyform) { + print '
    '; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print '
    '; + print $langs->trans("AddProjectIntoCategory").'  '; + $form->selectProjects('', 'elemid'); + print '
    '; + print ''; + } + print '
    '; print ''; print ''; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 88151e7c288..944651f4607 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6838,6 +6838,212 @@ class Form $optJson = array('key'=>$outkey, 'value'=>$outref, 'type'=>$outtypem); } + /** + * Return list of tickets in Ajax if Ajax activated or go to selectTicketsList + * + * @param int $selected Preselected tickets + * @param string $htmlname Name of HTML select field (must be unique in page). + * @param string $filtertype To add a filter + * @param int $limit Limit on number of returned lines + * @param int $status Ticket status + * @param string $selected_input_value Value of preselected input text (for use with ajax) + * @param int $hidelabel Hide label (0=no, 1=yes, 2=show search icon (before) and placeholder, 3 search icon after) + * @param array $ajaxoptions Options for ajax_autocompleter + * @param int $socid Thirdparty Id (to get also price dedicated to this customer) + * @param string $showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text. + * @param int $forcecombo Force to use combo box + * @param string $morecss Add more css on select + * @param array $selected_combinations Selected combinations. Format: array([attrid] => attrval, [...]) + * @param string $nooutput No print, return the output into a string + * @return void|string + */ + public function selectProjects($selected = '', $htmlname = 'projectid', $filtertype = '', $limit = 0, $status = 1, $selected_input_value = '', $hidelabel = 0, $ajaxoptions = array(), $socid = 0, $showempty = '1', $forcecombo = 0, $morecss = '', $selected_combinations = null, $nooutput = 0) + { + global $langs, $conf; + + $out = ''; + + // check parameters + if (is_null($ajaxoptions)) $ajaxoptions = array(); + + if (!empty($conf->use_javascript_ajax) && !empty($conf->global->TICKET_USE_SEARCH_TO_SELECT)) { + $placeholder = ''; + + if ($selected && empty($selected_input_value)) { + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + $projecttmpselect = new Project($this->db); + $projecttmpselect->fetch($selected); + $selected_input_value = $projecttmpselect->ref; + unset($projecttmpselect); + } + + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); + + if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel").' : '; + elseif ($hidelabel > 1) { + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; + if ($hidelabel == 2) { + $out .= img_picto($langs->trans("Search"), 'search'); + } + } + $out .= 'global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />'; + if ($hidelabel == 3) { + $out .= img_picto($langs->trans("Search"), 'search'); + } + } else { + $out .= $this->selectProjectsList($selected, $htmlname, $filtertype, $limit, $status, 0, $socid, $showempty, $forcecombo, $morecss); + } + + if (empty($nooutput)) print $out; + else return $out; + } + + + /** + * Return list of projects. + * Called by selectProjects. + * + * @param int $selected Preselected project + * @param string $htmlname Name of select html + * @param string $filtertype Filter on project type + * @param int $limit Limit on number of returned lines + * @param string $filterkey Filter on project ref or subject + * @param int $status Ticket status + * @param int $outputmode 0=HTML select string, 1=Array + * @param string $showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text. + * @param int $forcecombo Force to use combo box + * @param string $morecss Add more css on select + * @return array Array of keys for json + */ + public function selectProjectsList($selected = '', $htmlname = 'projectid', $filtertype = '', $limit = 20, $filterkey = '', $status = 1, $outputmode = 0, $showempty = '1', $forcecombo = 0, $morecss = '') + { + global $langs, $conf, $user, $db; + + $out = ''; + $outarray = array(); + + $selectFields = " p.rowid, p.ref"; + + $sql = "SELECT "; + $sql .= $selectFields; + $sql .= " FROM ".MAIN_DB_PREFIX."projet as p"; + $sql .= ' WHERE p.entity IN ('.getEntity('project').')'; + + // Add criteria on ref/label + if ($filterkey != '') { + $sql .= ' AND ('; + $prefix = empty($conf->global->TICKET_DONOTSEARCH_ANYWHERE) ? '%' : ''; // Can use index if PRODUCT_DONOTSEARCH_ANYWHERE is on + // For natural search + $scrit = explode(' ', $filterkey); + $i = 0; + if (count($scrit) > 1) $sql .= "("; + foreach ($scrit as $crit) { + if ($i > 0) $sql .= " AND "; + $sql .= "p.ref LIKE '".$this->db->escape($prefix.$crit)."%'"; + $sql .= ""; + $i++; + } + if (count($scrit) > 1) $sql .= ")"; + $sql .= ')'; + } + + $sql .= $this->db->plimit($limit, 0); + + // Build output string + dol_syslog(get_class($this)."::selectProjectsList search projects", LOG_DEBUG); + $result = $this->db->query($sql); + if ($result) { + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; + + $num = $this->db->num_rows($result); + + $events = null; + + if (!$forcecombo) { + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; + $out .= ajax_combobox($htmlname, $events, $conf->global->PROJECT_USE_SEARCH_TO_SELECT); + } + + $out .= ''; + + $this->db->free($result); + + if (empty($outputmode)) return $out; + return $outarray; + } else { + dol_print_error($db); + } + } + + /** + * constructTicketListOption. + * This define value for &$opt and &$optJson. + * + * @param resource $objp Result set of fetch + * @param string $opt Option (var used for returned value in string option format) + * @param string $optJson Option (var used for returned value in json format) + * @param string $selected Preselected value + * @param string $filterkey Filter key to highlight + * @return void + */ + protected function constructProjectListOption(&$objp, &$opt, &$optJson, $selected, $filterkey = '') + { + global $langs, $conf, $user, $db; + + $outkey = ''; + $outval = ''; + $outref = ''; + $outlabel = ''; + $outtype = ''; + + $label = $objp->label; + + $outkey = $objp->rowid; + $outref = $objp->ref; + $outlabel = $objp->label; + $outtype = $objp->fk_product_type; + + $opt = '\n"; + $optJson = array('key'=>$outkey, 'value'=>$outref, 'type'=>$outtypem); + } /** * Generic method to select a component from a combo list. diff --git a/htdocs/langs/fr_FR/categories.lang b/htdocs/langs/fr_FR/categories.lang index 62bb2267283..9a9f3750349 100644 --- a/htdocs/langs/fr_FR/categories.lang +++ b/htdocs/langs/fr_FR/categories.lang @@ -89,6 +89,7 @@ CategorieRecursiv=Lier automatiquement avec le(a) tag/catégorie parent(e) CategorieRecursivHelp=Si l'option est activé, quand un produit est ajouté dans une sous-catégorie, le produit sera ajouté aussi dans la catégorie parente. AddProductServiceIntoCategory=Ajouter le produit/service suivant AddCustomerIntoCategory=Assigner cette catégorie au client +AddProjectIntoCategory=Assigner cette catégorie au projet AddTicketIntoCategory=Assigner cette catégorie au ticket AddSupplierIntoCategory=Assigner cette catégorie au fournisseur ShowCategory=Afficher tag/catégorie From 977216806782ec30bcab3e3d5b75a5873359dbec Mon Sep 17 00:00:00 2001 From: Nicolas Domenech Date: Fri, 22 Oct 2021 15:57:03 +0200 Subject: [PATCH 1098/1460] fix: error sql creating folder in manual GED tree --- htdocs/ecm/class/ecmdirectory.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php index aed93b51f6f..03413a56eb1 100644 --- a/htdocs/ecm/class/ecmdirectory.class.php +++ b/htdocs/ecm/class/ecmdirectory.class.php @@ -197,7 +197,7 @@ class EcmDirectory extends CommonObject $sql .= " '".$this->db->escape($this->description)."',"; $sql .= " ".((int) $this->cachenbofdoc).","; $sql .= " '".$this->db->idate($this->date_c)."',"; - $sql .= " ".($this->fk_user_c > 0 ? ((int) $this->fk_user_c) : "null").","; + $sql .= " ".($this->fk_user_c > 0 ? ((int) $this->fk_user_c) : "null"); $sql .= ")"; dol_syslog(get_class($this)."::create", LOG_DEBUG); From a36c966f1532089e042f5ac91a39fa4b4ae5c999 Mon Sep 17 00:00:00 2001 From: Theo Date: Fri, 22 Oct 2021 16:13:54 +0200 Subject: [PATCH 1099/1460] add: quick link categories to adherent --- htdocs/categories/viewcat.php | 27 +++- htdocs/core/class/html.form.class.php | 212 +++++++++++++++++++++++++- htdocs/langs/fr_FR/categories.lang | 1 + 3 files changed, 236 insertions(+), 4 deletions(-) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 0f3d6d075a5..9158cf0dd92 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -174,7 +174,8 @@ if ($elemid && $action == 'addintocategory' && ($type == Categorie::TYPE_CUSTOMER && $user->rights->societe->creer) || ($type == Categorie::TYPE_SUPPLIER && $user->rights->societe->creer) || ($type == Categorie::TYPE_TICKET && $user->rights->ticket->write) || - ($type == Categorie::TYPE_PROJECT && $user->rights->projet->creer) + ($type == Categorie::TYPE_PROJECT && $user->rights->projet->creer)|| + ($type == Categorie::TYPE_MEMBER && $user->rights->projet->creer) )) { if ($type == Categorie::TYPE_PRODUCT) { require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; @@ -196,6 +197,10 @@ if ($elemid && $action == 'addintocategory' && require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $newobject = new Project($db); $elementtype = 'project'; + } elseif ($type == Categorie::TYPE_MEMBER) { + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; + $newobject = new Adherent($db); + $elementtype = 'member'; } $result = $newobject->fetch($elemid); @@ -701,6 +706,26 @@ if ($type == Categorie::TYPE_MEMBER) { if ($prods < 0) { dol_print_error($db, $object->error, $object->errors); } else { + // Form to add record into a category + $showclassifyform = 1; + if ($showclassifyform) { + print '
    '; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print '
    '; + print $langs->trans("AddMemberIntoCategory").'  '; + print $form->selectMembers('', 'elemid'); + print '
    '; + print ''; + } + print '
    '; print ''; print ''; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 944651f4607..b871fb66fab 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6839,7 +6839,7 @@ class Form } /** - * Return list of tickets in Ajax if Ajax activated or go to selectTicketsList + * Return list of projects in Ajax if Ajax activated or go to selectTicketsList * * @param int $selected Preselected tickets * @param string $htmlname Name of HTML select field (must be unique in page). @@ -6898,7 +6898,6 @@ class Form else return $out; } - /** * Return list of projects. * Called by selectProjects. @@ -7006,7 +7005,7 @@ class Form } /** - * constructTicketListOption. + * constructProjectListOption. * This define value for &$opt and &$optJson. * * @param resource $objp Result set of fetch @@ -7045,6 +7044,213 @@ class Form $optJson = array('key'=>$outkey, 'value'=>$outref, 'type'=>$outtypem); } + + /** + * Return list of members in Ajax if Ajax activated or go to selectTicketsList + * + * @param int $selected Preselected tickets + * @param string $htmlname Name of HTML select field (must be unique in page). + * @param string $filtertype To add a filter + * @param int $limit Limit on number of returned lines + * @param int $status Ticket status + * @param string $selected_input_value Value of preselected input text (for use with ajax) + * @param int $hidelabel Hide label (0=no, 1=yes, 2=show search icon (before) and placeholder, 3 search icon after) + * @param array $ajaxoptions Options for ajax_autocompleter + * @param int $socid Thirdparty Id (to get also price dedicated to this customer) + * @param string $showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text. + * @param int $forcecombo Force to use combo box + * @param string $morecss Add more css on select + * @param array $selected_combinations Selected combinations. Format: array([attrid] => attrval, [...]) + * @param string $nooutput No print, return the output into a string + * @return void|string + */ + public function selectMembers($selected = '', $htmlname = 'adherentid', $filtertype = '', $limit = 0, $status = 1, $selected_input_value = '', $hidelabel = 0, $ajaxoptions = array(), $socid = 0, $showempty = '1', $forcecombo = 0, $morecss = '', $selected_combinations = null, $nooutput = 0) + { + global $langs, $conf; + + $out = ''; + + // check parameters + if (is_null($ajaxoptions)) $ajaxoptions = array(); + + if (!empty($conf->use_javascript_ajax) && !empty($conf->global->TICKET_USE_SEARCH_TO_SELECT)) { + $placeholder = ''; + + if ($selected && empty($selected_input_value)) { + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; + $adherenttmpselect = new Member($this->db); + $adherenttmpselect->fetch($selected); + $selected_input_value = $adherenttmpselect->ref; + unset($adherenttmpselect); + } + + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); + + if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel").' : '; + elseif ($hidelabel > 1) { + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; + if ($hidelabel == 2) { + $out .= img_picto($langs->trans("Search"), 'search'); + } + } + $out .= 'global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />'; + if ($hidelabel == 3) { + $out .= img_picto($langs->trans("Search"), 'search'); + } + } else { + $out .= $this->selectMembersList($selected, $htmlname, $filtertype, $limit, $status, 0, $socid, $showempty, $forcecombo, $morecss); + } + + if (empty($nooutput)) print $out; + else return $out; + } + + /** + * Return list of adherents. + * Called by selectMembers. + * + * @param int $selected Preselected adherent + * @param string $htmlname Name of select html + * @param string $filtertype Filter on adherent type + * @param int $limit Limit on number of returned lines + * @param string $filterkey Filter on adherent ref or subject + * @param int $status Ticket status + * @param int $outputmode 0=HTML select string, 1=Array + * @param string $showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text. + * @param int $forcecombo Force to use combo box + * @param string $morecss Add more css on select + * @return array Array of keys for json + */ + public function selectMembersList($selected = '', $htmlname = 'adherentid', $filtertype = '', $limit = 20, $filterkey = '', $status = 1, $outputmode = 0, $showempty = '1', $forcecombo = 0, $morecss = '') + { + global $langs, $conf, $user, $db; + + $out = ''; + $outarray = array(); + + $selectFields = " p.rowid, p.ref"; + + $sql = "SELECT "; + $sql .= $selectFields; + $sql .= " FROM ".MAIN_DB_PREFIX."adherent as p"; + $sql .= ' WHERE p.entity IN ('.getEntity('adherent').')'; + + // Add criteria on ref/label + if ($filterkey != '') { + $sql .= ' AND ('; + $prefix = empty($conf->global->TICKET_DONOTSEARCH_ANYWHERE) ? '%' : ''; // Can use index if PRODUCT_DONOTSEARCH_ANYWHERE is on + // For natural search + $scrit = explode(' ', $filterkey); + $i = 0; + if (count($scrit) > 1) $sql .= "("; + foreach ($scrit as $crit) { + if ($i > 0) $sql .= " AND "; + $sql .= "p.ref LIKE '".$this->db->escape($prefix.$crit)."%'"; + $sql .= ""; + $i++; + } + if (count($scrit) > 1) $sql .= ")"; + $sql .= ')'; + } + + $sql .= $this->db->plimit($limit, 0); + + // Build output string + dol_syslog(get_class($this)."::selectMembersList search adherents", LOG_DEBUG); + $result = $this->db->query($sql); + if ($result) { + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; + require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; + + $num = $this->db->num_rows($result); + + $events = null; + + if (!$forcecombo) { + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; + $out .= ajax_combobox($htmlname, $events, $conf->global->PROJECT_USE_SEARCH_TO_SELECT); + } + + $out .= ''; + + $this->db->free($result); + + if (empty($outputmode)) return $out; + return $outarray; + } else { + dol_print_error($db); + } + } + + /** + * constructMemberListOption. + * This define value for &$opt and &$optJson. + * + * @param resource $objp Result set of fetch + * @param string $opt Option (var used for returned value in string option format) + * @param string $optJson Option (var used for returned value in json format) + * @param string $selected Preselected value + * @param string $filterkey Filter key to highlight + * @return void + */ + protected function constructMemberListOption(&$objp, &$opt, &$optJson, $selected, $filterkey = '') + { + global $langs, $conf, $user, $db; + + $outkey = ''; + $outval = ''; + $outref = ''; + $outlabel = ''; + $outtype = ''; + + $label = $objp->label; + + $outkey = $objp->rowid; + $outref = $objp->ref; + $outlabel = $objp->label; + $outtype = $objp->fk_product_type; + + $opt = '\n"; + $optJson = array('key'=>$outkey, 'value'=>$outref, 'type'=>$outtypem); + } + /** * Generic method to select a component from a combo list. * Can use autocomplete with ajax after x key pressed or a full combo, depending on setup. diff --git a/htdocs/langs/fr_FR/categories.lang b/htdocs/langs/fr_FR/categories.lang index 9a9f3750349..6bf8db21f03 100644 --- a/htdocs/langs/fr_FR/categories.lang +++ b/htdocs/langs/fr_FR/categories.lang @@ -89,6 +89,7 @@ CategorieRecursiv=Lier automatiquement avec le(a) tag/catégorie parent(e) CategorieRecursivHelp=Si l'option est activé, quand un produit est ajouté dans une sous-catégorie, le produit sera ajouté aussi dans la catégorie parente. AddProductServiceIntoCategory=Ajouter le produit/service suivant AddCustomerIntoCategory=Assigner cette catégorie au client +AddMemberIntoCategory=Assigner cette catégorie au membre AddProjectIntoCategory=Assigner cette catégorie au projet AddTicketIntoCategory=Assigner cette catégorie au ticket AddSupplierIntoCategory=Assigner cette catégorie au fournisseur From d7dd54549a070812a84c5004dcfe6fb4a509b3b2 Mon Sep 17 00:00:00 2001 From: Nicolas Domenech Date: Fri, 22 Oct 2021 16:34:51 +0200 Subject: [PATCH 1100/1460] fix: error on the creation of a new member --- htdocs/adherents/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index c4ac6ef1472..f8018ada57d 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -935,8 +935,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $object->country = $tmparray['label']; } + $soc = new Societe($db); if (!empty($socid)) { - $soc = new Societe($db); if ($socid > 0) { $soc->fetch($socid); } From 622304126e3ed189862529062cf5ea79b6245070 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 22 Oct 2021 16:35:23 +0200 Subject: [PATCH 1101/1460] Fix phpcs --- htdocs/public/partnership/new.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/htdocs/public/partnership/new.php b/htdocs/public/partnership/new.php index a46488ab5f9..fe57f4ea424 100644 --- a/htdocs/public/partnership/new.php +++ b/htdocs/public/partnership/new.php @@ -205,12 +205,8 @@ if (empty($reshook) && $action == 'add') { // We try to find the thirdparty or the member if (empty($conf->global->PARTNERSHIP_IS_MANAGED_FOR) || $conf->global->PARTNERSHIP_IS_MANAGED_FOR == 'thirdparty') { - - $partnership->fk_member = 0; } elseif ($conf->global->PARTNERSHIP_IS_MANAGED_FOR == 'member') { - - $partnership->fk_soc = 0; } From d5fc28f9b5a44eb91fd2493439dd30f79787a387 Mon Sep 17 00:00:00 2001 From: Theo Date: Fri, 22 Oct 2021 16:46:55 +0200 Subject: [PATCH 1102/1460] add: quick link categories to contacts --- htdocs/categories/viewcat.php | 30 +++++++++++++++++++++++++++--- htdocs/langs/fr_FR/categories.lang | 1 + 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 9158cf0dd92..df579ba99f7 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -173,9 +173,10 @@ if ($elemid && $action == 'addintocategory' && (($type == Categorie::TYPE_PRODUCT && ($user->rights->produit->creer || $user->rights->service->creer)) || ($type == Categorie::TYPE_CUSTOMER && $user->rights->societe->creer) || ($type == Categorie::TYPE_SUPPLIER && $user->rights->societe->creer) || - ($type == Categorie::TYPE_TICKET && $user->rights->ticket->write) || - ($type == Categorie::TYPE_PROJECT && $user->rights->projet->creer)|| - ($type == Categorie::TYPE_MEMBER && $user->rights->projet->creer) + ($type == Categorie::TYPE_TICKET && $user->rights->ticket->write) || + ($type == Categorie::TYPE_PROJECT && $user->rights->projet->creer) || + ($type == Categorie::TYPE_MEMBER && $user->rights->projet->creer) || + ($type == Categorie::TYPE_CONTACT && $user->rights->societe->creer) )) { if ($type == Categorie::TYPE_PRODUCT) { require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; @@ -201,6 +202,10 @@ if ($elemid && $action == 'addintocategory' && require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; $newobject = new Adherent($db); $elementtype = 'member'; + } elseif ($type == Categorie::TYPE_CONTACT) { + require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; + $newobject = new Contact($db); + $elementtype = 'contact'; } $result = $newobject->fetch($elemid); @@ -782,6 +787,25 @@ if ($type == Categorie::TYPE_CONTACT) { if ($contacts < 0) { dol_print_error($db, $object->error, $object->errors); } else { + // Form to add record into a category + $showclassifyform = 1; + if ($showclassifyform) { + print '
    '; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print '
    '; + print $langs->trans("AddContactIntoCategory").'  '; + print $form->selectContacts('', '','elemid'); + print '
    '; + print ''; + } print '
    '; print ''; print ''; diff --git a/htdocs/langs/fr_FR/categories.lang b/htdocs/langs/fr_FR/categories.lang index 6bf8db21f03..0868802298e 100644 --- a/htdocs/langs/fr_FR/categories.lang +++ b/htdocs/langs/fr_FR/categories.lang @@ -90,6 +90,7 @@ CategorieRecursivHelp=Si l'option est activé, quand un produit est ajouté dans AddProductServiceIntoCategory=Ajouter le produit/service suivant AddCustomerIntoCategory=Assigner cette catégorie au client AddMemberIntoCategory=Assigner cette catégorie au membre +AddContactIntoCategory=Assigner cette catégorie au contact AddProjectIntoCategory=Assigner cette catégorie au projet AddTicketIntoCategory=Assigner cette catégorie au ticket AddSupplierIntoCategory=Assigner cette catégorie au fournisseur From f4a48e46ffa89d0e56de0f6894933c646ea0689d Mon Sep 17 00:00:00 2001 From: Theo Date: Fri, 22 Oct 2021 16:54:31 +0200 Subject: [PATCH 1103/1460] add: quick link categories to user --- htdocs/categories/viewcat.php | 26 +++++++++++++++++++++++++- htdocs/langs/fr_FR/categories.lang | 1 + 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index df579ba99f7..ebd147e3cb1 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -176,7 +176,8 @@ if ($elemid && $action == 'addintocategory' && ($type == Categorie::TYPE_TICKET && $user->rights->ticket->write) || ($type == Categorie::TYPE_PROJECT && $user->rights->projet->creer) || ($type == Categorie::TYPE_MEMBER && $user->rights->projet->creer) || - ($type == Categorie::TYPE_CONTACT && $user->rights->societe->creer) + ($type == Categorie::TYPE_CONTACT && $user->rights->societe->creer) || + ($type == Categorie::TYPE_USER && $user->rights->user->user->creer) )) { if ($type == Categorie::TYPE_PRODUCT) { require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; @@ -206,6 +207,10 @@ if ($elemid && $action == 'addintocategory' && require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; $newobject = new Contact($db); $elementtype = 'contact'; + } elseif ($type == Categorie::TYPE_USER) { + require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; + $newobject = new User($db); + $elementtype = 'user'; } $result = $newobject->fetch($elemid); @@ -1004,6 +1009,25 @@ if ($type == Categorie::TYPE_USER) { if ($users < 0) { dol_print_error($db, $object->error, $object->errors); } else { + // Form to add record into a category + $showclassifyform = 1; + if ($showclassifyform) { + print '
    '; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print '
    '; + print $langs->trans("AddProjectIntoCategory").'  '; + $form->select_users('', 'elemid'); + print '
    '; + print ''; + } print '
    '; print ''; print ''; diff --git a/htdocs/langs/fr_FR/categories.lang b/htdocs/langs/fr_FR/categories.lang index 0868802298e..36b96f8ffae 100644 --- a/htdocs/langs/fr_FR/categories.lang +++ b/htdocs/langs/fr_FR/categories.lang @@ -91,6 +91,7 @@ AddProductServiceIntoCategory=Ajouter le produit/service suivant AddCustomerIntoCategory=Assigner cette catégorie au client AddMemberIntoCategory=Assigner cette catégorie au membre AddContactIntoCategory=Assigner cette catégorie au contact +AddUserIntoCategory=Assigner cette catégorie à l'utilisateur AddProjectIntoCategory=Assigner cette catégorie au projet AddTicketIntoCategory=Assigner cette catégorie au ticket AddSupplierIntoCategory=Assigner cette catégorie au fournisseur From 40a23e4aa455820d630d9d1d7f7238f745219554 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 22 Oct 2021 17:12:44 +0200 Subject: [PATCH 1104/1460] Update work, thanks Florian --- .../class/accountingaccount.class.php | 113 +++++++++++------- htdocs/accountancy/customer/index.php | 4 +- htdocs/accountancy/customer/list.php | 4 +- htdocs/accountancy/supplier/index.php | 4 +- htdocs/accountancy/supplier/list.php | 4 +- 5 files changed, 81 insertions(+), 48 deletions(-) diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index ed3c69c18bc..50116b94b23 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -1,10 +1,10 @@ - * Copyright (C) 2013-2020 Alexandre Spangaro - * Copyright (C) 2013-2014 Florian Henry + * Copyright (C) 2013-2021 Alexandre Spangaro + * Copyright (C) 2013-2021 Florian Henry * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Ari Elbaz (elarifr) - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018 Frédéric France * * 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 @@ -738,10 +738,11 @@ class AccountingAccount extends CommonObject * @param Facture $facture Facture * @param FactureLigne $factureDet Facture Det * @param array $accountingAccount array of Account account + * @param string $type Customer / Supplier * * @return array Accounting accounts suggested */ - public function getAccountingCodeToBind(Societe $buyer, $seller, Product $product, Facture $facture, FactureLigne $factureDet, $accountingAccount = array()) + public function getAccountingCodeToBind(Societe $buyer, $seller, Product $product, Facture $facture, FactureLigne $factureDet, $accountingAccount = array(), $type = '') { global $conf; global $hookmanager; @@ -750,84 +751,116 @@ class AccountingAccount extends CommonObject $hookmanager->initHooks(array('accoutancyBindingCalculation')); // Execute hook accoutancyBindingCalculation - $parameters = array('buyer' => $buyer, 'seller' => $seller, 'product' => $product, 'facture' => $facture, 'factureDet' => $factureDet ,'accountingAccount'=>$accountingAccount); + $parameters = array('buyer' => $buyer, 'seller' => $seller, 'product' => $product, 'facture' => $facture, 'factureDet' => $factureDet ,'accountingAccount'=>$accountingAccount, $type); $reshook = $hookmanager->executeHooks('accoutancyBindingCalculation', $parameters); // Note that $action and $object may have been modified by some hooks if (empty($reshook)) { + if ($type=='customer') { + $const_name = "SOLD"; + } elseif ($type=='supplier') { + $const_name = "BUY"; + } + require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; $isBuyerInEEC = isInEEC($buyer); $isSellerInEEC = isInEEC($seller); - $code_sell_l = ''; - $code_sell_p = ''; - $code_sell_t = ''; + $code_l = ''; + $code_p = ''; + $code_t = ''; $suggestedid = ''; // Level 1: Search suggested default account for product/service $suggestedaccountingaccountbydefaultfor = ''; if ($factureDet->product_type == 1) { if ($buyer->country_code == $seller->country_code || empty($buyer->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country) - $code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : ''); + $code_l = (!empty($conf->global->{'ACCOUNTING_SERVICE_' . $const_name . '_ACCOUNT'}) ? $conf->global->{'ACCOUNTING_SERVICE_' . $const_name . '_ACCOUNT'} : ''); $suggestedaccountingaccountbydefaultfor = ''; } else { if ($isSellerInEEC && $isBuyerInEEC && $factureDet->tva_tx != 0) { // European intravat sale, but with a VAT - $code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : ''); + $code_l = (!empty($conf->global->{'ACCOUNTING_SERVICE_' . $const_name . '_ACCOUNT'}) ? $conf->global->{'ACCOUNTING_SERVICE_' . $const_name . '_ACCOUNT'} : ''); $suggestedaccountingaccountbydefaultfor = 'eecwithvat'; } elseif ($isSellerInEEC && $isBuyerInEEC && empty($buyer->tva_intra)) { // European intravat sale, without VAT intra community number - $code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : ''); + $code_l = (!empty($conf->global->{'ACCOUNTING_SERVICE_' . $const_name . '_ACCOUNT'}) ? $conf->global->{'ACCOUNTING_SERVICE_' . $const_name . '_ACCOUNT'} : ''); $suggestedaccountingaccountbydefaultfor = 'eecwithoutvatnumber'; } elseif ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale - $code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT : ''); + $code_l = (!empty($conf->global->{'ACCOUNTING_SERVICE_' . $const_name . '_INTRA_ACCOUNT'}) ? $conf->global->{'ACCOUNTING_SERVICE_' . $const_name . '_INTRA_ACCOUNT'} : ''); $suggestedaccountingaccountbydefaultfor = 'eec'; } else { // Foreign sale - $code_sell_l = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT : ''); + $code_l = (!empty($conf->global->{'ACCOUNTING_SERVICE_' . $const_name . '_EXPORT_ACCOUNT'}) ? $conf->global->{'ACCOUNTING_SERVICE_' . $const_name . '_EXPORT_ACCOUNT'} : ''); $suggestedaccountingaccountbydefaultfor = 'export'; } } } elseif ($factureDet->product_type == 0) { if ($buyer->country_code == $seller->country_code || empty($buyer->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country) - $code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : ''); + $code_l = (!empty($conf->global->{'ACCOUNTING_PRODUCT_' . $const_name . '_ACCOUNT'}) ? $conf->global->{'ACCOUNTING_PRODUCT_' . $const_name . '_ACCOUNT'} : ''); $suggestedaccountingaccountbydefaultfor = ''; } else { if ($isSellerInEEC && $isBuyerInEEC && $factureDet->tva_tx != 0) { // European intravat sale, but with a VAT - $code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : ''); + $code_l = (!empty($conf->global->{'ACCOUNTING_PRODUCT_' . $const_name . '_ACCOUNT'}) ? $conf->global->{'ACCOUNTING_PRODUCT_' . $const_name . '_ACCOUNT'} : ''); $suggestedaccountingaccountbydefaultfor = 'eecwithvat'; } elseif ($isSellerInEEC && $isBuyerInEEC && empty($buyer->tva_intra)) { // European intravat sale, without VAT intra community number - $code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : ''); + $code_l = (!empty($conf->global->{'ACCOUNTING_PRODUCT_' . $const_name . '_ACCOUNT'}) ? $conf->global->{'ACCOUNTING_PRODUCT_' . $const_name . '_ACCOUNT'} : ''); $suggestedaccountingaccountbydefaultfor = 'eecwithoutvatnumber'; } elseif ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale - $code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT : ''); + $code_l = (!empty($conf->global->{'ACCOUNTING_PRODUCT_' . $const_name . '_INTRA_ACCOUNT'}) ? $conf->global->{'ACCOUNTING_PRODUCT_' . $const_name . '_INTRA_ACCOUNT'} : ''); $suggestedaccountingaccountbydefaultfor = 'eec'; } else { - $code_sell_l = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT : ''); + $code_l = (!empty($conf->global->{'ACCOUNTING_PRODUCT_' . $const_name . '_EXPORT_ACCOUNT'}) ? $conf->global->{'ACCOUNTING_PRODUCT_' . $const_name . '_EXPORT_ACCOUNT'} : ''); $suggestedaccountingaccountbydefaultfor = 'export'; } } } - if ($code_sell_l == -1) { - $code_sell_l = ''; + if ($code_l == -1) { + $code_l = ''; } // Level 2: Search suggested account for product/service (similar code exists in page index.php to make automatic binding) $suggestedaccountingaccountfor = ''; - if ((($buyer->country_code == $seller->country_code) || empty($buyer->country_code)) && !empty($product->accountancy_code_sell)) { // If buyer in same country than seller (if not defined, we assume it is same country) - $code_sell_p = $product->accountancy_code_sell; + if ((($buyer->country_code == $seller->country_code) || empty($buyer->country_code))) { + // If buyer in same country than seller (if not defined, we assume it is same country) + if ($type=='customer' && !empty($product->accountancy_code_sell)) { + $code_p = $product->accountancy_code_sell; + } elseif ($type=='supplier' && !empty($product->accountancy_code_buy)) { + $code_p = $product->accountancy_code_sell; + } $suggestedid = $accountingAccount['dom']; $suggestedaccountingaccountfor = 'prodserv'; } else { - if ($isSellerInEEC && $isBuyerInEEC && $factureDet->tva_tx != 0 && !empty($product->accountancy_code_sell)) { // European intravat sale, but with VAT - $code_sell_p = $product->accountancy_code_sell; + if ($isSellerInEEC && $isBuyerInEEC && $factureDet->tva_tx != 0) { + // European intravat sale, but with VAT + if ($type=='customer' && !empty($product->accountancy_code_sell)) { + $code_p = $product->accountancy_code_sell; + } elseif ($type=='supplier' && !empty($product->accountancy_code_buy)) { + $code_p = $product->accountancy_code_sell; + } $suggestedid = $accountingAccount['dom']; $suggestedaccountingaccountfor = 'eecwithvat'; - } elseif ($isSellerInEEC && $isBuyerInEEC && empty($buyer->tva_intra) && !empty($product->accountancy_code_sell)) { // European intravat sale, without VAT intra community number - $code_sell_p = $product->accountancy_code_sell; + } elseif ($isSellerInEEC && $isBuyerInEEC && empty($buyer->tva_intra)) { + // European intravat sale, without VAT intra community number + if ($type=='customer' && !empty($product->accountancy_code_sell)) { + $code_p = $product->accountancy_code_sell; + } elseif ($type=='supplier' && !empty($product->accountancy_code_buy)) { + $code_p = $product->accountancy_code_sell; + } $suggestedid = $accountingAccount['dom']; // There is a doubt for this case. Is it an error on vat or we just forgot to fill vat number ? $suggestedaccountingaccountfor = 'eecwithoutvatnumber'; - } elseif ($isSellerInEEC && $isBuyerInEEC && !empty($product->accountancy_code_sell_intra)) { // European intravat sale - $code_sell_p = $product->accountancy_code_sell_intra; + } elseif ($isSellerInEEC && $isBuyerInEEC && !empty($product->accountancy_code_sell_intra)) { + // European intravat sale + if ($type=='customer' && !empty($product->accountancy_code_sell_intra)) { + $code_p = $product->accountancy_code_sell_intra; + } elseif ($type=='supplier' && !empty($product->accountancy_code_buy_intra)) { + $code_p = $product->accountancy_code_buy_intra; + } $suggestedid = $accountingAccount['intra']; $suggestedaccountingaccountfor = 'eec'; - } elseif (!empty($product->accountancy_code_sell_export)) { // Foreign sale - $code_sell_p = $product->accountancy_code_sell_export; + } else { + // Foreign sale + // European intravat sale + if ($type=='customer' && !empty($product->accountancy_code_sell_export)) { + $code_p = $product->accountancy_code_sell_export; + } elseif ($type=='supplier' && !empty($product->accountancy_code_sell_export)) { + $code_p = $product->accountancy_code_sell_export; + } $suggestedid = $accountingAccount['export']; $suggestedaccountingaccountfor = 'export'; } @@ -836,7 +869,7 @@ class AccountingAccount extends CommonObject // Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding) if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) { if (!empty($buyer->code_compta)) { - $code_sell_t = $buyer->code_compta; + $code_t = $buyer->code_compta; $suggestedid = $accountingAccount['thirdparty']; $suggestedaccountingaccountfor = 'thridparty'; } @@ -850,33 +883,33 @@ class AccountingAccount extends CommonObject return -1; } - $code_sell_l = $accountdeposittoventilated->ref; + $code_l = $accountdeposittoventilated->ref; $suggestedid = $accountdeposittoventilated->rowid; $suggestedaccountingaccountfor = 'deposit'; } - if (empty($suggestedid) && empty($code_sell_p) && !empty($code_sell_l) && empty($conf->global->ACCOUNTANCY_DO_NOT_AUTOFILL_ACCOUNT_WITH_GENERIC)) { - if (empty($this->accountingaccount_codetotid_cache[$code_sell_l])) { + if (empty($suggestedid) && empty($code_p) && !empty($code_l) && empty($conf->global->ACCOUNTANCY_DO_NOT_AUTOFILL_ACCOUNT_WITH_GENERIC)) { + if (empty($this->accountingaccount_codetotid_cache[$code_l])) { $tmpaccount = new self($this->db); - $result = $tmpaccount->fetch(0, $code_sell_l, 1); + $result = $tmpaccount->fetch(0, $code_l, 1); if ($result < 0) { return -1; } if ($tmpaccount->id > 0) { $suggestedid = $tmpaccount->id; } - $this->accountingaccount_codetotid_cache[$code_sell_l] = $tmpaccount->id; + $this->accountingaccount_codetotid_cache[$code_l] = $tmpaccount->id; } else { - $suggestedid = $this->accountingaccount_codetotid_cache[$code_sell_l]; + $suggestedid = $this->accountingaccount_codetotid_cache[$code_l]; } } return array( 'suggestedaccountingaccountbydefaultfor' => $suggestedaccountingaccountbydefaultfor, 'suggestedaccountingaccountfor' => $suggestedaccountingaccountfor, 'suggestedid' => $suggestedid, - 'code_sell_l' => $code_sell_l, - 'code_sell_p' => $code_sell_p, - 'code_sell_t' => $code_sell_t, + 'code_l' => $code_l, + 'code_p' => $code_p, + 'code_t' => $code_t, ); } else { if (is_array($hookmanager->resArray) && !empty($hookmanager->resArray)) { diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index 2688af9a614..64607b3bd72 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -234,7 +234,7 @@ if ($action == 'validatehistory') { $facture_static_det->product_type = $objp->type_l; $facture_static_det->desc = $objp->description; - $accoutingAccountArray = array( + $accountingAccountArray = array( 'dom'=>$objp->aarowid, 'intra'=>$objp->aarowid_intra, 'export'=>$objp->aarowid_export, @@ -243,7 +243,7 @@ if ($action == 'validatehistory') { $code_sell_p_notset = ''; $code_sell_t_notset = ''; - $return=$accountingAccount->getAccountingCodeToBind($thirdpartystatic, $mysoc, $product_static, $facture_static, $facture_static_det, $accoutingAccountArray); + $return=$accountingAccount->getAccountingCodeToBind($thirdpartystatic, $mysoc, $product_static, $facture_static, $facture_static_det, $accountingAccountArray, 'customer'); if (!is_array($return) && $return<0) { setEventMessage($accountingAccount->error, 'errors'); } else { diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 45e539cbdfd..24a64bac872 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -567,7 +567,7 @@ if ($result) { $facture_static_det->product_type = $objp->type_l; $facture_static_det->desc = $objp->description; - $accoutingAccountArray = array( + $accountingAccountArray = array( 'dom'=>$objp->aarowid, 'intra'=>$objp->aarowid_intra, 'export'=>$objp->aarowid_export, @@ -576,7 +576,7 @@ if ($result) { $code_sell_p_notset = ''; $code_sell_t_notset = ''; - $return=$accountingAccount->getAccountingCodeToBind($thirdpartystatic, $mysoc, $product_static, $facture_static, $facture_static_det, $accoutinAccountArray); + $return=$accountingAccount->getAccountingCodeToBind($thirdpartystatic, $mysoc, $product_static, $facture_static, $facture_static_det, $accountingAccountArray, 'customer'); if (!is_array($return) && $return<0) { setEventMessage($accountingAccount->error, 'errors'); } else { diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index 476ead53860..39a60383492 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -232,7 +232,7 @@ if ($action == 'validatehistory') { $facture_static_det->product_type = $objp->type_l; $facture_static_det->desc = $objp->description; - $accoutingAccountArray = array( + $accountingAccountArray = array( 'dom'=>$objp->aarowid, 'intra'=>$objp->aarowid_intra, 'export'=>$objp->aarowid_export, @@ -241,7 +241,7 @@ if ($action == 'validatehistory') { $code_buy_p_notset = ''; $code_buy_t_notset = ''; - $return = $accountingAccount->getAccountingCodeToBind($mysoc, $thirdpartystatic, $product_static, $facture_static, $facture_static_det, $accoutingAccountArray); + $return = $accountingAccount->getAccountingCodeToBind($mysoc, $thirdpartystatic, $product_static, $facture_static, $facture_static_det, $accountingAccountArray, 'supplier'); if (!is_array($return) && $return<0) { setEventMessage($accountingAccount->error, 'errors'); } else { diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index 5b591db6069..20230c7cfad 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -578,7 +578,7 @@ if ($result) { $code_buy_t_notset = ''; $objp->aarowid_suggest = ''; // Will be set later - $accoutingAccountArray = array( + $accountingAccountArray = array( 'dom'=>$objp->aarowid, 'intra'=>$objp->aarowid_intra, 'export'=>$objp->aarowid_export, @@ -587,7 +587,7 @@ if ($result) { $code_buy_p_notset = ''; $code_buy_t_notset = ''; - $return=$accountingAccount->getAccountingCodeToBind($mysoc, $thirdpartystatic, $product_static, $facture_static, $facture_static_det, $accoutinAccountArray); + $return=$accountingAccount->getAccountingCodeToBind($mysoc, $thirdpartystatic, $product_static, $facturefourn_static, $facturefourn_static_det, $accountingAccountArray, 'supplier'); if (!is_array($return) && $return<0) { setEventMessage($accountingAccount->error, 'errors'); } else { From 03030685f620dc71d5925a8eeaa1cbf4e6296222 Mon Sep 17 00:00:00 2001 From: Theo Date: Fri, 22 Oct 2021 17:15:51 +0200 Subject: [PATCH 1105/1460] add: quick link categories to account --- htdocs/categories/viewcat.php | 30 ++++++++++++++++++++++++++++-- htdocs/langs/fr_FR/categories.lang | 1 + 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index ebd147e3cb1..c94a7086507 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -177,7 +177,8 @@ if ($elemid && $action == 'addintocategory' && ($type == Categorie::TYPE_PROJECT && $user->rights->projet->creer) || ($type == Categorie::TYPE_MEMBER && $user->rights->projet->creer) || ($type == Categorie::TYPE_CONTACT && $user->rights->societe->creer) || - ($type == Categorie::TYPE_USER && $user->rights->user->user->creer) + ($type == Categorie::TYPE_USER && $user->rights->user->user->creer) || + ($type == Categorie::TYPE_ACCOUNT && $user->rights->banque->configurer) )) { if ($type == Categorie::TYPE_PRODUCT) { require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; @@ -211,6 +212,10 @@ if ($elemid && $action == 'addintocategory' && require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; $newobject = new User($db); $elementtype = 'user'; + } elseif ($type == Categorie::TYPE_ACCOUNT) { + require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + $newobject = new User($db); + $elementtype = 'bank_account'; } $result = $newobject->fetch($elemid); @@ -558,6 +563,7 @@ if ($type == Categorie::TYPE_PRODUCT) { } } +// List of customers if ($type == Categorie::TYPE_CUSTOMER) { $permission = $user->rights->societe->creer; @@ -631,7 +637,7 @@ if ($type == Categorie::TYPE_CUSTOMER) { } } - +// List of suppliers if ($type == Categorie::TYPE_SUPPLIER) { $permission = $user->rights->societe->creer; @@ -876,6 +882,26 @@ if ($type == Categorie::TYPE_ACCOUNT) { if ($accounts < 0) { dol_print_error($db, $object->error, $object->errors); } else { + // Form to add record into a category + $showclassifyform = 1; + if ($showclassifyform) { + print '
    '; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print '
    '; + print $langs->trans("AddAccountIntoCategory").'  '; + $form->select_comptes('', 'elemid'); + print '
    '; + print ''; + } + print '
    '; print ''; print ''; diff --git a/htdocs/langs/fr_FR/categories.lang b/htdocs/langs/fr_FR/categories.lang index 36b96f8ffae..3789fd970a1 100644 --- a/htdocs/langs/fr_FR/categories.lang +++ b/htdocs/langs/fr_FR/categories.lang @@ -93,6 +93,7 @@ AddMemberIntoCategory=Assigner cette catégorie au membre AddContactIntoCategory=Assigner cette catégorie au contact AddUserIntoCategory=Assigner cette catégorie à l'utilisateur AddProjectIntoCategory=Assigner cette catégorie au projet +AddAccountIntoCategory=Assigner cette catégorie au compte AddTicketIntoCategory=Assigner cette catégorie au ticket AddSupplierIntoCategory=Assigner cette catégorie au fournisseur ShowCategory=Afficher tag/catégorie From 3d8a5d745a87f774e2d635ea3ee6dbe2de727ff1 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 22 Oct 2021 17:42:57 +0200 Subject: [PATCH 1106/1460] fix php 8 warning --- htdocs/ticket/list.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 04e411b54a6..666758a907a 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -390,7 +390,11 @@ foreach ($search as $key => $val) { } continue; } - $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); + if (array_key_exists($key, $object->fields)) { + $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); + } else { + $mode_search = 0; + } if ($search[$key] != '') { $sql .= natural_search($key, $search[$key], $mode_search); } @@ -912,6 +916,7 @@ if (!empty($extrafields->attributes[$object->table_element]['computed']) && is_a // -------------------------------------------------------------------- $i = 0; $totalarray = array(); +$totalarray['nbfield']=0; $cacheofoutputfield = array(); while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); @@ -946,15 +951,17 @@ while ($i < min($num, $limit)) { } if (!empty($arrayfields['t.'.$key]['checked'])) { print ''; From 070a03724af73e9ae4b03bd2dceaa730e12c2511 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 22 Oct 2021 15:46:16 +0000 Subject: [PATCH 1107/1460] Fixing style errors. --- htdocs/categories/viewcat.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index c94a7086507..d286354037f 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -811,7 +811,7 @@ if ($type == Categorie::TYPE_CONTACT) { print ''; print ''; print ''; print '
    '; print $langs->trans("AddContactIntoCategory").'  '; - print $form->selectContacts('', '','elemid'); + print $form->selectContacts('', '', 'elemid'); print '
    '; From 17773f84143a13419edef2c48b40b88ba5c598fe Mon Sep 17 00:00:00 2001 From: atm-florian Date: Fri, 22 Oct 2021 18:26:23 +0200 Subject: [PATCH 1108/1460] FIX tcpdf vulnerability to roman numeral bomb, cf. tecnickom/TCPDF issue #315 --- dev/dolibarr_changes.txt | 12 ++++++++++++ .../tecnickcom/tcpdf/include/tcpdf_static.php | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt index ecd25ce692b..8cb0e002d16 100644 --- a/dev/dolibarr_changes.txt +++ b/dev/dolibarr_changes.txt @@ -175,6 +175,18 @@ In htdocs/includes/tecnickcom/tcpdf/tcpdf.php - protected $default_monospaced_font = 'courier'; + protected $default_monospaced_font = 'freemono'; +* In tecnickcom/tcpdf/include/tcpdf_static, in function intToRoman, right at the beginning + of the function, replace: + + $roman = ''; + +with: + + $roman = ''; + if ($number >= 4000) { + // do not represent numbers above 4000 in Roman numerals + return strval($number); + } diff --git a/htdocs/includes/tecnickcom/tcpdf/include/tcpdf_static.php b/htdocs/includes/tecnickcom/tcpdf/include/tcpdf_static.php index 67bb255d187..9ed6233b46c 100644 --- a/htdocs/includes/tecnickcom/tcpdf/include/tcpdf_static.php +++ b/htdocs/includes/tecnickcom/tcpdf/include/tcpdf_static.php @@ -1440,6 +1440,10 @@ class TCPDF_STATIC { */ public static function intToRoman($number) { $roman = ''; + if ($number >= 4000) { + // do not represent numbers above 4000 in Roman numerals + return strval($number); + } while ($number >= 1000) { $roman .= 'M'; $number -= 1000; From 370642213fa172812a54cf3f844fe9fdd2cc9d7f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 22 Oct 2021 18:44:39 +0200 Subject: [PATCH 1109/1460] Fix warning --- htdocs/webservices/server_thirdparty.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/webservices/server_thirdparty.php b/htdocs/webservices/server_thirdparty.php index 554f7e7e996..800c2e0e2a2 100644 --- a/htdocs/webservices/server_thirdparty.php +++ b/htdocs/webservices/server_thirdparty.php @@ -462,7 +462,7 @@ function createThirdParty($authentication, $thirdparty) if ($thirdparty['country_code']) { $newobject->country_id = getCountry($thirdparty['country_code'], 3); } - $newobject->region_code = $thirdparty['region_code']; + $newobject->region_code = empty($thirdparty['region_code']) ? '' : $thirdparty['region_code']; //if ($thirdparty['province_code']) $newobject->province_code=getCountry($thirdparty['province_code'],3); $newobject->phone = $thirdparty['phone']; From 2780bb73c31a0cae3b5d92084d2a40540feafca7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 22 Oct 2021 21:57:34 +0200 Subject: [PATCH 1110/1460] fix warning --- htdocs/debugbar/class/DataCollector/DolLogsCollector.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/debugbar/class/DataCollector/DolLogsCollector.php b/htdocs/debugbar/class/DataCollector/DolLogsCollector.php index 520a0a20a72..5fd339918fa 100644 --- a/htdocs/debugbar/class/DataCollector/DolLogsCollector.php +++ b/htdocs/debugbar/class/DataCollector/DolLogsCollector.php @@ -73,7 +73,7 @@ class DolLogsCollector extends MessagesCollector { global $conf; - $uselogfile = $conf->global->DEBUGBAR_USE_LOGFILE; + $uselogfile = getDolGlobalInt('DEBUGBAR_USE_LOGFILE'); if ($uselogfile) { $this->getStorageLogs($this->path); From 9ca8dfcef91d1e5de8e6b5a87c910fe474674de9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 22 Oct 2021 22:05:04 +0200 Subject: [PATCH 1111/1460] fix warning --- htdocs/accountancy/admin/account.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index c9849f9f54f..4c9bb047439 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -51,14 +51,14 @@ $confirm = GETPOST('confirm', 'alpha'); $chartofaccounts = GETPOST('chartofaccounts', 'int'); -$permissiontoadd = $user->rights->accounting->chartofaccount; -$permissiontodelete = $user->rights->accounting->chartofaccount; +$permissiontoadd = !empty($user->rights->accounting->chartofaccount); +$permissiontodelete = !empty($user->rights->accounting->chartofaccount); // Security check if ($user->socid > 0) { accessforbidden(); } -if (!$user->rights->accounting->chartofaccount) { +if (empty($user->rights->accounting->chartofaccount)) { accessforbidden(); } From 6e2f438830e3eccdae638bfb537e2a4f241211c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 22 Oct 2021 22:07:47 +0200 Subject: [PATCH 1112/1460] Update accountmodel.php --- htdocs/accountancy/admin/accountmodel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index f19afb12899..97a460beaac 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -78,7 +78,7 @@ $search_country_id = GETPOST('search_country_id', 'int'); if ($user->socid > 0) { accessforbidden(); } -if (!$user->rights->accounting->chartofaccount) { +if (empty($user->rights->accounting->chartofaccount)) { accessforbidden(); } From e411e23082392fe11e2a73fb0af6ad7bdbd6de03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 22 Oct 2021 22:08:13 +0200 Subject: [PATCH 1113/1460] Update card.php --- htdocs/accountancy/admin/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index 4d69eae7db8..9430bf33439 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -48,7 +48,7 @@ $label = GETPOST('label', 'alpha'); if ($user->socid > 0) { accessforbidden(); } -if (!$user->rights->accounting->chartofaccount) { +if (empty($user->rights->accounting->chartofaccount)) { accessforbidden(); } From e82a07085fadcd5ca4b2629ff371cf554544745f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 22 Oct 2021 22:08:38 +0200 Subject: [PATCH 1114/1460] Update subaccount.php --- htdocs/accountancy/admin/subaccount.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/admin/subaccount.php b/htdocs/accountancy/admin/subaccount.php index c3308393c27..26c02de3467 100644 --- a/htdocs/accountancy/admin/subaccount.php +++ b/htdocs/accountancy/admin/subaccount.php @@ -46,7 +46,7 @@ $search_type = GETPOST('search_type', 'int'); if ($user->socid > 0) { accessforbidden(); } -if (!$user->rights->accounting->chartofaccount) { +if (empty($user->rights->accounting->chartofaccount)) { accessforbidden(); } From 46c4f284786fbb9791ff5110027b6336362a7643 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 22 Oct 2021 22:15:59 +0200 Subject: [PATCH 1115/1460] fix multiple warnings --- htdocs/accountancy/admin/productaccount.php | 2 +- htdocs/accountancy/customer/index.php | 2 +- htdocs/accountancy/supplier/index.php | 2 +- .../adherents/class/adherentstats.class.php | 12 +++--- htdocs/adherents/htpasswd.php | 2 +- htdocs/adherents/subscription/card.php | 2 +- htdocs/adherents/subscription/info.php | 2 +- htdocs/comm/action/class/actioncomm.class.php | 4 +- htdocs/comm/action/index.php | 4 +- htdocs/comm/action/list.php | 4 +- htdocs/comm/action/pertype.php | 4 +- htdocs/comm/action/peruser.php | 4 +- htdocs/comm/contact.php | 4 +- htdocs/comm/index.php | 40 +++++++++---------- htdocs/comm/propal/class/propal.class.php | 10 ++--- .../comm/propal/class/propalestats.class.php | 14 +++---- htdocs/comm/propal/index.php | 20 +++++----- htdocs/comm/propal/list.php | 6 +-- htdocs/comm/propal/stats/index.php | 6 +-- htdocs/comm/prospect/index.php | 16 ++++---- htdocs/commande/class/commande.class.php | 10 ++--- htdocs/commande/class/commandestats.class.php | 14 +++---- htdocs/commande/customer.php | 6 +-- htdocs/commande/index.php | 16 ++++---- htdocs/commande/list.php | 4 +- htdocs/commande/stats/index.php | 6 +-- htdocs/compta/clients.php | 6 +-- htdocs/compta/deplacement/index.php | 4 +- htdocs/compta/deplacement/list.php | 4 +- htdocs/compta/deplacement/stats/index.php | 2 +- htdocs/compta/facture/class/facture.class.php | 10 ++--- .../facture/class/facturestats.class.php | 16 ++++---- .../compta/facture/invoicetemplate_list.php | 4 +- htdocs/compta/facture/list.php | 4 +- htdocs/compta/facture/stats/index.php | 2 +- htdocs/compta/index.php | 12 +++--- htdocs/compta/paiement/list.php | 4 +- htdocs/compta/paiement/rapport.php | 2 +- htdocs/compta/paymentbybanktransfer/index.php | 4 +- htdocs/compta/prelevement/demandes.php | 4 +- htdocs/compta/prelevement/index.php | 4 +- htdocs/contact/class/contact.class.php | 2 +- htdocs/contact/list.php | 4 +- htdocs/contrat/class/contrat.class.php | 6 +-- htdocs/contrat/index.php | 28 ++++++------- htdocs/contrat/list.php | 4 +- htdocs/contrat/services_list.php | 6 +-- htdocs/core/boxes/box_actions.php | 4 +- htdocs/core/boxes/box_activity.php | 12 +++--- htdocs/core/boxes/box_clients.php | 4 +- htdocs/core/boxes/box_commandes.php | 4 +- htdocs/core/boxes/box_contacts.php | 4 +- htdocs/core/boxes/box_contracts.php | 4 +- ...box_customers_outstanding_bill_reached.php | 4 +- htdocs/core/boxes/box_factures.php | 4 +- htdocs/core/boxes/box_factures_fourn.php | 4 +- htdocs/core/boxes/box_factures_fourn_imp.php | 4 +- htdocs/core/boxes/box_factures_imp.php | 4 +- htdocs/core/boxes/box_ficheinter.php | 4 +- htdocs/core/boxes/box_fournisseurs.php | 4 +- .../boxes/box_graph_invoices_permonth.php | 2 +- .../core/boxes/box_graph_invoices_peryear.php | 2 +- .../box_graph_invoices_supplier_permonth.php | 2 +- .../core/boxes/box_graph_orders_permonth.php | 2 +- .../box_graph_orders_supplier_permonth.php | 2 +- .../boxes/box_graph_propales_permonth.php | 2 +- .../core/boxes/box_last_modified_ticket.php | 2 +- htdocs/core/boxes/box_last_ticket.php | 2 +- htdocs/core/boxes/box_propales.php | 4 +- htdocs/core/boxes/box_prospect.php | 4 +- htdocs/core/boxes/box_services_contracts.php | 2 +- htdocs/core/boxes/box_services_expired.php | 4 +- htdocs/core/boxes/box_shipments.php | 4 +- htdocs/core/boxes/box_supplier_orders.php | 4 +- ...box_supplier_orders_awaiting_reception.php | 4 +- htdocs/core/class/commonobject.class.php | 24 +++++------ htdocs/core/class/html.form.class.php | 8 ++-- htdocs/core/lib/agenda.lib.php | 8 ++-- htdocs/core/lib/invoice.lib.php | 36 ++++++++--------- htdocs/core/lib/order.lib.php | 4 +- htdocs/core/lib/propal.lib.php | 4 +- htdocs/core/lib/security.lib.php | 8 ++-- .../modules/rapport/pdf_paiement.class.php | 8 ++-- htdocs/core/photos_resize.php | 2 +- htdocs/document.php | 2 +- htdocs/don/stats/index.php | 6 +-- .../conferenceorbooth_list.php | 4 +- .../class/expeditionstats.class.php | 8 ++-- htdocs/expedition/index.php | 10 ++--- htdocs/expedition/list.php | 4 +- htdocs/expedition/stats/index.php | 6 +-- htdocs/expensereport/stats/index.php | 2 +- htdocs/fichinter/card-rec.php | 4 +- htdocs/fichinter/class/fichinter.class.php | 2 +- .../fichinter/class/fichinterstats.class.php | 14 +++---- htdocs/fichinter/index.php | 16 ++++---- htdocs/fichinter/list.php | 4 +- htdocs/fichinter/stats/index.php | 6 +-- htdocs/fourn/class/fournisseur.class.php | 6 +-- .../class/fournisseur.commande.class.php | 4 +- .../fourn/class/fournisseur.facture.class.php | 6 +-- htdocs/fourn/commande/index.php | 16 ++++---- htdocs/fourn/commande/list.php | 4 +- htdocs/fourn/contact.php | 6 +-- htdocs/fourn/facture/list.php | 4 +- htdocs/fourn/facture/paiement.php | 6 +-- htdocs/fourn/facture/rapport.php | 2 +- htdocs/fourn/index.php | 16 ++++---- htdocs/fourn/paiement/list.php | 8 ++-- htdocs/hrm/index.php | 10 ++--- htdocs/margin/customerMargins.php | 4 +- htdocs/margin/tabs/productMargins.php | 8 ++-- htdocs/product/stats/commande.php | 6 +-- htdocs/product/stats/commande_fournisseur.php | 6 +-- htdocs/product/stats/contrat.php | 4 +- htdocs/product/stats/facture.php | 6 +-- htdocs/product/stats/facture_fournisseur.php | 6 +-- htdocs/product/stats/propal.php | 6 +-- htdocs/product/stats/supplier_proposal.php | 6 +-- htdocs/product/stock/replenishorders.php | 4 +- htdocs/projet/class/task.class.php | 4 +- htdocs/projet/class/taskstats.class.php | 6 +-- .../reception/class/receptionstats.class.php | 8 ++-- htdocs/reception/index.php | 10 ++--- htdocs/reception/list.php | 4 +- htdocs/reception/stats/index.php | 6 +-- htdocs/recruitment/recruitmentindex.php | 8 ++-- htdocs/societe/class/client.class.php | 2 +- htdocs/societe/class/societe.class.php | 2 +- htdocs/societe/index.php | 8 ++-- .../class/supplier_proposal.class.php | 10 ++--- htdocs/supplier_proposal/index.php | 16 ++++---- htdocs/supplier_proposal/list.php | 6 +-- htdocs/ticket/class/ticket.class.php | 8 ++-- htdocs/ticket/index.php | 8 ++-- htdocs/ticket/stats/index.php | 6 +-- 136 files changed, 448 insertions(+), 448 deletions(-) diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index a842c294937..b3d6ac87780 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -41,7 +41,7 @@ $langs->loadLangs(array("companies", "compta", "accountancy", "products")); if (empty($conf->accounting->enabled)) { accessforbidden(); } -if (!$user->rights->accounting->bind->write) { +if (empty($user->rights->accounting->bind->write)) { accessforbidden(); } diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index aa1abde5fa5..83a49e7e74e 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -43,7 +43,7 @@ if (empty($conf->accounting->enabled)) { if ($user->socid > 0) { accessforbidden(); } -if (!$user->rights->accounting->bind->write) { +if (empty($user->rights->accounting->bind->write)) { accessforbidden(); } diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index 5e409f303ea..fafa9372dc0 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -40,7 +40,7 @@ if (empty($conf->accounting->enabled)) { if ($user->socid > 0) { accessforbidden(); } -if (!$user->rights->accounting->bind->write) { +if (empty($user->rights->accounting->bind->write)) { accessforbidden(); } diff --git a/htdocs/adherents/class/adherentstats.class.php b/htdocs/adherents/class/adherentstats.class.php index e777108c491..38ad3f037b9 100644 --- a/htdocs/adherents/class/adherentstats.class.php +++ b/htdocs/adherents/class/adherentstats.class.php @@ -70,7 +70,7 @@ class AdherentStats extends Stats $this->where .= " m.statut != -1"; $this->where .= " AND p.fk_adherent = m.rowid AND m.entity IN (".getEntity('adherent').")"; - //if (!$user->rights->societe->client->voir && !$user->socid) $this->where .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = " .((int) $user->id); + //if (empty($user->rights->societe->client->voir) && !$user->socid) $this->where .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = " .((int) $user->id); if ($this->memberid) { $this->where .= " AND m.rowid = ".((int) $this->memberid); } @@ -91,7 +91,7 @@ class AdherentStats extends Stats $sql = "SELECT date_format(p.dateadh,'%m') as dm, count(*)"; $sql .= " FROM ".$this->from; - //if (!$user->rights->societe->client->voir && !$user->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + //if (empty($user->rights->societe->client->voir) && !$user->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql .= " WHERE ".dolSqlDateFilter('p.dateadh', 0, 0, (int) $year, 1); $sql .= " AND ".$this->where; $sql .= " GROUP BY dm"; @@ -111,7 +111,7 @@ class AdherentStats extends Stats $sql = "SELECT date_format(p.dateadh,'%Y') as dm, count(*)"; $sql .= " FROM ".$this->from; - //if (!$user->rights->societe->client->voir && !$user->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + //if (empty($user->rights->societe->client->voir) && !$user->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql .= " WHERE ".$this->where; $sql .= " GROUP BY dm"; $sql .= $this->db->order('dm', 'DESC'); @@ -132,7 +132,7 @@ class AdherentStats extends Stats $sql = "SELECT date_format(p.dateadh,'%m') as dm, sum(p.".$this->field.")"; $sql .= " FROM ".$this->from; - //if (!$user->rights->societe->client->voir && !$user->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + //if (empty($user->rights->societe->client->voir) && !$user->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql .= " WHERE ".dolSqlDateFilter('p.dateadh', 0, 0, (int) $year, 1); $sql .= " AND ".$this->where; $sql .= " GROUP BY dm"; @@ -153,7 +153,7 @@ class AdherentStats extends Stats $sql = "SELECT date_format(p.dateadh,'%m') as dm, avg(p.".$this->field.")"; $sql .= " FROM ".$this->from; - //if (!$user->rights->societe->client->voir && !$this->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + //if (empty($user->rights->societe->client->voir) && !$this->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql .= " WHERE ".dolSqlDateFilter('p.dateadh', 0, 0, (int) $year, 1); $sql .= " AND ".$this->where; $sql .= " GROUP BY dm"; @@ -174,7 +174,7 @@ class AdherentStats extends Stats $sql = "SELECT date_format(p.dateadh,'%Y') as year, count(*) as nb, sum(".$this->field.") as total, avg(".$this->field.") as avg"; $sql .= " FROM ".$this->from; - //if (!$user->rights->societe->client->voir && !$this->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + //if (empty($user->rights->societe->client->voir) && !$this->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql .= " WHERE ".$this->where; $sql .= " GROUP BY year"; $sql .= $this->db->order('year', 'DESC'); diff --git a/htdocs/adherents/htpasswd.php b/htdocs/adherents/htpasswd.php index e1f580a3656..60639193295 100644 --- a/htdocs/adherents/htpasswd.php +++ b/htdocs/adherents/htpasswd.php @@ -36,7 +36,7 @@ $sortorder = GETPOST('sortorder', 'aZ09'); if (empty($conf->adherent->enabled)) { accessforbidden(); } -if (!$user->rights->adherent->export) { +if (empty($user->rights->adherent->export)) { accessforbidden(); } diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php index b0a6e40d3ca..df20ce37a86 100644 --- a/htdocs/adherents/subscription/card.php +++ b/htdocs/adherents/subscription/card.php @@ -48,7 +48,7 @@ $note = GETPOST('note', 'alpha'); $typeid = (int) GETPOST('typeid', 'int'); $amount = price2num(GETPOST('amount', 'alpha'), 'MT'); -if (!$user->rights->adherent->cotisation->lire) { +if (empty($user->rights->adherent->cotisation->lire)) { accessforbidden(); } diff --git a/htdocs/adherents/subscription/info.php b/htdocs/adherents/subscription/info.php index 080e2c0330c..9eb431320cd 100644 --- a/htdocs/adherents/subscription/info.php +++ b/htdocs/adherents/subscription/info.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php'; // Load translation files required by the page $langs->loadLangs(array("companies", "members", "bills", "users")); -if (!$user->rights->adherent->lire) { +if (empty($user->rights->adherent->lire)) { accessforbidden(); } diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 6d1b53cbca0..02617f7b52a 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1327,7 +1327,7 @@ class ActionComm extends CommonObject $sql = "SELECT count(a.id) as nb"; } $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc"; } if (!$user->rights->agenda->allactions->read) { @@ -1339,7 +1339,7 @@ class ActionComm extends CommonObject $sql .= " AND a.percent >= 0 AND a.percent < 100"; } $sql .= " AND a.entity IN (".getEntity('agenda').")"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".((int) $user->id).")"; } if ($user->socid) { diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 18b751a368c..eff302e699e 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -660,7 +660,7 @@ $sql .= ' a.fk_soc, a.fk_contact, a.fk_project,'; $sql .= ' a.fk_element, a.elementtype,'; $sql .= ' ca.code as type_code, ca.libelle as type_label, ca.color as type_color, ca.type as type_type, ca.picto as type_picto'; $sql .= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc"; } // We must filter on resource table @@ -711,7 +711,7 @@ if ($resourceid > 0) { if ($pid) { $sql .= " AND a.fk_project=".((int) $pid); } -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".((int) $user->id).")"; } if ($socid > 0) { diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index c7d28a1bcc7..7c70803300e 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -414,7 +414,7 @@ $sql .= $hookmanager->resPrint; $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."actioncomm_extrafields as ef ON (a.id = ef.fk_object)"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc"; } $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid"; @@ -468,7 +468,7 @@ if ($resourceid > 0) { if ($pid) { $sql .= " AND a.fk_project=".((int) $pid); } -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".((int) $user->id).")"; } if ($socid > 0) { diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index 08cef7dd80a..541a05a208f 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -506,7 +506,7 @@ $sql .= ' a.transparency, a.priority, a.fulldayevent, a.location,'; $sql .= ' a.fk_soc, a.fk_contact, a.fk_element, a.elementtype, a.fk_project,'; $sql .= ' ca.code, ca.libelle as type_label, ca.color, ca.type as type_type, ca.picto as type_picto'; $sql .= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc"; } // We must filter on resource table @@ -557,7 +557,7 @@ if ($resourceid > 0) { if ($pid) { $sql .= " AND a.fk_project=".((int) $pid); } -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".((int) $user->id).")"; } if ($socid > 0) { diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 18d75dba42b..c0f59a7f90b 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -533,7 +533,7 @@ $sql .= ' a.transparency, a.priority, a.fulldayevent, a.location,'; $sql .= ' a.fk_soc, a.fk_contact, a.fk_element, a.elementtype, a.fk_project,'; $sql .= ' ca.code, ca.libelle as type_label, ca.color, ca.type as type_type, ca.picto as type_picto'; $sql .= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc"; } // We must filter on resource table @@ -584,7 +584,7 @@ if ($resourceid > 0) { if ($pid) { $sql .= " AND a.fk_project = ".((int) $pid); } -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".((int) $user->id).")"; } if ($socid > 0) { diff --git a/htdocs/comm/contact.php b/htdocs/comm/contact.php index 52f6e675c5f..57a88bef157 100644 --- a/htdocs/comm/contact.php +++ b/htdocs/comm/contact.php @@ -82,14 +82,14 @@ if ($type == "f") { $sql = "SELECT s.rowid, s.nom as name, st.libelle as stcomm"; $sql .= ", p.rowid as cidp, p.name, p.firstname, p.email, p.phone"; $sql .= " FROM ".MAIN_DB_PREFIX."c_stcomm as st,"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " ".MAIN_DB_PREFIX."societe_commerciaux as sc,"; } $sql .= " ".MAIN_DB_PREFIX."socpeople as p"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = p.fk_soc"; $sql .= " WHERE s.fk_stcomm = st.id"; $sql .= " AND p.entity IN (".getEntity('socpeople').")"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($type == "c") { diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 2603b520c77..c3e4546fccd 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -129,13 +129,13 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) { $sql .= ", s.canvas"; $sql .= " FROM ".MAIN_DB_PREFIX."propal as p,"; $sql .= " ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE p.entity IN (".getEntity($propalstatic->element).")"; $sql .= " AND p.fk_soc = s.rowid"; $sql .= " AND p.fk_statut = ".Propal::STATUS_DRAFT; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { @@ -226,13 +226,13 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa $sql .= ", s.canvas"; $sql .= " FROM ".MAIN_DB_PREFIX."supplier_proposal as p,"; $sql .= " ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE p.entity IN (".getEntity($supplierproposalstatic->element).")"; $sql .= " AND p.fk_statut = ".SupplierProposal::STATUS_DRAFT; $sql .= " AND p.fk_soc = s.rowid"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { @@ -322,13 +322,13 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { $sql .= ", s.canvas"; $sql .= " FROM ".MAIN_DB_PREFIX."commande as c,"; $sql .= " ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE c.entity IN (".getEntity($orderstatic->element).")"; $sql .= " AND c.fk_statut = ".Commande::STATUS_DRAFT; $sql .= " AND c.fk_soc = s.rowid"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { @@ -419,13 +419,13 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU $sql .= ", s.canvas"; $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as cf,"; $sql .= " ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE cf.entity IN (".getEntity($supplierorderstatic->element).")"; $sql .= " AND cf.fk_statut = ".CommandeFournisseur::STATUS_DRAFT; $sql .= " AND cf.fk_soc = s.rowid"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { @@ -511,7 +511,7 @@ if (!empty($conf->ficheinter->enabled)) { $sql = "SELECT f.rowid, f.ref, s.nom as name, s.rowid as socid"; $sql .= " FROM ".MAIN_DB_PREFIX."fichinter as f"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE f.entity IN (".getEntity('intervention').")"; @@ -520,7 +520,7 @@ if (!empty($conf->ficheinter->enabled)) { if ($socid) { $sql .= " AND f.fk_soc = ".((int) $socid); } - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } @@ -561,12 +561,12 @@ if (!empty($conf->societe->enabled) && $user->rights->societe->lire) { $sql .= ", s.canvas"; $sql .= ", s.datec, s.tms"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE s.entity IN (".getEntity($companystatic->element).")"; $sql .= " AND s.client IN (".Societe::CUSTOMER.", ".Societe::PROSPECT.", ".Societe::CUSTOMER_AND_PROSPECT.")"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { @@ -657,12 +657,12 @@ if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_S $sql .= ", s.canvas"; $sql .= ", s.datec as dc, s.tms as dm"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE s.entity IN (".getEntity($companystatic->element).")"; $sql .= " AND s.fournisseur = ".Societe::SUPPLIER; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { @@ -762,13 +762,13 @@ if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) { // T $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= ", ".MAIN_DB_PREFIX."contrat as c"; $sql .= ", ".MAIN_DB_PREFIX."product as p"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE c.entity IN (".getEntity($staticcontrat->element).")"; $sql .= " AND c.fk_soc = s.rowid"; $sql .= " AND c.fk_product = p.rowid"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { @@ -837,13 +837,13 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) { $sql .= ", s.canvas"; $sql .= " FROM ".MAIN_DB_PREFIX."propal as p"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE p.entity IN (".getEntity($propalstatic->element).")"; $sql .= " AND p.fk_soc = s.rowid"; $sql .= " AND p.fk_statut = ".Propal::STATUS_VALIDATED; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { @@ -953,13 +953,13 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { $sql .= ", s.canvas"; $sql .= " FROM ".MAIN_DB_PREFIX."commande as c"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE c.entity IN (".getEntity($orderstatic->element).")"; $sql .= " AND c.fk_soc = s.rowid"; $sql .= " AND c.fk_statut IN (".Commande::STATUS_VALIDATED.", ".Commande::STATUS_SHIPMENTONPROCESS.")"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 6ae93695f8c..2f055f54a42 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -2779,17 +2779,17 @@ class Propal extends CommonObject $sql = "SELECT s.rowid, s.nom as name, s.client,"; $sql .= " p.rowid as propalid, p.fk_statut, p.total_ht, p.ref, p.remise, "; $sql .= " p.datep as dp, p.fin_validite as datelimite"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", sc.fk_soc, sc.fk_user"; } $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE p.entity IN (".getEntity('propal').")"; $sql .= " AND p.fk_soc = s.rowid"; $sql .= " AND p.fk_statut = c.id"; - if (!$user->rights->societe->client->voir && !$socid) { //restriction + if (empty($user->rights->societe->client->voir) && !$socid) { //restriction $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { @@ -3293,7 +3293,7 @@ class Propal extends CommonObject $sql = "SELECT p.rowid, p.ref, p.datec as datec, p.fin_validite as datefin, p.total_ht"; $sql .= " FROM ".MAIN_DB_PREFIX."propal as p"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON p.fk_soc = sc.fk_soc"; $sql .= " WHERE sc.fk_user = ".((int) $user->id); $clause = " AND"; @@ -3470,7 +3470,7 @@ class Propal extends CommonObject $sql = "SELECT count(p.rowid) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."propal as p"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON p.fk_soc = s.rowid"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; $sql .= " WHERE sc.fk_user = ".((int) $user->id); $clause = "AND"; diff --git a/htdocs/comm/propal/class/propalestats.class.php b/htdocs/comm/propal/class/propalestats.class.php index 181e5b545f8..2b8c5d9047d 100644 --- a/htdocs/comm/propal/class/propalestats.class.php +++ b/htdocs/comm/propal/class/propalestats.class.php @@ -93,7 +93,7 @@ class PropaleStats extends Stats } //$this->where.= " AND p.fk_soc = s.rowid AND p.entity = ".$conf->entity; $this->where .= ($this->where ? ' AND ' : '')."p.entity IN (".getEntity('propal').")"; - if (!$user->rights->societe->client->voir && !$this->socid) { + if (empty($user->rights->societe->client->voir) && !$this->socid) { $this->where .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($this->socid) { @@ -129,7 +129,7 @@ class PropaleStats extends Stats $sql = "SELECT date_format(".$this->field_date.",'%m') as dm, COUNT(*) as nb"; $sql .= " FROM ".$this->from; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= $this->join; @@ -154,7 +154,7 @@ class PropaleStats extends Stats $sql = "SELECT date_format(".$this->field_date.",'%Y') as dm, COUNT(*) as nb, SUM(c.".$this->field.")"; $sql .= " FROM ".$this->from; - if (!$user->rights->societe->client->voir && !$this->socid) { + if (empty($user->rights->societe->client->voir) && !$this->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= $this->join; @@ -178,7 +178,7 @@ class PropaleStats extends Stats $sql = "SELECT date_format(".$this->field_date.",'%m') as dm, SUM(p.".$this->field.")"; $sql .= " FROM ".$this->from; - if (!$user->rights->societe->client->voir && !$this->socid) { + if (empty($user->rights->societe->client->voir) && !$this->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= $this->join; @@ -203,7 +203,7 @@ class PropaleStats extends Stats $sql = "SELECT date_format(".$this->field_date.",'%m') as dm, AVG(p.".$this->field.")"; $sql .= " FROM ".$this->from; - if (!$user->rights->societe->client->voir && !$this->socid) { + if (empty($user->rights->societe->client->voir) && !$this->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= $this->join; @@ -226,7 +226,7 @@ class PropaleStats extends Stats $sql = "SELECT date_format(".$this->field_date.",'%Y') as year, COUNT(*) as nb, SUM(".$this->field.") as total, AVG(".$this->field.") as avg"; $sql .= " FROM ".$this->from; - if (!$user->rights->societe->client->voir && !$this->socid) { + if (empty($user->rights->societe->client->voir) && !$this->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= $this->join; @@ -252,7 +252,7 @@ class PropaleStats extends Stats $sql = "SELECT product.ref, COUNT(product.ref) as nb, SUM(tl.".$this->field_line.") as total, AVG(tl.".$this->field_line.") as avg"; $sql .= " FROM ".$this->from.", ".$this->from_line.", ".MAIN_DB_PREFIX."product as product"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= $this->join; diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index de2e4a1d64c..54e6541c7a9 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -81,13 +81,13 @@ if (!empty($conf->propal->enabled)) { $sql .= ", s.rowid as socid, s.nom as name, s.client, s.canvas, s.code_client, s.email, s.entity, s.code_compta"; $sql .= " FROM ".MAIN_DB_PREFIX."propal as p"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE p.entity IN (".getEntity($propalstatic->element).")"; $sql .= " AND p.fk_soc = s.rowid"; $sql .= " AND p.fk_statut =".Propal::STATUS_DRAFT; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { @@ -156,7 +156,7 @@ $sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, date_cloture as datec"; $sql .= ", s.nom as socname, s.rowid as socid, s.canvas, s.client, s.email, s.code_compta"; $sql .= " FROM ".MAIN_DB_PREFIX."propal as c"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE c.entity IN (".getEntity($propalstatic->element).")"; @@ -165,7 +165,7 @@ $sql .= " AND c.fk_soc = s.rowid"; if ($socid) { $sql .= " AND c.fk_soc = ".((int) $socid); } -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } $sql .= " ORDER BY c.tms DESC"; @@ -232,13 +232,13 @@ if (!empty($conf->propal->enabled) && $user->rights->propale->lire) { $sql .= ", p.rowid as propalid, p.entity, p.total_ttc, p.total_ht, p.ref, p.fk_statut, p.datep as dp, p.fin_validite as dfv"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= ", ".MAIN_DB_PREFIX."propal as p"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE p.fk_soc = s.rowid"; $sql .= " AND p.entity IN (".getEntity($propalstatic->element).")"; $sql .= " AND p.fk_statut = ".Propal::STATUS_VALIDATED; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { @@ -317,12 +317,12 @@ if (! empty($conf->propal->enabled)) $sql = "SELECT c.rowid, c.ref, c.fk_statut, s.nom as name, s.rowid as socid"; $sql.=" FROM ".MAIN_DB_PREFIX."propal as c"; $sql.= ", ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + if (empty($user->rights->societe->client->voir) && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE c.fk_soc = s.rowid"; $sql.= " AND c.entity = ".$conf->entity; $sql.= " AND c.fk_statut = 1"; if ($socid) $sql.= " AND c.fk_soc = ".((int) $socid); - if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .((int) $user->id); + if (empty($user->rights->societe->client->voir) && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .((int) $user->id); $sql.= " ORDER BY c.rowid DESC"; $resql=$db->query($sql); @@ -392,12 +392,12 @@ if (! empty($conf->propal->enabled)) $sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, s.nom as name, s.rowid as socid"; $sql.= " FROM ".MAIN_DB_PREFIX."commande as c"; $sql.= ", ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + if (empty($user->rights->societe->client->voir) && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE c.fk_soc = s.rowid"; $sql.= " AND c.entity = ".$conf->entity; $sql.= " AND c.fk_statut = 2 "; if ($socid) $sql.= " AND c.fk_soc = ".((int) $socid); - if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .((int) $user->id); + if (empty($user->rights->societe->client->voir) && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .((int) $user->id); $sql.= " ORDER BY c.rowid DESC"; $resql=$db->query($sql); diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 269cf9cfd91..3535ae0cde1 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -509,7 +509,7 @@ $sql .= ' p.note_public, p.note_private,'; $sql .= ' p.fk_cond_reglement,p.fk_mode_reglement,p.fk_shipping_method,p.fk_input_reason,'; $sql .= " pr.rowid as project_id, pr.ref as project_ref, pr.title as project_label,"; $sql .= ' u.login, u.lastname, u.firstname, u.email as user_email, u.statut as user_statut, u.entity as user_entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender'; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", sc.fk_soc, sc.fk_user"; } if (!empty($search_categ_cus) && $search_categ_cus != '-1') { @@ -547,7 +547,7 @@ $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as u ON p.fk_user_author = u.rowid'; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as pr ON pr.rowid = p.fk_projet"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_availability as ava on (ava.rowid = p.fk_availability)"; // We'll need this table joined to the select in order to filter by sale -if ($search_sale > 0 || (!$user->rights->societe->client->voir && !$socid)) { +if ($search_sale > 0 || (empty($user->rights->societe->client->voir) && !$socid)) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } if ($search_user > 0) { @@ -562,7 +562,7 @@ $sql .= $hookmanager->resPrint; $sql .= ' WHERE p.fk_soc = s.rowid'; $sql .= ' AND p.entity IN ('.getEntity('propal').')'; -if (!$user->rights->societe->client->voir && !$socid) { //restriction +if (empty($user->rights->societe->client->voir) && !$socid) { //restriction $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index c1975e309f5..fbdef4d91e6 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -111,7 +111,7 @@ $data = $stats->getNbByMonthWithPrevYear($endyear, $startyear); // $data = array(array('Lib',val1,val2,val3),...) -if (!$user->rights->societe->client->voir || $user->socid) { +if (empty($user->rights->societe->client->voir) || $user->socid) { $filenamenb = $dir.'/proposalsnbinyear-'.$user->id.'-'.$year.'.png'; $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=proposalsnbinyear-'.$user->id.'-'.$year.'.png'; } else { @@ -147,7 +147,7 @@ if (!$mesg) { $data = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, 0); // $data = array(array('Lib',val1,val2,val3),...) -if (!$user->rights->societe->client->voir || $user->socid) { +if (empty($user->rights->societe->client->voir) || $user->socid) { $filenameamount = $dir.'/proposalsamountinyear-'.$user->id.'-'.$year.'.png'; $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=proposalsamountinyear-'.$user->id.'-'.$year.'.png'; } else { @@ -182,7 +182,7 @@ if (!$mesg) { $data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear); $fileurl_avg = ''; -if (!$user->rights->societe->client->voir || $user->socid) { +if (empty($user->rights->societe->client->voir) || $user->socid) { $filename_avg = $dir.'/ordersaverage-'.$user->id.'-'.$year.'.png'; if ($mode == 'customer') { $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersaverage-'.$user->id.'-'.$year.'.png'; diff --git a/htdocs/comm/prospect/index.php b/htdocs/comm/prospect/index.php index d2f60c36212..24283c4e000 100644 --- a/htdocs/comm/prospect/index.php +++ b/htdocs/comm/prospect/index.php @@ -80,13 +80,13 @@ if (!empty($conf->propal->enabled)) { $sql = "SELECT count(*) as cc, st.libelle, st.picto, st.id"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= ", ".MAIN_DB_PREFIX."c_stcomm as st "; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE s.fk_stcomm = st.id"; $sql .= " AND s.client IN (2, 3)"; $sql .= " AND s.entity IN (".getEntity($companystatic->element).")"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } $sql .= " GROUP BY st.id"; @@ -122,13 +122,13 @@ if (!empty($conf->propal->enabled) && $user->rights->propale->lire) { $sql = "SELECT p.rowid, p.ref, p.price, s.nom as sname"; $sql .= " FROM ".MAIN_DB_PREFIX."propal as p"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE p.fk_statut = 0"; $sql .= " AND p.fk_soc = s.rowid"; $sql .= " AND p.entity IN (".getEntity('propal').")"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } @@ -183,14 +183,14 @@ if (!empty($conf->propal->enabled) && $user->rights->propale->lire) { $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= ", ".MAIN_DB_PREFIX."propal as p"; $sql .= ", ".MAIN_DB_PREFIX."c_propalst as c"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE p.fk_soc = s.rowid"; $sql .= " AND p.fk_statut = c.id"; $sql .= " AND p.fk_statut = 1"; $sql .= " AND p.entity IN (".getEntity('propal').")"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { @@ -244,12 +244,12 @@ if (!empty($conf->propal->enabled) && $user->rights->propale->lire) { */ $sql = "SELECT s.nom as name, s.rowid as socid, s.client, s.canvas"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE s.fk_stcomm = 1"; $sql .= " AND s.entity IN (".getEntity($companystatic->element).")"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } $sql .= " ORDER BY s.tms ASC"; diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index e3675129198..9b315698527 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -2678,16 +2678,16 @@ class Commande extends CommonOrder $sql = "SELECT s.rowid, s.nom as name, s.client,"; $sql .= " c.rowid as cid, c.ref"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", sc.fk_soc, sc.fk_user"; } $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE c.entity IN (".getEntity('commande').")"; $sql .= " AND c.fk_soc = s.rowid"; - if (!$user->rights->societe->client->voir && !$socid) { //restriction + if (empty($user->rights->societe->client->voir) && !$socid) { //restriction $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { @@ -3505,7 +3505,7 @@ class Commande extends CommonOrder $sql = "SELECT c.rowid, c.date_creation as datec, c.date_commande, c.date_livraison as delivery_date, c.fk_statut, c.total_ht"; $sql .= " FROM ".MAIN_DB_PREFIX."commande as c"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON c.fk_soc = sc.fk_soc"; $sql .= " WHERE sc.fk_user = ".((int) $user->id); $clause = " AND"; @@ -3915,7 +3915,7 @@ class Commande extends CommonOrder $sql = "SELECT count(co.rowid) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."commande as co"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON co.fk_soc = s.rowid"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; $sql .= " WHERE sc.fk_user = ".((int) $user->id); $clause = "AND"; diff --git a/htdocs/commande/class/commandestats.class.php b/htdocs/commande/class/commandestats.class.php index 8ac89d5a18f..d02d56175ff 100644 --- a/htdocs/commande/class/commandestats.class.php +++ b/htdocs/commande/class/commandestats.class.php @@ -93,7 +93,7 @@ class CommandeStats extends Stats //$this->where.= " AND c.fk_soc = s.rowid AND c.entity = ".$conf->entity; $this->where .= ($this->where ? ' AND ' : '').'c.entity IN ('.getEntity('commande').')'; - if (!$user->rights->societe->client->voir && !$this->socid) { + if (empty($user->rights->societe->client->voir) && !$this->socid) { $this->where .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($this->socid) { @@ -128,7 +128,7 @@ class CommandeStats extends Stats $sql = "SELECT date_format(c.date_commande,'%m') as dm, COUNT(*) as nb"; $sql .= " FROM ".$this->from; - if (!$user->rights->societe->client->voir && !$this->socid) { + if (empty($user->rights->societe->client->voir) && !$this->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= $this->join; @@ -153,7 +153,7 @@ class CommandeStats extends Stats $sql = "SELECT date_format(c.date_commande,'%Y') as dm, COUNT(*) as nb, SUM(c.".$this->field.")"; $sql .= " FROM ".$this->from; - if (!$user->rights->societe->client->voir && !$this->socid) { + if (empty($user->rights->societe->client->voir) && !$this->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= $this->join; @@ -177,7 +177,7 @@ class CommandeStats extends Stats $sql = "SELECT date_format(c.date_commande,'%m') as dm, SUM(c.".$this->field.")"; $sql .= " FROM ".$this->from; - if (!$user->rights->societe->client->voir && !$this->socid) { + if (empty($user->rights->societe->client->voir) && !$this->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= $this->join; @@ -202,7 +202,7 @@ class CommandeStats extends Stats $sql = "SELECT date_format(c.date_commande,'%m') as dm, AVG(c.".$this->field.")"; $sql .= " FROM ".$this->from; - if (!$user->rights->societe->client->voir && !$this->socid) { + if (empty($user->rights->societe->client->voir) && !$this->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= $this->join; @@ -225,7 +225,7 @@ class CommandeStats extends Stats $sql = "SELECT date_format(c.date_commande,'%Y') as year, COUNT(*) as nb, SUM(c.".$this->field.") as total, AVG(".$this->field.") as avg"; $sql .= " FROM ".$this->from; - if (!$user->rights->societe->client->voir && !$this->socid) { + if (empty($user->rights->societe->client->voir) && !$this->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= $this->join; @@ -249,7 +249,7 @@ class CommandeStats extends Stats $sql = "SELECT product.ref, COUNT(product.ref) as nb, SUM(tl.".$this->field_line.") as total, AVG(tl.".$this->field_line.") as avg"; $sql .= " FROM ".$this->from.", ".$this->from_line.", ".MAIN_DB_PREFIX."product as product"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= $this->join; diff --git a/htdocs/commande/customer.php b/htdocs/commande/customer.php index 3ecaa0fbee1..96efda7c187 100644 --- a/htdocs/commande/customer.php +++ b/htdocs/commande/customer.php @@ -77,16 +77,16 @@ $thirdpartystatic = new Societe($db); $sql = "SELECT s.rowid, s.nom as name, s.client, s.town, s.datec, s.datea"; $sql .= ", st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta "; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", sc.fk_soc, sc.fk_user "; } $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."c_stcomm as st, ".MAIN_DB_PREFIX."commande as c"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE s.fk_stcomm = st.id AND c.fk_soc = s.rowid"; $sql .= " AND s.entity IN (".getEntity('societe').")"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if (GETPOST("search_nom")) { diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index a794d79e743..8c59be3a2cb 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -94,7 +94,7 @@ if (!empty($conf->commande->enabled)) { $sql .= ", s.canvas"; $sql .= " FROM ".MAIN_DB_PREFIX."commande as c"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE c.fk_soc = s.rowid"; @@ -103,7 +103,7 @@ if (!empty($conf->commande->enabled)) { if ($socid) { $sql .= " AND c.fk_soc = ".((int) $socid); } - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } @@ -162,7 +162,7 @@ $sql .= ", s.code_client"; $sql .= ", s.canvas"; $sql .= " FROM ".MAIN_DB_PREFIX."commande as c,"; $sql .= " ".MAIN_DB_PREFIX."societe as s"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE c.fk_soc = s.rowid"; @@ -171,7 +171,7 @@ $sql .= " AND c.entity IN (".getEntity('commande').")"; if ($socid) { $sql .= " AND c.fk_soc = ".((int) $socid); } -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } $sql .= " ORDER BY c.tms DESC"; @@ -246,7 +246,7 @@ if (!empty($conf->commande->enabled)) { $sql .= ", s.canvas"; $sql .= " FROM ".MAIN_DB_PREFIX."commande as c"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE c.fk_soc = s.rowid"; @@ -255,7 +255,7 @@ if (!empty($conf->commande->enabled)) { if ($socid) { $sql .= " AND c.fk_soc = ".((int) $socid); } - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } $sql .= " ORDER BY c.rowid DESC"; @@ -335,7 +335,7 @@ if (!empty($conf->commande->enabled)) { $sql .= ", s.canvas"; $sql .= " FROM ".MAIN_DB_PREFIX."commande as c"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE c.fk_soc = s.rowid"; @@ -344,7 +344,7 @@ if (!empty($conf->commande->enabled)) { if ($socid) { $sql .= " AND c.fk_soc = ".((int) $socid); } - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } $sql .= " ORDER BY c.rowid DESC"; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 4e8a18821ff..503c125b59c 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -465,7 +465,7 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = c.fk_projet"; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as u ON c.fk_user_author = u.rowid'; // We'll need this table joined to the select in order to filter by sale -if ($search_sale > 0 || (!$user->rights->societe->client->voir && !$socid)) { +if ($search_sale > 0 || (empty($user->rights->societe->client->voir) && !$socid)) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } if ($search_user > 0) { @@ -486,7 +486,7 @@ if ($search_product_category > 0) { if ($socid > 0) { $sql .= ' AND s.rowid = '.((int) $socid); } -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($search_ref) { diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index a9c38e1531c..377782d9f1f 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -112,7 +112,7 @@ $data = $stats->getNbByMonthWithPrevYear($endyear, $startyear); // $data = array(array('Lib',val1,val2,val3),...) -if (!$user->rights->societe->client->voir || $user->socid) { +if (empty($user->rights->societe->client->voir) || $user->socid) { $filenamenb = $dir.'/ordersnbinyear-'.$user->id.'-'.$year.'.png'; if ($mode == 'customer') { $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersnbinyear-'.$user->id.'-'.$year.'.png'; @@ -158,7 +158,7 @@ $data = $stats->getAmountByMonthWithPrevYear($endyear, $startyear); //var_dump($data); // $data = array(array('Lib',val1,val2,val3),...) -if (!$user->rights->societe->client->voir || $user->socid) { +if (empty($user->rights->societe->client->voir) || $user->socid) { $filenameamount = $dir.'/ordersamountinyear-'.$user->id.'-'.$year.'.png'; if ($mode == 'customer') { $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersamountinyear-'.$user->id.'-'.$year.'.png'; @@ -202,7 +202,7 @@ if (!$mesg) { $data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear); -if (!$user->rights->societe->client->voir || $user->socid) { +if (empty($user->rights->societe->client->voir) || $user->socid) { $filename_avg = $dir.'/ordersaverage-'.$user->id.'-'.$year.'.png'; if ($mode == 'customer') { $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersaverage-'.$user->id.'-'.$year.'.png'; diff --git a/htdocs/compta/clients.php b/htdocs/compta/clients.php index 504e5638abc..b39364690a6 100644 --- a/htdocs/compta/clients.php +++ b/htdocs/compta/clients.php @@ -94,16 +94,16 @@ if ($mode == 'search') { $sql = "SELECT s.rowid, s.nom as name, s.client, s.town, s.datec, s.datea"; $sql .= ", st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta "; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", sc.fk_soc, sc.fk_user "; } $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."c_stcomm as st"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE s.fk_stcomm = st.id AND s.client in (1, 3)"; $sql .= " AND s.entity IN (".getEntity('societe').")"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if (dol_strlen($stcomm)) { diff --git a/htdocs/compta/deplacement/index.php b/htdocs/compta/deplacement/index.php index 12351032b53..f2eb5bfe969 100644 --- a/htdocs/compta/deplacement/index.php +++ b/htdocs/compta/deplacement/index.php @@ -150,7 +150,7 @@ $langs->load("boxes"); $sql = "SELECT u.rowid as uid, u.lastname, u.firstname, d.rowid, d.dated as date, d.tms as dm, d.km, d.fk_statut"; $sql .= " FROM ".MAIN_DB_PREFIX."deplacement as d, ".MAIN_DB_PREFIX."user as u"; -if (!$user->rights->societe->client->voir && !$user->socid) { +if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE u.rowid = d.fk_user"; @@ -158,7 +158,7 @@ $sql .= " AND d.entity = ".$conf->entity; if (empty($user->rights->deplacement->readall) && empty($user->rights->deplacement->lire_tous)) { $sql .= ' AND d.fk_user IN ('.$db->sanitize(join(',', $childids)).')'; } -if (!$user->rights->societe->client->voir && !$user->socid) { +if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " AND d.fk_soc = s. rowid AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { diff --git a/htdocs/compta/deplacement/list.php b/htdocs/compta/deplacement/list.php index 428eacbc93a..e7593406ad6 100644 --- a/htdocs/compta/deplacement/list.php +++ b/htdocs/compta/deplacement/list.php @@ -96,7 +96,7 @@ $sql .= " u.lastname, u.firstname"; // Qui $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; $sql .= ", ".MAIN_DB_PREFIX."deplacement as d"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON d.fk_soc = s.rowid"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; } $sql .= " WHERE d.fk_user = u.rowid"; @@ -104,7 +104,7 @@ $sql .= " AND d.entity = ".$conf->entity; if (empty($user->rights->deplacement->readall) && empty($user->rights->deplacement->lire_tous)) { $sql .= ' AND d.fk_user IN ('.$db->sanitize(join(',', $childids)).')'; } -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND (sc.fk_user = ".((int) $user->id)." OR d.fk_soc IS NULL) "; } if ($socid) { diff --git a/htdocs/compta/deplacement/stats/index.php b/htdocs/compta/deplacement/stats/index.php index edc590119ef..3acda4f76ce 100644 --- a/htdocs/compta/deplacement/stats/index.php +++ b/htdocs/compta/deplacement/stats/index.php @@ -163,7 +163,7 @@ if (!$mesg) { $data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear); -if (!$user->rights->societe->client->voir || $user->socid) { +if (empty($user->rights->societe->client->voir) || $user->socid) { $filename_avg = $dir.'/ordersaverage-'.$user->id.'-'.$year.'.png'; if ($mode == 'customer') { $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersaverage-'.$user->id.'-'.$year.'.png'; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 4b49c88f8ca..90641062b40 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -4055,16 +4055,16 @@ class Facture extends CommonInvoice $sql = "SELECT s.rowid, s.nom as name, s.client,"; $sql .= " f.rowid as fid, f.ref as ref, f.datef as df"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", sc.fk_soc, sc.fk_user"; } $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as f"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE f.entity IN (".getEntity('invoice').")"; $sql .= " AND f.fk_soc = s.rowid"; - if (!$user->rights->societe->client->voir && !$socid) { //restriction + if (empty($user->rights->societe->client->voir) && !$socid) { //restriction $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { @@ -4254,7 +4254,7 @@ class Facture extends CommonInvoice $sql = "SELECT f.rowid, f.date_lim_reglement as datefin,f.fk_statut, f.total_ht"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON f.fk_soc = sc.fk_soc"; $sql .= " WHERE sc.fk_user = ".((int) $user->id); $clause = " AND"; @@ -4501,7 +4501,7 @@ class Facture extends CommonInvoice $sql = "SELECT count(f.rowid) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON f.fk_soc = s.rowid"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; $sql .= " WHERE sc.fk_user = ".((int) $user->id); $clause = "AND"; diff --git a/htdocs/compta/facture/class/facturestats.class.php b/htdocs/compta/facture/class/facturestats.class.php index 1e6457104ea..a54cd1a6668 100644 --- a/htdocs/compta/facture/class/facturestats.class.php +++ b/htdocs/compta/facture/class/facturestats.class.php @@ -85,7 +85,7 @@ class FactureStats extends Stats $this->where = " f.fk_statut >= 0"; $this->where .= " AND f.entity IN (".getEntity('invoice').")"; - if (!$user->rights->societe->client->voir && !$this->socid) { + if (empty($user->rights->societe->client->voir) && !$this->socid) { $this->where .= " AND f.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($mode == 'customer') { @@ -129,7 +129,7 @@ class FactureStats extends Stats $sql = "SELECT date_format(f.datef,'%m') as dm, COUNT(*) as nb"; $sql .= " FROM ".$this->from; - if (!$user->rights->societe->client->voir && !$this->socid) { + if (empty($user->rights->societe->client->voir) && !$this->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= $this->join; @@ -155,7 +155,7 @@ class FactureStats extends Stats $sql = "SELECT date_format(f.datef,'%Y') as dm, COUNT(*), SUM(c.".$this->field.")"; $sql .= " FROM ".$this->from; - if (!$user->rights->societe->client->voir && !$this->socid) { + if (empty($user->rights->societe->client->voir) && !$this->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= $this->join; @@ -180,7 +180,7 @@ class FactureStats extends Stats $sql = "SELECT date_format(datef,'%m') as dm, SUM(f.".$this->field.")"; $sql .= " FROM ".$this->from; - if (!$user->rights->societe->client->voir && !$this->socid) { + if (empty($user->rights->societe->client->voir) && !$this->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= $this->join; @@ -206,7 +206,7 @@ class FactureStats extends Stats $sql = "SELECT date_format(datef,'%m') as dm, AVG(f.".$this->field.")"; $sql .= " FROM ".$this->from; - if (!$user->rights->societe->client->voir && !$this->socid) { + if (empty($user->rights->societe->client->voir) && !$this->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= $this->join; @@ -229,7 +229,7 @@ class FactureStats extends Stats $sql = "SELECT date_format(datef,'%Y') as year, COUNT(*) as nb, SUM(f.".$this->field.") as total, AVG(f.".$this->field.") as avg"; $sql .= " FROM ".$this->from; - if (!$user->rights->societe->client->voir && !$this->socid) { + if (empty($user->rights->societe->client->voir) && !$this->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= $this->join; @@ -253,7 +253,7 @@ class FactureStats extends Stats $sql = "SELECT product.ref, COUNT(product.ref) as nb, SUM(tl.".$this->field_line.") as total, AVG(tl.".$this->field_line.") as avg"; $sql .= " FROM ".$this->from.", ".$this->from_line.", ".MAIN_DB_PREFIX."product as product"; - if (!$user->rights->societe->client->voir && !$this->socid) { + if (empty($user->rights->societe->client->voir) && !$this->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= $this->join; @@ -281,7 +281,7 @@ class FactureStats extends Stats $startYear = $endYear - $numberYears; $sql = "SELECT date_format(datef,'%Y') as dm, SUM(f.".$this->field.")"; $sql .= " FROM ".$this->from; - if (!$user->rights->societe->client->voir && !$this->socid) { + if (empty($user->rights->societe->client->voir) && !$this->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= $this->join; diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index e5c7fdafd0c..12f554f4c5c 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -291,12 +291,12 @@ $sql = preg_replace('/,\s*$/', '', $sql); $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_rec as f"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture_rec_extrafields as ef ON ef.fk_object = f.rowid"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE f.fk_soc = s.rowid"; $sql .= ' AND f.entity IN ('.getEntity('invoice').')'; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($search_ref) { diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 852589dbd1a..2be624bf4d6 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -592,7 +592,7 @@ if ($search_product_category > 0) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = f.fk_projet"; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user AS u ON f.fk_user_author = u.rowid'; // We'll need this table joined to the select in order to filter by sale -if ($search_sale > 0 || (!$user->rights->societe->client->voir && !$socid)) { +if ($search_sale > 0 || (empty($user->rights->societe->client->voir) && !$socid)) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } if ($search_user > 0) { @@ -606,7 +606,7 @@ $sql .= $hookmanager->resPrint; $sql .= ' WHERE f.fk_soc = s.rowid'; $sql .= ' AND f.entity IN ('.getEntity('invoice').')'; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($search_product_category > 0) { diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index a8228e29d2a..3c8e093cdc5 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -192,7 +192,7 @@ if (!$mesg) { $data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear); -if (!$user->rights->societe->client->voir || $user->socid) { +if (empty($user->rights->societe->client->voir) || $user->socid) { $filename_avg = $dir.'/ordersaverage-'.$user->id.'-'.$year.'.png'; if ($mode == 'customer') { $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersaverage-'.$user->id.'-'.$year.'.png'; diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 7f3865906c8..29f41587224 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -129,12 +129,12 @@ if (!empty($conf->facture->enabled) && !empty($user->rights->facture->lire)) { $sql .= ", sum(pf.amount) as am"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s LEFT JOIN ".MAIN_DB_PREFIX."c_country as cc ON cc.rowid = s.fk_pays, ".MAIN_DB_PREFIX."facture as f"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf on f.rowid=pf.fk_facture"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE s.rowid = f.fk_soc"; $sql .= " AND f.entity IN (".getEntity('invoice').")"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { @@ -279,12 +279,12 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU $sql .= ", SUM(pf.amount) as am"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as ff"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf on ff.rowid=pf.fk_facturefourn"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE s.rowid = ff.fk_soc"; $sql .= " AND ff.entity = ".$conf->entity; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { @@ -589,7 +589,7 @@ if (!empty($conf->facture->enabled) && !empty($conf->commande->enabled) && $user $sql .= ", c.rowid, c.ref, c.facture, c.fk_statut as status, c.total_ht, c.total_tva, c.total_ttc,"; $sql .= " cc.rowid as country_id, cc.code as country_code"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s LEFT JOIN ".MAIN_DB_PREFIX."c_country as cc ON cc.rowid = s.fk_pays"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= ", ".MAIN_DB_PREFIX."commande as c"; @@ -597,7 +597,7 @@ if (!empty($conf->facture->enabled) && !empty($conf->commande->enabled) && $user $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture AS f ON el.fk_target = f.rowid AND el.targettype = 'facture'"; $sql .= " WHERE c.fk_soc = s.rowid"; $sql .= " AND c.entity = ".$conf->entity; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index 59aae0a4015..f5160c51757 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -201,11 +201,11 @@ if (GETPOST("orphelins", "alpha")) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON p.rowid = pf.fk_paiement"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON pf.fk_facture = f.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON f.fk_soc = s.rowid"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; } $sql .= " WHERE p.entity IN (".getEntity('invoice').")"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND sc.fk_user = ".((int) $user->id); } if ($socid > 0) { diff --git a/htdocs/compta/paiement/rapport.php b/htdocs/compta/paiement/rapport.php index 492404a9380..cf02c2aeb74 100644 --- a/htdocs/compta/paiement/rapport.php +++ b/htdocs/compta/paiement/rapport.php @@ -39,7 +39,7 @@ if ($user->socid > 0) { } $dir = $conf->facture->dir_output.'/payments'; -if (!$user->rights->societe->client->voir || $socid) { +if (empty($user->rights->societe->client->voir) || $socid) { $dir .= '/private/'.$user->id; // If user has no permission to see all, output dir is specific to user } diff --git a/htdocs/compta/paymentbybanktransfer/index.php b/htdocs/compta/paymentbybanktransfer/index.php index 009f99fccf1..2036bef5c57 100644 --- a/htdocs/compta/paymentbybanktransfer/index.php +++ b/htdocs/compta/paymentbybanktransfer/index.php @@ -98,7 +98,7 @@ $sql .= " pfd.date_demande, pfd.amount,"; $sql .= " s.nom as name, s.email, s.rowid as socid, s.tva_intra"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f,"; $sql .= " ".MAIN_DB_PREFIX."societe as s"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= ", ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; @@ -111,7 +111,7 @@ if (empty($conf->global->WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS)) { $sql .= " AND pfd.traite = 0"; $sql .= " AND pfd.ext_payment_id IS NULL"; $sql .= " AND pfd.fk_facture_fourn = f.rowid"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index cb10e9248f1..5ac0c07ede7 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -137,12 +137,12 @@ if ($type != 'bank-transfer') { } $sql .= " ".MAIN_DB_PREFIX."societe as s,"; $sql .= " ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE s.rowid = f.fk_soc"; $sql .= " AND f.entity IN (".getEntity('invoice').")"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { diff --git a/htdocs/compta/prelevement/index.php b/htdocs/compta/prelevement/index.php index 93f2305c60f..e299c067118 100644 --- a/htdocs/compta/prelevement/index.php +++ b/htdocs/compta/prelevement/index.php @@ -98,7 +98,7 @@ $sql .= " pfd.date_demande, pfd.amount,"; $sql .= " s.nom as name, s.email, s.rowid as socid"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f,"; $sql .= " ".MAIN_DB_PREFIX."societe as s"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " , ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; @@ -111,7 +111,7 @@ if (empty($conf->global->WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS)) { $sql .= " AND pfd.traite = 0"; $sql .= " AND pfd.ext_payment_id IS NULL"; $sql .= " AND pfd.fk_facture = f.rowid"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 5dec2ade61e..fa1dfb93c7a 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -383,7 +383,7 @@ class Contact extends CommonObject $sql = "SELECT count(sp.rowid) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe as s"; $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql .= " WHERE sp.fk_soc = s.rowid AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 71e888540b2..e005d6cfb1e 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -386,11 +386,11 @@ if (!empty($search_categ_thirdparty) && $search_categ_thirdparty != '-1') { if (!empty($search_categ_supplier) && $search_categ_supplier != '-1') { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_fournisseur as cs2 ON s.rowid = cs2.fk_soc"; // We need this table joined to the select in order to filter by categ } -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; } $sql .= ' WHERE p.entity IN ('.getEntity('socpeople').')'; -if (!$user->rights->societe->client->voir && !$socid) { //restriction +if (empty($user->rights->societe->client->voir) && !$socid) { //restriction $sql .= " AND (sc.fk_user = ".((int) $user->id)." OR p.fk_soc IS NULL)"; } if (!empty($userid)) { // propre au commercial diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index a23a620359e..29a67d52dd7 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -2187,7 +2187,7 @@ class Contrat extends CommonObject $this->from = " FROM ".MAIN_DB_PREFIX."contrat as c"; $this->from .= ", ".MAIN_DB_PREFIX."contratdet as cd"; $this->from .= ", ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $this->from .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } @@ -2218,7 +2218,7 @@ class Contrat extends CommonObject if ($user->socid) { $sql .= " AND c.fk_soc = ".((int) $user->socid); } - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } @@ -2286,7 +2286,7 @@ class Contrat extends CommonObject $sql = "SELECT count(c.rowid) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."contrat as c"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON c.fk_soc = s.rowid"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; $sql .= " WHERE sc.fk_user = ".((int) $user->id); $clause = "AND"; diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index b85cda094f3..626d81892b1 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -92,7 +92,7 @@ $vals = array(); $sql = "SELECT count(cd.rowid) as nb, cd.statut as status"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= ", ".MAIN_DB_PREFIX."contratdet as cd, ".MAIN_DB_PREFIX."contrat as c"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE cd.fk_contrat = c.rowid AND c.fk_soc = s.rowid"; @@ -101,7 +101,7 @@ $sql .= " AND c.entity IN (".getEntity('contract', 0).")"; if ($user->socid) { $sql .= ' AND c.fk_soc = '.((int) $user->socid); } -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } $sql .= " GROUP BY cd.statut"; @@ -129,7 +129,7 @@ if ($resql) { $sql = "SELECT count(cd.rowid) as nb, cd.statut as status"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= ", ".MAIN_DB_PREFIX."contratdet as cd, ".MAIN_DB_PREFIX."contrat as c"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE cd.fk_contrat = c.rowid AND c.fk_soc = s.rowid"; @@ -138,7 +138,7 @@ $sql .= " AND c.entity IN (".getEntity('contract', 0).")"; if ($user->socid) { $sql .= ' AND c.fk_soc = '.((int) $user->socid); } -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } $sql .= " GROUP BY cd.statut"; @@ -240,13 +240,13 @@ if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) { $sql = "SELECT c.rowid, c.ref,"; $sql .= " s.nom as name, s.rowid as socid"; $sql .= " FROM ".MAIN_DB_PREFIX."contrat as c, ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE s.rowid = c.fk_soc"; $sql .= " AND c.entity IN (".getEntity('contract', 0).")"; $sql .= " AND c.statut = 0"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { @@ -311,7 +311,7 @@ $sql .= " sum(".$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AN $sql .= " sum(".$db->ifsql("cd.statut=5", 1, 0).') as nb_closed,'; $sql .= " c.rowid as cid, c.ref, c.datec, c.tms, c.statut, s.nom as name, s.rowid as socid"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s,"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " ".MAIN_DB_PREFIX."societe_commerciaux as sc,"; } $sql .= " ".MAIN_DB_PREFIX."contrat as c"; @@ -319,7 +319,7 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."contratdet as cd ON c.rowid = cd.fk_contra $sql .= " WHERE c.fk_soc = s.rowid"; $sql .= " AND c.entity IN (".getEntity('contract', 0).")"; $sql .= " AND c.statut > 0"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { @@ -386,7 +386,7 @@ $sql .= " s.nom as name,"; $sql .= " p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype, p.entity as pentity"; $sql .= " FROM (".MAIN_DB_PREFIX."contrat as c"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= ", ".MAIN_DB_PREFIX."contratdet as cd"; @@ -394,7 +394,7 @@ $sql .= ") LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid"; $sql .= " WHERE c.entity IN (".getEntity('contract', 0).")"; $sql .= " AND cd.fk_contrat = c.rowid"; $sql .= " AND c.fk_soc = s.rowid"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { @@ -466,7 +466,7 @@ $sql .= " s.nom as name,"; $sql .= " p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype, p.entity as pentity"; $sql .= " FROM (".MAIN_DB_PREFIX."contrat as c"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= ", ".MAIN_DB_PREFIX."contratdet as cd"; @@ -476,7 +476,7 @@ $sql .= " AND c.statut = 1"; $sql .= " AND cd.statut = 0"; $sql .= " AND cd.fk_contrat = c.rowid"; $sql .= " AND c.fk_soc = s.rowid"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { @@ -547,7 +547,7 @@ $sql .= " s.nom as name,"; $sql .= " p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype, p.entity as pentity"; $sql .= " FROM (".MAIN_DB_PREFIX."contrat as c"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= ", ".MAIN_DB_PREFIX."contratdet as cd"; @@ -558,7 +558,7 @@ $sql .= " AND cd.statut = 4"; $sql .= " AND cd.date_fin_validite < '".$db->idate($now)."'"; $sql .= " AND cd.fk_contrat = c.rowid"; $sql .= " AND c.fk_soc = s.rowid"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 7e19ec13e22..cee0faf95aa 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -255,7 +255,7 @@ $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)"; -if ($search_sale > 0 || (!$user->rights->societe->client->voir && !$socid)) { +if ($search_sale > 0 || (empty($user->rights->societe->client->voir) && !$socid)) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= ", ".MAIN_DB_PREFIX."contrat as c"; @@ -281,7 +281,7 @@ if ($search_product_category > 0) { if ($socid) { $sql .= " AND s.rowid = ".((int) $socid); } -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($search_date_start) { diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index 0c06a194fd4..5bd98ded8c4 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -218,7 +218,7 @@ $sql = "SELECT c.rowid as cid, c.ref, c.statut as cstatut, c.ref_customer, c.ref $sql .= " s.rowid as socid, s.nom as name, s.email, s.client, s.fournisseur,"; $sql .= " cd.rowid, cd.description, cd.statut,"; $sql .= " p.rowid as pid, p.ref as pref, p.label as label, p.fk_product_type as ptype, p.entity as pentity,"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " sc.fk_soc, sc.fk_user,"; } $sql .= " cd.date_ouverture_prevue,"; @@ -244,7 +244,7 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // N $sql .= $hookmanager->resPrint; $sql .= " FROM ".MAIN_DB_PREFIX."contrat as c,"; $sql .= " ".MAIN_DB_PREFIX."societe as s,"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " ".MAIN_DB_PREFIX."societe_commerciaux as sc,"; } $sql .= " ".MAIN_DB_PREFIX."contratdet as cd"; @@ -261,7 +261,7 @@ if ($search_product_category > 0) { $sql .= " AND cp.fk_categorie = ".((int) $search_product_category); } $sql .= " AND c.fk_soc = s.rowid"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($mode == "0") { diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php index 814dfacc5f3..691e0ac1bc3 100644 --- a/htdocs/core/boxes/box_actions.php +++ b/htdocs/core/boxes/box_actions.php @@ -92,14 +92,14 @@ class box_actions extends ModeleBoxes $sql .= ", s.code_client, s.code_compta, s.client"; $sql .= ", s.logo, s.email, s.entity"; $sql .= " FROM ".MAIN_DB_PREFIX."c_actioncomm AS ta, ".MAIN_DB_PREFIX."actioncomm AS a"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc"; } $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid"; $sql .= " WHERE a.fk_action = ta.id"; $sql .= " AND a.entity IN (".getEntity('actioncomm').")"; $sql .= " AND a.percent >= 0 AND a.percent < 100"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".((int) $user->id).")"; } if ($user->socid) { diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index a858111d76d..487c2170a4a 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -113,13 +113,13 @@ class box_activity extends ModeleBoxes if ($refresh) { $sql = "SELECT p.fk_statut, SUM(p.total_ttc) as Mnttot, COUNT(*) as nb"; $sql .= " FROM (".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= ")"; $sql .= " WHERE p.entity IN (".getEntity('propal').")"; $sql .= " AND p.fk_soc = s.rowid"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($user->socid) { @@ -203,13 +203,13 @@ class box_activity extends ModeleBoxes if ($refresh) { $sql = "SELECT c.fk_statut, sum(c.total_ttc) as Mnttot, count(*) as nb"; $sql .= " FROM (".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= ")"; $sql .= " WHERE c.entity IN (".getEntity('commande').")"; $sql .= " AND c.fk_soc = s.rowid"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($user->socid) { @@ -291,12 +291,12 @@ class box_activity extends ModeleBoxes if ($refresh) { $sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb"; $sql .= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= ")"; $sql .= " WHERE f.entity IN (".getEntity('invoice').')'; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($user->socid) { diff --git a/htdocs/core/boxes/box_clients.php b/htdocs/core/boxes/box_clients.php index 995f017f5f1..74ba5a9d4c9 100644 --- a/htdocs/core/boxes/box_clients.php +++ b/htdocs/core/boxes/box_clients.php @@ -92,12 +92,12 @@ class box_clients extends ModeleBoxes $sql .= ", s.logo, s.email, s.entity"; $sql .= ", s.datec, s.tms, s.status"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE s.client IN (1, 3)"; $sql .= " AND s.entity IN (".getEntity('societe').")"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($user->socid) { diff --git a/htdocs/core/boxes/box_commandes.php b/htdocs/core/boxes/box_commandes.php index 4d47f703fff..abf9baf06f3 100644 --- a/htdocs/core/boxes/box_commandes.php +++ b/htdocs/core/boxes/box_commandes.php @@ -101,7 +101,7 @@ class box_commandes extends ModeleBoxes $sql .= ", c.total_ttc"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= ", ".MAIN_DB_PREFIX."commande as c"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE c.fk_soc = s.rowid"; @@ -109,7 +109,7 @@ class box_commandes extends ModeleBoxes if (!empty($conf->global->ORDER_BOX_LAST_ORDERS_VALIDATED_ONLY)) { $sql .= " AND c.fk_statut = 1"; } - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($user->socid) { diff --git a/htdocs/core/boxes/box_contacts.php b/htdocs/core/boxes/box_contacts.php index 97090895500..0d774faf569 100644 --- a/htdocs/core/boxes/box_contacts.php +++ b/htdocs/core/boxes/box_contacts.php @@ -103,11 +103,11 @@ class box_contacts extends ModeleBoxes if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity); } - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE sp.entity IN (".getEntity('socpeople').")"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($user->socid) { diff --git a/htdocs/core/boxes/box_contracts.php b/htdocs/core/boxes/box_contracts.php index 9bb794b94fa..8eeb1b93323 100644 --- a/htdocs/core/boxes/box_contracts.php +++ b/htdocs/core/boxes/box_contracts.php @@ -86,12 +86,12 @@ class box_contracts extends ModeleBoxes $sql .= " c.rowid, c.ref, c.statut as fk_statut, c.date_contrat, c.datec, c.fin_validite, c.date_cloture"; $sql .= ", c.ref_customer, c.ref_supplier"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE c.fk_soc = s.rowid"; $sql .= " AND c.entity = ".$conf->entity; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($user->socid) { diff --git a/htdocs/core/boxes/box_customers_outstanding_bill_reached.php b/htdocs/core/boxes/box_customers_outstanding_bill_reached.php index 87be4a10c2d..4077b04c6d9 100644 --- a/htdocs/core/boxes/box_customers_outstanding_bill_reached.php +++ b/htdocs/core/boxes/box_customers_outstanding_bill_reached.php @@ -93,12 +93,12 @@ class box_customers_outstanding_bill_reached extends ModeleBoxes $sql .= ", s.outstanding_limit"; $sql .= ", s.datec, s.tms, s.status"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE s.client IN (1, 3)"; $sql .= " AND s.entity IN (".getEntity('societe').")"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($user->socid) { diff --git a/htdocs/core/boxes/box_factures.php b/htdocs/core/boxes/box_factures.php index 6bdeabda212..e1d2860b212 100644 --- a/htdocs/core/boxes/box_factures.php +++ b/htdocs/core/boxes/box_factures.php @@ -100,13 +100,13 @@ class box_factures extends ModeleBoxes $sql .= ", s.logo, s.email, s.entity"; $sql .= ", s.tva_intra, s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4, s.idprof5, s.idprof6"; $sql .= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= ")"; $sql .= " WHERE f.fk_soc = s.rowid"; $sql .= " AND f.entity IN (".getEntity('invoice').")"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($user->socid) { diff --git a/htdocs/core/boxes/box_factures_fourn.php b/htdocs/core/boxes/box_factures_fourn.php index 70640efeb78..ae905d5d468 100644 --- a/htdocs/core/boxes/box_factures_fourn.php +++ b/htdocs/core/boxes/box_factures_fourn.php @@ -100,12 +100,12 @@ class box_factures_fourn extends ModeleBoxes $sql .= ', f.date_lim_reglement as datelimite, f.tms, f.type'; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= ", ".MAIN_DB_PREFIX."facture_fourn as f"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE f.fk_soc = s.rowid"; $sql .= " AND f.entity = ".$conf->entity; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($user->socid) { diff --git a/htdocs/core/boxes/box_factures_fourn_imp.php b/htdocs/core/boxes/box_factures_fourn_imp.php index 74f9a3a46aa..cfef8801414 100644 --- a/htdocs/core/boxes/box_factures_fourn_imp.php +++ b/htdocs/core/boxes/box_factures_fourn_imp.php @@ -95,14 +95,14 @@ class box_factures_fourn_imp extends ModeleBoxes $sql .= ", f.tms"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= ",".MAIN_DB_PREFIX."facture_fourn as f"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE f.fk_soc = s.rowid"; $sql .= " AND f.entity = ".$conf->entity; $sql .= " AND f.paye = 0"; $sql .= " AND fk_statut = 1"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($user->socid) { diff --git a/htdocs/core/boxes/box_factures_imp.php b/htdocs/core/boxes/box_factures_imp.php index c78e5b7dec9..9a8e764f208 100644 --- a/htdocs/core/boxes/box_factures_imp.php +++ b/htdocs/core/boxes/box_factures_imp.php @@ -108,7 +108,7 @@ class box_factures_imp extends ModeleBoxes if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity); } - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= ", ".MAIN_DB_PREFIX."facture as f"; @@ -117,7 +117,7 @@ class box_factures_imp extends ModeleBoxes $sql .= " AND f.entity IN (".getEntity('invoice').")"; $sql .= " AND f.paye = 0"; $sql .= " AND fk_statut = 1"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($user->socid) { diff --git a/htdocs/core/boxes/box_ficheinter.php b/htdocs/core/boxes/box_ficheinter.php index 3b62361343a..e0bdaf709ce 100644 --- a/htdocs/core/boxes/box_ficheinter.php +++ b/htdocs/core/boxes/box_ficheinter.php @@ -89,13 +89,13 @@ class box_ficheinter extends ModeleBoxes $sql .= ", s.code_client, s.code_compta, s.client"; $sql .= ", s.logo, s.email, s.entity"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir) { + if (empty($user->rights->societe->client->voir)) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= ", ".MAIN_DB_PREFIX."fichinter as f"; $sql .= " WHERE f.fk_soc = s.rowid "; $sql .= " AND f.entity = ".$conf->entity; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($user->socid) { diff --git a/htdocs/core/boxes/box_fournisseurs.php b/htdocs/core/boxes/box_fournisseurs.php index c0516c1cf4c..4f297135b26 100644 --- a/htdocs/core/boxes/box_fournisseurs.php +++ b/htdocs/core/boxes/box_fournisseurs.php @@ -87,12 +87,12 @@ class box_fournisseurs extends ModeleBoxes $sql .= ", s.logo, s.email, s.entity"; $sql .= ", s.datec, s.tms, s.status"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE s.fournisseur = 1"; $sql .= " AND s.entity IN (".getEntity('societe').")"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($user->socid) { diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index fe01eae730b..18ffe022610 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -99,7 +99,7 @@ class box_graph_invoices_permonth extends ModeleBoxes if ($user->socid) { $socid = $user->socid; } - if (!$user->rights->societe->client->voir || $socid) { + if (empty($user->rights->societe->client->voir) || $socid) { $prefix .= 'private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user } diff --git a/htdocs/core/boxes/box_graph_invoices_peryear.php b/htdocs/core/boxes/box_graph_invoices_peryear.php index 22d9ad956e7..9126cfcfb37 100644 --- a/htdocs/core/boxes/box_graph_invoices_peryear.php +++ b/htdocs/core/boxes/box_graph_invoices_peryear.php @@ -93,7 +93,7 @@ class box_graph_invoices_peryear extends ModeleBoxes $prefix = ''; $socid = 0; if ($user->socid) $socid = $user->socid; - if (!$user->rights->societe->client->voir || $socid) $prefix .= 'private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user + if (empty($user->rights->societe->client->voir) || $socid) $prefix .= 'private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user if ($user->rights->facture->lire) { $mesg = ''; diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php index 5ecc26c3f90..3d8cb88938d 100644 --- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php @@ -98,7 +98,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes if ($user->socid) { $socid = $user->socid; } - if (!$user->rights->societe->client->voir || $socid) { + if (empty($user->rights->societe->client->voir) || $socid) { $prefix .= 'private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user } diff --git a/htdocs/core/boxes/box_graph_orders_permonth.php b/htdocs/core/boxes/box_graph_orders_permonth.php index 48f0bd67ec3..0fd27c377d5 100644 --- a/htdocs/core/boxes/box_graph_orders_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_permonth.php @@ -99,7 +99,7 @@ class box_graph_orders_permonth extends ModeleBoxes if ($user->socid) { $socid = $user->socid; } - if (!$user->rights->societe->client->voir || $socid) { + if (empty($user->rights->societe->client->voir) || $socid) { $prefix .= 'private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user } diff --git a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php index a394834cd97..be58b1e983c 100644 --- a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php @@ -98,7 +98,7 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes if ($user->socid) { $socid = $user->socid; } - if (!$user->rights->societe->client->voir || $socid) { + if (empty($user->rights->societe->client->voir) || $socid) { $prefix .= 'private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user } diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php index 8a95761ea08..03899fb922f 100644 --- a/htdocs/core/boxes/box_graph_propales_permonth.php +++ b/htdocs/core/boxes/box_graph_propales_permonth.php @@ -101,7 +101,7 @@ class box_graph_propales_permonth extends ModeleBoxes if ($user->socid) { $socid = $user->socid; } - if (!$user->rights->societe->client->voir || $socid) { + if (empty($user->rights->societe->client->voir) || $socid) { $prefix .= 'private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user } diff --git a/htdocs/core/boxes/box_last_modified_ticket.php b/htdocs/core/boxes/box_last_modified_ticket.php index 57e54594255..300a13803c5 100644 --- a/htdocs/core/boxes/box_last_modified_ticket.php +++ b/htdocs/core/boxes/box_last_modified_ticket.php @@ -96,7 +96,7 @@ class box_last_modified_ticket extends ModeleBoxes $sql .= " WHERE t.entity IN (".getEntity('ticket').')'; // $sql.= " AND e.rowid = er.fk_event"; - //if (!$user->rights->societe->client->voir && !$user->socid) $sql.= " WHERE s.rowid = sc.fk_soc AND sc.fk_user = " .((int) $user->id); + //if (empty($user->rights->societe->client->voir) && !$user->socid) $sql.= " WHERE s.rowid = sc.fk_soc AND sc.fk_user = " .((int) $user->id); if ($user->socid) { $sql .= " AND t.fk_soc = ".((int) $user->socid); } diff --git a/htdocs/core/boxes/box_last_ticket.php b/htdocs/core/boxes/box_last_ticket.php index 39086464f73..25cb353b268 100644 --- a/htdocs/core/boxes/box_last_ticket.php +++ b/htdocs/core/boxes/box_last_ticket.php @@ -95,7 +95,7 @@ class box_last_ticket extends ModeleBoxes $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid=t.fk_soc"; $sql .= " WHERE t.entity IN (".getEntity('ticket').")"; // $sql.= " AND e.rowid = er.fk_event"; - //if (!$user->rights->societe->client->voir && !$user->socid) $sql.= " WHERE s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); + //if (empty($user->rights->societe->client->voir) && !$user->socid) $sql.= " WHERE s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); if ($user->socid) { $sql .= " AND t.fk_soc= ".((int) $user->socid); } diff --git a/htdocs/core/boxes/box_propales.php b/htdocs/core/boxes/box_propales.php index 6599116a980..51d313b7254 100644 --- a/htdocs/core/boxes/box_propales.php +++ b/htdocs/core/boxes/box_propales.php @@ -90,12 +90,12 @@ class box_propales extends ModeleBoxes $sql .= ", p.rowid, p.ref, p.fk_statut as status, p.datep as dp, p.datec, p.fin_validite, p.date_cloture, p.total_ht, p.total_tva, p.total_ttc, p.tms"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= ", ".MAIN_DB_PREFIX."propal as p"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE p.fk_soc = s.rowid"; $sql .= " AND p.entity IN (".getEntity('propal').")"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($user->socid) { diff --git a/htdocs/core/boxes/box_prospect.php b/htdocs/core/boxes/box_prospect.php index 06d42e34b18..a46713a3206 100644 --- a/htdocs/core/boxes/box_prospect.php +++ b/htdocs/core/boxes/box_prospect.php @@ -93,12 +93,12 @@ class box_prospect extends ModeleBoxes $sql .= ", s.fk_stcomm"; $sql .= ", s.datec, s.tms, s.status"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE s.client IN (2, 3)"; $sql .= " AND s.entity IN (".getEntity('societe').")"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($user->socid) { diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php index 320932a0c6f..c72a378a1a2 100644 --- a/htdocs/core/boxes/box_services_contracts.php +++ b/htdocs/core/boxes/box_services_contracts.php @@ -95,7 +95,7 @@ class box_services_contracts extends ModeleBoxes $sql .= " INNER JOIN ".MAIN_DB_PREFIX."contrat as c ON s.rowid = c.fk_soc"; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."contratdet as cd ON c.rowid = cd.fk_contrat"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } $sql .= ")"; diff --git a/htdocs/core/boxes/box_services_expired.php b/htdocs/core/boxes/box_services_expired.php index 433c566ad31..4353fb7eb02 100644 --- a/htdocs/core/boxes/box_services_expired.php +++ b/htdocs/core/boxes/box_services_expired.php @@ -86,7 +86,7 @@ class box_services_expired extends ModeleBoxes $sql .= " s.nom as name, s.rowid as socid, s.email, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,"; $sql .= " MIN(cd.date_fin_validite) as date_line, COUNT(cd.rowid) as nb_services"; $sql .= " FROM ".MAIN_DB_PREFIX."contrat as c, ".MAIN_DB_PREFIX."societe s, ".MAIN_DB_PREFIX."contratdet as cd"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE cd.statut = 4 AND cd.date_fin_validite <= '".$this->db->idate($now)."'"; @@ -95,7 +95,7 @@ class box_services_expired extends ModeleBoxes if ($user->socid) { $sql .= ' AND c.fk_soc = '.((int) $user->socid); } - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } $sql .= " GROUP BY c.rowid, c.ref, c.statut, c.date_contrat, c.ref_customer, c.ref_supplier, s.nom, s.rowid"; diff --git a/htdocs/core/boxes/box_shipments.php b/htdocs/core/boxes/box_shipments.php index 2b6adfe3bdc..d0ddf1f8dcb 100644 --- a/htdocs/core/boxes/box_shipments.php +++ b/htdocs/core/boxes/box_shipments.php @@ -101,7 +101,7 @@ class box_shipments extends ModeleBoxes $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON e.rowid = el.fk_target AND el.targettype = 'shipping' AND el.sourcetype IN ('commande')"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."commande as c ON el.fk_source = c.rowid AND el.sourcetype IN ('commande') AND el.targettype = 'shipping'"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = e.fk_soc"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON e.fk_soc = sc.fk_soc"; } $sql .= " WHERE e.entity IN (".getEntity('expedition').")"; @@ -111,7 +111,7 @@ class box_shipments extends ModeleBoxes if ($user->socid > 0) { $sql.= " AND s.rowid = ".((int) $user->socid); } - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " AND sc.fk_user = ".((int) $user->id); } else { $sql .= " ORDER BY e.date_delivery, e.ref DESC "; diff --git a/htdocs/core/boxes/box_supplier_orders.php b/htdocs/core/boxes/box_supplier_orders.php index b3451d9b6c3..2cc34a9255b 100644 --- a/htdocs/core/boxes/box_supplier_orders.php +++ b/htdocs/core/boxes/box_supplier_orders.php @@ -92,12 +92,12 @@ class box_supplier_orders extends ModeleBoxes $sql .= ", c.fk_statut as status"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= ", ".MAIN_DB_PREFIX."commande_fournisseur as c"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE c.fk_soc = s.rowid"; $sql .= " AND c.entity IN (".getEntity('supplier_order').")"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($user->socid) { diff --git a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php index 580ccdb373c..ff282a6cdc4 100644 --- a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php +++ b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php @@ -92,13 +92,13 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes $sql .= ", c.fk_statut as status"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= ", ".MAIN_DB_PREFIX."commande_fournisseur as c"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE c.fk_soc = s.rowid"; $sql .= " AND c.entity IN (".getEntity('supplier_order').")"; $sql .= " AND c.fk_statut IN (".CommandeFournisseur::STATUS_ORDERSENT.", ".CommandeFournisseur::STATUS_RECEIVED_PARTIALLY.")"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($user->socid) { diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 6bf0285a2fb..f89c8025333 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2048,19 +2048,19 @@ abstract class CommonObject if (isset($this->ismultientitymanaged) && !is_numeric($this->ismultientitymanaged)) { $tmparray = explode('@', $this->ismultientitymanaged); $sql .= ", ".MAIN_DB_PREFIX.$tmparray[1]." as ".($tmparray[1] == 'societe' ? 's' : 'parenttable'); // If we need to link to this table to limit select to entity - } elseif ($restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) { + } elseif ($restrictiononfksoc == 1 && $this->element != 'societe' && empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe as s"; // If we need to link to societe to limit select to socid - } elseif ($restrictiononfksoc == 2 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) { + } elseif ($restrictiononfksoc == 2 && $this->element != 'societe' && empty($user->rights->societe->client->voir) && !$socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON te.fk_soc = s.rowid"; // If we need to link to societe to limit select to socid } - if ($restrictiononfksoc && !$user->rights->societe->client->voir && !$socid) { + if ($restrictiononfksoc && empty($user->rights->societe->client->voir) && !$socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON ".$aliastablesociete.".rowid = sc.fk_soc"; } $sql .= " WHERE te.".$fieldid." < '".$this->db->escape($fieldid == 'rowid' ? $this->id : $this->ref)."'"; // ->ref must always be defined (set to id if field does not exists) - if ($restrictiononfksoc == 1 && !$user->rights->societe->client->voir && !$socid) { + if ($restrictiononfksoc == 1 && empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND sc.fk_user = ".((int) $user->id); } - if ($restrictiononfksoc == 2 && !$user->rights->societe->client->voir && !$socid) { + if ($restrictiononfksoc == 2 && empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND (sc.fk_user = ".((int) $user->id).' OR te.fk_soc IS NULL)'; } if (!empty($filter)) { @@ -2072,7 +2072,7 @@ abstract class CommonObject if (isset($this->ismultientitymanaged) && !is_numeric($this->ismultientitymanaged)) { $tmparray = explode('@', $this->ismultientitymanaged); $sql .= " AND te.".$tmparray[0]." = ".($tmparray[1] == "societe" ? "s" : "parenttable").".rowid"; // If we need to link to this table to limit select to entity - } elseif ($restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) { + } elseif ($restrictiononfksoc == 1 && $this->element != 'societe' && empty($user->rights->societe->client->voir) && !$socid) { $sql .= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to socid } if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) { @@ -2118,19 +2118,19 @@ abstract class CommonObject if (isset($this->ismultientitymanaged) && !is_numeric($this->ismultientitymanaged)) { $tmparray = explode('@', $this->ismultientitymanaged); $sql .= ", ".MAIN_DB_PREFIX.$tmparray[1]." as ".($tmparray[1] == 'societe' ? 's' : 'parenttable'); // If we need to link to this table to limit select to entity - } elseif ($restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) { + } elseif ($restrictiononfksoc == 1 && $this->element != 'societe' && empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe as s"; // If we need to link to societe to limit select to socid - } elseif ($restrictiononfksoc == 2 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) { + } elseif ($restrictiononfksoc == 2 && $this->element != 'societe' && empty($user->rights->societe->client->voir) && !$socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON te.fk_soc = s.rowid"; // If we need to link to societe to limit select to socid } - if ($restrictiononfksoc && !$user->rights->societe->client->voir && !$socid) { + if ($restrictiononfksoc && empty($user->rights->societe->client->voir) && !$socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON ".$aliastablesociete.".rowid = sc.fk_soc"; } $sql .= " WHERE te.".$fieldid." > '".$this->db->escape($fieldid == 'rowid' ? $this->id : $this->ref)."'"; // ->ref must always be defined (set to id if field does not exists) - if ($restrictiononfksoc == 1 && !$user->rights->societe->client->voir && !$socid) { + if ($restrictiononfksoc == 1 && empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND sc.fk_user = ".((int) $user->id); } - if ($restrictiononfksoc == 2 && !$user->rights->societe->client->voir && !$socid) { + if ($restrictiononfksoc == 2 && empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND (sc.fk_user = ".((int) $user->id).' OR te.fk_soc IS NULL)'; } if (!empty($filter)) { @@ -2142,7 +2142,7 @@ abstract class CommonObject if (isset($this->ismultientitymanaged) && !is_numeric($this->ismultientitymanaged)) { $tmparray = explode('@', $this->ismultientitymanaged); $sql .= " AND te.".$tmparray[0]." = ".($tmparray[1] == "societe" ? "s" : "parenttable").".rowid"; // If we need to link to this table to limit select to entity - } elseif ($restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) { + } elseif ($restrictiononfksoc == 1 && $this->element != 'societe' && empty($user->rights->societe->client->voir) && !$socid) { $sql .= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to socid } if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 88151e7c288..ebd4579e6f0 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1347,7 +1347,7 @@ class Form if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as dictp ON dictp.rowid = s.fk_pays"; } - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE s.entity IN (".getEntity('societe').")"; @@ -1357,7 +1357,7 @@ class Form if ($filter) { $sql .= " AND (".$filter.")"; } - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if (!empty($conf->global->COMPANY_HIDE_INACTIVE_IN_COMBOBOX)) { @@ -7029,7 +7029,7 @@ class Form $sql .= " INNER JOIN ".MAIN_DB_PREFIX.$tmparray[1]." as parenttable ON parenttable.rowid = t.".$tmparray[0]; } if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') { - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } } @@ -7057,7 +7057,7 @@ class Form } } if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') { - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } } diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 048335201ee..667a2808f58 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -162,12 +162,12 @@ function show_array_actions_to_do($max = 5) $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a LEFT JOIN "; $sql .= " ".MAIN_DB_PREFIX."c_actioncomm as c ON c.id = a.fk_action"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE a.entity IN (".getEntity('agenda').")"; $sql .= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { @@ -278,12 +278,12 @@ function show_array_last_actions_done($max = 5) $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a LEFT JOIN "; $sql .= " ".MAIN_DB_PREFIX."c_actioncomm as c ON c.id = a.fk_action "; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE a.entity IN (".getEntity('agenda').")"; $sql .= " AND (a.percent >= 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index 573f27c1eee..8b61a690910 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -233,7 +233,7 @@ function getCustomerInvoicePieChart($socid = 0) $sql = "SELECT count(f.rowid), f.fk_statut"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= ", ".MAIN_DB_PREFIX."facture as f"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE f.fk_soc = s.rowid"; @@ -241,7 +241,7 @@ function getCustomerInvoicePieChart($socid = 0) if ($user->socid) { $sql .= ' AND f.fk_soc = '.((int) $user->socid); } - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } $sql .= " GROUP BY f.fk_statut"; @@ -353,7 +353,7 @@ function getPurchaseInvoicePieChart($socid = 0) $sql = "SELECT count(f.rowid), f.fk_statut"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= ", ".MAIN_DB_PREFIX."facture_fourn as f"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE f.fk_soc = s.rowid"; @@ -361,7 +361,7 @@ function getPurchaseInvoicePieChart($socid = 0) if ($user->socid) { $sql .= ' AND f.fk_soc = '.((int) $user->socid); } - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } $sql .= " GROUP BY f.fk_statut"; @@ -609,16 +609,16 @@ function getCustomerInvoiceDraftTable($maxCount = 500, $socid = 0) $sql .= ", s.rowid as socid, s.email"; $sql .= ", s.code_client, s.code_compta, s.code_fournisseur, s.code_compta_fournisseur"; $sql .= ", cc.rowid as country_id, cc.code as country_code"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", sc.fk_soc, sc.fk_user "; } $sql .= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."societe as s LEFT JOIN ".MAIN_DB_PREFIX."c_country as cc ON cc.rowid = s.fk_pays"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE s.rowid = f.fk_soc AND f.fk_statut = ".Facture::STATUS_DRAFT; $sql .= " AND f.entity IN (".getEntity('invoice').")"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } @@ -633,7 +633,7 @@ function getCustomerInvoiceDraftTable($maxCount = 500, $socid = 0) $sql .= " GROUP BY f.rowid, f.ref, f.datef, f.total_ht, f.total_tva, f.total_ttc, f.ref_client, f.type, f.fk_statut, f.paye,"; $sql .= " s.nom, s.rowid, s.email, s.code_client, s.code_compta, s.code_fournisseur, s.code_compta_fournisseur,"; $sql .= " cc.rowid, cc.code"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", sc.fk_soc, sc.fk_user"; } @@ -757,12 +757,12 @@ function getDraftSupplierTable($maxCount = 500, $socid = 0) $sql .= ", s.code_fournisseur, s.code_compta_fournisseur"; $sql .= ", cc.rowid as country_id, cc.code as country_code"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f, ".MAIN_DB_PREFIX."societe as s LEFT JOIN ".MAIN_DB_PREFIX."c_country as cc ON cc.rowid = s.fk_pays"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE s.rowid = f.fk_soc AND f.fk_statut = ".FactureFournisseur::STATUS_DRAFT; $sql .= " AND f.entity IN (".getEntity('invoice').')'; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { @@ -879,7 +879,7 @@ function getCustomerInvoiceLatestEditTable($maxCount = 5, $socid = 0) $sql .= " s.nom as socname, s.rowid as socid, s.canvas, s.client"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE f.fk_soc = s.rowid"; @@ -887,7 +887,7 @@ function getCustomerInvoiceLatestEditTable($maxCount = 5, $socid = 0) if ($socid) { $sql .= " AND f.fk_soc = ".((int) $socid); } - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } $sql .= " ORDER BY f.tms DESC"; @@ -984,7 +984,7 @@ function getPurchaseInvoiceLatestEditTable($maxCount = 5, $socid = 0) $sql .= " s.nom as socname, s.rowid as socid, s.canvas, s.client"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE f.fk_soc = s.rowid"; @@ -992,7 +992,7 @@ function getPurchaseInvoiceLatestEditTable($maxCount = 5, $socid = 0) if ($socid) { $sql .= " AND f.fk_soc = ".((int) $socid); } - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } $sql .= " ORDER BY f.tms DESC"; @@ -1103,12 +1103,12 @@ function getCustomerInvoiceUnpaidOpenTable($maxCount = 500, $socid = 0) $sql .= ", sum(pf.amount) as am"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s LEFT JOIN ".MAIN_DB_PREFIX."c_country as cc ON cc.rowid = s.fk_pays,".MAIN_DB_PREFIX."facture as f"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf on f.rowid=pf.fk_facture"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE s.rowid = f.fk_soc AND f.paye = 0 AND f.fk_statut = ".Facture::STATUS_VALIDATED; $sql .= " AND f.entity IN (".getEntity('invoice').')'; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { @@ -1289,14 +1289,14 @@ function getPurchaseInvoiceUnpaidOpenTable($maxCount = 500, $socid = 0) $sql .= ", sum(pf.amount) as am"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as ff"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf on ff.rowid=pf.fk_facturefourn"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE s.rowid = ff.fk_soc"; $sql .= " AND ff.entity = ".$conf->entity; $sql .= " AND ff.paye = 0"; $sql .= " AND ff.fk_statut = ".FactureFournisseur::STATUS_VALIDATED; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { diff --git a/htdocs/core/lib/order.lib.php b/htdocs/core/lib/order.lib.php index f264eadaf58..0109847c59a 100644 --- a/htdocs/core/lib/order.lib.php +++ b/htdocs/core/lib/order.lib.php @@ -199,7 +199,7 @@ function getCustomerOrderPieChart($socid = 0) $sql = "SELECT count(c.rowid) as nb, c.fk_statut as status"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= ", ".MAIN_DB_PREFIX."commande as c"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE c.fk_soc = s.rowid"; @@ -207,7 +207,7 @@ function getCustomerOrderPieChart($socid = 0) if ($user->socid) { $sql .= ' AND c.fk_soc = '.((int) $user->socid); } - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } $sql .= " GROUP BY c.fk_statut"; diff --git a/htdocs/core/lib/propal.lib.php b/htdocs/core/lib/propal.lib.php index 038ab2a7911..c5d2a647a57 100644 --- a/htdocs/core/lib/propal.lib.php +++ b/htdocs/core/lib/propal.lib.php @@ -178,7 +178,7 @@ function getCustomerProposalPieChart($socid = 0) $sql = "SELECT count(p.rowid) as nb, p.fk_statut as status"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= ", ".MAIN_DB_PREFIX."propal as p"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE p.entity IN (".getEntity($propalstatic->element).")"; @@ -186,7 +186,7 @@ function getCustomerProposalPieChart($socid = 0) if ($user->socid) { $sql .= ' AND p.fk_soc = '.((int) $user->socid); } - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } $sql .= " AND p.fk_statut IN (".$db->sanitize(implode(" ,", $listofstatus)).")"; diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index be804dc184c..554fcba9370 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -514,7 +514,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f $deleteok = 0; } } elseif ($feature == 'adherent') { - if (!$user->rights->adherent->supprimer) { + if (empty($user->rights->adherent->supprimer)) { $deleteok = 0; } } elseif (!empty($feature2)) { // This is for permissions on 2 levels @@ -662,7 +662,7 @@ function checkUserAccessToObject($user, array $featuresarray, $objectid = 0, $ta if ($user->socid <> $objectid) { return false; } - } elseif (!empty($conf->societe->enabled) && ($user->rights->societe->lire && !$user->rights->societe->client->voir)) { + } elseif (!empty($conf->societe->enabled) && ($user->rights->societe->lire && empty($user->rights->societe->client->voir))) { // If internal user: Check permission for internal users that are restricted on their objects $sql = "SELECT COUNT(sc.fk_soc) as nb"; $sql .= " FROM (".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -685,7 +685,7 @@ function checkUserAccessToObject($user, array $featuresarray, $objectid = 0, $ta $sql .= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt"; $sql .= " WHERE dbt.".$dbt_select." IN (".$db->sanitize($objectid, 1).")"; $sql .= " AND dbt.fk_soc = ".((int) $user->socid); - } elseif (!empty($conf->societe->enabled) && ($user->rights->societe->lire && !$user->rights->societe->client->voir)) { + } elseif (!empty($conf->societe->enabled) && ($user->rights->societe->lire && empty($user->rights->societe->client->voir))) { // If internal user: Check permission for internal users that are restricted on their objects $sql = "SELECT COUNT(dbt.".$dbt_select.") as nb"; $sql .= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt"; @@ -755,7 +755,7 @@ function checkUserAccessToObject($user, array $featuresarray, $objectid = 0, $ta $sql .= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt"; $sql .= " WHERE dbt.rowid IN (".$db->sanitize($objectid, 1).")"; $sql .= " AND dbt.".$dbt_keyfield." = ".((int) $user->socid); - } elseif (!empty($conf->societe->enabled) && !$user->rights->societe->client->voir) { + } elseif (!empty($conf->societe->enabled) && empty($user->rights->societe->client->voir)) { // If internal user: Check permission for internal users that are restricted on their objects if ($feature != 'ticket') { if (empty($dbt_keyfield)) { diff --git a/htdocs/core/modules/rapport/pdf_paiement.class.php b/htdocs/core/modules/rapport/pdf_paiement.class.php index 5904db84398..215987054ce 100644 --- a/htdocs/core/modules/rapport/pdf_paiement.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement.class.php @@ -196,7 +196,7 @@ class pdf_paiement $sql .= " ".MAIN_DB_PREFIX."bank as b, ".MAIN_DB_PREFIX."bank_account as ba,"; } $sql .= " ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE f.fk_soc = s.rowid AND pf.fk_facture = f.rowid AND pf.fk_paiement = p.rowid"; @@ -205,7 +205,7 @@ class pdf_paiement } $sql .= " AND f.entity IN (".getEntity('invoice').")"; $sql .= " AND p.datep BETWEEN '".$this->db->idate(dol_get_first_day($year, $month))."' AND '".$this->db->idate(dol_get_last_day($year, $month))."'"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if (!empty($socid)) { @@ -234,7 +234,7 @@ class pdf_paiement $sql .= " ".MAIN_DB_PREFIX."bank as b, ".MAIN_DB_PREFIX."bank_account as ba,"; } $sql .= " ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE f.fk_soc = s.rowid AND pf.fk_facturefourn = f.rowid AND pf.fk_paiementfourn = p.rowid"; @@ -243,7 +243,7 @@ class pdf_paiement } $sql .= " AND f.entity IN (".getEntity('invoice').")"; $sql .= " AND p.datep BETWEEN '".$this->db->idate(dol_get_first_day($year, $month))."' AND '".$this->db->idate(dol_get_last_day($year, $month))."'"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if (!empty($socid)) { diff --git a/htdocs/core/photos_resize.php b/htdocs/core/photos_resize.php index 374f381c098..18d66e839b2 100644 --- a/htdocs/core/photos_resize.php +++ b/htdocs/core/photos_resize.php @@ -68,7 +68,7 @@ if ($modulepart == 'produit' || $modulepart == 'product' || $modulepart == 'serv $accessallowed = 1; } elseif ($modulepart == 'member') { $result = restrictedArea($user, 'adherent', $id, '', '', 'fk_soc', 'rowid'); - if (!$user->rights->adherent->lire) { + if (empty($user->rights->adherent->lire)) { accessforbidden(); } $accessallowed = 1; diff --git a/htdocs/document.php b/htdocs/document.php index 3c06801c9a0..b419acb8449 100644 --- a/htdocs/document.php +++ b/htdocs/document.php @@ -119,7 +119,7 @@ if ($user->socid > 0) { // For some module part, dir may be privates if (in_array($modulepart, array('facture_paiement', 'unpaid'))) { - if (!$user->rights->societe->client->voir || $socid) { + if (empty($user->rights->societe->client->voir) || $socid) { $original_file = 'private/'.$user->id.'/'.$original_file; // If user has no permission to see all, output dir is specific to user } } diff --git a/htdocs/don/stats/index.php b/htdocs/don/stats/index.php index 23e6c0a46c0..59a73ad5b19 100644 --- a/htdocs/don/stats/index.php +++ b/htdocs/don/stats/index.php @@ -70,7 +70,7 @@ $data = $stats->getNbByMonthWithPrevYear($endyear, $startyear); // $data = array(array('Lib',val1,val2,val3),...) -if (!$user->rights->societe->client->voir || $user->socid) { +if (empty($user->rights->societe->client->voir) || $user->socid) { $filenamenb = $dir.'/shipmentsnbinyear-'.$user->id.'-'.$year.'.png'; } else { $filenamenb = $dir.'/shipmentsnbinyear-'.$year.'.png'; @@ -105,7 +105,7 @@ $data = $stats->getAmountByMonthWithPrevYear($endyear,$startyear); //var_dump($data); // $data = array(array('Lib',val1,val2,val3),...) -if (!$user->rights->societe->client->voir || $user->socid) +if (empty($user->rights->societe->client->voir) || $user->socid) { $filenameamount = $dir.'/shipmentsamountinyear-'.$user->id.'-'.$year.'.png'; } @@ -143,7 +143,7 @@ if (! $mesg) /* $data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear); -if (!$user->rights->societe->client->voir || $user->socid) +if (empty($user->rights->societe->client->voir) || $user->socid) { $filename_avg = $dir.'/shipmentsaverage-'.$user->id.'-'.$year.'.png'; } diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index c02306ba6be..0b585a03ca2 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -282,13 +282,13 @@ if ($projectid > 0) { // Title $morehtmlref .= $project->title; // Thirdparty - if ($project->thirdparty->id > 0) { + if (isset($project->thirdparty->id) && $project->thirdparty->id > 0) { $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$project->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= '
    '; // Define a complementary filter for search of next/prev ref. - if (!$user->rights->project->all->lire) { + if (empty($user->rights->project->all->lire)) { $objectsListId = $project->getProjectsAuthorizedForUser($user, 0, 0); $project->next_prev_filter = " rowid IN (".$db->sanitize(count($objectsListId) ? join(',', array_keys($objectsListId)) : '0').")"; } diff --git a/htdocs/expedition/class/expeditionstats.class.php b/htdocs/expedition/class/expeditionstats.class.php index 3c1bef04d09..8eb31896f38 100644 --- a/htdocs/expedition/class/expeditionstats.class.php +++ b/htdocs/expedition/class/expeditionstats.class.php @@ -73,7 +73,7 @@ class ExpeditionStats extends Stats //$this->where.= " AND c.fk_soc = s.rowid AND c.entity = ".$conf->entity; $this->where .= " AND c.entity = ".$conf->entity; - if (!$user->rights->societe->client->voir && !$this->socid) { + if (empty($user->rights->societe->client->voir) && !$this->socid) { $this->where .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($this->socid) { @@ -97,7 +97,7 @@ class ExpeditionStats extends Stats $sql = "SELECT date_format(c.date_valid,'%m') as dm, COUNT(*) as nb"; $sql .= " FROM ".$this->from; - if (!$user->rights->societe->client->voir && !$this->socid) { + if (empty($user->rights->societe->client->voir) && !$this->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE c.date_valid BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; @@ -121,7 +121,7 @@ class ExpeditionStats extends Stats $sql = "SELECT date_format(c.date_valid,'%Y') as dm, COUNT(*) as nb, SUM(c.".$this->field.")"; $sql .= " FROM ".$this->from; - if (!$user->rights->societe->client->voir && !$this->socid) { + if (empty($user->rights->societe->client->voir) && !$this->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE ".$this->where; @@ -142,7 +142,7 @@ class ExpeditionStats extends Stats $sql = "SELECT date_format(c.date_valid,'%Y') as year, COUNT(*) as nb, SUM(c.".$this->field.") as total, AVG(".$this->field.") as avg"; $sql .= " FROM ".$this->from; - if (!$user->rights->societe->client->voir && !$this->socid) { + if (empty($user->rights->societe->client->voir) && !$this->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE ".$this->where; diff --git a/htdocs/expedition/index.php b/htdocs/expedition/index.php index 173cc1889bc..a08339d652f 100644 --- a/htdocs/expedition/index.php +++ b/htdocs/expedition/index.php @@ -66,7 +66,7 @@ $sql .= " FROM ".MAIN_DB_PREFIX."expedition as e"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON e.rowid = el.fk_target AND el.targettype = 'shipping'"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."commande as c ON el.fk_source = c.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = e.fk_soc"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON e.fk_soc = sc.fk_soc"; $sql .= $clause." sc.fk_user = ".((int) $user->id); $clause = " AND "; @@ -138,11 +138,11 @@ $sql .= " FROM ".MAIN_DB_PREFIX."expedition as e"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON e.rowid = el.fk_target AND el.targettype = 'shipping' AND el.sourcetype IN ('commande')"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."commande as c ON el.fk_source = c.rowid AND el.sourcetype IN ('commande') AND el.targettype = 'shipping'"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = e.fk_soc"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON e.fk_soc = sc.fk_soc"; } $sql .= " WHERE e.entity IN (".getEntity('expedition').")"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND sc.fk_user = ".((int) $user->id); } $sql .= " AND e.fk_statut = ".Expedition::STATUS_VALIDATED; @@ -208,7 +208,7 @@ if ($resql) { $sql = "SELECT c.rowid, c.ref, c.ref_client as ref_customer, c.fk_statut as status, c.facture as billed, s.nom as name, s.rowid as socid"; $sql .= " FROM ".MAIN_DB_PREFIX."commande as c,"; $sql .= " ".MAIN_DB_PREFIX."societe as s"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE c.fk_soc = s.rowid"; @@ -217,7 +217,7 @@ $sql .= " AND c.fk_statut IN (".Commande::STATUS_VALIDATED.", ".Commande::STATUS if ($socid > 0) { $sql .= " AND c.fk_soc = ".((int) $socid); } -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } $sql .= " ORDER BY c.rowid ASC"; diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index 391628a9d38..ac5704511ef 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -277,7 +277,7 @@ if ($search_user > 0) { // Get link to order to get the order id in eesource.fk $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as eesource ON eesource.fk_target = e.rowid AND eesource.targettype = 'shipping' AND eesource.sourcetype = 'commande'"; } // We'll need this table joined to the select in order to filter by sale -if ($search_sale > 0 || (!$user->rights->societe->client->voir && !$socid)) { +if ($search_sale > 0 || (empty($user->rights->societe->client->voir) && !$socid)) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } if ($search_user > 0) { @@ -291,7 +291,7 @@ if ($search_product_category > 0) { if ($socid > 0) { $sql .= ' AND s.rowid = '.$socid; } -if (!$user->rights->societe->client->voir && !$socid) { // Internal user with no permission to see all +if (empty($user->rights->societe->client->voir) && !$socid) { // Internal user with no permission to see all $sql .= " AND e.fk_soc = sc.fk_soc"; $sql .= " AND sc.fk_user = ".((int) $user->id); } diff --git a/htdocs/expedition/stats/index.php b/htdocs/expedition/stats/index.php index 42cac2d3c92..e5718added1 100644 --- a/htdocs/expedition/stats/index.php +++ b/htdocs/expedition/stats/index.php @@ -75,7 +75,7 @@ $data = $stats->getNbByMonthWithPrevYear($endyear, $startyear); // $data = array(array('Lib',val1,val2,val3),...) -if (!$user->rights->societe->client->voir || $user->socid) { +if (empty($user->rights->societe->client->voir) || $user->socid) { $filenamenb = $dir.'/shipmentsnbinyear-'.$user->id.'-'.$year.'.png'; } else { $filenamenb = $dir.'/shipmentsnbinyear-'.$year.'.png'; @@ -110,7 +110,7 @@ $data = $stats->getAmountByMonthWithPrevYear($endyear,$startyear); //var_dump($data); // $data = array(array('Lib',val1,val2,val3),...) -if (!$user->rights->societe->client->voir || $user->socid) +if (empty($user->rights->societe->client->voir) || $user->socid) { $filenameamount = $dir.'/shipmentsamountinyear-'.$user->id.'-'.$year.'.png'; } @@ -148,7 +148,7 @@ if (! $mesg) /* $data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear); -if (!$user->rights->societe->client->voir || $user->socid) +if (empty($user->rights->societe->client->voir) || $user->socid) { $filename_avg = $dir.'/shipmentsaverage-'.$user->id.'-'.$year.'.png'; } diff --git a/htdocs/expensereport/stats/index.php b/htdocs/expensereport/stats/index.php index 5f8a9f628b5..d9fe6a72c87 100644 --- a/htdocs/expensereport/stats/index.php +++ b/htdocs/expensereport/stats/index.php @@ -146,7 +146,7 @@ if (!$mesg) { $data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear); -if (!$user->rights->societe->client->voir || $user->socid) { +if (empty($user->rights->societe->client->voir) || $user->socid) { $filename_avg = $dir.'/ordersaverage-'.$user->id.'-'.$year.'.png'; if ($mode == 'customer') { $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersaverage-'.$user->id.'-'.$year.'.png'; diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index d74e0a5c5e8..f7e51b1139d 100644 --- a/htdocs/fichinter/card-rec.php +++ b/htdocs/fichinter/card-rec.php @@ -761,7 +761,7 @@ if ($action == 'create') { $sql .= " FROM ".MAIN_DB_PREFIX."fichinter_rec as f"; $sql .= " , ".MAIN_DB_PREFIX."societe as s "; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " , ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE f.fk_soc = s.rowid"; @@ -769,7 +769,7 @@ if ($action == 'create') { if ($socid) { $sql .= " AND s.rowid = ".((int) $socid); } - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($search_ref) { diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 9bd3f17da25..297e03fa379 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -204,7 +204,7 @@ class Fichinter extends CommonObject $sql = "SELECT count(fi.rowid) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."fichinter as fi"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON fi.fk_soc = s.rowid"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; $sql .= " WHERE sc.fk_user = ".((int) $user->id); $clause = "AND"; diff --git a/htdocs/fichinter/class/fichinterstats.class.php b/htdocs/fichinter/class/fichinterstats.class.php index 297aeca7760..f6fbdb8d305 100644 --- a/htdocs/fichinter/class/fichinterstats.class.php +++ b/htdocs/fichinter/class/fichinterstats.class.php @@ -72,7 +72,7 @@ class FichinterStats extends Stats $this->field_line = '0'; //$this->where.= " AND c.fk_statut > 0"; // Not draft and not cancelled } - if (!$user->rights->societe->client->voir && !$this->socid) { + if (empty($user->rights->societe->client->voir) && !$this->socid) { $this->where .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } $this->where .= ($this->where ? ' AND ' : '')."c.entity IN (".getEntity('fichinter').')'; @@ -98,7 +98,7 @@ class FichinterStats extends Stats $sql = "SELECT date_format(c.date_valid,'%m') as dm, COUNT(*) as nb"; $sql .= " FROM ".$this->from; - if (!$user->rights->societe->client->voir && !$this->socid) { + if (empty($user->rights->societe->client->voir) && !$this->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE c.date_valid BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; @@ -122,7 +122,7 @@ class FichinterStats extends Stats $sql = "SELECT date_format(c.date_valid,'%Y') as dm, COUNT(*) as nb, 0"; $sql .= " FROM ".$this->from; - if (!$user->rights->societe->client->voir && !$this->socid) { + if (empty($user->rights->societe->client->voir) && !$this->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE ".$this->where; @@ -145,7 +145,7 @@ class FichinterStats extends Stats $sql = "SELECT date_format(c.date_valid,'%m') as dm, 0"; $sql .= " FROM ".$this->from; - if (!$user->rights->societe->client->voir && !$this->socid) { + if (empty($user->rights->societe->client->voir) && !$this->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE c.date_valid BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; @@ -169,7 +169,7 @@ class FichinterStats extends Stats $sql = "SELECT date_format(c.date_valid,'%m') as dm, 0"; $sql .= " FROM ".$this->from; - if (!$user->rights->societe->client->voir && !$this->socid) { + if (empty($user->rights->societe->client->voir) && !$this->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE c.date_valid BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; @@ -191,7 +191,7 @@ class FichinterStats extends Stats $sql = "SELECT date_format(c.date_valid,'%Y') as year, COUNT(*) as nb, 0 as total, 0 as avg"; $sql .= " FROM ".$this->from; - if (!$user->rights->societe->client->voir && !$this->socid) { + if (empty($user->rights->societe->client->voir) && !$this->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE ".$this->where; @@ -214,7 +214,7 @@ class FichinterStats extends Stats $sql = "SELECT product.ref, COUNT(product.ref) as nb, 0 as total, 0 as avg"; $sql .= " FROM ".$this->from.", ".$this->from_line.", ".MAIN_DB_PREFIX."product as product"; - //if (!$user->rights->societe->client->voir && !$user->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + //if (empty($user->rights->societe->client->voir) && !$user->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql .= " WHERE ".$this->where; $sql .= " AND c.rowid = tl.fk_fichinter AND tl.fk_product = product.rowid"; $sql .= " AND c.date_valid BETWEEN '".$this->db->idate(dol_get_first_day($year, 1, false))."' AND '".$this->db->idate(dol_get_last_day($year, 12, false))."'"; diff --git a/htdocs/fichinter/index.php b/htdocs/fichinter/index.php index 8eca043ef40..169ddfdccbf 100644 --- a/htdocs/fichinter/index.php +++ b/htdocs/fichinter/index.php @@ -74,7 +74,7 @@ print '
    '; $sql = "SELECT count(f.rowid), f.fk_statut"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= ", ".MAIN_DB_PREFIX."fichinter as f"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE f.entity IN (".getEntity('intervention').")"; @@ -82,7 +82,7 @@ $sql .= " AND f.fk_soc = s.rowid"; if ($user->socid) { $sql .= ' AND f.fk_soc = '.((int) $user->socid); } -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } $sql .= " GROUP BY f.fk_statut"; @@ -192,7 +192,7 @@ if (!empty($conf->ficheinter->enabled)) { $sql = "SELECT f.rowid, f.ref, s.nom as name, s.rowid as socid"; $sql .= " FROM ".MAIN_DB_PREFIX."fichinter as f"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE f.entity IN (".getEntity('intervention').")"; @@ -201,7 +201,7 @@ if (!empty($conf->ficheinter->enabled)) { if ($socid) { $sql .= " AND f.fk_soc = ".((int) $socid); } - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } @@ -242,7 +242,7 @@ $sql = "SELECT f.rowid, f.ref, f.fk_statut, f.date_valid as datec, f.tms as date $sql .= " s.nom as name, s.rowid as socid"; $sql .= " FROM ".MAIN_DB_PREFIX."fichinter as f,"; $sql .= " ".MAIN_DB_PREFIX."societe as s"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE f.entity IN (".getEntity('intervention').")"; @@ -251,7 +251,7 @@ $sql .= " AND f.fk_soc = s.rowid"; if ($socid) { $sql .= " AND f.fk_soc = ".((int) $socid); } -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } $sql .= " ORDER BY f.tms DESC"; @@ -315,7 +315,7 @@ if (!empty($conf->ficheinter->enabled)) { $sql = "SELECT f.rowid, f.ref, f.fk_statut, s.nom as name, s.rowid as socid"; $sql .= " FROM ".MAIN_DB_PREFIX."fichinter as f"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE f.entity IN (".getEntity('intervention').")"; @@ -324,7 +324,7 @@ if (!empty($conf->ficheinter->enabled)) { if ($socid) { $sql .= " AND f.fk_soc = ".((int) $socid); } - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } $sql .= " ORDER BY f.rowid DESC"; diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 6f4dccd878d..d710d7cd6cc 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -257,7 +257,7 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; -if (!$user->rights->societe->client->voir && empty($socid)) { +if (empty($user->rights->societe->client->voir) && empty($socid)) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= ", ".MAIN_DB_PREFIX."societe as s"; @@ -285,7 +285,7 @@ if ($search_desc) { if ($search_status != '' && $search_status >= 0) { $sql .= ' AND f.fk_statut = '.urlencode($search_status); } -if (!$user->rights->societe->client->voir && empty($socid)) { +if (empty($user->rights->societe->client->voir) && empty($socid)) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { diff --git a/htdocs/fichinter/stats/index.php b/htdocs/fichinter/stats/index.php index 7a7adb639b3..aec9ab7e839 100644 --- a/htdocs/fichinter/stats/index.php +++ b/htdocs/fichinter/stats/index.php @@ -79,7 +79,7 @@ $data = $stats->getNbByMonthWithPrevYear($endyear, $startyear); // $data = array(array('Lib',val1,val2,val3),...) -if (!$user->rights->societe->client->voir || $user->socid) { +if (empty($user->rights->societe->client->voir) || $user->socid) { $filenamenb = $dir.'/interventionsnbinyear-'.$user->id.'-'.$year.'.png'; $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=interventionstats&file=interventionsnbinyear-'.$user->id.'-'.$year.'.png'; } else { @@ -114,7 +114,7 @@ if (!$mesg) { $data = $stats->getAmountByMonthWithPrevYear($endyear, $startyear); // $data = array(array('Lib',val1,val2,val3),...) -if (!$user->rights->societe->client->voir || $user->socid) { +if (empty($user->rights->societe->client->voir) || $user->socid) { $filenameamount = $dir.'/interventionsamountinyear-'.$user->id.'-'.$year.'.png'; $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=interventionstats&file=interventionsamountinyear-'.$user->id.'-'.$year.'.png'; } else { @@ -148,7 +148,7 @@ if (!$mesg) { $data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear); -if (!$user->rights->societe->client->voir || $user->socid) { +if (empty($user->rights->societe->client->voir) || $user->socid) { $filename_avg = $dir.'/interventionsaverage-'.$user->id.'-'.$year.'.png'; $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=interventionstats&file=interventionsaverage-'.$user->id.'-'.$year.'.png'; } else { diff --git a/htdocs/fourn/class/fournisseur.class.php b/htdocs/fourn/class/fournisseur.class.php index 805ed7c1ba6..b47cfa263c0 100644 --- a/htdocs/fourn/class/fournisseur.class.php +++ b/htdocs/fourn/class/fournisseur.class.php @@ -113,7 +113,7 @@ class Fournisseur extends Societe $sql = "SELECT count(s.rowid) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; $sql .= " WHERE sc.fk_user = ".((int) $user->id); $clause = "AND"; @@ -178,12 +178,12 @@ class Fournisseur extends Societe $sql = "SELECT s.rowid, s.nom as name"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE s.fournisseur = 1"; $sql .= " AND s.entity IN (".getEntity('societe').")"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 5da4ad4b08b..bc79aa4d6e1 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2965,7 +2965,7 @@ class CommandeFournisseur extends CommonOrder $sql = "SELECT count(co.rowid) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as co"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON co.fk_soc = s.rowid"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; $sql .= " WHERE sc.fk_user = ".((int) $user->id); $clause = "AND"; @@ -3003,7 +3003,7 @@ class CommandeFournisseur extends CommonOrder $sql = "SELECT c.rowid, c.date_creation as datec, c.date_commande, c.fk_statut, c.date_livraison as delivery_date"; $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON c.fk_soc = sc.fk_soc"; $sql .= " WHERE sc.fk_user = ".((int) $user->id); $clause = " AND"; diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index dbf33b6cd69..69b12820b34 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -2404,7 +2404,7 @@ class FactureFournisseur extends CommonInvoice $sql = 'SELECT ff.rowid, ff.date_lim_reglement as datefin, ff.fk_statut'; $sql .= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as ff'; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= ' WHERE ff.paye=0'; @@ -2413,7 +2413,7 @@ class FactureFournisseur extends CommonInvoice if ($user->socid) { $sql .= ' AND ff.fk_soc = '.((int) $user->socid); } - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " AND ff.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } @@ -2759,7 +2759,7 @@ class FactureFournisseur extends CommonInvoice $sql = "SELECT count(f.rowid) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON f.fk_soc = s.rowid"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; $sql .= " WHERE sc.fk_user = ".((int) $user->id); $clause = "AND"; diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php index b4956ea706f..4d93f6d3818 100644 --- a/htdocs/fourn/commande/index.php +++ b/htdocs/fourn/commande/index.php @@ -67,7 +67,7 @@ print '
    '; $sql = "SELECT count(cf.rowid) as nb, fk_statut as status"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= ", ".MAIN_DB_PREFIX."commande_fournisseur as cf"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE cf.fk_soc = s.rowid"; @@ -75,7 +75,7 @@ $sql .= " AND cf.entity IN (".getEntity('supplier_order').")"; if ($user->socid) { $sql .= ' AND cf.fk_soc = '.((int) $user->socid); } -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } $sql .= " GROUP BY cf.fk_statut"; @@ -176,7 +176,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU $sql = "SELECT c.rowid, c.ref, s.nom as name, s.rowid as socid"; $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE c.fk_soc = s.rowid"; @@ -185,7 +185,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU if (!empty($socid)) { $sql .= " AND c.fk_soc = ".((int) $socid); } - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } @@ -283,7 +283,7 @@ $max = 5; $sql = "SELECT c.rowid, c.ref, c.fk_statut as status, c.tms, c.billed, s.nom as name, s.rowid as socid"; $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE c.fk_soc = s.rowid"; @@ -292,7 +292,7 @@ $sql .= " AND c.entity IN (".getEntity('supplier_order').")"; if (!empty($socid)) { $sql .= " AND c.fk_soc = ".((int) $socid); } -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } $sql .= " ORDER BY c.tms DESC"; @@ -355,12 +355,12 @@ if ($resql) { $sql = "SELECT c.rowid, c.ref, c.fk_statut, s.nom as name, s.rowid as socid"; $sql.=" FROM ".MAIN_DB_PREFIX."commande_fournisseur as c"; $sql.= ", ".MAIN_DB_PREFIX."societe as s"; -if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; +if (empty($user->rights->societe->client->voir) && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE c.fk_soc = s.rowid"; $sql.= " AND c.entity IN (".getEntity("supplier_order").")"; $sql.= " AND c.fk_statut = 1"; if ($socid) $sql.= " AND c.fk_soc = ".((int) $socid); -if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .((int) $user->id); +if (empty($user->rights->societe->client->voir) && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .((int) $user->id); $sql.= " ORDER BY c.rowid DESC"; $resql=$db->query($sql); diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index bef5289c791..419e75b55aa 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -777,7 +777,7 @@ if ($search_product_category > 0) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON cf.fk_user_author = u.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = cf.fk_projet"; // We'll need this table joined to the select in order to filter by sale -if ($search_sale > 0 || (!$user->rights->societe->client->voir && !$socid)) { +if ($search_sale > 0 || (empty($user->rights->societe->client->voir) && !$socid)) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } if ($search_user > 0) { @@ -792,7 +792,7 @@ $sql .= ' AND cf.entity IN ('.getEntity('supplier_order').')'; if ($socid > 0) { $sql .= " AND s.rowid = ".((int) $socid); } -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($search_ref) { diff --git a/htdocs/fourn/contact.php b/htdocs/fourn/contact.php index 9fd4dd30b26..cabf726beee 100644 --- a/htdocs/fourn/contact.php +++ b/htdocs/fourn/contact.php @@ -64,18 +64,18 @@ $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; */ $sql = "SELECT s.rowid as socid, s.nom as name, st.libelle as stcomm, p.rowid as cidp, p.lastname, p.firstname, p.email, p.phone"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", sc.fk_soc, sc.fk_user "; } $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."socpeople as p, ".MAIN_DB_PREFIX."c_stcomm as st"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE s.fk_stcomm = st.id"; $sql .= " AND s.fournisseur = 1"; $sql .= " AND s.rowid = p.fk_soc"; $sql .= " AND s.entity IN (".getEntity('societe').")"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index a325f9db780..6c133c9b5a1 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -461,7 +461,7 @@ if ($search_product_category > 0) { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user AS u ON f.fk_user_author = u.rowid'; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = f.fk_projet"; // We'll need this table joined to the select in order to filter by sale -if ($search_sale > 0 || (!$user->rights->societe->client->voir && !$socid)) { +if ($search_sale > 0 || (empty($user->rights->societe->client->voir) && !$socid)) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } if ($search_user > 0) { @@ -474,7 +474,7 @@ $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object $sql .= $hookmanager->resPrint; $sql .= ' WHERE f.fk_soc = s.rowid'; $sql .= ' AND f.entity IN ('.getEntity('facture_fourn').')'; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($search_product_category > 0) { diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 1cc1a86fe4a..a29473eefd2 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -360,16 +360,16 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie $sql = 'SELECT s.nom as name, s.rowid as socid,'; $sql .= ' f.rowid, f.ref, f.ref_supplier, f.total_ttc as total, f.fk_mode_reglement, f.fk_account'; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", sc.fk_soc, sc.fk_user "; } $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'facture_fourn as f'; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= ' WHERE f.fk_soc = s.rowid'; $sql .= ' AND f.rowid = '.((int) $facid); - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } $resql = $db->query($sql); diff --git a/htdocs/fourn/facture/rapport.php b/htdocs/fourn/facture/rapport.php index fe2bb78008d..59b92f349c0 100644 --- a/htdocs/fourn/facture/rapport.php +++ b/htdocs/fourn/facture/rapport.php @@ -46,7 +46,7 @@ if ($user->socid > 0) { } $dir = $conf->fournisseur->facture->dir_output.'/payments'; -if (!$user->rights->societe->client->voir || $socid) { +if (empty($user->rights->societe->client->voir) || $socid) { $dir .= '/private/'.$user->id; // If user has no permission to see all, output dir is specific to user } diff --git a/htdocs/fourn/index.php b/htdocs/fourn/index.php index 44a689fcd80..7dfd17495c3 100644 --- a/htdocs/fourn/index.php +++ b/htdocs/fourn/index.php @@ -60,11 +60,11 @@ print '
    '; $sql = "SELECT count(cf.rowid), cf.fk_statut"; $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as cf,"; $sql .= " ".MAIN_DB_PREFIX."societe as s"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; } $sql .= " WHERE cf.fk_soc = s.rowid "; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND sc.fk_user = ".((int) $user->id); } $sql .= " AND cf.entity = ".$conf->entity; @@ -106,11 +106,11 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU $sql .= " s.nom as name, s.rowid as socid"; $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as cf"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; } $sql .= " WHERE cf.fk_soc = s.rowid"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND sc.fk_user = ".((int) $user->id); } $sql .= " AND cf.entity = ".$conf->entity; @@ -162,11 +162,11 @@ if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_S $sql .= ", s.nom as name, s.rowid as socid"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as ff"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; } $sql .= " WHERE s.rowid = ff.fk_soc"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND sc.fk_user = ".((int) $user->id); } $sql .= " AND ff.entity = ".$conf->entity; @@ -241,13 +241,13 @@ if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity); } $sql .= ", ".MAIN_DB_PREFIX."c_stcomm as st"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE s.fk_stcomm = st.id"; $sql .= " AND s.fournisseur = 1"; $sql .= " AND s.entity IN (".getEntity('societe').")"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { diff --git a/htdocs/fourn/paiement/list.php b/htdocs/fourn/paiement/list.php index 96af99d3f06..c4e18d50f90 100644 --- a/htdocs/fourn/paiement/list.php +++ b/htdocs/fourn/paiement/list.php @@ -177,7 +177,7 @@ $sql = 'SELECT p.rowid, p.ref, p.datep, p.amount as pamount, p.num_paiement'; $sql .= ', s.rowid as socid, s.nom as name, s.email'; $sql .= ', c.code as paiement_type, c.libelle as paiement_libelle'; $sql .= ', ba.rowid as bid, ba.label'; -if (!$user->rights->societe->client->voir) { +if (empty($user->rights->societe->client->voir)) { $sql .= ', sc.fk_soc, sc.fk_user'; } $sql .= ', SUM(pf.amount)'; @@ -189,12 +189,12 @@ $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement AS c ON p.fk_paiement = c.id'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe AS s ON s.rowid = f.fk_soc'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank_account as ba ON b.fk_account = ba.rowid'; -if (!$user->rights->societe->client->voir) { +if (empty($user->rights->societe->client->voir)) { $sql .= ', '.MAIN_DB_PREFIX.'societe_commerciaux as sc'; } $sql .= ' WHERE f.entity = '.$conf->entity; -if (!$user->rights->societe->client->voir) { +if (empty($user->rights->societe->client->voir)) { $sql .= ' AND s.rowid = sc.fk_soc AND sc.fk_user = '.((int) $user->id); } if ($socid > 0) { @@ -233,7 +233,7 @@ if ($search_all) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; $sql .= ' GROUP BY p.rowid, p.ref, p.datep, p.amount, p.num_paiement, s.rowid, s.nom, s.email, c.code, c.libelle, ba.rowid, ba.label'; -if (!$user->rights->societe->client->voir) { +if (empty($user->rights->societe->client->voir)) { $sql .= ', sc.fk_soc, sc.fk_user'; } diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index ec7ba9b74e3..ac9d01035af 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -189,7 +189,7 @@ if (!empty($conf->holiday->enabled) && $user->rights->holiday->read) { if (empty($user->rights->holiday->readall)) { $sql .= ' AND x.fk_user IN ('.$db->sanitize(join(',', $childids)).')'; } - //if (!$user->rights->societe->client->voir && !$user->socid) $sql.= " AND x.fk_soc = s. rowid AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); + //if (empty($user->rights->societe->client->voir) && !$user->socid) $sql.= " AND x.fk_soc = s. rowid AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); //if (!empty($socid)) $sql.= " AND x.fk_soc = ".((int) $socid); $sql .= $db->order("x.tms", "DESC"); $sql .= $db->plimit($max, 0); @@ -264,13 +264,13 @@ if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->lire) $sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.statut as user_status, u.photo,"; $sql .= " x.rowid, x.ref, x.date_debut as date, x.tms as dm, x.total_ttc, x.fk_statut as status"; $sql .= " FROM ".MAIN_DB_PREFIX."expensereport as x, ".MAIN_DB_PREFIX."user as u"; - //if (!$user->rights->societe->client->voir && !$user->socid) $sql.= ", ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + //if (empty($user->rights->societe->client->voir) && !$user->socid) $sql.= ", ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql .= " WHERE u.rowid = x.fk_user_author"; $sql .= " AND x.entity = ".$conf->entity; if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous)) { $sql .= ' AND x.fk_user_author IN ('.$db->sanitize(join(',', $childids)).')'; } - //if (!$user->rights->societe->client->voir && !$user->socid) $sql.= " AND x.fk_soc = s. rowid AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); + //if (empty($user->rights->societe->client->voir) && !$user->socid) $sql.= " AND x.fk_soc = s. rowid AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); //if (!empty($socid)) $sql.= " AND x.fk_soc = ".((int) $socid); $sql .= $db->order("x.tms", "DESC"); $sql .= $db->plimit($max, 0); @@ -339,11 +339,11 @@ if (!empty($conf->recruitment->enabled) && $user->rights->recruitment->recruitme $sql.= " rp.rowid as jobid, rp.ref as jobref, rp.label"; $sql .= " FROM ".MAIN_DB_PREFIX."recruitment_recruitmentcandidature as rc"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."recruitment_recruitmentjobposition as rp ON rc.fk_recruitmentjobposition = rp.rowid"; - if ($conf->societe->enabled && !$user->rights->societe->client->voir && !$socid) { + if ($conf->societe->enabled && empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE rc.entity IN (".getEntity($staticrecruitmentcandidature->element).")"; - if ($conf->societe->enabled && !$user->rights->societe->client->voir && !$socid) { + if ($conf->societe->enabled && empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND rp.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php index 6861f67db0d..7fe151b93f7 100644 --- a/htdocs/margin/customerMargins.php +++ b/htdocs/margin/customerMargins.php @@ -229,14 +229,14 @@ if (!empty($TSelectedCats)) { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=d.fk_product'; } -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE f.fk_soc = s.rowid"; if ($socid > 0) { $sql .= ' AND s.rowid = '.((int) $socid); } -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } $sql .= " AND f.fk_statut NOT IN (".$db->sanitize(implode(', ', $invoice_status_except_list)).")"; diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php index 3b14f1db808..062462be267 100644 --- a/htdocs/margin/tabs/productMargins.php +++ b/htdocs/margin/tabs/productMargins.php @@ -139,7 +139,7 @@ if ($id > 0 || !empty($ref)) { $sql = "SELECT s.nom as name, s.rowid as socid, s.code_client,"; $sql .= " f.rowid as facid, f.ref, f.total_ht,"; $sql .= " f.datef, f.paye, f.fk_statut as statut, f.type,"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " sc.fk_soc, sc.fk_user,"; } $sql .= " sum(d.total_ht) as selling_price,"; // may be negative or positive @@ -149,7 +149,7 @@ if ($id > 0 || !empty($ref)) { $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= ", ".MAIN_DB_PREFIX."facture as f"; $sql .= ", ".MAIN_DB_PREFIX."facturedet as d"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE f.fk_soc = s.rowid"; @@ -157,7 +157,7 @@ if ($id > 0 || !empty($ref)) { $sql .= " AND f.entity IN (".getEntity('invoice').")"; $sql .= " AND d.fk_facture = f.rowid"; $sql .= " AND d.fk_product = ".((int) $object->id); - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if (!empty($socid)) { @@ -170,7 +170,7 @@ if ($id > 0 || !empty($ref)) { $sql .= " AND d.buy_price_ht <> 0"; } $sql .= " GROUP BY s.nom, s.rowid, s.code_client, f.rowid, f.ref, f.total_ht, f.datef, f.paye, f.fk_statut, f.type"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", sc.fk_soc, sc.fk_user"; } $sql .= $db->order($sortfield, $sortorder); diff --git a/htdocs/product/stats/commande.php b/htdocs/product/stats/commande.php index 623306536b7..abfd329dfa4 100644 --- a/htdocs/product/stats/commande.php +++ b/htdocs/product/stats/commande.php @@ -139,13 +139,13 @@ if ($id > 0 || !empty($ref)) { $sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, s.code_client, c.rowid, d.total_ht as total_ht, c.ref,"; $sql .= " c.ref_client,"; $sql .= " c.date_commande, c.fk_statut as statut, c.facture, c.rowid as commandeid, d.rowid, d.qty"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", sc.fk_soc, sc.fk_user "; } $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= ", ".MAIN_DB_PREFIX."commande as c"; $sql .= ", ".MAIN_DB_PREFIX."commandedet as d"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE c.fk_soc = s.rowid"; @@ -158,7 +158,7 @@ if ($id > 0 || !empty($ref)) { if (!empty($search_year)) { $sql .= ' AND YEAR(c.date_commande) IN ('.$db->sanitize($search_year).')'; } - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { diff --git a/htdocs/product/stats/commande_fournisseur.php b/htdocs/product/stats/commande_fournisseur.php index fd64a1c0572..d9d81ad70dc 100644 --- a/htdocs/product/stats/commande_fournisseur.php +++ b/htdocs/product/stats/commande_fournisseur.php @@ -140,13 +140,13 @@ if ($id > 0 || !empty($ref)) { $sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, s.code_client,"; $sql .= " c.rowid, d.total_ht as total_ht, c.ref,"; $sql .= " c.date_commande, c.fk_statut as statut, c.rowid as commandeid, d.rowid, d.qty"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", sc.fk_soc, sc.fk_user "; } $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= ", ".MAIN_DB_PREFIX."commande_fournisseur as c"; $sql .= ", ".MAIN_DB_PREFIX."commande_fournisseurdet as d"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE c.fk_soc = s.rowid"; @@ -159,7 +159,7 @@ if ($id > 0 || !empty($ref)) { if (!empty($search_year)) { $sql .= ' AND YEAR(c.date_commande) IN ('.$db->sanitize($search_year).')'; } - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { diff --git a/htdocs/product/stats/contrat.php b/htdocs/product/stats/contrat.php index 65302ef2c7d..e44619d1b19 100644 --- a/htdocs/product/stats/contrat.php +++ b/htdocs/product/stats/contrat.php @@ -134,7 +134,7 @@ if ($id > 0 || !empty($ref)) { $sql .= " c.rowid as rowid, c.ref, c.ref_customer, c.ref_supplier, c.date_contrat, c.statut as statut,"; $sql .= " s.nom as name, s.rowid as socid, s.code_client"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= ", ".MAIN_DB_PREFIX."contrat as c"; @@ -143,7 +143,7 @@ if ($id > 0 || !empty($ref)) { $sql .= " AND c.fk_soc = s.rowid"; $sql .= " AND c.entity IN (".getEntity('contract').")"; $sql .= " AND cd.fk_product = ".((int) $product->id); - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index b3e5571ac5a..8da6e97f55c 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -156,13 +156,13 @@ if ($id > 0 || !empty($ref)) { $sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, s.code_client,"; $sql .= " f.ref, f.datef, f.paye, f.type, f.fk_statut as statut, f.rowid as facid,"; $sql .= " d.rowid, d.total_ht as total_ht, d.qty"; // We must keep the d.rowid here to not loose record because of the distinct used to ignore duplicate line when link on societe_commerciaux is used - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", sc.fk_soc, sc.fk_user "; } $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= ", ".MAIN_DB_PREFIX."facture as f"; $sql .= ", ".MAIN_DB_PREFIX."facturedet as d"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE f.fk_soc = s.rowid"; @@ -175,7 +175,7 @@ if ($id > 0 || !empty($ref)) { if (!empty($search_year)) { $sql .= ' AND YEAR(f.datef) IN ('.$db->sanitize($search_year).')'; } - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { diff --git a/htdocs/product/stats/facture_fournisseur.php b/htdocs/product/stats/facture_fournisseur.php index 212674582f9..d61b6de9491 100644 --- a/htdocs/product/stats/facture_fournisseur.php +++ b/htdocs/product/stats/facture_fournisseur.php @@ -139,13 +139,13 @@ if ($id > 0 || !empty($ref)) { if ($user->rights->fournisseur->facture->lire) { $sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, s.code_client, d.rowid, d.total_ht as line_total_ht,"; $sql .= " f.rowid as facid, f.ref, f.ref_supplier, f.datef, f.libelle as label, f.total_ht, f.total_ttc, f.total_tva, f.paye, f.fk_statut as statut, d.qty"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", sc.fk_soc, sc.fk_user "; } $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= ", ".MAIN_DB_PREFIX."facture_fourn as f"; $sql .= ", ".MAIN_DB_PREFIX."facture_fourn_det as d"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE f.fk_soc = s.rowid"; @@ -158,7 +158,7 @@ if ($id > 0 || !empty($ref)) { if (!empty($search_year)) { $sql .= ' AND YEAR(f.datef) IN ('.$db->sanitize($search_year).')'; } - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php index b83d0368b75..068184feb7e 100644 --- a/htdocs/product/stats/propal.php +++ b/htdocs/product/stats/propal.php @@ -141,13 +141,13 @@ if ($id > 0 || !empty($ref)) { $sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, p.rowid as propalid, p.ref, d.total_ht as amount,"; $sql .= " p.ref_client,"; $sql .= "p.datep, p.fk_statut as statut, d.rowid, d.qty"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", sc.fk_soc, sc.fk_user "; } $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= ",".MAIN_DB_PREFIX."propal as p"; $sql .= ", ".MAIN_DB_PREFIX."propaldet as d"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE p.fk_soc = s.rowid"; @@ -160,7 +160,7 @@ if ($id > 0 || !empty($ref)) { if (!empty($search_year)) { $sql .= ' AND YEAR(p.datep) IN ('.$db->sanitize($search_year).')'; } - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { diff --git a/htdocs/product/stats/supplier_proposal.php b/htdocs/product/stats/supplier_proposal.php index d583d58bff8..ab02e51fa57 100644 --- a/htdocs/product/stats/supplier_proposal.php +++ b/htdocs/product/stats/supplier_proposal.php @@ -140,13 +140,13 @@ if ($id > 0 || !empty($ref)) { $sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, p.rowid as propalid, p.ref, d.total_ht as amount,"; //$sql .= " p.ref_supplier,"; $sql .= "p.date_valid, p.fk_statut as statut, d.rowid, d.qty"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", sc.fk_soc, sc.fk_user "; } $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= ",".MAIN_DB_PREFIX."supplier_proposal as p"; $sql .= ", ".MAIN_DB_PREFIX."supplier_proposaldet as d"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE p.fk_soc = s.rowid"; @@ -159,7 +159,7 @@ if ($id > 0 || !empty($ref)) { if (!empty($search_year)) { $sql .= ' AND YEAR(p.datep) IN ('.$db->sanitize($search_year).')'; } - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { diff --git a/htdocs/product/stock/replenishorders.php b/htdocs/product/stock/replenishorders.php index 01a7e2dd1a3..a0138743f20 100644 --- a/htdocs/product/stock/replenishorders.php +++ b/htdocs/product/stock/replenishorders.php @@ -122,7 +122,7 @@ $sql .= ' cf.rowid, cf.ref, cf.fk_statut, cf.total_ttc, cf.fk_user_author,'; $sql .= ' u.login'; $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'commande_fournisseur as cf'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as u ON cf.fk_user_author = u.rowid'; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ', '.MAIN_DB_PREFIX.'societe_commerciaux as sc'; } $sql .= ' WHERE cf.fk_soc = s.rowid '; @@ -134,7 +134,7 @@ if ($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) { } else { $sql .= ' AND cf.fk_statut < 5'; } -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ' AND s.rowid = sc.fk_soc AND sc.fk_user = '.((int) $user->id); } if ($sref) { diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 240552ecc48..7e84683d5b3 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -2142,7 +2142,7 @@ class Task extends CommonObject $sql = "SELECT count(p.rowid) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON sc.fk_soc = s.rowid"; } $sql .= ", ".MAIN_DB_PREFIX."projet_task as t"; @@ -2156,7 +2156,7 @@ class Task extends CommonObject if ($socid) { $sql .= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".((int) $socid).")"; } - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND ((s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id).") OR (s.rowid IS NULL))"; } diff --git a/htdocs/projet/class/taskstats.class.php b/htdocs/projet/class/taskstats.class.php index 594ad38d723..a5b088f01e8 100644 --- a/htdocs/projet/class/taskstats.class.php +++ b/htdocs/projet/class/taskstats.class.php @@ -59,7 +59,7 @@ class TaskStats extends Stats $sql = "SELECT"; $sql .= " COUNT(t.rowid), t.priority"; $sql .= " FROM ".MAIN_DB_PREFIX."projet_task as t INNER JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = t.fk_projet"; - if (!$user->rights->societe->client->voir && !$user->soc_id) { + if (empty($user->rights->societe->client->voir) && !$user->soc_id) { $sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON sc.fk_soc=p.fk_soc AND sc.fk_user=".((int) $user->id); } $sql .= $this->buildWhere(); @@ -118,7 +118,7 @@ class TaskStats extends Stats $sql = "SELECT date_format(t.datec,'%Y') as year, COUNT(t.rowid) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."projet_task as t INNER JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = t.fk_projet"; - if (!$user->rights->societe->client->voir && !$user->soc_id) { + if (empty($user->rights->societe->client->voir) && !$user->soc_id) { $sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON sc.fk_soc=p.fk_soc AND sc.fk_user=".((int) $user->id); } $sql .= $this->buildWhere(); @@ -180,7 +180,7 @@ class TaskStats extends Stats $sql = "SELECT date_format(t.datec,'%m') as dm, COUNT(t.rowid) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."projet_task as t INNER JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = t.fk_projet"; - if (!$user->rights->societe->client->voir && !$user->soc_id) { + if (empty($user->rights->societe->client->voir) && !$user->soc_id) { $sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON sc.fk_soc=p.fk_soc AND sc.fk_user=".((int) $user->id); } $sql .= $this->buildWhere(); diff --git a/htdocs/reception/class/receptionstats.class.php b/htdocs/reception/class/receptionstats.class.php index 4055d5d5dfe..872d6845a96 100644 --- a/htdocs/reception/class/receptionstats.class.php +++ b/htdocs/reception/class/receptionstats.class.php @@ -70,7 +70,7 @@ class ReceptionStats extends Stats //$this->where.= " AND c.fk_soc = s.rowid AND c.entity = ".$conf->entity; $this->where .= " AND c.entity = ".$conf->entity; - if (!$user->rights->societe->client->voir && !$this->socid) { + if (empty($user->rights->societe->client->voir) && !$this->socid) { $this->where .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($this->socid) { @@ -93,7 +93,7 @@ class ReceptionStats extends Stats $sql = "SELECT date_format(c.date_valid,'%m') as dm, COUNT(*) as nb"; $sql .= " FROM ".$this->from; - if (!$user->rights->societe->client->voir && !$this->socid) { + if (empty($user->rights->societe->client->voir) && !$this->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE c.date_valid BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; @@ -117,7 +117,7 @@ class ReceptionStats extends Stats $sql = "SELECT date_format(c.date_valid,'%Y') as dm, COUNT(*) as nb, SUM(c.".$this->field.")"; $sql .= " FROM ".$this->from; - if (!$user->rights->societe->client->voir && !$this->socid) { + if (empty($user->rights->societe->client->voir) && !$this->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE ".$this->where; @@ -138,7 +138,7 @@ class ReceptionStats extends Stats $sql = "SELECT date_format(c.date_valid,'%Y') as year, COUNT(*) as nb, SUM(c.".$this->field.") as total, AVG(".$this->field.") as avg"; $sql .= " FROM ".$this->from; - if (!$user->rights->societe->client->voir && !$this->socid) { + if (empty($user->rights->societe->client->voir) && !$this->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE ".$this->where; diff --git a/htdocs/reception/index.php b/htdocs/reception/index.php index 948489aa843..965e3f12082 100644 --- a/htdocs/reception/index.php +++ b/htdocs/reception/index.php @@ -86,7 +86,7 @@ $sql .= " FROM ".MAIN_DB_PREFIX."reception as e"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON e.rowid = el.fk_target AND el.targettype = 'reception'"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."commande_fournisseur as c ON el.fk_source = c.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = e.fk_soc"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON e.fk_soc = sc.fk_soc"; $sql .= $clause." sc.fk_user = ".((int) $user->id); $clause = " AND "; @@ -151,11 +151,11 @@ $sql .= " FROM ".MAIN_DB_PREFIX."reception as e"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON e.rowid = el.fk_target AND el.targettype = 'reception' AND el.sourcetype IN ('order_supplier')"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."commande_fournisseur as c ON el.fk_source = c.rowid AND el.sourcetype IN ('order_supplier') AND el.targettype = 'reception'"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = e.fk_soc"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON e.fk_soc = sc.fk_soc"; } $sql .= " WHERE e.entity IN (".getEntity('reception').")"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND sc.fk_user = ".((int) $user->id); } $sql .= " AND e.fk_statut = 1"; @@ -212,7 +212,7 @@ if ($resql) { $sql = "SELECT c.rowid, c.ref, c.ref_supplier as ref_supplier, c.fk_statut as status, c.billed as billed, s.nom as name, s.rowid as socid"; $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c,"; $sql .= " ".MAIN_DB_PREFIX."societe as s"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE c.fk_soc = s.rowid"; @@ -221,7 +221,7 @@ $sql .= " AND c.fk_statut IN (".CommandeFournisseur::STATUS_ORDERSENT.", ".Comma if ($socid > 0) { $sql .= " AND c.fk_soc = ".((int) $socid); } -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } $sql .= " ORDER BY c.rowid ASC"; diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index 7e8e2e725ca..5a6db5b53b1 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -488,7 +488,7 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_ty $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as ee ON e.rowid = ee.fk_source AND ee.sourcetype = 'reception' AND ee.targettype = 'delivery'"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."delivery as l ON l.rowid = ee.fk_target"; -if (!$user->rights->societe->client->voir && !$socid) { // Internal user with no permission to see all +if (empty($user->rights->societe->client->voir) && !$socid) { // Internal user with no permission to see all $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } @@ -498,7 +498,7 @@ $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters); // Not $sql .= $hookmanager->resPrint; $sql .= " WHERE e.entity IN (".getEntity('reception').")"; -if (!$user->rights->societe->client->voir && !$socid) { // Internal user with no permission to see all +if (empty($user->rights->societe->client->voir) && !$socid) { // Internal user with no permission to see all $sql .= " AND e.fk_soc = sc.fk_soc"; $sql .= " AND sc.fk_user = ".((int) $user->id); } diff --git a/htdocs/reception/stats/index.php b/htdocs/reception/stats/index.php index 61098e74322..3e8ccb7f017 100644 --- a/htdocs/reception/stats/index.php +++ b/htdocs/reception/stats/index.php @@ -70,7 +70,7 @@ $data = $stats->getNbByMonthWithPrevYear($endyear, $startyear); // $data = array(array('Lib',val1,val2,val3),...) -if (!$user->rights->societe->client->voir || $user->socid) { +if (empty($user->rights->societe->client->voir) || $user->socid) { $filenamenb = $dir.'/receptionsnbinyear-'.$user->id.'-'.$year.'.png'; } else { $filenamenb = $dir.'/receptionsnbinyear-'.$year.'.png'; @@ -105,7 +105,7 @@ $data = $stats->getAmountByMonthWithPrevYear($endyear,$startyear); //var_dump($data); // $data = array(array('Lib',val1,val2,val3),...) -if (!$user->rights->societe->client->voir || $user->socid) +if (empty($user->rights->societe->client->voir) || $user->socid) { $filenameamount = $dir.'/receptionsamountinyear-'.$user->id.'-'.$year.'.png'; } @@ -143,7 +143,7 @@ if (! $mesg) /* $data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear); -if (!$user->rights->societe->client->voir || $user->socid) +if (empty($user->rights->societe->client->voir) || $user->socid) { $filename_avg = $dir.'/receptionsaverage-'.$user->id.'-'.$year.'.png'; } diff --git a/htdocs/recruitment/recruitmentindex.php b/htdocs/recruitment/recruitmentindex.php index 5473572f842..c0e5449b649 100644 --- a/htdocs/recruitment/recruitmentindex.php +++ b/htdocs/recruitment/recruitmentindex.php @@ -331,11 +331,11 @@ if (!empty($conf->recruitment->enabled) && $user->rights->recruitment->recruitme $sql = "SELECT s.rowid, s.ref, s.label, s.date_creation, s.tms, s.status, COUNT(rc.rowid) as nbapplications"; $sql .= " FROM ".MAIN_DB_PREFIX."recruitment_recruitmentjobposition as s"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."recruitment_recruitmentcandidature as rc ON rc.fk_recruitmentjobposition = s.rowid"; - if ($conf->societe->enabled && !$user->rights->societe->client->voir && !$socid) { + if ($conf->societe->enabled && empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE s.entity IN (".getEntity($staticrecruitmentjobposition->element).")"; - if ($conf->societe->enabled && !$user->rights->societe->client->voir && !$socid) { + if ($conf->societe->enabled && empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { @@ -402,11 +402,11 @@ if (!empty($conf->recruitment->enabled) && $user->rights->recruitment->recruitme $sql = "SELECT rc.rowid, rc.ref, rc.email, rc.lastname, rc.firstname, rc.date_creation, rc.tms, rc.status"; $sql .= " FROM ".MAIN_DB_PREFIX."recruitment_recruitmentcandidature as rc"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."recruitment_recruitmentjobposition as s ON rc.fk_recruitmentjobposition = s.rowid"; - if ($conf->societe->enabled && !$user->rights->societe->client->voir && !$socid) { + if ($conf->societe->enabled && empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE rc.entity IN (".getEntity($staticrecruitmentjobposition->element).")"; - if ($conf->societe->enabled && !$user->rights->societe->client->voir && !$socid) { + if ($conf->societe->enabled && empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { diff --git a/htdocs/societe/class/client.class.php b/htdocs/societe/class/client.class.php index 91e8cbc290b..4e55a914339 100644 --- a/htdocs/societe/class/client.class.php +++ b/htdocs/societe/class/client.class.php @@ -64,7 +64,7 @@ class Client extends Societe $sql = "SELECT count(s.rowid) as nb, s.client"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; $sql .= " WHERE sc.fk_user = ".((int) $user->id); $clause = "AND"; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 460ee6d798a..416c16e46a3 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2703,7 +2703,7 @@ class Societe extends CommonObject $linkend = ''; global $user; - if (!$user->rights->societe->client->voir && $user->socid > 0 && $this->id != $user->socid) { + if (empty($user->rights->societe->client->voir) && $user->socid > 0 && $this->id != $user->socid) { $linkstart = ''; $linkend = ''; } diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index de3bae16627..b66d82df1e7 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -94,11 +94,11 @@ $total = 0; $sql = "SELECT s.rowid, s.client, s.fournisseur"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= ' WHERE s.entity IN ('.getEntity('societe').')'; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid > 0) { @@ -277,11 +277,11 @@ $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity); } -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= ' WHERE s.entity IN ('.getEntity('societe').')'; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index de73b7a0296..907c3bf26c3 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -1935,17 +1935,17 @@ class SupplierProposal extends CommonObject $sql = "SELECT s.rowid, s.nom as name, s.client,"; $sql .= " p.rowid as supplier_proposalid, p.fk_statut, p.total_ht, p.ref, p.remise, "; $sql .= " p.datep as dp, p.fin_validite as datelimite"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", sc.fk_soc, sc.fk_user"; } $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."supplier_proposal as p, ".MAIN_DB_PREFIX."c_propalst as c"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE p.entity IN (".getEntity('supplier_proposal').")"; $sql .= " AND p.fk_soc = s.rowid"; $sql .= " AND p.fk_statut = c.id"; - if (!$user->rights->societe->client->voir && !$socid) { //restriction + if (empty($user->rights->societe->client->voir) && !$socid) { //restriction $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { @@ -2218,7 +2218,7 @@ class SupplierProposal extends CommonObject $sql = "SELECT p.rowid, p.ref, p.datec as datec, p.date_cloture as datefin"; $sql .= " FROM ".MAIN_DB_PREFIX."supplier_proposal as p"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON p.fk_soc = sc.fk_soc"; $sql .= " WHERE sc.fk_user = ".((int) $user->id); $clause = " AND"; @@ -2375,7 +2375,7 @@ class SupplierProposal extends CommonObject $sql = "SELECT count(p.rowid) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."supplier_proposal as p"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON p.fk_soc = s.rowid"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; $sql .= " WHERE sc.fk_user = ".((int) $user->id); $clause = "AND"; diff --git a/htdocs/supplier_proposal/index.php b/htdocs/supplier_proposal/index.php index ac937fe480d..04eff4ce896 100644 --- a/htdocs/supplier_proposal/index.php +++ b/htdocs/supplier_proposal/index.php @@ -66,7 +66,7 @@ print '
    '; $sql = "SELECT count(p.rowid), p.fk_statut"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= ", ".MAIN_DB_PREFIX."supplier_proposal as p"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE p.fk_soc = s.rowid"; @@ -74,7 +74,7 @@ $sql .= " AND p.entity IN (".getEntity('supplier_proposal').")"; if ($user->socid) { $sql .= ' AND p.fk_soc = '.((int) $user->socid); } -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } $sql .= " AND p.fk_statut IN (0,1,2,3,4)"; @@ -166,7 +166,7 @@ if (!empty($conf->supplier_proposal->enabled)) { $sql = "SELECT c.rowid, c.ref, s.nom as socname, s.rowid as socid, s.canvas, s.client"; $sql .= " FROM ".MAIN_DB_PREFIX."supplier_proposal as c"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE c.fk_soc = s.rowid"; @@ -175,7 +175,7 @@ if (!empty($conf->supplier_proposal->enabled)) { if ($socid) { $sql .= " AND c.fk_soc = ".((int) $socid); } - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } @@ -224,7 +224,7 @@ $sql = "SELECT c.rowid, c.ref, c.fk_statut, s.nom as socname, s.rowid as socid, $sql .= " date_cloture as datec"; $sql .= " FROM ".MAIN_DB_PREFIX."supplier_proposal as c"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE c.fk_soc = s.rowid"; @@ -233,7 +233,7 @@ $sql .= " AND c.entity = ".$conf->entity; if ($socid) { $sql .= " AND c.fk_soc = ".((int) $socid); } -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } $sql .= " ORDER BY c.tms DESC"; @@ -305,13 +305,13 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa $sql = "SELECT s.nom as socname, s.rowid as socid, s.canvas, s.client, p.rowid as supplier_proposalid, p.total_ttc, p.total_tva, p.total_ht, p.ref, p.fk_statut, p.datec as dp"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= ", ".MAIN_DB_PREFIX."supplier_proposal as p"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE p.fk_soc = s.rowid"; $sql .= " AND p.entity IN (".getEntity('supplier_proposal').")"; $sql .= " AND p.fk_statut = 1"; - if (!$user->rights->societe->client->voir && !$socid) { + if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 71cd1c1fa69..d34d3ae01e0 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -299,7 +299,7 @@ $sql .= ' sp.rowid, sp.note_public, sp.note_private, sp.total_ht, sp.total_tva, $sql .= ' sp.fk_multicurrency, sp.multicurrency_code, sp.multicurrency_tx, sp.multicurrency_total_ht, sp.multicurrency_total_tva as multicurrency_total_vat, sp.multicurrency_total_ttc,'; $sql .= ' sp.datec as date_creation, sp.tms as date_update,'; $sql .= " p.rowid as project_id, p.ref as project_ref,"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " sc.fk_soc, sc.fk_user,"; } $sql .= " u.firstname, u.lastname, u.photo, u.login"; @@ -330,7 +330,7 @@ if ($search_product_category > 0) { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as u ON sp.fk_user_author = u.rowid'; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = sp.fk_projet"; // We'll need this table joined to the select in order to filter by sale -if ($search_sale > 0 || (!$user->rights->societe->client->voir && !$socid)) { +if ($search_sale > 0 || (empty($user->rights->societe->client->voir) && !$socid)) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } if ($search_user > 0) { @@ -339,7 +339,7 @@ if ($search_user > 0) { } $sql .= ' WHERE sp.fk_soc = s.rowid'; $sql .= ' AND sp.entity IN ('.getEntity('supplier_proposal').')'; -if (!$user->rights->societe->client->voir && !$socid) { //restriction +if (empty($user->rights->societe->client->voir) && !$socid) { //restriction $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($search_town) { diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 2fad1afd8ab..bdbd975b87e 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -704,7 +704,7 @@ class Ticket extends CommonObject if (is_array($extrafields->attributes[$this->table_element]['label']) && count($extrafields->attributes[$this->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."ticket_extrafields as ef on (t.rowid = ef.fk_object)"; } - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } @@ -728,7 +728,7 @@ class Ticket extends CommonObject } } } - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " AND t.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } elseif ($user->socid) { $sql .= " AND t.fk_soc = ".((int) $user->socid); @@ -2850,7 +2850,7 @@ class Ticket extends CommonObject $sql = "SELECT p.rowid, p.ref, p.datec as datec"; $sql .= " FROM ".MAIN_DB_PREFIX."ticket as p"; - if ($conf->societe->enabled && !$user->rights->societe->client->voir && !$user->socid) { + if ($conf->societe->enabled && empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON p.fk_soc = sc.fk_soc"; $sql .= " WHERE sc.fk_user = ".((int) $user->id); $clause = " AND"; @@ -2916,7 +2916,7 @@ class Ticket extends CommonObject $sql = "SELECT count(p.rowid) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."ticket as p"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON p.fk_soc = s.rowid"; - if (!$user->rights->societe->client->voir && !$user->socid) { + if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; $sql .= " WHERE sc.fk_user = ".((int) $user->id); $clause = "AND"; diff --git a/htdocs/ticket/index.php b/htdocs/ticket/index.php index 315e93f153f..bf3f6601754 100644 --- a/htdocs/ticket/index.php +++ b/htdocs/ticket/index.php @@ -148,13 +148,13 @@ $tick = array( $sql = "SELECT t.fk_statut, COUNT(t.fk_statut) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."ticket as t"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= ' WHERE t.entity IN ('.getEntity('ticket').')'; $sql .= dolSqlDateFilter('datec', 0, 0, $endyear); -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND t.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } @@ -319,13 +319,13 @@ $sql .= " FROM ".MAIN_DB_PREFIX."ticket as t"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_type as type ON type.code=t.type_code"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_category as category ON category.code=t.category_code"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_severity as severity ON severity.code=t.severity_code"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= ' WHERE t.entity IN ('.getEntity('ticket').')'; $sql .= " AND t.fk_statut=0"; -if (!$user->rights->societe->client->voir && !$socid) { +if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND t.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } diff --git a/htdocs/ticket/stats/index.php b/htdocs/ticket/stats/index.php index 6e87cd42854..1a50d709514 100644 --- a/htdocs/ticket/stats/index.php +++ b/htdocs/ticket/stats/index.php @@ -82,7 +82,7 @@ $data = $stats->getNbByMonthWithPrevYear($endyear, $startyear); // $data = array(array('Lib',val1,val2,val3),...) -if (!$user->rights->societe->client->voir || $user->socid) { +if (empty($user->rights->societe->client->voir) || $user->socid) { $filenamenb = $dir.'/ticketsnbinyear-'.$user->id.'-'.$year.'.png'; $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=ticketstats&file=ticketsnbinyear-'.$user->id.'-'.$year.'.png'; } else { @@ -118,7 +118,7 @@ $data = $stats->getAmountByMonthWithPrevYear($endyear, $startyear); //var_dump($data); // $data = array(array('Lib',val1,val2,val3),...) -if (!$user->rights->societe->client->voir || $user->socid) { +if (empty($user->rights->societe->client->voir) || $user->socid) { $filenameamount = $dir.'/ticketsamountinyear-'.$user->id.'-'.$year.'.png'; $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=ticketstats&file=ticketsamountinyear-'.$user->id.'-'.$year.'.png'; } else { @@ -152,7 +152,7 @@ if (!$mesg) { $data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear); -if (!$user->rights->societe->client->voir || $user->socid) { +if (empty($user->rights->societe->client->voir) || $user->socid) { $filename_avg = $dir.'/ticketsaverage-'.$user->id.'-'.$year.'.png'; $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=ticketstats&file=ticketsaverage-'.$user->id.'-'.$year.'.png'; } else { From fafabe3be2730d0c0ccf8449f02ca8607bd4dc9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 22 Oct 2021 22:22:55 +0200 Subject: [PATCH 1116/1460] fix multiple warnings --- htdocs/core/class/html.formcontract.class.php | 2 +- htdocs/core/class/html.formintervention.class.php | 2 +- htdocs/core/class/html.formprojet.class.php | 2 +- htdocs/core/lib/security.lib.php | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/html.formcontract.class.php b/htdocs/core/class/html.formcontract.class.php index 5db615f4654..1909a4fb6c3 100644 --- a/htdocs/core/class/html.formcontract.class.php +++ b/htdocs/core/class/html.formcontract.class.php @@ -104,7 +104,7 @@ class FormContract while ($i < $num) { $obj = $this->db->fetch_object($resql); // If we ask to filter on a company and user has no permission to see all companies and project is linked to another company, we hide project. - if ($socid > 0 && (empty($obj->fk_soc) || $obj->fk_soc == $socid) && !$user->rights->societe->lire) { + if ($socid > 0 && (empty($obj->fk_soc) || $obj->fk_soc == $socid) && empty($user->rights->societe->lire)) { // Do nothing } else { $labeltoshow = dol_trunc($obj->ref, 18); diff --git a/htdocs/core/class/html.formintervention.class.php b/htdocs/core/class/html.formintervention.class.php index b9564c6aa52..60656128b64 100644 --- a/htdocs/core/class/html.formintervention.class.php +++ b/htdocs/core/class/html.formintervention.class.php @@ -99,7 +99,7 @@ class FormIntervention while ($i < $num) { $obj = $this->db->fetch_object($resql); // If we ask to filter on a company and user has no permission to see all companies and project is linked to another company, we hide project. - if ($socid > 0 && (empty($obj->fk_soc) || $obj->fk_soc == $socid) && !$user->rights->societe->lire) { + if ($socid > 0 && (empty($obj->fk_soc) || $obj->fk_soc == $socid) && empty($user->rights->societe->lire)) { // Do nothing } else { $labeltoshow = dol_trunc($obj->ref, 18); diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index 18b42c597bf..34ea7b0a2e8 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -207,7 +207,7 @@ class FormProjets while ($i < $num) { $obj = $this->db->fetch_object($resql); // If we ask to filter on a company and user has no permission to see all companies and project is linked to another company, we hide project. - if ($socid > 0 && (empty($obj->fk_soc) || $obj->fk_soc == $socid) && !$user->rights->societe->lire) { + if ($socid > 0 && (empty($obj->fk_soc) || $obj->fk_soc == $socid) && empty($user->rights->societe->lire)) { // Do nothing } else { if ($discard_closed == 1 && $obj->fk_statut == 2 && $obj->rowid != $selected) { // We discard closed except if selected diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 554fcba9370..37e98c0d91a 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -279,12 +279,12 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f } if ($feature == 'societe') { - if (!$user->rights->societe->lire && !$user->rights->fournisseur->lire) { + if (empty($user->rights->societe->lire) && !$user->rights->fournisseur->lire) { $readok = 0; $nbko++; } } elseif ($feature == 'contact') { - if (!$user->rights->societe->contact->lire) { + if (empty($user->rights->societe->contact->lire)) { $readok = 0; $nbko++; } @@ -370,12 +370,12 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f if ($wemustcheckpermissionforcreate || $wemustcheckpermissionfordeletedraft) { foreach ($featuresarray as $feature) { if ($feature == 'contact') { - if (!$user->rights->societe->contact->creer) { + if (empty($user->rights->societe->contact->creer)) { $createok = 0; $nbko++; } } elseif ($feature == 'produit|service') { - if (!$user->rights->produit->creer && !$user->rights->service->creer) { + if (empty($user->rights->produit->creer) && empty($user->rights->service->creer)) { $createok = 0; $nbko++; } From 6ec183cc3a68bcbf4db113863b54028c07fe4a6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 22 Oct 2021 22:32:01 +0200 Subject: [PATCH 1117/1460] fix warnings --- htdocs/projet/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index 213691f4e25..8b592373748 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -200,7 +200,7 @@ print_projecttasks_array($db, $form, $socid, $projectsListId, 0, 0, $listofoppst print '
    '; // Latest modified projects -$sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut as status, p.tms as datem"; +$sql = "SELECT p.rowid, p.ref, p.title, p.dateo, p.datee, p.fk_statut as status, p.tms as datem"; $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"; @@ -240,7 +240,7 @@ if ($resql) { $projectstatic->ref = $obj->ref; $projectstatic->title = $obj->title; $projectstatic->dateo = $obj->dateo; - $projectstatic->datep = $obj->datep; + $projectstatic->datee = $obj->datee; $projectstatic->thirdparty_name = $obj->name; $projectstatic->status = $obj->status; From 1f1e01aa88ee4a7bc72184cbeedf2f6585dedf04 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 22 Oct 2021 23:38:35 +0200 Subject: [PATCH 1118/1460] fix php 8 warning --- htdocs/comm/action/card.php | 2 +- htdocs/contact/list.php | 1 + htdocs/product/card.php | 7 ++-- htdocs/product/fournisseurs.php | 57 ++++++++++++++++++--------------- 4 files changed, 37 insertions(+), 30 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index e56a2e89fcf..f852d7e9938 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -2207,7 +2207,7 @@ if ($id > 0) { $delallowed = $user->rights->agenda->myactions->create; - print $formfile->showdocuments('actions', $object->id, $filedir, $urlsource, $genallowed, $delallowed, '', 0, 0, 0, 0, 0, '', '', '', $object->default_lang); + print $formfile->showdocuments('actions', $object->id, $filedir, $urlsource, $genallowed, $delallowed, '', 0, 0, 0, 0, 0, '', '', '', $langs->getDefaultLang()); print '
    '; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 71e888540b2..3808c651cae 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -1019,6 +1019,7 @@ print "\n"; $i = 0; $totalarray = array(); +$totalarray['nbfield'] = 0; while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); diff --git a/htdocs/product/card.php b/htdocs/product/card.php index b4c951a953f..ce633975af8 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -2175,8 +2175,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''.$langs->trans("ManageLotSerial").''; print $object->getLibStatut(0, 2); print ''; - if ((($object->status_batch == '1' && $conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS && $conf->global->PRODUCTBATCH_LOT_ADDON == 'mod_lot_advanced') - || ($object->status_batch == '2' && $conf->global->PRODUCTBATCH_SN_ADDON == 'mod_sn_advanced' && $conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS))) { + if ((($object->status_batch == '1' && !empty($conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS) && $conf->global->PRODUCTBATCH_LOT_ADDON == 'mod_lot_advanced') + || ($object->status_batch == '2' && $conf->global->PRODUCTBATCH_SN_ADDON == 'mod_sn_advanced' && !empty($conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS)))) { print ''.$langs->trans("ManageLotMask").''; print $object->batch_mask; print ''; @@ -2686,7 +2686,6 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete') { // Documents $objectref = dol_sanitizeFileName($object->ref); - $relativepath = $comref.'/'.$objectref.'.pdf'; if (!empty($conf->product->multidir_output[$object->entity])) { $filedir = $conf->product->multidir_output[$object->entity].'/'.$objectref; //Check repertories of current entities } else { @@ -2696,7 +2695,7 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete') { $genallowed = $usercanread; $delallowed = $usercancreate; - print $formfile->showdocuments($modulepart, $object->ref, $filedir, $urlsource, $genallowed, $delallowed, '', 0, 0, 0, 28, 0, '', 0, '', $object->default_lang, '', $object); + print $formfile->showdocuments($modulepart, $object->ref, $filedir, $urlsource, $genallowed, $delallowed, '', 0, 0, 0, 28, 0, '', 0, '', $langs->getDefaultLang(), '', $object); $somethingshown = $formfile->numoffiles; print '
    '; diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index a3ae38184e9..02e0211c01d 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -931,7 +931,7 @@ END; 'pfp.fk_availability'=>array('label'=>$langs->trans("Availability"), 'enabled' => !empty($conf->global->FOURN_PRODUCT_AVAILABILITY), 'checked'=>0, 'position'=>4), 'pfp.quantity'=>array('label'=>$langs->trans("QtyMin"), 'checked'=>1, 'position'=>5), 'pfp.unitprice'=>array('label'=>$langs->trans("UnitPriceHT"), 'checked'=>1, 'position'=>9), - 'pfp.multicurrency_unitprice'=>array('label'=>$langs->trans("UnitPriceHTCurrency"), 'enabled' => $conf->multicurrency->enabled, 'checked'=>0, 'position'=>10), + 'pfp.multicurrency_unitprice'=>array('label'=>$langs->trans("UnitPriceHTCurrency"), 'enabled' => (!empty($conf->multicurrency->enabled)), 'checked'=>0, 'position'=>10), 'pfp.delivery_time_days'=>array('label'=>$langs->trans("NbDaysToDelivery"), 'checked'=>1, 'position'=>13), 'pfp.supplier_reputation'=>array('label'=>$langs->trans("ReputationForThisProduct"), 'checked'=>1, 'position'=>14), 'pfp.fk_barcode_type'=>array('label'=>$langs->trans("BarcodeType"), 'enabled' => $conf->barcode->enabled, 'checked'=>0, 'position'=>15), @@ -942,14 +942,19 @@ END; // fetch optionals attributes and labels $extrafields->fetch_name_optionals_label("product_fournisseur_price"); - $extralabels = $extrafields->attributes["product_fournisseur_price"]['label']; + if ($extrafields->attributes["product_fournisseur_price"] && array_key_exists('label', $extrafields->attributes["product_fournisseur_price"])) { + $extralabels = $extrafields->attributes["product_fournisseur_price"]['label']; - if (!empty($extralabels)) { - foreach ($extralabels as $key => $value) { - // Show field if not hidden - if (!empty($extrafields->attributes["product_fournisseur_price"]['list'][$key]) && $extrafields->attributes["product_fournisseur_price"]['list'][$key] != 3) { - $extratitle = $langs->trans($value); - $arrayfields['ef.'.$key] = array('label'=>$extratitle, 'checked'=>0, 'position'=>(end($arrayfields)['position'] + 1), 'langfile'=>$extrafields->attributes["product_fournisseur_price"]['langfile'][$key], 'help'=>$extrafields->attributes["product_fournisseur_price"]['help'][$key]); + if (!empty($extralabels)) { + foreach ($extralabels as $key => $value) { + // Show field if not hidden + if (!empty($extrafields->attributes["product_fournisseur_price"]['list'][$key]) && $extrafields->attributes["product_fournisseur_price"]['list'][$key] != 3) { + $extratitle = $langs->trans($value); + $arrayfields['ef.' . $key] = array('label' => $extratitle, 'checked' => 0, + 'position' => (end($arrayfields)['position'] + 1), + 'langfile' => $extrafields->attributes["product_fournisseur_price"]['langfile'][$key], + 'help' => $extrafields->attributes["product_fournisseur_price"]['help'][$key]); + } } } } @@ -1023,29 +1028,31 @@ END; // fetch optionals attributes and labels $extrafields->fetch_name_optionals_label("product_fournisseur_price"); - $extralabels = $extrafields->attributes["product_fournisseur_price"]['label']; + if ($extrafields->attributes["product_fournisseur_price"] && array_key_exists('label', $extrafields->attributes["product_fournisseur_price"])) { + $extralabels = $extrafields->attributes["product_fournisseur_price"]['label']; - if (!empty($extralabels)) { - foreach ($extralabels as $key => $value) { - // Show field if not hidden - if (!empty($extrafields->attributes["product_fournisseur_price"]['list'][$key]) && $extrafields->attributes["product_fournisseur_price"]['list'][$key] != 3) { - if (!empty($extrafields->attributes["product_fournisseur_price"]['langfile'][$key])) { - $langs->load($extrafields->attributes["product_fournisseur_price"]['langfile'][$key]); - } - if (!empty($extrafields->attributes["product_fournisseur_price"]['help'][$key])) { - $extratitle = $form->textwithpicto($langs->trans($value), $langs->trans($extrafields->attributes["product_fournisseur_price"]['help'][$key])); - } else { - $extratitle = $langs->trans($value); - } - if (!empty($arrayfields['ef.'.$key]['checked'])) { - print_liste_field_titre($extratitle, $_SERVER["PHP_SELF"], 'ef.'.$key, '', $param, '', $sortfield, $sortorder, 'right '); + if (!empty($extralabels)) { + foreach ($extralabels as $key => $value) { + // Show field if not hidden + if (!empty($extrafields->attributes["product_fournisseur_price"]['list'][$key]) && $extrafields->attributes["product_fournisseur_price"]['list'][$key] != 3) { + if (!empty($extrafields->attributes["product_fournisseur_price"]['langfile'][$key])) { + $langs->load($extrafields->attributes["product_fournisseur_price"]['langfile'][$key]); + } + if (!empty($extrafields->attributes["product_fournisseur_price"]['help'][$key])) { + $extratitle = $form->textwithpicto($langs->trans($value), $langs->trans($extrafields->attributes["product_fournisseur_price"]['help'][$key])); + } else { + $extratitle = $langs->trans($value); + } + if (!empty($arrayfields['ef.' . $key]['checked'])) { + print_liste_field_titre($extratitle, $_SERVER["PHP_SELF"], 'ef.' . $key, '', $param, '', $sortfield, $sortorder, 'right '); + } } } } } if (is_object($hookmanager)) { - $parameters = array('id_fourn'=>$id_fourn, 'prod_id'=>$object->id); + $parameters = array('id_fourn'=>(!empty($id_fourn)?$id_fourn:''), 'prod_id'=>$object->id); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); } print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); @@ -1213,7 +1220,7 @@ END; } if (is_object($hookmanager)) { - $parameters = array('id_pfp'=>$productfourn->product_fourn_price_id, 'id_fourn'=>$id_fourn, 'prod_id'=>$object->id); + $parameters = array('id_pfp'=>$productfourn->product_fourn_price_id, 'id_fourn'=>(!empty($id_fourn)?$id_fourn:''), 'prod_id'=>$object->id); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); } From 55cdb8ac6fc66475401a57624bdf61639a0ec71f Mon Sep 17 00:00:00 2001 From: John BOTELLA Date: Sat, 23 Oct 2021 01:00:24 +0200 Subject: [PATCH 1119/1460] Fix numeric value --- htdocs/core/class/commonobject.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index f89c8025333..408e32626d0 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7693,7 +7693,7 @@ abstract class CommonObject $langs->load($extrafields->attributes[$this->table_element]['langfile'][$key]); } - $colspan = ''; + $colspan = 0; if (is_array($params) && count($params) > 0 && $display_type=='card') { if (array_key_exists('cols', $params)) { $colspan = $params['cols']; @@ -7706,6 +7706,7 @@ abstract class CommonObject } } } + $colspan = intval($colspan); switch ($mode) { case "view": @@ -7772,7 +7773,7 @@ abstract class CommonObject $html_id = (empty($this->id) ? '' : 'extrarow-'.$this->element.'_'.$key.'_'.$this->id); if ($display_type=='card') { if (!empty($conf->global->MAIN_EXTRAFIELDS_USE_TWO_COLUMS) && ($e % 2) == 0) { - $colspan = '0'; + $colspan = 0; } if ($action == 'selectlines') { From 5275d3cd48411596ce600546c98e68ef7deadd67 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 23 Oct 2021 02:20:06 +0200 Subject: [PATCH 1120/1460] Fix #19083 : wrong field list in sql request --- htdocs/recruitment/recruitmentcandidature_list.php | 6 ++---- htdocs/recruitment/recruitmentjobposition_list.php | 3 ++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/htdocs/recruitment/recruitmentcandidature_list.php b/htdocs/recruitment/recruitmentcandidature_list.php index 7a5a88bc6c4..30e147f355d 100644 --- a/htdocs/recruitment/recruitmentcandidature_list.php +++ b/htdocs/recruitment/recruitmentcandidature_list.php @@ -237,13 +237,11 @@ $title = $langs->trans('ListOfCandidatures'); // Build and execute select // -------------------------------------------------------------------- $sql = 'SELECT '; -foreach ($object->fields as $key => $val) { - $sql .= 't.'.$key.', '; -} +$sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.' as options_'.$key.', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : ''); } } // Add fields from hooks diff --git a/htdocs/recruitment/recruitmentjobposition_list.php b/htdocs/recruitment/recruitmentjobposition_list.php index c82c8312b40..de4905aa337 100644 --- a/htdocs/recruitment/recruitmentjobposition_list.php +++ b/htdocs/recruitment/recruitmentjobposition_list.php @@ -243,10 +243,11 @@ $title = $langs->trans('ListOfPositionsToBeFilled'); // -------------------------------------------------------------------- $sql = 'SELECT '; $sql .= $object->getFieldList('t'); + // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key.', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : ''); } } // Add fields from hooks From 604052d1a1bf4e80359fcac9489e74dfd4f4ae38 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 23 Oct 2021 02:28:53 +0200 Subject: [PATCH 1121/1460] Fix #19070 : Api subproducts was returning false --- htdocs/product/class/api_products.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 189161712d5..2d6c627ec41 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -405,7 +405,7 @@ class Products extends DolibarrApi $childsArbo = $this->product->getChildsArbo($id, 1); - $keys = ['rowid', 'qty', 'fk_product_type', 'label', 'incdec']; + $keys = ['rowid', 'qty', 'fk_product_type', 'label', 'incdec', 'ref']; $childs = []; foreach ($childsArbo as $values) { $childs[] = array_combine($keys, $values); From 2d92e6006ce537dace06539cf96f96918adfea89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 23 Oct 2021 07:04:13 +0200 Subject: [PATCH 1122/1460] fix warnings --- htdocs/comm/action/class/actioncomm.class.php | 4 ++-- htdocs/comm/action/index.php | 6 +++--- htdocs/comm/action/list.php | 6 +++--- htdocs/comm/action/pertype.php | 6 +++--- htdocs/comm/action/peruser.php | 6 +++--- htdocs/core/boxes/box_actions.php | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 02617f7b52a..3e2520f43da 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1330,7 +1330,7 @@ class ActionComm extends CommonObject if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc"; } - if (!$user->rights->agenda->allactions->read) { + if (empty($user->rights->agenda->allactions->read)) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."actioncomm_resources AS ar ON a.id = ar.fk_actioncomm AND ar.element_type ='user' AND ar.fk_element = ".((int) $user->id); } $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid"; @@ -1345,7 +1345,7 @@ class ActionComm extends CommonObject if ($user->socid) { $sql .= " AND a.fk_soc = ".((int) $user->socid); } - if (!$user->rights->agenda->allactions->read) { + if (empty($user->rights->agenda->allactions->read)) { $sql .= " AND (a.fk_user_author = ".((int) $user->id)." OR a.fk_user_action = ".((int) $user->id)." OR a.fk_user_done = ".((int) $user->id); $sql .= " OR ar.fk_element = ".((int) $user->id); $sql .= ")"; diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index eff302e699e..5f7349fab3c 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -86,13 +86,13 @@ if ($socid < 0) { } $canedit = 1; -if (!$user->rights->agenda->myactions->read) { +if (empty($user->rights->agenda->myactions->read)) { accessforbidden(); } -if (!$user->rights->agenda->allactions->read) { +if (empty($user->rights->agenda->allactions->read)) { $canedit = 0; } -if (!$user->rights->agenda->allactions->read || $filter == 'mine') { // If no permission to see all, we show only affected to me +if (empty($user->rights->agenda->allactions->read) || $filter == 'mine') { // If no permission to see all, we show only affected to me $filtert = $user->id; } diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 7c70803300e..985a403b086 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -136,13 +136,13 @@ if ($socid < 0) { } $canedit = 1; -if (!$user->rights->agenda->myactions->read) { +if (empty($user->rights->agenda->myactions->read)) { accessforbidden(); } -if (!$user->rights->agenda->allactions->read) { +if (empty($user->rights->agenda->allactions->read)) { $canedit = 0; } -if (!$user->rights->agenda->allactions->read || $filter == 'mine') { // If no permission to see all, we show only affected to me +if (empty($user->rights->agenda->allactions->read) || $filter == 'mine') { // If no permission to see all, we show only affected to me $filtert = $user->id; } diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index 541a05a208f..55540b3006f 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -80,13 +80,13 @@ if ($socid < 0) { } $canedit = 1; -if (!$user->rights->agenda->myactions->read) { +if (empty($user->rights->agenda->myactions->read)) { accessforbidden(); } -if (!$user->rights->agenda->allactions->read) { +if (empty($user->rights->agenda->allactions->read)) { $canedit = 0; } -if (!$user->rights->agenda->allactions->read || $filter == 'mine') { // If no permission to see all, we show only affected to me +if (empty($user->rights->agenda->allactions->read) || $filter == 'mine') { // If no permission to see all, we show only affected to me $filtert = $user->id; } diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index c0f59a7f90b..0148170d316 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -80,13 +80,13 @@ if ($socid < 0) { } $canedit = 1; -if (!$user->rights->agenda->myactions->read) { +if (empty($user->rights->agenda->myactions->read)) { accessforbidden(); } -if (!$user->rights->agenda->allactions->read) { +if (empty($user->rights->agenda->allactions->read)) { $canedit = 0; } -if (!$user->rights->agenda->allactions->read || $filter == 'mine') { // If no permission to see all, we show only affected to me +if (empty($user->rights->agenda->allactions->read) || $filter == 'mine') { // If no permission to see all, we show only affected to me $filtert = $user->id; } diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php index 691e0ac1bc3..ee41df3cdd2 100644 --- a/htdocs/core/boxes/box_actions.php +++ b/htdocs/core/boxes/box_actions.php @@ -105,7 +105,7 @@ class box_actions extends ModeleBoxes if ($user->socid) { $sql .= " AND s.rowid = ".((int) $user->socid); } - if (!$user->rights->agenda->allactions->read) { + if (empty($user->rights->agenda->allactions->read)) { $sql .= " AND (a.fk_user_author = ".((int) $user->id)." OR a.fk_user_action = ".((int) $user->id)." OR a.fk_user_done = ".((int) $user->id).")"; } $sql .= " ORDER BY a.datec DESC"; From 9bd31d2b8507fe6ffbe3f7a4b3dddbe0c17a3059 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 23 Oct 2021 07:13:08 +0200 Subject: [PATCH 1123/1460] fix warnings --- htdocs/accountancy/admin/fiscalyear.php | 2 +- htdocs/accountancy/admin/fiscalyear_info.php | 2 +- htdocs/accountancy/closure/index.php | 2 +- htdocs/blockedlog/admin/blockedlog_list.php | 2 +- htdocs/blockedlog/ajax/block-info.php | 2 +- htdocs/commande/stats/index.php | 2 +- htdocs/compta/facture/list.php | 8 ++++---- htdocs/compta/facture/prelevement.php | 2 +- htdocs/compta/facture/stats/index.php | 2 +- htdocs/core/class/fiscalyear.class.php | 2 +- htdocs/core/class/html.formmargin.class.php | 2 +- htdocs/core/lib/security.lib.php | 4 ++-- htdocs/core/photos_resize.php | 2 +- htdocs/fourn/commande/info.php | 2 +- htdocs/product/stats/card.php | 4 ++-- htdocs/societe/index.php | 4 ++-- htdocs/societe/list.php | 2 +- 17 files changed, 23 insertions(+), 23 deletions(-) diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php index 4338d7ad803..44c5309f531 100644 --- a/htdocs/accountancy/admin/fiscalyear.php +++ b/htdocs/accountancy/admin/fiscalyear.php @@ -52,7 +52,7 @@ $langs->loadLangs(array("admin", "compta")); if ($user->socid > 0) { accessforbidden(); } -if (!$user->rights->accounting->fiscalyear->write) { // If we can read accounting records, we should be able to see fiscal year. +if (empty($user->rights->accounting->fiscalyear->write)) { // If we can read accounting records, we should be able to see fiscal year. accessforbidden(); } diff --git a/htdocs/accountancy/admin/fiscalyear_info.php b/htdocs/accountancy/admin/fiscalyear_info.php index d472350fab7..77ec988143a 100644 --- a/htdocs/accountancy/admin/fiscalyear_info.php +++ b/htdocs/accountancy/admin/fiscalyear_info.php @@ -33,7 +33,7 @@ $langs->loadLangs(array("admin", "compta")); if ($user->socid > 0) { accessforbidden(); } -if (!$user->rights->accounting->fiscalyear->write) { +if (empty($user->rights->accounting->fiscalyear->write)) { accessforbidden(); } diff --git a/htdocs/accountancy/closure/index.php b/htdocs/accountancy/closure/index.php index a7220d01a28..fdcc6f54ab3 100644 --- a/htdocs/accountancy/closure/index.php +++ b/htdocs/accountancy/closure/index.php @@ -63,7 +63,7 @@ if (empty($conf->accounting->enabled)) { if ($user->socid > 0) { accessforbidden(); } -if (!$user->rights->accounting->fiscalyear->write) { +if (empty($user->rights->accounting->fiscalyear->write)) { accessforbidden(); } diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index 2a15aa0965b..4698222bda8 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; // Load translation files required by the page $langs->loadLangs(array("admin", "other", "blockedlog", "bills")); -if ((!$user->admin && !$user->rights->blockedlog->read) || empty($conf->blockedlog->enabled)) { +if ((!$user->admin && empty($user->rights->blockedlog->read)) || empty($conf->blockedlog->enabled)) { accessforbidden(); } diff --git a/htdocs/blockedlog/ajax/block-info.php b/htdocs/blockedlog/ajax/block-info.php index 9fde03e1e5e..eb851af169a 100644 --- a/htdocs/blockedlog/ajax/block-info.php +++ b/htdocs/blockedlog/ajax/block-info.php @@ -43,7 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php'; $id = GETPOST('id', 'int'); $block = new BlockedLog($db); -if ((!$user->admin && !$user->rights->blockedlog->read) || empty($conf->blockedlog->enabled)) { +if ((!$user->admin && empty($user->rights->blockedlog->read)) || empty($conf->blockedlog->enabled)) { accessforbidden(); } diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index 377782d9f1f..37535e0b573 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -42,7 +42,7 @@ $mode = GETPOSTISSET("mode") ? GETPOST("mode", 'aZ09') : 'customer'; if ($mode == 'customer' && !$user->rights->commande->lire) { accessforbidden(); } -if ($mode == 'supplier' && !$user->rights->fournisseur->commande->lire) { +if ($mode == 'supplier' && empty($user->rights->fournisseur->commande->lire)) { accessforbidden(); } diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 2be624bf4d6..b73569d86d1 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -242,10 +242,10 @@ $arrayfields = array( 'f.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>292), 'multicurrency_dynamount_payed'=>array('label'=>'MulticurrencyAlreadyPaid', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>295), 'multicurrency_rtp'=>array('label'=>'MulticurrencyRemainderToPay', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>296), // Not enabled by default because slow - 'total_pa' => array('label' => ($conf->global->MARGIN_TYPE == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous ? 0 : 1)), - 'total_margin' => array('label' => 'Margin', 'checked' => 0, 'position' => 301, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous ? 0 : 1)), - 'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous || empty($conf->global->DISPLAY_MARGIN_RATES) ? 0 : 1)), - 'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous || empty($conf->global->DISPLAY_MARK_RATES) ? 0 : 1)), + 'total_pa' => array('label' => ($conf->global->MARGIN_TYPE == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (empty($conf->margin->enabled) || empty($user->rights->margins->liretous) ? 0 : 1)), + 'total_margin' => array('label' => 'Margin', 'checked' => 0, 'position' => 301, 'enabled' => (empty($conf->margin->enabled) || empty($user->rights->margins->liretous) ? 0 : 1)), + 'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (empty($conf->margin->enabled) || empty($user->rights->margins->liretous) || empty($conf->global->DISPLAY_MARGIN_RATES) ? 0 : 1)), + 'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (empty($conf->margin->enabled) || empty($user->rights->margins->liretous) || empty($conf->global->DISPLAY_MARK_RATES) ? 0 : 1)), 'f.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), 'f.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>502), 'f.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES))), diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 084d24ebfdb..e017533c9ee 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -71,7 +71,7 @@ $hookmanager->initHooks(array('directdebitcard', 'globalcard')); if ($type == 'bank-transfer') { $result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture', 'fk_soc', $fieldid, $isdraft); - if (!$user->rights->fournisseur->facture->lire) { + if (empty($user->rights->fournisseur->facture->lire)) { accessforbidden(); } } else { diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 3c8e093cdc5..380393d2855 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -46,7 +46,7 @@ $mode = GETPOST("mode") ? GETPOST("mode") : 'customer'; if ($mode == 'customer' && !$user->rights->facture->lire) { accessforbidden(); } -if ($mode == 'supplier' && !$user->rights->fournisseur->facture->lire) { +if ($mode == 'supplier' && empty($user->rights->fournisseur->facture->lire)) { accessforbidden(); } diff --git a/htdocs/core/class/fiscalyear.class.php b/htdocs/core/class/fiscalyear.class.php index 2a1f769e15c..0edae298f46 100644 --- a/htdocs/core/class/fiscalyear.class.php +++ b/htdocs/core/class/fiscalyear.class.php @@ -291,7 +291,7 @@ class Fiscalyear extends CommonObject $url = DOL_URL_ROOT.'/accountancy/admin/fiscalyear_card.php?id='.$this->id; - if (!$user->rights->accounting->fiscalyear->write) { + if (empty($user->rights->accounting->fiscalyear->write)) { $option = 'nolink'; } diff --git a/htdocs/core/class/html.formmargin.class.php b/htdocs/core/class/html.formmargin.class.php index 02972f39630..e77ebe3498c 100644 --- a/htdocs/core/class/html.formmargin.class.php +++ b/htdocs/core/class/html.formmargin.class.php @@ -207,7 +207,7 @@ class FormMargin return; } - if (!$user->rights->margins->liretous) { + if (empty($user->rights->margins->liretous)) { return; } diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 9e183020e85..ab404db010b 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -279,7 +279,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f } if ($feature == 'societe') { - if (empty($user->rights->societe->lire) && !$user->rights->fournisseur->lire) { + if (empty($user->rights->societe->lire) && empty($user->rights->fournisseur->lire)) { $readok = 0; $nbko++; } @@ -314,7 +314,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f $nbko++; } } elseif ($feature == 'payment_supplier') { - if (!$user->rights->fournisseur->facture->lire) { + if (empty($user->rights->fournisseur->facture->lire)) { $readok = 0; $nbko++; } diff --git a/htdocs/core/photos_resize.php b/htdocs/core/photos_resize.php index 18d66e839b2..a1559ef6d53 100644 --- a/htdocs/core/photos_resize.php +++ b/htdocs/core/photos_resize.php @@ -98,7 +98,7 @@ if ($modulepart == 'produit' || $modulepart == 'product' || $modulepart == 'serv $accessallowed = 1; } elseif ($modulepart == 'facture_fourn' || $modulepart == 'facture_fournisseur') { $result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture'); - if (!$user->rights->fournisseur->facture->lire) { + if (empty($user->rights->fournisseur->facture->lire)) { accessforbidden(); } $accessallowed = 1; diff --git a/htdocs/fourn/commande/info.php b/htdocs/fourn/commande/info.php index aeb17c25035..bb8dc302b1c 100644 --- a/htdocs/fourn/commande/info.php +++ b/htdocs/fourn/commande/info.php @@ -74,7 +74,7 @@ if ($user->socid) { } $result = restrictedArea($user, 'fournisseur', $id, 'commande_fournisseur', 'commande'); -if (!$user->rights->fournisseur->commande->lire) { +if (empty($user->rights->fournisseur->commande->lire)) { accessforbidden(); } diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php index 932a57d0885..9232dc419b4 100644 --- a/htdocs/product/stats/card.php +++ b/htdocs/product/stats/card.php @@ -418,10 +418,10 @@ if ($result || empty($id)) { if ($graphfiles == 'proposals_suppliers' && !$user->rights->supplier_proposal->lire) { continue; } - if ($graphfiles == 'invoices_suppliers' && !$user->rights->fournisseur->facture->lire) { + if ($graphfiles == 'invoices_suppliers' && empty($user->rights->fournisseur->facture->lire)) { continue; } - if ($graphfiles == 'orders_suppliers' && !$user->rights->fournisseur->commande->lire) { + if ($graphfiles == 'orders_suppliers' && empty($user->rights->fournisseur->commande->lire)) { continue; } if ($graphfiles == 'mrp' && empty($user->rights->mrp->mo->read)) { diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index b66d82df1e7..422ec5c8552 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -104,7 +104,7 @@ if (empty($user->rights->societe->client->voir) && !$socid) { if ($socid > 0) { $sql .= " AND s.rowid = ".((int) $socid); } -if (!$user->rights->fournisseur->lire) { +if (empty($user->rights->fournisseur->lire)) { $sql .= " AND (s.fournisseur <> 1 OR s.client <> 0)"; // client=0, fournisseur=0 must be visible } //print $sql; @@ -287,7 +287,7 @@ if (empty($user->rights->societe->client->voir) && !$socid) { if ($socid) { $sql .= " AND s.rowid = ".((int) $socid); } -if (!$user->rights->fournisseur->lire) { +if (empty($user->rights->fournisseur->lire)) { $sql .= " AND (s.fournisseur != 1 OR s.client != 0)"; } $sql .= $db->order("s.tms", "DESC"); diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index ab567733959..7013acdae56 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -520,7 +520,7 @@ if (empty($user->rights->societe->client->voir) && !$socid) { if ($search_sale && $search_sale != '-1' && $search_sale != '-2') { $sql .= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale } -if (!$user->rights->fournisseur->lire) { +if (empty($user->rights->fournisseur->lire)) { $sql .= " AND (s.fournisseur <> 1 OR s.client <> 0)"; // client=0, fournisseur=0 must be visible } if ($search_sale == -2) { From cad2cf9b6fe1aeef8bf9a703c68d6ecbe17c6e87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 23 Oct 2021 07:20:30 +0200 Subject: [PATCH 1124/1460] fix warnings --- htdocs/bookmarks/card.php | 2 +- htdocs/bookmarks/list.php | 2 +- htdocs/compta/bank/bilan.php | 2 +- htdocs/compta/bank/info.php | 2 +- htdocs/compta/bank/line.php | 2 +- htdocs/core/lib/security.lib.php | 14 +++++++------- htdocs/core/photos_resize.php | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index 74d2284c4b5..289916a07c2 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/bookmarks/class/bookmark.class.php'; $langs->loadLangs(array('bookmarks', 'other')); // Security check -if (!$user->rights->bookmark->lire) { +if (empty($user->rights->bookmark->lire)) { restrictedArea($user, 'bookmarks'); } diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php index 17be6be9cef..8a5de8f4d91 100644 --- a/htdocs/bookmarks/list.php +++ b/htdocs/bookmarks/list.php @@ -35,7 +35,7 @@ $toselect = GETPOST('toselect', 'array'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'bookmarklist'; // To manage different context of search // Security check -if (!$user->rights->bookmark->lire) { +if (empty($user->rights->bookmark->lire)) { restrictedArea($user, 'bookmarks'); } $optioncss = GETPOST('optioncss', 'alpha'); diff --git a/htdocs/compta/bank/bilan.php b/htdocs/compta/bank/bilan.php index 94ae0134a9d..6edee79f86b 100644 --- a/htdocs/compta/bank/bilan.php +++ b/htdocs/compta/bank/bilan.php @@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Load translation files required by the page $langs->loadLangs(array('banks', 'categories')); -if (!$user->rights->banque->lire) { +if (empty($user->rights->banque->lire)) { accessforbidden(); } diff --git a/htdocs/compta/bank/info.php b/htdocs/compta/bank/info.php index c61f6e50bff..e8514c1e96e 100644 --- a/htdocs/compta/bank/info.php +++ b/htdocs/compta/bank/info.php @@ -39,7 +39,7 @@ if ($user->socid) { $socid = $user->socid; } $result = restrictedArea($user, 'banque', $fieldvalue, 'bank_account', '', '', $fieldtype); -if (!$user->rights->banque->lire && !$user->rights->banque->consolidate) { +if (empty($user->rights->banque->lire) && !$user->rights->banque->consolidate) { accessforbidden(); } diff --git a/htdocs/compta/bank/line.php b/htdocs/compta/bank/line.php index 05aed6a215e..5567678c366 100644 --- a/htdocs/compta/bank/line.php +++ b/htdocs/compta/bank/line.php @@ -67,7 +67,7 @@ if ($user->socid) { $socid = $user->socid; } $result = restrictedArea($user, 'banque', $fieldvalue, 'bank_account', '', '', $fieldtype); -if (!$user->rights->banque->lire && !$user->rights->banque->consolidate) { +if (empty($user->rights->banque->lire) && !$user->rights->banque->consolidate) { accessforbidden(); } diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index ab404db010b..fbd2651d4b3 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -299,7 +299,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f $nbko++; } } elseif ($feature == 'cheque') { - if (!$user->rights->banque->cheque) { + if (empty($user->rights->banque->cheque)) { $readok = 0; $nbko++; } @@ -385,22 +385,22 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f $nbko++; } } elseif ($feature == 'commande_fournisseur') { - if (!$user->rights->fournisseur->commande->creer || !$user->rights->supplier_order->creer) { + if (empty($user->rights->fournisseur->commande->creer) || empty($user->rights->supplier_order->creer)) { $createok = 0; $nbko++; } } elseif ($feature == 'banque') { - if (!$user->rights->banque->modifier) { + if (empty($user->rights->banque->modifier)) { $createok = 0; $nbko++; } } elseif ($feature == 'cheque') { - if (!$user->rights->banque->cheque) { + if (empty($user->rights->banque->cheque)) { $createok = 0; $nbko++; } } elseif ($feature == 'import') { - if (!$user->rights->import->run) { + if (empty($user->rights->import->run)) { $createok = 0; $nbko++; } @@ -497,11 +497,11 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f $deleteok = 0; } } elseif ($feature == 'banque') { - if (!$user->rights->banque->modifier) { + if (empty($user->rights->banque->modifier)) { $deleteok = 0; } } elseif ($feature == 'cheque') { - if (!$user->rights->banque->cheque) { + if (empty($user->rights->banque->cheque)) { $deleteok = 0; } } elseif ($feature == 'ecm') { diff --git a/htdocs/core/photos_resize.php b/htdocs/core/photos_resize.php index a1559ef6d53..654435dad89 100644 --- a/htdocs/core/photos_resize.php +++ b/htdocs/core/photos_resize.php @@ -86,7 +86,7 @@ if ($modulepart == 'produit' || $modulepart == 'product' || $modulepart == 'serv $accessallowed = 1; } elseif ($modulepart == 'bank') { $result = restrictedArea($user, 'banque', $id, 'bank_account'); - if (!$user->rights->banque->lire) { + if (empty($user->rights->banque->lire)) { accessforbidden(); } $accessallowed = 1; From 57bac4f5dbb47f3ad9019fd15425e22fc2c97fe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 23 Oct 2021 07:29:12 +0200 Subject: [PATCH 1125/1460] fix warnings --- htdocs/accountancy/admin/account.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 4c9bb047439..a9e0a5dc509 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -438,43 +438,37 @@ if ($resql) { print $searchpicto; print ''; print ''; - $totalarray = array(); print ''; if (!empty($arrayfields['aa.account_number']['checked'])) { print_liste_field_titre($arrayfields['aa.account_number']['label'], $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder); - $totalarray['nbfield']++; } if (!empty($arrayfields['aa.label']['checked'])) { print_liste_field_titre($arrayfields['aa.label']['label'], $_SERVER["PHP_SELF"], "aa.label", "", $param, '', $sortfield, $sortorder); - $totalarray['nbfield']++; } if (!empty($arrayfields['aa.labelshort']['checked'])) { print_liste_field_titre($arrayfields['aa.labelshort']['label'], $_SERVER["PHP_SELF"], "aa.labelshort", "", $param, '', $sortfield, $sortorder); - $totalarray['nbfield']++; } if (!empty($arrayfields['aa.account_parent']['checked'])) { print_liste_field_titre($arrayfields['aa.account_parent']['label'], $_SERVER["PHP_SELF"], "aa.account_parent", "", $param, '', $sortfield, $sortorder, 'left '); - $totalarray['nbfield']++; } if (!empty($arrayfields['aa.pcg_type']['checked'])) { print_liste_field_titre($arrayfields['aa.pcg_type']['label'], $_SERVER["PHP_SELF"], 'aa.pcg_type,aa.account_number', '', $param, '', $sortfield, $sortorder, '', $arrayfields['aa.pcg_type']['help'], 1); - $totalarray['nbfield']++; } if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { if (!empty($arrayfields['aa.reconcilable']['checked'])) { print_liste_field_titre($arrayfields['aa.reconcilable']['label'], $_SERVER["PHP_SELF"], 'aa.reconcilable', '', $param, '', $sortfield, $sortorder); - $totalarray['nbfield']++; } } if (!empty($arrayfields['aa.active']['checked'])) { print_liste_field_titre($arrayfields['aa.active']['label'], $_SERVER["PHP_SELF"], 'aa.active', '', $param, '', $sortfield, $sortorder); - $totalarray['nbfield']++; } print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); print "\n"; $accountstatic = new AccountingAccount($db); $accountparent = new AccountingAccount($db); + $totalarray = array(); + $totalarray['nbfield'] = 0; $i = 0; while ($i < min($num, $limit)) { From 93e223bf84186245c13d7f87a9e7735f1cf92a4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 23 Oct 2021 07:38:10 +0200 Subject: [PATCH 1126/1460] fix warnings --- htdocs/accountancy/admin/defaultaccounts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/admin/defaultaccounts.php b/htdocs/accountancy/admin/defaultaccounts.php index 061752c11c5..5d78036159a 100644 --- a/htdocs/accountancy/admin/defaultaccounts.php +++ b/htdocs/accountancy/admin/defaultaccounts.php @@ -186,7 +186,7 @@ foreach ($list_account as $key) { print ''.$label.''; // Value print ''; // 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', 'accounts'); + print $formaccounting->select_account(getDolGlobalString($key), $key, 1, '', 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', 'accounts'); print ''; print ''; } From 21aaed4a862fb50d4fcba2a5546bceb0c2c8201d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 23 Oct 2021 07:40:36 +0200 Subject: [PATCH 1127/1460] Update closure.php --- htdocs/accountancy/admin/closure.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/admin/closure.php b/htdocs/accountancy/admin/closure.php index 8efb869ffaf..437ff1b7116 100644 --- a/htdocs/accountancy/admin/closure.php +++ b/htdocs/accountancy/admin/closure.php @@ -109,7 +109,7 @@ foreach ($list_account_main as $key) { print ''; // Value print ''; // 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); + print $formaccounting->select_account(getDolGlobalString($key), $key, 1, '', 1, 1); print ''; print ''; } From febb48d345c436610cac62c9b617d3e0f39ed64e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 23 Oct 2021 07:41:40 +0200 Subject: [PATCH 1128/1460] Update loan.php --- htdocs/admin/loan.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/loan.php b/htdocs/admin/loan.php index 0769ee5c0a0..59b7eb8b463 100644 --- a/htdocs/admin/loan.php +++ b/htdocs/admin/loan.php @@ -105,7 +105,7 @@ foreach ($list as $key) { // Value print ''; if (!empty($conf->accounting->enabled)) { - print $formaccounting->select_account($conf->global->$key, $key, 1, '', 1, 1); + print $formaccounting->select_account(getDolGlobalString($key), $key, 1, '', 1, 1); } else { print ''; } From 4fa050bd1a18dd2c2970c0420fc8555c28ac1a01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 23 Oct 2021 07:42:29 +0200 Subject: [PATCH 1129/1460] Update salaries.php --- htdocs/salaries/admin/salaries.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/salaries/admin/salaries.php b/htdocs/salaries/admin/salaries.php index f8ed3f3f7ce..1c9eeec6464 100644 --- a/htdocs/salaries/admin/salaries.php +++ b/htdocs/salaries/admin/salaries.php @@ -120,7 +120,7 @@ foreach ($list as $key) { // Value print ''; if (!empty($conf->accounting->enabled)) { - print $formaccounting->select_account($conf->global->$key, $key, 1, '', 1, 1); + print $formaccounting->select_account(getDolGlobalString($key), $key, 1, '', 1, 1); } else { print ''; } From a194737f1c711d57ba459f553ca331e2683da962 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 23 Oct 2021 07:58:35 +0200 Subject: [PATCH 1130/1460] fix permission --- htdocs/opensurvey/list.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/opensurvey/list.php b/htdocs/opensurvey/list.php index 3dc42def482..b05abe3fd40 100644 --- a/htdocs/opensurvey/list.php +++ b/htdocs/opensurvey/list.php @@ -107,7 +107,8 @@ $arrayfields = dol_sort_array($arrayfields, 'position'); $permissiontoread = $user->rights->opensurvey->read; $permissiontoadd = $user->rights->opensurvey->write; -$permissiontodelete = $user->rights->opensurvey->delete; +// permission delete doesn't exists +$permissiontodelete = $user->rights->opensurvey->write; /* From c19ea8b220db432a4fdcb0993ef8e7844b7c2836 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 23 Oct 2021 08:37:07 +0200 Subject: [PATCH 1131/1460] clean code --- htdocs/hrm/evaluation_note.php | 53 ++-------------------------------- 1 file changed, 2 insertions(+), 51 deletions(-) diff --git a/htdocs/hrm/evaluation_note.php b/htdocs/hrm/evaluation_note.php index aae7b56acaf..1b6b5a35564 100644 --- a/htdocs/hrm/evaluation_note.php +++ b/htdocs/hrm/evaluation_note.php @@ -25,57 +25,8 @@ * \brief Tab for notes on Evaluation */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification - // 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"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/class/evaluation.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_evaluation.lib.php'; @@ -86,7 +37,7 @@ $langs->loadLangs(array("hrm", "companies")); // Get parameters $id = GETPOST('id', 'int'); -$ref = GETPOST('ref', 'alpha'); +$ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); From 8dd237b96470e50deefd573ee80656eb30ea0fb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 23 Oct 2021 08:38:27 +0200 Subject: [PATCH 1132/1460] Update evaluation_list.php --- htdocs/hrm/evaluation_list.php | 50 +--------------------------------- 1 file changed, 1 insertion(+), 49 deletions(-) diff --git a/htdocs/hrm/evaluation_list.php b/htdocs/hrm/evaluation_list.php index a713b37ca48..35189f11b87 100644 --- a/htdocs/hrm/evaluation_list.php +++ b/htdocs/hrm/evaluation_list.php @@ -25,57 +25,9 @@ * \brief List page for evaluation */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification // 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"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; From a81da58639f96f4ebbbbe3c8f3f9bdbb5b5b80d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 23 Oct 2021 08:39:10 +0200 Subject: [PATCH 1133/1460] Update evaluation_document.php --- htdocs/hrm/evaluation_document.php | 50 +----------------------------- 1 file changed, 1 insertion(+), 49 deletions(-) diff --git a/htdocs/hrm/evaluation_document.php b/htdocs/hrm/evaluation_document.php index 06cbd7a621a..7318819644e 100644 --- a/htdocs/hrm/evaluation_document.php +++ b/htdocs/hrm/evaluation_document.php @@ -25,57 +25,9 @@ * \brief Tab for documents linked to Evaluation */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification // 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"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; From cf4954e1c59fbd5a434ab4e7f448378d35435076 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 23 Oct 2021 08:39:37 +0200 Subject: [PATCH 1134/1460] Update evaluation_contact.php --- htdocs/hrm/evaluation_contact.php | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/htdocs/hrm/evaluation_contact.php b/htdocs/hrm/evaluation_contact.php index 540154b77ef..61af793b28a 100644 --- a/htdocs/hrm/evaluation_contact.php +++ b/htdocs/hrm/evaluation_contact.php @@ -26,35 +26,7 @@ */ // 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"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; From 7792a69d8bf00a81c4511f9ce9014333e9b0cb21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 23 Oct 2021 08:40:02 +0200 Subject: [PATCH 1135/1460] Update evaluation_card.php --- htdocs/hrm/evaluation_card.php | 51 +--------------------------------- 1 file changed, 1 insertion(+), 50 deletions(-) diff --git a/htdocs/hrm/evaluation_card.php b/htdocs/hrm/evaluation_card.php index 64b54b4c80b..2716bbf8a83 100644 --- a/htdocs/hrm/evaluation_card.php +++ b/htdocs/hrm/evaluation_card.php @@ -25,57 +25,8 @@ * \brief Page to create/edit/view evaluation */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification - // 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"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; From 1c32847c07ad4cc5643e5c93b821bb3add8cb7c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 23 Oct 2021 08:40:29 +0200 Subject: [PATCH 1136/1460] Update evaluation_agenda.php --- htdocs/hrm/evaluation_agenda.php | 50 +------------------------------- 1 file changed, 1 insertion(+), 49 deletions(-) diff --git a/htdocs/hrm/evaluation_agenda.php b/htdocs/hrm/evaluation_agenda.php index 8524f6df3d9..91a0615bc95 100644 --- a/htdocs/hrm/evaluation_agenda.php +++ b/htdocs/hrm/evaluation_agenda.php @@ -25,57 +25,9 @@ * \brief Tab of events on Evaluation */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification // 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"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; From fa516a146087b9433f56eeecbc87b78844c3642e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 23 Oct 2021 08:42:42 +0200 Subject: [PATCH 1137/1460] Update skill_tab.php --- htdocs/hrm/skill_tab.php | 55 ++-------------------------------------- 1 file changed, 2 insertions(+), 53 deletions(-) diff --git a/htdocs/hrm/skill_tab.php b/htdocs/hrm/skill_tab.php index 2aada2a771e..9a9ea39e31d 100644 --- a/htdocs/hrm/skill_tab.php +++ b/htdocs/hrm/skill_tab.php @@ -25,61 +25,10 @@ * \brief Page to add/delete/view skill to jobs/users */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification + // 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"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; From b1d948a0f39aade3b717b30a341659f377f2769b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 23 Oct 2021 08:43:07 +0200 Subject: [PATCH 1138/1460] Update skill_note.php --- htdocs/hrm/skill_note.php | 50 +-------------------------------------- 1 file changed, 1 insertion(+), 49 deletions(-) diff --git a/htdocs/hrm/skill_note.php b/htdocs/hrm/skill_note.php index 000c5e1b41b..1510f746e5e 100644 --- a/htdocs/hrm/skill_note.php +++ b/htdocs/hrm/skill_note.php @@ -25,57 +25,9 @@ * \brief Tab for notes on skill */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification // 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"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/class/skill.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_skill.lib.php'; From cbead902dfa1d405625f6bce4bb565e2045694f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 23 Oct 2021 08:43:31 +0200 Subject: [PATCH 1139/1460] Update skill_list.php --- htdocs/hrm/skill_list.php | 50 +-------------------------------------- 1 file changed, 1 insertion(+), 49 deletions(-) diff --git a/htdocs/hrm/skill_list.php b/htdocs/hrm/skill_list.php index fc2998d046a..1fc5440e589 100644 --- a/htdocs/hrm/skill_list.php +++ b/htdocs/hrm/skill_list.php @@ -25,57 +25,9 @@ * \brief List page for skill */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification // 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"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; From 3c8b135de1d3c169036d4660a519aa2ef828be96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 23 Oct 2021 08:43:59 +0200 Subject: [PATCH 1140/1460] Update skill_document.php --- htdocs/hrm/skill_document.php | 50 +---------------------------------- 1 file changed, 1 insertion(+), 49 deletions(-) diff --git a/htdocs/hrm/skill_document.php b/htdocs/hrm/skill_document.php index ca13044f712..77f3325de15 100644 --- a/htdocs/hrm/skill_document.php +++ b/htdocs/hrm/skill_document.php @@ -25,57 +25,9 @@ * \brief Tab for documents linked to skill */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification // 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"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; From 5f2269761c9f8f723b57c13a97f490fe1c963f0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 23 Oct 2021 08:44:27 +0200 Subject: [PATCH 1141/1460] Update skill_contact.php --- htdocs/hrm/skill_contact.php | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/htdocs/hrm/skill_contact.php b/htdocs/hrm/skill_contact.php index a535e00696b..f8ea2a04a9f 100644 --- a/htdocs/hrm/skill_contact.php +++ b/htdocs/hrm/skill_contact.php @@ -26,35 +26,7 @@ */ // 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"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; From c5d60f44e3c279a2e9e832ec30f2f0d1ed44b9fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 23 Oct 2021 08:44:54 +0200 Subject: [PATCH 1142/1460] Update skill_card.php --- htdocs/hrm/skill_card.php | 55 +-------------------------------------- 1 file changed, 1 insertion(+), 54 deletions(-) diff --git a/htdocs/hrm/skill_card.php b/htdocs/hrm/skill_card.php index 2a5b58cd788..3b649ebf485 100644 --- a/htdocs/hrm/skill_card.php +++ b/htdocs/hrm/skill_card.php @@ -25,62 +25,9 @@ * \brief Page to create/edit/view skill */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification // 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"); -} - +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; From ad6d57502f7b3a5f9f7aa5631549453e251fb38b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 23 Oct 2021 08:45:29 +0200 Subject: [PATCH 1143/1460] Update skill_agenda.php --- htdocs/hrm/skill_agenda.php | 50 +------------------------------------ 1 file changed, 1 insertion(+), 49 deletions(-) diff --git a/htdocs/hrm/skill_agenda.php b/htdocs/hrm/skill_agenda.php index 0b854ccb028..9c1821fb8d7 100644 --- a/htdocs/hrm/skill_agenda.php +++ b/htdocs/hrm/skill_agenda.php @@ -25,57 +25,9 @@ * \brief Tab of events on skill */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification // 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"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; From d990b2dc3865fb31243475bbb6045e737a120184 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 23 Oct 2021 08:45:59 +0200 Subject: [PATCH 1144/1460] Update position_note.php --- htdocs/hrm/position_note.php | 50 +----------------------------------- 1 file changed, 1 insertion(+), 49 deletions(-) diff --git a/htdocs/hrm/position_note.php b/htdocs/hrm/position_note.php index 81548761326..1eea4b82676 100644 --- a/htdocs/hrm/position_note.php +++ b/htdocs/hrm/position_note.php @@ -26,57 +26,9 @@ * \brief Tab for notes on Position */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification // 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"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/class/position.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_position.lib.php'; From 445473f1ca4d09eccb58f1140b15f9f9823d6731 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 23 Oct 2021 08:46:27 +0200 Subject: [PATCH 1145/1460] Update position_list.php --- htdocs/hrm/position_list.php | 50 +----------------------------------- 1 file changed, 1 insertion(+), 49 deletions(-) diff --git a/htdocs/hrm/position_list.php b/htdocs/hrm/position_list.php index 3877a6ea14d..d6ed72c2612 100644 --- a/htdocs/hrm/position_list.php +++ b/htdocs/hrm/position_list.php @@ -25,57 +25,9 @@ * \brief List page for position */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification // 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"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; From a7704d858e25bce58195e1e6d234b143d179bb2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 23 Oct 2021 08:46:57 +0200 Subject: [PATCH 1146/1460] Update position_document.php --- htdocs/hrm/position_document.php | 51 +------------------------------- 1 file changed, 1 insertion(+), 50 deletions(-) diff --git a/htdocs/hrm/position_document.php b/htdocs/hrm/position_document.php index 1ae41c193ab..7a820310ee2 100644 --- a/htdocs/hrm/position_document.php +++ b/htdocs/hrm/position_document.php @@ -25,57 +25,8 @@ * \brief Tab for documents linked to Position */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification - // 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"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; From c37a5007490c9dbd29fc37079ca1f369c6926a26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 23 Oct 2021 08:47:22 +0200 Subject: [PATCH 1147/1460] Update position_contact.php --- htdocs/hrm/position_contact.php | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/htdocs/hrm/position_contact.php b/htdocs/hrm/position_contact.php index 56a4fc8ff8f..a7246e3a82b 100644 --- a/htdocs/hrm/position_contact.php +++ b/htdocs/hrm/position_contact.php @@ -26,35 +26,7 @@ */ // 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"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; From 8c28751d0354f05cb5adbae58271cf3384b2234b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 23 Oct 2021 08:47:53 +0200 Subject: [PATCH 1148/1460] Update position_card.php --- htdocs/hrm/position_card.php | 54 +----------------------------------- 1 file changed, 1 insertion(+), 53 deletions(-) diff --git a/htdocs/hrm/position_card.php b/htdocs/hrm/position_card.php index 8cb8ba9de8c..4e003372a1c 100644 --- a/htdocs/hrm/position_card.php +++ b/htdocs/hrm/position_card.php @@ -25,61 +25,9 @@ * \brief Page to create/edit/view position */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification // 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"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; From 72418ffbcee44fd1f75beca9b3bcbae57dee7222 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 23 Oct 2021 08:48:26 +0200 Subject: [PATCH 1149/1460] Update position_agenda.php --- htdocs/hrm/position_agenda.php | 50 +--------------------------------- 1 file changed, 1 insertion(+), 49 deletions(-) diff --git a/htdocs/hrm/position_agenda.php b/htdocs/hrm/position_agenda.php index 670ec51304b..b3b68d9bcbc 100644 --- a/htdocs/hrm/position_agenda.php +++ b/htdocs/hrm/position_agenda.php @@ -25,57 +25,9 @@ * \brief Tab of events on Position */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification // 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"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; From a54fccf933e13264eac4628c28879d19e8870544 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 23 Oct 2021 08:48:53 +0200 Subject: [PATCH 1150/1460] Update job_note.php --- htdocs/hrm/job_note.php | 50 +---------------------------------------- 1 file changed, 1 insertion(+), 49 deletions(-) diff --git a/htdocs/hrm/job_note.php b/htdocs/hrm/job_note.php index 85a1cd1dc84..7205afec247 100644 --- a/htdocs/hrm/job_note.php +++ b/htdocs/hrm/job_note.php @@ -25,57 +25,9 @@ * \brief Tab for notes on Job */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification // 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"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php'; From b1a6094cc15f995568244ad3d4d2065748a1ae1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 23 Oct 2021 08:49:16 +0200 Subject: [PATCH 1151/1460] Update job_list.php --- htdocs/hrm/job_list.php | 50 +---------------------------------------- 1 file changed, 1 insertion(+), 49 deletions(-) diff --git a/htdocs/hrm/job_list.php b/htdocs/hrm/job_list.php index ebd4535e6e7..55363d729b5 100644 --- a/htdocs/hrm/job_list.php +++ b/htdocs/hrm/job_list.php @@ -25,57 +25,9 @@ * \brief List page for job */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification // 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"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; From fe78912aee0a0c280d854f4d6963b0411fe5e51f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 23 Oct 2021 08:49:46 +0200 Subject: [PATCH 1152/1460] Update job_document.php --- htdocs/hrm/job_document.php | 51 +------------------------------------ 1 file changed, 1 insertion(+), 50 deletions(-) diff --git a/htdocs/hrm/job_document.php b/htdocs/hrm/job_document.php index a32f02915e9..a055fbbc325 100644 --- a/htdocs/hrm/job_document.php +++ b/htdocs/hrm/job_document.php @@ -25,57 +25,8 @@ * \brief Tab for documents linked to Job */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification - // 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"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; From 2a6e6edc5d4f981f25fc9192746737a9412c100f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 23 Oct 2021 08:50:07 +0200 Subject: [PATCH 1153/1460] Update job_contact.php --- htdocs/hrm/job_contact.php | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/htdocs/hrm/job_contact.php b/htdocs/hrm/job_contact.php index cbc961d3f9e..67da8ecfd91 100644 --- a/htdocs/hrm/job_contact.php +++ b/htdocs/hrm/job_contact.php @@ -26,35 +26,7 @@ */ // 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"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; From f76a6c024106fb8111b5201bdced44bb25ea38c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 23 Oct 2021 08:50:41 +0200 Subject: [PATCH 1154/1460] Update job_card.php --- htdocs/hrm/job_card.php | 54 +---------------------------------------- 1 file changed, 1 insertion(+), 53 deletions(-) diff --git a/htdocs/hrm/job_card.php b/htdocs/hrm/job_card.php index 19b40048f7b..23343c5c09b 100644 --- a/htdocs/hrm/job_card.php +++ b/htdocs/hrm/job_card.php @@ -25,61 +25,9 @@ * \brief Page to create/edit/view job */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification // 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"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; From 46cfa7537eb350e568020e139bf4c75c15758f51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 23 Oct 2021 08:51:15 +0200 Subject: [PATCH 1155/1460] Update job_agenda.php --- htdocs/hrm/job_agenda.php | 50 +-------------------------------------- 1 file changed, 1 insertion(+), 49 deletions(-) diff --git a/htdocs/hrm/job_agenda.php b/htdocs/hrm/job_agenda.php index 77dd464a7f0..d7772763d8d 100644 --- a/htdocs/hrm/job_agenda.php +++ b/htdocs/hrm/job_agenda.php @@ -25,57 +25,9 @@ * \brief Tab of events on Job */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification // 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"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; From 452a8cfe18199dc81c80cd95cc667b4e9600bf80 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 23 Oct 2021 10:27:24 +0200 Subject: [PATCH 1156/1460] FIX wrong position of error message --- htdocs/societe/card.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 5c9c0f63e94..e5a624ec07f 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2509,7 +2509,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; print ''; print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_client)); - print ''; $tmpcheck = $object->check_codeclient(); if ($tmpcheck != 0 && $tmpcheck != -5) { print ' ('.$langs->trans("WrongCustomerCode").')'; From 9d927973a7651fccbfc51cf5931117ec8c021bd9 Mon Sep 17 00:00:00 2001 From: Nicolas Domenech Date: Sat, 23 Oct 2021 10:32:50 +0200 Subject: [PATCH 1157/1460] fix: redirection after creation contact --- htdocs/contact/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 8ae2deae1cf..8493fd03f3c 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -296,7 +296,7 @@ if (empty($reshook)) { if (empty($error) && $id > 0) { $db->commit(); if (!empty($backtopage)) { - $url = $backtopage; + $url = str_replace('__ID__', $id, $backtopage); } else { $url = 'card.php?id='.$id; } From 953a56b08c27fbe72c82b7ffd575241e462fbf81 Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller Date: Sat, 23 Oct 2021 10:57:03 +0200 Subject: [PATCH 1158/1460] Fix: PHP 8.0 Warnings --- htdocs/compta/bank/list.php | 8 +++++++- htdocs/core/class/dolgraph.class.php | 4 ++-- htdocs/projet/index.php | 2 -- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index cd6e6cfd365..1463a0c44eb 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -506,6 +506,8 @@ print "\n"; $totalarray = array(); $totalarray['nbfield'] = 0; +$totalarray['val'] = array('balance'=>0); +$total = array(); $found = 0; $i = 0; $lastcurrencycode = ''; @@ -714,7 +716,11 @@ foreach ($accounts as $key => $type) { print ''; - $total[$objecttmp->currency_code] += $solde; + if (empty($total[$objecttmp->currency_code])) { + $total[$objecttmp->currency_code] = $solde; + }else{ + $total[$objecttmp->currency_code] += $solde; + } $i++; } diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index 26701cde6ff..e52ab780195 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -1415,12 +1415,12 @@ class DolGraph $color = 'rgb(' . $newcolor[0] . ', ' . $newcolor[1] . ', ' . $newcolor[2] . ', 0.9)'; $bordercolor = 'rgb(' . $newcolor[0] . ', ' . $newcolor[1] . ', ' . $newcolor[2] . ')'; } else { // We do not use a 'group by' - if (is_array($this->datacolor[$i])) { + if (!empty($this->bordercolor[$i]) && is_array($this->datacolor[$i])) { $color = 'rgb(' . $this->datacolor[$i][0] . ', ' . $this->datacolor[$i][1] . ', ' . $this->datacolor[$i][2] . ', 0.9)'; } else { $color = $this->datacolor[$i]; } - if (is_array($this->bordercolor[$i])) { + if (!empty($this->bordercolor[$i]) && is_array($this->bordercolor[$i])) { $color = 'rgb(' . $this->bordercolor[$i][0] . ', ' . $this->bordercolor[$i][1] . ', ' . $this->bordercolor[$i][2] . ', 0.9)'; } else { if ($type != 'horizontalBar') { diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index 213691f4e25..d0e7773a06d 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -239,8 +239,6 @@ if ($resql) { $projectstatic->id = $obj->rowid; $projectstatic->ref = $obj->ref; $projectstatic->title = $obj->title; - $projectstatic->dateo = $obj->dateo; - $projectstatic->datep = $obj->datep; $projectstatic->thirdparty_name = $obj->name; $projectstatic->status = $obj->status; From 0270d1c1b717f056bc23af566e7d89067e403f2d Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller Date: Sat, 23 Oct 2021 10:57:21 +0200 Subject: [PATCH 1159/1460] fix syntax --- htdocs/compta/bank/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index 1463a0c44eb..ea656141639 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -718,7 +718,7 @@ foreach ($accounts as $key => $type) { if (empty($total[$objecttmp->currency_code])) { $total[$objecttmp->currency_code] = $solde; - }else{ + } else { $total[$objecttmp->currency_code] += $solde; } From d1ec71197a6406442f66a125606b9d584e6b3b41 Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller Date: Sat, 23 Oct 2021 11:10:58 +0200 Subject: [PATCH 1160/1460] Fix : scrutinizer errors --- htdocs/commande/class/api_orders.class.php | 2 +- htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/commande/class/api_orders.class.php b/htdocs/commande/class/api_orders.class.php index 0887c22a8f3..6d0b5a5d297 100644 --- a/htdocs/commande/class/api_orders.class.php +++ b/htdocs/commande/class/api_orders.class.php @@ -981,6 +981,7 @@ class Orders extends DolibarrApi if (!DolibarrApiAccess::$user->rights->expedition->lire) { throw new RestException(401); } + $obj_ret = array(); $sql = "SELECT e.rowid"; $sql .= " FROM ".MAIN_DB_PREFIX."expedition as e"; $sql .= " JOIN ".MAIN_DB_PREFIX."expeditiondet as edet"; @@ -1054,7 +1055,6 @@ class Orders extends DolibarrApi if ($result <= 0) { throw new RestException(500, 'Error on creating expedition lines:'.$this->db->lasterror()); } - $i++; } return $shipment->id; } diff --git a/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php b/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php index f37bda11104..83acae25b45 100644 --- a/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php +++ b/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php @@ -65,7 +65,7 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes public function loadBox($max = 5) { global $conf, $user, $langs; - $dataseries = ""; + $dataseries = array(); $graphtoshow = ""; $badgeStatus0 = '#cbd3d3'; // draft @@ -118,7 +118,6 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes if ($resql) { $num = $this->db->num_rows($resql); $i = 0; - $dataseries = array(); while ($i < $num) { $objp = $this->db->fetch_object($resql); while ($minimumdatecformated < $objp->datec) { From 6ccd8ce83acde5e10a86b379a0d7466bc6aa4d3c Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller Date: Sat, 23 Oct 2021 11:45:06 +0200 Subject: [PATCH 1161/1460] Fix : PHP errors 8.0 --- htdocs/core/class/html.form.class.php | 2 +- .../class/DataCollector/DolLogsCollector.php | 2 +- .../class/DataCollector/DolibarrCollector.php | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 88151e7c288..6293dd9e9ec 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2602,7 +2602,7 @@ class Form if (!$forcecombo) { include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; - $out .= ajax_combobox($htmlname, $events, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); + $out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT")); } $out .= ''; } if (!empty($arrayfields['bu.label']['checked'])) { - print ''; + print ''; } if (!empty($arrayfields['ba.ref']['checked'])) { print ''; From b8250be2372b0ef8eee1f1314eef891816584432 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 24 Oct 2021 16:35:42 +0200 Subject: [PATCH 1229/1460] css for toolitp --- htdocs/core/js/lib_foot.js.php | 6 +++--- htdocs/core/lib/functions.lib.php | 4 ++-- htdocs/theme/eldy/global.inc.php | 23 +++++++++++++++++++++++ htdocs/theme/md/style.css.php | 24 ++++++++++++++++++++++++ 4 files changed, 52 insertions(+), 5 deletions(-) diff --git a/htdocs/core/js/lib_foot.js.php b/htdocs/core/js/lib_foot.js.php index 1de4fef0176..997132ca132 100644 --- a/htdocs/core/js/lib_foot.js.php +++ b/htdocs/core/js/lib_foot.js.php @@ -258,12 +258,12 @@ print ' window.getSelection().removeAllRanges(); /* Show message */ - var lastchild = this.parentNode.lastChild; + var lastchild = this.parentNode.lastChild; /* .parentNode is clipboardCP and last child is clipboardCPText */ var tmp = lastchild.innerHTML if (succeed) { - lastchild.innerHTML = \''.dol_escape_js($langs->trans('CopiedToClipboard')).'\'; + lastchild.innerHTML = \'
    '.dol_escape_js($langs->trans('CopiedToClipboard')).'
    \'; } else { - lastchild.innerHTML = \''.dol_escape_js($langs->trans('Error')).'\'; + lastchild.innerHTML = \'
    '.dol_escape_js($langs->trans('Error')).'
    \'; } setTimeout(() => { lastchild.innerHTML = tmp; }, 1000); }); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 98a879410b0..7ee19214c64 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -10520,9 +10520,9 @@ function showValueWithClipboardCPButton($valuetocopy, $showonlyonhover = 1, $tex $tag = 'span'; // Using div does not work when using the js copy code. if ($texttoshow) { - $result = '<'.$tag.' class="clipboardCPValue hidewithsize">'.dol_escape_htmltag($valuetocopy, 1, 1).''.dol_escape_htmltag($texttoshow, 1, 1).''; + $result = '<'.$tag.' class="clipboardCPValue hidewithsize">'.dol_escape_htmltag($valuetocopy, 1, 1).''.dol_escape_htmltag($texttoshow, 1, 1).''; } else { - $result = '<'.$tag.' class="clipboardCPValue">'.dol_escape_htmltag($valuetocopy, 1, 1).''; + $result = '<'.$tag.' class="clipboardCPValue">'.dol_escape_htmltag($valuetocopy, 1, 1).''; } return $result; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 366e9322dde..91736813d15 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -6879,6 +6879,29 @@ div.clipboardCPValue.hidewithsize { display: none; } +/* To make a div popup, we must use a position aboluste inside a position relative */ +.clipboardCPText { + position: relative; +} +.clipboardCPTextDivInside { + position: absolute; + background: #f8f8fa; + color: #888; + border: 1px solid #E0E0E0; + opacity: 1; + z-index: 20; + padding: 2px; + padding-left: 5px; + padding-right: 5px; + top: -5px; + left: 0px; + border-radius: 5px; + white-space: nowrap; + font-size: 0.9em; + box-shadow: 1px 1px 6px #ddd; +} + + /* ============================================================================== */ /* CSS style used for small screen */ diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 51e625438fd..1acc8e26ed1 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -6717,6 +6717,30 @@ div.clipboardCPValue.hidewithsize { display: none; } +/* To make a div popup, we must use a position aboluste inside a position relative */ + +.clipboardCPText { + position: relative; +} +.clipboardCPTextDivInside { + position: absolute; + background: #EEE; + color: 888; + border: 1px solid #DDD; + opacity: 1; + z-index: 20; + padding: 2px; + padding-left: 4px; + padding-right: 4px; + top: -5px; + left: 0px; + border-radius: 5px; + white-space: nowrap; + font-size: 0.95em; + box-shadow: 1px 1px 6px #ddd; +} + + /* ============================================================================== */ /* CSS style used for small screen */ From de312cf8b4512b88b9e4cd0b6c4256c9cb64ae6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 24 Oct 2021 16:39:57 +0200 Subject: [PATCH 1230/1460] Update bankentries_list.php --- htdocs/compta/bank/bankentries_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 25245bac7d2..6c03fd7b725 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -68,7 +68,7 @@ $contextpage = 'banktransactionlist'.(empty($object->ref) ? '' : '-'.$object->id // Security check $fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : '')); $fieldtype = (!empty($ref) ? 'ref' : 'rowid'); -if ($fielvalue) { +if ($fieldvalue) { if ($user->socid) { $socid = $user->socid; } From f6cd0818b3418a74a0864cc2e5794fc1cdffbc51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 24 Oct 2021 16:47:01 +0200 Subject: [PATCH 1231/1460] fix warnings in bankentrie list --- htdocs/compta/bank/bankentries_list.php | 39 +++++++++++++------------ htdocs/compta/bank/line.php | 2 ++ 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index eabe47e54ca..ebf4e23dc58 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -64,11 +64,12 @@ $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); $contextpage = 'banktransactionlist'.(empty($object->ref) ? '' : '-'.$object->id); +$massaction = GETPOST('massaction', 'alpha'); // Security check $fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : '')); $fieldtype = (!empty($ref) ? 'ref' : 'rowid'); -if ($fielvalue) { +if ($fieldvalue) { if ($user->socid) { $socid = $user->socid; } @@ -97,6 +98,8 @@ $search_thirdparty_user = GETPOST("search_thirdparty", 'alpha') ?GETPOST("search $search_req_nb = GETPOST("req_nb", 'alpha'); $search_num_releve = GETPOST("search_num_releve", 'alpha'); $search_conciliated = GETPOST("search_conciliated", 'int'); +$optioncss = GETPOST('optioncss', 'alpha'); +$toselect = GETPOST('toselect', 'array'); $num_releve = GETPOST("num_releve", "alpha"); if (empty($dateop)) { $dateop = -1; @@ -222,7 +225,7 @@ if (empty($reshook)) { $objectclass = 'Account'; $objectlabel = 'BankTransaction'; $permissiontoread = $user->rights->banque->lire; - $permissiontodelete = $user->rights->banque->supprimer; + $permissiontodelete = $user->rights->banque->modifier; $uploaddir = $conf->bank->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } @@ -484,6 +487,11 @@ if ($optioncss != '') { if ($action == 'reconcile') { $param .= '&action=reconcile'; } +$totalarray = array( + 'nbfield' => 0, + 'totalcred' => 0, + 'totaldeb' => 0, +); // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; @@ -574,7 +582,7 @@ if ($search_bid > 0) { } $sql .= " ".MAIN_DB_PREFIX."bank_account as ba,"; $sql .= " ".MAIN_DB_PREFIX."bank as b"; -if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { +if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (b.rowid = ef.fk_object)"; } $sql .= " WHERE b.fk_account = ba.rowid"; @@ -732,7 +740,7 @@ $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); - $arrayofselected = is_array($toselect) ? $toselect : array(); + $arrayofselected = (!empty($toselect) && is_array($toselect)) ? $toselect : array(); // List of mass actions available $arrayofmassactions = array( @@ -759,7 +767,9 @@ if ($resql) { print ''; print ''; print ''; - print ''; + if (!empty($view)) { + print ''; + } print ''; print ''; print ''; @@ -939,6 +949,7 @@ if ($resql) { } } + $morehtml = ''; /*$morehtml = '
    '; $morehtml .= ' "; // ' Page '; $morehtml .= ''; @@ -1050,7 +1061,7 @@ if ($resql) { print ''; } if (!empty($arrayfields['bu.label']['checked'])) { - print ''; + print ''; } if (!empty($arrayfields['ba.ref']['checked'])) { print ''; @@ -1160,7 +1171,6 @@ if ($resql) { // Loop on each record $sign = 1; - $totalarray = array(); while ($i < min($num, $limit)) { $objp = $db->fetch_object($resql); $links = $bankaccountstatic->get_url($objp->rowid); @@ -1296,18 +1306,10 @@ if ($resql) { $backgroundcolor = "class='oddeven'"; } else { if ($objp->amount < 0) { - if (empty($conf->global->BANK_COLORIZE_MOVEMENT_COLOR1)) { - $color = '#fca955'; - } else { - $color = '#'.$conf->global->BANK_COLORIZE_MOVEMENT_COLOR1; - } + $color = '#' . getDolGlobalString('BANK_COLORIZE_MOVEMENT_COLOR1', 'fca955'); $backgroundcolor = 'style="background: '.$color.';"'; } else { - if (empty($conf->global->BANK_COLORIZE_MOVEMENT_COLOR2)) { - $color = '#7fdb86'; - } else { - $color = '#'.$conf->global->BANK_COLORIZE_MOVEMENT_COLOR2; - } + $color = '#' . getDolGlobalString('BANK_COLORIZE_MOVEMENT_COLOR2', '7fdb86'); $backgroundcolor = 'style="background: '.$color.';"'; } } @@ -1333,7 +1335,7 @@ if ($resql) { $titletoshow = ''; $reg = array(); preg_match('/\((.+)\)/i', $objp->label, $reg); // Si texte entoure de parenthee on tente recherche de traduction - if ($reg[1] && $langs->trans($reg[1]) != $reg[1]) { + if (!empty($reg[1]) && $langs->trans($reg[1]) != $reg[1]) { $labeltoshow = $langs->trans($reg[1]); } else { if ($objp->label == '(payment_salary)') { @@ -1357,6 +1359,7 @@ if ($resql) { } elseif ($links[$key]['type'] == 'payment') { $paymentstatic->id = $links[$key]['url_id']; $paymentstatic->ref = $links[$key]['url_id']; // FIXME This is id, not ref of payment + $paymentstatic->date = $db->jdate($objp->do); print ' '.$paymentstatic->getNomUrl(2); } elseif ($links[$key]['type'] == 'payment_supplier') { $paymentsupplierstatic->id = $links[$key]['url_id']; diff --git a/htdocs/compta/bank/line.php b/htdocs/compta/bank/line.php index 5567678c366..76c0046884f 100644 --- a/htdocs/compta/bank/line.php +++ b/htdocs/compta/bank/line.php @@ -63,6 +63,7 @@ $cancel = GETPOST('cancel', 'alpha'); // Security check $fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : '')); $fieldtype = (!empty($ref) ? 'ref' : 'rowid'); +$socid = 0; if ($user->socid) { $socid = $user->socid; } @@ -568,6 +569,7 @@ if ($result) { // Bank line print ''.$form->editfieldkey('RubriquesTransactions', 'custcats', '', $object, 0).''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_BANK_LINE, null, 'parent', null, null, 1); + $arrayselected = array(); print img_picto('', 'category', 'class="paddingright"').$form->multiselectarray('custcats', $cate_arbo, $arrayselected, null, null, null, null, "90%"); print ""; } From 71541fa299cb3ad8da02b6eefb564c827db5c2f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 24 Oct 2021 16:52:02 +0200 Subject: [PATCH 1232/1460] fix warnings in bankentrie list --- htdocs/compta/bank/bankentries_list.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index ebf4e23dc58..8fd2f9552f8 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -214,6 +214,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' $search_thirdparty_user = ''; $search_num_releve = ''; $search_conciliated = ''; + $toselect = ''; $search_account = ""; if ($id > 0 || !empty($ref)) { @@ -224,14 +225,14 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' if (empty($reshook)) { $objectclass = 'Account'; $objectlabel = 'BankTransaction'; - $permissiontoread = $user->rights->banque->lire; - $permissiontodelete = $user->rights->banque->modifier; + $permissiontoread = !empty($user->rights->banque->lire); + $permissiontodelete = !empty($user->rights->banque->modifier); $uploaddir = $conf->bank->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } // Conciliation -if ((GETPOST('confirm_savestatement', 'alpha') || GETPOST('confirm_reconcile', 'alpha')) && $user->rights->banque->consolidate +if ((GETPOST('confirm_savestatement', 'alpha') || GETPOST('confirm_reconcile', 'alpha')) && !empty($user->rights->banque->consolidate) && (!GETPOSTISSET('pageplusone') || (GETPOST('pageplusone') == GETPOST('pageplusoneold')))) { $error = 0; @@ -313,7 +314,7 @@ if ((GETPOST('confirm_savestatement', 'alpha') || GETPOST('confirm_reconcile', ' } -if (GETPOST('save') && !$cancel && $user->rights->banque->modifier) { +if (GETPOST('save') && !$cancel && !empty($user->rights->banque->modifier)) { $error = 0; if (price2num(GETPOST("addcredit")) > 0) { @@ -373,7 +374,7 @@ if (GETPOST('save') && !$cancel && $user->rights->banque->modifier) { } } -if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->banque->modifier) { +if ($action == 'confirm_delete' && $confirm == 'yes' && !empty($user->rights->banque->modifier)) { $accline = new AccountLine($db); $result = $accline->fetch(GETPOST("rowid", "int")); $result = $accline->delete($user); @@ -843,7 +844,7 @@ if ($resql) { } // Form to add a transaction with no invoice - if ($user->rights->banque->modifier && $action == 'addline' && !empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) { + if (!empty($user->rights->banque->modifier) && $action == 'addline' && !empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) { print load_fiche_titre($langs->trans("AddBankRecordLong"), '', ''); print ''; From b1555bc4fc27d62784e05aef0768f674ea577ef8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 24 Oct 2021 17:06:37 +0200 Subject: [PATCH 1233/1460] fix set categories for bank line --- htdocs/compta/bank/line.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/compta/bank/line.php b/htdocs/compta/bank/line.php index 76c0046884f..f86c50f31cc 100644 --- a/htdocs/compta/bank/line.php +++ b/htdocs/compta/bank/line.php @@ -570,6 +570,11 @@ if ($result) { print '"; } From 10d35ee4aa9c7a9d36369122468fdc4d763e2cab Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 24 Oct 2021 17:40:44 +0200 Subject: [PATCH 1234/1460] Fix excluded member display in takepos --- htdocs/takepos/invoice.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 3b40d726a77..016f9c48c51 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -1159,7 +1159,7 @@ $( document ).ready(function() { $result = $adh->fetch('', '', $invoice->socid); if ($result > 0) { $adh->ref = $adh->getFullName($langs); - if (empty($adh->statut)) { + if (empty($adh->statut) || $adh->statut = -2) { $s .= ""; } $s .= $adh->getFullName($langs); @@ -1175,7 +1175,7 @@ $( document ).ready(function() { $s .= " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft and not terminated } } - if (empty($adh->statut)) { + if (empty($adh->statut) || $adh->statut = -2) { $s .= ""; } } else { From 68979578d9218ffc434f46ed8a6c6b24d81efcb9 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 24 Oct 2021 17:56:41 +0200 Subject: [PATCH 1235/1460] Update invoice.php --- htdocs/takepos/invoice.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 016f9c48c51..df17e376f65 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -1159,7 +1159,7 @@ $( document ).ready(function() { $result = $adh->fetch('', '', $invoice->socid); if ($result > 0) { $adh->ref = $adh->getFullName($langs); - if (empty($adh->statut) || $adh->statut = -2) { + if (empty($adh->statut) || $adh->statut == -2) { $s .= ""; } $s .= $adh->getFullName($langs); @@ -1175,7 +1175,7 @@ $( document ).ready(function() { $s .= " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft and not terminated } } - if (empty($adh->statut) || $adh->statut = -2) { + if (empty($adh->statut) || $adh->statut == -2) { $s .= ""; } } else { From 72a665b90199afdf670cfc4e64a2569bd29511e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 24 Oct 2021 19:19:32 +0200 Subject: [PATCH 1236/1460] fix warning --- htdocs/core/tpl/commonfields_view.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/commonfields_view.tpl.php b/htdocs/core/tpl/commonfields_view.tpl.php index 53f846c1713..29bf3943cea 100644 --- a/htdocs/core/tpl/commonfields_view.tpl.php +++ b/htdocs/core/tpl/commonfields_view.tpl.php @@ -156,7 +156,7 @@ foreach ($object->fields as $key => $val) { if ($val['type'] == 'text') { print ' wordbreak'; } - if ($val['cssview']) { + if (!empty($val['cssview'])) { print ' '.$val['cssview']; } print '">'; From b322ae383ba4e29561b61056a12067ba1434e691 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 24 Oct 2021 19:21:51 +0200 Subject: [PATCH 1237/1460] Update invoice.php --- htdocs/takepos/invoice.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index df17e376f65..65ac3d2d0d3 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -1159,7 +1159,7 @@ $( document ).ready(function() { $result = $adh->fetch('', '', $invoice->socid); if ($result > 0) { $adh->ref = $adh->getFullName($langs); - if (empty($adh->statut) || $adh->statut == -2) { + if (empty($adh->statut) || $adh->statut == Adherent::STATUS_EXCLUDED ) { $s .= ""; } $s .= $adh->getFullName($langs); @@ -1175,7 +1175,7 @@ $( document ).ready(function() { $s .= " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft and not terminated } } - if (empty($adh->statut) || $adh->statut == -2) { + if (empty($adh->statut) || $adh->statut == Adherent::STATUS_EXCLUDED) { $s .= ""; } } else { From 03a8c5f0cbd80972b6ff7ddcf09aa0d0d3a43688 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 24 Oct 2021 19:21:58 +0200 Subject: [PATCH 1238/1460] Update commonfields_edit.tpl.php --- htdocs/core/tpl/commonfields_edit.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/commonfields_edit.tpl.php b/htdocs/core/tpl/commonfields_edit.tpl.php index abf3144de8f..39103fdbb0a 100644 --- a/htdocs/core/tpl/commonfields_edit.tpl.php +++ b/htdocs/core/tpl/commonfields_edit.tpl.php @@ -86,7 +86,7 @@ foreach ($object->fields as $key => $val) { $value = GETPOSTISSET($key) ? GETPOST($key, 'alpha') : $object->$key; } //var_dump($val.' '.$key.' '.$value); - if ($val['noteditable']) { + if (!empty($val['noteditable'])) { print $object->showOutputField($val, $key, $value, '', '', '', 0); } else { if ($key == 'lang') { From 28c5b105baefe9a8872f92c1fe285d9d9ce548ee Mon Sep 17 00:00:00 2001 From: atm-florian Date: Mon, 25 Oct 2021 11:20:28 +0200 Subject: [PATCH 1239/1460] FIX: remove two lines of javascript referring to DOM elements that no longer exist in Dolibarr (form#move_event) --- htdocs/comm/action/pertype.php | 1 - htdocs/comm/action/peruser.php | 1 - 2 files changed, 2 deletions(-) diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index 08cef7dd80a..9a88c4f18a2 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -377,7 +377,6 @@ if ($conf->use_javascript_ajax) { $s .= 'jQuery(".family_birthday").toggle();'."\n"; if ($action == "show_week" || $action == "show_month" || empty($action)) { $s .= 'jQuery( "td.sortable" ).sortable({connectWith: ".sortable",placeholder: "ui-state-highlight",items: "div:not(.unsortable)", receive: function( event, ui ) {'; - $s .= 'var frm=jQuery("#move_event");frm.attr("action",ui.item.find("a.cal_event").attr("href")).children("#newdate").val(jQuery(event.target).closest("div").attr("id"));frm.submit();}});'."\n"; } $s .= '});'."\n"; $s .= ''."\n"; diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 0d1567ee274..dc546141aca 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -387,7 +387,6 @@ if ($conf->use_javascript_ajax) { $s .= 'jQuery(".family_birthday").toggle();'."\n"; if ($action == "show_week" || $action == "show_month" || empty($action)) { $s .= 'jQuery( "td.sortable" ).sortable({connectWith: ".sortable",placeholder: "ui-state-highlight",items: "div:not(.unsortable)", receive: function( event, ui ) {'; - $s .= 'var frm=jQuery("#move_event");frm.attr("action",ui.item.find("a.cal_event").attr("href")).children("#newdate").val(jQuery(event.target).closest("div").attr("id"));frm.submit();}});'."\n"; } $s .= '});'."\n"; $s .= ''."\n"; From 940c69b46d9f2c90e349090c4d91e976a4fd0fca Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 Oct 2021 12:09:17 +0200 Subject: [PATCH 1240/1460] Clean code --- htdocs/core/bookmarks_page.php | 126 +++++++++++++++++++++++++++++++++ htdocs/main.inc.php | 6 +- 2 files changed, 128 insertions(+), 4 deletions(-) create mode 100644 htdocs/core/bookmarks_page.php diff --git a/htdocs/core/bookmarks_page.php b/htdocs/core/bookmarks_page.php new file mode 100644 index 00000000000..05ae866463f --- /dev/null +++ b/htdocs/core/bookmarks_page.php @@ -0,0 +1,126 @@ + + * + * This file is a modified version of datepicker.php from phpBSM to fix some + * bugs, to add new features and to dramatically increase speed. + * + * 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 . + */ + +/** + * \file htdocs/core/bookmarks_page.php + * \brief File to return a page with the complete list of bookmarks (all search input fields) + */ + +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled cause need to do translations +if (!defined('NOCSRFCHECK')) { + define('NOCSRFCHECK', 1); +} +if (!defined('NOTOKENRENEWAL')) { + define('NOTOKENRENEWAL', 1); +} +//if (! defined('NOLOGIN')) define('NOLOGIN',1); // Not disabled cause need to load personalized language +if (!defined('NOREQUIREMENU')) { + define('NOREQUIREMENU', 1); +} +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1); + +require_once '../main.inc.php'; + +if (GETPOST('lang', 'aZ09')) { + $langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL by the main.inc.php +} + +$langs->load("main"); + +$right = ($langs->trans("DIRECTION") == 'rtl' ? 'left' : 'right'); +$left = ($langs->trans("DIRECTION") == 'rtl' ? 'right' : 'left'); + + +/* + * View + */ + +$title = $langs->trans("Bookmarks"); + +// URL http://mydolibarr/core/search_page?dol_use_jmobile=1 can be used for tests +$head = ''."\n"; +$arrayofjs = array(); +$arrayofcss = array(); +top_htmlhead($head, $title, 0, 0, $arrayofjs, $arrayofcss); + + + +print ''."\n"; +print '
    '; +//print '
    '; + +$nbofsearch = 0; + +// Instantiate hooks of thirdparty module +$hookmanager->initHooks(array('bookmarks')); + +// Define $bookmarks +$bookmarks = ''; + + +$arrayresult = array(); +//include DOL_DOCUMENT_ROOT.'/core/ajax/selectsearchbox.php'; + +$i = 0; +$accesskeyalreadyassigned = array(); +foreach ($arrayresult as $key => $val) { + $tmp = explode('?', $val['url']); + $urlaction = $tmp[0]; + $keysearch = 'search_all'; + + $accesskey = ''; + if (!$accesskeyalreadyassigned[$val['label'][0]]) { + $accesskey = $val['label'][0]; + $accesskeyalreadyassigned[$accesskey] = $accesskey; + } + + //$bookmarks .= printSearchForm($urlaction, $urlaction, $val['label'], 'minwidth200', $keysearch, $accesskey, $key, $val['img'], $showtitlebefore, ($i > 0 ? 0 : 1)); + + $i++; +} + + +// Execute hook printSearchForm +$parameters = array('bookmarks'=>$bookmarks); +$reshook = $hookmanager->executeHooks('printBookmarks', $parameters); // Note that $action and $object may have been modified by some hooks +if (empty($reshook)) { + $bookmarks .= $hookmanager->resPrint; +} else { + $bookmarks = $hookmanager->resPrint; +} + + +print "\n"; +print "\n"; +print '
    '; +print ''; +print '
    '."\n"; +print $bookmarks; +print '
    '."\n"; +print '
    '; +print "\n\n"; + +print '
    '; +print ''."\n"; + +$db->close(); diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 4d233b9a290..4d77fea3377 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1795,7 +1795,6 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead global $hookmanager, $menumanager; $searchform = ''; - $bookmarks = ''; // Instantiate hooks for external modules $hookmanager->initHooks(array('toprightmenu')); @@ -1825,7 +1824,7 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead // Show menu entries print '
    '."\n"; $menumanager->atarget = $target; - $menumanager->showmenu('top', array('searchform'=>$searchform, 'bookmarks'=>$bookmarks)); // This contains a \n + $menumanager->showmenu('top', array('searchform'=>$searchform)); // This contains a \n print "
    \n"; // Define link to login card @@ -2712,7 +2711,6 @@ function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_ global $hookmanager, $menumanager; $searchform = ''; - $bookmarks = ''; if (!empty($menu_array_before)) { dol_syslog("Deprecated parameter menu_array_before was used when calling main::left_menu function. Menu entries of module should now be defined into module descriptor and not provided when calling left_menu.", LOG_WARNING); @@ -2783,7 +2781,7 @@ function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_ // Show left menu with other forms $menumanager->menu_array = $menu_array_before; $menumanager->menu_array_after = $menu_array_after; - $menumanager->showmenu('left', array('searchform'=>$searchform, 'bookmarks'=>$bookmarks)); // output menu_array and menu found in database + $menumanager->showmenu('left', array('searchform'=>$searchform)); // output menu_array and menu found in database // Dolibarr version + help + bug report link print "\n"; From 1106198c05b86b49db8820d9a7403041a6ddf239 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 Oct 2021 12:34:12 +0200 Subject: [PATCH 1241/1460] css --- htdocs/theme/md/style.css.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 261547992c0..2ce0e07ccfb 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -6821,6 +6821,10 @@ span.clipboardCPValue.hidewithsize { min-width: 30px; } + div.login_block { + border-right: 1px solid rgba(0,0,0,0.3); + } + div.tmenucenter { text-overflow: clip; } From 664fd13428ab6ead1b05309052632bd37479b779 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 Oct 2021 13:04:52 +0200 Subject: [PATCH 1242/1460] Clean CSS --- htdocs/main.inc.php | 2 +- htdocs/theme/eldy/global.inc.php | 2 +- htdocs/theme/md/style.css.php | 17 ++++++----------- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 4d77fea3377..03abc10b171 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1889,7 +1889,7 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead } // Link to print main content area - if (empty($conf->global->MAIN_PRINT_DISABLELINK) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && $conf->browser->layout != 'phone') { + if (empty($conf->global->MAIN_PRINT_DISABLELINK) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { $qs = dol_escape_htmltag($_SERVER["QUERY_STRING"]); if (isset($_POST) && is_array($_POST)) { diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 49d7f9bd168..b3c13594939 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -7050,7 +7050,7 @@ div.clipboardCPValue.hidewithsize { padding-left: 20px; padding-right: 20px; padding-bottom: 16px; - top: inherit !important; + top: auto; left: 0 !important; text-align: center; vertical-align: middle; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 242e83c8400..4400ce22fa5 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1869,11 +1869,6 @@ body.sidebar-collapse .side-nav, body.sidebar-collapse .login_block .side-nav-vert { margin-left: 0; } -div.login_block { - /* border-right: none ! important; */ - top: inherit !important; - border-right: 1px solid rgba(0,0,0,0.3); -} .side-nav { : 0; - top: 0px; browser->layout, array('phone', 'tablet')) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { ?> position: absolute; @@ -6834,6 +6825,10 @@ div.clipboardCPValue.hidewithsize { /* rule to reduce top menu - 3rd reduction */ @media only screen and (max-width: 570px) { + div.login_block { + top: auto; + } + div#tmenu_tooltip { display:none; From 15c80327b1cbe779908c5699683cb538a32f2ee4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 Oct 2021 13:29:08 +0200 Subject: [PATCH 1243/1460] data-key for extrafielsds has prefix of element --- .../tpl/extrafields_list_print_fields.tpl.php | 19 +++++++++++-------- htdocs/societe/list.php | 8 +++++--- htdocs/theme/md/style.css.php | 2 +- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index adf90e204bb..00a22934f78 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -19,13 +19,8 @@ if (!empty($extrafieldsobjectkey) && !empty($extrafields->attributes[$extrafield foreach ($extrafields->attributes[$extrafieldsobjectkey]['label'] as $key => $val) { if (!empty($arrayfields[$extrafieldsobjectprefix.$key]['checked'])) { - $align = $extrafields->getAlignFlag($key, $extrafieldsobjectkey); - print ''; + $cssclass = $extrafields->getAlignFlag($key, $extrafieldsobjectkey); + $tmpkey = 'options_'.$key; if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$key], array('date', 'datetime', 'timestamp')) && !is_numeric($obj->$tmpkey)) { @@ -47,8 +42,16 @@ if (!empty($extrafieldsobjectkey) && !empty($extrafields->attributes[$extrafield //var_dump($value); } - print $extrafields->showOutputField($key, $value, '', $extrafieldsobjectkey); + $valuetoshow = $extrafields->showOutputField($key, $value, '', $extrafieldsobjectkey); + $title = dol_string_nohtmltag($valuetoshow); + + print ''; + print $valuetoshow; print ''; + if (!$i) { $totalarray['nbfield']++; } diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 8aaa12c6562..d071e8f9921 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -1094,7 +1094,7 @@ if (!empty($arrayfields['country.code_iso']['checked'])) { if (!empty($arrayfields['typent.code']['checked'])) { print '
    '; } // Multiprice level @@ -1508,11 +1508,13 @@ while ($i < min($num, $limit)) { } // Type ent if (!empty($arrayfields['typent.code']['checked'])) { - print ''; if (!$i) { $totalarray['nbfield']++; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 37915d91da5..bd4ebed0b49 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2714,7 +2714,6 @@ table.login_table_securitycode tr td { div.login_block { top: 0; - border-right: 1px solid rgba(0,0,0,0.3); padding-top: 3px; padding-bottom: 3px; : 0; @@ -6826,6 +6825,7 @@ div.clipboardCPValue.hidewithsize { @media only screen and (max-width: 570px) { div.login_block { + border-right: 1px solid rgba(0,0,0,0.3); top: auto; } From d916fe121a8a6c58ed068d3e06433919d3f993f0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 Oct 2021 13:57:02 +0200 Subject: [PATCH 1244/1460] css --- htdocs/core/tpl/admin_extrafields_view.tpl.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/core/tpl/admin_extrafields_view.tpl.php b/htdocs/core/tpl/admin_extrafields_view.tpl.php index 6750cc0b1a5..0c1d34efa08 100644 --- a/htdocs/core/tpl/admin_extrafields_view.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_view.tpl.php @@ -93,7 +93,10 @@ if (isset($extrafields->attributes[$elementtype]['type']) && is_array($extrafiel // Key print "\n"; // Type - print "\n"; + $typetoshow = $type2label[$extrafields->attributes[$elementtype]['type'][$key]]; + print '\n"; // Size print '\n"; // Computed field From 1e45b9b1cd5f0b6c934a3b275c225ec6d3da7e8a Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Mon, 25 Oct 2021 15:25:58 +0200 Subject: [PATCH 1245/1460] FIX : We need a default price base type in variant creation case with multiprices when parent has been created with only one level price --- htdocs/variants/class/ProductCombination.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/variants/class/ProductCombination.class.php b/htdocs/variants/class/ProductCombination.class.php index bc479b68653..10318f11a46 100644 --- a/htdocs/variants/class/ProductCombination.class.php +++ b/htdocs/variants/class/ProductCombination.class.php @@ -509,7 +509,7 @@ class ProductCombination for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) { if ($parent->multiprices[$i] != '' || isset($this->combination_price_levels[$i]->variation_price)) { - $new_type = $parent->multiprices_base_type[$i]; + $new_type = !empty($parent->multiprices_base_type[$i]) ? $parent->multiprices_base_type[$i] : 'HT'; $new_min_price = $parent->multiprices_min[$i]; $variation_price = doubleval(!isset($this->combination_price_levels[$i]->variation_price) ? $this->variation_price : $this->combination_price_levels[$i]->variation_price); $variation_price_percentage = doubleval(!isset($this->combination_price_levels[$i]->variation_price_percentage) ? $this->variation_price_percentage : $this->combination_price_levels[$i]->variation_price_percentage); From ad2e567571f0ce0dbe17093612f27b0841286c76 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 Oct 2021 15:32:10 +0200 Subject: [PATCH 1246/1460] Fix bug huntr.dev --- htdocs/compta/bank/account_statement_document.php | 2 ++ htdocs/compta/bank/document.php | 2 ++ htdocs/compta/bank/various_payment/document.php | 3 +++ htdocs/compta/deplacement/document.php | 14 ++++++++------ htdocs/compta/sociales/document.php | 2 ++ htdocs/compta/tva/document.php | 4 +++- htdocs/contact/document.php | 15 +++++++++------ htdocs/contrat/document.php | 2 ++ htdocs/don/document.php | 2 ++ htdocs/expedition/card.php | 3 +-- htdocs/expedition/document.php | 2 ++ htdocs/expensereport/card.php | 3 ++- htdocs/expensereport/document.php | 15 ++++++++------- htdocs/fichinter/card.php | 12 ++++++------ htdocs/fichinter/document.php | 2 ++ htdocs/fourn/commande/document.php | 15 +++++++++------ htdocs/fourn/facture/document.php | 2 ++ htdocs/fourn/paiement/document.php | 3 +++ htdocs/holiday/document.php | 1 + .../knowledgerecord_document.php | 2 +- htdocs/loan/document.php | 2 ++ htdocs/mrp/mo_document.php | 4 +++- htdocs/product/card.php | 6 +++--- htdocs/product/document.php | 4 ++-- htdocs/product/stock/card.php | 8 ++++---- htdocs/product/stock/productlot_document.php | 3 +-- htdocs/projet/document.php | 1 + htdocs/projet/tasks/document.php | 1 + htdocs/resource/agenda.php | 10 +++++++--- htdocs/resource/card.php | 12 ++++++++---- htdocs/resource/contact.php | 13 ++++++++++--- htdocs/resource/document.php | 8 +++++++- htdocs/resource/element_resource.php | 1 + htdocs/resource/list.php | 11 ++++++----- htdocs/resource/note.php | 8 +++++--- htdocs/salaries/document.php | 2 ++ htdocs/societe/document.php | 2 ++ htdocs/supplier_proposal/document.php | 10 ++++++++++ htdocs/ticket/document.php | 2 +- htdocs/user/document.php | 5 ++--- htdocs/website/index.php | 1 + htdocs/workstation/workstation_document.php | 4 ++-- 42 files changed, 151 insertions(+), 73 deletions(-) diff --git a/htdocs/compta/bank/account_statement_document.php b/htdocs/compta/bank/account_statement_document.php index 03209ad7673..0a979e01d39 100644 --- a/htdocs/compta/bank/account_statement_document.php +++ b/htdocs/compta/bank/account_statement_document.php @@ -120,6 +120,8 @@ if (GETPOST("rel") == 'prev') { $found = true; } +$permissiontoadd = $user->rights->banque->modifier; // Used by the include of actions_dellink.inc.php + /* * Actions diff --git a/htdocs/compta/bank/document.php b/htdocs/compta/bank/document.php index ec46002b031..7dce00005f3 100644 --- a/htdocs/compta/bank/document.php +++ b/htdocs/compta/bank/document.php @@ -74,6 +74,8 @@ if ($id > 0 || !empty($ref)) { $result = restrictedArea($user, 'banque', $object->id, 'bank_account', '', ''); +$permissiontoadd = $user->rights->banque->modifier; // Used by the include of actions_dellink.inc.php + /* * Actions diff --git a/htdocs/compta/bank/various_payment/document.php b/htdocs/compta/bank/various_payment/document.php index 5f55f4c2559..ad199caaf5a 100644 --- a/htdocs/compta/bank/various_payment/document.php +++ b/htdocs/compta/bank/various_payment/document.php @@ -69,6 +69,9 @@ $object->fetch($id, $ref); $upload_dir = $conf->bank->dir_output.'/'.dol_sanitizeFileName($object->id); $modulepart = 'banque'; +$permissiontoadd = $user->rights->banque->modifier; // Used by the include of actions_dellink.inc.php + + /* * Actions diff --git a/htdocs/compta/deplacement/document.php b/htdocs/compta/deplacement/document.php index cdb4b5f0f0f..2a16d6e4f49 100644 --- a/htdocs/compta/deplacement/document.php +++ b/htdocs/compta/deplacement/document.php @@ -42,12 +42,6 @@ $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); -// Security check -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'deplacement', $id, ''); - // Get parameters $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; @@ -74,6 +68,14 @@ $object->fetch($id, $ref); $upload_dir = $conf->deplacement->dir_output.'/'.dol_sanitizeFileName($object->ref); $modulepart = 'trip'; +// Security check +if ($user->socid) { + $socid = $user->socid; +} +$result = restrictedArea($user, 'deplacement', $id, ''); + +$permissiontoadd = $user->rights->deplacement->creer; // Used by the include of actions_dellink.inc.php + /* * Actions diff --git a/htdocs/compta/sociales/document.php b/htdocs/compta/sociales/document.php index 1fbfdfa296a..d0cf3a1f34c 100644 --- a/htdocs/compta/sociales/document.php +++ b/htdocs/compta/sociales/document.php @@ -78,6 +78,8 @@ if ($user->socid) { } $result = restrictedArea($user, 'tax', $object->id, 'chargesociales', 'charges'); +$permissiontoadd = $user->rights->tax->charges->creer; // Used by the include of actions_dellink.inc.php + /* * Actions diff --git a/htdocs/compta/tva/document.php b/htdocs/compta/tva/document.php index e2f0dcec96d..67de87d0c21 100644 --- a/htdocs/compta/tva/document.php +++ b/htdocs/compta/tva/document.php @@ -79,6 +79,8 @@ if ($user->socid) { } $result = restrictedArea($user, 'tax', '', 'tva', 'charges'); +$permissiontoadd = $user->rights->tax->charges->creer; // Used by the include of actions_dellink.inc.php + /* * Actions @@ -86,7 +88,7 @@ $result = restrictedArea($user, 'tax', '', 'tva', 'charges'); include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; -if ($action == 'setlib' && $user->rights->tax->charges->creer) { +if ($action == 'setlib' && $permissiontoadd) { $object->fetch($id); $result = $object->setValueFrom('label', GETPOST('lib', 'alpha'), '', '', 'text', '', $user, 'TAX_MODIFY'); if ($result < 0) { diff --git a/htdocs/contact/document.php b/htdocs/contact/document.php index 3005c6b7827..1870e7b8d9c 100644 --- a/htdocs/contact/document.php +++ b/htdocs/contact/document.php @@ -49,12 +49,6 @@ if (!empty($canvas)) { $objcanvas->getCanvas('contact', 'contactcard', $canvas); } -// Security check -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', 'rowid', 0); // If we create a contact with no company (shared contacts), no check on write permission - // Get parameters $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); @@ -91,6 +85,15 @@ $modulepart = 'contact'; // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('contactdocument')); +// Security check +if ($user->socid) { + $socid = $user->socid; +} +$result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', 'rowid', 0); // If we create a contact with no company (shared contacts), no check on write permission + +$permissiontoadd = $user->rights->societe->contact->creer; // Used by the include of actions_dellink.inc.php + + /* * Actions */ diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index 690b5432a1b..c54823ee142 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -84,6 +84,8 @@ $modulepart = 'contract'; // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('contractcard', 'globalcard')); +$permissiontoadd = $user->rights->contrat->creer; // Used by the include of actions_dellink.inc.php + /* * Actions diff --git a/htdocs/don/document.php b/htdocs/don/document.php index 52e33a26cb4..51227a07ef4 100644 --- a/htdocs/don/document.php +++ b/htdocs/don/document.php @@ -80,6 +80,8 @@ $object->fetch($id, $ref); $upload_dir = $conf->don->dir_output.'/'.get_exdir($filename, 0, 0, 0, $object, 'donation').'/'.dol_sanitizeFileName($object->ref); $modulepart = 'don'; +$permissiontoadd = $user->rights->don->creer; // Used by the include of actions_dellink.inc.php + /* * Actions diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index ba8547726b8..03938003dfb 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -122,7 +122,7 @@ if ($user->socid) { $result = restrictedArea($user, 'expedition', $object->id, ''); $permissiondellink = $user->rights->expedition->delivery->creer; // Used by the include of actions_dellink.inc.php -//var_dump($object->lines[0]->detail_batch); +$permissiontoadd = $user->rights->expedition->creer; /* @@ -152,7 +152,6 @@ if (empty($reshook)) { // Actions to build doc $upload_dir = $conf->expedition->dir_output.'/sending'; - $permissiontoadd = $user->rights->expedition->creer; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; // Reopen diff --git a/htdocs/expedition/document.php b/htdocs/expedition/document.php index ee0014a2f8d..df88cbe7a3f 100644 --- a/htdocs/expedition/document.php +++ b/htdocs/expedition/document.php @@ -76,6 +76,8 @@ if ($user->socid) { } $result = restrictedArea($user, 'expedition', $object->id, ''); +$permissiontoadd = $user->rights->expedition->creer; // Used by the include of actions_dellink.inc.php + /* * Actions diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index fca9d9b9681..92c12f74e6d 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -139,6 +139,8 @@ if ($user->socid) { } $result = restrictedArea($user, 'expensereport', $object->id, 'expensereport'); +$permissiontoadd = $user->rights->expensereport->creer; // Used by the include of actions_dellink.inc.php + /* * Actions @@ -1339,7 +1341,6 @@ if (empty($reshook)) { // Actions to build doc $upload_dir = $conf->expensereport->dir_output; - $permissiontoadd = $user->rights->expensereport->creer; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; } diff --git a/htdocs/expensereport/document.php b/htdocs/expensereport/document.php index d7ecea8fcc9..8c3b5f56549 100644 --- a/htdocs/expensereport/document.php +++ b/htdocs/expensereport/document.php @@ -44,13 +44,6 @@ $confirm = GETPOST('confirm', 'alpha'); $childids = $user->getAllChildIds(1); -// Security check -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'expensereport', $id, 'expensereport'); - - // Get parameters $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); @@ -81,6 +74,12 @@ $modulepart = 'trip'; // Load object //include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +// Security check +if ($user->socid) { + $socid = $user->socid; +} +$result = restrictedArea($user, 'expensereport', $id, 'expensereport'); + if ($object->id > 0) { // Check current user can read this expense report $canread = 0; @@ -95,6 +94,8 @@ if ($object->id > 0) { } } +$permissiontoadd = $user->rights->expensereport->creer; // Used by the include of actions_dellink.inc.php + /* * Actions diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index a9b85840bca..09fc151c8c1 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -71,12 +71,6 @@ $hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : $hidedesc = (GETPOST('hidedesc', 'int') ? GETPOST('hidedesc', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0)); $hideref = (GETPOST('hideref', 'int') ? GETPOST('hideref', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0)); -// Security check -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'ficheinter', $id, 'fichinter'); - // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('interventioncard', 'globalcard')); @@ -96,6 +90,12 @@ if ($id > 0 || !empty($ref)) { } } +// Security check +if ($user->socid) { + $socid = $user->socid; +} +$result = restrictedArea($user, 'ficheinter', $id, 'fichinter'); + $permissionnote = $user->rights->ficheinter->creer; // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->rights->ficheinter->creer; // Used by the include of actions_dellink.inc.php diff --git a/htdocs/fichinter/document.php b/htdocs/fichinter/document.php index 74ef0c57804..f3dae0d8318 100644 --- a/htdocs/fichinter/document.php +++ b/htdocs/fichinter/document.php @@ -78,6 +78,8 @@ $object->fetch($id, $ref); $upload_dir = $conf->ficheinter->dir_output.'/'.dol_sanitizeFileName($object->ref); $modulepart = 'fichinter'; +$permissiontoadd = $user->rights->ficheinter->creer; // Used by the include of actions_setnotes.inc.php + /* * Actions diff --git a/htdocs/fourn/commande/document.php b/htdocs/fourn/commande/document.php index aea8abed665..993830eb539 100644 --- a/htdocs/fourn/commande/document.php +++ b/htdocs/fourn/commande/document.php @@ -46,12 +46,6 @@ $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); -// Security check -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'fournisseur', $id, 'commande_fournisseur', 'commande'); - // Get parameters $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); @@ -81,6 +75,15 @@ if ($object->fetch($id, $ref) < 0) { $upload_dir = $conf->fournisseur->commande->dir_output.'/'.dol_sanitizeFileName($object->ref); $object->fetch_thirdparty(); +// Security check +$socid = 0; +if ($user->socid) { + $socid = $user->socid; +} +$result = restrictedArea($user, 'fournisseur', $id, 'commande_fournisseur', 'commande'); + +$permissiontoadd = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); // Used by the include of actions_setnotes.inc.php + /* * Actions diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php index f6954635db1..4c4e92315f4 100644 --- a/htdocs/fourn/facture/document.php +++ b/htdocs/fourn/facture/document.php @@ -77,6 +77,8 @@ if ($object->fetch($id, $ref)) { $upload_dir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id, 2, 0, 0, $object, 'invoice_supplier').$ref; } +$permissiontoadd = ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer); // Used by the include of actions_setnotes.inc.php + /* * Actions diff --git a/htdocs/fourn/paiement/document.php b/htdocs/fourn/paiement/document.php index 05a13d901da..a29e9b0713c 100644 --- a/htdocs/fourn/paiement/document.php +++ b/htdocs/fourn/paiement/document.php @@ -79,6 +79,9 @@ if ($object->fetch($id, $ref)) { $upload_dir = $conf->fournisseur->payment->dir_output.'/'.dol_sanitizeFileName($object->ref); } +$permissiontoadd = ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer); // Used by the include of actions_setnotes.inc.php + + /* * Actions */ diff --git a/htdocs/holiday/document.php b/htdocs/holiday/document.php index 959543f436b..7dc086a113f 100644 --- a/htdocs/holiday/document.php +++ b/htdocs/holiday/document.php @@ -120,6 +120,7 @@ if ($user->socid) { } $result = restrictedArea($user, 'holiday', $object->id, 'holiday'); +$permissiontoadd = $user->rights->holiday->write; // Used by the include of actions_setnotes.inc.php /* diff --git a/htdocs/knowledgemanagement/knowledgerecord_document.php b/htdocs/knowledgemanagement/knowledgerecord_document.php index f3d23fba4bd..90bb9f736cc 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_document.php +++ b/htdocs/knowledgemanagement/knowledgerecord_document.php @@ -80,7 +80,7 @@ if ($id > 0 || !empty($ref)) { //if ($user->socid > 0) $socid = $user->socid; //$result = restrictedArea($user, 'knowledgemanagement', $object->id); -$permissiontoadd = $user->rights->knowledgemanagement->knowledgerecord->write; // Used by the include of actions_addupdatedelete.inc.php +$permissiontoadd = $user->rights->knowledgemanagement->knowledgerecord->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php diff --git a/htdocs/loan/document.php b/htdocs/loan/document.php index 2d6bfef3079..a151615bd35 100644 --- a/htdocs/loan/document.php +++ b/htdocs/loan/document.php @@ -71,6 +71,8 @@ if ($id > 0) { $upload_dir = $conf->loan->dir_output.'/'.dol_sanitizeFileName($object->ref); $modulepart = 'loan'; +$permissiontoadd = $user->rights->loan->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php + /* * Actions diff --git a/htdocs/mrp/mo_document.php b/htdocs/mrp/mo_document.php index 7e297206b3d..c81ed1f995e 100644 --- a/htdocs/mrp/mo_document.php +++ b/htdocs/mrp/mo_document.php @@ -83,12 +83,14 @@ if ($id > 0 || !empty($ref)) { $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); $result = restrictedArea($user, 'mrp', $object->id, 'mrp_mo', '', 'fk_soc', 'rowid', $isdraft); +$permissiontoadd = $user->rights->mrp->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php + /* * Actions */ -include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; +include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php /* diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 75d11aee3b9..919931d34ce 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -179,6 +179,9 @@ if ($object->id > 0) { // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('productcard', 'globalcard')); +$usercanread = (($object->type == Product::TYPE_PRODUCT && $user->rights->produit->lire) || ($object->type == Product::TYPE_SERVICE && $user->rights->service->lire)); +$usercancreate = (($object->type == Product::TYPE_PRODUCT && $user->rights->produit->creer) || ($object->type == Product::TYPE_SERVICE && $user->rights->service->creer)); +$usercandelete = (($object->type == Product::TYPE_PRODUCT && $user->rights->produit->supprimer) || ($object->type == Product::TYPE_SERVICE && $user->rights->service->supprimer)); /* @@ -189,9 +192,6 @@ if ($cancel) { $action = ''; } -$usercanread = (($object->type == Product::TYPE_PRODUCT && $user->rights->produit->lire) || ($object->type == Product::TYPE_SERVICE && $user->rights->service->lire)); -$usercancreate = (($object->type == Product::TYPE_PRODUCT && $user->rights->produit->creer) || ($object->type == Product::TYPE_SERVICE && $user->rights->service->creer)); -$usercandelete = (($object->type == Product::TYPE_PRODUCT && $user->rights->produit->supprimer) || ($object->type == Product::TYPE_SERVICE && $user->rights->service->supprimer)); $createbarcode = empty($conf->barcode->enabled) ? 0 : 1; if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->barcode->creer_advance)) { $createbarcode = 0; diff --git a/htdocs/product/document.php b/htdocs/product/document.php index 0b15ad7a85c..230f8375538 100644 --- a/htdocs/product/document.php +++ b/htdocs/product/document.php @@ -96,8 +96,6 @@ if ($id > 0 || !empty($ref)) { $modulepart = 'produit'; -$permissiontoadd = (($object->type == Product::TYPE_PRODUCT && $user->rights->produit->creer) || ($object->type == Product::TYPE_SERVICE && $user->rights->service->creer)); - if ($object->id > 0) { if ($object->type == $object::TYPE_PRODUCT) { restrictedArea($user, 'produit', $object->id, 'product&product', '', ''); @@ -109,6 +107,8 @@ if ($object->id > 0) { restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); } +$permissiontoadd = (($object->type == Product::TYPE_PRODUCT && $user->rights->produit->creer) || ($object->type == Product::TYPE_SERVICE && $user->rights->service->creer)); + /* * Actions diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 7b81b147b1d..e485ea3d543 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -87,6 +87,10 @@ if ($id > 0 || !empty($ref)) { } } +$usercanread = (($user->rights->stock->lire)); +$usercancreate = (($user->rights->stock->creer)); +$usercandelete = (($user->rights->stock->supprimer)); + /* * Actions @@ -94,10 +98,6 @@ if ($id > 0 || !empty($ref)) { $error = 0; -$usercanread = (($user->rights->stock->lire)); -$usercancreate = (($user->rights->stock->creer)); -$usercandelete = (($user->rights->stock->supprimer)); - $parameters = array('id'=>$id, 'ref'=>$ref); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { diff --git a/htdocs/product/stock/productlot_document.php b/htdocs/product/stock/productlot_document.php index 08b565c90a0..c6e72c6f0da 100644 --- a/htdocs/product/stock/productlot_document.php +++ b/htdocs/product/stock/productlot_document.php @@ -100,6 +100,7 @@ if (empty($upload_dir)) { $permissiontoread = $usercanread; $permissiontoadd = $usercancreate; +$permtoedit = $user->rights->produit->creer; //$permissiontodelete = $usercandelete; // Security check @@ -130,8 +131,6 @@ if (empty($reshook)) { include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; } -$permtoedit = $user->rights->produit->creer; - /* * View diff --git a/htdocs/projet/document.php b/htdocs/projet/document.php index db1f63fe8de..1bfbb9aa4a6 100644 --- a/htdocs/projet/document.php +++ b/htdocs/projet/document.php @@ -82,6 +82,7 @@ $socid = 0; //if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement. $result = restrictedArea($user, 'projet', $id, 'projet&project'); +$permissiontoadd = $user->rights->projet->creer; /* diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index a1e708b6a46..c60e3324741 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -74,6 +74,7 @@ $socid = 0; restrictedArea($user, 'projet', $object->fk_project, 'projet&project'); +$permissiontoadd = $$user->rights->mrp->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php /* diff --git a/htdocs/resource/agenda.php b/htdocs/resource/agenda.php index 6f9cfa8ce34..bf300141bc4 100644 --- a/htdocs/resource/agenda.php +++ b/htdocs/resource/agenda.php @@ -71,14 +71,18 @@ if (!$sortorder) { $sortorder = 'DESC,DESC'; } -$object = new DolResource($db); -$object->fetch($id, $ref); - // Initialize technical objects //$object=new MyObject($db); $extrafields = new ExtraFields($db); $hookmanager->initHooks(array('agendaresource')); +$object = new DolResource($db); + +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. + +$result = restrictedArea($user, 'resource', $object->id, 'resource'); + // Security check if (!$user->rights->resource->read) { accessforbidden(); diff --git a/htdocs/resource/card.php b/htdocs/resource/card.php index 989aa4ccf91..f89e16da3f9 100644 --- a/htdocs/resource/card.php +++ b/htdocs/resource/card.php @@ -48,10 +48,6 @@ if ($user->socid > 0) { accessforbidden(); } -if (!$user->rights->resource->read) { - accessforbidden(); -} - $object = new Dolresource($db); $extrafields = new ExtraFields($db); @@ -59,6 +55,14 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. + + +$result = restrictedArea($user, 'resource', $object->id, 'resource'); + +$permissiontoadd = $user->rights->resource->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php + /* diff --git a/htdocs/resource/contact.php b/htdocs/resource/contact.php index 811bb476430..aca47d49743 100644 --- a/htdocs/resource/contact.php +++ b/htdocs/resource/contact.php @@ -38,14 +38,21 @@ $id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); +$object = new DolResource($db); + +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. + // Security check if ($user->socid) { $socid = $user->socid; } -$result = restrictedArea($user, 'resource', $id, 'resource'); +$result = restrictedArea($user, 'resource', $object->id, 'resource'); -$object = new DolResource($db); -$result = $object->fetch($id, $ref); +// Security check +if (!$user->rights->resource->read) { + accessforbidden(); +} /* diff --git a/htdocs/resource/document.php b/htdocs/resource/document.php index fec869d5620..001598d2023 100644 --- a/htdocs/resource/document.php +++ b/htdocs/resource/document.php @@ -70,11 +70,17 @@ if (!$sortfield) { $object = new DolResource($db); -$object->fetch($id, $ref); + +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. $upload_dir = $conf->resource->dir_output.'/'.dol_sanitizeFileName($object->ref); $modulepart = 'resource'; +$result = restrictedArea($user, 'resource', $object->id, 'resource'); + +$permissiontoadd = $user->rights->resource->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles + /* * Actions diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index 4a51f1dfbb3..9f9ef7e54f2 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -76,6 +76,7 @@ if ($socid > 0) { // Special for thirdparty $element = 'societe'; } +// Permission is not permission on resources. We just make link here on objects. /* diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php index 356df3a746e..4e7a5c57ae7 100644 --- a/htdocs/resource/list.php +++ b/htdocs/resource/list.php @@ -66,10 +66,10 @@ $filter = array(); $param = ''; if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { - $param .= '&contextpage='.urlencode($contextpage); + $param .= '&contextpage='.urlencode($contextpage); } if ($limit > 0 && $limit != $conf->liste_limit) { - $param .= '&limit='.urlencode($limit); + $param .= '&limit='.urlencode($limit); } if ($search_ref != '') { @@ -126,9 +126,6 @@ $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -if (!$user->rights->resource->read) { - accessforbidden(); -} $arrayfields = array( 't.ref' => array( 'label' => $langs->trans("Ref"), @@ -156,6 +153,10 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' $filter = array(); } +if (empty($user->rights->resource->read)) { + accessforbidden(); +} + /* * Action diff --git a/htdocs/resource/note.php b/htdocs/resource/note.php index b43c9f8cb37..98efb72d55b 100644 --- a/htdocs/resource/note.php +++ b/htdocs/resource/note.php @@ -43,10 +43,12 @@ if ($user->socid) { // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('resourcenote')); -$result = restrictedArea($user, 'resource', $id, 'resource'); - $object = new DolResource($db); -$object->fetch($id, $ref); + +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. + +$result = restrictedArea($user, 'resource', $object->id, 'resource'); $permissionnote = $user->rights->resource->write; // Used by the include of actions_setnotes.inc.php diff --git a/htdocs/salaries/document.php b/htdocs/salaries/document.php index 4f49858eb7a..47d03e62380 100644 --- a/htdocs/salaries/document.php +++ b/htdocs/salaries/document.php @@ -104,6 +104,8 @@ if ($user->socid) { } restrictedArea($user, 'salaries', $object->id, 'salary', ''); +$permissiontoadd = $user->rights->salaries->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles + /* * Actions diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php index 23720ebd54c..9ce01c64638 100644 --- a/htdocs/societe/document.php +++ b/htdocs/societe/document.php @@ -85,6 +85,8 @@ if ($user->socid > 0) { } $result = restrictedArea($user, 'societe', $object->id, '&societe'); +$permissiontoadd = $user->rights->societe->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles + /* * Actions diff --git a/htdocs/supplier_proposal/document.php b/htdocs/supplier_proposal/document.php index 2795c006723..3d5ce3fbb47 100644 --- a/htdocs/supplier_proposal/document.php +++ b/htdocs/supplier_proposal/document.php @@ -73,6 +73,15 @@ $object->fetch($id, $ref); if ($object->id > 0) { $object->fetch_thirdparty(); $upload_dir = $conf->supplier_proposal->dir_output.'/'.dol_sanitizeFileName($object->ref); +} + + + +/* + * Actions + */ + +if ($object->id > 0) { include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; } @@ -80,6 +89,7 @@ if ($object->id > 0) { /* * View */ + $title = $langs->trans('CommRequest')." - ".$langs->trans('Documents'); $help_url = 'EN:Ask_Price_Supplier|FR:Demande_de_prix_fournisseur'; llxHeader('', $title, $help_url); diff --git a/htdocs/ticket/document.php b/htdocs/ticket/document.php index aa83b7c1038..e9f9dbbb145 100644 --- a/htdocs/ticket/document.php +++ b/htdocs/ticket/document.php @@ -70,7 +70,7 @@ if ($result < 0) { $upload_dir = $conf->ticket->dir_output."/".dol_sanitizeFileName($object->ref); } -$permissiontoadd = $user->rights->ticket->write; +$permissiontoadd = $user->rights->ticket->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles // Security check - Protection if external user $result = restrictedArea($user, 'ticket', $object->id); diff --git a/htdocs/user/document.php b/htdocs/user/document.php index a5d88d04c5d..9bd109ec5fb 100644 --- a/htdocs/user/document.php +++ b/htdocs/user/document.php @@ -60,7 +60,7 @@ if ($id) { || (($user->id != $id) && $user->rights->user->user->password)); } -$permissiontoadd = $caneditfield; +$permissiontoadd = $caneditfield; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles $permtoedit = $caneditfield; // Security check @@ -107,6 +107,7 @@ if ($id > 0 || !empty($ref)) { $hookmanager->initHooks(array('usercard', 'userdoc', 'globalcard')); + /* * Actions */ @@ -139,8 +140,6 @@ if ($object->id) { } $head = user_prepare_head($object); - $form = new Form($db); - print dol_get_fiche_head($head, 'document', $langs->trans("User"), -1, 'user'); $linkback = ''; diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 78f3e3de232..7a6c24c58f7 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -339,6 +339,7 @@ if ($action == 'replacesiteconfirm') { } $usercanedit = $user->rights->website->write; +$permissiontoadd = $user->rights->website->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles $permissiontodelete = $user->rights->website->delete; diff --git a/htdocs/workstation/workstation_document.php b/htdocs/workstation/workstation_document.php index 7c5d654a7d9..22157106154 100755 --- a/htdocs/workstation/workstation_document.php +++ b/htdocs/workstation/workstation_document.php @@ -74,12 +74,12 @@ if ($id > 0 || !empty($ref)) { $upload_dir = $conf->workstation->multidir_output[$object->entity ? $object->entity : $conf->entity]."/workstation/".get_exdir(0, 0, 0, 1, $object); } -$permissiontoadd = $user->rights->workstation->workstation->write; // Used by the include of actions_addupdatedelete.inc.php - // Security check $isdraft = 0; restrictedArea($user, $object->element, $object->id, $object->table_element, 'workstation', 'fk_soc', 'rowid', $isdraft); +$permissiontoadd = $user->rights->workstation->workstation->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles + /* * Actions From 7533d4495dc97dc1f65b753daf270b0f6fa304f0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 Oct 2021 15:39:02 +0200 Subject: [PATCH 1247/1460] Fix bug huntr.dev --- htdocs/core/actions_linkedfiles.inc.php | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/htdocs/core/actions_linkedfiles.inc.php b/htdocs/core/actions_linkedfiles.inc.php index ad9ca441e8a..86d4e923131 100644 --- a/htdocs/core/actions_linkedfiles.inc.php +++ b/htdocs/core/actions_linkedfiles.inc.php @@ -36,8 +36,19 @@ if (GETPOST('uploadform', 'int') && empty($_POST) && empty($_FILES)) { die; } +if ((GETPOST('sendit', 'alpha') + || GETPOST('linkit', 'restricthtml') + || ($action == 'confirm_deletefile' && $confirm == 'yes') + || ($action == 'confirm_updateline' && GETPOST('save', 'alpha') && GETPOST('link', 'alpha')) + || ($action == 'renamefile' && GETPOST('renamefilesave', 'alpha'))) && empty($permissiontoadd)) { + dol_syslog('The file actions_linkedfiles.inc.php was included but paramater $permissiontoadd as not set before.'); + print 'The file actions_linkedfiles.inc.php was included but paramater $permissiontoadd as not set before.'; + die; +} + + // Submit file/link -if (GETPOST('sendit', 'alpha') && !empty($conf->global->MAIN_UPLOAD_DOC) && (!isset($permissiontoadd) || $permissiontoadd)) { +if (GETPOST('sendit', 'alpha') && !empty($conf->global->MAIN_UPLOAD_DOC) && !empty($permissiontoadd)) { if (!empty($_FILES)) { if (is_array($_FILES['userfile']['tmp_name'])) { $userfiles = $_FILES['userfile']['tmp_name']; @@ -75,7 +86,7 @@ if (GETPOST('sendit', 'alpha') && !empty($conf->global->MAIN_UPLOAD_DOC) && (!is } } } -} elseif (GETPOST('linkit', 'restricthtml') && !empty($conf->global->MAIN_UPLOAD_DOC) && (!isset($permissiontoadd) || $permissiontoadd)) { +} elseif (GETPOST('linkit', 'restricthtml') && !empty($conf->global->MAIN_UPLOAD_DOC) && !empty($permissiontoadd)) { $link = GETPOST('link', 'alpha'); if ($link) { if (substr($link, 0, 7) != 'http://' && substr($link, 0, 8) != 'https://' && substr($link, 0, 7) != 'file://' && substr($link, 0, 7) != 'davs://') { @@ -87,7 +98,7 @@ if (GETPOST('sendit', 'alpha') && !empty($conf->global->MAIN_UPLOAD_DOC) && (!is // Delete file/link -if ($action == 'confirm_deletefile' && $confirm == 'yes' && (!isset($permissiontoadd) || $permissiontoadd)) { +if ($action == 'confirm_deletefile' && $confirm == 'yes' && !empty($permissiontoadd)) { $urlfile = GETPOST('urlfile', 'alpha', 0, null, null, 1); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). if (GETPOST('section', 'alpha')) { // For a delete from the ECM module, upload_dir is ECM root dir and urlfile contains relative path from upload_dir @@ -158,7 +169,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes' && (!isset($permissiont exit; } } -} elseif ($action == 'confirm_updateline' && GETPOST('save', 'alpha') && GETPOST('link', 'alpha') && (!isset($permissiontoadd) || $permissiontoadd)) { +} elseif ($action == 'confirm_updateline' && GETPOST('save', 'alpha') && GETPOST('link', 'alpha') && !empty($permissiontoadd)) { require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; $langs->load('link'); $link = new Link($db); @@ -176,7 +187,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes' && (!isset($permissiont } else { //error fetching } -} elseif ($action == 'renamefile' && GETPOST('renamefilesave', 'alpha') && (!isset($permissiontoadd) || $permissiontoadd)) { +} elseif ($action == 'renamefile' && GETPOST('renamefilesave', 'alpha') && !empty($permissiontoadd)) { // For documents pages, upload_dir contains already path to file from module dir, so we clean path into urlfile. if (!empty($upload_dir)) { $filenamefrom = dol_sanitizeFileName(GETPOST('renamefilefrom', 'alpha'), '_', 0); // Do not remove accents From 28926ab174259b480244e80c2e82a5db384dd5d0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 Oct 2021 16:25:32 +0200 Subject: [PATCH 1248/1460] Fix permission on page to set resource of an object --- htdocs/comm/action/document.php | 8 ++++---- htdocs/fichinter/card.php | 4 ++-- htdocs/resource/element_resource.php | 20 ++++++++++++++++---- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 4c4d44c3a6e..855571e834b 100644 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -201,9 +201,9 @@ if ($object->id > 0) { // Date start print ''; @@ -384,9 +379,7 @@ if ($result > 0) { print ''; print ''; }*/ - /*if ($user->admin) - { - $var = ! $var; + /*if ($user->admin) { print ''; @@ -403,7 +396,7 @@ if ($result > 0) { // List $sql = "SELECT n.rowid, n.daten, n.email, n.objet_type as object_type, n.objet_id as object_id, n.type,"; - $sql .= " c.rowid as id, c.lastname, c.firstname, c.email as contactemail,"; + $sql .= " c.rowid as id, c.lastname, c.firstname, c.email as contactemail, c.statut as status,"; $sql .= " a.code, a.label"; $sql .= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a,"; $sql .= " ".MAIN_DB_PREFIX."notify as n"; @@ -477,6 +470,8 @@ if ($result > 0) { $userstatic->id = $obj->id; $userstatic->lastname = $obj->lastname; $userstatic->firstname = $obj->firstname; + $userstatic->statut = $obj->status; + $userstatic->email = $obj->email; print $userstatic->getNomUrl(1); print $obj->email ? ' <'.$obj->email.'>' : $langs->trans("NoMail"); } else { @@ -497,13 +492,12 @@ if ($result > 0) { print ''; // TODO Add link to object here for other types /*print '';*/ + print '';*/ // print print''; print ''; From c4fbf7c422a9abf13913bf3a880ef5e95f3a3e7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 25 Oct 2021 20:48:45 +0200 Subject: [PATCH 1256/1460] fix warning --- htdocs/ticket/list.php | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 76e2208ba0b..7973861b25a 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -886,10 +886,19 @@ foreach ($object->fields as $key => $val) { print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, '', $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n"; } } +$totalarray = array( + 'nbfield' => 0, +); // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); +$parameters = array( + 'arrayfields' => $arrayfields, + 'param' => $param, + 'sortfield' => $sortfield, + 'sortorder' => $sortorder, + 'totalarray' => &$totalarray, +); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'maxwidthsearch center ')."\n"; @@ -910,7 +919,6 @@ if (!empty($extrafields->attributes[$object->table_element]['computed']) && is_a // Loop on record // -------------------------------------------------------------------- $i = 0; -$totalarray = array(); $cacheofoutputfield = array(); while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); @@ -945,15 +953,15 @@ while ($i < min($num, $limit)) { } if (!empty($arrayfields['t.'.$key]['checked'])) { print ''; From 8c08786182701b19ffc901bdbb1f7cf7156d98d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 25 Oct 2021 20:51:56 +0200 Subject: [PATCH 1257/1460] Update list.php --- htdocs/ticket/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 7973861b25a..8458d2ed459 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -953,7 +953,7 @@ while ($i < min($num, $limit)) { } if (!empty($arrayfields['t.'.$key]['checked'])) { print 'id)." OR fk_user is NULL OR fk_user = 0)"; +$sql .= " AND entity IN (".getEntity('bookmarks').")"; +$sql .= " ORDER BY position"; +if ($resql = $db->query($sql)) { + $bookmarkList = ''; - //$bookmarks .= printSearchForm($urlaction, $urlaction, $val['label'], 'minwidth200', $keysearch, $accesskey, $key, $val['img'], $showtitlebefore, ($i > 0 ? 0 : 1)); - - $i++; + $searchForm .= ''; +} else { + dol_print_error($db); } -// Execute hook printSearchForm -$parameters = array('bookmarks'=>$bookmarks); +// Execute hook printBookmarks +$parameters = array('bookmarks'=>$bookmarkList); $reshook = $hookmanager->executeHooks('printBookmarks', $parameters); // Note that $action and $object may have been modified by some hooks if (empty($reshook)) { - $bookmarks .= $hookmanager->resPrint; + $bookmarkList .= $hookmanager->resPrint; } else { - $bookmarks = $hookmanager->resPrint; + $bookmarkList = $hookmanager->resPrint; } @@ -115,7 +120,7 @@ print "\n"; print '
    '; print ''; print '
    '."\n"; -print $bookmarks; +print $bookmarkList; print '
    '."\n"; print '
    '; print "\n\n"; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 03ed22e9b19..e02369fa22f 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -680,6 +680,12 @@ textarea.centpercent { .alignstart { text-align: start; } +.start { + text-align: start; +} +.end { + text-align: end; +} .left { text-align: ; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index d929373c402..0a4eb3fc5d0 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -829,6 +829,12 @@ textarea.centpercent { .alignstart { text-align: start; } +.start { + text-align: start; +} +.end { + text-align: end; +} .left { text-align: ; } From 5694c88b701403332e2cc8c44d813b01f17d542c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 25 Oct 2021 21:33:59 +0200 Subject: [PATCH 1260/1460] fix rights and warnings --- htdocs/bookmarks/list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php index 8a5de8f4d91..642fc4995a9 100644 --- a/htdocs/bookmarks/list.php +++ b/htdocs/bookmarks/list.php @@ -62,9 +62,9 @@ $id = GETPOST("id", 'int'); $object = new Bookmark($db); -$permissiontoread = $user->rights->bookmark->lire; -$permissiontoadd = $user->rights->bookmark->write; -$permissiontodelete = $user->rights->bookmark->delete; +$permissiontoread = !empty($user->rights->bookmark->lire); +$permissiontoadd = !empty($user->rights->bookmark->creer); +$permissiontodelete = !empty($user->rights->bookmark->supprimer); /* From 8803fe64dc368241c746a327acbb9be3056fbb88 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 25 Oct 2021 21:45:00 +0200 Subject: [PATCH 1261/1460] fix scrutinizer --- htdocs/categories/viewcat.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 7ccd80eb4bd..bf089e0cd5b 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -749,7 +749,7 @@ if ($type == Categorie::TYPE_CONTACT) { $permission = $user->rights->societe->creer; $contacts = $object->getObjectsInCateg($type, 0, $limit, $offset); - if ($contacts < 0) { + if (!is_array($contacts) && $contacts < 0) { dol_print_error($db, $object->error, $object->errors); } else { print ''; From 02f8ac4cbcb135419160b795c632df332bdd826b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 Oct 2021 21:49:25 +0200 Subject: [PATCH 1262/1460] Fix error phpunit --- htdocs/delivery/class/delivery.class.php | 234 ++++++++++++----------- 1 file changed, 118 insertions(+), 116 deletions(-) diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php index dee6d021e17..491830529a1 100644 --- a/htdocs/delivery/class/delivery.class.php +++ b/htdocs/delivery/class/delivery.class.php @@ -166,11 +166,11 @@ class Delivery extends CommonObject $sql .= ", fk_incoterms, location_incoterms"; $sql .= ") VALUES ("; $sql .= "'(PROV)'"; - $sql .= ", ".$conf->entity; - $sql .= ", ".$this->socid; + $sql .= ", ".((int) $conf->entity); + $sql .= ", ".((int) $this->socid); $sql .= ", '".$this->db->escape($this->ref_customer)."'"; $sql .= ", '".$this->db->idate($now)."'"; - $sql .= ", ".$user->id; + $sql .= ", ".((int) $user->id); $sql .= ", ".($this->date_delivery ? "'".$this->db->idate($this->date_delivery)."'" : "null"); $sql .= ", ".($this->fk_delivery_address > 0 ? $this->fk_delivery_address : "null"); $sql .= ", ".(!empty($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null"); @@ -189,7 +189,7 @@ class Delivery extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."delivery "; $sql .= "SET ref = '".$this->db->escape($numref)."'"; - $sql .= " WHERE rowid = ".$this->id; + $sql .= " WHERE rowid = ".((int) $this->id); dol_syslog("Delivery::create", LOG_DEBUG); $resql = $this->db->query($sql); @@ -262,9 +262,10 @@ class Delivery extends CommonObject * @param string $qty Quantity * @param string $fk_product Id of predefined product * @param string $description Description + * @param array $array_options Array options * @return int <0 if KO, >0 if OK */ - public function create_line($origin_id, $qty, $fk_product, $description, $array_options = 0) + public function create_line($origin_id, $qty, $fk_product, $description, $array_options = null) { // phpcs:enable $error = 0; @@ -394,126 +395,126 @@ class Delivery extends CommonObject $error = 0; if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->delivery->creer)) - || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->delivery_advance->validate))) { - if (!empty($conf->global->DELIVERY_ADDON_NUMBER)) { - // Setting the command numbering module name - $modName = $conf->global->DELIVERY_ADDON_NUMBER; + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->delivery_advance->validate))) { + if (!empty($conf->global->DELIVERY_ADDON_NUMBER)) { + // Setting the command numbering module name + $modName = $conf->global->DELIVERY_ADDON_NUMBER; - if (is_readable(DOL_DOCUMENT_ROOT.'/core/modules/delivery/'.$modName.'.php')) { - require_once DOL_DOCUMENT_ROOT.'/core/modules/delivery/'.$modName.'.php'; + if (is_readable(DOL_DOCUMENT_ROOT.'/core/modules/delivery/'.$modName.'.php')) { + require_once DOL_DOCUMENT_ROOT.'/core/modules/delivery/'.$modName.'.php'; - $now = dol_now(); + $now = dol_now(); - // Retrieving the new reference - $objMod = new $modName($this->db); - $soc = new Societe($this->db); - $soc->fetch($this->socid); + // Retrieving the new reference + $objMod = new $modName($this->db); + $soc = new Societe($this->db); + $soc->fetch($this->socid); - if (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) { // empty should not happened, but when it occurs, the test save life - $numref = $objMod->delivery_get_num($soc, $this); - } else { - $numref = $this->ref; - } - $this->newref = dol_sanitizeFileName($numref); - - // Test if is not already in valid status. If so, we stop to avoid decrementing the stock twice. - $sql = "SELECT ref"; - $sql .= " FROM ".MAIN_DB_PREFIX."delivery"; - $sql .= " WHERE ref = '".$this->db->escape($numref)."'"; - $sql .= " AND fk_statut <> 0"; - $sql .= " AND entity = ".((int) $conf->entity); - - $resql = $this->db->query($sql); - if ($resql) { - $num = $this->db->num_rows($resql); - if ($num > 0) { - return 0; + if (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) { // empty should not happened, but when it occurs, the test save life + $numref = $objMod->delivery_get_num($soc, $this); + } else { + $numref = $this->ref; } - } + $this->newref = dol_sanitizeFileName($numref); - $sql = "UPDATE ".MAIN_DB_PREFIX."delivery SET"; - $sql .= " ref='".$this->db->escape($numref)."'"; - $sql .= ", fk_statut = 1"; - $sql .= ", date_valid = '".$this->db->idate($now)."'"; - $sql .= ", fk_user_valid = ".$user->id; - $sql .= " WHERE rowid = ".$this->id; - $sql .= " AND fk_statut = 0"; + // Test if is not already in valid status. If so, we stop to avoid decrementing the stock twice. + $sql = "SELECT ref"; + $sql .= " FROM ".MAIN_DB_PREFIX."delivery"; + $sql .= " WHERE ref = '".$this->db->escape($numref)."'"; + $sql .= " AND fk_statut <> 0"; + $sql .= " AND entity = ".((int) $conf->entity); - $resql = $this->db->query($sql); - if (!$resql) { - dol_print_error($this->db); - $this->error = $this->db->lasterror(); - $error++; - } + $resql = $this->db->query($sql); + if ($resql) { + $num = $this->db->num_rows($resql); + if ($num > 0) { + return 0; + } + } - if (!$error && !$notrigger) { - // Call trigger - $result = $this->call_trigger('DELIVERY_VALIDATE', $user); - if ($result < 0) { + $sql = "UPDATE ".MAIN_DB_PREFIX."delivery SET"; + $sql .= " ref='".$this->db->escape($numref)."'"; + $sql .= ", fk_statut = 1"; + $sql .= ", date_valid = '".$this->db->idate($now)."'"; + $sql .= ", fk_user_valid = ".$user->id; + $sql .= " WHERE rowid = ".((int) $this->id); + $sql .= " AND fk_statut = 0"; + + $resql = $this->db->query($sql); + if (!$resql) { + dol_print_error($this->db); + $this->error = $this->db->lasterror(); $error++; } - // End call triggers - } - if (!$error) { - $this->oldref = $this->ref; - - // Rename directory if dir was a temporary ref - if (preg_match('/^[\(]?PROV/i', $this->ref)) { - // Now we rename also files into index - $sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filename = CONCAT('".$this->db->escape($this->newref)."', SUBSTR(filename, ".(strlen($this->ref) + 1).")), filepath = 'expedition/receipt/".$this->db->escape($this->newref)."'"; - $sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'expedition/receipt/".$this->db->escape($this->ref)."' and entity = ".((int) $conf->entity); - $resql = $this->db->query($sql); - if (!$resql) { - $error++; $this->error = $this->db->lasterror(); + if (!$error && !$notrigger) { + // Call trigger + $result = $this->call_trigger('DELIVERY_VALIDATE', $user); + if ($result < 0) { + $error++; } + // End call triggers + } - // We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments - $oldref = dol_sanitizeFileName($this->ref); - $newref = dol_sanitizeFileName($numref); - $dirsource = $conf->expedition->dir_output.'/receipt/'.$oldref; - $dirdest = $conf->expedition->dir_output.'/receipt/'.$newref; - if (!$error && file_exists($dirsource)) { - dol_syslog(get_class($this)."::valid rename dir ".$dirsource." into ".$dirdest); + if (!$error) { + $this->oldref = $this->ref; - if (@rename($dirsource, $dirdest)) { - dol_syslog("Rename ok"); - // Rename docs starting with $oldref with $newref - $listoffiles = dol_dir_list($conf->expedition->dir_output.'/receipt/'.$newref, 'files', 1, '^'.preg_quote($oldref, '/')); - foreach ($listoffiles as $fileentry) { - $dirsource = $fileentry['name']; - $dirdest = preg_replace('/^'.preg_quote($oldref, '/').'/', $newref, $dirsource); - $dirsource = $fileentry['path'].'/'.$dirsource; - $dirdest = $fileentry['path'].'/'.$dirdest; - @rename($dirsource, $dirdest); + // Rename directory if dir was a temporary ref + if (preg_match('/^[\(]?PROV/i', $this->ref)) { + // Now we rename also files into index + $sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filename = CONCAT('".$this->db->escape($this->newref)."', SUBSTR(filename, ".(strlen($this->ref) + 1).")), filepath = 'expedition/receipt/".$this->db->escape($this->newref)."'"; + $sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'expedition/receipt/".$this->db->escape($this->ref)."' and entity = ".((int) $conf->entity); + $resql = $this->db->query($sql); + if (!$resql) { + $error++; $this->error = $this->db->lasterror(); + } + + // We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments + $oldref = dol_sanitizeFileName($this->ref); + $newref = dol_sanitizeFileName($numref); + $dirsource = $conf->expedition->dir_output.'/receipt/'.$oldref; + $dirdest = $conf->expedition->dir_output.'/receipt/'.$newref; + if (!$error && file_exists($dirsource)) { + dol_syslog(get_class($this)."::valid rename dir ".$dirsource." into ".$dirdest); + + if (@rename($dirsource, $dirdest)) { + dol_syslog("Rename ok"); + // Rename docs starting with $oldref with $newref + $listoffiles = dol_dir_list($conf->expedition->dir_output.'/receipt/'.$newref, 'files', 1, '^'.preg_quote($oldref, '/')); + foreach ($listoffiles as $fileentry) { + $dirsource = $fileentry['name']; + $dirdest = preg_replace('/^'.preg_quote($oldref, '/').'/', $newref, $dirsource); + $dirsource = $fileentry['path'].'/'.$dirsource; + $dirdest = $fileentry['path'].'/'.$dirdest; + @rename($dirsource, $dirdest); + } } } } + + // Set new ref and current status + if (!$error) { + $this->ref = $numref; + $this->statut = 1; + } + + dol_syslog(get_class($this)."::valid ok"); } - // Set new ref and current status if (!$error) { - $this->ref = $numref; - $this->statut = 1; + $this->db->commit(); + return 1; + } else { + $this->db->rollback(); + return -1; } - - dol_syslog(get_class($this)."::valid ok"); - } - - if (!$error) { - $this->db->commit(); - return 1; - } else { - $this->db->rollback(); - return -1; } } + } else { + $this->error = "Non autorise"; + dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); + return -1; } - } else { - $this->error = "Non autorise"; - dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); - return -1; - } } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -600,15 +601,16 @@ class Delivery extends CommonObject /** * Add line * - * @param int $origin_id Origin id - * @param int $qty Qty + * @param int $origin_id Origin id + * @param int $qty Qty + * @param array $array_options Array options * @return void */ - public function addline($origin_id, $qty, $array_options = 0) + public function addline($origin_id, $qty, $array_options = null) { global $conf; - $num = count($this->lines); + $num = count($this->lines); $line = new DeliveryLine($this->db); $line->origin_id = $origin_id; @@ -666,7 +668,7 @@ class Delivery extends CommonObject if (!$error) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."delivery"; - $sql .= " WHERE rowid = ".$this->id; + $sql .= " WHERE rowid = ".((int) $this->id); if ($this->db->query($sql)) { $this->db->commit(); @@ -734,8 +736,8 @@ class Delivery extends CommonObject //if ($option !== 'nolink') //{ - // Add param to save lastsearch_values or not - $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0); + // Add param to save lastsearch_values or not + $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0); if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) { $add_save_lastsearch_values = 1; } @@ -861,12 +863,12 @@ class Delivery extends CommonObject if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("mymodule"); - $this->labelStatus[-1] = $langs->trans('StatusDeliveryCanceled'); - $this->labelStatus[0] = $langs->trans('StatusDeliveryDraft'); - $this->labelStatus[1] = $langs->trans('StatusDeliveryValidated'); - $this->labelStatusShort[-1] = $langs->trans('StatusDeliveryCanceled'); - $this->labelStatusShort[0] = $langs->trans('StatusDeliveryDraft'); - $this->labelStatusShort[1] = $langs->trans('StatusDeliveryValidated'); + $this->labelStatus[-1] = $langs->transnoentitiesnoconv('StatusDeliveryCanceled'); + $this->labelStatus[0] = $langs->transnoentitiesnoconv('StatusDeliveryDraft'); + $this->labelStatus[1] = $langs->transnoentitiesnoconv('StatusDeliveryValidated'); + $this->labelStatusShort[-1] = $langs->transnoentitiesnoconv('StatusDeliveryCanceled'); + $this->labelStatusShort[0] = $langs->transnoentitiesnoconv('StatusDeliveryDraft'); + $this->labelStatusShort[1] = $langs->transnoentitiesnoconv('StatusDeliveryValidated'); } $statusType = 'status0'; @@ -995,7 +997,7 @@ class Delivery extends CommonObject $array[$i]['label'] = $objSourceLine->label ? $objSourceLine->label : $objSourceLine->description; } - $i++; + $i++; } return $array; } else { @@ -1016,7 +1018,7 @@ class Delivery extends CommonObject if ($user->rights->expedition->creer) { $sql = "UPDATE ".MAIN_DB_PREFIX."delivery"; $sql .= " SET date_delivery = ".($delivery_date ? "'".$this->db->idate($delivery_date)."'" : 'null'); - $sql .= " WHERE rowid = ".$this->id; + $sql .= " WHERE rowid = ".((int) $this->id); dol_syslog(get_class($this)."::setDeliveryDate", LOG_DEBUG); $resql = $this->db->query($sql); From cfd88cb6e5cc48b343cea190998aa8a4a681e1d1 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 25 Oct 2021 21:50:27 +0200 Subject: [PATCH 1263/1460] fix scrutinizer error --- .../societe/doc/doc_generic_odt.modules.php | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php index 8b8069ff34f..6427a6a60a3 100644 --- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php +++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php @@ -320,17 +320,22 @@ class doc_generic_odt extends ModeleThirdPartyDoc foreach ($contact_arrray as $array_key => $contact_id) { $res_contact = $contactstatic->fetch($contact_id); - $tmparray = $this->get_substitutionarray_contact($contactstatic, $outputlangs, 'contact'); - foreach ($tmparray as $key => $val) { - try { - $listlines->setVars($key, $val, true, 'UTF-8'); - } catch (OdfException $e) { - dol_syslog($e->getMessage(), LOG_INFO); - } catch (SegmentException $e) { - dol_syslog($e->getMessage(), LOG_INFO); + if ((int) $res_contact > 0) { + $tmparray = $this->get_substitutionarray_contact($contactstatic, $outputlangs, 'contact'); + foreach ($tmparray as $key => $val) { + try { + $listlines->setVars($key, $val, true, 'UTF-8'); + } catch (OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); + } catch (SegmentException $e) { + dol_syslog($e->getMessage(), LOG_INFO); + } } + $listlines->merge(); + } else { + $this->error = $contactstatic->error; + dol_syslog($this->error, LOG_WARNING); } - $listlines->merge(); } $odfHandler->mergeSegment($listlines); } catch (OdfException $e) { From 9a2e1df94a1813dcbb78f2d5d2e33498f47e2112 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 25 Oct 2021 21:54:56 +0200 Subject: [PATCH 1264/1460] fix scrutinizer error --- htdocs/resource/class/html.formresource.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/resource/class/html.formresource.class.php b/htdocs/resource/class/html.formresource.class.php index a8b17665fa1..99916b8ed70 100644 --- a/htdocs/resource/class/html.formresource.class.php +++ b/htdocs/resource/class/html.formresource.class.php @@ -224,8 +224,9 @@ class FormResource $value = ($maxlength ?dol_trunc($arraytypes['label'], $maxlength) : $arraytypes['label']); } elseif ($format == 3) { $value = $arraytypes['code']; + } elseif (empty($value)) { + print ' '; } - print $value ? $value : ' '; print ''; } } From 7638a2a8a07c5dc7b774d19ba473400455e93317 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 25 Oct 2021 22:00:45 +0200 Subject: [PATCH 1265/1460] fix warnings --- htdocs/comm/action/list.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 985a403b086..7f3cb247c59 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -4,7 +4,7 @@ * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2017 Open-DSI - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2021 Frédéric France * Copyright (C) 2020 Tobias Sekan * * This program is free software; you can redistribute it and/or modify @@ -636,7 +636,9 @@ if (empty($reshook)) { } elseif ($reshook > 1) { $s = $hookmanager->resPrint; } - +$viewyear = is_object($object) ? dol_print_date($object->datep, '%Y') : ''; +$viewmonth = is_object($object) ? dol_print_date($object->datep, '%m') : ''; +$viewday = is_object($object) ? dol_print_date($object->datep, '%d') : ''; $viewmode = ''; $viewmode .= ''; //$viewmode .= ''; @@ -644,25 +646,25 @@ $viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="imgforviewm //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewList").''; -$viewmode .= ''; +$viewmode .= ''; //$viewmode .= ''; $viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendarmonth', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewCal").''; -$viewmode .= ''; +$viewmode .= ''; //$viewmode .= ''; $viewmode .= img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewWeek").''; -$viewmode .= ''; +$viewmode .= ''; //$viewmode .= ''; $viewmode .= img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewDay").''; -$viewmode .= ''; +$viewmode .= ''; //$viewmode .= ''; $viewmode .= img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="pictoactionview block"'); //$viewmode .= ''; From e3f4c70aeaf02bbc16cd2262601888dd32b2ce79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 25 Oct 2021 22:01:36 +0200 Subject: [PATCH 1266/1460] Update list.php --- htdocs/comm/action/list.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 7f3cb247c59..7273ebad1c3 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -629,7 +629,8 @@ print $nav; $s = $newtitle; // Calendars from hooks -$parameters = array(); $object = null; +$parameters = array(); +$object = null; $reshook = $hookmanager->executeHooks('addCalendarChoice', $parameters, $object, $action); if (empty($reshook)) { $s .= $hookmanager->resPrint; @@ -673,7 +674,8 @@ $viewmode .= ''; // Add more views from hooks -$parameters = array(); $object = null; +$parameters = array(); +$object = null; $reshook = $hookmanager->executeHooks('addCalendarView', $parameters, $object, $action); if (empty($reshook)) { $viewmode .= $hookmanager->resPrint; From 5469d49102e99c7b539ac5bc69de012c2a6b120e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 25 Oct 2021 22:04:19 +0200 Subject: [PATCH 1267/1460] fix warning --- htdocs/comm/action/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 985a403b086..b1b1de6d955 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -681,7 +681,7 @@ if (empty($reshook)) { $tmpforcreatebutton = dol_getdate(dol_now(), true); -$newparam .= '&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$tmpforcreatebutton['year']; +$newparam = '&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$tmpforcreatebutton['year']; //$param='month='.$monthshown.'&year='.$year; $hourminsec = '100000'; From 5567310e4471bd747f27f85adc7beda99b26844f Mon Sep 17 00:00:00 2001 From: Scrutinizer Auto-Fixer Date: Mon, 25 Oct 2021 20:07:31 +0000 Subject: [PATCH 1268/1460] Scrutinizer Auto-Fixes This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com --- .../adherents/class/adherent_type.class.php | 12 +-- htdocs/adherents/subscription/card.php | 2 +- htdocs/admin/agenda_other.php | 36 ++++---- .../admin/dolistore/class/dolistore.class.php | 2 +- htdocs/admin/prelevement.php | 4 +- htdocs/admin/taxes.php | 2 +- htdocs/admin/tools/export.php | 2 +- htdocs/admin/workstation.php | 4 +- htdocs/api/class/api_documents.class.php | 4 +- htdocs/asset/card.php | 4 +- htdocs/barcode/printsheet.php | 6 +- htdocs/categories/class/categorie.class.php | 5 +- htdocs/comm/action/pertype.php | 4 +- htdocs/compta/accounting-files.php | 2 +- htdocs/compta/bank/various_payment/card.php | 2 +- .../facture/class/facture-rec.class.php | 12 +-- htdocs/compta/facture/class/facture.class.php | 7 +- htdocs/compta/prelevement/create.php | 4 +- .../class/paymentsocialcontribution.class.php | 2 +- htdocs/contrat/card.php | 4 +- htdocs/core/ajax/ajaxdirpreview.php | 4 +- ...box_customers_outstanding_bill_reached.php | 2 +- .../core/boxes/box_funnel_of_prospection.php | 30 +++---- .../boxes/box_graph_nb_ticket_last_x_days.php | 26 +++--- htdocs/core/class/commoninvoice.class.php | 4 +- htdocs/core/class/defaultvalues.class.php | 10 ++- htdocs/core/class/html.formfile.class.php | 12 +-- htdocs/core/class/infobox.class.php | 2 +- htdocs/core/class/smtps.class.php | 4 +- htdocs/core/lib/date.lib.php | 2 +- htdocs/core/lib/import.lib.php | 2 +- htdocs/core/lib/memory.lib.php | 20 ++--- htdocs/core/lib/price.lib.php | 6 +- htdocs/core/lib/security.lib.php | 2 +- htdocs/core/lib/security2.lib.php | 2 +- .../commande/doc/pdf_einstein.modules.php | 4 +- htdocs/core/modules/modCategorie.class.php | 12 +-- .../modules/propale/doc/pdf_cyan.modules.php | 2 +- .../doc/pdf_canelle.modules.php | 2 +- .../doc/pdf_muscadet.modules.php | 6 +- .../doc/pdf_standard.modules.php | 2 +- .../doc/pdf_aurore.modules.php | 2 +- .../workstation/mod_workstation_advanced.php | 2 +- htdocs/core/photos_resize.php | 2 +- .../tpl/extrafields_list_search_param.tpl.php | 20 ++--- htdocs/core/tpl/extrafields_view.tpl.php | 2 +- htdocs/core/tpl/massactions_pre.tpl.php | 16 ++-- ...e_20_modWorkflow_WorkflowManager.class.php | 4 +- htdocs/ecm/index_auto.php | 4 +- .../class/conferenceorbooth.class.php | 36 ++++---- htdocs/exports/class/export.class.php | 2 +- htdocs/fourn/facture/paiement.php | 4 +- htdocs/index.php | 2 +- htdocs/install/upgrade2.php | 2 +- htdocs/mrp/mo_note.php | 2 +- htdocs/paypal/lib/paypal.lib.php | 2 +- .../class/productcustomerprice.class.php | 2 +- htdocs/product/stock/productlot_document.php | 4 +- htdocs/product/stock/stockatdate.php | 2 +- htdocs/projet/element.php | 2 +- htdocs/projet/graph_opportunities.inc.php | 4 +- htdocs/projet/tasks/contact.php | 4 +- htdocs/societe/class/societe.class.php | 82 +++++++++---------- htdocs/societe/price.php | 2 +- .../class/supplier_proposal.class.php | 6 +- htdocs/theme/eldy/manifest.json.php | 18 ++-- htdocs/theme/md/manifest.json.php | 2 +- htdocs/user/home.php | 80 +++++++++--------- .../webservices/server_productorservice.php | 2 +- .../class/workstationresource.class.php | 4 +- .../class/workstationusergroup.class.php | 4 +- htdocs/workstation/lib/workstation.lib.php | 2 +- 72 files changed, 307 insertions(+), 291 deletions(-) diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 90b34e604be..6be452c86de 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -250,12 +250,12 @@ class AdherentType extends CommonObject } /** - * Delete a language for this member type - * - * @param string $langtodelete Language code to delete - * @param User $user Object user making delete - * @return int <0 if KO, >0 if OK - */ + * Delete a language for this member type + * + * @param string $langtodelete Language code to delete + * @param User $user Object user making delete + * @return int <0 if KO, >0 if OK + */ public function delMultiLangs($langtodelete, $user) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."adherent_type_lang"; diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php index 0dca0d86193..5967d670856 100644 --- a/htdocs/adherents/subscription/card.php +++ b/htdocs/adherents/subscription/card.php @@ -59,7 +59,7 @@ $permissiontoedit = $user->rights->adherent->cotisation->creer; // Used by the i $hookmanager->initHooks(array('subscriptioncard', 'globalcard')); // Security check -$result = restrictedArea($user, 'subscription', 0); // TODO Check on object id +$result = restrictedArea($user, 'subscription', 0); // TODO Check on object id /* diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index 8060398574c..1cce5388f90 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -83,26 +83,26 @@ if ($action == 'set') { dolibarr_set_const($db, 'AGENDA_DEFAULT_VIEW', GETPOST('AGENDA_DEFAULT_VIEW'), 'chaine', 0, '', $conf->entity); $defaultValues = new DefaultValues($db); - $result = $defaultValues->fetchAll('', '', 0, 0, array('t.page'=>'comm/action/card.php', 't.param'=>'complete','t.user_id'=>'0', 't.type'=>'createform', 't.entity'=>$conf->entity)); - if (!is_array($result) && $result<0) { + $result = $defaultValues->fetchAll('', '', 0, 0, array('t.page'=>'comm/action/card.php', 't.param'=>'complete', 't.user_id'=>'0', 't.type'=>'createform', 't.entity'=>$conf->entity)); + if (!is_array($result) && $result < 0) { setEventMessages($defaultValues->error, $defaultValues->errors, 'errors'); - } elseif (count($result)>0) { + } elseif (count($result) > 0) { foreach ($result as $defval) { - $defaultValues->id=$defval->id; + $defaultValues->id = $defval->id; $resultDel = $defaultValues->delete($user); - if ($resultDel<0) { + if ($resultDel < 0) { setEventMessages($defaultValues->error, $defaultValues->errors, 'errors'); } } } - $defaultValues->type='createform'; - $defaultValues->entity=$conf->entity; - $defaultValues->user_id=0; - $defaultValues->page='comm/action/card.php'; - $defaultValues->param='complete'; - $defaultValues->value=GETPOST('AGENDA_EVENT_DEFAULT_STATUS'); - $resultCreat=$defaultValues->create($user); - if ($resultCreat<0) { + $defaultValues->type = 'createform'; + $defaultValues->entity = $conf->entity; + $defaultValues->user_id = 0; + $defaultValues->page = 'comm/action/card.php'; + $defaultValues->param = 'complete'; + $defaultValues->value = GETPOST('AGENDA_EVENT_DEFAULT_STATUS'); + $resultCreat = $defaultValues->create($user); + if ($resultCreat < 0) { setEventMessages($defaultValues->error, $defaultValues->errors, 'errors'); } } elseif ($action == 'specimen') { // For orders @@ -355,13 +355,13 @@ print '
    '."\n"; print ''."\n"; print ''."\n"; print ''."\n"; diff --git a/htdocs/admin/dolistore/class/dolistore.class.php b/htdocs/admin/dolistore/class/dolistore.class.php index 5e7a229fee3..25446dbed4d 100644 --- a/htdocs/admin/dolistore/class/dolistore.class.php +++ b/htdocs/admin/dolistore/class/dolistore.class.php @@ -307,7 +307,7 @@ class Dolistore } } else { //need update - $version = ''.$langs->trans( + $version = ''.$langs->trans( 'CompatibleAfterUpdate', DOL_VERSION, $product->dolibarr_min, diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index e09dd13b045..207642fe8e3 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -102,11 +102,11 @@ if ($action == "set") { } $res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"), 'chaine', 0, '', $conf->entity); - if (! ($res > 0)) { + if (!($res > 0)) { $error++; } - if (! $error) { + if (!$error) { $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php index 613c8853297..646f4a7be74 100644 --- a/htdocs/admin/taxes.php +++ b/htdocs/admin/taxes.php @@ -270,7 +270,7 @@ print ''; echo '
    '; echo '
    '.$form->editfieldkey('RubriquesTransactions', 'custcats', '', $object, 0).''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_BANK_LINE, null, 'parent', null, null, 1); $arrayselected = array(); + $c = new Categorie($db); + $cats = $c->containing($bankline->id, Categorie::TYPE_BANK_LINE); + foreach ($cats as $cat) { + $arrayselected[] = $cat->id; + } print img_picto('', 'category', 'class="paddingright"').$form->multiselectarray('custcats', $cate_arbo, $arrayselected, null, null, null, null, "90%"); print "
    '; // We use showempty=0 here because there is already an unknown value into dictionary. - print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 1, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT), 'minwidth50 maxwidth100', 1); + print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 1, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT), 'minwidth50 maxwidth125', 1); print ''; if (!isset($typenArray) || !is_array($typenArray) || count($typenArray) == 0) { $typenArray = $formcompany->typent_array(1); } - print empty($typenArray[$obj->typent_code]) ? '' : $typenArray[$obj->typent_code]; + $labeltypeofcompany= empty($typenArray[$obj->typent_code]) ? '' : $typenArray[$obj->typent_code]; + + print ''; + print dol_escape_htmltag($labeltypeofcompany); print '".dol_escape_htmltag($key)."".dol_escape_htmltag($type2label[$extrafields->attributes[$elementtype]['type'][$key]])."'; + print dol_escape_htmltag($typetoshow); + print "'.dol_escape_htmltag($extrafields->attributes[$elementtype]['size'][$key])."
    '.$langs->trans("DateActionStart").''; if (!$object->fulldayevent) { - print dol_print_date($object->datep, 'dayhour'); + print dol_print_date($object->datep, 'dayhour', 'tzuser'); } else { - print dol_print_date($object->datep, 'day'); + print dol_print_date($object->datep, 'day', 'tzuser'); } if ($object->percentage == 0 && $object->datep && $object->datep < ($now - $delay_warning)) { print img_warning($langs->trans("Late")); @@ -214,9 +214,9 @@ if ($object->id > 0) { // Date end print '
    '.$langs->trans("DateActionEnd").''; if (!$object->fulldayevent) { - print dol_print_date($object->datef, 'dayhour'); + print dol_print_date($object->datef, 'dayhour', 'tzuser'); } else { - print dol_print_date($object->datef, 'day'); + print dol_print_date($object->datef, 'day', 'tzuser'); } if ($object->percentage > 0 && $object->percentage < 100 && $object->datef && $object->datef < ($now - $delay_warning)) { print img_warning($langs->trans("Late")); diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 09fc151c8c1..32147367d4e 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -66,6 +66,8 @@ $originid = (GETPOST('originid', 'int') ?GETPOST('originid', 'int') : GETPOST('o $note_public = GETPOST('note_public', 'restricthtml'); $lineid = GETPOST('line_id', 'int'); +$error = 0; + //PDF $hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0)); $hidedesc = (GETPOST('hidedesc', 'int') ? GETPOST('hidedesc', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0)); @@ -99,8 +101,6 @@ $result = restrictedArea($user, 'ficheinter', $id, 'fichinter'); $permissionnote = $user->rights->ficheinter->creer; // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->rights->ficheinter->creer; // Used by the include of actions_dellink.inc.php -$error = 0; - /* * Actions diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index 9f9ef7e54f2..e6a8a02d59a 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -77,6 +77,18 @@ if ($socid > 0) { // Special for thirdparty } // Permission is not permission on resources. We just make link here on objects. +if ($element == 'action') { + $result = restrictedArea($user, 'agenda', $element_id, 'actioncomm&societe', 'myactions|allactions', 'fk_soc', 'id'); +} +if ($element == 'fichinter') { + $result = restrictedArea($user, 'ficheinter', $element_id, 'fichinter'); +} +if ($element == 'product' || $element == 'service') { // When RESOURCE_ON_PRODUCTS or RESOURCE_ON_SERVICES is set + $tmpobject = new Product($db); + $tmpobject->fetch($element_id); + $fieldtype = $tmpobject->type; + $result = restrictedArea($user, 'produit|service', $element_id, 'product&product', '', '', $fieldtype); +} /* @@ -371,9 +383,9 @@ if (!$ret) { // Date start print '
    '.$langs->trans("DateActionStart").''; if (!$act->fulldayevent) { - print dol_print_date($act->datep, 'dayhour'); + print dol_print_date($act->datep, 'dayhour', 'tzuser'); } else { - print dol_print_date($act->datep, 'day'); + print dol_print_date($act->datep, 'day', 'tzuser'); } if ($act->percentage == 0 && $act->datep && $act->datep < ($now - $delay_warning)) { print img_warning($langs->trans("Late")); @@ -384,9 +396,9 @@ if (!$ret) { // Date end print '
    '.$langs->trans("DateActionEnd").''; if (!$act->fulldayevent) { - print dol_print_date($act->datef, 'dayhour'); + print dol_print_date($act->datef, 'dayhour', 'tzuser'); } else { - print dol_print_date($act->datef, 'day'); + print dol_print_date($act->datef, 'day', 'tzuser'); } if ($act->percentage > 0 && $act->percentage < 100 && $act->datef && $act->datef < ($now - $delay_warning)) { print img_warning($langs->trans("Late")); From 02632e9e88c15863391cf3ce2e461d9fe85bab73 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 Oct 2021 16:30:55 +0200 Subject: [PATCH 1249/1460] Fix need write permission on object to link/remove resource --- htdocs/core/lib/security.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index e6d2d2aa74f..6cc4650bea4 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -364,7 +364,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f // Check write permission from module (we need to know write permission to create but also to delete drafts record or to upload files) $createok = 1; $nbko = 0; - $wemustcheckpermissionforcreate = (GETPOST('sendit', 'alpha') || GETPOST('linkit', 'alpha') || GETPOST('action', 'aZ09') == 'create' || GETPOST('action', 'aZ09') == 'update') || GETPOST('roworder', 'alpha', 2); + $wemustcheckpermissionforcreate = (GETPOST('sendit', 'alpha') || GETPOST('linkit', 'alpha') || in_array(GETPOST('action', 'aZ09'), array('create', 'update', 'add_element_resource', 'confirm_delete_linked_resource')) || GETPOST('roworder', 'alpha', 2)); $wemustcheckpermissionfordeletedraft = ((GETPOST("action", "aZ09") == 'confirm_delete' && GETPOST("confirm", "aZ09") == 'yes') || GETPOST("action", "aZ09") == 'delete'); if ($wemustcheckpermissionforcreate || $wemustcheckpermissionfordeletedraft) { From d96de15788550ea8035a3924e77bb7d23d4be747 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 Oct 2021 17:12:06 +0200 Subject: [PATCH 1250/1460] Comment --- htdocs/user/bank.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 0f6b5302982..6bf0cc66c7c 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -83,7 +83,7 @@ $canreaduser = (!empty($user->admin) || $user->rights->user->user->lire); $permissiontoaddbankaccount = (!empty($user->rights->salaries->write) || !empty($user->rights->hrm->employee->write) || !empty($user->rights->user->creer)); // Ok if user->rights->salaries->read or user->rights->hrm->read -//$result = restrictedArea($user, 'salaries|hrm', $id, 'user&user', $feature2); +//$result = restrictedArea($user, 'salaries|hrm', $object->id, 'user&user', $feature2); $ok = false; if ($user->id == $id) { $ok = true; // A user can always read its own card From 4869f2ea2de95f1d0f8c467407b847aec078c94e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 Oct 2021 17:58:55 +0200 Subject: [PATCH 1251/1460] css --- htdocs/theme/eldy/global.inc.php | 2 +- htdocs/theme/md/style.css.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index b3c13594939..03ed22e9b19 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1683,7 +1683,7 @@ select.widthcentpercentminusxx, span.widthcentpercentminusxx:not(.select2-select } .linkobject { cursor: pointer; } -table.tableforfield tr>td:first-of-type, tr.trforfield>td:first-of-type, div.tableforfield div.tagtr>div.tagtd:first-of-type { +table.tableforfield tr:not(.liste_titre)>td:first-of-type, tr.trforfield:not(.liste_titre)>td:first-of-type, div.tableforfield div.tagtr:not(.liste_titre)>div.tagtd:first-of-type { color: var(--tableforfieldcolor); } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index bd4ebed0b49..d929373c402 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1699,7 +1699,7 @@ table[summary="list_of_modules"] .fa-cog { } .linkobject { cursor: pointer; } -table.tableforfield tr>td:first-of-type, tr.trforfield>td:first-of-type, div.tableforfield div.tagtr>div.tagtd:first-of-type { +table.tableforfield tr:not(.liste_titre)>td:first-of-type, tr.trforfield:not(.liste_titre)>td:first-of-type, div.tableforfield div.tagtr:not(.liste_titre)>div.tagtd:first-of-type { color: #666; } From 1aa59a8b739c1eeeb7142336216d2e7d2e652f5c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 Oct 2021 18:28:04 +0200 Subject: [PATCH 1252/1460] Fix avoid duplicate fetch_optionnal when updating contract lines --- htdocs/contrat/class/contrat.class.php | 106 ++++++++++++------------- 1 file changed, 49 insertions(+), 57 deletions(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 793273c833f..fe8edd30ea4 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1729,85 +1729,77 @@ class Contrat extends CommonObject } } - $sql = "UPDATE ".MAIN_DB_PREFIX."contratdet set description='".$this->db->escape($desc)."'"; - $sql .= ",price_ht='".price2num($price)."'"; - $sql .= ",subprice='".price2num($subprice)."'"; - $sql .= ",remise='".price2num($remise)."'"; - $sql .= ",remise_percent='".price2num($remise_percent)."'"; - $sql .= ",qty='".$qty."'"; - $sql .= ",tva_tx='".price2num($tvatx)."'"; - $sql .= ",localtax1_tx='".price2num($localtax1tx)."'"; - $sql .= ",localtax2_tx='".price2num($localtax2tx)."'"; - $sql .= ",localtax1_type='".$this->db->escape($localtax1_type)."'"; - $sql .= ",localtax2_type='".$this->db->escape($localtax2_type)."'"; - $sql .= ", total_ht='".price2num($total_ht)."'"; - $sql .= ", total_tva='".price2num($total_tva)."'"; - $sql .= ", total_localtax1='".price2num($total_localtax1)."'"; - $sql .= ", total_localtax2='".price2num($total_localtax2)."'"; - $sql .= ", total_ttc='".price2num($total_ttc)."'"; + $sql = "UPDATE ".MAIN_DB_PREFIX."contratdet set description = '".$this->db->escape($desc)."'"; + $sql .= ",price_ht = ".((float) price2num($price)); + $sql .= ",subprice = ".((float) price2num($subprice)); + $sql .= ",remise = ".((float) price2num($remise)); + $sql .= ",remise_percent = ".((float) price2num($remise_percent)); + $sql .= ",qty = ".((float) $qty); + $sql .= ",tva_tx = ".((float) price2num($tvatx)); + $sql .= ",localtax1_tx = ".((float) price2num($localtax1tx)); + $sql .= ",localtax2_tx = ".((float) price2num($localtax2tx)); + $sql .= ",localtax1_type='".$this->db->escape($localtax1_type); + $sql .= ",localtax2_type='".$this->db->escape($localtax2_type); + $sql .= ", total_ht = ".((float) price2num($total_ht)); + $sql .= ", total_tva = ".((float) price2num($total_tva)); + $sql .= ", total_localtax1 = ".((float) price2num($total_localtax1)); + $sql .= ", total_localtax2 = ".((float) price2num($total_localtax2)); + $sql .= ", total_ttc = ".((float) price2num($total_ttc)); $sql .= ", fk_product_fournisseur_price=".($fk_fournprice > 0 ? $fk_fournprice : "null"); - $sql .= ", buy_price_ht='".price2num($pa_ht)."'"; + $sql .= ", buy_price_ht = ".((float) price2num($pa_ht)); if ($date_start > 0) { - $sql .= ",date_ouverture_prevue='".$this->db->idate($date_start)."'"; + $sql .= ",date_ouverture_prevue = '".$this->db->idate($date_start)."'"; } else { - $sql .= ",date_ouverture_prevue=null"; + $sql .= ",date_ouverture_prevue = null"; } if ($date_end > 0) { - $sql .= ",date_fin_validite='".$this->db->idate($date_end)."'"; + $sql .= ",date_fin_validite = '".$this->db->idate($date_end)."'"; } else { - $sql .= ",date_fin_validite=null"; + $sql .= ",date_fin_validite = null"; } if ($date_debut_reel > 0) { - $sql .= ",date_ouverture='".$this->db->idate($date_debut_reel)."'"; + $sql .= ",date_ouverture = '".$this->db->idate($date_debut_reel)."'"; } else { - $sql .= ",date_ouverture=null"; + $sql .= ",date_ouverture = null"; } if ($date_fin_reel > 0) { - $sql .= ",date_cloture='".$this->db->idate($date_fin_reel)."'"; + $sql .= ",date_cloture = '".$this->db->idate($date_fin_reel)."'"; } else { - $sql .= ",date_cloture=null"; + $sql .= ",date_cloture = null"; } - $sql .= ", fk_unit=".($fk_unit ? "'".$this->db->escape($fk_unit)."'" : "null"); + $sql .= ", fk_unit = ".($fk_unit > 0 ? ((int) $fk_unit) : "null"); $sql .= " WHERE rowid = ".((int) $rowid); dol_syslog(get_class($this)."::updateline", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { - $result = $this->update_statut($user); - if ($result >= 0) { - if (is_array($array_options) && count($array_options) > 0) { // For avoid conflicts if trigger used - $contractline = new ContratLigne($this->db); - $contractline->fetch($rowid); - $contractline->fetch_optionals(); + if (is_array($array_options) && count($array_options) > 0) { // For avoid conflicts if trigger used + $contractline = new ContratLigne($this->db); + $contractline->fetch($rowid); - // We replace values in $contractline->array_options only for entries defined into $array_options - foreach ($array_options as $key => $value) { - $contractline->array_options[$key] = $array_options[$key]; - } - - $result = $contractline->insertExtraFields(); - if ($result < 0) { - $this->error[] = $contractline->error; - $error++; - } + // We replace values in $contractline->array_options only for entries defined into $array_options + foreach ($array_options as $key => $value) { + $contractline->array_options[$key] = $array_options[$key]; } - if (empty($error)) { - // Call trigger - $result = $this->call_trigger('LINECONTRACT_UPDATE', $user); - if ($result < 0) { - $this->db->rollback(); - return -3; - } - // End call triggers - - $this->db->commit(); - return 1; + $result = $contractline->insertExtraFields(); + if ($result < 0) { + $this->error[] = $contractline->error; + $error++; } - } else { - $this->db->rollback(); - dol_syslog(get_class($this)."::updateline Erreur -2"); - return -2; + } + + if (empty($error)) { + // Call trigger + $result = $this->call_trigger('LINECONTRACT_UPDATE', $user); + if ($result < 0) { + $this->db->rollback(); + return -3; + } + // End call triggers + + $this->db->commit(); + return 1; } } else { $this->db->rollback(); From dc1226b116a868c781658ef40fe46e6a3f540631 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 Oct 2021 18:40:19 +0200 Subject: [PATCH 1253/1460] Fix #yogosha7508 --- htdocs/core/class/commonobject.class.php | 2 +- .../fourn/class/fournisseur.commande.dispatch.class.php | 5 +---- test/phpunit/CodingPhpTest.php | 8 ++++---- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index c68cc9c7d84..91446f38070 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1851,7 +1851,7 @@ abstract class CommonObject $result = false; $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX.$table; - $sql .= " WHERE ".$field." = '".$key."'"; + $sql .= " WHERE ".$field." = '".$this->db->escape($key)."'"; if (!empty($element)) { $sql .= " AND entity IN (".getEntity($element).")"; } else { diff --git a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php index a73be8ac43b..7037cd94262 100644 --- a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php +++ b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php @@ -286,7 +286,7 @@ class CommandeFournisseurDispatch extends CommonObjectLine $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element." as t"; if ($ref) { - $sql .= " WHERE t.ref = '".$ref."'"; + $sql .= " WHERE t.ref = '".$this->db->escape($ref)."'"; } else { $sql .= " WHERE t.rowid = ".((int) $id); } @@ -374,7 +374,6 @@ class CommandeFournisseurDispatch extends CommonObjectLine // Update request $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET"; - $sql .= " fk_commande=".(isset($this->fk_commande) ? $this->fk_commande : "null").","; $sql .= " fk_product=".(isset($this->fk_product) ? $this->fk_product : "null").","; $sql .= " fk_commandefourndet=".(isset($this->fk_commandefourndet) ? $this->fk_commandefourndet : "null").","; @@ -388,8 +387,6 @@ class CommandeFournisseurDispatch extends CommonObjectLine $sql .= " batch=".(isset($this->batch) ? "'".$this->db->escape($this->batch)."'" : "null").","; $sql .= " eatby=".(dol_strlen($this->eatby) != 0 ? "'".$this->db->idate($this->eatby)."'" : 'null').","; $sql .= " sellby=".(dol_strlen($this->sellby) != 0 ? "'".$this->db->idate($this->sellby)."'" : 'null').""; - - $sql .= " WHERE rowid=".((int) $this->id); $this->db->begin(); diff --git a/test/phpunit/CodingPhpTest.php b/test/phpunit/CodingPhpTest.php index c68f1162790..c0bf927e382 100644 --- a/test/phpunit/CodingPhpTest.php +++ b/test/phpunit/CodingPhpTest.php @@ -360,13 +360,13 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase //print __METHOD__." Result for checking we don't have non escaped string in sql requests for file ".$file."\n"; $this->assertTrue($ok, 'Found non escaped string in building of a sql request (case 1) in '.$file['relativename'].' - Bad.'); - // Check string sql|set...'".$yyy->xxx with xxx that is not 'escape', 'idate', .... It means we forget a db->escape when forging sql request. + // Check string sql|set|WHERE|...'".$yyy->xxx with xxx that is not 'escape', 'idate', .... It means we forget a db->escape when forging sql request. $ok=true; $matches=array(); - preg_match_all('/(sql|SET|WHERE|INSERT|VALUES).+\s*\'"\s*\.\s*\$(.........)/', $filecontent, $matches, PREG_SET_ORDER); + preg_match_all('/(sql|SET|WHERE|INSERT|VALUES).+\s*\'"\s*\.\s*\$(........)/', $filecontent, $matches, PREG_SET_ORDER); foreach ($matches as $key => $val) { - if (! in_array($val[2], array('this->db-', 'this->esc', 'db->escap', 'dbs->esca', 'mydb->esc', 'dbsession', 'db->idate', 'escapedli', 'excludeGr', 'includeGr'))) { - $ok=false; + if (! in_array($val[2], array('this->db', 'this->es', 'db->esca', 'dbs->esc', 'mydb->es', 'dbsessio', 'db->idat', 'escapedl', 'excludeG', 'includeG'))) { + $ok=false; // This will generate error break; } //if ($reg[0] != 'db') $ok=false; From 20c874d441a3c9ffbb6e4d201146e7ce7b7fc5d8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 Oct 2021 18:48:44 +0200 Subject: [PATCH 1254/1460] Fix escape sql params. --- htdocs/core/class/infobox.class.php | 2 +- htdocs/don/card.php | 2 +- htdocs/expensereport/card.php | 2 +- htdocs/product/ajax/products.php | 2 +- test/phpunit/CodingPhpTest.php | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/infobox.class.php b/htdocs/core/class/infobox.class.php index bdd0f79a0aa..07962e6e98d 100644 --- a/htdocs/core/class/infobox.class.php +++ b/htdocs/core/class/infobox.class.php @@ -215,7 +215,7 @@ class InfoBox /** * Save order of boxes for area and user * - * @param DoliDB $dbs Database handler + * @param DoliDB $dbs Database handler * @param int $zone Name of area (0 for Homepage, ...) * @param string $boxorder List of boxes with correct order 'A:123,456,...-B:789,321...' * @param int $userid Id of user diff --git a/htdocs/don/card.php b/htdocs/don/card.php index b4c84c15203..6bfa9130363 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -787,7 +787,7 @@ if (!empty($id) && $action != 'edit') { $sql .= " FROM ".MAIN_DB_PREFIX."payment_donation as p"; $sql .= ", ".MAIN_DB_PREFIX."c_paiement as c "; $sql .= ", ".MAIN_DB_PREFIX."don as d"; - $sql .= " WHERE d.rowid = '".$id."'"; + $sql .= " WHERE d.rowid = ".((int) $id); $sql .= " AND p.fk_donation = d.rowid"; $sql .= " AND d.entity IN (".getEntity('donation').")"; $sql .= " AND p.fk_typepayment = c.id"; diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 92c12f74e6d..b711a65d25a 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -1924,7 +1924,7 @@ if ($action == 'create') { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as c ON p.fk_typepayment = c.id"; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank_account as ba ON b.fk_account = ba.rowid'; - $sql .= " WHERE e.rowid = '".$id."'"; + $sql .= " WHERE e.rowid = ".((int) $id); $sql .= " AND p.fk_expensereport = e.rowid"; $sql .= ' AND e.entity IN ('.getEntity('expensereport').')'; $sql .= " ORDER BY dp"; diff --git a/htdocs/product/ajax/products.php b/htdocs/product/ajax/products.php index 9ba8d9cec09..84562bf95a4 100644 --- a/htdocs/product/ajax/products.php +++ b/htdocs/product/ajax/products.php @@ -144,7 +144,7 @@ if (!empty($action) && $action == 'fetch' && !empty($id)) { if (!$found && isset($price_level) && $price_level >= 1 && (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))) { // If we need a particular price level (from 1 to 6) $sql = "SELECT price, price_ttc, price_base_type, tva_tx"; $sql .= " FROM ".MAIN_DB_PREFIX."product_price "; - $sql .= " WHERE fk_product = '".$id."'"; + $sql .= " WHERE fk_product = ".((int) $id); $sql .= " AND entity IN (".getEntity('productprice').")"; $sql .= " AND price_level = ".((int) $price_level); $sql .= " ORDER BY date_price"; diff --git a/test/phpunit/CodingPhpTest.php b/test/phpunit/CodingPhpTest.php index c0bf927e382..2681164c857 100644 --- a/test/phpunit/CodingPhpTest.php +++ b/test/phpunit/CodingPhpTest.php @@ -363,9 +363,9 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase // Check string sql|set|WHERE|...'".$yyy->xxx with xxx that is not 'escape', 'idate', .... It means we forget a db->escape when forging sql request. $ok=true; $matches=array(); - preg_match_all('/(sql|SET|WHERE|INSERT|VALUES).+\s*\'"\s*\.\s*\$(........)/', $filecontent, $matches, PREG_SET_ORDER); + preg_match_all('/(sql|SET|WHERE|INSERT|VALUES).+\s*\'"\s*\.\s*\$(.......)/', $filecontent, $matches, PREG_SET_ORDER); foreach ($matches as $key => $val) { - if (! in_array($val[2], array('this->db', 'this->es', 'db->esca', 'dbs->esc', 'mydb->es', 'dbsessio', 'db->idat', 'escapedl', 'excludeG', 'includeG'))) { + if (! in_array($val[2], array('this->d', 'this->e', 'db->esc', 'dbs->es', 'mydb->e', 'dbsessi', 'db->ida', 'escaped', 'exclude', 'include'))) { $ok=false; // This will generate error break; } From 02564df769fba68369c7accf8c7d980427e9fd03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 25 Oct 2021 20:34:19 +0200 Subject: [PATCH 1255/1460] fix warning --- htdocs/user/notify/card.php | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php index 48cbad46799..d6bbd300093 100644 --- a/htdocs/user/notify/card.php +++ b/htdocs/user/notify/card.php @@ -349,21 +349,17 @@ if ($result > 0) { foreach($conf->global as $key => $val) { if (! preg_match('/^NOTIFICATION_FIXEDEMAIL_(.*)/', $key, $reg)) continue; print '
    '; - $listtmp=explode(',',$val); + $listtmp=explode(',', $val); $first=1; - foreach($listtmp as $keyemail => $valemail) - { + foreach($listtmp as $keyemail => $valemail) { if (! $first) print ', '; $first=0; $valemail=trim($valemail); //print $keyemail.' - '.$valemail.' - '.$reg[1].'
    '; - if (isValidEmail($valemail, 1)) - { + if (isValidEmail($valemail, 1)) { if ($valemail == '__SUPERVISOREMAIL__') print $valemail; else print ' <'.$valemail.'>'; - } - else - { + } else { print ' '.img_warning().' '.$langs->trans("ErrorBadEMail",$valemail); } } @@ -373,8 +369,7 @@ if ($result > 0) { $notifcodecond=preg_replace('/^.*_(THRESHOLD_)/','$1',$reg[1]); $label=($langs->trans("Notify_".$notifcode)!="Notify_".$notifcode?$langs->trans("Notify_".$notifcode):$notifcode); print $label; - if (preg_match('/^THRESHOLD_HIGHER_(.*)$/',$notifcodecond,$regcond) && ($regcond[1] > 0)) - { + if (preg_match('/^THRESHOLD_HIGHER_(.*)$/',$notifcodecond,$regcond) && ($regcond[1] > 0)) { print ' - '.$langs->trans("IfAmountHigherThan",$regcond[1]); } print '
    '.$langs->trans("SeeModuleSetup", $langs->transnoentitiesnoconv("Module600Name")).'
    '; print '+ '.$langs->trans("SeeModuleSetup", $langs->transnoentitiesnoconv("Module600Name")).''; print '
    '; - if ($obj->object_type == 'order') - { + if ($obj->object_type == 'order') { $orderstatic->id=$obj->object_id; $orderstatic->ref=... print $orderstatic->getNomUrl(1); } - print ''.dol_print_date($db->jdate($obj->daten), 'dayhour').'
    '.$langs->trans("AGENDA_EVENT_DEFAULT_STATUS").' '."\n"; -$defval='na'; +$defval = 'na'; $defaultValues = new DefaultValues($db); -$result = $defaultValues->fetchAll('', '', 0, 0, array('t.page'=>'comm/action/card.php', 't.param'=>'complete','t.user_id'=>'0', 't.type'=>'createform', 't.entity'=>$conf->entity)); -if (!is_array($result) && $result<0) { +$result = $defaultValues->fetchAll('', '', 0, 0, array('t.page'=>'comm/action/card.php', 't.param'=>'complete', 't.user_id'=>'0', 't.type'=>'createform', 't.entity'=>$conf->entity)); +if (!is_array($result) && $result < 0) { setEventMessages($defaultValues->error, $defaultValues->errors, 'errors'); -} elseif (count($result)>0) { - $defval=reset($result)->value; +} elseif (count($result) > 0) { + $defval = reset($result)->value; } $formactions->form_select_status_action('agenda', $defval, 1, "AGENDA_EVENT_DEFAULT_STATUS", 0, 1, 'maxwidth200'); print '
    '; echo ''; -echo ''; +echo ''; echo ''; echo ''; diff --git a/htdocs/admin/tools/export.php b/htdocs/admin/tools/export.php index 4dd2fbad58e..c8a2a02498c 100644 --- a/htdocs/admin/tools/export.php +++ b/htdocs/admin/tools/export.php @@ -90,7 +90,7 @@ $_SESSION["commandbackuptorun"] = ''; $_SESSION["commandbackupresult"] = ''; // Increase limit of time. Works only if we are not in safe mode -$ExecTimeLimit = 600; // Set it to 0 to not use a forced time limit +$ExecTimeLimit = 600; // Set it to 0 to not use a forced time limit if (!empty($ExecTimeLimit)) { $err = error_reporting(); error_reporting(0); // Disable all errors diff --git a/htdocs/admin/workstation.php b/htdocs/admin/workstation.php index 83241f2a9e2..e89cbb2fd41 100755 --- a/htdocs/admin/workstation.php +++ b/htdocs/admin/workstation.php @@ -26,8 +26,8 @@ require "../main.inc.php"; // Libraries -require_once DOL_DOCUMENT_ROOT . "/core/lib/admin.lib.php"; -require_once DOL_DOCUMENT_ROOT . '/workstation/lib/workstation.lib.php'; +require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"; +require_once DOL_DOCUMENT_ROOT.'/workstation/lib/workstation.lib.php'; //require_once "../class/myclass.class.php"; // Translations diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php index f10c7b10b48..3cd8d3e0774 100644 --- a/htdocs/api/class/api_documents.class.php +++ b/htdocs/api/class/api_documents.class.php @@ -497,11 +497,11 @@ class Documents extends DolibarrApi throw new RestException(404, 'Search for modulepart '.$modulepart.' with Id '.$object->id.(!empty($object->ref) ? ' or Ref '.$object->ref : '').' does not return any document.'); } else { if (($object->id) > 0 && !empty($modulepart)) { - require_once DOL_DOCUMENT_ROOT . '/ecm/class/ecmfiles.class.php'; + require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php'; $ecmfile = new EcmFiles($this->db); $result = $ecmfile->fetchAll('', '', 0, 0, array('t.src_object_type' => $modulepart, 't.src_object_id' => $object->id)); if ($result < 0) { - throw new RestException(503, 'Error when retrieve ecm list : ' . $this->db->lasterror()); + throw new RestException(503, 'Error when retrieve ecm list : '.$this->db->lasterror()); } elseif (is_array($ecmfile->lines) && count($ecmfile->lines) > 0) { $filearray['ecmfiles_infos'] = $ecmfile->lines; } diff --git a/htdocs/asset/card.php b/htdocs/asset/card.php index 524b92a080e..35c0ffcff88 100644 --- a/htdocs/asset/card.php +++ b/htdocs/asset/card.php @@ -316,8 +316,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $filename = dol_sanitizeFileName($object->ref); $filedir = $conf->contrat->dir_output."/".dol_sanitizeFileName($object->ref); $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; - $genallowed = $user->rights->asset->read; // If you can read, you can build the PDF to read content - $delallowed = $user->rights->asset->write; // If you can create/edit, you can remove a file on card + $genallowed = $user->rights->asset->read; // If you can read, you can build the PDF to read content + $delallowed = $user->rights->asset->write; // If you can create/edit, you can remove a file on card print $formfile->showdocuments('asset', $filename, $filedir, $urlsource, 0, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang); diff --git a/htdocs/barcode/printsheet.php b/htdocs/barcode/printsheet.php index 2cb4d972493..6bfd655b62d 100644 --- a/htdocs/barcode/printsheet.php +++ b/htdocs/barcode/printsheet.php @@ -25,7 +25,7 @@ if (!empty($_POST['mode']) && $_POST['mode'] === 'label') { // Page is called to build a PDF and output, we must ne renew the token. if (!defined('NOTOKENRENEWAL')) { - define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) + define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) } } @@ -277,10 +277,10 @@ dol_htmloutput_errors($mesg); //print img_picto('','puce').' '.$langs->trans("PrintsheetForOneBarCode").'
    '; //print '
    '; -print '
    '; // The target is for brothers that open the file instead of downloading it +print ''; // The target is for brothers that open the file instead of downloading it print ''; print ''; -print ''; // The page will not renew the token but force download of a file, so we must use here currentToken +print ''; // The page will not renew the token but force download of a file, so we must use here currentToken print '
    '; diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 4f8c6b28d41..e6a94b21701 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -244,7 +244,6 @@ class Categorie extends CommonObject * @see Categorie::TYPE_ACTIONCOMM * @see Categorie::TYPE_WEBSITE_PAGE * @see Categorie::TYPE_TICKET - */ public $type; @@ -385,8 +384,8 @@ class Categorie extends CommonObject } } else { dol_print_error($this->db); - $this->error=$this->db->lasterror; - $this->errors[]=$this->db->lasterror; + $this->error = $this->db->lasterror; + $this->errors[] = $this->db->lasterror; return -1; } } diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index 55540b3006f..7cdb056c595 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -965,8 +965,8 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s // We are in a particular day for $username, now we scan all events foreach ($eventarray as $daykey => $notused) { $annee = dol_print_date($daykey, '%Y'); - $mois = dol_print_date($daykey, '%m'); - $jour = dol_print_date($daykey, '%d'); + $mois = dol_print_date($daykey, '%m'); + $jour = dol_print_date($daykey, '%d'); if ($day == $jour && $month == $mois && $year == $annee) { // Is it the day we are looking for when calling function ? // Scan all event for this date diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index fddf7a2879f..8abbdaa0dd3 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -578,7 +578,7 @@ print '
    '; foreach ($listofchoices as $choice => $val) { if (empty($val['enabled'])) { - continue; // list not qualified + continue; // list not qualified } $disabled = ''; if (empty($val['perms'])) { diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index 3b078698728..d4245594447 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -540,7 +540,7 @@ if ($id) { array('type' => 'date', 'name' => 'clone_date_value', 'label' => $langs->trans("DateValue"), 'value' => -1), array('type' => 'other', 'tdclass'=>'fieldrequired', 'name' => 'clone_accountid', 'label' => $langs->trans("BankAccount"), 'value' => $form->select_comptes($object->fk_account, "accountid", 0, '', 1, '', 0, 'minwidth200', 1)), array('type' => 'text', 'name' => 'clone_amount', 'label' => $langs->trans("Amount"), 'value' => price($object->amount)), - array('type' => 'select', 'name' => 'clone_sens', 'label' => $langs->trans("Sens") . ' ' . $set_value_help, 'values' => $sensarray, 'default' => $object->sens), + array('type' => 'select', 'name' => 'clone_sens', 'label' => $langs->trans("Sens").' '.$set_value_help, 'values' => $sensarray, 'default' => $object->sens), ); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneVariousPayment', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 350); diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index b589607ac37..100334e046a 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -126,8 +126,8 @@ class FactureRec extends CommonInvoice public $suspended; // status - public $auto_validate; // 0 to create in draft, 1 to create and validate the new invoice - public $generate_pdf; // 1 to generate PDF on invoice generation (default) + public $auto_validate; // 0 to create in draft, 1 to create and validate the new invoice + public $generate_pdf; // 1 to generate PDF on invoice generation (default) /** * @var int 1 if status is draft @@ -712,12 +712,12 @@ class FactureRec extends CommonInvoice //$line->code_ventilation = $objp->fk_code_ventilation; $line->fk_product_fournisseur_price = $objp->fk_product_fournisseur_price; - $line->fk_fournprice = $objp->fk_product_fournisseur_price; // For backward compatibility + $line->fk_fournprice = $objp->fk_product_fournisseur_price; // For backward compatibility $marginInfos = getMarginInfos($objp->subprice, $objp->remise_percent, $objp->tva_tx, $objp->localtax1_tx, $objp->localtax2_tx, $objp->fk_product_fournisseur_price, $objp->pa_ht); $line->buyprice = $marginInfos[0]; - $line->pa_ht = $marginInfos[0]; // For backward compatibility + $line->pa_ht = $marginInfos[0]; // For backward compatibility $line->marge_tx = $marginInfos[1]; $line->marque_tx = $marginInfos[2]; $line->rang = $objp->rang; @@ -1930,14 +1930,14 @@ class FactureLigneRec extends CommonInvoiceLine public $fk_product_fournisseur_price; - public $fk_fournprice; // For backward compatibility + public $fk_fournprice; // For backward compatibility public $rang; public $desc; public $description; - public $fk_product_type; // Use instead product_type + public $fk_product_type; // Use instead product_type public $fk_contract_line; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 90641062b40..04c1383c4a5 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1560,8 +1560,11 @@ class Facture extends CommonInvoice $hookmanager->initHooks(array('invoicedao')); $parameters = array('id'=>$this->id, 'getnomurl'=>$result, 'notooltip' => $notooltip, 'addlinktonotes' => $addlinktonotes, 'save_lastsearch_value'=> $save_lastsearch_value, 'target' => $target); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks - if ($reshook > 0) $result = $hookmanager->resPrint; - else $result .= $hookmanager->resPrint; + if ($reshook > 0) { + $result = $hookmanager->resPrint; + } else { + $result .= $hookmanager->resPrint; + } return $result; } diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 03dfd0288bd..42bf73eaae6 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -90,10 +90,10 @@ if (empty($reshook)) { } } if ($action == 'create') { - $default_account=($type == 'bank-transfer' ? 'PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT' : 'PRELEVEMENT_ID_BANKACCOUNT'); + $default_account = ($type == 'bank-transfer' ? 'PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT' : 'PRELEVEMENT_ID_BANKACCOUNT'); if ($id_bankaccount != $conf->global->{$default_account}) { - $res = dolibarr_set_const($db, $default_account, $id_bankaccount, 'chaine', 0, '', $conf->entity); //Set as default + $res = dolibarr_set_const($db, $default_account, $id_bankaccount, 'chaine', 0, '', $conf->entity); //Set as default } require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index fa95b08faca..9a4b50e3474 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -600,7 +600,7 @@ class PaymentSocialContribution extends CommonObject $result = $acc->add_url_line( $bank_line_id, $socialcontrib->fk_user, - DOL_URL_ROOT . '/user/card.php?id=', + DOL_URL_ROOT.'/user/card.php?id=', $fuser->getFullName($langs), 'user' ); diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index f30ff3ead4c..b7648da956d 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -505,8 +505,8 @@ if (empty($reshook)) { $desc = $prod->description; //If text set in desc is the same as product descpription (as now it's preloaded) whe add it only one time - if ($product_desc==$desc && !empty($conf->global->PRODUIT_AUTOFILL_DESC)) { - $product_desc=''; + if ($product_desc == $desc && !empty($conf->global->PRODUIT_AUTOFILL_DESC)) { + $product_desc = ''; } if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) { diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index f46c1051c53..63b4b3f7fc6 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -218,8 +218,8 @@ if ($type == 'directory') { $parameters = array('modulepart'=>$module); $reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters); - if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray)>0) { - $automodules[]=$hookmanager->resArray['module']; + if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray) > 0) { + $automodules[] = $hookmanager->resArray['module']; } // TODO change for multicompany sharing diff --git a/htdocs/core/boxes/box_customers_outstanding_bill_reached.php b/htdocs/core/boxes/box_customers_outstanding_bill_reached.php index 4077b04c6d9..22fafb4633c 100644 --- a/htdocs/core/boxes/box_customers_outstanding_bill_reached.php +++ b/htdocs/core/boxes/box_customers_outstanding_bill_reached.php @@ -35,7 +35,7 @@ class box_customers_outstanding_bill_reached extends ModeleBoxes public $boxcode = "customersoutstandingbillreached"; public $boximg = "object_company"; public $boxlabel = "BoxCustomersOutstandingBillReached"; - public $depends = array("facture","societe"); + public $depends = array("facture", "societe"); /** * @var DoliDB Database handler. diff --git a/htdocs/core/boxes/box_funnel_of_prospection.php b/htdocs/core/boxes/box_funnel_of_prospection.php index 28c3b22788d..fd89e732937 100644 --- a/htdocs/core/boxes/box_funnel_of_prospection.php +++ b/htdocs/core/boxes/box_funnel_of_prospection.php @@ -24,7 +24,7 @@ * \ingroup projet * \brief Module to show the funnel of prospection */ -include_once DOL_DOCUMENT_ROOT . "/core/boxes/modules_boxes.php"; +include_once DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"; /** * Class to manage the box to show last projet @@ -91,8 +91,8 @@ class box_funnel_of_prospection extends ModeleBoxes $badgeStatus7 = '#baa32b'; $badgeStatus8 = '#993013'; $badgeStatus9 = '#e7f0f0'; - if (file_exists(DOL_DOCUMENT_ROOT . '/theme/' . $conf->theme . '/theme_vars.inc.php')) { - include DOL_DOCUMENT_ROOT . '/theme/' . $conf->theme . '/theme_vars.inc.php'; + if (file_exists(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php')) { + include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php'; } $listofoppstatus = array(); $listofopplabel = array(); @@ -100,7 +100,7 @@ class box_funnel_of_prospection extends ModeleBoxes $colorseriesstat = array(); $bordercolorseries = array(); $sql = "SELECT cls.rowid, cls.code, cls.percent, cls.label"; - $sql .= " FROM " . MAIN_DB_PREFIX . "c_lead_status as cls"; + $sql .= " FROM ".MAIN_DB_PREFIX."c_lead_status as cls"; $sql .= " WHERE active=1"; $sql .= " AND cls.code <> 'LOST'"; $sql .= $this->db->order('cls.rowid', 'ASC'); @@ -148,14 +148,14 @@ class box_funnel_of_prospection extends ModeleBoxes $this->max = $max; $this->info_box_head = array( - 'text' => $langs->trans("Statistics") . ' - ' . $langs->trans("BoxTitleFunnelOfProspection"), + 'text' => $langs->trans("Statistics").' - '.$langs->trans("BoxTitleFunnelOfProspection"), 'graph' => '1' ); if ($user->rights->projet->lire || !empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { $sql = "SELECT p.fk_opp_status as opp_status, cls.code, COUNT(p.rowid) as nb, SUM(p.opp_amount) as opp_amount, SUM(p.opp_amount * p.opp_percent) as ponderated_opp_amount"; - $sql .= " FROM " . MAIN_DB_PREFIX . "projet as p, " . MAIN_DB_PREFIX . "c_lead_status as cls"; - $sql .= " WHERE p.entity IN (" . getEntity('project') . ")"; + $sql .= " FROM ".MAIN_DB_PREFIX."projet as p, ".MAIN_DB_PREFIX."c_lead_status as cls"; + $sql .= " WHERE p.entity IN (".getEntity('project').")"; $sql .= " AND p.fk_opp_status = cls.rowid"; $sql .= " AND p.fk_statut = 1"; // Opend projects only $sql .= " AND cls.code NOT IN ('LOST')"; @@ -200,14 +200,14 @@ class box_funnel_of_prospection extends ModeleBoxes $liststatus = array(); $data = array(''); $customlabels = array(); - $total=0; + $total = 0; foreach ($listofstatus as $status) { $customlabel = ''; $labelStatus = ''; if ($status != 7) { $code = dol_getIdFromCode($this->db, $status, 'c_lead_status', 'rowid', 'code'); if ($code) { - $labelStatus = $langs->transnoentitiesnoconv("OppStatus" . $code); + $labelStatus = $langs->transnoentitiesnoconv("OppStatus".$code); } if (empty($labelStatus)) { $labelStatus = $listofopplabel[$status]; @@ -218,16 +218,16 @@ class box_funnel_of_prospection extends ModeleBoxes $liststatus[] = $labelStatus; if (!$conf->use_javascript_ajax) { $stringtoprint .= '
    '; - $stringtoprint .= ''; - $stringtoprint .= ''; + $stringtoprint .= ''; + $stringtoprint .= ''; $stringtoprint .= "\n"; } } - $customlabels[]=$customlabel; + $customlabels[] = $customlabel; } $dataseries[] = $data; if ($conf->use_javascript_ajax) { - include_once DOL_DOCUMENT_ROOT . '/core/class/dolgraph.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $dolgraph = new DolGraph(); $dolgraph->SetMinValue(0); $dolgraph->SetData($dataseries); @@ -273,7 +273,7 @@ class box_funnel_of_prospection extends ModeleBoxes 'tr' => 'class="oddeven"', 'td' => 'class="left "', 'maxlength' => 500, - 'text' => $langs->trans("OpportunityTotalAmount") . ' (' . $langs->trans("WonLostExcluded") . ')' + 'text' => $langs->trans("OpportunityTotalAmount").' ('.$langs->trans("WonLostExcluded").')' ); $this->info_box_contents[$line][] = array( 'tr' => 'class="oddeven"', @@ -286,7 +286,7 @@ class box_funnel_of_prospection extends ModeleBoxes 'tr' => 'class="oddeven"', 'td' => 'class="left "', 'maxlength' => 500, - 'text' => $form->textwithpicto($langs->trans("OpportunityPonderatedAmount") . ' (' . $langs->trans("WonLostExcluded") . ')', $langs->trans("OpportunityPonderatedAmountDesc"), 1) + 'text' => $form->textwithpicto($langs->trans("OpportunityPonderatedAmount").' ('.$langs->trans("WonLostExcluded").')', $langs->trans("OpportunityPonderatedAmountDesc"), 1) ); $this->info_box_contents[$line][] = array( diff --git a/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php b/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php index 83acae25b45..1c0e7a6e3ff 100644 --- a/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php +++ b/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php @@ -80,8 +80,8 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes $badgeStatus7 = '#baa32b'; $badgeStatus8 = '#993013'; $badgeStatus9 = '#e7f0f0'; - if (file_exists(DOL_DOCUMENT_ROOT . '/theme/' . $conf->theme . '/theme_vars.inc.php')) { - include DOL_DOCUMENT_ROOT . '/theme/' . $conf->theme . '/theme_vars.inc.php'; + if (file_exists(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php')) { + include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php'; } $this->max = $max; @@ -97,22 +97,22 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes $days = 7; } require_once DOL_DOCUMENT_ROOT."/ticket/class/ticket.class.php"; - $text = $langs->trans("BoxTicketLastXDays", $days).' ' . img_picto('', 'filter.png', 'id="idsubimgDOLUSERCOOKIE_ticket_last_days" class="linkobject"'); + $text = $langs->trans("BoxTicketLastXDays", $days).' '.img_picto('', 'filter.png', 'id="idsubimgDOLUSERCOOKIE_ticket_last_days" class="linkobject"'); $this->info_box_head = array( 'text' => $text, 'limit' => dol_strlen($text) ); $today = date_time_set(date_create(), 0, 0); $todayformat = date('Y-m-d', date_timestamp_get($today)); - $intervaltosub = new DateInterval('P' . dol_escape_htmltag($days - 1) . 'D'); + $intervaltosub = new DateInterval('P'.dol_escape_htmltag($days - 1).'D'); $intervaltoadd = new DateInterval('P1D'); $minimumdatec = date_sub($today, $intervaltosub); $minimumdatecformated = date('Y-m-d', date_timestamp_get($minimumdatec)); if ($user->rights->ticket->read) { $sql = "SELECT CAST(t.datec AS DATE) as datec, COUNT(t.datec) as nb"; - $sql .= " FROM " . MAIN_DB_PREFIX . "ticket as t"; - $sql .= " WHERE CAST(t.datec AS DATE) > DATE_SUB(CURRENT_DATE, INTERVAL " . $days . " DAY)"; + $sql .= " FROM ".MAIN_DB_PREFIX."ticket as t"; + $sql .= " WHERE CAST(t.datec AS DATE) > DATE_SUB(CURRENT_DATE, INTERVAL ".$days." DAY)"; $sql .= " GROUP BY CAST(t.datec AS DATE)"; $resql = $this->db->query($sql); if ($resql) { @@ -148,12 +148,12 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes }); '; $stringtoshow .= '
    '; // hideobject is to start hidden - $stringtoshow .= ''; - $stringtoshow .= ''; + $stringtoshow .= ''; + $stringtoshow .= ''; $stringtoshow .= ''; $stringtoshow .= ''; - $stringtoshow .= ' ' . $langs->trans("Days"); - $stringtoshow .= ''; + $stringtoshow .= ' '.$langs->trans("Days"); + $stringtoshow .= ''; $stringtoshow .= ''; $stringtoshow .= '
    '; @@ -181,21 +181,21 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes $px1->mode = 'depth'; $px1->draw('idgraphticketlastxdays'); - $graphtoshow= $px1->show($totalnb ? 0 : 1); + $graphtoshow = $px1->show($totalnb ? 0 : 1); } if ($totalnb) { $stringtoshow .= $graphtoshow; } $stringtoshow .= ''; if ($totalnb) { - $this->info_box_contents[][]=array( + $this->info_box_contents[][] = array( 'td' => 'center', 'text' => $stringtoshow ); } else { $this->info_box_contents[0][0] = array( 'td' => 'class="center opacitymedium"', - 'text' => $stringtoshow . $langs->trans("BoxNoTicketLastXDays", $days) + 'text' => $stringtoshow.$langs->trans("BoxNoTicketLastXDays", $days) ); } } else { diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 3b98d3f3356..c7a5beae245 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -970,8 +970,8 @@ abstract class CommonInvoiceLine extends CommonObjectLine public $date_end_fill; // If set to 1, when invoice is created from a template invoice, it will also auto set the field date_end at creation public $buy_price_ht; - public $buyprice; // For backward compatibility - public $pa_ht; // For backward compatibility + public $buyprice; // For backward compatibility + public $pa_ht; // For backward compatibility public $marge_tx; public $marque_tx; diff --git a/htdocs/core/class/defaultvalues.class.php b/htdocs/core/class/defaultvalues.class.php index ad69982357c..f6edb58207c 100644 --- a/htdocs/core/class/defaultvalues.class.php +++ b/htdocs/core/class/defaultvalues.class.php @@ -88,7 +88,7 @@ class DefaultValues extends CommonObject /** * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ - public $fields=array( + public $fields = array( 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>15, 'index'=>1), 'type' =>array('type'=>'varchar(10)', 'label'=>'Type', 'enabled'=>1, 'visible'=>-1, 'position'=>20), @@ -145,8 +145,12 @@ class DefaultValues extends CommonObject $this->db = $db; - if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) $this->fields['rowid']['visible'] = 0; - if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) $this->fields['entity']['enabled'] = 0; + if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) { + $this->fields['rowid']['visible'] = 0; + } + if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) { + $this->fields['entity']['enabled'] = 0; + } // Unset fields that are disabled foreach ($this->fields as $key => $val) { diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index d313d91f505..ffa441c0527 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -500,7 +500,7 @@ class FormFile $modellist = array(); if ($modulepart == 'company') { - $showempty = 1; // can have no template active + $showempty = 1; // can have no template active if (is_array($genallowed)) { $modellist = $genallowed; } else { @@ -564,7 +564,7 @@ class FormFile $modellist = ModelePDFFactures::liste_modeles($this->db); } } elseif ($modulepart == 'contract') { - $showempty = 1; // can have no template active + $showempty = 1; // can have no template active if (is_array($genallowed)) { $modellist = $genallowed; } else { @@ -628,7 +628,7 @@ class FormFile $modellist = ModelePDFSuppliersOrders::liste_modeles($this->db); } } elseif ($modulepart == 'facture_fournisseur' || $modulepart == 'supplier_invoice') { - $showempty = 1; // can have no template active + $showempty = 1; // can have no template active if (is_array($genallowed)) { $modellist = $genallowed; } else { @@ -1708,7 +1708,7 @@ class FormFile } else { $parameters = array('modulepart'=>$modulepart); $reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters); - if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray)>0) { + if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray) > 0) { if (array_key_exists('classpath', $hookmanager->resArray) && !empty($hookmanager->resArray['classpath'])) { dol_include_once($hookmanager->resArray['classpath']); if (array_key_exists('classname', $hookmanager->resArray) && !empty($hookmanager->resArray['classname'])) { @@ -1789,9 +1789,9 @@ class FormFile preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $ref = (isset($reg[1]) ? $reg[1] : ''); } else { - $parameters = array('modulepart'=>$modulepart,'fileinfo'=>$file); + $parameters = array('modulepart'=>$modulepart, 'fileinfo'=>$file); $reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters); - if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray)>0) { + if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray) > 0) { if (array_key_exists('ref', $hookmanager->resArray) && !empty($hookmanager->resArray['ref'])) { $ref = $hookmanager->resArray['ref']; } diff --git a/htdocs/core/class/infobox.class.php b/htdocs/core/class/infobox.class.php index 07962e6e98d..adde51c4974 100644 --- a/htdocs/core/class/infobox.class.php +++ b/htdocs/core/class/infobox.class.php @@ -151,7 +151,7 @@ class InfoBox $box->rowid = (empty($obj->rowid) ? '' : $obj->rowid); $box->id = (empty($obj->box_id) ? '' : $obj->box_id); $box->position = ((isset($obj->position) && $obj->position == '') ? '' : (isset($obj->position) ? $obj->position : '')); // '0' must stay '0' - $box->box_order = (empty($obj->box_order) ? '' : $obj->box_order); + $box->box_order = (empty($obj->box_order) ? '' : $obj->box_order); $box->fk_user = (empty($obj->fk_user) ? 0 : $obj->fk_user); $box->sourcefile = $relsourcefile; $box->class = $boxname; diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index 4743d4559b6..c287aae1c2f 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -1422,7 +1422,7 @@ class SMTPs $this->_msgContent[$strType]['dataText'] = $strContentAltText; if ($this->getMD5flag()) { - $this->_msgContent[$strType]['md5'] = dol_hash($strContent, 3); + $this->_msgContent[$strType]['md5'] = dol_hash($strContent, 3); } //} } @@ -1622,7 +1622,7 @@ class SMTPs $this->_msgContent['image'][$strImageName]['data'] = $strContent; if ($this->getMD5flag()) { - $this->_msgContent['image'][$strImageName]['md5'] = dol_hash($strContent, 3); + $this->_msgContent['image'][$strImageName]['md5'] = dol_hash($strContent, 3); } } } diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index e7ab98ca3b6..d4028e2196b 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -681,7 +681,7 @@ function dol_get_first_day_week($day, $month, $year, $gm = false) function getGMTEasterDatetime($year) { $base = new DateTime("$year-03-21", new DateTimeZone("UTC")); - $days = easter_days($year); // Return number of days between 21 march and easter day. + $days = easter_days($year); // Return number of days between 21 march and easter day. $tmp = $base->add(new DateInterval("P{$days}D")); return $tmp->getTimestamp(); } diff --git a/htdocs/core/lib/import.lib.php b/htdocs/core/lib/import.lib.php index 54e6d232871..96ad79f03e6 100644 --- a/htdocs/core/lib/import.lib.php +++ b/htdocs/core/lib/import.lib.php @@ -48,7 +48,7 @@ function import_prepare_head($param, $maxstep = 0) if ($i < 6) { $head[$h][0] = DOL_URL_ROOT.'/imports/import.php?step='.$i.$param; } else { - $head[$h][0] = DOL_URL_ROOT.'/imports/import.php?step=5'.$param; // For step6, link is to step 5 + $head[$h][0] = DOL_URL_ROOT.'/imports/import.php?step=5'.$param; // For step6, link is to step 5 } $head[$h][1] = $langs->trans("Step")." ".$i; $head[$h][2] = 'step'.$i; diff --git a/htdocs/core/lib/memory.lib.php b/htdocs/core/lib/memory.lib.php index 1300c1b771f..557bbe6dcf5 100644 --- a/htdocs/core/lib/memory.lib.php +++ b/htdocs/core/lib/memory.lib.php @@ -76,7 +76,7 @@ function dol_setcache($memoryid, $data, $expire = 0) } } - if (!empty($conf->memcached->enabled) && class_exists('Memcached')) { + if (!empty($conf->memcached->enabled) && class_exists('Memcached')) { // Using a memcached server global $dolmemcache; if (empty($dolmemcache) || !is_object($dolmemcache)) { @@ -88,7 +88,7 @@ function dol_setcache($memoryid, $data, $expire = 0) } } - $memoryid = session_name() . '_' . $memoryid; + $memoryid = session_name().'_'.$memoryid; //$dolmemcache->setOption(Memcached::OPT_COMPRESSION, false); $dolmemcache->add($memoryid, $data, $expire); // This fails if key already exists $rescode = $dolmemcache->getResultCode(); @@ -109,7 +109,7 @@ function dol_setcache($memoryid, $data, $expire = 0) } } - $memoryid = session_name() . '_' . $memoryid; + $memoryid = session_name().'_'.$memoryid; //$dolmemcache->setOption(Memcached::OPT_COMPRESSION, false); $result = $dolmemcache->add($memoryid, $data, false, $expire); // This fails if key already exists if ($result) { @@ -154,7 +154,7 @@ function dol_getcache($memoryid) } } - $memoryid = session_name() . '_' . $memoryid; + $memoryid = session_name().'_'.$memoryid; //$m->setOption(Memcached::OPT_COMPRESSION, false); //print "Get memoryid=".$memoryid; $data = $m->get($memoryid); @@ -179,7 +179,7 @@ function dol_getcache($memoryid) } } - $memoryid = session_name() . '_' . $memoryid; + $memoryid = session_name().'_'.$memoryid; //$m->setOption(Memcached::OPT_COMPRESSION, false); $data = $m->get($memoryid); //print "memoryid=".$memoryid." - rescode=".$rescode." - data=".count($data)."\n
    "; @@ -187,7 +187,7 @@ function dol_getcache($memoryid) if ($data) { return $data; } else { - return null; // There is no way to make a difference between NOTFOUND and error when using Memcache. So do not use it, use Memcached instead. + return null; // There is no way to make a difference between NOTFOUND and error when using Memcache. So do not use it, use Memcached instead. } } elseif (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x02)) { // This is a really not reliable cache ! Use Memcached instead. // Using shmop @@ -252,7 +252,7 @@ function dol_setshmop($memoryid, $data, $expire) } $shmkey = dol_getshmopaddress($memoryid); if (empty($shmkey)) { - return 0; // No key reserved for this memoryid, we can't cache this memoryid + return 0; // No key reserved for this memoryid, we can't cache this memoryid } $newdata = serialize($data); @@ -268,7 +268,7 @@ function dol_setshmop($memoryid, $data, $expire) shmop_close($handle); return ($shm_bytes_written1 + $shm_bytes_written2); } else { - print 'Error in shmop_open for memoryid=' . $memoryid . ' shmkey=' . $shmkey . ' 6+size=6+' . $size; + print 'Error in shmop_open for memoryid='.$memoryid.' shmkey='.$shmkey.' 6+size=6+'.$size; return -1; } } @@ -290,7 +290,7 @@ function dol_getshmop($memoryid) } $shmkey = dol_getshmopaddress($memoryid); if (empty($shmkey)) { - return null; // No key reserved for this memoryid, we can't cache this memoryid + return null; // No key reserved for this memoryid, we can't cache this memoryid } //print 'dol_getshmop memoryid='.$memoryid." shmkey=".$shmkey."
    \n"; @@ -304,7 +304,7 @@ function dol_getshmop($memoryid) } shmop_close($handle); } else { - return null; // Can't open existing block, so we suppose it was not created, so nothing were cached yet for the memoryid + return null; // Can't open existing block, so we suppose it was not created, so nothing were cached yet for the memoryid } return $data; } diff --git a/htdocs/core/lib/price.lib.php b/htdocs/core/lib/price.lib.php index 9be293a81ab..28723ab87db 100644 --- a/htdocs/core/lib/price.lib.php +++ b/htdocs/core/lib/price.lib.php @@ -157,8 +157,8 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt if ($resql) { $obj = $db->fetch_object($resql); if ($obj) { - $localtax1_rate = (float) $obj->localtax1; // Use float to force to get first numeric value when value is x:y:z - $localtax2_rate = (float) $obj->localtax2; // Use float to force to get first numeric value when value is -19:-15:-9 + $localtax1_rate = (float) $obj->localtax1; // Use float to force to get first numeric value when value is x:y:z + $localtax2_rate = (float) $obj->localtax2; // Use float to force to get first numeric value when value is -19:-15:-9 $localtax1_type = $obj->localtax1_type; $localtax2_type = $obj->localtax2_type; //var_dump($localtax1_rate.' '.$localtax2_rate.' '.$localtax1_type.' '.$localtax2_type); @@ -443,7 +443,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt // initialize result array //for ($i=0; $i <= 18; $i++) $result[$i] = (float) $result[$i]; - dol_syslog('Price.lib::calcul_price_total MAIN_ROUNDING_RULE_TOT='.(empty($conf->global->MAIN_ROUNDING_RULE_TOT)?'':$conf->global->MAIN_ROUNDING_RULE_TOT).' pu='.$pu.' qty='.$qty.' price_base_type='.$price_base_type.' total_ht='.$result[0].'-total_vat='.$result[1].'-total_ttc='.$result[2]); + dol_syslog('Price.lib::calcul_price_total MAIN_ROUNDING_RULE_TOT='.(empty($conf->global->MAIN_ROUNDING_RULE_TOT) ? '' : $conf->global->MAIN_ROUNDING_RULE_TOT).' pu='.$pu.' qty='.$qty.' price_base_type='.$price_base_type.' total_ht='.$result[0].'-total_vat='.$result[1].'-total_ttc='.$result[2]); return $result; } diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 6cc4650bea4..89fd9fe590b 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -618,7 +618,7 @@ function checkUserAccessToObject($user, array $featuresarray, $objectid = 0, $ta $checksoc = array('societe'); // Test for societe object $checkother = array('contact', 'agenda'); // Test on entity + link to third party on field $dbt_keyfield. Allowed if link is empty (Ex: contacts...). $checkproject = array('projet', 'project'); // Test for project object - $checktask = array('projet_task'); // Test for task object + $checktask = array('projet_task'); // Test for task object $nocheck = array('barcode', 'stock'); // No test //$checkdefault = 'all other not already defined'; // Test on entity + link to third party on field $dbt_keyfield. Not allowed if link is empty (Ex: invoice, orders...). diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php index e015313ad15..ab47bc02899 100644 --- a/htdocs/core/lib/security2.lib.php +++ b/htdocs/core/lib/security2.lib.php @@ -234,7 +234,7 @@ if (!function_exists('dol_loginfunction')) { if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); - } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { + } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); $width = 128; } elseif (!empty($mysoc->logo_squarred_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_small)) { diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index d83bf427ead..913438b4600 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -1256,7 +1256,9 @@ class pdf_einstein extends ModelePDFCommandes global $conf, $langs, $hookmanager; $ltrdirection = 'L'; - if ($outputlangs->trans("DIRECTION") == 'rtl') $ltrdirection = 'R'; + if ($outputlangs->trans("DIRECTION") == 'rtl') { + $ltrdirection = 'R'; + } // Load traductions files required by page $outputlangs->loadLangs(array("main", "bills", "propal", "orders", "companies")); diff --git a/htdocs/core/modules/modCategorie.class.php b/htdocs/core/modules/modCategorie.class.php index 776c5c76681..c3b7f256b4b 100644 --- a/htdocs/core/modules/modCategorie.class.php +++ b/htdocs/core/modules/modCategorie.class.php @@ -164,8 +164,8 @@ class modCategorie extends DolibarrModules $typeexample .= ($typeexample ? " / " : "")."11=Website page"; } - $this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.type'=>"Type", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategory", 'pcat.label'=>"ParentCategoryLabel" ); - $this->export_TypeFields_array[$r] = array('cat.label'=>"Text", 'cat.type'=>"Numeric", 'cat.description'=>"Text", 'cat.fk_parent'=>'List:categorie:label:rowid', 'pcat.label'=>'Text' ); + $this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.type'=>"Type", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategory", 'pcat.label'=>"ParentCategoryLabel"); + $this->export_TypeFields_array[$r] = array('cat.label'=>"Text", 'cat.type'=>"Numeric", 'cat.description'=>"Text", 'cat.fk_parent'=>'List:categorie:label:rowid', 'pcat.label'=>'Text'); $this->export_entities_array[$r] = array(); // We define here only fields that use another picto $this->export_help_array[$r] = array('cat.type'=>$typeexample); @@ -460,7 +460,7 @@ class modCategorie extends DolibarrModules ); $this->import_examplevalues_array[$r] = array( - 'ca.label'=>"My Category Label", 'ca.type'=>$typeexample, 'ca.description'=>"My Category description", // $typeexample built above in exports + 'ca.label'=>"My Category Label", 'ca.type'=>$typeexample, 'ca.description'=>"My Category description", // $typeexample built above in exports 'ca.fk_parent' => 'rowid or label' ); $this->import_updatekeys_array[$r] = array('ca.label'=>'Label'); @@ -538,7 +538,7 @@ class modCategorie extends DolibarrModules $this->import_convertvalue_array[$r] = array( 'cs.fk_categorie'=>array('rule'=>'fetchidfromref', 'classfile'=>'/categories/class/categorie.class.php', 'class'=>'Categorie', 'method'=>'fetch', 'element'=>'category'), - 'cs.fk_member'=>array('rule'=>'fetchidfromref','classfile'=>'/adherents/class/adherent.class.php','class'=>'Adherent','method'=>'fetch','element'=>'Member') + 'cs.fk_member'=>array('rule'=>'fetchidfromref', 'classfile'=>'/adherents/class/adherent.class.php', 'class'=>'Adherent', 'method'=>'fetch', 'element'=>'Member') ); $this->import_examplevalues_array[$r] = array('cs.fk_categorie'=>"rowid or label", 'cs.fk_member'=>"rowid or ref"); } @@ -579,7 +579,7 @@ class modCategorie extends DolibarrModules $this->import_convertvalue_array[$r] = array( 'cs.fk_categorie'=>array('rule'=>'fetchidfromref', 'classfile'=>'/categories/class/categorie.class.php', 'class'=>'Categorie', 'method'=>'fetch', 'element'=>'category'), - 'cs.fk_project'=>array('rule'=>'fetchidfromref','classfile'=>'/projet/class/project.class.php','class'=>'Project','method'=>'fetch','element'=>'Project') + 'cs.fk_project'=>array('rule'=>'fetchidfromref', 'classfile'=>'/projet/class/project.class.php', 'class'=>'Project', 'method'=>'fetch', 'element'=>'Project') ); $this->import_examplevalues_array[$r] = array('cp.fk_categorie'=>"rowid or label", 'cp.fk_project'=>"rowid or ref"); } @@ -597,7 +597,7 @@ class modCategorie extends DolibarrModules $this->import_convertvalue_array[$r] = array( 'cu.fk_categorie'=>array('rule'=>'fetchidfromref', 'classfile'=>'/categories/class/categorie.class.php', 'class'=>'Categorie', 'method'=>'fetch', 'element'=>'category'), - 'cu.fk_user'=>array('rule'=>'fetchidfromref','classfile'=>'/user/class/user.class.php','class'=>'User','method'=>'fetch','element'=>'User') + 'cu.fk_user'=>array('rule'=>'fetchidfromref', 'classfile'=>'/user/class/user.class.php', 'class'=>'User', 'method'=>'fetch', 'element'=>'User') ); $this->import_examplevalues_array[$r] = array('cu.fk_categorie'=>"rowid or label", 'cu.fk_user'=>"rowid or login"); } diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 9dcccb92fdc..d0e51fb8bc7 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1739,7 +1739,7 @@ class pdf_cyan extends ModelePDFPropales $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); - $mode = 'target'; + $mode = 'target'; $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, $mode, $object); // Show recipient diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php index c4fb2ef7b50..08ccf213b18 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -133,7 +133,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $this->db = $db; $this->name = "canelle"; $this->description = $langs->trans('SuppliersInvoiceModel'); - $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template + $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template // Page dimensions $this->type = 'pdf'; diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php index 8c706f59db3..76d264f2444 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -135,7 +135,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $this->db = $db; $this->name = "muscadet"; $this->description = $langs->trans('SuppliersCommandModelMuscadet'); - $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template + $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template // Page size for A4 format $this->type = 'pdf'; @@ -1127,7 +1127,9 @@ class pdf_muscadet extends ModelePDFSuppliersOrders global $langs, $conf, $mysoc; $ltrdirection = 'L'; - if ($outputlangs->trans("DIRECTION") == 'rtl') $ltrdirection = 'R'; + if ($outputlangs->trans("DIRECTION") == 'rtl') { + $ltrdirection = 'R'; + } // Load translation files required by the page $outputlangs->loadLangs(array("main", "orders", "companies", "bills", "sendings")); diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php index 0a4cd815d45..5b9ffa062a3 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -132,7 +132,7 @@ class pdf_standard extends ModelePDFSuppliersPayments $this->db = $db; $this->name = "standard"; $this->description = $langs->trans('DocumentModelStandardPDF'); - $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template + $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template // Page size for A4 format $this->type = 'pdf'; diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index 1bf47275599..c2ab5c99ea6 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -132,7 +132,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $this->db = $db; $this->name = "aurore"; $this->description = $langs->trans('DocModelAuroreDescription'); - $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template + $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template // Page size for A4 format $this->type = 'pdf'; diff --git a/htdocs/core/modules/workstation/mod_workstation_advanced.php b/htdocs/core/modules/workstation/mod_workstation_advanced.php index 2f1a8ae9d71..6611f8d926e 100755 --- a/htdocs/core/modules/workstation/mod_workstation_advanced.php +++ b/htdocs/core/modules/workstation/mod_workstation_advanced.php @@ -27,7 +27,7 @@ * \brief File containing class for advanced numbering model of Workstation */ -require_once DOL_DOCUMENT_ROOT . '/core/modules/workstation/modules_workstation.php'; +require_once DOL_DOCUMENT_ROOT.'/core/modules/workstation/modules_workstation.php'; /** diff --git a/htdocs/core/photos_resize.php b/htdocs/core/photos_resize.php index 654435dad89..7b2feef5c72 100644 --- a/htdocs/core/photos_resize.php +++ b/htdocs/core/photos_resize.php @@ -475,7 +475,7 @@ if ($action == 'confirm_crop') { * View */ -$title= $langs->trans("ImageEditor"); +$title = $langs->trans("ImageEditor"); $morejs = array('/includes/jquery/plugins/jcrop/js/jquery.Jcrop.min.js', '/core/js/lib_photosresize.js'); $morecss = array('/includes/jquery/plugins/jcrop/css/jquery.Jcrop.css'); diff --git a/htdocs/core/tpl/extrafields_list_search_param.tpl.php b/htdocs/core/tpl/extrafields_list_search_param.tpl.php index 56652b87dd3..7e58e106882 100644 --- a/htdocs/core/tpl/extrafields_list_search_param.tpl.php +++ b/htdocs/core/tpl/extrafields_list_search_param.tpl.php @@ -18,17 +18,17 @@ if (!empty($search_array_options) && is_array($search_array_options)) { // $extr if (is_array($val) && array_key_exists('start', $val) && array_key_exists('end', $val)) { // date range from list filters is stored as array('start' => , 'end' => ) // start date - $param .= '&' . $search_options_pattern.$tmpkey.'_startyear=' . dol_print_date($val['start'], '%Y'); - $param .= '&' . $search_options_pattern.$tmpkey.'_startmonth=' . dol_print_date($val['start'], '%m'); - $param .= '&' . $search_options_pattern.$tmpkey.'_startday=' . dol_print_date($val['start'], '%d'); - $param .= '&' . $search_options_pattern.$tmpkey.'_starthour=' . dol_print_date($val['start'], '%H'); - $param .= '&' . $search_options_pattern.$tmpkey.'_startmin=' . dol_print_date($val['start'], '%M'); + $param .= '&'.$search_options_pattern.$tmpkey.'_startyear='.dol_print_date($val['start'], '%Y'); + $param .= '&'.$search_options_pattern.$tmpkey.'_startmonth='.dol_print_date($val['start'], '%m'); + $param .= '&'.$search_options_pattern.$tmpkey.'_startday='.dol_print_date($val['start'], '%d'); + $param .= '&'.$search_options_pattern.$tmpkey.'_starthour='.dol_print_date($val['start'], '%H'); + $param .= '&'.$search_options_pattern.$tmpkey.'_startmin='.dol_print_date($val['start'], '%M'); // end date - $param .= '&' . $search_options_pattern.$tmpkey.'_endyear=' . dol_print_date($val['end'], '%Y'); - $param .= '&' . $search_options_pattern.$tmpkey.'_endmonth=' . dol_print_date($val['end'], '%m'); - $param .= '&' . $search_options_pattern.$tmpkey.'_endday=' . dol_print_date($val['end'], '%d'); - $param .= '&' . $search_options_pattern.$tmpkey.'_endhour=' . dol_print_date($val['end'], '%H'); - $param .= '&' . $search_options_pattern.$tmpkey.'_endmin=' . dol_print_date($val['end'], '%M'); + $param .= '&'.$search_options_pattern.$tmpkey.'_endyear='.dol_print_date($val['end'], '%Y'); + $param .= '&'.$search_options_pattern.$tmpkey.'_endmonth='.dol_print_date($val['end'], '%m'); + $param .= '&'.$search_options_pattern.$tmpkey.'_endday='.dol_print_date($val['end'], '%d'); + $param .= '&'.$search_options_pattern.$tmpkey.'_endhour='.dol_print_date($val['end'], '%H'); + $param .= '&'.$search_options_pattern.$tmpkey.'_endmin='.dol_print_date($val['end'], '%M'); $val = ''; } if ($val != '') { diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index cd58ae554f2..199d9011cf6 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -125,7 +125,7 @@ if (empty($reshook) && isset($extrafields->attributes[$object->table_element]['l $lastseparatorkeyfound = $tmpkeyextra; } else { - print '
    id) ? '_'.$object->id : ''); /*if ($extrafields_collapse_num && $extrafields_collapse_num_old && $extrafields_collapse_num != $extrafields_collapse_num_old) { print ' trextrafields_collapse_new'; }*/ diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index 75daecbf38e..4f92f5d9af0 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -38,17 +38,17 @@ if ($massaction == 'predelete') { if ($massaction == 'preaffecttag') { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $categ = new Categorie($db); - $categ_types=array(); - $categ_type_array=$categ->getMapList(); + $categ_types = array(); + $categ_type_array = $categ->getMapList(); foreach ($categ_type_array as $categdef) { - if (isset($object) && $categdef['obj_table']==$object->table_element) { + if (isset($object) && $categdef['obj_table'] == $object->table_element) { if (!array_key_exists($categdef['code'], $categ_types)) { - $categ_types[$categdef['code']] = array('code'=>$categdef['code'],'label'=>$langs->trans($categdef['obj_class'])); + $categ_types[$categdef['code']] = array('code'=>$categdef['code'], 'label'=>$langs->trans($categdef['obj_class'])); } } - if (isset($objecttmp) && $categdef['obj_table']==$objecttmp->table_element) { + if (isset($objecttmp) && $categdef['obj_table'] == $objecttmp->table_element) { if (!array_key_exists($categdef['code'], $categ_types)) { - $categ_types[$categdef['code']] = array('code'=>$categdef['code'],'label'=>$langs->trans($categdef['obj_class'])); + $categ_types[$categdef['code']] = array('code'=>$categdef['code'], 'label'=>$langs->trans($categdef['obj_class'])); } } } @@ -57,12 +57,12 @@ if ($massaction == 'preaffecttag') { if (!empty($categ_types)) { foreach ($categ_types as $categ_type) { $cate_arbo = $form->select_all_categories($categ_type['code'], null, 'parent', null, null, 1); - $formquestion[]=array('type' => 'other', + $formquestion[] = array('type' => 'other', 'name' => 'affecttag_'.$categ_type['code'], 'label' => $langs->trans("Tag").' '.$categ_type['label'], 'value' => $form->multiselectarray('contcats_'.$categ_type['code'], $cate_arbo, GETPOST('contcats_'.$categ_type['code'], 'array'), null, null, null, null, '60%')); } - $formquestion[]=array('type' => 'other', + $formquestion[] = array('type' => 'other', 'name' => 'affecttag_type', 'label' => '', 'value' => ''); diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index dd779803026..c45ce9d2406 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -173,11 +173,11 @@ class InterfaceWorkflowManager extends DolibarrTriggers } } - if (! empty($conf->expedition->enabled) && ! empty($conf->workflow->enabled) && ! empty($conf->global->WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE)) { + if (!empty($conf->expedition->enabled) && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE)) { /** @var Facture $object */ $object->fetchObjectLinked('', 'shipping', $object->id, $object->element); - if (! empty($object->linkedObjects)) { + if (!empty($object->linkedObjects)) { /** @var Expedition $shipment */ $shipment = array_shift($object->linkedObjects['shipping']); diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index 1310936ca83..7f098951fe7 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -366,8 +366,8 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) { $parameters = array(); $reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters); - if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray)>0) { - $sectionauto[]=$hookmanager->resArray; + if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray) > 0) { + $sectionauto[] = $hookmanager->resArray; $rowspan += count($hookmanager->resArray); } } diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index 1a33cf1a4b6..ac9e465b43b 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -24,7 +24,7 @@ // Put here all includes required by your class file require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; -require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php'; +require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; //require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; /** @@ -102,7 +102,7 @@ class ConferenceOrBooth extends ActionComm /** * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ - public $fields=array( + public $fields = array( 'id' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), 'ref' => array('type'=>'integer', 'label'=>'Ref', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>2, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>0, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'help'=>"Help text", 'showoncombobox'=>'1',), @@ -195,11 +195,11 @@ class ConferenceOrBooth extends ActionComm */ protected function setPercentageFromStatus() { - if ($this->status==self::STATUS_DONE) { - $this->percentage=100; + if ($this->status == self::STATUS_DONE) { + $this->percentage = 100; } - if ($this->status==self::STATUS_DRAFT) { - $this->percentage=0; + if ($this->status == self::STATUS_DRAFT) { + $this->percentage = 0; } } @@ -211,12 +211,12 @@ class ConferenceOrBooth extends ActionComm */ protected function setActionCommFields(User $user) { - $this->userownerid=$user->id; - $this->type_id=$this->fk_action; - $this->socid=$this->fk_soc; - $this->datef=$this->datep2; - $this->note_private=$this->note; - $this->fk_user_author=$this->fk_user_author; + $this->userownerid = $user->id; + $this->type_id = $this->fk_action; + $this->socid = $this->fk_soc; + $this->datef = $this->datep2; + $this->note_private = $this->note; + $this->fk_user_author = $this->fk_user_author; } /** @@ -226,9 +226,9 @@ class ConferenceOrBooth extends ActionComm */ protected function getActionCommFields() { - $this->fk_action=$this->type_id; - $this->fk_soc=$this->socid; - $this->datep2=$this->datef; + $this->fk_action = $this->type_id; + $this->fk_soc = $this->socid; + $this->datep2 = $this->datef; } /** @@ -408,7 +408,9 @@ class ConferenceOrBooth extends ActionComm if (!$error && !$notrigger) { // Call trigger $result = $this->call_trigger('CONFERENCEORBOOTH_VALIDATE', $user); - if ($result < 0) $error++; + if ($result < 0) { + $error++; + } // End call triggers } @@ -540,7 +542,7 @@ class ConferenceOrBooth extends ActionComm if ($add_save_lastsearch_values) { $url .= '&save_lastsearch_values=1'; } - if ($option=='withproject') { + if ($option == 'withproject') { $url .= '&withproject=1'; } } diff --git a/htdocs/exports/class/export.class.php b/htdocs/exports/class/export.class.php index e0067709e85..c87f03f3110 100644 --- a/htdocs/exports/class/export.class.php +++ b/htdocs/exports/class/export.class.php @@ -178,7 +178,7 @@ class Export // Code du dataset export $this->array_export_code[$i] = $module->export_code[$r]; // Define a key for sort - $this->array_export_code_for_sort[$i] = $module->module_position.'_'.$module->export_code[$r]; // Add a key into the module + $this->array_export_code_for_sort[$i] = $module->module_position.'_'.$module->export_code[$r]; // Add a key into the module // Libelle du dataset export $this->array_export_label[$i] = $module->getExportDatasetLabel($r); // Tableau des champ a exporter (cle=champ, valeur=libelle) diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index a29473eefd2..71a15023343 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -682,10 +682,10 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print img_picto("Auto fill", 'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($sign * $remaintopay)."'"); } print ''; - print ''; // class is requied to be used by javascript callForResult(); + print ''; // class is requied to be used by javascript callForResult(); } else { print ''; - print ''; // class is requied to be used by javascript callForResult(); + print ''; // class is requied to be used by javascript callForResult(); } print ""; diff --git a/htdocs/index.php b/htdocs/index.php index 8c1433c79cb..1884d9a823a 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -26,7 +26,7 @@ */ -define('CSRFCHECK_WITH_TOKEN', 1); // We force need to use a token to login when making a POST +define('CSRFCHECK_WITH_TOKEN', 1); // We force need to use a token to login when making a POST require 'main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 960b5b88c74..efe20aff6b1 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -4360,7 +4360,7 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo $mod = new $classname($db); //$mod->remove('noboxes'); - $mod->delete_menus(); // We must delete to be sure it is inserted with new values + $mod->delete_menus(); // We must delete to be sure it is inserted with new values $mod->init($reloadmode); } else { dolibarr_install_syslog('Failed to include '.DOL_DOCUMENT_ROOT.'/core/modules/mod'.$moduletoreloadshort.'.class.php'); diff --git a/htdocs/mrp/mo_note.php b/htdocs/mrp/mo_note.php index 12b9ade3f2a..6fb173c4295 100644 --- a/htdocs/mrp/mo_note.php +++ b/htdocs/mrp/mo_note.php @@ -60,7 +60,7 @@ if ($id > 0 || !empty($ref)) { $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); $result = restrictedArea($user, 'mrp', $object->id, 'mrp_mo', '', 'fk_soc', 'rowid', $isdraft); -$permissionnote = $user->rights->mrp->write; // Used by the include of actions_setnotes.inc.php +$permissionnote = $user->rights->mrp->write; // Used by the include of actions_setnotes.inc.php diff --git a/htdocs/paypal/lib/paypal.lib.php b/htdocs/paypal/lib/paypal.lib.php index dee6476f773..16e728512f6 100644 --- a/htdocs/paypal/lib/paypal.lib.php +++ b/htdocs/paypal/lib/paypal.lib.php @@ -282,7 +282,7 @@ function callSetExpressCheckout($paymentAmount, $currencyCodeType, $paymentType, $_SESSION["FinalPaymentAmt"] = $paymentAmount; $_SESSION["currencyCodeType"] = $currencyCodeType; $_SESSION["PaymentType"] = $paymentType; // 'Mark', 'Sole' - $_SESSION['ipaddress'] = getUserRemoteIP(); // Payer ip + $_SESSION['ipaddress'] = getUserRemoteIP(); // Payer ip //'--------------------------------------------------------------------------------------------------------------- //' Make the API call to PayPal diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index d3c23b17c4a..407eac7c30a 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -739,7 +739,7 @@ class Productcustomerprice extends CommonObject $sql .= " tms=".(dol_strlen($this->tms) != 0 ? "'".$this->db->idate($this->tms)."'" : 'null').","; $sql .= " fk_product=".(isset($this->fk_product) ? $this->fk_product : "null").","; $sql .= " fk_soc=".(isset($this->fk_soc) ? $this->fk_soc : "null").","; - $sql .= " ref_customer=".(isset($this->ref_customer) ? "'" . $this->db->escape($this->ref_customer) . "'" : "null").","; + $sql .= " ref_customer=".(isset($this->ref_customer) ? "'".$this->db->escape($this->ref_customer)."'" : "null").","; $sql .= " price=".(isset($this->price) ? $this->price : "null").","; $sql .= " price_ttc=".(isset($this->price_ttc) ? $this->price_ttc : "null").","; $sql .= " price_min=".(isset($this->price_min) ? $this->price_min : "null").","; diff --git a/htdocs/product/stock/productlot_document.php b/htdocs/product/stock/productlot_document.php index c6e72c6f0da..4f695f990e4 100644 --- a/htdocs/product/stock/productlot_document.php +++ b/htdocs/product/stock/productlot_document.php @@ -113,7 +113,9 @@ if ($user->socid > 0) { // Protection if external user accessforbidden(); } //$result = restrictedArea($user, 'productbatch'); -if (!$permissiontoread) accessforbidden(); +if (!$permissiontoread) { + accessforbidden(); +} /* diff --git a/htdocs/product/stock/stockatdate.php b/htdocs/product/stock/stockatdate.php index 3fc409f58be..d5de51c7311 100644 --- a/htdocs/product/stock/stockatdate.php +++ b/htdocs/product/stock/stockatdate.php @@ -607,7 +607,7 @@ $parameters = array('sql'=>$sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; -if (empty($date) || ! $dateIsValid) { +if (empty($date) || !$dateIsValid) { $colspan = 8; if ($mode == 'future') { $colspan++; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 66288159f39..feee30f3527 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -880,7 +880,7 @@ foreach ($listofreferent as $key => $value) { } // Add total if we have to - if ($qualifiedfortotal) { + if ($qualifiedfortotal) { $total_ht = $total_ht + $total_ht_by_line; $total_ttc = $total_ttc + $total_ttc_by_line; } diff --git a/htdocs/projet/graph_opportunities.inc.php b/htdocs/projet/graph_opportunities.inc.php index 56649af9a45..ae0542d8b4b 100644 --- a/htdocs/projet/graph_opportunities.inc.php +++ b/htdocs/projet/graph_opportunities.inc.php @@ -19,7 +19,7 @@ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { $sql = "SELECT p.fk_opp_status as opp_status, cls.code, COUNT(p.rowid) as nb, SUM(p.opp_amount) as opp_amount, SUM(p.opp_amount * p.opp_percent) as ponderated_opp_amount"; - $sql .= " FROM ".MAIN_DB_PREFIX."projet as p LEFT JOIN ".MAIN_DB_PREFIX."c_lead_status as cls ON p.fk_opp_status = cls.rowid"; // If lead status has been removed, we must show it in stats as unknown + $sql .= " FROM ".MAIN_DB_PREFIX."projet as p LEFT JOIN ".MAIN_DB_PREFIX."c_lead_status as cls ON p.fk_opp_status = cls.rowid"; // If lead status has been removed, we must show it in stats as unknown $sql .= " WHERE p.entity IN (".getEntity('project').")"; $sql .= " AND p.fk_statut = 1"; // Opend projects only if ($mine || empty($user->rights->projet->all->lire)) { @@ -91,7 +91,7 @@ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { $labelStatus = $listofopplabel[$status]; } if (empty($labelStatus)) { - $labelStatus = $langs->transnoentitiesnoconv('OldValue', $status); // When id is id of an entry no more in dictionary for example. + $labelStatus = $langs->transnoentitiesnoconv('OldValue', $status); // When id is id of an entry no more in dictionary for example. } //$labelStatus .= ' ('.$langs->trans("Coeff").': '.price2num($listofoppstatus[$status]).')'; diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index 753ccc9b419..0b26161c28c 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -59,9 +59,9 @@ restrictedArea($user, 'projet', $object->fk_project, 'projet&project'); // Add new contact if ($action == 'addcontact' && $user->rights->projet->creer) { - $source = 'internal'; + $source = 'internal'; if (GETPOST("addsourceexternal")) { - $source ='external'; + $source = 'external'; } $result = $object->fetch($id, $ref); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 416c16e46a3..5c7eac48240 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -853,7 +853,7 @@ class Societe extends CommonObject $this->accountancy_code_customer = trim($this->code_compta); $this->accountancy_code_supplier = trim($this->code_compta_fournisseur); $this->accountancy_code_buy = trim($this->accountancy_code_buy); - $this->accountancy_code_sell= trim($this->accountancy_code_sell); + $this->accountancy_code_sell = trim($this->accountancy_code_sell); if (!empty($this->multicurrency_code)) { $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code); @@ -917,8 +917,8 @@ class Societe extends CommonObject $sql .= ", ".(int) $this->fk_multicurrency; $sql .= ", '".$this->db->escape($this->multicurrency_code)."'"; if (empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'"; - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'"; + $sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'"; + $sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'"; } $sql .= ")"; @@ -931,9 +931,9 @@ class Societe extends CommonObject // update accountancy for this entity if (!$error && !empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { - $this->db->query("DELETE FROM " . MAIN_DB_PREFIX . "societe_perentity WHERE fk_soc = " . ((int) $this->id) . " AND entity = " . ((int) $conf->entity)); + $this->db->query("DELETE FROM ".MAIN_DB_PREFIX."societe_perentity WHERE fk_soc = ".((int) $this->id)." AND entity = ".((int) $conf->entity)); - $sql = "INSERT INTO " . MAIN_DB_PREFIX . "societe_perentity ("; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_perentity ("; $sql .= " fk_soc"; $sql .= ", entity"; $sql .= ", accountancy_code_customer"; @@ -942,11 +942,11 @@ class Societe extends CommonObject $sql .= ", accountancy_code_sell"; $sql .= ") VALUES ("; $sql .= $this->id; - $sql .= ", " . $conf->entity; - $sql .= ", '" . $this->db->escape($this->accountancy_code_customer) . "'"; - $sql .= ", '" . $this->db->escape($this->accountancy_code_supplier) . "'"; - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'"; - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'"; + $sql .= ", ".$conf->entity; + $sql .= ", '".$this->db->escape($this->accountancy_code_customer)."'"; + $sql .= ", '".$this->db->escape($this->accountancy_code_supplier)."'"; + $sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'"; + $sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'"; $sql .= ")"; $result = $this->db->query($sql); if (!$result) { @@ -1053,7 +1053,7 @@ class Societe extends CommonObject $error++; $this->error = $contact->error; $this->errors = array_merge($this->errors, $contact->errors); - dol_syslog(get_class($this) . "::create_individual Affect Tag ERROR:" . $this->error, LOG_ERR); + dol_syslog(get_class($this)."::create_individual Affect Tag ERROR:".$this->error, LOG_ERR); $contactId = $result; } } @@ -1063,7 +1063,7 @@ class Societe extends CommonObject if ($result < 0) { $this->error = $contact->error; $this->errors = array_merge($this->errors, $contact->errors); - dol_syslog(get_class($this) . "::create_individual set mailing status ERROR:" . $this->error, LOG_ERR); + dol_syslog(get_class($this)."::create_individual set mailing status ERROR:".$this->error, LOG_ERR); $contactId = $result; } } @@ -1299,7 +1299,7 @@ class Societe extends CommonObject } $this->code_compta_client = trim(empty($this->code_compta) ? $this->code_compta_client : $this->code_compta); - $this->code_compta = $this->code_compta_client; // for backward compatibility + $this->code_compta = $this->code_compta_client; // for backward compatibility $this->code_compta_fournisseur = trim($this->code_compta_fournisseur); // Check parameters. More tests are done later in the ->verify() @@ -1340,7 +1340,7 @@ class Societe extends CommonObject $this->webservices_key = trim($this->webservices_key); $this->accountancy_code_buy = trim($this->accountancy_code_buy); - $this->accountancy_code_sell= trim($this->accountancy_code_sell); + $this->accountancy_code_sell = trim($this->accountancy_code_sell); //Incoterms $this->fk_incoterms = (int) $this->fk_incoterms; @@ -1467,8 +1467,8 @@ class Societe extends CommonObject $sql .= ",supplier_order_min_amount= ".($this->supplier_order_min_amount != '' ? $this->supplier_order_min_amount : 'null'); $sql .= ",fk_prospectlevel='".$this->db->escape($this->fk_prospectlevel)."'"; if (empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { - $sql .= ", accountancy_code_buy = '" . $this->db->escape($this->accountancy_code_buy) . "'"; - $sql .= ", accountancy_code_sell= '" . $this->db->escape($this->accountancy_code_sell) . "'"; + $sql .= ", accountancy_code_buy = '".$this->db->escape($this->accountancy_code_buy)."'"; + $sql .= ", accountancy_code_sell= '".$this->db->escape($this->accountancy_code_sell)."'"; if ($customer) { $sql .= ", code_compta = ".(!empty($this->code_compta_client) ? "'".$this->db->escape($this->code_compta_client)."'" : "null"); @@ -1559,9 +1559,9 @@ class Societe extends CommonObject // update accountancy for this entity if (!$error && !empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { - $this->db->query("DELETE FROM " . MAIN_DB_PREFIX . "societe_perentity WHERE fk_soc = " . ((int) $this->id) . " AND entity = " . ((int) $conf->entity)); + $this->db->query("DELETE FROM ".MAIN_DB_PREFIX."societe_perentity WHERE fk_soc = ".((int) $this->id)." AND entity = ".((int) $conf->entity)); - $sql = "INSERT INTO " . MAIN_DB_PREFIX . "societe_perentity ("; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_perentity ("; $sql .= " fk_soc"; $sql .= ", entity"; $sql .= ", accountancy_code_customer"; @@ -1570,11 +1570,11 @@ class Societe extends CommonObject $sql .= ", accountancy_code_sell"; $sql .= ") VALUES ("; $sql .= $this->id; - $sql .= ", " . $conf->entity; - $sql .= ", '" . $this->db->escape($this->code_compta_client)."'"; - $sql .= ", '" . $this->db->escape($this->code_compta_fournisseur)."'"; - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'"; - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'"; + $sql .= ", ".$conf->entity; + $sql .= ", '".$this->db->escape($this->code_compta_client)."'"; + $sql .= ", '".$this->db->escape($this->code_compta_fournisseur)."'"; + $sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'"; + $sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'"; $sql .= ")"; $result = $this->db->query($sql); if (!$result) { @@ -1702,7 +1702,7 @@ class Societe extends CommonObject } $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s'; if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity); + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = ".((int) $conf->entity); } $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_effectif as e ON s.fk_effectif = e.id'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid'; @@ -1792,7 +1792,7 @@ class Societe extends CommonObject $this->state_id = $obj->state_id; $this->state_code = $obj->state_code; $this->region_id = $obj->region_id; - $this->region_code = $obj->region_code; + $this->region_code = $obj->region_code; $this->state = ($obj->state != '-' ? $obj->state : ''); $transcode = $langs->trans('StatusProspect'.$obj->fk_stcomm); @@ -2630,7 +2630,7 @@ class Societe extends CommonObject $label .= '
    '.implode(' ', $phonelist); } if (!empty($this->address)) { - $label .= '
    '.$langs->trans("Address").': '.dol_format_address($this, 1, ' ', $langs); // Address + country + $label .= '
    '.$langs->trans("Address").': '.dol_format_address($this, 1, ' ', $langs); // Address + country } elseif (!empty($this->country_code)) { $label .= '
    '.$langs->trans('Country').': '.$this->country_code; } @@ -3350,7 +3350,7 @@ class Societe extends CommonObject if ($type == 'customer') { $this->code_compta_client = $mod->code; - $this->code_compta = $this->code_compta_client; // For backward compatibility + $this->code_compta = $this->code_compta_client; // For backward compatibility } elseif ($type == 'supplier') { $this->code_compta_fournisseur = $mod->code; } @@ -3385,7 +3385,7 @@ class Societe extends CommonObject if ($this->id) { // Check if the id we want to add as parent has not already one parent that is the current id we try to update if ($id > 0) { - $sameparent = $this->validateFamilyTree($id, $this->id, 0); + $sameparent = $this->validateFamilyTree($id, $this->id, 0); if ($sameparent < 0) { return -1; } @@ -3397,7 +3397,7 @@ class Societe extends CommonObject $sql = 'UPDATE '.MAIN_DB_PREFIX.'societe SET parent = '.($id > 0 ? $id : 'null').' WHERE rowid = '.((int) $this->id); - $resql = $this->db->query($sql); + $resql = $this->db->query($sql); if ($resql) { $this->parent = $id; return 1; @@ -3426,16 +3426,16 @@ class Societe extends CommonObject $sql = 'SELECT s.parent'; $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s'; $sql .= ' WHERE rowid = '.((int) $idparent); - $resql = $this->db->query($sql); + $resql = $this->db->query($sql); if ($resql) { $obj = $this->db->fetch_object($resql); - if ($obj->parent == '') { + if ($obj->parent == '') { return 0; - } elseif ($obj->parent == $idchild) { + } elseif ($obj->parent == $idchild) { return 1; } else { - $sameparent = $this->validateFamilyTree($obj->parent, $idchild, ($counter + 1)); + $sameparent = $this->validateFamilyTree($obj->parent, $idchild, ($counter + 1)); } return $sameparent; } else { @@ -3936,7 +3936,7 @@ class Societe extends CommonObject */ public function create_from_member(Adherent $member, $socname = '', $socalias = '', $customercode = '') { - // phpcs:enable + // phpcs:enable global $conf, $user, $langs; dol_syslog(get_class($this)."::create_from_member", LOG_DEBUG); @@ -4819,19 +4819,19 @@ class Societe extends CommonObject } $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET "; - $sql.= $field." = '".$this->db->escape($value)."'"; - $sql.= " WHERE rowid = ".((int) $this->id); + $sql .= $field." = '".$this->db->escape($value)."'"; + $sql .= " WHERE rowid = ".((int) $this->id); dol_syslog(get_class($this)."::".__FUNCTION__."", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { // Call triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('COMPANY_MODIFY', $this, $user, $langs, $conf); + include_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php'; + $interface = new Interfaces($this->db); + $result = $interface->run_triggers('COMPANY_MODIFY', $this, $user, $langs, $conf); if ($result < 0) { - $this->errors=$interface->errors; + $this->errors = $interface->errors; $this->db->rollback(); return -1; } @@ -4842,7 +4842,7 @@ class Societe extends CommonObject $this->db->commit(); return 1; } else { - $this->error=$this->db->lasterror(); + $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; } diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index a24b6a4776c..72246fdf9cb 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -374,7 +374,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { // Ref. Customer print '
    '; - print ''; + print ''; // VAT print '
    ' . $langs->trans('Parameter') . '' . $langs->trans('Value') . '
    '.$langs->trans('Parameter').''.$langs->trans('Value').'
    ' . $labelStatus . '' . price((isset($valsamount[$status]) ? (float) $valsamount[$status] : 0), 0, '', 1, -1, -1, $conf->currency) . ''.$labelStatus.''.price((isset($valsamount[$status]) ? (float) $valsamount[$status] : 0), 0, '', 1, -1, -1, $conf->currency).'
    '.$langs->trans('RefCustomer').'
    '.$langs->trans("VATRate").''; diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 907c3bf26c3..9c84e2c2e89 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -1019,7 +1019,7 @@ class SupplierProposal extends CommonObject $fk_parent_line, $this->lines[$i]->fk_fournprice, $this->lines[$i]->pa_ht, - empty($this->lines[$i]->label) ? '' : $this->lines[$i]->label, // deprecated + empty($this->lines[$i]->label) ? '' : $this->lines[$i]->label, // deprecated $this->lines[$i]->array_options, $this->lines[$i]->ref_fourn, $this->lines[$i]->fk_unit, @@ -1405,7 +1405,9 @@ class SupplierProposal extends CommonObject $soc = new Societe($this->db); $result = $soc->fetch($this->socid); - if ($result < 0) return -1; + if ($result < 0) { + return -1; + } // Define new ref if (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) { // empty should not happened, but when it occurs, the test save life diff --git a/htdocs/theme/eldy/manifest.json.php b/htdocs/theme/eldy/manifest.json.php index 7d0f75614c7..ec6472c80e6 100644 --- a/htdocs/theme/eldy/manifest.json.php +++ b/htdocs/theme/eldy/manifest.json.php @@ -64,7 +64,7 @@ top_httphead('text/json'); if (empty($dolibarr_nocache)) { header('Cache-Control: max-age=10800, public, must-revalidate'); // For a text/json, we must set an Expires to avoid to have it forced to an expired value by the web server - header('Expires: '.gmdate('D, d M Y H:i:s', dol_now('gmt') + 10800) . ' GMT'); + header('Expires: '.gmdate('D, d M Y H:i:s', dol_now('gmt') + 10800).' GMT'); } else { header('Cache-Control: no-cache'); } @@ -79,8 +79,8 @@ if (!empty($conf->global->MAIN_APPLICATION_TITLE)) { } -$manifest->theme_color = !empty($conf->global->MAIN_MANIFEST_APPLI_THEME_COLOR)?$conf->global->MAIN_MANIFEST_APPLI_THEME_COLOR:'#F05F40'; -$manifest->background_color = !empty($conf->global->MAIN_MANIFEST_APPLI_BG_COLOR)?$conf->global->MAIN_MANIFEST_APPLI_BG_COLOR:"#ffffff"; +$manifest->theme_color = !empty($conf->global->MAIN_MANIFEST_APPLI_THEME_COLOR) ? $conf->global->MAIN_MANIFEST_APPLI_THEME_COLOR : '#F05F40'; +$manifest->background_color = !empty($conf->global->MAIN_MANIFEST_APPLI_BG_COLOR) ? $conf->global->MAIN_MANIFEST_APPLI_BG_COLOR : "#ffffff"; $manifest->display = "standalone"; $manifest->splash_pages = null; $manifest->icons = array(); @@ -97,8 +97,8 @@ if (!empty($conf->global->MAIN_MANIFEST_APPLI_LOGO_URL)) { $manifest->icons[] = $icon; } elseif (!empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED)) { if (!empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI)) { - $iconRelativePath = 'logos/thumbs/'.$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI; - $iconPath = $conf->mycompany->dir_output.'/'.$iconRelativePath; + $iconRelativePath = 'logos/thumbs/'.$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI; + $iconPath = $conf->mycompany->dir_output.'/'.$iconRelativePath; if (is_readable($iconPath)) { $imgSize = getimagesize($iconPath); if ($imgSize) { @@ -112,8 +112,8 @@ if (!empty($conf->global->MAIN_MANIFEST_APPLI_LOGO_URL)) { } if (!empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_SMALL)) { - $iconRelativePath = 'logos/thumbs/'.$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_SMALL; - $iconPath = $conf->mycompany->dir_output.'/'.$iconRelativePath; + $iconRelativePath = 'logos/thumbs/'.$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_SMALL; + $iconPath = $conf->mycompany->dir_output.'/'.$iconRelativePath; if (is_readable($iconPath)) { $imgSize = getimagesize($iconPath); if ($imgSize) { @@ -127,8 +127,8 @@ if (!empty($conf->global->MAIN_MANIFEST_APPLI_LOGO_URL)) { } if (!empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED)) { - $iconRelativePath = 'logos/'.$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED; - $iconPath = $conf->mycompany->dir_output.'/'.$iconRelativePath; + $iconRelativePath = 'logos/'.$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED; + $iconPath = $conf->mycompany->dir_output.'/'.$iconRelativePath; if (is_readable($iconPath)) { $imgSize = getimagesize($iconPath); if ($imgSize) { diff --git a/htdocs/theme/md/manifest.json.php b/htdocs/theme/md/manifest.json.php index b249e81e7df..2ad98e7e565 100644 --- a/htdocs/theme/md/manifest.json.php +++ b/htdocs/theme/md/manifest.json.php @@ -71,7 +71,7 @@ top_httphead('text/json'); if (empty($dolibarr_nocache)) { header('Cache-Control: max-age=10800, public, must-revalidate'); // For a text/json, we must set an Expires to avoid to have it forced to an expired value by the web server - header('Expires: '.gmdate('D, d M Y H:i:s', dol_now('gmt') + 10800) . ' GMT'); + header('Expires: '.gmdate('D, d M Y H:i:s', dol_now('gmt') + 10800).' GMT'); } else { header('Cache-Control: no-cache'); } diff --git a/htdocs/user/home.php b/htdocs/user/home.php index 924dceb14ab..c8dbdf2c1b8 100644 --- a/htdocs/user/home.php +++ b/htdocs/user/home.php @@ -137,11 +137,11 @@ $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); - $lastcreatedbox .='
    '; - $lastcreatedbox .=''; - $lastcreatedbox .=''; - $lastcreatedbox .=''; - $lastcreatedbox .=''."\n"; + $lastcreatedbox .= '
    '; + $lastcreatedbox .= '
    '.$langs->trans("LastUsersCreated", min($num, $max)).''.$langs->trans("FullList").'
    '; + $lastcreatedbox .= ''; + $lastcreatedbox .= ''; + $lastcreatedbox .= ''."\n"; $i = 0; while ($i < $num && $i < $max) { @@ -162,24 +162,24 @@ if ($resql) { $companystatic->code_client = $obj->code_client; $companystatic->canvas = $obj->canvas; - $lastcreatedbox .=''; - $lastcreatedbox .=''; + $lastcreatedbox .= '"; - $lastcreatedbox .=''; - $lastcreatedbox .=""; + $lastcreatedbox .= ''; + $lastcreatedbox .= "'; - $lastcreatedbox .=''; - $lastcreatedbox .=''; + $lastcreatedbox .= ''; + $lastcreatedbox .= ''; + $lastcreatedbox .= ''; - $lastcreatedbox .=''; + $lastcreatedbox .= ''; $i++; } - $lastcreatedbox .="
    '.$langs->trans("LastUsersCreated", min($num, $max)).''.$langs->trans("FullList").'
    '; - $lastcreatedbox .=$fuserstatic->getNomUrl(-1); + $lastcreatedbox .= '
    '; + $lastcreatedbox .= $fuserstatic->getNomUrl(-1); if (!empty($conf->multicompany->enabled) && $obj->admin && !$obj->entity) { - $lastcreatedbox .=img_picto($langs->trans("SuperAdministrator"), 'redstar'); + $lastcreatedbox .= img_picto($langs->trans("SuperAdministrator"), 'redstar'); } elseif ($obj->admin) { - $lastcreatedbox .=img_picto($langs->trans("Administrator"), 'star'); + $lastcreatedbox .= img_picto($langs->trans("Administrator"), 'star'); } - $lastcreatedbox .="'.$obj->login.'"; + $lastcreatedbox .= "'.$obj->login.'"; if ($obj->fk_soc) { - $lastcreatedbox .=$companystatic->getNomUrl(1); + $lastcreatedbox .= $companystatic->getNomUrl(1); } else { - $lastcreatedbox .=$langs->trans("InternalUser"); + $lastcreatedbox .= $langs->trans("InternalUser"); } if ($obj->ldap_sid) { - $lastcreatedbox .=' ('.$langs->trans("DomainUser").')'; + $lastcreatedbox .= ' ('.$langs->trans("DomainUser").')'; } $entity = $obj->entity; @@ -193,19 +193,19 @@ if ($resql) { $entitystring = $mc->label; } } - $lastcreatedbox .=($entitystring ? ' ('.$entitystring.')' : ''); + $lastcreatedbox .= ($entitystring ? ' ('.$entitystring.')' : ''); - $lastcreatedbox .=''.dol_print_date($db->jdate($obj->datec), 'dayhour').''; - $lastcreatedbox .=$fuserstatic->getLibStatut(3); - $lastcreatedbox .=''.dol_print_date($db->jdate($obj->datec), 'dayhour').''; + $lastcreatedbox .= $fuserstatic->getLibStatut(3); + $lastcreatedbox .= '
    "; - $lastcreatedbox .="

    "; + $lastcreatedbox .= "
    "; + $lastcreatedbox .= "

    "; $db->free($resql); } else { @@ -238,11 +238,11 @@ if ($canreadperms) { } $num = $db->num_rows($resql); - $lastgroupbox .='
    '; - $lastgroupbox .=''; - $lastgroupbox .=''; - $lastgroupbox .=''; - $lastgroupbox .=''; + $lastgroupbox .= '
    '; + $lastgroupbox .= '
    '.$langs->trans("LastGroupsCreated", ($num ? $num : $max)).''.$langs->trans("FullList").'
    '; + $lastgroupbox .= ''; + $lastgroupbox .= ''; + $lastgroupbox .= ''; $i = 0; $grouptemp = new UserGroup($db); @@ -254,21 +254,21 @@ if ($canreadperms) { $grouptemp->name = $obj->name; $grouptemp->note = $obj->note; - $lastgroupbox .=''; - $lastgroupbox .=''; + $lastgroupbox .= '"; + $lastgroupbox .= ""; if (!empty($conf->multicompany->enabled) && is_object($mc)) { $mc->getInfo($obj->entity); - $lastgroupbox .=''; + $lastgroupbox .= ''; } - $lastgroupbox .=''; - $lastgroupbox .=""; + $lastgroupbox .= ''; + $lastgroupbox .= ""; $i++; } $lastgroupbox .= "
    '.$langs->trans("LastGroupsCreated", ($num ? $num : $max)).''.$langs->trans("FullList").'
    '; - $lastgroupbox .=$grouptemp->getNomUrl(1); + $lastgroupbox .= '
    '; + $lastgroupbox .= $grouptemp->getNomUrl(1); if (!$obj->entity) { - $lastgroupbox .=img_picto($langs->trans("GlobalGroup"), 'redstar'); + $lastgroupbox .= img_picto($langs->trans("GlobalGroup"), 'redstar'); } - $lastgroupbox .="'; - $lastgroupbox .=$mc->label; - $lastgroupbox .=''; + $lastgroupbox .= $mc->label; + $lastgroupbox .= ''.dol_print_date($db->jdate($obj->datec), 'dayhour').'
    '.dol_print_date($db->jdate($obj->datec), 'dayhour').'
    "; diff --git a/htdocs/webservices/server_productorservice.php b/htdocs/webservices/server_productorservice.php index 35997d16d6e..25eeec6430f 100644 --- a/htdocs/webservices/server_productorservice.php +++ b/htdocs/webservices/server_productorservice.php @@ -527,7 +527,7 @@ function createProductOrService($authentication, $product) $newobject->label = empty($product['label']) ? '' : $product['label']; $newobject->description = empty($product['description']) ? '' : $product['description']; $newobject->note_public = empty($product['note_public']) ? '' : $product['note_public']; - $newobject->note_private = empty($product['note_private']) ? '' :$product['note_private']; + $newobject->note_private = empty($product['note_private']) ? '' : $product['note_private']; $newobject->status = empty($product['status_tosell']) ? 0 : $product['status_tosell']; $newobject->status_buy = empty($product['status_tobuy']) ? 0 : $product['status_tobuy']; $newobject->price = isset($product['price_net']) ? $product['price_net'] : 0; diff --git a/htdocs/workstation/class/workstationresource.class.php b/htdocs/workstation/class/workstationresource.class.php index 72fb91cfe85..0b670891583 100644 --- a/htdocs/workstation/class/workstationresource.class.php +++ b/htdocs/workstation/class/workstationresource.class.php @@ -38,8 +38,8 @@ class WorkstationResource extends CommonObject * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( - 'fk_workstation' => array ('type' => 'integer'), - 'fk_resource' => array ('type' => 'integer') + 'fk_workstation' => array('type' => 'integer'), + 'fk_resource' => array('type' => 'integer') ); /** diff --git a/htdocs/workstation/class/workstationusergroup.class.php b/htdocs/workstation/class/workstationusergroup.class.php index 86fdda7ce66..a40ea43143a 100644 --- a/htdocs/workstation/class/workstationusergroup.class.php +++ b/htdocs/workstation/class/workstationusergroup.class.php @@ -37,8 +37,8 @@ class WorkstationUserGroup extends CommonObject * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( - 'fk_workstation' => array ('type' => 'integer'), - 'fk_usergroup' => array ('type' => 'integer') + 'fk_workstation' => array('type' => 'integer'), + 'fk_usergroup' => array('type' => 'integer') ); /** diff --git a/htdocs/workstation/lib/workstation.lib.php b/htdocs/workstation/lib/workstation.lib.php index fc57575bcf9..92ea28d8bfb 100755 --- a/htdocs/workstation/lib/workstation.lib.php +++ b/htdocs/workstation/lib/workstation.lib.php @@ -34,7 +34,7 @@ function workstationAdminPrepareHead() $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT . "/admin/workstation.php"; + $head[$h][0] = DOL_URL_ROOT."/admin/workstation.php"; $head[$h][1] = $langs->trans("Settings"); $head[$h][2] = 'settings'; $h++; From 64ca5365e794c3b199fce080eeb41fa42f7287a3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 Oct 2021 22:07:36 +0200 Subject: [PATCH 1269/1460] Fix sql --- htdocs/hrm/class/skilldet.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/hrm/class/skilldet.class.php b/htdocs/hrm/class/skilldet.class.php index e3f2d011b85..1fb90b907db 100644 --- a/htdocs/hrm/class/skilldet.class.php +++ b/htdocs/hrm/class/skilldet.class.php @@ -377,13 +377,13 @@ class Skilldet extends CommonObject if ($key == 't.rowid') { $sqlwhere[] = $key.'='.$value; } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { - $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; + $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; } elseif (strpos($value, '%') === false) { - $sqlwhere[] = $key.' IN ('.$this->db->sanitize($this->db->escape($value)).')'; + $sqlwhere[] = $key." IN (".$this->db->sanitize($this->db->escape($value)).")"; } else { - $sqlwhere[] = $key.' LIKE \'%'.$this->db->escape($value).'%\''; + $sqlwhere[] = $key." LIKE '%".$this->db->escape($value)."%'"; } } } @@ -395,7 +395,7 @@ class Skilldet extends CommonObject $sql .= $this->db->order($sortfield, $sortorder); } if (!empty($limit)) { - $sql .= ' '.$this->db->plimit($limit, $offset); + $sql .= " ".$this->db->plimit($limit, $offset); } $resql = $this->db->query($sql); From 02b2ed3f05a4c05e2b122c7f4dce0e3d947d293f Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 25 Oct 2021 20:08:01 +0000 Subject: [PATCH 1270/1460] Fixing style errors. --- htdocs/adherents/class/adherent_type.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 6be452c86de..90b34e604be 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -250,12 +250,12 @@ class AdherentType extends CommonObject } /** - * Delete a language for this member type - * - * @param string $langtodelete Language code to delete - * @param User $user Object user making delete - * @return int <0 if KO, >0 if OK - */ + * Delete a language for this member type + * + * @param string $langtodelete Language code to delete + * @param User $user Object user making delete + * @return int <0 if KO, >0 if OK + */ public function delMultiLangs($langtodelete, $user) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."adherent_type_lang"; From cffee1df4bebe6f70e3f589a20588358c65cd65c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 Oct 2021 22:09:21 +0200 Subject: [PATCH 1271/1460] Fix phpcs --- htdocs/delivery/class/delivery.class.php | 190 +++++++++++------------ 1 file changed, 95 insertions(+), 95 deletions(-) diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php index 491830529a1..6bfe3a33dd7 100644 --- a/htdocs/delivery/class/delivery.class.php +++ b/htdocs/delivery/class/delivery.class.php @@ -396,125 +396,125 @@ class Delivery extends CommonObject if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->delivery->creer)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->delivery_advance->validate))) { - if (!empty($conf->global->DELIVERY_ADDON_NUMBER)) { - // Setting the command numbering module name - $modName = $conf->global->DELIVERY_ADDON_NUMBER; + if (!empty($conf->global->DELIVERY_ADDON_NUMBER)) { + // Setting the command numbering module name + $modName = $conf->global->DELIVERY_ADDON_NUMBER; - if (is_readable(DOL_DOCUMENT_ROOT.'/core/modules/delivery/'.$modName.'.php')) { - require_once DOL_DOCUMENT_ROOT.'/core/modules/delivery/'.$modName.'.php'; + if (is_readable(DOL_DOCUMENT_ROOT.'/core/modules/delivery/'.$modName.'.php')) { + require_once DOL_DOCUMENT_ROOT.'/core/modules/delivery/'.$modName.'.php'; - $now = dol_now(); + $now = dol_now(); - // Retrieving the new reference - $objMod = new $modName($this->db); - $soc = new Societe($this->db); - $soc->fetch($this->socid); + // Retrieving the new reference + $objMod = new $modName($this->db); + $soc = new Societe($this->db); + $soc->fetch($this->socid); - if (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) { // empty should not happened, but when it occurs, the test save life - $numref = $objMod->delivery_get_num($soc, $this); - } else { - $numref = $this->ref; + if (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) { // empty should not happened, but when it occurs, the test save life + $numref = $objMod->delivery_get_num($soc, $this); + } else { + $numref = $this->ref; + } + $this->newref = dol_sanitizeFileName($numref); + + // Test if is not already in valid status. If so, we stop to avoid decrementing the stock twice. + $sql = "SELECT ref"; + $sql .= " FROM ".MAIN_DB_PREFIX."delivery"; + $sql .= " WHERE ref = '".$this->db->escape($numref)."'"; + $sql .= " AND fk_statut <> 0"; + $sql .= " AND entity = ".((int) $conf->entity); + + $resql = $this->db->query($sql); + if ($resql) { + $num = $this->db->num_rows($resql); + if ($num > 0) { + return 0; } - $this->newref = dol_sanitizeFileName($numref); + } - // Test if is not already in valid status. If so, we stop to avoid decrementing the stock twice. - $sql = "SELECT ref"; - $sql .= " FROM ".MAIN_DB_PREFIX."delivery"; - $sql .= " WHERE ref = '".$this->db->escape($numref)."'"; - $sql .= " AND fk_statut <> 0"; - $sql .= " AND entity = ".((int) $conf->entity); + $sql = "UPDATE ".MAIN_DB_PREFIX."delivery SET"; + $sql .= " ref='".$this->db->escape($numref)."'"; + $sql .= ", fk_statut = 1"; + $sql .= ", date_valid = '".$this->db->idate($now)."'"; + $sql .= ", fk_user_valid = ".$user->id; + $sql .= " WHERE rowid = ".((int) $this->id); + $sql .= " AND fk_statut = 0"; - $resql = $this->db->query($sql); - if ($resql) { - $num = $this->db->num_rows($resql); - if ($num > 0) { - return 0; - } - } + $resql = $this->db->query($sql); + if (!$resql) { + dol_print_error($this->db); + $this->error = $this->db->lasterror(); + $error++; + } - $sql = "UPDATE ".MAIN_DB_PREFIX."delivery SET"; - $sql .= " ref='".$this->db->escape($numref)."'"; - $sql .= ", fk_statut = 1"; - $sql .= ", date_valid = '".$this->db->idate($now)."'"; - $sql .= ", fk_user_valid = ".$user->id; - $sql .= " WHERE rowid = ".((int) $this->id); - $sql .= " AND fk_statut = 0"; - - $resql = $this->db->query($sql); - if (!$resql) { - dol_print_error($this->db); - $this->error = $this->db->lasterror(); + if (!$error && !$notrigger) { + // Call trigger + $result = $this->call_trigger('DELIVERY_VALIDATE', $user); + if ($result < 0) { $error++; } + // End call triggers + } - if (!$error && !$notrigger) { - // Call trigger - $result = $this->call_trigger('DELIVERY_VALIDATE', $user); - if ($result < 0) { - $error++; + if (!$error) { + $this->oldref = $this->ref; + + // Rename directory if dir was a temporary ref + if (preg_match('/^[\(]?PROV/i', $this->ref)) { + // Now we rename also files into index + $sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filename = CONCAT('".$this->db->escape($this->newref)."', SUBSTR(filename, ".(strlen($this->ref) + 1).")), filepath = 'expedition/receipt/".$this->db->escape($this->newref)."'"; + $sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'expedition/receipt/".$this->db->escape($this->ref)."' and entity = ".((int) $conf->entity); + $resql = $this->db->query($sql); + if (!$resql) { + $error++; $this->error = $this->db->lasterror(); } - // End call triggers - } - if (!$error) { - $this->oldref = $this->ref; + // We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments + $oldref = dol_sanitizeFileName($this->ref); + $newref = dol_sanitizeFileName($numref); + $dirsource = $conf->expedition->dir_output.'/receipt/'.$oldref; + $dirdest = $conf->expedition->dir_output.'/receipt/'.$newref; + if (!$error && file_exists($dirsource)) { + dol_syslog(get_class($this)."::valid rename dir ".$dirsource." into ".$dirdest); - // Rename directory if dir was a temporary ref - if (preg_match('/^[\(]?PROV/i', $this->ref)) { - // Now we rename also files into index - $sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filename = CONCAT('".$this->db->escape($this->newref)."', SUBSTR(filename, ".(strlen($this->ref) + 1).")), filepath = 'expedition/receipt/".$this->db->escape($this->newref)."'"; - $sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'expedition/receipt/".$this->db->escape($this->ref)."' and entity = ".((int) $conf->entity); - $resql = $this->db->query($sql); - if (!$resql) { - $error++; $this->error = $this->db->lasterror(); - } - - // We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments - $oldref = dol_sanitizeFileName($this->ref); - $newref = dol_sanitizeFileName($numref); - $dirsource = $conf->expedition->dir_output.'/receipt/'.$oldref; - $dirdest = $conf->expedition->dir_output.'/receipt/'.$newref; - if (!$error && file_exists($dirsource)) { - dol_syslog(get_class($this)."::valid rename dir ".$dirsource." into ".$dirdest); - - if (@rename($dirsource, $dirdest)) { - dol_syslog("Rename ok"); - // Rename docs starting with $oldref with $newref - $listoffiles = dol_dir_list($conf->expedition->dir_output.'/receipt/'.$newref, 'files', 1, '^'.preg_quote($oldref, '/')); - foreach ($listoffiles as $fileentry) { - $dirsource = $fileentry['name']; - $dirdest = preg_replace('/^'.preg_quote($oldref, '/').'/', $newref, $dirsource); - $dirsource = $fileentry['path'].'/'.$dirsource; - $dirdest = $fileentry['path'].'/'.$dirdest; - @rename($dirsource, $dirdest); - } + if (@rename($dirsource, $dirdest)) { + dol_syslog("Rename ok"); + // Rename docs starting with $oldref with $newref + $listoffiles = dol_dir_list($conf->expedition->dir_output.'/receipt/'.$newref, 'files', 1, '^'.preg_quote($oldref, '/')); + foreach ($listoffiles as $fileentry) { + $dirsource = $fileentry['name']; + $dirdest = preg_replace('/^'.preg_quote($oldref, '/').'/', $newref, $dirsource); + $dirsource = $fileentry['path'].'/'.$dirsource; + $dirdest = $fileentry['path'].'/'.$dirdest; + @rename($dirsource, $dirdest); } } } - - // Set new ref and current status - if (!$error) { - $this->ref = $numref; - $this->statut = 1; - } - - dol_syslog(get_class($this)."::valid ok"); } + // Set new ref and current status if (!$error) { - $this->db->commit(); - return 1; - } else { - $this->db->rollback(); - return -1; + $this->ref = $numref; + $this->statut = 1; } + + dol_syslog(get_class($this)."::valid ok"); + } + + if (!$error) { + $this->db->commit(); + return 1; + } else { + $this->db->rollback(); + return -1; } } - } else { - $this->error = "Non autorise"; - dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); - return -1; } + } else { + $this->error = "Non autorise"; + dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); + return -1; + } } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps From 5db80efcece6177157e56b56af5b2786ca1827d7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 Oct 2021 22:39:19 +0200 Subject: [PATCH 1272/1460] css --- htdocs/product/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 8ec03d408f3..14d9b320e8e 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -793,7 +793,7 @@ if ($resql) { $categoriesProductArr = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', '', 64, 0, 1); $categoriesProductArr[-2] = '- '.$langs->trans('NotCategorized').' -'; $moreforfilter .= Form::multiselectarray('search_category_product_list', $categoriesProductArr, $searchCategoryProductList, 0, 0, 'minwidth300'); - $moreforfilter .= ' '.$langs->trans('UseOrOperatorForCategories').''; + $moreforfilter .= ' '; $moreforfilter .= '
    '; } From c376d4034614d25ac636893a07a4096c25ba80a3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Oct 2021 01:30:00 +0200 Subject: [PATCH 1273/1460] css --- htdocs/comm/action/peruser.php | 4 ++-- htdocs/theme/eldy/global.inc.php | 3 +++ htdocs/theme/md/style.css.php | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 0148170d316..060b4f8d7d1 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -802,7 +802,7 @@ $currentdaytoshow = $firstdaytoshow; echo '
    '; while ($currentdaytoshow < $lastdaytoshow) { - echo ''; + echo '
    '; echo ''; echo ''; print ''; // State From e9ba9fc10345e5979925bc50dfc8bb782bdb931c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Oct 2021 13:52:00 +0200 Subject: [PATCH 1277/1460] Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into develop Conflicts: htdocs/contact/list.php htdocs/core/modules/mailings/modules_mailings.php --- dev/dolibarr_changes.txt | 12 +++ htdocs/compta/facture/card.php | 10 +++ htdocs/compta/facture/contact.php | 10 +++ htdocs/compta/facture/document.php | 10 +++ htdocs/compta/facture/info.php | 10 +++ htdocs/compta/facture/note.php | 10 +++ htdocs/contact/card.php | 16 +++- htdocs/contact/list.php | 82 +++++++++++-------- .../modules/mailings/contacts1.modules.php | 36 ++++---- .../modules/mailings/modules_mailings.php | 2 +- htdocs/delivery/class/delivery.class.php | 10 +-- htdocs/langs/en_US/mails.lang | 1 + htdocs/product/card.php | 5 +- 13 files changed, 150 insertions(+), 64 deletions(-) diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt index cce6351950c..7ce22e790c3 100644 --- a/dev/dolibarr_changes.txt +++ b/dev/dolibarr_changes.txt @@ -168,6 +168,18 @@ In htdocs/includes/tecnickcom/tcpdf/tcpdf.php - protected $default_monospaced_font = 'courier'; + protected $default_monospaced_font = 'freemono'; +* In tecnickcom/tcpdf/include/tcpdf_static, in function intToRoman, right at the beginning + of the function, replace: + + $roman = ''; + +with: + + $roman = ''; + if ($number >= 4000) { + // do not represent numbers above 4000 in Roman numerals + return strval($number); + } diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 602757522b2..816c07ece42 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2846,6 +2846,16 @@ if (empty($reshook)) { * View */ +if (empty($object->id)) { + llxHeader(); + $head = facture_prepare_head($object); + $langs->load('errors'); + echo dol_get_fiche_head($head, 'compta', $langs->trans("InvoiceCustomer"), -1, 'bill'), + '
    ' . $langs->trans("ErrorRecordNotFound") . '
    '; + llxFooter(); + exit; +} + $form = new Form($db); $formother = new FormOther($db); $formfile = new FormFile($db); diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php index 4381557cd28..230999f18fe 100644 --- a/htdocs/compta/facture/contact.php +++ b/htdocs/compta/facture/contact.php @@ -100,6 +100,16 @@ if ($action == 'addcontact' && $user->rights->facture->creer) { * View */ +if (empty($object->id)) { + llxHeader(); + $head = facture_prepare_head($object); + $langs->load('errors'); + echo dol_get_fiche_head($head, 'contact', $langs->trans("InvoiceCustomer"), -1, 'bill'), + '
    ' . $langs->trans("ErrorRecordNotFound") . '
    '; + llxFooter(); + exit; +} + $title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('ContactsAddresses'); $helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; llxHeader('', $title, $helpurl); diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index c9b6f9a39a8..c194f5dc997 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -92,6 +92,16 @@ include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; * View */ +if (empty($object->id)) { + llxHeader(); + $head = facture_prepare_head($object); + $langs->load('errors'); + echo dol_get_fiche_head($head, 'documents', $langs->trans("InvoiceCustomer"), -1, 'bill'), + '
    ' . $langs->trans("ErrorRecordNotFound") . '
    '; + llxFooter(); + exit; +} + $title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Documents'); $help_url = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; diff --git a/htdocs/compta/facture/info.php b/htdocs/compta/facture/info.php index 69322187e59..c38e9722267 100644 --- a/htdocs/compta/facture/info.php +++ b/htdocs/compta/facture/info.php @@ -62,6 +62,16 @@ $result = restrictedArea($user, 'facture', $object->id, '', '', 'fk_soc', $field * View */ +if (empty($object->id)) { + llxHeader(); + $head = facture_prepare_head($object); + $langs->load('errors'); + echo dol_get_fiche_head($head, 'info', $langs->trans("InvoiceCustomer"), -1, 'bill'), + '
    ' . $langs->trans("ErrorRecordNotFound") . '
    '; + llxFooter(); + exit; +} + $form = new Form($db); $title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Info'); diff --git a/htdocs/compta/facture/note.php b/htdocs/compta/facture/note.php index 40bb97fa236..8355d81fe0b 100644 --- a/htdocs/compta/facture/note.php +++ b/htdocs/compta/facture/note.php @@ -77,6 +77,16 @@ if (empty($reshook)) { * View */ +if (empty($object->id)) { + llxHeader(); + $head = facture_prepare_head($object); + $langs->load('errors'); + echo dol_get_fiche_head($head, 'note', $langs->trans("InvoiceCustomer"), -1, 'bill'), + '
    ' . $langs->trans("ErrorRecordNotFound") . '
    '; + llxFooter(); + exit; +} + $title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Notes'); $helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; llxHeader('', $title, $helpurl); diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 9e9895444b8..62f2262e2d6 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -818,7 +818,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } print '
    '; print ''; - print ''; + print ''; print ''; } @@ -1095,8 +1097,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } print ''; print ''; + print ''; + print $form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOST("no_email", 'int') : $object->no_email), 1, false, $useempty); + print ''; print ''; } @@ -1323,7 +1327,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } - print ''; + print ''; } print ''; } -if (!empty($arrayfields['p.no_email']['checked'])) { +if (!empty($arrayfields['unsubscribed']['checked'])) { print ''; @@ -965,8 +977,8 @@ if (!empty($arrayfields['p.fax']['checked'])) { if (!empty($arrayfields['p.email']['checked'])) { print_liste_field_titre($arrayfields['p.email']['label'], $_SERVER["PHP_SELF"], "p.email", $begin, $param, '', $sortfield, $sortorder); } -if (!empty($arrayfields['p.no_email']['checked'])) { - print_liste_field_titre($arrayfields['p.no_email']['label'], $_SERVER["PHP_SELF"], "p.no_email", $begin, $param, '', $sortfield, $sortorder, 'center '); +if (!empty($arrayfields['unsubscribed']['checked'])) { + print_liste_field_titre($arrayfields['unsubscribed']['label'], $_SERVER["PHP_SELF"], "unsubscribed", $begin, $param, '', $sortfield, $sortorder, 'center '); } if (!empty($conf->socialnetworks->enabled)) { foreach ($socialnetworks as $key => $value) { @@ -1155,8 +1167,14 @@ while ($i < min($num, $limit)) { } } // No EMail - if (!empty($arrayfields['p.no_email']['checked'])) { - print ''; + if (!empty($arrayfields['unsubscribed']['checked'])) { + print ''; if (!$i) { $totalarray['nbfield']++; } diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php index 2d41dfd9725..ef43f05b86a 100644 --- a/htdocs/core/modules/mailings/contacts1.modules.php +++ b/htdocs/core/modules/mailings/contacts1.modules.php @@ -79,8 +79,8 @@ class mailing_contacts1 extends MailingTargets $statssql[0] .= " count(distinct(c.email)) as nb"; $statssql[0] .= " FROM ".MAIN_DB_PREFIX."socpeople as c"; $statssql[0] .= " WHERE c.entity IN (".getEntity('socpeople').")"; - $statssql[0] .= " AND c.email != ''"; // Note that null != '' is false - $statssql[0] .= " AND c.no_email = 0"; + $statssql[0] .= " AND c.email <> ''"; // Note that null != '' is false + $statssql[0] .= " AND (SELECT count(*) FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = c.email) = 0"; $statssql[0] .= " AND c.statut = 1"; return $statssql; @@ -103,8 +103,7 @@ class mailing_contacts1 extends MailingTargets $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as c"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = c.fk_soc"; $sql .= " WHERE c.entity IN (".getEntity('socpeople').")"; - $sql .= " AND c.email != ''"; // Note that null != '' is false - $sql .= " AND c.no_email = 0"; + $sql .= " AND c.email <> ''"; // Note that null != '' is false $sql .= " AND (SELECT count(*) FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = c.email) = 0"; // exclude unsubscribed users $sql .= " AND c.statut = 1"; @@ -132,10 +131,9 @@ class mailing_contacts1 extends MailingTargets $sql = "SELECT sp.poste, count(distinct(sp.email)) AS nb"; $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; $sql .= " WHERE sp.entity IN (".getEntity('socpeople').")"; - /*$sql.= " AND sp.email != ''"; // Note that null != '' is false - $sql.= " AND sp.no_email = 0"; - $sql.= " AND sp.statut = 1";*/ - $sql .= " AND (sp.poste IS NOT NULL AND sp.poste != '')"; + $sql .= " AND sp.email <> ''"; // Note that null != '' is false + $sql .= " AND sp.statut = 1"; + $sql .= " AND (sp.poste IS NOT NULL AND sp.poste <> '')"; $sql .= " GROUP BY sp.poste"; $sql .= " ORDER BY sp.poste"; $resql = $this->db->query($sql); @@ -169,10 +167,9 @@ class mailing_contacts1 extends MailingTargets $sql .= " ".MAIN_DB_PREFIX."socpeople as sp,"; $sql .= " ".MAIN_DB_PREFIX."categorie as c,"; $sql .= " ".MAIN_DB_PREFIX."categorie_contact as cs"; - $sql .= " WHERE sp.statut = 1"; // Note that null != '' is false - //$sql.= " AND sp.no_email = 0"; - //$sql.= " AND sp.email != ''"; - //$sql.= " AND sp.entity IN (".getEntity('socpeople').")"; + $sql .= " WHERE sp.entity IN (".getEntity('socpeople').")"; + $sql .= " AND sp.email <> ''"; // Note that null != '' is false + $sql .= " AND sp.statut = 1"; $sql .= " AND cs.fk_categorie = c.rowid"; $sql .= " AND cs.fk_socpeople = sp.rowid"; $sql .= " GROUP BY c.label"; @@ -244,10 +241,9 @@ class mailing_contacts1 extends MailingTargets $sql .= " ".MAIN_DB_PREFIX."socpeople as sp,"; $sql .= " ".MAIN_DB_PREFIX."categorie as c,"; $sql .= " ".MAIN_DB_PREFIX."categorie_societe as cs"; - $sql .= " WHERE sp.statut = 1"; // Note that null != '' is false - //$sql.= " AND sp.no_email = 0"; - //$sql.= " AND sp.email != ''"; - //$sql.= " AND sp.entity IN (".getEntity('socpeople').")"; + $sql .= " WHERE sp.entity IN (".getEntity('socpeople').")"; + $sql .= " AND sp.email <> ''"; // Note that null != '' is false + $sql .= " AND sp.statut = 1"; $sql .= " AND cs.fk_categorie = c.rowid"; $sql .= " AND cs.fk_soc = sp.fk_soc"; $sql .= " GROUP BY c.label"; @@ -282,10 +278,9 @@ class mailing_contacts1 extends MailingTargets $sql .= " ".MAIN_DB_PREFIX."socpeople as sp,"; $sql .= " ".MAIN_DB_PREFIX."categorie as c,"; $sql .= " ".MAIN_DB_PREFIX."categorie_fournisseur as cs"; - $sql .= " WHERE sp.statut = 1"; // Note that null != '' is false - //$sql.= " AND sp.no_email = 0"; - //$sql.= " AND sp.email != ''"; - //$sql.= " AND sp.entity IN (".getEntity('socpeople').")"; + $sql .= " WHERE sp.entity IN (".getEntity('socpeople').")"; + $sql .= " AND sp.email <> ''"; // Note that null != '' is false + $sql .= " AND sp.statut = 1"; $sql .= " AND cs.fk_categorie = c.rowid"; $sql .= " AND cs.fk_soc = sp.fk_soc"; $sql .= " GROUP BY c.label"; @@ -391,7 +386,6 @@ class mailing_contacts1 extends MailingTargets } $sql .= " WHERE sp.entity IN (".getEntity('socpeople').")"; $sql .= " AND sp.email <> ''"; - $sql .= " AND sp.no_email = 0"; $sql .= " AND (SELECT count(*) FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = sp.email) = 0"; // Exclude unsubscribed email adresses $sql .= " AND sp.statut = 1"; diff --git a/htdocs/core/modules/mailings/modules_mailings.php b/htdocs/core/modules/mailings/modules_mailings.php index afbf1e22481..9df8d44daf1 100644 --- a/htdocs/core/modules/mailings/modules_mailings.php +++ b/htdocs/core/modules/mailings/modules_mailings.php @@ -224,7 +224,7 @@ class MailingTargets // This can't be abstract as it is used for some method $sql = "UPDATE ".MAIN_DB_PREFIX."mailing_cibles"; $sql .= " SET statut=3"; - $sql .= " WHERE fk_mailing =" .((int) $mailing_id)." AND email IN (SELECT mu.email FROM ".MAIN_DB_PREFIX."mailing_unsubscribe AS mu WHERE mu.entity IN ('".getEntity('mailing')."'))"; + $sql .= " WHERE fk_mailing = ".((int) $mailing_id)." AND email IN (SELECT mu.email FROM ".MAIN_DB_PREFIX."mailing_unsubscribe AS mu WHERE mu.entity IN ('".getEntity('mailing')."'))"; dol_syslog(__METHOD__.":mailing update status to display emails that do not want to be contacted anymore", LOG_DEBUG); $result = $this->db->query($sql); diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php index 8937de62fdf..6bfe3a33dd7 100644 --- a/htdocs/delivery/class/delivery.class.php +++ b/htdocs/delivery/class/delivery.class.php @@ -395,7 +395,7 @@ class Delivery extends CommonObject $error = 0; if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->delivery->creer)) - || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->delivery_advance->validate))) { + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->delivery_advance->validate))) { if (!empty($conf->global->DELIVERY_ADDON_NUMBER)) { // Setting the command numbering module name $modName = $conf->global->DELIVERY_ADDON_NUMBER; @@ -610,7 +610,7 @@ class Delivery extends CommonObject { global $conf; - $num = count($this->lines); + $num = count($this->lines); $line = new DeliveryLine($this->db); $line->origin_id = $origin_id; @@ -736,8 +736,8 @@ class Delivery extends CommonObject //if ($option !== 'nolink') //{ - // Add param to save lastsearch_values or not - $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0); + // Add param to save lastsearch_values or not + $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0); if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) { $add_save_lastsearch_values = 1; } @@ -997,7 +997,7 @@ class Delivery extends CommonObject $array[$i]['label'] = $objSourceLine->label ? $objSourceLine->label : $objSourceLine->description; } - $i++; + $i++; } return $array; } else { diff --git a/htdocs/langs/en_US/mails.lang b/htdocs/langs/en_US/mails.lang index 033f86b63aa..22fe0696363 100644 --- a/htdocs/langs/en_US/mails.lang +++ b/htdocs/langs/en_US/mails.lang @@ -60,6 +60,7 @@ EMailTestSubstitutionReplacedByGenericValues=When using test mode, substitutions MailingAddFile=Attach this file NoAttachedFiles=No attached files BadEMail=Bad value for Email +EMailNotDefined=Email not defined ConfirmCloneEMailing=Are you sure you want to clone this emailing? CloneContent=Clone message CloneReceivers=Cloner recipients diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 919931d34ce..dd4fd64a28c 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1922,11 +1922,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; print ''; + // State if (empty($conf->global->PRODUCT_DISABLE_STATE)) { print ''; @@ -1937,7 +1938,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } print img_picto('', 'state', 'class="pictofixedwidth"'); - print $formcompany->select_state($object->state_id, $object->country_code); + print $formcompany->select_state(GETPOSTISSET('state_id') ? GETPOST('state_id', 'int') : $object->state_id, $object->country_code); print ''; print ''; } From 89ba133c61429071b2c64ab007f7d888fb659f92 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 26 Oct 2021 14:11:51 +0200 Subject: [PATCH 1278/1460] fix: categorie display if none --- htdocs/modulebuilder/template/admin/setup.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/modulebuilder/template/admin/setup.php b/htdocs/modulebuilder/template/admin/setup.php index 9007eab60cc..6cae58ecf2e 100644 --- a/htdocs/modulebuilder/template/admin/setup.php +++ b/htdocs/modulebuilder/template/admin/setup.php @@ -354,13 +354,14 @@ if ($action == 'edit') { $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[] = '
  • color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '
  • '; + } + print '
      ' . implode(' ', $toprint) . '
    '; } - $ways = $c->print_all_ways(' >> ', 'none', 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formated text - $toprint = array(); - foreach ($ways as $way) { - $toprint[] = '
  • color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '
  • '; - } - print '
      ' . implode(' ', $toprint) . '
    '; } elseif (preg_match('/thirdparty_type/', $val['type'])) { if ($conf->global->{$constname}==2) { print $langs->trans("Prospect"); From fcdfd370ba226500242cd38bcc374c2a8eb8e8ed Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Oct 2021 14:31:55 +0200 Subject: [PATCH 1279/1460] Fix css --- htdocs/imports/import.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 5139e12ab7a..12b0b50c5f4 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -706,12 +706,12 @@ if ($step == 3 && $datatoimport) { print $out; print ''; - print '
    '; // You can use div-table-responsive-no-min if you dont need reserved height for your table - print '
    '; @@ -829,7 +829,7 @@ while ($currentdaytoshow < $lastdaytoshow) { // Filter on days print img_picto('', 'clock', 'class="fawidth30 inline-block paddingleft"'); print ''.$langs->trans("DaysOfWeek").''; - print "\n".'
    '; + print "\n".'
    '; print ''; if (empty($conf->dol_use_jmobile)) { print ' - '; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index e02369fa22f..2fd4c7c966f 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -298,6 +298,9 @@ input.buttonpayment, button.buttonpayment, div.buttonpayment { cursor: pointer; max-width: 350px; } +input.short { + width: 40px; +} .nofocusvisible:focus-visible { outline: none; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 0a4eb3fc5d0..c7ad8870c2e 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -441,6 +441,9 @@ input, select { input.button.massactionconfirmed { margin: 4px; } +input.short { + width: 40px; +} textarea { border-radius: 0; From e5a8e41cd9af07300956707848c9d9a1411e687e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Oct 2021 02:00:11 +0200 Subject: [PATCH 1274/1460] Trans --- htdocs/langs/en_US/languages.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/languages.lang b/htdocs/langs/en_US/languages.lang index d486fef0f5c..91811ebf667 100644 --- a/htdocs/langs/en_US/languages.lang +++ b/htdocs/langs/en_US/languages.lang @@ -1,6 +1,7 @@ # Dolibarr language file - Source file is en_US - languages Language_am_ET=Ethiopian Language_ar_AR=Arabic +Language_ar_DZ=Arabic (Algeria) Language_ar_EG=Arabic (Egypt) Language_ar_MA=Arabic (Moroco) Language_ar_SA=Arabic From 0c915dc052c71577c8f221f55229e3b065145576 Mon Sep 17 00:00:00 2001 From: Quentin-Seekness <72733832+Quentin-Seekness@users.noreply.github.com> Date: Tue, 26 Oct 2021 09:54:08 +0200 Subject: [PATCH 1275/1460] FIX: Can't create new attendee Field date_subscription is mandatory when creating a new attendee. --- htdocs/public/eventorganization/attendee_new.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/public/eventorganization/attendee_new.php b/htdocs/public/eventorganization/attendee_new.php index ede24103bdb..b350ece39f4 100644 --- a/htdocs/public/eventorganization/attendee_new.php +++ b/htdocs/public/eventorganization/attendee_new.php @@ -268,6 +268,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen } else { // Need to create a confattendee $confattendee->date_creation = dol_now(); + $confattendee->date_subscription = dol_now(); $confattendee->email = $email; $confattendee->fk_project = $project->id; $confattendee->fk_actioncomm = $id; From e87e354bd53fdd5219c166cbdd8865646542d207 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Oct 2021 13:08:22 +0200 Subject: [PATCH 1276/1460] Fix: can't reset country of origin --- htdocs/product/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index c0154bf7788..ca5a8959946 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1624,7 +1624,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
    '.$langs->trans("CountryOrigin").''; print img_picto('', 'globe-americas', 'class="paddingrightonly"'); - print $form->select_country($object->country_id, 'country_id', '', 0, 'minwidth100 maxwidthonsmartphone'); + print $form->select_country(GETPOSTISSET('country_id') ? GETPOST('country_id', 'int') : $object->country_id, 'country_id', '', 0, 'minwidth100 maxwidthonsmartphone'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print '
    '.$form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOST("no_email", 'int') : $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS), 1, false, ($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2)).''; + print $form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOST("no_email", 'int') : $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS), 1, false, ($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2)); + print '
    '; $useempty = (isset($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS) && ($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2)); - print ''.$form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOST("no_email", 'int') : $object->no_email), 1, false, $useempty).'
    '.$langs->trans("No_Email").''.yn($object->no_email).'
    '.$langs->trans("No_Email").''; + if ($object->email) { + print yn($object->no_email); + } else { + print ''.$langs->trans("EMailNotDefined").''; + } + print '
    '.$langs->trans("ContactVisibility").''; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index e005d6cfb1e..82a2161f89f 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -204,6 +204,12 @@ if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) { $arrayfields['s.nom'] = array('label'=>"ThirdParty", 'position'=>25, 'checked'=>1); } +$arrayfields['unsubscribed'] = array( + 'label'=>'No_Email', + 'checked'=>0, + 'enabled'=>(!empty($conf->mailing->enabled)), + 'position'=>41); + if (!empty($conf->socialnetworks->enabled)) { foreach ($socialnetworks as $key => $value) { if ($value['active']) { @@ -355,7 +361,7 @@ if ($resql) { } $sql = "SELECT s.rowid as socid, s.nom as name,"; -$sql .= " p.rowid, p.lastname as lastname, p.statut, p.firstname, p.address, p.zip, p.town, p.poste, p.email, p.no_email,"; +$sql .= " p.rowid, p.lastname as lastname, p.statut, p.firstname, p.address, p.zip, p.town, p.poste, p.email,"; $sql .= " p.socialnetworks, p.photo,"; $sql .= " p.phone as phone_pro, p.phone_mobile, p.phone_perso, p.fax, p.fk_pays, p.priv, p.datec as date_creation, p.tms as date_update,"; $sql .= " st.libelle as stcomm, st.picto as stcomm_picto, p.fk_stcommcontact as stcomm_id, p.fk_prospectcontactlevel,"; @@ -366,6 +372,9 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) { $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : ''); } } +if (!empty($conf->mailing->enabled)) { + $sql .= ", (SELECT count(*) FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = p.email) as unsubscribed"; +} // Add fields from hooks $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook @@ -499,8 +508,11 @@ if (strlen($search_town)) { if (count($search_roles) > 0) { $sql .= " AND p.rowid IN (SELECT sc.fk_socpeople FROM ".MAIN_DB_PREFIX."societe_contacts as sc WHERE sc.fk_c_type_contact IN (".$db->sanitize(implode(',', $search_roles))."))"; } -if ($search_no_email != '' && $search_no_email >= 0) { - $sql .= " AND p.no_email = ".((int) $search_no_email); +if ($search_no_email != -1 && $search_no_email > 0) { + $sql .= " AND (SELECT count(*) FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = p.email) > 0"; +} +if ($search_no_email != -1 && $search_no_email == 0) { + $sql .= " AND (SELECT count(*) FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = p.email) = 0 AND p.email IS NOT NULL AND p.email <> ''"; } if ($search_status != '' && $search_status >= 0) { $sql .= " AND p.statut = ".((int) $search_status); @@ -568,75 +580,75 @@ llxHeader('', $title, $help_url); $param = ''; if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { - $param .= '&contextpage='.$contextpage; + $param .= '&contextpage='.urlencode($contextpage); } if ($limit > 0 && $limit != $conf->liste_limit) { - $param .= '&limit='.$limit; + $param .= '&limit='.((int) $limit); } -$param .= '&begin='.urlencode($begin).'&userid='.urlencode($userid).'&contactname='.urlencode($sall); -$param .= '&type='.urlencode($type).'&view='.urlencode($view); +$param .= '&begin='.urlencode($begin).'&userid='.urlencode($userid).'&contactname='.urlencode($sall); +$param .= '&type='.urlencode($type).'&view='.urlencode($view); if (!empty($search_categ) && $search_categ != '-1') { - $param .= '&search_categ='.urlencode($search_categ); + $param .= '&search_categ='.urlencode($search_categ); } if (!empty($search_categ_thirdparty) && $search_categ_thirdparty != '-1') { - $param .= '&search_categ_thirdparty='.urlencode($search_categ_thirdparty); + $param .= '&search_categ_thirdparty='.urlencode($search_categ_thirdparty); } if (!empty($search_categ_supplier) && $search_categ_supplier != '-1') { - $param .= '&search_categ_supplier='.urlencode($search_categ_supplier); + $param .= '&search_categ_supplier='.urlencode($search_categ_supplier); } if ($sall != '') { - $param .= '&sall='.urlencode($sall); + $param .= '&sall='.urlencode($sall); } if ($search_id > 0) { - $param .= "&search_id=".urlencode($search_id); + $param .= "&search_id=".urlencode($search_id); } if ($search_lastname != '') { - $param .= '&search_lastname='.urlencode($search_lastname); + $param .= '&search_lastname='.urlencode($search_lastname); } if ($search_firstname != '') { - $param .= '&search_firstname='.urlencode($search_firstname); + $param .= '&search_firstname='.urlencode($search_firstname); } if ($search_societe != '') { - $param .= '&search_societe='.urlencode($search_societe); + $param .= '&search_societe='.urlencode($search_societe); } if ($search_address != '') { - $param .= '&search_address='.urlencode($search_address); + $param .= '&search_address='.urlencode($search_address); } if ($search_zip != '') { - $param .= '&search_zip='.urlencode($search_zip); + $param .= '&search_zip='.urlencode($search_zip); } if ($search_town != '') { - $param .= '&search_town='.urlencode($search_town); + $param .= '&search_town='.urlencode($search_town); } if ($search_country != '') { $param .= "&search_country=".urlencode($search_country); } if ($search_poste != '') { - $param .= '&search_poste='.urlencode($search_poste); + $param .= '&search_poste='.urlencode($search_poste); } if ($search_phone_pro != '') { - $param .= '&search_phone_pro='.urlencode($search_phone_pro); + $param .= '&search_phone_pro='.urlencode($search_phone_pro); } if ($search_phone_perso != '') { - $param .= '&search_phone_perso='.urlencode($search_phone_perso); + $param .= '&search_phone_perso='.urlencode($search_phone_perso); } if ($search_phone_mobile != '') { - $param .= '&search_phone_mobile='.urlencode($search_phone_mobile); + $param .= '&search_phone_mobile='.urlencode($search_phone_mobile); } if ($search_fax != '') { - $param .= '&search_fax='.urlencode($search_fax); + $param .= '&search_fax='.urlencode($search_fax); } if ($search_email != '') { - $param .= '&search_email='.urlencode($search_email); + $param .= '&search_email='.urlencode($search_email); } if ($search_no_email != '') { - $param .= '&search_no_email='.urlencode($search_no_email); + $param .= '&search_no_email='.urlencode($search_no_email); } if ($search_status != '') { - $param .= '&search_status='.urlencode($search_status); + $param .= '&search_status='.urlencode($search_status); } if ($search_priv == '0' || $search_priv == '1') { - $param .= "&search_priv=".urlencode($search_priv); + $param .= "&search_priv=".urlencode($search_priv); } if ($search_stcomm != '') { $param .= '&search_stcomm='.urlencode($search_stcomm); @@ -843,7 +855,7 @@ if (!empty($arrayfields['p.email']['checked'])) { print ''; print ''; print $form->selectarray('search_no_email', array('-1'=>'', '0'=>$langs->trans('No'), '1'=>$langs->trans('Yes')), $search_no_email); print ''.yn($obj->no_email).''; + if (empty($obj->email)) { + //print ''.$langs->trans("NoEmail").''; + } else { + print yn(($obj->unsubscribed > 0) ? 1 : 0); + } + print '
    '.$langs->trans("CountryOrigin").''; print img_picto('', 'globe-americas', 'class="paddingrightonly"'); - print $form->select_country($object->country_id, 'country_id', '', 0, 'minwidth100 maxwidthonsmartphone'); + print $form->select_country(GETPOSTISSET('country_id') ? GETPOST('country_id', 'int') : $object->country_id, 'country_id', '', 0, 'minwidth100 maxwidthonsmartphone'); if ($user->admin) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } print '
    '; - // Search available imports $filearray = dol_dir_list($conf->import->dir_temp, 'files', 0, '', '', 'name', SORT_DESC); if (count($filearray) > 0) { + print '
    '; // You can use div-table-responsive-no-min if you dont need reserved height for your table + print '
    '; + $dir = $conf->import->dir_temp; // Search available files to import @@ -752,10 +752,10 @@ if ($step == 3 && $datatoimport) { print ''; print ''; } - } - print '
    '; - print '
    '; + print ''; + print '
    '; + } print ''; } From 2436f0967b9826aee392f8e4f20c204003616354 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Oct 2021 14:37:15 +0200 Subject: [PATCH 1280/1460] Fix translation of Nature of member in import. --- htdocs/core/modules/modAdherent.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modAdherent.class.php b/htdocs/core/modules/modAdherent.class.php index d620c6244b7..66cc9799a6b 100644 --- a/htdocs/core/modules/modAdherent.class.php +++ b/htdocs/core/modules/modAdherent.class.php @@ -286,7 +286,7 @@ class modAdherent extends DolibarrModules $this->export_label[$r] = 'MembersAndSubscriptions'; $this->export_permission[$r] = array(array("adherent", "export")); $this->export_fields_array[$r] = array( - 'a.rowid'=>'Id', 'a.civility'=>"UserTitle", 'a.lastname'=>"Lastname", 'a.firstname'=>"Firstname", 'a.login'=>"Login", 'a.gender'=>"Gender", 'a.morphy'=>'Nature', + 'a.rowid'=>'Id', 'a.civility'=>"UserTitle", 'a.lastname'=>"Lastname", 'a.firstname'=>"Firstname", 'a.login'=>"Login", 'a.gender'=>"Gender", 'a.morphy'=>'MemberNature', 'a.societe'=>'Company', 'a.address'=>"Address", 'a.zip'=>"Zip", 'a.town'=>"Town", 'd.nom'=>"State", 'co.code'=>"CountryCode", 'co.label'=>"Country", 'a.phone'=>"PhonePro", 'a.phone_perso'=>"PhonePerso", 'a.phone_mobile'=>"PhoneMobile", 'a.email'=>"Email", 'a.birth'=>"Birthday", 'a.statut'=>"Status", 'a.photo'=>"Photo", 'a.note_public'=>"NotePublic", 'a.note_private'=>"NotePrivate", 'a.datec'=>'DateCreation', 'a.datevalid'=>'DateValidation', @@ -339,7 +339,7 @@ class modAdherent extends DolibarrModules $this->import_tables_creator_array[$r] = array('a'=>'fk_user_author'); // Fields to store import user id $this->import_fields_array[$r] = array( 'a.civility'=>"UserTitle", 'a.lastname'=>"Lastname*", 'a.firstname'=>"Firstname", 'a.gender'=>"Gender", 'a.login'=>"Login*", "a.pass"=>"Password", - "a.fk_adherent_type"=>"MemberType*", 'a.morphy'=>'Nature*', 'a.societe'=>'Company', 'a.address'=>"Address", 'a.zip'=>"Zip", 'a.town'=>"Town", + "a.fk_adherent_type"=>"MemberType*", 'a.morphy'=>'MemberNature*', 'a.societe'=>'Company', 'a.address'=>"Address", 'a.zip'=>"Zip", 'a.town'=>"Town", 'a.state_id'=>'StateId', 'a.country'=>"CountryId", 'a.phone'=>"PhonePro", 'a.phone_perso'=>"PhonePerso", 'a.phone_mobile'=>"PhoneMobile", 'a.email'=>"Email", 'a.birth'=>"Birthday", 'a.statut'=>"Status*", 'a.photo'=>"Photo", 'a.note_public'=>"NotePublic", 'a.note_private'=>"NotePrivate", 'a.datec'=>'DateCreation', 'a.datefin'=>'DateEndSubscription' From 7393abea8f816643a56b98af31c792831cf50e76 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Oct 2021 14:42:26 +0200 Subject: [PATCH 1281/1460] Fix phpcs --- htdocs/contact/list.php | 2 +- htdocs/core/modules/mailings/modules_mailings.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 48cc6fafa61..7397cf8b61f 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -345,7 +345,7 @@ $sql .= " co.label as country, co.code as country_code"; if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : ''); } -if(!empty($conf->mailing->enabled)) { +if (!empty($conf->mailing->enabled)) { $sql .= ", (SELECT count(*) FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = p.email) as unsubscribed"; } // Add fields from hooks diff --git a/htdocs/core/modules/mailings/modules_mailings.php b/htdocs/core/modules/mailings/modules_mailings.php index 1a533591b18..1250c7a9550 100644 --- a/htdocs/core/modules/mailings/modules_mailings.php +++ b/htdocs/core/modules/mailings/modules_mailings.php @@ -213,7 +213,7 @@ class MailingTargets // This can't be abstract as it is used for some method $sql .= " AND source_type='thirdparty'"; dol_syslog(__METHOD__.": mailing update status to display thirdparty mail that do not want to be contacted"); $result=$this->db->query($sql); - + //Update the status to show contact mail that don't want to be contacted anymore' $sql = "UPDATE ".MAIN_DB_PREFIX."mailing_cibles"; $sql .= " SET statut=3"; @@ -222,7 +222,7 @@ class MailingTargets // This can't be abstract as it is used for some method dol_syslog(__METHOD__.": mailing update status to display contact mail that do not want to be contacted",LOG_DEBUG); $result=$this->db->query($sql); */ - + $sql = "UPDATE ".MAIN_DB_PREFIX."mailing_cibles"; $sql .= " SET statut=3"; $sql .= " WHERE fk_mailing=".((int) $mailing_id)." AND email IN (SELECT mu.email FROM ".MAIN_DB_PREFIX."mailing_unsubscribe AS mu WHERE mu.entity IN ('".getEntity('mailing')."'))"; From e4b3dda7f0e9cae4e1e0326368ccfc89b4cf68e3 Mon Sep 17 00:00:00 2001 From: fr69400 <82267780+fr69400@users.noreply.github.com> Date: Tue, 26 Oct 2021 15:27:12 +0200 Subject: [PATCH 1282/1460] Update functions.lib.php FIX : Duplicate entry in array FIX : Unasigned variable FIX : Type mismatch FIX : Wrong variable --- htdocs/core/lib/functions.lib.php | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 897b248824f..d6d8bc8600f 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2390,7 +2390,7 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs = // Analyze date $reg = array(); if (preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])$/i', $time, $reg)) { // Deprecated. Ex: 1970-01-01, 1970-01-01 01:00:00, 19700101010000 - dol_print_error("Functions.lib::dol_print_date function called with a bad value from page ".$_SERVER["PHP_SELF"]); + dol_print_error('',"Functions.lib::dol_print_date function called with a bad value from page ".$_SERVER["PHP_SELF"]); return ''; } elseif (preg_match('/^([0-9]+)\-([0-9]+)\-([0-9]+) ?([0-9]+)?:?([0-9]+)?:?([0-9]+)?/i', $time, $reg)) { // Still available to solve problems in extrafields of type date // This part of code should not be used anymore. @@ -3659,9 +3659,9 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'member'=>'user-alt', 'meeting'=>'chalkboard-teacher', 'mrp'=>'cubes', 'next'=>'arrow-alt-circle-right', 'trip'=>'wallet', 'expensereport'=>'wallet', 'group'=>'users', 'movement'=>'people-carry', 'sign-out'=>'sign-out-alt', - 'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'switch_on_red'=>'toggle-on', 'check'=>'check', 'bookmark'=>'star', 'bookmark'=>'star', - 'bank'=>'university', 'close_title'=>'times', 'delete'=>'trash', 'edit'=>'pencil-alt', 'filter'=>'filter', - 'list-alt'=>'list-alt', 'calendar'=>'calendar-alt', 'calendarmonth'=>'calendar-alt', 'calendarweek'=>'calendar-week', 'calendarmonth'=>'calendar-alt', 'calendarday'=>'calendar-day', 'calendarperuser'=>'table', + 'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'switch_on_red'=>'toggle-on', 'check'=>'check', 'bookmark'=>'star', + 'bank'=>'university', 'close_title'=>'times', 'delete'=>'trash', 'filter'=>'filter', + 'list-alt'=>'list-alt', 'calendar'=>'calendar-alt', 'calendarmonth'=>'calendar-alt', 'calendarweek'=>'calendar-week', 'calendarday'=>'calendar-day', 'calendarperuser'=>'table', 'intervention'=>'ambulance', 'invoice'=>'file-invoice-dollar', 'multicurrency'=>'dollar-sign', 'order'=>'file-invoice', 'error'=>'exclamation-triangle', 'warning'=>'exclamation-triangle', 'other'=>'square', @@ -3671,7 +3671,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'resize'=>'crop', 'supplier_order'=>'dol-order_supplier', 'supplier_proposal'=>'file-signature', 'refresh'=>'redo', 'region'=>'map-marked', 'resource'=>'laptop-house', 'state'=>'map-marked-alt', 'security'=>'key', 'salary'=>'wallet', 'shipment'=>'dolly', 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'stripe'=>'stripe-s', - 'supplier'=>'building', 'supplier_invoice'=>'file-invoice-dollar', 'technic'=>'cogs', 'ticket'=>'ticket-alt', + 'supplier'=>'building', 'technic'=>'cogs', 'timespent'=>'clock', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach', 'title_agenda'=>'calendar-alt', 'uncheck'=>'times', 'uparrow'=>'share', 'vcard'=>'address-card', @@ -4462,7 +4462,7 @@ function info_admin($text, $infoonimgalt = 0, $nodiv = 0, $admin = '1', $morecss $result = ($nodiv ? '' : '
    ').' '.$text.($nodiv ? '' : '
    '); if ($textfordropdown) { - $tmpresult .= ''.$langs->trans($textfordropdown).' '.img_picto($langs->trans($textfordropdown), '1downarrow').''; + $tmpresult = ''.$langs->trans($textfordropdown).' '.img_picto($langs->trans($textfordropdown), '1downarrow').''; $tmpresult .= ' - '; print "\n"; @@ -612,9 +581,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea '; } } - print ' '.$alreadyconsumed; + print ' '.price2num($alreadyconsumed, 'MS'); print ''; // Warehouse print ''; print ''; + // Stock if ($conf->stock->enabled) { print ''; if ($tmpproduct->stock_reel < ($line->qty - $alreadyconsumed)) { print img_warning($langs->trans('StockTooLow')).' '; } - print $tmpproduct->stock_reel; // Available + print price2num($tmpproduct->stock_reel, 'MS'); // Available print ''; } + // Lot if ($conf->productbatch->enabled) { - print ''; // Lot + print ''; } + // Action delete line if ($permissiontodelete) { - $href = $_SERVER["PHP_SELF"]; - $href .= '?id='.$object->id; - $href .= '&action=deleteline'; - $href .= '&lineid='.$line->id; + $href = $_SERVER["PHP_SELF"].'?id='.((int) $object->id).'&action=deleteline&token='.newToken().'&lineid='.((int) $line->id); print ''; - print '
    '; - print img_picto('', "delete"); + print ''; + print img_picto('', 'delete'); print ''; print ''; } @@ -911,16 +919,26 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Show detailed of already consumed with js code to collapse foreach ($arrayoflines as $line2) { print ''; + + // Date print ''; $tmpstockmovement->id = $line2['fk_stock_movement']; print ''.img_picto($langs->trans("StockMovement"), 'movement', 'class="paddingright"').''; print dol_print_date($line2['date'], 'dayhour', 'tzuserrel'); print ''; + + // Already consumed print ''; + + // Qty print ''.$line2['qty'].''; + + // Cost price if ($permissiontoupdatecost && !empty($conf->global->MRP_SHOW_COST_FOR_CONSUMPTION)) { print ''; } + + // Warehouse print ''; if ($line2['fk_warehouse'] > 0) { $result = $tmpwarehouse->fetch($line2['fk_warehouse']); @@ -929,6 +947,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } } print ''; + + // Stock + if ($conf->stock->enabled) { + print ''; + } + // Lot Batch print ''; if ($line2['batch'] != '') { @@ -936,6 +960,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print $tmpbatch->getNomUrl(1); } print ''; + + // Action delete line + if ($permissiontodelete) { + print ''; + } + print ''; } @@ -954,11 +984,18 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $disable = 'disabled'; } + // Qty print ''; + + // Cost if ($permissiontoupdatecost && !empty($conf->global->MRP_SHOW_COST_FOR_CONSUMPTION)) { print ''; } + + // Already consumed print ''; + + // Warehouse print ''; if ($tmpproduct->type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { if (empty($line->disable_stock_change)) { @@ -970,10 +1007,16 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } else { print ''.$langs->trans("NoStockChangeOnServices").''; } - // Lot / Batch print ''; + + // Stock + if ($conf->stock->enabled) { + print ''; + } + + // Lot / Batch if ($conf->productbatch->enabled) { - print ''; + print 'aaa'; if ($tmpproduct->status_batch) { $preselected = (GETPOSTISSET('batch-'.$line->id.'-'.$i) ? GETPOST('batch-'.$line->id.'-'.$i) : ''); print ''; @@ -981,6 +1024,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } print ''; } + + // Action delete line + if ($permissiontodelete) { + print ''; + } + print ''; } } @@ -1003,13 +1052,16 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $nblinetoproduce++; } } - $newlinetext = ''; - if ($object->status != $object::STATUS_PRODUCED && $object->status != $object::STATUS_CANCELED && $action != 'consumeorproduce' && $action != 'consumeandproduceall') { - if ($nblinetoproduce == 0 || $object->mrptype == 1) { - $newlinetext = ''.$langs->trans("AddNewProduceLines").''; - } + + $newcardbutton = ''; + $url = $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=addproduceline&token='.newToken(); + $permissiontoaddaproductline = $object->status != $object::STATUS_PRODUCED && $object->status != $object::STATUS_CANCELED && $action != 'consumeorproduce' && $action != 'consumeandproduceall'; + $parameters = array('morecss'=>'reposition'); + if ($nblinetoproduce == 0 || $object->mrptype == 1) { + $newcardbutton = dolGetButtonTitle($langs->trans('AddNewProduceLines'), '', 'fa fa-plus-circle size15x', $url, '', $permissiontoaddaproductline, $parameters); } - print load_fiche_titre($langs->trans('Production'), '', '', 0, '', '', $newlinetext); + + print load_fiche_titre($langs->trans('Production'), $newcardbutton, '', 0, '', ''); print '
    '; print ''; @@ -1044,7 +1096,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''."\n"; print ''; print ''; // Qty print ''; @@ -1052,10 +1104,10 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; // Qty already produced - print ''; + print ''; // Lot - serial if ($conf->productbatch->enabled) { @@ -1155,7 +1207,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $href .= '&action=deleteline'; $href .= '&lineid='.$line->id; print ''; diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index e485ea3d543..ce9c26c5480 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -451,9 +451,10 @@ if ($action == 'create') { if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); - $morehtmlref .= ''; - $morehtmlref .= $proj->ref; - $morehtmlref .= ''; + $morehtmlref .= ' : '.$proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.$proj->title; + } } else { $morehtmlref .= ''; } diff --git a/htdocs/product/stock/info.php b/htdocs/product/stock/info.php index 36897c7aef0..db6560a9970 100644 --- a/htdocs/product/stock/info.php +++ b/htdocs/product/stock/info.php @@ -81,9 +81,10 @@ if (!empty($conf->projet->enabled)) { if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); - $morehtmlref .= ''; - $morehtmlref .= $proj->ref; - $morehtmlref .= ''; + $morehtmlref .= ' : '.$proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.$proj->title; + } } else { $morehtmlref .= ''; } diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index e028c49396b..7d261a73f7a 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -671,9 +671,10 @@ if ($object->id > 0) { if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); - $morehtmlref .= ''; - $morehtmlref .= $proj->ref; - $morehtmlref .= ''; + $morehtmlref .= ' : '.$proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.$proj->title; + } } else { $morehtmlref .= ''; } diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 96953d93824..de6ccc2c7e7 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -1351,9 +1351,10 @@ if ($action == 'create') { if (!empty($objectsrc->fk_project)) { $proj = new Project($db); $proj->fetch($objectsrc->fk_project); - $morehtmlref .= ''; - $morehtmlref .= $proj->ref; - $morehtmlref .= ''; + $morehtmlref .= ' : '.$proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.$proj->title; + } } else { $morehtmlref .= ''; } diff --git a/htdocs/reception/contact.php b/htdocs/reception/contact.php index 1c368dc9caa..a7cec515e29 100644 --- a/htdocs/reception/contact.php +++ b/htdocs/reception/contact.php @@ -172,9 +172,10 @@ if ($id > 0 || !empty($ref)) { if (!empty($objectsrc->fk_project)) { $proj = new Project($db); $proj->fetch($objectsrc->fk_project); - $morehtmlref .= ''; - $morehtmlref .= $proj->ref; - $morehtmlref .= ''; + $morehtmlref .= ' : '.$proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.$proj->title; + } } else { $morehtmlref .= ''; } diff --git a/htdocs/reception/note.php b/htdocs/reception/note.php index a75dd432082..725c23ae738 100644 --- a/htdocs/reception/note.php +++ b/htdocs/reception/note.php @@ -149,9 +149,10 @@ if ($id > 0 || !empty($ref)) { if (!empty($objectsrc->fk_project)) { $proj = new Project($db); $proj->fetch($objectsrc->fk_project); - $morehtmlref .= ''; - $morehtmlref .= $proj->ref; - $morehtmlref .= ''; + $morehtmlref .= ' : '.$proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.$proj->title; + } } else { $morehtmlref .= ''; } diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index e6a8a02d59a..7b74283d90a 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -349,9 +349,7 @@ if (!$ret) { if (!empty($act->fk_project)) { $proj = new Project($db); $proj->fetch($act->fk_project); - $morehtmlref .= ''; - $morehtmlref .= $proj->ref; - $morehtmlref .= ''; + $morehtmlref .= ' : '.$proj->getNomUrl(1); if ($proj->title) { $morehtmlref .= ' - '.$proj->title; } @@ -533,9 +531,10 @@ if (!$ret) { if (!empty($fichinter->fk_project)) { $proj = new Project($db); $proj->fetch($fichinter->fk_project); - $morehtmlref .= ''; - $morehtmlref .= $proj->ref; - $morehtmlref .= ''; + $morehtmlref .= ' : '.$proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.$proj->title; + } } else { $morehtmlref .= ''; } diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index 0d47a90796f..931605dace0 100755 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -750,9 +750,10 @@ if ($id) { if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); - $morehtmlref .= ''; - $morehtmlref .= $proj->ref; - $morehtmlref .= ''; + $morehtmlref .= ' : '.$proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.$proj->title; + } } else { $morehtmlref .= ''; } diff --git a/htdocs/salaries/document.php b/htdocs/salaries/document.php index 47d03e62380..3181770cfcc 100644 --- a/htdocs/salaries/document.php +++ b/htdocs/salaries/document.php @@ -197,9 +197,10 @@ if ($object->id) { if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); - $morehtmlref .= ''; - $morehtmlref .= $proj->ref; - $morehtmlref .= ''; + $morehtmlref .= ' : '.$proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.$proj->title; + } } else { $morehtmlref .= ''; } diff --git a/htdocs/salaries/info.php b/htdocs/salaries/info.php index 173e03c2c7d..b6a818e6f54 100644 --- a/htdocs/salaries/info.php +++ b/htdocs/salaries/info.php @@ -160,9 +160,10 @@ if (!empty($conf->projet->enabled)) { if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); - $morehtmlref .= ''; - $morehtmlref .= $proj->ref; - $morehtmlref .= ''; + $morehtmlref .= ' : '.$proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.$proj->title; + } } else { $morehtmlref .= ''; } diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 6fc7f4df73a..a5837c2557f 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1492,9 +1492,10 @@ if ($action == 'create') { if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); - $morehtmlref .= ''; - $morehtmlref .= $proj->ref; - $morehtmlref .= ''; + $morehtmlref .= ' : '.$proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.$proj->title; + } } else { $morehtmlref .= ''; } diff --git a/htdocs/supplier_proposal/contact.php b/htdocs/supplier_proposal/contact.php index faa9127779c..f1756f17814 100644 --- a/htdocs/supplier_proposal/contact.php +++ b/htdocs/supplier_proposal/contact.php @@ -157,9 +157,10 @@ if ($id > 0 || !empty($ref)) { if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); - $morehtmlref .= ''; - $morehtmlref .= $proj->ref; - $morehtmlref .= ''; + $morehtmlref .= ' : '.$proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.$proj->title; + } } else { $morehtmlref .= ''; } diff --git a/htdocs/supplier_proposal/document.php b/htdocs/supplier_proposal/document.php index 3d5ce3fbb47..a8b85fc25b5 100644 --- a/htdocs/supplier_proposal/document.php +++ b/htdocs/supplier_proposal/document.php @@ -144,9 +144,10 @@ if ($object->id > 0) { if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); - $morehtmlref .= ''; - $morehtmlref .= $proj->ref; - $morehtmlref .= ''; + $morehtmlref .= ' : '.$proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.$proj->title; + } } else { $morehtmlref .= ''; } diff --git a/htdocs/supplier_proposal/info.php b/htdocs/supplier_proposal/info.php index 7d6d72276d8..0b796937d2e 100644 --- a/htdocs/supplier_proposal/info.php +++ b/htdocs/supplier_proposal/info.php @@ -99,9 +99,10 @@ if (!empty($conf->projet->enabled)) { if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); - $morehtmlref .= ''; - $morehtmlref .= $proj->ref; - $morehtmlref .= ''; + $morehtmlref .= ' : '.$proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.$proj->title; + } } else { $morehtmlref .= ''; } diff --git a/htdocs/supplier_proposal/note.php b/htdocs/supplier_proposal/note.php index 6466c6f42cb..5a19a94b402 100644 --- a/htdocs/supplier_proposal/note.php +++ b/htdocs/supplier_proposal/note.php @@ -128,9 +128,10 @@ if ($id > 0 || !empty($ref)) { if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); - $morehtmlref .= ''; - $morehtmlref .= $proj->ref; - $morehtmlref .= ''; + $morehtmlref .= ' : '.$proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.$proj->title; + } } else { $morehtmlref .= ''; } diff --git a/htdocs/workstation/class/workstation.class.php b/htdocs/workstation/class/workstation.class.php index ab23a55e525..f66f2c51f49 100755 --- a/htdocs/workstation/class/workstation.class.php +++ b/htdocs/workstation/class/workstation.class.php @@ -111,8 +111,8 @@ class Workstation extends CommonObject 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>'1', 'position'=>511, 'notnull'=>-1, 'visible'=>-2,), 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>512, 'notnull'=>-1, 'visible'=>-2,), 'nb_operators_required' => array('type'=>'integer', 'label'=>'NbOperatorsRequired', 'enabled'=>'1', 'position'=>50, 'notnull'=>0, 'visible'=>1,), - 'thm_operator_estimated' => array('type'=>'double', 'help'=>'THMEstimatedHelp','label'=>'THMOperatorEstimated', 'enabled'=>'1', 'position'=>50, 'notnull'=>0, 'visible'=>1,), - 'thm_machine_estimated' => array('type'=>'double', 'help'=>'THMEstimatedHelp', 'label'=>'THMMachineEstimated', 'enabled'=>'1', 'position'=>50, 'notnull'=>0, 'visible'=>1,), + 'thm_operator_estimated' => array('type'=>'double', 'help'=>'THMOperatorEstimatedHelp','label'=>'THMOperatorEstimated', 'enabled'=>'1', 'position'=>50, 'notnull'=>0, 'visible'=>1,), + 'thm_machine_estimated' => array('type'=>'double', 'help'=>'THMMachineEstimatedHelp', 'label'=>'THMMachineEstimated', 'enabled'=>'1', 'position'=>50, 'notnull'=>0, 'visible'=>1,), 'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'default'=>1, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Disabled', '1'=>'Enabled'),), ); public $rowid; From 0cb6c7296ada2733a23c7969d9ba120a0202f315 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 29 Oct 2021 11:19:38 +0200 Subject: [PATCH 1326/1460] FIX look and feel --- htdocs/societe/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 195b2957e76..5fdf4a4ef37 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2718,7 +2718,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
    '; print '
    '; - print '
    '; - print $form->select_produits('', 'productidtoadd', '', 0, 0, -1, 2, '', 0, array(), 0, '1', 0, 'maxwidth300'); + print $form->select_produits('', 'productidtoadd', '', 0, 0, -1, 2, '', 1, array(), 0, '1', 0, 'maxwidth300'); print ''; // Warehouse - print ''; print ''; + print ''; print ''; - print ''; + print ''; print img_picto('', "delete"); print ''; print '
    '; + print '
    '; // Tags / categories if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { From 72069dc2086d6c74e00d3df1423b00ed963e8cb2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 29 Oct 2021 11:35:09 +0200 Subject: [PATCH 1327/1460] Fix css --- htdocs/societe/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 195b2957e76..7c820f92e8e 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2489,7 +2489,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
    '; print '
    '; - print '
    '; + print '
    '; // Type Prospect/Customer/Supplier print '
    '.$langs->trans('NatureOfThirdParty').''; @@ -2718,7 +2718,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
    '; print '
    '; - print ''; + print '
    '; // Tags / categories if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { From 1336d3e7910904a79d910671d3420c973d453266 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Fri, 29 Oct 2021 12:25:50 +0200 Subject: [PATCH 1328/1460] Fix: Import don't work if extrafield is separator --- htdocs/core/modules/modAdherent.class.php | 2 +- htdocs/core/modules/modProduct.class.php | 2 +- htdocs/core/modules/modProjet.class.php | 2 +- htdocs/core/modules/modResource.class.php | 2 +- htdocs/core/modules/modService.class.php | 2 +- htdocs/core/modules/modSociete.class.php | 4 ++-- htdocs/core/modules/modUser.class.php | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/modules/modAdherent.class.php b/htdocs/core/modules/modAdherent.class.php index 911a4bbd5b9..deaa1bd70b7 100644 --- a/htdocs/core/modules/modAdherent.class.php +++ b/htdocs/core/modules/modAdherent.class.php @@ -329,7 +329,7 @@ class modAdherent extends DolibarrModules 'a.datec'=>'DateCreation', 'a.datefin'=>'DateEndSubscription' ); // Add extra fields - $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'adherent' AND entity IN (0,".$conf->entity.")"; + $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'adherent' AND entity IN (0,".$conf->entity.")"; $resql = $this->db->query($sql); if ($resql) // This can fail when class is used on old database (during migration for example) { diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index b029448cd58..a560bb3ee46 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -491,7 +491,7 @@ class modProduct extends DolibarrModules if (!empty($conf->global->PRODUCT_USE_UNITS)) $this->import_fields_array[$r]['p.fk_unit'] = 'Unit'; // Add extra fields $import_extrafield_sample = array(); - $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'product' AND entity IN (0, ".$conf->entity.")"; + $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'product' AND entity IN (0, ".$conf->entity.")"; $resql = $this->db->query($sql); if ($resql) // This can fail when class is used on old database (during migration for example) { diff --git a/htdocs/core/modules/modProjet.class.php b/htdocs/core/modules/modProjet.class.php index 77d339da035..7f71c30a6ac 100644 --- a/htdocs/core/modules/modProjet.class.php +++ b/htdocs/core/modules/modProjet.class.php @@ -293,7 +293,7 @@ class modProjet extends DolibarrModules $this->import_tables_array[$r] = array('t'=>MAIN_DB_PREFIX.'projet_task', 'extra'=>MAIN_DB_PREFIX.'projet_task_extrafields'); // List of tables to insert into (insert done in same order) $this->import_fields_array[$r] = array('t.fk_projet'=>'ProjectRef*', 't.ref'=>'RefTask*', 't.label'=>'LabelTask*', 't.dateo'=>"DateStart", 't.datee'=>"DateEnd", 't.planned_workload'=>"PlannedWorkload", 't.progress'=>"Progress", 't.note_private'=>"NotePrivate", 't.note_public'=>"NotePublic", 't.datec'=>"DateCreation"); // Add extra fields - $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'projet_task' AND entity IN (0,".$conf->entity.")"; + $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'projet_task' AND entity IN (0,".$conf->entity.")"; $resql = $this->db->query($sql); if ($resql) // This can fail when class is used on old database (during migration for example) { diff --git a/htdocs/core/modules/modResource.class.php b/htdocs/core/modules/modResource.class.php index 0d1353076ec..62c86e2e2a8 100644 --- a/htdocs/core/modules/modResource.class.php +++ b/htdocs/core/modules/modResource.class.php @@ -265,7 +265,7 @@ class modResource extends DolibarrModules $this->import_tables_array[$r] = array('r'=>MAIN_DB_PREFIX.'resource', 'extra'=>MAIN_DB_PREFIX.'resource_extrafields'); // List of tables to insert into (insert done in same order) $this->import_fields_array[$r] = array('r.ref'=>"ResourceFormLabel_ref*", 'r.fk_code_type_resource'=>'ResourceTypeCode', 'r.description'=>'ResourceFormLabel_description', 'r.note_private'=>"NotePrivate", 'r.note_public'=>"NotePublic", 'r.asset_number'=>'AssetNumber', 'r.datec'=>'DateCreation'); // Add extra fields - $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'resource' AND entity IN (0,".$conf->entity.")"; + $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'resource' AND entity IN (0,".$conf->entity.")"; $resql = $this->db->query($sql); if ($resql) // This can fail when class is used on old database (during migration for example) { diff --git a/htdocs/core/modules/modService.class.php b/htdocs/core/modules/modService.class.php index b7933bcf3f4..dd8e211ce13 100644 --- a/htdocs/core/modules/modService.class.php +++ b/htdocs/core/modules/modService.class.php @@ -459,7 +459,7 @@ class modService extends DolibarrModules if (!empty($conf->global->PRODUCT_USE_UNITS)) $this->import_fields_array[$r]['p.fk_unit'] = 'Unit'; // Add extra fields $import_extrafield_sample = array(); - $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'product' AND entity IN (0,".$conf->entity.")"; + $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'product' AND entity IN (0,".$conf->entity.")"; $resql = $this->db->query($sql); if ($resql) // This can fail when class is used on old database (during migration for example) { diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index b0346054323..bd947b59fd7 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -453,7 +453,7 @@ class modSociete extends DolibarrModules ); if (!empty($conf->global->PRODUIT_MULTIPRICES)) $this->import_fields_array[$r]['s.price_level'] = 'PriceLevel'; // Add extra fields - $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'societe' AND entity IN (0, ".$conf->entity.")"; + $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'societe' AND entity IN (0, ".$conf->entity.")"; $resql = $this->db->query($sql); if ($resql) // This can fail when class is used on old database (during migration for example) { @@ -602,7 +602,7 @@ class modSociete extends DolibarrModules 's.note_public' => "NotePublic" ); // Add extra fields - $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'socpeople' AND entity IN (0, ".$conf->entity.")"; + $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'socpeople' AND entity IN (0, ".$conf->entity.")"; $resql = $this->db->query($sql); if ($resql) // This can fail when class is used on an old database (during a migration for example) { diff --git a/htdocs/core/modules/modUser.class.php b/htdocs/core/modules/modUser.class.php index e5ba3289d05..9859d0e4830 100644 --- a/htdocs/core/modules/modUser.class.php +++ b/htdocs/core/modules/modUser.class.php @@ -291,7 +291,7 @@ class modUser extends DolibarrModules 'u.statut'=>'Status' ); // Add extra fields - $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'user' AND entity IN (0,".$conf->entity.")"; + $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'user' AND entity IN (0,".$conf->entity.")"; $resql = $this->db->query($sql); if ($resql) // This can fail when class is used on old database (during migration for example) { From be6b1e29ad69840c909bc4876901b8bb7fc26326 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 29 Oct 2021 13:32:32 +0200 Subject: [PATCH 1329/1460] Add logs --- htdocs/core/lib/geturl.lib.php | 5 ++++- htdocs/societe/tpl/linesalesrepresentative.tpl.php | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/geturl.lib.php b/htdocs/core/lib/geturl.lib.php index 3398189a771..70eca219e03 100644 --- a/htdocs/core/lib/geturl.lib.php +++ b/htdocs/core/lib/geturl.lib.php @@ -249,7 +249,10 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation = $request = curl_getinfo($ch, CURLINFO_HEADER_OUT); // Reading of request must be done after sending request dol_syslog("getURLContent request=".$request); - //dol_syslog("getURLContent response =".response); // This may contains binary data, so we dont output it + if (!empty($conf->global->MAIN_GETURLCONTENT_OUTPUT_RESPONSE)) { + // This may contains binary data, so we dont output reponse by default. + dol_syslog("getURLContent response =".response); + } dol_syslog("getURLContent response size=".strlen($response)); // This may contains binary data, so we dont output it $rep = array(); diff --git a/htdocs/societe/tpl/linesalesrepresentative.tpl.php b/htdocs/societe/tpl/linesalesrepresentative.tpl.php index a885cab03ed..125264e14d7 100644 --- a/htdocs/societe/tpl/linesalesrepresentative.tpl.php +++ b/htdocs/societe/tpl/linesalesrepresentative.tpl.php @@ -21,6 +21,8 @@ if (empty($conf) || !is_object($conf)) { exit; } +print ''; + // Sale representative print ''; // Progression print '
    '; print ''."\n"; // Loop on record // -------------------------------------------------------------------- $i = 0; -$totalarray = array(); $warehouse = new Entrepot($db); From 466f064d9a5a63e690ac3175ef5dbef6fb6d5326 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 30 Oct 2021 12:08:32 +0200 Subject: [PATCH 1331/1460] fixes to be pure markdown --- README-FR.md | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/README-FR.md b/README-FR.md index 81fdff13047..a67bf204076 100644 --- a/README-FR.md +++ b/README-FR.md @@ -8,12 +8,10 @@ Il est simple d'utilisation et modulaire, vous permettant de n'activez que les f ![ScreenShot](https://www.dolibarr.org/medias/dolibarr_screenshot1_1920x1080.jpg) - ## LICENCE Dolibarr est distribué sous les termes de la licence GNU General Public License v3+ ou supérieure. - ## INSTALLER DOLIBARR ### Configuration simple @@ -54,7 +52,6 @@ Vous pouvez aussi utiliser un serveur Web et une base de données prise en charg - Suivez les instructions de l'installateur - ## METTRE A JOUR DOLIBARR Pour mettre à jour Dolibarr depuis une vieille version vers celle ci: @@ -65,14 +62,12 @@ Pour mettre à jour Dolibarr depuis une vieille version vers celle ci: - Au prochain accès, Dolibarr proposera la page de "mise à jour" des données (si nécessaire). Si un fichier install.lock existe pour verrouiller le processus de mise à jour, il sera demandé de le supprimer manuellement (vous devriez trouver le fichier install.lock dans le répertoire utilisé pour stocker les documents générés ou transférés sur le serveur. Dans la plupart des cas, c'est le répertoire appelé "documents") -*Note: Le processus de migration peut être lancé manuellement et plusieurs fois, sans risque, en appelant la page /install/* - +Note: *Le processus de migration peut être lancé manuellement et plusieurs fois, sans risque, en appelant la page /install/* ## CE QUI EST NOUVEAU See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) file. - ## CE QUE DOLIBARR PEUT FAIRE ### Modules principaux (tous optionnels) @@ -122,7 +117,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) - Peux être multi-société par ajout du module externe multi-société. - Plusieurs thèmes visuels. - Application simple à utiliser. -- Requiert PHP et MariaDb, Mysql ou Postgresql (Voir versions exactes sur https://wiki.dolibarr.org/index.php/Prérequis). +- Requiert PHP et MariaDb, Mysql ou Postgresql (Voir versions exactes sur [https://wiki.dolibarr.org/index.php/Prérequis](https://wiki.dolibarr.org/index.php/Prérequis)). - Compatible avec toutes les offres Cloud du marché respectant les prérequis de base de données et PHP. - APIs. - Génération PDF et ODT des éléments (factures, propositions commerciales, commandes, bons expéditions, etc...) @@ -142,7 +137,6 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) Dolibarr peut aussi être étendu à volonté avec l'ajout de module/applications externes développées par des développeus tiers, disponible sur [DoliStore](https://www.dolistore.com). - ## CE QUE DOLIBARR NE PEUT PAS (ENCORE) FAIRE Voici un liste de fonctionnalités pas encore gérées par Dolibarr: @@ -152,18 +146,15 @@ Voici un liste de fonctionnalités pas encore gérées par Dolibarr: - Dolibarr n'embarque pas de Webmail intégré nativement. - Dolibarr ne fait pas le café (pas encore). - ## DOCUMENTATION La documentation utilisateur, développeur et traducteur est disponible sous forme de ressources de la communauté via le site [Wiki](https://wiki.dolibarr.org). - ## CONTRIBUER Ce projet existe grâce à ses nombreux contributeurs [[Contribuer](https://github.com/Dolibarr/dolibarr/blob/develop/.github/CONTRIBUTING.md)]. - - +[![Dolibarr](https://opencollective.com/dolibarr/contributors.svg?width=890&button=false)](https://github.com/Dolibarr/dolibarr/graphs/contributors) ## CREDITS @@ -171,7 +162,6 @@ Dolibarr est le résultat du travail de nombreux contributeurs depuis des année Voir le fichier [COPYRIGHT](https://github.com/Dolibarr/dolibarr/blob/develop/COPYRIGHT) - ## ACTUALITES ET RESEAUX SOCIAUX Suivez le projet Dolibarr project sur les réseaux francophones From 5f09f11a679bf2bc17e7313e1fd90b89a0d55cd2 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 30 Oct 2021 12:25:40 +0200 Subject: [PATCH 1332/1460] fixes to be pure markdown --- README.md | 123 +++++++++++++++++++++++++----------------------------- 1 file changed, 57 insertions(+), 66 deletions(-) diff --git a/README.md b/README.md index 54fdf1e958b..b0f7a2c3761 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ You can use a web server and a supported database (MariaDB, MySQL or PostgreSQL) On GNU/Linux, first check if your distribution has already packaged Dolibarr. -#### Generic install steps: +#### Generic install steps - Check that your installed PHP version is supported [see PHP support](https://wiki.dolibarr.org/index.php/Releases). @@ -71,86 +71,87 @@ On GNU/Linux, first check if your distribution has already packaged Dolibarr. - Follow the installer instructions - ### Saas/Cloud setup -If you don't have time to install it yourself, you can try some commercial 'ready to use' Cloud offers (See https://saas.dolibarr.org). However, this third solution is not free. - +If you don't have time to install it yourself, you can try some commercial 'ready to use' Cloud offers (See [https://saas.dolibarr.org](https://saas.dolibarr.org)). However, this third solution is not free. ## UPGRADING Dolibarr supports upgrading, usually without the need for any (commercial) support (depending on if you use any commercial extensions). It supports upgrading all the way from any version after 2.8 without breakage. This is unique in the ERP ecosystem and a benefit our users highly appreciate! - + - At first make a backup of your Dolibarr files & then [see](https://wiki.dolibarr.org/index.php/Installation_-_Upgrade#Upgrade_Dolibarr) - Check that your installed PHP version is supported by the new version [see PHP support](./doc/phpmatrix.md). - Overwrite all old files from 'dolibarr' directory with files provided into the new version's package. - At first next access, Dolibarr will redirect you to the "install/" page to follow the upgrade process.  If an `install.lock` file exists to lock any other upgrade process, the application will ask you to remove the file manually (you should find the `install.lock` file in the directory used to store generated and uploaded documents, in most cases, it is the directory called "*documents*"). - ## WHAT'S NEW See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) file. - ## FEATURES ### Main application/modules (all optional) -- Third-Parties Management: Customers, Prospects (Leads) and/or Suppliers + Contacts -- Members/Membership/Foundation management +- Third-Parties Management: Customers, Prospects (Leads) and/or Suppliers + Contacts +- Members/Membership/Foundation management - Product Management -- Products and/or Services catalog -- Stock / Warehouse management + Inventory -- Barcodes -- Batches / Lots / Serials -- Product Variants + Product Management + +- Products and/or Services catalog +- Stock / Warehouse management + Inventory +- Barcodes +- Batches / Lots / Serials +- Product Variants - Bill of Materials (BOM) -- Manufacturing Orders +- Manufacturing Orders - Customer/Sales Management -- Customers/Prospects + Contacts management -- Opportunities or Leads management -- Commercial proposals management -- Customer Orders management -- Contracts/Subscription management -- Interventions management -- Ticket System -- Shipping management -- Customer Invoices/Credit notes and payment management -- Point of Sale (POS) + Customer/Sales Management - Supplier/Purchase Management -- Suppliers/Vendors + Contacts -- Supplier (price) requests -- Purchase Orders management -- Delivery/Receiption -- Supplier Invoices/credit notes and payment management -- INCOTERMS +- Customers/Prospects + Contacts management +- Opportunities or Leads management +- Commercial proposals management +- Customer Orders management +- Contracts/Subscription management +- Interventions management +- Ticket System +- Shipping management +- Customer Invoices/Credit notes and payment management +- Point of Sale (POS) - Finance / Accounting -- Invoices / Payments -- Bank accounts management -- Direct debit orders management (European SEPA) -- Accounting management -- Donations management -- Loan management -- Margins -- Reports + Supplier/Purchase Management - Collaboration -- Shared calendar/agenda (with ical and vcal export for third party tools integration) -- Projects & Tasks management -- Ticket System +- Suppliers/Vendors + Contacts +- Supplier (price) requests +- Purchase Orders management +- Delivery/Receiption +- Supplier Invoices/credit notes and payment management +- INCOTERMS + + Finance / Accounting + +- Invoices / Payments +- Bank accounts management +- Direct debit orders management (European SEPA) +- Accounting management +- Donations management +- Loan management +- Margins +- Reports + + Collaboration + +- Shared calendar/agenda (with ical and vcal export for third party tools integration) +- Projects & Tasks management +- Ticket System - Surveys - HR -- Employee's leave requests management -- Expense reports -- Recruitment management -- Timesheets + HR +- Employee's leave requests management +- Expense reports +- Recruitment management +- Timesheets ### Other application/modules @@ -171,7 +172,6 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) (around 100 modules available by default, 1000+ on the addon market place) - ### Other general features - Localization in most major languages @@ -190,27 +190,24 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) - Canadian double taxes (federal/province) and other countries using cumulative VAT - Tunisian tax stamp - Argentina invoice numbering using A,B,C... - - Compatible with [European directives] (https://europa.eu/legislation_summaries/taxation/l31057_en.htm) (2006/112/CE ... 2010/45/UE) + - Compatible with [European directives](https://europa.eu/legislation_summaries/taxation/l31057_en.htm) (2006/112/CE ... 2010/45/UE) - Compatible with European GDPR rules - ... - Flexible PDF & ODT generation for invoices, proposals, orders... - ... - ### System Environment / Requirements - PHP -- MariaDB, MySQL or PostgreSQL +- MariaDB, MySQL or PostgreSQL - Compatible with all Cloud solutions that match PHP & MySQL or PostgreSQL prerequisites. See exact requirements on the [Wiki](https://wiki.dolibarr.org/index.php/Prerequisite) - ### Extending Dolibarr can be extended with a lot of other external application or modules from third party developers available at the [DoliStore](https://www.dolistore.com). - ## WHAT DOLIBARR CAN'T DO YET These are features that Dolibarr does **not** yet fully support: @@ -220,21 +217,18 @@ These are features that Dolibarr does **not** yet fully support: - No native embedded Webmail, but you can send email to contacts in Dolibarr with e.g. offers, invoices, etc. - Dolibarr can't do coffee (yet) - ## DOCUMENTATION Administrator, user, developer and translator's documentations are available along with other community resources in the [Wiki](https://wiki.dolibarr.org). - ## CONTRIBUTING -This project exists thanks to all the people who contribute. +This project exists thanks to all the people who contribute. Please read the instructions how to contribute (report a bug/error, a feature request, send code ...) [[Contribute](https://github.com/Dolibarr/dolibarr/blob/develop/.github/CONTRIBUTING.md)] A view on Contributors: - - +[![Dolibarr](https://opencollective.com/dolibarr/contributors.svg?width=890&button=false)](https://github.com/Dolibarr/dolibarr/graphs/contributors) ## CREDITS @@ -242,7 +236,6 @@ Dolibarr is the work of many contributors over the years and uses some fine PHP See [COPYRIGHT](https://github.com/Dolibarr/dolibarr/blob/develop/COPYRIGHT) file. - ## NEWS AND SOCIAL NETWORKS Follow Dolibarr project on: @@ -253,8 +246,6 @@ Follow Dolibarr project on: - [YouTube](https://www.youtube.com/user/DolibarrERPCRM) - [GitHub](https://github.com/Dolibarr/dolibarr) - ### Sponsors Support this project by becoming a sponsor. Your logo will show up here. 🙏 [[Become a sponsor/backer](https://opencollective.com/dolibarr#backer)] - From 47c131af743d500fbb735bb60a8d3c6268e726bc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 30 Oct 2021 14:10:55 +0200 Subject: [PATCH 1333/1460] Fix regression --- htdocs/theme/eldy/global.inc.php | 2 +- htdocs/theme/md/style.css.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 6aa2a066e89..d2e3c43a3aa 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -4774,7 +4774,7 @@ div.visible { display: block; } -div.hidden, td.hidden, img.hidden, span.hidden, div.showifmore { +div.hidden, header.hidden, td.hidden, img.hidden, span.hidden, div.showifmore { display: none; } .unvisible { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index c7ad8870c2e..4acf119eff7 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -4660,7 +4660,7 @@ div.visible { display: block; } -div.hidden, td.hidden, img.hidden, span.hidden, div.showifmore { +div.hidden, header.hidden, td.hidden, img.hidden, span.hidden, div.showifmore { display: none; } From 0017c159742dfdae473886e0c1064e866bdbf1d6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 30 Oct 2021 17:19:46 +0200 Subject: [PATCH 1334/1460] Debug v15 --- htdocs/comm/propal/card.php | 8 +- htdocs/core/bookmarks_page.php | 65 +++++---- htdocs/core/class/html.form.class.php | 3 +- htdocs/core/multicompany_page.php | 147 +++++++++++++++++++++ htdocs/langs/en_US/bookmarks.lang | 1 + htdocs/langs/en_US/propal.lang | 6 +- htdocs/projet/class/project.class.php | 4 +- htdocs/public/onlinesign/newonlinesign.php | 27 +++- htdocs/public/stripe/ipn.php | 25 +++- 9 files changed, 235 insertions(+), 51 deletions(-) create mode 100644 htdocs/core/multicompany_page.php diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index c301e054e96..c046281f18e 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2014,15 +2014,15 @@ if ($action == 'create') { $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); + $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherProposals").')'; } // Project if (!empty($conf->projet->enabled)) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; - if (!$usercancreate) { + $morehtmlref .= '
    '.$langs->trans('Project').''; + if ($usercancreate) { if ($action != 'classify') { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; } @@ -2041,7 +2041,7 @@ if ($action == 'create') { if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); - $morehtmlref .= ' : '.$proj->getNomUrl(1); + $morehtmlref .= ': '.$proj->getNomUrl(1); if ($proj->title) { $morehtmlref .= ' - '.$proj->title; } diff --git a/htdocs/core/bookmarks_page.php b/htdocs/core/bookmarks_page.php index af2ba15829c..46c4b38988e 100644 --- a/htdocs/core/bookmarks_page.php +++ b/htdocs/core/bookmarks_page.php @@ -20,7 +20,7 @@ /** * \file htdocs/core/bookmarks_page.php - * \brief File to return a page with the complete list of bookmarks (all search input fields) + * \brief File to return a page with the complete list of bookmarks */ //if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language @@ -45,7 +45,7 @@ if (GETPOST('lang', 'aZ09')) { $langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL by the main.inc.php } -$langs->load("main"); +$langs->loadLangs(array("bookmarks")); $right = ($langs->trans("DIRECTION") == 'rtl' ? 'left' : 'right'); $left = ($langs->trans("DIRECTION") == 'rtl' ? 'right' : 'left'); @@ -57,7 +57,7 @@ $left = ($langs->trans("DIRECTION") == 'rtl' ? 'right' : 'left'); $title = $langs->trans("Bookmarks"); -// URL http://mydolibarr/core/search_page?dol_use_jmobile=1 can be used for tests +// URL http://mydolibarr/core/bookmarks_page?dol_use_jmobile=1 can be used for tests $head = ''."\n"; $arrayofjs = array(); $arrayofcss = array(); @@ -69,8 +69,6 @@ print ''."\n"; print '
    '; //print '
    '; -$nbofsearch = 0; - // Instantiate hooks of thirdparty module $hookmanager->initHooks(array('bookmarks')); @@ -78,32 +76,43 @@ $hookmanager->initHooks(array('bookmarks')); $bookmarkList = ''; $searchForm = ''; -$arrayresult = array(); -//include DOL_DOCUMENT_ROOT.'/core/ajax/selectsearchbox.php'; - - -// Menu with list of bookmarks -$sql = "SELECT rowid, title, url, target FROM ".MAIN_DB_PREFIX."bookmark"; -$sql .= " WHERE (fk_user = ".((int) $user->id)." OR fk_user is NULL OR fk_user = 0)"; -$sql .= " AND entity IN (".getEntity('bookmarks').")"; -$sql .= " ORDER BY position"; -if ($resql = $db->query($sql)) { - $bookmarkList = ''; - - $searchForm .= ''; +if (empty($conf->bookmarks->enabled)) { + $langs->load("admin"); + $bookmarkList .= '
    '.$langs->trans("WarningModuleNotActive", $langs->transnoentitiesnoconv("Bookmarks")).''; + $bookmarkList .= '

    '; } else { - dol_print_error($db); -} + // Menu with list of bookmarks + $sql = "SELECT rowid, title, url, target FROM ".MAIN_DB_PREFIX."bookmark"; + $sql .= " WHERE (fk_user = ".((int) $user->id)." OR fk_user is NULL OR fk_user = 0)"; + $sql .= " AND entity IN (".getEntity('bookmarks').")"; + $sql .= " ORDER BY position"; + if ($resql = $db->query($sql)) { + $bookmarkList = ''; + + + $searchForm .= ''; + } else { + dol_print_error($db); + } +} // Execute hook printBookmarks $parameters = array('bookmarks'=>$bookmarkList); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 98ba6ca3cc2..56f7c41994b 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5088,8 +5088,7 @@ class Form if ($selected) { $projet = new Project($this->db); $projet->fetch($selected); - //print ''.$projet->title.''; - $out .= $projet->getNomUrl(0, '', 1); + $out .= $projet->getNomUrl(1, '', 1); } else { $out .= " "; } diff --git a/htdocs/core/multicompany_page.php b/htdocs/core/multicompany_page.php new file mode 100644 index 00000000000..239e5c46392 --- /dev/null +++ b/htdocs/core/multicompany_page.php @@ -0,0 +1,147 @@ + + * + * This file is a modified version of datepicker.php from phpBSM to fix some + * bugs, to add new features and to dramatically increase speed. + * + * 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 . + */ + +/** + * \file htdocs/multicompany_page.php + * \brief File to return a page with the list of all entities user can switch to + */ + +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled cause need to do translations +if (!defined('NOCSRFCHECK')) { + define('NOCSRFCHECK', 1); +} +if (!defined('NOTOKENRENEWAL')) { + define('NOTOKENRENEWAL', 1); +} +//if (! defined('NOLOGIN')) define('NOLOGIN',1); // Not disabled cause need to load personalized language +if (!defined('NOREQUIREMENU')) { + define('NOREQUIREMENU', 1); +} +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1); + +require_once '../main.inc.php'; + +$action = GETPOST('action', 'aZ09'); +$entityid = GETPOST('entity', 'int'); +$backtourl = GETPOST('backtourl'); +if (empty($backtourl)) { + $backtourl = DOL_URL_ROOT; +} + +if (GETPOST('lang', 'aZ09')) { + $langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL by the main.inc.php +} + +$langs->load("main"); + +$right = ($langs->trans("DIRECTION") == 'rtl' ? 'left' : 'right'); +$left = ($langs->trans("DIRECTION") == 'rtl' ? 'right' : 'left'); + + + +/* + * Actions + */ + +if (GETPOST('acction', 'aZ') == 'switchentity') { + if (is_object($mc)) { + $mc->switchEntity($entityid); + } + + header("Location: ".$backtourl); + exit(0); +} + + + +/* + * View + */ + +$title = $langs->trans("Multicompanies"); + +// URL http://mydolibarr/core/multicompany_page?dol_use_jmobile=1 can be used for tests +$head = ''."\n"; +$arrayofjs = array(); +$arrayofcss = array(); +top_htmlhead($head, $title, 0, 0, $arrayofjs, $arrayofcss); + + +print ''."\n"; +print '
    '; +//print '
    '; + + +if (empty($conf->multicompany->enabled)) { + $langs->load("admin"); + $bookmarkList .= '
    '.$langs->trans("WarningModuleNotActive", $langs->transnoentitiesnoconv("MultiCompany")).''; + $bookmarkList .= '

    '; +} else { + // Instantiate hooks of thirdparty module + $hookmanager->initHooks(array('multicompany')); + + // Define $bookmarks + $multicompanyList = ''; + $searchForm = ''; + + + if (is_object($mc)) { + $listofentities = $mc->getEntitiesList($user->login, false, true); + } + + foreach ($listofentities as $entityid => $entitycursor) { + $url = DOL_URL_ROOT.'/core/multicompany_page.php?action=switchentity&token='.newToken().'&entity='.((int) $entityid).($backtourl ? '&backtourl='.urlencode($backtourl) : ''); + $multicompanyList .= ''; + $multicompanyList .= dol_escape_htmltag($entitycursor); + $multicompanyList .= ''; + } + $multicompanyList .= '
    '; + + $searchForm .= ''; + + + // Execute hook printBookmarks + $parameters = array('multicompany'=>$multicompanyList); + $reshook = $hookmanager->executeHooks('printMultiCompanyEntities', $parameters); // Note that $action and $object may have been modified by some hooks + if (empty($reshook)) { + $multicompanyList .= $hookmanager->resPrint; + } else { + $multicompanyList = $hookmanager->resPrint; + } + + + print "\n"; + print "\n"; + print '
    '; + print ''; + print '
    '."\n"; + print $multicompanyList; + print '
    '."\n"; + print '
    '; + print "\n\n"; +} + +print '
    '; +print ''."\n"; + +$db->close(); diff --git a/htdocs/langs/en_US/bookmarks.lang b/htdocs/langs/en_US/bookmarks.lang index 87466cadcfa..d2378963a21 100644 --- a/htdocs/langs/en_US/bookmarks.lang +++ b/htdocs/langs/en_US/bookmarks.lang @@ -19,3 +19,4 @@ UseAnExternalHttpLinkOrRelativeDolibarrLink=Use an external/absolute link (https ChooseIfANewWindowMustBeOpenedOnClickOnBookmark=Choose if the linked page should open in the current tab or a new tab BookmarksManagement=Bookmarks management BookmarksMenuShortCut=Ctrl + shift + m +NoBookmarks=No bookmarks defined diff --git a/htdocs/langs/en_US/propal.lang b/htdocs/langs/en_US/propal.lang index 7141c1d38ae..ed07831fcba 100644 --- a/htdocs/langs/en_US/propal.lang +++ b/htdocs/langs/en_US/propal.lang @@ -89,11 +89,11 @@ IdProposal=Proposal ID IdProduct=Product ID PrParentLine=Proposal Parent Line LineBuyPriceHT=Buy Price Amount net of tax for line -SignPropal=Sign proposal +SignPropal=Accept proposal RefusePropal=Refuse proposal Sign=Sign +PropalAlreadySigned=Proposal already accepted PropalAlreadyRefused=Proposal already refused -PropalAlreadySigned=Proposal already signed -PropalSigned=Proposal signed +PropalSigned=Proposal accepted PropalRefused=Proposal refused ConfirmRefusePropal=Are you sure you want to refuse this commercial proposal? diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index aa823dc44d6..6d8b54d1954 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1183,7 +1183,7 @@ class Project extends CommonObject $label = ''; if ($option != 'nolink') { - $label = img_picto('', $this->picto).' '.$langs->trans("Project").''; + $label = img_picto('', $this->picto, 'class="pictofixedwidth"').' '.$langs->trans("Project").''; } if (isset($this->status)) { $label .= ' '.$this->getLibStatut(5); @@ -1252,7 +1252,7 @@ class Project extends CommonObject $result .= $linkstart; if ($withpicto) { - $result .= img_object(($notooltip ? '' : $label), $picto, ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); + $result .= img_object(($notooltip ? '' : $label), $picto, ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip pictofixedwidth"'), 0, 0, $notooltip ? 0 : 1); } if ($withpicto != 2) { $result .= $this->ref; diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index 65b12a91342..66b4af425e7 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -61,6 +61,7 @@ $langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'alpha'); $refusepropal = GETPOST('refusepropal', 'alpha'); +$message = GETPOST('message', 'aZ09'); // Input are: // type ('invoice','order','contractline'), @@ -120,25 +121,33 @@ $creditor = $mysoc->name; $object = new Propal($db); $object->fetch(0, $ref); + /* * Actions */ if ($action == 'confirm_refusepropal') { + $db->begin(); + $sql = "UPDATE ".MAIN_DB_PREFIX."propal"; - $sql .= " SET fk_statut = ".((int) $object::STATUS_NOTSIGNED).", note_private = '".$object->note_private."', date_signature='".$db->idate(dol_now())."'"; + $sql .= " SET fk_statut = ".((int) $object::STATUS_NOTSIGNED).", note_private = '".$db->escape($object->note_private)."', date_signature='".$db->idate(dol_now())."'"; $sql .= " WHERE rowid = ".((int) $object->id); + dol_syslog(__METHOD__, LOG_DEBUG); $resql = $db->query($sql); if (!$resql) { $error++; } + if (!$error) { $db->commit(); - setEventMessage("PropalRefused"); + + $message = 'refused'; + setEventMessages("PropalRefused", null, 'warning'); } else { $db->rollback(); } + $object->fetch(0, $ref); } @@ -367,7 +376,7 @@ if ($action == "dosign" && empty($cancel)) { success: function(response) { if(response == "success"){ console.log("Success on saving signature"); - window.location.replace("'.$_SERVER["SELF"].'?ref='.$ref.'"); + window.location.replace("'.$_SERVER["SELF"].'?ref='.$ref.'&message=signed"); }else{ console.error(response); } @@ -390,10 +399,18 @@ if ($action == "dosign" && empty($cancel)) { } else { if ($object->status == $object::STATUS_SIGNED) { print '
    '; - print ''.$langs->trans("PropalAlreadySigned").''; + if ($message == 'signed') { + print ''.$langs->trans("PropalSigned").''; + } else { + print ''.$langs->trans("PropalAlreadySigned").''; + } } elseif ($object->status == $object::STATUS_NOTSIGNED) { print '
    '; - print ''.$langs->trans("PropalAlreadyRefused").''; + if ($message == 'refused') { + print ''.$langs->trans("PropalRefused").''; + } else { + print ''.$langs->trans("PropalAlreadyRefused").''; + } } else { print ''; print ''; diff --git a/htdocs/public/stripe/ipn.php b/htdocs/public/stripe/ipn.php index f44bc0b1c99..6674ce9c6de 100644 --- a/htdocs/public/stripe/ipn.php +++ b/htdocs/public/stripe/ipn.php @@ -83,6 +83,21 @@ if (empty($endpoint_secret)) { exit(); } +if (!empty($conf->global->STRIPE_USER_ACCOUNT_FOR_ACTIONS)) { + // We set the user to use for all ipn actions in Dolibarr + $user = new User($db); + $user->fetch($conf->global->STRIPE_USER_ACCOUNT_FOR_ACTIONS); + $user->getrights(); +} else { + print 'Error: Setup of module Stripe not complete for mode '.$service.'. The STRIPE_USER_ACCOUNT_FOR_ACTIONS is not defined.'; + http_response_code(400); // PHP 5.4 or greater + exit(); +} + + +// TODO Add a check on a security key + + /* * Actions @@ -110,10 +125,6 @@ try { $langs->load("main"); -// TODO Do we really need a user in setup just to have a name to fill an email topic when it is a technical system notification email -$user = new User($db); -$user->fetch($conf->global->STRIPE_USER_ACCOUNT_FOR_ACTIONS); -$user->getrights(); if (!empty($conf->multicompany->enabled) && !empty($conf->stripeconnect->enabled) && is_object($mc)) { $sql = "SELECT entity"; @@ -276,11 +287,11 @@ if ($event->type == 'payout.created') { $ret = $mailfile->sendfile(); - http_response_code(200); // PHP 5.4 or greater + http_response_code(200); return 1; } else { $error++; - http_response_code(500); // PHP 5.4 or greater + http_response_code(500); return -1; } } elseif ($event->type == 'customer.source.created') { @@ -385,4 +396,4 @@ if ($event->type == 'payout.created') { // This event is deprecated. } -http_response_code(200); // PHP 5.4 or greater +http_response_code(200); From b1c799ee08bd1ec97412182fe56005f0ae894f0d Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 30 Oct 2021 21:17:15 +0200 Subject: [PATCH 1335/1460] FIX #19241 Project - Fix display salary in overview --- htdocs/projet/element.php | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 9e14a53e7ea..22fe94a362a 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -1,13 +1,13 @@ - * Copyright (C) 2004-2020 Laurent Destailleur - * Copyright (C) 2005-2010 Regis Houssin - * Copyright (C) 2012-2016 Juanjo Menent - * Copyright (C) 2015-2019 Alexandre Spangaro - * Copyright (C) 2015 Marcos García - * Copyright (C) 2016 Josep Lluís Amador - * Copyright (C) 2021 Gauthier VERDOL - * Copyright (C) 2021 Noé Cendrier +/* Copyright (C) 2001-2004 Rodolphe Quiedeville + * Copyright (C) 2004-2020 Laurent Destailleur + * Copyright (C) 2005-2010 Regis Houssin + * Copyright (C) 2012-2016 Juanjo Menent + * Copyright (C) 2015-2021 Alexandre Spangaro + * Copyright (C) 2015 Marcos García + * Copyright (C) 2016 Josep Lluís Amador + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021 Noé Cendrier * * 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 @@ -590,8 +590,8 @@ $listofreferent = array( 'name'=>"Salaries", 'title'=>"ListSalariesAssociatedProject", 'class'=>'Salary', - 'table'=>'payment_salary', - 'datefieldname'=>'datev', + 'table'=>'salary', + 'datefieldname'=>'datesp', 'margin'=>'minus', 'disableamount'=>0, 'urlnew'=>DOL_URL_ROOT.'/salaries/card.php?action=create&projectid='.$id, @@ -816,7 +816,7 @@ foreach ($listofreferent as $key => $value) { } // Define $total_ht_by_line - if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various' || $tablename == 'payment_salary') { + if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various' || $tablename == 'salary') { $total_ht_by_line = $element->amount; } elseif ($tablename == 'fichinter') { $total_ht_by_line = $element->getAmount(); @@ -858,7 +858,7 @@ foreach ($listofreferent as $key => $value) { } // Define $total_ttc_by_line - if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various' || $tablename == 'payment_salary') { + if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various' || $tablename == 'salary') { $total_ttc_by_line = $element->amount; } elseif ($tablename == 'fichinter') { $total_ttc_by_line = $element->getAmount(); @@ -1075,7 +1075,7 @@ foreach ($listofreferent as $key => $value) { print ''; // if $key == 'project_task', we don't want details per user } elseif (in_array($tablename, array('payment_various'))) { print ''; // if $key == 'payment_various', we don't have any thirdparty - } elseif (in_array($tablename, array('expensereport_det', 'don', 'projet_task', 'stock_mouvement', 'payment_salary'))) { + } elseif (in_array($tablename, array('expensereport_det', 'don', 'projet_task', 'stock_mouvement', 'salary'))) { print $langs->trans("User"); } else { print $langs->trans("ThirdParty"); @@ -1233,8 +1233,8 @@ foreach ($listofreferent as $key => $value) { $date = $element->date; // No draft status on lines } elseif ($tablename == 'stock_mouvement') { $date = $element->datem; - } elseif ($tablename == 'payment_salary') { - $date = $element->datev; + } elseif ($tablename == 'salary') { + $date = $element->datesp; } elseif ($tablename == 'payment_various') { $date = $element->datev; } elseif ($tablename == 'chargesociales') { @@ -1292,7 +1292,7 @@ foreach ($listofreferent as $key => $value) { $tmpuser = new User($db); $tmpuser->fetch($expensereport->fk_user_author); print $tmpuser->getNomUrl(1, '', 48); - } elseif ($tablename == 'payment_salary') { + } elseif ($tablename == 'salary') { $tmpuser = new User($db); $tmpuser->fetch($element->fk_user); print $tmpuser->getNomUrl(1, '', 48); @@ -1320,7 +1320,7 @@ foreach ($listofreferent as $key => $value) { if (empty($value['disableamount'])) { $total_ht_by_line = null; $othermessage = ''; - if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various' || $tablename == 'payment_salary') { + if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various' || $tablename == 'salary') { $total_ht_by_line = $element->amount; } elseif ($tablename == 'fichinter') { $total_ht_by_line = $element->getAmount(); @@ -1374,7 +1374,7 @@ foreach ($listofreferent as $key => $value) { // Amount inc tax if (empty($value['disableamount'])) { $total_ttc_by_line = null; - if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various' || $tablename == 'payment_salary') { + if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various' || $tablename == 'salary') { $total_ttc_by_line = $element->amount; } elseif ($tablename == 'fichinter') { $total_ttc_by_line = $element->getAmount(); From 9142599ea5e80af74060ed6211f83f1ecd8dfeea Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 30 Oct 2021 21:18:52 +0200 Subject: [PATCH 1336/1460] copyright --- htdocs/projet/element.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 22fe94a362a..7e03c3738cc 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -6,7 +6,7 @@ * Copyright (C) 2015-2021 Alexandre Spangaro * Copyright (C) 2015 Marcos García * Copyright (C) 2016 Josep Lluís Amador - * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021 Gauthier VERDOL * Copyright (C) 2021 Noé Cendrier * * This program is free software; you can redistribute it and/or modify From 54b81312b59b88e9d40497017f28eb93d667ff21 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 30 Oct 2021 22:49:32 +0200 Subject: [PATCH 1337/1460] FIX Ticket - Duplicate field project when we create ticket from project --- htdocs/core/class/html.formticket.class.php | 24 +++++++++++---------- htdocs/ticket/card.php | 19 ++++++++++------ 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 8dcd4965c65..e2f9ba48687 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -1,16 +1,17 @@ - * Copyright (C) 2016 Christophe Battarel - * Copyright (C) 2019 Frédéric France +/* Copyright (C) 2013-2015 Jean-François FERRY + * Copyright (C) 2016 Christophe Battarel + * Copyright (C) 2019 Frédéric France + * Copyright (C) 2021 Alexandre Spangaro * * 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 2 of the License, or + * 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 + * 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 @@ -351,12 +352,13 @@ class FormTicket } } - if (!empty($conf->projet->enabled) && !$this->ispublic) - { - $formproject = new FormProjets($this->db); - print '
    '; + if($subelement != 'project') { + if (!empty($conf->projet->enabled) && !$this->ispublic) { + $formproject = new FormProjets($this->db); + print ''; + } } // Attached files diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 08d9330a4c6..32d9cdfbb78 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -1,7 +1,8 @@ - * Copyright (C) 2016 Christophe Battarel - * Copyright (C) 2018 Laurent Destailleur +/* Copyright (C) 2013-2016 Jean-François FERRY + * Copyright (C) 2016 Christophe Battarel + * Copyright (C) 2018 Laurent Destailleur + * Copyright (C) 2021 Alexandre Spangaro * * 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 @@ -192,9 +193,15 @@ if (empty($reshook)) { $result = $object->add_contact($contactid, GETPOST("type"), 'external'); } - // altairis: link ticket to project - if (GETPOST('projectid') > 0) { - $object->setProject(GETPOST('projectid')); + // Link ticket to project + if(GETPOST('origin', 'alpha') == 'projet') { + $projectid = GETPOST('originid', 'int'); + } else { + $projectid = GETPOST('projectid', 'int'); + } + + if ($projectid > 0) { + $object->setProject($projectid); } // Auto assign user From 3242400855c5fb399c71782bed990f7d3195d559 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 31 Oct 2021 06:26:41 +0100 Subject: [PATCH 1338/1460] Clean module HRM --- htdocs/core/modules/modHRM.class.php | 126 +++++++++++++-------------- 1 file changed, 60 insertions(+), 66 deletions(-) diff --git a/htdocs/core/modules/modHRM.class.php b/htdocs/core/modules/modHRM.class.php index d6870244521..d03ede8a55e 100644 --- a/htdocs/core/modules/modHRM.class.php +++ b/htdocs/core/modules/modHRM.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2015-2021 Alexandre Spangaro * * 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 @@ -13,25 +13,27 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * or see https://www.gnu.org/ */ /** - * \file htdocs/core/modules/modHRM.class.php - * \ingroup HRM - * \brief Description and activation file for the module HRM + * \defgroup HRM Module hrm + * \file htdocs/core/modules/modHRM.class.php + * \ingroup HRM + * \brief Description and activation file for the module HRM */ include_once DOL_DOCUMENT_ROOT."/core/modules/DolibarrModules.class.php"; + /** - * Class to describe and activate the HRM module + * Description and activation class for module HRM */ class modHRM extends DolibarrModules { /** - * Constructor. - * Define names, constants, directories, boxes, permissions + * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDB $db Database handler + * @param DoliDB $db Database handler */ public function __construct($db) { @@ -39,34 +41,27 @@ class modHRM extends DolibarrModules $this->db = $db; + // Id for module (must be unique). + // Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id). $this->numero = 4000; + // Key text used to identify module (for permissions, menus, etc...) $this->rights_class = 'hrm'; + // Family can be 'crm','financial','hr','projects','products','ecm','technic','other' + // It is used to group modules in module setup page $this->family = "hr"; $this->module_position = '50'; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i', '', get_class($this)); - // Module description, used if translation string 'ModulehrmDesc' not found (hrm is name of module). - $this->description = "hrm Description product "; - // Used only if file README.md and README-LL.md not found. - $this->descriptionlong = "hrm Description long"; - - // Author - $this->editor_name = 'Editor name'; - $this->editor_url = 'https://www.example.com'; - - // Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z' - $this->version = '1.0'; - // Url to the file with your last numberversion of this module - //$this->url_last_version = 'http://www.example.com/versionmodule.txt'; - - // Key used in llx_const table to save module status enabled/disabled (where HRMTEST is value of property name of module in uppercase) + // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) + $this->description = "HRM"; + // Possible values for version are: 'development', 'experimental', 'dolibarr' or version + $this->version = 'development'; + // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); - // Name of image file used for this module. // If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue' // If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module' - // To use a supported fa-xxx css style of font awesome, use this->picto='xxx' $this->picto = 'hrm'; // Define some features supported by module (triggers, login, substitutions, menus, css, etc...) @@ -110,32 +105,20 @@ class modHRM extends DolibarrModules $this->config_page_url = array("hrm.php"); // Dependencies - // A condition to hide module - $this->hidden = false; - // List of module class names as string that must be enabled if this module is enabled. Example: array('always1'=>'modModuleToEnable1','always2'=>'modModuleToEnable2', 'FR1'=>'modModuleToEnableFR'...) - $this->depends = array(); - $this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...) - $this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...) - - // The language file dedicated to your module + $this->hidden = false; // A condition to hide module + $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled + $this->requiredby = array(); // List of module ids to disable if this one is disabled + $this->conflictwith = array(); // List of module class names as string this module is in conflict with + $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->need_dolibarr_version = array(11, 0); // Minimum version of Dolibarr required by module $this->langfiles = array("hrm"); - // Prerequisites - $this->phpmin = array(5, 6); // Minimum version of PHP required by module - $this->need_dolibarr_version = array(11, -3); // Minimum version of Dolibarr required by module - - // Messages at activation - $this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...) - $this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...) - //$this->automatic_activation = array('FR'=>'HrmTestWasAutomaticallyActivatedBecauseOfYourCountryChoice'); - //$this->always_enabled = true; // If true, can't be disabled - // Constants - // List of particular constants to add when module is enabled (key, 'chaine', value, desc, visible, 'current' or 'allentities', deleteonunactive) - // Example: $this->const=array(1 => array('HRMTEST_MYNEWCONST1', 'chaine', 'myvalue', 'This is a constant to add', 1), - // 2 => array('HRMTEST_MYNEWCONST2', 'chaine', 'myvalue', 'This is another constant to add', 0, 'current', 1) - // ); - $this->const = array(); + // Example: $this->const=array(0=>array('MYMODULE_MYNEWCONST1','chaine','myvalue','This is a constant to add',0), + // 1=>array('MYMODULE_MYNEWCONST2','chaine','myvalue','This is another constant to add',0) ); + // 2=>array('MAIN_MODULE_MYMODULE_NEEDSMARTY','chaine',1,'Constant to say module need smarty',0) + $this->const = array(); // List of particular constants to add when module is enabled (key, 'chaine', value, desc, visible, 0 or 'allentities') + $r = 0; if (!isset($conf->hrm) || !isset($conf->hrm->enabled)) { @@ -207,67 +190,78 @@ class modHRM extends DolibarrModules // ), ); - // Permissions provided by this module - $this->rights = array(); + + // Permissions + $this->rights = array(); // Permission array used by this module $r = 0; - // Add here entries to declare new permissions - /* BEGIN MODULEBUILDER PERMISSIONS */ // Skill / Job / Position - $this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used) + $this->rights[$r][0] = 4010; // Permission id (must not be already used) $this->rights[$r][1] = $langs->trans('ReadSkillJobPosition'); // Permission label + $this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][4] = 'all'; $this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->read) $r++; - $this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used) + + $this->rights[$r][0] = 4011; // Permission id (must not be already used) $this->rights[$r][1] = $langs->trans('CreateUpdateSkillJobPosition'); // Permission label + $this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][4] = 'all'; $this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->write) $r++; - $this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used) + + $this->rights[$r][0] = 4012; // Permission id (must not be already used) $this->rights[$r][1] = $langs->trans('DeleteSkillJobPosition'); // Permission label + $this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][4] = 'all'; $this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->delete) $r++; //Eval - $this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used) + $this->rights[$r][0] = 4020; // Permission id (must not be already used) $this->rights[$r][1] = $langs->trans('ReadEval'); // Permission label + $this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][4] = 'evaluation'; $this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->read) $r++; - $this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used) + + $this->rights[$r][0] = 4021; // Permission id (must not be already used) $this->rights[$r][1] = $langs->trans('CreateUpdateEval'); // Permission label + $this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][4] = 'evaluation'; $this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->write) $r++; - $this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used) + + $this->rights[$r][0] = 4022; // Permission id (must not be already used) $this->rights[$r][1] = $langs->trans('ValidateEval'); // Permission label + $this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][4] = 'evaluation'; $this->rights[$r][5] = 'validate'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->write) $r++; - $this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used) + + $this->rights[$r][0] = 4023; // Permission id (must not be already used) $this->rights[$r][1] = $langs->trans('DeleteEval'); // Permission label + $this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][4] = 'evaluation'; $this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->delete) $r++; // Comparison - $this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used) + $this->rights[$r][0] = 4030; // Permission id (must not be already used) $this->rights[$r][1] = $langs->trans('SeeComparisonMenu'); // Permission label + $this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][4] = 'compare'; $this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->delete) $r++; } /** - * Function called when module is enabled. - * The init function add constants, boxes, permissions and menus - * (defined in constructor) into Dolibarr database. - * It also creates data directories + * Function called when module is enabled. + * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database. + * It also creates data directories * - * @param string $options Enabling module ('', 'noboxes') - * @return int if OK, 0 if KO + * @param string $options Options when enabling module ('', 'newboxdefonly', 'noboxes') + * @return int 1 if OK, 0 if KO */ public function init($options = '') { From 62ce27886b57391e3c1330c7eb87e20255e05816 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 31 Oct 2021 07:04:31 +0100 Subject: [PATCH 1339/1460] Remove useless language key --- htdocs/langs/en_US/hrm.lang | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/langs/en_US/hrm.lang b/htdocs/langs/en_US/hrm.lang index 430124cecba..29ceba717ce 100644 --- a/htdocs/langs/en_US/hrm.lang +++ b/htdocs/langs/en_US/hrm.lang @@ -23,8 +23,6 @@ HrmSetup = Hrm setup HrmSetupPage = Hrm setup page HRM_MAXRANK=Maximum rank for a skill HRM_DEFAULT_SKILL_DESCRIPTION=Default description of ranks when skill is created -HrmAbout = About Hrm -traduction_note=Translate deplacement=Shift DateEval=Evaluation date JobCard=Job card From 84c3c9d025712eb69b6de55a486ec64ca7ef0b39 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 31 Oct 2021 07:12:26 +0100 Subject: [PATCH 1340/1460] Remove useless language key --- htdocs/langs/en_US/hrm.lang | 8 -------- 1 file changed, 8 deletions(-) diff --git a/htdocs/langs/en_US/hrm.lang b/htdocs/langs/en_US/hrm.lang index 29ceba717ce..56fcfba16de 100644 --- a/htdocs/langs/en_US/hrm.lang +++ b/htdocs/langs/en_US/hrm.lang @@ -80,11 +80,3 @@ NoEval=No evaluation done for this employee HowManyUserWithThisMaxNote=Number of users with this rank HighestRank=Highest rank SkillComparison=Skill comparison -ReadSkillJobPosition=Read skills / jobs / positions -CreateUpdateSkillJobPosition=Create / update skills / jobs / positions -DeleteSkillJobPosition=Delete skills / jobs / positions -ReadEval=Read evaluations -CreateUpdateEval=Create / update evaluations -ValidateEval=Validate evaluations -DeleteEval=Delete evaluations -SeeComparisonMenu=Access skills comparison menu From 70ed6331711a8ed0e50f0bac20bb65b405907d55 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 31 Oct 2021 07:23:34 +0100 Subject: [PATCH 1341/1460] Update label perms --- htdocs/core/modules/modHRM.class.php | 18 +++++++++--------- htdocs/langs/en_US/admin.lang | 8 ++++++++ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/htdocs/core/modules/modHRM.class.php b/htdocs/core/modules/modHRM.class.php index d03ede8a55e..9c5e509ecd3 100644 --- a/htdocs/core/modules/modHRM.class.php +++ b/htdocs/core/modules/modHRM.class.php @@ -197,50 +197,50 @@ class modHRM extends DolibarrModules // Skill / Job / Position $this->rights[$r][0] = 4010; // Permission id (must not be already used) - $this->rights[$r][1] = $langs->trans('ReadSkillJobPosition'); // Permission label + $this->rights[$r][1] = 'Read skill/job/position'; // Permission label $this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][4] = 'all'; $this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->read) $r++; $this->rights[$r][0] = 4011; // Permission id (must not be already used) - $this->rights[$r][1] = $langs->trans('CreateUpdateSkillJobPosition'); // Permission label + $this->rights[$r][1] = 'Create/modify skill/job/position'; // Permission label $this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][4] = 'all'; $this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->write) $r++; $this->rights[$r][0] = 4012; // Permission id (must not be already used) - $this->rights[$r][1] = $langs->trans('DeleteSkillJobPosition'); // Permission label + $this->rights[$r][1] = 'Delete skill/job/position'; // Permission label $this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][4] = 'all'; $this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->delete) $r++; - //Eval + // Evaluation $this->rights[$r][0] = 4020; // Permission id (must not be already used) - $this->rights[$r][1] = $langs->trans('ReadEval'); // Permission label + $this->rights[$r][1] = 'Read evaluation'; // Permission label $this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][4] = 'evaluation'; $this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->read) $r++; $this->rights[$r][0] = 4021; // Permission id (must not be already used) - $this->rights[$r][1] = $langs->trans('CreateUpdateEval'); // Permission label + $this->rights[$r][1] = 'Create/modify evaluation'; // Permission label $this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][4] = 'evaluation'; $this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->write) $r++; $this->rights[$r][0] = 4022; // Permission id (must not be already used) - $this->rights[$r][1] = $langs->trans('ValidateEval'); // Permission label + $this->rights[$r][1] = 'Validate evaluation'; // Permission label $this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][4] = 'evaluation'; $this->rights[$r][5] = 'validate'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->write) $r++; $this->rights[$r][0] = 4023; // Permission id (must not be already used) - $this->rights[$r][1] = $langs->trans('DeleteEval'); // Permission label + $this->rights[$r][1] = 'Delete evaluation'; // Permission label $this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][4] = 'evaluation'; $this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->delete) @@ -248,7 +248,7 @@ class modHRM extends DolibarrModules // Comparison $this->rights[$r][0] = 4030; // Permission id (must not be already used) - $this->rights[$r][1] = $langs->trans('SeeComparisonMenu'); // Permission label + $this->rights[$r][1] = 'See comparison menu'; // Permission label $this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][4] = 'compare'; $this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->delete) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index d9099f567fa..508d56a46c5 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -961,6 +961,14 @@ Permission4001=See employees Permission4002=Create employees Permission4003=Delete employees Permission4004=Export employees +Permission4010=Read skill/job/position +Permission4011=Create/modify skill/job/position +Permission4012=Delete skill/job/position +Permission4020=Read evaluation +Permission4021=Create/modify evaluation +Permission4022=Validate evaluation +Permission4023=Delete evaluation +Permission4030=See comparison menu Permission10001=Read website content Permission10002=Create/modify website content (html and javascript content) Permission10003=Create/modify website content (dynamic php code). Dangerous, must be reserved to restricted developers. From 57a479e32838d039766a2c160834bcddb7a129e0 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 31 Oct 2021 07:27:37 +0100 Subject: [PATCH 1342/1460] Remove useless language key --- htdocs/langs/en_US/hrm.lang | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/hrm.lang b/htdocs/langs/en_US/hrm.lang index 56fcfba16de..8724bb805a6 100644 --- a/htdocs/langs/en_US/hrm.lang +++ b/htdocs/langs/en_US/hrm.lang @@ -19,8 +19,7 @@ Employees=Employees Employee=Employee NewEmployee=New employee ListOfEmployees=List of employees -HrmSetup = Hrm setup -HrmSetupPage = Hrm setup page +HrmSetup=HRM module setup HRM_MAXRANK=Maximum rank for a skill HRM_DEFAULT_SKILL_DESCRIPTION=Default description of ranks when skill is created deplacement=Shift From dcc98b6026df8c8f89705324952e906759800ba4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 31 Oct 2021 12:54:08 +0100 Subject: [PATCH 1343/1460] Fix filter on product on statistic page --- htdocs/product/popuprop.php | 4 +-- htdocs/product/stats/card.php | 55 +++++++++++++++++++++++------------ 2 files changed, 38 insertions(+), 21 deletions(-) diff --git a/htdocs/product/popuprop.php b/htdocs/product/popuprop.php index 8ffae0bee8c..32a2cd08cc9 100644 --- a/htdocs/product/popuprop.php +++ b/htdocs/product/popuprop.php @@ -178,7 +178,7 @@ $arrayofmode = array( 'facture' => 'Facture' ); $title .= ' '.$form->selectarray('mode', $arrayofmode, $mode, 1); -$title .= ' '; +$title .= ' '; print '
    '; @@ -198,7 +198,7 @@ print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sort print '
    '; @@ -45,7 +47,7 @@ if ($action == 'editsalesrepresentatives') { $arrayselected = $object->getSalesRepresentatives($user, 1); } print $form->multiselectarray('commercial', $userlist, $arrayselected, null, null, null, null, "90%"); - print ''; + print ''; print ''; } else { $listsalesrepresentatives = $object->getSalesRepresentatives($user); From 09621af54e54830922fb44b1f8c26a2cd284c20e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 29 Oct 2021 22:49:29 +0200 Subject: [PATCH 1330/1460] FIX $totalarray is overwritten, totals were lost --- htdocs/product/stock/list.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index b8f998c0ec0..a86bc83982b 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -566,7 +566,6 @@ print '
    '; - print $formproject->select_projects(-1, GETPOST('projectid', 'int'), 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500'); - print '
    '; + print $formproject->select_projects(-1, GETPOST('projectid', 'int'), 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500'); + print '
    '; -print ""; +print ''; print_liste_field_titre('Ref', $_SERVER["PHP_SELF"], 'p.ref', '', $param, '', $sortfield, $sortorder); print_liste_field_titre('Type', $_SERVER["PHP_SELF"], 'p.fk_product_type', '', $param, '', $sortfield, $sortorder); print_liste_field_titre('Label', $_SERVER["PHP_SELF"], 'p.label', '', $param, '', $sortfield, $sortorder); diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php index 6929c70a5ff..6dc40ab7477 100644 --- a/htdocs/product/stats/card.php +++ b/htdocs/product/stats/card.php @@ -45,6 +45,7 @@ $ref = GETPOST('ref', 'alpha'); $mode = (GETPOST('mode', 'alpha') ? GETPOST('mode', 'alpha') : 'byunit'); $search_year = GETPOST('search_year', 'int'); $search_categ = GETPOST('search_categ', 'int'); +$notab = GETPOST('notab', 'int'); $error = 0; $mesg = ''; @@ -56,7 +57,7 @@ if (!empty($user->socid)) { } // Security check -$fieldvalue = (!empty($id) ? $id : $ref); +$fieldvalue = ($id > 0 ? $id : $ref); $fieldtype = (!empty($ref) ? 'ref' : 'rowid'); $tmp = dol_getdate(dol_now()); @@ -65,6 +66,11 @@ if (empty($search_year)) { $search_year = $currentyear; } +$object = new Product($db); +if ($id > 0 || !empty($ref)) { + $result = $object->fetch($id, $ref); +} + $result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); @@ -81,9 +87,10 @@ $result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product $form = new Form($db); $htmlother = new FormOther($db); -$object = new Product($db); -if (!$id && empty($ref)) { +if (!($id > 0) && empty($ref) || $notab) { + $notab = 1; + llxHeader("", $langs->trans("ProductStatistics")); $type = GETPOST('type', 'int'); @@ -128,7 +135,7 @@ if (!$id && empty($ref)) { } -if ($result && (!empty($id) || !empty($ref))) { +if ($result && ($id > 0 || !empty($ref)) && empty($notab)) { $head = product_prepare_head($object); $titre = $langs->trans("CardProduct".$object->type); $picto = ($object->type == Product::TYPE_SERVICE ? 'service' : 'product'); @@ -141,11 +148,11 @@ if ($result && (!empty($id) || !empty($ref))) { print dol_get_fiche_end(); } -if (empty($id) && empty($ref)) { +if ((!($id > 0) && empty($ref)) || $notab) { $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT.'/product/stats/card.php'.($type != '' ? '?type='.$type : ''); + $head[$h][0] = DOL_URL_ROOT.'/product/stats/card.php'.($type != '' ? '?type='.((int) $type) : ''); $head[$h][1] = $langs->trans("Chart"); $head[$h][2] = 'chart'; $h++; @@ -158,7 +165,7 @@ if (empty($id) && empty($ref)) { $title = $langs->trans("ListProductByPopularity"); } - $head[$h][0] = DOL_URL_ROOT.'/product/popuprop.php'.($type != '' ? '?type='.$type : ''); + $head[$h][0] = DOL_URL_ROOT.'/product/popuprop.php'.($type != '' ? '?type='.((int) $type) : ''); $head[$h][1] = $langs->trans("ProductsPerPopularity"); $head[$h][2] = 'popularity'; $h++; @@ -167,21 +174,29 @@ if (empty($id) && empty($ref)) { } -if ($result || empty($id)) { +if ($result || !($id > 0)) { print ''; print ''; - print ''; + if (empty($id) || $notab) { + print ''; + } print '
    '; print ''; - if (empty($id)) { + if (!($id > 0) || $notab) { // Type - print ''; + // Product + print ''; + // Tag if ($conf->categorie->enabled) { print ''; } + } else { + print ''; } // Year @@ -220,7 +237,7 @@ if ($result || empty($id)) { } if ($mode == 'bynumber') { - print 'id).($type != '' ? '&type='.$type : '').'&mode=byunit&search_year='.$search_year.'">'; + print ''; } else { print ''; } @@ -238,7 +255,7 @@ if ($result || empty($id)) { } if ($mode == 'byunit') { - print 'id).($type != '' ? '&type='.$type : '').'&mode=bynumber&search_year='.$search_year.'">'; + print ''; } else { print ''; } @@ -256,9 +273,7 @@ if ($result || empty($id)) { } print '
    '; - //print '
    '.$langs->trans("Filter").'
    '.$langs->trans("ProductsAndServices").''; + print '
    '.$langs->trans("Type").''; $array = array('-1'=>' ', '0'=>$langs->trans('Product'), '1'=>$langs->trans('Service')); print $form->selectarray('type', $array, $type); print '
    '.$langs->trans("ProductOrService").''; + print img_picto('', 'product', 'class="pictofixedwidth"'); + print $form->select_produits($id, 'id', '', 0, 0, 1, 2, '', 0, array(), 0, '1', 0, 'maxwidth500'); + print '
    '.$langs->trans("Categories").''; @@ -190,6 +205,8 @@ if ($result || empty($id)) { print $moreforfilter; print '
    '; - - // Generation des graphs + // Generation of graphs $dir = (!empty($conf->product->multidir_temp[$object->entity]) ? $conf->product->multidir_temp[$object->entity] : $conf->service->multidir_temp[$object->entity]); if ($object->id > 0) { // We are on statistics for a dedicated product if (!file_exists($dir.'/'.$object->id)) { @@ -383,7 +398,7 @@ if ($result || empty($id)) { $px->SetShading(3); //print 'x '.$key.' '.$graphfiles[$key]['file']; - $url = DOL_URL_ROOT.'/viewimage.php?modulepart='.$graphfiles[$key]['modulepart'].'&entity='.$object->entity.'&file='.urlencode($graphfiles[$key]['file']); + $url = DOL_URL_ROOT.'/viewimage.php?modulepart='.$graphfiles[$key]['modulepart'].'&entity='.((int) $object->entity).'&file='.urlencode($graphfiles[$key]['file']).($notab ? '¬ab='.$notab : ''); $px->draw($dir."/".$graphfiles[$key]['file'], $url); $graphfiles[$key]['total'] = $px->total(); @@ -444,7 +459,9 @@ if ($result || empty($id)) { } else { $dategenerated = ($mesg ? ''.$mesg.'' : $langs->trans("ChartNotGenerated")); } - $linktoregenerate = 'id).((string) $type != '' ? '&type='.$type : '').'&action=recalcul&mode='.$mode.'&search_year='.$search_year.'&search_categ='.$search_categ.'">'.img_picto($langs->trans("ReCalculate").' ('.$dategenerated.')', 'refresh').''; + $linktoregenerate = ' 0 ? '&search_categ='.((int) $search_categ) : '').'">'; + $linktoregenerate .= img_picto($langs->trans("ReCalculate").' ('.$dategenerated.')', 'refresh'); + $linktoregenerate .= ''; // Show graph print '
    '; @@ -478,7 +495,7 @@ if ($result || empty($id)) { } } -if (!$id) { +if (!($id > 0)) { print dol_get_fiche_end(); } From ed9f0c4ad951e4a79609c0396b67c2f99a09cf4f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 31 Oct 2021 13:42:08 +0100 Subject: [PATCH 1344/1460] Fix labels --- htdocs/core/modules/modHRM.class.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/htdocs/core/modules/modHRM.class.php b/htdocs/core/modules/modHRM.class.php index 9c5e509ecd3..b13e5b6bbba 100644 --- a/htdocs/core/modules/modHRM.class.php +++ b/htdocs/core/modules/modHRM.class.php @@ -200,58 +200,58 @@ class modHRM extends DolibarrModules $this->rights[$r][1] = 'Read skill/job/position'; // Permission label $this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][4] = 'all'; - $this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->read) + $this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->hrm->all->read) $r++; $this->rights[$r][0] = 4011; // Permission id (must not be already used) $this->rights[$r][1] = 'Create/modify skill/job/position'; // Permission label $this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][4] = 'all'; - $this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->write) + $this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->hrm->all->write) $r++; $this->rights[$r][0] = 4012; // Permission id (must not be already used) $this->rights[$r][1] = 'Delete skill/job/position'; // Permission label $this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][4] = 'all'; - $this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->delete) + $this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->hrm->all->delete) $r++; // Evaluation $this->rights[$r][0] = 4020; // Permission id (must not be already used) - $this->rights[$r][1] = 'Read evaluation'; // Permission label + $this->rights[$r][1] = 'Read evaluations'; // Permission label $this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][4] = 'evaluation'; - $this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->read) + $this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->hrm->evaluation->read) $r++; $this->rights[$r][0] = 4021; // Permission id (must not be already used) - $this->rights[$r][1] = 'Create/modify evaluation'; // Permission label + $this->rights[$r][1] = 'Create/modify your own evaluation'; // Permission label $this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][4] = 'evaluation'; - $this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->write) + $this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->hrm->evaluation->write) $r++; $this->rights[$r][0] = 4022; // Permission id (must not be already used) $this->rights[$r][1] = 'Validate evaluation'; // Permission label $this->rights[$r][3] = 0; // Permission by default for new user (0/1) - $this->rights[$r][4] = 'evaluation'; - $this->rights[$r][5] = 'validate'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->write) + $this->rights[$r][4] = 'evaluation_advance'; + $this->rights[$r][5] = 'validate'; // In php code, permission will be checked by test if ($user->rights->hrm->evaluation->validate) $r++; $this->rights[$r][0] = 4023; // Permission id (must not be already used) - $this->rights[$r][1] = 'Delete evaluation'; // Permission label + $this->rights[$r][1] = 'Delete all evaluations'; // Permission label $this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][4] = 'evaluation'; - $this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->delete) + $this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->hrm->evaluation->delete) $r++; // Comparison $this->rights[$r][0] = 4030; // Permission id (must not be already used) $this->rights[$r][1] = 'See comparison menu'; // Permission label $this->rights[$r][3] = 0; // Permission by default for new user (0/1) - $this->rights[$r][4] = 'compare'; - $this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->delete) + $this->rights[$r][4] = 'compare_advance'; + $this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->hrm->compare_advance->read) $r++; } From 92f9f3179e83db0de114191d463cfcdfedb705c8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 31 Oct 2021 13:56:19 +0100 Subject: [PATCH 1345/1460] Update list.php --- htdocs/product/stock/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index a86bc83982b..8125e5d3cf3 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -195,6 +195,7 @@ $now = dol_now(); $help_url = 'EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks'; $title = $langs->trans("ListOfWarehouses"); +$totalarray = array(); // Build and execute select // -------------------------------------------------------------------- From 0e2e8fe27fb453b34da4fe0fb22a744bddef6fc4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 31 Oct 2021 14:01:40 +0100 Subject: [PATCH 1346/1460] Update contact.php --- htdocs/compta/facture/contact.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php index 8395409cbd6..60fdeaf3e64 100644 --- a/htdocs/compta/facture/contact.php +++ b/htdocs/compta/facture/contact.php @@ -121,8 +121,7 @@ elseif ($action == 'deletecontact' && $user->rights->facture->creer) if (empty($object->id)) { llxHeader(); $langs->load('errors'); - echo '
    '.$langs->trans("ErrorRecordNotFound"); - echo ' '.$langs->trans('GoBack').'
    '; + echo '
    '.$langs->trans("ErrorRecordNotFound").'
    '; llxFooter(); exit; } From 65d59405da76a97d906fa49e54432d946ea71af6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 31 Oct 2021 14:01:56 +0100 Subject: [PATCH 1347/1460] Update document.php --- htdocs/compta/facture/document.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index e6cf3551738..33e651d833d 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -88,8 +88,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; if (empty($object->id)) { llxHeader(); $langs->load('errors'); - echo '
    '; + echo '
    '.$langs->trans("ErrorRecordNotFound").'
    '; llxFooter(); exit; } From 8dfe4fe05fb49e58309a3d02b92b0133a74c5b9d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 31 Oct 2021 14:02:14 +0100 Subject: [PATCH 1348/1460] Update note.php --- htdocs/compta/facture/note.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/compta/facture/note.php b/htdocs/compta/facture/note.php index 089d01b4a1f..8e2e8829d1a 100644 --- a/htdocs/compta/facture/note.php +++ b/htdocs/compta/facture/note.php @@ -67,8 +67,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, if (empty($object->id)) { llxHeader(); $langs->load('errors'); - echo '
    '; + echo '
    '.$langs->trans("ErrorRecordNotFound").'
    '; llxFooter(); exit; } From 3dcd1aa05d4f8bdde463a110bd3a4bfa71ec27dd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 31 Oct 2021 14:02:34 +0100 Subject: [PATCH 1349/1460] Update info.php --- htdocs/compta/facture/info.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/compta/facture/info.php b/htdocs/compta/facture/info.php index 51b2ce8f4e3..820793c14d7 100644 --- a/htdocs/compta/facture/info.php +++ b/htdocs/compta/facture/info.php @@ -46,8 +46,7 @@ $ref = GETPOST("ref", 'alpha'); if (empty($object->id)) { llxHeader(); $langs->load('errors'); - echo '
    '; + echo '
    '.$langs->trans("ErrorRecordNotFound").'
    '; llxFooter(); exit; } From dfc869842264d8efb638f02dfe32501d71843702 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 31 Oct 2021 14:16:18 +0100 Subject: [PATCH 1350/1460] Update replenish.php --- htdocs/product/stock/replenish.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index d531a7df05c..329df47ef2e 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -581,7 +581,7 @@ print dol_get_fiche_head($head, 'replenish', '', -1, ''); print ''.$langs->trans("ReplenishmentStatusDesc").''."\n"; -$link = '
    '.$langs->trans("MenuNewWarehouse").''; +$link = ''.$langs->trans("MenuNewWarehouse").''; print info_admin($langs->trans("ErrorAtLeastOneWarehouseNeededForReplenish") .' '. $link, 0, 0, 'info', 'clearboth'); if (empty($fk_warhouse) && !empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE)) { From 7773f8f01733bd4444284ea2912661ae0e952348 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 31 Oct 2021 14:20:30 +0100 Subject: [PATCH 1351/1460] Update replenish.php --- htdocs/product/stock/replenish.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 329df47ef2e..e536c8c52f7 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -580,9 +580,7 @@ print dol_get_fiche_head($head, 'replenish', '', -1, ''); print ''.$langs->trans("ReplenishmentStatusDesc").''."\n"; - -$link = ''.$langs->trans("MenuNewWarehouse").''; -print info_admin($langs->trans("ErrorAtLeastOneWarehouseNeededForReplenish") .' '. $link, 0, 0, 'info', 'clearboth'); +//$link = ''.$langs->trans("MenuNewWarehouse").''; if (empty($fk_warhouse) && !empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE)) { print ''.$langs->trans("ReplenishmentStatusDescPerWarehouse").''."\n"; From 480ad63c5d7f9dccb5d01732280aca2c40144f38 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 31 Oct 2021 14:21:01 +0100 Subject: [PATCH 1352/1460] Update stocks.lang --- htdocs/langs/en_US/stocks.lang | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index 03e0be4dec4..19655b2cc9e 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -256,4 +256,3 @@ AutofillWithExpected=Fill real quantity with expected quantity ShowAllBatchByDefault=By default, show batch details on product "stock" tab CollapseBatchDetailHelp=You can set batch detail default display in stocks module configuration FieldCannotBeNegative=Field "%s" cannot be negative -ErrorAtLeastOneWarehouseNeededForReplenish= Attention: You need to create at least one warehouse to use the replenish feature. From 13d3ff8ef70293905039691dfe8b56d07f750161 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 31 Oct 2021 14:22:14 +0100 Subject: [PATCH 1353/1460] Update replenish.php --- htdocs/product/stock/replenish.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index e536c8c52f7..1e348d01dee 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -359,7 +359,7 @@ $sql .= $hookmanager->resPrint; $sql .= ' FROM '.MAIN_DB_PREFIX.'product as p'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as s ON p.rowid = s.fk_product'; -$list_warehouse = empty($listofqualifiedwarehousesid) ? '0' :$listofqualifiedwarehousesid; +$list_warehouse = (empty($listofqualifiedwarehousesid) ? '0' : $listofqualifiedwarehousesid); $sql .= ' AND s.fk_entrepot IN ('.$db->sanitize($list_warehouse) .')'; //$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'entrepot AS ent ON s.fk_entrepot = ent.rowid AND ent.entity IN('.getEntity('stock').')'; From e6e440e573c32556dd3c28219be8e390d2d7e7eb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 31 Oct 2021 15:14:15 +0100 Subject: [PATCH 1354/1460] Fix #19257 error in the page Overview of a project --- htdocs/admin/stock.php | 20 ++++++++- htdocs/core/class/html.formprojet.class.php | 12 ++++- htdocs/langs/en_US/salaries.lang | 1 + htdocs/langs/en_US/stocks.lang | 1 + htdocs/projet/element.php | 48 ++++++++++---------- htdocs/salaries/card.php | 50 ++++++++++++++++++--- 6 files changed, 100 insertions(+), 32 deletions(-) diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index a4a9e91e3ff..e1fc7fc1d3a 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -683,6 +683,8 @@ if ($conf->use_javascript_ajax) { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); print $form->selectarray("SOCIETE_ASK_FOR_WAREHOUSE", $arrval, $conf->global->SOCIETE_ASK_FOR_WAREHOUSE); } +print ""; +print "\n"; print '
    '; print ''; @@ -693,6 +695,9 @@ if ($conf->use_javascript_ajax) { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); print $form->selectarray("WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL", $arrval, $conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL); } +print ""; +print "\n"; + print ''; print ''; print '"; print ''; print "\n"; +/* +print ''; +print ''; +print ''; +print "\n"; +*/ + print ''; print ''; // Owner From ad6f7e1a4887bad5ac91a257505d16d4af91309f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 31 Oct 2021 16:31:15 +0100 Subject: [PATCH 1359/1460] Default target is same window for a link on app, external if not defined --- htdocs/bookmarks/card.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index 289916a07c2..2637262a5e1 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -169,7 +169,11 @@ if ($action == 'create') { // Target print ''; // Owner From fb6a1d1f5119b73e227c17c825202e1a5e135244 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 31 Oct 2021 16:56:38 +0100 Subject: [PATCH 1360/1460] FIX #19210 --- htdocs/core/lib/functions.lib.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index d659c2b1916..eae8546a338 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2266,6 +2266,11 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs = { global $conf, $langs; + // If date undefined or "", we return "" + if (dol_strlen($time) == 0) { + return ''; // $time=0 allowed (it means 01/01/1970 00:00:00) + } + if ($tzoutput === 'auto') { $tzoutput = (empty($conf) ? 'tzserver' : (isset($conf->tzuserinputkey) ? $conf->tzuserinputkey : 'tzserver')); } @@ -2289,7 +2294,7 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs = $user_date_tz = new DateTimeZone($offsettzstring); $user_dt = new DateTime(); $user_dt->setTimezone($user_date_tz); - $user_dt->setTimestamp(($tzoutput == 'tzuser' || empty($time)) ? dol_now() : $time); + $user_dt->setTimestamp($tzoutput == 'tzuser' ? dol_now() : (int) $time); $offsettz = $user_dt->getOffset(); } else { // old method (The 'tzuser' was processed like the 'tzuserrel') $offsettz = (empty($_SESSION['dol_tz']) ? 0 : $_SESSION['dol_tz']) * 60 * 60; // Will not be used anymore @@ -2357,11 +2362,6 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs = $format = str_replace('yyyy', 'yy', $format); } - // If date undefined or "", we return "" - if (dol_strlen($time) == 0) { - return ''; // $time=0 allowed (it means 01/01/1970 00:00:00) - } - // Clean format if (preg_match('/%b/i', $format)) { // There is some text to translate // We inhibate translation to text made by strftime functions. We will use trans instead later. From 682ad989186f864ca2c0c3a2c51acefcb382e629 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 31 Oct 2021 17:06:37 +0100 Subject: [PATCH 1361/1460] Update security.lib.php --- htdocs/core/lib/security.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 852a87baa0b..475649701ae 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -489,12 +489,12 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f if (!$user->rights->fournisseur->commande->supprimer) { $deleteok = 0; } - } elseif ($feature == 'payment_supplier') { + } elseif ($feature == 'payment_supplier') { // Permission to delete a payment of an invoice is permission to edit an invoice. if (!$user->rights->fournisseur->facture->creer) { $deleteok = 0; } - } elseif ($feature == 'payment') { - if (!$user->rights->facture->supprimer) { + } elseif ($feature == 'payment') { // Permission to delete a payment of an invoice is permission to edit an invoice. + if (!$user->rights->facture->creer) { $deleteok = 0; } } elseif ($feature == 'banque') { From 0e4c113e7fcc167f9e7e60e51c316e35b7459595 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 31 Oct 2021 17:11:23 +0100 Subject: [PATCH 1362/1460] Fix phpcs --- htdocs/core/class/html.formticket.class.php | 2 +- htdocs/ticket/card.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 46df923704d..ebfd3802cc2 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -406,7 +406,7 @@ class FormTicket } } - if($subelement != 'project') { + if ($subelement != 'project') { if (!empty($conf->projet->enabled) && !$this->ispublic) { $formproject = new FormProjets($this->db); print '
    '.$langs->trans("WarehouseAskWarehouseDuringPropal").'
    '.$langs->trans("WarehouseAskWarehouseDuringOrder").''; @@ -702,10 +707,23 @@ if ($conf->use_javascript_ajax) { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); print $form->selectarray("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER", $arrval, $conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER); } -print "
    '.$langs->trans("WarehouseAskWarehouseDuringProject").''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('WAREHOUSE_ASK_WAREHOUSE_DURING_PROJECT'); +} else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("WAREHOUSE_ASK_WAREHOUSE_DURING_PROJECT", $arrval, $conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROJECT); +} +print '
    '; print $form->textwithpicto($langs->trans("StockSupportServices"), $langs->trans("StockSupportServicesDesc")); diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index 9696dca7183..d485720dab8 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -505,7 +505,17 @@ class FormProjets } $linkedtothirdparty = false; - if (!in_array($table_element, array('don', 'expensereport_det', 'expensereport', 'loan', 'stock_mouvement', 'payment_salary', 'payment_various', 'chargesociales', 'entrepot'))) { + if (!in_array($table_element, array( + 'don', + 'expensereport_det', + 'expensereport', 'loan', + 'stock_mouvement', + 'payment_salary', + 'payment_various', + 'salary', + 'chargesociales', + 'entrepot') + )) { $linkedtothirdparty = true; } diff --git a/htdocs/langs/en_US/salaries.lang b/htdocs/langs/en_US/salaries.lang index 504f0fbcc16..6397ed4c6d4 100644 --- a/htdocs/langs/en_US/salaries.lang +++ b/htdocs/langs/en_US/salaries.lang @@ -6,6 +6,7 @@ CREATE_NEW_SALARY_WITHOUT_AUTO_PAYMENT=By default, leave empty the option "Autom Salary=Salary Salaries=Salaries NewSalary=New salary +AddSalary=Add salary NewSalaryPayment=New salary card AddSalaryPayment=Add salary payment SalaryPayment=Salary payment diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index 19655b2cc9e..b373be27c35 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -63,6 +63,7 @@ RuleForWarehouse=Rule for warehouses WarehouseAskWarehouseOnThirparty=Set a warehouse on Third-parties WarehouseAskWarehouseDuringPropal=Set a warehouse on Commercial proposals WarehouseAskWarehouseDuringOrder=Set a warehouse on Sale orders +WarehouseAskWarehouseDuringProject=Set a warehouse on Projects UserDefaultWarehouse=Set a warehouse on Users MainDefaultWarehouse=Default warehouse MainDefaultWarehouseUser=Use a default warehouse for each user diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 7e03c3738cc..c805552d7a5 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -164,7 +164,7 @@ if ($id == '' && $ref == '') { exit(); } -$mine = $_REQUEST['mode'] == 'mine' ? 1 : 0; +$mine = GETPOST('mode') == 'mine' ? 1 : 0; //if (! $user->rights->projet->all->lire) $mine=1; // Special for projects $object = new Project($db); @@ -368,19 +368,19 @@ $listofreferent = array( 'class'=>'Entrepot', 'table'=>'entrepot', 'datefieldname'=>'date_entrepot', - 'urlnew'=>DOL_URL_ROOT.'/product/stock/card.php?action=create&projectid='.$id, + 'urlnew'=>DOL_URL_ROOT.'/product/stock/card.php?action=create&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), 'lang'=>'entrepot', 'buttonnew'=>'AddWarehouse', 'project_field'=>'fk_project', 'testnew'=>$user->rights->stock->creer, - 'test'=>$conf->stock->enabled && $user->rights->stock->lire), + 'test'=>$conf->stock->enabled && $user->rights->stock->lire && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROJECT)), 'propal'=>array( 'name'=>"Proposals", 'title'=>"ListProposalsAssociatedProject", 'class'=>'Propal', 'table'=>'propal', 'datefieldname'=>'datep', - 'urlnew'=>DOL_URL_ROOT.'/comm/propal/card.php?action=create&origin=project&originid='.$id.'&socid='.$socid, + 'urlnew'=>DOL_URL_ROOT.'/comm/propal/card.php?action=create&origin=project&originid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), 'lang'=>'propal', 'buttonnew'=>'AddProp', 'testnew'=>$user->rights->propal->creer, @@ -391,7 +391,7 @@ $listofreferent = array( 'class'=>'Commande', 'table'=>'commande', 'datefieldname'=>'date_commande', - 'urlnew'=>DOL_URL_ROOT.'/commande/card.php?action=create&projectid='.$id.'&socid='.$socid, + 'urlnew'=>DOL_URL_ROOT.'/commande/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), 'lang'=>'orders', 'buttonnew'=>'CreateOrder', 'testnew'=>$user->rights->commande->creer, @@ -403,7 +403,7 @@ $listofreferent = array( 'margin'=>'add', 'table'=>'facture', 'datefieldname'=>'datef', - 'urlnew'=>DOL_URL_ROOT.'/compta/facture/card.php?action=create&projectid='.$id.'&socid='.$socid, + 'urlnew'=>DOL_URL_ROOT.'/compta/facture/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), 'lang'=>'bills', 'buttonnew'=>'CreateBill', 'testnew'=>$user->rights->facture->creer, @@ -414,7 +414,7 @@ $listofreferent = array( 'class'=>'FactureRec', 'table'=>'facture_rec', 'datefieldname'=>'datec', - 'urlnew'=>DOL_URL_ROOT.'/compta/facture/card.php?action=create&projectid='.$id.'&socid='.$socid, + 'urlnew'=>DOL_URL_ROOT.'/compta/facture/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), 'lang'=>'bills', 'buttonnew'=>'CreateBill', 'testnew'=>$user->rights->facture->creer, @@ -425,7 +425,7 @@ $listofreferent = array( 'class'=>'SupplierProposal', 'table'=>'supplier_proposal', 'datefieldname'=>'date_valid', - 'urlnew'=>DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&projectid='.$id, // No socid parameter here, the socid is often the customer and we create a supplier object + 'urlnew'=>DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), // No socid parameter here, the socid is often the customer and we create a supplier object 'lang'=>'supplier_proposal', 'buttonnew'=>'AddSupplierProposal', 'testnew'=>$user->rights->supplier_proposal->creer, @@ -436,7 +436,7 @@ $listofreferent = array( 'class'=>'CommandeFournisseur', 'table'=>'commande_fournisseur', 'datefieldname'=>'date_commande', - 'urlnew'=>DOL_URL_ROOT.'/fourn/commande/card.php?action=create&projectid='.$id, // No socid parameter here, the socid is often the customer and we create a supplier object + 'urlnew'=>DOL_URL_ROOT.'/fourn/commande/card.php?action=create&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), // No socid parameter here, the socid is often the customer and we create a supplier object 'lang'=>'suppliers', 'buttonnew'=>'AddSupplierOrder', 'testnew'=>($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer), @@ -448,7 +448,7 @@ $listofreferent = array( 'margin'=>'minus', 'table'=>'facture_fourn', 'datefieldname'=>'datef', - 'urlnew'=>DOL_URL_ROOT.'/fourn/facture/card.php?action=create&projectid='.$id, // No socid parameter here, the socid is often the customer and we create a supplier object + 'urlnew'=>DOL_URL_ROOT.'/fourn/facture/card.php?action=create&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), // No socid parameter here, the socid is often the customer and we create a supplier object 'lang'=>'suppliers', 'buttonnew'=>'AddSupplierInvoice', 'testnew'=>($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer), @@ -459,7 +459,7 @@ $listofreferent = array( 'class'=>'Contrat', 'table'=>'contrat', 'datefieldname'=>'date_contrat', - 'urlnew'=>DOL_URL_ROOT.'/contrat/card.php?action=create&projectid='.$id.'&socid='.$socid, + 'urlnew'=>DOL_URL_ROOT.'/contrat/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), 'lang'=>'contracts', 'buttonnew'=>'AddContract', 'testnew'=>$user->rights->contrat->creer, @@ -472,7 +472,7 @@ $listofreferent = array( 'datefieldname'=>'date_valid', 'disableamount'=>0, 'margin'=>'minus', - 'urlnew'=>DOL_URL_ROOT.'/fichinter/card.php?action=create&origin=project&originid='.$id.'&socid='.$socid, + 'urlnew'=>DOL_URL_ROOT.'/fichinter/card.php?action=create&origin=project&originid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), 'lang'=>'interventions', 'buttonnew'=>'AddIntervention', 'testnew'=>$user->rights->ficheinter->creer, @@ -483,7 +483,7 @@ $listofreferent = array( 'class'=>'Expedition', 'table'=>'expedition', 'datefieldname'=>'date_valid', - 'urlnew'=>DOL_URL_ROOT.'/expedition/card.php?action=create&origin=project&originid='.$id.'&socid='.$socid, + 'urlnew'=>DOL_URL_ROOT.'/expedition/card.php?action=create&origin=project&originid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), 'lang'=>'sendings', 'buttonnew'=>'CreateShipment', 'testnew'=>0, @@ -494,7 +494,7 @@ $listofreferent = array( 'class'=>'Mo', 'table'=>'mrp_mo', 'datefieldname'=>'date_valid', - 'urlnew'=>DOL_URL_ROOT.'/mrp/mo_card.php?action=create&origin=project&originid='.$id.'&socid='.$socid, + 'urlnew'=>DOL_URL_ROOT.'/mrp/mo_card.php?action=create&origin=project&originid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), 'lang'=>'mrp', 'buttonnew'=>'CreateMO', 'testnew'=>'$user->rights->mrp->write', @@ -508,7 +508,7 @@ $listofreferent = array( 'datefieldname'=>'dated', 'margin'=>'minus', 'disableamount'=>1, - 'urlnew'=>DOL_URL_ROOT.'/deplacement/card.php?action=create&projectid='.$id.'&socid='.$socid, + 'urlnew'=>DOL_URL_ROOT.'/deplacement/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), 'lang'=>'trips', 'buttonnew'=>'AddTrip', 'testnew'=>$user->rights->deplacement->creer, @@ -521,7 +521,7 @@ $listofreferent = array( 'datefieldname'=>'date', 'margin'=>'minus', 'disableamount'=>0, - 'urlnew'=>DOL_URL_ROOT.'/expensereport/card.php?action=create&projectid='.$id.'&socid='.$socid, + 'urlnew'=>DOL_URL_ROOT.'/expensereport/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), 'lang'=>'trips', 'buttonnew'=>'AddTrip', 'testnew'=>$user->rights->expensereport->creer, @@ -534,7 +534,7 @@ $listofreferent = array( 'table'=>'don', 'datefieldname'=>'datedon', 'disableamount'=>0, - 'urlnew'=>DOL_URL_ROOT.'/don/card.php?action=create&projectid='.$id.'&socid='.$socid, + 'urlnew'=>DOL_URL_ROOT.'/don/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), 'lang'=>'donations', 'buttonnew'=>'AddDonation', 'testnew'=>$user->rights->don->creer, @@ -547,7 +547,7 @@ $listofreferent = array( 'table'=>'loan', 'datefieldname'=>'datestart', 'disableamount'=>0, - 'urlnew'=>DOL_URL_ROOT.'/loan/card.php?action=create&projectid='.$id.'&socid='.$socid, + 'urlnew'=>DOL_URL_ROOT.'/loan/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), 'lang'=>'loan', 'buttonnew'=>'AddLoan', 'testnew'=>$user->rights->loan->write, @@ -560,7 +560,7 @@ $listofreferent = array( 'table'=>'chargesociales', 'datefieldname'=>'date_ech', 'disableamount'=>0, - 'urlnew'=>DOL_URL_ROOT.'/compta/sociales/card.php?action=create&projectid='.$id, + 'urlnew'=>DOL_URL_ROOT.'/compta/sociales/card.php?action=create&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), 'lang'=>'compta', 'buttonnew'=>'AddSocialContribution', 'testnew'=>$user->rights->tax->charges->lire, @@ -573,7 +573,7 @@ $listofreferent = array( 'table'=>'projet_task', 'datefieldname'=>'task_date', 'disableamount'=>0, - 'urlnew'=>DOL_URL_ROOT.'/projet/tasks/time.php?withproject=1&action=createtime&projectid='.$id, + 'urlnew'=>DOL_URL_ROOT.'/projet/tasks/time.php?withproject=1&action=createtime&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), 'buttonnew'=>'AddTimeSpent', 'testnew'=>$user->rights->projet->creer, 'test'=>($conf->projet->enabled && $user->rights->projet->lire && empty($conf->global->PROJECT_HIDE_TASKS))), @@ -594,9 +594,9 @@ $listofreferent = array( 'datefieldname'=>'datesp', 'margin'=>'minus', 'disableamount'=>0, - 'urlnew'=>DOL_URL_ROOT.'/salaries/card.php?action=create&projectid='.$id, + 'urlnew'=>DOL_URL_ROOT.'/salaries/card.php?action=create&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), 'lang'=>'salaries', - 'buttonnew'=>'AddSalaryPayment', + 'buttonnew'=>'AddSalary', 'testnew'=>$user->rights->salaries->write, 'test'=>$conf->salaries->enabled && $user->rights->salaries->read), 'variouspayment'=>array( @@ -607,7 +607,7 @@ $listofreferent = array( 'datefieldname'=>'datev', 'margin'=>'minus', 'disableamount'=>0, - 'urlnew'=>DOL_URL_ROOT.'/compta/bank/various_payment/card.php?action=create&projectid='.$id, + 'urlnew'=>DOL_URL_ROOT.'/compta/bank/various_payment/card.php?action=create&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), 'lang'=>'banks', 'buttonnew'=>'AddVariousPayment', 'testnew'=>$user->rights->banque->modifier, @@ -620,7 +620,7 @@ $listofreferent = array( 'table'=>'actioncomm', 'datefieldname'=>'datep', 'disableamount'=>1, - 'urlnew'=>DOL_URL_ROOT.'/comm/action/card.php?action=create&projectid='.$id.'&socid='.$socid, + 'urlnew'=>DOL_URL_ROOT.'/comm/action/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), 'lang'=>'agenda', 'buttonnew'=>'AddEvent', 'testnew'=>$user->rights->agenda->myactions->create, diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index 486b4fd70ea..f5ebbcf0ec6 100755 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -48,6 +48,9 @@ $id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); +$backtopage = GETPOST('backtopage', 'alpha'); +$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); + $accountid = GETPOST('accountid', 'int') > 0 ? GETPOST('accountid', 'int') : 0; $projectid = (GETPOST('projectid', 'int') ? GETPOST('projectid', 'int') : GETPOST('fk_project', 'int')); $confirm = GETPOST('confirm'); @@ -75,7 +78,6 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('salarycard', 'globalcard')); -$object = new Salary($db); if ($id > 0 || !empty($ref)) { $object->fetch($id, $ref); @@ -97,6 +99,7 @@ $socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } + restrictedArea($user, 'salaries', $object->id, 'salary', ''); @@ -104,9 +107,39 @@ restrictedArea($user, 'salaries', $object->id, 'salary', ''); * Actions */ -if ($cancel) { - header("Location: list.php"); - exit; +$parameters = array(); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + +if (empty($reshook)) { + $error = 0; + + $backurlforlist = dol_buildpath('/salaries/list.php', 1); + + if (empty($backtopage) || ($cancel && empty($id))) { + if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { + if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { + $backtopage = $backurlforlist; + } else { + $backtopage = dol_buildpath('/salaries/card.php', 1).'?id='.($id > 0 ? $id : '__ID__'); + } + } + } + + if ($cancel) { + /*var_dump($cancel); + var_dump($backtopage);exit;*/ + if (!empty($backtopageforcancel)) { + header("Location: ".$backtopageforcancel); + exit; + } elseif (!empty($backtopage)) { + header("Location: ".$backtopage); + exit; + } + $action = ''; + } } // Link to a project @@ -404,8 +437,7 @@ llxHeader("", $title, $help_url); $form = new Form($db); if (!empty($conf->projet->enabled)) $formproject = new FormProjets($db); -if ($id) { - $object = new Salary($db); +if ($id > 0) { $result = $object->fetch($id); if ($result <= 0) { dol_print_error($db); @@ -439,6 +471,12 @@ if ($action == 'create') { print ''; print ''; print ''; + if ($backtopage) { + print ''; + } + if ($backtopageforcancel) { + print ''; + } print load_fiche_titre($langs->trans("NewSalary"), '', 'salary'); From 41b8c92311f37172436886394bec319f8354d6f3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 31 Oct 2021 15:16:40 +0100 Subject: [PATCH 1355/1460] Update card.php --- htdocs/holiday/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 045c370de8e..e84fb79c7e3 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -1541,7 +1541,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') { //$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); - print '
    '; + print '
    '; $MAXEVENT = 10; @@ -1550,7 +1550,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') { $formactions = new FormActions($db); $somethingshown = $formactions->showactions($object, $object->element, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlright); - print '
    '; + print ''; } } } From 4f2cd2ba188b12d56063098264706fd0b82f4434 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 31 Oct 2021 15:59:03 +0100 Subject: [PATCH 1356/1460] FIx #19227 --- htdocs/core/lib/functions.lib.php | 20 ++++++++++++++------ test/phpunit/SecurityTest.php | 4 ++++ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 084a4a4f25a..1c533f0e686 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -108,6 +108,10 @@ function getEntity($element, $shared = 1, $currentobject = null) { global $conf, $mc, $hookmanager, $object, $action; + if (! is_object($hookmanager)) { + $hookmanager = new HookManager($db); + } + // fix different element names (France to English) switch ($element) { case 'contrat': @@ -8151,16 +8155,20 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1) return 'Bad string syntax to evaluate: '.$s; } - // We block using of php exec or php file functions - $forbiddenphpstrings = array("exec(", "passthru(", "shell_exec(", "system(", "proc_open(", "popen(", "eval(", "dol_eval(", "executeCLI("); - $forbiddenphpstrings = array_merge($forbiddenphpstrings, array("fopen(", "file_put_contents(", "fputs(", "fputscsv(", "fwrite(", "fpassthru(", "unlink(", "mkdir(", "rmdir(", "symlink(", "touch(", "umask(")); - $forbiddenphpstrings = array_merge($forbiddenphpstrings, array('function(', '$$', 'call_user_func(')); + // We block use of php exec or php file functions + $forbiddenphpstrings = array('$$'); $forbiddenphpstrings = array_merge($forbiddenphpstrings, array('_ENV', '_SESSION', '_COOKIE', '_GET', '_POST', '_REQUEST')); - $forbiddenphpregex = 'global\s+\$'; + + $forbiddenphpfunctions = array("exec", "passthru", "shell_exec", "system", "proc_open", "popen", "eval", "dol_eval", "executeCLI"); + $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("fopen", "file_put_contents", "fputs", "fputscsv", "fwrite", "fpassthru", "unlink", "mkdir", "rmdir", "symlink", "touch", "umask")); + $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("function", "call_user_func")); + + $forbiddenphpregex = 'global\s+\$|\b('.implode('|', $forbiddenphpfunctions).')\b'; + do { $oldstringtoclean = $s; $s = str_ireplace($forbiddenphpstrings, '__forbiddenstring__', $s); - $s = preg_replace('/'.$forbiddenphpregex.'/', '__forbiddenstring__', $s); + $s = preg_replace('/'.$forbiddenphpregex.'/i', '__forbiddenstring__', $s); //$s = preg_replace('/\$[a-zA-Z0-9_\->\$]+\(/i', '', $s); // Remove $function( call and $mycall->mymethod( } while ($oldstringtoclean != $s); diff --git a/test/phpunit/SecurityTest.php b/test/phpunit/SecurityTest.php index 81eff830b49..fe091b0fe47 100644 --- a/test/phpunit/SecurityTest.php +++ b/test/phpunit/SecurityTest.php @@ -874,6 +874,10 @@ class SecurityTest extends PHPUnit\Framework\TestCase print "result = ".$result."\n"; $this->assertContains('Bad string syntax to evaluate', $result); + $result=dol_eval('$a=exec ("ls")', 1, 1); + print "result = ".$result."\n"; + $this->assertContains('Bad string syntax to evaluate', $result); + $result=dol_eval('$a="test"; $$a;', 1, 0); print "result = ".$result."\n"; $this->assertContains('Bad string syntax to evaluate', $result); From d4107fcc4e324267ed872f7f4da07c123c01ba80 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 31 Oct 2021 16:14:13 +0100 Subject: [PATCH 1357/1460] Fix wrong column name --- htdocs/install/mysql/tables/llx_element_tag.key.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/tables/llx_element_tag.key.sql b/htdocs/install/mysql/tables/llx_element_tag.key.sql index fc1e3e7861d..e4af1c3871e 100644 --- a/htdocs/install/mysql/tables/llx_element_tag.key.sql +++ b/htdocs/install/mysql/tables/llx_element_tag.key.sql @@ -16,8 +16,8 @@ -- -- ============================================================================ -ALTER TABLE llx_element_tag ADD PRIMARY KEY pk_element_tag (fk_categorie, fk_socpeople); +ALTER TABLE llx_element_tag ADD PRIMARY KEY pk_element_tag (fk_categorie, fk_element); ALTER TABLE llx_element_tag ADD INDEX idx_element_tag_fk_categorie (fk_categorie); -ALTER TABLE llx_element_tag ADD INDEX idx_element_tag_fk_socpeople (fk_socpeople); +ALTER TABLE llx_element_tag ADD INDEX idx_element_tag_fk_element (fk_element); ALTER TABLE llx_element_tag ADD CONSTRAINT fk_element_tag_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid); From 9989180c5fb6c3fe49a7f0753a26bbe27a59f9bf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 31 Oct 2021 16:25:29 +0100 Subject: [PATCH 1358/1460] Fix target is lost --- htdocs/bookmarks/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index 1094eabf0c6..bfad54b361a 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -169,7 +169,7 @@ if ($action == 'create') { // Target print '
    '.$langs->trans("BehaviourOnClick").''; $liste = array(0=>$langs->trans("ReplaceWindow"), 1=>$langs->trans("OpenANewWindow")); - print $form->selectarray('target', $liste, 1); + print $form->selectarray('target', $liste, GETPOSTISSET('target') ? GETPOST('target', 'int') : 1); print ''.$langs->trans("ChooseIfANewWindowMustBeOpenedOnClickOnBookmark").'
    '.$langs->trans("BehaviourOnClick").''; $liste = array(0=>$langs->trans("ReplaceWindow"), 1=>$langs->trans("OpenANewWindow")); - print $form->selectarray('target', $liste, GETPOSTISSET('target') ? GETPOST('target', 'int') : 1, 0, 0, 0, '', 0, 0, 0, '', 'maxwidth300'); + $defaulttarget = 1; + if ($url && !preg_match('/^http/i', $url)) { + $defaulttarget = 0; + } + print $form->selectarray('target', $liste, GETPOSTISSET('target') ? GETPOST('target', 'int') : $defaulttarget, 0, 0, 0, '', 0, 0, 0, '', 'maxwidth300'); print ''.$langs->trans("ChooseIfANewWindowMustBeOpenedOnClickOnBookmark").'
    '; diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index d59369a07ff..380d85be94c 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -200,7 +200,7 @@ if (empty($reshook)) { } // Link ticket to project - if(GETPOST('origin', 'alpha') == 'projet') { + if (GETPOST('origin', 'alpha') == 'projet') { $projectid = GETPOST('originid', 'int'); } else { $projectid = GETPOST('projectid', 'int'); From dbf330b49c252b4f57805b04ecf76daeacd2c340 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 31 Oct 2021 17:17:21 +0100 Subject: [PATCH 1363/1460] Comment on test --- test/phpunit/DateLibTzFranceTest.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/phpunit/DateLibTzFranceTest.php b/test/phpunit/DateLibTzFranceTest.php index 4b63450c332..0db809be2f7 100644 --- a/test/phpunit/DateLibTzFranceTest.php +++ b/test/phpunit/DateLibTzFranceTest.php @@ -83,7 +83,10 @@ class DateLibTzFranceTest extends PHPUnit\Framework\TestCase global $conf,$user,$langs,$db; if (getServerTimeZoneString() != 'Europe/Paris' && getServerTimeZoneString() != 'Europe/Berlin') { - print "\n".__METHOD__." This PHPUnit test can be launched manually only onto a server with PHP timezone set to TZ=Europe/Paris, not a TZ=".getServerTimeZoneString().".\n"; die(1); + print "\n".__METHOD__." This PHPUnit test can be launched manually only onto a server with PHP timezone set to TZ=Europe/Paris, not a TZ=".getServerTimeZoneString().".\n"; + print "You can launch the test from command line with:\n"; + print "php -d date.timezone='Europe/Paris' phpunit DateLibTzFranceTest.php\n"; + die(1); } $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. From df5b2b67284950e5ab2c5ddea095efe946b1a3d1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 31 Oct 2021 17:36:56 +0100 Subject: [PATCH 1364/1460] Update viewcat.php --- htdocs/categories/viewcat.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index d6b663a8804..5912d63c7cf 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -795,7 +795,7 @@ if ($type == Categorie::TYPE_CONTACT) { $permission = $user->rights->societe->creer; $contacts = $object->getObjectsInCateg($type, 0, $limit, $offset); - if (!is_array($contacts) && $contacts < 0) { + if (is_numeric($contacts) && $contacts < 0) { dol_print_error($db, $object->error, $object->errors); } else { // Form to add record into a category From cee573cf96094cee86453f0553cb542573d502dd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 31 Oct 2021 17:42:43 +0100 Subject: [PATCH 1365/1460] Update ProductCombination.class.php --- htdocs/variants/class/ProductCombination.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/variants/class/ProductCombination.class.php b/htdocs/variants/class/ProductCombination.class.php index 10318f11a46..336503056f9 100644 --- a/htdocs/variants/class/ProductCombination.class.php +++ b/htdocs/variants/class/ProductCombination.class.php @@ -509,7 +509,7 @@ class ProductCombination for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) { if ($parent->multiprices[$i] != '' || isset($this->combination_price_levels[$i]->variation_price)) { - $new_type = !empty($parent->multiprices_base_type[$i]) ? $parent->multiprices_base_type[$i] : 'HT'; + $new_type = empty($parent->multiprices_base_type[$i]) ? 'HT' : $parent->multiprices_base_type[$i]; $new_min_price = $parent->multiprices_min[$i]; $variation_price = doubleval(!isset($this->combination_price_levels[$i]->variation_price) ? $this->variation_price : $this->combination_price_levels[$i]->variation_price); $variation_price_percentage = doubleval(!isset($this->combination_price_levels[$i]->variation_price_percentage) ? $this->variation_price_percentage : $this->combination_price_levels[$i]->variation_price_percentage); From 8ce70aac5d9bec2161d2a73bd40f0dae0b3eb7ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 31 Oct 2021 18:43:11 +0100 Subject: [PATCH 1366/1460] display spf info from dns --- htdocs/admin/mails.php | 15 +++++++++++++-- htdocs/langs/en_US/admin.lang | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 1283c5698d3..acfafcf9370 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -848,8 +848,19 @@ if ($action == 'edit') { $text .= ($text ? '

    ' : '').''.$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD); } } - - + $companyemail = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL'); + $dnsinfo = false; + if (!empty($companyemail)) { + $domain = array_pop(explode('@', $companyemail)); + $dnsinfo = dns_get_record($domain, DNS_TXT); + } + if (!empty($dnsinfo) && is_array($dnsinfo)) { + foreach ($dnsinfo as $info) { + if (strpos($info['txt'], 'v=spf1') !== false) { + $text .= ($text ? '

    ' : '').$langs->trans("ActualMailSPFRecordFound", $info['txt']); + } + } + } if ($text) { print info_admin($text); } diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index d9099f567fa..4ff9f693cf7 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -501,6 +501,7 @@ WarningPHPMailC=- Using the SMTP server of your own Email Service Provider to se WarningPHPMailD=Also, it is therefore recommended to change the sending method of e-mails to the value "SMTP". If you really want to keep the default "PHP" method to send emails, just ignore this warning, or remove it by setting the MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP constant to 1 in Home - Setup - Other. WarningPHPMail2=If your email SMTP provider need to restrict email client to some IP addresses (very rare), this is the IP address of the mail user agent (MUA) for your ERP CRM application: %s. WarningPHPMailSPF=If the domain name in your sender email address is protected by a SPF record (ask your domain name registar), you must add the following IPs in the SPF record of the DNS of your domain: %s. +ActualMailSPFRecordFound=Actual SPF record found : %s ClickToShowDescription=Click to show description DependsOn=This module needs the module(s) RequiredBy=This module is required by module(s) From 7d60cddaac4f6b2cee06fb7a63c99e79eca1d1d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 31 Oct 2021 19:36:31 +0100 Subject: [PATCH 1367/1460] fix warning same test at line 65 --- htdocs/core/tpl/object_discounts.tpl.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/tpl/object_discounts.tpl.php b/htdocs/core/tpl/object_discounts.tpl.php index df565aea6f9..38e1967c11b 100644 --- a/htdocs/core/tpl/object_discounts.tpl.php +++ b/htdocs/core/tpl/object_discounts.tpl.php @@ -1,5 +1,6 @@ + * Copyright (C) 2021 Frédéric France * * 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 @@ -88,7 +89,7 @@ if ($absolute_discount > 0) { // Is there credit notes availables ? if ($absolute_creditnote > 0) { // If validated, we show link "add credit note to payment" - if ($cannotApplyDiscount || !$isInvoice || $isNewObject || $object->statut != $objclassname::STATUS_VALIDATED || $object->type == $objclassname::TYPE_CREDIT_NOTE) { + if (!empty($cannotApplyDiscount) || !$isInvoice || $isNewObject || $object->statut != $objclassname::STATUS_VALIDATED || $object->type == $objclassname::TYPE_CREDIT_NOTE) { $translationKey = !empty($discount_type) ? 'HasCreditNoteFromSupplier' : 'CompanyHasCreditNote'; $text = $langs->trans($translationKey, price($absolute_creditnote), $langs->transnoentities("Currency".$conf->currency)).'.'; From 033d983f051900f0e6f00429af9c246d4a3afc87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 31 Oct 2021 20:41:07 +0100 Subject: [PATCH 1368/1460] fix warning --- htdocs/knowledgemanagement/knowledgerecord_list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index d4a702f26b8..c2e26fb7a86 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -1,6 +1,6 @@ - * Copyright (C) ---Put here your own copyright and developer email--- + * Copyright (C) 2021 Frédéric France * * 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 @@ -104,7 +104,7 @@ foreach ($object->fields as $key => $val) { // List of fields to search into when doing a "search in all" $fieldstosearchall = array(); foreach ($object->fields as $key => $val) { - if ($val['searchall']) { + if (!empty($val['searchall'])) { $fieldstosearchall['t.'.$key] = $val['label']; } } From af8f74103a0b9401c1906bb57f60aa07ca8515c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 31 Oct 2021 20:48:13 +0100 Subject: [PATCH 1369/1460] Update knowledgerecord_list.php --- htdocs/knowledgemanagement/knowledgerecord_list.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index c2e26fb7a86..aed45b1db26 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -444,6 +444,7 @@ print ''; foreach ($object->fields as $key => $val) { + $searchkey = empty($search[$key]) ? '' : $search[$key]; $cssforfield = (empty($val['css']) ? '' : $val['css']); if ($key == 'status') { $cssforfield .= ($cssforfield ? ' ' : '').'center'; @@ -458,9 +459,9 @@ foreach ($object->fields as $key => $val) { print ''; } @@ -522,7 +523,7 @@ print ''."\n"; // Detect if we need a fetch on each output line $needToFetchEachLine = 0; -if (is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { +if (!empty($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) { if (preg_match('/\$object/', $val)) { $needToFetchEachLine++; // There is at least one compute field that use $object From bc972554c6a254c3aee643cd43cd9dda48c3d156 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 31 Oct 2021 21:13:15 +0100 Subject: [PATCH 1370/1460] replace reseved word rank --- .../install/mysql/migration/14.0.0-15.0.0.sql | 189 +++++++++--------- .../mysql/tables/llx_hrm_evaluationdet.sql | 23 +-- .../install/mysql/tables/llx_hrm_skilldet.sql | 14 +- .../mysql/tables/llx_hrm_skillrank.sql | 19 +- 4 files changed, 116 insertions(+), 129 deletions(-) diff --git a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql index d25f039fd42..3e71d0f6d65 100644 --- a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql +++ b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql @@ -157,24 +157,23 @@ INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2012', ' -- START GRH/HRM MODULE -CREATE TABLE llx_hrm_evaluation( - -- BEGIN MODULEBUILDER FIELDS - rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, - ref varchar(128) DEFAULT '(PROV)' NOT NULL, - label varchar(255), - description text, - note_public text, - note_private text, - date_creation datetime NOT NULL, - tms timestamp, - fk_user_creat integer NOT NULL, - fk_user_modif integer, - import_key varchar(14), - status smallint NOT NULL, - date_eval date, - fk_user integer NOT NULL, - fk_job integer NOT NULL - -- END MODULEBUILDER FIELDS +CREATE TABLE llx_hrm_evaluation +( + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + ref varchar(128) DEFAULT '(PROV)' NOT NULL, + label varchar(255), + description text, + note_public text, + note_private text, + date_creation datetime NOT NULL, + tms timestamp, + fk_user_creat integer NOT NULL, + fk_user_modif integer, + import_key varchar(14), + status smallint NOT NULL, + date_eval date, + fk_user integer NOT NULL, + fk_job integer NOT NULL ) ENGINE=innodb; ALTER TABLE llx_hrm_evaluation ADD INDEX idx_hrm_evaluation_rowid (rowid); ALTER TABLE llx_hrm_evaluation ADD INDEX idx_hrm_evaluation_ref (ref); @@ -193,19 +192,19 @@ create table llx_hrm_evaluation_extrafields ALTER TABLE llx_hrm_evaluation_extrafields ADD INDEX idx_evaluation_fk_object(fk_object); -CREATE TABLE llx_hrm_evaluationdet( +CREATE TABLE llx_hrm_evaluationdet +( -- BEGIN MODULEBUILDER FIELDS - rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, - date_creation datetime NOT NULL, - tms timestamp, - fk_user_creat integer NOT NULL, - fk_user_modif integer, - fk_skill integer NOT NULL, - fk_evaluation integer NOT NULL, - rank integer NOT NULL, - required_rank integer NOT NULL, - import_key varchar(14) - -- END MODULEBUILDER FIELDS + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + date_creation datetime NOT NULL, + tms timestamp, + fk_user_creat integer NOT NULL, + fk_user_modif integer, + fk_skill integer NOT NULL, + fk_evaluation integer NOT NULL, + rankorder integer NOT NULL, + required_rank integer NOT NULL, + import_key varchar(14) ) ENGINE=innodb; ALTER TABLE llx_hrm_evaluationdet ADD INDEX idx_hrm_evaluationdet_rowid (rowid); @@ -226,20 +225,18 @@ ALTER TABLE llx_hrm_evaluationdet_extrafields ADD INDEX idx_evaluationdet_fk_obj - -CREATE TABLE llx_hrm_job( - - rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, - label varchar(255) NOT NULL, - description text, - date_creation datetime NOT NULL, - tms timestamp, - deplacement varchar(255), - note_public text, - note_private text, - fk_user_creat integer, - fk_user_modif integer - +CREATE TABLE llx_hrm_job +( + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + label varchar(255) NOT NULL, + description text, + date_creation datetime NOT NULL, + tms timestamp, + deplacement varchar(255), + note_public text, + note_private text, + fk_user_creat integer, + fk_user_modif integer ) ENGINE=innodb; ALTER TABLE llx_hrm_job ADD INDEX idx_hrm_job_rowid (rowid); @@ -259,23 +256,21 @@ ALTER TABLE llx_hrm_job_extrafields ADD INDEX idx_job_fk_object(fk_object); CREATE TABLE llx_hrm_job_user( - -- BEGIN MODULEBUILDER FIELDS - rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, - -- ref varchar(128) NOT NULL, - description text, - date_creation datetime NOT NULL, - tms timestamp, - fk_contrat integer, - fk_user integer NOT NULL, - fk_job integer NOT NULL, - date_start date, - date_end date, - commentaire_abandon varchar(255), - note_public text, - note_private text, - fk_user_creat integer, - fk_user_modif integer - -- END MODULEBUILDER FIELDS + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + -- ref varchar(128) NOT NULL, + description text, + date_creation datetime NOT NULL, + tms timestamp, + fk_contrat integer, + fk_user integer NOT NULL, + fk_job integer NOT NULL, + date_start date, + date_end date, + commentaire_abandon varchar(255), + note_public text, + note_private text, + fk_user_creat integer, + fk_user_modif integer ) ENGINE=innodb; ALTER TABLE llx_hrm_job_user ADD INDEX idx_hrm_job_user_rowid (rowid); @@ -294,22 +289,21 @@ ALTER TABLE llx_hrm_job_user_extrafields ADD INDEX idx_position_fk_object(fk_obj -CREATE TABLE llx_hrm_skill( - -- BEGIN MODULEBUILDER FIELDS - rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, - label varchar(255), - description text, - date_creation datetime NOT NULL, - tms timestamp, - fk_user_creat integer NOT NULL, - fk_user_modif integer, - required_level integer NOT NULL, - date_validite integer NOT NULL, - temps_theorique double(24,8) NOT NULL, - skill_type integer NOT NULL, - note_public text, - note_private text - -- END MODULEBUILDER FIELDS +CREATE TABLE llx_hrm_skill +( + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + label varchar(255), + description text, + date_creation datetime NOT NULL, + tms timestamp, + fk_user_creat integer NOT NULL, + fk_user_modif integer, + required_level integer NOT NULL, + date_validite integer NOT NULL, + temps_theorique double(24,8) NOT NULL, + skill_type integer NOT NULL, + note_public text, + note_private text ) ENGINE=innodb; ALTER TABLE llx_hrm_skill ADD INDEX idx_hrm_skill_rowid (rowid); @@ -327,15 +321,14 @@ create table llx_hrm_skill_extrafields ALTER TABLE llx_hrm_skill_extrafields ADD INDEX idx_skill_fk_object(fk_object); -CREATE TABLE llx_hrm_skilldet( - -- BEGIN MODULEBUILDER FIELDS - rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, - description text, - fk_user_creat integer NOT NULL, - fk_user_modif integer, - fk_skill integer NOT NULL, - rank integer - -- END MODULEBUILDER FIELDS +CREATE TABLE llx_hrm_skilldet +( + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + description text, + fk_user_creat integer NOT NULL, + fk_user_modif integer, + fk_skill integer NOT NULL, + rankorder integer ) ENGINE=innodb; ALTER TABLE llx_hrm_skilldet ADD INDEX idx_hrm_skilldet_rowid (rowid); @@ -352,18 +345,17 @@ create table llx_hrm_skilldet_extrafields ALTER TABLE llx_hrm_skilldet_extrafields ADD INDEX idx_skilldet_fk_object(fk_object); -CREATE TABLE llx_hrm_skillrank( - -- BEGIN MODULEBUILDER FIELDS - rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, - fk_skill integer NOT NULL, - rank integer NOT NULL, - fk_object integer NOT NULL, - date_creation datetime NOT NULL, - tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - fk_user_creat integer NOT NULL, - fk_user_modif integer, - objecttype varchar(128) NOT NULL - -- END MODULEBUILDER FIELDS +CREATE TABLE llx_hrm_skillrank +( + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + fk_skill integer NOT NULL, + rankorder integer NOT NULL, + fk_object integer NOT NULL, + date_creation datetime NOT NULL, + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + fk_user_creat integer NOT NULL, + fk_user_modif integer, + objecttype varchar(128) NOT NULL ) ENGINE=innodb; ALTER TABLE llx_hrm_skillrank ADD INDEX idx_hrm_skillrank_rowid (rowid); @@ -429,4 +421,3 @@ ALTER TABLE llx_socpeople DROP COLUMN googleplus; ALTER TABLE llx_socpeople DROP COLUMN youtube; ALTER TABLE llx_socpeople DROP COLUMN whatsapp; - \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_hrm_evaluationdet.sql b/htdocs/install/mysql/tables/llx_hrm_evaluationdet.sql index 0509cc80146..4e1b3860ec8 100644 --- a/htdocs/install/mysql/tables/llx_hrm_evaluationdet.sql +++ b/htdocs/install/mysql/tables/llx_hrm_evaluationdet.sql @@ -16,17 +16,16 @@ -- along with this program. If not, see https://www.gnu.org/licenses/. -CREATE TABLE llx_hrm_evaluationdet( - -- BEGIN MODULEBUILDER FIELDS - rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, - date_creation datetime NOT NULL, - tms timestamp, - fk_user_creat integer NOT NULL, - fk_user_modif integer, - fk_skill integer NOT NULL, - fk_evaluation integer NOT NULL, - rank integer NOT NULL, - required_rank integer NOT NULL, +CREATE TABLE llx_hrm_evaluationdet +( + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + date_creation datetime NOT NULL, + tms timestamp, + fk_user_creat integer NOT NULL, + fk_user_modif integer, + fk_skill integer NOT NULL, + fk_evaluation integer NOT NULL, + rankorder integer NOT NULL, + required_rank integer NOT NULL, import_key varchar(14) - -- END MODULEBUILDER FIELDS ) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_hrm_skilldet.sql b/htdocs/install/mysql/tables/llx_hrm_skilldet.sql index fba82645915..0257d886813 100644 --- a/htdocs/install/mysql/tables/llx_hrm_skilldet.sql +++ b/htdocs/install/mysql/tables/llx_hrm_skilldet.sql @@ -17,12 +17,10 @@ CREATE TABLE llx_hrm_skilldet( - -- BEGIN MODULEBUILDER FIELDS - rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, - description text, - fk_user_creat integer NOT NULL, - fk_user_modif integer, - fk_skill integer NOT NULL, - rank integer - -- END MODULEBUILDER FIELDS + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + description text, + fk_user_creat integer NOT NULL, + fk_user_modif integer, + fk_skill integer NOT NULL, + rankorder integer ) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_hrm_skillrank.sql b/htdocs/install/mysql/tables/llx_hrm_skillrank.sql index 5c4deb95938..4c4109ee7f7 100644 --- a/htdocs/install/mysql/tables/llx_hrm_skillrank.sql +++ b/htdocs/install/mysql/tables/llx_hrm_skillrank.sql @@ -15,16 +15,15 @@ -- along with this program. If not, see https://www.gnu.org/licenses/. -CREATE TABLE llx_hrm_skillrank( - -- BEGIN MODULEBUILDER FIELDS - rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, - fk_skill integer NOT NULL, - rank integer NOT NULL, - fk_object integer NOT NULL, - date_creation datetime NOT NULL, +CREATE TABLE llx_hrm_skillrank +( + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + fk_skill integer NOT NULL, + rankorder integer NOT NULL, + fk_object integer NOT NULL, + date_creation datetime NOT NULL, tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - fk_user_creat integer NOT NULL, - fk_user_modif integer, + fk_user_creat integer NOT NULL, + fk_user_modif integer, objecttype varchar(128) NOT NULL - -- END MODULEBUILDER FIELDS ) ENGINE=innodb; From 9a68a97fc60c6c1869194d308ccc935a795803c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 31 Oct 2021 21:18:59 +0100 Subject: [PATCH 1371/1460] replace commentaire_abandon by abort_comment --- htdocs/hrm/class/position.class.php | 4 ++-- .../install/mysql/migration/14.0.0-15.0.0.sql | 2 +- .../install/mysql/tables/llx_hrm_job_user.sql | 20 +++++++++---------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/htdocs/hrm/class/position.class.php b/htdocs/hrm/class/position.class.php index 2a0d04fe393..26298c31aa7 100644 --- a/htdocs/hrm/class/position.class.php +++ b/htdocs/hrm/class/position.class.php @@ -113,7 +113,7 @@ class Position extends CommonObject 'fk_job' => array('type'=>'integer:Job:/hrm/class/job.class.php', 'label'=>'Job', 'enabled'=>'1', 'position'=>56, 'notnull'=>1, 'visible'=>1,), 'date_start' => array('type'=>'date', 'label'=>'DateStart', 'enabled'=>'1', 'position'=>51, 'notnull'=>1, 'visible'=>1,), 'date_end' => array('type'=>'date', 'label'=>'DateEnd', 'enabled'=>'1', 'position'=>52, 'notnull'=>0, 'visible'=>1,), - 'commentaire_abandon' => array('type'=>'varchar(255)', 'label'=>'AbandonmentComment', 'enabled'=>'1', 'position'=>502, 'notnull'=>0, 'visible'=>1,), + 'abort_comment' => array('type'=>'varchar(255)', 'label'=>'AbandonmentComment', 'enabled'=>'1', 'position'=>502, 'notnull'=>0, 'visible'=>1,), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>70, 'notnull'=>0, 'visible'=>0,), 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>71, 'notnull'=>0, 'visible'=>0,), 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>'1', 'position'=>510, 'notnull'=>1, 'visible'=>-2, 'foreignkey'=>'user.rowid',), @@ -129,7 +129,7 @@ class Position extends CommonObject public $fk_job; public $date_start; public $date_end; - public $commentaire_abandon; + public $abort_comment; public $note_public; public $note_private; public $fk_user_creat; diff --git a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql index 3e71d0f6d65..6e751280a28 100644 --- a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql +++ b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql @@ -266,7 +266,7 @@ CREATE TABLE llx_hrm_job_user( fk_job integer NOT NULL, date_start date, date_end date, - commentaire_abandon varchar(255), + abort_comment varchar(255), note_public text, note_private text, fk_user_creat integer, diff --git a/htdocs/install/mysql/tables/llx_hrm_job_user.sql b/htdocs/install/mysql/tables/llx_hrm_job_user.sql index ce9620623dd..6124f84e1e6 100644 --- a/htdocs/install/mysql/tables/llx_hrm_job_user.sql +++ b/htdocs/install/mysql/tables/llx_hrm_job_user.sql @@ -17,17 +17,17 @@ CREATE TABLE llx_hrm_job_user( -- BEGIN MODULEBUILDER FIELDS - rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, -- ref varchar(128) NOT NULL, - description text, - date_creation datetime NOT NULL, - tms timestamp, - fk_contrat integer, - fk_user integer NOT NULL, - fk_job integer NOT NULL, - date_start datetime, - date_end datetime, - commentaire_abandon varchar(255), + description text, + date_creation datetime NOT NULL, + tms timestamp, + fk_contrat integer, + fk_user integer NOT NULL, + fk_job integer NOT NULL, + date_start datetime, + date_end datetime, + abort_comment varchar(255), note_public text, note_private text, fk_user_creat integer, From 445fea18bbf9482912525fce42b35e98c35e44ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 31 Oct 2021 22:20:02 +0100 Subject: [PATCH 1372/1460] fix scrutinizer dol_set_focus returns void --- htdocs/user/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 2e06d89c39c..79ae03cbe4f 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -817,7 +817,7 @@ if ($action == 'create' || $action == 'adduserldap') { print dol_get_fiche_head('', '', '', 0, ''); - print dol_set_focus('#lastname'); + dol_set_focus('#lastname'); print '
    '; if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { - print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); + print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $searchkey, $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:')=== 0)) { - print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth125', 1); + print $object->showInputField($val, $key, $searchkey, '', '', 'search_', 'maxwidth125', 1); } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { print '
    '; print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); @@ -469,9 +470,9 @@ foreach ($object->fields as $key => $val) { print $form->selectDate($search[$key.'_dtend'] ? $search[$key.'_dtend'] : '', "search_".$key."_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); print '
    '; } elseif ($key == 'lang') { - print $formadmin->select_language($search[$key], 'search_lang', 0, null, 1, 0, 0, 'minwidth150 maxwidth200', 2); + print $formadmin->select_language($searchkey, 'search_lang', 0, null, 1, 0, 0, 'minwidth150 maxwidth200', 2); } else { - print ''; + print ''; } print '
    '; From 270ddfda1f20c4589d236d70fcf65df32872eca7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 31 Oct 2021 22:24:25 +0100 Subject: [PATCH 1373/1460] fix scrutinizer --- htdocs/core/lib/geturl.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/geturl.lib.php b/htdocs/core/lib/geturl.lib.php index 70eca219e03..be7e1ffa80b 100644 --- a/htdocs/core/lib/geturl.lib.php +++ b/htdocs/core/lib/geturl.lib.php @@ -251,7 +251,7 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation = dol_syslog("getURLContent request=".$request); if (!empty($conf->global->MAIN_GETURLCONTENT_OUTPUT_RESPONSE)) { // This may contains binary data, so we dont output reponse by default. - dol_syslog("getURLContent response =".response); + dol_syslog("getURLContent response =".$response); } dol_syslog("getURLContent response size=".strlen($response)); // This may contains binary data, so we dont output it From 75eff571d9e8b0be3cc25257b470bf82047e7593 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 31 Oct 2021 22:27:39 +0100 Subject: [PATCH 1374/1460] fix unknown function --- htdocs/core/modules/societe/mod_codeclient_elephant.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/societe/mod_codeclient_elephant.php b/htdocs/core/modules/societe/mod_codeclient_elephant.php index c44b290bb0e..67edcb94b8b 100644 --- a/htdocs/core/modules/societe/mod_codeclient_elephant.php +++ b/htdocs/core/modules/societe/mod_codeclient_elephant.php @@ -132,7 +132,7 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode // Parametrage du prefix customers $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; @@ -140,7 +140,7 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode // Parametrage du prefix suppliers $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; $texte .= '
    '.$langs->trans("Mask").' ('.$langs->trans("CustomerCodeModel").'):'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 1).' 
    '.$langs->trans("Mask").' ('.$langs->trans("SupplierCodeModel").'):'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 1).'
    '; From e02565190a028ed129d88cb8e837b3b84d3c82bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 1 Nov 2021 01:10:30 +0100 Subject: [PATCH 1375/1460] replace function each deprecated in php 7.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Warning This function has been DEPRECATED as of PHP 7.2.0, and REMOVED as of PHP 8.0.0. Relying on this function is highly discouraged. Avertissement Cette fonctionnalité est OBSOLÈTE à partir de PHP 7.2.0 et a été SUPPRIMÉE à partir de PHP 8.0.0. --- htdocs/includes/printipp/http_class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/includes/printipp/http_class.php b/htdocs/includes/printipp/http_class.php index 30bb33d663b..27a3d0cb584 100644 --- a/htdocs/includes/printipp/http_class.php +++ b/htdocs/includes/printipp/http_class.php @@ -366,7 +366,9 @@ class http_class $content_length = 0; foreach ($this->arguments["BodyStream"] as $argument) { - list ($type, $value) = each ($argument); + // list ($type, $value) = each ($argument); + $type = key($argument); + $value = current($argument); reset ($argument); if ($type == "Data") { @@ -420,7 +422,9 @@ class http_class } foreach ($this->arguments["BodyStream"] as $argument) { - list ($type, $value) = each ($argument); + // list ($type, $value) = each ($argument); + $type = key($argument); + $value = current($argument); reset ($argument); if ($type == "Data") { From d5130f25418e367b53cd015891b7d743211f3370 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 1 Nov 2021 02:16:29 +0100 Subject: [PATCH 1376/1460] Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop FIX #19013 --- htdocs/adherents/card.php | 14 ++--- htdocs/ticket/card.php | 85 +++++++++++++++------------- htdocs/ticket/class/ticket.class.php | 19 +++++-- 3 files changed, 68 insertions(+), 50 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index cf0d82b2c7b..5b53437a212 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1788,13 +1788,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; - // Birth Date - print ''; - - // Public - print ''; - - // Categories + // Tags / Categories if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { print ''; print ''; } + // Birth Date + print ''; + + // Public + print ''; + // Other attributes include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 581ca8601e8..3dbd1ad8aa7 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -618,7 +618,7 @@ if (empty($reshook)) { if ($ret > 0) { $log_action = $langs->trans('TicketInitialMessageModified')." \n"; // include the Diff class - dol_include_once('/ticket/class/utils_diff.class.php'); + include_once DOL_DOCUMENT_ROOT.'/core/class/utils_diff.class.php'; // output the result of comparing two files as plain text $log_action .= Diff::toString(Diff::compare(strip_tags($oldvalue_message), strip_tags($object->message))); @@ -1048,11 +1048,11 @@ if ($action == 'create' || $action == 'presend') { print '
    '.$langs->trans("DateOfBirth").''.dol_print_date($object->birth, 'day').'
    '.$langs->trans("Public").''.yn($object->public).'
    '.$langs->trans("Categories").''; @@ -1802,6 +1796,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
    '.$langs->trans("DateOfBirth").''.dol_print_date($object->birth, 'day').'
    '.$langs->trans("Public").''.yn($object->public).'
    '; + print '
    '; print $langs->trans("AssignedTo"); if ($object->fk_statut < $object::STATUS_CLOSED && GETPOST('set', 'alpha') != "assign_ticket" && $user->rights->ticket->manage) { - print ''.img_edit($langs->trans('Modify'), '').''.img_edit($langs->trans('Modify'), '').''; } - print '
    '; + print '
    '; print '
    '; - if ($object->fk_user_assign > 0) { + if (GETPOST('set', 'alpha') != "assign_ticket" && $object->fk_user_assign > 0) { $userstat->fetch($object->fk_user_assign); print $userstat->getNomUrl(-1); } @@ -1063,30 +1063,30 @@ if ($action == 'create' || $action == 'presend') { print ''; print ''; print ''; - print ' '; + //print ' '; print $form->select_dolusers($user->id, 'fk_user_assign', 1); - print ' '; + print ' '; print ''; } print '
    '; - print ''; // Timing (Duration sum of linked fichinter) - if ($conf->ficheinter->enabled) { + if (!empty($conf->ficheinter->enabled)) { $object->fetchObjectLinked(); $num = count($object->linkedObjects); $timing = 0; + $foundinter = 0; if ($num) { foreach ($object->linkedObjects as $objecttype => $objects) { if ($objecttype = "fichinter") { foreach ($objects as $fichinter) { + $foundinter++; $timing += $fichinter->duration; } } } } - print ''; } + // Other attributes + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; + + print '
    '; + print ''; if ($action != 'progression' && $object->fk_statut < $object::STATUS_CLOSED && !$user->socid) { print ''; } print '
    '; print $langs->trans('Progression').''; print ''.img_edit($langs->trans('Modify')).'
    '; - print '
    '; + print ''; if ($user->rights->ticket->write && $action == 'progression') { print '
    '; print ''; print ''; print ''; - print ''; - print ' '; + print ''; + print ' '; print '
    '; } else { print($object->progress > 0 ? $object->progress : '0').'%'; @@ -1095,32 +1095,53 @@ if ($action == 'create' || $action == 'presend') { print '
    '; - + print '
    '; print $form->textwithpicto($langs->trans("TicketDurationAuto"), $langs->trans("TicketDurationAutoInfos"), 1); print ''; - print convertSecondToTime($timing, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY); + print $foundinter ? convertSecondToTime($timing, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY) : ''; print '
    '; + + + // Fin colonne gauche et début colonne droite + print '
    '; + + print '
    '; + print ''; + print ''; + print ''; + + print '
    '; + // Categories if ($conf->categorie->enabled) { + print '
    '; // You can use div-table-responsive-no-min if you dont need reserved height for your table + + print ''; + print ''; - print ''; - print ''; + print "\n"; print ''; print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "l.rowid", "", $param, '', $sortfield, $sortorder); @@ -539,7 +542,7 @@ if ($result) { $thirdpartystatic->email = $objp->email; $thirdpartystatic->country_code = $objp->country_code; $thirdpartystatic->tva_intra = $objp->tva_intra; - $thirdpartystatic->code_compta = $objp->company_code_sell; + $thirdpartystatic->code_compta_company = $objp->company_code_sell; $product_static->ref = $objp->product_ref; $product_static->id = $objp->product_id; @@ -558,7 +561,7 @@ if ($result) { $facture_static->ref = $objp->ref; $facture_static->id = $objp->facid; $facture_static->type = $objp->ftype; - $facture_static->date = $objp->datef; + $facture_static->date = $db->jdate($objp->datef); $facture_static_det->id = $objp->rowid; $facture_static_det->total_ht = $objp->total_ht; @@ -634,7 +637,7 @@ if ($result) { // Ref Invoice print ''; - print ''; + print ''; // Ref Product print ''; */ - print ''; + print ''; // Ref Product print ''; @@ -650,11 +654,12 @@ if ($result) { print ''; // Vat rate + $code_vat_differ=''; if ($objp->vat_tx_l != $objp->vat_tx_p && ! empty($objp->vat_tx_l)) { // Note: having a vat rate of 0 is often the normal case when sells is intra b2b or to export $code_vat_differ = 'font-weight:bold; text-decoration:blink; color:red'; } print ''; // Thirdparty @@ -671,7 +676,7 @@ if ($result) { // Found accounts print '\n"; -print ''; +print ''."\n"; +print ''."\n"; -$result=$object->fetchAll($sortorder, $sortfield, 0, 0, array('t.type'=>$mode,'t.entity'=>array($user->entity,$conf->entity))); +$result = $object->fetchAll($sortorder, $sortfield, 0, 0, array('t.type'=>$mode,'t.entity'=>array($user->entity,$conf->entity))); -if (!is_array($result) && $result<0) { +if (!is_array($result) && $result < 0) { setEventMessages($object->error, $object->errors, 'errors'); -} elseif (count($result)>0) { - foreach ($result as $key=>$defaultvalue) { - print "\n"; - +} elseif (is_array($result) && count($result) > 0) { + foreach ($result as $key => $defaultvalue) { print ''; // Page @@ -378,11 +376,6 @@ if (!is_array($result) && $result<0) { // Value if ($mode != 'focus' && $mode != 'mandatory') { print ''; @@ -405,8 +398,6 @@ if (!is_array($result) && $result<0) { print ''; print "\n"; - print "\n"; - $i++; } } From 5085db36a7e6fba0d8a2f6dbce9fee0f501eb704 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Nov 2021 18:54:59 +0100 Subject: [PATCH 1443/1460] Clean code --- .../accountancy/class/accountancyexport.class.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 2c4dbfd51cd..07d28b7abdb 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -87,11 +87,11 @@ class AccountancyExport * * @param DoliDb $db Database handler */ - public function __construct(DoliDB &$db) + public function __construct(DoliDB $db) { global $conf; - $this->db = &$db; + $this->db = $db; $this->separator = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV; $this->end_line = empty($conf->global->ACCOUNTING_EXPORT_ENDLINE) ? "\n" : ($conf->global->ACCOUNTING_EXPORT_ENDLINE == 1 ? "\n" : "\r\n"); } @@ -928,17 +928,18 @@ class AccountancyExport $date_validation = dol_print_date($line->date_validation, '%Y%m%d'); $date_limit_payment = dol_print_date($line->date_lim_reglement, '%Y%m%d'); + $refInvoice = ''; if ($line->doc_type == 'customer_invoice') { // Customer invoice require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; - $invoice = new Facture($db); + $invoice = new Facture($this->db); $invoice->fetch($line->fk_doc); $refInvoice = $invoice->ref; } elseif ($line->doc_type == 'supplier_invoice') { // Supplier invoice require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; - $invoice = new FactureFournisseur($db); + $invoice = new FactureFournisseur($this->db); $invoice->fetch($line->fk_doc); $refInvoice = $invoice->ref_supplier; @@ -1054,17 +1055,18 @@ class AccountancyExport $date_validation = dol_print_date($line->date_validation, '%Y%m%d'); $date_limit_payment = dol_print_date($line->date_lim_reglement, '%Y%m%d'); + $refInvoice = ''; if ($line->doc_type == 'customer_invoice') { // Customer invoice require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; - $invoice = new Facture($db); + $invoice = new Facture($this->db); $invoice->fetch($line->fk_doc); $refInvoice = $invoice->ref; } elseif ($line->doc_type == 'supplier_invoice') { // Supplier invoice require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; - $invoice = new FactureFournisseur($db); + $invoice = new FactureFournisseur($this->db); $invoice->fetch($line->fk_doc); $refInvoice = $invoice->ref_supplier; From 1d09ffa4c6f7cd63292ccd636e26718c268c263b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Nov 2021 18:59:11 +0100 Subject: [PATCH 1444/1460] Fix scrutinizer --- htdocs/admin/hrm.php | 10 ++++++---- htdocs/admin/mails.php | 7 +++++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/htdocs/admin/hrm.php b/htdocs/admin/hrm.php index 8eb2f93c13c..c006688fca1 100644 --- a/htdocs/admin/hrm.php +++ b/htdocs/admin/hrm.php @@ -79,10 +79,12 @@ if ($action == 'update') { if (!empty($max_rank)) { $static_skill = new Skill($db); $TAllSkills = $static_skill->fetchAll(); - foreach ($TAllSkills as &$skill) { - if (empty($skill->lines)) $skill->fetchLines(); - if (count($skill->lines) < $conf->global->HRM_MAXRANK) { - $skill->createSkills(count($skill->lines) + 1); + if (is_array($TAllSkills)) { + foreach ($TAllSkills as &$skill) { + if (empty($skill->lines)) $skill->fetchLines(); + if (count($skill->lines) < $conf->global->HRM_MAXRANK) { + $skill->createSkills(count($skill->lines) + 1); + } } } } diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 90036b752b0..d60b4e4ddc6 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -851,8 +851,11 @@ if ($action == 'edit') { $companyemail = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL'); $dnsinfo = false; if (!empty($companyemail) && function_exists('dns_get_record')) { - $domain = array_pop(explode('@', $companyemail)); - $dnsinfo = dns_get_record($domain, DNS_TXT); + $arrayofemailparts = explode('@', $companyemail); + if (count($arrayofemailparts) == 2) { + $domain = $arrayofemailparts[1]; + $dnsinfo = dns_get_record($domain, DNS_TXT); + } } if (!empty($dnsinfo) && is_array($dnsinfo)) { foreach ($dnsinfo as $info) { From 29bf662cc4431c1c2503bcfcb5526fd7f7332b57 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Nov 2021 19:01:44 +0100 Subject: [PATCH 1445/1460] Fix warnings --- htdocs/adherents/class/adherent_type.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 90b34e604be..cdf021cfa68 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -90,7 +90,7 @@ class AdherentType extends CommonObject public $subscription; /** - * @var float amount for subscription + * @var float|string Amount for subscription (null or '' means not defined) */ public $amount; From c3fb8416a58e0d0327c658541ec0b4932731029b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Nov 2021 20:40:02 +0100 Subject: [PATCH 1446/1460] reponsive --- htdocs/contrat/list.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index cee0faf95aa..ca544e94a1b 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -492,7 +492,7 @@ $massactionbutton = $form->selectMassAction('', $arrayofmassactions); $url = DOL_URL_ROOT.'/contrat/card.php?action=create'; if (!empty($socid)) { - $url .= '&socid='.$socid; + $url .= '&socid='.((int) $socid); } $newcardbutton = dolGetButtonTitle($langs->trans('NewContractSubscription'), '', 'fa fa-plus-circle', $url, '', $user->rights->contrat->creer); @@ -795,11 +795,12 @@ while ($i < min($num, $limit)) { print ''; } + // Ref thirdparty if (!empty($arrayfields['c.ref_customer']['checked'])) { - print ''; + print ''; } if (!empty($arrayfields['c.ref_supplier']['checked'])) { - print ''; + print ''; } if (!empty($arrayfields['s.nom']['checked'])) { print ''; } if (!empty($arrayfields['s.email']['checked'])) { - print ''; + print ''; } // Town if (!empty($arrayfields['s.town']['checked'])) { From a386d637b3cd5c062187a9910be580abd020eb9f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Nov 2021 20:43:04 +0100 Subject: [PATCH 1447/1460] Clean code --- htdocs/contrat/list.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index ca544e94a1b..110afee0cd5 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -319,7 +319,7 @@ if ($sall) { } if ($search_user > 0) { $sql .= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='contrat' AND tc.source='internal' AND ec.element_id = c.rowid AND ec.fk_socpeople = ".((int) $search_user); -} +}tdoverflowmax200 // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks @@ -600,11 +600,11 @@ if (!empty($arrayfields['s.email']['checked'])) { } // Town if (!empty($arrayfields['s.town']['checked'])) { - print ''; + print ''; } // Zip if (!empty($arrayfields['s.zip']['checked'])) { - print ''; + print ''; } // State if (!empty($arrayfields['state.nom']['checked'])) { @@ -797,7 +797,7 @@ while ($i < min($num, $limit)) { // Ref thirdparty if (!empty($arrayfields['c.ref_customer']['checked'])) { - print ''; + print ''; } if (!empty($arrayfields['c.ref_supplier']['checked'])) { print ''; From c7cb5213bd321873f9e1eb477c9e09321e6c07e6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Nov 2021 20:43:26 +0100 Subject: [PATCH 1448/1460] Clean code --- htdocs/contrat/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 110afee0cd5..0cfa0b2bf16 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -319,7 +319,7 @@ if ($sall) { } if ($search_user > 0) { $sql .= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='contrat' AND tc.source='internal' AND ec.element_id = c.rowid AND ec.fk_socpeople = ".((int) $search_user); -}tdoverflowmax200 +} // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks From 2fc05a4c1cdd0541e51b90e960d7d23e5501110e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Nov 2021 00:37:42 +0100 Subject: [PATCH 1449/1460] Add test virus file --- test/phpunit/testvirus.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 test/phpunit/testvirus.txt diff --git a/test/phpunit/testvirus.txt b/test/phpunit/testvirus.txt new file mode 100644 index 00000000000..a2463df6d64 --- /dev/null +++ b/test/phpunit/testvirus.txt @@ -0,0 +1 @@ +X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H* \ No newline at end of file From d591a83085c93346e969054c6967350648d68755 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Nov 2021 00:57:00 +0100 Subject: [PATCH 1450/1460] css --- htdocs/admin/tools/dolibarr_import.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/admin/tools/dolibarr_import.php b/htdocs/admin/tools/dolibarr_import.php index 29bfe5c12a4..77dea6f23ab 100644 --- a/htdocs/admin/tools/dolibarr_import.php +++ b/htdocs/admin/tools/dolibarr_import.php @@ -207,6 +207,9 @@ if (in_array($type, array('mysql', 'mysqli'))) { //if (empty($_GET["showpass"]) && $dolibarr_main_db_pass) print '
    '.$langs->trans("UnHidePassword").''; //else print '
    '.$langs->trans("HidePassword").''; print ''; + + print '
    '; + print ''; } From bbd3293c3c5c13dc6b9e9f98947bce37d626439b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Nov 2021 01:42:38 +0100 Subject: [PATCH 1451/1460] Data ref --- htdocs/install/mysql/data/llx_c_availability.sql | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/install/mysql/data/llx_c_availability.sql b/htdocs/install/mysql/data/llx_c_availability.sql index 2e06d1de8b3..7291c399da0 100644 --- a/htdocs/install/mysql/data/llx_c_availability.sql +++ b/htdocs/install/mysql/data/llx_c_availability.sql @@ -27,6 +27,8 @@ delete from llx_c_availability; INSERT INTO llx_c_availability (rowid,code,label,active,position) VALUES (1, 'AV_NOW', 'Immediate', 1, 10); -INSERT INTO llx_c_availability (rowid,code,label,active,position) VALUES (2, 'AV_1W', '1 week', 1, 20); -INSERT INTO llx_c_availability (rowid,code,label,active,position) VALUES (3, 'AV_2W', '2 weeks', 1, 30); -INSERT INTO llx_c_availability (rowid,code,label,active,position) VALUES (4, 'AV_3W', '3 weeks', 1, 40); +INSERT INTO llx_c_availability (rowid,code,label,active,position) VALUES (2, 'AV_1W', '1 week', 1, 20); +INSERT INTO llx_c_availability (rowid,code,label,active,position) VALUES (3, 'AV_2W', '2 weeks', 1, 30); +INSERT INTO llx_c_availability (rowid,code,label,active,position) VALUES (4, 'AV_3W', '3 weeks', 1, 40); +INSERT INTO llx_c_availability (rowid,code,label,active,position) VALUES (5, 'AV_4W', '4 weeks', 1, 50); + From 2ea248e705fdb8986b27e72ee46666caec7c5cc2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Nov 2021 02:09:20 +0100 Subject: [PATCH 1452/1460] Clean code --- htdocs/hrm/core/tpl/objectline_view.tpl.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/htdocs/hrm/core/tpl/objectline_view.tpl.php b/htdocs/hrm/core/tpl/objectline_view.tpl.php index 9be74a5f38f..9dd0e0099ab 100644 --- a/htdocs/hrm/core/tpl/objectline_view.tpl.php +++ b/htdocs/hrm/core/tpl/objectline_view.tpl.php @@ -57,11 +57,6 @@ $domData .= ' data-id="'.$line->id.'"'; $domData .= ' data-qty="'.$line->qty.'"'; $domData .= ' data-product_type="'.$line->product_type.'"'; -$sign = 1; -if (!empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE_SCREEN) && in_array($object->element, array('facture', 'invoice_supplier')) && $object->type == $object::TYPE_CREDIT_NOTE) { - $sign = -1; -} - $coldisplay = 0; ?> From e8b3875e2e79b4c30681e86a5ab7ab9ed988fb21 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Nov 2021 02:57:21 +0100 Subject: [PATCH 1453/1460] FIX bad sign of amount stored for multicurrency columns on credit notes --- htdocs/compta/facture/card.php | 19 ++++++++------- htdocs/compta/facture/class/facture.class.php | 23 ++++++++++--------- .../fourn/class/fournisseur.facture.class.php | 23 ++++++++++--------- .../install/mysql/migration/13.0.0-14.0.0.sql | 20 ++++++++++++++++ htdocs/langs/en_US/bills.lang | 2 ++ htdocs/theme/eldy/global.inc.php | 2 +- 6 files changed, 58 insertions(+), 31 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index ed4f3d873e9..d9be7ff3f1c 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3845,13 +3845,14 @@ if ($action == 'create') { $totalpaye = $object->getSommePaiement(); $totalcreditnotes = $object->getSumCreditNotesUsed(); $totaldeposits = $object->getSumDepositsUsed(); - // print "totalpaye=".$totalpaye." totalcreditnotes=".$totalcreditnotes." totaldeposts=".$totaldeposits." + //print "totalpaye=".$totalpaye." totalcreditnotes=".$totalcreditnotes." totaldeposts=".$totaldeposits." // selleruserrevenuestamp=".$selleruserevenustamp; // We can also use bcadd to avoid pb with floating points // For example print 239.2 - 229.3 - 9.9; does not return 0. // $resteapayer=bcadd($object->total_ttc,$totalpaye,$conf->global->MAIN_MAX_DECIMALS_TOT); // $resteapayer=bcadd($resteapayer,$totalavoir,$conf->global->MAIN_MAX_DECIMALS_TOT); + $resteapayer = price2num($object->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits, 'MT'); // Multicurrency @@ -5089,7 +5090,7 @@ if ($action == 'create') { print ''; print $langs->trans('RemainderToPay'); if ($resteapayeraffiche < 0) { - print ' ('.$langs->trans('ExcessReceived').')'; + print ' ('.$langs->trans('NegativeIfExcessReceived').')'; } print ''; print ''; @@ -5117,23 +5118,25 @@ if ($action == 'create') { print ' :
    '; } } else { // Credit note + + $resteapayeraffiche = $resteapayer; $cssforamountpaymentcomplete = 'amountpaymentneutral'; // Total already paid back print ''; + print ''.$langs->trans('AlreadyPaidBack').''; + print ''; // Billed - print ''; + print ''; // Remainder to pay back print ''; + print ''; print ''; print ''; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index a28838756d9..f8f246924e3 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -3296,8 +3296,8 @@ class Facture extends CommonInvoice $this->line->desc = $desc; $this->line->ref_ext = $ref_ext; - $this->line->qty = ($this->type == self::TYPE_CREDIT_NOTE ?abs($qty) : $qty); // For credit note, quantity is always positive and unit price negative - $this->line->subprice = ($this->type == self::TYPE_CREDIT_NOTE ?-abs($pu_ht) : $pu_ht); // For credit note, unit price always negative, always positive otherwise + $this->line->qty = ($this->type == self::TYPE_CREDIT_NOTE ? abs($qty) : $qty); // For credit note, quantity is always positive and unit price negative + $this->line->subprice = ($this->type == self::TYPE_CREDIT_NOTE ? -abs($pu_ht) : $pu_ht); // For credit note, unit price always negative, always positive otherwise $this->line->vat_src_code = $vat_src_code; $this->line->tva_tx = $txtva; @@ -3306,11 +3306,11 @@ class Facture extends CommonInvoice $this->line->localtax1_type = empty($localtaxes_type[0]) ? '' : $localtaxes_type[0]; $this->line->localtax2_type = empty($localtaxes_type[2]) ? '' : $localtaxes_type[2]; - $this->line->total_ht = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ?-abs($total_ht) : $total_ht); // For credit note and if qty is negative, total is negative - $this->line->total_ttc = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ?-abs($total_ttc) : $total_ttc); // For credit note and if qty is negative, total is negative - $this->line->total_tva = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ?-abs($total_tva) : $total_tva); // For credit note and if qty is negative, total is negative - $this->line->total_localtax1 = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ?-abs($total_localtax1) : $total_localtax1); // For credit note and if qty is negative, total is negative - $this->line->total_localtax2 = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ?-abs($total_localtax2) : $total_localtax2); // For credit note and if qty is negative, total is negative + $this->line->total_ht = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ? -abs($total_ht) : $total_ht); // For credit note and if qty is negative, total is negative + $this->line->total_ttc = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ? -abs($total_ttc) : $total_ttc); // For credit note and if qty is negative, total is negative + $this->line->total_tva = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ? -abs($total_tva) : $total_tva); // For credit note and if qty is negative, total is negative + $this->line->total_localtax1 = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ? -abs($total_localtax1) : $total_localtax1); // For credit note and if qty is negative, total is negative + $this->line->total_localtax2 = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ? -abs($total_localtax2) : $total_localtax2); // For credit note and if qty is negative, total is negative $this->line->fk_product = $fk_product; $this->line->product_type = $product_type; @@ -3337,10 +3337,11 @@ class Facture extends CommonInvoice // Multicurrency $this->line->fk_multicurrency = $this->fk_multicurrency; $this->line->multicurrency_code = $this->multicurrency_code; - $this->line->multicurrency_subprice = $pu_ht_devise; - $this->line->multicurrency_total_ht = $multicurrency_total_ht; - $this->line->multicurrency_total_tva = $multicurrency_total_tva; - $this->line->multicurrency_total_ttc = $multicurrency_total_ttc; + $this->line->multicurrency_subprice = ($this->type == self::TYPE_CREDIT_NOTE ? -abs($pu_ht_devise) : $pu_ht_devise); // For credit note, unit price always negative, always positive otherwise + + $this->line->multicurrency_total_ht = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ? -abs($multicurrency_total_ht) : $multicurrency_total_ht); // For credit note and if qty is negative, total is negative + $this->line->multicurrency_total_tva = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ? -abs($multicurrency_total_tva) : $multicurrency_total_tva); // For credit note and if qty is negative, total is negative + $this->line->multicurrency_total_ttc = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ? -abs($multicurrency_total_ttc) : $multicurrency_total_ttc); // For credit note and if qty is negative, total is negative if (is_array($array_options) && count($array_options) > 0) { $this->line->array_options = $array_options; diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 2601c610e15..851dcf645a5 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1957,8 +1957,8 @@ class FactureFournisseur extends CommonInvoice $this->line->desc = $desc; $this->line->ref_supplier = $ref_supplier; - $this->line->qty = ($this->type == self::TYPE_CREDIT_NOTE ?abs($qty) : $qty); // For credit note, quantity is always positive and unit price negative - $this->line->subprice = ($this->type == self::TYPE_CREDIT_NOTE ?-abs($pu_ht) : $pu_ht); // For credit note, unit price always negative, always positive otherwise + $this->line->qty = ($this->type == self::TYPE_CREDIT_NOTE ? abs($qty) : $qty); // For credit note, quantity is always positive and unit price negative + $this->line->subprice = ($this->type == self::TYPE_CREDIT_NOTE ? -abs($pu_ht) : $pu_ht); // For credit note, unit price always negative, always positive otherwise $this->line->vat_src_code = $vat_src_code; $this->line->tva_tx = $txtva; @@ -1967,11 +1967,11 @@ class FactureFournisseur extends CommonInvoice $this->line->localtax1_type = empty($localtaxes_type[0]) ? '' : $localtaxes_type[0]; $this->line->localtax2_type = empty($localtaxes_type[2]) ? '' : $localtaxes_type[2]; - $this->line->total_ht = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ?-abs($total_ht) : $total_ht); // For credit note and if qty is negative, total is negative - $this->line->total_tva = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ?-abs($total_tva) : $total_tva); - $this->line->total_localtax1 = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ?-abs($total_localtax1) : $total_localtax1); - $this->line->total_localtax2 = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ?-abs($total_localtax2) : $total_localtax2); - $this->line->total_ttc = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ?-abs($total_ttc) : $total_ttc); + $this->line->total_ht = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ? -abs($total_ht) : $total_ht); // For credit note and if qty is negative, total is negative + $this->line->total_tva = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ? -abs($total_tva) : $total_tva); // For credit note and if qty is negative, total is negative + $this->line->total_localtax1 = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ? -abs($total_localtax1) : $total_localtax1); // For credit note and if qty is negative, total is negative + $this->line->total_localtax2 = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ? -abs($total_localtax2) : $total_localtax2); // For credit note and if qty is negative, total is negative + $this->line->total_ttc = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ? -abs($total_ttc) : $total_ttc); // For credit note and if qty is negative, total is negative $this->line->fk_product = $fk_product; $this->line->product_type = $type; @@ -1992,10 +1992,11 @@ class FactureFournisseur extends CommonInvoice // Multicurrency $this->line->fk_multicurrency = $this->fk_multicurrency; $this->line->multicurrency_code = $this->multicurrency_code; - $this->line->multicurrency_subprice = $pu_ht_devise; - $this->line->multicurrency_total_ht = $multicurrency_total_ht; - $this->line->multicurrency_total_tva = $multicurrency_total_tva; - $this->line->multicurrency_total_ttc = $multicurrency_total_ttc; + $this->line->multicurrency_subprice = ($this->type == self::TYPE_CREDIT_NOTE ? -abs($pu_ht_devise) : $pu_ht_devise); // For credit note, unit price always negative, always positive otherwise + + $this->line->multicurrency_total_ht = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ? -abs($multicurrency_total_ht) : $multicurrency_total_ht); // For credit note and if qty is negative, total is negative + $this->line->multicurrency_total_tva = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ? -abs($multicurrency_total_tva) : $multicurrency_total_tva); // For credit note and if qty is negative, total is negative + $this->line->multicurrency_total_ttc = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ? -abs($multicurrency_total_ttc) : $multicurrency_total_ttc); // For credit note and if qty is negative, total is negative if (is_array($array_options) && count($array_options) > 0) { $this->line->array_options = $array_options; diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index 03110b4425e..ac032d3541d 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -87,6 +87,26 @@ DELETE FROM llx_user_param where param = 'MAIN_THEME' and value in ('auguria', ' -- For v14 +--Fix bad sign on multicompany column for customer invoice lines +UPDATE llx_facturedet SET multicurrency_subprice = -multicurrency_subprice WHERE ((multicurrency_subprice < 0 and subprice > 0) OR (multicurrency_subprice > 0 and subprice < 0)); +UPDATE llx_facturedet SET multicurrency_total_ht = -multicurrency_total_ht WHERE ((multicurrency_total_ht < 0 and total_ht > 0) OR (multicurrency_total_ht > 0 and total_ht < 0)); +UPDATE llx_facturedet SET multicurrency_total_tva = -multicurrency_total_tva WHERE ((multicurrency_total_tva < 0 and total_tva > 0) OR (multicurrency_total_tva > 0 and total_tva < 0)); +UPDATE llx_facturedet SET multicurrency_total_ttc = -multicurrency_total_ttc WHERE ((multicurrency_total_ttc < 0 and total_ttc > 0) OR (multicurrency_total_ttc > 0 and total_ttc < 0)); +--Fix bad sign on multicompany column for customer invoices +UPDATE llx_facture SET multicurrency_total_ht = -multicurrency_total_ht WHERE ((multicurrency_total_ht < 0 and total_ht > 0) OR (multicurrency_total_ht > 0 and total_ht < 0)); +UPDATE llx_facture SET multicurrency_total_tva = -multicurrency_total_tva WHERE ((multicurrency_total_tva < 0 and total_tva > 0) OR (multicurrency_total_tva > 0 and total_tva < 0)); +UPDATE llx_facture SET multicurrency_total_ttc = -multicurrency_total_ttc WHERE ((multicurrency_total_ttc < 0 and total_ttc > 0) OR (multicurrency_total_ttc > 0 and total_ttc < 0)); +--Fix bad sign on multicurrency column for supplier invoice lines +UPDATE llx_facture_fourn_det SET multicurrency_subprice = -multicurrency_subprice WHERE ((multicurrency_subprice < 0 and pu_ht > 0) OR (multicurrency_subprice > 0 and pu_ht < 0)); +UPDATE llx_facture_fourn_det SET multicurrency_total_ht = -multicurrency_total_ht WHERE ((multicurrency_total_ht < 0 and total_ht > 0) OR (multicurrency_total_ht > 0 and total_ht < 0)); +UPDATE llx_facture_fourn_det SET multicurrency_total_tva = -multicurrency_total_tva WHERE ((multicurrency_total_tva < 0 and tva > 0) OR (multicurrency_total_tva > 0 and tva < 0)); +UPDATE llx_facture_fourn_det SET multicurrency_total_ttc = -multicurrency_total_ttc WHERE ((multicurrency_total_ttc < 0 and total_ttc > 0) OR (multicurrency_total_ttc > 0 and total_ttc < 0)); +--Fix bad sign on multicompany column for customer invoices +UPDATE llx_facture_fourn SET multicurrency_total_ht = -multicurrency_total_ht WHERE ((multicurrency_total_ht < 0 and total_ht > 0) OR (multicurrency_total_ht > 0 and total_ht < 0)); +UPDATE llx_facture_fourn SET multicurrency_total_tva = -multicurrency_total_tva WHERE ((multicurrency_total_tva < 0 and total_tva > 0) OR (multicurrency_total_tva > 0 and total_tva < 0)); +UPDATE llx_facture_fourn SET multicurrency_total_ttc = -multicurrency_total_ttc WHERE ((multicurrency_total_ttc < 0 and total_ttc > 0) OR (multicurrency_total_ttc > 0 and total_ttc < 0)); + + UPDATE llx_c_ticket_type set label = 'Issue or bug' WHERE code = 'ISSUE'; INSERT INTO llx_c_ticket_type (code, pos, label, active, use_default, description) VALUES('PROBLEM', '22', 'Problem', 0, 0, NULL); diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index a835ec8475d..6078942f574 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -236,9 +236,11 @@ Abandoned=Abandoned RemainderToPay=Remaining unpaid RemainderToTake=Remaining amount to take RemainderToPayBack=Remaining amount to refund +NegativeIfExcessRefunded=negative if excess refunded Rest=Pending AmountExpected=Amount claimed ExcessReceived=Excess received +NegativeIfExcessReceived=negative if excess received ExcessPaid=Excess paid EscompteOffered=Discount offered (payment before term) EscompteOfferedShort=Discount diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 4da2d71dfd7..39c62b2685f 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1195,7 +1195,7 @@ select.flat.selectlimit { } /* Styles for amount on card */ -table.paymenttable td.amountpaymentcomplete, table.paymenttable td.amountremaintopay { +table.paymenttable td.amountpaymentcomplete, table.paymenttable td.amountremaintopay, table.paymenttable td.amountremaintopayback { padding-top: 0px; padding-bottom: 0px; } From cd4f59bb2a5777536598ea3e45afd6f54a6f7b87 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Nov 2021 03:01:18 +0100 Subject: [PATCH 1454/1460] FIX bad sign of amount stored for multicurrency columns on credit notes --- htdocs/install/mysql/migration/repair.sql | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index 59f04fdb2ca..5208a733769 100644 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -501,6 +501,25 @@ UPDATE llx_accounting_bookkeeping set date_creation = tms where date_creation IS -- UPDATE llx_facturedet_rec set label = NULL WHERE label IS NOT NULL; +--Fix bad sign on multicompany column for customer invoice lines +UPDATE llx_facturedet SET multicurrency_subprice = -multicurrency_subprice WHERE ((multicurrency_subprice < 0 and subprice > 0) OR (multicurrency_subprice > 0 and subprice < 0)); +UPDATE llx_facturedet SET multicurrency_total_ht = -multicurrency_total_ht WHERE ((multicurrency_total_ht < 0 and total_ht > 0) OR (multicurrency_total_ht > 0 and total_ht < 0)); +UPDATE llx_facturedet SET multicurrency_total_tva = -multicurrency_total_tva WHERE ((multicurrency_total_tva < 0 and total_tva > 0) OR (multicurrency_total_tva > 0 and total_tva < 0)); +UPDATE llx_facturedet SET multicurrency_total_ttc = -multicurrency_total_ttc WHERE ((multicurrency_total_ttc < 0 and total_ttc > 0) OR (multicurrency_total_ttc > 0 and total_ttc < 0)); +--Fix bad sign on multicompany column for customer invoices +UPDATE llx_facture SET multicurrency_total_ht = -multicurrency_total_ht WHERE ((multicurrency_total_ht < 0 and total_ht > 0) OR (multicurrency_total_ht > 0 and total_ht < 0)); +UPDATE llx_facture SET multicurrency_total_tva = -multicurrency_total_tva WHERE ((multicurrency_total_tva < 0 and total_tva > 0) OR (multicurrency_total_tva > 0 and total_tva < 0)); +UPDATE llx_facture SET multicurrency_total_ttc = -multicurrency_total_ttc WHERE ((multicurrency_total_ttc < 0 and total_ttc > 0) OR (multicurrency_total_ttc > 0 and total_ttc < 0)); +--Fix bad sign on multicurrency column for supplier invoice lines +UPDATE llx_facture_fourn_det SET multicurrency_subprice = -multicurrency_subprice WHERE ((multicurrency_subprice < 0 and pu_ht > 0) OR (multicurrency_subprice > 0 and pu_ht < 0)); +UPDATE llx_facture_fourn_det SET multicurrency_total_ht = -multicurrency_total_ht WHERE ((multicurrency_total_ht < 0 and total_ht > 0) OR (multicurrency_total_ht > 0 and total_ht < 0)); +UPDATE llx_facture_fourn_det SET multicurrency_total_tva = -multicurrency_total_tva WHERE ((multicurrency_total_tva < 0 and tva > 0) OR (multicurrency_total_tva > 0 and tva < 0)); +UPDATE llx_facture_fourn_det SET multicurrency_total_ttc = -multicurrency_total_ttc WHERE ((multicurrency_total_ttc < 0 and total_ttc > 0) OR (multicurrency_total_ttc > 0 and total_ttc < 0)); +--Fix bad sign on multicompany column for customer invoices +UPDATE llx_facture_fourn SET multicurrency_total_ht = -multicurrency_total_ht WHERE ((multicurrency_total_ht < 0 and total_ht > 0) OR (multicurrency_total_ht > 0 and total_ht < 0)); +UPDATE llx_facture_fourn SET multicurrency_total_tva = -multicurrency_total_tva WHERE ((multicurrency_total_tva < 0 and total_tva > 0) OR (multicurrency_total_tva > 0 and total_tva < 0)); +UPDATE llx_facture_fourn SET multicurrency_total_ttc = -multicurrency_total_ttc WHERE ((multicurrency_total_ttc < 0 and total_ttc > 0) OR (multicurrency_total_ttc > 0 and total_ttc < 0)); + UPDATE llx_facturedet SET situation_percent = 100 WHERE situation_percent IS NULL AND fk_prev_id IS NULL; From be1ca6ebab44388d5b29ff3c27344ebaaf461458 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Nov 2021 03:21:15 +0100 Subject: [PATCH 1455/1460] Clean code --- .../core/class/commondocgenerator.class.php | 123 +++++++++--------- 1 file changed, 61 insertions(+), 62 deletions(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 7183605ae10..a92179e7b6a 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -399,7 +399,7 @@ abstract class CommonDocGenerator $sumpayed = $sumdeposit = $sumcreditnote = ''; $already_payed_all = 0; - $remain_to_pay = 0; + if ($object->element == 'facture') { $invoice_source = new Facture($this->db); if ($object->fk_facture_source > 0) { @@ -409,7 +409,6 @@ abstract class CommonDocGenerator $sumdeposit = $object->getSumDepositsUsed(); $sumcreditnote = $object->getSumCreditNotesUsed(); $already_payed_all = $sumpayed + $sumdeposit + $sumcreditnote; - $remain_to_pay = $sumpayed - $sumdeposit - $sumcreditnote; if ($object->fk_account > 0) { require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; @@ -421,76 +420,76 @@ abstract class CommonDocGenerator $date = ($object->element == 'contrat' ? $object->date_contrat : $object->date); $resarray = array( - $array_key.'_id'=>$object->id, - $array_key.'_ref'=>$object->ref, - $array_key.'_ref_ext'=>$object->ref_ext, - $array_key.'_ref_customer'=>(!empty($object->ref_client) ? $object->ref_client : (empty($object->ref_customer) ? '' : $object->ref_customer)), - $array_key.'_ref_supplier'=>(!empty($object->ref_fournisseur) ? $object->ref_fournisseur : (empty($object->ref_supplier) ? '' : $object->ref_supplier)), - $array_key.'_source_invoice_ref'=>$invoice_source->ref, - // Dates - $array_key.'_hour'=>dol_print_date($date, 'hour'), - $array_key.'_date'=>dol_print_date($date, 'day'), - $array_key.'_date_rfc'=>dol_print_date($date, 'dayrfc'), - $array_key.'_date_limit'=>(!empty($object->date_lim_reglement) ?dol_print_date($object->date_lim_reglement, 'day') : ''), - $array_key.'_date_end'=>(!empty($object->fin_validite) ?dol_print_date($object->fin_validite, 'day') : ''), - $array_key.'_date_creation'=>dol_print_date($object->date_creation, 'day'), - $array_key.'_date_modification'=>(!empty($object->date_modification) ?dol_print_date($object->date_modification, 'day') : ''), - $array_key.'_date_validation'=>(!empty($object->date_validation) ?dol_print_date($object->date_validation, 'dayhour') : ''), - $array_key.'_date_delivery_planed'=>(!empty($object->date_livraison) ?dol_print_date($object->date_livraison, 'day') : ''), - $array_key.'_date_close'=>(!empty($object->date_cloture) ?dol_print_date($object->date_cloture, 'dayhour') : ''), + $array_key.'_id'=>$object->id, + $array_key.'_ref'=>$object->ref, + $array_key.'_ref_ext'=>$object->ref_ext, + $array_key.'_ref_customer'=>(!empty($object->ref_client) ? $object->ref_client : (empty($object->ref_customer) ? '' : $object->ref_customer)), + $array_key.'_ref_supplier'=>(!empty($object->ref_fournisseur) ? $object->ref_fournisseur : (empty($object->ref_supplier) ? '' : $object->ref_supplier)), + $array_key.'_source_invoice_ref'=>$invoice_source->ref, + // Dates + $array_key.'_hour'=>dol_print_date($date, 'hour'), + $array_key.'_date'=>dol_print_date($date, 'day'), + $array_key.'_date_rfc'=>dol_print_date($date, 'dayrfc'), + $array_key.'_date_limit'=>(!empty($object->date_lim_reglement) ?dol_print_date($object->date_lim_reglement, 'day') : ''), + $array_key.'_date_end'=>(!empty($object->fin_validite) ?dol_print_date($object->fin_validite, 'day') : ''), + $array_key.'_date_creation'=>dol_print_date($object->date_creation, 'day'), + $array_key.'_date_modification'=>(!empty($object->date_modification) ?dol_print_date($object->date_modification, 'day') : ''), + $array_key.'_date_validation'=>(!empty($object->date_validation) ?dol_print_date($object->date_validation, 'dayhour') : ''), + $array_key.'_date_delivery_planed'=>(!empty($object->date_livraison) ?dol_print_date($object->date_livraison, 'day') : ''), + $array_key.'_date_close'=>(!empty($object->date_cloture) ?dol_print_date($object->date_cloture, 'dayhour') : ''), - $array_key.'_payment_mode_code'=>$object->mode_reglement_code, - $array_key.'_payment_mode'=>($outputlangs->transnoentitiesnoconv('PaymentType'.$object->mode_reglement_code) != 'PaymentType'.$object->mode_reglement_code ? $outputlangs->transnoentitiesnoconv('PaymentType'.$object->mode_reglement_code) : $object->mode_reglement), - $array_key.'_payment_term_code'=>$object->cond_reglement_code, - $array_key.'_payment_term'=>($outputlangs->transnoentitiesnoconv('PaymentCondition'.$object->cond_reglement_code) != 'PaymentCondition'.$object->cond_reglement_code ? $outputlangs->transnoentitiesnoconv('PaymentCondition'.$object->cond_reglement_code) : ($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement)), + $array_key.'_payment_mode_code'=>$object->mode_reglement_code, + $array_key.'_payment_mode'=>($outputlangs->transnoentitiesnoconv('PaymentType'.$object->mode_reglement_code) != 'PaymentType'.$object->mode_reglement_code ? $outputlangs->transnoentitiesnoconv('PaymentType'.$object->mode_reglement_code) : $object->mode_reglement), + $array_key.'_payment_term_code'=>$object->cond_reglement_code, + $array_key.'_payment_term'=>($outputlangs->transnoentitiesnoconv('PaymentCondition'.$object->cond_reglement_code) != 'PaymentCondition'.$object->cond_reglement_code ? $outputlangs->transnoentitiesnoconv('PaymentCondition'.$object->cond_reglement_code) : ($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement)), - $array_key.'_incoterms'=>(method_exists($object, 'display_incoterms') ? $object->display_incoterms() : ''), + $array_key.'_incoterms'=>(method_exists($object, 'display_incoterms') ? $object->display_incoterms() : ''), - $array_key.'_bank_iban'=>$bank_account->iban, - $array_key.'_bank_bic'=>$bank_account->bic, - $array_key.'_bank_label'=>$bank_account->label, - $array_key.'_bank_number'=>$bank_account->number, - $array_key.'_bank_proprio'=>$bank_account->proprio, + $array_key.'_bank_iban'=>$bank_account->iban, + $array_key.'_bank_bic'=>$bank_account->bic, + $array_key.'_bank_label'=>$bank_account->label, + $array_key.'_bank_number'=>$bank_account->number, + $array_key.'_bank_proprio'=>$bank_account->proprio, - $array_key.'_total_ht_locale'=>price($object->total_ht, 0, $outputlangs), - $array_key.'_total_vat_locale'=>(!empty($object->total_vat) ?price($object->total_vat, 0, $outputlangs) : price($object->total_tva, 0, $outputlangs)), - $array_key.'_total_localtax1_locale'=>price($object->total_localtax1, 0, $outputlangs), - $array_key.'_total_localtax2_locale'=>price($object->total_localtax2, 0, $outputlangs), - $array_key.'_total_ttc_locale'=>price($object->total_ttc, 0, $outputlangs), + $array_key.'_total_ht_locale'=>price($object->total_ht, 0, $outputlangs), + $array_key.'_total_vat_locale'=>(!empty($object->total_vat) ?price($object->total_vat, 0, $outputlangs) : price($object->total_tva, 0, $outputlangs)), + $array_key.'_total_localtax1_locale'=>price($object->total_localtax1, 0, $outputlangs), + $array_key.'_total_localtax2_locale'=>price($object->total_localtax2, 0, $outputlangs), + $array_key.'_total_ttc_locale'=>price($object->total_ttc, 0, $outputlangs), - $array_key.'_total_ht'=>price2num($object->total_ht), - $array_key.'_total_vat'=>(!empty($object->total_vat) ?price2num($object->total_vat) : price2num($object->total_tva)), - $array_key.'_total_localtax1'=>price2num($object->total_localtax1), - $array_key.'_total_localtax2'=>price2num($object->total_localtax2), - $array_key.'_total_ttc'=>price2num($object->total_ttc), + $array_key.'_total_ht'=>price2num($object->total_ht), + $array_key.'_total_vat'=>(!empty($object->total_vat) ?price2num($object->total_vat) : price2num($object->total_tva)), + $array_key.'_total_localtax1'=>price2num($object->total_localtax1), + $array_key.'_total_localtax2'=>price2num($object->total_localtax2), + $array_key.'_total_ttc'=>price2num($object->total_ttc), - $array_key.'_multicurrency_code' => $object->multicurrency_code, - $array_key.'_multicurrency_tx' => price2num($object->multicurrency_tx), - $array_key.'_multicurrency_total_ht' => price2num($object->multicurrency_total_ht), - $array_key.'_multicurrency_total_tva' => price2num($object->multicurrency_total_tva), - $array_key.'_multicurrency_total_ttc' => price2num($object->multicurrency_total_ttc), - $array_key.'_multicurrency_total_ht_locale' => price($object->multicurrency_total_ht, 0, $outputlangs), - $array_key.'_multicurrency_total_tva_locale' => price($object->multicurrency_total_tva, 0, $outputlangs), - $array_key.'_multicurrency_total_ttc_locale' => price($object->multicurrency_total_ttc, 0, $outputlangs), + $array_key.'_multicurrency_code' => $object->multicurrency_code, + $array_key.'_multicurrency_tx' => price2num($object->multicurrency_tx), + $array_key.'_multicurrency_total_ht' => price2num($object->multicurrency_total_ht), + $array_key.'_multicurrency_total_tva' => price2num($object->multicurrency_total_tva), + $array_key.'_multicurrency_total_ttc' => price2num($object->multicurrency_total_ttc), + $array_key.'_multicurrency_total_ht_locale' => price($object->multicurrency_total_ht, 0, $outputlangs), + $array_key.'_multicurrency_total_tva_locale' => price($object->multicurrency_total_tva, 0, $outputlangs), + $array_key.'_multicurrency_total_ttc_locale' => price($object->multicurrency_total_ttc, 0, $outputlangs), - $array_key.'_note_private'=>$object->note, - $array_key.'_note_public'=>$object->note_public, - $array_key.'_note'=>$object->note_public, // For backward compatibility + $array_key.'_note_private'=>$object->note, + $array_key.'_note_public'=>$object->note_public, + $array_key.'_note'=>$object->note_public, // For backward compatibility - // Payments - $array_key.'_already_payed_locale'=>price($sumpayed, 0, $outputlangs), - $array_key.'_already_payed'=>price2num($sumpayed), - $array_key.'_already_deposit_locale'=>price($sumdeposit, 0, $outputlangs), - $array_key.'_already_deposit'=>price2num($sumdeposit), - $array_key.'_already_creditnote_locale'=>price($sumcreditnote, 0, $outputlangs), - $array_key.'_already_creditnote'=>price2num($sumcreditnote), + // Payments + $array_key.'_already_payed_locale'=>price($sumpayed, 0, $outputlangs), + $array_key.'_already_payed'=>price2num($sumpayed), + $array_key.'_already_deposit_locale'=>price($sumdeposit, 0, $outputlangs), + $array_key.'_already_deposit'=>price2num($sumdeposit), + $array_key.'_already_creditnote_locale'=>price($sumcreditnote, 0, $outputlangs), + $array_key.'_already_creditnote'=>price2num($sumcreditnote), - $array_key.'_already_payed_all_locale'=>price(price2num($already_payed_all, 'MT'), 0, $outputlangs), - $array_key.'_already_payed_all'=> price2num($already_payed_all, 'MT'), + $array_key.'_already_payed_all_locale'=>price(price2num($already_payed_all, 'MT'), 0, $outputlangs), + $array_key.'_already_payed_all'=> price2num($already_payed_all, 'MT'), - // Remain to pay with all know information (except open direct debit requests) - $array_key.'_remain_to_pay_locale'=>price(price2num($object->total_ttc - $remain_to_pay, 'MT'), 0, $outputlangs), - $array_key.'_remain_to_pay'=>price2num($object->total_ttc - $remain_to_pay, 'MT') + // Remain to pay with all known information (except open direct debit requests) + $array_key.'_remain_to_pay_locale'=>price(price2num($object->total_ttc - $already_payed_all, 'MT'), 0, $outputlangs), + $array_key.'_remain_to_pay'=>price2num($object->total_ttc - $already_payed_all, 'MT') ); if (method_exists($object, 'getTotalDiscount') && in_array(get_class($object), array('Proposal', 'Commande', 'Facture', 'SupplierProposal', 'CommandeFournisseur', 'FactureFournisseur'))) { From d026c721cf8f59933f8b66d3230af3f7896c08d7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Nov 2021 03:27:27 +0100 Subject: [PATCH 1456/1460] Update security2.lib.php --- htdocs/core/lib/security2.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php index d6546e64cfd..2edb2e629de 100644 --- a/htdocs/core/lib/security2.lib.php +++ b/htdocs/core/lib/security2.lib.php @@ -215,17 +215,17 @@ if (!function_exists('dol_loginfunction')) { } // Execute hook getLoginPageOptions (for table) - $parameters = array('entity' => GETPOST('entity', 'int')); + $parameters = array('entity' => GETPOST('entity', 'int'), 'switchentity' => GETPOST('switchentity', 'int')); $reshook = $hookmanager->executeHooks('getLoginPageOptions', $parameters); // Note that $action and $object may have been modified by some hooks. $morelogincontent = $hookmanager->resPrint; // Execute hook getLoginPageExtraOptions (eg for js) - $parameters = array('entity' => GETPOST('entity', 'int')); + $parameters = array('entity' => GETPOST('entity', 'int'), 'switchentity' => GETPOST('switchentity', 'int')); $reshook = $hookmanager->executeHooks('getLoginPageExtraOptions', $parameters); // Note that $action and $object may have been modified by some hooks. $moreloginextracontent = $hookmanager->resPrint; //Redirect after connection - $parameters = array('entity' => GETPOST('entity', 'int')); + $parameters = array('entity' => GETPOST('entity', 'int'), 'switchentity' => GETPOST('switchentity', 'int')); $reshook = $hookmanager->executeHooks('redirectAfterConnection', $parameters); // Note that $action and $object may have been modified by some hooks. $php_self = $hookmanager->resPrint; From e8e0768eec34e01f6e10f11bfb8a8144cec0a199 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Nov 2021 03:47:16 +0100 Subject: [PATCH 1457/1460] Fix phpcs --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index e18d0c081c2..81a5413182e 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7227,7 +7227,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, if ($object->id > 0) { $substitutionarray['__ONLINE_PAYMENT_TEXT_AND_URL__'] = ($paymenturl ?str_replace('\n', "\n", $outputlangs->trans("PredefinedMailContentLink", $paymenturl)) : ''); $substitutionarray['__ONLINE_PAYMENT_URL__'] = $paymenturl; - + if (is_object($object) && $object->element == 'propal') { $substitutionarray['__ONLINE_SIGN_URL__'] = getOnlineSignatureUrl(0, 'proposal', $object->ref); } From 3ff880aa74c12f389135cdad31b0726bf0084b84 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Nov 2021 11:40:40 +0100 Subject: [PATCH 1458/1460] Avoid virus detection --- test/phpunit/testvirus.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/phpunit/testvirus.txt b/test/phpunit/testvirus.txt index a2463df6d64..4a130462173 100644 --- a/test/phpunit/testvirus.txt +++ b/test/phpunit/testvirus.txt @@ -1 +1,2 @@ -X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H* \ No newline at end of file +# Remove this line and replace the ABC with X50 to get a file that is detected by antiviruses. +ABC!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H* \ No newline at end of file From 39b8916215623e9d19d477d8ebe10e554510408e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Nov 2021 14:01:15 +0100 Subject: [PATCH 1459/1460] css --- htdocs/index.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/index.php b/htdocs/index.php index b9ac604ca95..be439300291 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -561,9 +561,11 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { $nbtodClass = ''; if ($board->nbtodo > 0) { $nbtodClass = 'badge badge-info'; + } else { + $nbtodClass = 'opacitymedium'; } - $openedDashBoard .= ' '.$infoName.''.$board->nbtodo.''; + $openedDashBoard .= ''.$infoName.''.$board->nbtodo.''; if ($textLate) { if ($board->url_late) { $openedDashBoard .= ''; From c858c7bf53ff4f7be7dbef8b5a7f305ce090515e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Nov 2021 14:05:07 +0100 Subject: [PATCH 1460/1460] Trans shorter --- htdocs/langs/en_US/ticket.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang index 0134b96b935..d38358eb74d 100644 --- a/htdocs/langs/en_US/ticket.lang +++ b/htdocs/langs/en_US/ticket.lang @@ -318,7 +318,7 @@ BoxTicketLastXDays=Number of new tickets by days the last %s days BoxTicketLastXDayswidget = Number of new tickets by days the last X days BoxNoTicketLastXDays=No new tickets the last %s days BoxNumberOfTicketByDay=Number of new tickets by day -BoxNewTicketVSClose=Number of today's new tickets versus today's closed tickets +BoxNewTicketVSClose=Number of tickets versus closed tickets (today) TicketCreatedToday=Ticket created today TicketClosedToday=Ticket closed today KMFoundForTicketGroup=We found topics and FAQs that may answers your question, thanks to check them before submitting the ticket
    '; - print '
    '; + print ''; + print ''; @@ -1130,7 +1151,7 @@ if ($action == 'create' || $action == 'presend') { if ($user->rights->ticket->write && $action == 'categories') { $cate_arbo = $form->select_all_categories(Categorie::TYPE_TICKET, '', 'parent', 64, 0, 1); - if (count($cate_arbo)) { + if (is_array($cate_arbo)) { // Categories print '"; } @@ -1155,27 +1176,15 @@ if ($action == 'create' || $action == 'presend') { print $form->showCategories($object->id, Categorie::TYPE_TICKET, 1); print ""; } + + print '
    '; print $langs->trans("Categories"); if ($action != 'categories' && !$user->socid) { print ''.img_edit($langs->trans('Modify')).''; print ''; @@ -1146,7 +1167,7 @@ if ($action == 'create' || $action == 'presend') { } print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0); - print ''; + print ''; print ''; print "
    '; } - // Other attributes - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; - - print '
    '; - - - // Fin colonne gauche et début colonne droite - print '
    '; - // View Original message $actionobject->viewTicketOriginalMessage($user, $action, $object); // Classification of ticket - print '
    '; - print ''; - print ''; - print ''; - print '
    '; // You can use div-table-responsive-no-min if you dont need reserved height for your table print ''; print ''; @@ -1184,11 +1193,11 @@ if ($action == 'create' || $action == 'presend') { print ''; print ''; @@ -1198,7 +1207,7 @@ if ($action == 'create' || $action == 'presend') { print ''; // Type print ''; @@ -1206,15 +1215,15 @@ if ($action == 'create' || $action == 'presend') { // Group print ''; print ''; print ''; // Severity print ''; print ''; diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index ed134296e76..2265bb2fb66 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1258,12 +1258,12 @@ class Ticket extends CommonObject /** * Return status label of object * - * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto - * @return string Label + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label */ public function getLibStatut($mode = 0) { - return $this->libStatut($this->fk_statut, $mode); + return $this->libStatut($this->fk_statut, $mode, 0, $this->progress); } @@ -1274,9 +1274,10 @@ class Ticket extends CommonObject * @param string $status Id status * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto * @param int $notooltip 1=No tooltip + * @param int $progress Progression (0 to 100) * @return string Label */ - public function LibStatut($status, $mode = 0, $notooltip = 0) + public function LibStatut($status, $mode = 0, $notooltip = 0, $progress = 0) { // phpcs:enable global $langs; @@ -1312,7 +1313,15 @@ class Ticket extends CommonObject $params = array('tooltip' => 'no'); } - return dolGetStatus($langs->transnoentitiesnoconv($labelStatus), $langs->transnoentitiesnoconv($labelStatusShort), '', $statusType, $mode, '', $params); + $labelStatus = $langs->transnoentitiesnoconv($labelStatus); + $labelStatusShort = $langs->transnoentitiesnoconv($labelStatusShort); + + if ($status == self::STATUS_IN_PROGRESS && $progress > 0) { + $labelStatus .= ' ('.round($progress).'%)'; + $labelStatusShort .= ' ('.round($progress).'%)'; + } + + return dolGetStatus($labelStatus, $labelStatusShort, '', $statusType, $mode, '', $params); } From e4613b3104c06862d6b25b97f7732a4f3e709716 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 1 Nov 2021 02:28:41 +0100 Subject: [PATCH 1377/1460] FIX sql error when values for natural_search is an array --- htdocs/ticket/list.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 141cafa17fd..1bac8af0e92 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -383,15 +383,16 @@ foreach ($search as $key => $val) { $sql .= natural_search($key, join(',', $newarrayofstatus), 2); } continue; - } - if ($key == 'fk_user_assign' || $key == 'fk_user_create' || $key == 'fk_project') { + } elseif ($key == 'fk_user_assign' || $key == 'fk_user_create' || $key == 'fk_project') { if ($search[$key] > 0) { $sql .= natural_search($key, $search[$key], 2); } continue; } + $mode_search = ((!empty($object->fields[$key]) && ($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key]))) ? 1 : 0); - if ($search[$key] != '') { + // $search[$key] can be an array of values, or a string. We add filter if array not empty or if it is a string. + if ((is_array($search[$key]) && !empty($search[$key])) || (!is_array($search[$key]) && $search[$key] != '')) { $sql .= natural_search($key, $search[$key], $mode_search); } } From 3c69fb0ea3f866bf6b3449aed13bffcf866dd00c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 1 Nov 2021 02:35:15 +0100 Subject: [PATCH 1378/1460] Update mails.php --- htdocs/admin/mails.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index acfafcf9370..90036b752b0 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -850,13 +850,13 @@ if ($action == 'edit') { } $companyemail = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL'); $dnsinfo = false; - if (!empty($companyemail)) { + if (!empty($companyemail) && function_exists('dns_get_record')) { $domain = array_pop(explode('@', $companyemail)); $dnsinfo = dns_get_record($domain, DNS_TXT); } if (!empty($dnsinfo) && is_array($dnsinfo)) { foreach ($dnsinfo as $info) { - if (strpos($info['txt'], 'v=spf1') !== false) { + if (strpos($info['txt'], 'v=spf') !== false) { $text .= ($text ? '

    ' : '').$langs->trans("ActualMailSPFRecordFound", $info['txt']); } } From 1b336456ce3ae58f7fd522f6a6529773623a39b1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 1 Nov 2021 02:44:14 +0100 Subject: [PATCH 1379/1460] Code comment --- htdocs/core/class/ldap.class.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index e2ce33cc45f..4e0c2bd83ca 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -292,12 +292,12 @@ class Ldap } - /** - * Simply closes the connection set up earlier. - * Returns true if OK, false if there was an error. + * Simply closes the connection set up earlier. Returns true if OK, false if there was an error. + * This method seems a duplicate/alias of unbind(). * * @return boolean true or false + * @see unbind() */ public function close() { @@ -349,16 +349,21 @@ class Ldap } /** - * Unbind du serveur ldap. + * Unbind of LDAP server (close connection). * * @return boolean true or false + * @see close() */ public function unbind() { - if (!$this->result = @ldap_unbind($this->connection)) { - return false; - } else { + $this->result = true; + if ($this->connection) { + $this->result = @ldap_unbind($this->connection); + } + if ($this->result) { return true; + } else { + return false; } } From 3e46d5812915c8497ec28aaa8de9980ffe53e0a6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 1 Nov 2021 03:14:54 +0100 Subject: [PATCH 1380/1460] FIX Type of field progression in ticket must be integer --- .../install/mysql/migration/14.0.0-15.0.0.sql | 3 +++ htdocs/install/mysql/tables/llx_ticket.sql | 2 +- htdocs/ticket/class/ticket.class.php | 2 +- htdocs/ticket/list.php | 27 +++++++++---------- 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql index 6e751280a28..02a18f69a40 100644 --- a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql +++ b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql @@ -87,6 +87,9 @@ ALTER TABLE llx_product ADD COLUMN mandatory_period tinyint NULL DEFAULT 0; ALTER TABLE llx_holiday ADD COLUMN date_approve DATETIME DEFAULT NULL; ALTER TABLE llx_holiday ADD COLUMN fk_user_approve integer DEFAULT NULL; +ALTER TABLE llx_ticket MODIFY COLUMN progress integer; + + ALTER TABLE llx_emailcollector_emailcollectoraction MODIFY COLUMN actionparam TEXT; ALTER TABLE llx_knowledgemanagement_knowledgerecord ADD COLUMN lang varchar(6); diff --git a/htdocs/install/mysql/tables/llx_ticket.sql b/htdocs/install/mysql/tables/llx_ticket.sql index c053e787dfa..d891a65d502 100644 --- a/htdocs/install/mysql/tables/llx_ticket.sql +++ b/htdocs/install/mysql/tables/llx_ticket.sql @@ -29,7 +29,7 @@ CREATE TABLE llx_ticket message text, fk_statut integer, resolution integer, - progress varchar(100), + progress integer DEFAULT 0, -- progression 0 - 100 or null timing varchar(20), type_code varchar(32), category_code varchar(32), diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 2265bb2fb66..43bb2cd5835 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -271,7 +271,7 @@ class Ticket extends CommonObject 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'visible'=>-1, 'enabled'=>1, 'position'=>520, 'notnull'=>1), 'message' => array('type'=>'text', 'label'=>'Message', 'visible'=>-2, 'enabled'=>1, 'position'=>540, 'notnull'=>-1,), 'email_msgid' => array('type'=>'varchar(255)', 'label'=>'EmailMsgID', 'visible'=>-2, 'enabled'=>1, 'position'=>540, 'notnull'=>-1, 'help'=>'EmailMsgIDDesc'), - 'progress' => array('type'=>'varchar(100)', 'label'=>'Progression', 'visible'=>-1, 'enabled'=>1, 'position'=>540, 'notnull'=>-1, 'css'=>'right', 'help'=>"", 'isameasure'=>2), + 'progress' => array('type'=>'integer', 'label'=>'Progression', 'visible'=>-1, 'enabled'=>1, 'position'=>540, 'notnull'=>-1, 'css'=>'right', 'help'=>"", 'isameasure'=>2, 'csslist'=>'width50'), 'resolution' => array('type'=>'integer', 'label'=>'Resolution', 'visible'=>-1, 'enabled'=>'$conf->global->TICKET_ENABLE_RESOLUTION', 'position'=>550, 'notnull'=>1), 'fk_statut' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>600, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array(0 => 'Unread', 1 => 'Read', 3 => 'Answered', 4 => 'Assigned', 5 => 'InProgress', 6 => 'Waiting', 8 => 'SolvedClosed', 9 => 'Deleted')), 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>900), diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 1bac8af0e92..96ac7aab8be 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -334,20 +334,18 @@ $title = $langs->trans('TicketList'); // Build and execute select // -------------------------------------------------------------------- $sql = 'SELECT '; -foreach ($object->fields as $key => $val) { - $sql .= "t.".$key.", "; -} +$sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key." as options_".$key.', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : ''); } } // Add fields from hooks $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; -$sql = preg_replace('/, $/', '', $sql); +$sql = preg_replace('/,\s*$/', '', $sql); $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; @@ -424,7 +422,6 @@ if ($search_dateclose_end) { $sql .= " AND t.date_close <= '".$db->idate($search_dateclose_end)."'"; } - if (!$user->socid && ($mode == "mine" || (!$user->admin && $conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY))) { $sql .= " AND (t.fk_user_assign = ".((int) $user->id); if (empty($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY)) { @@ -675,8 +672,6 @@ $arrayofmassactions = array( ); if ($user->rights->ticket->write) { $arrayofmassactions['close'] = img_picto('', 'close_title', 'class="pictofixedwidth"').$langs->trans("Close"); -} -if ($user->rights->ticket->write) { $arrayofmassactions['reopen'] = img_picto('', 'folder-open', 'class="pictofixedwidth"').$langs->trans("ReOpen"); } if ($user->rights->ticket->delete) { @@ -768,18 +763,22 @@ print '
    '; if (GETPOST('set', 'alpha') == 'properties' && $user->rights->ticket->write) { - print ''; + print ''; } else { // Button to edit Properties if ($object->fk_statut < $object::STATUS_NEED_MORE_INFO && $user->rights->ticket->write) { - print ''.img_edit($langs->trans('Modify')).''; + print ' '.img_edit($langs->trans('Modify')).''; } } print '
    '; - print $langs->trans('TicketChangeType'); + print $langs->trans('Type'); print ''; $formticket->selectTypesTickets($object->type_code, 'update_value_type', '', 2); print '
    '; - print $langs->trans('TicketChangeCategory'); + print $langs->trans('TicketCategory'); print ''; - $formticket->selectGroupTickets($object->category_code, 'update_value_category', '', 2); + $formticket->selectGroupTickets($object->category_code, 'update_value_category', '', 2, 0, 0, 0, 'maxwidth500'); print '
    '; - print $langs->trans('TicketChangeSeverity'); + print $langs->trans('TicketSeverity'); print ''; $formticket->selectSeveritiesTickets($object->severity_code, 'update_value_severity', '', 2); print '
    '; foreach ($object->fields as $key => $val) { - $cssforfield = (empty($val['css']) ? '' : $val['css']); + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); if ($key == 'fk_statut') { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; - } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID') { + } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { $cssforfield .= ($cssforfield ? ' ' : '').'right'; } if (!empty($arrayfields['t.'.$key]['checked'])) { - if ($key == 'type_code') { + if ($key == 'progress') { + print ''; + } elseif ($key == 'type_code') { print ''; @@ -873,18 +872,18 @@ print ''."\n"; // -------------------------------------------------------------------- print ''; foreach ($object->fields as $key => $val) { - $cssforfield = (empty($val['css']) ? '' : $val['css']); + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); if ($key == 'fk_statut' || $key == 'severity_code') { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; - } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID') { + } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { $cssforfield .= ($cssforfield ? ' ' : '').'right'; } if (!empty($arrayfields['t.'.$key]['checked'])) { - print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, '', $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n"; + print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n"; } } $totalarray = array( From 2f7e246ab366735fbd199047cbde4cb82db59c1a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 1 Nov 2021 03:18:12 +0100 Subject: [PATCH 1381/1460] Merge --- htdocs/includes/printipp/http_class.php | 954 +++++++++++------------- 1 file changed, 446 insertions(+), 508 deletions(-) diff --git a/htdocs/includes/printipp/http_class.php b/htdocs/includes/printipp/http_class.php index 30bb33d663b..553152b5c90 100644 --- a/htdocs/includes/printipp/http_class.php +++ b/htdocs/includes/printipp/http_class.php @@ -4,7 +4,7 @@ /* ==================================================================== * GNU Lesser General Public License * Version 2.1, February 1999 - * + * * Class http_class - Basic http client with "Basic" and Digest/MD5 * authorization mechanism. * handle ipv4/v6 addresses, Unix sockets, http and https @@ -31,13 +31,13 @@ * This class is intended to implement a subset of Hyper Text Transfer Protocol * (HTTP/1.1) on client side (currently: POST operation), with file streaming * capability. - * + * * It can perform Basic and Digest authentication. - * + * * References needed to debug / add functionnalities: * - RFC 2616 * - RFC 2617 - * + * * * Class and Function List: * Function list: @@ -66,58 +66,55 @@ ************************/ class httpException extends Exception { - protected $errno; + protected $errno; - public function __construct ($msg, $errno = null) - { - parent::__construct ($msg); - $this->errno = $errno; - } + public function __construct($msg, $errno = null) + { + parent::__construct($msg); + $this->errno = $errno; + } - public function getErrorFormatted () - { - return sprintf ("[http_class]: %s -- "._(" file %s, line %s"), - $this->getMessage (), $this->getFile (), $this->getLine ()); - } + public function getErrorFormatted() + { + return sprintf("[http_class]: %s -- "._(" file %s, line %s"), + $this->getMessage(), $this->getFile(), $this->getLine()); + } - public function getErrno () - { - return $this->errno; - } + public function getErrno() + { + return $this->errno; + } } function error2string($value) { - $level_names = array( - E_ERROR => 'E_ERROR', - E_WARNING => 'E_WARNING', - E_PARSE => 'E_PARSE', - E_NOTICE => 'E_NOTICE', - E_CORE_ERROR => 'E_CORE_ERROR', - E_CORE_WARNING => 'E_CORE_WARNING', - E_COMPILE_ERROR => 'E_COMPILE_ERROR', - E_COMPILE_WARNING => 'E_COMPILE_WARNING', - E_USER_ERROR => 'E_USER_ERROR', - E_USER_WARNING => 'E_USER_WARNING', - E_USER_NOTICE => 'E_USER_NOTICE' - ); - if(defined('E_STRICT')) { - $level_names[E_STRICT]='E_STRICT'; - } - $levels=array(); - if(($value&E_ALL)==E_ALL) - { - $levels[]='E_ALL'; - $value&=~E_ALL; - } - foreach($level_names as $level=>$name) - { - if(($value&$level)==$level) - { - $levels[]=$name; - } - } - return implode(' | ',$levels); + $level_names = array( + E_ERROR => 'E_ERROR', + E_WARNING => 'E_WARNING', + E_PARSE => 'E_PARSE', + E_NOTICE => 'E_NOTICE', + E_CORE_ERROR => 'E_CORE_ERROR', + E_CORE_WARNING => 'E_CORE_WARNING', + E_COMPILE_ERROR => 'E_COMPILE_ERROR', + E_COMPILE_WARNING => 'E_COMPILE_WARNING', + E_USER_ERROR => 'E_USER_ERROR', + E_USER_WARNING => 'E_USER_WARNING', + E_USER_NOTICE => 'E_USER_NOTICE' + ); + if (defined('E_STRICT')) { + $level_names[E_STRICT]='E_STRICT'; + } + $levels=array(); + if (($value&E_ALL)==E_ALL) { + $levels[]='E_ALL'; + $value&=~E_ALL; + } + foreach ($level_names as $level=>$name) { + if (($value&$level)==$level) { + $levels[]=$name; + } + } + return implode(' | ', $levels); } /*********************** @@ -127,486 +124,427 @@ function error2string($value) ************************/ class http_class { - // variables declaration - public $debug; - public $html_debug; - public $timeout = 30; // time waiting for connection, seconds - public $data_timeout = 30; // time waiting for data, milliseconds - public $data_chunk_timeout = 1; // time waiting between data chunks, millisecond - public $force_multipart_form_post; - public $username; - public $password; - public $request_headers = array (); - public $request_body = "Not a useful information"; - public $status; - public $window_size = 1024; // chunk size of data - public $with_exceptions = 0; // compatibility mode for old scripts - public $port; - public $host; - private $default_port = 631; - private $headers; - private $reply_headers = array (); - private $reply_body = array (); - private $connection; - private $arguments; - private $bodystream = array (); - private $last_limit; - private $connected; - private $nc = 1; - private $user_agent = "PRINTIPP/0.81+CVS"; - private $readed_bytes = 0; + // variables declaration + public $debug; + public $html_debug; + public $timeout = 30; // time waiting for connection, seconds + public $data_timeout = 30; // time waiting for data, milliseconds + public $data_chunk_timeout = 1; // time waiting between data chunks, millisecond + public $force_multipart_form_post; + public $username; + public $password; + public $request_headers = array (); + public $request_body = "Not a useful information"; + public $status; + public $window_size = 1024; // chunk size of data + public $with_exceptions = 0; // compatibility mode for old scripts + public $port; + public $host; + private $default_port = 631; + private $headers; + private $reply_headers = array (); + private $reply_body = array (); + private $connection; + private $arguments; + private $bodystream = array (); + private $last_limit; + private $connected; + private $nc = 1; + private $user_agent = "PRINTIPP/0.81+CVS"; + private $readed_bytes = 0; - public function __construct () - { - true; - } + public function __construct() + { + true; + } - /********************* - * - * Public functions - * - **********************/ + /********************* + * + * Public functions + * + **********************/ - public function GetRequestArguments ($url, &$arguments) - { - $this->arguments = array (); - $this->arguments["URL"] = $arguments["URL"] = $url; - $this->arguments["RequestMethod"] = $arguments["RequestMethod"] = "POST"; - $this->headers["Content-Length"] = 0; - $this->headers["Content-Type"] = "application/octet-stream"; - $this->headers["Host"] = $this->host; - $this->headers["User-Agent"] = $this->user_agent; - //$this->headers["Expect"] = "100-continue"; - } + public function GetRequestArguments($url, &$arguments) + { + $this->arguments = array (); + $this->arguments["URL"] = $arguments["URL"] = $url; + $this->arguments["RequestMethod"] = $arguments["RequestMethod"] = "POST"; + $this->headers["Content-Length"] = 0; + $this->headers["Content-Type"] = "application/octet-stream"; + $this->headers["Host"] = $this->host; + $this->headers["User-Agent"] = $this->user_agent; + //$this->headers["Expect"] = "100-continue"; + } - public function Open ($arguments) - { - $this->connected = false; - $url = $arguments["URL"]; - $port = $this->default_port; - #$url = split (':', $url, 2); - $url = preg_split ('#:#', $url, 2); - $transport_type = $url[0]; - $unix = false; - switch ($transport_type) - { - case 'http': - $transport_type = 'tcp://'; - break; + public function Open($arguments) + { + $this->connected = false; + $url = $arguments["URL"]; + $port = $this->default_port; + // $url = split (':', $url, 2); + $url = preg_split('#:#', $url, 2); + $transport_type = $url[0]; + $unix = false; + switch ($transport_type) { + case 'http': + $transport_type = 'tcp://'; + break; - case 'https': - $transport_type = 'tls://'; - break; + case 'https': + $transport_type = 'tls://'; + break; - case 'unix': - $transport_type = 'unix://'; - $port = 0; - $unix = true; - break; + case 'unix': + $transport_type = 'unix://'; + $port = 0; + $unix = true; + break; - default: - $transport_type = 'tcp://'; - break; - } - $url = $url[1]; - if (!$unix) - { - #$url = split ("/", preg_replace ("#^/{1,}#", '', $url), 2); - $url = preg_split ("#/#", preg_replace ("#^/{1,}#", '', $url), 2); - $url = $url[0]; - $port = $this->port; - $error = sprintf (_("Cannot resolve url: %s"), $url); - $ip = gethostbyname ($url); - $ip = @gethostbyaddr ($ip); - if (!$ip) - { - return $this->_HttpError ($error, E_USER_WARNING); - } - if (strstr ($url, ":")) // we got an ipv6 address - { - if (!strstr ($url, "[")) // it is not escaped - { - $url = sprintf ("[%s]", $url); - } - } - } - $this->connection = @fsockopen ($transport_type.$url, $port, $errno, $errstr, $this->timeout); - $error = - sprintf (_('Unable to connect to "%s%s port %s": %s'), $transport_type, - $url, $port, $errstr); - if (!$this->connection) - { - return $this->_HttpError ($error, E_USER_WARNING); - } - $this->connected = true; - return array (true, "success"); - } + default: + $transport_type = 'tcp://'; + break; + } + $url = $url[1]; + if (!$unix) { + // $url = split ("/", preg_replace ("#^/{1,}#", '', $url), 2); + $url = preg_split("#/#", preg_replace("#^/{1,}#", '', $url), 2); + $url = $url[0]; + $port = $this->port; + $error = sprintf(_("Cannot resolve url: %s"), $url); + $ip = gethostbyname($url); + $ip = @gethostbyaddr($ip); + if (!$ip) { + return $this->_HttpError($error, E_USER_WARNING); + } + if (strstr($url, ":")) { // we got an ipv6 address + if (!strstr($url, "[")) { // it is not escaped + $url = sprintf("[%s]", $url); + } + } + } + $this->connection = @fsockopen($transport_type.$url, $port, $errno, $errstr, $this->timeout); + $error = + sprintf(_('Unable to connect to "%s%s port %s": %s'), $transport_type, + $url, $port, $errstr); + if (!$this->connection) { + return $this->_HttpError($error, E_USER_WARNING); + } + $this->connected = true; + return array (true, "success"); + } - public function SendRequest ($arguments) - { - $error = - sprintf (_('Streaming request failed to %s'), $arguments['RequestURI']); - $result = self::_StreamRequest ($arguments); - if (!$result[0]) - { - return $this->_HttpError ($error." ".$result[1], E_USER_WARNING); - } - self::_ReadReply (); - if (!preg_match ('#http/1.1 401 unauthorized#', $this->status)) - { - return array (true, "success"); - } - $headers = array_keys ($this->reply_headers); - $error = _("need authentication but no mechanism provided"); - if (!in_array ("www-authenticate", $headers)) - { - return $this->_HttpError ($error, E_USER_WARNING); - } - #$authtype = split (' ', $this->reply_headers["www-authenticate"]); - $authtype = preg_split ('# #', $this->reply_headers["www-authenticate"]); - $authtype = strtolower ($authtype[0]); - switch ($authtype) - { - case 'basic': - $pass = base64_encode ($this->user.":".$this->password); - $arguments["Headers"]["Authorization"] = "Basic ".$pass; - break; + public function SendRequest($arguments) + { + $error = + sprintf(_('Streaming request failed to %s'), $arguments['RequestURI']); + $result = self::_StreamRequest($arguments); + if (!$result[0]) { + return $this->_HttpError($error." ".$result[1], E_USER_WARNING); + } + self::_ReadReply(); + if (!preg_match('#http/1.1 401 unauthorized#', $this->status)) { + return array (true, "success"); + } + $headers = array_keys($this->reply_headers); + $error = _("need authentication but no mechanism provided"); + if (!in_array("www-authenticate", $headers)) { + return $this->_HttpError($error, E_USER_WARNING); + } + // $authtype = split (' ', $this->reply_headers["www-authenticate"]); + $authtype = preg_split('# #', $this->reply_headers["www-authenticate"]); + $authtype = strtolower($authtype[0]); + switch ($authtype) { + case 'basic': + $pass = base64_encode($this->user.":".$this->password); + $arguments["Headers"]["Authorization"] = "Basic ".$pass; + break; - case 'digest': - $arguments["Headers"]["Authorization"] = self::_BuildDigest (); - break; + case 'digest': + $arguments["Headers"]["Authorization"] = self::_BuildDigest(); + break; - default: - $error = - sprintf (_("need '%s' authentication mechanism, but have not"), - $authtype[0]); - return $this->_HttpError ($error, E_USER_WARNING); - break; - } - self::Close (); - self::Open ($arguments); + default: + $error = + sprintf(_("need '%s' authentication mechanism, but have not"), + $authtype[0]); + return $this->_HttpError($error, E_USER_WARNING); + break; + } + self::Close(); + self::Open($arguments); - $error = sprintf(_('Streaming request failed to %s after a try to authenticate'), $arguments['RequestURI']); - $result = self::_StreamRequest ($arguments); - if (!$result[0]) - { - return $this->_HttpError ($error.": ".$result[1], E_USER_WARNING); - } - self::_ReadReply (); - return array (true, "success"); - } + $error = sprintf(_('Streaming request failed to %s after a try to authenticate'), $arguments['RequestURI']); + $result = self::_StreamRequest($arguments); + if (!$result[0]) { + return $this->_HttpError($error.": ".$result[1], E_USER_WARNING); + } + self::_ReadReply(); + return array (true, "success"); + } - public function ReadReplyHeaders (&$headers) - { - $headers = $this->reply_headers; - } + public function ReadReplyHeaders(&$headers) + { + $headers = $this->reply_headers; + } - public function ReadReplyBody (&$body, $chunk_size) - { - $body = substr ($this->reply_body, $this->last_limit, $chunk_size); - $this->last_limit += $chunk_size; - } + public function ReadReplyBody(&$body, $chunk_size) + { + $body = substr($this->reply_body, $this->last_limit, $chunk_size); + $this->last_limit += $chunk_size; + } - public function Close () - { - if (!$this->connected) - { - return; - } - fclose ($this->connection); - } + public function Close() + { + if (!$this->connected) { + return; + } + fclose($this->connection); + } - /********************* - * - * Private functions - * - *********************/ + /********************* + * + * Private functions + * + *********************/ - private function _HttpError ($msg, $level, $errno = null) - { - $trace = ''; - $backtrace = debug_backtrace(); - foreach ($backtrace as $trace) - { - $trace .= sprintf ("in [file: '%s'][function: '%s'][line: %s];\n", $trace['file'], $trace['function'],$trace['line']); - } - $msg = sprintf ( '%s\n%s: [errno: %s]: %s', - $trace, error2string ($level), $errno, $msg); - if ($this->with_exceptions) - { - throw new httpException ($msg, $errno); - } - else - { - trigger_error ($msg, $level); - return array (false, $msg); - } - } + private function _HttpError($msg, $level, $errno = null) + { + $trace = ''; + $backtrace = debug_backtrace(); + foreach ($backtrace as $trace) { + $trace .= sprintf("in [file: '%s'][function: '%s'][line: %s];\n", $trace['file'], $trace['function'], $trace['line']); + } + $msg = sprintf( '%s\n%s: [errno: %s]: %s', + $trace, error2string($level), $errno, $msg); + if ($this->with_exceptions) { + throw new httpException($msg, $errno); + } else { + trigger_error($msg, $level); + return array (false, $msg); + } + } - private function _streamString ($string) - { - $success = fwrite ($this->connection, $string); - if (!$success) - { - return false; - } - return true; - } + private function _streamString($string) + { + $success = fwrite($this->connection, $string); + if (!$success) { + return false; + } + return true; + } - private function _StreamRequest ($arguments) - { - $this->status = false; - $this->reply_headers = array (); - $this->reply_body = ""; - if (!$this->connected) - { - return $this->_HttpError (_("not connected"), E_USER_WARNING); - } - $this->arguments = $arguments; - $content_length = 0; - foreach ($this->arguments["BodyStream"] as $argument) - { - list ($type, $value) = each ($argument); - reset ($argument); - if ($type == "Data") - { - $length = strlen ($value); - } - elseif ($type == "File") - { - if (is_readable ($value)) - { - $length = filesize ($value); - } - else - { - $length = 0; - return $this->_HttpError (sprintf (_("%s: file is not readable"), $value), E_USER_WARNING); - } - } - else - { - $length = 0; - return $this->_HttpError (sprintf(_("%s: not a valid argument for content"), $type), E_USER_WARNING); - } - $content_length += $length; - } - $this->request_body = sprintf (_("%s Bytes"), $content_length); - $this->headers["Content-Length"] = $content_length; - $this->arguments["Headers"] = array_merge ($this->headers, $this->arguments["Headers"]); - if ($this->arguments["RequestMethod"] != "POST") - { - return $this->_HttpError (sprintf(_("%s: method not implemented"), $arguments["RequestMethod"]), E_USER_WARNING); - } - $string = sprintf ("POST %s HTTP/1.1\r\n", $this->arguments["RequestURI"]); - $this->request_headers[$string] = ''; - if (!$this->_streamString ($string)) - { - return $this->_HttpError (_("Error while puts POST operation"), E_USER_WARNING); - } - foreach ($this->arguments["Headers"] as $header => $value) - { - $string = sprintf ("%s: %s\r\n", $header, $value); - $this->request_headers[$header] = $value; - if (!$this->_streamString ($string)) - { - return $this->_HttpError (_("Error while puts HTTP headers"), E_USER_WARNING); - } - } - $string = "\r\n"; - if (!$this->_streamString ($string)) - { - return $this->_HttpError (_("Error while ends HTTP headers"), E_USER_WARNING); - } - foreach ($this->arguments["BodyStream"] as $argument) - { - list ($type, $value) = each ($argument); - reset ($argument); - if ($type == "Data") - { - $streamed_length = 0; - while ($streamed_length < strlen ($value)) - { - $string = substr ($value, $streamed_length, $this->window_size); - if (!$this->_streamString ($string)) - { - return $this->_HttpError (_("error while sending body data"), E_USER_WARNING); - } - $streamed_length += $this->window_size; - } - } - elseif ($type == "File") - { - if (is_readable ($value)) - { - $file = fopen ($value, 'rb'); - while (!feof ($file)) - { - if (gettype ($block = @fread ($file, $this->window_size)) != "string") - { - return $this->_HttpError (_("cannot read file to upload"), E_USER_WARNING); - } - if (!$this->_streamString ($block)) - { - return $this->_HttpError (_("error while sending body data"), E_USER_WARNING); - } - } - } - } - } - return array (true, "success"); - } + private function _StreamRequest($arguments) + { + $this->status = false; + $this->reply_headers = array (); + $this->reply_body = ""; + if (!$this->connected) { + return $this->_HttpError(_("not connected"), E_USER_WARNING); + } + $this->arguments = $arguments; + $content_length = 0; + foreach ($this->arguments["BodyStream"] as $argument) { + // list ($type, $value) = each ($argument); + $type = key($argument); + $value = current($argument); + reset($argument); + if ($type == "Data") { + $length = strlen($value); + } elseif ($type == "File") { + if (is_readable($value)) { + $length = filesize($value); + } else { + $length = 0; + return $this->_HttpError(sprintf(_("%s: file is not readable"), $value), E_USER_WARNING); + } + } else { + $length = 0; + return $this->_HttpError(sprintf(_("%s: not a valid argument for content"), $type), E_USER_WARNING); + } + $content_length += $length; + } + $this->request_body = sprintf(_("%s Bytes"), $content_length); + $this->headers["Content-Length"] = $content_length; + $this->arguments["Headers"] = array_merge($this->headers, $this->arguments["Headers"]); + if ($this->arguments["RequestMethod"] != "POST") { + return $this->_HttpError(sprintf(_("%s: method not implemented"), $arguments["RequestMethod"]), E_USER_WARNING); + } + $string = sprintf("POST %s HTTP/1.1\r\n", $this->arguments["RequestURI"]); + $this->request_headers[$string] = ''; + if (!$this->_streamString($string)) { + return $this->_HttpError(_("Error while puts POST operation"), E_USER_WARNING); + } + foreach ($this->arguments["Headers"] as $header => $value) { + $string = sprintf("%s: %s\r\n", $header, $value); + $this->request_headers[$header] = $value; + if (!$this->_streamString($string)) { + return $this->_HttpError(_("Error while puts HTTP headers"), E_USER_WARNING); + } + } + $string = "\r\n"; + if (!$this->_streamString($string)) { + return $this->_HttpError(_("Error while ends HTTP headers"), E_USER_WARNING); + } + foreach ($this->arguments["BodyStream"] as $argument) { + // list ($type, $value) = each ($argument); + $type = key($argument); + $value = current($argument); + reset($argument); + if ($type == "Data") { + $streamed_length = 0; + while ($streamed_length < strlen($value)) { + $string = substr($value, $streamed_length, $this->window_size); + if (!$this->_streamString($string)) { + return $this->_HttpError(_("error while sending body data"), E_USER_WARNING); + } + $streamed_length += $this->window_size; + } + } elseif ($type == "File") { + if (is_readable($value)) { + $file = fopen($value, 'rb'); + while (!feof($file)) { + if (gettype($block = @fread($file, $this->window_size)) != "string") { + return $this->_HttpError(_("cannot read file to upload"), E_USER_WARNING); + } + if (!$this->_streamString($block)) { + return $this->_HttpError(_("error while sending body data"), E_USER_WARNING); + } + } + } + } + } + return array (true, "success"); + } - private function _ReadReply () - { - if (!$this->connected) - { - return array (false, _("not connected")); - } - $this->reply_headers = array (); - $this->reply_body = ""; - $headers = array (); - $body = ""; - while (!feof ($this->connection)) - { - $line = fgets ($this->connection, 1024); - if (strlen (trim($line)) == 0) - { - break; - } // \r\n => end of headers - if (preg_match ('#^[[:space:]]#', $line)) - { - $headers[-1] .= sprintf(' %s', trim ($line)); - continue; - } - $headers[] = trim ($line); - } - $this->status = isset ($headers[0]) ? strtolower ($headers[0]) : false; - foreach ($headers as $header) - { - $header = preg_split ("#: #", $header); - $header[0] = strtolower ($header[0]); - if ($header[0] !== "www-authenticate") - { - $header[1] = isset ($header[1]) ? strtolower ($header[1]) : ""; - } - if (!isset ($this->reply_headers[$header[0]])) - { - $this->reply_headers[$header[0]] = $header[1]; - } - } - self::_ReadStream (); - return true; - } + private function _ReadReply() + { + if (!$this->connected) { + return array (false, _("not connected")); + } + $this->reply_headers = array (); + $this->reply_body = ""; + $headers = array (); + $body = ""; + while (!feof($this->connection)) { + $line = fgets($this->connection, 1024); + if (strlen(trim($line)) == 0) { + break; + } // \r\n => end of headers + if (preg_match('#^[[:space:]]#', $line)) { + $headers[-1] .= sprintf(' %s', trim($line)); + continue; + } + $headers[] = trim($line); + } + $this->status = isset($headers[0]) ? strtolower($headers[0]) : false; + foreach ($headers as $header) { + $header = preg_split("#: #", $header); + $header[0] = strtolower($header[0]); + if ($header[0] !== "www-authenticate") { + $header[1] = isset($header[1]) ? strtolower($header[1]) : ""; + } + if (!isset($this->reply_headers[$header[0]])) { + $this->reply_headers[$header[0]] = $header[1]; + } + } + self::_ReadStream(); + return true; + } - private function _ReadStream () - { - if (! array_key_exists ("content-length", $this->reply_headers)) - { - stream_set_blocking($this->connection, 0); - $this->reply_body = stream_get_contents($this->connection); - return true; - } - stream_set_blocking($this->connection, 1); - $content_length = $this->reply_headers["content-length"]; - $this->reply_body = stream_get_contents($this->connection,$content_length); - return true; - } + private function _ReadStream() + { + if (! array_key_exists("content-length", $this->reply_headers)) { + stream_set_blocking($this->connection, 0); + $this->reply_body = stream_get_contents($this->connection); + return true; + } + stream_set_blocking($this->connection, 1); + $content_length = $this->reply_headers["content-length"]; + $this->reply_body = stream_get_contents($this->connection, $content_length); + return true; + } - private function _BuildDigest () - { - $auth = $this->reply_headers["www-authenticate"]; - #list ($head, $auth) = split (" ", $auth, 2); - list ($head, $auth) = preg_split ("# #", $auth, 2); - #$auth = split (", ", $auth); - $auth = preg_split ("#, #", $auth); - foreach ($auth as $sheme) - { - #list ($sheme, $value) = split ('=', $sheme); - list ($sheme, $value) = preg_split ('#=#', $sheme); - $fields[$sheme] = trim (trim ($value), '"'); - } - $nc = sprintf ('%x', $this->nc); - $prepend = ""; - while ((strlen ($nc) + strlen ($prepend)) < 8) - $prependi .= "0"; - $nc = $prepend.$nc; - $cnonce = "printipp"; - $username = $this->user; - $password = $this->password; - $A1 = $username.":".$fields["realm"].":".$password; - if (array_key_exists ("algorithm", $fields)) - { - $algorithm = strtolower ($fields["algorithm"]); - switch ($algorithm) - { - case "md5": - break; + private function _BuildDigest() + { + $auth = $this->reply_headers["www-authenticate"]; + // list ($head, $auth) = split (" ", $auth, 2); + list ($head, $auth) = preg_split("# #", $auth, 2); + // $auth = split (", ", $auth); + $auth = preg_split("#, #", $auth); + foreach ($auth as $sheme) { + // list ($sheme, $value) = split ('=', $sheme); + list ($sheme, $value) = preg_split('#=#', $sheme); + $fields[$sheme] = trim(trim($value), '"'); + } + $nc = sprintf('%x', $this->nc); + $prepend = ""; + while ((strlen($nc) + strlen($prepend)) < 8) + $prependi .= "0"; + $nc = $prepend.$nc; + $cnonce = "printipp"; + $username = $this->user; + $password = $this->password; + $A1 = $username.":".$fields["realm"].":".$password; + if (array_key_exists("algorithm", $fields)) { + $algorithm = strtolower($fields["algorithm"]); + switch ($algorithm) { + case "md5": + break; - case "md5-sess": - $A1 = - $username.":".$fields["realm"].":".$password.":". - $fields['nonce'].":".$cnonce; - break; + case "md5-sess": + $A1 = + $username.":".$fields["realm"].":".$password.":". + $fields['nonce'].":".$cnonce; + break; - default: - return $this->_HttpError( - sprintf (_("digest Authorization: algorithm '%s' not implemented"), - $algorithm), - E_USER_WARNING); - return false; - break; - } - } - $A2 = "POST:".$this->arguments["RequestURI"]; - if (array_key_exists ("qop", $fields)) - { - $qop = strtolower ($fields["qop"]); - #$qop = split (" ", $qop); - $qop = preg_split ("# #", $qop); - if (in_array ("auth", $qop)) - { - $qop = "auth"; - } - else - { - self::_HttpError( - sprintf (_("digest Authorization: algorithm '%s' not implemented"), - $qop), - E_USER_WARNING); - return false; - } - } - $response = md5 (md5 ($A1).":".$fields["nonce"].":".md5 ($A2)); - if (isset ($qop) && ($qop == "auth")) - { - $response = - md5 (md5 ($A1).":".$fields["nonce"].":".$nc.":".$cnonce.":".$qop. - ":".$A2); - } - $auth_scheme = - sprintf - ('Digest username="%s", realm="%s", nonce="%s", uri="%s", response="%s"', - $username, $fields["realm"], $fields['nonce'], - $this->arguments["RequestURI"], $response); - if (isset ($algorithm)) - { - $auth_scheme .= sprintf (', algorithm="%s"', $algorithm); - } - if (isset ($qop)) - { - $auth_scheme .= sprintf (', cnonce="%s"', $cnonce); - } - if (array_key_exists ("opaque", $fields)) - { - $auth_scheme .= sprintf (', opaque="%s"', $fields['opaque']); - } - if (isset ($qop)) - { - $auth_scheme .= sprintf (', qop="%s"', $qop); - } - $auth_scheme .= sprintf (', nc=%s', $nc); - $this->nc++; - return $auth_scheme; - } + default: + return $this->_HttpError( + sprintf(_("digest Authorization: algorithm '%s' not implemented"), + $algorithm), + E_USER_WARNING); + return false; + break; + } + } + $A2 = "POST:".$this->arguments["RequestURI"]; + if (array_key_exists("qop", $fields)) { + $qop = strtolower($fields["qop"]); + // $qop = split (" ", $qop); + $qop = preg_split("# #", $qop); + if (in_array("auth", $qop)) { + $qop = "auth"; + } else { + self::_HttpError( + sprintf(_("digest Authorization: algorithm '%s' not implemented"), + $qop), + E_USER_WARNING); + return false; + } + } + $response = md5(md5($A1).":".$fields["nonce"].":".md5($A2)); + if (isset($qop) && ($qop == "auth")) { + $response = + md5(md5($A1).":".$fields["nonce"].":".$nc.":".$cnonce.":".$qop. + ":".$A2); + } + $auth_scheme = + sprintf('Digest username="%s", realm="%s", nonce="%s", uri="%s", response="%s"', + $username, $fields["realm"], $fields['nonce'], + $this->arguments["RequestURI"], $response); + if (isset($algorithm)) { + $auth_scheme .= sprintf(', algorithm="%s"', $algorithm); + } + if (isset($qop)) { + $auth_scheme .= sprintf(', cnonce="%s"', $cnonce); + } + if (array_key_exists("opaque", $fields)) { + $auth_scheme .= sprintf(', opaque="%s"', $fields['opaque']); + } + if (isset($qop)) { + $auth_scheme .= sprintf(', qop="%s"', $qop); + } + $auth_scheme .= sprintf(', nc=%s', $nc); + $this->nc++; + return $auth_scheme; + } } From 3e1fa44657b90bd2212072f8f8e9543eee2cb619 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 1 Nov 2021 03:23:38 +0100 Subject: [PATCH 1382/1460] Fix phpdoc --- htdocs/core/lib/functions.lib.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 2a48858c9f6..408a771e1ed 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4500,7 +4500,7 @@ function info_admin($text, $infoonimgalt = 0, $nodiv = 0, $admin = '1', $morecss * This function must be called when a blocking technical error is encountered. * However, one must try to call it only within php pages, classes must return their error through their property "error". * - * @param DoliDB? $db Database handler + * @param DoliDB|string $db Database handler * @param string|string[] $error String or array of errors strings to show * @param array $errors Array of errors * @return void @@ -5193,16 +5193,16 @@ function vatrate($rate, $addpercent = false, $info_bits = 0, $usestarfornpr = 0) * Function to format a value into an amount for visual output * Function used into PDF and HTML pages * - * @param float $amount Amount to format - * @param integer $form Type of format, HTML or not (not by default) - * @param Translate? $outlangs Object langs for output - * @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) - * @param string $currency_code To add currency symbol (''=add nothing, 'auto'=Use default currency, 'XXX'=add currency symbols for XXX currency) - * @return string Chaine avec montant formate + * @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 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) + * @param string $currency_code To add currency symbol (''=add nothing, 'auto'=Use default currency, 'XXX'=add currency symbols for XXX currency) + * @return string String with formated amount * - * @see price2num() Revert function of price + * @see price2num() Revert function of price */ function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $forcerounding = -1, $currency_code = '') { From 7d07da527d2c2a93a0d3a938ed2dff3c8f8e4801 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 1 Nov 2021 03:30:22 +0100 Subject: [PATCH 1383/1460] Debug v15 --- htdocs/core/db/DoliDB.class.php | 17 +++++++++-------- htdocs/hrm/compare.php | 5 ++++- htdocs/takepos/invoice.php | 2 +- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php index 29ced10dc35..a30fa5f4f7e 100644 --- a/htdocs/core/db/DoliDB.class.php +++ b/htdocs/core/db/DoliDB.class.php @@ -318,14 +318,14 @@ abstract class DoliDB implements Database /** * Return first result from query as object * Note : This method executes a given SQL query and retrieves the first row of results as an object. It should only be used with SELECT queries - * Dont add LIMIT to your query, it will be added by this method - * @param string $sql the sql query string - * @return bool| object - * @deprecated + * Dont add LIMIT to your query, it will be added by this method. + * + * @param string $sql The sql query string + * @return bool|object Result of fetch_object */ public function getRow($sql) { - $sql .= ' LIMIT 1;'; + $sql .= ' LIMIT 1'; $res = $this->query($sql); if ($res) { @@ -338,9 +338,10 @@ abstract class DoliDB implements Database /** * return all results from query as an array of objects * Note : This method executes a given SQL query and retrieves all row of results as an array of objects. It should only be used with SELECT queries - * be carefull with this method use it only with some limit of results to avoid performences loss - * @param string $sql the sql query string - * @return bool| array + * be carefull with this method use it only with some limit of results to avoid performences loss. + * + * @param string $sql The sql query string + * @return bool|array Result * @deprecated */ public function getRows($sql) diff --git a/htdocs/hrm/compare.php b/htdocs/hrm/compare.php index 13b83af9737..07097443628 100644 --- a/htdocs/hrm/compare.php +++ b/htdocs/hrm/compare.php @@ -256,10 +256,13 @@ $fk_usergroup1 = GETPOST('fk_usergroup1'); update_note_public($desc); + $invoice->update_note($desc, '_public'); } else foreach ($invoice->lines as $line) { if ($line->id == $idline) { $result = $invoice->updateline($line->id, $desc, $line->subprice, $line->qty, $line->remise_percent, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit); From cb8e1ce8f034903e5d3c5010abc326f776eb16a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 1 Nov 2021 09:20:22 +0100 Subject: [PATCH 1384/1460] fix warning --- htdocs/core/actions_addupdatedelete.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 6fd84f4eda3..dff83eb508c 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -110,7 +110,7 @@ if ($action == 'add' && !empty($permissiontoadd)) { } // Validation of fields values - if ($conf->global->MAIN_FEATURE_LEVEL >= 2 || !empty($conf->global->MAIN_ACTIVATE_VALIDATION_RESULT)) { + if (getDolGlobalInt('MAIN_FEATURE_LEVEL') >= 2 || !empty($conf->global->MAIN_ACTIVATE_VALIDATION_RESULT)) { if (!$error && !empty($val['validate']) && is_callable(array($object, 'validateField'))) { if (!$object->validateField($object->fields, $key, $value)) { $error++; From aaadeb1b9db153e2664f9030efbbb1a737995325 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 1 Nov 2021 09:27:32 +0100 Subject: [PATCH 1385/1460] fix change sql --- htdocs/hrm/class/skilldet.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/hrm/class/skilldet.class.php b/htdocs/hrm/class/skilldet.class.php index 1fb90b907db..c3acdd0982e 100644 --- a/htdocs/hrm/class/skilldet.class.php +++ b/htdocs/hrm/class/skilldet.class.php @@ -104,7 +104,7 @@ class Skilldet extends CommonObject */ public $fields=array( 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), - 'rank' => array('type'=>'integer', 'label'=>'rank', 'enabled'=>'1', 'position'=>2, 'notnull'=>0, 'visible'=>2,), + 'rankorder' => array('type'=>'integer', 'label'=>'rank', 'enabled'=>'1', 'position'=>2, 'notnull'=>0, 'visible'=>2,), 'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>1,), 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>'1', 'position'=>510, 'notnull'=>1, 'visible'=>-2, 'foreignkey'=>'user.rowid',), 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>'1', 'position'=>511, 'notnull'=>-1, 'visible'=>0,), From f99a11b876324d5b87c0bd1401f470d4d62fc380 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 1 Nov 2021 09:28:51 +0100 Subject: [PATCH 1386/1460] Update evaluationdet.class.php --- htdocs/hrm/class/evaluationdet.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/hrm/class/evaluationdet.class.php b/htdocs/hrm/class/evaluationdet.class.php index a268f1b30be..115571bb6ba 100644 --- a/htdocs/hrm/class/evaluationdet.class.php +++ b/htdocs/hrm/class/evaluationdet.class.php @@ -111,7 +111,7 @@ class Evaluationline extends CommonObject 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>'1', 'position'=>511, 'notnull'=>-1, 'visible'=>-2,), 'fk_skill' => array('type'=>'integer:Skill:hrm/class/skill.class.php:1', 'label'=>'Skill', 'enabled'=>'1', 'position'=>3, 'notnull'=>1, 'visible'=>1, 'index'=>1,), 'fk_evaluation' => array('type'=>'integer:Evaluation:hrm/class/evaluation.class.php:1', 'label'=>'Evaluation', 'enabled'=>'1', 'position'=>3, 'notnull'=>1, 'visible'=>1, 'index'=>1,), - 'rank' => array('type'=>'integer', 'label'=>'Rank', 'enabled'=>'1', 'position'=>4, 'notnull'=>1, 'visible'=>1,), + 'rankorder' => array('type'=>'integer', 'label'=>'Rank', 'enabled'=>'1', 'position'=>4, 'notnull'=>1, 'visible'=>1,), 'required_rank' => array('type'=>'integer', 'label'=>'requiredRank', 'enabled'=>'1', 'position'=>5, 'notnull'=>1, 'visible'=>1,), 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,), ); From b992deb08444b8a620af8773e6a2c741e119964e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 1 Nov 2021 09:44:43 +0100 Subject: [PATCH 1387/1460] fix warnings --- htdocs/core/modules/printing/printipp.modules.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/modules/printing/printipp.modules.php b/htdocs/core/modules/printing/printipp.modules.php index f290b2b4e90..02ba610961d 100644 --- a/htdocs/core/modules/printing/printipp.modules.php +++ b/htdocs/core/modules/printing/printipp.modules.php @@ -1,6 +1,6 @@ + * Copyright (C) 2014-2021 Frederic France * * 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 @@ -108,10 +108,10 @@ class printing_printipp extends PrintingDriver global $conf; $this->db = $db; - $this->host = $conf->global->PRINTIPP_HOST; - $this->port = $conf->global->PRINTIPP_PORT; - $this->user = $conf->global->PRINTIPP_USER; - $this->password = $conf->global->PRINTIPP_PASSWORD; + $this->host = getDolGlobalString('PRINTIPP_HOST'); + $this->port = getDolGlobalString('PRINTIPP_PORT'); + $this->user = getDolGlobalString('PRINTIPP_USER'); + $this->password = getDolGlobalString('PRINTIPP_PASSWORD'); $this->conf[] = array('varname'=>'PRINTIPP_HOST', 'required'=>1, 'example'=>'localhost', 'type'=>'text'); $this->conf[] = array('varname'=>'PRINTIPP_PORT', 'required'=>1, 'example'=>'631', 'type'=>'text'); $this->conf[] = array('varname'=>'PRINTIPP_USER', 'required'=>0, 'example'=>'', 'type'=>'text', 'moreattributes'=>'autocomplete="off"'); @@ -159,8 +159,8 @@ class printing_printipp extends PrintingDriver $ipp->setCopies($obj->copy); } else { if (!empty($conf->global->PRINTIPP_URI_DEFAULT)) { - dol_syslog("Will use default printer conf->global->PRINTIPP_URI_DEFAULT = ".$conf->global->PRINTIPP_URI_DEFAULT); - $ipp->setPrinterURI($conf->global->PRINTIPP_URI_DEFAULT); + dol_syslog("Will use default printer conf->global->PRINTIPP_URI_DEFAULT = ".getDolGlobalString('PRINTIPP_URI_DEFAULT')); + $ipp->setPrinterURI(getDolGlobalString('PRINTIPP_URI_DEFAULT')); } else { $this->errors[] = 'NoDefaultPrinterDefined'; $error++; From 3508aa92d6bcc20d6f7e2d5fefe15cef6ceaacd4 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 1 Nov 2021 10:24:19 +0100 Subject: [PATCH 1388/1460] Fix : uk and index on element_tag table --- htdocs/install/mysql/tables/llx_element_tag.key.sql | 4 +--- htdocs/install/mysql/tables/llx_element_tag.sql | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/install/mysql/tables/llx_element_tag.key.sql b/htdocs/install/mysql/tables/llx_element_tag.key.sql index e4af1c3871e..d3a0b38afa9 100644 --- a/htdocs/install/mysql/tables/llx_element_tag.key.sql +++ b/htdocs/install/mysql/tables/llx_element_tag.key.sql @@ -16,8 +16,6 @@ -- -- ============================================================================ -ALTER TABLE llx_element_tag ADD PRIMARY KEY pk_element_tag (fk_categorie, fk_element); -ALTER TABLE llx_element_tag ADD INDEX idx_element_tag_fk_categorie (fk_categorie); -ALTER TABLE llx_element_tag ADD INDEX idx_element_tag_fk_element (fk_element); +ALTER TABLE llx_element_tag ADD UNIQUE INDEX idx_element_tag_uk (fk_categorie, fk_element); ALTER TABLE llx_element_tag ADD CONSTRAINT fk_element_tag_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid); diff --git a/htdocs/install/mysql/tables/llx_element_tag.sql b/htdocs/install/mysql/tables/llx_element_tag.sql index 937137727e7..d43ced98130 100644 --- a/htdocs/install/mysql/tables/llx_element_tag.sql +++ b/htdocs/install/mysql/tables/llx_element_tag.sql @@ -18,6 +18,7 @@ create table llx_element_tag ( + rowid integer AUTO_INCREMENT PRIMARY KEY, fk_categorie integer NOT NULL, fk_element integer NOT NULL, import_key varchar(14) From 960319fd8a988f6141de7c3a74e20179440002b9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 1 Nov 2021 10:33:54 +0100 Subject: [PATCH 1389/1460] dol_htmlentities is better for future than htmlentities --- htdocs/comm/action/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 42257707ea2..74c7a6d272f 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1474,7 +1474,7 @@ if ($id > 0) { print ''; print ''; if ($backtopage) { - print ''; + print ''; } if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) { print ''; From 55243dedb69c29a0ac3b54db9a1739d021b192f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 1 Nov 2021 13:32:19 +0100 Subject: [PATCH 1390/1460] fix typo --- htdocs/core/actions_addupdatedelete.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index dff83eb508c..fd13c61efd2 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -110,7 +110,7 @@ if ($action == 'add' && !empty($permissiontoadd)) { } // Validation of fields values - if (getDolGlobalInt('MAIN_FEATURE_LEVEL') >= 2 || !empty($conf->global->MAIN_ACTIVATE_VALIDATION_RESULT)) { + if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2 || !empty($conf->global->MAIN_ACTIVATE_VALIDATION_RESULT)) { if (!$error && !empty($val['validate']) && is_callable(array($object, 'validateField'))) { if (!$object->validateField($object->fields, $key, $value)) { $error++; From 18918d4e9d26be41029b5680c9fc831ca99dc4cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 1 Nov 2021 13:34:13 +0100 Subject: [PATCH 1391/1460] Update actions_addupdatedelete.inc.php --- htdocs/core/actions_addupdatedelete.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index fd13c61efd2..10d25b2aa09 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -226,7 +226,7 @@ if ($action == 'update' && !empty($permissiontoadd)) { } // Validation of fields values - if ($conf->global->MAIN_FEATURE_LEVEL >= 2 || !empty($conf->global->MAIN_ACTIVATE_VALIDATION_RESULT)) { + if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2 || !empty($conf->global->MAIN_ACTIVATE_VALIDATION_RESULT)) { if (!$error && !empty($val['validate']) && is_callable(array($object, 'validateField'))) { if (!$object->validateField($object->fields, $key, $value)) { $error++; From d7c0d87aeb0eb5cab544c97856c4127df5239912 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 1 Nov 2021 13:35:25 +0100 Subject: [PATCH 1392/1460] Update mod_facture_fournisseur_tulip.php --- .../modules/supplier_invoice/mod_facture_fournisseur_tulip.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php index 5fc2737957f..e6838b9c4c4 100644 --- a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php +++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php @@ -104,7 +104,7 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices $texte .= ''; $texte .= ''; - if ($conf->global->MAIN_FEATURE_LEVEL >= 2) { + if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { // Parametrage du prefix des replacement $texte .= ''; $texte .= ''; From 8bfb6562284d6c3cd4eb151af82d03ff4f3dd468 Mon Sep 17 00:00:00 2001 From: javieralapps4up Date: Mon, 1 Nov 2021 13:47:52 +0100 Subject: [PATCH 1393/1460] Update card.php Load $usergroup->members is not necessary and wastes resources --- htdocs/user/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 429de7fd1a6..8a211501382 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1945,7 +1945,7 @@ if ($action == 'create' || $action == 'adduserldap') { $exclude = array(); $usergroup = new UserGroup($db); - $groupslist = $usergroup->listGroupsForUser($object->id); + $groupslist = $usergroup->listGroupsForUser($object->id, false); if (!empty($groupslist)) { foreach ($groupslist as $groupforuser) { From d40e9bb3046b30ec3e47a9844ec838e905514873 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 1 Nov 2021 13:52:06 +0100 Subject: [PATCH 1394/1460] remove old field field skype has been removed --- htdocs/adherents/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index fe21b8577ef..4936fadd326 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -314,7 +314,7 @@ if (!empty($search_categ) || !empty($catid)) { } $sql .= " d.rowid, d.ref, d.login, d.lastname, d.firstname, d.gender, d.societe as company, d.fk_soc,"; $sql .= " d.civility, d.datefin, d.address, d.zip, d.town, d.state_id, d.country,"; -$sql .= " d.email, d.phone, d.phone_perso, d.phone_mobile, d.skype, d.birth, d.public, d.photo,"; +$sql .= " d.email, d.phone, d.phone_perso, d.phone_mobile, d.birth, d.public, d.photo,"; $sql .= " d.fk_adherent_type as type_id, d.morphy, d.statut, d.datec as date_creation, d.tms as date_update,"; $sql .= " d.note_private, d.note_public,"; $sql .= " s.nom,"; From 5bb6185e64359d476954359076e64473d13591e6 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Tue, 2 Nov 2021 12:37:39 +0100 Subject: [PATCH 1395/1460] add_substitution --- htdocs/core/lib/functions.lib.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 084a4a4f25a..5eb0bd7d62c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7212,7 +7212,10 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, if ($object->id > 0) { $substitutionarray['__ONLINE_PAYMENT_TEXT_AND_URL__'] = ($paymenturl ?str_replace('\n', "\n", $outputlangs->trans("PredefinedMailContentLink", $paymenturl)) : ''); $substitutionarray['__ONLINE_PAYMENT_URL__'] = $paymenturl; - + + if (is_object($object) && $object->element == 'propal') { + $substitutionarray['__ONLINE_SIGN_URL__'] = getOnlineSignatureUrl(0, 'proposal', $object->ref); + } if (!empty($conf->global->PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD) && is_object($object) && $object->element == 'propal') { $substitutionarray['__DIRECTDOWNLOAD_URL_PROPOSAL__'] = $object->getLastMainDocLink($object->element); } else { From 98929f2dbac85245debf9f05670f3ba5947dbfea Mon Sep 17 00:00:00 2001 From: BadPixxel Date: Tue, 2 Nov 2021 14:16:55 +0100 Subject: [PATCH 1396/1460] FIX: Status propagation from Parent Product toSell or toBuy Status propagation should be done only when parent is updated. Otherwise, any modification made on the parent will overwrite the specific configuration made at the child level. --- htdocs/variants/class/ProductCombination.class.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/variants/class/ProductCombination.class.php b/htdocs/variants/class/ProductCombination.class.php index b7fc3d620f5..4245f2039c9 100644 --- a/htdocs/variants/class/ProductCombination.class.php +++ b/htdocs/variants/class/ProductCombination.class.php @@ -488,8 +488,14 @@ class ProductCombination $child->price_autogen = $parent->price_autogen; $child->weight = $parent->weight; - $child->status = $parent->status; - + // Only when Parent Status are updated + if ($parent->oldcopy && ($parent->status != $parent->oldcopy->status)) { + $child->status = $parent->status; + } + if ($parent->oldcopy && ($parent->status_buy != $parent->oldcopy->status_buy)) { + $child->status_buy = $parent->status_buy; + } + if ($this->variation_weight) { // If we must add a delta on weight $child->weight = ($child->weight ? $child->weight : 0) + $this->variation_weight; } From 5c10cd5ba9df55220a1f218da5333ec444e01b61 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 2 Nov 2021 13:20:41 +0000 Subject: [PATCH 1397/1460] Fixing style errors. --- htdocs/variants/class/ProductCombination.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/variants/class/ProductCombination.class.php b/htdocs/variants/class/ProductCombination.class.php index 4245f2039c9..e1fab396cb8 100644 --- a/htdocs/variants/class/ProductCombination.class.php +++ b/htdocs/variants/class/ProductCombination.class.php @@ -490,12 +490,12 @@ class ProductCombination $child->weight = $parent->weight; // Only when Parent Status are updated if ($parent->oldcopy && ($parent->status != $parent->oldcopy->status)) { - $child->status = $parent->status; - } + $child->status = $parent->status; + } if ($parent->oldcopy && ($parent->status_buy != $parent->oldcopy->status_buy)) { - $child->status_buy = $parent->status_buy; - } - + $child->status_buy = $parent->status_buy; + } + if ($this->variation_weight) { // If we must add a delta on weight $child->weight = ($child->weight ? $child->weight : 0) + $this->variation_weight; } From 82b7f0e9e45e7b85b544ed8a8d9ca60cdb0dfabc Mon Sep 17 00:00:00 2001 From: kamel Date: Tue, 2 Nov 2021 15:21:14 +0100 Subject: [PATCH 1398/1460] FIX second approval back in stable feature as is the setting for minimum amount (last part from PR#14286) --- htdocs/fourn/class/fournisseur.commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 72ba5be84ee..00bc994096f 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -999,7 +999,7 @@ class CommandeFournisseur extends CommonOrder if (empty($secondlevel)) { // standard or first level approval $sql .= " date_approve='".$this->db->idate($now)."',"; $sql .= " fk_user_approve = ".$user->id; - if (!empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) && $conf->global->MAIN_FEATURES_LEVEL > 0 && $this->total_ht >= $conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) { + if (!empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) && $this->total_ht >= $conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) { if (empty($this->user_approve_id2)) { $movetoapprovestatus = false; // second level approval not done $comment = ' (first level)'; From d91c24233c33525d89ec4c0557fc74770464cd8e Mon Sep 17 00:00:00 2001 From: kamel Date: Tue, 2 Nov 2021 16:43:09 +0100 Subject: [PATCH 1399/1460] NEW: Can show Paid button if invoice or supplier invoice has no payments with global INVOICE_CAN_FORCE_PAID_WHEN_NO_PAIEMENTS and SUPPLIER_INVOICE_CAN_FORCE_PAID_WHEN_NO_PAIEMENTS --- htdocs/compta/facture/card.php | 13 ++++++++----- htdocs/fourn/facture/card.php | 13 ++++++++----- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index ba505f33d67..b02c48ff79b 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4091,10 +4091,10 @@ if ($action == 'create') { } // Confirmation du classement paye - if ($action == 'paid' && $resteapayer <= 0) { + if ($action == 'paid' && ($resteapayer <= 0 || (!empty($conf->global->INVOICE_CAN_FORCE_PAID_WHEN_NO_PAIEMENTS) && $resteapayer == $object->total_ttc))) { $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$object->id, $langs->trans('ClassifyPaid'), $langs->trans('ConfirmClassifyPaidBill', $object->ref), 'confirm_paid', '', "yes", 1); } - if ($action == 'paid' && $resteapayer > 0) { + if ($action == 'paid' && $resteapayer > 0 && (empty($conf->global->INVOICE_CAN_FORCE_PAID_WHEN_NO_PAIEMENTS) || $resteapayer != $object->total_ttc)) { $close = array(); // Code $i = 0; @@ -5450,14 +5450,17 @@ if ($action == 'create') { } // Classify paid - if (($object->statut == Facture::STATUS_VALIDATED && $object->paye == 0 && $usercanissuepayment && (($object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT && $resteapayer <= 0) || ($object->type == Facture::TYPE_CREDIT_NOTE && $resteapayer >= 0))) - || ($object->type == Facture::TYPE_DEPOSIT && $object->paye == 0 && $object->total_ttc > 0 && $resteapayer == 0 && $usercanissuepayment && empty($discount->id)) + if ($object->statut == Facture::STATUS_VALIDATED && $object->paye == 0 && $usercanissuepayment && ( + ($object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT && ($resteapayer <= 0 || (!empty($conf->global->INVOICE_CAN_FORCE_PAID_WHEN_NO_PAIEMENTS) && $object->total_ttc == $resteapayer))) || + ($object->type == Facture::TYPE_CREDIT_NOTE && $resteapayer >= 0) || + ($object->type == Facture::TYPE_DEPOSIT && $object->total_ttc > 0 && ($resteapayer == 0 || (!empty($conf->global->INVOICE_CAN_FORCE_PAID_WHEN_NO_PAIEMENTS) && $object->total_ttc == $resteapayer))) + ) ) { print ''.$langs->trans('ClassifyPaid').''; } // Classify 'closed not completely paid' (possible if validated and not yet filed paid) - if ($object->statut == Facture::STATUS_VALIDATED && $object->paye == 0 && $resteapayer > 0 && $usercanissuepayment) { + if ($object->statut == Facture::STATUS_VALIDATED && $object->paye == 0 && $resteapayer > 0 && (empty($conf->global->INVOICE_CAN_FORCE_PAID_WHEN_NO_PAIEMENTS) || $resteapayer != $object->total_ttc) && $usercanissuepayment) { if ($totalpaye > 0 || $totalcreditnotes > 0) { // If one payment or one credit note was linked to this invoice print ''.$langs->trans('ClassifyPaidPartially').''; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index ee1f768b60b..507c046a6a4 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2563,11 +2563,11 @@ if ($action == 'create') { } // Confirmation set paid - if ($action == 'paid' && $resteapayer <= 0) { + if ($action == 'paid' && ($resteapayer <= 0 || (!empty($conf->global->SUPPLIER_INVOICE_CAN_FORCE_PAID_WHEN_NO_PAIEMENTS) && $resteapayer == $object->total_ttc))) { $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ClassifyPaid'), $langs->trans('ConfirmClassifyPaidBill', $object->ref), 'confirm_paid', '', 0, 1); } - if ($action == 'paid' && $resteapayer > 0) { + if ($action == 'paid' && $resteapayer > 0 && (empty($conf->global->SUPPLIER_INVOICE_CAN_FORCE_PAID_WHEN_NO_PAIEMENTS) || $resteapayer != $object->total_ttc)) { $close = array(); // Code $i = 0; @@ -3496,14 +3496,17 @@ if ($action == 'create') { } // Classify paid - if (($object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && (($object->type != FactureFournisseur::TYPE_CREDIT_NOTE && $object->type != FactureFournisseur::TYPE_DEPOSIT && $resteapayer <= 0) || ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE && $resteapayer >= 0))) - || ($object->type == FactureFournisseur::TYPE_DEPOSIT && $object->paye == 0 && $object->total_ttc > 0 && $resteapayer == 0 && empty($discount->id)) + if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && ( + ($object->type != FactureFournisseur::TYPE_CREDIT_NOTE && $object->type != FactureFournisseur::TYPE_DEPOSIT && ($resteapayer <= 0 || (!empty($conf->global->SUPPLIER_INVOICE_CAN_FORCE_PAID_WHEN_NO_PAIEMENTS) && $object->total_ttc == $resteapayer))) || + ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE && $resteapayer >= 0) || + ($object->type == FactureFournisseur::TYPE_DEPOSIT && $object->total_ttc > 0 && ($resteapayer == 0 || (!empty($conf->global->SUPPLIER_INVOICE_CAN_FORCE_PAID_WHEN_NO_PAIEMENTS) && $object->total_ttc == $resteapayer))) + ) ) { print ''.$langs->trans('ClassifyPaid').''; } // Classify 'closed not completely paid' (possible if validated and not yet filed paid) - if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $resteapayer > 0) { + if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $resteapayer > 0 && (empty($conf->global->SUPPLIER_INVOICE_CAN_FORCE_PAID_WHEN_NO_PAIEMENTS) || $object->total_ttc != $resteapayer)) { if ($totalpaye > 0 || $totalcreditnotes > 0) { // If one payment or one credit note was linked to this invoice print ''.$langs->trans('ClassifyPaidPartially').''; From b02c89bd8b7e68090c52142ef33e42d8c39be7d7 Mon Sep 17 00:00:00 2001 From: daraelmin Date: Tue, 2 Nov 2021 23:07:46 +0100 Subject: [PATCH 1400/1460] Add link year subscription list in subscription by year stats page --- htdocs/adherents/stats/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php index ed79978552f..de9a5b3d9d9 100644 --- a/htdocs/adherents/stats/index.php +++ b/htdocs/adherents/stats/index.php @@ -196,7 +196,7 @@ foreach ($data as $val) { print ''; print ''; print ''; From d334fe1292b1abfe4b2ec1083f504e5b1f852bf1 Mon Sep 17 00:00:00 2001 From: daraelmin Date: Wed, 3 Nov 2021 13:12:33 +0100 Subject: [PATCH 1401/1460] Fix Bad count of subscription by year If --- htdocs/core/boxes/box_members_subscriptions_by_year.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_members_subscriptions_by_year.php b/htdocs/core/boxes/box_members_subscriptions_by_year.php index be835511c6b..b6c146312bc 100644 --- a/htdocs/core/boxes/box_members_subscriptions_by_year.php +++ b/htdocs/core/boxes/box_members_subscriptions_by_year.php @@ -111,7 +111,7 @@ class box_members_subscriptions_by_year extends ModeleBoxes $i = 0; while ($i < $num) { $objp = $this->db->fetch_object($result); - $year = dol_print_date($this->db->jdate($objp->dateh), "%Y", 'gmt'); + $year = dol_print_date($this->db->jdate($objp->dateh), "%Y"); $Total[$year] = (isset($Total[$year]) ? $Total[$year] : 0) + $objp->subscription; $Number[$year] = (isset($Number[$year]) ? $Number[$year] : 0) + 1; $tot += $objp->subscription; From a359c7a681dfa27c3d57969ea02cdabd13e4b259 Mon Sep 17 00:00:00 2001 From: Vincent Dieltiens Date: Wed, 3 Nov 2021 14:22:08 +0100 Subject: [PATCH 1402/1460] Handle case where credit note has no source invoice --- htdocs/fourn/facture/card.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) mode change 100644 => 100755 htdocs/fourn/facture/card.php diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php old mode 100644 new mode 100755 index ee1f768b60b..5de5942a542 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2721,8 +2721,12 @@ if ($action == 'create') { } if ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE) { $facusing = new FactureFournisseur($db); - $facusing->fetch($object->fk_facture_source); - print ' ('.$langs->transnoentities("CorrectInvoice", $facusing->getNomUrl(1)).')'; + if ($object->fk_facture_source > 0) { + $facusing->fetch($object->fk_facture_source); + print ' ('.$langs->transnoentities("CorrectInvoice", $facusing->getNomUrl(1)).')'; + } else { + print ' ('.$langs->transnoentities("NoInvoiceToCorrect").')'; + } } $facidavoir = $object->getListIdAvoirFromInvoice(); From a4c4732d5d10588dd6877360a6db1e51be046d33 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Wed, 3 Nov 2021 16:18:03 +0100 Subject: [PATCH 1403/1460] NEW: for developpers add hook for moreHTMLRef in dol_banner_tab --- htdocs/core/class/hookmanager.class.php | 3 ++- htdocs/core/lib/functions.lib.php | 13 ++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index 40610ce5d6f..691c20e10f8 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -229,7 +229,8 @@ class HookManager 'showLinkToObjectBlock', 'setContentSecurityPolicy', 'setHtmlTitle', - 'completeTabsHead' + 'completeTabsHead', + 'formDolBanner' ) )) { $hooktype = 'addreplace'; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 408a771e1ed..8912c41152a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1845,7 +1845,7 @@ function dol_get_fiche_end($notab = 0) */ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldid = 'rowid', $fieldref = 'ref', $morehtmlref = '', $moreparam = '', $nodbprefix = 0, $morehtmlleft = '', $morehtmlstatus = '', $onlybanner = 0, $morehtmlright = '') { - global $conf, $form, $user, $langs; + global $conf, $form, $user, $langs, $hookmanager; $error = 0; @@ -2116,6 +2116,17 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi $morehtmlref .= ''; } + $parameters=array('morehtmlref'=>$morehtmlref); + $reshook = $hookmanager->executeHooks('formDolBanner', $parameters, $object, ''); + if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + } elseif (empty($reshook)) { + $morehtmlref .= $hookmanager->resPrint; + } elseif ($reshook > 0) { + $morehtmlref = $hookmanager->resPrint; + } + + print '
    '; print $form->showrefnav($object, $paramid, $morehtml, $shownav, $fieldid, $fieldref, $morehtmlref, $moreparam, $nodbprefix, $morehtmlleft, $morehtmlstatus, $morehtmlright); print '
    '; From 054d98b942299ab8cb8d238c66047e5009cd6831 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Wed, 3 Nov 2021 16:31:35 +0100 Subject: [PATCH 1404/1460] fix ref --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 8912c41152a..c71b3ad0802 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2117,7 +2117,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi } $parameters=array('morehtmlref'=>$morehtmlref); - $reshook = $hookmanager->executeHooks('formDolBanner', $parameters, $object, ''); + $reshook = $hookmanager->executeHooks('formDolBanner', $parameters, $object, $action); if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } elseif (empty($reshook)) { From 3f426abc290f6198d836fed5a357982b177c7034 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Thu, 4 Nov 2021 10:56:55 +0100 Subject: [PATCH 1405/1460] Qual: If hidden option BANK_CAN_RECONCILIATE_CASHACCOUNT is activated, show Account Statements tab on Cash Accounts --- htdocs/core/lib/bank.lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php index 30a3d21de90..554d435c471 100644 --- a/htdocs/core/lib/bank.lib.php +++ b/htdocs/core/lib/bank.lib.php @@ -4,6 +4,7 @@ * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2016 Juanjo Menent * Copyright (C) 2019 Nicolas ZABOURI + * Copyright (C) 2021 Ferran Marcet * * 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 @@ -66,7 +67,7 @@ function bank_prepare_head(Account $object) $head[$h][2] = 'graph'; $h++; - if ($object->courant != Account::TYPE_CASH) { + if ($object->courant != Account::TYPE_CASH || !empty($conf->global->BANK_CAN_RECONCILIATE_CASHACCOUNT)) { $nbReceipts = 0; // List of all standing receipts From dd8d4e9e983c5650f31db1386fdb698ee668f315 Mon Sep 17 00:00:00 2001 From: ATM john Date: Thu, 4 Nov 2021 12:10:19 +0100 Subject: [PATCH 1406/1460] Fix missing return status --- htdocs/core/db/DoliDB.class.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php index 8f2a9dc315e..af470ac62d6 100644 --- a/htdocs/core/db/DoliDB.class.php +++ b/htdocs/core/db/DoliDB.class.php @@ -308,7 +308,7 @@ abstract class DoliDB implements Database * Note : This method executes a given SQL query and retrieves the first row of results as an object. It should only be used with SELECT queries * Dont add LIMIT to your query, it will be added by this method * @param string $sql the sql query string - * @return bool| object + * @return bool|int|object false on failure, 0 on empty, object on success */ public function getRow($sql) { @@ -317,7 +317,13 @@ abstract class DoliDB implements Database $res = $this->query($sql); if ($res) { - return $this->fetch_object($res); + $obj = $this->fetch_object($res); + if(!$obj){ + return 0; + } + else{ + return $obj; + } } return false; From 58ae45a88bd29fb66eeeb24f5d95b54e92cd2ffa Mon Sep 17 00:00:00 2001 From: Christian Foellmann Date: Thu, 4 Nov 2021 13:57:47 +0100 Subject: [PATCH 1407/1460] fix DocumentPreview on holiday documents --- htdocs/core/class/html.formfile.class.php | 2 +- htdocs/holiday/document.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index ffa441c0527..6f0a79d9383 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1373,7 +1373,7 @@ class FormFile } // Preview link if (!$editline) { - print $this->showPreview($file, $modulepart, $filepath, 0, '&entity='.(!empty($object->entity) ? $object->entity : $conf->entity)); + print $this->showPreview($file, $modulepart, $filepath, 0, 'entity='.(!empty($object->entity) ? $object->entity : $conf->entity)); } print "\n"; diff --git a/htdocs/holiday/document.php b/htdocs/holiday/document.php index 6986d75d630..b11b795723c 100644 --- a/htdocs/holiday/document.php +++ b/htdocs/holiday/document.php @@ -349,7 +349,7 @@ if ($object->id) { $permissiontoadd = $user->rights->holiday->write; $permtoedit = $user->rights->holiday->write; $param = '&id='.$object->id; - $relativepathwithnofile = $modulepart.'/'.dol_sanitizeFileName($object->ref).'/'; + $relativepathwithnofile = dol_sanitizeFileName($object->ref).'/'; $savingdocmask = dol_sanitizeFileName($object->ref).'-__file__'; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; From 4af8a4e9fd8c84a8c3443c8066db1cfc28cdc275 Mon Sep 17 00:00:00 2001 From: Vincent Dieltiens Date: Fri, 5 Nov 2021 12:10:28 +0100 Subject: [PATCH 1408/1460] Add EXPENSEREPORT_FILE_IS_REQUIRED global var to force user to join a file for each line of an expense report --- htdocs/expensereport/card.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index b711a65d25a..f15f8c74743 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -118,6 +118,7 @@ $permissiontoadd = $user->rights->expensereport->creer; // Used by the include o $upload_dir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($object->ref); $projectRequired = $conf->projet->enabled && ! empty($conf->global->EXPENSEREPORT_PROJECT_IS_REQUIRED); +$fileRequired = !empty($conf->global->EXPENSEREPORT_FILE_IS_REQUIRED); if ($object->id > 0) { // Check current user can read this expense report @@ -1157,6 +1158,12 @@ if (empty($reshook)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Project")), null, 'errors'); } + // If no file associated + if ($fileRequired && $fk_ecm_files == 0) { + $error++; + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("File")), null, 'errors'); + } + if (!$error) { $type = 0; // TODO What if service ? We should take the type product/service from the type of expense report llx_c_type_fees From 3959d12a39bf5022c6436b493b6de4be77f754fb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Nov 2021 12:42:42 +0100 Subject: [PATCH 1409/1460] Update DoliDB.class.php --- htdocs/core/db/DoliDB.class.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php index af470ac62d6..68e29f22481 100644 --- a/htdocs/core/db/DoliDB.class.php +++ b/htdocs/core/db/DoliDB.class.php @@ -312,17 +312,15 @@ abstract class DoliDB implements Database */ public function getRow($sql) { - $sql .= ' LIMIT 1;'; + $sql .= ' LIMIT 1'; $res = $this->query($sql); - if ($res) - { + if ($res) { $obj = $this->fetch_object($res); - if(!$obj){ - return 0; - } - else{ + if ($obj) { return $obj; + } else { + return 0; } } From 19b9412c1357299940c14be206bf464fc774cd61 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Nov 2021 12:49:33 +0100 Subject: [PATCH 1410/1460] FIX #19305 --- htdocs/core/modules/modPropale.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/modPropale.class.php b/htdocs/core/modules/modPropale.class.php index 007e92e4277..12835530bf9 100644 --- a/htdocs/core/modules/modPropale.class.php +++ b/htdocs/core/modules/modPropale.class.php @@ -156,7 +156,8 @@ class modPropale extends DolibarrModules $this->rights[$r][1] = 'Close commercial proposals'; // libelle de la permission $this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour) $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut - $this->rights[$r][4] = 'cloturer'; + $this->rights[$r][4] = 'propal_advance'; + $this->rights[$r][5] = 'close'; $r++; $this->rights[$r][0] = 27; // id de la permission From 02200b98103803826a1b6737bd6bc355ce77b8e4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Nov 2021 13:10:44 +0100 Subject: [PATCH 1411/1460] Update card.php --- htdocs/fourn/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 5de5942a542..c986bdd56db 100755 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2725,7 +2725,7 @@ if ($action == 'create') { $facusing->fetch($object->fk_facture_source); print ' ('.$langs->transnoentities("CorrectInvoice", $facusing->getNomUrl(1)).')'; } else { - print ' ('.$langs->transnoentities("NoInvoiceToCorrect").')'; + print ' ('.$langs->transnoentities("CorrectInvoiceNotFound").')'; } } From bc7b035846a33b21000614751b33c413408bd646 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Nov 2021 13:11:54 +0100 Subject: [PATCH 1412/1460] Update card.php --- htdocs/fourn/facture/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index c986bdd56db..da8672c9518 100755 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1,4 +1,4 @@ - * Copyright (C) 2004-2020 Laurent Destailleur * Copyright (C) 2004 Christophe Combelles @@ -2725,7 +2725,7 @@ if ($action == 'create') { $facusing->fetch($object->fk_facture_source); print ' ('.$langs->transnoentities("CorrectInvoice", $facusing->getNomUrl(1)).')'; } else { - print ' ('.$langs->transnoentities("CorrectInvoiceNotFound").')'; + print ' ('.$langs->transnoentities("CorrectedInvoiceNotFound").')'; } } From 15bc4a7d6b4b0a7a9c943b12989f3950b3fb5aad Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Nov 2021 13:18:37 +0100 Subject: [PATCH 1413/1460] Update index.php --- htdocs/adherents/stats/index.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php index de9a5b3d9d9..7bf395e9bcc 100644 --- a/htdocs/adherents/stats/index.php +++ b/htdocs/adherents/stats/index.php @@ -195,9 +195,7 @@ foreach ($data as $val) { } print '
    '; print ''; print ''; print ''; From 2b6d296e63a0d3e7f80cb41416129c9da646154e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Nov 2021 13:58:11 +0100 Subject: [PATCH 1414/1460] Rename var --- htdocs/compta/facture/card.php | 10 +++++----- htdocs/fourn/facture/card.php | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index b02c48ff79b..509ab85634d 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4091,10 +4091,10 @@ if ($action == 'create') { } // Confirmation du classement paye - if ($action == 'paid' && ($resteapayer <= 0 || (!empty($conf->global->INVOICE_CAN_FORCE_PAID_WHEN_NO_PAIEMENTS) && $resteapayer == $object->total_ttc))) { + if ($action == 'paid' && ($resteapayer <= 0 || (!empty($conf->global->INVOICE_CAN_ADD_PAYMENT_EVEN_IF_ALREADY_PAID) && $resteapayer == $object->total_ttc))) { $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$object->id, $langs->trans('ClassifyPaid'), $langs->trans('ConfirmClassifyPaidBill', $object->ref), 'confirm_paid', '', "yes", 1); } - if ($action == 'paid' && $resteapayer > 0 && (empty($conf->global->INVOICE_CAN_FORCE_PAID_WHEN_NO_PAIEMENTS) || $resteapayer != $object->total_ttc)) { + if ($action == 'paid' && $resteapayer > 0 && (empty($conf->global->INVOICE_CAN_ADD_PAYMENT_EVEN_IF_ALREADY_PAID) || $resteapayer != $object->total_ttc)) { $close = array(); // Code $i = 0; @@ -5451,16 +5451,16 @@ if ($action == 'create') { // Classify paid if ($object->statut == Facture::STATUS_VALIDATED && $object->paye == 0 && $usercanissuepayment && ( - ($object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT && ($resteapayer <= 0 || (!empty($conf->global->INVOICE_CAN_FORCE_PAID_WHEN_NO_PAIEMENTS) && $object->total_ttc == $resteapayer))) || + ($object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT && ($resteapayer <= 0 || (!empty($conf->global->INVOICE_CAN_ADD_PAYMENT_EVEN_IF_ALREADY_PAID) && $object->total_ttc == $resteapayer))) || ($object->type == Facture::TYPE_CREDIT_NOTE && $resteapayer >= 0) || - ($object->type == Facture::TYPE_DEPOSIT && $object->total_ttc > 0 && ($resteapayer == 0 || (!empty($conf->global->INVOICE_CAN_FORCE_PAID_WHEN_NO_PAIEMENTS) && $object->total_ttc == $resteapayer))) + ($object->type == Facture::TYPE_DEPOSIT && $object->total_ttc > 0 && ($resteapayer == 0 || (!empty($conf->global->INVOICE_CAN_ADD_PAYMENT_EVEN_IF_ALREADY_PAID) && $object->total_ttc == $resteapayer))) ) ) { print ''.$langs->trans('ClassifyPaid').''; } // Classify 'closed not completely paid' (possible if validated and not yet filed paid) - if ($object->statut == Facture::STATUS_VALIDATED && $object->paye == 0 && $resteapayer > 0 && (empty($conf->global->INVOICE_CAN_FORCE_PAID_WHEN_NO_PAIEMENTS) || $resteapayer != $object->total_ttc) && $usercanissuepayment) { + if ($object->statut == Facture::STATUS_VALIDATED && $object->paye == 0 && $resteapayer > 0 && (empty($conf->global->INVOICE_CAN_ADD_PAYMENT_EVEN_IF_ALREADY_PAID) || $resteapayer != $object->total_ttc) && $usercanissuepayment) { if ($totalpaye > 0 || $totalcreditnotes > 0) { // If one payment or one credit note was linked to this invoice print ''.$langs->trans('ClassifyPaidPartially').''; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index d5e27b62d4b..a6cf0cb232d 100755 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2563,11 +2563,11 @@ if ($action == 'create') { } // Confirmation set paid - if ($action == 'paid' && ($resteapayer <= 0 || (!empty($conf->global->SUPPLIER_INVOICE_CAN_FORCE_PAID_WHEN_NO_PAIEMENTS) && $resteapayer == $object->total_ttc))) { + if ($action == 'paid' && ($resteapayer <= 0 || (!empty($conf->global->SUPPLIER_INVOICE_CAN_ADD_PAYMENT_EVEN_IF_ALREADY_PAID) && $resteapayer == $object->total_ttc))) { $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ClassifyPaid'), $langs->trans('ConfirmClassifyPaidBill', $object->ref), 'confirm_paid', '', 0, 1); } - if ($action == 'paid' && $resteapayer > 0 && (empty($conf->global->SUPPLIER_INVOICE_CAN_FORCE_PAID_WHEN_NO_PAIEMENTS) || $resteapayer != $object->total_ttc)) { + if ($action == 'paid' && $resteapayer > 0 && (empty($conf->global->SUPPLIER_INVOICE_CAN_ADD_PAYMENT_EVEN_IF_ALREADY_PAID) || $resteapayer != $object->total_ttc)) { $close = array(); // Code $i = 0; @@ -3501,16 +3501,16 @@ if ($action == 'create') { // Classify paid if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && ( - ($object->type != FactureFournisseur::TYPE_CREDIT_NOTE && $object->type != FactureFournisseur::TYPE_DEPOSIT && ($resteapayer <= 0 || (!empty($conf->global->SUPPLIER_INVOICE_CAN_FORCE_PAID_WHEN_NO_PAIEMENTS) && $object->total_ttc == $resteapayer))) || + ($object->type != FactureFournisseur::TYPE_CREDIT_NOTE && $object->type != FactureFournisseur::TYPE_DEPOSIT && ($resteapayer <= 0 || (!empty($conf->global->SUPPLIER_INVOICE_CAN_ADD_PAYMENT_EVEN_IF_ALREADY_PAID) && $object->total_ttc == $resteapayer))) || ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE && $resteapayer >= 0) || - ($object->type == FactureFournisseur::TYPE_DEPOSIT && $object->total_ttc > 0 && ($resteapayer == 0 || (!empty($conf->global->SUPPLIER_INVOICE_CAN_FORCE_PAID_WHEN_NO_PAIEMENTS) && $object->total_ttc == $resteapayer))) + ($object->type == FactureFournisseur::TYPE_DEPOSIT && $object->total_ttc > 0 && ($resteapayer == 0 || (!empty($conf->global->SUPPLIER_INVOICE_CAN_ADD_PAYMENT_EVEN_IF_ALREADY_PAID) && $object->total_ttc == $resteapayer))) ) ) { print ''.$langs->trans('ClassifyPaid').''; } // Classify 'closed not completely paid' (possible if validated and not yet filed paid) - if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $resteapayer > 0 && (empty($conf->global->SUPPLIER_INVOICE_CAN_FORCE_PAID_WHEN_NO_PAIEMENTS) || $object->total_ttc != $resteapayer)) { + if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $resteapayer > 0 && (empty($conf->global->SUPPLIER_INVOICE_CAN_ADD_PAYMENT_EVEN_IF_ALREADY_PAID) || $object->total_ttc != $resteapayer)) { if ($totalpaye > 0 || $totalcreditnotes > 0) { // If one payment or one credit note was linked to this invoice print ''.$langs->trans('ClassifyPaidPartially').''; From 897b00faf02fb5e803f33f7c0f9196b8701fcfda Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Nov 2021 14:23:19 +0100 Subject: [PATCH 1415/1460] Clean code --- htdocs/admin/bank.php | 6 ++---- htdocs/admin/modules.php | 2 +- htdocs/admin/prelevement.php | 2 +- htdocs/admin/syslog.php | 4 +--- htdocs/admin/translation.php | 2 +- htdocs/comm/propal/card.php | 2 +- htdocs/core/class/html.formadmin.class.php | 2 +- htdocs/core/class/infobox.class.php | 2 +- htdocs/core/class/translate.class.php | 2 +- htdocs/core/get_info.php | 4 ++-- htdocs/core/lib/functions.lib.php | 4 ++-- htdocs/core/lib/project.lib.php | 10 +--------- htdocs/exports/export.php | 1 - htdocs/main.inc.php | 14 ++++---------- htdocs/societe/admin/societe.php | 2 +- htdocs/societe/paymentmodes.php | 2 +- htdocs/stripe/admin/stripe.php | 11 +---------- htdocs/theme/eldy/main_menu_fa_icons.inc.php | 2 +- 18 files changed, 23 insertions(+), 51 deletions(-) diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index 6580db4e8f3..e1e468b0cec 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -275,8 +275,7 @@ print '

    '; /* * Document templates generators */ -//if (! empty($conf->global->MAIN_FEATURES_LEVEL)) -//{ + print load_fiche_titre($langs->trans("BankAccountModelModule"), '', ''); // Load array def with activated templates @@ -466,8 +465,7 @@ print '

    '; /* * Document templates generators */ -//if (! empty($conf->global->MAIN_FEATURES_LEVEL)) -//{ + print load_fiche_titre($langs->trans("Other"), '', ''); print "
    '; + print ''; + print ''; $formTicket->selectTypesTickets(dol_escape_htmltag(empty($search[$key]) ? '' : $search[$key]), 'search_'.$key.'', '', 2, 1, 1, 0, ($val['css'] ? $val['css'] : 'maxwidth150')); print '
    '.$form->textwithpicto('', $tooltip, 1, 1).'
    '.$langs->trans("Mask").' ('.$langs->trans("InvoiceReplacement").'):'.$form->textwithpicto('', $tooltip, 1, 1).'
    '; //print ''; - print $year; + print ''.$year.''; //print ''; print ''.$val['nb'].'
    '; - //print ''; - print ''.$year.''; - //print ''; + print ''.$year.''; print ''.$val['nb'].''.price(price2num($val['total'], 'MT'), 1).'
    \n"; diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 9c2b91ec586..2cbb14bb2dd 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -542,7 +542,7 @@ if ($mode == 'common' || $mode == 'commonkanban') { $moreforfilter .= '
    '; $moreforfilter .= $form->selectarray('search_nature', $arrayofnatures, dol_escape_htmltag($search_nature), $langs->trans('Origin'), 0, 0, '', 0, 0, 0, '', 'maxwidth200', 1); $moreforfilter .= '
    '; - if (!empty($conf->global->MAIN_FEATURES_LEVEL)) { + if (getDolGlobalInt('MAIN_FEATURES_LEVEL')) { $array_version = array('stable'=>$langs->transnoentitiesnoconv("Stable")); if ($conf->global->MAIN_FEATURES_LEVEL < 0) { $array_version['deprecated'] = $langs->trans("Deprecated"); diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 207642fe8e3..88a02e90457 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -297,7 +297,7 @@ foreach ($dirmodels as $reldir) $module = new $classname($db); $modulequalified=1; - if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0; + 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) { diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php index 10b3d1bd47b..2f272cd986f 100644 --- a/htdocs/admin/syslog.php +++ b/htdocs/admin/syslog.php @@ -187,8 +187,6 @@ if (!empty($conf->global->MAIN_MODULE_MULTICOMPANY) && $user->entity) { } -//print "conf->global->MAIN_FEATURES_LEVEL = ".$conf->global->MAIN_FEATURES_LEVEL."

    \n"; - // Output mode print load_fiche_titre($langs->trans("SyslogOutput"), '', ''); @@ -207,7 +205,7 @@ foreach ($syslogModules as $moduleName) { $moduleactive = (int) $module->isActive(); //print $moduleName." = ".$moduleactive." - ".$module->getName()." ".($moduleactive == -1)."
    \n"; - if (($moduleactive == -1) && empty($conf->global->MAIN_FEATURES_LEVEL)) { + if (($moduleactive == -1) && getDolGlobalInt('MAIN_FEATURES_LEVEL') == 0) { continue; // Some modules are hidden if not activable and not into debug mode (end user must not see them) } diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index f07623ed5d0..e9a6eaeb390 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -556,7 +556,7 @@ if ($mode == 'searchkey') { print ''.img_edit_add($langs->trans("TranslationOverwriteKey")).''; } - if (!empty($conf->global->MAIN_FEATURES_LEVEL)) { + if (getDolGlobalInt('MAIN_FEATURES_LEVEL')) { $transifexlangfile = '$'; // $ means 'All' //$transifexurl = 'https://www.transifex.com/dolibarr-association/dolibarr/translate/#'.$langcode.'/'.$transifexlangfile.'?key='.$key; $transifexurl = 'https://www.transifex.com/dolibarr-association/dolibarr/translate/#'.$langcode.'/'.$transifexlangfile.'?q=key%3A'.$key; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index c046281f18e..896448d7b9a 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2679,7 +2679,7 @@ if ($action == 'create') { $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem, $compatibleImportElementsList); // Show online signature link - $useonlinesignature = $conf->global->MAIN_FEATURES_LEVEL; // Replace this with 1 when feature to make online signature is ok + $useonlinesignature = 1; // Replace this with 1 when feature to make online signature is ok if ($object->statut != Propal::STATUS_DRAFT && $useonlinesignature) { print '
    '; diff --git a/htdocs/core/class/html.formadmin.class.php b/htdocs/core/class/html.formadmin.class.php index 13619fe5aa3..4196fb32b68 100644 --- a/htdocs/core/class/html.formadmin.class.php +++ b/htdocs/core/class/html.formadmin.class.php @@ -304,7 +304,7 @@ class FormAdmin if (preg_match('/\.lib/i', $filelib)) { continue; } - if (empty($conf->global->MAIN_FEATURES_LEVEL) && in_array($file, $expdevmenu)) { + if (getDolGlobalInt('MAIN_FEATURES_LEVEL') == 0 && in_array($file, $expdevmenu)) { continue; } diff --git a/htdocs/core/class/infobox.class.php b/htdocs/core/class/infobox.class.php index adde51c4974..0cd34e13193 100644 --- a/htdocs/core/class/infobox.class.php +++ b/htdocs/core/class/infobox.class.php @@ -37,7 +37,7 @@ class InfoBox { global $conf; - if (empty($conf->global->MAIN_FEATURES_LEVEL) || $conf->global->MAIN_FEATURES_LEVEL < 2) { + if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) { return array( 0 => 'Home', 1 => 'UsersHome', diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index b535d2b3585..e741adc84b5 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -589,7 +589,7 @@ class Translate } /* Disabled. There is too many cases where translation of $newstr is not defined is normal (like when output with setEventMessage an already translated string) - if (! empty($conf->global->MAIN_FEATURES_LEVEL) && $conf->global->MAIN_FEATURES_LEVEL >= 2) + if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { dol_syslog(__METHOD__." MAIN_FEATURES_LEVEL=DEVELOP: missing translation for key '".$newstr."' in ".$_SERVER["PHP_SELF"], LOG_DEBUG); }*/ diff --git a/htdocs/core/get_info.php b/htdocs/core/get_info.php index 4927be6a005..ee21aac0de3 100644 --- a/htdocs/core/get_info.php +++ b/htdocs/core/get_info.php @@ -83,8 +83,8 @@ if (!empty($conf->global->MAIN_APPLICATION_TITLE)) { $appli .= " ".DOL_VERSION; } -if (!empty($conf->global->MAIN_FEATURES_LEVEL)) { - $appli .= "
    ".$langs->trans("LevelOfFeature").': '.$conf->global->MAIN_FEATURES_LEVEL; +if (getDolGlobalInt('MAIN_FEATURES_LEVEL')) { + $appli .= "
    ".$langs->trans("LevelOfFeature").': '.getDolGlobalInt('MAIN_FEATURES_LEVEL'); } $logouttext = ''; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index c71b3ad0802..25dec3e47bb 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4537,7 +4537,7 @@ function dol_print_error($db = '', $error = '', $errors = null) if ($_SERVER['DOCUMENT_ROOT']) { // Mode web $out .= $langs->trans("DolibarrHasDetectedError").".
    \n"; - if (!empty($conf->global->MAIN_FEATURES_LEVEL)) { + if (getDolGlobalInt('MAIN_FEATURES_LEVEL') > 0) { $out .= "You use an experimental or develop level of features, so please do NOT report any bugs or vulnerability, except if problem is confirmed after moving option MAIN_FEATURES_LEVEL back to 0.
    \n"; } $out .= $langs->trans("InformationToHelpDiagnose").":
    \n"; @@ -4545,7 +4545,7 @@ function dol_print_error($db = '', $error = '', $errors = null) $out .= "".$langs->trans("Date").": ".dol_print_date(time(), 'dayhourlog')."
    \n"; $out .= "".$langs->trans("Dolibarr").": ".DOL_VERSION." - https://www.dolibarr.org
    \n"; if (isset($conf->global->MAIN_FEATURES_LEVEL)) { - $out .= "".$langs->trans("LevelOfFeature").": ".dol_htmlentities($conf->global->MAIN_FEATURES_LEVEL, ENT_COMPAT)."
    \n"; + $out .= "".$langs->trans("LevelOfFeature").": ".getDolGlobalInt('MAIN_FEATURES_LEVEL')."
    \n"; } if (function_exists("phpversion")) { $out .= "".$langs->trans("PHP").": ".phpversion()."
    \n"; diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index c66bcdfc2d8..e9e06708f7c 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -471,14 +471,6 @@ function project_timesheet_prepare_head($mode, $fuser = null) $h++; } - /*if ($conf->global->MAIN_FEATURES_LEVEL >= 2) - { - $head[$h][0] = DOL_URL_ROOT."/projet/activity/perline.php".($param?'?'.$param:''); - $head[$h][1] = $langs->trans("InputDetail"); - $head[$h][2] = 'inputperline'; - $h++; - }*/ - complete_head_from_modules($conf, $langs, null, $head, $h, 'project_timesheet'); complete_head_from_modules($conf, $langs, null, $head, $h, 'project_timesheet', 'remove'); @@ -517,7 +509,7 @@ function project_admin_prepare_head() $head[$h][2] = 'attributes_task'; $h++; - if (! empty($conf->global->MAIN_FEATURES_LEVEL) && $conf->global->MAIN_FEATURES_LEVEL >= 2) { + if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { $langs->load("members"); $head[$h][0] = DOL_URL_ROOT.'/projet/admin/website.php'; diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index c0a48b97222..93e20b06afe 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -151,7 +151,6 @@ $sqlusedforexport = ''; $head = array(); $upload_dir = $conf->export->dir_temp.'/'.$user->id; -//$usefilters=($conf->global->MAIN_FEATURES_LEVEL > 1); $usefilters = 1; // Security check diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index c1f3231c737..25bc42046a9 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -523,7 +523,6 @@ if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && getDolGlobalInt( dol_syslog("--- Access to ".(empty($_SERVER["REQUEST_METHOD"]) ? '' : $_SERVER["REQUEST_METHOD"].' ').$_SERVER["PHP_SELF"]." refused by CSRF protection (invalid token), so we disable POST and some GET parameters - referer=".$_SERVER['HTTP_REFERER'].", action=".GETPOST('action', 'aZ09').", _GET|POST['token']=".GETPOST('token', 'alpha').", _SESSION['token']=".$_SESSION['token'], LOG_WARNING); //print 'Unset POST by CSRF protection in main.inc.php.'; // Do not output anything because this create problems when using the BACK button on browsers. setEventMessages('SecurityTokenHasExpiredSoActionHasBeenCanceledPleaseRetry', null, 'warnings'); - //if ($conf->global->MAIN_FEATURES_LEVEL >= 1) setEventMessages('Unset POST and GET params by CSRF protection in main.inc.php (Token provided was not generated by the previous page).'."
    \n".'$_SERVER[REQUEST_URI] = '.$_SERVER['REQUEST_URI'].' $_SERVER[REQUEST_METHOD] = '.$_SERVER['REQUEST_METHOD'].' GETPOST(token) = '.GETPOST('token', 'alpha').' $_SESSION[token] = '.$_SESSION['token'], null, 'warnings'); if (isset($_POST['id'])) $savid = ((int) $_POST['id']); unset($_POST); //unset($_POST['action']); unset($_POST['massaction']); @@ -1437,8 +1436,8 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr print ''."\n"; // Do not index print ''."\n"; // Scale for mobile device print ''."\n"; - if (!empty($conf->global->MAIN_FEATURES_LEVEL)) { - print ''."\n"; + if (getDolGlobalInt('MAIN_FEATURES_LEVEL')) { + print ''."\n"; } // Favicon $favicon = DOL_URL_ROOT.'/theme/dolibarr_256x256_color.png'; @@ -1628,11 +1627,6 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr } else { print ''."\n"; } - /*if (! empty($conf->global->MAIN_FEATURES_LEVEL) && ! defined('JS_JQUERY_MIGRATE_DISABLED')) - { - if (defined('JS_JQUERY_MIGRATE') && constant('JS_JQUERY_MIGRATE')) print ''."\n"; - else print ''."\n"; - }*/ if (defined('JS_JQUERY_UI') && constant('JS_JQUERY_UI')) { print ''."\n"; } else { @@ -1842,8 +1836,8 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead $appli .= " ".DOL_VERSION; } - if (!empty($conf->global->MAIN_FEATURES_LEVEL)) { - $appli .= "
    ".$langs->trans("LevelOfFeature").': '.$conf->global->MAIN_FEATURES_LEVEL; + if (getDolGlobalInt('MAIN_FEATURES_LEVEL')) { + $appli .= "
    ".$langs->trans("LevelOfFeature").': '.getDolGlobalInt('MAIN_FEATURES_LEVEL'); } $logouttext = ''; diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index 536eb0546cc..2f272ceca1c 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -833,7 +833,7 @@ print ''; print ''; if (!empty($conf->expedition->enabled)) { - if (!empty($conf->global->MAIN_FEATURES_LEVEL)) { // Visible on experimental only because seems to not be implemented everywhere (only on proposal) + if (getDolGlobalInt('MAIN_FEATURES_LEVEL') > 0) { // Visible on experimental only because seems to not be implemented everywhere (only on proposal) print ''; print ''; print ''; diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 7d0c9b154c4..995558ae2f5 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -848,7 +848,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' } } - if (!empty($conf->stripe->enabled) && !empty($conf->stripeconnect->enabled) && $conf->global->MAIN_FEATURES_LEVEL >= 2) { + if (!empty($conf->stripe->enabled) && !empty($conf->stripeconnect->enabled) && getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { $permissiontowrite = $user->rights->societe->creer; $stripesupplieracc = $stripe->getStripeAccount($service, $object->id); // Get Stripe OAuth connect account (no network access here) diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index 0bb351bf977..06f417e48df 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -356,7 +356,7 @@ print img_picto('', 'bank_account').' '; $form->select_comptes($conf->global->STRIPE_BANK_ACCOUNT_FOR_PAYMENTS, 'STRIPE_BANK_ACCOUNT_FOR_PAYMENTS', 0, '', 1); print ''; -if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { // What is this for ? +if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { // What is this for ? print ''; } -// Warehouse for automatic decrement -//if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // warehouse to reduce stock for online payment -//{ -// print ''; -//} - print ''; } // Ref supplier if (!empty($arrayfields['f.ref_supplier']['checked'])) { print ''; } // Type @@ -1006,7 +1006,7 @@ if ($resql) { // Label if (!empty($arrayfields['f.label']['checked'])) { print ''; } // Date invoice @@ -1037,11 +1037,11 @@ if ($resql) { } // Project if (!empty($arrayfields['p.ref']['checked'])) { - print ''; + print ''; } // Thirpdarty if (!empty($arrayfields['s.nom']['checked'])) { - print ''; + print ''; } // Town if (!empty($arrayfields['s.town']['checked'])) { @@ -1096,13 +1096,13 @@ if ($resql) { if (!empty($arrayfields['f.total_localtax1']['checked'])) { // Amount tax 1 print ''; } if (!empty($arrayfields['f.total_localtax2']['checked'])) { // Amount tax 2 print ''; } if (!empty($arrayfields['f.total_ttc']['checked'])) { From 09d9d1ac4242a626d253fe4b02c6fe2d667b1958 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Nov 2021 12:38:44 +0100 Subject: [PATCH 1423/1460] Add missing unique key --- .../install/mysql/migration/14.0.0-15.0.0.sql | 2 ++ .../tables/llx_c_partnership_type.key.sql | 19 +++++++++++++++++++ .../mysql/tables/llx_c_partnership_type.sql | 2 +- 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 htdocs/install/mysql/tables/llx_c_partnership_type.key.sql diff --git a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql index 02a18f69a40..2c460d4ab88 100644 --- a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql +++ b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql @@ -80,6 +80,8 @@ INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, -- v15 +ALTER TABLE llx_c_partnership_type ADD UNIQUE INDEX uk_c_partnership_type(entity, code); + ALTER TABLE llx_c_holiday_types CHANGE COLUMN newByMonth newbymonth double(8,5) DEFAULT 0 NOT NULL; ALTER TABLE llx_product ADD COLUMN mandatory_period tinyint NULL DEFAULT 0; diff --git a/htdocs/install/mysql/tables/llx_c_partnership_type.key.sql b/htdocs/install/mysql/tables/llx_c_partnership_type.key.sql new file mode 100644 index 00000000000..c4aa0c04b0a --- /dev/null +++ b/htdocs/install/mysql/tables/llx_c_partnership_type.key.sql @@ -0,0 +1,19 @@ +-- ======================================================================== +-- Copyright (C) 2021 Laurent Destailleur +-- +-- 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 . +-- +-- ======================================================================== + +ALTER TABLE llx_c_partnership_type ADD UNIQUE INDEX uk_c_partnership_type(entity, code); diff --git a/htdocs/install/mysql/tables/llx_c_partnership_type.sql b/htdocs/install/mysql/tables/llx_c_partnership_type.sql index 23d5a89e16c..d2a4a3b7549 100644 --- a/htdocs/install/mysql/tables/llx_c_partnership_type.sql +++ b/htdocs/install/mysql/tables/llx_c_partnership_type.sql @@ -30,6 +30,6 @@ create table llx_c_partnership_type entity integer DEFAULT 1 NOT NULL, code varchar(32) NOT NULL, label varchar(64) NOT NULL, - active tinyint DEFAULT 1 NOT NULL + active tinyint DEFAULT 1 NOT NULL )ENGINE=innodb; From e8a2fc33c31fce90c5c51563a0ea3021e2caa2de Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Nov 2021 12:47:03 +0100 Subject: [PATCH 1424/1460] Fix visiblity of dictionnary for MAIN_USE_EXPENSE_IK --- htdocs/admin/dict.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 4a5a09a3461..035d44cf3b2 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -509,8 +509,8 @@ $tabcond[30] = !empty($conf->label->enabled); $tabcond[32] = (!empty($conf->holiday->enabled) || !empty($conf->hrm->enabled)); $tabcond[33] = !empty($conf->hrm->enabled); $tabcond[34] = !empty($conf->hrm->enabled); -$tabcond[35] = !empty($conf->expensereport->enabled); -$tabcond[36] = !empty($conf->expensereport->enabled); +$tabcond[35] = !empty($conf->expensereport->enabled) && !empty($conf->global->MAIN_USE_EXPENSE_IK); +$tabcond[36] = !empty($conf->expensereport->enabled) && !empty($conf->global->MAIN_USE_EXPENSE_IK); $tabcond[37] = !empty($conf->product->enabled); $tabcond[38] = !empty($conf->socialnetworks->enabled); $tabcond[39] = (!empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && !empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES)); From 22345225190627b3b1a44c5a9d121db2af9931aa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Nov 2021 13:51:31 +0100 Subject: [PATCH 1425/1460] Debug module parnership. Add the type of partnership. --- htdocs/admin/dict.php | 2 +- htdocs/core/lib/modulebuilder.lib.php | 4 +- .../install/mysql/migration/14.0.0-15.0.0.sql | 2 + .../install/mysql/tables/llx_partnership.sql | 1 + htdocs/modulebuilder/index.php | 29 +- .../template/class/myobject.class.php | 6 +- .../partnership/class/partnership.class.php | 18 +- .../class/partnership_type.class.php | 562 ++++++++++++++++++ 8 files changed, 609 insertions(+), 15 deletions(-) create mode 100644 htdocs/partnership/class/partnership_type.class.php diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 035d44cf3b2..35fd58980b1 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -2107,7 +2107,7 @@ if ($id) { if ($iserasable) { print ''; diff --git a/htdocs/core/lib/modulebuilder.lib.php b/htdocs/core/lib/modulebuilder.lib.php index a5589679b50..d44da05fa38 100644 --- a/htdocs/core/lib/modulebuilder.lib.php +++ b/htdocs/core/lib/modulebuilder.lib.php @@ -17,8 +17,8 @@ */ /** - * \file htdocs/core/lib/memory.lib.php - * \brief Set of function for memory/cache management + * \file htdocs/core/lib/modulebuilder.lib.php + * \brief Set of function for modulebuilder management */ diff --git a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql index 2c460d4ab88..960b8010d51 100644 --- a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql +++ b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql @@ -82,6 +82,8 @@ INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, ALTER TABLE llx_c_partnership_type ADD UNIQUE INDEX uk_c_partnership_type(entity, code); +ALTER TABLE llx_partnership ADD COLUMN fk_type integer DEFAULT 0 NOT NULL; + ALTER TABLE llx_c_holiday_types CHANGE COLUMN newByMonth newbymonth double(8,5) DEFAULT 0 NOT NULL; ALTER TABLE llx_product ADD COLUMN mandatory_period tinyint NULL DEFAULT 0; diff --git a/htdocs/install/mysql/tables/llx_partnership.sql b/htdocs/install/mysql/tables/llx_partnership.sql index 6ab312f8875..47ee7f3a48b 100644 --- a/htdocs/install/mysql/tables/llx_partnership.sql +++ b/htdocs/install/mysql/tables/llx_partnership.sql @@ -20,6 +20,7 @@ CREATE TABLE llx_partnership( rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, ref varchar(128) DEFAULT '(PROV)' NOT NULL, status smallint NOT NULL DEFAULT '0', + fk_type integer DEFAULT 0 NOT NULL, fk_soc integer, fk_member integer, date_partnership_start date NOT NULL, diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index cab90270d64..9239413d951 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -262,6 +262,7 @@ if ($dirins && $action == 'initmodule' && $modulename) { // Delete some files related to Object (because the previous dolCopyDir has copied everything) dol_delete_file($destdir.'/myobject_card.php'); + dol_delete_file($destdir.'/myobject_contact.php'); dol_delete_file($destdir.'/myobject_note.php'); dol_delete_file($destdir.'/myobject_document.php'); dol_delete_file($destdir.'/myobject_agenda.php'); @@ -337,6 +338,14 @@ if ($dirins && $action == 'initmodule' && $modulename) { setEventMessages('ModuleInitialized', null); $module = $modulename; $modulename = ''; + + clearstatcache(true); + if (function_exists('opcache_invalidate')) { + opcache_reset(); // remove the include cache hell ! + } + + header("Location: ".$_SERVER["PHP_SELF"].'?module='.$modulename); + exit; } } @@ -953,7 +962,7 @@ if ($dirins && $action == 'initobject' && $module && GETPOST('createtablearray', if ($notnull) { $string .= ", 'notnull'=>".$notnull; } - if ($fieldname == 'ref') { + if ($fieldname == 'ref' || $fieldname == 'code') { $string .= ", 'showoncombobox'=>1"; } $string .= ", 'position'=>".$position; @@ -1417,6 +1426,14 @@ if ($dirins && $action == 'confirm_deletemodule') { if ($result > 0) { setEventMessages($langs->trans("DirWasRemoved", $modulelowercase), null); + + clearstatcache(true); + if (function_exists('opcache_invalidate')) { + opcache_reset(); // remove the include cache hell ! + } + + header("Location: ".$_SERVER["PHP_SELF"].'?module=deletemodule'); + exit; } else { setEventMessages($langs->trans("PurgeNothingToDelete"), null, 'warnings'); } @@ -1757,6 +1774,10 @@ if (!empty($module) && $module != 'initmodule' && $module != 'deletemodule') { $loadclasserrormessage = $e->getMessage()."
    \n"; $loadclasserrormessage .= 'File: '.$e->getFile()."
    \n"; $loadclasserrormessage .= 'Line: '.$e->getLine()."
    \n"; + } catch (Exception $e) { + $loadclasserrormessage = $e->getMessage()."
    \n"; + $loadclasserrormessage .= 'File: '.$e->getFile()."
    \n"; + $loadclasserrormessage .= 'Line: '.$e->getLine()."
    \n"; } if (class_exists($class)) { @@ -1771,6 +1792,7 @@ if (!empty($module) && $module != 'initmodule' && $module != 'deletemodule') { $error++; } $langs->load("errors"); + print ''; print img_warning('').' '.$langs->trans("ErrorFailedToLoadModuleDescriptorForXXX", $module).'
    '; print $loadclasserrormessage; } @@ -2423,8 +2445,8 @@ if ($module == 'initmodule') { print ''.$langs->trans("EnterNameOfObjectDesc").'

    '; print '
    '; - print ' '.$form->textwithpicto($langs->trans("IncludeRefGeneration"), $langs->trans("IncludeRefGenerationHelp")).'
    '; - print ' '.$form->textwithpicto($langs->trans("IncludeDocGeneration"), $langs->trans("IncludeDocGenerationHelp")).'
    '; + print '
    '; + print '
    '; print ''; print '
    '; print '
    '; @@ -2633,6 +2655,7 @@ if ($module == 'initmodule') { print '


    '; + clearstatcache(true); if (function_exists('opcache_invalidate')) { opcache_invalidate($dirread.'/'.$pathtoclass, true); // remove the include cache hell ! } diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 8e316d014d5..6e5d6efcff4 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -767,7 +767,7 @@ class MyObject extends CommonObject if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) { $add_save_lastsearch_values = 1; } - if ($add_save_lastsearch_values) { + if ($url && $add_save_lastsearch_values) { $url .= '&save_lastsearch_values=1'; } } @@ -784,13 +784,13 @@ class MyObject extends CommonObject $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); } - if ($option == 'nolink') { + if ($option == 'nolink' || empty($url)) { $linkstart = ''; - if ($option == 'nolink') { + if ($option == 'nolink' || empty($url)) { $linkend = ''; } else { $linkend = ''; diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index f2b15735762..b378435e546 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2021 NextGestion +/* Copyright (C) 2017 Laurent Destailleur + * Copyright (C) 2021 NextGestion * * 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 @@ -27,6 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; //require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; //require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; + /** * Class for Partnership */ @@ -105,7 +106,7 @@ class Partnership extends CommonObject 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>4, 'noteditable'=>'1', 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'comment'=>"Reference of object"), 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => 1, 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 15, 'index' => 1), - //'fk_type' => array('type' => 'integer:PartnershipType:partnership/class/partnershiptype.class.php', 'label' => 'Type', 'default' => 1, 'enabled' => 1, 'visible' => 1, 'position' => 20), + 'fk_type' => array('type' => 'integer:PartnershipType:partnership/class/partnership_type.class.php', 'label' => 'Type', 'enabled' => 1, 'visible' => 1, 'position' => 20), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>61, 'notnull'=>0, 'visible'=>0,), 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>62, 'notnull'=>0, 'visible'=>0,), 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2,), @@ -366,14 +367,15 @@ class Partnership extends CommonObject return -1; } - $sql = 'SELECT p.rowid, p.ref, p.fk_soc, p.fk_member, p.status'; + $sql = 'SELECT p.rowid, p.ref, p.fk_type, p.fk_soc, p.fk_member, p.status'; $sql .= ', p.entity, p.date_partnership_start, p.date_partnership_end, p.date_creation'; $sql .= ', p.fk_user_creat, p.tms, p.fk_user_modif, p.fk_user_modif'; $sql .= ', p.note_private, p.note_public'; $sql .= ', p.last_main_doc, p.count_last_url_check_error, p.last_check_backlink, p.reason_decline_or_cancel'; $sql .= ', p.import_key, p.model_pdf'; - + $sql .= ', pt.code as type_code, pt.label as type_label'; $sql .= ' FROM '.MAIN_DB_PREFIX.'partnership as p'; + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_partnership_type as pt ON p.fk_type = pt.rowid'; if ($id) { $sql .= " WHERE p.rowid=".((int) $id); @@ -400,8 +402,12 @@ class Partnership extends CommonObject if ($obj) { $this->id = $obj->rowid; $this->entity = $obj->entity; - $this->rowid = $obj->rowid; $this->ref = $obj->ref; + + $this->fk_type = $obj->fk_type; + $this->type_code = $obj->type_code; + $this->type_label = $obj->type_label; + $this->fk_soc = $obj->fk_soc; $this->fk_member = $obj->fk_member; $this->status = $obj->status; diff --git a/htdocs/partnership/class/partnership_type.class.php b/htdocs/partnership/class/partnership_type.class.php new file mode 100644 index 00000000000..6916d95e4f3 --- /dev/null +++ b/htdocs/partnership/class/partnership_type.class.php @@ -0,0 +1,562 @@ + + * Copyright (C) 2004-2008 Laurent Destailleur + * Copyright (C) 2009-2017 Regis Houssin + * Copyright (C) 2016 Charlie Benke + * Copyright (C) 2018-2019 Thibault Foucart + * Copyright (C) 2021 Waël Almoman + * + * 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 . + */ + +/** + * \file htdocs/partnership/class/partnership_type.class.php + * \ingroup partnership + * \brief File of class to manage partnership types + */ + +require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; + + +/** + * Class to manage partnership type + */ +class PartnershipType extends CommonObject +{ + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'c_partnership_type'; + + /** + * @var string ID to identify managed object + */ + public $element = 'partnership_type'; + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'generic'; + + /** + * 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + * @var int + */ + public $ismultientitymanaged = 1; + + /** + * @var string Partnership code + */ + public $code; + + /** + * @var string Partnership type label + */ + public $label; + + + public $fields=array( + 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), + 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>15, 'index'=>1), + 'code' =>array('type'=>'varchar(32)', 'label'=>'Code', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>20, 'showoncombobox'=>1), + 'label' =>array('type'=>'varchar(64)', 'label'=>'Label', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>25, 'showoncombobox'=>1), + 'active' =>array('type'=>'integer', 'label'=>'Active', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>30), + ); + + + + /** + * Constructor + * + * @param DoliDb $db Database handler + */ + public function __construct(DoliDB $db) + { + global $conf, $langs; + + $this->db = $db; + + if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) { + $this->fields['rowid']['visible'] = 0; + } + if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) { + $this->fields['entity']['enabled'] = 0; + } + + // Example to show how to set values of fields definition dynamically + /*if ($user->rights->mymodule->myobject->read) { + $this->fields['myfield']['visible'] = 1; + $this->fields['myfield']['noteditable'] = 0; + }*/ + + // Unset fields that are disabled + foreach ($this->fields as $key => $val) { + if (isset($val['enabled']) && empty($val['enabled'])) { + unset($this->fields[$key]); + } + } + + // Translate some data of arrayofkeyval + if (is_object($langs)) { + foreach ($this->fields as $key => $val) { + if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { + foreach ($val['arrayofkeyval'] as $key2 => $val2) { + $this->fields[$key]['arrayofkeyval'][$key2] = $langs->trans($val2); + } + } + } + } + } + + /** + * Create object into database + * + * @param User $user User that creates + * @param bool $notrigger false=launch triggers after, true=disable triggers + * @return int <0 if KO, Id of created object if OK + */ + public function create(User $user, $notrigger = false) + { + $resultcreate = $this->createCommon($user, $notrigger); + + //$resultvalidate = $this->validate($user, $notrigger); + + return $resultcreate; + } + + /** + * Load object in memory from the database + * + * @param int $id Id object + * @param string $ref Ref + * @return int <0 if KO, 0 if not found, >0 if OK + */ + public function fetch($id, $ref = null) + { + $result = $this->fetchCommon($id, $ref); + if ($result > 0 && !empty($this->table_element_line)) { + $this->fetchLines(); + } + return $result; + } + + /** + * Load list of objects in memory from the database. + * + * @param string $sortorder Sort Order + * @param string $sortfield Sort field + * @param int $limit limit + * @param int $offset Offset + * @param array $filter Filter array. Example array('field'=>'valueforlike', 'customurl'=>...) + * @param string $filtermode Filter mode (AND or OR) + * @return array|int int <0 if KO, array of pages if OK + */ + public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND') + { + global $conf; + + dol_syslog(__METHOD__, LOG_DEBUG); + + $records = array(); + + $sql = "SELECT "; + $sql .= $this->getFieldList('t'); + $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element." as t"; + if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) { + $sql .= " WHERE t.entity IN (".getEntity($this->table_element).")"; + } else { + $sql .= " WHERE 1 = 1"; + } + // Manage filter + $sqlwhere = array(); + if (count($filter) > 0) { + foreach ($filter as $key => $value) { + if ($key == 't.rowid') { + $sqlwhere[] = $key." = ".((int) $value); + } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; + } elseif ($key == 'customsql') { + $sqlwhere[] = $value; + } elseif (strpos($value, '%') === false) { + $sqlwhere[] = $key." IN (".$this->db->sanitize($this->db->escape($value)).")"; + } else { + $sqlwhere[] = $key." LIKE '%".$this->db->escape($value)."%'"; + } + } + } + if (count($sqlwhere) > 0) { + $sql .= " AND (".implode(" ".$filtermode." ", $sqlwhere).")"; + } + + if (!empty($sortfield)) { + $sql .= $this->db->order($sortfield, $sortorder); + } + if (!empty($limit)) { + $sql .= $this->db->plimit($limit, $offset); + } + + $resql = $this->db->query($sql); + if ($resql) { + $num = $this->db->num_rows($resql); + $i = 0; + while ($i < ($limit ? min($limit, $num) : $num)) { + $obj = $this->db->fetch_object($resql); + + $record = new self($this->db); + $record->setVarsFromFetchObj($obj); + + $records[$record->id] = $record; + + $i++; + } + $this->db->free($resql); + + return $records; + } else { + $this->errors[] = 'Error '.$this->db->lasterror(); + dol_syslog(__METHOD__.' '.join(',', $this->errors), LOG_ERR); + + return -1; + } + } + + /** + * Update object into database + * + * @param User $user User that modifies + * @param bool $notrigger false=launch triggers after, true=disable triggers + * @return int <0 if KO, >0 if OK + */ + public function update(User $user, $notrigger = false) + { + return $this->updateCommon($user, $notrigger); + } + + /** + * Delete object in database + * + * @param User $user User that deletes + * @param bool $notrigger false=launch triggers after, true=disable triggers + * @return int <0 if KO, >0 if OK + */ + public function delete(User $user, $notrigger = false) + { + return $this->deleteCommon($user, $notrigger); + //return $this->deleteCommon($user, $notrigger, 1); + } + + /** + * Set draft status + * + * @param User $user Object user that modify + * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers + * @return int <0 if KO, >0 if OK + */ + public function setDraft($user, $notrigger = 0) + { + // Protection + if ($this->status <= self::STATUS_DRAFT) { + return 0; + } + + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->write)) + || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->mymodule_advance->validate)))) + { + $this->error='Permission denied'; + return -1; + }*/ + + return $this->setStatusCommon($user, self::STATUS_DRAFT, $notrigger, 'PARTNERSHIPTYPE_UNVALIDATE'); + } + + /** + * Set cancel status + * + * @param User $user Object user that modify + * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers + * @return int <0 if KO, 0=Nothing done, >0 if OK + */ + public function cancel($user, $notrigger = 0) + { + // Protection + if ($this->status != self::STATUS_VALIDATED) { + return 0; + } + + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->write)) + || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->mymodule_advance->validate)))) + { + $this->error='Permission denied'; + return -1; + }*/ + + return $this->setStatusCommon($user, self::STATUS_CANCELED, $notrigger, 'PARTNERSHIPTYPE_CANCEL'); + } + + /** + * Set back to validated status + * + * @param User $user Object user that modify + * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers + * @return int <0 if KO, 0=Nothing done, >0 if OK + */ + public function reopen($user, $notrigger = 0) + { + // Protection + if ($this->status != self::STATUS_CANCELED) { + return 0; + } + + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->write)) + || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->mymodule_advance->validate)))) + { + $this->error='Permission denied'; + return -1; + }*/ + + return $this->setStatusCommon($user, self::STATUS_VALIDATED, $notrigger, 'PARTNERSHIPTYPE_REOPEN'); + } + + /** + * Return a link to the object card (with optionaly the picto) + * + * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) + * @param string $option On what the link point to ('nolink', ...) + * @param int $notooltip 1=Disable tooltip + * @param string $morecss Add more css on link + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string String with URL + */ + public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) + { + global $conf, $langs, $hookmanager; + + if (!empty($conf->dol_no_mouse_hover)) { + $notooltip = 1; // Force disable tooltips + } + + $result = ''; + + $label = img_picto('', $this->picto).' '.$langs->trans("PartnershipType").''; + if (isset($this->status)) { + $label .= ' '.$this->getLibStatut(5); + } + $label .= '
    '; + $label .= ''.$langs->trans('Code').': '.$this->code; + $label .= '
    '.$langs->trans('Label').': '.$this->label; + + //$url = dol_buildpath('/partnership/partnership_card.php', 1).'?id='.$this->id; + $url = ''; + + if ($option != 'nolink') { + // Add param to save lastsearch_values or not + $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0); + if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) { + $add_save_lastsearch_values = 1; + } + if ($url && $add_save_lastsearch_values) { + $url .= '&save_lastsearch_values=1'; + } + } + + $linkclose = ''; + if (empty($notooltip)) { + if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { + $label = $langs->trans("ShowMyObject"); + $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; + } + $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; + $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"'; + } else { + $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); + } + + if ($option == 'nolink' || empty($url)) { + $linkstart = ''; + if ($option == 'nolink' || empty($url)) { + $linkend = ''; + } else { + $linkend = ''; + } + + $result .= $linkstart; + + if (empty($this->showphoto_on_popup)) { + if ($withpicto) { + $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); + } + } else { + if ($withpicto) { + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + + list($class, $module) = explode('@', $this->picto); + $upload_dir = $conf->$module->multidir_output[$conf->entity]."/$class/".dol_sanitizeFileName($this->ref); + $filearray = dol_dir_list($upload_dir, "files"); + $filename = $filearray[0]['name']; + if (!empty($filename)) { + $pospoint = strpos($filearray[0]['name'], '.'); + + $pathtophoto = $class.'/'.$this->ref.'/thumbs/'.substr($filename, 0, $pospoint).'_mini'.substr($filename, $pospoint); + if (empty($conf->global->{strtoupper($module.'_'.$class).'_FORMATLISTPHOTOSASUSERS'})) { + $result .= '
    No photo
    '; + } else { + $result .= '
    No photo
    '; + } + + $result .= ''; + } else { + $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); + } + } + } + + if ($withpicto != 2) { + $result .= $this->ref; + } + + $result .= $linkend; + //if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : ''); + + global $action, $hookmanager; + $hookmanager->initHooks(array('myobjectdao')); + $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) { + $result = $hookmanager->resPrint; + } else { + $result .= $hookmanager->resPrint; + } + + return $result; + } + + /** + * Return the label of the status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function getLabelStatus($mode = 0) + { + return $this->LibStatut($this->status, $mode); + } + + /** + * Return the label of the status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function getLibStatut($mode = 0) + { + return $this->LibStatut($this->status, $mode); + } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return the status + * + * @param int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function LibStatut($status, $mode = 0) + { + // phpcs:enable + if (empty($this->labelStatus) || empty($this->labelStatusShort)) { + global $langs; + //$langs->load("mymodule@mymodule"); + $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); + $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); + $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled'); + $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); + $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); + $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled'); + } + + $statusType = 'status'.$status; + //if ($status == self::STATUS_VALIDATED) $statusType = 'status1'; + if ($status == self::STATUS_CANCELED) { + $statusType = 'status6'; + } + + return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); + } + + /** + * Load the info information in the object + * + * @param int $id Id of object + * @return void + */ + public function info($id) + { + $sql = "SELECT rowid, date_creation as datec, tms as datem,"; + $sql .= " fk_user_creat, fk_user_modif"; + $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element." as t"; + $sql .= " WHERE t.rowid = ".((int) $id); + + $result = $this->db->query($sql); + if ($result) { + if ($this->db->num_rows($result)) { + $obj = $this->db->fetch_object($result); + $this->id = $obj->rowid; + if ($obj->fk_user_author) { + $cuser = new User($this->db); + $cuser->fetch($obj->fk_user_author); + $this->user_creation = $cuser; + } + + if ($obj->fk_user_valid) { + $vuser = new User($this->db); + $vuser->fetch($obj->fk_user_valid); + $this->user_validation = $vuser; + } + + if ($obj->fk_user_cloture) { + $cluser = new User($this->db); + $cluser->fetch($obj->fk_user_cloture); + $this->user_cloture = $cluser; + } + + $this->date_creation = $this->db->jdate($obj->datec); + $this->date_modification = $this->db->jdate($obj->datem); + $this->date_validation = $this->db->jdate($obj->datev); + } + + $this->db->free($result); + } else { + dol_print_error($this->db); + } + } + + /** + * Initialise object with example values + * Id must be 0 if object instance is a specimen + * + * @return void + */ + public function initAsSpecimen() + { + // Set here init that are not commonf fields + // $this->property1 = ... + // $this->property2 = ... + + $this->initAsSpecimenCommon(); + } +} From 3b7c385c6c5ee621586a78e775ccf943c0699b50 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Nov 2021 13:53:30 +0100 Subject: [PATCH 1426/1460] Fix syntax error --- htdocs/core/lib/pdf.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 3ba436cf28c..1b051a6081f 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -979,7 +979,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ $outputlangs->load("dict"); $line = ''; - $reg = aray(); + $reg = array(); $dims = $pdf->getPageDimensions(); From 98ba48c0e76f7585701e1d5bf9017d7cc797e87e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Nov 2021 15:58:46 +0100 Subject: [PATCH 1427/1460] Look and feel v15 --- htdocs/modulebuilder/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 9239413d951..ef777569ee5 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1724,8 +1724,8 @@ print load_fiche_titre($text, '', 'title_setup'); print ''.$langs->trans("ModuleBuilderDesc", 'https://wiki.dolibarr.org/index.php/Module_development#Create_your_module').'
    '; -print $textforlistofdirs; -print '
    '; +//print $textforlistofdirs; +//print '
    '; //var_dump($listofmodules); @@ -1750,7 +1750,7 @@ if ($message) { } //print $langs->trans("ModuleBuilderDesc3", count($listofmodules), $FILEFLAG).'
    '; -$infomodulesfound = '
    '.$form->textwithpicto(''.$langs->trans("ModuleBuilderDesc3", count($listofmodules)).'', $langs->trans("ModuleBuilderDesc4", $FILEFLAG)).'
    '; +$infomodulesfound = '
    '.$form->textwithpicto(''.$langs->trans("ModuleBuilderDesc3", count($listofmodules)).'', $langs->trans("ModuleBuilderDesc4", $FILEFLAG).'
    '.$textforlistofdirs).'
    '; // Load module descriptor From 6d10facf5bda1e5d0a04893a334625134e865153 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Nov 2021 16:04:37 +0100 Subject: [PATCH 1428/1460] Debug v15 --- htdocs/modulebuilder/index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index ef777569ee5..1ab03743747 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -3355,7 +3355,8 @@ if ($module == 'initmodule') { } } else { print '
    '; print ''; print ''; From ed9806576aa61063fe6ea9bf7da9ddb146137dd9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Nov 2021 16:07:16 +0100 Subject: [PATCH 1429/1460] Trans --- htdocs/langs/en_US/modulebuilder.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index 5d6b51d5fe4..e479438769d 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -98,7 +98,7 @@ MenusDefDescTooltip=The menus provided by your module/application are defined in DictionariesDefDescTooltip=The dictionaries provided by your module/application are defined into the array $this->dictionaries into the module descriptor file. You can edit manually this file or use the embedded editor.

    Note: Once defined (and module re-activated), dictionaries are also visible into the setup area to administrator users on %s. PermissionsDefDescTooltip=The permissions provided by your module/application are defined into the array $this->rights into the module descriptor file. You can edit manually this file or use the embedded editor.

    Note: Once defined (and module re-activated), permissions are visible into the default permissions setup %s. HooksDefDesc=Define in the module_parts['hooks'] property, in the module descriptor, the context of hooks you want to manage (list of contexts can be found by a search on 'initHooks(' in core code).
    Edit the hook file to add code of your hooked functions (hookable functions can be found by a search on 'executeHooks' in core code). -TriggerDefDesc=Define in the trigger file the code you want to execute for each business event executed. +TriggerDefDesc=Define in the trigger file the code that you want to execute when a business event external to your module is executed (events recorded by other modules). SeeIDsInUse=See IDs in use in your installation SeeReservedIDsRangeHere=See range of reserved IDs ToolkitForDevelopers=Toolkit for Dolibarr developers From 969fe16442a098490142eb0d2622377622933e3e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Nov 2021 16:51:18 +0100 Subject: [PATCH 1430/1460] Debug mass actions of partnership module --- htdocs/core/actions_massactions.inc.php | 1 + htdocs/langs/en_US/partnership.lang | 1 + .../partnership/class/partnership.class.php | 22 ++++---- .../class/partnershiputils.class.php | 4 +- htdocs/partnership/partnership_card.php | 8 +-- htdocs/partnership/partnership_list.php | 56 +++++++++++++++++-- 6 files changed, 69 insertions(+), 23 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 00bfe865aaa..8ccff0eb017 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1556,6 +1556,7 @@ if (!$error && ($massaction == 'disable' || ($action == 'disable' && $confirm == } } +// Approve for leave only if (!$error && ($massaction == 'approveleave' || ($action == 'approveleave' && $confirm == 'yes')) && $permissiontoapprove) { $db->begin(); diff --git a/htdocs/langs/en_US/partnership.lang b/htdocs/langs/en_US/partnership.lang index f5b9ebcde24..0eb73c17920 100644 --- a/htdocs/langs/en_US/partnership.lang +++ b/htdocs/langs/en_US/partnership.lang @@ -58,6 +58,7 @@ ManagePartnership=Manage partnership BacklinkNotFoundOnPartnerWebsite=Backlink not found on partner website ConfirmClosePartnershipAsk=Are you sure you want to cancel this partnership? PartnershipType=Partnership type +PartnershipRefApproved=Partnership %s approved # # Template Mail diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index b378435e546..4981dde2b45 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -67,7 +67,7 @@ class Partnership extends CommonObject const STATUS_DRAFT = 0; const STATUS_VALIDATED = 1; // Validate (no more draft) - const STATUS_ACCEPTED = 2; // Approved + const STATUS_APPROVED = 2; // Approved const STATUS_REFUSED = 3; // Refused const STATUS_CANCELED = 9; @@ -707,13 +707,13 @@ class Partnership extends CommonObject } /** - * Accept object + * Approve object * * @param User $user User making status change * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <=0 if OK, 0=Nothing done, >0 if KO */ - public function accept($user, $notrigger = 0) + public function approve($user, $notrigger = 0) { global $conf, $langs; @@ -722,7 +722,7 @@ class Partnership extends CommonObject $error = 0; // Protection - if ($this->status == self::STATUS_ACCEPTED) { + if ($this->status == self::STATUS_APPROVED) { dol_syslog(get_class($this)."::accept action abandonned: already acceptd", LOG_WARNING); return 0; } @@ -751,7 +751,7 @@ class Partnership extends CommonObject // Accept $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element; $sql .= " SET ref = '".$this->db->escape($num)."',"; - $sql .= " status = ".self::STATUS_ACCEPTED; + $sql .= " status = ".self::STATUS_APPROVED; // if (!empty($this->fields['date_validation'])) { // $sql .= ", date_validation = '".$this->db->idate($now)."'"; // } @@ -818,7 +818,7 @@ class Partnership extends CommonObject // Set new ref and current status if (!$error) { $this->ref = $num; - $this->status = self::STATUS_ACCEPTED; + $this->status = self::STATUS_APPROVED; } if (!$error) { @@ -893,7 +893,7 @@ class Partnership extends CommonObject public function cancel($user, $notrigger = 0) { // Protection - if ($this->status != self::STATUS_ACCEPTED) { + if ($this->status != self::STATUS_APPROVED) { return 0; } @@ -928,7 +928,7 @@ class Partnership extends CommonObject return -1; }*/ - return $this->setStatusCommon($user, self::STATUS_ACCEPTED, $notrigger, 'PARTNERSHIP_REOPEN'); + return $this->setStatusCommon($user, self::STATUS_APPROVED, $notrigger, 'PARTNERSHIP_REOPEN'); } /** @@ -1073,18 +1073,18 @@ class Partnership extends CommonObject //$langs->load("partnership"); $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Validated'); - $this->labelStatus[self::STATUS_ACCEPTED] = $langs->transnoentitiesnoconv('Accepted'); + $this->labelStatus[self::STATUS_APPROVED] = $langs->transnoentitiesnoconv('Approved'); $this->labelStatus[self::STATUS_REFUSED] = $langs->transnoentitiesnoconv('Refused'); $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Canceled'); $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Validated'); - $this->labelStatusShort[self::STATUS_ACCEPTED] = $langs->transnoentitiesnoconv('Accepted'); + $this->labelStatusShort[self::STATUS_APPROVED] = $langs->transnoentitiesnoconv('Approved'); $this->labelStatusShort[self::STATUS_REFUSED] = $langs->transnoentitiesnoconv('Refused'); $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Canceled'); } $statusType = 'status'.$status; - if ($status == self::STATUS_ACCEPTED) { + if ($status == self::STATUS_APPROVED) { $statusType = 'status4'; } if ($status == self::STATUS_REFUSED) { diff --git a/htdocs/partnership/class/partnershiputils.class.php b/htdocs/partnership/class/partnershiputils.class.php index 0588b9e5df2..35b8a3b01e5 100644 --- a/htdocs/partnership/class/partnershiputils.class.php +++ b/htdocs/partnership/class/partnershiputils.class.php @@ -101,7 +101,7 @@ class PartnershipUtils $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."adherent_type as dty on (dty.rowid = d.fk_adherent_type)"; $sql .= " WHERE fk_member > 0"; $sql .= " AND (d.datefin < '".$this->db->idate($datetotest)."' AND dty.subscription = 1)"; - $sql .= " AND p.status = ".((int) $partnership::STATUS_ACCEPTED); // Only accepted not yet canceled + $sql .= " AND p.status = ".((int) $partnership::STATUS_APPROVED); // Only accepted not yet canceled $sql .= $this->db->order('d.rowid', 'ASC'); // Limit is managed into loop later @@ -262,7 +262,7 @@ class PartnershipUtils $sql .= " WHERE 1 = 1"; $sql .= " AND p.".$fk_partner." > 0"; - $sql .= " AND p.status = ".((int) $partnership::STATUS_ACCEPTED); // Only accepted not yet canceled + $sql .= " AND p.status = ".((int) $partnership::STATUS_APPROVED); // Only accepted not yet canceled $sql .= " AND (p.last_check_backlink IS NULL OR p.last_check_backlink <= '".$this->db->idate($now - 7 * 24 * 3600)."')"; // Every week, check that website contains a link to dolibarr. $sql .= $this->db->order('p.rowid', 'ASC'); // Limit is managed into loop later diff --git a/htdocs/partnership/partnership_card.php b/htdocs/partnership/partnership_card.php index 72787042e0e..0f32eb94580 100644 --- a/htdocs/partnership/partnership_card.php +++ b/htdocs/partnership/partnership_card.php @@ -153,7 +153,7 @@ if (empty($reshook)) { setEventMessages($object->error, $object->errors, 'errors'); } } elseif ($action == 'confirm_accept' && $confirm == 'yes' && $permissiontoadd) { - $result = $object->accept($user); + $result = $object->approve($user); if ($result >= 0) { // Define output language if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { @@ -590,9 +590,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Cancel if ($permissiontoadd) { - if ($object->status == $object::STATUS_ACCEPTED) { + if ($object->status == $object::STATUS_APPROVED) { print dolGetButtonAction($langs->trans('Cancel'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=close&token='.newToken(), '', $permissiontoadd); - } elseif ($object->status > $object::STATUS_ACCEPTED) { + } elseif ($object->status > $object::STATUS_APPROVED) { // print ''.$langs->trans("Re-Open").''."\n"; print dolGetButtonAction($langs->trans('Re-Open'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_reopen&confirm=yes&token='.newToken(), '', $permissiontoadd); } @@ -600,7 +600,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Refuse if ($permissiontoadd) { - if ($object->status != $object::STATUS_DRAFT && $object->status != $object::STATUS_ACCEPTED && $object->status != $object::STATUS_CANCELED && $object->status != $object::STATUS_REFUSED) { + if ($object->status != $object::STATUS_DRAFT && $object->status != $object::STATUS_APPROVED && $object->status != $object::STATUS_CANCELED && $object->status != $object::STATUS_REFUSED) { print dolGetButtonAction($langs->trans('Refuse'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=refuse&token='.newToken(), '', $permissiontoadd); } } diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index ef3b55ae44b..2703d431e1a 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -29,8 +29,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; - -// load partnership libraries require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership.class.php'; // for other modules @@ -158,6 +156,8 @@ if ($user->socid > 0) { // Protection if external user * Actions */ +$error = 0; + if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; @@ -200,6 +200,43 @@ if (empty($reshook)) { $uploaddir = $conf->partnership->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; + // Validate and approve + if (!$error && $massaction == 'approve' && $permissiontoadd) { + $objecttmp = new Partnership($db); + + $db->begin(); + $error = 0; + $result = 0; + + foreach ($toselect as $checked) { + if ($objecttmp->fetch($checked)) { + if ($objecttmp->status == $objecttmp::STATUS_DRAFT) { + //$objecttmp->date = dol_now(); + $result = $objecttmp->validate($user); + } + + if ($result >= 0 && $objecttmp->status == $objecttmp::STATUS_VALIDATED) { + $result = $objecttmp->approve($user); + if ($result > 0) { + setEventMessages($langs->trans("PartnershipRefApproved", $objecttmp->ref), null); + } else { + setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); + $error++; + } + } else { + setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); + $error++; + } + } + } + + if (!$error) { + $db->commit(); + } else { + $db->rollback(); + } + } + // Cancel partnership if ($massaction == 'cancel' && $permissiontoadd) { $db->begin(); @@ -208,9 +245,14 @@ if (empty($reshook)) { $nbok = 0; foreach ($toselect as $toselectid) { $result = $objecttmp->fetch($toselectid); + var_dump($objecttmp->status); if ($result > 0) { - $result = $objecttmp->cancel($user, 3); - if ($result <= 0) { + $result = $objecttmp->cancel($user, 0); + var_dump($result); + if ($result == 0) { + setEventMessages($langs->trans('StatusOfRefMustBe', $objecttmp->ref, $objecttmp->LibStatut($objecttmp::STATUS_APPROVED)), null, 'warnings'); + $error++; + } elseif ($result <= 0) { setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); $error++; break; @@ -432,7 +474,9 @@ $param .= $hookmanager->resPrint; // List of mass actions available $arrayofmassactions = array( -'cancel'=>img_picto('', 'close_title', 'class="pictofixedwidth"').$langs->trans("Cancel"), + //'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"), + 'approve'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("ValidateAndApprove"), + 'cancel'=>img_picto('', 'close_title', 'class="pictofixedwidth"').$langs->trans("Cancel"), //'generate_doc'=>img_picto('', 'pdf').$langs->trans("ReGeneratePDF"), //'builddoc'=>img_picto('', 'pdf').$langs->trans("PDFMerge"), 'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendMail"), @@ -440,7 +484,7 @@ $arrayofmassactions = array( if ($permissiontodelete) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { +if (GETPOST('nomassaction', 'int') || in_array($massaction, array('prevalidate', 'presend', 'predelete'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); From 424727546550d4f653e58176d9e03f74b61cf0a5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Nov 2021 17:27:37 +0100 Subject: [PATCH 1431/1460] css --- htdocs/index.php | 8 ++++---- htdocs/theme/eldy/global.inc.php | 2 +- htdocs/theme/md/style.css.php | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/index.php b/htdocs/index.php index 1884d9a823a..b9ac604ca95 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -539,9 +539,9 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { $openedDashBoard .= '
    '; if (!empty($board->labelShort)) { - $infoName = ''.$board->labelShort.''; + $infoName = ''.$board->labelShort.''; } else { - $infoName = $board->label; + $infoName = ''.$board->label.''; } $textLateTitle = $langs->trans("NActionsLate", $board->nbtodolate); @@ -563,7 +563,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { $nbtodClass = 'badge badge-info'; } - $openedDashBoard .= ' '.$infoName.' : '.$board->nbtodo.''; + $openedDashBoard .= ' '.$infoName.''.$board->nbtodo.''; if ($textLate) { if ($board->url_late) { $openedDashBoard .= ''; @@ -576,7 +576,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { $openedDashBoard .= ''."\n"; if ($board->total > 0 && !empty($conf->global->MAIN_WORKBOARD_SHOW_TOTAL_WO_TAX)) { - $openedDashBoard .= ''.$langs->trans('Total').' : '.price($board->total).''; + $openedDashBoard .= ''.$langs->trans('Total').' '.price($board->total).''; } $openedDashBoard .= '
    '."\n"; } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index d2e3c43a3aa..31bc0e036b6 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1086,7 +1086,7 @@ select.flat.selectlimit { max-width: 62px; } .selectlimit, .marginrightonly { - margin-right: 10px !important; + margin-: 10px !important; } .marginleftonly { margin-: 10px !important; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 4acf119eff7..06598624da2 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1170,7 +1170,7 @@ select.flat.selectlimit { max-width: 62px; } .selectlimit, .marginrightonly { - margin-right: 10px !important; + margin-: 10px !important; } .marginleftonly { margin-: 10px !important; From 1934a3767651f836b3eabe3b228f7d8cf1f732dc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Nov 2021 17:35:43 +0100 Subject: [PATCH 1432/1460] Escape to avoid false positive, even if it should be useless. --- htdocs/core/class/commonobject.class.php | 7 +------ htdocs/core/class/fileupload.class.php | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 91446f38070..812353591ed 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7874,11 +7874,6 @@ abstract class CommonObject $out .= ($display_type=='card' ? '' : ''); - /*for($ii = 0; $ii < ($colspan - 1); $ii++) - { - $out .='
    '; - }*/ - if (!empty($conf->global->MAIN_EXTRAFIELDS_USE_TWO_COLUMS) && (($e % 2) == 1)) { $out .= ($display_type=='card' ? '' : ''); } else { @@ -8887,7 +8882,7 @@ abstract class CommonObject $sql = "SELECT ".$objectline->getFieldList('l'); $sql .= " FROM ".MAIN_DB_PREFIX.$objectline->table_element." as l"; - $sql .= " WHERE l.fk_".$this->element." = ".((int) $this->id); + $sql .= " WHERE l.fk_".$this->db->escape($this->element)." = ".((int) $this->id); if ($morewhere) { $sql .= $morewhere; } diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php index 45bc622b9db..ea8618c8b92 100644 --- a/htdocs/core/class/fileupload.class.php +++ b/htdocs/core/class/fileupload.class.php @@ -222,7 +222,7 @@ class FileUpload protected function setFileDeleteUrl($file) { $file->delete_url = $this->options['script_url'] - .'?file='.rawurlencode($file->name).'&fk_element='.$this->fk_element.'&element='.$this->element; + .'?file='.urlencode($file->name).'&fk_element='.urlencode($this->fk_element).'&element='.urlencode($this->element); $file->delete_type = $this->options['delete_type']; if ($file->delete_type !== 'DELETE') { $file->delete_url .= '&_method=DELETE'; From 66f85d674db5967808806cacea45cc5945d27df7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Nov 2021 17:43:17 +0100 Subject: [PATCH 1433/1460] Fix warning scrutinizer --- htdocs/core/class/ldap.class.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 1d31c0cfc86..4af22683b2c 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -181,6 +181,8 @@ class Ldap $connected = 0; $this->bind = 0; + $this->error = 0; + $this->connectedServer = ''; // Check parameters if (count($this->server) == 0 || empty($this->server[0])) { @@ -229,7 +231,7 @@ class Ldap dol_syslog(get_class($this)."::connect_bind failed to start tls", LOG_WARNING); $this->error = 'ldap_start_tls Failed to start TLS '.ldap_errno($this->connection).' '.ldap_error($this->connection); $connected = 0; - $this->close(); + $this->unbind(); } } @@ -278,7 +280,9 @@ class Ldap } if (!$connected) { - $this->close(); + $this->unbind(); + } else { + $this->connectedServer = $host; } } } @@ -291,7 +295,7 @@ class Ldap $return = -1; dol_syslog(get_class($this)."::connect_bind return=".$return.' - '.$this->error, LOG_WARNING); } - $this->connectedServer = $host; + return $return; } From 68295073720d52307b3c8040269dfbf6bab28be8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Nov 2021 17:44:34 +0100 Subject: [PATCH 1434/1460] Fix missing $db --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 25dec3e47bb..602460e0e6d 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -106,7 +106,7 @@ function getDoliDBInstance($type, $host, $user, $pass, $name, $port) */ function getEntity($element, $shared = 1, $currentobject = null) { - global $conf, $mc, $hookmanager, $object, $action; + global $conf, $mc, $hookmanager, $object, $action, $db; if (! is_object($hookmanager)) { $hookmanager = new HookManager($db); From 2e499c2d17326353b6a4417c70175f199e995739 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Nov 2021 17:46:08 +0100 Subject: [PATCH 1435/1460] Fix unknown property --- htdocs/core/lib/functions.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 602460e0e6d..0ad85cc6c49 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -144,10 +144,10 @@ function getEntity($element, $shared = 1, $currentobject = null) $reshook = $hookmanager->executeHooks('hookGetEntity', $parameters, $currentobject, $action); // Note that $action and $object may have been modified by some hooks if (is_numeric($reshook)) { - if ($reshook == 0 && !empty($hookmanager->resprints)) { - $out .= ','.$hookmanager->resprints; // add + if ($reshook == 0 && !empty($hookmanager->resPrint)) { + $out .= ','.$hookmanager->resPrint; // add } elseif ($reshook == 1) { - $out = $hookmanager->resprints; // replace + $out = $hookmanager->resPrint; // replace } } From 5613ec71d60b2c64f4444609c69bbd8aa2f85738 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Nov 2021 17:48:01 +0100 Subject: [PATCH 1436/1460] Fix syntax --- htdocs/fourn/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index a6cf0cb232d..7ad7d434f46 100755 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1,4 +1,4 @@ - * Copyright (C) 2004-2020 Laurent Destailleur * Copyright (C) 2004 Christophe Combelles From eaf2c6e89cf762cc31c7efab842607ab07ee2023 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Nov 2021 17:49:31 +0100 Subject: [PATCH 1437/1460] Fix $action not defined --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 0ad85cc6c49..53ec09f943b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1845,7 +1845,7 @@ function dol_get_fiche_end($notab = 0) */ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldid = 'rowid', $fieldref = 'ref', $morehtmlref = '', $moreparam = '', $nodbprefix = 0, $morehtmlleft = '', $morehtmlstatus = '', $onlybanner = 0, $morehtmlright = '') { - global $conf, $form, $user, $langs, $hookmanager; + global $conf, $form, $user, $langs, $hookmanager, $action; $error = 0; From 5d4cf586d60a8ebdae04b03a7d6ddf1e0f696c1a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Nov 2021 17:51:30 +0100 Subject: [PATCH 1438/1460] Fix duplicate call --- scripts/company/sync_contacts_dolibarr2ldap.php | 1 - scripts/members/sync_members_dolibarr2ldap.php | 1 - scripts/members/sync_members_types_dolibarr2ldap.php | 1 - scripts/user/sync_groups_dolibarr2ldap.php | 1 - scripts/user/sync_users_dolibarr2ldap.php | 1 - 5 files changed, 5 deletions(-) diff --git a/scripts/company/sync_contacts_dolibarr2ldap.php b/scripts/company/sync_contacts_dolibarr2ldap.php index e161a813ec7..ccaabb1afda 100755 --- a/scripts/company/sync_contacts_dolibarr2ldap.php +++ b/scripts/company/sync_contacts_dolibarr2ldap.php @@ -154,7 +154,6 @@ if ($resql) { } $ldap->unbind(); - $ldap->close(); } else { dol_print_error($db); } diff --git a/scripts/members/sync_members_dolibarr2ldap.php b/scripts/members/sync_members_dolibarr2ldap.php index 66c245cf3eb..74a5c4db210 100755 --- a/scripts/members/sync_members_dolibarr2ldap.php +++ b/scripts/members/sync_members_dolibarr2ldap.php @@ -163,7 +163,6 @@ if ($resql) { } $ldap->unbind(); - $ldap->close(); } else { dol_print_error($db); } diff --git a/scripts/members/sync_members_types_dolibarr2ldap.php b/scripts/members/sync_members_types_dolibarr2ldap.php index 3d592673296..3ec2c9d0d90 100755 --- a/scripts/members/sync_members_types_dolibarr2ldap.php +++ b/scripts/members/sync_members_types_dolibarr2ldap.php @@ -121,7 +121,6 @@ if ($resql) { } $ldap->unbind(); - $ldap->close(); } else { print $ldap->error; } diff --git a/scripts/user/sync_groups_dolibarr2ldap.php b/scripts/user/sync_groups_dolibarr2ldap.php index dd0476bbfca..7d9ed2f307e 100755 --- a/scripts/user/sync_groups_dolibarr2ldap.php +++ b/scripts/user/sync_groups_dolibarr2ldap.php @@ -112,7 +112,6 @@ if ($resql) { } $ldap->unbind(); - $ldap->close(); } else { dol_print_error($db); } diff --git a/scripts/user/sync_users_dolibarr2ldap.php b/scripts/user/sync_users_dolibarr2ldap.php index 26b1363d5a1..abe0b9fbcf4 100755 --- a/scripts/user/sync_users_dolibarr2ldap.php +++ b/scripts/user/sync_users_dolibarr2ldap.php @@ -111,7 +111,6 @@ if ($resql) { } $ldap->unbind(); - $ldap->close(); } else { dol_print_error($db); } From f5edd25f6dfefcc6e090c603bb69af074c190cad Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Nov 2021 18:14:49 +0100 Subject: [PATCH 1439/1460] Clean code --- .../class/ProductCombination.class.php | 28 ++++++++----------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/htdocs/variants/class/ProductCombination.class.php b/htdocs/variants/class/ProductCombination.class.php index 5e396fba8db..bb6372fd5eb 100644 --- a/htdocs/variants/class/ProductCombination.class.php +++ b/htdocs/variants/class/ProductCombination.class.php @@ -1061,37 +1061,33 @@ class ProductCombinationLevel */ public function fetchAll($fk_product_attribute_combination, $fk_price_level = 0) { + $result = array(); $sql = "SELECT rowid, fk_product_attribute_combination, fk_price_level, variation_price, variation_price_percentage"; $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element; $sql .= " WHERE fk_product_attribute_combination = ".intval($fk_product_attribute_combination); - if (!empty($fk_price_level)) { $sql .= ' AND fk_price_level = '.intval($fk_price_level); } - $combination_price_levels = $this->db->getRows($sql); - - if (!is_array($combination_price_levels)) { - return -1; - } - - $result = array(); - - if (!empty($combination_price_levels)) { - // For more simple usage set level as array key - foreach ($combination_price_levels as $k => $row) { - $productCombinationLevel = new ProductCombinationLevel($this->db); - $productCombinationLevel->fetchFormObj($row); - $result[$row->fk_price_level] = $productCombinationLevel; + $res = $this->db->query($sql); + if ($res) { + if ($this->db->num_rows($res) > 0) { + while ($obj = $this->db->fetch_object($res)) { + $productCombinationLevel = new ProductCombinationLevel($this->db); + $productCombinationLevel->fetchFormObj($obj); + $result[$obj->fk_price_level] = $productCombinationLevel; + } } + } else { + return -1; } return $result; } /** - * assign vars form an stdclass like sql obj + * Assign vars form an stdclass like sql obj * * @param int $obj Object resultset * @return int <0 KO, >0 OK From 142e9473c5af94978048f70149e097a72b27d307 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Nov 2021 18:28:59 +0100 Subject: [PATCH 1440/1460] Responsive --- htdocs/admin/barcode.php | 152 +++++++++++++++++-------------- htdocs/variants/combinations.php | 40 +++++--- 2 files changed, 109 insertions(+), 83 deletions(-) diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index c370c07b73b..2fbfed35536 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -176,6 +176,71 @@ foreach ($dirbarcode as $reldir) { } } + + +// Select barcode numbering module +if ($conf->product->enabled) { + print load_fiche_titre($langs->trans("BarCodeNumberManager")." (".$langs->trans("Product").")", '', ''); + + print '
    '; + print '
    '.$langs->trans("AskForPreferredShippingMethod").' 
    '; print $langs->trans("BankAccountForBankTransfer").''; print img_picto('', 'bank_account').' '; @@ -446,15 +446,6 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { // TODO Not used by current code print '
    '; -// print $langs->trans("ONLINE_PAYMENT_WAREHOUSE").''; -// print $formproduct->selectWarehouses($conf->global->ONLINE_PAYMENT_WAREHOUSE, 'ONLINE_PAYMENT_WAREHOUSE', '', 1, $disabled); -// print '
    '; print $langs->trans("CSSUrlForPaymentForm").''; print ''; diff --git a/htdocs/theme/eldy/main_menu_fa_icons.inc.php b/htdocs/theme/eldy/main_menu_fa_icons.inc.php index a9e5e80c009..f193af733c9 100644 --- a/htdocs/theme/eldy/main_menu_fa_icons.inc.php +++ b/htdocs/theme/eldy/main_menu_fa_icons.inc.php @@ -53,7 +53,7 @@ div.mainmenu.bank::before { content: "\f19c"; } -global->MAIN_FEATURES_LEVEL == 2) { ?> + /* TESTING USAGE OF SVG WITHOUT FONT */ div.mainmenu.cashdesk { line-height: 26px; From 61d97ccd22abfc9fd60bce6741b7cf4e1d2047bf Mon Sep 17 00:00:00 2001 From: Nicolas Domenech Date: Fri, 5 Nov 2021 16:02:24 +0100 Subject: [PATCH 1416/1460] NEW : redirect after connection in login page --- htdocs/core/lib/security2.lib.php | 5 +++++ htdocs/core/tpl/login.tpl.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php index ab47bc02899..d6546e64cfd 100644 --- a/htdocs/core/lib/security2.lib.php +++ b/htdocs/core/lib/security2.lib.php @@ -224,6 +224,11 @@ if (!function_exists('dol_loginfunction')) { $reshook = $hookmanager->executeHooks('getLoginPageExtraOptions', $parameters); // Note that $action and $object may have been modified by some hooks. $moreloginextracontent = $hookmanager->resPrint; + //Redirect after connection + $parameters = array('entity' => GETPOST('entity', 'int')); + $reshook = $hookmanager->executeHooks('redirectAfterConnection', $parameters); // Note that $action and $object may have been modified by some hooks. + $php_self = $hookmanager->resPrint; + // Login $login = (!empty($hookmanager->resArray['username']) ? $hookmanager->resArray['username'] : (GETPOST("username", "alpha") ? GETPOST("username", "alpha") : $demologin)); $password = $demopassword; diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 0a4bb149986..9f2f2f68712 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -57,7 +57,7 @@ if (!empty($conf->dol_use_jmobile)) { $conf->use_javascript_ajax = 1; } -$php_self = dol_escape_htmltag($_SERVER['PHP_SELF']); +$php_self = empty($php_self) ? dol_escape_htmltag($_SERVER['PHP_SELF']) : $php_self; $php_self .= dol_escape_htmltag($_SERVER["QUERY_STRING"]) ? '?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]) : ''; if (!preg_match('/mainmenu=/', $php_self)) { $php_self .= (preg_match('/\?/', $php_self) ? '&' : '?').'mainmenu=home'; From 77864f2c2c45678f167c891e106d9912bf738edf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Nov 2021 19:07:28 +0100 Subject: [PATCH 1417/1460] NEW Can set value for EHLO smtp command in MAIL_SMTP_USE_FROM_FOR_HELO --- htdocs/core/class/smtps.class.php | 77 ++++++++++++++++++++++++------- 1 file changed, 61 insertions(+), 16 deletions(-) diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index c287aae1c2f..dbaaacc2d18 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -464,20 +464,26 @@ class SMTPs $host = 'tls://'.$host; } - $hosth = $host; + $hosth = $host; // so for example 'localhost' or 'smtp-relay.gmail.com' if (!empty($conf->global->MAIL_SMTP_USE_FROM_FOR_HELO)) { - // If the from to is 'aaa ', we will keep 'ccc.com' - $hosth = $this->getFrom('addr'); - $hosth = preg_replace('/^.*.*$/', '', $hosth); - $hosth = preg_replace('/.*@/', '', $hosth); + if (!is_numeric($conf->global->MAIL_SMTP_USE_FROM_FOR_HELO)) { + // If value of MAIL_SMTP_USE_FROM_FOR_HELO is a string, we use it as domain name + $hosth = $conf->global->MAIL_SMTP_USE_FROM_FOR_HELO; + } else { + // If value of MAIL_SMTP_USE_FROM_FOR_HELO is 1, we use the domain in the from. + // So if the from to is 'aaa ', we will keep 'ccc.com' + $hosth = $this->getFrom('addr'); + $hosth = preg_replace('/^.*.*$/', '', $hosth); + $hosth = preg_replace('/.*@/', '', $hosth); + } } if ($_retVal = $this->socket_send_str('EHLO '.$hosth, '250')) { if ($usetls) { /* - The following dialog illustrates how a client and server can start a TLS STARTTLS session + The following dialog illustrates how a client and server can start a TLS STARTTLS session: S: C: S: 220 mail.imc.org SMTP service ready @@ -494,6 +500,39 @@ class SMTPs S: 250-server-domain.com S: 250 AUTH LOGIN C: + S: 250 OK + C: RCPT TO: + S: 250 OK + C: DATA + S: 354 Send message, end with a "." on a line by itself + C: + S . + S: 250 OK, message accepted for delivery: queued as 12345 + C: QUIT + S: 221 Bye */ if (!$_retVal = $this->socket_send_str('STARTTLS', 220)) { $this->_setErr(131, 'STARTTLS connection is not supported.'); @@ -517,10 +556,10 @@ class SMTPs $this->_setErr(132, 'STARTTLS connection failed.'); return $_retVal; } - // Most server servers expect a 2nd pass of EHLO after TLS is established to get another time + // Most servers expect a 2nd pass of EHLO after TLS is established to get another time // the answer with list of supported AUTH methods. They may differs between non STARTTLS and with STARTTLS. - if (!$_retVal = $this->socket_send_str('EHLO '.$hosth, '250')) { - $this->_setErr(126, '"'.$hosth.'" does not support authenticated connections.'); + if (! $_retVal = $this->socket_send_str('EHLO '.$hosth, '250')) { + $this->_setErr(126, '"'.$hosth.'" does not support authenticated connections. Error after sending EHLO '.$hosth); return $_retVal; } } @@ -560,7 +599,7 @@ class SMTPs $this->_setErr(130, 'Invalid Authentication Credentials.'); } } else { - $this->_setErr(126, '"'.$host.'" does not support authenticated connections.'); + $this->_setErr(126, '"'.$host.'" does not support authenticated connections. Error after sending EHLO '.$hosth); } return $_retVal; @@ -603,11 +642,17 @@ class SMTPs $hosth = $host; if (!empty($conf->global->MAIL_SMTP_USE_FROM_FOR_HELO)) { - // If the from to is 'aaa ', we will keep 'ccc.com' - $hosth = $this->getFrom('addr'); - $hosth = preg_replace('/^.*.*$/', '', $hosth); - $hosth = preg_replace('/.*@/', '', $hosth); + if (!is_numeric($conf->global->MAIL_SMTP_USE_FROM_FOR_HELO)) { + // If value of MAIL_SMTP_USE_FROM_FOR_HELO is a string, we use it as domain name + $hosth = $conf->global->MAIL_SMTP_USE_FROM_FOR_HELO; + } else { + // If value of MAIL_SMTP_USE_FROM_FOR_HELO is 1, we use the domain in the from. + // If the from to is 'aaa ', we will keep 'ccc.com' + $hosth = $this->getFrom('addr'); + $hosth = preg_replace('/^.*.*$/', '', $hosth); + $hosth = preg_replace('/.*@/', '', $hosth); + } } $_retVal = $this->socket_send_str('HELO '.$hosth, '250'); From 65105a3e05b26a8c6959da65394ed38fb909df42 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Nov 2021 19:27:50 +0100 Subject: [PATCH 1418/1460] Better log --- htdocs/core/class/ldap.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index e2ce33cc45f..48618a83dd9 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -261,7 +261,7 @@ class Ldap } // Try in anonymous if (!$this->bind) { - dol_syslog(get_class($this)."::connect_bind try bind on ".$host, LOG_DEBUG); + dol_syslog(get_class($this)."::connect_bind try bind anonymously on ".$host, LOG_DEBUG); $result = $this->bind(); if ($result) { $this->bind = $this->result; From fc70adb2e74f53dbcf3746b94731dc55ae4df8c9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Nov 2021 20:40:26 +0100 Subject: [PATCH 1419/1460] Fix ref suffix for patnership into PSHIP --- .../core/modules/partnership/mod_partnership_standard.php | 2 +- htdocs/partnership/partnership_card.php | 4 ++-- htdocs/partnership/partnership_list.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/partnership/core/modules/partnership/mod_partnership_standard.php b/htdocs/partnership/core/modules/partnership/mod_partnership_standard.php index fefcafa2350..d5a2bb326b2 100644 --- a/htdocs/partnership/core/modules/partnership/mod_partnership_standard.php +++ b/htdocs/partnership/core/modules/partnership/mod_partnership_standard.php @@ -36,7 +36,7 @@ class mod_partnership_standard extends ModeleNumRefPartnership */ public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' - public $prefix = 'PARTNERSHIP'; + public $prefix = 'PSHIP'; /** * @var string Error code (or message) diff --git a/htdocs/partnership/partnership_card.php b/htdocs/partnership/partnership_card.php index 99cdb74e264..72787042e0e 100644 --- a/htdocs/partnership/partnership_card.php +++ b/htdocs/partnership/partnership_card.php @@ -232,7 +232,7 @@ if (empty($reshook)) { // Actions to send emails $triggersendname = 'PARTNERSHIP_SENTBYMAIL'; $autocopy = 'MAIN_MAIL_AUTOCOPY_PARTNERSHIP_TO'; - $trackid = 'partnership'.$object->id; + $trackid = 'pship'.$object->id; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; if (!empty($id) && !empty(GETPOST('confirm'))) { @@ -664,7 +664,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $modelmail = 'partnership_send'; $defaulttopic = 'InformationMessage'; $diroutput = $conf->partnership->dir_output; - $trackid = 'partnership'.$object->id; + $trackid = 'pship'.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; } diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index a5c52609d74..ef3b55ae44b 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -464,7 +464,7 @@ print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sort $topicmail = "SendPartnershipRef"; $modelmail = "partnership_send"; $objecttmp = new Partnership($db); -$trackid = 'partnership'.$object->id; +$trackid = 'pship'.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; if ($search_all) { From ccc1d4d1fa1871d7b5680376427dbd95a43ef513 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Nov 2021 12:24:25 +0100 Subject: [PATCH 1420/1460] Fix warning --- htdocs/core/lib/pdf.lib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 4821bfde2b9..3ba436cf28c 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -979,6 +979,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ $outputlangs->load("dict"); $line = ''; + $reg = aray(); $dims = $pdf->getPageDimensions(); @@ -1273,6 +1274,7 @@ function pdf_writelinedesc(&$pdf, $object, $i, $outputlangs, $w, $h, $posx, $pos // Fix bug of some HTML editors that replace links ]*src=")([^"]*)(&)([^"]*")/', '\1\2&\4', $labelproductservice, -1, $nbrep); //var_dump($labelproductservice);exit; From 713db0e61355924009116566e720c8e90bc8b7e7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Nov 2021 12:26:44 +0100 Subject: [PATCH 1421/1460] Removed function pdf_getTotalQty (duplicate with pdf_getlineqty) --- htdocs/core/lib/pdf.lib.php | 42 ------------------------------------- 1 file changed, 42 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 1a8d15a4fc4..c8334edc705 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -2214,48 +2214,6 @@ function pdf_getlinetotalwithtax($object, $i, $outputlangs, $hidedetails = 0) return $result; } -/** - * Return total quantity of products and/or services - * - * @param Object $object Object - * @param string $type Type - * @param Translate $outputlangs Object langs for output - * @return integer - * @deprecated Not used by Dolibarr core, so will be removed. - */ -function pdf_getTotalQty($object, $type, $outputlangs) -{ - global $hookmanager; - - $total = 0; - $nblines = count($object->lines); - - // Loop on each lines - for ($i = 0; $i < $nblines; $i++) { - if ($object->lines[$i]->special_code != 3) { - if ($type == 'all') { - $total += $object->lines[$i]->qty; - } elseif ($type == 9 && is_object($hookmanager) && (($object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line))) { - $special_code = $object->lines[$i]->special_code; - if (!empty($object->lines[$i]->fk_parent_line)) { - $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); - } - $hidedetails = ''; - $parameters = array('i'=>$i, 'outputlangs'=>$outputlangs, 'hidedetails'=>$hidedetails, 'special_code'=>$special_code); - $action = ''; - $reshook = $hookmanager->executeHooks('pdf_getTotalQty', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks - return $hookmanager->resPrint; - } elseif ($type == 0 && $object->lines[$i]->product_type == 0) { - $total += $object->lines[$i]->qty; - } elseif ($type == 1 && $object->lines[$i]->product_type == 1) { - $total += $object->lines[$i]->qty; - } - } - } - - return $total; -} - /** * Return linked objects to use for document generation. * Warning: To save space, this function returns only one link per link type (all links are concated on same record string). This function is used by pdf_writeLinkedObjects From 11bb7428cedf682dd322f1494b545e80d7c5f3f6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Nov 2021 12:34:08 +0100 Subject: [PATCH 1422/1460] Clean code --- htdocs/fourn/facture/list.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 6c133c9b5a1..7dbead5536b 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -975,13 +975,13 @@ if ($resql) { // Ref if (!empty($arrayfields['f.ref']['checked'])) { print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; if ($user->admin) { - print ''.img_delete().''; + print ''.img_delete().''; } //else print ''.img_delete().''; // Some dictionary can be edited by other profile than admin print '
    '; - print ' '.$langs->trans("NoTrigger"); + print ' '.$langs->trans("TriggersFile"); + print ' : '.$langs->trans("FileNotYetGenerated").''; print ''.img_picto('Generate', 'generate', 'class="paddingleft"').'
    '; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + + $dirbarcodenum = array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']); + + foreach ($dirbarcodenum as $dirroot) { + $dir = dol_buildpath($dirroot, 0); + + $handle = @opendir($dir); + if (is_resource($handle)) { + while (($file = readdir($handle)) !== false) { + if (preg_match('/^mod_barcode_product_.*php$/', $file)) { + $file = substr($file, 0, dol_strlen($file) - 4); + + try { + dol_include_once($dirroot.$file.'.php'); + } catch (Exception $e) { + dol_syslog($e->getMessage(), LOG_ERR); + } + + $modBarCode = new $file(); + + print ''; + print ''; + print '\n"; + + if (!empty($conf->global->BARCODE_PRODUCT_ADDON_NUM) && $conf->global->BARCODE_PRODUCT_ADDON_NUM == "$file") { + print ''; + } else { + print ''; + } + print ''; + print "\n"; + } + } + closedir($handle); + } + } + print "
    '.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Example").''.$langs->trans("Status").''.$langs->trans("ShortInfo").'
    '.(isset($modBarCode->name) ? $modBarCode->name : $modBarCode->nom)."\n"; + print $modBarCode->info($langs); + print ''.$modBarCode->getExample($langs)."'; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print ''; + $s = $modBarCode->getToolTip($langs, null, -1); + print $form->textwithpicto('', $s, 1); + print '
    \n"; + print '
    '; +} + + /* * CHOIX ENCODAGE */ @@ -189,6 +254,7 @@ if (empty($conf->use_javascript_ajax)) { print ''; } +print '
    '; print ''; print ''; print ''; @@ -211,8 +277,9 @@ if ($resql) { while ($i < $num) { $obj = $db->fetch_object($resql); - print ''; + print '
    '.$langs->trans("Name").'
    '; - print $obj->label; + print '
    '; + print dol_escape_htmltag($obj->label); print "\n"; print $langs->trans('BarcodeDesc'.$obj->encoding); //print "L'EAN se compose de 8 caracteres, 7 chiffres plus une cle de controle.
    "; @@ -270,6 +337,7 @@ if ($resql) { } } print "
    \n"; +print '
    '; if (empty($conf->use_javascript_ajax)) { print $form->buttonsSaveCancel("Save", ''); @@ -287,6 +355,7 @@ print ""; print ''; print ""; +print '
    '; print ''; print ''; print ''; @@ -304,7 +373,9 @@ if (!isset($_SERVER['WINDIR'])) { $langs->load("errors"); print '
    '.$langs->trans("ErrorFileNotFound", $conf->global->GENBARCODE_LOCATION).''; } - print ''; + print ''; + print ''; + print ''; } // Module products @@ -313,7 +384,9 @@ if (!empty($conf->product->enabled)) { print ''; print ''; + print ''; + print ''; + print ''; } // Module thirdparty @@ -322,10 +395,14 @@ if (!empty($conf->societe->enabled)) { print ''; print ''; + print ''; + print ''; + print ''; } print "
    '.$langs->trans("Parameter").'
     
    '.$langs->trans("SetDefaultBarcodeTypeProducts").''; print $formbarcode->selectBarcodeType($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE, "PRODUIT_DEFAULT_BARCODE_TYPE", 1); - print '
     
    '.$langs->trans("SetDefaultBarcodeTypeThirdParties").''; print $formbarcode->selectBarcodeType($conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY, "GENBARCODE_BARCODETYPE_THIRDPARTY", 1); - print '
     
    \n"; +print '
    '; + print '
    '; print ''; print "
    "; @@ -334,71 +411,6 @@ print '
    '; print '
    '; - -// Select barcode numbering module -if ($conf->product->enabled) { - print load_fiche_titre($langs->trans("BarCodeNumberManager")." (".$langs->trans("Product").")", '', ''); - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print "\n"; - - $dirbarcodenum = array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']); - - foreach ($dirbarcodenum as $dirroot) { - $dir = dol_buildpath($dirroot, 0); - - $handle = @opendir($dir); - if (is_resource($handle)) { - while (($file = readdir($handle)) !== false) { - if (preg_match('/^mod_barcode_product_.*php$/', $file)) { - $file = substr($file, 0, dol_strlen($file) - 4); - - try { - dol_include_once($dirroot.$file.'.php'); - } catch (Exception $e) { - dol_syslog($e->getMessage(), LOG_ERR); - } - - $modBarCode = new $file(); - - print ''; - print ''; - print '\n"; - - if (!empty($conf->global->BARCODE_PRODUCT_ADDON_NUM) && $conf->global->BARCODE_PRODUCT_ADDON_NUM == "$file") { - print ''; - } else { - print ''; - } - print ''; - print "\n"; - } - } - closedir($handle); - } - } - print "
    '.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Example").''.$langs->trans("Status").''.$langs->trans("ShortInfo").'
    '.(isset($modBarCode->name) ? $modBarCode->name : $modBarCode->nom)."\n"; - print $modBarCode->info($langs); - print ''.$modBarCode->getExample($langs)."'; - print img_picto($langs->trans("Activated"), 'switch_on'); - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - print ''; - $s = $modBarCode->getToolTip($langs, null, -1); - print $form->textwithpicto('', $s, 1); - print '
    \n"; -} - -//print ''; - -print "
    "; - // End of page llxFooter(); $db->close(); diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index d70419060f5..1569fcabb39 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -194,14 +194,11 @@ if (($action == 'add' || $action == 'create') && empty($massaction) && !GETPOST( $bulkaction = $massaction; $error = 0; - - $db->begin(); foreach ($toselect as $prodid) { // need create new of Product to prevent rename dir behavior $prodstatic = new Product($db); - if ($prodstatic->fetch($prodid) < 0) { continue; } @@ -209,33 +206,50 @@ if (($action == 'add' || $action == 'create') && empty($massaction) && !GETPOST( if ($bulkaction == 'on_sell') { $prodstatic->status = 1; $res = $prodstatic->update($prodstatic->id, $user); + if ($res <= 0) { + setEventMessages($prodstatic->error, $prodstatic->errors, 'errors'); + $error++; + break; + } } elseif ($bulkaction == 'on_buy') { $prodstatic->status_buy = 1; $res = $prodstatic->update($prodstatic->id, $user); + if ($res <= 0) { + setEventMessages($prodstatic->error, $prodstatic->errors, 'errors'); + $error++; + break; + } } elseif ($bulkaction == 'not_sell') { $prodstatic->status = 0; $res = $prodstatic->update($prodstatic->id, $user); + if ($res <= 0) { + setEventMessages($prodstatic->error, $prodstatic->errors, 'errors'); + $error++; + break; + } } elseif ($bulkaction == 'not_buy') { $prodstatic->status_buy = 0; $res = $prodstatic->update($prodstatic->id, $user); + if ($res <= 0) { + setEventMessages($prodstatic->error, $prodstatic->errors, 'errors'); + $error++; + break; + } } elseif ($bulkaction == 'delete') { $res = $prodstatic->delete($user, $prodstatic->id); + if ($res <= 0) { + setEventMessages($prodstatic->error, $prodstatic->errors, 'errors'); + $error++; + break; + } } else { break; } - - if ($res <= 0) { - $error++; - break; - } } if ($error) { $db->rollback(); - - if ($prodstatic->error) { - setEventMessages($prodstatic->error, $prodstatic->errors, 'errors'); - } else { + if (empty($prodstatic->error)) { setEventMessages($langs->trans('CoreErrorMessage'), null, 'errors'); } } else { @@ -834,7 +848,7 @@ if (!empty($id) || !empty($ref)) { $aaa .= ' '; $aaa .= ' '; $aaa .= ''; - $aaa .= ''; + $aaa .= ''; } $massactionbutton = $aaa; From 9fd57279855a097354c80ea58ca73800c657e722 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Nov 2021 18:47:27 +0100 Subject: [PATCH 1441/1460] Try to fix some regressions --- htdocs/accountancy/customer/list.php | 13 ++++++++----- htdocs/accountancy/supplier/list.php | 21 +++++++++++++-------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index abf5a8d4c2e..c07f4854b84 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -413,6 +413,9 @@ if ($result) { if ($search_ref) { $param .= '&search_ref='.urlencode($search_ref); } + if ($search_label) { + $param .= '&search_label='.urlencode($search_label); + } if ($search_desc) { $param .= '&search_desc='.urlencode($search_desc); } @@ -491,7 +494,7 @@ if ($result) { $searchpicto = $form->showFilterButtons(); print $searchpicto; print '
    '.$facture_static->getNomUrl(1).''.dol_print_date($db->jdate($facture_static->date), 'day').''.dol_print_date($facture_static->date, 'day').''; @@ -728,7 +731,7 @@ if ($result) { // Column with checkbox print ''; - if (!empty($suggestedid) && $suggestedaccountingaccountfor<>'') { + if (!empty($suggestedid) && $suggestedaccountingaccountfor <> '') { $ischecked=1; } elseif ($suggestedaccountingaccountfor == 'eecwithoutvatnumber') { $ischecked = 0; diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index 20230c7cfad..b7e914c381a 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -291,7 +291,7 @@ if (strlen(trim($search_ref))) { $sql .= natural_search("p.ref", $search_ref); } if (strlen(trim($search_label))) { - $sql .= natural_search("f.libelle", $search_label); + $sql .= natural_search(array("p.label", "f.libelle"), $search_label); } if (strlen(trim($search_desc))) { $sql .= natural_search("l.description", $search_desc); @@ -546,7 +546,7 @@ if ($result) { $thirdpartystatic->email = $objp->email; $thirdpartystatic->country_code = $objp->country_code; $thirdpartystatic->tva_intra = $objp->tva_intra; - $thirdpartystatic->code_compta_fournisseur = $objp->company_code_buy; + $thirdpartystatic->code_compta_company = $objp->company_code_buy; $product_static->ref = $objp->product_ref; $product_static->id = $objp->product_id; @@ -566,10 +566,11 @@ if ($result) { $facturefourn_static->id = $objp->facid; $facturefourn_static->type = $objp->ftype; $facturefourn_static->label = $objp->invoice_label; + $facturefourn_static->date = $db->jdate($objp->datef); $facturefourn_static_det->id = $objp->rowid; $facturefourn_static_det->total_ht = $objp->total_ht; - $facturefourn_static_det->tva_tx_line = $objp->tva_tx_line; + $facturefourn_static_det->tva_tx = $objp->tva_tx_line; $facturefourn_static_det->vat_src_code = $objp->vat_src_code; $facturefourn_static_det->product_type = $objp->type_l; $facturefourn_static_det->desc = $objp->description; @@ -608,6 +609,9 @@ if ($result) { if (empty($code_buy_l) && empty($code_buy_p)) { $code_buy_p_notset = 'color:red'; } + /*if ($suggestedaccountingaccountfor == 'eecwithoutvatnumber' && empty($code_sell_p_notset)) { + $code_sell_p_notset = 'color:orange'; + }*/ // $code_buy_l is now default code of product/service // $code_buy_p is now code of product/service @@ -626,15 +630,15 @@ if ($result) { print ''.dol_print_date($db->jdate($facturefourn_static_det->datef), 'day').''.dol_print_date($facturefourn_static->date, 'day').''; if ($product_static->id > 0) { print $product_static->getNomUrl(1); } - if ($product_static->product_label) { - print '
    '.$product_static->product_label.''; + if ($product_static->label) { + print '
    '.$product_static->label.''; } print '
    '; - print vatrate($facturefourn_static_det->tva_tx_line.($facturefourn_static_det->vat_src_code ? ' ('.$facturefourn_static_det->vat_src_code.')' : '')); + print vatrate($facturefourn_static_det->tva_tx.($facturefourn_static_det->vat_src_code ? ' ('.$facturefourn_static_det->vat_src_code.')' : '')); print ''; - $s = '1. '.(($facturefourn_static_det->type_l == 1) ? $langs->trans("DefaultForService") : $langs->trans("DefaultForProduct")).': '; + $s = '1. '.(($facturefourn_static_det->product_type == 1) ? $langs->trans("DefaultForService") : $langs->trans("DefaultForProduct")).': '; $shelp = ''; if ($suggestedaccountingaccountbydefaultfor == 'eec') { $shelp .= $langs->trans("SaleEEC"); From 47451432a743abe22270c6d803f38b4673c8dfef Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Nov 2021 18:49:58 +0100 Subject: [PATCH 1442/1460] Fix warning --- htdocs/admin/defaultvalues.php | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/htdocs/admin/defaultvalues.php b/htdocs/admin/defaultvalues.php index 026a4315c83..9c80b1f7fa8 100644 --- a/htdocs/admin/defaultvalues.php +++ b/htdocs/admin/defaultvalues.php @@ -350,17 +350,15 @@ if (empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES)) { $disabled = ' disabled="disabled"'; } print ''; -print "
    '; - /*print ''; - print ''; - print ''; - print ''; - */ if ($action != 'edit' || GETPOST('rowid') != $defaultvalue->id) print dol_escape_htmltag($defaultvalue->value); else print ''; print '
    '.$contracttmp->getFormatedCustomerRef($obj->ref_customer).''.$contracttmp->getFormatedCustomerRef($obj->ref_customer).''.$obj->ref_supplier.''.dol_escape_htmltag($obj->ref_supplier).''; @@ -810,7 +811,7 @@ while ($i < min($num, $limit)) { print ''.$obj->email.''.dol_print_email($obj->email).''.$contracttmp->getFormatedCustomerRef($obj->ref_customer).''.$contracttmp->getFormatedCustomerRef($obj->ref_customer).''.dol_escape_htmltag($obj->ref_supplier).''.price($retainedWarranty).' 
    '; - print $langs->trans('AlreadyPaidBack'); - print ' :'.price($sign * $totalpaye).' 
    '.price($sign * $totalpaye).' 
    '.$langs->trans("Billed").' :'.price($sign * $object->total_ttc).' 
    '.$langs->trans("Billed").''.price($sign * $object->total_ttc).' 
    '; - print $langs->trans('RemainderToPayBack'); + print ''.$langs->trans('RemainderToPayBack'); if ($resteapayeraffiche > 0) { - print ' ('.$langs->trans('ExcessPaid').')'; + print ' ('.$langs->trans('NegativeIfExcessRefunded').')'; } - print ' :'.price($sign * $resteapayeraffiche).'