Fix: compatibility between bureau2crea theme and multicompany module

This commit is contained in:
Regis Houssin 2012-09-02 11:36:42 +02:00
parent 63564f8d50
commit ac5e201829
6 changed files with 110 additions and 25 deletions

View File

@ -34,6 +34,23 @@ print '<head>
print '<!-- Includes for JQuery (Ajax library) -->'."\n"; print '<!-- Includes for JQuery (Ajax library) -->'."\n";
if (constant('JS_JQUERY_UI')) print '<link rel="stylesheet" type="text/css" href="'.JS_JQUERY_UI.'css/'.$jquerytheme.'/jquery-ui.min.css" />'."\n"; // JQuery if (constant('JS_JQUERY_UI')) print '<link rel="stylesheet" type="text/css" href="'.JS_JQUERY_UI.'css/'.$jquerytheme.'/jquery-ui.min.css" />'."\n"; // JQuery
else print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui-latest.custom.css" />'."\n"; // JQuery else print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui-latest.custom.css" />'."\n"; // JQuery
// CSS forced by modules (relative url starting with /)
if (isset($conf->modules_parts['css']))
{
$arraycss=(array) $conf->modules_parts['css'];
foreach($arraycss as $modcss => $filescss)
{
$filescss=(array) $filescss; // To be sure filecss is an array
foreach($filescss as $cssfile)
{
// cssfile is a relative path
print '<link rel="stylesheet" type="text/css" title="default" href="'.dol_buildpath($cssfile,1);
// We add params only if page is not static, because some web server setup does not return content type text/css if url has parameters, so browser cache is not used.
if (!preg_match('/\.css$/i',$cssfile)) print $themeparam;
print '"><!-- Added by module '.$modcss. '-->'."\n";
}
}
}
// JQuery. Must be before other includes // JQuery. Must be before other includes
$ext='.js'; $ext='.js';
if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x01)) $ext='.jgz'; if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x01)) $ext='.jgz';
@ -98,10 +115,12 @@ $(document).ready(function () {
<?php <?php
if (! empty($hookmanager->resArray['options'])) { if (! empty($hookmanager->resArray['options'])) {
foreach ($hookmanager->resArray['options'] as $option) foreach ($hookmanager->resArray['options'] as $format => $option)
{ {
echo '<!-- Option by hook -->'; if ($format == 'table') {
echo $option; echo '<!-- Option by hook -->';
echo $option;
}
} }
} }
?> ?>

View File

@ -34,6 +34,23 @@ print '<head>
print '<!-- Includes for JQuery (Ajax library) -->'."\n"; print '<!-- Includes for JQuery (Ajax library) -->'."\n";
if (constant('JS_JQUERY_UI')) print '<link rel="stylesheet" type="text/css" href="'.JS_JQUERY_UI.'css/'.$jquerytheme.'/jquery-ui.min.css" />'."\n"; // JQuery if (constant('JS_JQUERY_UI')) print '<link rel="stylesheet" type="text/css" href="'.JS_JQUERY_UI.'css/'.$jquerytheme.'/jquery-ui.min.css" />'."\n"; // JQuery
else print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui-latest.custom.css" />'."\n"; // JQuery else print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui-latest.custom.css" />'."\n"; // JQuery
// CSS forced by modules (relative url starting with /)
if (isset($conf->modules_parts['css']))
{
$arraycss=(array) $conf->modules_parts['css'];
foreach($arraycss as $modcss => $filescss)
{
$filescss=(array) $filescss; // To be sure filecss is an array
foreach($filescss as $cssfile)
{
// cssfile is a relative path
print '<link rel="stylesheet" type="text/css" title="default" href="'.dol_buildpath($cssfile,1);
// We add params only if page is not static, because some web server setup does not return content type text/css if url has parameters, so browser cache is not used.
if (!preg_match('/\.css$/i',$cssfile)) print $themeparam;
print '"><!-- Added by module '.$modcss. '-->'."\n";
}
}
}
// JQuery. Must be before other includes // JQuery. Must be before other includes
$ext='.js'; $ext='.js';
if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x01)) $ext='.jgz'; if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x01)) $ext='.jgz';
@ -72,10 +89,12 @@ print '<!-- HTTP_USER_AGENT = '.$_SERVER['HTTP_USER_AGENT'].' -->
<?php <?php
if (! empty($hookmanager->resArray['options'])) { if (! empty($hookmanager->resArray['options'])) {
foreach ($hookmanager->resArray['options'] as $option) foreach ($hookmanager->resArray['options'] as $format => $option)
{ {
echo '<!-- Option by hook -->'; if ($format == 'table') {
echo $option; echo '<!-- Option by hook -->';
echo $option;
}
} }
} }
?> ?>

View File

@ -35,6 +35,7 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1);
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1); if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
session_cache_limiter(FALSE);
require_once '../../main.inc.php'; require_once '../../main.inc.php';

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2009-2010 Regis Houssin <regis@dolibarr.fr> /* Copyright (C) 2009-2012 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -33,6 +33,23 @@ print '<head>
print '<!-- Includes for JQuery (Ajax library) -->'."\n"; print '<!-- Includes for JQuery (Ajax library) -->'."\n";
if (constant('JS_JQUERY_UI')) print '<link rel="stylesheet" type="text/css" href="'.JS_JQUERY_UI.'css/'.$jquerytheme.'/jquery-ui.min.css" />'."\n"; // JQuery if (constant('JS_JQUERY_UI')) print '<link rel="stylesheet" type="text/css" href="'.JS_JQUERY_UI.'css/'.$jquerytheme.'/jquery-ui.min.css" />'."\n"; // JQuery
else print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui-latest.custom.css" />'."\n"; // JQuery else print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui-latest.custom.css" />'."\n"; // JQuery
// CSS forced by modules (relative url starting with /)
if (isset($conf->modules_parts['css']))
{
$arraycss=(array) $conf->modules_parts['css'];
foreach($arraycss as $modcss => $filescss)
{
$filescss=(array) $filescss; // To be sure filecss is an array
foreach($filescss as $cssfile)
{
// cssfile is a relative path
print '<link rel="stylesheet" type="text/css" title="default" href="'.dol_buildpath($cssfile,1);
// We add params only if page is not static, because some web server setup does not return content type text/css if url has parameters, so browser cache is not used.
if (!preg_match('/\.css$/i',$cssfile)) print $themeparam;
print '"><!-- Added by module '.$modcss. '-->'."\n";
}
}
}
// JQuery. Must be before other includes // JQuery. Must be before other includes
$ext='.js'; $ext='.js';
if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x01)) $ext='.jgz'; if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x01)) $ext='.jgz';
@ -97,10 +114,12 @@ $(document).ready(function () {
<?php <?php
if (! empty($hookmanager->resArray['options'])) { if (! empty($hookmanager->resArray['options'])) {
foreach ($hookmanager->resArray['options'] as $option) foreach ($hookmanager->resArray['options'] as $format => $option)
{ {
echo '<!-- Option by hook -->'; if ($format == 'div') {
echo $option; echo '<!-- Option by hook -->';
echo $option;
}
} }
} }
?> ?>

View File

@ -34,6 +34,23 @@ print '<head>
print '<!-- Includes for JQuery (Ajax library) -->'."\n"; print '<!-- Includes for JQuery (Ajax library) -->'."\n";
if (constant('JS_JQUERY_UI')) print '<link rel="stylesheet" type="text/css" href="'.JS_JQUERY_UI.'css/'.$jquerytheme.'/jquery-ui.min.css" />'."\n"; // JQuery if (constant('JS_JQUERY_UI')) print '<link rel="stylesheet" type="text/css" href="'.JS_JQUERY_UI.'css/'.$jquerytheme.'/jquery-ui.min.css" />'."\n"; // JQuery
else print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui-latest.custom.css" />'."\n"; // JQuery else print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui-latest.custom.css" />'."\n"; // JQuery
// CSS forced by modules (relative url starting with /)
if (isset($conf->modules_parts['css']))
{
$arraycss=(array) $conf->modules_parts['css'];
foreach($arraycss as $modcss => $filescss)
{
$filescss=(array) $filescss; // To be sure filecss is an array
foreach($filescss as $cssfile)
{
// cssfile is a relative path
print '<link rel="stylesheet" type="text/css" title="default" href="'.dol_buildpath($cssfile,1);
// We add params only if page is not static, because some web server setup does not return content type text/css if url has parameters, so browser cache is not used.
if (!preg_match('/\.css$/i',$cssfile)) print $themeparam;
print '"><!-- Added by module '.$modcss. '-->'."\n";
}
}
}
// JQuery. Must be before other includes // JQuery. Must be before other includes
$ext='.js'; $ext='.js';
if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x01)) $ext='.jgz'; if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x01)) $ext='.jgz';
@ -59,14 +76,19 @@ print '<!-- HTTP_USER_AGENT = '.$_SERVER['HTTP_USER_AGENT'].' -->
</div> </div>
<div id="parameterBox"> <div id="parameterBox">
<div id="logBox"><strong><label for="username"><?php echo $langs->trans('Login'); ?></label></strong><input type="text" <?php echo $disabled; ?> id="username" name="username" class="flat" size="15" maxlength="25" value="<?php echo $login; ?>" tabindex="1" /></div> <div id="logBox">
<strong><label for="username"><?php echo $langs->trans('Login'); ?></label></strong>
<input type="text" <?php echo $disabled; ?> id="username" name="username" class="flat" size="15" maxlength="25" value="<?php echo $login; ?>" tabindex="1" />
</div>
<?php <?php
if (! empty($hookmanager->resArray['options'])) { if (! empty($hookmanager->resArray['options'])) {
foreach ($hookmanager->resArray['options'] as $option) foreach ($hookmanager->resArray['options'] as $format => $option)
{ {
echo '<!-- Option by hook -->'; if ($format == 'div') {
echo $option; echo '<!-- Option by hook -->';
echo $option;
}
} }
} }
?> ?>

View File

@ -176,6 +176,9 @@ else
$conf->css = "/theme/".$conf->theme."/style.css.php?lang=".$langs->defaultlang; $conf->css = "/theme/".$conf->theme."/style.css.php?lang=".$langs->defaultlang;
$conf_css = DOL_URL_ROOT.$conf->css; $conf_css = DOL_URL_ROOT.$conf->css;
$jquerytheme = 'smoothness';
if (! empty($conf->global->MAIN_USE_JQUERY_THEME)) $jquerytheme = $conf->global->MAIN_USE_JQUERY_THEME;
if (file_exists(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/img/login_background.png')) if (file_exists(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/img/login_background.png'))
{ {
$login_background = DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/login_background.png'; $login_background = DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/login_background.png';
@ -199,25 +202,27 @@ $rowspan=2;
$urllogo=DOL_URL_ROOT.'/theme/login_logo.png'; $urllogo=DOL_URL_ROOT.'/theme/login_logo.png';
if (! empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) if (! empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small))
{ {
$urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&amp;modulepart=companylogo&amp;file='.urlencode('thumbs/'.$mysoc->logo_small); $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&amp;modulepart=companylogo&amp;file='.urlencode('thumbs/'.$mysoc->logo_small);
} }
elseif (! empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) elseif (! empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo))
{ {
$urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&amp;modulepart=companylogo&amp;file='.urlencode($mysoc->logo); $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&amp;modulepart=companylogo&amp;file='.urlencode($mysoc->logo);
$width=128; $width=128;
}elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/img/dolibarr_logo.png')) }
{ elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/img/dolibarr_logo.png'))
$urllogo=DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/dolibarr_logo.png'; {
}elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.png')) $urllogo=DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/dolibarr_logo.png';
{ }
$urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo.png'; elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.png'))
{
$urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo.png';
} }
// Security graphical code // Security graphical code
if (function_exists("imagecreatefrompng") && ! $disabled) if (function_exists("imagecreatefrompng") && ! $disabled)
{ {
$captcha = 1; $captcha = 1;
$captcha_refresh = img_picto($langs->trans("Refresh"),'refresh','id="captcha_refresh_img"'); $captcha_refresh = img_picto($langs->trans("Refresh"),'refresh','id="captcha_refresh_img"');
} }
// Execute hook getPasswordForgottenPageOptions // Execute hook getPasswordForgottenPageOptions