From 3e807b00ba9dd3e998176b85b10f5bbe81bf2f87 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 20 Mar 2020 21:16:52 +0100 Subject: [PATCH] FIX Look and feel v11 --- htdocs/opensurvey/fonctions.php | 69 +++++++++++++++++++----- htdocs/opensurvey/results.php | 2 +- htdocs/opensurvey/wizard/choix_autre.php | 2 +- htdocs/public/opensurvey/studs.php | 7 ++- 4 files changed, 60 insertions(+), 20 deletions(-) diff --git a/htdocs/opensurvey/fonctions.php b/htdocs/opensurvey/fonctions.php index 69dd0d4e0a7..22cd78ae8d7 100644 --- a/htdocs/opensurvey/fonctions.php +++ b/htdocs/opensurvey/fonctions.php @@ -67,31 +67,70 @@ function opensurvey_prepare_head(Opensurveysondage $object) * @param int $disablehead More content into html header * @param array $arrayofjs Array of complementary js files * @param array $arrayofcss Array of complementary css files + * @param string $numsondage Num survey * @return void */ -function llxHeaderSurvey($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '') +function llxHeaderSurvey($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $numsondage = '') { - global $conf, $mysoc; + global $conf, $langs, $mysoc; + global $dolibarr_main_url_root; + + //$replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
' : '').'
'; top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers - print ''; + print ''; - // Print logo - if ($mysoc->logo) { - if (file_exists($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); - } - } - if (!$urllogo && (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.png'))) + + print ''."\n"; + print '
'."\n"; + print '
'."\n"; + print ''; + print ''."\n"; + print "\n"; + + + // Show logo (search order: logo defined by PAYMENT_LOGO_suffix, then PAYMENT_LOGO, then small company logo, large company logo, theme logo, common logo) + $width = 0; + // Define logo and logosmall + $logosmall = $mysoc->logo_small; + $logo = $mysoc->logo; + $paramlogo = 'ONLINE_PAYMENT_LOGO_'.$suffix; + if (!empty($conf->global->$paramlogo)) $logosmall = $conf->global->$paramlogo; + elseif (!empty($conf->global->ONLINE_PAYMENT_LOGO)) $logosmall = $conf->global->ONLINE_PAYMENT_LOGO; + //print ''."\n"; + // Define urllogo + $urllogo = ''; + $urllogofull = ''; + if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall)) { - $urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo.png'; + $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); + $width = 150; + } + 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); + $width = 150; } - print '
Logo
'; - print '
'; + // Output html code for logo + if ($urllogo) + { + print '
'; + print '
'; + print ''; + print '
'; + if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { + print ''; + } + print '
'; + } - print '
'; + print '

'; } /** @@ -102,6 +141,8 @@ function llxHeaderSurvey($title, $head = "", $disablejs = 0, $disablehead = 0, $ function llxFooterSurvey() { print '
'; + print ''; + print '
'; printCommonFooter('public'); diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php index a9b726a646b..beed90e3fdd 100644 --- a/htdocs/opensurvey/results.php +++ b/htdocs/opensurvey/results.php @@ -1093,6 +1093,6 @@ print ''."\n"; print ''."\n"; -llxFooterSurvey(); +llxFooter(); $db->close(); diff --git a/htdocs/opensurvey/wizard/choix_autre.php b/htdocs/opensurvey/wizard/choix_autre.php index cb3ed346a52..7a31e21c843 100644 --- a/htdocs/opensurvey/wizard/choix_autre.php +++ b/htdocs/opensurvey/wizard/choix_autre.php @@ -110,7 +110,7 @@ llxHeader('', $langs->trans("OpenSurvey"), "", '', 0, 0, $arrayofjs, $arrayofcss if (empty($_SESSION['titre'])) { dol_print_error('', $langs->trans('ErrorOpenSurveyFillFirstSection')); - llxFooterSurvey(); + llxFooter(); exit; } diff --git a/htdocs/public/opensurvey/studs.php b/htdocs/public/opensurvey/studs.php index ab011dd219a..c9697e2e1e4 100644 --- a/htdocs/public/opensurvey/studs.php +++ b/htdocs/public/opensurvey/studs.php @@ -250,7 +250,8 @@ $form = new Form($db); $arrayofjs = array(); $arrayofcss = array('/opensurvey/css/style.css'); -llxHeaderSurvey($object->titre, "", 0, 0, $arrayofjs, $arrayofcss); + +llxHeaderSurvey($object->titre, "", 0, 0, $arrayofjs, $arrayofcss, $numsondage); if (empty($object->ref)) // For survey, id is a hex string { @@ -274,6 +275,7 @@ foreach ($toutsujet as $value) $toutsujet = str_replace("°", "'", $toutsujet); + print '
'.$langs->trans("YouAreInivitedToVote").'
'; print $langs->trans("OpenSurveyHowTo").'

'; @@ -301,9 +303,6 @@ if (!$canbemodified) { exit; } -print '
'."\n"; -print ''; - print '
'."\n"; print '

'."\n";