diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index b0654b0567d..5a1a1e4bd66 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -834,7 +834,7 @@ if ($id > 0) if (! empty($conf->commande->enabled)) { - if($orders2invoice > 0) print '
'; + if (! empty($orders2invoice) && $orders2invoice > 0) print ''; else print ''; } diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index ccd8ed36c79..aa7339cb7ca 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -46,7 +46,8 @@ function societe_prepare_head($object) if ($object->client==1 || $object->client==2 || $object->client==3) { $head[$h][0] = DOL_URL_ROOT.'/comm/fiche.php?socid='.$object->id; - if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && ($object->client==2 || $object->client==3)) $head[$h][1] = $langs->trans("Prospect"); + $head[$h][1]=''; + if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && ($object->client==2 || $object->client==3)) $head[$h][1] .= $langs->trans("Prospect"); if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && $object->client==3) $head[$h][1] .= '/'; if (empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && ($object->client==1 || $object->client==3)) $head[$h][1] .= $langs->trans("Customer"); $head[$h][2] = 'customer'; diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 2ad1d1f7bb2..90caed4b8b4 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -19,7 +19,7 @@ header('Cache-Control: Public, must-revalidate'); header("Content-type: text/html; charset=".$conf->file->character_set_client); -if (GETPOST('dol_hide_topmenu')) $conf->dol_use_jmobile=1; +if (GETPOST('dol_hide_topmenu')) $conf->dol_hide_topmenu=1; if (GETPOST('dol_hide_leftmenu')) $conf->dol_hide_leftmenu=1; if (GETPOST('dol_optimize_smallscreen')) $conf->dol_optimize_smallscreen=1; if (GETPOST('dol_no_mouse_hover')) $conf->dol_no_mouse_hover=1; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index b82662dcd6e..6e03a9ac2ce 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -345,13 +345,32 @@ if (! defined('NOLOGIN')) // It is not already authenticated and it requests the login / password include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; + $dol_dst_observed=GETPOST("dst_observed",3); + $dol_dst_first=GETPOST("dst_first",3); + $dol_dst_second=GETPOST("dst_second",3); + $dol_screenwidth=GETPOST("screenwidth",3); + $dol_screenheight=GETPOST("screenheight",3); + $dol_hide_topmenu=GETPOST('dol_hide_topmenu',3); + $dol_hide_leftmenu=GETPOST('dol_hide_leftmenu',3); + $dol_optimize_smallscreen=GETPOST('dol_optimize_smallscreen',3); + $dol_no_mouse_hover=GETPOST('dol_no_mouse_hover',3); + $dol_use_jmobile=GETPOST('dol_use_jmobile',3); + //dol_syslog("POST key=".join(array_keys($_POST),',').' value='.join($_POST,',')); + // If in demo mode, we check we go to home page through the public/demo/index.php page if (! empty($dolibarr_main_demo) && $_SERVER['PHP_SELF'] == DOL_URL_ROOT.'/index.php') // We ask index page { if (! preg_match('/public/',$_SERVER['HTTP_REFERER'])) { dol_syslog("Call index page from another url than demo page"); - header("Location: ".DOL_URL_ROOT.'/public/demo/index.php'); + $url=''; + $url.=($url?'&':'').($dol_hide_topmenu?'dol_hide_topmenu='.$dol_hide_topmenu:''); + $url.=($url?'&':'').($dol_hide_leftmenu?'dol_hide_leftmenu='.$dol_hide_leftmenu:''); + $url.=($url?'&':'').($dol_optimize_smallscreen?'dol_optimize_smallscreen='.$dol_optimize_smallscreen:''); + $url.=($url?'&':'').($dol_no_mouse_hover?'dol_no_mouse_hover='.$dol_no_mouse_hover:''); + $url.=($url?'&':'').($dol_use_jmobile?'dol_use_jmobile='.$dol_use_jmobile:''); + $url=DOL_URL_ROOT.'/public/demo/index.php'.($url?'?'.$url:''); + header("Location: ".$url); exit; } } @@ -422,17 +441,6 @@ if (! defined('NOLOGIN')) if ($datenow >= $datefirst && $datenow < $datesecond) $dol_dst=1; } //print $datefirst.'-'.$datesecond.'-'.$datenow; exit; - $dol_dst_observed=$_POST["dst_observed"]; - $dol_dst_first=$_POST["dst_first"]; - $dol_dst_second=$_POST["dst_second"]; - $dol_screenwidth=$_POST["screenwidth"]; - $dol_screenheight=$_POST["screenheight"]; - $dol_hide_topmenu=$_POST['dol_hide_topmenu']; - $dol_hide_leftmenu=$_POST['dol_hide_leftmenu']; - $dol_optimize_smallscreen=$_POST['dol_optimize_smallscreen']; - $dol_no_mouse_hover=$_POST['dol_no_mouse_hover']; - $dol_use_jmobile=$_POST['dol_use_jmobile']; - //dol_syslog("POST key=".join(array_keys($_POST),',').' value='.join($_POST,',')); } if (! $login) @@ -1788,7 +1796,7 @@ if (! function_exists("llxFooter")) print "\n"; if ($foot) print ''."\n"; - printCommonFooter(); + printCommonFooter($foot); if (empty($conf->dol_hide_leftmenu)) print ''; // End div container diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index f4acea385ea..a99366d9a36 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -33,6 +33,12 @@ $langs->load("main"); $langs->load("install"); $langs->load("other"); +$conf->dol_hide_topmenu=GETPOST('dol_hide_topmenu'); +$conf->dol_hide_leftmenu=GETPOST('dol_hide_leftmenu'); +$conf->dol_optimize_smallscreen=GETPOST('dol_optimize_smallscreen'); +$conf->dol_no_mouse_hover=GETPOST('dol_no_mouse_hover'); +$conf->dol_use_jmobile=GETPOST('dol_use_jmobile'); + // Security check global $dolibarr_main_demo; if (empty($dolibarr_main_demo)) accessforbidden('Parameter dolibarr_main_demo must be defined in conf file with value "default login,default pass" to enable the demo entry page',1,1,1); @@ -217,13 +223,19 @@ if (GETPOST("action") == 'gotodemo') $disablestring.=$modulekeyname.','; if ($modulekeyname=='propale') $disablestring.='propal,'; } - } // Do redirect to login page if ($disablestring) { - $url=DOL_URL_ROOT.'/index.php?'.(GETPOST('urlfrom','alpha')?'urlfrom='.urlencode(GETPOST('urlfrom','alpha')).'&':'').'disablemodules='.$disablestring; + $url=''; + $url.=($url?'&':'').($conf->dol_hide_topmenu?'dol_hide_topmenu='.$conf->dol_hide_topmenu:''); + $url.=($url?'&':'').($conf->dol_hide_leftmenu?'dol_hide_leftmenu='.$conf->dol_hide_leftmenu:''); + $url.=($url?'&':'').($conf->dol_optimize_smallscreen?'dol_optimize_smallscreen='.$conf->dol_optimize_smallscreen:''); + $url.=($url?'&':'').($conf->dol_no_mouse_hover?'dol_no_mouse_hover='.$conf->dol_no_mouse_hover:''); + $url.=($url?'&':'').($conf->dol_use_jmobile?'dol_use_jmobile='.$conf->dol_use_jmobile:''); + if (GETPOST('urlfrom')) $url.=($url?'&':'').'urlfrom='.urlencode(GETPOST('urlfrom','alpha')); + $url=DOL_URL_ROOT.'/index.php?'.($url?$url.'&':'').'disablemodules='.$disablestring; header("Location: ".$url); exit; } @@ -234,34 +246,64 @@ if (GETPOST("action") == 'gotodemo') * View */ -llxHeaderVierge($langs->trans("DolibarrDemo")); +$head=''; +$head.=''."\n"; +$head.=''."\n"; +$head.=' -?> - - +var openedId=""; +jQuery(document).ready(function () { +jQuery("tr.moduleline").hide(); +// Enable this to allow personalized setup +jQuery(".modulelineshow").attr("href","#"); +jQuery(".cursorpointer").css("cursor","pointer"); +jQuery(".modulelineshow").click(function() { +var idstring=$(this).attr("id"); +if (typeof idstring != "undefined") +{ +var currentId = idstring.substring(2); +jQuery("tr.moduleline").hide(); +if (currentId != openedId) +{ +openedId=currentId; +jQuery("#tr1"+currentId).show(); +jQuery("#tr2"+currentId).show(); +} +else openedId = ""; +} +}); +}); +'; + +llxHeaderVierge($langs->trans("DolibarrDemo"), $head); print "\n"; @@ -305,6 +347,11 @@ foreach ($demoprofiles as $profilearray) print ''."\n"; print ''."\n"; print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; print '