Fix combo for multicompany not visible where there is other hooks by

other modules
This commit is contained in:
Laurent Destailleur
2017-07-31 18:16:41 +02:00
parent 9cf6c43f8a
commit 7d6d4adcdb
2 changed files with 7 additions and 8 deletions

View File

@@ -166,7 +166,7 @@ function dol_loginfunction($langs,$conf,$mysoc)
}
$conf_css = $themepath."?lang=".$langs->defaultlang;
// Select templates
// Select templates dir
if (! empty($conf->modules_parts['tpl'])) // Using this feature slow down application
{
$dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl/'));
@@ -205,6 +205,7 @@ function dol_loginfunction($langs,$conf,$mysoc)
// Should be an array with differents options in $hookmanager->resArray
$parameters=array('entity' => GETPOST('entity','int'));
$reshook = $hookmanager->executeHooks('getLoginPageOptions',$parameters); // Note that $action and $object may have been modified by some hooks. resArray is filled by hook.
$morelogincontent = $hookmanager->resArray['options']; // TODO Use here a resprints
// Login
$login = (! empty($hookmanager->resArray['username']) ? $hookmanager->resArray['username'] : (GETPOST("username","alpha") ? GETPOST("username","alpha") : $demologin));

View File

@@ -17,9 +17,7 @@
*/
// Need global variable $title to be defined by caller (like dol_loginfunction)
// Caller can also set $theResArray = array(['options']=>array('js'=>..., 'table'=>...);
// Caller can also set $morelogincontent = array(['options']=>array('js'=>..., 'table'=>...);
header('Cache-Control: Public, must-revalidate');
header("Content-type: text/html; charset=".$conf->file->character_set_client);
@@ -125,8 +123,8 @@ if ($disablenofollow) echo '</a>';
</span>
</td></tr>
<?php
if (! empty($hookmanager->resArray['options'])) {
foreach ($hookmanager->resArray['options'] as $format => $option)
if (! empty($morelogincontent) && is_array($morelogincontent)) {
foreach ($morelogincontent as $format => $option)
{
if ($format == 'table') {
echo '<!-- Option by hook -->';
@@ -280,8 +278,8 @@ if (!empty($conf->global->MAIN_EASTER_EGG_COMMITSTRIP)) {
<?php if (! empty($conf->global->MAIN_HTML_FOOTER)) print $conf->global->MAIN_HTML_FOOTER; ?>
<?php
if (! empty($hookmanager->resArray['options'])) {
foreach ($hookmanager->resArray['options'] as $format => $option)
if (! empty($morelogincontent) && is_array($morelogincontent)) {
foreach ($morelogincontent as $format => $option)
{
if ($format == 'js') {
echo "\n".'<!-- Javascript by hook -->';