diff --git a/.travis.yml b/.travis.yml index 9d0700d3a84..709feaeaa37 100644 --- a/.travis.yml +++ b/.travis.yml @@ -121,19 +121,31 @@ install: - | echo "Installing Composer dependencies - PHP Unit, Parallel Lint, PHP CodeSniffer - for $TRAVIS_PHP_VERSION" - if [ "$TRAVIS_PHP_VERSION" = '5.6' ] || [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] \ - [ "$TRAVIS_PHP_VERSION" = '7.2' ] || [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = '7.4' ]; then + if [ "$TRAVIS_PHP_VERSION" = '5.6' ]; then composer -n require phpunit/phpunit ^5 \ php-parallel-lint/php-parallel-lint ^1 \ php-parallel-lint/php-console-highlighter ^0 \ squizlabs/php_codesniffer ^3 fi + if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = '7.2' ]; then + composer -n require phpunit/phpunit ^6 \ + php-parallel-lint/php-parallel-lint ^1 \ + php-parallel-lint/php-console-highlighter ^0 \ + squizlabs/php_codesniffer ^3 + fi + if [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = '7.4' ]; then + composer -n require phpunit/phpunit ^7 \ + php-parallel-lint/php-parallel-lint ^1.2 \ + php-parallel-lint/php-console-highlighter ^0 \ + squizlabs/php_codesniffer ^3 + fi + # phpunit 9 is required for php 8 if [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then - composer -n require --ignore-platform-reqs phpunit/phpunit ^5 \ + composer -n require --ignore-platform-reqs phpunit/phpunit ^7 \ php-parallel-lint/php-parallel-lint ^1.2 \ php-parallel-lint/php-console-highlighter ^0 \ squizlabs/php_codesniffer ^3 - fi + fi echo - | @@ -165,15 +177,20 @@ before_script: - | echo "Versions information" + echo # Check PHP echo "PHP version" php -i | head - - # Check PHP CodeSniffer installation + # Check Parallel-lin version + echo "Parallel-lint version" + which parallel-lint + parallel-lint -V + # Check PHP CodeSniffer version echo "PHPCS version" which phpcs phpcs --version | head - phpcs -i | head - - # Check PHPUnit installation + # Check PHPUnit version echo "PHPUnit version" which phpunit phpunit --version | head - @@ -409,7 +426,7 @@ script: php step5.php 12.0.0 13.0.0 > $TRAVIS_BUILD_DIR/upgrade12001300-3.log # Enable modules not enabled into original dump - php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL,MAIN_MODULE_WEBSITE,MAIN_MODULE_TICKETSUP,MAIN_MODULE_ACCOUNTING > $TRAVIS_BUILD_DIR/enablemodule.log + php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL,MAIN_MODULE_WEBSITE,MAIN_MODULE_TICKET,MAIN_MODULE_ACCOUNTING,MAIN_MODULE_MRP > $TRAVIS_BUILD_DIR/enablemodule.log echo $? cd - set +e diff --git a/COPYRIGHT b/COPYRIGHT index d8cefedcd65..d43f4d506f1 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -21,6 +21,7 @@ Mobiledetect 2.8.34 MIT License Yes NuSoap 0.9.5 LGPL 2.1+ Yes Library to develop SOAP Web services (not into rpm and deb package) PEAR Mail_MIME 1.8.9 BSD Yes NuSoap dependency ParseDown 1.6 MIT License Yes Markdown parser +PCLZip 2.8.4 LGPL-3+ Yes Library to zip/unzip files PHPDebugBar 1.15.1 MIT License Yes Used only by the module "debugbar" for developers PHPExcel 1.8.1 LGPL-2.1+ Yes Read/Write XLS files, read ODS files PHPSpreadSheet ? LGPL-2.1+ Yes Read/Write XLS files, read ODS files diff --git a/ChangeLog b/ChangeLog index d8fdafeae95..516bc270321 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,30 +8,29 @@ For users: NEW: Add module "Credit transfer SEPA" to manage payment of vendors using bank credit transfer SEPA files. NEW: Module Reception (for a more accurate management of your receptions) moved from experimental to stable. NEW: Several security issues after a private bug bounty campaign. -NEW: #15065 Fix formatting NEW: #15065 Put the product label in bold in the PDF templates if configured NEW: Accountancy - Add chart of sub accounts NEW: Accountancy - Add options to disable binding on sales, purchases & expense reports independently of the modules -NEW: Accountancy balance - Add a input to show subtotal by group +NEW: Accountancy balance - Add a menu entry to show subtotal by group NEW: Accountancy - Move to real ledger, real journals, menu disposition NEW: Accountancy - On transfers, select the periodicity by default NEW: New currency rate editor. NEW: Add 2 rules for emailcollector: Message send/not sent from Dolibarr -NEW: Add a counter of number of words of pages in website module -NEW: add alert before change thirdparty in takepos -NEW: Add a page to list Stock at a given date. +NEW: Add a counter of number of words for pages in website module +NEW: add alert before changing thirdparty in takepos +NEW: Add a page to list Stock at a given date in the past. NEW: Add a start date to begin binding in accountancy -NEW: Add a stat page to list popularity of products on invoices +NEW: Add a statistics page to list popularity of products on invoices NEW: Add calendar selection for agenda view -NEW: add class for ticket edition (pdf or odt) +NEW: Support documents generation for ticket edition (pdf or odt) NEW: Add column payment term into list of supplier invoices. NEW: Add column quantity in product margin page NEW: Add column vat rate in page to define accounting account on product/service NEW: Add common list function for available app/module page NEW: add costprice in fields of products list -NEW: ADDED IMPORT TOOL FOR CUSTOMER ORDER, PO, PROPOSAL MODULE, SUPPLIER INVOICE -NEW: Added incoterms to substitution array -NEW: Add employee in expense report binding page +NEW: Added an import profile for CUSTOMER ORDER, PO, PROPOSAL MODULE, SUPPLIER INVOICE +NEW: Added incoterms dara into the substitution array +NEW: Add employee link in expense report binding page NEW: Add export for various payment NEW: add extra fields labels and values in mail on create ticket NEW: Add extrafields support on ECM module @@ -46,13 +45,14 @@ NEW: Add helper function for table headers with numbers NEW: add hooks on stats pages NEW: Add link to edit property from search result of website pages NEW: Add link to reset qty on supplier dispatch page -NEW: add MAIN_EMAILCOLLECTOR_MAIL_WITHOUT_HEADER const to remove header in email collector -NEW: Add Manufacturing Orders into the automatic ECM +NEW: add MAIN_EMAILCOLLECTOR_MAIL_WITHOUT_HEADER const to remove header stored by email collector +NEW: Add Manufacturing Orders attached files into the automatic ECM view NEW: add margin info in invoice list NEW: Add mass action to set category on a list of website pages. NEW: Add mass deletion for events +NEW: Add mass deletion for draft invoices NEW: Add __MEMBER_TYPE__ substitution key -NEW: Add message in error_log after detection of SQL or script injection +NEW: Add a message in error_log after detection of SQL or script injection NEW: Add module Credit transfer SEPA to manage payment of supplier using NEW: Add more filters on monthly statement list NEW: Add option TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT diff --git a/README-FR.md b/README-FR.md index bccb7b0143b..77bb5a3e27a 100644 --- a/README-FR.md +++ b/README-FR.md @@ -6,7 +6,7 @@ Dolibarr ERP & CRM est un logiciel moderne pour gérer votre activité (société, association, auto-entrepreneurs, artisans). Il est simple d'utilisation et modulaire, vous permettant de n'activez que les fonctions dont vous avez besoin (contacts, fournisseurs, factures, commandes, stocks, agenda, ...). -![ScreenShot](https://www.dolibarr.org/images/dolibarr_screenshot1_1920x1080.jpg) +![ScreenShot](https://www.dolibarr.org/medias/dolibarr_screenshot1_1920x1080.jpg) ## LICENCE diff --git a/README.md b/README.md index 919fc62ae5b..ac8f1d06382 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ You can use it as a standalone application or as a web application to access it Dolibarr has a large community ready to help you, free forums and [oficially preferred partners ready to offer commercial support should you need it](https://partners.dolibarr.org) -![ScreenShot](https://www.dolibarr.org/images/dolibarr_screenshot1_1920x1080.jpg) +![ScreenShot](https://www.dolibarr.org/medias/dolibarr_screenshot1_1920x1080.jpg) ## LICENSE diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index 3c0523ac877..e09f6ec14cf 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -610,7 +610,7 @@ if ($result) if (empty($defaultvalue)) $defaultvalue = $compta_prodbuy; $codesell = length_accountg($obj->accountancy_code_buy); if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid - print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1); + print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect'); print ''; } elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_INTRA') { // Accounting account buy intra (In EEC) @@ -620,7 +620,7 @@ if ($result) $codesell = length_accountg($obj->accountancy_code_buy_intra); //var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell); if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid - print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1); + print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect'); print ''; } elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_EXPORT') { // Accounting account buy export (Out of EEC) @@ -630,7 +630,7 @@ if ($result) $codesell = length_accountg($obj->accountancy_code_buy_export); //var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell); if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid - print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1); + print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect'); print ''; } elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL') { // Accounting account sell @@ -640,7 +640,7 @@ if ($result) $codesell = length_accountg($obj->accountancy_code_sell); //var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell); if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid - print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1); + print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect'); print ''; } elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA') { // Accounting account sell intra (In EEC) @@ -650,7 +650,7 @@ if ($result) $codesell = length_accountg($obj->accountancy_code_sell_intra); //var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell); if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid - print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1); + print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect'); print ''; } else { // Accounting account sell export (Out of EEC) @@ -659,13 +659,13 @@ if ($result) if (empty($defaultvalue)) $defaultvalue = $compta_prodsell; $codesell = length_accountg($obj->accountancy_code_sell_export); if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid - print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1); + print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect'); print ''; } // Checkbox select print ''; - print ''; + print ''; print ""; $i++; } @@ -689,7 +689,17 @@ if ($result) if (atleastoneselected) jQuery("#changeaccount").attr(\'class\',\'button\'); else jQuery("#changeaccount").attr(\'class\',\'button\'); } - jQuery(".checkforselect, #checkallactions").click(function() { + + jQuery(".checkforselect").change(function() { + init_savebutton(); + }); + jQuery(".productforselect").change(function() { + console.log($(this).attr("id")+" "+$(this).val()); + if ($(this).val() && $(this).val() != -1) { + $(".productforselect"+$(this).attr("id")).prop(\'checked\', true); + } else { + $(".productforselect"+$(this).attr("id")).prop(\'checked\', false); + } init_savebutton(); }); diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 096a0195668..bd3ad481cd8 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -191,6 +191,9 @@ if (empty($reshook)) { if ($result < 0) { $langs->load("errors"); setEventMessages($langs->trans($nuser->error), null, 'errors'); + } else { + setEventMessages($langs->trans("NewUserCreated", $nuser->login), null, 'mesgs'); + $action = ''; } } else { setEventMessages($object->error, $object->errors, 'errors'); @@ -1272,7 +1275,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Confirm create user if ($action == 'create_user') { - $login = $object->login; + $login = (GETPOSTISSET('login') ? GETPOST('login', 'alphanohtml') : $object->login); if (empty($login)) { // Full firstname and name separated with a dot : firstname.name include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; @@ -1701,13 +1704,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } } - // Delete - if ($user->rights->adherent->supprimer) { - print '
'.$langs->trans("Delete")."
\n"; - } else { - print '
'.$langs->trans("Delete")."
"; - } - // Action SPIP if (!empty($conf->mailmanspip->enabled) && !empty($conf->global->ADHERENT_USE_SPIP)) { $isinspip = $mailmanspip->is_in_spip($object); @@ -1719,6 +1715,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
'.$langs->trans("AddIntoSpip")."
\n"; } } + + // Delete + if ($user->rights->adherent->supprimer) { + print '
'.$langs->trans("Delete")."
\n"; + } else { + print '
'.$langs->trans("Delete")."
"; + } } } print ''; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 6a0eb273394..009c73cf318 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -74,17 +74,17 @@ class Adherent extends CommonObject public $login; /** - * @var Clear password in memory + * @var string Clear password in memory */ public $pass; /** - * @var Clear password in database (defined if DATABASE_PWD_ENCRYPTED=0) + * @var string Clear password in database (defined if DATABASE_PWD_ENCRYPTED=0) */ public $pass_indatabase; /** - * @var Encrypted password in database (always defined) + * @var string Encrypted password in database (always defined) */ public $pass_indatabase_crypted; @@ -2013,7 +2013,8 @@ class Adherent extends CommonObject } $label .= '
'; - $label .= ''.$langs->trans("Member").''; + $label .= img_picto('', $this->picto).' '.$langs->trans("Member").''; + $label .= ' '.$this->getLibStatut(4); if (!empty($this->ref)) $label .= '
'.$langs->trans('Ref').': '.$this->ref; if (!empty($this->firstname) || !empty($this->lastname)) $label .= '
'.$langs->trans('Name').': '.$this->getFullName($langs); if (!empty($this->company)) $label .= '
'.$langs->trans('Company').': '.$this->company; diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index e31d1e8fbc7..b5c701f2ad4 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -85,7 +85,6 @@ class AdherentType extends CommonObject /** * @var int Subsription required (0 or 1) - * @since 5.0 */ public $subscription; @@ -95,9 +94,15 @@ class AdherentType extends CommonObject /** @var integer Can vote */ public $vote; - /** @var string Email sent during validation */ + /** @var string Email sent during validation of member */ public $mail_valid; + /** @var string Email sent after recording a new subscription */ + public $mail_subscription = ''; + + /** @var string Email sent after resiliation */ + public $mail_resiliate = ''; + /** @var array Array of members */ public $members = array(); @@ -116,7 +121,7 @@ class AdherentType extends CommonObject } /** - * Load array this->multilangs + * Load array this->multilangs * * @return int <0 if KO, >0 if OK */ @@ -151,7 +156,7 @@ class AdherentType extends CommonObject } /** - * Update or add a translation for a product + * Update or add a translation for this member type * * @param User $user Object user making update * @return int <0 if KO, >0 if OK @@ -236,12 +241,11 @@ class AdherentType extends CommonObject } /** - * Delete a language for this product + * 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 + * @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) { @@ -268,9 +272,9 @@ class AdherentType extends CommonObject } /** - * Fonction qui permet de creer le status de l'adherent + * Function to create the member type * - * @param User $user User making creation + * @param User $user User making creation * @param int $notrigger 1=do not execute triggers, 0 otherwise * @return int >0 if OK, < 0 if KO */ @@ -574,7 +578,7 @@ class AdherentType extends CommonObject public function getmorphylib($morphy = '') { global $langs; - if ($morphy == 'phy') { return $langs->trans("Physical"); } elseif ($morphy == 'mor') { return $langs->trans("Moral"); } else return $langs->trans("MorPhy"); + if ($morphy == 'phy') { return $langs->trans("Physical"); } elseif ($morphy == 'mor') { return $langs->trans("Moral"); } else return $langs->trans("MorAndPhy"); //return $morphy; } @@ -591,7 +595,15 @@ class AdherentType extends CommonObject global $langs; $result = ''; - $label = $langs->trans("ShowTypeCard", $this->label); + + $label = ''; + + $label = img_picto('', $this->picto).' '.$langs->trans("MemberType").''; + $label .= ' '.$this->getLibStatut(4); + $label .= '
'.$langs->trans("Label").': '.$this->label; + if (isset($this->subscription)) { + $label .= '
'.$langs->trans("SubscriptionRequired").': '.yn($this->subscription); + } $linkstart = ''; $linkend = ''; @@ -741,4 +753,34 @@ class AdherentType extends CommonObject return ''; } + + /** + * getMailOnSubscription + * + * @return string Return mail content of type or empty + */ + public function getMailOnSubscription() + { + // mail_subscription not defined so never used + if (!empty($this->mail_subscription) && trim(dol_htmlentitiesbr_decode($this->mail_subscription))) { // Property not yet defined + return $this->mail_subscription; + } + + return ''; + } + + /** + * getMailOnResiliate + * + * @return string Return mail model content of type or empty + */ + public function getMailOnResiliate() + { + // NOTE mail_resiliate not defined so never used + if (!empty($this->mail_resiliate) && trim(dol_htmlentitiesbr_decode($this->mail_resiliate))) { // Property not yet defined + return $this->mail_resiliate; + } + + return ''; + } } diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index fc93f828f6c..35b0fcfb478 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -284,10 +284,10 @@ print '
'; */ $max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT; -$sql = "SELECT a.rowid, a.statut, a.lastname, a.firstname, a.societe as company, a.fk_soc,"; +$sql = "SELECT a.rowid, a.statut as status, a.lastname, a.firstname, a.societe as company, a.fk_soc,"; $sql .= " a.gender, a.email, a.photo, a.morphy,"; -$sql .= " a.tms as datem, datefin as date_end_subscription,"; -$sql .= " ta.rowid as typeid, ta.libelle as label, ta.subscription"; +$sql .= " a.tms as datem, a.datefin as date_end_subscription,"; +$sql .= " ta.rowid as typeid, ta.libelle as label, ta.subscription as need_subscription"; $sql .= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as ta"; $sql .= " WHERE a.entity IN (".getEntity('adherent').")"; $sql .= " AND a.fk_adherent_type = ta.rowid"; @@ -306,7 +306,7 @@ if ($resql) { $i = 0; while ($i < $num) { $obj = $db->fetch_object($resql); - print ''; + $staticmember->id = $obj->rowid; $staticmember->ref = $obj->rowid; $staticmember->lastname = $obj->lastname; @@ -315,6 +315,9 @@ if ($resql) { $staticmember->email = $obj->email; $staticmember->photo = $obj->photo; $staticmember->morphy = $obj->morphy; + $staticmember->statut = $obj->status; + $staticmember->need_subscription = $obj->need_subscription; + $staticmember->datefin = $db->jdate($obj->date_end_subscription); if (!empty($obj->fk_soc)) { $staticmember->fk_soc = $obj->fk_soc; $staticmember->fetch_thirdparty(); @@ -322,12 +325,16 @@ if ($resql) { } else { $staticmember->name = $obj->company; } + $statictype->id = $obj->typeid; $statictype->label = $obj->label; + $statictype->subscription = $obj->need_subscription; + + print ''; print ''.$staticmember->getNomUrl(-1, 32).''; print ''.$statictype->getNomUrl(1, 32).''; print ''.dol_print_date($db->jdate($obj->datem), 'dayhour').''; - print ''.$staticmember->LibStatut($obj->statut, ($obj->subscription == 'yes' ? 1 : 0), $db->jdate($obj->date_end_subscription), 3).''; + print ''.$staticmember->getLibStatut(3).''; print ''; $i++; } @@ -344,12 +351,14 @@ if ($resql) { */ $max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT; -$sql = "SELECT a.rowid, a.statut, a.lastname, a.firstname, a.societe as company, a.fk_soc,"; +$sql = "SELECT a.rowid, a.statut as status, a.lastname, a.firstname, a.societe as company, a.fk_soc,"; $sql .= " a.gender, a.email, a.photo, a.morphy,"; $sql .= " a.datefin as date_end_subscription,"; +$sql .= " ta.rowid as typeid, ta.libelle as label, ta.subscription as need_subscription,"; $sql .= " c.rowid as cid, c.tms as datem, c.datec as datec, c.dateadh as date_start, c.datef as date_end, c.subscription"; -$sql .= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."subscription as c"; +$sql .= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as ta, ".MAIN_DB_PREFIX."subscription as c"; $sql .= " WHERE a.entity IN (".getEntity('adherent').")"; +$sql .= " AND a.fk_adherent_type = ta.rowid"; $sql .= " AND c.fk_adherent = a.rowid"; $sql .= $db->order("c.tms", "DESC"); $sql .= $db->plimit($max, 0); @@ -366,9 +375,7 @@ if ($resql) { $i = 0; while ($i < $num) { $obj = $db->fetch_object($resql); - print ''; - $subscriptionstatic->id = $obj->cid; - $subscriptionstatic->ref = $obj->cid; + $staticmember->id = $obj->rowid; $staticmember->ref = $obj->rowid; $staticmember->lastname = $obj->lastname; @@ -377,6 +384,9 @@ if ($resql) { $staticmember->email = $obj->email; $staticmember->photo = $obj->photo; $staticmember->morphy = $obj->morphy; + $staticmember->statut = $obj->status; + $staticmember->need_subscription = $obj->need_subscription; + $staticmember->datefin = $db->jdate($obj->date_end_subscription); if (!empty($obj->fk_soc)) { $staticmember->fk_soc = $obj->fk_soc; $staticmember->fetch_thirdparty(); @@ -384,6 +394,11 @@ if ($resql) { } else { $staticmember->name = $obj->company; } + + $subscriptionstatic->id = $obj->cid; + $subscriptionstatic->ref = $obj->cid; + + print ''; print ''.$subscriptionstatic->getNomUrl(1).''; print ''.$staticmember->getNomUrl(-1, 32, 'subscription').''; print ''.get_date_range($db->jdate($obj->date_start), $db->jdate($obj->date_end)).''; diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php index 6479b5c479f..c97c502abaf 100644 --- a/htdocs/adherents/subscription/card.php +++ b/htdocs/adherents/subscription/card.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2020 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 @@ -40,10 +40,13 @@ $object = new Subscription($db); $errmsg = ''; $action = GETPOST("action", 'alpha'); -$rowid = GETPOST("rowid", "int") ?GETPOST("rowid", "int") : GETPOST("id", "int"); +$rowid = GETPOST("rowid", "int") ? GETPOST("rowid", "int") : GETPOST("id", "int"); $typeid = GETPOST("typeid", "int"); $cancel = GETPOST('cancel', 'alpha'); $confirm = GETPOST('confirm'); +$note = GETPOST('note', 'alpha'); +$typeid = (int) GETPOST('typeid', 'int'); +$amount = price2num(GETPOST('amount', 'alpha'), 'MT'); if (!$user->rights->adherent->cotisation->lire) accessforbidden(); @@ -84,7 +87,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'update' && !$cance } else { $accountline->datev = dol_mktime($_POST['datesubhour'], $_POST['datesubmin'], 0, $_POST['datesubmonth'], $_POST['datesubday'], $_POST['datesubyear']); $accountline->dateo = dol_mktime($_POST['datesubhour'], $_POST['datesubmin'], 0, $_POST['datesubmonth'], $_POST['datesubday'], $_POST['datesubyear']); - $accountline->amount = $_POST["amount"]; + $accountline->amount = $amount; $result = $accountline->update($user); if ($result < 0) { $errmsg = $accountline->error; @@ -96,9 +99,9 @@ if ($user->rights->adherent->cotisation->creer && $action == 'update' && !$cance // Modify values $object->dateh = dol_mktime($_POST['datesubhour'], $_POST['datesubmin'], 0, $_POST['datesubmonth'], $_POST['datesubday'], $_POST['datesubyear']); $object->datef = dol_mktime($_POST['datesubendhour'], $_POST['datesubendmin'], 0, $_POST['datesubendmonth'], $_POST['datesubendday'], $_POST['datesubendyear']); - $object->fk_type = $_POST["typeid"]; - $object->note = $_POST["note"]; - $object->amount = $_POST["amount"]; + $object->fk_type = $typeid; + $object->note = $note; + $object->amount = $amount; //print 'datef='.$object->datef.' '.$_POST['datesubendday']; $result = $object->update($user); @@ -216,18 +219,16 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit') { print ''; // Bank line - if (!empty($conf->banque->enabled)) { - if ($conf->global->ADHERENT_BANK_USE || $object->fk_bank) { - print ''.$langs->trans("BankTransactionLine").''; - if ($object->fk_bank) { - $bankline = new AccountLine($db); - $result = $bankline->fetch($object->fk_bank); - print $bankline->getNomUrl(1, 0, 'showall'); - } else { - print $langs->trans("NoneF"); - } - print ''; + if (!empty($conf->banque->enabled) && ($conf->global->ADHERENT_BANK_USE || $object->fk_bank)) { + print ''.$langs->trans("BankTransactionLine").''; + if ($object->fk_bank) { + $bankline = new AccountLine($db); + $result = $bankline->fetch($object->fk_bank); + print $bankline->getNomUrl(1, 0, 'showall'); + } else { + print $langs->trans("NoneF"); } + print ''; } print ''; @@ -316,18 +317,16 @@ if ($rowid && $action != 'edit') { print ''.$langs->trans("Label").''.$object->note.''; // Bank line - if (!empty($conf->banque->enabled)) { - if ($conf->global->ADHERENT_BANK_USE || $object->fk_bank) { - print ''.$langs->trans("BankTransactionLine").''; - if ($object->fk_bank) { - $bankline = new AccountLine($db); - $result = $bankline->fetch($object->fk_bank); - print $bankline->getNomUrl(1, 0, 'showall'); - } else { - print $langs->trans("NoneF"); - } - print ''; + if (!empty($conf->banque->enabled) && ($conf->global->ADHERENT_BANK_USE || $object->fk_bank)) { + print ''.$langs->trans("BankTransactionLine").''; + if ($object->fk_bank) { + $bankline = new AccountLine($db); + $result = $bankline->fetch($object->fk_bank); + print $bankline->getNomUrl(1, 0, 'showall'); + } else { + print $langs->trans("NoneF"); } + print ''; } print "\n"; diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index d1573f316f9..fc1d7ecb1d9 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -247,7 +247,7 @@ if (!$rowid && $action != 'create' && $action != 'edit') { print ''; print ''.$langs->trans("Ref").''; print ''.$langs->trans("Label").''; - print ''.$langs->trans("MemberNature").''; + print ''.$langs->trans("MembersNature").''; print ''.$langs->trans("SubscriptionRequired").''; print ''.$langs->trans("VoteAllowed").''; print ''.$langs->trans("Status").''; @@ -263,6 +263,7 @@ if (!$rowid && $action != 'create' && $action != 'edit') { $membertype->ref = $objp->rowid; $membertype->label = $objp->rowid; $membertype->status = $objp->status; + $membertype->subscription = $objp->subscription; print ''; print ''; @@ -271,7 +272,7 @@ if (!$rowid && $action != 'create' && $action != 'edit') { print ''; print ''.dol_escape_htmltag($objp->label).''; print ''; - if ($objp->morphy == 'phy') { print $langs->trans("Physical"); } elseif ($objp->morphy == 'mor') { print $langs->trans("Moral"); } else print $langs->trans("MorPhy"); + if ($objp->morphy == 'phy') { print $langs->trans("Physical"); } elseif ($objp->morphy == 'mor') { print $langs->trans("Moral"); } else print $langs->trans("MorAndPhy"); print ''; print ''.yn($objp->subscription).''; print ''.yn($objp->vote).''; @@ -321,10 +322,10 @@ if ($action == 'create') { // Morphy $morphys = array(); - $morphys[""] = $langs->trans("MorPhy"); - $morphys["phy"] = $langs->trans("Physical"); + $morphys[""] = $langs->trans("MorAndPhy"); + $morphys["phy"] = $langs->trans("Physical"); $morphys["mor"] = $langs->trans("Moral"); - print ''.$langs->trans("MemberNature").''; + print ''.$langs->trans("MembersNature").''; print $form->selectarray("morphy", $morphys, GETPOSTISSET("morphy") ? GETPOST("morphy", 'aZ09') : 'morphy'); print ""; @@ -343,12 +344,12 @@ if ($action == 'create') { print ''.$langs->trans("Description").''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('comment', $object->note, '', 280, 'dolibarr_notes', '', false, true, $conf->fckeditor->enabled, 15, '90%'); + $doleditor = new DolEditor('comment', $object->note, '', 200, 'dolibarr_notes', '', false, true, $conf->fckeditor->enabled, 15, '90%'); $doleditor->Create(); print ''.$langs->trans("WelcomeEMail").''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('mail_valid', $object->mail_valid, '', 280, 'dolibarr_notes', '', false, true, $conf->fckeditor->enabled, 15, '90%'); + $doleditor = new DolEditor('mail_valid', $object->mail_valid, '', 250, 'dolibarr_notes', '', false, true, $conf->fckeditor->enabled, 15, '90%'); $doleditor->Create(); print ''; @@ -401,7 +402,7 @@ if ($rowid > 0) { print ''; // Morphy - print ''; + print ''; print ''; print ''; if ($objp->company != '') { - print ''."\n"; + print ''."\n"; } else { - print ''."\n"; + print ''."\n"; } // Login @@ -640,9 +644,9 @@ if ($rowid > 0) { // EMail print "\n"; - // Statut + // Status print '"; // Date end subscription @@ -668,11 +672,10 @@ if ($rowid > 0) { // Actions print '"; @@ -723,11 +726,11 @@ if ($rowid > 0) { print ''; // Morphy - $morphys[""] = $langs->trans("MorPhy"); + $morphys[""] = $langs->trans("MorAndPhy"); $morphys["phy"] = $langs->trans("Physical"); $morphys["mor"] = $langs->trans("Moral"); - print '"; print ''; } elseif ($value == 'type_template') { print ''; } elseif (!in_array($value, array('content', 'content_lines'))) { print ''; @@ -1033,7 +1075,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') print ''; print $obj->{$fieldlist[$field]}; } else { - print $form->selectarray('type_template', $elementList, (!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:''), 1, 0, 0, '', 0, 0, 0, '', 'maxwidth150', 1, '', 0, 1); + print $form->selectarray('type_template', $elementList, (!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:''), 1, 0, 0, '', 0, 0, 0, '', 'maxwidth200', 1, '', 0, 1); } print ''; } elseif ($context == 'add' && in_array($fieldlist[$field], array('topic', 'joinfiles', 'content', 'content_lines'))) continue; diff --git a/htdocs/admin/security_file.php b/htdocs/admin/security_file.php index fc2c4e141d5..2669e741c6e 100644 --- a/htdocs/admin/security_file.php +++ b/htdocs/admin/security_file.php @@ -153,7 +153,7 @@ 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 ''; +print ''; if (defined('MAIN_ANTIVIRUS_COMMAND')) { print '
'.$langs->trans("ValueIsForcedBySystem").''; } diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index c5a6bc79421..6fc37f45734 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -668,8 +668,8 @@ print load_fiche_titre($langs->trans("Other"), '', ''); print '
'.$langs->trans("MemberNature").''.$object->getmorphylib($object->morphy).'
'.$langs->trans("MembersNature").''.$object->getmorphylib($object->morphy).'
'.$langs->trans("SubscriptionRequired").''; @@ -614,13 +615,16 @@ if ($rowid > 0) { $adh = new Adherent($db); $adh->lastname = $objp->lastname; $adh->firstname = $objp->firstname; + $adh->datefin = $datefin; + $adh->need_subscription = $objp->subscription; + $adh->statut = $objp->status; // Lastname print '
'.img_object($langs->trans("ShowMember"), "user").' '.$adh->getFullName($langs, 0, -1, 20).' / '.dol_trunc($objp->societe, 12).''.img_object($langs->trans("ShowMember"), "user", 'class="paddingright"').$adh->getFullName($langs, 0, -1, 20).' / '.dol_trunc($objp->company, 12).''.img_object($langs->trans("ShowMember"), "user").' '.$adh->getFullName($langs, 0, -1, 32).''.img_object($langs->trans("ShowMember"), "user", 'class="paddingright"').$adh->getFullName($langs, 0, -1, 32).'".dol_print_email($objp->email, 0, 0, 1)."'; - print $adh->LibStatut($objp->status, $objp->subscription, $datefin, 2); + print $adh->getLibStatut(2); print "'; if ($user->rights->adherent->creer) { - print ''.img_edit().''; + print ''.img_edit().''; } - print ' '; if ($user->rights->adherent->supprimer) { - print ''.img_picto($langs->trans("Resiliate"), 'disable.png').''; + print ''.img_picto($langs->trans("Resiliate"), 'disable.png').''; } print "
'.$langs->trans("MemberNature").''; - print $form->selectarray("morphy", $morphys, GETPOSTISSET("morphy") ? GETPOST("morphy") : $object->morphy); + print '
'.$langs->trans("MembersNature").''; + print $form->selectarray("morphy", $morphys, GETPOSTISSET("morphy") ? GETPOST("morphy", 'aZ09') : $object->morphy); print "
'.$langs->trans("SubscriptionRequired").''; diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index c7a86766a32..f63af39e985 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -11,7 +11,7 @@ * Copyright (C) 2011-2016 Alexandre Spangaro * Copyright (C) 2015 Ferran Marcet * Copyright (C) 2016 Raphaël Doursenaud - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2020 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 @@ -139,7 +139,15 @@ if (empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) $tabhelp = array(); -$tabhelp[25] = array('topic'=>$helpsubstit, 'joinfiles'=>$langs->trans('AttachMainDocByDefault'), 'content'=>$helpsubstit, 'content_lines'=>$helpsubstitforlines, 'type_template'=>$langs->trans("TemplateForElement"), 'private'=>$langs->trans("TemplateIsVisibleByOwnerOnly"), 'position'=>$langs->trans("PositionIntoComboList")); +$tabhelp[25] = array( + 'topic'=>$helpsubstit, + 'joinfiles'=>$langs->trans('AttachMainDocByDefault'), + 'content'=>$helpsubstit, + 'content_lines'=>$helpsubstitforlines, + 'type_template'=>$langs->trans("TemplateForElement"), + 'private'=>$langs->trans("TemplateIsVisibleByOwnerOnly"), + 'position'=>$langs->trans("PositionIntoComboList") +); // List of check for fields (NOT USED YET) $tabfieldcheck = array(); @@ -154,22 +162,54 @@ $elementList = array(); $elementList['all'] = '-- '.dol_escape_htmltag($langs->trans("All")).' --'; $elementList['none'] = '-- '.dol_escape_htmltag($langs->trans("None")).' --'; $elementList['user'] = img_picto('', 'user', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToUser')); -if ($conf->adherent->enabled && $user->rights->adherent->lire) $elementList['member'] = img_picto('', 'object_member', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToMember')); -if ($conf->recruitment->enabled && $user->rights->recruitment->recruitmentjobposition->read) $elementList['recruitmentcandidature_send'] = img_picto('', 'recruitmentcandidature', 'class="paddingright"').dol_escape_htmltag($langs->trans('RecruitmentCandidatures')); -if ($conf->societe->enabled && $user->rights->societe->lire) $elementList['thirdparty'] = img_picto('', 'company', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToThirdparty')); -if ($conf->projet->enabled) $elementList['project'] = img_picto('', 'project', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToProject')); -if ($conf->propal->enabled && $user->rights->propal->lire) $elementList['propal_send'] = dol_escape_htmltag($langs->trans('MailToSendProposal')); -if ($conf->commande->enabled && $user->rights->commande->lire) $elementList['order_send'] = dol_escape_htmltag($langs->trans('MailToSendOrder')); -if ($conf->facture->enabled && $user->rights->facture->lire) $elementList['facture_send'] = dol_escape_htmltag($langs->trans('MailToSendInvoice')); -if ($conf->expedition->enabled) $elementList['shipping_send'] = dol_escape_htmltag($langs->trans('MailToSendShipment')); -if ($conf->reception->enabled) $elementList['reception_send'] = dol_escape_htmltag($langs->trans('MailToSendReception')); -if ($conf->ficheinter->enabled) $elementList['fichinter_send'] = dol_escape_htmltag($langs->trans('MailToSendIntervention')); -if ($conf->supplier_proposal->enabled) $elementList['supplier_proposal_send'] = dol_escape_htmltag($langs->trans('MailToSendSupplierRequestForQuotation')); -if (($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || ($conf->supplier_order->enabled && $user->rights->supplier_order->lire)) $elementList['order_supplier_send'] = dol_escape_htmltag($langs->trans('MailToSendSupplierOrder')); -if (($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || ($conf->supplier_invoice->enabled && $user->rights->supplier_invoice->lire)) $elementList['invoice_supplier_send'] = dol_escape_htmltag($langs->trans('MailToSendSupplierInvoice')); -if ($conf->contrat->enabled && $user->rights->contrat->lire) $elementList['contract'] = img_picto('', 'contract', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendContract')); -if ($conf->ticket->enabled && $user->rights->ticket->read) $elementList['ticket_send'] = img_picto('', 'ticket', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToTicket')); -if ($conf->agenda->enabled) $elementList['actioncomm_send'] = img_picto('', 'action', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendEventPush')); +if ($conf->adherent->enabled && $user->rights->adherent->lire) { + $elementList['member'] = img_picto('', 'object_member', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToMember')); +} +if ($conf->recruitment->enabled && $user->rights->recruitment->recruitmentjobposition->read) { + $elementList['recruitmentcandidature_send'] = img_picto('', 'recruitmentcandidature', 'class="paddingright"').dol_escape_htmltag($langs->trans('RecruitmentCandidatures')); +} +if ($conf->societe->enabled && $user->rights->societe->lire) { + $elementList['thirdparty'] = img_picto('', 'company', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToThirdparty')); +} +if ($conf->projet->enabled) { + $elementList['project'] = img_picto('', 'project', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToProject')); +} +if ($conf->propal->enabled && $user->rights->propal->lire) { + $elementList['propal_send'] = img_picto('', 'propal', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendProposal')); +} +if ($conf->commande->enabled && $user->rights->commande->lire) { + $elementList['order_send'] = img_picto('', 'order', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendOrder')); +} +if ($conf->facture->enabled && $user->rights->facture->lire) { + $elementList['facture_send'] = img_picto('', 'bill', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendInvoice')); +} +if ($conf->expedition->enabled) { + $elementList['shipping_send'] = img_picto('', 'dolly', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendShipment')); +} +if ($conf->reception->enabled) { + $elementList['reception_send'] = img_picto('', 'dolly', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendReception')); +} +if ($conf->ficheinter->enabled) { + $elementList['fichinter_send'] = img_picto('', 'intervention', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendIntervention')); +} +if ($conf->supplier_proposal->enabled) { + $elementList['supplier_proposal_send'] = img_picto('', 'propal', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendSupplierRequestForQuotation')); +} +if (($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || ($conf->supplier_order->enabled && $user->rights->supplier_order->lire)) { + $elementList['order_supplier_send'] = img_picto('', 'order', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendSupplierOrder')); +} +if (($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || ($conf->supplier_invoice->enabled && $user->rights->supplier_invoice->lire)) { + $elementList['invoice_supplier_send'] = img_picto('', 'bill', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendSupplierInvoice')); +} +if ($conf->contrat->enabled && $user->rights->contrat->lire) { + $elementList['contract'] = img_picto('', 'contract', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendContract')); +} +if ($conf->ticket->enabled && $user->rights->ticket->read) { + $elementList['ticket_send'] = img_picto('', 'ticket', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToTicket')); +} +if ($conf->agenda->enabled) { + $elementList['actioncomm_send'] = img_picto('', 'action', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendEventPush')); +} $parameters = array('elementList'=>$elementList); $reshook = $hookmanager->executeHooks('emailElementlist', $parameters); // Note that $action and $object may have been modified by some hooks @@ -188,18 +228,22 @@ $id = 25; * Actions */ -if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; } +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 ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} -if (empty($reshook)) -{ +if (empty($reshook)) { // 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 - { + 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_label = ''; $search_type_template = ''; $search_lang = ''; @@ -210,8 +254,7 @@ if (empty($reshook)) } // Actions add or modify an entry into a dictionary - if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) - { + if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) { $listfield = explode(',', str_replace(' ', '', $tabfield[$id])); $listfieldinsert = explode(',', $tabfieldinsert[$id]); $listfieldmodify = explode(',', $tabfieldinsert[$id]); @@ -219,8 +262,7 @@ if (empty($reshook)) // Check that all fields are filled $ok = 1; - foreach ($listfield as $f => $value) - { + foreach ($listfield as $f => $value) { // Not mandatory fields if ($value == 'joinfiles') continue; if ($value == 'content') continue; @@ -662,7 +704,7 @@ if ($resql) print ''; - print $form->selectarray('search_type_template', $elementList, $search_type_template, 1, 0, 0, '', 0, 0, 0, '', 'maxwidth150', 1, '', 0, 1); + print $form->selectarray('search_type_template', $elementList, $search_type_template, 1, 0, 0, '', 0, 0, 0, '', 'maxwidth200', 1, '', 0, 1); print '
'; print ''; -print "\n"; -print ''."\n"; +print "\n"; +print ''."\n"; print ''."\n"; print ''; diff --git a/htdocs/admin/system/about.php b/htdocs/admin/system/about.php index 460e568501b..0668e4612ae 100644 --- a/htdocs/admin/system/about.php +++ b/htdocs/admin/system/about.php @@ -83,6 +83,7 @@ print '
  • '; print ''.$langs->trans("OfficialWebSite").''; print '
  • '; // Show local site +/* if (preg_match('/^fr_/i', $langs->getDefaultLang())) { print '
  • '; @@ -112,7 +113,7 @@ if (preg_match('/^de_/i', $langs->getDefaultLang())) print '
  • '; print ''.$langs->trans("OfficialWebSiteLocal", $langs->transnoentitiesnoconv("Germany")).''; print '
  • '; -} +}*/ print '
  • '; print ''.$langs->trans("OfficialWiki").''; print '
  • '; @@ -168,7 +169,7 @@ print $langs->trans("OtherResources").':'; print '
      '; $url = 'https://saas.dolibarr.org'; $title = $langs->trans("OfficialWebHostingService"); -if (preg_match('/^fr_/i', $langs->getDefaultLang())) $url = 'https://wiki.dolibarr.org/index.php/Solutions_de_Cloud'; +if (preg_match('/^fr_/i', $langs->getDefaultLang())) $url = 'https://wiki.dolibarr.org/index.php/Solutions_Cloud_pour_Dolibarr_ERP_CRM'; if (preg_match('/^es_/i', $langs->getDefaultLang())) $url = 'https://wiki.dolibarr.org/index.php/Soluciones_en_la_Nube'; print '
    • '; print ''.$title.''; diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index 24a3f2ca55f..6bae9666ee9 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -50,7 +50,11 @@ if ($action == 'getlastversion') { $result = getURLContent('https://sourceforge.net/projects/dolibarr/rss'); //var_dump($result['content']); - $sfurl = simplexml_load_string($result['content']); + if (function_exists('simplexml_load_string')) { + $sfurl = simplexml_load_string($result['content']); + } else { + setEventMessages($langs->trans("ErrorPHPDoesNotSupport", "xml"), null, 'errors'); + } } diff --git a/htdocs/admin/system/perf.php b/htdocs/admin/system/perf.php index 80c4556c35a..6d9e3574789 100644 --- a/htdocs/admin/system/perf.php +++ b/htdocs/admin/system/perf.php @@ -62,7 +62,7 @@ print "
      Web server - ".$langs->trans("Version").": ".$_SERVE print '
      '; print ''.$langs->trans("XDebug").': '; $test = !function_exists('xdebug_is_enabled'); -if ($test) print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled"); +if ($test) print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' - '.$langs->trans("NotSlowedDownByThis"); else { print img_picto('', 'warning').' '.$langs->trans("ModuleActivated", $langs->transnoentities("XDebug")); print ' - '.$langs->trans("MoreInformation").' XDebug admin page'; @@ -73,7 +73,7 @@ print '
      '; print '
      '; print ''.$langs->trans("Syslog").': '; $test = empty($conf->syslog->enabled); -if ($test) print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled"); +if ($test) print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' - '.$langs->trans("NotSlowedDownByThis"); else { print img_picto('', 'warning').' '.$langs->trans("ModuleActivated", $langs->transnoentities("Syslog")); //print ' '.$langs->trans("MoreInformation").' XDebug admin page'; @@ -84,7 +84,7 @@ print '
      '; print '
      '; print ''.$langs->trans("DebugBar").': '; $test = empty($conf->debugbar->enabled); -if ($test) print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled"); +if ($test) print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' - '.$langs->trans("NotSlowedDownByThis"); else { print img_picto('', 'warning').' '.$langs->trans("ModuleActivated", $langs->transnoentities("DebugBar")); //print ' '.$langs->trans("MoreInformation").' XDebug admin page'; diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index cb708090386..a959aee2e54 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -66,32 +66,40 @@ print "PHP safe_mode = ".(ini_get('safe_mode') ? ini_get('safe_ print "PHP open_basedir = ".(ini_get('open_basedir') ? ini_get('open_basedir') : yn(0))."
      \n"; print '
      '; +print '
      '; print load_fiche_titre($langs->trans("ConfigFile"), '', ''); print ''.$langs->trans("dolibarr_main_prod").': '.$dolibarr_main_prod; +if (empty($dolibarr_main_prod)) { + print img_picto('', 'warning').'   '.$langs->trans("IfYouAreOnAProductionSetThis"); +} // dolibarr_main_prod +print '
      '; print '
      '; print '
      '; +print load_fiche_titre($langs->trans("Permissions"), '', ''); -print load_fiche_titre($langs->trans("PermissionsOnFiles"), '', ''); - -print ''.$langs->trans("PermissionOnFileInWebRoot").': '; -// TODO +print ''.$langs->trans("PermissionsOnFilesInWebRoot").': '; +// TODO Check permission are read only except for custom dir print 'TODO'; - - -print '
      '; print '
      '; +print ''.$langs->trans("PermissionsOnFile", 'conf.php').': '; +// TODO Check permission on file conf.php (read only for the web user) +print 'TODO'; +print '
      '; +print '
      '; + +print '
      '; print load_fiche_titre($langs->trans("Modules"), '', ''); // XDebug print ''.$langs->trans("XDebug").': '; $test = !function_exists('xdebug_is_enabled'); -if ($test) print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled"); +if ($test) print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' - '.$langs->trans("NotRiskOfLeakWithThis"); else { print img_picto('', 'warning').' '.$langs->trans("ModuleActivatedMayExposeInformation", $langs->transnoentities("XDebug")); print ' - '.$langs->trans("MoreInformation").' XDebug admin page'; @@ -102,7 +110,7 @@ print '
      '; print '
      '; print ''.$langs->trans("Syslog").': '; $test = empty($conf->syslog->enabled); -if ($test) print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled"); +if ($test) print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' - '.$langs->trans("NotRiskOfLeakWithThis"); else { print img_picto('', 'warning').' '.$langs->trans("ModuleActivatedMayExposeInformation", $langs->transnoentities("Syslog")); //print ' '.$langs->trans("MoreInformation").' XDebug admin page'; @@ -113,14 +121,15 @@ print '
      '; print '
      '; print ''.$langs->trans("DebugBar").': '; $test = empty($conf->debugbar->enabled); -if ($test) print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled"); +if ($test) print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' - '.$langs->trans("NotRiskOfLeakWithThis"); else { print img_picto('', 'error').' '.$langs->trans("ModuleActivatedDoNotUseInProduction", $langs->transnoentities("DebugBar")); //print ' '.$langs->trans("MoreInformation").' XDebug admin page'; } print '
      '; -print '
      '; +print '
      '; +print '
      '; print load_fiche_titre($langs->trans("SecuritySetup"), '', ''); //print ''.$langs->trans("PasswordEncryption").': '; @@ -130,7 +139,13 @@ print '
      '; // TODO print ''.$langs->trans("AntivirusEnabledOnUpload").': '; -// TODO +print yn($conf->global->MAIN_ANTIVIRUS_COMMAND ? 1 : 0); +if (!empty($conf->global->MAIN_ANTIVIRUS_COMMAND)) { + print '   - '.$conf->global->MAIN_ANTIVIRUS_COMMAND; + if (defined('MAIN_ANTIVIRUS_COMMAND')) { + print ' - '.$langs->trans("ValueIsForcedBySystem").''; + } +} print '
      '; print '
      '; diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 4306bc728d6..8c1eccfa846 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -278,13 +278,13 @@ print "
      \n"; if ($user->rights->categorie->creer) { - $socid = ($object->socid ? "&socid=".$object->socid : ""); - print "".$langs->trans("Modify").""; + $socid = ($object->socid ? "&socid=".$object->socid : ""); + print ''.$langs->trans("Modify").''; } if ($user->rights->categorie->supprimer) { - print "".$langs->trans("Delete").""; + print 'id.'&type='.$type.'">'.$langs->trans("Delete").''; } print "
      "; diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index b305858bd93..8ce38ba4ea3 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -137,10 +137,10 @@ if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { * Draft customer proposals */ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) { - $sql = "SELECT p.rowid, p.ref, p.ref_client, p.total_ht, p.tva as total_tva, p.total as total_ttc"; - $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"; + $sql = "SELECT p.rowid, p.ref, p.ref_client, p.total_ht, p.tva as total_tva, p.total as total_ttc, p.fk_statut as status,"; + $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) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql .= " WHERE p.entity IN (".getEntity($propalstatic->element).")"; $sql .= " AND p.fk_soc = s.rowid"; @@ -167,6 +167,7 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) { $propalstatic->total_ht = $obj->total_ht; $propalstatic->total_tva = $obj->total_tva; $propalstatic->total_ttc = $obj->total_ttc; + $propalstatic->statut = $obj->status; $companystatic->id = $obj->socid; $companystatic->name = $obj->name; @@ -203,10 +204,10 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) { * Draft supplier proposals */ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire) { - $sql = "SELECT p.rowid, p.ref, p.total_ht, p.tva as total_tva, p.total as total_ttc"; - $sql .= ", s.rowid as socid, s.nom as name, s.client, s.canvas, s.code_client, s.code_fournisseur, s.entity, s.email"; - $sql .= " FROM ".MAIN_DB_PREFIX."supplier_proposal as p"; - $sql .= ", ".MAIN_DB_PREFIX."societe as s"; + $sql = "SELECT p.rowid, p.ref, p.total_ht, p.tva as total_tva, p.total as total_ttc, p.fk_statut as status,"; + $sql .= " s.rowid as socid, s.nom as name, s.client, s.canvas, s.code_client, s.code_fournisseur, s.entity, s.email"; + $sql .= " FROM ".MAIN_DB_PREFIX."supplier_proposal as p,"; + $sql .= " ".MAIN_DB_PREFIX."societe as s"; if (!$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; @@ -232,6 +233,7 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa $supplierproposalstatic->total_ht = $obj->total_ht; $supplierproposalstatic->total_tva = $obj->total_tva; $supplierproposalstatic->total_ttc = $obj->total_ttc; + $supplierproposalstatic->statut = $obj->status; $companystatic->id = $obj->socid; $companystatic->name = $obj->name; @@ -267,10 +269,10 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa * Draft customer orders */ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { - $sql = "SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.tva as total_tva, c.total_ttc"; - $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."commande as c"; - $sql .= ", ".MAIN_DB_PREFIX."societe as s"; + $sql = "SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.tva as total_tva, c.total_ttc, c.fk_statut as status,"; + $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."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"; $sql .= " WHERE c.entity IN (".getEntity($orderstatic->element).")"; $sql .= " AND c.fk_statut = ".Commande::STATUS_DRAFT; @@ -297,6 +299,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { $orderstatic->total_ht = $obj->total_ht; $orderstatic->total_tva = $obj->total_tva; $orderstatic->total_ttc = $obj->total_ttc; + $orderstatic->statut = $obj->status; $companystatic->id = $obj->socid; $companystatic->name = $obj->name; @@ -329,13 +332,13 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { /* - * Draft suppliers orders + * Draft purchase orders */ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire) { - $sql = "SELECT cf.rowid, cf.ref, cf.ref_supplier, cf.total_ttc"; - $sql .= ", s.rowid as socid, s.nom as name, s.client, s.canvas, s.code_client, s.code_fournisseur, s.entity, s.email"; - $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as cf"; - $sql .= ", ".MAIN_DB_PREFIX."societe as s"; + $sql = "SELECT cf.rowid, cf.ref, cf.ref_supplier, cf.total_ttc, cf.fk_statut as status,"; + $sql .= " s.rowid as socid, s.nom as name, s.client, s.canvas, s.code_client, s.code_fournisseur, s.entity, s.email"; + $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as cf,"; + $sql .= " ".MAIN_DB_PREFIX."societe as s"; if (!$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; @@ -362,6 +365,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU $supplierorderstatic->total_ht = $obj->total_ht; $supplierorderstatic->total_tva = $obj->total_tva; $supplierorderstatic->total_ttc = $obj->total_ttc; + $supplierorderstatic->statut = $obj->status; $companystatic->id = $obj->socid; $companystatic->name = $obj->name; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 904f33cb1eb..9977910518b 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1511,11 +1511,12 @@ if ($action == 'create') print '
    ".$langs->trans("Other")."'.$langs->trans("Status").'".$langs->trans("Parameter")."'.$langs->trans("Value").'
    '; print $form->select_company('', 'socid', '(s.client = 1 OR s.client = 2 OR s.client = 3) AND status=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300 maxwidth500'); // reload page to retrieve customer informations - if (!empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE)) + if (empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE_DISABLED)) { print '