diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php
index 84c37a1cf4f..2d66661c839 100644
--- a/htdocs/core/class/html.formactions.class.php
+++ b/htdocs/core/class/html.formactions.class.php
@@ -1,7 +1,7 @@
* Copyright (C) 2010-2012 Regis Houssin
- * Copyright (C) 2010 Juanjo Menent
+ * Copyright (C) 2010-2018 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
@@ -194,9 +194,12 @@ class FormActions
$projectid = $object->fk_project;
if ($typeelement == 'project') $projectid = $object->id;
- $buttontoaddnewevent = '';
- $buttontoaddnewevent.= $langs->trans("AddEvent");
- $buttontoaddnewevent.= '';
+ if (! empty($conf->agenda->enabled))
+ {
+ $buttontoaddnewevent = '';
+ $buttontoaddnewevent.= $langs->trans("AddEvent");
+ $buttontoaddnewevent.= '';
+ }
print ''."\n";
print load_fiche_titre($title, $buttontoaddnewevent, '', 0, 0, '', $morehtmlright);
diff --git a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql
index 1e0388cff94..56659ea714c 100644
--- a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql
+++ b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql
@@ -242,7 +242,7 @@ UPDATE llx_bank_account SET accountancy_journal = 'OD' WHERE accountancy_journal
ALTER TABLE llx_bank_account ADD COLUMN fk_accountancy_journal integer;
ALTER TABLE llx_bank_account ADD INDEX idx_fk_accountancy_journal (fk_accountancy_journal);
-UPDATE llx_bank_account AS ba SET fk_accountancy_journal = (SELECT rowid FROM llx_accounting_journal AS aj WHERE ba.accountancy_journal = aj.code) WHERE accountancy_journal NOT IN ('1', '2', '3', '4', '5', '6', '5', '8', '9', '10', '11', '12', '13', '14', '15');
+UPDATE llx_bank_account AS ba SET fk_accountancy_journal = (SELECT rowid FROM llx_accounting_journal AS aj WHERE ba.accountancy_journal = aj.code AND aj.entity = ba.entity) WHERE accountancy_journal NOT IN ('1', '2', '3', '4', '5', '6', '5', '8', '9', '10', '11', '12', '13', '14', '15');
ALTER TABLE llx_bank_account ADD CONSTRAINT fk_bank_account_accountancy_journal FOREIGN KEY (fk_accountancy_journal) REFERENCES llx_accounting_journal (rowid);
--Update general ledger for FEC format & harmonization
diff --git a/htdocs/user/card.php b/htdocs/user/card.php
index ba327e7c9f1..e6ced69ea64 100644
--- a/htdocs/user/card.php
+++ b/htdocs/user/card.php
@@ -67,6 +67,9 @@ if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS))
$canreadgroup=(! empty($user->admin) || $user->rights->user->group_advance->read);
$caneditgroup=(! empty($user->admin) || $user->rights->user->group_advance->write);
}
+if(! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
+ $caneditgroup = ($conf->entity == 1) && ! empty($user->admin) && empty($user->entity);
+}
// Define value to know what current user can do on properties of edited user
if ($id)
{
@@ -1795,7 +1798,7 @@ else
}
else
{
- print '